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