@shtabapp/ui-kit 1.65.0 → 1.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/{SColorPicker-Z6lSlByI.cjs → SColorPicker-B_rbs-0d.cjs} +1 -1
- package/dist/{SColorPicker-B8x6qO8A.js → SColorPicker-C_161aLA.js} +3 -3
- package/dist/{SDropdown-LNVnMol3.cjs → SDropdown-B1OGbIYg.cjs} +1 -1
- package/dist/SDropdown-CiXHI3g1.js +362 -0
- package/dist/{SSelect-BLc_92_w.js → SSelect-C3-8vi2u.js} +1 -1
- package/dist/{SSelect-LaTTGKd1.cjs → SSelect-EhvfGB4d.cjs} +1 -1
- package/dist/{STable-CfRGPFmm.js → STable-CADyNvk8.js} +2 -2
- package/dist/{STable-xMxOF84K.cjs → STable-D1x-kIBO.cjs} +1 -1
- package/dist/components/SDropdown/SDropdown.types.d.ts +10 -2
- package/dist/components/SDropdown/SDropdown.types.d.ts.map +1 -1
- package/dist/components/SDropdown/SDropdown.vue.d.ts.map +1 -1
- package/dist/components/SDropdown/index.d.ts +1 -1
- package/dist/components/SDropdown/index.d.ts.map +1 -1
- package/dist/composables/connectedPosition/index.d.ts +1 -1
- package/dist/composables/connectedPosition/index.d.ts.map +1 -1
- package/dist/composables/connectedPosition/types.d.ts +4 -0
- package/dist/composables/connectedPosition/types.d.ts.map +1 -1
- package/dist/composables/useFloatingOverlay.d.ts +2 -1
- package/dist/composables/useFloatingOverlay.d.ts.map +1 -1
- package/dist/entries/color-picker.cjs +1 -1
- package/dist/entries/color-picker.js +1 -1
- package/dist/entries/composables.cjs +1 -1
- package/dist/entries/composables.js +1 -1
- package/dist/entries/dropdown.cjs +1 -1
- package/dist/entries/dropdown.js +2 -2
- package/dist/entries/select.cjs +1 -1
- package/dist/entries/select.js +1 -1
- package/dist/entries/table.cjs +1 -1
- package/dist/entries/table.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +139 -139
- package/dist/uikit-components.css +1 -1
- package/dist/{useFloatingOverlay-QcumEYEq.js → useFloatingOverlay-B1BvRxLz.js} +134 -130
- package/dist/useFloatingOverlay-CtQBdvS9.cjs +1 -0
- package/package.json +1 -1
- package/dist/SDropdown-LOTCtlCX.js +0 -356
- package/dist/useFloatingOverlay-B1UCUYQQ.cjs +0 -1
|
@@ -1,356 +0,0 @@
|
|
|
1
|
-
import { i as e, t } from "./useFloatingOverlay-QcumEYEq.js";
|
|
2
|
-
import { Fragment as n, Teleport as r, Transition as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, defineComponent as u, mergeModels as d, mergeProps as f, nextTick as p, normalizeClass as m, normalizeStyle as h, onBeforeUnmount as g, onScopeDispose as _, openBlock as v, ref as y, renderSlot as b, shallowRef as x, toDisplayString as S, toValue as C, unref as w, useId as T, useModel as E, useSlots as D, useTemplateRef as O, watch as k, withCtx as A, withModifiers as j } from "vue";
|
|
3
|
-
import { useUiKitI18n as M } from "@shtabapp/ui-kit-primitives";
|
|
4
|
-
import { useElementHover as N, useEventListener as P, useMediaQuery as F, useScrollLock as I } from "@vueuse/core";
|
|
5
|
-
//#region src/components/SDropdown/SDropdown.types.ts
|
|
6
|
-
var L = 768, R = (e) => {
|
|
7
|
-
let t = y(e.value), n = y(e.value);
|
|
8
|
-
return k(e, (e) => {
|
|
9
|
-
if (e) {
|
|
10
|
-
t.value = !0, n.value = !0;
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
t.value = !1;
|
|
14
|
-
}, { flush: "sync" }), {
|
|
15
|
-
isPanelShown: t,
|
|
16
|
-
isPanelActive: n,
|
|
17
|
-
handlePanelAfterLeave: () => {
|
|
18
|
-
e.value || (n.value = !1);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
}, ee = (e, t) => {
|
|
22
|
-
let n = F(a(() => `(max-width: ${(C(t) || 768) - .02}px)`));
|
|
23
|
-
return a(() => C(e) && n.value);
|
|
24
|
-
}, te = (e) => {
|
|
25
|
-
if (!e) return null;
|
|
26
|
-
let t = e.getBoundingClientRect();
|
|
27
|
-
if (t.width > 0 || t.height > 0) return e;
|
|
28
|
-
let n = e.firstElementChild;
|
|
29
|
-
return n instanceof HTMLElement ? n : e;
|
|
30
|
-
}, z = {
|
|
31
|
-
OVERDRAG_LIMIT: 50,
|
|
32
|
-
CLOSE_DISTANCE_RATIO: .3,
|
|
33
|
-
CLOSE_DISTANCE_LIMIT: 140,
|
|
34
|
-
CLOSE_VELOCITY: .5,
|
|
35
|
-
SETTLE_TIMEOUT: 400,
|
|
36
|
-
INTERACTIVE_SELECTOR: "button, a[href], input, select, textarea, [role=\"button\"], [contenteditable=\"true\"]"
|
|
37
|
-
}, B = (e) => {
|
|
38
|
-
let t = x(0), n = x(!1), r = x(!1), i = null, o = 0, s = 0, c = 0, l = 0, u = 0, d, f = a(() => n.value || r.value), p = () => {
|
|
39
|
-
clearTimeout(d), d = void 0, r.value = !1;
|
|
40
|
-
}, m = () => {
|
|
41
|
-
r.value = !0, clearTimeout(d), d = setTimeout(p, z.SETTLE_TIMEOUT);
|
|
42
|
-
}, h = () => {
|
|
43
|
-
i = null, t.value = 0, n.value = !1, p();
|
|
44
|
-
}, g = () => C(e.popup)?.offsetHeight ?? 0, v = () => {
|
|
45
|
-
let e = l - o;
|
|
46
|
-
if (e <= 0) return !1;
|
|
47
|
-
let t = u - c;
|
|
48
|
-
return (t > 0 ? (l - s) / t : 0) >= z.CLOSE_VELOCITY ? !0 : e >= Math.min(g() * z.CLOSE_DISTANCE_RATIO, z.CLOSE_DISTANCE_LIMIT);
|
|
49
|
-
}, y = (e) => {
|
|
50
|
-
i === null && (e.pointerType === "mouse" && e.button !== 0 || e.target instanceof Element && e.target.closest(z.INTERACTIVE_SELECTOR) || (i = e.pointerId, o = e.clientY, l = e.clientY, s = e.clientY, u = e.timeStamp, c = e.timeStamp, p(), n.value = !0));
|
|
51
|
-
}, b = (e) => {
|
|
52
|
-
i === e.pointerId && (s = l, c = u, l = e.clientY, u = e.timeStamp, t.value = Math.max(e.clientY - o, -z.OVERDRAG_LIMIT));
|
|
53
|
-
}, S = (a) => {
|
|
54
|
-
if (i === a.pointerId) {
|
|
55
|
-
if (i = null, n.value = !1, v()) {
|
|
56
|
-
r.value = !0, t.value = g() + z.OVERDRAG_LIMIT, e.onClose();
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
if (t.value === 0) {
|
|
60
|
-
p();
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
m(), t.value = 0;
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
return P(() => C(e.handle), "pointerdown", y), P(window, "pointermove", b), P(window, "pointerup", S), P(window, "pointercancel", S), P(() => C(e.popup), "transitionend", (e) => {
|
|
67
|
-
e.propertyName !== "transform" || n.value || t.value !== 0 || p();
|
|
68
|
-
}), _(() => {
|
|
69
|
-
clearTimeout(d);
|
|
70
|
-
}), {
|
|
71
|
-
isActive: f,
|
|
72
|
-
popupStyles: a(() => {
|
|
73
|
-
if (f.value) return {
|
|
74
|
-
transform: `translate3d(0, ${t.value}px, 0)`,
|
|
75
|
-
transition: r.value ? "transform var(--s-ui-transition-duration-slow) var(--s-ui-transition-easing-standard)" : "none"
|
|
76
|
-
};
|
|
77
|
-
}),
|
|
78
|
-
reset: h
|
|
79
|
-
};
|
|
80
|
-
}, V = ["aria-label"], H = { class: "s-ui-dropdown-sheet__side" }, U = { class: "s-ui-dropdown-sheet__title" }, W = { class: "s-ui-dropdown-sheet__side s-ui-dropdown-sheet__side--end" }, G = ["id"], K = /* @__PURE__ */ u({
|
|
81
|
-
__name: "SDropdownSheet",
|
|
82
|
-
props: {
|
|
83
|
-
open: { type: Boolean },
|
|
84
|
-
title: { default: "" },
|
|
85
|
-
dismissOnOverlayClick: {
|
|
86
|
-
type: Boolean,
|
|
87
|
-
default: !0
|
|
88
|
-
},
|
|
89
|
-
dismissOnEscape: {
|
|
90
|
-
type: Boolean,
|
|
91
|
-
default: !0
|
|
92
|
-
},
|
|
93
|
-
contentId: {}
|
|
94
|
-
},
|
|
95
|
-
emits: ["close"],
|
|
96
|
-
setup(e, { emit: t }) {
|
|
97
|
-
let n = t, { t: r } = M(), a = O("popupRef"), u = O("headerRef"), d = () => n("close"), { isActive: f, popupStyles: m, reset: _ } = B({
|
|
98
|
-
handle: u,
|
|
99
|
-
popup: a,
|
|
100
|
-
onClose: d
|
|
101
|
-
}), y = I(() => typeof document > "u" ? null : document.body), x = () => {
|
|
102
|
-
e.dismissOnOverlayClick && d();
|
|
103
|
-
}, C = (e) => {
|
|
104
|
-
f.value && e.stopPropagation();
|
|
105
|
-
}, T = () => _(), E = null, D = () => {
|
|
106
|
-
let e = document.activeElement;
|
|
107
|
-
E = e instanceof HTMLElement ? e : null;
|
|
108
|
-
}, N = async () => {
|
|
109
|
-
await p();
|
|
110
|
-
let e = a.value;
|
|
111
|
-
!e || e.contains(document.activeElement) || e.focus({ preventScroll: !0 });
|
|
112
|
-
}, F = () => {
|
|
113
|
-
let e = E, t = !!a.value?.contains(document.activeElement);
|
|
114
|
-
E = null, !(!t || !e?.isConnected) && e.focus({ preventScroll: !0 });
|
|
115
|
-
};
|
|
116
|
-
return k(() => e.open, (e) => {
|
|
117
|
-
if (y.value = e, e) {
|
|
118
|
-
D(), N();
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
F();
|
|
122
|
-
}, { immediate: !0 }), P(window, "keydown", (t) => {
|
|
123
|
-
!e.open || !e.dismissOnEscape || t.key !== "Escape" || d();
|
|
124
|
-
}), g(() => {
|
|
125
|
-
y.value = !1;
|
|
126
|
-
}), (t, n) => (v(), o(i, {
|
|
127
|
-
name: "s-ui-dropdown-sheet",
|
|
128
|
-
onAfterLeave: T
|
|
129
|
-
}, {
|
|
130
|
-
default: A(() => [e.open ? (v(), c("div", {
|
|
131
|
-
key: 0,
|
|
132
|
-
class: "s-ui-dropdown-sheet",
|
|
133
|
-
onClick: x
|
|
134
|
-
}, [l("div", {
|
|
135
|
-
ref_key: "popupRef",
|
|
136
|
-
ref: a,
|
|
137
|
-
class: "s-ui-dropdown-sheet__popup",
|
|
138
|
-
style: h(w(m)),
|
|
139
|
-
role: "dialog",
|
|
140
|
-
"aria-modal": "true",
|
|
141
|
-
"aria-label": e.title || w(r)("dropdown.sheet"),
|
|
142
|
-
tabindex: "-1",
|
|
143
|
-
onClickCapture: C,
|
|
144
|
-
onClick: n[0] ||= j(() => {}, ["stop"])
|
|
145
|
-
}, [l("header", {
|
|
146
|
-
ref_key: "headerRef",
|
|
147
|
-
ref: u,
|
|
148
|
-
class: "s-ui-dropdown-sheet__header"
|
|
149
|
-
}, [
|
|
150
|
-
n[1] ||= l("span", {
|
|
151
|
-
class: "s-ui-dropdown-sheet__handle",
|
|
152
|
-
"aria-hidden": "true"
|
|
153
|
-
}, null, -1),
|
|
154
|
-
l("div", H, [b(t.$slots, "header-left")]),
|
|
155
|
-
l("div", U, S(e.title), 1),
|
|
156
|
-
l("div", W, [b(t.$slots, "header-right")])
|
|
157
|
-
], 512), l("div", {
|
|
158
|
-
id: e.contentId,
|
|
159
|
-
class: "s-ui-dropdown-sheet__content"
|
|
160
|
-
}, [b(t.$slots, "default")], 8, G)], 44, V)])) : s("", !0)]),
|
|
161
|
-
_: 3
|
|
162
|
-
}));
|
|
163
|
-
}
|
|
164
|
-
}), q = ["id"], ne = ["data-placement"], re = { class: "s-ui-dropdown__content" }, J = /* @__PURE__ */ u({
|
|
165
|
-
inheritAttrs: !1,
|
|
166
|
-
__name: "SDropdown",
|
|
167
|
-
props: /*@__PURE__*/ d({
|
|
168
|
-
placement: { default: () => e.BOTTOM_START },
|
|
169
|
-
offset: { default: 8 },
|
|
170
|
-
flip: {
|
|
171
|
-
type: Boolean,
|
|
172
|
-
default: !0
|
|
173
|
-
},
|
|
174
|
-
shift: {
|
|
175
|
-
type: Boolean,
|
|
176
|
-
default: !1
|
|
177
|
-
},
|
|
178
|
-
matchReferenceWidth: {
|
|
179
|
-
type: Boolean,
|
|
180
|
-
default: !1
|
|
181
|
-
},
|
|
182
|
-
fitViewport: {
|
|
183
|
-
type: Boolean,
|
|
184
|
-
default: !1
|
|
185
|
-
},
|
|
186
|
-
surfaceClass: {},
|
|
187
|
-
teleportTo: {
|
|
188
|
-
type: [String, Boolean],
|
|
189
|
-
default: "body"
|
|
190
|
-
},
|
|
191
|
-
dismissOnClickOutside: {
|
|
192
|
-
type: Boolean,
|
|
193
|
-
default: !0
|
|
194
|
-
},
|
|
195
|
-
dismissOnEscape: {
|
|
196
|
-
type: Boolean,
|
|
197
|
-
default: !0
|
|
198
|
-
},
|
|
199
|
-
disabled: {
|
|
200
|
-
type: Boolean,
|
|
201
|
-
default: !1
|
|
202
|
-
},
|
|
203
|
-
reference: { default: null },
|
|
204
|
-
contentId: {},
|
|
205
|
-
viewportPadding: { default: 8 },
|
|
206
|
-
arrow: {
|
|
207
|
-
type: Boolean,
|
|
208
|
-
default: !1
|
|
209
|
-
},
|
|
210
|
-
showOnHover: {
|
|
211
|
-
type: Boolean,
|
|
212
|
-
default: !1
|
|
213
|
-
},
|
|
214
|
-
hoverLeaveDelay: { default: 100 },
|
|
215
|
-
sheet: {
|
|
216
|
-
type: Boolean,
|
|
217
|
-
default: !0
|
|
218
|
-
},
|
|
219
|
-
sheetBreakpoint: { default: () => 768 },
|
|
220
|
-
sheetTitle: { default: "" }
|
|
221
|
-
}, {
|
|
222
|
-
modelValue: {
|
|
223
|
-
type: Boolean,
|
|
224
|
-
default: !1
|
|
225
|
-
},
|
|
226
|
-
modelModifiers: {}
|
|
227
|
-
}),
|
|
228
|
-
emits: ["update:modelValue"],
|
|
229
|
-
setup(u, { expose: d }) {
|
|
230
|
-
let p = E(u, "modelValue"), g = ee(() => u.sheet, () => u.sheetBreakpoint), { isPanelShown: _, isPanelActive: y, handlePanelAfterLeave: x } = R(p), S = (e) => {
|
|
231
|
-
p.value = e;
|
|
232
|
-
}, C = () => S(!1), j = D(), M = O("triggerWrapperRef"), P = O("panelRef"), F = T(), I = T(), L = a(() => u.contentId ?? F), z = a(() => j.trigger ? te(M.value) : u.reference), B = a(() => u.teleportTo !== !1), V = a(() => u.teleportTo === !1 ? "body" : u.teleportTo), H = e.BOTTOM_START, U = () => {
|
|
233
|
-
u.disabled || S(!0);
|
|
234
|
-
}, W = () => {
|
|
235
|
-
u.disabled || (p.value = !p.value);
|
|
236
|
-
}, G = a(() => ({
|
|
237
|
-
id: I,
|
|
238
|
-
"aria-expanded": p.value,
|
|
239
|
-
"aria-haspopup": "dialog",
|
|
240
|
-
"aria-controls": L.value
|
|
241
|
-
})), { panelStyles: J, panelMaxHeight: Y, resolvedPlacement: X, arrowStyles: ie, isArrowOverflow: ae, isPositionReady: oe, updatePosition: se } = t({
|
|
242
|
-
open: () => y.value && !g.value,
|
|
243
|
-
onOpenChange: S,
|
|
244
|
-
reference: () => z.value,
|
|
245
|
-
panel: () => P.value,
|
|
246
|
-
placement: () => u.placement,
|
|
247
|
-
offset: () => u.offset,
|
|
248
|
-
flip: () => u.flip,
|
|
249
|
-
shift: () => u.shift,
|
|
250
|
-
matchReferenceWidth: () => u.matchReferenceWidth,
|
|
251
|
-
fitViewport: () => u.fitViewport,
|
|
252
|
-
dismissOnClickOutside: () => u.dismissOnClickOutside,
|
|
253
|
-
dismissOnEscape: () => u.dismissOnEscape,
|
|
254
|
-
viewportPadding: () => u.viewportPadding,
|
|
255
|
-
arrow: () => u.arrow
|
|
256
|
-
}), Z = a(() => u.showOnHover && !g.value), ce = a(() => Z.value ? z.value : null), le = a(() => Z.value ? P.value : null), Q = N(ce, { delayLeave: u.hoverLeaveDelay }), $ = N(le, { delayLeave: u.hoverLeaveDelay });
|
|
257
|
-
k([
|
|
258
|
-
Q,
|
|
259
|
-
$,
|
|
260
|
-
Z,
|
|
261
|
-
() => u.disabled
|
|
262
|
-
], () => {
|
|
263
|
-
if (Z.value) {
|
|
264
|
-
if (u.disabled) {
|
|
265
|
-
S(!1);
|
|
266
|
-
return;
|
|
267
|
-
}
|
|
268
|
-
S(Q.value || $.value);
|
|
269
|
-
}
|
|
270
|
-
});
|
|
271
|
-
let ue = a(() => !!Y.value), de = a(() => {
|
|
272
|
-
if (Y.value) return { maxHeight: `${Y.value}px` };
|
|
273
|
-
});
|
|
274
|
-
return k(() => u.disabled, (e) => {
|
|
275
|
-
e && p.value && (p.value = !1);
|
|
276
|
-
}), d({
|
|
277
|
-
updatePosition: se,
|
|
278
|
-
show: U,
|
|
279
|
-
close: C,
|
|
280
|
-
toggle: W
|
|
281
|
-
}), (e, t) => (v(), c(n, null, [w(j).trigger ? (v(), c("span", f({
|
|
282
|
-
key: 0,
|
|
283
|
-
ref_key: "triggerWrapperRef",
|
|
284
|
-
ref: M,
|
|
285
|
-
class: "s-ui-dropdown"
|
|
286
|
-
}, e.$attrs), [b(e.$slots, "trigger", {
|
|
287
|
-
open: p.value,
|
|
288
|
-
toggle: W,
|
|
289
|
-
close: C,
|
|
290
|
-
isSheet: w(g),
|
|
291
|
-
triggerProps: G.value
|
|
292
|
-
})], 16)) : s("", !0), (v(), o(r, {
|
|
293
|
-
to: V.value,
|
|
294
|
-
disabled: !B.value
|
|
295
|
-
}, [w(g) ? (v(), o(K, {
|
|
296
|
-
key: 0,
|
|
297
|
-
open: p.value,
|
|
298
|
-
title: u.sheetTitle,
|
|
299
|
-
"dismiss-on-overlay-click": u.dismissOnClickOutside,
|
|
300
|
-
"dismiss-on-escape": u.dismissOnEscape,
|
|
301
|
-
"content-id": L.value,
|
|
302
|
-
onClose: C
|
|
303
|
-
}, {
|
|
304
|
-
"header-left": A(() => [b(e.$slots, "sheet-header-left", { close: C })]),
|
|
305
|
-
"header-right": A(() => [b(e.$slots, "sheet-header-right", { close: C })]),
|
|
306
|
-
default: A(() => [b(e.$slots, "content", {
|
|
307
|
-
resolvedPlacement: w(H),
|
|
308
|
-
isSheet: !0,
|
|
309
|
-
close: C
|
|
310
|
-
})]),
|
|
311
|
-
_: 3
|
|
312
|
-
}, 8, [
|
|
313
|
-
"open",
|
|
314
|
-
"title",
|
|
315
|
-
"dismiss-on-overlay-click",
|
|
316
|
-
"dismiss-on-escape",
|
|
317
|
-
"content-id"
|
|
318
|
-
])) : (v(), o(i, {
|
|
319
|
-
key: 1,
|
|
320
|
-
name: "s-ui-dropdown",
|
|
321
|
-
onAfterLeave: w(x)
|
|
322
|
-
}, {
|
|
323
|
-
default: A(() => [w(_) ? (v(), c("div", {
|
|
324
|
-
key: 0,
|
|
325
|
-
id: L.value,
|
|
326
|
-
ref_key: "panelRef",
|
|
327
|
-
ref: P,
|
|
328
|
-
class: m(["s-ui-dropdown__panel", {
|
|
329
|
-
"s-ui-dropdown__panel--match-reference-width": u.matchReferenceWidth,
|
|
330
|
-
"s-ui-dropdown__panel--ready": w(oe)
|
|
331
|
-
}]),
|
|
332
|
-
style: h(w(J)),
|
|
333
|
-
role: "dialog"
|
|
334
|
-
}, [l("div", {
|
|
335
|
-
class: m(["s-ui-dropdown__surface", [u.surfaceClass, {
|
|
336
|
-
"s-ui-dropdown__surface--fit-viewport": ue.value,
|
|
337
|
-
"s-ui-dropdown__surface--with-arrow": u.arrow
|
|
338
|
-
}]]),
|
|
339
|
-
style: h(de.value),
|
|
340
|
-
"data-placement": w(X)
|
|
341
|
-
}, [u.arrow ? (v(), c("div", {
|
|
342
|
-
key: 0,
|
|
343
|
-
class: m(["s-ui-dropdown__arrow", { "s-ui-dropdown__arrow--overflow": w(ae) }]),
|
|
344
|
-
style: h(w(ie)),
|
|
345
|
-
"aria-hidden": "true"
|
|
346
|
-
}, [...t[0] ||= [l("span", { class: "s-ui-dropdown__arrow-outer" }, null, -1), l("span", { class: "s-ui-dropdown__arrow-inner" }, null, -1)]], 6)) : s("", !0), l("div", re, [b(e.$slots, "content", {
|
|
347
|
-
resolvedPlacement: w(X),
|
|
348
|
-
isSheet: !1,
|
|
349
|
-
close: C
|
|
350
|
-
})])], 14, ne)], 14, q)) : s("", !0)]),
|
|
351
|
-
_: 3
|
|
352
|
-
}, 8, ["onAfterLeave"]))], 8, ["to", "disabled"]))], 64));
|
|
353
|
-
}
|
|
354
|
-
});
|
|
355
|
-
//#endregion
|
|
356
|
-
export { L as n, J as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
let e=require("vue"),t=require("@vueuse/core");var n=function(e){return e.TOP=`top`,e.BOTTOM=`bottom`,e.LEFT=`left`,e.RIGHT=`right`,e}({}),r=function(e){return e.START=`start`,e.END=`end`,e.CENTER=`center`,e}({}),i=function(e){return e.TOP=`top`,e.TOP_START=`top-start`,e.TOP_END=`top-end`,e.BOTTOM=`bottom`,e.BOTTOM_START=`bottom-start`,e.BOTTOM_END=`bottom-end`,e.LEFT=`left`,e.LEFT_START=`left-start`,e.LEFT_END=`left-end`,e.RIGHT=`right`,e.RIGHT_START=`right-start`,e.RIGHT_END=`right-end`,e}({}),a=function(e){return e.PREFERRED=`preferred`,e.FLIP=`flip`,e.SHIFT=`shift`,e.SIZE=`size`,e}({}),o=e=>{switch(e){case i.TOP:return{side:n.TOP,align:r.CENTER};case i.TOP_START:return{side:n.TOP,align:r.START};case i.TOP_END:return{side:n.TOP,align:r.END};case i.BOTTOM:return{side:n.BOTTOM,align:r.CENTER};case i.BOTTOM_START:return{side:n.BOTTOM,align:r.START};case i.BOTTOM_END:return{side:n.BOTTOM,align:r.END};case i.LEFT:return{side:n.LEFT,align:r.CENTER};case i.LEFT_START:return{side:n.LEFT,align:r.START};case i.LEFT_END:return{side:n.LEFT,align:r.END};case i.RIGHT:return{side:n.RIGHT,align:r.CENTER};case i.RIGHT_START:return{side:n.RIGHT,align:r.START};case i.RIGHT_END:return{side:n.RIGHT,align:r.END};default:return e}},s=e=>e.side===n.TOP?e.align===r.START?i.TOP_START:e.align===r.END?i.TOP_END:i.TOP:e.side===n.BOTTOM?e.align===r.START?i.BOTTOM_START:e.align===r.END?i.BOTTOM_END:i.BOTTOM:e.side===n.LEFT?e.align===r.START?i.LEFT_START:e.align===r.END?i.LEFT_END:i.LEFT:e.align===r.START?i.RIGHT_START:e.align===r.END?i.RIGHT_END:i.RIGHT,c=(e,t,n)=>Math.min(Math.max(t,e),n),l=e=>e===n.TOP?`bottom`:e===n.BOTTOM?`top`:e===n.LEFT?`right`:`left`,u=({referenceCenter:e,floatingStart:t,floatingLength:n,crossAxisProperty:r,staticSide:i,staticOffset:a,arrowSize:o,arrowPadding:s})=>{let l=e-t-o/2,u=c(s,l,n-o-s),d=l-u;return{crossAxisPosition:u,crossAxisProperty:r,staticSide:i,staticOffset:a,centerOffset:d,isOverflow:Math.abs(d)>o/2}},d=e=>{let{referenceRect:t,floatingCoordinates:r,floatingSize:i,arrowSize:a,arrowPadding:s}=e,c=o(e.resolvedPlacement),d=l(c.side),f=-(a/2);return c.side===n.TOP||c.side===n.BOTTOM?u({referenceCenter:t.left+t.width/2,floatingStart:r.x,floatingLength:i.width,crossAxisProperty:`left`,staticSide:d,staticOffset:f,arrowSize:a,arrowPadding:s}):u({referenceCenter:t.top+t.height/2,floatingStart:r.y,floatingLength:i.height,crossAxisProperty:`top`,staticSide:d,staticOffset:f,arrowSize:a,arrowPadding:s})},f=(e,t,n)=>{let r=t.top+n,i=t.left+n,a=t.right-n,o=t.bottom-n;return{top:r-e.top,bottom:e.bottom-o,left:i-e.left,right:e.right-a}},p=(e,t)=>t===`top`?e.top>0:t===`bottom`?e.bottom>0:t===`left`?e.left>0:e.right>0,m=e=>e.top>0||e.bottom>0||e.left>0||e.right>0,h=(e,t)=>t===n.TOP||t===n.BOTTOM?e.left>0||e.right>0:e.top>0||e.bottom>0,g=(e,t)=>e.bottom>t.top&&e.top<t.bottom&&e.right>t.left&&e.left<t.right,_=(e,t)=>{let n=e.top+t,r=e.left+t,i=e.right-t,a=e.bottom-t;return{top:n,left:r,right:i,bottom:a,width:Math.max(0,i-r),height:Math.max(0,a-n)}},v=e=>e.side===n.TOP?{...e,side:n.BOTTOM}:e.side===n.BOTTOM?{...e,side:n.TOP}:e.side===n.LEFT?{...e,side:n.RIGHT}:{...e,side:n.LEFT},y=(e,t,n)=>Math.min(Math.max(t,e),n),b=(e,t,n)=>e===`y`?{x:t.x,y:y(t.y+n.top,t.y,t.y-n.bottom)}:{x:y(t.x+n.left,t.x,t.x-n.right),y:t.y},x=e=>e===n.TOP||e===n.BOTTOM?{mainAxis:`x`,crossAxis:`y`}:{mainAxis:`y`,crossAxis:`x`},S=(e,t,n,i)=>i===r.START?e:i===r.END?e+t-n:e+(t-n)/2,C=(e,t,r,i)=>r.side===n.BOTTOM?{x:S(e.left,e.width,t.width,r.align),y:e.bottom+i}:r.side===n.TOP?{x:S(e.left,e.width,t.width,r.align),y:e.top-i-t.height}:r.side===n.LEFT?{x:e.left-i-t.width,y:S(e.top,e.height,t.height,r.align)}:{x:e.right+i,y:S(e.top,e.height,t.height,r.align)},w=(e,t)=>({top:e.y,left:e.x,right:e.x+t.width,bottom:e.y+t.height,width:t.width,height:t.height}),T=(e,t,n,r)=>e===`x`?{min:t.left+n,max:t.right-n-r.width}:{min:t.top+n,max:t.bottom-n-r.height},E=(e,t,n,r,i)=>t<=n?y(t,e,n):y(r,e,i),D=(e,t,n,r,i,a)=>{let{mainAxis:o}=x(t),{x:s,y:c}=e,l=T(o,i,a,r);if(o===`y`){let e=n.top-r.height,t=n.bottom,i=Math.max(l.min,e),a=Math.min(l.max,t);c=E(c,i,a,l.min,l.max)}else{let e=n.left-r.width,t=n.right,i=Math.max(l.min,e),a=Math.min(l.max,t);s=E(s,i,a,l.min,l.max)}return{x:s,y:c}},O=(e,t,n)=>{let{anchorSide:r,referenceRect:i,viewportRect:a,viewportPadding:o,mainAxis:s=!0,crossAxis:c=!1}=n,l=f(w(e,t),a,o),{mainAxis:u,crossAxis:d}=x(r),p={x:e.x,y:e.y};return s&&(p=b(u,p,l)),c&&(p=b(d,p,l)),D(p,r,i,t,a,o)},k=e=>e===n.TOP?`top`:e===n.BOTTOM?`bottom`:e===n.LEFT?`left`:`right`,A=(e,t,n)=>{let r=t.bottom-n;return Math.max(0,Math.floor(r-e.y))},j=e=>{let t=o(e.placement),n=e.flip?[t,v(t)]:[t],r={anchor:t,coordinates:C(e.referenceRect,e.floatingSize,t,e.offset),strategy:a.PREFERRED};for(let i of n){let n=C(e.referenceRect,e.floatingSize,i,e.offset);if(!p(f(w(n,e.floatingSize),e.viewportRect,e.viewportPadding),k(i.side)))return{anchor:i,coordinates:n,strategy:i===t?a.PREFERRED:a.FLIP};r={anchor:i,coordinates:n,strategy:a.FLIP}}return r},M=(e,t)=>!e.shift||!m(f(w(t.coordinates,e.floatingSize),e.viewportRect,e.viewportPadding))?t:{...t,coordinates:O(t.coordinates,e.floatingSize,{anchorSide:t.anchor.side,referenceRect:e.referenceRect,viewportRect:e.viewportRect,viewportPadding:e.viewportPadding}),strategy:a.SHIFT},N=(e,t)=>{if(!e.fitViewport)return{coordinates:t.coordinates,strategy:t.strategy,maxHeight:void 0};let r=A(t.coordinates,e.viewportRect,e.viewportPadding),i=e.referenceRect.top-e.offset;if(t.anchor.side===n.TOP){let t=e.viewportRect.top+e.viewportPadding,n=Math.max(0,Math.floor(i-t));r=Math.min(r,n)}return r>=e.floatingSize.height?{coordinates:t.coordinates,strategy:t.strategy,maxHeight:void 0}:{coordinates:t.anchor.side===n.TOP?{...t.coordinates,y:i-r}:t.coordinates,strategy:a.SIZE,maxHeight:r}},P=e=>{let t=M(e,j(e)),n=N(e,t);return{x:n.coordinates.x,y:n.coordinates.y,resolvedPlacement:s(t.anchor),strategy:n.strategy,maxHeight:n.maxHeight}},F=()=>{let e=window.visualViewport;return e?{top:e.offsetTop,left:e.offsetLeft,right:e.offsetLeft+e.width,bottom:e.offsetTop+e.height,width:e.width,height:e.height}:{top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}},I=e=>({top:e.top,left:e.left,right:e.right,bottom:e.bottom,width:e.width,height:e.height}),L=/auto|scroll|overlay|hidden|clip/,R=e=>{let t=window.getComputedStyle(e);return[t.overflow,t.overflowX,t.overflowY].some(e=>L.test(e))},z=(e,t)=>{let n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),i=Math.min(e.right,t.right),a=Math.min(e.bottom,t.bottom);return{top:n,left:r,right:i,bottom:a,width:Math.max(0,i-r),height:Math.max(0,a-n)}},B=e=>{let t=F();if(!e)return t;let n=e.parentElement;for(;n;)R(n)&&(t=z(t,n.getBoundingClientRect())),n=n.parentElement;return t},V=/auto|scroll|overlay/,H=e=>{let t=window.getComputedStyle(e);return[t.overflow,t.overflowX,t.overflowY].some(e=>V.test(e))},U=e=>{let t=[],n=e?.parentElement??null;for(;n;)H(n)&&t.push(n),n=n.parentElement;return t},W=e=>e?e instanceof HTMLElement?e:e.$el instanceof HTMLElement?e.$el:null:null,G=e=>{let t=e.trim();if(!t)return;let n=parseFloat(t);if(!Number.isNaN(n))return n},K=e=>{let t=getComputedStyle(e);return{arrowSize:G(t.getPropertyValue(`--s-ui-dropdown-arrow-size`))??12,arrowPadding:G(t.getPropertyValue(`--s-ui-dropdown-arrow-padding`))??8}},q=(e,t,n)=>{if(!n)return t;let r=e.firstElementChild;return r instanceof HTMLElement?Math.max(r.scrollHeight,t):Math.max(e.scrollHeight,t)},J=(t,n)=>(0,e.toValue)(t??n),Y=(e,t)=>e&&t instanceof HTMLElement?K(t):{arrowSize:12,arrowPadding:8},X=(e,t,n,r,i,a)=>{let s=_(r,i),c=f(w({x:e.x,y:e.y},n),r,i),l=g(t,s),u=o(e.resolvedPlacement).side,d=a?!h(c,u):!m(c);return l&&d},Z=n=>{let r=(0,e.shallowRef)(null),a=(0,e.shallowRef)(void 0),o=(0,e.shallowRef)(i.BOTTOM_START),s=(0,e.shallowRef)(!1),c=(0,e.shallowRef)(0),l=(0,e.shallowRef)(null),u=(0,e.shallowRef)(!1),f=[],p=()=>{(0,e.toValue)(n.open)&&y()},m=()=>{for(let e of f)e();f=[]},h=()=>{m();let t=W((0,e.toValue)(n.reference));for(let e of U(t))e.addEventListener(`scroll`,p,{capture:!0,passive:!0}),f.push(()=>{e.removeEventListener(`scroll`,p,{capture:!0})})};(0,t.useEventListener)(window,`scroll`,p,{capture:!0}),(0,t.useEventListener)(document,`scroll`,p,{capture:!0}),(0,t.useEventListener)(()=>document.documentElement,`scroll`,p,{capture:!0}),(0,t.useEventListener)(()=>window.visualViewport??null,`scroll`,p,{passive:!0});let g=()=>({matchReferenceWidth:J(n.matchReferenceWidth,!1),fitViewport:J(n.fitViewport,!1),shift:J(n.shift,!1),baseOffset:J(n.offset,8),viewportPadding:J(n.viewportPadding,8),hasArrow:J(n.arrow,!1),placement:J(n.placement,i.BOTTOM_START),flip:J(n.flip,!0)}),_=(e,t)=>{if(!e){l.value=null,u.value=!1;return}let n=d({referenceRect:t.referenceRect,floatingCoordinates:{x:t.result.x,y:t.result.y},floatingSize:t.renderedFloatingSize,resolvedPlacement:t.result.resolvedPlacement,arrowSize:t.arrowSize,arrowPadding:t.arrowPadding});l.value=n,u.value=n.isOverflow},v=()=>{if(!(0,e.toValue)(n.open))return;let t=W((0,e.toValue)(n.reference)),i=(0,e.toValue)(n.panel);if(!t||!i)return;let l=g(),u=I(t.getBoundingClientRect()),d=I(i.getBoundingClientRect());c.value=Math.round(u.width);let f=i.firstElementChild,{arrowSize:p,arrowPadding:m}=Y(l.hasArrow,f),h=l.hasArrow?l.baseOffset+p/2:l.baseOffset,v={width:l.matchReferenceWidth&&u.width>0?u.width:d.width,height:q(i,d.height,l.fitViewport)},y=B(t),b=P({referenceRect:u,floatingSize:v,placement:l.placement,offset:h,flip:l.flip,shift:l.shift,fitViewport:l.fitViewport,viewportRect:y,viewportPadding:l.viewportPadding});r.value={x:b.x,y:b.y},a.value=b.maxHeight,o.value=b.resolvedPlacement;let x={width:v.width,height:b.maxHeight??v.height};s.value=X(b,u,x,y,l.viewportPadding,l.shift),_(l.hasArrow,{referenceRect:u,result:b,renderedFloatingSize:x,arrowSize:p,arrowPadding:m})},y=()=>{v()},b=(0,e.computed)(()=>{let t=(0,e.toValue)(n.matchReferenceWidth??!1);if(!(0,e.toValue)(n.open)||!r.value)return{position:`fixed`,top:`0`,left:`0`,visibility:`hidden`,pointerEvents:`none`};let i={position:`fixed`,top:`0`,left:`0`,transform:`translate(${r.value.x}px, ${r.value.y}px)`,visibility:s.value?`visible`:`hidden`,pointerEvents:s.value?`auto`:`none`};if(t&&c.value>0){let e=`${Math.round(c.value)}px`;i.width=e,i.minWidth=e,i.maxWidth=e}return i}),x=(0,e.computed)(()=>{if(!(0,e.toValue)(n.open)||!(0,e.toValue)(n.arrow??!1)||!l.value)return;let t=l.value;return{[t.crossAxisProperty]:`${t.crossAxisPosition}px`}}),S=()=>{n.onOpenChange?.(!1)};return(0,e.watch)(()=>(0,e.toValue)(n.open),async t=>{if(t){s.value=!1,await(0,e.nextTick)(),h(),y();return}s.value=!1,r.value=null,a.value=void 0,l.value=null,u.value=!1,m()}),(0,e.watch)([()=>(0,e.toValue)(n.placement??i.BOTTOM_START),()=>(0,e.toValue)(n.offset??8),()=>(0,e.toValue)(n.flip??!0),()=>(0,e.toValue)(n.shift??!1),()=>(0,e.toValue)(n.matchReferenceWidth??!1),()=>(0,e.toValue)(n.fitViewport??!1),()=>(0,e.toValue)(n.viewportPadding??8),()=>(0,e.toValue)(n.arrow??!1)],async()=>{(0,e.toValue)(n.open)&&(s.value=!1,await(0,e.nextTick)(),y())}),(0,t.useResizeObserver)(()=>W((0,e.toValue)(n.reference)),()=>{(0,e.toValue)(n.open)&&y()}),(0,t.useResizeObserver)(()=>(0,e.toValue)(n.panel),()=>{(0,e.toValue)(n.open)&&y()}),(0,t.useEventListener)(window,`resize`,()=>{(0,e.toValue)(n.open)&&y()}),(0,t.useEventListener)(()=>window.visualViewport??null,`resize`,()=>{(0,e.toValue)(n.open)&&y()}),(0,t.onClickOutside)(()=>(0,e.toValue)(n.panel),()=>{!(0,e.toValue)(n.open)||!(0,e.toValue)(n.dismissOnClickOutside??!0)||S()},{ignore:[(0,e.computed)(()=>W((0,e.toValue)(n.reference))),`.s-ui-dropdown`,`.s-ui-dropdown__panel`]}),(0,t.useEventListener)(window,`keydown`,t=>{!(0,e.toValue)(n.open)||!(0,e.toValue)(n.dismissOnEscape??!0)||t.key===`Escape`&&S()}),(0,e.onScopeDispose)(()=>{m()}),{panelStyles:b,panelMaxHeight:a,resolvedPlacement:o,isPositionReady:s,referenceWidth:c,arrowStyles:x,isArrowOverflow:u,updatePosition:y}};Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Z}});
|