vlite3 1.1.2 → 1.1.5

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 (149) hide show
  1. package/README.md +5 -0
  2. package/components/AttachmentsList/AttachmentsList.vue.d.ts +1 -1
  3. package/components/AttachmentsList/AttachmentsList.vue.js +237 -163
  4. package/components/Avatar.vue.js +1 -1
  5. package/components/AvatarUploader/AvatarUploader.vue.js +40 -37
  6. package/components/Button.vue.js +30 -28
  7. package/components/Carousel/Carousel.vue.d.ts +2 -2
  8. package/components/CategoryManager/CategoryManager.vue.d.ts +10 -2
  9. package/components/CategoryManager/CategoryManager.vue.js +138 -119
  10. package/components/CategoryManager/CategoryNode.vue.d.ts +2 -0
  11. package/components/CategoryManager/CategoryNode.vue.js +93 -88
  12. package/components/Chart/BarChart.vue.d.ts +48 -0
  13. package/components/Chart/CircleChart.vue.d.ts +47 -0
  14. package/components/Chart/LineChart.vue.d.ts +55 -0
  15. package/components/Chart/PieChart.vue.d.ts +49 -0
  16. package/components/Chart/index.d.ts +5 -0
  17. package/components/Chart/types.d.ts +135 -0
  18. package/components/Chart/utils.d.ts +40 -0
  19. package/components/Chat/ChatBubble.vue.js +22 -22
  20. package/components/CheckBox.vue.js +29 -28
  21. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  22. package/components/ColorPicker/ColorPicker.vue.js +2 -2
  23. package/components/Comment/CommentEditor.vue.d.ts +41 -0
  24. package/components/Comment/CommentEditor.vue.js +221 -0
  25. package/components/Comment/CommentEditor.vue2.js +4 -0
  26. package/components/Comment/CommentItem.vue.d.ts +70 -0
  27. package/components/Comment/CommentItem.vue.js +7 -0
  28. package/components/Comment/CommentItem.vue2.js +322 -0
  29. package/components/Comment/CommentThread.vue.d.ts +64 -0
  30. package/components/Comment/CommentThread.vue.js +185 -0
  31. package/components/Comment/CommentThread.vue2.js +4 -0
  32. package/components/Comment/index.d.ts +4 -0
  33. package/components/Comment/types.d.ts +34 -0
  34. package/components/ConfirmationModal.vue.js +30 -28
  35. package/components/CopyButton.vue.d.ts +50 -0
  36. package/components/CopyButton.vue.js +69 -0
  37. package/components/CopyButton.vue2.js +4 -0
  38. package/components/DataTable/DataTable.vue.d.ts +2 -4
  39. package/components/DataTable/DataTable.vue.js +184 -235
  40. package/components/DataTable/DataTableHeader.vue.d.ts +2 -0
  41. package/components/DataTable/DataTableHeader.vue.js +24 -23
  42. package/components/DataTable/DataTableRow.vue.d.ts +2 -0
  43. package/components/DataTable/DataTableRow.vue.js +32 -31
  44. package/components/DataTable/types.d.ts +2 -9
  45. package/components/DatePicker.vue.js +41 -35
  46. package/components/DateRangePicker.vue.js +18 -17
  47. package/components/Dropdown/Dropdown.vue.d.ts +5 -0
  48. package/components/Dropdown/Dropdown.vue.js +141 -137
  49. package/components/Dropdown/DropdownBooleanItem.vue.js +16 -15
  50. package/components/Dropdown/DropdownItem.vue.js +21 -20
  51. package/components/Dropdown/DropdownMenu.vue.js +1 -1
  52. package/components/Dropdown/DropdownMenu.vue2.js +13 -12
  53. package/components/Dropdown/DropdownTrigger.vue.d.ts +4 -0
  54. package/components/Dropdown/DropdownTrigger.vue.js +12 -7
  55. package/components/Dropdown/composables/useDropdownHydration.d.ts +2 -0
  56. package/components/Dropdown/composables/useDropdownSelection.d.ts +1 -0
  57. package/components/Dropdown/composables/useDropdownSelection.js +46 -31
  58. package/components/Empty/Empty.vue.js +7 -5
  59. package/components/Empty/index.d.ts +1 -1
  60. package/components/Empty/variants/Variant12.vue.d.ts +22 -0
  61. package/components/Empty/variants/Variant12.vue.js +35 -0
  62. package/components/Empty/variants/Variant12.vue2.js +4 -0
  63. package/components/FilePicker/FilePicker.vue.js +93 -90
  64. package/components/Footer/Footer.vue.d.ts +3 -0
  65. package/components/Footer/Variant1.vue.d.ts +20 -0
  66. package/components/Footer/Variant2.vue.d.ts +20 -0
  67. package/components/Footer/Variant3.vue.d.ts +12 -0
  68. package/components/Footer/index.d.ts +2 -0
  69. package/components/Footer/types.d.ts +73 -0
  70. package/components/Form/CustomFields.vue.d.ts +2 -0
  71. package/components/Form/CustomFields.vue.js +1 -1
  72. package/components/Form/CustomFields.vue2.js +125 -122
  73. package/components/Form/Form.vue.js +2 -2
  74. package/components/Form/Form.vue2.js +68 -64
  75. package/components/Form/FormField.vue.js +205 -149
  76. package/components/Form/FormFields.vue.js +2 -2
  77. package/components/Form/FormFields.vue2.js +28 -27
  78. package/components/Form/types.d.ts +2 -2
  79. package/components/Form/utils/form.utils.d.ts +3 -3
  80. package/components/Form/utils/form.utils.js +37 -37
  81. package/components/Input.vue.js +64 -62
  82. package/components/Invoice/Invoice.vue.js +9 -7
  83. package/components/Invoice/InvoiceTotals.vue.d.ts +14 -0
  84. package/components/Invoice/InvoiceTotals.vue.js +86 -0
  85. package/components/Invoice/InvoiceTotals.vue2.js +4 -0
  86. package/components/Invoice/InvoiceVariant1.vue.d.ts +3 -1
  87. package/components/Invoice/InvoiceVariant1.vue.js +194 -207
  88. package/components/Invoice/InvoiceVariant2.vue.d.ts +3 -1
  89. package/components/Invoice/InvoiceVariant2.vue.js +109 -118
  90. package/components/Invoice/InvoiceVariant3.vue.d.ts +3 -1
  91. package/components/Invoice/InvoiceVariant3.vue.js +157 -167
  92. package/components/Invoice/InvoiceVariant4.vue.d.ts +3 -1
  93. package/components/Invoice/InvoiceVariant4.vue.js +192 -202
  94. package/components/Invoice/index.d.ts +1 -0
  95. package/components/Invoice/types.d.ts +22 -0
  96. package/components/Masonry/Masonry.vue.d.ts +1 -1
  97. package/components/Modal.vue.js +1 -1
  98. package/components/Modal.vue2.js +60 -54
  99. package/components/MultiSelect/MultiSelect.vue.d.ts +2 -0
  100. package/components/MultiSelect/MultiSelect.vue.js +92 -90
  101. package/components/MultiSelect/composables/useMultiSelectHydration.d.ts +2 -0
  102. package/components/NumberInput.vue.js +2 -2
  103. package/components/NumberInput.vue2.js +127 -121
  104. package/components/PricingPlan/PricingPlan.vue.d.ts +1 -1
  105. package/components/RichTextEditor/RichTextLinkPopover.vue.d.ts +26 -0
  106. package/components/RichTextEditor/RichTextReader.vue.d.ts +7 -0
  107. package/components/RichTextEditor/RichTextToolbar.vue.d.ts +24 -0
  108. package/components/RichTextEditor/composables/useRichTextImageUpload.d.ts +14 -0
  109. package/components/RichTextEditor/composables/useRichTextLinks.d.ts +32 -0
  110. package/components/RichTextEditor/index.d.ts +2 -0
  111. package/components/Screen/Screen.vue.js +45 -46
  112. package/components/Screen/ScreenFilter.vue.js +1 -1
  113. package/components/SidePanel.vue.js +2 -2
  114. package/components/SidePanel.vue2.js +58 -52
  115. package/components/SidebarMenu/SidebarMenu.vue.d.ts +1 -1
  116. package/components/SidebarMenu/SidebarMenu.vue.js +192 -91
  117. package/components/SidebarMenu/SidebarMenu.vue3.js +5 -0
  118. package/components/SidebarMenu/SidebarMenuItem.vue.js +170 -157
  119. package/components/SidebarMenu/types.d.ts +12 -3
  120. package/components/{DataTable/DataTableToolbar.vue.d.ts → Splitter/Splitter.vue.d.ts} +18 -15
  121. package/components/Splitter/Splitter.vue.js +64 -0
  122. package/components/Splitter/Splitter.vue2.js +4 -0
  123. package/components/Splitter/index.d.ts +1 -0
  124. package/components/Stats/StatItem.vue.js +96 -91
  125. package/components/Stats/types.d.ts +1 -0
  126. package/components/StatusChip/status-map.js +34 -2
  127. package/components/Switch.vue.d.ts +6 -1
  128. package/components/Switch.vue.js +61 -24
  129. package/components/TagInput/TagInput.vue.d.ts +187 -0
  130. package/components/TagInput/TagInput.vue.js +113 -0
  131. package/components/TagInput/TagInput.vue2.js +4 -0
  132. package/components/TagInput/index.d.ts +1 -0
  133. package/components/Textarea.vue.js +19 -18
  134. package/components/ThumbnailSelector/ThumbnailSelector.vue.js +2 -2
  135. package/components/ThumbnailSelector/ThumbnailSelector.vue2.js +19 -16
  136. package/components/index.d.ts +4 -0
  137. package/core/config.d.ts +54 -0
  138. package/index.d.ts +4 -0
  139. package/index.js +300 -285
  140. package/package.json +1 -1
  141. package/style.css +657 -6
  142. package/types/button.d.ts +1 -1
  143. package/types/config.type.d.ts +2 -0
  144. package/types/styles.d.ts +1 -0
  145. package/utils/functions.js +9 -9
  146. package/components/DataTable/DataTableToolbar.vue.js +0 -60
  147. package/components/DataTable/DataTableToolbar.vue2.js +0 -4
  148. package/components/SidebarMenu/SidebarMenu.vue2.js +0 -4
  149. /package/components/ColorPicker/{ColorIro.vue2.js → ColorIro.vue.js} +0 -0
