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,39 +1,40 @@
1
- import { defineComponent as w, computed as g, openBlock as l, createElementBlock as s, normalizeClass as n, createElementVNode as a, normalizeStyle as b, createCommentVNode as u, Fragment as P, renderList as p, createVNode as S, createBlock as v, renderSlot as z, toDisplayString as x } from "vue";
1
+ import { defineComponent as S, computed as g, openBlock as l, createElementBlock as r, normalizeClass as a, createElementVNode as c, normalizeStyle as b, createCommentVNode as u, Fragment as z, renderList as j, createVNode as $, createBlock as v, renderSlot as C, toDisplayString as x } from "vue";
2
2
  import f from "./Icon.vue.js";
3
- const j = {
3
+ import { $t as y } from "../utils/i18n.js";
4
+ const I = {
4
5
  key: 0,
5
6
  class: "absolute top-4 left-4 right-4 h-0.5 bg-border",
6
7
  "aria-hidden": "true"
7
- }, C = {
8
+ }, B = {
8
9
  key: 1,
9
10
  class: "absolute top-4 left-4 right-4 h-0.5 bg-border block sm:hidden",
10
11
  "aria-hidden": "true"
11
- }, $ = ["onClick"], B = {
12
+ }, V = ["onClick"], N = {
12
13
  class: "flex h-9 w-9 items-center justify-center shrink-0 bg-background z-10",
13
14
  "aria-hidden": "true"
14
- }, V = {
15
+ }, D = {
15
16
  key: 0,
16
17
  class: "relative z-10 flex h-8 w-8 items-center justify-center rounded-full bg-primary hover:bg-primary-dark transition-colors"
17
- }, N = {
18
+ }, E = {
18
19
  key: 1,
19
20
  class: "relative z-10 flex h-8 w-8 items-center justify-center rounded-full border-2 border-primary bg-background"
20
- }, E = {
21
+ }, T = {
21
22
  key: 1,
22
23
  class: "h-2.5 w-2.5 rounded-full bg-primary"
23
- }, D = {
24
+ }, F = {
24
25
  key: 2,
25
26
  class: "relative z-10 flex h-8 w-8 items-center justify-center rounded-full border-2 bg-background group-hover:border-muted-foreground transition-colors"
26
- }, F = {
27
+ }, L = {
27
28
  key: 1,
28
29
  class: "h-2.5 w-2.5 rounded-full bg-transparent group-hover:bg-muted"
29
- }, L = {
30
+ }, M = {
30
31
  key: 0,
31
32
  class: "text-xs text-muted-foreground mt-1"
32
- }, M = {
33
+ }, q = {
33
34
  key: 0,
34
35
  class: "hidden sm:block flex-1 h-0.5 bg-border ml-2",
35
36
  "aria-hidden": "true"
36
- }, G = /* @__PURE__ */ w({
37
+ }, K = /* @__PURE__ */ S({
37
38
  __name: "Timeline",
38
39
  props: {
39
40
  steps: {},
@@ -44,131 +45,116 @@ const j = {
44
45
  class: { default: "" }
45
46
  },
46
47
  emits: ["step-click"],
47
- setup(e, { emit: y }) {
48
- const r = e, k = y, d = (c, m) => m.status ? m.status : c < r.activeStep ? "completed" : c === r.activeStep ? "current" : "upcoming", t = g(() => r.direction === "vertical"), h = g(() => r.steps.length <= 1 ? 0 : Math.min(r.activeStep, r.steps.length - 1) / (r.steps.length - 1) * 100);
49
- return (c, m) => (l(), s("nav", {
48
+ setup(t, { emit: k }) {
49
+ const s = t, w = k, d = (o, m) => m.status ? m.status : o < s.activeStep ? "completed" : o === s.activeStep ? "current" : "upcoming", e = g(() => s.direction === "vertical"), h = g(() => s.steps.length <= 1 ? 0 : Math.min(s.activeStep, s.steps.length - 1) / (s.steps.length - 1) * 100), p = (o) => o.titleI18n ? y(o.titleI18n) : o.title, P = (o) => o.descriptionI18n ? y(o.descriptionI18n) : o.description;
50
+ return (o, m) => (l(), r("nav", {
50
51
  "aria-label": "Progress",
51
- class: n(["w-full", r.class])
52
+ class: a(["w-full", s.class])
52
53
  }, [
53
- a("ol", {
54
+ c("ol", {
54
55
  role: "list",
55
- class: n([
56
+ class: a([
56
57
  "relative flex",
57
- // Vertical
58
- t.value ? "flex-col space-y-0" : "",
59
- // Horizontal: Bottom Text (Default) -> Justify Between
60
- !t.value && e.textPosition === "bottom" ? "flex-row w-full justify-between items-center" : "",
61
- // Horizontal: Right Text -> Standard Flex
62
- !t.value && e.textPosition === "right" ? "flex-row w-full" : ""
58
+ e.value ? "flex-col space-y-0" : "",
59
+ !e.value && t.textPosition === "bottom" ? "flex-row w-full justify-between items-center" : "",
60
+ !e.value && t.textPosition === "right" ? "flex-row w-full" : ""
63
61
  ])
64
62
  }, [
65
- !t.value && e.textPosition === "bottom" ? (l(), s("div", j, [
66
- a("div", {
63
+ !e.value && t.textPosition === "bottom" ? (l(), r("div", I, [
64
+ c("div", {
67
65
  class: "h-full bg-primary transition-all duration-300 ease-in-out",
68
66
  style: b({ width: `${h.value}%` })
69
67
  }, null, 4)
70
68
  ])) : u("", !0),
71
- !t.value && e.textPosition === "right" ? (l(), s("div", C, [
72
- a("div", {
69
+ !e.value && t.textPosition === "right" ? (l(), r("div", B, [
70
+ c("div", {
73
71
  class: "h-full bg-primary transition-all duration-300 ease-in-out",
74
72
  style: b({ width: `${h.value}%` })
75
73
  }, null, 4)
76
74
  ])) : u("", !0),
77
- (l(!0), s(P, null, p(e.steps, (i, o) => (l(), s("li", {
75
+ (l(!0), r(z, null, j(t.steps, (i, n) => (l(), r("li", {
78
76
  key: i.id,
79
- onClick: (T) => e.clickable ? k("step-click", i, o) : null,
80
- class: n([
77
+ onClick: (A) => t.clickable ? w("step-click", i, n) : null,
78
+ class: a([
81
79
  "relative",
82
- e.clickable ? "cursor-pointer" : "",
83
- // Vertical
84
- t.value ? "w-full pb-10 last:pb-0" : "",
85
- // Horizontal Bottom: Fixed Width Icon Anchor
86
- !t.value && e.textPosition === "bottom" ? "flex-none w-8" : "",
87
- // Horizontal Right: Flex-1 to spread out (Desktop), Mobile acts as fixed width
88
- !t.value && e.textPosition === "right" ? "flex-1 last:flex-none" : ""
80
+ t.clickable ? "cursor-pointer" : "",
81
+ e.value ? "w-full pb-10 last:pb-0" : "",
82
+ !e.value && t.textPosition === "bottom" ? "flex-none w-8" : "",
83
+ !e.value && t.textPosition === "right" ? "flex-1 last:flex-none" : ""
89
84
  ])
90
85
  }, [
91
- t.value && o !== e.steps.length - 1 ? (l(), s("div", {
86
+ e.value && n !== t.steps.length - 1 ? (l(), r("div", {
92
87
  key: 0,
93
- class: n(["hidden sm:block absolute top-4 left-4 -ml-px h-full w-0.5 bg-border", { "bg-primary": o < e.activeStep }]),
88
+ class: a(["hidden sm:block absolute top-4 left-4 -ml-px h-full w-0.5 bg-border", { "bg-primary": n < t.activeStep }]),
94
89
  "aria-hidden": "true"
95
90
  }, null, 2)) : u("", !0),
96
- a("div", {
97
- class: n([
91
+ c("div", {
92
+ class: a([
98
93
  "group relative flex",
99
- // Vertical Layout
100
- t.value ? "flex-col items-center text-center sm:flex-row sm:items-start sm:text-left" : "",
101
- // Horizontal Bottom or Mobile Default
102
- !t.value && e.textPosition === "bottom" ? "flex-col items-center justify-center" : "",
103
- // Horizontal Right (Desktop) -> Row with gap
104
- // Mobile -> Fallback to Col (Icon Only effectively)
105
- !t.value && e.textPosition === "right" ? "flex-col items-center sm:flex-row sm:items-center sm:gap-2 w-full" : ""
94
+ e.value ? "flex-col items-center text-center sm:flex-row sm:items-start sm:text-left" : "",
95
+ !e.value && t.textPosition === "bottom" ? "flex-col items-center justify-center" : "",
96
+ !e.value && t.textPosition === "right" ? "flex-col items-center sm:flex-row sm:items-center sm:gap-2 w-full" : ""
106
97
  ])
107
98
  }, [
108
- a("span", B, [
109
- d(o, i) === "completed" ? (l(), s("span", V, [
110
- S(f, {
99
+ c("span", N, [
100
+ d(n, i) === "completed" ? (l(), r("span", D, [
101
+ $(f, {
111
102
  icon: "lucide:check",
112
103
  class: "h-5 w-5 text-primary-foreground"
113
104
  })
114
- ])) : d(o, i) === "current" ? (l(), s("span", N, [
105
+ ])) : d(n, i) === "current" ? (l(), r("span", E, [
115
106
  i.icon ? (l(), v(f, {
116
107
  key: 0,
117
108
  icon: i.icon,
118
109
  class: "h-4 w-4 text-primary"
119
- }, null, 8, ["icon"])) : (l(), s("span", E))
120
- ])) : (l(), s("span", D, [
110
+ }, null, 8, ["icon"])) : (l(), r("span", T))
111
+ ])) : (l(), r("span", F, [
121
112
  i.icon ? (l(), v(f, {
122
113
  key: 0,
123
114
  icon: i.icon,
124
115
  class: "h-4 w-4 text-muted-foreground"
125
- }, null, 8, ["icon"])) : (l(), s("span", F))
116
+ }, null, 8, ["icon"])) : (l(), r("span", L))
126
117
  ]))
127
118
  ]),
128
- a("span", {
129
- class: n([
119
+ c("span", {
120
+ class: a([
130
121
  "min-w-[max-content] flex-col",
131
122
  "hidden sm:flex",
132
- // Hide on mobile (Icon Only rule)
133
- // Vertical: Margin Left
134
- t.value ? "sm:ml-4 sm:pt-1.5" : "",
135
- // Horizontal Bottom: Absolute Below
136
- !t.value && e.textPosition === "bottom" ? "absolute top-10 text-center" : "",
137
- // Horizontal Bottom Alignment specific
138
- !t.value && e.textPosition === "bottom" && o === 0 ? "left-0 text-left items-start" : "",
139
- !t.value && e.textPosition === "bottom" && o === e.steps.length - 1 ? "right-0 text-right items-end" : "",
140
- !t.value && e.textPosition === "bottom" && o > 0 && o < e.steps.length - 1 ? "left-1/2 -translate-x-1/2 items-center" : "",
141
- // Horizontal Right: No absolute, just flow
142
- (!t.value && e.textPosition === "right", "")
123
+ e.value ? "sm:ml-4 sm:pt-1.5" : "",
124
+ !e.value && t.textPosition === "bottom" ? "absolute top-10 text-center" : "",
125
+ !e.value && t.textPosition === "bottom" && n === 0 ? "left-0 text-left items-start" : "",
126
+ !e.value && t.textPosition === "bottom" && n === t.steps.length - 1 ? "right-0 text-right items-end" : "",
127
+ !e.value && t.textPosition === "bottom" && n > 0 && n < t.steps.length - 1 ? "left-1/2 -translate-x-1/2 items-center" : "",
128
+ (!e.value && t.textPosition === "right", "")
143
129
  ])
144
130
  }, [
145
- z(c.$slots, "content", {
131
+ C(o.$slots, "content", {
146
132
  step: i,
147
- index: o
133
+ index: n
148
134
  }, () => [
149
- a("span", {
150
- class: n([
135
+ c("span", {
136
+ class: a([
151
137
  "text-sm font-medium leading-tight",
152
- d(o, i) === "upcoming" ? "text-muted-foreground" : "text-primary"
138
+ d(n, i) === "upcoming" ? "text-muted-foreground" : "text-primary"
153
139
  ])
154
- }, x(i.title), 3),
155
- i.description ? (l(), s("span", L, x(i.description), 1)) : u("", !0)
140
+ }, x(p(i)), 3),
141
+ i.description || i.descriptionI18n ? (l(), r("span", M, x(P(i)), 1)) : u("", !0)
156
142
  ])
157
143
  ], 2),
158
- !t.value && e.textPosition === "right" && o !== e.steps.length - 1 ? (l(), s("div", M, [
159
- a("div", {
160
- class: n([
144
+ !e.value && t.textPosition === "right" && n !== t.steps.length - 1 ? (l(), r("div", q, [
145
+ c("div", {
146
+ class: a([
161
147
  "h-full bg-primary transition-all duration-300",
162
- o < e.activeStep ? "w-full" : "w-0"
148
+ n < t.activeStep ? "w-full" : "w-0"
163
149
  ])
164
150
  }, null, 2)
165
151
  ])) : u("", !0)
166
152
  ], 2)
167
- ], 10, $))), 128))
153
+ ], 10, V))), 128))
168
154
  ], 2)
169
155
  ], 2));
170
156
  }
171
157
  });
172
158
  export {
173
- G as default
159
+ K as default
174
160
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./ToastNotification.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-6b631840"]]);
4
+ const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-dc3a3b49"]]);
5
5
  export {
6
- f as default
6
+ c as default
7
7
  };
@@ -1,7 +1,8 @@
1
1
  import { TooltTipProps } from 'v-tooltip-lite/types';
2
- type __VLS_Props = TooltTipProps & {
2
+ interface Props extends TooltTipProps {
3
3
  disabled?: boolean;
4
- };
4
+ contentI18n?: string;
5
+ }
5
6
  declare function __VLS_template(): {
6
7
  attrs: Partial<{}>;
7
8
  slots: {
@@ -13,7 +14,7 @@ declare function __VLS_template(): {
13
14
  rootEl: any;
14
15
  };
15
16
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
- declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
17
+ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
17
18
  disabled: boolean;
18
19
  triggerClass: string;
19
20
  contentClass: string;
@@ -1,12 +1,15 @@
1
- import { defineComponent as n, openBlock as l, createElementBlock as r, renderSlot as o, createBlock as c, unref as i, mergeProps as d, withCtx as a } from "vue";
2
- import p from "v-tooltip-lite";
1
+ import { defineComponent as r, computed as c, openBlock as l, createElementBlock as i, renderSlot as n, createBlock as d, unref as p, mergeProps as u, withCtx as a } from "vue";
2
+ import f from "v-tooltip-lite";
3
3
  import "v-tooltip-lite/style.css";
4
- const f = {
4
+ import { $t as m } from "../utils/i18n.js";
5
+ const g = {
5
6
  key: 0,
6
7
  class: "contents"
7
- }, y = /* @__PURE__ */ n({
8
+ }, b = /* @__PURE__ */ r({
8
9
  __name: "Tooltip",
9
10
  props: {
11
+ disabled: { type: Boolean, default: !1 },
12
+ contentI18n: {},
10
13
  content: {},
11
14
  placement: { default: "top" },
12
15
  offset: {},
@@ -19,27 +22,26 @@ const f = {
19
22
  styles: {},
20
23
  ignoreClickOutside: {},
21
24
  isOpen: { type: Boolean },
22
- menuId: {},
23
- disabled: { type: Boolean, default: !1 }
25
+ menuId: {}
24
26
  },
25
- setup(e) {
26
- const s = e;
27
- return (t, u) => e.disabled ? (l(), r("div", f, [
28
- o(t.$slots, "default")
29
- ])) : (l(), c(i(p), d({ key: 1 }, s, {
27
+ setup(t) {
28
+ const e = t, s = c(() => e.contentI18n ? m(e.contentI18n) : e.content);
29
+ return (o, y) => t.disabled ? (l(), i("div", g, [
30
+ n(o.$slots, "default")
31
+ ])) : (l(), d(p(f), u({ key: 1 }, { ...e, content: s.value }, {
30
32
  class: "inline-block",
31
- "class-name": `basic-tooltip ${e.className}`
33
+ "class-name": `basic-tooltip ${t.className}`
32
34
  }), {
33
35
  trigger: a(() => [
34
- o(t.$slots, "default")
36
+ n(o.$slots, "default")
35
37
  ]),
36
38
  default: a(() => [
37
- o(t.$slots, "content")
39
+ n(o.$slots, "content")
38
40
  ]),
39
41
  _: 3
40
42
  }, 16, ["class-name"]));
41
43
  }
42
44
  });
43
45
  export {
44
- y as default
46
+ b as default
45
47
  };
@@ -1,19 +1,20 @@
1
- import { defineComponent as S, ref as g, computed as y, openBlock as a, createElementBlock as c, normalizeClass as D, createElementVNode as r, withModifiers as f, createBlock as b, withCtx as v, createVNode as d, createCommentVNode as C, withDirectives as V, vModelText as N, toDisplayString as k, unref as O, createTextVNode as j, nextTick as M } from "vue";
2
- import u from "../Icon.vue.js";
3
- import R from "../Dropdown/Dropdown.vue.js";
4
- import z from "../IconPicker.vue.js";
5
- const A = {
1
+ import { defineComponent as N, ref as g, computed as v, openBlock as a, createElementBlock as d, normalizeClass as D, createElementVNode as c, withModifiers as p, createBlock as y, withCtx as h, createVNode as u, createCommentVNode as w, withDirectives as O, vModelText as j, toDisplayString as C, unref as M, createTextVNode as R, nextTick as z } from "vue";
2
+ import m from "../Icon.vue.js";
3
+ import A from "../Dropdown/Dropdown.vue.js";
4
+ import { $t as s } from "../../utils/i18n.js";
5
+ import K from "../IconPicker.vue.js";
6
+ const U = {
6
7
  type: "button",
7
8
  class: "flex items-center justify-center rounded hover:bg-accent transition-colors p-0.5 outline-none focus-visible:ring-2 focus-visible:ring-primary/20 mt-1"
8
- }, K = {
9
+ }, q = {
9
10
  key: 1,
10
11
  class: "flex items-center justify-center p-0.5"
11
- }, U = { class: "flex-1 min-w-0 pr-1" }, q = {
12
+ }, F = { class: "flex-1 min-w-0 pr-1" }, G = {
12
13
  key: 1,
13
14
  class: "block truncate text-sm font-medium leading-normal"
14
- }, F = { class: "p-1 rounded-md hover:bg-accent text-muted-foreground hover:text-foreground transition-colors" }, G = {
15
+ }, H = { class: "p-1 rounded-md hover:bg-accent text-muted-foreground hover:text-foreground transition-colors" }, J = {
15
16
  class: /* @__PURE__ */ D(["flex items-center"])
16
- }, Q = /* @__PURE__ */ S({
17
+ }, Y = /* @__PURE__ */ N({
17
18
  __name: "Sheet",
18
19
  props: {
19
20
  sheet: {},
@@ -28,24 +29,32 @@ const A = {
28
29
  inactiveItemClass: { default: "" }
29
30
  },
30
31
  emits: ["select", "update:title", "update:icon", "edit-start", "edit-end", "duplicate", "delete"],
31
- setup(i, { emit: w }) {
32
- const e = i, l = w, m = g(null), s = g(e.sheet.title), p = () => {
33
- s.value = e.sheet.title, l("edit-start", e.sheet.id), M(() => {
34
- m.value?.focus(), m.value?.select();
32
+ setup(o, { emit: E }) {
33
+ const e = o, n = E, f = g(null), r = g(e.sheet.title), T = v(() => e.sheet.titleI18n ? s(e.sheet.titleI18n) : e.sheet.title), k = () => {
34
+ r.value = e.sheet.title, n("edit-start", e.sheet.id), z(() => {
35
+ f.value?.focus(), f.value?.select();
35
36
  });
36
- }, h = () => {
37
+ }, b = () => {
37
38
  if (!e.isEditing) return;
38
- const t = s.value.trim();
39
- t ? l("update:title", e.sheet.id, t) : s.value = e.sheet.title, l("edit-end", e.sheet.id);
40
- }, E = () => {
41
- s.value = e.sheet.title, l("edit-end", e.sheet.id);
42
- }, T = (t) => {
43
- t.key === "Enter" && h(), t.key === "Escape" && E();
44
- }, B = y(() => [
45
- { label: "Rename", value: "rename", icon: "lucide:pencil" },
46
- { label: "Duplicate", value: "duplicate", icon: "lucide:copy" },
39
+ const t = r.value.trim();
40
+ t ? n("update:title", e.sheet.id, t) : r.value = e.sheet.title, n("edit-end", e.sheet.id);
41
+ }, B = () => {
42
+ r.value = e.sheet.title, n("edit-end", e.sheet.id);
43
+ }, I = (t) => {
44
+ t.key === "Enter" && b(), t.key === "Escape" && B();
45
+ }, $ = v(() => [
47
46
  {
48
- label: "Delete",
47
+ label: s("vlite.workbook.rename") !== "vlite.workbook.rename" ? s("vlite.workbook.rename") : "Rename",
48
+ value: "rename",
49
+ icon: "lucide:pencil"
50
+ },
51
+ {
52
+ label: s("vlite.workbook.duplicate") !== "vlite.workbook.duplicate" ? s("vlite.workbook.duplicate") : "Duplicate",
53
+ value: "duplicate",
54
+ icon: "lucide:copy"
55
+ },
56
+ {
57
+ label: s("vlite.workbook.delete") !== "vlite.workbook.delete" ? s("vlite.workbook.delete") : "Delete",
49
58
  value: "delete",
50
59
  icon: "lucide:trash-2",
51
60
  class: "text-danger",
@@ -57,101 +66,101 @@ const A = {
57
66
  cancelText: e.confirmDeleteTexts?.cancel,
58
67
  variant: "danger",
59
68
  onConfirm: () => {
60
- e.canDelete && l("delete", e.sheet.id);
69
+ e.canDelete && n("delete", e.sheet.id);
61
70
  }
62
71
  } : void 0
63
72
  }
64
- ]), I = (t) => {
65
- if (t.value === "rename" && p(), t.value === "duplicate" && l("duplicate", e.sheet.id), t.value === "delete") {
73
+ ]), S = (t) => {
74
+ if (t.value === "rename" && k(), t.value === "duplicate" && n("duplicate", e.sheet.id), t.value === "delete") {
66
75
  if (!e.canDelete || e.confirmDelete) return;
67
- l("delete", e.sheet.id);
76
+ n("delete", e.sheet.id);
68
77
  }
69
78
  }, x = (t) => {
70
- t && t.value && t.value !== "delete" || e.canDelete && l("delete", e.sheet.id);
71
- }, $ = y(() => [
79
+ t && t.value && t.value !== "delete" || e.canDelete && n("delete", e.sheet.id);
80
+ }, V = v(() => [
72
81
  "group relative flex items-center min-w-[120px] max-w-[240px] h-9 px-3 border-r border-border select-none cursor-pointer transition-all duration-200 ease-out",
73
82
  e.itemClass,
74
83
  e.isActive ? `bg-muted text-foreground ring-1 ring-border ring-b-0 z-10 ${e.activeItemClass}` : `text-muted-foreground hover:bg-accent/50 ${e.inactiveItemClass}`,
75
84
  e.isEditing ? "cursor-text" : ""
76
85
  ].filter(Boolean).join(" "));
77
- return (t, n) => (a(), c("div", {
78
- class: D($.value),
79
- onClick: n[5] || (n[5] = (o) => l("select", i.sheet.id)),
80
- onDblclick: p
86
+ return (t, i) => (a(), d("div", {
87
+ class: D(V.value),
88
+ onClick: i[5] || (i[5] = (l) => n("select", o.sheet.id)),
89
+ onDblclick: k
81
90
  }, [
82
- r("div", {
83
- onClick: n[1] || (n[1] = f(() => {
91
+ c("div", {
92
+ onClick: i[1] || (i[1] = p(() => {
84
93
  }, ["stop"])),
85
94
  class: "mr-2 flex items-center shrink-0"
86
95
  }, [
87
- (i.sheet.icon || i.isEditing) && i.allowIconChange ? (a(), b(z, {
96
+ (o.sheet.icon || o.isEditing) && o.allowIconChange ? (a(), y(K, {
88
97
  key: 0,
89
- value: i.sheet.icon || "lucide:file",
98
+ value: o.sheet.icon || "lucide:file",
90
99
  position: "bottom-start",
91
- onOnSelect: n[0] || (n[0] = (o) => l("update:icon", i.sheet.id, o))
100
+ onOnSelect: i[0] || (i[0] = (l) => n("update:icon", o.sheet.id, l))
92
101
  }, {
93
- default: v(() => [
94
- r("button", A, [
95
- d(u, {
96
- icon: i.sheet.icon || "lucide:file",
102
+ default: h(() => [
103
+ c("button", U, [
104
+ u(m, {
105
+ icon: o.sheet.icon || "lucide:file",
97
106
  class: "w-4 h-4 opacity-70 hover:opacity-100 transition-opacity"
98
107
  }, null, 8, ["icon"])
99
108
  ])
100
109
  ]),
101
110
  _: 1
102
- }, 8, ["value"])) : i.sheet.icon ? (a(), c("div", K, [
103
- d(u, {
104
- icon: i.sheet.icon,
111
+ }, 8, ["value"])) : o.sheet.icon ? (a(), d("div", q, [
112
+ u(m, {
113
+ icon: o.sheet.icon,
105
114
  class: "w-4 h-4 opacity-70"
106
115
  }, null, 8, ["icon"])
107
- ])) : C("", !0)
116
+ ])) : w("", !0)
108
117
  ]),
109
- r("div", U, [
110
- i.isEditing ? V((a(), c("input", {
118
+ c("div", F, [
119
+ o.isEditing ? O((a(), d("input", {
111
120
  key: 0,
112
121
  ref_key: "inputRef",
113
- ref: m,
114
- "onUpdate:modelValue": n[2] || (n[2] = (o) => s.value = o),
122
+ ref: f,
123
+ "onUpdate:modelValue": i[2] || (i[2] = (l) => r.value = l),
115
124
  type: "text",
116
125
  class: "w-full bg-transparent border-none outline-none p-0 text-sm font-medium text-foreground placeholder-muted-foreground focus:ring-0",
117
- onBlur: h,
118
- onKeydown: T,
119
- onClick: n[3] || (n[3] = f(() => {
126
+ onBlur: b,
127
+ onKeydown: I,
128
+ onClick: i[3] || (i[3] = p(() => {
120
129
  }, ["stop"]))
121
130
  }, null, 544)), [
122
- [N, s.value]
123
- ]) : (a(), c("span", q, k(i.sheet.title), 1))
131
+ [j, r.value]
132
+ ]) : (a(), d("span", G, C(T.value), 1))
124
133
  ]),
125
- r("div", {
134
+ c("div", {
126
135
  class: "opacity-0 group-hover:opacity-100 transition-opacity ml-auto pl-1 flex items-center bg-inherit",
127
- onClick: n[4] || (n[4] = f(() => {
136
+ onClick: i[4] || (i[4] = p(() => {
128
137
  }, ["stop"]))
129
138
  }, [
130
- d(O(R), {
131
- options: B.value,
139
+ u(M(A), {
140
+ options: $.value,
132
141
  position: "bottom-end",
133
142
  width: "140px",
134
143
  teleport: !0,
135
- onOnSelect: I,
144
+ onOnSelect: S,
136
145
  onOnConfirm: x,
137
146
  onConfirm: x
138
147
  }, {
139
- trigger: v(() => [
140
- r("button", F, [
141
- d(u, {
148
+ trigger: h(() => [
149
+ c("button", H, [
150
+ u(m, {
142
151
  icon: "lucide:more-vertical",
143
152
  class: "w-3.5 h-3.5"
144
153
  })
145
154
  ])
146
155
  ]),
147
- item: v(({ option: o }) => [
148
- r("div", G, [
149
- o?.icon ? (a(), b(u, {
156
+ item: h(({ option: l }) => [
157
+ c("div", J, [
158
+ l?.icon ? (a(), y(m, {
150
159
  key: 0,
151
- icon: o?.icon,
160
+ icon: l?.icon,
152
161
  class: "w-3.5 h-3.5 mr-2 opacity-70"
153
- }, null, 8, ["icon"])) : C("", !0),
154
- j(" " + k(o?.label), 1)
162
+ }, null, 8, ["icon"])) : w("", !0),
163
+ R(" " + C(l?.label), 1)
155
164
  ])
156
165
  ]),
157
166
  _: 1
@@ -161,5 +170,5 @@ const A = {
161
170
  }
162
171
  });
163
172
  export {
164
- Q as default
173
+ Y as default
165
174
  };
@@ -1,20 +1,24 @@
1
- import { defineComponent as i, openBlock as r, createBlock as c } from "vue";
2
- import m from "../Button.vue.js";
3
- const u = /* @__PURE__ */ i({
1
+ import { defineComponent as c, computed as l, openBlock as m, createBlock as s } from "vue";
2
+ import d from "../Button.vue.js";
3
+ import { $t as u } from "../../utils/i18n.js";
4
+ const f = /* @__PURE__ */ c({
4
5
  __name: "WorkbookAddButton",
5
6
  emits: ["click"],
6
- setup(s, { emit: o }) {
7
- const t = o;
8
- return (d, e) => (r(), c(m, {
7
+ setup(k, { emit: o }) {
8
+ const n = o, i = l(() => {
9
+ const t = u("vlite.workbook.addSheet");
10
+ return t !== "vlite.workbook.addSheet" ? t : "Add New Sheet";
11
+ });
12
+ return (t, e) => (m(), s(d, {
9
13
  variant: "ghost",
10
14
  size: "sm",
11
15
  icon: "lucide:plus",
12
- title: "Add New Sheet",
16
+ title: i.value,
13
17
  rounded: "none",
14
- onClick: e[0] || (e[0] = (n) => t("click", n))
15
- }));
18
+ onClick: e[0] || (e[0] = (r) => n("click", r))
19
+ }, null, 8, ["title"]));
16
20
  }
17
21
  });
18
22
  export {
19
- u as default
23
+ f as default
20
24
  };
@@ -1,6 +1,7 @@
1
1
  export interface WorkbookSheet {
2
2
  id: string;
3
3
  title: string;
4
+ titleI18n?: string;
4
5
  icon?: string;
5
6
  content?: string;
6
7
  closable?: boolean;
package/core/config.d.ts CHANGED
@@ -12,6 +12,7 @@ export declare const VLITE_CONFIG_KEY: InjectionKey<VLiteConfig>;
12
12
  export declare const configState: {
13
13
  services?: {
14
14
  upload?: import('..').FileUploadHandler;
15
+ t?: import('..').TranslationHandler;
15
16
  };
16
17
  };
17
18
  /**
@@ -25,5 +26,6 @@ export declare function updateConfig(updates: Partial<VLiteConfig>): void;
25
26
  export declare function useVLiteConfig(): {
26
27
  services?: {
27
28
  upload?: import('..').FileUploadHandler;
29
+ t?: import('..').TranslationHandler;
28
30
  };
29
31
  };
package/index.d.ts CHANGED
@@ -54,6 +54,7 @@ export * from './directives/vScrollReveal';
54
54
  export { createVLite, useVLiteConfig } from './core';
55
55
  export { GoogleSignInPlugin };
56
56
  export * from './utils';
57
+ export { $t } from './utils/i18n';
57
58
  export * from './types';
58
59
  export * from './components/DataList';
59
60
  export * from './components/Screen';