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