@indielayer/ui 1.11.0 → 1.12.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/docs/pages/component/select/multiple.vue +35 -13
- package/docs/pages/component/tag/usage.vue +26 -0
- package/lib/components/select/Select.vue.d.ts +3 -3
- package/lib/components/select/Select.vue.js +203 -188
- package/lib/components/tag/Tag.vue.d.ts +1 -0
- package/lib/components/tag/Tag.vue.js +42 -35
- package/lib/index.js +1 -1
- package/lib/index.umd.js +4 -4
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/src/components/select/Select.vue +14 -5
- package/src/components/tag/Tag.vue +11 -6
- package/src/version.ts +1 -1
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useEventListener as
|
|
3
|
-
import { useColors as
|
|
4
|
-
import { useCommon as
|
|
5
|
-
import { useInputtable as
|
|
1
|
+
import { defineComponent as Ne, mergeModels as ue, computed as R, ref as h, useModel as ze, watch as D, nextTick as G, unref as r, onUnmounted as De, openBlock as s, createBlock as x, mergeProps as U, toHandlers as de, withCtx as p, createElementVNode as M, createElementBlock as n, normalizeClass as A, Fragment as w, createTextVNode as S, toDisplayString as k, createVNode as P, renderSlot as O, createCommentVNode as I, renderList as j, createSlots as Me, withModifiers as Pe, withDirectives as Fe, vModelSelect as Ee } from "vue";
|
|
2
|
+
import { useEventListener as He, useResizeObserver as qe } from "../../node_modules/.pnpm/@vueuse_core@11.1.0_vue@3.5.10_typescript@5.2.2_/node_modules/@vueuse/core/index.js";
|
|
3
|
+
import { useColors as We } from "../../composables/useColors.js";
|
|
4
|
+
import { useCommon as ce } from "../../composables/useCommon.js";
|
|
5
|
+
import { useInputtable as J } from "../../composables/useInputtable.js";
|
|
6
6
|
import { useInteractive as me } from "../../composables/useInteractive.js";
|
|
7
|
-
import { useTheme as
|
|
8
|
-
import { useVirtualList as
|
|
9
|
-
import { checkIcon as
|
|
10
|
-
import
|
|
7
|
+
import { useTheme as Ue } from "../../composables/useTheme.js";
|
|
8
|
+
import { useVirtualList as je } from "../../composables/useVirtualList.js";
|
|
9
|
+
import { checkIcon as Xe, selectIcon as Ke } from "../../common/icons.js";
|
|
10
|
+
import Ge from "../label/Label.vue.js";
|
|
11
11
|
import fe from "../tag/Tag.vue.js";
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
12
|
+
import Je from "../icon/Icon.vue.js";
|
|
13
|
+
import Qe from "../menu/MenuItem.vue.js";
|
|
14
|
+
import Ye from "../spinner/Spinner.vue.js";
|
|
15
15
|
import ve from "../popover/Popover.vue.js";
|
|
16
16
|
import "../popover/Popover.vue3.js";
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import { useThrottleFn as
|
|
21
|
-
const
|
|
17
|
+
import pe from "../popover/PopoverContainer.vue.js";
|
|
18
|
+
import Ze from "../inputFooter/InputFooter.vue.js";
|
|
19
|
+
import _e from "../input/Input.vue.js";
|
|
20
|
+
import { useThrottleFn as el } from "../../node_modules/.pnpm/@vueuse_shared@11.1.0_vue@3.5.10_typescript@5.2.2_/node_modules/@vueuse/shared/index.js";
|
|
21
|
+
const ll = { class: "relative" }, tl = {
|
|
22
22
|
key: 0,
|
|
23
23
|
class: "text-secondary-400 dark:text-secondary-500"
|
|
24
|
-
},
|
|
24
|
+
}, al = { key: 1 }, il = {
|
|
25
25
|
key: 0,
|
|
26
26
|
class: "text-secondary-400 dark:text-secondary-500"
|
|
27
|
-
},
|
|
27
|
+
}, ol = { key: 1 }, sl = {
|
|
28
28
|
key: 0,
|
|
29
29
|
class: "p-2 text-center text-secondary-400"
|
|
30
|
-
}, rl = ["id", "name", "disabled", "multiple", "readonly"],
|
|
31
|
-
...
|
|
32
|
-
...
|
|
30
|
+
}, rl = ["id", "name", "disabled", "multiple", "readonly"], nl = ["value", "disabled"], ul = {
|
|
31
|
+
...We.props("secondary"),
|
|
32
|
+
...ce.props(),
|
|
33
33
|
...me.props(),
|
|
34
|
-
...
|
|
34
|
+
...J.props(),
|
|
35
35
|
placeholder: String,
|
|
36
36
|
options: Array,
|
|
37
37
|
multiple: Boolean,
|
|
@@ -44,7 +44,6 @@ const el = { class: "relative" }, ll = {
|
|
|
44
44
|
type: String,
|
|
45
45
|
default: "Filter by..."
|
|
46
46
|
},
|
|
47
|
-
filterInputProps: Object,
|
|
48
47
|
virtualList: Boolean,
|
|
49
48
|
virtualListOffsetTop: Number,
|
|
50
49
|
virtualListOffsetBottom: Number,
|
|
@@ -57,27 +56,27 @@ const el = { class: "relative" }, ll = {
|
|
|
57
56
|
default: 5
|
|
58
57
|
},
|
|
59
58
|
placement: String
|
|
60
|
-
},
|
|
59
|
+
}, dl = {
|
|
61
60
|
name: "XSelect",
|
|
62
61
|
validators: {
|
|
63
|
-
...
|
|
62
|
+
...ce.validators()
|
|
64
63
|
}
|
|
65
|
-
},
|
|
66
|
-
...
|
|
67
|
-
props: /* @__PURE__ */ ue(
|
|
64
|
+
}, Tl = /* @__PURE__ */ Ne({
|
|
65
|
+
...dl,
|
|
66
|
+
props: /* @__PURE__ */ ue(ul, {
|
|
68
67
|
filter: { default: "" },
|
|
69
68
|
filterModifiers: {}
|
|
70
69
|
}),
|
|
71
|
-
emits: /* @__PURE__ */ ue([...
|
|
72
|
-
setup(
|
|
73
|
-
const o =
|
|
70
|
+
emits: /* @__PURE__ */ ue([...J.emits(), "close"], ["update:filter"]),
|
|
71
|
+
setup(Q, { expose: ye, emit: be }) {
|
|
72
|
+
const o = Q, B = be, f = R(() => o.multiple || o.multipleCheckbox), X = h(null), K = h(null), F = h(null), g = h(null), u = h(), V = ze(Q, "filter"), E = h(null), $ = R(() => o.disabled || o.loading || o.readonly), i = R({
|
|
74
73
|
get() {
|
|
75
74
|
return f.value ? o.modelValue ? Array.isArray(o.modelValue) ? o.modelValue : [o.modelValue] : [] : o.modelValue;
|
|
76
75
|
},
|
|
77
76
|
set(e) {
|
|
78
|
-
|
|
77
|
+
B("update:modelValue", e);
|
|
79
78
|
}
|
|
80
|
-
}), v =
|
|
79
|
+
}), v = R(() => !o.options || o.options.length === 0 ? [] : o.options.filter((e) => V.value === "" || e.label.toLowerCase().includes(V.value.toLowerCase())).map((e) => {
|
|
81
80
|
let t = !1;
|
|
82
81
|
return f.value && Array.isArray(i.value) ? t = i.value.includes(e.value) : t = e.value === i.value, {
|
|
83
82
|
value: e.value,
|
|
@@ -86,11 +85,11 @@ const el = { class: "relative" }, ll = {
|
|
|
86
85
|
prefix: e.prefix,
|
|
87
86
|
suffix: e.suffix,
|
|
88
87
|
disabled: e.disabled,
|
|
89
|
-
iconRight: !o.multipleCheckbox && t ?
|
|
88
|
+
iconRight: !o.multipleCheckbox && t ? Xe : void 0,
|
|
90
89
|
keepOpenOnClick: e.keepOpenOnClick,
|
|
91
90
|
onClick: () => ee(e.value)
|
|
92
91
|
};
|
|
93
|
-
})),
|
|
92
|
+
})), Y = R(() => v.value.filter((e) => !e.disabled)), { list: Z, scrollTo: he, containerProps: ke, wrapperProps: ge } = je(
|
|
94
93
|
v,
|
|
95
94
|
{
|
|
96
95
|
disabled: !o.virtualList,
|
|
@@ -99,19 +98,19 @@ const el = { class: "relative" }, ll = {
|
|
|
99
98
|
bottomOffset: o.virtualListOffsetBottom || 0,
|
|
100
99
|
overscan: o.virtualListOverscan
|
|
101
100
|
}
|
|
102
|
-
),
|
|
101
|
+
), T = R(() => {
|
|
103
102
|
var e;
|
|
104
|
-
return (e =
|
|
103
|
+
return (e = g.value) == null ? void 0 : e.isOpen;
|
|
105
104
|
});
|
|
106
|
-
|
|
107
|
-
e && (u.value = void 0,
|
|
108
|
-
}),
|
|
109
|
-
e ? (Ce(), (f.value || typeof u.value > "u") &&
|
|
105
|
+
D(V, (e) => {
|
|
106
|
+
e && (u.value = void 0, H(-1));
|
|
107
|
+
}), D(T, (e) => {
|
|
108
|
+
e ? (Ce(), (f.value || typeof u.value > "u") && H(-1), setTimeout(() => {
|
|
110
109
|
requestAnimationFrame(() => {
|
|
111
110
|
var t;
|
|
112
|
-
|
|
111
|
+
_(u.value || 0), o.filterable && ((t = E.value) == null || t.focus());
|
|
113
112
|
});
|
|
114
|
-
}, 50)) : (o.filterable && (
|
|
113
|
+
}, 50)) : (o.filterable && (V.value = ""), B("close"));
|
|
115
114
|
});
|
|
116
115
|
function Ce() {
|
|
117
116
|
if (f.value) {
|
|
@@ -124,15 +123,15 @@ const el = { class: "relative" }, ll = {
|
|
|
124
123
|
e !== -1 && (u.value = e);
|
|
125
124
|
}
|
|
126
125
|
}
|
|
127
|
-
function
|
|
126
|
+
function _(e) {
|
|
128
127
|
var t;
|
|
129
|
-
o.virtualList ? he(e) :
|
|
128
|
+
o.virtualList ? he(e) : F.value && ((t = F.value[e]) == null || t.$el.scrollIntoView({ block: "nearest", inline: "nearest" }));
|
|
130
129
|
}
|
|
131
|
-
|
|
132
|
-
typeof e < "u" &&
|
|
130
|
+
D(u, (e) => {
|
|
131
|
+
typeof e < "u" && F.value && _(e);
|
|
133
132
|
});
|
|
134
|
-
function
|
|
135
|
-
if (!
|
|
133
|
+
function H(e, t = "down") {
|
|
134
|
+
if (!Y.value || Y.value.length === 0) {
|
|
136
135
|
u.value = void 0;
|
|
137
136
|
return;
|
|
138
137
|
}
|
|
@@ -158,18 +157,18 @@ const el = { class: "relative" }, ll = {
|
|
|
158
157
|
if (f.value) {
|
|
159
158
|
if (Array.isArray(i.value)) {
|
|
160
159
|
const a = i.value.indexOf(e);
|
|
161
|
-
a !== -1 ? i.value.splice(a, 1) :
|
|
160
|
+
a !== -1 ? i.value.splice(a, 1) : i.value.push(e);
|
|
162
161
|
} else
|
|
163
162
|
i.value = [e];
|
|
164
|
-
o.filterable && setTimeout(() => {
|
|
163
|
+
B("update:modelValue", i.value), o.filterable && setTimeout(() => {
|
|
165
164
|
var a;
|
|
166
|
-
(a =
|
|
165
|
+
(a = E.value) == null || a.focus();
|
|
167
166
|
});
|
|
168
167
|
} else
|
|
169
168
|
i.value = e;
|
|
170
|
-
o.native ||
|
|
169
|
+
o.native || G(() => {
|
|
171
170
|
var a;
|
|
172
|
-
|
|
171
|
+
se(), (a = K.value) == null || a.$el.focus();
|
|
173
172
|
});
|
|
174
173
|
}
|
|
175
174
|
}
|
|
@@ -177,12 +176,12 @@ const el = { class: "relative" }, ll = {
|
|
|
177
176
|
return !!(typeof e > "u" || e === null || e === "" || Array.isArray(e) && e.length === 0 || !Array.isArray(e) && typeof e == "object" && Object.keys(e).length === 0);
|
|
178
177
|
}
|
|
179
178
|
function te(e, t) {
|
|
180
|
-
if (e.stopPropagation(),
|
|
179
|
+
if (e.stopPropagation(), $.value)
|
|
181
180
|
return;
|
|
182
181
|
const l = i.value.indexOf(t);
|
|
183
|
-
l !== -1 && (i.value.splice(l, 1),
|
|
182
|
+
l !== -1 && (i.value.splice(l, 1), B("update:modelValue", i.value));
|
|
184
183
|
}
|
|
185
|
-
function
|
|
184
|
+
function N(e) {
|
|
186
185
|
var l;
|
|
187
186
|
const t = (l = o.options) == null ? void 0 : l.find((a) => a.value === e);
|
|
188
187
|
return t ? t.label : "";
|
|
@@ -192,150 +191,150 @@ const el = { class: "relative" }, ll = {
|
|
|
192
191
|
hideFooterInternal: Oe,
|
|
193
192
|
inputListeners: oe,
|
|
194
193
|
reset: $e,
|
|
195
|
-
validate:
|
|
194
|
+
validate: se,
|
|
196
195
|
setError: Ae,
|
|
197
196
|
isFocused: Le,
|
|
198
|
-
isInsideForm:
|
|
199
|
-
} =
|
|
200
|
-
const { focus: e, blur: t } =
|
|
197
|
+
isInsideForm: Re
|
|
198
|
+
} = J(o, { focus: ae, emit: B, withListeners: !0 }), xe = R(() => {
|
|
199
|
+
const { focus: e, blur: t } = r(oe);
|
|
201
200
|
return {
|
|
202
201
|
focus: e,
|
|
203
202
|
blur: t
|
|
204
203
|
};
|
|
205
204
|
});
|
|
206
|
-
let
|
|
207
|
-
|
|
208
|
-
e || t ?
|
|
205
|
+
let L = null;
|
|
206
|
+
D([Le, T], ([e, t]) => {
|
|
207
|
+
e || t ? L || (L = He(document, "keydown", Ie)) : L && (L(), L = null);
|
|
209
208
|
}, {
|
|
210
209
|
immediate: !0
|
|
211
|
-
}),
|
|
212
|
-
|
|
210
|
+
}), De(() => {
|
|
211
|
+
L && L();
|
|
213
212
|
});
|
|
214
|
-
function
|
|
215
|
-
var t, l, a,
|
|
213
|
+
function Ie(e) {
|
|
214
|
+
var t, l, a, y, c;
|
|
216
215
|
if (v.value.length !== 0)
|
|
217
216
|
if (e.code === "ArrowDown") {
|
|
218
|
-
if (e.preventDefault(), !
|
|
219
|
-
(t =
|
|
217
|
+
if (e.preventDefault(), !T.value) {
|
|
218
|
+
(t = g.value) == null || t.show();
|
|
220
219
|
return;
|
|
221
220
|
}
|
|
222
|
-
|
|
221
|
+
H(u.value, "down");
|
|
223
222
|
} else if (e.code === "ArrowUp") {
|
|
224
|
-
if (e.preventDefault(), !
|
|
225
|
-
(l =
|
|
223
|
+
if (e.preventDefault(), !T.value) {
|
|
224
|
+
(l = g.value) == null || l.show();
|
|
226
225
|
return;
|
|
227
226
|
}
|
|
228
|
-
|
|
227
|
+
H(u.value, "up");
|
|
229
228
|
} else if (e.code === "Enter" || e.code === "Space") {
|
|
230
229
|
if (e.code === "Space" && o.filterable)
|
|
231
230
|
return;
|
|
232
|
-
if (e.preventDefault(), e.stopPropagation(), !
|
|
233
|
-
(a =
|
|
231
|
+
if (e.preventDefault(), e.stopPropagation(), !T.value) {
|
|
232
|
+
(a = g.value) == null || a.show();
|
|
234
233
|
return;
|
|
235
234
|
}
|
|
236
235
|
if (typeof u.value < "u" && v.value[u.value]) {
|
|
237
236
|
const d = v.value[u.value];
|
|
238
|
-
ee(d.value), !d.keepOpenOnClick && (!f.value || o.multipleCheckbox) && ((
|
|
237
|
+
ee(d.value), !d.keepOpenOnClick && (!f.value || o.multipleCheckbox) && ((y = g.value) == null || y.hide());
|
|
239
238
|
}
|
|
240
239
|
} else
|
|
241
|
-
e.code === "Tab" &&
|
|
240
|
+
e.code === "Tab" && T.value && (e.preventDefault(), (c = g.value) == null || c.hide(), o.native || G(() => {
|
|
242
241
|
var d;
|
|
243
|
-
(d =
|
|
242
|
+
(d = K.value) == null || d.$el.focus();
|
|
244
243
|
}));
|
|
245
244
|
}
|
|
246
|
-
const
|
|
247
|
-
f.value && o.truncate &&
|
|
245
|
+
const z = h(null), re = h(null), q = h(!1), W = h(0), ne = el(() => {
|
|
246
|
+
f.value && o.truncate && G(() => {
|
|
248
247
|
const e = Ve();
|
|
249
|
-
e < i.value.length ? (
|
|
248
|
+
e < i.value.length ? (q.value = !0, W.value = i.value.length - e) : (q.value = !1, W.value = 0);
|
|
250
249
|
});
|
|
251
250
|
}, 100, !0);
|
|
252
|
-
|
|
251
|
+
qe(z, () => {
|
|
253
252
|
ne();
|
|
254
253
|
});
|
|
255
254
|
function Ve() {
|
|
256
|
-
if (!
|
|
255
|
+
if (!z.value)
|
|
257
256
|
return 0;
|
|
258
|
-
const e =
|
|
257
|
+
const e = z.value.querySelectorAll(".x-tag"), t = Array.from(e);
|
|
259
258
|
let l = 0, a = 0;
|
|
260
|
-
const
|
|
259
|
+
const y = z.value.offsetWidth - 30;
|
|
261
260
|
for (let c = 0; c < t.length; c++) {
|
|
262
261
|
const d = t[c];
|
|
263
|
-
d.style.display = "flex", l += d.offsetWidth, l <
|
|
262
|
+
d.style.display = "flex", l += d.offsetWidth, l < y ? a++ : d.style.display = "none";
|
|
264
263
|
}
|
|
265
264
|
return a;
|
|
266
265
|
}
|
|
267
|
-
|
|
266
|
+
D(i, (e) => {
|
|
268
267
|
ne();
|
|
269
268
|
}, { immediate: !0, deep: !0 });
|
|
270
|
-
const { styles: Te, classes:
|
|
271
|
-
return ye({ focus: ae, blur: we, reset: $e, validate:
|
|
269
|
+
const { styles: Te, classes: C, className: Se } = Ue("Select", {}, o, { errorInternal: ie });
|
|
270
|
+
return ye({ focus: ae, blur: we, reset: $e, validate: se, setError: Ae, filterRef: E }), (e, t) => (s(), x(Ge, U({
|
|
272
271
|
ref_key: "labelRef",
|
|
273
|
-
ref:
|
|
272
|
+
ref: K,
|
|
274
273
|
tabindex: "0",
|
|
275
274
|
class: ["group", [
|
|
276
|
-
|
|
277
|
-
|
|
275
|
+
r(Se),
|
|
276
|
+
r(C).wrapper
|
|
278
277
|
]],
|
|
279
|
-
style:
|
|
280
|
-
disabled:
|
|
278
|
+
style: r(Te),
|
|
279
|
+
disabled: $.value,
|
|
281
280
|
required: e.required,
|
|
282
|
-
"is-inside-form":
|
|
281
|
+
"is-inside-form": r(Re),
|
|
283
282
|
label: e.label,
|
|
284
283
|
tooltip: e.tooltip
|
|
285
|
-
}, de(
|
|
284
|
+
}, de(xe.value)), {
|
|
286
285
|
default: p(() => [
|
|
287
|
-
M("div",
|
|
288
|
-
e.native && !f.value ? (
|
|
286
|
+
M("div", ll, [
|
|
287
|
+
e.native && !f.value ? (s(), n("div", {
|
|
289
288
|
key: 0,
|
|
290
|
-
class:
|
|
289
|
+
class: A(r(C).box),
|
|
291
290
|
onClick: t[0] || (t[0] = (l) => {
|
|
292
291
|
var a;
|
|
293
292
|
return (a = X.value) == null ? void 0 : a.click();
|
|
294
293
|
})
|
|
295
294
|
}, [
|
|
296
|
-
le(i.value) ? (
|
|
297
|
-
e.placeholder ? (
|
|
298
|
-
], 64)) : (
|
|
299
|
-
|
|
295
|
+
le(i.value) ? (s(), n(w, { key: 1 }, [
|
|
296
|
+
e.placeholder ? (s(), n("div", tl, k(e.placeholder), 1)) : (s(), n("div", al, " "))
|
|
297
|
+
], 64)) : (s(), n(w, { key: 0 }, [
|
|
298
|
+
S(k(N(i.value)), 1)
|
|
300
299
|
], 64))
|
|
301
|
-
], 2)) : (
|
|
302
|
-
|
|
300
|
+
], 2)) : (s(), n(w, { key: 1 }, [
|
|
301
|
+
P(ve, {
|
|
303
302
|
ref_key: "popoverRef",
|
|
304
|
-
ref:
|
|
305
|
-
disabled:
|
|
303
|
+
ref: g,
|
|
304
|
+
disabled: $.value,
|
|
306
305
|
placement: e.placement
|
|
307
306
|
}, {
|
|
308
307
|
content: p(() => [
|
|
309
|
-
|
|
310
|
-
class:
|
|
308
|
+
P(pe, {
|
|
309
|
+
class: A(r(C).content)
|
|
311
310
|
}, {
|
|
312
311
|
default: p(() => [
|
|
313
|
-
|
|
314
|
-
e.filterable ? (
|
|
312
|
+
O(e.$slots, "content-header", {}, () => [
|
|
313
|
+
e.filterable ? (s(), n("div", {
|
|
315
314
|
key: 0,
|
|
316
|
-
class:
|
|
315
|
+
class: A(r(C).search)
|
|
317
316
|
}, [
|
|
318
|
-
|
|
317
|
+
P(_e, {
|
|
319
318
|
ref_key: "filterRef",
|
|
320
|
-
ref:
|
|
321
|
-
modelValue:
|
|
322
|
-
"onUpdate:modelValue": t[2] || (t[2] = (l) =>
|
|
319
|
+
ref: E,
|
|
320
|
+
modelValue: V.value,
|
|
321
|
+
"onUpdate:modelValue": t[2] || (t[2] = (l) => V.value = l),
|
|
323
322
|
placeholder: e.filterPlaceholder,
|
|
324
323
|
"skip-form-registry": "",
|
|
325
324
|
"data-1p-ignore": "",
|
|
326
325
|
size: "sm"
|
|
327
|
-
},
|
|
328
|
-
], 2)) :
|
|
326
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
327
|
+
], 2)) : I("", !0)
|
|
329
328
|
]),
|
|
330
|
-
M("div",
|
|
331
|
-
class:
|
|
329
|
+
M("div", U(r(ke), {
|
|
330
|
+
class: r(C).contentBody
|
|
332
331
|
}), [
|
|
333
|
-
M("div",
|
|
334
|
-
(
|
|
332
|
+
M("div", U(r(ge), { class: "space-y-0.5" }), [
|
|
333
|
+
(s(!0), n(w, null, j(r(Z), (l) => (s(), x(Qe, {
|
|
335
334
|
key: l.index,
|
|
336
335
|
ref_for: !0,
|
|
337
336
|
ref_key: "itemsRef",
|
|
338
|
-
ref:
|
|
337
|
+
ref: F,
|
|
339
338
|
item: l.data,
|
|
340
339
|
size: e.size,
|
|
341
340
|
disabled: l.data.disabled,
|
|
@@ -345,11 +344,11 @@ const el = { class: "relative" }, ll = {
|
|
|
345
344
|
filled: "",
|
|
346
345
|
onClick: () => {
|
|
347
346
|
var a;
|
|
348
|
-
return !l.data.keepOpenOnClick && (!f.value || e.multipleCheckbox) && ((a =
|
|
347
|
+
return !l.data.keepOpenOnClick && (!f.value || e.multipleCheckbox) && ((a = g.value) == null ? void 0 : a.hide());
|
|
349
348
|
}
|
|
350
|
-
},
|
|
349
|
+
}, Me({
|
|
351
350
|
default: p(() => [
|
|
352
|
-
|
|
351
|
+
O(e.$slots, "label", {
|
|
353
352
|
item: l.data
|
|
354
353
|
})
|
|
355
354
|
]),
|
|
@@ -358,10 +357,10 @@ const el = { class: "relative" }, ll = {
|
|
|
358
357
|
e.$slots.prefix || l.data.prefix ? {
|
|
359
358
|
name: "prefix",
|
|
360
359
|
fn: p(() => [
|
|
361
|
-
|
|
360
|
+
O(e.$slots, "prefix", {
|
|
362
361
|
item: l.data
|
|
363
362
|
}, () => [
|
|
364
|
-
|
|
363
|
+
S(k(l.data.prefix), 1)
|
|
365
364
|
])
|
|
366
365
|
]),
|
|
367
366
|
key: "0"
|
|
@@ -369,119 +368,135 @@ const el = { class: "relative" }, ll = {
|
|
|
369
368
|
e.$slots.suffix || l.data.suffix ? {
|
|
370
369
|
name: "suffix",
|
|
371
370
|
fn: p(() => [
|
|
372
|
-
|
|
371
|
+
O(e.$slots, "suffix", {
|
|
373
372
|
item: l.data
|
|
374
373
|
}, () => [
|
|
375
|
-
|
|
374
|
+
S(k(l.data.suffix), 1)
|
|
376
375
|
])
|
|
377
376
|
]),
|
|
378
377
|
key: "1"
|
|
379
378
|
} : void 0
|
|
380
379
|
]), 1032, ["item", "size", "disabled", "selected", "checkbox", "color", "onClick"]))), 128))
|
|
381
380
|
], 16),
|
|
382
|
-
|
|
381
|
+
r(Z).length === 0 ? (s(), n("div", sl, " No options ")) : I("", !0)
|
|
383
382
|
], 16),
|
|
384
|
-
|
|
383
|
+
O(e.$slots, "content-footer")
|
|
385
384
|
]),
|
|
386
385
|
_: 3
|
|
387
386
|
}, 8, ["class"])
|
|
388
387
|
]),
|
|
389
388
|
default: p(() => [
|
|
390
|
-
|
|
391
|
-
popover:
|
|
389
|
+
O(e.$slots, "input", {
|
|
390
|
+
popover: g.value,
|
|
392
391
|
selected: i.value,
|
|
393
|
-
disabled:
|
|
394
|
-
label:
|
|
392
|
+
disabled: $.value,
|
|
393
|
+
label: N(i.value)
|
|
395
394
|
}, () => [
|
|
396
395
|
M("div", {
|
|
397
|
-
class:
|
|
396
|
+
class: A([r(C).box])
|
|
398
397
|
}, [
|
|
399
|
-
f.value && Array.isArray(i.value) && i.value.length > 0 ? (
|
|
398
|
+
f.value && Array.isArray(i.value) && i.value.length > 0 ? (s(), n("div", {
|
|
400
399
|
key: 0,
|
|
401
400
|
ref_key: "tagsRef",
|
|
402
|
-
ref:
|
|
403
|
-
class:
|
|
401
|
+
ref: z,
|
|
402
|
+
class: A(["flex gap-1 relative", {
|
|
404
403
|
"flex-wrap": !e.truncate,
|
|
405
404
|
"overflow-hidden": e.truncate
|
|
406
405
|
}])
|
|
407
406
|
}, [
|
|
408
|
-
(
|
|
409
|
-
var a,
|
|
410
|
-
return
|
|
407
|
+
(s(!0), n(w, null, j(i.value, (l) => {
|
|
408
|
+
var a, y, c, d;
|
|
409
|
+
return s(), x(fe, {
|
|
411
410
|
key: l,
|
|
412
411
|
size: "xs",
|
|
413
412
|
removable: "",
|
|
414
|
-
outlined: !(
|
|
415
|
-
disabled:
|
|
416
|
-
onRemove: (
|
|
417
|
-
te(
|
|
413
|
+
outlined: !($.value || (y = (a = e.options) == null ? void 0 : a.find((m) => m.value === l)) != null && y.disabled),
|
|
414
|
+
disabled: $.value || ((d = (c = e.options) == null ? void 0 : c.find((m) => m.value === l)) == null ? void 0 : d.disabled),
|
|
415
|
+
onRemove: (m) => {
|
|
416
|
+
te(m, l);
|
|
418
417
|
}
|
|
419
418
|
}, {
|
|
419
|
+
prefix: p(() => {
|
|
420
|
+
var m;
|
|
421
|
+
return [
|
|
422
|
+
O(e.$slots, "tag-prefix", {
|
|
423
|
+
item: (m = e.options) == null ? void 0 : m.find((b) => b.value === l)
|
|
424
|
+
})
|
|
425
|
+
];
|
|
426
|
+
}),
|
|
420
427
|
default: p(() => [
|
|
421
|
-
|
|
428
|
+
S(" " + k(N(l)), 1)
|
|
422
429
|
]),
|
|
423
430
|
_: 2
|
|
424
431
|
}, 1032, ["outlined", "disabled", "onRemove"]);
|
|
425
432
|
}), 128)),
|
|
426
|
-
|
|
433
|
+
q.value ? (s(), n("div", {
|
|
427
434
|
key: 0,
|
|
428
|
-
class:
|
|
429
|
-
onClick: t[1] || (t[1] =
|
|
435
|
+
class: A(r(C).truncateCounter),
|
|
436
|
+
onClick: t[1] || (t[1] = Pe((l) => {
|
|
430
437
|
var a;
|
|
431
|
-
return (a =
|
|
438
|
+
return (a = re.value) == null ? void 0 : a.toggle();
|
|
432
439
|
}, ["stop"]))
|
|
433
|
-
}, "+" +
|
|
434
|
-
], 2)) : !f.value && !le(i.value) ? (
|
|
435
|
-
|
|
436
|
-
], 64)) : (
|
|
437
|
-
e.placeholder ? (
|
|
440
|
+
}, "+" + k(W.value), 3)) : I("", !0)
|
|
441
|
+
], 2)) : !f.value && !le(i.value) ? (s(), n(w, { key: 1 }, [
|
|
442
|
+
S(k(N(i.value)), 1)
|
|
443
|
+
], 64)) : (s(), n(w, { key: 2 }, [
|
|
444
|
+
e.placeholder ? (s(), n("div", il, k(e.placeholder), 1)) : (s(), n("div", ol, " "))
|
|
438
445
|
], 64))
|
|
439
446
|
], 2)
|
|
440
447
|
])
|
|
441
448
|
]),
|
|
442
449
|
_: 3
|
|
443
450
|
}, 8, ["disabled", "placement"]),
|
|
444
|
-
f.value && e.truncate &&
|
|
451
|
+
f.value && e.truncate && q.value ? (s(), x(ve, {
|
|
445
452
|
key: 0,
|
|
446
453
|
ref_key: "multipleHiddenRef",
|
|
447
|
-
ref:
|
|
454
|
+
ref: re,
|
|
448
455
|
"popper-show-triggers": [],
|
|
449
456
|
"popper-hide-triggers": [],
|
|
450
457
|
class: "inline-block !absolute right-0",
|
|
451
458
|
placement: "auto-start"
|
|
452
459
|
}, {
|
|
453
460
|
content: p(() => [
|
|
454
|
-
|
|
461
|
+
P(pe, { class: "p-2 flex gap-2 flex-wrap" }, {
|
|
455
462
|
default: p(() => {
|
|
456
463
|
var l;
|
|
457
464
|
return [
|
|
458
|
-
(
|
|
459
|
-
var
|
|
460
|
-
return
|
|
465
|
+
(s(!0), n(w, null, j((l = i.value) == null ? void 0 : l.slice(i.value.length - W.value), (a) => {
|
|
466
|
+
var y, c, d, m;
|
|
467
|
+
return s(), x(fe, {
|
|
461
468
|
key: a,
|
|
462
469
|
size: "xs",
|
|
463
470
|
removable: "",
|
|
464
|
-
outlined: !(
|
|
465
|
-
disabled:
|
|
466
|
-
onRemove: (
|
|
467
|
-
te(
|
|
471
|
+
outlined: !($.value || (c = (y = e.options) == null ? void 0 : y.find((b) => b.value === a)) != null && c.disabled),
|
|
472
|
+
disabled: $.value || ((m = (d = e.options) == null ? void 0 : d.find((b) => b.value === a)) == null ? void 0 : m.disabled),
|
|
473
|
+
onRemove: (b) => {
|
|
474
|
+
te(b, a);
|
|
468
475
|
}
|
|
469
476
|
}, {
|
|
477
|
+
prefix: p(() => {
|
|
478
|
+
var b;
|
|
479
|
+
return [
|
|
480
|
+
O(e.$slots, "tag-prefix", {
|
|
481
|
+
item: (b = e.options) == null ? void 0 : b.find((Be) => Be.value === a)
|
|
482
|
+
})
|
|
483
|
+
];
|
|
484
|
+
}),
|
|
470
485
|
default: p(() => [
|
|
471
|
-
|
|
486
|
+
S(" " + k(N(a)), 1)
|
|
472
487
|
]),
|
|
473
488
|
_: 2
|
|
474
489
|
}, 1032, ["outlined", "disabled", "onRemove"]);
|
|
475
490
|
}), 128))
|
|
476
491
|
];
|
|
477
492
|
}),
|
|
478
|
-
_:
|
|
493
|
+
_: 3
|
|
479
494
|
})
|
|
480
495
|
]),
|
|
481
|
-
_:
|
|
482
|
-
}, 512)) :
|
|
496
|
+
_: 3
|
|
497
|
+
}, 512)) : I("", !0)
|
|
483
498
|
], 64)),
|
|
484
|
-
|
|
499
|
+
Fe(M("select", U({
|
|
485
500
|
id: e.id,
|
|
486
501
|
ref_key: "elRef",
|
|
487
502
|
ref: X,
|
|
@@ -492,33 +507,33 @@ const el = { class: "relative" }, ll = {
|
|
|
492
507
|
disabled: e.disabled || e.loading,
|
|
493
508
|
multiple: f.value,
|
|
494
509
|
readonly: e.readonly
|
|
495
|
-
}, de(
|
|
496
|
-
e.native ? (
|
|
510
|
+
}, de(r(oe), !0)), [
|
|
511
|
+
e.native ? (s(!0), n(w, { key: 0 }, j(e.options, (l, a) => (s(), n("option", {
|
|
497
512
|
key: a,
|
|
498
513
|
value: l.value,
|
|
499
514
|
disabled: l.disabled
|
|
500
|
-
},
|
|
515
|
+
}, k(l.label), 9, nl))), 128)) : I("", !0)
|
|
501
516
|
], 16, rl), [
|
|
502
|
-
[
|
|
517
|
+
[Ee, i.value]
|
|
503
518
|
]),
|
|
504
|
-
e.$slots.input ?
|
|
519
|
+
e.$slots.input ? I("", !0) : (s(), n("div", {
|
|
505
520
|
key: 2,
|
|
506
|
-
class:
|
|
521
|
+
class: A(r(C).iconWrapper)
|
|
507
522
|
}, [
|
|
508
|
-
e.loading ? (
|
|
523
|
+
e.loading ? (s(), x(Ye, {
|
|
509
524
|
key: 0,
|
|
510
525
|
size: e.size
|
|
511
|
-
}, null, 8, ["size"])) :
|
|
512
|
-
|
|
513
|
-
icon:
|
|
514
|
-
class:
|
|
526
|
+
}, null, 8, ["size"])) : O(e.$slots, "icon", { key: 1 }, () => [
|
|
527
|
+
P(Je, {
|
|
528
|
+
icon: r(Ke),
|
|
529
|
+
class: A([r(C).icon])
|
|
515
530
|
}, null, 8, ["icon", "class"])
|
|
516
531
|
])
|
|
517
532
|
], 2))
|
|
518
533
|
]),
|
|
519
|
-
|
|
534
|
+
r(Oe) ? I("", !0) : (s(), x(Ze, {
|
|
520
535
|
key: 0,
|
|
521
|
-
error:
|
|
536
|
+
error: r(ie),
|
|
522
537
|
helper: e.helper
|
|
523
538
|
}, null, 8, ["error", "helper"]))
|
|
524
539
|
]),
|
|
@@ -527,5 +542,5 @@ const el = { class: "relative" }, ll = {
|
|
|
527
542
|
}
|
|
528
543
|
});
|
|
529
544
|
export {
|
|
530
|
-
|
|
545
|
+
Tl as default
|
|
531
546
|
};
|