@shtabapp/ui-kit 1.70.0 → 1.71.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/CHANGELOG.md +18 -0
- package/dist/{SChartLine-Cp1csHeY.cjs → SChartLine-3l507dBg.cjs} +1 -1
- package/dist/{SChartLine-CTjiKi4H.js → SChartLine-v0tkmnN6.js} +1 -1
- package/dist/{SChartMultiLine-CbPSG0mN.js → SChartMultiLine-CG6dKmWm.js} +1 -1
- package/dist/{SChartMultiLine-Bt9Cf-L9.cjs → SChartMultiLine-vz7JdyA3.cjs} +1 -1
- package/dist/{SColorPicker-BmaA5Xnp.js → SColorPicker-BjtlrGHZ.js} +3 -3
- package/dist/{SColorPicker-D7mTRL7K.cjs → SColorPicker-Ct8FVU0D.cjs} +1 -1
- package/dist/SDropdown-B8Z4oNMk.cjs +1 -0
- package/dist/SDropdown-cNmJ5Lrz.js +400 -0
- package/dist/SSelect-mnobObXO.cjs +1 -0
- package/dist/{SSelect-DUtNtnqM.js → SSelect-rpJCD5PL.js} +22 -19
- package/dist/{STable-CunQFK-x.js → STable-1Bfr6VLH.js} +2 -2
- package/dist/{STable-Ch7thYCy.cjs → STable-uR69d9kL.cjs} +1 -1
- package/dist/components/SDropdown/SDropdown.types.d.ts +4 -4
- package/dist/components/SDropdown/SDropdown.types.d.ts.map +1 -1
- package/dist/components/SDropdown/SDropdown.vue.d.ts +8 -8
- package/dist/components/SDropdown/SDropdown.vue.d.ts.map +1 -1
- package/dist/components/SDropdown/parts/SDropdownSheet.types.d.ts +2 -0
- package/dist/components/SDropdown/parts/SDropdownSheet.types.d.ts.map +1 -1
- package/dist/components/SDropdown/parts/SDropdownSheet.vue.d.ts +3 -1
- package/dist/components/SDropdown/parts/SDropdownSheet.vue.d.ts.map +1 -1
- package/dist/components/SDropdown/utils/context.d.ts +13 -0
- package/dist/components/SDropdown/utils/context.d.ts.map +1 -0
- package/dist/components/SDropdown/utils/useDropdownTree.d.ts +18 -0
- package/dist/components/SDropdown/utils/useDropdownTree.d.ts.map +1 -0
- package/dist/components/SSelect/SSelect.vue.d.ts.map +1 -1
- package/dist/composables/connectedPosition/computeConnectedPosition.d.ts.map +1 -1
- package/dist/composables/connectedPosition/getOverflow.d.ts +1 -0
- package/dist/composables/connectedPosition/getOverflow.d.ts.map +1 -1
- package/dist/composables/useEscapeDismiss.d.ts +15 -0
- package/dist/composables/useEscapeDismiss.d.ts.map +1 -0
- package/dist/composables/useFloatingOverlay.d.ts +4 -0
- package/dist/composables/useFloatingOverlay.d.ts.map +1 -1
- package/dist/createChartMarkersPlugin-Cg1yGzxW.cjs +1 -0
- package/dist/createChartMarkersPlugin-DkXituwE.js +43 -0
- package/dist/entries/chart-line.cjs +1 -1
- package/dist/entries/chart-line.js +1 -1
- package/dist/entries/chart-multi-line.cjs +1 -1
- package/dist/entries/chart-multi-line.js +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 +2 -2
- 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.js +8 -8
- package/dist/uikit-components.css +1 -1
- package/dist/useFloatingOverlay-CwGCMrig.cjs +1 -0
- package/dist/{useFloatingOverlay-b9_eDGNE.js → useFloatingOverlay-TxzVisMJ.js} +89 -86
- package/dist/utils/chart/core/createChartMarkersPlugin.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/SDropdown-BdgpPzfl.cjs +0 -1
- package/dist/SDropdown-xNcC6JDy.js +0 -362
- package/dist/SSelect-Coyrc99Y.cjs +0 -1
- package/dist/createChartMarkersPlugin-DSKGilFU.js +0 -40
- package/dist/createChartMarkersPlugin-S4oQKxO4.cjs +0 -1
- package/dist/useFloatingOverlay-Dp44TxvN.cjs +0 -1
|
@@ -1,362 +0,0 @@
|
|
|
1
|
-
import { a as e, i as t, t as n } from "./useFloatingOverlay-b9_eDGNE.js";
|
|
2
|
-
import { Fragment as r, Teleport as i, Transition as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, defineComponent as d, mergeModels as f, mergeProps as p, nextTick as m, normalizeClass as h, normalizeStyle as g, onBeforeUnmount as _, onScopeDispose as v, openBlock as y, ref as b, renderSlot as x, shallowRef as S, toDisplayString as C, toValue as w, unref as T, useId as E, useModel as D, useSlots as O, useTemplateRef as k, watch as A, withCtx as j, withModifiers as M } from "vue";
|
|
3
|
-
import { useUiKitI18n as N } from "@shtabapp/ui-kit-primitives";
|
|
4
|
-
import { useElementHover as P, useEventListener as F, useMediaQuery as I, useScrollLock as L } from "@vueuse/core";
|
|
5
|
-
//#region src/components/SDropdown/SDropdown.types.ts
|
|
6
|
-
var R = 768, ee = (e) => {
|
|
7
|
-
let t = b(e.value), n = b(e.value);
|
|
8
|
-
return A(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
|
-
}, te = (e, t) => {
|
|
22
|
-
let n = I(o(() => `(max-width: ${(w(t) || 768) - .02}px)`));
|
|
23
|
-
return o(() => w(e) && n.value);
|
|
24
|
-
}, z = (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
|
-
}, B = {
|
|
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
|
-
}, V = (e) => {
|
|
38
|
-
let t = S(0), n = S(!1), r = S(!1), i = null, a = 0, s = 0, c = 0, l = 0, u = 0, d, f = o(() => 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, B.SETTLE_TIMEOUT);
|
|
42
|
-
}, h = () => {
|
|
43
|
-
i = null, t.value = 0, n.value = !1, p();
|
|
44
|
-
}, g = () => w(e.popup)?.offsetHeight ?? 0, _ = () => {
|
|
45
|
-
let e = l - a;
|
|
46
|
-
if (e <= 0) return !1;
|
|
47
|
-
let t = u - c;
|
|
48
|
-
return (t > 0 ? (l - s) / t : 0) >= B.CLOSE_VELOCITY ? !0 : e >= Math.min(g() * B.CLOSE_DISTANCE_RATIO, B.CLOSE_DISTANCE_LIMIT);
|
|
49
|
-
}, y = (e) => {
|
|
50
|
-
i === null && (e.pointerType === "mouse" && e.button !== 0 || e.target instanceof Element && e.target.closest(B.INTERACTIVE_SELECTOR) || (i = e.pointerId, a = 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 - a, -B.OVERDRAG_LIMIT));
|
|
53
|
-
}, x = (a) => {
|
|
54
|
-
if (i === a.pointerId) {
|
|
55
|
-
if (i = null, n.value = !1, _()) {
|
|
56
|
-
r.value = !0, t.value = g() + B.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 F(() => w(e.handle), "pointerdown", y), F(window, "pointermove", b), F(window, "pointerup", x), F(window, "pointercancel", x), F(() => w(e.popup), "transitionend", (e) => {
|
|
67
|
-
e.propertyName !== "transform" || n.value || t.value !== 0 || p();
|
|
68
|
-
}), v(() => {
|
|
69
|
-
clearTimeout(d);
|
|
70
|
-
}), {
|
|
71
|
-
isActive: f,
|
|
72
|
-
popupStyles: o(() => {
|
|
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
|
-
}, H = ["aria-label"], U = { class: "s-ui-dropdown-sheet__side" }, W = { class: "s-ui-dropdown-sheet__title" }, G = { class: "s-ui-dropdown-sheet__side s-ui-dropdown-sheet__side--end" }, K = ["id"], q = /* @__PURE__ */ d({
|
|
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 } = N(), i = k("popupRef"), o = k("headerRef"), d = () => n("close"), { isActive: f, popupStyles: p, reset: h } = V({
|
|
98
|
-
handle: o,
|
|
99
|
-
popup: i,
|
|
100
|
-
onClose: d
|
|
101
|
-
}), v = L(() => typeof document > "u" ? null : document.body), b = () => {
|
|
102
|
-
e.dismissOnOverlayClick && d();
|
|
103
|
-
}, S = (e) => {
|
|
104
|
-
f.value && e.stopPropagation();
|
|
105
|
-
}, w = () => h(), E = null, D = () => {
|
|
106
|
-
let e = document.activeElement;
|
|
107
|
-
E = e instanceof HTMLElement ? e : null;
|
|
108
|
-
}, O = async () => {
|
|
109
|
-
await m();
|
|
110
|
-
let e = i.value;
|
|
111
|
-
!e || e.contains(document.activeElement) || e.focus({ preventScroll: !0 });
|
|
112
|
-
}, P = () => {
|
|
113
|
-
let e = E, t = !!i.value?.contains(document.activeElement);
|
|
114
|
-
E = null, !(!t || !e?.isConnected) && e.focus({ preventScroll: !0 });
|
|
115
|
-
};
|
|
116
|
-
return A(() => e.open, (e) => {
|
|
117
|
-
if (v.value = e, e) {
|
|
118
|
-
D(), O();
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
P();
|
|
122
|
-
}, { immediate: !0 }), F(window, "keydown", (t) => {
|
|
123
|
-
!e.open || !e.dismissOnEscape || t.key !== "Escape" || d();
|
|
124
|
-
}), _(() => {
|
|
125
|
-
v.value = !1;
|
|
126
|
-
}), (t, n) => (y(), s(a, {
|
|
127
|
-
name: "s-ui-dropdown-sheet",
|
|
128
|
-
onAfterLeave: w
|
|
129
|
-
}, {
|
|
130
|
-
default: j(() => [e.open ? (y(), l("div", {
|
|
131
|
-
key: 0,
|
|
132
|
-
class: "s-ui-dropdown-sheet",
|
|
133
|
-
onClick: b
|
|
134
|
-
}, [u("div", {
|
|
135
|
-
ref_key: "popupRef",
|
|
136
|
-
ref: i,
|
|
137
|
-
class: "s-ui-dropdown-sheet__popup",
|
|
138
|
-
style: g(T(p)),
|
|
139
|
-
role: "dialog",
|
|
140
|
-
"aria-modal": "true",
|
|
141
|
-
"aria-label": e.title || T(r)("dropdown.sheet"),
|
|
142
|
-
tabindex: "-1",
|
|
143
|
-
onClickCapture: S,
|
|
144
|
-
onClick: n[0] ||= M(() => {}, ["stop"])
|
|
145
|
-
}, [u("header", {
|
|
146
|
-
ref_key: "headerRef",
|
|
147
|
-
ref: o,
|
|
148
|
-
class: "s-ui-dropdown-sheet__header"
|
|
149
|
-
}, [
|
|
150
|
-
n[1] ||= u("span", {
|
|
151
|
-
class: "s-ui-dropdown-sheet__handle",
|
|
152
|
-
"aria-hidden": "true"
|
|
153
|
-
}, null, -1),
|
|
154
|
-
u("div", U, [x(t.$slots, "header-left")]),
|
|
155
|
-
u("div", W, C(e.title), 1),
|
|
156
|
-
u("div", G, [x(t.$slots, "header-right")])
|
|
157
|
-
], 512), u("div", {
|
|
158
|
-
id: e.contentId,
|
|
159
|
-
class: "s-ui-dropdown-sheet__content"
|
|
160
|
-
}, [x(t.$slots, "default")], 8, K)], 44, H)])) : c("", !0)]),
|
|
161
|
-
_: 3
|
|
162
|
-
}));
|
|
163
|
-
}
|
|
164
|
-
}), J = ["id"], ne = ["data-placement"], re = { class: "s-ui-dropdown__content" }, Y = /* @__PURE__ */ d({
|
|
165
|
-
inheritAttrs: !1,
|
|
166
|
-
__name: "SDropdown",
|
|
167
|
-
props: /*@__PURE__*/ f({
|
|
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
|
-
boundary: { default: () => t.CLIPPING_ANCESTORS },
|
|
207
|
-
block: {
|
|
208
|
-
type: Boolean,
|
|
209
|
-
default: !1
|
|
210
|
-
},
|
|
211
|
-
arrow: {
|
|
212
|
-
type: Boolean,
|
|
213
|
-
default: !1
|
|
214
|
-
},
|
|
215
|
-
showOnHover: {
|
|
216
|
-
type: Boolean,
|
|
217
|
-
default: !1
|
|
218
|
-
},
|
|
219
|
-
hoverLeaveDelay: { default: 100 },
|
|
220
|
-
sheet: {
|
|
221
|
-
type: Boolean,
|
|
222
|
-
default: !0
|
|
223
|
-
},
|
|
224
|
-
sheetBreakpoint: { default: () => 768 },
|
|
225
|
-
sheetTitle: { default: "" }
|
|
226
|
-
}, {
|
|
227
|
-
modelValue: {
|
|
228
|
-
type: Boolean,
|
|
229
|
-
default: !1
|
|
230
|
-
},
|
|
231
|
-
modelModifiers: {}
|
|
232
|
-
}),
|
|
233
|
-
emits: ["update:modelValue"],
|
|
234
|
-
setup(t, { expose: d }) {
|
|
235
|
-
let f = D(t, "modelValue"), m = te(() => t.sheet, () => t.sheetBreakpoint), { isPanelShown: _, isPanelActive: v, handlePanelAfterLeave: b } = ee(f), S = (e) => {
|
|
236
|
-
f.value = e;
|
|
237
|
-
}, C = () => S(!1), w = O(), M = k("triggerWrapperRef"), N = k("panelRef"), F = E(), I = E(), L = o(() => t.contentId ?? F), R = o(() => w.trigger ? z(M.value) : t.reference), B = o(() => t.teleportTo !== !1), V = o(() => t.teleportTo === !1 ? "body" : t.teleportTo), H = e.BOTTOM_START, U = () => {
|
|
238
|
-
t.disabled || S(!0);
|
|
239
|
-
}, W = () => {
|
|
240
|
-
t.disabled || (f.value = !f.value);
|
|
241
|
-
}, G = o(() => ({
|
|
242
|
-
id: I,
|
|
243
|
-
"aria-expanded": f.value,
|
|
244
|
-
"aria-haspopup": "dialog",
|
|
245
|
-
"aria-controls": L.value
|
|
246
|
-
})), { panelStyles: K, panelMaxHeight: Y, resolvedPlacement: X, arrowStyles: ie, isArrowOverflow: ae, isPositionReady: oe, updatePosition: se } = n({
|
|
247
|
-
open: () => v.value && !m.value,
|
|
248
|
-
onOpenChange: S,
|
|
249
|
-
reference: () => R.value,
|
|
250
|
-
panel: () => N.value,
|
|
251
|
-
placement: () => t.placement,
|
|
252
|
-
offset: () => t.offset,
|
|
253
|
-
flip: () => t.flip,
|
|
254
|
-
shift: () => t.shift,
|
|
255
|
-
matchReferenceWidth: () => t.matchReferenceWidth,
|
|
256
|
-
fitViewport: () => t.fitViewport,
|
|
257
|
-
dismissOnClickOutside: () => t.dismissOnClickOutside,
|
|
258
|
-
dismissOnEscape: () => t.dismissOnEscape,
|
|
259
|
-
viewportPadding: () => t.viewportPadding,
|
|
260
|
-
arrow: () => t.arrow,
|
|
261
|
-
boundary: () => t.boundary
|
|
262
|
-
}), Z = o(() => t.showOnHover && !m.value), ce = o(() => Z.value ? R.value : null), le = o(() => Z.value ? N.value : null), Q = P(ce, { delayLeave: t.hoverLeaveDelay }), $ = P(le, { delayLeave: t.hoverLeaveDelay });
|
|
263
|
-
A([
|
|
264
|
-
Q,
|
|
265
|
-
$,
|
|
266
|
-
Z,
|
|
267
|
-
() => t.disabled
|
|
268
|
-
], () => {
|
|
269
|
-
if (Z.value) {
|
|
270
|
-
if (t.disabled) {
|
|
271
|
-
S(!1);
|
|
272
|
-
return;
|
|
273
|
-
}
|
|
274
|
-
S(Q.value || $.value);
|
|
275
|
-
}
|
|
276
|
-
});
|
|
277
|
-
let ue = o(() => !!Y.value), de = o(() => {
|
|
278
|
-
if (Y.value) return { maxHeight: `${Y.value}px` };
|
|
279
|
-
});
|
|
280
|
-
return A(() => t.disabled, (e) => {
|
|
281
|
-
e && f.value && (f.value = !1);
|
|
282
|
-
}), d({
|
|
283
|
-
updatePosition: se,
|
|
284
|
-
show: U,
|
|
285
|
-
close: C,
|
|
286
|
-
toggle: W
|
|
287
|
-
}), (e, n) => (y(), l(r, null, [T(w).trigger ? (y(), l("span", p({
|
|
288
|
-
key: 0,
|
|
289
|
-
ref_key: "triggerWrapperRef",
|
|
290
|
-
ref: M,
|
|
291
|
-
class: ["s-ui-dropdown", { "s-ui-dropdown--block": t.block }]
|
|
292
|
-
}, e.$attrs), [x(e.$slots, "trigger", {
|
|
293
|
-
open: f.value,
|
|
294
|
-
toggle: W,
|
|
295
|
-
close: C,
|
|
296
|
-
isSheet: T(m),
|
|
297
|
-
triggerProps: G.value
|
|
298
|
-
})], 16)) : c("", !0), (y(), s(i, {
|
|
299
|
-
to: V.value,
|
|
300
|
-
disabled: !B.value
|
|
301
|
-
}, [T(m) ? (y(), s(q, {
|
|
302
|
-
key: 0,
|
|
303
|
-
open: f.value,
|
|
304
|
-
title: t.sheetTitle,
|
|
305
|
-
"dismiss-on-overlay-click": t.dismissOnClickOutside,
|
|
306
|
-
"dismiss-on-escape": t.dismissOnEscape,
|
|
307
|
-
"content-id": L.value,
|
|
308
|
-
onClose: C
|
|
309
|
-
}, {
|
|
310
|
-
"header-left": j(() => [x(e.$slots, "sheet-header-left", { close: C })]),
|
|
311
|
-
"header-right": j(() => [x(e.$slots, "sheet-header-right", { close: C })]),
|
|
312
|
-
default: j(() => [x(e.$slots, "content", {
|
|
313
|
-
resolvedPlacement: T(H),
|
|
314
|
-
isSheet: !0,
|
|
315
|
-
close: C
|
|
316
|
-
})]),
|
|
317
|
-
_: 3
|
|
318
|
-
}, 8, [
|
|
319
|
-
"open",
|
|
320
|
-
"title",
|
|
321
|
-
"dismiss-on-overlay-click",
|
|
322
|
-
"dismiss-on-escape",
|
|
323
|
-
"content-id"
|
|
324
|
-
])) : (y(), s(a, {
|
|
325
|
-
key: 1,
|
|
326
|
-
name: "s-ui-dropdown",
|
|
327
|
-
onAfterLeave: T(b)
|
|
328
|
-
}, {
|
|
329
|
-
default: j(() => [T(_) ? (y(), l("div", {
|
|
330
|
-
key: 0,
|
|
331
|
-
id: L.value,
|
|
332
|
-
ref_key: "panelRef",
|
|
333
|
-
ref: N,
|
|
334
|
-
class: h(["s-ui-dropdown__panel", {
|
|
335
|
-
"s-ui-dropdown__panel--match-reference-width": t.matchReferenceWidth,
|
|
336
|
-
"s-ui-dropdown__panel--ready": T(oe)
|
|
337
|
-
}]),
|
|
338
|
-
style: g(T(K)),
|
|
339
|
-
role: "dialog"
|
|
340
|
-
}, [u("div", {
|
|
341
|
-
class: h(["s-ui-dropdown__surface", [t.surfaceClass, {
|
|
342
|
-
"s-ui-dropdown__surface--fit-viewport": ue.value,
|
|
343
|
-
"s-ui-dropdown__surface--with-arrow": t.arrow
|
|
344
|
-
}]]),
|
|
345
|
-
style: g(de.value),
|
|
346
|
-
"data-placement": T(X)
|
|
347
|
-
}, [t.arrow ? (y(), l("div", {
|
|
348
|
-
key: 0,
|
|
349
|
-
class: h(["s-ui-dropdown__arrow", { "s-ui-dropdown__arrow--overflow": T(ae) }]),
|
|
350
|
-
style: g(T(ie)),
|
|
351
|
-
"aria-hidden": "true"
|
|
352
|
-
}, [...n[0] ||= [u("span", { class: "s-ui-dropdown__arrow-outer" }, null, -1), u("span", { class: "s-ui-dropdown__arrow-inner" }, null, -1)]], 6)) : c("", !0), u("div", re, [x(e.$slots, "content", {
|
|
353
|
-
resolvedPlacement: T(X),
|
|
354
|
-
isSheet: !1,
|
|
355
|
-
close: C
|
|
356
|
-
})])], 14, ne)], 14, J)) : c("", !0)]),
|
|
357
|
-
_: 3
|
|
358
|
-
}, 8, ["onAfterLeave"]))], 8, ["to", "disabled"]))], 64));
|
|
359
|
-
}
|
|
360
|
-
});
|
|
361
|
-
//#endregion
|
|
362
|
-
export { R as n, Y as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./SButton-CLTNdnCK.cjs"),t=require("./useSelectionGroup-NJvi3hNo.cjs"),n=require("./SDropdown-BdgpPzfl.cjs"),r=require("./SDropdownMenu-k9SxaFVH.cjs"),i=require("./SInput-B4So5LGW.cjs"),a=require("./SListItem-BeaflFVf.cjs"),o=require("./SList-CvP0U6U1.cjs");let s=require("vue"),c=require("@shtabapp/ui-kit-primitives");var l=({listItemScope:e,itemTitle:t,itemSubtitle:n,itemDisabled:r,itemIconLeft:i,listActiveKey:a,isOptionSelected:s})=>{let c=e.item;return{rowKey:e.key,title:o.i(c,t),subtitle:o.i(c,n),disabled:o.n(c,r),iconLeft:o.r(c,i),selected:s,active:a===e.key,revealRight:e.revealRight,tiny:!0}},u=e=>typeof e==`string`||typeof e==`number`,d=(e,t)=>{let n=e[t];if(u(n))return n},f=e=>typeof e==`string`?e:String(e),p=e=>e==null?!1:typeof e==`string`?e.length>0:!0,m=(e,t,n)=>t.find(t=>f(d(t,n)??``)===e),h=e=>typeof e==`object`&&!!e,g=(e,t,n)=>{let r=m(e,t,n);if(r)return d(r,n)},_=function(e){return e.INPUT=`input`,e.CONTENT=`content`,e}({}),v=(e,t,n)=>{if(!e)return!0;let r=e.toLocaleLowerCase(),i=o.i(t,n.itemTitle)?.toLocaleLowerCase()??``,a=f(d(t,n.itemValue)??``).toLocaleLowerCase();return i.includes(r)||a.includes(r)},y=(e,t,n,r)=>{let i=r??((e,t)=>v(e,t,n));return t?e.filter(e=>i(t,e)):[...e]},b=e=>typeof e==`string`&&p(e),x=e=>typeof e==`number`&&p(e),S=(e,t,n)=>{if(t){if(!h(e))return;let t=d(e,n);return b(t)||x(t)?t:void 0}let r=typeof e==`string`||typeof e==`number`?e:void 0;if(b(r)||x(r))return r},C=(e,t,n)=>e?(Array.isArray(e)?e:[e]).flatMap(e=>{let r=S(e,t,n);return p(r)?[r]:[]}):[],w=(e,t)=>{if(b(t)){e.value=t;return}if(x(t)){e.value=t;return}e.value=void 0},T=(e,t,n)=>t.flatMap(t=>{let r=f(t),i=e.find(e=>f(d(e,n)??``)===r);return i?[i]:[]}),E=({modelValue:e,options:n,itemFields:r,multiple:i,returnObject:a,searchable:c,filterOption:l,isDropdownOpen:u,searchQuery:h})=>{let v=(0,s.computed)(()=>(0,s.toValue)(i)),b=(0,s.computed)(()=>(0,s.toValue)(a)),x=(0,s.computed)(()=>(0,s.toValue)(c)===_.INPUT),S=(0,s.computed)(()=>(0,s.toValue)(c)===_.CONTENT),E=(0,s.computed)(()=>!!(0,s.toValue)(c)),D=(0,s.computed)(()=>{let t=(0,s.toValue)(r);return C(e.value,b.value,t.itemValue)}),O=(0,s.computed)(()=>{let e=(0,s.toValue)(n),t=(0,s.toValue)(r);return y(e,E.value?h.value:``,t,(0,s.toValue)(l))}),k=(0,s.computed)(()=>v.value?t.n.MULTIPLE:t.n.SINGLE),A=(t,n,r)=>{if(b.value){e.value=T(n,t,r);return}e.value=t},ee=(t,n,r)=>{if(!t){e.value=void 0;return}if(b.value){e.value=m(t,n,r)??void 0;return}w(e,g(t,n,r))},te=(0,s.computed)({get:()=>{if(v.value)return D.value.map(e=>f(e));let e=D.value[0];if(p(e))return f(e)},set:e=>{let t=(0,s.toValue)(n),i=(0,s.toValue)(r);if(v.value){A((Array.isArray(e)?e:[]).map(e=>g(e,t,i.itemValue)).filter(e=>p(e)),t,i.itemValue);return}ee(typeof e==`string`?e:void 0,t,i.itemValue)}}),ne=(0,s.computed)(()=>D.value.length>0),j=(e,t,n)=>{let r=f(t);return e.find(e=>f(d(e,n)??``)===r)},M=(0,s.computed)(()=>{let e=D.value[0];if(!p(e))return``;let t=(0,s.toValue)(r),i=j((0,s.toValue)(n),e,t.itemValue);return i?o.i(i,t.itemTitle)??``:f(e)}),N=(0,s.computed)(()=>{let e=(0,s.toValue)(n),t=(0,s.toValue)(r);return D.value.map(n=>{let r=j(e,n,t.itemValue);return r?o.i(r,t.itemTitle)??``:f(n)})}),re=(0,s.computed)(()=>N.value.join(`, `)),P=(0,s.computed)(()=>v.value?D.value.length===0:!M.value),F=(0,s.computed)(()=>x.value&&(u.value||v.value)),I=()=>{h.value=``};return(0,s.watch)(u,e=>{e||I()}),(0,s.watch)(()=>(0,s.toValue)(c),()=>{I()}),{searchQuery:h,selectedValues:D,filteredOptions:O,listSelectionMode:k,listSelectedModel:te,hasSelectedValues:ne,singleDisplayLabel:M,multipleDisplayLabels:N,multipleDisplayText:re,showPlaceholder:P,showInputSearchField:F,isSearchableMode:E,isSearchableInputMode:x,isSearchableContentMode:S,isMultipleMode:v,isReturnObjectMode:b,clearSelection:()=>{e.value=void 0,I()},removeSelectedValue:e=>{let t=f(e);A(D.value.filter(e=>f(e)!==t),(0,s.toValue)(n),(0,s.toValue)(r).itemValue)},resetSearchQuery:I,formatSelectListKey:f,resolveValueFromListKey:e=>g(e,(0,s.toValue)(n),(0,s.toValue)(r).itemValue)}},D={key:1,class:`s-ui-select__empty s-ui-typography-body-14-regular`},O=[`id`,`aria-expanded`,`aria-controls`,`aria-disabled`,`aria-readonly`,`aria-autocomplete`,`tabindex`],k={key:0,class:`s-ui-select__value`},A={key:1,class:`s-ui-select__placeholder`},ee={key:1,class:`s-ui-select__placeholder`},te={key:2,class:`s-ui-select__value`},ne={key:3,class:`s-ui-select__value-suffix`},j=[`name`,`placeholder`,`disabled`,`readonly`],M=20,N=`100%`,re=20,P=(0,s.defineComponent)({__name:`SSelect`,props:(0,s.mergeModels)({options:{},itemValue:{default:`value`},itemTitle:{default:`label`},itemSubtitle:{default:`subtitle`},itemId:{},itemDisabled:{default:`disabled`},itemIconLeft:{default:`iconLeft`},multiple:{type:Boolean,default:!1},returnObject:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},closableOptions:{type:Boolean,default:!1},searchable:{type:[String,Boolean],default:!1},closeOnSelect:{type:Boolean,default:!0},listHeight:{default:320},searchPlaceholder:{default:`Search`},filterOption:{type:Function},fitViewport:{type:Boolean,default:!0},panelWidth:{},surfaceClass:{},canLoadMore:{type:Function},endReachedDistance:{default:0},label:{},labelProps:{},placeholder:{},helpMessages:{},errorMessages:{},bordered:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},iconLeft:{},customize:{default:()=>i.n.NONE},name:{},id:{}},{modelValue:{},modelModifiers:{},searchQuery:{default:``},searchQueryModifiers:{}}),emits:(0,s.mergeModels)([`clear`,`focus`,`blur`,`open`,`close`,`endReached`],[`update:modelValue`,`update:searchQuery`]),setup(t,{expose:u,emit:d}){let f=(0,s.useModel)(t,`modelValue`),m=(0,s.useModel)(t,`searchQuery`),h=d,{t:g}=(0,c.useUiKitI18n)(),_=(0,s.useSlots)(),v=(0,s.useId)(),y=(0,s.useId)(),b=(0,s.useTemplateRef)(`triggerInputRef`),x=(0,s.ref)(``),S=(0,s.useTemplateRef)(`searchInputElementRef`),C=(0,s.useTemplateRef)(`panelSearchInputElementRef`),w=(0,s.useTemplateRef)(`listElementRef`),T=(0,s.ref)(),P=(0,s.ref)(!1),F=(0,s.ref)(!1),I=(0,s.computed)(()=>t.panelWidth===void 0),ie=(0,s.computed)(()=>t.panelWidth??N),ae=(0,s.computed)(()=>t.itemId??t.itemValue),oe=(0,s.computed)(()=>({itemValue:t.itemValue,itemTitle:t.itemTitle,itemSubtitle:t.itemSubtitle,itemId:ae.value})),{selectedValues:L,filteredOptions:R,listSelectionMode:se,listSelectedModel:z,hasSelectedValues:ce,singleDisplayLabel:le,multipleDisplayLabels:ue,multipleDisplayText:B,showPlaceholder:V,showInputSearchField:H,isSearchableMode:de,isSearchableInputMode:U,isSearchableContentMode:W,isMultipleMode:G,clearSelection:fe,removeSelectedValue:K,resolveValueFromListKey:pe,formatSelectListKey:q}=E({modelValue:f,options:()=>t.options,itemFields:()=>oe.value,multiple:()=>t.multiple,returnObject:()=>t.returnObject,searchable:()=>t.searchable,filterOption:()=>t.filterOption,isDropdownOpen:P,searchQuery:m}),me=(0,s.computed)(()=>({disabled:t.disabled,displayLabel:le.value})),J=(0,s.computed)(()=>R.value.length>re),he=(0,s.computed)(()=>W.value||J.value?t.listHeight:`auto`),ge=(0,s.computed)(()=>{if(!(W.value||J.value))return t.listHeight}),_e=(0,s.computed)(()=>L.value.map(e=>q(e))),ve=e=>_e.value.includes(e),ye=()=>({tiny:!0}),be=e=>l({listItemScope:e,itemTitle:t.itemTitle,itemSubtitle:t.itemSubtitle,itemDisabled:t.itemDisabled,itemIconLeft:t.itemIconLeft,listActiveKey:T.value,isOptionSelected:ve(e.key)}),xe=e=>{let t=pe(e);if(p(t)){if(G.value){K(t);return}f.value=void 0}},Se=(0,s.computed)(()=>t.id??v),Ce=(0,s.computed)(()=>y),we=(0,s.computed)(()=>b.value?.fieldElementRef??null),Te=(0,s.computed)(()=>({labels:ue.value,values:L.value,displayText:B.value,disabled:t.disabled||t.readonly,removeValue:K})),Ee=(0,s.computed)(()=>{if(!t.disabled&&(t.readonly&&!U.value||!U.value))return 0}),De=(0,s.computed)(()=>({"s-ui-select--disabled":t.disabled,"s-ui-select--readonly":t.readonly,"s-ui-select--multiple":G.value,"s-ui-select--open":P.value})),Oe=()=>{if(W.value){C.value?.focus();return}S.value?.focus()},ke=async()=>{await(0,s.nextTick)(),C.value?.focus()},Ae=async()=>{await(0,s.nextTick)(),await w.value?.focusNavigation()},Y=async()=>{if(!(t.disabled||t.readonly)&&!P.value){if(P.value=!0,h(`open`),W.value){await ke();return}if(U.value){await(0,s.nextTick)(),S.value?.focus();return}await Ae()}},je=async()=>{t.disabled||t.readonly||P.value||await Y()};(0,s.watch)(m,async e=>{U.value&&(t.disabled||t.readonly||e&&(P.value||await Y()))});let X=()=>{P.value&&(P.value=!1,T.value=void 0,h(`close`))},Z=()=>{!t.closeOnSelect||G.value||X()};(0,s.watch)(f,(e,n)=>{!t.closeOnSelect||G.value||!P.value||!e||e===n||X()});let Me=e=>{P.value&&e.target instanceof Element&&e.target.closest(`.s-ui-list-item`)&&Z()},Ne=async e=>{e.key!==`Enter`&&e.key!==` `&&e.key!==`Spacebar`||P.value&&(await(0,s.nextTick)(),Z())},Q=async()=>{if(P.value){X();return}await Y()},Pe=async e=>{if(!(t.disabled||t.readonly)&&e.target instanceof HTMLElement){if(e.target.closest(`.s-ui-select__search-input`)){P.value||await Y();return}await Q()}},$=async e=>e.key!==`ArrowDown`&&e.key!==`ArrowUp`?!1:(e.preventDefault(),e.stopPropagation(),P.value||await Y(),await Ae(),await w.value?.handleKeyboardNavigation(e),!0),Fe=e=>{let t=pe(e);if(t){if(G.value){L.value.some(t=>q(t)===e)?K(t):z.value=[...L.value.map(e=>q(e)),e];return}z.value=e,Z()}},Ie=async e=>{if(!(t.disabled||t.readonly)&&!await $(e)){if(e.key===`Escape`){e.preventDefault(),X();return}if(e.key===`Enter`||e.key===` `){if(e.preventDefault(),P.value&&T.value){Fe(T.value);return}await Q()}}},Le=async e=>{if(e.key===`Escape`){e.preventDefault(),X();return}await $(e)},Re=Le,ze=e=>{t.disabled||(F.value||h(`focus`,e),F.value=!0)},Be=e=>{if(!(e.currentTarget instanceof HTMLElement))return;let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||(F.value=!1,h(`blur`,e))},Ve=()=>{fe(),h(`clear`)},He=e=>{h(`endReached`,e)};return u({open:Y,close:X,toggle:Q,focusSearchInput:Oe}),(l,u)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{class:(0,s.normalizeClass)([`s-ui-select`,De.value])},[(0,s.createVNode)((0,s.unref)(n.t),{modelValue:P.value,"onUpdate:modelValue":u[4]||=e=>P.value=e,reference:we.value,disabled:t.disabled,"match-reference-width":I.value,"fit-viewport":t.fitViewport,"surface-class":t.surfaceClass,"content-id":Ce.value,"dismiss-on-click-outside":!0,"dismiss-on-escape":!0},{content:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(r.t),{class:`s-ui-select__menu`,width:ie.value},(0,s.createSlots)({default:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`div`,{class:`s-ui-select__menu-body`,onClick:Me,onKeydown:Ne},[(0,s.unref)(R).length>0?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(o.t),{key:0,ref_key:`listElementRef`,ref:w,modelValue:T.value,"onUpdate:modelValue":u[2]||=e=>T.value=e,selected:(0,s.unref)(z),"onUpdate:selected":u[3]||=e=>(0,s.isRef)(z)?z.value=e:null,items:(0,s.unref)(R),"item-key":ae.value,"title-key":t.itemTitle,"subtitle-key":t.itemSubtitle,"icon-left-key":t.itemIconLeft,"disabled-key":t.itemDisabled,"selection-mode":(0,s.unref)(se),mandatory:!t.multiple,height:he.value,"max-height":ge.value,virtual:J.value,"item-props":ye,"selected-on-top":(0,s.unref)(G),"can-load-more":t.canLoadMore,"end-reached-distance":t.endReachedDistance,onEndReached:He},(0,s.createSlots)({_:2},[(0,s.unref)(_).option||(0,s.unref)(_)[`option-icon`]||t.closableOptions||(0,s.unref)(G)?{name:`item`,fn:(0,s.withCtx)(n=>[(0,s.unref)(_).option?(0,s.renderSlot)(l.$slots,`option`,(0,s.normalizeProps)((0,s.mergeProps)({key:0},n))):t.closableOptions?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(a.t),(0,s.normalizeProps)((0,s.mergeProps)({key:1},be(n))),(0,s.createSlots)({_:2},[(0,s.unref)(_)[`option-icon`]?{name:`icon-left`,fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(l.$slots,`option-icon`,(0,s.normalizeProps)((0,s.guardReactiveProps)(n)))]),key:`0`}:void 0,ve(n.key)?{name:`right`,fn:(0,s.withCtx)(t=>[(0,s.createVNode)((0,s.unref)(e.t),{appearance:(0,s.unref)(e.n).BARE,variant:(0,s.unref)(e.i).NEUTRAL,size:(0,s.unref)(e.r).SMALL,icon:`closeMini`,"aria-label":(0,s.unref)(g)(`select.removeOption`),disabled:t.disabled||t.readonly,tabindex:-1,onClick:(0,s.withModifiers)(e=>xe(n.key),[`stop`])},null,8,[`appearance`,`variant`,`size`,`aria-label`,`disabled`,`onClick`])]),key:`1`}:void 0]),1040)):((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(a.t),(0,s.normalizeProps)((0,s.mergeProps)({key:2},be(n))),(0,s.createSlots)({_:2},[(0,s.unref)(_)[`option-icon`]?{name:`icon-left`,fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(l.$slots,`option-icon`,(0,s.normalizeProps)((0,s.guardReactiveProps)(n)))]),key:`0`}:void 0]),1040))]),key:`0`}:void 0]),1032,[`modelValue`,`selected`,`items`,`item-key`,`title-key`,`subtitle-key`,`icon-left-key`,`disabled-key`,`selection-mode`,`mandatory`,`height`,`max-height`,`virtual`,`selected-on-top`,`can-load-more`,`end-reached-distance`])):((0,s.openBlock)(),(0,s.createElementBlock)(`div`,D,[(0,s.renderSlot)(l.$slots,`empty`,{},()=>[(0,s.createTextVNode)((0,s.toDisplayString)((0,s.unref)(g)(`select.noOptions`)),1)])]))],32)]),_:2},[(0,s.unref)(W)||(0,s.unref)(_)[`panel-header`]?{name:`header`,fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(l.$slots,`panel-header`),(0,s.unref)(W)?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(i.t),{key:0,ref_key:`panelSearchInputElementRef`,ref:C,modelValue:m.value,"onUpdate:modelValue":u[0]||=e=>m.value=e,placeholder:t.searchPlaceholder,disabled:t.disabled,clearable:!1,"icon-left":`search`,onClick:u[1]||=(0,s.withModifiers)(()=>{},[`stop`]),onKeydown:(0,s.unref)(Re)},null,8,[`modelValue`,`placeholder`,`disabled`,`onKeydown`])):(0,s.createCommentVNode)(``,!0)]),key:`0`}:void 0,(0,s.unref)(_)[`panel-footer`]?{name:`footer`,fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(l.$slots,`panel-footer`)]),key:`1`}:void 0]),1032,[`width`])]),_:3},8,[`modelValue`,`reference`,`disabled`,`match-reference-width`,`fit-viewport`,`surface-class`,`content-id`]),(0,s.createVNode)((0,s.unref)(i.t),{ref_key:`triggerInputRef`,ref:b,modelValue:x.value,"onUpdate:modelValue":u[7]||=e=>x.value=e,label:t.label,"label-props":t.labelProps,placeholder:t.placeholder,"help-messages":t.helpMessages,"error-messages":t.errorMessages,bordered:t.bordered,disabled:t.disabled,readonly:t.readonly,clearable:t.clearable,"has-value":(0,s.unref)(ce),focused:F.value||P.value,"icon-left":t.iconLeft,customize:t.customize,name:t.name,id:Se.value,onClear:Ve,onFocus:ze,onBlur:Be},(0,s.createSlots)({control:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`div`,{id:Se.value,class:(0,s.normalizeClass)([`s-ui-select__control s-ui-typography-body-14-regular`,{"s-ui-select__control--multiple":(0,s.unref)(G),"s-ui-select__control--empty":(0,s.unref)(G)&&!(0,s.unref)(ce)&&!(0,s.unref)(H),"s-ui-select__control--with-value-suffix":(0,s.unref)(_)[`value-suffix`]&&!(0,s.unref)(G)&&!(0,s.unref)(H)&&!(0,s.unref)(V)}]),role:`combobox`,"aria-expanded":P.value,"aria-controls":Ce.value,"aria-haspopup":`listbox`,"aria-disabled":t.disabled?!0:void 0,"aria-readonly":t.readonly?!0:void 0,"aria-autocomplete":(0,s.unref)(de)?`list`:void 0,tabindex:Ee.value,onClick:Pe,onKeydown:Ie},[(0,s.unref)(G)?(0,s.renderSlot)(l.$slots,`selection`,(0,s.normalizeProps)((0,s.mergeProps)({key:0},Te.value)),()=>[(0,s.unref)(B)?((0,s.openBlock)(),(0,s.createElementBlock)(`span`,k,(0,s.toDisplayString)((0,s.unref)(B)),1)):(0,s.unref)(V)&&!(0,s.unref)(H)?((0,s.openBlock)(),(0,s.createElementBlock)(`span`,A,(0,s.toDisplayString)(t.placeholder),1)):(0,s.createCommentVNode)(``,!0)]):(0,s.unref)(V)&&!(0,s.unref)(H)?((0,s.openBlock)(),(0,s.createElementBlock)(`span`,ee,(0,s.toDisplayString)(t.placeholder),1)):(0,s.unref)(H)?(0,s.createCommentVNode)(``,!0):((0,s.openBlock)(),(0,s.createElementBlock)(`span`,te,(0,s.toDisplayString)((0,s.unref)(le)),1)),(0,s.unref)(_)[`value-suffix`]&&!(0,s.unref)(G)&&!(0,s.unref)(H)&&!(0,s.unref)(V)?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,ne,[(0,s.renderSlot)(l.$slots,`value-suffix`,(0,s.normalizeProps)((0,s.guardReactiveProps)(me.value)))])):(0,s.createCommentVNode)(``,!0),(0,s.unref)(H)?(0,s.withDirectives)(((0,s.openBlock)(),(0,s.createElementBlock)(`input`,{key:4,ref_key:`searchInputElementRef`,ref:S,"onUpdate:modelValue":u[5]||=e=>m.value=e,class:`s-ui-select__search-input`,type:`text`,name:t.name,placeholder:t.placeholder,disabled:t.disabled,readonly:t.readonly,autocomplete:`off`,onClick:u[6]||=(0,s.withModifiers)(()=>{},[`stop`]),onFocus:je,onKeydown:Le},null,40,j)),[[s.vModelText,m.value]]):(0,s.createCommentVNode)(``,!0)],42,O)]),action:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.SIcon),{name:`chevronMiniDown`,size:M,class:`s-ui-select__chevron`})]),_:2},[(0,s.unref)(_).label?{name:`label`,fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(l.$slots,`label`)]),key:`0`}:void 0,(0,s.unref)(_).prefix?{name:`prefix`,fn:(0,s.withCtx)(e=>[(0,s.renderSlot)(l.$slots,`prefix`,(0,s.normalizeProps)((0,s.guardReactiveProps)(e)))]),key:`1`}:void 0,(0,s.unref)(_).prepend?{name:`prepend`,fn:(0,s.withCtx)(e=>[(0,s.renderSlot)(l.$slots,`prepend`,(0,s.normalizeProps)((0,s.guardReactiveProps)(e)))]),key:`2`}:void 0,(0,s.unref)(_).message?{name:`message`,fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(l.$slots,`message`)]),key:`3`}:void 0]),1032,[`modelValue`,`label`,`label-props`,`placeholder`,`help-messages`,`error-messages`,`bordered`,`disabled`,`readonly`,`clearable`,`has-value`,`focused`,`icon-left`,`customize`,`name`,`id`])],2))}});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return P}});
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { T as e, y as t } from "./useChartInteractivity-Cl06JL4l.js";
|
|
2
|
-
//#region src/utils/chart/core/createZeroLinePlugin.ts
|
|
3
|
-
var n = [4, 4], r = (r) => ({
|
|
4
|
-
id: "sUiChartZeroLine",
|
|
5
|
-
beforeDatasetsDraw(i) {
|
|
6
|
-
let { ctx: a, chartArea: o } = i, s = i.scales.y;
|
|
7
|
-
if (!o || !s || s.min >= 0 || s.max <= 0) return;
|
|
8
|
-
let c = s.getPixelForValue(0);
|
|
9
|
-
a.save(), a.beginPath(), a.setLineDash(n), a.moveTo(o.left, c), a.lineTo(o.right, c), a.lineWidth = 1, a.strokeStyle = e(t.axisLabel, r), a.stroke(), a.restore();
|
|
10
|
-
}
|
|
11
|
-
}), i = 3.5, a = 1.5, o = 8, s = 6, c = 6, l = "--s-ui-color-surface-primary", u = "--s-ui-color-text-surface-secondary", d = "--", f = /^var\(\s*(--[^,)]+)\s*\)$/, p = (e) => {
|
|
12
|
-
if (typeof window > "u") return "500 10px sans-serif";
|
|
13
|
-
let t = e ?? document.documentElement;
|
|
14
|
-
return `500 10px ${getComputedStyle(t).getPropertyValue("--s-ui-font-family-label").trim() || "sans-serif"}`;
|
|
15
|
-
}, m = (t, n, r) => {
|
|
16
|
-
if (!t) return r;
|
|
17
|
-
let i = t.startsWith(d) ? t : f.exec(t)?.[1];
|
|
18
|
-
return i ? e(i, n) || r : t;
|
|
19
|
-
}, h = (e, t, n, r, i) => {
|
|
20
|
-
let a = t === 0, o = t === n - 1, c = a ? e + s : o ? e - s - r : e - r / 2;
|
|
21
|
-
return Math.min(Math.max(c, i.left), i.right - r);
|
|
22
|
-
}, g = ({ markers: n, datasetIndex: r = 0 }, s) => ({
|
|
23
|
-
id: "sUiChartMarkers",
|
|
24
|
-
afterDatasetsDraw(d) {
|
|
25
|
-
if (n.length === 0) return;
|
|
26
|
-
let f = d.getDatasetMeta(r), { ctx: g, chartArea: _ } = d;
|
|
27
|
-
if (!f || !_) return;
|
|
28
|
-
let v = e(t.seriesPrimary, s), y = e(l, s), b = e(u, s), x = f.data.length;
|
|
29
|
-
g.save(), g.font = p(s), g.textAlign = "left", g.textBaseline = "middle", n.forEach((e) => {
|
|
30
|
-
let t = f.data[e.index];
|
|
31
|
-
if (!t) return;
|
|
32
|
-
let n = m(e.color, s, v);
|
|
33
|
-
if (g.beginPath(), g.arc(t.x, t.y, i, 0, Math.PI * 2), g.fillStyle = n, g.fill(), g.lineWidth = a, g.strokeStyle = y, g.stroke(), !e.label) return;
|
|
34
|
-
let r = g.measureText(e.label).width, l = h(t.x, e.index, x, r, _), u = t.y - i - o, d = t.y + i + o, p = u - c >= _.top, S = e.below || !p ? d : u;
|
|
35
|
-
g.fillStyle = e.color ? n : b, g.fillText(e.label, l, S);
|
|
36
|
-
}), g.restore();
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
//#endregion
|
|
40
|
-
export { r as n, g as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./useChartInteractivity-LbJiqlvI.cjs");var t=[4,4],n=n=>({id:`sUiChartZeroLine`,beforeDatasetsDraw(r){let{ctx:i,chartArea:a}=r,o=r.scales.y;if(!a||!o||o.min>=0||o.max<=0)return;let s=o.getPixelForValue(0);i.save(),i.beginPath(),i.setLineDash(t),i.moveTo(a.left,s),i.lineTo(a.right,s),i.lineWidth=1,i.strokeStyle=e.T(e.y.axisLabel,n),i.stroke(),i.restore()}}),r=3.5,i=1.5,a=8,o=6,s=6,c=`--s-ui-color-surface-primary`,l=`--s-ui-color-text-surface-secondary`,u=`--`,d=/^var\(\s*(--[^,)]+)\s*\)$/,f=e=>{if(typeof window>`u`)return`500 10px sans-serif`;let t=e??document.documentElement;return`500 10px ${getComputedStyle(t).getPropertyValue(`--s-ui-font-family-label`).trim()||`sans-serif`}`},p=(t,n,r)=>{if(!t)return r;let i=t.startsWith(u)?t:d.exec(t)?.[1];return i?e.T(i,n)||r:t},m=(e,t,n,r,i)=>{let a=t===0,s=t===n-1,c=a?e+o:s?e-o-r:e-r/2;return Math.min(Math.max(c,i.left),i.right-r)},h=({markers:t,datasetIndex:n=0},o)=>({id:`sUiChartMarkers`,afterDatasetsDraw(u){if(t.length===0)return;let d=u.getDatasetMeta(n),{ctx:h,chartArea:g}=u;if(!d||!g)return;let _=e.T(e.y.seriesPrimary,o),v=e.T(c,o),y=e.T(l,o),b=d.data.length;h.save(),h.font=f(o),h.textAlign=`left`,h.textBaseline=`middle`,t.forEach(e=>{let t=d.data[e.index];if(!t)return;let n=p(e.color,o,_);if(h.beginPath(),h.arc(t.x,t.y,r,0,Math.PI*2),h.fillStyle=n,h.fill(),h.lineWidth=i,h.strokeStyle=v,h.stroke(),!e.label)return;let c=h.measureText(e.label).width,l=m(t.x,e.index,b,c,g),u=t.y-r-a,f=t.y+r+a,x=u-s>=g.top,S=e.below||!x?f:u;h.fillStyle=e.color?n:y,h.fillText(e.label,l,S)}),h.restore()}});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
|
|
@@ -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.CLIPPING_ANCESTORS=`clipping-ancestors`,e.VIEWPORT=`viewport`,e}({}),o=function(e){return e.PREFERRED=`preferred`,e.FLIP=`flip`,e.SHIFT=`shift`,e.SIZE=`size`,e}({}),s=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}},c=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,l=(e,t,n)=>Math.min(Math.max(t,e),n),u=e=>e===n.TOP?`bottom`:e===n.BOTTOM?`top`:e===n.LEFT?`right`:`left`,d=({referenceCenter:e,floatingStart:t,floatingLength:n,crossAxisProperty:r,staticSide:i,staticOffset:a,arrowSize:o,arrowPadding:s})=>{let c=e-t-o/2,u=l(s,c,n-o-s),d=c-u;return{crossAxisPosition:u,crossAxisProperty:r,staticSide:i,staticOffset:a,centerOffset:d,isOverflow:Math.abs(d)>o/2}},f=e=>{let{referenceRect:t,floatingCoordinates:r,floatingSize:i,arrowSize:a,arrowPadding:o}=e,c=s(e.resolvedPlacement),l=u(c.side),f=-(a/2);return c.side===n.TOP||c.side===n.BOTTOM?d({referenceCenter:t.left+t.width/2,floatingStart:r.x,floatingLength:i.width,crossAxisProperty:`left`,staticSide:l,staticOffset:f,arrowSize:a,arrowPadding:o}):d({referenceCenter:t.top+t.height/2,floatingStart:r.y,floatingLength:i.height,crossAxisProperty:`top`,staticSide:l,staticOffset:f,arrowSize:a,arrowPadding:o})},p=.5,m=e=>e>p,h=(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}},g=(e,t)=>m(t===`top`?e.top:t===`bottom`?e.bottom:t===`left`?e.left:e.right),_=e=>m(e.top)||m(e.bottom)||m(e.left)||m(e.right),v=(e,t)=>t===n.TOP||t===n.BOTTOM?m(e.left)||m(e.right):m(e.top)||m(e.bottom),y=(e,t)=>e.bottom>t.top&&e.top<t.bottom&&e.right>t.left&&e.left<t.right,b=(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)}},x=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},S=(e,t,n)=>Math.min(Math.max(t,e),n),C=(e,t,n)=>e===`y`?{x:t.x,y:S(t.y+n.top,t.y,t.y-n.bottom)}:{x:S(t.x+n.left,t.x,t.x-n.right),y:t.y},w=e=>e===n.TOP||e===n.BOTTOM?{mainAxis:`x`,crossAxis:`y`}:{mainAxis:`y`,crossAxis:`x`},T=(e,t,n,i)=>i===r.START?e:i===r.END?e+t-n:e+(t-n)/2,E=(e,t,r,i)=>r.side===n.BOTTOM?{x:T(e.left,e.width,t.width,r.align),y:e.bottom+i}:r.side===n.TOP?{x:T(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:T(e.top,e.height,t.height,r.align)}:{x:e.right+i,y:T(e.top,e.height,t.height,r.align)},D=(e,t)=>({top:e.y,left:e.x,right:e.x+t.width,bottom:e.y+t.height,width:t.width,height:t.height}),O=(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},k=(e,t,n,r,i)=>t<=n?S(t,e,n):S(r,e,i),A=(e,t,n,r,i,a)=>{let{mainAxis:o}=w(t),{x:s,y:c}=e,l=O(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=k(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=k(s,i,a,l.min,l.max)}return{x:s,y:c}},j=(e,t,n)=>{let{anchorSide:r,referenceRect:i,viewportRect:a,viewportPadding:o,mainAxis:s=!0,crossAxis:c=!1}=n,l=h(D(e,t),a,o),{mainAxis:u,crossAxis:d}=w(r),f={x:e.x,y:e.y};return s&&(f=C(u,f,l)),c&&(f=C(d,f,l)),A(f,r,i,t,a,o)},M=e=>e===n.TOP?`top`:e===n.BOTTOM?`bottom`:e===n.LEFT?`left`:`right`,N=(e,t,n)=>{let r=t.bottom-n;return Math.max(0,Math.floor(r-e.y))},P=e=>{let t=s(e.placement),n=e.flip?[t,x(t)]:[t],r={anchor:t,coordinates:E(e.referenceRect,e.floatingSize,t,e.offset),strategy:o.PREFERRED};for(let i of n){let n=E(e.referenceRect,e.floatingSize,i,e.offset);if(!g(h(D(n,e.floatingSize),e.viewportRect,e.viewportPadding),M(i.side)))return{anchor:i,coordinates:n,strategy:i===t?o.PREFERRED:o.FLIP};r={anchor:i,coordinates:n,strategy:o.FLIP}}return r},F=(e,t)=>!e.shift||!_(h(D(t.coordinates,e.floatingSize),e.viewportRect,e.viewportPadding))?t:{...t,coordinates:j(t.coordinates,e.floatingSize,{anchorSide:t.anchor.side,referenceRect:e.referenceRect,viewportRect:e.viewportRect,viewportPadding:e.viewportPadding}),strategy:o.SHIFT},I=(e,t)=>{if(!e.fitViewport)return{coordinates:t.coordinates,strategy:t.strategy,maxHeight:void 0};let r=N(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:o.SIZE,maxHeight:r}},L=e=>{let t=F(e,P(e)),n=I(e,t);return{x:n.coordinates.x,y:n.coordinates.y,resolvedPlacement:c(t.anchor),strategy:n.strategy,maxHeight:n.maxHeight}},R=()=>{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}},z=e=>({top:e.top,left:e.left,right:e.right,bottom:e.bottom,width:e.width,height:e.height}),B=/auto|scroll|overlay|hidden|clip/,V=e=>{let t=window.getComputedStyle(e);return[t.overflow,t.overflowX,t.overflowY].some(e=>B.test(e))},H=(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)}},U=e=>{let t=R();if(!e)return t;let n=e.parentElement;for(;n;)V(n)&&(t=H(t,n.getBoundingClientRect())),n=n.parentElement;return t},W=/auto|scroll|overlay/,G=e=>{let t=window.getComputedStyle(e);return[t.overflow,t.overflowX,t.overflowY].some(e=>W.test(e))},K=e=>{let t=[],n=e?.parentElement??null;for(;n;)G(n)&&t.push(n),n=n.parentElement;return t},q=e=>e?e instanceof HTMLElement?e:e.$el instanceof HTMLElement?e.$el:null:null,J=e=>{let t=e.trim();if(!t)return;let n=parseFloat(t);if(!Number.isNaN(n))return n},Y=e=>{let t=getComputedStyle(e);return{arrowSize:J(t.getPropertyValue(`--s-ui-dropdown-arrow-size`))??12,arrowPadding:J(t.getPropertyValue(`--s-ui-dropdown-arrow-padding`))??8}},X=(e,t,n)=>{if(!n)return t;let r=e.firstElementChild;if(!(r instanceof HTMLElement))return Math.max(e.scrollHeight,t);let i=Math.max(0,t-r.clientHeight);return r.scrollHeight+i},Z=(t,n)=>(0,e.toValue)(t??n),Q=(e,t)=>e&&t instanceof HTMLElement?Y(t):{arrowSize:12,arrowPadding:8},$=(e,t,n,r,i,a,o,c)=>{let l=b(i,o),u=h(D(t,r),a,o),d=y(n,l),f=s(e.resolvedPlacement).side,p=c?!v(u,f):!_(u);return d&&p},ee=n=>{let r=(0,e.shallowRef)(null),o=(0,e.shallowRef)(void 0),s=(0,e.shallowRef)(i.BOTTOM_START),c=(0,e.shallowRef)(!1),l=(0,e.shallowRef)(0),u=(0,e.shallowRef)(null),d=(0,e.shallowRef)(!1),p=[],m=()=>{(0,e.toValue)(n.open)&&b()},h=()=>{for(let e of p)e();p=[]},g=()=>{h();let t=q((0,e.toValue)(n.reference));for(let e of K(t))e.addEventListener(`scroll`,m,{capture:!0,passive:!0}),p.push(()=>{e.removeEventListener(`scroll`,m,{capture:!0})})};(0,t.useEventListener)(window,`scroll`,m,{capture:!0}),(0,t.useEventListener)(document,`scroll`,m,{capture:!0}),(0,t.useEventListener)(()=>document.documentElement,`scroll`,m,{capture:!0}),(0,t.useEventListener)(()=>window.visualViewport??null,`scroll`,m,{passive:!0});let _=()=>({matchReferenceWidth:Z(n.matchReferenceWidth,!1),fitViewport:Z(n.fitViewport,!1),shift:Z(n.shift,!1),baseOffset:Z(n.offset,8),viewportPadding:Z(n.viewportPadding,8),hasArrow:Z(n.arrow,!1),placement:Z(n.placement,i.BOTTOM_START),flip:Z(n.flip,!0),boundary:Z(n.boundary,a.CLIPPING_ANCESTORS)}),v=(e,t)=>{if(!e){u.value=null,d.value=!1;return}let n=f({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});u.value=n,d.value=n.isOverflow},y=()=>{if(!(0,e.toValue)(n.open))return;let t=q((0,e.toValue)(n.reference)),i=(0,e.toValue)(n.panel);if(!t||!i)return;let u=_(),d=z(t.getBoundingClientRect()),f=z(i.getBoundingClientRect());l.value=Math.round(d.width);let p=i.firstElementChild,{arrowSize:m,arrowPadding:h}=Q(u.hasArrow,p),g=u.hasArrow?u.baseOffset+m/2:u.baseOffset,y={width:u.matchReferenceWidth&&d.width>0?d.width:f.width,height:X(i,f.height,u.fitViewport)},b=U(t),x=u.boundary===a.VIEWPORT?R():b,S=L({referenceRect:d,floatingSize:y,placement:u.placement,offset:g,flip:u.flip,shift:u.shift,fitViewport:u.fitViewport,viewportRect:x,viewportPadding:u.viewportPadding});r.value={x:Math.round(S.x),y:Math.round(S.y)},o.value=S.maxHeight===void 0?void 0:Math.floor(S.maxHeight),s.value=S.resolvedPlacement;let C={width:y.width,height:o.value??y.height};c.value=$(S,r.value,d,C,b,x,u.viewportPadding,u.shift),v(u.hasArrow,{referenceRect:d,result:S,renderedFloatingSize:C,arrowSize:m,arrowPadding:h})},b=()=>{y()},x=(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:c.value?`visible`:`hidden`,pointerEvents:c.value?`auto`:`none`};if(t&&l.value>0){let e=`${Math.round(l.value)}px`;i.width=e,i.minWidth=e,i.maxWidth=e}return i}),S=(0,e.computed)(()=>{if(!(0,e.toValue)(n.open)||!(0,e.toValue)(n.arrow??!1)||!u.value)return;let t=u.value;return{[t.crossAxisProperty]:`${t.crossAxisPosition}px`}}),C=()=>{n.onOpenChange?.(!1)};return(0,e.watch)(()=>(0,e.toValue)(n.open),async t=>{if(t){c.value=!1,await(0,e.nextTick)(),g(),b();return}c.value=!1,r.value=null,o.value=void 0,u.value=null,d.value=!1,h()}),(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),()=>(0,e.toValue)(n.boundary??a.CLIPPING_ANCESTORS)],async()=>{(0,e.toValue)(n.open)&&(c.value=!1,await(0,e.nextTick)(),b())}),(0,t.useResizeObserver)(()=>q((0,e.toValue)(n.reference)),()=>{(0,e.toValue)(n.open)&&b()}),(0,t.useResizeObserver)(()=>(0,e.toValue)(n.panel),()=>{(0,e.toValue)(n.open)&&b()}),(0,t.useEventListener)(window,`resize`,()=>{(0,e.toValue)(n.open)&&b()}),(0,t.useEventListener)(()=>window.visualViewport??null,`resize`,()=>{(0,e.toValue)(n.open)&&b()}),(0,t.onClickOutside)(()=>(0,e.toValue)(n.panel),()=>{!(0,e.toValue)(n.open)||!(0,e.toValue)(n.dismissOnClickOutside??!0)||C()},{ignore:[(0,e.computed)(()=>q((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`&&C()}),(0,e.onScopeDispose)(()=>{h()}),{panelStyles:x,panelMaxHeight:o,resolvedPlacement:s,isPositionReady:c,referenceWidth:l,arrowStyles:S,isArrowOverflow:d,updatePosition:b}};Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return ee}});
|