vlite3 1.1.2 → 1.1.4

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 (87) hide show
  1. package/components/AttachmentsList/AttachmentsList.vue.d.ts +1 -1
  2. package/components/AttachmentsList/AttachmentsList.vue.js +237 -163
  3. package/components/Avatar.vue.js +1 -1
  4. package/components/AvatarUploader/AvatarUploader.vue.js +40 -37
  5. package/components/Button.vue.js +30 -28
  6. package/components/Carousel/Carousel.vue.d.ts +2 -2
  7. package/components/CategoryManager/CategoryManager.vue.d.ts +10 -2
  8. package/components/CategoryManager/CategoryManager.vue.js +137 -118
  9. package/components/CategoryManager/CategoryNode.vue.d.ts +2 -0
  10. package/components/CategoryManager/CategoryNode.vue.js +93 -88
  11. package/components/Chat/ChatBubble.vue.js +22 -22
  12. package/components/CheckBox.vue.js +29 -28
  13. package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
  14. package/components/CommandPalette/{CommandPaletteItem.vue.js → CommandPaletteItem.vue2.js} +1 -1
  15. package/components/ConfirmationModal.vue.js +30 -28
  16. package/components/CopyButton.vue.d.ts +50 -0
  17. package/components/CopyButton.vue.js +69 -0
  18. package/components/CopyButton.vue2.js +4 -0
  19. package/components/DataTable/DataTable.vue.js +44 -44
  20. package/components/DatePicker.vue.js +41 -35
  21. package/components/DateRangePicker.vue.js +18 -17
  22. package/components/Dropdown/Dropdown.vue.d.ts +3 -0
  23. package/components/Dropdown/Dropdown.vue.js +117 -115
  24. package/components/Dropdown/DropdownBooleanItem.vue.js +16 -15
  25. package/components/Dropdown/DropdownItem.vue.js +21 -20
  26. package/components/Dropdown/DropdownMenu.vue.js +1 -1
  27. package/components/Dropdown/DropdownMenu.vue2.js +13 -12
  28. package/components/Dropdown/DropdownTrigger.vue.d.ts +2 -0
  29. package/components/Dropdown/DropdownTrigger.vue.js +10 -6
  30. package/components/Dropdown/composables/useDropdownHydration.d.ts +2 -0
  31. package/components/Dropdown/composables/useDropdownSelection.d.ts +1 -0
  32. package/components/Dropdown/composables/useDropdownSelection.js +46 -31
  33. package/components/FilePicker/FilePicker.vue.js +93 -90
  34. package/components/Form/CustomFields.vue.js +2 -2
  35. package/components/Form/Form.vue.js +2 -2
  36. package/components/Form/Form.vue2.js +68 -64
  37. package/components/Form/FormField.vue.js +204 -148
  38. package/components/Form/FormFields.vue.js +2 -2
  39. package/components/Form/FormFields.vue2.js +28 -27
  40. package/components/Form/types.d.ts +2 -2
  41. package/components/Form/utils/form.utils.d.ts +3 -3
  42. package/components/Form/utils/form.utils.js +37 -37
  43. package/components/Input.vue.js +64 -62
  44. package/components/Invoice/Invoice.vue.js +9 -7
  45. package/components/Invoice/InvoiceTotals.vue.d.ts +14 -0
  46. package/components/Invoice/InvoiceTotals.vue.js +86 -0
  47. package/components/Invoice/InvoiceTotals.vue2.js +4 -0
  48. package/components/Invoice/InvoiceVariant1.vue.d.ts +3 -1
  49. package/components/Invoice/InvoiceVariant1.vue.js +194 -207
  50. package/components/Invoice/InvoiceVariant2.vue.d.ts +3 -1
  51. package/components/Invoice/InvoiceVariant2.vue.js +109 -118
  52. package/components/Invoice/InvoiceVariant3.vue.d.ts +3 -1
  53. package/components/Invoice/InvoiceVariant3.vue.js +157 -167
  54. package/components/Invoice/InvoiceVariant4.vue.d.ts +3 -1
  55. package/components/Invoice/InvoiceVariant4.vue.js +192 -202
  56. package/components/Invoice/index.d.ts +1 -0
  57. package/components/Invoice/types.d.ts +22 -0
  58. package/components/Masonry/Masonry.vue.d.ts +1 -1
  59. package/components/Modal.vue.js +1 -1
  60. package/components/Modal.vue2.js +60 -54
  61. package/components/MultiSelect/MultiSelect.vue.js +47 -46
  62. package/components/MultiSelect/composables/useMultiSelectHydration.d.ts +2 -0
  63. package/components/NavbarCommandPalette.vue.js +1 -1
  64. package/components/NumberInput.vue.js +2 -2
  65. package/components/NumberInput.vue2.js +121 -116
  66. package/components/PricingPlan/PricingPlan.vue.d.ts +1 -1
  67. package/components/SidePanel.vue.js +2 -2
  68. package/components/SidePanel.vue2.js +58 -52
  69. package/components/Stats/StatItem.vue.js +96 -91
  70. package/components/Stats/types.d.ts +1 -0
  71. package/components/Switch.vue.d.ts +6 -1
  72. package/components/Switch.vue.js +61 -24
  73. package/components/TagInput/TagInput.vue.d.ts +187 -0
  74. package/components/TagInput/TagInput.vue.js +113 -0
  75. package/components/TagInput/TagInput.vue2.js +4 -0
  76. package/components/TagInput/index.d.ts +1 -0
  77. package/components/Textarea.vue.js +19 -18
  78. package/components/ThumbnailSelector/ThumbnailSelector.vue.js +2 -2
  79. package/components/ThumbnailSelector/ThumbnailSelector.vue2.js +19 -16
  80. package/core/config.d.ts +36 -0
  81. package/index.d.ts +2 -0
  82. package/index.js +130 -124
  83. package/package.json +1 -1
  84. package/style.css +616 -1
  85. package/types/button.d.ts +1 -1
  86. package/types/styles.d.ts +1 -0
  87. package/utils/functions.js +9 -9
