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