@keenmate/web-multiselect 1.0.0-rc03 → 1.0.0-rc05
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +357 -8
- package/dist/multiselect.js +548 -516
- 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
|
|
54
|
+
const Pe = ["left", "right"], Ae = ["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 ? Ae : Pe : e ? Pe : Ae;
|
|
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,53 +278,53 @@ 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
|
-
B.every((
|
|
304
|
+
B.every((P) => V(P.placement) === _ ? P.overflows[0] > 0 : !0)))
|
|
305
305
|
return {
|
|
306
306
|
data: {
|
|
307
|
-
index:
|
|
307
|
+
index: $,
|
|
308
308
|
overflows: B
|
|
309
309
|
},
|
|
310
310
|
reset: {
|
|
311
311
|
placement: he
|
|
312
312
|
}
|
|
313
313
|
};
|
|
314
|
-
let K = (xe = B.filter((L) => L.overflows[0] <= 0).sort((L,
|
|
314
|
+
let K = (xe = B.filter((L) => L.overflows[0] <= 0).sort((L, P) => L.overflows[1] - P.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
|
-
const L = (Ce = B.filter((
|
|
319
|
+
const L = (Ce = B.filter((P) => {
|
|
320
320
|
if (G) {
|
|
321
|
-
const M = V(
|
|
321
|
+
const M = V(P.placement);
|
|
322
322
|
return M === _ || // Create a bias to the `y` side axis due to horizontal
|
|
323
323
|
// reading directions favoring greater width.
|
|
324
324
|
M === "y";
|
|
325
325
|
}
|
|
326
326
|
return !0;
|
|
327
|
-
}).map((
|
|
327
|
+
}).map((P) => [P.placement, P.overflows.filter((M) => M > 0).reduce((M, Ke) => M + Ke, 0)]).sort((P, M) => P[1] - M[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
|
}
|
|
@@ -466,13 +466,13 @@ function I(i) {
|
|
|
466
466
|
function Le(i) {
|
|
467
467
|
return re() ? i instanceof Node || i instanceof k(i).Node : !1;
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function A(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 = A(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 A(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
|
-
|
|
544
|
+
Oe(i) && i.host || // Fallback.
|
|
545
545
|
I(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 A(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 ? A(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 && A(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(I(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 = I(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,
|
|
@@ -665,41 +665,41 @@ function Ct(i) {
|
|
|
665
665
|
function kt(i) {
|
|
666
666
|
return Array.from(i.getClientRects());
|
|
667
667
|
}
|
|
668
|
-
function
|
|
669
|
-
const e = I(i), t = ce(i),
|
|
668
|
+
function Pt(i) {
|
|
669
|
+
const e = I(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 At(i, e) {
|
|
681
|
+
const t = k(i), l = I(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,
|
|
@@ -708,52 +708,52 @@ function Pt(i, e) {
|
|
|
708
708
|
};
|
|
709
709
|
}
|
|
710
710
|
function Ie(i, e, t) {
|
|
711
|
-
let
|
|
711
|
+
let l;
|
|
712
712
|
if (e === "viewport")
|
|
713
|
-
|
|
713
|
+
l = At(i, t);
|
|
714
714
|
else if (e === "document")
|
|
715
|
-
|
|
716
|
-
else if (
|
|
717
|
-
|
|
715
|
+
l = Pt(I(i));
|
|
716
|
+
else if (A(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 || !A(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) => A(r) && j(r) !== "body"), o = null;
|
|
738
|
+
const s = S(i).position === "fixed";
|
|
739
|
+
let n = s ? D(i) : i;
|
|
740
|
+
for (; A(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
746
|
function It(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 = Ie(e, p,
|
|
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 = Ie(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
|
-
}, Ie(e, r,
|
|
756
|
+
}, Ie(e, r, o));
|
|
757
757
|
return {
|
|
758
758
|
width: a.right - a.left,
|
|
759
759
|
height: a.bottom - a.top,
|
|
@@ -765,29 +765,29 @@ function Mt(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 = I(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,10 +796,10 @@ 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
801
|
function Me(i, e) {
|
|
802
|
-
if (!T(i) ||
|
|
802
|
+
if (!T(i) || S(i).position === "fixed")
|
|
803
803
|
return null;
|
|
804
804
|
if (e)
|
|
805
805
|
return e(i);
|
|
@@ -811,35 +811,35 @@ function He(i, e) {
|
|
|
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 (A(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 = Me(i, e);
|
|
823
|
+
for (; l && mt(l) && ue(l); )
|
|
824
|
+
l = Me(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
844
|
getDocumentElement: I,
|
|
845
845
|
getClippingRect: It,
|
|
@@ -848,30 +848,30 @@ const Dt = {
|
|
|
848
848
|
getClientRects: kt,
|
|
849
849
|
getDimensions: Mt,
|
|
850
850
|
getScale: H,
|
|
851
|
-
isElement:
|
|
852
|
-
isRTL:
|
|
851
|
+
isElement: A,
|
|
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 = I(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 || "",
|
|
@@ -1066,6 +1069,14 @@ class zt {
|
|
|
1066
1069
|
getItemDisplayValue(e) {
|
|
1067
1070
|
return Array.isArray(e) && e.length === 2 ? String(e[1]) : this.options.displayValueMember && e[this.options.displayValueMember] !== void 0 ? String(e[this.options.displayValueMember]) : this.options.getDisplayValueCallback ? this.options.getDisplayValueCallback(e) : "[N/A]";
|
|
1068
1071
|
}
|
|
1072
|
+
/**
|
|
1073
|
+
* Extract pill display value from item
|
|
1074
|
+
* Precedence: getPillDisplayCallback -> getItemDisplayValue()
|
|
1075
|
+
* This allows customizing pill text separately from dropdown display text
|
|
1076
|
+
*/
|
|
1077
|
+
getItemPillDisplayValue(e) {
|
|
1078
|
+
return this.options.getPillDisplayCallback ? this.options.getPillDisplayCallback(e) : this.getItemDisplayValue(e);
|
|
1079
|
+
}
|
|
1069
1080
|
/**
|
|
1070
1081
|
* Extract search value from item
|
|
1071
1082
|
* Precedence: searchValueMember -> getSearchValueCallback -> displayValue
|
|
@@ -1134,12 +1145,21 @@ class zt {
|
|
|
1134
1145
|
this.filteredOptions = [...this.allOptions];
|
|
1135
1146
|
}
|
|
1136
1147
|
buildHTML() {
|
|
1137
|
-
const e = this.options.container || document.body;
|
|
1138
|
-
this.
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1148
|
+
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;
|
|
1149
|
+
this.isRTL = o || s, console.log("[MultiSelect RTL Debug]", {
|
|
1150
|
+
isShadowRoot: t instanceof ShadowRoot,
|
|
1151
|
+
hostElement: l,
|
|
1152
|
+
elementDir: l.getAttribute("dir"),
|
|
1153
|
+
hasElementDir: o,
|
|
1154
|
+
hasAncestorDir: s,
|
|
1155
|
+
isRTL: this.isRTL
|
|
1156
|
+
}), this.effectivePillsPosition = this.options.pillsPosition || "bottom", this.isRTL && (this.effectivePillsPosition === "left" ? this.effectivePillsPosition = "right" : this.effectivePillsPosition === "right" && (this.effectivePillsPosition = "left")), this.element.classList.add("ml"), this.isRTL && (this.element.classList.add("ml--rtl"), console.log("[MultiSelect RTL] Added ml--rtl class to element")), (!this.options.isCheckboxesShown || !this.options.isMultipleEnabled) && this.element.classList.add("ml--no-checkboxes");
|
|
1157
|
+
const n = document.createElement("div");
|
|
1158
|
+
n.className = "ml__input-wrapper", this.input = document.createElement("input"), this.input.type = "text", this.input.className = "ml__input", this.input.placeholder = this.options.searchPlaceholder, this.input.autocomplete = "off", this.options.searchInputMode === "readonly" ? this.input.readOnly = !0 : this.options.searchInputMode === "hidden" && (this.input.style.display = "none");
|
|
1159
|
+
const r = document.createElement("span");
|
|
1160
|
+
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";
|
|
1161
|
+
const a = document.createElement("div");
|
|
1162
|
+
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
1163
|
}
|
|
1144
1164
|
renderDropdown() {
|
|
1145
1165
|
let e = "";
|
|
@@ -1155,33 +1175,33 @@ class zt {
|
|
|
1155
1175
|
e += `<div class="ml__empty">${this.options.emptyMessage}</div>`;
|
|
1156
1176
|
else if (this.options.isGroupsAllowed) {
|
|
1157
1177
|
const t = this.groupOptions(this.filteredOptions);
|
|
1158
|
-
Object.keys(t).forEach((
|
|
1159
|
-
e += '<div class="ml__group">',
|
|
1160
|
-
e += this.renderOption(
|
|
1178
|
+
Object.keys(t).forEach((l) => {
|
|
1179
|
+
e += '<div class="ml__group">', l !== "__ungrouped__" && (e += `<div class="ml__group-label">${l}</div>`), t[l].forEach((o, s) => {
|
|
1180
|
+
e += this.renderOption(o, s);
|
|
1161
1181
|
}), e += "</div>";
|
|
1162
1182
|
});
|
|
1163
1183
|
} else
|
|
1164
|
-
this.filteredOptions.forEach((t,
|
|
1165
|
-
e += this.renderOption(t,
|
|
1184
|
+
this.filteredOptions.forEach((t, l) => {
|
|
1185
|
+
e += this.renderOption(t, l);
|
|
1166
1186
|
});
|
|
1167
1187
|
e += "</div>", this.dropdown.innerHTML = e;
|
|
1168
1188
|
}
|
|
1169
1189
|
renderOption(e, t) {
|
|
1170
|
-
const
|
|
1190
|
+
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
1191
|
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">',
|
|
1192
|
+
let d = `<div class="${p.join(" ")}" data-value="${l}" data-index="${t}">`;
|
|
1193
|
+
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
1194
|
}
|
|
1175
1195
|
highlightMatch(e, t) {
|
|
1176
1196
|
if (!t) return e;
|
|
1177
|
-
const
|
|
1178
|
-
return e.replace(
|
|
1197
|
+
const l = new RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})`, "gi");
|
|
1198
|
+
return e.replace(l, "<mark>$1</mark>");
|
|
1179
1199
|
}
|
|
1180
1200
|
groupOptions(e) {
|
|
1181
1201
|
const t = {};
|
|
1182
|
-
return e.forEach((
|
|
1183
|
-
const
|
|
1184
|
-
t[
|
|
1202
|
+
return e.forEach((l) => {
|
|
1203
|
+
const o = this.getItemGroup(l) || "__ungrouped__";
|
|
1204
|
+
t[o] || (t[o] = []), t[o].push(l);
|
|
1185
1205
|
}), t;
|
|
1186
1206
|
}
|
|
1187
1207
|
renderPills() {
|
|
@@ -1189,26 +1209,26 @@ class zt {
|
|
|
1189
1209
|
const e = Array.from(this.selectedOptions.values()), t = this.selectedValues.size;
|
|
1190
1210
|
if (!this.options.isMultipleEnabled) {
|
|
1191
1211
|
this.pillsContainer.innerHTML = "", this.countBadge.style.display = "none";
|
|
1192
|
-
const
|
|
1212
|
+
const s = e[0] ? this.getItemDisplayValue(e[0]) : void 0;
|
|
1193
1213
|
f.warn(`[${this.instanceId}] renderPills() single-select mode`, {
|
|
1194
1214
|
isOpen: this.isOpen,
|
|
1195
1215
|
count: t,
|
|
1196
1216
|
selectedOptionsLength: e.length,
|
|
1197
1217
|
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 = "${
|
|
1218
|
+
selectedLabel: s
|
|
1219
|
+
}), !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
1220
|
return;
|
|
1201
1221
|
}
|
|
1202
|
-
let
|
|
1203
|
-
if (this.options.pillsThreshold !== null && t > this.options.pillsThreshold && (
|
|
1204
|
-
if (t > 0 &&
|
|
1205
|
-
const
|
|
1206
|
-
this.input.placeholder =
|
|
1222
|
+
let l = this.options.pillsDisplayMode;
|
|
1223
|
+
if (this.options.pillsThreshold !== null && t > this.options.pillsThreshold && (l = this.options.pillsThresholdMode || "count"), !this.isOpen)
|
|
1224
|
+
if (t > 0 && l === "count") {
|
|
1225
|
+
const s = this.options.getCountPillCallback ? this.options.getCountPillCallback(t) : `${t} selected`;
|
|
1226
|
+
this.input.placeholder = s;
|
|
1207
1227
|
} else
|
|
1208
1228
|
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(
|
|
1229
|
+
if (this.options.isCountBadgeShown && t > 0 ? (this.countBadge.textContent = `[${t}]`, this.countBadge.style.display = "") : this.countBadge.style.display = "none", l === "pills")
|
|
1230
|
+
this.pillsContainer.className = `ml__pills ml__pills--${this.effectivePillsPosition}`, this.pillsContainer.innerHTML = e.map((s) => {
|
|
1231
|
+
const n = this.getItemValue(s), r = this.getItemPillDisplayValue(s);
|
|
1212
1232
|
return `
|
|
1213
1233
|
<div class="ml__pill">
|
|
1214
1234
|
<span class="ml__pill-text">${r}</span>
|
|
@@ -1216,10 +1236,10 @@ class zt {
|
|
|
1216
1236
|
</div>
|
|
1217
1237
|
`;
|
|
1218
1238
|
}).join("");
|
|
1219
|
-
else if (
|
|
1220
|
-
this.pillsContainer.className = `ml__pills ml__pills--${this.
|
|
1221
|
-
const
|
|
1222
|
-
const d = this.getItemValue(p), m = this.
|
|
1239
|
+
else if (l === "partial") {
|
|
1240
|
+
this.pillsContainer.className = `ml__pills ml__pills--${this.effectivePillsPosition}`;
|
|
1241
|
+
const s = this.options.pillsMaxVisible || 3, n = e.slice(0, s), r = t - s, a = n.map((p) => {
|
|
1242
|
+
const d = this.getItemValue(p), m = this.getItemPillDisplayValue(p);
|
|
1223
1243
|
return `
|
|
1224
1244
|
<div class="ml__pill">
|
|
1225
1245
|
<span class="ml__pill-text">${m}</span>
|
|
@@ -1234,12 +1254,12 @@ class zt {
|
|
|
1234
1254
|
<button type="button" class="ml__pill-remove" data-action="remove-hidden" aria-label="Remove ${r} hidden items"></button>
|
|
1235
1255
|
</div>
|
|
1236
1256
|
`), this.pillsContainer.innerHTML = a + c;
|
|
1237
|
-
} else if (this.pillsContainer.className = `ml__count-display ml__count-display--${this.
|
|
1238
|
-
const
|
|
1257
|
+
} else if (this.pillsContainer.className = `ml__count-display ml__count-display--${this.effectivePillsPosition}`, t > 0) {
|
|
1258
|
+
const s = this.options.getCountPillCallback ? this.options.getCountPillCallback(t) : `${t} selected`;
|
|
1239
1259
|
this.pillsContainer.innerHTML = `
|
|
1240
1260
|
<div class="ml__count-badge-wrapper">
|
|
1241
1261
|
<button type="button" class="ml__count-text" data-action="show-selected">
|
|
1242
|
-
${
|
|
1262
|
+
${s}
|
|
1243
1263
|
</button>
|
|
1244
1264
|
<button type="button" class="ml__count-clear" data-action="clear-count" aria-label="Clear all selections"></button>
|
|
1245
1265
|
</div>
|
|
@@ -1250,8 +1270,12 @@ class zt {
|
|
|
1250
1270
|
}
|
|
1251
1271
|
attachEvents() {
|
|
1252
1272
|
this.input.addEventListener("mousedown", (e) => {
|
|
1253
|
-
this.isOpen
|
|
1254
|
-
|
|
1273
|
+
e.stopPropagation(), this.isOpen ? (this.justClosedViaClick = !0, this.close(), setTimeout(() => {
|
|
1274
|
+
this.justClosedViaClick = !1;
|
|
1275
|
+
}, 0)) : this.open();
|
|
1276
|
+
}), this.input.addEventListener("focus", () => {
|
|
1277
|
+
!this.isOpen && !this.justClosedViaClick && this.open();
|
|
1278
|
+
}), this.input.addEventListener("input", (e) => {
|
|
1255
1279
|
const t = e.target.value;
|
|
1256
1280
|
this.options.isSearchEnabled && !this.isOpen && this.open(), this.handleSearch(t);
|
|
1257
1281
|
}), this.input.addEventListener("keydown", (e) => this.handleKeydown(e)), setTimeout(() => {
|
|
@@ -1287,8 +1311,8 @@ class zt {
|
|
|
1287
1311
|
return;
|
|
1288
1312
|
}
|
|
1289
1313
|
if (!this.options.isSearchEnabled) {
|
|
1290
|
-
const t = e.key.length === 1 || e.key === "Backspace" || e.key === "Delete",
|
|
1291
|
-
if (t && !
|
|
1314
|
+
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);
|
|
1315
|
+
if (t && !l) {
|
|
1292
1316
|
e.preventDefault();
|
|
1293
1317
|
return;
|
|
1294
1318
|
}
|
|
@@ -1328,19 +1352,19 @@ class zt {
|
|
|
1328
1352
|
const t = e.target.closest("[data-action]");
|
|
1329
1353
|
if (t) {
|
|
1330
1354
|
e.preventDefault();
|
|
1331
|
-
const
|
|
1332
|
-
f.debug(`[${this.instanceId}] Action button clicked:`,
|
|
1355
|
+
const o = t.dataset.action;
|
|
1356
|
+
f.debug(`[${this.instanceId}] Action button clicked:`, o), o === "select-all" ? this.selectAll() : o === "clear-all" && this.clearAll();
|
|
1333
1357
|
return;
|
|
1334
1358
|
}
|
|
1335
|
-
const
|
|
1336
|
-
if (
|
|
1359
|
+
const l = e.target.closest(".ml__option");
|
|
1360
|
+
if (l && !l.classList.contains("ml__option--disabled")) {
|
|
1337
1361
|
e.preventDefault();
|
|
1338
|
-
const
|
|
1362
|
+
const o = l.dataset.value, s = this.filteredOptions.find((n) => String(this.getItemValue(n)) === o);
|
|
1339
1363
|
f.debug(`[${this.instanceId}] Option clicked:`, {
|
|
1340
|
-
value:
|
|
1364
|
+
value: o,
|
|
1341
1365
|
closeOnSelect: this.options.isCloseOnSelect,
|
|
1342
1366
|
placeholder: this.options.searchPlaceholder
|
|
1343
|
-
}),
|
|
1367
|
+
}), s && this.toggleOption(s);
|
|
1344
1368
|
}
|
|
1345
1369
|
}
|
|
1346
1370
|
handlePillClick(e) {
|
|
@@ -1352,15 +1376,15 @@ class zt {
|
|
|
1352
1376
|
e.preventDefault(), e.stopPropagation(), this.toggleSelectedPopover();
|
|
1353
1377
|
return;
|
|
1354
1378
|
}
|
|
1355
|
-
const
|
|
1356
|
-
if (
|
|
1357
|
-
if (e.preventDefault(), e.stopPropagation(),
|
|
1379
|
+
const o = e.target.closest(".ml__pill-remove");
|
|
1380
|
+
if (o) {
|
|
1381
|
+
if (e.preventDefault(), e.stopPropagation(), o.dataset.action === "remove-hidden") {
|
|
1358
1382
|
f.debug(`[${this.instanceId}] Remove hidden items button clicked`);
|
|
1359
1383
|
const a = this.options.pillsMaxVisible || 3;
|
|
1360
1384
|
Array.from(this.selectedOptions.values()).slice(a).forEach((d) => this.deselectOption(d));
|
|
1361
1385
|
return;
|
|
1362
1386
|
}
|
|
1363
|
-
const n =
|
|
1387
|
+
const n = o.dataset.value, r = this.selectedOptions.get(n);
|
|
1364
1388
|
r && this.deselectOption(r);
|
|
1365
1389
|
return;
|
|
1366
1390
|
}
|
|
@@ -1370,7 +1394,7 @@ class zt {
|
|
|
1370
1394
|
}
|
|
1371
1395
|
}
|
|
1372
1396
|
handleClickOutside(e) {
|
|
1373
|
-
var
|
|
1397
|
+
var o;
|
|
1374
1398
|
const t = e.composedPath();
|
|
1375
1399
|
if (this.showSelectedPopover && !t.some(
|
|
1376
1400
|
(n) => n instanceof Node && (this.selectedPopover.contains(n) || this.countBadge.contains(n) || n.closest && n.closest(".ml__count-text"))
|
|
@@ -1379,19 +1403,19 @@ class zt {
|
|
|
1379
1403
|
return;
|
|
1380
1404
|
}
|
|
1381
1405
|
if (!this.isOpen) return;
|
|
1382
|
-
const
|
|
1383
|
-
(
|
|
1406
|
+
const l = t.some(
|
|
1407
|
+
(s) => s instanceof Node && (this.element.contains(s) || this.dropdown.contains(s) || this.hint && this.hint.contains(s))
|
|
1384
1408
|
);
|
|
1385
1409
|
f.debug(`[${this.instanceId}] handleClickOutside`, {
|
|
1386
1410
|
target: e.target.className,
|
|
1387
1411
|
targetTag: e.target.tagName,
|
|
1388
|
-
clickedInside:
|
|
1412
|
+
clickedInside: l,
|
|
1389
1413
|
pathLength: t.length,
|
|
1390
|
-
firstInPath: (
|
|
1391
|
-
elementContains: t.some((
|
|
1392
|
-
dropdownContains: t.some((
|
|
1414
|
+
firstInPath: (o = t[0]) == null ? void 0 : o.tagName,
|
|
1415
|
+
elementContains: t.some((s) => s instanceof Node && this.element.contains(s)),
|
|
1416
|
+
dropdownContains: t.some((s) => s instanceof Node && this.dropdown.contains(s)),
|
|
1393
1417
|
isConnected: this.dropdown.isConnected
|
|
1394
|
-
}),
|
|
1418
|
+
}), l || (f.warn(`[${this.instanceId}] Closing dropdown due to click outside`), this.close());
|
|
1395
1419
|
}
|
|
1396
1420
|
focusNext() {
|
|
1397
1421
|
this.filteredOptions.length !== 0 && (this.focusedIndex = (this.focusedIndex + 1) % this.filteredOptions.length, this.renderDropdown(), this.scrollToFocused());
|
|
@@ -1416,12 +1440,12 @@ class zt {
|
|
|
1416
1440
|
e && e.scrollIntoView({ block: "nearest", behavior: "smooth" });
|
|
1417
1441
|
}
|
|
1418
1442
|
toggleOption(e) {
|
|
1419
|
-
const t = this.getItemValue(e),
|
|
1443
|
+
const t = this.getItemValue(e), l = String(t);
|
|
1420
1444
|
if (f.debug(`[${this.instanceId}] toggleOption called`, { value: t, multiple: this.options.isMultipleEnabled }), !this.options.isMultipleEnabled) {
|
|
1421
|
-
this.selectedValues.has(
|
|
1445
|
+
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
1446
|
return;
|
|
1423
1447
|
}
|
|
1424
|
-
this.selectedValues.has(
|
|
1448
|
+
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
1449
|
closeOnSelect: this.options.isCloseOnSelect,
|
|
1426
1450
|
willClose: this.options.isCloseOnSelect === !0,
|
|
1427
1451
|
placeholder: this.options.searchPlaceholder
|
|
@@ -1438,18 +1462,18 @@ class zt {
|
|
|
1438
1462
|
}
|
|
1439
1463
|
}
|
|
1440
1464
|
selectOption(e) {
|
|
1441
|
-
const t = this.getItemValue(e),
|
|
1442
|
-
this.selectedValues.add(
|
|
1465
|
+
const t = this.getItemValue(e), l = String(t);
|
|
1466
|
+
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
1467
|
}
|
|
1444
1468
|
deselectOption(e) {
|
|
1445
|
-
const t = this.getItemValue(e),
|
|
1446
|
-
this.selectedValues.delete(
|
|
1469
|
+
const t = this.getItemValue(e), l = String(t);
|
|
1470
|
+
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
1471
|
}
|
|
1448
1472
|
selectAll() {
|
|
1449
1473
|
this.filteredOptions.forEach((e) => {
|
|
1450
1474
|
if (!this.getItemDisabled(e)) {
|
|
1451
|
-
const t = this.getItemValue(e),
|
|
1452
|
-
this.selectedValues.add(
|
|
1475
|
+
const t = this.getItemValue(e), l = String(t);
|
|
1476
|
+
this.selectedValues.add(l), this.selectedOptions.set(l, e);
|
|
1453
1477
|
}
|
|
1454
1478
|
}), this.renderDropdown(), this.renderPills(), this.updateHiddenInput(), this.options.changeCallback && this.options.changeCallback(this.getSelected());
|
|
1455
1479
|
}
|
|
@@ -1483,11 +1507,11 @@ class zt {
|
|
|
1483
1507
|
ee(this.input, this.dropdown, {
|
|
1484
1508
|
placement: e,
|
|
1485
1509
|
middleware: t
|
|
1486
|
-
}).then(({ x:
|
|
1487
|
-
this.options.isPlacementLocked && !this.dropdownPlacement && (this.dropdownPlacement =
|
|
1510
|
+
}).then(({ x: l, y: o, placement: s }) => {
|
|
1511
|
+
this.options.isPlacementLocked && !this.dropdownPlacement && (this.dropdownPlacement = s, f.debug(`[${this.instanceId}] Locked dropdown placement:`, s));
|
|
1488
1512
|
const n = {
|
|
1489
|
-
left: `${
|
|
1490
|
-
top: `${
|
|
1513
|
+
left: `${l}px`,
|
|
1514
|
+
top: `${o}px`,
|
|
1491
1515
|
width: `${this.input.offsetWidth}px`
|
|
1492
1516
|
};
|
|
1493
1517
|
this.options.dropdownMinWidth && (n.minWidth = this.options.dropdownMinWidth), Object.assign(this.dropdown.style, n), this.hint && this.isOpen && this.positionHint();
|
|
@@ -1508,10 +1532,10 @@ class zt {
|
|
|
1508
1532
|
// Don't use flip() - we want hint to stay opposite of dropdown
|
|
1509
1533
|
Q({ padding: 8 })
|
|
1510
1534
|
]
|
|
1511
|
-
}).then(({ x: t, y:
|
|
1535
|
+
}).then(({ x: t, y: l }) => {
|
|
1512
1536
|
Object.assign(this.hint.style, {
|
|
1513
1537
|
left: `${t}px`,
|
|
1514
|
-
top: `${
|
|
1538
|
+
top: `${l}px`
|
|
1515
1539
|
});
|
|
1516
1540
|
});
|
|
1517
1541
|
}
|
|
@@ -1521,11 +1545,11 @@ class zt {
|
|
|
1521
1545
|
const e = this.element.dataset.initialValues;
|
|
1522
1546
|
if (e)
|
|
1523
1547
|
try {
|
|
1524
|
-
JSON.parse(e).forEach((
|
|
1525
|
-
const
|
|
1526
|
-
this.selectedValues.add(
|
|
1527
|
-
const
|
|
1528
|
-
|
|
1548
|
+
JSON.parse(e).forEach((l) => {
|
|
1549
|
+
const o = String(l);
|
|
1550
|
+
this.selectedValues.add(o);
|
|
1551
|
+
const s = this.allOptions.find((n) => String(this.getItemValue(n)) === o);
|
|
1552
|
+
s && this.selectedOptions.set(o, s);
|
|
1529
1553
|
}), this.renderPills();
|
|
1530
1554
|
} catch (t) {
|
|
1531
1555
|
console.error("[MultiSelect] Failed to parse initial values:", t);
|
|
@@ -1548,12 +1572,12 @@ class zt {
|
|
|
1548
1572
|
<button type="button" class="ml__selected-popover-close" aria-label="Close">×</button>
|
|
1549
1573
|
</div>
|
|
1550
1574
|
<div class="ml__selected-popover-body">
|
|
1551
|
-
${e.map((
|
|
1552
|
-
const
|
|
1575
|
+
${e.map((l) => {
|
|
1576
|
+
const o = this.getItemValue(l), s = this.getItemPillDisplayValue(l);
|
|
1553
1577
|
return `
|
|
1554
1578
|
<div class="ml__pill">
|
|
1555
|
-
<span class="ml__pill-text">${
|
|
1556
|
-
<button type="button" class="ml__pill-remove" data-value="${
|
|
1579
|
+
<span class="ml__pill-text">${s}</span>
|
|
1580
|
+
<button type="button" class="ml__pill-remove" data-value="${o}" aria-label="Remove ${s}"></button>
|
|
1557
1581
|
</div>
|
|
1558
1582
|
`;
|
|
1559
1583
|
}).join("")}
|
|
@@ -1565,11 +1589,11 @@ class zt {
|
|
|
1565
1589
|
e.preventDefault(), this.hideSelectedPopover();
|
|
1566
1590
|
return;
|
|
1567
1591
|
}
|
|
1568
|
-
const
|
|
1569
|
-
if (
|
|
1592
|
+
const l = e.target.closest(".ml__pill-remove");
|
|
1593
|
+
if (l) {
|
|
1570
1594
|
e.preventDefault();
|
|
1571
|
-
const
|
|
1572
|
-
|
|
1595
|
+
const o = l.dataset.value, s = this.selectedOptions.get(o);
|
|
1596
|
+
s && (this.deselectOption(s), this.renderSelectedPopover(), this.selectedValues.size === 0 && this.hideSelectedPopover());
|
|
1573
1597
|
}
|
|
1574
1598
|
}
|
|
1575
1599
|
positionSelectedPopover() {
|
|
@@ -1585,14 +1609,14 @@ class zt {
|
|
|
1585
1609
|
...this.selectedPopoverPlacement ? [] : [me()],
|
|
1586
1610
|
Q({ padding: 8 })
|
|
1587
1611
|
]
|
|
1588
|
-
}).then(({ x: t, y:
|
|
1589
|
-
this.selectedPopoverPlacement || (this.selectedPopoverPlacement =
|
|
1590
|
-
const
|
|
1612
|
+
}).then(({ x: t, y: l, placement: o }) => {
|
|
1613
|
+
this.selectedPopoverPlacement || (this.selectedPopoverPlacement = o, f.debug(`[${this.instanceId}] Locked popover placement:`, o));
|
|
1614
|
+
const s = {
|
|
1591
1615
|
left: `${t}px`,
|
|
1592
|
-
top: `${
|
|
1616
|
+
top: `${l}px`,
|
|
1593
1617
|
width: `${this.input.offsetWidth}px`
|
|
1594
1618
|
};
|
|
1595
|
-
this.options.dropdownMinWidth && (
|
|
1619
|
+
this.options.dropdownMinWidth && (s.minWidth = this.options.dropdownMinWidth), Object.assign(this.selectedPopover.style, s);
|
|
1596
1620
|
});
|
|
1597
1621
|
}
|
|
1598
1622
|
);
|
|
@@ -1602,20 +1626,20 @@ class zt {
|
|
|
1602
1626
|
// ========================================================================
|
|
1603
1627
|
updateHiddenInput() {
|
|
1604
1628
|
if (!this.options.formFieldId) return;
|
|
1605
|
-
this.hiddenInputs.forEach((
|
|
1606
|
-
const e = this.options.valueFormat || "json", t = Array.from(this.selectedOptions.values()).map((
|
|
1629
|
+
this.hiddenInputs.forEach((o) => o.remove()), this.hiddenInputs = [];
|
|
1630
|
+
const e = this.options.valueFormat || "json", t = Array.from(this.selectedOptions.values()).map((o) => this.getItemValue(o)), l = this.options.hostElement || this.element;
|
|
1607
1631
|
if (e === "array")
|
|
1608
|
-
t.forEach((
|
|
1609
|
-
const
|
|
1610
|
-
|
|
1632
|
+
t.forEach((o) => {
|
|
1633
|
+
const s = document.createElement("input");
|
|
1634
|
+
s.type = "hidden", s.name = `${this.options.formFieldId}[]`, s.value = String(o), l.appendChild(s), this.hiddenInputs.push(s);
|
|
1611
1635
|
});
|
|
1612
1636
|
else {
|
|
1613
|
-
const
|
|
1614
|
-
|
|
1637
|
+
const o = document.createElement("input");
|
|
1638
|
+
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
1639
|
}
|
|
1616
1640
|
}
|
|
1617
1641
|
getFormValue() {
|
|
1618
|
-
const e = Array.from(this.selectedOptions.values()).map((
|
|
1642
|
+
const e = Array.from(this.selectedOptions.values()).map((l) => this.getItemValue(l));
|
|
1619
1643
|
return this.options.getValueFormatCallback ? this.options.getValueFormatCallback(e) : (this.options.valueFormat || "json") === "csv" ? e.join(",") : JSON.stringify(e);
|
|
1620
1644
|
}
|
|
1621
1645
|
// ========================================================================
|
|
@@ -1626,8 +1650,8 @@ class zt {
|
|
|
1626
1650
|
}
|
|
1627
1651
|
setSelected(e) {
|
|
1628
1652
|
this.selectedValues = new Set(e.map((t) => String(t))), this.selectedOptions.clear(), e.forEach((t) => {
|
|
1629
|
-
const
|
|
1630
|
-
|
|
1653
|
+
const l = String(t), o = this.allOptions.find((s) => String(this.getItemValue(s)) === l);
|
|
1654
|
+
o && this.selectedOptions.set(l, o);
|
|
1631
1655
|
}), this.renderDropdown(), this.renderPills(), this.updateHiddenInput();
|
|
1632
1656
|
}
|
|
1633
1657
|
get selectedItem() {
|
|
@@ -1656,70 +1680,70 @@ class zt {
|
|
|
1656
1680
|
return;
|
|
1657
1681
|
}
|
|
1658
1682
|
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 =
|
|
1683
|
+
console.log(`[Tooltips] Found ${e.length} pills to attach tooltips to`), e.forEach((l) => {
|
|
1684
|
+
const o = l, s = o.querySelector(".ml__pill-remove");
|
|
1685
|
+
if (!s) return;
|
|
1686
|
+
const n = s.dataset.value, r = this.selectedOptions.get(n);
|
|
1663
1687
|
if (!r) return;
|
|
1664
|
-
const a =
|
|
1688
|
+
const a = o.querySelector(".ml__pill-text");
|
|
1665
1689
|
a && this.createTooltipForElement(a, r, n);
|
|
1666
|
-
const c = this.
|
|
1667
|
-
this.createRemoveButtonTooltip(
|
|
1690
|
+
const c = this.getItemPillDisplayValue(r);
|
|
1691
|
+
this.createRemoveButtonTooltip(s, c, n);
|
|
1668
1692
|
});
|
|
1669
1693
|
const t = this.pillsContainer.querySelector(".ml__pill--more");
|
|
1670
1694
|
if (t) {
|
|
1671
|
-
const
|
|
1672
|
-
if (
|
|
1673
|
-
const
|
|
1674
|
-
this.createRemoveButtonTooltip(
|
|
1695
|
+
const l = t.querySelector(".ml__pill-remove");
|
|
1696
|
+
if (l && l.dataset.action === "remove-hidden") {
|
|
1697
|
+
const o = this.options.pillsMaxVisible || 3, n = Array.from(this.selectedOptions.values()).length - o;
|
|
1698
|
+
this.createRemoveButtonTooltip(l, `${n} hidden items`, "more-badge-remove");
|
|
1675
1699
|
}
|
|
1676
1700
|
}
|
|
1677
1701
|
}
|
|
1678
|
-
createTooltipForElement(e, t,
|
|
1679
|
-
const
|
|
1680
|
-
|
|
1681
|
-
let
|
|
1702
|
+
createTooltipForElement(e, t, l) {
|
|
1703
|
+
const o = document.createElement("div");
|
|
1704
|
+
o.className = "ml__pill-tooltip";
|
|
1705
|
+
let s;
|
|
1682
1706
|
if (this.options.getPillTooltipCallback)
|
|
1683
|
-
|
|
1707
|
+
s = this.options.getPillTooltipCallback(t), console.log("[Tooltips] Using custom callback for tooltip content");
|
|
1684
1708
|
else {
|
|
1685
|
-
const d = this.
|
|
1686
|
-
|
|
1687
|
-
${m}` : d, console.log(`[Tooltips] Using default content: "${
|
|
1709
|
+
const d = this.getItemPillDisplayValue(t), m = this.getItemSubtitle(t);
|
|
1710
|
+
s = m ? `${d}
|
|
1711
|
+
${m}` : d, console.log(`[Tooltips] Using default content: "${s}"`);
|
|
1688
1712
|
}
|
|
1689
|
-
typeof
|
|
1713
|
+
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
1714
|
let r, a;
|
|
1691
1715
|
const c = () => {
|
|
1692
|
-
clearTimeout(a), console.log(`[Tooltips] Mouse entered pill "${
|
|
1693
|
-
console.log(`[Tooltips] Showing tooltip for "${
|
|
1716
|
+
clearTimeout(a), console.log(`[Tooltips] Mouse entered pill "${l}", will show tooltip in ${this.options.pillTooltipDelay || 300}ms`), r = window.setTimeout(() => {
|
|
1717
|
+
console.log(`[Tooltips] Showing tooltip for "${l}"`), o.classList.add("ml__pill-tooltip--visible"), this.positionPillTooltip(e, o, l);
|
|
1694
1718
|
}, this.options.pillTooltipDelay || 300);
|
|
1695
1719
|
}, p = () => {
|
|
1696
1720
|
clearTimeout(r), a = window.setTimeout(() => {
|
|
1697
|
-
|
|
1721
|
+
o.classList.remove("ml__pill-tooltip--visible"), this.cleanupPillTooltip(l);
|
|
1698
1722
|
}, 100);
|
|
1699
1723
|
};
|
|
1700
1724
|
e.addEventListener("mouseenter", c), e.addEventListener("mouseleave", p);
|
|
1701
1725
|
}
|
|
1702
|
-
createRemoveButtonTooltip(e, t,
|
|
1703
|
-
const
|
|
1704
|
-
|
|
1705
|
-
const n = `${
|
|
1706
|
-
this.pillTooltips.set(n,
|
|
1726
|
+
createRemoveButtonTooltip(e, t, l) {
|
|
1727
|
+
const o = document.createElement("div");
|
|
1728
|
+
o.className = "ml__pill-tooltip", o.textContent = `Remove ${t}`, (this.options.container || document.body).appendChild(o);
|
|
1729
|
+
const n = `${l}-remove`;
|
|
1730
|
+
this.pillTooltips.set(n, o);
|
|
1707
1731
|
let r, a;
|
|
1708
1732
|
const c = () => {
|
|
1709
1733
|
clearTimeout(a);
|
|
1710
|
-
const d = this.pillTooltips.get(
|
|
1734
|
+
const d = this.pillTooltips.get(l);
|
|
1711
1735
|
d && d.classList.remove("ml__pill-tooltip--visible"), r = window.setTimeout(() => {
|
|
1712
|
-
|
|
1736
|
+
o.classList.add("ml__pill-tooltip--visible"), this.positionPillTooltip(e, o, n);
|
|
1713
1737
|
}, this.options.pillTooltipDelay || 300);
|
|
1714
1738
|
}, p = () => {
|
|
1715
1739
|
clearTimeout(r), a = window.setTimeout(() => {
|
|
1716
|
-
|
|
1740
|
+
o.classList.remove("ml__pill-tooltip--visible"), this.cleanupPillTooltip(n);
|
|
1717
1741
|
}, 100);
|
|
1718
1742
|
};
|
|
1719
1743
|
e.addEventListener("mouseenter", c), e.addEventListener("mouseleave", p);
|
|
1720
1744
|
}
|
|
1721
|
-
positionPillTooltip(e, t,
|
|
1722
|
-
const
|
|
1745
|
+
positionPillTooltip(e, t, l) {
|
|
1746
|
+
const o = q(e, t, () => {
|
|
1723
1747
|
ee(e, t, {
|
|
1724
1748
|
placement: this.options.pillTooltipPlacement || "top",
|
|
1725
1749
|
strategy: "fixed",
|
|
@@ -1728,11 +1752,11 @@ ${m}` : d, console.log(`[Tooltips] Using default content: "${l}"`);
|
|
|
1728
1752
|
me(),
|
|
1729
1753
|
Q({ padding: 8 })
|
|
1730
1754
|
]
|
|
1731
|
-
}).then(({ x:
|
|
1755
|
+
}).then(({ x: s, y: n }) => {
|
|
1732
1756
|
Object.assign(t.style, {
|
|
1733
|
-
left: `${
|
|
1757
|
+
left: `${s}px`,
|
|
1734
1758
|
top: `${n}px`
|
|
1735
|
-
}), console.log(`[Tooltips] Positioned tooltip "${
|
|
1759
|
+
}), console.log(`[Tooltips] Positioned tooltip "${l}" at x:${s}, y:${n}`, {
|
|
1736
1760
|
placement: this.options.pillTooltipPlacement || "top",
|
|
1737
1761
|
tooltipClasses: t.className,
|
|
1738
1762
|
tooltipDisplay: window.getComputedStyle(t).display,
|
|
@@ -1743,7 +1767,7 @@ ${m}` : d, console.log(`[Tooltips] Using default content: "${l}"`);
|
|
|
1743
1767
|
});
|
|
1744
1768
|
});
|
|
1745
1769
|
});
|
|
1746
|
-
this.pillTooltipCleanups.set(
|
|
1770
|
+
this.pillTooltipCleanups.set(l, o);
|
|
1747
1771
|
}
|
|
1748
1772
|
cleanupPillTooltip(e) {
|
|
1749
1773
|
const t = this.pillTooltipCleanups.get(e);
|
|
@@ -1759,49 +1783,50 @@ ${m}` : d, console.log(`[Tooltips] Using default content: "${l}"`);
|
|
|
1759
1783
|
this.destroyAllPillTooltips(), this.dropdownCleanup && this.dropdownCleanup(), this.hintCleanup && this.hintCleanup(), this.selectedPopoverCleanup && this.selectedPopoverCleanup(), this.dropdown && this.dropdown.remove(), this.hint && this.hint.remove(), this.selectedPopover && this.selectedPopover.remove(), this.element.innerHTML = "", this.element.classList.remove("ml", "ml--open", "ml--no-checkboxes"), console.log("[MultiSelect] Destroyed");
|
|
1760
1784
|
}
|
|
1761
1785
|
}
|
|
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 {
|
|
1786
|
+
const Rt = '@charset "UTF-8";multi-select:not(:defined){display:block;min-height:2.5rem;color:transparent!important;background:transparent}.ml-wrapper{display:flex;flex-direction:column;align-items:stretch}.ml-wrapper--inline{flex-direction:row;align-items:flex-start}.ml{position:relative;width:100%}.ml__input-wrapper{position:relative;display:flex;align-items:center}.ml__input{width:100%;padding:var(--ml-input-padding, .5rem .75rem);padding-right:var(--ml-input-padding-right, 2.5rem);font-size:var(--ml-input-font-size, .875rem);border:var(--ml-input-border-style, 1px solid #d1d5db);border-radius:var(--ml-input-border-radius, .375rem);background:var(--ml-input-bg, #ffffff);color:var(--ml-input-text, #111827);cursor:pointer;transition:border-color var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}.ml__input:focus{outline:none;border-color:var(--ml-input-focus-border-color, #3b82f6)}.ml__input::placeholder{color:var(--ml-input-placeholder-color, #6b7280);opacity:0;transition:opacity var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}:host([data-ready]) .ml__input::placeholder{opacity:var(--ml-placeholder-opacity, .6)}.ml__toggle{position:absolute;right:var(--ml-toggle-right, .75rem);top:50%;transform:var(--ml-transform-center-y, translateY(-50%));pointer-events:none;color:var(--ml-toggle-color, #6b7280);transition:transform var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}.ml--open .ml__toggle{transform:var(--ml-transform-center-y, translateY(-50%)) rotate(var(--ml-transform-rotate-180, 180deg))}.ml__count-badge{position:absolute;right:var(--ml-count-badge-offset, 2rem);top:50%;transform:var(--ml-transform-center-y, translateY(-50%));padding:var(--ml-count-badge-padding, .125rem .25rem);background:var(--ml-count-badge-bg, #3b82f6);color:var(--ml-count-badge-color, #ffffff);font-size:var(--ml-count-badge-font-size, .75rem);font-weight:var(--ml-count-badge-font-weight, 600);border-radius:var(--ml-count-badge-border-radius, .25rem);cursor:pointer;transition:all var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}.ml__count-badge:hover{background:var(--ml-count-badge-bg-hover, #2563eb);transform:var(--ml-transform-center-y, translateY(-50%)) scale(var(--ml-transform-scale-hover, 1.1))}.ml__hint{display:none;position:absolute;z-index:var(--ml-z-index-popover, 10000);padding:var(--ml-hint-padding, .5rem .75rem);background:var(--ml-hint-bg, #ffffff);border:var(--ml-hint-border, 1px solid #e5e7eb);border-radius:var(--ml-hint-border-radius, .375rem);box-shadow:var(--ml-hint-box-shadow, 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -2px rgba(0, 0, 0, .1));font-size:var(--ml-hint-font-size, .75rem);color:var(--ml-hint-color, #6b7280);line-height:var(--ml-line-height-relaxed, 1.4);max-width:100%}.ml__hint--visible{display:block}.ml__dropdown{display:none;position:absolute;z-index:var(--ml-z-index-dropdown, 9999);background:var(--ml-dropdown-bg, #ffffff);border:var(--ml-dropdown-border, 1px solid #e5e7eb);border-radius:var(--ml-dropdown-border-radius, .375rem);box-shadow:var(--ml-dropdown-box-shadow, 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1));max-height:var(--ml-dropdown-max-height, 20rem);overflow-y:auto;color:var(--ml-dropdown-color, #111827)}.ml__dropdown--visible{display:block}.ml__actions{display:flex;gap:var(--ml-actions-gap, .25rem);padding:var(--ml-actions-padding, .5rem);border-bottom:var(--ml-actions-border-bottom, 1px solid #e5e7eb)}.ml__actions--sticky{position:sticky;top:0;z-index:var(--ml-z-index-sticky, 1);background:var(--ml-actions-bg, #ffffff)}.ml__action-btn{flex:1;padding:var(--ml-action-btn-padding, .25rem .5rem);font-size:var(--ml-action-btn-font-size, .75rem);border:var(--ml-action-btn-border, 1px solid #e5e7eb);border-radius:var(--ml-action-btn-border-radius, .25rem);background:var(--ml-action-btn-bg, transparent);color:var(--ml-action-btn-color, inherit);cursor:pointer;transition:all var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}.ml__action-btn:hover{background:var(--ml-action-btn-bg-hover, #f3f4f6);border-color:var(--ml-action-btn-border-color-hover, #3b82f6)}.ml__action-btn:active{transform:scale(var(--ml-transform-scale-active, .98))}.ml__options{padding:var(--ml-options-padding, .25rem 0)}.ml__group+.ml__group{border-top:var(--ml-group-border-top, 1px solid #e5e7eb);margin-top:var(--ml-group-margin-top, .25rem);padding-top:var(--ml-group-padding-top, .25rem)}.ml__group-label{padding:var(--ml-group-label-padding, .25rem .75rem);font-size:var(--ml-group-label-font-size, .75rem);font-weight:var(--ml-group-label-font-weight, 600);color:var(--ml-group-label-color, #6b7280);text-transform:var(--ml-group-label-transform, uppercase);letter-spacing:var(--ml-group-label-letter-spacing, .05em)}.ml__option{display:flex;align-items:flex-start;gap:var(--ml-option-gap, .5rem);padding:var(--ml-option-padding, .5rem .75rem);cursor:pointer;transition:background-color var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}.ml__option:hover{background:var(--ml-option-bg-hover, #f9fafb)}.ml__option--focused{background:var(--ml-option-bg-focused, #f9fafb);outline:var(--ml-option-outline-focused, 2px solid #3b82f6);outline-offset:var(--ml-option-focus-outline-offset, -2px)}.ml__option--selected{background:var(--ml-option-bg-selected, rgba(59, 130, 246, .1))}.ml__option--disabled{opacity:var(--ml-disabled-opacity, .5);cursor:not-allowed}.ml__option--disabled:hover{background:var(--ml-option-bg, transparent)}.ml__checkbox{flex-shrink:0;margin-top:var(--ml-checkbox-margin-top, .125rem);cursor:pointer}.ml__option--disabled .ml__checkbox{cursor:not-allowed}.ml__option-content{flex:1;display:flex;align-items:flex-start;gap:var(--ml-option-content-gap, .5rem);min-width:0}.ml__option-icon{flex-shrink:0;width:var(--ml-option-icon-size, 1.25rem);height:var(--ml-option-icon-size, 1.25rem);display:flex;align-items:center;justify-content:center;font-size:var(--ml-option-icon-font-size, 1rem)}.ml__option-icon svg{width:100%;height:100%;fill:currentColor}.ml__option-text{flex:1;min-width:0}.ml__option-title{font-size:var(--ml-option-title-font-size, .875rem);color:var(--ml-option-title-color, inherit);line-height:var(--ml-line-height-relaxed, 1.4)}.ml__option-title mark{background:var(--ml-option-mark-bg, rgba(59, 130, 246, .2));color:var(--ml-option-mark-color, inherit);font-weight:var(--ml-option-mark-font-weight, 600)}.ml__option-subtitle{margin-top:var(--ml-option-subtitle-margin-top, .25rem);font-size:var(--ml-option-subtitle-font-size, .75rem);color:var(--ml-option-subtitle-color, #6b7280);line-height:var(--ml-option-subtitle-line-height, 1.3)}.ml__empty{padding:var(--ml-empty-padding, 1rem .75rem);text-align:center;font-size:var(--ml-empty-font-size, .875rem);color:var(--ml-empty-color, #6b7280)}.ml__loader{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:var(--ml-loader-padding, 1rem);gap:var(--ml-loader-gap, .5rem)}.ml__loading-text{font-size:var(--ml-loading-text-font-size, .875rem);color:var(--ml-loading-text-color, #6b7280)}.ml__pills{display:flex;flex-wrap:wrap;gap:var(--ml-pills-gap, .5rem);padding:0}.ml__pills:empty{display:none}.ml__pills--bottom{margin-top:var(--ml-pills-margin-bottom, .5rem)}.ml__pills--top{margin-bottom:var(--ml-pills-margin-top, .5rem);order:var(--ml-order-first, -1)}.ml__pills--left{order:var(--ml-order-first, -1);margin-right:var(--ml-pills-margin-left, .25rem);justify-content:flex-end}.ml__pills--right{margin-left:var(--ml-pills-margin-right, .25rem);justify-content:flex-start}.ml__count-display{display:flex;align-items:center}.ml__count-display:empty{display:none}.ml__count-display--bottom{margin-top:var(--ml-count-display-margin-bottom, .5rem)}.ml__count-display--top{margin-bottom:var(--ml-count-display-margin-top, .5rem);order:var(--ml-order-first, -1)}.ml__count-display--left{order:var(--ml-order-first, -1);margin-right:var(--ml-count-display-margin-left, .5rem);justify-content:flex-start}.ml__count-display--right{margin-left:var(--ml-count-display-margin-right, .5rem);justify-content:flex-end}.ml__count-badge-wrapper{display:inline-flex;align-items:center;gap:var(--ml-count-badge-wrapper-gap, .25rem);background:var(--ml-count-badge-wrapper-bg, transparent);border:var(--ml-count-badge-wrapper-border, 1px solid #e5e7eb);border-radius:var(--ml-count-badge-wrapper-border-radius, .25rem);padding:var(--ml-count-badge-wrapper-padding, .25rem .5rem);transition:all var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}.ml__count-badge-wrapper:hover{background:var(--ml-count-badge-wrapper-bg-hover, #f9fafb);border-color:var(--ml-count-badge-wrapper-border-color-hover, #3b82f6)}.ml__count-text{display:inline-flex;align-items:center;background:var(--ml-count-text-bg, transparent);border:var(--ml-count-text-border, none);padding:0;font-size:var(--ml-count-text-font-size, .875rem);color:var(--ml-count-text-color, #111827);cursor:pointer;transition:color var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}.ml__count-clear{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:var(--ml-count-clear-size, 1rem);height:var(--ml-count-clear-size, 1rem);padding:0;border:none;background:var(--ml-count-clear-bg, transparent);color:var(--ml-count-clear-color, #6b7280);font-size:var(--ml-count-clear-font-size, 1.125rem);line-height:var(--ml-line-height-none, 1);cursor:pointer;border-radius:var(--ml-count-clear-border-radius, 50%);transition:all var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}.ml__count-clear:hover{background:var(--ml-count-clear-bg-hover, rgba(59, 130, 246, .2));color:var(--ml-count-clear-color-hover, #3b82f6)}.ml__count-clear:before{content:var(--ml-icon-clear, "×")}.ml__pill{display:inline-flex;align-items:center;height:var(--ml-pill-height, 1.5rem);font-size:var(--ml-pill-font-size, .75rem);font-weight:var(--ml-pill-font-weight, 600);line-height:var(--ml-line-height-none, 1);border-radius:var(--ml-pill-border-radius, .375rem);overflow:hidden;max-width:100%}.ml__pill-text{display:flex;align-items:center;height:100%;padding:var(--ml-pill-text-padding, 0 .5rem);background:var(--ml-pill-text-bg, #eff6ff);color:var(--ml-pill-text-color, #3b82f6);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:background-color var(--ml-transition-normal, .2s) ease}.ml__pill-remove{display:flex;align-items:center;justify-content:center;width:var(--ml-pill-remove-width, 1.5rem);height:100%;flex-shrink:0;background:var(--ml-pill-remove-bg, #3b82f6);color:var(--ml-pill-remove-color, #ffffff);border:var(--ml-pill-remove-border, none);cursor:pointer;transition:background-color var(--ml-transition-normal, .2s) ease;font-size:var(--ml-pill-remove-font-size, .75rem)}.ml__pill-remove:hover{background:var(--ml-pill-remove-bg-hover, #2563eb)}.ml__pill-remove:focus{outline:none;box-shadow:var(--ml-pill-remove-box-shadow-focus, 0 0 0 2px rgba(59, 130, 246, .5))}.ml__pill-remove:before{content:var(--ml-icon-remove, "×");font-size:var(--ml-font-size-base, 1rem);line-height:var(--ml-line-height-none, 1)}.ml__pill--more{cursor:pointer}.ml__pill--more .ml__pill-text{background:var(--ml-more-badge-bg, #eff6ff);font-weight:var(--ml-pill-font-weight, 600)}.ml__pill--more:hover .ml__pill-text{background:var(--ml-more-badge-hover-bg, #ffffff)}.ml__pill--more:active .ml__pill-text{background:var(--ml-more-badge-active-bg, #e0f2fe)}.ml__pill-tooltip{position:fixed;z-index:var(--ml-tooltip-z-index, 10000);opacity:0;visibility:hidden;transition:opacity var(--ml-transition-normal, .2s) ease,visibility var(--ml-transition-normal, .2s) ease;background:var(--ml-tooltip-bg, #333);color:var(--ml-tooltip-color, #fff);padding:var(--ml-tooltip-padding, .5rem .75rem);border-radius:var(--ml-tooltip-border-radius, .375rem);font-size:var(--ml-tooltip-font-size, .875rem);line-height:var(--ml-line-height-relaxed, 1.4);max-width:var(--ml-tooltip-max-width, 20rem);word-wrap:break-word;white-space:pre-wrap;box-shadow:var(--ml-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, .15));pointer-events:none}.ml__pill-tooltip--visible{opacity:1;visibility:visible}.ml__selected-popover{display:none;position:absolute;z-index:var(--ml-z-index-popover, 10000);background:var(--ml-selected-popover-bg, #ffffff);border:var(--ml-selected-popover-border, 1px solid #e5e7eb);border-radius:var(--ml-selected-popover-border-radius, .375rem);box-shadow:var(--ml-selected-popover-box-shadow, 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1));width:var(--ml-selected-popover-width, 20rem);max-height:var(--ml-selected-popover-max-height, 20rem);overflow:hidden}.ml__selected-popover--visible{display:flex;flex-direction:column}.ml__selected-popover-header{display:flex;align-items:center;justify-content:space-between;padding:var(--ml-selected-popover-header-padding, .5rem .75rem);background:var(--ml-selected-popover-header-bg, rgba(59, 130, 246, .1));border-bottom:var(--ml-selected-popover-header-border-bottom, 1px solid #e5e7eb);font-size:var(--ml-selected-popover-header-font-size, .875rem);font-weight:var(--ml-selected-popover-header-font-weight, 600);color:var(--ml-selected-popover-header-color, #111827)}.ml__selected-popover-close{display:flex;align-items:center;justify-content:center;width:var(--ml-popover-close-size, 1.5rem);height:var(--ml-popover-close-size, 1.5rem);padding:0;border:none;background:var(--ml-selected-popover-close-bg, transparent);color:var(--ml-selected-popover-close-color, #6b7280);font-size:var(--ml-selected-popover-close-font-size, 1.25rem);line-height:var(--ml-line-height-none, 1);cursor:pointer;border-radius:var(--ml-selected-popover-close-border-radius, 50%);transition:all var(--ml-transition-fast, .15s) var(--ml-easing-snappy, cubic-bezier(.4, 0, .2, 1))}.ml__selected-popover-close:hover{background:var(--ml-selected-popover-close-bg-hover, rgba(59, 130, 246, .2));color:var(--ml-selected-popover-close-color-hover, #3b82f6)}.ml__selected-popover-body{display:flex;flex-direction:column;gap:var(--ml-selected-popover-body-gap, .25rem);padding:var(--ml-selected-popover-body-padding, .5rem);overflow-y:auto;max-height:var(--ml-selected-popover-body-max-height, 18rem)}.ml__selected-popover-body .ml__pill{width:100%}.ml__selected-popover-body .ml__pill-text{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.ml--rtl .ml__input-wrapper{direction:rtl}.ml--rtl .ml__input{text-align:right;padding-left:var(--ml-input-padding-right, 2.5rem);padding-right:var(--ml-input-padding-h, .75rem)}.ml--rtl .ml__toggle{left:var(--ml-toggle-right, .75rem)!important;right:auto!important}.ml--rtl .ml__count-badge{left:var(--ml-count-badge-offset, 2rem)!important;right:auto!important}.ml--rtl .ml__dropdown{direction:rtl;text-align:right}.ml--rtl .ml__option{flex-direction:row-reverse}.ml--rtl .ml__checkbox{margin-left:var(--ml-spacing-sm, .5rem);margin-right:0}.ml--rtl .ml__option-content{text-align:right}.ml--rtl .ml__option-icon{margin-left:var(--ml-spacing-xs, .25rem);margin-right:0}.ml--rtl .ml__pills{direction:rtl}.ml--rtl .ml__pill{flex-direction:row-reverse}.ml--rtl .ml__pill-remove{border-radius:var(--ml-pill-remove-border-radius-rtl, .375rem) 0 0 var(--ml-pill-remove-border-radius-rtl, .375rem);border-left:var(--ml-pill-remove-border, none);border-right:none}.ml--rtl .ml__pill-text{border-radius:0 var(--ml-pill-text-border-radius-rtl, .375rem) var(--ml-pill-text-border-radius-rtl, .375rem) 0}.ml--rtl .ml__count-display{direction:rtl}.ml--rtl .ml__count-badge-wrapper{flex-direction:row-reverse}.ml--rtl .ml__selected-popover{direction:rtl;text-align:right}.ml--rtl .ml__actions{direction:rtl}.ml--rtl .ml__group-label,.ml--rtl .ml__empty{text-align:right}.ml--rtl .ml__hint{direction:rtl;text-align:right}.ml--xs .ml__input{font-size:var(--ml-font-size-xs, .75rem)}.ml--xs .ml__option{padding:var(--ml-spacing-xs, .25rem) var(--ml-spacing-sm, .5rem)}.ml--xs .ml__option-title{font-size:var(--ml-font-size-xs, .75rem)}.ml--xs .ml__pill{font-size:var(--ml-font-size-2xs, .625rem)}.ml--sm .ml__input,.ml--sm .ml__option-title{font-size:var(--ml-font-size-xs, .75rem)}.ml--lg .ml__input,.ml--lg .ml__option-title{font-size:var(--ml-font-size-base, 1rem)}.ml--lg .ml__pill{font-size:var(--ml-font-size-sm, .875rem)}.ml--xl .ml__input,.ml--xl .ml__option-title{font-size:var(--ml-font-size-lg, 1.125rem)}.ml--xl .ml__pill{font-size:var(--ml-font-size-base, 1rem)}.ml--disabled .ml__input{opacity:var(--ml-disabled-input-opacity, .6);cursor:not-allowed;background:var(--ml-input-bg-disabled, rgba(107, 114, 128, .05))}.ml--disabled .ml__toggle{opacity:var(--ml-disabled-input-opacity, .6)}.ml--no-checkboxes .ml__option{gap:0;padding-left:var(--ml-option-padding-h, .75rem)}.ml--no-checkboxes .ml__option-content{padding-left:0}.ml-debug-info{margin-top:.25rem;padding:.25rem;background-color:#f9fafb;border:1px solid #e5e7eb;border-radius:.375rem;font-size:.75rem;color:#111827}.ml-debug-info details summary{cursor:pointer;font-weight:600;color:#2563eb;-webkit-user-select:none;user-select:none;padding:.25rem;border-radius:.25rem}.ml-debug-info details summary:hover{background-color:#f3f4f6}.ml-debug-info details summary:focus{outline:2px solid #3b82f6;outline-offset:2px}.ml-debug-info .ml-debug-stats{display:flex;flex-direction:column;gap:.25rem;margin-top:.25rem;padding:.25rem;background-color:#fff;border-radius:.25rem}.ml-debug-info .ml-debug-stats span{display:flex;justify-content:space-between;padding:2px 4px;font-family:monospace;font-size:.625rem}.ml-debug-info .ml-debug-stats span:before{content:"•";margin-right:.25rem;color:#3b82f6}', Nt = typeof HTMLElement < "u" ? HTMLElement : class {
|
|
1763
1787
|
}, be = /* @__PURE__ */ new Set();
|
|
1764
1788
|
function je() {
|
|
1765
1789
|
return Array.from(be);
|
|
1766
1790
|
}
|
|
1767
|
-
class Ge extends
|
|
1791
|
+
class Ge extends Nt {
|
|
1768
1792
|
constructor() {
|
|
1769
1793
|
super();
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1794
|
+
h(this, "picker");
|
|
1795
|
+
h(this, "containerElement");
|
|
1796
|
+
h(this, "shadow");
|
|
1773
1797
|
// Properties for complex data (not attributes)
|
|
1774
|
-
|
|
1798
|
+
h(this, "_options");
|
|
1775
1799
|
// Member/Callback properties
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1800
|
+
h(this, "_valueMember");
|
|
1801
|
+
h(this, "_getValueCallback");
|
|
1802
|
+
h(this, "_displayValueMember");
|
|
1803
|
+
h(this, "_getDisplayValueCallback");
|
|
1804
|
+
h(this, "_getPillDisplayCallback");
|
|
1805
|
+
h(this, "_searchValueMember");
|
|
1806
|
+
h(this, "_getSearchValueCallback");
|
|
1807
|
+
h(this, "_iconMember");
|
|
1808
|
+
h(this, "_getIconCallback");
|
|
1809
|
+
h(this, "_subtitleMember");
|
|
1810
|
+
h(this, "_getSubtitleCallback");
|
|
1811
|
+
h(this, "_groupMember");
|
|
1812
|
+
h(this, "_getGroupCallback");
|
|
1813
|
+
h(this, "_disabledMember");
|
|
1814
|
+
h(this, "_getDisabledCallback");
|
|
1790
1815
|
// Value formatting callbacks
|
|
1791
|
-
|
|
1816
|
+
h(this, "_getValueFormatCallback");
|
|
1792
1817
|
// Tooltip callbacks
|
|
1793
|
-
|
|
1818
|
+
h(this, "_getPillTooltipCallback");
|
|
1794
1819
|
// Count pill callback
|
|
1795
|
-
|
|
1820
|
+
h(this, "_getCountPillCallback");
|
|
1796
1821
|
// Event callbacks
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1822
|
+
h(this, "_searchCallback");
|
|
1823
|
+
h(this, "_addNewCallback");
|
|
1824
|
+
h(this, "_selectCallback");
|
|
1825
|
+
h(this, "_deselectCallback");
|
|
1826
|
+
h(this, "_changeCallback");
|
|
1802
1827
|
this.shadow = this.attachShadow({ mode: "open" });
|
|
1803
1828
|
const t = document.createElement("style");
|
|
1804
|
-
t.textContent =
|
|
1829
|
+
t.textContent = Rt, this.shadow.appendChild(t), requestAnimationFrame(() => {
|
|
1805
1830
|
this.setAttribute("data-ready", "");
|
|
1806
1831
|
});
|
|
1807
1832
|
}
|
|
@@ -1857,8 +1882,8 @@ class Ge extends Rt {
|
|
|
1857
1882
|
disconnectedCallback() {
|
|
1858
1883
|
be.delete(this), this.picker && this.picker.destroy();
|
|
1859
1884
|
}
|
|
1860
|
-
attributeChangedCallback(t,
|
|
1861
|
-
|
|
1885
|
+
attributeChangedCallback(t, l, o) {
|
|
1886
|
+
l !== o && this.picker && t !== "initial-values" && (this.picker.destroy(), this.initializePicker());
|
|
1862
1887
|
}
|
|
1863
1888
|
render() {
|
|
1864
1889
|
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 +1891,21 @@ class Ge extends Rt {
|
|
|
1866
1891
|
renderDebugInfo() {
|
|
1867
1892
|
const t = this.shadow.querySelector(".ml-debug-info");
|
|
1868
1893
|
t && t.remove();
|
|
1869
|
-
const
|
|
1870
|
-
|
|
1871
|
-
const
|
|
1872
|
-
|
|
1894
|
+
const l = document.createElement("div");
|
|
1895
|
+
l.className = "ml-debug-info";
|
|
1896
|
+
const o = document.createElement("details"), s = document.createElement("summary");
|
|
1897
|
+
s.textContent = "Debug Info";
|
|
1873
1898
|
const n = document.createElement("div");
|
|
1874
|
-
n.className = "ml-debug-stats",
|
|
1899
|
+
n.className = "ml-debug-stats", o.appendChild(s), o.appendChild(n), l.appendChild(o), this.shadow.appendChild(l), this.updateDebugInfo();
|
|
1875
1900
|
}
|
|
1876
1901
|
updateDebugInfo() {
|
|
1877
|
-
var
|
|
1902
|
+
var u, g;
|
|
1878
1903
|
const t = this.shadow.querySelector(".ml-debug-stats");
|
|
1879
1904
|
if (!t || !this.picker) return;
|
|
1880
|
-
const
|
|
1905
|
+
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
1906
|
t.innerHTML = `
|
|
1882
|
-
<span>Version: ${
|
|
1883
|
-
<span>Total Instances: ${
|
|
1907
|
+
<span>Version: ${l}</span>
|
|
1908
|
+
<span>Total Instances: ${o}</span>
|
|
1884
1909
|
<span>Options: ${r}</span>
|
|
1885
1910
|
<span>Filtered: ${m}</span>
|
|
1886
1911
|
<span>Selected: ${n}</span>
|
|
@@ -1894,14 +1919,14 @@ class Ge extends Rt {
|
|
|
1894
1919
|
initializePicker() {
|
|
1895
1920
|
if (!this.containerElement) return;
|
|
1896
1921
|
let t;
|
|
1897
|
-
const
|
|
1898
|
-
if (
|
|
1922
|
+
const l = this.getAttribute("initial-values");
|
|
1923
|
+
if (l)
|
|
1899
1924
|
try {
|
|
1900
|
-
t = JSON.parse(
|
|
1901
|
-
} catch (
|
|
1902
|
-
console.error("[MultiSelectElement] Failed to parse initial-values:",
|
|
1925
|
+
t = JSON.parse(l);
|
|
1926
|
+
} catch (s) {
|
|
1927
|
+
console.error("[MultiSelectElement] Failed to parse initial-values:", s);
|
|
1903
1928
|
}
|
|
1904
|
-
const
|
|
1929
|
+
const o = {
|
|
1905
1930
|
// String options
|
|
1906
1931
|
searchHint: this.getAttribute("search-hint") || void 0,
|
|
1907
1932
|
searchPlaceholder: this.getAttribute("search-placeholder") || "Search...",
|
|
@@ -1940,6 +1965,7 @@ class Ge extends Rt {
|
|
|
1940
1965
|
// Callback properties (JavaScript only)
|
|
1941
1966
|
getValueCallback: this._getValueCallback,
|
|
1942
1967
|
getDisplayValueCallback: this._getDisplayValueCallback,
|
|
1968
|
+
getPillDisplayCallback: this._getPillDisplayCallback,
|
|
1943
1969
|
getSearchValueCallback: this._getSearchValueCallback,
|
|
1944
1970
|
getIconCallback: this._getIconCallback,
|
|
1945
1971
|
getSubtitleCallback: this._getSubtitleCallback,
|
|
@@ -1956,36 +1982,36 @@ class Ge extends Rt {
|
|
|
1956
1982
|
pillTooltipDelay: parseInt(this.getAttribute("pill-tooltip-delay") || "300"),
|
|
1957
1983
|
pillTooltipOffset: parseInt(this.getAttribute("pill-tooltip-offset") || "8"),
|
|
1958
1984
|
// Count pill callback
|
|
1959
|
-
getCountPillCallback: this._getCountPillCallback || ((
|
|
1985
|
+
getCountPillCallback: this._getCountPillCallback || ((s, n) => n !== void 0 ? `+${n} more` : `${s} selected`),
|
|
1960
1986
|
// Data and callbacks
|
|
1961
1987
|
options: this._options,
|
|
1962
1988
|
searchCallback: this._searchCallback,
|
|
1963
1989
|
addNewCallback: this._addNewCallback,
|
|
1964
|
-
selectCallback: (
|
|
1990
|
+
selectCallback: (s) => {
|
|
1965
1991
|
var n, r;
|
|
1966
|
-
this._selectCallback && this._selectCallback(
|
|
1992
|
+
this._selectCallback && this._selectCallback(s), this.dispatchEvent(new CustomEvent("select", {
|
|
1967
1993
|
detail: {
|
|
1968
|
-
option:
|
|
1994
|
+
option: s,
|
|
1969
1995
|
selectedOptions: (n = this.picker) == null ? void 0 : n.getSelected(),
|
|
1970
1996
|
selectedValues: Array.from(((r = this.picker) == null ? void 0 : r.getValue()) || [])
|
|
1971
1997
|
}
|
|
1972
1998
|
}));
|
|
1973
1999
|
},
|
|
1974
|
-
deselectCallback: (
|
|
2000
|
+
deselectCallback: (s) => {
|
|
1975
2001
|
var n, r;
|
|
1976
|
-
this._deselectCallback && this._deselectCallback(
|
|
2002
|
+
this._deselectCallback && this._deselectCallback(s), this.dispatchEvent(new CustomEvent("deselect", {
|
|
1977
2003
|
detail: {
|
|
1978
|
-
option:
|
|
2004
|
+
option: s,
|
|
1979
2005
|
selectedOptions: (n = this.picker) == null ? void 0 : n.getSelected(),
|
|
1980
2006
|
selectedValues: Array.from(((r = this.picker) == null ? void 0 : r.getValue()) || [])
|
|
1981
2007
|
}
|
|
1982
2008
|
}));
|
|
1983
2009
|
},
|
|
1984
|
-
changeCallback: (
|
|
2010
|
+
changeCallback: (s) => {
|
|
1985
2011
|
var n;
|
|
1986
|
-
this._changeCallback && this._changeCallback(
|
|
2012
|
+
this._changeCallback && this._changeCallback(s), this.dispatchEvent(new CustomEvent("change", {
|
|
1987
2013
|
detail: {
|
|
1988
|
-
selectedOptions:
|
|
2014
|
+
selectedOptions: s,
|
|
1989
2015
|
selectedValues: Array.from(((n = this.picker) == null ? void 0 : n.getValue()) || [])
|
|
1990
2016
|
}
|
|
1991
2017
|
}));
|
|
@@ -1995,7 +2021,7 @@ class Ge extends Rt {
|
|
|
1995
2021
|
// Pass host element (this) for hidden inputs in light DOM
|
|
1996
2022
|
hostElement: this
|
|
1997
2023
|
};
|
|
1998
|
-
t && (this.containerElement.dataset.initialValues = JSON.stringify(t)), this.picker = new zt(this.containerElement,
|
|
2024
|
+
t && (this.containerElement.dataset.initialValues = JSON.stringify(t)), this.picker = new zt(this.containerElement, o);
|
|
1999
2025
|
}
|
|
2000
2026
|
reinitialize() {
|
|
2001
2027
|
this.picker && (this.picker.destroy(), this.initializePicker());
|
|
@@ -2066,6 +2092,12 @@ class Ge extends Rt {
|
|
|
2066
2092
|
get getDisplayValueCallback() {
|
|
2067
2093
|
return this._getDisplayValueCallback;
|
|
2068
2094
|
}
|
|
2095
|
+
set getPillDisplayCallback(t) {
|
|
2096
|
+
this._getPillDisplayCallback = t, this.reinitialize();
|
|
2097
|
+
}
|
|
2098
|
+
get getPillDisplayCallback() {
|
|
2099
|
+
return this._getPillDisplayCallback;
|
|
2100
|
+
}
|
|
2069
2101
|
set getSearchValueCallback(t) {
|
|
2070
2102
|
this._getSearchValueCallback = t, this.reinitialize();
|
|
2071
2103
|
}
|
|
@@ -2212,10 +2244,10 @@ class Ge extends Rt {
|
|
|
2212
2244
|
}
|
|
2213
2245
|
typeof window < "u" && typeof customElements < "u" && (customElements.get("multi-select") || customElements.define("multi-select", Ge));
|
|
2214
2246
|
typeof window < "u" && (window.keenmate = window.keenmate || {}, window.keenmate.multiselect = {
|
|
2215
|
-
version: () => "1.0.0-
|
|
2247
|
+
version: () => "1.0.0-rc04",
|
|
2216
2248
|
config: {
|
|
2217
2249
|
name: "@keenmate/web-multiselect",
|
|
2218
|
-
version: "1.0.0-
|
|
2250
|
+
version: "1.0.0-rc04",
|
|
2219
2251
|
author: "Keenmate",
|
|
2220
2252
|
license: "MIT",
|
|
2221
2253
|
repository: "git+https://github.com/keenmate/web-multiselect.git",
|