@serendie/ui 2.1.3 → 2.2.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/client.js +79 -74
- package/dist/components/Accordion/Accordion.d.ts +1 -1
- package/dist/components/Avatar/Avatar.d.ts +1 -1
- package/dist/components/Banner/Banner.d.ts +1 -1
- package/dist/components/BottomNavigation/BottomNavigationItem.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +2 -2
- package/dist/components/Button/Button.js +22 -21
- package/dist/components/DatePicker/DatePicker.d.ts +13 -0
- package/dist/components/DatePicker/DatePicker.js +203 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/index.js +6 -0
- package/dist/components/DatePicker/parseDate.d.ts +1 -0
- package/dist/components/DatePicker/styles.d.ts +1 -0
- package/dist/components/DatePicker/styles.js +224 -0
- package/dist/components/IconButton/IconButton.d.ts +3 -3
- package/dist/components/List/ListItem.d.ts +1 -1
- package/dist/components/ModalDialog/ModalDialog.d.ts +1 -1
- package/dist/components/NotificationBadge/NotificationBadge.d.ts +1 -1
- package/dist/components/Pagination/Pagination.d.ts +1 -1
- package/dist/components/ProgressIndicator/AnimatedArc.d.ts +6 -0
- package/dist/components/ProgressIndicator/AnimatedArc.js +46 -0
- package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +11 -29
- package/dist/components/ProgressIndicator/ProgressIndicator.js +201 -43
- package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.d.ts +10 -0
- package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.js +215 -0
- package/dist/components/ProgressIndicator/index.d.ts +4 -1
- package/dist/components/ProgressIndicator/index.js +3 -2
- package/dist/components/ProgressIndicator/util.d.ts +1 -0
- package/dist/components/ProgressIndicator/util.js +13 -0
- package/dist/components/Search/Search.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Switch/Switch.d.ts +1 -1
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/TextField/TextField.js +59 -156
- package/dist/components/Toast/Toast.d.ts +1 -1
- package/dist/components/TopAppBar/TopAppBar.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +80 -75
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-content.js +15 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-context.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-control.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-input.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-label.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-month-select.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-next-trigger.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-positioner.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-prev-trigger.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-root.js +55 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-body.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell-trigger.js +19 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell.js +26 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-head.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-header.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-row.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table.js +16 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-trigger.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view-control.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view.js +23 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-year-select.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker.anatomy.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-table-cell-props-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-table-props-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-view-props-context.js +12 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker.js +18 -0
- package/dist/node_modules/@ark-ui/react/dist/components/factory.js +11 -12
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-root.js +5 -4
- package/dist/node_modules/@ark-ui/react/dist/utils/use-event.js +0 -1
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +36 -36
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +238 -235
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +88 -83
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +68 -67
- package/dist/node_modules/@internationalized/date/dist/CalendarDate.js +178 -0
- package/dist/node_modules/@internationalized/date/dist/DateFormatter.js +99 -0
- package/dist/node_modules/@internationalized/date/dist/GregorianCalendar.js +98 -0
- package/dist/node_modules/@internationalized/date/dist/conversion.js +135 -0
- package/dist/node_modules/@internationalized/date/dist/manipulation.js +205 -0
- package/dist/node_modules/@internationalized/date/dist/queries.js +202 -0
- package/dist/node_modules/@internationalized/date/dist/string.js +41 -0
- package/dist/node_modules/@internationalized/date/dist/utils.js +6 -0
- package/dist/node_modules/@internationalized/date/dist/weekStartData.js +100 -0
- package/dist/node_modules/@swc/helpers/esm/_check_private_redeclaration.js +7 -0
- package/dist/node_modules/@swc/helpers/esm/_class_private_field_init.js +7 -0
- package/dist/node_modules/@zag-js/anatomy/dist/index.js +15 -14
- package/dist/node_modules/@zag-js/aria-hidden/dist/index.js +23 -23
- package/dist/node_modules/@zag-js/collection/dist/index.js +102 -71
- package/dist/node_modules/@zag-js/combobox/dist/index.js +482 -426
- package/dist/node_modules/@zag-js/date-picker/dist/index.js +1826 -0
- package/dist/node_modules/@zag-js/date-utils/dist/index.js +366 -0
- package/dist/node_modules/@zag-js/dialog/dist/index.js +66 -64
- package/dist/node_modules/@zag-js/dismissable/dist/index.js +94 -69
- package/dist/node_modules/@zag-js/dom-query/dist/index.js +359 -300
- package/dist/node_modules/@zag-js/live-region/dist/index.js +39 -0
- package/dist/node_modules/@zag-js/menu/dist/index.js +357 -340
- package/dist/node_modules/@zag-js/popper/dist/index.js +123 -120
- package/dist/node_modules/@zag-js/presence/dist/index.js +17 -17
- package/dist/node_modules/@zag-js/radio-group/dist/index.js +118 -117
- package/dist/node_modules/@zag-js/react/dist/index.js +124 -121
- package/dist/node_modules/@zag-js/select/dist/index.js +211 -197
- package/dist/node_modules/@zag-js/toast/dist/index.js +73 -71
- package/dist/node_modules/@zag-js/tooltip/dist/index.js +31 -30
- package/dist/node_modules/@zag-js/utils/dist/index.js +150 -104
- package/dist/preset.d.ts +11 -1
- package/dist/recipes/index.d.ts +3 -2
- package/dist/recipes/index.js +5 -2
- package/dist/recipes/textFieldRecipe.d.ts +6 -0
- package/dist/recipes/textFieldRecipe.js +107 -0
- package/dist/styled-system/css/cva.js +43 -38
- package/dist/styled-system/recipes/create-recipe.js +37 -0
- package/dist/styled-system/recipes/text-field-recipe.js +61 -0
- package/dist/styles.css +1 -1
- package/dist/tokens/keyframes/index.d.ts +8 -0
- package/dist/tokens/keyframes/index.js +6 -2
- package/package.json +3 -3
- package/styled-system/recipes/create-recipe.js +82 -0
- package/styled-system/recipes/index.d.ts +2 -0
- package/styled-system/recipes/index.js +1 -0
- package/styled-system/recipes/text-field-recipe.d.ts +28 -0
- package/styled-system/recipes/text-field-recipe.js +72 -0
- package/styled-system/types/prop-type.d.ts +1 -1
- package/dist/node_modules/@zag-js/store/dist/index.js +0 -131
- package/dist/node_modules/proxy-compare/dist/index.js +0 -7
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { createAnatomy as
|
|
2
|
-
import { ListCollection as
|
|
3
|
-
import { raf as N, observeAttributes as
|
|
4
|
-
import { getPlacement as
|
|
5
|
-
import { addOrRemove as
|
|
6
|
-
import { createMachine as
|
|
7
|
-
import { trackDismissableElement as
|
|
1
|
+
import { createAnatomy as ie } from "../../anatomy/dist/index.js";
|
|
2
|
+
import { ListCollection as Q } from "../../collection/dist/index.js";
|
|
3
|
+
import { raf as N, observeAttributes as le, trackFormControl as ne, getByTypeahead as D, isSelfTarget as ae, isValidTabEvent as se, getEventKey as K, getEventTarget as oe, isEditableElement as re, visuallyHiddenStyle as de, dataAttr as r, ariaAttr as ce, getInitialFocus as ue, scrollIntoView as ge } from "../../dom-query/dist/index.js";
|
|
4
|
+
import { getPlacement as B, getPlacementStyles as he } from "../../popper/dist/index.js";
|
|
5
|
+
import { addOrRemove as Y, isEqual as me, ensure as Ie } from "../../utils/dist/index.js";
|
|
6
|
+
import { createMachine as pe, createGuards as Ee } from "../../core/dist/index.js";
|
|
7
|
+
import { trackDismissableElement as ve } from "../../dismissable/dist/index.js";
|
|
8
8
|
import { createProps as G } from "../../types/dist/index.js";
|
|
9
|
-
var
|
|
9
|
+
var fe = ie("select").parts(
|
|
10
10
|
"label",
|
|
11
11
|
"positioner",
|
|
12
12
|
"trigger",
|
|
@@ -22,103 +22,106 @@ var ve = te("select").parts(
|
|
|
22
22
|
"root",
|
|
23
23
|
"control",
|
|
24
24
|
"valueText"
|
|
25
|
-
), h =
|
|
26
|
-
|
|
27
|
-
var
|
|
25
|
+
), h = fe.build(), X = (e) => new Q(e);
|
|
26
|
+
X.empty = () => new Q({ items: [] });
|
|
27
|
+
var Te = (e) => {
|
|
28
28
|
var t;
|
|
29
29
|
return ((t = e.ids) == null ? void 0 : t.root) ?? `select:${e.id}`;
|
|
30
|
-
},
|
|
30
|
+
}, M = (e) => {
|
|
31
31
|
var t;
|
|
32
32
|
return ((t = e.ids) == null ? void 0 : t.content) ?? `select:${e.id}:content`;
|
|
33
|
-
},
|
|
33
|
+
}, w = (e) => {
|
|
34
34
|
var t;
|
|
35
35
|
return ((t = e.ids) == null ? void 0 : t.trigger) ?? `select:${e.id}:trigger`;
|
|
36
|
-
},
|
|
36
|
+
}, Z = (e) => {
|
|
37
37
|
var t;
|
|
38
38
|
return ((t = e.ids) == null ? void 0 : t.clearTrigger) ?? `select:${e.id}:clear-trigger`;
|
|
39
39
|
}, b = (e) => {
|
|
40
40
|
var t;
|
|
41
41
|
return ((t = e.ids) == null ? void 0 : t.label) ?? `select:${e.id}:label`;
|
|
42
|
-
},
|
|
42
|
+
}, Oe = (e) => {
|
|
43
43
|
var t;
|
|
44
44
|
return ((t = e.ids) == null ? void 0 : t.control) ?? `select:${e.id}:control`;
|
|
45
|
-
},
|
|
45
|
+
}, _ = (e, t) => {
|
|
46
46
|
var i, l;
|
|
47
47
|
return ((l = (i = e.ids) == null ? void 0 : i.item) == null ? void 0 : l.call(i, t)) ?? `select:${e.id}:option:${t}`;
|
|
48
|
-
},
|
|
48
|
+
}, U = (e) => {
|
|
49
49
|
var t;
|
|
50
50
|
return ((t = e.ids) == null ? void 0 : t.hiddenSelect) ?? `select:${e.id}:select`;
|
|
51
|
-
},
|
|
51
|
+
}, x = (e) => {
|
|
52
52
|
var t;
|
|
53
53
|
return ((t = e.ids) == null ? void 0 : t.positioner) ?? `select:${e.id}:positioner`;
|
|
54
|
-
},
|
|
54
|
+
}, Re = (e, t) => {
|
|
55
55
|
var i, l;
|
|
56
56
|
return ((l = (i = e.ids) == null ? void 0 : i.itemGroup) == null ? void 0 : l.call(i, t)) ?? `select:${e.id}:optgroup:${t}`;
|
|
57
|
-
},
|
|
57
|
+
}, q = (e, t) => {
|
|
58
58
|
var i, l;
|
|
59
59
|
return ((l = (i = e.ids) == null ? void 0 : i.itemGroupLabel) == null ? void 0 : l.call(i, t)) ?? `select:${e.id}:optgroup-label:${t}`;
|
|
60
|
-
},
|
|
60
|
+
}, H = (e) => e.getById(U(e)), y = (e) => e.getById(M(e)), v = (e) => e.getById(w(e)), ye = (e) => e.getById(Z(e)), j = (e) => e.getById(x(e)), k = (e, t) => t == null ? null : e.getById(_(e, t));
|
|
61
61
|
function Ne(e, t) {
|
|
62
|
-
const { context: i, prop: l, scope: a, state:
|
|
63
|
-
function
|
|
64
|
-
const
|
|
65
|
-
return
|
|
62
|
+
const { context: i, prop: l, scope: a, state: c, computed: d, send: s } = e, g = l("disabled") || i.get("fieldsetDisabled"), m = l("invalid"), f = l("readOnly"), I = l("composite"), V = l("collection"), p = c.hasTag("open"), L = c.matches("focused"), R = i.get("highlightedValue"), z = i.get("highlightedItem"), ee = i.get("selectedItems"), P = i.get("currentPlacement"), W = d("isTypingAhead"), F = d("isInteractive"), A = R ? _(a, R) : void 0;
|
|
63
|
+
function S(n) {
|
|
64
|
+
const o = V.getItemDisabled(n.item), u = V.getItemValue(n.item);
|
|
65
|
+
return Ie(u, () => `[zag-js] No value found for item ${JSON.stringify(n.item)}`), {
|
|
66
66
|
value: u,
|
|
67
|
-
disabled: !!(g ||
|
|
68
|
-
highlighted:
|
|
67
|
+
disabled: !!(g || o),
|
|
68
|
+
highlighted: R === u,
|
|
69
69
|
selected: i.get("value").includes(u)
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
|
-
const
|
|
72
|
+
const te = he({
|
|
73
73
|
...l("positioning"),
|
|
74
|
-
placement:
|
|
74
|
+
placement: P
|
|
75
75
|
});
|
|
76
76
|
return {
|
|
77
|
-
open:
|
|
78
|
-
focused:
|
|
77
|
+
open: p,
|
|
78
|
+
focused: L,
|
|
79
79
|
empty: i.get("value").length === 0,
|
|
80
|
-
highlightedItem:
|
|
81
|
-
highlightedValue:
|
|
82
|
-
selectedItems:
|
|
83
|
-
hasSelectedItems:
|
|
80
|
+
highlightedItem: z,
|
|
81
|
+
highlightedValue: R,
|
|
82
|
+
selectedItems: ee,
|
|
83
|
+
hasSelectedItems: d("hasSelectedItems"),
|
|
84
84
|
value: i.get("value"),
|
|
85
|
-
valueAsString:
|
|
86
|
-
collection:
|
|
85
|
+
valueAsString: d("valueAsString"),
|
|
86
|
+
collection: V,
|
|
87
87
|
multiple: !!l("multiple"),
|
|
88
88
|
disabled: !!g,
|
|
89
89
|
reposition(n = {}) {
|
|
90
|
-
|
|
90
|
+
s({ type: "POSITIONING.SET", options: n });
|
|
91
91
|
},
|
|
92
92
|
focus() {
|
|
93
93
|
var n;
|
|
94
|
-
(n =
|
|
94
|
+
(n = v(a)) == null || n.focus({ preventScroll: !0 });
|
|
95
95
|
},
|
|
96
96
|
setOpen(n) {
|
|
97
|
-
|
|
97
|
+
c.hasTag("open") !== n && s({ type: n ? "OPEN" : "CLOSE" });
|
|
98
98
|
},
|
|
99
99
|
selectValue(n) {
|
|
100
|
-
|
|
100
|
+
s({ type: "ITEM.SELECT", value: n });
|
|
101
101
|
},
|
|
102
102
|
setValue(n) {
|
|
103
|
-
|
|
103
|
+
s({ type: "VALUE.SET", value: n });
|
|
104
104
|
},
|
|
105
105
|
selectAll() {
|
|
106
|
-
|
|
106
|
+
s({ type: "VALUE.SET", value: V.getValues() });
|
|
107
|
+
},
|
|
108
|
+
setHighlightValue(n) {
|
|
109
|
+
s({ type: "HIGHLIGHTED_VALUE.SET", value: n });
|
|
107
110
|
},
|
|
108
|
-
|
|
109
|
-
|
|
111
|
+
clearHighlightValue() {
|
|
112
|
+
s({ type: "HIGHLIGHTED_VALUE.CLEAR" });
|
|
110
113
|
},
|
|
111
114
|
clearValue(n) {
|
|
112
|
-
|
|
115
|
+
s(n ? { type: "ITEM.CLEAR", value: n } : { type: "VALUE.CLEAR" });
|
|
113
116
|
},
|
|
114
|
-
getItemState:
|
|
117
|
+
getItemState: S,
|
|
115
118
|
getRootProps() {
|
|
116
119
|
return t.element({
|
|
117
120
|
...h.root.attrs,
|
|
118
121
|
dir: l("dir"),
|
|
119
|
-
id:
|
|
122
|
+
id: Te(a),
|
|
120
123
|
"data-invalid": r(m),
|
|
121
|
-
"data-readonly": r(
|
|
124
|
+
"data-readonly": r(f)
|
|
122
125
|
});
|
|
123
126
|
},
|
|
124
127
|
getLabelProps() {
|
|
@@ -128,11 +131,11 @@ function Ne(e, t) {
|
|
|
128
131
|
...h.label.attrs,
|
|
129
132
|
"data-disabled": r(g),
|
|
130
133
|
"data-invalid": r(m),
|
|
131
|
-
"data-readonly": r(
|
|
132
|
-
htmlFor:
|
|
134
|
+
"data-readonly": r(f),
|
|
135
|
+
htmlFor: U(a),
|
|
133
136
|
onClick(n) {
|
|
134
|
-
var
|
|
135
|
-
n.defaultPrevented || g || (
|
|
137
|
+
var o;
|
|
138
|
+
n.defaultPrevented || g || (o = v(a)) == null || o.focus({ preventScroll: !0 });
|
|
136
139
|
}
|
|
137
140
|
});
|
|
138
141
|
},
|
|
@@ -140,9 +143,9 @@ function Ne(e, t) {
|
|
|
140
143
|
return t.element({
|
|
141
144
|
...h.control.attrs,
|
|
142
145
|
dir: l("dir"),
|
|
143
|
-
id:
|
|
144
|
-
"data-state":
|
|
145
|
-
"data-focus": r(
|
|
146
|
+
id: Oe(a),
|
|
147
|
+
"data-state": p ? "open" : "closed",
|
|
148
|
+
"data-focus": r(L),
|
|
146
149
|
"data-disabled": r(g),
|
|
147
150
|
"data-invalid": r(m)
|
|
148
151
|
});
|
|
@@ -153,65 +156,65 @@ function Ne(e, t) {
|
|
|
153
156
|
dir: l("dir"),
|
|
154
157
|
"data-disabled": r(g),
|
|
155
158
|
"data-invalid": r(m),
|
|
156
|
-
"data-focus": r(
|
|
159
|
+
"data-focus": r(L)
|
|
157
160
|
});
|
|
158
161
|
},
|
|
159
162
|
getTriggerProps() {
|
|
160
163
|
return t.button({
|
|
161
|
-
id:
|
|
164
|
+
id: w(a),
|
|
162
165
|
disabled: g,
|
|
163
166
|
dir: l("dir"),
|
|
164
167
|
type: "button",
|
|
165
168
|
role: "combobox",
|
|
166
|
-
"aria-controls":
|
|
167
|
-
"aria-expanded":
|
|
169
|
+
"aria-controls": M(a),
|
|
170
|
+
"aria-expanded": p,
|
|
168
171
|
"aria-haspopup": "listbox",
|
|
169
|
-
"data-state":
|
|
172
|
+
"data-state": p ? "open" : "closed",
|
|
170
173
|
"aria-invalid": m,
|
|
171
174
|
"aria-labelledby": b(a),
|
|
172
175
|
...h.trigger.attrs,
|
|
173
176
|
"data-disabled": r(g),
|
|
174
177
|
"data-invalid": r(m),
|
|
175
|
-
"data-readonly": r(
|
|
176
|
-
"data-placement":
|
|
177
|
-
"data-placeholder-shown": r(!
|
|
178
|
+
"data-readonly": r(f),
|
|
179
|
+
"data-placement": P,
|
|
180
|
+
"data-placeholder-shown": r(!d("hasSelectedItems")),
|
|
178
181
|
onClick(n) {
|
|
179
|
-
F && (n.defaultPrevented ||
|
|
182
|
+
F && (n.defaultPrevented || s({ type: "TRIGGER.CLICK" }));
|
|
180
183
|
},
|
|
181
184
|
onFocus() {
|
|
182
|
-
|
|
185
|
+
s({ type: "TRIGGER.FOCUS" });
|
|
183
186
|
},
|
|
184
187
|
onBlur() {
|
|
185
|
-
|
|
188
|
+
s({ type: "TRIGGER.BLUR" });
|
|
186
189
|
},
|
|
187
190
|
onKeyDown(n) {
|
|
188
191
|
if (n.defaultPrevented || !F) return;
|
|
189
192
|
const u = {
|
|
190
193
|
ArrowUp() {
|
|
191
|
-
|
|
194
|
+
s({ type: "TRIGGER.ARROW_UP" });
|
|
192
195
|
},
|
|
193
196
|
ArrowDown(T) {
|
|
194
|
-
|
|
197
|
+
s({ type: T.altKey ? "OPEN" : "TRIGGER.ARROW_DOWN" });
|
|
195
198
|
},
|
|
196
199
|
ArrowLeft() {
|
|
197
|
-
|
|
200
|
+
s({ type: "TRIGGER.ARROW_LEFT" });
|
|
198
201
|
},
|
|
199
202
|
ArrowRight() {
|
|
200
|
-
|
|
203
|
+
s({ type: "TRIGGER.ARROW_RIGHT" });
|
|
201
204
|
},
|
|
202
205
|
Home() {
|
|
203
|
-
|
|
206
|
+
s({ type: "TRIGGER.HOME" });
|
|
204
207
|
},
|
|
205
208
|
End() {
|
|
206
|
-
|
|
209
|
+
s({ type: "TRIGGER.END" });
|
|
207
210
|
},
|
|
208
211
|
Enter() {
|
|
209
|
-
|
|
212
|
+
s({ type: "TRIGGER.ENTER" });
|
|
210
213
|
},
|
|
211
214
|
Space(T) {
|
|
212
|
-
|
|
215
|
+
s(W ? { type: "TRIGGER.TYPEAHEAD", key: T.key } : { type: "TRIGGER.ENTER" });
|
|
213
216
|
}
|
|
214
|
-
}[
|
|
217
|
+
}[K(n, {
|
|
215
218
|
dir: l("dir"),
|
|
216
219
|
orientation: "vertical"
|
|
217
220
|
})];
|
|
@@ -219,7 +222,7 @@ function Ne(e, t) {
|
|
|
219
222
|
u(n), n.preventDefault();
|
|
220
223
|
return;
|
|
221
224
|
}
|
|
222
|
-
|
|
225
|
+
D.isValidEvent(n) && (s({ type: "TRIGGER.TYPEAHEAD", key: n.key }), n.preventDefault());
|
|
223
226
|
}
|
|
224
227
|
});
|
|
225
228
|
},
|
|
@@ -228,71 +231,71 @@ function Ne(e, t) {
|
|
|
228
231
|
...h.indicator.attrs,
|
|
229
232
|
dir: l("dir"),
|
|
230
233
|
"aria-hidden": !0,
|
|
231
|
-
"data-state":
|
|
234
|
+
"data-state": p ? "open" : "closed",
|
|
232
235
|
"data-disabled": r(g),
|
|
233
236
|
"data-invalid": r(m),
|
|
234
|
-
"data-readonly": r(
|
|
237
|
+
"data-readonly": r(f)
|
|
235
238
|
});
|
|
236
239
|
},
|
|
237
240
|
getItemProps(n) {
|
|
238
|
-
const
|
|
241
|
+
const o = S(n);
|
|
239
242
|
return t.element({
|
|
240
|
-
id:
|
|
243
|
+
id: _(a, o.value),
|
|
241
244
|
role: "option",
|
|
242
245
|
...h.item.attrs,
|
|
243
246
|
dir: l("dir"),
|
|
244
|
-
"data-value":
|
|
245
|
-
"aria-selected":
|
|
246
|
-
"data-state":
|
|
247
|
-
"data-highlighted": r(
|
|
248
|
-
"data-disabled": r(
|
|
249
|
-
"aria-disabled":
|
|
247
|
+
"data-value": o.value,
|
|
248
|
+
"aria-selected": o.selected,
|
|
249
|
+
"data-state": o.selected ? "checked" : "unchecked",
|
|
250
|
+
"data-highlighted": r(o.highlighted),
|
|
251
|
+
"data-disabled": r(o.disabled),
|
|
252
|
+
"aria-disabled": ce(o.disabled),
|
|
250
253
|
onPointerMove(u) {
|
|
251
|
-
|
|
254
|
+
o.disabled || u.pointerType !== "mouse" || o.value !== R && s({ type: "ITEM.POINTER_MOVE", value: o.value });
|
|
252
255
|
},
|
|
253
256
|
onClick(u) {
|
|
254
|
-
u.defaultPrevented ||
|
|
257
|
+
u.defaultPrevented || o.disabled || s({ type: "ITEM.CLICK", src: "pointerup", value: o.value });
|
|
255
258
|
},
|
|
256
259
|
onPointerLeave(u) {
|
|
257
260
|
var O;
|
|
258
|
-
|
|
261
|
+
o.disabled || n.persistFocus || u.pointerType !== "mouse" || !((O = e.event.previous()) != null && O.type.includes("POINTER")) || s({ type: "ITEM.POINTER_LEAVE" });
|
|
259
262
|
}
|
|
260
263
|
});
|
|
261
264
|
},
|
|
262
265
|
getItemTextProps(n) {
|
|
263
|
-
const
|
|
266
|
+
const o = S(n);
|
|
264
267
|
return t.element({
|
|
265
268
|
...h.itemText.attrs,
|
|
266
|
-
"data-state":
|
|
267
|
-
"data-disabled": r(
|
|
268
|
-
"data-highlighted": r(
|
|
269
|
+
"data-state": o.selected ? "checked" : "unchecked",
|
|
270
|
+
"data-disabled": r(o.disabled),
|
|
271
|
+
"data-highlighted": r(o.highlighted)
|
|
269
272
|
});
|
|
270
273
|
},
|
|
271
274
|
getItemIndicatorProps(n) {
|
|
272
|
-
const
|
|
275
|
+
const o = S(n);
|
|
273
276
|
return t.element({
|
|
274
277
|
"aria-hidden": !0,
|
|
275
278
|
...h.itemIndicator.attrs,
|
|
276
|
-
"data-state":
|
|
277
|
-
hidden: !
|
|
279
|
+
"data-state": o.selected ? "checked" : "unchecked",
|
|
280
|
+
hidden: !o.selected
|
|
278
281
|
});
|
|
279
282
|
},
|
|
280
283
|
getItemGroupLabelProps(n) {
|
|
281
|
-
const { htmlFor:
|
|
284
|
+
const { htmlFor: o } = n;
|
|
282
285
|
return t.element({
|
|
283
286
|
...h.itemGroupLabel.attrs,
|
|
284
|
-
id:
|
|
287
|
+
id: q(a, o),
|
|
285
288
|
dir: l("dir"),
|
|
286
289
|
role: "presentation"
|
|
287
290
|
});
|
|
288
291
|
},
|
|
289
292
|
getItemGroupProps(n) {
|
|
290
|
-
const { id:
|
|
293
|
+
const { id: o } = n;
|
|
291
294
|
return t.element({
|
|
292
295
|
...h.itemGroup.attrs,
|
|
293
296
|
"data-disabled": r(g),
|
|
294
|
-
id:
|
|
295
|
-
"aria-labelledby":
|
|
297
|
+
id: Re(a, o),
|
|
298
|
+
"aria-labelledby": q(a, o),
|
|
296
299
|
role: "group",
|
|
297
300
|
dir: l("dir")
|
|
298
301
|
});
|
|
@@ -300,20 +303,20 @@ function Ne(e, t) {
|
|
|
300
303
|
getClearTriggerProps() {
|
|
301
304
|
return t.button({
|
|
302
305
|
...h.clearTrigger.attrs,
|
|
303
|
-
id:
|
|
306
|
+
id: Z(a),
|
|
304
307
|
type: "button",
|
|
305
308
|
"aria-label": "Clear value",
|
|
306
309
|
"data-invalid": r(m),
|
|
307
310
|
disabled: g,
|
|
308
|
-
hidden: !
|
|
311
|
+
hidden: !d("hasSelectedItems"),
|
|
309
312
|
dir: l("dir"),
|
|
310
313
|
onClick(n) {
|
|
311
|
-
n.defaultPrevented ||
|
|
314
|
+
n.defaultPrevented || s({ type: "CLEAR.CLICK" });
|
|
312
315
|
}
|
|
313
316
|
});
|
|
314
317
|
},
|
|
315
318
|
getHiddenSelectProps() {
|
|
316
|
-
const n = i.get("value"),
|
|
319
|
+
const n = i.get("value"), o = l("multiple") ? n : n == null ? void 0 : n[0];
|
|
317
320
|
return t.select({
|
|
318
321
|
name: l("name"),
|
|
319
322
|
form: l("form"),
|
|
@@ -321,15 +324,15 @@ function Ne(e, t) {
|
|
|
321
324
|
multiple: l("multiple"),
|
|
322
325
|
required: l("required"),
|
|
323
326
|
"aria-hidden": !0,
|
|
324
|
-
id:
|
|
325
|
-
defaultValue:
|
|
326
|
-
style:
|
|
327
|
+
id: U(a),
|
|
328
|
+
defaultValue: o,
|
|
329
|
+
style: de,
|
|
327
330
|
tabIndex: -1,
|
|
328
331
|
// Some browser extensions will focus the hidden select.
|
|
329
332
|
// Let's forward the focus to the trigger.
|
|
330
333
|
onFocus() {
|
|
331
334
|
var u;
|
|
332
|
-
(u =
|
|
335
|
+
(u = v(a)) == null || u.focus({ preventScroll: !0 });
|
|
333
336
|
},
|
|
334
337
|
"aria-labelledby": b(a)
|
|
335
338
|
});
|
|
@@ -338,57 +341,57 @@ function Ne(e, t) {
|
|
|
338
341
|
return t.element({
|
|
339
342
|
...h.positioner.attrs,
|
|
340
343
|
dir: l("dir"),
|
|
341
|
-
id:
|
|
342
|
-
style:
|
|
344
|
+
id: x(a),
|
|
345
|
+
style: te.floating
|
|
343
346
|
});
|
|
344
347
|
},
|
|
345
348
|
getContentProps() {
|
|
346
349
|
return t.element({
|
|
347
|
-
hidden: !
|
|
350
|
+
hidden: !p,
|
|
348
351
|
dir: l("dir"),
|
|
349
|
-
id:
|
|
350
|
-
role:
|
|
352
|
+
id: M(a),
|
|
353
|
+
role: I ? "listbox" : "dialog",
|
|
351
354
|
...h.content.attrs,
|
|
352
|
-
"data-state":
|
|
353
|
-
"data-placement":
|
|
355
|
+
"data-state": p ? "open" : "closed",
|
|
356
|
+
"data-placement": P,
|
|
354
357
|
"data-activedescendant": A,
|
|
355
|
-
"aria-activedescendant":
|
|
356
|
-
"aria-multiselectable": l("multiple") &&
|
|
358
|
+
"aria-activedescendant": I ? A : void 0,
|
|
359
|
+
"aria-multiselectable": l("multiple") && I ? !0 : void 0,
|
|
357
360
|
"aria-labelledby": b(a),
|
|
358
361
|
tabIndex: 0,
|
|
359
362
|
onKeyDown(n) {
|
|
360
|
-
if (!F || !
|
|
361
|
-
if (n.key === "Tab" && !
|
|
363
|
+
if (!F || !ae(n)) return;
|
|
364
|
+
if (n.key === "Tab" && !se(n)) {
|
|
362
365
|
n.preventDefault();
|
|
363
366
|
return;
|
|
364
367
|
}
|
|
365
|
-
const
|
|
368
|
+
const o = {
|
|
366
369
|
ArrowUp() {
|
|
367
|
-
|
|
370
|
+
s({ type: "CONTENT.ARROW_UP" });
|
|
368
371
|
},
|
|
369
372
|
ArrowDown() {
|
|
370
|
-
|
|
373
|
+
s({ type: "CONTENT.ARROW_DOWN" });
|
|
371
374
|
},
|
|
372
375
|
Home() {
|
|
373
|
-
|
|
376
|
+
s({ type: "CONTENT.HOME" });
|
|
374
377
|
},
|
|
375
378
|
End() {
|
|
376
|
-
|
|
379
|
+
s({ type: "CONTENT.END" });
|
|
377
380
|
},
|
|
378
381
|
Enter() {
|
|
379
|
-
|
|
382
|
+
s({ type: "ITEM.CLICK", src: "keydown.enter" });
|
|
380
383
|
},
|
|
381
384
|
Space(O) {
|
|
382
|
-
var
|
|
383
|
-
|
|
385
|
+
var $;
|
|
386
|
+
W ? s({ type: "CONTENT.TYPEAHEAD", key: O.key }) : ($ = o.Enter) == null || $.call(o, O);
|
|
384
387
|
}
|
|
385
|
-
}, u =
|
|
388
|
+
}, u = o[K(n)];
|
|
386
389
|
if (u) {
|
|
387
390
|
u(n), n.preventDefault();
|
|
388
391
|
return;
|
|
389
392
|
}
|
|
390
|
-
const T =
|
|
391
|
-
|
|
393
|
+
const T = oe(n);
|
|
394
|
+
re(T) || D.isValidEvent(n) && (s({ type: "CONTENT.TYPEAHEAD", key: n.key }), n.preventDefault());
|
|
392
395
|
}
|
|
393
396
|
});
|
|
394
397
|
},
|
|
@@ -396,15 +399,15 @@ function Ne(e, t) {
|
|
|
396
399
|
return t.element({
|
|
397
400
|
...h.list.attrs,
|
|
398
401
|
tabIndex: 0,
|
|
399
|
-
role:
|
|
400
|
-
"aria-labelledby":
|
|
401
|
-
"aria-activedescendant":
|
|
402
|
-
"aria-multiselectable": !
|
|
402
|
+
role: I ? void 0 : "listbox",
|
|
403
|
+
"aria-labelledby": w(a),
|
|
404
|
+
"aria-activedescendant": I ? void 0 : A,
|
|
405
|
+
"aria-multiselectable": !I && l("multiple") ? !0 : void 0
|
|
403
406
|
});
|
|
404
407
|
}
|
|
405
408
|
};
|
|
406
409
|
}
|
|
407
|
-
var { and: C, not:
|
|
410
|
+
var { and: C, not: E, or: Ce } = Ee(), He = pe({
|
|
408
411
|
props({ props: e }) {
|
|
409
412
|
return {
|
|
410
413
|
loopFocus: !1,
|
|
@@ -412,7 +415,7 @@ var { and: C, not: v, or: Ce } = pe(), ke = Ie({
|
|
|
412
415
|
composite: !0,
|
|
413
416
|
defaultValue: [],
|
|
414
417
|
...e,
|
|
415
|
-
collection: e.collection ??
|
|
418
|
+
collection: e.collection ?? X.empty(),
|
|
416
419
|
positioning: {
|
|
417
420
|
placement: "bottom-start",
|
|
418
421
|
gutter: 8,
|
|
@@ -425,7 +428,7 @@ var { and: C, not: v, or: Ce } = pe(), ke = Ie({
|
|
|
425
428
|
value: t(() => ({
|
|
426
429
|
defaultValue: e("defaultValue"),
|
|
427
430
|
value: e("value"),
|
|
428
|
-
isEqual:
|
|
431
|
+
isEqual: me,
|
|
429
432
|
onChange(i) {
|
|
430
433
|
var a;
|
|
431
434
|
const l = e("collection").findMany(i);
|
|
@@ -456,23 +459,20 @@ var { and: C, not: v, or: Ce } = pe(), ke = Ie({
|
|
|
456
459
|
selectedItems: t(() => {
|
|
457
460
|
const i = e("value") ?? e("defaultValue") ?? [];
|
|
458
461
|
return { defaultValue: e("collection").findMany(i) };
|
|
459
|
-
}),
|
|
460
|
-
valueAsString: t(() => {
|
|
461
|
-
const i = e("value") ?? e("defaultValue") ?? [];
|
|
462
|
-
return { defaultValue: e("collection").stringifyMany(i) };
|
|
463
462
|
})
|
|
464
463
|
};
|
|
465
464
|
},
|
|
466
465
|
refs() {
|
|
467
466
|
return {
|
|
468
|
-
typeahead: { ...
|
|
467
|
+
typeahead: { ...D.defaultOptions }
|
|
469
468
|
};
|
|
470
469
|
},
|
|
471
470
|
computed: {
|
|
472
471
|
hasSelectedItems: ({ context: e }) => e.get("value").length > 0,
|
|
473
472
|
isTypingAhead: ({ refs: e }) => e.get("typeahead").keysSoFar !== "",
|
|
474
473
|
isDisabled: ({ prop: e, context: t }) => !!e("disabled") || !!t.get("fieldsetDisabled"),
|
|
475
|
-
isInteractive: ({ prop: e }) => !(e("disabled") || e("readOnly"))
|
|
474
|
+
isInteractive: ({ prop: e }) => !(e("disabled") || e("readOnly")),
|
|
475
|
+
valueAsString: ({ context: e, prop: t }) => t("collection").stringifyItems(e.get("selectedItems"))
|
|
476
476
|
},
|
|
477
477
|
initialState({ prop: e }) {
|
|
478
478
|
return e("open") || e("defaultOpen") ? "open" : "idle";
|
|
@@ -493,6 +493,9 @@ var { and: C, not: v, or: Ce } = pe(), ke = Ie({
|
|
|
493
493
|
"HIGHLIGHTED_VALUE.SET": {
|
|
494
494
|
actions: ["setHighlightedItem"]
|
|
495
495
|
},
|
|
496
|
+
"HIGHLIGHTED_VALUE.CLEAR": {
|
|
497
|
+
actions: ["clearHighlightedItem"]
|
|
498
|
+
},
|
|
496
499
|
"ITEM.SELECT": {
|
|
497
500
|
actions: ["selectItem"]
|
|
498
501
|
},
|
|
@@ -629,34 +632,34 @@ var { and: C, not: v, or: Ce } = pe(), ke = Ie({
|
|
|
629
632
|
],
|
|
630
633
|
"TRIGGER.ARROW_LEFT": [
|
|
631
634
|
{
|
|
632
|
-
guard: C(
|
|
635
|
+
guard: C(E("multiple"), "hasSelectedItems"),
|
|
633
636
|
actions: ["selectPreviousItem"]
|
|
634
637
|
},
|
|
635
638
|
{
|
|
636
|
-
guard:
|
|
639
|
+
guard: E("multiple"),
|
|
637
640
|
actions: ["selectLastItem"]
|
|
638
641
|
}
|
|
639
642
|
],
|
|
640
643
|
"TRIGGER.ARROW_RIGHT": [
|
|
641
644
|
{
|
|
642
|
-
guard: C(
|
|
645
|
+
guard: C(E("multiple"), "hasSelectedItems"),
|
|
643
646
|
actions: ["selectNextItem"]
|
|
644
647
|
},
|
|
645
648
|
{
|
|
646
|
-
guard:
|
|
649
|
+
guard: E("multiple"),
|
|
647
650
|
actions: ["selectFirstItem"]
|
|
648
651
|
}
|
|
649
652
|
],
|
|
650
653
|
"TRIGGER.HOME": {
|
|
651
|
-
guard:
|
|
654
|
+
guard: E("multiple"),
|
|
652
655
|
actions: ["selectFirstItem"]
|
|
653
656
|
},
|
|
654
657
|
"TRIGGER.END": {
|
|
655
|
-
guard:
|
|
658
|
+
guard: E("multiple"),
|
|
656
659
|
actions: ["selectLastItem"]
|
|
657
660
|
},
|
|
658
661
|
"TRIGGER.TYPEAHEAD": {
|
|
659
|
-
guard:
|
|
662
|
+
guard: E("multiple"),
|
|
660
663
|
actions: ["selectMatchingItem"]
|
|
661
664
|
}
|
|
662
665
|
}
|
|
@@ -772,7 +775,7 @@ var { and: C, not: v, or: Ce } = pe(), ke = Ie({
|
|
|
772
775
|
isFirstItemHighlighted: ({ context: e, prop: t }) => e.get("highlightedValue") === t("collection").firstValue,
|
|
773
776
|
isLastItemHighlighted: ({ context: e, prop: t }) => e.get("highlightedValue") === t("collection").lastValue,
|
|
774
777
|
closeOnSelect: ({ prop: e, event: t }) => !!(t.closeOnSelect ?? e("closeOnSelect")),
|
|
775
|
-
restoreFocus: ({ event: e }) =>
|
|
778
|
+
restoreFocus: ({ event: e }) => J(e),
|
|
776
779
|
// guard assertions (for controlled mode)
|
|
777
780
|
isOpenControlled: ({ prop: e }) => e("open") !== void 0,
|
|
778
781
|
isTriggerClickEvent: ({ event: e }) => {
|
|
@@ -794,7 +797,7 @@ var { and: C, not: v, or: Ce } = pe(), ke = Ie({
|
|
|
794
797
|
},
|
|
795
798
|
effects: {
|
|
796
799
|
trackFormControlState({ context: e, scope: t }) {
|
|
797
|
-
return
|
|
800
|
+
return ne(H(t), {
|
|
798
801
|
onFieldsetDisabledChange(i) {
|
|
799
802
|
e.set("fieldsetDisabled", i);
|
|
800
803
|
},
|
|
@@ -805,16 +808,16 @@ var { and: C, not: v, or: Ce } = pe(), ke = Ie({
|
|
|
805
808
|
});
|
|
806
809
|
},
|
|
807
810
|
trackDismissableElement({ scope: e, send: t, prop: i }) {
|
|
808
|
-
const l = () =>
|
|
811
|
+
const l = () => y(e);
|
|
809
812
|
let a = !0;
|
|
810
|
-
return
|
|
813
|
+
return ve(l, {
|
|
811
814
|
defer: !0,
|
|
812
|
-
exclude: [
|
|
815
|
+
exclude: [v(e), ye(e)],
|
|
813
816
|
onFocusOutside: i("onFocusOutside"),
|
|
814
817
|
onPointerDownOutside: i("onPointerDownOutside"),
|
|
815
|
-
onInteractOutside(
|
|
816
|
-
var
|
|
817
|
-
(
|
|
818
|
+
onInteractOutside(c) {
|
|
819
|
+
var d;
|
|
820
|
+
(d = i("onInteractOutside")) == null || d(c), a = !(c.detail.focusable || c.detail.contextmenu);
|
|
818
821
|
},
|
|
819
822
|
onDismiss() {
|
|
820
823
|
t({ type: "CLOSE", src: "interact-outside", restoreFocus: a });
|
|
@@ -823,27 +826,32 @@ var { and: C, not: v, or: Ce } = pe(), ke = Ie({
|
|
|
823
826
|
},
|
|
824
827
|
computePlacement({ context: e, prop: t, scope: i }) {
|
|
825
828
|
const l = t("positioning");
|
|
826
|
-
return e.set("currentPlacement", l.placement),
|
|
829
|
+
return e.set("currentPlacement", l.placement), B(() => v(i), () => j(i), {
|
|
827
830
|
defer: !0,
|
|
828
831
|
...l,
|
|
829
|
-
onComplete(
|
|
830
|
-
e.set("currentPlacement",
|
|
832
|
+
onComplete(d) {
|
|
833
|
+
e.set("currentPlacement", d.placement);
|
|
831
834
|
}
|
|
832
835
|
});
|
|
833
836
|
},
|
|
834
837
|
scrollToHighlightedItem({ context: e, prop: t, scope: i, event: l }) {
|
|
835
|
-
const a = (
|
|
836
|
-
const
|
|
837
|
-
if (
|
|
838
|
-
const g =
|
|
839
|
-
if (
|
|
840
|
-
const
|
|
841
|
-
|
|
838
|
+
const a = (d) => {
|
|
839
|
+
const s = e.get("highlightedValue");
|
|
840
|
+
if (s == null || l.current().type.includes("POINTER")) return;
|
|
841
|
+
const g = y(i), m = t("scrollToIndexFn");
|
|
842
|
+
if (m) {
|
|
843
|
+
const I = t("collection").indexOf(s);
|
|
844
|
+
m == null || m({
|
|
845
|
+
index: I,
|
|
846
|
+
immediate: d,
|
|
847
|
+
getElement: () => k(i, s)
|
|
848
|
+
});
|
|
842
849
|
return;
|
|
843
850
|
}
|
|
844
|
-
|
|
851
|
+
const f = k(i, s);
|
|
852
|
+
ge(f, { rootEl: g, block: "nearest" });
|
|
845
853
|
};
|
|
846
|
-
return N(() => a(!0)),
|
|
854
|
+
return N(() => a(!0)), le(() => y(i), {
|
|
847
855
|
defer: !0,
|
|
848
856
|
attributes: ["data-activedescendant"],
|
|
849
857
|
callback() {
|
|
@@ -854,14 +862,14 @@ var { and: C, not: v, or: Ce } = pe(), ke = Ie({
|
|
|
854
862
|
},
|
|
855
863
|
actions: {
|
|
856
864
|
reposition({ context: e, prop: t, scope: i, event: l }) {
|
|
857
|
-
const a = () =>
|
|
858
|
-
|
|
865
|
+
const a = () => j(i);
|
|
866
|
+
B(v(i), a, {
|
|
859
867
|
...t("positioning"),
|
|
860
868
|
...l.options,
|
|
861
869
|
defer: !0,
|
|
862
870
|
listeners: !1,
|
|
863
|
-
onComplete(
|
|
864
|
-
e.set("currentPlacement",
|
|
871
|
+
onComplete(c) {
|
|
872
|
+
e.set("currentPlacement", c.placement);
|
|
865
873
|
}
|
|
866
874
|
});
|
|
867
875
|
},
|
|
@@ -890,23 +898,23 @@ var { and: C, not: v, or: Ce } = pe(), ke = Ie({
|
|
|
890
898
|
},
|
|
891
899
|
setInitialFocus({ scope: e }) {
|
|
892
900
|
N(() => {
|
|
893
|
-
const t =
|
|
894
|
-
root:
|
|
901
|
+
const t = ue({
|
|
902
|
+
root: y(e)
|
|
895
903
|
});
|
|
896
904
|
t == null || t.focus({ preventScroll: !0 });
|
|
897
905
|
});
|
|
898
906
|
},
|
|
899
907
|
focusTriggerEl({ event: e, scope: t }) {
|
|
900
|
-
|
|
901
|
-
const i =
|
|
908
|
+
J(e) && N(() => {
|
|
909
|
+
const i = v(t);
|
|
902
910
|
i == null || i.focus({ preventScroll: !0 });
|
|
903
911
|
});
|
|
904
912
|
},
|
|
905
913
|
selectHighlightedItem({ context: e, prop: t, event: i }) {
|
|
906
|
-
var
|
|
914
|
+
var c;
|
|
907
915
|
let l = i.value ?? e.get("highlightedValue");
|
|
908
|
-
if (l == null) return;
|
|
909
|
-
(
|
|
916
|
+
if (l == null || !t("collection").has(l)) return;
|
|
917
|
+
(c = t("onSelect")) == null || c({ value: l }), l = t("deselectable") && !t("multiple") && e.get("value").includes(l) ? null : l, e.set("value", (d) => l == null ? [] : t("multiple") ? Y(d, l) : [l]);
|
|
910
918
|
},
|
|
911
919
|
highlightComputedFirstItem({ context: e, prop: t, computed: i }) {
|
|
912
920
|
const l = t("collection"), a = i("hasSelectedItems") ? l.sort(e.get("value"))[0] : l.firstValue;
|
|
@@ -938,10 +946,10 @@ var { and: C, not: v, or: Ce } = pe(), ke = Ie({
|
|
|
938
946
|
e.set("highlightedValue", null);
|
|
939
947
|
},
|
|
940
948
|
selectItem({ context: e, prop: t, event: i }) {
|
|
941
|
-
var
|
|
942
|
-
(
|
|
949
|
+
var c;
|
|
950
|
+
(c = t("onSelect")) == null || c({ value: i.value });
|
|
943
951
|
const a = t("deselectable") && !t("multiple") && e.get("value").includes(i.value) ? null : i.value;
|
|
944
|
-
e.set("value", (
|
|
952
|
+
e.set("value", (d) => a == null ? [] : t("multiple") ? Y(d, a) : [a]);
|
|
945
953
|
},
|
|
946
954
|
clearItem({ context: e, event: t }) {
|
|
947
955
|
e.set("value", (i) => i.filter((l) => l !== t.value));
|
|
@@ -977,7 +985,15 @@ var { and: C, not: v, or: Ce } = pe(), ke = Ie({
|
|
|
977
985
|
},
|
|
978
986
|
scrollContentToTop({ prop: e, scope: t }) {
|
|
979
987
|
var i, l;
|
|
980
|
-
|
|
988
|
+
if (e("scrollToIndexFn")) {
|
|
989
|
+
const a = e("collection").firstValue;
|
|
990
|
+
(i = e("scrollToIndexFn")) == null || i({
|
|
991
|
+
index: 0,
|
|
992
|
+
immediate: !0,
|
|
993
|
+
getElement: () => k(t, a)
|
|
994
|
+
});
|
|
995
|
+
} else
|
|
996
|
+
(l = y(t)) == null || l.scrollTo(0, 0);
|
|
981
997
|
},
|
|
982
998
|
invokeOnOpen({ prop: e }) {
|
|
983
999
|
var t;
|
|
@@ -988,7 +1004,7 @@ var { and: C, not: v, or: Ce } = pe(), ke = Ie({
|
|
|
988
1004
|
(t = e("onOpenChange")) == null || t({ open: !1 });
|
|
989
1005
|
},
|
|
990
1006
|
syncSelectElement({ context: e, prop: t, scope: i }) {
|
|
991
|
-
const l =
|
|
1007
|
+
const l = H(i);
|
|
992
1008
|
if (l) {
|
|
993
1009
|
if (e.get("value").length === 0 && !t("multiple")) {
|
|
994
1010
|
l.selectedIndex = -1;
|
|
@@ -1003,12 +1019,10 @@ var { and: C, not: v, or: Ce } = pe(), ke = Ie({
|
|
|
1003
1019
|
l && e.set("highlightedItem", l);
|
|
1004
1020
|
const a = i.findMany(e.get("value"));
|
|
1005
1021
|
e.set("selectedItems", a);
|
|
1006
|
-
const d = i.stringifyItems(a);
|
|
1007
|
-
e.set("valueAsString", d);
|
|
1008
1022
|
},
|
|
1009
1023
|
syncSelectedItems({ context: e, prop: t }) {
|
|
1010
|
-
const i = t("collection"), l = e.get("selectedItems"),
|
|
1011
|
-
e.set("selectedItems",
|
|
1024
|
+
const i = t("collection"), l = e.get("selectedItems"), c = e.get("value").map((d) => l.find((g) => i.getItemValue(g) === d) || i.find(d));
|
|
1025
|
+
e.set("selectedItems", c);
|
|
1012
1026
|
},
|
|
1013
1027
|
syncHighlightedItem({ context: e, prop: t }) {
|
|
1014
1028
|
const i = t("collection"), l = e.get("highlightedValue"), a = l ? i.find(l) : null;
|
|
@@ -1016,7 +1030,7 @@ var { and: C, not: v, or: Ce } = pe(), ke = Ie({
|
|
|
1016
1030
|
},
|
|
1017
1031
|
dispatchChangeEvent({ scope: e }) {
|
|
1018
1032
|
queueMicrotask(() => {
|
|
1019
|
-
const t =
|
|
1033
|
+
const t = H(e);
|
|
1020
1034
|
if (!t) return;
|
|
1021
1035
|
const i = e.getWin(), l = new i.Event("change", { bubbles: !0, composed: !0 });
|
|
1022
1036
|
t.dispatchEvent(l);
|
|
@@ -1025,7 +1039,7 @@ var { and: C, not: v, or: Ce } = pe(), ke = Ie({
|
|
|
1025
1039
|
}
|
|
1026
1040
|
}
|
|
1027
1041
|
});
|
|
1028
|
-
function
|
|
1042
|
+
function J(e) {
|
|
1029
1043
|
var i;
|
|
1030
1044
|
const t = e.restoreFocus ?? ((i = e.previousEvent) == null ? void 0 : i.restoreFocus);
|
|
1031
1045
|
return t == null || !!t;
|
|
@@ -1067,8 +1081,8 @@ G()(["item", "persistFocus"]);
|
|
|
1067
1081
|
G()(["id"]);
|
|
1068
1082
|
G()(["htmlFor"]);
|
|
1069
1083
|
export {
|
|
1070
|
-
|
|
1071
|
-
|
|
1084
|
+
fe as anatomy,
|
|
1085
|
+
X as collection,
|
|
1072
1086
|
Ne as connect,
|
|
1073
|
-
|
|
1087
|
+
He as machine
|
|
1074
1088
|
};
|