vlite3 0.7.13 → 0.7.15

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 (58) hide show
  1. package/components/Button.vue.js +1 -1
  2. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  3. package/components/ColorPicker/ColorPicker.vue.js +18 -17
  4. package/components/{CommandPaletteContent.vue.d.ts → CommandPalette/CommandPaletteContent.vue.d.ts} +3 -3
  5. package/components/CommandPalette/CommandPaletteContent.vue.js +7 -0
  6. package/components/CommandPalette/CommandPaletteContent.vue2.js +180 -0
  7. package/components/CommandPalette/CommandPaletteItem.vue.d.ts +15 -0
  8. package/components/CommandPalette/CommandPaletteItem.vue2.js +7 -0
  9. package/components/CommandPalette/CommandPaletteItem.vue3.js +60 -0
  10. package/components/CommandPalette/index.d.ts +5 -0
  11. package/components/CommandPalette/types.d.ts +40 -0
  12. package/components/CommandPalette/useCommandPaletteItems.d.ts +15 -0
  13. package/components/CommandPalette/useCommandPaletteItems.js +99 -0
  14. package/components/CommandPalette/useCommandPaletteNav.d.ts +13 -0
  15. package/components/CommandPalette/useCommandPaletteNav.js +49 -0
  16. package/components/DataList/DataList.vue.js +53 -50
  17. package/components/DataTable/DataTable.vue.js +185 -173
  18. package/components/DatePicker.vue.js +3 -2
  19. package/components/DateRangePicker.vue.js +26 -25
  20. package/components/Dropdown/Dropdown.vue.js +20 -20
  21. package/components/Dropdown/DropdownMenu.vue.js +5 -256
  22. package/components/Dropdown/DropdownMenu.vue2.js +256 -2
  23. package/components/Form/CustomFields.vue.js +1 -1
  24. package/components/Form/CustomFields.vue2.js +102 -97
  25. package/components/Form/Form.vue.d.ts +0 -1
  26. package/components/Form/Form.vue.js +2 -2
  27. package/components/Form/Form.vue2.js +20 -20
  28. package/components/Form/FormFields.vue.js +2 -2
  29. package/components/Form/FormFields.vue2.js +90 -78
  30. package/components/IconPicker.vue.js +3 -2
  31. package/components/ImportData/ImportStep2.vue.js +10 -9
  32. package/components/List/List.vue.js +205 -180
  33. package/components/Modal.vue.js +2 -2
  34. package/components/Modal.vue2.js +82 -96
  35. package/components/MultiSelect/MultiSelect.vue.js +7 -7
  36. package/components/Navbar/Navbar.vue.js +12 -12
  37. package/components/NavbarCommandPalette.vue.d.ts +7 -30
  38. package/components/NavbarCommandPalette.vue.js +40 -40
  39. package/components/PermissionMatrix/PermissionEditorList.vue.js +1 -1
  40. package/components/PermissionMatrix/PermissionEditorList.vue2.js +84 -75
  41. package/components/PermissionMatrix/PermissionEditorMatrix.vue.js +2 -2
  42. package/components/PermissionMatrix/PermissionEditorMatrix.vue2.js +122 -107
  43. package/components/PermissionMatrix/PermissionMatrix.vue.js +2 -2
  44. package/components/PermissionMatrix/PermissionMatrix.vue2.js +161 -138
  45. package/components/PermissionMatrix/PermissionTopBar.vue.js +19 -18
  46. package/components/Screen/Screen.vue.js +169 -166
  47. package/components/Screen/ScreenFilter.vue.js +4 -3
  48. package/components/SidePanel.vue.js +5 -146
  49. package/components/SidePanel.vue2.js +146 -2
  50. package/components/SidebarMenu/SidebarMenuItem.vue.js +26 -25
  51. package/components/Workbook/Sheet.vue.js +3 -2
  52. package/index.d.ts +1 -1
  53. package/index.js +1 -1
  54. package/package.json +1 -1
  55. package/style.css +1 -1
  56. package/components/CommandPaletteContent.vue.js +0 -7
  57. package/components/CommandPaletteContent.vue2.js +0 -311
  58. /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
