@serendie/ui 3.5.1-dev.202606091509 → 3.5.1
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/BottomNavigation/BottomNavigation.d.ts +1 -1
- package/dist/components/DataTable/DataTableComponent.d.ts +1 -1
- package/dist/components/DataTable/table/BodyCheckbox.d.ts +1 -1
- package/dist/components/Divider/Divider.d.ts +1 -1
- package/dist/components/List/List.d.ts +1 -1
- package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +1 -1
- package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.d.ts +1 -1
- package/dist/components/Tabs/TabItem.d.ts +1 -1
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/i18n/provider.d.ts +1 -1
- package/dist/node_modules/@zag-js/accordion/dist/accordion.connect.js +50 -49
- package/dist/node_modules/@zag-js/combobox/dist/combobox.connect.js +68 -70
- package/dist/node_modules/@zag-js/combobox/dist/combobox.machine.js +1 -1
- package/dist/node_modules/@zag-js/date-picker/dist/date-picker.connect.js +308 -322
- package/dist/node_modules/@zag-js/date-picker/dist/date-picker.machine.js +79 -93
- package/dist/node_modules/@zag-js/date-picker/dist/date-picker.utils.js +43 -35
- package/dist/node_modules/@zag-js/dialog/dist/dialog.dom.js +35 -36
- package/dist/node_modules/@zag-js/dialog/dist/dialog.machine.js +37 -27
- package/dist/node_modules/@zag-js/dismissable/dist/dismissable-layer.js +41 -56
- package/dist/node_modules/@zag-js/dismissable/dist/layer-stack.js +31 -51
- package/dist/node_modules/@zag-js/dismissable/dist/pointer-event-outside.js +25 -46
- package/dist/node_modules/@zag-js/dom-query/dist/controller.js +5 -5
- package/dist/node_modules/@zag-js/dom-query/dist/overflow.js +21 -13
- package/dist/node_modules/@zag-js/live-region/dist/index.js +19 -29
- package/dist/node_modules/@zag-js/menu/dist/menu.connect.js +135 -138
- package/dist/node_modules/@zag-js/menu/dist/menu.dom.js +24 -24
- package/dist/node_modules/@zag-js/menu/dist/menu.machine.js +1 -1
- package/dist/node_modules/@zag-js/popper/dist/get-placement.js +71 -82
- package/dist/node_modules/@zag-js/react/dist/machine.js +96 -105
- package/dist/node_modules/@zag-js/remove-scroll/dist/index.js +26 -34
- package/dist/node_modules/@zag-js/select/dist/select.connect.js +101 -104
- package/dist/node_modules/@zag-js/select/dist/select.machine.js +1 -1
- package/dist/node_modules/@zag-js/tabs/dist/tabs.machine.js +60 -63
- package/dist/node_modules/@zag-js/tooltip/dist/tooltip.connect.js +25 -27
- package/dist/node_modules/@zag-js/tooltip/dist/tooltip.dom.js +14 -15
- package/dist/theme/initColorScheme.d.ts +1 -1
- package/package.json +8 -8
- package/dist/node_modules/@zag-js/date-utils/dist/locale.js +0 -12
- package/dist/node_modules/@zag-js/dom-query/dist/scroll.js +0 -11
|
@@ -1,19 +1,27 @@
|
|
|
1
|
-
import { getWindow as c, getParentNode as u, isRootElement as
|
|
2
|
-
function
|
|
3
|
-
const
|
|
4
|
-
return
|
|
1
|
+
import { getWindow as c, getParentNode as u, isRootElement as f, getDocument as a, isHTMLElement as w } from "./node.js";
|
|
2
|
+
function l(t) {
|
|
3
|
+
const o = u(t);
|
|
4
|
+
return f(o) ? a(o).body : w(o) && i(o) ? o : l(o);
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
const
|
|
8
|
-
return
|
|
6
|
+
function d(t, o = []) {
|
|
7
|
+
const n = l(t), e = n === t.ownerDocument.body, r = c(n);
|
|
8
|
+
return e ? o.concat(r, r.visualViewport || [], i(n) ? n : []) : o.concat(n, d(n, []));
|
|
9
9
|
}
|
|
10
|
-
var
|
|
10
|
+
var v = /auto|scroll|overlay|hidden|clip/, g = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
11
11
|
function i(t) {
|
|
12
|
-
const
|
|
13
|
-
return
|
|
12
|
+
const o = c(t), { overflow: n, overflowX: e, overflowY: r, display: s } = o.getComputedStyle(t);
|
|
13
|
+
return v.test(n + r + e) && !g.has(s);
|
|
14
|
+
}
|
|
15
|
+
function m(t) {
|
|
16
|
+
return t.scrollHeight > t.clientHeight || t.scrollWidth > t.clientWidth;
|
|
17
|
+
}
|
|
18
|
+
function O(t, o) {
|
|
19
|
+
const { rootEl: n, ...e } = o || {};
|
|
20
|
+
!t || !n || !i(n) || !m(n) || t.scrollIntoView(e);
|
|
14
21
|
}
|
|
15
22
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
i as isOverflowElement
|
|
23
|
+
l as getNearestOverflowAncestor,
|
|
24
|
+
d as getOverflowAncestors,
|
|
25
|
+
i as isOverflowElement,
|
|
26
|
+
O as scrollIntoView
|
|
19
27
|
};
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
var o = "__live-region__"
|
|
2
|
-
function
|
|
3
|
-
const { level:
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
r == null || r.remove(), i = i ?? p;
|
|
12
|
-
const n = t.createElement("span");
|
|
13
|
-
n.id = o, n.dataset.liveAnnouncer = "true";
|
|
14
|
-
const f = d !== "assertive" ? "status" : "alert";
|
|
15
|
-
n.setAttribute("aria-live", d), n.setAttribute("role", f), Object.assign(n.style, {
|
|
1
|
+
var o = "__live-region__";
|
|
2
|
+
function w(s = {}) {
|
|
3
|
+
const { level: a = "polite", document: t = document, root: c, delay: d = 0 } = s, l = t.defaultView ?? window, u = c ?? t.body;
|
|
4
|
+
function p(n, r) {
|
|
5
|
+
const i = t.getElementById(o);
|
|
6
|
+
i == null || i.remove(), r = r ?? d;
|
|
7
|
+
const e = t.createElement("span");
|
|
8
|
+
e.id = o, e.dataset.liveAnnouncer = "true";
|
|
9
|
+
const v = a !== "assertive" ? "status" : "alert";
|
|
10
|
+
e.setAttribute("aria-live", a), e.setAttribute("role", v), Object.assign(e.style, {
|
|
16
11
|
border: "0",
|
|
17
12
|
clip: "rect(0 0 0 0)",
|
|
18
13
|
height: "1px",
|
|
@@ -23,27 +18,22 @@ function _(l = {}) {
|
|
|
23
18
|
width: "1px",
|
|
24
19
|
whiteSpace: "nowrap",
|
|
25
20
|
wordWrap: "normal"
|
|
26
|
-
}),
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const c = b();
|
|
30
|
-
c && (c.textContent = e);
|
|
31
|
-
}, i);
|
|
21
|
+
}), u.appendChild(e), l.setTimeout(() => {
|
|
22
|
+
e.textContent = n;
|
|
23
|
+
}, r);
|
|
32
24
|
}
|
|
33
|
-
function
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
const i = t.getElementById(a);
|
|
37
|
-
i == null || i.remove();
|
|
25
|
+
function m() {
|
|
26
|
+
const n = t.getElementById(o);
|
|
27
|
+
n == null || n.remove();
|
|
38
28
|
}
|
|
39
29
|
return {
|
|
40
|
-
announce:
|
|
41
|
-
destroy:
|
|
30
|
+
announce: p,
|
|
31
|
+
destroy: m,
|
|
42
32
|
toJSON() {
|
|
43
33
|
return o;
|
|
44
34
|
}
|
|
45
35
|
};
|
|
46
36
|
}
|
|
47
37
|
export {
|
|
48
|
-
|
|
38
|
+
w as createLiveRegion
|
|
49
39
|
};
|
|
@@ -1,46 +1,45 @@
|
|
|
1
|
-
import { isDownloadingEvent as x, isOpeningInNewTab as U, getEventTarget as
|
|
2
|
-
import { isValidTabEvent as
|
|
3
|
-
import { contains as
|
|
4
|
-
import { dataAttr as T, ariaAttr as
|
|
5
|
-
import { getPlacementStyles as
|
|
6
|
-
import { getPlacementSide as re } from "../../popper/dist/placement.js";
|
|
1
|
+
import { isDownloadingEvent as x, isOpeningInNewTab as U, getEventTarget as v, getEventKey as W, isPrintableKey as $, isModifierKey as j, isContextMenuEvent as q, getEventPoint as f } from "../../dom-query/dist/event.js";
|
|
2
|
+
import { isValidTabEvent as J } from "../../dom-query/dist/initial-focus.js";
|
|
3
|
+
import { contains as Q, isEditableElement as Z } from "../../dom-query/dist/node.js";
|
|
4
|
+
import { dataAttr as T, ariaAttr as z } from "../../dom-query/dist/shared.js";
|
|
5
|
+
import { getPlacementStyles as tt } from "../../popper/dist/get-styles.js";
|
|
7
6
|
import { parts as l } from "./menu.anatomy.js";
|
|
8
|
-
import { getGroupLabelId as
|
|
9
|
-
import { setParentRoutingLock as
|
|
10
|
-
import { hasProp as
|
|
11
|
-
import { mergeProps as
|
|
12
|
-
import { cast as
|
|
13
|
-
function
|
|
14
|
-
const { context: m, send: n, state:
|
|
7
|
+
import { getGroupLabelId as V, getGroupId as et, getContextTriggerId as H, getTriggerId as K, getContentId as h, getArrowId as rt, getPositionerId as nt, isTargetDisabled as P, itemSelectEvent as X, getItemId as F } from "./menu.dom.js";
|
|
8
|
+
import { setParentRoutingLock as it } from "./menu.utils.js";
|
|
9
|
+
import { hasProp as N } from "../../utils/dist/guard.js";
|
|
10
|
+
import { mergeProps as ot } from "../../core/dist/merge-props.js";
|
|
11
|
+
import { cast as B } from "../../utils/dist/functions.js";
|
|
12
|
+
function ft(I, g) {
|
|
13
|
+
const { context: m, send: n, state: k, computed: C, prop: a, scope: d } = I, p = k.hasTag("open"), R = m.get("isSubmenu"), Y = C("isTypingAhead"), _ = a("composite"), L = m.get("currentPlacement"), w = m.get("anchorPoint"), D = m.get("highlightedValue"), E = m.get("triggerValue"), b = tt({
|
|
15
14
|
...a("positioning"),
|
|
16
|
-
placement:
|
|
15
|
+
placement: w ? "bottom" : L
|
|
17
16
|
});
|
|
18
|
-
function
|
|
17
|
+
function O(t) {
|
|
19
18
|
return {
|
|
20
|
-
id:
|
|
21
|
-
disabled: !!
|
|
22
|
-
highlighted:
|
|
19
|
+
id: F(d, t.value),
|
|
20
|
+
disabled: !!t.disabled,
|
|
21
|
+
highlighted: D === t.value
|
|
23
22
|
};
|
|
24
23
|
}
|
|
25
|
-
function
|
|
26
|
-
const
|
|
27
|
-
return { ...
|
|
24
|
+
function G(t) {
|
|
25
|
+
const e = t.valueText ?? t.value;
|
|
26
|
+
return { ...t, id: t.value, valueText: e };
|
|
28
27
|
}
|
|
29
|
-
function
|
|
28
|
+
function y(t) {
|
|
30
29
|
return {
|
|
31
|
-
...
|
|
32
|
-
checked: !!
|
|
30
|
+
...O(G(t)),
|
|
31
|
+
checked: !!t.checked
|
|
33
32
|
};
|
|
34
33
|
}
|
|
35
|
-
function
|
|
36
|
-
const { closeOnSelect:
|
|
34
|
+
function S(t) {
|
|
35
|
+
const { closeOnSelect: e, valueText: s, value: c } = t, r = O(t), o = F(d, c);
|
|
37
36
|
return g.element({
|
|
38
37
|
...l.item.attrs,
|
|
39
38
|
id: o,
|
|
40
39
|
role: "menuitem",
|
|
41
|
-
"aria-disabled":
|
|
40
|
+
"aria-disabled": z(r.disabled),
|
|
42
41
|
"data-disabled": T(r.disabled),
|
|
43
|
-
"data-ownedby":
|
|
42
|
+
"data-ownedby": h(d),
|
|
44
43
|
"data-highlighted": T(r.highlighted),
|
|
45
44
|
"data-value": c,
|
|
46
45
|
"data-valuetext": s,
|
|
@@ -51,72 +50,72 @@ function Pe(R, g) {
|
|
|
51
50
|
if (r.disabled || i.pointerType !== "mouse") return;
|
|
52
51
|
const u = i.currentTarget;
|
|
53
52
|
if (r.highlighted) return;
|
|
54
|
-
const
|
|
55
|
-
n({ type: "ITEM_POINTERMOVE", id: o, target: u, closeOnSelect:
|
|
53
|
+
const A = f(i);
|
|
54
|
+
n({ type: "ITEM_POINTERMOVE", id: o, target: u, closeOnSelect: e, point: A });
|
|
56
55
|
},
|
|
57
56
|
onPointerLeave(i) {
|
|
58
|
-
var
|
|
59
|
-
if (r.disabled || i.pointerType !== "mouse" || !((
|
|
60
|
-
const
|
|
61
|
-
n({ type: "ITEM_POINTERLEAVE", id: o, target:
|
|
57
|
+
var M;
|
|
58
|
+
if (r.disabled || i.pointerType !== "mouse" || !((M = I.event.previous()) == null ? void 0 : M.type.includes("POINTER"))) return;
|
|
59
|
+
const A = i.currentTarget;
|
|
60
|
+
n({ type: "ITEM_POINTERLEAVE", id: o, target: A, closeOnSelect: e });
|
|
62
61
|
},
|
|
63
62
|
onPointerDown(i) {
|
|
64
63
|
if (r.disabled) return;
|
|
65
64
|
const u = i.currentTarget;
|
|
66
|
-
n({ type: "ITEM_POINTERDOWN", target: u, id: o, closeOnSelect:
|
|
65
|
+
n({ type: "ITEM_POINTERDOWN", target: u, id: o, closeOnSelect: e });
|
|
67
66
|
},
|
|
68
67
|
onClick(i) {
|
|
69
68
|
if (x(i) || U(i) || r.disabled) return;
|
|
70
69
|
const u = i.currentTarget;
|
|
71
|
-
n({ type: "ITEM_CLICK", target: u, id: o, closeOnSelect:
|
|
70
|
+
n({ type: "ITEM_CLICK", target: u, id: o, closeOnSelect: e });
|
|
72
71
|
}
|
|
73
72
|
});
|
|
74
73
|
}
|
|
75
74
|
return {
|
|
76
|
-
highlightedValue:
|
|
75
|
+
highlightedValue: D,
|
|
77
76
|
open: p,
|
|
78
|
-
setOpen(
|
|
79
|
-
|
|
77
|
+
setOpen(t) {
|
|
78
|
+
k.hasTag("open") !== t && n({ type: t ? "OPEN" : "CLOSE" });
|
|
80
79
|
},
|
|
81
|
-
triggerValue:
|
|
82
|
-
setTriggerValue(
|
|
83
|
-
n({ type: "TRIGGER_VALUE.SET", value:
|
|
80
|
+
triggerValue: E,
|
|
81
|
+
setTriggerValue(t) {
|
|
82
|
+
n({ type: "TRIGGER_VALUE.SET", value: t });
|
|
84
83
|
},
|
|
85
|
-
setHighlightedValue(
|
|
86
|
-
n({ type: "HIGHLIGHTED.SET", value:
|
|
84
|
+
setHighlightedValue(t) {
|
|
85
|
+
n({ type: "HIGHLIGHTED.SET", value: t });
|
|
87
86
|
},
|
|
88
|
-
setParent(
|
|
89
|
-
n({ type: "PARENT.SET", value:
|
|
87
|
+
setParent(t) {
|
|
88
|
+
n({ type: "PARENT.SET", value: t, id: t.prop("id") });
|
|
90
89
|
},
|
|
91
|
-
setChild(
|
|
92
|
-
n({ type: "CHILD.SET", value:
|
|
90
|
+
setChild(t) {
|
|
91
|
+
n({ type: "CHILD.SET", value: t, id: t.prop("id") });
|
|
93
92
|
},
|
|
94
|
-
reposition(
|
|
95
|
-
n({ type: "POSITIONING.SET", options:
|
|
93
|
+
reposition(t = {}) {
|
|
94
|
+
n({ type: "POSITIONING.SET", options: t });
|
|
96
95
|
},
|
|
97
|
-
addItemListener(
|
|
98
|
-
const
|
|
99
|
-
if (!
|
|
96
|
+
addItemListener(t) {
|
|
97
|
+
const e = d.getById(t.id);
|
|
98
|
+
if (!e) return;
|
|
100
99
|
const s = () => {
|
|
101
100
|
var c;
|
|
102
|
-
return (c =
|
|
101
|
+
return (c = t.onSelect) == null ? void 0 : c.call(t);
|
|
103
102
|
};
|
|
104
|
-
return
|
|
103
|
+
return e.addEventListener(X, s), () => e.removeEventListener(X, s);
|
|
105
104
|
},
|
|
106
|
-
getContextTriggerProps(
|
|
107
|
-
const { value:
|
|
105
|
+
getContextTriggerProps(t = {}) {
|
|
106
|
+
const { value: e } = t, s = e == null ? !1 : E === e, c = H(d, e);
|
|
108
107
|
return g.element({
|
|
109
108
|
...l.contextTrigger.attrs,
|
|
110
109
|
dir: a("dir"),
|
|
111
110
|
id: c,
|
|
112
111
|
"data-ownedby": d.id,
|
|
113
|
-
"data-value":
|
|
112
|
+
"data-value": e,
|
|
114
113
|
"data-current": T(s),
|
|
115
114
|
"data-state": p ? "open" : "closed",
|
|
116
115
|
onPointerDown(r) {
|
|
117
116
|
if (r.pointerType === "mouse") return;
|
|
118
|
-
const o =
|
|
119
|
-
n({ type: "CONTEXT_MENU_START", point: o, value:
|
|
117
|
+
const o = f(r);
|
|
118
|
+
n({ type: "CONTEXT_MENU_START", point: o, value: e });
|
|
120
119
|
},
|
|
121
120
|
onPointerCancel(r) {
|
|
122
121
|
r.pointerType !== "mouse" && n({ type: "CONTEXT_MENU_CANCEL" });
|
|
@@ -128,11 +127,11 @@ function Pe(R, g) {
|
|
|
128
127
|
r.pointerType !== "mouse" && n({ type: "CONTEXT_MENU_CANCEL" });
|
|
129
128
|
},
|
|
130
129
|
onContextMenu(r) {
|
|
131
|
-
const o =
|
|
130
|
+
const o = f(r), i = p && e != null && !s;
|
|
132
131
|
n({
|
|
133
132
|
type: i ? "TRIGGER_VALUE.SET" : "CONTEXT_MENU",
|
|
134
133
|
point: o,
|
|
135
|
-
value:
|
|
134
|
+
value: e
|
|
136
135
|
}), r.preventDefault();
|
|
137
136
|
},
|
|
138
137
|
style: {
|
|
@@ -142,40 +141,39 @@ function Pe(R, g) {
|
|
|
142
141
|
}
|
|
143
142
|
});
|
|
144
143
|
},
|
|
145
|
-
getTriggerItemProps(
|
|
146
|
-
const
|
|
147
|
-
return
|
|
144
|
+
getTriggerItemProps(t) {
|
|
145
|
+
const e = t.getTriggerProps();
|
|
146
|
+
return ot(S({ value: e.id }), e);
|
|
148
147
|
},
|
|
149
|
-
getTriggerProps(
|
|
150
|
-
const { value:
|
|
148
|
+
getTriggerProps(t = {}) {
|
|
149
|
+
const { value: e } = t, s = e == null ? !1 : E === e, c = K(d, e);
|
|
151
150
|
return g.button({
|
|
152
|
-
...
|
|
153
|
-
"data-placement":
|
|
154
|
-
"data-side": w,
|
|
151
|
+
...R ? l.triggerItem.attrs : l.trigger.attrs,
|
|
152
|
+
"data-placement": m.get("currentPlacement"),
|
|
155
153
|
type: "button",
|
|
156
154
|
dir: a("dir"),
|
|
157
155
|
id: c,
|
|
158
156
|
// Multi-trigger attributes - only included when value is provided
|
|
159
|
-
...
|
|
157
|
+
...e != null && {
|
|
160
158
|
"data-ownedby": d.id,
|
|
161
|
-
"data-value":
|
|
159
|
+
"data-value": e,
|
|
162
160
|
"data-current": T(s)
|
|
163
161
|
},
|
|
164
162
|
"data-uid": a("id"),
|
|
165
|
-
"aria-haspopup":
|
|
166
|
-
"aria-controls":
|
|
167
|
-
"data-controls":
|
|
168
|
-
"aria-expanded":
|
|
163
|
+
"aria-haspopup": _ ? "menu" : "dialog",
|
|
164
|
+
"aria-controls": h(d),
|
|
165
|
+
"data-controls": h(d),
|
|
166
|
+
"aria-expanded": e == null ? p : p && s,
|
|
169
167
|
"data-state": p ? "open" : "closed",
|
|
170
168
|
onPointerMove(r) {
|
|
171
|
-
if (r.pointerType !== "mouse" ||
|
|
172
|
-
const i =
|
|
169
|
+
if (r.pointerType !== "mouse" || P(r.currentTarget) || !R) return;
|
|
170
|
+
const i = f(r);
|
|
173
171
|
n({ type: "TRIGGER_POINTERMOVE", target: r.currentTarget, point: i });
|
|
174
172
|
},
|
|
175
173
|
onPointerLeave(r) {
|
|
176
|
-
if (
|
|
177
|
-
|
|
178
|
-
const o =
|
|
174
|
+
if (P(r.currentTarget) || r.pointerType !== "mouse" || !R) return;
|
|
175
|
+
it(I.refs.get("parent"), !0);
|
|
176
|
+
const o = f(r);
|
|
179
177
|
n({
|
|
180
178
|
type: "TRIGGER_POINTERLEAVE",
|
|
181
179
|
target: r.currentTarget,
|
|
@@ -183,15 +181,15 @@ function Pe(R, g) {
|
|
|
183
181
|
});
|
|
184
182
|
},
|
|
185
183
|
onPointerDown(r) {
|
|
186
|
-
|
|
184
|
+
P(r.currentTarget) || q(r) || r.preventDefault();
|
|
187
185
|
},
|
|
188
186
|
onClick(r) {
|
|
189
|
-
if (r.defaultPrevented ||
|
|
190
|
-
const o = p &&
|
|
187
|
+
if (r.defaultPrevented || P(r.currentTarget)) return;
|
|
188
|
+
const o = p && e != null && !s;
|
|
191
189
|
n({
|
|
192
190
|
type: o ? "TRIGGER_VALUE.SET" : "TRIGGER_CLICK",
|
|
193
191
|
target: r.currentTarget,
|
|
194
|
-
value:
|
|
192
|
+
value: e
|
|
195
193
|
});
|
|
196
194
|
},
|
|
197
195
|
onBlur() {
|
|
@@ -204,18 +202,18 @@ function Pe(R, g) {
|
|
|
204
202
|
if (r.defaultPrevented) return;
|
|
205
203
|
const o = {
|
|
206
204
|
ArrowDown() {
|
|
207
|
-
n({ type: "ARROW_DOWN", value:
|
|
205
|
+
n({ type: "ARROW_DOWN", value: e });
|
|
208
206
|
},
|
|
209
207
|
ArrowUp() {
|
|
210
|
-
n({ type: "ARROW_UP", value:
|
|
208
|
+
n({ type: "ARROW_UP", value: e });
|
|
211
209
|
},
|
|
212
210
|
Enter() {
|
|
213
|
-
n({ type: "ARROW_DOWN", src: "enter", value:
|
|
211
|
+
n({ type: "ARROW_DOWN", src: "enter", value: e });
|
|
214
212
|
},
|
|
215
213
|
Space() {
|
|
216
|
-
n({ type: "ARROW_DOWN", src: "space", value:
|
|
214
|
+
n({ type: "ARROW_DOWN", src: "space", value: e });
|
|
217
215
|
}
|
|
218
|
-
}, i =
|
|
216
|
+
}, i = W(r, {
|
|
219
217
|
orientation: "vertical",
|
|
220
218
|
dir: a("dir")
|
|
221
219
|
}), u = o[i];
|
|
@@ -234,48 +232,47 @@ function Pe(R, g) {
|
|
|
234
232
|
return g.element({
|
|
235
233
|
...l.positioner.attrs,
|
|
236
234
|
dir: a("dir"),
|
|
237
|
-
id:
|
|
238
|
-
style:
|
|
235
|
+
id: nt(d),
|
|
236
|
+
style: b.floating
|
|
239
237
|
});
|
|
240
238
|
},
|
|
241
239
|
getArrowProps() {
|
|
242
240
|
return g.element({
|
|
243
|
-
id:
|
|
241
|
+
id: rt(d),
|
|
244
242
|
...l.arrow.attrs,
|
|
245
243
|
dir: a("dir"),
|
|
246
|
-
style:
|
|
244
|
+
style: b.arrow
|
|
247
245
|
});
|
|
248
246
|
},
|
|
249
247
|
getArrowTipProps() {
|
|
250
248
|
return g.element({
|
|
251
249
|
...l.arrowTip.attrs,
|
|
252
250
|
dir: a("dir"),
|
|
253
|
-
style:
|
|
251
|
+
style: b.arrowTip
|
|
254
252
|
});
|
|
255
253
|
},
|
|
256
254
|
getContentProps() {
|
|
257
255
|
return g.element({
|
|
258
256
|
...l.content.attrs,
|
|
259
|
-
id:
|
|
257
|
+
id: h(d),
|
|
260
258
|
"aria-label": a("aria-label"),
|
|
261
259
|
hidden: !p,
|
|
262
260
|
"data-state": p ? "open" : "closed",
|
|
263
|
-
role:
|
|
261
|
+
role: _ ? "menu" : "dialog",
|
|
264
262
|
tabIndex: 0,
|
|
265
263
|
dir: a("dir"),
|
|
266
|
-
"aria-activedescendant":
|
|
267
|
-
"aria-labelledby":
|
|
268
|
-
"data-placement":
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
e.pointerType === "mouse" && n({ type: "MENU_POINTERENTER" });
|
|
264
|
+
"aria-activedescendant": C("highlightedId") || void 0,
|
|
265
|
+
"aria-labelledby": w ? H(d, E ?? void 0) : K(d, E ?? void 0),
|
|
266
|
+
"data-placement": L,
|
|
267
|
+
onPointerEnter(t) {
|
|
268
|
+
t.pointerType === "mouse" && n({ type: "MENU_POINTERENTER" });
|
|
272
269
|
},
|
|
273
|
-
onKeyDown(
|
|
274
|
-
if (
|
|
275
|
-
const
|
|
276
|
-
if (!((
|
|
277
|
-
if (
|
|
278
|
-
|
|
270
|
+
onKeyDown(t) {
|
|
271
|
+
if (t.defaultPrevented || !Q(t.currentTarget, v(t))) return;
|
|
272
|
+
const e = v(t);
|
|
273
|
+
if (!((e == null ? void 0 : e.closest("[role=menu]")) === t.currentTarget || e === t.currentTarget)) return;
|
|
274
|
+
if (t.key === "Tab" && !J(t)) {
|
|
275
|
+
t.preventDefault();
|
|
279
276
|
return;
|
|
280
277
|
}
|
|
281
278
|
const c = {
|
|
@@ -296,7 +293,7 @@ function Pe(R, g) {
|
|
|
296
293
|
},
|
|
297
294
|
Space(i) {
|
|
298
295
|
var u;
|
|
299
|
-
|
|
296
|
+
Y ? n({ type: "TYPEAHEAD", key: i.key }) : (u = c.Enter) == null || u.call(c, i);
|
|
300
297
|
},
|
|
301
298
|
Home() {
|
|
302
299
|
n({ type: "HOME" });
|
|
@@ -304,12 +301,12 @@ function Pe(R, g) {
|
|
|
304
301
|
End() {
|
|
305
302
|
n({ type: "END" });
|
|
306
303
|
}
|
|
307
|
-
}, r =
|
|
304
|
+
}, r = W(t, { dir: a("dir") }), o = c[r];
|
|
308
305
|
if (o) {
|
|
309
|
-
o(
|
|
306
|
+
o(t), t.stopPropagation(), t.preventDefault();
|
|
310
307
|
return;
|
|
311
308
|
}
|
|
312
|
-
a("typeahead") &&
|
|
309
|
+
a("typeahead") && $(t) && (j(t) || Z(e) || (n({ type: "TYPEAHEAD", key: t.key }), t.preventDefault()));
|
|
313
310
|
}
|
|
314
311
|
});
|
|
315
312
|
},
|
|
@@ -321,19 +318,19 @@ function Pe(R, g) {
|
|
|
321
318
|
"aria-orientation": "horizontal"
|
|
322
319
|
});
|
|
323
320
|
},
|
|
324
|
-
getItemState:
|
|
325
|
-
getItemProps:
|
|
326
|
-
getOptionItemState:
|
|
327
|
-
getOptionItemProps(
|
|
328
|
-
const { type:
|
|
321
|
+
getItemState: O,
|
|
322
|
+
getItemProps: S,
|
|
323
|
+
getOptionItemState: y,
|
|
324
|
+
getOptionItemProps(t) {
|
|
325
|
+
const { type: e, disabled: s, closeOnSelect: c } = t, r = G(t), o = y(t);
|
|
329
326
|
return {
|
|
330
|
-
...
|
|
327
|
+
...S(r),
|
|
331
328
|
...g.element({
|
|
332
|
-
"data-type":
|
|
329
|
+
"data-type": e,
|
|
333
330
|
...l.item.attrs,
|
|
334
331
|
dir: a("dir"),
|
|
335
332
|
"data-value": r.value,
|
|
336
|
-
role: `menuitem${
|
|
333
|
+
role: `menuitem${e}`,
|
|
337
334
|
"aria-checked": !!o.checked,
|
|
338
335
|
"data-state": o.checked ? "checked" : "unchecked",
|
|
339
336
|
onClick(i) {
|
|
@@ -344,45 +341,45 @@ function Pe(R, g) {
|
|
|
344
341
|
})
|
|
345
342
|
};
|
|
346
343
|
},
|
|
347
|
-
getItemIndicatorProps(
|
|
348
|
-
const
|
|
344
|
+
getItemIndicatorProps(t) {
|
|
345
|
+
const e = y(B(t)), s = e.checked ? "checked" : "unchecked";
|
|
349
346
|
return g.element({
|
|
350
347
|
...l.itemIndicator.attrs,
|
|
351
348
|
dir: a("dir"),
|
|
352
|
-
"data-disabled": T(
|
|
353
|
-
"data-highlighted": T(
|
|
354
|
-
"data-state":
|
|
355
|
-
hidden:
|
|
349
|
+
"data-disabled": T(e.disabled),
|
|
350
|
+
"data-highlighted": T(e.highlighted),
|
|
351
|
+
"data-state": N(t, "checked") ? s : void 0,
|
|
352
|
+
hidden: N(t, "checked") ? !e.checked : void 0
|
|
356
353
|
});
|
|
357
354
|
},
|
|
358
|
-
getItemTextProps(
|
|
359
|
-
const
|
|
355
|
+
getItemTextProps(t) {
|
|
356
|
+
const e = y(B(t)), s = e.checked ? "checked" : "unchecked";
|
|
360
357
|
return g.element({
|
|
361
358
|
...l.itemText.attrs,
|
|
362
359
|
dir: a("dir"),
|
|
363
|
-
"data-disabled": T(
|
|
364
|
-
"data-highlighted": T(
|
|
365
|
-
"data-state":
|
|
360
|
+
"data-disabled": T(e.disabled),
|
|
361
|
+
"data-highlighted": T(e.highlighted),
|
|
362
|
+
"data-state": N(t, "checked") ? s : void 0
|
|
366
363
|
});
|
|
367
364
|
},
|
|
368
|
-
getItemGroupLabelProps(
|
|
365
|
+
getItemGroupLabelProps(t) {
|
|
369
366
|
return g.element({
|
|
370
367
|
...l.itemGroupLabel.attrs,
|
|
371
|
-
id:
|
|
368
|
+
id: V(d, t.htmlFor),
|
|
372
369
|
dir: a("dir")
|
|
373
370
|
});
|
|
374
371
|
},
|
|
375
|
-
getItemGroupProps(
|
|
372
|
+
getItemGroupProps(t) {
|
|
376
373
|
return g.element({
|
|
377
|
-
id:
|
|
374
|
+
id: et(d, t.id),
|
|
378
375
|
...l.itemGroup.attrs,
|
|
379
376
|
dir: a("dir"),
|
|
380
|
-
"aria-labelledby":
|
|
377
|
+
"aria-labelledby": V(d, t.id),
|
|
381
378
|
role: "group"
|
|
382
379
|
});
|
|
383
380
|
}
|
|
384
381
|
};
|
|
385
382
|
}
|
|
386
383
|
export {
|
|
387
|
-
|
|
384
|
+
ft as connect
|
|
388
385
|
};
|