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,13 +1,14 @@
1
- import { defineComponent as q, computed as c, resolveComponent as z, openBlock as s, createElementBlock as d, createElementVNode as r, normalizeClass as y, normalizeStyle as f, withModifiers as M, createVNode as L, createCommentVNode as k, createBlock as u, Fragment as v, renderList as w, toDisplayString as p } from "vue";
1
+ import { defineComponent as q, computed as c, resolveComponent as z, openBlock as s, createElementBlock as d, createElementVNode as r, normalizeClass as y, normalizeStyle as f, withModifiers as M, createVNode as N, createCommentVNode as k, createBlock as u, Fragment as v, renderList as p, toDisplayString as w } from "vue";
2
2
  import g from "../Icon.vue.js";
3
- import I from "../CheckBox.vue.js";
4
- const V = { class: "flex flex-col select-none" }, D = ["title"], O = {
3
+ import V from "../CheckBox.vue.js";
4
+ import { $t as D } from "../../utils/i18n.js";
5
+ const O = { class: "flex flex-col select-none" }, j = ["title"], U = {
5
6
  key: 1,
6
7
  class: "w-6 mr-1"
7
- }, j = { class: "mr-2 text-muted-foreground shrink-0" }, U = { class: "flex-1 truncate text-sm font-medium" }, A = { class: "mr-2 text-gray-400 select-none shrink-0" }, G = { class: "truncate" }, H = {
8
+ }, A = { class: "mr-2 text-muted-foreground shrink-0" }, G = { class: "flex-1 truncate text-sm font-medium" }, H = { class: "mr-2 text-gray-400 select-none shrink-0" }, J = { class: "truncate" }, R = {
8
9
  key: 0,
9
10
  class: "relative flex flex-col"
10
- }, X = /* @__PURE__ */ q({
11
+ }, _ = /* @__PURE__ */ q({
11
12
  name: "FileTreeNode",
12
13
  __name: "FileTreeNode",
13
14
  props: {
@@ -23,11 +24,11 @@ const V = { class: "flex flex-col select-none" }, D = ["title"], O = {
23
24
  searchQuery: {}
24
25
  },
25
26
  emits: ["toggle-expand", "toggle-select", "click-node"],
26
- setup(e, { emit: N }) {
27
- const n = e, m = N, b = c(() => n.selectedKeys.has(n.node.id)), S = c(() => n.indeterminateKeys.has(n.node.id)), x = c(() => n.expandedKeys.has(n.node.id)), C = c(() => n.loadingKeys.has(n.node.id)), h = c(
27
+ setup(e, { emit: S }) {
28
+ const n = e, m = S, b = c(() => n.selectedKeys.has(n.node.id)), F = c(() => n.indeterminateKeys.has(n.node.id)), x = c(() => n.expandedKeys.has(n.node.id)), C = c(() => n.loadingKeys.has(n.node.id)), h = c(
28
29
  () => n.node.isFolder || n.node.children && n.node.children.length > 0
29
- ), F = c(() => n.depth * 20 + "px"), T = c(() => {
30
- const t = n.node.label, l = 35;
30
+ ), T = c(() => n.depth * 20 + "px"), K = c(() => n.node.labelI18n ? D(n.node.labelI18n) : n.node.label), $ = c(() => {
31
+ const t = K.value, l = 35;
31
32
  if (t.length <= l) return t;
32
33
  const o = t.lastIndexOf(".");
33
34
  if (o === -1 || t.length - o > 10)
@@ -35,7 +36,7 @@ const V = { class: "flex flex-col select-none" }, D = ["title"], O = {
35
36
  const i = t.substring(o), a = t.substring(0, o), Q = Math.max(0, l - i.length - 3);
36
37
  return a.substring(0, Q) + "..." + i;
37
38
  }), B = c(() => {
38
- const t = T.value;
39
+ const t = $.value;
39
40
  if (!n.highlightSearch || !n.searchQuery)
40
41
  return [{ text: t, highlight: !1 }];
41
42
  const l = n.searchQuery.toLowerCase(), o = t.toLowerCase().indexOf(l);
@@ -56,16 +57,16 @@ const V = { class: "flex flex-col select-none" }, D = ["title"], O = {
56
57
  { text: l.substring(o, o + i), highlight: !0 },
57
58
  { text: l.substring(o + i), highlight: !1 }
58
59
  ];
59
- }), K = (t) => {
60
+ }), L = (t) => {
60
61
  t && t.stopPropagation(), m("toggle-expand", n.node);
61
- }, $ = () => {
62
+ }, I = () => {
62
63
  m("toggle-select", n.node);
63
64
  }, P = (t) => {
64
- t.stopPropagation(), h.value ? K() : n.selectionMode !== "none" && m("toggle-select", n.node), m("click-node", n.node);
65
+ t.stopPropagation(), h.value ? L() : n.selectionMode !== "none" && m("toggle-select", n.node), m("click-node", n.node);
65
66
  };
66
67
  return (t, l) => {
67
68
  const o = z("FileTreeNode", !0);
68
- return s(), d("div", V, [
69
+ return s(), d("div", O, [
69
70
  r("div", {
70
71
  class: y(["group flex flex-col rounded-md transition-colors cursor-pointer", {
71
72
  "bg-accent/50 text-accent-foreground": b.value && e.selectionMode === "single" && !e.showCheckboxes,
@@ -73,39 +74,39 @@ const V = { class: "flex flex-col select-none" }, D = ["title"], O = {
73
74
  "opacity-50 pointer-events-none": e.node.disabled
74
75
  }]),
75
76
  onClick: P,
76
- title: e.node.label
77
+ title: K.value
77
78
  }, [
78
79
  r("div", {
79
80
  class: "flex items-center py-1 pr-2 min-h-[32px]",
80
- style: f({ paddingLeft: F.value })
81
+ style: f({ paddingLeft: T.value })
81
82
  }, [
82
83
  h.value ? (s(), d("button", {
83
84
  key: 0,
84
85
  type: "button",
85
86
  class: y(["p-1 mr-1 rounded-sm hover:bg-muted text-muted-foreground transition-transform duration-200 focus:outline-none", { "rotate-90": x.value }]),
86
- onClick: M(K, ["stop"])
87
+ onClick: M(L, ["stop"])
87
88
  }, [
88
- L(g, {
89
+ N(g, {
89
90
  icon: "lucide:chevron-right",
90
91
  class: "w-4 h-4"
91
92
  })
92
- ], 2)) : (s(), d("div", O)),
93
+ ], 2)) : (s(), d("div", U)),
93
94
  e.showCheckboxes && e.selectionMode !== "none" ? (s(), d("div", {
94
95
  key: 2,
95
96
  class: "mr-2 flex items-center justify-center bg-transparent",
96
97
  onClick: l[0] || (l[0] = M(() => {
97
98
  }, ["stop"]))
98
99
  }, [
99
- L(I, {
100
+ N(V, {
100
101
  checked: b.value,
101
- indeterminate: S.value,
102
+ indeterminate: F.value,
102
103
  disabled: e.node.disabled,
103
- "onUpdate:checked": $,
104
+ "onUpdate:checked": I,
104
105
  rounded: "sm",
105
106
  size: "sm"
106
107
  }, null, 8, ["checked", "indeterminate", "disabled"])
107
108
  ])) : k("", !0),
108
- r("div", j, [
109
+ r("div", A, [
109
110
  C.value ? (s(), u(g, {
110
111
  key: 0,
111
112
  icon: "lucide:loader-2",
@@ -124,13 +125,13 @@ const V = { class: "flex flex-col select-none" }, D = ["title"], O = {
124
125
  class: "w-4 h-4"
125
126
  }))
126
127
  ]),
127
- r("div", U, [
128
- (s(!0), d(v, null, w(B.value, (i, a) => (s(), d("span", {
128
+ r("div", G, [
129
+ (s(!0), d(v, null, p(B.value, (i, a) => (s(), d("span", {
129
130
  key: a,
130
131
  class: y({
131
132
  "bg-yellow-100 text-yellow-900 rounded-sm px-0.5": i.highlight
132
133
  })
133
- }, p(i.text), 3))), 128))
134
+ }, w(i.text), 3))), 128))
134
135
  ])
135
136
  ], 4),
136
137
  e.node.searchMatch ? (s(), d("div", {
@@ -138,23 +139,23 @@ const V = { class: "flex flex-col select-none" }, D = ["title"], O = {
138
139
  class: "flex items-center text-[11px] text-gray-500 font-mono pr-2 pb-1.5 truncate",
139
140
  style: f({ paddingLeft: e.depth * 20 + 28 + "px" })
140
141
  }, [
141
- r("span", A, "L" + p(e.node.searchMatch.line_number), 1),
142
- r("div", G, [
143
- (s(!0), d(v, null, w(E.value, (i, a) => (s(), d("span", {
142
+ r("span", H, "L" + w(e.node.searchMatch.line_number), 1),
143
+ r("div", J, [
144
+ (s(!0), d(v, null, p(E.value, (i, a) => (s(), d("span", {
144
145
  key: a,
145
146
  class: y({
146
147
  "bg-yellow-500/20 text-gray-900 px-0.5 rounded-[1px] font-medium border border-yellow-600/30": i.highlight
147
148
  })
148
- }, p(i.text), 3))), 128))
149
+ }, w(i.text), 3))), 128))
149
150
  ])
150
151
  ], 4)) : k("", !0)
151
- ], 10, D),
152
- x.value && h.value && !C.value ? (s(), d("div", H, [
152
+ ], 10, j),
153
+ x.value && h.value && !C.value ? (s(), d("div", R, [
153
154
  r("div", {
154
155
  class: "absolute top-1 bottom-1 border-l border-border",
155
156
  style: f({ left: e.depth * 20 + 10 + "px" })
156
157
  }, null, 4),
157
- e.node.children && e.node.children.length > 0 ? (s(!0), d(v, { key: 0 }, w(e.node.children, (i) => (s(), u(o, {
158
+ e.node.children && e.node.children.length > 0 ? (s(!0), d(v, { key: 0 }, p(e.node.children, (i) => (s(), u(o, {
158
159
  key: i.id,
159
160
  node: i,
160
161
  depth: e.depth + 1,
@@ -180,5 +181,5 @@ const V = { class: "flex flex-col select-none" }, D = ["title"], O = {
180
181
  }
181
182
  });
182
183
  export {
183
- X as default
184
+ _ as default
184
185
  };
@@ -8,6 +8,7 @@ export interface SearchMatch {
8
8
  export interface FileNode {
9
9
  id: string;
10
10
  label: string;
11
+ labelI18n?: string;
11
12
  isFolder?: boolean;
12
13
  children?: FileNode[];
13
14
  icon?: string;
@@ -27,6 +28,8 @@ export interface FileTreeProps {
27
28
  highlightSearch?: boolean;
28
29
  searchQuery?: string;
29
30
  class?: string;
31
+ emptyText?: string;
32
+ emptyTextI18n?: string;
30
33
  }
31
34
  export interface FileTreeEvents {
32
35
  (e: 'update:modelValue', keys: string[]): void;
@@ -11,7 +11,9 @@ interface Props {
11
11
  minRows?: number;
12
12
  maxRows?: number;
13
13
  addButtonText?: string;
14
- label: string;
14
+ textI18n?: string;
15
+ label?: string;
16
+ labelI18n?: string;
15
17
  showRowNumbers?: boolean;
16
18
  /** All form values for context */
17
19
  values?: Record<string, any>;
@@ -1,7 +1,7 @@
1
1
  import o from "./CustomFields.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ce6a94e8"]]);
4
+ const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-2969f70d"]]);
5
5
  export {
6
- r as default
6
+ s as default
7
7
  };
@@ -1,26 +1,27 @@
1
- import { defineComponent as U, ref as E, watch as T, computed as b, openBlock as r, createElementBlock as n, createElementVNode as m, createVNode as c, withCtx as R, createTextVNode as D, toDisplayString as v, createCommentVNode as u, Fragment as h, renderList as w, normalizeClass as _, TransitionGroup as S } from "vue";
2
- import G from "./FormField.vue.js";
3
- import k from "../Button.vue.js";
4
- import H from "../Label.vue.js";
5
- const L = { class: "custom-fields-wrapper" }, M = { class: "flex justify-between items-center mb-2" }, q = { class: "custom-fields-table border border-border rounded overflow-hidden bg-background" }, J = {
1
+ import { defineComponent as I, computed as u, ref as L, watch as S, openBlock as o, createElementBlock as n, createElementVNode as f, createBlock as G, withCtx as k, createTextVNode as H, toDisplayString as m, createCommentVNode as i, createVNode as v, Fragment as p, renderList as w, normalizeClass as C, TransitionGroup as M } from "vue";
2
+ import q from "./FormField.vue.js";
3
+ import V from "../Button.vue.js";
4
+ import J from "../Label.vue.js";
5
+ import { $t as b } from "../../utils/i18n.js";
6
+ const K = { class: "custom-fields-wrapper" }, O = { class: "flex justify-between items-center mb-2" }, P = { class: "custom-fields-table border border-border rounded overflow-hidden bg-background" }, Q = {
6
7
  key: 0,
7
8
  class: "flex border-b border-border bg-muted/50 text-gray-800 text-xs font-semibold uppercase tracking-wider"
8
- }, K = {
9
+ }, W = {
9
10
  key: 0,
10
11
  class: "w-10 flex-none p-3 text-center border-r border-border"
11
- }, O = {
12
+ }, X = {
12
13
  key: 1,
13
14
  class: "w-10 flex-none p-3"
14
- }, P = {
15
+ }, Y = {
15
16
  key: 0,
16
17
  class: "w-10 flex-none flex items-center justify-center text-xs text-muted-foreground border-r border-border bg-muted/20"
17
- }, Q = {
18
+ }, Z = {
18
19
  key: 1,
19
20
  class: "w-10 flex-none flex items-center justify-center border-l border-border bg-muted/20"
20
- }, W = {
21
+ }, ee = {
21
22
  key: 1,
22
23
  class: "flex flex-col items-center justify-center py-6 text-center bg-muted/5"
23
- }, ee = /* @__PURE__ */ U({
24
+ }, te = { class: "text-sm font-medium text-foreground" }, le = { class: "text-xs text-muted-foreground mt-1" }, de = /* @__PURE__ */ I({
24
25
  __name: "CustomFields",
25
26
  props: {
26
27
  modelValue: { default: () => [] },
@@ -33,97 +34,108 @@ const L = { class: "custom-fields-wrapper" }, M = { class: "flex justify-between
33
34
  minRows: { default: 0 },
34
35
  maxRows: {},
35
36
  addButtonText: { default: "Add Row" },
37
+ textI18n: {},
36
38
  label: {},
39
+ labelI18n: {},
37
40
  showRowNumbers: { type: Boolean, default: !1 },
38
41
  values: {},
39
42
  isUpdate: { type: Boolean, default: !1 }
40
43
  },
41
44
  emits: ["update:modelValue", "change"],
42
- setup(d, { emit: C }) {
43
- const a = d, x = C, s = E([]), g = () => `row_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
44
- T(
45
- () => a.modelValue,
45
+ setup(d, { emit: F }) {
46
+ const t = d, x = F, g = u(() => t.labelI18n ? b(t.labelI18n) : t.label), N = u(() => {
47
+ const e = b("vlite.customFields.emptyTitle");
48
+ return e !== "vlite.customFields.emptyTitle" ? e : "No items added";
49
+ }), B = u(() => {
50
+ const e = b("vlite.customFields.emptyDescription");
51
+ return e !== "vlite.customFields.emptyDescription" ? e : "Add a new item to get started";
52
+ }), s = L([]), y = () => `row_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
53
+ S(
54
+ () => t.modelValue,
46
55
  (e) => {
47
- Array.isArray(e) ? s.value = e.map((t, o) => {
48
- const l = s.value[o];
56
+ Array.isArray(e) ? s.value = e.map((l, r) => {
57
+ const a = s.value[r];
49
58
  return {
50
- ...t,
51
- _id: l?._id || g()
59
+ ...l,
60
+ _id: a?._id || y()
52
61
  };
53
62
  }) : s.value = [];
54
63
  },
55
64
  { immediate: !0, deep: !0 }
56
65
  );
57
- const V = () => {
66
+ const $ = () => {
58
67
  const e = {};
59
- for (const t of a.schema) {
60
- const o = typeof t.value == "function" ? t.value() : t.value;
61
- e[t.name] = o ?? null;
68
+ for (const l of t.schema) {
69
+ const r = typeof l.value == "function" ? l.value() : l.value;
70
+ e[l.name] = r ?? null;
62
71
  }
63
- return { ...e, _id: g() };
64
- }, N = () => {
65
- if (a.disabled || a.maxRows && s.value.length >= a.maxRows) return;
66
- const e = [...s.value, V()];
67
- s.value = e, f(e);
68
- }, B = (e) => {
69
- if (a.disabled || s.value.length <= a.minRows) return;
70
- const t = [...s.value];
71
- t.splice(e, 1), s.value = t, f(t);
72
- }, $ = (e, t, o) => {
72
+ return { ...e, _id: y() };
73
+ }, T = () => {
74
+ if (t.disabled || t.maxRows && s.value.length >= t.maxRows) return;
75
+ const e = [...s.value, $()];
76
+ s.value = e, h(e);
77
+ }, z = (e) => {
78
+ if (t.disabled || s.value.length <= t.minRows) return;
73
79
  const l = [...s.value];
74
- l[e] = {
75
- ...l[e],
76
- [t]: o.value
77
- }, s.value = l, f(l);
78
- }, f = (e) => {
79
- const t = e.map(({ _id: o, ...l }) => l);
80
- x("update:modelValue", t), x("change", t);
81
- }, z = (e, t) => s.value[e]?.[t], A = b(() => !(a.disabled || a.maxRows && s.value.length >= a.maxRows)), p = b(() => a.disabled ? !1 : s.value.length > a.minRows), y = b(() => a.headers && a.headers.length > 0 ? a.headers : a.schema.map((e) => e.label || e.name));
82
- return (e, t) => (r(), n("div", L, [
83
- m("div", M, [
84
- c(H, { class: "text-sm font-medium text-foreground" }, {
85
- default: R(() => [
86
- D(v(d.label), 1)
80
+ l.splice(e, 1), s.value = l, h(l);
81
+ }, A = (e, l, r) => {
82
+ const a = [...s.value];
83
+ a[e] = {
84
+ ...a[e],
85
+ [l]: r.value
86
+ }, s.value = a, h(a);
87
+ }, h = (e) => {
88
+ const l = e.map(({ _id: r, ...a }) => a);
89
+ x("update:modelValue", l), x("change", l);
90
+ }, D = (e, l) => s.value[e]?.[l], E = u(() => !(t.disabled || t.maxRows && s.value.length >= t.maxRows)), _ = u(() => t.disabled ? !1 : s.value.length > t.minRows), R = u(() => t.headers && t.headers.length > 0 ? t.headers : t.schema.map((e) => e.labelI18n ? b(e.labelI18n) : e.label || e.name));
91
+ return (e, l) => (o(), n("div", K, [
92
+ f("div", O, [
93
+ g.value ? (o(), G(J, {
94
+ key: 0,
95
+ class: "text-sm font-medium text-foreground"
96
+ }, {
97
+ default: k(() => [
98
+ H(m(g.value), 1)
87
99
  ]),
88
100
  _: 1
89
- }),
90
- c(k, {
101
+ })) : i("", !0),
102
+ v(V, {
91
103
  type: "button",
92
104
  variant: "outline",
93
105
  size: "xs",
94
106
  rounded: "full",
95
107
  icon: "lucide:plus",
96
- disabled: !A.value,
97
- onClick: N
108
+ disabled: !E.value,
109
+ onClick: T
98
110
  }, null, 8, ["disabled"])
99
111
  ]),
100
- m("div", q, [
101
- y.value.length > 0 ? (r(), n("div", J, [
102
- d.showRowNumbers ? (r(), n("div", K, " # ")) : u("", !0),
103
- (r(!0), n(h, null, w(y.value, (o, l) => (r(), n("div", {
104
- key: l,
105
- class: _(["flex-1 p-3 min-w-0 truncate", { "border-l border-border": l > 0 }])
106
- }, v(o), 3))), 128)),
107
- p.value ? (r(), n("div", O)) : u("", !0)
108
- ])) : u("", !0),
109
- c(S, {
112
+ f("div", P, [
113
+ R.value.length > 0 ? (o(), n("div", Q, [
114
+ d.showRowNumbers ? (o(), n("div", W, " # ")) : i("", !0),
115
+ (o(!0), n(p, null, w(R.value, (r, a) => (o(), n("div", {
116
+ key: a,
117
+ class: C(["flex-1 p-3 min-w-0 truncate", { "border-l border-border": a > 0 }])
118
+ }, m(r), 3))), 128)),
119
+ _.value ? (o(), n("div", X)) : i("", !0)
120
+ ])) : i("", !0),
121
+ v(M, {
110
122
  name: "list",
111
123
  tag: "div",
112
124
  class: "divide-y divide-border"
113
125
  }, {
114
- default: R(() => [
115
- (r(!0), n(h, null, w(s.value, (o, l) => (r(), n("div", {
116
- key: o._id,
126
+ default: k(() => [
127
+ (o(!0), n(p, null, w(s.value, (r, a) => (o(), n("div", {
128
+ key: r._id,
117
129
  class: "flex group bg-white transition-colors"
118
130
  }, [
119
- d.showRowNumbers ? (r(), n("div", P, v(l + 1), 1)) : u("", !0),
120
- (r(!0), n(h, null, w(d.schema, (i, j) => (r(), n("div", {
121
- key: i.name,
122
- class: _(["flex-1 min-w-0 relative", { "border-l border-border": j > 0 }])
131
+ d.showRowNumbers ? (o(), n("div", Y, m(a + 1), 1)) : i("", !0),
132
+ (o(!0), n(p, null, w(d.schema, (c, j) => (o(), n("div", {
133
+ key: c.name,
134
+ class: C(["flex-1 min-w-0 relative", { "border-l border-border": j > 0 }])
123
135
  }, [
124
- c(G, {
125
- field: { ...i, label: void 0 },
126
- value: z(l, i.name),
136
+ v(q, {
137
+ field: { ...c, label: void 0 },
138
+ value: D(a, c.name),
127
139
  values: d.values || {},
128
140
  variant: "transparent",
129
141
  size: "sm",
@@ -131,31 +143,31 @@ const L = { class: "custom-fields-wrapper" }, M = { class: "flex justify-between
131
143
  disabled: d.disabled,
132
144
  isUpdate: d.isUpdate,
133
145
  class: "w-full h-full min-h-[40px]",
134
- onChange: (F) => $(l, i.name, F)
146
+ onChange: (U) => A(a, c.name, U)
135
147
  }, null, 8, ["field", "value", "values", "disabled", "isUpdate", "onChange"])
136
148
  ], 2))), 128)),
137
- p.value ? (r(), n("div", Q, [
138
- c(k, {
149
+ _.value ? (o(), n("div", Z, [
150
+ v(V, {
139
151
  type: "button",
140
152
  variant: "ghost",
141
153
  size: "xs",
142
154
  icon: "lucide:trash-2",
143
155
  disabled: d.disabled,
144
- onClick: (i) => B(l)
156
+ onClick: (c) => z(a)
145
157
  }, null, 8, ["disabled", "onClick"])
146
- ])) : u("", !0)
158
+ ])) : i("", !0)
147
159
  ]))), 128))
148
160
  ]),
149
161
  _: 1
150
162
  }),
151
- s.value.length === 0 ? (r(), n("div", W, [...t[0] || (t[0] = [
152
- m("p", { class: "text-sm font-medium text-foreground" }, "No items added", -1),
153
- m("p", { class: "text-xs text-muted-foreground mt-1" }, "Add a new item to get started", -1)
154
- ])])) : u("", !0)
163
+ s.value.length === 0 ? (o(), n("div", ee, [
164
+ f("p", te, m(N.value), 1),
165
+ f("p", le, m(B.value), 1)
166
+ ])) : i("", !0)
155
167
  ])
156
168
  ]));
157
169
  }
158
170
  });
159
171
  export {
160
- ee as default
172
+ de as default
161
173
  };
@@ -77,8 +77,8 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
77
77
  class: string;
78
78
  size: InputSize;
79
79
  variant: InputVariant;
80
- loading: boolean;
81
80
  rounded: InputRounded;
81
+ loading: boolean;
82
82
  className: string;
83
83
  headerClass: string;
84
84
  footerClass: string;
@@ -24,8 +24,8 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
24
24
  disabled: boolean;
25
25
  size: InputSize;
26
26
  variant: InputVariant;
27
- error: string;
28
27
  rounded: InputRounded;
28
+ error: string;
29
29
  readonly: boolean;
30
30
  isUpdate: boolean;
31
31
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;