@indielayer/ui 1.8.4 → 1.9.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/usage.vue +17 -5
- package/docs/pages/component/table/index.vue +7 -0
- package/docs/pages/component/table/virtual.vue +53 -0
- package/lib/components/select/Select.vue.d.ts +36 -0
- package/lib/components/select/Select.vue.js +224 -201
- package/lib/components/select/theme/Select.base.theme.js +1 -1
- package/lib/components/table/Table.vue.d.ts +91 -4
- package/lib/components/table/Table.vue.js +214 -180
- package/lib/components/table/TableHead.vue.d.ts +10 -2
- package/lib/components/table/TableHead.vue.js +16 -13
- package/lib/components/table/TableHeader.vue.d.ts +0 -4
- package/lib/components/table/TableHeader.vue.js +9 -10
- package/lib/components/table/theme/TableHead.base.theme.js +7 -4
- package/lib/components/table/theme/TableHead.carbon.theme.js +7 -4
- package/lib/components/table/theme/TableHeader.base.theme.js +3 -3
- package/lib/components/table/theme/TableHeader.carbon.theme.js +1 -1
- package/lib/composables/index.d.ts +1 -0
- package/lib/composables/useVirtualList.d.ts +48 -0
- package/lib/composables/useVirtualList.js +123 -0
- package/lib/index.js +34 -32
- package/lib/index.umd.js +4 -4
- package/lib/node_modules/.pnpm/@vueuse_core@10.2.0_vue@3.3.9_typescript@5.2.2_/node_modules/@vueuse/core/index.js +254 -221
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/src/components/select/Select.vue +56 -26
- package/src/components/select/theme/Select.base.theme.ts +1 -1
- package/src/components/table/Table.vue +152 -113
- package/src/components/table/TableHead.vue +6 -2
- package/src/components/table/TableHeader.vue +0 -1
- package/src/components/table/theme/TableHead.base.theme.ts +7 -1
- package/src/components/table/theme/TableHead.carbon.theme.ts +7 -1
- package/src/components/table/theme/TableHeader.base.theme.ts +0 -2
- package/src/components/table/theme/TableHeader.carbon.theme.ts +0 -2
- package/src/composables/index.ts +1 -0
- package/src/composables/useVirtualList.ts +286 -0
- package/src/version.ts +1 -1
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useEventListener as
|
|
3
|
-
import { useColors as
|
|
4
|
-
import { useCommon as
|
|
5
|
-
import { useInputtable as
|
|
1
|
+
import { defineComponent as Le, ref as m, computed as k, watch as S, nextTick as ee, unref as s, onUnmounted as Ae, resolveComponent as Ve, openBlock as a, createBlock as g, mergeProps as E, toHandlers as le, withCtx as $, createElementVNode as w, createElementBlock as n, normalizeClass as L, Fragment as y, createTextVNode as F, toDisplayString as A, createVNode as q, renderSlot as H, createCommentVNode as T, normalizeProps as Ie, guardReactiveProps as Oe, renderList as U, withDirectives as Re, vModelSelect as $e } from "vue";
|
|
2
|
+
import { useEventListener as Ce } from "../../node_modules/.pnpm/@vueuse_core@10.2.0_vue@3.3.9_typescript@5.2.2_/node_modules/@vueuse/core/index.js";
|
|
3
|
+
import { useColors as Ne } from "../../composables/useColors.js";
|
|
4
|
+
import { useCommon as te } from "../../composables/useCommon.js";
|
|
5
|
+
import { useInputtable as j } from "../../composables/useInputtable.js";
|
|
6
6
|
import { useInteractive as ie } from "../../composables/useInteractive.js";
|
|
7
|
-
import { useTheme as
|
|
8
|
-
import {
|
|
9
|
-
import _e from "
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
7
|
+
import { useTheme as Be } from "../../composables/useTheme.js";
|
|
8
|
+
import { useVirtualList as Se } from "../../composables/useVirtualList.js";
|
|
9
|
+
import { checkIcon as Te, selectIcon as _e } from "../../common/icons.js";
|
|
10
|
+
import ze from "../label/Label.vue.js";
|
|
11
|
+
import Pe from "../tag/Tag.vue.js";
|
|
12
|
+
import De from "../icon/Icon.vue.js";
|
|
13
|
+
import Ee from "../menu/MenuItem.vue.js";
|
|
14
|
+
import Fe from "../spinner/Spinner.vue.js";
|
|
15
|
+
import qe from "../popover/Popover.vue.js";
|
|
15
16
|
import "../popover/Popover.vue3.js";
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
const
|
|
17
|
+
import He from "../popover/PopoverContainer.vue.js";
|
|
18
|
+
import Ue from "../inputFooter/InputFooter.vue.js";
|
|
19
|
+
const je = { class: "relative" }, Me = {
|
|
19
20
|
key: 0,
|
|
20
21
|
class: "text-secondary-400 dark:text-secondary-500"
|
|
21
|
-
},
|
|
22
|
+
}, Xe = { key: 1 }, xe = {
|
|
22
23
|
key: 0,
|
|
23
24
|
class: "flex gap-1 flex-wrap"
|
|
24
|
-
},
|
|
25
|
+
}, Ke = {
|
|
25
26
|
key: 0,
|
|
26
27
|
class: "text-secondary-400 dark:text-secondary-500"
|
|
27
|
-
},
|
|
28
|
-
key:
|
|
29
|
-
class: "
|
|
30
|
-
},
|
|
31
|
-
...
|
|
32
|
-
...
|
|
28
|
+
}, We = { key: 1 }, Ge = {
|
|
29
|
+
key: 0,
|
|
30
|
+
class: "p-2 text-center text-secondary-400"
|
|
31
|
+
}, Je = ["id", "name", "disabled", "multiple", "readonly"], Qe = ["value", "disabled"], Ye = {
|
|
32
|
+
...Ne.props("primary"),
|
|
33
|
+
...te.props(),
|
|
33
34
|
...ie.props(),
|
|
34
|
-
...
|
|
35
|
+
...j.props(),
|
|
35
36
|
placeholder: String,
|
|
36
37
|
options: Array,
|
|
37
38
|
multiple: Boolean,
|
|
@@ -41,68 +42,88 @@ const Te = { class: "relative" }, Ee = {
|
|
|
41
42
|
filterPlaceholder: {
|
|
42
43
|
type: String,
|
|
43
44
|
default: "Filter by..."
|
|
45
|
+
},
|
|
46
|
+
virtualList: Boolean,
|
|
47
|
+
virtualListOffsetTop: Number,
|
|
48
|
+
virtualListOffsetBottom: Number,
|
|
49
|
+
virtualListItemHeight: {
|
|
50
|
+
type: Number,
|
|
51
|
+
default: 33
|
|
52
|
+
},
|
|
53
|
+
virtualListOverscan: {
|
|
54
|
+
type: Number,
|
|
55
|
+
default: 5
|
|
44
56
|
}
|
|
45
|
-
},
|
|
57
|
+
}, Ze = {
|
|
46
58
|
name: "XSelect",
|
|
47
59
|
validators: {
|
|
48
|
-
...
|
|
60
|
+
...te.validators()
|
|
49
61
|
}
|
|
50
|
-
},
|
|
51
|
-
...
|
|
52
|
-
props:
|
|
53
|
-
emits:
|
|
54
|
-
setup(
|
|
55
|
-
const
|
|
62
|
+
}, hl = /* @__PURE__ */ Le({
|
|
63
|
+
...Ze,
|
|
64
|
+
props: Ye,
|
|
65
|
+
emits: j.emits(),
|
|
66
|
+
setup(oe, { expose: re, emit: ae }) {
|
|
67
|
+
const i = oe, C = ae, _ = m(null), z = m(null), N = m(null), v = m(null), u = m(), b = m(""), P = m(null), V = k(() => i.disabled || i.loading || i.readonly), r = k({
|
|
56
68
|
get() {
|
|
57
|
-
return
|
|
69
|
+
return i.multiple ? i.modelValue ? Array.isArray(i.modelValue) ? i.modelValue : [i.modelValue] : [] : i.modelValue;
|
|
58
70
|
},
|
|
59
71
|
set(e) {
|
|
60
|
-
|
|
72
|
+
C("update:modelValue", e);
|
|
61
73
|
}
|
|
62
|
-
}), d =
|
|
74
|
+
}), d = k(() => !i.options || i.options.length === 0 ? [] : i.options.filter((e) => b.value === "" || e.label.toLowerCase().includes(b.value.toLowerCase())).map((e) => {
|
|
63
75
|
let l = !1;
|
|
64
|
-
return
|
|
76
|
+
return i.multiple && Array.isArray(r.value) ? l = r.value.includes(e.value) : l = e.value === r.value, {
|
|
65
77
|
value: e.value,
|
|
66
78
|
label: e.label,
|
|
67
79
|
active: l,
|
|
68
80
|
disabled: e.disabled,
|
|
69
|
-
iconRight: l ?
|
|
70
|
-
onClick: () =>
|
|
81
|
+
iconRight: l ? Te : void 0,
|
|
82
|
+
onClick: () => K(e.value)
|
|
71
83
|
};
|
|
72
|
-
})),
|
|
84
|
+
})), M = k(() => d.value.filter((e) => !e.disabled)), { list: X, scrollTo: se, containerProps: ne, wrapperProps: ue } = Se(
|
|
85
|
+
d,
|
|
86
|
+
{
|
|
87
|
+
disabled: !i.virtualList,
|
|
88
|
+
itemHeight: i.virtualListItemHeight,
|
|
89
|
+
topOffset: i.virtualListOffsetTop || 0,
|
|
90
|
+
bottomOffset: i.virtualListOffsetBottom || 0,
|
|
91
|
+
overscan: i.virtualListOverscan
|
|
92
|
+
}
|
|
93
|
+
), h = k(() => {
|
|
73
94
|
var e;
|
|
74
95
|
return (e = v.value) == null ? void 0 : e.isOpen;
|
|
75
96
|
});
|
|
76
|
-
|
|
77
|
-
e && (u.value = void 0,
|
|
78
|
-
}),
|
|
79
|
-
e ? (
|
|
97
|
+
S(b, (e) => {
|
|
98
|
+
e && (u.value = void 0, B(-1));
|
|
99
|
+
}), S(h, (e) => {
|
|
100
|
+
e ? (de(), (i.multiple || typeof u.value > "u") && B(-1), setTimeout(() => {
|
|
80
101
|
requestAnimationFrame(() => {
|
|
81
102
|
var l;
|
|
82
|
-
|
|
103
|
+
x(u.value || 0), i.filterable && ((l = P.value) == null || l.focus());
|
|
83
104
|
});
|
|
84
|
-
}, 50)) :
|
|
105
|
+
}, 50)) : i.filterable && (b.value = "");
|
|
85
106
|
});
|
|
86
|
-
function
|
|
87
|
-
if (
|
|
88
|
-
if (Array.isArray(
|
|
89
|
-
const e = d.value.findIndex((l) => l.value ===
|
|
107
|
+
function de() {
|
|
108
|
+
if (i.multiple) {
|
|
109
|
+
if (Array.isArray(r.value) && r.value.length > 0) {
|
|
110
|
+
const e = d.value.findIndex((l) => l.value === r.value[0]);
|
|
90
111
|
e !== -1 && (u.value = e);
|
|
91
112
|
}
|
|
92
113
|
} else {
|
|
93
|
-
const e = d.value.findIndex((l) => l.value ===
|
|
114
|
+
const e = d.value.findIndex((l) => l.value === r.value);
|
|
94
115
|
e !== -1 && (u.value = e);
|
|
95
116
|
}
|
|
96
117
|
}
|
|
97
|
-
function
|
|
118
|
+
function x(e) {
|
|
98
119
|
var l;
|
|
99
|
-
|
|
120
|
+
i.virtualList ? se(e) : N.value && ((l = N.value[e]) == null || l.$el.scrollIntoView({ block: "nearest", inline: "nearest" }));
|
|
100
121
|
}
|
|
101
|
-
|
|
102
|
-
typeof e < "u" &&
|
|
122
|
+
S(u, (e) => {
|
|
123
|
+
typeof e < "u" && N.value && x(e);
|
|
103
124
|
});
|
|
104
|
-
function
|
|
105
|
-
if (!
|
|
125
|
+
function B(e, l = "down") {
|
|
126
|
+
if (!M.value || M.value.length === 0) {
|
|
106
127
|
u.value = void 0;
|
|
107
128
|
return;
|
|
108
129
|
}
|
|
@@ -118,250 +139,252 @@ const Te = { class: "relative" }, Ee = {
|
|
|
118
139
|
u.value = o;
|
|
119
140
|
}
|
|
120
141
|
}
|
|
121
|
-
function
|
|
142
|
+
function K(e) {
|
|
122
143
|
var o;
|
|
123
|
-
const l = (o =
|
|
144
|
+
const l = (o = i.options) == null ? void 0 : o.find((t) => t.value === e);
|
|
124
145
|
if (!(!l || l.disabled)) {
|
|
125
|
-
if (
|
|
126
|
-
if (Array.isArray(
|
|
127
|
-
const
|
|
128
|
-
|
|
146
|
+
if (i.multiple) {
|
|
147
|
+
if (Array.isArray(r.value)) {
|
|
148
|
+
const t = r.value.indexOf(e);
|
|
149
|
+
t !== -1 ? r.value.splice(t, 1) : (r.value.push(e), C("update:modelValue", r.value));
|
|
129
150
|
} else
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
var
|
|
133
|
-
(
|
|
151
|
+
r.value = [e];
|
|
152
|
+
i.filterable && setTimeout(() => {
|
|
153
|
+
var t;
|
|
154
|
+
(t = P.value) == null || t.focus();
|
|
134
155
|
});
|
|
135
156
|
} else
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
var
|
|
139
|
-
|
|
157
|
+
r.value = e;
|
|
158
|
+
i.native || ee(() => {
|
|
159
|
+
var t;
|
|
160
|
+
Y(), (t = z.value) == null || t.$el.focus();
|
|
140
161
|
});
|
|
141
162
|
}
|
|
142
163
|
}
|
|
143
|
-
function
|
|
164
|
+
function W(e) {
|
|
144
165
|
return !!(typeof e > "u" || e === null || e === "" || Array.isArray(e) && e.length === 0 || !Array.isArray(e) && typeof e == "object" && Object.keys(e).length === 0);
|
|
145
166
|
}
|
|
146
|
-
function
|
|
147
|
-
if (e.stopPropagation(),
|
|
167
|
+
function fe(e, l) {
|
|
168
|
+
if (e.stopPropagation(), V.value)
|
|
148
169
|
return;
|
|
149
|
-
const o =
|
|
150
|
-
o !== -1 && (
|
|
170
|
+
const o = r.value.indexOf(l);
|
|
171
|
+
o !== -1 && (r.value.splice(o, 1), C("update:modelValue", r.value));
|
|
151
172
|
}
|
|
152
|
-
function
|
|
173
|
+
function D(e) {
|
|
153
174
|
var o;
|
|
154
|
-
const l = (o =
|
|
175
|
+
const l = (o = i.options) == null ? void 0 : o.find((t) => t.value === e);
|
|
155
176
|
return l ? l.label : "";
|
|
156
177
|
}
|
|
157
|
-
const { focus:
|
|
158
|
-
errorInternal:
|
|
159
|
-
hideFooterInternal:
|
|
160
|
-
inputListeners:
|
|
161
|
-
reset:
|
|
162
|
-
validate:
|
|
163
|
-
setError:
|
|
164
|
-
isFocused:
|
|
165
|
-
isInsideForm:
|
|
166
|
-
} =
|
|
167
|
-
const { focus: e, blur: l } = s(
|
|
178
|
+
const { focus: G, blur: ve } = ie(_), {
|
|
179
|
+
errorInternal: J,
|
|
180
|
+
hideFooterInternal: pe,
|
|
181
|
+
inputListeners: Q,
|
|
182
|
+
reset: ce,
|
|
183
|
+
validate: Y,
|
|
184
|
+
setError: me,
|
|
185
|
+
isFocused: ye,
|
|
186
|
+
isInsideForm: be
|
|
187
|
+
} = j(i, { focus: G, emit: C, withListeners: !0 }), he = k(() => {
|
|
188
|
+
const { focus: e, blur: l } = s(Q);
|
|
168
189
|
return {
|
|
169
190
|
focus: e,
|
|
170
191
|
blur: l
|
|
171
192
|
};
|
|
172
193
|
});
|
|
173
|
-
let
|
|
174
|
-
|
|
175
|
-
e || l ?
|
|
194
|
+
let c = null;
|
|
195
|
+
S([ye, h], ([e, l]) => {
|
|
196
|
+
e || l ? c || (c = Ce(document, "keydown", ke)) : c && (c(), c = null);
|
|
176
197
|
}, {
|
|
177
198
|
immediate: !0
|
|
178
|
-
}),
|
|
179
|
-
|
|
199
|
+
}), Ae(() => {
|
|
200
|
+
c && c();
|
|
180
201
|
});
|
|
181
|
-
function
|
|
182
|
-
var l, o,
|
|
202
|
+
function ke(e) {
|
|
203
|
+
var l, o, t, f, I;
|
|
183
204
|
if (d.value.length !== 0)
|
|
184
205
|
if (e.code === "ArrowDown") {
|
|
185
|
-
if (e.preventDefault(), !
|
|
206
|
+
if (e.preventDefault(), !h.value) {
|
|
186
207
|
(l = v.value) == null || l.show();
|
|
187
208
|
return;
|
|
188
209
|
}
|
|
189
|
-
|
|
210
|
+
B(u.value, "down");
|
|
190
211
|
} else if (e.code === "ArrowUp") {
|
|
191
|
-
if (e.preventDefault(), !
|
|
212
|
+
if (e.preventDefault(), !h.value) {
|
|
192
213
|
(o = v.value) == null || o.show();
|
|
193
214
|
return;
|
|
194
215
|
}
|
|
195
|
-
|
|
216
|
+
B(u.value, "up");
|
|
196
217
|
} else if (e.code === "Enter" || e.code === "Space") {
|
|
197
|
-
if (e.code === "Space" &&
|
|
218
|
+
if (e.code === "Space" && i.filterable)
|
|
198
219
|
return;
|
|
199
|
-
if (e.preventDefault(), e.stopPropagation(), !
|
|
200
|
-
(
|
|
220
|
+
if (e.preventDefault(), e.stopPropagation(), !h.value) {
|
|
221
|
+
(t = v.value) == null || t.show();
|
|
201
222
|
return;
|
|
202
223
|
}
|
|
203
|
-
typeof u.value < "u" && d.value[u.value] && (
|
|
224
|
+
typeof u.value < "u" && d.value[u.value] && (K(d.value[u.value].value), i.multiple || (f = v.value) == null || f.hide());
|
|
204
225
|
} else
|
|
205
|
-
e.code === "Tab" &&
|
|
206
|
-
var
|
|
207
|
-
(
|
|
226
|
+
e.code === "Tab" && h.value && (e.preventDefault(), (I = v.value) == null || I.hide(), i.native || ee(() => {
|
|
227
|
+
var O;
|
|
228
|
+
(O = z.value) == null || O.$el.focus();
|
|
208
229
|
}));
|
|
209
230
|
}
|
|
210
|
-
const { styles:
|
|
211
|
-
return
|
|
212
|
-
const o =
|
|
213
|
-
return
|
|
231
|
+
const { styles: ge, classes: p, className: we } = Be("Select", {}, i, { errorInternal: J });
|
|
232
|
+
return re({ focus: G, blur: ve, reset: ce, validate: Y, setError: me }), (e, l) => {
|
|
233
|
+
const o = Ve("x-input");
|
|
234
|
+
return a(), g(ze, E({
|
|
214
235
|
ref_key: "labelRef",
|
|
215
|
-
ref:
|
|
236
|
+
ref: z,
|
|
216
237
|
tabindex: "0",
|
|
217
238
|
class: ["group", [
|
|
218
|
-
s(
|
|
239
|
+
s(we),
|
|
219
240
|
s(p).wrapper
|
|
220
241
|
]],
|
|
221
|
-
style: s(
|
|
222
|
-
disabled:
|
|
242
|
+
style: s(ge),
|
|
243
|
+
disabled: V.value,
|
|
223
244
|
required: e.required,
|
|
224
|
-
"is-inside-form": s(
|
|
245
|
+
"is-inside-form": s(be),
|
|
225
246
|
label: e.label,
|
|
226
247
|
tooltip: e.tooltip
|
|
227
|
-
},
|
|
228
|
-
default:
|
|
229
|
-
|
|
230
|
-
e.native && !e.multiple ? (
|
|
248
|
+
}, le(he.value)), {
|
|
249
|
+
default: $(() => [
|
|
250
|
+
w("div", je, [
|
|
251
|
+
e.native && !e.multiple ? (a(), n("div", {
|
|
231
252
|
key: 0,
|
|
232
|
-
class:
|
|
233
|
-
onClick: l[0] || (l[0] = (
|
|
253
|
+
class: L(s(p).box),
|
|
254
|
+
onClick: l[0] || (l[0] = (t) => {
|
|
234
255
|
var f;
|
|
235
|
-
return (f =
|
|
256
|
+
return (f = _.value) == null ? void 0 : f.click();
|
|
236
257
|
})
|
|
237
258
|
}, [
|
|
238
|
-
|
|
239
|
-
e.placeholder ? (
|
|
240
|
-
], 64)) : (
|
|
241
|
-
|
|
259
|
+
W(r.value) ? (a(), n(y, { key: 1 }, [
|
|
260
|
+
e.placeholder ? (a(), n("div", Me, A(e.placeholder), 1)) : (a(), n("div", Xe, " "))
|
|
261
|
+
], 64)) : (a(), n(y, { key: 0 }, [
|
|
262
|
+
F(A(D(r.value)), 1)
|
|
242
263
|
], 64))
|
|
243
|
-
], 2)) : (
|
|
264
|
+
], 2)) : (a(), g(qe, {
|
|
244
265
|
key: 1,
|
|
245
266
|
ref_key: "popoverRef",
|
|
246
267
|
ref: v,
|
|
247
|
-
disabled:
|
|
268
|
+
disabled: V.value
|
|
248
269
|
}, {
|
|
249
|
-
content:
|
|
250
|
-
|
|
251
|
-
class:
|
|
270
|
+
content: $(() => [
|
|
271
|
+
q(He, {
|
|
272
|
+
class: L(s(p).content)
|
|
252
273
|
}, {
|
|
253
|
-
default:
|
|
254
|
-
|
|
255
|
-
e.filterable ? (
|
|
274
|
+
default: $(() => [
|
|
275
|
+
H(e.$slots, "content-header", {}, () => [
|
|
276
|
+
e.filterable ? (a(), n("div", {
|
|
256
277
|
key: 0,
|
|
257
|
-
class:
|
|
278
|
+
class: L(s(p).search)
|
|
258
279
|
}, [
|
|
259
|
-
|
|
280
|
+
q(o, {
|
|
260
281
|
ref_key: "filterRef",
|
|
261
|
-
ref:
|
|
262
|
-
modelValue:
|
|
263
|
-
"onUpdate:modelValue": l[1] || (l[1] = (
|
|
282
|
+
ref: P,
|
|
283
|
+
modelValue: b.value,
|
|
284
|
+
"onUpdate:modelValue": l[1] || (l[1] = (t) => b.value = t),
|
|
264
285
|
placeholder: e.filterPlaceholder,
|
|
265
286
|
"skip-form-registry": "",
|
|
266
287
|
size: "sm"
|
|
267
288
|
}, null, 8, ["modelValue", "placeholder"])
|
|
268
|
-
], 2)) :
|
|
289
|
+
], 2)) : T("", !0)
|
|
269
290
|
]),
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
291
|
+
w("div", E(s(ne), {
|
|
292
|
+
class: s(p).contentBody
|
|
293
|
+
}), [
|
|
294
|
+
w("div", Ie(Oe(s(ue))), [
|
|
295
|
+
(a(!0), n(y, null, U(s(X), (t) => (a(), g(Ee, {
|
|
296
|
+
key: t.index,
|
|
297
|
+
ref_for: !0,
|
|
298
|
+
ref_key: "itemsRef",
|
|
299
|
+
ref: N,
|
|
300
|
+
item: t.data,
|
|
301
|
+
size: e.size,
|
|
302
|
+
disabled: t.data.disabled,
|
|
303
|
+
selected: t.index === u.value,
|
|
304
|
+
color: e.color,
|
|
305
|
+
filled: "",
|
|
306
|
+
onClick: l[2] || (l[2] = () => {
|
|
307
|
+
var f;
|
|
308
|
+
return !e.multiple && ((f = v.value) == null ? void 0 : f.hide());
|
|
309
|
+
})
|
|
310
|
+
}, null, 8, ["item", "size", "disabled", "selected", "color"]))), 128))
|
|
311
|
+
], 16),
|
|
312
|
+
s(X).length === 0 ? (a(), n("div", Ge, " No options ")) : T("", !0)
|
|
313
|
+
], 16),
|
|
314
|
+
H(e.$slots, "content-footer")
|
|
292
315
|
]),
|
|
293
316
|
_: 3
|
|
294
317
|
}, 8, ["class"])
|
|
295
318
|
]),
|
|
296
|
-
default:
|
|
297
|
-
|
|
298
|
-
class:
|
|
319
|
+
default: $(() => [
|
|
320
|
+
w("div", {
|
|
321
|
+
class: L([s(p).box])
|
|
299
322
|
}, [
|
|
300
|
-
e.multiple && Array.isArray(
|
|
301
|
-
(
|
|
302
|
-
var f,
|
|
303
|
-
return
|
|
304
|
-
key:
|
|
323
|
+
e.multiple && Array.isArray(r.value) && r.value.length > 0 ? (a(), n("div", xe, [
|
|
324
|
+
(a(!0), n(y, null, U(r.value, (t) => {
|
|
325
|
+
var f, I, O, Z;
|
|
326
|
+
return a(), g(Pe, {
|
|
327
|
+
key: t,
|
|
305
328
|
size: "xs",
|
|
306
329
|
removable: "",
|
|
307
|
-
outlined: !(
|
|
308
|
-
disabled:
|
|
309
|
-
onRemove: (
|
|
310
|
-
|
|
330
|
+
outlined: !(V.value || (I = (f = e.options) == null ? void 0 : f.find((R) => R.value === t)) != null && I.disabled),
|
|
331
|
+
disabled: V.value || ((Z = (O = e.options) == null ? void 0 : O.find((R) => R.value === t)) == null ? void 0 : Z.disabled),
|
|
332
|
+
onRemove: (R) => {
|
|
333
|
+
fe(R, t);
|
|
311
334
|
}
|
|
312
335
|
}, {
|
|
313
|
-
default:
|
|
314
|
-
|
|
336
|
+
default: $(() => [
|
|
337
|
+
F(A(D(t)), 1)
|
|
315
338
|
]),
|
|
316
339
|
_: 2
|
|
317
340
|
}, 1032, ["outlined", "disabled", "onRemove"]);
|
|
318
341
|
}), 128))
|
|
319
|
-
])) : !e.multiple && !
|
|
320
|
-
|
|
321
|
-
], 64)) : (
|
|
322
|
-
e.placeholder ? (
|
|
342
|
+
])) : !e.multiple && !W(r.value) ? (a(), n(y, { key: 1 }, [
|
|
343
|
+
F(A(D(r.value)), 1)
|
|
344
|
+
], 64)) : (a(), n(y, { key: 2 }, [
|
|
345
|
+
e.placeholder ? (a(), n("div", Ke, A(e.placeholder), 1)) : (a(), n("div", We, " "))
|
|
323
346
|
], 64))
|
|
324
347
|
], 2)
|
|
325
348
|
]),
|
|
326
349
|
_: 3
|
|
327
350
|
}, 8, ["disabled"])),
|
|
328
|
-
|
|
351
|
+
Re(w("select", E({
|
|
329
352
|
id: e.id,
|
|
330
353
|
ref_key: "elRef",
|
|
331
|
-
ref:
|
|
332
|
-
"onUpdate:modelValue": l[3] || (l[3] = (
|
|
354
|
+
ref: _,
|
|
355
|
+
"onUpdate:modelValue": l[3] || (l[3] = (t) => r.value = t),
|
|
333
356
|
tabindex: "-1",
|
|
334
357
|
class: e.native && !e.multiple ? "absolute inset-0 w-full h-full cursor-pointer opacity-0" : "hidden",
|
|
335
358
|
name: e.name,
|
|
336
359
|
disabled: e.disabled || e.loading,
|
|
337
360
|
multiple: e.multiple,
|
|
338
361
|
readonly: e.readonly
|
|
339
|
-
},
|
|
340
|
-
(
|
|
362
|
+
}, le(s(Q), !0)), [
|
|
363
|
+
e.native ? (a(!0), n(y, { key: 0 }, U(e.options, (t, f) => (a(), n("option", {
|
|
341
364
|
key: f,
|
|
342
|
-
value:
|
|
343
|
-
disabled:
|
|
344
|
-
},
|
|
345
|
-
], 16,
|
|
346
|
-
[
|
|
365
|
+
value: t.value,
|
|
366
|
+
disabled: t.disabled
|
|
367
|
+
}, A(t.label), 9, Qe))), 128)) : T("", !0)
|
|
368
|
+
], 16, Je), [
|
|
369
|
+
[$e, r.value]
|
|
347
370
|
]),
|
|
348
|
-
|
|
349
|
-
class:
|
|
371
|
+
w("div", {
|
|
372
|
+
class: L(s(p).iconWrapper)
|
|
350
373
|
}, [
|
|
351
|
-
e.loading ? (
|
|
374
|
+
e.loading ? (a(), g(Fe, {
|
|
352
375
|
key: 0,
|
|
353
376
|
size: e.size
|
|
354
|
-
}, null, 8, ["size"])) :
|
|
355
|
-
|
|
356
|
-
icon: s(
|
|
357
|
-
class:
|
|
377
|
+
}, null, 8, ["size"])) : H(e.$slots, "icon", { key: 1 }, () => [
|
|
378
|
+
q(De, {
|
|
379
|
+
icon: s(_e),
|
|
380
|
+
class: L([s(p).icon])
|
|
358
381
|
}, null, 8, ["icon", "class"])
|
|
359
382
|
])
|
|
360
383
|
], 2)
|
|
361
384
|
]),
|
|
362
|
-
s(
|
|
385
|
+
s(pe) ? T("", !0) : (a(), g(Ue, {
|
|
363
386
|
key: 0,
|
|
364
|
-
error: s(
|
|
387
|
+
error: s(J),
|
|
365
388
|
helper: e.helper
|
|
366
389
|
}, null, 8, ["error", "helper"]))
|
|
367
390
|
]),
|
|
@@ -371,5 +394,5 @@ const Te = { class: "relative" }, Ee = {
|
|
|
371
394
|
}
|
|
372
395
|
});
|
|
373
396
|
export {
|
|
374
|
-
|
|
397
|
+
hl as default
|
|
375
398
|
};
|
|
@@ -7,7 +7,7 @@ const t = {
|
|
|
7
7
|
},
|
|
8
8
|
content: "p-1",
|
|
9
9
|
search: "p-1 mb-0.5",
|
|
10
|
-
contentBody: "overflow-y-auto max-h-64",
|
|
10
|
+
contentBody: "overflow-y-auto max-h-64 min-w-[280px]",
|
|
11
11
|
iconWrapper: "pointer-events-none absolute inset-y-0 right-0 flex items-center px-2",
|
|
12
12
|
icon: ({ props: e }) => {
|
|
13
13
|
const s = [""];
|