@keenmate/web-multiselect 1.0.0-rc05 → 1.0.0-rc08
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/README.md +329 -56
- package/dist/multiselect.js +1367 -829
- package/dist/multiselect.umd.js +14 -14
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/scss/_css-variables.scss +379 -0
- package/src/scss/_input-dropdown.scss +9 -0
- package/src/scss/_options.scss +18 -0
- package/src/scss/_variables.scss +2 -0
- package/src/scss/main.scss +2 -0
package/dist/multiselect.js
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
const
|
|
1
|
+
var at = Object.defineProperty;
|
|
2
|
+
var ct = (i, e, t) => e in i ? at(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
+
var u = (i, e, t) => ct(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
const ae = Math.min, B = Math.max, ce = Math.round, oe = Math.floor, M = (i) => ({
|
|
5
5
|
x: i,
|
|
6
6
|
y: i
|
|
7
|
-
}),
|
|
7
|
+
}), dt = {
|
|
8
8
|
left: "right",
|
|
9
9
|
right: "left",
|
|
10
10
|
bottom: "top",
|
|
11
11
|
top: "bottom"
|
|
12
|
-
},
|
|
12
|
+
}, pt = {
|
|
13
13
|
start: "end",
|
|
14
14
|
end: "start"
|
|
15
15
|
};
|
|
16
|
-
function
|
|
17
|
-
return
|
|
16
|
+
function Ve(i, e, t) {
|
|
17
|
+
return B(i, ae(e, t));
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function me(i, e) {
|
|
20
20
|
return typeof i == "function" ? i(e) : i;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function W(i) {
|
|
23
23
|
return i.split("-")[0];
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function ue(i) {
|
|
26
26
|
return i.split("-")[1];
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function We(i) {
|
|
29
29
|
return i === "x" ? "y" : "x";
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function je(i) {
|
|
32
32
|
return i === "y" ? "height" : "width";
|
|
33
33
|
}
|
|
34
|
-
const
|
|
35
|
-
function
|
|
36
|
-
return
|
|
34
|
+
const ht = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
35
|
+
function z(i) {
|
|
36
|
+
return ht.has(W(i)) ? "y" : "x";
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
return
|
|
38
|
+
function Ge(i) {
|
|
39
|
+
return We(z(i));
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function mt(i, e, t) {
|
|
42
42
|
t === void 0 && (t = !1);
|
|
43
|
-
const
|
|
44
|
-
let n =
|
|
45
|
-
return e.reference[s] > e.floating[s] && (n =
|
|
43
|
+
const o = ue(i), l = Ge(i), s = je(l);
|
|
44
|
+
let n = l === "x" ? o === (t ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
|
|
45
|
+
return e.reference[s] > e.floating[s] && (n = de(n)), [n, de(n)];
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
const e =
|
|
49
|
-
return [
|
|
47
|
+
function ut(i) {
|
|
48
|
+
const e = de(i);
|
|
49
|
+
return [Ce(i), e, Ce(e)];
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
return i.replace(/start|end/g, (e) =>
|
|
51
|
+
function Ce(i) {
|
|
52
|
+
return i.replace(/start|end/g, (e) => pt[e]);
|
|
53
53
|
}
|
|
54
|
-
const
|
|
55
|
-
function
|
|
54
|
+
const $e = ["left", "right"], ze = ["right", "left"], ft = ["top", "bottom"], gt = ["bottom", "top"];
|
|
55
|
+
function bt(i, e, t) {
|
|
56
56
|
switch (i) {
|
|
57
57
|
case "top":
|
|
58
58
|
case "bottom":
|
|
59
|
-
return t ? e ?
|
|
59
|
+
return t ? e ? ze : $e : e ? $e : ze;
|
|
60
60
|
case "left":
|
|
61
61
|
case "right":
|
|
62
|
-
return e ?
|
|
62
|
+
return e ? ft : gt;
|
|
63
63
|
default:
|
|
64
64
|
return [];
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
const
|
|
69
|
-
let s =
|
|
70
|
-
return
|
|
67
|
+
function vt(i, e, t, o) {
|
|
68
|
+
const l = ue(i);
|
|
69
|
+
let s = bt(W(i), t === "start", o);
|
|
70
|
+
return l && (s = s.map((n) => n + "-" + l), e && (s = s.concat(s.map(Ce)))), s;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
return i.replace(/left|right|bottom|top/g, (e) =>
|
|
72
|
+
function de(i) {
|
|
73
|
+
return i.replace(/left|right|bottom|top/g, (e) => dt[e]);
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function wt(i) {
|
|
76
76
|
return {
|
|
77
77
|
top: 0,
|
|
78
78
|
right: 0,
|
|
@@ -81,309 +81,309 @@ function ot(i) {
|
|
|
81
81
|
...i
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
return typeof i != "number" ?
|
|
84
|
+
function yt(i) {
|
|
85
|
+
return typeof i != "number" ? wt(i) : {
|
|
86
86
|
top: i,
|
|
87
87
|
right: i,
|
|
88
88
|
bottom: i,
|
|
89
89
|
left: i
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function pe(i) {
|
|
93
93
|
const {
|
|
94
94
|
x: e,
|
|
95
95
|
y: t,
|
|
96
|
-
width:
|
|
97
|
-
height:
|
|
96
|
+
width: o,
|
|
97
|
+
height: l
|
|
98
98
|
} = i;
|
|
99
99
|
return {
|
|
100
|
-
width:
|
|
101
|
-
height:
|
|
100
|
+
width: o,
|
|
101
|
+
height: l,
|
|
102
102
|
top: t,
|
|
103
103
|
left: e,
|
|
104
|
-
right: e +
|
|
105
|
-
bottom: t +
|
|
104
|
+
right: e + o,
|
|
105
|
+
bottom: t + l,
|
|
106
106
|
x: e,
|
|
107
107
|
y: t
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function De(i, e, t) {
|
|
111
111
|
let {
|
|
112
|
-
reference:
|
|
113
|
-
floating:
|
|
112
|
+
reference: o,
|
|
113
|
+
floating: l
|
|
114
114
|
} = i;
|
|
115
|
-
const s =
|
|
116
|
-
let
|
|
115
|
+
const s = z(e), n = Ge(e), r = je(n), a = W(e), d = s === "y", c = o.x + o.width / 2 - l.width / 2, m = o.y + o.height / 2 - l.height / 2, p = o[r] / 2 - l[r] / 2;
|
|
116
|
+
let h;
|
|
117
117
|
switch (a) {
|
|
118
118
|
case "top":
|
|
119
|
-
|
|
120
|
-
x:
|
|
121
|
-
y:
|
|
119
|
+
h = {
|
|
120
|
+
x: c,
|
|
121
|
+
y: o.y - l.height
|
|
122
122
|
};
|
|
123
123
|
break;
|
|
124
124
|
case "bottom":
|
|
125
|
-
|
|
126
|
-
x:
|
|
127
|
-
y:
|
|
125
|
+
h = {
|
|
126
|
+
x: c,
|
|
127
|
+
y: o.y + o.height
|
|
128
128
|
};
|
|
129
129
|
break;
|
|
130
130
|
case "right":
|
|
131
|
-
|
|
132
|
-
x:
|
|
133
|
-
y:
|
|
131
|
+
h = {
|
|
132
|
+
x: o.x + o.width,
|
|
133
|
+
y: m
|
|
134
134
|
};
|
|
135
135
|
break;
|
|
136
136
|
case "left":
|
|
137
|
-
|
|
138
|
-
x:
|
|
139
|
-
y:
|
|
137
|
+
h = {
|
|
138
|
+
x: o.x - l.width,
|
|
139
|
+
y: m
|
|
140
140
|
};
|
|
141
141
|
break;
|
|
142
142
|
default:
|
|
143
|
-
|
|
144
|
-
x:
|
|
145
|
-
y:
|
|
143
|
+
h = {
|
|
144
|
+
x: o.x,
|
|
145
|
+
y: o.y
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
|
-
switch (
|
|
148
|
+
switch (ue(e)) {
|
|
149
149
|
case "start":
|
|
150
|
-
|
|
150
|
+
h[n] -= p * (t && d ? -1 : 1);
|
|
151
151
|
break;
|
|
152
152
|
case "end":
|
|
153
|
-
|
|
153
|
+
h[n] += p * (t && d ? -1 : 1);
|
|
154
154
|
break;
|
|
155
155
|
}
|
|
156
|
-
return
|
|
156
|
+
return h;
|
|
157
157
|
}
|
|
158
|
-
const
|
|
158
|
+
const _t = async (i, e, t) => {
|
|
159
159
|
const {
|
|
160
|
-
placement:
|
|
161
|
-
strategy:
|
|
160
|
+
placement: o = "bottom",
|
|
161
|
+
strategy: l = "absolute",
|
|
162
162
|
middleware: s = [],
|
|
163
163
|
platform: n
|
|
164
164
|
} = t, r = s.filter(Boolean), a = await (n.isRTL == null ? void 0 : n.isRTL(e));
|
|
165
|
-
let
|
|
165
|
+
let d = await n.getElementRects({
|
|
166
166
|
reference: i,
|
|
167
167
|
floating: e,
|
|
168
|
-
strategy:
|
|
168
|
+
strategy: l
|
|
169
169
|
}), {
|
|
170
|
-
x:
|
|
171
|
-
y:
|
|
172
|
-
} =
|
|
173
|
-
for (let
|
|
170
|
+
x: c,
|
|
171
|
+
y: m
|
|
172
|
+
} = De(d, o, a), p = o, h = {}, f = 0;
|
|
173
|
+
for (let w = 0; w < r.length; w++) {
|
|
174
174
|
const {
|
|
175
|
-
name:
|
|
175
|
+
name: g,
|
|
176
176
|
fn: b
|
|
177
|
-
} = r[
|
|
178
|
-
x:
|
|
179
|
-
y,
|
|
180
|
-
data:
|
|
181
|
-
reset:
|
|
177
|
+
} = r[w], {
|
|
178
|
+
x: y,
|
|
179
|
+
y: x,
|
|
180
|
+
data: A,
|
|
181
|
+
reset: S
|
|
182
182
|
} = await b({
|
|
183
|
-
x:
|
|
184
|
-
y:
|
|
185
|
-
initialPlacement:
|
|
186
|
-
placement:
|
|
187
|
-
strategy:
|
|
188
|
-
middlewareData:
|
|
189
|
-
rects:
|
|
183
|
+
x: c,
|
|
184
|
+
y: m,
|
|
185
|
+
initialPlacement: o,
|
|
186
|
+
placement: p,
|
|
187
|
+
strategy: l,
|
|
188
|
+
middlewareData: h,
|
|
189
|
+
rects: d,
|
|
190
190
|
platform: n,
|
|
191
191
|
elements: {
|
|
192
192
|
reference: i,
|
|
193
193
|
floating: e
|
|
194
194
|
}
|
|
195
195
|
});
|
|
196
|
-
|
|
197
|
-
...
|
|
198
|
-
[
|
|
199
|
-
...
|
|
200
|
-
...
|
|
196
|
+
c = y ?? c, m = x ?? m, h = {
|
|
197
|
+
...h,
|
|
198
|
+
[g]: {
|
|
199
|
+
...h[g],
|
|
200
|
+
...A
|
|
201
201
|
}
|
|
202
|
-
},
|
|
202
|
+
}, S && f <= 50 && (f++, typeof S == "object" && (S.placement && (p = S.placement), S.rects && (d = S.rects === !0 ? await n.getElementRects({
|
|
203
203
|
reference: i,
|
|
204
204
|
floating: e,
|
|
205
|
-
strategy:
|
|
206
|
-
}) :
|
|
207
|
-
x:
|
|
208
|
-
y:
|
|
209
|
-
} =
|
|
205
|
+
strategy: l
|
|
206
|
+
}) : S.rects), {
|
|
207
|
+
x: c,
|
|
208
|
+
y: m
|
|
209
|
+
} = De(d, p, a)), w = -1);
|
|
210
210
|
}
|
|
211
211
|
return {
|
|
212
|
-
x:
|
|
213
|
-
y:
|
|
214
|
-
placement:
|
|
215
|
-
strategy:
|
|
216
|
-
middlewareData:
|
|
212
|
+
x: c,
|
|
213
|
+
y: m,
|
|
214
|
+
placement: p,
|
|
215
|
+
strategy: l,
|
|
216
|
+
middlewareData: h
|
|
217
217
|
};
|
|
218
218
|
};
|
|
219
|
-
async function
|
|
219
|
+
async function Ue(i, e) {
|
|
220
220
|
var t;
|
|
221
221
|
e === void 0 && (e = {});
|
|
222
222
|
const {
|
|
223
|
-
x:
|
|
224
|
-
y:
|
|
223
|
+
x: o,
|
|
224
|
+
y: l,
|
|
225
225
|
platform: s,
|
|
226
226
|
rects: n,
|
|
227
227
|
elements: r,
|
|
228
228
|
strategy: a
|
|
229
229
|
} = i, {
|
|
230
|
-
boundary:
|
|
231
|
-
rootBoundary:
|
|
232
|
-
elementContext:
|
|
233
|
-
altBoundary:
|
|
234
|
-
padding:
|
|
235
|
-
} =
|
|
236
|
-
element: (t = await (s.isElement == null ? void 0 : s.isElement(
|
|
237
|
-
boundary:
|
|
238
|
-
rootBoundary:
|
|
230
|
+
boundary: d = "clippingAncestors",
|
|
231
|
+
rootBoundary: c = "viewport",
|
|
232
|
+
elementContext: m = "floating",
|
|
233
|
+
altBoundary: p = !1,
|
|
234
|
+
padding: h = 0
|
|
235
|
+
} = me(e, i), f = yt(h), g = r[p ? m === "floating" ? "reference" : "floating" : m], b = pe(await s.getClippingRect({
|
|
236
|
+
element: (t = await (s.isElement == null ? void 0 : s.isElement(g))) == null || t ? g : g.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(r.floating)),
|
|
237
|
+
boundary: d,
|
|
238
|
+
rootBoundary: c,
|
|
239
239
|
strategy: a
|
|
240
|
-
})),
|
|
241
|
-
x:
|
|
242
|
-
y:
|
|
240
|
+
})), y = m === "floating" ? {
|
|
241
|
+
x: o,
|
|
242
|
+
y: l,
|
|
243
243
|
width: n.floating.width,
|
|
244
244
|
height: n.floating.height
|
|
245
|
-
} : n.reference,
|
|
245
|
+
} : n.reference, x = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(r.floating)), A = await (s.isElement == null ? void 0 : s.isElement(x)) ? await (s.getScale == null ? void 0 : s.getScale(x)) || {
|
|
246
246
|
x: 1,
|
|
247
247
|
y: 1
|
|
248
248
|
} : {
|
|
249
249
|
x: 1,
|
|
250
250
|
y: 1
|
|
251
|
-
},
|
|
251
|
+
}, S = pe(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
252
252
|
elements: r,
|
|
253
|
-
rect:
|
|
254
|
-
offsetParent:
|
|
253
|
+
rect: y,
|
|
254
|
+
offsetParent: x,
|
|
255
255
|
strategy: a
|
|
256
|
-
}) :
|
|
256
|
+
}) : y);
|
|
257
257
|
return {
|
|
258
|
-
top: (b.top -
|
|
259
|
-
bottom: (
|
|
260
|
-
left: (b.left -
|
|
261
|
-
right: (
|
|
258
|
+
top: (b.top - S.top + f.top) / A.y,
|
|
259
|
+
bottom: (S.bottom - b.bottom + f.bottom) / A.y,
|
|
260
|
+
left: (b.left - S.left + f.left) / A.x,
|
|
261
|
+
right: (S.right - b.right + f.right) / A.x
|
|
262
262
|
};
|
|
263
263
|
}
|
|
264
|
-
const
|
|
264
|
+
const xt = function(i) {
|
|
265
265
|
return i === void 0 && (i = {}), {
|
|
266
266
|
name: "flip",
|
|
267
267
|
options: i,
|
|
268
268
|
async fn(e) {
|
|
269
|
-
var t,
|
|
269
|
+
var t, o;
|
|
270
270
|
const {
|
|
271
|
-
placement:
|
|
271
|
+
placement: l,
|
|
272
272
|
middlewareData: s,
|
|
273
273
|
rects: n,
|
|
274
274
|
initialPlacement: r,
|
|
275
275
|
platform: a,
|
|
276
|
-
elements:
|
|
276
|
+
elements: d
|
|
277
277
|
} = e, {
|
|
278
|
-
mainAxis:
|
|
279
|
-
crossAxis:
|
|
280
|
-
fallbackPlacements:
|
|
281
|
-
fallbackStrategy:
|
|
282
|
-
fallbackAxisSideDirection:
|
|
283
|
-
flipAlignment:
|
|
284
|
-
...
|
|
285
|
-
} =
|
|
278
|
+
mainAxis: c = !0,
|
|
279
|
+
crossAxis: m = !0,
|
|
280
|
+
fallbackPlacements: p,
|
|
281
|
+
fallbackStrategy: h = "bestFit",
|
|
282
|
+
fallbackAxisSideDirection: f = "none",
|
|
283
|
+
flipAlignment: w = !0,
|
|
284
|
+
...g
|
|
285
|
+
} = me(i, e);
|
|
286
286
|
if ((t = s.arrow) != null && t.alignmentOffset)
|
|
287
287
|
return {};
|
|
288
|
-
const b =
|
|
289
|
-
!
|
|
290
|
-
const
|
|
291
|
-
let
|
|
292
|
-
if (
|
|
293
|
-
const
|
|
294
|
-
|
|
288
|
+
const b = W(l), y = z(r), x = W(r) === r, A = await (a.isRTL == null ? void 0 : a.isRTL(d.floating)), S = p || (x || !w ? [de(r)] : ut(r)), X = f !== "none";
|
|
289
|
+
!p && X && S.push(...vt(r, w, f, A));
|
|
290
|
+
const G = [r, ...S], we = await Ue(e, g), ie = [];
|
|
291
|
+
let U = ((o = s.flip) == null ? void 0 : o.overflows) || [];
|
|
292
|
+
if (c && ie.push(we[b]), m) {
|
|
293
|
+
const R = mt(l, n, A);
|
|
294
|
+
ie.push(we[R[0]], we[R[1]]);
|
|
295
295
|
}
|
|
296
|
-
if (
|
|
297
|
-
placement:
|
|
298
|
-
overflows:
|
|
299
|
-
}], !
|
|
300
|
-
var
|
|
301
|
-
const
|
|
302
|
-
if (
|
|
296
|
+
if (U = [...U, {
|
|
297
|
+
placement: l,
|
|
298
|
+
overflows: ie
|
|
299
|
+
}], !ie.every((R) => R <= 0)) {
|
|
300
|
+
var Ee, Me;
|
|
301
|
+
const R = (((Ee = s.flip) == null ? void 0 : Ee.index) || 0) + 1, ye = G[R];
|
|
302
|
+
if (ye && (!(m === "alignment" ? y !== z(ye) : !1) || // We leave the current main axis only if every placement on that axis
|
|
303
303
|
// overflows the main axis.
|
|
304
|
-
|
|
304
|
+
U.every((I) => z(I.placement) === y ? I.overflows[0] > 0 : !0)))
|
|
305
305
|
return {
|
|
306
306
|
data: {
|
|
307
|
-
index:
|
|
308
|
-
overflows:
|
|
307
|
+
index: R,
|
|
308
|
+
overflows: U
|
|
309
309
|
},
|
|
310
310
|
reset: {
|
|
311
|
-
placement:
|
|
311
|
+
placement: ye
|
|
312
312
|
}
|
|
313
313
|
};
|
|
314
|
-
let
|
|
315
|
-
if (!
|
|
316
|
-
switch (
|
|
314
|
+
let q = (Me = U.filter((F) => F.overflows[0] <= 0).sort((F, I) => F.overflows[1] - I.overflows[1])[0]) == null ? void 0 : Me.placement;
|
|
315
|
+
if (!q)
|
|
316
|
+
switch (h) {
|
|
317
317
|
case "bestFit": {
|
|
318
|
-
var
|
|
319
|
-
const
|
|
320
|
-
if (
|
|
321
|
-
const
|
|
322
|
-
return
|
|
318
|
+
var Le;
|
|
319
|
+
const F = (Le = U.filter((I) => {
|
|
320
|
+
if (X) {
|
|
321
|
+
const $ = z(I.placement);
|
|
322
|
+
return $ === y || // Create a bias to the `y` side axis due to horizontal
|
|
323
323
|
// reading directions favoring greater width.
|
|
324
|
-
|
|
324
|
+
$ === "y";
|
|
325
325
|
}
|
|
326
326
|
return !0;
|
|
327
|
-
}).map((
|
|
328
|
-
|
|
327
|
+
}).map((I) => [I.placement, I.overflows.filter(($) => $ > 0).reduce(($, rt) => $ + rt, 0)]).sort((I, $) => I[1] - $[1])[0]) == null ? void 0 : Le[0];
|
|
328
|
+
F && (q = F);
|
|
329
329
|
break;
|
|
330
330
|
}
|
|
331
331
|
case "initialPlacement":
|
|
332
|
-
|
|
332
|
+
q = r;
|
|
333
333
|
break;
|
|
334
334
|
}
|
|
335
|
-
if (
|
|
335
|
+
if (l !== q)
|
|
336
336
|
return {
|
|
337
337
|
reset: {
|
|
338
|
-
placement:
|
|
338
|
+
placement: q
|
|
339
339
|
}
|
|
340
340
|
};
|
|
341
341
|
}
|
|
342
342
|
return {};
|
|
343
343
|
}
|
|
344
344
|
};
|
|
345
|
-
},
|
|
346
|
-
async function
|
|
345
|
+
}, Ct = /* @__PURE__ */ new Set(["left", "top"]);
|
|
346
|
+
async function kt(i, e) {
|
|
347
347
|
const {
|
|
348
348
|
placement: t,
|
|
349
|
-
platform:
|
|
350
|
-
elements:
|
|
351
|
-
} = i, s = await (
|
|
349
|
+
platform: o,
|
|
350
|
+
elements: l
|
|
351
|
+
} = i, s = await (o.isRTL == null ? void 0 : o.isRTL(l.floating)), n = W(t), r = ue(t), a = z(t) === "y", d = Ct.has(n) ? -1 : 1, c = s && a ? -1 : 1, m = me(e, i);
|
|
352
352
|
let {
|
|
353
|
+
mainAxis: p,
|
|
354
|
+
crossAxis: h,
|
|
355
|
+
alignmentAxis: f
|
|
356
|
+
} = typeof m == "number" ? {
|
|
353
357
|
mainAxis: m,
|
|
354
|
-
crossAxis: u,
|
|
355
|
-
alignmentAxis: g
|
|
356
|
-
} = typeof d == "number" ? {
|
|
357
|
-
mainAxis: d,
|
|
358
358
|
crossAxis: 0,
|
|
359
359
|
alignmentAxis: null
|
|
360
360
|
} : {
|
|
361
|
-
mainAxis:
|
|
362
|
-
crossAxis:
|
|
363
|
-
alignmentAxis:
|
|
361
|
+
mainAxis: m.mainAxis || 0,
|
|
362
|
+
crossAxis: m.crossAxis || 0,
|
|
363
|
+
alignmentAxis: m.alignmentAxis
|
|
364
364
|
};
|
|
365
|
-
return r && typeof
|
|
366
|
-
x:
|
|
367
|
-
y:
|
|
365
|
+
return r && typeof f == "number" && (h = r === "end" ? f * -1 : f), a ? {
|
|
366
|
+
x: h * c,
|
|
367
|
+
y: p * d
|
|
368
368
|
} : {
|
|
369
|
-
x:
|
|
370
|
-
y:
|
|
369
|
+
x: p * d,
|
|
370
|
+
y: h * c
|
|
371
371
|
};
|
|
372
372
|
}
|
|
373
|
-
const
|
|
373
|
+
const St = function(i) {
|
|
374
374
|
return i === void 0 && (i = 0), {
|
|
375
375
|
name: "offset",
|
|
376
376
|
options: i,
|
|
377
377
|
async fn(e) {
|
|
378
|
-
var t,
|
|
378
|
+
var t, o;
|
|
379
379
|
const {
|
|
380
|
-
x:
|
|
380
|
+
x: l,
|
|
381
381
|
y: s,
|
|
382
382
|
placement: n,
|
|
383
383
|
middlewareData: r
|
|
384
|
-
} = e, a = await
|
|
385
|
-
return n === ((t = r.offset) == null ? void 0 : t.placement) && (
|
|
386
|
-
x:
|
|
384
|
+
} = e, a = await kt(e, i);
|
|
385
|
+
return n === ((t = r.offset) == null ? void 0 : t.placement) && (o = r.arrow) != null && o.alignmentOffset ? {} : {
|
|
386
|
+
x: l + a.x,
|
|
387
387
|
y: s + a.y,
|
|
388
388
|
data: {
|
|
389
389
|
...a,
|
|
@@ -392,106 +392,106 @@ const dt = function(i) {
|
|
|
392
392
|
};
|
|
393
393
|
}
|
|
394
394
|
};
|
|
395
|
-
},
|
|
395
|
+
}, At = function(i) {
|
|
396
396
|
return i === void 0 && (i = {}), {
|
|
397
397
|
name: "shift",
|
|
398
398
|
options: i,
|
|
399
399
|
async fn(e) {
|
|
400
400
|
const {
|
|
401
401
|
x: t,
|
|
402
|
-
y:
|
|
403
|
-
placement:
|
|
402
|
+
y: o,
|
|
403
|
+
placement: l
|
|
404
404
|
} = e, {
|
|
405
405
|
mainAxis: s = !0,
|
|
406
406
|
crossAxis: n = !1,
|
|
407
407
|
limiter: r = {
|
|
408
|
-
fn: (
|
|
408
|
+
fn: (g) => {
|
|
409
409
|
let {
|
|
410
410
|
x: b,
|
|
411
|
-
y
|
|
412
|
-
} =
|
|
411
|
+
y
|
|
412
|
+
} = g;
|
|
413
413
|
return {
|
|
414
414
|
x: b,
|
|
415
|
-
y
|
|
415
|
+
y
|
|
416
416
|
};
|
|
417
417
|
}
|
|
418
418
|
},
|
|
419
419
|
...a
|
|
420
|
-
} =
|
|
420
|
+
} = me(i, e), d = {
|
|
421
421
|
x: t,
|
|
422
|
-
y:
|
|
423
|
-
},
|
|
424
|
-
let
|
|
422
|
+
y: o
|
|
423
|
+
}, c = await Ue(e, a), m = z(W(l)), p = We(m);
|
|
424
|
+
let h = d[p], f = d[m];
|
|
425
425
|
if (s) {
|
|
426
|
-
const
|
|
427
|
-
|
|
426
|
+
const g = p === "y" ? "top" : "left", b = p === "y" ? "bottom" : "right", y = h + c[g], x = h - c[b];
|
|
427
|
+
h = Ve(y, h, x);
|
|
428
428
|
}
|
|
429
429
|
if (n) {
|
|
430
|
-
const
|
|
431
|
-
|
|
430
|
+
const g = m === "y" ? "top" : "left", b = m === "y" ? "bottom" : "right", y = f + c[g], x = f - c[b];
|
|
431
|
+
f = Ve(y, f, x);
|
|
432
432
|
}
|
|
433
|
-
const
|
|
433
|
+
const w = r.fn({
|
|
434
434
|
...e,
|
|
435
|
-
[
|
|
436
|
-
[
|
|
435
|
+
[p]: h,
|
|
436
|
+
[m]: f
|
|
437
437
|
});
|
|
438
438
|
return {
|
|
439
|
-
...
|
|
439
|
+
...w,
|
|
440
440
|
data: {
|
|
441
|
-
x:
|
|
442
|
-
y:
|
|
441
|
+
x: w.x - t,
|
|
442
|
+
y: w.y - o,
|
|
443
443
|
enabled: {
|
|
444
|
-
[
|
|
445
|
-
[
|
|
444
|
+
[p]: s,
|
|
445
|
+
[m]: n
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
448
|
};
|
|
449
449
|
}
|
|
450
450
|
};
|
|
451
451
|
};
|
|
452
|
-
function
|
|
452
|
+
function fe() {
|
|
453
453
|
return typeof window < "u";
|
|
454
454
|
}
|
|
455
|
-
function
|
|
456
|
-
return
|
|
455
|
+
function J(i) {
|
|
456
|
+
return Ke(i) ? (i.nodeName || "").toLowerCase() : "#document";
|
|
457
457
|
}
|
|
458
|
-
function
|
|
458
|
+
function O(i) {
|
|
459
459
|
var e;
|
|
460
460
|
return (i == null || (e = i.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function V(i) {
|
|
463
463
|
var e;
|
|
464
|
-
return (e = (
|
|
465
|
-
}
|
|
466
|
-
function Le(i) {
|
|
467
|
-
return re() ? i instanceof Node || i instanceof k(i).Node : !1;
|
|
464
|
+
return (e = (Ke(i) ? i.ownerDocument : i.document) || window.document) == null ? void 0 : e.documentElement;
|
|
468
465
|
}
|
|
469
|
-
function
|
|
470
|
-
return
|
|
466
|
+
function Ke(i) {
|
|
467
|
+
return fe() ? i instanceof Node || i instanceof O(i).Node : !1;
|
|
471
468
|
}
|
|
472
469
|
function T(i) {
|
|
473
|
-
return
|
|
470
|
+
return fe() ? i instanceof Element || i instanceof O(i).Element : !1;
|
|
474
471
|
}
|
|
475
|
-
function
|
|
476
|
-
return
|
|
472
|
+
function L(i) {
|
|
473
|
+
return fe() ? i instanceof HTMLElement || i instanceof O(i).HTMLElement : !1;
|
|
477
474
|
}
|
|
478
|
-
|
|
479
|
-
|
|
475
|
+
function Re(i) {
|
|
476
|
+
return !fe() || typeof ShadowRoot > "u" ? !1 : i instanceof ShadowRoot || i instanceof O(i).ShadowRoot;
|
|
477
|
+
}
|
|
478
|
+
const Ot = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
479
|
+
function te(i) {
|
|
480
480
|
const {
|
|
481
481
|
overflow: e,
|
|
482
482
|
overflowX: t,
|
|
483
|
-
overflowY:
|
|
484
|
-
display:
|
|
485
|
-
} =
|
|
486
|
-
return /auto|scroll|overlay|hidden|clip/.test(e +
|
|
487
|
-
}
|
|
488
|
-
const
|
|
489
|
-
function
|
|
490
|
-
return
|
|
491
|
-
}
|
|
492
|
-
const
|
|
493
|
-
function
|
|
494
|
-
return
|
|
483
|
+
overflowY: o,
|
|
484
|
+
display: l
|
|
485
|
+
} = E(i);
|
|
486
|
+
return /auto|scroll|overlay|hidden|clip/.test(e + o + t) && !Ot.has(l);
|
|
487
|
+
}
|
|
488
|
+
const It = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
489
|
+
function Pt(i) {
|
|
490
|
+
return It.has(J(i));
|
|
491
|
+
}
|
|
492
|
+
const Tt = [":popover-open", ":modal"];
|
|
493
|
+
function ge(i) {
|
|
494
|
+
return Tt.some((e) => {
|
|
495
495
|
try {
|
|
496
496
|
return i.matches(e);
|
|
497
497
|
} catch {
|
|
@@ -499,34 +499,34 @@ function ae(i) {
|
|
|
499
499
|
}
|
|
500
500
|
});
|
|
501
501
|
}
|
|
502
|
-
const
|
|
503
|
-
function
|
|
504
|
-
const e =
|
|
505
|
-
return
|
|
502
|
+
const Et = ["transform", "translate", "scale", "rotate", "perspective"], Mt = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Lt = ["paint", "layout", "strict", "content"];
|
|
503
|
+
function Oe(i) {
|
|
504
|
+
const e = Ie(), t = T(i) ? E(i) : i;
|
|
505
|
+
return Et.some((o) => t[o] ? t[o] !== "none" : !1) || (t.containerType ? t.containerType !== "normal" : !1) || !e && (t.backdropFilter ? t.backdropFilter !== "none" : !1) || !e && (t.filter ? t.filter !== "none" : !1) || Mt.some((o) => (t.willChange || "").includes(o)) || Lt.some((o) => (t.contain || "").includes(o));
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function Vt(i) {
|
|
508
508
|
let e = D(i);
|
|
509
|
-
for (;
|
|
510
|
-
if (
|
|
509
|
+
for (; L(e) && !Y(e); ) {
|
|
510
|
+
if (Oe(e))
|
|
511
511
|
return e;
|
|
512
|
-
if (
|
|
512
|
+
if (ge(e))
|
|
513
513
|
return null;
|
|
514
514
|
e = D(e);
|
|
515
515
|
}
|
|
516
516
|
return null;
|
|
517
517
|
}
|
|
518
|
-
function
|
|
518
|
+
function Ie() {
|
|
519
519
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
520
520
|
}
|
|
521
|
-
const
|
|
522
|
-
function
|
|
523
|
-
return
|
|
521
|
+
const $t = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
522
|
+
function Y(i) {
|
|
523
|
+
return $t.has(J(i));
|
|
524
524
|
}
|
|
525
|
-
function
|
|
526
|
-
return
|
|
525
|
+
function E(i) {
|
|
526
|
+
return O(i).getComputedStyle(i);
|
|
527
527
|
}
|
|
528
|
-
function
|
|
529
|
-
return
|
|
528
|
+
function be(i) {
|
|
529
|
+
return T(i) ? {
|
|
530
530
|
scrollLeft: i.scrollLeft,
|
|
531
531
|
scrollTop: i.scrollTop
|
|
532
532
|
} : {
|
|
@@ -535,161 +535,161 @@ function ce(i) {
|
|
|
535
535
|
};
|
|
536
536
|
}
|
|
537
537
|
function D(i) {
|
|
538
|
-
if (
|
|
538
|
+
if (J(i) === "html")
|
|
539
539
|
return i;
|
|
540
540
|
const e = (
|
|
541
541
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
542
542
|
i.assignedSlot || // DOM Element detected.
|
|
543
543
|
i.parentNode || // ShadowRoot detected.
|
|
544
|
-
|
|
545
|
-
|
|
544
|
+
Re(i) && i.host || // Fallback.
|
|
545
|
+
V(i)
|
|
546
546
|
);
|
|
547
|
-
return
|
|
547
|
+
return Re(e) ? e.host : e;
|
|
548
548
|
}
|
|
549
|
-
function
|
|
549
|
+
function Ye(i) {
|
|
550
550
|
const e = D(i);
|
|
551
|
-
return
|
|
551
|
+
return Y(e) ? i.ownerDocument ? i.ownerDocument.body : i.body : L(e) && te(e) ? e : Ye(e);
|
|
552
552
|
}
|
|
553
|
-
function
|
|
554
|
-
var
|
|
553
|
+
function Q(i, e, t) {
|
|
554
|
+
var o;
|
|
555
555
|
e === void 0 && (e = []), t === void 0 && (t = !0);
|
|
556
|
-
const
|
|
556
|
+
const l = Ye(i), s = l === ((o = i.ownerDocument) == null ? void 0 : o.body), n = O(l);
|
|
557
557
|
if (s) {
|
|
558
|
-
const r =
|
|
559
|
-
return e.concat(n, n.visualViewport || [],
|
|
558
|
+
const r = ke(n);
|
|
559
|
+
return e.concat(n, n.visualViewport || [], te(l) ? l : [], r && t ? Q(r) : []);
|
|
560
560
|
}
|
|
561
|
-
return e.concat(
|
|
561
|
+
return e.concat(l, Q(l, [], t));
|
|
562
562
|
}
|
|
563
|
-
function
|
|
563
|
+
function ke(i) {
|
|
564
564
|
return i.parent && Object.getPrototypeOf(i.parent) ? i.frameElement : null;
|
|
565
565
|
}
|
|
566
|
-
function
|
|
567
|
-
const e =
|
|
568
|
-
let t = parseFloat(e.width) || 0,
|
|
569
|
-
const
|
|
570
|
-
return r && (t = s,
|
|
566
|
+
function Je(i) {
|
|
567
|
+
const e = E(i);
|
|
568
|
+
let t = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
|
|
569
|
+
const l = L(i), s = l ? i.offsetWidth : t, n = l ? i.offsetHeight : o, r = ce(t) !== s || ce(o) !== n;
|
|
570
|
+
return r && (t = s, o = n), {
|
|
571
571
|
width: t,
|
|
572
|
-
height:
|
|
572
|
+
height: o,
|
|
573
573
|
$: r
|
|
574
574
|
};
|
|
575
575
|
}
|
|
576
|
-
function
|
|
577
|
-
return
|
|
576
|
+
function Pe(i) {
|
|
577
|
+
return T(i) ? i : i.contextElement;
|
|
578
578
|
}
|
|
579
|
-
function
|
|
580
|
-
const e =
|
|
581
|
-
if (!
|
|
582
|
-
return
|
|
579
|
+
function K(i) {
|
|
580
|
+
const e = Pe(i);
|
|
581
|
+
if (!L(e))
|
|
582
|
+
return M(1);
|
|
583
583
|
const t = e.getBoundingClientRect(), {
|
|
584
|
-
width:
|
|
585
|
-
height:
|
|
584
|
+
width: o,
|
|
585
|
+
height: l,
|
|
586
586
|
$: s
|
|
587
|
-
} =
|
|
588
|
-
let n = (s ?
|
|
587
|
+
} = Je(e);
|
|
588
|
+
let n = (s ? ce(t.width) : t.width) / o, r = (s ? ce(t.height) : t.height) / l;
|
|
589
589
|
return (!n || !Number.isFinite(n)) && (n = 1), (!r || !Number.isFinite(r)) && (r = 1), {
|
|
590
590
|
x: n,
|
|
591
591
|
y: r
|
|
592
592
|
};
|
|
593
593
|
}
|
|
594
|
-
const
|
|
595
|
-
function
|
|
596
|
-
const e =
|
|
597
|
-
return !
|
|
594
|
+
const zt = /* @__PURE__ */ M(0);
|
|
595
|
+
function Xe(i) {
|
|
596
|
+
const e = O(i);
|
|
597
|
+
return !Ie() || !e.visualViewport ? zt : {
|
|
598
598
|
x: e.visualViewport.offsetLeft,
|
|
599
599
|
y: e.visualViewport.offsetTop
|
|
600
600
|
};
|
|
601
601
|
}
|
|
602
|
-
function
|
|
603
|
-
return e === void 0 && (e = !1), !t || e && t !==
|
|
602
|
+
function Dt(i, e, t) {
|
|
603
|
+
return e === void 0 && (e = !1), !t || e && t !== O(i) ? !1 : e;
|
|
604
604
|
}
|
|
605
|
-
function
|
|
605
|
+
function j(i, e, t, o) {
|
|
606
606
|
e === void 0 && (e = !1), t === void 0 && (t = !1);
|
|
607
|
-
const
|
|
608
|
-
let n =
|
|
609
|
-
e && (
|
|
610
|
-
const r =
|
|
611
|
-
let a = (
|
|
607
|
+
const l = i.getBoundingClientRect(), s = Pe(i);
|
|
608
|
+
let n = M(1);
|
|
609
|
+
e && (o ? T(o) && (n = K(o)) : n = K(i));
|
|
610
|
+
const r = Dt(s, t, o) ? Xe(s) : M(0);
|
|
611
|
+
let a = (l.left + r.x) / n.x, d = (l.top + r.y) / n.y, c = l.width / n.x, m = l.height / n.y;
|
|
612
612
|
if (s) {
|
|
613
|
-
const
|
|
614
|
-
let
|
|
615
|
-
for (;
|
|
616
|
-
const
|
|
617
|
-
a *=
|
|
613
|
+
const p = O(s), h = o && T(o) ? O(o) : o;
|
|
614
|
+
let f = p, w = ke(f);
|
|
615
|
+
for (; w && o && h !== f; ) {
|
|
616
|
+
const g = K(w), b = w.getBoundingClientRect(), y = E(w), x = b.left + (w.clientLeft + parseFloat(y.paddingLeft)) * g.x, A = b.top + (w.clientTop + parseFloat(y.paddingTop)) * g.y;
|
|
617
|
+
a *= g.x, d *= g.y, c *= g.x, m *= g.y, a += x, d += A, f = O(w), w = ke(f);
|
|
618
618
|
}
|
|
619
619
|
}
|
|
620
|
-
return
|
|
621
|
-
width:
|
|
622
|
-
height:
|
|
620
|
+
return pe({
|
|
621
|
+
width: c,
|
|
622
|
+
height: m,
|
|
623
623
|
x: a,
|
|
624
|
-
y:
|
|
624
|
+
y: d
|
|
625
625
|
});
|
|
626
626
|
}
|
|
627
|
-
function
|
|
628
|
-
const t =
|
|
629
|
-
return e ? e.left + t :
|
|
627
|
+
function ve(i, e) {
|
|
628
|
+
const t = be(i).scrollLeft;
|
|
629
|
+
return e ? e.left + t : j(V(i)).left + t;
|
|
630
630
|
}
|
|
631
|
-
function
|
|
632
|
-
const t = i.getBoundingClientRect(),
|
|
631
|
+
function qe(i, e) {
|
|
632
|
+
const t = i.getBoundingClientRect(), o = t.left + e.scrollLeft - ve(i, t), l = t.top + e.scrollTop;
|
|
633
633
|
return {
|
|
634
|
-
x:
|
|
635
|
-
y:
|
|
634
|
+
x: o,
|
|
635
|
+
y: l
|
|
636
636
|
};
|
|
637
637
|
}
|
|
638
|
-
function
|
|
638
|
+
function Rt(i) {
|
|
639
639
|
let {
|
|
640
640
|
elements: e,
|
|
641
641
|
rect: t,
|
|
642
|
-
offsetParent:
|
|
643
|
-
strategy:
|
|
642
|
+
offsetParent: o,
|
|
643
|
+
strategy: l
|
|
644
644
|
} = i;
|
|
645
|
-
const s =
|
|
646
|
-
if (
|
|
645
|
+
const s = l === "fixed", n = V(o), r = e ? ge(e.floating) : !1;
|
|
646
|
+
if (o === n || r && s)
|
|
647
647
|
return t;
|
|
648
648
|
let a = {
|
|
649
649
|
scrollLeft: 0,
|
|
650
650
|
scrollTop: 0
|
|
651
|
-
},
|
|
652
|
-
const
|
|
653
|
-
if ((
|
|
654
|
-
const
|
|
655
|
-
|
|
651
|
+
}, d = M(1);
|
|
652
|
+
const c = M(0), m = L(o);
|
|
653
|
+
if ((m || !m && !s) && ((J(o) !== "body" || te(n)) && (a = be(o)), L(o))) {
|
|
654
|
+
const h = j(o);
|
|
655
|
+
d = K(o), c.x = h.x + o.clientLeft, c.y = h.y + o.clientTop;
|
|
656
656
|
}
|
|
657
|
-
const
|
|
657
|
+
const p = n && !m && !s ? qe(n, a) : M(0);
|
|
658
658
|
return {
|
|
659
|
-
width: t.width *
|
|
660
|
-
height: t.height *
|
|
661
|
-
x: t.x *
|
|
662
|
-
y: t.y *
|
|
659
|
+
width: t.width * d.x,
|
|
660
|
+
height: t.height * d.y,
|
|
661
|
+
x: t.x * d.x - a.scrollLeft * d.x + c.x + p.x,
|
|
662
|
+
y: t.y * d.y - a.scrollTop * d.y + c.y + p.y
|
|
663
663
|
};
|
|
664
664
|
}
|
|
665
|
-
function
|
|
665
|
+
function Ft(i) {
|
|
666
666
|
return Array.from(i.getClientRects());
|
|
667
667
|
}
|
|
668
|
-
function
|
|
669
|
-
const e =
|
|
670
|
-
let n = -t.scrollLeft +
|
|
668
|
+
function Nt(i) {
|
|
669
|
+
const e = V(i), t = be(i), o = i.ownerDocument.body, l = B(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), s = B(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
|
|
670
|
+
let n = -t.scrollLeft + ve(i);
|
|
671
671
|
const r = -t.scrollTop;
|
|
672
|
-
return
|
|
673
|
-
width:
|
|
672
|
+
return E(o).direction === "rtl" && (n += B(e.clientWidth, o.clientWidth) - l), {
|
|
673
|
+
width: l,
|
|
674
674
|
height: s,
|
|
675
675
|
x: n,
|
|
676
676
|
y: r
|
|
677
677
|
};
|
|
678
678
|
}
|
|
679
|
-
const
|
|
680
|
-
function
|
|
681
|
-
const t =
|
|
682
|
-
let s =
|
|
683
|
-
if (
|
|
684
|
-
s =
|
|
685
|
-
const
|
|
686
|
-
(!
|
|
687
|
-
}
|
|
688
|
-
const
|
|
689
|
-
if (
|
|
690
|
-
const
|
|
691
|
-
|
|
692
|
-
} else
|
|
679
|
+
const Fe = 25;
|
|
680
|
+
function Ht(i, e) {
|
|
681
|
+
const t = O(i), o = V(i), l = t.visualViewport;
|
|
682
|
+
let s = o.clientWidth, n = o.clientHeight, r = 0, a = 0;
|
|
683
|
+
if (l) {
|
|
684
|
+
s = l.width, n = l.height;
|
|
685
|
+
const c = Ie();
|
|
686
|
+
(!c || c && e === "fixed") && (r = l.offsetLeft, a = l.offsetTop);
|
|
687
|
+
}
|
|
688
|
+
const d = ve(o);
|
|
689
|
+
if (d <= 0) {
|
|
690
|
+
const c = o.ownerDocument, m = c.body, p = getComputedStyle(m), h = c.compatMode === "CSS1Compat" && parseFloat(p.marginLeft) + parseFloat(p.marginRight) || 0, f = Math.abs(o.clientWidth - m.clientWidth - h);
|
|
691
|
+
f <= Fe && (s -= f);
|
|
692
|
+
} else d <= Fe && (s += d);
|
|
693
693
|
return {
|
|
694
694
|
width: s,
|
|
695
695
|
height: n,
|
|
@@ -697,63 +697,63 @@ function At(i, e) {
|
|
|
697
697
|
y: a
|
|
698
698
|
};
|
|
699
699
|
}
|
|
700
|
-
const
|
|
701
|
-
function
|
|
702
|
-
const t =
|
|
700
|
+
const Bt = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
701
|
+
function Wt(i, e) {
|
|
702
|
+
const t = j(i, !0, e === "fixed"), o = t.top + i.clientTop, l = t.left + i.clientLeft, s = L(i) ? K(i) : M(1), n = i.clientWidth * s.x, r = i.clientHeight * s.y, a = l * s.x, d = o * s.y;
|
|
703
703
|
return {
|
|
704
704
|
width: n,
|
|
705
705
|
height: r,
|
|
706
706
|
x: a,
|
|
707
|
-
y:
|
|
707
|
+
y: d
|
|
708
708
|
};
|
|
709
709
|
}
|
|
710
|
-
function
|
|
711
|
-
let
|
|
710
|
+
function Ne(i, e, t) {
|
|
711
|
+
let o;
|
|
712
712
|
if (e === "viewport")
|
|
713
|
-
|
|
713
|
+
o = Ht(i, t);
|
|
714
714
|
else if (e === "document")
|
|
715
|
-
|
|
716
|
-
else if (
|
|
717
|
-
|
|
715
|
+
o = Nt(V(i));
|
|
716
|
+
else if (T(e))
|
|
717
|
+
o = Wt(e, t);
|
|
718
718
|
else {
|
|
719
|
-
const
|
|
720
|
-
|
|
721
|
-
x: e.x -
|
|
722
|
-
y: e.y -
|
|
719
|
+
const l = Xe(i);
|
|
720
|
+
o = {
|
|
721
|
+
x: e.x - l.x,
|
|
722
|
+
y: e.y - l.y,
|
|
723
723
|
width: e.width,
|
|
724
724
|
height: e.height
|
|
725
725
|
};
|
|
726
726
|
}
|
|
727
|
-
return
|
|
727
|
+
return pe(o);
|
|
728
728
|
}
|
|
729
|
-
function
|
|
729
|
+
function Ze(i, e) {
|
|
730
730
|
const t = D(i);
|
|
731
|
-
return t === e || !
|
|
731
|
+
return t === e || !T(t) || Y(t) ? !1 : E(t).position === "fixed" || Ze(t, e);
|
|
732
732
|
}
|
|
733
|
-
function
|
|
733
|
+
function jt(i, e) {
|
|
734
734
|
const t = e.get(i);
|
|
735
735
|
if (t)
|
|
736
736
|
return t;
|
|
737
|
-
let
|
|
738
|
-
const s =
|
|
737
|
+
let o = Q(i, [], !1).filter((r) => T(r) && J(r) !== "body"), l = null;
|
|
738
|
+
const s = E(i).position === "fixed";
|
|
739
739
|
let n = s ? D(i) : i;
|
|
740
|
-
for (;
|
|
741
|
-
const r =
|
|
742
|
-
!a && r.position === "fixed" && (
|
|
740
|
+
for (; T(n) && !Y(n); ) {
|
|
741
|
+
const r = E(n), a = Oe(n);
|
|
742
|
+
!a && r.position === "fixed" && (l = null), (s ? !a && !l : !a && r.position === "static" && !!l && Bt.has(l.position) || te(n) && !a && Ze(i, n)) ? o = o.filter((c) => c !== n) : l = r, n = D(n);
|
|
743
743
|
}
|
|
744
|
-
return e.set(i,
|
|
744
|
+
return e.set(i, o), o;
|
|
745
745
|
}
|
|
746
|
-
function
|
|
746
|
+
function Gt(i) {
|
|
747
747
|
let {
|
|
748
748
|
element: e,
|
|
749
749
|
boundary: t,
|
|
750
|
-
rootBoundary:
|
|
751
|
-
strategy:
|
|
750
|
+
rootBoundary: o,
|
|
751
|
+
strategy: l
|
|
752
752
|
} = i;
|
|
753
|
-
const n = [...t === "clippingAncestors" ?
|
|
754
|
-
const
|
|
755
|
-
return
|
|
756
|
-
},
|
|
753
|
+
const n = [...t === "clippingAncestors" ? ge(e) ? [] : jt(e, this._c) : [].concat(t), o], r = n[0], a = n.reduce((d, c) => {
|
|
754
|
+
const m = Ne(e, c, l);
|
|
755
|
+
return d.top = B(m.top, d.top), d.right = ae(m.right, d.right), d.bottom = ae(m.bottom, d.bottom), d.left = B(m.left, d.left), d;
|
|
756
|
+
}, Ne(e, r, l));
|
|
757
757
|
return {
|
|
758
758
|
width: a.right - a.left,
|
|
759
759
|
height: a.bottom - a.top,
|
|
@@ -761,263 +761,633 @@ function It(i) {
|
|
|
761
761
|
y: a.top
|
|
762
762
|
};
|
|
763
763
|
}
|
|
764
|
-
function
|
|
764
|
+
function Ut(i) {
|
|
765
765
|
const {
|
|
766
766
|
width: e,
|
|
767
767
|
height: t
|
|
768
|
-
} =
|
|
768
|
+
} = Je(i);
|
|
769
769
|
return {
|
|
770
770
|
width: e,
|
|
771
771
|
height: t
|
|
772
772
|
};
|
|
773
773
|
}
|
|
774
|
-
function
|
|
775
|
-
const
|
|
774
|
+
function Kt(i, e, t) {
|
|
775
|
+
const o = L(e), l = V(e), s = t === "fixed", n = j(i, !0, s, e);
|
|
776
776
|
let r = {
|
|
777
777
|
scrollLeft: 0,
|
|
778
778
|
scrollTop: 0
|
|
779
779
|
};
|
|
780
|
-
const a =
|
|
781
|
-
function
|
|
782
|
-
a.x =
|
|
783
|
-
}
|
|
784
|
-
if (
|
|
785
|
-
if ((
|
|
786
|
-
const
|
|
787
|
-
a.x =
|
|
788
|
-
} else
|
|
789
|
-
s && !
|
|
790
|
-
const
|
|
780
|
+
const a = M(0);
|
|
781
|
+
function d() {
|
|
782
|
+
a.x = ve(l);
|
|
783
|
+
}
|
|
784
|
+
if (o || !o && !s)
|
|
785
|
+
if ((J(e) !== "body" || te(l)) && (r = be(e)), o) {
|
|
786
|
+
const h = j(e, !0, s, e);
|
|
787
|
+
a.x = h.x + e.clientLeft, a.y = h.y + e.clientTop;
|
|
788
|
+
} else l && d();
|
|
789
|
+
s && !o && l && d();
|
|
790
|
+
const c = l && !o && !s ? qe(l, r) : M(0), m = n.left + r.scrollLeft - a.x - c.x, p = n.top + r.scrollTop - a.y - c.y;
|
|
791
791
|
return {
|
|
792
|
-
x:
|
|
793
|
-
y:
|
|
792
|
+
x: m,
|
|
793
|
+
y: p,
|
|
794
794
|
width: n.width,
|
|
795
795
|
height: n.height
|
|
796
796
|
};
|
|
797
797
|
}
|
|
798
|
-
function
|
|
799
|
-
return
|
|
798
|
+
function _e(i) {
|
|
799
|
+
return E(i).position === "static";
|
|
800
800
|
}
|
|
801
|
-
function
|
|
802
|
-
if (!
|
|
801
|
+
function He(i, e) {
|
|
802
|
+
if (!L(i) || E(i).position === "fixed")
|
|
803
803
|
return null;
|
|
804
804
|
if (e)
|
|
805
805
|
return e(i);
|
|
806
806
|
let t = i.offsetParent;
|
|
807
|
-
return
|
|
807
|
+
return V(i) === t && (t = t.ownerDocument.body), t;
|
|
808
808
|
}
|
|
809
|
-
function
|
|
810
|
-
const t =
|
|
811
|
-
if (
|
|
809
|
+
function Qe(i, e) {
|
|
810
|
+
const t = O(i);
|
|
811
|
+
if (ge(i))
|
|
812
812
|
return t;
|
|
813
|
-
if (!
|
|
814
|
-
let
|
|
815
|
-
for (;
|
|
816
|
-
if (
|
|
817
|
-
return
|
|
818
|
-
|
|
813
|
+
if (!L(i)) {
|
|
814
|
+
let l = D(i);
|
|
815
|
+
for (; l && !Y(l); ) {
|
|
816
|
+
if (T(l) && !_e(l))
|
|
817
|
+
return l;
|
|
818
|
+
l = D(l);
|
|
819
819
|
}
|
|
820
820
|
return t;
|
|
821
821
|
}
|
|
822
|
-
let
|
|
823
|
-
for (;
|
|
824
|
-
|
|
825
|
-
return
|
|
822
|
+
let o = He(i, e);
|
|
823
|
+
for (; o && Pt(o) && _e(o); )
|
|
824
|
+
o = He(o, e);
|
|
825
|
+
return o && Y(o) && _e(o) && !Oe(o) ? t : o || Vt(i) || t;
|
|
826
826
|
}
|
|
827
|
-
const
|
|
828
|
-
const e = this.getOffsetParent ||
|
|
827
|
+
const Yt = async function(i) {
|
|
828
|
+
const e = this.getOffsetParent || Qe, t = this.getDimensions, o = await t(i.floating);
|
|
829
829
|
return {
|
|
830
|
-
reference:
|
|
830
|
+
reference: Kt(i.reference, await e(i.floating), i.strategy),
|
|
831
831
|
floating: {
|
|
832
832
|
x: 0,
|
|
833
833
|
y: 0,
|
|
834
|
-
width:
|
|
835
|
-
height:
|
|
834
|
+
width: o.width,
|
|
835
|
+
height: o.height
|
|
836
836
|
}
|
|
837
837
|
};
|
|
838
838
|
};
|
|
839
|
-
function
|
|
840
|
-
return
|
|
841
|
-
}
|
|
842
|
-
const
|
|
843
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
844
|
-
getDocumentElement:
|
|
845
|
-
getClippingRect:
|
|
846
|
-
getOffsetParent:
|
|
847
|
-
getElementRects:
|
|
848
|
-
getClientRects:
|
|
849
|
-
getDimensions:
|
|
850
|
-
getScale:
|
|
851
|
-
isElement:
|
|
852
|
-
isRTL:
|
|
839
|
+
function Jt(i) {
|
|
840
|
+
return E(i).direction === "rtl";
|
|
841
|
+
}
|
|
842
|
+
const Xt = {
|
|
843
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Rt,
|
|
844
|
+
getDocumentElement: V,
|
|
845
|
+
getClippingRect: Gt,
|
|
846
|
+
getOffsetParent: Qe,
|
|
847
|
+
getElementRects: Yt,
|
|
848
|
+
getClientRects: Ft,
|
|
849
|
+
getDimensions: Ut,
|
|
850
|
+
getScale: K,
|
|
851
|
+
isElement: T,
|
|
852
|
+
isRTL: Jt
|
|
853
853
|
};
|
|
854
|
-
function
|
|
854
|
+
function et(i, e) {
|
|
855
855
|
return i.x === e.x && i.y === e.y && i.width === e.width && i.height === e.height;
|
|
856
856
|
}
|
|
857
|
-
function
|
|
858
|
-
let t = null,
|
|
859
|
-
const
|
|
857
|
+
function qt(i, e) {
|
|
858
|
+
let t = null, o;
|
|
859
|
+
const l = V(i);
|
|
860
860
|
function s() {
|
|
861
861
|
var r;
|
|
862
|
-
clearTimeout(
|
|
862
|
+
clearTimeout(o), (r = t) == null || r.disconnect(), t = null;
|
|
863
863
|
}
|
|
864
864
|
function n(r, a) {
|
|
865
865
|
r === void 0 && (r = !1), a === void 0 && (a = 1), s();
|
|
866
|
-
const
|
|
867
|
-
left:
|
|
868
|
-
top:
|
|
869
|
-
width:
|
|
870
|
-
height:
|
|
871
|
-
} =
|
|
872
|
-
if (r || e(), !
|
|
866
|
+
const d = i.getBoundingClientRect(), {
|
|
867
|
+
left: c,
|
|
868
|
+
top: m,
|
|
869
|
+
width: p,
|
|
870
|
+
height: h
|
|
871
|
+
} = d;
|
|
872
|
+
if (r || e(), !p || !h)
|
|
873
873
|
return;
|
|
874
|
-
const
|
|
875
|
-
rootMargin: -
|
|
876
|
-
threshold:
|
|
874
|
+
const f = oe(m), w = oe(l.clientWidth - (c + p)), g = oe(l.clientHeight - (m + h)), b = oe(c), x = {
|
|
875
|
+
rootMargin: -f + "px " + -w + "px " + -g + "px " + -b + "px",
|
|
876
|
+
threshold: B(0, ae(1, a)) || 1
|
|
877
877
|
};
|
|
878
|
-
let
|
|
879
|
-
function
|
|
880
|
-
const
|
|
881
|
-
if (
|
|
882
|
-
if (!
|
|
878
|
+
let A = !0;
|
|
879
|
+
function S(X) {
|
|
880
|
+
const G = X[0].intersectionRatio;
|
|
881
|
+
if (G !== a) {
|
|
882
|
+
if (!A)
|
|
883
883
|
return n();
|
|
884
|
-
|
|
884
|
+
G ? n(!1, G) : o = setTimeout(() => {
|
|
885
885
|
n(!1, 1e-7);
|
|
886
886
|
}, 1e3);
|
|
887
887
|
}
|
|
888
|
-
|
|
888
|
+
G === 1 && !et(d, i.getBoundingClientRect()) && n(), A = !1;
|
|
889
889
|
}
|
|
890
890
|
try {
|
|
891
|
-
t = new IntersectionObserver(
|
|
892
|
-
...
|
|
891
|
+
t = new IntersectionObserver(S, {
|
|
892
|
+
...x,
|
|
893
893
|
// Handle <iframe>s
|
|
894
|
-
root:
|
|
894
|
+
root: l.ownerDocument
|
|
895
895
|
});
|
|
896
896
|
} catch {
|
|
897
|
-
t = new IntersectionObserver(
|
|
897
|
+
t = new IntersectionObserver(S, x);
|
|
898
898
|
}
|
|
899
899
|
t.observe(i);
|
|
900
900
|
}
|
|
901
901
|
return n(!0), s;
|
|
902
902
|
}
|
|
903
|
-
function
|
|
904
|
-
|
|
903
|
+
function le(i, e, t, o) {
|
|
904
|
+
o === void 0 && (o = {});
|
|
905
905
|
const {
|
|
906
|
-
ancestorScroll:
|
|
906
|
+
ancestorScroll: l = !0,
|
|
907
907
|
ancestorResize: s = !0,
|
|
908
908
|
elementResize: n = typeof ResizeObserver == "function",
|
|
909
909
|
layoutShift: r = typeof IntersectionObserver == "function",
|
|
910
910
|
animationFrame: a = !1
|
|
911
|
-
} =
|
|
912
|
-
|
|
913
|
-
|
|
911
|
+
} = o, d = Pe(i), c = l || s ? [...d ? Q(d) : [], ...Q(e)] : [];
|
|
912
|
+
c.forEach((b) => {
|
|
913
|
+
l && b.addEventListener("scroll", t, {
|
|
914
914
|
passive: !0
|
|
915
915
|
}), s && b.addEventListener("resize", t);
|
|
916
916
|
});
|
|
917
|
-
const
|
|
918
|
-
let
|
|
919
|
-
n && (
|
|
920
|
-
let [
|
|
921
|
-
|
|
922
|
-
var
|
|
923
|
-
(
|
|
917
|
+
const m = d && r ? qt(d, t) : null;
|
|
918
|
+
let p = -1, h = null;
|
|
919
|
+
n && (h = new ResizeObserver((b) => {
|
|
920
|
+
let [y] = b;
|
|
921
|
+
y && y.target === d && h && (h.unobserve(e), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
|
|
922
|
+
var x;
|
|
923
|
+
(x = h) == null || x.observe(e);
|
|
924
924
|
})), t();
|
|
925
|
-
}),
|
|
926
|
-
let
|
|
927
|
-
a &&
|
|
928
|
-
function
|
|
929
|
-
const b =
|
|
930
|
-
|
|
925
|
+
}), d && !a && h.observe(d), h.observe(e));
|
|
926
|
+
let f, w = a ? j(i) : null;
|
|
927
|
+
a && g();
|
|
928
|
+
function g() {
|
|
929
|
+
const b = j(i);
|
|
930
|
+
w && !et(w, b) && t(), w = b, f = requestAnimationFrame(g);
|
|
931
931
|
}
|
|
932
932
|
return t(), () => {
|
|
933
933
|
var b;
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
}),
|
|
934
|
+
c.forEach((y) => {
|
|
935
|
+
l && y.removeEventListener("scroll", t), s && y.removeEventListener("resize", t);
|
|
936
|
+
}), m == null || m(), (b = h) == null || b.disconnect(), h = null, a && cancelAnimationFrame(f);
|
|
937
937
|
};
|
|
938
938
|
}
|
|
939
|
-
const
|
|
940
|
-
const
|
|
941
|
-
platform:
|
|
939
|
+
const se = St, ne = At, xe = xt, re = (i, e, t) => {
|
|
940
|
+
const o = /* @__PURE__ */ new Map(), l = {
|
|
941
|
+
platform: Xt,
|
|
942
942
|
...t
|
|
943
943
|
}, s = {
|
|
944
|
-
...
|
|
945
|
-
_c:
|
|
944
|
+
...l.platform,
|
|
945
|
+
_c: o
|
|
946
946
|
};
|
|
947
|
-
return
|
|
948
|
-
...
|
|
947
|
+
return _t(i, e, {
|
|
948
|
+
...l,
|
|
949
949
|
platform: s
|
|
950
950
|
});
|
|
951
951
|
};
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
952
|
+
var tt = function() {
|
|
953
|
+
}, P = "undefined", Zt = typeof window !== P && typeof window.navigator !== P && /Trident\/|MSIE /.test(window.navigator.userAgent), Se = [
|
|
954
|
+
"trace",
|
|
955
|
+
"debug",
|
|
956
|
+
"info",
|
|
957
|
+
"warn",
|
|
958
|
+
"error"
|
|
959
|
+
], ee = {}, _ = null;
|
|
960
|
+
function Be(i, e) {
|
|
961
|
+
var t = i[e];
|
|
962
|
+
if (typeof t.bind == "function")
|
|
963
|
+
return t.bind(i);
|
|
964
|
+
try {
|
|
965
|
+
return Function.prototype.bind.call(t, i);
|
|
966
|
+
} catch {
|
|
967
|
+
return function() {
|
|
968
|
+
return Function.prototype.apply.apply(t, [i, arguments]);
|
|
969
|
+
};
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
function Qt() {
|
|
973
|
+
console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace();
|
|
974
|
+
}
|
|
975
|
+
function ei(i) {
|
|
976
|
+
return i === "debug" && (i = "log"), typeof console === P ? !1 : i === "trace" && Zt ? Qt : console[i] !== void 0 ? Be(console, i) : console.log !== void 0 ? Be(console, "log") : tt;
|
|
977
|
+
}
|
|
978
|
+
function Z() {
|
|
979
|
+
for (var i = this.getLevel(), e = 0; e < Se.length; e++) {
|
|
980
|
+
var t = Se[e];
|
|
981
|
+
this[t] = e < i ? tt : this.methodFactory(t, i, this.name);
|
|
982
|
+
}
|
|
983
|
+
if (this.log = this.debug, typeof console === P && i < this.levels.SILENT)
|
|
984
|
+
return "No console available for logging";
|
|
985
|
+
}
|
|
986
|
+
function ti(i) {
|
|
987
|
+
return function() {
|
|
988
|
+
typeof console !== P && (Z.call(this), this[i].apply(this, arguments));
|
|
989
|
+
};
|
|
990
|
+
}
|
|
991
|
+
function ii(i, e, t) {
|
|
992
|
+
return ei(i) || ti.apply(this, arguments);
|
|
993
|
+
}
|
|
994
|
+
function it(i, e) {
|
|
995
|
+
var t = this, o, l, s, n = "loglevel";
|
|
996
|
+
typeof i == "string" ? n += ":" + i : typeof i == "symbol" && (n = void 0);
|
|
997
|
+
function r(p) {
|
|
998
|
+
var h = (Se[p] || "silent").toUpperCase();
|
|
999
|
+
if (!(typeof window === P || !n)) {
|
|
1000
|
+
try {
|
|
1001
|
+
window.localStorage[n] = h;
|
|
1002
|
+
return;
|
|
1003
|
+
} catch {
|
|
1004
|
+
}
|
|
1005
|
+
try {
|
|
1006
|
+
window.document.cookie = encodeURIComponent(n) + "=" + h + ";";
|
|
1007
|
+
} catch {
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
function a() {
|
|
1012
|
+
var p;
|
|
1013
|
+
if (!(typeof window === P || !n)) {
|
|
1014
|
+
try {
|
|
1015
|
+
p = window.localStorage[n];
|
|
1016
|
+
} catch {
|
|
1017
|
+
}
|
|
1018
|
+
if (typeof p === P)
|
|
1019
|
+
try {
|
|
1020
|
+
var h = window.document.cookie, f = encodeURIComponent(n), w = h.indexOf(f + "=");
|
|
1021
|
+
w !== -1 && (p = /^([^;]+)/.exec(
|
|
1022
|
+
h.slice(w + f.length + 1)
|
|
1023
|
+
)[1]);
|
|
1024
|
+
} catch {
|
|
1025
|
+
}
|
|
1026
|
+
return t.levels[p] === void 0 && (p = void 0), p;
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
function d() {
|
|
1030
|
+
if (!(typeof window === P || !n)) {
|
|
1031
|
+
try {
|
|
1032
|
+
window.localStorage.removeItem(n);
|
|
1033
|
+
} catch {
|
|
1034
|
+
}
|
|
1035
|
+
try {
|
|
1036
|
+
window.document.cookie = encodeURIComponent(n) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
|
|
1037
|
+
} catch {
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
function c(p) {
|
|
1042
|
+
var h = p;
|
|
1043
|
+
if (typeof h == "string" && t.levels[h.toUpperCase()] !== void 0 && (h = t.levels[h.toUpperCase()]), typeof h == "number" && h >= 0 && h <= t.levels.SILENT)
|
|
1044
|
+
return h;
|
|
1045
|
+
throw new TypeError("log.setLevel() called with invalid level: " + p);
|
|
1046
|
+
}
|
|
1047
|
+
t.name = i, t.levels = {
|
|
1048
|
+
TRACE: 0,
|
|
1049
|
+
DEBUG: 1,
|
|
1050
|
+
INFO: 2,
|
|
1051
|
+
WARN: 3,
|
|
1052
|
+
ERROR: 4,
|
|
1053
|
+
SILENT: 5
|
|
1054
|
+
}, t.methodFactory = e || ii, t.getLevel = function() {
|
|
1055
|
+
return s ?? l ?? o;
|
|
1056
|
+
}, t.setLevel = function(p, h) {
|
|
1057
|
+
return s = c(p), h !== !1 && r(s), Z.call(t);
|
|
1058
|
+
}, t.setDefaultLevel = function(p) {
|
|
1059
|
+
l = c(p), a() || t.setLevel(p, !1);
|
|
1060
|
+
}, t.resetLevel = function() {
|
|
1061
|
+
s = null, d(), Z.call(t);
|
|
1062
|
+
}, t.enableAll = function(p) {
|
|
1063
|
+
t.setLevel(t.levels.TRACE, p);
|
|
1064
|
+
}, t.disableAll = function(p) {
|
|
1065
|
+
t.setLevel(t.levels.SILENT, p);
|
|
1066
|
+
}, t.rebuild = function() {
|
|
1067
|
+
if (_ !== t && (o = c(_.getLevel())), Z.call(t), _ === t)
|
|
1068
|
+
for (var p in ee)
|
|
1069
|
+
ee[p].rebuild();
|
|
1070
|
+
}, o = c(
|
|
1071
|
+
_ ? _.getLevel() : "WARN"
|
|
1072
|
+
);
|
|
1073
|
+
var m = a();
|
|
1074
|
+
m != null && (s = c(m)), Z.call(t);
|
|
1075
|
+
}
|
|
1076
|
+
_ = new it();
|
|
1077
|
+
_.getLogger = function(e) {
|
|
1078
|
+
if (typeof e != "symbol" && typeof e != "string" || e === "")
|
|
1079
|
+
throw new TypeError("You must supply a name when creating a logger.");
|
|
1080
|
+
var t = ee[e];
|
|
1081
|
+
return t || (t = ee[e] = new it(
|
|
1082
|
+
e,
|
|
1083
|
+
_.methodFactory
|
|
1084
|
+
)), t;
|
|
1085
|
+
};
|
|
1086
|
+
var oi = typeof window !== P ? window.log : void 0;
|
|
1087
|
+
_.noConflict = function() {
|
|
1088
|
+
return typeof window !== P && window.log === _ && (window.log = oi), _;
|
|
1089
|
+
};
|
|
1090
|
+
_.getLoggers = function() {
|
|
1091
|
+
return ee;
|
|
1092
|
+
};
|
|
1093
|
+
_.default = _;
|
|
1094
|
+
var li = function(i) {
|
|
1095
|
+
for (var e = 1, t = arguments.length, o; e < t; e++)
|
|
1096
|
+
for (o in arguments[e])
|
|
1097
|
+
Object.prototype.hasOwnProperty.call(arguments[e], o) && (i[o] = arguments[e][o]);
|
|
1098
|
+
return i;
|
|
1099
|
+
}, si = {
|
|
1100
|
+
template: "[%t] %l:",
|
|
1101
|
+
levelFormatter: function(i) {
|
|
1102
|
+
return i.toUpperCase();
|
|
961
1103
|
},
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
`%c[MultiSelect ${E}]%c ${i}`,
|
|
965
|
-
"color: #10b981; font-weight: bold;",
|
|
966
|
-
"color: inherit;",
|
|
967
|
-
...e
|
|
968
|
-
);
|
|
1104
|
+
nameFormatter: function(i) {
|
|
1105
|
+
return i || "root";
|
|
969
1106
|
},
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
`%c[MultiSelect ${E}]%c ${i}`,
|
|
973
|
-
"color: #f59e0b; font-weight: bold;",
|
|
974
|
-
"color: inherit;",
|
|
975
|
-
...e
|
|
976
|
-
);
|
|
1107
|
+
timestampFormatter: function(i) {
|
|
1108
|
+
return i.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1");
|
|
977
1109
|
},
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
1110
|
+
format: void 0
|
|
1111
|
+
}, ot, N = {}, ni = function(i) {
|
|
1112
|
+
if (!i || !i.getLogger)
|
|
1113
|
+
throw new TypeError("Argument is not a root logger");
|
|
1114
|
+
ot = i;
|
|
1115
|
+
}, ri = function(i, e) {
|
|
1116
|
+
if (!i || !i.setLevel)
|
|
1117
|
+
throw new TypeError("Argument is not a logger");
|
|
1118
|
+
var t = i.methodFactory, o = i.name || "", l = N[o] || N[""] || si;
|
|
1119
|
+
function s(n, r, a) {
|
|
1120
|
+
var d = t(n, r, a), c = N[a] || N[""], m = c.template.indexOf("%t") !== -1, p = c.template.indexOf("%l") !== -1, h = c.template.indexOf("%n") !== -1;
|
|
1121
|
+
return function() {
|
|
1122
|
+
for (var f = "", w = arguments.length, g = Array(w), b = 0; b < w; b++)
|
|
1123
|
+
g[b] = arguments[b];
|
|
1124
|
+
if (o || !N[a]) {
|
|
1125
|
+
var y = c.timestampFormatter(/* @__PURE__ */ new Date()), x = c.levelFormatter(n), A = c.nameFormatter(a);
|
|
1126
|
+
c.format ? f += c.format(x, A, y) : (f += c.template, m && (f = f.replace(/%t/, y)), p && (f = f.replace(/%l/, x)), h && (f = f.replace(/%n/, A))), g.length && typeof g[0] == "string" ? g[0] = f + " " + g[0] : g.unshift(f);
|
|
1127
|
+
}
|
|
1128
|
+
d.apply(void 0, g);
|
|
1129
|
+
};
|
|
1130
|
+
}
|
|
1131
|
+
return N[o] || (i.methodFactory = s), e = e || {}, e.template && (e.format = void 0), N[o] = li({}, l, e), i.setLevel(i.getLevel()), ot || i.warn(
|
|
1132
|
+
"It is necessary to call the function reg() of loglevel-plugin-prefix before calling apply. From the next release, it will throw an error. See more: https://github.com/kutuluk/loglevel-plugin-prefix/blob/master/README.md"
|
|
1133
|
+
), i;
|
|
1134
|
+
}, Te = {
|
|
1135
|
+
reg: ni,
|
|
1136
|
+
apply: ri
|
|
1137
|
+
};
|
|
1138
|
+
const he = {
|
|
1139
|
+
debug: "#0ea5e9",
|
|
1140
|
+
// Blue
|
|
1141
|
+
info: "#10b981",
|
|
1142
|
+
// Green
|
|
1143
|
+
warn: "#f59e0b",
|
|
1144
|
+
// Orange
|
|
1145
|
+
error: "#ef4444"
|
|
1146
|
+
// Red
|
|
1147
|
+
};
|
|
1148
|
+
Te.reg(_);
|
|
1149
|
+
Te.apply(_, {
|
|
1150
|
+
format(i, e, t) {
|
|
1151
|
+
return he[i.toLowerCase()], `%c[${t}]%c %c[${i}]%c ${e ? `%c[${e}]%c ` : ""}`;
|
|
1152
|
+
},
|
|
1153
|
+
timestampFormatter(i) {
|
|
1154
|
+
return i.toTimeString().split(" ")[0] + "." + i.getMilliseconds().toString().padStart(3, "0");
|
|
985
1155
|
}
|
|
1156
|
+
});
|
|
1157
|
+
const ai = _.methodFactory;
|
|
1158
|
+
_.methodFactory = function(i, e, t) {
|
|
1159
|
+
const o = ai(i, e, t);
|
|
1160
|
+
return function(...l) {
|
|
1161
|
+
if (l.length > 0 && typeof l[0] == "string" && l[0].includes("%c")) {
|
|
1162
|
+
const s = he[i] || "#666", n = [
|
|
1163
|
+
l[0],
|
|
1164
|
+
`color: ${s}; font-weight: bold;`,
|
|
1165
|
+
// timestamp color
|
|
1166
|
+
"color: inherit;",
|
|
1167
|
+
// reset
|
|
1168
|
+
`color: ${s}; font-weight: bold;`,
|
|
1169
|
+
// level color
|
|
1170
|
+
"color: inherit;",
|
|
1171
|
+
// reset
|
|
1172
|
+
...t ? [
|
|
1173
|
+
`color: ${s}; font-weight: bold;`,
|
|
1174
|
+
// name color
|
|
1175
|
+
"color: inherit;"
|
|
1176
|
+
// reset
|
|
1177
|
+
] : [],
|
|
1178
|
+
...l.slice(1)
|
|
1179
|
+
];
|
|
1180
|
+
o(...n);
|
|
1181
|
+
} else
|
|
1182
|
+
o(...l);
|
|
1183
|
+
};
|
|
986
1184
|
};
|
|
987
|
-
|
|
1185
|
+
_.setLevel("silent");
|
|
1186
|
+
const H = _.getLogger("INIT"), C = _.getLogger("DATA"), v = _.getLogger("UI"), k = _.getLogger("INTERACTION");
|
|
1187
|
+
[H, C, v, k].forEach((i) => {
|
|
1188
|
+
Te.apply(i, {
|
|
1189
|
+
format(t, o, l) {
|
|
1190
|
+
return he[t.toLowerCase()], `%c[${l}]%c %c[${t}]%c %c[${o}]%c `;
|
|
1191
|
+
},
|
|
1192
|
+
timestampFormatter(t) {
|
|
1193
|
+
return t.toTimeString().split(" ")[0] + "." + t.getMilliseconds().toString().padStart(3, "0");
|
|
1194
|
+
}
|
|
1195
|
+
});
|
|
1196
|
+
const e = i.methodFactory;
|
|
1197
|
+
i.methodFactory = function(t, o, l) {
|
|
1198
|
+
const s = e(t, o, l);
|
|
1199
|
+
return function(...n) {
|
|
1200
|
+
if (n.length > 0 && typeof n[0] == "string" && n[0].includes("%c")) {
|
|
1201
|
+
const r = he[t] || "#666", a = [
|
|
1202
|
+
n[0],
|
|
1203
|
+
`color: ${r}; font-weight: bold;`,
|
|
1204
|
+
// timestamp
|
|
1205
|
+
"color: inherit;",
|
|
1206
|
+
`color: ${r}; font-weight: bold;`,
|
|
1207
|
+
// level
|
|
1208
|
+
"color: inherit;",
|
|
1209
|
+
`color: ${r}; font-weight: bold;`,
|
|
1210
|
+
// category name
|
|
1211
|
+
"color: inherit;",
|
|
1212
|
+
...n.slice(1)
|
|
1213
|
+
];
|
|
1214
|
+
s(...a);
|
|
1215
|
+
} else
|
|
1216
|
+
s(...n);
|
|
1217
|
+
};
|
|
1218
|
+
}, i.setLevel("silent");
|
|
1219
|
+
});
|
|
1220
|
+
const lt = (i) => {
|
|
1221
|
+
_.setLevel(i), H.setLevel(i), C.setLevel(i), v.setLevel(i), k.setLevel(i);
|
|
1222
|
+
}, ui = () => {
|
|
1223
|
+
lt("debug");
|
|
1224
|
+
}, fi = () => {
|
|
1225
|
+
lt("silent");
|
|
1226
|
+
}, gi = (i, e = "debug") => {
|
|
1227
|
+
({
|
|
1228
|
+
INIT: H,
|
|
1229
|
+
DATA: C,
|
|
1230
|
+
UI: v,
|
|
1231
|
+
INTERACTION: k
|
|
1232
|
+
})[i].setLevel(e);
|
|
1233
|
+
};
|
|
1234
|
+
class ci {
|
|
1235
|
+
constructor(e) {
|
|
1236
|
+
u(this, "container");
|
|
1237
|
+
u(this, "wrapper");
|
|
1238
|
+
u(this, "viewport");
|
|
1239
|
+
u(this, "itemHeight");
|
|
1240
|
+
u(this, "items");
|
|
1241
|
+
u(this, "renderItem");
|
|
1242
|
+
u(this, "bufferSize");
|
|
1243
|
+
u(this, "onVisibleRangeChange");
|
|
1244
|
+
u(this, "onScroll");
|
|
1245
|
+
u(this, "scrollTop", 0);
|
|
1246
|
+
u(this, "viewportHeight", 0);
|
|
1247
|
+
u(this, "visibleStart", 0);
|
|
1248
|
+
u(this, "visibleEnd", 0);
|
|
1249
|
+
u(this, "scrollHandler");
|
|
1250
|
+
u(this, "resizeObserver");
|
|
1251
|
+
this.container = e.container, this.itemHeight = e.itemHeight, this.items = e.items, this.renderItem = e.renderItem, this.bufferSize = e.bufferSize ?? 10, this.onVisibleRangeChange = e.onVisibleRangeChange, this.onScroll = e.onScroll, this.scrollHandler = this.handleScroll.bind(this), this.init();
|
|
1252
|
+
}
|
|
1253
|
+
/**
|
|
1254
|
+
* Initialize virtual scroll DOM structure
|
|
1255
|
+
*
|
|
1256
|
+
* Structure:
|
|
1257
|
+
* container (overflow-y: auto)
|
|
1258
|
+
* └─ wrapper (height: totalItems * itemHeight)
|
|
1259
|
+
* └─ viewport (position: absolute, top: 0)
|
|
1260
|
+
* └─ items (position: absolute, top: index * itemHeight)
|
|
1261
|
+
*/
|
|
1262
|
+
init() {
|
|
1263
|
+
this.container.innerHTML = "", this.wrapper = document.createElement("div"), this.wrapper.style.position = "relative", this.wrapper.style.width = "100%", this.wrapper.style.height = `${this.items.length * this.itemHeight}px`, this.wrapper.className = "ml__virtual-scroll-wrapper", this.viewport = document.createElement("div"), this.viewport.style.position = "absolute", this.viewport.style.top = "0", this.viewport.style.left = "0", this.viewport.style.right = "0", this.viewport.style.width = "100%", this.viewport.className = "ml__virtual-scroll-viewport", this.wrapper.appendChild(this.viewport), this.container.appendChild(this.wrapper), this.container.addEventListener("scroll", this.scrollHandler), typeof ResizeObserver < "u" && (this.resizeObserver = new ResizeObserver(() => {
|
|
1264
|
+
this.updateViewportHeight(), this.render();
|
|
1265
|
+
}), this.resizeObserver.observe(this.container)), this.updateViewportHeight(), this.render();
|
|
1266
|
+
}
|
|
1267
|
+
/**
|
|
1268
|
+
* Update viewport height (visible area)
|
|
1269
|
+
*/
|
|
1270
|
+
updateViewportHeight() {
|
|
1271
|
+
this.viewportHeight = this.container.clientHeight;
|
|
1272
|
+
}
|
|
1273
|
+
/**
|
|
1274
|
+
* Handle scroll event
|
|
1275
|
+
*/
|
|
1276
|
+
handleScroll() {
|
|
1277
|
+
this.scrollTop = this.container.scrollTop, this.onScroll && this.onScroll(this.scrollTop), this.render();
|
|
1278
|
+
}
|
|
1279
|
+
/**
|
|
1280
|
+
* Calculate visible range based on scroll position
|
|
1281
|
+
*/
|
|
1282
|
+
calculateVisibleRange() {
|
|
1283
|
+
const e = Math.floor(this.scrollTop / this.itemHeight), t = Math.ceil((this.scrollTop + this.viewportHeight) / this.itemHeight), o = Math.max(0, e - this.bufferSize), l = Math.min(this.items.length, t + this.bufferSize);
|
|
1284
|
+
return { start: o, end: l };
|
|
1285
|
+
}
|
|
1286
|
+
/**
|
|
1287
|
+
* Render visible items
|
|
1288
|
+
*/
|
|
1289
|
+
render() {
|
|
1290
|
+
const { start: e, end: t } = this.calculateVisibleRange();
|
|
1291
|
+
if (e === this.visibleStart && t === this.visibleEnd)
|
|
1292
|
+
return;
|
|
1293
|
+
this.visibleStart = e, this.visibleEnd = t, this.onVisibleRangeChange && this.onVisibleRangeChange(e, t);
|
|
1294
|
+
let o = "";
|
|
1295
|
+
for (let l = e; l < t; l++) {
|
|
1296
|
+
const s = this.items[l], n = this.renderItem(s, l), r = l * this.itemHeight;
|
|
1297
|
+
o += `<div class="ml__virtual-item" style="position: absolute; top: ${r}px; left: 0; right: 0; height: ${this.itemHeight}px;" data-index="${l}">`, o += n, o += "</div>";
|
|
1298
|
+
}
|
|
1299
|
+
this.viewport.innerHTML = o;
|
|
1300
|
+
}
|
|
1301
|
+
/**
|
|
1302
|
+
* Update items and re-render
|
|
1303
|
+
*/
|
|
1304
|
+
setItems(e) {
|
|
1305
|
+
this.items = e, this.wrapper.style.height = `${e.length * this.itemHeight}px`, this.updateViewportHeight(), this.visibleStart = -1, this.visibleEnd = -1, this.render();
|
|
1306
|
+
}
|
|
1307
|
+
/**
|
|
1308
|
+
* Scroll to specific item index
|
|
1309
|
+
*/
|
|
1310
|
+
scrollToIndex(e) {
|
|
1311
|
+
if (e < 0 || e >= this.items.length)
|
|
1312
|
+
return;
|
|
1313
|
+
const t = e * this.itemHeight;
|
|
1314
|
+
this.container.scrollTop = t;
|
|
1315
|
+
}
|
|
1316
|
+
/**
|
|
1317
|
+
* Get currently visible range
|
|
1318
|
+
*/
|
|
1319
|
+
getVisibleRange() {
|
|
1320
|
+
return { start: this.visibleStart, end: this.visibleEnd };
|
|
1321
|
+
}
|
|
1322
|
+
/**
|
|
1323
|
+
* Get total number of items
|
|
1324
|
+
*/
|
|
1325
|
+
getItemCount() {
|
|
1326
|
+
return this.items.length;
|
|
1327
|
+
}
|
|
1328
|
+
/**
|
|
1329
|
+
* Update item height and re-render
|
|
1330
|
+
*/
|
|
1331
|
+
setItemHeight(e) {
|
|
1332
|
+
this.itemHeight = e, this.wrapper.style.height = `${this.items.length * e}px`, this.visibleStart = -1, this.visibleEnd = -1, this.render();
|
|
1333
|
+
}
|
|
1334
|
+
/**
|
|
1335
|
+
* Update buffer size
|
|
1336
|
+
*/
|
|
1337
|
+
setBufferSize(e) {
|
|
1338
|
+
this.bufferSize = e, this.visibleStart = -1, this.visibleEnd = -1, this.render();
|
|
1339
|
+
}
|
|
1340
|
+
/**
|
|
1341
|
+
* Refresh/force re-render
|
|
1342
|
+
*/
|
|
1343
|
+
refresh() {
|
|
1344
|
+
this.visibleStart = -1, this.visibleEnd = -1, this.render();
|
|
1345
|
+
}
|
|
1346
|
+
/**
|
|
1347
|
+
* Cleanup and remove event listeners
|
|
1348
|
+
*/
|
|
1349
|
+
destroy() {
|
|
1350
|
+
this.container.removeEventListener("scroll", this.scrollHandler), this.resizeObserver && this.resizeObserver.disconnect(), this.container.innerHTML = "";
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
class di {
|
|
988
1354
|
constructor(e, t = {}) {
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1355
|
+
u(this, "element");
|
|
1356
|
+
u(this, "instanceId");
|
|
1357
|
+
u(this, "options");
|
|
1358
|
+
u(this, "isOpen", !1);
|
|
1359
|
+
u(this, "selectedValues", /* @__PURE__ */ new Set());
|
|
1360
|
+
u(this, "selectedOptions", /* @__PURE__ */ new Map());
|
|
1361
|
+
u(this, "allOptions", []);
|
|
1362
|
+
u(this, "filteredOptions", []);
|
|
1363
|
+
u(this, "hiddenInputs", []);
|
|
1364
|
+
u(this, "focusedIndex", -1);
|
|
1365
|
+
u(this, "matchingIndices", /* @__PURE__ */ new Set());
|
|
1366
|
+
u(this, "searchTerm", "");
|
|
1367
|
+
u(this, "isLoading", !1);
|
|
1368
|
+
u(this, "showSelectedPopover", !1);
|
|
1369
|
+
u(this, "selectedPopoverPlacement", null);
|
|
1370
|
+
u(this, "dropdownPlacement", null);
|
|
1371
|
+
u(this, "isRTL", !1);
|
|
1372
|
+
u(this, "effectivePillsPosition", "bottom");
|
|
1373
|
+
u(this, "justClosedViaClick", !1);
|
|
1007
1374
|
// Floating UI cleanup functions
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1375
|
+
u(this, "dropdownCleanup", null);
|
|
1376
|
+
u(this, "hintCleanup", null);
|
|
1377
|
+
u(this, "selectedPopoverCleanup", null);
|
|
1011
1378
|
// Pill tooltip storage
|
|
1012
|
-
|
|
1013
|
-
|
|
1379
|
+
u(this, "pillTooltips", /* @__PURE__ */ new Map());
|
|
1380
|
+
u(this, "pillTooltipCleanups", /* @__PURE__ */ new Map());
|
|
1381
|
+
// Virtual scroll instance
|
|
1382
|
+
u(this, "virtualScroll", null);
|
|
1383
|
+
u(this, "optionsContainer", null);
|
|
1014
1384
|
// DOM elements
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1385
|
+
u(this, "input");
|
|
1386
|
+
u(this, "dropdown");
|
|
1387
|
+
u(this, "pillsContainer");
|
|
1388
|
+
u(this, "countBadge");
|
|
1389
|
+
u(this, "hint");
|
|
1390
|
+
u(this, "selectedPopover");
|
|
1021
1391
|
this.element = e, this.instanceId = `MS-${Math.random().toString(36).substr(2, 9)}`, this.options = {
|
|
1022
1392
|
// String options
|
|
1023
1393
|
searchHint: e.dataset.searchHint || "",
|
|
@@ -1030,6 +1400,7 @@ class zt {
|
|
|
1030
1400
|
emptyMessage: e.dataset.emptyMessage || "No results found",
|
|
1031
1401
|
loadingMessage: e.dataset.loadingMessage || "Loading...",
|
|
1032
1402
|
searchInputMode: e.dataset.searchInputMode || "normal",
|
|
1403
|
+
searchMode: e.dataset.searchMode || "filter",
|
|
1033
1404
|
// Number options
|
|
1034
1405
|
pillsThreshold: e.dataset.pillsThreshold ? parseInt(e.dataset.pillsThreshold) : void 0,
|
|
1035
1406
|
minSearchLength: parseInt(e.dataset.minSearchLength || "0") || 0,
|
|
@@ -1045,6 +1416,7 @@ class zt {
|
|
|
1045
1416
|
isSearchEnabled: e.dataset.enableSearch !== "false",
|
|
1046
1417
|
isAddNewAllowed: e.dataset.allowAddNew === "true",
|
|
1047
1418
|
isCountBadgeShown: e.dataset.showCountBadge === "true",
|
|
1419
|
+
isKeepOptionsOnSearch: e.dataset.keepOptionsOnSearch !== "false",
|
|
1048
1420
|
// Data and callbacks
|
|
1049
1421
|
options: [],
|
|
1050
1422
|
container: void 0,
|
|
@@ -1124,7 +1496,7 @@ class zt {
|
|
|
1124
1496
|
return Array.isArray(e) ? !1 : this.options.disabledMember && e[this.options.disabledMember] !== void 0 ? !!e[this.options.disabledMember] : this.options.getDisabledCallback ? this.options.getDisabledCallback(e) : !1;
|
|
1125
1497
|
}
|
|
1126
1498
|
init() {
|
|
1127
|
-
this.parseOptions(), this.buildHTML(), this.attachEvents(), this.parseInitialSelection(),
|
|
1499
|
+
this.parseOptions(), this.buildHTML(), this.attachEvents(), this.parseInitialSelection(), H.debug(`Initialized [${this.instanceId}] with options:`, {
|
|
1128
1500
|
placeholder: this.options.searchPlaceholder,
|
|
1129
1501
|
totalOptions: this.allOptions.length,
|
|
1130
1502
|
isCloseOnSelect: this.options.isCloseOnSelect,
|
|
@@ -1139,21 +1511,21 @@ class zt {
|
|
|
1139
1511
|
try {
|
|
1140
1512
|
this.allOptions = JSON.parse(e);
|
|
1141
1513
|
} catch (t) {
|
|
1142
|
-
|
|
1514
|
+
C.error(`[${this.instanceId}] Failed to parse data-options:`, t), this.allOptions = [];
|
|
1143
1515
|
}
|
|
1144
1516
|
else this.options.options && (this.allOptions = this.options.options);
|
|
1145
1517
|
this.filteredOptions = [...this.allOptions];
|
|
1146
1518
|
}
|
|
1147
1519
|
buildHTML() {
|
|
1148
|
-
const e = this.options.container || document.body, t = this.element.getRootNode(),
|
|
1149
|
-
this.isRTL =
|
|
1520
|
+
const e = this.options.container || document.body, t = this.element.getRootNode(), o = t instanceof ShadowRoot ? t.host : this.element, l = o.getAttribute("dir") === "rtl", s = o.closest('[dir="rtl"]') !== null;
|
|
1521
|
+
this.isRTL = l || s, H.debug(`[${this.instanceId}] RTL Debug:`, {
|
|
1150
1522
|
isShadowRoot: t instanceof ShadowRoot,
|
|
1151
|
-
hostElement:
|
|
1152
|
-
elementDir:
|
|
1153
|
-
hasElementDir:
|
|
1523
|
+
hostElement: o,
|
|
1524
|
+
elementDir: o.getAttribute("dir"),
|
|
1525
|
+
hasElementDir: l,
|
|
1154
1526
|
hasAncestorDir: s,
|
|
1155
1527
|
isRTL: this.isRTL
|
|
1156
|
-
}), this.effectivePillsPosition = this.options.pillsPosition || "bottom", this.isRTL && (this.effectivePillsPosition === "left" ? this.effectivePillsPosition = "right" : this.effectivePillsPosition === "right" && (this.effectivePillsPosition = "left")), this.element.classList.add("ml"), this.isRTL && (this.element.classList.add("ml--rtl"),
|
|
1528
|
+
}), this.effectivePillsPosition = this.options.pillsPosition || "bottom", this.isRTL && (this.effectivePillsPosition === "left" ? this.effectivePillsPosition = "right" : this.effectivePillsPosition === "right" && (this.effectivePillsPosition = "left")), this.element.classList.add("ml"), this.isRTL && (this.element.classList.add("ml--rtl"), H.debug(`[${this.instanceId}] Added ml--rtl class to element`)), (!this.options.isCheckboxesShown || !this.options.isMultipleEnabled) && this.element.classList.add("ml--no-checkboxes");
|
|
1157
1529
|
const n = document.createElement("div");
|
|
1158
1530
|
n.className = "ml__input-wrapper", this.input = document.createElement("input"), this.input.type = "text", this.input.className = "ml__input", this.input.placeholder = this.options.searchPlaceholder, this.input.autocomplete = "off", this.options.searchInputMode === "readonly" ? this.input.readOnly = !0 : this.options.searchInputMode === "hidden" && (this.input.style.display = "none");
|
|
1159
1531
|
const r = document.createElement("span");
|
|
@@ -1161,7 +1533,29 @@ class zt {
|
|
|
1161
1533
|
const a = document.createElement("div");
|
|
1162
1534
|
a.className = "ml-wrapper", (this.effectivePillsPosition === "left" || this.effectivePillsPosition === "right") && a.classList.add("ml-wrapper--inline"), a.appendChild(n), a.appendChild(this.pillsContainer), this.element.appendChild(a), this.dropdown = document.createElement("div"), this.dropdown.className = "ml__dropdown", e.appendChild(this.dropdown), this.options.searchHint && (this.hint = document.createElement("div"), this.hint.className = "ml__hint", this.hint.textContent = this.options.searchHint, e.appendChild(this.hint)), this.selectedPopover = document.createElement("div"), this.selectedPopover.className = "ml__selected-popover", e.appendChild(this.selectedPopover), this.renderDropdown();
|
|
1163
1535
|
}
|
|
1536
|
+
/**
|
|
1537
|
+
* Check if virtual scroll should be used
|
|
1538
|
+
*/
|
|
1539
|
+
shouldUseVirtualScroll() {
|
|
1540
|
+
if (!this.options.isVirtualScrollEnabled || this.options.isGroupsAllowed && this.hasGroups()) return !1;
|
|
1541
|
+
const e = this.options.virtualScrollThreshold ?? 100;
|
|
1542
|
+
return this.filteredOptions.length >= e;
|
|
1543
|
+
}
|
|
1544
|
+
/**
|
|
1545
|
+
* Check if any options have groups
|
|
1546
|
+
*/
|
|
1547
|
+
hasGroups() {
|
|
1548
|
+
return this.filteredOptions.some((e) => {
|
|
1549
|
+
const t = this.getItemGroup(e);
|
|
1550
|
+
return t && t.trim() !== "";
|
|
1551
|
+
});
|
|
1552
|
+
}
|
|
1164
1553
|
renderDropdown() {
|
|
1554
|
+
if (this.shouldUseVirtualScroll()) {
|
|
1555
|
+
this.dropdown.classList.add("ml__dropdown--virtual"), this.renderDropdownVirtual();
|
|
1556
|
+
return;
|
|
1557
|
+
}
|
|
1558
|
+
this.dropdown.classList.remove("ml__dropdown--virtual");
|
|
1165
1559
|
let e = "";
|
|
1166
1560
|
if (this.isLoading) {
|
|
1167
1561
|
e += '<div class="ml__loader">', e += '<div class="pa-loader pa-loader--sm"></div>', e += `<div class="ml__loading-text">${this.options.loadingMessage}</div>`, e += "</div>", this.dropdown.innerHTML = e;
|
|
@@ -1175,33 +1569,61 @@ class zt {
|
|
|
1175
1569
|
e += `<div class="ml__empty">${this.options.emptyMessage}</div>`;
|
|
1176
1570
|
else if (this.options.isGroupsAllowed) {
|
|
1177
1571
|
const t = this.groupOptions(this.filteredOptions);
|
|
1178
|
-
Object.keys(t).forEach((
|
|
1179
|
-
e += '<div class="ml__group">',
|
|
1180
|
-
e += this.renderOption(
|
|
1572
|
+
Object.keys(t).forEach((o) => {
|
|
1573
|
+
e += '<div class="ml__group">', o !== "__ungrouped__" && (e += `<div class="ml__group-label">${o}</div>`), t[o].forEach((l, s) => {
|
|
1574
|
+
e += this.renderOption(l, s);
|
|
1181
1575
|
}), e += "</div>";
|
|
1182
1576
|
});
|
|
1183
1577
|
} else
|
|
1184
|
-
this.filteredOptions.forEach((t,
|
|
1185
|
-
e += this.renderOption(t,
|
|
1578
|
+
this.filteredOptions.forEach((t, o) => {
|
|
1579
|
+
e += this.renderOption(t, o);
|
|
1186
1580
|
});
|
|
1187
1581
|
e += "</div>", this.dropdown.innerHTML = e;
|
|
1188
1582
|
}
|
|
1583
|
+
/**
|
|
1584
|
+
* Render dropdown with virtual scrolling
|
|
1585
|
+
*/
|
|
1586
|
+
renderDropdownVirtual() {
|
|
1587
|
+
if (!this.virtualScroll) {
|
|
1588
|
+
let o = "";
|
|
1589
|
+
if (this.options.isMultipleEnabled && (this.options.isSelectAllAllowed || this.options.isClearAllAllowed)) {
|
|
1590
|
+
const s = this.options.isActionsSticky ? " ml__actions--sticky" : "";
|
|
1591
|
+
o += `<div class="ml__actions${s}">`, this.options.isSelectAllAllowed && (o += '<button type="button" class="ml__action-btn" data-action="select-all">Select All</button>'), this.options.isClearAllAllowed && (o += '<button type="button" class="ml__action-btn" data-action="clear-all">Clear All</button>'), o += "</div>";
|
|
1592
|
+
}
|
|
1593
|
+
const l = this.options.maxHeight || "20rem";
|
|
1594
|
+
o += `<div class="ml__options ml__options--virtual" style="height: ${l}; max-height: ${l}; overflow-y: auto; position: relative;"></div>`, this.dropdown.innerHTML = o, this.optionsContainer = this.dropdown.querySelector(".ml__options");
|
|
1595
|
+
}
|
|
1596
|
+
if (this.filteredOptions.length === 0) {
|
|
1597
|
+
this.optionsContainer.innerHTML = `<div class="ml__empty">${this.options.emptyMessage}</div>`;
|
|
1598
|
+
return;
|
|
1599
|
+
}
|
|
1600
|
+
const e = this.options.optionHeight ?? 50, t = this.options.virtualScrollBuffer ?? 10;
|
|
1601
|
+
requestAnimationFrame(() => {
|
|
1602
|
+
this.optionsContainer && (this.virtualScroll ? this.virtualScroll.setItems(this.filteredOptions) : this.virtualScroll = new ci({
|
|
1603
|
+
container: this.optionsContainer,
|
|
1604
|
+
itemHeight: e,
|
|
1605
|
+
items: this.filteredOptions,
|
|
1606
|
+
renderItem: (o, l) => this.renderOption(o, l),
|
|
1607
|
+
bufferSize: t
|
|
1608
|
+
}));
|
|
1609
|
+
});
|
|
1610
|
+
}
|
|
1189
1611
|
renderOption(e, t) {
|
|
1190
|
-
const
|
|
1191
|
-
a &&
|
|
1192
|
-
let
|
|
1193
|
-
return this.options.isCheckboxesShown && this.options.isMultipleEnabled && (
|
|
1612
|
+
const o = this.getItemValue(e), l = this.getItemDisplayValue(e), s = this.getItemIcon(e), n = this.getItemSubtitle(e), r = this.getItemDisabled(e), a = this.selectedValues.has(String(o)), d = t === this.focusedIndex, c = this.matchingIndices.has(t), m = ["ml__option"];
|
|
1613
|
+
a && m.push("ml__option--selected"), d && m.push("ml__option--focused"), c && m.push("ml__option--matched"), r && m.push("ml__option--disabled");
|
|
1614
|
+
let p = `<div class="${m.join(" ")}" data-value="${o}" data-index="${t}">`;
|
|
1615
|
+
return this.options.isCheckboxesShown && this.options.isMultipleEnabled && (p += `<input type="checkbox" class="ml__checkbox" ${a ? "checked" : ""} ${r ? "disabled" : ""}>`), p += '<div class="ml__option-content">', s && (p += `<span class="ml__option-icon">${s}</span>`), p += '<div class="ml__option-text">', p += `<div class="ml__option-title">${this.highlightMatch(l, this.searchTerm)}</div>`, n && (p += `<div class="ml__option-subtitle">${n}</div>`), p += "</div>", p += "</div>", p += "</div>", p;
|
|
1194
1616
|
}
|
|
1195
1617
|
highlightMatch(e, t) {
|
|
1196
1618
|
if (!t) return e;
|
|
1197
|
-
const
|
|
1198
|
-
return e.replace(
|
|
1619
|
+
const o = new RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})`, "gi");
|
|
1620
|
+
return e.replace(o, "<mark>$1</mark>");
|
|
1199
1621
|
}
|
|
1200
1622
|
groupOptions(e) {
|
|
1201
1623
|
const t = {};
|
|
1202
|
-
return e.forEach((
|
|
1203
|
-
const
|
|
1204
|
-
t[
|
|
1624
|
+
return e.forEach((o) => {
|
|
1625
|
+
const l = this.getItemGroup(o) || "__ungrouped__";
|
|
1626
|
+
t[l] || (t[l] = []), t[l].push(o);
|
|
1205
1627
|
}), t;
|
|
1206
1628
|
}
|
|
1207
1629
|
renderPills() {
|
|
@@ -1210,23 +1632,23 @@ class zt {
|
|
|
1210
1632
|
if (!this.options.isMultipleEnabled) {
|
|
1211
1633
|
this.pillsContainer.innerHTML = "", this.countBadge.style.display = "none";
|
|
1212
1634
|
const s = e[0] ? this.getItemDisplayValue(e[0]) : void 0;
|
|
1213
|
-
|
|
1635
|
+
v.warn(`[${this.instanceId}] renderPills() single-select mode`, {
|
|
1214
1636
|
isOpen: this.isOpen,
|
|
1215
1637
|
count: t,
|
|
1216
1638
|
selectedOptionsLength: e.length,
|
|
1217
1639
|
willSetValue: !this.isOpen && t > 0 && e.length > 0,
|
|
1218
1640
|
selectedLabel: s
|
|
1219
|
-
}), !this.isOpen && t > 0 && e.length > 0 ? (
|
|
1641
|
+
}), !this.isOpen && t > 0 && e.length > 0 ? (v.info(`[${this.instanceId}] ✅ SETTING input.value = "${s}"`), this.input.value = s, v.info(`[${this.instanceId}] 🔍 VERIFY input.value = "${this.input.value}"`)) : this.isOpen ? v.info(`[${this.instanceId}] ⏭️ SKIPPING input update (dropdown is open)`) : (v.info(`[${this.instanceId}] ❌ CLEARING input.value (no selection)`), this.input.value = "");
|
|
1220
1642
|
return;
|
|
1221
1643
|
}
|
|
1222
|
-
let
|
|
1223
|
-
if (this.options.pillsThreshold !== null && t > this.options.pillsThreshold && (
|
|
1224
|
-
if (t > 0 &&
|
|
1644
|
+
let o = this.options.pillsDisplayMode;
|
|
1645
|
+
if (this.options.pillsThreshold !== null && t > this.options.pillsThreshold && (o = this.options.pillsThresholdMode || "count"), !this.isOpen)
|
|
1646
|
+
if (t > 0 && o === "count") {
|
|
1225
1647
|
const s = this.options.getCountPillCallback ? this.options.getCountPillCallback(t) : `${t} selected`;
|
|
1226
1648
|
this.input.placeholder = s;
|
|
1227
1649
|
} else
|
|
1228
1650
|
this.input.placeholder = this.options.searchPlaceholder;
|
|
1229
|
-
if (this.options.isCountBadgeShown && t > 0 ? (this.countBadge.textContent = `[${t}]`, this.countBadge.style.display = "") : this.countBadge.style.display = "none",
|
|
1651
|
+
if (this.options.isCountBadgeShown && t > 0 ? (this.countBadge.textContent = `[${t}]`, this.countBadge.style.display = "") : this.countBadge.style.display = "none", o === "pills")
|
|
1230
1652
|
this.pillsContainer.className = `ml__pills ml__pills--${this.effectivePillsPosition}`, this.pillsContainer.innerHTML = e.map((s) => {
|
|
1231
1653
|
const n = this.getItemValue(s), r = this.getItemPillDisplayValue(s);
|
|
1232
1654
|
return `
|
|
@@ -1236,24 +1658,24 @@ class zt {
|
|
|
1236
1658
|
</div>
|
|
1237
1659
|
`;
|
|
1238
1660
|
}).join("");
|
|
1239
|
-
else if (
|
|
1661
|
+
else if (o === "partial") {
|
|
1240
1662
|
this.pillsContainer.className = `ml__pills ml__pills--${this.effectivePillsPosition}`;
|
|
1241
|
-
const s = this.options.pillsMaxVisible || 3, n = e.slice(0, s), r = t - s, a = n.map((
|
|
1242
|
-
const
|
|
1663
|
+
const s = this.options.pillsMaxVisible || 3, n = e.slice(0, s), r = t - s, a = n.map((c) => {
|
|
1664
|
+
const m = this.getItemValue(c), p = this.getItemPillDisplayValue(c);
|
|
1243
1665
|
return `
|
|
1244
1666
|
<div class="ml__pill">
|
|
1245
|
-
<span class="ml__pill-text">${
|
|
1246
|
-
<button type="button" class="ml__pill-remove" data-value="${
|
|
1667
|
+
<span class="ml__pill-text">${p}</span>
|
|
1668
|
+
<button type="button" class="ml__pill-remove" data-value="${m}" aria-label="Remove ${p}"></button>
|
|
1247
1669
|
</div>
|
|
1248
1670
|
`;
|
|
1249
1671
|
}).join("");
|
|
1250
|
-
let
|
|
1251
|
-
r > 0 && (
|
|
1672
|
+
let d = "";
|
|
1673
|
+
r > 0 && (d = `
|
|
1252
1674
|
<div class="ml__pill ml__pill--more" data-action="show-selected">
|
|
1253
1675
|
<span class="ml__pill-text">${this.options.getCountPillCallback ? this.options.getCountPillCallback(t, r) : `+${r} more`}</span>
|
|
1254
1676
|
<button type="button" class="ml__pill-remove" data-action="remove-hidden" aria-label="Remove ${r} hidden items"></button>
|
|
1255
1677
|
</div>
|
|
1256
|
-
`), this.pillsContainer.innerHTML = a +
|
|
1678
|
+
`), this.pillsContainer.innerHTML = a + d;
|
|
1257
1679
|
} else if (this.pillsContainer.className = `ml__count-display ml__count-display--${this.effectivePillsPosition}`, t > 0) {
|
|
1258
1680
|
const s = this.options.getCountPillCallback ? this.options.getCountPillCallback(t) : `${t} selected`;
|
|
1259
1681
|
this.pillsContainer.innerHTML = `
|
|
@@ -1280,7 +1702,12 @@ class zt {
|
|
|
1280
1702
|
this.options.isSearchEnabled && !this.isOpen && this.open(), this.handleSearch(t);
|
|
1281
1703
|
}), this.input.addEventListener("keydown", (e) => this.handleKeydown(e)), setTimeout(() => {
|
|
1282
1704
|
document.addEventListener("click", (e) => this.handleClickOutside(e));
|
|
1283
|
-
}, 0), this.dropdown.addEventListener("click", (e) => this.handleDropdownClick(e)), this.
|
|
1705
|
+
}, 0), this.dropdown.addEventListener("click", (e) => this.handleDropdownClick(e)), this.dropdown.addEventListener("wheel", (e) => {
|
|
1706
|
+
if (this.virtualScroll)
|
|
1707
|
+
return;
|
|
1708
|
+
const t = e.currentTarget, o = t.scrollTop === 0, l = t.scrollTop + t.clientHeight >= t.scrollHeight;
|
|
1709
|
+
(e.deltaY < 0 && o || e.deltaY > 0 && l) && e.preventDefault(), e.stopPropagation();
|
|
1710
|
+
}, { passive: !1 }), this.pillsContainer.addEventListener("mousedown", (e) => {
|
|
1284
1711
|
e.target.closest(".ml__count-text") && !this.showSelectedPopover && e.stopPropagation();
|
|
1285
1712
|
}), this.pillsContainer.addEventListener("click", (e) => this.handlePillClick(e)), this.countBadge.addEventListener("mousedown", (e) => {
|
|
1286
1713
|
this.showSelectedPopover || e.stopPropagation();
|
|
@@ -1289,21 +1716,49 @@ class zt {
|
|
|
1289
1716
|
}), this.selectedPopover.addEventListener("click", (e) => this.handleSelectedPopoverClick(e));
|
|
1290
1717
|
}
|
|
1291
1718
|
async handleSearch(e) {
|
|
1292
|
-
if (this.searchTerm = e,
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1719
|
+
if (this.searchTerm = e, !this.options.isSearchEnabled)
|
|
1720
|
+
return;
|
|
1721
|
+
let t = e;
|
|
1722
|
+
if (this.options.beforeSearchCallback) {
|
|
1723
|
+
const o = this.options.beforeSearchCallback(e);
|
|
1724
|
+
if (o === null) {
|
|
1725
|
+
C.debug(`[${this.instanceId}] beforeSearchCallback blocked search for term:`, e), this.filteredOptions = [...this.allOptions], this.matchingIndices.clear(), this.renderDropdown();
|
|
1726
|
+
return;
|
|
1727
|
+
}
|
|
1728
|
+
t = o, t !== e && C.debug(`[${this.instanceId}] beforeSearchCallback transformed: "${e}" -> "${t}"`);
|
|
1729
|
+
}
|
|
1730
|
+
if (this.options.searchCallback) {
|
|
1731
|
+
if (t.length < this.options.minSearchLength) {
|
|
1732
|
+
this.isLoading = !1, this.options.isKeepOptionsOnSearch ? (this.filteredOptions = [...this.allOptions], C.debug(`[${this.instanceId}] Search term below minimum, showing ${this.allOptions.length} initial options`)) : this.filteredOptions = [], this.matchingIndices.clear(), this.renderDropdown();
|
|
1733
|
+
return;
|
|
1734
|
+
}
|
|
1735
|
+
this.isLoading = !0, this.renderDropdown(), C.debug(`[${this.instanceId}] Loading data for search term:`, t);
|
|
1736
|
+
try {
|
|
1737
|
+
const o = await this.options.searchCallback(t);
|
|
1738
|
+
if (this.searchTerm === e) {
|
|
1739
|
+
const l = o || [];
|
|
1740
|
+
this.filteredOptions = [...l], this.isLoading = !1, this.matchingIndices.clear(), this.focusedIndex = this.options.isSearchEnabled && this.filteredOptions.length > 0 ? 0 : -1, this.renderDropdown(), C.debug(`[${this.instanceId}] Loaded ${l.length} results`);
|
|
1297
1741
|
}
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1742
|
+
} catch (o) {
|
|
1743
|
+
C.error(`[${this.instanceId}] Error loading data:`, o), this.isLoading = !1, this.options.isKeepOptionsOnSearch ? this.filteredOptions = [...this.allOptions] : this.filteredOptions = [], this.matchingIndices.clear(), this.renderDropdown();
|
|
1744
|
+
}
|
|
1745
|
+
} else {
|
|
1746
|
+
if (!t)
|
|
1747
|
+
this.filteredOptions = [...this.allOptions], this.matchingIndices.clear(), this.focusedIndex = this.filteredOptions.length > 0 ? 0 : -1;
|
|
1748
|
+
else {
|
|
1749
|
+
const o = this.options.searchMode || "filter", l = t.toLowerCase();
|
|
1750
|
+
if (o === "filter")
|
|
1751
|
+
this.filteredOptions = this.allOptions.filter((s) => this.getItemSearchValue(s).toLowerCase().includes(l)), this.matchingIndices.clear(), this.focusedIndex = this.filteredOptions.length > 0 ? 0 : -1, C.debug(`[${this.instanceId}] Filter mode: ${this.filteredOptions.length} matches for "${t}"`);
|
|
1752
|
+
else {
|
|
1753
|
+
this.filteredOptions = [...this.allOptions], this.matchingIndices.clear();
|
|
1754
|
+
let s = -1;
|
|
1755
|
+
this.allOptions.forEach((n, r) => {
|
|
1756
|
+
this.getItemSearchValue(n).toLowerCase().includes(l) && (this.matchingIndices.add(r), s === -1 && (s = r));
|
|
1757
|
+
}), s >= 0 ? (this.focusedIndex = s, C.debug(`[${this.instanceId}] Navigate mode: ${this.matchingIndices.size} matches, jumped to index ${s}`)) : C.debug(`[${this.instanceId}] Navigate mode: No matches found, keeping previous focus`);
|
|
1304
1758
|
}
|
|
1305
|
-
}
|
|
1306
|
-
|
|
1759
|
+
}
|
|
1760
|
+
this.renderDropdown(), this.options.searchMode === "navigate" && this.focusedIndex >= 0 && this.scrollToFocused();
|
|
1761
|
+
}
|
|
1307
1762
|
}
|
|
1308
1763
|
handleKeydown(e) {
|
|
1309
1764
|
if (!this.isOpen) {
|
|
@@ -1311,18 +1766,18 @@ class zt {
|
|
|
1311
1766
|
return;
|
|
1312
1767
|
}
|
|
1313
1768
|
if (!this.options.isSearchEnabled) {
|
|
1314
|
-
const t = e.key.length === 1 || e.key === "Backspace" || e.key === "Delete",
|
|
1315
|
-
if (t && !
|
|
1769
|
+
const t = e.key.length === 1 || e.key === "Backspace" || e.key === "Delete", o = ["ArrowUp", "ArrowDown", "PageUp", "PageDown", "Home", "End", "Enter", "Escape", "Tab"].includes(e.key);
|
|
1770
|
+
if (t && !o) {
|
|
1316
1771
|
e.preventDefault();
|
|
1317
1772
|
return;
|
|
1318
1773
|
}
|
|
1319
1774
|
}
|
|
1320
1775
|
switch (e.key) {
|
|
1321
1776
|
case "ArrowDown":
|
|
1322
|
-
e.preventDefault(), this.focusNext();
|
|
1777
|
+
e.preventDefault(), e.ctrlKey || e.metaKey ? this.focusNextMatch() : this.focusNext();
|
|
1323
1778
|
break;
|
|
1324
1779
|
case "ArrowUp":
|
|
1325
|
-
e.preventDefault(), this.focusPrevious();
|
|
1780
|
+
e.preventDefault(), e.ctrlKey || e.metaKey ? this.focusPreviousMatch() : this.focusPrevious();
|
|
1326
1781
|
break;
|
|
1327
1782
|
case "Enter":
|
|
1328
1783
|
e.preventDefault(), this.focusedIndex >= 0 ? this.toggleOption(this.filteredOptions[this.focusedIndex]) : this.options.isAddNewAllowed && this.options.addNewCallback && this.input.value.trim() && this.handleAddNew(this.input.value.trim());
|
|
@@ -1348,20 +1803,20 @@ class zt {
|
|
|
1348
1803
|
}
|
|
1349
1804
|
}
|
|
1350
1805
|
handleDropdownClick(e) {
|
|
1351
|
-
|
|
1806
|
+
k.debug(`[${this.instanceId}] Dropdown clicked`, { target: e.target.className }), e.stopPropagation();
|
|
1352
1807
|
const t = e.target.closest("[data-action]");
|
|
1353
1808
|
if (t) {
|
|
1354
1809
|
e.preventDefault();
|
|
1355
|
-
const
|
|
1356
|
-
|
|
1810
|
+
const l = t.dataset.action;
|
|
1811
|
+
k.debug(`[${this.instanceId}] Action button clicked:`, l), l === "select-all" ? this.selectAll() : l === "clear-all" && this.clearAll();
|
|
1357
1812
|
return;
|
|
1358
1813
|
}
|
|
1359
|
-
const
|
|
1360
|
-
if (
|
|
1814
|
+
const o = e.target.closest(".ml__option");
|
|
1815
|
+
if (o && !o.classList.contains("ml__option--disabled")) {
|
|
1361
1816
|
e.preventDefault();
|
|
1362
|
-
const
|
|
1363
|
-
|
|
1364
|
-
value:
|
|
1817
|
+
const l = o.dataset.value, s = this.filteredOptions.find((n) => String(this.getItemValue(n)) === l);
|
|
1818
|
+
k.debug(`[${this.instanceId}] Option clicked:`, {
|
|
1819
|
+
value: l,
|
|
1365
1820
|
closeOnSelect: this.options.isCloseOnSelect,
|
|
1366
1821
|
placeholder: this.options.searchPlaceholder
|
|
1367
1822
|
}), s && this.toggleOption(s);
|
|
@@ -1369,56 +1824,56 @@ class zt {
|
|
|
1369
1824
|
}
|
|
1370
1825
|
handlePillClick(e) {
|
|
1371
1826
|
if (e.target.closest(".ml__count-clear")) {
|
|
1372
|
-
e.preventDefault(), e.stopPropagation(),
|
|
1827
|
+
e.preventDefault(), e.stopPropagation(), k.debug(`[${this.instanceId}] Count clear button clicked`), this.clearAll();
|
|
1373
1828
|
return;
|
|
1374
1829
|
}
|
|
1375
1830
|
if (e.target.closest(".ml__count-text")) {
|
|
1376
1831
|
e.preventDefault(), e.stopPropagation(), this.toggleSelectedPopover();
|
|
1377
1832
|
return;
|
|
1378
1833
|
}
|
|
1379
|
-
const
|
|
1380
|
-
if (
|
|
1381
|
-
if (e.preventDefault(), e.stopPropagation(),
|
|
1382
|
-
|
|
1834
|
+
const l = e.target.closest(".ml__pill-remove");
|
|
1835
|
+
if (l) {
|
|
1836
|
+
if (e.preventDefault(), e.stopPropagation(), l.dataset.action === "remove-hidden") {
|
|
1837
|
+
k.debug(`[${this.instanceId}] Remove hidden items button clicked`);
|
|
1383
1838
|
const a = this.options.pillsMaxVisible || 3;
|
|
1384
|
-
Array.from(this.selectedOptions.values()).slice(a).forEach((
|
|
1839
|
+
Array.from(this.selectedOptions.values()).slice(a).forEach((m) => this.deselectOption(m));
|
|
1385
1840
|
return;
|
|
1386
1841
|
}
|
|
1387
|
-
const n =
|
|
1842
|
+
const n = l.dataset.value, r = this.selectedOptions.get(n);
|
|
1388
1843
|
r && this.deselectOption(r);
|
|
1389
1844
|
return;
|
|
1390
1845
|
}
|
|
1391
1846
|
if (e.target.closest(".ml__pill--more") && !e.target.closest(".ml__pill-remove")) {
|
|
1392
|
-
e.preventDefault(), e.stopPropagation(),
|
|
1847
|
+
e.preventDefault(), e.stopPropagation(), k.debug(`[${this.instanceId}] '+X more' badge clicked, showing popover`), this.toggleSelectedPopover();
|
|
1393
1848
|
return;
|
|
1394
1849
|
}
|
|
1395
1850
|
}
|
|
1396
1851
|
handleClickOutside(e) {
|
|
1397
|
-
var
|
|
1852
|
+
var l;
|
|
1398
1853
|
const t = e.composedPath();
|
|
1399
1854
|
if (this.showSelectedPopover && !t.some(
|
|
1400
1855
|
(n) => n instanceof Node && (this.selectedPopover.contains(n) || this.countBadge.contains(n) || n.closest && n.closest(".ml__count-text"))
|
|
1401
1856
|
)) {
|
|
1402
|
-
|
|
1857
|
+
v.debug(`[${this.instanceId}] Closing selected popover due to click outside`), this.hideSelectedPopover();
|
|
1403
1858
|
return;
|
|
1404
1859
|
}
|
|
1405
1860
|
if (!this.isOpen) return;
|
|
1406
|
-
const
|
|
1861
|
+
const o = t.some(
|
|
1407
1862
|
(s) => s instanceof Node && (this.element.contains(s) || this.dropdown.contains(s) || this.hint && this.hint.contains(s))
|
|
1408
1863
|
);
|
|
1409
|
-
|
|
1864
|
+
k.debug(`[${this.instanceId}] handleClickOutside`, {
|
|
1410
1865
|
target: e.target.className,
|
|
1411
1866
|
targetTag: e.target.tagName,
|
|
1412
|
-
clickedInside:
|
|
1867
|
+
clickedInside: o,
|
|
1413
1868
|
pathLength: t.length,
|
|
1414
|
-
firstInPath: (
|
|
1869
|
+
firstInPath: (l = t[0]) == null ? void 0 : l.tagName,
|
|
1415
1870
|
elementContains: t.some((s) => s instanceof Node && this.element.contains(s)),
|
|
1416
1871
|
dropdownContains: t.some((s) => s instanceof Node && this.dropdown.contains(s)),
|
|
1417
1872
|
isConnected: this.dropdown.isConnected
|
|
1418
|
-
}),
|
|
1873
|
+
}), o || (k.warn(`[${this.instanceId}] Closing dropdown due to click outside`), this.close());
|
|
1419
1874
|
}
|
|
1420
1875
|
focusNext() {
|
|
1421
|
-
this.filteredOptions.length !== 0 && (this.focusedIndex = (this.focusedIndex + 1)
|
|
1876
|
+
this.filteredOptions.length !== 0 && (this.focusedIndex = Math.min(this.filteredOptions.length - 1, this.focusedIndex + 1), this.renderDropdown(), this.scrollToFocused());
|
|
1422
1877
|
}
|
|
1423
1878
|
focusPrevious() {
|
|
1424
1879
|
this.filteredOptions.length !== 0 && (this.focusedIndex = this.focusedIndex <= 0 ? this.filteredOptions.length - 1 : this.focusedIndex - 1, this.renderDropdown(), this.scrollToFocused());
|
|
@@ -1429,6 +1884,16 @@ class zt {
|
|
|
1429
1884
|
focusLast() {
|
|
1430
1885
|
this.filteredOptions.length !== 0 && (this.focusedIndex = this.filteredOptions.length - 1, this.renderDropdown(), this.scrollToFocused());
|
|
1431
1886
|
}
|
|
1887
|
+
focusNextMatch() {
|
|
1888
|
+
if (this.matchingIndices.size === 0) return;
|
|
1889
|
+
const e = Array.from(this.matchingIndices).sort((l, s) => l - s), t = e.findIndex((l) => l === this.focusedIndex), o = (t + 1) % e.length;
|
|
1890
|
+
this.focusedIndex = e[o], this.renderDropdown(), this.scrollToFocused(), k.debug(`[${this.instanceId}] Jumped to next match: index ${this.focusedIndex} (${t + 1} of ${e.length})`);
|
|
1891
|
+
}
|
|
1892
|
+
focusPreviousMatch() {
|
|
1893
|
+
if (this.matchingIndices.size === 0) return;
|
|
1894
|
+
const e = Array.from(this.matchingIndices).sort((l, s) => l - s), t = e.findIndex((l) => l === this.focusedIndex), o = t <= 0 ? e.length - 1 : t - 1;
|
|
1895
|
+
this.focusedIndex = e[o], this.renderDropdown(), this.scrollToFocused(), k.debug(`[${this.instanceId}] Jumped to previous match: index ${this.focusedIndex} (${t + 1} of ${e.length})`);
|
|
1896
|
+
}
|
|
1432
1897
|
focusPageUp() {
|
|
1433
1898
|
this.filteredOptions.length !== 0 && (this.focusedIndex = Math.max(0, this.focusedIndex - 10), this.renderDropdown(), this.scrollToFocused());
|
|
1434
1899
|
}
|
|
@@ -1436,44 +1901,48 @@ class zt {
|
|
|
1436
1901
|
this.filteredOptions.length !== 0 && (this.focusedIndex = Math.min(this.filteredOptions.length - 1, this.focusedIndex + 10), this.renderDropdown(), this.scrollToFocused());
|
|
1437
1902
|
}
|
|
1438
1903
|
scrollToFocused() {
|
|
1439
|
-
|
|
1440
|
-
|
|
1904
|
+
if (this.virtualScroll && this.focusedIndex >= 0)
|
|
1905
|
+
this.virtualScroll.scrollToIndex(this.focusedIndex);
|
|
1906
|
+
else {
|
|
1907
|
+
const e = this.dropdown.querySelector(".ml__option--focused");
|
|
1908
|
+
e && e.scrollIntoView({ block: "nearest", behavior: "smooth" });
|
|
1909
|
+
}
|
|
1441
1910
|
}
|
|
1442
1911
|
toggleOption(e) {
|
|
1443
|
-
const t = this.getItemValue(e),
|
|
1444
|
-
if (
|
|
1445
|
-
this.selectedValues.has(
|
|
1912
|
+
const t = this.getItemValue(e), o = String(t);
|
|
1913
|
+
if (k.debug(`[${this.instanceId}] toggleOption called`, { value: t, multiple: this.options.isMultipleEnabled }), !this.options.isMultipleEnabled) {
|
|
1914
|
+
this.selectedValues.has(o) ? (k.debug(`[${this.instanceId}] Deselecting option in single-select mode`, { value: t }), this.deselectOption(e)) : (k.debug(`[${this.instanceId}] Clearing previous selections and selecting new option`, { value: t }), this.selectedValues.clear(), this.selectedOptions.clear(), this.selectOption(e)), v.info(`[${this.instanceId}] ❌ Closing dropdown (single-select mode)`), this.close();
|
|
1446
1915
|
return;
|
|
1447
1916
|
}
|
|
1448
|
-
this.selectedValues.has(
|
|
1917
|
+
this.selectedValues.has(o) ? (k.debug(`[${this.instanceId}] Deselecting option`, { value: t }), this.deselectOption(e)) : (k.debug(`[${this.instanceId}] Selecting option`, { value: t }), this.selectOption(e)), k.debug(`[${this.instanceId}] Checking closeOnSelect`, {
|
|
1449
1918
|
closeOnSelect: this.options.isCloseOnSelect,
|
|
1450
1919
|
willClose: this.options.isCloseOnSelect === !0,
|
|
1451
1920
|
placeholder: this.options.searchPlaceholder
|
|
1452
|
-
}), this.options.isCloseOnSelect ? (
|
|
1921
|
+
}), this.options.isCloseOnSelect ? (v.info(`[${this.instanceId}] ❌ Closing dropdown (closeOnSelect=true)`), this.close()) : v.info(`[${this.instanceId}] ✅ Keeping dropdown open (closeOnSelect=false)`);
|
|
1453
1922
|
}
|
|
1454
1923
|
async handleAddNew(e) {
|
|
1455
1924
|
if (this.options.addNewCallback)
|
|
1456
1925
|
try {
|
|
1457
|
-
|
|
1926
|
+
C.debug(`[${this.instanceId}] Adding new option:`, e);
|
|
1458
1927
|
const t = await this.options.addNewCallback(e);
|
|
1459
1928
|
this.allOptions.push(t), this.filteredOptions.push(t), this.selectOption(t), this.input.value = "", this.renderDropdown(), this.renderPills(), this.options.isCloseOnSelect && this.close();
|
|
1460
1929
|
} catch (t) {
|
|
1461
|
-
|
|
1930
|
+
C.error(`[${this.instanceId}] Error adding new option:`, t);
|
|
1462
1931
|
}
|
|
1463
1932
|
}
|
|
1464
1933
|
selectOption(e) {
|
|
1465
|
-
const t = this.getItemValue(e),
|
|
1466
|
-
this.selectedValues.add(
|
|
1934
|
+
const t = this.getItemValue(e), o = String(t);
|
|
1935
|
+
this.selectedValues.add(o), this.selectedOptions.set(o, e), this.renderDropdown(), this.renderPills(), this.updateHiddenInput(), this.options.selectCallback && this.options.selectCallback(e), this.options.changeCallback && this.options.changeCallback(this.getSelected());
|
|
1467
1936
|
}
|
|
1468
1937
|
deselectOption(e) {
|
|
1469
|
-
const t = this.getItemValue(e),
|
|
1470
|
-
this.selectedValues.delete(
|
|
1938
|
+
const t = this.getItemValue(e), o = String(t);
|
|
1939
|
+
this.selectedValues.delete(o), this.selectedOptions.delete(o), this.renderDropdown(), this.renderPills(), this.updateHiddenInput(), this.options.deselectCallback && this.options.deselectCallback(e), this.options.changeCallback && this.options.changeCallback(this.getSelected());
|
|
1471
1940
|
}
|
|
1472
1941
|
selectAll() {
|
|
1473
1942
|
this.filteredOptions.forEach((e) => {
|
|
1474
1943
|
if (!this.getItemDisabled(e)) {
|
|
1475
|
-
const t = this.getItemValue(e),
|
|
1476
|
-
this.selectedValues.add(
|
|
1944
|
+
const t = this.getItemValue(e), o = String(t);
|
|
1945
|
+
this.selectedValues.add(o), this.selectedOptions.set(o, e);
|
|
1477
1946
|
}
|
|
1478
1947
|
}), this.renderDropdown(), this.renderPills(), this.updateHiddenInput(), this.options.changeCallback && this.options.changeCallback(this.getSelected());
|
|
1479
1948
|
}
|
|
@@ -1481,37 +1950,37 @@ class zt {
|
|
|
1481
1950
|
this.selectedValues.clear(), this.selectedOptions.clear(), this.renderDropdown(), this.renderPills(), this.updateHiddenInput(), this.options.changeCallback && this.options.changeCallback(this.getSelected());
|
|
1482
1951
|
}
|
|
1483
1952
|
open() {
|
|
1484
|
-
|
|
1953
|
+
v.debug(`[${this.instanceId}] open() called`, { isOpen: this.isOpen }), !this.isOpen && (this.isOpen = !0, this.element.classList.add("ml--open"), this.dropdown.classList.add("ml__dropdown--visible"), v.info(`[${this.instanceId}] Dropdown opened`), this.input.placeholder = this.options.searchPlaceholder, !this.options.isMultipleEnabled && this.options.isSearchEnabled && (this.input.value = ""), this.options.searchCallback && this.options.isKeepOptionsOnSearch && !this.searchTerm && (this.filteredOptions = [...this.allOptions], v.debug(`[${this.instanceId}] Showing ${this.allOptions.length} initial options on open`)), this.renderDropdown(), this.positionDropdown(), this.hint && (this.hint.classList.add("ml__hint--visible"), this.positionHint()));
|
|
1485
1954
|
}
|
|
1486
1955
|
close() {
|
|
1487
|
-
if (
|
|
1956
|
+
if (v.debug(`[${this.instanceId}] close() called`, { isOpen: this.isOpen }), !this.isOpen) return;
|
|
1488
1957
|
this.isOpen = !1, this.element.classList.remove("ml--open"), this.dropdown.classList.remove("ml__dropdown--visible"), this.hint && this.hint.classList.remove("ml__hint--visible"), this.searchTerm = "";
|
|
1489
1958
|
const e = this.options.isMultipleEnabled || this.options.isSearchEnabled;
|
|
1490
|
-
|
|
1959
|
+
v.warn(`[${this.instanceId}] close() - input clearing decision`, {
|
|
1491
1960
|
multiple: this.options.isMultipleEnabled,
|
|
1492
1961
|
enableSearch: this.options.isSearchEnabled,
|
|
1493
1962
|
willClearInput: e,
|
|
1494
1963
|
currentInputValue: this.input.value
|
|
1495
|
-
}), e ? (
|
|
1964
|
+
}), e ? (v.info(`[${this.instanceId}] 🧹 close() CLEARING input.value`), this.input.value = "") : v.info(`[${this.instanceId}] 🔒 close() KEEPING input.value = "${this.input.value}"`), this.filteredOptions = [...this.allOptions], this.focusedIndex = -1, v.info(`[${this.instanceId}] 📞 close() CALLING renderPills()`), this.renderPills(), v.info(`[${this.instanceId}] ✅ close() AFTER renderPills(), input.value = "${this.input.value}"`), this.dropdownCleanup && (this.dropdownCleanup(), this.dropdownCleanup = null), this.hintCleanup && (this.hintCleanup(), this.hintCleanup = null), this.dropdownPlacement = null, v.info(`[${this.instanceId}] Dropdown closed. Stack trace:`), v.trace();
|
|
1496
1965
|
}
|
|
1497
1966
|
positionDropdown() {
|
|
1498
|
-
this.dropdownCleanup =
|
|
1967
|
+
this.dropdownCleanup = le(
|
|
1499
1968
|
this.input,
|
|
1500
1969
|
this.dropdown,
|
|
1501
1970
|
() => {
|
|
1502
1971
|
const e = this.options.isPlacementLocked && this.dropdownPlacement ? this.dropdownPlacement : "bottom-start", t = [
|
|
1503
|
-
|
|
1504
|
-
...this.options.isPlacementLocked && this.dropdownPlacement ? [] : [
|
|
1505
|
-
|
|
1972
|
+
se(4),
|
|
1973
|
+
...this.options.isPlacementLocked && this.dropdownPlacement ? [] : [xe()],
|
|
1974
|
+
ne({ padding: 8 })
|
|
1506
1975
|
];
|
|
1507
|
-
|
|
1976
|
+
re(this.input, this.dropdown, {
|
|
1508
1977
|
placement: e,
|
|
1509
1978
|
middleware: t
|
|
1510
|
-
}).then(({ x:
|
|
1511
|
-
this.options.isPlacementLocked && !this.dropdownPlacement && (this.dropdownPlacement = s,
|
|
1979
|
+
}).then(({ x: o, y: l, placement: s }) => {
|
|
1980
|
+
this.options.isPlacementLocked && !this.dropdownPlacement && (this.dropdownPlacement = s, v.debug(`[${this.instanceId}] Locked dropdown placement:`, s));
|
|
1512
1981
|
const n = {
|
|
1513
|
-
left: `${
|
|
1514
|
-
top: `${
|
|
1982
|
+
left: `${o}px`,
|
|
1983
|
+
top: `${l}px`,
|
|
1515
1984
|
width: `${this.input.offsetWidth}px`
|
|
1516
1985
|
};
|
|
1517
1986
|
this.options.dropdownMinWidth && (n.minWidth = this.options.dropdownMinWidth), Object.assign(this.dropdown.style, n), this.hint && this.isOpen && this.positionHint();
|
|
@@ -1520,22 +1989,22 @@ class zt {
|
|
|
1520
1989
|
);
|
|
1521
1990
|
}
|
|
1522
1991
|
positionHint() {
|
|
1523
|
-
this.hint && (this.hintCleanup && this.hintCleanup(), this.hintCleanup =
|
|
1992
|
+
this.hint && (this.hintCleanup && this.hintCleanup(), this.hintCleanup = le(
|
|
1524
1993
|
this.input,
|
|
1525
1994
|
this.hint,
|
|
1526
1995
|
() => {
|
|
1527
1996
|
let e = "top-start";
|
|
1528
|
-
this.dropdownPlacement && (this.dropdownPlacement.startsWith("bottom") ? e = this.dropdownPlacement.replace("bottom", "top") : this.dropdownPlacement.startsWith("top") && (e = this.dropdownPlacement.replace("top", "bottom"))),
|
|
1997
|
+
this.dropdownPlacement && (this.dropdownPlacement.startsWith("bottom") ? e = this.dropdownPlacement.replace("bottom", "top") : this.dropdownPlacement.startsWith("top") && (e = this.dropdownPlacement.replace("top", "bottom"))), re(this.input, this.hint, {
|
|
1529
1998
|
placement: e,
|
|
1530
1999
|
middleware: [
|
|
1531
|
-
|
|
2000
|
+
se(4),
|
|
1532
2001
|
// Don't use flip() - we want hint to stay opposite of dropdown
|
|
1533
|
-
|
|
2002
|
+
ne({ padding: 8 })
|
|
1534
2003
|
]
|
|
1535
|
-
}).then(({ x: t, y:
|
|
2004
|
+
}).then(({ x: t, y: o }) => {
|
|
1536
2005
|
Object.assign(this.hint.style, {
|
|
1537
2006
|
left: `${t}px`,
|
|
1538
|
-
top: `${
|
|
2007
|
+
top: `${o}px`
|
|
1539
2008
|
});
|
|
1540
2009
|
});
|
|
1541
2010
|
}
|
|
@@ -1545,24 +2014,24 @@ class zt {
|
|
|
1545
2014
|
const e = this.element.dataset.initialValues;
|
|
1546
2015
|
if (e)
|
|
1547
2016
|
try {
|
|
1548
|
-
JSON.parse(e).forEach((
|
|
1549
|
-
const
|
|
1550
|
-
this.selectedValues.add(
|
|
1551
|
-
const s = this.allOptions.find((n) => String(this.getItemValue(n)) ===
|
|
1552
|
-
s && this.selectedOptions.set(
|
|
2017
|
+
JSON.parse(e).forEach((o) => {
|
|
2018
|
+
const l = String(o);
|
|
2019
|
+
this.selectedValues.add(l);
|
|
2020
|
+
const s = this.allOptions.find((n) => String(this.getItemValue(n)) === l);
|
|
2021
|
+
s && this.selectedOptions.set(l, s);
|
|
1553
2022
|
}), this.renderPills();
|
|
1554
2023
|
} catch (t) {
|
|
1555
|
-
|
|
2024
|
+
C.error(`[${this.instanceId}] Failed to parse initial values:`, t);
|
|
1556
2025
|
}
|
|
1557
2026
|
}
|
|
1558
2027
|
toggleSelectedPopover() {
|
|
1559
2028
|
this.showSelectedPopover ? this.hideSelectedPopover() : this.showPopover();
|
|
1560
2029
|
}
|
|
1561
2030
|
showPopover() {
|
|
1562
|
-
|
|
2031
|
+
v.debug(`[${this.instanceId}] showPopover() called`), this.isOpen && this.close(), this.showSelectedPopover = !0, this.renderSelectedPopover(), this.selectedPopover.classList.add("ml__selected-popover--visible"), this.positionSelectedPopover();
|
|
1563
2032
|
}
|
|
1564
2033
|
hideSelectedPopover() {
|
|
1565
|
-
|
|
2034
|
+
v.debug(`[${this.instanceId}] hideSelectedPopover() called`), this.showSelectedPopover = !1, this.selectedPopover.classList.remove("ml__selected-popover--visible"), this.selectedPopoverPlacement = null, this.selectedPopoverCleanup && (this.selectedPopoverCleanup(), this.selectedPopoverCleanup = null);
|
|
1566
2035
|
}
|
|
1567
2036
|
renderSelectedPopover() {
|
|
1568
2037
|
const e = Array.from(this.selectedOptions.values()), t = this.selectedValues.size;
|
|
@@ -1572,12 +2041,12 @@ class zt {
|
|
|
1572
2041
|
<button type="button" class="ml__selected-popover-close" aria-label="Close">×</button>
|
|
1573
2042
|
</div>
|
|
1574
2043
|
<div class="ml__selected-popover-body">
|
|
1575
|
-
${e.map((
|
|
1576
|
-
const
|
|
2044
|
+
${e.map((o) => {
|
|
2045
|
+
const l = this.getItemValue(o), s = this.getItemPillDisplayValue(o);
|
|
1577
2046
|
return `
|
|
1578
2047
|
<div class="ml__pill">
|
|
1579
2048
|
<span class="ml__pill-text">${s}</span>
|
|
1580
|
-
<button type="button" class="ml__pill-remove" data-value="${
|
|
2049
|
+
<button type="button" class="ml__pill-remove" data-value="${l}" aria-label="Remove ${s}"></button>
|
|
1581
2050
|
</div>
|
|
1582
2051
|
`;
|
|
1583
2052
|
}).join("")}
|
|
@@ -1589,31 +2058,31 @@ class zt {
|
|
|
1589
2058
|
e.preventDefault(), this.hideSelectedPopover();
|
|
1590
2059
|
return;
|
|
1591
2060
|
}
|
|
1592
|
-
const
|
|
1593
|
-
if (
|
|
2061
|
+
const o = e.target.closest(".ml__pill-remove");
|
|
2062
|
+
if (o) {
|
|
1594
2063
|
e.preventDefault();
|
|
1595
|
-
const
|
|
2064
|
+
const l = o.dataset.value, s = this.selectedOptions.get(l);
|
|
1596
2065
|
s && (this.deselectOption(s), this.renderSelectedPopover(), this.selectedValues.size === 0 && this.hideSelectedPopover());
|
|
1597
2066
|
}
|
|
1598
2067
|
}
|
|
1599
2068
|
positionSelectedPopover() {
|
|
1600
|
-
this.selectedPopoverCleanup =
|
|
2069
|
+
this.selectedPopoverCleanup = le(
|
|
1601
2070
|
this.input,
|
|
1602
2071
|
this.selectedPopover,
|
|
1603
2072
|
() => {
|
|
1604
2073
|
const e = this.selectedPopoverPlacement || "bottom-start";
|
|
1605
|
-
|
|
2074
|
+
re(this.input, this.selectedPopover, {
|
|
1606
2075
|
placement: e,
|
|
1607
2076
|
middleware: [
|
|
1608
|
-
|
|
1609
|
-
...this.selectedPopoverPlacement ? [] : [
|
|
1610
|
-
|
|
2077
|
+
se(4),
|
|
2078
|
+
...this.selectedPopoverPlacement ? [] : [xe()],
|
|
2079
|
+
ne({ padding: 8 })
|
|
1611
2080
|
]
|
|
1612
|
-
}).then(({ x: t, y:
|
|
1613
|
-
this.selectedPopoverPlacement || (this.selectedPopoverPlacement =
|
|
2081
|
+
}).then(({ x: t, y: o, placement: l }) => {
|
|
2082
|
+
this.selectedPopoverPlacement || (this.selectedPopoverPlacement = l, v.debug(`[${this.instanceId}] Locked popover placement:`, l));
|
|
1614
2083
|
const s = {
|
|
1615
2084
|
left: `${t}px`,
|
|
1616
|
-
top: `${
|
|
2085
|
+
top: `${o}px`,
|
|
1617
2086
|
width: `${this.input.offsetWidth}px`
|
|
1618
2087
|
};
|
|
1619
2088
|
this.options.dropdownMinWidth && (s.minWidth = this.options.dropdownMinWidth), Object.assign(this.selectedPopover.style, s);
|
|
@@ -1626,20 +2095,20 @@ class zt {
|
|
|
1626
2095
|
// ========================================================================
|
|
1627
2096
|
updateHiddenInput() {
|
|
1628
2097
|
if (!this.options.formFieldId) return;
|
|
1629
|
-
this.hiddenInputs.forEach((
|
|
1630
|
-
const e = this.options.valueFormat || "json", t = Array.from(this.selectedOptions.values()).map((
|
|
2098
|
+
this.hiddenInputs.forEach((l) => l.remove()), this.hiddenInputs = [];
|
|
2099
|
+
const e = this.options.valueFormat || "json", t = Array.from(this.selectedOptions.values()).map((l) => this.getItemValue(l)), o = this.options.hostElement || this.element;
|
|
1631
2100
|
if (e === "array")
|
|
1632
|
-
t.forEach((
|
|
2101
|
+
t.forEach((l) => {
|
|
1633
2102
|
const s = document.createElement("input");
|
|
1634
|
-
s.type = "hidden", s.name = `${this.options.formFieldId}[]`, s.value = String(
|
|
2103
|
+
s.type = "hidden", s.name = `${this.options.formFieldId}[]`, s.value = String(l), o.appendChild(s), this.hiddenInputs.push(s);
|
|
1635
2104
|
});
|
|
1636
2105
|
else {
|
|
1637
|
-
const
|
|
1638
|
-
|
|
2106
|
+
const l = document.createElement("input");
|
|
2107
|
+
l.type = "hidden", l.name = this.options.formFieldId, l.id = this.options.formFieldId, l.value = this.getFormValue(), o.appendChild(l), this.hiddenInputs.push(l);
|
|
1639
2108
|
}
|
|
1640
2109
|
}
|
|
1641
2110
|
getFormValue() {
|
|
1642
|
-
const e = Array.from(this.selectedOptions.values()).map((
|
|
2111
|
+
const e = Array.from(this.selectedOptions.values()).map((o) => this.getItemValue(o));
|
|
1643
2112
|
return this.options.getValueFormatCallback ? this.options.getValueFormatCallback(e) : (this.options.valueFormat || "json") === "csv" ? e.join(",") : JSON.stringify(e);
|
|
1644
2113
|
}
|
|
1645
2114
|
// ========================================================================
|
|
@@ -1650,8 +2119,8 @@ class zt {
|
|
|
1650
2119
|
}
|
|
1651
2120
|
setSelected(e) {
|
|
1652
2121
|
this.selectedValues = new Set(e.map((t) => String(t))), this.selectedOptions.clear(), e.forEach((t) => {
|
|
1653
|
-
const
|
|
1654
|
-
|
|
2122
|
+
const o = String(t), l = this.allOptions.find((s) => String(this.getItemValue(s)) === o);
|
|
2123
|
+
l && this.selectedOptions.set(o, l);
|
|
1655
2124
|
}), this.renderDropdown(), this.renderPills(), this.updateHiddenInput();
|
|
1656
2125
|
}
|
|
1657
2126
|
get selectedItem() {
|
|
@@ -1676,87 +2145,87 @@ class zt {
|
|
|
1676
2145
|
// ========================================================================
|
|
1677
2146
|
attachPillTooltips() {
|
|
1678
2147
|
if (!this.options.isPillTooltipsEnabled) {
|
|
1679
|
-
|
|
2148
|
+
v.debug(`[${this.instanceId}] Tooltips disabled - isPillTooltipsEnabled is false`);
|
|
1680
2149
|
return;
|
|
1681
2150
|
}
|
|
1682
2151
|
const e = this.pillsContainer.querySelectorAll(".ml__pill:not(.ml__pill--more)");
|
|
1683
|
-
|
|
1684
|
-
const
|
|
2152
|
+
v.debug(`[${this.instanceId}] Found ${e.length} pills to attach tooltips to`), e.forEach((o) => {
|
|
2153
|
+
const l = o, s = l.querySelector(".ml__pill-remove");
|
|
1685
2154
|
if (!s) return;
|
|
1686
2155
|
const n = s.dataset.value, r = this.selectedOptions.get(n);
|
|
1687
2156
|
if (!r) return;
|
|
1688
|
-
const a =
|
|
2157
|
+
const a = l.querySelector(".ml__pill-text");
|
|
1689
2158
|
a && this.createTooltipForElement(a, r, n);
|
|
1690
|
-
const
|
|
1691
|
-
this.createRemoveButtonTooltip(s,
|
|
2159
|
+
const d = this.getItemPillDisplayValue(r);
|
|
2160
|
+
this.createRemoveButtonTooltip(s, d, n);
|
|
1692
2161
|
});
|
|
1693
2162
|
const t = this.pillsContainer.querySelector(".ml__pill--more");
|
|
1694
2163
|
if (t) {
|
|
1695
|
-
const
|
|
1696
|
-
if (
|
|
1697
|
-
const
|
|
1698
|
-
this.createRemoveButtonTooltip(
|
|
2164
|
+
const o = t.querySelector(".ml__pill-remove");
|
|
2165
|
+
if (o && o.dataset.action === "remove-hidden") {
|
|
2166
|
+
const l = this.options.pillsMaxVisible || 3, n = Array.from(this.selectedOptions.values()).length - l;
|
|
2167
|
+
this.createRemoveButtonTooltip(o, `${n} hidden items`, "more-badge-remove");
|
|
1699
2168
|
}
|
|
1700
2169
|
}
|
|
1701
2170
|
}
|
|
1702
|
-
createTooltipForElement(e, t,
|
|
1703
|
-
const
|
|
1704
|
-
|
|
2171
|
+
createTooltipForElement(e, t, o) {
|
|
2172
|
+
const l = document.createElement("div");
|
|
2173
|
+
l.className = "ml__pill-tooltip";
|
|
1705
2174
|
let s;
|
|
1706
2175
|
if (this.options.getPillTooltipCallback)
|
|
1707
|
-
s = this.options.getPillTooltipCallback(t),
|
|
2176
|
+
s = this.options.getPillTooltipCallback(t), v.debug(`[${this.instanceId}] Using custom callback for tooltip content`);
|
|
1708
2177
|
else {
|
|
1709
|
-
const
|
|
1710
|
-
s =
|
|
1711
|
-
${
|
|
2178
|
+
const m = this.getItemPillDisplayValue(t), p = this.getItemSubtitle(t);
|
|
2179
|
+
s = p ? `${m}
|
|
2180
|
+
${p}` : m, v.debug(`[${this.instanceId}] Using default content: "${s}"`);
|
|
1712
2181
|
}
|
|
1713
|
-
typeof s == "string" ?
|
|
2182
|
+
typeof s == "string" ? l.textContent = s : l.appendChild(s), (this.options.container || document.body).appendChild(l), v.debug(`[${this.instanceId}] Tooltip element created and appended for "${o}"`), this.pillTooltips.set(o, l);
|
|
1714
2183
|
let r, a;
|
|
1715
|
-
const
|
|
1716
|
-
clearTimeout(a),
|
|
1717
|
-
|
|
2184
|
+
const d = () => {
|
|
2185
|
+
clearTimeout(a), v.debug(`[${this.instanceId}] Mouse entered pill "${o}", will show tooltip in ${this.options.pillTooltipDelay || 300}ms`), r = window.setTimeout(() => {
|
|
2186
|
+
v.debug(`[${this.instanceId}] Showing tooltip for "${o}"`), l.classList.add("ml__pill-tooltip--visible"), this.positionPillTooltip(e, l, o);
|
|
1718
2187
|
}, this.options.pillTooltipDelay || 300);
|
|
1719
|
-
},
|
|
2188
|
+
}, c = () => {
|
|
1720
2189
|
clearTimeout(r), a = window.setTimeout(() => {
|
|
1721
|
-
|
|
2190
|
+
l.classList.remove("ml__pill-tooltip--visible"), this.cleanupPillTooltip(o);
|
|
1722
2191
|
}, 100);
|
|
1723
2192
|
};
|
|
1724
|
-
e.addEventListener("mouseenter",
|
|
2193
|
+
e.addEventListener("mouseenter", d), e.addEventListener("mouseleave", c);
|
|
1725
2194
|
}
|
|
1726
|
-
createRemoveButtonTooltip(e, t,
|
|
1727
|
-
const
|
|
1728
|
-
|
|
1729
|
-
const n = `${
|
|
1730
|
-
this.pillTooltips.set(n,
|
|
2195
|
+
createRemoveButtonTooltip(e, t, o) {
|
|
2196
|
+
const l = document.createElement("div");
|
|
2197
|
+
l.className = "ml__pill-tooltip", l.textContent = `Remove ${t}`, (this.options.container || document.body).appendChild(l);
|
|
2198
|
+
const n = `${o}-remove`;
|
|
2199
|
+
this.pillTooltips.set(n, l);
|
|
1731
2200
|
let r, a;
|
|
1732
|
-
const
|
|
2201
|
+
const d = () => {
|
|
1733
2202
|
clearTimeout(a);
|
|
1734
|
-
const
|
|
1735
|
-
|
|
1736
|
-
|
|
2203
|
+
const m = this.pillTooltips.get(o);
|
|
2204
|
+
m && m.classList.remove("ml__pill-tooltip--visible"), r = window.setTimeout(() => {
|
|
2205
|
+
l.classList.add("ml__pill-tooltip--visible"), this.positionPillTooltip(e, l, n);
|
|
1737
2206
|
}, this.options.pillTooltipDelay || 300);
|
|
1738
|
-
},
|
|
2207
|
+
}, c = () => {
|
|
1739
2208
|
clearTimeout(r), a = window.setTimeout(() => {
|
|
1740
|
-
|
|
2209
|
+
l.classList.remove("ml__pill-tooltip--visible"), this.cleanupPillTooltip(n);
|
|
1741
2210
|
}, 100);
|
|
1742
2211
|
};
|
|
1743
|
-
e.addEventListener("mouseenter",
|
|
2212
|
+
e.addEventListener("mouseenter", d), e.addEventListener("mouseleave", c);
|
|
1744
2213
|
}
|
|
1745
|
-
positionPillTooltip(e, t,
|
|
1746
|
-
const
|
|
1747
|
-
|
|
2214
|
+
positionPillTooltip(e, t, o) {
|
|
2215
|
+
const l = le(e, t, () => {
|
|
2216
|
+
re(e, t, {
|
|
1748
2217
|
placement: this.options.pillTooltipPlacement || "top",
|
|
1749
2218
|
strategy: "fixed",
|
|
1750
2219
|
middleware: [
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
2220
|
+
se(this.options.pillTooltipOffset || 8),
|
|
2221
|
+
xe(),
|
|
2222
|
+
ne({ padding: 8 })
|
|
1754
2223
|
]
|
|
1755
2224
|
}).then(({ x: s, y: n }) => {
|
|
1756
2225
|
Object.assign(t.style, {
|
|
1757
2226
|
left: `${s}px`,
|
|
1758
2227
|
top: `${n}px`
|
|
1759
|
-
}),
|
|
2228
|
+
}), v.debug(`[${this.instanceId}] Positioned tooltip "${o}" at x:${s}, y:${n}`, {
|
|
1760
2229
|
placement: this.options.pillTooltipPlacement || "top",
|
|
1761
2230
|
tooltipClasses: t.className,
|
|
1762
2231
|
tooltipDisplay: window.getComputedStyle(t).display,
|
|
@@ -1767,7 +2236,7 @@ ${m}` : d, console.log(`[Tooltips] Using default content: "${s}"`);
|
|
|
1767
2236
|
});
|
|
1768
2237
|
});
|
|
1769
2238
|
});
|
|
1770
|
-
this.pillTooltipCleanups.set(
|
|
2239
|
+
this.pillTooltipCleanups.set(o, l);
|
|
1771
2240
|
}
|
|
1772
2241
|
cleanupPillTooltip(e) {
|
|
1773
2242
|
const t = this.pillTooltipCleanups.get(e);
|
|
@@ -1780,53 +2249,55 @@ ${m}` : d, console.log(`[Tooltips] Using default content: "${s}"`);
|
|
|
1780
2249
|
// PUBLIC API
|
|
1781
2250
|
// ========================================================================
|
|
1782
2251
|
destroy() {
|
|
1783
|
-
this.destroyAllPillTooltips(), this.dropdownCleanup && this.dropdownCleanup(), this.hintCleanup && this.hintCleanup(), this.selectedPopoverCleanup && this.selectedPopoverCleanup(), this.dropdown && this.dropdown.remove(), this.hint && this.hint.remove(), this.selectedPopover && this.selectedPopover.remove(), this.element.innerHTML = "", this.element.classList.remove("ml", "ml--open", "ml--no-checkboxes"),
|
|
2252
|
+
this.destroyAllPillTooltips(), this.dropdownCleanup && this.dropdownCleanup(), this.hintCleanup && this.hintCleanup(), this.selectedPopoverCleanup && this.selectedPopoverCleanup(), this.virtualScroll && (this.virtualScroll.destroy(), this.virtualScroll = null), this.dropdown && this.dropdown.remove(), this.hint && this.hint.remove(), this.selectedPopover && this.selectedPopover.remove(), this.element.innerHTML = "", this.element.classList.remove("ml", "ml--open", "ml--no-checkboxes"), H.info(`[${this.instanceId}] Component destroyed`);
|
|
1784
2253
|
}
|
|
1785
2254
|
}
|
|
1786
|
-
const Rt = '@charset "UTF-8";multi-select:not(:defined){display:block;min-height:2.5rem;color:transparent!important;background:transparent}.ml-wrapper{display:flex;flex-direction:column;align-items:stretch}.ml-wrapper--inline{flex-direction:row;align-items:flex-start}.ml{position:relative;width:100%}.ml__input-wrapper{position:relative;display:flex;align-items:center}.ml__input{width:100%;padding:var(--ml-input-padding, .5rem .75rem);padding-right:var(--ml-input-padding-right, 2.5rem);font-size:var(--ml-input-font-size, .875rem);border:var(--ml-input-border-style, 1px solid #d1d5db);border-radius:var(--ml-input-border-radius, .375rem);background:var(--ml-input-bg, #ffffff);color:var(--ml-input-text, #111827);cursor:pointer;transition:border-color var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}.ml__input:focus{outline:none;border-color:var(--ml-input-focus-border-color, #3b82f6)}.ml__input::placeholder{color:var(--ml-input-placeholder-color, #6b7280);opacity:0;transition:opacity var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}:host([data-ready]) .ml__input::placeholder{opacity:var(--ml-placeholder-opacity, .6)}.ml__toggle{position:absolute;right:var(--ml-toggle-right, .75rem);top:50%;transform:var(--ml-transform-center-y, translateY(-50%));pointer-events:none;color:var(--ml-toggle-color, #6b7280);transition:transform var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}.ml--open .ml__toggle{transform:var(--ml-transform-center-y, translateY(-50%)) rotate(var(--ml-transform-rotate-180, 180deg))}.ml__count-badge{position:absolute;right:var(--ml-count-badge-offset, 2rem);top:50%;transform:var(--ml-transform-center-y, translateY(-50%));padding:var(--ml-count-badge-padding, .125rem .25rem);background:var(--ml-count-badge-bg, #3b82f6);color:var(--ml-count-badge-color, #ffffff);font-size:var(--ml-count-badge-font-size, .75rem);font-weight:var(--ml-count-badge-font-weight, 600);border-radius:var(--ml-count-badge-border-radius, .25rem);cursor:pointer;transition:all var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}.ml__count-badge:hover{background:var(--ml-count-badge-bg-hover, #2563eb);transform:var(--ml-transform-center-y, translateY(-50%)) scale(var(--ml-transform-scale-hover, 1.1))}.ml__hint{display:none;position:absolute;z-index:var(--ml-z-index-popover, 10000);padding:var(--ml-hint-padding, .5rem .75rem);background:var(--ml-hint-bg, #ffffff);border:var(--ml-hint-border, 1px solid #e5e7eb);border-radius:var(--ml-hint-border-radius, .375rem);box-shadow:var(--ml-hint-box-shadow, 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -2px rgba(0, 0, 0, .1));font-size:var(--ml-hint-font-size, .75rem);color:var(--ml-hint-color, #6b7280);line-height:var(--ml-line-height-relaxed, 1.4);max-width:100%}.ml__hint--visible{display:block}.ml__dropdown{display:none;position:absolute;z-index:var(--ml-z-index-dropdown, 9999);background:var(--ml-dropdown-bg, #ffffff);border:var(--ml-dropdown-border, 1px solid #e5e7eb);border-radius:var(--ml-dropdown-border-radius, .375rem);box-shadow:var(--ml-dropdown-box-shadow, 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1));max-height:var(--ml-dropdown-max-height, 20rem);overflow-y:auto;color:var(--ml-dropdown-color, #111827)}.ml__dropdown--visible{display:block}.ml__actions{display:flex;gap:var(--ml-actions-gap, .25rem);padding:var(--ml-actions-padding, .5rem);border-bottom:var(--ml-actions-border-bottom, 1px solid #e5e7eb)}.ml__actions--sticky{position:sticky;top:0;z-index:var(--ml-z-index-sticky, 1);background:var(--ml-actions-bg, #ffffff)}.ml__action-btn{flex:1;padding:var(--ml-action-btn-padding, .25rem .5rem);font-size:var(--ml-action-btn-font-size, .75rem);border:var(--ml-action-btn-border, 1px solid #e5e7eb);border-radius:var(--ml-action-btn-border-radius, .25rem);background:var(--ml-action-btn-bg, transparent);color:var(--ml-action-btn-color, inherit);cursor:pointer;transition:all var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}.ml__action-btn:hover{background:var(--ml-action-btn-bg-hover, #f3f4f6);border-color:var(--ml-action-btn-border-color-hover, #3b82f6)}.ml__action-btn:active{transform:scale(var(--ml-transform-scale-active, .98))}.ml__options{padding:var(--ml-options-padding, .25rem 0)}.ml__group+.ml__group{border-top:var(--ml-group-border-top, 1px solid #e5e7eb);margin-top:var(--ml-group-margin-top, .25rem);padding-top:var(--ml-group-padding-top, .25rem)}.ml__group-label{padding:var(--ml-group-label-padding, .25rem .75rem);font-size:var(--ml-group-label-font-size, .75rem);font-weight:var(--ml-group-label-font-weight, 600);color:var(--ml-group-label-color, #6b7280);text-transform:var(--ml-group-label-transform, uppercase);letter-spacing:var(--ml-group-label-letter-spacing, .05em)}.ml__option{display:flex;align-items:flex-start;gap:var(--ml-option-gap, .5rem);padding:var(--ml-option-padding, .5rem .75rem);cursor:pointer;transition:background-color var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}.ml__option:hover{background:var(--ml-option-bg-hover, #f9fafb)}.ml__option--focused{background:var(--ml-option-bg-focused, #f9fafb);outline:var(--ml-option-outline-focused, 2px solid #3b82f6);outline-offset:var(--ml-option-focus-outline-offset, -2px)}.ml__option--selected{background:var(--ml-option-bg-selected, rgba(59, 130, 246, .1))}.ml__option--disabled{opacity:var(--ml-disabled-opacity, .5);cursor:not-allowed}.ml__option--disabled:hover{background:var(--ml-option-bg, transparent)}.ml__checkbox{flex-shrink:0;margin-top:var(--ml-checkbox-margin-top, .125rem);cursor:pointer}.ml__option--disabled .ml__checkbox{cursor:not-allowed}.ml__option-content{flex:1;display:flex;align-items:flex-start;gap:var(--ml-option-content-gap, .5rem);min-width:0}.ml__option-icon{flex-shrink:0;width:var(--ml-option-icon-size, 1.25rem);height:var(--ml-option-icon-size, 1.25rem);display:flex;align-items:center;justify-content:center;font-size:var(--ml-option-icon-font-size, 1rem)}.ml__option-icon svg{width:100%;height:100%;fill:currentColor}.ml__option-text{flex:1;min-width:0}.ml__option-title{font-size:var(--ml-option-title-font-size, .875rem);color:var(--ml-option-title-color, inherit);line-height:var(--ml-line-height-relaxed, 1.4)}.ml__option-title mark{background:var(--ml-option-mark-bg, rgba(59, 130, 246, .2));color:var(--ml-option-mark-color, inherit);font-weight:var(--ml-option-mark-font-weight, 600)}.ml__option-subtitle{margin-top:var(--ml-option-subtitle-margin-top, .25rem);font-size:var(--ml-option-subtitle-font-size, .75rem);color:var(--ml-option-subtitle-color, #6b7280);line-height:var(--ml-option-subtitle-line-height, 1.3)}.ml__empty{padding:var(--ml-empty-padding, 1rem .75rem);text-align:center;font-size:var(--ml-empty-font-size, .875rem);color:var(--ml-empty-color, #6b7280)}.ml__loader{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:var(--ml-loader-padding, 1rem);gap:var(--ml-loader-gap, .5rem)}.ml__loading-text{font-size:var(--ml-loading-text-font-size, .875rem);color:var(--ml-loading-text-color, #6b7280)}.ml__pills{display:flex;flex-wrap:wrap;gap:var(--ml-pills-gap, .5rem);padding:0}.ml__pills:empty{display:none}.ml__pills--bottom{margin-top:var(--ml-pills-margin-bottom, .5rem)}.ml__pills--top{margin-bottom:var(--ml-pills-margin-top, .5rem);order:var(--ml-order-first, -1)}.ml__pills--left{order:var(--ml-order-first, -1);margin-right:var(--ml-pills-margin-left, .25rem);justify-content:flex-end}.ml__pills--right{margin-left:var(--ml-pills-margin-right, .25rem);justify-content:flex-start}.ml__count-display{display:flex;align-items:center}.ml__count-display:empty{display:none}.ml__count-display--bottom{margin-top:var(--ml-count-display-margin-bottom, .5rem)}.ml__count-display--top{margin-bottom:var(--ml-count-display-margin-top, .5rem);order:var(--ml-order-first, -1)}.ml__count-display--left{order:var(--ml-order-first, -1);margin-right:var(--ml-count-display-margin-left, .5rem);justify-content:flex-start}.ml__count-display--right{margin-left:var(--ml-count-display-margin-right, .5rem);justify-content:flex-end}.ml__count-badge-wrapper{display:inline-flex;align-items:center;gap:var(--ml-count-badge-wrapper-gap, .25rem);background:var(--ml-count-badge-wrapper-bg, transparent);border:var(--ml-count-badge-wrapper-border, 1px solid #e5e7eb);border-radius:var(--ml-count-badge-wrapper-border-radius, .25rem);padding:var(--ml-count-badge-wrapper-padding, .25rem .5rem);transition:all var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}.ml__count-badge-wrapper:hover{background:var(--ml-count-badge-wrapper-bg-hover, #f9fafb);border-color:var(--ml-count-badge-wrapper-border-color-hover, #3b82f6)}.ml__count-text{display:inline-flex;align-items:center;background:var(--ml-count-text-bg, transparent);border:var(--ml-count-text-border, none);padding:0;font-size:var(--ml-count-text-font-size, .875rem);color:var(--ml-count-text-color, #111827);cursor:pointer;transition:color var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}.ml__count-clear{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:var(--ml-count-clear-size, 1rem);height:var(--ml-count-clear-size, 1rem);padding:0;border:none;background:var(--ml-count-clear-bg, transparent);color:var(--ml-count-clear-color, #6b7280);font-size:var(--ml-count-clear-font-size, 1.125rem);line-height:var(--ml-line-height-none, 1);cursor:pointer;border-radius:var(--ml-count-clear-border-radius, 50%);transition:all var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}.ml__count-clear:hover{background:var(--ml-count-clear-bg-hover, rgba(59, 130, 246, .2));color:var(--ml-count-clear-color-hover, #3b82f6)}.ml__count-clear:before{content:var(--ml-icon-clear, "×")}.ml__pill{display:inline-flex;align-items:center;height:var(--ml-pill-height, 1.5rem);font-size:var(--ml-pill-font-size, .75rem);font-weight:var(--ml-pill-font-weight, 600);line-height:var(--ml-line-height-none, 1);border-radius:var(--ml-pill-border-radius, .375rem);overflow:hidden;max-width:100%}.ml__pill-text{display:flex;align-items:center;height:100%;padding:var(--ml-pill-text-padding, 0 .5rem);background:var(--ml-pill-text-bg, #eff6ff);color:var(--ml-pill-text-color, #3b82f6);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:background-color var(--ml-transition-normal, .2s) ease}.ml__pill-remove{display:flex;align-items:center;justify-content:center;width:var(--ml-pill-remove-width, 1.5rem);height:100%;flex-shrink:0;background:var(--ml-pill-remove-bg, #3b82f6);color:var(--ml-pill-remove-color, #ffffff);border:var(--ml-pill-remove-border, none);cursor:pointer;transition:background-color var(--ml-transition-normal, .2s) ease;font-size:var(--ml-pill-remove-font-size, .75rem)}.ml__pill-remove:hover{background:var(--ml-pill-remove-bg-hover, #2563eb)}.ml__pill-remove:focus{outline:none;box-shadow:var(--ml-pill-remove-box-shadow-focus, 0 0 0 2px rgba(59, 130, 246, .5))}.ml__pill-remove:before{content:var(--ml-icon-remove, "×");font-size:var(--ml-font-size-base, 1rem);line-height:var(--ml-line-height-none, 1)}.ml__pill--more{cursor:pointer}.ml__pill--more .ml__pill-text{background:var(--ml-more-badge-bg, #eff6ff);font-weight:var(--ml-pill-font-weight, 600)}.ml__pill--more:hover .ml__pill-text{background:var(--ml-more-badge-hover-bg, #ffffff)}.ml__pill--more:active .ml__pill-text{background:var(--ml-more-badge-active-bg, #e0f2fe)}.ml__pill-tooltip{position:fixed;z-index:var(--ml-tooltip-z-index, 10000);opacity:0;visibility:hidden;transition:opacity var(--ml-transition-normal, .2s) ease,visibility var(--ml-transition-normal, .2s) ease;background:var(--ml-tooltip-bg, #333);color:var(--ml-tooltip-color, #fff);padding:var(--ml-tooltip-padding, .5rem .75rem);border-radius:var(--ml-tooltip-border-radius, .375rem);font-size:var(--ml-tooltip-font-size, .875rem);line-height:var(--ml-line-height-relaxed, 1.4);max-width:var(--ml-tooltip-max-width, 20rem);word-wrap:break-word;white-space:pre-wrap;box-shadow:var(--ml-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, .15));pointer-events:none}.ml__pill-tooltip--visible{opacity:1;visibility:visible}.ml__selected-popover{display:none;position:absolute;z-index:var(--ml-z-index-popover, 10000);background:var(--ml-selected-popover-bg, #ffffff);border:var(--ml-selected-popover-border, 1px solid #e5e7eb);border-radius:var(--ml-selected-popover-border-radius, .375rem);box-shadow:var(--ml-selected-popover-box-shadow, 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1));width:var(--ml-selected-popover-width, 20rem);max-height:var(--ml-selected-popover-max-height, 20rem);overflow:hidden}.ml__selected-popover--visible{display:flex;flex-direction:column}.ml__selected-popover-header{display:flex;align-items:center;justify-content:space-between;padding:var(--ml-selected-popover-header-padding, .5rem .75rem);background:var(--ml-selected-popover-header-bg, rgba(59, 130, 246, .1));border-bottom:var(--ml-selected-popover-header-border-bottom, 1px solid #e5e7eb);font-size:var(--ml-selected-popover-header-font-size, .875rem);font-weight:var(--ml-selected-popover-header-font-weight, 600);color:var(--ml-selected-popover-header-color, #111827)}.ml__selected-popover-close{display:flex;align-items:center;justify-content:center;width:var(--ml-popover-close-size, 1.5rem);height:var(--ml-popover-close-size, 1.5rem);padding:0;border:none;background:var(--ml-selected-popover-close-bg, transparent);color:var(--ml-selected-popover-close-color, #6b7280);font-size:var(--ml-selected-popover-close-font-size, 1.25rem);line-height:var(--ml-line-height-none, 1);cursor:pointer;border-radius:var(--ml-selected-popover-close-border-radius, 50%);transition:all var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}.ml__selected-popover-close:hover{background:var(--ml-selected-popover-close-bg-hover, rgba(59, 130, 246, .2));color:var(--ml-selected-popover-close-color-hover, #3b82f6)}.ml__selected-popover-body{display:flex;flex-direction:column;gap:var(--ml-selected-popover-body-gap, .25rem);padding:var(--ml-selected-popover-body-padding, .5rem);overflow-y:auto;max-height:var(--ml-selected-popover-body-max-height, 18rem)}.ml__selected-popover-body .ml__pill{width:100%}.ml__selected-popover-body .ml__pill-text{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.ml--rtl .ml__input-wrapper{direction:rtl}.ml--rtl .ml__input{text-align:right;padding-left:var(--ml-input-padding-right, 2.5rem);padding-right:var(--ml-input-padding-h, .75rem)}.ml--rtl .ml__toggle{left:var(--ml-toggle-right, .75rem)!important;right:auto!important}.ml--rtl .ml__count-badge{left:var(--ml-count-badge-offset, 2rem)!important;right:auto!important}.ml--rtl .ml__dropdown{direction:rtl;text-align:right}.ml--rtl .ml__option{flex-direction:row-reverse}.ml--rtl .ml__checkbox{margin-left:var(--ml-spacing-sm, .5rem);margin-right:0}.ml--rtl .ml__option-content{text-align:right}.ml--rtl .ml__option-icon{margin-left:var(--ml-spacing-xs, .25rem);margin-right:0}.ml--rtl .ml__pills{direction:rtl}.ml--rtl .ml__pill{flex-direction:row-reverse}.ml--rtl .ml__pill-remove{border-radius:var(--ml-pill-remove-border-radius-rtl, .375rem) 0 0 var(--ml-pill-remove-border-radius-rtl, .375rem);border-left:var(--ml-pill-remove-border, none);border-right:none}.ml--rtl .ml__pill-text{border-radius:0 var(--ml-pill-text-border-radius-rtl, .375rem) var(--ml-pill-text-border-radius-rtl, .375rem) 0}.ml--rtl .ml__count-display{direction:rtl}.ml--rtl .ml__count-badge-wrapper{flex-direction:row-reverse}.ml--rtl .ml__selected-popover{direction:rtl;text-align:right}.ml--rtl .ml__actions{direction:rtl}.ml--rtl .ml__group-label,.ml--rtl .ml__empty{text-align:right}.ml--rtl .ml__hint{direction:rtl;text-align:right}.ml--xs .ml__input{font-size:var(--ml-font-size-xs, .75rem)}.ml--xs .ml__option{padding:var(--ml-spacing-xs, .25rem) var(--ml-spacing-sm, .5rem)}.ml--xs .ml__option-title{font-size:var(--ml-font-size-xs, .75rem)}.ml--xs .ml__pill{font-size:var(--ml-font-size-2xs, .625rem)}.ml--sm .ml__input,.ml--sm .ml__option-title{font-size:var(--ml-font-size-xs, .75rem)}.ml--lg .ml__input,.ml--lg .ml__option-title{font-size:var(--ml-font-size-base, 1rem)}.ml--lg .ml__pill{font-size:var(--ml-font-size-sm, .875rem)}.ml--xl .ml__input,.ml--xl .ml__option-title{font-size:var(--ml-font-size-lg, 1.125rem)}.ml--xl .ml__pill{font-size:var(--ml-font-size-base, 1rem)}.ml--disabled .ml__input{opacity:var(--ml-disabled-input-opacity, .6);cursor:not-allowed;background:var(--ml-input-bg-disabled, rgba(107, 114, 128, .05))}.ml--disabled .ml__toggle{opacity:var(--ml-disabled-input-opacity, .6)}.ml--no-checkboxes .ml__option{gap:0;padding-left:var(--ml-option-padding-h, .75rem)}.ml--no-checkboxes .ml__option-content{padding-left:0}.ml-debug-info{margin-top:.25rem;padding:.25rem;background-color:#f9fafb;border:1px solid #e5e7eb;border-radius:.375rem;font-size:.75rem;color:#111827}.ml-debug-info details summary{cursor:pointer;font-weight:600;color:#2563eb;-webkit-user-select:none;user-select:none;padding:.25rem;border-radius:.25rem}.ml-debug-info details summary:hover{background-color:#f3f4f6}.ml-debug-info details summary:focus{outline:2px solid #3b82f6;outline-offset:2px}.ml-debug-info .ml-debug-stats{display:flex;flex-direction:column;gap:.25rem;margin-top:.25rem;padding:.25rem;background-color:#fff;border-radius:.25rem}.ml-debug-info .ml-debug-stats span{display:flex;justify-content:space-between;padding:2px 4px;font-family:monospace;font-size:.625rem}.ml-debug-info .ml-debug-stats span:before{content:"•";margin-right:.25rem;color:#3b82f6}', Nt = typeof HTMLElement < "u" ? HTMLElement : class {
|
|
1787
|
-
},
|
|
1788
|
-
function
|
|
1789
|
-
return Array.from(
|
|
2255
|
+
const pi = '@charset "UTF-8";:host{--ml-accent-color: #3b82f6;--ml-accent-color-hover: #2563eb;--ml-accent-color-active: #1d4ed8;--ml-text-primary: #111827;--ml-text-secondary: #6b7280;--ml-text-white: #ffffff;--ml-primary-bg: #f3f4f6;--ml-primary-bg-hover: #e5e7eb;--ml-border-color: #e5e7eb;--ml-input-padding: .5rem .75rem;--ml-input-padding-right: 2.5rem;--ml-input-font-size: .875rem;--ml-input-border-style: 1px solid #d1d5db;--ml-input-border-radius: .375rem;--ml-input-bg: #ffffff;--ml-input-text: #111827;--ml-input-focus-border-color: #3b82f6;--ml-input-placeholder-color: #6b7280;--ml-input-bg-disabled: rgba(107, 114, 128, .05);--ml-toggle-right: .75rem;--ml-toggle-color: #6b7280;--ml-transform-center-y: translateY(-50%);--ml-transform-rotate-180: 180deg;--ml-count-badge-offset: 2rem;--ml-count-badge-padding: .125rem .25rem;--ml-count-badge-bg: #3b82f6;--ml-count-badge-color: #ffffff;--ml-count-badge-font-size: .75rem;--ml-count-badge-font-weight: 600;--ml-count-badge-border-radius: .25rem;--ml-count-badge-bg-hover: #2563eb;--ml-transform-scale-hover: 1.1;--ml-hint-padding: .5rem .75rem;--ml-hint-bg: #ffffff;--ml-hint-border: 1px solid #e5e7eb;--ml-hint-border-radius: .375rem;--ml-hint-box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -2px rgba(0, 0, 0, .1);--ml-hint-font-size: .75rem;--ml-hint-color: #6b7280;--ml-line-height-relaxed: 1.4;--ml-dropdown-bg: #ffffff;--ml-dropdown-border: 1px solid #e5e7eb;--ml-dropdown-border-radius: .375rem;--ml-dropdown-box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1);--ml-dropdown-max-height: 20rem;--ml-dropdown-color: #111827;--ml-z-index-dropdown: 9999;--ml-z-index-sticky: 1;--ml-actions-gap: .25rem;--ml-actions-padding: .5rem;--ml-actions-border-bottom: 1px solid #e5e7eb;--ml-actions-bg: #ffffff;--ml-action-btn-padding: .25rem .5rem;--ml-action-btn-font-size: .75rem;--ml-action-btn-border: 1px solid #e5e7eb;--ml-action-btn-border-radius: .25rem;--ml-action-btn-bg: transparent;--ml-action-btn-color: inherit;--ml-action-btn-bg-hover: #f3f4f6;--ml-action-btn-border-color-hover: #3b82f6;--ml-transform-scale-active: .98;--ml-options-padding: .25rem 0;--ml-group-border-top: 1px solid #e5e7eb;--ml-group-margin-top: .25rem;--ml-group-padding-top: .25rem;--ml-group-label-padding: .25rem .75rem;--ml-group-label-font-size: .75rem;--ml-group-label-font-weight: 600;--ml-group-label-color: #6b7280;--ml-group-label-transform: uppercase;--ml-group-label-letter-spacing: .05em;--ml-option-gap: .5rem;--ml-option-padding: .5rem .75rem;--ml-option-padding-h: .75rem;--ml-option-bg: transparent;--ml-option-bg-hover: #f9fafb;--ml-option-bg-focused: #f9fafb;--ml-option-outline-focused: 2px solid #3b82f6;--ml-option-focus-outline-offset: -2px;--ml-option-bg-matched: rgba(59, 130, 246, .08);--ml-option-border-matched: 3px solid rgba(59, 130, 246, .4);--ml-option-bg-selected: rgba(59, 130, 246, .1);--ml-disabled-opacity: .5;--ml-option-content-gap: .5rem;--ml-option-icon-size: 1.25rem;--ml-option-icon-font-size: 1rem;--ml-option-title-font-size: .875rem;--ml-option-title-color: inherit;--ml-option-mark-bg: rgba(59, 130, 246, .2);--ml-option-mark-color: inherit;--ml-option-mark-font-weight: 600;--ml-option-subtitle-margin-top: .25rem;--ml-option-subtitle-font-size: .75rem;--ml-option-subtitle-color: #6b7280;--ml-option-subtitle-line-height: 1.3;--ml-checkbox-margin-top: .125rem;--ml-empty-padding: 1rem .75rem;--ml-empty-font-size: .875rem;--ml-empty-color: #6b7280;--ml-loader-padding: 1rem;--ml-loader-gap: .5rem;--ml-loading-text-font-size: .875rem;--ml-loading-text-color: #6b7280;--ml-pills-gap: .5rem;--ml-pills-margin-bottom: .5rem;--ml-pills-margin-top: .5rem;--ml-pills-margin-left: .25rem;--ml-pills-margin-right: .25rem;--ml-pill-gap: .5rem;--ml-pill-height: 1.5rem;--ml-pill-font-size: .75rem;--ml-pill-font-weight: 600;--ml-pill-border-radius: .375rem;--ml-pill-bg: #eff6ff;--ml-pill-bg-hover: #ffffff;--ml-pill-bg-active: #e0f2fe;--ml-order-first: -1;--ml-pill-text-padding: 0 .5rem;--ml-pill-text-bg: #eff6ff;--ml-pill-text-color: #3b82f6;--ml-pill-remove-width: 1.5rem;--ml-pill-remove-bg: #3b82f6;--ml-pill-remove-color: #ffffff;--ml-pill-remove-border: none;--ml-pill-remove-font-size: .75rem;--ml-pill-remove-bg-hover: #2563eb;--ml-pill-remove-box-shadow-focus: 0 0 0 2px rgba(59, 130, 246, .5);--ml-icon-remove: "×";--ml-more-badge-bg: #eff6ff;--ml-more-badge-hover-bg: #ffffff;--ml-more-badge-active-bg: #e0f2fe;--ml-count-display-margin-bottom: .5rem;--ml-count-display-margin-top: .5rem;--ml-count-display-margin-left: .5rem;--ml-count-display-margin-right: .5rem;--ml-count-badge-wrapper-bg: transparent;--ml-count-badge-wrapper-border: 1px solid #e5e7eb;--ml-count-badge-wrapper-border-radius: .25rem;--ml-count-badge-wrapper-padding: .25rem .5rem;--ml-count-badge-wrapper-gap: .25rem;--ml-count-badge-wrapper-bg-hover: #f9fafb;--ml-count-badge-wrapper-border-color-hover: #3b82f6;--ml-count-text-bg: transparent;--ml-count-text-border: none;--ml-count-text-font-size: .875rem;--ml-count-text-color: #111827;--ml-count-clear-size: 1rem;--ml-count-clear-bg: transparent;--ml-count-clear-color: #6b7280;--ml-count-clear-font-size: 1.125rem;--ml-count-clear-border-radius: 50%;--ml-count-clear-bg-hover: rgba(59, 130, 246, .2);--ml-count-clear-color-hover: #3b82f6;--ml-icon-clear: "×";--ml-tooltip-bg: #333;--ml-tooltip-color: #fff;--ml-tooltip-padding: .5rem .75rem;--ml-tooltip-border-radius: .375rem;--ml-tooltip-font-size: .875rem;--ml-tooltip-max-width: 20rem;--ml-tooltip-shadow: 0 2px 8px rgba(0, 0, 0, .15);--ml-tooltip-z-index: 10000;--ml-z-index-popover: 10000;--ml-selected-popover-width: 20rem;--ml-selected-popover-max-height: 20rem;--ml-selected-popover-bg: #ffffff;--ml-selected-popover-border: 1px solid #e5e7eb;--ml-selected-popover-border-radius: .375rem;--ml-selected-popover-box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1);--ml-selected-popover-header-padding: .5rem .75rem;--ml-selected-popover-header-bg: rgba(59, 130, 246, .1);--ml-selected-popover-header-border-bottom: 1px solid #e5e7eb;--ml-selected-popover-header-font-size: .875rem;--ml-selected-popover-header-font-weight: 600;--ml-selected-popover-header-color: #111827;--ml-popover-close-size: 1.5rem;--ml-selected-popover-close-bg: transparent;--ml-selected-popover-close-color: #6b7280;--ml-selected-popover-close-font-size: 1.25rem;--ml-selected-popover-close-border-radius: 50%;--ml-selected-popover-close-bg-hover: rgba(59, 130, 246, .2);--ml-selected-popover-close-color-hover: #3b82f6;--ml-selected-popover-body-gap: .25rem;--ml-selected-popover-body-padding: .5rem;--ml-selected-popover-body-max-height: 18rem;--ml-font-size-2xs: .625rem;--ml-font-size-xs: .75rem;--ml-font-size-sm: .875rem;--ml-font-size-base: 1rem;--ml-font-size-lg: 1.125rem;--ml-font-weight-medium: 500;--ml-font-weight-semibold: 600;--ml-line-height-none: 1;--ml-spacing-xs: .25rem;--ml-spacing-sm: .5rem;--ml-spacing-md: .75rem;--ml-spacing-lg: 1rem;--ml-transition-fast: .15s;--ml-transition-normal: .2s;--ml-easing-snappy: cubic-bezier(.4, 0, .2, 1);--ml-placeholder-opacity: .6;--ml-disabled-input-opacity: .6}multi-select:not(:defined){display:block;min-height:2.5rem;color:transparent!important;background:transparent}.ml-wrapper{display:flex;flex-direction:column;align-items:stretch}.ml-wrapper--inline{flex-direction:row;align-items:flex-start}.ml{position:relative;width:100%}.ml__input-wrapper{position:relative;display:flex;align-items:center}.ml__input{width:100%;padding:var(--ml-input-padding, .5rem .75rem);padding-right:var(--ml-input-padding-right, 2.5rem);font-size:var(--ml-input-font-size, .875rem);border:var(--ml-input-border-style, 1px solid #d1d5db);border-radius:var(--ml-input-border-radius, .375rem);background:var(--ml-input-bg, #ffffff);color:var(--ml-input-text, #111827);cursor:pointer;transition:border-color var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}.ml__input:focus{outline:none;border-color:var(--ml-input-focus-border-color, #3b82f6)}.ml__input::placeholder{color:var(--ml-input-placeholder-color, #6b7280);opacity:0;transition:opacity var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}:host([data-ready]) .ml__input::placeholder{opacity:var(--ml-placeholder-opacity, .6)}.ml__toggle{position:absolute;right:var(--ml-toggle-right, .75rem);top:50%;transform:var(--ml-transform-center-y, translateY(-50%));pointer-events:none;color:var(--ml-toggle-color, #6b7280);transition:transform var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}.ml--open .ml__toggle{transform:var(--ml-transform-center-y, translateY(-50%)) rotate(var(--ml-transform-rotate-180, 180deg))}.ml__count-badge{position:absolute;right:var(--ml-count-badge-offset, 2rem);top:50%;transform:var(--ml-transform-center-y, translateY(-50%));padding:var(--ml-count-badge-padding, .125rem .25rem);background:var(--ml-count-badge-bg, #3b82f6);color:var(--ml-count-badge-color, #ffffff);font-size:var(--ml-count-badge-font-size, .75rem);font-weight:var(--ml-count-badge-font-weight, 600);border-radius:var(--ml-count-badge-border-radius, .25rem);cursor:pointer;transition:all var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}.ml__count-badge:hover{background:var(--ml-count-badge-bg-hover, #2563eb);transform:var(--ml-transform-center-y, translateY(-50%)) scale(var(--ml-transform-scale-hover, 1.1))}.ml__hint{display:none;position:absolute;z-index:var(--ml-z-index-popover, 10000);padding:var(--ml-hint-padding, .5rem .75rem);background:var(--ml-hint-bg, #ffffff);border:var(--ml-hint-border, 1px solid #e5e7eb);border-radius:var(--ml-hint-border-radius, .375rem);box-shadow:var(--ml-hint-box-shadow, 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -2px rgba(0, 0, 0, .1));font-size:var(--ml-hint-font-size, .75rem);color:var(--ml-hint-color, #6b7280);line-height:var(--ml-line-height-relaxed, 1.4);max-width:100%}.ml__hint--visible{display:block}.ml__dropdown{display:none;position:absolute;z-index:var(--ml-z-index-dropdown, 9999);background:var(--ml-dropdown-bg, #ffffff);border:var(--ml-dropdown-border, 1px solid #e5e7eb);border-radius:var(--ml-dropdown-border-radius, .375rem);box-shadow:var(--ml-dropdown-box-shadow, 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1));max-height:var(--ml-dropdown-max-height, 20rem);overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch;color:var(--ml-dropdown-color, #111827)}.ml__dropdown--visible{display:block}.ml__dropdown--virtual{overflow-y:visible;max-height:none}.ml__actions{display:flex;gap:var(--ml-actions-gap, .25rem);padding:var(--ml-actions-padding, .5rem);border-bottom:var(--ml-actions-border-bottom, 1px solid #e5e7eb)}.ml__actions--sticky{position:sticky;top:0;z-index:var(--ml-z-index-sticky, 1);background:var(--ml-actions-bg, #ffffff)}.ml__action-btn{flex:1;padding:var(--ml-action-btn-padding, .25rem .5rem);font-size:var(--ml-action-btn-font-size, .75rem);border:var(--ml-action-btn-border, 1px solid #e5e7eb);border-radius:var(--ml-action-btn-border-radius, .25rem);background:var(--ml-action-btn-bg, transparent);color:var(--ml-action-btn-color, inherit);cursor:pointer;transition:all var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}.ml__action-btn:hover{background:var(--ml-action-btn-bg-hover, #f3f4f6);border-color:var(--ml-action-btn-border-color-hover, #3b82f6)}.ml__action-btn:active{transform:scale(var(--ml-transform-scale-active, .98))}.ml__options{padding:var(--ml-options-padding, .25rem 0)}.ml__options--virtual .ml__option{height:var(--ml-option-height, 50px);min-height:var(--ml-option-height, 50px);max-height:var(--ml-option-height, 50px);overflow:hidden;box-sizing:border-box}.ml__group+.ml__group{border-top:var(--ml-group-border-top, 1px solid #e5e7eb);margin-top:var(--ml-group-margin-top, .25rem);padding-top:var(--ml-group-padding-top, .25rem)}.ml__group-label{padding:var(--ml-group-label-padding, .25rem .75rem);font-size:var(--ml-group-label-font-size, .75rem);font-weight:var(--ml-group-label-font-weight, 600);color:var(--ml-group-label-color, #6b7280);text-transform:var(--ml-group-label-transform, uppercase);letter-spacing:var(--ml-group-label-letter-spacing, .05em)}.ml__option{display:flex;align-items:flex-start;gap:var(--ml-option-gap, .5rem);padding:var(--ml-option-padding, .5rem .75rem);cursor:pointer;transition:background-color var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}.ml__option:hover{background:var(--ml-option-bg-hover, #f9fafb)}.ml__option--focused{background:var(--ml-option-bg-focused, #f9fafb);outline:var(--ml-option-outline-focused, 2px solid #3b82f6);outline-offset:var(--ml-option-focus-outline-offset, -2px)}.ml__option--matched{background:var(--ml-option-bg-matched, rgba(59, 130, 246, .08));border-left:var(--ml-option-border-matched, 3px solid rgba(59, 130, 246, .4))}.ml__option--selected{background:var(--ml-option-bg-selected, rgba(59, 130, 246, .1))}.ml__option--disabled{opacity:var(--ml-disabled-opacity, .5);cursor:not-allowed}.ml__option--disabled:hover{background:var(--ml-option-bg, transparent)}.ml__checkbox{flex-shrink:0;margin-top:var(--ml-checkbox-margin-top, .125rem);cursor:pointer}.ml__option--disabled .ml__checkbox{cursor:not-allowed}.ml__option-content{flex:1;display:flex;align-items:flex-start;gap:var(--ml-option-content-gap, .5rem);min-width:0}.ml__option-icon{flex-shrink:0;width:var(--ml-option-icon-size, 1.25rem);height:var(--ml-option-icon-size, 1.25rem);display:flex;align-items:center;justify-content:center;font-size:var(--ml-option-icon-font-size, 1rem)}.ml__option-icon svg{width:100%;height:100%;fill:currentColor}.ml__option-text{flex:1;min-width:0}.ml__option-title{font-size:var(--ml-option-title-font-size, .875rem);color:var(--ml-option-title-color, inherit);line-height:var(--ml-line-height-relaxed, 1.4)}.ml__option-title mark{background:var(--ml-option-mark-bg, rgba(59, 130, 246, .2));color:var(--ml-option-mark-color, inherit);font-weight:var(--ml-option-mark-font-weight, 600)}.ml__option-subtitle{margin-top:var(--ml-option-subtitle-margin-top, .25rem);font-size:var(--ml-option-subtitle-font-size, .75rem);color:var(--ml-option-subtitle-color, #6b7280);line-height:var(--ml-option-subtitle-line-height, 1.3)}.ml__empty{padding:var(--ml-empty-padding, 1rem .75rem);text-align:center;font-size:var(--ml-empty-font-size, .875rem);color:var(--ml-empty-color, #6b7280)}.ml__loader{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:var(--ml-loader-padding, 1rem);gap:var(--ml-loader-gap, .5rem)}.ml__loading-text{font-size:var(--ml-loading-text-font-size, .875rem);color:var(--ml-loading-text-color, #6b7280)}.ml__pills{display:flex;flex-wrap:wrap;gap:var(--ml-pills-gap, .5rem);padding:0}.ml__pills:empty{display:none}.ml__pills--bottom{margin-top:var(--ml-pills-margin-bottom, .5rem)}.ml__pills--top{margin-bottom:var(--ml-pills-margin-top, .5rem);order:var(--ml-order-first, -1)}.ml__pills--left{order:var(--ml-order-first, -1);margin-right:var(--ml-pills-margin-left, .25rem);justify-content:flex-end}.ml__pills--right{margin-left:var(--ml-pills-margin-right, .25rem);justify-content:flex-start}.ml__count-display{display:flex;align-items:center}.ml__count-display:empty{display:none}.ml__count-display--bottom{margin-top:var(--ml-count-display-margin-bottom, .5rem)}.ml__count-display--top{margin-bottom:var(--ml-count-display-margin-top, .5rem);order:var(--ml-order-first, -1)}.ml__count-display--left{order:var(--ml-order-first, -1);margin-right:var(--ml-count-display-margin-left, .5rem);justify-content:flex-start}.ml__count-display--right{margin-left:var(--ml-count-display-margin-right, .5rem);justify-content:flex-end}.ml__count-badge-wrapper{display:inline-flex;align-items:center;gap:var(--ml-count-badge-wrapper-gap, .25rem);background:var(--ml-count-badge-wrapper-bg, transparent);border:var(--ml-count-badge-wrapper-border, 1px solid #e5e7eb);border-radius:var(--ml-count-badge-wrapper-border-radius, .25rem);padding:var(--ml-count-badge-wrapper-padding, .25rem .5rem);transition:all var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}.ml__count-badge-wrapper:hover{background:var(--ml-count-badge-wrapper-bg-hover, #f9fafb);border-color:var(--ml-count-badge-wrapper-border-color-hover, #3b82f6)}.ml__count-text{display:inline-flex;align-items:center;background:var(--ml-count-text-bg, transparent);border:var(--ml-count-text-border, none);padding:0;font-size:var(--ml-count-text-font-size, .875rem);color:var(--ml-count-text-color, #111827);cursor:pointer;transition:color var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}.ml__count-clear{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:var(--ml-count-clear-size, 1rem);height:var(--ml-count-clear-size, 1rem);padding:0;border:none;background:var(--ml-count-clear-bg, transparent);color:var(--ml-count-clear-color, #6b7280);font-size:var(--ml-count-clear-font-size, 1.125rem);line-height:var(--ml-line-height-none, 1);cursor:pointer;border-radius:var(--ml-count-clear-border-radius, 50%);transition:all var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}.ml__count-clear:hover{background:var(--ml-count-clear-bg-hover, rgba(59, 130, 246, .2));color:var(--ml-count-clear-color-hover, #3b82f6)}.ml__count-clear:before{content:var(--ml-icon-clear, "×")}.ml__pill{display:inline-flex;align-items:center;height:var(--ml-pill-height, 1.5rem);font-size:var(--ml-pill-font-size, .75rem);font-weight:var(--ml-pill-font-weight, 600);line-height:var(--ml-line-height-none, 1);border-radius:var(--ml-pill-border-radius, .375rem);overflow:hidden;max-width:100%}.ml__pill-text{display:flex;align-items:center;height:100%;padding:var(--ml-pill-text-padding, 0 .5rem);background:var(--ml-pill-text-bg, #eff6ff);color:var(--ml-pill-text-color, #3b82f6);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:background-color var(--ml-transition-normal, .2s) ease}.ml__pill-remove{display:flex;align-items:center;justify-content:center;width:var(--ml-pill-remove-width, 1.5rem);height:100%;flex-shrink:0;background:var(--ml-pill-remove-bg, #3b82f6);color:var(--ml-pill-remove-color, #ffffff);border:var(--ml-pill-remove-border, none);cursor:pointer;transition:background-color var(--ml-transition-normal, .2s) ease;font-size:var(--ml-pill-remove-font-size, .75rem)}.ml__pill-remove:hover{background:var(--ml-pill-remove-bg-hover, #2563eb)}.ml__pill-remove:focus{outline:none;box-shadow:var(--ml-pill-remove-box-shadow-focus, 0 0 0 2px rgba(59, 130, 246, .5))}.ml__pill-remove:before{content:var(--ml-icon-remove, "×");font-size:var(--ml-font-size-base, 1rem);line-height:var(--ml-line-height-none, 1)}.ml__pill--more{cursor:pointer}.ml__pill--more .ml__pill-text{background:var(--ml-more-badge-bg, #eff6ff);font-weight:var(--ml-pill-font-weight, 600)}.ml__pill--more:hover .ml__pill-text{background:var(--ml-more-badge-hover-bg, #ffffff)}.ml__pill--more:active .ml__pill-text{background:var(--ml-more-badge-active-bg, #e0f2fe)}.ml__pill-tooltip{position:fixed;z-index:var(--ml-tooltip-z-index, 10000);opacity:0;visibility:hidden;transition:opacity var(--ml-transition-normal, .2s) ease,visibility var(--ml-transition-normal, .2s) ease;background:var(--ml-tooltip-bg, #333);color:var(--ml-tooltip-color, #fff);padding:var(--ml-tooltip-padding, .5rem .75rem);border-radius:var(--ml-tooltip-border-radius, .375rem);font-size:var(--ml-tooltip-font-size, .875rem);line-height:var(--ml-line-height-relaxed, 1.4);max-width:var(--ml-tooltip-max-width, 20rem);word-wrap:break-word;white-space:pre-wrap;box-shadow:var(--ml-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, .15));pointer-events:none}.ml__pill-tooltip--visible{opacity:1;visibility:visible}.ml__selected-popover{display:none;position:absolute;z-index:var(--ml-z-index-popover, 10000);background:var(--ml-selected-popover-bg, #ffffff);border:var(--ml-selected-popover-border, 1px solid #e5e7eb);border-radius:var(--ml-selected-popover-border-radius, .375rem);box-shadow:var(--ml-selected-popover-box-shadow, 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1));width:var(--ml-selected-popover-width, 20rem);max-height:var(--ml-selected-popover-max-height, 20rem);overflow:hidden}.ml__selected-popover--visible{display:flex;flex-direction:column}.ml__selected-popover-header{display:flex;align-items:center;justify-content:space-between;padding:var(--ml-selected-popover-header-padding, .5rem .75rem);background:var(--ml-selected-popover-header-bg, rgba(59, 130, 246, .1));border-bottom:var(--ml-selected-popover-header-border-bottom, 1px solid #e5e7eb);font-size:var(--ml-selected-popover-header-font-size, .875rem);font-weight:var(--ml-selected-popover-header-font-weight, 600);color:var(--ml-selected-popover-header-color, #111827)}.ml__selected-popover-close{display:flex;align-items:center;justify-content:center;width:var(--ml-popover-close-size, 1.5rem);height:var(--ml-popover-close-size, 1.5rem);padding:0;border:none;background:var(--ml-selected-popover-close-bg, transparent);color:var(--ml-selected-popover-close-color, #6b7280);font-size:var(--ml-selected-popover-close-font-size, 1.25rem);line-height:var(--ml-line-height-none, 1);cursor:pointer;border-radius:var(--ml-selected-popover-close-border-radius, 50%);transition:all var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}.ml__selected-popover-close:hover{background:var(--ml-selected-popover-close-bg-hover, rgba(59, 130, 246, .2));color:var(--ml-selected-popover-close-color-hover, #3b82f6)}.ml__selected-popover-body{display:flex;flex-direction:column;gap:var(--ml-selected-popover-body-gap, .25rem);padding:var(--ml-selected-popover-body-padding, .5rem);overflow-y:auto;max-height:var(--ml-selected-popover-body-max-height, 18rem)}.ml__selected-popover-body .ml__pill{width:100%}.ml__selected-popover-body .ml__pill-text{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.ml--rtl .ml__input-wrapper{direction:rtl}.ml--rtl .ml__input{text-align:right;padding-left:var(--ml-input-padding-right, 2.5rem);padding-right:var(--ml-input-padding-h, .75rem)}.ml--rtl .ml__toggle{left:var(--ml-toggle-right, .75rem)!important;right:auto!important}.ml--rtl .ml__count-badge{left:var(--ml-count-badge-offset, 2rem)!important;right:auto!important}.ml--rtl .ml__dropdown{direction:rtl;text-align:right}.ml--rtl .ml__option{flex-direction:row-reverse}.ml--rtl .ml__checkbox{margin-left:var(--ml-spacing-sm, .5rem);margin-right:0}.ml--rtl .ml__option-content{text-align:right}.ml--rtl .ml__option-icon{margin-left:var(--ml-spacing-xs, .25rem);margin-right:0}.ml--rtl .ml__pills{direction:rtl}.ml--rtl .ml__pill{flex-direction:row-reverse}.ml--rtl .ml__pill-remove{border-radius:var(--ml-pill-remove-border-radius-rtl, .375rem) 0 0 var(--ml-pill-remove-border-radius-rtl, .375rem);border-left:var(--ml-pill-remove-border, none);border-right:none}.ml--rtl .ml__pill-text{border-radius:0 var(--ml-pill-text-border-radius-rtl, .375rem) var(--ml-pill-text-border-radius-rtl, .375rem) 0}.ml--rtl .ml__count-display{direction:rtl}.ml--rtl .ml__count-badge-wrapper{flex-direction:row-reverse}.ml--rtl .ml__selected-popover{direction:rtl;text-align:right}.ml--rtl .ml__actions{direction:rtl}.ml--rtl .ml__group-label,.ml--rtl .ml__empty{text-align:right}.ml--rtl .ml__hint{direction:rtl;text-align:right}.ml--xs .ml__input{font-size:var(--ml-font-size-xs, .75rem)}.ml--xs .ml__option{padding:var(--ml-spacing-xs, .25rem) var(--ml-spacing-sm, .5rem)}.ml--xs .ml__option-title{font-size:var(--ml-font-size-xs, .75rem)}.ml--xs .ml__pill{font-size:var(--ml-font-size-2xs, .625rem)}.ml--sm .ml__input,.ml--sm .ml__option-title{font-size:var(--ml-font-size-xs, .75rem)}.ml--lg .ml__input,.ml--lg .ml__option-title{font-size:var(--ml-font-size-base, 1rem)}.ml--lg .ml__pill{font-size:var(--ml-font-size-sm, .875rem)}.ml--xl .ml__input,.ml--xl .ml__option-title{font-size:var(--ml-font-size-lg, 1.125rem)}.ml--xl .ml__pill{font-size:var(--ml-font-size-base, 1rem)}.ml--disabled .ml__input{opacity:var(--ml-disabled-input-opacity, .6);cursor:not-allowed;background:var(--ml-input-bg-disabled, rgba(107, 114, 128, .05))}.ml--disabled .ml__toggle{opacity:var(--ml-disabled-input-opacity, .6)}.ml--no-checkboxes .ml__option{gap:0;padding-left:var(--ml-option-padding-h, .75rem)}.ml--no-checkboxes .ml__option-content{padding-left:0}.ml-debug-info{margin-top:.25rem;padding:.25rem;background-color:#f9fafb;border:1px solid #e5e7eb;border-radius:.375rem;font-size:.75rem;color:#111827}.ml-debug-info details summary{cursor:pointer;font-weight:600;color:#2563eb;-webkit-user-select:none;user-select:none;padding:.25rem;border-radius:.25rem}.ml-debug-info details summary:hover{background-color:#f3f4f6}.ml-debug-info details summary:focus{outline:2px solid #3b82f6;outline-offset:2px}.ml-debug-info .ml-debug-stats{display:flex;flex-direction:column;gap:.25rem;margin-top:.25rem;padding:.25rem;background-color:#fff;border-radius:.25rem}.ml-debug-info .ml-debug-stats span{display:flex;justify-content:space-between;padding:2px 4px;font-family:monospace;font-size:.625rem}.ml-debug-info .ml-debug-stats span:before{content:"•";margin-right:.25rem;color:#3b82f6}', hi = typeof HTMLElement < "u" ? HTMLElement : class {
|
|
2256
|
+
}, Ae = /* @__PURE__ */ new Set();
|
|
2257
|
+
function st() {
|
|
2258
|
+
return Array.from(Ae);
|
|
1790
2259
|
}
|
|
1791
|
-
class
|
|
2260
|
+
class nt extends hi {
|
|
1792
2261
|
constructor() {
|
|
1793
2262
|
super();
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
2263
|
+
u(this, "picker");
|
|
2264
|
+
u(this, "containerElement");
|
|
2265
|
+
u(this, "shadow");
|
|
1797
2266
|
// Properties for complex data (not attributes)
|
|
1798
|
-
|
|
2267
|
+
u(this, "_options");
|
|
1799
2268
|
// Member/Callback properties
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
2269
|
+
u(this, "_valueMember");
|
|
2270
|
+
u(this, "_getValueCallback");
|
|
2271
|
+
u(this, "_displayValueMember");
|
|
2272
|
+
u(this, "_getDisplayValueCallback");
|
|
2273
|
+
u(this, "_getPillDisplayCallback");
|
|
2274
|
+
u(this, "_searchValueMember");
|
|
2275
|
+
u(this, "_getSearchValueCallback");
|
|
2276
|
+
u(this, "_iconMember");
|
|
2277
|
+
u(this, "_getIconCallback");
|
|
2278
|
+
u(this, "_subtitleMember");
|
|
2279
|
+
u(this, "_getSubtitleCallback");
|
|
2280
|
+
u(this, "_groupMember");
|
|
2281
|
+
u(this, "_getGroupCallback");
|
|
2282
|
+
u(this, "_disabledMember");
|
|
2283
|
+
u(this, "_getDisabledCallback");
|
|
1815
2284
|
// Value formatting callbacks
|
|
1816
|
-
|
|
2285
|
+
u(this, "_getValueFormatCallback");
|
|
1817
2286
|
// Tooltip callbacks
|
|
1818
|
-
|
|
2287
|
+
u(this, "_getPillTooltipCallback");
|
|
1819
2288
|
// Count pill callback
|
|
1820
|
-
|
|
2289
|
+
u(this, "_getCountPillCallback");
|
|
1821
2290
|
// Event callbacks
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
2291
|
+
u(this, "_beforeSearchCallback");
|
|
2292
|
+
u(this, "_searchCallback");
|
|
2293
|
+
u(this, "_addNewCallback");
|
|
2294
|
+
u(this, "_selectCallback");
|
|
2295
|
+
u(this, "_deselectCallback");
|
|
2296
|
+
u(this, "_changeCallback");
|
|
2297
|
+
u(this, "_declarativeSelectedValues");
|
|
1827
2298
|
this.shadow = this.attachShadow({ mode: "open" });
|
|
1828
2299
|
const t = document.createElement("style");
|
|
1829
|
-
t.textContent =
|
|
2300
|
+
t.textContent = pi, this.shadow.appendChild(t), requestAnimationFrame(() => {
|
|
1830
2301
|
this.setAttribute("data-ready", "");
|
|
1831
2302
|
});
|
|
1832
2303
|
}
|
|
@@ -1850,14 +2321,21 @@ class Ge extends Nt {
|
|
|
1850
2321
|
"pills-threshold-mode",
|
|
1851
2322
|
"pills-position",
|
|
1852
2323
|
"show-count-badge",
|
|
2324
|
+
"keep-options-on-search",
|
|
1853
2325
|
"max-height",
|
|
1854
2326
|
"empty-message",
|
|
1855
2327
|
"loading-message",
|
|
1856
2328
|
"min-search-length",
|
|
1857
2329
|
"enable-search",
|
|
1858
2330
|
"search-input-mode",
|
|
2331
|
+
"search-mode",
|
|
1859
2332
|
"allow-add-new",
|
|
1860
2333
|
"initial-values",
|
|
2334
|
+
// Virtual scroll options
|
|
2335
|
+
"enable-virtual-scroll",
|
|
2336
|
+
"virtual-scroll-threshold",
|
|
2337
|
+
"option-height",
|
|
2338
|
+
"virtual-scroll-buffer",
|
|
1861
2339
|
// New member properties
|
|
1862
2340
|
"value-member",
|
|
1863
2341
|
"display-value-member",
|
|
@@ -1877,13 +2355,15 @@ class Ge extends Nt {
|
|
|
1877
2355
|
];
|
|
1878
2356
|
}
|
|
1879
2357
|
connectedCallback() {
|
|
1880
|
-
|
|
2358
|
+
Ae.add(this), this.render();
|
|
2359
|
+
const t = this.parseDeclarativeOptions();
|
|
2360
|
+
t && (this._options && this._options.length > 0 && C.warn("[MultiSelectElement] Both declarative <option> elements and programmatic .options detected. Using declarative options."), this._options = t), this.initializePicker();
|
|
1881
2361
|
}
|
|
1882
2362
|
disconnectedCallback() {
|
|
1883
|
-
|
|
2363
|
+
Ae.delete(this), this.picker && this.picker.destroy();
|
|
1884
2364
|
}
|
|
1885
|
-
attributeChangedCallback(t,
|
|
1886
|
-
|
|
2365
|
+
attributeChangedCallback(t, o, l) {
|
|
2366
|
+
o !== l && this.picker && t !== "initial-values" && (this.picker.destroy(), this.initializePicker());
|
|
1887
2367
|
}
|
|
1888
2368
|
render() {
|
|
1889
2369
|
this.containerElement = document.createElement("div"), this.containerElement.setAttribute("data-multiselect", ""), this.className && (this.containerElement.className = this.className), this.shadow.appendChild(this.containerElement), this.getAttribute("show-debug-info") === "true" && this.renderDebugInfo();
|
|
@@ -1891,41 +2371,77 @@ class Ge extends Nt {
|
|
|
1891
2371
|
renderDebugInfo() {
|
|
1892
2372
|
const t = this.shadow.querySelector(".ml-debug-info");
|
|
1893
2373
|
t && t.remove();
|
|
1894
|
-
const
|
|
1895
|
-
|
|
1896
|
-
const
|
|
2374
|
+
const o = document.createElement("div");
|
|
2375
|
+
o.className = "ml-debug-info";
|
|
2376
|
+
const l = document.createElement("details"), s = document.createElement("summary");
|
|
1897
2377
|
s.textContent = "Debug Info";
|
|
1898
2378
|
const n = document.createElement("div");
|
|
1899
|
-
n.className = "ml-debug-stats",
|
|
2379
|
+
n.className = "ml-debug-stats", l.appendChild(s), l.appendChild(n), o.appendChild(l), this.shadow.appendChild(o), this.updateDebugInfo();
|
|
1900
2380
|
}
|
|
1901
2381
|
updateDebugInfo() {
|
|
1902
|
-
var
|
|
2382
|
+
var h, f;
|
|
1903
2383
|
const t = this.shadow.querySelector(".ml-debug-stats");
|
|
1904
2384
|
if (!t || !this.picker) return;
|
|
1905
|
-
const
|
|
2385
|
+
const o = "1.0.0-rc08", l = st().length, n = this.picker.getSelected().length, r = ((h = this._options) == null ? void 0 : h.length) || 0, a = this.picker, d = a.isOpen || !1, c = a.searchTerm || "", m = a.isLoading || !1, p = ((f = a.filteredOptions) == null ? void 0 : f.length) || 0;
|
|
1906
2386
|
t.innerHTML = `
|
|
1907
|
-
<span>Version: ${
|
|
1908
|
-
<span>Total Instances: ${
|
|
2387
|
+
<span>Version: ${o}</span>
|
|
2388
|
+
<span>Total Instances: ${l}</span>
|
|
1909
2389
|
<span>Options: ${r}</span>
|
|
1910
|
-
<span>Filtered: ${
|
|
2390
|
+
<span>Filtered: ${p}</span>
|
|
1911
2391
|
<span>Selected: ${n}</span>
|
|
1912
|
-
<span>Dropdown: ${
|
|
1913
|
-
<span>Search: ${
|
|
1914
|
-
<span>Loading: ${
|
|
2392
|
+
<span>Dropdown: ${d ? "Open" : "Closed"}</span>
|
|
2393
|
+
<span>Search: ${c || "none"}</span>
|
|
2394
|
+
<span>Loading: ${m ? "Yes" : "No"}</span>
|
|
1915
2395
|
`, setTimeout(() => {
|
|
1916
2396
|
this.getAttribute("show-debug-info") === "true" && this.updateDebugInfo();
|
|
1917
2397
|
}, 500);
|
|
1918
2398
|
}
|
|
2399
|
+
/**
|
|
2400
|
+
* Parse declarative <option> and <optgroup> elements from Light DOM
|
|
2401
|
+
* Returns array of options in the format expected by the picker
|
|
2402
|
+
*/
|
|
2403
|
+
parseDeclarativeOptions() {
|
|
2404
|
+
var s, n, r, a;
|
|
2405
|
+
const t = [], o = Array.from(this.children);
|
|
2406
|
+
if (o.length === 0)
|
|
2407
|
+
return null;
|
|
2408
|
+
let l = !1;
|
|
2409
|
+
for (const d of o)
|
|
2410
|
+
if (d.tagName === "OPTION") {
|
|
2411
|
+
const c = d, m = {
|
|
2412
|
+
value: c.value || ((s = c.textContent) == null ? void 0 : s.trim()) || "",
|
|
2413
|
+
label: ((n = c.textContent) == null ? void 0 : n.trim()) || c.value || ""
|
|
2414
|
+
};
|
|
2415
|
+
c.hasAttribute("selected") && (this._declarativeSelectedValues || (this._declarativeSelectedValues = []), this._declarativeSelectedValues.push(m.value)), c.hasAttribute("disabled") && (m.disabled = !0), c.hasAttribute("data-icon") && (m.icon = c.getAttribute("data-icon")), c.hasAttribute("data-subtitle") && (m.subtitle = c.getAttribute("data-subtitle")), t.push(m), l = !0;
|
|
2416
|
+
} else if (d.tagName === "OPTGROUP") {
|
|
2417
|
+
const c = d, m = c.label || c.getAttribute("label") || "Group", p = Array.from(c.querySelectorAll("option"));
|
|
2418
|
+
for (const h of p) {
|
|
2419
|
+
const f = {
|
|
2420
|
+
value: h.value || ((r = h.textContent) == null ? void 0 : r.trim()) || "",
|
|
2421
|
+
label: ((a = h.textContent) == null ? void 0 : a.trim()) || h.value || "",
|
|
2422
|
+
group: m
|
|
2423
|
+
};
|
|
2424
|
+
h.hasAttribute("selected") && (this._declarativeSelectedValues || (this._declarativeSelectedValues = []), this._declarativeSelectedValues.push(f.value)), h.hasAttribute("disabled") && (f.disabled = !0), h.hasAttribute("data-icon") && (f.icon = h.getAttribute("data-icon")), h.hasAttribute("data-subtitle") && (f.subtitle = h.getAttribute("data-subtitle")), t.push(f), l = !0;
|
|
2425
|
+
}
|
|
2426
|
+
}
|
|
2427
|
+
return l ? (C.debug(`[MultiSelectElement] Parsed ${t.length} declarative options from Light DOM`), o.forEach((d) => {
|
|
2428
|
+
(d.tagName === "OPTION" || d.tagName === "OPTGROUP") && d.remove();
|
|
2429
|
+
}), t) : null;
|
|
2430
|
+
}
|
|
1919
2431
|
initializePicker() {
|
|
1920
2432
|
if (!this.containerElement) return;
|
|
1921
2433
|
let t;
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
2434
|
+
if (this._declarativeSelectedValues && this._declarativeSelectedValues.length > 0)
|
|
2435
|
+
t = this._declarativeSelectedValues, C.debug(`[MultiSelectElement] Using ${t.length} declaratively selected values`);
|
|
2436
|
+
else {
|
|
2437
|
+
const l = this.getAttribute("initial-values");
|
|
2438
|
+
if (l)
|
|
2439
|
+
try {
|
|
2440
|
+
t = JSON.parse(l);
|
|
2441
|
+
} catch (s) {
|
|
2442
|
+
C.error("[MultiSelectElement] Failed to parse initial-values:", s);
|
|
2443
|
+
}
|
|
2444
|
+
}
|
|
1929
2445
|
const o = {
|
|
1930
2446
|
// String options
|
|
1931
2447
|
searchHint: this.getAttribute("search-hint") || void 0,
|
|
@@ -1938,6 +2454,7 @@ class Ge extends Nt {
|
|
|
1938
2454
|
emptyMessage: this.getAttribute("empty-message") || "No results found",
|
|
1939
2455
|
loadingMessage: this.getAttribute("loading-message") || "Loading...",
|
|
1940
2456
|
searchInputMode: this.getAttribute("search-input-mode") || "normal",
|
|
2457
|
+
searchMode: this.getAttribute("search-mode") || "filter",
|
|
1941
2458
|
// Number options
|
|
1942
2459
|
pillsThreshold: this.getAttribute("pills-threshold") ? parseInt(this.getAttribute("pills-threshold")) : void 0,
|
|
1943
2460
|
pillsMaxVisible: this.getAttribute("pills-max-visible") ? parseInt(this.getAttribute("pills-max-visible")) : void 0,
|
|
@@ -1954,6 +2471,12 @@ class Ge extends Nt {
|
|
|
1954
2471
|
isSearchEnabled: this.getAttribute("enable-search") !== "false",
|
|
1955
2472
|
isAddNewAllowed: this.getAttribute("allow-add-new") === "true",
|
|
1956
2473
|
isCountBadgeShown: this.getAttribute("show-count-badge") === "true",
|
|
2474
|
+
isKeepOptionsOnSearch: this.getAttribute("keep-options-on-search") !== "false",
|
|
2475
|
+
isVirtualScrollEnabled: this.getAttribute("enable-virtual-scroll") === "true",
|
|
2476
|
+
// Virtual scroll options
|
|
2477
|
+
virtualScrollThreshold: this.getAttribute("virtual-scroll-threshold") ? parseInt(this.getAttribute("virtual-scroll-threshold")) : 100,
|
|
2478
|
+
optionHeight: this.getAttribute("option-height") ? parseInt(this.getAttribute("option-height")) : 50,
|
|
2479
|
+
virtualScrollBuffer: this.getAttribute("virtual-scroll-buffer") ? parseInt(this.getAttribute("virtual-scroll-buffer")) : 10,
|
|
1957
2480
|
// Member properties
|
|
1958
2481
|
valueMember: this.getAttribute("value-member") || this._valueMember,
|
|
1959
2482
|
displayValueMember: this.getAttribute("display-value-member") || this._displayValueMember,
|
|
@@ -1982,37 +2505,38 @@ class Ge extends Nt {
|
|
|
1982
2505
|
pillTooltipDelay: parseInt(this.getAttribute("pill-tooltip-delay") || "300"),
|
|
1983
2506
|
pillTooltipOffset: parseInt(this.getAttribute("pill-tooltip-offset") || "8"),
|
|
1984
2507
|
// Count pill callback
|
|
1985
|
-
getCountPillCallback: this._getCountPillCallback || ((
|
|
2508
|
+
getCountPillCallback: this._getCountPillCallback || ((l, s) => s !== void 0 ? `+${s} more` : `${l} selected`),
|
|
1986
2509
|
// Data and callbacks
|
|
1987
2510
|
options: this._options,
|
|
2511
|
+
beforeSearchCallback: this._beforeSearchCallback,
|
|
1988
2512
|
searchCallback: this._searchCallback,
|
|
1989
2513
|
addNewCallback: this._addNewCallback,
|
|
1990
|
-
selectCallback: (
|
|
1991
|
-
var
|
|
1992
|
-
this._selectCallback && this._selectCallback(
|
|
2514
|
+
selectCallback: (l) => {
|
|
2515
|
+
var s, n;
|
|
2516
|
+
this._selectCallback && this._selectCallback(l), this.dispatchEvent(new CustomEvent("select", {
|
|
1993
2517
|
detail: {
|
|
1994
|
-
option:
|
|
1995
|
-
selectedOptions: (
|
|
1996
|
-
selectedValues: Array.from(((
|
|
2518
|
+
option: l,
|
|
2519
|
+
selectedOptions: (s = this.picker) == null ? void 0 : s.getSelected(),
|
|
2520
|
+
selectedValues: Array.from(((n = this.picker) == null ? void 0 : n.getValue()) || [])
|
|
1997
2521
|
}
|
|
1998
2522
|
}));
|
|
1999
2523
|
},
|
|
2000
|
-
deselectCallback: (
|
|
2001
|
-
var
|
|
2002
|
-
this._deselectCallback && this._deselectCallback(
|
|
2524
|
+
deselectCallback: (l) => {
|
|
2525
|
+
var s, n;
|
|
2526
|
+
this._deselectCallback && this._deselectCallback(l), this.dispatchEvent(new CustomEvent("deselect", {
|
|
2003
2527
|
detail: {
|
|
2004
|
-
option:
|
|
2005
|
-
selectedOptions: (
|
|
2006
|
-
selectedValues: Array.from(((
|
|
2528
|
+
option: l,
|
|
2529
|
+
selectedOptions: (s = this.picker) == null ? void 0 : s.getSelected(),
|
|
2530
|
+
selectedValues: Array.from(((n = this.picker) == null ? void 0 : n.getValue()) || [])
|
|
2007
2531
|
}
|
|
2008
2532
|
}));
|
|
2009
2533
|
},
|
|
2010
|
-
changeCallback: (
|
|
2011
|
-
var
|
|
2012
|
-
this._changeCallback && this._changeCallback(
|
|
2534
|
+
changeCallback: (l) => {
|
|
2535
|
+
var s;
|
|
2536
|
+
this._changeCallback && this._changeCallback(l), this.dispatchEvent(new CustomEvent("change", {
|
|
2013
2537
|
detail: {
|
|
2014
|
-
selectedOptions:
|
|
2015
|
-
selectedValues: Array.from(((
|
|
2538
|
+
selectedOptions: l,
|
|
2539
|
+
selectedValues: Array.from(((s = this.picker) == null ? void 0 : s.getValue()) || [])
|
|
2016
2540
|
}
|
|
2017
2541
|
}));
|
|
2018
2542
|
},
|
|
@@ -2021,7 +2545,7 @@ class Ge extends Nt {
|
|
|
2021
2545
|
// Pass host element (this) for hidden inputs in light DOM
|
|
2022
2546
|
hostElement: this
|
|
2023
2547
|
};
|
|
2024
|
-
t && (this.containerElement.dataset.initialValues = JSON.stringify(t)), this.picker = new
|
|
2548
|
+
t && (this.containerElement.dataset.initialValues = JSON.stringify(t)), this.picker = new di(this.containerElement, o);
|
|
2025
2549
|
}
|
|
2026
2550
|
reinitialize() {
|
|
2027
2551
|
this.picker && (this.picker.destroy(), this.initializePicker());
|
|
@@ -2187,6 +2711,12 @@ class Ge extends Nt {
|
|
|
2187
2711
|
return this._getCountPillCallback;
|
|
2188
2712
|
}
|
|
2189
2713
|
// Event callbacks
|
|
2714
|
+
get beforeSearchCallback() {
|
|
2715
|
+
return this._beforeSearchCallback;
|
|
2716
|
+
}
|
|
2717
|
+
set beforeSearchCallback(t) {
|
|
2718
|
+
this._beforeSearchCallback = t, this.reinitialize();
|
|
2719
|
+
}
|
|
2190
2720
|
get searchCallback() {
|
|
2191
2721
|
return this._searchCallback;
|
|
2192
2722
|
}
|
|
@@ -2242,23 +2772,31 @@ class Ge extends Nt {
|
|
|
2242
2772
|
this.picker && this.picker.destroy();
|
|
2243
2773
|
}
|
|
2244
2774
|
}
|
|
2245
|
-
typeof window < "u" && typeof customElements < "u" && (customElements.get("
|
|
2775
|
+
typeof window < "u" && typeof customElements < "u" && (customElements.get("web-multiselect") || customElements.define("web-multiselect", nt));
|
|
2246
2776
|
typeof window < "u" && (window.keenmate = window.keenmate || {}, window.keenmate.multiselect = {
|
|
2247
|
-
version: () => "1.0.0-
|
|
2777
|
+
version: () => "1.0.0-rc08",
|
|
2248
2778
|
config: {
|
|
2249
2779
|
name: "@keenmate/web-multiselect",
|
|
2250
|
-
version: "1.0.0-
|
|
2780
|
+
version: "1.0.0-rc08",
|
|
2251
2781
|
author: "Keenmate",
|
|
2252
2782
|
license: "MIT",
|
|
2253
2783
|
repository: "git+https://github.com/keenmate/web-multiselect.git",
|
|
2254
2784
|
homepage: "https://github.com/keenmate/web-multiselect#readme"
|
|
2255
2785
|
},
|
|
2256
2786
|
register: () => {
|
|
2257
|
-
typeof customElements < "u" && !customElements.get("
|
|
2787
|
+
typeof customElements < "u" && !customElements.get("web-multiselect") && customElements.define("web-multiselect", nt);
|
|
2258
2788
|
},
|
|
2259
|
-
getInstances: () =>
|
|
2789
|
+
getInstances: () => st()
|
|
2260
2790
|
});
|
|
2261
2791
|
export {
|
|
2262
|
-
|
|
2263
|
-
|
|
2792
|
+
nt as MultiSelectElement,
|
|
2793
|
+
di as PureMultiSelect,
|
|
2794
|
+
C as dataLogger,
|
|
2795
|
+
fi as disableLogging,
|
|
2796
|
+
gi as enableCategory,
|
|
2797
|
+
ui as enableLogging,
|
|
2798
|
+
H as initLogger,
|
|
2799
|
+
k as interactionLogger,
|
|
2800
|
+
lt as setLogLevel,
|
|
2801
|
+
v as uiLogger
|
|
2264
2802
|
};
|