@livestorm/ui-vue 1.0.4 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -16
- package/dist/components.mjs +1560 -0
- package/dist/environment-e70e5768.mjs +1664 -0
- package/dist/index.mjs +168 -0
- package/dist/style.css +1 -1
- package/package.json +68 -20
- package/dist/ui-vue.es.js +0 -5182
- package/dist/ui-vue.umd.js +0 -671
|
@@ -0,0 +1,1560 @@
|
|
|
1
|
+
import { _ as L, u as E, i as K, D as $e, I as ee, e as te, f as le, B as X, R as ne, g as oe, h as se, j as ae, k as ie, l as de } from "./environment-e70e5768.mjs";
|
|
2
|
+
import { provide as U, computed as w, ref as D, watch as P, onMounted as De, onBeforeUnmount as re, resolveComponent as S, openBlock as s, createBlock as I, withCtx as B, renderSlot as y, normalizeProps as Y, guardReactiveProps as Z, createElementVNode as m, normalizeClass as f, unref as a, withModifiers as F, createElementBlock as i, createVNode as M, createCommentVNode as v, createTextVNode as H, toDisplayString as j, defineComponent as G, mergeProps as W, inject as V, resolveDirective as ce, withDirectives as R, resolveDynamicComponent as Ve, Fragment as J, withKeys as ue, normalizeStyle as fe, toRefs as Q, pushScopeId as Te, popScopeId as je, renderList as Le, reactive as Ae, vModelCheckbox as ze } from "vue";
|
|
3
|
+
import "@vueuse/core";
|
|
4
|
+
import "i18next";
|
|
5
|
+
import "floating-vue";
|
|
6
|
+
import "vue-router";
|
|
7
|
+
import "mitt";
|
|
8
|
+
let Pe = 0;
|
|
9
|
+
function Ee() {
|
|
10
|
+
return ++Pe;
|
|
11
|
+
}
|
|
12
|
+
const Re = { class: "toggle toggle-default cursor-pointer flex items-center justify-center w-full" }, He = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "gradient-divider-top"
|
|
15
|
+
}, Ge = {
|
|
16
|
+
key: 0,
|
|
17
|
+
class: "sticky-header"
|
|
18
|
+
}, Ne = { key: 1 }, Ue = {
|
|
19
|
+
key: 1,
|
|
20
|
+
class: "gradient-divider-bottom"
|
|
21
|
+
}, Fe = {
|
|
22
|
+
key: 0,
|
|
23
|
+
class: "sticky-footer"
|
|
24
|
+
}, qe = { key: 1 }, Ke = {
|
|
25
|
+
key: 0,
|
|
26
|
+
class: "pt-4"
|
|
27
|
+
}, We = {
|
|
28
|
+
__name: "BaseDropdownMenu",
|
|
29
|
+
props: {
|
|
30
|
+
icon: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: "i-ls-more-horizontal"
|
|
33
|
+
},
|
|
34
|
+
searchEnabled: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: !1
|
|
37
|
+
},
|
|
38
|
+
searchPosition: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: "top",
|
|
41
|
+
validator: (e) => ["top", "bottom"].includes(e)
|
|
42
|
+
},
|
|
43
|
+
searchThrottle: {
|
|
44
|
+
type: Number,
|
|
45
|
+
default: 0
|
|
46
|
+
},
|
|
47
|
+
searchPlaceholder: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: null
|
|
50
|
+
},
|
|
51
|
+
containerClass: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: ""
|
|
54
|
+
},
|
|
55
|
+
/** Prevent click events propagation on the trigger */
|
|
56
|
+
blockClick: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: !1
|
|
59
|
+
},
|
|
60
|
+
scrollable: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: !1
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
emits: ["search:enter", "update:search"],
|
|
66
|
+
setup(e, { expose: l, emit: t }) {
|
|
67
|
+
const n = e;
|
|
68
|
+
U("BaseDropdown", { close: d });
|
|
69
|
+
function d() {
|
|
70
|
+
g.value.hide();
|
|
71
|
+
}
|
|
72
|
+
l({
|
|
73
|
+
hide: d
|
|
74
|
+
});
|
|
75
|
+
const o = E(), c = w(() => o.header ? o.header() : null), r = w(() => o.footer ? o.footer() : null), b = w(() => n.searchEnabled && n.searchPosition === "top"), h = w(() => n.searchEnabled && n.searchPosition === "bottom"), _ = K(), g = D(), u = D();
|
|
76
|
+
P(
|
|
77
|
+
() => u.value,
|
|
78
|
+
(p) => {
|
|
79
|
+
t("update:search", p);
|
|
80
|
+
}
|
|
81
|
+
), U("BaseDropdown.search", u);
|
|
82
|
+
function C(p) {
|
|
83
|
+
p.stopPropagation(), p.preventDefault();
|
|
84
|
+
}
|
|
85
|
+
function T() {
|
|
86
|
+
g.value.$refs.popper.$refs.reference.addEventListener("click", C);
|
|
87
|
+
}
|
|
88
|
+
function O() {
|
|
89
|
+
g.value.$refs.popper.$refs.reference.removeEventListener("click", C);
|
|
90
|
+
}
|
|
91
|
+
P(
|
|
92
|
+
() => n.blockClick,
|
|
93
|
+
(p, k) => {
|
|
94
|
+
p !== k && (p ? T() : O());
|
|
95
|
+
}
|
|
96
|
+
), De(() => {
|
|
97
|
+
n.blockClick && T();
|
|
98
|
+
}), re(() => {
|
|
99
|
+
O();
|
|
100
|
+
});
|
|
101
|
+
const $ = D();
|
|
102
|
+
function A() {
|
|
103
|
+
n.searchEnabled && !_ && $.value.focusSearch();
|
|
104
|
+
}
|
|
105
|
+
return (p, k) => {
|
|
106
|
+
const x = S("RenderSlot"), N = S("BaseDropdownMenuSearch"), Ie = S("BaseButton"), Oe = S("VDropdown");
|
|
107
|
+
return s(), I(Oe, {
|
|
108
|
+
ref_key: "popover",
|
|
109
|
+
ref: g,
|
|
110
|
+
class: "base-dropdown-menu",
|
|
111
|
+
"popper-class": "no-padding",
|
|
112
|
+
onApplyShow: k[6] || (k[6] = (z) => A())
|
|
113
|
+
}, {
|
|
114
|
+
default: B(() => [
|
|
115
|
+
y(p.$slots, "default", Y(Z(n)), () => [
|
|
116
|
+
m("div", Re, [
|
|
117
|
+
m("div", {
|
|
118
|
+
class: f([e.icon, "icon w-4 h-4 text-grey-700 hover:text-grey-900"])
|
|
119
|
+
}, null, 2)
|
|
120
|
+
])
|
|
121
|
+
], !0)
|
|
122
|
+
]),
|
|
123
|
+
popper: B(() => [
|
|
124
|
+
m("div", {
|
|
125
|
+
class: f(["max-w-inherit max-h-inherit text-grey-900 [&_a:not(.base-button)]:text-grey-900", [
|
|
126
|
+
{
|
|
127
|
+
"bg-white rounded-8": a(K)
|
|
128
|
+
},
|
|
129
|
+
a(c) || a(b) ? "pt-2" : "pt-1",
|
|
130
|
+
a(r) || a(h) ? "pb-2" : "pb-1",
|
|
131
|
+
e.containerClass
|
|
132
|
+
]]),
|
|
133
|
+
"data-testid": "popper",
|
|
134
|
+
onClick: k[4] || (k[4] = F(() => {
|
|
135
|
+
}, ["stop"]))
|
|
136
|
+
}, [
|
|
137
|
+
a(c) || a(b) ? (s(), i("div", He, [
|
|
138
|
+
a(c) ? (s(), i("div", Ge, [
|
|
139
|
+
M(x, { vnodes: a(c) }, null, 8, ["vnodes"])
|
|
140
|
+
])) : a(b) ? (s(), i("div", Ne, [
|
|
141
|
+
M(N, {
|
|
142
|
+
ref_key: "searchInput",
|
|
143
|
+
ref: $,
|
|
144
|
+
class: "sticky-header bg-white",
|
|
145
|
+
"padding-item": "px-2 pb-2",
|
|
146
|
+
throttle: e.searchThrottle,
|
|
147
|
+
placeholder: e.searchPlaceholder,
|
|
148
|
+
"onUpdate:search": k[0] || (k[0] = (z) => u.value = z),
|
|
149
|
+
"onSearch:enter": k[1] || (k[1] = (z) => p.$emit("search:enter", u.value))
|
|
150
|
+
}, null, 8, ["throttle", "placeholder"]),
|
|
151
|
+
y(p.$slots, "header-with-search-additional-block", {}, void 0, !0)
|
|
152
|
+
])) : v("", !0)
|
|
153
|
+
])) : v("", !0),
|
|
154
|
+
m("div", {
|
|
155
|
+
ref: "list",
|
|
156
|
+
class: f(["menu-items max-w-inherit overflow-y-auto", {
|
|
157
|
+
"max-h-[268px]": e.scrollable || a(_)
|
|
158
|
+
}])
|
|
159
|
+
}, [
|
|
160
|
+
y(p.$slots, "popper", Y(Z({ ...n, search: u.value })), void 0, !0)
|
|
161
|
+
], 2),
|
|
162
|
+
a(r) || a(h) ? (s(), i("div", Ue, [
|
|
163
|
+
a(r) ? (s(), i("div", Fe, [
|
|
164
|
+
M(x, { vnodes: a(r) }, null, 8, ["vnodes"])
|
|
165
|
+
])) : a(h) ? (s(), i("div", qe, [
|
|
166
|
+
y(p.$slots, "header-with-search-additional-block", {}, void 0, !0),
|
|
167
|
+
M(N, {
|
|
168
|
+
ref_key: "searchInput",
|
|
169
|
+
ref: $,
|
|
170
|
+
class: "sticky-footer bg-white",
|
|
171
|
+
"padding-item": "px-2 pt-2",
|
|
172
|
+
throttle: e.searchThrottle,
|
|
173
|
+
placeholder: e.searchPlaceholder,
|
|
174
|
+
"onUpdate:search": k[2] || (k[2] = (z) => u.value = z),
|
|
175
|
+
"onSearch:enter": k[3] || (k[3] = (z) => p.$emit("search:enter", u.value))
|
|
176
|
+
}, null, 8, ["throttle", "placeholder"])
|
|
177
|
+
])) : v("", !0)
|
|
178
|
+
])) : v("", !0)
|
|
179
|
+
], 2),
|
|
180
|
+
a(_) ? (s(), i("div", Ke, [
|
|
181
|
+
M(Ie, {
|
|
182
|
+
class: "base-button-alpha-white w-full",
|
|
183
|
+
onClick: k[5] || (k[5] = (z) => d())
|
|
184
|
+
}, {
|
|
185
|
+
default: B(() => [
|
|
186
|
+
H(j(p.i18n.t("general_text_cancel")), 1)
|
|
187
|
+
]),
|
|
188
|
+
_: 1
|
|
189
|
+
})
|
|
190
|
+
])) : v("", !0)
|
|
191
|
+
]),
|
|
192
|
+
_: 3
|
|
193
|
+
}, 512);
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
}, Je = /* @__PURE__ */ L(We, [["__scopeId", "data-v-ec1adfdc"]]), he = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
197
|
+
__proto__: null,
|
|
198
|
+
default: Je
|
|
199
|
+
}, Symbol.toStringTag, { value: "Module" })), Qe = {
|
|
200
|
+
inheritAttrs: !1
|
|
201
|
+
}, Xe = /* @__PURE__ */ G({
|
|
202
|
+
...Qe,
|
|
203
|
+
__name: "BaseDropdownMenuButton",
|
|
204
|
+
emits: ["click"],
|
|
205
|
+
setup(e) {
|
|
206
|
+
return (l, t) => {
|
|
207
|
+
const n = S("BaseButton"), d = S("BaseDropdownMenuItem");
|
|
208
|
+
return s(), I(d, {
|
|
209
|
+
tag: "div",
|
|
210
|
+
"has-hover-effect": !1,
|
|
211
|
+
"keep-open": "",
|
|
212
|
+
"padding-item": "px-2"
|
|
213
|
+
}, {
|
|
214
|
+
default: B(() => [
|
|
215
|
+
M(n, W(l.$attrs, {
|
|
216
|
+
class: "w-full",
|
|
217
|
+
onClick: t[0] || (t[0] = (o) => l.$emit("click"))
|
|
218
|
+
}), {
|
|
219
|
+
default: B(() => [
|
|
220
|
+
y(l.$slots, "default")
|
|
221
|
+
]),
|
|
222
|
+
_: 3
|
|
223
|
+
}, 16)
|
|
224
|
+
]),
|
|
225
|
+
_: 3
|
|
226
|
+
});
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
}), pe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
230
|
+
__proto__: null,
|
|
231
|
+
default: Xe
|
|
232
|
+
}, Symbol.toStringTag, { value: "Module" })), Ye = {}, Ze = /* @__PURE__ */ m("hr", { class: "h-[1px] border-alpha-black-100 w-full" }, null, -1);
|
|
233
|
+
function et(e, l) {
|
|
234
|
+
const t = S("BaseDropdownMenuItem");
|
|
235
|
+
return s(), I(t, {
|
|
236
|
+
tag: "div",
|
|
237
|
+
"padding-item": "px-O py-1",
|
|
238
|
+
"keep-open": "",
|
|
239
|
+
"has-hover-effect": !1
|
|
240
|
+
}, {
|
|
241
|
+
default: B(() => [
|
|
242
|
+
Ze
|
|
243
|
+
]),
|
|
244
|
+
_: 1
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
const tt = /* @__PURE__ */ L(Ye, [["render", et]]), me = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
248
|
+
__proto__: null,
|
|
249
|
+
default: tt
|
|
250
|
+
}, Symbol.toStringTag, { value: "Module" })), lt = { class: "left-part flex items-center [&>*]:mr-2" }, nt = {
|
|
251
|
+
key: 0,
|
|
252
|
+
class: "loader grey-dovegray w-4 h-4",
|
|
253
|
+
size: "small"
|
|
254
|
+
}, ot = {
|
|
255
|
+
key: 0,
|
|
256
|
+
class: "icon w-4 h-4"
|
|
257
|
+
}, st = ["innerHTML"], at = { class: "right-part flex items-center [&>*]:ml-2" }, it = {
|
|
258
|
+
key: 0,
|
|
259
|
+
class: "text-14-regular text-grey-600"
|
|
260
|
+
}, dt = {
|
|
261
|
+
mixins: [
|
|
262
|
+
$e
|
|
263
|
+
]
|
|
264
|
+
}, rt = /* @__PURE__ */ Object.assign(dt, {
|
|
265
|
+
__name: "BaseDropdownMenuItem",
|
|
266
|
+
props: {
|
|
267
|
+
id: {
|
|
268
|
+
type: String,
|
|
269
|
+
default: null
|
|
270
|
+
},
|
|
271
|
+
label: {
|
|
272
|
+
type: [String, Function],
|
|
273
|
+
default: null
|
|
274
|
+
},
|
|
275
|
+
secondaryLabel: {
|
|
276
|
+
type: String,
|
|
277
|
+
default: null
|
|
278
|
+
},
|
|
279
|
+
icon: {
|
|
280
|
+
type: String,
|
|
281
|
+
default: null
|
|
282
|
+
},
|
|
283
|
+
secondaryIcon: {
|
|
284
|
+
type: String,
|
|
285
|
+
default: null
|
|
286
|
+
},
|
|
287
|
+
loading: {
|
|
288
|
+
type: Boolean,
|
|
289
|
+
default: !1
|
|
290
|
+
},
|
|
291
|
+
disabled: {
|
|
292
|
+
type: Boolean,
|
|
293
|
+
default: !1
|
|
294
|
+
},
|
|
295
|
+
keepOpen: {
|
|
296
|
+
type: Boolean,
|
|
297
|
+
default: !1
|
|
298
|
+
},
|
|
299
|
+
labelClass: {
|
|
300
|
+
type: String,
|
|
301
|
+
default: null
|
|
302
|
+
},
|
|
303
|
+
secondaryLabelClass: {
|
|
304
|
+
type: String,
|
|
305
|
+
default: null
|
|
306
|
+
},
|
|
307
|
+
tooltip: {
|
|
308
|
+
type: [String, Object],
|
|
309
|
+
default: null
|
|
310
|
+
},
|
|
311
|
+
labelTooltip: {
|
|
312
|
+
type: Object,
|
|
313
|
+
default: null
|
|
314
|
+
},
|
|
315
|
+
secondaryLabelTooltip: {
|
|
316
|
+
type: Object,
|
|
317
|
+
default: null
|
|
318
|
+
},
|
|
319
|
+
additionalInfo: {
|
|
320
|
+
type: String,
|
|
321
|
+
default: null
|
|
322
|
+
},
|
|
323
|
+
active: {
|
|
324
|
+
type: Boolean,
|
|
325
|
+
default: !1
|
|
326
|
+
},
|
|
327
|
+
canClickOnActive: {
|
|
328
|
+
type: Boolean,
|
|
329
|
+
default: !1
|
|
330
|
+
},
|
|
331
|
+
paddingItem: {
|
|
332
|
+
type: String,
|
|
333
|
+
default: "py-2 px-4"
|
|
334
|
+
},
|
|
335
|
+
hasHoverEffect: {
|
|
336
|
+
type: Boolean,
|
|
337
|
+
default: !0
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
emits: ["click", "input"],
|
|
341
|
+
setup(e, { emit: l }) {
|
|
342
|
+
const t = e, n = V("BaseDropdown"), d = w(() => t.loading || t.disabled), o = w(() => ({
|
|
343
|
+
icon: t.icon,
|
|
344
|
+
active: t.active
|
|
345
|
+
})), c = E(), r = w(() => c.icon ? c.icon() : null);
|
|
346
|
+
function b(h) {
|
|
347
|
+
t.disabled || t.active && !t.canClickOnActive ? h.preventDefault() : (l("click", h), t.keepOpen || n.close());
|
|
348
|
+
}
|
|
349
|
+
return (h, _) => {
|
|
350
|
+
const g = S("RenderSlot"), u = ce("tooltip");
|
|
351
|
+
return R((s(), I(Ve(h.component.is), W(h.component.props, {
|
|
352
|
+
disabled: a(d) ? !0 : null,
|
|
353
|
+
class: ["base-dropdown-menu-item v-popover-item flex w-full h-auto", a(o)],
|
|
354
|
+
onClick: b,
|
|
355
|
+
onInput: _[0] || (_[0] = (C) => h.$emit("input", C))
|
|
356
|
+
}), {
|
|
357
|
+
default: B(() => [
|
|
358
|
+
m("div", {
|
|
359
|
+
class: f(["base-dropdown-item flex w-full justify-between", [{
|
|
360
|
+
"hover:bg-grey-100 transition-all duration-200": !e.active && !a(d) && e.hasHoverEffect,
|
|
361
|
+
"opacity-40 cursor-default pointer-events-none": a(d),
|
|
362
|
+
"bg-livestorm-100": e.active
|
|
363
|
+
}, e.paddingItem]])
|
|
364
|
+
}, [
|
|
365
|
+
y(h.$slots, "default", {}, () => [
|
|
366
|
+
m("div", lt, [
|
|
367
|
+
e.loading ? (s(), i("span", nt)) : (s(), i(J, { key: 1 }, [
|
|
368
|
+
y(h.$slots, "additional-left-part"),
|
|
369
|
+
y(h.$slots, "checkbox"),
|
|
370
|
+
a(r) ? (s(), i("div", ot, [
|
|
371
|
+
M(g, { vnodes: a(r) }, null, 8, ["vnodes"])
|
|
372
|
+
])) : e.icon ? (s(), i("div", {
|
|
373
|
+
key: 1,
|
|
374
|
+
class: f([e.icon, "icon w-4 h-4"])
|
|
375
|
+
}, null, 2)) : v("", !0)
|
|
376
|
+
], 64)),
|
|
377
|
+
m("div", null, [
|
|
378
|
+
m("div", {
|
|
379
|
+
class: f([[
|
|
380
|
+
e.labelClass
|
|
381
|
+
], "text-14-medium text-left"])
|
|
382
|
+
}, [
|
|
383
|
+
y(h.$slots, "label-override", {}, () => [
|
|
384
|
+
R(m("div", {
|
|
385
|
+
class: "no-info",
|
|
386
|
+
innerHTML: e.label
|
|
387
|
+
}, null, 8, st), [
|
|
388
|
+
[u, e.labelTooltip]
|
|
389
|
+
])
|
|
390
|
+
])
|
|
391
|
+
], 2),
|
|
392
|
+
R((s(), i("div", {
|
|
393
|
+
class: f([e.secondaryLabelClass, "text-14-regular text-grey-600 text-left no-info"])
|
|
394
|
+
}, [
|
|
395
|
+
H(j(e.secondaryLabel), 1)
|
|
396
|
+
], 2)), [
|
|
397
|
+
[u, e.secondaryLabelTooltip]
|
|
398
|
+
])
|
|
399
|
+
])
|
|
400
|
+
]),
|
|
401
|
+
m("div", at, [
|
|
402
|
+
e.additionalInfo ? (s(), i("div", it, j(e.additionalInfo), 1)) : v("", !0),
|
|
403
|
+
e.secondaryIcon ? (s(), i("div", {
|
|
404
|
+
key: 1,
|
|
405
|
+
class: f([e.secondaryIcon, "icon icon-right w-4 h-4 text-grey-600"])
|
|
406
|
+
}, null, 2)) : v("", !0),
|
|
407
|
+
y(h.$slots, "additional-right-part")
|
|
408
|
+
])
|
|
409
|
+
])
|
|
410
|
+
], 2)
|
|
411
|
+
]),
|
|
412
|
+
_: 3
|
|
413
|
+
}, 16, ["disabled", "class"])), [
|
|
414
|
+
[u, e.tooltip]
|
|
415
|
+
]);
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
}), ve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
419
|
+
__proto__: null,
|
|
420
|
+
default: rt
|
|
421
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
422
|
+
let q;
|
|
423
|
+
function ct(e) {
|
|
424
|
+
if (e)
|
|
425
|
+
if (clearTimeout(q), e.focus(), "activeElement" in document) {
|
|
426
|
+
const l = setInterval(() => {
|
|
427
|
+
e.focus(), document.activeElement === e && (clearInterval(l), clearTimeout(q), q = setTimeout(() => {
|
|
428
|
+
document.activeElement !== e && focus(e);
|
|
429
|
+
}, 100));
|
|
430
|
+
}, 100);
|
|
431
|
+
} else
|
|
432
|
+
setTimeout(() => {
|
|
433
|
+
e.focus();
|
|
434
|
+
}, 1e3);
|
|
435
|
+
}
|
|
436
|
+
const ut = /* @__PURE__ */ G({
|
|
437
|
+
__name: "BaseDropdownMenuSearch",
|
|
438
|
+
props: {
|
|
439
|
+
paddingItem: {
|
|
440
|
+
type: String,
|
|
441
|
+
default: "px-2"
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
emits: ["update:search", "search:enter"],
|
|
445
|
+
setup(e, { expose: l, emit: t }) {
|
|
446
|
+
const n = D();
|
|
447
|
+
function d() {
|
|
448
|
+
ct(n.value);
|
|
449
|
+
}
|
|
450
|
+
l({
|
|
451
|
+
focusSearch: d
|
|
452
|
+
});
|
|
453
|
+
const o = D();
|
|
454
|
+
return P(
|
|
455
|
+
() => o.value,
|
|
456
|
+
(c) => {
|
|
457
|
+
t("update:search", c);
|
|
458
|
+
}
|
|
459
|
+
), (c, r) => {
|
|
460
|
+
const b = S("BaseSearchInput"), h = S("BaseDropdownMenuItem");
|
|
461
|
+
return s(), I(h, {
|
|
462
|
+
tag: "div",
|
|
463
|
+
"keep-open": "",
|
|
464
|
+
"padding-item": e.paddingItem,
|
|
465
|
+
"has-hover-effect": !1
|
|
466
|
+
}, {
|
|
467
|
+
default: B(() => [
|
|
468
|
+
M(b, W({
|
|
469
|
+
ref_key: "searchInput",
|
|
470
|
+
ref: n
|
|
471
|
+
}, c.$attrs, {
|
|
472
|
+
modelValue: o.value,
|
|
473
|
+
"onUpdate:modelValue": r[0] || (r[0] = (_) => o.value = _),
|
|
474
|
+
modelModifiers: { trim: !0, lazy: !0 },
|
|
475
|
+
"input-class": "base-input-small",
|
|
476
|
+
class: "w-full",
|
|
477
|
+
onKeyup: r[1] || (r[1] = ue((_) => t("search:enter"), ["enter"]))
|
|
478
|
+
}), null, 16, ["modelValue"])
|
|
479
|
+
]),
|
|
480
|
+
_: 1
|
|
481
|
+
}, 8, ["padding-item"]);
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
}), be = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
485
|
+
__proto__: null,
|
|
486
|
+
default: ut
|
|
487
|
+
}, Symbol.toStringTag, { value: "Module" })), ft = { class: "text-12-medium text-grey-600 flex justify-between items-center w-full" }, ht = /* @__PURE__ */ G({
|
|
488
|
+
__name: "BaseDropdownMenuTitle",
|
|
489
|
+
props: {
|
|
490
|
+
title: {
|
|
491
|
+
type: String,
|
|
492
|
+
required: !0
|
|
493
|
+
},
|
|
494
|
+
paddingItem: {
|
|
495
|
+
type: String,
|
|
496
|
+
default: "px-4 pt-2 pb-1"
|
|
497
|
+
}
|
|
498
|
+
},
|
|
499
|
+
setup(e) {
|
|
500
|
+
return (l, t) => {
|
|
501
|
+
const n = S("BaseDropdownMenuItem");
|
|
502
|
+
return s(), I(n, {
|
|
503
|
+
tag: "h3",
|
|
504
|
+
"padding-item": e.paddingItem,
|
|
505
|
+
"keep-open": "",
|
|
506
|
+
"has-hover-effect": !1
|
|
507
|
+
}, {
|
|
508
|
+
default: B(() => [
|
|
509
|
+
m("div", ft, [
|
|
510
|
+
m("span", null, j(e.title), 1),
|
|
511
|
+
y(l.$slots, "additional-info")
|
|
512
|
+
])
|
|
513
|
+
]),
|
|
514
|
+
_: 3
|
|
515
|
+
}, 8, ["padding-item"]);
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
}), _e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
519
|
+
__proto__: null,
|
|
520
|
+
default: ht
|
|
521
|
+
}, Symbol.toStringTag, { value: "Module" })), pt = { class: "flex min-h-full items-end justify-center p-2 text-center sm:items-center" }, mt = { class: "flex justify-between" }, vt = {
|
|
522
|
+
key: 0,
|
|
523
|
+
class: "flex items-center px-6 pt-6"
|
|
524
|
+
}, bt = { key: 1 }, _t = {
|
|
525
|
+
key: 0,
|
|
526
|
+
class: "p-6 text-left text-grey-700",
|
|
527
|
+
"data-testid": "modal-content"
|
|
528
|
+
}, gt = { class: "flex flex-col-reverse sm:flex-row gap-2.5 w-full justify-end" }, yt = /* @__PURE__ */ G({
|
|
529
|
+
__name: "BaseModalContent",
|
|
530
|
+
props: {
|
|
531
|
+
title: null,
|
|
532
|
+
locked: { type: Boolean },
|
|
533
|
+
width: null,
|
|
534
|
+
confirmLabel: null,
|
|
535
|
+
cancelLabel: null,
|
|
536
|
+
confirmLoading: { type: Boolean },
|
|
537
|
+
confirmColor: null,
|
|
538
|
+
confirmHref: null,
|
|
539
|
+
type: null
|
|
540
|
+
},
|
|
541
|
+
emits: [
|
|
542
|
+
"confirm",
|
|
543
|
+
"cancel",
|
|
544
|
+
"close"
|
|
545
|
+
],
|
|
546
|
+
setup(e, { emit: l }) {
|
|
547
|
+
const t = e, n = V(ee);
|
|
548
|
+
if (!n)
|
|
549
|
+
throw new Error("BaseModalContent must be used inside a BaseModal");
|
|
550
|
+
P(() => t.locked, (g) => {
|
|
551
|
+
n.locked = g;
|
|
552
|
+
}, { immediate: !0 });
|
|
553
|
+
const d = V(te);
|
|
554
|
+
function o(g = !0) {
|
|
555
|
+
t.locked || (l("close"), g && d());
|
|
556
|
+
}
|
|
557
|
+
V(le)(() => {
|
|
558
|
+
o(!1);
|
|
559
|
+
});
|
|
560
|
+
const r = E(), b = w(() => r.content ? r.content() : []), h = w(() => r["additional-buttons"]()), _ = w(() => {
|
|
561
|
+
switch (t.type) {
|
|
562
|
+
case "alert":
|
|
563
|
+
return "i-ls-alert-circle text-red-600";
|
|
564
|
+
case "warning":
|
|
565
|
+
return "i-ls-alert-triangle text-orange-600";
|
|
566
|
+
case "info":
|
|
567
|
+
return "i-ls-info text-livestorm-600";
|
|
568
|
+
case "success":
|
|
569
|
+
return "i-ls-check-circle text-green-600";
|
|
570
|
+
default:
|
|
571
|
+
return "i-ls-alert-circle text-livestorm-600";
|
|
572
|
+
}
|
|
573
|
+
});
|
|
574
|
+
return (g, u) => (s(), i("div", pt, [
|
|
575
|
+
m("div", {
|
|
576
|
+
class: "relative bg-white w-full min-w-[320px] max-w-[650px] rounded-8 base-modal-box",
|
|
577
|
+
style: fe({ "max-width": `${e.width}px` }),
|
|
578
|
+
onClick: u[4] || (u[4] = F(() => {
|
|
579
|
+
}, ["stop"]))
|
|
580
|
+
}, [
|
|
581
|
+
m("div", mt, [
|
|
582
|
+
t.title ? (s(), i("div", vt, [
|
|
583
|
+
t.type ? (s(), i("div", {
|
|
584
|
+
key: 0,
|
|
585
|
+
class: f(["w-6 h-6 mr-2 sm:mr-3 shrink-0", a(_)])
|
|
586
|
+
}, null, 2)) : v("", !0),
|
|
587
|
+
m("span", {
|
|
588
|
+
"data-testid": "modal-title",
|
|
589
|
+
class: f(["block text-16-semibold text-grey-900 text-left", { "pb-6": !a(b) }])
|
|
590
|
+
}, j(t.title), 3)
|
|
591
|
+
])) : (s(), i("span", bt)),
|
|
592
|
+
e.locked ? v("", !0) : (s(), i("div", {
|
|
593
|
+
key: 2,
|
|
594
|
+
class: "i-ls-x w-6 h-6 text-grey-700 hover:text-grey-900 cursor-pointer shrink-0 mt-6 mr-6",
|
|
595
|
+
"data-testid": "modal-close-icon",
|
|
596
|
+
tabindex: "0",
|
|
597
|
+
role: "button",
|
|
598
|
+
"aria-label": "close",
|
|
599
|
+
onClick: u[0] || (u[0] = (C) => o()),
|
|
600
|
+
onKeydown: u[1] || (u[1] = ue((C) => o(), ["enter"]))
|
|
601
|
+
}, null, 32))
|
|
602
|
+
]),
|
|
603
|
+
a(b) ? (s(), i("div", _t, [
|
|
604
|
+
y(g.$slots, "content", {}, void 0, !0)
|
|
605
|
+
])) : v("", !0),
|
|
606
|
+
e.confirmLabel || e.cancelLabel || a(h) ? (s(), i("div", {
|
|
607
|
+
key: 1,
|
|
608
|
+
class: f(["px-6 pb-6 flex flex-row-reverse w-full sm:w-auto", { "pt-6": !t.title && !a(b) }])
|
|
609
|
+
}, [
|
|
610
|
+
m("div", gt, [
|
|
611
|
+
y(g.$slots, "additional-buttons", {}, void 0, !0),
|
|
612
|
+
e.cancelLabel ? (s(), I(X, {
|
|
613
|
+
key: 0,
|
|
614
|
+
class: "base-button-anti-primary w-full sm:w-auto",
|
|
615
|
+
onClick: u[2] || (u[2] = (C) => g.$emit("cancel"))
|
|
616
|
+
}, {
|
|
617
|
+
default: B(() => [
|
|
618
|
+
H(j(e.cancelLabel), 1)
|
|
619
|
+
]),
|
|
620
|
+
_: 1
|
|
621
|
+
})) : v("", !0),
|
|
622
|
+
e.confirmLabel ? (s(), I(X, {
|
|
623
|
+
key: 1,
|
|
624
|
+
loading: e.confirmLoading,
|
|
625
|
+
href: e.confirmHref,
|
|
626
|
+
target: e.confirmHref ? "_blank" : null,
|
|
627
|
+
class: f(["w-full sm:w-auto", e.confirmColor ? `base-button-${e.confirmColor}` : "base-button-primary"]),
|
|
628
|
+
onClick: u[3] || (u[3] = (C) => g.$emit("confirm", C))
|
|
629
|
+
}, {
|
|
630
|
+
default: B(() => [
|
|
631
|
+
H(j(e.confirmLabel), 1)
|
|
632
|
+
]),
|
|
633
|
+
_: 1
|
|
634
|
+
}, 8, ["loading", "href", "target", "class"])) : v("", !0)
|
|
635
|
+
])
|
|
636
|
+
], 2)) : v("", !0)
|
|
637
|
+
], 4)
|
|
638
|
+
]));
|
|
639
|
+
}
|
|
640
|
+
});
|
|
641
|
+
const Bt = /* @__PURE__ */ L(yt, [["__scopeId", "data-v-1824bd13"]]), ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
642
|
+
__proto__: null,
|
|
643
|
+
default: Bt
|
|
644
|
+
}, Symbol.toStringTag, { value: "Module" })), wt = (e) => (Te("data-v-d29a3e6a"), e = e(), je(), e), St = ["data-testid"], kt = { class: "base-modal-header" }, Ct = /* @__PURE__ */ wt(() => /* @__PURE__ */ m("div", { class: "i-ls-x icon" }, null, -1)), Mt = [
|
|
645
|
+
Ct
|
|
646
|
+
], xt = {
|
|
647
|
+
key: 2,
|
|
648
|
+
class: "subtitle"
|
|
649
|
+
}, It = {
|
|
650
|
+
key: 0,
|
|
651
|
+
class: "base-modal-content"
|
|
652
|
+
}, Ot = /* @__PURE__ */ G({
|
|
653
|
+
__name: "BaseModalContentOld",
|
|
654
|
+
props: {
|
|
655
|
+
locked: {
|
|
656
|
+
type: Boolean,
|
|
657
|
+
default: !1
|
|
658
|
+
},
|
|
659
|
+
width: {
|
|
660
|
+
type: Number,
|
|
661
|
+
default: null
|
|
662
|
+
},
|
|
663
|
+
// @deprecated
|
|
664
|
+
fullScreen: {
|
|
665
|
+
type: Boolean,
|
|
666
|
+
default: !1
|
|
667
|
+
},
|
|
668
|
+
// @deprecated
|
|
669
|
+
noPadding: {
|
|
670
|
+
type: Boolean,
|
|
671
|
+
default: !1
|
|
672
|
+
},
|
|
673
|
+
dataTestid: {
|
|
674
|
+
type: String,
|
|
675
|
+
default: null
|
|
676
|
+
}
|
|
677
|
+
},
|
|
678
|
+
emits: [
|
|
679
|
+
"close"
|
|
680
|
+
],
|
|
681
|
+
setup(e, { emit: l }) {
|
|
682
|
+
const t = e, {
|
|
683
|
+
locked: n,
|
|
684
|
+
fullScreen: d,
|
|
685
|
+
width: o,
|
|
686
|
+
noPadding: c
|
|
687
|
+
} = Q(t), r = V(ee);
|
|
688
|
+
if (!r)
|
|
689
|
+
throw new Error("BaseModalContentOld must be used inside BaseModal");
|
|
690
|
+
P(() => t.locked, (O) => {
|
|
691
|
+
r.locked = O;
|
|
692
|
+
}, { immediate: !0 }), P(() => t.fullScreen, (O) => {
|
|
693
|
+
r.fullScreen = O;
|
|
694
|
+
}, { immediate: !0 });
|
|
695
|
+
const b = V(te);
|
|
696
|
+
function h(O = !0) {
|
|
697
|
+
n.value || (l("close"), O && b());
|
|
698
|
+
}
|
|
699
|
+
V(le)(() => {
|
|
700
|
+
h(!1);
|
|
701
|
+
});
|
|
702
|
+
const g = E(), u = w(() => g.title()), C = w(() => g.subtitle()), T = w(() => g.content());
|
|
703
|
+
return (O, $) => {
|
|
704
|
+
const A = S("RenderSlot");
|
|
705
|
+
return s(), i("div", {
|
|
706
|
+
class: f([{
|
|
707
|
+
"has-header": a(u) || a(C),
|
|
708
|
+
"has-title": a(u),
|
|
709
|
+
"has-subtitle": a(C),
|
|
710
|
+
"has-content": a(T)
|
|
711
|
+
}, "base-modal-layout"]),
|
|
712
|
+
onClick: $[2] || ($[2] = F(() => {
|
|
713
|
+
}, ["stop"]))
|
|
714
|
+
}, [
|
|
715
|
+
m("section", {
|
|
716
|
+
style: fe({ "max-width": `${a(o)}px` }),
|
|
717
|
+
class: f([[a(c) ? "p-0" : "p-5"], "transition-transform"]),
|
|
718
|
+
"data-testid": e.dataTestid
|
|
719
|
+
}, [
|
|
720
|
+
y(O.$slots, "outside-header", {}, void 0, !0),
|
|
721
|
+
m("div", kt, [
|
|
722
|
+
!a(n) && !a(d) ? (s(), i("div", {
|
|
723
|
+
key: 0,
|
|
724
|
+
class: "close-button",
|
|
725
|
+
"data-testid": "modal-close-icon",
|
|
726
|
+
onClick: $[0] || ($[0] = (p) => h())
|
|
727
|
+
}, Mt)) : v("", !0),
|
|
728
|
+
a(u) ? (s(), i("div", {
|
|
729
|
+
key: 1,
|
|
730
|
+
class: f(["title text-grey-900", {
|
|
731
|
+
"flex flex-row items-center border-b h-16 border-grey-200 px-6 py-4": a(d)
|
|
732
|
+
}])
|
|
733
|
+
}, [
|
|
734
|
+
a(d) ? (s(), i("div", {
|
|
735
|
+
key: 0,
|
|
736
|
+
class: "i-ls-chevron-left arrow-back cursor-pointer w-6 h-6 mr-2 text-grey-600 hover:text-grey-600",
|
|
737
|
+
onClick: $[1] || ($[1] = (p) => h())
|
|
738
|
+
})) : v("", !0),
|
|
739
|
+
M(A, { vnodes: a(u) }, null, 8, ["vnodes"])
|
|
740
|
+
], 2)) : v("", !0),
|
|
741
|
+
a(C) ? (s(), i("div", xt, [
|
|
742
|
+
M(A, { vnodes: a(C) }, null, 8, ["vnodes"])
|
|
743
|
+
])) : v("", !0)
|
|
744
|
+
]),
|
|
745
|
+
a(T) ? (s(), i("div", It, [
|
|
746
|
+
M(A, { vnodes: a(T) }, null, 8, ["vnodes"])
|
|
747
|
+
])) : v("", !0)
|
|
748
|
+
], 14, St)
|
|
749
|
+
], 2);
|
|
750
|
+
};
|
|
751
|
+
}
|
|
752
|
+
});
|
|
753
|
+
const $t = /* @__PURE__ */ L(Ot, [["__scopeId", "data-v-d29a3e6a"]]), ye = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
754
|
+
__proto__: null,
|
|
755
|
+
default: $t
|
|
756
|
+
}, Symbol.toStringTag, { value: "Module" })), Dt = ["onMouseenter"], Vt = ["for"], Tt = ["fill-color"], jt = ["id", "name", "value", "readonly", "onClick"], Lt = {
|
|
757
|
+
__name: "BaseRating",
|
|
758
|
+
props: {
|
|
759
|
+
modelValue: {
|
|
760
|
+
type: Number,
|
|
761
|
+
default: 0
|
|
762
|
+
},
|
|
763
|
+
name: {
|
|
764
|
+
type: String,
|
|
765
|
+
default: null
|
|
766
|
+
},
|
|
767
|
+
length: {
|
|
768
|
+
type: Number,
|
|
769
|
+
validator: (e) => e > 0 && e < 100,
|
|
770
|
+
default: 5
|
|
771
|
+
},
|
|
772
|
+
itemLabels: {
|
|
773
|
+
type: Array,
|
|
774
|
+
default: null
|
|
775
|
+
},
|
|
776
|
+
hover: {
|
|
777
|
+
type: Boolean,
|
|
778
|
+
default: !1
|
|
779
|
+
},
|
|
780
|
+
readonly: {
|
|
781
|
+
type: Boolean,
|
|
782
|
+
default: !1
|
|
783
|
+
},
|
|
784
|
+
itemLabelClass: {
|
|
785
|
+
type: String,
|
|
786
|
+
default: null
|
|
787
|
+
}
|
|
788
|
+
},
|
|
789
|
+
emits: ["update:modelValue"],
|
|
790
|
+
setup(e, { emit: l }) {
|
|
791
|
+
const t = e, { hover: n, modelValue: d, itemLabels: o, name: c, readonly: r } = Q(t), b = Ee(), h = D(d.value), _ = D(0), g = D(!1), u = w(() => c.value ?? `base-rating-${b}`);
|
|
792
|
+
function C(p) {
|
|
793
|
+
return n.value && g.value ? p <= _.value : p <= h.value;
|
|
794
|
+
}
|
|
795
|
+
function T(p) {
|
|
796
|
+
var k;
|
|
797
|
+
return (k = o.value) == null ? void 0 : k[p - 1];
|
|
798
|
+
}
|
|
799
|
+
function O(p) {
|
|
800
|
+
r.value || (h.value = p, g.value = !1, l("update:modelValue", h.value));
|
|
801
|
+
}
|
|
802
|
+
function $(p) {
|
|
803
|
+
_.value = p, g.value = !0;
|
|
804
|
+
}
|
|
805
|
+
function A(p) {
|
|
806
|
+
g.value = !1;
|
|
807
|
+
}
|
|
808
|
+
return (p, k) => (s(), i("div", {
|
|
809
|
+
class: "base-rating flex gap-3",
|
|
810
|
+
onMouseleave: A
|
|
811
|
+
}, [
|
|
812
|
+
(s(!0), i(J, null, Le(e.length, (x) => (s(), i("div", {
|
|
813
|
+
key: `${a(u)}-${x}`,
|
|
814
|
+
class: f(["item", {
|
|
815
|
+
active: C(x),
|
|
816
|
+
"pointer-events-none": a(r)
|
|
817
|
+
}]),
|
|
818
|
+
"data-testid": "base-rating-item",
|
|
819
|
+
onMouseenter: (N) => $(x)
|
|
820
|
+
}, [
|
|
821
|
+
m("label", {
|
|
822
|
+
for: `${a(u)}-${x}`,
|
|
823
|
+
class: "flex flex-col items-center h-full cursor-pointer"
|
|
824
|
+
}, [
|
|
825
|
+
m("div", {
|
|
826
|
+
"data-testid": "base-rating-star-icon",
|
|
827
|
+
class: f(["i-ls-star-fill w-8 h-8", [C(x) ? "text-livestorm-700" : "text-grey-300"]]),
|
|
828
|
+
"fill-color": C(x) ? "currentColor" : null
|
|
829
|
+
}, null, 10, Tt),
|
|
830
|
+
T(x) ? (s(), i("span", {
|
|
831
|
+
key: 0,
|
|
832
|
+
class: f(["flex-1 flex items-center justify-center min-w-[52px] text-11-regular text-center text-grey-700 mt-2", e.itemLabelClass])
|
|
833
|
+
}, j(T(x)), 3)) : v("", !0)
|
|
834
|
+
], 8, Vt),
|
|
835
|
+
m("input", {
|
|
836
|
+
id: `${a(u)}-${x}`,
|
|
837
|
+
class: "hidden",
|
|
838
|
+
name: a(u),
|
|
839
|
+
type: "radio",
|
|
840
|
+
value: x,
|
|
841
|
+
readonly: a(r),
|
|
842
|
+
onClick: (N) => O(x)
|
|
843
|
+
}, null, 8, jt)
|
|
844
|
+
], 42, Dt))), 128))
|
|
845
|
+
], 32));
|
|
846
|
+
}
|
|
847
|
+
}, Be = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
848
|
+
__proto__: null,
|
|
849
|
+
default: Lt
|
|
850
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
851
|
+
const At = {
|
|
852
|
+
provide() {
|
|
853
|
+
return {
|
|
854
|
+
select_onValueChange: this.onValueChange,
|
|
855
|
+
select_childConfig: this.childConfig
|
|
856
|
+
};
|
|
857
|
+
},
|
|
858
|
+
props: {
|
|
859
|
+
buttonClass: {
|
|
860
|
+
type: String,
|
|
861
|
+
default: "base-button-select base-form-style"
|
|
862
|
+
},
|
|
863
|
+
disabled: {
|
|
864
|
+
type: Boolean,
|
|
865
|
+
default: !1
|
|
866
|
+
},
|
|
867
|
+
icon: {
|
|
868
|
+
type: String,
|
|
869
|
+
default: null
|
|
870
|
+
},
|
|
871
|
+
// eslint-disable-next-line vue/require-prop-types
|
|
872
|
+
modelValue: {
|
|
873
|
+
default: null
|
|
874
|
+
},
|
|
875
|
+
label: {
|
|
876
|
+
type: [String, Boolean],
|
|
877
|
+
default: null
|
|
878
|
+
},
|
|
879
|
+
loading: {
|
|
880
|
+
type: Boolean,
|
|
881
|
+
default: !1
|
|
882
|
+
},
|
|
883
|
+
searchEnabled: {
|
|
884
|
+
type: Boolean,
|
|
885
|
+
default: !1
|
|
886
|
+
},
|
|
887
|
+
searchPlaceholder: {
|
|
888
|
+
type: String,
|
|
889
|
+
default: null
|
|
890
|
+
},
|
|
891
|
+
multi: {
|
|
892
|
+
type: Boolean,
|
|
893
|
+
default: !1
|
|
894
|
+
},
|
|
895
|
+
values: {
|
|
896
|
+
type: Array,
|
|
897
|
+
default: null
|
|
898
|
+
},
|
|
899
|
+
// Override
|
|
900
|
+
popperClass: {
|
|
901
|
+
type: String,
|
|
902
|
+
default: null
|
|
903
|
+
},
|
|
904
|
+
placeholder: {
|
|
905
|
+
type: String,
|
|
906
|
+
default: null
|
|
907
|
+
},
|
|
908
|
+
placeholderOne: {
|
|
909
|
+
type: String,
|
|
910
|
+
default: null
|
|
911
|
+
},
|
|
912
|
+
placeholderMany: {
|
|
913
|
+
type: [String, Function],
|
|
914
|
+
default: null
|
|
915
|
+
},
|
|
916
|
+
placeholderAll: {
|
|
917
|
+
type: String,
|
|
918
|
+
default: null
|
|
919
|
+
},
|
|
920
|
+
required: {
|
|
921
|
+
type: Boolean,
|
|
922
|
+
default: !1
|
|
923
|
+
},
|
|
924
|
+
theme: {
|
|
925
|
+
type: String,
|
|
926
|
+
default: "select"
|
|
927
|
+
},
|
|
928
|
+
selectAllButtonDisplayed: {
|
|
929
|
+
type: Boolean,
|
|
930
|
+
default: !1
|
|
931
|
+
},
|
|
932
|
+
scrollable: {
|
|
933
|
+
type: Boolean,
|
|
934
|
+
default: !0
|
|
935
|
+
}
|
|
936
|
+
},
|
|
937
|
+
emits: ["input", "change", "update:modelValue"],
|
|
938
|
+
setup(e) {
|
|
939
|
+
const { modelValue: l } = Q(e);
|
|
940
|
+
U("BaseSelect.modelValue", l);
|
|
941
|
+
const t = D([]);
|
|
942
|
+
U("BaseSelect.childOptions", t);
|
|
943
|
+
const n = w(() => t.value.find((c) => c.value === e.modelValue)), d = D(""), o = K();
|
|
944
|
+
return {
|
|
945
|
+
currentChild: n,
|
|
946
|
+
childOptions: t,
|
|
947
|
+
search: d,
|
|
948
|
+
mobileMode: o
|
|
949
|
+
};
|
|
950
|
+
},
|
|
951
|
+
data() {
|
|
952
|
+
return {
|
|
953
|
+
childConfig: {
|
|
954
|
+
width: 0,
|
|
955
|
+
multi: this.multi,
|
|
956
|
+
count: 0
|
|
957
|
+
}
|
|
958
|
+
};
|
|
959
|
+
},
|
|
960
|
+
computed: {
|
|
961
|
+
allChildOptionsInModelValue() {
|
|
962
|
+
return this.childOptions.filter((e) => !this.modelValue.includes(e.value)).length === 0;
|
|
963
|
+
},
|
|
964
|
+
selectAllIcon() {
|
|
965
|
+
return this.allChildOptionsInModelValue ? "i-ls-check" : "i-ls-minus";
|
|
966
|
+
},
|
|
967
|
+
selectAll() {
|
|
968
|
+
var e;
|
|
969
|
+
return (e = this.modelValue) != null && e.length ? this.childOptions.filter((l) => l.disabled).length === this.modelValue.length && this.allChildOptionsInModelValue ? !0 : !!this.childOptions.filter((l) => !l.disabled).find((l) => this.modelValue.includes(l.value)) : !1;
|
|
970
|
+
},
|
|
971
|
+
displayedLabel() {
|
|
972
|
+
let e, l = !1;
|
|
973
|
+
return this.label ? e = this.label : !this.multi && this.currentChild ? (e = this.currentChild.label || this.modelValue, l = !0) : this.placeholderOne && this.selectedCount === 1 ? (e = this.placeholderOne, l = !0) : this.multi && this.placeholderAll && this.selectedCount === this.totalCount ? (e = this.placeholderAll, l = !0) : this.placeholderMany && this.selectedCount > 0 ? (typeof this.placeholderMany == "function" ? e = this.placeholderMany(this.selectedCount) : e = `${this.selectedCount} ${this.placeholderMany}`, l = !0) : this.placeholder ? e = this.placeholder : e = this.modelValue, {
|
|
974
|
+
label: e,
|
|
975
|
+
hasValue: l
|
|
976
|
+
};
|
|
977
|
+
},
|
|
978
|
+
selectedCount() {
|
|
979
|
+
if (this.multi && Array.isArray(this.modelValue))
|
|
980
|
+
return this.modelValue.length;
|
|
981
|
+
},
|
|
982
|
+
totalCount() {
|
|
983
|
+
return this.childConfig.count;
|
|
984
|
+
},
|
|
985
|
+
finalLabel() {
|
|
986
|
+
return this.loading ? "" : this.displayedLabel.label;
|
|
987
|
+
}
|
|
988
|
+
},
|
|
989
|
+
watch: {
|
|
990
|
+
search(e, l) {
|
|
991
|
+
this.scrollToSelectedItem();
|
|
992
|
+
},
|
|
993
|
+
multi(e) {
|
|
994
|
+
this.childConfig.multi = e;
|
|
995
|
+
}
|
|
996
|
+
},
|
|
997
|
+
methods: {
|
|
998
|
+
onToggleSelectAll() {
|
|
999
|
+
if (this.selectAll)
|
|
1000
|
+
this.$emit("update:modelValue", this.childOptions.filter((e) => e.disabled).map((e) => e.value));
|
|
1001
|
+
else {
|
|
1002
|
+
const e = this.childOptions.filter((l) => l.disabled && this.modelValue.includes(l.value)).map((l) => l.value);
|
|
1003
|
+
this.$emit("update:modelValue", [
|
|
1004
|
+
...e,
|
|
1005
|
+
...this.childOptions.filter((l) => !l.disabled && !l.hidden).map((l) => l.value)
|
|
1006
|
+
]);
|
|
1007
|
+
}
|
|
1008
|
+
},
|
|
1009
|
+
onValueChange(e) {
|
|
1010
|
+
let l, t = !1;
|
|
1011
|
+
if (this.multi) {
|
|
1012
|
+
l = this.modelValue && this.modelValue.slice() || [];
|
|
1013
|
+
const n = l.indexOf(e);
|
|
1014
|
+
n === -1 ? this.values ? l.splice(this.getValueIndex(l, e), 0, e) : (l.push(e), t = !0) : l.splice(n, 1);
|
|
1015
|
+
} else
|
|
1016
|
+
l = e;
|
|
1017
|
+
this.$emit("update:modelValue", l), this.$emit("change", e, t), this.mobileMode || this.focusSearch();
|
|
1018
|
+
},
|
|
1019
|
+
getValueIndex(e, l) {
|
|
1020
|
+
let n = this.values.indexOf(l), d;
|
|
1021
|
+
for (; n >= 0 && (d = e.indexOf(this.values[n])) === -1; )
|
|
1022
|
+
n--;
|
|
1023
|
+
return d + 1;
|
|
1024
|
+
},
|
|
1025
|
+
onApplyShow() {
|
|
1026
|
+
this.multi || this.scrollToSelectedItem(), this.mobileMode || this.focusSearch();
|
|
1027
|
+
},
|
|
1028
|
+
focusSearch() {
|
|
1029
|
+
var e;
|
|
1030
|
+
(e = this.$refs.dropdown.$refs.searchInput) == null || e.focusSearch();
|
|
1031
|
+
},
|
|
1032
|
+
onShow() {
|
|
1033
|
+
this.$responsive.tablet && !this.$_wasShown && (this.$_documentElementOverflow = document.documentElement.style.overflow, this.$_bodyOverflow = document.body.style.overflow, document.documentElement.style.overflow = "hidden", document.body.style.overflow = "hidden", this.$_wasShown = !0);
|
|
1034
|
+
},
|
|
1035
|
+
onHide() {
|
|
1036
|
+
document.documentElement.style.overflow = this.$_documentElementOverflow, document.body.style.overflow = this.$_bodyOverflow, this.$_wasShown = !1;
|
|
1037
|
+
},
|
|
1038
|
+
async scrollToSelectedItem() {
|
|
1039
|
+
await this.$nextTick();
|
|
1040
|
+
const e = this.$refs.dropdown.$refs.list, l = e.querySelector(".selected");
|
|
1041
|
+
l && (e.scrollTop = l.offsetTop + (l.clientHeight - e.clientHeight) / 2);
|
|
1042
|
+
},
|
|
1043
|
+
selectFirstResult() {
|
|
1044
|
+
if (this.search) {
|
|
1045
|
+
const [e] = this.childOptions.filter((l) => l.matchSearch);
|
|
1046
|
+
e && (this.onValueChange(e.value), this.multi || this.$refs.dropdown.hide());
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
}, zt = {
|
|
1051
|
+
ref: "toggle",
|
|
1052
|
+
class: "select-toggle"
|
|
1053
|
+
};
|
|
1054
|
+
function Pt(e, l, t, n, d, o) {
|
|
1055
|
+
const c = S("BaseButton"), r = S("BaseCheckbox"), b = S("BaseDropdownMenuItem"), h = S("BaseDropdownMenu");
|
|
1056
|
+
return s(), I(h, {
|
|
1057
|
+
ref: "dropdown",
|
|
1058
|
+
theme: t.theme,
|
|
1059
|
+
"popper-class": t.popperClass + " select-popper ios-fix-height",
|
|
1060
|
+
disabled: t.disabled,
|
|
1061
|
+
class: f([{
|
|
1062
|
+
"has-value": o.displayedLabel.hasValue
|
|
1063
|
+
}, "base-select"]),
|
|
1064
|
+
"search-enabled": t.searchEnabled,
|
|
1065
|
+
"search-throttle": 200,
|
|
1066
|
+
"search-placeholder": t.searchPlaceholder || e.i18n.t("general_form_multiselect-search"),
|
|
1067
|
+
scrollable: t.scrollable,
|
|
1068
|
+
onShow: o.onShow,
|
|
1069
|
+
onHide: o.onHide,
|
|
1070
|
+
onApplyShow: o.onApplyShow,
|
|
1071
|
+
"onUpdate:search": l[1] || (l[1] = (_) => n.search = _),
|
|
1072
|
+
"onSearch:enter": l[2] || (l[2] = (_) => o.selectFirstResult(e.hide))
|
|
1073
|
+
}, {
|
|
1074
|
+
default: B(({ shown: _ }) => [
|
|
1075
|
+
m("div", zt, [
|
|
1076
|
+
y(e.$slots, "toggle", {
|
|
1077
|
+
loading: t.loading,
|
|
1078
|
+
value: t.modelValue,
|
|
1079
|
+
label: o.finalLabel,
|
|
1080
|
+
disabled: t.disabled,
|
|
1081
|
+
isShown: _
|
|
1082
|
+
}, () => [
|
|
1083
|
+
M(c, {
|
|
1084
|
+
class: f(["w-full justify-start", [
|
|
1085
|
+
t.buttonClass,
|
|
1086
|
+
{ active: _ }
|
|
1087
|
+
]]),
|
|
1088
|
+
disabled: t.disabled,
|
|
1089
|
+
icon: t.icon,
|
|
1090
|
+
"icon-right": "i-ls-chevron-down",
|
|
1091
|
+
loading: t.loading,
|
|
1092
|
+
type: "button"
|
|
1093
|
+
}, {
|
|
1094
|
+
default: B(() => [
|
|
1095
|
+
y(e.$slots, "toggle-button", {
|
|
1096
|
+
loading: t.loading,
|
|
1097
|
+
value: t.modelValue,
|
|
1098
|
+
label: o.finalLabel
|
|
1099
|
+
}, () => [
|
|
1100
|
+
H(j(o.finalLabel), 1)
|
|
1101
|
+
], !0)
|
|
1102
|
+
]),
|
|
1103
|
+
_: 2
|
|
1104
|
+
}, 1032, ["class", "disabled", "icon", "loading"])
|
|
1105
|
+
], !0)
|
|
1106
|
+
], 512)
|
|
1107
|
+
]),
|
|
1108
|
+
header: B(() => [
|
|
1109
|
+
y(e.$slots, "header", {}, void 0, !0)
|
|
1110
|
+
]),
|
|
1111
|
+
"header-with-search-additional-block": B(() => [
|
|
1112
|
+
y(e.$slots, "header-with-search-additional-block", {}, void 0, !0)
|
|
1113
|
+
]),
|
|
1114
|
+
footer: B(() => [
|
|
1115
|
+
y(e.$slots, "footer", {}, void 0, !0)
|
|
1116
|
+
]),
|
|
1117
|
+
popper: B(() => [
|
|
1118
|
+
!n.search && t.multi && n.childOptions.length && t.selectAllButtonDisplayed ? (s(), I(b, {
|
|
1119
|
+
key: 0,
|
|
1120
|
+
label: e.i18n.t(o.selectAll ? "general_form_multiselect-unselect-all" : "general_form_multiselect-select-all"),
|
|
1121
|
+
"keep-open": "",
|
|
1122
|
+
"data-testid": "select-all",
|
|
1123
|
+
"can-click-on-active": "",
|
|
1124
|
+
onClick: l[0] || (l[0] = F((_) => o.onToggleSelectAll(), ["prevent"]))
|
|
1125
|
+
}, {
|
|
1126
|
+
checkbox: B(() => [
|
|
1127
|
+
M(r, {
|
|
1128
|
+
icon: o.selectAllIcon,
|
|
1129
|
+
value: o.selectAll,
|
|
1130
|
+
"for-id": "select-all"
|
|
1131
|
+
}, null, 8, ["icon", "value"])
|
|
1132
|
+
]),
|
|
1133
|
+
_: 1
|
|
1134
|
+
}, 8, ["label"])) : v("", !0),
|
|
1135
|
+
y(e.$slots, "default", {}, void 0, !0)
|
|
1136
|
+
]),
|
|
1137
|
+
_: 3
|
|
1138
|
+
}, 8, ["theme", "popper-class", "disabled", "class", "search-enabled", "search-placeholder", "scrollable", "onShow", "onHide", "onApplyShow"]);
|
|
1139
|
+
}
|
|
1140
|
+
const Et = /* @__PURE__ */ L(At, [["render", Pt], ["__scopeId", "data-v-e636353b"]]), we = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1141
|
+
__proto__: null,
|
|
1142
|
+
default: Et
|
|
1143
|
+
}, Symbol.toStringTag, { value: "Module" })), Rt = {
|
|
1144
|
+
provide() {
|
|
1145
|
+
return {
|
|
1146
|
+
selectGroup_childConfig: this.childConfig
|
|
1147
|
+
};
|
|
1148
|
+
},
|
|
1149
|
+
props: {
|
|
1150
|
+
title: {
|
|
1151
|
+
type: String,
|
|
1152
|
+
default: null
|
|
1153
|
+
}
|
|
1154
|
+
},
|
|
1155
|
+
data() {
|
|
1156
|
+
return {
|
|
1157
|
+
childConfig: {
|
|
1158
|
+
visible: 0
|
|
1159
|
+
}
|
|
1160
|
+
};
|
|
1161
|
+
}
|
|
1162
|
+
}, Ht = { class: "base-select-group" };
|
|
1163
|
+
function Gt(e, l, t, n, d, o) {
|
|
1164
|
+
const c = S("BaseDropdownMenuTitle");
|
|
1165
|
+
return s(), i("div", Ht, [
|
|
1166
|
+
t.title && d.childConfig.visible ? (s(), I(c, {
|
|
1167
|
+
key: 0,
|
|
1168
|
+
title: t.title
|
|
1169
|
+
}, null, 8, ["title"])) : v("", !0),
|
|
1170
|
+
y(e.$slots, "default")
|
|
1171
|
+
]);
|
|
1172
|
+
}
|
|
1173
|
+
const Nt = /* @__PURE__ */ L(Rt, [["render", Gt]]), Se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1174
|
+
__proto__: null,
|
|
1175
|
+
default: Nt
|
|
1176
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1177
|
+
let Ut = 0;
|
|
1178
|
+
const Ft = {
|
|
1179
|
+
name: "BaseSelectOption",
|
|
1180
|
+
inject: {
|
|
1181
|
+
select_onValueChange: {},
|
|
1182
|
+
select_childConfig: {},
|
|
1183
|
+
selectGroup_childConfig: { default: null }
|
|
1184
|
+
},
|
|
1185
|
+
props: {
|
|
1186
|
+
// eslint-disable-next-line vue/require-prop-types
|
|
1187
|
+
value: {
|
|
1188
|
+
default: null
|
|
1189
|
+
},
|
|
1190
|
+
label: {
|
|
1191
|
+
type: [String, Function],
|
|
1192
|
+
default: ""
|
|
1193
|
+
},
|
|
1194
|
+
hidden: {
|
|
1195
|
+
type: Boolean,
|
|
1196
|
+
default: !1
|
|
1197
|
+
},
|
|
1198
|
+
prevent: {
|
|
1199
|
+
type: Boolean,
|
|
1200
|
+
default: !1
|
|
1201
|
+
},
|
|
1202
|
+
selected: {
|
|
1203
|
+
type: Boolean,
|
|
1204
|
+
default: !1
|
|
1205
|
+
},
|
|
1206
|
+
description: {
|
|
1207
|
+
type: String,
|
|
1208
|
+
default: null
|
|
1209
|
+
},
|
|
1210
|
+
tooltip: {
|
|
1211
|
+
type: [String, Object],
|
|
1212
|
+
default: null
|
|
1213
|
+
},
|
|
1214
|
+
labelClass: {
|
|
1215
|
+
type: String,
|
|
1216
|
+
default: null
|
|
1217
|
+
},
|
|
1218
|
+
descriptionClass: {
|
|
1219
|
+
type: String,
|
|
1220
|
+
default: null
|
|
1221
|
+
},
|
|
1222
|
+
icon: {
|
|
1223
|
+
type: String,
|
|
1224
|
+
default: null
|
|
1225
|
+
},
|
|
1226
|
+
disabled: {
|
|
1227
|
+
type: Boolean,
|
|
1228
|
+
default: !1
|
|
1229
|
+
}
|
|
1230
|
+
},
|
|
1231
|
+
emits: ["click"],
|
|
1232
|
+
setup(e) {
|
|
1233
|
+
const l = V("BaseSelect.modelValue"), t = D(""), n = V("BaseSelect.childOptions"), d = V("BaseDropdown.search"), o = w(() => {
|
|
1234
|
+
if (!d.value)
|
|
1235
|
+
return !0;
|
|
1236
|
+
if (!t.value)
|
|
1237
|
+
return !1;
|
|
1238
|
+
const r = (_) => _.normalize("NFD").replace(/[\u0300-\u036f]/g, ""), b = r(d.value).replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&");
|
|
1239
|
+
return new RegExp(b, "i").test(r(t.value));
|
|
1240
|
+
}), c = Ut++;
|
|
1241
|
+
return n.value.push(Ae({
|
|
1242
|
+
id: c,
|
|
1243
|
+
value: w(() => e.value),
|
|
1244
|
+
label: t,
|
|
1245
|
+
matchSearch: o,
|
|
1246
|
+
disabled: w(() => e.disabled),
|
|
1247
|
+
hidden: w(() => e.hidden)
|
|
1248
|
+
})), re(() => {
|
|
1249
|
+
const r = n.value.findIndex((b) => b.id === c);
|
|
1250
|
+
r !== -1 && n.value.splice(r, 1);
|
|
1251
|
+
}), {
|
|
1252
|
+
finalValue: l,
|
|
1253
|
+
labelContent: t,
|
|
1254
|
+
matchSearch: o
|
|
1255
|
+
};
|
|
1256
|
+
},
|
|
1257
|
+
computed: {
|
|
1258
|
+
finalSelected() {
|
|
1259
|
+
if (this.selected)
|
|
1260
|
+
return this.selected;
|
|
1261
|
+
const e = this.finalValue;
|
|
1262
|
+
return this.multi ? e && e.indexOf(this.value) !== -1 : this.value === e;
|
|
1263
|
+
},
|
|
1264
|
+
cssClass() {
|
|
1265
|
+
return {
|
|
1266
|
+
selected: this.finalSelected,
|
|
1267
|
+
hidden: this.finalHidden
|
|
1268
|
+
};
|
|
1269
|
+
},
|
|
1270
|
+
finalHidden() {
|
|
1271
|
+
return this.hidden || !this.matchSearch;
|
|
1272
|
+
},
|
|
1273
|
+
multi() {
|
|
1274
|
+
return this.select_childConfig.multi;
|
|
1275
|
+
}
|
|
1276
|
+
},
|
|
1277
|
+
watch: {
|
|
1278
|
+
hidden(e) {
|
|
1279
|
+
this.select_childConfig.count += e ? -1 : 1;
|
|
1280
|
+
},
|
|
1281
|
+
finalHidden(e) {
|
|
1282
|
+
this.selectGroup_childConfig && (this.selectGroup_childConfig.visible += e ? -1 : 1);
|
|
1283
|
+
},
|
|
1284
|
+
label: {
|
|
1285
|
+
handler: "updateLabelContent",
|
|
1286
|
+
immediate: !0
|
|
1287
|
+
}
|
|
1288
|
+
},
|
|
1289
|
+
mounted() {
|
|
1290
|
+
this.select_childConfig.count++, this.selectGroup_childConfig && !this.finalHidden && this.selectGroup_childConfig.visible++;
|
|
1291
|
+
},
|
|
1292
|
+
beforeUnmount() {
|
|
1293
|
+
this.select_childConfig.count--, this.selectGroup_childConfig && !this.finalHidden && this.selectGroup_childConfig.visible--;
|
|
1294
|
+
},
|
|
1295
|
+
methods: {
|
|
1296
|
+
async updateLabelContent() {
|
|
1297
|
+
typeof this.label == "function" ? this.labelContent = await this.label() : this.labelContent = this.label;
|
|
1298
|
+
},
|
|
1299
|
+
onClick(e) {
|
|
1300
|
+
this.prevent || this.select_onValueChange(this.value), this.$emit("click", e);
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
};
|
|
1304
|
+
function qt(e, l, t, n, d, o) {
|
|
1305
|
+
const c = S("BaseCheckbox"), r = S("BaseDropdownMenuItem");
|
|
1306
|
+
return s(), I(r, {
|
|
1307
|
+
"keep-open": e.$attrs["keep-open"] != null ? e.$attrs["keep-open"] === "" || e.$attrs["keep-open"] : o.multi,
|
|
1308
|
+
class: f([o.cssClass, "base-select-option overflow-hidden"]),
|
|
1309
|
+
tooltip: t.tooltip,
|
|
1310
|
+
active: o.finalSelected,
|
|
1311
|
+
label: n.labelContent,
|
|
1312
|
+
"secondary-label": t.description,
|
|
1313
|
+
disabled: t.disabled,
|
|
1314
|
+
"label-class": t.labelClass,
|
|
1315
|
+
icon: t.icon,
|
|
1316
|
+
"can-click-on-active": !0,
|
|
1317
|
+
onClick: o.onClick
|
|
1318
|
+
}, {
|
|
1319
|
+
checkbox: B(() => [
|
|
1320
|
+
o.multi && !e.$attrs.loading ? (s(), I(c, {
|
|
1321
|
+
key: 0,
|
|
1322
|
+
modelValue: n.finalValue,
|
|
1323
|
+
"onUpdate:modelValue": l[0] || (l[0] = (b) => n.finalValue = b),
|
|
1324
|
+
"for-id": t.value,
|
|
1325
|
+
value: t.value,
|
|
1326
|
+
disabled: t.disabled,
|
|
1327
|
+
"disable-change": ""
|
|
1328
|
+
}, null, 8, ["modelValue", "for-id", "value", "disabled"])) : v("", !0)
|
|
1329
|
+
]),
|
|
1330
|
+
"label-override": B(() => [
|
|
1331
|
+
y(e.$slots, "default", {}, void 0, !0)
|
|
1332
|
+
]),
|
|
1333
|
+
"additional-left-part": B(() => [
|
|
1334
|
+
y(e.$slots, "additional-left-part", {}, void 0, !0)
|
|
1335
|
+
]),
|
|
1336
|
+
"additional-right-part": B(() => [
|
|
1337
|
+
y(e.$slots, "additional-right-part", {}, void 0, !0)
|
|
1338
|
+
]),
|
|
1339
|
+
_: 3
|
|
1340
|
+
}, 8, ["keep-open", "class", "tooltip", "active", "label", "secondary-label", "disabled", "label-class", "icon", "onClick"]);
|
|
1341
|
+
}
|
|
1342
|
+
const Kt = /* @__PURE__ */ L(Ft, [["render", qt], ["__scopeId", "data-v-0b16dd62"]]), ke = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1343
|
+
__proto__: null,
|
|
1344
|
+
default: Kt
|
|
1345
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1346
|
+
const Wt = {
|
|
1347
|
+
props: {
|
|
1348
|
+
modelValue: {
|
|
1349
|
+
type: Boolean,
|
|
1350
|
+
required: !0
|
|
1351
|
+
},
|
|
1352
|
+
disabled: {
|
|
1353
|
+
type: Boolean,
|
|
1354
|
+
default: !1
|
|
1355
|
+
},
|
|
1356
|
+
colorClass: {
|
|
1357
|
+
type: String,
|
|
1358
|
+
default: "base-switch-green"
|
|
1359
|
+
}
|
|
1360
|
+
},
|
|
1361
|
+
emits: [
|
|
1362
|
+
"update:modelValue"
|
|
1363
|
+
],
|
|
1364
|
+
setup() {
|
|
1365
|
+
const e = E();
|
|
1366
|
+
return {
|
|
1367
|
+
defaultSlot: w(() => e.default())
|
|
1368
|
+
};
|
|
1369
|
+
},
|
|
1370
|
+
computed: {
|
|
1371
|
+
valueModel: {
|
|
1372
|
+
get() {
|
|
1373
|
+
return this.modelValue;
|
|
1374
|
+
},
|
|
1375
|
+
set(e) {
|
|
1376
|
+
return this.$emit("update:modelValue", e);
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
}, Jt = { class: "flex items-center relative" }, Qt = ["disabled"], Xt = {
|
|
1381
|
+
key: 0,
|
|
1382
|
+
class: "ml-3"
|
|
1383
|
+
};
|
|
1384
|
+
function Yt(e, l, t, n, d, o) {
|
|
1385
|
+
const c = S("RenderSlot");
|
|
1386
|
+
return s(), i("div", {
|
|
1387
|
+
class: f(["base-switch select-none", {
|
|
1388
|
+
checked: o.valueModel,
|
|
1389
|
+
"opacity-50": t.disabled
|
|
1390
|
+
}])
|
|
1391
|
+
}, [
|
|
1392
|
+
m("div", Jt, [
|
|
1393
|
+
m("label", {
|
|
1394
|
+
class: f(["switch-box flex-none block rounded-full h-5 border", o.valueModel ? t.colorClass : "bg-grey-300 border-grey-200"])
|
|
1395
|
+
}, [
|
|
1396
|
+
R(m("input", {
|
|
1397
|
+
"onUpdate:modelValue": l[0] || (l[0] = (r) => o.valueModel = r),
|
|
1398
|
+
type: "checkbox",
|
|
1399
|
+
disabled: t.disabled,
|
|
1400
|
+
class: f(["opacity-0 absolute inset-0 w-full h-full z-10", [
|
|
1401
|
+
t.disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
1402
|
+
]])
|
|
1403
|
+
}, null, 10, Qt), [
|
|
1404
|
+
[ze, o.valueModel]
|
|
1405
|
+
]),
|
|
1406
|
+
m("div", {
|
|
1407
|
+
class: f(["dot w-4 h-4 bg-white rounded-full absolute border", !o.valueModel && "border-grey-200"])
|
|
1408
|
+
}, null, 2)
|
|
1409
|
+
], 2),
|
|
1410
|
+
n.defaultSlot ? (s(), i("span", Xt, [
|
|
1411
|
+
M(c, { vnodes: n.defaultSlot }, null, 8, ["vnodes"])
|
|
1412
|
+
])) : v("", !0)
|
|
1413
|
+
])
|
|
1414
|
+
], 2);
|
|
1415
|
+
}
|
|
1416
|
+
const Zt = /* @__PURE__ */ L(Wt, [["render", Yt], ["__scopeId", "data-v-5805577b"]]), Ce = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1417
|
+
__proto__: null,
|
|
1418
|
+
default: Zt
|
|
1419
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1420
|
+
const el = {
|
|
1421
|
+
props: {
|
|
1422
|
+
size: {
|
|
1423
|
+
type: String,
|
|
1424
|
+
default: "small",
|
|
1425
|
+
validator(e) {
|
|
1426
|
+
return ["xsmall", "small", "medium"].includes(e);
|
|
1427
|
+
}
|
|
1428
|
+
},
|
|
1429
|
+
theme: {
|
|
1430
|
+
type: String,
|
|
1431
|
+
default: "light-blue",
|
|
1432
|
+
validator(e) {
|
|
1433
|
+
return [
|
|
1434
|
+
"light-blue",
|
|
1435
|
+
"light-green",
|
|
1436
|
+
"light-orange",
|
|
1437
|
+
"light-red",
|
|
1438
|
+
"light-grey",
|
|
1439
|
+
"dark-blue",
|
|
1440
|
+
"dark-green",
|
|
1441
|
+
"dark-orange",
|
|
1442
|
+
"dark-red",
|
|
1443
|
+
"dark-grey"
|
|
1444
|
+
].includes(e);
|
|
1445
|
+
}
|
|
1446
|
+
},
|
|
1447
|
+
leftIcon: {
|
|
1448
|
+
type: String,
|
|
1449
|
+
default: null
|
|
1450
|
+
},
|
|
1451
|
+
tooltip: {
|
|
1452
|
+
type: [String, Object],
|
|
1453
|
+
default: null
|
|
1454
|
+
},
|
|
1455
|
+
uppercase: {
|
|
1456
|
+
type: Boolean,
|
|
1457
|
+
default: !1
|
|
1458
|
+
},
|
|
1459
|
+
deletable: {
|
|
1460
|
+
type: Boolean,
|
|
1461
|
+
default: !1
|
|
1462
|
+
}
|
|
1463
|
+
},
|
|
1464
|
+
emits: ["delete"],
|
|
1465
|
+
setup() {
|
|
1466
|
+
const e = E(), l = w(() => e.default()), t = w(() => e["user-avatar"]());
|
|
1467
|
+
return {
|
|
1468
|
+
defaultSlot: l,
|
|
1469
|
+
userAvatarSlot: t
|
|
1470
|
+
};
|
|
1471
|
+
},
|
|
1472
|
+
computed: {
|
|
1473
|
+
isLeftIconImageUrl() {
|
|
1474
|
+
var e;
|
|
1475
|
+
return (e = this.leftIcon) == null ? void 0 : e.includes(".svg");
|
|
1476
|
+
},
|
|
1477
|
+
iconSizeClasses() {
|
|
1478
|
+
return {
|
|
1479
|
+
"h-3 w-3": this.size === "xsmall" || this.size === "small",
|
|
1480
|
+
"h-4 w-4": this.size === "medium"
|
|
1481
|
+
};
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
}, tl = ["src"];
|
|
1485
|
+
function ll(e, l, t, n, d, o) {
|
|
1486
|
+
const c = S("RenderSlot"), r = ce("tooltip");
|
|
1487
|
+
return R((s(), i("span", {
|
|
1488
|
+
class: f([[
|
|
1489
|
+
{ uppercase: t.uppercase },
|
|
1490
|
+
{ "xsmall text-11-semibold ": t.size === "xsmall" },
|
|
1491
|
+
{ "small text-12-semibold py-1": t.size === "small" },
|
|
1492
|
+
{ "medium text-16-semibold py-1": t.size === "medium" },
|
|
1493
|
+
{ "pointer-events-none": !t.deletable && !t.tooltip },
|
|
1494
|
+
{ "cursor-help": !t.deletable && t.tooltip },
|
|
1495
|
+
t.theme
|
|
1496
|
+
], "base-tag cursor-default no-info px-2 rounded-full inline-flex items-center whitespace-nowrap"]),
|
|
1497
|
+
"data-testid": "base-tag"
|
|
1498
|
+
}, [
|
|
1499
|
+
t.leftIcon ? (s(), i(J, { key: 0 }, [
|
|
1500
|
+
o.isLeftIconImageUrl ? (s(), i("img", {
|
|
1501
|
+
key: 0,
|
|
1502
|
+
class: f(o.iconSizeClasses),
|
|
1503
|
+
src: t.leftIcon
|
|
1504
|
+
}, null, 10, tl)) : (s(), i("div", {
|
|
1505
|
+
key: 1,
|
|
1506
|
+
class: f(["icon-left block", [t.leftIcon, o.iconSizeClasses]])
|
|
1507
|
+
}, null, 2))
|
|
1508
|
+
], 64)) : v("", !0),
|
|
1509
|
+
n.userAvatarSlot ? (s(), i("div", {
|
|
1510
|
+
key: 1,
|
|
1511
|
+
class: f(["base-tag-avatar", [
|
|
1512
|
+
{ "ml-1": t.leftIcon },
|
|
1513
|
+
{ "h-3 w-3 xsmall": t.size === "xsmall" },
|
|
1514
|
+
{ "h-4 w-4 small": t.size === "small" },
|
|
1515
|
+
{ "h-6 w-6 medium": t.size === "medium" }
|
|
1516
|
+
]])
|
|
1517
|
+
}, [
|
|
1518
|
+
M(c, { vnodes: n.userAvatarSlot }, null, 8, ["vnodes"])
|
|
1519
|
+
], 2)) : v("", !0),
|
|
1520
|
+
n.defaultSlot ? (s(), i("span", {
|
|
1521
|
+
key: 2,
|
|
1522
|
+
class: f(["overflow-hidden max-w-sm text-ellipsis", { "ml-1": t.leftIcon || n.userAvatarSlot }])
|
|
1523
|
+
}, [
|
|
1524
|
+
M(c, { vnodes: n.defaultSlot }, null, 8, ["vnodes"])
|
|
1525
|
+
], 2)) : v("", !0),
|
|
1526
|
+
t.deletable ? (s(), i("div", {
|
|
1527
|
+
key: 3,
|
|
1528
|
+
class: f(["i-ls-x icon-delete block ml-1 cursor-pointer", o.iconSizeClasses]),
|
|
1529
|
+
onClick: l[0] || (l[0] = (b) => e.$emit("delete"))
|
|
1530
|
+
}, null, 2)) : v("", !0)
|
|
1531
|
+
], 2)), [
|
|
1532
|
+
[r, t.tooltip]
|
|
1533
|
+
]);
|
|
1534
|
+
}
|
|
1535
|
+
const nl = /* @__PURE__ */ L(el, [["render", ll], ["__scopeId", "data-v-25ee29c2"]]), Me = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1536
|
+
__proto__: null,
|
|
1537
|
+
default: nl
|
|
1538
|
+
}, Symbol.toStringTag, { value: "Module" })), xe = /Base([a-z0-9]+)\./i;
|
|
1539
|
+
function ul(e, l = "Ls") {
|
|
1540
|
+
e.component("RenderSlot", ne);
|
|
1541
|
+
const t = /* @__PURE__ */ Object.assign({ "./src/components/BaseAutocomplete/BaseAutocomplete.vue": oe, "./src/components/BaseBanner/BaseBanner.vue": se, "./src/components/BaseButton/BaseButton.vue": ae, "./src/components/BaseCheckbox/BaseCheckbox.vue": ie, "./src/components/BaseDropdownMenu/BaseDropdownMenu.vue": he, "./src/components/BaseDropdownMenu/BaseDropdownMenuButton.vue": pe, "./src/components/BaseDropdownMenu/BaseDropdownMenuDivider.vue": me, "./src/components/BaseDropdownMenu/BaseDropdownMenuItem.vue": ve, "./src/components/BaseDropdownMenu/BaseDropdownMenuSearch.vue": be, "./src/components/BaseDropdownMenu/BaseDropdownMenuTitle.vue": _e, "./src/components/BaseModal/BaseModal.vue": de, "./src/components/BaseModal/BaseModalContent.vue": ge, "./src/components/BaseModal/BaseModalContentOld.vue": ye, "./src/components/BaseRating/BaseRating.vue": Be, "./src/components/BaseSelect/BaseSelect.vue": we, "./src/components/BaseSelect/BaseSelectGroup.vue": Se, "./src/components/BaseSelect/BaseSelectOption.vue": ke, "./src/components/BaseSwitch/BaseSwitch.vue": Ce, "./src/components/BaseTag/BaseTag.vue": Me });
|
|
1542
|
+
for (const n in t) {
|
|
1543
|
+
const d = t[n], o = n.match(xe)[1];
|
|
1544
|
+
e.component(`${l}${o}`, d.default || d);
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
function fl(e = "Ls") {
|
|
1548
|
+
const l = {};
|
|
1549
|
+
l.RenderSlot = ne;
|
|
1550
|
+
const t = /* @__PURE__ */ Object.assign({ "./src/components/BaseAutocomplete/BaseAutocomplete.vue": oe, "./src/components/BaseBanner/BaseBanner.vue": se, "./src/components/BaseButton/BaseButton.vue": ae, "./src/components/BaseCheckbox/BaseCheckbox.vue": ie, "./src/components/BaseDropdownMenu/BaseDropdownMenu.vue": he, "./src/components/BaseDropdownMenu/BaseDropdownMenuButton.vue": pe, "./src/components/BaseDropdownMenu/BaseDropdownMenuDivider.vue": me, "./src/components/BaseDropdownMenu/BaseDropdownMenuItem.vue": ve, "./src/components/BaseDropdownMenu/BaseDropdownMenuSearch.vue": be, "./src/components/BaseDropdownMenu/BaseDropdownMenuTitle.vue": _e, "./src/components/BaseModal/BaseModal.vue": de, "./src/components/BaseModal/BaseModalContent.vue": ge, "./src/components/BaseModal/BaseModalContentOld.vue": ye, "./src/components/BaseRating/BaseRating.vue": Be, "./src/components/BaseSelect/BaseSelect.vue": we, "./src/components/BaseSelect/BaseSelectGroup.vue": Se, "./src/components/BaseSelect/BaseSelectOption.vue": ke, "./src/components/BaseSwitch/BaseSwitch.vue": Ce, "./src/components/BaseTag/BaseTag.vue": Me });
|
|
1551
|
+
for (const n in t) {
|
|
1552
|
+
const d = t[n], o = n.match(xe)[1];
|
|
1553
|
+
l[`${e}${o}`] = d.default || d;
|
|
1554
|
+
}
|
|
1555
|
+
return l;
|
|
1556
|
+
}
|
|
1557
|
+
export {
|
|
1558
|
+
fl as getComponents,
|
|
1559
|
+
ul as registerComponents
|
|
1560
|
+
};
|