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