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