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