@leaflink/stash 48.21.2 → 49.0.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/ActionsDropdown.js +1 -1
- package/dist/AddressSelect.js +15 -14
- package/dist/AddressSelect.js.map +1 -1
- package/dist/Alert.js +1 -1
- package/dist/Copy.js +1 -1
- package/dist/DataViewSortButton.js +1 -1
- package/dist/Dropdown.js +1 -1
- package/dist/FilterDropdown.js +1 -1
- package/dist/Filters.js +4 -3
- package/dist/Filters.js.map +1 -1
- package/dist/InputOptions.js +4 -3
- package/dist/InputOptions.js.map +1 -1
- package/dist/ListView.js +9 -8
- package/dist/ListView.js.map +1 -1
- package/dist/Modal.js +18 -17
- package/dist/Modal.js.map +1 -1
- package/dist/PageNavigation.js +1 -1
- package/dist/Select.js +272 -1277
- package/dist/Select.js.map +1 -1
- package/dist/SelectStatus.js +10 -9
- package/dist/SelectStatus.js.map +1 -1
- package/dist/Tab.js +1 -1
- package/dist/Tabs.js +1 -1
- package/dist/Tooltip.js +199 -0
- package/dist/Tooltip.js.map +1 -0
- package/dist/Tooltip.vue.d.ts +106 -0
- package/dist/components.css +1 -1
- package/dist/directives/autofocus.js.map +1 -0
- package/dist/directives/clickoutside.js.map +1 -0
- package/dist/directives/observe.js.map +1 -0
- package/dist/directives/sticky.js.map +1 -0
- package/dist/{tooltip.js → directives/tooltip.js} +3 -3
- package/dist/directives/tooltip.js.map +1 -0
- package/dist/directives/viewable.js.map +1 -0
- package/dist/floating-ui.vue-8d7f7932.js +1069 -0
- package/dist/floating-ui.vue-8d7f7932.js.map +1 -0
- package/dist/tooltip.d.ts +1 -0
- package/package.json +6 -1
- package/styles/base.css +2 -2
- package/dist/autofocus.js.map +0 -1
- package/dist/clickoutside.js.map +0 -1
- package/dist/observe.js.map +0 -1
- package/dist/sticky.js.map +0 -1
- package/dist/tooltip.js.map +0 -1
- package/dist/viewable.js.map +0 -1
- /package/dist/{autofocus.js → directives/autofocus.js} +0 -0
- /package/dist/{clickoutside.js → directives/clickoutside.js} +0 -0
- /package/dist/{observe.js → directives/observe.js} +0 -0
- /package/dist/{sticky.js → directives/sticky.js} +0 -0
- /package/dist/{viewable.js → directives/viewable.js} +0 -0
package/dist/Select.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
1
|
+
import { defineComponent as xe, useAttrs as Ce, useSlots as Ie, ref as u, computed as v, watch as U, nextTick as Y, onMounted as Oe, onUnmounted as Me, openBlock as o, createBlock as K, normalizeClass as O, unref as y, createSlots as Fe, withCtx as M, createElementVNode as p, createElementBlock as d, Fragment as V, renderList as G, toDisplayString as k, withDirectives as F, withKeys as oe, createCommentVNode as R, renderSlot as j, createTextVNode as $, withModifiers as P, createVNode as B, Teleport as Re, Transition as $e, normalizeStyle as Pe, vModelText as ze, vShow as J } from "vue";
|
|
2
|
+
import { u as He, a as Ne, f as Ae, o as Le, s as De } from "./floating-ui.vue-8d7f7932.js";
|
|
3
|
+
import Ue from "@leaflink/snitch";
|
|
4
|
+
import Ke from "lodash-es/debounce";
|
|
5
|
+
import Ve from "lodash-es/isEmpty";
|
|
6
|
+
import re from "lodash-es/isEqual";
|
|
7
|
+
import Ge from "lodash-es/isPlainObject";
|
|
8
|
+
import je from "lodash-es/uniqueId";
|
|
9
|
+
import qe from "./useSearch.js";
|
|
10
|
+
import { DEBOUNCE as We, KEY_CODES as S } from "./constants.js";
|
|
11
|
+
import Xe from "./directives/clickoutside.js";
|
|
12
|
+
import { D as Ye } from "./MenusPlugin-9288029a.js";
|
|
13
|
+
import ie from "./Chip.js";
|
|
14
|
+
import { _ as Je } from "./Field.vue_vue_type_script_setup_true_lang-e1e4ff03.js";
|
|
15
|
+
import z from "./Icon.js";
|
|
16
|
+
import { _ as Qe } from "./_plugin-vue_export-helper-dad06003.js";
|
|
16
17
|
import "lodash-es/get";
|
|
17
18
|
import "./searchFuzzy-9b74ec4e.js";
|
|
18
19
|
import "./_commonjsHelpers-10dfc225.js";
|
|
@@ -20,1026 +21,20 @@ import "./utils/helpers.js";
|
|
|
20
21
|
import "lodash-es/camelCase";
|
|
21
22
|
import "lodash-es/isFinite";
|
|
22
23
|
import "./utils/colorScheme.js";
|
|
23
|
-
import "./index-9e1095ef.js";
|
|
24
|
-
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
25
24
|
import "./Label.vue_vue_type_script_setup_true_lang-4b02087f.js";
|
|
26
25
|
import "./locale.js";
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}), Yt = {
|
|
31
|
-
left: "right",
|
|
32
|
-
right: "left",
|
|
33
|
-
bottom: "top",
|
|
34
|
-
top: "bottom"
|
|
35
|
-
}, Jt = {
|
|
36
|
-
start: "end",
|
|
37
|
-
end: "start"
|
|
38
|
-
};
|
|
39
|
-
function Ve(e, n) {
|
|
40
|
-
return typeof e == "function" ? e(n) : e;
|
|
41
|
-
}
|
|
42
|
-
function le(e) {
|
|
43
|
-
return e.split("-")[0];
|
|
44
|
-
}
|
|
45
|
-
function Ce(e) {
|
|
46
|
-
return e.split("-")[1];
|
|
47
|
-
}
|
|
48
|
-
function Qt(e) {
|
|
49
|
-
return e === "x" ? "y" : "x";
|
|
50
|
-
}
|
|
51
|
-
function ct(e) {
|
|
52
|
-
return e === "y" ? "height" : "width";
|
|
53
|
-
}
|
|
54
|
-
function me(e) {
|
|
55
|
-
return ["top", "bottom"].includes(le(e)) ? "y" : "x";
|
|
56
|
-
}
|
|
57
|
-
function ut(e) {
|
|
58
|
-
return Qt(me(e));
|
|
59
|
-
}
|
|
60
|
-
function Zt(e, n, o) {
|
|
61
|
-
o === void 0 && (o = !1);
|
|
62
|
-
const l = Ce(e), t = ut(e), s = ct(t);
|
|
63
|
-
let i = t === "x" ? l === (o ? "end" : "start") ? "right" : "left" : l === "start" ? "bottom" : "top";
|
|
64
|
-
return n.reference[s] > n.floating[s] && (i = Pe(i)), [i, Pe(i)];
|
|
65
|
-
}
|
|
66
|
-
function en(e) {
|
|
67
|
-
const n = Pe(e);
|
|
68
|
-
return [Ue(e), n, Ue(n)];
|
|
69
|
-
}
|
|
70
|
-
function Ue(e) {
|
|
71
|
-
return e.replace(/start|end/g, (n) => Jt[n]);
|
|
72
|
-
}
|
|
73
|
-
function tn(e, n, o) {
|
|
74
|
-
const l = ["left", "right"], t = ["right", "left"], s = ["top", "bottom"], i = ["bottom", "top"];
|
|
75
|
-
switch (e) {
|
|
76
|
-
case "top":
|
|
77
|
-
case "bottom":
|
|
78
|
-
return o ? n ? t : l : n ? l : t;
|
|
79
|
-
case "left":
|
|
80
|
-
case "right":
|
|
81
|
-
return n ? s : i;
|
|
82
|
-
default:
|
|
83
|
-
return [];
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
function nn(e, n, o, l) {
|
|
87
|
-
const t = Ce(e);
|
|
88
|
-
let s = tn(le(e), o === "start", l);
|
|
89
|
-
return t && (s = s.map((i) => i + "-" + t), n && (s = s.concat(s.map(Ue)))), s;
|
|
90
|
-
}
|
|
91
|
-
function Pe(e) {
|
|
92
|
-
return e.replace(/left|right|bottom|top/g, (n) => Yt[n]);
|
|
93
|
-
}
|
|
94
|
-
function on(e) {
|
|
95
|
-
return {
|
|
96
|
-
top: 0,
|
|
97
|
-
right: 0,
|
|
98
|
-
bottom: 0,
|
|
99
|
-
left: 0,
|
|
100
|
-
...e
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
function ln(e) {
|
|
104
|
-
return typeof e != "number" ? on(e) : {
|
|
105
|
-
top: e,
|
|
106
|
-
right: e,
|
|
107
|
-
bottom: e,
|
|
108
|
-
left: e
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
function Ie(e) {
|
|
112
|
-
const {
|
|
113
|
-
x: n,
|
|
114
|
-
y: o,
|
|
115
|
-
width: l,
|
|
116
|
-
height: t
|
|
117
|
-
} = e;
|
|
118
|
-
return {
|
|
119
|
-
width: l,
|
|
120
|
-
height: t,
|
|
121
|
-
top: o,
|
|
122
|
-
left: n,
|
|
123
|
-
right: n + l,
|
|
124
|
-
bottom: o + t,
|
|
125
|
-
x: n,
|
|
126
|
-
y: o
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
function ot(e, n, o) {
|
|
130
|
-
let {
|
|
131
|
-
reference: l,
|
|
132
|
-
floating: t
|
|
133
|
-
} = e;
|
|
134
|
-
const s = me(n), i = ut(n), a = ct(i), f = le(n), c = s === "y", u = l.x + l.width / 2 - t.width / 2, h = l.y + l.height / 2 - t.height / 2, g = l[a] / 2 - t[a] / 2;
|
|
135
|
-
let m;
|
|
136
|
-
switch (f) {
|
|
137
|
-
case "top":
|
|
138
|
-
m = {
|
|
139
|
-
x: u,
|
|
140
|
-
y: l.y - t.height
|
|
141
|
-
};
|
|
142
|
-
break;
|
|
143
|
-
case "bottom":
|
|
144
|
-
m = {
|
|
145
|
-
x: u,
|
|
146
|
-
y: l.y + l.height
|
|
147
|
-
};
|
|
148
|
-
break;
|
|
149
|
-
case "right":
|
|
150
|
-
m = {
|
|
151
|
-
x: l.x + l.width,
|
|
152
|
-
y: h
|
|
153
|
-
};
|
|
154
|
-
break;
|
|
155
|
-
case "left":
|
|
156
|
-
m = {
|
|
157
|
-
x: l.x - t.width,
|
|
158
|
-
y: h
|
|
159
|
-
};
|
|
160
|
-
break;
|
|
161
|
-
default:
|
|
162
|
-
m = {
|
|
163
|
-
x: l.x,
|
|
164
|
-
y: l.y
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
switch (Ce(n)) {
|
|
168
|
-
case "start":
|
|
169
|
-
m[i] -= g * (o && c ? -1 : 1);
|
|
170
|
-
break;
|
|
171
|
-
case "end":
|
|
172
|
-
m[i] += g * (o && c ? -1 : 1);
|
|
173
|
-
break;
|
|
174
|
-
}
|
|
175
|
-
return m;
|
|
176
|
-
}
|
|
177
|
-
const sn = async (e, n, o) => {
|
|
178
|
-
const {
|
|
179
|
-
placement: l = "bottom",
|
|
180
|
-
strategy: t = "absolute",
|
|
181
|
-
middleware: s = [],
|
|
182
|
-
platform: i
|
|
183
|
-
} = o, a = s.filter(Boolean), f = await (i.isRTL == null ? void 0 : i.isRTL(n));
|
|
184
|
-
let c = await i.getElementRects({
|
|
185
|
-
reference: e,
|
|
186
|
-
floating: n,
|
|
187
|
-
strategy: t
|
|
188
|
-
}), {
|
|
189
|
-
x: u,
|
|
190
|
-
y: h
|
|
191
|
-
} = ot(c, l, f), g = l, m = {}, y = 0;
|
|
192
|
-
for (let d = 0; d < a.length; d++) {
|
|
193
|
-
const {
|
|
194
|
-
name: _,
|
|
195
|
-
fn: v
|
|
196
|
-
} = a[d], {
|
|
197
|
-
x: w,
|
|
198
|
-
y: b,
|
|
199
|
-
data: C,
|
|
200
|
-
reset: R
|
|
201
|
-
} = await v({
|
|
202
|
-
x: u,
|
|
203
|
-
y: h,
|
|
204
|
-
initialPlacement: l,
|
|
205
|
-
placement: g,
|
|
206
|
-
strategy: t,
|
|
207
|
-
middlewareData: m,
|
|
208
|
-
rects: c,
|
|
209
|
-
platform: i,
|
|
210
|
-
elements: {
|
|
211
|
-
reference: e,
|
|
212
|
-
floating: n
|
|
213
|
-
}
|
|
214
|
-
});
|
|
215
|
-
u = w ?? u, h = b ?? h, m = {
|
|
216
|
-
...m,
|
|
217
|
-
[_]: {
|
|
218
|
-
...m[_],
|
|
219
|
-
...C
|
|
220
|
-
}
|
|
221
|
-
}, R && y <= 50 && (y++, typeof R == "object" && (R.placement && (g = R.placement), R.rects && (c = R.rects === !0 ? await i.getElementRects({
|
|
222
|
-
reference: e,
|
|
223
|
-
floating: n,
|
|
224
|
-
strategy: t
|
|
225
|
-
}) : R.rects), {
|
|
226
|
-
x: u,
|
|
227
|
-
y: h
|
|
228
|
-
} = ot(c, g, f)), d = -1);
|
|
229
|
-
}
|
|
230
|
-
return {
|
|
231
|
-
x: u,
|
|
232
|
-
y: h,
|
|
233
|
-
placement: g,
|
|
234
|
-
strategy: t,
|
|
235
|
-
middlewareData: m
|
|
236
|
-
};
|
|
237
|
-
};
|
|
238
|
-
async function ft(e, n) {
|
|
239
|
-
var o;
|
|
240
|
-
n === void 0 && (n = {});
|
|
241
|
-
const {
|
|
242
|
-
x: l,
|
|
243
|
-
y: t,
|
|
244
|
-
platform: s,
|
|
245
|
-
rects: i,
|
|
246
|
-
elements: a,
|
|
247
|
-
strategy: f
|
|
248
|
-
} = e, {
|
|
249
|
-
boundary: c = "clippingAncestors",
|
|
250
|
-
rootBoundary: u = "viewport",
|
|
251
|
-
elementContext: h = "floating",
|
|
252
|
-
altBoundary: g = !1,
|
|
253
|
-
padding: m = 0
|
|
254
|
-
} = Ve(n, e), y = ln(m), _ = a[g ? h === "floating" ? "reference" : "floating" : h], v = Ie(await s.getClippingRect({
|
|
255
|
-
element: (o = await (s.isElement == null ? void 0 : s.isElement(_))) == null || o ? _ : _.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(a.floating)),
|
|
256
|
-
boundary: c,
|
|
257
|
-
rootBoundary: u,
|
|
258
|
-
strategy: f
|
|
259
|
-
})), w = h === "floating" ? {
|
|
260
|
-
x: l,
|
|
261
|
-
y: t,
|
|
262
|
-
width: i.floating.width,
|
|
263
|
-
height: i.floating.height
|
|
264
|
-
} : i.reference, b = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(a.floating)), C = await (s.isElement == null ? void 0 : s.isElement(b)) ? await (s.getScale == null ? void 0 : s.getScale(b)) || {
|
|
265
|
-
x: 1,
|
|
266
|
-
y: 1
|
|
267
|
-
} : {
|
|
268
|
-
x: 1,
|
|
269
|
-
y: 1
|
|
270
|
-
}, R = Ie(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
271
|
-
elements: a,
|
|
272
|
-
rect: w,
|
|
273
|
-
offsetParent: b,
|
|
274
|
-
strategy: f
|
|
275
|
-
}) : w);
|
|
276
|
-
return {
|
|
277
|
-
top: (v.top - R.top + y.top) / C.y,
|
|
278
|
-
bottom: (R.bottom - v.bottom + y.bottom) / C.y,
|
|
279
|
-
left: (v.left - R.left + y.left) / C.x,
|
|
280
|
-
right: (R.right - v.right + y.right) / C.x
|
|
281
|
-
};
|
|
282
|
-
}
|
|
283
|
-
const rn = function(e) {
|
|
284
|
-
return e === void 0 && (e = {}), {
|
|
285
|
-
name: "flip",
|
|
286
|
-
options: e,
|
|
287
|
-
async fn(n) {
|
|
288
|
-
var o, l;
|
|
289
|
-
const {
|
|
290
|
-
placement: t,
|
|
291
|
-
middlewareData: s,
|
|
292
|
-
rects: i,
|
|
293
|
-
initialPlacement: a,
|
|
294
|
-
platform: f,
|
|
295
|
-
elements: c
|
|
296
|
-
} = n, {
|
|
297
|
-
mainAxis: u = !0,
|
|
298
|
-
crossAxis: h = !0,
|
|
299
|
-
fallbackPlacements: g,
|
|
300
|
-
fallbackStrategy: m = "bestFit",
|
|
301
|
-
fallbackAxisSideDirection: y = "none",
|
|
302
|
-
flipAlignment: d = !0,
|
|
303
|
-
..._
|
|
304
|
-
} = Ve(e, n);
|
|
305
|
-
if ((o = s.arrow) != null && o.alignmentOffset)
|
|
306
|
-
return {};
|
|
307
|
-
const v = le(t), w = me(a), b = le(a) === a, C = await (f.isRTL == null ? void 0 : f.isRTL(c.floating)), R = g || (b || !d ? [Pe(a)] : en(a)), I = y !== "none";
|
|
308
|
-
!g && I && R.push(...nn(a, d, y, C));
|
|
309
|
-
const S = [a, ...R], T = await ft(n, _), F = [];
|
|
310
|
-
let D = ((l = s.flip) == null ? void 0 : l.overflows) || [];
|
|
311
|
-
if (u && F.push(T[v]), h) {
|
|
312
|
-
const X = Zt(t, i, C);
|
|
313
|
-
F.push(T[X[0]], T[X[1]]);
|
|
314
|
-
}
|
|
315
|
-
if (D = [...D, {
|
|
316
|
-
placement: t,
|
|
317
|
-
overflows: F
|
|
318
|
-
}], !F.every((X) => X <= 0)) {
|
|
319
|
-
var Z, ee;
|
|
320
|
-
const X = (((Z = s.flip) == null ? void 0 : Z.index) || 0) + 1, Oe = S[X];
|
|
321
|
-
if (Oe)
|
|
322
|
-
return {
|
|
323
|
-
data: {
|
|
324
|
-
index: X,
|
|
325
|
-
overflows: D
|
|
326
|
-
},
|
|
327
|
-
reset: {
|
|
328
|
-
placement: Oe
|
|
329
|
-
}
|
|
330
|
-
};
|
|
331
|
-
let W = (ee = D.filter((q) => q.overflows[0] <= 0).sort((q, M) => q.overflows[1] - M.overflows[1])[0]) == null ? void 0 : ee.placement;
|
|
332
|
-
if (!W)
|
|
333
|
-
switch (m) {
|
|
334
|
-
case "bestFit": {
|
|
335
|
-
var te;
|
|
336
|
-
const q = (te = D.filter((M) => {
|
|
337
|
-
if (I) {
|
|
338
|
-
const $ = me(M.placement);
|
|
339
|
-
return $ === w || // Create a bias to the `y` side axis due to horizontal
|
|
340
|
-
// reading directions favoring greater width.
|
|
341
|
-
$ === "y";
|
|
342
|
-
}
|
|
343
|
-
return !0;
|
|
344
|
-
}).map((M) => [M.placement, M.overflows.filter(($) => $ > 0).reduce(($, Y) => $ + Y, 0)]).sort((M, $) => M[1] - $[1])[0]) == null ? void 0 : te[0];
|
|
345
|
-
q && (W = q);
|
|
346
|
-
break;
|
|
347
|
-
}
|
|
348
|
-
case "initialPlacement":
|
|
349
|
-
W = a;
|
|
350
|
-
break;
|
|
351
|
-
}
|
|
352
|
-
if (t !== W)
|
|
353
|
-
return {
|
|
354
|
-
reset: {
|
|
355
|
-
placement: W
|
|
356
|
-
}
|
|
357
|
-
};
|
|
358
|
-
}
|
|
359
|
-
return {};
|
|
360
|
-
}
|
|
361
|
-
};
|
|
362
|
-
};
|
|
363
|
-
async function an(e, n) {
|
|
364
|
-
const {
|
|
365
|
-
placement: o,
|
|
366
|
-
platform: l,
|
|
367
|
-
elements: t
|
|
368
|
-
} = e, s = await (l.isRTL == null ? void 0 : l.isRTL(t.floating)), i = le(o), a = Ce(o), f = me(o) === "y", c = ["left", "top"].includes(i) ? -1 : 1, u = s && f ? -1 : 1, h = Ve(n, e);
|
|
369
|
-
let {
|
|
370
|
-
mainAxis: g,
|
|
371
|
-
crossAxis: m,
|
|
372
|
-
alignmentAxis: y
|
|
373
|
-
} = typeof h == "number" ? {
|
|
374
|
-
mainAxis: h,
|
|
375
|
-
crossAxis: 0,
|
|
376
|
-
alignmentAxis: null
|
|
377
|
-
} : {
|
|
378
|
-
mainAxis: h.mainAxis || 0,
|
|
379
|
-
crossAxis: h.crossAxis || 0,
|
|
380
|
-
alignmentAxis: h.alignmentAxis
|
|
381
|
-
};
|
|
382
|
-
return a && typeof y == "number" && (m = a === "end" ? y * -1 : y), f ? {
|
|
383
|
-
x: m * u,
|
|
384
|
-
y: g * c
|
|
385
|
-
} : {
|
|
386
|
-
x: g * c,
|
|
387
|
-
y: m * u
|
|
388
|
-
};
|
|
389
|
-
}
|
|
390
|
-
const cn = function(e) {
|
|
391
|
-
return e === void 0 && (e = 0), {
|
|
392
|
-
name: "offset",
|
|
393
|
-
options: e,
|
|
394
|
-
async fn(n) {
|
|
395
|
-
var o, l;
|
|
396
|
-
const {
|
|
397
|
-
x: t,
|
|
398
|
-
y: s,
|
|
399
|
-
placement: i,
|
|
400
|
-
middlewareData: a
|
|
401
|
-
} = n, f = await an(n, e);
|
|
402
|
-
return i === ((o = a.offset) == null ? void 0 : o.placement) && (l = a.arrow) != null && l.alignmentOffset ? {} : {
|
|
403
|
-
x: t + f.x,
|
|
404
|
-
y: s + f.y,
|
|
405
|
-
data: {
|
|
406
|
-
...f,
|
|
407
|
-
placement: i
|
|
408
|
-
}
|
|
409
|
-
};
|
|
410
|
-
}
|
|
411
|
-
};
|
|
412
|
-
}, un = function(e) {
|
|
413
|
-
return e === void 0 && (e = {}), {
|
|
414
|
-
name: "size",
|
|
415
|
-
options: e,
|
|
416
|
-
async fn(n) {
|
|
417
|
-
var o, l;
|
|
418
|
-
const {
|
|
419
|
-
placement: t,
|
|
420
|
-
rects: s,
|
|
421
|
-
platform: i,
|
|
422
|
-
elements: a
|
|
423
|
-
} = n, {
|
|
424
|
-
apply: f = () => {
|
|
425
|
-
},
|
|
426
|
-
...c
|
|
427
|
-
} = Ve(e, n), u = await ft(n, c), h = le(t), g = Ce(t), m = me(t) === "y", {
|
|
428
|
-
width: y,
|
|
429
|
-
height: d
|
|
430
|
-
} = s.floating;
|
|
431
|
-
let _, v;
|
|
432
|
-
h === "top" || h === "bottom" ? (_ = h, v = g === (await (i.isRTL == null ? void 0 : i.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (v = h, _ = g === "end" ? "top" : "bottom");
|
|
433
|
-
const w = d - u.top - u.bottom, b = y - u.left - u.right, C = Se(d - u[_], w), R = Se(y - u[v], b), I = !n.middlewareData.shift;
|
|
434
|
-
let S = C, T = R;
|
|
435
|
-
if ((o = n.middlewareData.shift) != null && o.enabled.x && (T = b), (l = n.middlewareData.shift) != null && l.enabled.y && (S = w), I && !g) {
|
|
436
|
-
const D = N(u.left, 0), Z = N(u.right, 0), ee = N(u.top, 0), te = N(u.bottom, 0);
|
|
437
|
-
m ? T = y - 2 * (D !== 0 || Z !== 0 ? D + Z : N(u.left, u.right)) : S = d - 2 * (ee !== 0 || te !== 0 ? ee + te : N(u.top, u.bottom));
|
|
438
|
-
}
|
|
439
|
-
await f({
|
|
440
|
-
...n,
|
|
441
|
-
availableWidth: T,
|
|
442
|
-
availableHeight: S
|
|
443
|
-
});
|
|
444
|
-
const F = await i.getDimensions(a.floating);
|
|
445
|
-
return y !== F.width || d !== F.height ? {
|
|
446
|
-
reset: {
|
|
447
|
-
rects: !0
|
|
448
|
-
}
|
|
449
|
-
} : {};
|
|
450
|
-
}
|
|
451
|
-
};
|
|
452
|
-
};
|
|
453
|
-
function Ne() {
|
|
454
|
-
return typeof window < "u";
|
|
455
|
-
}
|
|
456
|
-
function se(e) {
|
|
457
|
-
return Ge(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
458
|
-
}
|
|
459
|
-
function P(e) {
|
|
460
|
-
var n;
|
|
461
|
-
return (e == null || (n = e.ownerDocument) == null ? void 0 : n.defaultView) || window;
|
|
462
|
-
}
|
|
463
|
-
function K(e) {
|
|
464
|
-
var n;
|
|
465
|
-
return (n = (Ge(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : n.documentElement;
|
|
466
|
-
}
|
|
467
|
-
function Ge(e) {
|
|
468
|
-
return Ne() ? e instanceof Node || e instanceof P(e).Node : !1;
|
|
469
|
-
}
|
|
470
|
-
function H(e) {
|
|
471
|
-
return Ne() ? e instanceof Element || e instanceof P(e).Element : !1;
|
|
472
|
-
}
|
|
473
|
-
function U(e) {
|
|
474
|
-
return Ne() ? e instanceof HTMLElement || e instanceof P(e).HTMLElement : !1;
|
|
475
|
-
}
|
|
476
|
-
function lt(e) {
|
|
477
|
-
return !Ne() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof P(e).ShadowRoot;
|
|
478
|
-
}
|
|
479
|
-
function Te(e) {
|
|
480
|
-
const {
|
|
481
|
-
overflow: n,
|
|
482
|
-
overflowX: o,
|
|
483
|
-
overflowY: l,
|
|
484
|
-
display: t
|
|
485
|
-
} = z(e);
|
|
486
|
-
return /auto|scroll|overlay|hidden|clip/.test(n + l + o) && !["inline", "contents"].includes(t);
|
|
487
|
-
}
|
|
488
|
-
function fn(e) {
|
|
489
|
-
return ["table", "td", "th"].includes(se(e));
|
|
490
|
-
}
|
|
491
|
-
function $e(e) {
|
|
492
|
-
return [":popover-open", ":modal"].some((n) => {
|
|
493
|
-
try {
|
|
494
|
-
return e.matches(n);
|
|
495
|
-
} catch {
|
|
496
|
-
return !1;
|
|
497
|
-
}
|
|
498
|
-
});
|
|
499
|
-
}
|
|
500
|
-
function qe(e) {
|
|
501
|
-
const n = Ye(), o = H(e) ? z(e) : e;
|
|
502
|
-
return o.transform !== "none" || o.perspective !== "none" || (o.containerType ? o.containerType !== "normal" : !1) || !n && (o.backdropFilter ? o.backdropFilter !== "none" : !1) || !n && (o.filter ? o.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((l) => (o.willChange || "").includes(l)) || ["paint", "layout", "strict", "content"].some((l) => (o.contain || "").includes(l));
|
|
503
|
-
}
|
|
504
|
-
function dn(e) {
|
|
505
|
-
let n = Q(e);
|
|
506
|
-
for (; U(n) && !he(n); ) {
|
|
507
|
-
if (qe(n))
|
|
508
|
-
return n;
|
|
509
|
-
if ($e(n))
|
|
510
|
-
return null;
|
|
511
|
-
n = Q(n);
|
|
512
|
-
}
|
|
513
|
-
return null;
|
|
514
|
-
}
|
|
515
|
-
function Ye() {
|
|
516
|
-
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
517
|
-
}
|
|
518
|
-
function he(e) {
|
|
519
|
-
return ["html", "body", "#document"].includes(se(e));
|
|
520
|
-
}
|
|
521
|
-
function z(e) {
|
|
522
|
-
return P(e).getComputedStyle(e);
|
|
523
|
-
}
|
|
524
|
-
function He(e) {
|
|
525
|
-
return H(e) ? {
|
|
526
|
-
scrollLeft: e.scrollLeft,
|
|
527
|
-
scrollTop: e.scrollTop
|
|
528
|
-
} : {
|
|
529
|
-
scrollLeft: e.scrollX,
|
|
530
|
-
scrollTop: e.scrollY
|
|
531
|
-
};
|
|
532
|
-
}
|
|
533
|
-
function Q(e) {
|
|
534
|
-
if (se(e) === "html")
|
|
535
|
-
return e;
|
|
536
|
-
const n = (
|
|
537
|
-
// Step into the shadow DOM of the parent of a slotted node.
|
|
538
|
-
e.assignedSlot || // DOM Element detected.
|
|
539
|
-
e.parentNode || // ShadowRoot detected.
|
|
540
|
-
lt(e) && e.host || // Fallback.
|
|
541
|
-
K(e)
|
|
542
|
-
);
|
|
543
|
-
return lt(n) ? n.host : n;
|
|
544
|
-
}
|
|
545
|
-
function dt(e) {
|
|
546
|
-
const n = Q(e);
|
|
547
|
-
return he(n) ? e.ownerDocument ? e.ownerDocument.body : e.body : U(n) && Te(n) ? n : dt(n);
|
|
548
|
-
}
|
|
549
|
-
function Re(e, n, o) {
|
|
550
|
-
var l;
|
|
551
|
-
n === void 0 && (n = []), o === void 0 && (o = !0);
|
|
552
|
-
const t = dt(e), s = t === ((l = e.ownerDocument) == null ? void 0 : l.body), i = P(t);
|
|
553
|
-
if (s) {
|
|
554
|
-
const a = Ke(i);
|
|
555
|
-
return n.concat(i, i.visualViewport || [], Te(t) ? t : [], a && o ? Re(a) : []);
|
|
556
|
-
}
|
|
557
|
-
return n.concat(t, Re(t, [], o));
|
|
558
|
-
}
|
|
559
|
-
function Ke(e) {
|
|
560
|
-
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
561
|
-
}
|
|
562
|
-
function mt(e) {
|
|
563
|
-
const n = z(e);
|
|
564
|
-
let o = parseFloat(n.width) || 0, l = parseFloat(n.height) || 0;
|
|
565
|
-
const t = U(e), s = t ? e.offsetWidth : o, i = t ? e.offsetHeight : l, a = Fe(o) !== s || Fe(l) !== i;
|
|
566
|
-
return a && (o = s, l = i), {
|
|
567
|
-
width: o,
|
|
568
|
-
height: l,
|
|
569
|
-
$: a
|
|
570
|
-
};
|
|
571
|
-
}
|
|
572
|
-
function Je(e) {
|
|
573
|
-
return H(e) ? e : e.contextElement;
|
|
574
|
-
}
|
|
575
|
-
function de(e) {
|
|
576
|
-
const n = Je(e);
|
|
577
|
-
if (!U(n))
|
|
578
|
-
return J(1);
|
|
579
|
-
const o = n.getBoundingClientRect(), {
|
|
580
|
-
width: l,
|
|
581
|
-
height: t,
|
|
582
|
-
$: s
|
|
583
|
-
} = mt(n);
|
|
584
|
-
let i = (s ? Fe(o.width) : o.width) / l, a = (s ? Fe(o.height) : o.height) / t;
|
|
585
|
-
return (!i || !Number.isFinite(i)) && (i = 1), (!a || !Number.isFinite(a)) && (a = 1), {
|
|
586
|
-
x: i,
|
|
587
|
-
y: a
|
|
588
|
-
};
|
|
589
|
-
}
|
|
590
|
-
const mn = /* @__PURE__ */ J(0);
|
|
591
|
-
function ht(e) {
|
|
592
|
-
const n = P(e);
|
|
593
|
-
return !Ye() || !n.visualViewport ? mn : {
|
|
594
|
-
x: n.visualViewport.offsetLeft,
|
|
595
|
-
y: n.visualViewport.offsetTop
|
|
596
|
-
};
|
|
597
|
-
}
|
|
598
|
-
function hn(e, n, o) {
|
|
599
|
-
return n === void 0 && (n = !1), !o || n && o !== P(e) ? !1 : n;
|
|
600
|
-
}
|
|
601
|
-
function ie(e, n, o, l) {
|
|
602
|
-
n === void 0 && (n = !1), o === void 0 && (o = !1);
|
|
603
|
-
const t = e.getBoundingClientRect(), s = Je(e);
|
|
604
|
-
let i = J(1);
|
|
605
|
-
n && (l ? H(l) && (i = de(l)) : i = de(e));
|
|
606
|
-
const a = hn(s, o, l) ? ht(s) : J(0);
|
|
607
|
-
let f = (t.left + a.x) / i.x, c = (t.top + a.y) / i.y, u = t.width / i.x, h = t.height / i.y;
|
|
608
|
-
if (s) {
|
|
609
|
-
const g = P(s), m = l && H(l) ? P(l) : l;
|
|
610
|
-
let y = g, d = Ke(y);
|
|
611
|
-
for (; d && l && m !== y; ) {
|
|
612
|
-
const _ = de(d), v = d.getBoundingClientRect(), w = z(d), b = v.left + (d.clientLeft + parseFloat(w.paddingLeft)) * _.x, C = v.top + (d.clientTop + parseFloat(w.paddingTop)) * _.y;
|
|
613
|
-
f *= _.x, c *= _.y, u *= _.x, h *= _.y, f += b, c += C, y = P(d), d = Ke(y);
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
return Ie({
|
|
617
|
-
width: u,
|
|
618
|
-
height: h,
|
|
619
|
-
x: f,
|
|
620
|
-
y: c
|
|
621
|
-
});
|
|
622
|
-
}
|
|
623
|
-
function pn(e) {
|
|
624
|
-
let {
|
|
625
|
-
elements: n,
|
|
626
|
-
rect: o,
|
|
627
|
-
offsetParent: l,
|
|
628
|
-
strategy: t
|
|
629
|
-
} = e;
|
|
630
|
-
const s = t === "fixed", i = K(l), a = n ? $e(n.floating) : !1;
|
|
631
|
-
if (l === i || a && s)
|
|
632
|
-
return o;
|
|
633
|
-
let f = {
|
|
634
|
-
scrollLeft: 0,
|
|
635
|
-
scrollTop: 0
|
|
636
|
-
}, c = J(1);
|
|
637
|
-
const u = J(0), h = U(l);
|
|
638
|
-
if ((h || !h && !s) && ((se(l) !== "body" || Te(i)) && (f = He(l)), U(l))) {
|
|
639
|
-
const g = ie(l);
|
|
640
|
-
c = de(l), u.x = g.x + l.clientLeft, u.y = g.y + l.clientTop;
|
|
641
|
-
}
|
|
642
|
-
return {
|
|
643
|
-
width: o.width * c.x,
|
|
644
|
-
height: o.height * c.y,
|
|
645
|
-
x: o.x * c.x - f.scrollLeft * c.x + u.x,
|
|
646
|
-
y: o.y * c.y - f.scrollTop * c.y + u.y
|
|
647
|
-
};
|
|
648
|
-
}
|
|
649
|
-
function vn(e) {
|
|
650
|
-
return Array.from(e.getClientRects());
|
|
651
|
-
}
|
|
652
|
-
function Xe(e, n) {
|
|
653
|
-
const o = He(e).scrollLeft;
|
|
654
|
-
return n ? n.left + o : ie(K(e)).left + o;
|
|
655
|
-
}
|
|
656
|
-
function gn(e) {
|
|
657
|
-
const n = K(e), o = He(e), l = e.ownerDocument.body, t = N(n.scrollWidth, n.clientWidth, l.scrollWidth, l.clientWidth), s = N(n.scrollHeight, n.clientHeight, l.scrollHeight, l.clientHeight);
|
|
658
|
-
let i = -o.scrollLeft + Xe(e);
|
|
659
|
-
const a = -o.scrollTop;
|
|
660
|
-
return z(l).direction === "rtl" && (i += N(n.clientWidth, l.clientWidth) - t), {
|
|
661
|
-
width: t,
|
|
662
|
-
height: s,
|
|
663
|
-
x: i,
|
|
664
|
-
y: a
|
|
665
|
-
};
|
|
666
|
-
}
|
|
667
|
-
function yn(e, n) {
|
|
668
|
-
const o = P(e), l = K(e), t = o.visualViewport;
|
|
669
|
-
let s = l.clientWidth, i = l.clientHeight, a = 0, f = 0;
|
|
670
|
-
if (t) {
|
|
671
|
-
s = t.width, i = t.height;
|
|
672
|
-
const c = Ye();
|
|
673
|
-
(!c || c && n === "fixed") && (a = t.offsetLeft, f = t.offsetTop);
|
|
674
|
-
}
|
|
675
|
-
return {
|
|
676
|
-
width: s,
|
|
677
|
-
height: i,
|
|
678
|
-
x: a,
|
|
679
|
-
y: f
|
|
680
|
-
};
|
|
681
|
-
}
|
|
682
|
-
function wn(e, n) {
|
|
683
|
-
const o = ie(e, !0, n === "fixed"), l = o.top + e.clientTop, t = o.left + e.clientLeft, s = U(e) ? de(e) : J(1), i = e.clientWidth * s.x, a = e.clientHeight * s.y, f = t * s.x, c = l * s.y;
|
|
684
|
-
return {
|
|
685
|
-
width: i,
|
|
686
|
-
height: a,
|
|
687
|
-
x: f,
|
|
688
|
-
y: c
|
|
689
|
-
};
|
|
690
|
-
}
|
|
691
|
-
function it(e, n, o) {
|
|
692
|
-
let l;
|
|
693
|
-
if (n === "viewport")
|
|
694
|
-
l = yn(e, o);
|
|
695
|
-
else if (n === "document")
|
|
696
|
-
l = gn(K(e));
|
|
697
|
-
else if (H(n))
|
|
698
|
-
l = wn(n, o);
|
|
699
|
-
else {
|
|
700
|
-
const t = ht(e);
|
|
701
|
-
l = {
|
|
702
|
-
...n,
|
|
703
|
-
x: n.x - t.x,
|
|
704
|
-
y: n.y - t.y
|
|
705
|
-
};
|
|
706
|
-
}
|
|
707
|
-
return Ie(l);
|
|
708
|
-
}
|
|
709
|
-
function pt(e, n) {
|
|
710
|
-
const o = Q(e);
|
|
711
|
-
return o === n || !H(o) || he(o) ? !1 : z(o).position === "fixed" || pt(o, n);
|
|
712
|
-
}
|
|
713
|
-
function bn(e, n) {
|
|
714
|
-
const o = n.get(e);
|
|
715
|
-
if (o)
|
|
716
|
-
return o;
|
|
717
|
-
let l = Re(e, [], !1).filter((a) => H(a) && se(a) !== "body"), t = null;
|
|
718
|
-
const s = z(e).position === "fixed";
|
|
719
|
-
let i = s ? Q(e) : e;
|
|
720
|
-
for (; H(i) && !he(i); ) {
|
|
721
|
-
const a = z(i), f = qe(i);
|
|
722
|
-
!f && a.position === "fixed" && (t = null), (s ? !f && !t : !f && a.position === "static" && !!t && ["absolute", "fixed"].includes(t.position) || Te(i) && !f && pt(e, i)) ? l = l.filter((u) => u !== i) : t = a, i = Q(i);
|
|
723
|
-
}
|
|
724
|
-
return n.set(e, l), l;
|
|
725
|
-
}
|
|
726
|
-
function xn(e) {
|
|
727
|
-
let {
|
|
728
|
-
element: n,
|
|
729
|
-
boundary: o,
|
|
730
|
-
rootBoundary: l,
|
|
731
|
-
strategy: t
|
|
732
|
-
} = e;
|
|
733
|
-
const i = [...o === "clippingAncestors" ? $e(n) ? [] : bn(n, this._c) : [].concat(o), l], a = i[0], f = i.reduce((c, u) => {
|
|
734
|
-
const h = it(n, u, t);
|
|
735
|
-
return c.top = N(h.top, c.top), c.right = Se(h.right, c.right), c.bottom = Se(h.bottom, c.bottom), c.left = N(h.left, c.left), c;
|
|
736
|
-
}, it(n, a, t));
|
|
737
|
-
return {
|
|
738
|
-
width: f.right - f.left,
|
|
739
|
-
height: f.bottom - f.top,
|
|
740
|
-
x: f.left,
|
|
741
|
-
y: f.top
|
|
742
|
-
};
|
|
743
|
-
}
|
|
744
|
-
function _n(e) {
|
|
745
|
-
const {
|
|
746
|
-
width: n,
|
|
747
|
-
height: o
|
|
748
|
-
} = mt(e);
|
|
749
|
-
return {
|
|
750
|
-
width: n,
|
|
751
|
-
height: o
|
|
752
|
-
};
|
|
753
|
-
}
|
|
754
|
-
function En(e, n, o) {
|
|
755
|
-
const l = U(n), t = K(n), s = o === "fixed", i = ie(e, !0, s, n);
|
|
756
|
-
let a = {
|
|
757
|
-
scrollLeft: 0,
|
|
758
|
-
scrollTop: 0
|
|
759
|
-
};
|
|
760
|
-
const f = J(0);
|
|
761
|
-
if (l || !l && !s)
|
|
762
|
-
if ((se(n) !== "body" || Te(t)) && (a = He(n)), l) {
|
|
763
|
-
const m = ie(n, !0, s, n);
|
|
764
|
-
f.x = m.x + n.clientLeft, f.y = m.y + n.clientTop;
|
|
765
|
-
} else
|
|
766
|
-
t && (f.x = Xe(t));
|
|
767
|
-
let c = 0, u = 0;
|
|
768
|
-
if (t && !l && !s) {
|
|
769
|
-
const m = t.getBoundingClientRect();
|
|
770
|
-
u = m.top + a.scrollTop, c = m.left + a.scrollLeft - // RTL <body> scrollbar.
|
|
771
|
-
Xe(t, m);
|
|
772
|
-
}
|
|
773
|
-
const h = i.left + a.scrollLeft - f.x - c, g = i.top + a.scrollTop - f.y - u;
|
|
774
|
-
return {
|
|
775
|
-
x: h,
|
|
776
|
-
y: g,
|
|
777
|
-
width: i.width,
|
|
778
|
-
height: i.height
|
|
779
|
-
};
|
|
780
|
-
}
|
|
781
|
-
function je(e) {
|
|
782
|
-
return z(e).position === "static";
|
|
783
|
-
}
|
|
784
|
-
function st(e, n) {
|
|
785
|
-
if (!U(e) || z(e).position === "fixed")
|
|
786
|
-
return null;
|
|
787
|
-
if (n)
|
|
788
|
-
return n(e);
|
|
789
|
-
let o = e.offsetParent;
|
|
790
|
-
return K(e) === o && (o = o.ownerDocument.body), o;
|
|
791
|
-
}
|
|
792
|
-
function vt(e, n) {
|
|
793
|
-
const o = P(e);
|
|
794
|
-
if ($e(e))
|
|
795
|
-
return o;
|
|
796
|
-
if (!U(e)) {
|
|
797
|
-
let t = Q(e);
|
|
798
|
-
for (; t && !he(t); ) {
|
|
799
|
-
if (H(t) && !je(t))
|
|
800
|
-
return t;
|
|
801
|
-
t = Q(t);
|
|
802
|
-
}
|
|
803
|
-
return o;
|
|
804
|
-
}
|
|
805
|
-
let l = st(e, n);
|
|
806
|
-
for (; l && fn(l) && je(l); )
|
|
807
|
-
l = st(l, n);
|
|
808
|
-
return l && he(l) && je(l) && !qe(l) ? o : l || dn(e) || o;
|
|
809
|
-
}
|
|
810
|
-
const Sn = async function(e) {
|
|
811
|
-
const n = this.getOffsetParent || vt, o = this.getDimensions, l = await o(e.floating);
|
|
812
|
-
return {
|
|
813
|
-
reference: En(e.reference, await n(e.floating), e.strategy),
|
|
814
|
-
floating: {
|
|
815
|
-
x: 0,
|
|
816
|
-
y: 0,
|
|
817
|
-
width: l.width,
|
|
818
|
-
height: l.height
|
|
819
|
-
}
|
|
820
|
-
};
|
|
821
|
-
};
|
|
822
|
-
function Rn(e) {
|
|
823
|
-
return z(e).direction === "rtl";
|
|
824
|
-
}
|
|
825
|
-
const Cn = {
|
|
826
|
-
convertOffsetParentRelativeRectToViewportRelativeRect: pn,
|
|
827
|
-
getDocumentElement: K,
|
|
828
|
-
getClippingRect: xn,
|
|
829
|
-
getOffsetParent: vt,
|
|
830
|
-
getElementRects: Sn,
|
|
831
|
-
getClientRects: vn,
|
|
832
|
-
getDimensions: _n,
|
|
833
|
-
getScale: de,
|
|
834
|
-
isElement: H,
|
|
835
|
-
isRTL: Rn
|
|
836
|
-
};
|
|
837
|
-
function Tn(e, n) {
|
|
838
|
-
let o = null, l;
|
|
839
|
-
const t = K(e);
|
|
840
|
-
function s() {
|
|
841
|
-
var a;
|
|
842
|
-
clearTimeout(l), (a = o) == null || a.disconnect(), o = null;
|
|
843
|
-
}
|
|
844
|
-
function i(a, f) {
|
|
845
|
-
a === void 0 && (a = !1), f === void 0 && (f = 1), s();
|
|
846
|
-
const {
|
|
847
|
-
left: c,
|
|
848
|
-
top: u,
|
|
849
|
-
width: h,
|
|
850
|
-
height: g
|
|
851
|
-
} = e.getBoundingClientRect();
|
|
852
|
-
if (a || n(), !h || !g)
|
|
853
|
-
return;
|
|
854
|
-
const m = Me(u), y = Me(t.clientWidth - (c + h)), d = Me(t.clientHeight - (u + g)), _ = Me(c), w = {
|
|
855
|
-
rootMargin: -m + "px " + -y + "px " + -d + "px " + -_ + "px",
|
|
856
|
-
threshold: N(0, Se(1, f)) || 1
|
|
857
|
-
};
|
|
858
|
-
let b = !0;
|
|
859
|
-
function C(R) {
|
|
860
|
-
const I = R[0].intersectionRatio;
|
|
861
|
-
if (I !== f) {
|
|
862
|
-
if (!b)
|
|
863
|
-
return i();
|
|
864
|
-
I ? i(!1, I) : l = setTimeout(() => {
|
|
865
|
-
i(!1, 1e-7);
|
|
866
|
-
}, 1e3);
|
|
867
|
-
}
|
|
868
|
-
b = !1;
|
|
869
|
-
}
|
|
870
|
-
try {
|
|
871
|
-
o = new IntersectionObserver(C, {
|
|
872
|
-
...w,
|
|
873
|
-
// Handle <iframe>s
|
|
874
|
-
root: t.ownerDocument
|
|
875
|
-
});
|
|
876
|
-
} catch {
|
|
877
|
-
o = new IntersectionObserver(C, w);
|
|
878
|
-
}
|
|
879
|
-
o.observe(e);
|
|
880
|
-
}
|
|
881
|
-
return i(!0), s;
|
|
882
|
-
}
|
|
883
|
-
function On(e, n, o, l) {
|
|
884
|
-
l === void 0 && (l = {});
|
|
885
|
-
const {
|
|
886
|
-
ancestorScroll: t = !0,
|
|
887
|
-
ancestorResize: s = !0,
|
|
888
|
-
elementResize: i = typeof ResizeObserver == "function",
|
|
889
|
-
layoutShift: a = typeof IntersectionObserver == "function",
|
|
890
|
-
animationFrame: f = !1
|
|
891
|
-
} = l, c = Je(e), u = t || s ? [...c ? Re(c) : [], ...Re(n)] : [];
|
|
892
|
-
u.forEach((v) => {
|
|
893
|
-
t && v.addEventListener("scroll", o, {
|
|
894
|
-
passive: !0
|
|
895
|
-
}), s && v.addEventListener("resize", o);
|
|
896
|
-
});
|
|
897
|
-
const h = c && a ? Tn(c, o) : null;
|
|
898
|
-
let g = -1, m = null;
|
|
899
|
-
i && (m = new ResizeObserver((v) => {
|
|
900
|
-
let [w] = v;
|
|
901
|
-
w && w.target === c && m && (m.unobserve(n), cancelAnimationFrame(g), g = requestAnimationFrame(() => {
|
|
902
|
-
var b;
|
|
903
|
-
(b = m) == null || b.observe(n);
|
|
904
|
-
})), o();
|
|
905
|
-
}), c && !f && m.observe(c), m.observe(n));
|
|
906
|
-
let y, d = f ? ie(e) : null;
|
|
907
|
-
f && _();
|
|
908
|
-
function _() {
|
|
909
|
-
const v = ie(e);
|
|
910
|
-
d && (v.x !== d.x || v.y !== d.y || v.width !== d.width || v.height !== d.height) && o(), d = v, y = requestAnimationFrame(_);
|
|
911
|
-
}
|
|
912
|
-
return o(), () => {
|
|
913
|
-
var v;
|
|
914
|
-
u.forEach((w) => {
|
|
915
|
-
t && w.removeEventListener("scroll", o), s && w.removeEventListener("resize", o);
|
|
916
|
-
}), h == null || h(), (v = m) == null || v.disconnect(), m = null, f && cancelAnimationFrame(y);
|
|
917
|
-
};
|
|
918
|
-
}
|
|
919
|
-
const kn = cn, Bn = rn, An = un, Ln = (e, n, o) => {
|
|
920
|
-
const l = /* @__PURE__ */ new Map(), t = {
|
|
921
|
-
platform: Cn,
|
|
922
|
-
...o
|
|
923
|
-
}, s = {
|
|
924
|
-
...t.platform,
|
|
925
|
-
_c: l
|
|
926
|
-
};
|
|
927
|
-
return sn(e, n, {
|
|
928
|
-
...t,
|
|
929
|
-
platform: s
|
|
930
|
-
});
|
|
931
|
-
};
|
|
932
|
-
function Dn(e) {
|
|
933
|
-
return e != null && typeof e == "object" && "$el" in e;
|
|
934
|
-
}
|
|
935
|
-
function rt(e) {
|
|
936
|
-
if (Dn(e)) {
|
|
937
|
-
const n = e.$el;
|
|
938
|
-
return Ge(n) && se(n) === "#comment" ? null : n;
|
|
939
|
-
}
|
|
940
|
-
return e;
|
|
941
|
-
}
|
|
942
|
-
function Ee(e) {
|
|
943
|
-
return typeof e == "function" ? e() : G(e);
|
|
944
|
-
}
|
|
945
|
-
function gt(e) {
|
|
946
|
-
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
947
|
-
}
|
|
948
|
-
function at(e, n) {
|
|
949
|
-
const o = gt(e);
|
|
950
|
-
return Math.round(n * o) / o;
|
|
951
|
-
}
|
|
952
|
-
function Mn(e, n, o) {
|
|
953
|
-
o === void 0 && (o = {});
|
|
954
|
-
const l = o.whileElementsMounted, t = k(() => {
|
|
955
|
-
var S;
|
|
956
|
-
return (S = Ee(o.open)) != null ? S : !0;
|
|
957
|
-
}), s = k(() => Ee(o.middleware)), i = k(() => {
|
|
958
|
-
var S;
|
|
959
|
-
return (S = Ee(o.placement)) != null ? S : "bottom";
|
|
960
|
-
}), a = k(() => {
|
|
961
|
-
var S;
|
|
962
|
-
return (S = Ee(o.strategy)) != null ? S : "absolute";
|
|
963
|
-
}), f = k(() => {
|
|
964
|
-
var S;
|
|
965
|
-
return (S = Ee(o.transform)) != null ? S : !0;
|
|
966
|
-
}), c = k(() => rt(e.value)), u = k(() => rt(n.value)), h = O(0), g = O(0), m = O(a.value), y = O(i.value), d = Ct({}), _ = O(!1), v = k(() => {
|
|
967
|
-
const S = {
|
|
968
|
-
position: m.value,
|
|
969
|
-
left: "0",
|
|
970
|
-
top: "0"
|
|
971
|
-
};
|
|
972
|
-
if (!u.value)
|
|
973
|
-
return S;
|
|
974
|
-
const T = at(u.value, h.value), F = at(u.value, g.value);
|
|
975
|
-
return f.value ? {
|
|
976
|
-
...S,
|
|
977
|
-
transform: "translate(" + T + "px, " + F + "px)",
|
|
978
|
-
...gt(u.value) >= 1.5 && {
|
|
979
|
-
willChange: "transform"
|
|
980
|
-
}
|
|
981
|
-
} : {
|
|
982
|
-
position: m.value,
|
|
983
|
-
left: T + "px",
|
|
984
|
-
top: F + "px"
|
|
985
|
-
};
|
|
986
|
-
});
|
|
987
|
-
let w;
|
|
988
|
-
function b() {
|
|
989
|
-
if (c.value == null || u.value == null)
|
|
990
|
-
return;
|
|
991
|
-
const S = t.value;
|
|
992
|
-
Ln(c.value, u.value, {
|
|
993
|
-
middleware: s.value,
|
|
994
|
-
placement: i.value,
|
|
995
|
-
strategy: a.value
|
|
996
|
-
}).then((T) => {
|
|
997
|
-
h.value = T.x, g.value = T.y, m.value = T.strategy, y.value = T.placement, d.value = T.middlewareData, _.value = S !== !1;
|
|
998
|
-
});
|
|
999
|
-
}
|
|
1000
|
-
function C() {
|
|
1001
|
-
typeof w == "function" && (w(), w = void 0);
|
|
1002
|
-
}
|
|
1003
|
-
function R() {
|
|
1004
|
-
if (C(), l === void 0) {
|
|
1005
|
-
b();
|
|
1006
|
-
return;
|
|
1007
|
-
}
|
|
1008
|
-
if (c.value != null && u.value != null) {
|
|
1009
|
-
w = l(c.value, u.value, b);
|
|
1010
|
-
return;
|
|
1011
|
-
}
|
|
1012
|
-
}
|
|
1013
|
-
function I() {
|
|
1014
|
-
t.value || (_.value = !1);
|
|
1015
|
-
}
|
|
1016
|
-
return oe([s, i, a, t], b, {
|
|
1017
|
-
flush: "sync"
|
|
1018
|
-
}), oe([c, u], R, {
|
|
1019
|
-
flush: "sync"
|
|
1020
|
-
}), oe(t, I, {
|
|
1021
|
-
flush: "sync"
|
|
1022
|
-
}), Tt() && Ot(C), {
|
|
1023
|
-
x: ae(h),
|
|
1024
|
-
y: ae(g),
|
|
1025
|
-
strategy: ae(m),
|
|
1026
|
-
placement: ae(y),
|
|
1027
|
-
middlewareData: ae(d),
|
|
1028
|
-
isPositioned: ae(_),
|
|
1029
|
-
floatingStyles: v,
|
|
1030
|
-
update: b
|
|
1031
|
-
};
|
|
1032
|
-
}
|
|
1033
|
-
const Fn = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "name"], Pn = ["selected", "value"], In = ["aria-controls", "aria-expanded", "aria-label", "aria-disabled"], Vn = ["id"], Nn = ["onKeypress", "onMousedown"], $n = {
|
|
26
|
+
import "./index-9e1095ef.js";
|
|
27
|
+
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
28
|
+
const Ze = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "name"], et = ["selected", "value"], tt = ["aria-controls", "aria-expanded", "aria-label", "aria-disabled"], lt = ["id"], at = ["onKeypress", "onMousedown"], st = {
|
|
1034
29
|
key: 0,
|
|
1035
30
|
class: "stash-select__total"
|
|
1036
|
-
},
|
|
31
|
+
}, nt = {
|
|
1037
32
|
key: 0,
|
|
1038
33
|
class: "tw-flex tw-items-center tw-border-b tw-border-blue-500 tw-pr-1.5"
|
|
1039
|
-
},
|
|
34
|
+
}, ot = ["data-test", "placeholder"], rt = { class: "stash-select__options options tw-my-1.5 tw-w-full tw-border-white tw-bg-white" }, it = ["data-test", "onClick", "onMouseenter"], ut = { class: "tw-m-1.5 tw-cursor-default tw-p-1.5" }, ct = {
|
|
1040
35
|
class: "tw-m-1.5 tw-cursor-default tw-p-1.5",
|
|
1041
36
|
"data-test": "stash-select|no-options"
|
|
1042
|
-
},
|
|
37
|
+
}, dt = /* @__PURE__ */ xe({
|
|
1043
38
|
name: "ll-select",
|
|
1044
39
|
__name: "Select",
|
|
1045
40
|
props: {
|
|
@@ -1079,404 +74,404 @@ const Fn = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "
|
|
|
1079
74
|
useFuzzySearch: { type: Boolean, default: !1 },
|
|
1080
75
|
menuPlacement: { default: "bottom-start" },
|
|
1081
76
|
enableTeleport: { type: Boolean, default: !1 },
|
|
1082
|
-
teleportTo: { default: `#${
|
|
77
|
+
teleportTo: { default: `#${Ye}` }
|
|
1083
78
|
},
|
|
1084
79
|
emits: ["update:model-value", "clear", "add", "remove", "opened", "closed"],
|
|
1085
|
-
setup(
|
|
1086
|
-
const
|
|
1087
|
-
whileElementsMounted:
|
|
1088
|
-
placement:
|
|
80
|
+
setup(ue, { emit: ce }) {
|
|
81
|
+
const e = ue, h = ce, H = Ce(), de = Ie(), Q = u(null), m = u(null), E = u(null), q = u(null), Z = u(null), N = u(0), T = u(0), n = u([]), ee = u(() => []), _ = u(""), f = u(-1), c = u(!1), W = u({}), te = u(!1), { floatingStyles: fe } = He(Q, E, {
|
|
82
|
+
whileElementsMounted: Ne,
|
|
83
|
+
placement: e.menuPlacement,
|
|
1089
84
|
middleware: [
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
apply({ availableHeight:
|
|
1094
|
-
|
|
1095
|
-
maxWidth: `${
|
|
1096
|
-
maxHeight: `${Math.min(
|
|
85
|
+
Ae(),
|
|
86
|
+
Le(({ rects: t }) => e.menuPlacement.includes("bottom") && N.value > T.value ? N.value - t.reference.height + 6 : 6),
|
|
87
|
+
De({
|
|
88
|
+
apply({ availableHeight: t, elements: l, rects: s }) {
|
|
89
|
+
e.enableTeleport && Object.assign(l.floating.style, {
|
|
90
|
+
maxWidth: `${s.reference.width}px`,
|
|
91
|
+
maxHeight: `${Math.min(t, 300)}px`
|
|
1097
92
|
});
|
|
1098
93
|
}
|
|
1099
94
|
})
|
|
1100
95
|
]
|
|
1101
|
-
}),
|
|
1102
|
-
let
|
|
1103
|
-
return
|
|
1104
|
-
}),
|
|
1105
|
-
() => !
|
|
1106
|
-
),
|
|
1107
|
-
|
|
1108
|
-
() =>
|
|
1109
|
-
(
|
|
1110
|
-
if (Array.isArray(
|
|
1111
|
-
const
|
|
1112
|
-
|
|
96
|
+
}), X = v(() => !e.hideSearch && e.searchable !== "false" && e.searchable !== !1), A = v(() => {
|
|
97
|
+
let t = (te.value && e.lazy ? e.lazy() : e.options).filter(Boolean);
|
|
98
|
+
return Ge(t[0]) || (t = t.map((l, s) => ({ name: l, id: s }))), t;
|
|
99
|
+
}), le = v(() => e.searchLoading || Object.keys(W.value).length > 0), x = v(() => e.disableFiltering || !(_.value || "").trim() ? A.value : ee.value(_.value)), pe = v(() => N.value <= T.value), ve = v(
|
|
100
|
+
() => !c.value && !e.single && !pe.value && n.value.length
|
|
101
|
+
), he = v(() => [n.value.length, e.selectItemType, "selected"].filter(Boolean).join(" ")), me = v(() => e.preventEmpty || e.allowEmpty === "false" || e.allowEmpty === !1);
|
|
102
|
+
U(_, (t, l) => l !== t && D(-1)), U(n, () => I(), { deep: !0 }), U(
|
|
103
|
+
() => e.modelValue,
|
|
104
|
+
(t) => {
|
|
105
|
+
if (Array.isArray(t)) {
|
|
106
|
+
const l = t.filter(Boolean);
|
|
107
|
+
re(l, n.value) || (n.value = l);
|
|
1113
108
|
return;
|
|
1114
109
|
}
|
|
1115
|
-
if (!
|
|
1116
|
-
|
|
110
|
+
if (!Ve(t)) {
|
|
111
|
+
re(t, n.value[0]) || (n.value[0] = t);
|
|
1117
112
|
return;
|
|
1118
113
|
}
|
|
1119
|
-
|
|
114
|
+
n.value = [];
|
|
1120
115
|
},
|
|
1121
116
|
{ immediate: !0 }
|
|
1122
|
-
),
|
|
1123
|
-
() =>
|
|
117
|
+
), U(
|
|
118
|
+
() => e.options,
|
|
1124
119
|
() => {
|
|
1125
|
-
const { searchFor:
|
|
1126
|
-
items:
|
|
1127
|
-
fieldNames:
|
|
1128
|
-
trackBy:
|
|
120
|
+
const { searchFor: t } = qe({
|
|
121
|
+
items: v(() => A.value),
|
|
122
|
+
fieldNames: e.searchBy.length ? e.searchBy : [e.displayBy],
|
|
123
|
+
trackBy: e.trackBy
|
|
1129
124
|
});
|
|
1130
|
-
|
|
125
|
+
ee.value = (l) => t(l, { fuzzy: e.useFuzzySearch });
|
|
1131
126
|
},
|
|
1132
127
|
{ immediate: !0 }
|
|
1133
128
|
);
|
|
1134
|
-
const
|
|
1135
|
-
|
|
1136
|
-
},
|
|
1137
|
-
|
|
1138
|
-
},
|
|
1139
|
-
if (
|
|
1140
|
-
const
|
|
1141
|
-
var
|
|
1142
|
-
return ((
|
|
129
|
+
const ye = () => {
|
|
130
|
+
n.value = [], h("update:model-value", e.single ? void 0 : n.value), h("clear");
|
|
131
|
+
}, L = (t) => {
|
|
132
|
+
e.disabled || !t || typeof t == "object" && "disabled" in t && (t != null && t.disabled) || (w(t) ? C(t) : (e.single && (n.value = []), n.value.push(t), h("update:model-value", e.single ? n.value[0] : n.value), h("add", t)), e.single && g());
|
|
133
|
+
}, _e = (t) => {
|
|
134
|
+
if (e.single) {
|
|
135
|
+
const s = A.value.find((r) => {
|
|
136
|
+
var i;
|
|
137
|
+
return ((i = r[e.trackBy]) == null ? void 0 : i.toString()) === t.target.value;
|
|
1143
138
|
});
|
|
1144
|
-
|
|
139
|
+
L(s);
|
|
1145
140
|
return;
|
|
1146
141
|
}
|
|
1147
|
-
const
|
|
1148
|
-
for (const
|
|
1149
|
-
|
|
1150
|
-
var
|
|
1151
|
-
return
|
|
1152
|
-
}) ||
|
|
1153
|
-
for (const
|
|
1154
|
-
const
|
|
1155
|
-
(
|
|
1156
|
-
var
|
|
1157
|
-
return ((
|
|
142
|
+
const l = [...t.target.selectedOptions];
|
|
143
|
+
for (const s of [...n.value])
|
|
144
|
+
l.find((i) => {
|
|
145
|
+
var a;
|
|
146
|
+
return i.value === ((a = s[e.trackBy]) == null ? void 0 : a.toString());
|
|
147
|
+
}) || C(s);
|
|
148
|
+
for (const s of l) {
|
|
149
|
+
const r = A.value.find(
|
|
150
|
+
(i) => {
|
|
151
|
+
var a;
|
|
152
|
+
return ((a = i[e.trackBy]) == null ? void 0 : a.toString()) === s.value;
|
|
1158
153
|
}
|
|
1159
154
|
);
|
|
1160
|
-
|
|
155
|
+
w(r) || L(r);
|
|
1161
156
|
}
|
|
1162
|
-
},
|
|
1163
|
-
if (
|
|
157
|
+
}, C = (t) => {
|
|
158
|
+
if (e.disabled || me.value && n.value.length === 1)
|
|
1164
159
|
return;
|
|
1165
|
-
const
|
|
1166
|
-
if (
|
|
1167
|
-
|
|
160
|
+
const l = n.value.findIndex((s) => s[e.trackBy] === t[e.trackBy]);
|
|
161
|
+
if (l === -1) {
|
|
162
|
+
Ue.warn("ll-select: could not find option to remove", t);
|
|
1168
163
|
return;
|
|
1169
164
|
}
|
|
1170
|
-
|
|
1171
|
-
},
|
|
1172
|
-
|
|
1173
|
-
var
|
|
1174
|
-
(
|
|
165
|
+
n.value.splice(l, 1), h("update:model-value", e.single ? n.value[0] : n.value), h("remove", t, l);
|
|
166
|
+
}, ae = () => {
|
|
167
|
+
c.value || (I(), c.value = !0, h("opened"), X.value && Y(() => {
|
|
168
|
+
var t;
|
|
169
|
+
(t = Z.value) == null || t.focus({ preventScroll: !0 });
|
|
1175
170
|
}));
|
|
1176
|
-
},
|
|
1177
|
-
var
|
|
1178
|
-
|
|
1179
|
-
},
|
|
1180
|
-
if (await
|
|
171
|
+
}, g = () => {
|
|
172
|
+
var t;
|
|
173
|
+
c.value && h("closed", n.value), D(-1), c.value = !1, e.preserveSearchTerm || (_.value = ""), (t = m.value) == null || t.blur();
|
|
174
|
+
}, be = async (t) => {
|
|
175
|
+
if (await Y(), !m.value)
|
|
1181
176
|
return;
|
|
1182
|
-
if (![
|
|
1183
|
-
const
|
|
1184
|
-
if (!
|
|
177
|
+
if (![S.ENTER, S.ESCAPE].includes(t.keyCode)) {
|
|
178
|
+
const s = m.value.querySelector(".stash-select__option--highlighted"), r = s == null ? void 0 : s.getBoundingClientRect(), i = m.value.getBoundingClientRect();
|
|
179
|
+
if (!r || !i)
|
|
1185
180
|
return;
|
|
1186
|
-
(
|
|
181
|
+
(r.bottom >= i.bottom || r.top <= i.top + r.height) && (s == null || s.scrollIntoView({ block: "nearest", inline: "nearest" }));
|
|
1187
182
|
}
|
|
1188
|
-
},
|
|
1189
|
-
|
|
1190
|
-
},
|
|
1191
|
-
if (
|
|
1192
|
-
|
|
1193
|
-
else if (
|
|
1194
|
-
|
|
1195
|
-
else if (
|
|
1196
|
-
|
|
1197
|
-
else if (
|
|
1198
|
-
|
|
183
|
+
}, D = (t) => {
|
|
184
|
+
f.value = t;
|
|
185
|
+
}, ge = (t) => {
|
|
186
|
+
if (t.keyCode === S.ESCAPE)
|
|
187
|
+
g();
|
|
188
|
+
else if (t.keyCode === S.DOWN && f.value < x.value.length - 1)
|
|
189
|
+
c.value && f.value++;
|
|
190
|
+
else if (t.keyCode === S.UP && f.value > 0)
|
|
191
|
+
c.value && f.value--, E.value && X.value && f.value === 0 && (E.value.scrollTop -= 100);
|
|
192
|
+
else if (t.keyCode === S.ENTER && f.value !== -1)
|
|
193
|
+
c.value && L(x.value[f.value]);
|
|
1199
194
|
else
|
|
1200
195
|
return;
|
|
1201
|
-
|
|
1202
|
-
},
|
|
1203
|
-
|
|
1204
|
-
},
|
|
1205
|
-
if (!
|
|
196
|
+
t.preventDefault(), be(t);
|
|
197
|
+
}, se = Ke(function() {
|
|
198
|
+
we();
|
|
199
|
+
}, We.FAST), we = async function() {
|
|
200
|
+
if (!e.onSearch)
|
|
1206
201
|
return;
|
|
1207
|
-
const
|
|
202
|
+
const t = je("search-request-");
|
|
1208
203
|
try {
|
|
1209
|
-
|
|
204
|
+
W.value[t] = !0, await e.onSearch(_.value);
|
|
1210
205
|
} finally {
|
|
1211
|
-
delete
|
|
206
|
+
delete W.value[t];
|
|
1212
207
|
}
|
|
1213
|
-
},
|
|
208
|
+
}, ke = (t, l) => [
|
|
1214
209
|
{
|
|
1215
210
|
"stash-select__option": !0,
|
|
1216
|
-
"stash-select__option--disabled":
|
|
1217
|
-
"stash-select__option--highlighted":
|
|
1218
|
-
"stash-select__option--selected":
|
|
211
|
+
"stash-select__option--disabled": t && typeof t == "object" && "disabled" in t && (t == null ? void 0 : t.disabled),
|
|
212
|
+
"stash-select__option--highlighted": f.value === l,
|
|
213
|
+
"stash-select__option--selected": w(t)
|
|
1219
214
|
},
|
|
1220
215
|
// @deprecated
|
|
1221
216
|
{
|
|
1222
|
-
"tw-bg-ice-200":
|
|
1223
|
-
"tw-bg-blue-100 tw-text-ice-700":
|
|
217
|
+
"tw-bg-ice-200": f.value === l,
|
|
218
|
+
"tw-bg-blue-100 tw-text-ice-700": w(t)
|
|
1224
219
|
}
|
|
1225
|
-
],
|
|
1226
|
-
function
|
|
1227
|
-
var
|
|
1228
|
-
if (!
|
|
220
|
+
], w = (t) => t == null ? !1 : n.value.some((l) => (l == null ? void 0 : l[e.trackBy]) === t[e.trackBy]);
|
|
221
|
+
function ne(t) {
|
|
222
|
+
var r, i;
|
|
223
|
+
if (!t)
|
|
1229
224
|
return !1;
|
|
1230
|
-
const
|
|
1231
|
-
return
|
|
225
|
+
const l = (r = m.value) == null ? void 0 : r.contains(t), s = (i = E.value) == null ? void 0 : i.contains(t);
|
|
226
|
+
return l || s;
|
|
1232
227
|
}
|
|
1233
|
-
function
|
|
1234
|
-
const
|
|
1235
|
-
!
|
|
228
|
+
function Be(t) {
|
|
229
|
+
const l = t.relatedTarget;
|
|
230
|
+
!ne(l) && l && g();
|
|
1236
231
|
}
|
|
1237
|
-
function
|
|
1238
|
-
const
|
|
1239
|
-
|
|
232
|
+
function Se(t) {
|
|
233
|
+
const l = t.target;
|
|
234
|
+
ne(l) || g();
|
|
1240
235
|
}
|
|
1241
|
-
const
|
|
1242
|
-
|
|
1243
|
-
},
|
|
1244
|
-
await
|
|
236
|
+
const Ee = () => {
|
|
237
|
+
D(-1);
|
|
238
|
+
}, I = async () => {
|
|
239
|
+
await Y(), q.value && m.value && (T.value = T.value === 0 ? m.value.clientHeight : T.value, N.value = q.value.clientHeight);
|
|
1245
240
|
};
|
|
1246
|
-
return
|
|
1247
|
-
if (
|
|
241
|
+
return Oe(() => {
|
|
242
|
+
if (H.onInput)
|
|
1248
243
|
throw new Error("ll-select: use the @update:model-value event instead of @input.");
|
|
1249
|
-
window.addEventListener("resize",
|
|
1250
|
-
}),
|
|
1251
|
-
window.removeEventListener("resize",
|
|
1252
|
-
}), (
|
|
1253
|
-
id:
|
|
1254
|
-
class:
|
|
244
|
+
window.addEventListener("resize", I), I();
|
|
245
|
+
}), Me(() => {
|
|
246
|
+
window.removeEventListener("resize", I);
|
|
247
|
+
}), (t, l) => (o(), K(Je, {
|
|
248
|
+
id: e.id,
|
|
249
|
+
class: O(["input ll-select stash-select", y(H).class]),
|
|
1255
250
|
"data-test": "stash-select",
|
|
1256
|
-
"add-bottom-space":
|
|
1257
|
-
"error-text":
|
|
1258
|
-
"hint-text":
|
|
1259
|
-
label:
|
|
1260
|
-
"show-optional-in-label":
|
|
1261
|
-
},
|
|
1262
|
-
default:
|
|
1263
|
-
|
|
1264
|
-
id:
|
|
1265
|
-
"aria-errormessage":
|
|
1266
|
-
"aria-invalid":
|
|
251
|
+
"add-bottom-space": e.addBottomSpace,
|
|
252
|
+
"error-text": e.errorText || e.error,
|
|
253
|
+
"hint-text": e.hintText || e.hint,
|
|
254
|
+
label: e.label,
|
|
255
|
+
"show-optional-in-label": e.showOptionalInLabel
|
|
256
|
+
}, Fe({
|
|
257
|
+
default: M(({ fieldId: s, fieldErrorId: r, hasError: i }) => [
|
|
258
|
+
p("select", {
|
|
259
|
+
id: s,
|
|
260
|
+
"aria-errormessage": r,
|
|
261
|
+
"aria-invalid": i,
|
|
1267
262
|
class: "tw-sr-only",
|
|
1268
|
-
disabled:
|
|
1269
|
-
multiple: !
|
|
1270
|
-
name:
|
|
1271
|
-
onChange:
|
|
263
|
+
disabled: e.disabled,
|
|
264
|
+
multiple: !e.single,
|
|
265
|
+
name: e.name,
|
|
266
|
+
onChange: _e
|
|
1272
267
|
}, [
|
|
1273
|
-
(
|
|
1274
|
-
key: `srOnlyOption-${
|
|
1275
|
-
selected:
|
|
1276
|
-
value:
|
|
1277
|
-
},
|
|
1278
|
-
|
|
1279
|
-
], 40,
|
|
1280
|
-
|
|
268
|
+
(o(!0), d(V, null, G(x.value, (a, b) => (o(), d("option", {
|
|
269
|
+
key: `srOnlyOption-${b}`,
|
|
270
|
+
selected: w(a),
|
|
271
|
+
value: a[e.trackBy]
|
|
272
|
+
}, k(a[e.displayBy] || ""), 9, et))), 128)),
|
|
273
|
+
l[5] || (l[5] = p("option", { value: "" }, null, -1))
|
|
274
|
+
], 40, Ze),
|
|
275
|
+
F((o(), d("div", {
|
|
1281
276
|
ref_key: "selectRef",
|
|
1282
|
-
ref:
|
|
277
|
+
ref: Q,
|
|
1283
278
|
role: "listbox",
|
|
1284
279
|
"aria-hidden": "true",
|
|
1285
|
-
class:
|
|
280
|
+
class: O(["stash-select__content-wrapper", [
|
|
1286
281
|
{
|
|
1287
|
-
"stash-select--disabled": !!
|
|
1288
|
-
"stash-select--error": !!(
|
|
1289
|
-
"stash-select--active":
|
|
1290
|
-
"stash-select--single":
|
|
282
|
+
"stash-select--disabled": !!e.disabled,
|
|
283
|
+
"stash-select--error": !!(e.errorText || e.error),
|
|
284
|
+
"stash-select--active": c.value,
|
|
285
|
+
"stash-select--single": e.single
|
|
1291
286
|
},
|
|
1292
287
|
// @deprecated
|
|
1293
288
|
{
|
|
1294
|
-
"is-active":
|
|
1295
|
-
"is-single":
|
|
1296
|
-
"is-disabled":
|
|
289
|
+
"is-active": c.value,
|
|
290
|
+
"is-single": e.single,
|
|
291
|
+
"is-disabled": e.disabled
|
|
1297
292
|
}
|
|
1298
293
|
]]),
|
|
1299
|
-
"aria-controls": "listbox-" +
|
|
1300
|
-
"aria-expanded":
|
|
1301
|
-
"aria-label":
|
|
1302
|
-
"aria-disabled":
|
|
1303
|
-
onKeydown:
|
|
1304
|
-
onKeyup:
|
|
294
|
+
"aria-controls": "listbox-" + s,
|
|
295
|
+
"aria-expanded": c.value,
|
|
296
|
+
"aria-label": e.placeholder,
|
|
297
|
+
"aria-disabled": e.disabled || void 0,
|
|
298
|
+
onKeydown: ge,
|
|
299
|
+
onKeyup: oe(g, ["esc"])
|
|
1305
300
|
}, [
|
|
1306
|
-
|
|
1307
|
-
id: "listbox-" +
|
|
301
|
+
p("div", {
|
|
302
|
+
id: "listbox-" + s,
|
|
1308
303
|
ref_key: "contentRef",
|
|
1309
|
-
ref:
|
|
304
|
+
ref: m,
|
|
1310
305
|
class: "input-field stash-select__content",
|
|
1311
306
|
tabindex: "0",
|
|
1312
|
-
onFocusin:
|
|
1313
|
-
onFocusinOnce:
|
|
1314
|
-
onFocusout:
|
|
1315
|
-
onKeydown:
|
|
1316
|
-
onMouseleave:
|
|
307
|
+
onFocusin: ae,
|
|
308
|
+
onFocusinOnce: l[4] || (l[4] = (a) => te.value = !0),
|
|
309
|
+
onFocusout: Be,
|
|
310
|
+
onKeydown: ae,
|
|
311
|
+
onMouseleave: Ee
|
|
1317
312
|
}, [
|
|
1318
|
-
|
|
313
|
+
p("ul", {
|
|
1319
314
|
ref_key: "chipsRef",
|
|
1320
|
-
ref:
|
|
315
|
+
ref: q,
|
|
1321
316
|
class: "stash-select__chips"
|
|
1322
317
|
}, [
|
|
1323
|
-
|
|
318
|
+
n.value.length ? R("", !0) : (o(), d("li", {
|
|
1324
319
|
key: 0,
|
|
1325
|
-
class:
|
|
1326
|
-
},
|
|
1327
|
-
|
|
1328
|
-
key: `chip-${
|
|
1329
|
-
class:
|
|
320
|
+
class: O(["stash-select__placeholder tw-mr-0 tw-pl-1.5", { "tw-truncate": !e.noTruncate }])
|
|
321
|
+
}, k(e.placeholder), 3)),
|
|
322
|
+
e.single ? (o(!0), d(V, { key: 1 }, G(n.value, (a) => (o(), d("li", {
|
|
323
|
+
key: `chip-${a[e.trackBy]}`,
|
|
324
|
+
class: O(["stash-select__selected tw-mr-0 tw-pl-1.5", { "tw-truncate": !e.noTruncate }])
|
|
1330
325
|
}, [
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
326
|
+
j(t.$slots, "selected", { option: a }, () => [
|
|
327
|
+
$(k(a[e.displayBy] || a) + " ", 1),
|
|
328
|
+
p("button", {
|
|
1334
329
|
tabindex: "-1",
|
|
1335
330
|
class: "stash-select__remove",
|
|
1336
|
-
onKeypress:
|
|
1337
|
-
onMousedown:
|
|
331
|
+
onKeypress: oe(P((b) => C(a), ["prevent"]), ["enter"]),
|
|
332
|
+
onMousedown: P((b) => C(a), ["prevent", "stop"])
|
|
1338
333
|
}, [
|
|
1339
|
-
|
|
334
|
+
B(z, {
|
|
1340
335
|
icon: "close",
|
|
1341
336
|
name: "close",
|
|
1342
337
|
size: "small"
|
|
1343
338
|
})
|
|
1344
|
-
], 40,
|
|
339
|
+
], 40, at)
|
|
1345
340
|
], !0)
|
|
1346
|
-
], 2))), 128)) : (
|
|
1347
|
-
key: `chip-${
|
|
341
|
+
], 2))), 128)) : (o(!0), d(V, { key: 2 }, G(n.value, (a) => (o(), d("li", {
|
|
342
|
+
key: `chip-${a[e.trackBy]}`,
|
|
1348
343
|
class: "tw-inline-block"
|
|
1349
344
|
}, [
|
|
1350
|
-
|
|
345
|
+
B(ie, {
|
|
1351
346
|
"bg-color": "blue-500",
|
|
1352
347
|
"is-removable": "",
|
|
1353
348
|
"text-color": "white",
|
|
1354
349
|
class: "stash-select__chip",
|
|
1355
|
-
onRemove: (
|
|
350
|
+
onRemove: (b) => C(a)
|
|
1356
351
|
}, {
|
|
1357
|
-
default:
|
|
1358
|
-
|
|
352
|
+
default: M(() => [
|
|
353
|
+
$(k(a[e.displayBy] || a), 1)
|
|
1359
354
|
]),
|
|
1360
355
|
_: 2
|
|
1361
356
|
}, 1032, ["onRemove"])
|
|
1362
357
|
]))), 128))
|
|
1363
358
|
], 512),
|
|
1364
|
-
|
|
1365
|
-
|
|
359
|
+
ve.value ? (o(), d("div", st, [
|
|
360
|
+
B(ie, {
|
|
1366
361
|
"bg-color": "blue-500",
|
|
1367
362
|
"is-removable": "",
|
|
1368
363
|
"text-color": "white",
|
|
1369
364
|
class: "stash-select__chip",
|
|
1370
|
-
onRemove:
|
|
365
|
+
onRemove: ye
|
|
1371
366
|
}, {
|
|
1372
|
-
default:
|
|
1373
|
-
|
|
367
|
+
default: M(() => [
|
|
368
|
+
$(k(he.value), 1)
|
|
1374
369
|
]),
|
|
1375
370
|
_: 1
|
|
1376
371
|
})
|
|
1377
|
-
])) :
|
|
1378
|
-
|
|
372
|
+
])) : R("", !0),
|
|
373
|
+
e.icon ? (o(), K(z, {
|
|
1379
374
|
key: 1,
|
|
1380
375
|
class: "stash-select__icon",
|
|
1381
376
|
"data-test": "stash-select|toggle-icon",
|
|
1382
|
-
name:
|
|
1383
|
-
onMousedown:
|
|
1384
|
-
}, null, 8, ["name"])) :
|
|
1385
|
-
(
|
|
1386
|
-
to:
|
|
1387
|
-
disabled: !
|
|
377
|
+
name: e.icon,
|
|
378
|
+
onMousedown: l[0] || (l[0] = P((a) => c.value && g(), ["prevent"]))
|
|
379
|
+
}, null, 8, ["name"])) : R("", !0),
|
|
380
|
+
(o(), K(Re, {
|
|
381
|
+
to: e.teleportTo,
|
|
382
|
+
disabled: !e.enableTeleport
|
|
1388
383
|
}, [
|
|
1389
|
-
|
|
1390
|
-
default:
|
|
1391
|
-
|
|
384
|
+
B($e, { name: "fade" }, {
|
|
385
|
+
default: M(() => [
|
|
386
|
+
F(p("div", {
|
|
1392
387
|
ref_key: "optionsWrapperRef",
|
|
1393
|
-
ref:
|
|
388
|
+
ref: E,
|
|
1394
389
|
class: "stash-select__border-selector tw-w-full tw-shadow-2xl",
|
|
1395
|
-
style:
|
|
1396
|
-
onClick:
|
|
390
|
+
style: Pe(y(fe)),
|
|
391
|
+
onClick: l[3] || (l[3] = P(() => {
|
|
1397
392
|
}, ["stop"]))
|
|
1398
393
|
}, [
|
|
1399
|
-
|
|
1400
|
-
|
|
394
|
+
X.value ? (o(), d("div", nt, [
|
|
395
|
+
F(p("input", {
|
|
1401
396
|
ref_key: "searchRef",
|
|
1402
|
-
ref:
|
|
1403
|
-
"onUpdate:modelValue":
|
|
397
|
+
ref: Z,
|
|
398
|
+
"onUpdate:modelValue": l[1] || (l[1] = (a) => _.value = a),
|
|
1404
399
|
type: "text",
|
|
1405
400
|
autocomplete: "off",
|
|
1406
401
|
class: "stash-select__search",
|
|
1407
|
-
"data-test":
|
|
1408
|
-
placeholder:
|
|
402
|
+
"data-test": y(H)["data-test"] ? y(H)["data-test"] + "-search" : "stash-select|search",
|
|
403
|
+
placeholder: e.searchPlaceholder,
|
|
1409
404
|
spellcheck: !1,
|
|
1410
|
-
onInput:
|
|
1411
|
-
(...
|
|
1412
|
-
}, null, 40,
|
|
1413
|
-
[
|
|
405
|
+
onInput: l[2] || (l[2] = //@ts-ignore
|
|
406
|
+
(...a) => y(se) && y(se)(...a))
|
|
407
|
+
}, null, 40, ot), [
|
|
408
|
+
[ze, _.value]
|
|
1414
409
|
]),
|
|
1415
|
-
|
|
410
|
+
B(z, {
|
|
1416
411
|
name: "search",
|
|
1417
412
|
class: "tw-text-ice-500"
|
|
1418
413
|
})
|
|
1419
|
-
])) :
|
|
1420
|
-
|
|
1421
|
-
(
|
|
1422
|
-
key: `option-${
|
|
1423
|
-
"data-test":
|
|
1424
|
-
class:
|
|
1425
|
-
onClick: (
|
|
1426
|
-
onMouseenter:
|
|
414
|
+
])) : R("", !0),
|
|
415
|
+
p("ul", rt, [
|
|
416
|
+
(o(!0), d(V, null, G(x.value, (a, b) => (o(), d("li", {
|
|
417
|
+
key: `option-${a[e.trackBy]}`,
|
|
418
|
+
"data-test": a[e.trackBy],
|
|
419
|
+
class: O(ke(a, b)),
|
|
420
|
+
onClick: (Te) => L(a),
|
|
421
|
+
onMouseenter: P((Te) => D(b), ["self"])
|
|
1427
422
|
}, [
|
|
1428
|
-
|
|
1429
|
-
|
|
423
|
+
j(t.$slots, "option", { option: a }, () => [
|
|
424
|
+
$(k(a[e.displayBy] || a), 1)
|
|
1430
425
|
], !0),
|
|
1431
|
-
|
|
426
|
+
w(a) && !e.hideCheck ? (o(), K(z, {
|
|
1432
427
|
key: 0,
|
|
1433
428
|
class: "tw-ml-auto tw-text-blue-500",
|
|
1434
429
|
name: "check"
|
|
1435
|
-
})) :
|
|
1436
|
-
], 42,
|
|
1437
|
-
|
|
1438
|
-
|
|
430
|
+
})) : R("", !0)
|
|
431
|
+
], 42, it))), 128)),
|
|
432
|
+
F(p("li", ut, [
|
|
433
|
+
B(z, {
|
|
1439
434
|
"data-test": "stash-select|options-loading",
|
|
1440
435
|
name: "working",
|
|
1441
436
|
class: "tw-animate-spin tw-text-ice-500"
|
|
1442
437
|
})
|
|
1443
438
|
], 512), [
|
|
1444
|
-
[
|
|
439
|
+
[J, e.loading || le.value]
|
|
1445
440
|
]),
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
441
|
+
F(p("li", ct, [
|
|
442
|
+
j(t.$slots, "no-options", {}, () => [
|
|
443
|
+
l[6] || (l[6] = $(" No options "))
|
|
1449
444
|
], !0)
|
|
1450
445
|
], 512), [
|
|
1451
|
-
[
|
|
446
|
+
[J, !e.loading && !le.value && !x.value.length]
|
|
1452
447
|
])
|
|
1453
448
|
])
|
|
1454
449
|
], 4), [
|
|
1455
|
-
[
|
|
450
|
+
[J, c.value && !e.disabled]
|
|
1456
451
|
])
|
|
1457
452
|
]),
|
|
1458
453
|
_: 3
|
|
1459
454
|
})
|
|
1460
455
|
], 8, ["to", "disabled"]))
|
|
1461
|
-
], 40,
|
|
1462
|
-
], 42,
|
|
1463
|
-
[
|
|
456
|
+
], 40, lt)
|
|
457
|
+
], 42, tt)), [
|
|
458
|
+
[y(Xe), Se]
|
|
1464
459
|
])
|
|
1465
460
|
]),
|
|
1466
461
|
_: 2
|
|
1467
462
|
}, [
|
|
1468
|
-
|
|
463
|
+
y(de).hint ? {
|
|
1469
464
|
name: "hint",
|
|
1470
|
-
fn:
|
|
1471
|
-
|
|
465
|
+
fn: M(() => [
|
|
466
|
+
j(t.$slots, "hint", {}, void 0, !0)
|
|
1472
467
|
]),
|
|
1473
468
|
key: "0"
|
|
1474
469
|
} : void 0
|
|
1475
470
|
]), 1032, ["id", "add-bottom-space", "class", "error-text", "hint-text", "label", "show-optional-in-label"]));
|
|
1476
471
|
}
|
|
1477
472
|
});
|
|
1478
|
-
const
|
|
473
|
+
const Dt = /* @__PURE__ */ Qe(dt, [["__scopeId", "data-v-ab74bb37"]]);
|
|
1479
474
|
export {
|
|
1480
|
-
|
|
475
|
+
Dt as default
|
|
1481
476
|
};
|
|
1482
477
|
//# sourceMappingURL=Select.js.map
|