add input indeterminate accessor

This commit is contained in:
Karl Seguin
2026-01-07 07:35:24 +08:00
parent d8f7eb3f24
commit c9d0e2097d

View File

@@ -76,6 +76,7 @@ _checked: bool = false,
_checked_dirty: bool = false,
_input_type: Type = .text,
_selected: bool = false,
_indeterminate: bool = false,
pub fn asElement(self: *Input) *Element {
return self._proto._proto;
@@ -129,6 +130,14 @@ pub fn setChecked(self: *Input, checked: bool, page: *Page) !void {
self._checked_dirty = true;
}
pub fn getIndeterminate(self: *const Input) bool {
return self._indeterminate;
}
pub fn setIndeterminate(self: *Input, value: bool) !void {
self._indeterminate = value;
}
pub fn getDefaultChecked(self: *const Input) bool {
return self._default_checked;
}
@@ -342,6 +351,7 @@ pub const JsApi = struct {
pub const size = bridge.accessor(Input.getSize, Input.setSize, .{});
pub const src = bridge.accessor(Input.getSrc, Input.setSrc, .{});
pub const form = bridge.accessor(Input.getForm, null, .{});
pub const indeterminate = bridge.accessor(Input.getIndeterminate, Input.setIndeterminate, .{});
pub const select = bridge.function(Input.select, .{});
};
@@ -414,6 +424,7 @@ pub const Build = struct {
clone._checked = source._checked;
clone._checked_dirty = source._checked_dirty;
clone._selected = source._selected;
clone._indeterminate = source._indeterminate;
}
};