vlite3 0.9.2 → 0.9.3

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.
@@ -1,6 +1,6 @@
1
- import { defineComponent as V, ref as B, computed as t, useSlots as N, openBlock as a, createElementBlock as i, normalizeClass as r, renderSlot as p, createBlock as S, createCommentVNode as o, createElementVNode as v, toDisplayString as m, createTextVNode as T, createVNode as j } from "vue";
2
- import f from "./Icon.vue.js";
3
- import { $t as y } from "../utils/i18n.js";
1
+ import { defineComponent as V, ref as B, computed as t, useSlots as N, openBlock as r, createElementBlock as i, normalizeClass as l, renderSlot as p, createBlock as S, createCommentVNode as a, createElementVNode as v, toDisplayString as f, createTextVNode as T, createVNode as j } from "vue";
2
+ import b from "./Icon.vue.js";
3
+ import { $t as m } from "../utils/i18n.js";
4
4
  const D = ["role"], E = {
5
5
  key: 1,
6
6
  class: "text-sm opacity-90 [&_p]:leading-relaxed"
@@ -18,67 +18,69 @@ const D = ["role"], E = {
18
18
  class: { default: "" }
19
19
  },
20
20
  emits: ["close"],
21
- setup(s, { emit: b }) {
22
- const e = s, k = b, u = B(!0), x = () => {
23
- u.value = !1, k("close");
24
- }, d = t(() => e.titleI18n ? y(e.titleI18n) : e.title), c = t(() => e.descriptionI18n ? y(e.descriptionI18n) : e.description), h = t(() => ({
25
- primary: "bg-primary-light text-primary border-primary/15",
26
- success: "bg-success-light text-success-dark border-success/25",
27
- warning: "bg-warning-light text-warning-dark border-warning/20",
28
- danger: "bg-danger-light text-danger-dark border-danger/15"
21
+ setup(s, { emit: y }) {
22
+ const e = s, x = y, u = B(!0), h = () => {
23
+ u.value = !1, x("close");
24
+ }, d = t(() => e.titleI18n ? m(e.titleI18n) : e.title), c = t(
25
+ () => e.descriptionI18n ? m(e.descriptionI18n) : e.description
26
+ ), k = t(() => ({
27
+ danger: "bg-danger-subtle text-danger-subtle-fg border-danger-subtle-border/20",
28
+ primary: "bg-primary-light text-primary-light-fg border-primary/10",
29
+ success: "bg-success-subtle text-success-subtle-fg border-success-subtle-border/20",
30
+ warning: "bg-warning-subtle text-warning-subtle-fg border-warning-subtle-border/20"
29
31
  })[e.variant]), w = t(() => ({
30
- primary: "text-primary!",
31
- success: "text-success-dark!",
32
- warning: "text-warning-dark!",
33
- danger: "text-danger-dark!"
34
- })[e.variant]), l = t(() => !c.value && !N().default), C = t(() => [
32
+ primary: "text-primary-light-fg!",
33
+ success: "text-success-subtle-fg!",
34
+ warning: "text-warning-subtle-fg!",
35
+ danger: "text-danger-subtle-fg!"
36
+ })[e.variant]), o = t(() => !c.value && !N().default), C = t(() => [
35
37
  "relative w-full rounded-lg border px-4 [&>svg]:absolute [&>svg]:left-4 [&>svg]:text-foreground",
36
- l.value ? "py-3" : "pt-4 pb-2",
37
- l.value ? "[&>svg]:top-1/2 [&>svg]:-translate-y-1/2" : "[&>svg]:top-4 top-4 [&>svg+div]:translate-y-[-3px]",
38
- h.value,
38
+ o.value ? "py-3" : "pt-4 pb-2",
39
+ o.value ? "[&>svg]:top-1/2 [&>svg]:-translate-y-1/2" : "[&>svg]:top-4 top-4 [&>svg+div]:translate-y-[-3px]",
40
+ k.value,
39
41
  e.class
40
42
  ].join(" ")), I = t(() => [
41
43
  "font-medium leading-none tracking-tight text-inherit!",
42
- l.value ? "" : "mb-1"
44
+ o.value ? "" : "mb-1"
43
45
  ].join(" ")), $ = t(() => e.role ? e.role : ["danger", "warning"].includes(e.variant) ? "alert" : "status");
44
- return (n, g) => u.value ? (a(), i("div", {
46
+ return (n, g) => u.value ? (r(), i("div", {
45
47
  key: 0,
46
- class: r(C.value),
48
+ class: l(C.value),
47
49
  role: $.value
48
50
  }, [
49
51
  p(n.$slots, "icon", {}, () => [
50
- s.icon ? (a(), S(f, {
52
+ s.icon ? (r(), S(b, {
51
53
  key: 0,
52
54
  icon: s.icon,
53
- class: r(["h-4 w-4", w.value])
54
- }, null, 8, ["icon", "class"])) : o("", !0)
55
+ class: l(["h-4 w-4", w.value])
56
+ }, null, 8, ["icon", "class"])) : a("", !0)
55
57
  ]),
56
58
  v("div", {
57
- class: r({ "pl-7": s.icon || n.$slots.icon, "pr-6": s.closable })
59
+ class: l({ "pl-7": s.icon || n.$slots.icon, "pr-6": s.closable })
58
60
  }, [
59
- d.value ? (a(), i("h5", {
61
+ d.value ? (r(), i("h5", {
60
62
  key: 0,
61
- class: r(I.value)
62
- }, m(d.value), 3)) : o("", !0),
63
- c.value || n.$slots.default ? (a(), i("div", E, [
63
+ class: l(I.value)
64
+ }, f(d.value), 3)) : a("", !0),
65
+ c.value || n.$slots.default ? (r(), i("div", E, [
64
66
  p(n.$slots, "default", {}, () => [
65
- T(m(c.value), 1)
67
+ T(f(c.value), 1)
66
68
  ])
67
- ])) : o("", !0)
69
+ ])) : a("", !0)
68
70
  ], 2),
69
- s.closable ? (a(), i("button", {
71
+ s.closable ? (r(), i("button", {
70
72
  key: 0,
71
73
  type: "button",
72
- onClick: x,
73
- class: r(["absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", [l.value ? "top-1/2 -translate-y-1/2" : "top-4"]])
74
+ onClick: h,
75
+ class: l(["absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", [o.value ? "top-1/2 -translate-y-1/2" : "top-4"]])
74
76
  }, [
75
- j(f, {
77
+ j(b, {
76
78
  icon: "lucide:x",
77
79
  class: "h-4 w-4"
78
80
  }),
79
81
  g[0] || (g[0] = v("span", { class: "sr-only" }, "Close", -1))
80
- ], 2)) : o("", !0)
81
- ], 10, D)) : o("", !0);
82
+ ], 2)) : a("", !0)
83
+ ], 10, D)) : a("", !0);
82
84
  }
83
85
  });
84
86
  export {
@@ -352,7 +352,7 @@ declare function __VLS_template(): {
352
352
  };
353
353
  }>> & Readonly<{
354
354
  "onSlide-change"?: ((index: number) => any) | undefined;
355
- }>, "focus" | "state" | "direction" | "goNext" | "draggable" | "easing" | "gap" | "pagination" | "paginationSize" | "paginationVisibility" | "paginationHoverInitialTimeout" | "paginationHoverEdgeThreshold" | "autoPlay" | "autoPlayInterval" | "itemsToShow" | "speed" | "mousewheel" | "loop" | "currentItem" | "bufferSize" | "maxDomElements" | "goToSlide" | "goPrev" | "autoFocus" | "wheelOptions" | "canGoNext" | "canGoPrev"> & import('vue').ShallowUnwrapRef<{
355
+ }>, "focus" | "state" | "direction" | "draggable" | "easing" | "goNext" | "gap" | "pagination" | "paginationSize" | "paginationVisibility" | "paginationHoverInitialTimeout" | "paginationHoverEdgeThreshold" | "autoPlay" | "autoPlayInterval" | "itemsToShow" | "speed" | "mousewheel" | "loop" | "currentItem" | "bufferSize" | "maxDomElements" | "goToSlide" | "goPrev" | "autoFocus" | "wheelOptions" | "canGoNext" | "canGoPrev"> & import('vue').ShallowUnwrapRef<{
356
356
  goToSlide: (index: number, smooth?: boolean) => void;
357
357
  goNext: (smooth?: boolean) => void;
358
358
  goPrev: (smooth?: boolean) => void;
@@ -778,7 +778,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
778
778
  };
779
779
  }>> & Readonly<{
780
780
  "onSlide-change"?: ((index: number) => any) | undefined;
781
- }>, "focus" | "state" | "direction" | "goNext" | "draggable" | "easing" | "gap" | "pagination" | "paginationSize" | "paginationVisibility" | "paginationHoverInitialTimeout" | "paginationHoverEdgeThreshold" | "autoPlay" | "autoPlayInterval" | "itemsToShow" | "speed" | "mousewheel" | "loop" | "currentItem" | "bufferSize" | "maxDomElements" | "goToSlide" | "goPrev" | "autoFocus" | "wheelOptions" | "canGoNext" | "canGoPrev"> & import('vue').ShallowUnwrapRef<{
781
+ }>, "focus" | "state" | "direction" | "draggable" | "easing" | "goNext" | "gap" | "pagination" | "paginationSize" | "paginationVisibility" | "paginationHoverInitialTimeout" | "paginationHoverEdgeThreshold" | "autoPlay" | "autoPlayInterval" | "itemsToShow" | "speed" | "mousewheel" | "loop" | "currentItem" | "bufferSize" | "maxDomElements" | "goToSlide" | "goPrev" | "autoFocus" | "wheelOptions" | "canGoNext" | "canGoPrev"> & import('vue').ShallowUnwrapRef<{
782
782
  goToSlide: (index: number, smooth?: boolean) => void;
783
783
  goNext: (smooth?: boolean) => void;
784
784
  goPrev: (smooth?: boolean) => void;
@@ -1,7 +1,7 @@
1
1
  import o from "./Carousel.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-4034dab4"]]);
4
+ const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-e8fba320"]]);
5
5
  export {
6
- p as default
6
+ f as default
7
7
  };
@@ -6,7 +6,7 @@ const w = { class: "carousel-wrapper" }, V = /* @__PURE__ */ g({
6
6
  props: {
7
7
  data: { default: () => [] },
8
8
  pagination: { type: [String, Array, Boolean], default: "dots" },
9
- paginationSize: { default: "md" },
9
+ paginationSize: { default: "sm" },
10
10
  paginationPosition: { default: "bottom-center" },
11
11
  paginationVisibility: {},
12
12
  paginationHoverInitialTimeout: {},
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as C, computed as S, openBlock as s, createElementBlock as d, normalizeClass as u, withModifiers as B, createElementVNode as M, createVNode as p, createCommentVNode as N, Fragment as V, renderList as z, renderSlot as F, createBlock as m } from "vue";
2
2
  import L from "../CheckBox.vue.js";
3
3
  import $ from "../Price/Price.vue.js";
4
- import T from "../Date/Date.vue.js";
4
+ import T from "../DateTime/DateTime.vue.js";
5
5
  const E = ["data-state"], H = { class: "flex items-center justify-center" }, I = ["title", "innerHTML"], j = /* @__PURE__ */ C({
6
6
  __name: "DataTableRow",
7
7
  props: {
@@ -0,0 +1,31 @@
1
+ import { defineComponent as D, computed as n, openBlock as _, createElementBlock as g, toDisplayString as h } from "vue";
2
+ import s from "dayjs";
3
+ import { useVLiteConfig as y } from "../../core/config.js";
4
+ const V = /* @__PURE__ */ D({
5
+ __name: "DateTime",
6
+ props: {
7
+ value: {},
8
+ format: {}
9
+ },
10
+ setup(m) {
11
+ const t = m, i = y(), c = n(() => t.format || i?.components?.datetime?.format || "MM/DD/YYYY"), f = n(() => {
12
+ if (!t.value) return "--";
13
+ if (typeof t.value == "string") {
14
+ const e = t.value.trim();
15
+ if (/^([01]?\d|2[0-3]):([0-5]\d)(:([0-5]\d))?$/.test(e)) {
16
+ const r = e.split(":"), u = r[0].padStart(2, "0"), l = r[1], p = r[2] || "00", d = `1970-01-01T${u}:${l}:${p}`, a = s(d);
17
+ if (a.isValid()) {
18
+ const v = t.format || "h:mm A";
19
+ return a.format(v);
20
+ }
21
+ }
22
+ }
23
+ const o = s(t.value);
24
+ return o.isValid() ? o.format(c.value) : String(t.value);
25
+ });
26
+ return (o, e) => (_(), g("span", null, h(f.value), 1));
27
+ }
28
+ });
29
+ export {
30
+ V as default
31
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./DateTime.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1 @@
1
+ export { default as DateTime } from './DateTime.vue';
@@ -8,6 +8,7 @@ interface Props {
8
8
  size?: InputSize;
9
9
  rounded?: InputRounded;
10
10
  disabled?: boolean;
11
+ draggable?: boolean;
11
12
  minRows?: number;
12
13
  maxRows?: number;
13
14
  addButtonText?: string;
@@ -33,6 +34,7 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
33
34
  isUpdate: boolean;
34
35
  modelValue: Record<string, any>[];
35
36
  headers: string[];
37
+ draggable: boolean;
36
38
  minRows: number;
37
39
  addButtonText: string;
38
40
  showRowNumbers: boolean;
@@ -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 p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-0cced8cd"]]);
4
+ const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-877e3c1c"]]);
5
5
  export {
6
- p as default
6
+ r as default
7
7
  };
@@ -1,27 +1,32 @@
1
- import { defineComponent as M, computed as c, shallowRef 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 = {
1
+ import { defineComponent as H, computed as c, shallowRef as q, watch as G, openBlock as o, createElementBlock as n, createElementVNode as g, createBlock as J, withCtx as B, createTextVNode as K, toDisplayString as m, createCommentVNode as i, createVNode as b, Fragment as y, renderList as p, normalizeClass as x, unref as O, isMemoSame as P } from "vue";
2
+ import { VueDraggable as Q } from "vue-draggable-plus";
3
+ import W from "./FormField.vue.js";
4
+ import F from "../Button.vue.js";
5
+ import X from "../Label.vue.js";
6
+ import Y from "../Icon.vue.js";
7
+ import { $t as h } from "../../utils/i18n.js";
8
+ const Z = { class: "custom-fields-wrapper" }, ee = { class: "flex justify-between items-center mb-2" }, te = { class: "custom-fields-table border border-border rounded overflow-hidden bg-background" }, ae = {
7
9
  key: 0,
8
10
  class: "flex border-b border-border bg-muted/50 text-gray-800 text-xs font-semibold uppercase tracking-wider"
9
- }, ee = {
11
+ }, le = {
10
12
  key: 0,
11
- class: "w-10 flex-none p-3 text-center border-r border-border"
12
- }, te = {
13
+ class: "w-10 flex-none p-3 border-r border-border"
14
+ }, re = {
13
15
  key: 1,
14
- class: "w-10 flex-none p-3"
16
+ class: "w-10 flex-none p-3 text-center border-r border-border"
15
17
  }, se = {
16
- key: 0,
17
- class: "w-10 flex-none flex items-center justify-center text-xs text-muted-foreground border-r border-border bg-muted/20"
18
- }, le = {
18
+ key: 2,
19
+ class: "w-10 flex-none p-3"
20
+ }, oe = {
19
21
  key: 1,
22
+ class: "w-10 flex-none flex items-center justify-center text-xs text-muted-foreground border-r border-border bg-muted/20"
23
+ }, ne = {
24
+ key: 2,
20
25
  class: "w-10 flex-none flex items-center justify-center border-l border-border bg-muted/20"
21
- }, ae = {
26
+ }, de = {
22
27
  key: 1,
23
28
  class: "flex flex-col items-center justify-center py-6 text-center bg-muted/5"
24
- }, oe = { class: "text-sm font-medium text-foreground" }, ne = { class: "text-xs text-muted-foreground mt-1" }, fe = /* @__PURE__ */ M({
29
+ }, ie = { class: "text-sm font-medium text-foreground" }, ue = { class: "text-xs text-muted-foreground mt-1" }, ye = /* @__PURE__ */ H({
25
30
  __name: "CustomFields",
26
31
  props: {
27
32
  modelValue: { default: () => [] },
@@ -31,6 +36,7 @@ const W = { class: "custom-fields-wrapper" }, X = { class: "flex justify-between
31
36
  size: { default: "md" },
32
37
  rounded: { default: "md" },
33
38
  disabled: { type: Boolean, default: !1 },
39
+ draggable: { type: Boolean, default: !1 },
34
40
  minRows: { default: 0 },
35
41
  maxRows: {},
36
42
  addButtonText: { default: "Add Row" },
@@ -42,144 +48,160 @@ const W = { class: "custom-fields-wrapper" }, X = { class: "flex justify-between
42
48
  isUpdate: { type: Boolean, default: !1 }
43
49
  },
44
50
  emits: ["update:modelValue", "change"],
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");
51
+ setup(r, { emit: $ }) {
52
+ const t = r, R = $, k = c(() => t.labelI18n ? h(t.labelI18n) : t.label), D = c(() => {
53
+ const e = h("vlite.customFields.emptyTitle");
48
54
  return e !== "vlite.customFields.emptyTitle" ? e : "No items added";
49
- }), z = c(() => {
50
- const e = p("vlite.customFields.emptyDescription");
55
+ }), U = c(() => {
56
+ const e = h("vlite.customFields.emptyDescription");
51
57
  return e !== "vlite.customFields.emptyDescription" ? e : "Add a new item to get started";
52
- }), l = G([]), R = () => `row_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
53
- H(
58
+ }), l = q([]), _ = () => `row_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
59
+ G(
54
60
  () => t.modelValue,
55
61
  (e) => {
56
- Array.isArray(e) ? l.value = e.map((s, r) => {
57
- const a = l.value[r];
62
+ Array.isArray(e) ? l.value = e.map((a, d) => {
63
+ const s = l.value[d];
58
64
  return {
59
- ...s,
60
- _id: a?._id || R()
65
+ ...a,
66
+ _id: s?._id || _()
61
67
  };
62
68
  }) : l.value = [];
63
69
  },
64
70
  { immediate: !0, deep: !0 }
65
71
  );
66
- const A = () => {
72
+ const j = () => {
67
73
  const e = {};
68
- for (const s of t.schema) {
69
- const r = typeof s.value == "function" ? s.value() : s.value;
70
- e[s.name] = r ?? null;
74
+ for (const a of t.schema) {
75
+ const d = typeof a.value == "function" ? a.value() : a.value;
76
+ e[a.name] = d ?? null;
71
77
  }
72
- return { ...e, _id: R() };
73
- }, D = () => {
78
+ return { ...e, _id: _() };
79
+ }, z = () => {
74
80
  if (t.disabled || t.maxRows && l.value.length >= t.maxRows) return;
75
- const e = [...l.value, A()];
76
- l.value = e, h(e);
77
- }, E = (e) => {
81
+ const e = [...l.value, j()];
82
+ l.value = e, f(e);
83
+ }, A = (e) => {
78
84
  if (t.disabled || l.value.length <= t.minRows) return;
79
- const s = [...l.value];
80
- s.splice(e, 1), l.value = s, h(s);
81
- }, U = (e, s, r) => {
82
85
  const a = [...l.value];
83
- a[e] = {
84
- ...a[e],
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, {
86
+ a.splice(e, 1), l.value = a, f(a);
87
+ }, E = (e, a, d) => {
88
+ const s = [...l.value];
89
+ s[e] = {
90
+ ...s[e],
91
+ [a]: d.value
92
+ }, l.value = s, f(s);
93
+ }, T = (e) => {
94
+ l.value = e, f(e);
95
+ }, f = (e) => {
96
+ const a = e.map(({ _id: d, ...s }) => s);
97
+ R("update:modelValue", a), R("change", a);
98
+ }, S = (e, a) => l.value[e]?.[a], I = c(() => !(t.disabled || t.maxRows && l.value.length >= t.maxRows)), w = c(() => t.disabled ? !1 : l.value.length > t.minRows), C = c(() => t.headers && t.headers.length > 0 ? t.headers : t.schema.map((e) => e.labelI18n ? h(e.labelI18n) : e.label || e.name));
99
+ return (e, a) => (o(), n("div", Z, [
100
+ g("div", ee, [
101
+ k.value ? (o(), J(X, {
94
102
  key: 0,
95
103
  class: "text-sm font-medium text-foreground"
96
104
  }, {
97
- default: N(() => [
98
- J(m(_.value), 1)
105
+ default: B(() => [
106
+ K(m(k.value), 1)
99
107
  ]),
100
108
  _: 1
101
- })) : u("", !0),
102
- v(B, {
109
+ })) : i("", !0),
110
+ b(F, {
103
111
  type: "button",
104
112
  variant: "outline",
105
113
  size: "xs",
106
114
  rounded: "full",
107
115
  icon: "lucide:plus",
108
- disabled: !S.value,
109
- onClick: D
116
+ disabled: !I.value,
117
+ onClick: z
110
118
  }, null, 8, ["disabled"])
111
119
  ]),
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
- key: a,
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
- ])) : u("", !0),
121
- v(K, {
122
- name: "list",
123
- tag: "div",
120
+ g("div", te, [
121
+ C.value.length > 0 ? (o(), n("div", ae, [
122
+ r.draggable ? (o(), n("div", le)) : i("", !0),
123
+ r.showRowNumbers ? (o(), n("div", re, " # ")) : i("", !0),
124
+ (o(!0), n(y, null, p(C.value, (d, s) => (o(), n("div", {
125
+ key: s,
126
+ class: x(["flex-1 p-3 min-w-0 truncate", { "border-l border-border": s > 0 }])
127
+ }, m(d), 3))), 128)),
128
+ w.value ? (o(), n("div", se)) : i("", !0)
129
+ ])) : i("", !0),
130
+ b(O(Q), {
131
+ "model-value": l.value,
132
+ "onUpdate:modelValue": T,
133
+ disabled: !r.draggable || r.disabled,
134
+ animation: 150,
135
+ handle: ".drag-handle",
136
+ "ghost-class": "opacity-50",
124
137
  class: "divide-y divide-border"
125
138
  }, {
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,
139
+ default: B(() => [
140
+ (o(!0), n(y, null, p(l.value, (d, s, ce, v) => {
141
+ const V = [d, r.disabled, r.isUpdate, r.showRowNumbers, w.value, r.draggable, s];
142
+ if (v && v.key === d._id && P(v, V)) return v;
143
+ const N = (o(), n("div", {
144
+ key: d._id,
132
145
  class: "flex group bg-white transition-colors"
133
146
  }, [
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 }])
147
+ r.draggable ? (o(), n("div", {
148
+ key: 0,
149
+ class: x(["w-10 flex-none flex items-center justify-center border-r border-border bg-muted/5 drag-handle transition-colors", r.disabled ? "cursor-not-allowed opacity-50" : "cursor-grab active:cursor-grabbing hover:bg-muted/10 text-muted-foreground hover:text-foreground"])
150
+ }, [
151
+ b(Y, {
152
+ icon: "lucide:grip-vertical",
153
+ class: "w-4 h-4"
154
+ })
155
+ ], 2)) : i("", !0),
156
+ r.showRowNumbers ? (o(), n("div", oe, m(s + 1), 1)) : i("", !0),
157
+ (o(!0), n(y, null, p(r.schema, (u, L) => (o(), n("div", {
158
+ key: u.name,
159
+ class: x(["flex-1 min-w-0 relative", { "border-l border-border": L > 0 }])
138
160
  }, [
139
- v(P, {
161
+ b(W, {
140
162
  field: {
141
- ...i,
163
+ ...u,
142
164
  props: {
143
- ...i.type === "multiSelect" ? { showControls: !1, wrap: !1 } : {},
144
- ...i.props || {}
165
+ ...u.type === "multiSelect" ? { showControls: !1, wrap: !1 } : {},
166
+ ...u.props || {}
145
167
  },
146
168
  label: void 0
147
169
  },
148
- value: j(a, i.name),
149
- values: d.values || {},
170
+ value: S(s, u.name),
171
+ values: r.values || {},
150
172
  variant: "transparent",
151
173
  size: "sm",
152
174
  rounded: "none",
153
- disabled: d.disabled,
154
- isUpdate: d.isUpdate,
175
+ disabled: r.disabled,
176
+ isUpdate: r.isUpdate,
155
177
  class: "w-full h-full min-h-[40px]",
156
- onChange: (L) => U(a, i.name, L)
178
+ onChange: (M) => E(s, u.name, M)
157
179
  }, null, 8, ["field", "value", "values", "disabled", "isUpdate", "onChange"])
158
180
  ], 2))), 128)),
159
- w.value ? (o(), n("div", le, [
160
- v(B, {
181
+ w.value ? (o(), n("div", ne, [
182
+ b(F, {
161
183
  type: "button",
162
184
  variant: "ghost",
163
185
  size: "xs",
164
186
  icon: "lucide:trash-2",
165
- disabled: d.disabled,
166
- onClick: (i) => E(a)
187
+ disabled: r.disabled,
188
+ onClick: (u) => A(s)
167
189
  }, null, 8, ["disabled", "onClick"])
168
- ])) : u("", !0)
190
+ ])) : i("", !0)
169
191
  ]));
170
- return V.memo = C, V;
171
- }, s, 0), 128))
192
+ return N.memo = V, N;
193
+ }, a, 0), 128))
172
194
  ]),
173
195
  _: 1
174
- }),
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)
178
- ])) : u("", !0)
196
+ }, 8, ["model-value", "disabled"]),
197
+ l.value.length === 0 ? (o(), n("div", de, [
198
+ g("p", ie, m(D.value), 1),
199
+ g("p", ue, m(U.value), 1)
200
+ ])) : i("", !0)
179
201
  ])
180
202
  ]));
181
203
  }
182
204
  });
183
205
  export {
184
- fe as default
206
+ ye as default
185
207
  };
@@ -211,6 +211,7 @@ const pe = /* @__PURE__ */ I({
211
211
  modelValue: Array.isArray(e.value) ? e.value : [],
212
212
  schema: e.field.props?.schema || [],
213
213
  headers: e.field.props?.headers || [],
214
+ draggable: e.field.props?.draggable || !1,
214
215
  values: e.values,
215
216
  variant: e.variant,
216
217
  size: e.size,
@@ -64,6 +64,7 @@ export type IFormWhen = (context: IFormContext) => boolean;
64
64
  export interface IFormCustomFieldsProps {
65
65
  schema: IForm[];
66
66
  headers?: string[];
67
+ draggable?: boolean;
67
68
  }
68
69
  /**
69
70
  * Main form field interface
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as V, ref as D, computed as f, openBlock as l, createElementBlock as a, normalizeClass as s, createElementVNode as v, createBlock as u, createCommentVNode as T, toDisplayString as w, renderSlot as C, resolveDynamicComponent as B, Fragment as m, createVNode as S } from "vue";
2
2
  import x from "../Icon.vue.js";
3
3
  import b from "../Price/Price.vue.js";
4
- import h from "../Date/Date.vue.js";
4
+ import h from "../DateTime/DateTime.vue.js";
5
5
  import { $t as I } from "../../utils/i18n.js";
6
6
  import { getObjectValue as N, formatNumber as Y, getStatusColorClass as F } from "./utils.js";
7
7
  const A = { class: "flex items-center gap-2 min-w-0" }, E = { class: "text-xs font-normal text-muted-foreground leading-snug truncate" }, O = { class: "min-w-0" }, z = {