@@ -1,4 +1,258 @@
1
- import f from "./DropdownMenu.vue.js";
1
+ import { defineComponent as ee, ref as B, computed as v, watch as C, onMounted as te, onBeforeUnmount as le, openBlock as o, createElementBlock as i, createVNode as j, createCommentVNode as d, renderSlot as b, unref as r, normalizeStyle as se, normalizeClass as T, toDisplayString as E, createBlock as m, Fragment as N, renderList as oe, withCtx as P, createElementVNode as S, createSlots as ne, mergeProps as re, nextTick as ae } from "vue";
2
+ import O from "../Icon.vue.js";
3
+ import ie from "../Input.vue.js";
4
+ /* empty css */
5
+ import ce from "./DropdownItem.vue.js";
6
+ import de from "./DropdownBooleanItem.vue.js";
7
+ import ue from "./DropdownGroupedLayout.vue.js";
8
+ import { useDropdownNavigation as fe } from "./composables/useDropdownNavigation.js";
9
+ import { useDropdownIds as me } from "./composables/useDropdownIds.js";
10
+ import { $t as $ } from "../../utils/i18n.js";
11
+ import he from "./Dropdown.vue.js";
12
+ const ve = ["dir"], ye = {
13
+ key: 0,
14
+ class: "bg-body border-b z-10 rounded-t-md shrink-0"
15
+ }, ge = {
16
+ key: 1,
17
+ class: "shrink-0"
18
+ }, be = {
19
+ key: 0,
20
+ class: "px-2 py-6 text-center text-sm text-muted-foreground"
21
+ }, ke = {
22
+ key: 0,
23
+ class: "h-px bg-border my-1 mx-1"
24
+ }, we = ["onMouseenter"], pe = { class: "flex items-center flex-1 min-w-0" }, xe = { class: "truncate" }, Se = {
25
+ key: 3,
26
+ class: "flex justify-center py-2"
27
+ }, Oe = {
28
+ key: 3,
29
+ class: "shrink-0"
30
+ }, Ve = /* @__PURE__ */ ee({
31
+ __name: "DropdownMenu",
32
+ props: {
33
+ options: { default: () => [] },
34
+ cachedOptions: { default: () => [] },
35
+ selected: {},
36
+ selectedIndex: { default: null },
37
+ class: { default: "" },
38
+ maxHeight: { default: "300px" },
39
+ nestedPosition: { default: "right-start" },
40
+ nestedOffset: { default: () => [0, -5] },
41
+ selectable: { type: Boolean, default: !0 },
42
+ layout: { default: "default" },
43
+ columns: { default: 3 },
44
+ loading: { type: Boolean, default: !1 },
45
+ hasMore: { type: Boolean, default: !1 },
46
+ searchable: { type: Boolean, default: !0 },
47
+ remote: { type: Boolean, default: !1 },
48
+ debounceTime: { default: 300 },
49
+ direction: { default: "ltr" }
50
+ },
51
+ emits: ["select", "close", "load-more", "search"],
52
+ setup(a, { emit: V }) {
53
+ const t = a, f = V, _ = B(null), h = B(""), { getMenuId: D, getAllRecursiveIds: z } = me(), H = v(() => {
54
+ const e = $("vlite.dropdown.empty");
55
+ return e !== "vlite.dropdown.empty" ? e : "No options found";
56
+ }), L = v(() => {
57
+ const e = $("vlite.dropdown.search");
58
+ return e !== "vlite.dropdown.search" ? e : "Search...";
59
+ }), u = v(() => t.options ? t.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), R = v(() => t.remote ? t.searchable : t.searchable && (u.value.length || 0) > 9);
60
+ let k = null;
61
+ C(h, (e) => {
62
+ t.remote && (k && clearTimeout(k), k = setTimeout(() => {
63
+ e !== void 0 && f("search", e);
64
+ }, t.debounceTime));
65
+ });
66
+ const A = (e) => {
67
+ const s = e.target;
68
+ s.scrollTop + s.clientHeight >= s.scrollHeight - 50 && t.hasMore && !t.loading && f("load-more");
69
+ }, w = (e, s) => {
70
+ e.disabled || f("select", e);
71
+ }, {
72
+ focusedIndex: y,
73
+ isKeyboardMode: p,
74
+ filteredOptions: F,
75
+ handleKeyDown: I,
76
+ handleMouseMove: M,
77
+ onMouseEnterItem: x,
78
+ scrollToIndex: K
79
+ } = fe({
80
+ options: u,
81
+ searchQuery: h,
82
+ containerRef: _,
83
+ emit: (e, ...s) => f(e, ...s),
84
+ handleSelect: (e, s) => w(e)
85
+ }), g = v(() => t.remote ? h.value ? u.value : t.cachedOptions.length ? t.cachedOptions : u.value : F.value), U = (e) => {
86
+ if (!(!t.selected || typeof t.selected != "object") && e.key && e.key in t.selected)
87
+ return t.selected[e.key];
88
+ }, 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) => {
89
+ if (!s.key) return;
90
+ const l = {
91
+ label: s.label,
92
+ value: e,
93
+ key: s.key,
94
+ data: s.data,
95
+ _originalOption: s,
96
+ _path: [s]
97
+ };
98
+ f("select", l);
99
+ }, Q = (e, s) => {
100
+ let l = s.value;
101
+ e.key && (l = { [e.key]: l });
102
+ const n = s.option, c = n?._path || [n?._originalOption || n].filter(Boolean), Z = {
103
+ label: e.label,
104
+ value: l,
105
+ data: s.data,
106
+ key: e.key,
107
+ _originalOption: n?._originalOption || n,
108
+ _path: [e, ...c]
109
+ };
110
+ f("select", Z);
111
+ }, W = async () => {
112
+ await ae();
113
+ let e = -1;
114
+ t.layout !== "grouped" && (t.selectedIndex !== null && t.selectedIndex >= 0 ? e = t.selectedIndex : t.selected !== void 0 && typeof t.selected != "object" && (e = u.value.findIndex((s) => s.value === t.selected)), e !== -1 && K(e));
115
+ };
116
+ C(
117
+ () => g.value,
118
+ () => {
119
+ y.value = -1;
120
+ }
121
+ ), te(() => {
122
+ W(), window.addEventListener("keydown", I);
123
+ }), le(() => {
124
+ window.removeEventListener("keydown", I);
125
+ });
126
+ const X = (e) => e.labelI18n ? $(e.labelI18n) : e.label, Y = (e) => e.showChevron !== !1;
127
+ return (e, s) => (o(), i("div", {
128
+ class: "dropdown-menu w-full min-w-[150px] flex flex-col",
129
+ dir: a.direction
130
+ }, [
131
+ R.value ? (o(), i("div", ye, [
132
+ j(ie, {
133
+ modelValue: h.value,
134
+ "onUpdate:modelValue": s[0] || (s[0] = (l) => h.value = l),
135
+ placeholder: L.value,
136
+ icon: "lucide:search",
137
+ size: "sm",
138
+ class: "font-medium!",
139
+ "input-class": "-ml-1",
140
+ variant: "transparent",
141
+ "icon-class": "h-3.5! w-3.5!",
142
+ "show-clear-button": !1
143
+ }, null, 8, ["modelValue", "placeholder"])
144
+ ])) : d("", !0),
145
+ e.$slots.header ? (o(), i("div", ge, [
146
+ b(e.$slots, "header", {}, void 0, !0)
147
+ ])) : d("", !0),
148
+ u.value.length > 0 || e.$slots.menu ? (o(), i("div", {
149
+ key: 2,
150
+ ref_key: "containerRef",
151
+ ref: _,
152
+ tabindex: "0",
153
+ role: "menu",
154
+ class: T([
155
+ "w-full p-1 space-y-0.5 overflow-y-auto overflow-x-hidden focus:outline-none flex-1",
156
+ t.class
157
+ ]),
158
+ style: se({ maxHeight: t.maxHeight }),
159
+ onMousemove: s[1] || (s[1] = //@ts-ignore
160
+ (...l) => r(M) && r(M)(...l)),
161
+ onScroll: A
162
+ }, [
163
+ g.value.length === 0 && u.value.length > 0 && !a.loading ? (o(), i("div", be, E(H.value), 1)) : d("", !0),
164
+ a.layout === "grouped" ? (o(), m(ue, {
165
+ key: 1,
166
+ options: g.value,
167
+ selected: a.selected,
168
+ selectable: a.selectable,
169
+ columns: a.columns,
170
+ onSelect: w
171
+ }, null, 8, ["options", "selected", "selectable", "columns"])) : (o(!0), i(N, { key: 2 }, oe(g.value, (l, n) => (o(), i(N, { key: n }, [
172
+ l.label === "---" ? (o(), i("div", ke)) : l.data?.isBoolean ? (o(), m(de, {
173
+ key: 1,
174
+ option: l,
175
+ value: G(l),
176
+ focused: r(p) && r(y) === n,
177
+ onChange: J,
178
+ onMouseenter: (c) => r(x)(n)
179
+ }, null, 8, ["option", "value", "focused", "onMouseenter"])) : l.children && l.children.length > 0 ? (o(), m(he, {
180
+ key: 2,
181
+ "is-nested": !0,
182
+ position: l.position || t.nestedPosition,
183
+ offset: l.offset || t.nestedOffset,
184
+ class: "w-full",
185
+ options: l.children,
186
+ selected: U(l),
187
+ menuId: r(D)(l),
188
+ nestedPosition: t.nestedPosition,
189
+ nestedOffset: t.nestedOffset,
190
+ selectable: t.selectable,
191
+ ignoreClickOutside: r(z)(l.children),
192
+ direction: a.direction,
193
+ onOnSelect: (c) => Q(l, c)
194
+ }, {
195
+ trigger: P(() => [
196
+ S("div", {
197
+ tabindex: 0,
198
+ "data-dropdown-item": "",
199
+ 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 focus-visible:bg-accent focus-visible:text-accent-foreground focus-visible:ring-1 focus-visible:ring-primary focus-visible:ring-offset-1", [
200
+ r(p) && r(y) === n ? "bg-accent text-accent-foreground" : "hover:bg-accent hover:text-accent-foreground",
201
+ l.disabled ? "opacity-50 cursor-not-allowed" : "",
202
+ l.triggerClass || l.class || ""
203
+ ]]),
204
+ onMouseenter: (c) => r(x)(n)
205
+ }, [
206
+ S("div", pe, [
207
+ l.icon || l.emoji ? (o(), m(O, {
208
+ key: 0,
209
+ icon: l.icon,
210
+ emoji: l.emoji,
211
+ class: "mr-2 h-4 w-4 shrink-0 mt-0.5"
212
+ }, null, 8, ["icon", "emoji"])) : d("", !0),
213
+ S("span", xe, E(X(l)), 1)
214
+ ]),
215
+ Y(l) ? (o(), m(O, {
216
+ key: 0,
217
+ icon: a.direction === "rtl" ? "lucide:chevron-left" : "lucide:chevron-right",
218
+ class: "h-4 w-4 text-muted-foreground shrink-0 ml-2"
219
+ }, null, 8, ["icon"])) : d("", !0)
220
+ ], 42, we)
221
+ ]),
222
+ _: 2
223
+ }, 1032, ["position", "offset", "options", "selected", "menuId", "nestedPosition", "nestedOffset", "selectable", "ignoreClickOutside", "direction", "onOnSelect"])) : (o(), m(ce, {
224
+ key: 3,
225
+ option: l,
226
+ index: n,
227
+ selected: q(l),
228
+ focused: r(p) && r(y) === n,
229
+ selectable: a.selectable,
230
+ onClick: (c) => w(l),
231
+ onMouseenter: (c) => r(x)(n)
232
+ }, ne({ _: 2 }, [
233
+ e.$slots.item ? {
234
+ name: "default",
235
+ fn: P((c) => [
236
+ b(e.$slots, "item", re({ ref_for: !0 }, c), void 0, !0)
237
+ ]),
238
+ key: "0"
239
+ } : void 0
240
+ ]), 1032, ["option", "index", "selected", "focused", "selectable", "onClick", "onMouseenter"]))
241
+ ], 64))), 128)),
242
+ a.loading ? (o(), i("div", Se, [
243
+ j(O, {
244
+ icon: "lucide:loader-2",
245
+ class: "w-4 h-4 animate-spin text-muted-foreground"
246
+ })
247
+ ])) : d("", !0),
248
+ b(e.$slots, "menu", {}, void 0, !0)
249
+ ], 38)) : d("", !0),
250
+ e.$slots.footer ? (o(), i("div", Oe, [
251
+ b(e.$slots, "footer", {}, void 0, !0)
252
+ ])) : d("", !0)
253
+ ], 8, ve));
254
+ }
255
+ });
2
256
  export {
3
- f as default
257
+ Ve as default
4
258
  };
