@keenmate/web-multiselect 1.0.0-rc03 → 1.0.0-rc04
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/multiselect.js +537 -521
- package/dist/multiselect.umd.js +11 -11
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/scss/_input-dropdown.scss +1 -0
- package/src/scss/_pills-display.scss +2 -2
- package/src/scss/_rtl.scss +142 -0
- package/src/scss/_variables.scss +2 -2
- package/src/scss/main.scss +2 -0
package/dist/multiselect.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Ue = Object.defineProperty;
|
|
2
2
|
var Ye = (i, e, t) => e in i ? Ue(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
-
var
|
|
4
|
-
const te = Math.min, z = Math.max, ie = Math.round, J = Math.floor,
|
|
3
|
+
var h = (i, e, t) => Ye(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
const te = Math.min, z = Math.max, ie = Math.round, J = Math.floor, O = (i) => ({
|
|
5
5
|
x: i,
|
|
6
6
|
y: i
|
|
7
7
|
}), Xe = {
|
|
@@ -16,10 +16,10 @@ const te = Math.min, z = Math.max, ie = Math.round, J = Math.floor, P = (i) => (
|
|
|
16
16
|
function ke(i, e, t) {
|
|
17
17
|
return z(i, te(e, t));
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function se(i, e) {
|
|
20
20
|
return typeof i == "function" ? i(e) : i;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function R(i) {
|
|
23
23
|
return i.split("-")[0];
|
|
24
24
|
}
|
|
25
25
|
function ne(i) {
|
|
@@ -33,30 +33,30 @@ function Ve(i) {
|
|
|
33
33
|
}
|
|
34
34
|
const qe = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
35
35
|
function V(i) {
|
|
36
|
-
return qe.has(
|
|
36
|
+
return qe.has(R(i)) ? "y" : "x";
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function De(i) {
|
|
39
39
|
return Ee(V(i));
|
|
40
40
|
}
|
|
41
41
|
function Ze(i, e, t) {
|
|
42
42
|
t === void 0 && (t = !1);
|
|
43
|
-
const
|
|
44
|
-
let n =
|
|
45
|
-
return e.reference[
|
|
43
|
+
const l = ne(i), o = De(i), s = Ve(o);
|
|
44
|
+
let n = o === "x" ? l === (t ? "end" : "start") ? "right" : "left" : l === "start" ? "bottom" : "top";
|
|
45
|
+
return e.reference[s] > e.floating[s] && (n = le(n)), [n, le(n)];
|
|
46
46
|
}
|
|
47
47
|
function Qe(i) {
|
|
48
|
-
const e =
|
|
48
|
+
const e = le(i);
|
|
49
49
|
return [fe(i), e, fe(e)];
|
|
50
50
|
}
|
|
51
51
|
function fe(i) {
|
|
52
52
|
return i.replace(/start|end/g, (e) => Je[e]);
|
|
53
53
|
}
|
|
54
|
-
const Ae = ["left", "right"],
|
|
54
|
+
const Ae = ["left", "right"], Pe = ["right", "left"], et = ["top", "bottom"], tt = ["bottom", "top"];
|
|
55
55
|
function it(i, e, t) {
|
|
56
56
|
switch (i) {
|
|
57
57
|
case "top":
|
|
58
58
|
case "bottom":
|
|
59
|
-
return t ? e ?
|
|
59
|
+
return t ? e ? Pe : Ae : e ? Ae : Pe;
|
|
60
60
|
case "left":
|
|
61
61
|
case "right":
|
|
62
62
|
return e ? et : tt;
|
|
@@ -64,15 +64,15 @@ function it(i, e, t) {
|
|
|
64
64
|
return [];
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
const
|
|
69
|
-
let
|
|
70
|
-
return
|
|
67
|
+
function lt(i, e, t, l) {
|
|
68
|
+
const o = ne(i);
|
|
69
|
+
let s = it(R(i), t === "start", l);
|
|
70
|
+
return o && (s = s.map((n) => n + "-" + o), e && (s = s.concat(s.map(fe)))), s;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function le(i) {
|
|
73
73
|
return i.replace(/left|right|bottom|top/g, (e) => Xe[e]);
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function ot(i) {
|
|
76
76
|
return {
|
|
77
77
|
top: 0,
|
|
78
78
|
right: 0,
|
|
@@ -81,95 +81,95 @@ function st(i) {
|
|
|
81
81
|
...i
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
return typeof i != "number" ?
|
|
84
|
+
function st(i) {
|
|
85
|
+
return typeof i != "number" ? ot(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 oe(i) {
|
|
93
93
|
const {
|
|
94
94
|
x: e,
|
|
95
95
|
y: t,
|
|
96
|
-
width:
|
|
97
|
-
height:
|
|
96
|
+
width: l,
|
|
97
|
+
height: o
|
|
98
98
|
} = i;
|
|
99
99
|
return {
|
|
100
|
-
width:
|
|
101
|
-
height:
|
|
100
|
+
width: l,
|
|
101
|
+
height: o,
|
|
102
102
|
top: t,
|
|
103
103
|
left: e,
|
|
104
|
-
right: e +
|
|
105
|
-
bottom: t +
|
|
104
|
+
right: e + l,
|
|
105
|
+
bottom: t + o,
|
|
106
106
|
x: e,
|
|
107
107
|
y: t
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function Se(i, e, t) {
|
|
111
111
|
let {
|
|
112
|
-
reference:
|
|
113
|
-
floating:
|
|
112
|
+
reference: l,
|
|
113
|
+
floating: o
|
|
114
114
|
} = i;
|
|
115
|
-
const
|
|
116
|
-
let
|
|
115
|
+
const s = V(e), n = De(e), r = Ve(n), a = R(e), c = s === "y", p = l.x + l.width / 2 - o.width / 2, d = l.y + l.height / 2 - o.height / 2, m = l[r] / 2 - o[r] / 2;
|
|
116
|
+
let u;
|
|
117
117
|
switch (a) {
|
|
118
118
|
case "top":
|
|
119
|
-
|
|
119
|
+
u = {
|
|
120
120
|
x: p,
|
|
121
|
-
y:
|
|
121
|
+
y: l.y - o.height
|
|
122
122
|
};
|
|
123
123
|
break;
|
|
124
124
|
case "bottom":
|
|
125
|
-
|
|
125
|
+
u = {
|
|
126
126
|
x: p,
|
|
127
|
-
y:
|
|
127
|
+
y: l.y + l.height
|
|
128
128
|
};
|
|
129
129
|
break;
|
|
130
130
|
case "right":
|
|
131
|
-
|
|
132
|
-
x:
|
|
131
|
+
u = {
|
|
132
|
+
x: l.x + l.width,
|
|
133
133
|
y: d
|
|
134
134
|
};
|
|
135
135
|
break;
|
|
136
136
|
case "left":
|
|
137
|
-
|
|
138
|
-
x:
|
|
137
|
+
u = {
|
|
138
|
+
x: l.x - o.width,
|
|
139
139
|
y: d
|
|
140
140
|
};
|
|
141
141
|
break;
|
|
142
142
|
default:
|
|
143
|
-
|
|
144
|
-
x:
|
|
145
|
-
y:
|
|
143
|
+
u = {
|
|
144
|
+
x: l.x,
|
|
145
|
+
y: l.y
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
148
|
switch (ne(e)) {
|
|
149
149
|
case "start":
|
|
150
|
-
|
|
150
|
+
u[n] -= m * (t && c ? -1 : 1);
|
|
151
151
|
break;
|
|
152
152
|
case "end":
|
|
153
|
-
|
|
153
|
+
u[n] += m * (t && c ? -1 : 1);
|
|
154
154
|
break;
|
|
155
155
|
}
|
|
156
|
-
return
|
|
156
|
+
return u;
|
|
157
157
|
}
|
|
158
158
|
const nt = async (i, e, t) => {
|
|
159
159
|
const {
|
|
160
|
-
placement:
|
|
161
|
-
strategy:
|
|
162
|
-
middleware:
|
|
160
|
+
placement: l = "bottom",
|
|
161
|
+
strategy: o = "absolute",
|
|
162
|
+
middleware: s = [],
|
|
163
163
|
platform: n
|
|
164
|
-
} = t, r =
|
|
164
|
+
} = t, r = s.filter(Boolean), a = await (n.isRTL == null ? void 0 : n.isRTL(e));
|
|
165
165
|
let c = await n.getElementRects({
|
|
166
166
|
reference: i,
|
|
167
167
|
floating: e,
|
|
168
|
-
strategy:
|
|
168
|
+
strategy: o
|
|
169
169
|
}), {
|
|
170
170
|
x: p,
|
|
171
171
|
y: d
|
|
172
|
-
} =
|
|
172
|
+
} = Se(c, l, a), m = l, u = {}, g = 0;
|
|
173
173
|
for (let v = 0; v < r.length; v++) {
|
|
174
174
|
const {
|
|
175
175
|
name: w,
|
|
@@ -182,10 +182,10 @@ const nt = async (i, e, t) => {
|
|
|
182
182
|
} = await b({
|
|
183
183
|
x: p,
|
|
184
184
|
y: d,
|
|
185
|
-
initialPlacement:
|
|
185
|
+
initialPlacement: l,
|
|
186
186
|
placement: m,
|
|
187
|
-
strategy:
|
|
188
|
-
middlewareData:
|
|
187
|
+
strategy: o,
|
|
188
|
+
middlewareData: u,
|
|
189
189
|
rects: c,
|
|
190
190
|
platform: n,
|
|
191
191
|
elements: {
|
|
@@ -193,36 +193,36 @@ const nt = async (i, e, t) => {
|
|
|
193
193
|
floating: e
|
|
194
194
|
}
|
|
195
195
|
});
|
|
196
|
-
p = _ ?? p, d = y ?? d,
|
|
197
|
-
...
|
|
196
|
+
p = _ ?? p, d = y ?? d, u = {
|
|
197
|
+
...u,
|
|
198
198
|
[w]: {
|
|
199
|
-
...
|
|
199
|
+
...u[w],
|
|
200
200
|
...C
|
|
201
201
|
}
|
|
202
202
|
}, x && g <= 50 && (g++, typeof x == "object" && (x.placement && (m = x.placement), x.rects && (c = x.rects === !0 ? await n.getElementRects({
|
|
203
203
|
reference: i,
|
|
204
204
|
floating: e,
|
|
205
|
-
strategy:
|
|
205
|
+
strategy: o
|
|
206
206
|
}) : x.rects), {
|
|
207
207
|
x: p,
|
|
208
208
|
y: d
|
|
209
|
-
} =
|
|
209
|
+
} = Se(c, m, a)), v = -1);
|
|
210
210
|
}
|
|
211
211
|
return {
|
|
212
212
|
x: p,
|
|
213
213
|
y: d,
|
|
214
214
|
placement: m,
|
|
215
|
-
strategy:
|
|
216
|
-
middlewareData:
|
|
215
|
+
strategy: o,
|
|
216
|
+
middlewareData: u
|
|
217
217
|
};
|
|
218
218
|
};
|
|
219
|
-
async function
|
|
219
|
+
async function $e(i, e) {
|
|
220
220
|
var t;
|
|
221
221
|
e === void 0 && (e = {});
|
|
222
222
|
const {
|
|
223
|
-
x:
|
|
224
|
-
y:
|
|
225
|
-
platform:
|
|
223
|
+
x: l,
|
|
224
|
+
y: o,
|
|
225
|
+
platform: s,
|
|
226
226
|
rects: n,
|
|
227
227
|
elements: r,
|
|
228
228
|
strategy: a
|
|
@@ -231,24 +231,24 @@ async function De(i, e) {
|
|
|
231
231
|
rootBoundary: p = "viewport",
|
|
232
232
|
elementContext: d = "floating",
|
|
233
233
|
altBoundary: m = !1,
|
|
234
|
-
padding:
|
|
235
|
-
} =
|
|
236
|
-
element: (t = await (
|
|
234
|
+
padding: u = 0
|
|
235
|
+
} = se(e, i), g = st(u), w = r[m ? d === "floating" ? "reference" : "floating" : d], b = oe(await s.getClippingRect({
|
|
236
|
+
element: (t = await (s.isElement == null ? void 0 : s.isElement(w))) == null || t ? w : w.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(r.floating)),
|
|
237
237
|
boundary: c,
|
|
238
238
|
rootBoundary: p,
|
|
239
239
|
strategy: a
|
|
240
240
|
})), _ = d === "floating" ? {
|
|
241
|
-
x:
|
|
242
|
-
y:
|
|
241
|
+
x: l,
|
|
242
|
+
y: o,
|
|
243
243
|
width: n.floating.width,
|
|
244
244
|
height: n.floating.height
|
|
245
|
-
} : n.reference, y = await (
|
|
245
|
+
} : n.reference, y = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(r.floating)), C = await (s.isElement == null ? void 0 : s.isElement(y)) ? await (s.getScale == null ? void 0 : s.getScale(y)) || {
|
|
246
246
|
x: 1,
|
|
247
247
|
y: 1
|
|
248
248
|
} : {
|
|
249
249
|
x: 1,
|
|
250
250
|
y: 1
|
|
251
|
-
}, x =
|
|
251
|
+
}, x = oe(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
252
252
|
elements: r,
|
|
253
253
|
rect: _,
|
|
254
254
|
offsetParent: y,
|
|
@@ -266,10 +266,10 @@ const rt = function(i) {
|
|
|
266
266
|
name: "flip",
|
|
267
267
|
options: i,
|
|
268
268
|
async fn(e) {
|
|
269
|
-
var t,
|
|
269
|
+
var t, l;
|
|
270
270
|
const {
|
|
271
|
-
placement:
|
|
272
|
-
middlewareData:
|
|
271
|
+
placement: o,
|
|
272
|
+
middlewareData: s,
|
|
273
273
|
rects: n,
|
|
274
274
|
initialPlacement: r,
|
|
275
275
|
platform: a,
|
|
@@ -278,33 +278,33 @@ const rt = function(i) {
|
|
|
278
278
|
mainAxis: p = !0,
|
|
279
279
|
crossAxis: d = !0,
|
|
280
280
|
fallbackPlacements: m,
|
|
281
|
-
fallbackStrategy:
|
|
281
|
+
fallbackStrategy: u = "bestFit",
|
|
282
282
|
fallbackAxisSideDirection: g = "none",
|
|
283
283
|
flipAlignment: v = !0,
|
|
284
284
|
...w
|
|
285
|
-
} =
|
|
286
|
-
if ((t =
|
|
285
|
+
} = se(i, e);
|
|
286
|
+
if ((t = s.arrow) != null && t.alignmentOffset)
|
|
287
287
|
return {};
|
|
288
|
-
const b =
|
|
289
|
-
!m && G && x.push(...
|
|
290
|
-
const F = [r, ...x], pe = await
|
|
291
|
-
let B = ((
|
|
288
|
+
const b = R(o), _ = V(r), y = R(r) === r, C = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), x = m || (y || !v ? [le(r)] : Qe(r)), G = g !== "none";
|
|
289
|
+
!m && G && x.push(...lt(r, v, g, C));
|
|
290
|
+
const F = [r, ...x], pe = await $e(e, w), X = [];
|
|
291
|
+
let B = ((l = s.flip) == null ? void 0 : l.overflows) || [];
|
|
292
292
|
if (p && X.push(pe[b]), d) {
|
|
293
|
-
const
|
|
294
|
-
X.push(pe[
|
|
293
|
+
const $ = Ze(o, n, C);
|
|
294
|
+
X.push(pe[$[0]], pe[$[1]]);
|
|
295
295
|
}
|
|
296
296
|
if (B = [...B, {
|
|
297
|
-
placement:
|
|
297
|
+
placement: o,
|
|
298
298
|
overflows: X
|
|
299
|
-
}], !X.every((
|
|
299
|
+
}], !X.every(($) => $ <= 0)) {
|
|
300
300
|
var ye, xe;
|
|
301
|
-
const
|
|
301
|
+
const $ = (((ye = s.flip) == null ? void 0 : ye.index) || 0) + 1, he = F[$];
|
|
302
302
|
if (he && (!(d === "alignment" ? _ !== V(he) : !1) || // We leave the current main axis only if every placement on that axis
|
|
303
303
|
// overflows the main axis.
|
|
304
304
|
B.every((A) => V(A.placement) === _ ? A.overflows[0] > 0 : !0)))
|
|
305
305
|
return {
|
|
306
306
|
data: {
|
|
307
|
-
index:
|
|
307
|
+
index: $,
|
|
308
308
|
overflows: B
|
|
309
309
|
},
|
|
310
310
|
reset: {
|
|
@@ -313,18 +313,18 @@ const rt = function(i) {
|
|
|
313
313
|
};
|
|
314
314
|
let K = (xe = B.filter((L) => L.overflows[0] <= 0).sort((L, A) => L.overflows[1] - A.overflows[1])[0]) == null ? void 0 : xe.placement;
|
|
315
315
|
if (!K)
|
|
316
|
-
switch (
|
|
316
|
+
switch (u) {
|
|
317
317
|
case "bestFit": {
|
|
318
318
|
var Ce;
|
|
319
319
|
const L = (Ce = B.filter((A) => {
|
|
320
320
|
if (G) {
|
|
321
|
-
const
|
|
322
|
-
return
|
|
321
|
+
const I = V(A.placement);
|
|
322
|
+
return I === _ || // Create a bias to the `y` side axis due to horizontal
|
|
323
323
|
// reading directions favoring greater width.
|
|
324
|
-
|
|
324
|
+
I === "y";
|
|
325
325
|
}
|
|
326
326
|
return !0;
|
|
327
|
-
}).map((A) => [A.placement, A.overflows.filter((
|
|
327
|
+
}).map((A) => [A.placement, A.overflows.filter((I) => I > 0).reduce((I, Ke) => I + Ke, 0)]).sort((A, I) => A[1] - I[1])[0]) == null ? void 0 : Ce[0];
|
|
328
328
|
L && (K = L);
|
|
329
329
|
break;
|
|
330
330
|
}
|
|
@@ -332,7 +332,7 @@ const rt = function(i) {
|
|
|
332
332
|
K = r;
|
|
333
333
|
break;
|
|
334
334
|
}
|
|
335
|
-
if (
|
|
335
|
+
if (o !== K)
|
|
336
336
|
return {
|
|
337
337
|
reset: {
|
|
338
338
|
placement: K
|
|
@@ -346,12 +346,12 @@ const rt = function(i) {
|
|
|
346
346
|
async function ct(i, e) {
|
|
347
347
|
const {
|
|
348
348
|
placement: t,
|
|
349
|
-
platform:
|
|
350
|
-
elements:
|
|
351
|
-
} = i,
|
|
349
|
+
platform: l,
|
|
350
|
+
elements: o
|
|
351
|
+
} = i, s = await (l.isRTL == null ? void 0 : l.isRTL(o.floating)), n = R(t), r = ne(t), a = V(t) === "y", c = at.has(n) ? -1 : 1, p = s && a ? -1 : 1, d = se(e, i);
|
|
352
352
|
let {
|
|
353
353
|
mainAxis: m,
|
|
354
|
-
crossAxis:
|
|
354
|
+
crossAxis: u,
|
|
355
355
|
alignmentAxis: g
|
|
356
356
|
} = typeof d == "number" ? {
|
|
357
357
|
mainAxis: d,
|
|
@@ -362,12 +362,12 @@ async function ct(i, e) {
|
|
|
362
362
|
crossAxis: d.crossAxis || 0,
|
|
363
363
|
alignmentAxis: d.alignmentAxis
|
|
364
364
|
};
|
|
365
|
-
return r && typeof g == "number" && (
|
|
366
|
-
x:
|
|
365
|
+
return r && typeof g == "number" && (u = r === "end" ? g * -1 : g), a ? {
|
|
366
|
+
x: u * p,
|
|
367
367
|
y: m * c
|
|
368
368
|
} : {
|
|
369
369
|
x: m * c,
|
|
370
|
-
y:
|
|
370
|
+
y: u * p
|
|
371
371
|
};
|
|
372
372
|
}
|
|
373
373
|
const dt = function(i) {
|
|
@@ -375,16 +375,16 @@ const dt = function(i) {
|
|
|
375
375
|
name: "offset",
|
|
376
376
|
options: i,
|
|
377
377
|
async fn(e) {
|
|
378
|
-
var t,
|
|
378
|
+
var t, l;
|
|
379
379
|
const {
|
|
380
|
-
x:
|
|
381
|
-
y:
|
|
380
|
+
x: o,
|
|
381
|
+
y: s,
|
|
382
382
|
placement: n,
|
|
383
383
|
middlewareData: r
|
|
384
384
|
} = e, a = await ct(e, i);
|
|
385
|
-
return n === ((t = r.offset) == null ? void 0 : t.placement) && (
|
|
386
|
-
x:
|
|
387
|
-
y:
|
|
385
|
+
return n === ((t = r.offset) == null ? void 0 : t.placement) && (l = r.arrow) != null && l.alignmentOffset ? {} : {
|
|
386
|
+
x: o + a.x,
|
|
387
|
+
y: s + a.y,
|
|
388
388
|
data: {
|
|
389
389
|
...a,
|
|
390
390
|
placement: n
|
|
@@ -399,10 +399,10 @@ const dt = function(i) {
|
|
|
399
399
|
async fn(e) {
|
|
400
400
|
const {
|
|
401
401
|
x: t,
|
|
402
|
-
y:
|
|
403
|
-
placement:
|
|
402
|
+
y: l,
|
|
403
|
+
placement: o
|
|
404
404
|
} = e, {
|
|
405
|
-
mainAxis:
|
|
405
|
+
mainAxis: s = !0,
|
|
406
406
|
crossAxis: n = !1,
|
|
407
407
|
limiter: r = {
|
|
408
408
|
fn: (w) => {
|
|
@@ -417,14 +417,14 @@ const dt = function(i) {
|
|
|
417
417
|
}
|
|
418
418
|
},
|
|
419
419
|
...a
|
|
420
|
-
} =
|
|
420
|
+
} = se(i, e), c = {
|
|
421
421
|
x: t,
|
|
422
|
-
y:
|
|
423
|
-
}, p = await
|
|
424
|
-
let
|
|
425
|
-
if (
|
|
426
|
-
const w = m === "y" ? "top" : "left", b = m === "y" ? "bottom" : "right", _ =
|
|
427
|
-
|
|
422
|
+
y: l
|
|
423
|
+
}, p = await $e(e, a), d = V(R(o)), m = Ee(d);
|
|
424
|
+
let u = c[m], g = c[d];
|
|
425
|
+
if (s) {
|
|
426
|
+
const w = m === "y" ? "top" : "left", b = m === "y" ? "bottom" : "right", _ = u + p[w], y = u - p[b];
|
|
427
|
+
u = ke(_, u, y);
|
|
428
428
|
}
|
|
429
429
|
if (n) {
|
|
430
430
|
const w = d === "y" ? "top" : "left", b = d === "y" ? "bottom" : "right", _ = g + p[w], y = g - p[b];
|
|
@@ -432,16 +432,16 @@ const dt = function(i) {
|
|
|
432
432
|
}
|
|
433
433
|
const v = r.fn({
|
|
434
434
|
...e,
|
|
435
|
-
[m]:
|
|
435
|
+
[m]: u,
|
|
436
436
|
[d]: g
|
|
437
437
|
});
|
|
438
438
|
return {
|
|
439
439
|
...v,
|
|
440
440
|
data: {
|
|
441
441
|
x: v.x - t,
|
|
442
|
-
y: v.y -
|
|
442
|
+
y: v.y - l,
|
|
443
443
|
enabled: {
|
|
444
|
-
[m]:
|
|
444
|
+
[m]: s,
|
|
445
445
|
[d]: n
|
|
446
446
|
}
|
|
447
447
|
}
|
|
@@ -459,20 +459,20 @@ function k(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 M(i) {
|
|
463
463
|
var e;
|
|
464
464
|
return (e = (Le(i) ? i.ownerDocument : i.document) || window.document) == null ? void 0 : e.documentElement;
|
|
465
465
|
}
|
|
466
466
|
function Le(i) {
|
|
467
467
|
return re() ? i instanceof Node || i instanceof k(i).Node : !1;
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function P(i) {
|
|
470
470
|
return re() ? i instanceof Element || i instanceof k(i).Element : !1;
|
|
471
471
|
}
|
|
472
472
|
function T(i) {
|
|
473
473
|
return re() ? i instanceof HTMLElement || i instanceof k(i).HTMLElement : !1;
|
|
474
474
|
}
|
|
475
|
-
function
|
|
475
|
+
function Oe(i) {
|
|
476
476
|
return !re() || typeof ShadowRoot > "u" ? !1 : i instanceof ShadowRoot || i instanceof k(i).ShadowRoot;
|
|
477
477
|
}
|
|
478
478
|
const ht = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
@@ -480,10 +480,10 @@ function Y(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 +
|
|
483
|
+
overflowY: l,
|
|
484
|
+
display: o
|
|
485
|
+
} = S(i);
|
|
486
|
+
return /auto|scroll|overlay|hidden|clip/.test(e + l + t) && !ht.has(o);
|
|
487
487
|
}
|
|
488
488
|
const ut = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
489
489
|
function mt(i) {
|
|
@@ -501,17 +501,17 @@ function ae(i) {
|
|
|
501
501
|
}
|
|
502
502
|
const gt = ["transform", "translate", "scale", "rotate", "perspective"], bt = ["transform", "translate", "scale", "rotate", "perspective", "filter"], vt = ["paint", "layout", "strict", "content"];
|
|
503
503
|
function ve(i) {
|
|
504
|
-
const e = we(), t =
|
|
505
|
-
return gt.some((
|
|
504
|
+
const e = we(), t = P(i) ? S(i) : i;
|
|
505
|
+
return gt.some((l) => t[l] ? t[l] !== "none" : !1) || (t.containerType ? t.containerType !== "normal" : !1) || !e && (t.backdropFilter ? t.backdropFilter !== "none" : !1) || !e && (t.filter ? t.filter !== "none" : !1) || bt.some((l) => (t.willChange || "").includes(l)) || vt.some((l) => (t.contain || "").includes(l));
|
|
506
506
|
}
|
|
507
507
|
function wt(i) {
|
|
508
|
-
let e =
|
|
508
|
+
let e = D(i);
|
|
509
509
|
for (; T(e) && !W(e); ) {
|
|
510
510
|
if (ve(e))
|
|
511
511
|
return e;
|
|
512
512
|
if (ae(e))
|
|
513
513
|
return null;
|
|
514
|
-
e =
|
|
514
|
+
e = D(e);
|
|
515
515
|
}
|
|
516
516
|
return null;
|
|
517
517
|
}
|
|
@@ -522,11 +522,11 @@ const _t = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
|
522
522
|
function W(i) {
|
|
523
523
|
return _t.has(j(i));
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function S(i) {
|
|
526
526
|
return k(i).getComputedStyle(i);
|
|
527
527
|
}
|
|
528
528
|
function ce(i) {
|
|
529
|
-
return
|
|
529
|
+
return P(i) ? {
|
|
530
530
|
scrollLeft: i.scrollLeft,
|
|
531
531
|
scrollTop: i.scrollTop
|
|
532
532
|
} : {
|
|
@@ -534,65 +534,65 @@ function ce(i) {
|
|
|
534
534
|
scrollTop: i.scrollY
|
|
535
535
|
};
|
|
536
536
|
}
|
|
537
|
-
function
|
|
537
|
+
function D(i) {
|
|
538
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
|
+
Oe(i) && i.host || // Fallback.
|
|
545
|
+
M(i)
|
|
546
546
|
);
|
|
547
|
-
return
|
|
547
|
+
return Oe(e) ? e.host : e;
|
|
548
548
|
}
|
|
549
549
|
function ze(i) {
|
|
550
|
-
const e =
|
|
550
|
+
const e = D(i);
|
|
551
551
|
return W(e) ? i.ownerDocument ? i.ownerDocument.body : i.body : T(e) && Y(e) ? e : ze(e);
|
|
552
552
|
}
|
|
553
553
|
function U(i, e, t) {
|
|
554
|
-
var
|
|
554
|
+
var l;
|
|
555
555
|
e === void 0 && (e = []), t === void 0 && (t = !0);
|
|
556
|
-
const
|
|
557
|
-
if (
|
|
556
|
+
const o = ze(i), s = o === ((l = i.ownerDocument) == null ? void 0 : l.body), n = k(o);
|
|
557
|
+
if (s) {
|
|
558
558
|
const r = ge(n);
|
|
559
|
-
return e.concat(n, n.visualViewport || [], Y(
|
|
559
|
+
return e.concat(n, n.visualViewport || [], Y(o) ? o : [], r && t ? U(r) : []);
|
|
560
560
|
}
|
|
561
|
-
return e.concat(
|
|
561
|
+
return e.concat(o, U(o, [], t));
|
|
562
562
|
}
|
|
563
563
|
function ge(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 =
|
|
566
|
+
function Re(i) {
|
|
567
|
+
const e = S(i);
|
|
568
|
+
let t = parseFloat(e.width) || 0, l = parseFloat(e.height) || 0;
|
|
569
|
+
const o = T(i), s = o ? i.offsetWidth : t, n = o ? i.offsetHeight : l, r = ie(t) !== s || ie(l) !== n;
|
|
570
|
+
return r && (t = s, l = n), {
|
|
571
571
|
width: t,
|
|
572
|
-
height:
|
|
572
|
+
height: l,
|
|
573
573
|
$: r
|
|
574
574
|
};
|
|
575
575
|
}
|
|
576
576
|
function _e(i) {
|
|
577
|
-
return
|
|
577
|
+
return P(i) ? i : i.contextElement;
|
|
578
578
|
}
|
|
579
579
|
function H(i) {
|
|
580
580
|
const e = _e(i);
|
|
581
581
|
if (!T(e))
|
|
582
|
-
return
|
|
582
|
+
return O(1);
|
|
583
583
|
const t = e.getBoundingClientRect(), {
|
|
584
|
-
width:
|
|
585
|
-
height:
|
|
586
|
-
$:
|
|
587
|
-
} =
|
|
588
|
-
let n = (
|
|
584
|
+
width: l,
|
|
585
|
+
height: o,
|
|
586
|
+
$: s
|
|
587
|
+
} = Re(e);
|
|
588
|
+
let n = (s ? ie(t.width) : t.width) / l, r = (s ? ie(t.height) : t.height) / o;
|
|
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 yt = /* @__PURE__ */
|
|
595
|
-
function
|
|
594
|
+
const yt = /* @__PURE__ */ O(0);
|
|
595
|
+
function Ne(i) {
|
|
596
596
|
const e = k(i);
|
|
597
597
|
return !we() || !e.visualViewport ? yt : {
|
|
598
598
|
x: e.visualViewport.offsetLeft,
|
|
@@ -602,22 +602,22 @@ function Re(i) {
|
|
|
602
602
|
function xt(i, e, t) {
|
|
603
603
|
return e === void 0 && (e = !1), !t || e && t !== k(i) ? !1 : e;
|
|
604
604
|
}
|
|
605
|
-
function
|
|
605
|
+
function N(i, e, t, l) {
|
|
606
606
|
e === void 0 && (e = !1), t === void 0 && (t = !1);
|
|
607
|
-
const
|
|
608
|
-
let n =
|
|
609
|
-
e && (
|
|
610
|
-
const r = xt(
|
|
611
|
-
let a = (
|
|
612
|
-
if (
|
|
613
|
-
const m = k(
|
|
607
|
+
const o = i.getBoundingClientRect(), s = _e(i);
|
|
608
|
+
let n = O(1);
|
|
609
|
+
e && (l ? P(l) && (n = H(l)) : n = H(i));
|
|
610
|
+
const r = xt(s, t, l) ? Ne(s) : O(0);
|
|
611
|
+
let a = (o.left + r.x) / n.x, c = (o.top + r.y) / n.y, p = o.width / n.x, d = o.height / n.y;
|
|
612
|
+
if (s) {
|
|
613
|
+
const m = k(s), u = l && P(l) ? k(l) : l;
|
|
614
614
|
let g = m, v = ge(g);
|
|
615
|
-
for (; v &&
|
|
616
|
-
const w = H(v), b = v.getBoundingClientRect(), _ =
|
|
615
|
+
for (; v && l && u !== g; ) {
|
|
616
|
+
const w = H(v), b = v.getBoundingClientRect(), _ = S(v), y = b.left + (v.clientLeft + parseFloat(_.paddingLeft)) * w.x, C = b.top + (v.clientTop + parseFloat(_.paddingTop)) * w.y;
|
|
617
617
|
a *= w.x, c *= w.y, p *= w.x, d *= w.y, a += y, c += C, g = k(v), v = ge(g);
|
|
618
618
|
}
|
|
619
619
|
}
|
|
620
|
-
return
|
|
620
|
+
return oe({
|
|
621
621
|
width: p,
|
|
622
622
|
height: d,
|
|
623
623
|
x: a,
|
|
@@ -626,35 +626,35 @@ function R(i, e, t, o) {
|
|
|
626
626
|
}
|
|
627
627
|
function de(i, e) {
|
|
628
628
|
const t = ce(i).scrollLeft;
|
|
629
|
-
return e ? e.left + t :
|
|
629
|
+
return e ? e.left + t : N(M(i)).left + t;
|
|
630
630
|
}
|
|
631
631
|
function Fe(i, e) {
|
|
632
|
-
const t = i.getBoundingClientRect(),
|
|
632
|
+
const t = i.getBoundingClientRect(), l = t.left + e.scrollLeft - de(i, t), o = t.top + e.scrollTop;
|
|
633
633
|
return {
|
|
634
|
-
x:
|
|
635
|
-
y:
|
|
634
|
+
x: l,
|
|
635
|
+
y: o
|
|
636
636
|
};
|
|
637
637
|
}
|
|
638
638
|
function Ct(i) {
|
|
639
639
|
let {
|
|
640
640
|
elements: e,
|
|
641
641
|
rect: t,
|
|
642
|
-
offsetParent:
|
|
643
|
-
strategy:
|
|
642
|
+
offsetParent: l,
|
|
643
|
+
strategy: o
|
|
644
644
|
} = i;
|
|
645
|
-
const
|
|
646
|
-
if (
|
|
645
|
+
const s = o === "fixed", n = M(l), r = e ? ae(e.floating) : !1;
|
|
646
|
+
if (l === n || r && s)
|
|
647
647
|
return t;
|
|
648
648
|
let a = {
|
|
649
649
|
scrollLeft: 0,
|
|
650
650
|
scrollTop: 0
|
|
651
|
-
}, c =
|
|
652
|
-
const p =
|
|
653
|
-
if ((d || !d && !
|
|
654
|
-
const
|
|
655
|
-
c = H(
|
|
651
|
+
}, c = O(1);
|
|
652
|
+
const p = O(0), d = T(l);
|
|
653
|
+
if ((d || !d && !s) && ((j(l) !== "body" || Y(n)) && (a = ce(l)), T(l))) {
|
|
654
|
+
const u = N(l);
|
|
655
|
+
c = H(l), p.x = u.x + l.clientLeft, p.y = u.y + l.clientTop;
|
|
656
656
|
}
|
|
657
|
-
const m = n && !d && !
|
|
657
|
+
const m = n && !d && !s ? Fe(n, a) : O(0);
|
|
658
658
|
return {
|
|
659
659
|
width: t.width * c.x,
|
|
660
660
|
height: t.height * c.y,
|
|
@@ -666,40 +666,40 @@ function kt(i) {
|
|
|
666
666
|
return Array.from(i.getClientRects());
|
|
667
667
|
}
|
|
668
668
|
function At(i) {
|
|
669
|
-
const e =
|
|
669
|
+
const e = M(i), t = ce(i), l = i.ownerDocument.body, o = z(e.scrollWidth, e.clientWidth, l.scrollWidth, l.clientWidth), s = z(e.scrollHeight, e.clientHeight, l.scrollHeight, l.clientHeight);
|
|
670
670
|
let n = -t.scrollLeft + de(i);
|
|
671
671
|
const r = -t.scrollTop;
|
|
672
|
-
return
|
|
673
|
-
width:
|
|
674
|
-
height:
|
|
672
|
+
return S(l).direction === "rtl" && (n += z(e.clientWidth, l.clientWidth) - o), {
|
|
673
|
+
width: o,
|
|
674
|
+
height: s,
|
|
675
675
|
x: n,
|
|
676
676
|
y: r
|
|
677
677
|
};
|
|
678
678
|
}
|
|
679
679
|
const Te = 25;
|
|
680
|
-
function
|
|
681
|
-
const t = k(i),
|
|
682
|
-
let
|
|
683
|
-
if (
|
|
684
|
-
|
|
680
|
+
function Pt(i, e) {
|
|
681
|
+
const t = k(i), l = M(i), o = t.visualViewport;
|
|
682
|
+
let s = l.clientWidth, n = l.clientHeight, r = 0, a = 0;
|
|
683
|
+
if (o) {
|
|
684
|
+
s = o.width, n = o.height;
|
|
685
685
|
const p = we();
|
|
686
|
-
(!p || p && e === "fixed") && (r =
|
|
686
|
+
(!p || p && e === "fixed") && (r = o.offsetLeft, a = o.offsetTop);
|
|
687
687
|
}
|
|
688
|
-
const c = de(
|
|
688
|
+
const c = de(l);
|
|
689
689
|
if (c <= 0) {
|
|
690
|
-
const p =
|
|
691
|
-
g <= Te && (
|
|
692
|
-
} else c <= Te && (
|
|
690
|
+
const p = l.ownerDocument, d = p.body, m = getComputedStyle(d), u = p.compatMode === "CSS1Compat" && parseFloat(m.marginLeft) + parseFloat(m.marginRight) || 0, g = Math.abs(l.clientWidth - d.clientWidth - u);
|
|
691
|
+
g <= Te && (s -= g);
|
|
692
|
+
} else c <= Te && (s += c);
|
|
693
693
|
return {
|
|
694
|
-
width:
|
|
694
|
+
width: s,
|
|
695
695
|
height: n,
|
|
696
696
|
x: r,
|
|
697
697
|
y: a
|
|
698
698
|
};
|
|
699
699
|
}
|
|
700
|
-
const
|
|
701
|
-
function
|
|
702
|
-
const t =
|
|
700
|
+
const St = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
701
|
+
function Ot(i, e) {
|
|
702
|
+
const t = N(i, !0, e === "fixed"), l = t.top + i.clientTop, o = t.left + i.clientLeft, s = T(i) ? H(i) : O(1), n = i.clientWidth * s.x, r = i.clientHeight * s.y, a = o * s.x, c = l * s.y;
|
|
703
703
|
return {
|
|
704
704
|
width: n,
|
|
705
705
|
height: r,
|
|
@@ -707,53 +707,53 @@ function Pt(i, e) {
|
|
|
707
707
|
y: c
|
|
708
708
|
};
|
|
709
709
|
}
|
|
710
|
-
function
|
|
711
|
-
let
|
|
710
|
+
function Me(i, e, t) {
|
|
711
|
+
let l;
|
|
712
712
|
if (e === "viewport")
|
|
713
|
-
|
|
713
|
+
l = Pt(i, t);
|
|
714
714
|
else if (e === "document")
|
|
715
|
-
|
|
716
|
-
else if (
|
|
717
|
-
|
|
715
|
+
l = At(M(i));
|
|
716
|
+
else if (P(e))
|
|
717
|
+
l = Ot(e, t);
|
|
718
718
|
else {
|
|
719
|
-
const
|
|
720
|
-
|
|
721
|
-
x: e.x -
|
|
722
|
-
y: e.y -
|
|
719
|
+
const o = Ne(i);
|
|
720
|
+
l = {
|
|
721
|
+
x: e.x - o.x,
|
|
722
|
+
y: e.y - o.y,
|
|
723
723
|
width: e.width,
|
|
724
724
|
height: e.height
|
|
725
725
|
};
|
|
726
726
|
}
|
|
727
|
-
return
|
|
727
|
+
return oe(l);
|
|
728
728
|
}
|
|
729
729
|
function Be(i, e) {
|
|
730
|
-
const t =
|
|
731
|
-
return t === e || !
|
|
730
|
+
const t = D(i);
|
|
731
|
+
return t === e || !P(t) || W(t) ? !1 : S(t).position === "fixed" || Be(t, e);
|
|
732
732
|
}
|
|
733
733
|
function Tt(i, e) {
|
|
734
734
|
const t = e.get(i);
|
|
735
735
|
if (t)
|
|
736
736
|
return t;
|
|
737
|
-
let
|
|
738
|
-
const
|
|
739
|
-
let n =
|
|
740
|
-
for (;
|
|
741
|
-
const r =
|
|
742
|
-
!a && r.position === "fixed" && (
|
|
737
|
+
let l = U(i, [], !1).filter((r) => P(r) && j(r) !== "body"), o = null;
|
|
738
|
+
const s = S(i).position === "fixed";
|
|
739
|
+
let n = s ? D(i) : i;
|
|
740
|
+
for (; P(n) && !W(n); ) {
|
|
741
|
+
const r = S(n), a = ve(n);
|
|
742
|
+
!a && r.position === "fixed" && (o = null), (s ? !a && !o : !a && r.position === "static" && !!o && St.has(o.position) || Y(n) && !a && Be(i, n)) ? l = l.filter((p) => p !== n) : o = r, n = D(n);
|
|
743
743
|
}
|
|
744
|
-
return e.set(i,
|
|
744
|
+
return e.set(i, l), l;
|
|
745
745
|
}
|
|
746
|
-
function
|
|
746
|
+
function Mt(i) {
|
|
747
747
|
let {
|
|
748
748
|
element: e,
|
|
749
749
|
boundary: t,
|
|
750
|
-
rootBoundary:
|
|
751
|
-
strategy:
|
|
750
|
+
rootBoundary: l,
|
|
751
|
+
strategy: o
|
|
752
752
|
} = i;
|
|
753
|
-
const n = [...t === "clippingAncestors" ? ae(e) ? [] : Tt(e, this._c) : [].concat(t),
|
|
754
|
-
const d =
|
|
753
|
+
const n = [...t === "clippingAncestors" ? ae(e) ? [] : Tt(e, this._c) : [].concat(t), l], r = n[0], a = n.reduce((c, p) => {
|
|
754
|
+
const d = Me(e, p, o);
|
|
755
755
|
return c.top = z(d.top, c.top), c.right = te(d.right, c.right), c.bottom = te(d.bottom, c.bottom), c.left = z(d.left, c.left), c;
|
|
756
|
-
},
|
|
756
|
+
}, Me(e, r, o));
|
|
757
757
|
return {
|
|
758
758
|
width: a.right - a.left,
|
|
759
759
|
height: a.bottom - a.top,
|
|
@@ -761,33 +761,33 @@ function It(i) {
|
|
|
761
761
|
y: a.top
|
|
762
762
|
};
|
|
763
763
|
}
|
|
764
|
-
function
|
|
764
|
+
function It(i) {
|
|
765
765
|
const {
|
|
766
766
|
width: e,
|
|
767
767
|
height: t
|
|
768
|
-
} =
|
|
768
|
+
} = Re(i);
|
|
769
769
|
return {
|
|
770
770
|
width: e,
|
|
771
771
|
height: t
|
|
772
772
|
};
|
|
773
773
|
}
|
|
774
774
|
function Et(i, e, t) {
|
|
775
|
-
const
|
|
775
|
+
const l = T(e), o = M(e), s = t === "fixed", n = N(i, !0, s, e);
|
|
776
776
|
let r = {
|
|
777
777
|
scrollLeft: 0,
|
|
778
778
|
scrollTop: 0
|
|
779
779
|
};
|
|
780
|
-
const a =
|
|
780
|
+
const a = O(0);
|
|
781
781
|
function c() {
|
|
782
|
-
a.x = de(
|
|
783
|
-
}
|
|
784
|
-
if (
|
|
785
|
-
if ((j(e) !== "body" || Y(
|
|
786
|
-
const
|
|
787
|
-
a.x =
|
|
788
|
-
} else
|
|
789
|
-
|
|
790
|
-
const p =
|
|
782
|
+
a.x = de(o);
|
|
783
|
+
}
|
|
784
|
+
if (l || !l && !s)
|
|
785
|
+
if ((j(e) !== "body" || Y(o)) && (r = ce(e)), l) {
|
|
786
|
+
const u = N(e, !0, s, e);
|
|
787
|
+
a.x = u.x + e.clientLeft, a.y = u.y + e.clientTop;
|
|
788
|
+
} else o && c();
|
|
789
|
+
s && !l && o && c();
|
|
790
|
+
const p = o && !l && !s ? Fe(o, r) : O(0), d = n.left + r.scrollLeft - a.x - p.x, m = n.top + r.scrollTop - a.y - p.y;
|
|
791
791
|
return {
|
|
792
792
|
x: d,
|
|
793
793
|
y: m,
|
|
@@ -796,82 +796,82 @@ function Et(i, e, t) {
|
|
|
796
796
|
};
|
|
797
797
|
}
|
|
798
798
|
function ue(i) {
|
|
799
|
-
return
|
|
799
|
+
return S(i).position === "static";
|
|
800
800
|
}
|
|
801
|
-
function
|
|
802
|
-
if (!T(i) ||
|
|
801
|
+
function Ie(i, e) {
|
|
802
|
+
if (!T(i) || S(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 M(i) === t && (t = t.ownerDocument.body), t;
|
|
808
808
|
}
|
|
809
809
|
function He(i, e) {
|
|
810
810
|
const t = k(i);
|
|
811
811
|
if (ae(i))
|
|
812
812
|
return t;
|
|
813
813
|
if (!T(i)) {
|
|
814
|
-
let
|
|
815
|
-
for (;
|
|
816
|
-
if (
|
|
817
|
-
return
|
|
818
|
-
|
|
814
|
+
let o = D(i);
|
|
815
|
+
for (; o && !W(o); ) {
|
|
816
|
+
if (P(o) && !ue(o))
|
|
817
|
+
return o;
|
|
818
|
+
o = D(o);
|
|
819
819
|
}
|
|
820
820
|
return t;
|
|
821
821
|
}
|
|
822
|
-
let
|
|
823
|
-
for (;
|
|
824
|
-
|
|
825
|
-
return
|
|
822
|
+
let l = Ie(i, e);
|
|
823
|
+
for (; l && mt(l) && ue(l); )
|
|
824
|
+
l = Ie(l, e);
|
|
825
|
+
return l && W(l) && ue(l) && !ve(l) ? t : l || wt(i) || t;
|
|
826
826
|
}
|
|
827
827
|
const Vt = async function(i) {
|
|
828
|
-
const e = this.getOffsetParent || He, t = this.getDimensions,
|
|
828
|
+
const e = this.getOffsetParent || He, t = this.getDimensions, l = await t(i.floating);
|
|
829
829
|
return {
|
|
830
830
|
reference: Et(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: l.width,
|
|
835
|
+
height: l.height
|
|
836
836
|
}
|
|
837
837
|
};
|
|
838
838
|
};
|
|
839
|
-
function
|
|
840
|
-
return
|
|
839
|
+
function Dt(i) {
|
|
840
|
+
return S(i).direction === "rtl";
|
|
841
841
|
}
|
|
842
|
-
const
|
|
842
|
+
const $t = {
|
|
843
843
|
convertOffsetParentRelativeRectToViewportRelativeRect: Ct,
|
|
844
|
-
getDocumentElement:
|
|
845
|
-
getClippingRect:
|
|
844
|
+
getDocumentElement: M,
|
|
845
|
+
getClippingRect: Mt,
|
|
846
846
|
getOffsetParent: He,
|
|
847
847
|
getElementRects: Vt,
|
|
848
848
|
getClientRects: kt,
|
|
849
|
-
getDimensions:
|
|
849
|
+
getDimensions: It,
|
|
850
850
|
getScale: H,
|
|
851
|
-
isElement:
|
|
852
|
-
isRTL:
|
|
851
|
+
isElement: P,
|
|
852
|
+
isRTL: Dt
|
|
853
853
|
};
|
|
854
854
|
function We(i, e) {
|
|
855
855
|
return i.x === e.x && i.y === e.y && i.width === e.width && i.height === e.height;
|
|
856
856
|
}
|
|
857
857
|
function Lt(i, e) {
|
|
858
|
-
let t = null,
|
|
859
|
-
const
|
|
860
|
-
function
|
|
858
|
+
let t = null, l;
|
|
859
|
+
const o = M(i);
|
|
860
|
+
function s() {
|
|
861
861
|
var r;
|
|
862
|
-
clearTimeout(
|
|
862
|
+
clearTimeout(l), (r = t) == null || r.disconnect(), t = null;
|
|
863
863
|
}
|
|
864
864
|
function n(r, a) {
|
|
865
|
-
r === void 0 && (r = !1), a === void 0 && (a = 1),
|
|
865
|
+
r === void 0 && (r = !1), a === void 0 && (a = 1), s();
|
|
866
866
|
const c = i.getBoundingClientRect(), {
|
|
867
867
|
left: p,
|
|
868
868
|
top: d,
|
|
869
869
|
width: m,
|
|
870
|
-
height:
|
|
870
|
+
height: u
|
|
871
871
|
} = c;
|
|
872
|
-
if (r || e(), !m || !
|
|
872
|
+
if (r || e(), !m || !u)
|
|
873
873
|
return;
|
|
874
|
-
const g = J(d), v = J(
|
|
874
|
+
const g = J(d), v = J(o.clientWidth - (p + m)), w = J(o.clientHeight - (d + u)), b = J(p), y = {
|
|
875
875
|
rootMargin: -g + "px " + -v + "px " + -w + "px " + -b + "px",
|
|
876
876
|
threshold: z(0, te(1, a)) || 1
|
|
877
877
|
};
|
|
@@ -881,7 +881,7 @@ function Lt(i, e) {
|
|
|
881
881
|
if (F !== a) {
|
|
882
882
|
if (!C)
|
|
883
883
|
return n();
|
|
884
|
-
F ? n(!1, F) :
|
|
884
|
+
F ? n(!1, F) : l = setTimeout(() => {
|
|
885
885
|
n(!1, 1e-7);
|
|
886
886
|
}, 1e3);
|
|
887
887
|
}
|
|
@@ -891,62 +891,62 @@ function Lt(i, e) {
|
|
|
891
891
|
t = new IntersectionObserver(x, {
|
|
892
892
|
...y,
|
|
893
893
|
// Handle <iframe>s
|
|
894
|
-
root:
|
|
894
|
+
root: o.ownerDocument
|
|
895
895
|
});
|
|
896
896
|
} catch {
|
|
897
897
|
t = new IntersectionObserver(x, y);
|
|
898
898
|
}
|
|
899
899
|
t.observe(i);
|
|
900
900
|
}
|
|
901
|
-
return n(!0),
|
|
901
|
+
return n(!0), s;
|
|
902
902
|
}
|
|
903
|
-
function q(i, e, t,
|
|
904
|
-
|
|
903
|
+
function q(i, e, t, l) {
|
|
904
|
+
l === void 0 && (l = {});
|
|
905
905
|
const {
|
|
906
|
-
ancestorScroll:
|
|
907
|
-
ancestorResize:
|
|
906
|
+
ancestorScroll: o = !0,
|
|
907
|
+
ancestorResize: s = !0,
|
|
908
908
|
elementResize: n = typeof ResizeObserver == "function",
|
|
909
909
|
layoutShift: r = typeof IntersectionObserver == "function",
|
|
910
910
|
animationFrame: a = !1
|
|
911
|
-
} =
|
|
911
|
+
} = l, c = _e(i), p = o || s ? [...c ? U(c) : [], ...U(e)] : [];
|
|
912
912
|
p.forEach((b) => {
|
|
913
|
-
|
|
913
|
+
o && b.addEventListener("scroll", t, {
|
|
914
914
|
passive: !0
|
|
915
|
-
}),
|
|
915
|
+
}), s && b.addEventListener("resize", t);
|
|
916
916
|
});
|
|
917
917
|
const d = c && r ? Lt(c, t) : null;
|
|
918
|
-
let m = -1,
|
|
919
|
-
n && (
|
|
918
|
+
let m = -1, u = null;
|
|
919
|
+
n && (u = new ResizeObserver((b) => {
|
|
920
920
|
let [_] = b;
|
|
921
|
-
_ && _.target === c &&
|
|
921
|
+
_ && _.target === c && u && (u.unobserve(e), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
|
|
922
922
|
var y;
|
|
923
|
-
(y =
|
|
923
|
+
(y = u) == null || y.observe(e);
|
|
924
924
|
})), t();
|
|
925
|
-
}), c && !a &&
|
|
926
|
-
let g, v = a ?
|
|
925
|
+
}), c && !a && u.observe(c), u.observe(e));
|
|
926
|
+
let g, v = a ? N(i) : null;
|
|
927
927
|
a && w();
|
|
928
928
|
function w() {
|
|
929
|
-
const b =
|
|
929
|
+
const b = N(i);
|
|
930
930
|
v && !We(v, b) && t(), v = b, g = requestAnimationFrame(w);
|
|
931
931
|
}
|
|
932
932
|
return t(), () => {
|
|
933
933
|
var b;
|
|
934
934
|
p.forEach((_) => {
|
|
935
|
-
|
|
936
|
-
}), d == null || d(), (b =
|
|
935
|
+
o && _.removeEventListener("scroll", t), s && _.removeEventListener("resize", t);
|
|
936
|
+
}), d == null || d(), (b = u) == null || b.disconnect(), u = null, a && cancelAnimationFrame(g);
|
|
937
937
|
};
|
|
938
938
|
}
|
|
939
939
|
const Z = dt, Q = pt, me = rt, ee = (i, e, t) => {
|
|
940
|
-
const
|
|
941
|
-
platform:
|
|
940
|
+
const l = /* @__PURE__ */ new Map(), o = {
|
|
941
|
+
platform: $t,
|
|
942
942
|
...t
|
|
943
|
-
},
|
|
944
|
-
...
|
|
945
|
-
_c:
|
|
943
|
+
}, s = {
|
|
944
|
+
...o.platform,
|
|
945
|
+
_c: l
|
|
946
946
|
};
|
|
947
947
|
return nt(i, e, {
|
|
948
|
-
...
|
|
949
|
-
platform:
|
|
948
|
+
...o,
|
|
949
|
+
platform: s
|
|
950
950
|
});
|
|
951
951
|
};
|
|
952
952
|
let E = 0;
|
|
@@ -986,35 +986,38 @@ const f = {
|
|
|
986
986
|
};
|
|
987
987
|
class zt {
|
|
988
988
|
constructor(e, t = {}) {
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
989
|
+
h(this, "element");
|
|
990
|
+
h(this, "instanceId");
|
|
991
|
+
h(this, "options");
|
|
992
|
+
h(this, "isOpen", !1);
|
|
993
|
+
h(this, "selectedValues", /* @__PURE__ */ new Set());
|
|
994
|
+
h(this, "selectedOptions", /* @__PURE__ */ new Map());
|
|
995
|
+
h(this, "allOptions", []);
|
|
996
|
+
h(this, "filteredOptions", []);
|
|
997
|
+
h(this, "hiddenInputs", []);
|
|
998
|
+
h(this, "focusedIndex", -1);
|
|
999
|
+
h(this, "searchTerm", "");
|
|
1000
|
+
h(this, "isLoading", !1);
|
|
1001
|
+
h(this, "showSelectedPopover", !1);
|
|
1002
|
+
h(this, "selectedPopoverPlacement", null);
|
|
1003
|
+
h(this, "dropdownPlacement", null);
|
|
1004
|
+
h(this, "isRTL", !1);
|
|
1005
|
+
h(this, "effectivePillsPosition", "bottom");
|
|
1006
|
+
h(this, "justClosedViaClick", !1);
|
|
1004
1007
|
// Floating UI cleanup functions
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
+
h(this, "dropdownCleanup", null);
|
|
1009
|
+
h(this, "hintCleanup", null);
|
|
1010
|
+
h(this, "selectedPopoverCleanup", null);
|
|
1008
1011
|
// Pill tooltip storage
|
|
1009
|
-
|
|
1010
|
-
|
|
1012
|
+
h(this, "pillTooltips", /* @__PURE__ */ new Map());
|
|
1013
|
+
h(this, "pillTooltipCleanups", /* @__PURE__ */ new Map());
|
|
1011
1014
|
// DOM elements
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1015
|
+
h(this, "input");
|
|
1016
|
+
h(this, "dropdown");
|
|
1017
|
+
h(this, "pillsContainer");
|
|
1018
|
+
h(this, "countBadge");
|
|
1019
|
+
h(this, "hint");
|
|
1020
|
+
h(this, "selectedPopover");
|
|
1018
1021
|
this.element = e, this.instanceId = `MS-${Math.random().toString(36).substr(2, 9)}`, this.options = {
|
|
1019
1022
|
// String options
|
|
1020
1023
|
searchHint: e.dataset.searchHint || "",
|
|
@@ -1134,12 +1137,21 @@ class zt {
|
|
|
1134
1137
|
this.filteredOptions = [...this.allOptions];
|
|
1135
1138
|
}
|
|
1136
1139
|
buildHTML() {
|
|
1137
|
-
const e = this.options.container || document.body;
|
|
1138
|
-
this.
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1140
|
+
const e = this.options.container || document.body, t = this.element.getRootNode(), l = t instanceof ShadowRoot ? t.host : this.element, o = l.getAttribute("dir") === "rtl", s = l.closest('[dir="rtl"]') !== null;
|
|
1141
|
+
this.isRTL = o || s, console.log("[MultiSelect RTL Debug]", {
|
|
1142
|
+
isShadowRoot: t instanceof ShadowRoot,
|
|
1143
|
+
hostElement: l,
|
|
1144
|
+
elementDir: l.getAttribute("dir"),
|
|
1145
|
+
hasElementDir: o,
|
|
1146
|
+
hasAncestorDir: s,
|
|
1147
|
+
isRTL: this.isRTL
|
|
1148
|
+
}), 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"), console.log("[MultiSelect RTL] Added ml--rtl class to element")), (!this.options.isCheckboxesShown || !this.options.isMultipleEnabled) && this.element.classList.add("ml--no-checkboxes");
|
|
1149
|
+
const n = document.createElement("div");
|
|
1150
|
+
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");
|
|
1151
|
+
const r = document.createElement("span");
|
|
1152
|
+
r.className = "ml__toggle", r.innerHTML = "▼", this.countBadge = document.createElement("span"), this.countBadge.className = "ml__count-badge", this.countBadge.style.display = "none", n.appendChild(this.input), n.appendChild(this.countBadge), n.appendChild(r), this.pillsContainer = document.createElement("div"), this.pillsContainer.className = "ml__pills";
|
|
1153
|
+
const a = document.createElement("div");
|
|
1154
|
+
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();
|
|
1143
1155
|
}
|
|
1144
1156
|
renderDropdown() {
|
|
1145
1157
|
let e = "";
|
|
@@ -1155,33 +1167,33 @@ class zt {
|
|
|
1155
1167
|
e += `<div class="ml__empty">${this.options.emptyMessage}</div>`;
|
|
1156
1168
|
else if (this.options.isGroupsAllowed) {
|
|
1157
1169
|
const t = this.groupOptions(this.filteredOptions);
|
|
1158
|
-
Object.keys(t).forEach((
|
|
1159
|
-
e += '<div class="ml__group">',
|
|
1160
|
-
e += this.renderOption(
|
|
1170
|
+
Object.keys(t).forEach((l) => {
|
|
1171
|
+
e += '<div class="ml__group">', l !== "__ungrouped__" && (e += `<div class="ml__group-label">${l}</div>`), t[l].forEach((o, s) => {
|
|
1172
|
+
e += this.renderOption(o, s);
|
|
1161
1173
|
}), e += "</div>";
|
|
1162
1174
|
});
|
|
1163
1175
|
} else
|
|
1164
|
-
this.filteredOptions.forEach((t,
|
|
1165
|
-
e += this.renderOption(t,
|
|
1176
|
+
this.filteredOptions.forEach((t, l) => {
|
|
1177
|
+
e += this.renderOption(t, l);
|
|
1166
1178
|
});
|
|
1167
1179
|
e += "</div>", this.dropdown.innerHTML = e;
|
|
1168
1180
|
}
|
|
1169
1181
|
renderOption(e, t) {
|
|
1170
|
-
const
|
|
1182
|
+
const l = this.getItemValue(e), o = this.getItemDisplayValue(e), s = this.getItemIcon(e), n = this.getItemSubtitle(e), r = this.getItemDisabled(e), a = this.selectedValues.has(String(l)), c = t === this.focusedIndex, p = ["ml__option"];
|
|
1171
1183
|
a && p.push("ml__option--selected"), c && p.push("ml__option--focused"), r && p.push("ml__option--disabled");
|
|
1172
|
-
let d = `<div class="${p.join(" ")}" data-value="${
|
|
1173
|
-
return this.options.isCheckboxesShown && this.options.isMultipleEnabled && (d += `<input type="checkbox" class="ml__checkbox" ${a ? "checked" : ""} ${r ? "disabled" : ""}>`), d += '<div class="ml__option-content">',
|
|
1184
|
+
let d = `<div class="${p.join(" ")}" data-value="${l}" data-index="${t}">`;
|
|
1185
|
+
return this.options.isCheckboxesShown && this.options.isMultipleEnabled && (d += `<input type="checkbox" class="ml__checkbox" ${a ? "checked" : ""} ${r ? "disabled" : ""}>`), d += '<div class="ml__option-content">', s && (d += `<span class="ml__option-icon">${s}</span>`), d += '<div class="ml__option-text">', d += `<div class="ml__option-title">${this.highlightMatch(o, this.searchTerm)}</div>`, n && (d += `<div class="ml__option-subtitle">${n}</div>`), d += "</div>", d += "</div>", d += "</div>", d;
|
|
1174
1186
|
}
|
|
1175
1187
|
highlightMatch(e, t) {
|
|
1176
1188
|
if (!t) return e;
|
|
1177
|
-
const
|
|
1178
|
-
return e.replace(
|
|
1189
|
+
const l = new RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})`, "gi");
|
|
1190
|
+
return e.replace(l, "<mark>$1</mark>");
|
|
1179
1191
|
}
|
|
1180
1192
|
groupOptions(e) {
|
|
1181
1193
|
const t = {};
|
|
1182
|
-
return e.forEach((
|
|
1183
|
-
const
|
|
1184
|
-
t[
|
|
1194
|
+
return e.forEach((l) => {
|
|
1195
|
+
const o = this.getItemGroup(l) || "__ungrouped__";
|
|
1196
|
+
t[o] || (t[o] = []), t[o].push(l);
|
|
1185
1197
|
}), t;
|
|
1186
1198
|
}
|
|
1187
1199
|
renderPills() {
|
|
@@ -1189,26 +1201,26 @@ class zt {
|
|
|
1189
1201
|
const e = Array.from(this.selectedOptions.values()), t = this.selectedValues.size;
|
|
1190
1202
|
if (!this.options.isMultipleEnabled) {
|
|
1191
1203
|
this.pillsContainer.innerHTML = "", this.countBadge.style.display = "none";
|
|
1192
|
-
const
|
|
1204
|
+
const s = e[0] ? this.getItemDisplayValue(e[0]) : void 0;
|
|
1193
1205
|
f.warn(`[${this.instanceId}] renderPills() single-select mode`, {
|
|
1194
1206
|
isOpen: this.isOpen,
|
|
1195
1207
|
count: t,
|
|
1196
1208
|
selectedOptionsLength: e.length,
|
|
1197
1209
|
willSetValue: !this.isOpen && t > 0 && e.length > 0,
|
|
1198
|
-
selectedLabel:
|
|
1199
|
-
}), !this.isOpen && t > 0 && e.length > 0 ? (f.info(`[${this.instanceId}] ✅ SETTING input.value = "${
|
|
1210
|
+
selectedLabel: s
|
|
1211
|
+
}), !this.isOpen && t > 0 && e.length > 0 ? (f.info(`[${this.instanceId}] ✅ SETTING input.value = "${s}"`), this.input.value = s, f.info(`[${this.instanceId}] 🔍 VERIFY input.value = "${this.input.value}"`)) : this.isOpen ? f.info(`[${this.instanceId}] ⏭️ SKIPPING input update (dropdown is open)`) : (f.info(`[${this.instanceId}] ❌ CLEARING input.value (no selection)`), this.input.value = "");
|
|
1200
1212
|
return;
|
|
1201
1213
|
}
|
|
1202
|
-
let
|
|
1203
|
-
if (this.options.pillsThreshold !== null && t > this.options.pillsThreshold && (
|
|
1204
|
-
if (t > 0 &&
|
|
1205
|
-
const
|
|
1206
|
-
this.input.placeholder =
|
|
1214
|
+
let l = this.options.pillsDisplayMode;
|
|
1215
|
+
if (this.options.pillsThreshold !== null && t > this.options.pillsThreshold && (l = this.options.pillsThresholdMode || "count"), !this.isOpen)
|
|
1216
|
+
if (t > 0 && l === "count") {
|
|
1217
|
+
const s = this.options.getCountPillCallback ? this.options.getCountPillCallback(t) : `${t} selected`;
|
|
1218
|
+
this.input.placeholder = s;
|
|
1207
1219
|
} else
|
|
1208
1220
|
this.input.placeholder = this.options.searchPlaceholder;
|
|
1209
|
-
if (this.options.isCountBadgeShown && t > 0 ? (this.countBadge.textContent = `[${t}]`, this.countBadge.style.display = "") : this.countBadge.style.display = "none",
|
|
1210
|
-
this.pillsContainer.className = `ml__pills ml__pills--${this.
|
|
1211
|
-
const n = this.getItemValue(
|
|
1221
|
+
if (this.options.isCountBadgeShown && t > 0 ? (this.countBadge.textContent = `[${t}]`, this.countBadge.style.display = "") : this.countBadge.style.display = "none", l === "pills")
|
|
1222
|
+
this.pillsContainer.className = `ml__pills ml__pills--${this.effectivePillsPosition}`, this.pillsContainer.innerHTML = e.map((s) => {
|
|
1223
|
+
const n = this.getItemValue(s), r = this.getItemDisplayValue(s);
|
|
1212
1224
|
return `
|
|
1213
1225
|
<div class="ml__pill">
|
|
1214
1226
|
<span class="ml__pill-text">${r}</span>
|
|
@@ -1216,9 +1228,9 @@ class zt {
|
|
|
1216
1228
|
</div>
|
|
1217
1229
|
`;
|
|
1218
1230
|
}).join("");
|
|
1219
|
-
else if (
|
|
1220
|
-
this.pillsContainer.className = `ml__pills ml__pills--${this.
|
|
1221
|
-
const
|
|
1231
|
+
else if (l === "partial") {
|
|
1232
|
+
this.pillsContainer.className = `ml__pills ml__pills--${this.effectivePillsPosition}`;
|
|
1233
|
+
const s = this.options.pillsMaxVisible || 3, n = e.slice(0, s), r = t - s, a = n.map((p) => {
|
|
1222
1234
|
const d = this.getItemValue(p), m = this.getItemDisplayValue(p);
|
|
1223
1235
|
return `
|
|
1224
1236
|
<div class="ml__pill">
|
|
@@ -1234,12 +1246,12 @@ class zt {
|
|
|
1234
1246
|
<button type="button" class="ml__pill-remove" data-action="remove-hidden" aria-label="Remove ${r} hidden items"></button>
|
|
1235
1247
|
</div>
|
|
1236
1248
|
`), this.pillsContainer.innerHTML = a + c;
|
|
1237
|
-
} else if (this.pillsContainer.className = `ml__count-display ml__count-display--${this.
|
|
1238
|
-
const
|
|
1249
|
+
} else if (this.pillsContainer.className = `ml__count-display ml__count-display--${this.effectivePillsPosition}`, t > 0) {
|
|
1250
|
+
const s = this.options.getCountPillCallback ? this.options.getCountPillCallback(t) : `${t} selected`;
|
|
1239
1251
|
this.pillsContainer.innerHTML = `
|
|
1240
1252
|
<div class="ml__count-badge-wrapper">
|
|
1241
1253
|
<button type="button" class="ml__count-text" data-action="show-selected">
|
|
1242
|
-
${
|
|
1254
|
+
${s}
|
|
1243
1255
|
</button>
|
|
1244
1256
|
<button type="button" class="ml__count-clear" data-action="clear-count" aria-label="Clear all selections"></button>
|
|
1245
1257
|
</div>
|
|
@@ -1250,8 +1262,12 @@ class zt {
|
|
|
1250
1262
|
}
|
|
1251
1263
|
attachEvents() {
|
|
1252
1264
|
this.input.addEventListener("mousedown", (e) => {
|
|
1253
|
-
this.isOpen
|
|
1254
|
-
|
|
1265
|
+
e.stopPropagation(), this.isOpen ? (this.justClosedViaClick = !0, this.close(), setTimeout(() => {
|
|
1266
|
+
this.justClosedViaClick = !1;
|
|
1267
|
+
}, 0)) : this.open();
|
|
1268
|
+
}), this.input.addEventListener("focus", () => {
|
|
1269
|
+
!this.isOpen && !this.justClosedViaClick && this.open();
|
|
1270
|
+
}), this.input.addEventListener("input", (e) => {
|
|
1255
1271
|
const t = e.target.value;
|
|
1256
1272
|
this.options.isSearchEnabled && !this.isOpen && this.open(), this.handleSearch(t);
|
|
1257
1273
|
}), this.input.addEventListener("keydown", (e) => this.handleKeydown(e)), setTimeout(() => {
|
|
@@ -1287,8 +1303,8 @@ class zt {
|
|
|
1287
1303
|
return;
|
|
1288
1304
|
}
|
|
1289
1305
|
if (!this.options.isSearchEnabled) {
|
|
1290
|
-
const t = e.key.length === 1 || e.key === "Backspace" || e.key === "Delete",
|
|
1291
|
-
if (t && !
|
|
1306
|
+
const t = e.key.length === 1 || e.key === "Backspace" || e.key === "Delete", l = ["ArrowUp", "ArrowDown", "PageUp", "PageDown", "Home", "End", "Enter", "Escape", "Tab"].includes(e.key);
|
|
1307
|
+
if (t && !l) {
|
|
1292
1308
|
e.preventDefault();
|
|
1293
1309
|
return;
|
|
1294
1310
|
}
|
|
@@ -1328,19 +1344,19 @@ class zt {
|
|
|
1328
1344
|
const t = e.target.closest("[data-action]");
|
|
1329
1345
|
if (t) {
|
|
1330
1346
|
e.preventDefault();
|
|
1331
|
-
const
|
|
1332
|
-
f.debug(`[${this.instanceId}] Action button clicked:`,
|
|
1347
|
+
const o = t.dataset.action;
|
|
1348
|
+
f.debug(`[${this.instanceId}] Action button clicked:`, o), o === "select-all" ? this.selectAll() : o === "clear-all" && this.clearAll();
|
|
1333
1349
|
return;
|
|
1334
1350
|
}
|
|
1335
|
-
const
|
|
1336
|
-
if (
|
|
1351
|
+
const l = e.target.closest(".ml__option");
|
|
1352
|
+
if (l && !l.classList.contains("ml__option--disabled")) {
|
|
1337
1353
|
e.preventDefault();
|
|
1338
|
-
const
|
|
1354
|
+
const o = l.dataset.value, s = this.filteredOptions.find((n) => String(this.getItemValue(n)) === o);
|
|
1339
1355
|
f.debug(`[${this.instanceId}] Option clicked:`, {
|
|
1340
|
-
value:
|
|
1356
|
+
value: o,
|
|
1341
1357
|
closeOnSelect: this.options.isCloseOnSelect,
|
|
1342
1358
|
placeholder: this.options.searchPlaceholder
|
|
1343
|
-
}),
|
|
1359
|
+
}), s && this.toggleOption(s);
|
|
1344
1360
|
}
|
|
1345
1361
|
}
|
|
1346
1362
|
handlePillClick(e) {
|
|
@@ -1352,15 +1368,15 @@ class zt {
|
|
|
1352
1368
|
e.preventDefault(), e.stopPropagation(), this.toggleSelectedPopover();
|
|
1353
1369
|
return;
|
|
1354
1370
|
}
|
|
1355
|
-
const
|
|
1356
|
-
if (
|
|
1357
|
-
if (e.preventDefault(), e.stopPropagation(),
|
|
1371
|
+
const o = e.target.closest(".ml__pill-remove");
|
|
1372
|
+
if (o) {
|
|
1373
|
+
if (e.preventDefault(), e.stopPropagation(), o.dataset.action === "remove-hidden") {
|
|
1358
1374
|
f.debug(`[${this.instanceId}] Remove hidden items button clicked`);
|
|
1359
1375
|
const a = this.options.pillsMaxVisible || 3;
|
|
1360
1376
|
Array.from(this.selectedOptions.values()).slice(a).forEach((d) => this.deselectOption(d));
|
|
1361
1377
|
return;
|
|
1362
1378
|
}
|
|
1363
|
-
const n =
|
|
1379
|
+
const n = o.dataset.value, r = this.selectedOptions.get(n);
|
|
1364
1380
|
r && this.deselectOption(r);
|
|
1365
1381
|
return;
|
|
1366
1382
|
}
|
|
@@ -1370,7 +1386,7 @@ class zt {
|
|
|
1370
1386
|
}
|
|
1371
1387
|
}
|
|
1372
1388
|
handleClickOutside(e) {
|
|
1373
|
-
var
|
|
1389
|
+
var o;
|
|
1374
1390
|
const t = e.composedPath();
|
|
1375
1391
|
if (this.showSelectedPopover && !t.some(
|
|
1376
1392
|
(n) => n instanceof Node && (this.selectedPopover.contains(n) || this.countBadge.contains(n) || n.closest && n.closest(".ml__count-text"))
|
|
@@ -1379,19 +1395,19 @@ class zt {
|
|
|
1379
1395
|
return;
|
|
1380
1396
|
}
|
|
1381
1397
|
if (!this.isOpen) return;
|
|
1382
|
-
const
|
|
1383
|
-
(
|
|
1398
|
+
const l = t.some(
|
|
1399
|
+
(s) => s instanceof Node && (this.element.contains(s) || this.dropdown.contains(s) || this.hint && this.hint.contains(s))
|
|
1384
1400
|
);
|
|
1385
1401
|
f.debug(`[${this.instanceId}] handleClickOutside`, {
|
|
1386
1402
|
target: e.target.className,
|
|
1387
1403
|
targetTag: e.target.tagName,
|
|
1388
|
-
clickedInside:
|
|
1404
|
+
clickedInside: l,
|
|
1389
1405
|
pathLength: t.length,
|
|
1390
|
-
firstInPath: (
|
|
1391
|
-
elementContains: t.some((
|
|
1392
|
-
dropdownContains: t.some((
|
|
1406
|
+
firstInPath: (o = t[0]) == null ? void 0 : o.tagName,
|
|
1407
|
+
elementContains: t.some((s) => s instanceof Node && this.element.contains(s)),
|
|
1408
|
+
dropdownContains: t.some((s) => s instanceof Node && this.dropdown.contains(s)),
|
|
1393
1409
|
isConnected: this.dropdown.isConnected
|
|
1394
|
-
}),
|
|
1410
|
+
}), l || (f.warn(`[${this.instanceId}] Closing dropdown due to click outside`), this.close());
|
|
1395
1411
|
}
|
|
1396
1412
|
focusNext() {
|
|
1397
1413
|
this.filteredOptions.length !== 0 && (this.focusedIndex = (this.focusedIndex + 1) % this.filteredOptions.length, this.renderDropdown(), this.scrollToFocused());
|
|
@@ -1416,12 +1432,12 @@ class zt {
|
|
|
1416
1432
|
e && e.scrollIntoView({ block: "nearest", behavior: "smooth" });
|
|
1417
1433
|
}
|
|
1418
1434
|
toggleOption(e) {
|
|
1419
|
-
const t = this.getItemValue(e),
|
|
1435
|
+
const t = this.getItemValue(e), l = String(t);
|
|
1420
1436
|
if (f.debug(`[${this.instanceId}] toggleOption called`, { value: t, multiple: this.options.isMultipleEnabled }), !this.options.isMultipleEnabled) {
|
|
1421
|
-
this.selectedValues.has(
|
|
1437
|
+
this.selectedValues.has(l) ? (f.debug(`[${this.instanceId}] Deselecting option in single-select mode`, { value: t }), this.deselectOption(e)) : (f.debug(`[${this.instanceId}] Clearing previous selections and selecting new option`, { value: t }), this.selectedValues.clear(), this.selectedOptions.clear(), this.selectOption(e)), f.info(`[${this.instanceId}] ❌ Closing dropdown (single-select mode)`), this.close();
|
|
1422
1438
|
return;
|
|
1423
1439
|
}
|
|
1424
|
-
this.selectedValues.has(
|
|
1440
|
+
this.selectedValues.has(l) ? (f.debug(`[${this.instanceId}] Deselecting option`, { value: t }), this.deselectOption(e)) : (f.debug(`[${this.instanceId}] Selecting option`, { value: t }), this.selectOption(e)), f.debug(`[${this.instanceId}] Checking closeOnSelect`, {
|
|
1425
1441
|
closeOnSelect: this.options.isCloseOnSelect,
|
|
1426
1442
|
willClose: this.options.isCloseOnSelect === !0,
|
|
1427
1443
|
placeholder: this.options.searchPlaceholder
|
|
@@ -1438,18 +1454,18 @@ class zt {
|
|
|
1438
1454
|
}
|
|
1439
1455
|
}
|
|
1440
1456
|
selectOption(e) {
|
|
1441
|
-
const t = this.getItemValue(e),
|
|
1442
|
-
this.selectedValues.add(
|
|
1457
|
+
const t = this.getItemValue(e), l = String(t);
|
|
1458
|
+
this.selectedValues.add(l), this.selectedOptions.set(l, e), this.renderDropdown(), this.renderPills(), this.updateHiddenInput(), this.options.selectCallback && this.options.selectCallback(e), this.options.changeCallback && this.options.changeCallback(this.getSelected());
|
|
1443
1459
|
}
|
|
1444
1460
|
deselectOption(e) {
|
|
1445
|
-
const t = this.getItemValue(e),
|
|
1446
|
-
this.selectedValues.delete(
|
|
1461
|
+
const t = this.getItemValue(e), l = String(t);
|
|
1462
|
+
this.selectedValues.delete(l), this.selectedOptions.delete(l), this.renderDropdown(), this.renderPills(), this.updateHiddenInput(), this.options.deselectCallback && this.options.deselectCallback(e), this.options.changeCallback && this.options.changeCallback(this.getSelected());
|
|
1447
1463
|
}
|
|
1448
1464
|
selectAll() {
|
|
1449
1465
|
this.filteredOptions.forEach((e) => {
|
|
1450
1466
|
if (!this.getItemDisabled(e)) {
|
|
1451
|
-
const t = this.getItemValue(e),
|
|
1452
|
-
this.selectedValues.add(
|
|
1467
|
+
const t = this.getItemValue(e), l = String(t);
|
|
1468
|
+
this.selectedValues.add(l), this.selectedOptions.set(l, e);
|
|
1453
1469
|
}
|
|
1454
1470
|
}), this.renderDropdown(), this.renderPills(), this.updateHiddenInput(), this.options.changeCallback && this.options.changeCallback(this.getSelected());
|
|
1455
1471
|
}
|
|
@@ -1483,11 +1499,11 @@ class zt {
|
|
|
1483
1499
|
ee(this.input, this.dropdown, {
|
|
1484
1500
|
placement: e,
|
|
1485
1501
|
middleware: t
|
|
1486
|
-
}).then(({ x:
|
|
1487
|
-
this.options.isPlacementLocked && !this.dropdownPlacement && (this.dropdownPlacement =
|
|
1502
|
+
}).then(({ x: l, y: o, placement: s }) => {
|
|
1503
|
+
this.options.isPlacementLocked && !this.dropdownPlacement && (this.dropdownPlacement = s, f.debug(`[${this.instanceId}] Locked dropdown placement:`, s));
|
|
1488
1504
|
const n = {
|
|
1489
|
-
left: `${
|
|
1490
|
-
top: `${
|
|
1505
|
+
left: `${l}px`,
|
|
1506
|
+
top: `${o}px`,
|
|
1491
1507
|
width: `${this.input.offsetWidth}px`
|
|
1492
1508
|
};
|
|
1493
1509
|
this.options.dropdownMinWidth && (n.minWidth = this.options.dropdownMinWidth), Object.assign(this.dropdown.style, n), this.hint && this.isOpen && this.positionHint();
|
|
@@ -1508,10 +1524,10 @@ class zt {
|
|
|
1508
1524
|
// Don't use flip() - we want hint to stay opposite of dropdown
|
|
1509
1525
|
Q({ padding: 8 })
|
|
1510
1526
|
]
|
|
1511
|
-
}).then(({ x: t, y:
|
|
1527
|
+
}).then(({ x: t, y: l }) => {
|
|
1512
1528
|
Object.assign(this.hint.style, {
|
|
1513
1529
|
left: `${t}px`,
|
|
1514
|
-
top: `${
|
|
1530
|
+
top: `${l}px`
|
|
1515
1531
|
});
|
|
1516
1532
|
});
|
|
1517
1533
|
}
|
|
@@ -1521,11 +1537,11 @@ class zt {
|
|
|
1521
1537
|
const e = this.element.dataset.initialValues;
|
|
1522
1538
|
if (e)
|
|
1523
1539
|
try {
|
|
1524
|
-
JSON.parse(e).forEach((
|
|
1525
|
-
const
|
|
1526
|
-
this.selectedValues.add(
|
|
1527
|
-
const
|
|
1528
|
-
|
|
1540
|
+
JSON.parse(e).forEach((l) => {
|
|
1541
|
+
const o = String(l);
|
|
1542
|
+
this.selectedValues.add(o);
|
|
1543
|
+
const s = this.allOptions.find((n) => String(this.getItemValue(n)) === o);
|
|
1544
|
+
s && this.selectedOptions.set(o, s);
|
|
1529
1545
|
}), this.renderPills();
|
|
1530
1546
|
} catch (t) {
|
|
1531
1547
|
console.error("[MultiSelect] Failed to parse initial values:", t);
|
|
@@ -1548,12 +1564,12 @@ class zt {
|
|
|
1548
1564
|
<button type="button" class="ml__selected-popover-close" aria-label="Close">×</button>
|
|
1549
1565
|
</div>
|
|
1550
1566
|
<div class="ml__selected-popover-body">
|
|
1551
|
-
${e.map((
|
|
1552
|
-
const
|
|
1567
|
+
${e.map((l) => {
|
|
1568
|
+
const o = this.getItemValue(l), s = this.getItemDisplayValue(l);
|
|
1553
1569
|
return `
|
|
1554
1570
|
<div class="ml__pill">
|
|
1555
|
-
<span class="ml__pill-text">${
|
|
1556
|
-
<button type="button" class="ml__pill-remove" data-value="${
|
|
1571
|
+
<span class="ml__pill-text">${s}</span>
|
|
1572
|
+
<button type="button" class="ml__pill-remove" data-value="${o}" aria-label="Remove ${s}"></button>
|
|
1557
1573
|
</div>
|
|
1558
1574
|
`;
|
|
1559
1575
|
}).join("")}
|
|
@@ -1565,11 +1581,11 @@ class zt {
|
|
|
1565
1581
|
e.preventDefault(), this.hideSelectedPopover();
|
|
1566
1582
|
return;
|
|
1567
1583
|
}
|
|
1568
|
-
const
|
|
1569
|
-
if (
|
|
1584
|
+
const l = e.target.closest(".ml__pill-remove");
|
|
1585
|
+
if (l) {
|
|
1570
1586
|
e.preventDefault();
|
|
1571
|
-
const
|
|
1572
|
-
|
|
1587
|
+
const o = l.dataset.value, s = this.selectedOptions.get(o);
|
|
1588
|
+
s && (this.deselectOption(s), this.renderSelectedPopover(), this.selectedValues.size === 0 && this.hideSelectedPopover());
|
|
1573
1589
|
}
|
|
1574
1590
|
}
|
|
1575
1591
|
positionSelectedPopover() {
|
|
@@ -1585,14 +1601,14 @@ class zt {
|
|
|
1585
1601
|
...this.selectedPopoverPlacement ? [] : [me()],
|
|
1586
1602
|
Q({ padding: 8 })
|
|
1587
1603
|
]
|
|
1588
|
-
}).then(({ x: t, y:
|
|
1589
|
-
this.selectedPopoverPlacement || (this.selectedPopoverPlacement =
|
|
1590
|
-
const
|
|
1604
|
+
}).then(({ x: t, y: l, placement: o }) => {
|
|
1605
|
+
this.selectedPopoverPlacement || (this.selectedPopoverPlacement = o, f.debug(`[${this.instanceId}] Locked popover placement:`, o));
|
|
1606
|
+
const s = {
|
|
1591
1607
|
left: `${t}px`,
|
|
1592
|
-
top: `${
|
|
1608
|
+
top: `${l}px`,
|
|
1593
1609
|
width: `${this.input.offsetWidth}px`
|
|
1594
1610
|
};
|
|
1595
|
-
this.options.dropdownMinWidth && (
|
|
1611
|
+
this.options.dropdownMinWidth && (s.minWidth = this.options.dropdownMinWidth), Object.assign(this.selectedPopover.style, s);
|
|
1596
1612
|
});
|
|
1597
1613
|
}
|
|
1598
1614
|
);
|
|
@@ -1602,20 +1618,20 @@ class zt {
|
|
|
1602
1618
|
// ========================================================================
|
|
1603
1619
|
updateHiddenInput() {
|
|
1604
1620
|
if (!this.options.formFieldId) return;
|
|
1605
|
-
this.hiddenInputs.forEach((
|
|
1606
|
-
const e = this.options.valueFormat || "json", t = Array.from(this.selectedOptions.values()).map((
|
|
1621
|
+
this.hiddenInputs.forEach((o) => o.remove()), this.hiddenInputs = [];
|
|
1622
|
+
const e = this.options.valueFormat || "json", t = Array.from(this.selectedOptions.values()).map((o) => this.getItemValue(o)), l = this.options.hostElement || this.element;
|
|
1607
1623
|
if (e === "array")
|
|
1608
|
-
t.forEach((
|
|
1609
|
-
const
|
|
1610
|
-
|
|
1624
|
+
t.forEach((o) => {
|
|
1625
|
+
const s = document.createElement("input");
|
|
1626
|
+
s.type = "hidden", s.name = `${this.options.formFieldId}[]`, s.value = String(o), l.appendChild(s), this.hiddenInputs.push(s);
|
|
1611
1627
|
});
|
|
1612
1628
|
else {
|
|
1613
|
-
const
|
|
1614
|
-
|
|
1629
|
+
const o = document.createElement("input");
|
|
1630
|
+
o.type = "hidden", o.name = this.options.formFieldId, o.id = this.options.formFieldId, o.value = this.getFormValue(), l.appendChild(o), this.hiddenInputs.push(o);
|
|
1615
1631
|
}
|
|
1616
1632
|
}
|
|
1617
1633
|
getFormValue() {
|
|
1618
|
-
const e = Array.from(this.selectedOptions.values()).map((
|
|
1634
|
+
const e = Array.from(this.selectedOptions.values()).map((l) => this.getItemValue(l));
|
|
1619
1635
|
return this.options.getValueFormatCallback ? this.options.getValueFormatCallback(e) : (this.options.valueFormat || "json") === "csv" ? e.join(",") : JSON.stringify(e);
|
|
1620
1636
|
}
|
|
1621
1637
|
// ========================================================================
|
|
@@ -1626,8 +1642,8 @@ class zt {
|
|
|
1626
1642
|
}
|
|
1627
1643
|
setSelected(e) {
|
|
1628
1644
|
this.selectedValues = new Set(e.map((t) => String(t))), this.selectedOptions.clear(), e.forEach((t) => {
|
|
1629
|
-
const
|
|
1630
|
-
|
|
1645
|
+
const l = String(t), o = this.allOptions.find((s) => String(this.getItemValue(s)) === l);
|
|
1646
|
+
o && this.selectedOptions.set(l, o);
|
|
1631
1647
|
}), this.renderDropdown(), this.renderPills(), this.updateHiddenInput();
|
|
1632
1648
|
}
|
|
1633
1649
|
get selectedItem() {
|
|
@@ -1656,70 +1672,70 @@ class zt {
|
|
|
1656
1672
|
return;
|
|
1657
1673
|
}
|
|
1658
1674
|
const e = this.pillsContainer.querySelectorAll(".ml__pill:not(.ml__pill--more)");
|
|
1659
|
-
console.log(`[Tooltips] Found ${e.length} pills to attach tooltips to`), e.forEach((
|
|
1660
|
-
const
|
|
1661
|
-
if (!
|
|
1662
|
-
const n =
|
|
1675
|
+
console.log(`[Tooltips] Found ${e.length} pills to attach tooltips to`), e.forEach((l) => {
|
|
1676
|
+
const o = l, s = o.querySelector(".ml__pill-remove");
|
|
1677
|
+
if (!s) return;
|
|
1678
|
+
const n = s.dataset.value, r = this.selectedOptions.get(n);
|
|
1663
1679
|
if (!r) return;
|
|
1664
|
-
const a =
|
|
1680
|
+
const a = o.querySelector(".ml__pill-text");
|
|
1665
1681
|
a && this.createTooltipForElement(a, r, n);
|
|
1666
1682
|
const c = this.getItemDisplayValue(r);
|
|
1667
|
-
this.createRemoveButtonTooltip(
|
|
1683
|
+
this.createRemoveButtonTooltip(s, c, n);
|
|
1668
1684
|
});
|
|
1669
1685
|
const t = this.pillsContainer.querySelector(".ml__pill--more");
|
|
1670
1686
|
if (t) {
|
|
1671
|
-
const
|
|
1672
|
-
if (
|
|
1673
|
-
const
|
|
1674
|
-
this.createRemoveButtonTooltip(
|
|
1687
|
+
const l = t.querySelector(".ml__pill-remove");
|
|
1688
|
+
if (l && l.dataset.action === "remove-hidden") {
|
|
1689
|
+
const o = this.options.pillsMaxVisible || 3, n = Array.from(this.selectedOptions.values()).length - o;
|
|
1690
|
+
this.createRemoveButtonTooltip(l, `${n} hidden items`, "more-badge-remove");
|
|
1675
1691
|
}
|
|
1676
1692
|
}
|
|
1677
1693
|
}
|
|
1678
|
-
createTooltipForElement(e, t,
|
|
1679
|
-
const
|
|
1680
|
-
|
|
1681
|
-
let
|
|
1694
|
+
createTooltipForElement(e, t, l) {
|
|
1695
|
+
const o = document.createElement("div");
|
|
1696
|
+
o.className = "ml__pill-tooltip";
|
|
1697
|
+
let s;
|
|
1682
1698
|
if (this.options.getPillTooltipCallback)
|
|
1683
|
-
|
|
1699
|
+
s = this.options.getPillTooltipCallback(t), console.log("[Tooltips] Using custom callback for tooltip content");
|
|
1684
1700
|
else {
|
|
1685
1701
|
const d = this.getItemDisplayValue(t), m = this.getItemSubtitle(t);
|
|
1686
|
-
|
|
1687
|
-
${m}` : d, console.log(`[Tooltips] Using default content: "${
|
|
1702
|
+
s = m ? `${d}
|
|
1703
|
+
${m}` : d, console.log(`[Tooltips] Using default content: "${s}"`);
|
|
1688
1704
|
}
|
|
1689
|
-
typeof
|
|
1705
|
+
typeof s == "string" ? o.textContent = s : o.appendChild(s), (this.options.container || document.body).appendChild(o), console.log(`[Tooltips] Tooltip element created and appended for "${l}"`), this.pillTooltips.set(l, o);
|
|
1690
1706
|
let r, a;
|
|
1691
1707
|
const c = () => {
|
|
1692
|
-
clearTimeout(a), console.log(`[Tooltips] Mouse entered pill "${
|
|
1693
|
-
console.log(`[Tooltips] Showing tooltip for "${
|
|
1708
|
+
clearTimeout(a), console.log(`[Tooltips] Mouse entered pill "${l}", will show tooltip in ${this.options.pillTooltipDelay || 300}ms`), r = window.setTimeout(() => {
|
|
1709
|
+
console.log(`[Tooltips] Showing tooltip for "${l}"`), o.classList.add("ml__pill-tooltip--visible"), this.positionPillTooltip(e, o, l);
|
|
1694
1710
|
}, this.options.pillTooltipDelay || 300);
|
|
1695
1711
|
}, p = () => {
|
|
1696
1712
|
clearTimeout(r), a = window.setTimeout(() => {
|
|
1697
|
-
|
|
1713
|
+
o.classList.remove("ml__pill-tooltip--visible"), this.cleanupPillTooltip(l);
|
|
1698
1714
|
}, 100);
|
|
1699
1715
|
};
|
|
1700
1716
|
e.addEventListener("mouseenter", c), e.addEventListener("mouseleave", p);
|
|
1701
1717
|
}
|
|
1702
|
-
createRemoveButtonTooltip(e, t,
|
|
1703
|
-
const
|
|
1704
|
-
|
|
1705
|
-
const n = `${
|
|
1706
|
-
this.pillTooltips.set(n,
|
|
1718
|
+
createRemoveButtonTooltip(e, t, l) {
|
|
1719
|
+
const o = document.createElement("div");
|
|
1720
|
+
o.className = "ml__pill-tooltip", o.textContent = `Remove ${t}`, (this.options.container || document.body).appendChild(o);
|
|
1721
|
+
const n = `${l}-remove`;
|
|
1722
|
+
this.pillTooltips.set(n, o);
|
|
1707
1723
|
let r, a;
|
|
1708
1724
|
const c = () => {
|
|
1709
1725
|
clearTimeout(a);
|
|
1710
|
-
const d = this.pillTooltips.get(
|
|
1726
|
+
const d = this.pillTooltips.get(l);
|
|
1711
1727
|
d && d.classList.remove("ml__pill-tooltip--visible"), r = window.setTimeout(() => {
|
|
1712
|
-
|
|
1728
|
+
o.classList.add("ml__pill-tooltip--visible"), this.positionPillTooltip(e, o, n);
|
|
1713
1729
|
}, this.options.pillTooltipDelay || 300);
|
|
1714
1730
|
}, p = () => {
|
|
1715
1731
|
clearTimeout(r), a = window.setTimeout(() => {
|
|
1716
|
-
|
|
1732
|
+
o.classList.remove("ml__pill-tooltip--visible"), this.cleanupPillTooltip(n);
|
|
1717
1733
|
}, 100);
|
|
1718
1734
|
};
|
|
1719
1735
|
e.addEventListener("mouseenter", c), e.addEventListener("mouseleave", p);
|
|
1720
1736
|
}
|
|
1721
|
-
positionPillTooltip(e, t,
|
|
1722
|
-
const
|
|
1737
|
+
positionPillTooltip(e, t, l) {
|
|
1738
|
+
const o = q(e, t, () => {
|
|
1723
1739
|
ee(e, t, {
|
|
1724
1740
|
placement: this.options.pillTooltipPlacement || "top",
|
|
1725
1741
|
strategy: "fixed",
|
|
@@ -1728,11 +1744,11 @@ ${m}` : d, console.log(`[Tooltips] Using default content: "${l}"`);
|
|
|
1728
1744
|
me(),
|
|
1729
1745
|
Q({ padding: 8 })
|
|
1730
1746
|
]
|
|
1731
|
-
}).then(({ x:
|
|
1747
|
+
}).then(({ x: s, y: n }) => {
|
|
1732
1748
|
Object.assign(t.style, {
|
|
1733
|
-
left: `${
|
|
1749
|
+
left: `${s}px`,
|
|
1734
1750
|
top: `${n}px`
|
|
1735
|
-
}), console.log(`[Tooltips] Positioned tooltip "${
|
|
1751
|
+
}), console.log(`[Tooltips] Positioned tooltip "${l}" at x:${s}, y:${n}`, {
|
|
1736
1752
|
placement: this.options.pillTooltipPlacement || "top",
|
|
1737
1753
|
tooltipClasses: t.className,
|
|
1738
1754
|
tooltipDisplay: window.getComputedStyle(t).display,
|
|
@@ -1743,7 +1759,7 @@ ${m}` : d, console.log(`[Tooltips] Using default content: "${l}"`);
|
|
|
1743
1759
|
});
|
|
1744
1760
|
});
|
|
1745
1761
|
});
|
|
1746
|
-
this.pillTooltipCleanups.set(
|
|
1762
|
+
this.pillTooltipCleanups.set(l, o);
|
|
1747
1763
|
}
|
|
1748
1764
|
cleanupPillTooltip(e) {
|
|
1749
1765
|
const t = this.pillTooltipCleanups.get(e);
|
|
@@ -1759,49 +1775,49 @@ ${m}` : d, console.log(`[Tooltips] Using default content: "${l}"`);
|
|
|
1759
1775
|
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"), console.log("[MultiSelect] Destroyed");
|
|
1760
1776
|
}
|
|
1761
1777
|
}
|
|
1762
|
-
const Nt = '@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);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, .5rem);justify-content:flex-start}.ml__pills--right{margin-left:var(--ml-pills-margin-right, .5rem);justify-content:flex-end}.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--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}', Rt = typeof HTMLElement < "u" ? HTMLElement : class {
|
|
1778
|
+
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 {
|
|
1763
1779
|
}, be = /* @__PURE__ */ new Set();
|
|
1764
1780
|
function je() {
|
|
1765
1781
|
return Array.from(be);
|
|
1766
1782
|
}
|
|
1767
|
-
class Ge extends
|
|
1783
|
+
class Ge extends Nt {
|
|
1768
1784
|
constructor() {
|
|
1769
1785
|
super();
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1786
|
+
h(this, "picker");
|
|
1787
|
+
h(this, "containerElement");
|
|
1788
|
+
h(this, "shadow");
|
|
1773
1789
|
// Properties for complex data (not attributes)
|
|
1774
|
-
|
|
1790
|
+
h(this, "_options");
|
|
1775
1791
|
// Member/Callback properties
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1792
|
+
h(this, "_valueMember");
|
|
1793
|
+
h(this, "_getValueCallback");
|
|
1794
|
+
h(this, "_displayValueMember");
|
|
1795
|
+
h(this, "_getDisplayValueCallback");
|
|
1796
|
+
h(this, "_searchValueMember");
|
|
1797
|
+
h(this, "_getSearchValueCallback");
|
|
1798
|
+
h(this, "_iconMember");
|
|
1799
|
+
h(this, "_getIconCallback");
|
|
1800
|
+
h(this, "_subtitleMember");
|
|
1801
|
+
h(this, "_getSubtitleCallback");
|
|
1802
|
+
h(this, "_groupMember");
|
|
1803
|
+
h(this, "_getGroupCallback");
|
|
1804
|
+
h(this, "_disabledMember");
|
|
1805
|
+
h(this, "_getDisabledCallback");
|
|
1790
1806
|
// Value formatting callbacks
|
|
1791
|
-
|
|
1807
|
+
h(this, "_getValueFormatCallback");
|
|
1792
1808
|
// Tooltip callbacks
|
|
1793
|
-
|
|
1809
|
+
h(this, "_getPillTooltipCallback");
|
|
1794
1810
|
// Count pill callback
|
|
1795
|
-
|
|
1811
|
+
h(this, "_getCountPillCallback");
|
|
1796
1812
|
// Event callbacks
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1813
|
+
h(this, "_searchCallback");
|
|
1814
|
+
h(this, "_addNewCallback");
|
|
1815
|
+
h(this, "_selectCallback");
|
|
1816
|
+
h(this, "_deselectCallback");
|
|
1817
|
+
h(this, "_changeCallback");
|
|
1802
1818
|
this.shadow = this.attachShadow({ mode: "open" });
|
|
1803
1819
|
const t = document.createElement("style");
|
|
1804
|
-
t.textContent =
|
|
1820
|
+
t.textContent = Rt, this.shadow.appendChild(t), requestAnimationFrame(() => {
|
|
1805
1821
|
this.setAttribute("data-ready", "");
|
|
1806
1822
|
});
|
|
1807
1823
|
}
|
|
@@ -1857,8 +1873,8 @@ class Ge extends Rt {
|
|
|
1857
1873
|
disconnectedCallback() {
|
|
1858
1874
|
be.delete(this), this.picker && this.picker.destroy();
|
|
1859
1875
|
}
|
|
1860
|
-
attributeChangedCallback(t,
|
|
1861
|
-
|
|
1876
|
+
attributeChangedCallback(t, l, o) {
|
|
1877
|
+
l !== o && this.picker && t !== "initial-values" && (this.picker.destroy(), this.initializePicker());
|
|
1862
1878
|
}
|
|
1863
1879
|
render() {
|
|
1864
1880
|
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();
|
|
@@ -1866,21 +1882,21 @@ class Ge extends Rt {
|
|
|
1866
1882
|
renderDebugInfo() {
|
|
1867
1883
|
const t = this.shadow.querySelector(".ml-debug-info");
|
|
1868
1884
|
t && t.remove();
|
|
1869
|
-
const
|
|
1870
|
-
|
|
1871
|
-
const
|
|
1872
|
-
|
|
1885
|
+
const l = document.createElement("div");
|
|
1886
|
+
l.className = "ml-debug-info";
|
|
1887
|
+
const o = document.createElement("details"), s = document.createElement("summary");
|
|
1888
|
+
s.textContent = "Debug Info";
|
|
1873
1889
|
const n = document.createElement("div");
|
|
1874
|
-
n.className = "ml-debug-stats",
|
|
1890
|
+
n.className = "ml-debug-stats", o.appendChild(s), o.appendChild(n), l.appendChild(o), this.shadow.appendChild(l), this.updateDebugInfo();
|
|
1875
1891
|
}
|
|
1876
1892
|
updateDebugInfo() {
|
|
1877
|
-
var
|
|
1893
|
+
var u, g;
|
|
1878
1894
|
const t = this.shadow.querySelector(".ml-debug-stats");
|
|
1879
1895
|
if (!t || !this.picker) return;
|
|
1880
|
-
const
|
|
1896
|
+
const l = "1.0.0-rc04", o = je().length, n = this.picker.getSelected().length, r = ((u = this._options) == null ? void 0 : u.length) || 0, a = this.picker, c = a.isOpen || !1, p = a.searchTerm || "", d = a.isLoading || !1, m = ((g = a.filteredOptions) == null ? void 0 : g.length) || 0;
|
|
1881
1897
|
t.innerHTML = `
|
|
1882
|
-
<span>Version: ${
|
|
1883
|
-
<span>Total Instances: ${
|
|
1898
|
+
<span>Version: ${l}</span>
|
|
1899
|
+
<span>Total Instances: ${o}</span>
|
|
1884
1900
|
<span>Options: ${r}</span>
|
|
1885
1901
|
<span>Filtered: ${m}</span>
|
|
1886
1902
|
<span>Selected: ${n}</span>
|
|
@@ -1894,14 +1910,14 @@ class Ge extends Rt {
|
|
|
1894
1910
|
initializePicker() {
|
|
1895
1911
|
if (!this.containerElement) return;
|
|
1896
1912
|
let t;
|
|
1897
|
-
const
|
|
1898
|
-
if (
|
|
1913
|
+
const l = this.getAttribute("initial-values");
|
|
1914
|
+
if (l)
|
|
1899
1915
|
try {
|
|
1900
|
-
t = JSON.parse(
|
|
1901
|
-
} catch (
|
|
1902
|
-
console.error("[MultiSelectElement] Failed to parse initial-values:",
|
|
1916
|
+
t = JSON.parse(l);
|
|
1917
|
+
} catch (s) {
|
|
1918
|
+
console.error("[MultiSelectElement] Failed to parse initial-values:", s);
|
|
1903
1919
|
}
|
|
1904
|
-
const
|
|
1920
|
+
const o = {
|
|
1905
1921
|
// String options
|
|
1906
1922
|
searchHint: this.getAttribute("search-hint") || void 0,
|
|
1907
1923
|
searchPlaceholder: this.getAttribute("search-placeholder") || "Search...",
|
|
@@ -1956,36 +1972,36 @@ class Ge extends Rt {
|
|
|
1956
1972
|
pillTooltipDelay: parseInt(this.getAttribute("pill-tooltip-delay") || "300"),
|
|
1957
1973
|
pillTooltipOffset: parseInt(this.getAttribute("pill-tooltip-offset") || "8"),
|
|
1958
1974
|
// Count pill callback
|
|
1959
|
-
getCountPillCallback: this._getCountPillCallback || ((
|
|
1975
|
+
getCountPillCallback: this._getCountPillCallback || ((s, n) => n !== void 0 ? `+${n} more` : `${s} selected`),
|
|
1960
1976
|
// Data and callbacks
|
|
1961
1977
|
options: this._options,
|
|
1962
1978
|
searchCallback: this._searchCallback,
|
|
1963
1979
|
addNewCallback: this._addNewCallback,
|
|
1964
|
-
selectCallback: (
|
|
1980
|
+
selectCallback: (s) => {
|
|
1965
1981
|
var n, r;
|
|
1966
|
-
this._selectCallback && this._selectCallback(
|
|
1982
|
+
this._selectCallback && this._selectCallback(s), this.dispatchEvent(new CustomEvent("select", {
|
|
1967
1983
|
detail: {
|
|
1968
|
-
option:
|
|
1984
|
+
option: s,
|
|
1969
1985
|
selectedOptions: (n = this.picker) == null ? void 0 : n.getSelected(),
|
|
1970
1986
|
selectedValues: Array.from(((r = this.picker) == null ? void 0 : r.getValue()) || [])
|
|
1971
1987
|
}
|
|
1972
1988
|
}));
|
|
1973
1989
|
},
|
|
1974
|
-
deselectCallback: (
|
|
1990
|
+
deselectCallback: (s) => {
|
|
1975
1991
|
var n, r;
|
|
1976
|
-
this._deselectCallback && this._deselectCallback(
|
|
1992
|
+
this._deselectCallback && this._deselectCallback(s), this.dispatchEvent(new CustomEvent("deselect", {
|
|
1977
1993
|
detail: {
|
|
1978
|
-
option:
|
|
1994
|
+
option: s,
|
|
1979
1995
|
selectedOptions: (n = this.picker) == null ? void 0 : n.getSelected(),
|
|
1980
1996
|
selectedValues: Array.from(((r = this.picker) == null ? void 0 : r.getValue()) || [])
|
|
1981
1997
|
}
|
|
1982
1998
|
}));
|
|
1983
1999
|
},
|
|
1984
|
-
changeCallback: (
|
|
2000
|
+
changeCallback: (s) => {
|
|
1985
2001
|
var n;
|
|
1986
|
-
this._changeCallback && this._changeCallback(
|
|
2002
|
+
this._changeCallback && this._changeCallback(s), this.dispatchEvent(new CustomEvent("change", {
|
|
1987
2003
|
detail: {
|
|
1988
|
-
selectedOptions:
|
|
2004
|
+
selectedOptions: s,
|
|
1989
2005
|
selectedValues: Array.from(((n = this.picker) == null ? void 0 : n.getValue()) || [])
|
|
1990
2006
|
}
|
|
1991
2007
|
}));
|
|
@@ -1995,7 +2011,7 @@ class Ge extends Rt {
|
|
|
1995
2011
|
// Pass host element (this) for hidden inputs in light DOM
|
|
1996
2012
|
hostElement: this
|
|
1997
2013
|
};
|
|
1998
|
-
t && (this.containerElement.dataset.initialValues = JSON.stringify(t)), this.picker = new zt(this.containerElement,
|
|
2014
|
+
t && (this.containerElement.dataset.initialValues = JSON.stringify(t)), this.picker = new zt(this.containerElement, o);
|
|
1999
2015
|
}
|
|
2000
2016
|
reinitialize() {
|
|
2001
2017
|
this.picker && (this.picker.destroy(), this.initializePicker());
|
|
@@ -2212,10 +2228,10 @@ class Ge extends Rt {
|
|
|
2212
2228
|
}
|
|
2213
2229
|
typeof window < "u" && typeof customElements < "u" && (customElements.get("multi-select") || customElements.define("multi-select", Ge));
|
|
2214
2230
|
typeof window < "u" && (window.keenmate = window.keenmate || {}, window.keenmate.multiselect = {
|
|
2215
|
-
version: () => "1.0.0-
|
|
2231
|
+
version: () => "1.0.0-rc04",
|
|
2216
2232
|
config: {
|
|
2217
2233
|
name: "@keenmate/web-multiselect",
|
|
2218
|
-
version: "1.0.0-
|
|
2234
|
+
version: "1.0.0-rc04",
|
|
2219
2235
|
author: "Keenmate",
|
|
2220
2236
|
license: "MIT",
|
|
2221
2237
|
repository: "git+https://github.com/keenmate/web-multiselect.git",
|