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