@@ -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 s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-112b16b5"]]);
4
+ const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-41abc1b3"]]);
5
5
  export {
6
6
  s as default
7
7
  };
@@ -1,27 +1,27 @@
1
- import { defineComponent as I, computed as c, ref as S, watch as L, openBlock as o, createElementBlock as r, createElementVNode as f, createBlock as G, withCtx as k, createTextVNode as H, toDisplayString as m, createCommentVNode as u, createVNode as v, Fragment as h, 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 = {
1
+ import { defineComponent as M, computed as c, ref as G, watch as H, openBlock as o, createElementBlock as n, createElementVNode as b, createBlock as q, withCtx as N, createTextVNode as J, toDisplayString as m, createCommentVNode as u, createVNode as v, Fragment as x, renderList as y, normalizeClass as F, TransitionGroup as K, isMemoSame as O } from "vue";
2
+ import P from "./FormField.vue.js";
3
+ import B from "../Button.vue.js";
4
+ import Q from "../Label.vue.js";
5
+ import { $t as p } from "../../utils/i18n.js";
6
+ const W = { class: "custom-fields-wrapper" }, X = { class: "flex justify-between items-center mb-2" }, Y = { class: "custom-fields-table border border-border rounded overflow-hidden bg-background" }, Z = {
7
7
  key: 0,
8
8
  class: "flex border-b border-border bg-muted/50 text-gray-800 text-xs font-semibold uppercase tracking-wider"
9
- }, W = {
9
+ }, ee = {
10
10
  key: 0,
11
11
  class: "w-10 flex-none p-3 text-center border-r border-border"
12
- }, X = {
12
+ }, te = {
13
13
  key: 1,
14
14
  class: "w-10 flex-none p-3"
15
- }, Y = {
15
+ }, se = {
16
16
  key: 0,
17
17
  class: "w-10 flex-none flex items-center justify-center text-xs text-muted-foreground border-r border-border bg-muted/20"
18
- }, Z = {
18
+ }, le = {
19
19
  key: 1,
20
20
  class: "w-10 flex-none flex items-center justify-center border-l border-border bg-muted/20"
21
- }, ee = {
21
+ }, ae = {
22
22
  key: 1,
23
23
  class: "flex flex-col items-center justify-center py-6 text-center bg-muted/5"
24
- }, te = { class: "text-sm font-medium text-foreground" }, se = { class: "text-xs text-muted-foreground mt-1" }, de = /* @__PURE__ */ I({
24
+ }, oe = { class: "text-sm font-medium text-foreground" }, ne = { class: "text-xs text-muted-foreground mt-1" }, fe = /* @__PURE__ */ M({
25
25
  __name: "CustomFields",
26
26
  props: {
27
27
  modelValue: { default: () => [] },
@@ -42,139 +42,144 @@ const K = { class: "custom-fields-wrapper" }, O = { class: "flex justify-between
42
42
  isUpdate: { type: Boolean, default: !1 }
43
43
  },
44
44
  emits: ["update:modelValue", "change"],
45
- setup(d, { emit: F }) {
46
- const t = d, x = F, y = c(() => t.labelI18n ? b(t.labelI18n) : t.label), N = c(() => {
47
- const e = b("vlite.customFields.emptyTitle");
45
+ setup(d, { emit: $ }) {
46
+ const t = d, g = $, _ = c(() => t.labelI18n ? p(t.labelI18n) : t.label), T = c(() => {
47
+ const e = p("vlite.customFields.emptyTitle");
48
48
  return e !== "vlite.customFields.emptyTitle" ? e : "No items added";
49
- }), B = c(() => {
50
- const e = b("vlite.customFields.emptyDescription");
49
+ }), z = c(() => {
50
+ const e = p("vlite.customFields.emptyDescription");
51
51
  return e !== "vlite.customFields.emptyDescription" ? e : "Add a new item to get started";
52
- }), l = S([]), g = () => `row_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
53
- L(
52
+ }), l = G([]), R = () => `row_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
53
+ H(
54
54
  () => t.modelValue,
55
55
  (e) => {
56
- Array.isArray(e) ? l.value = e.map((s, n) => {
57
- const a = l.value[n];
56
+ Array.isArray(e) ? l.value = e.map((s, r) => {
57
+ const a = l.value[r];
58
58
  return {
59
59
  ...s,
60
- _id: a?._id || g()
60
+ _id: a?._id || R()
61
61
  };
62
62
  }) : l.value = [];
63
63
  },
64
64
  { immediate: !0, deep: !0 }
65
65
  );
66
- const $ = () => {
66
+ const A = () => {
67
67
  const e = {};
68
68
  for (const s of t.schema) {
69
- const n = typeof s.value == "function" ? s.value() : s.value;
70
- e[s.name] = n ?? null;
69
+ const r = typeof s.value == "function" ? s.value() : s.value;
70
+ e[s.name] = r ?? null;
71
71
  }
72
- return { ...e, _id: g() };
73
- }, T = () => {
72
+ return { ...e, _id: R() };
73
+ }, D = () => {
74
74
  if (t.disabled || t.maxRows && l.value.length >= t.maxRows) return;
75
- const e = [...l.value, $()];
76
- l.value = e, p(e);
77
- }, z = (e) => {
75
+ const e = [...l.value, A()];
76
+ l.value = e, h(e);
77
+ }, E = (e) => {
78
78
  if (t.disabled || l.value.length <= t.minRows) return;
79
79
  const s = [...l.value];
80
- s.splice(e, 1), l.value = s, p(s);
81
- }, A = (e, s, n) => {
80
+ s.splice(e, 1), l.value = s, h(s);
81
+ }, U = (e, s, r) => {
82
82
  const a = [...l.value];
83
83
  a[e] = {
84
84
  ...a[e],
85
- [s]: n.value
86
- }, l.value = a, p(a);
87
- }, p = (e) => {
88
- const s = e.map(({ _id: n, ...a }) => a);
89
- x("update:modelValue", s), x("change", s);
90
- }, D = (e, s) => l.value[e]?.[s], E = c(() => !(t.disabled || t.maxRows && l.value.length >= t.maxRows)), _ = c(() => t.disabled ? !1 : l.value.length > t.minRows), R = c(() => t.headers && t.headers.length > 0 ? t.headers : t.schema.map((e) => e.labelI18n ? b(e.labelI18n) : e.label || e.name));
91
- return (e, s) => (o(), r("div", K, [
92
- f("div", O, [
93
- y.value ? (o(), G(J, {
85
+ [s]: r.value
86
+ }, l.value = a, h(a);
87
+ }, h = (e) => {
88
+ const s = e.map(({ _id: r, ...a }) => a);
89
+ g("update:modelValue", s), g("change", s);
90
+ }, j = (e, s) => l.value[e]?.[s], S = c(() => !(t.disabled || t.maxRows && l.value.length >= t.maxRows)), w = c(() => t.disabled ? !1 : l.value.length > t.minRows), k = c(() => t.headers && t.headers.length > 0 ? t.headers : t.schema.map((e) => e.labelI18n ? p(e.labelI18n) : e.label || e.name));
91
+ return (e, s) => (o(), n("div", W, [
92
+ b("div", X, [
93
+ _.value ? (o(), q(Q, {
94
94
  key: 0,
95
95
  class: "text-sm font-medium text-foreground"
96
96
  }, {
97
- default: k(() => [
98
- H(m(y.value), 1)
97
+ default: N(() => [
98
+ J(m(_.value), 1)
99
99
  ]),
100
100
  _: 1
101
101
  })) : u("", !0),
102
- v(V, {
102
+ v(B, {
103
103
  type: "button",
104
104
  variant: "outline",
105
105
  size: "xs",
106
106
  rounded: "full",
107
107
  icon: "lucide:plus",
108
- disabled: !E.value,
109
- onClick: T
108
+ disabled: !S.value,
109
+ onClick: D
110
110
  }, null, 8, ["disabled"])
111
111
  ]),
112
- f("div", P, [
113
- R.value.length > 0 ? (o(), r("div", Q, [
114
- d.showRowNumbers ? (o(), r("div", W, " # ")) : u("", !0),
115
- (o(!0), r(h, null, w(R.value, (n, a) => (o(), r("div", {
112
+ b("div", Y, [
113
+ k.value.length > 0 ? (o(), n("div", Z, [
114
+ d.showRowNumbers ? (o(), n("div", ee, " # ")) : u("", !0),
115
+ (o(!0), n(x, null, y(k.value, (r, a) => (o(), n("div", {
116
116
  key: a,
117
- class: C(["flex-1 p-3 min-w-0 truncate", { "border-l border-border": a > 0 }])
118
- }, m(n), 3))), 128)),
119
- _.value ? (o(), r("div", X)) : u("", !0)
117
+ class: F(["flex-1 p-3 min-w-0 truncate", { "border-l border-border": a > 0 }])
118
+ }, m(r), 3))), 128)),
119
+ w.value ? (o(), n("div", te)) : u("", !0)
120
120
  ])) : u("", !0),
121
- v(M, {
121
+ v(K, {
122
122
  name: "list",
123
123
  tag: "div",
124
124
  class: "divide-y divide-border"
125
125
  }, {
126
- default: k(() => [
127
- (o(!0), r(h, null, w(l.value, (n, a) => (o(), r("div", {
128
- key: n._id,
129
- class: "flex group bg-white transition-colors"
130
- }, [
131
- d.showRowNumbers ? (o(), r("div", Y, m(a + 1), 1)) : u("", !0),
132
- (o(!0), r(h, null, w(d.schema, (i, j) => (o(), r("div", {
133
- key: i.name,
134
- class: C(["flex-1 min-w-0 relative", { "border-l border-border": j > 0 }])
126
+ default: N(() => [
127
+ (o(!0), n(x, null, y(l.value, (r, a, re, f) => {
128
+ const C = [r, d.disabled, d.isUpdate, d.showRowNumbers, w.value];
129
+ if (f && f.key === r._id && O(f, C)) return f;
130
+ const V = (o(), n("div", {
131
+ key: r._id,
132
+ class: "flex group bg-white transition-colors"
135
133
  }, [
136
- v(q, {
137
- field: {
138
- ...i,
139
- props: {
140
- ...i.type === "multiSelect" ? { showControls: !1, wrap: !1 } : {},
141
- ...i.props || {}
134
+ d.showRowNumbers ? (o(), n("div", se, m(a + 1), 1)) : u("", !0),
135
+ (o(!0), n(x, null, y(d.schema, (i, I) => (o(), n("div", {
136
+ key: i.name,
137
+ class: F(["flex-1 min-w-0 relative", { "border-l border-border": I > 0 }])
138
+ }, [
139
+ v(P, {
140
+ field: {
141
+ ...i,
142
+ props: {
143
+ ...i.type === "multiSelect" ? { showControls: !1, wrap: !1 } : {},
144
+ ...i.props || {}
145
+ },
146
+ label: void 0
142
147
  },
143
- label: void 0
144
- },
145
- value: D(a, i.name),
146
- values: d.values || {},
147
- variant: "transparent",
148
- size: "sm",
149
- rounded: "none",
150
- disabled: d.disabled,
151
- isUpdate: d.isUpdate,
152
- class: "w-full h-full min-h-[40px]",
153
- onChange: (U) => A(a, i.name, U)
154
- }, null, 8, ["field", "value", "values", "disabled", "isUpdate", "onChange"])
155
- ], 2))), 128)),
156
- _.value ? (o(), r("div", Z, [
157
- v(V, {
158
- type: "button",
159
- variant: "ghost",
160
- size: "xs",
161
- icon: "lucide:trash-2",
162
- disabled: d.disabled,
163
- onClick: (i) => z(a)
164
- }, null, 8, ["disabled", "onClick"])
165
- ])) : u("", !0)
166
- ]))), 128))
148
+ value: j(a, i.name),
149
+ values: d.values || {},
150
+ variant: "transparent",
151
+ size: "sm",
152
+ rounded: "none",
153
+ disabled: d.disabled,
154
+ isUpdate: d.isUpdate,
155
+ class: "w-full h-full min-h-[40px]",
156
+ onChange: (L) => U(a, i.name, L)
157
+ }, null, 8, ["field", "value", "values", "disabled", "isUpdate", "onChange"])
158
+ ], 2))), 128)),
159
+ w.value ? (o(), n("div", le, [
160
+ v(B, {
161
+ type: "button",
162
+ variant: "ghost",
163
+ size: "xs",
164
+ icon: "lucide:trash-2",
165
+ disabled: d.disabled,
166
+ onClick: (i) => E(a)
167
+ }, null, 8, ["disabled", "onClick"])
168
+ ])) : u("", !0)
169
+ ]));
170
+ return V.memo = C, V;
171
+ }, s, 0), 128))
167
172
  ]),
168
173
  _: 1
169
174
  }),
170
- l.value.length === 0 ? (o(), r("div", ee, [
171
- f("p", te, m(N.value), 1),
172
- f("p", se, m(B.value), 1)
175
+ l.value.length === 0 ? (o(), n("div", ae, [
176
+ b("p", oe, m(T.value), 1),
177
+ b("p", ne, m(z.value), 1)
173
178
  ])) : u("", !0)
174
179
  ])
175
180
  ]));
176
181
  }
177
182
  });
178
183
  export {
179
- de as default
184
+ fe as default
180
185
  };
@@ -58,7 +58,6 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
58
58
  }>, {
59
59
  values: Record<string, any>;
60
60
  footer: boolean;
61
- size: InputSize;
62
61
  class: string;
63
62
  loading: boolean;
64
63
  isUpdate: boolean;
@@ -1,7 +1,7 @@
1
1
  import o from "./Form.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-1a2b21d0"]]);
4
+ const _ = /* @__PURE__ */ r(o, [["__scopeId", "data-v-c368964e"]]);
5
5
  export {
6
- p as default
6
+ _ as default
7
7
  };