@oneb/ui-vue 0.3.13 → 0.3.15
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/dist/CheckIcon-09b84cf5.cjs +1 -0
- package/dist/CheckIcon-f1c94824.js +20 -0
- package/dist/ChevronDownIcon-6805ce6c.js +20 -0
- package/dist/ChevronDownIcon-6889ac87.cjs +1 -0
- package/dist/{ChevronRightIcon-8df1af46.js → ChevronRightIcon-4549a26b.js} +4 -21
- package/dist/ChevronRightIcon-7a2f0c20.cjs +1 -0
- package/dist/NoSymbolIcon-5d326416.cjs +1 -0
- package/dist/NoSymbolIcon-e58a9aee.js +71 -0
- package/dist/OneHelpMenu-66a2d4c2.cjs +1 -0
- package/dist/OneHelpMenu-d7a39a69.js +856 -0
- package/dist/OneMarkdown.vue_vue_type_style_index_0_lang-0ea8fbf8.cjs +1 -0
- package/dist/OneMarkdown.vue_vue_type_style_index_0_lang-4ed993c7.js +1 -0
- package/dist/{SpinnerIcon-516264ba.js → SpinnerIcon-74648c98.js} +6 -5
- package/dist/SpinnerIcon-ccb6f3fc.cjs +1 -0
- package/dist/SpinnerIcon.vue_vue_type_style_index_0_lang-0ea8fbf8.cjs +1 -0
- package/dist/SpinnerIcon.vue_vue_type_style_index_0_lang-4ed993c7.js +1 -0
- package/dist/button/index.cjs +1 -1
- package/dist/button/index.js +17 -16
- package/dist/buttonGroup/index.cjs +1 -0
- package/dist/buttonGroup/index.js +31 -0
- package/dist/checkbox/index.cjs +1 -0
- package/dist/checkbox/index.js +124 -0
- package/dist/collapse/index.cjs +1 -0
- package/dist/collapse/index.js +58 -0
- package/dist/common/index.cjs +1 -16
- package/dist/common/index.js +14 -3120
- package/dist/dataTable/index.cjs +1 -1
- package/dist/dataTable/index.js +846 -9
- package/dist/dropdown/index.cjs +1 -1
- package/dist/dropdown/index.js +792 -17
- package/dist/entityPicker/index.cjs +1 -0
- package/dist/entityPicker/index.js +584 -0
- package/dist/errorsPage/index.cjs +1 -0
- package/dist/errorsPage/index.js +63 -0
- package/dist/floating-ui.dom-2121a4fd.cjs +1 -0
- package/dist/floating-ui.dom-4509432e.js +941 -0
- package/dist/i18n/index.cjs +1 -0
- package/dist/{useI18n-2103b39e.js → i18n/index.js} +4 -4
- package/dist/index.cjs +1 -1
- package/dist/index.js +114 -10295
- package/dist/indicators/index.cjs +1 -0
- package/dist/indicators/index.js +84 -0
- package/dist/infobox/index.cjs +1 -0
- package/dist/infobox/index.js +111 -0
- package/dist/label/index.cjs +1 -0
- package/dist/label/index.js +47 -0
- package/dist/layout/index.cjs +1 -1
- package/dist/layout/index.js +115 -109
- package/dist/modal/index.cjs +1 -0
- package/dist/modal/index.js +41 -0
- package/dist/periodPicker/index.cjs +1 -0
- package/dist/periodPicker/index.js +1323 -0
- package/dist/radio/index.cjs +1 -0
- package/dist/radio/index.js +73 -0
- package/dist/skeleton/index.cjs +1 -0
- package/dist/skeleton/index.js +46 -0
- package/dist/style.css +1 -1
- package/dist/switch/index.cjs +1 -0
- package/dist/switch/index.js +142 -0
- package/dist/toast/index.cjs +1 -0
- package/dist/toast/index.js +140 -0
- package/dist/tooltip/index.cjs +1 -0
- package/dist/tooltip/index.js +20 -0
- package/dist/useModal-85f57682.js +177 -0
- package/dist/useModal-98810f6a.cjs +1 -0
- package/package.json +4 -4
- package/dist/ChevronRightIcon-6aa413c4.cjs +0 -1
- package/dist/OneHelpMenu-8e315cb3.js +0 -1791
- package/dist/OneHelpMenu-95ae3d5a.cjs +0 -1
- package/dist/SpinnerIcon-01be39fe.cjs +0 -1
- package/dist/index-19e93dfb.js +0 -954
- package/dist/index-85e729ab.cjs +0 -1
- package/dist/index-8b41a099.cjs +0 -1
- package/dist/index-98daa7ed.js +0 -862
- package/dist/useI18n-bcf9c640.cjs +0 -1
package/dist/dropdown/index.js
CHANGED
|
@@ -1,21 +1,796 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import "vue";
|
|
4
|
-
import "../
|
|
1
|
+
import { d as he, e as ye, _ as we, r as ge, f as ke } from "../OneHelpMenu-d7a39a69.js";
|
|
2
|
+
import { O as so, a as lo, c as no, b as ro } from "../OneHelpMenu-d7a39a69.js";
|
|
3
|
+
import { defineComponent as X, ref as C, watch as ce, onBeforeUnmount as be, provide as xe, computed as I, openBlock as o, createElementBlock as l, createElementVNode as t, renderSlot as V, normalizeProps as F, guardReactiveProps as P, createBlock as U, Teleport as Ce, createCommentVNode as m, withDirectives as q, normalizeClass as w, toDisplayString as u, vShow as _e, withCtx as z, createVNode as H, unref as y, normalizeStyle as J, Fragment as M, renderList as L, onMounted as $e, onUnmounted as Me, vModelText as le, mergeProps as R, createTextVNode as ne, nextTick as T } from "vue";
|
|
4
|
+
import { c as re, o as ae, s as ie, a as Ve } from "../floating-ui.dom-4509432e.js";
|
|
5
|
+
import { flip as ue } from "@floating-ui/vue";
|
|
6
|
+
import { _ as Ke } from "../_plugin-vue_export-helper-dad06003.js";
|
|
7
|
+
import { _ as de } from "../OneAvatar.vue_vue_type_script_setup_true_lang-08ab80dd.js";
|
|
8
|
+
import { useOnebI18n as Ae } from "../i18n/index.js";
|
|
9
|
+
import { u as Oe, O as je } from "../useModal-85f57682.js";
|
|
5
10
|
import "../XMarkIcon-51ef0691.js";
|
|
6
|
-
import "../
|
|
11
|
+
import "../ChevronDownIcon-6805ce6c.js";
|
|
12
|
+
import "../ChevronRightIcon-4549a26b.js";
|
|
7
13
|
import "../button/index.js";
|
|
8
|
-
import "../SpinnerIcon-
|
|
9
|
-
import "../
|
|
10
|
-
|
|
14
|
+
import "../SpinnerIcon-74648c98.js";
|
|
15
|
+
import "../SpinnerIcon.vue_vue_type_style_index_0_lang-4ed993c7.js";
|
|
16
|
+
const Ie = ["data-opened"], Be = {
|
|
17
|
+
key: 0,
|
|
18
|
+
class: "text-sm text-secondary-content px-3 py-2 text-left"
|
|
19
|
+
}, Le = /* @__PURE__ */ X({
|
|
20
|
+
__name: "OneDropdownAuto",
|
|
21
|
+
props: he,
|
|
22
|
+
emits: ["open", "close"],
|
|
23
|
+
setup(S, { emit: g }) {
|
|
24
|
+
const n = S, c = C(!1), f = C(null), x = C(null);
|
|
25
|
+
let h = null;
|
|
26
|
+
ce(c, (p) => {
|
|
27
|
+
p && x.value && f.value ? (re(x.value, f.value, {
|
|
28
|
+
placement: n.stick ? n.stick : "bottom-start",
|
|
29
|
+
strategy: "fixed",
|
|
30
|
+
middleware: [ae(5), ue(), ie({ padding: 8 })]
|
|
31
|
+
}).then(({ x: i, y: A }) => {
|
|
32
|
+
Object.assign(f.value.style, {
|
|
33
|
+
left: `${i}px`,
|
|
34
|
+
top: `${A}px`
|
|
35
|
+
});
|
|
36
|
+
}), h = Ve(x.value, f.value, () => {
|
|
37
|
+
re(x.value, f.value, {
|
|
38
|
+
placement: n.stick ? n.stick : "bottom-start",
|
|
39
|
+
strategy: "fixed",
|
|
40
|
+
middleware: [ae(4), ue(), ie({ padding: 8 })]
|
|
41
|
+
}).then(({ x: i, y: A }) => {
|
|
42
|
+
Object.assign(f.value.style, {
|
|
43
|
+
left: `${i}px`,
|
|
44
|
+
top: `${A}px`
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
})) : h && (h(), h = null);
|
|
48
|
+
}), be(() => {
|
|
49
|
+
h && h();
|
|
50
|
+
});
|
|
51
|
+
const d = g, _ = () => {
|
|
52
|
+
c.value = !c.value, c.value ? d("open") : d("close");
|
|
53
|
+
};
|
|
54
|
+
xe("OneDropdown", {
|
|
55
|
+
onToggle: _
|
|
56
|
+
});
|
|
57
|
+
const K = I(() => [
|
|
58
|
+
"fixed z-[10000] w-fit rounded-md bg-white",
|
|
59
|
+
"py-1 shadow-lg ring-black ring-opacity-5 focus:outline-none",
|
|
60
|
+
"overflow-auto max-h-[540px] min-w-[150px] max-w-[540px]"
|
|
61
|
+
]);
|
|
62
|
+
return (p, i) => (o(), l("div", {
|
|
63
|
+
class: "relative inline-block",
|
|
64
|
+
"data-opened": c.value
|
|
65
|
+
}, [
|
|
66
|
+
t("div", {
|
|
67
|
+
ref_key: "buttonRef",
|
|
68
|
+
ref: x
|
|
69
|
+
}, [
|
|
70
|
+
V(p.$slots, "button", F(P({ onToggle: _, isExpanded: c.value })))
|
|
71
|
+
], 512),
|
|
72
|
+
(o(), U(Ce, { to: "body" }, [
|
|
73
|
+
c.value ? (o(), l("div", {
|
|
74
|
+
key: 0,
|
|
75
|
+
class: "fixed top-0 left-0 w-screen h-screen z-[9999]",
|
|
76
|
+
onClick: _
|
|
77
|
+
})) : m("", !0),
|
|
78
|
+
q(t("div", {
|
|
79
|
+
ref_key: "menuRef",
|
|
80
|
+
ref: f,
|
|
81
|
+
class: w(["menu", K.value]),
|
|
82
|
+
role: "menu",
|
|
83
|
+
"aria-orientation": "vertical",
|
|
84
|
+
tabindex: "-1",
|
|
85
|
+
style: { display: "none" }
|
|
86
|
+
}, [
|
|
87
|
+
p.title ? (o(), l("div", Be, u(p.title), 1)) : m("", !0),
|
|
88
|
+
V(p.$slots, "menu", F(P({ onToggle: _ })))
|
|
89
|
+
], 2), [
|
|
90
|
+
[_e, c.value]
|
|
91
|
+
])
|
|
92
|
+
]))
|
|
93
|
+
], 8, Ie));
|
|
94
|
+
}
|
|
95
|
+
}), Se = {}, De = { class: "border-t border-secondary-stroke my-1" };
|
|
96
|
+
function ze(S, g) {
|
|
97
|
+
return o(), l("div", De);
|
|
98
|
+
}
|
|
99
|
+
const Zt = /* @__PURE__ */ Ke(Se, [["render", ze]]), Ee = ["onClick"], Re = { class: "grid" }, Fe = { class: "font-semibold px-3" }, Pe = { class: "rounded-lg m-3 border" }, Ue = {
|
|
100
|
+
class: "space-x-2 flex items-center px-3 py-2",
|
|
101
|
+
style: { width: "300px" }
|
|
102
|
+
}, We = { class: "flex-shrink-0" }, Ne = { class: "w-full text-left" }, Ge = { class: "flex-shrink-0" }, He = { class: "px-3 py-2" }, Te = { class: "text-secondary-content text-left pb-1 text-sm uppercase" }, qe = {
|
|
103
|
+
key: 0,
|
|
104
|
+
class: "space-y-2"
|
|
105
|
+
}, Je = ["onClick"], Xe = { class: "pl-2" }, Ye = { class: "text-sm mt-1" }, Ze = { class: "text-xs mt-1" }, pe = 3, Qt = /* @__PURE__ */ X({
|
|
106
|
+
__name: "OneBrowserMenuGrid",
|
|
107
|
+
props: ye,
|
|
108
|
+
setup(S) {
|
|
109
|
+
const g = S, n = () => {
|
|
110
|
+
typeof g.onChange == "function" && g.onChange();
|
|
111
|
+
}, c = C(!1), f = I(() => g.apps ? c.value ? g.apps : g.apps.slice(0, pe) : []), x = () => {
|
|
112
|
+
c.value = !c.value;
|
|
113
|
+
}, h = (d) => {
|
|
114
|
+
typeof g.onApp == "function" && g.onApp(d);
|
|
115
|
+
};
|
|
116
|
+
return (d, _) => (o(), U(we, { stick: "right" }, {
|
|
117
|
+
button: z(({ onToggle: K, isExpanded: p }) => [
|
|
118
|
+
t("button", {
|
|
119
|
+
onClick: K,
|
|
120
|
+
class: w(["p-1 rounded-md hover:bg-secondary-10", [p ? "bg-secondary-25" : ""]])
|
|
121
|
+
}, [
|
|
122
|
+
H(y(ge), {
|
|
123
|
+
class: "text-secondary-base",
|
|
124
|
+
style: J(`width: ${d.iconSize}px; height: ${d.iconSize}px`)
|
|
125
|
+
}, null, 8, ["style"])
|
|
126
|
+
], 10, Ee)
|
|
127
|
+
]),
|
|
128
|
+
menu: z(() => {
|
|
129
|
+
var K, p, i, A;
|
|
130
|
+
return [
|
|
131
|
+
t("div", Re, [
|
|
132
|
+
t("div", Fe, u((K = d.workspace) == null ? void 0 : K.title), 1),
|
|
133
|
+
t("div", Pe, [
|
|
134
|
+
t("div", Ue, [
|
|
135
|
+
t("div", We, [
|
|
136
|
+
H(de, {
|
|
137
|
+
text: ((p = d.workspace) == null ? void 0 : p.name) || "",
|
|
138
|
+
src: (i = d.workspace) == null ? void 0 : i.photo_url,
|
|
139
|
+
size: 44,
|
|
140
|
+
rounded: !1,
|
|
141
|
+
class: "mx-auto"
|
|
142
|
+
}, null, 8, ["text", "src"])
|
|
143
|
+
]),
|
|
144
|
+
t("div", Ne, u((A = d.workspace) == null ? void 0 : A.name), 1),
|
|
145
|
+
t("div", Ge, [
|
|
146
|
+
t("button", {
|
|
147
|
+
class: "text-sm border border-secondary-stroke rounded px-2 py-0.5 text-secondary-content hover:text-primary-content",
|
|
148
|
+
onClick: n
|
|
149
|
+
}, u(d.changeLabel), 1)
|
|
150
|
+
])
|
|
151
|
+
]),
|
|
152
|
+
_[0] || (_[0] = t("hr", null, null, -1))
|
|
153
|
+
])
|
|
154
|
+
]),
|
|
155
|
+
t("div", He, [
|
|
156
|
+
t("div", Te, u(d.appsTitle), 1),
|
|
157
|
+
t("div", null, [
|
|
158
|
+
d.apps && d.apps.length ? (o(), l("div", qe, [
|
|
159
|
+
(o(!0), l(M, null, L(f.value, (O) => (o(), l("div", {
|
|
160
|
+
key: O.id,
|
|
161
|
+
onClick: (W) => h(O),
|
|
162
|
+
class: "flex items-center rounded-lg hover:bg-secondary-10 border p-2 bg-[#FAFAFA] cursor-pointer"
|
|
163
|
+
}, [
|
|
164
|
+
H(de, {
|
|
165
|
+
text: O.name,
|
|
166
|
+
src: O.photo_url,
|
|
167
|
+
size: 44,
|
|
168
|
+
rounded: !1
|
|
169
|
+
}, null, 8, ["text", "src"]),
|
|
170
|
+
t("div", Xe, [
|
|
171
|
+
t("p", Ye, u(O.name), 1),
|
|
172
|
+
t("p", Ze, u(O.short), 1)
|
|
173
|
+
])
|
|
174
|
+
], 8, Je))), 128))
|
|
175
|
+
])) : m("", !0),
|
|
176
|
+
d.apps && d.apps.length > pe ? (o(), l("button", {
|
|
177
|
+
key: 1,
|
|
178
|
+
onClick: x,
|
|
179
|
+
class: "mt-2 w-full bg-[#FAFAFA] hover:bg-secondary-10 p-2 rounded-lg mb-5 text-xs"
|
|
180
|
+
}, u(c.value ? "Приховати" : "Дивитися всі"), 1)) : m("", !0)
|
|
181
|
+
])
|
|
182
|
+
])
|
|
183
|
+
];
|
|
184
|
+
}),
|
|
185
|
+
_: 1
|
|
186
|
+
}));
|
|
187
|
+
}
|
|
188
|
+
}), Qe = ["onClick"], et = ["onKeydown"], tt = {
|
|
189
|
+
key: 0,
|
|
190
|
+
class: "text-sm font-medium text-gray-700 px-3 pt-2.5 pb-1.5"
|
|
191
|
+
}, ot = {
|
|
192
|
+
key: 1,
|
|
193
|
+
class: "px-3 py-2"
|
|
194
|
+
}, st = { class: "relative" }, lt = ["placeholder"], nt = {
|
|
195
|
+
key: 2,
|
|
196
|
+
class: "border-b border-gray-100"
|
|
197
|
+
}, rt = ["onClick"], at = {
|
|
198
|
+
key: 3,
|
|
199
|
+
class: "flex items-center justify-between px-3 py-1.5 border-b border-gray-100"
|
|
200
|
+
}, it = {
|
|
201
|
+
key: 4,
|
|
202
|
+
class: "flex justify-center py-4"
|
|
203
|
+
}, ut = ["aria-selected", "onClick"], dt = {
|
|
204
|
+
key: 0,
|
|
205
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
206
|
+
fill: "none",
|
|
207
|
+
viewBox: "0 0 24 24",
|
|
208
|
+
"stroke-width": "1.5",
|
|
209
|
+
stroke: "currentColor",
|
|
210
|
+
class: "w-4 h-4 text-blue-600 shrink-0"
|
|
211
|
+
}, pt = {
|
|
212
|
+
key: 1,
|
|
213
|
+
class: "w-4 h-4 shrink-0"
|
|
214
|
+
}, ct = ["aria-selected", "onClick", "onMouseenter"], vt = {
|
|
215
|
+
key: 0,
|
|
216
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
217
|
+
fill: "none",
|
|
218
|
+
viewBox: "0 0 24 24",
|
|
219
|
+
"stroke-width": "1.5",
|
|
220
|
+
stroke: "currentColor",
|
|
221
|
+
class: "w-4 h-4 text-blue-600 shrink-0"
|
|
222
|
+
}, mt = {
|
|
223
|
+
key: 1,
|
|
224
|
+
class: "w-4 h-4 shrink-0"
|
|
225
|
+
}, ft = ["aria-selected", "onClick", "onMouseenter"], ht = {
|
|
226
|
+
key: 0,
|
|
227
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
228
|
+
fill: "none",
|
|
229
|
+
viewBox: "0 0 24 24",
|
|
230
|
+
"stroke-width": "1.5",
|
|
231
|
+
stroke: "currentColor",
|
|
232
|
+
class: "w-4 h-4 text-blue-600 shrink-0"
|
|
233
|
+
}, yt = {
|
|
234
|
+
key: 1,
|
|
235
|
+
class: "w-4 h-4 shrink-0"
|
|
236
|
+
}, wt = {
|
|
237
|
+
key: 3,
|
|
238
|
+
class: "px-3 py-4 text-sm text-gray-500 text-center"
|
|
239
|
+
}, gt = { class: "pb-6" }, kt = {
|
|
240
|
+
key: 0,
|
|
241
|
+
class: "relative px-3 py-3"
|
|
242
|
+
}, bt = { class: "relative" }, xt = ["placeholder"], Ct = {
|
|
243
|
+
key: 1,
|
|
244
|
+
class: "px-3 py-2"
|
|
245
|
+
}, _t = {
|
|
246
|
+
key: 2,
|
|
247
|
+
class: "flex items-center justify-between px-3 py-2 border-b border-gray-100"
|
|
248
|
+
}, $t = {
|
|
249
|
+
key: 3,
|
|
250
|
+
class: "flex justify-center py-8"
|
|
251
|
+
}, Mt = {
|
|
252
|
+
key: 4,
|
|
253
|
+
class: "overflow-auto h-[60dvh] divide-y",
|
|
254
|
+
role: "listbox"
|
|
255
|
+
}, Vt = ["aria-selected"], Kt = {
|
|
256
|
+
key: 0,
|
|
257
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
258
|
+
fill: "none",
|
|
259
|
+
viewBox: "0 0 24 24",
|
|
260
|
+
"stroke-width": "1.5",
|
|
261
|
+
stroke: "currentColor",
|
|
262
|
+
class: "w-5 h-5 text-blue-600 shrink-0"
|
|
263
|
+
}, At = {
|
|
264
|
+
key: 1,
|
|
265
|
+
class: "w-5 h-5 shrink-0"
|
|
266
|
+
}, Ot = {
|
|
267
|
+
key: 0,
|
|
268
|
+
class: "px-3 pt-3 pb-2 text-xs font-semibold text-gray-400 uppercase tracking-wide"
|
|
269
|
+
}, jt = ["aria-selected", "onClick"], It = {
|
|
270
|
+
key: 0,
|
|
271
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
272
|
+
fill: "none",
|
|
273
|
+
viewBox: "0 0 24 24",
|
|
274
|
+
"stroke-width": "1.5",
|
|
275
|
+
stroke: "currentColor",
|
|
276
|
+
class: "w-5 h-5 text-blue-600 shrink-0"
|
|
277
|
+
}, Bt = {
|
|
278
|
+
key: 1,
|
|
279
|
+
class: "w-5 h-5 shrink-0"
|
|
280
|
+
}, Lt = ["aria-selected", "onClick"], St = {
|
|
281
|
+
key: 0,
|
|
282
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
283
|
+
fill: "none",
|
|
284
|
+
viewBox: "0 0 24 24",
|
|
285
|
+
"stroke-width": "1.5",
|
|
286
|
+
stroke: "currentColor",
|
|
287
|
+
class: "w-5 h-5 text-blue-600 shrink-0"
|
|
288
|
+
}, Dt = {
|
|
289
|
+
key: 1,
|
|
290
|
+
class: "w-5 h-5 shrink-0"
|
|
291
|
+
}, zt = {
|
|
292
|
+
key: 3,
|
|
293
|
+
class: "px-3 py-8 text-sm text-gray-500 text-center"
|
|
294
|
+
}, eo = /* @__PURE__ */ X({
|
|
295
|
+
__name: "OneDropdownSelect",
|
|
296
|
+
props: ke,
|
|
297
|
+
emits: ["update:modelValue", "search", "create"],
|
|
298
|
+
setup(S, { emit: g }) {
|
|
299
|
+
const n = S, c = Ae(), f = g, x = C(!1);
|
|
300
|
+
let h = null;
|
|
301
|
+
$e(() => {
|
|
302
|
+
h = window.matchMedia("(max-width: 767px)"), x.value = h.matches;
|
|
303
|
+
const e = (s) => {
|
|
304
|
+
x.value = s.matches;
|
|
305
|
+
};
|
|
306
|
+
h.addEventListener("change", e), Me(() => {
|
|
307
|
+
h == null || h.removeEventListener("change", e);
|
|
308
|
+
});
|
|
309
|
+
});
|
|
310
|
+
const d = Oe(), _ = C(null), K = () => {
|
|
311
|
+
p.value = "", i.value = -1, d.open(), T(() => {
|
|
312
|
+
var e;
|
|
313
|
+
(e = _.value) == null || e.focus();
|
|
314
|
+
});
|
|
315
|
+
}, p = C(""), i = C(-1), A = C(null), O = C(null), W = C({}), N = (e, s) => {
|
|
316
|
+
e && (W.value[s] = e);
|
|
317
|
+
}, D = I(() => n.allowEmpty ? 1 : 0), B = I(() => {
|
|
318
|
+
if (!p.value.trim())
|
|
319
|
+
return n.items;
|
|
320
|
+
const e = p.value.toLowerCase();
|
|
321
|
+
return n.items.filter(
|
|
322
|
+
(s) => String(s[n.labelKey] ?? "").toLowerCase().includes(e)
|
|
323
|
+
);
|
|
324
|
+
}), Y = I(() => {
|
|
325
|
+
if (!n.groupKey)
|
|
326
|
+
return [];
|
|
327
|
+
const e = [], s = /* @__PURE__ */ new Map();
|
|
328
|
+
let a = D.value;
|
|
329
|
+
for (const r of B.value) {
|
|
330
|
+
const b = String(r[n.groupKey] ?? "");
|
|
331
|
+
let v = s.get(b);
|
|
332
|
+
v || (v = { label: b, entries: [] }, s.set(b, v), e.push(v)), v.entries.push({ item: r, flatIndex: a }), a++;
|
|
333
|
+
}
|
|
334
|
+
return e;
|
|
335
|
+
}), $ = I(() => n.multiple ? (n.modelValue ?? []).length > 0 : n.modelValue !== null && n.modelValue !== void 0), E = I(() => {
|
|
336
|
+
if (n.multiple) {
|
|
337
|
+
const e = n.modelValue ?? [];
|
|
338
|
+
return e.length === 0 ? n.placeholder : e.length === 1 ? e[0][n.labelKey] ?? n.placeholder : `${e[0][n.labelKey]} +${e.length - 1}`;
|
|
339
|
+
}
|
|
340
|
+
return n.modelValue === null || n.modelValue === void 0 ? n.placeholder : n.modelValue[n.labelKey] ?? n.placeholder;
|
|
341
|
+
}), k = (e) => n.modelValue ? n.multiple ? n.modelValue.some((a) => a[n.valueKey] === e[n.valueKey]) : n.modelValue[n.valueKey] === e[n.valueKey] : !1, Z = I(() => B.value.length + D.value), j = (e, s) => {
|
|
342
|
+
if (n.multiple) {
|
|
343
|
+
const a = (n.modelValue ?? []).slice();
|
|
344
|
+
if (e === null) {
|
|
345
|
+
f("update:modelValue", []);
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
const r = a.findIndex((b) => b[n.valueKey] === e[n.valueKey]);
|
|
349
|
+
r >= 0 ? a.splice(r, 1) : a.push(e), f("update:modelValue", a);
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
f("update:modelValue", e), s();
|
|
353
|
+
}, Q = () => {
|
|
354
|
+
f("update:modelValue", [...n.items]);
|
|
355
|
+
}, ee = () => {
|
|
356
|
+
f("update:modelValue", []);
|
|
357
|
+
}, te = (e) => {
|
|
358
|
+
f("create", p.value), e();
|
|
359
|
+
}, ve = () => {
|
|
360
|
+
p.value = "", i.value = -1, T(() => {
|
|
361
|
+
var e;
|
|
362
|
+
(e = A.value) == null || e.focus();
|
|
363
|
+
});
|
|
364
|
+
}, me = () => {
|
|
365
|
+
p.value = "", i.value = -1;
|
|
366
|
+
}, oe = () => {
|
|
367
|
+
i.value = 0, f("search", p.value);
|
|
368
|
+
}, se = () => {
|
|
369
|
+
T(() => {
|
|
370
|
+
const e = W.value[i.value];
|
|
371
|
+
e && e.scrollIntoView({ block: "nearest" });
|
|
372
|
+
});
|
|
373
|
+
}, fe = (e, s) => {
|
|
374
|
+
switch (e.key) {
|
|
375
|
+
case "ArrowDown":
|
|
376
|
+
e.preventDefault(), i.value < Z.value - 1 ? i.value++ : i.value = 0, se();
|
|
377
|
+
break;
|
|
378
|
+
case "ArrowUp":
|
|
379
|
+
e.preventDefault(), i.value > 0 ? i.value-- : i.value = Z.value - 1, se();
|
|
380
|
+
break;
|
|
381
|
+
case "Enter":
|
|
382
|
+
if (e.preventDefault(), i.value >= 0)
|
|
383
|
+
if (n.allowEmpty && i.value === 0)
|
|
384
|
+
j(null, s);
|
|
385
|
+
else {
|
|
386
|
+
const a = i.value - D.value, r = B.value[a];
|
|
387
|
+
r && j(r, s);
|
|
388
|
+
}
|
|
389
|
+
break;
|
|
390
|
+
case "Escape":
|
|
391
|
+
e.preventDefault(), s();
|
|
392
|
+
break;
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
return ce(p, () => {
|
|
396
|
+
i.value = 0;
|
|
397
|
+
}), (e, s) => x.value ? (o(), l(M, { key: 1 }, [
|
|
398
|
+
V(e.$slots, "button", F(P({ onToggle: K, isExpanded: y(d).isOpened.value, selectedLabel: E.value })), () => [
|
|
399
|
+
t("button", {
|
|
400
|
+
class: w(["inline-flex items-center justify-between gap-2 text-sm transition-colors", [
|
|
401
|
+
e.view === "pill" ? "rounded-full bg-gray-100 px-3.5 py-1.5 hover:bg-gray-200 text-gray-700" : "rounded-lg border border-gray-300 bg-white px-3 py-2 hover:bg-gray-50 min-w-[180px]"
|
|
402
|
+
]]),
|
|
403
|
+
style: J(e.maxWidth ? { maxWidth: e.maxWidth } : void 0),
|
|
404
|
+
onClick: K
|
|
405
|
+
}, [
|
|
406
|
+
t("span", {
|
|
407
|
+
class: w(["truncate", e.view === "pill" ? "" : $.value ? "text-gray-900" : "text-gray-500"])
|
|
408
|
+
}, u(E.value), 3),
|
|
409
|
+
s[12] || (s[12] = t("svg", {
|
|
410
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
411
|
+
fill: "none",
|
|
412
|
+
viewBox: "0 0 24 24",
|
|
413
|
+
"stroke-width": "1.5",
|
|
414
|
+
stroke: "currentColor",
|
|
415
|
+
class: "w-4 h-4 text-gray-400 shrink-0"
|
|
416
|
+
}, [
|
|
417
|
+
t("path", {
|
|
418
|
+
"stroke-linecap": "round",
|
|
419
|
+
"stroke-linejoin": "round",
|
|
420
|
+
d: "M19.5 8.25l-7.5 7.5-7.5-7.5"
|
|
421
|
+
})
|
|
422
|
+
], -1))
|
|
423
|
+
], 6)
|
|
424
|
+
]),
|
|
425
|
+
y(d).isOpened.value ? (o(), U(y(je), {
|
|
426
|
+
key: 0,
|
|
427
|
+
useModal: y(d),
|
|
428
|
+
title: e.title || e.placeholder,
|
|
429
|
+
size: "sm",
|
|
430
|
+
classModal: !0,
|
|
431
|
+
titleCenter: !0
|
|
432
|
+
}, {
|
|
433
|
+
default: z(() => [
|
|
434
|
+
t("div", gt, [
|
|
435
|
+
e.searchable ? (o(), l("div", kt, [
|
|
436
|
+
t("div", bt, [
|
|
437
|
+
s[13] || (s[13] = t("svg", {
|
|
438
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
439
|
+
fill: "none",
|
|
440
|
+
viewBox: "0 0 24 24",
|
|
441
|
+
"stroke-width": "1.5",
|
|
442
|
+
stroke: "currentColor",
|
|
443
|
+
class: "absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"
|
|
444
|
+
}, [
|
|
445
|
+
t("path", {
|
|
446
|
+
"stroke-linecap": "round",
|
|
447
|
+
"stroke-linejoin": "round",
|
|
448
|
+
d: "M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"
|
|
449
|
+
})
|
|
450
|
+
], -1)),
|
|
451
|
+
q(t("input", {
|
|
452
|
+
ref_key: "mobileSearchInputRef",
|
|
453
|
+
ref: _,
|
|
454
|
+
"onUpdate:modelValue": s[2] || (s[2] = (a) => p.value = a),
|
|
455
|
+
type: "text",
|
|
456
|
+
placeholder: e.searchPlaceholder,
|
|
457
|
+
class: "w-full rounded-md border border-gray-300 py-2 pl-8 pr-3 text-sm outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",
|
|
458
|
+
onInput: oe
|
|
459
|
+
}, null, 40, xt), [
|
|
460
|
+
[le, p.value]
|
|
461
|
+
])
|
|
462
|
+
])
|
|
463
|
+
])) : m("", !0),
|
|
464
|
+
e.createLabel ? (o(), l("div", Ct, [
|
|
465
|
+
t("button", {
|
|
466
|
+
class: "w-full flex items-center justify-center gap-2 py-2 text-sm text-blue-700 hover:text-blue-500",
|
|
467
|
+
onClick: s[3] || (s[3] = (a) => te(() => y(d).close()))
|
|
468
|
+
}, [
|
|
469
|
+
s[14] || (s[14] = t("svg", {
|
|
470
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
471
|
+
fill: "none",
|
|
472
|
+
viewBox: "0 0 24 24",
|
|
473
|
+
"stroke-width": "1.5",
|
|
474
|
+
stroke: "currentColor",
|
|
475
|
+
class: "w-4 h-4"
|
|
476
|
+
}, [
|
|
477
|
+
t("path", {
|
|
478
|
+
"stroke-linecap": "round",
|
|
479
|
+
"stroke-linejoin": "round",
|
|
480
|
+
d: "M12 4.5v15m7.5-7.5h-15"
|
|
481
|
+
})
|
|
482
|
+
], -1)),
|
|
483
|
+
t("span", null, u(e.createLabel), 1)
|
|
484
|
+
])
|
|
485
|
+
])) : m("", !0),
|
|
486
|
+
e.multiple ? (o(), l("div", _t, [
|
|
487
|
+
t("button", {
|
|
488
|
+
class: "text-sm text-blue-600 hover:text-blue-800 transition-colors",
|
|
489
|
+
onClick: Q
|
|
490
|
+
}, u(y(c)("ui.dropdown.selectAll")), 1),
|
|
491
|
+
$.value ? (o(), l("button", {
|
|
492
|
+
key: 0,
|
|
493
|
+
class: "text-sm text-gray-500 hover:text-gray-700 transition-colors",
|
|
494
|
+
onClick: ee
|
|
495
|
+
}, u(y(c)("ui.dropdown.clear")), 1)) : m("", !0)
|
|
496
|
+
])) : m("", !0),
|
|
497
|
+
e.isLoading ? (o(), l("div", $t, [...s[15] || (s[15] = [
|
|
498
|
+
t("div", { class: "animate-spin w-6 h-6 border-2 border-blue-500 border-t-transparent rounded-full" }, null, -1)
|
|
499
|
+
])])) : (o(), l("div", Mt, [
|
|
500
|
+
e.allowEmpty ? (o(), l("button", {
|
|
501
|
+
key: 0,
|
|
502
|
+
class: w(["flex items-center gap-3 w-full px-3 py-3 text-sm text-left hover:bg-gray-50 transition-colors", $.value ? "" : "bg-gray-50 font-medium"]),
|
|
503
|
+
role: "option",
|
|
504
|
+
"aria-selected": !$.value,
|
|
505
|
+
onClick: s[4] || (s[4] = (a) => j(null, () => y(d).close()))
|
|
506
|
+
}, [
|
|
507
|
+
$.value ? (o(), l("span", At)) : (o(), l("svg", Kt, [...s[16] || (s[16] = [
|
|
508
|
+
t("path", {
|
|
509
|
+
"stroke-linecap": "round",
|
|
510
|
+
"stroke-linejoin": "round",
|
|
511
|
+
d: "M4.5 12.75l6 6 9-13.5"
|
|
512
|
+
}, null, -1)
|
|
513
|
+
])])),
|
|
514
|
+
t("span", null, u(e.emptyLabel ?? e.placeholder), 1)
|
|
515
|
+
], 10, Vt)) : m("", !0),
|
|
516
|
+
e.groupKey ? (o(!0), l(M, { key: 1 }, L(Y.value, (a) => (o(), l(M, {
|
|
517
|
+
key: a.label
|
|
518
|
+
}, [
|
|
519
|
+
a.label ? (o(), l("div", Ot, u(a.label), 1)) : m("", !0),
|
|
520
|
+
(o(!0), l(M, null, L(a.entries, (r) => (o(), l("button", {
|
|
521
|
+
key: r.item[e.valueKey],
|
|
522
|
+
class: w(["flex items-center gap-3 w-full px-3 py-3 text-sm text-left hover:bg-gray-50 transition-colors break-words", k(r.item) ? "bg-gray-50 font-medium" : ""]),
|
|
523
|
+
role: "option",
|
|
524
|
+
"aria-selected": k(r.item),
|
|
525
|
+
onClick: (b) => j(r.item, () => y(d).close())
|
|
526
|
+
}, [
|
|
527
|
+
k(r.item) ? (o(), l("svg", It, [...s[17] || (s[17] = [
|
|
528
|
+
t("path", {
|
|
529
|
+
"stroke-linecap": "round",
|
|
530
|
+
"stroke-linejoin": "round",
|
|
531
|
+
d: "M4.5 12.75l6 6 9-13.5"
|
|
532
|
+
}, null, -1)
|
|
533
|
+
])])) : (o(), l("span", Bt)),
|
|
534
|
+
V(e.$slots, "item", R({ ref_for: !0 }, { item: r.item }), () => [
|
|
535
|
+
t("span", null, u(r.item[e.labelKey]), 1)
|
|
536
|
+
])
|
|
537
|
+
], 10, jt))), 128))
|
|
538
|
+
], 64))), 128)) : (o(!0), l(M, { key: 2 }, L(B.value, (a) => (o(), l("button", {
|
|
539
|
+
key: a[e.valueKey],
|
|
540
|
+
class: w(["flex items-center gap-3 w-full px-3 py-3 text-sm text-left hover:bg-gray-50 transition-colors break-words", k(a) ? "bg-gray-50 font-medium" : ""]),
|
|
541
|
+
role: "option",
|
|
542
|
+
"aria-selected": k(a),
|
|
543
|
+
onClick: (r) => j(a, () => y(d).close())
|
|
544
|
+
}, [
|
|
545
|
+
k(a) ? (o(), l("svg", St, [...s[18] || (s[18] = [
|
|
546
|
+
t("path", {
|
|
547
|
+
"stroke-linecap": "round",
|
|
548
|
+
"stroke-linejoin": "round",
|
|
549
|
+
d: "M4.5 12.75l6 6 9-13.5"
|
|
550
|
+
}, null, -1)
|
|
551
|
+
])])) : (o(), l("span", Dt)),
|
|
552
|
+
V(e.$slots, "item", R({ ref_for: !0 }, { item: a }), () => [
|
|
553
|
+
t("span", null, u(a[e.labelKey]), 1)
|
|
554
|
+
])
|
|
555
|
+
], 10, Lt))), 128)),
|
|
556
|
+
B.value.length === 0 && !e.allowEmpty ? (o(), l("div", zt, [
|
|
557
|
+
V(e.$slots, "empty", {}, () => [
|
|
558
|
+
ne(u(y(c)("ui.dropdown.nothingFound")), 1)
|
|
559
|
+
])
|
|
560
|
+
])) : m("", !0)
|
|
561
|
+
]))
|
|
562
|
+
])
|
|
563
|
+
]),
|
|
564
|
+
_: 3
|
|
565
|
+
}, 8, ["useModal", "title"])) : m("", !0)
|
|
566
|
+
], 64)) : (o(), U(Le, {
|
|
567
|
+
key: 0,
|
|
568
|
+
stick: e.stick,
|
|
569
|
+
onOpen: ve,
|
|
570
|
+
onClose: me
|
|
571
|
+
}, {
|
|
572
|
+
button: z(({ onToggle: a, isExpanded: r }) => [
|
|
573
|
+
V(e.$slots, "button", F(P({ onToggle: a, isExpanded: r, selectedLabel: E.value })), () => [
|
|
574
|
+
t("button", {
|
|
575
|
+
class: w(["inline-flex items-center justify-between gap-2 text-sm transition-colors", [
|
|
576
|
+
e.view === "pill" ? "rounded-full bg-gray-100 px-3.5 py-1.5 hover:bg-gray-200 text-gray-700" : "rounded-lg border border-gray-300 bg-white px-3 py-2 hover:bg-gray-50 min-w-[180px]",
|
|
577
|
+
e.view === "default" && r ? "ring-1 ring-blue-500 border-blue-500" : ""
|
|
578
|
+
]]),
|
|
579
|
+
style: J(e.maxWidth ? { maxWidth: e.maxWidth } : void 0),
|
|
580
|
+
onClick: a
|
|
581
|
+
}, [
|
|
582
|
+
t("span", {
|
|
583
|
+
class: w(["truncate", e.view === "pill" ? "" : $.value ? "text-gray-900" : "text-gray-500"])
|
|
584
|
+
}, u(E.value), 3),
|
|
585
|
+
(o(), l("svg", {
|
|
586
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
587
|
+
fill: "none",
|
|
588
|
+
viewBox: "0 0 24 24",
|
|
589
|
+
"stroke-width": "1.5",
|
|
590
|
+
stroke: "currentColor",
|
|
591
|
+
class: w(["w-4 h-4 text-gray-400 transition-transform shrink-0", r ? "rotate-180" : ""])
|
|
592
|
+
}, [...s[5] || (s[5] = [
|
|
593
|
+
t("path", {
|
|
594
|
+
"stroke-linecap": "round",
|
|
595
|
+
"stroke-linejoin": "round",
|
|
596
|
+
d: "M19.5 8.25l-7.5 7.5-7.5-7.5"
|
|
597
|
+
}, null, -1)
|
|
598
|
+
])], 2))
|
|
599
|
+
], 14, Qe)
|
|
600
|
+
])
|
|
601
|
+
]),
|
|
602
|
+
menu: z(({ onToggle: a }) => [
|
|
603
|
+
t("div", {
|
|
604
|
+
class: "min-w-[240px] w-full",
|
|
605
|
+
onKeydown: (r) => fe(r, a)
|
|
606
|
+
}, [
|
|
607
|
+
e.title ? (o(), l("div", tt, u(e.title), 1)) : m("", !0),
|
|
608
|
+
e.searchable ? (o(), l("div", ot, [
|
|
609
|
+
t("div", st, [
|
|
610
|
+
s[6] || (s[6] = t("svg", {
|
|
611
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
612
|
+
fill: "none",
|
|
613
|
+
viewBox: "0 0 24 24",
|
|
614
|
+
"stroke-width": "1.5",
|
|
615
|
+
stroke: "currentColor",
|
|
616
|
+
class: "absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"
|
|
617
|
+
}, [
|
|
618
|
+
t("path", {
|
|
619
|
+
"stroke-linecap": "round",
|
|
620
|
+
"stroke-linejoin": "round",
|
|
621
|
+
d: "M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"
|
|
622
|
+
})
|
|
623
|
+
], -1)),
|
|
624
|
+
q(t("input", {
|
|
625
|
+
ref_key: "searchInputRef",
|
|
626
|
+
ref: A,
|
|
627
|
+
"onUpdate:modelValue": s[0] || (s[0] = (r) => p.value = r),
|
|
628
|
+
type: "text",
|
|
629
|
+
placeholder: e.searchPlaceholder,
|
|
630
|
+
class: "w-full rounded-md border border-gray-300 py-1.5 pl-8 pr-3 text-sm outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500",
|
|
631
|
+
onInput: oe
|
|
632
|
+
}, null, 40, lt), [
|
|
633
|
+
[le, p.value]
|
|
634
|
+
])
|
|
635
|
+
])
|
|
636
|
+
])) : m("", !0),
|
|
637
|
+
e.createLabel ? (o(), l("div", nt, [
|
|
638
|
+
t("button", {
|
|
639
|
+
class: "flex items-center gap-2 w-full px-3 py-2 text-sm text-blue-700 hover:bg-gray-50 transition-colors",
|
|
640
|
+
onClick: (r) => te(a)
|
|
641
|
+
}, [
|
|
642
|
+
s[7] || (s[7] = t("svg", {
|
|
643
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
644
|
+
fill: "none",
|
|
645
|
+
viewBox: "0 0 24 24",
|
|
646
|
+
"stroke-width": "1.5",
|
|
647
|
+
stroke: "currentColor",
|
|
648
|
+
class: "w-4 h-4"
|
|
649
|
+
}, [
|
|
650
|
+
t("path", {
|
|
651
|
+
"stroke-linecap": "round",
|
|
652
|
+
"stroke-linejoin": "round",
|
|
653
|
+
d: "M12 4.5v15m7.5-7.5h-15"
|
|
654
|
+
})
|
|
655
|
+
], -1)),
|
|
656
|
+
t("span", null, u(e.createLabel), 1)
|
|
657
|
+
], 8, rt)
|
|
658
|
+
])) : m("", !0),
|
|
659
|
+
e.multiple ? (o(), l("div", at, [
|
|
660
|
+
t("button", {
|
|
661
|
+
class: "text-xs text-blue-600 hover:text-blue-800 transition-colors",
|
|
662
|
+
onClick: Q
|
|
663
|
+
}, u(y(c)("ui.dropdown.selectAll")), 1),
|
|
664
|
+
$.value ? (o(), l("button", {
|
|
665
|
+
key: 0,
|
|
666
|
+
class: "text-xs text-gray-500 hover:text-gray-700 transition-colors",
|
|
667
|
+
onClick: ee
|
|
668
|
+
}, u(y(c)("ui.dropdown.clear")), 1)) : m("", !0)
|
|
669
|
+
])) : m("", !0),
|
|
670
|
+
e.isLoading ? (o(), l("div", it, [...s[8] || (s[8] = [
|
|
671
|
+
t("svg", {
|
|
672
|
+
class: "animate-spin h-5 w-5 text-gray-400",
|
|
673
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
674
|
+
fill: "none",
|
|
675
|
+
viewBox: "0 0 24 24"
|
|
676
|
+
}, [
|
|
677
|
+
t("circle", {
|
|
678
|
+
class: "opacity-25",
|
|
679
|
+
cx: "12",
|
|
680
|
+
cy: "12",
|
|
681
|
+
r: "10",
|
|
682
|
+
stroke: "currentColor",
|
|
683
|
+
"stroke-width": "4"
|
|
684
|
+
}),
|
|
685
|
+
t("path", {
|
|
686
|
+
class: "opacity-75",
|
|
687
|
+
fill: "currentColor",
|
|
688
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
|
|
689
|
+
})
|
|
690
|
+
], -1)
|
|
691
|
+
])])) : (o(), l("div", {
|
|
692
|
+
key: 5,
|
|
693
|
+
ref_key: "listRef",
|
|
694
|
+
ref: O,
|
|
695
|
+
class: "max-h-[300px] overflow-y-auto",
|
|
696
|
+
role: "listbox"
|
|
697
|
+
}, [
|
|
698
|
+
e.allowEmpty ? (o(), l("button", {
|
|
699
|
+
key: 0,
|
|
700
|
+
ref: (r) => N(r, 0),
|
|
701
|
+
class: w(["flex items-center gap-2 w-full px-3 py-2 text-sm text-left transition-colors", [
|
|
702
|
+
$.value ? "hover:bg-gray-50" : "bg-gray-100 font-medium",
|
|
703
|
+
i.value === 0 ? "bg-gray-50" : ""
|
|
704
|
+
]]),
|
|
705
|
+
role: "option",
|
|
706
|
+
"aria-selected": !$.value,
|
|
707
|
+
onClick: (r) => j(null, a),
|
|
708
|
+
onMouseenter: s[1] || (s[1] = (r) => i.value = 0)
|
|
709
|
+
}, [
|
|
710
|
+
$.value ? (o(), l("span", pt)) : (o(), l("svg", dt, [...s[9] || (s[9] = [
|
|
711
|
+
t("path", {
|
|
712
|
+
"stroke-linecap": "round",
|
|
713
|
+
"stroke-linejoin": "round",
|
|
714
|
+
d: "M4.5 12.75l6 6 9-13.5"
|
|
715
|
+
}, null, -1)
|
|
716
|
+
])])),
|
|
717
|
+
t("span", null, u(e.emptyLabel ?? e.placeholder), 1)
|
|
718
|
+
], 42, ut)) : m("", !0),
|
|
719
|
+
e.groupKey ? (o(!0), l(M, { key: 1 }, L(Y.value, (r, b) => (o(), l(M, {
|
|
720
|
+
key: r.label
|
|
721
|
+
}, [
|
|
722
|
+
r.label ? (o(), l("div", {
|
|
723
|
+
key: 0,
|
|
724
|
+
class: w(["px-3 pt-2 pb-1 text-xs font-semibold text-gray-500 uppercase tracking-wide", b > 0 ? "border-t border-gray-100 mt-1" : ""])
|
|
725
|
+
}, u(r.label), 3)) : m("", !0),
|
|
726
|
+
(o(!0), l(M, null, L(r.entries, (v) => (o(), l("button", {
|
|
727
|
+
key: v.item[e.valueKey],
|
|
728
|
+
ref_for: !0,
|
|
729
|
+
ref: (G) => N(G, v.flatIndex),
|
|
730
|
+
class: w(["flex items-center gap-2 w-full px-3 py-2 text-sm text-left transition-colors break-words", [
|
|
731
|
+
k(v.item) ? "bg-gray-100 font-medium" : "hover:bg-gray-50",
|
|
732
|
+
i.value === v.flatIndex ? "bg-gray-50" : ""
|
|
733
|
+
]]),
|
|
734
|
+
role: "option",
|
|
735
|
+
"aria-selected": k(v.item),
|
|
736
|
+
onClick: (G) => j(v.item, a),
|
|
737
|
+
onMouseenter: (G) => i.value = v.flatIndex
|
|
738
|
+
}, [
|
|
739
|
+
k(v.item) ? (o(), l("svg", vt, [...s[10] || (s[10] = [
|
|
740
|
+
t("path", {
|
|
741
|
+
"stroke-linecap": "round",
|
|
742
|
+
"stroke-linejoin": "round",
|
|
743
|
+
d: "M4.5 12.75l6 6 9-13.5"
|
|
744
|
+
}, null, -1)
|
|
745
|
+
])])) : (o(), l("span", mt)),
|
|
746
|
+
V(e.$slots, "item", R({ ref_for: !0 }, { item: v.item }), () => [
|
|
747
|
+
t("span", null, u(v.item[e.labelKey]), 1)
|
|
748
|
+
])
|
|
749
|
+
], 42, ct))), 128))
|
|
750
|
+
], 64))), 128)) : (o(!0), l(M, { key: 2 }, L(B.value, (r, b) => (o(), l("button", {
|
|
751
|
+
key: r[e.valueKey],
|
|
752
|
+
ref_for: !0,
|
|
753
|
+
ref: (v) => N(v, D.value + b),
|
|
754
|
+
class: w(["flex items-center gap-2 w-full px-3 py-2 text-sm text-left transition-colors break-words", [
|
|
755
|
+
k(r) ? "bg-gray-100 font-medium" : "hover:bg-gray-50",
|
|
756
|
+
i.value === D.value + b ? "bg-gray-50" : ""
|
|
757
|
+
]]),
|
|
758
|
+
role: "option",
|
|
759
|
+
"aria-selected": k(r),
|
|
760
|
+
onClick: (v) => j(r, a),
|
|
761
|
+
onMouseenter: (v) => i.value = D.value + b
|
|
762
|
+
}, [
|
|
763
|
+
k(r) ? (o(), l("svg", ht, [...s[11] || (s[11] = [
|
|
764
|
+
t("path", {
|
|
765
|
+
"stroke-linecap": "round",
|
|
766
|
+
"stroke-linejoin": "round",
|
|
767
|
+
d: "M4.5 12.75l6 6 9-13.5"
|
|
768
|
+
}, null, -1)
|
|
769
|
+
])])) : (o(), l("span", yt)),
|
|
770
|
+
V(e.$slots, "item", R({ ref_for: !0 }, { item: r }), () => [
|
|
771
|
+
t("span", null, u(r[e.labelKey]), 1)
|
|
772
|
+
])
|
|
773
|
+
], 42, ft))), 128)),
|
|
774
|
+
B.value.length === 0 && !e.allowEmpty ? (o(), l("div", wt, [
|
|
775
|
+
V(e.$slots, "empty", {}, () => [
|
|
776
|
+
ne(u(y(c)("ui.dropdown.nothingFound")), 1)
|
|
777
|
+
])
|
|
778
|
+
])) : m("", !0)
|
|
779
|
+
], 512))
|
|
780
|
+
], 40, et)
|
|
781
|
+
]),
|
|
782
|
+
_: 3
|
|
783
|
+
}, 8, ["stick"]));
|
|
784
|
+
}
|
|
785
|
+
});
|
|
11
786
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
787
|
+
so as OneBrowserMenu,
|
|
788
|
+
Qt as OneBrowserMenuGrid,
|
|
789
|
+
we as OneDropdown,
|
|
790
|
+
Le as OneDropdownAuto,
|
|
791
|
+
Zt as OneDropdownDivider,
|
|
792
|
+
lo as OneDropdownItem,
|
|
793
|
+
eo as OneDropdownSelect,
|
|
794
|
+
no as OneHelpMenu,
|
|
795
|
+
ro as OneUserMenu
|
|
21
796
|
};
|