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