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,30 +1,31 @@
1
- import { defineComponent as G, defineAsyncComponent as J, ref as B, computed as I, watch as C, toRef as Q, onMounted as W, onBeforeUnmount as X, openBlock as o, createElementBlock as c, createVNode as x, createCommentVNode as i, renderSlot as v, unref as n, normalizeStyle as Y, normalizeClass as T, createBlock as m, Fragment as N, renderList as Z, withCtx as V, createElementVNode as p, toDisplayString as ee, createSlots as te, mergeProps as le, nextTick as se } from "vue";
2
- import S from "../Icon.vue.js";
3
- import oe from "../Input.vue.js";
4
- import ne from "./DropdownItem.vue.js";
5
- import re from "./DropdownBooleanItem.vue.js";
6
- import de from "./DropdownGroupedLayout.vue.js";
7
- import { useDropdownNavigation as ce } from "./composables/useDropdownNavigation.js";
8
- import { useDropdownIds as ae } from "./composables/useDropdownIds.js";
9
- const ie = ["dir"], ue = {
1
+ import { defineComponent as Y, defineAsyncComponent as Z, ref as C, computed as v, watch as T, toRef as ee, onMounted as te, onBeforeUnmount as le, openBlock as o, createElementBlock as c, createVNode as x, createCommentVNode as i, renderSlot as g, unref as n, normalizeStyle as se, normalizeClass as D, toDisplayString as E, createBlock as m, Fragment as N, renderList as oe, withCtx as V, createElementVNode as S, createSlots as ne, mergeProps as re, nextTick as de } from "vue";
2
+ import $ from "../Icon.vue.js";
3
+ import ce from "../Input.vue.js";
4
+ import ae from "./DropdownItem.vue.js";
5
+ import ie from "./DropdownBooleanItem.vue.js";
6
+ import ue from "./DropdownGroupedLayout.vue.js";
7
+ import { useDropdownNavigation as fe } from "./composables/useDropdownNavigation.js";
8
+ import { useDropdownIds as me } from "./composables/useDropdownIds.js";
9
+ import { $t as I } from "../../utils/i18n.js";
10
+ const he = ["dir"], ye = {
10
11
  key: 0,
11
12
  class: "bg-body border-b mb-1 z-10 rounded-t-md shrink-0"
12
- }, fe = {
13
+ }, ve = {
13
14
  key: 1,
14
15
  class: "shrink-0"
15
- }, me = {
16
+ }, ge = {
16
17
  key: 0,
17
18
  class: "px-2 py-6 text-center text-sm text-muted-foreground"
18
- }, he = {
19
+ }, ke = {
19
20
  key: 0,
20
21
  class: "h-px bg-border my-1 mx-1"
21
- }, ye = ["onMouseenter"], ve = { class: "flex items-center gap-2 flex-1 min-w-0" }, ge = { class: "truncate" }, ke = {
22
+ }, be = ["onMouseenter"], we = { class: "flex items-center gap-2 flex-1 min-w-0" }, pe = { class: "truncate" }, xe = {
22
23
  key: 3,
23
24
  class: "flex justify-center py-2"
24
- }, be = {
25
+ }, Se = {
25
26
  key: 3,
26
27
  class: "shrink-0 border-t mt-1 pt-1"
27
- }, Ie = /* @__PURE__ */ G({
28
+ }, Ne = /* @__PURE__ */ Y({
28
29
  __name: "DropdownMenu",
29
30
  props: {
30
31
  options: { default: () => [] },
@@ -46,37 +47,43 @@ const ie = ["dir"], ue = {
46
47
  },
47
48
  emits: ["select", "close", "load-more", "search"],
48
49
  setup(r, { emit: j }) {
49
- const D = J(() => import("./Dropdown.vue2.js")), t = r, u = j, $ = B(null), f = B(""), { getMenuId: E, getAllRecursiveIds: P } = ae(), _ = I(() => t.remote ? t.searchable : t.searchable && (t.options?.length || 0) > 9);
50
- let g = null;
51
- C(f, (e) => {
52
- t.remote && (g && clearTimeout(g), g = setTimeout(() => {
50
+ const P = Z(() => import("./Dropdown.vue2.js")), t = r, u = j, M = C(null), f = C(""), { getMenuId: _, getAllRecursiveIds: H } = me(), R = v(() => {
51
+ const e = I("vlite.dropdown.empty");
52
+ return e !== "vlite.dropdown.empty" ? e : "No options found";
53
+ }), z = v(() => {
54
+ const e = I("vlite.dropdown.search");
55
+ return e !== "vlite.dropdown.search" ? e : "Search...";
56
+ }), A = v(() => t.remote ? t.searchable : t.searchable && (t.options?.length || 0) > 9);
57
+ let k = null;
58
+ T(f, (e) => {
59
+ t.remote && (k && clearTimeout(k), k = setTimeout(() => {
53
60
  e && u("search", e);
54
61
  }, 100));
55
62
  });
56
- const H = (e) => {
63
+ const L = (e) => {
57
64
  const s = e.target;
58
65
  s.scrollTop + s.clientHeight >= s.scrollHeight - 50 && t.hasMore && !t.loading && u("load-more");
59
- }, k = (e, s) => {
66
+ }, b = (e, s) => {
60
67
  e.disabled || u("select", e);
61
68
  }, {
62
69
  focusedIndex: h,
63
- isKeyboardMode: b,
64
- filteredOptions: R,
70
+ isKeyboardMode: w,
71
+ filteredOptions: F,
65
72
  // rename
66
- handleKeyDown: M,
67
- handleMouseMove: O,
68
- onMouseEnterItem: w,
69
- scrollToIndex: z
70
- } = ce({
71
- options: Q(t, "options"),
73
+ handleKeyDown: O,
74
+ handleMouseMove: B,
75
+ onMouseEnterItem: p,
76
+ scrollToIndex: K
77
+ } = fe({
78
+ options: ee(t, "options"),
72
79
  searchQuery: f,
73
- containerRef: $,
80
+ containerRef: M,
74
81
  emit: (e, ...s) => u(e, ...s),
75
- handleSelect: (e, s) => k(e)
76
- }), y = I(() => t.remote ? f.value ? t.options : t.cachedOptions.length ? t.cachedOptions : t.options : R.value), A = (e) => {
82
+ handleSelect: (e, s) => b(e)
83
+ }), y = v(() => t.remote ? f.value ? t.options : t.cachedOptions.length ? t.cachedOptions : t.options : F.value), U = (e) => {
77
84
  if (!(!t.selected || typeof t.selected != "object") && e.key && e.key in t.selected)
78
85
  return t.selected[e.key];
79
- }, L = (e) => e.disabled ? !1 : Array.isArray(t.selected) ? t.selected.includes(e.value) : t.selected && typeof t.selected == "object" && e.key ? t.selected[e.key] === e.value : t.selected === e.value, F = (e) => !e.key || !t.selected || typeof t.selected != "object" ? !1 : !!t.selected[e.key], K = (e, s) => {
86
+ }, q = (e) => e.disabled ? !1 : Array.isArray(t.selected) ? t.selected.includes(e.value) : t.selected && typeof t.selected == "object" && e.key ? t.selected[e.key] === e.value : t.selected === e.value, G = (e) => !e.key || !t.selected || typeof t.selected != "object" ? !1 : !!t.selected[e.key], J = (e, s) => {
80
87
  if (!s.key) return;
81
88
  const l = {
82
89
  label: s.label,
@@ -85,7 +92,7 @@ const ie = ["dir"], ue = {
85
92
  data: s.data
86
93
  };
87
94
  u("select", l);
88
- }, U = (e, s) => {
95
+ }, Q = (e, s) => {
89
96
  let l = s.value;
90
97
  e.key && (l = { [e.key]: l });
91
98
  const d = {
@@ -95,142 +102,144 @@ const ie = ["dir"], ue = {
95
102
  key: e.key
96
103
  };
97
104
  u("select", d);
98
- }, q = async () => {
99
- await se();
105
+ }, W = async () => {
106
+ await de();
100
107
  let e = -1;
101
- t.layout !== "grouped" && (t.selectedIndex !== null && t.selectedIndex >= 0 ? e = t.selectedIndex : t.selected !== void 0 && typeof t.selected != "object" && (e = t.options.findIndex((s) => s.value === t.selected)), e !== -1 && z(e));
108
+ t.layout !== "grouped" && (t.selectedIndex !== null && t.selectedIndex >= 0 ? e = t.selectedIndex : t.selected !== void 0 && typeof t.selected != "object" && (e = t.options.findIndex((s) => s.value === t.selected)), e !== -1 && K(e));
102
109
  };
103
- return C(
110
+ T(
104
111
  () => y.value,
105
112
  () => {
106
113
  h.value = -1;
107
114
  }
108
- ), W(() => {
109
- q(), window.addEventListener("keydown", M);
110
- }), X(() => {
111
- window.removeEventListener("keydown", M);
112
- }), (e, s) => (o(), c("div", {
115
+ ), te(() => {
116
+ W(), window.addEventListener("keydown", O);
117
+ }), le(() => {
118
+ window.removeEventListener("keydown", O);
119
+ });
120
+ const X = (e) => e.labelI18n ? I(e.labelI18n) : e.label;
121
+ return (e, s) => (o(), c("div", {
113
122
  class: "dropdown-menu w-full min-w-[150px] flex flex-col",
114
123
  dir: r.direction
115
124
  }, [
116
- _.value ? (o(), c("div", ue, [
117
- x(oe, {
125
+ A.value ? (o(), c("div", ye, [
126
+ x(ce, {
118
127
  modelValue: f.value,
119
128
  "onUpdate:modelValue": s[0] || (s[0] = (l) => f.value = l),
120
- placeholder: "Search...",
129
+ placeholder: z.value,
121
130
  icon: "lucide:search",
122
131
  size: "sm",
123
132
  class: "font-medium!",
124
133
  variant: "transparent",
125
134
  "show-clear-button": !1
126
- }, null, 8, ["modelValue"])
135
+ }, null, 8, ["modelValue", "placeholder"])
127
136
  ])) : i("", !0),
128
- e.$slots.header ? (o(), c("div", fe, [
129
- v(e.$slots, "header")
137
+ e.$slots.header ? (o(), c("div", ve, [
138
+ g(e.$slots, "header")
130
139
  ])) : i("", !0),
131
140
  t?.options.length > 0 || e.$slots.menu ? (o(), c("div", {
132
141
  key: 2,
133
142
  ref_key: "containerRef",
134
- ref: $,
143
+ ref: M,
135
144
  tabindex: "0",
136
145
  role: "menu",
137
- class: T([
146
+ class: D([
138
147
  "w-full p-1 space-y-0.5 overflow-y-auto overflow-x-hidden focus:outline-none flex-1",
139
148
  t.class
140
149
  ]),
141
- style: Y({ maxHeight: t.maxHeight }),
150
+ style: se({ maxHeight: t.maxHeight }),
142
151
  onMousemove: s[1] || (s[1] = //@ts-ignore
143
- (...l) => n(O) && n(O)(...l)),
144
- onScroll: H
152
+ (...l) => n(B) && n(B)(...l)),
153
+ onScroll: L
145
154
  }, [
146
- y.value.length === 0 && r.options?.length > 0 && !r.loading ? (o(), c("div", me, " No options found ")) : i("", !0),
147
- r.layout === "grouped" ? (o(), m(de, {
155
+ y.value.length === 0 && r.options?.length > 0 && !r.loading ? (o(), c("div", ge, E(R.value), 1)) : i("", !0),
156
+ r.layout === "grouped" ? (o(), m(ue, {
148
157
  key: 1,
149
158
  options: y.value,
150
159
  selected: r.selected,
151
160
  selectable: r.selectable,
152
161
  columns: r.columns,
153
- onSelect: k
154
- }, null, 8, ["options", "selected", "selectable", "columns"])) : (o(!0), c(N, { key: 2 }, Z(y.value, (l, d) => (o(), c(N, { key: d }, [
155
- l.label === "---" ? (o(), c("div", he)) : l.data?.isBoolean ? (o(), m(re, {
162
+ onSelect: b
163
+ }, null, 8, ["options", "selected", "selectable", "columns"])) : (o(!0), c(N, { key: 2 }, oe(y.value, (l, d) => (o(), c(N, { key: d }, [
164
+ l.label === "---" ? (o(), c("div", ke)) : l.data?.isBoolean ? (o(), m(ie, {
156
165
  key: 1,
157
166
  option: l,
158
- value: F(l),
159
- focused: n(b) && n(h) === d,
160
- onChange: K,
161
- onMouseenter: (a) => n(w)(d)
162
- }, null, 8, ["option", "value", "focused", "onMouseenter"])) : l.children && l.children.length > 0 ? (o(), m(n(D), {
167
+ value: G(l),
168
+ focused: n(w) && n(h) === d,
169
+ onChange: J,
170
+ onMouseenter: (a) => n(p)(d)
171
+ }, null, 8, ["option", "value", "focused", "onMouseenter"])) : l.children && l.children.length > 0 ? (o(), m(n(P), {
163
172
  key: 2,
164
173
  position: l.position || t.nestedPosition,
165
174
  offset: l.offset || t.nestedOffset,
166
175
  class: "w-full",
167
176
  options: l.children,
168
- selected: A(l),
169
- menuId: n(E)(l),
177
+ selected: U(l),
178
+ menuId: n(_)(l),
170
179
  nestedPosition: t.nestedPosition,
171
180
  nestedOffset: t.nestedOffset,
172
181
  selectable: t.selectable,
173
- ignoreClickOutside: n(P)(l.children),
182
+ ignoreClickOutside: n(H)(l.children),
174
183
  direction: r.direction,
175
- onOnSelect: (a) => U(l, a)
184
+ onOnSelect: (a) => Q(l, a)
176
185
  }, {
177
186
  trigger: V(() => [
178
- p("div", {
187
+ S("div", {
179
188
  "data-dropdown-item": "",
180
- class: T(["relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm font-medium outline-none transition-colors justify-between w-full", [
181
- n(b) && n(h) === d ? "bg-accent text-accent-foreground" : "hover:bg-accent hover:text-accent-foreground",
189
+ class: D(["relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm font-medium outline-none transition-colors justify-between w-full", [
190
+ n(w) && n(h) === d ? "bg-accent text-accent-foreground" : "hover:bg-accent hover:text-accent-foreground",
182
191
  l.disabled ? "opacity-50 cursor-not-allowed" : ""
183
192
  ]]),
184
- onMouseenter: (a) => n(w)(d)
193
+ onMouseenter: (a) => n(p)(d)
185
194
  }, [
186
- p("div", ve, [
187
- l.icon ? (o(), m(S, {
195
+ S("div", we, [
196
+ l.icon ? (o(), m($, {
188
197
  key: 0,
189
198
  icon: l.icon,
190
199
  class: "mr-2 h-4 w-4 shrink-0 mt-0.5"
191
200
  }, null, 8, ["icon"])) : i("", !0),
192
- p("span", ge, ee(l.label), 1)
201
+ S("span", pe, E(X(l)), 1)
193
202
  ]),
194
- x(S, {
203
+ x($, {
195
204
  icon: r.direction === "rtl" ? "lucide:chevron-left" : "lucide:chevron-right",
196
205
  class: "h-4 w-4 text-muted-foreground shrink-0 ml-2"
197
206
  }, null, 8, ["icon"])
198
- ], 42, ye)
207
+ ], 42, be)
199
208
  ]),
200
209
  _: 2
201
- }, 1032, ["position", "offset", "options", "selected", "menuId", "nestedPosition", "nestedOffset", "selectable", "ignoreClickOutside", "direction", "onOnSelect"])) : (o(), m(ne, {
210
+ }, 1032, ["position", "offset", "options", "selected", "menuId", "nestedPosition", "nestedOffset", "selectable", "ignoreClickOutside", "direction", "onOnSelect"])) : (o(), m(ae, {
202
211
  key: 3,
203
212
  option: l,
204
213
  index: d,
205
- selected: L(l),
206
- focused: n(b) && n(h) === d,
214
+ selected: q(l),
215
+ focused: n(w) && n(h) === d,
207
216
  selectable: r.selectable,
208
- onClick: (a) => k(l),
209
- onMouseenter: (a) => n(w)(d)
210
- }, te({ _: 2 }, [
217
+ onClick: (a) => b(l),
218
+ onMouseenter: (a) => n(p)(d)
219
+ }, ne({ _: 2 }, [
211
220
  e.$slots.item ? {
212
221
  name: "default",
213
222
  fn: V((a) => [
214
- v(e.$slots, "item", le({ ref_for: !0 }, a))
223
+ g(e.$slots, "item", re({ ref_for: !0 }, a))
215
224
  ]),
216
225
  key: "0"
217
226
  } : void 0
218
227
  ]), 1032, ["option", "index", "selected", "focused", "selectable", "onClick", "onMouseenter"]))
219
228
  ], 64))), 128)),
220
- r.loading ? (o(), c("div", ke, [
221
- x(S, {
229
+ r.loading ? (o(), c("div", xe, [
230
+ x($, {
222
231
  icon: "lucide:loader-2",
223
232
  class: "w-4 h-4 animate-spin text-muted-foreground"
224
233
  })
225
234
  ])) : i("", !0),
226
- v(e.$slots, "menu")
235
+ g(e.$slots, "menu")
227
236
  ], 38)) : i("", !0),
228
- e.$slots.footer ? (o(), c("div", be, [
229
- v(e.$slots, "footer")
237
+ e.$slots.footer ? (o(), c("div", Se, [
238
+ g(e.$slots, "footer")
230
239
  ])) : i("", !0)
231
- ], 8, ie));
240
+ ], 8, he));
232
241
  }
233
242
  });
234
243
  export {
235
- Ie as default
244
+ Ne as default
236
245
  };
@@ -1,42 +1,43 @@
1
- import { ref as s, computed as i } from "vue";
2
- function h(a) {
3
- const t = s(-1), l = s(!1), u = i(() => {
4
- const e = a.options.value;
5
- if (!a.searchQuery.value) return e;
6
- const o = a.searchQuery.value.toLowerCase();
7
- return e.filter((n) => n.label.toLowerCase().includes(o));
1
+ import { ref as u, computed as i } from "vue";
2
+ import { $t as c } from "../../../utils/i18n.js";
3
+ function b(n) {
4
+ const t = u(-1), o = u(!1), s = i(() => {
5
+ const e = n.options.value;
6
+ if (!n.searchQuery.value) return e;
7
+ const a = n.searchQuery.value.toLowerCase();
8
+ return e.filter((l) => (l.labelI18n ? c(l.labelI18n) : l.label).toLowerCase().includes(a));
8
9
  }), r = (e) => {
9
- if (!a.containerRef.value || e < 0) return;
10
- const n = a.containerRef.value.querySelectorAll("[data-dropdown-item]")[e];
11
- n && n.scrollIntoView({ block: "nearest" });
10
+ if (!n.containerRef.value || e < 0) return;
11
+ const l = n.containerRef.value.querySelectorAll("[data-dropdown-item]")[e];
12
+ l && l.scrollIntoView({ block: "nearest" });
12
13
  };
13
14
  return {
14
15
  focusedIndex: t,
15
- isKeyboardMode: l,
16
- filteredOptions: u,
16
+ isKeyboardMode: o,
17
+ filteredOptions: s,
17
18
  handleKeyDown: (e) => {
18
- const o = u.value;
19
- if (o.length !== 0)
20
- switch (["ArrowDown", "ArrowUp", "Enter"].includes(e.key) && (l.value = !0), e.key) {
19
+ const a = s.value;
20
+ if (a.length !== 0)
21
+ switch (["ArrowDown", "ArrowUp", "Enter"].includes(e.key) && (o.value = !0), e.key) {
21
22
  case "ArrowDown":
22
- e.preventDefault(), e.stopPropagation(), t.value < o.length - 1 ? t.value++ : t.value = 0, r(t.value);
23
+ e.preventDefault(), e.stopPropagation(), t.value < a.length - 1 ? t.value++ : t.value = 0, r(t.value);
23
24
  break;
24
25
  case "ArrowUp":
25
- e.preventDefault(), e.stopPropagation(), t.value > 0 ? t.value-- : (t.value, t.value = o.length - 1), r(t.value);
26
+ e.preventDefault(), e.stopPropagation(), t.value > 0 ? t.value-- : (t.value, t.value = a.length - 1), r(t.value);
26
27
  break;
27
28
  case "Enter":
28
- if (e.preventDefault(), e.stopPropagation(), t.value >= 0 && t.value < o.length) {
29
- const n = o[t.value];
30
- n.children || a.handleSelect(n, t.value);
29
+ if (e.preventDefault(), e.stopPropagation(), t.value >= 0 && t.value < a.length) {
30
+ const l = a[t.value];
31
+ l.children || n.handleSelect(l, t.value);
31
32
  }
32
33
  break;
33
34
  case "Escape":
34
- e.preventDefault(), e.stopPropagation(), a.emit("close");
35
+ e.preventDefault(), e.stopPropagation(), n.emit("close");
35
36
  break;
36
37
  }
37
38
  },
38
39
  handleMouseMove: () => {
39
- l.value && (l.value = !1);
40
+ o.value && (o.value = !1);
40
41
  },
41
42
  onMouseEnterItem: (e) => {
42
43
  t.value = e;
@@ -45,5 +46,5 @@ function h(a) {
45
46
  };
46
47
  }
47
48
  export {
48
- h as useDropdownNavigation
49
+ b as useDropdownNavigation
49
50
  };
@@ -1,41 +1,43 @@
1
- import { computed as s } from "vue";
1
+ import { computed as f } from "vue";
2
2
  import { deepMerge as g } from "../../../utils/object.js";
3
- function S(a, r) {
4
- const n = s(() => a.modelValue !== void 0 ? a.modelValue : a.selected), o = (l = [], t) => {
3
+ import { $t as k } from "../../../utils/i18n.js";
4
+ function h(r, n) {
5
+ const u = f(() => r.modelValue !== void 0 ? r.modelValue : r.selected), o = (l = [], t) => {
5
6
  for (const e of l) {
6
- if (e.value === t) return e.label;
7
+ const a = e.labelI18n ? k(e.labelI18n) : e.label;
8
+ if (e.value === t) return a;
7
9
  if (e.key && typeof t == "object" && t !== null && e.key in t) {
8
10
  if (e.children) {
9
11
  const c = o(e.children, t[e.key]);
10
- if (c) return `${e.label} / ${c}`;
12
+ if (c) return `${a} / ${c}`;
11
13
  }
12
- return e.value === t[e.key], e.label;
14
+ return e.value === t[e.key], a;
13
15
  }
14
16
  }
15
17
  return "";
16
- }, i = s(() => !a.showSelectedLabel || !a.selectable || !a.options?.length ? "" : o(a.options, n.value));
18
+ }, i = f(() => !r.showSelectedLabel || !r.selectable || !r.options?.length ? "" : o(r.options, u.value));
17
19
  return {
18
- currentValue: n,
20
+ currentValue: u,
19
21
  selectedLabel: i,
20
22
  selectOption: (l) => {
21
23
  if (typeof l != "string" && l?.disabled) return;
22
- const t = n.value;
24
+ const t = u.value;
23
25
  let e = l?.value ?? l?.label;
24
- const c = l.data;
26
+ const a = l.data;
25
27
  if (l.key && (typeof e == "object" && e !== null && l.key in e || (e = { [l.key]: e })), t && typeof t == "object" && !Array.isArray(t) && l.key) {
26
- const u = l.key, b = l.value ?? l.label, y = t[u] === b;
27
- if (a.toggleSelection && y) {
28
+ const c = l.key, y = l.value ?? l.label, b = t[c] === y;
29
+ if (r.toggleSelection && b) {
28
30
  const d = { ...t };
29
- delete d[u], r("update:modelValue", d), r("onSelect", { value: d, data: c });
31
+ delete d[c], n("update:modelValue", d), n("onSelect", { value: d, data: a });
30
32
  return;
31
33
  }
32
- const f = g(t, e);
33
- r("update:modelValue", f), r("onSelect", { value: f, data: c });
34
+ const s = g(t, e);
35
+ n("update:modelValue", s), n("onSelect", { value: s, data: a });
34
36
  } else
35
- a.toggleSelection && t === (l.value ?? l.label) ? (r("update:modelValue", void 0), r("onSelect", { value: void 0, data: c })) : (r("update:modelValue", e), r("onSelect", { value: e, data: c }));
37
+ r.toggleSelection && t === (l.value ?? l.label) ? (n("update:modelValue", void 0), n("onSelect", { value: void 0, data: a })) : (n("update:modelValue", e), n("onSelect", { value: e, data: a }));
36
38
  }
37
39
  };
38
40
  }
39
41
  export {
40
- S as useDropdownSelection
42
+ h as useDropdownSelection
41
43
  };
@@ -1,6 +1,8 @@
1
1
  interface Props {
2
2
  title?: string;
3
+ titleI18n?: string;
3
4
  description?: string;
5
+ descriptionI18n?: string;
4
6
  icon?: string;
5
7
  }
6
8
  declare function __VLS_template(): {
@@ -14,8 +16,6 @@ declare function __VLS_template(): {
14
16
  };
15
17
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
18
  declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
17
- title: string;
18
- description: string;
19
19
  icon: string;
20
20
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
21
21
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
@@ -1,33 +1,47 @@
1
- import { defineComponent as r, openBlock as i, createElementBlock as s, createElementVNode as e, createVNode as d, toDisplayString as l, renderSlot as n } from "vue";
2
- import c from "../Icon.vue.js";
3
- const a = { class: "flex flex-col items-center justify-center py-28 gap-5 rounded-3xl border border-gray-150 bg-muted/50 w-full mt-4" }, f = { class: "w-17 h-17 rounded-full bg-gray-200/60 border border-gray-250 shadow-inner flex items-center justify-center" }, u = { class: "text-center space-y-1" }, m = { class: "text-fs-5 font-semibold text-foreground tracking-tight" }, h = ["innerHTML"], _ = /* @__PURE__ */ r({
1
+ import { defineComponent as d, computed as o, openBlock as a, createElementBlock as p, createElementVNode as i, createVNode as u, toDisplayString as f, renderSlot as s } from "vue";
2
+ import m from "../Icon.vue.js";
3
+ import { $t as n } from "../../utils/i18n.js";
4
+ const h = { class: "flex flex-col items-center justify-center py-28 gap-5 rounded-3xl border border-gray-150 bg-muted/50 w-full mt-4" }, y = { class: "w-17 h-17 rounded-full bg-gray-200/60 border border-gray-250 shadow-inner flex items-center justify-center" }, g = { class: "text-center space-y-1" }, _ = { class: "text-fs-5 font-semibold text-foreground tracking-tight" }, x = ["innerHTML"], k = /* @__PURE__ */ d({
4
5
  __name: "Empty",
5
6
  props: {
6
- title: { default: "No data found" },
7
- description: { default: "There is nothing to display here right now." },
7
+ title: {},
8
+ titleI18n: {},
9
+ description: {},
10
+ descriptionI18n: {},
8
11
  icon: { default: "lucide:inbox" }
9
12
  },
10
- setup(t) {
11
- return (o, g) => (i(), s("div", a, [
12
- e("div", f, [
13
- d(c, {
14
- icon: t.icon,
13
+ setup(r) {
14
+ const t = r, l = o(() => {
15
+ if (t.titleI18n) return n(t.titleI18n);
16
+ if (t.title) return t.title;
17
+ const e = n("vlite.empty.title");
18
+ return e !== "vlite.empty.title" ? e : "No data found";
19
+ }), c = o(() => {
20
+ if (t.descriptionI18n) return n(t.descriptionI18n);
21
+ if (t.description) return t.description;
22
+ const e = n("vlite.empty.description");
23
+ return e !== "vlite.empty.description" ? e : "There is nothing to display here right now.";
24
+ });
25
+ return (e, v) => (a(), p("div", h, [
26
+ i("div", y, [
27
+ u(m, {
28
+ icon: r.icon,
15
29
  class: "w-7 h-7 text-muted-foreground",
16
30
  "stroke-width": "1.2"
17
31
  }, null, 8, ["icon"])
18
32
  ]),
19
- e("div", u, [
20
- e("h3", m, l(t.title), 1),
21
- e("p", {
33
+ i("div", g, [
34
+ i("h3", _, f(l.value), 1),
35
+ i("p", {
22
36
  class: "text-sm text-gray-700 font-light leading-relaxed",
23
- innerHTML: t.description
24
- }, null, 8, h)
37
+ innerHTML: c.value
38
+ }, null, 8, x)
25
39
  ]),
26
- n(o.$slots, "action"),
27
- n(o.$slots, "default")
40
+ s(e.$slots, "action"),
41
+ s(e.$slots, "default")
28
42
  ]));
29
43
  }
30
44
  });
31
45
  export {
32
- _ as default
46
+ k as default
33
47
  };
@@ -17,6 +17,8 @@ interface Props {
17
17
  maxFiles?: number;
18
18
  variant?: 'dropzone' | 'input';
19
19
  placeholder?: string;
20
+ placeholderI18n?: string;
21
+ textI18n?: string;
20
22
  size?: InputSize;
21
23
  rounded?: InputRounded;
22
24
  }
@@ -49,8 +51,8 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
49
51
  size: InputSize;
50
52
  variant: "dropzone" | "input";
51
53
  modelValue: FilePickerValue | FilePickerValue[] | null;
52
- loading: boolean;
53
54
  rounded: InputRounded;
55
+ loading: boolean;
54
56
  multiSelect: boolean;
55
57
  fileTypes: string[];
56
58
  returnFormat: "file" | "base64";