vlite3 0.4.4 → 0.4.7

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 (109) hide show
  1. package/components/Accordion/AccordionItem.vue.js +33 -32
  2. package/components/Accordion/types.d.ts +2 -0
  3. package/components/Alert.vue.d.ts +2 -0
  4. package/components/Alert.vue.js +38 -36
  5. package/components/AvatarUploader/AvatarUploader.vue.d.ts +1 -1
  6. package/components/AvatarUploader/AvatarUploader.vue.js +25 -24
  7. package/components/Button.vue.d.ts +1 -1
  8. package/components/Button.vue.js +37 -35
  9. package/components/CheckBox.vue.d.ts +1 -0
  10. package/components/CheckBox.vue.js +40 -40
  11. package/components/Chip/Chip.vue.js +55 -55
  12. package/components/Chip/types.d.ts +1 -0
  13. package/components/ChoiceBox/ChoiceBox.vue.d.ts +5 -0
  14. package/components/ChoiceBox/ChoiceBox.vue.js +61 -58
  15. package/components/ColorPicker/ColorPicker.vue.js +3 -2
  16. package/components/ConfirmationModal.vue.d.ts +4 -2
  17. package/components/ConfirmationModal.vue.js +48 -33
  18. package/components/DataList/DataList.vue.d.ts +0 -2
  19. package/components/DataList/DataList.vue.js +39 -35
  20. package/components/DataList/types.d.ts +2 -0
  21. package/components/DataTable/DataTable.vue.d.ts +0 -5
  22. package/components/DataTable/DataTable.vue.js +177 -158
  23. package/components/DataTable/DataTableHeader.vue.js +15 -14
  24. package/components/DataTable/DataTableToolbar.vue.d.ts +1 -1
  25. package/components/DataTable/DataTableToolbar.vue.js +30 -23
  26. package/components/DataTable/types.d.ts +4 -0
  27. package/components/DatePicker.vue.d.ts +1 -0
  28. package/components/DatePicker.vue.js +32 -25
  29. package/components/Dropdown/DropdownBooleanItem.vue.js +18 -17
  30. package/components/Dropdown/DropdownGroupedLayout.vue.js +28 -27
  31. package/components/Dropdown/DropdownItem.vue.js +24 -23
  32. package/components/Dropdown/DropdownMenu.vue.js +100 -91
  33. package/components/Dropdown/composables/useDropdownNavigation.js +24 -23
  34. package/components/Dropdown/composables/useDropdownSelection.js +19 -17
  35. package/components/Empty/Empty.vue.d.ts +2 -2
  36. package/components/Empty/Empty.vue.js +32 -18
  37. package/components/FilePicker/FilePicker.vue.d.ts +3 -1
  38. package/components/FilePicker/FilePicker.vue.js +140 -127
  39. package/components/FileTree/FileTree.vue.js +68 -58
  40. package/components/FileTree/FileTreeNode.vue.js +35 -34
  41. package/components/FileTree/types.d.ts +3 -0
  42. package/components/Form/CustomFields.vue.d.ts +3 -1
  43. package/components/Form/CustomFields.vue.js +2 -2
  44. package/components/Form/CustomFields.vue2.js +92 -80
  45. package/components/Form/Form.vue.d.ts +1 -1
  46. package/components/Form/FormField.vue.d.ts +1 -1
  47. package/components/Form/FormField.vue.js +60 -59
  48. package/components/Form/FormFields.vue.js +2 -2
  49. package/components/Form/FormFields.vue2.js +58 -57
  50. package/components/Form/composables/useForm.js +91 -88
  51. package/components/Form/types.d.ts +4 -0
  52. package/components/Form/utils/form.utils.js +104 -98
  53. package/components/GoogleLogin.vue.d.ts +1 -1
  54. package/components/GoogleLogin.vue.js +39 -32
  55. package/components/Heatmap/Heatmap.vue2.js +3 -2
  56. package/components/IconPicker.vue.d.ts +2 -0
  57. package/components/IconPicker.vue.js +37 -29
  58. package/components/Input.vue.d.ts +1 -1
  59. package/components/Input.vue.js +96 -98
  60. package/components/Kanban/KanbanBoard.vue.js +1 -1
  61. package/components/Kanban/KanbanBoard.vue2.js +55 -54
  62. package/components/Kanban/types.d.ts +1 -0
  63. package/components/Masonry/Masonry.vue2.js +3 -2
  64. package/components/Modal.vue.d.ts +2 -0
  65. package/components/Modal.vue.js +62 -57
  66. package/components/MultiSelect/MultiSelect.vue.d.ts +1 -1
  67. package/components/MultiSelect/MultiSelect.vue.js +61 -54
  68. package/components/Navbar/Navbar.vue.js +46 -46
  69. package/components/Pagination/Pagination.vue.js +116 -97
  70. package/components/PricingPlan/PricingPlanItem.vue.js +60 -47
  71. package/components/PricingPlan/types.d.ts +5 -0
  72. package/components/Screen/Screen.vue.d.ts +0 -4
  73. package/components/Screen/Screen.vue.js +231 -189
  74. package/components/Screen/ScreenFilter.vue.js +73 -63
  75. package/components/Screen/types.d.ts +5 -0
  76. package/components/SidePanel.vue.d.ts +2 -0
  77. package/components/SidePanel.vue.js +140 -5
  78. package/components/SidePanel.vue2.js +2 -135
  79. package/components/SidebarMenu/SidebarMenuItem.vue.js +131 -130
  80. package/components/SidebarMenu/types.d.ts +1 -0
  81. package/components/Slider.vue.d.ts +1 -0
  82. package/components/Slider.vue.js +71 -69
  83. package/components/Switch.vue.d.ts +1 -0
  84. package/components/Switch.vue.js +23 -18
  85. package/components/Tabes/Tabes.vue.js +20 -19
  86. package/components/Tabes/types.d.ts +1 -0
  87. package/components/Textarea.vue.d.ts +1 -0
  88. package/components/Textarea.vue.js +18 -16
  89. package/components/ThemeToggle.vue.js +24 -14
  90. package/components/Timeline.vue.js +68 -82
  91. package/components/ToastNotification.vue.js +2 -2
  92. package/components/Tooltip.vue.d.ts +4 -3
  93. package/components/Tooltip.vue.js +17 -15
  94. package/components/Workbook/Sheet.vue.js +80 -71
  95. package/components/Workbook/WorkbookAddButton.vue.js +14 -10
  96. package/components/Workbook/types.d.ts +1 -0
  97. package/core/config.d.ts +2 -0
  98. package/index.d.ts +1 -0
  99. package/index.js +28 -26
  100. package/package.json +1 -1
  101. package/style.css +1 -2
  102. package/types/button.d.ts +1 -0
  103. package/types/config.type.d.ts +10 -0
  104. package/types/form.type.d.ts +2 -0
  105. package/types/styles.d.ts +3 -0
  106. package/types/timeline.type.d.ts +2 -0
  107. package/utils/i18n.d.ts +8 -0
  108. package/utils/i18n.js +5 -0
  109. package/utils/index.d.ts +1 -0
