vlite3 1.4.39 → 1.4.41

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 (135) hide show
  1. package/components/AppShell/AppShellLayoutClassic.vue.js +27 -28
  2. package/components/AppShell/AppShellLayoutDashboard.vue.js +48 -48
  3. package/components/AppShell/AppShellLayoutDock.vue.js +51 -51
  4. package/components/AppShell/AppShellLayoutHeaderShell.vue.js +69 -69
  5. package/components/AppShell/AppShellLayoutSidebarFirst.vue.d.ts +2 -2
  6. package/components/AppShell/AppShellLayoutSidebarFirst.vue.js +78 -78
  7. package/components/AppShell/AppShellLayoutStorefront.vue.js +14 -15
  8. package/components/AppShell/useAppShell.d.ts +4 -0
  9. package/components/AppShell/useAppShell.js +45 -40
  10. package/components/AsyncSelect/createAsyncSelect.js +10 -10
  11. package/components/AttachmentsList/AttachmentsList.vue.d.ts +50 -2
  12. package/components/AttachmentsList/AttachmentsList.vue.js +289 -272
  13. package/components/AttachmentsList/types.d.ts +37 -0
  14. package/components/BackButton.vue.js +2 -2
  15. package/components/Button.vue.d.ts +1 -0
  16. package/components/Button.vue.js +5 -241
  17. package/components/Button.vue2.js +245 -2
  18. package/components/ButtonGroup.vue.js +2 -2
  19. package/components/ButtonGroup.vue2.js +4 -1
  20. package/components/Calendar/Calendar.vue2.js +16 -16
  21. package/components/Cart/CartCouponInput.vue.js +24 -24
  22. package/components/Cart/CartEmptyState.vue.js +4 -4
  23. package/components/Cart/CartLineItem.vue.js +33 -33
  24. package/components/Cart/CartVariant1.vue.js +3 -3
  25. package/components/Cart/CartVariant2.vue.js +5 -5
  26. package/components/Cart/CartVariant3.vue.js +25 -25
  27. package/components/Cart/CartVariant4.vue.js +9 -9
  28. package/components/CategoryManager/CategoryManager.vue2.js +18 -18
  29. package/components/CategoryManager/CategoryNode.vue.js +4 -4
  30. package/components/CategoryMenu/CategoryMenu.vue.js +3 -2
  31. package/components/CategoryMenu/CategoryMenuVariant1.vue2.js +3 -2
  32. package/components/Chat/ChatInterface.vue.js +23 -23
  33. package/components/Clipboard.vue.d.ts +7 -1
  34. package/components/Clipboard.vue.js +19 -17
  35. package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +22 -22
  36. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  37. package/components/ColorPicker/ColorPicker.vue.js +8 -8
  38. package/components/Comment/CommentEditor.vue.js +14 -14
  39. package/components/Comment/CommentItem.vue2.js +6 -6
  40. package/components/Comment/CommentThread.vue.js +4 -4
  41. package/components/DataList/DataList.vue.js +7 -7
  42. package/components/DataTable/DataTable.vue.d.ts +9 -0
  43. package/components/DataTable/DataTable.vue.js +380 -265
  44. package/components/DataTable/DataTableRow.vue.d.ts +23 -2
  45. package/components/DataTable/DataTableRow.vue.js +5 -198
  46. package/components/DataTable/DataTableRow.vue2.js +360 -2
  47. package/components/DataTable/dataTableHeaders.d.ts +18 -0
  48. package/components/DataTable/dataTableHeaders.js +9 -0
  49. package/components/DataTable/types.d.ts +11 -0
  50. package/components/DatePicker.vue.js +8 -9
  51. package/components/DateRangePicker.vue2.js +34 -34
  52. package/components/Dropdown/Dropdown.vue.d.ts +7 -2
  53. package/components/Dropdown/Dropdown.vue.js +146 -139
  54. package/components/Dropdown/DropdownTrigger.vue.js +6 -6
  55. package/components/ExportData/ExportData.vue.js +15 -15
  56. package/components/FilePicker/FilePickerDropzone.vue.js +16 -16
  57. package/components/FilePicker/FilePickerInput.vue.js +3 -2
  58. package/components/FilePicker/FilePreview.vue.js +3 -3
  59. package/components/FileTree/FileTree.vue.js +4 -4
  60. package/components/FileTree/FileTree.vue2.js +9 -9
  61. package/components/FileTree/FileTreeNode.vue.js +76 -72
  62. package/components/Footer/Variant1.vue.js +48 -48
  63. package/components/Footer/Variant2.vue.js +42 -42
  64. package/components/Form/AccordionView.vue.d.ts +1 -1
  65. package/components/Form/AccordionView.vue2.js +2 -2
  66. package/components/Form/AccordionView.vue3.js +61 -57
  67. package/components/Form/Form.vue2.js +41 -41
  68. package/components/Form/TableRow.vue.d.ts +7 -0
  69. package/components/Form/TableRow.vue.js +187 -41
  70. package/components/Form/TableView.vue.d.ts +11 -1
  71. package/components/Form/TableView.vue.js +71 -49
  72. package/components/Form/composables/useForm.js +146 -142
  73. package/components/Form/index.vue.d.ts +5 -1
  74. package/components/Form/index.vue.js +2 -2
  75. package/components/Form/index.vue2.js +44 -37
  76. package/components/Form/rowHelpers.d.ts +20 -0
  77. package/components/Form/rowHelpers.js +76 -28
  78. package/components/Form/types.d.ts +11 -0
  79. package/components/GoogleLogin.vue.js +4 -4
  80. package/components/IconPicker.vue.js +9 -9
  81. package/components/ImportData/ImportData.vue.js +11 -11
  82. package/components/ImportData/ImportStep1.vue.js +10 -10
  83. package/components/ImportData/ImportStep2.vue.js +15 -14
  84. package/components/Input.vue.js +133 -129
  85. package/components/Kanban/KanbanBoard.vue.js +1 -1
  86. package/components/Kanban/KanbanBoard.vue2.js +9 -9
  87. package/components/MultiSelect/MultiSelect.vue.js +3 -2
  88. package/components/Navbar/Navbar.vue.js +17 -17
  89. package/components/Navbar/NavbarGroup.vue.js +8 -7
  90. package/components/Navbar/NavbarItem.vue.js +40 -39
  91. package/components/Navbar/NavbarTabs.vue.js +6 -184
  92. package/components/Navbar/NavbarTabs.vue2.js +204 -0
  93. package/components/Navbar/useNavbar.js +3 -3
  94. package/components/NavbarCommandPalette.vue.js +1 -1
  95. package/components/NumberInput.vue.js +2 -2
  96. package/components/NumberInput.vue2.js +81 -77
  97. package/components/OTPInput/OTPInput.vue.js +24 -23
  98. package/components/Pagination/Pagination.vue.d.ts +1 -1
  99. package/components/Pagination/Pagination.vue.js +5 -274
  100. package/components/Pagination/Pagination.vue2.js +283 -2
  101. package/components/PermissionMatrix/PermissionTopBar.vue.js +19 -18
  102. package/components/PricingPlan/PricingPlanItem.vue.js +7 -7
  103. package/components/Screen/Screen.vue.d.ts +1 -1
  104. package/components/Screen/Screen.vue.js +21 -21
  105. package/components/Screen/ScreenFilter.vue.js +5 -5
  106. package/components/Screen/components/ScreenAddAction.vue.js +3 -3
  107. package/components/Screen/components/ScreenEmptyState.vue.js +10 -10
  108. package/components/Screen/components/ScreenExportModal.vue.js +12 -12
  109. package/components/Screen/components/ScreenOptionsDropdown.vue.js +5 -5
  110. package/components/Screen/components/ScreenToolbar.vue.js +15 -15
  111. package/components/SidePanel.vue.js +2 -2
  112. package/components/SidePanel.vue2.js +6 -6
  113. package/components/SidebarMenu/SidebarMenu.vue.js +77 -72
  114. package/components/SidebarMenu/SidebarMenuItem.vue.js +172 -168
  115. package/components/Slider.vue.js +123 -108
  116. package/components/Tabes/Tabes.vue.d.ts +8 -3
  117. package/components/Tabes/Tabes.vue.js +2 -2
  118. package/components/Tabes/Tabes.vue2.js +209 -200
  119. package/components/Tabes/tabes.utils.d.ts +23 -0
  120. package/components/Tabes/tabes.utils.js +39 -16
  121. package/components/Textarea.vue.d.ts +2 -0
  122. package/components/Textarea.vue.js +19 -16
  123. package/components/ThemeToggle.vue.js +8 -8
  124. package/components/ToastNotification.vue2.js +10 -10
  125. package/components/TreeConnectors/TreeConnectors.vue.d.ts +1 -1
  126. package/components/TreeConnectors/TreeConnectors.vue.js +13 -8
  127. package/components/TreeConnectors/geometry.js +77 -69
  128. package/components/Workbook/WorkbookAddButton.vue.js +2 -2
  129. package/composables/useRtl.d.ts +14 -0
  130. package/composables/useRtl.js +33 -0
  131. package/index.js +470 -471
  132. package/package.json +1 -1
  133. package/style.css +86 -1
  134. package/types/button.d.ts +8 -0
  135. package/components/Navbar/NavbarTabs.vue3.js +0 -5
