@serendie/ui 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CheckBox/CheckBox.js +36 -35
- package/dist/components/ChoiceBox/ChoiceBox.js +41 -41
- package/dist/components/DataTable/DataTableComponent.d.ts +3 -20
- package/dist/components/DataTable/DataTableComponent.js +38 -36
- package/dist/components/DataTable/table/HeaderCheckbox.js +29 -19
- package/dist/components/Search/Search.d.ts +3 -1
- package/dist/components/Search/Search.js +34 -33
- package/dist/components/Select/Select.d.ts +2 -1
- package/dist/components/Select/Select.js +47 -41
- package/dist/components/Tooltip/Tooltip.d.ts +14 -0
- package/dist/components/Tooltip/Tooltip.js +70 -0
- package/dist/components/Tooltip/index.d.ts +1 -0
- package/dist/components/Tooltip/index.js +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +12 -10
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-content.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-indicator.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-trigger.js +10 -12
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item.js +16 -16
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/use-accordion.js +13 -20
- package/dist/node_modules/@ark-ui/react/dist/components/avatar/avatar-root.js +1 -5
- package/dist/node_modules/@ark-ui/react/dist/components/avatar/use-avatar.js +14 -18
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-hidden-input.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox.js +22 -28
- package/dist/node_modules/@ark-ui/react/dist/components/collapsible/collapsible-content.js +7 -9
- package/dist/node_modules/@ark-ui/react/dist/components/collapsible/use-collapsible.js +14 -21
- package/dist/node_modules/@ark-ui/react/dist/components/collection/list-collection.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-content.js +9 -8
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-item-group.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-positioner.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-root.js +17 -18
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-trigger.js +10 -9
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/use-combobox-item-context.js +5 -7
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/use-combobox.js +21 -45
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-backdrop.js +10 -9
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-close-trigger.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-content.js +6 -5
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-description.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/use-dialog.js +13 -22
- package/dist/node_modules/@ark-ui/react/dist/components/factory.js +26 -24
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-content.js +9 -8
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item-group.js +1 -3
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item.js +15 -13
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-root.js +13 -14
- package/dist/node_modules/@ark-ui/react/dist/components/menu/use-menu-option-item-props-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/menu/use-menu.js +14 -21
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-ellipsis.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-next-trigger.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-prev-trigger.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-root.js +5 -4
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/use-pagination.js +13 -19
- package/dist/node_modules/@ark-ui/react/dist/components/portal/portal.js +25 -16
- package/dist/node_modules/@ark-ui/react/dist/components/presence/split-presence-props.js +3 -2
- package/dist/node_modules/@ark-ui/react/dist/components/presence/use-presence.js +18 -18
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-control.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-text.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item.js +1 -5
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/use-radio-group.js +14 -22
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-content.js +9 -8
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-root.js +11 -12
- package/dist/node_modules/@ark-ui/react/dist/components/select/use-select.js +20 -47
- package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-hidden-input.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/switch/use-switch.js +20 -26
- package/dist/node_modules/@ark-ui/react/dist/components/tabs/tabs-root.js +9 -8
- package/dist/node_modules/@ark-ui/react/dist/components/tabs/use-tabs.js +14 -21
- package/dist/node_modules/@ark-ui/react/dist/components/toast/create-toaster.js +3 -7
- package/dist/node_modules/@ark-ui/react/dist/components/toast/toaster.js +28 -15
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-arrow-tip.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-arrow.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-content.js +15 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-positioner.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-root.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-trigger.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/use-tooltip-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/use-tooltip.js +17 -0
- package/dist/node_modules/@ark-ui/react/dist/utils/compose-refs.js +13 -7
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +92 -90
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +230 -216
- package/dist/node_modules/@zag-js/accordion/dist/index.js +210 -227
- package/dist/node_modules/@zag-js/aria-hidden/dist/index.js +49 -12
- package/dist/node_modules/@zag-js/avatar/dist/index.js +119 -134
- package/dist/node_modules/@zag-js/checkbox/dist/index.js +196 -197
- package/dist/node_modules/@zag-js/collapsible/dist/index.js +250 -198
- package/dist/node_modules/@zag-js/collection/dist/index.js +172 -179
- package/dist/node_modules/@zag-js/combobox/dist/index.js +1176 -1082
- package/dist/node_modules/@zag-js/core/dist/index.js +77 -496
- package/dist/node_modules/@zag-js/dialog/dist/index.js +243 -270
- package/dist/node_modules/@zag-js/dismissable/dist/index.js +62 -60
- package/dist/node_modules/@zag-js/dom-query/dist/index.js +465 -253
- package/dist/node_modules/@zag-js/focus-trap/dist/index.js +307 -0
- package/dist/node_modules/@zag-js/focus-visible/dist/index.js +48 -47
- package/dist/node_modules/@zag-js/interact-outside/dist/index.js +112 -80
- package/dist/node_modules/@zag-js/menu/dist/index.js +998 -884
- package/dist/node_modules/@zag-js/pagination/dist/index.js +207 -213
- package/dist/node_modules/@zag-js/popper/dist/index.js +130 -129
- package/dist/node_modules/@zag-js/presence/dist/index.js +139 -122
- package/dist/node_modules/@zag-js/radio-group/dist/index.js +297 -302
- package/dist/node_modules/@zag-js/react/dist/index.js +255 -103
- package/dist/node_modules/@zag-js/remove-scroll/dist/index.js +18 -31
- package/dist/node_modules/@zag-js/select/dist/index.js +889 -885
- package/dist/node_modules/@zag-js/store/dist/index.js +98 -137
- package/dist/node_modules/@zag-js/switch/dist/index.js +199 -191
- package/dist/node_modules/@zag-js/tabs/dist/index.js +383 -386
- package/dist/node_modules/@zag-js/toast/dist/index.js +646 -633
- package/dist/node_modules/@zag-js/tooltip/dist/index.js +459 -0
- package/dist/node_modules/@zag-js/types/dist/index.js +6 -6
- package/dist/node_modules/@zag-js/utils/dist/index.js +112 -99
- package/dist/node_modules/proxy-compare/dist/index.js +4 -106
- package/dist/styles.css +1 -1
- package/package.json +5 -5
- package/dist/node_modules/@ark-ui/react/dist/utils/use-is-server.js +0 -10
- package/dist/node_modules/@zag-js/dom-event/dist/index.js +0 -130
- package/dist/node_modules/@zag-js/element-rect/dist/index.js +0 -32
- package/dist/node_modules/@zag-js/form-utils/dist/index.js +0 -51
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +0 -52
- package/dist/node_modules/focus-trap/dist/focus-trap.esm.js +0 -431
- package/dist/node_modules/klona/full/index.js +0 -21
- package/dist/node_modules/tabbable/dist/index.esm.js +0 -202
|
@@ -1,255 +1,254 @@
|
|
|
1
|
-
import { createAnatomy as
|
|
2
|
-
import {
|
|
3
|
-
import { trackFocusVisible as
|
|
4
|
-
import { createMachine as
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
function M(e, d, t) {
|
|
30
|
-
const o = e.context.isDisabled, r = e.context.readOnly, a = !o && e.context.focused, u = !o && e.context.focusVisible, h = e.context.isChecked, k = e.context.isIndeterminate, s = {
|
|
31
|
-
"data-active": c(e.context.active),
|
|
32
|
-
"data-focus": c(a),
|
|
33
|
-
"data-focus-visible": c(u),
|
|
34
|
-
"data-readonly": c(r),
|
|
35
|
-
"data-hover": c(e.context.hovered),
|
|
36
|
-
"data-disabled": c(o),
|
|
37
|
-
"data-state": k ? "indeterminate" : e.context.checked ? "checked" : "unchecked",
|
|
38
|
-
"data-invalid": c(e.context.invalid)
|
|
1
|
+
import { createAnatomy as I } from "../../anatomy/dist/index.js";
|
|
2
|
+
import { dispatchInputCheckedEvent as P, setElementChecked as S, trackFormControl as F, trackPress as N, dataAttr as o, visuallyHiddenStyle as D, getEventTarget as O } from "../../dom-query/dist/index.js";
|
|
3
|
+
import { trackFocusVisible as H, isFocusVisible as K } from "../../focus-visible/dist/index.js";
|
|
4
|
+
import { createMachine as R, createGuards as x } from "../../core/dist/index.js";
|
|
5
|
+
import { createProps as G } from "../../types/dist/index.js";
|
|
6
|
+
var L = I("checkbox").parts("root", "label", "control", "indicator"), h = L.build(), y = (e) => {
|
|
7
|
+
var t;
|
|
8
|
+
return ((t = e.ids) == null ? void 0 : t.root) ?? `checkbox:${e.id}`;
|
|
9
|
+
}, b = (e) => {
|
|
10
|
+
var t;
|
|
11
|
+
return ((t = e.ids) == null ? void 0 : t.label) ?? `checkbox:${e.id}:label`;
|
|
12
|
+
}, X = (e) => {
|
|
13
|
+
var t;
|
|
14
|
+
return ((t = e.ids) == null ? void 0 : t.control) ?? `checkbox:${e.id}:control`;
|
|
15
|
+
}, g = (e) => {
|
|
16
|
+
var t;
|
|
17
|
+
return ((t = e.ids) == null ? void 0 : t.hiddenInput) ?? `checkbox:${e.id}:input`;
|
|
18
|
+
}, q = (e) => e.getById(y(e)), l = (e) => e.getById(g(e));
|
|
19
|
+
function J(e, t) {
|
|
20
|
+
const { send: d, context: r, prop: a, computed: C, scope: c } = e, i = a("disabled"), v = a("readOnly"), E = a("invalid"), p = !i && r.get("focused"), V = !i && r.get("focusVisible"), n = C("checked"), k = C("indeterminate"), u = {
|
|
21
|
+
"data-active": o(r.get("active")),
|
|
22
|
+
"data-focus": o(p),
|
|
23
|
+
"data-focus-visible": o(V),
|
|
24
|
+
"data-readonly": o(v),
|
|
25
|
+
"data-hover": o(r.get("hovered")),
|
|
26
|
+
"data-disabled": o(i),
|
|
27
|
+
"data-state": k ? "indeterminate" : n ? "checked" : "unchecked",
|
|
28
|
+
"data-invalid": o(E)
|
|
39
29
|
};
|
|
40
30
|
return {
|
|
41
|
-
checked:
|
|
42
|
-
disabled:
|
|
31
|
+
checked: n,
|
|
32
|
+
disabled: i,
|
|
43
33
|
indeterminate: k,
|
|
44
|
-
focused:
|
|
45
|
-
checkedState:
|
|
46
|
-
setChecked(
|
|
47
|
-
d({ type: "CHECKED.SET", checked:
|
|
34
|
+
focused: p,
|
|
35
|
+
checkedState: n,
|
|
36
|
+
setChecked(s) {
|
|
37
|
+
d({ type: "CHECKED.SET", checked: s, isTrusted: !1 });
|
|
48
38
|
},
|
|
49
39
|
toggleChecked() {
|
|
50
|
-
d({ type: "CHECKED.TOGGLE", checked:
|
|
40
|
+
d({ type: "CHECKED.TOGGLE", checked: n, isTrusted: !1 });
|
|
51
41
|
},
|
|
52
42
|
getRootProps() {
|
|
53
43
|
return t.label({
|
|
54
|
-
...
|
|
55
|
-
...
|
|
56
|
-
dir:
|
|
57
|
-
id:
|
|
58
|
-
htmlFor:
|
|
44
|
+
...h.root.attrs,
|
|
45
|
+
...u,
|
|
46
|
+
dir: a("dir"),
|
|
47
|
+
id: y(c),
|
|
48
|
+
htmlFor: g(c),
|
|
59
49
|
onPointerMove() {
|
|
60
|
-
|
|
50
|
+
i || d({ type: "CONTEXT.SET", context: { hovered: !0 } });
|
|
61
51
|
},
|
|
62
52
|
onPointerLeave() {
|
|
63
|
-
|
|
53
|
+
i || d({ type: "CONTEXT.SET", context: { hovered: !1 } });
|
|
64
54
|
},
|
|
65
|
-
onClick(
|
|
66
|
-
|
|
55
|
+
onClick(s) {
|
|
56
|
+
O(s) === l(c) && s.stopPropagation();
|
|
67
57
|
}
|
|
68
58
|
});
|
|
69
59
|
},
|
|
70
60
|
getLabelProps() {
|
|
71
61
|
return t.element({
|
|
72
|
-
...
|
|
73
|
-
...
|
|
74
|
-
dir:
|
|
75
|
-
id:
|
|
62
|
+
...h.label.attrs,
|
|
63
|
+
...u,
|
|
64
|
+
dir: a("dir"),
|
|
65
|
+
id: b(c)
|
|
76
66
|
});
|
|
77
67
|
},
|
|
78
68
|
getControlProps() {
|
|
79
69
|
return t.element({
|
|
80
|
-
...
|
|
81
|
-
...
|
|
82
|
-
dir:
|
|
83
|
-
id:
|
|
70
|
+
...h.control.attrs,
|
|
71
|
+
...u,
|
|
72
|
+
dir: a("dir"),
|
|
73
|
+
id: X(c),
|
|
84
74
|
"aria-hidden": !0
|
|
85
75
|
});
|
|
86
76
|
},
|
|
87
77
|
getIndicatorProps() {
|
|
88
78
|
return t.element({
|
|
89
|
-
...
|
|
90
|
-
...
|
|
91
|
-
dir:
|
|
92
|
-
hidden: !k && !
|
|
79
|
+
...h.indicator.attrs,
|
|
80
|
+
...u,
|
|
81
|
+
dir: a("dir"),
|
|
82
|
+
hidden: !k && !n
|
|
93
83
|
});
|
|
94
84
|
},
|
|
95
85
|
getHiddenInputProps() {
|
|
96
86
|
return t.input({
|
|
97
|
-
id:
|
|
87
|
+
id: g(c),
|
|
98
88
|
type: "checkbox",
|
|
99
|
-
required:
|
|
100
|
-
defaultChecked:
|
|
101
|
-
disabled:
|
|
102
|
-
"aria-labelledby":
|
|
103
|
-
"aria-invalid":
|
|
104
|
-
name:
|
|
105
|
-
form:
|
|
106
|
-
value:
|
|
107
|
-
style:
|
|
89
|
+
required: a("required"),
|
|
90
|
+
defaultChecked: n,
|
|
91
|
+
disabled: i,
|
|
92
|
+
"aria-labelledby": b(c),
|
|
93
|
+
"aria-invalid": E,
|
|
94
|
+
name: a("name"),
|
|
95
|
+
form: a("form"),
|
|
96
|
+
value: a("value"),
|
|
97
|
+
style: D,
|
|
108
98
|
onFocus() {
|
|
109
|
-
const
|
|
110
|
-
d({ type: "CONTEXT.SET", context: { focused: !0, focusVisible:
|
|
99
|
+
const s = K();
|
|
100
|
+
d({ type: "CONTEXT.SET", context: { focused: !0, focusVisible: s } });
|
|
111
101
|
},
|
|
112
102
|
onBlur() {
|
|
113
103
|
d({ type: "CONTEXT.SET", context: { focused: !1, focusVisible: !1 } });
|
|
114
104
|
},
|
|
115
|
-
onClick(
|
|
116
|
-
if (
|
|
117
|
-
|
|
105
|
+
onClick(s) {
|
|
106
|
+
if (v) {
|
|
107
|
+
s.preventDefault();
|
|
118
108
|
return;
|
|
119
109
|
}
|
|
120
|
-
const
|
|
121
|
-
d({ type: "CHECKED.SET", checked:
|
|
110
|
+
const m = s.currentTarget.checked;
|
|
111
|
+
d({ type: "CHECKED.SET", checked: m, isTrusted: !0 });
|
|
122
112
|
}
|
|
123
113
|
});
|
|
124
114
|
}
|
|
125
115
|
};
|
|
126
116
|
}
|
|
127
|
-
var { not:
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
117
|
+
var { not: T } = x(), Q = R({
|
|
118
|
+
props({ props: e }) {
|
|
119
|
+
return {
|
|
120
|
+
value: "on",
|
|
121
|
+
...e,
|
|
122
|
+
defaultChecked: !!e.defaultChecked
|
|
123
|
+
};
|
|
124
|
+
},
|
|
125
|
+
initialState() {
|
|
126
|
+
return "ready";
|
|
127
|
+
},
|
|
128
|
+
context({ prop: e, bindable: t }) {
|
|
129
|
+
return {
|
|
130
|
+
checked: t(() => ({
|
|
131
|
+
defaultValue: e("defaultChecked"),
|
|
132
|
+
value: e("checked"),
|
|
133
|
+
onChange(d) {
|
|
134
|
+
var r;
|
|
135
|
+
(r = e("onCheckedChange")) == null || r({ checked: d });
|
|
136
|
+
}
|
|
137
|
+
})),
|
|
138
|
+
fieldsetDisabled: t(() => ({ defaultValue: !1 })),
|
|
139
|
+
focusVisible: t(() => ({ defaultValue: !1 })),
|
|
140
|
+
active: t(() => ({ defaultValue: !1 })),
|
|
141
|
+
focused: t(() => ({ defaultValue: !1 })),
|
|
142
|
+
hovered: t(() => ({ defaultValue: !1 }))
|
|
143
|
+
};
|
|
144
|
+
},
|
|
145
|
+
watch({ track: e, context: t, prop: d, action: r }) {
|
|
146
|
+
e([() => d("disabled")], () => {
|
|
147
|
+
r(["removeFocusIfNeeded"]);
|
|
148
|
+
}), e([() => t.get("checked")], () => {
|
|
149
|
+
r(["syncInputElement"]);
|
|
150
|
+
});
|
|
151
|
+
},
|
|
152
|
+
effects: ["trackFormControlState", "trackPressEvent", "trackFocusVisible"],
|
|
153
|
+
on: {
|
|
154
|
+
"CHECKED.TOGGLE": [
|
|
155
|
+
{
|
|
156
|
+
guard: T("isTrusted"),
|
|
157
|
+
actions: ["toggleChecked", "dispatchChangeEvent"]
|
|
141
158
|
},
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
159
|
+
{
|
|
160
|
+
actions: ["toggleChecked"]
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
"CHECKED.SET": [
|
|
164
|
+
{
|
|
165
|
+
guard: T("isTrusted"),
|
|
166
|
+
actions: ["setChecked", "dispatchChangeEvent"]
|
|
145
167
|
},
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
168
|
+
{
|
|
169
|
+
actions: ["setChecked"]
|
|
170
|
+
}
|
|
171
|
+
],
|
|
172
|
+
"CONTEXT.SET": {
|
|
173
|
+
actions: ["setContext"]
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
computed: {
|
|
177
|
+
indeterminate: ({ context: e }) => f(e.get("checked")),
|
|
178
|
+
checked: ({ context: e }) => $(e.get("checked")),
|
|
179
|
+
disabled: ({ context: e, prop: t }) => !!t("disabled") || e.get("fieldsetDisabled")
|
|
180
|
+
},
|
|
181
|
+
states: {
|
|
182
|
+
ready: {}
|
|
183
|
+
},
|
|
184
|
+
implementations: {
|
|
185
|
+
guards: {
|
|
186
|
+
isTrusted: ({ event: e }) => !!e.isTrusted
|
|
187
|
+
},
|
|
188
|
+
effects: {
|
|
189
|
+
trackPressEvent({ context: e, computed: t, scope: d }) {
|
|
190
|
+
if (!t("disabled"))
|
|
191
|
+
return N({
|
|
192
|
+
pointerNode: q(d),
|
|
193
|
+
keyboardNode: l(d),
|
|
194
|
+
isValidKey: (r) => r.key === " ",
|
|
195
|
+
onPress: () => e.set("active", !1),
|
|
196
|
+
onPressStart: () => e.set("active", !0),
|
|
197
|
+
onPressEnd: () => e.set("active", !1)
|
|
198
|
+
});
|
|
169
199
|
},
|
|
170
|
-
computed: {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
200
|
+
trackFocusVisible({ computed: e, scope: t }) {
|
|
201
|
+
var d;
|
|
202
|
+
if (!e("disabled"))
|
|
203
|
+
return H({ root: (d = t.getRootNode) == null ? void 0 : d.call(t) });
|
|
174
204
|
},
|
|
175
|
-
|
|
176
|
-
|
|
205
|
+
trackFormControlState({ context: e, scope: t }) {
|
|
206
|
+
return F(l(t), {
|
|
207
|
+
onFieldsetDisabledChange(d) {
|
|
208
|
+
e.set("fieldsetDisabled", d);
|
|
209
|
+
},
|
|
210
|
+
onFormReset() {
|
|
211
|
+
e.set("checked", e.initial("checked"));
|
|
212
|
+
}
|
|
213
|
+
});
|
|
177
214
|
}
|
|
178
215
|
},
|
|
179
|
-
{
|
|
180
|
-
|
|
181
|
-
|
|
216
|
+
actions: {
|
|
217
|
+
setContext({ context: e, event: t }) {
|
|
218
|
+
for (const d in t.context)
|
|
219
|
+
e.set(d, t.context[d]);
|
|
182
220
|
},
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
return x({
|
|
187
|
-
pointerNode: n.getRootEl(t),
|
|
188
|
-
keyboardNode: n.getHiddenInputEl(t),
|
|
189
|
-
isValidKey: (o) => o.key === " ",
|
|
190
|
-
onPress: () => t.active = !1,
|
|
191
|
-
onPressStart: () => t.active = !0,
|
|
192
|
-
onPressEnd: () => t.active = !1
|
|
193
|
-
});
|
|
194
|
-
},
|
|
195
|
-
trackFocusVisible(t) {
|
|
196
|
-
if (!t.isDisabled)
|
|
197
|
-
return I({ root: n.getRootNode(t) });
|
|
198
|
-
},
|
|
199
|
-
trackFormControlState(t, o, { send: r, initialContext: a }) {
|
|
200
|
-
return S(n.getHiddenInputEl(t), {
|
|
201
|
-
onFieldsetDisabledChange(u) {
|
|
202
|
-
t.fieldsetDisabled = u;
|
|
203
|
-
},
|
|
204
|
-
onFormReset() {
|
|
205
|
-
r({ type: "CHECKED.SET", checked: !!a.checked });
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
}
|
|
221
|
+
syncInputElement({ context: e, computed: t, scope: d }) {
|
|
222
|
+
const r = l(d);
|
|
223
|
+
r && (S(r, t("checked")), r.indeterminate = f(e.get("checked")));
|
|
209
224
|
},
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
const o = f(t.checked) ? !0 : !t.checked;
|
|
226
|
-
C.checked(t, o);
|
|
227
|
-
},
|
|
228
|
-
dispatchChangeEvent(t) {
|
|
229
|
-
const o = n.getHiddenInputEl(t);
|
|
230
|
-
D(o, { checked: g(t.checked) });
|
|
231
|
-
}
|
|
225
|
+
removeFocusIfNeeded({ context: e, prop: t }) {
|
|
226
|
+
t("disabled") && e.get("focused") && (e.set("focused", !1), e.set("focusVisible", !1));
|
|
227
|
+
},
|
|
228
|
+
setChecked({ context: e, event: t }) {
|
|
229
|
+
e.set("checked", t.checked);
|
|
230
|
+
},
|
|
231
|
+
toggleChecked({ context: e, computed: t }) {
|
|
232
|
+
const d = f(t("checked")) ? !0 : !t("checked");
|
|
233
|
+
e.set("checked", d);
|
|
234
|
+
},
|
|
235
|
+
dispatchChangeEvent({ computed: e, scope: t }) {
|
|
236
|
+
queueMicrotask(() => {
|
|
237
|
+
const d = l(t);
|
|
238
|
+
P(d, { checked: e("checked") });
|
|
239
|
+
});
|
|
232
240
|
}
|
|
233
241
|
}
|
|
234
|
-
|
|
235
|
-
}
|
|
242
|
+
}
|
|
243
|
+
});
|
|
236
244
|
function f(e) {
|
|
237
245
|
return e === "indeterminate";
|
|
238
246
|
}
|
|
239
|
-
function
|
|
247
|
+
function $(e) {
|
|
240
248
|
return f(e) ? !1 : !!e;
|
|
241
249
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
var d;
|
|
245
|
-
(d = e.onCheckedChange) == null || d.call(e, { checked: e.checked });
|
|
246
|
-
}
|
|
247
|
-
}, C = {
|
|
248
|
-
checked: (e, d) => {
|
|
249
|
-
V(e.checked, d) || (e.checked = d, R.change(e));
|
|
250
|
-
}
|
|
251
|
-
};
|
|
252
|
-
N()([
|
|
250
|
+
G()([
|
|
251
|
+
"defaultChecked",
|
|
253
252
|
"checked",
|
|
254
253
|
"dir",
|
|
255
254
|
"disabled",
|
|
@@ -265,7 +264,7 @@ N()([
|
|
|
265
264
|
"value"
|
|
266
265
|
]);
|
|
267
266
|
export {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
267
|
+
L as anatomy,
|
|
268
|
+
J as connect,
|
|
269
|
+
Q as machine
|
|
271
270
|
};
|