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