@oneb/ui-vue 0.2.29 → 0.3.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/dist/dataTable/index.cjs +1 -1
- package/dist/dataTable/index.js +4 -3
- package/dist/dropdown/index.cjs +1 -1
- package/dist/dropdown/index.js +12 -11
- package/dist/entityPicker/entityPicker.d.ts +2 -13
- package/dist/entityPicker/index.d.ts +0 -1
- package/dist/i18n/defaults.d.ts +1 -0
- package/dist/i18n/index.d.ts +3 -0
- package/dist/i18n/plugin.d.ts +10 -0
- package/dist/i18n/useI18n.d.ts +2 -0
- package/dist/{index-4f1aeab2.js → index-649075f0.js} +397 -396
- package/dist/index-85e729ab.cjs +1 -0
- package/dist/index-8b41a099.cjs +1 -0
- package/dist/{index-8b4488cc.js → index-98daa7ed.js} +230 -229
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4850 -4525
- package/dist/periodPicker/periodPicker.d.ts +30 -56
- package/dist/periodPicker/util.d.ts +6 -1
- package/dist/style.css +1 -1
- package/dist/useI18n-2103b39e.js +126 -0
- package/dist/useI18n-bcf9c640.cjs +1 -0
- package/package.json +1 -1
- package/dist/index-09b67bb7.cjs +0 -1
- package/dist/index-5fa52675.cjs +0 -1
|
@@ -1,172 +1,173 @@
|
|
|
1
|
-
import { d as
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { _ as
|
|
4
|
-
import { _ as
|
|
5
|
-
|
|
1
|
+
import { d as ge, e as oe, o as ne, f as re, s as ae, g as be, h as ke, _ as xe, r as Ce, i as _e } from "./OneHelpMenu-9a2f42f5.js";
|
|
2
|
+
import { defineComponent as q, ref as _, watch as pe, onBeforeUnmount as ve, provide as $e, computed as A, openBlock as s, createElementBlock as l, createElementVNode as t, renderSlot as M, normalizeProps as P, guardReactiveProps as T, createBlock as U, Teleport as Me, createCommentVNode as y, withDirectives as X, normalizeClass as b, toDisplayString as p, vShow as Ve, withCtx as R, createVNode as H, unref as C, normalizeStyle as N, Fragment as B, renderList as D, onMounted as me, onUnmounted as Ke, vModelText as ie, mergeProps as W, createTextVNode as ue, nextTick as J } from "vue";
|
|
3
|
+
import { _ as fe } from "./_plugin-vue_export-helper-dad06003.js";
|
|
4
|
+
import { _ as de } from "./OneAvatar.vue_vue_type_script_setup_true_lang-08ab80dd.js";
|
|
5
|
+
import { u as Oe } from "./useI18n-2103b39e.js";
|
|
6
|
+
const Le = ["data-opened"], je = {
|
|
6
7
|
key: 0,
|
|
7
8
|
class: "text-sm text-secondary-content px-3 py-2 text-left"
|
|
8
|
-
},
|
|
9
|
+
}, Ae = /* @__PURE__ */ q({
|
|
9
10
|
__name: "OneDropdownAuto",
|
|
10
|
-
props:
|
|
11
|
+
props: ge,
|
|
11
12
|
emits: ["open", "close"],
|
|
12
|
-
setup(
|
|
13
|
-
const n =
|
|
14
|
-
let
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
setup(K, { emit: f }) {
|
|
14
|
+
const n = K, a = _(!1), m = _(null), k = _(null);
|
|
15
|
+
let g = null;
|
|
16
|
+
pe(a, (v) => {
|
|
17
|
+
v && k.value && m.value ? (oe(k.value, m.value, {
|
|
17
18
|
placement: n.stick ? n.stick : "bottom-start",
|
|
18
19
|
strategy: "fixed",
|
|
19
|
-
middleware: [
|
|
20
|
-
}).then(({ x:
|
|
21
|
-
Object.assign(
|
|
22
|
-
left: `${
|
|
20
|
+
middleware: [ne(5), re(), ae({ padding: 8 })]
|
|
21
|
+
}).then(({ x: c, y: $ }) => {
|
|
22
|
+
Object.assign(m.value.style, {
|
|
23
|
+
left: `${c}px`,
|
|
23
24
|
top: `${$}px`
|
|
24
25
|
});
|
|
25
|
-
}),
|
|
26
|
-
|
|
26
|
+
}), g = be(k.value, m.value, () => {
|
|
27
|
+
oe(k.value, m.value, {
|
|
27
28
|
placement: n.stick ? n.stick : "bottom-start",
|
|
28
29
|
strategy: "fixed",
|
|
29
|
-
middleware: [
|
|
30
|
-
}).then(({ x:
|
|
31
|
-
Object.assign(
|
|
32
|
-
left: `${
|
|
30
|
+
middleware: [ne(4), re(), ae({ padding: 8 })]
|
|
31
|
+
}).then(({ x: c, y: $ }) => {
|
|
32
|
+
Object.assign(m.value.style, {
|
|
33
|
+
left: `${c}px`,
|
|
33
34
|
top: `${$}px`
|
|
34
35
|
});
|
|
35
36
|
});
|
|
36
|
-
})) :
|
|
37
|
-
}),
|
|
38
|
-
|
|
37
|
+
})) : g && (g(), g = null);
|
|
38
|
+
}), ve(() => {
|
|
39
|
+
g && g();
|
|
39
40
|
});
|
|
40
|
-
const
|
|
41
|
-
a.value = !a.value, a.value ?
|
|
41
|
+
const d = f, h = () => {
|
|
42
|
+
a.value = !a.value, a.value ? d("open") : d("close");
|
|
42
43
|
};
|
|
43
|
-
|
|
44
|
-
onToggle:
|
|
44
|
+
$e("OneDropdown", {
|
|
45
|
+
onToggle: h
|
|
45
46
|
});
|
|
46
|
-
const
|
|
47
|
+
const V = A(() => [
|
|
47
48
|
"fixed z-[10000] w-fit rounded-md bg-white",
|
|
48
49
|
"py-1 shadow-lg ring-black ring-opacity-5 focus:outline-none",
|
|
49
50
|
"overflow-auto max-h-[540px] min-w-[150px] max-w-[540px]"
|
|
50
51
|
]);
|
|
51
|
-
return (
|
|
52
|
+
return (v, c) => (s(), l("div", {
|
|
52
53
|
class: "relative inline-block",
|
|
53
54
|
"data-opened": a.value
|
|
54
55
|
}, [
|
|
55
56
|
t("div", {
|
|
56
57
|
ref_key: "buttonRef",
|
|
57
|
-
ref:
|
|
58
|
+
ref: k
|
|
58
59
|
}, [
|
|
59
|
-
|
|
60
|
+
M(v.$slots, "button", P(T({ onToggle: h, isExpanded: a.value })))
|
|
60
61
|
], 512),
|
|
61
|
-
(s(),
|
|
62
|
-
a.value ? (s(),
|
|
62
|
+
(s(), U(Me, { to: "body" }, [
|
|
63
|
+
a.value ? (s(), l("div", {
|
|
63
64
|
key: 0,
|
|
64
65
|
class: "fixed top-0 left-0 w-screen h-screen z-[9999]",
|
|
65
|
-
onClick:
|
|
66
|
-
})) :
|
|
67
|
-
|
|
66
|
+
onClick: h
|
|
67
|
+
})) : y("", !0),
|
|
68
|
+
X(t("div", {
|
|
68
69
|
ref_key: "menuRef",
|
|
69
|
-
ref:
|
|
70
|
-
class:
|
|
70
|
+
ref: m,
|
|
71
|
+
class: b(["menu", V.value]),
|
|
71
72
|
role: "menu",
|
|
72
73
|
"aria-orientation": "vertical",
|
|
73
74
|
tabindex: "-1",
|
|
74
75
|
style: { display: "none" }
|
|
75
76
|
}, [
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
v.title ? (s(), l("div", je, p(v.title), 1)) : y("", !0),
|
|
78
|
+
M(v.$slots, "menu", P(T({ onToggle: h })))
|
|
78
79
|
], 2), [
|
|
79
|
-
[
|
|
80
|
+
[Ve, a.value]
|
|
80
81
|
])
|
|
81
82
|
]))
|
|
82
|
-
], 8,
|
|
83
|
+
], 8, Le));
|
|
83
84
|
}
|
|
84
|
-
}),
|
|
85
|
-
function
|
|
86
|
-
return s(),
|
|
85
|
+
}), Se = {}, Be = { class: "border-t border-secondary-stroke my-1" };
|
|
86
|
+
function Ie(K, f) {
|
|
87
|
+
return s(), l("div", Be);
|
|
87
88
|
}
|
|
88
|
-
const
|
|
89
|
+
const Ht = /* @__PURE__ */ fe(Se, [["render", Ie]]), ze = ["onClick"], Ee = { class: "grid" }, De = { class: "font-semibold px-3" }, Re = { class: "rounded-lg m-3 border" }, Fe = {
|
|
89
90
|
class: "space-x-2 flex items-center px-3 py-2",
|
|
90
91
|
style: { width: "300px" }
|
|
91
|
-
},
|
|
92
|
+
}, We = { class: "flex-shrink-0" }, Pe = { class: "w-full text-left" }, Te = { class: "flex-shrink-0" }, Ue = { class: "px-3 py-2" }, Ne = { class: "text-secondary-content text-left pb-1 text-sm uppercase" }, qe = {
|
|
92
93
|
key: 0,
|
|
93
94
|
class: "space-y-2"
|
|
94
|
-
},
|
|
95
|
+
}, Ge = ["onClick"], He = { class: "pl-2" }, Je = { class: "text-sm mt-1" }, Xe = { class: "text-xs mt-1" }, ce = 3, Jt = /* @__PURE__ */ q({
|
|
95
96
|
__name: "OneBrowserMenuGrid",
|
|
96
|
-
props:
|
|
97
|
-
setup(
|
|
98
|
-
const
|
|
99
|
-
typeof
|
|
100
|
-
}, a =
|
|
97
|
+
props: ke,
|
|
98
|
+
setup(K) {
|
|
99
|
+
const f = K, n = () => {
|
|
100
|
+
typeof f.onChange == "function" && f.onChange();
|
|
101
|
+
}, a = _(!1), m = A(() => f.apps ? a.value ? f.apps : f.apps.slice(0, ce) : []), k = () => {
|
|
101
102
|
a.value = !a.value;
|
|
102
|
-
},
|
|
103
|
-
typeof
|
|
103
|
+
}, g = (d) => {
|
|
104
|
+
typeof f.onApp == "function" && f.onApp(d);
|
|
104
105
|
};
|
|
105
|
-
return (
|
|
106
|
-
button:
|
|
106
|
+
return (d, h) => (s(), U(xe, { stick: "right" }, {
|
|
107
|
+
button: R(({ onToggle: V, isExpanded: v }) => [
|
|
107
108
|
t("button", {
|
|
108
|
-
onClick:
|
|
109
|
-
class:
|
|
109
|
+
onClick: V,
|
|
110
|
+
class: b(["p-1 rounded-md hover:bg-secondary-10", [v ? "bg-secondary-25" : ""]])
|
|
110
111
|
}, [
|
|
111
|
-
|
|
112
|
+
H(C(Ce), {
|
|
112
113
|
class: "text-secondary-base",
|
|
113
|
-
style:
|
|
114
|
+
style: N(`width: ${d.iconSize}px; height: ${d.iconSize}px`)
|
|
114
115
|
}, null, 8, ["style"])
|
|
115
|
-
], 10,
|
|
116
|
+
], 10, ze)
|
|
116
117
|
]),
|
|
117
|
-
menu:
|
|
118
|
-
var
|
|
118
|
+
menu: R(() => {
|
|
119
|
+
var V, v, c, $;
|
|
119
120
|
return [
|
|
120
|
-
t("div",
|
|
121
|
-
t("div",
|
|
122
|
-
t("div",
|
|
123
|
-
t("div",
|
|
124
|
-
t("div",
|
|
125
|
-
|
|
126
|
-
text: ((
|
|
127
|
-
src: (
|
|
121
|
+
t("div", Ee, [
|
|
122
|
+
t("div", De, p((V = d.workspace) == null ? void 0 : V.title), 1),
|
|
123
|
+
t("div", Re, [
|
|
124
|
+
t("div", Fe, [
|
|
125
|
+
t("div", We, [
|
|
126
|
+
H(de, {
|
|
127
|
+
text: ((v = d.workspace) == null ? void 0 : v.name) || "",
|
|
128
|
+
src: (c = d.workspace) == null ? void 0 : c.photo_url,
|
|
128
129
|
size: 44,
|
|
129
130
|
rounded: !1,
|
|
130
131
|
class: "mx-auto"
|
|
131
132
|
}, null, 8, ["text", "src"])
|
|
132
133
|
]),
|
|
133
|
-
t("div",
|
|
134
|
-
t("div",
|
|
134
|
+
t("div", Pe, p(($ = d.workspace) == null ? void 0 : $.name), 1),
|
|
135
|
+
t("div", Te, [
|
|
135
136
|
t("button", {
|
|
136
137
|
class: "text-sm border border-secondary-stroke rounded px-2 py-0.5 text-secondary-content hover:text-primary-content",
|
|
137
138
|
onClick: n
|
|
138
|
-
},
|
|
139
|
+
}, p(d.changeLabel), 1)
|
|
139
140
|
])
|
|
140
141
|
]),
|
|
141
|
-
|
|
142
|
+
h[0] || (h[0] = t("hr", null, null, -1))
|
|
142
143
|
])
|
|
143
144
|
]),
|
|
144
|
-
t("div",
|
|
145
|
-
t("div",
|
|
145
|
+
t("div", Ue, [
|
|
146
|
+
t("div", Ne, p(d.appsTitle), 1),
|
|
146
147
|
t("div", null, [
|
|
147
|
-
|
|
148
|
-
(s(!0),
|
|
149
|
-
key:
|
|
150
|
-
onClick: (i) =>
|
|
148
|
+
d.apps && d.apps.length ? (s(), l("div", qe, [
|
|
149
|
+
(s(!0), l(B, null, D(m.value, (I) => (s(), l("div", {
|
|
150
|
+
key: I.id,
|
|
151
|
+
onClick: (i) => g(I),
|
|
151
152
|
class: "flex items-center rounded-lg hover:bg-secondary-10 border p-2 bg-[#FAFAFA] cursor-pointer"
|
|
152
153
|
}, [
|
|
153
|
-
|
|
154
|
-
text:
|
|
155
|
-
src:
|
|
154
|
+
H(de, {
|
|
155
|
+
text: I.name,
|
|
156
|
+
src: I.photo_url,
|
|
156
157
|
size: 44,
|
|
157
158
|
rounded: !1
|
|
158
159
|
}, null, 8, ["text", "src"]),
|
|
159
|
-
t("div",
|
|
160
|
-
t("p",
|
|
161
|
-
t("p",
|
|
160
|
+
t("div", He, [
|
|
161
|
+
t("p", Je, p(I.name), 1),
|
|
162
|
+
t("p", Xe, p(I.short), 1)
|
|
162
163
|
])
|
|
163
|
-
], 8,
|
|
164
|
-
])) :
|
|
165
|
-
|
|
164
|
+
], 8, Ge))), 128))
|
|
165
|
+
])) : y("", !0),
|
|
166
|
+
d.apps && d.apps.length > ce ? (s(), l("button", {
|
|
166
167
|
key: 1,
|
|
167
|
-
onClick:
|
|
168
|
+
onClick: k,
|
|
168
169
|
class: "mt-2 w-full bg-[#FAFAFA] hover:bg-secondary-10 p-2 rounded-lg mb-5 text-xs"
|
|
169
|
-
},
|
|
170
|
+
}, p(a.value ? "Приховати" : "Дивитися всі"), 1)) : y("", !0)
|
|
170
171
|
])
|
|
171
172
|
])
|
|
172
173
|
];
|
|
@@ -174,7 +175,7 @@ const Nt = /* @__PURE__ */ me(je, [["render", Ae]]), Be = ["onClick"], Ie = { cl
|
|
|
174
175
|
_: 1
|
|
175
176
|
}));
|
|
176
177
|
}
|
|
177
|
-
}),
|
|
178
|
+
}), Ye = {
|
|
178
179
|
useModal: {
|
|
179
180
|
required: !0,
|
|
180
181
|
type: Object
|
|
@@ -210,7 +211,7 @@ const Nt = /* @__PURE__ */ me(je, [["render", Ae]]), Be = ["onClick"], Ie = { cl
|
|
|
210
211
|
type: String,
|
|
211
212
|
default: ""
|
|
212
213
|
}
|
|
213
|
-
},
|
|
214
|
+
}, Ze = {
|
|
214
215
|
"3xs": ["max-w-xs"],
|
|
215
216
|
xs: ["max-w-sm"],
|
|
216
217
|
sm: ["max-w-md"],
|
|
@@ -224,73 +225,73 @@ const Nt = /* @__PURE__ */ me(je, [["render", Ae]]), Be = ["onClick"], Ie = { cl
|
|
|
224
225
|
"4xl": ["max-w-5xl"],
|
|
225
226
|
"5xl": ["max-w-5xl"],
|
|
226
227
|
"7xl": ["max-w-7xl"]
|
|
227
|
-
},
|
|
228
|
-
const
|
|
229
|
-
return
|
|
230
|
-
},
|
|
228
|
+
}, Qe = (K = "medium") => {
|
|
229
|
+
const f = [];
|
|
230
|
+
return f.push(...Ze[K] ?? []), f;
|
|
231
|
+
}, et = { class: "relative bg-white rounded-lg shadow h-full" }, tt = /* @__PURE__ */ q({
|
|
231
232
|
__name: "OneModal",
|
|
232
|
-
props:
|
|
233
|
+
props: Ye,
|
|
233
234
|
emits: ["isOpen", "closed"],
|
|
234
|
-
setup(
|
|
235
|
-
const a =
|
|
236
|
-
var
|
|
235
|
+
setup(K, { expose: f, emit: n }) {
|
|
236
|
+
const a = K, m = n, k = A(() => {
|
|
237
|
+
var x, O;
|
|
237
238
|
const i = a.useModal;
|
|
238
|
-
return ((
|
|
239
|
-
}),
|
|
240
|
-
function
|
|
241
|
-
|
|
239
|
+
return ((x = i == null ? void 0 : i.isOpened) == null ? void 0 : x.value) ?? ((O = i == null ? void 0 : i.isOpen) == null ? void 0 : O.value) ?? !1;
|
|
240
|
+
}), g = A(() => Qe(a.size)), d = A(() => a.customWidth ? { width: a.customWidth } : {}), h = _(null), V = _(!1);
|
|
241
|
+
function v(i) {
|
|
242
|
+
V.value = !1, h.value && !h.value.contains(i.target) && (V.value = !0);
|
|
242
243
|
}
|
|
243
|
-
function
|
|
244
|
-
|
|
244
|
+
function c(i) {
|
|
245
|
+
V.value && h.value && !h.value.contains(i.target) && $();
|
|
245
246
|
}
|
|
246
247
|
const $ = () => {
|
|
247
|
-
var
|
|
248
|
+
var x, O;
|
|
248
249
|
if (a.canClose && !a.canClose())
|
|
249
250
|
return;
|
|
250
251
|
const i = a.useModal;
|
|
251
|
-
(
|
|
252
|
+
(x = i == null ? void 0 : i.close) == null || x.call(i), (O = a.onClose) == null || O.call(a), m("closed"), m("isOpen");
|
|
252
253
|
};
|
|
253
|
-
return
|
|
254
|
+
return f({
|
|
254
255
|
open: () => {
|
|
255
|
-
var
|
|
256
|
+
var x;
|
|
256
257
|
const i = a.useModal;
|
|
257
|
-
(
|
|
258
|
+
(x = i == null ? void 0 : i.open) == null || x.call(i), m("isOpen");
|
|
258
259
|
},
|
|
259
260
|
close: $
|
|
260
|
-
}), (i,
|
|
261
|
+
}), (i, x) => k.value ? (s(), l("div", {
|
|
261
262
|
key: 0,
|
|
262
263
|
tabindex: "-1",
|
|
263
|
-
onMousedown:
|
|
264
|
-
onMouseup:
|
|
265
|
-
class:
|
|
264
|
+
onMousedown: v,
|
|
265
|
+
onMouseup: c,
|
|
266
|
+
class: b(["modal backdrop !m-0", { "modal-mobile": i.classModal }])
|
|
266
267
|
}, [
|
|
267
268
|
t("div", {
|
|
268
|
-
class:
|
|
269
|
+
class: b([
|
|
269
270
|
"relative w-full max-h-full",
|
|
270
|
-
|
|
271
|
+
g.value,
|
|
271
272
|
{ "fixed bottom-0 left-0 right-0 w-full bg-white rounded-t-xl mobile-modal": i.classModal }
|
|
272
273
|
]),
|
|
273
|
-
style:
|
|
274
|
+
style: N(d.value),
|
|
274
275
|
ref_key: "modalContent",
|
|
275
|
-
ref:
|
|
276
|
+
ref: h
|
|
276
277
|
}, [
|
|
277
|
-
t("div",
|
|
278
|
-
i.title ? (s(),
|
|
278
|
+
t("div", et, [
|
|
279
|
+
i.title ? (s(), l("div", {
|
|
279
280
|
key: 0,
|
|
280
|
-
class:
|
|
281
|
+
class: b([
|
|
281
282
|
i.titleCenter ? "grid grid-cols-4" : "flex items-start justify-between",
|
|
282
283
|
"p-3 border-b rounded-t",
|
|
283
284
|
i.classTitle
|
|
284
285
|
])
|
|
285
286
|
}, [
|
|
286
287
|
t("h3", {
|
|
287
|
-
class:
|
|
288
|
-
},
|
|
288
|
+
class: b(["text-xl font-semibold text-gray-900 whitespace-nowrap overflow-hidden text-ellipsis", i.titleCenter ? "col-span-2 text-center col-start-2" : ""])
|
|
289
|
+
}, p(i.title), 3),
|
|
289
290
|
t("button", {
|
|
290
291
|
type: "button",
|
|
291
292
|
class: "text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center",
|
|
292
293
|
onClick: $
|
|
293
|
-
}, [...
|
|
294
|
+
}, [...x[0] || (x[0] = [
|
|
294
295
|
t("svg", {
|
|
295
296
|
xmlns: "http://www.w3.org/2000/svg",
|
|
296
297
|
fill: "none",
|
|
@@ -307,59 +308,59 @@ const Nt = /* @__PURE__ */ me(je, [["render", Ae]]), Be = ["onClick"], Ie = { cl
|
|
|
307
308
|
})
|
|
308
309
|
], -1)
|
|
309
310
|
])])
|
|
310
|
-
], 2)) :
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
311
|
+
], 2)) : y("", !0),
|
|
312
|
+
M(i.$slots, "header", {}, void 0, !0),
|
|
313
|
+
M(i.$slots, "body", {}, void 0, !0),
|
|
314
|
+
M(i.$slots, "default", {}, void 0, !0),
|
|
315
|
+
M(i.$slots, "footer", { close: $ }, void 0, !0)
|
|
315
316
|
])
|
|
316
317
|
], 6)
|
|
317
|
-
], 34)) :
|
|
318
|
+
], 34)) : y("", !0);
|
|
318
319
|
}
|
|
319
320
|
});
|
|
320
|
-
const
|
|
321
|
-
function
|
|
322
|
-
const
|
|
321
|
+
const st = /* @__PURE__ */ fe(tt, [["__scopeId", "data-v-3560b61e"]]);
|
|
322
|
+
function lt(K = !1) {
|
|
323
|
+
const f = _(K), n = _(void 0);
|
|
323
324
|
let a = null;
|
|
324
|
-
const
|
|
325
|
-
a && (clearTimeout(a), a = null),
|
|
326
|
-
},
|
|
327
|
-
n.value =
|
|
328
|
-
},
|
|
329
|
-
a && clearTimeout(a), a = setTimeout(
|
|
330
|
-
},
|
|
331
|
-
|
|
325
|
+
const m = () => {
|
|
326
|
+
a && (clearTimeout(a), a = null), f.value = !1, n.value = void 0;
|
|
327
|
+
}, k = (h) => {
|
|
328
|
+
n.value = h, f.value = !0;
|
|
329
|
+
}, g = (h) => {
|
|
330
|
+
a && clearTimeout(a), a = setTimeout(m, h * 1e3);
|
|
331
|
+
}, d = (h) => {
|
|
332
|
+
h.key === "Escape" && f.value && m();
|
|
332
333
|
};
|
|
333
|
-
return
|
|
334
|
-
document.addEventListener("keydown",
|
|
335
|
-
}),
|
|
336
|
-
document.removeEventListener("keydown",
|
|
334
|
+
return me(() => {
|
|
335
|
+
document.addEventListener("keydown", d);
|
|
336
|
+
}), ve(() => {
|
|
337
|
+
document.removeEventListener("keydown", d), a && clearTimeout(a);
|
|
337
338
|
}), {
|
|
338
|
-
isOpened:
|
|
339
|
-
isOpen:
|
|
339
|
+
isOpened: f,
|
|
340
|
+
isOpen: f,
|
|
340
341
|
// alias for backward compatibility
|
|
341
342
|
data: n,
|
|
342
|
-
open:
|
|
343
|
-
close:
|
|
344
|
-
closeWithDelay:
|
|
343
|
+
open: k,
|
|
344
|
+
close: m,
|
|
345
|
+
closeWithDelay: g
|
|
345
346
|
};
|
|
346
347
|
}
|
|
347
|
-
const
|
|
348
|
+
const ot = ["onClick"], nt = ["onKeydown"], rt = {
|
|
348
349
|
key: 0,
|
|
349
350
|
class: "text-sm font-medium text-gray-700 px-3 pt-2.5 pb-1.5"
|
|
350
|
-
},
|
|
351
|
+
}, at = {
|
|
351
352
|
key: 1,
|
|
352
353
|
class: "px-3 py-2"
|
|
353
|
-
},
|
|
354
|
+
}, it = { class: "relative" }, ut = ["placeholder"], dt = {
|
|
354
355
|
key: 2,
|
|
355
356
|
class: "border-b border-gray-100"
|
|
356
|
-
},
|
|
357
|
+
}, ct = ["onClick"], pt = {
|
|
357
358
|
key: 3,
|
|
358
359
|
class: "flex items-center justify-between px-3 py-1.5 border-b border-gray-100"
|
|
359
|
-
},
|
|
360
|
+
}, vt = {
|
|
360
361
|
key: 4,
|
|
361
362
|
class: "flex justify-center py-4"
|
|
362
|
-
},
|
|
363
|
+
}, mt = ["aria-selected", "onClick"], ft = {
|
|
363
364
|
key: 0,
|
|
364
365
|
xmlns: "http://www.w3.org/2000/svg",
|
|
365
366
|
fill: "none",
|
|
@@ -367,10 +368,10 @@ const st = ["onClick"], lt = ["onKeydown"], ot = {
|
|
|
367
368
|
"stroke-width": "1.5",
|
|
368
369
|
stroke: "currentColor",
|
|
369
370
|
class: "w-4 h-4 text-blue-600 shrink-0"
|
|
370
|
-
},
|
|
371
|
+
}, ht = {
|
|
371
372
|
key: 1,
|
|
372
373
|
class: "w-4 h-4 shrink-0"
|
|
373
|
-
},
|
|
374
|
+
}, yt = ["aria-selected", "onClick", "onMouseenter"], wt = {
|
|
374
375
|
key: 0,
|
|
375
376
|
xmlns: "http://www.w3.org/2000/svg",
|
|
376
377
|
fill: "none",
|
|
@@ -378,10 +379,10 @@ const st = ["onClick"], lt = ["onKeydown"], ot = {
|
|
|
378
379
|
"stroke-width": "1.5",
|
|
379
380
|
stroke: "currentColor",
|
|
380
381
|
class: "w-4 h-4 text-blue-600 shrink-0"
|
|
381
|
-
},
|
|
382
|
+
}, gt = {
|
|
382
383
|
key: 1,
|
|
383
384
|
class: "w-4 h-4 shrink-0"
|
|
384
|
-
},
|
|
385
|
+
}, bt = ["aria-selected", "onClick", "onMouseenter"], kt = {
|
|
385
386
|
key: 0,
|
|
386
387
|
xmlns: "http://www.w3.org/2000/svg",
|
|
387
388
|
fill: "none",
|
|
@@ -389,29 +390,29 @@ const st = ["onClick"], lt = ["onKeydown"], ot = {
|
|
|
389
390
|
"stroke-width": "1.5",
|
|
390
391
|
stroke: "currentColor",
|
|
391
392
|
class: "w-4 h-4 text-blue-600 shrink-0"
|
|
392
|
-
},
|
|
393
|
+
}, xt = {
|
|
393
394
|
key: 1,
|
|
394
395
|
class: "w-4 h-4 shrink-0"
|
|
395
|
-
},
|
|
396
|
+
}, Ct = {
|
|
396
397
|
key: 3,
|
|
397
398
|
class: "px-3 py-4 text-sm text-gray-500 text-center"
|
|
398
|
-
},
|
|
399
|
+
}, _t = { class: "pb-6" }, $t = {
|
|
399
400
|
key: 0,
|
|
400
401
|
class: "relative px-3 py-3"
|
|
401
|
-
},
|
|
402
|
+
}, Mt = { class: "relative" }, Vt = ["placeholder"], Kt = {
|
|
402
403
|
key: 1,
|
|
403
404
|
class: "px-3 py-2"
|
|
404
|
-
},
|
|
405
|
+
}, Ot = {
|
|
405
406
|
key: 2,
|
|
406
407
|
class: "flex items-center justify-between px-3 py-2 border-b border-gray-100"
|
|
407
|
-
},
|
|
408
|
+
}, Lt = {
|
|
408
409
|
key: 3,
|
|
409
410
|
class: "flex justify-center py-8"
|
|
410
|
-
},
|
|
411
|
+
}, jt = {
|
|
411
412
|
key: 4,
|
|
412
413
|
class: "overflow-auto h-[60dvh] divide-y",
|
|
413
414
|
role: "listbox"
|
|
414
|
-
},
|
|
415
|
+
}, At = ["aria-selected"], St = {
|
|
415
416
|
key: 0,
|
|
416
417
|
xmlns: "http://www.w3.org/2000/svg",
|
|
417
418
|
fill: "none",
|
|
@@ -419,13 +420,13 @@ const st = ["onClick"], lt = ["onKeydown"], ot = {
|
|
|
419
420
|
"stroke-width": "1.5",
|
|
420
421
|
stroke: "currentColor",
|
|
421
422
|
class: "w-5 h-5 text-blue-600 shrink-0"
|
|
422
|
-
},
|
|
423
|
+
}, Bt = {
|
|
423
424
|
key: 1,
|
|
424
425
|
class: "w-5 h-5 shrink-0"
|
|
425
|
-
},
|
|
426
|
+
}, It = {
|
|
426
427
|
key: 0,
|
|
427
428
|
class: "px-3 pt-3 pb-2 text-xs font-semibold text-gray-400 uppercase tracking-wide"
|
|
428
|
-
},
|
|
429
|
+
}, zt = ["aria-selected", "onClick"], Et = {
|
|
429
430
|
key: 0,
|
|
430
431
|
xmlns: "http://www.w3.org/2000/svg",
|
|
431
432
|
fill: "none",
|
|
@@ -433,10 +434,10 @@ const st = ["onClick"], lt = ["onKeydown"], ot = {
|
|
|
433
434
|
"stroke-width": "1.5",
|
|
434
435
|
stroke: "currentColor",
|
|
435
436
|
class: "w-5 h-5 text-blue-600 shrink-0"
|
|
436
|
-
},
|
|
437
|
+
}, Dt = {
|
|
437
438
|
key: 1,
|
|
438
439
|
class: "w-5 h-5 shrink-0"
|
|
439
|
-
},
|
|
440
|
+
}, Rt = ["aria-selected", "onClick"], Ft = {
|
|
440
441
|
key: 0,
|
|
441
442
|
xmlns: "http://www.w3.org/2000/svg",
|
|
442
443
|
fill: "none",
|
|
@@ -444,128 +445,128 @@ const st = ["onClick"], lt = ["onKeydown"], ot = {
|
|
|
444
445
|
"stroke-width": "1.5",
|
|
445
446
|
stroke: "currentColor",
|
|
446
447
|
class: "w-5 h-5 text-blue-600 shrink-0"
|
|
447
|
-
},
|
|
448
|
+
}, Wt = {
|
|
448
449
|
key: 1,
|
|
449
450
|
class: "w-5 h-5 shrink-0"
|
|
450
|
-
},
|
|
451
|
+
}, Pt = {
|
|
451
452
|
key: 3,
|
|
452
453
|
class: "px-3 py-8 text-sm text-gray-500 text-center"
|
|
453
|
-
},
|
|
454
|
+
}, Xt = /* @__PURE__ */ q({
|
|
454
455
|
__name: "OneDropdownSelect",
|
|
455
|
-
props:
|
|
456
|
+
props: _e,
|
|
456
457
|
emits: ["update:modelValue", "search", "create"],
|
|
457
|
-
setup(
|
|
458
|
-
const n =
|
|
459
|
-
let
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
const e = (
|
|
463
|
-
|
|
458
|
+
setup(K, { emit: f }) {
|
|
459
|
+
const n = K, a = Oe(), m = f, k = _(!1);
|
|
460
|
+
let g = null;
|
|
461
|
+
me(() => {
|
|
462
|
+
g = window.matchMedia("(max-width: 767px)"), k.value = g.matches;
|
|
463
|
+
const e = (o) => {
|
|
464
|
+
k.value = o.matches;
|
|
464
465
|
};
|
|
465
|
-
|
|
466
|
-
|
|
466
|
+
g.addEventListener("change", e), Ke(() => {
|
|
467
|
+
g == null || g.removeEventListener("change", e);
|
|
467
468
|
});
|
|
468
469
|
});
|
|
469
|
-
const
|
|
470
|
-
v.value = "",
|
|
470
|
+
const d = lt(), h = _(null), V = () => {
|
|
471
|
+
v.value = "", c.value = -1, d.open(), J(() => {
|
|
471
472
|
var e;
|
|
472
|
-
(e =
|
|
473
|
+
(e = h.value) == null || e.focus();
|
|
473
474
|
});
|
|
474
|
-
}, v =
|
|
475
|
-
e && (
|
|
476
|
-
},
|
|
475
|
+
}, v = _(""), c = _(-1), $ = _(null), I = _(null), i = _({}), x = (e, o) => {
|
|
476
|
+
e && (i.value[o] = e);
|
|
477
|
+
}, O = A(() => n.allowEmpty ? 1 : 0), E = A(() => {
|
|
477
478
|
if (!v.value.trim())
|
|
478
479
|
return n.items;
|
|
479
480
|
const e = v.value.toLowerCase();
|
|
480
481
|
return n.items.filter(
|
|
481
|
-
(
|
|
482
|
+
(o) => String(o[n.labelKey] ?? "").toLowerCase().includes(e)
|
|
482
483
|
);
|
|
483
|
-
}),
|
|
484
|
+
}), Y = A(() => {
|
|
484
485
|
if (!n.groupKey)
|
|
485
486
|
return [];
|
|
486
|
-
const e = [],
|
|
487
|
-
let u =
|
|
488
|
-
for (const r of
|
|
489
|
-
const
|
|
490
|
-
let
|
|
491
|
-
|
|
487
|
+
const e = [], o = /* @__PURE__ */ new Map();
|
|
488
|
+
let u = O.value;
|
|
489
|
+
for (const r of E.value) {
|
|
490
|
+
const j = String(r[n.groupKey] ?? "");
|
|
491
|
+
let w = o.get(j);
|
|
492
|
+
w || (w = { label: j, entries: [] }, o.set(j, w), e.push(w)), w.entries.push({ item: r, flatIndex: u }), u++;
|
|
492
493
|
}
|
|
493
494
|
return e;
|
|
494
|
-
}),
|
|
495
|
+
}), S = A(() => n.multiple ? (n.modelValue ?? []).length > 0 : n.modelValue !== null && n.modelValue !== void 0), F = A(() => {
|
|
495
496
|
if (n.multiple) {
|
|
496
497
|
const e = n.modelValue ?? [];
|
|
497
498
|
return e.length === 0 ? n.placeholder : e.length === 1 ? e[0][n.labelKey] ?? n.placeholder : `${e[0][n.labelKey]} +${e.length - 1}`;
|
|
498
499
|
}
|
|
499
500
|
return n.modelValue === null || n.modelValue === void 0 ? n.placeholder : n.modelValue[n.labelKey] ?? n.placeholder;
|
|
500
|
-
}), L = (e) => n.modelValue ? n.multiple ? n.modelValue.some((u) => u[n.valueKey] === e[n.valueKey]) : n.modelValue[n.valueKey] === e[n.valueKey] : !1,
|
|
501
|
+
}), L = (e) => n.modelValue ? n.multiple ? n.modelValue.some((u) => u[n.valueKey] === e[n.valueKey]) : n.modelValue[n.valueKey] === e[n.valueKey] : !1, Z = A(() => E.value.length + O.value), z = (e, o) => {
|
|
501
502
|
if (n.multiple) {
|
|
502
503
|
const u = (n.modelValue ?? []).slice();
|
|
503
504
|
if (e === null) {
|
|
504
|
-
|
|
505
|
+
m("update:modelValue", []);
|
|
505
506
|
return;
|
|
506
507
|
}
|
|
507
|
-
const r = u.findIndex((
|
|
508
|
-
r >= 0 ? u.splice(r, 1) : u.push(e),
|
|
508
|
+
const r = u.findIndex((j) => j[n.valueKey] === e[n.valueKey]);
|
|
509
|
+
r >= 0 ? u.splice(r, 1) : u.push(e), m("update:modelValue", u);
|
|
509
510
|
return;
|
|
510
511
|
}
|
|
511
|
-
|
|
512
|
-
}, Z = () => {
|
|
513
|
-
a("update:modelValue", [...n.items]);
|
|
512
|
+
m("update:modelValue", e), o();
|
|
514
513
|
}, Q = () => {
|
|
515
|
-
|
|
516
|
-
}, ee = (
|
|
517
|
-
|
|
518
|
-
},
|
|
519
|
-
|
|
514
|
+
m("update:modelValue", [...n.items]);
|
|
515
|
+
}, ee = () => {
|
|
516
|
+
m("update:modelValue", []);
|
|
517
|
+
}, te = (e) => {
|
|
518
|
+
m("create", v.value), e();
|
|
519
|
+
}, he = () => {
|
|
520
|
+
v.value = "", c.value = -1, J(() => {
|
|
520
521
|
var e;
|
|
521
|
-
(e =
|
|
522
|
+
(e = $.value) == null || e.focus();
|
|
522
523
|
});
|
|
523
|
-
},
|
|
524
|
-
v.value = "",
|
|
525
|
-
}, te = () => {
|
|
526
|
-
d.value = 0, a("search", v.value);
|
|
524
|
+
}, ye = () => {
|
|
525
|
+
v.value = "", c.value = -1;
|
|
527
526
|
}, se = () => {
|
|
528
|
-
|
|
529
|
-
|
|
527
|
+
c.value = 0, m("search", v.value);
|
|
528
|
+
}, le = () => {
|
|
529
|
+
J(() => {
|
|
530
|
+
const e = i.value[c.value];
|
|
530
531
|
e && e.scrollIntoView({ block: "nearest" });
|
|
531
532
|
});
|
|
532
|
-
},
|
|
533
|
+
}, we = (e, o) => {
|
|
533
534
|
switch (e.key) {
|
|
534
535
|
case "ArrowDown":
|
|
535
|
-
e.preventDefault(),
|
|
536
|
+
e.preventDefault(), c.value < Z.value - 1 ? c.value++ : c.value = 0, le();
|
|
536
537
|
break;
|
|
537
538
|
case "ArrowUp":
|
|
538
|
-
e.preventDefault(),
|
|
539
|
+
e.preventDefault(), c.value > 0 ? c.value-- : c.value = Z.value - 1, le();
|
|
539
540
|
break;
|
|
540
541
|
case "Enter":
|
|
541
|
-
if (e.preventDefault(),
|
|
542
|
-
if (n.allowEmpty &&
|
|
543
|
-
z(null,
|
|
542
|
+
if (e.preventDefault(), c.value >= 0)
|
|
543
|
+
if (n.allowEmpty && c.value === 0)
|
|
544
|
+
z(null, o);
|
|
544
545
|
else {
|
|
545
|
-
const u =
|
|
546
|
-
r && z(r,
|
|
546
|
+
const u = c.value - O.value, r = E.value[u];
|
|
547
|
+
r && z(r, o);
|
|
547
548
|
}
|
|
548
549
|
break;
|
|
549
550
|
case "Escape":
|
|
550
|
-
e.preventDefault(),
|
|
551
|
+
e.preventDefault(), o();
|
|
551
552
|
break;
|
|
552
553
|
}
|
|
553
554
|
};
|
|
554
|
-
return
|
|
555
|
-
|
|
556
|
-
}), (e,
|
|
557
|
-
|
|
555
|
+
return pe(v, () => {
|
|
556
|
+
c.value = 0;
|
|
557
|
+
}), (e, o) => k.value ? (s(), l(B, { key: 1 }, [
|
|
558
|
+
M(e.$slots, "button", P(T({ onToggle: V, isExpanded: C(d).isOpened.value, selectedLabel: F.value })), () => [
|
|
558
559
|
t("button", {
|
|
559
|
-
class:
|
|
560
|
+
class: b(["inline-flex items-center justify-between gap-2 text-sm transition-colors", [
|
|
560
561
|
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]"
|
|
561
562
|
]]),
|
|
562
|
-
style:
|
|
563
|
-
onClick:
|
|
563
|
+
style: N(e.maxWidth ? { maxWidth: e.maxWidth } : void 0),
|
|
564
|
+
onClick: V
|
|
564
565
|
}, [
|
|
565
566
|
t("span", {
|
|
566
|
-
class:
|
|
567
|
-
},
|
|
568
|
-
|
|
567
|
+
class: b(["truncate", e.view === "pill" ? "" : S.value ? "text-gray-900" : "text-gray-500"])
|
|
568
|
+
}, p(F.value), 3),
|
|
569
|
+
o[12] || (o[12] = t("svg", {
|
|
569
570
|
xmlns: "http://www.w3.org/2000/svg",
|
|
570
571
|
fill: "none",
|
|
571
572
|
viewBox: "0 0 24 24",
|
|
@@ -581,19 +582,19 @@ const st = ["onClick"], lt = ["onKeydown"], ot = {
|
|
|
581
582
|
], -1))
|
|
582
583
|
], 6)
|
|
583
584
|
]),
|
|
584
|
-
|
|
585
|
+
C(d).isOpened.value ? (s(), U(C(st), {
|
|
585
586
|
key: 0,
|
|
586
|
-
useModal:
|
|
587
|
+
useModal: C(d),
|
|
587
588
|
title: e.title || e.placeholder,
|
|
588
589
|
size: "sm",
|
|
589
590
|
classModal: !0,
|
|
590
591
|
titleCenter: !0
|
|
591
592
|
}, {
|
|
592
|
-
default:
|
|
593
|
-
t("div",
|
|
594
|
-
e.searchable ? (s(),
|
|
595
|
-
t("div",
|
|
596
|
-
|
|
593
|
+
default: R(() => [
|
|
594
|
+
t("div", _t, [
|
|
595
|
+
e.searchable ? (s(), l("div", $t, [
|
|
596
|
+
t("div", Mt, [
|
|
597
|
+
o[13] || (o[13] = t("svg", {
|
|
597
598
|
xmlns: "http://www.w3.org/2000/svg",
|
|
598
599
|
fill: "none",
|
|
599
600
|
viewBox: "0 0 24 24",
|
|
@@ -607,25 +608,25 @@ const st = ["onClick"], lt = ["onKeydown"], ot = {
|
|
|
607
608
|
d: "M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"
|
|
608
609
|
})
|
|
609
610
|
], -1)),
|
|
610
|
-
|
|
611
|
+
X(t("input", {
|
|
611
612
|
ref_key: "mobileSearchInputRef",
|
|
612
|
-
ref:
|
|
613
|
-
"onUpdate:modelValue":
|
|
613
|
+
ref: h,
|
|
614
|
+
"onUpdate:modelValue": o[2] || (o[2] = (u) => v.value = u),
|
|
614
615
|
type: "text",
|
|
615
616
|
placeholder: e.searchPlaceholder,
|
|
616
617
|
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",
|
|
617
|
-
onInput:
|
|
618
|
-
}, null, 40,
|
|
619
|
-
[
|
|
618
|
+
onInput: se
|
|
619
|
+
}, null, 40, Vt), [
|
|
620
|
+
[ie, v.value]
|
|
620
621
|
])
|
|
621
622
|
])
|
|
622
|
-
])) :
|
|
623
|
-
e.createLabel ? (s(),
|
|
623
|
+
])) : y("", !0),
|
|
624
|
+
e.createLabel ? (s(), l("div", Kt, [
|
|
624
625
|
t("button", {
|
|
625
626
|
class: "w-full flex items-center justify-center gap-2 py-2 text-sm text-blue-700 hover:text-blue-500",
|
|
626
|
-
onClick:
|
|
627
|
+
onClick: o[3] || (o[3] = (u) => te(() => C(d).close()))
|
|
627
628
|
}, [
|
|
628
|
-
|
|
629
|
+
o[14] || (o[14] = t("svg", {
|
|
629
630
|
xmlns: "http://www.w3.org/2000/svg",
|
|
630
631
|
fill: "none",
|
|
631
632
|
viewBox: "0 0 24 24",
|
|
@@ -639,134 +640,134 @@ const st = ["onClick"], lt = ["onKeydown"], ot = {
|
|
|
639
640
|
d: "M12 4.5v15m7.5-7.5h-15"
|
|
640
641
|
})
|
|
641
642
|
], -1)),
|
|
642
|
-
t("span", null,
|
|
643
|
+
t("span", null, p(e.createLabel), 1)
|
|
643
644
|
])
|
|
644
|
-
])) :
|
|
645
|
-
e.multiple ? (s(),
|
|
645
|
+
])) : y("", !0),
|
|
646
|
+
e.multiple ? (s(), l("div", Ot, [
|
|
646
647
|
t("button", {
|
|
647
648
|
class: "text-sm text-blue-600 hover:text-blue-800 transition-colors",
|
|
648
|
-
onClick:
|
|
649
|
-
}, "
|
|
650
|
-
|
|
649
|
+
onClick: Q
|
|
650
|
+
}, p(C(a)("ui.dropdown.selectAll")), 1),
|
|
651
|
+
S.value ? (s(), l("button", {
|
|
651
652
|
key: 0,
|
|
652
653
|
class: "text-sm text-gray-500 hover:text-gray-700 transition-colors",
|
|
653
|
-
onClick:
|
|
654
|
-
}, "
|
|
655
|
-
])) :
|
|
656
|
-
e.isLoading ? (s(),
|
|
654
|
+
onClick: ee
|
|
655
|
+
}, p(C(a)("ui.dropdown.clear")), 1)) : y("", !0)
|
|
656
|
+
])) : y("", !0),
|
|
657
|
+
e.isLoading ? (s(), l("div", Lt, [...o[15] || (o[15] = [
|
|
657
658
|
t("div", { class: "animate-spin w-6 h-6 border-2 border-blue-500 border-t-transparent rounded-full" }, null, -1)
|
|
658
|
-
])])) : (s(),
|
|
659
|
-
e.allowEmpty ? (s(),
|
|
659
|
+
])])) : (s(), l("div", jt, [
|
|
660
|
+
e.allowEmpty ? (s(), l("button", {
|
|
660
661
|
key: 0,
|
|
661
|
-
class:
|
|
662
|
+
class: b(["flex items-center gap-3 w-full px-3 py-3 text-sm text-left hover:bg-gray-50 transition-colors", S.value ? "" : "bg-gray-50 font-medium"]),
|
|
662
663
|
role: "option",
|
|
663
|
-
"aria-selected": !
|
|
664
|
-
onClick:
|
|
664
|
+
"aria-selected": !S.value,
|
|
665
|
+
onClick: o[4] || (o[4] = (u) => z(null, () => C(d).close()))
|
|
665
666
|
}, [
|
|
666
|
-
|
|
667
|
+
S.value ? (s(), l("span", Bt)) : (s(), l("svg", St, [...o[16] || (o[16] = [
|
|
667
668
|
t("path", {
|
|
668
669
|
"stroke-linecap": "round",
|
|
669
670
|
"stroke-linejoin": "round",
|
|
670
671
|
d: "M4.5 12.75l6 6 9-13.5"
|
|
671
672
|
}, null, -1)
|
|
672
673
|
])])),
|
|
673
|
-
t("span", null,
|
|
674
|
-
], 10,
|
|
675
|
-
e.groupKey ? (s(!0),
|
|
674
|
+
t("span", null, p(e.emptyLabel ?? e.placeholder), 1)
|
|
675
|
+
], 10, At)) : y("", !0),
|
|
676
|
+
e.groupKey ? (s(!0), l(B, { key: 1 }, D(Y.value, (u) => (s(), l(B, {
|
|
676
677
|
key: u.label
|
|
677
678
|
}, [
|
|
678
|
-
u.label ? (s(),
|
|
679
|
-
(s(!0),
|
|
679
|
+
u.label ? (s(), l("div", It, p(u.label), 1)) : y("", !0),
|
|
680
|
+
(s(!0), l(B, null, D(u.entries, (r) => (s(), l("button", {
|
|
680
681
|
key: r.item[e.valueKey],
|
|
681
|
-
class:
|
|
682
|
+
class: b(["flex items-center gap-3 w-full px-3 py-3 text-sm text-left hover:bg-gray-50 transition-colors break-words", L(r.item) ? "bg-gray-50 font-medium" : ""]),
|
|
682
683
|
role: "option",
|
|
683
684
|
"aria-selected": L(r.item),
|
|
684
|
-
onClick: (
|
|
685
|
+
onClick: (j) => z(r.item, () => C(d).close())
|
|
685
686
|
}, [
|
|
686
|
-
L(r.item) ? (s(),
|
|
687
|
+
L(r.item) ? (s(), l("svg", Et, [...o[17] || (o[17] = [
|
|
687
688
|
t("path", {
|
|
688
689
|
"stroke-linecap": "round",
|
|
689
690
|
"stroke-linejoin": "round",
|
|
690
691
|
d: "M4.5 12.75l6 6 9-13.5"
|
|
691
692
|
}, null, -1)
|
|
692
|
-
])])) : (s(),
|
|
693
|
-
|
|
694
|
-
t("span", null,
|
|
693
|
+
])])) : (s(), l("span", Dt)),
|
|
694
|
+
M(e.$slots, "item", W({ ref_for: !0 }, { item: r.item }), () => [
|
|
695
|
+
t("span", null, p(r.item[e.labelKey]), 1)
|
|
695
696
|
])
|
|
696
|
-
], 10,
|
|
697
|
-
], 64))), 128)) : (s(!0),
|
|
697
|
+
], 10, zt))), 128))
|
|
698
|
+
], 64))), 128)) : (s(!0), l(B, { key: 2 }, D(E.value, (u) => (s(), l("button", {
|
|
698
699
|
key: u[e.valueKey],
|
|
699
|
-
class:
|
|
700
|
+
class: b(["flex items-center gap-3 w-full px-3 py-3 text-sm text-left hover:bg-gray-50 transition-colors break-words", L(u) ? "bg-gray-50 font-medium" : ""]),
|
|
700
701
|
role: "option",
|
|
701
702
|
"aria-selected": L(u),
|
|
702
|
-
onClick: (r) => z(u, () =>
|
|
703
|
+
onClick: (r) => z(u, () => C(d).close())
|
|
703
704
|
}, [
|
|
704
|
-
L(u) ? (s(),
|
|
705
|
+
L(u) ? (s(), l("svg", Ft, [...o[18] || (o[18] = [
|
|
705
706
|
t("path", {
|
|
706
707
|
"stroke-linecap": "round",
|
|
707
708
|
"stroke-linejoin": "round",
|
|
708
709
|
d: "M4.5 12.75l6 6 9-13.5"
|
|
709
710
|
}, null, -1)
|
|
710
|
-
])])) : (s(),
|
|
711
|
-
|
|
712
|
-
t("span", null,
|
|
711
|
+
])])) : (s(), l("span", Wt)),
|
|
712
|
+
M(e.$slots, "item", W({ ref_for: !0 }, { item: u }), () => [
|
|
713
|
+
t("span", null, p(u[e.labelKey]), 1)
|
|
713
714
|
])
|
|
714
|
-
], 10,
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
715
|
+
], 10, Rt))), 128)),
|
|
716
|
+
E.value.length === 0 && !e.allowEmpty ? (s(), l("div", Pt, [
|
|
717
|
+
M(e.$slots, "empty", {}, () => [
|
|
718
|
+
ue(p(C(a)("ui.dropdown.nothingFound")), 1)
|
|
718
719
|
])
|
|
719
|
-
])) :
|
|
720
|
+
])) : y("", !0)
|
|
720
721
|
]))
|
|
721
722
|
])
|
|
722
723
|
]),
|
|
723
724
|
_: 3
|
|
724
|
-
}, 8, ["useModal", "title"])) :
|
|
725
|
-
], 64)) : (s(),
|
|
725
|
+
}, 8, ["useModal", "title"])) : y("", !0)
|
|
726
|
+
], 64)) : (s(), U(Ae, {
|
|
726
727
|
key: 0,
|
|
727
728
|
stick: e.stick,
|
|
728
|
-
onOpen:
|
|
729
|
-
onClose:
|
|
729
|
+
onOpen: he,
|
|
730
|
+
onClose: ye
|
|
730
731
|
}, {
|
|
731
|
-
button:
|
|
732
|
-
|
|
732
|
+
button: R(({ onToggle: u, isExpanded: r }) => [
|
|
733
|
+
M(e.$slots, "button", P(T({ onToggle: u, isExpanded: r, selectedLabel: F.value })), () => [
|
|
733
734
|
t("button", {
|
|
734
|
-
class:
|
|
735
|
+
class: b(["inline-flex items-center justify-between gap-2 text-sm transition-colors", [
|
|
735
736
|
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]",
|
|
736
737
|
e.view === "default" && r ? "ring-1 ring-blue-500 border-blue-500" : ""
|
|
737
738
|
]]),
|
|
738
|
-
style:
|
|
739
|
+
style: N(e.maxWidth ? { maxWidth: e.maxWidth } : void 0),
|
|
739
740
|
onClick: u
|
|
740
741
|
}, [
|
|
741
742
|
t("span", {
|
|
742
|
-
class:
|
|
743
|
-
},
|
|
744
|
-
(s(),
|
|
743
|
+
class: b(["truncate", e.view === "pill" ? "" : S.value ? "text-gray-900" : "text-gray-500"])
|
|
744
|
+
}, p(F.value), 3),
|
|
745
|
+
(s(), l("svg", {
|
|
745
746
|
xmlns: "http://www.w3.org/2000/svg",
|
|
746
747
|
fill: "none",
|
|
747
748
|
viewBox: "0 0 24 24",
|
|
748
749
|
"stroke-width": "1.5",
|
|
749
750
|
stroke: "currentColor",
|
|
750
|
-
class:
|
|
751
|
-
}, [...
|
|
751
|
+
class: b(["w-4 h-4 text-gray-400 transition-transform shrink-0", r ? "rotate-180" : ""])
|
|
752
|
+
}, [...o[5] || (o[5] = [
|
|
752
753
|
t("path", {
|
|
753
754
|
"stroke-linecap": "round",
|
|
754
755
|
"stroke-linejoin": "round",
|
|
755
756
|
d: "M19.5 8.25l-7.5 7.5-7.5-7.5"
|
|
756
757
|
}, null, -1)
|
|
757
758
|
])], 2))
|
|
758
|
-
], 14,
|
|
759
|
+
], 14, ot)
|
|
759
760
|
])
|
|
760
761
|
]),
|
|
761
|
-
menu:
|
|
762
|
+
menu: R(({ onToggle: u }) => [
|
|
762
763
|
t("div", {
|
|
763
764
|
class: "min-w-[240px] w-full",
|
|
764
|
-
onKeydown: (r) =>
|
|
765
|
+
onKeydown: (r) => we(r, u)
|
|
765
766
|
}, [
|
|
766
|
-
e.title ? (s(),
|
|
767
|
-
e.searchable ? (s(),
|
|
768
|
-
t("div",
|
|
769
|
-
|
|
767
|
+
e.title ? (s(), l("div", rt, p(e.title), 1)) : y("", !0),
|
|
768
|
+
e.searchable ? (s(), l("div", at, [
|
|
769
|
+
t("div", it, [
|
|
770
|
+
o[6] || (o[6] = t("svg", {
|
|
770
771
|
xmlns: "http://www.w3.org/2000/svg",
|
|
771
772
|
fill: "none",
|
|
772
773
|
viewBox: "0 0 24 24",
|
|
@@ -780,25 +781,25 @@ const st = ["onClick"], lt = ["onKeydown"], ot = {
|
|
|
780
781
|
d: "M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"
|
|
781
782
|
})
|
|
782
783
|
], -1)),
|
|
783
|
-
|
|
784
|
+
X(t("input", {
|
|
784
785
|
ref_key: "searchInputRef",
|
|
785
|
-
ref:
|
|
786
|
-
"onUpdate:modelValue":
|
|
786
|
+
ref: $,
|
|
787
|
+
"onUpdate:modelValue": o[0] || (o[0] = (r) => v.value = r),
|
|
787
788
|
type: "text",
|
|
788
789
|
placeholder: e.searchPlaceholder,
|
|
789
790
|
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",
|
|
790
|
-
onInput:
|
|
791
|
-
}, null, 40,
|
|
792
|
-
[
|
|
791
|
+
onInput: se
|
|
792
|
+
}, null, 40, ut), [
|
|
793
|
+
[ie, v.value]
|
|
793
794
|
])
|
|
794
795
|
])
|
|
795
|
-
])) :
|
|
796
|
-
e.createLabel ? (s(),
|
|
796
|
+
])) : y("", !0),
|
|
797
|
+
e.createLabel ? (s(), l("div", dt, [
|
|
797
798
|
t("button", {
|
|
798
799
|
class: "flex items-center gap-2 w-full px-3 py-2 text-sm text-blue-700 hover:bg-gray-50 transition-colors",
|
|
799
|
-
onClick: (r) =>
|
|
800
|
+
onClick: (r) => te(u)
|
|
800
801
|
}, [
|
|
801
|
-
|
|
802
|
+
o[7] || (o[7] = t("svg", {
|
|
802
803
|
xmlns: "http://www.w3.org/2000/svg",
|
|
803
804
|
fill: "none",
|
|
804
805
|
viewBox: "0 0 24 24",
|
|
@@ -812,21 +813,21 @@ const st = ["onClick"], lt = ["onKeydown"], ot = {
|
|
|
812
813
|
d: "M12 4.5v15m7.5-7.5h-15"
|
|
813
814
|
})
|
|
814
815
|
], -1)),
|
|
815
|
-
t("span", null,
|
|
816
|
-
], 8,
|
|
817
|
-
])) :
|
|
818
|
-
e.multiple ? (s(),
|
|
816
|
+
t("span", null, p(e.createLabel), 1)
|
|
817
|
+
], 8, ct)
|
|
818
|
+
])) : y("", !0),
|
|
819
|
+
e.multiple ? (s(), l("div", pt, [
|
|
819
820
|
t("button", {
|
|
820
821
|
class: "text-xs text-blue-600 hover:text-blue-800 transition-colors",
|
|
821
|
-
onClick:
|
|
822
|
-
}, "
|
|
823
|
-
|
|
822
|
+
onClick: Q
|
|
823
|
+
}, p(C(a)("ui.dropdown.selectAll")), 1),
|
|
824
|
+
S.value ? (s(), l("button", {
|
|
824
825
|
key: 0,
|
|
825
826
|
class: "text-xs text-gray-500 hover:text-gray-700 transition-colors",
|
|
826
|
-
onClick:
|
|
827
|
-
}, "
|
|
828
|
-
])) :
|
|
829
|
-
e.isLoading ? (s(),
|
|
827
|
+
onClick: ee
|
|
828
|
+
}, p(C(a)("ui.dropdown.clear")), 1)) : y("", !0)
|
|
829
|
+
])) : y("", !0),
|
|
830
|
+
e.isLoading ? (s(), l("div", vt, [...o[8] || (o[8] = [
|
|
830
831
|
t("svg", {
|
|
831
832
|
class: "animate-spin h-5 w-5 text-gray-400",
|
|
832
833
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -847,107 +848,107 @@ const st = ["onClick"], lt = ["onKeydown"], ot = {
|
|
|
847
848
|
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
|
|
848
849
|
})
|
|
849
850
|
], -1)
|
|
850
|
-
])])) : (s(),
|
|
851
|
+
])])) : (s(), l("div", {
|
|
851
852
|
key: 5,
|
|
852
853
|
ref_key: "listRef",
|
|
853
|
-
ref:
|
|
854
|
+
ref: I,
|
|
854
855
|
class: "max-h-[300px] overflow-y-auto",
|
|
855
856
|
role: "listbox"
|
|
856
857
|
}, [
|
|
857
|
-
e.allowEmpty ? (s(),
|
|
858
|
+
e.allowEmpty ? (s(), l("button", {
|
|
858
859
|
key: 0,
|
|
859
|
-
ref: (r) =>
|
|
860
|
-
class:
|
|
861
|
-
|
|
862
|
-
|
|
860
|
+
ref: (r) => x(r, 0),
|
|
861
|
+
class: b(["flex items-center gap-2 w-full px-3 py-2 text-sm text-left transition-colors", [
|
|
862
|
+
S.value ? "hover:bg-gray-50" : "bg-gray-100 font-medium",
|
|
863
|
+
c.value === 0 ? "bg-gray-50" : ""
|
|
863
864
|
]]),
|
|
864
865
|
role: "option",
|
|
865
|
-
"aria-selected": !
|
|
866
|
+
"aria-selected": !S.value,
|
|
866
867
|
onClick: (r) => z(null, u),
|
|
867
|
-
onMouseenter:
|
|
868
|
+
onMouseenter: o[1] || (o[1] = (r) => c.value = 0)
|
|
868
869
|
}, [
|
|
869
|
-
|
|
870
|
+
S.value ? (s(), l("span", ht)) : (s(), l("svg", ft, [...o[9] || (o[9] = [
|
|
870
871
|
t("path", {
|
|
871
872
|
"stroke-linecap": "round",
|
|
872
873
|
"stroke-linejoin": "round",
|
|
873
874
|
d: "M4.5 12.75l6 6 9-13.5"
|
|
874
875
|
}, null, -1)
|
|
875
876
|
])])),
|
|
876
|
-
t("span", null,
|
|
877
|
-
], 42,
|
|
878
|
-
e.groupKey ? (s(!0),
|
|
877
|
+
t("span", null, p(e.emptyLabel ?? e.placeholder), 1)
|
|
878
|
+
], 42, mt)) : y("", !0),
|
|
879
|
+
e.groupKey ? (s(!0), l(B, { key: 1 }, D(Y.value, (r, j) => (s(), l(B, {
|
|
879
880
|
key: r.label
|
|
880
881
|
}, [
|
|
881
|
-
r.label ? (s(),
|
|
882
|
+
r.label ? (s(), l("div", {
|
|
882
883
|
key: 0,
|
|
883
|
-
class:
|
|
884
|
-
},
|
|
885
|
-
(s(!0),
|
|
886
|
-
key:
|
|
884
|
+
class: b(["px-3 pt-2 pb-1 text-xs font-semibold text-gray-500 uppercase tracking-wide", j > 0 ? "border-t border-gray-100 mt-1" : ""])
|
|
885
|
+
}, p(r.label), 3)) : y("", !0),
|
|
886
|
+
(s(!0), l(B, null, D(r.entries, (w) => (s(), l("button", {
|
|
887
|
+
key: w.item[e.valueKey],
|
|
887
888
|
ref_for: !0,
|
|
888
|
-
ref: (
|
|
889
|
-
class:
|
|
890
|
-
L(
|
|
891
|
-
|
|
889
|
+
ref: (G) => x(G, w.flatIndex),
|
|
890
|
+
class: b(["flex items-center gap-2 w-full px-3 py-2 text-sm text-left transition-colors break-words", [
|
|
891
|
+
L(w.item) ? "bg-gray-100 font-medium" : "hover:bg-gray-50",
|
|
892
|
+
c.value === w.flatIndex ? "bg-gray-50" : ""
|
|
892
893
|
]]),
|
|
893
894
|
role: "option",
|
|
894
|
-
"aria-selected": L(
|
|
895
|
-
onClick: (
|
|
896
|
-
onMouseenter: (
|
|
895
|
+
"aria-selected": L(w.item),
|
|
896
|
+
onClick: (G) => z(w.item, u),
|
|
897
|
+
onMouseenter: (G) => c.value = w.flatIndex
|
|
897
898
|
}, [
|
|
898
|
-
L(
|
|
899
|
+
L(w.item) ? (s(), l("svg", wt, [...o[10] || (o[10] = [
|
|
899
900
|
t("path", {
|
|
900
901
|
"stroke-linecap": "round",
|
|
901
902
|
"stroke-linejoin": "round",
|
|
902
903
|
d: "M4.5 12.75l6 6 9-13.5"
|
|
903
904
|
}, null, -1)
|
|
904
|
-
])])) : (s(),
|
|
905
|
-
|
|
906
|
-
t("span", null,
|
|
905
|
+
])])) : (s(), l("span", gt)),
|
|
906
|
+
M(e.$slots, "item", W({ ref_for: !0 }, { item: w.item }), () => [
|
|
907
|
+
t("span", null, p(w.item[e.labelKey]), 1)
|
|
907
908
|
])
|
|
908
|
-
], 42,
|
|
909
|
-
], 64))), 128)) : (s(!0),
|
|
909
|
+
], 42, yt))), 128))
|
|
910
|
+
], 64))), 128)) : (s(!0), l(B, { key: 2 }, D(E.value, (r, j) => (s(), l("button", {
|
|
910
911
|
key: r[e.valueKey],
|
|
911
912
|
ref_for: !0,
|
|
912
|
-
ref: (
|
|
913
|
-
class:
|
|
913
|
+
ref: (w) => x(w, O.value + j),
|
|
914
|
+
class: b(["flex items-center gap-2 w-full px-3 py-2 text-sm text-left transition-colors break-words", [
|
|
914
915
|
L(r) ? "bg-gray-100 font-medium" : "hover:bg-gray-50",
|
|
915
|
-
|
|
916
|
+
c.value === O.value + j ? "bg-gray-50" : ""
|
|
916
917
|
]]),
|
|
917
918
|
role: "option",
|
|
918
919
|
"aria-selected": L(r),
|
|
919
|
-
onClick: (
|
|
920
|
-
onMouseenter: (
|
|
920
|
+
onClick: (w) => z(r, u),
|
|
921
|
+
onMouseenter: (w) => c.value = O.value + j
|
|
921
922
|
}, [
|
|
922
|
-
L(r) ? (s(),
|
|
923
|
+
L(r) ? (s(), l("svg", kt, [...o[11] || (o[11] = [
|
|
923
924
|
t("path", {
|
|
924
925
|
"stroke-linecap": "round",
|
|
925
926
|
"stroke-linejoin": "round",
|
|
926
927
|
d: "M4.5 12.75l6 6 9-13.5"
|
|
927
928
|
}, null, -1)
|
|
928
|
-
])])) : (s(),
|
|
929
|
-
|
|
930
|
-
t("span", null,
|
|
929
|
+
])])) : (s(), l("span", xt)),
|
|
930
|
+
M(e.$slots, "item", W({ ref_for: !0 }, { item: r }), () => [
|
|
931
|
+
t("span", null, p(r[e.labelKey]), 1)
|
|
931
932
|
])
|
|
932
|
-
], 42,
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
933
|
+
], 42, bt))), 128)),
|
|
934
|
+
E.value.length === 0 && !e.allowEmpty ? (s(), l("div", Ct, [
|
|
935
|
+
M(e.$slots, "empty", {}, () => [
|
|
936
|
+
ue(p(C(a)("ui.dropdown.nothingFound")), 1)
|
|
936
937
|
])
|
|
937
|
-
])) :
|
|
938
|
+
])) : y("", !0)
|
|
938
939
|
], 512))
|
|
939
|
-
], 40,
|
|
940
|
+
], 40, nt)
|
|
940
941
|
]),
|
|
941
942
|
_: 3
|
|
942
943
|
}, 8, ["stick"]));
|
|
943
944
|
}
|
|
944
945
|
});
|
|
945
946
|
export {
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
947
|
+
st as O,
|
|
948
|
+
Ae as _,
|
|
949
|
+
Ht as a,
|
|
950
|
+
Jt as b,
|
|
951
|
+
Xt as c,
|
|
952
|
+
Ye as m,
|
|
953
|
+
lt as u
|
|
953
954
|
};
|