@@ -1,4 +1,4 @@
1
- import { defineComponent as Ge, computed as o, inject as He, getCurrentInstance as $e, onMounted as Me, onUnmounted as _, shallowRef as ee, watch as te, nextTick as Oe, openBlock as n, createElementBlock as c, withKeys as ye, withModifiers as ae, normalizeClass as m, createElementVNode as p, createVNode as k, mergeProps as O, toDisplayString as j, renderSlot as he, unref as l, createCommentVNode as d, createBlock as C, withCtx as be, Fragment as je, renderList as Ke, isMemoSame as Ye } from "vue";
1
+ import { defineComponent as Ge, computed as o, inject as He, getCurrentInstance as $e, onMounted as Me, onUnmounted as _, shallowRef as ee, watch as te, nextTick as Oe, openBlock as n, createElementBlock as c, withKeys as ye, withModifiers as ae, normalizeClass as v, createElementVNode as p, createVNode as k, mergeProps as O, toDisplayString as j, renderSlot as he, unref as l, createCommentVNode as d, createBlock as C, withCtx as be, Fragment as je, renderList as Ke, isMemoSame as Ye } from "vue";
2
2
  import { useForm as Je } from "./composables/useForm.js";
3
3
  import X from "./FormFields.vue.js";
4
4
  import Qe from "./FormField.vue.js";
