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