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