@@ -25,7 +25,7 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
25
25
  }, ct = {
26
26
  key: 3,
27
27
  class: "form-step"
28
- }, mt = { class: "text-lg font-semibold text-foreground" }, vt = {
28
+ }, vt = { class: "text-lg font-semibold text-foreground" }, mt = {
29
29
  key: 0,
30
30
  class: "text-sm text-muted-foreground mt-1"
31
31
  }, ft = {
@@ -139,8 +139,8 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
139
139
  if (Array.isArray(t)) return t;
140
140
  try {
141
141
  const a = t({
142
- values: v.value,
143
- globalValues: v.value,
142
+ values: m.value,
143
+ globalValues: m.value,
144
144
  isUpdate: i.isUpdate
145
145
  });
146
146
  return Array.isArray(a) ? a : [];
@@ -153,7 +153,7 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
153
153
  const t = G.value, a = [];
154
154
  for (let s = 0; s < t.length; s++) {
155
155
  const x = t[s];
156
- !Array.isArray(x) || x.length === 0 || x.some((ve) => R(ve)) && a.push({ schema: x, originalIndex: s });
156
+ !Array.isArray(x) || x.length === 0 || x.some((me) => R(me)) && a.push({ schema: x, originalIndex: s });
157
157
  }
158
158
  return a;
159
159
  }), Ae = o(
@@ -168,11 +168,11 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
168
168
  t.set(`form-group-${a.originalIndex}`, a.schema);
169
169
  return t;
170
170
  }), h = o(() => u.value ? null : (T.value ? i.schema.flat() : i.schema).find((a) => at(a, {
171
- values: v.value,
172
- globalValues: v.value,
171
+ values: m.value,
172
+ globalValues: m.value,
173
173
  isUpdate: i.isUpdate
174
174
  }) === "thumbnailSelector") ?? null), P = o(() => !!h.value), {
175
- formValues: v,
175
+ formValues: m,
176
176
  errors: b,
177
177
  isSubmitting: y,
178
178
  fieldLoading: V,
@@ -213,7 +213,7 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
213
213
  }
214
214
  );
215
215
  const M = (t, a) => {
216
- re(t, a.value, a.data), f("onChange", v.value);
216
+ re(t, a.value, a.data), f("onChange", m.value);
217
217
  }, Ve = async () => {
218
218
  if (!u.value) return !0;
219
219
  const t = ne.value;
@@ -253,11 +253,11 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
253
253
  if (!a) return;
254
254
  const s = a.tagName.toLowerCase();
255
255
  s !== "textarea" && s !== "button" && (a.isContentEditable || (t.preventDefault(), w()));
256
- }, me = (t) => {
256
+ }, ve = (t) => {
257
257
  (t.metaKey || t.ctrlKey) && t.key === "s" && (t.preventDefault(), w());
258
258
  };