@@ -1,14 +1,14 @@
1
- import { defineComponent as P, ref as c, inject as R, computed as h, markRaw as V, watch as T, provide as W, nextTick as K, onMounted as A, onUnmounted as U, openBlock as s, createElementBlock as r, Fragment as q, mergeProps as B, withModifiers as I, renderSlot as m, createCommentVNode as a, createBlock as S, Teleport as G, normalizeClass as i, createElementVNode as b, toDisplayString as F, createVNode as H, resolveDynamicComponent as J } from "vue";
2
- import L from "./Button.vue.js";
1
+ import { defineComponent as P, ref as f, inject as R, computed as h, markRaw as V, watch as T, provide as W, nextTick as K, onMounted as L, onUnmounted as A, openBlock as s, createElementBlock as d, Fragment as U, mergeProps as B, withModifiers as S, renderSlot as v, createCommentVNode as n, createBlock as I, Teleport as q, normalizeClass as i, createElementVNode as b, toDisplayString as z, createVNode as G, resolveDynamicComponent as H } from "vue";
2
+ import J from "./Button.vue.js";
3
3
  import { useKeyStroke as Q } from "../composables/useKeyStroke.js";
4
- import { $t as O } from "../utils/i18n.js";
5
- const X = {
4
+ import { $t as F } from "../utils/i18n.js";
5
+ const X = ["data-testid"], Y = ["data-testid"], Z = {
6
6
  key: 0,
7
7
  class: "flex-none flex flex-col space-y-1.5 pb-0 border-b border-border/90"
8
- }, Y = { class: "text-lg font-semibold leading-none tracking-tight" }, Z = {
8
+ }, _ = { class: "text-lg font-semibold leading-none tracking-tight" }, ee = {
9
9
  key: 0,
10
10
  class: "text-sm text-muted-foreground mb-3.5"
11
- }, le = /* @__PURE__ */ P({
11
+ }, ae = /* @__PURE__ */ P({
12
12
  inheritAttrs: !1,
13
13
  __name: "Modal",
14
14
  props: {
@@ -28,107 +28,113 @@ const X = {
28
28
  bodyProps: {}
29
29
  },
30
30
  emits: ["close", "update:show", "onOpen"],
31
- setup(t, { emit: j }) {
32
- const o = t, d = j, l = c(o.show), g = c(!1), v = c(!1), k = c(null);
33
- let u = null;
34
- const y = c(!1), n = R("dropdown-context", null), C = h(() => o.body ? V(o.body) : void 0);
31
+ setup(t, { emit: O }) {
32
+ const o = t, u = O, l = f(o.show), k = f(!1), g = f(!1), C = f(null);
33
+ let c = null;
34
+ const y = f(!1), a = R("dropdown-context", null), w = h(() => o.body ? V(o.body) : void 0);
35
35
  T(
36
36
  () => o.show,
37
37
  (e) => {
38
- l.value = e, e && (d("onOpen"), n?.close());
38
+ l.value = e, e && (u("onOpen"), a?.close());
39
39
  }
40
40
  );
41
- const z = () => {
42
- l.value = !0, n?.close();
41
+ const j = () => {
42
+ l.value = !0, a?.close();
43
43
  }, D = (e) => {
44
- g.value = e;
44
+ k.value = e;
45
45
  }, E = (e) => {
46
46
  y.value = e;
47
- }, f = () => {
48
- if (g.value) {
49
- v.value = !0, u && clearTimeout(u), u = setTimeout(() => {
50
- v.value = !1;
47
+ }, m = () => {
48
+ if (k.value) {
49
+ g.value = !0, c && clearTimeout(c), c = setTimeout(() => {
50
+ g.value = !1;
51
51
  }, 1e3);
52
52
  return;
53
53
  }
54
- l.value = !1, d("update:show", !1), d("close");
54
+ l.value = !1, u("update:show", !1), u("close");
55
55
  }, p = () => {
56
- l.value = !1, d("update:show", !1), d("close");
56
+ l.value = !1, u("update:show", !1), u("close");
57
57
  };
58
- W("modal-context", { close: f, setSubmitting: D, registerFormFooter: E });
58
+ W("modal-context", { close: m, setSubmitting: D, registerFormFooter: E });
59
59
  const M = () => {
60
- o.closeOutside && f();
60
+ o.closeOutside && m();
61
61
  }, { onKeyStroke: N } = Q();
62
- N("Escape", f), T(l, async (e) => {
63
- e ? (n?.onChildToggle?.(!0), document.body.style.overflow = "hidden", await K(), k.value?.focus()) : (document.body.style.overflow = "", n?.onChildToggle?.(!1), y.value = !1);
62
+ N("Escape", m), T(l, async (e) => {
63
+ e ? (a?.onChildToggle?.(!0), document.body.style.overflow = "hidden", await K(), C.value?.focus()) : (document.body.style.overflow = "", a?.onChildToggle?.(!1), y.value = !1);
64
+ }), L(() => {
65
+ l.value && a?.onChildToggle?.(!0);
64
66
  }), A(() => {
65
- l.value && n?.onChildToggle?.(!0);
66
- }), U(() => {
67
- l.value && n?.onChildToggle?.(!1), document.body.style.overflow = "", u && clearTimeout(u);
67
+ l.value && a?.onChildToggle?.(!1), document.body.style.overflow = "", c && clearTimeout(c);
68
68
  });
69
- const x = h(() => o.titleI18n ? O(o.titleI18n) : o.title), w = h(
70
- () => o.descriptionI18n ? O(o.descriptionI18n) : o.description
69
+ const r = h(() => o.titleI18n ? F(o.titleI18n) : o.title), x = h(
70
+ () => o.descriptionI18n ? F(o.descriptionI18n) : o.description
71
71
  );
72
- return (e, $) => (s(), r(q, null, [
73
- e.$slots?.trigger || e.$slots?.default ? (s(), r("span", B({
72
+ return (e, $) => (s(), d(U, null, [
73
+ e.$slots?.trigger || e.$slots?.default ? (s(), d("span", B({
74
74
  key: 0,
75
- onClick: I(z, ["stop"]),
75
+ onClick: S(j, ["stop"]),
76
76
  class: `${t.triggerClass}`
77
- }, e.$attrs), [
78
- m(e.$slots, "trigger", {}, () => [
79
- t.body ? m(e.$slots, "default", { key: 0 }, void 0, !0) : a("", !0)
77
+ }, e.$attrs, {
78
+ "data-testid": e.$attrs["data-testid"] ? `${e.$attrs["data-testid"]}-trigger` : r.value ? `modal-trigger-${r.value.toString().toLowerCase().replace(/[^a-z0-9]+/g, "-")}` : "modal-trigger"
79
+ }), [
80
+ v(e.$slots, "trigger", {}, () => [
81
+ t.body ? v(e.$slots, "default", { key: 0 }, void 0, !0) : n("", !0)
80
82
  ], !0)
81
- ], 16)) : a("", !0),
82
- (s(), S(G, { to: "body" }, [
83
- l.value ? (s(), r("div", {
83
+ ], 16, X)) : n("", !0),
84
+ (s(), I(q, { to: "body" }, [
85
+ l.value ? (s(), d("div", {
84
86
  key: 0,
85
87
  class: i(["fixed inset-0 z-50 flex items-center justify-center p-4 v-modal-overlay", t.backdrop ? "v-modal-backdrop" : ""]),
86
88
  onClick: M
87
89
  }, [
88
90
  b("div", {
89
91
  ref_key: "modalRef",
90
- ref: k,
92
+ ref: C,
91
93
  tabindex: "-1",
94
+ role: "dialog",
95
+ "aria-modal": "true",
92
96
  class: i(["modal-body relative w-full rounded border border-border/60 bg-body shadow-lg text-foreground flex flex-col max-h-[85vh] sm:max-h-[90vh] focus:outline-none", [t.maxWidth]]),
93
- onClick: $[0] || ($[0] = I(() => {
97
+ "data-testid": e.$attrs["data-testid"] || (r.value ? `modal-${r.value.toString().toLowerCase().replace(/[^a-z0-9]+/g, "-")}` : "modal"),
98
+ onClick: $[0] || ($[0] = S(() => {
94
99
  }, ["stop"]))
95
100
  }, [
96
- x.value ? (s(), r("div", X, [
101
+ r.value ? (s(), d("div", Z, [
97
102
  b("div", {
98
103
  class: i(["flex items-center justify-between py-2 px-4 rounded-t-md", t.headerClass])
99
104
  }, [
100
- b("h3", Y, F(x.value), 1),
101
- H(L, {
105
+ b("h3", _, z(r.value), 1),
106
+ G(J, {
102
107
  rounded: "full",
103
108
  size: "sm",
104
109
  icon: "lucide:x",
105
110
  variant: "ghost",
106
- class: i(["hover:bg-gray-250/25!", { "blink-bg": v.value }]),
107
- onClick: f
111
+ class: i(["hover:bg-gray-250/25!", { "blink-bg": g.value }]),
112
+ "data-testid": "modal-close-btn",
113
+ onClick: m
108
114
  }, null, 8, ["class"])
109
115
  ], 2)
110
- ])) : a("", !0),
116
+ ])) : n("", !0),
111
117
  b("div", {
112
118
  class: i(["flex-1 overflow-y-auto px-4 pt-4 min-h-0 scrollbar-thin scrollbar-stable", [y.value ? "pb-0" : "pb-3.5", t.bodyClass]])
113
119
  }, [
114
- w.value ? (s(), r("p", Z, F(w.value), 1)) : a("", !0),
115
- C.value ? (s(), S(J(C.value), B({ key: 1 }, { ...t.bodyProps, ...e.$attrs }, { close: p }), null, 16)) : m(e.$slots, "default", {
120
+ x.value ? (s(), d("p", ee, z(x.value), 1)) : n("", !0),
121
+ w.value ? (s(), I(H(w.value), B({ key: 1 }, { ...t.bodyProps, ...e.$attrs }, { close: p }), null, 16)) : v(e.$slots, "default", {
116
122
  key: 2,
117
123
  close: p
118
124
  }, void 0, !0)
119
125
  ], 2),
120
- e.$slots.footer ? (s(), r("div", {
126
+ e.$slots.footer ? (s(), d("div", {
121
127
  key: 1,
122
128
  class: i([t.footerClass, "flex-none flex items-center px-4 py-3 border-t border-border/75 rounded-b-xl bg-body"])
123
129
  }, [
124
- m(e.$slots, "footer", { close: p }, void 0, !0)
125
- ], 2)) : a("", !0)
126
- ], 2)
127
- ], 2)) : a("", !0)
130
+ v(e.$slots, "footer", { close: p }, void 0, !0)
131
+ ], 2)) : n("", !0)
132
+ ], 10, Y)
133
+ ], 2)) : n("", !0)
128
134
  ]))
129
135
  ], 64));
130
136
  }
131
137
  });
132
138
  export {
133
- le as default
139
+ ae as default
134
140
  };
@@ -5,6 +5,7 @@ interface Props {
5
5
  placeholder?: string;
6
6
  placeholderI18n?: string;
7
7
  disabled?: boolean;
8
+ readonly?: boolean;
8
9
  searchable?: boolean;
9
10
  variant?: 'default' | 'outline' | 'solid' | 'floating' | string;
10
11
  size?: 'sm' | 'md' | 'lg';
@@ -34,6 +35,7 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
34
35
  size: "sm" | "md" | "lg";
35
36
  rounded: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | string;
36
37
  loading: boolean;
38
+ readonly: boolean;
37
39
  disabled: boolean;
38
40
  modelValue: any[];
39
41
  options: (IDropdownOption | string | number)[];
@@ -1,11 +1,11 @@
1
- import { defineComponent as P, ref as k, computed as s, watch as M, openBlock as r, createBlock as m, unref as h, withCtx as p, createCommentVNode as f, createElementVNode as g, withKeys as I, withModifiers as y, normalizeClass as c, createElementBlock as v, toDisplayString as S, Fragment as T, renderList as R, createVNode as L, createTextVNode as U } from "vue";
2
- import C from "../Icon.vue.js";
1
+ import { defineComponent as P, ref as k, computed as d, watch as M, openBlock as r, createBlock as f, unref as h, withCtx as g, createCommentVNode as m, createElementVNode as y, withKeys as I, withModifiers as p, normalizeClass as c, createElementBlock as v, toDisplayString as $, Fragment as T, renderList as R, createVNode as L, createTextVNode as U } from "vue";
2
+ import S from "../Icon.vue.js";
3
3
  import q from "../Dropdown/Dropdown.vue.js";
4
4
  import G from "../Dropdown/DropdownMenu.vue.js";
5
- import { $t as $ } from "../../utils/i18n.js";
5
+ import { $t as C } from "../../utils/i18n.js";
6
6
  import N from "../Badge.vue.js";
7
7
  import { useMultiSelectHydration as J } from "./composables/useMultiSelectHydration.js";
8
- const Q = ["tabindex"], W = {
8
+ const Q = ["tabindex", "data-testid"], W = {
9
9
  key: 0,
10
10
  class: "text-muted-foreground pl-0.5 truncate"
11
11
  }, X = { class: "truncate min-w-0" }, Y = ["onClick"], Z = {
@@ -19,6 +19,7 @@ const Q = ["tabindex"], W = {
19
19
  placeholder: {},
20
20
  placeholderI18n: {},
21
21
  disabled: { type: Boolean, default: !1 },
22
+ readonly: { type: Boolean, default: !1 },
22
23
  searchable: { type: Boolean, default: !0 },
23
24
  variant: { default: "outline" },
24
25
  size: { default: "md" },
@@ -34,28 +35,28 @@ const Q = ["tabindex"], W = {
34
35
  rounded: { default: "md" }
35
36
  },
36
37
  emits: ["update:modelValue", "change", "load-more", "search"],
37
- setup(l, { emit: j }) {
38
- const e = l, i = j, o = k(!1), D = s(() => {
39
- if (e.placeholderI18n) return $(e.placeholderI18n);
38
+ setup(t, { emit: j }) {
39
+ const e = t, i = j, o = k(!1), D = d(() => {
40
+ if (e.placeholderI18n) return C(e.placeholderI18n);
40
41
  if (e.placeholder) return e.placeholder;
41
- const t = $("vlite.multiSelect.placeholder");
42
- return t !== "vlite.multiSelect.placeholder" ? t : "Select items...";
43
- }), x = s(() => e.options ? e.options.map((t) => typeof t == "string" || typeof t == "number" ? { label: String(t), value: String(t) } : t) : []), B = k(!1), w = k(!1);
42
+ const a = C("vlite.multiSelect.placeholder");
43
+ return a !== "vlite.multiSelect.placeholder" ? a : "Select items...";
44
+ }), x = d(() => e.options ? e.options.map((a) => typeof a == "string" || typeof a == "number" ? { label: String(a), value: String(a) } : a) : []), B = k(!1), w = k(!1);
44
45
  M(
45
46
  x,
46
- (t) => {
47
- !B.value && t.length > 0 && (B.value = !0, setTimeout(() => {
48
- w.value = !0, d.hydrateSelected(e.modelValue || []);
47
+ (a) => {
48
+ !B.value && a.length > 0 && (B.value = !0, setTimeout(() => {
49
+ w.value = !0, s.hydrateSelected(e.modelValue || []);
49
50
  }, 10));
50
51
  },
51
52
  { immediate: !0 }
52
53
  );
53
- const V = s(() => {
54
- const t = [...x.value], a = new Set(t.map((n) => n.value ?? n.label));
55
- return d.selectedBuffer.value.forEach((n, u) => {
56
- a.has(u) || (t.unshift(n), a.add(u));
57
- }), t;
58
- }), d = J({
54
+ const V = d(() => {
55
+ const a = [...x.value], n = new Set(a.map((l) => l.value ?? l.label));
56
+ return s.selectedBuffer.value.forEach((l, u) => {
57
+ n.has(u) || (a.unshift(l), n.add(u));
58
+ }), a;
59
+ }), s = J({
59
60
  fetchSelected: e.fetchSelected,
60
61
  getValues: () => e.modelValue || [],
61
62
  getOptions: () => V.value,
@@ -63,77 +64,78 @@ const Q = ["tabindex"], W = {
63
64
  });
64
65
  M(
65
66
  () => e.modelValue,
66
- (t) => {
67
- w.value && d.hydrateSelected(t || []);
67
+ (a) => {
68
+ w.value && s.hydrateSelected(a || []);
68
69
  },
69
70
  { deep: !0 }
70
71
  );
71
- const b = s(() => V.value.filter((t) => {
72
- const a = t.value ?? t.label;
73
- return e.modelValue.includes(a);
74
- })), E = s(() => b.value.slice(0, e.maxVisible)), O = s(() => b.value.length - e.maxVisible), H = (t) => {
75
- if (e.disabled) return;
76
- const a = t.value ?? t.label;
77
- d.selectedBuffer.value.has(a) || d.selectedBuffer.value.set(a, t);
78
- const n = [...e.modelValue], u = n.indexOf(a);
79
- u === -1 ? n.push(a) : n.splice(u, 1), i("update:modelValue", n), i("change", n);
80
- }, K = (t) => {
81
- if (e.disabled) return;
82
- const a = e.modelValue.filter((n) => n !== t);
83
- i("update:modelValue", a), i("change", a);
72
+ const b = d(() => V.value.filter((a) => {
73
+ const n = a.value ?? a.label;
74
+ return e.modelValue.includes(n);
75
+ })), E = d(() => b.value.slice(0, e.maxVisible)), O = d(() => b.value.length - e.maxVisible), H = (a) => {
76
+ if (e.disabled || e.readonly) return;
77
+ const n = a.value ?? a.label;
78
+ s.selectedBuffer.value.has(n) || s.selectedBuffer.value.set(n, a);
79
+ const l = [...e.modelValue], u = l.indexOf(n);
80
+ u === -1 ? l.push(n) : l.splice(u, 1), i("update:modelValue", l), i("change", l);
81
+ }, K = (a) => {
82
+ if (e.disabled || e.readonly) return;
83
+ const n = e.modelValue.filter((l) => l !== a);
84
+ i("update:modelValue", n), i("change", n);
84
85
  }, A = () => {
85
- e.disabled || (i("update:modelValue", []), i("change", []));
86
- }, F = s(() => {
87
- const t = e.rounded === "none" ? "rounded-none" : `rounded-${e.rounded}`, a = e.variant === "transparent" ? "px-2 py-0" : "px-3 py-1.5", n = e.variant === "transparent" ? "h-full min-h-[40px]" : "min-h-[40px]";
86
+ e.disabled || e.readonly || (i("update:modelValue", []), i("change", []));
87
+ }, F = d(() => {
88
+ const a = e.rounded === "none" ? "rounded-none" : `rounded-${e.rounded}`, n = e.variant === "transparent" ? "px-2 py-0" : "px-3 py-1.5", l = e.variant === "transparent" ? "h-full min-h-[40px]" : "min-h-[40px]";
88
89
  return [
89
- `flex items-center justify-between w-full ${a} ${n} ${t} border text-sm transition-colors cursor-pointer outline-none`,
90
- e.disabled ? "opacity-50 cursor-not-allowed bg-muted" : e.variant === "floating" || e.variant === "transparent" ? "bg-transparent text-foreground" : "bg-background hover:bg-gray-50/70",
90
+ `flex items-center justify-between w-full ${n} ${l} ${a} border text-sm transition-colors outline-none`,
91
+ e.disabled ? "opacity-50 cursor-not-allowed bg-muted" : e.readonly ? `cursor-default ${e.variant === "transparent" || e.variant === "floating" ? "bg-transparent text-foreground" : "bg-background"}` : `cursor-pointer ${e.variant === "floating" || e.variant === "transparent" ? "bg-transparent text-foreground" : "bg-background hover:bg-gray-50/70"}`,
91
92
  e.variant === "outline" || e.variant === "floating" ? "border-input focus-visible:ring-1 focus-visible:ring-primary" : e.variant === "transparent" ? "border-transparent" : "border-transparent bg-muted",
92
93
  o.value && e.variant !== "transparent" ? "border-primary/20 ring-1 ring-primary/20" : ""
93
94
  ].join(" ");
94
- }), z = s(() => e.size === "sm" ? "xs" : "sm");
95
- return (t, a) => (r(), m(h(q), {
95
+ }), z = d(() => e.size === "sm" ? "xs" : "sm");
96
+ return (a, n) => (r(), f(h(q), {
96
97
  isOpen: o.value,
97
- "onUpdate:isOpen": a[5] || (a[5] = (n) => o.value = n),
98
+ "onUpdate:isOpen": n[5] || (n[5] = (l) => o.value = l),
98
99
  "close-on-select": !1,
99
100
  selectable: !0,
100
- disabled: l.disabled
101
+ disabled: t.disabled || t.readonly
101
102
  }, {
102
- trigger: p(() => [
103
- g("div", {
103
+ trigger: g(() => [
104
+ y("div", {
104
105
  class: c(F.value),
105
- tabindex: l.disabled ? -1 : 0,
106
+ tabindex: t.disabled || t.readonly ? -1 : 0,
106
107
  onKeydown: [
107
- a[0] || (a[0] = I(y((n) => !l.disabled && (o.value = !o.value), ["prevent"]), ["enter"])),
108
- a[1] || (a[1] = I(y((n) => !l.disabled && (o.value = !o.value), ["prevent"]), ["space"]))
109
- ]
108
+ n[0] || (n[0] = I(p((l) => !(t.disabled || t.readonly) && (o.value = !o.value), ["prevent"]), ["enter"])),
109
+ n[1] || (n[1] = I(p((l) => !(t.disabled || t.readonly) && (o.value = !o.value), ["prevent"]), ["space"]))
110
+ ],
111
+ "data-testid": a.$attrs["data-testid"] || (a.$attrs.name ? `multiselect-${a.$attrs.name}` : "multiselect")
110
112
  }, [
111
- g("div", {
112
- class: c(["flex gap-1.5 items-center flex-1 min-w-0", [l.wrap ? "flex-wrap py-0.5" : "flex-nowrap overflow-hidden py-1"]])
113
+ y("div", {
114
+ class: c(["flex gap-1.5 items-center flex-1 min-w-0", [t.wrap ? "flex-wrap py-0.5" : "flex-nowrap overflow-hidden py-1"]])
113
115
  }, [
114
- b.value.length === 0 ? (r(), v("span", W, S(D.value), 1)) : (r(), v(T, { key: 1 }, [
115
- (r(!0), v(T, null, R(E.value, (n) => (r(), m(N, {
116
- key: n.value,
117
- variant: l.variant === "transparent" ? "outline" : "secondary",
116
+ b.value.length === 0 ? (r(), v("span", W, $(D.value), 1)) : (r(), v(T, { key: 1 }, [
117
+ (r(!0), v(T, null, R(E.value, (l) => (r(), f(N, {
118
+ key: l.value,
119
+ variant: t.variant === "transparent" ? "outline" : "secondary",
118
120
  size: z.value,
119
- rounded: l.rounded === "none" ? "sm" : "full",
121
+ rounded: t.rounded === "none" ? "sm" : "full",
120
122
  class: c(["gap-1 pr-1 truncate min-w-0 shrink", [
121
- l.wrap ? "max-w-[150px]" : "",
122
- l.variant === "transparent" ? "border-transparent bg-muted/50 text-foreground font-medium shadow-none" : ""
123
+ t.wrap ? "max-w-[150px]" : "",
124
+ t.variant === "transparent" ? "border-transparent bg-muted/50 text-foreground font-medium shadow-none" : ""
123
125
  ]])
124
126
  }, {
125
- default: p(() => [
126
- g("span", X, S(n.labelI18n ? h($)(n.labelI18n) : n.label), 1),
127
- l.disabled ? f("", !0) : (r(), v("button", {
127
+ default: g(() => [
128
+ y("span", X, $(l.labelI18n ? h(C)(l.labelI18n) : l.label), 1),
129
+ t.disabled || t.readonly ? m("", !0) : (r(), v("button", {
128
130
  key: 0,
129
131
  type: "button",
130
- onClick: y((u) => K(n.value), ["stop"]),
132
+ onClick: p((u) => K(l.value), ["stop"]),
131
133
  class: c([
132
134
  "rounded transition-colors shrink-0 flex items-center justify-center p-px",
133
- l.variant === "transparent" ? "text-muted-foreground hover:bg-black/10 hover:text-foreground" : "hover:bg-destructive/10 hover:text-destructive p-0.5 rounded-full"
135
+ t.variant === "transparent" ? "text-muted-foreground hover:bg-black/10 hover:text-foreground" : "hover:bg-destructive/10 hover:text-destructive p-0.5 rounded-full"
134
136
  ])
135
137
  }, [
136
- L(C, {
138
+ L(S, {
137
139
  icon: "lucide:x",
138
140
  class: "w-3 h-3"
139
141
  })
@@ -141,55 +143,55 @@ const Q = ["tabindex"], W = {
141
143
  ]),
142
144
  _: 2
143
145
  }, 1032, ["variant", "size", "rounded", "class"]))), 128)),
144
- O.value > 0 ? (r(), m(N, {
146
+ O.value > 0 ? (r(), f(N, {
145
147
  key: 0,
146
- variant: l.variant === "transparent" ? "outline" : "secondary",
148
+ variant: t.variant === "transparent" ? "outline" : "secondary",
147
149
  size: z.value,
148
- rounded: l.rounded === "none" ? "sm" : "full",
150
+ rounded: t.rounded === "none" ? "sm" : "full",
149
151
  class: c([
150
152
  "shrink-0",
151
- l.variant === "transparent" ? "border-transparent bg-muted/50 text-muted-foreground font-medium shadow-none" : ""
153
+ t.variant === "transparent" ? "border-transparent bg-muted/50 text-muted-foreground font-medium shadow-none" : ""
152
154
  ])
153
155
  }, {
154
- default: p(() => [
155
- U(" +" + S(O.value), 1)
156
+ default: g(() => [
157
+ U(" +" + $(O.value), 1)
156
158
  ]),
157
159
  _: 1
158
- }, 8, ["variant", "size", "rounded", "class"])) : f("", !0)
160
+ }, 8, ["variant", "size", "rounded", "class"])) : m("", !0)
159
161
  ], 64))
160
162
  ], 2),
161
- l.showControls ? (r(), v("div", Z, [
162
- b.value.length > 0 && !l.disabled ? (r(), m(C, {
163
+ t.showControls && !(t.disabled || t.readonly) ? (r(), v("div", Z, [
164
+ b.value.length > 0 && !(t.disabled || t.readonly) ? (r(), f(S, {
163
165
  key: 0,
164
166
  icon: "lucide:x",
165
167
  class: "w-4 h-4 hover:text-foreground transition-colors",
166
- onClick: y(A, ["stop"])
167
- })) : f("", !0),
168
- a[6] || (a[6] = g("div", { class: "w-px h-4 bg-border mx-0.5" }, null, -1)),
169
- L(C, {
168
+ onClick: p(A, ["stop"])
169
+ })) : m("", !0),
170
+ n[6] || (n[6] = y("div", { class: "w-px h-4 bg-border mx-0.5" }, null, -1)),
171
+ L(S, {
170
172
  icon: "lucide:chevron-down",
171
173
  class: c(["w-4 h-4 transition-transform duration-200", { "rotate-180": o.value }])
172
174
  }, null, 8, ["class"])
173
- ])) : f("", !0)
175
+ ])) : m("", !0)
174
176
  ], 42, Q)
175
177
  ]),
176
- default: p(() => [
177
- l.disabled ? f("", !0) : (r(), m(h(G), {
178
+ default: g(() => [
179
+ t.disabled || t.readonly ? m("", !0) : (r(), f(h(G), {
178
180
  key: 0,
179
181
  options: x.value,
180
182
  cachedOptions: V.value,
181
- selected: l.modelValue,
183
+ selected: t.modelValue,
182
184
  class: "min-w-[300px]",
183
- loading: l.loading || h(d).isHydrating.value,
184
- hasMore: l.hasMore,
185
- searchable: l.searchable,
186
- remote: l.remote,
187
- debounceTime: l.debounceTime,
188
- layout: l.layout,
185
+ loading: t.loading || h(s).isHydrating.value,
186
+ hasMore: t.hasMore,
187
+ searchable: t.searchable,
188
+ remote: t.remote,
189
+ debounceTime: t.debounceTime,
190
+ layout: t.layout,
189
191
  onSelect: H,
190
- onClose: a[2] || (a[2] = (n) => o.value = !1),
191
- onLoadMore: a[3] || (a[3] = (n) => t.$emit("load-more")),
192
- onSearch: a[4] || (a[4] = (n) => t.$emit("search", n))
192
+ onClose: n[2] || (n[2] = (l) => o.value = !1),
193
+ onLoadMore: n[3] || (n[3] = (l) => a.$emit("load-more")),
194
+ onSearch: n[4] || (n[4] = (l) => a.$emit("search", l))
193
195
  }, null, 8, ["options", "cachedOptions", "selected", "loading", "hasMore", "searchable", "remote", "debounceTime", "layout"]))
194
196
  ]),
195
197
  _: 1
@@ -19,6 +19,7 @@ export declare function useMultiSelectHydration(opts: UseMultiSelectHydrationOpt
19
19
  description?: string;
20
20
  descriptionI18n?: string;
21
21
  icon?: string;
22
+ badge?: string;
22
23
  emoji?: string;
23
24
  disabled?: {
24
25
  valueOf: () => boolean;
@@ -59,6 +60,7 @@ export declare function useMultiSelectHydration(opts: UseMultiSelectHydrationOpt
59
60
  description?: string;
60
61
  descriptionI18n?: string;
61
62
  icon?: string;
63
+ badge?: string;
62
64
  emoji?: string;
63
65
  disabled?: {
64
66
  valueOf: () => boolean;
@@ -1,7 +1,7 @@
1
1
  import o from "./NumberInput.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-651a2b21"]]);
4
+ const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-cce64dd9"]]);
5
5
  export {
6
- a as default
6
+ c as default
7
7
  };