@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,251 +1,259 @@
|
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
});
|
|
33
|
-
function $(e, d, t) {
|
|
34
|
-
const o = e.context.isDisabled, s = e.context.readOnly, c = e.context.checked, a = !o && e.context.focused, p = !o && e.context.focusVisible, l = {
|
|
35
|
-
"data-active": n(e.context.active),
|
|
36
|
-
"data-focus": n(a),
|
|
37
|
-
"data-focus-visible": n(p),
|
|
38
|
-
"data-readonly": n(s),
|
|
39
|
-
"data-hover": n(e.context.hovered),
|
|
40
|
-
"data-disabled": n(o),
|
|
41
|
-
"data-state": e.context.checked ? "checked" : "unchecked",
|
|
42
|
-
"data-invalid": n(e.context.invalid)
|
|
1
|
+
import { createAnatomy as T } from "../../anatomy/dist/index.js";
|
|
2
|
+
import { dispatchInputCheckedEvent as y, setElementChecked as V, trackFormControl as I, trackPress as P, dataAttr as c, visuallyHiddenStyle as S, getEventTarget as D, isSafari as F } from "../../dom-query/dist/index.js";
|
|
3
|
+
import { trackFocusVisible as N, isFocusVisible as H } from "../../focus-visible/dist/index.js";
|
|
4
|
+
import { createMachine as O, createGuards as w } from "../../core/dist/index.js";
|
|
5
|
+
import { createProps as K } from "../../types/dist/index.js";
|
|
6
|
+
var R = T("switch").parts("root", "label", "control", "thumb"), h = R.build(), m = (e) => {
|
|
7
|
+
var t;
|
|
8
|
+
return ((t = e.ids) == null ? void 0 : t.root) ?? `switch:${e.id}`;
|
|
9
|
+
}, v = (e) => {
|
|
10
|
+
var t;
|
|
11
|
+
return ((t = e.ids) == null ? void 0 : t.label) ?? `switch:${e.id}:label`;
|
|
12
|
+
}, G = (e) => {
|
|
13
|
+
var t;
|
|
14
|
+
return ((t = e.ids) == null ? void 0 : t.thumb) ?? `switch:${e.id}:thumb`;
|
|
15
|
+
}, L = (e) => {
|
|
16
|
+
var t;
|
|
17
|
+
return ((t = e.ids) == null ? void 0 : t.control) ?? `switch:${e.id}:control`;
|
|
18
|
+
}, f = (e) => {
|
|
19
|
+
var t;
|
|
20
|
+
return ((t = e.ids) == null ? void 0 : t.hiddenInput) ?? `switch:${e.id}:input`;
|
|
21
|
+
}, X = (e) => e.getById(m(e)), n = (e) => e.getById(f(e));
|
|
22
|
+
function x(e, t) {
|
|
23
|
+
const { context: s, send: d, prop: r, scope: a } = e, o = r("disabled"), k = r("readOnly"), l = !!s.get("checked"), g = !o && s.get("focused"), b = !o && s.get("focusVisible"), u = {
|
|
24
|
+
"data-active": c(s.get("active")),
|
|
25
|
+
"data-focus": c(g),
|
|
26
|
+
"data-focus-visible": c(b),
|
|
27
|
+
"data-readonly": c(k),
|
|
28
|
+
"data-hover": c(s.get("hovered")),
|
|
29
|
+
"data-disabled": c(o),
|
|
30
|
+
"data-state": l ? "checked" : "unchecked",
|
|
31
|
+
"data-invalid": c(r("invalid"))
|
|
43
32
|
};
|
|
44
33
|
return {
|
|
45
|
-
checked:
|
|
34
|
+
checked: l,
|
|
46
35
|
disabled: o,
|
|
47
|
-
focused:
|
|
48
|
-
setChecked(
|
|
49
|
-
d({ type: "CHECKED.SET", checked:
|
|
36
|
+
focused: g,
|
|
37
|
+
setChecked(i) {
|
|
38
|
+
d({ type: "CHECKED.SET", checked: i, isTrusted: !1 });
|
|
50
39
|
},
|
|
51
40
|
toggleChecked() {
|
|
52
|
-
d({ type: "CHECKED.TOGGLE", checked:
|
|
41
|
+
d({ type: "CHECKED.TOGGLE", checked: l, isTrusted: !1 });
|
|
53
42
|
},
|
|
54
43
|
getRootProps() {
|
|
55
44
|
return t.label({
|
|
56
|
-
...
|
|
57
|
-
...
|
|
58
|
-
dir:
|
|
59
|
-
id:
|
|
60
|
-
htmlFor:
|
|
45
|
+
...h.root.attrs,
|
|
46
|
+
...u,
|
|
47
|
+
dir: r("dir"),
|
|
48
|
+
id: m(a),
|
|
49
|
+
htmlFor: f(a),
|
|
61
50
|
onPointerMove() {
|
|
62
51
|
o || d({ type: "CONTEXT.SET", context: { hovered: !0 } });
|
|
63
52
|
},
|
|
64
53
|
onPointerLeave() {
|
|
65
54
|
o || d({ type: "CONTEXT.SET", context: { hovered: !1 } });
|
|
66
55
|
},
|
|
67
|
-
onClick(
|
|
68
|
-
|
|
56
|
+
onClick(i) {
|
|
57
|
+
var p;
|
|
58
|
+
if (o) return;
|
|
59
|
+
D(i) === n(a) && i.stopPropagation(), F() && ((p = n(a)) == null || p.focus());
|
|
69
60
|
}
|
|
70
61
|
});
|
|
71
62
|
},
|
|
72
63
|
getLabelProps() {
|
|
73
64
|
return t.element({
|
|
74
|
-
...
|
|
75
|
-
...
|
|
76
|
-
dir:
|
|
77
|
-
id:
|
|
65
|
+
...h.label.attrs,
|
|
66
|
+
...u,
|
|
67
|
+
dir: r("dir"),
|
|
68
|
+
id: v(a)
|
|
78
69
|
});
|
|
79
70
|
},
|
|
80
71
|
getThumbProps() {
|
|
81
72
|
return t.element({
|
|
82
|
-
...
|
|
83
|
-
...
|
|
84
|
-
dir:
|
|
85
|
-
id:
|
|
73
|
+
...h.thumb.attrs,
|
|
74
|
+
...u,
|
|
75
|
+
dir: r("dir"),
|
|
76
|
+
id: G(a),
|
|
86
77
|
"aria-hidden": !0
|
|
87
78
|
});
|
|
88
79
|
},
|
|
89
80
|
getControlProps() {
|
|
90
81
|
return t.element({
|
|
91
|
-
...
|
|
92
|
-
...
|
|
93
|
-
dir:
|
|
94
|
-
id:
|
|
82
|
+
...h.control.attrs,
|
|
83
|
+
...u,
|
|
84
|
+
dir: r("dir"),
|
|
85
|
+
id: L(a),
|
|
95
86
|
"aria-hidden": !0
|
|
96
87
|
});
|
|
97
88
|
},
|
|
98
89
|
getHiddenInputProps() {
|
|
99
90
|
return t.input({
|
|
100
|
-
id:
|
|
91
|
+
id: f(a),
|
|
101
92
|
type: "checkbox",
|
|
102
|
-
required:
|
|
103
|
-
defaultChecked:
|
|
93
|
+
required: r("required"),
|
|
94
|
+
defaultChecked: l,
|
|
104
95
|
disabled: o,
|
|
105
|
-
"aria-labelledby":
|
|
106
|
-
"aria-invalid":
|
|
107
|
-
name:
|
|
108
|
-
form:
|
|
109
|
-
value:
|
|
110
|
-
style:
|
|
96
|
+
"aria-labelledby": v(a),
|
|
97
|
+
"aria-invalid": r("invalid"),
|
|
98
|
+
name: r("name"),
|
|
99
|
+
form: r("form"),
|
|
100
|
+
value: r("value"),
|
|
101
|
+
style: S,
|
|
111
102
|
onFocus() {
|
|
112
|
-
const
|
|
113
|
-
d({ type: "CONTEXT.SET", context: { focused: !0, focusVisible:
|
|
103
|
+
const i = H();
|
|
104
|
+
d({ type: "CONTEXT.SET", context: { focused: !0, focusVisible: i } });
|
|
114
105
|
},
|
|
115
106
|
onBlur() {
|
|
116
107
|
d({ type: "CONTEXT.SET", context: { focused: !1, focusVisible: !1 } });
|
|
117
108
|
},
|
|
118
|
-
onClick(
|
|
119
|
-
if (
|
|
120
|
-
|
|
109
|
+
onClick(i) {
|
|
110
|
+
if (k) {
|
|
111
|
+
i.preventDefault();
|
|
121
112
|
return;
|
|
122
113
|
}
|
|
123
|
-
const
|
|
124
|
-
d({ type: "CHECKED.SET", checked:
|
|
114
|
+
const C = i.currentTarget.checked;
|
|
115
|
+
d({ type: "CHECKED.SET", checked: C, isTrusted: !0 });
|
|
125
116
|
}
|
|
126
117
|
});
|
|
127
118
|
}
|
|
128
119
|
};
|
|
129
120
|
}
|
|
130
|
-
var { not:
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
121
|
+
var { not: E } = w(), j = O({
|
|
122
|
+
props({ props: e }) {
|
|
123
|
+
return {
|
|
124
|
+
defaultChecked: !1,
|
|
125
|
+
label: "switch",
|
|
126
|
+
value: "on",
|
|
127
|
+
...e
|
|
128
|
+
};
|
|
129
|
+
},
|
|
130
|
+
initialState() {
|
|
131
|
+
return "ready";
|
|
132
|
+
},
|
|
133
|
+
context({ prop: e, bindable: t }) {
|
|
134
|
+
return {
|
|
135
|
+
checked: t(() => ({
|
|
136
|
+
defaultValue: e("defaultChecked"),
|
|
137
|
+
value: e("checked"),
|
|
138
|
+
onChange(s) {
|
|
139
|
+
var d;
|
|
140
|
+
(d = e("onCheckedChange")) == null || d({ checked: s });
|
|
141
|
+
}
|
|
142
|
+
})),
|
|
143
|
+
fieldsetDisabled: t(() => ({
|
|
144
|
+
defaultValue: !1
|
|
145
|
+
})),
|
|
146
|
+
focusVisible: t(() => ({
|
|
147
|
+
defaultValue: !1
|
|
148
|
+
})),
|
|
149
|
+
active: t(() => ({
|
|
150
|
+
defaultValue: !1
|
|
151
|
+
})),
|
|
152
|
+
focused: t(() => ({
|
|
153
|
+
defaultValue: !1
|
|
154
|
+
})),
|
|
155
|
+
hovered: t(() => ({
|
|
156
|
+
defaultValue: !1
|
|
157
|
+
}))
|
|
158
|
+
};
|
|
159
|
+
},
|
|
160
|
+
computed: {
|
|
161
|
+
isDisabled: ({ context: e, prop: t }) => t("disabled") || e.get("fieldsetDisabled")
|
|
162
|
+
},
|
|
163
|
+
watch({ track: e, prop: t, context: s, action: d }) {
|
|
164
|
+
e([() => t("disabled")], () => {
|
|
165
|
+
d(["removeFocusIfNeeded"]);
|
|
166
|
+
}), e([() => s.get("checked")], () => {
|
|
167
|
+
d(["syncInputElement"]);
|
|
168
|
+
});
|
|
169
|
+
},
|
|
170
|
+
effects: ["trackFormControlState", "trackPressEvent", "trackFocusVisible"],
|
|
171
|
+
on: {
|
|
172
|
+
"CHECKED.TOGGLE": [
|
|
173
|
+
{
|
|
174
|
+
guard: E("isTrusted"),
|
|
175
|
+
actions: ["toggleChecked", "dispatchChangeEvent"]
|
|
145
176
|
},
|
|
146
|
-
|
|
147
|
-
|
|
177
|
+
{
|
|
178
|
+
actions: ["toggleChecked"]
|
|
179
|
+
}
|
|
180
|
+
],
|
|
181
|
+
"CHECKED.SET": [
|
|
182
|
+
{
|
|
183
|
+
guard: E("isTrusted"),
|
|
184
|
+
actions: ["setChecked", "dispatchChangeEvent"]
|
|
148
185
|
},
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
186
|
+
{
|
|
187
|
+
actions: ["setChecked"]
|
|
188
|
+
}
|
|
189
|
+
],
|
|
190
|
+
"CONTEXT.SET": {
|
|
191
|
+
actions: ["setContext"]
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
states: {
|
|
195
|
+
ready: {}
|
|
196
|
+
},
|
|
197
|
+
implementations: {
|
|
198
|
+
guards: {
|
|
199
|
+
isTrusted: ({ event: e }) => !!e.isTrusted
|
|
200
|
+
},
|
|
201
|
+
effects: {
|
|
202
|
+
trackPressEvent({ computed: e, scope: t, context: s }) {
|
|
203
|
+
if (!e("isDisabled"))
|
|
204
|
+
return P({
|
|
205
|
+
pointerNode: X(t),
|
|
206
|
+
keyboardNode: n(t),
|
|
207
|
+
isValidKey: (d) => d.key === " ",
|
|
208
|
+
onPress: () => s.set("active", !1),
|
|
209
|
+
onPressStart: () => s.set("active", !0),
|
|
210
|
+
onPressEnd: () => s.set("active", !1)
|
|
211
|
+
});
|
|
152
212
|
},
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
actions: ["toggleChecked"]
|
|
162
|
-
}
|
|
163
|
-
],
|
|
164
|
-
"CHECKED.SET": [
|
|
165
|
-
{
|
|
166
|
-
guard: h("isTrusted"),
|
|
167
|
-
actions: ["setChecked", "dispatchChangeEvent"]
|
|
213
|
+
trackFocusVisible({ computed: e, scope: t }) {
|
|
214
|
+
if (!e("isDisabled"))
|
|
215
|
+
return N({ root: t.getRootNode() });
|
|
216
|
+
},
|
|
217
|
+
trackFormControlState({ context: e, send: t, scope: s }) {
|
|
218
|
+
return I(n(s), {
|
|
219
|
+
onFieldsetDisabledChange(d) {
|
|
220
|
+
e.set("fieldsetDisabled", d);
|
|
168
221
|
},
|
|
169
|
-
{
|
|
170
|
-
|
|
222
|
+
onFormReset() {
|
|
223
|
+
const d = e.initial("checked");
|
|
224
|
+
t({ type: "CHECKED.SET", checked: !!d, src: "form-reset" });
|
|
171
225
|
}
|
|
172
|
-
|
|
173
|
-
"CONTEXT.SET": {
|
|
174
|
-
actions: ["setContext"]
|
|
175
|
-
}
|
|
176
|
-
},
|
|
177
|
-
states: {
|
|
178
|
-
ready: {}
|
|
226
|
+
});
|
|
179
227
|
}
|
|
180
228
|
},
|
|
181
|
-
{
|
|
182
|
-
|
|
183
|
-
|
|
229
|
+
actions: {
|
|
230
|
+
setContext({ context: e, event: t }) {
|
|
231
|
+
for (const s in t.context)
|
|
232
|
+
e.set(s, t.context[s]);
|
|
184
233
|
},
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
return T({
|
|
189
|
-
pointerNode: i.getRootEl(t),
|
|
190
|
-
keyboardNode: i.getHiddenInputEl(t),
|
|
191
|
-
isValidKey: (o) => o.key === " ",
|
|
192
|
-
onPress: () => t.active = !1,
|
|
193
|
-
onPressStart: () => t.active = !0,
|
|
194
|
-
onPressEnd: () => t.active = !1
|
|
195
|
-
});
|
|
196
|
-
},
|
|
197
|
-
trackFocusVisible(t) {
|
|
198
|
-
if (!t.isDisabled)
|
|
199
|
-
return C({ root: i.getRootNode(t) });
|
|
200
|
-
},
|
|
201
|
-
trackFormControlState(t, o, { send: s, initialContext: c }) {
|
|
202
|
-
return H(i.getHiddenInputEl(t), {
|
|
203
|
-
onFieldsetDisabledChange(a) {
|
|
204
|
-
t.fieldsetDisabled = a;
|
|
205
|
-
},
|
|
206
|
-
onFormReset() {
|
|
207
|
-
s({ type: "CHECKED.SET", checked: !!c.checked, src: "form-reset" });
|
|
208
|
-
}
|
|
209
|
-
});
|
|
210
|
-
}
|
|
234
|
+
syncInputElement({ context: e, scope: t }) {
|
|
235
|
+
const s = n(t);
|
|
236
|
+
s && V(s, !!e.get("checked"));
|
|
211
237
|
},
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
f.checked(t, o.checked);
|
|
225
|
-
},
|
|
226
|
-
toggleChecked(t, o) {
|
|
227
|
-
f.checked(t, !t.checked);
|
|
228
|
-
},
|
|
229
|
-
dispatchChangeEvent(t) {
|
|
230
|
-
const o = i.getHiddenInputEl(t);
|
|
231
|
-
y(o, { checked: t.checked });
|
|
232
|
-
}
|
|
238
|
+
removeFocusIfNeeded({ context: e, prop: t }) {
|
|
239
|
+
t("disabled") && e.set("focused", !1);
|
|
240
|
+
},
|
|
241
|
+
setChecked({ context: e, event: t }) {
|
|
242
|
+
e.set("checked", t.checked);
|
|
243
|
+
},
|
|
244
|
+
toggleChecked({ context: e }) {
|
|
245
|
+
e.set("checked", !e.get("checked"));
|
|
246
|
+
},
|
|
247
|
+
dispatchChangeEvent({ context: e, scope: t }) {
|
|
248
|
+
const s = n(t);
|
|
249
|
+
y(s, { checked: e.get("checked") });
|
|
233
250
|
}
|
|
234
251
|
}
|
|
235
|
-
);
|
|
236
|
-
}
|
|
237
|
-
var x = {
|
|
238
|
-
change: (e) => {
|
|
239
|
-
var d;
|
|
240
|
-
(d = e.onCheckedChange) == null || d.call(e, { checked: e.checked });
|
|
241
|
-
}
|
|
242
|
-
}, f = {
|
|
243
|
-
checked: (e, d) => {
|
|
244
|
-
P(e.checked, d) || (e.checked = d, x.change(e));
|
|
245
252
|
}
|
|
246
|
-
};
|
|
247
|
-
|
|
253
|
+
});
|
|
254
|
+
K()([
|
|
248
255
|
"checked",
|
|
256
|
+
"defaultChecked",
|
|
249
257
|
"dir",
|
|
250
258
|
"disabled",
|
|
251
259
|
"form",
|
|
@@ -261,7 +269,7 @@ S()([
|
|
|
261
269
|
"value"
|
|
262
270
|
]);
|
|
263
271
|
export {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
272
|
+
R as anatomy,
|
|
273
|
+
x as connect,
|
|
274
|
+
j as machine
|
|
267
275
|
};
|