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