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,52 +1,59 @@
1
- import { defineComponent as h, computed as p, openBlock as a, createElementBlock as t, normalizeClass as d, renderSlot as o, createCommentVNode as u, createElementVNode as n, createVNode as V } from "vue";
2
- import v from "../Input.vue.js";
3
- const g = {
1
+ import { defineComponent as V, computed as d, openBlock as t, createElementBlock as o, normalizeClass as n, renderSlot as s, createCommentVNode as u, createElementVNode as m, createVNode as b } from "vue";
2
+ import g from "../Input.vue.js";
3
+ import { $t as i } from "../../utils/i18n.js";
4
+ const w = {
4
5
  key: 0,
5
6
  class: "flex items-center gap-3 mr-auto"
6
- }, w = { class: "ml-auto" }, b = { class: "flex items-center gap-3" }, $ = /* @__PURE__ */ h({
7
+ }, $ = { class: "ml-auto" }, k = { class: "flex items-center gap-3" }, T = /* @__PURE__ */ V({
7
8
  __name: "DataTableToolbar",
8
9
  props: {
9
10
  modelValue: { default: "" },
10
11
  showSearch: { type: Boolean, default: !0 },
11
- placeholder: { default: "Search..." },
12
+ placeholder: {},
13
+ placeholderI18n: {},
12
14
  class: { default: "" },
13
15
  searchClass: { default: "" }
14
16
  },
15
17
  emits: ["update:modelValue"],
16
- setup(l, { emit: m }) {
17
- const s = l, i = m, r = p({
18
- get: () => s.modelValue,
19
- set: (e) => i("update:modelValue", e)
18
+ setup(a, { emit: h }) {
19
+ const l = a, p = h, r = d({
20
+ get: () => l.modelValue,
21
+ set: (e) => p("update:modelValue", e)
22
+ }), f = d(() => {
23
+ if (l.placeholderI18n) return i(l.placeholderI18n);
24
+ if (l.placeholder) return l.placeholder;
25
+ const e = i("vlite.dataTable.searchPlaceholder");
26
+ return e !== "vlite.dataTable.searchPlaceholder" ? e : "Search...";
20
27
  });
21
- return (e, c) => (a(), t("div", {
22
- class: d(["flex flex-col sm:flex-row items-center gap-4 p-1", s.class])
28
+ return (e, c) => (t(), o("div", {
29
+ class: n(["flex flex-col sm:flex-row items-center gap-4 p-1", l.class])
23
30
  }, [
24
- e.$slots?.left ? (a(), t("div", g, [
25
- o(e.$slots, "left")
31
+ e.$slots?.left ? (t(), o("div", w, [
32
+ s(e.$slots, "left")
26
33
  ])) : u("", !0),
27
- n("div", w, [
28
- o(e.$slots, "delete")
34
+ m("div", $, [
35
+ s(e.$slots, "delete")
29
36
  ]),
30
- l.showSearch ? (a(), t("div", {
37
+ a.showSearch ? (t(), o("div", {
31
38
  key: 1,
32
- class: d(["w-full sm:w-72!", l.searchClass])
39
+ class: n(["w-full sm:w-72!", a.searchClass])
33
40
  }, [
34
- V(v, {
41
+ b(g, {
35
42
  modelValue: r.value,
36
- "onUpdate:modelValue": c[0] || (c[0] = (f) => r.value = f),
37
- placeholder: l.placeholder,
43
+ "onUpdate:modelValue": c[0] || (c[0] = (v) => r.value = v),
44
+ placeholder: f.value,
38
45
  icon: "lucide:search",
39
46
  variant: "outline",
40
47
  class: "bg-background",
41
48
  "show-clear-button": !0
42
49
  }, null, 8, ["modelValue", "placeholder"])
43
50
  ], 2)) : u("", !0),
44
- n("div", b, [
45
- o(e.$slots, "right")
51
+ m("div", k, [
52
+ s(e.$slots, "right")
46
53
  ])
47
54
  ], 2));
48
55
  }
49
56
  });
50
57
  export {
51
- $ as default
58
+ T as default
52
59
  };
@@ -25,6 +25,7 @@ export interface TableFilter {
25
25
  export interface TableHeader {
26
26
  field: string;
27
27
  title: string;
28
+ titleI18n?: string;
28
29
  width?: string;
29
30
  minWidth?: string;
30
31
  sortable?: boolean;
@@ -42,6 +43,7 @@ export interface DataTableProps {
42
43
  search?: string;
43
44
  showSearch?: boolean;
44
45
  searchPlaceholder?: string;
46
+ searchPlaceholderI18n?: string;
45
47
  toolbarClass?: string;
46
48
  toolbarSearchClass?: string;
47
49
  headers: TableHeader[];
@@ -49,7 +51,9 @@ export interface DataTableProps {
49
51
  loading?: boolean;
50
52
  selectable?: boolean;
51
53
  emptyTitle?: string;
54
+ emptyTitleI18n?: string;
52
55
  emptyDescription?: string;
56
+ emptyDescriptionI18n?: string;
53
57
  emptyIcon?: string;
54
58
  showPagination?: boolean;
55
59
  paginationProps?: DataTablePaginationProps;
@@ -2,6 +2,7 @@ import { DatePickerMode } from 'v-datepicker-lite/types';
2
2
  import { ButtonSize, ButtonVariant } from '../types';
3
3
  type __VLS_Props = {
4
4
  placeholder?: string;
5
+ placeholderI18n?: string;
5
6
  modelValue?: any;
6
7
  value?: any;
7
8
  mode: DatePickerMode;
@@ -1,13 +1,15 @@
1
- import { defineComponent as g, computed as s, openBlock as c, createBlock as f, unref as n, withCtx as m, createElementVNode as D, createVNode as u, renderSlot as w, mergeProps as v } from "vue";
1
+ import { defineComponent as P, computed as n, openBlock as f, createBlock as v, unref as o, withCtx as r, createElementVNode as k, createVNode as m, renderSlot as w, mergeProps as h } from "vue";
2
2
  import b from "./Button.vue.js";
3
- import V from "./Dropdown/Dropdown.vue.js";
3
+ import I from "./Dropdown/Dropdown.vue.js";
4
4
  import "@iconify/vue";
5
- import k, { TimePicker as P } from "v-datepicker-lite";
5
+ import { $t as y } from "../utils/i18n.js";
6
+ import V, { TimePicker as z } from "v-datepicker-lite";
6
7
  import "v-datepicker-lite/style.css";
7
- const z = { class: "overflow-hidden min-w-[300px]" }, $ = /* @__PURE__ */ g({
8
+ const S = { class: "overflow-hidden min-w-[300px]" }, H = /* @__PURE__ */ P({
8
9
  __name: "DatePicker",
9
10
  props: {
10
11
  placeholder: {},
12
+ placeholderI18n: {},
11
13
  modelValue: {},
12
14
  value: {},
13
15
  mode: {},
@@ -25,19 +27,19 @@ const z = { class: "overflow-hidden min-w-[300px]" }, $ = /* @__PURE__ */ g({
25
27
  readonly: { type: Boolean }
26
28
  },
27
29
  emits: ["update:modelValue", "change"],
28
- setup(e, { emit: h }) {
29
- const l = e, o = h, a = s({
30
+ setup(e, { emit: x }) {
31
+ const l = e, u = x, a = n({
30
32
  get: () => l.modelValue ?? l.value,
31
33
  set: (t) => {
32
- o("update:modelValue", t), o("change", t);
34
+ u("update:modelValue", t), u("change", t);
33
35
  }
34
- }), y = (t) => t instanceof Date ? t.getHours() !== 0 || t.getMinutes() !== 0 : typeof t == "string" ? t.includes("T") || /\d{2}:\d{2}/.test(t) : !1, i = s(() => {
36
+ }), g = (t) => t instanceof Date ? t.getHours() !== 0 || t.getMinutes() !== 0 : typeof t == "string" ? t.includes("T") || /\d{2}:\d{2}/.test(t) : !1, i = n(() => {
35
37
  if (!a.value) return "";
36
38
  if (l.mode === "time") return a.value;
37
39
  try {
38
40
  const t = new Date(a.value);
39
41
  if (isNaN(t.getTime())) return String(a.value);
40
- const d = l.mode === "dateTime" && y(a.value);
42
+ const d = l.mode === "dateTime" && g(a.value);
41
43
  return t.toLocaleDateString("en-US", {
42
44
  month: "short",
43
45
  day: "numeric",
@@ -47,10 +49,15 @@ const z = { class: "overflow-hidden min-w-[300px]" }, $ = /* @__PURE__ */ g({
47
49
  } catch {
48
50
  return String(a.value);
49
51
  }
50
- }), r = (t) => {
52
+ }), s = n(() => {
53
+ if (l.placeholderI18n) return y(l.placeholderI18n);
54
+ if (l.placeholder) return l.placeholder;
55
+ const t = y("vlite.datePicker.placeholder");
56
+ return t !== "vlite.datePicker.placeholder" ? t : "Select date";
57
+ }), c = (t) => {
51
58
  a.value = t;
52
59
  };
53
- return (t, d) => e.mode !== "time" ? (c(), f(n(V), {
60
+ return (t, d) => e.mode !== "time" ? (f(), v(o(I), {
54
61
  key: 0,
55
62
  position: "bottom-start",
56
63
  class: "w-full",
@@ -58,13 +65,13 @@ const z = { class: "overflow-hidden min-w-[300px]" }, $ = /* @__PURE__ */ g({
58
65
  teleport: e.teleport,
59
66
  disabled: e.disabled || e.readonly
60
67
  }, {
61
- trigger: m(() => [
68
+ trigger: r(() => [
62
69
  w(t.$slots, "default", {
63
70
  value: a.value,
64
71
  displayValue: i.value
65
72
  }, () => [
66
- u(b, v({
67
- text: i.value || e.placeholder || "Select date",
73
+ m(b, h({
74
+ text: i.value || s.value,
68
75
  variant: e.variant || "outline",
69
76
  size: e.size || "md",
70
77
  icon: e.icon || "lucide:calendar",
@@ -72,9 +79,9 @@ const z = { class: "overflow-hidden min-w-[300px]" }, $ = /* @__PURE__ */ g({
72
79
  }, e.btnProps, { class: "w-full justify-start text-left font-normal" }), null, 16, ["text", "variant", "size", "icon", "disabled"])
73
80
  ])
74
81
  ]),
75
- default: m(() => [
76
- D("div", z, [
77
- u(n(k), {
82
+ default: r(() => [
83
+ k("div", S, [
84
+ m(o(V), {
78
85
  value: a.value,
79
86
  mode: e.mode,
80
87
  "min-date": e.minDate,
@@ -85,17 +92,17 @@ const z = { class: "overflow-hidden min-w-[300px]" }, $ = /* @__PURE__ */ g({
85
92
  "time-format": "12h",
86
93
  disabled: e.disabled,
87
94
  readonly: e.readonly,
88
- onChange: r
95
+ onChange: c
89
96
  }, null, 8, ["value", "mode", "min-date", "max-date", "disabled-dates", "minuteInterval", "disabled", "readonly"])
90
97
  ])
91
98
  ]),
92
99
  _: 3
93
- }, 8, ["teleport", "disabled"])) : (c(), f(n(P), {
100
+ }, 8, ["teleport", "disabled"])) : (f(), v(o(z), {
94
101
  key: 1,
95
102
  "model-value": a.value,
96
103
  "onUpdate:modelValue": [
97
- d[0] || (d[0] = (x) => a.value = x),
98
- r
104
+ d[0] || (d[0] = (D) => a.value = D),
105
+ c
99
106
  ],
100
107
  mode: e.mode,
101
108
  "min-date": e.minDate,
@@ -107,9 +114,9 @@ const z = { class: "overflow-hidden min-w-[300px]" }, $ = /* @__PURE__ */ g({
107
114
  disabled: e.disabled,
108
115
  readonly: e.readonly
109
116
  }, {
110
- default: m(() => [
111
- u(b, v({
112
- text: i.value || e.placeholder || "Select date",
117
+ default: r(() => [
118
+ m(b, h({
119
+ text: i.value || s.value,
113
120
  variant: e.variant || "outline",
114
121
  size: e.size || "md",
115
122
  icon: e.icon || (e.mode === "time" ? "lucide:clock" : "lucide:calendar"),
@@ -121,5 +128,5 @@ const z = { class: "overflow-hidden min-w-[300px]" }, $ = /* @__PURE__ */ g({
121
128
  }
122
129
  });
123
130
  export {
124
- $ as default
131
+ H as default
125
132
  };
@@ -1,7 +1,8 @@
1
- import { defineComponent as r, openBlock as i, createElementBlock as m, withModifiers as d, normalizeClass as u, createElementVNode as c, createBlock as f, createCommentVNode as p, toDisplayString as g, createVNode as h } from "vue";
2
- import v from "../Switch.vue.js";
3
- import x from "../Icon.vue.js";
4
- const k = { class: "flex items-center gap-2 flex-1 min-w-0" }, y = { class: "truncate font-medium" }, V = /* @__PURE__ */ r({
1
+ import { defineComponent as m, computed as d, openBlock as l, createElementBlock as u, withModifiers as p, normalizeClass as f, createElementVNode as a, createBlock as g, createCommentVNode as v, toDisplayString as h, createVNode as x } from "vue";
2
+ import y from "../Switch.vue.js";
3
+ import b from "../Icon.vue.js";
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" }, D = /* @__PURE__ */ m({
5
6
  __name: "DropdownBooleanItem",
6
7
  props: {
7
8
  option: {},
@@ -9,33 +10,33 @@ const k = { class: "flex items-center gap-2 flex-1 min-w-0" }, y = { class: "tru
9
10
  focused: { type: Boolean }
10
11
  },
11
12
  emits: ["change"],
12
- setup(e, { emit: a }) {
13
- const l = e, s = a, o = (t) => {
14
- s("change", t, l.option);
13
+ setup(e, { emit: c }) {
14
+ const o = e, s = c, r = d(() => o.option.labelI18n ? k(o.option.labelI18n) : o.option.label), t = (n) => {
15
+ s("change", n, o.option);
15
16
  };
16
- return (t, n) => (i(), m("div", {
17
+ return (n, i) => (l(), u("div", {
17
18
  "data-dropdown-item": "",
18
- class: u(["relative flex cursor-pointer select-none items-center justify-between rounded-sm px-2 py-1.5 text-sm outline-none transition-colors", [
19
+ 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", [
19
20
  e.focused ? "bg-accent text-accent-foreground" : "hover:bg-accent hover:text-accent-foreground"
20
21
  ]]),
21
- onClick: n[0] || (n[0] = d((w) => o(!e.value), ["stop"]))
22
+ onClick: i[0] || (i[0] = p((C) => t(!e.value), ["stop"]))
22
23
  }, [
23
- c("div", k, [
24
- e.option.icon ? (i(), f(x, {
24
+ a("div", w, [
25
+ e.option.icon ? (l(), g(b, {
25
26
  key: 0,
26
27
  icon: e.option.icon,
27
28
  class: "h-4 w-4 shrink-0 opacity-70"
28
- }, null, 8, ["icon"])) : p("", !0),
29
- c("span", y, g(e.option.label), 1)
29
+ }, null, 8, ["icon"])) : v("", !0),
30
+ a("span", B, h(r.value), 1)
30
31
  ]),
31
- h(v, {
32
+ x(y, {
32
33
  "model-value": e.value,
33
34
  class: "ml-3 shrink-0 scale-75 origin-right",
34
- "onUpdate:modelValue": o
35
+ "onUpdate:modelValue": t
35
36
  }, null, 8, ["model-value"])
36
37
  ], 2));
37
38
  }
38
39
  });
39
40
  export {
40
- V as default
41
+ D as default
41
42
  };
@@ -1,13 +1,14 @@
1
- import { defineComponent as v, computed as _, openBlock as t, createElementBlock as n, normalizeStyle as C, Fragment as a, renderList as i, createElementVNode as m, normalizeClass as $, toDisplayString as h, createBlock as d, createCommentVNode as f, createVNode as w } from "vue";
2
- import B from "../Icon.vue.js";
1
+ import { defineComponent as _, computed as C, openBlock as t, createElementBlock as c, normalizeStyle as $, Fragment as a, renderList as i, createElementVNode as m, normalizeClass as h, toDisplayString as w, createBlock as d, createCommentVNode as f, createVNode as B } from "vue";
2
+ import N from "../Icon.vue.js";
3
3
  import y from "./DropdownItem.vue.js";
4
- const N = { class: "font-semibold text-sm text-foreground" }, S = { class: "flex flex-col space-y-1" }, V = {
4
+ import { $t as S } from "../../utils/i18n.js";
5
+ const L = { class: "font-semibold text-sm text-foreground" }, V = { class: "flex flex-col space-y-1" }, z = {
5
6
  key: 0,
6
7
  class: "flex flex-col space-y-1 ml-3 pl-3 border-l border-border mt-0.5 mb-1.5"
7
- }, g = {
8
+ }, A = {
8
9
  key: 1,
9
10
  class: "px-2 text-xs text-muted-foreground italic"
10
- }, j = /* @__PURE__ */ v({
11
+ }, F = /* @__PURE__ */ _({
11
12
  __name: "DropdownGroupedLayout",
12
13
  props: {
13
14
  options: { default: () => [] },
@@ -18,56 +19,56 @@ const N = { class: "font-semibold text-sm text-foreground" }, S = { class: "flex
18
19
  headerClass: {}
19
20
  },
20
21
  emits: ["select", "mouseenter"],
21
- setup(o, { emit: z }) {
22
- const l = o, k = _(() => {
22
+ setup(o, { emit: D }) {
23
+ const l = o, k = C(() => {
23
24
  const e = l.columns;
24
25
  return typeof e == "number" ? { gridTemplateColumns: `repeat(${e}, minmax(0, 1fr))` } : { gridTemplateColumns: e };
25
- }), u = (e) => l.selected ? Array.isArray(l.selected) ? l.selected.includes(e.value) : typeof l.selected == "object" && l.selected !== null && e.key && e.key in l.selected ? l.selected[e.key] === e.value : l.selected === e.value : !1;
26
- return (e, A) => (t(), n("div", {
26
+ }), u = (e) => l.selected ? Array.isArray(l.selected) ? l.selected.includes(e.value) : typeof l.selected == "object" && l.selected !== null && e.key && e.key in l.selected ? l.selected[e.key] === e.value : l.selected === e.value : !1, b = (e) => e.labelI18n ? S(e.labelI18n) : e.label;
27
+ return (e, E) => (t(), c("div", {
27
28
  class: "grid gap-6 p-4",
28
- style: C(k.value)
29
+ style: $(k.value)
29
30
  }, [
30
- (t(!0), n(a, null, i(o.options, (s, p) => (t(), n("div", {
31
+ (t(!0), c(a, null, i(o.options, (s, p) => (t(), c("div", {
31
32
  key: s.key || s.value || p,
32
33
  class: "flex flex-col space-y-2 min-w-[150px]"
33
34
  }, [
34
35
  m("div", {
35
- class: $(["flex items-center gap-2 px-2 py-1 mb-1", o.headerClass])
36
+ class: h(["flex items-center gap-2 px-2 py-1 mb-1", o.headerClass])
36
37
  }, [
37
- m("span", N, h(s.label), 1),
38
- s.icon ? (t(), d(B, {
38
+ m("span", L, w(b(s)), 1),
39
+ s.icon ? (t(), d(N, {
39
40
  key: 0,
40
41
  icon: s.icon,
41
42
  class: "w-4 h-4 text-muted-foreground"
42
43
  }, null, 8, ["icon"])) : f("", !0)
43
44
  ], 2),
44
- m("div", S, [
45
- s.children && s.children.length ? (t(!0), n(a, { key: 0 }, i(s.children, (c, x) => (t(), n(a, {
46
- key: c.key || c.value || x
45
+ m("div", V, [
46
+ s.children && s.children.length ? (t(!0), c(a, { key: 0 }, i(s.children, (n, x) => (t(), c(a, {
47
+ key: n.key || n.value || x
47
48
  }, [
48
- w(y, {
49
- option: c,
50
- selected: u(c),
49
+ B(y, {
50
+ option: n,
51
+ selected: u(n),
51
52
  selectable: o.selectable,
52
53
  class: "w-full",
53
- onClick: (r) => e.$emit("select", c)
54
+ onClick: (r) => e.$emit("select", n)
54
55
  }, null, 8, ["option", "selected", "selectable", "onClick"]),
55
- c.children && c.children.length ? (t(), n("div", V, [
56
- (t(!0), n(a, null, i(c.children, (r, b) => (t(), d(y, {
57
- key: r.key || r.value || b,
56
+ n.children && n.children.length ? (t(), c("div", z, [
57
+ (t(!0), c(a, null, i(n.children, (r, v) => (t(), d(y, {
58
+ key: r.key || r.value || v,
58
59
  option: r,
59
60
  selected: u(r),
60
61
  selectable: o.selectable,
61
62
  class: "w-full text-xs",
62
- onClick: (D) => e.$emit("select", r)
63
+ onClick: (G) => e.$emit("select", r)
63
64
  }, null, 8, ["option", "selected", "selectable", "onClick"]))), 128))
64
65
  ])) : f("", !0)
65
- ], 64))), 128)) : (t(), n("div", g, "No items"))
66
+ ], 64))), 128)) : (t(), c("div", A, "No items"))
66
67
  ])
67
68
  ]))), 128))
68
69
  ], 4));
69
70
  }
70
71
  });
71
72
  export {
72
- j as default
73
+ F as default
73
74
  };
@@ -1,12 +1,13 @@
1
- import { defineComponent as f, openBlock as t, createElementBlock as i, normalizeClass as x, renderSlot as b, normalizeProps as y, guardReactiveProps as k, createBlock as s, createCommentVNode as n, createElementVNode as c, toDisplayString as a } from "vue";
2
- import d from "../Icon.vue.js";
3
- const h = ["data-disabled"], v = { class: "flex flex-col flex-1 min-w-0" }, g = { class: "flex items-center justify-between gap-2" }, p = { class: "truncate font-medium" }, w = {
1
+ import { defineComponent as k, computed as l, openBlock as o, createElementBlock as s, normalizeClass as h, renderSlot as g, normalizeProps as w, guardReactiveProps as I, createBlock as p, createCommentVNode as i, createElementVNode as a, toDisplayString as c } from "vue";
2
+ import f from "../Icon.vue.js";
3
+ import { $t as d } from "../../utils/i18n.js";
4
+ const B = ["data-disabled"], $ = { class: "flex flex-col flex-1 min-w-0" }, C = { class: "flex items-center justify-between gap-2" }, D = { class: "truncate font-medium" }, S = {
4
5
  key: 0,
5
6
  class: "text-xs text-muted-foreground whitespace-nowrap opacity-90"
6
- }, B = {
7
+ }, z = {
7
8
  key: 0,
8
9
  class: "text-[10px] text-muted-foreground truncate opacity-70"
9
- }, z = /* @__PURE__ */ f({
10
+ }, V = /* @__PURE__ */ k({
10
11
  __name: "DropdownItem",
11
12
  props: {
12
13
  option: {},
@@ -16,41 +17,41 @@ const h = ["data-disabled"], v = { class: "flex flex-col flex-1 min-w-0" }, g =
16
17
  index: {}
17
18
  },
18
19
  emits: ["click", "mouseenter"],
19
- setup(e, { emit: r }) {
20
- const u = r;
21
- return (l, o) => (t(), i("div", {
20
+ setup(e, { emit: b }) {
21
+ const t = e, x = b, y = l(() => t.option.labelI18n ? d(t.option.labelI18n) : t.option.label), r = l(() => t.option.subtitleI18n ? d(t.option.subtitleI18n) : t.option.subtitle), u = l(() => t.option.descriptionI18n ? d(t.option.descriptionI18n) : t.option.description);
22
+ return (m, n) => (o(), s("div", {
22
23
  "data-dropdown-item": "",
23
- class: x(["relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-disabled:pointer-events-none data-disabled:opacity-50", [
24
+ class: h(["relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-disabled:pointer-events-none data-disabled:opacity-50", [
24
25
  e.selectable && e.selected && !e.option.children ? "bg-accent" : "",
25
26
  e.focused ? "bg-accent text-accent-foreground" : "hover:bg-accent hover:text-accent-foreground",
26
27
  e.option.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
27
28
  ]]),
28
29
  "data-disabled": e.option.disabled ? !0 : void 0,
29
- onClick: o[0] || (o[0] = (m) => u("click", e.option)),
30
- onMouseenter: o[1] || (o[1] = (m) => l.$emit("mouseenter", e.index ?? -1))
30
+ onClick: n[0] || (n[0] = (v) => x("click", e.option)),
31
+ onMouseenter: n[1] || (n[1] = (v) => m.$emit("mouseenter", e.index ?? -1))
31
32
  }, [
32
- b(l.$slots, "default", y(k({ option: e.option, index: e.index, selected: e.selected })), () => [
33
- e.option.icon ? (t(), s(d, {
33
+ g(m.$slots, "default", w(I({ option: e.option, index: e.index, selected: e.selected })), () => [
34
+ e.option.icon ? (o(), p(f, {
34
35
  key: 0,
35
36
  icon: e.option.icon,
36
37
  class: "mr-2 h-4 w-4 shrink-0 mt-0.5"
37
- }, null, 8, ["icon"])) : n("", !0),
38
- c("div", v, [
39
- c("div", g, [
40
- c("span", p, a(e.option.label), 1),
41
- e.option.subtitle ? (t(), i("span", w, a(e.option.subtitle), 1)) : n("", !0)
38
+ }, null, 8, ["icon"])) : i("", !0),
39
+ a("div", $, [
40
+ a("div", C, [
41
+ a("span", D, c(y.value), 1),
42
+ r.value ? (o(), s("span", S, c(r.value), 1)) : i("", !0)
42
43
  ]),
43
- e.option.description ? (t(), i("span", B, a(e.option.description), 1)) : n("", !0)
44
+ u.value ? (o(), s("span", z, c(u.value), 1)) : i("", !0)
44
45
  ]),
45
- e.selectable && e.selected ? (t(), s(d, {
46
+ e.selectable && e.selected ? (o(), p(f, {
46
47
  key: 1,
47
48
  icon: "lucide:check",
48
49
  class: "ml-2 h-4 w-4 shrink-0 text-primary"
49
- })) : n("", !0)
50
+ })) : i("", !0)
50
51
  ])
51
- ], 42, h));
52
+ ], 42, B));
52
53
  }
53
54
  });
54
55
  export {
55
- z as default
56
+ V as default
56
57
  };