@purpur/library 9.4.1 → 9.4.3
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/CHANGELOG.json +33 -0
- package/CHANGELOG.md +18 -1
- package/dist/LICENSE.txt +8 -1
- package/dist/calendar-BXQ3v62X.js +2 -0
- package/dist/{calendar-CBBV8n3x.js.map → calendar-BXQ3v62X.js.map} +1 -1
- package/dist/{calendar-DEXw83mu.mjs → calendar-d53vgYqR.mjs} +481 -465
- package/dist/{calendar-DEXw83mu.mjs.map → calendar-d53vgYqR.mjs.map} +1 -1
- package/dist/calendar.cjs.js +1 -1
- package/dist/calendar.es.js +3 -3
- package/dist/comparison-table-C74IAVqz.js +2 -0
- package/dist/comparison-table-C74IAVqz.js.map +1 -0
- package/dist/comparison-table-DctKxmX9.mjs +267 -0
- package/dist/comparison-table-DctKxmX9.mjs.map +1 -0
- package/dist/comparison-table.cjs.js +1 -1
- package/dist/comparison-table.es.js +1 -1
- package/dist/components/calendar/src/calendar.d.ts +4 -11
- package/dist/components/calendar/src/calendar.d.ts.map +1 -1
- package/dist/components/comparison-table/src/comparison-table.d.ts.map +1 -1
- package/dist/components/comparison-table/src/components/OptionCard/option-card.d.ts +2 -1
- package/dist/components/comparison-table/src/components/OptionCard/option-card.d.ts.map +1 -1
- package/dist/components/comparison-table/src/components/ScrollProgress/scroll-progress.d.ts +1 -2
- package/dist/components/comparison-table/src/components/ScrollProgress/scroll-progress.d.ts.map +1 -1
- package/dist/components/date-field/src/date-field.d.ts.map +1 -1
- package/dist/components/date-picker/src/date-picker.d.ts +11 -2
- package/dist/components/date-picker/src/date-picker.d.ts.map +1 -1
- package/dist/components/date-range-field/src/date-range-field.d.ts +27 -0
- package/dist/components/date-range-field/src/date-range-field.d.ts.map +1 -0
- package/dist/components-metadata.js +10 -0
- package/dist/date-field-BKKty89_.js +2 -0
- package/dist/{date-field-BJaomFjs.js.map → date-field-BKKty89_.js.map} +1 -1
- package/dist/{date-field-D3rTtf9Y.mjs → date-field-Cv5CKR1y.mjs} +276 -268
- package/dist/{date-field-D3rTtf9Y.mjs.map → date-field-Cv5CKR1y.mjs.map} +1 -1
- package/dist/date-field.cjs.js +1 -1
- package/dist/date-field.es.js +1 -1
- package/dist/date-picker-CzxhZxsw.mjs +1611 -0
- package/dist/date-picker-CzxhZxsw.mjs.map +1 -0
- package/dist/date-picker-uyPKJulK.js +2 -0
- package/dist/date-picker-uyPKJulK.js.map +1 -0
- package/dist/date-picker.cjs.js +1 -1
- package/dist/date-picker.es.js +1 -1
- package/dist/date-range-field-CFcjprIl.mjs +142 -0
- package/dist/date-range-field-CFcjprIl.mjs.map +1 -0
- package/dist/date-range-field-D8vLeSwp.js +2 -0
- package/dist/date-range-field-D8vLeSwp.js.map +1 -0
- package/dist/date-range-field.cjs.js +2 -0
- package/dist/date-range-field.cjs.js.map +1 -0
- package/dist/date-range-field.es.js +5 -0
- package/dist/date-range-field.es.js.map +1 -0
- package/dist/{floating-ui.react-dom-gsHLgcoR.mjs → floating-ui.react-dom-EredA301.mjs} +3 -3
- package/dist/{floating-ui.react-dom-gsHLgcoR.mjs.map → floating-ui.react-dom-EredA301.mjs.map} +1 -1
- package/dist/{format-DpkYPs7O.mjs → format-CWOXI-dC.mjs} +8 -8
- package/dist/{format-DpkYPs7O.mjs.map → format-CWOXI-dC.mjs.map} +1 -1
- package/dist/libraries/library/src/date-range-field.d.ts +6 -0
- package/dist/libraries/library/src/date-range-field.d.ts.map +1 -0
- package/dist/libraries/library/src/library.d.ts +1 -0
- package/dist/libraries/library/src/library.d.ts.map +1 -1
- package/dist/library.cjs.js +1 -1
- package/dist/library.es.js +636 -633
- package/dist/library.es.js.map +1 -1
- package/dist/{popover-_xJATlhN.mjs → popover-I26xNbTz.mjs} +2 -2
- package/dist/{popover-_xJATlhN.mjs.map → popover-I26xNbTz.mjs.map} +1 -1
- package/dist/popover.es.js +1 -1
- package/dist/purpur.css +1 -1
- package/dist/{stepper-CNnx_NiR.mjs → stepper-CWR2vGPj.mjs} +2 -2
- package/dist/{stepper-CNnx_NiR.mjs.map → stepper-CWR2vGPj.mjs.map} +1 -1
- package/dist/stepper.es.js +1 -1
- package/dist/{table-D_sdSJyr.mjs → table-g_n68i4s.mjs} +2 -2
- package/dist/{table-D_sdSJyr.mjs.map → table-g_n68i4s.mjs.map} +1 -1
- package/dist/table.es.js +1 -1
- package/dist/{tooltip-VlURN8H3.mjs → tooltip-LU2Cy-QC.mjs} +2 -2
- package/dist/{tooltip-VlURN8H3.mjs.map → tooltip-LU2Cy-QC.mjs.map} +1 -1
- package/dist/tooltip.es.js +1 -1
- package/dist/{zh-TW-oiRD71xW.mjs → zh-TW-DrQ6h7hA.mjs} +2 -2
- package/dist/{zh-TW-oiRD71xW.mjs.map → zh-TW-DrQ6h7hA.mjs.map} +1 -1
- package/package.json +29 -28
- package/src/aliases.ts +7 -0
- package/src/date-range-field.ts +6 -0
- package/src/entries.js +1 -0
- package/src/library.ts +2 -0
- package/dist/calendar-CBBV8n3x.js +0 -2
- package/dist/comparison-table-8bOJmz-L.mjs +0 -275
- package/dist/comparison-table-8bOJmz-L.mjs.map +0 -1
- package/dist/comparison-table-mKL2IHXW.js +0 -2
- package/dist/comparison-table-mKL2IHXW.js.map +0 -1
- package/dist/date-field-BJaomFjs.js +0 -2
- package/dist/date-picker-CbUNbOhn.mjs +0 -1415
- package/dist/date-picker-CbUNbOhn.mjs.map +0 -1
- package/dist/date-picker-DYXNB5aU.js +0 -2
- package/dist/date-picker-DYXNB5aU.js.map +0 -1
|
@@ -1,1415 +0,0 @@
|
|
|
1
|
-
import { jsxs as Ce, jsx as N, Fragment as Kt } from "react/jsx-runtime";
|
|
2
|
-
import * as c from "react";
|
|
3
|
-
import { useLayoutEffect as wt, forwardRef as Wt, useState as Se, useRef as Ht, useEffect as Ut, useId as qt } from "react";
|
|
4
|
-
import { i as ne, a as St, u as jt, b as Z, g as Me, c as Gt, d as Le, e as Yt, f as Zt, h as zt, j as xt, k as Xt, o as Jt, l as Qt } from "./floating-ui.react-dom-gsHLgcoR.mjs";
|
|
5
|
-
import * as en from "react-dom";
|
|
6
|
-
import { C as Je } from "./calendar-DEXw83mu.mjs";
|
|
7
|
-
import { D as Qe } from "./date-field-D3rTtf9Y.mjs";
|
|
8
|
-
import { D as _e } from "./drawer-8Acg4wkV.mjs";
|
|
9
|
-
import { b as tn } from "./icon-DNHpBTHs-JfI8WyiR.mjs";
|
|
10
|
-
import { c as nn } from "./bind-CU-R61T-.mjs";
|
|
11
|
-
var rn = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert] *)", "textarea:not([inert]):not([inert] *)", "a[href]:not([inert]):not([inert] *)", "button:not([inert]):not([inert] *)", "[tabindex]:not(slot):not([inert]):not([inert] *)", "audio[controls]:not([inert]):not([inert] *)", "video[controls]:not([inert]):not([inert] *)", '[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)', "details>summary:first-of-type:not([inert]):not([inert] *)", "details:not([inert]):not([inert] *)"], Ie = /* @__PURE__ */ rn.join(","), Tt = typeof Element > "u", ge = Tt ? function() {
|
|
12
|
-
} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, Ae = !Tt && Element.prototype.getRootNode ? function(e) {
|
|
13
|
-
var t;
|
|
14
|
-
return e == null || (t = e.getRootNode) === null || t === void 0 ? void 0 : t.call(e);
|
|
15
|
-
} : function(e) {
|
|
16
|
-
return e?.ownerDocument;
|
|
17
|
-
}, ke = function(t, n) {
|
|
18
|
-
var r;
|
|
19
|
-
n === void 0 && (n = !0);
|
|
20
|
-
var o = t == null || (r = t.getAttribute) === null || r === void 0 ? void 0 : r.call(t, "inert"), i = o === "" || o === "true", s = i || n && t && // closest does not exist on shadow roots, so we fall back to a manual
|
|
21
|
-
// lookup upward, in case it is not defined.
|
|
22
|
-
(typeof t.closest == "function" ? t.closest("[inert]") : ke(t.parentNode));
|
|
23
|
-
return s;
|
|
24
|
-
}, on = function(t) {
|
|
25
|
-
var n, r = t == null || (n = t.getAttribute) === null || n === void 0 ? void 0 : n.call(t, "contenteditable");
|
|
26
|
-
return r === "" || r === "true";
|
|
27
|
-
}, Ct = function(t, n, r) {
|
|
28
|
-
if (ke(t))
|
|
29
|
-
return [];
|
|
30
|
-
var o = Array.prototype.slice.apply(t.querySelectorAll(Ie));
|
|
31
|
-
return n && ge.call(t, Ie) && o.unshift(t), o = o.filter(r), o;
|
|
32
|
-
}, De = function(t, n, r) {
|
|
33
|
-
for (var o = [], i = Array.from(t); i.length; ) {
|
|
34
|
-
var s = i.shift();
|
|
35
|
-
if (!ke(s, !1))
|
|
36
|
-
if (s.tagName === "SLOT") {
|
|
37
|
-
var u = s.assignedElements(), d = u.length ? u : s.children, a = De(d, !0, r);
|
|
38
|
-
r.flatten ? o.push.apply(o, a) : o.push({
|
|
39
|
-
scopeParent: s,
|
|
40
|
-
candidates: a
|
|
41
|
-
});
|
|
42
|
-
} else {
|
|
43
|
-
var v = ge.call(s, Ie);
|
|
44
|
-
v && r.filter(s) && (n || !t.includes(s)) && o.push(s);
|
|
45
|
-
var E = s.shadowRoot || // check for an undisclosed shadow
|
|
46
|
-
typeof r.getShadowRoot == "function" && r.getShadowRoot(s), I = !ke(E, !1) && (!r.shadowRootFilter || r.shadowRootFilter(s));
|
|
47
|
-
if (E && I) {
|
|
48
|
-
var f = De(E === !0 ? s.children : E.children, !0, r);
|
|
49
|
-
r.flatten ? o.push.apply(o, f) : o.push({
|
|
50
|
-
scopeParent: s,
|
|
51
|
-
candidates: f
|
|
52
|
-
});
|
|
53
|
-
} else
|
|
54
|
-
i.unshift.apply(i, s.children);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return o;
|
|
58
|
-
}, It = function(t) {
|
|
59
|
-
return !isNaN(parseInt(t.getAttribute("tabindex"), 10));
|
|
60
|
-
}, At = function(t) {
|
|
61
|
-
if (!t)
|
|
62
|
-
throw new Error("No node provided");
|
|
63
|
-
return t.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName) || on(t)) && !It(t) ? 0 : t.tabIndex;
|
|
64
|
-
}, sn = function(t, n) {
|
|
65
|
-
var r = At(t);
|
|
66
|
-
return r < 0 && n && !It(t) ? 0 : r;
|
|
67
|
-
}, an = function(t, n) {
|
|
68
|
-
return t.tabIndex === n.tabIndex ? t.documentOrder - n.documentOrder : t.tabIndex - n.tabIndex;
|
|
69
|
-
}, kt = function(t) {
|
|
70
|
-
return t.tagName === "INPUT";
|
|
71
|
-
}, un = function(t) {
|
|
72
|
-
return kt(t) && t.type === "hidden";
|
|
73
|
-
}, cn = function(t) {
|
|
74
|
-
var n = t.tagName === "DETAILS" && Array.prototype.slice.apply(t.children).some(function(r) {
|
|
75
|
-
return r.tagName === "SUMMARY";
|
|
76
|
-
});
|
|
77
|
-
return n;
|
|
78
|
-
}, ln = function(t, n) {
|
|
79
|
-
for (var r = 0; r < t.length; r++)
|
|
80
|
-
if (t[r].checked && t[r].form === n)
|
|
81
|
-
return t[r];
|
|
82
|
-
}, fn = function(t) {
|
|
83
|
-
if (!t.name)
|
|
84
|
-
return !0;
|
|
85
|
-
var n = t.form || Ae(t), r = function(u) {
|
|
86
|
-
return n.querySelectorAll('input[type="radio"][name="' + u + '"]');
|
|
87
|
-
}, o;
|
|
88
|
-
if (typeof window < "u" && typeof window.CSS < "u" && typeof window.CSS.escape == "function")
|
|
89
|
-
o = r(window.CSS.escape(t.name));
|
|
90
|
-
else
|
|
91
|
-
try {
|
|
92
|
-
o = r(t.name);
|
|
93
|
-
} catch (s) {
|
|
94
|
-
return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", s.message), !1;
|
|
95
|
-
}
|
|
96
|
-
var i = ln(o, t.form);
|
|
97
|
-
return !i || i === t;
|
|
98
|
-
}, dn = function(t) {
|
|
99
|
-
return kt(t) && t.type === "radio";
|
|
100
|
-
}, vn = function(t) {
|
|
101
|
-
return dn(t) && !fn(t);
|
|
102
|
-
}, bn = function(t) {
|
|
103
|
-
var n, r = t && Ae(t), o = (n = r) === null || n === void 0 ? void 0 : n.host, i = !1;
|
|
104
|
-
if (r && r !== t) {
|
|
105
|
-
var s, u, d;
|
|
106
|
-
for (i = !!((s = o) !== null && s !== void 0 && (u = s.ownerDocument) !== null && u !== void 0 && u.contains(o) || t != null && (d = t.ownerDocument) !== null && d !== void 0 && d.contains(t)); !i && o; ) {
|
|
107
|
-
var a, v, E;
|
|
108
|
-
r = Ae(o), o = (a = r) === null || a === void 0 ? void 0 : a.host, i = !!((v = o) !== null && v !== void 0 && (E = v.ownerDocument) !== null && E !== void 0 && E.contains(o));
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
return i;
|
|
112
|
-
}, et = function(t) {
|
|
113
|
-
var n = t.getBoundingClientRect(), r = n.width, o = n.height;
|
|
114
|
-
return r === 0 && o === 0;
|
|
115
|
-
}, mn = function(t, n) {
|
|
116
|
-
var r = n.displayCheck, o = n.getShadowRoot;
|
|
117
|
-
if (r === "full-native" && "checkVisibility" in t) {
|
|
118
|
-
var i = t.checkVisibility({
|
|
119
|
-
// Checking opacity might be desirable for some use cases, but natively,
|
|
120
|
-
// opacity zero elements _are_ focusable and tabbable.
|
|
121
|
-
checkOpacity: !1,
|
|
122
|
-
opacityProperty: !1,
|
|
123
|
-
contentVisibilityAuto: !0,
|
|
124
|
-
visibilityProperty: !0,
|
|
125
|
-
// This is an alias for `visibilityProperty`. Contemporary browsers
|
|
126
|
-
// support both. However, this alias has wider browser support (Chrome
|
|
127
|
-
// >= 105 and Firefox >= 106, vs. Chrome >= 121 and Firefox >= 122), so
|
|
128
|
-
// we include it anyway.
|
|
129
|
-
checkVisibilityCSS: !0
|
|
130
|
-
});
|
|
131
|
-
return !i;
|
|
132
|
-
}
|
|
133
|
-
if (getComputedStyle(t).visibility === "hidden")
|
|
134
|
-
return !0;
|
|
135
|
-
var s = ge.call(t, "details>summary:first-of-type"), u = s ? t.parentElement : t;
|
|
136
|
-
if (ge.call(u, "details:not([open]) *"))
|
|
137
|
-
return !0;
|
|
138
|
-
if (!r || r === "full" || // full-native can run this branch when it falls through in case
|
|
139
|
-
// Element#checkVisibility is unsupported
|
|
140
|
-
r === "full-native" || r === "legacy-full") {
|
|
141
|
-
if (typeof o == "function") {
|
|
142
|
-
for (var d = t; t; ) {
|
|
143
|
-
var a = t.parentElement, v = Ae(t);
|
|
144
|
-
if (a && !a.shadowRoot && o(a) === !0)
|
|
145
|
-
return et(t);
|
|
146
|
-
t.assignedSlot ? t = t.assignedSlot : !a && v !== t.ownerDocument ? t = v.host : t = a;
|
|
147
|
-
}
|
|
148
|
-
t = d;
|
|
149
|
-
}
|
|
150
|
-
if (bn(t))
|
|
151
|
-
return !t.getClientRects().length;
|
|
152
|
-
if (r !== "legacy-full")
|
|
153
|
-
return !0;
|
|
154
|
-
} else if (r === "non-zero-area")
|
|
155
|
-
return et(t);
|
|
156
|
-
return !1;
|
|
157
|
-
}, gn = function(t) {
|
|
158
|
-
if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))
|
|
159
|
-
for (var n = t.parentElement; n; ) {
|
|
160
|
-
if (n.tagName === "FIELDSET" && n.disabled) {
|
|
161
|
-
for (var r = 0; r < n.children.length; r++) {
|
|
162
|
-
var o = n.children.item(r);
|
|
163
|
-
if (o.tagName === "LEGEND")
|
|
164
|
-
return ge.call(n, "fieldset[disabled] *") ? !0 : !o.contains(t);
|
|
165
|
-
}
|
|
166
|
-
return !0;
|
|
167
|
-
}
|
|
168
|
-
n = n.parentElement;
|
|
169
|
-
}
|
|
170
|
-
return !1;
|
|
171
|
-
}, He = function(t, n) {
|
|
172
|
-
return !(n.disabled || un(n) || mn(n, t) || // For a details element with a summary, the summary element gets the focus
|
|
173
|
-
cn(n) || gn(n));
|
|
174
|
-
}, Ue = function(t, n) {
|
|
175
|
-
return !(vn(n) || At(n) < 0 || !He(t, n));
|
|
176
|
-
}, pn = function(t) {
|
|
177
|
-
var n = parseInt(t.getAttribute("tabindex"), 10);
|
|
178
|
-
return !!(isNaN(n) || n >= 0);
|
|
179
|
-
}, Dt = function(t) {
|
|
180
|
-
var n = [], r = [];
|
|
181
|
-
return t.forEach(function(o, i) {
|
|
182
|
-
var s = !!o.scopeParent, u = s ? o.scopeParent : o, d = sn(u, s), a = s ? Dt(o.candidates) : u;
|
|
183
|
-
d === 0 ? s ? n.push.apply(n, a) : n.push(u) : r.push({
|
|
184
|
-
documentOrder: i,
|
|
185
|
-
tabIndex: d,
|
|
186
|
-
item: o,
|
|
187
|
-
isScope: s,
|
|
188
|
-
content: a
|
|
189
|
-
});
|
|
190
|
-
}), r.sort(an).reduce(function(o, i) {
|
|
191
|
-
return i.isScope ? o.push.apply(o, i.content) : o.push(i.content), o;
|
|
192
|
-
}, []).concat(n);
|
|
193
|
-
}, Ne = function(t, n) {
|
|
194
|
-
n = n || {};
|
|
195
|
-
var r;
|
|
196
|
-
return n.getShadowRoot ? r = De([t], n.includeContainer, {
|
|
197
|
-
filter: Ue.bind(null, n),
|
|
198
|
-
flatten: !1,
|
|
199
|
-
getShadowRoot: n.getShadowRoot,
|
|
200
|
-
shadowRootFilter: pn
|
|
201
|
-
}) : r = Ct(t, n.includeContainer, Ue.bind(null, n)), Dt(r);
|
|
202
|
-
}, hn = function(t, n) {
|
|
203
|
-
n = n || {};
|
|
204
|
-
var r;
|
|
205
|
-
return n.getShadowRoot ? r = De([t], n.includeContainer, {
|
|
206
|
-
filter: He.bind(null, n),
|
|
207
|
-
flatten: !0,
|
|
208
|
-
getShadowRoot: n.getShadowRoot
|
|
209
|
-
}) : r = Ct(t, n.includeContainer, He.bind(null, n)), r;
|
|
210
|
-
}, Pt = function(t, n) {
|
|
211
|
-
if (n = n || {}, !t)
|
|
212
|
-
throw new Error("No node provided");
|
|
213
|
-
return ge.call(t, Ie) === !1 ? !1 : Ue(n, t);
|
|
214
|
-
};
|
|
215
|
-
function Rn() {
|
|
216
|
-
const e = navigator.userAgentData;
|
|
217
|
-
return e != null && e.platform ? e.platform : navigator.platform;
|
|
218
|
-
}
|
|
219
|
-
function Nt() {
|
|
220
|
-
const e = navigator.userAgentData;
|
|
221
|
-
return e && Array.isArray(e.brands) ? e.brands.map((t) => {
|
|
222
|
-
let {
|
|
223
|
-
brand: n,
|
|
224
|
-
version: r
|
|
225
|
-
} = t;
|
|
226
|
-
return n + "/" + r;
|
|
227
|
-
}).join(" ") : navigator.userAgent;
|
|
228
|
-
}
|
|
229
|
-
function En() {
|
|
230
|
-
return /apple/i.test(navigator.vendor);
|
|
231
|
-
}
|
|
232
|
-
function qe() {
|
|
233
|
-
const e = /android/i;
|
|
234
|
-
return e.test(Rn()) || e.test(Nt());
|
|
235
|
-
}
|
|
236
|
-
function yn() {
|
|
237
|
-
return Nt().includes("jsdom/");
|
|
238
|
-
}
|
|
239
|
-
const tt = "data-floating-ui-focusable", wn = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";
|
|
240
|
-
function ve(e) {
|
|
241
|
-
let t = e.activeElement;
|
|
242
|
-
for (; ((n = t) == null || (n = n.shadowRoot) == null ? void 0 : n.activeElement) != null; ) {
|
|
243
|
-
var n;
|
|
244
|
-
t = t.shadowRoot.activeElement;
|
|
245
|
-
}
|
|
246
|
-
return t;
|
|
247
|
-
}
|
|
248
|
-
function U(e, t) {
|
|
249
|
-
if (!e || !t)
|
|
250
|
-
return !1;
|
|
251
|
-
const n = t.getRootNode == null ? void 0 : t.getRootNode();
|
|
252
|
-
if (e.contains(t))
|
|
253
|
-
return !0;
|
|
254
|
-
if (n && St(n)) {
|
|
255
|
-
let r = t;
|
|
256
|
-
for (; r; ) {
|
|
257
|
-
if (e === r)
|
|
258
|
-
return !0;
|
|
259
|
-
r = r.parentNode || r.host;
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
return !1;
|
|
263
|
-
}
|
|
264
|
-
function ue(e) {
|
|
265
|
-
return "composedPath" in e ? e.composedPath()[0] : e.target;
|
|
266
|
-
}
|
|
267
|
-
function Ve(e, t) {
|
|
268
|
-
if (t == null)
|
|
269
|
-
return !1;
|
|
270
|
-
if ("composedPath" in e)
|
|
271
|
-
return e.composedPath().includes(t);
|
|
272
|
-
const n = e;
|
|
273
|
-
return n.target != null && t.contains(n.target);
|
|
274
|
-
}
|
|
275
|
-
function Sn(e) {
|
|
276
|
-
return e.matches("html,body");
|
|
277
|
-
}
|
|
278
|
-
function z(e) {
|
|
279
|
-
return e?.ownerDocument || document;
|
|
280
|
-
}
|
|
281
|
-
function Ot(e) {
|
|
282
|
-
return ne(e) && e.matches(wn);
|
|
283
|
-
}
|
|
284
|
-
function nt(e) {
|
|
285
|
-
return e ? e.getAttribute("role") === "combobox" && Ot(e) : !1;
|
|
286
|
-
}
|
|
287
|
-
function rt(e) {
|
|
288
|
-
return e ? e.hasAttribute(tt) ? e : e.querySelector("[" + tt + "]") || e : null;
|
|
289
|
-
}
|
|
290
|
-
function be(e, t, n) {
|
|
291
|
-
return n === void 0 && (n = !0), e.filter((o) => {
|
|
292
|
-
var i;
|
|
293
|
-
return o.parentId === t && (!n || ((i = o.context) == null ? void 0 : i.open));
|
|
294
|
-
}).flatMap((o) => [o, ...be(e, o.id, n)]);
|
|
295
|
-
}
|
|
296
|
-
function ot(e, t) {
|
|
297
|
-
var n;
|
|
298
|
-
let r = [], o = (n = e.find((i) => i.id === t)) == null ? void 0 : n.parentId;
|
|
299
|
-
for (; o; ) {
|
|
300
|
-
const i = e.find((s) => s.id === o);
|
|
301
|
-
o = i?.parentId, i && (r = r.concat(i));
|
|
302
|
-
}
|
|
303
|
-
return r;
|
|
304
|
-
}
|
|
305
|
-
function $e(e) {
|
|
306
|
-
e.preventDefault(), e.stopPropagation();
|
|
307
|
-
}
|
|
308
|
-
function xn(e) {
|
|
309
|
-
return "nativeEvent" in e;
|
|
310
|
-
}
|
|
311
|
-
function Tn(e) {
|
|
312
|
-
return e.mozInputSource === 0 && e.isTrusted ? !0 : qe() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
|
|
313
|
-
}
|
|
314
|
-
function Cn(e) {
|
|
315
|
-
return yn() ? !1 : !qe() && e.width === 0 && e.height === 0 || qe() && e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse" || // iOS VoiceOver returns 0.333• for width/height.
|
|
316
|
-
e.width < 1 && e.height < 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "touch";
|
|
317
|
-
}
|
|
318
|
-
function it(e, t) {
|
|
319
|
-
return ["mouse", "pen"].includes(e);
|
|
320
|
-
}
|
|
321
|
-
var In = typeof document < "u", An = function() {
|
|
322
|
-
}, G = In ? wt : An;
|
|
323
|
-
const kn = {
|
|
324
|
-
...c
|
|
325
|
-
};
|
|
326
|
-
function Be(e) {
|
|
327
|
-
const t = c.useRef(e);
|
|
328
|
-
return G(() => {
|
|
329
|
-
t.current = e;
|
|
330
|
-
}), t;
|
|
331
|
-
}
|
|
332
|
-
const Dn = kn.useInsertionEffect, Pn = Dn || ((e) => e());
|
|
333
|
-
function J(e) {
|
|
334
|
-
const t = c.useRef(() => {
|
|
335
|
-
if (process.env.NODE_ENV !== "production")
|
|
336
|
-
throw new Error("Cannot call an event handler while rendering.");
|
|
337
|
-
});
|
|
338
|
-
return Pn(() => {
|
|
339
|
-
t.current = e;
|
|
340
|
-
}), c.useCallback(function() {
|
|
341
|
-
for (var n = arguments.length, r = new Array(n), o = 0; o < n; o++)
|
|
342
|
-
r[o] = arguments[o];
|
|
343
|
-
return t.current == null ? void 0 : t.current(...r);
|
|
344
|
-
}, []);
|
|
345
|
-
}
|
|
346
|
-
const Ee = () => ({
|
|
347
|
-
getShadowRoot: !0,
|
|
348
|
-
displayCheck: (
|
|
349
|
-
// JSDOM does not support the `tabbable` library. To solve this we can
|
|
350
|
-
// check if `ResizeObserver` is a real function (not polyfilled), which
|
|
351
|
-
// determines if the current environment is JSDOM-like.
|
|
352
|
-
typeof ResizeObserver == "function" && ResizeObserver.toString().includes("[native code]") ? "full" : "none"
|
|
353
|
-
)
|
|
354
|
-
});
|
|
355
|
-
function Ft(e, t) {
|
|
356
|
-
const n = Ne(e, Ee()), r = n.length;
|
|
357
|
-
if (r === 0) return;
|
|
358
|
-
const o = ve(z(e)), i = n.indexOf(o), s = i === -1 ? t === 1 ? 0 : r - 1 : i + t;
|
|
359
|
-
return n[s];
|
|
360
|
-
}
|
|
361
|
-
function Mt(e) {
|
|
362
|
-
return Ft(z(e).body, 1) || e;
|
|
363
|
-
}
|
|
364
|
-
function Lt(e) {
|
|
365
|
-
return Ft(z(e).body, -1) || e;
|
|
366
|
-
}
|
|
367
|
-
function he(e, t) {
|
|
368
|
-
const n = t || e.currentTarget, r = e.relatedTarget;
|
|
369
|
-
return !r || !U(n, r);
|
|
370
|
-
}
|
|
371
|
-
function Nn(e) {
|
|
372
|
-
Ne(e, Ee()).forEach((n) => {
|
|
373
|
-
n.dataset.tabindex = n.getAttribute("tabindex") || "", n.setAttribute("tabindex", "-1");
|
|
374
|
-
});
|
|
375
|
-
}
|
|
376
|
-
function st(e) {
|
|
377
|
-
e.querySelectorAll("[data-tabindex]").forEach((n) => {
|
|
378
|
-
const r = n.dataset.tabindex;
|
|
379
|
-
delete n.dataset.tabindex, r ? n.setAttribute("tabindex", r) : n.removeAttribute("tabindex");
|
|
380
|
-
});
|
|
381
|
-
}
|
|
382
|
-
const On = "data-floating-ui-focusable", at = "active", ut = "selected", Fn = {
|
|
383
|
-
...c
|
|
384
|
-
};
|
|
385
|
-
let ct = !1, Mn = 0;
|
|
386
|
-
const lt = () => (
|
|
387
|
-
// Ensure the id is unique with multiple independent versions of Floating UI
|
|
388
|
-
// on <React 18
|
|
389
|
-
"floating-ui-" + Math.random().toString(36).slice(2, 6) + Mn++
|
|
390
|
-
);
|
|
391
|
-
function Ln() {
|
|
392
|
-
const [e, t] = c.useState(() => ct ? lt() : void 0);
|
|
393
|
-
return G(() => {
|
|
394
|
-
e == null && t(lt());
|
|
395
|
-
}, []), c.useEffect(() => {
|
|
396
|
-
ct = !0;
|
|
397
|
-
}, []), e;
|
|
398
|
-
}
|
|
399
|
-
const _n = Fn.useId, _t = _n || Ln;
|
|
400
|
-
let je;
|
|
401
|
-
process.env.NODE_ENV !== "production" && (je = /* @__PURE__ */ new Set());
|
|
402
|
-
function Vn() {
|
|
403
|
-
for (var e, t = arguments.length, n = new Array(t), r = 0; r < t; r++)
|
|
404
|
-
n[r] = arguments[r];
|
|
405
|
-
const o = "Floating UI: " + n.join(" ");
|
|
406
|
-
if (!((e = je) != null && e.has(o))) {
|
|
407
|
-
var i;
|
|
408
|
-
(i = je) == null || i.add(o), console.error(o);
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
function $n() {
|
|
412
|
-
const e = /* @__PURE__ */ new Map();
|
|
413
|
-
return {
|
|
414
|
-
emit(t, n) {
|
|
415
|
-
var r;
|
|
416
|
-
(r = e.get(t)) == null || r.forEach((o) => o(n));
|
|
417
|
-
},
|
|
418
|
-
on(t, n) {
|
|
419
|
-
e.has(t) || e.set(t, /* @__PURE__ */ new Set()), e.get(t).add(n);
|
|
420
|
-
},
|
|
421
|
-
off(t, n) {
|
|
422
|
-
var r;
|
|
423
|
-
(r = e.get(t)) == null || r.delete(n);
|
|
424
|
-
}
|
|
425
|
-
};
|
|
426
|
-
}
|
|
427
|
-
const Bn = /* @__PURE__ */ c.createContext(null), Kn = /* @__PURE__ */ c.createContext(null), Wn = () => {
|
|
428
|
-
var e;
|
|
429
|
-
return ((e = c.useContext(Bn)) == null ? void 0 : e.id) || null;
|
|
430
|
-
}, Ye = () => c.useContext(Kn);
|
|
431
|
-
function Re(e) {
|
|
432
|
-
return "data-floating-ui-" + e;
|
|
433
|
-
}
|
|
434
|
-
function Hn(e) {
|
|
435
|
-
e.current !== -1 && (clearTimeout(e.current), e.current = -1);
|
|
436
|
-
}
|
|
437
|
-
let ft = 0;
|
|
438
|
-
function de(e, t) {
|
|
439
|
-
t === void 0 && (t = {});
|
|
440
|
-
const {
|
|
441
|
-
preventScroll: n = !1,
|
|
442
|
-
cancelPrevious: r = !0,
|
|
443
|
-
sync: o = !1
|
|
444
|
-
} = t;
|
|
445
|
-
r && cancelAnimationFrame(ft);
|
|
446
|
-
const i = () => e?.focus({
|
|
447
|
-
preventScroll: n
|
|
448
|
-
});
|
|
449
|
-
o ? i() : ft = requestAnimationFrame(i);
|
|
450
|
-
}
|
|
451
|
-
function Un(e) {
|
|
452
|
-
return e?.ownerDocument || document;
|
|
453
|
-
}
|
|
454
|
-
const me = {
|
|
455
|
-
inert: /* @__PURE__ */ new WeakMap(),
|
|
456
|
-
"aria-hidden": /* @__PURE__ */ new WeakMap(),
|
|
457
|
-
none: /* @__PURE__ */ new WeakMap()
|
|
458
|
-
};
|
|
459
|
-
function dt(e) {
|
|
460
|
-
return e === "inert" ? me.inert : e === "aria-hidden" ? me["aria-hidden"] : me.none;
|
|
461
|
-
}
|
|
462
|
-
let xe = /* @__PURE__ */ new WeakSet(), Te = {}, Ke = 0;
|
|
463
|
-
const qn = () => typeof HTMLElement < "u" && "inert" in HTMLElement.prototype;
|
|
464
|
-
function Vt(e) {
|
|
465
|
-
return e ? St(e) ? e.host : Vt(e.parentNode) : null;
|
|
466
|
-
}
|
|
467
|
-
const jn = (e, t) => t.map((n) => {
|
|
468
|
-
if (e.contains(n))
|
|
469
|
-
return n;
|
|
470
|
-
const r = Vt(n);
|
|
471
|
-
return e.contains(r) ? r : null;
|
|
472
|
-
}).filter((n) => n != null);
|
|
473
|
-
function Gn(e, t, n, r) {
|
|
474
|
-
const o = "data-floating-ui-inert", i = r ? "inert" : n ? "aria-hidden" : null, s = jn(t, e), u = /* @__PURE__ */ new Set(), d = new Set(s), a = [];
|
|
475
|
-
Te[o] || (Te[o] = /* @__PURE__ */ new WeakMap());
|
|
476
|
-
const v = Te[o];
|
|
477
|
-
s.forEach(E), I(t), u.clear();
|
|
478
|
-
function E(f) {
|
|
479
|
-
!f || u.has(f) || (u.add(f), f.parentNode && E(f.parentNode));
|
|
480
|
-
}
|
|
481
|
-
function I(f) {
|
|
482
|
-
!f || d.has(f) || [].forEach.call(f.children, (h) => {
|
|
483
|
-
if (xt(h) !== "script")
|
|
484
|
-
if (u.has(h))
|
|
485
|
-
I(h);
|
|
486
|
-
else {
|
|
487
|
-
const l = i ? h.getAttribute(i) : null, w = l !== null && l !== "false", x = dt(i), g = (x.get(h) || 0) + 1, p = (v.get(h) || 0) + 1;
|
|
488
|
-
x.set(h, g), v.set(h, p), a.push(h), g === 1 && w && xe.add(h), p === 1 && h.setAttribute(o, ""), !w && i && h.setAttribute(i, i === "inert" ? "" : "true");
|
|
489
|
-
}
|
|
490
|
-
});
|
|
491
|
-
}
|
|
492
|
-
return Ke++, () => {
|
|
493
|
-
a.forEach((f) => {
|
|
494
|
-
const h = dt(i), w = (h.get(f) || 0) - 1, x = (v.get(f) || 0) - 1;
|
|
495
|
-
h.set(f, w), v.set(f, x), w || (!xe.has(f) && i && f.removeAttribute(i), xe.delete(f)), x || f.removeAttribute(o);
|
|
496
|
-
}), Ke--, Ke || (me.inert = /* @__PURE__ */ new WeakMap(), me["aria-hidden"] = /* @__PURE__ */ new WeakMap(), me.none = /* @__PURE__ */ new WeakMap(), xe = /* @__PURE__ */ new WeakSet(), Te = {});
|
|
497
|
-
};
|
|
498
|
-
}
|
|
499
|
-
function vt(e, t, n) {
|
|
500
|
-
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
501
|
-
const r = Un(e[0]).body;
|
|
502
|
-
return Gn(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))), r, t, n);
|
|
503
|
-
}
|
|
504
|
-
const Ze = {
|
|
505
|
-
border: 0,
|
|
506
|
-
clip: "rect(0 0 0 0)",
|
|
507
|
-
height: "1px",
|
|
508
|
-
margin: "-1px",
|
|
509
|
-
overflow: "hidden",
|
|
510
|
-
padding: 0,
|
|
511
|
-
position: "fixed",
|
|
512
|
-
whiteSpace: "nowrap",
|
|
513
|
-
width: "1px",
|
|
514
|
-
top: 0,
|
|
515
|
-
left: 0
|
|
516
|
-
}, Pe = /* @__PURE__ */ c.forwardRef(function(t, n) {
|
|
517
|
-
const [r, o] = c.useState();
|
|
518
|
-
G(() => {
|
|
519
|
-
En() && o("button");
|
|
520
|
-
}, []);
|
|
521
|
-
const i = {
|
|
522
|
-
ref: n,
|
|
523
|
-
tabIndex: 0,
|
|
524
|
-
// Role is only for VoiceOver
|
|
525
|
-
role: r,
|
|
526
|
-
"aria-hidden": r ? void 0 : !0,
|
|
527
|
-
[Re("focus-guard")]: "",
|
|
528
|
-
style: Ze
|
|
529
|
-
};
|
|
530
|
-
return /* @__PURE__ */ N("span", {
|
|
531
|
-
...t,
|
|
532
|
-
...i
|
|
533
|
-
});
|
|
534
|
-
}), Yn = {
|
|
535
|
-
clipPath: "inset(50%)",
|
|
536
|
-
position: "fixed",
|
|
537
|
-
top: 0,
|
|
538
|
-
left: 0
|
|
539
|
-
}, $t = /* @__PURE__ */ c.createContext(null), bt = /* @__PURE__ */ Re("portal");
|
|
540
|
-
function Zn(e) {
|
|
541
|
-
e === void 0 && (e = {});
|
|
542
|
-
const {
|
|
543
|
-
id: t,
|
|
544
|
-
root: n
|
|
545
|
-
} = e, r = _t(), o = Bt(), [i, s] = c.useState(null), u = c.useRef(null);
|
|
546
|
-
return G(() => () => {
|
|
547
|
-
i?.remove(), queueMicrotask(() => {
|
|
548
|
-
u.current = null;
|
|
549
|
-
});
|
|
550
|
-
}, [i]), G(() => {
|
|
551
|
-
if (!r || u.current) return;
|
|
552
|
-
const d = t ? document.getElementById(t) : null;
|
|
553
|
-
if (!d) return;
|
|
554
|
-
const a = document.createElement("div");
|
|
555
|
-
a.id = r, a.setAttribute(bt, ""), d.appendChild(a), u.current = a, s(a);
|
|
556
|
-
}, [t, r]), G(() => {
|
|
557
|
-
if (n === null || !r || u.current) return;
|
|
558
|
-
let d = n || o?.portalNode;
|
|
559
|
-
d && !zt(d) && (d = d.current), d = d || document.body;
|
|
560
|
-
let a = null;
|
|
561
|
-
t && (a = document.createElement("div"), a.id = t, d.appendChild(a));
|
|
562
|
-
const v = document.createElement("div");
|
|
563
|
-
v.id = r, v.setAttribute(bt, ""), d = a || d, d.appendChild(v), u.current = v, s(v);
|
|
564
|
-
}, [t, n, r, o]), i;
|
|
565
|
-
}
|
|
566
|
-
function zn(e) {
|
|
567
|
-
const {
|
|
568
|
-
children: t,
|
|
569
|
-
id: n,
|
|
570
|
-
root: r,
|
|
571
|
-
preserveTabOrder: o = !0
|
|
572
|
-
} = e, i = Zn({
|
|
573
|
-
id: n,
|
|
574
|
-
root: r
|
|
575
|
-
}), [s, u] = c.useState(null), d = c.useRef(null), a = c.useRef(null), v = c.useRef(null), E = c.useRef(null), I = s?.modal, f = s?.open, h = (
|
|
576
|
-
// The FocusManager and therefore floating element are currently open/
|
|
577
|
-
// rendered.
|
|
578
|
-
!!s && // Guards are only for non-modal focus management.
|
|
579
|
-
!s.modal && // Don't render if unmount is transitioning.
|
|
580
|
-
s.open && o && !!(r || i)
|
|
581
|
-
);
|
|
582
|
-
return c.useEffect(() => {
|
|
583
|
-
if (!i || !o || I)
|
|
584
|
-
return;
|
|
585
|
-
function l(w) {
|
|
586
|
-
i && he(w) && (w.type === "focusin" ? st : Nn)(i);
|
|
587
|
-
}
|
|
588
|
-
return i.addEventListener("focusin", l, !0), i.addEventListener("focusout", l, !0), () => {
|
|
589
|
-
i.removeEventListener("focusin", l, !0), i.removeEventListener("focusout", l, !0);
|
|
590
|
-
};
|
|
591
|
-
}, [i, o, I]), c.useEffect(() => {
|
|
592
|
-
i && (f || st(i));
|
|
593
|
-
}, [f, i]), /* @__PURE__ */ Ce($t.Provider, {
|
|
594
|
-
value: c.useMemo(() => ({
|
|
595
|
-
preserveTabOrder: o,
|
|
596
|
-
beforeOutsideRef: d,
|
|
597
|
-
afterOutsideRef: a,
|
|
598
|
-
beforeInsideRef: v,
|
|
599
|
-
afterInsideRef: E,
|
|
600
|
-
portalNode: i,
|
|
601
|
-
setFocusManagerState: u
|
|
602
|
-
}), [o, i]),
|
|
603
|
-
children: [h && i && /* @__PURE__ */ N(Pe, {
|
|
604
|
-
"data-type": "outside",
|
|
605
|
-
ref: d,
|
|
606
|
-
onFocus: (l) => {
|
|
607
|
-
if (he(l, i)) {
|
|
608
|
-
var w;
|
|
609
|
-
(w = v.current) == null || w.focus();
|
|
610
|
-
} else {
|
|
611
|
-
const x = s ? s.domReference : null, g = Lt(x);
|
|
612
|
-
g?.focus();
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
}), h && i && /* @__PURE__ */ N("span", {
|
|
616
|
-
"aria-owns": i.id,
|
|
617
|
-
style: Yn
|
|
618
|
-
}), i && /* @__PURE__ */ en.createPortal(t, i), h && i && /* @__PURE__ */ N(Pe, {
|
|
619
|
-
"data-type": "outside",
|
|
620
|
-
ref: a,
|
|
621
|
-
onFocus: (l) => {
|
|
622
|
-
if (he(l, i)) {
|
|
623
|
-
var w;
|
|
624
|
-
(w = E.current) == null || w.focus();
|
|
625
|
-
} else {
|
|
626
|
-
const x = s ? s.domReference : null, g = Mt(x);
|
|
627
|
-
g?.focus(), s?.closeOnFocusOut && s?.onOpenChange(!1, l.nativeEvent, "focus-out");
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
})]
|
|
631
|
-
});
|
|
632
|
-
}
|
|
633
|
-
const Bt = () => c.useContext($t);
|
|
634
|
-
function mt(e) {
|
|
635
|
-
return c.useMemo(() => (t) => {
|
|
636
|
-
e.forEach((n) => {
|
|
637
|
-
n && (n.current = t);
|
|
638
|
-
});
|
|
639
|
-
}, e);
|
|
640
|
-
}
|
|
641
|
-
const gt = 20;
|
|
642
|
-
let ce = [];
|
|
643
|
-
function ze() {
|
|
644
|
-
ce = ce.filter((e) => {
|
|
645
|
-
var t;
|
|
646
|
-
return (t = e.deref()) == null ? void 0 : t.isConnected;
|
|
647
|
-
});
|
|
648
|
-
}
|
|
649
|
-
function Xn(e) {
|
|
650
|
-
ze(), e && xt(e) !== "body" && (ce.push(new WeakRef(e)), ce.length > gt && (ce = ce.slice(-gt)));
|
|
651
|
-
}
|
|
652
|
-
function pt() {
|
|
653
|
-
ze();
|
|
654
|
-
const e = ce[ce.length - 1];
|
|
655
|
-
return e?.deref();
|
|
656
|
-
}
|
|
657
|
-
function Jn(e) {
|
|
658
|
-
const t = Ee();
|
|
659
|
-
return Pt(e, t) ? e : Ne(e, t)[0] || e;
|
|
660
|
-
}
|
|
661
|
-
function ht(e, t) {
|
|
662
|
-
var n;
|
|
663
|
-
if (!t.current.includes("floating") && !((n = e.getAttribute("role")) != null && n.includes("dialog")))
|
|
664
|
-
return;
|
|
665
|
-
const r = Ee(), i = hn(e, r).filter((u) => {
|
|
666
|
-
const d = u.getAttribute("data-tabindex") || "";
|
|
667
|
-
return Pt(u, r) || u.hasAttribute("data-tabindex") && !d.startsWith("-");
|
|
668
|
-
}), s = e.getAttribute("tabindex");
|
|
669
|
-
t.current.includes("floating") || i.length === 0 ? s !== "0" && e.setAttribute("tabindex", "0") : (s !== "-1" || e.hasAttribute("data-tabindex") && e.getAttribute("data-tabindex") !== "-1") && (e.setAttribute("tabindex", "-1"), e.setAttribute("data-tabindex", "-1"));
|
|
670
|
-
}
|
|
671
|
-
const Qn = /* @__PURE__ */ c.forwardRef(function(t, n) {
|
|
672
|
-
return /* @__PURE__ */ N("button", {
|
|
673
|
-
...t,
|
|
674
|
-
type: "button",
|
|
675
|
-
ref: n,
|
|
676
|
-
tabIndex: -1,
|
|
677
|
-
style: Ze
|
|
678
|
-
});
|
|
679
|
-
});
|
|
680
|
-
function er(e) {
|
|
681
|
-
const {
|
|
682
|
-
context: t,
|
|
683
|
-
children: n,
|
|
684
|
-
disabled: r = !1,
|
|
685
|
-
order: o = ["content"],
|
|
686
|
-
guards: i = !0,
|
|
687
|
-
initialFocus: s = 0,
|
|
688
|
-
returnFocus: u = !0,
|
|
689
|
-
restoreFocus: d = !1,
|
|
690
|
-
modal: a = !0,
|
|
691
|
-
visuallyHiddenDismiss: v = !1,
|
|
692
|
-
closeOnFocusOut: E = !0,
|
|
693
|
-
outsideElementsInert: I = !1,
|
|
694
|
-
getInsideElements: f = () => []
|
|
695
|
-
} = e, {
|
|
696
|
-
open: h,
|
|
697
|
-
onOpenChange: l,
|
|
698
|
-
events: w,
|
|
699
|
-
dataRef: x,
|
|
700
|
-
elements: {
|
|
701
|
-
domReference: g,
|
|
702
|
-
floating: p
|
|
703
|
-
}
|
|
704
|
-
} = t, L = J(() => {
|
|
705
|
-
var y;
|
|
706
|
-
return (y = x.current.floatingContext) == null ? void 0 : y.nodeId;
|
|
707
|
-
}), K = J(f), W = typeof s == "number" && s < 0, O = nt(g) && W, B = qn(), re = B ? i : !0, Q = !re || B && I, T = Be(o), pe = Be(s), oe = Be(u), m = Ye(), b = Bt(), $ = c.useRef(null), _ = c.useRef(null), R = c.useRef(!1), F = c.useRef(!1), V = c.useRef(-1), Y = c.useRef(-1), fe = b != null, C = rt(p), X = J(function(y) {
|
|
708
|
-
return y === void 0 && (y = C), y ? Ne(y, Ee()) : [];
|
|
709
|
-
}), P = J((y) => {
|
|
710
|
-
const A = X(y);
|
|
711
|
-
return T.current.map((S) => g && S === "reference" ? g : C && S === "floating" ? C : A).filter(Boolean).flat();
|
|
712
|
-
});
|
|
713
|
-
c.useEffect(() => {
|
|
714
|
-
if (r || !a) return;
|
|
715
|
-
function y(S) {
|
|
716
|
-
if (S.key === "Tab") {
|
|
717
|
-
U(C, ve(z(C))) && X().length === 0 && !O && $e(S);
|
|
718
|
-
const D = P(), M = ue(S);
|
|
719
|
-
T.current[0] === "reference" && M === g && ($e(S), S.shiftKey ? de(D[D.length - 1]) : de(D[1])), T.current[1] === "floating" && M === C && S.shiftKey && ($e(S), de(D[0]));
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
const A = z(C);
|
|
723
|
-
return A.addEventListener("keydown", y), () => {
|
|
724
|
-
A.removeEventListener("keydown", y);
|
|
725
|
-
};
|
|
726
|
-
}, [r, g, C, a, T, O, X, P]), c.useEffect(() => {
|
|
727
|
-
if (r || !p) return;
|
|
728
|
-
function y(A) {
|
|
729
|
-
const S = ue(A), M = X().indexOf(S);
|
|
730
|
-
M !== -1 && (V.current = M);
|
|
731
|
-
}
|
|
732
|
-
return p.addEventListener("focusin", y), () => {
|
|
733
|
-
p.removeEventListener("focusin", y);
|
|
734
|
-
};
|
|
735
|
-
}, [r, p, X]), c.useEffect(() => {
|
|
736
|
-
if (r || !E) return;
|
|
737
|
-
function y() {
|
|
738
|
-
F.current = !0, setTimeout(() => {
|
|
739
|
-
F.current = !1;
|
|
740
|
-
});
|
|
741
|
-
}
|
|
742
|
-
function A(M) {
|
|
743
|
-
const k = M.relatedTarget, ee = M.currentTarget, j = ue(M);
|
|
744
|
-
queueMicrotask(() => {
|
|
745
|
-
const H = L(), le = !(U(g, k) || U(p, k) || U(k, p) || U(b?.portalNode, k) || k != null && k.hasAttribute(Re("focus-guard")) || m && (be(m.nodesRef.current, H).find((se) => {
|
|
746
|
-
var te, ae;
|
|
747
|
-
return U((te = se.context) == null ? void 0 : te.elements.floating, k) || U((ae = se.context) == null ? void 0 : ae.elements.domReference, k);
|
|
748
|
-
}) || ot(m.nodesRef.current, H).find((se) => {
|
|
749
|
-
var te, ae, Xe;
|
|
750
|
-
return [(te = se.context) == null ? void 0 : te.elements.floating, rt((ae = se.context) == null ? void 0 : ae.elements.floating)].includes(k) || ((Xe = se.context) == null ? void 0 : Xe.elements.domReference) === k;
|
|
751
|
-
})));
|
|
752
|
-
if (ee === g && C && ht(C, T), d && ee !== g && !(j != null && j.isConnected) && ve(z(C)) === z(C).body) {
|
|
753
|
-
ne(C) && C.focus();
|
|
754
|
-
const se = V.current, te = X(), ae = te[se] || te[te.length - 1] || C;
|
|
755
|
-
ne(ae) && ae.focus();
|
|
756
|
-
}
|
|
757
|
-
if (x.current.insideReactTree) {
|
|
758
|
-
x.current.insideReactTree = !1;
|
|
759
|
-
return;
|
|
760
|
-
}
|
|
761
|
-
(O || !a) && k && le && !F.current && // Fix React 18 Strict Mode returnFocus due to double rendering.
|
|
762
|
-
k !== pt() && (R.current = !0, l(!1, M, "focus-out"));
|
|
763
|
-
});
|
|
764
|
-
}
|
|
765
|
-
const S = !!(!m && b);
|
|
766
|
-
function D() {
|
|
767
|
-
Hn(Y), x.current.insideReactTree = !0, Y.current = window.setTimeout(() => {
|
|
768
|
-
x.current.insideReactTree = !1;
|
|
769
|
-
});
|
|
770
|
-
}
|
|
771
|
-
if (p && ne(g))
|
|
772
|
-
return g.addEventListener("focusout", A), g.addEventListener("pointerdown", y), p.addEventListener("focusout", A), S && p.addEventListener("focusout", D, !0), () => {
|
|
773
|
-
g.removeEventListener("focusout", A), g.removeEventListener("pointerdown", y), p.removeEventListener("focusout", A), S && p.removeEventListener("focusout", D, !0);
|
|
774
|
-
};
|
|
775
|
-
}, [r, g, p, C, a, m, b, l, E, d, X, O, L, T, x]);
|
|
776
|
-
const q = c.useRef(null), ie = c.useRef(null), Oe = mt([q, b?.beforeInsideRef]), Fe = mt([ie, b?.afterInsideRef]);
|
|
777
|
-
c.useEffect(() => {
|
|
778
|
-
var y, A;
|
|
779
|
-
if (r || !p) return;
|
|
780
|
-
const S = Array.from((b == null || (y = b.portalNode) == null ? void 0 : y.querySelectorAll("[" + Re("portal") + "]")) || []), M = (A = (m ? ot(m.nodesRef.current, L()) : []).find((j) => {
|
|
781
|
-
var H;
|
|
782
|
-
return nt(((H = j.context) == null ? void 0 : H.elements.domReference) || null);
|
|
783
|
-
})) == null || (A = A.context) == null ? void 0 : A.elements.domReference, k = [p, M, ...S, ...K(), $.current, _.current, q.current, ie.current, b?.beforeOutsideRef.current, b?.afterOutsideRef.current, T.current.includes("reference") || O ? g : null].filter((j) => j != null), ee = a || O ? vt(k, !Q, Q) : vt(k);
|
|
784
|
-
return () => {
|
|
785
|
-
ee();
|
|
786
|
-
};
|
|
787
|
-
}, [r, g, p, a, T, b, O, re, Q, m, L, K]), G(() => {
|
|
788
|
-
if (r || !ne(C)) return;
|
|
789
|
-
const y = z(C), A = ve(y);
|
|
790
|
-
queueMicrotask(() => {
|
|
791
|
-
const S = P(C), D = pe.current, M = (typeof D == "number" ? S[D] : D.current) || C, k = U(C, A);
|
|
792
|
-
!W && !k && h && de(M, {
|
|
793
|
-
preventScroll: M === C
|
|
794
|
-
});
|
|
795
|
-
});
|
|
796
|
-
}, [r, h, C, W, P, pe]), G(() => {
|
|
797
|
-
if (r || !C) return;
|
|
798
|
-
const y = z(C), A = ve(y);
|
|
799
|
-
Xn(A);
|
|
800
|
-
function S(k) {
|
|
801
|
-
let {
|
|
802
|
-
reason: ee,
|
|
803
|
-
event: j,
|
|
804
|
-
nested: H
|
|
805
|
-
} = k;
|
|
806
|
-
if (["hover", "safe-polygon"].includes(ee) && j.type === "mouseleave" && (R.current = !0), ee === "outside-press")
|
|
807
|
-
if (H)
|
|
808
|
-
R.current = !1;
|
|
809
|
-
else if (Tn(j) || Cn(j))
|
|
810
|
-
R.current = !1;
|
|
811
|
-
else {
|
|
812
|
-
let le = !1;
|
|
813
|
-
document.createElement("div").focus({
|
|
814
|
-
get preventScroll() {
|
|
815
|
-
return le = !0, !1;
|
|
816
|
-
}
|
|
817
|
-
}), le ? R.current = !1 : R.current = !0;
|
|
818
|
-
}
|
|
819
|
-
}
|
|
820
|
-
w.on("openchange", S);
|
|
821
|
-
const D = y.createElement("span");
|
|
822
|
-
D.setAttribute("tabindex", "-1"), D.setAttribute("aria-hidden", "true"), Object.assign(D.style, Ze), fe && g && g.insertAdjacentElement("afterend", D);
|
|
823
|
-
function M() {
|
|
824
|
-
if (typeof oe.current == "boolean") {
|
|
825
|
-
const k = g || pt();
|
|
826
|
-
return k && k.isConnected ? k : D;
|
|
827
|
-
}
|
|
828
|
-
return oe.current.current || D;
|
|
829
|
-
}
|
|
830
|
-
return () => {
|
|
831
|
-
w.off("openchange", S);
|
|
832
|
-
const k = ve(y), ee = U(p, k) || m && be(m.nodesRef.current, L(), !1).some((H) => {
|
|
833
|
-
var le;
|
|
834
|
-
return U((le = H.context) == null ? void 0 : le.elements.floating, k);
|
|
835
|
-
}), j = M();
|
|
836
|
-
queueMicrotask(() => {
|
|
837
|
-
const H = Jn(j);
|
|
838
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
839
|
-
oe.current && !R.current && ne(H) && // If the focus moved somewhere else after mount, avoid returning focus
|
|
840
|
-
// since it likely entered a different element which should be
|
|
841
|
-
// respected: https://github.com/floating-ui/floating-ui/issues/2607
|
|
842
|
-
(!(H !== k && k !== y.body) || ee) && H.focus({
|
|
843
|
-
preventScroll: !0
|
|
844
|
-
}), D.remove();
|
|
845
|
-
});
|
|
846
|
-
};
|
|
847
|
-
}, [r, p, C, oe, x, w, m, fe, g, L]), c.useEffect(() => (queueMicrotask(() => {
|
|
848
|
-
R.current = !1;
|
|
849
|
-
}), () => {
|
|
850
|
-
queueMicrotask(ze);
|
|
851
|
-
}), [r]), G(() => {
|
|
852
|
-
if (!r && b)
|
|
853
|
-
return b.setFocusManagerState({
|
|
854
|
-
modal: a,
|
|
855
|
-
closeOnFocusOut: E,
|
|
856
|
-
open: h,
|
|
857
|
-
onOpenChange: l,
|
|
858
|
-
domReference: g
|
|
859
|
-
}), () => {
|
|
860
|
-
b.setFocusManagerState(null);
|
|
861
|
-
};
|
|
862
|
-
}, [r, b, a, h, l, E, g]), G(() => {
|
|
863
|
-
r || C && ht(C, T);
|
|
864
|
-
}, [r, C, T]);
|
|
865
|
-
function ye(y) {
|
|
866
|
-
return r || !v || !a ? null : /* @__PURE__ */ N(Qn, {
|
|
867
|
-
ref: y === "start" ? $ : _,
|
|
868
|
-
onClick: (A) => l(!1, A.nativeEvent),
|
|
869
|
-
children: typeof v == "string" ? v : "Dismiss"
|
|
870
|
-
});
|
|
871
|
-
}
|
|
872
|
-
const we = !r && re && (a ? !O : !0) && (fe || a);
|
|
873
|
-
return /* @__PURE__ */ Ce(Kt, {
|
|
874
|
-
children: [we && /* @__PURE__ */ N(Pe, {
|
|
875
|
-
"data-type": "inside",
|
|
876
|
-
ref: Oe,
|
|
877
|
-
onFocus: (y) => {
|
|
878
|
-
if (a) {
|
|
879
|
-
const S = P();
|
|
880
|
-
de(o[0] === "reference" ? S[0] : S[S.length - 1]);
|
|
881
|
-
} else if (b != null && b.preserveTabOrder && b.portalNode)
|
|
882
|
-
if (R.current = !1, he(y, b.portalNode)) {
|
|
883
|
-
const S = Mt(g);
|
|
884
|
-
S?.focus();
|
|
885
|
-
} else {
|
|
886
|
-
var A;
|
|
887
|
-
(A = b.beforeOutsideRef.current) == null || A.focus();
|
|
888
|
-
}
|
|
889
|
-
}
|
|
890
|
-
}), !O && ye("start"), n, ye("end"), we && /* @__PURE__ */ N(Pe, {
|
|
891
|
-
"data-type": "inside",
|
|
892
|
-
ref: Fe,
|
|
893
|
-
onFocus: (y) => {
|
|
894
|
-
if (a)
|
|
895
|
-
de(P()[0]);
|
|
896
|
-
else if (b != null && b.preserveTabOrder && b.portalNode)
|
|
897
|
-
if (E && (R.current = !0), he(y, b.portalNode)) {
|
|
898
|
-
const S = Lt(g);
|
|
899
|
-
S?.focus();
|
|
900
|
-
} else {
|
|
901
|
-
var A;
|
|
902
|
-
(A = b.afterOutsideRef.current) == null || A.focus();
|
|
903
|
-
}
|
|
904
|
-
}
|
|
905
|
-
})]
|
|
906
|
-
});
|
|
907
|
-
}
|
|
908
|
-
function Rt(e) {
|
|
909
|
-
return ne(e.target) && e.target.tagName === "BUTTON";
|
|
910
|
-
}
|
|
911
|
-
function tr(e) {
|
|
912
|
-
return ne(e.target) && e.target.tagName === "A";
|
|
913
|
-
}
|
|
914
|
-
function Et(e) {
|
|
915
|
-
return Ot(e);
|
|
916
|
-
}
|
|
917
|
-
function nr(e, t) {
|
|
918
|
-
t === void 0 && (t = {});
|
|
919
|
-
const {
|
|
920
|
-
open: n,
|
|
921
|
-
onOpenChange: r,
|
|
922
|
-
dataRef: o,
|
|
923
|
-
elements: {
|
|
924
|
-
domReference: i
|
|
925
|
-
}
|
|
926
|
-
} = e, {
|
|
927
|
-
enabled: s = !0,
|
|
928
|
-
event: u = "click",
|
|
929
|
-
toggle: d = !0,
|
|
930
|
-
ignoreMouse: a = !1,
|
|
931
|
-
keyboardHandlers: v = !0,
|
|
932
|
-
stickIfOpen: E = !0
|
|
933
|
-
} = t, I = c.useRef(), f = c.useRef(!1), h = c.useMemo(() => ({
|
|
934
|
-
onPointerDown(l) {
|
|
935
|
-
I.current = l.pointerType;
|
|
936
|
-
},
|
|
937
|
-
onMouseDown(l) {
|
|
938
|
-
const w = I.current;
|
|
939
|
-
l.button === 0 && u !== "click" && (it(w) && a || (n && d && (!(o.current.openEvent && E) || o.current.openEvent.type === "mousedown") ? r(!1, l.nativeEvent, "click") : (l.preventDefault(), r(!0, l.nativeEvent, "click"))));
|
|
940
|
-
},
|
|
941
|
-
onClick(l) {
|
|
942
|
-
const w = I.current;
|
|
943
|
-
if (u === "mousedown" && I.current) {
|
|
944
|
-
I.current = void 0;
|
|
945
|
-
return;
|
|
946
|
-
}
|
|
947
|
-
it(w) && a || (n && d && (!(o.current.openEvent && E) || o.current.openEvent.type === "click") ? r(!1, l.nativeEvent, "click") : r(!0, l.nativeEvent, "click"));
|
|
948
|
-
},
|
|
949
|
-
onKeyDown(l) {
|
|
950
|
-
I.current = void 0, !(l.defaultPrevented || !v || Rt(l)) && (l.key === " " && !Et(i) && (l.preventDefault(), f.current = !0), !tr(l) && l.key === "Enter" && r(!(n && d), l.nativeEvent, "click"));
|
|
951
|
-
},
|
|
952
|
-
onKeyUp(l) {
|
|
953
|
-
l.defaultPrevented || !v || Rt(l) || Et(i) || l.key === " " && f.current && (f.current = !1, r(!(n && d), l.nativeEvent, "click"));
|
|
954
|
-
}
|
|
955
|
-
}), [o, i, u, a, v, r, n, E, d]);
|
|
956
|
-
return c.useMemo(() => s ? {
|
|
957
|
-
reference: h
|
|
958
|
-
} : {}, [s, h]);
|
|
959
|
-
}
|
|
960
|
-
const rr = {
|
|
961
|
-
pointerdown: "onPointerDown",
|
|
962
|
-
mousedown: "onMouseDown",
|
|
963
|
-
click: "onClick"
|
|
964
|
-
}, or = {
|
|
965
|
-
pointerdown: "onPointerDownCapture",
|
|
966
|
-
mousedown: "onMouseDownCapture",
|
|
967
|
-
click: "onClickCapture"
|
|
968
|
-
}, yt = (e) => {
|
|
969
|
-
var t, n;
|
|
970
|
-
return {
|
|
971
|
-
escapeKey: typeof e == "boolean" ? e : (t = e?.escapeKey) != null ? t : !1,
|
|
972
|
-
outsidePress: typeof e == "boolean" ? e : (n = e?.outsidePress) != null ? n : !0
|
|
973
|
-
};
|
|
974
|
-
};
|
|
975
|
-
function ir(e, t) {
|
|
976
|
-
t === void 0 && (t = {});
|
|
977
|
-
const {
|
|
978
|
-
open: n,
|
|
979
|
-
onOpenChange: r,
|
|
980
|
-
elements: o,
|
|
981
|
-
dataRef: i
|
|
982
|
-
} = e, {
|
|
983
|
-
enabled: s = !0,
|
|
984
|
-
escapeKey: u = !0,
|
|
985
|
-
outsidePress: d = !0,
|
|
986
|
-
outsidePressEvent: a = "pointerdown",
|
|
987
|
-
referencePress: v = !1,
|
|
988
|
-
referencePressEvent: E = "pointerdown",
|
|
989
|
-
ancestorScroll: I = !1,
|
|
990
|
-
bubbles: f,
|
|
991
|
-
capture: h
|
|
992
|
-
} = t, l = Ye(), w = J(typeof d == "function" ? d : () => !1), x = typeof d == "function" ? w : d, g = c.useRef(!1), {
|
|
993
|
-
escapeKey: p,
|
|
994
|
-
outsidePress: L
|
|
995
|
-
} = yt(f), {
|
|
996
|
-
escapeKey: K,
|
|
997
|
-
outsidePress: W
|
|
998
|
-
} = yt(h), O = c.useRef(!1), B = J((m) => {
|
|
999
|
-
var b;
|
|
1000
|
-
if (!n || !s || !u || m.key !== "Escape" || O.current)
|
|
1001
|
-
return;
|
|
1002
|
-
const $ = (b = i.current.floatingContext) == null ? void 0 : b.nodeId, _ = l ? be(l.nodesRef.current, $) : [];
|
|
1003
|
-
if (!p && (m.stopPropagation(), _.length > 0)) {
|
|
1004
|
-
let R = !0;
|
|
1005
|
-
if (_.forEach((F) => {
|
|
1006
|
-
var V;
|
|
1007
|
-
if ((V = F.context) != null && V.open && !F.context.dataRef.current.__escapeKeyBubbles) {
|
|
1008
|
-
R = !1;
|
|
1009
|
-
return;
|
|
1010
|
-
}
|
|
1011
|
-
}), !R)
|
|
1012
|
-
return;
|
|
1013
|
-
}
|
|
1014
|
-
r(!1, xn(m) ? m.nativeEvent : m, "escape-key");
|
|
1015
|
-
}), re = J((m) => {
|
|
1016
|
-
var b;
|
|
1017
|
-
const $ = () => {
|
|
1018
|
-
var _;
|
|
1019
|
-
B(m), (_ = ue(m)) == null || _.removeEventListener("keydown", $);
|
|
1020
|
-
};
|
|
1021
|
-
(b = ue(m)) == null || b.addEventListener("keydown", $);
|
|
1022
|
-
}), Q = J((m) => {
|
|
1023
|
-
var b;
|
|
1024
|
-
const $ = i.current.insideReactTree;
|
|
1025
|
-
i.current.insideReactTree = !1;
|
|
1026
|
-
const _ = g.current;
|
|
1027
|
-
if (g.current = !1, a === "click" && _ || $ || typeof x == "function" && !x(m))
|
|
1028
|
-
return;
|
|
1029
|
-
const R = ue(m), F = "[" + Re("inert") + "]", V = z(o.floating).querySelectorAll(F);
|
|
1030
|
-
let Y = Z(R) ? R : null;
|
|
1031
|
-
for (; Y && !Le(Y); ) {
|
|
1032
|
-
const P = Yt(Y);
|
|
1033
|
-
if (Le(P) || !Z(P))
|
|
1034
|
-
break;
|
|
1035
|
-
Y = P;
|
|
1036
|
-
}
|
|
1037
|
-
if (V.length && Z(R) && !Sn(R) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
|
|
1038
|
-
!U(R, o.floating) && // If the target root element contains none of the markers, then the
|
|
1039
|
-
// element was injected after the floating element rendered.
|
|
1040
|
-
Array.from(V).every((P) => !U(Y, P)))
|
|
1041
|
-
return;
|
|
1042
|
-
if (ne(R) && oe) {
|
|
1043
|
-
const P = Le(R), q = Zt(R), ie = /auto|scroll/, Oe = P || ie.test(q.overflowX), Fe = P || ie.test(q.overflowY), ye = Oe && R.clientWidth > 0 && R.scrollWidth > R.clientWidth, we = Fe && R.clientHeight > 0 && R.scrollHeight > R.clientHeight, y = q.direction === "rtl", A = we && (y ? m.offsetX <= R.offsetWidth - R.clientWidth : m.offsetX > R.clientWidth), S = ye && m.offsetY > R.clientHeight;
|
|
1044
|
-
if (A || S)
|
|
1045
|
-
return;
|
|
1046
|
-
}
|
|
1047
|
-
const fe = (b = i.current.floatingContext) == null ? void 0 : b.nodeId, C = l && be(l.nodesRef.current, fe).some((P) => {
|
|
1048
|
-
var q;
|
|
1049
|
-
return Ve(m, (q = P.context) == null ? void 0 : q.elements.floating);
|
|
1050
|
-
});
|
|
1051
|
-
if (Ve(m, o.floating) || Ve(m, o.domReference) || C)
|
|
1052
|
-
return;
|
|
1053
|
-
const X = l ? be(l.nodesRef.current, fe) : [];
|
|
1054
|
-
if (X.length > 0) {
|
|
1055
|
-
let P = !0;
|
|
1056
|
-
if (X.forEach((q) => {
|
|
1057
|
-
var ie;
|
|
1058
|
-
if ((ie = q.context) != null && ie.open && !q.context.dataRef.current.__outsidePressBubbles) {
|
|
1059
|
-
P = !1;
|
|
1060
|
-
return;
|
|
1061
|
-
}
|
|
1062
|
-
}), !P)
|
|
1063
|
-
return;
|
|
1064
|
-
}
|
|
1065
|
-
r(!1, m, "outside-press");
|
|
1066
|
-
}), T = J((m) => {
|
|
1067
|
-
var b;
|
|
1068
|
-
const $ = () => {
|
|
1069
|
-
var _;
|
|
1070
|
-
Q(m), (_ = ue(m)) == null || _.removeEventListener(a, $);
|
|
1071
|
-
};
|
|
1072
|
-
(b = ue(m)) == null || b.addEventListener(a, $);
|
|
1073
|
-
});
|
|
1074
|
-
c.useEffect(() => {
|
|
1075
|
-
if (!n || !s)
|
|
1076
|
-
return;
|
|
1077
|
-
i.current.__escapeKeyBubbles = p, i.current.__outsidePressBubbles = L;
|
|
1078
|
-
let m = -1;
|
|
1079
|
-
function b(V) {
|
|
1080
|
-
r(!1, V, "ancestor-scroll");
|
|
1081
|
-
}
|
|
1082
|
-
function $() {
|
|
1083
|
-
window.clearTimeout(m), O.current = !0;
|
|
1084
|
-
}
|
|
1085
|
-
function _() {
|
|
1086
|
-
m = window.setTimeout(
|
|
1087
|
-
() => {
|
|
1088
|
-
O.current = !1;
|
|
1089
|
-
},
|
|
1090
|
-
// 0ms or 1ms don't work in Safari. 5ms appears to consistently work.
|
|
1091
|
-
// Only apply to WebKit for the test to remain 0ms.
|
|
1092
|
-
Gt() ? 5 : 0
|
|
1093
|
-
);
|
|
1094
|
-
}
|
|
1095
|
-
const R = z(o.floating);
|
|
1096
|
-
u && (R.addEventListener("keydown", K ? re : B, K), R.addEventListener("compositionstart", $), R.addEventListener("compositionend", _)), x && R.addEventListener(a, W ? T : Q, W);
|
|
1097
|
-
let F = [];
|
|
1098
|
-
return I && (Z(o.domReference) && (F = Me(o.domReference)), Z(o.floating) && (F = F.concat(Me(o.floating))), !Z(o.reference) && o.reference && o.reference.contextElement && (F = F.concat(Me(o.reference.contextElement)))), F = F.filter((V) => {
|
|
1099
|
-
var Y;
|
|
1100
|
-
return V !== ((Y = R.defaultView) == null ? void 0 : Y.visualViewport);
|
|
1101
|
-
}), F.forEach((V) => {
|
|
1102
|
-
V.addEventListener("scroll", b, {
|
|
1103
|
-
passive: !0
|
|
1104
|
-
});
|
|
1105
|
-
}), () => {
|
|
1106
|
-
u && (R.removeEventListener("keydown", K ? re : B, K), R.removeEventListener("compositionstart", $), R.removeEventListener("compositionend", _)), x && R.removeEventListener(a, W ? T : Q, W), F.forEach((V) => {
|
|
1107
|
-
V.removeEventListener("scroll", b);
|
|
1108
|
-
}), window.clearTimeout(m);
|
|
1109
|
-
};
|
|
1110
|
-
}, [i, o, u, x, a, n, r, I, s, p, L, B, K, re, Q, W, T]), c.useEffect(() => {
|
|
1111
|
-
i.current.insideReactTree = !1;
|
|
1112
|
-
}, [i, x, a]);
|
|
1113
|
-
const pe = c.useMemo(() => ({
|
|
1114
|
-
onKeyDown: B,
|
|
1115
|
-
...v && {
|
|
1116
|
-
[rr[E]]: (m) => {
|
|
1117
|
-
r(!1, m.nativeEvent, "reference-press");
|
|
1118
|
-
},
|
|
1119
|
-
...E !== "click" && {
|
|
1120
|
-
onClick(m) {
|
|
1121
|
-
r(!1, m.nativeEvent, "reference-press");
|
|
1122
|
-
}
|
|
1123
|
-
}
|
|
1124
|
-
}
|
|
1125
|
-
}), [B, r, v, E]), oe = c.useMemo(() => {
|
|
1126
|
-
function m(b) {
|
|
1127
|
-
b.button === 0 && (g.current = !0);
|
|
1128
|
-
}
|
|
1129
|
-
return {
|
|
1130
|
-
onKeyDown: B,
|
|
1131
|
-
onMouseDown: m,
|
|
1132
|
-
onMouseUp: m,
|
|
1133
|
-
[or[a]]: () => {
|
|
1134
|
-
i.current.insideReactTree = !0;
|
|
1135
|
-
}
|
|
1136
|
-
};
|
|
1137
|
-
}, [B, a, i]);
|
|
1138
|
-
return c.useMemo(() => s ? {
|
|
1139
|
-
reference: pe,
|
|
1140
|
-
floating: oe
|
|
1141
|
-
} : {}, [s, pe, oe]);
|
|
1142
|
-
}
|
|
1143
|
-
function sr(e) {
|
|
1144
|
-
const {
|
|
1145
|
-
open: t = !1,
|
|
1146
|
-
onOpenChange: n,
|
|
1147
|
-
elements: r
|
|
1148
|
-
} = e, o = _t(), i = c.useRef({}), [s] = c.useState(() => $n()), u = Wn() != null;
|
|
1149
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1150
|
-
const f = r.reference;
|
|
1151
|
-
f && !Z(f) && Vn("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
|
|
1152
|
-
}
|
|
1153
|
-
const [d, a] = c.useState(r.reference), v = J((f, h, l) => {
|
|
1154
|
-
i.current.openEvent = f ? h : void 0, s.emit("openchange", {
|
|
1155
|
-
open: f,
|
|
1156
|
-
event: h,
|
|
1157
|
-
reason: l,
|
|
1158
|
-
nested: u
|
|
1159
|
-
}), n?.(f, h, l);
|
|
1160
|
-
}), E = c.useMemo(() => ({
|
|
1161
|
-
setPositionReference: a
|
|
1162
|
-
}), []), I = c.useMemo(() => ({
|
|
1163
|
-
reference: d || r.reference || null,
|
|
1164
|
-
floating: r.floating || null,
|
|
1165
|
-
domReference: r.reference
|
|
1166
|
-
}), [d, r.reference, r.floating]);
|
|
1167
|
-
return c.useMemo(() => ({
|
|
1168
|
-
dataRef: i,
|
|
1169
|
-
open: t,
|
|
1170
|
-
onOpenChange: v,
|
|
1171
|
-
elements: I,
|
|
1172
|
-
events: s,
|
|
1173
|
-
floatingId: o,
|
|
1174
|
-
refs: E
|
|
1175
|
-
}), [t, v, I, s, o, E]);
|
|
1176
|
-
}
|
|
1177
|
-
function ar(e) {
|
|
1178
|
-
e === void 0 && (e = {});
|
|
1179
|
-
const {
|
|
1180
|
-
nodeId: t
|
|
1181
|
-
} = e, n = sr({
|
|
1182
|
-
...e,
|
|
1183
|
-
elements: {
|
|
1184
|
-
reference: null,
|
|
1185
|
-
floating: null,
|
|
1186
|
-
...e.elements
|
|
1187
|
-
}
|
|
1188
|
-
}), r = e.rootContext || n, o = r.elements, [i, s] = c.useState(null), [u, d] = c.useState(null), v = o?.domReference || i, E = c.useRef(null), I = Ye();
|
|
1189
|
-
G(() => {
|
|
1190
|
-
v && (E.current = v);
|
|
1191
|
-
}, [v]);
|
|
1192
|
-
const f = jt({
|
|
1193
|
-
...e,
|
|
1194
|
-
elements: {
|
|
1195
|
-
...o,
|
|
1196
|
-
...u && {
|
|
1197
|
-
reference: u
|
|
1198
|
-
}
|
|
1199
|
-
}
|
|
1200
|
-
}), h = c.useCallback((p) => {
|
|
1201
|
-
const L = Z(p) ? {
|
|
1202
|
-
getBoundingClientRect: () => p.getBoundingClientRect(),
|
|
1203
|
-
getClientRects: () => p.getClientRects(),
|
|
1204
|
-
contextElement: p
|
|
1205
|
-
} : p;
|
|
1206
|
-
d(L), f.refs.setReference(L);
|
|
1207
|
-
}, [f.refs]), l = c.useCallback((p) => {
|
|
1208
|
-
(Z(p) || p === null) && (E.current = p, s(p)), (Z(f.refs.reference.current) || f.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
|
|
1209
|
-
// `null` to support `positionReference` + an unstable `reference`
|
|
1210
|
-
// callback ref.
|
|
1211
|
-
p !== null && !Z(p)) && f.refs.setReference(p);
|
|
1212
|
-
}, [f.refs]), w = c.useMemo(() => ({
|
|
1213
|
-
...f.refs,
|
|
1214
|
-
setReference: l,
|
|
1215
|
-
setPositionReference: h,
|
|
1216
|
-
domReference: E
|
|
1217
|
-
}), [f.refs, l, h]), x = c.useMemo(() => ({
|
|
1218
|
-
...f.elements,
|
|
1219
|
-
domReference: v
|
|
1220
|
-
}), [f.elements, v]), g = c.useMemo(() => ({
|
|
1221
|
-
...f,
|
|
1222
|
-
...r,
|
|
1223
|
-
refs: w,
|
|
1224
|
-
elements: x,
|
|
1225
|
-
nodeId: t
|
|
1226
|
-
}), [f, w, x, t, r]);
|
|
1227
|
-
return G(() => {
|
|
1228
|
-
r.dataRef.current.floatingContext = g;
|
|
1229
|
-
const p = I?.nodesRef.current.find((L) => L.id === t);
|
|
1230
|
-
p && (p.context = g);
|
|
1231
|
-
}), c.useMemo(() => ({
|
|
1232
|
-
...f,
|
|
1233
|
-
context: g,
|
|
1234
|
-
refs: w,
|
|
1235
|
-
elements: x
|
|
1236
|
-
}), [f, w, x, g]);
|
|
1237
|
-
}
|
|
1238
|
-
function We(e, t, n) {
|
|
1239
|
-
const r = /* @__PURE__ */ new Map(), o = n === "item";
|
|
1240
|
-
let i = e;
|
|
1241
|
-
if (o && e) {
|
|
1242
|
-
const {
|
|
1243
|
-
[at]: s,
|
|
1244
|
-
[ut]: u,
|
|
1245
|
-
...d
|
|
1246
|
-
} = e;
|
|
1247
|
-
i = d;
|
|
1248
|
-
}
|
|
1249
|
-
return {
|
|
1250
|
-
...n === "floating" && {
|
|
1251
|
-
tabIndex: -1,
|
|
1252
|
-
[On]: ""
|
|
1253
|
-
},
|
|
1254
|
-
...i,
|
|
1255
|
-
...t.map((s) => {
|
|
1256
|
-
const u = s ? s[n] : null;
|
|
1257
|
-
return typeof u == "function" ? e ? u(e) : null : u;
|
|
1258
|
-
}).concat(e).reduce((s, u) => (u && Object.entries(u).forEach((d) => {
|
|
1259
|
-
let [a, v] = d;
|
|
1260
|
-
if (!(o && [at, ut].includes(a)))
|
|
1261
|
-
if (a.indexOf("on") === 0) {
|
|
1262
|
-
if (r.has(a) || r.set(a, []), typeof v == "function") {
|
|
1263
|
-
var E;
|
|
1264
|
-
(E = r.get(a)) == null || E.push(v), s[a] = function() {
|
|
1265
|
-
for (var I, f = arguments.length, h = new Array(f), l = 0; l < f; l++)
|
|
1266
|
-
h[l] = arguments[l];
|
|
1267
|
-
return (I = r.get(a)) == null ? void 0 : I.map((w) => w(...h)).find((w) => w !== void 0);
|
|
1268
|
-
};
|
|
1269
|
-
}
|
|
1270
|
-
} else
|
|
1271
|
-
s[a] = v;
|
|
1272
|
-
}), s), {})
|
|
1273
|
-
};
|
|
1274
|
-
}
|
|
1275
|
-
function ur(e) {
|
|
1276
|
-
e === void 0 && (e = []);
|
|
1277
|
-
const t = e.map((u) => u?.reference), n = e.map((u) => u?.floating), r = e.map((u) => u?.item), o = c.useCallback(
|
|
1278
|
-
(u) => We(u, e, "reference"),
|
|
1279
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1280
|
-
t
|
|
1281
|
-
), i = c.useCallback(
|
|
1282
|
-
(u) => We(u, e, "floating"),
|
|
1283
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1284
|
-
n
|
|
1285
|
-
), s = c.useCallback(
|
|
1286
|
-
(u) => We(u, e, "item"),
|
|
1287
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1288
|
-
r
|
|
1289
|
-
);
|
|
1290
|
-
return c.useMemo(() => ({
|
|
1291
|
-
getReferenceProps: o,
|
|
1292
|
-
getFloatingProps: i,
|
|
1293
|
-
getItemProps: s
|
|
1294
|
-
}), [o, i, s]);
|
|
1295
|
-
}
|
|
1296
|
-
const cr = {
|
|
1297
|
-
name: "calendar",
|
|
1298
|
-
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M8 1.6a.9.9 0 0 1 .9.9V7a.9.9 0 0 1-1.8 0V5.9H4a.1.1 0 0 0-.1.1v3.105A.91.91 0 0 1 4 9.1h16.1V6a.1.1 0 0 0-.1-.1h-3.1V7a.9.9 0 1 1-1.8 0V5.9h-3.6a.9.9 0 1 1 0-1.8h3.6V2.5a.9.9 0 1 1 1.8 0v1.6H20c1.05 0 1.9.85 1.9 1.9v14a1.9 1.9 0 0 1-1.9 1.9H4A1.9 1.9 0 0 1 2.1 20V6c0-1.05.85-1.9 1.9-1.9h3.1V2.5a.9.9 0 0 1 .9-.9Zm12.1 9.3H4a.917.917 0 0 1-.1-.005V20a.1.1 0 0 0 .1.1h16a.1.1 0 0 0 .1-.1v-9.1ZM5.6 13.5a.9.9 0 0 1 .9-.9h1a.9.9 0 1 1 0 1.8h-1a.9.9 0 0 1-.9-.9Zm5 0a.9.9 0 0 1 .9-.9h1a.9.9 0 1 1 0 1.8h-1a.9.9 0 0 1-.9-.9Zm5 0a.9.9 0 0 1 .9-.9h1a.9.9 0 1 1 0 1.8h-1a.9.9 0 0 1-.9-.9Zm-10 4a.9.9 0 0 1 .9-.9h1a.9.9 0 1 1 0 1.8h-1a.9.9 0 0 1-.9-.9Zm5 0a.9.9 0 0 1 .9-.9h1a.9.9 0 1 1 0 1.8h-1a.9.9 0 0 1-.9-.9Zm5 0a.9.9 0 0 1 .9-.9h1a.9.9 0 1 1 0 1.8h-1a.9.9 0 0 1-.9-.9Z" clip-rule="evenodd"/></svg>',
|
|
1299
|
-
keywords: ["calendar"],
|
|
1300
|
-
category: "other"
|
|
1301
|
-
}, Ge = (e) => /* @__PURE__ */ N(tn, { ...e, svg: cr });
|
|
1302
|
-
Ge.displayName = "IconCalendar";
|
|
1303
|
-
const lr = {
|
|
1304
|
-
"date-picker-calendar-container": "_date-picker-calendar-container_17f84_1"
|
|
1305
|
-
}, fr = nn.bind(lr), dr = Wt(
|
|
1306
|
-
({
|
|
1307
|
-
calendarProps: e,
|
|
1308
|
-
drawerContentProps: t,
|
|
1309
|
-
value: n,
|
|
1310
|
-
onChange: r,
|
|
1311
|
-
overlayZIndex: o,
|
|
1312
|
-
...i
|
|
1313
|
-
}, s) => {
|
|
1314
|
-
const [u, d] = Se(!1), [a, v] = Se(!1), [E, I] = Se(!1), f = Ht(null), { context: h, refs: l, floatingStyles: w } = ar({
|
|
1315
|
-
open: u,
|
|
1316
|
-
onOpenChange: (T) => {
|
|
1317
|
-
i.readOnly || d(T);
|
|
1318
|
-
},
|
|
1319
|
-
placement: "bottom-start",
|
|
1320
|
-
middleware: [
|
|
1321
|
-
Jt({
|
|
1322
|
-
mainAxis: 10,
|
|
1323
|
-
crossAxis: -32
|
|
1324
|
-
// left padding + small icon
|
|
1325
|
-
}),
|
|
1326
|
-
Qt()
|
|
1327
|
-
],
|
|
1328
|
-
whileElementsMounted: Xt
|
|
1329
|
-
}), x = nr(h), g = ir(h), { getFloatingProps: p, getReferenceProps: L } = ur([x, g]), [K, W] = Se(n);
|
|
1330
|
-
Ut(() => {
|
|
1331
|
-
W(n);
|
|
1332
|
-
}, [n]);
|
|
1333
|
-
const O = (T) => {
|
|
1334
|
-
T ? (W(T), r?.(T), (u || a) && (d(!1), v(!1))) : (W(void 0), r?.(void 0));
|
|
1335
|
-
}, B = qt();
|
|
1336
|
-
return wt(() => {
|
|
1337
|
-
const T = () => {
|
|
1338
|
-
I(window.innerWidth < 600);
|
|
1339
|
-
};
|
|
1340
|
-
return T(), window.addEventListener("resize", T), () => {
|
|
1341
|
-
window.removeEventListener("resize", T);
|
|
1342
|
-
};
|
|
1343
|
-
}, []), E ? /* @__PURE__ */ Ce(_e, { open: a, onOpenChange: v, children: [
|
|
1344
|
-
/* @__PURE__ */ N(_e.Trigger, { children: /* @__PURE__ */ N(
|
|
1345
|
-
Qe,
|
|
1346
|
-
{
|
|
1347
|
-
...i,
|
|
1348
|
-
startAdornment: /* @__PURE__ */ N(Ge, { size: "sm" }),
|
|
1349
|
-
id: B,
|
|
1350
|
-
value: K,
|
|
1351
|
-
onChange: (T) => O(T),
|
|
1352
|
-
"data-testid": i["data-testid"]
|
|
1353
|
-
}
|
|
1354
|
-
) }),
|
|
1355
|
-
/* @__PURE__ */ N(
|
|
1356
|
-
_e.Content,
|
|
1357
|
-
{
|
|
1358
|
-
"data-testid": i["data-testid"] && `${i["data-testid"]}-calendar`,
|
|
1359
|
-
fitToContent: !0,
|
|
1360
|
-
...t,
|
|
1361
|
-
zIndex: o,
|
|
1362
|
-
children: /* @__PURE__ */ N(
|
|
1363
|
-
Je,
|
|
1364
|
-
{
|
|
1365
|
-
showOutsideDays: !0,
|
|
1366
|
-
...e,
|
|
1367
|
-
mode: "single",
|
|
1368
|
-
selected: K,
|
|
1369
|
-
onSelect: (T) => O(T)
|
|
1370
|
-
}
|
|
1371
|
-
)
|
|
1372
|
-
}
|
|
1373
|
-
)
|
|
1374
|
-
] }) : /* @__PURE__ */ Ce("div", { ref: s, children: [
|
|
1375
|
-
/* @__PURE__ */ N(
|
|
1376
|
-
Qe,
|
|
1377
|
-
{
|
|
1378
|
-
...L(i),
|
|
1379
|
-
ref: l.setReference,
|
|
1380
|
-
startAdornment: /* @__PURE__ */ N(Ge, { size: "sm" }),
|
|
1381
|
-
id: B,
|
|
1382
|
-
value: K,
|
|
1383
|
-
onChange: (T) => O(T),
|
|
1384
|
-
"data-testid": i["data-testid"]
|
|
1385
|
-
}
|
|
1386
|
-
),
|
|
1387
|
-
u && !i.readOnly && /* @__PURE__ */ N(zn, { children: /* @__PURE__ */ N(er, { context: h, initialFocus: f, children: /* @__PURE__ */ N(
|
|
1388
|
-
"div",
|
|
1389
|
-
{
|
|
1390
|
-
"data-testid": i["data-testid"] && `${i["data-testid"]}-calendar`,
|
|
1391
|
-
className: fr("date-picker-calendar-container"),
|
|
1392
|
-
ref: l.setFloating,
|
|
1393
|
-
style: { ...w, zIndex: o },
|
|
1394
|
-
...p(),
|
|
1395
|
-
children: /* @__PURE__ */ N(
|
|
1396
|
-
Je,
|
|
1397
|
-
{
|
|
1398
|
-
showOutsideDays: !0,
|
|
1399
|
-
...e,
|
|
1400
|
-
mode: "single",
|
|
1401
|
-
selected: K,
|
|
1402
|
-
onSelect: (T) => O(T),
|
|
1403
|
-
firstElementRef: f
|
|
1404
|
-
}
|
|
1405
|
-
)
|
|
1406
|
-
}
|
|
1407
|
-
) }) })
|
|
1408
|
-
] });
|
|
1409
|
-
}
|
|
1410
|
-
);
|
|
1411
|
-
dr.displayName = "DatePicker";
|
|
1412
|
-
export {
|
|
1413
|
-
dr as D
|
|
1414
|
-
};
|
|
1415
|
-
//# sourceMappingURL=date-picker-CbUNbOhn.mjs.map
|