energy-components 1.0.2
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/LICENSE +21 -0
- package/README.md +94 -0
- package/dist/.empty +0 -0
- package/dist/components/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/components/accordion.es.js +121 -0
- package/dist/components/accordionGroup.es.js +32 -0
- package/dist/components/actionButton.es.js +64 -0
- package/dist/components/breadcrumbs.es.js +90 -0
- package/dist/components/button.es.js +144 -0
- package/dist/components/checkbox.es.js +130 -0
- package/dist/components/divider.es.js +35 -0
- package/dist/components/dropdown.es.js +331 -0
- package/dist/components/floatingActionButton.es.js +97 -0
- package/dist/components/functions-DIHwdgF0.js +18 -0
- package/dist/components/icon-svg-Cpx09myr.js +10818 -0
- package/dist/components/iconList.es.js +49 -0
- package/dist/components/iconSvg.es.js +5 -0
- package/dist/components/index.es.js +81 -0
- package/dist/components/indicator.es.js +175 -0
- package/dist/components/link.es.js +147 -0
- package/dist/components/multiselect.es.js +1039 -0
- package/dist/components/pagination.es.js +138 -0
- package/dist/components/radioButton.es.js +111 -0
- package/dist/components/style/accordion.css +1 -0
- package/dist/components/style/accordionGroup.css +1 -0
- package/dist/components/style/actionButton.css +1 -0
- package/dist/components/style/breadcrumbs.css +1 -0
- package/dist/components/style/button.css +1 -0
- package/dist/components/style/checkbox.css +1 -0
- package/dist/components/style/divider.css +1 -0
- package/dist/components/style/dropdown.css +1 -0
- package/dist/components/style/floatingActionButton.css +1 -0
- package/dist/components/style/icon-svg.css +1 -0
- package/dist/components/style/iconList.css +1 -0
- package/dist/components/style/indicator.css +1 -0
- package/dist/components/style/link.css +1 -0
- package/dist/components/style/multiselect.css +1 -0
- package/dist/components/style/pagination.css +1 -0
- package/dist/components/style/radioButton.css +1 -0
- package/dist/components/style/switch.css +1 -0
- package/dist/components/style/tabBar.css +1 -0
- package/dist/components/style/tag.css +1 -0
- package/dist/components/style/textArea.css +1 -0
- package/dist/components/style/textField.css +1 -0
- package/dist/components/style/tooltip.css +1 -0
- package/dist/components/switch.es.js +96 -0
- package/dist/components/tabBar.es.js +181 -0
- package/dist/components/tag.es.js +91 -0
- package/dist/components/textArea.es.js +259 -0
- package/dist/components/textField.es.js +254 -0
- package/dist/components/tooltip.es.js +1082 -0
- package/dist/energy-components.es.js +15368 -0
- package/dist/energy-components.umd.js +1 -0
- package/dist/style.css +1 -0
- package/dist/types/src/components/buttons/action-button/action-button.vue.d.ts +100 -0
- package/dist/types/src/components/buttons/button/button.vue.d.ts +196 -0
- package/dist/types/src/components/buttons/constants/buttonDocs.d.ts +1 -0
- package/dist/types/src/components/buttons/constants/buttonPosition.d.ts +1 -0
- package/dist/types/src/components/buttons/constants/socialMedia.d.ts +1 -0
- package/dist/types/src/components/buttons/floating-action-button/floating-action-button.vue.d.ts +136 -0
- package/dist/types/src/components/content/accordion/accordion.vue.d.ts +122 -0
- package/dist/types/src/components/content/acordion-group/accordion-group.d.ts +6 -0
- package/dist/types/src/components/content/acordion-group/accordion-group.vue.d.ts +33 -0
- package/dist/types/src/components/content/divider/divider.vue.d.ts +35 -0
- package/dist/types/src/components/content/tag/tag.vue.d.ts +105 -0
- package/dist/types/src/components/feedback/indicator/indicator.vue.d.ts +100 -0
- package/dist/types/src/components/icon-svg/icon-list.d.ts +11 -0
- package/dist/types/src/components/icon-svg/icon-list.vue.d.ts +2 -0
- package/dist/types/src/components/icon-svg/icon-svg.vue.d.ts +68 -0
- package/dist/types/src/components/index.d.ts +20 -0
- package/dist/types/src/components/input/checkbox/checkbox.vue.d.ts +151 -0
- package/dist/types/src/components/input/dropdown/Multiselect/Multiselect.vue.d.ts +2 -0
- package/dist/types/src/components/input/dropdown/dropdown.vue.d.ts +270 -0
- package/dist/types/src/components/input/radio-button/radio-button.vue.d.ts +114 -0
- package/dist/types/src/components/input/switch/switch.vue.d.ts +104 -0
- package/dist/types/src/components/input/text-area/text-area.vue.d.ts +281 -0
- package/dist/types/src/components/input/text-field/text-field.vue.d.ts +271 -0
- package/dist/types/src/components/navigation/breadcrumbs/breadcrumbs.vue.d.ts +63 -0
- package/dist/types/src/components/navigation/link/link.types.d.ts +15 -0
- package/dist/types/src/components/navigation/link/link.vue.d.ts +175 -0
- package/dist/types/src/components/navigation/pagination/pagination.vue.d.ts +67 -0
- package/dist/types/src/components/navigation/tab-bar/tab-bar.vue.d.ts +132 -0
- package/dist/types/src/components/overlay/tooltip/tooltip.vue.d.ts +118 -0
- package/dist/types/src/helpers/functions.d.ts +3 -0
- package/dist/types/src/helpers/stories.helpers.d.ts +1 -0
- package/dist/types/src/helpers/validation.d.ts +1 -0
- package/dist/types/src/index.d.ts +8 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +156 -0
|
@@ -0,0 +1,1082 @@
|
|
|
1
|
+
import { unref as at, defineComponent as Vt, toRefs as Mt, ref as U, computed as Ft, openBlock as bt, createElementBlock as At, createElementVNode as Z, renderSlot as Ht, normalizeClass as Rt, toDisplayString as Ct, createVNode as jt, createCommentVNode as Yt } from "vue";
|
|
2
|
+
import { R as Xt } from "./icon-svg-Cpx09myr.js";
|
|
3
|
+
import { _ as zt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
import './style/tooltip.css';const X = Math.min, O = Math.max, nt = Math.round, H = (t) => ({
|
|
5
|
+
x: t,
|
|
6
|
+
y: t
|
|
7
|
+
}), It = {
|
|
8
|
+
left: "right",
|
|
9
|
+
right: "left",
|
|
10
|
+
bottom: "top",
|
|
11
|
+
top: "bottom"
|
|
12
|
+
}, Kt = {
|
|
13
|
+
start: "end",
|
|
14
|
+
end: "start"
|
|
15
|
+
};
|
|
16
|
+
function ft(t, e, o) {
|
|
17
|
+
return O(t, X(e, o));
|
|
18
|
+
}
|
|
19
|
+
function J(t, e) {
|
|
20
|
+
return typeof t == "function" ? t(e) : t;
|
|
21
|
+
}
|
|
22
|
+
function j(t) {
|
|
23
|
+
return t.split("-")[0];
|
|
24
|
+
}
|
|
25
|
+
function Q(t) {
|
|
26
|
+
return t.split("-")[1];
|
|
27
|
+
}
|
|
28
|
+
function Tt(t) {
|
|
29
|
+
return t === "x" ? "y" : "x";
|
|
30
|
+
}
|
|
31
|
+
function gt(t) {
|
|
32
|
+
return t === "y" ? "height" : "width";
|
|
33
|
+
}
|
|
34
|
+
function z(t) {
|
|
35
|
+
return ["top", "bottom"].includes(j(t)) ? "y" : "x";
|
|
36
|
+
}
|
|
37
|
+
function ht(t) {
|
|
38
|
+
return Tt(z(t));
|
|
39
|
+
}
|
|
40
|
+
function qt(t, e, o) {
|
|
41
|
+
o === void 0 && (o = !1);
|
|
42
|
+
const n = Q(t), i = ht(t), r = gt(i);
|
|
43
|
+
let s = i === "x" ? n === (o ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
|
|
44
|
+
return e.reference[r] > e.floating[r] && (s = ot(s)), [s, ot(s)];
|
|
45
|
+
}
|
|
46
|
+
function Gt(t) {
|
|
47
|
+
const e = ot(t);
|
|
48
|
+
return [ut(t), e, ut(e)];
|
|
49
|
+
}
|
|
50
|
+
function ut(t) {
|
|
51
|
+
return t.replace(/start|end/g, (e) => Kt[e]);
|
|
52
|
+
}
|
|
53
|
+
function Jt(t, e, o) {
|
|
54
|
+
const n = ["left", "right"], i = ["right", "left"], r = ["top", "bottom"], s = ["bottom", "top"];
|
|
55
|
+
switch (t) {
|
|
56
|
+
case "top":
|
|
57
|
+
case "bottom":
|
|
58
|
+
return o ? e ? i : n : e ? n : i;
|
|
59
|
+
case "left":
|
|
60
|
+
case "right":
|
|
61
|
+
return e ? r : s;
|
|
62
|
+
default:
|
|
63
|
+
return [];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function Qt(t, e, o, n) {
|
|
67
|
+
const i = Q(t);
|
|
68
|
+
let r = Jt(j(t), o === "start", n);
|
|
69
|
+
return i && (r = r.map((s) => s + "-" + i), e && (r = r.concat(r.map(ut)))), r;
|
|
70
|
+
}
|
|
71
|
+
function ot(t) {
|
|
72
|
+
return t.replace(/left|right|bottom|top/g, (e) => It[e]);
|
|
73
|
+
}
|
|
74
|
+
function Ut(t) {
|
|
75
|
+
return {
|
|
76
|
+
top: 0,
|
|
77
|
+
right: 0,
|
|
78
|
+
bottom: 0,
|
|
79
|
+
left: 0,
|
|
80
|
+
...t
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function Et(t) {
|
|
84
|
+
return typeof t != "number" ? Ut(t) : {
|
|
85
|
+
top: t,
|
|
86
|
+
right: t,
|
|
87
|
+
bottom: t,
|
|
88
|
+
left: t
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function it(t) {
|
|
92
|
+
const {
|
|
93
|
+
x: e,
|
|
94
|
+
y: o,
|
|
95
|
+
width: n,
|
|
96
|
+
height: i
|
|
97
|
+
} = t;
|
|
98
|
+
return {
|
|
99
|
+
width: n,
|
|
100
|
+
height: i,
|
|
101
|
+
top: o,
|
|
102
|
+
left: e,
|
|
103
|
+
right: e + n,
|
|
104
|
+
bottom: o + i,
|
|
105
|
+
x: e,
|
|
106
|
+
y: o
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function Ot(t, e, o) {
|
|
110
|
+
let {
|
|
111
|
+
reference: n,
|
|
112
|
+
floating: i
|
|
113
|
+
} = t;
|
|
114
|
+
const r = z(e), s = ht(e), l = gt(s), c = j(e), a = r === "y", f = n.x + n.width / 2 - i.width / 2, u = n.y + n.height / 2 - i.height / 2, p = n[l] / 2 - i[l] / 2;
|
|
115
|
+
let d;
|
|
116
|
+
switch (c) {
|
|
117
|
+
case "top":
|
|
118
|
+
d = {
|
|
119
|
+
x: f,
|
|
120
|
+
y: n.y - i.height
|
|
121
|
+
};
|
|
122
|
+
break;
|
|
123
|
+
case "bottom":
|
|
124
|
+
d = {
|
|
125
|
+
x: f,
|
|
126
|
+
y: n.y + n.height
|
|
127
|
+
};
|
|
128
|
+
break;
|
|
129
|
+
case "right":
|
|
130
|
+
d = {
|
|
131
|
+
x: n.x + n.width,
|
|
132
|
+
y: u
|
|
133
|
+
};
|
|
134
|
+
break;
|
|
135
|
+
case "left":
|
|
136
|
+
d = {
|
|
137
|
+
x: n.x - i.width,
|
|
138
|
+
y: u
|
|
139
|
+
};
|
|
140
|
+
break;
|
|
141
|
+
default:
|
|
142
|
+
d = {
|
|
143
|
+
x: n.x,
|
|
144
|
+
y: n.y
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
switch (Q(e)) {
|
|
148
|
+
case "start":
|
|
149
|
+
d[s] -= p * (o && a ? -1 : 1);
|
|
150
|
+
break;
|
|
151
|
+
case "end":
|
|
152
|
+
d[s] += p * (o && a ? -1 : 1);
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
return d;
|
|
156
|
+
}
|
|
157
|
+
const Zt = async (t, e, o) => {
|
|
158
|
+
const {
|
|
159
|
+
placement: n = "bottom",
|
|
160
|
+
strategy: i = "absolute",
|
|
161
|
+
middleware: r = [],
|
|
162
|
+
platform: s
|
|
163
|
+
} = o, l = r.filter(Boolean), c = await (s.isRTL == null ? void 0 : s.isRTL(e));
|
|
164
|
+
let a = await s.getElementRects({
|
|
165
|
+
reference: t,
|
|
166
|
+
floating: e,
|
|
167
|
+
strategy: i
|
|
168
|
+
}), {
|
|
169
|
+
x: f,
|
|
170
|
+
y: u
|
|
171
|
+
} = Ot(a, n, c), p = n, d = {}, m = 0;
|
|
172
|
+
for (let g = 0; g < l.length; g++) {
|
|
173
|
+
const {
|
|
174
|
+
name: h,
|
|
175
|
+
fn: w
|
|
176
|
+
} = l[g], {
|
|
177
|
+
x,
|
|
178
|
+
y,
|
|
179
|
+
data: b,
|
|
180
|
+
reset: v
|
|
181
|
+
} = await w({
|
|
182
|
+
x: f,
|
|
183
|
+
y: u,
|
|
184
|
+
initialPlacement: n,
|
|
185
|
+
placement: p,
|
|
186
|
+
strategy: i,
|
|
187
|
+
middlewareData: d,
|
|
188
|
+
rects: a,
|
|
189
|
+
platform: s,
|
|
190
|
+
elements: {
|
|
191
|
+
reference: t,
|
|
192
|
+
floating: e
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
f = x ?? f, u = y ?? u, d = {
|
|
196
|
+
...d,
|
|
197
|
+
[h]: {
|
|
198
|
+
...d[h],
|
|
199
|
+
...b
|
|
200
|
+
}
|
|
201
|
+
}, v && m <= 50 && (m++, typeof v == "object" && (v.placement && (p = v.placement), v.rects && (a = v.rects === !0 ? await s.getElementRects({
|
|
202
|
+
reference: t,
|
|
203
|
+
floating: e,
|
|
204
|
+
strategy: i
|
|
205
|
+
}) : v.rects), {
|
|
206
|
+
x: f,
|
|
207
|
+
y: u
|
|
208
|
+
} = Ot(a, p, c)), g = -1);
|
|
209
|
+
}
|
|
210
|
+
return {
|
|
211
|
+
x: f,
|
|
212
|
+
y: u,
|
|
213
|
+
placement: p,
|
|
214
|
+
strategy: i,
|
|
215
|
+
middlewareData: d
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
async function wt(t, e) {
|
|
219
|
+
var o;
|
|
220
|
+
e === void 0 && (e = {});
|
|
221
|
+
const {
|
|
222
|
+
x: n,
|
|
223
|
+
y: i,
|
|
224
|
+
platform: r,
|
|
225
|
+
rects: s,
|
|
226
|
+
elements: l,
|
|
227
|
+
strategy: c
|
|
228
|
+
} = t, {
|
|
229
|
+
boundary: a = "clippingAncestors",
|
|
230
|
+
rootBoundary: f = "viewport",
|
|
231
|
+
elementContext: u = "floating",
|
|
232
|
+
altBoundary: p = !1,
|
|
233
|
+
padding: d = 0
|
|
234
|
+
} = J(e, t), m = Et(d), h = l[p ? u === "floating" ? "reference" : "floating" : u], w = it(await r.getClippingRect({
|
|
235
|
+
element: (o = await (r.isElement == null ? void 0 : r.isElement(h))) == null || o ? h : h.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(l.floating)),
|
|
236
|
+
boundary: a,
|
|
237
|
+
rootBoundary: f,
|
|
238
|
+
strategy: c
|
|
239
|
+
})), x = u === "floating" ? {
|
|
240
|
+
x: n,
|
|
241
|
+
y: i,
|
|
242
|
+
width: s.floating.width,
|
|
243
|
+
height: s.floating.height
|
|
244
|
+
} : s.reference, y = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(l.floating)), b = await (r.isElement == null ? void 0 : r.isElement(y)) ? await (r.getScale == null ? void 0 : r.getScale(y)) || {
|
|
245
|
+
x: 1,
|
|
246
|
+
y: 1
|
|
247
|
+
} : {
|
|
248
|
+
x: 1,
|
|
249
|
+
y: 1
|
|
250
|
+
}, v = it(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
251
|
+
elements: l,
|
|
252
|
+
rect: x,
|
|
253
|
+
offsetParent: y,
|
|
254
|
+
strategy: c
|
|
255
|
+
}) : x);
|
|
256
|
+
return {
|
|
257
|
+
top: (w.top - v.top + m.top) / b.y,
|
|
258
|
+
bottom: (v.bottom - w.bottom + m.bottom) / b.y,
|
|
259
|
+
left: (w.left - v.left + m.left) / b.x,
|
|
260
|
+
right: (v.right - w.right + m.right) / b.x
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
const te = (t) => ({
|
|
264
|
+
name: "arrow",
|
|
265
|
+
options: t,
|
|
266
|
+
async fn(e) {
|
|
267
|
+
const {
|
|
268
|
+
x: o,
|
|
269
|
+
y: n,
|
|
270
|
+
placement: i,
|
|
271
|
+
rects: r,
|
|
272
|
+
platform: s,
|
|
273
|
+
elements: l,
|
|
274
|
+
middlewareData: c
|
|
275
|
+
} = e, {
|
|
276
|
+
element: a,
|
|
277
|
+
padding: f = 0
|
|
278
|
+
} = J(t, e) || {};
|
|
279
|
+
if (a == null)
|
|
280
|
+
return {};
|
|
281
|
+
const u = Et(f), p = {
|
|
282
|
+
x: o,
|
|
283
|
+
y: n
|
|
284
|
+
}, d = ht(i), m = gt(d), g = await s.getDimensions(a), h = d === "y", w = h ? "top" : "left", x = h ? "bottom" : "right", y = h ? "clientHeight" : "clientWidth", b = r.reference[m] + r.reference[d] - p[d] - r.floating[m], v = p[d] - r.reference[d], T = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(a));
|
|
285
|
+
let R = T ? T[y] : 0;
|
|
286
|
+
(!R || !await (s.isElement == null ? void 0 : s.isElement(T))) && (R = l.floating[y] || r.floating[m]);
|
|
287
|
+
const $ = b / 2 - v / 2, E = R / 2 - g[m] / 2 - 1, _ = X(u[w], E), B = X(u[x], E), P = _, V = R - g[m] - B, A = R / 2 - g[m] / 2 + $, K = ft(P, A, V), W = !c.arrow && Q(i) != null && A !== K && r.reference[m] / 2 - (A < P ? _ : B) - g[m] / 2 < 0, L = W ? A < P ? A - P : A - V : 0;
|
|
288
|
+
return {
|
|
289
|
+
[d]: p[d] + L,
|
|
290
|
+
data: {
|
|
291
|
+
[d]: K,
|
|
292
|
+
centerOffset: A - K - L,
|
|
293
|
+
...W && {
|
|
294
|
+
alignmentOffset: L
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
reset: W
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
}), ee = function(t) {
|
|
301
|
+
return t === void 0 && (t = {}), {
|
|
302
|
+
name: "flip",
|
|
303
|
+
options: t,
|
|
304
|
+
async fn(e) {
|
|
305
|
+
var o, n;
|
|
306
|
+
const {
|
|
307
|
+
placement: i,
|
|
308
|
+
middlewareData: r,
|
|
309
|
+
rects: s,
|
|
310
|
+
initialPlacement: l,
|
|
311
|
+
platform: c,
|
|
312
|
+
elements: a
|
|
313
|
+
} = e, {
|
|
314
|
+
mainAxis: f = !0,
|
|
315
|
+
crossAxis: u = !0,
|
|
316
|
+
fallbackPlacements: p,
|
|
317
|
+
fallbackStrategy: d = "bestFit",
|
|
318
|
+
fallbackAxisSideDirection: m = "none",
|
|
319
|
+
flipAlignment: g = !0,
|
|
320
|
+
...h
|
|
321
|
+
} = J(t, e);
|
|
322
|
+
if ((o = r.arrow) != null && o.alignmentOffset)
|
|
323
|
+
return {};
|
|
324
|
+
const w = j(i), x = z(l), y = j(l) === l, b = await (c.isRTL == null ? void 0 : c.isRTL(a.floating)), v = p || (y || !g ? [ot(l)] : Gt(l)), T = m !== "none";
|
|
325
|
+
!p && T && v.push(...Qt(l, g, m, b));
|
|
326
|
+
const R = [l, ...v], $ = await wt(e, h), E = [];
|
|
327
|
+
let _ = ((n = r.flip) == null ? void 0 : n.overflows) || [];
|
|
328
|
+
if (f && E.push($[w]), u) {
|
|
329
|
+
const A = qt(i, s, b);
|
|
330
|
+
E.push($[A[0]], $[A[1]]);
|
|
331
|
+
}
|
|
332
|
+
if (_ = [..._, {
|
|
333
|
+
placement: i,
|
|
334
|
+
overflows: E
|
|
335
|
+
}], !E.every((A) => A <= 0)) {
|
|
336
|
+
var B, P;
|
|
337
|
+
const A = (((B = r.flip) == null ? void 0 : B.index) || 0) + 1, K = R[A];
|
|
338
|
+
if (K)
|
|
339
|
+
return {
|
|
340
|
+
data: {
|
|
341
|
+
index: A,
|
|
342
|
+
overflows: _
|
|
343
|
+
},
|
|
344
|
+
reset: {
|
|
345
|
+
placement: K
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
let W = (P = _.filter((L) => L.overflows[0] <= 0).sort((L, M) => L.overflows[1] - M.overflows[1])[0]) == null ? void 0 : P.placement;
|
|
349
|
+
if (!W)
|
|
350
|
+
switch (d) {
|
|
351
|
+
case "bestFit": {
|
|
352
|
+
var V;
|
|
353
|
+
const L = (V = _.filter((M) => {
|
|
354
|
+
if (T) {
|
|
355
|
+
const F = z(M.placement);
|
|
356
|
+
return F === x || // Create a bias to the `y` side axis due to horizontal
|
|
357
|
+
// reading directions favoring greater width.
|
|
358
|
+
F === "y";
|
|
359
|
+
}
|
|
360
|
+
return !0;
|
|
361
|
+
}).map((M) => [M.placement, M.overflows.filter((F) => F > 0).reduce((F, Bt) => F + Bt, 0)]).sort((M, F) => M[1] - F[1])[0]) == null ? void 0 : V[0];
|
|
362
|
+
L && (W = L);
|
|
363
|
+
break;
|
|
364
|
+
}
|
|
365
|
+
case "initialPlacement":
|
|
366
|
+
W = l;
|
|
367
|
+
break;
|
|
368
|
+
}
|
|
369
|
+
if (i !== W)
|
|
370
|
+
return {
|
|
371
|
+
reset: {
|
|
372
|
+
placement: W
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
return {};
|
|
377
|
+
}
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
async function ne(t, e) {
|
|
381
|
+
const {
|
|
382
|
+
placement: o,
|
|
383
|
+
platform: n,
|
|
384
|
+
elements: i
|
|
385
|
+
} = t, r = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), s = j(o), l = Q(o), c = z(o) === "y", a = ["left", "top"].includes(s) ? -1 : 1, f = r && c ? -1 : 1, u = J(e, t);
|
|
386
|
+
let {
|
|
387
|
+
mainAxis: p,
|
|
388
|
+
crossAxis: d,
|
|
389
|
+
alignmentAxis: m
|
|
390
|
+
} = typeof u == "number" ? {
|
|
391
|
+
mainAxis: u,
|
|
392
|
+
crossAxis: 0,
|
|
393
|
+
alignmentAxis: null
|
|
394
|
+
} : {
|
|
395
|
+
mainAxis: u.mainAxis || 0,
|
|
396
|
+
crossAxis: u.crossAxis || 0,
|
|
397
|
+
alignmentAxis: u.alignmentAxis
|
|
398
|
+
};
|
|
399
|
+
return l && typeof m == "number" && (d = l === "end" ? m * -1 : m), c ? {
|
|
400
|
+
x: d * f,
|
|
401
|
+
y: p * a
|
|
402
|
+
} : {
|
|
403
|
+
x: p * a,
|
|
404
|
+
y: d * f
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
const oe = function(t) {
|
|
408
|
+
return t === void 0 && (t = 0), {
|
|
409
|
+
name: "offset",
|
|
410
|
+
options: t,
|
|
411
|
+
async fn(e) {
|
|
412
|
+
var o, n;
|
|
413
|
+
const {
|
|
414
|
+
x: i,
|
|
415
|
+
y: r,
|
|
416
|
+
placement: s,
|
|
417
|
+
middlewareData: l
|
|
418
|
+
} = e, c = await ne(e, t);
|
|
419
|
+
return s === ((o = l.offset) == null ? void 0 : o.placement) && (n = l.arrow) != null && n.alignmentOffset ? {} : {
|
|
420
|
+
x: i + c.x,
|
|
421
|
+
y: r + c.y,
|
|
422
|
+
data: {
|
|
423
|
+
...c,
|
|
424
|
+
placement: s
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
};
|
|
429
|
+
}, ie = function(t) {
|
|
430
|
+
return t === void 0 && (t = {}), {
|
|
431
|
+
name: "shift",
|
|
432
|
+
options: t,
|
|
433
|
+
async fn(e) {
|
|
434
|
+
const {
|
|
435
|
+
x: o,
|
|
436
|
+
y: n,
|
|
437
|
+
placement: i
|
|
438
|
+
} = e, {
|
|
439
|
+
mainAxis: r = !0,
|
|
440
|
+
crossAxis: s = !1,
|
|
441
|
+
limiter: l = {
|
|
442
|
+
fn: (h) => {
|
|
443
|
+
let {
|
|
444
|
+
x: w,
|
|
445
|
+
y: x
|
|
446
|
+
} = h;
|
|
447
|
+
return {
|
|
448
|
+
x: w,
|
|
449
|
+
y: x
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
},
|
|
453
|
+
...c
|
|
454
|
+
} = J(t, e), a = {
|
|
455
|
+
x: o,
|
|
456
|
+
y: n
|
|
457
|
+
}, f = await wt(e, c), u = z(j(i)), p = Tt(u);
|
|
458
|
+
let d = a[p], m = a[u];
|
|
459
|
+
if (r) {
|
|
460
|
+
const h = p === "y" ? "top" : "left", w = p === "y" ? "bottom" : "right", x = d + f[h], y = d - f[w];
|
|
461
|
+
d = ft(x, d, y);
|
|
462
|
+
}
|
|
463
|
+
if (s) {
|
|
464
|
+
const h = u === "y" ? "top" : "left", w = u === "y" ? "bottom" : "right", x = m + f[h], y = m - f[w];
|
|
465
|
+
m = ft(x, m, y);
|
|
466
|
+
}
|
|
467
|
+
const g = l.fn({
|
|
468
|
+
...e,
|
|
469
|
+
[p]: d,
|
|
470
|
+
[u]: m
|
|
471
|
+
});
|
|
472
|
+
return {
|
|
473
|
+
...g,
|
|
474
|
+
data: {
|
|
475
|
+
x: g.x - o,
|
|
476
|
+
y: g.y - n,
|
|
477
|
+
enabled: {
|
|
478
|
+
[p]: r,
|
|
479
|
+
[u]: s
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
}, se = function(t) {
|
|
486
|
+
return t === void 0 && (t = {}), {
|
|
487
|
+
name: "size",
|
|
488
|
+
options: t,
|
|
489
|
+
async fn(e) {
|
|
490
|
+
var o, n;
|
|
491
|
+
const {
|
|
492
|
+
placement: i,
|
|
493
|
+
rects: r,
|
|
494
|
+
platform: s,
|
|
495
|
+
elements: l
|
|
496
|
+
} = e, {
|
|
497
|
+
apply: c = () => {
|
|
498
|
+
},
|
|
499
|
+
...a
|
|
500
|
+
} = J(t, e), f = await wt(e, a), u = j(i), p = Q(i), d = z(i) === "y", {
|
|
501
|
+
width: m,
|
|
502
|
+
height: g
|
|
503
|
+
} = r.floating;
|
|
504
|
+
let h, w;
|
|
505
|
+
u === "top" || u === "bottom" ? (h = u, w = p === (await (s.isRTL == null ? void 0 : s.isRTL(l.floating)) ? "start" : "end") ? "left" : "right") : (w = u, h = p === "end" ? "top" : "bottom");
|
|
506
|
+
const x = g - f.top - f.bottom, y = m - f.left - f.right, b = X(g - f[h], x), v = X(m - f[w], y), T = !e.middlewareData.shift;
|
|
507
|
+
let R = b, $ = v;
|
|
508
|
+
if ((o = e.middlewareData.shift) != null && o.enabled.x && ($ = y), (n = e.middlewareData.shift) != null && n.enabled.y && (R = x), T && !p) {
|
|
509
|
+
const _ = O(f.left, 0), B = O(f.right, 0), P = O(f.top, 0), V = O(f.bottom, 0);
|
|
510
|
+
d ? $ = m - 2 * (_ !== 0 || B !== 0 ? _ + B : O(f.left, f.right)) : R = g - 2 * (P !== 0 || V !== 0 ? P + V : O(f.top, f.bottom));
|
|
511
|
+
}
|
|
512
|
+
await c({
|
|
513
|
+
...e,
|
|
514
|
+
availableWidth: $,
|
|
515
|
+
availableHeight: R
|
|
516
|
+
});
|
|
517
|
+
const E = await s.getDimensions(l.floating);
|
|
518
|
+
return m !== E.width || g !== E.height ? {
|
|
519
|
+
reset: {
|
|
520
|
+
rects: !0
|
|
521
|
+
}
|
|
522
|
+
} : {};
|
|
523
|
+
}
|
|
524
|
+
};
|
|
525
|
+
};
|
|
526
|
+
function st() {
|
|
527
|
+
return typeof window < "u";
|
|
528
|
+
}
|
|
529
|
+
function I(t) {
|
|
530
|
+
return xt(t) ? (t.nodeName || "").toLowerCase() : "#document";
|
|
531
|
+
}
|
|
532
|
+
function C(t) {
|
|
533
|
+
var e;
|
|
534
|
+
return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
535
|
+
}
|
|
536
|
+
function N(t) {
|
|
537
|
+
var e;
|
|
538
|
+
return (e = (xt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
539
|
+
}
|
|
540
|
+
function xt(t) {
|
|
541
|
+
return st() ? t instanceof Node || t instanceof C(t).Node : !1;
|
|
542
|
+
}
|
|
543
|
+
function S(t) {
|
|
544
|
+
return st() ? t instanceof Element || t instanceof C(t).Element : !1;
|
|
545
|
+
}
|
|
546
|
+
function k(t) {
|
|
547
|
+
return st() ? t instanceof HTMLElement || t instanceof C(t).HTMLElement : !1;
|
|
548
|
+
}
|
|
549
|
+
function _t(t) {
|
|
550
|
+
return !st() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof C(t).ShadowRoot;
|
|
551
|
+
}
|
|
552
|
+
function et(t) {
|
|
553
|
+
const {
|
|
554
|
+
overflow: e,
|
|
555
|
+
overflowX: o,
|
|
556
|
+
overflowY: n,
|
|
557
|
+
display: i
|
|
558
|
+
} = D(t);
|
|
559
|
+
return /auto|scroll|overlay|hidden|clip/.test(e + n + o) && !["inline", "contents"].includes(i);
|
|
560
|
+
}
|
|
561
|
+
function re(t) {
|
|
562
|
+
return ["table", "td", "th"].includes(I(t));
|
|
563
|
+
}
|
|
564
|
+
function rt(t) {
|
|
565
|
+
return [":popover-open", ":modal"].some((e) => {
|
|
566
|
+
try {
|
|
567
|
+
return t.matches(e);
|
|
568
|
+
} catch {
|
|
569
|
+
return !1;
|
|
570
|
+
}
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
function yt(t) {
|
|
574
|
+
const e = vt(), o = S(t) ? D(t) : t;
|
|
575
|
+
return o.transform !== "none" || o.perspective !== "none" || (o.containerType ? o.containerType !== "normal" : !1) || !e && (o.backdropFilter ? o.backdropFilter !== "none" : !1) || !e && (o.filter ? o.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((n) => (o.willChange || "").includes(n)) || ["paint", "layout", "strict", "content"].some((n) => (o.contain || "").includes(n));
|
|
576
|
+
}
|
|
577
|
+
function le(t) {
|
|
578
|
+
let e = Y(t);
|
|
579
|
+
for (; k(e) && !G(e); ) {
|
|
580
|
+
if (yt(e))
|
|
581
|
+
return e;
|
|
582
|
+
if (rt(e))
|
|
583
|
+
return null;
|
|
584
|
+
e = Y(e);
|
|
585
|
+
}
|
|
586
|
+
return null;
|
|
587
|
+
}
|
|
588
|
+
function vt() {
|
|
589
|
+
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
590
|
+
}
|
|
591
|
+
function G(t) {
|
|
592
|
+
return ["html", "body", "#document"].includes(I(t));
|
|
593
|
+
}
|
|
594
|
+
function D(t) {
|
|
595
|
+
return C(t).getComputedStyle(t);
|
|
596
|
+
}
|
|
597
|
+
function lt(t) {
|
|
598
|
+
return S(t) ? {
|
|
599
|
+
scrollLeft: t.scrollLeft,
|
|
600
|
+
scrollTop: t.scrollTop
|
|
601
|
+
} : {
|
|
602
|
+
scrollLeft: t.scrollX,
|
|
603
|
+
scrollTop: t.scrollY
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
function Y(t) {
|
|
607
|
+
if (I(t) === "html")
|
|
608
|
+
return t;
|
|
609
|
+
const e = (
|
|
610
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
611
|
+
t.assignedSlot || // DOM Element detected.
|
|
612
|
+
t.parentNode || // ShadowRoot detected.
|
|
613
|
+
_t(t) && t.host || // Fallback.
|
|
614
|
+
N(t)
|
|
615
|
+
);
|
|
616
|
+
return _t(e) ? e.host : e;
|
|
617
|
+
}
|
|
618
|
+
function Pt(t) {
|
|
619
|
+
const e = Y(t);
|
|
620
|
+
return G(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : k(e) && et(e) ? e : Pt(e);
|
|
621
|
+
}
|
|
622
|
+
function dt(t, e, o) {
|
|
623
|
+
var n;
|
|
624
|
+
e === void 0 && (e = []), o === void 0 && (o = !0);
|
|
625
|
+
const i = Pt(t), r = i === ((n = t.ownerDocument) == null ? void 0 : n.body), s = C(i);
|
|
626
|
+
if (r) {
|
|
627
|
+
const l = mt(s);
|
|
628
|
+
return e.concat(s, s.visualViewport || [], et(i) ? i : [], l && o ? dt(l) : []);
|
|
629
|
+
}
|
|
630
|
+
return e.concat(i, dt(i, [], o));
|
|
631
|
+
}
|
|
632
|
+
function mt(t) {
|
|
633
|
+
return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
|
|
634
|
+
}
|
|
635
|
+
function Lt(t) {
|
|
636
|
+
const e = D(t);
|
|
637
|
+
let o = parseFloat(e.width) || 0, n = parseFloat(e.height) || 0;
|
|
638
|
+
const i = k(t), r = i ? t.offsetWidth : o, s = i ? t.offsetHeight : n, l = nt(o) !== r || nt(n) !== s;
|
|
639
|
+
return l && (o = r, n = s), {
|
|
640
|
+
width: o,
|
|
641
|
+
height: n,
|
|
642
|
+
$: l
|
|
643
|
+
};
|
|
644
|
+
}
|
|
645
|
+
function kt(t) {
|
|
646
|
+
return S(t) ? t : t.contextElement;
|
|
647
|
+
}
|
|
648
|
+
function q(t) {
|
|
649
|
+
const e = kt(t);
|
|
650
|
+
if (!k(e))
|
|
651
|
+
return H(1);
|
|
652
|
+
const o = e.getBoundingClientRect(), {
|
|
653
|
+
width: n,
|
|
654
|
+
height: i,
|
|
655
|
+
$: r
|
|
656
|
+
} = Lt(e);
|
|
657
|
+
let s = (r ? nt(o.width) : o.width) / n, l = (r ? nt(o.height) : o.height) / i;
|
|
658
|
+
return (!s || !Number.isFinite(s)) && (s = 1), (!l || !Number.isFinite(l)) && (l = 1), {
|
|
659
|
+
x: s,
|
|
660
|
+
y: l
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
const ce = /* @__PURE__ */ H(0);
|
|
664
|
+
function $t(t) {
|
|
665
|
+
const e = C(t);
|
|
666
|
+
return !vt() || !e.visualViewport ? ce : {
|
|
667
|
+
x: e.visualViewport.offsetLeft,
|
|
668
|
+
y: e.visualViewport.offsetTop
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
function ae(t, e, o) {
|
|
672
|
+
return e === void 0 && (e = !1), !o || e && o !== C(t) ? !1 : e;
|
|
673
|
+
}
|
|
674
|
+
function tt(t, e, o, n) {
|
|
675
|
+
e === void 0 && (e = !1), o === void 0 && (o = !1);
|
|
676
|
+
const i = t.getBoundingClientRect(), r = kt(t);
|
|
677
|
+
let s = H(1);
|
|
678
|
+
e && (n ? S(n) && (s = q(n)) : s = q(t));
|
|
679
|
+
const l = ae(r, o, n) ? $t(r) : H(0);
|
|
680
|
+
let c = (i.left + l.x) / s.x, a = (i.top + l.y) / s.y, f = i.width / s.x, u = i.height / s.y;
|
|
681
|
+
if (r) {
|
|
682
|
+
const p = C(r), d = n && S(n) ? C(n) : n;
|
|
683
|
+
let m = p, g = mt(m);
|
|
684
|
+
for (; g && n && d !== m; ) {
|
|
685
|
+
const h = q(g), w = g.getBoundingClientRect(), x = D(g), y = w.left + (g.clientLeft + parseFloat(x.paddingLeft)) * h.x, b = w.top + (g.clientTop + parseFloat(x.paddingTop)) * h.y;
|
|
686
|
+
c *= h.x, a *= h.y, f *= h.x, u *= h.y, c += y, a += b, m = C(g), g = mt(m);
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
return it({
|
|
690
|
+
width: f,
|
|
691
|
+
height: u,
|
|
692
|
+
x: c,
|
|
693
|
+
y: a
|
|
694
|
+
});
|
|
695
|
+
}
|
|
696
|
+
function fe(t) {
|
|
697
|
+
let {
|
|
698
|
+
elements: e,
|
|
699
|
+
rect: o,
|
|
700
|
+
offsetParent: n,
|
|
701
|
+
strategy: i
|
|
702
|
+
} = t;
|
|
703
|
+
const r = i === "fixed", s = N(n), l = e ? rt(e.floating) : !1;
|
|
704
|
+
if (n === s || l && r)
|
|
705
|
+
return o;
|
|
706
|
+
let c = {
|
|
707
|
+
scrollLeft: 0,
|
|
708
|
+
scrollTop: 0
|
|
709
|
+
}, a = H(1);
|
|
710
|
+
const f = H(0), u = k(n);
|
|
711
|
+
if ((u || !u && !r) && ((I(n) !== "body" || et(s)) && (c = lt(n)), k(n))) {
|
|
712
|
+
const p = tt(n);
|
|
713
|
+
a = q(n), f.x = p.x + n.clientLeft, f.y = p.y + n.clientTop;
|
|
714
|
+
}
|
|
715
|
+
return {
|
|
716
|
+
width: o.width * a.x,
|
|
717
|
+
height: o.height * a.y,
|
|
718
|
+
x: o.x * a.x - c.scrollLeft * a.x + f.x,
|
|
719
|
+
y: o.y * a.y - c.scrollTop * a.y + f.y
|
|
720
|
+
};
|
|
721
|
+
}
|
|
722
|
+
function ue(t) {
|
|
723
|
+
return Array.from(t.getClientRects());
|
|
724
|
+
}
|
|
725
|
+
function pt(t, e) {
|
|
726
|
+
const o = lt(t).scrollLeft;
|
|
727
|
+
return e ? e.left + o : tt(N(t)).left + o;
|
|
728
|
+
}
|
|
729
|
+
function de(t) {
|
|
730
|
+
const e = N(t), o = lt(t), n = t.ownerDocument.body, i = O(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), r = O(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
|
|
731
|
+
let s = -o.scrollLeft + pt(t);
|
|
732
|
+
const l = -o.scrollTop;
|
|
733
|
+
return D(n).direction === "rtl" && (s += O(e.clientWidth, n.clientWidth) - i), {
|
|
734
|
+
width: i,
|
|
735
|
+
height: r,
|
|
736
|
+
x: s,
|
|
737
|
+
y: l
|
|
738
|
+
};
|
|
739
|
+
}
|
|
740
|
+
function me(t, e) {
|
|
741
|
+
const o = C(t), n = N(t), i = o.visualViewport;
|
|
742
|
+
let r = n.clientWidth, s = n.clientHeight, l = 0, c = 0;
|
|
743
|
+
if (i) {
|
|
744
|
+
r = i.width, s = i.height;
|
|
745
|
+
const a = vt();
|
|
746
|
+
(!a || a && e === "fixed") && (l = i.offsetLeft, c = i.offsetTop);
|
|
747
|
+
}
|
|
748
|
+
return {
|
|
749
|
+
width: r,
|
|
750
|
+
height: s,
|
|
751
|
+
x: l,
|
|
752
|
+
y: c
|
|
753
|
+
};
|
|
754
|
+
}
|
|
755
|
+
function pe(t, e) {
|
|
756
|
+
const o = tt(t, !0, e === "fixed"), n = o.top + t.clientTop, i = o.left + t.clientLeft, r = k(t) ? q(t) : H(1), s = t.clientWidth * r.x, l = t.clientHeight * r.y, c = i * r.x, a = n * r.y;
|
|
757
|
+
return {
|
|
758
|
+
width: s,
|
|
759
|
+
height: l,
|
|
760
|
+
x: c,
|
|
761
|
+
y: a
|
|
762
|
+
};
|
|
763
|
+
}
|
|
764
|
+
function St(t, e, o) {
|
|
765
|
+
let n;
|
|
766
|
+
if (e === "viewport")
|
|
767
|
+
n = me(t, o);
|
|
768
|
+
else if (e === "document")
|
|
769
|
+
n = de(N(t));
|
|
770
|
+
else if (S(e))
|
|
771
|
+
n = pe(e, o);
|
|
772
|
+
else {
|
|
773
|
+
const i = $t(t);
|
|
774
|
+
n = {
|
|
775
|
+
...e,
|
|
776
|
+
x: e.x - i.x,
|
|
777
|
+
y: e.y - i.y
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
return it(n);
|
|
781
|
+
}
|
|
782
|
+
function Wt(t, e) {
|
|
783
|
+
const o = Y(t);
|
|
784
|
+
return o === e || !S(o) || G(o) ? !1 : D(o).position === "fixed" || Wt(o, e);
|
|
785
|
+
}
|
|
786
|
+
function ge(t, e) {
|
|
787
|
+
const o = e.get(t);
|
|
788
|
+
if (o)
|
|
789
|
+
return o;
|
|
790
|
+
let n = dt(t, [], !1).filter((l) => S(l) && I(l) !== "body"), i = null;
|
|
791
|
+
const r = D(t).position === "fixed";
|
|
792
|
+
let s = r ? Y(t) : t;
|
|
793
|
+
for (; S(s) && !G(s); ) {
|
|
794
|
+
const l = D(s), c = yt(s);
|
|
795
|
+
!c && l.position === "fixed" && (i = null), (r ? !c && !i : !c && l.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || et(s) && !c && Wt(t, s)) ? n = n.filter((f) => f !== s) : i = l, s = Y(s);
|
|
796
|
+
}
|
|
797
|
+
return e.set(t, n), n;
|
|
798
|
+
}
|
|
799
|
+
function he(t) {
|
|
800
|
+
let {
|
|
801
|
+
element: e,
|
|
802
|
+
boundary: o,
|
|
803
|
+
rootBoundary: n,
|
|
804
|
+
strategy: i
|
|
805
|
+
} = t;
|
|
806
|
+
const s = [...o === "clippingAncestors" ? rt(e) ? [] : ge(e, this._c) : [].concat(o), n], l = s[0], c = s.reduce((a, f) => {
|
|
807
|
+
const u = St(e, f, i);
|
|
808
|
+
return a.top = O(u.top, a.top), a.right = X(u.right, a.right), a.bottom = X(u.bottom, a.bottom), a.left = O(u.left, a.left), a;
|
|
809
|
+
}, St(e, l, i));
|
|
810
|
+
return {
|
|
811
|
+
width: c.right - c.left,
|
|
812
|
+
height: c.bottom - c.top,
|
|
813
|
+
x: c.left,
|
|
814
|
+
y: c.top
|
|
815
|
+
};
|
|
816
|
+
}
|
|
817
|
+
function we(t) {
|
|
818
|
+
const {
|
|
819
|
+
width: e,
|
|
820
|
+
height: o
|
|
821
|
+
} = Lt(t);
|
|
822
|
+
return {
|
|
823
|
+
width: e,
|
|
824
|
+
height: o
|
|
825
|
+
};
|
|
826
|
+
}
|
|
827
|
+
function xe(t, e, o) {
|
|
828
|
+
const n = k(e), i = N(e), r = o === "fixed", s = tt(t, !0, r, e);
|
|
829
|
+
let l = {
|
|
830
|
+
scrollLeft: 0,
|
|
831
|
+
scrollTop: 0
|
|
832
|
+
};
|
|
833
|
+
const c = H(0);
|
|
834
|
+
if (n || !n && !r)
|
|
835
|
+
if ((I(e) !== "body" || et(i)) && (l = lt(e)), n) {
|
|
836
|
+
const d = tt(e, !0, r, e);
|
|
837
|
+
c.x = d.x + e.clientLeft, c.y = d.y + e.clientTop;
|
|
838
|
+
} else i && (c.x = pt(i));
|
|
839
|
+
let a = 0, f = 0;
|
|
840
|
+
if (i && !n && !r) {
|
|
841
|
+
const d = i.getBoundingClientRect();
|
|
842
|
+
f = d.top + l.scrollTop, a = d.left + l.scrollLeft - // RTL <body> scrollbar.
|
|
843
|
+
pt(i, d);
|
|
844
|
+
}
|
|
845
|
+
const u = s.left + l.scrollLeft - c.x - a, p = s.top + l.scrollTop - c.y - f;
|
|
846
|
+
return {
|
|
847
|
+
x: u,
|
|
848
|
+
y: p,
|
|
849
|
+
width: s.width,
|
|
850
|
+
height: s.height
|
|
851
|
+
};
|
|
852
|
+
}
|
|
853
|
+
function ct(t) {
|
|
854
|
+
return D(t).position === "static";
|
|
855
|
+
}
|
|
856
|
+
function Dt(t, e) {
|
|
857
|
+
if (!k(t) || D(t).position === "fixed")
|
|
858
|
+
return null;
|
|
859
|
+
if (e)
|
|
860
|
+
return e(t);
|
|
861
|
+
let o = t.offsetParent;
|
|
862
|
+
return N(t) === o && (o = o.ownerDocument.body), o;
|
|
863
|
+
}
|
|
864
|
+
function Nt(t, e) {
|
|
865
|
+
const o = C(t);
|
|
866
|
+
if (rt(t))
|
|
867
|
+
return o;
|
|
868
|
+
if (!k(t)) {
|
|
869
|
+
let i = Y(t);
|
|
870
|
+
for (; i && !G(i); ) {
|
|
871
|
+
if (S(i) && !ct(i))
|
|
872
|
+
return i;
|
|
873
|
+
i = Y(i);
|
|
874
|
+
}
|
|
875
|
+
return o;
|
|
876
|
+
}
|
|
877
|
+
let n = Dt(t, e);
|
|
878
|
+
for (; n && re(n) && ct(n); )
|
|
879
|
+
n = Dt(n, e);
|
|
880
|
+
return n && G(n) && ct(n) && !yt(n) ? o : n || le(t) || o;
|
|
881
|
+
}
|
|
882
|
+
const ye = async function(t) {
|
|
883
|
+
const e = this.getOffsetParent || Nt, o = this.getDimensions, n = await o(t.floating);
|
|
884
|
+
return {
|
|
885
|
+
reference: xe(t.reference, await e(t.floating), t.strategy),
|
|
886
|
+
floating: {
|
|
887
|
+
x: 0,
|
|
888
|
+
y: 0,
|
|
889
|
+
width: n.width,
|
|
890
|
+
height: n.height
|
|
891
|
+
}
|
|
892
|
+
};
|
|
893
|
+
};
|
|
894
|
+
function ve(t) {
|
|
895
|
+
return D(t).direction === "rtl";
|
|
896
|
+
}
|
|
897
|
+
const be = {
|
|
898
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: fe,
|
|
899
|
+
getDocumentElement: N,
|
|
900
|
+
getClippingRect: he,
|
|
901
|
+
getOffsetParent: Nt,
|
|
902
|
+
getElementRects: ye,
|
|
903
|
+
getClientRects: ue,
|
|
904
|
+
getDimensions: we,
|
|
905
|
+
getScale: q,
|
|
906
|
+
isElement: S,
|
|
907
|
+
isRTL: ve
|
|
908
|
+
}, Ae = oe, Re = ie, Ce = ee, Oe = se, _e = te, Se = (t, e, o) => {
|
|
909
|
+
const n = /* @__PURE__ */ new Map(), i = {
|
|
910
|
+
platform: be,
|
|
911
|
+
...o
|
|
912
|
+
}, r = {
|
|
913
|
+
...i.platform,
|
|
914
|
+
_c: n
|
|
915
|
+
};
|
|
916
|
+
return Zt(t, e, {
|
|
917
|
+
...i,
|
|
918
|
+
platform: r
|
|
919
|
+
});
|
|
920
|
+
};
|
|
921
|
+
function De(t) {
|
|
922
|
+
return t != null && typeof t == "object" && "$el" in t;
|
|
923
|
+
}
|
|
924
|
+
function Te(t) {
|
|
925
|
+
if (De(t)) {
|
|
926
|
+
const e = t.$el;
|
|
927
|
+
return xt(e) && I(e) === "#comment" ? null : e;
|
|
928
|
+
}
|
|
929
|
+
return t;
|
|
930
|
+
}
|
|
931
|
+
function Ee(t) {
|
|
932
|
+
return typeof t == "function" ? t() : at(t);
|
|
933
|
+
}
|
|
934
|
+
function Pe(t) {
|
|
935
|
+
return {
|
|
936
|
+
name: "arrow",
|
|
937
|
+
options: t,
|
|
938
|
+
fn(e) {
|
|
939
|
+
const o = Te(Ee(t.element));
|
|
940
|
+
return o == null ? {} : _e({
|
|
941
|
+
element: o,
|
|
942
|
+
padding: t.padding
|
|
943
|
+
}).fn(e);
|
|
944
|
+
}
|
|
945
|
+
};
|
|
946
|
+
}
|
|
947
|
+
const Le = { class: "rds-tooltip" }, ke = {
|
|
948
|
+
key: 0,
|
|
949
|
+
class: "rds-tooltip__header"
|
|
950
|
+
}, $e = { class: "rds-tooltip__title" }, We = { class: "rds-tooltip__content" }, Ne = /* @__PURE__ */ Vt({
|
|
951
|
+
__name: "tooltip",
|
|
952
|
+
props: {
|
|
953
|
+
/**
|
|
954
|
+
* <span>Título del tooltip</span>
|
|
955
|
+
*/
|
|
956
|
+
title: {
|
|
957
|
+
type: String,
|
|
958
|
+
default: ""
|
|
959
|
+
},
|
|
960
|
+
/**
|
|
961
|
+
* <span>Contenido del tooltip</span>
|
|
962
|
+
*/
|
|
963
|
+
content: {
|
|
964
|
+
type: String,
|
|
965
|
+
default: ""
|
|
966
|
+
},
|
|
967
|
+
/**
|
|
968
|
+
* <span>Posición del tooltip</span>
|
|
969
|
+
*/
|
|
970
|
+
placement: {
|
|
971
|
+
type: String
|
|
972
|
+
},
|
|
973
|
+
/**
|
|
974
|
+
* <span>Espacio de desplazamiento para el tooltip</span>
|
|
975
|
+
*/
|
|
976
|
+
offsetSpace: {
|
|
977
|
+
type: Number,
|
|
978
|
+
default: 8
|
|
979
|
+
},
|
|
980
|
+
/**
|
|
981
|
+
* <span>Especifica si el tooltip es grande</span>
|
|
982
|
+
*/
|
|
983
|
+
large: {
|
|
984
|
+
type: Boolean,
|
|
985
|
+
default: !1
|
|
986
|
+
// Aquí se necesita aclaración, ya que en el original se menciona 'size: 'large'', pero no se define un default para 'large'
|
|
987
|
+
},
|
|
988
|
+
/**
|
|
989
|
+
* <span>Especifica si el tooltip debe ocupar el ancho completo</span>
|
|
990
|
+
*/
|
|
991
|
+
fullWidth: {
|
|
992
|
+
type: Boolean,
|
|
993
|
+
default: !1
|
|
994
|
+
}
|
|
995
|
+
},
|
|
996
|
+
setup(t) {
|
|
997
|
+
const e = t, { large: o, fullWidth: n, title: i } = Mt(e), r = U(), s = U(), l = U(), c = U(!0), a = U(""), f = async () => {
|
|
998
|
+
const { x: m, y: g, middlewareData: h, placement: w } = await Se(
|
|
999
|
+
r.value,
|
|
1000
|
+
s.value,
|
|
1001
|
+
{
|
|
1002
|
+
placement: e.placement,
|
|
1003
|
+
middleware: [
|
|
1004
|
+
Ae(e.offsetSpace),
|
|
1005
|
+
Ce(),
|
|
1006
|
+
Re(),
|
|
1007
|
+
Oe({
|
|
1008
|
+
apply({ availableWidth: v, availableHeight: T, elements: R }) {
|
|
1009
|
+
Object.assign(R.floating.style, {
|
|
1010
|
+
maxWidth: n.value ? `${v}px` : "380px",
|
|
1011
|
+
maxHeight: `${Math.max(0, T)}px`
|
|
1012
|
+
});
|
|
1013
|
+
}
|
|
1014
|
+
}),
|
|
1015
|
+
Pe({
|
|
1016
|
+
element: l.value,
|
|
1017
|
+
padding: o.value ? 16 : 8
|
|
1018
|
+
})
|
|
1019
|
+
]
|
|
1020
|
+
}
|
|
1021
|
+
);
|
|
1022
|
+
Object.assign(s.value.style, {
|
|
1023
|
+
left: `${m}px`,
|
|
1024
|
+
top: `${g}px`
|
|
1025
|
+
});
|
|
1026
|
+
const { x, y } = h.arrow, b = {
|
|
1027
|
+
left: "right",
|
|
1028
|
+
right: "left",
|
|
1029
|
+
bottom: "top",
|
|
1030
|
+
top: "bottom"
|
|
1031
|
+
};
|
|
1032
|
+
a.value = `rds-tooltip__tooltip-arrow--${w}`, Object.assign(l.value.style, {
|
|
1033
|
+
left: x != null ? `${x}px` : "",
|
|
1034
|
+
top: y != null ? `${y}px` : "",
|
|
1035
|
+
bottom: "",
|
|
1036
|
+
right: "",
|
|
1037
|
+
[b[w.split("-")[0]]]: "-4px"
|
|
1038
|
+
});
|
|
1039
|
+
}, u = () => {
|
|
1040
|
+
i != null && i.value || (c.value = !0);
|
|
1041
|
+
}, p = () => {
|
|
1042
|
+
c.value = !1, f();
|
|
1043
|
+
}, d = Ft(() => `rds-tooltip__tooltip ${c.value ? "rds-tooltip__tooltip-hidden " : ""}${o.value || i != null && i.value ? "rds-tooltip__tooltip--large " : ""}${n.value ? "rds-tooltip__tooltip--full-width " : ""}`);
|
|
1044
|
+
return (m, g) => (bt(), At("div", Le, [
|
|
1045
|
+
Z("div", {
|
|
1046
|
+
ref_key: "referenceRef",
|
|
1047
|
+
ref: r,
|
|
1048
|
+
class: "rds-tooltip__trigger",
|
|
1049
|
+
onBlur: u,
|
|
1050
|
+
onFocus: p,
|
|
1051
|
+
onMouseenter: p,
|
|
1052
|
+
onMouseleave: u
|
|
1053
|
+
}, [
|
|
1054
|
+
Ht(m.$slots, "default", {}, void 0, !0)
|
|
1055
|
+
], 544),
|
|
1056
|
+
Z("div", {
|
|
1057
|
+
ref_key: "floatingRef",
|
|
1058
|
+
ref: s,
|
|
1059
|
+
class: Rt(d.value)
|
|
1060
|
+
}, [
|
|
1061
|
+
at(i) ? (bt(), At("div", ke, [
|
|
1062
|
+
Z("h3", $e, Ct(at(i)), 1),
|
|
1063
|
+
jt(Xt, {
|
|
1064
|
+
name: "close",
|
|
1065
|
+
"aria-hidden": "true",
|
|
1066
|
+
class: "rds-tooltip__icon",
|
|
1067
|
+
onClick: g[0] || (g[0] = (h) => c.value = !c.value)
|
|
1068
|
+
})
|
|
1069
|
+
])) : Yt("", !0),
|
|
1070
|
+
Z("div", We, Ct(t.content), 1),
|
|
1071
|
+
Z("div", {
|
|
1072
|
+
ref_key: "arrowRef",
|
|
1073
|
+
ref: l,
|
|
1074
|
+
class: Rt(["rds-tooltip__tooltip-arrow", a.value])
|
|
1075
|
+
}, null, 2)
|
|
1076
|
+
], 2)
|
|
1077
|
+
]));
|
|
1078
|
+
}
|
|
1079
|
+
}), Fe = /* @__PURE__ */ zt(Ne, [["__scopeId", "data-v-e5e6156d"]]);
|
|
1080
|
+
export {
|
|
1081
|
+
Fe as default
|
|
1082
|
+
};
|