@vue-interface/btn-dropdown 2.0.0-beta.6 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1804 +0,0 @@
1
- import { defineComponent as U, openBlock as W, createBlock as te, resolveDynamicComponent as Ue, mergeProps as me, withCtx as B, renderSlot as P, createTextVNode as be, toDisplayString as ye, createElementBlock as Xe, normalizeClass as F, h as Lt, Fragment as Vt, resolveComponent as re, createVNode as we, normalizeProps as ae, guardReactiveProps as Re, normalizeStyle as It, withKeys as yt, withModifiers as wt, createCommentVNode as ce, createSlots as qt } from "vue";
2
- var R = "top", N = "bottom", M = "right", j = "left", Te = "auto", xe = [R, N, M, j], se = "start", Oe = "end", Ft = "clippingParents", Ot = "viewport", ve = "popper", Wt = "reference", lt = /* @__PURE__ */ xe.reduce(function(e, t) {
3
- return e.concat([t + "-" + se, t + "-" + Oe]);
4
- }, []), $t = /* @__PURE__ */ [].concat(xe, [Te]).reduce(function(e, t) {
5
- return e.concat([t, t + "-" + se, t + "-" + Oe]);
6
- }, []), Ht = "beforeRead", Ut = "read", Xt = "afterRead", Yt = "beforeMain", Kt = "main", Gt = "afterMain", Jt = "beforeWrite", Qt = "write", Zt = "afterWrite", Fe = [Ht, Ut, Xt, Yt, Kt, Gt, Jt, Qt, Zt];
7
- function H(e) {
8
- return e ? (e.nodeName || "").toLowerCase() : null;
9
- }
10
- function L(e) {
11
- if (e == null)
12
- return window;
13
- if (e.toString() !== "[object Window]") {
14
- var t = e.ownerDocument;
15
- return t && t.defaultView || window;
16
- }
17
- return e;
18
- }
19
- function oe(e) {
20
- var t = L(e).Element;
21
- return e instanceof t || e instanceof Element;
22
- }
23
- function z(e) {
24
- var t = L(e).HTMLElement;
25
- return e instanceof t || e instanceof HTMLElement;
26
- }
27
- function Ye(e) {
28
- if (typeof ShadowRoot > "u")
29
- return !1;
30
- var t = L(e).ShadowRoot;
31
- return e instanceof t || e instanceof ShadowRoot;
32
- }
33
- function _t(e) {
34
- var t = e.state;
35
- Object.keys(t.elements).forEach(function(r) {
36
- var n = t.styles[r] || {}, o = t.attributes[r] || {}, i = t.elements[r];
37
- !z(i) || !H(i) || (Object.assign(i.style, n), Object.keys(o).forEach(function(a) {
38
- var l = o[a];
39
- l === !1 ? i.removeAttribute(a) : i.setAttribute(a, l === !0 ? "" : l);
40
- }));
41
- });
42
- }
43
- function er(e) {
44
- var t = e.state, r = {
45
- popper: {
46
- position: t.options.strategy,
47
- left: "0",
48
- top: "0",
49
- margin: "0"
50
- },
51
- arrow: {
52
- position: "absolute"
53
- },
54
- reference: {}
55
- };
56
- return Object.assign(t.elements.popper.style, r.popper), t.styles = r, t.elements.arrow && Object.assign(t.elements.arrow.style, r.arrow), function() {
57
- Object.keys(t.elements).forEach(function(n) {
58
- var o = t.elements[n], i = t.attributes[n] || {}, a = Object.keys(t.styles.hasOwnProperty(n) ? t.styles[n] : r[n]), l = a.reduce(function(s, f) {
59
- return s[f] = "", s;
60
- }, {});
61
- !z(o) || !H(o) || (Object.assign(o.style, l), Object.keys(i).forEach(function(s) {
62
- o.removeAttribute(s);
63
- }));
64
- });
65
- };
66
- }
67
- const tr = {
68
- name: "applyStyles",
69
- enabled: !0,
70
- phase: "write",
71
- fn: _t,
72
- effect: er,
73
- requires: ["computeStyles"]
74
- };
75
- function I(e) {
76
- return e.split("-")[0];
77
- }
78
- var ne = Math.max, je = Math.min, le = Math.round;
79
- function We() {
80
- var e = navigator.userAgentData;
81
- return e != null && e.brands ? e.brands.map(function(t) {
82
- return t.brand + "/" + t.version;
83
- }).join(" ") : navigator.userAgent;
84
- }
85
- function xt() {
86
- return !/^((?!chrome|android).)*safari/i.test(We());
87
- }
88
- function pe(e, t, r) {
89
- t === void 0 && (t = !1), r === void 0 && (r = !1);
90
- var n = e.getBoundingClientRect(), o = 1, i = 1;
91
- t && z(e) && (o = e.offsetWidth > 0 && le(n.width) / e.offsetWidth || 1, i = e.offsetHeight > 0 && le(n.height) / e.offsetHeight || 1);
92
- var a = oe(e) ? L(e) : window, l = a.visualViewport, s = !xt() && r, f = (n.left + (s && l ? l.offsetLeft : 0)) / o, p = (n.top + (s && l ? l.offsetTop : 0)) / i, h = n.width / o, y = n.height / i;
93
- return {
94
- width: h,
95
- height: y,
96
- top: p,
97
- right: f + h,
98
- bottom: p + y,
99
- left: f,
100
- x: f,
101
- y: p
102
- };
103
- }
104
- function Ke(e) {
105
- var t = pe(e), r = e.offsetWidth, n = e.offsetHeight;
106
- return Math.abs(t.width - r) <= 1 && (r = t.width), Math.abs(t.height - n) <= 1 && (n = t.height), {
107
- x: e.offsetLeft,
108
- y: e.offsetTop,
109
- width: r,
110
- height: n
111
- };
112
- }
113
- function Ct(e, t) {
114
- var r = t.getRootNode && t.getRootNode();
115
- if (e.contains(t))
116
- return !0;
117
- if (r && Ye(r)) {
118
- var n = t;
119
- do {
120
- if (n && e.isSameNode(n))
121
- return !0;
122
- n = n.parentNode || n.host;
123
- } while (n);
124
- }
125
- return !1;
126
- }
127
- function q(e) {
128
- return L(e).getComputedStyle(e);
129
- }
130
- function rr(e) {
131
- return ["table", "td", "th"].indexOf(H(e)) >= 0;
132
- }
133
- function K(e) {
134
- return ((oe(e) ? e.ownerDocument : (
135
- // $FlowFixMe[prop-missing]
136
- e.document
137
- )) || window.document).documentElement;
138
- }
139
- function ze(e) {
140
- return H(e) === "html" ? e : (
141
- // this is a quicker (but less type safe) way to save quite some bytes from the bundle
142
- // $FlowFixMe[incompatible-return]
143
- // $FlowFixMe[prop-missing]
144
- e.assignedSlot || // step into the shadow DOM of the parent of a slotted node
145
- e.parentNode || // DOM Element detected
146
- (Ye(e) ? e.host : null) || // ShadowRoot detected
147
- // $FlowFixMe[incompatible-call]: HTMLElement is a Node
148
- K(e)
149
- );
150
- }
151
- function pt(e) {
152
- return !z(e) || // https://github.com/popperjs/popper-core/issues/837
153
- q(e).position === "fixed" ? null : e.offsetParent;
154
- }
155
- function nr(e) {
156
- var t = /firefox/i.test(We()), r = /Trident/i.test(We());
157
- if (r && z(e)) {
158
- var n = q(e);
159
- if (n.position === "fixed")
160
- return null;
161
- }
162
- var o = ze(e);
163
- for (Ye(o) && (o = o.host); z(o) && ["html", "body"].indexOf(H(o)) < 0; ) {
164
- var i = q(o);
165
- if (i.transform !== "none" || i.perspective !== "none" || i.contain === "paint" || ["transform", "perspective"].indexOf(i.willChange) !== -1 || t && i.willChange === "filter" || t && i.filter && i.filter !== "none")
166
- return o;
167
- o = o.parentNode;
168
- }
169
- return null;
170
- }
171
- function Ce(e) {
172
- for (var t = L(e), r = pt(e); r && rr(r) && q(r).position === "static"; )
173
- r = pt(r);
174
- return r && (H(r) === "html" || H(r) === "body" && q(r).position === "static") ? t : r || nr(e) || t;
175
- }
176
- function Ge(e) {
177
- return ["top", "bottom"].indexOf(e) >= 0 ? "x" : "y";
178
- }
179
- function he(e, t, r) {
180
- return ne(e, je(t, r));
181
- }
182
- function or(e, t, r) {
183
- var n = he(e, t, r);
184
- return n > r ? r : n;
185
- }
186
- function Pt() {
187
- return {
188
- top: 0,
189
- right: 0,
190
- bottom: 0,
191
- left: 0
192
- };
193
- }
194
- function Et(e) {
195
- return Object.assign({}, Pt(), e);
196
- }
197
- function St(e, t) {
198
- return t.reduce(function(r, n) {
199
- return r[n] = e, r;
200
- }, {});
201
- }
202
- var ir = function(t, r) {
203
- return t = typeof t == "function" ? t(Object.assign({}, r.rects, {
204
- placement: r.placement
205
- })) : t, Et(typeof t != "number" ? t : St(t, xe));
206
- };
207
- function ar(e) {
208
- var t, r = e.state, n = e.name, o = e.options, i = r.elements.arrow, a = r.modifiersData.popperOffsets, l = I(r.placement), s = Ge(l), f = [j, M].indexOf(l) >= 0, p = f ? "height" : "width";
209
- if (!(!i || !a)) {
210
- var h = ir(o.padding, r), y = Ke(i), u = s === "y" ? R : j, O = s === "y" ? N : M, g = r.rects.reference[p] + r.rects.reference[s] - a[s] - r.rects.popper[p], v = a[s] - r.rects.reference[s], w = Ce(i), C = w ? s === "y" ? w.clientHeight || 0 : w.clientWidth || 0 : 0, x = g / 2 - v / 2, d = h[u], m = C - y[p] - h[O], c = C / 2 - y[p] / 2 + x, $ = he(d, c, m), E = s;
211
- r.modifiersData[n] = (t = {}, t[E] = $, t.centerOffset = $ - c, t);
212
- }
213
- }
214
- function sr(e) {
215
- var t = e.state, r = e.options, n = r.element, o = n === void 0 ? "[data-popper-arrow]" : n;
216
- if (o != null && !(typeof o == "string" && (o = t.elements.popper.querySelector(o), !o))) {
217
- if (process.env.NODE_ENV !== "production" && (z(o) || console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).', "To use an SVG arrow, wrap it in an HTMLElement that will be used as", "the arrow."].join(" "))), !Ct(t.elements.popper, o)) {
218
- process.env.NODE_ENV !== "production" && console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', "element."].join(" "));
219
- return;
220
- }
221
- t.elements.arrow = o;
222
- }
223
- }
224
- const lr = {
225
- name: "arrow",
226
- enabled: !0,
227
- phase: "main",
228
- fn: ar,
229
- effect: sr,
230
- requires: ["popperOffsets"],
231
- requiresIfExists: ["preventOverflow"]
232
- };
233
- function fe(e) {
234
- return e.split("-")[1];
235
- }
236
- var pr = {
237
- top: "auto",
238
- right: "auto",
239
- bottom: "auto",
240
- left: "auto"
241
- };
242
- function fr(e) {
243
- var t = e.x, r = e.y, n = window, o = n.devicePixelRatio || 1;
244
- return {
245
- x: le(t * o) / o || 0,
246
- y: le(r * o) / o || 0
247
- };
248
- }
249
- function ft(e) {
250
- var t, r = e.popper, n = e.popperRect, o = e.placement, i = e.variation, a = e.offsets, l = e.position, s = e.gpuAcceleration, f = e.adaptive, p = e.roundOffsets, h = e.isFixed, y = a.x, u = y === void 0 ? 0 : y, O = a.y, g = O === void 0 ? 0 : O, v = typeof p == "function" ? p({
251
- x: u,
252
- y: g
253
- }) : {
254
- x: u,
255
- y: g
256
- };
257
- u = v.x, g = v.y;
258
- var w = a.hasOwnProperty("x"), C = a.hasOwnProperty("y"), x = j, d = R, m = window;
259
- if (f) {
260
- var c = Ce(r), $ = "clientHeight", E = "clientWidth";
261
- if (c === L(r) && (c = K(r), q(c).position !== "static" && l === "absolute" && ($ = "scrollHeight", E = "scrollWidth")), c = c, o === R || (o === j || o === M) && i === Oe) {
262
- d = N;
263
- var S = h && c === m && m.visualViewport ? m.visualViewport.height : (
264
- // $FlowFixMe[prop-missing]
265
- c[$]
266
- );
267
- g -= S - n.height, g *= s ? 1 : -1;
268
- }
269
- if (o === j || (o === R || o === N) && i === Oe) {
270
- x = M;
271
- var k = h && c === m && m.visualViewport ? m.visualViewport.width : (
272
- // $FlowFixMe[prop-missing]
273
- c[E]
274
- );
275
- u -= k - n.width, u *= s ? 1 : -1;
276
- }
277
- }
278
- var b = Object.assign({
279
- position: l
280
- }, f && pr), D = p === !0 ? fr({
281
- x: u,
282
- y: g
283
- }) : {
284
- x: u,
285
- y: g
286
- };
287
- if (u = D.x, g = D.y, s) {
288
- var A;
289
- return Object.assign({}, b, (A = {}, A[d] = C ? "0" : "", A[x] = w ? "0" : "", A.transform = (m.devicePixelRatio || 1) <= 1 ? "translate(" + u + "px, " + g + "px)" : "translate3d(" + u + "px, " + g + "px, 0)", A));
290
- }
291
- return Object.assign({}, b, (t = {}, t[d] = C ? g + "px" : "", t[x] = w ? u + "px" : "", t.transform = "", t));
292
- }
293
- function ur(e) {
294
- var t = e.state, r = e.options, n = r.gpuAcceleration, o = n === void 0 ? !0 : n, i = r.adaptive, a = i === void 0 ? !0 : i, l = r.roundOffsets, s = l === void 0 ? !0 : l;
295
- if (process.env.NODE_ENV !== "production") {
296
- var f = q(t.elements.popper).transitionProperty || "";
297
- a && ["transform", "top", "right", "bottom", "left"].some(function(h) {
298
- return f.indexOf(h) >= 0;
299
- }) && console.warn(["Popper: Detected CSS transitions on at least one of the following", 'CSS properties: "transform", "top", "right", "bottom", "left".', `
300
-
301
- `, 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', "for smooth transitions, or remove these properties from the CSS", "transition declaration on the popper element if only transitioning", "opacity or background-color for example.", `
302
-
303
- `, "We recommend using the popper element as a wrapper around an inner", "element that can have any CSS property transitioned for animations."].join(" "));
304
- }
305
- var p = {
306
- placement: I(t.placement),
307
- variation: fe(t.placement),
308
- popper: t.elements.popper,
309
- popperRect: t.rects.popper,
310
- gpuAcceleration: o,
311
- isFixed: t.options.strategy === "fixed"
312
- };
313
- t.modifiersData.popperOffsets != null && (t.styles.popper = Object.assign({}, t.styles.popper, ft(Object.assign({}, p, {
314
- offsets: t.modifiersData.popperOffsets,
315
- position: t.options.strategy,
316
- adaptive: a,
317
- roundOffsets: s
318
- })))), t.modifiersData.arrow != null && (t.styles.arrow = Object.assign({}, t.styles.arrow, ft(Object.assign({}, p, {
319
- offsets: t.modifiersData.arrow,
320
- position: "absolute",
321
- adaptive: !1,
322
- roundOffsets: s
323
- })))), t.attributes.popper = Object.assign({}, t.attributes.popper, {
324
- "data-popper-placement": t.placement
325
- });
326
- }
327
- const dr = {
328
- name: "computeStyles",
329
- enabled: !0,
330
- phase: "beforeWrite",
331
- fn: ur,
332
- data: {}
333
- };
334
- var De = {
335
- passive: !0
336
- };
337
- function cr(e) {
338
- var t = e.state, r = e.instance, n = e.options, o = n.scroll, i = o === void 0 ? !0 : o, a = n.resize, l = a === void 0 ? !0 : a, s = L(t.elements.popper), f = [].concat(t.scrollParents.reference, t.scrollParents.popper);
339
- return i && f.forEach(function(p) {
340
- p.addEventListener("scroll", r.update, De);
341
- }), l && s.addEventListener("resize", r.update, De), function() {
342
- i && f.forEach(function(p) {
343
- p.removeEventListener("scroll", r.update, De);
344
- }), l && s.removeEventListener("resize", r.update, De);
345
- };
346
- }
347
- const vr = {
348
- name: "eventListeners",
349
- enabled: !0,
350
- phase: "write",
351
- fn: function() {
352
- },
353
- effect: cr,
354
- data: {}
355
- };
356
- var hr = {
357
- left: "right",
358
- right: "left",
359
- bottom: "top",
360
- top: "bottom"
361
- };
362
- function Ae(e) {
363
- return e.replace(/left|right|bottom|top/g, function(t) {
364
- return hr[t];
365
- });
366
- }
367
- var gr = {
368
- start: "end",
369
- end: "start"
370
- };
371
- function ut(e) {
372
- return e.replace(/start|end/g, function(t) {
373
- return gr[t];
374
- });
375
- }
376
- function Je(e) {
377
- var t = L(e), r = t.pageXOffset, n = t.pageYOffset;
378
- return {
379
- scrollLeft: r,
380
- scrollTop: n
381
- };
382
- }
383
- function Qe(e) {
384
- return pe(K(e)).left + Je(e).scrollLeft;
385
- }
386
- function mr(e, t) {
387
- var r = L(e), n = K(e), o = r.visualViewport, i = n.clientWidth, a = n.clientHeight, l = 0, s = 0;
388
- if (o) {
389
- i = o.width, a = o.height;
390
- var f = xt();
391
- (f || !f && t === "fixed") && (l = o.offsetLeft, s = o.offsetTop);
392
- }
393
- return {
394
- width: i,
395
- height: a,
396
- x: l + Qe(e),
397
- y: s
398
- };
399
- }
400
- function br(e) {
401
- var t, r = K(e), n = Je(e), o = (t = e.ownerDocument) == null ? void 0 : t.body, i = ne(r.scrollWidth, r.clientWidth, o ? o.scrollWidth : 0, o ? o.clientWidth : 0), a = ne(r.scrollHeight, r.clientHeight, o ? o.scrollHeight : 0, o ? o.clientHeight : 0), l = -n.scrollLeft + Qe(e), s = -n.scrollTop;
402
- return q(o || r).direction === "rtl" && (l += ne(r.clientWidth, o ? o.clientWidth : 0) - i), {
403
- width: i,
404
- height: a,
405
- x: l,
406
- y: s
407
- };
408
- }
409
- function Ze(e) {
410
- var t = q(e), r = t.overflow, n = t.overflowX, o = t.overflowY;
411
- return /auto|scroll|overlay|hidden/.test(r + o + n);
412
- }
413
- function kt(e) {
414
- return ["html", "body", "#document"].indexOf(H(e)) >= 0 ? e.ownerDocument.body : z(e) && Ze(e) ? e : kt(ze(e));
415
- }
416
- function ge(e, t) {
417
- var r;
418
- t === void 0 && (t = []);
419
- var n = kt(e), o = n === ((r = e.ownerDocument) == null ? void 0 : r.body), i = L(n), a = o ? [i].concat(i.visualViewport || [], Ze(n) ? n : []) : n, l = t.concat(a);
420
- return o ? l : (
421
- // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
422
- l.concat(ge(ze(a)))
423
- );
424
- }
425
- function He(e) {
426
- return Object.assign({}, e, {
427
- left: e.x,
428
- top: e.y,
429
- right: e.x + e.width,
430
- bottom: e.y + e.height
431
- });
432
- }
433
- function yr(e, t) {
434
- var r = pe(e, !1, t === "fixed");
435
- return r.top = r.top + e.clientTop, r.left = r.left + e.clientLeft, r.bottom = r.top + e.clientHeight, r.right = r.left + e.clientWidth, r.width = e.clientWidth, r.height = e.clientHeight, r.x = r.left, r.y = r.top, r;
436
- }
437
- function dt(e, t, r) {
438
- return t === Ot ? He(mr(e, r)) : oe(t) ? yr(t, r) : He(br(K(e)));
439
- }
440
- function wr(e) {
441
- var t = ge(ze(e)), r = ["absolute", "fixed"].indexOf(q(e).position) >= 0, n = r && z(e) ? Ce(e) : e;
442
- return oe(n) ? t.filter(function(o) {
443
- return oe(o) && Ct(o, n) && H(o) !== "body";
444
- }) : [];
445
- }
446
- function Or(e, t, r, n) {
447
- var o = t === "clippingParents" ? wr(e) : [].concat(t), i = [].concat(o, [r]), a = i[0], l = i.reduce(function(s, f) {
448
- var p = dt(e, f, n);
449
- return s.top = ne(p.top, s.top), s.right = je(p.right, s.right), s.bottom = je(p.bottom, s.bottom), s.left = ne(p.left, s.left), s;
450
- }, dt(e, a, n));
451
- return l.width = l.right - l.left, l.height = l.bottom - l.top, l.x = l.left, l.y = l.top, l;
452
- }
453
- function Bt(e) {
454
- var t = e.reference, r = e.element, n = e.placement, o = n ? I(n) : null, i = n ? fe(n) : null, a = t.x + t.width / 2 - r.width / 2, l = t.y + t.height / 2 - r.height / 2, s;
455
- switch (o) {
456
- case R:
457
- s = {
458
- x: a,
459
- y: t.y - r.height
460
- };
461
- break;
462
- case N:
463
- s = {
464
- x: a,
465
- y: t.y + t.height
466
- };
467
- break;
468
- case M:
469
- s = {
470
- x: t.x + t.width,
471
- y: l
472
- };
473
- break;
474
- case j:
475
- s = {
476
- x: t.x - r.width,
477
- y: l
478
- };
479
- break;
480
- default:
481
- s = {
482
- x: t.x,
483
- y: t.y
484
- };
485
- }
486
- var f = o ? Ge(o) : null;
487
- if (f != null) {
488
- var p = f === "y" ? "height" : "width";
489
- switch (i) {
490
- case se:
491
- s[f] = s[f] - (t[p] / 2 - r[p] / 2);
492
- break;
493
- case Oe:
494
- s[f] = s[f] + (t[p] / 2 - r[p] / 2);
495
- break;
496
- }
497
- }
498
- return s;
499
- }
500
- function $e(e, t) {
501
- t === void 0 && (t = {});
502
- var r = t, n = r.placement, o = n === void 0 ? e.placement : n, i = r.strategy, a = i === void 0 ? e.strategy : i, l = r.boundary, s = l === void 0 ? Ft : l, f = r.rootBoundary, p = f === void 0 ? Ot : f, h = r.elementContext, y = h === void 0 ? ve : h, u = r.altBoundary, O = u === void 0 ? !1 : u, g = r.padding, v = g === void 0 ? 0 : g, w = Et(typeof v != "number" ? v : St(v, xe)), C = y === ve ? Wt : ve, x = e.rects.popper, d = e.elements[O ? C : y], m = Or(oe(d) ? d : d.contextElement || K(e.elements.popper), s, p, a), c = pe(e.elements.reference), $ = Bt({
503
- reference: c,
504
- element: x,
505
- strategy: "absolute",
506
- placement: o
507
- }), E = He(Object.assign({}, x, $)), S = y === ve ? E : c, k = {
508
- top: m.top - S.top + w.top,
509
- bottom: S.bottom - m.bottom + w.bottom,
510
- left: m.left - S.left + w.left,
511
- right: S.right - m.right + w.right
512
- }, b = e.modifiersData.offset;
513
- if (y === ve && b) {
514
- var D = b[o];
515
- Object.keys(k).forEach(function(A) {
516
- var G = [M, N].indexOf(A) >= 0 ? 1 : -1, J = [R, N].indexOf(A) >= 0 ? "y" : "x";
517
- k[A] += D[J] * G;
518
- });
519
- }
520
- return k;
521
- }
522
- function $r(e, t) {
523
- t === void 0 && (t = {});
524
- var r = t, n = r.placement, o = r.boundary, i = r.rootBoundary, a = r.padding, l = r.flipVariations, s = r.allowedAutoPlacements, f = s === void 0 ? $t : s, p = fe(n), h = p ? l ? lt : lt.filter(function(O) {
525
- return fe(O) === p;
526
- }) : xe, y = h.filter(function(O) {
527
- return f.indexOf(O) >= 0;
528
- });
529
- y.length === 0 && (y = h, process.env.NODE_ENV !== "production" && console.error(["Popper: The `allowedAutoPlacements` option did not allow any", "placements. Ensure the `placement` option matches the variation", "of the allowed placements.", 'For example, "auto" cannot be used to allow "bottom-start".', 'Use "auto-start" instead.'].join(" ")));
530
- var u = y.reduce(function(O, g) {
531
- return O[g] = $e(e, {
532
- placement: g,
533
- boundary: o,
534
- rootBoundary: i,
535
- padding: a
536
- })[I(g)], O;
537
- }, {});
538
- return Object.keys(u).sort(function(O, g) {
539
- return u[O] - u[g];
540
- });
541
- }
542
- function xr(e) {
543
- if (I(e) === Te)
544
- return [];
545
- var t = Ae(e);
546
- return [ut(e), t, ut(t)];
547
- }
548
- function Cr(e) {
549
- var t = e.state, r = e.options, n = e.name;
550
- if (!t.modifiersData[n]._skip) {
551
- for (var o = r.mainAxis, i = o === void 0 ? !0 : o, a = r.altAxis, l = a === void 0 ? !0 : a, s = r.fallbackPlacements, f = r.padding, p = r.boundary, h = r.rootBoundary, y = r.altBoundary, u = r.flipVariations, O = u === void 0 ? !0 : u, g = r.allowedAutoPlacements, v = t.options.placement, w = I(v), C = w === v, x = s || (C || !O ? [Ae(v)] : xr(v)), d = [v].concat(x).reduce(function(ie, X) {
552
- return ie.concat(I(X) === Te ? $r(t, {
553
- placement: X,
554
- boundary: p,
555
- rootBoundary: h,
556
- padding: f,
557
- flipVariations: O,
558
- allowedAutoPlacements: g
559
- }) : X);
560
- }, []), m = t.rects.reference, c = t.rects.popper, $ = /* @__PURE__ */ new Map(), E = !0, S = d[0], k = 0; k < d.length; k++) {
561
- var b = d[k], D = I(b), A = fe(b) === se, G = [R, N].indexOf(D) >= 0, J = G ? "width" : "height", T = $e(t, {
562
- placement: b,
563
- boundary: p,
564
- rootBoundary: h,
565
- altBoundary: y,
566
- padding: f
567
- }), V = G ? A ? M : j : A ? N : R;
568
- m[J] > c[J] && (V = Ae(V));
569
- var Pe = Ae(V), Q = [];
570
- if (i && Q.push(T[D] <= 0), l && Q.push(T[V] <= 0, T[Pe] <= 0), Q.every(function(ie) {
571
- return ie;
572
- })) {
573
- S = b, E = !1;
574
- break;
575
- }
576
- $.set(b, Q);
577
- }
578
- if (E)
579
- for (var Ee = O ? 3 : 1, Me = function(X) {
580
- var de = d.find(function(ke) {
581
- var Z = $.get(ke);
582
- if (Z)
583
- return Z.slice(0, X).every(function(Le) {
584
- return Le;
585
- });
586
- });
587
- if (de)
588
- return S = de, "break";
589
- }, ue = Ee; ue > 0; ue--) {
590
- var Se = Me(ue);
591
- if (Se === "break")
592
- break;
593
- }
594
- t.placement !== S && (t.modifiersData[n]._skip = !0, t.placement = S, t.reset = !0);
595
- }
596
- }
597
- const Pr = {
598
- name: "flip",
599
- enabled: !0,
600
- phase: "main",
601
- fn: Cr,
602
- requiresIfExists: ["offset"],
603
- data: {
604
- _skip: !1
605
- }
606
- };
607
- function ct(e, t, r) {
608
- return r === void 0 && (r = {
609
- x: 0,
610
- y: 0
611
- }), {
612
- top: e.top - t.height - r.y,
613
- right: e.right - t.width + r.x,
614
- bottom: e.bottom - t.height + r.y,
615
- left: e.left - t.width - r.x
616
- };
617
- }
618
- function vt(e) {
619
- return [R, M, N, j].some(function(t) {
620
- return e[t] >= 0;
621
- });
622
- }
623
- function Er(e) {
624
- var t = e.state, r = e.name, n = t.rects.reference, o = t.rects.popper, i = t.modifiersData.preventOverflow, a = $e(t, {
625
- elementContext: "reference"
626
- }), l = $e(t, {
627
- altBoundary: !0
628
- }), s = ct(a, n), f = ct(l, o, i), p = vt(s), h = vt(f);
629
- t.modifiersData[r] = {
630
- referenceClippingOffsets: s,
631
- popperEscapeOffsets: f,
632
- isReferenceHidden: p,
633
- hasPopperEscaped: h
634
- }, t.attributes.popper = Object.assign({}, t.attributes.popper, {
635
- "data-popper-reference-hidden": p,
636
- "data-popper-escaped": h
637
- });
638
- }
639
- const Sr = {
640
- name: "hide",
641
- enabled: !0,
642
- phase: "main",
643
- requiresIfExists: ["preventOverflow"],
644
- fn: Er
645
- };
646
- function kr(e, t, r) {
647
- var n = I(e), o = [j, R].indexOf(n) >= 0 ? -1 : 1, i = typeof r == "function" ? r(Object.assign({}, t, {
648
- placement: e
649
- })) : r, a = i[0], l = i[1];
650
- return a = a || 0, l = (l || 0) * o, [j, M].indexOf(n) >= 0 ? {
651
- x: l,
652
- y: a
653
- } : {
654
- x: a,
655
- y: l
656
- };
657
- }
658
- function Br(e) {
659
- var t = e.state, r = e.options, n = e.name, o = r.offset, i = o === void 0 ? [0, 0] : o, a = $t.reduce(function(p, h) {
660
- return p[h] = kr(h, t.rects, i), p;
661
- }, {}), l = a[t.placement], s = l.x, f = l.y;
662
- t.modifiersData.popperOffsets != null && (t.modifiersData.popperOffsets.x += s, t.modifiersData.popperOffsets.y += f), t.modifiersData[n] = a;
663
- }
664
- const Dr = {
665
- name: "offset",
666
- enabled: !0,
667
- phase: "main",
668
- requires: ["popperOffsets"],
669
- fn: Br
670
- };
671
- function Ar(e) {
672
- var t = e.state, r = e.name;
673
- t.modifiersData[r] = Bt({
674
- reference: t.rects.reference,
675
- element: t.rects.popper,
676
- strategy: "absolute",
677
- placement: t.placement
678
- });
679
- }
680
- const Rr = {
681
- name: "popperOffsets",
682
- enabled: !0,
683
- phase: "read",
684
- fn: Ar,
685
- data: {}
686
- };
687
- function jr(e) {
688
- return e === "x" ? "y" : "x";
689
- }
690
- function Tr(e) {
691
- var t = e.state, r = e.options, n = e.name, o = r.mainAxis, i = o === void 0 ? !0 : o, a = r.altAxis, l = a === void 0 ? !1 : a, s = r.boundary, f = r.rootBoundary, p = r.altBoundary, h = r.padding, y = r.tether, u = y === void 0 ? !0 : y, O = r.tetherOffset, g = O === void 0 ? 0 : O, v = $e(t, {
692
- boundary: s,
693
- rootBoundary: f,
694
- padding: h,
695
- altBoundary: p
696
- }), w = I(t.placement), C = fe(t.placement), x = !C, d = Ge(w), m = jr(d), c = t.modifiersData.popperOffsets, $ = t.rects.reference, E = t.rects.popper, S = typeof g == "function" ? g(Object.assign({}, t.rects, {
697
- placement: t.placement
698
- })) : g, k = typeof S == "number" ? {
699
- mainAxis: S,
700
- altAxis: S
701
- } : Object.assign({
702
- mainAxis: 0,
703
- altAxis: 0
704
- }, S), b = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, D = {
705
- x: 0,
706
- y: 0
707
- };
708
- if (c) {
709
- if (i) {
710
- var A, G = d === "y" ? R : j, J = d === "y" ? N : M, T = d === "y" ? "height" : "width", V = c[d], Pe = V + v[G], Q = V - v[J], Ee = u ? -E[T] / 2 : 0, Me = C === se ? $[T] : E[T], ue = C === se ? -E[T] : -$[T], Se = t.elements.arrow, ie = u && Se ? Ke(Se) : {
711
- width: 0,
712
- height: 0
713
- }, X = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : Pt(), de = X[G], ke = X[J], Z = he(0, $[T], ie[T]), Le = x ? $[T] / 2 - Ee - Z - de - k.mainAxis : Me - Z - de - k.mainAxis, Rt = x ? -$[T] / 2 + Ee + Z + ke + k.mainAxis : ue + Z + ke + k.mainAxis, Ve = t.elements.arrow && Ce(t.elements.arrow), jt = Ve ? d === "y" ? Ve.clientTop || 0 : Ve.clientLeft || 0 : 0, _e = (A = b == null ? void 0 : b[d]) != null ? A : 0, Tt = V + Le - _e - jt, zt = V + Rt - _e, et = he(u ? je(Pe, Tt) : Pe, V, u ? ne(Q, zt) : Q);
714
- c[d] = et, D[d] = et - V;
715
- }
716
- if (l) {
717
- var tt, Nt = d === "x" ? R : j, Mt = d === "x" ? N : M, _ = c[m], Be = m === "y" ? "height" : "width", rt = _ + v[Nt], nt = _ - v[Mt], Ie = [R, j].indexOf(w) !== -1, ot = (tt = b == null ? void 0 : b[m]) != null ? tt : 0, it = Ie ? rt : _ - $[Be] - E[Be] - ot + k.altAxis, at = Ie ? _ + $[Be] + E[Be] - ot - k.altAxis : nt, st = u && Ie ? or(it, _, at) : he(u ? it : rt, _, u ? at : nt);
718
- c[m] = st, D[m] = st - _;
719
- }
720
- t.modifiersData[n] = D;
721
- }
722
- }
723
- const zr = {
724
- name: "preventOverflow",
725
- enabled: !0,
726
- phase: "main",
727
- fn: Tr,
728
- requiresIfExists: ["offset"]
729
- };
730
- function Nr(e) {
731
- return {
732
- scrollLeft: e.scrollLeft,
733
- scrollTop: e.scrollTop
734
- };
735
- }
736
- function Mr(e) {
737
- return e === L(e) || !z(e) ? Je(e) : Nr(e);
738
- }
739
- function Lr(e) {
740
- var t = e.getBoundingClientRect(), r = le(t.width) / e.offsetWidth || 1, n = le(t.height) / e.offsetHeight || 1;
741
- return r !== 1 || n !== 1;
742
- }
743
- function Vr(e, t, r) {
744
- r === void 0 && (r = !1);
745
- var n = z(t), o = z(t) && Lr(t), i = K(t), a = pe(e, o, r), l = {
746
- scrollLeft: 0,
747
- scrollTop: 0
748
- }, s = {
749
- x: 0,
750
- y: 0
751
- };
752
- return (n || !n && !r) && ((H(t) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
753
- Ze(i)) && (l = Mr(t)), z(t) ? (s = pe(t, !0), s.x += t.clientLeft, s.y += t.clientTop) : i && (s.x = Qe(i))), {
754
- x: a.left + l.scrollLeft - s.x,
755
- y: a.top + l.scrollTop - s.y,
756
- width: a.width,
757
- height: a.height
758
- };
759
- }
760
- function Ir(e) {
761
- var t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), n = [];
762
- e.forEach(function(i) {
763
- t.set(i.name, i);
764
- });
765
- function o(i) {
766
- r.add(i.name);
767
- var a = [].concat(i.requires || [], i.requiresIfExists || []);
768
- a.forEach(function(l) {
769
- if (!r.has(l)) {
770
- var s = t.get(l);
771
- s && o(s);
772
- }
773
- }), n.push(i);
774
- }
775
- return e.forEach(function(i) {
776
- r.has(i.name) || o(i);
777
- }), n;
778
- }
779
- function qr(e) {
780
- var t = Ir(e);
781
- return Fe.reduce(function(r, n) {
782
- return r.concat(t.filter(function(o) {
783
- return o.phase === n;
784
- }));
785
- }, []);
786
- }
787
- function Fr(e) {
788
- var t;
789
- return function() {
790
- return t || (t = new Promise(function(r) {
791
- Promise.resolve().then(function() {
792
- t = void 0, r(e());
793
- });
794
- })), t;
795
- };
796
- }
797
- function Y(e) {
798
- for (var t = arguments.length, r = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
799
- r[n - 1] = arguments[n];
800
- return [].concat(r).reduce(function(o, i) {
801
- return o.replace(/%s/, i);
802
- }, e);
803
- }
804
- var ee = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s', Wr = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available', ht = ["name", "enabled", "phase", "fn", "effect", "requires", "options"];
805
- function Hr(e) {
806
- e.forEach(function(t) {
807
- [].concat(Object.keys(t), ht).filter(function(r, n, o) {
808
- return o.indexOf(r) === n;
809
- }).forEach(function(r) {
810
- switch (r) {
811
- case "name":
812
- typeof t.name != "string" && console.error(Y(ee, String(t.name), '"name"', '"string"', '"' + String(t.name) + '"'));
813
- break;
814
- case "enabled":
815
- typeof t.enabled != "boolean" && console.error(Y(ee, t.name, '"enabled"', '"boolean"', '"' + String(t.enabled) + '"'));
816
- break;
817
- case "phase":
818
- Fe.indexOf(t.phase) < 0 && console.error(Y(ee, t.name, '"phase"', "either " + Fe.join(", "), '"' + String(t.phase) + '"'));
819
- break;
820
- case "fn":
821
- typeof t.fn != "function" && console.error(Y(ee, t.name, '"fn"', '"function"', '"' + String(t.fn) + '"'));
822
- break;
823
- case "effect":
824
- t.effect != null && typeof t.effect != "function" && console.error(Y(ee, t.name, '"effect"', '"function"', '"' + String(t.fn) + '"'));
825
- break;
826
- case "requires":
827
- t.requires != null && !Array.isArray(t.requires) && console.error(Y(ee, t.name, '"requires"', '"array"', '"' + String(t.requires) + '"'));
828
- break;
829
- case "requiresIfExists":
830
- Array.isArray(t.requiresIfExists) || console.error(Y(ee, t.name, '"requiresIfExists"', '"array"', '"' + String(t.requiresIfExists) + '"'));
831
- break;
832
- case "options":
833
- case "data":
834
- break;
835
- default:
836
- console.error('PopperJS: an invalid property has been provided to the "' + t.name + '" modifier, valid properties are ' + ht.map(function(n) {
837
- return '"' + n + '"';
838
- }).join(", ") + '; but "' + r + '" was provided.');
839
- }
840
- t.requires && t.requires.forEach(function(n) {
841
- e.find(function(o) {
842
- return o.name === n;
843
- }) == null && console.error(Y(Wr, String(t.name), n, n));
844
- });
845
- });
846
- });
847
- }
848
- function Ur(e, t) {
849
- var r = /* @__PURE__ */ new Set();
850
- return e.filter(function(n) {
851
- var o = t(n);
852
- if (!r.has(o))
853
- return r.add(o), !0;
854
- });
855
- }
856
- function Xr(e) {
857
- var t = e.reduce(function(r, n) {
858
- var o = r[n.name];
859
- return r[n.name] = o ? Object.assign({}, o, n, {
860
- options: Object.assign({}, o.options, n.options),
861
- data: Object.assign({}, o.data, n.data)
862
- }) : n, r;
863
- }, {});
864
- return Object.keys(t).map(function(r) {
865
- return t[r];
866
- });
867
- }
868
- var gt = "Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.", Yr = "Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.", mt = {
869
- placement: "bottom",
870
- modifiers: [],
871
- strategy: "absolute"
872
- };
873
- function bt() {
874
- for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
875
- t[r] = arguments[r];
876
- return !t.some(function(n) {
877
- return !(n && typeof n.getBoundingClientRect == "function");
878
- });
879
- }
880
- function Kr(e) {
881
- e === void 0 && (e = {});
882
- var t = e, r = t.defaultModifiers, n = r === void 0 ? [] : r, o = t.defaultOptions, i = o === void 0 ? mt : o;
883
- return function(l, s, f) {
884
- f === void 0 && (f = i);
885
- var p = {
886
- placement: "bottom",
887
- orderedModifiers: [],
888
- options: Object.assign({}, mt, i),
889
- modifiersData: {},
890
- elements: {
891
- reference: l,
892
- popper: s
893
- },
894
- attributes: {},
895
- styles: {}
896
- }, h = [], y = !1, u = {
897
- state: p,
898
- setOptions: function(w) {
899
- var C = typeof w == "function" ? w(p.options) : w;
900
- g(), p.options = Object.assign({}, i, p.options, C), p.scrollParents = {
901
- reference: oe(l) ? ge(l) : l.contextElement ? ge(l.contextElement) : [],
902
- popper: ge(s)
903
- };
904
- var x = qr(Xr([].concat(n, p.options.modifiers)));
905
- if (p.orderedModifiers = x.filter(function(b) {
906
- return b.enabled;
907
- }), process.env.NODE_ENV !== "production") {
908
- var d = Ur([].concat(x, p.options.modifiers), function(b) {
909
- var D = b.name;
910
- return D;
911
- });
912
- if (Hr(d), I(p.options.placement) === Te) {
913
- var m = p.orderedModifiers.find(function(b) {
914
- var D = b.name;
915
- return D === "flip";
916
- });
917
- m || console.error(['Popper: "auto" placements require the "flip" modifier be', "present and enabled to work."].join(" "));
918
- }
919
- var c = q(s), $ = c.marginTop, E = c.marginRight, S = c.marginBottom, k = c.marginLeft;
920
- [$, E, S, k].some(function(b) {
921
- return parseFloat(b);
922
- }) && console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', "between the popper and its reference element or boundary.", "To replicate margin, use the `offset` modifier, as well as", "the `padding` option in the `preventOverflow` and `flip`", "modifiers."].join(" "));
923
- }
924
- return O(), u.update();
925
- },
926
- // Sync update – it will always be executed, even if not necessary. This
927
- // is useful for low frequency updates where sync behavior simplifies the
928
- // logic.
929
- // For high frequency updates (e.g. `resize` and `scroll` events), always
930
- // prefer the async Popper#update method
931
- forceUpdate: function() {
932
- if (!y) {
933
- var w = p.elements, C = w.reference, x = w.popper;
934
- if (!bt(C, x)) {
935
- process.env.NODE_ENV !== "production" && console.error(gt);
936
- return;
937
- }
938
- p.rects = {
939
- reference: Vr(C, Ce(x), p.options.strategy === "fixed"),
940
- popper: Ke(x)
941
- }, p.reset = !1, p.placement = p.options.placement, p.orderedModifiers.forEach(function(b) {
942
- return p.modifiersData[b.name] = Object.assign({}, b.data);
943
- });
944
- for (var d = 0, m = 0; m < p.orderedModifiers.length; m++) {
945
- if (process.env.NODE_ENV !== "production" && (d += 1, d > 100)) {
946
- console.error(Yr);
947
- break;
948
- }
949
- if (p.reset === !0) {
950
- p.reset = !1, m = -1;
951
- continue;
952
- }
953
- var c = p.orderedModifiers[m], $ = c.fn, E = c.options, S = E === void 0 ? {} : E, k = c.name;
954
- typeof $ == "function" && (p = $({
955
- state: p,
956
- options: S,
957
- name: k,
958
- instance: u
959
- }) || p);
960
- }
961
- }
962
- },
963
- // Async and optimistically optimized update – it will not be executed if
964
- // not necessary (debounced to run at most once-per-tick)
965
- update: Fr(function() {
966
- return new Promise(function(v) {
967
- u.forceUpdate(), v(p);
968
- });
969
- }),
970
- destroy: function() {
971
- g(), y = !0;
972
- }
973
- };
974
- if (!bt(l, s))
975
- return process.env.NODE_ENV !== "production" && console.error(gt), u;
976
- u.setOptions(f).then(function(v) {
977
- !y && f.onFirstUpdate && f.onFirstUpdate(v);
978
- });
979
- function O() {
980
- p.orderedModifiers.forEach(function(v) {
981
- var w = v.name, C = v.options, x = C === void 0 ? {} : C, d = v.effect;
982
- if (typeof d == "function") {
983
- var m = d({
984
- state: p,
985
- name: w,
986
- instance: u,
987
- options: x
988
- }), c = function() {
989
- };
990
- h.push(m || c);
991
- }
992
- });
993
- }
994
- function g() {
995
- h.forEach(function(v) {
996
- return v();
997
- }), h = [];
998
- }
999
- return u;
1000
- };
1001
- }
1002
- var Gr = [vr, Rr, dr, tr, Dr, Pr, zr, lr, Sr], Jr = /* @__PURE__ */ Kr({
1003
- defaultModifiers: Gr
1004
- });
1005
- const Qr = {
1006
- props: {
1007
- componentPrefix: String,
1008
- size: String,
1009
- sizePrefix: String
1010
- },
1011
- computed: {
1012
- sizeableClassPrefix() {
1013
- return this.sizePrefix || this.componentPrefix;
1014
- },
1015
- hasSizeablePrefix() {
1016
- return this.size === void 0 ? !1 : !!this.size.match(new RegExp(`^${this.sizeableClassPrefix}`));
1017
- },
1018
- sizeableClass() {
1019
- return this.size ? !this.sizeableClassPrefix || this.hasSizeablePrefix ? this.size : `${this.sizeableClassPrefix}-${this.size}` : "";
1020
- }
1021
- }
1022
- }, Zr = {
1023
- props: {
1024
- componentPrefix: String,
1025
- variant: String,
1026
- variantPrefix: String
1027
- },
1028
- computed: {
1029
- variantClassPrefix() {
1030
- return this.variantPrefix || this.componentPrefix;
1031
- },
1032
- hasVariantPrefix() {
1033
- return this.variant === void 0 ? !1 : !!this.variant.match(new RegExp(`^${this.variantClassPrefix}`));
1034
- },
1035
- variantClass() {
1036
- return this.variant ? !this.variantClassPrefix || this.hasVariantPrefix ? this.variant : `${this.variantClassPrefix}-${this.variant}` : "";
1037
- }
1038
- }
1039
- }, _r = U({
1040
- mixins: [Qr, Zr],
1041
- props: {
1042
- active: Boolean,
1043
- block: Boolean,
1044
- componentPrefix: {
1045
- type: String,
1046
- default: "btn"
1047
- },
1048
- disabled: Boolean,
1049
- label: String,
1050
- outline: Boolean,
1051
- tag: String,
1052
- variant: {
1053
- type: String,
1054
- default: "primary"
1055
- }
1056
- },
1057
- computed: {
1058
- classes() {
1059
- return ["btn", this.variantClass, this.sizeableClass, this.active && "active", this.block && "btn-block", this.disabled && "disabled"];
1060
- },
1061
- component() {
1062
- return this.tag ? this.tag : this.$attrs.href ? "a" : "button";
1063
- },
1064
- variantClassPrefix() {
1065
- return (this.variantPrefix || this.componentPrefix) + (this.outline ? "-outline" : "");
1066
- }
1067
- }
1068
- }), en = (e, t) => {
1069
- const r = e.__vccOpts || e;
1070
- for (const [n, o] of t)
1071
- r[n] = o;
1072
- return r;
1073
- };
1074
- function tn(e, t, r, n, o, i) {
1075
- return W(), te(Ue(e.component), me(e.$attrs, {
1076
- disabled: e.disabled,
1077
- class: e.classes,
1078
- role: "button"
1079
- }), {
1080
- default: B(() => [P(e.$slots, "default", {}, () => [be(ye(e.label), 1)])]),
1081
- _: 3
1082
- }, 16, ["disabled", "class"]);
1083
- }
1084
- const rn = /* @__PURE__ */ en(_r, [["render", tn]]), nn = U({
1085
- props: {
1086
- componentPrefix: String,
1087
- size: String,
1088
- sizePrefix: String
1089
- },
1090
- computed: {
1091
- sizeableClassPrefix() {
1092
- return this.sizePrefix || this.componentPrefix;
1093
- },
1094
- hasSizeablePrefix() {
1095
- return this.size === void 0 ? !1 : !!this.size.match(new RegExp(`^${this.sizeableClassPrefix}`));
1096
- },
1097
- sizeableClass() {
1098
- return this.size ? !this.sizeableClassPrefix || this.hasSizeablePrefix ? this.size : `${this.sizeableClassPrefix}-${this.size}` : "";
1099
- }
1100
- }
1101
- }), on = U({
1102
- name: "BtnGroup",
1103
- mixins: [nn],
1104
- props: {
1105
- /**
1106
- * The size prefix.
1107
- *
1108
- * @param {String}
1109
- */
1110
- sizePrefix: {
1111
- type: String,
1112
- default() {
1113
- return "btn-group";
1114
- }
1115
- },
1116
- /**
1117
- * Denote the button group as toggle buttons
1118
- *
1119
- * @type {Boolean}
1120
- */
1121
- toggle: Boolean,
1122
- /**
1123
- * Display the buttons vertically
1124
- *
1125
- * @type {Boolean}
1126
- */
1127
- vertical: Boolean
1128
- },
1129
- computed: {
1130
- classes() {
1131
- return {
1132
- "btn-group": !this.vertical,
1133
- "btn-group-toggle": this.toggle,
1134
- "btn-group-vertical": this.vertical,
1135
- [this.sizeableClass]: !!this.size
1136
- };
1137
- }
1138
- }
1139
- }), an = (e, t) => {
1140
- const r = e.__vccOpts || e;
1141
- for (const [n, o] of t)
1142
- r[n] = o;
1143
- return r;
1144
- }, sn = ["data-toggle"];
1145
- function ln(e, t, r, n, o, i) {
1146
- return W(), Xe("div", {
1147
- class: F(e.classes),
1148
- "data-toggle": e.toggle ? "buttons" : !1,
1149
- role: "group"
1150
- }, [P(e.$slots, "default")], 10, sn);
1151
- }
1152
- const pn = /* @__PURE__ */ an(on, [["render", ln]]);
1153
- U({
1154
- name: "BtnGroupToggle"
1155
- });
1156
- function qe(e, t) {
1157
- e.props.class = `${e.props.class || ""} ${t}`.trim();
1158
- }
1159
- function Dt(e) {
1160
- for (const t of e) {
1161
- t.type === Vt && Dt(t.children), t.props = Object.assign({
1162
- class: void 0
1163
- }, t.props), t.attrs = Object.assign({}, t.attrs), t.attrs.on || (t.attrs.on = {});
1164
- const r = t.props.class && t.props.class.match(/dropdown-item/), n = t.props.class && t.props.class.match(/dropdown-divider/);
1165
- typeof t.type == "string" && t.type.match(/^h\d$/) ? qe(t, "dropdown-header") : t.type === "hr" && !n ? (t.type = "div", qe(t, "dropdown-divider")) : !r && !n && qe(t, "dropdown-item");
1166
- }
1167
- return e;
1168
- }
1169
- const fn = (e, t) => Lt("div", {}, Dt(t.slots.default())), un = U({
1170
- name: "DropdownMenu",
1171
- components: {
1172
- DropdownMenuItems: fn
1173
- },
1174
- props: {
1175
- /**
1176
- * Display the dropdown menu aligned left or right
1177
- *
1178
- * @property String
1179
- */
1180
- align: {
1181
- type: String,
1182
- default: "left",
1183
- validate(e) {
1184
- return ["left", "right"].indexOf(e.toLowerCase()) !== -1;
1185
- }
1186
- },
1187
- /**
1188
- * The default visibility of the dropdown menu.
1189
- *
1190
- * @property Object
1191
- */
1192
- show: Boolean
1193
- }
1194
- }), dn = (e, t) => {
1195
- const r = e.__vccOpts || e;
1196
- for (const [n, o] of t)
1197
- r[n] = o;
1198
- return r;
1199
- }, cn = ["aria-labelledby"];
1200
- function vn(e, t, r, n, o, i) {
1201
- const a = re("dropdown-menu-items");
1202
- return W(), Xe("div", {
1203
- class: F(["dropdown-menu", {
1204
- "dropdown-menu-left": e.align === "left",
1205
- "dropdown-menu-right": e.align === "right",
1206
- show: e.show
1207
- }]),
1208
- "aria-labelledby": e.$attrs.id
1209
- }, [we(a, null, {
1210
- default: B(() => [P(e.$slots, "default")]),
1211
- _: 3
1212
- })], 10, cn);
1213
- }
1214
- const hn = /* @__PURE__ */ dn(un, [["render", vn]]), gn = U({
1215
- props: {
1216
- expanded: {
1217
- type: Boolean,
1218
- default: !1
1219
- },
1220
- id: {
1221
- type: String,
1222
- default: void 0
1223
- },
1224
- href: {
1225
- type: String,
1226
- default: void 0
1227
- },
1228
- to: {
1229
- type: [String, Object],
1230
- default: void 0
1231
- }
1232
- },
1233
- computed: {
1234
- is() {
1235
- return this.to ? "router-link" : this.href ? "a" : "button";
1236
- }
1237
- }
1238
- }), Ne = (e, t) => {
1239
- const r = e.__vccOpts || e;
1240
- for (const [n, o] of t)
1241
- r[n] = o;
1242
- return r;
1243
- };
1244
- function mn(e, t, r, n, o, i) {
1245
- return W(), te(Ue(e.is), me({ id: e.id }, e.to ? { to: e.to } : { href: e.href }, {
1246
- "aria-haspopup": "true",
1247
- "aria-expanded": e.expanded,
1248
- type: e.is === "button" ? "button" : void 0
1249
- }), {
1250
- default: B(() => [
1251
- P(e.$slots, "default")
1252
- ]),
1253
- _: 3
1254
- }, 16, ["id", "aria-expanded", "type"]);
1255
- }
1256
- const bn = /* @__PURE__ */ Ne(gn, [["render", mn]]), At = {
1257
- components: {
1258
- BtnDropdownAction: bn,
1259
- BtnGroup: pn,
1260
- DropdownMenu: hn
1261
- },
1262
- extends: rn,
1263
- emits: [
1264
- "click-toggle",
1265
- "show",
1266
- "hide",
1267
- "toggle"
1268
- ],
1269
- props: {
1270
- /**
1271
- * Display the dropdown menu aligned left or right
1272
- *
1273
- * @property String
1274
- */
1275
- align: {
1276
- type: String,
1277
- default: "left",
1278
- validate(e) {
1279
- return ["left", "right"].indexOf(e.toLowerCase()) !== -1;
1280
- }
1281
- },
1282
- /**
1283
- * Should animate the dropdown opening.
1284
- *
1285
- * @property {Boolean}
1286
- */
1287
- animated: {
1288
- type: Boolean,
1289
- default: !0
1290
- },
1291
- /**
1292
- * Additional button classes.
1293
- *
1294
- * @property {Object|String}
1295
- */
1296
- buttonClass: [Object, String],
1297
- /**
1298
- * Show the caret.
1299
- *
1300
- * @property {Boolean}
1301
- */
1302
- caret: {
1303
- type: Boolean,
1304
- default: !0
1305
- },
1306
- /**
1307
- * Should display the toggle button as a circle.
1308
- *
1309
- * @property Boolean
1310
- */
1311
- // circle: {
1312
- // type: Boolean,
1313
- // default: false
1314
- // },
1315
- /**
1316
- * Display as a dropup instead of a dropdown.
1317
- *
1318
- * @property Boolean
1319
- */
1320
- dropup: {
1321
- type: Boolean,
1322
- default: !1
1323
- },
1324
- /**
1325
- * Display as a dropright instead of a dropdown.
1326
- *
1327
- * @property Boolean
1328
- */
1329
- dropright: {
1330
- type: Boolean,
1331
- default: !1
1332
- },
1333
- /**
1334
- * Display as a dropleft instead of a dropdown.
1335
- *
1336
- * @property Boolean
1337
- */
1338
- dropleft: {
1339
- type: Boolean,
1340
- default: !1
1341
- },
1342
- /**
1343
- * The action height.
1344
- *
1345
- * @property {String}
1346
- */
1347
- height: String,
1348
- /**
1349
- * The href action.
1350
- *
1351
- * @property {String}
1352
- */
1353
- href: String,
1354
- /**
1355
- * Is the dropdown a nav item?
1356
- *
1357
- * @property {Boolean}
1358
- */
1359
- nav: Boolean,
1360
- /**
1361
- * The toggle button's label. If not defined as an attribute,
1362
- * you can override with the component's slot (inner html).
1363
- *
1364
- * @property {String}
1365
- */
1366
- label: String,
1367
- offset: {
1368
- type: Number,
1369
- default: 5
1370
- },
1371
- /**
1372
- * Should rotate the toggle button when opened.
1373
- *
1374
- * @property {Boolean}
1375
- */
1376
- rotate: {
1377
- type: Boolean,
1378
- default: !1
1379
- },
1380
- /**
1381
- * Display the dropdown button with a split toggle button.
1382
- *
1383
- * @property {Boolean}
1384
- */
1385
- split: {
1386
- type: Boolean,
1387
- default: !1
1388
- },
1389
- /**
1390
- * The "to" path, used for vue-router.
1391
- *
1392
- * @property {String|Object}
1393
- */
1394
- to: [String, Object],
1395
- /**
1396
- * The button type attribute.
1397
- *
1398
- * @property {String}
1399
- */
1400
- type: {
1401
- type: String,
1402
- default: "button"
1403
- },
1404
- /**
1405
- * The action width.
1406
- *
1407
- * @property {String}
1408
- */
1409
- width: String
1410
- },
1411
- data() {
1412
- return {
1413
- popper: null,
1414
- triggerAnimation: !1,
1415
- expanded: !1
1416
- };
1417
- },
1418
- computed: {
1419
- scope() {
1420
- return {
1421
- // Pass the computed props.
1422
- placement: this.placement,
1423
- variantClassPrefix: this.variantClassPrefix,
1424
- sizeableClassPrefix: this.sizeableClassPrefix,
1425
- classes: this.classes,
1426
- actionClasses: this.actionClasses,
1427
- toggleStyle: this.toggleStyle,
1428
- toggleClasses: this.toggleClasses,
1429
- // Pass the methods
1430
- focus: this.focus,
1431
- queryFocusable: this.queryFocusable,
1432
- isFocusable: this.isFocusable,
1433
- toggle: this.toggle,
1434
- show: this.show,
1435
- hide: this.hide,
1436
- onBlur: this.onBlur,
1437
- onClickItem: this.onClickItem,
1438
- onClickToggle: this.onClickToggle,
1439
- expanded: this.expanded
1440
- };
1441
- },
1442
- placement() {
1443
- return this.dropup ? "top" : this.dropleft ? "left" : this.dropright ? "right" : "bottom";
1444
- },
1445
- variantClassPrefix() {
1446
- return "btn" + (this.outline ? "-outline" : "");
1447
- },
1448
- sizeableClassPrefix() {
1449
- return "btn";
1450
- },
1451
- classes() {
1452
- return {
1453
- dropdown: this.dropup && this.dropright && this.dropleft,
1454
- dropup: this.dropup,
1455
- dropright: this.dropright,
1456
- dropleft: this.dropleft,
1457
- "icon-only": !this.nav && !this.split && !!this.$slots.icon && !this.$slots.label,
1458
- "hide-caret": !this.caret,
1459
- expanded: this.expanded,
1460
- "rotate-90": !this.nav && this.split && this.rotate && this.expanded
1461
- };
1462
- },
1463
- actionClasses() {
1464
- return Object.assign({
1465
- btn: !this.nav,
1466
- [this.variantClass]: !this.nav && !!this.variant,
1467
- [this.sizeableClass]: !!this.size
1468
- }, typeof this.buttonClass == "object" ? this.buttonClass : {
1469
- [this.buttonClass]: !!this.buttonClass
1470
- });
1471
- },
1472
- toggleStyle() {
1473
- return {
1474
- width: this.width,
1475
- height: this.height
1476
- };
1477
- },
1478
- toggleClasses() {
1479
- return Object.assign({
1480
- active: this.active,
1481
- btn: !this.nav,
1482
- "btn-block": !!this.block,
1483
- "nav-link": !!this.nav,
1484
- "rotate-90": !this.split && this.rotate && this.expanded,
1485
- "dropdown-toggle": !0,
1486
- "dropdown-toggle-split": !this.nav && this.split,
1487
- [this.variantClass]: !this.nav && !!this.variant,
1488
- [this.sizeableClass]: !!this.size
1489
- }, typeof this.buttonClass == "object" ? this.buttonClass : {
1490
- [this.buttonClass]: !!this.buttonClass
1491
- });
1492
- }
1493
- },
1494
- beforeUnmount() {
1495
- this.popper && this.popper.destroy();
1496
- },
1497
- methods: {
1498
- /**
1499
- * Focus on the the dropdown toggle button
1500
- *
1501
- * @return void
1502
- */
1503
- focus() {
1504
- this.$el.querySelector(".dropdown-toggle").focus();
1505
- },
1506
- /**
1507
- * Focus on the the dropdown toggle button
1508
- *
1509
- * @return void
1510
- */
1511
- queryFocusable() {
1512
- return this.$el.querySelector(".dropdown-menu").querySelectorAll('label, input, select, textarea, [tabindex]:not([tabindex="-1"])');
1513
- },
1514
- /**
1515
- * Method to check if the given element is focusable.
1516
- *
1517
- * @return void
1518
- */
1519
- isFocusable(e) {
1520
- const t = this.queryFocusable();
1521
- for (const r in t)
1522
- if (e === t[r])
1523
- return !0;
1524
- return !1;
1525
- },
1526
- /**
1527
- * Toggle the dropdown menu
1528
- *
1529
- * @return void
1530
- */
1531
- toggle() {
1532
- this.expanded ? this.hide() : this.show();
1533
- },
1534
- /**
1535
- * Show the dropdown menu
1536
- *
1537
- * @return void
1538
- */
1539
- show() {
1540
- this.expanded = !0;
1541
- const e = this.$refs.split && this.$refs.split.$el || this.$el;
1542
- !this.nav && !this.popper ? this.popper = Jr(e, this.$refs.menu.$el, {
1543
- placement: `${this.placement}-${this.align === "left" ? "start" : "end"}`,
1544
- onFirstUpdate: () => {
1545
- this.triggerAnimation = this.animated;
1546
- },
1547
- modifiers: [
1548
- {
1549
- name: "offset",
1550
- options: {
1551
- offset: [0, this.nav ? 1 : this.offset]
1552
- // offset: ['.125rem', !this.nav ? 4 : 1],
1553
- }
1554
- }
1555
- ]
1556
- }) : this.popper && this.popper.update();
1557
- },
1558
- /**
1559
- * Hide the dropdown menu
1560
- *
1561
- * @return void
1562
- */
1563
- hide() {
1564
- this.expanded = !1;
1565
- },
1566
- /**
1567
- * A callback function for the `blur-item` event.
1568
- *
1569
- * @return void
1570
- */
1571
- onBlur(e) {
1572
- (!this.$refs.menu.$el.contains(e.relatedTarget) || !this.$el.contains(e.relatedTarget)) && this.hide();
1573
- },
1574
- onClickDocument(e) {
1575
- this.$el.contains(e.target) || this.hide();
1576
- },
1577
- /**
1578
- * A callback function for the `click-item` event.
1579
- *
1580
- * @return void
1581
- */
1582
- onClickItem(e) {
1583
- this.isFocusable(e.target) || this.hide();
1584
- },
1585
- /**
1586
- * A callback function for the `click-toggle` event.
1587
- *
1588
- * @return void
1589
- */
1590
- onClickToggle(e) {
1591
- e.target.dispatchEvent(new Event("focus", e)), this.$emit("click-toggle", e), e.defaultPrevented || this.toggle();
1592
- },
1593
- onKeydown(e) {
1594
- e.target.parentElement.lastElementChild === e.target && this.hide();
1595
- }
1596
- },
1597
- watch: {
1598
- expanded(e) {
1599
- this.$nextTick(() => {
1600
- this.$emit(e ? "show" : "hide"), this.$emit("toggle", e);
1601
- }), setTimeout(() => {
1602
- e ? document.addEventListener("click", this.onClickDocument) : document.removeEventListener("click", this.onClickDocument);
1603
- });
1604
- }
1605
- }
1606
- }, yn = U({
1607
- mixins: [
1608
- At
1609
- ]
1610
- });
1611
- function wn(e, t, r, n, o, i) {
1612
- const a = re("btn-dropdown-action"), l = re("dropdown-menu"), s = re("btn-group");
1613
- return W(), te(s, {
1614
- class: F(e.classes)
1615
- }, {
1616
- default: B(() => [
1617
- P(e.$slots, "button", ae(Re(e.scope)), () => [
1618
- we(a, {
1619
- id: e.$attrs.id,
1620
- ref: "button",
1621
- expanded: e.expanded,
1622
- href: e.href,
1623
- to: e.to,
1624
- style: It(e.toggleStyle),
1625
- class: F(e.toggleClasses),
1626
- onBlur: e.onBlur,
1627
- onClick: e.onClickToggle
1628
- }, {
1629
- default: B(() => [
1630
- P(e.$slots, "icon"),
1631
- P(e.$slots, "label", {}, () => [
1632
- be(ye(e.label), 1)
1633
- ])
1634
- ]),
1635
- _: 3
1636
- }, 8, ["id", "expanded", "href", "to", "style", "class", "onBlur", "onClick"])
1637
- ]),
1638
- we(l, {
1639
- id: e.$attrs.id,
1640
- ref: "menu",
1641
- align: e.align,
1642
- show: e.expanded,
1643
- class: F({ animated: e.triggerAnimation }),
1644
- onBlur: e.onBlur,
1645
- onClick: e.onClickItem,
1646
- onKeydown: yt(e.onKeydown, ["tab"]),
1647
- onMousedown: t[0] || (t[0] = wt(() => {
1648
- }, ["prevent"]))
1649
- }, {
1650
- default: B(() => [
1651
- P(e.$slots, "default")
1652
- ]),
1653
- _: 3
1654
- }, 8, ["id", "align", "show", "class", "onBlur", "onClick", "onKeydown"])
1655
- ]),
1656
- _: 3
1657
- }, 8, ["class"]);
1658
- }
1659
- const On = /* @__PURE__ */ Ne(yn, [["render", wn]]), $n = U({
1660
- mixins: [
1661
- At
1662
- ],
1663
- emits: [
1664
- "click"
1665
- ]
1666
- }), xn = ["id", "aria-expanded"];
1667
- function Cn(e, t, r, n, o, i) {
1668
- const a = re("btn-dropdown-action"), l = re("dropdown-menu"), s = re("btn-group");
1669
- return W(), te(s, {
1670
- class: F([e.classes, "btn-dropdown-split"])
1671
- }, {
1672
- default: B(() => [
1673
- e.dropleft ? ce("", !0) : P(e.$slots, "button", ae(me({ key: 0 }, e.scope)), () => [
1674
- e.dropleft ? ce("", !0) : (W(), te(a, {
1675
- key: 0,
1676
- id: e.$attrs.id,
1677
- ref: "button",
1678
- expanded: e.expanded,
1679
- href: e.href,
1680
- to: e.to,
1681
- class: F(e.actionClasses),
1682
- onClick: t[0] || (t[0] = (f) => e.$emit("click", f))
1683
- }, {
1684
- default: B(() => [
1685
- P(e.$slots, "icon"),
1686
- P(e.$slots, "label", {}, () => [
1687
- be(ye(e.label), 1)
1688
- ])
1689
- ]),
1690
- _: 3
1691
- }, 8, ["id", "expanded", "href", "to", "class"]))
1692
- ]),
1693
- we(s, { ref: "split" }, {
1694
- default: B(() => [
1695
- P(e.$slots, "split", ae(Re(e.scope)), () => [
1696
- e.split ? (W(), Xe("button", {
1697
- key: 0,
1698
- id: e.$attrs.id,
1699
- type: "button",
1700
- "aria-haspopup": "true",
1701
- "aria-expanded": e.expanded,
1702
- class: F(e.toggleClasses),
1703
- onBlur: t[1] || (t[1] = (...f) => e.onBlur && e.onBlur(...f)),
1704
- onClick: t[2] || (t[2] = (...f) => e.onClickToggle && e.onClickToggle(...f))
1705
- }, null, 42, xn)) : ce("", !0)
1706
- ]),
1707
- we(l, {
1708
- id: e.$attrs.id,
1709
- ref: "menu",
1710
- align: e.align,
1711
- show: e.expanded,
1712
- class: F({ animated: e.triggerAnimation }),
1713
- onBlur: e.onBlur,
1714
- onClick: e.onClickItem,
1715
- onKeydown: yt(e.onKeydown, ["tab"]),
1716
- onMousedown: t[3] || (t[3] = wt(() => {
1717
- }, ["prevent"]))
1718
- }, {
1719
- default: B(() => [
1720
- P(e.$slots, "default")
1721
- ]),
1722
- _: 3
1723
- }, 8, ["id", "align", "show", "class", "onBlur", "onClick", "onKeydown"])
1724
- ]),
1725
- _: 3
1726
- }, 512),
1727
- e.dropleft ? P(e.$slots, "button", ae(me({ key: 1 }, e.scope)), () => [
1728
- e.dropleft ? (W(), te(a, {
1729
- key: 0,
1730
- id: e.$attrs.id,
1731
- ref: "button",
1732
- expanded: e.expanded,
1733
- href: e.href,
1734
- to: e.to,
1735
- class: F(e.actionClasses),
1736
- onClick: t[4] || (t[4] = (f) => e.$emit("click", f))
1737
- }, {
1738
- default: B(() => [
1739
- P(e.$slots, "icon"),
1740
- P(e.$slots, "label", {}, () => [
1741
- be(ye(e.label), 1)
1742
- ])
1743
- ]),
1744
- _: 3
1745
- }, 8, ["id", "expanded", "href", "to", "class"])) : ce("", !0)
1746
- ]) : ce("", !0)
1747
- ]),
1748
- _: 3
1749
- }, 8, ["class"]);
1750
- }
1751
- const Pn = /* @__PURE__ */ Ne($n, [["render", Cn]]), En = U({
1752
- name: "BtnDropdown",
1753
- components: {
1754
- BtnDropdownSplit: Pn,
1755
- BtnDropdownSingle: On
1756
- },
1757
- inheritAttrs: !1,
1758
- emits: [
1759
- "click",
1760
- "click-toggle",
1761
- "dropdown",
1762
- "show",
1763
- "hide",
1764
- "toggle"
1765
- ]
1766
- });
1767
- function Sn(e, t, r, n, o, i) {
1768
- return W(), te(Ue(e.$attrs.split === void 0 || e.$attrs.nav ? "btn-dropdown-single" : "btn-dropdown-split"), me({ class: "btn-dropdown" }, e.$attrs, {
1769
- onClick: t[0] || (t[0] = (...a) => e.$emit("click", ...a)),
1770
- onClickToggle: t[1] || (t[1] = (...a) => e.$emit("click-toggle", ...a)),
1771
- onDropdown: t[2] || (t[2] = (...a) => e.$emit("dropdown", ...a)),
1772
- onShow: t[3] || (t[3] = (...a) => e.$emit("show", ...a)),
1773
- onHide: t[4] || (t[4] = (...a) => e.$emit("hide", ...a)),
1774
- onToggle: t[5] || (t[5] = (...a) => e.$emit("toggle", ...a))
1775
- }), qt({
1776
- icon: B(() => [
1777
- P(e.$slots, "icon")
1778
- ]),
1779
- button: B((a) => [
1780
- P(e.$slots, "button", ae(Re(a)))
1781
- ]),
1782
- split: B((a) => [
1783
- P(e.$slots, "split", ae(Re(a)))
1784
- ]),
1785
- default: B(() => [
1786
- P(e.$slots, "default")
1787
- ]),
1788
- _: 2
1789
- }, [
1790
- e.$attrs.label || e.$slots.label ? {
1791
- name: "label",
1792
- fn: B(() => [
1793
- P(e.$slots, "label", {}, () => [
1794
- be(ye(e.$attrs.label), 1)
1795
- ])
1796
- ]),
1797
- key: "0"
1798
- } : void 0
1799
- ]), 1040);
1800
- }
1801
- const Bn = /* @__PURE__ */ Ne(En, [["render", Sn]]);
1802
- export {
1803
- Bn as BtnDropdown
1804
- };