@@ -1,14 +1,15 @@
1
- import { defineComponent as B, ref as K, watch as U, onMounted as E, openBlock as r, createElementBlock as d, normalizeClass as u, createElementVNode as n, renderSlot as m, unref as t, toDisplayString as f, Fragment as g, renderList as b, createVNode as h, withCtx as L, createCommentVNode as M } from "vue";
2
- import { VueDraggable as V } from "vue-draggable-plus";
3
- import j from "../Spinner/Spinner.vue.js";
4
- import { useKanbanBoard as z } from "./useKanbanBoard.js";
5
- const F = { class: "flex items-center justify-between font-semibold text-foreground" }, H = {
1
+ import { defineComponent as K, ref as U, watch as E, onMounted as L, computed as M, openBlock as r, createElementBlock as d, normalizeClass as u, createElementVNode as n, renderSlot as m, unref as t, toDisplayString as f, Fragment as g, renderList as b, createVNode as h, withCtx as V, createCommentVNode as j } from "vue";
2
+ import { VueDraggable as z } from "vue-draggable-plus";
3
+ import F from "../Spinner/Spinner.vue.js";
4
+ import { useKanbanBoard as H } from "./useKanbanBoard.js";
5
+ import { $t as J } from "../../utils/i18n.js";
6
+ const O = { class: "flex items-center justify-between font-semibold text-foreground" }, T = {
6
7
  key: 0,
7
8
  class: "flex-1 flex flex-col gap-3 min-h-[50px] py-1"
8
- }, J = { class: "bg-body p-3 rounded-md shadow-sm border border-border text-sm" }, O = {
9
+ }, A = { class: "bg-body p-3 rounded-md shadow-sm border border-border text-sm" }, R = {
9
10
  key: 0,
10
11
  class: "py-4 flex justify-center shrink-0"
11
- }, G = /* @__PURE__ */ B({
12
+ }, X = /* @__PURE__ */ K({
12
13
  __name: "KanbanBoard",
13
14
  props: {
14
15
  column: {},
@@ -23,112 +24,112 @@ const F = { class: "flex items-center justify-between font-semibold text-foregro
23
24
  ghostClass: {}
24
25
  },
25
26
  emits: ["change", "update:columnData"],
26
- setup(o, { emit: v }) {
27
- const l = o, i = v, p = K(null), { items: a, isInitialLoading: y, isLoadingMore: x, pageInfo: C, loadInitial: k, loadMore: D } = z(
28
- l.column.id,
29
- l.loadData,
30
- l.columnData
31
- ), w = (e) => {
32
- a.value = e, i("update:columnData", e);
27
+ setup(l, { emit: p }) {
28
+ const o = l, c = p, v = U(null), { items: a, isInitialLoading: y, isLoadingMore: x, pageInfo: C, loadInitial: k, loadMore: D } = H(
29
+ o.column.id,
30
+ o.loadData,
31
+ o.columnData
32
+ ), I = (e) => {
33
+ a.value = e, c("update:columnData", e);
33
34
  };
34
- U(
35
- () => l.columnData,
35
+ E(
36
+ () => o.columnData,
36
37
  (e) => {
37
38
  e && JSON.stringify(e) !== JSON.stringify(a.value) && (a.value = [...e]);
38
39
  },
39
40
  { deep: !0 }
40
- ), E(() => {
41
- l.loadData && (!l.columnData || l.columnData.length === 0) && k();
41
+ ), L(() => {
42
+ o.loadData && (!o.columnData || o.columnData.length === 0) && k();
42
43
  });
43
- const I = (e) => {
44
- const c = e.target;
45
- c.scrollTop + c.clientHeight >= c.scrollHeight - 50 && D();
44
+ const w = (e) => {
45
+ const i = e.target;
46
+ i.scrollTop + i.clientHeight >= i.scrollHeight - 50 && D();
46
47
  }, S = (e) => {
47
- i("change", { type: "add", event: e, columnId: l.column.id });
48
- }, N = (e) => {
49
- i("change", { type: "remove", event: e, columnId: l.column.id });
48
+ c("change", { type: "add", event: e, columnId: o.column.id });
50
49
  }, $ = (e) => {
51
- i("change", { type: "update", event: e, columnId: l.column.id });
52
- };
53
- return (e, c) => (r(), d("div", {
50
+ c("change", { type: "remove", event: e, columnId: o.column.id });
51
+ }, N = (e) => {
52
+ c("change", { type: "update", event: e, columnId: o.column.id });
53
+ }, B = M(() => o.column.titleI18n ? J(o.column.titleI18n) : o.column.title);
54
+ return (e, i) => (r(), d("div", {
54
55
  class: u([
55
56
  "flex flex-col bg-card rounded-lg overflow-hidden shrink-0 border border-border/60",
56
- o.boardClass || "w-80"
57
+ l.boardClass || "w-80"
57
58
  ])
58
59
  }, [
59
60
  n("div", {
60
- class: u(["p-3 border-b border-border/80 ", o.headerClass])
61
+ class: u(["p-3 border-b border-border/80 ", l.headerClass])
61
62
  }, [
62
63
  m(e.$slots, "header", {
63
- column: o.column,
64
+ column: l.column,
64
65
  pageInfo: t(C)
65
66
  }, () => [
66
- n("div", F, [
67
- n("span", null, f(o.column.title), 1)
67
+ n("div", O, [
68
+ n("span", null, f(B.value), 1)
68
69
  ])
69
70
  ], !0)
70
71
  ], 2),
71
72
  n("div", {
72
73
  ref_key: "scrollContainer",
73
- ref: p,
74
- class: u(["flex-1 flex flex-col overflow-y-auto p-3 custom-scrollbar", o.bodyClass]),
75
- onScroll: I
74
+ ref: v,
75
+ class: u(["flex-1 flex flex-col overflow-y-auto p-3 custom-scrollbar", l.bodyClass]),
76
+ onScroll: w
76
77
  }, [
77
- t(y) && t(a).length === 0 ? (r(), d("div", H, [
78
+ t(y) && t(a).length === 0 ? (r(), d("div", T, [
78
79
  (r(), d(g, null, b(3, (s) => n("div", {
79
80
  key: "skeleton-" + s,
80
81
  class: "bg-body p-3 rounded-md shadow-sm border border-border animate-pulse flex flex-col gap-3"
81
- }, [...c[0] || (c[0] = [
82
+ }, [...i[0] || (i[0] = [
82
83
  n("div", { class: "h-4 bg-muted/60 rounded w-2/3" }, null, -1),
83
84
  n("div", { class: "h-3 bg-muted/60 rounded w-1/3" }, null, -1)
84
85
  ])])), 64))
85
86
  ])) : (r(), d(g, { key: 1 }, [
86
87
  m(e.$slots, "prepend-item", {
87
- column: o.column,
88
+ column: l.column,
88
89
  items: t(a)
89
90
  }, void 0, !0),
90
- h(t(V), {
91
+ h(t(z), {
91
92
  "model-value": t(a),
92
- "onUpdate:modelValue": w,
93
- group: o.group,
93
+ "onUpdate:modelValue": I,
94
+ group: l.group,
94
95
  animation: 150,
95
- ghostClass: o.ghostClass || "kanban-ghost",
96
- class: u(["flex-1 flex flex-col gap-2 min-h-[50px] py-1", o.draggableClass]),
96
+ ghostClass: l.ghostClass || "kanban-ghost",
97
+ class: u(["flex-1 flex flex-col gap-2 min-h-[50px] py-1", l.draggableClass]),
97
98
  onAdd: S,
98
- onRemove: N,
99
- onUpdate: $
99
+ onRemove: $,
100
+ onUpdate: N
100
101
  }, {
101
- default: L(() => [
102
+ default: V(() => [
102
103
  (r(!0), d(g, null, b(t(a), (s) => (r(), d("div", {
103
- key: s[o.itemKey || "id"],
104
+ key: s[l.itemKey || "id"],
104
105
  class: "cursor-grab active:cursor-grabbing"
105
106
  }, [
106
107
  m(e.$slots, "item", {
107
108
  item: s,
108
- column: o.column
109
+ column: l.column
109
110
  }, () => [
110
- n("div", J, f(s.title || s.name || s.id), 1)
111
+ n("div", A, f(s.title || s.name || s.id), 1)
111
112
  ], !0)
112
113
  ]))), 128))
113
114
  ]),
114
115
  _: 3
115
116
  }, 8, ["model-value", "group", "ghostClass", "class"]),
116
117
  m(e.$slots, "append-item", {
117
- column: o.column,
118
+ column: l.column,
118
119
  items: t(a)
119
120
  }, void 0, !0),
120
- t(x) ? (r(), d("div", O, [
121
- h(j, {
121
+ t(x) ? (r(), d("div", R, [
122
+ h(F, {
122
123
  size: "sm",
123
124
  variant: "dots",
124
125
  color: "primary"
125
126
  })
126
- ])) : M("", !0)
127
+ ])) : j("", !0)
127
128
  ], 64))
128
129
  ], 34)
129
130
  ], 2));
130
131
  }
131
132
  });
132
133
  export {
133
- G as default
134
+ X as default
134
135
  };
@@ -10,6 +10,7 @@ export interface KanbanLoadDataResult<T = any> {
10
10
  export interface KanbanColumn {
11
11
  id: string | number;
12
12
  title: string;
13
+ titleI18n?: string;
13
14
  [key: string]: any;
14
15
  }
15
16
  export interface KanbanChangeEvent {
@@ -1,7 +1,8 @@
1
1
  import { defineComponent as B, ref as d, computed as m, onMounted as K, onUnmounted as O, openBlock as u, createBlock as w, resolveDynamicComponent as z, normalizeStyle as v, withCtx as C, createElementBlock as c, Fragment as p, renderList as y, renderSlot as S } from "vue";
2
2
  import { MASONRY_BREAKPOINTS as x } from "./types.js";
3
3
  import { debounce as A } from "../../utils/functions.js";
4
- const j = /* @__PURE__ */ B({
4
+ import "../../core/config.js";
5
+ const k = /* @__PURE__ */ B({
5
6
  __name: "Masonry",
6
7
  props: {
7
8
  data: {},
@@ -79,5 +80,5 @@ const j = /* @__PURE__ */ B({
79
80
  }
80
81
  });
81
82
  export {
82
- j as default
83
+ k as default
83
84
  };
@@ -2,10 +2,12 @@ import { Component } from 'vue';
2
2
  interface Props {
3
3
  show?: boolean;
4
4
  title?: string;
5
+ titleI18n?: string;
5
6
  maxWidth?: string;
6
7
  closeOutside?: boolean;
7
8
  backdrop?: boolean;
8
9
  description?: string;
10
+ descriptionI18n?: string;
9
11
  triggerClass?: string;
10
12
  bodyClass?: string;
11
13
  headerClass?: string;
@@ -1,22 +1,25 @@
1
- import { defineComponent as w, ref as $, watch as m, provide as B, onUnmounted as O, openBlock as s, createElementBlock as a, Fragment as S, createElementVNode as r, mergeProps as y, withModifiers as b, renderSlot as i, createCommentVNode as n, createBlock as h, Teleport as z, createVNode as v, Transition as E, withCtx as N, normalizeClass as d, toDisplayString as p, resolveDynamicComponent as P } from "vue";
2
- import V from "./Button.vue.js";
3
- import { useKeyStroke as j } from "../composables/useKeyStroke.js";
4
- const D = {
1
+ import { defineComponent as O, ref as S, watch as b, provide as z, onUnmounted as D, computed as p, openBlock as l, createElementBlock as a, Fragment as E, createElementVNode as n, mergeProps as v, withModifiers as h, renderSlot as c, createCommentVNode as i, createBlock as g, Teleport as N, createVNode as x, Transition as P, withCtx as T, normalizeClass as d, toDisplayString as k, resolveDynamicComponent as V } from "vue";
2
+ import j from "./Button.vue.js";
3
+ import { useKeyStroke as K } from "../composables/useKeyStroke.js";
4
+ import { $t as C } from "../utils/i18n.js";
5
+ const M = {
5
6
  key: 0,
6
7
  class: "flex-none flex flex-col space-y-1.5 pb-0 border-b border-border/90"
7
- }, K = { class: "text-lg font-semibold leading-none tracking-tight" }, M = {
8
+ }, W = { class: "text-lg font-semibold leading-none tracking-tight" }, A = {
8
9
  key: 0,
9
10
  class: "text-sm text-muted-foreground mb-6.5"
10
- }, F = /* @__PURE__ */ w({
11
+ }, H = /* @__PURE__ */ O({
11
12
  inheritAttrs: !1,
12
13
  __name: "Modal",
13
14
  props: {
14
15
  show: { type: Boolean, default: !1 },
15
16
  title: {},
17
+ titleI18n: {},
16
18
  maxWidth: { default: "sm:max-w-lg" },
17
19
  closeOutside: { type: Boolean, default: !0 },
18
20
  backdrop: { type: Boolean, default: !0 },
19
21
  description: {},
22
+ descriptionI18n: {},
20
23
  triggerClass: {},
21
24
  bodyClass: {},
22
25
  headerClass: {},
@@ -25,38 +28,40 @@ const D = {
25
28
  bodyProps: {}
26
29
  },
27
30
  emits: ["close", "update:show", "onOpen"],
28
- setup(e, { emit: g }) {
29
- const c = e, f = g, l = $(c.show);
30
- m(
31
- () => c.show,
32
- (t) => {
33
- l.value = t, t && f("onOpen");
31
+ setup(t, { emit: w }) {
32
+ const o = t, u = w, r = S(o.show);
33
+ b(
34
+ () => o.show,
35
+ (e) => {
36
+ r.value = e, e && u("onOpen");
34
37
  }
35
38
  );
36
- const x = () => {
37
- l.value = !0;
38
- }, o = () => {
39
- l.value = !1, f("update:show", !1), f("close");
39
+ const $ = () => {
40
+ r.value = !0;
41
+ }, s = () => {
42
+ r.value = !1, u("update:show", !1), u("close");
40
43
  };
41
- B("modal-context", { close: o });
42
- const k = () => {
43
- c.closeOutside && o();
44
- }, { onKeyStroke: C } = j();
45
- return C("Escape", o), m(l, (t) => {
46
- t ? document.body.style.overflow = "hidden" : document.body.style.overflow = "";
47
- }), O(() => {
44
+ z("modal-context", { close: s });
45
+ const B = () => {
46
+ o.closeOutside && s();
47
+ }, { onKeyStroke: I } = K();
48
+ I("Escape", s), b(r, (e) => {
49
+ e ? document.body.style.overflow = "hidden" : document.body.style.overflow = "";
50
+ }), D(() => {
48
51
  document.body.style.overflow = "";
49
- }), (t, u) => (s(), a(S, null, [
50
- r("span", y({
51
- onClick: b(x, ["stop"]),
52
- class: `${e.triggerClass}`
53
- }, t.$attrs), [
54
- i(t.$slots, "trigger", {}, () => [
55
- e.body ? i(t.$slots, "default", { key: 0 }) : n("", !0)
52
+ });
53
+ const f = p(() => o.titleI18n ? C(o.titleI18n) : o.title), m = p(() => o.descriptionI18n ? C(o.descriptionI18n) : o.description);
54
+ return (e, y) => (l(), a(E, null, [
55
+ n("span", v({
56
+ onClick: h($, ["stop"]),
57
+ class: `${t.triggerClass}`
58
+ }, e.$attrs), [
59
+ c(e.$slots, "trigger", {}, () => [
60
+ t.body ? c(e.$slots, "default", { key: 0 }) : i("", !0)
56
61
  ])
57
62
  ], 16),
58
- (s(), h(z, { to: "body" }, [
59
- v(E, {
63
+ (l(), g(N, { to: "body" }, [
64
+ x(P, {
60
65
  "enter-active-class": "transition duration-200 ease-out",
61
66
  "enter-from-class": "opacity-0",
62
67
  "enter-to-class": "opacity-100",
@@ -64,49 +69,49 @@ const D = {
64
69
  "leave-from-class": "opacity-100",
65
70
  "leave-to-class": "opacity-0"
66
71
  }, {
67
- default: N(() => [
68
- l.value ? (s(), a("div", {
72
+ default: T(() => [
73
+ r.value ? (l(), a("div", {
69
74
  key: 0,
70
- class: d(["fixed inset-0 z-50 flex items-center justify-center bg-[#00000051] p-4", e.backdrop && "backdrop-blur-[2px]"]),
71
- onClick: k
75
+ class: d(["fixed inset-0 z-50 flex items-center justify-center bg-[#00000051] p-4", t.backdrop && "backdrop-blur-[2px]"]),
76
+ onClick: B
72
77
  }, [
73
- r("div", {
74
- class: d(["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]", [e.maxWidth]]),
75
- onClick: u[0] || (u[0] = b(() => {
78
+ n("div", {
79
+ class: d(["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]", [t.maxWidth]]),
80
+ onClick: y[0] || (y[0] = h(() => {
76
81
  }, ["stop"]))
77
82
  }, [
78
- e.title ? (s(), a("div", D, [
79
- r("div", {
80
- class: d(["flex items-center justify-between py-2 px-4 rounded-t-md", e.headerClass])
83
+ f.value ? (l(), a("div", M, [
84
+ n("div", {
85
+ class: d(["flex items-center justify-between py-2 px-4 rounded-t-md", t.headerClass])
81
86
  }, [
82
- r("h3", K, p(e.title), 1),
83
- v(V, {
87
+ n("h3", W, k(f.value), 1),
88
+ x(j, {
84
89
  rounded: "full",
85
90
  size: "sm",
86
91
  icon: "lucide:x",
87
92
  variant: "ghost",
88
93
  class: "hover:bg-gray-250/25!",
89
- onClick: o
94
+ onClick: s
90
95
  })
91
96
  ], 2)
92
- ])) : n("", !0),
93
- r("div", {
94
- class: d(["flex-1 overflow-y-auto px-4 pt-4 pb-3.5 min-h-0", e.bodyClass])
97
+ ])) : i("", !0),
98
+ n("div", {
99
+ class: d(["flex-1 overflow-y-auto px-4 pt-4 pb-3.5 min-h-0", t.bodyClass])
95
100
  }, [
96
- e.description ? (s(), a("p", M, p(e.description), 1)) : n("", !0),
97
- e.body ? (s(), h(P(e.body), y({ key: 1 }, { ...e.bodyProps, ...t.$attrs }, { close: o }), null, 16)) : i(t.$slots, "default", {
101
+ m.value ? (l(), a("p", A, k(m.value), 1)) : i("", !0),
102
+ t.body ? (l(), g(V(t.body), v({ key: 1 }, { ...t.bodyProps, ...e.$attrs }, { close: s }), null, 16)) : c(e.$slots, "default", {
98
103
  key: 2,
99
- close: o
104
+ close: s
100
105
  })
101
106
  ], 2),
102
- t.$slots.footer ? (s(), a("div", {
107
+ e.$slots.footer ? (l(), a("div", {
103
108
  key: 1,
104
- class: d([e.footerClass, "flex-none flex items-center px-4 py-3 border-t border-border/75 rounded-b-xl bg"])
109
+ class: d([t.footerClass, "flex-none flex items-center px-4 py-3 border-t border-border/75 rounded-b-xl bg-body"])
105
110
  }, [
106
- i(t.$slots, "footer", { close: o })
107
- ], 2)) : n("", !0)
111
+ c(e.$slots, "footer", { close: s })
112
+ ], 2)) : i("", !0)
108
113
  ], 2)
109
- ], 2)) : n("", !0)
114
+ ], 2)) : i("", !0)
110
115
  ]),
111
116
  _: 3
112
117
  })
@@ -115,5 +120,5 @@ const D = {
115
120
  }
116
121
  });
117
122
  export {
118
- F as default
123
+ H as default
119
124
  };
@@ -3,6 +3,7 @@ interface Props {
3
3
  modelValue?: any[];
4
4
  options?: IDropdownOptions;
5
5
  placeholder?: string;
6
+ placeholderI18n?: string;
6
7
  disabled?: boolean;
7
8
  searchable?: boolean;
8
9
  variant?: 'default' | 'outline' | 'solid';
@@ -26,7 +27,6 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
26
27
  }>, {
27
28
  disabled: boolean;
28
29
  size: "sm" | "md" | "lg";
29
- placeholder: string;
30
30
  variant: "default" | "outline" | "solid";
31
31
  modelValue: any[];
32
32
  loading: boolean;
@@ -1,17 +1,19 @@
1
- import { defineComponent as z, ref as j, computed as i, openBlock as n, createBlock as m, unref as y, withCtx as f, createVNode as v, createElementVNode as d, normalizeClass as V, createElementBlock as p, toDisplayString as b, Fragment as w, renderList as E, withModifiers as k, createCommentVNode as g, createTextVNode as L } from "vue";
2
- import h from "../Icon.vue.js";
3
- import A from "../Dropdown/Dropdown.vue.js";
4
- import D from "../Dropdown/DropdownMenu.vue.js";
5
- import C from "../Badge.vue.js";
6
- const F = { class: "flex flex-wrap gap-1.5 items-center flex-1 min-w-0 py-0.5" }, T = {
1
+ import { defineComponent as j, ref as E, computed as i, openBlock as s, createBlock as m, unref as v, withCtx as f, createVNode as h, createElementVNode as d, normalizeClass as w, createElementBlock as p, toDisplayString as b, Fragment as k, renderList as L, withModifiers as C, createCommentVNode as g, createTextVNode as A } from "vue";
2
+ import x from "../Icon.vue.js";
3
+ import D from "../Dropdown/Dropdown.vue.js";
4
+ import F from "../Dropdown/DropdownMenu.vue.js";
5
+ import { $t as y } from "../../utils/i18n.js";
6
+ import $ from "../Badge.vue.js";
7
+ const P = { class: "flex flex-wrap gap-1.5 items-center flex-1 min-w-0 py-0.5" }, T = {
7
8
  key: 0,
8
9
  class: "text-muted-foreground pl-1"
9
- }, U = { class: "truncate" }, q = ["onClick"], G = { class: "flex items-center gap-2 pl-2 shrink-0 text-muted-foreground" }, R = /* @__PURE__ */ z({
10
+ }, U = { class: "truncate" }, q = ["onClick"], G = { class: "flex items-center gap-2 pl-2 shrink-0 text-muted-foreground" }, Y = /* @__PURE__ */ j({
10
11
  __name: "MultiSelect",
11
12
  props: {
12
13
  modelValue: { default: () => [] },
13
14
  options: { default: () => [] },
14
- placeholder: { default: "Select items..." },
15
+ placeholder: {},
16
+ placeholderI18n: {},
15
17
  disabled: { type: Boolean, default: !1 },
16
18
  searchable: { type: Boolean, default: !0 },
17
19
  variant: { default: "outline" },
@@ -23,51 +25,56 @@ const F = { class: "flex flex-wrap gap-1.5 items-center flex-1 min-w-0 py-0.5" }
23
25
  layout: { default: "default" }
24
26
  },
25
27
  emits: ["update:modelValue", "change", "load-more", "search"],
26
- setup(l, { emit: $ }) {
27
- const o = l, s = $, u = j(!1), c = i(() => o.options.filter((a) => {
28
+ setup(o, { emit: S }) {
29
+ const t = o, r = S, u = E(!1), B = i(() => {
30
+ if (t.placeholderI18n) return y(t.placeholderI18n);
31
+ if (t.placeholder) return t.placeholder;
32
+ const a = y("vlite.multiSelect.placeholder");
33
+ return a !== "vlite.multiSelect.placeholder" ? a : "Select items...";
34
+ }), c = i(() => t.options.filter((a) => {
28
35
  const e = a.value ?? a.label;
29
- return o.modelValue.includes(e);
30
- })), B = i(() => c.value.slice(0, o.maxVisible)), x = i(() => c.value.length - o.maxVisible), O = (a) => {
31
- const e = a.value ?? a.label, t = [...o.modelValue], r = t.indexOf(e);
32
- r === -1 ? t.push(e) : t.splice(r, 1), s("update:modelValue", t), s("change", t);
33
- }, M = (a) => {
34
- const e = o.modelValue.filter((t) => t !== a);
35
- s("update:modelValue", e), s("change", e);
36
- }, S = () => {
37
- s("update:modelValue", []), s("change", []);
38
- }, N = i(() => [
36
+ return t.modelValue.includes(e);
37
+ })), O = i(() => c.value.slice(0, t.maxVisible)), V = i(() => c.value.length - t.maxVisible), M = (a) => {
38
+ const e = a.value ?? a.label, l = [...t.modelValue], n = l.indexOf(e);
39
+ n === -1 ? l.push(e) : l.splice(n, 1), r("update:modelValue", l), r("change", l);
40
+ }, I = (a) => {
41
+ const e = t.modelValue.filter((l) => l !== a);
42
+ r("update:modelValue", e), r("change", e);
43
+ }, N = () => {
44
+ r("update:modelValue", []), r("change", []);
45
+ }, z = i(() => [
39
46
  "flex items-center justify-between w-full px-3 py-1.5 rounded-md border text-sm transition-colors cursor-pointer",
40
- o.disabled ? "opacity-50 cursor-not-allowed bg-muted" : "bg-background hover:bg-gray-50/70",
41
- o.variant === "outline" ? "border-input" : "border-transparent bg-muted",
47
+ t.disabled ? "opacity-50 cursor-not-allowed bg-muted" : "bg-background hover:bg-gray-50/70",
48
+ t.variant === "outline" ? "border-input" : "border-transparent bg-muted",
42
49
  u.value ? "border-primary/20" : ""
43
50
  ].join(" "));
44
- return i(() => o.size === "sm" ? "xs" : "sm"), (a, e) => (n(), m(y(A), {
51
+ return i(() => t.size === "sm" ? "xs" : "sm"), (a, e) => (s(), m(v(D), {
45
52
  isOpen: u.value,
46
- "onUpdate:isOpen": e[3] || (e[3] = (t) => u.value = t),
53
+ "onUpdate:isOpen": e[3] || (e[3] = (l) => u.value = l),
47
54
  "close-on-select": !1,
48
55
  selectable: !0,
49
- disabled: l.disabled
56
+ disabled: o.disabled
50
57
  }, {
51
- trigger: f(({ isOpen: t }) => [
58
+ trigger: f(({ isOpen: l }) => [
52
59
  d("div", {
53
- class: V(N.value)
60
+ class: w(z.value)
54
61
  }, [
55
- d("div", F, [
56
- c.value.length === 0 ? (n(), p("span", T, b(l.placeholder), 1)) : (n(), p(w, { key: 1 }, [
57
- (n(!0), p(w, null, E(B.value, (r) => (n(), m(C, {
58
- key: r.value,
62
+ d("div", P, [
63
+ c.value.length === 0 ? (s(), p("span", T, b(B.value), 1)) : (s(), p(k, { key: 1 }, [
64
+ (s(!0), p(k, null, L(O.value, (n) => (s(), m($, {
65
+ key: n.value,
59
66
  variant: "secondary",
60
67
  class: "gap-1 pr-1 truncate max-w-[150px]"
61
68
  }, {
62
69
  default: f(() => [
63
- d("span", U, b(r.label), 1),
64
- l.disabled ? g("", !0) : (n(), p("button", {
70
+ d("span", U, b(n.labelI18n ? v(y)(n.labelI18n) : n.label), 1),
71
+ o.disabled ? g("", !0) : (s(), p("button", {
65
72
  key: 0,
66
73
  type: "button",
67
- onClick: k((H) => M(r.value), ["stop"]),
74
+ onClick: C((H) => I(n.value), ["stop"]),
68
75
  class: "hover:bg-destructive/10 hover:text-destructive rounded-full p-0.5 transition-colors"
69
76
  }, [
70
- v(h, {
77
+ h(x, {
71
78
  icon: "lucide:x",
72
79
  class: "w-3 h-3"
73
80
  })
@@ -75,47 +82,47 @@ const F = { class: "flex flex-wrap gap-1.5 items-center flex-1 min-w-0 py-0.5" }
75
82
  ]),
76
83
  _: 2
77
84
  }, 1024))), 128)),
78
- x.value > 0 ? (n(), m(C, {
85
+ V.value > 0 ? (s(), m($, {
79
86
  key: 0,
80
87
  variant: "secondary",
81
88
  class: "font-normal text-muted-foreground"
82
89
  }, {
83
90
  default: f(() => [
84
- L(" +" + b(x.value), 1)
91
+ A(" +" + b(V.value), 1)
85
92
  ]),
86
93
  _: 1
87
94
  })) : g("", !0)
88
95
  ], 64))
89
96
  ]),
90
97
  d("div", G, [
91
- c.value.length > 0 && !l.disabled ? (n(), m(h, {
98
+ c.value.length > 0 && !o.disabled ? (s(), m(x, {
92
99
  key: 0,
93
100
  icon: "lucide:x",
94
101
  class: "w-4 h-4 hover:text-foreground transition-colors",
95
- onClick: k(S, ["stop"])
102
+ onClick: C(N, ["stop"])
96
103
  })) : g("", !0),
97
104
  e[4] || (e[4] = d("div", { class: "w-px h-4 bg-border mx-0.5" }, null, -1)),
98
- v(h, {
105
+ h(x, {
99
106
  icon: "lucide:chevron-down",
100
- class: V(["w-4 h-4 transition-transform duration-200", { "rotate-180": t }])
107
+ class: w(["w-4 h-4 transition-transform duration-200", { "rotate-180": l }])
101
108
  }, null, 8, ["class"])
102
109
  ])
103
110
  ], 2)
104
111
  ]),
105
112
  default: f(() => [
106
- v(y(D), {
107
- options: l.options,
108
- selected: l.modelValue,
113
+ h(v(F), {
114
+ options: o.options,
115
+ selected: o.modelValue,
109
116
  class: "min-w-[300px]",
110
- loading: l.loading,
111
- hasMore: l.hasMore,
112
- searchable: l.searchable,
113
- remote: l.remote,
114
- layout: l.layout,
115
- onSelect: O,
116
- onClose: e[0] || (e[0] = (t) => u.value = !1),
117
- onLoadMore: e[1] || (e[1] = (t) => a.$emit("load-more")),
118
- onSearch: e[2] || (e[2] = (t) => a.$emit("search", t))
117
+ loading: o.loading,
118
+ hasMore: o.hasMore,
119
+ searchable: o.searchable,
120
+ remote: o.remote,
121
+ layout: o.layout,
122
+ onSelect: M,
123
+ onClose: e[0] || (e[0] = (l) => u.value = !1),
124
+ onLoadMore: e[1] || (e[1] = (l) => a.$emit("load-more")),
125
+ onSearch: e[2] || (e[2] = (l) => a.$emit("search", l))
119
126
  }, null, 8, ["options", "selected", "loading", "hasMore", "searchable", "remote", "layout"])
120
127
  ]),
121
128
  _: 1
@@ -123,5 +130,5 @@ const F = { class: "flex flex-wrap gap-1.5 items-center flex-1 min-w-0 py-0.5" }
123
130
  }
124
131
  });
125
132
  export {
126
- R as default
133
+ Y as default
127
134
  };