@@ -1,5 +1,5 @@
1
- import { defineComponent as F, ref as b, watch as L, computed as u, openBlock as d, createBlock as m, unref as v, withCtx as D, createElementVNode as i, createElementBlock as w, Fragment as T, renderList as z, createCommentVNode as B, createVNode as h, normalizeClass as y, toDisplayString as x, createTextVNode as E } from "vue";
2
- import $ from "./Dropdown/Dropdown.vue.js";
1
+ import { defineComponent as $, ref as b, watch as F, computed as u, openBlock as d, createBlock as m, unref as v, withCtx as D, createElementVNode as i, createElementBlock as w, Fragment as L, renderList as T, createCommentVNode as z, createVNode as h, normalizeClass as y, toDisplayString as x, createTextVNode as B } from "vue";
2
+ import E from "./Dropdown/Dropdown.vue.js";
3
3
  import R from "./Icon.vue.js";
4
4
  import { $t as l } from "../utils/i18n.js";
5
5
  /* empty css */
@@ -10,7 +10,7 @@ import "v-datepicker-lite/style.css";
10
10
  const j = { class: "flex items-center justify-start gap-2 w-full" }, H = { class: "flex flex-col sm:flex-row bg-background rounded-md" }, Q = {
11
11
  key: 0,
12
12
  class: "flex flex-col gap-1 sm:pr-3 py-2 sm:border-r border-border max-h-[280px]"
13
- }, O = { class: "flex flex-col sm:flex-row items-center gap-4 py-2 p-3" }, I = { class: "border border-border rounded-md overflow-hidden bg-background" }, U = { class: "flex items-center justify-center shrink-0" }, q = { class: "border border-border rounded-md overflow-hidden bg-background" }, te = /* @__PURE__ */ F({
13
+ }, O = { class: "flex flex-col sm:flex-row items-center gap-4 py-2 p-3" }, I = { class: "border border-border rounded-md overflow-hidden bg-background" }, U = { class: "flex items-center justify-center shrink-0" }, q = { class: "border border-border rounded-md overflow-hidden bg-background" }, te = /* @__PURE__ */ $({
14
14
  __name: "DateRangePicker",
15
15
  props: {
16
16
  modelValue: {},
@@ -28,7 +28,7 @@ const j = { class: "flex items-center justify-start gap-2 w-full" }, H = { class
28
28
  emits: ["update:modelValue", "change"],
29
29
  setup(s, { emit: M }) {
30
30
  const g = s, k = M, o = b(!1), c = b(0);
31
- L(o, (a) => {
31
+ F(o, (a) => {
32
32
  a && c.value++;
33
33
  });
34
34
  const n = u({
@@ -46,13 +46,13 @@ const j = { class: "flex items-center justify-start gap-2 w-full" }, H = { class
46
46
  n.value = { ...n.value, startDate: a };
47
47
  }, S = (a) => {
48
48
  n.value = { ...n.value, endDate: a };
49
- }, _ = u(() => {
49
+ }, C = u(() => {
50
50
  if (n.value.endDate) {
51
51
  const a = new Date(n.value.endDate);
52
52
  if (!isNaN(a.getTime())) return a.toISOString();
53
53
  }
54
54
  return g.maxDate;
55
- }), C = u(() => {
55
+ }), N = u(() => {
56
56
  if (n.value.startDate) {
57
57
  const a = new Date(n.value.startDate);
58
58
  if (!isNaN(a.getTime())) return a.toISOString();
@@ -66,7 +66,7 @@ const j = { class: "flex items-center justify-start gap-2 w-full" }, H = { class
66
66
  } catch {
67
67
  return "";
68
68
  }
69
- }, N = u(() => [
69
+ }, V = u(() => [
70
70
  {
71
71
  label: l("vlite.dateRangePicker.today") !== "vlite.dateRangePicker.today" ? l("vlite.dateRangePicker.today") : "Today",
72
72
  value: "today",
@@ -112,7 +112,7 @@ const j = { class: "flex items-center justify-start gap-2 w-full" }, H = { class
112
112
  value: "last_year",
113
113
  icon: "lucide:history"
114
114
  }
115
- ]), V = (a) => {
115
+ ]), _ = (a) => {
116
116
  const e = /* @__PURE__ */ new Date();
117
117
  let t = /* @__PURE__ */ new Date(), r = /* @__PURE__ */ new Date();
118
118
  switch (e.setHours(0, 0, 0, 0), t.setHours(0, 0, 0, 0), r.setHours(0, 0, 0, 0), a.value) {
@@ -146,7 +146,7 @@ const j = { class: "flex items-center justify-start gap-2 w-full" }, H = { class
146
146
  }
147
147
  n.value = { startDate: t, endDate: r }, c.value++, o.value = !1;
148
148
  };
149
- return (a, e) => (d(), m(v($), {
149
+ return (a, e) => (d(), m(v(E), {
150
150
  isOpen: o.value,
151
151
  "onUpdate:isOpen": e[0] || (e[0] = (t) => o.value = t),
152
152
  position: "bottom-start",
@@ -160,36 +160,37 @@ const j = { class: "flex items-center justify-start gap-2 w-full" }, H = { class
160
160
  variant: s.variant || "outline",
161
161
  size: s.size || "md",
162
162
  disabled: s.disabled,
163
- class: y(["w-full justify-between text-left font-normal", [s.triggerClass, { "ring-1 ring-ring ring-offset-[1]": t }]])
163
+ class: y(["w-full justify-between text-left font-normal", [s.triggerClass, { "ring-1 ring-ring ring-offset-[1]": t }]]),
164
+ "data-testid": a.$attrs["data-testid"] || (a.$attrs.name ? `daterange-${a.$attrs.name}` : "daterange")
164
165
  }, {
165
166
  default: D(() => [
166
167
  i("div", j, [
167
168
  i("span", {
168
169
  class: y({ "text-muted-foreground": !n.value.startDate })
169
170
  }, x(n.value.startDate ? f(n.value.startDate) : s.placeholderStart), 3),
170
- e[1] || (e[1] = E(" — ", -1)),
171
+ e[1] || (e[1] = B(" — ", -1)),
171
172
  i("span", {
172
173
  class: y({ "text-muted-foreground": !n.value.endDate })
173
174
  }, x(n.value.endDate ? f(n.value.endDate) : s.placeholderEnd), 3)
174
175
  ])
175
176
  ]),
176
177
  _: 1
177
- }, 8, ["variant", "size", "disabled", "class"])
178
+ }, 8, ["variant", "size", "disabled", "class", "data-testid"])
178
179
  ]),
179
180
  menu: D(() => [
180
181
  i("div", H, [
181
182
  s.showQuickRanges ? (d(), w("div", Q, [
182
183
  e[2] || (e[2] = i("div", { class: "text-xs pl-2 pb-2 font-semibold text-muted-foreground uppercase tracking-wider" }, " Quick Ranges ", -1)),
183
- (d(!0), w(T, null, z(N.value, (t) => (d(), m(P, {
184
+ (d(!0), w(L, null, T(V.value, (t) => (d(), m(P, {
184
185
  key: t.value,
185
186
  text: t.label,
186
187
  icon: t.icon,
187
188
  variant: "ghost",
188
189
  size: "sm",
189
190
  class: "justify-start w-full font-normal",
190
- onClick: (r) => V(t)
191
+ onClick: (r) => _(t)
191
192
  }, null, 8, ["text", "icon", "onClick"]))), 128))
192
- ])) : B("", !0),
193
+ ])) : z("", !0),
193
194
  i("div", O, [
194
195
  i("div", I, [
195
196
  (d(), m(v(p), {
@@ -197,7 +198,7 @@ const j = { class: "flex items-center justify-start gap-2 w-full" }, H = { class
197
198
  value: n.value.startDate,
198
199
  onChange: Y,
199
200
  mode: "date",
200
- "max-date": _.value,
201
+ "max-date": C.value,
201
202
  "min-date": s.minDate,
202
203
  disabled: s.disabled,
203
204
  class: "min-w-[270px]",
@@ -220,7 +221,7 @@ const j = { class: "flex items-center justify-start gap-2 w-full" }, H = { class
220
221
  value: n.value.endDate,
221
222
  onChange: S,
222
223
  mode: "date",
223
- "min-date": C.value,
224
+ "min-date": N.value,
224
225
  "max-date": s.maxDate,
225
226
  class: "min-w-[270px]",
226
227
  disabled: s.disabled,
@@ -22,6 +22,7 @@ type __VLS_Props = {
22
22
  nestedPosition?: TooltTipPlacement;
23
23
  nestedOffset?: [number, number];
24
24
  showSelectedLabel?: boolean;
25
+ showSelectedIcon?: boolean;
25
26
  selectable?: boolean;
26
27
  doubleConfirmation?: boolean;
27
28
  layout?: 'default' | 'grouped';
@@ -42,6 +43,7 @@ declare function __VLS_template(): {
42
43
  slots: {
43
44
  trigger?(_: {
44
45
  selectedLabel: string;
46
+ selectedIcon: string;
45
47
  isOpen: boolean;
46
48
  }): any;
47
49
  default?(_: {}): any;
@@ -104,6 +106,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
104
106
  isOpen: boolean;
105
107
  teleport: boolean;
106
108
  showSelectedLabel: boolean;
109
+ showSelectedIcon: boolean;
107
110
  doubleConfirmation: boolean;
108
111
  isNested: boolean;
109
112
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
@@ -1,16 +1,16 @@
1
- import { defineComponent as ne, ref as i, computed as c, inject as oe, onMounted as ae, onUnmounted as ie, watch as P, provide as V, reactive as se, toRefs as re, openBlock as x, createElementBlock as R, normalizeStyle as de, createVNode as M, unref as g, withCtx as f, renderSlot as m, createCommentVNode as z, createBlock as ue, normalizeClass as ce, createSlots as fe, normalizeProps as E, guardReactiveProps as j } from "vue";
2
- import me from "v-tooltip-lite";
1
+ import { defineComponent as oe, ref as i, computed as f, inject as ae, onMounted as ie, onUnmounted as se, watch as P, provide as R, reactive as re, toRefs as de, openBlock as x, createElementBlock as z, normalizeStyle as ue, createVNode as M, unref as u, withCtx as m, renderSlot as v, createCommentVNode as E, createBlock as ce, normalizeClass as fe, createSlots as me, normalizeProps as j, guardReactiveProps as U } from "vue";
2
+ import ve from "v-tooltip-lite";
3
3
  import "v-tooltip-lite/style.css";
4
- import ve from "./DropdownMenu.vue.js";
5
- import he from "./DropdownTrigger.vue.js";
4
+ import he from "./DropdownMenu.vue.js";
5
+ import ge from "./DropdownTrigger.vue.js";
6
6
  import pe from "../ConfirmationModal.vue.js";
7
- import { useDropdownIds as ge } from "./composables/useDropdownIds.js";
8
- import { useDropdownSelection as ye } from "./composables/useDropdownSelection.js";
9
- import { useDropdownHydration as be } from "./composables/useDropdownHydration.js";
10
- const Ce = {
7
+ import { useDropdownIds as ye } from "./composables/useDropdownIds.js";
8
+ import { useDropdownSelection as be } from "./composables/useDropdownSelection.js";
9
+ import { useDropdownHydration as Ce } from "./composables/useDropdownHydration.js";
10
+ const Oe = {
11
11
  key: 0,
12
12
  tabindex: "0"
13
- }, Me = /* @__PURE__ */ ne({
13
+ }, Ne = /* @__PURE__ */ oe({
14
14
  __name: "Dropdown",
15
15
  props: {
16
16
  selected: {},
@@ -34,6 +34,7 @@ const Ce = {
34
34
  nestedPosition: {},
35
35
  nestedOffset: {},
36
36
  showSelectedLabel: { type: Boolean, default: !0 },
37
+ showSelectedIcon: { type: Boolean, default: !1 },
37
38
  selectable: { type: Boolean, default: !0 },
38
39
  doubleConfirmation: { type: Boolean, default: !1 },
39
40
  layout: { default: "default" },
@@ -50,22 +51,22 @@ const Ce = {
50
51
  disabled: { type: Boolean, default: !1 }
51
52
  },
52
53
  emits: ["onSelect", "update:modelValue", "onOpen", "onClose", "update:isOpen", "load-more", "search"],
53
- setup(l, { emit: U }) {
54
- const o = l, v = U, y = i(!1), h = i(null), r = i({
54
+ setup(t, { emit: q }) {
55
+ const o = t, h = q, y = i(!1), g = i(null), r = i({
55
56
  title: "Confirm Selection",
56
57
  description: "Are you sure you want to select this option?",
57
58
  confirmText: "Confirm",
58
59
  cancelText: "Cancel",
59
60
  variant: "primary"
60
- }), q = c(() => o.position ? o.position : o.direction === "rtl" ? "bottom-end" : "bottom-start"), F = c(() => o.nestedPosition ? o.nestedPosition : o.direction === "rtl" ? "left-start" : "right-start"), b = i(o.isOpen || !1), C = i(0), G = `dropdown-${Math.random().toString(36).substring(2, 9)}`, $ = c(() => o.menuId || G), p = i([]), s = oe("dropdown-context", null), J = (e) => {
61
+ }), F = f(() => o.position ? o.position : o.direction === "rtl" ? "bottom-end" : "bottom-start"), G = f(() => o.nestedPosition ? o.nestedPosition : o.direction === "rtl" ? "left-start" : "right-start"), b = i(o.isOpen || !1), C = i(0), J = `dropdown-${Math.random().toString(36).substring(2, 9)}`, w = f(() => o.menuId || J), p = i([]), s = ae("dropdown-context", null), K = (e) => {
61
62
  p.value.includes(e) || p.value.push(e), s?.registerChildId?.(e);
62
- }, K = (e) => {
63
+ }, Q = (e) => {
63
64
  p.value = p.value.filter((n) => n !== e), s?.unregisterChildId?.(e);
64
65
  };
65
- ae(() => {
66
- s?.registerChildId && s.registerChildId(`#${$.value}`);
67
- }), ie(() => {
68
- s?.unregisterChildId && s.unregisterChildId(`#${$.value}`);
66
+ ie(() => {
67
+ s?.registerChildId && s.registerChildId(`#${w.value}`);
68
+ }), se(() => {
69
+ s?.unregisterChildId && s.unregisterChildId(`#${w.value}`);
69
70
  }), P(
70
71
  () => o.isOpen,
71
72
  (e) => {
@@ -77,71 +78,71 @@ const Ce = {
77
78
  );
78
79
  const N = (e) => {
79
80
  if (o.disabled) {
80
- b.value = !1, v("update:isOpen", !1);
81
+ b.value = !1, h("update:isOpen", !1);
81
82
  return;
82
83
  }
83
- b.value = e, v("update:isOpen", e), v(e ? "onOpen" : "onClose"), s?.onChildToggle?.(e);
84
+ b.value = e, h("update:isOpen", e), h(e ? "onOpen" : "onClose"), s?.onChildToggle?.(e);
84
85
  }, O = () => {
85
86
  N(!1);
86
- }, Q = (e) => {
87
+ }, W = (e) => {
87
88
  e ? C.value++ : C.value = Math.max(0, C.value - 1);
88
89
  };
89
- V("dropdown-context", {
90
+ R("dropdown-context", {
90
91
  close: O,
91
92
  onChildToggle: (e) => {
92
- Q(e), s?.onChildToggle?.(e);
93
+ W(e), s?.onChildToggle?.(e);
93
94
  },
94
- registerChildId: J,
95
- unregisterChildId: K
96
- }), V("modal-context", null);
97
- const w = c(() => o.options ? o.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), S = i([]), A = i(!1), k = i(!1);
95
+ registerChildId: K,
96
+ unregisterChildId: Q
97
+ }), R("modal-context", null);
98
+ const I = f(() => o.options ? o.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), S = i([]), A = i(!1), $ = i(!1);
98
99
  P(
99
- w,
100
+ I,
100
101
  (e) => {
101
102
  if (e) {
102
103
  if (o.remote) {
103
104
  const n = [...S.value];
104
- e.forEach((t) => {
105
- n.some((a) => a.value !== void 0 && t.value !== void 0 ? typeof a.value == "object" && a.key && t.key ? a.key === t.key && a.value[a.key] === t.value[t.key] : a.value === t.value : a.label === t.label) || n.push(t);
105
+ e.forEach((l) => {
106
+ n.some((a) => a.value !== void 0 && l.value !== void 0 ? typeof a.value == "object" && a.key && l.key ? a.key === l.key && a.value[a.key] === l.value[l.key] : a.value === l.value : a.label === l.label) || n.push(l);
106
107
  }), S.value = n;
107
108
  } else
108
109
  S.value = e;
109
110
  !A.value && e.length > 0 && (A.value = !0, setTimeout(() => {
110
- k.value = !0, H(T.value);
111
+ $.value = !0, H(T.value);
111
112
  }, 10));
112
113
  }
113
114
  },
114
115
  { immediate: !0 }
115
116
  );
116
- const u = c(() => {
117
- const e = [...S.value], n = new Set(e.map((t) => t.value ?? t.label));
118
- return I.value.forEach((t, d) => {
119
- n.has(d) || (e.unshift(t), n.add(d));
117
+ const c = f(() => {
118
+ const e = [...S.value], n = new Set(e.map((l) => l.value ?? l.label));
119
+ return k.value.forEach((l, d) => {
120
+ n.has(d) || (e.unshift(l), n.add(d));
120
121
  }), e;
121
- }), { selectedBuffer: I, isHydrating: W, hydrateSelected: H } = be({
122
+ }), { selectedBuffer: k, isHydrating: X, hydrateSelected: H } = Ce({
122
123
  fetchSelected: o.fetchSelected,
123
- getAvailableOptions: () => u.value,
124
- isReady: () => k.value
125
- }), { getAllRecursiveIds: X } = ge(), Y = se({
126
- ...re(o),
127
- options: u
128
- }), { currentValue: T, selectedLabel: D, selectOption: Z } = ye(
129
- Y,
130
- v
131
- ), _ = c(() => {
132
- const e = o.ignoreClickOutside || [], n = X(u.value);
124
+ getAvailableOptions: () => c.value,
125
+ isReady: () => $.value
126
+ }), { getAllRecursiveIds: Y } = ye(), Z = re({
127
+ ...de(o),
128
+ options: c
129
+ }), { currentValue: T, selectedLabel: D, selectedIcon: L, selectOption: _ } = be(
130
+ Z,
131
+ h
132
+ ), ee = f(() => {
133
+ const e = o.ignoreClickOutside || [], n = Y(c.value);
133
134
  return [.../* @__PURE__ */ new Set([...e, ...n, ...p.value])];
134
135
  });
135
136
  P(
136
137
  () => T.value,
137
138
  (e) => {
138
- k.value && H(e);
139
+ $.value && H(e);
139
140
  },
140
141
  { deep: !0 }
141
142
  );
142
- const ee = (e) => {
143
+ const te = (e) => {
143
144
  if (o.disabled || e.disabled) return;
144
- o.doubleConfirmation || !!e.confirmation ? (h.value = e, typeof e.confirmation == "object" ? r.value = {
145
+ o.doubleConfirmation || !!e.confirmation ? (g.value = e, typeof e.confirmation == "object" ? r.value = {
145
146
  title: e.confirmation.title || "Confirm Selection",
146
147
  description: e.confirmation.description || "Are you sure you want to select this option?",
147
148
  confirmText: e.confirmation.confirmText || "Confirm",
@@ -153,120 +154,121 @@ const Ce = {
153
154
  confirmText: "Confirm",
154
155
  cancelText: "Cancel",
155
156
  variant: "primary"
156
- }, y.value = !0, O()) : (L(e), o.closeOnSelect && O());
157
- }, L = (e) => {
157
+ }, y.value = !0, O()) : (V(e), o.closeOnSelect && O());
158
+ }, V = (e) => {
158
159
  if (o.disabled || e.disabled) return;
159
160
  const n = e.value ?? e.label;
160
- I.value.has(n) || I.value.set(n, e);
161
- const t = Z(e);
161
+ k.value.has(n) || k.value.set(n, e);
162
+ const l = _(e);
162
163
  if (!o.isNested) {
163
164
  const d = e._originalOption || e, a = d.value ?? d.label;
164
165
  (e._path || [d]).forEach((B) => {
165
166
  typeof B.onSelect == "function" && B.onSelect({
166
167
  value: a,
167
168
  option: B,
168
- data: u.value || [],
169
- values: t
169
+ data: c.value || [],
170
+ values: l
170
171
  });
171
172
  });
172
173
  }
173
- }, te = () => {
174
- h.value && (L(h.value), h.value = null, y.value = !1);
175
174
  }, le = () => {
176
- h.value = null, y.value = !1;
175
+ g.value && (V(g.value), g.value = null, y.value = !1);
176
+ }, ne = () => {
177
+ g.value = null, y.value = !1;
177
178
  };
178
- return (e, n) => (x(), R("div", {
179
+ return (e, n) => (x(), z("div", {
179
180
  class: "relative inline-block text-left",
180
- style: de({ direction: l.direction })
181
+ style: ue({ direction: t.direction })
181
182
  }, [
182
- M(g(me), {
183
+ M(u(ve), {
183
184
  content: "",
184
185
  trigger: "click",
185
186
  arrow: !1,
186
- teleport: l.teleport,
187
- offset: l.offset,
188
- placement: q.value,
187
+ teleport: t.teleport,
188
+ offset: t.offset,
189
+ placement: F.value,
189
190
  isOpen: b.value,
190
191
  keepAlive: C.value > 0,
191
- menuId: $.value,
192
- ignoreClickOutside: _.value,
192
+ menuId: w.value,
193
+ ignoreClickOutside: ee.value,
193
194
  class: "w-full",
194
- className: "dropdown " + (l.className || ""),
195
- onOnShow: n[2] || (n[2] = (t) => e.$emit("onOpen")),
196
- onOnHide: n[3] || (n[3] = (t) => e.$emit("onClose")),
195
+ className: "dropdown " + (t.className || ""),
196
+ onOnShow: n[2] || (n[2] = (l) => e.$emit("onOpen")),
197
+ onOnHide: n[3] || (n[3] = (l) => e.$emit("onClose")),
197
198
  "onUpdate:isOpen": N,
198
199
  triggerClass: "w-full",
199
200
  styles: { padding: "0" }
200
201
  }, {
201
- trigger: f(({ isOpen: t }) => [
202
- m(e.$slots, "trigger", E(j({ selectedLabel: g(D), isOpen: t })), () => [
203
- M(he, {
204
- "selected-label": g(D),
205
- "is-open": t,
206
- direction: l.direction,
207
- disabled: l.disabled,
208
- triggerProps: l.triggerProps,
202
+ trigger: m(({ isOpen: l }) => [
203
+ v(e.$slots, "trigger", j(U({ selectedLabel: u(D), selectedIcon: t.showSelectedIcon ? u(L) : void 0, isOpen: l })), () => [
204
+ M(ge, {
205
+ "selected-label": u(D),
206
+ "selected-icon": t.showSelectedIcon ? u(L) : void 0,
207
+ "is-open": l,
208
+ direction: t.direction,
209
+ disabled: t.disabled,
210
+ triggerProps: t.triggerProps,
209
211
  class: "w-full"
210
- }, null, 8, ["selected-label", "is-open", "direction", "disabled", "triggerProps"])
212
+ }, null, 8, ["selected-label", "selected-icon", "is-open", "direction", "disabled", "triggerProps"])
211
213
  ])
212
214
  ]),
213
- default: f(() => [
214
- e.$slots?.default ? (x(), R("span", Ce, [
215
- m(e.$slots, "default")
216
- ])) : z("", !0),
217
- !l.disabled && (w.value.length || u.value.length || e.$slots.menu || e.$slots.item || l.remote || l.searchable) ? (x(), ue(ve, {
215
+ default: m(() => [
216
+ e.$slots?.default ? (x(), z("span", Oe, [
217
+ v(e.$slots, "default")
218
+ ])) : E("", !0),
219
+ !t.disabled && (I.value.length || c.value.length || e.$slots.menu || e.$slots.item || t.remote || t.searchable) ? (x(), ce(he, {
218
220
  key: 1,
219
- options: w.value,
220
- cachedOptions: u.value,
221
- class: ce(l.className),
222
- selected: g(T),
223
- selectedIndex: l.selectedIndex,
224
- maxHeight: l.maxHeight,
225
- nestedPosition: F.value,
226
- nestedOffset: l.nestedOffset,
227
- selectable: l.selectable,
228
- direction: l.direction,
229
- layout: l.layout,
230
- columns: l.columns,
231
- loading: l.loading || g(W),
232
- hasMore: l.hasMore,
233
- searchable: l.searchable,
234
- remote: l.remote,
235
- debounceTime: l.debounceTime,
236
- onSelect: ee,
221
+ options: I.value,
222
+ cachedOptions: c.value,
223
+ class: fe(t.className),
224
+ selected: u(T),
225
+ selectedIndex: t.selectedIndex,
226
+ maxHeight: t.maxHeight,
227
+ nestedPosition: G.value,
228
+ nestedOffset: t.nestedOffset,
229
+ selectable: t.selectable,
230
+ direction: t.direction,
231
+ layout: t.layout,
232
+ columns: t.columns,
233
+ loading: t.loading || u(X),
234
+ hasMore: t.hasMore,
235
+ searchable: t.searchable,
236
+ remote: t.remote,
237
+ debounceTime: t.debounceTime,
238
+ onSelect: te,
237
239
  onClose: O,
238
- onLoadMore: n[0] || (n[0] = (t) => e.$emit("load-more")),
239
- onSearch: n[1] || (n[1] = (t) => e.$emit("search", t))
240
- }, fe({ _: 2 }, [
240
+ onLoadMore: n[0] || (n[0] = (l) => e.$emit("load-more")),
241
+ onSearch: n[1] || (n[1] = (l) => e.$emit("search", l))
242
+ }, me({ _: 2 }, [
241
243
  e.$slots.menu ? {
242
244
  name: "menu",
243
- fn: f(() => [
244
- m(e.$slots, "menu")
245
+ fn: m(() => [
246
+ v(e.$slots, "menu")
245
247
  ]),
246
248
  key: "0"
247
249
  } : void 0,
248
250
  e.$slots.item ? {
249
251
  name: "item",
250
- fn: f((t) => [
251
- m(e.$slots, "item", E(j(t)))
252
+ fn: m((l) => [
253
+ v(e.$slots, "item", j(U(l)))
252
254
  ]),
253
255
  key: "1"
254
256
  } : void 0,
255
257
  e.$slots.header ? {
256
258
  name: "header",
257
- fn: f(() => [
258
- m(e.$slots, "header")
259
+ fn: m(() => [
260
+ v(e.$slots, "header")
259
261
  ]),
260
262
  key: "2"
261
263
  } : void 0,
262
264
  e.$slots.footer ? {
263
265
  name: "footer",
264
- fn: f(() => [
265
- m(e.$slots, "footer")
266
+ fn: m(() => [
267
+ v(e.$slots, "footer")
266
268
  ]),
267
269
  key: "3"
268
270
  } : void 0
269
- ]), 1032, ["options", "cachedOptions", "class", "selected", "selectedIndex", "maxHeight", "nestedPosition", "nestedOffset", "selectable", "direction", "layout", "columns", "loading", "hasMore", "searchable", "remote", "debounceTime"])) : z("", !0)
271
+ ]), 1032, ["options", "cachedOptions", "class", "selected", "selectedIndex", "maxHeight", "nestedPosition", "nestedOffset", "selectable", "direction", "layout", "columns", "loading", "hasMore", "searchable", "remote", "debounceTime"])) : E("", !0)
270
272
  ]),
271
273
  _: 3
272
274
  }, 8, ["teleport", "offset", "placement", "isOpen", "keepAlive", "menuId", "ignoreClickOutside", "className"]),
@@ -277,12 +279,12 @@ const Ce = {
277
279
  "confirm-text": r.value.confirmText,
278
280
  "cancel-text": r.value.cancelText,
279
281
  variant: r.value.variant,
280
- onConfirm: te,
281
- onCancel: le
282
+ onConfirm: le,
283
+ onCancel: ne
282
284
  }, null, 8, ["show", "title", "description", "confirm-text", "cancel-text", "variant"])
283
285
  ], 4));
284
286
  }
285
287
  });
286
288
  export {
287
- Me as default
289
+ Ne as default
288
290
  };
@@ -1,8 +1,8 @@
1
- import { defineComponent as r, computed as d, openBlock as a, createElementBlock as u, withModifiers as p, normalizeClass as f, createElementVNode as l, createBlock as g, createCommentVNode as v, toDisplayString as h, createVNode as x } from "vue";
2
- import b from "../Switch.vue.js";
1
+ import { defineComponent as m, computed as d, openBlock as a, createElementBlock as u, withModifiers as p, normalizeClass as f, createElementVNode as l, createBlock as g, createCommentVNode as h, toDisplayString as v, createVNode as b } from "vue";
2
+ import x from "../Switch.vue.js";
3
3
  import y from "../Icon.vue.js";
4
4
  import { $t as k } from "../../utils/i18n.js";
5
- const w = { class: "flex items-center gap-2 flex-1 min-w-0" }, B = { class: "truncate font-medium" }, N = /* @__PURE__ */ r({
5
+ const w = ["data-testid"], B = { class: "flex items-center gap-2 flex-1 min-w-0" }, $ = { class: "truncate font-medium" }, z = /* @__PURE__ */ m({
6
6
  __name: "DropdownBooleanItem",
7
7
  props: {
8
8
  option: {},
@@ -11,36 +11,37 @@ const w = { class: "flex items-center gap-2 flex-1 min-w-0" }, B = { class: "tru
11
11
  },
12
12
  emits: ["change"],
13
13
  setup(e, { emit: c }) {
14
- const o = e, s = c, m = d(
14
+ const o = e, s = c, r = d(
15
15
  () => o.option.labelI18n ? k(o.option.labelI18n) : o.option.label
16
- ), t = (n) => {
17
- s("change", n, o.option);
16
+ ), n = (t) => {
17
+ s("change", t, o.option);
18
18
  };
19
- return (n, i) => (a(), u("div", {
19
+ return (t, i) => (a(), u("div", {
20
20
  tabindex: "0",
21
21
  "data-dropdown-item": "",
22
22
  class: f(["relative flex cursor-pointer select-none items-center justify-between rounded-sm px-2 py-1.5 text-sm outline-none transition-colors", [
23
23
  e.focused ? "bg-accent text-accent-foreground" : "hover:bg-accent hover:text-accent-foreground"
24
24
  ]]),
25
- onClick: i[0] || (i[0] = p((j) => t(!e.value), ["stop"]))
25
+ "data-testid": t.$attrs["data-testid"] || `dropdown-item-bool-${e.option.key || e.option.label}`.toLowerCase().replace(/[^a-z0-9]+/g, "-"),
26
+ onClick: i[0] || (i[0] = p((j) => n(!e.value), ["stop"]))
26
27
  }, [
27
- l("div", w, [
28
+ l("div", B, [
28
29
  e.option.icon || e.option.emoji ? (a(), g(y, {
29
30
  key: 0,
30
31
  icon: e.option.icon,
31
32
  emoji: e.option.emoji,
32
33
  class: "h-4 w-4 shrink-0 opacity-70"
33
- }, null, 8, ["icon", "emoji"])) : v("", !0),
34
- l("span", B, h(m.value), 1)
34
+ }, null, 8, ["icon", "emoji"])) : h("", !0),
35
+ l("span", $, v(r.value), 1)
35
36
  ]),
36
- x(b, {
37
+ b(x, {
37
38
  "model-value": e.value,
38
39
  class: "ml-3 shrink-0 scale-75 origin-right",
39
- "onUpdate:modelValue": t
40
+ "onUpdate:modelValue": n
40
41
  }, null, 8, ["model-value"])
41
- ], 2));
42
+ ], 10, w));
42
43
  }
43
44
  });
44
45
  export {
45
- N as default
46
+ z as default
46
47
  };