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