259
259
  xe({
260
- formValues: v,
260
+ formValues: m,
261
261
  errors: b,
262
262
  isSubmitting: y,
263
263
  handleSubmit: w,
@@ -271,17 +271,17 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
271
271
  f("onCancel"), g && g?.close?.();
272
272
  };
273
273
  return (t, a) => (n(), c("form", {
274
- class: m(["form-container", i.class, e.isPage && "pb-10"]),
274
+ class: v(["form-container", i.class, e.isPage && "pb-10"]),
275
275
  onSubmit: ae(w, ["prevent"]),
276
276
  onKeydown: [
277
277
  Ee,
278
- ye(ae(me, ["meta", "prevent"]), ["s"]),
279
- ye(ae(me, ["ctrl", "prevent"]), ["s"])
278
+ ye(ae(ve, ["meta", "prevent"]), ["s"]),
279
+ ye(ae(ve, ["ctrl", "prevent"]), ["s"])
280
280
  ]
281
281
  }, [
282
282
  e.isPage ? (n(), c("div", {
283
283
  key: 0,
284
- class: m([
284
+ class: v([
285
285
  "form-page-header sticky top-0 z-30 bg-background flex items-center justify-between pb-3.5 pt-4 -mt-3.5 mb-4.5",
286
286
  e.pageHeaderClass
287
287
  ])
@@ -292,12 +292,12 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
292
292
  class: "max-sm:w-8 max-sm:h-8 max-sm:min-w-8 max-sm:min-h-8 max-sm:px-0 shrink-0"
293
293
  }), null, 16, ["fallback"]),
294
294
  p("h1", {
295
- class: m(["text-foreground max-sm:text-lg text-fs-5 truncate", e.pageTitleClass])
295
+ class: v(["text-foreground max-sm:text-lg text-fs-5 truncate", e.pageTitleClass])
296
296
  }, j(ke.value), 3)
297
297
  ]),
298
298
  p("div", st, [
299
299
  he(t.$slots, "header-actions", {
300
- values: l(v),
300
+ values: l(m),
301
301
  isSubmitting: l(y),
302
302
  handleSubmit: w
303
303
  }, void 0, !0),
@@ -315,7 +315,7 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
315
315
  ], 2)) : d("", !0),
316
316
  !e.schemaLoading && u.value && se.value.length > 0 ? (n(), c("div", {
317
317
  key: 1,
318
- class: m(["form-timeline", e.timelineTextPosition == "right" ? "mb-2" : "mb-8"])
318
+ class: v(["form-timeline", e.timelineTextPosition == "right" ? "mb-2" : "mb-8"])
319
319
  }, [
320
320
  k(l(_e), {
321
321
  steps: se.value,
@@ -327,21 +327,21 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
327
327
  }, null, 8, ["steps", "activeStep", "textPosition"])
328
328
  ], 2)) : d("", !0),
329
329
  p("div", {
330
- class: m(e.footer && L.value ? "pb-2" : "")
330
+ class: v(e.footer && L.value ? "pb-2" : "")
331
331
  }, [
332
332
  e.schemaLoading ? (n(), C(We, {
333
333
  key: 0,
334
334
  isGrouped: T.value
335
335
  }, null, 8, ["isGrouped"])) : (n(), c("div", {
336
336
  key: 1,
337
- class: m(P.value ? "flex flex-col lg:flex-row gap-10 lg:gap-16" : "")
337
+ class: v(P.value ? "flex flex-col lg:flex-row gap-10 lg:gap-16" : "")
338
338
  }, [
339
339
  P.value ? (n(), c("div", nt, [
340
340
  h.value && l(R)(h.value) ? (n(), C(Qe, {
341
341
  key: 0,
342
342
  field: h.value,
343
- value: l(v)[h.value.name],
344
- values: l(v),
343
+ value: l(m)[h.value.name],
344
+ values: l(m),
345
345
  errors: l(b),
346
346
  variant: U.value,
347
347
  size: I.value,
@@ -355,17 +355,17 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
355
355
  }, null, 8, ["field", "value", "values", "errors", "variant", "size", "rounded", "disabled", "readonly", "error", "isUpdate", "loading"])) : d("", !0)
356
356
  ])) : d("", !0),
357
357
  p("div", {
358
- class: m(P.value ? "flex-1 min-w-0 order-last lg:order-first" : "w-full")
358
+ class: v(P.value ? "flex-1 min-w-0 order-last lg:order-first" : "w-full")
359
359
  }, [
360
360
  T.value ? T.value && !u.value && e.groupLayout === "basic" ? (n(), c("div", {
361
361
  key: 1,
362
- class: m(["form-groups space-y-6", e.groupContainerClass])
362
+ class: v(["form-groups space-y-6", e.groupContainerClass])
363
363
  }, [
364
- (n(!0), c(je, null, Ke(H.value, (s, x, ve, W) => {
364
+ (n(!0), c(je, null, Ke(H.value, (s, x, me, W) => {
365
365
  const fe = [
366
366
  s.schema,
367
367
  s.originalIndex,
368
- l(v),
368
+ l(m),
369
369
  l(b),
370
370
  l(V),
371
371
  U.value,
@@ -383,7 +383,7 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
383
383
  if (W && W.key === s.originalIndex && Ye(W, fe)) return W;
384
384
  const ge = (n(), c("div", {
385
385
  key: s.originalIndex,
386
- class: m([
386
+ class: v([
387
387
  "form-group overflow-hidden bg-body",
388
388
  e.groupClass,
389
389
  H.value.length > 1 ? "border rounded" : ""
@@ -391,17 +391,17 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
391
391
  }, [
392
392
  J.value?.[s.originalIndex] ? (n(), c("div", {
393
393
  key: 0,
394
- class: m(["form-group-header bg-muted/50 px-4 py-2.5 border-b", e.headerClass])
394
+ class: v(["form-group-header bg-muted/50 px-4 py-2.5 border-b", e.headerClass])
395
395
  }, [
396
396
  p("h3", ut, j(J.value[s.originalIndex]), 1),
397
397
  Q.value?.[s.originalIndex] ? (n(), c("p", dt, j(Q.value[s.originalIndex]), 1)) : d("", !0)
398
398
  ], 2)) : d("", !0),
399
399
  p("div", {
400
- class: m(["form-group-body", [e.groupBodyClass, H.value.length > 1 ? "p-4.5" : ""]])
400
+ class: v(["form-group-body", [e.groupBodyClass, H.value.length > 1 ? "p-4.5" : ""]])
401
401
  }, [
402
402
  k(X, {
403
403
  schema: s.schema,
404
- values: l(v),
404
+ values: l(m),
405
405
  errors: l(b),
406
406
  fieldLoading: l(V),
407
407
  variant: U.value,
@@ -423,18 +423,18 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
423
423
  }, a, 3), 128))
424
424
  ], 2)) : T.value && !u.value && e.groupLayout === "accordion" ? (n(), c("div", {
425
425
  key: 2,
426
- class: m(e.groupContainerClass)
426
+ class: v(e.groupContainerClass)
427
427
  }, [
428
428
  k(Xe, {
429
429
  variant: "solid",
430
430
  items: Ae.value,
431
431
  "allow-multiple": "",
432
- class: m(e.groupClass)
432
+ class: v(e.groupClass)
433
433
  }, {
434
434
  content: be(({ item: s }) => [
435
435
  k(X, {
436
436
  schema: Te.value.get(s.id) || [],
437
- values: l(v),
437
+ values: l(m),
438
438
  errors: l(b),
439
439
  fieldLoading: l(V),
440
440
  variant: U.value,
@@ -456,14 +456,14 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
456
456
  ], 2)) : u.value ? (n(), c("div", ct, [
457
457
  e.tabs?.[r.value] ? (n(), c("div", {
458
458
  key: 0,
459
- class: m(["form-step-header mb-6", e.headerClass])
459
+ class: v(["form-step-header mb-6", e.headerClass])
460
460
  }, [
461
- p("h2", mt, j(e.tabs[r.value].title), 1),
462
- e.tabs[r.value].description ? (n(), c("p", vt, j(e.tabs[r.value].description), 1)) : d("", !0)
461
+ p("h2", vt, j(e.tabs[r.value].title), 1),
462
+ e.tabs[r.value].description ? (n(), c("p", mt, j(e.tabs[r.value].description), 1)) : d("", !0)
463
463
  ], 2)) : d("", !0),
464
464
  k(X, {
465
465
  schema: ne.value,
466
- values: l(v),
466
+ values: l(m),
467
467
  errors: l(b),
468
468
  fieldLoading: l(V),
469
469
  variant: U.value,
@@ -482,7 +482,7 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
482
482
  ])) : d("", !0) : (n(), c("div", ot, [
483
483
  k(X, {
484
484
  schema: e.schema,
485
- values: l(v),
485
+ values: l(m),
486
486
  errors: l(b),
487
487
  fieldLoading: l(V),
488
488
  variant: U.value,
@@ -522,7 +522,7 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
522
522
  }, 8, ["schema", "values", "errors", "fieldLoading", "variant", "size", "rounded", "className", "isUpdate", "showRequiredAsterisk", "isFieldVisible", "isFieldDisabled", "isFieldReadonly", "excludeTypes", "layout"])
523
523
  ])),
524
524
  he(t.$slots, "default", {
525
- values: l(v),
525
+ values: l(m),
526
526
  errors: l(b),
527
527
  isSubmitting: l(y),
528
528
  handleSubmit: w
@@ -534,7 +534,7 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
534
534
  key: 2,
535
535
  ref_key: "footerRef",
536
536
  ref: F,
537
- class: m([
537
+ class: v([
538
538
  "form-footer items-center gap-3 z-20 rounded-b-md!",
539
539
  e.isPage ? "flex sm:hidden" : "flex",
540
540
  e.footerClass,
@@ -572,7 +572,7 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
572
572
  }), null, 16, ["text", "loading"])) : d("", !0)
573
573
  ])) : d("", !0),
574
574
  p("div", {
575
- class: m(["flex gap-3 items-center", [
575
+ class: v(["flex gap-3 items-center", [
576
576
  u.value && "ml-auto",
577
577
  !u.value || N.value ? "w-full justify-end" : ""
578
578
  ]])
@@ -1,15 +1,22 @@
1
+ import { InputVariant, InputSize, InputRounded } from '../../types';
1
2
  import { IForm, IFormFieldChangePayload } from './types';
2
3
  import { CustomFieldRow, RowHelpers } from './rowHelpers';
3
4
  interface Props {
4
5
  row: CustomFieldRow;
5
6
  rowIndex: number;
6
7
  fields: IForm[];
8
+ columnHeaders: string[];
7
9
  draggable: boolean;
8
10
  disabled: boolean;
9
11
  readonly: boolean;
10
12
  isUpdate: boolean;
11
13
  showRowNumbers: boolean;
12
14
  canRemoveRow: boolean;
15
+ isStacked: boolean;
16
+ variant: InputVariant;
17
+ size: InputSize;
18
+ rounded: InputRounded;
19
+ rowTitleKey?: string;
13
20
  helpers: RowHelpers;
14
21
  onFieldChange: (rowIndex: number, fieldName: string, payload: IFormFieldChangePayload) => void;
15
22
  onRemoveRow: (index: number) => void;
@@ -1,103 +1,249 @@
1
- import { defineComponent as x, computed as d, withMemo as f, openBlock as a, createElementBlock as l, normalizeStyle as R, normalizeClass as m, createVNode as u, createCommentVNode as i, toDisplayString as C, Fragment as F, renderList as I, createBlock as k } from "vue";
2
- import B from "./FormField.vue.js";
3
- import N from "../Icon.vue.js";
4
- import T from "../Button.vue.js";
5
- import { resolveFieldType as U } from "./utils/form.utils.js";
6
- const z = {
1
+ import { defineComponent as D, computed as s, withMemo as F, openBlock as a, createElementBlock as l, createElementVNode as u, normalizeClass as m, createVNode as w, createCommentVNode as d, toDisplayString as i, createBlock as h, Fragment as f, renderList as C, withCtx as T, createTextVNode as B, unref as K, normalizeStyle as L } from "vue";
2
+ import S from "./FormField.vue.js";
3
+ import z from "../Icon.vue.js";
4
+ import N from "../Button.vue.js";
5
+ import V from "../Label.vue.js";
6
+ import { fieldRendersOwnErrorMessage as q, resolveFieldType as M } from "./utils/form.utils.js";
7
+ import { resolveCustomFieldRowTitle as G } from "./rowHelpers.js";
8
+ const O = { class: "flex items-center justify-between gap-2 px-3 py-2 bg-muted/30 border-b border-border" }, A = { class: "flex items-center gap-2 min-w-0 flex-1" }, J = {
9
+ key: 1,
10
+ class: "text-xs font-semibold text-muted-foreground tabular-nums shrink-0"
11
+ }, P = ["title"], Q = { class: "flex flex-col gap-4 p-3 min-w-0" }, W = {
12
+ key: 0,
13
+ class: "text-destructive ml-0.5"
14
+ }, X = {
15
+ key: 0,
16
+ class: "text-destructive ml-0.5"
17
+ }, Y = {
18
+ key: 1,
19
+ class: "text-xs text-destructive"
20
+ }, Z = {
7
21
  key: 1,
8
22
  class: "w-10 flex-none flex items-center justify-center text-xs text-muted-foreground border-r border-border bg-muted/20"
9
- }, V = {
23
+ }, p = {
10
24
  key: 2,
11
25
  class: "w-10 flex-none flex items-center justify-center border-l border-border bg-muted/20"
12
- }, H = /* @__PURE__ */ x({
26
+ }, le = /* @__PURE__ */ D({
13
27
  __name: "TableRow",
14
28
  props: {
15
29
  row: {},
16
30
  rowIndex: {},
17
31
  fields: {},
32
+ columnHeaders: {},
18
33
  draggable: { type: Boolean },
19
34
  disabled: { type: Boolean },
20
35
  readonly: { type: Boolean },
21
36
  isUpdate: { type: Boolean },
22
37
  showRowNumbers: { type: Boolean },
23
38
  canRemoveRow: { type: Boolean },
39
+ isStacked: { type: Boolean },
40
+ variant: {},
41
+ size: {},
42
+ rounded: {},
43
+ rowTitleKey: {},
24
44
  helpers: {},
25
45
  onFieldChange: { type: Function },
26
46
  onRemoveRow: { type: Function }
27
47
  },
28
48
  setup(e) {
29
- const o = e, s = d(() => o.draggable && !o.disabled && !o.readonly), w = d(() => o.helpers.getRowErrorsHash(o.rowIndex)), c = (r) => U(r, o.helpers.getRowContext(o.rowIndex)), b = (r) => {
30
- const t = c(r);
49
+ const o = e, b = s(() => o.draggable && !o.disabled && !o.readonly), k = s(() => o.helpers.getRowErrorsHash(o.rowIndex)), g = s(
50
+ () => G({
51
+ row: o.row,
52
+ titleKey: o.rowTitleKey,
53
+ schema: o.fields
54
+ })
55
+ ), v = s(() => g.value || `#${o.rowIndex + 1}`), R = s(
56
+ () => o.showRowNumbers && !!g.value
57
+ ), x = (r) => M(r, o.helpers.getRowContext(o.rowIndex)), U = (r) => {
58
+ const n = x(r);
59
+ return {
60
+ ...r,
61
+ props: {
62
+ ...n === "multiSelect" ? { showControls: !1, wrap: !1 } : {},
63
+ ...n === "file" || n === "fileUploader" ? { variant: "input" } : {},
64
+ ...n === "switch" ? { switchVariant: "basic" } : {},
65
+ ...n === "check" ? { size: "sm" } : {},
66
+ ...n === "color" ? { trigger: "swatch" } : {},
67
+ ...r.props || {}
68
+ },
69
+ label: void 0
70
+ };
71
+ }, E = (r) => {
72
+ const n = x(r);
31
73
  return {
32
74
  ...r,
33
75
  props: {
34
- ...t === "multiSelect" ? { showControls: !1, wrap: !1 } : {},
35
- ...t === "file" || t === "fileUploader" ? { variant: "input" } : {},
36
- ...t === "switch" ? { switchVariant: "basic" } : {},
37
- ...t === "check" ? { size: "sm" } : {},
38
- ...t === "color" ? { trigger: "swatch" } : {},
76
+ ...n === "switch" ? { switchVariant: "basic" } : {},
39
77
  ...r.props || {}
40
78
  },
41
79
  label: void 0
42
80
  };
43
- }, h = (r) => ["switch", "check"].includes(String(c(r))), g = d(() => {
81
+ }, H = (r) => ["switch", "check"].includes(String(x(r))), I = (r) => {
82
+ const n = String(o.helpers.getResolvedType(r, o.rowIndex));
83
+ return n === "check" || n === "switch" && r.props?.switchVariant === "basic";
84
+ }, j = (r, n) => {
85
+ if (!n) return !1;
86
+ const t = String(o.helpers.getResolvedType(r, o.rowIndex));
87
+ return t !== "switch" && t !== "check" && t !== "customFields" && t !== "choiceBox";
88
+ }, $ = s(() => {
44
89
  const r = [];
45
- return s.value && r.push("2.5rem"), o.showRowNumbers && r.push("2.5rem"), r.push(...o.fields.map(() => "minmax(0, 1fr)")), o.canRemoveRow && r.push("2.5rem"), r.join(" ");
90
+ return b.value && r.push("2.5rem"), o.showRowNumbers && r.push("2.5rem"), r.push(...o.fields.map(() => "minmax(0, 1fr)")), o.canRemoveRow && r.push("2.5rem"), r.join(" ");
46
91
  });
47
- return (r, t) => f([e.row, e.disabled, e.readonly, e.isUpdate, e.showRowNumbers, e.canRemoveRow, e.draggable, e.rowIndex, w.value], () => (a(), l("div", {
92
+ return (r, n) => e.isStacked ? F([
93
+ e.row,
94
+ e.disabled,
95
+ e.readonly,
96
+ e.isUpdate,
97
+ e.showRowNumbers,
98
+ e.canRemoveRow,
99
+ e.draggable,
100
+ e.rowIndex,
101
+ e.columnHeaders,
102
+ e.variant,
103
+ e.size,
104
+ e.rounded,
105
+ e.rowTitleKey,
106
+ v.value,
107
+ R.value,
108
+ k.value
109
+ ], () => (a(), l("div", {
110
+ key: 0,
111
+ class: "custom-fields-table-row--stacked border border-border rounded-lg overflow-hidden bg-white min-w-0"
112
+ }, [
113
+ u("div", O, [
114
+ u("div", A, [
115
+ b.value ? (a(), l("button", {
116
+ key: 0,
117
+ type: "button",
118
+ class: m(["drag-handle flex items-center justify-center w-8 h-8 shrink-0 rounded text-muted-foreground hover:text-foreground hover:bg-muted/50 cursor-grab active:cursor-grabbing", e.disabled ? "cursor-not-allowed opacity-50" : ""]),
119
+ "aria-label": "Reorder row"
120
+ }, [
121
+ w(z, {
122
+ icon: "lucide:grip-vertical",
123
+ class: "w-4 h-4"
124
+ })
125
+ ], 2)) : d("", !0),
126
+ R.value ? (a(), l("span", J, " #" + i(e.rowIndex + 1), 1)) : d("", !0),
127
+ u("span", {
128
+ class: m(["text-sm font-medium text-foreground truncate min-w-0", g.value ? "" : "text-muted-foreground"]),
129
+ title: v.value
130
+ }, i(v.value), 11, P)
131
+ ]),
132
+ e.canRemoveRow ? (a(), h(N, {
133
+ key: 0,
134
+ type: "button",
135
+ variant: "ghost",
136
+ size: "xs",
137
+ icon: "lucide:trash-2",
138
+ class: "shrink-0",
139
+ disabled: e.disabled || e.readonly,
140
+ onClick: n[0] || (n[0] = (t) => e.onRemoveRow(e.rowIndex))
141
+ }, null, 8, ["disabled"])) : d("", !0)
142
+ ]),
143
+ u("div", Q, [
144
+ (a(!0), l(f, null, C(e.fields, (t, c) => (a(), l("div", {
145
+ key: t.name,
146
+ class: "flex flex-col min-w-0 gap-1.5"
147
+ }, [
148
+ e.helpers.isFieldVisible(e.rowIndex, t) ? (a(), l(f, { key: 0 }, [
149
+ j(t, e.columnHeaders[c] || "") ? (a(), h(V, {
150
+ key: 0,
151
+ class: "text-xs font-semibold uppercase tracking-wider text-muted-foreground"
152
+ }, {
153
+ default: T(() => [
154
+ B(i(e.columnHeaders[c]) + " ", 1),
155
+ t.required ? (a(), l("span", W, "*")) : d("", !0)
156
+ ]),
157
+ _: 2
158
+ }, 1024)) : d("", !0),
159
+ u("div", {
160
+ class: m(["relative min-w-0", I(t) ? "w-auto flex items-center" : "w-full"])
161
+ }, [
162
+ w(S, {
163
+ field: E(t),
164
+ value: e.helpers.getFieldValue(e.rowIndex, t.name),
165
+ values: e.row,
166
+ errors: e.helpers.errors,
167
+ error: e.helpers.getFieldError(e.rowIndex, t.name),
168
+ variant: e.variant,
169
+ size: e.size,
170
+ rounded: e.rounded,
171
+ disabled: e.disabled || e.helpers.isFieldDisabled(e.rowIndex, t),
172
+ readonly: e.readonly || e.helpers.isFieldReadonly(e.rowIndex, t),
173
+ isUpdate: e.isUpdate,
174
+ class: "w-full",
175
+ onChange: (y) => e.onFieldChange(e.rowIndex, t.name, y)
176
+ }, null, 8, ["field", "value", "values", "errors", "error", "variant", "size", "rounded", "disabled", "readonly", "isUpdate", "onChange"]),
177
+ I(t) ? (a(), h(V, {
178
+ key: 0,
179
+ class: "ml-2 text-sm font-medium cursor-pointer"
180
+ }, {
181
+ default: T(() => [
182
+ B(i(e.columnHeaders[c]) + " ", 1),
183
+ t.required ? (a(), l("span", X, "*")) : d("", !0)
184
+ ]),
185
+ _: 2
186
+ }, 1024)) : d("", !0)
187
+ ], 2),
188
+ e.helpers.getFieldError(e.rowIndex, t.name) && !K(q)(e.helpers.getResolvedType(t, e.rowIndex)) ? (a(), l("p", Y, i(e.helpers.getFieldError(e.rowIndex, t.name)), 1)) : d("", !0)
189
+ ], 64)) : d("", !0)
190
+ ]))), 128))
191
+ ])
192
+ ])), n, 1) : F([e.row, e.disabled, e.readonly, e.isUpdate, e.showRowNumbers, e.canRemoveRow, e.draggable, e.rowIndex, k.value], () => (a(), l("div", {
193
+ key: 1,
48
194
  class: "grid group bg-white transition-colors min-w-0",
49
- style: R({ gridTemplateColumns: g.value })
195
+ style: L({ gridTemplateColumns: $.value })
50
196
  }, [
51
- s.value ? (a(), l("div", {
197
+ b.value ? (a(), l("div", {
52
198
  key: 0,
53
199
  class: m([
54
200
  "w-10 flex-none flex items-center justify-center border-r border-border bg-muted/5 drag-handle transition-colors",
55
201
  e.disabled ? "cursor-not-allowed opacity-50" : "cursor-grab active:cursor-grabbing hover:bg-muted/10 text-muted-foreground hover:text-foreground"
56
202
  ])
57
203
  }, [
58
- u(N, {
204
+ w(z, {
59
205
  icon: "lucide:grip-vertical",
60
206
  class: "w-4 h-4"
61
207
  })
62
- ], 2)) : i("", !0),
63
- e.showRowNumbers ? (a(), l("div", z, C(e.rowIndex + 1), 1)) : i("", !0),
64
- (a(!0), l(F, null, I(e.fields, (n, y) => (a(), l("div", {
65
- key: n.name,
208
+ ], 2)) : d("", !0),
209
+ e.showRowNumbers ? (a(), l("div", Z, i(e.rowIndex + 1), 1)) : d("", !0),
210
+ (a(!0), l(f, null, C(e.fields, (t, c) => (a(), l("div", {
211
+ key: t.name,
66
212
  class: m(["min-w-0 relative", [
67
- { "border-l border-border": y > 0 },
68
- h(n) ? "flex items-center px-3" : ""
213
+ { "border-l border-border": c > 0 },
214
+ H(t) ? "flex items-center px-3" : ""
69
215
  ]])
70
216
  }, [
71
- e.helpers.isFieldVisible(e.rowIndex, n) ? (a(), k(B, {
217
+ e.helpers.isFieldVisible(e.rowIndex, t) ? (a(), h(S, {
72
218
  key: 0,
73
- field: b(n),
74
- value: e.helpers.getFieldValue(e.rowIndex, n.name),
219
+ field: U(t),
220
+ value: e.helpers.getFieldValue(e.rowIndex, t.name),
75
221
  values: e.row,
76
222
  errors: e.helpers.errors,
77
- error: e.helpers.getFieldError(e.rowIndex, n.name),
223
+ error: e.helpers.getFieldError(e.rowIndex, t.name),
78
224
  variant: "transparent",
79
225
  size: "sm",
80
226
  rounded: "none",
81
- disabled: e.disabled || e.helpers.isFieldDisabled(e.rowIndex, n),
82
- readonly: e.readonly || e.helpers.isFieldReadonly(e.rowIndex, n),
227
+ disabled: e.disabled || e.helpers.isFieldDisabled(e.rowIndex, t),
228
+ readonly: e.readonly || e.helpers.isFieldReadonly(e.rowIndex, t),
83
229
  isUpdate: e.isUpdate,
84
230
  class: "w-full h-full min-h-[40px]",
85
- onChange: (v) => e.onFieldChange(e.rowIndex, n.name, v)
86
- }, null, 8, ["field", "value", "values", "errors", "error", "disabled", "readonly", "isUpdate", "onChange"])) : i("", !0)
231
+ onChange: (y) => e.onFieldChange(e.rowIndex, t.name, y)
232
+ }, null, 8, ["field", "value", "values", "errors", "error", "disabled", "readonly", "isUpdate", "onChange"])) : d("", !0)
87
233
  ], 2))), 128)),
88
- e.canRemoveRow ? (a(), l("div", V, [
89
- u(T, {
234
+ e.canRemoveRow ? (a(), l("div", p, [
235
+ w(N, {
90
236
  type: "button",
91
237
  variant: "ghost",
92
238
  size: "xs",
93
239
  icon: "lucide:trash-2",
94
240
  disabled: e.disabled || e.readonly,
95
- onClick: t[0] || (t[0] = (n) => e.onRemoveRow(e.rowIndex))
241
+ onClick: n[2] || (n[2] = (t) => e.onRemoveRow(e.rowIndex))
96
242
  }, null, 8, ["disabled"])
97
- ])) : i("", !0)
98
- ], 4)), t, 1);
243
+ ])) : d("", !0)
244
+ ], 4)), n, 3);
99
245
  }
100
246
  });
101
247
  export {
102
- H as default
248
+ le as default
103
249
  };
@@ -1,3 +1,4 @@
1
+ import { InputVariant, InputSize, InputRounded } from '../../types';
1
2
  import { IForm, IFormFieldChangePayload } from './types';
2
3
  import { CustomFieldRow, RowHelpers } from './rowHelpers';
3
4
  interface Props {
@@ -15,9 +16,18 @@ interface Props {
15
16
  helpers: RowHelpers;
16
17
  emptyTitle: string;
17
18
  emptyDescription: string;
19
+ variant?: InputVariant;
20
+ size?: InputSize;
21
+ rounded?: InputRounded;
22
+ rowTitleKey?: string;
18
23
  onFieldChange: (rowIndex: number, fieldName: string, payload: IFormFieldChangePayload) => void;
19
24
  onRemoveRow: (index: number) => void;
20
25
  onDragUpdate: (rows: CustomFieldRow[]) => void;
21
26
  }
22
- declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
27
+ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
28
+ variant: InputVariant;
29
+ size: InputSize;
30
+ rounded: InputRounded;
31
+ rowTitleKey: string;
32
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
23
33
  export default _default;