@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
1
|
import { createAnatomy as de } from "../../anatomy/dist/index.js";
|
|
2
2
|
import { mergeProps as ue, createMachine as ce, createGuards as he } from "../../core/dist/index.js";
|
|
3
|
-
import { dataAttr as C, isDownloadingEvent as
|
|
4
|
-
import { getPlacementStyles as Le, getPlacementSide as Ae, getPlacement as
|
|
5
|
-
import { hasProp as
|
|
6
|
-
import { trackDismissableElement as
|
|
7
|
-
import { getElementPolygon as
|
|
3
|
+
import { dataAttr as C, isDownloadingEvent as J, isOpeningInNewTab as Q, isSelfTarget as pe, getEventTarget as B, isValidTabEvent as Oe, getEventKey as Z, isPrintableKey as Ee, isModifierKey as me, isEditableElement as re, isContextMenuEvent as Te, getEventPoint as b, ariaAttr as Ie, isAnchorElement as fe, isHTMLElement as Pe, raf as D, observeAttributes as ye, addDomEvent as Ce, getByTypeahead as oe, clickIfLink as Re, getWindow as ve, queryAll as Se, getInitialFocus as Ne, contains as U, scrollIntoView as ke } from "../../dom-query/dist/index.js";
|
|
4
|
+
import { getPlacementStyles as Le, getPlacementSide as Ae, getPlacement as z } from "../../popper/dist/index.js";
|
|
5
|
+
import { hasProp as W, cast as ee, last as Me, first as be, isEqual as De, prev as _e, next as He } from "../../utils/dist/index.js";
|
|
6
|
+
import { trackDismissableElement as we } from "../../dismissable/dist/index.js";
|
|
7
|
+
import { getElementPolygon as Ge, isPointInPolygon as Ve } from "../../rect-utils/dist/index.js";
|
|
8
8
|
import { createProps as k } from "../../types/dist/index.js";
|
|
9
|
-
var
|
|
9
|
+
var Fe = de("menu").parts(
|
|
10
10
|
"arrow",
|
|
11
11
|
"arrowTip",
|
|
12
12
|
"content",
|
|
@@ -21,7 +21,7 @@ var Ve = de("menu").parts(
|
|
|
21
21
|
"separator",
|
|
22
22
|
"trigger",
|
|
23
23
|
"triggerItem"
|
|
24
|
-
),
|
|
24
|
+
), O = Fe.build(), w = (e) => {
|
|
25
25
|
var t;
|
|
26
26
|
return ((t = e.ids) == null ? void 0 : t.trigger) ?? `menu:${e.id}:trigger`;
|
|
27
27
|
}, ae = (e) => {
|
|
@@ -30,148 +30,149 @@ var Ve = de("menu").parts(
|
|
|
30
30
|
}, S = (e) => {
|
|
31
31
|
var t;
|
|
32
32
|
return ((t = e.ids) == null ? void 0 : t.content) ?? `menu:${e.id}:content`;
|
|
33
|
-
},
|
|
33
|
+
}, Ue = (e) => {
|
|
34
34
|
var t;
|
|
35
35
|
return ((t = e.ids) == null ? void 0 : t.arrow) ?? `menu:${e.id}:arrow`;
|
|
36
36
|
}, se = (e) => {
|
|
37
37
|
var t;
|
|
38
38
|
return ((t = e.ids) == null ? void 0 : t.positioner) ?? `menu:${e.id}:popper`;
|
|
39
|
-
},
|
|
40
|
-
var n,
|
|
41
|
-
return ((
|
|
42
|
-
}, N = (e, t) => `${e.id}/${t}`,
|
|
43
|
-
var n,
|
|
44
|
-
return ((
|
|
45
|
-
}, I = (e) => e.getById(S(e)),
|
|
39
|
+
}, We = (e, t) => {
|
|
40
|
+
var n, i;
|
|
41
|
+
return ((i = (n = e.ids) == null ? void 0 : n.group) == null ? void 0 : i.call(n, t)) ?? `menu:${e.id}:group:${t}`;
|
|
42
|
+
}, N = (e, t) => `${e.id}/${t}`, y = (e) => (e == null ? void 0 : e.dataset.value) ?? null, te = (e, t) => {
|
|
43
|
+
var n, i;
|
|
44
|
+
return ((i = (n = e.ids) == null ? void 0 : n.groupLabel) == null ? void 0 : i.call(n, t)) ?? `menu:${e.id}:group-label:${t}`;
|
|
45
|
+
}, I = (e) => e.getById(S(e)), ne = (e) => e.getById(se(e)), _ = (e) => e.getById(w(e)), le = (e, t) => t ? e.getById(N(e, t)) : null, x = (e) => e.getById(ae(e)), L = (e) => {
|
|
46
46
|
const n = `[role^="menuitem"][data-ownedby=${CSS.escape(S(e))}]:not([data-disabled])`;
|
|
47
47
|
return Se(I(e), n);
|
|
48
|
-
},
|
|
49
|
-
const n = L(e),
|
|
50
|
-
return
|
|
51
|
-
}, Ke = (e, t) => {
|
|
52
|
-
const n = L(e), r = n.findIndex((o) => x(o, t.value));
|
|
53
|
-
return _e(n, r, { loop: t.loop ?? t.loopFocus });
|
|
48
|
+
}, xe = (e) => be(L(e)), Be = (e) => Me(L(e)), $ = (e, t) => t ? e.id === t || e.dataset.value === t : !1, Ke = (e, t) => {
|
|
49
|
+
const n = L(e), i = n.findIndex((s) => $(s, t.value));
|
|
50
|
+
return He(n, i, { loop: t.loop ?? t.loopFocus });
|
|
54
51
|
}, $e = (e, t) => {
|
|
55
|
-
const n = L(e),
|
|
56
|
-
return
|
|
57
|
-
},
|
|
52
|
+
const n = L(e), i = n.findIndex((s) => $(s, t.value));
|
|
53
|
+
return _e(n, i, { loop: t.loop ?? t.loopFocus });
|
|
54
|
+
}, Xe = (e, t) => {
|
|
55
|
+
const n = L(e), i = n.find((s) => $(s, t.value));
|
|
56
|
+
return oe(n, { state: t.typeaheadState, key: t.key, activeId: (i == null ? void 0 : i.id) ?? null });
|
|
57
|
+
}, H = (e) => Pe(e) && (e.dataset.disabled === "" || e.hasAttribute("disabled")), Ye = (e) => {
|
|
58
58
|
var t;
|
|
59
59
|
return !!((t = e == null ? void 0 : e.getAttribute("role")) != null && t.startsWith("menuitem")) && !!(e != null && e.hasAttribute("aria-controls"));
|
|
60
|
-
},
|
|
61
|
-
function
|
|
60
|
+
}, K = "menu:select";
|
|
61
|
+
function qe(e, t) {
|
|
62
62
|
if (!e) return;
|
|
63
|
-
const n =
|
|
64
|
-
e.dispatchEvent(
|
|
63
|
+
const n = ve(e), i = new n.CustomEvent(K, { detail: { value: t } });
|
|
64
|
+
e.dispatchEvent(i);
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
const { context: n, send:
|
|
68
|
-
...
|
|
69
|
-
placement: ge ? "bottom" :
|
|
66
|
+
function at(e, t) {
|
|
67
|
+
const { context: n, send: i, state: s, computed: g, prop: o, scope: l } = e, u = s.hasTag("open"), f = n.get("isSubmenu"), P = g("isTypingAhead"), X = o("composite"), Y = n.get("currentPlacement"), ge = n.get("anchorPoint"), v = n.get("highlightedValue"), G = Le({
|
|
68
|
+
...o("positioning"),
|
|
69
|
+
placement: ge ? "bottom" : Y
|
|
70
70
|
});
|
|
71
|
-
function V(
|
|
71
|
+
function V(r) {
|
|
72
72
|
return {
|
|
73
|
-
id: N(l,
|
|
74
|
-
disabled: !!
|
|
75
|
-
highlighted:
|
|
73
|
+
id: N(l, r.value),
|
|
74
|
+
disabled: !!r.disabled,
|
|
75
|
+
highlighted: v === r.value
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
const
|
|
80
|
-
return { ...
|
|
78
|
+
function q(r) {
|
|
79
|
+
const a = r.valueText ?? r.value;
|
|
80
|
+
return { ...r, id: r.value, valueText: a };
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function A(r) {
|
|
83
83
|
return {
|
|
84
|
-
...V(
|
|
85
|
-
checked: !!
|
|
84
|
+
...V(q(r)),
|
|
85
|
+
checked: !!r.checked
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
|
-
function F(
|
|
89
|
-
const { closeOnSelect:
|
|
88
|
+
function F(r) {
|
|
89
|
+
const { closeOnSelect: a, valueText: p, value: E } = r, c = V(r), T = N(l, E);
|
|
90
90
|
return t.element({
|
|
91
|
-
...
|
|
91
|
+
...O.item.attrs,
|
|
92
92
|
id: T,
|
|
93
93
|
role: "menuitem",
|
|
94
|
-
"aria-disabled": Ie(
|
|
95
|
-
"data-disabled": C(
|
|
94
|
+
"aria-disabled": Ie(c.disabled),
|
|
95
|
+
"data-disabled": C(c.disabled),
|
|
96
96
|
"data-ownedby": S(l),
|
|
97
|
-
"data-highlighted": C(
|
|
98
|
-
"data-value":
|
|
97
|
+
"data-highlighted": C(c.highlighted),
|
|
98
|
+
"data-value": E,
|
|
99
99
|
"data-valuetext": p,
|
|
100
100
|
onDragStart(d) {
|
|
101
101
|
d.currentTarget.matches("a[href]") && d.preventDefault();
|
|
102
102
|
},
|
|
103
103
|
onPointerMove(d) {
|
|
104
|
-
if (
|
|
105
|
-
const
|
|
106
|
-
|
|
104
|
+
if (c.disabled || d.pointerType !== "mouse") return;
|
|
105
|
+
const h = d.currentTarget;
|
|
106
|
+
c.highlighted || i({ type: "ITEM_POINTERMOVE", id: T, target: h, closeOnSelect: a });
|
|
107
107
|
},
|
|
108
108
|
onPointerLeave(d) {
|
|
109
|
-
var
|
|
110
|
-
if (
|
|
111
|
-
const
|
|
112
|
-
|
|
109
|
+
var j;
|
|
110
|
+
if (c.disabled || d.pointerType !== "mouse" || !((j = e.event.previous()) == null ? void 0 : j.type.includes("POINTER"))) return;
|
|
111
|
+
const M = d.currentTarget;
|
|
112
|
+
i({ type: "ITEM_POINTERLEAVE", id: T, target: M, closeOnSelect: a });
|
|
113
113
|
},
|
|
114
114
|
onPointerDown(d) {
|
|
115
|
-
if (
|
|
116
|
-
const
|
|
117
|
-
|
|
115
|
+
if (c.disabled) return;
|
|
116
|
+
const h = d.currentTarget;
|
|
117
|
+
i({ type: "ITEM_POINTERDOWN", target: h, id: T, closeOnSelect: a });
|
|
118
118
|
},
|
|
119
119
|
onClick(d) {
|
|
120
|
-
if (
|
|
121
|
-
const
|
|
122
|
-
|
|
120
|
+
if (J(d) || Q(d) || c.disabled) return;
|
|
121
|
+
const h = d.currentTarget;
|
|
122
|
+
i({ type: "ITEM_CLICK", target: h, id: T, closeOnSelect: a });
|
|
123
123
|
}
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
126
|
return {
|
|
127
|
-
highlightedValue:
|
|
128
|
-
open:
|
|
129
|
-
setOpen(
|
|
130
|
-
|
|
127
|
+
highlightedValue: v,
|
|
128
|
+
open: u,
|
|
129
|
+
setOpen(r) {
|
|
130
|
+
s.hasTag("open") !== r && i({ type: r ? "OPEN" : "CLOSE" });
|
|
131
131
|
},
|
|
132
|
-
setHighlightedValue(
|
|
133
|
-
|
|
132
|
+
setHighlightedValue(r) {
|
|
133
|
+
i({ type: "HIGHLIGHTED.SET", value: r });
|
|
134
134
|
},
|
|
135
|
-
setParent(
|
|
136
|
-
|
|
135
|
+
setParent(r) {
|
|
136
|
+
i({ type: "PARENT.SET", value: r, id: r.prop("id") });
|
|
137
137
|
},
|
|
138
|
-
setChild(
|
|
139
|
-
|
|
138
|
+
setChild(r) {
|
|
139
|
+
i({ type: "CHILD.SET", value: r, id: r.prop("id") });
|
|
140
140
|
},
|
|
141
|
-
reposition(
|
|
142
|
-
|
|
141
|
+
reposition(r = {}) {
|
|
142
|
+
i({ type: "POSITIONING.SET", options: r });
|
|
143
143
|
},
|
|
144
|
-
addItemListener(
|
|
145
|
-
const
|
|
146
|
-
if (!
|
|
144
|
+
addItemListener(r) {
|
|
145
|
+
const a = l.getById(r.id);
|
|
146
|
+
if (!a) return;
|
|
147
147
|
const p = () => {
|
|
148
|
-
var
|
|
149
|
-
return (
|
|
148
|
+
var E;
|
|
149
|
+
return (E = r.onSelect) == null ? void 0 : E.call(r);
|
|
150
150
|
};
|
|
151
|
-
return
|
|
151
|
+
return a.addEventListener(K, p), () => a.removeEventListener(K, p);
|
|
152
152
|
},
|
|
153
153
|
getContextTriggerProps() {
|
|
154
154
|
return t.element({
|
|
155
|
-
...
|
|
156
|
-
dir:
|
|
155
|
+
...O.contextTrigger.attrs,
|
|
156
|
+
dir: o("dir"),
|
|
157
157
|
id: ae(l),
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
158
|
+
"data-state": u ? "open" : "closed",
|
|
159
|
+
onPointerDown(r) {
|
|
160
|
+
if (r.pointerType === "mouse") return;
|
|
161
|
+
const a = b(r);
|
|
162
|
+
i({ type: "CONTEXT_MENU_START", point: a });
|
|
162
163
|
},
|
|
163
|
-
onPointerCancel(
|
|
164
|
-
|
|
164
|
+
onPointerCancel(r) {
|
|
165
|
+
r.pointerType !== "mouse" && i({ type: "CONTEXT_MENU_CANCEL" });
|
|
165
166
|
},
|
|
166
|
-
onPointerMove(
|
|
167
|
-
|
|
167
|
+
onPointerMove(r) {
|
|
168
|
+
r.pointerType !== "mouse" && i({ type: "CONTEXT_MENU_CANCEL" });
|
|
168
169
|
},
|
|
169
|
-
onPointerUp(
|
|
170
|
-
|
|
170
|
+
onPointerUp(r) {
|
|
171
|
+
r.pointerType !== "mouse" && i({ type: "CONTEXT_MENU_CANCEL" });
|
|
171
172
|
},
|
|
172
|
-
onContextMenu(
|
|
173
|
-
const
|
|
174
|
-
|
|
173
|
+
onContextMenu(r) {
|
|
174
|
+
const a = b(r);
|
|
175
|
+
i({ type: "CONTEXT_MENU", point: a }), r.preventDefault();
|
|
175
176
|
},
|
|
176
177
|
style: {
|
|
177
178
|
WebkitTouchCallout: "none",
|
|
@@ -180,232 +181,232 @@ function ot(e, t) {
|
|
|
180
181
|
}
|
|
181
182
|
});
|
|
182
183
|
},
|
|
183
|
-
getTriggerItemProps(
|
|
184
|
-
const
|
|
185
|
-
return ue(F({ value:
|
|
184
|
+
getTriggerItemProps(r) {
|
|
185
|
+
const a = r.getTriggerProps();
|
|
186
|
+
return ue(F({ value: a.id }), a);
|
|
186
187
|
},
|
|
187
188
|
getTriggerProps() {
|
|
188
189
|
return t.button({
|
|
189
|
-
...
|
|
190
|
+
...f ? O.triggerItem.attrs : O.trigger.attrs,
|
|
190
191
|
"data-placement": n.get("currentPlacement"),
|
|
191
192
|
type: "button",
|
|
192
|
-
dir:
|
|
193
|
+
dir: o("dir"),
|
|
193
194
|
id: w(l),
|
|
194
|
-
"data-uid":
|
|
195
|
-
"aria-haspopup":
|
|
195
|
+
"data-uid": o("id"),
|
|
196
|
+
"aria-haspopup": X ? "menu" : "dialog",
|
|
196
197
|
"aria-controls": S(l),
|
|
197
|
-
"aria-expanded":
|
|
198
|
-
"data-state":
|
|
199
|
-
onPointerMove(
|
|
200
|
-
if (
|
|
201
|
-
const p = b(
|
|
202
|
-
|
|
198
|
+
"aria-expanded": u || void 0,
|
|
199
|
+
"data-state": u ? "open" : "closed",
|
|
200
|
+
onPointerMove(r) {
|
|
201
|
+
if (r.pointerType !== "mouse" || H(r.currentTarget) || !f) return;
|
|
202
|
+
const p = b(r);
|
|
203
|
+
i({ type: "TRIGGER_POINTERMOVE", target: r.currentTarget, point: p });
|
|
203
204
|
},
|
|
204
|
-
onPointerLeave(
|
|
205
|
-
if (H(
|
|
206
|
-
const
|
|
207
|
-
|
|
205
|
+
onPointerLeave(r) {
|
|
206
|
+
if (H(r.currentTarget) || r.pointerType !== "mouse" || !f) return;
|
|
207
|
+
const a = b(r);
|
|
208
|
+
i({
|
|
208
209
|
type: "TRIGGER_POINTERLEAVE",
|
|
209
|
-
target:
|
|
210
|
-
point:
|
|
210
|
+
target: r.currentTarget,
|
|
211
|
+
point: a
|
|
211
212
|
});
|
|
212
213
|
},
|
|
213
|
-
onPointerDown(
|
|
214
|
-
H(
|
|
214
|
+
onPointerDown(r) {
|
|
215
|
+
H(r.currentTarget) || Te(r) || r.preventDefault();
|
|
215
216
|
},
|
|
216
|
-
onClick(
|
|
217
|
-
|
|
217
|
+
onClick(r) {
|
|
218
|
+
r.defaultPrevented || H(r.currentTarget) || i({ type: "TRIGGER_CLICK", target: r.currentTarget });
|
|
218
219
|
},
|
|
219
220
|
onBlur() {
|
|
220
|
-
|
|
221
|
+
i({ type: "TRIGGER_BLUR" });
|
|
221
222
|
},
|
|
222
223
|
onFocus() {
|
|
223
|
-
|
|
224
|
+
i({ type: "TRIGGER_FOCUS" });
|
|
224
225
|
},
|
|
225
|
-
onKeyDown(
|
|
226
|
-
if (
|
|
227
|
-
const
|
|
226
|
+
onKeyDown(r) {
|
|
227
|
+
if (r.defaultPrevented) return;
|
|
228
|
+
const a = {
|
|
228
229
|
ArrowDown() {
|
|
229
|
-
|
|
230
|
+
i({ type: "ARROW_DOWN" });
|
|
230
231
|
},
|
|
231
232
|
ArrowUp() {
|
|
232
|
-
|
|
233
|
+
i({ type: "ARROW_UP" });
|
|
233
234
|
},
|
|
234
235
|
Enter() {
|
|
235
|
-
|
|
236
|
+
i({ type: "ARROW_DOWN", src: "enter" });
|
|
236
237
|
},
|
|
237
238
|
Space() {
|
|
238
|
-
|
|
239
|
+
i({ type: "ARROW_DOWN", src: "space" });
|
|
239
240
|
}
|
|
240
|
-
}, p =
|
|
241
|
+
}, p = Z(r, {
|
|
241
242
|
orientation: "vertical",
|
|
242
|
-
dir:
|
|
243
|
-
}),
|
|
244
|
-
|
|
243
|
+
dir: o("dir")
|
|
244
|
+
}), E = a[p];
|
|
245
|
+
E && (r.preventDefault(), E(r));
|
|
245
246
|
}
|
|
246
247
|
});
|
|
247
248
|
},
|
|
248
249
|
getIndicatorProps() {
|
|
249
250
|
return t.element({
|
|
250
|
-
...
|
|
251
|
-
dir:
|
|
252
|
-
"data-state":
|
|
251
|
+
...O.indicator.attrs,
|
|
252
|
+
dir: o("dir"),
|
|
253
|
+
"data-state": u ? "open" : "closed"
|
|
253
254
|
});
|
|
254
255
|
},
|
|
255
256
|
getPositionerProps() {
|
|
256
257
|
return t.element({
|
|
257
|
-
...
|
|
258
|
-
dir:
|
|
258
|
+
...O.positioner.attrs,
|
|
259
|
+
dir: o("dir"),
|
|
259
260
|
id: se(l),
|
|
260
261
|
style: G.floating
|
|
261
262
|
});
|
|
262
263
|
},
|
|
263
264
|
getArrowProps() {
|
|
264
265
|
return t.element({
|
|
265
|
-
id:
|
|
266
|
-
...
|
|
267
|
-
dir:
|
|
266
|
+
id: Ue(l),
|
|
267
|
+
...O.arrow.attrs,
|
|
268
|
+
dir: o("dir"),
|
|
268
269
|
style: G.arrow
|
|
269
270
|
});
|
|
270
271
|
},
|
|
271
272
|
getArrowTipProps() {
|
|
272
273
|
return t.element({
|
|
273
|
-
...
|
|
274
|
-
dir:
|
|
274
|
+
...O.arrowTip.attrs,
|
|
275
|
+
dir: o("dir"),
|
|
275
276
|
style: G.arrowTip
|
|
276
277
|
});
|
|
277
278
|
},
|
|
278
279
|
getContentProps() {
|
|
279
280
|
return t.element({
|
|
280
|
-
...
|
|
281
|
+
...O.content.attrs,
|
|
281
282
|
id: S(l),
|
|
282
|
-
"aria-label":
|
|
283
|
-
hidden: !
|
|
284
|
-
"data-state":
|
|
285
|
-
role:
|
|
283
|
+
"aria-label": o("aria-label"),
|
|
284
|
+
hidden: !u,
|
|
285
|
+
"data-state": u ? "open" : "closed",
|
|
286
|
+
role: X ? "menu" : "dialog",
|
|
286
287
|
tabIndex: 0,
|
|
287
|
-
dir:
|
|
288
|
+
dir: o("dir"),
|
|
288
289
|
"aria-activedescendant": g("highlightedId") || void 0,
|
|
289
290
|
"aria-labelledby": w(l),
|
|
290
|
-
"data-placement":
|
|
291
|
-
onPointerEnter(
|
|
292
|
-
|
|
291
|
+
"data-placement": Y,
|
|
292
|
+
onPointerEnter(r) {
|
|
293
|
+
r.pointerType === "mouse" && i({ type: "MENU_POINTERENTER" });
|
|
293
294
|
},
|
|
294
|
-
onKeyDown(
|
|
295
|
-
if (
|
|
296
|
-
const
|
|
297
|
-
if (!((
|
|
298
|
-
if (
|
|
299
|
-
|
|
295
|
+
onKeyDown(r) {
|
|
296
|
+
if (r.defaultPrevented || !pe(r)) return;
|
|
297
|
+
const a = B(r);
|
|
298
|
+
if (!((a == null ? void 0 : a.closest("[role=menu]")) === r.currentTarget || a === r.currentTarget)) return;
|
|
299
|
+
if (r.key === "Tab" && !Oe(r)) {
|
|
300
|
+
r.preventDefault();
|
|
300
301
|
return;
|
|
301
302
|
}
|
|
302
|
-
const
|
|
303
|
+
const E = le(l, v), c = {
|
|
303
304
|
ArrowDown() {
|
|
304
|
-
|
|
305
|
+
i({ type: "ARROW_DOWN" });
|
|
305
306
|
},
|
|
306
307
|
ArrowUp() {
|
|
307
|
-
|
|
308
|
+
i({ type: "ARROW_UP" });
|
|
308
309
|
},
|
|
309
310
|
ArrowLeft() {
|
|
310
|
-
|
|
311
|
+
i({ type: "ARROW_LEFT" });
|
|
311
312
|
},
|
|
312
313
|
ArrowRight() {
|
|
313
|
-
|
|
314
|
+
i({ type: "ARROW_RIGHT" });
|
|
314
315
|
},
|
|
315
316
|
Enter() {
|
|
316
|
-
var
|
|
317
|
-
|
|
317
|
+
var h;
|
|
318
|
+
i({ type: "ENTER" }), v != null && fe(E) && ((h = o("navigate")) == null || h({ value: v, node: E, href: E.href }));
|
|
318
319
|
},
|
|
319
|
-
Space(
|
|
320
|
-
var
|
|
321
|
-
|
|
320
|
+
Space(h) {
|
|
321
|
+
var M;
|
|
322
|
+
P ? i({ type: "TYPEAHEAD", key: h.key }) : (M = c.Enter) == null || M.call(c, h);
|
|
322
323
|
},
|
|
323
324
|
Home() {
|
|
324
|
-
|
|
325
|
+
i({ type: "HOME" });
|
|
325
326
|
},
|
|
326
327
|
End() {
|
|
327
|
-
|
|
328
|
+
i({ type: "END" });
|
|
328
329
|
}
|
|
329
|
-
}, T =
|
|
330
|
+
}, T = Z(r, { dir: o("dir") }), d = c[T];
|
|
330
331
|
if (d) {
|
|
331
|
-
d(
|
|
332
|
+
d(r), r.stopPropagation(), r.preventDefault();
|
|
332
333
|
return;
|
|
333
334
|
}
|
|
334
|
-
|
|
335
|
+
o("typeahead") && Ee(r) && (me(r) || re(a) || (i({ type: "TYPEAHEAD", key: r.key }), r.preventDefault()));
|
|
335
336
|
}
|
|
336
337
|
});
|
|
337
338
|
},
|
|
338
339
|
getSeparatorProps() {
|
|
339
340
|
return t.element({
|
|
340
|
-
...
|
|
341
|
+
...O.separator.attrs,
|
|
341
342
|
role: "separator",
|
|
342
|
-
dir:
|
|
343
|
+
dir: o("dir"),
|
|
343
344
|
"aria-orientation": "horizontal"
|
|
344
345
|
});
|
|
345
346
|
},
|
|
346
347
|
getItemState: V,
|
|
347
348
|
getItemProps: F,
|
|
348
|
-
getOptionItemState:
|
|
349
|
-
getOptionItemProps(
|
|
350
|
-
const { type:
|
|
349
|
+
getOptionItemState: A,
|
|
350
|
+
getOptionItemProps(r) {
|
|
351
|
+
const { type: a, disabled: p, closeOnSelect: E } = r, c = q(r), T = A(r);
|
|
351
352
|
return {
|
|
352
|
-
...F(
|
|
353
|
+
...F(c),
|
|
353
354
|
...t.element({
|
|
354
|
-
"data-type":
|
|
355
|
-
...
|
|
356
|
-
dir:
|
|
357
|
-
"data-value":
|
|
358
|
-
role: `menuitem${
|
|
359
|
-
"aria-checked": !!
|
|
360
|
-
"data-state":
|
|
361
|
-
onClick(
|
|
362
|
-
if (p ||
|
|
363
|
-
const
|
|
364
|
-
|
|
355
|
+
"data-type": a,
|
|
356
|
+
...O.item.attrs,
|
|
357
|
+
dir: o("dir"),
|
|
358
|
+
"data-value": c.value,
|
|
359
|
+
role: `menuitem${a}`,
|
|
360
|
+
"aria-checked": !!T.checked,
|
|
361
|
+
"data-state": T.checked ? "checked" : "unchecked",
|
|
362
|
+
onClick(d) {
|
|
363
|
+
if (p || J(d) || Q(d)) return;
|
|
364
|
+
const h = d.currentTarget;
|
|
365
|
+
i({ type: "ITEM_CLICK", target: h, option: c, closeOnSelect: E });
|
|
365
366
|
}
|
|
366
367
|
})
|
|
367
368
|
};
|
|
368
369
|
},
|
|
369
|
-
getItemIndicatorProps(
|
|
370
|
-
const
|
|
370
|
+
getItemIndicatorProps(r) {
|
|
371
|
+
const a = A(ee(r)), p = a.checked ? "checked" : "unchecked";
|
|
371
372
|
return t.element({
|
|
372
|
-
...
|
|
373
|
-
dir:
|
|
374
|
-
"data-disabled": C(
|
|
375
|
-
"data-highlighted": C(
|
|
376
|
-
"data-state":
|
|
377
|
-
hidden:
|
|
373
|
+
...O.itemIndicator.attrs,
|
|
374
|
+
dir: o("dir"),
|
|
375
|
+
"data-disabled": C(a.disabled),
|
|
376
|
+
"data-highlighted": C(a.highlighted),
|
|
377
|
+
"data-state": W(r, "checked") ? p : void 0,
|
|
378
|
+
hidden: W(r, "checked") ? !a.checked : void 0
|
|
378
379
|
});
|
|
379
380
|
},
|
|
380
|
-
getItemTextProps(
|
|
381
|
-
const
|
|
381
|
+
getItemTextProps(r) {
|
|
382
|
+
const a = A(ee(r)), p = a.checked ? "checked" : "unchecked";
|
|
382
383
|
return t.element({
|
|
383
|
-
...
|
|
384
|
-
dir:
|
|
385
|
-
"data-disabled": C(
|
|
386
|
-
"data-highlighted": C(
|
|
387
|
-
"data-state":
|
|
384
|
+
...O.itemText.attrs,
|
|
385
|
+
dir: o("dir"),
|
|
386
|
+
"data-disabled": C(a.disabled),
|
|
387
|
+
"data-highlighted": C(a.highlighted),
|
|
388
|
+
"data-state": W(r, "checked") ? p : void 0
|
|
388
389
|
});
|
|
389
390
|
},
|
|
390
|
-
getItemGroupLabelProps(
|
|
391
|
+
getItemGroupLabelProps(r) {
|
|
391
392
|
return t.element({
|
|
392
|
-
...
|
|
393
|
-
id:
|
|
394
|
-
dir:
|
|
393
|
+
...O.itemGroupLabel.attrs,
|
|
394
|
+
id: te(l, r.htmlFor),
|
|
395
|
+
dir: o("dir")
|
|
395
396
|
});
|
|
396
397
|
},
|
|
397
|
-
getItemGroupProps(
|
|
398
|
+
getItemGroupProps(r) {
|
|
398
399
|
return t.element({
|
|
399
|
-
id:
|
|
400
|
-
...
|
|
401
|
-
dir:
|
|
402
|
-
"aria-labelledby":
|
|
400
|
+
id: We(l, r.id),
|
|
401
|
+
...O.itemGroup.attrs,
|
|
402
|
+
dir: o("dir"),
|
|
403
|
+
"aria-labelledby": te(l, r.id),
|
|
403
404
|
role: "group"
|
|
404
405
|
});
|
|
405
406
|
}
|
|
406
407
|
};
|
|
407
408
|
}
|
|
408
|
-
var { not: m, and:
|
|
409
|
+
var { not: m, and: R, or: je } = he(), st = ce({
|
|
409
410
|
props({ props: e }) {
|
|
410
411
|
return {
|
|
411
412
|
closeOnSelect: !0,
|
|
@@ -413,7 +414,7 @@ var { not: m, and: v, or: qe } = he(), at = ce({
|
|
|
413
414
|
composite: !0,
|
|
414
415
|
loopFocus: !1,
|
|
415
416
|
navigate(t) {
|
|
416
|
-
|
|
417
|
+
Re(t.node);
|
|
417
418
|
},
|
|
418
419
|
...e,
|
|
419
420
|
positioning: {
|
|
@@ -435,8 +436,8 @@ var { not: m, and: v, or: qe } = he(), at = ce({
|
|
|
435
436
|
defaultValue: t("defaultHighlightedValue") || null,
|
|
436
437
|
value: t("highlightedValue"),
|
|
437
438
|
onChange(n) {
|
|
438
|
-
var
|
|
439
|
-
(
|
|
439
|
+
var i;
|
|
440
|
+
(i = t("onHighlightChange")) == null || i({ highlightedValue: n });
|
|
440
441
|
}
|
|
441
442
|
})),
|
|
442
443
|
lastHighlightedValue: e(() => ({
|
|
@@ -453,6 +454,9 @@ var { not: m, and: v, or: qe } = he(), at = ce({
|
|
|
453
454
|
hash(n) {
|
|
454
455
|
return `x: ${n == null ? void 0 : n.x}, y: ${n == null ? void 0 : n.y}`;
|
|
455
456
|
}
|
|
457
|
+
})),
|
|
458
|
+
isSubmenu: e(() => ({
|
|
459
|
+
defaultValue: !1
|
|
456
460
|
}))
|
|
457
461
|
};
|
|
458
462
|
},
|
|
@@ -465,17 +469,16 @@ var { not: m, and: v, or: qe } = he(), at = ce({
|
|
|
465
469
|
};
|
|
466
470
|
},
|
|
467
471
|
computed: {
|
|
468
|
-
isSubmenu: ({ refs: e }) => e.get("parent") != null,
|
|
469
472
|
isRtl: ({ prop: e }) => e("dir") === "rtl",
|
|
470
473
|
isTypingAhead: ({ refs: e }) => e.get("typeaheadState").keysSoFar !== "",
|
|
471
|
-
highlightedId: ({ context: e, scope: t, refs: n }) =>
|
|
474
|
+
highlightedId: ({ context: e, scope: t, refs: n }) => Qe(n.get("children"), e.get("highlightedValue"), t)
|
|
472
475
|
},
|
|
473
|
-
watch({ track: e, action: t, context: n,
|
|
474
|
-
e([() =>
|
|
476
|
+
watch({ track: e, action: t, context: n, prop: i }) {
|
|
477
|
+
e([() => n.get("isSubmenu")], () => {
|
|
475
478
|
t(["setSubmenuPlacement"]);
|
|
476
479
|
}), e([() => n.hash("anchorPoint")], () => {
|
|
477
|
-
t(["reposition"]);
|
|
478
|
-
}), e([() =>
|
|
480
|
+
n.get("anchorPoint") && t(["reposition"]);
|
|
481
|
+
}), e([() => i("open")], () => {
|
|
479
482
|
t(["toggleVisibility"]);
|
|
480
483
|
});
|
|
481
484
|
},
|
|
@@ -678,11 +681,11 @@ var { not: m, and: v, or: qe } = he(), at = ce({
|
|
|
678
681
|
},
|
|
679
682
|
closed: {
|
|
680
683
|
tags: ["closed"],
|
|
681
|
-
entry: ["clearHighlightedItem", "focusTrigger", "resumePointer"],
|
|
684
|
+
entry: ["clearHighlightedItem", "focusTrigger", "resumePointer", "clearAnchorPoint"],
|
|
682
685
|
on: {
|
|
683
686
|
"CONTROLLED.OPEN": [
|
|
684
687
|
{
|
|
685
|
-
guard:
|
|
688
|
+
guard: je("isOpenAutoFocusEvent", "isArrowDownEvent"),
|
|
686
689
|
target: "open",
|
|
687
690
|
actions: ["highlightFirstItem"]
|
|
688
691
|
},
|
|
@@ -763,7 +766,7 @@ var { not: m, and: v, or: qe } = he(), at = ce({
|
|
|
763
766
|
],
|
|
764
767
|
TRIGGER_CLICK: [
|
|
765
768
|
{
|
|
766
|
-
guard:
|
|
769
|
+
guard: R(m("isTriggerItem"), "isOpenControlled"),
|
|
767
770
|
actions: ["invokeOnClose"]
|
|
768
771
|
},
|
|
769
772
|
{
|
|
@@ -783,7 +786,7 @@ var { not: m, and: v, or: qe } = he(), at = ce({
|
|
|
783
786
|
},
|
|
784
787
|
ARROW_LEFT: [
|
|
785
788
|
{
|
|
786
|
-
guard:
|
|
789
|
+
guard: R("isSubmenu", "isOpenControlled"),
|
|
787
790
|
actions: ["invokeOnClose"]
|
|
788
791
|
},
|
|
789
792
|
{
|
|
@@ -821,13 +824,13 @@ var { not: m, and: v, or: qe } = he(), at = ce({
|
|
|
821
824
|
}
|
|
822
825
|
],
|
|
823
826
|
ITEM_POINTERLEAVE: {
|
|
824
|
-
guard:
|
|
827
|
+
guard: R(m("isPointerSuspended"), m("isTriggerItem")),
|
|
825
828
|
actions: ["clearHighlightedItem"]
|
|
826
829
|
},
|
|
827
830
|
ITEM_CLICK: [
|
|
828
831
|
// == grouped ==
|
|
829
832
|
{
|
|
830
|
-
guard:
|
|
833
|
+
guard: R(
|
|
831
834
|
m("isTriggerItemHighlighted"),
|
|
832
835
|
m("isHighlightedItemEditable"),
|
|
833
836
|
"closeOnSelect",
|
|
@@ -836,13 +839,13 @@ var { not: m, and: v, or: qe } = he(), at = ce({
|
|
|
836
839
|
actions: ["invokeOnSelect", "setOptionState", "closeRootMenu", "invokeOnClose"]
|
|
837
840
|
},
|
|
838
841
|
{
|
|
839
|
-
guard:
|
|
842
|
+
guard: R(m("isTriggerItemHighlighted"), m("isHighlightedItemEditable"), "closeOnSelect"),
|
|
840
843
|
target: "closed",
|
|
841
844
|
actions: ["invokeOnSelect", "setOptionState", "closeRootMenu", "invokeOnClose"]
|
|
842
845
|
},
|
|
843
846
|
//
|
|
844
847
|
{
|
|
845
|
-
guard:
|
|
848
|
+
guard: R(m("isTriggerItemHighlighted"), m("isHighlightedItemEditable")),
|
|
846
849
|
actions: ["invokeOnSelect", "setOptionState"]
|
|
847
850
|
},
|
|
848
851
|
{ actions: ["setHighlightedItem"] }
|
|
@@ -873,13 +876,13 @@ var { not: m, and: v, or: qe } = he(), at = ce({
|
|
|
873
876
|
guards: {
|
|
874
877
|
closeOnSelect: ({ prop: e, event: t }) => !!((t == null ? void 0 : t.closeOnSelect) ?? e("closeOnSelect")),
|
|
875
878
|
// whether the trigger is also a menu item
|
|
876
|
-
isTriggerItem: ({ event: e }) =>
|
|
879
|
+
isTriggerItem: ({ event: e }) => Ye(e.target),
|
|
877
880
|
// whether the trigger item is the active item
|
|
878
881
|
isTriggerItemHighlighted: ({ event: e, scope: t, computed: n }) => {
|
|
879
|
-
const
|
|
880
|
-
return !!(
|
|
882
|
+
const i = e.target ?? t.getById(n("highlightedId"));
|
|
883
|
+
return !!(i != null && i.hasAttribute("aria-controls"));
|
|
881
884
|
},
|
|
882
|
-
isSubmenu: ({
|
|
885
|
+
isSubmenu: ({ context: e }) => e.get("isSubmenu"),
|
|
883
886
|
isPointerSuspended: ({ context: e }) => e.get("suspendPointer"),
|
|
884
887
|
isHighlightedItemEditable: ({ scope: e, computed: t }) => re(e.getById(t("highlightedId"))),
|
|
885
888
|
// guard assertions (for controlled mode)
|
|
@@ -920,119 +923,132 @@ var { not: m, and: v, or: qe } = he(), at = ce({
|
|
|
920
923
|
}, 700);
|
|
921
924
|
return () => clearTimeout(t);
|
|
922
925
|
},
|
|
923
|
-
trackPositioning({ context: e, prop: t, scope: n, refs:
|
|
924
|
-
if (
|
|
925
|
-
const
|
|
926
|
+
trackPositioning({ context: e, prop: t, scope: n, refs: i }) {
|
|
927
|
+
if (x(n)) return;
|
|
928
|
+
const s = {
|
|
926
929
|
...t("positioning"),
|
|
927
|
-
...
|
|
930
|
+
...i.get("positioningOverride")
|
|
928
931
|
};
|
|
929
|
-
e.set("currentPlacement",
|
|
930
|
-
const g = () =>
|
|
931
|
-
return
|
|
932
|
-
...
|
|
932
|
+
e.set("currentPlacement", s.placement);
|
|
933
|
+
const g = () => ne(n);
|
|
934
|
+
return z(_(n), g, {
|
|
935
|
+
...s,
|
|
933
936
|
defer: !0,
|
|
934
|
-
onComplete(
|
|
935
|
-
e.set("currentPlacement",
|
|
937
|
+
onComplete(o) {
|
|
938
|
+
e.set("currentPlacement", o.placement);
|
|
936
939
|
}
|
|
937
940
|
});
|
|
938
941
|
},
|
|
939
|
-
trackInteractOutside({ refs: e, scope: t, prop: n,
|
|
942
|
+
trackInteractOutside({ refs: e, scope: t, prop: n, context: i, send: s }) {
|
|
940
943
|
const g = () => I(t);
|
|
941
|
-
let
|
|
942
|
-
return
|
|
944
|
+
let o = !0;
|
|
945
|
+
return we(g, {
|
|
943
946
|
defer: !0,
|
|
944
|
-
exclude: [
|
|
947
|
+
exclude: [_(t)],
|
|
945
948
|
onInteractOutside: n("onInteractOutside"),
|
|
946
|
-
|
|
949
|
+
onRequestDismiss: n("onRequestDismiss"),
|
|
950
|
+
onFocusOutside(l) {
|
|
951
|
+
var P;
|
|
952
|
+
(P = n("onFocusOutside")) == null || P(l);
|
|
953
|
+
const u = B(l.detail.originalEvent);
|
|
954
|
+
if (U(x(t), u)) {
|
|
955
|
+
l.preventDefault();
|
|
956
|
+
return;
|
|
957
|
+
}
|
|
958
|
+
},
|
|
947
959
|
onEscapeKeyDown(l) {
|
|
948
|
-
var
|
|
949
|
-
(
|
|
960
|
+
var u;
|
|
961
|
+
(u = n("onEscapeKeyDown")) == null || u(l), i.get("isSubmenu") && l.preventDefault(), ie({ parent: e.get("parent") });
|
|
950
962
|
},
|
|
951
963
|
onPointerDownOutside(l) {
|
|
952
|
-
var
|
|
953
|
-
|
|
954
|
-
|
|
964
|
+
var P;
|
|
965
|
+
(P = n("onPointerDownOutside")) == null || P(l);
|
|
966
|
+
const u = B(l.detail.originalEvent);
|
|
967
|
+
if (U(x(t), u) && l.detail.contextmenu) {
|
|
955
968
|
l.preventDefault();
|
|
956
969
|
return;
|
|
957
970
|
}
|
|
958
|
-
|
|
971
|
+
o = !l.detail.focusable;
|
|
959
972
|
},
|
|
960
973
|
onDismiss() {
|
|
961
|
-
|
|
974
|
+
s({ type: "CLOSE", src: "interact-outside", restoreFocus: o });
|
|
962
975
|
}
|
|
963
976
|
});
|
|
964
977
|
},
|
|
965
|
-
trackPointerMove({ context: e, scope: t, send: n, refs:
|
|
966
|
-
const g =
|
|
967
|
-
|
|
978
|
+
trackPointerMove({ context: e, scope: t, send: n, refs: i, flush: s }) {
|
|
979
|
+
const g = i.get("parent");
|
|
980
|
+
s(() => {
|
|
968
981
|
g.context.set("suspendPointer", !0);
|
|
969
982
|
});
|
|
970
|
-
const
|
|
971
|
-
return Ce(
|
|
972
|
-
|
|
983
|
+
const o = t.getDoc();
|
|
984
|
+
return Ce(o, "pointermove", (l) => {
|
|
985
|
+
Je(e.get("intentPolygon"), {
|
|
973
986
|
x: l.clientX,
|
|
974
987
|
y: l.clientY
|
|
975
988
|
}) || (n({ type: "POINTER_MOVED_AWAY_FROM_SUBMENU" }), g.context.set("suspendPointer", !1));
|
|
976
989
|
});
|
|
977
990
|
},
|
|
978
991
|
scrollToHighlightedItem({ event: e, scope: t, computed: n }) {
|
|
979
|
-
const
|
|
992
|
+
const i = () => {
|
|
980
993
|
if (e.type.startsWith("ITEM_POINTER")) return;
|
|
981
|
-
const g = t.getById(n("highlightedId")),
|
|
982
|
-
ke(g, { rootEl:
|
|
994
|
+
const g = t.getById(n("highlightedId")), o = I(t);
|
|
995
|
+
ke(g, { rootEl: o, block: "nearest" });
|
|
983
996
|
};
|
|
984
|
-
return
|
|
997
|
+
return D(() => i()), ye(() => I(t), {
|
|
985
998
|
defer: !0,
|
|
986
999
|
attributes: ["aria-activedescendant"],
|
|
987
|
-
callback:
|
|
1000
|
+
callback: i
|
|
988
1001
|
});
|
|
989
1002
|
}
|
|
990
1003
|
},
|
|
991
1004
|
actions: {
|
|
992
1005
|
setAnchorPoint({ context: e, event: t }) {
|
|
993
|
-
e.set("anchorPoint", t.point);
|
|
1006
|
+
e.set("anchorPoint", (n) => De(n, t.point) ? n : t.point);
|
|
994
1007
|
},
|
|
995
|
-
setSubmenuPlacement({
|
|
996
|
-
if (!e("isSubmenu")) return;
|
|
997
|
-
const
|
|
998
|
-
|
|
1008
|
+
setSubmenuPlacement({ context: e, computed: t, refs: n }) {
|
|
1009
|
+
if (!e.get("isSubmenu")) return;
|
|
1010
|
+
const i = t("isRtl") ? "left-start" : "right-start";
|
|
1011
|
+
n.set("positioningOverride", { placement: i, gutter: 0 });
|
|
999
1012
|
},
|
|
1000
|
-
reposition({ context: e, scope: t, prop: n, event:
|
|
1001
|
-
const g = () =>
|
|
1013
|
+
reposition({ context: e, scope: t, prop: n, event: i, refs: s }) {
|
|
1014
|
+
const g = () => ne(t), o = e.get("anchorPoint"), l = o ? () => ({ width: 0, height: 0, ...o }) : void 0, u = {
|
|
1002
1015
|
...n("positioning"),
|
|
1003
|
-
...
|
|
1016
|
+
...s.get("positioningOverride")
|
|
1004
1017
|
};
|
|
1005
|
-
|
|
1006
|
-
...
|
|
1018
|
+
z(_(t), g, {
|
|
1019
|
+
...u,
|
|
1007
1020
|
defer: !0,
|
|
1008
1021
|
getAnchorRect: l,
|
|
1009
|
-
...
|
|
1022
|
+
...i.options ?? {},
|
|
1010
1023
|
listeners: !1,
|
|
1011
|
-
onComplete(
|
|
1012
|
-
e.set("currentPlacement",
|
|
1024
|
+
onComplete(f) {
|
|
1025
|
+
e.set("currentPlacement", f.placement);
|
|
1013
1026
|
}
|
|
1014
1027
|
});
|
|
1015
1028
|
},
|
|
1016
1029
|
setOptionState({ event: e }) {
|
|
1017
1030
|
if (!e.option) return;
|
|
1018
|
-
const { checked: t, onCheckedChange: n, type:
|
|
1019
|
-
|
|
1031
|
+
const { checked: t, onCheckedChange: n, type: i } = e.option;
|
|
1032
|
+
i === "radio" ? n == null || n(!0) : i === "checkbox" && (n == null || n(!t));
|
|
1020
1033
|
},
|
|
1021
1034
|
clickHighlightedItem({ scope: e, computed: t }) {
|
|
1022
1035
|
const n = e.getById(t("highlightedId"));
|
|
1023
1036
|
!n || n.dataset.disabled || queueMicrotask(() => n.click());
|
|
1024
1037
|
},
|
|
1025
1038
|
setIntentPolygon({ context: e, scope: t, event: n }) {
|
|
1026
|
-
const
|
|
1027
|
-
if (!
|
|
1028
|
-
const g =
|
|
1029
|
-
if (!
|
|
1030
|
-
const
|
|
1031
|
-
e.set("intentPolygon", [{ ...n.point, x: n.point.x +
|
|
1039
|
+
const i = I(t), s = e.get("currentPlacement");
|
|
1040
|
+
if (!i || !s) return;
|
|
1041
|
+
const g = i.getBoundingClientRect(), o = Ge(g, s);
|
|
1042
|
+
if (!o) return;
|
|
1043
|
+
const u = Ae(s) === "right" ? -5 : 5;
|
|
1044
|
+
e.set("intentPolygon", [{ ...n.point, x: n.point.x + u }, ...o]);
|
|
1032
1045
|
},
|
|
1033
1046
|
clearIntentPolygon({ context: e }) {
|
|
1034
1047
|
e.set("intentPolygon", null);
|
|
1035
1048
|
},
|
|
1049
|
+
clearAnchorPoint({ context: e }) {
|
|
1050
|
+
e.set("anchorPoint", null);
|
|
1051
|
+
},
|
|
1036
1052
|
resumePointer({ refs: e, flush: t }) {
|
|
1037
1053
|
const n = e.get("parent");
|
|
1038
1054
|
n && t(() => {
|
|
@@ -1040,94 +1056,94 @@ var { not: m, and: v, or: qe } = he(), at = ce({
|
|
|
1040
1056
|
});
|
|
1041
1057
|
},
|
|
1042
1058
|
setHighlightedItem({ context: e, event: t }) {
|
|
1043
|
-
const n = t.value ||
|
|
1059
|
+
const n = t.value || y(t.target);
|
|
1044
1060
|
e.set("highlightedValue", n);
|
|
1045
1061
|
},
|
|
1046
1062
|
clearHighlightedItem({ context: e }) {
|
|
1047
1063
|
e.set("highlightedValue", null);
|
|
1048
1064
|
},
|
|
1049
1065
|
focusMenu({ scope: e }) {
|
|
1050
|
-
|
|
1066
|
+
D(() => {
|
|
1051
1067
|
const t = I(e), n = Ne({
|
|
1052
1068
|
root: t,
|
|
1053
|
-
enabled: !
|
|
1054
|
-
filter(
|
|
1055
|
-
var
|
|
1056
|
-
return !((
|
|
1069
|
+
enabled: !U(t, e.getActiveElement()),
|
|
1070
|
+
filter(i) {
|
|
1071
|
+
var s;
|
|
1072
|
+
return !((s = i.role) != null && s.startsWith("menuitem"));
|
|
1057
1073
|
}
|
|
1058
1074
|
});
|
|
1059
1075
|
n == null || n.focus({ preventScroll: !0 });
|
|
1060
1076
|
});
|
|
1061
1077
|
},
|
|
1062
1078
|
highlightFirstItem({ context: e, scope: t }) {
|
|
1063
|
-
(I(t) ? queueMicrotask :
|
|
1064
|
-
const
|
|
1065
|
-
|
|
1079
|
+
(I(t) ? queueMicrotask : D)(() => {
|
|
1080
|
+
const i = xe(t);
|
|
1081
|
+
i && e.set("highlightedValue", y(i));
|
|
1066
1082
|
});
|
|
1067
1083
|
},
|
|
1068
1084
|
highlightLastItem({ context: e, scope: t }) {
|
|
1069
|
-
(I(t) ? queueMicrotask :
|
|
1070
|
-
const
|
|
1071
|
-
|
|
1085
|
+
(I(t) ? queueMicrotask : D)(() => {
|
|
1086
|
+
const i = Be(t);
|
|
1087
|
+
i && e.set("highlightedValue", y(i));
|
|
1072
1088
|
});
|
|
1073
1089
|
},
|
|
1074
|
-
highlightNextItem({ context: e, scope: t, event: n, prop:
|
|
1075
|
-
const
|
|
1090
|
+
highlightNextItem({ context: e, scope: t, event: n, prop: i }) {
|
|
1091
|
+
const s = Ke(t, {
|
|
1076
1092
|
loop: n.loop,
|
|
1077
1093
|
value: e.get("highlightedValue"),
|
|
1078
|
-
loopFocus:
|
|
1094
|
+
loopFocus: i("loopFocus")
|
|
1079
1095
|
});
|
|
1080
|
-
e.set("highlightedValue",
|
|
1096
|
+
e.set("highlightedValue", y(s));
|
|
1081
1097
|
},
|
|
1082
|
-
highlightPrevItem({ context: e, scope: t, event: n, prop:
|
|
1083
|
-
const
|
|
1098
|
+
highlightPrevItem({ context: e, scope: t, event: n, prop: i }) {
|
|
1099
|
+
const s = $e(t, {
|
|
1084
1100
|
loop: n.loop,
|
|
1085
1101
|
value: e.get("highlightedValue"),
|
|
1086
|
-
loopFocus:
|
|
1102
|
+
loopFocus: i("loopFocus")
|
|
1087
1103
|
});
|
|
1088
|
-
e.set("highlightedValue",
|
|
1104
|
+
e.set("highlightedValue", y(s));
|
|
1089
1105
|
},
|
|
1090
1106
|
invokeOnSelect({ context: e, prop: t, scope: n }) {
|
|
1091
1107
|
var g;
|
|
1092
|
-
const
|
|
1093
|
-
if (
|
|
1094
|
-
const
|
|
1095
|
-
|
|
1108
|
+
const i = e.get("highlightedValue");
|
|
1109
|
+
if (i == null) return;
|
|
1110
|
+
const s = le(n, i);
|
|
1111
|
+
qe(s, i), (g = t("onSelect")) == null || g({ value: i });
|
|
1096
1112
|
},
|
|
1097
|
-
focusTrigger({ scope: e, context: t, event: n
|
|
1098
|
-
|
|
1099
|
-
var
|
|
1100
|
-
return (
|
|
1113
|
+
focusTrigger({ scope: e, context: t, event: n }) {
|
|
1114
|
+
t.get("isSubmenu") || t.get("anchorPoint") || n.restoreFocus === !1 || queueMicrotask(() => {
|
|
1115
|
+
var i;
|
|
1116
|
+
return (i = _(e)) == null ? void 0 : i.focus({ preventScroll: !0 });
|
|
1101
1117
|
});
|
|
1102
1118
|
},
|
|
1103
|
-
highlightMatchedItem({ scope: e, context: t, event: n, refs:
|
|
1104
|
-
const
|
|
1119
|
+
highlightMatchedItem({ scope: e, context: t, event: n, refs: i }) {
|
|
1120
|
+
const s = Xe(e, {
|
|
1105
1121
|
key: n.key,
|
|
1106
1122
|
value: t.get("highlightedValue"),
|
|
1107
|
-
typeaheadState:
|
|
1123
|
+
typeaheadState: i.get("typeaheadState")
|
|
1108
1124
|
});
|
|
1109
|
-
|
|
1125
|
+
s && t.set("highlightedValue", y(s));
|
|
1110
1126
|
},
|
|
1111
|
-
setParentMenu({ refs: e, event: t }) {
|
|
1112
|
-
e.set("parent", t.value);
|
|
1127
|
+
setParentMenu({ refs: e, event: t, context: n }) {
|
|
1128
|
+
e.set("parent", t.value), n.set("isSubmenu", !0);
|
|
1113
1129
|
},
|
|
1114
1130
|
setChildMenu({ refs: e, event: t }) {
|
|
1115
1131
|
const n = e.get("children");
|
|
1116
1132
|
n[t.id] = t.value, e.set("children", n);
|
|
1117
1133
|
},
|
|
1118
1134
|
closeRootMenu({ refs: e }) {
|
|
1119
|
-
|
|
1135
|
+
ie({ parent: e.get("parent") });
|
|
1120
1136
|
},
|
|
1121
1137
|
openSubmenu({ refs: e, scope: t, computed: n }) {
|
|
1122
|
-
const
|
|
1123
|
-
|
|
1138
|
+
const i = t.getById(n("highlightedId")), s = i == null ? void 0 : i.getAttribute("data-uid"), g = e.get("children"), o = s ? g[s] : null;
|
|
1139
|
+
o == null || o.send({ type: "OPEN_AUTOFOCUS" });
|
|
1124
1140
|
},
|
|
1125
1141
|
focusParentMenu({ refs: e }) {
|
|
1126
1142
|
var t;
|
|
1127
1143
|
(t = e.get("parent")) == null || t.send({ type: "FOCUS_MENU" });
|
|
1128
1144
|
},
|
|
1129
1145
|
setLastHighlightedItem({ context: e, event: t }) {
|
|
1130
|
-
e.set("lastHighlightedValue",
|
|
1146
|
+
e.set("lastHighlightedValue", y(t.target));
|
|
1131
1147
|
},
|
|
1132
1148
|
restoreHighlightedItem({ context: e }) {
|
|
1133
1149
|
e.get("lastHighlightedValue") && (e.set("highlightedValue", e.get("lastHighlightedValue")), e.set("lastHighlightedValue", null));
|
|
@@ -1153,24 +1169,24 @@ var { not: m, and: v, or: qe } = he(), at = ce({
|
|
|
1153
1169
|
}
|
|
1154
1170
|
}
|
|
1155
1171
|
});
|
|
1156
|
-
function
|
|
1172
|
+
function ie(e) {
|
|
1157
1173
|
let t = e.parent;
|
|
1158
|
-
for (; t && t.
|
|
1174
|
+
for (; t && t.context.get("isSubmenu"); )
|
|
1159
1175
|
t = t.refs.get("parent");
|
|
1160
1176
|
t == null || t.send({ type: "CLOSE" });
|
|
1161
1177
|
}
|
|
1162
|
-
function
|
|
1163
|
-
return e ?
|
|
1178
|
+
function Je(e, t) {
|
|
1179
|
+
return e ? Ve(e, t) : !1;
|
|
1164
1180
|
}
|
|
1165
|
-
function
|
|
1166
|
-
const
|
|
1181
|
+
function Qe(e, t, n) {
|
|
1182
|
+
const i = Object.keys(e).length > 0;
|
|
1167
1183
|
if (!t) return null;
|
|
1168
|
-
if (!
|
|
1184
|
+
if (!i)
|
|
1169
1185
|
return N(n, t);
|
|
1170
|
-
for (const
|
|
1171
|
-
const g = e[
|
|
1172
|
-
if (
|
|
1173
|
-
return
|
|
1186
|
+
for (const s in e) {
|
|
1187
|
+
const g = e[s], o = w(g.scope);
|
|
1188
|
+
if (o === t)
|
|
1189
|
+
return o;
|
|
1174
1190
|
}
|
|
1175
1191
|
return N(n, t);
|
|
1176
1192
|
}
|
|
@@ -1194,6 +1210,7 @@ k()([
|
|
|
1194
1210
|
"onInteractOutside",
|
|
1195
1211
|
"onOpenChange",
|
|
1196
1212
|
"onPointerDownOutside",
|
|
1213
|
+
"onRequestDismiss",
|
|
1197
1214
|
"onSelect",
|
|
1198
1215
|
"open",
|
|
1199
1216
|
"positioning",
|
|
@@ -1212,7 +1229,7 @@ k()([
|
|
|
1212
1229
|
"valueText"
|
|
1213
1230
|
]);
|
|
1214
1231
|
export {
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1232
|
+
Fe as anatomy,
|
|
1233
|
+
at as connect,
|
|
1234
|
+
st as machine
|
|
1218
1235
|
};
|