vlite3 1.4.37 → 1.4.39

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 (41) hide show
  1. package/components/Badge.vue.js +5 -5
  2. package/components/Badge.vue3.js +5 -0
  3. package/components/CategoryManager/CategoryManager.vue2.js +4 -3
  4. package/components/Chip/Chip.vue.js +21 -21
  5. package/components/Chip/Chip.vue3.js +5 -0
  6. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  7. package/components/ColorPicker/ColorPicker.vue.js +2 -2
  8. package/components/Comment/CommentItem.vue2.js +3 -2
  9. package/components/DataTable/DataTable.vue.js +186 -189
  10. package/components/DataTable/DataTableRow.vue.js +54 -51
  11. package/components/DataTable/useDataTableTree.d.ts +4 -3
  12. package/components/DataTable/useDataTableTree.js +102 -92
  13. package/components/FileTree/FileTree.vue.d.ts +3 -1
  14. package/components/FileTree/FileTree.vue.js +1 -1
  15. package/components/FileTree/FileTree.vue2.js +157 -116
  16. package/components/FileTree/FileTreeNode.vue.d.ts +9 -5
  17. package/components/FileTree/FileTreeNode.vue.js +147 -189
  18. package/components/Form/Form.vue2.js +45 -43
  19. package/components/ImportData/ImportData.vue.js +4 -2
  20. package/components/Invoice/InvoiceVariant1.vue.js +3 -2
  21. package/components/Invoice/InvoiceVariant2.vue.js +3 -2
  22. package/components/Invoice/InvoiceVariant3.vue.js +3 -2
  23. package/components/Invoice/InvoiceVariant4.vue.js +3 -2
  24. package/components/MultiSelect/MultiSelect.vue.js +3 -2
  25. package/components/PricingPlan/PricingPlanItem.vue.js +10 -9
  26. package/components/Screen/ScreenFilter.vue.js +19 -18
  27. package/components/StatusChip/StatusChip.vue.js +8 -7
  28. package/components/StatusChip/StatusChip.vue3.js +5 -0
  29. package/components/Timeline/TimelineItem.vue.js +3 -2
  30. package/components/TreeConnectors/TreeConnectors.vue.d.ts +1 -1
  31. package/components/TreeConnectors/TreeConnectors.vue.js +26 -17
  32. package/components/TreeConnectors/geometry.d.ts +29 -3
  33. package/components/TreeConnectors/geometry.js +128 -46
  34. package/components/TreeConnectors/index.d.ts +1 -1
  35. package/index.js +473 -470
  36. package/package.json +1 -1
  37. package/style.css +15 -1
  38. package/components/Badge.vue2.js +0 -4
  39. package/components/Chip/Chip.vue2.js +0 -4
  40. package/components/StatusChip/StatusChip.vue2.js +0 -4
  41. /package/components/ColorPicker/{ColorIro.vue2.js → ColorIro.vue.js} +0 -0
@@ -1,8 +1,9 @@
1
- import { defineComponent as u, computed as a, openBlock as c, createBlock as f, unref as p, normalizeClass as m } from "vue";
1
+ import { defineComponent as u, computed as l, openBlock as c, createBlock as f, unref as p, normalizeClass as m } from "vue";
2
2
  import d from "../Chip/Chip.vue.js";
3
+ /* empty css */
3
4
  import { resolveStatus as v } from "./status-map.js";
4
5
  import { $t as b } from "../../utils/i18n.js";
5
- import { useVLiteConfig as I } from "../../core/config.js";
6
+ import { useVLiteConfig as h } from "../../core/config.js";
6
7
  const S = /* @__PURE__ */ u({
7
8
  __name: "StatusChip",
8
9
  props: {
@@ -13,14 +14,14 @@ const S = /* @__PURE__ */ u({
13
14
  size: { default: "small" },
14
15
  class: { default: "" }
15
16
  },
16
- setup(l) {
17
- const e = l, s = I(), n = a(() => s?.components?.statusChip), i = a(() => e.hideIcon !== null ? e.hideIcon : n.value?.hideIcon ?? !1), t = a(() => v(e.status, n.value?.customStatuses)), r = a(() => e.labelI18n ? b(e.labelI18n) : t.value.label ? t.value.label : e.label ? e.label : e.status.replace(/[_\-]+/g, " ").replace(/\b\w/g, (o) => o.toUpperCase()));
18
- return (o, g) => (c(), f(p(d), {
17
+ setup(a) {
18
+ const e = a, s = h(), n = l(() => s?.components?.statusChip), i = l(() => e.hideIcon !== null ? e.hideIcon : n.value?.hideIcon ?? !1), t = l(() => v(e.status, n.value?.customStatuses)), r = l(() => e.labelI18n ? b(e.labelI18n) : t.value.label ? t.value.label : e.label ? e.label : e.status.replace(/[_\-]+/g, " ").replace(/\b\w/g, (o) => o.toUpperCase()));
19
+ return (o, I) => (c(), f(p(d), {
19
20
  text: r.value,
20
21
  variant: t.value.variant,
21
22
  icon: i.value ? void 0 : t.value.icon,
22
- size: l.size,
23
- class: m(e.class)
23
+ size: a.size,
24
+ class: m(["status-chip", "scrollbar-hide", e.class].filter(Boolean).join(" "))
24
25
  }, null, 8, ["text", "variant", "icon", "size", "class"]));
25
26
  }
26
27
  });
@@ -0,0 +1,5 @@
1
+ import o from "./StatusChip.vue.js";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };
@@ -1,6 +1,7 @@
1
1
  import { defineComponent as P, computed as b, openBlock as n, createElementBlock as l, normalizeClass as o, createElementVNode as i, createVNode as y, createCommentVNode as c, renderSlot as a, toDisplayString as d, createBlock as g, resolveDynamicComponent as I, normalizeProps as $, mergeProps as L } from "vue";
2
2
  import h from "./TimelineIndicator.vue.js";
3
3
  import B from "../StatusChip/StatusChip.vue.js";
4
+ /* empty css */
4
5
  import { $t as r } from "../../utils/i18n.js";
5
6
  const C = { class: "flex flex-col items-center shrink-0 mr-4 w-9" }, T = { class: "flex flex-col gap-1" }, V = { class: "flex justify-between items-start gap-4" }, D = { class: "text-sm font-semibold text-foreground leading-none" }, N = {
6
7
  key: 0,
@@ -18,7 +19,7 @@ const C = { class: "flex flex-col items-center shrink-0 mr-4 w-9" }, T = { class
18
19
  key: 0,
19
20
  class: "hidden sm:block flex-1 h-0.5 bg-border ml-2",
20
21
  "aria-hidden": "true"
21
- }, M = /* @__PURE__ */ P({
22
+ }, O = /* @__PURE__ */ P({
22
23
  __name: "TimelineItem",
23
24
  props: {
24
25
  step: {},
@@ -152,5 +153,5 @@ const C = { class: "flex flex-col items-center shrink-0 mr-4 w-9" }, T = { class
152
153
  }
153
154
  });
154
155
  export {
155
- M as default
156
+ O as default
156
157
  };
@@ -19,8 +19,8 @@ interface Props extends TreeConnectorInput {
19
19
  bleedY?: boolean;
20
20
  }
21
21
  declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
22
- ancestorLastFlags: boolean[];
23
22
  hasToggle: boolean;
23
+ ancestorLastFlags: boolean[];
24
24
  lineClass: string;
25
25
  bleedY: boolean;
26
26
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLSpanElement>;
@@ -1,22 +1,24 @@
1
- import { defineComponent as r, computed as i, openBlock as s, createElementBlock as a, normalizeClass as o, Fragment as d, renderList as c, normalizeStyle as g } from "vue";
2
- import { buildTreeConnectorSegments as p } from "./geometry.js";
3
- const h = /* @__PURE__ */ r({
1
+ import { defineComponent as m, computed as u, openBlock as s, createElementBlock as l, normalizeClass as i, Fragment as c, renderList as f, isMemoSame as g, normalizeStyle as S } from "vue";
2
+ import { EMPTY_ANCESTOR_LAST_FLAGS as b, buildTreeConnectorSegments as y } from "./geometry.js";
3
+ const x = /* @__PURE__ */ m({
4
4
  __name: "TreeConnectors",
5
5
  props: {
6
6
  lineClass: { default: "bg-muted-foreground/35 dark:bg-muted-foreground/25!" },
7
7
  bleedY: { type: Boolean, default: !1 },
8
8
  depth: {},
9
9
  isLastSibling: { type: Boolean },
10
- ancestorLastFlags: { default: () => [] },
10
+ ancestorLastFlags: { default: () => b },
11
11
  hasToggle: { type: Boolean, default: !1 },
12
12
  indent: {},
13
13
  toggleSize: {},
14
14
  baseInset: {},
15
- contentGap: {}
15
+ contentGap: {},
16
+ leafHasSpacer: { type: Boolean },
17
+ leafInset: {}
16
18
  },
17
- setup(t) {
18
- const e = t, l = i(
19
- () => p({
19
+ setup(n) {
20
+ const e = n, p = u(
21
+ () => y({
20
22
  depth: e.depth,
21
23
  isLastSibling: e.isLastSibling,
22
24
  ancestorLastFlags: e.ancestorLastFlags,
@@ -24,21 +26,28 @@ const h = /* @__PURE__ */ r({
24
26
  indent: e.indent,
25
27
  toggleSize: e.toggleSize,
26
28
  baseInset: e.baseInset,
27
- contentGap: e.contentGap
29
+ contentGap: e.contentGap,
30
+ leafHasSpacer: e.leafHasSpacer,
31
+ leafInset: e.leafInset
28
32
  })
29
33
  );
30
- return (u, m) => (s(), a("span", {
31
- class: o(["tree-connectors pointer-events-none absolute inset-x-0", t.bleedY ? "-inset-y-px z-[1]" : "inset-y-0 overflow-hidden"]),
34
+ return (L, d) => (s(), l("span", {
35
+ class: i(["tree-connectors pointer-events-none absolute inset-x-0", n.bleedY ? "-inset-y-px z-[1]" : "inset-y-0 overflow-hidden"]),
32
36
  "aria-hidden": "true"
33
37
  }, [
34
- (s(!0), a(d, null, c(l.value, (n) => (s(), a("span", {
35
- key: n.key,
36
- class: o(["absolute", [n.orientation === "vertical" ? "w-px" : "h-px", t.lineClass]]),
37
- style: g(n.style)
38
- }, null, 6))), 128))
38
+ (s(!0), l(c, null, f(p.value, (t, C, T, a) => {
39
+ const o = [t, n.lineClass];
40
+ if (a && a.key === t.key && g(a, o)) return a;
41
+ const r = (s(), l("span", {
42
+ key: t.key,
43
+ class: i(["absolute", [t.orientation === "vertical" ? "w-px" : "h-px", n.lineClass]]),
44
+ style: S(t.style)
45
+ }, null, 6));
46
+ return r.memo = o, r;
47
+ }, d, 0), 128))
39
48
  ], 2));
40
49
  }
41
50
  });
42
51
  export {
43
- h as default
52
+ x as default
44
53
  };
@@ -2,11 +2,16 @@ import { CSSProperties } from 'vue';
2
2
  /** Horizontal indent (px) added per depth level. Mirrors DataTable's `treeIndent`. */
3
3
  export declare const DEFAULT_TREE_INDENT = 20;
4
4
  /** Width (px) of the expand/collapse toggle. Rails are centred on it. */
5
- export declare const DEFAULT_TOGGLE_SIZE = 24;
5
+ export declare const DEFAULT_TOGGLE_SIZE = 20;
6
6
  /** Default leading space (px) before the depth-0 toggle (keeps it off the edge). */
7
- export declare const DEFAULT_TREE_LEADING = 5;
7
+ export declare const DEFAULT_TREE_LEADING = 10;
8
8
  /** Default gap (px) between the toggle and the row content (icon/label). */
9
- export declare const DEFAULT_TREE_CONTENT_GAP = 5;
9
+ export declare const DEFAULT_TREE_CONTENT_GAP = 10;
10
+ /**
11
+ * Default extra left inset (px) for leaf rows that don't reserve a toggle slot,
12
+ * so their icon isn't flush against the table's left edge.
13
+ */
14
+ export declare const DEFAULT_TREE_LEAF_INSET = 5;
10
15
  export type TreeConnectorOrientation = 'vertical' | 'horizontal';
11
16
  export type TreeConnectorRole = 'trunk' | 'elbow' | 'branch';
12
17
  /** Inline styles for a connector segment (Vue `:style` / CSSProperties-compatible). */
@@ -48,11 +53,29 @@ export interface TreeConnectorInput {
48
53
  * as the content is pushed right.
49
54
  */
50
55
  contentGap?: number;
56
+ /**
57
+ * Whether leaf rows keep an empty toggle-sized spacer before their content.
58
+ * `true` (default): the branch reaches into that spacer toward the icon.
59
+ * `false`: the leaf icon is left-aligned into the toggle slot, so the branch
60
+ * stops just before it — exactly like an expandable row's chevron.
61
+ */
62
+ leafHasSpacer?: boolean;
63
+ /**
64
+ * Extra left inset (px) applied to a leaf row's icon when it doesn't reserve a
65
+ * toggle slot (`leafHasSpacer: false`). The branch extends to match, so leaf
66
+ * icons keep breathing room from the table edge without losing their connector.
67
+ */
68
+ leafInset?: number;
51
69
  }
52
70
  /** Horizontal centre (px) of the vertical rail for a given tree depth. */
53
71
  export declare function railX(level: number, indent: number, toggleSize: number): number;
54
72
  /** @deprecated Renamed to {@link railX}. Kept as an alias for compatibility. */
55
73
  export declare const guideX: typeof railX;
74
+ /** Shared empty flags array — stable reference for root rows / v-memo. */
75
+ export declare const EMPTY_ANCESTOR_LAST_FLAGS: readonly boolean[];
76
+ export declare function stabilizeAncestorLastFlags(flags: readonly boolean[]): boolean[];
77
+ /** Append one flag onto a (preferably already-stable) ancestor list, with caching. */
78
+ export declare function appendAncestorLastFlag(flags: readonly boolean[], isLastSibling: boolean): boolean[];
56
79
  /**
57
80
  * Compute every connector segment for a single tree row.
58
81
  *
@@ -60,5 +83,8 @@ export declare const guideX: typeof railX;
60
83
  * node on the row's own path at depth `k + 1` still has a following sibling —
61
84
  * i.e. `ancestorLastFlags[k + 1] === false`. That single rule keeps vertical
62
85
  * lines running through descendants and stops them exactly at the final child.
86
+ *
87
+ * Results are cached by geometry inputs so identical tree shapes reuse the same
88
+ * `markRaw` segment objects (helps v-memo / avoids proxy churn).
63
89
  */
64
90
  export declare function buildTreeConnectorSegments(input: TreeConnectorInput): TreeConnectorSegment[];
@@ -1,55 +1,137 @@
1
- const A = 20, F = 24, h = 5, p = 5;
2
- function N(o, e, s) {
3
- return o * e + s / 2;
1
+ import { markRaw as c } from "vue";
2
+ const I = 20, C = 20, w = 10, H = 10, O = 5, i = 0.5, N = 2, y = 5, G = 512;
3
+ function R(n, e, o) {
4
+ return n * e + o / 2;
4
5
  }
5
- const E = (o) => `${o}px`;
6
- function R(o) {
6
+ const f = (n) => `${n}px`, k = Object.freeze([]), S = /* @__PURE__ */ new Map();
7
+ function x(n) {
8
+ if (!n.length) return k;
9
+ let e = "";
10
+ for (let a = 0; a < n.length; a++)
11
+ e += n[a] ? "1" : "0";
12
+ const o = S.get(e);
13
+ if (o) return o;
14
+ const s = c(n.slice());
15
+ return S.set(e, s), s;
16
+ }
17
+ function v(n, e) {
18
+ return x([...n, e]);
19
+ }
20
+ const E = /* @__PURE__ */ new Map();
21
+ function D(n) {
22
+ const {
23
+ depth: e,
24
+ isLastSibling: o,
25
+ hasToggle: s,
26
+ indent: a,
27
+ toggleSize: r,
28
+ baseInset: h,
29
+ contentGap: l,
30
+ leafHasSpacer: g,
31
+ leafInset: p,
32
+ flagsKey: u
33
+ } = n;
34
+ return [
35
+ e,
36
+ o ? 1 : 0,
37
+ s ? 1 : 0,
38
+ a,
39
+ r,
40
+ h,
41
+ l,
42
+ g ? 1 : 0,
43
+ p,
44
+ u
45
+ ].join("|");
46
+ }
47
+ function M(n, e) {
48
+ if (E.size >= G) {
49
+ const s = E.keys().next().value;
50
+ s !== void 0 && E.delete(s);
51
+ }
52
+ const o = c(e);
53
+ return E.set(n, o), o;
54
+ }
55
+ function U(n) {
7
56
  const {
8
57
  depth: e,
9
- isLastSibling: s,
10
- ancestorLastFlags: T,
11
- hasToggle: c = !1,
12
- indent: a = 20,
13
- toggleSize: _ = 24,
14
- baseInset: i = 0,
15
- contentGap: I = 0
16
- } = o, n = [];
17
- if (!Number.isFinite(e) || e < 0) return n;
18
- const l = (t) => i + N(t, a, _);
58
+ isLastSibling: o,
59
+ ancestorLastFlags: s,
60
+ hasToggle: a = !1,
61
+ indent: r = I,
62
+ toggleSize: h = C,
63
+ baseInset: l = 0,
64
+ contentGap: g = 0,
65
+ leafHasSpacer: p = !0,
66
+ leafInset: u = 0
67
+ } = n;
68
+ if (!Number.isFinite(e) || e < 0) return [];
69
+ let b = "";
70
+ for (let t = 0; t < s.length; t++)
71
+ b += s[t] ? "1" : "0";
72
+ const d = D({
73
+ depth: e,
74
+ isLastSibling: o,
75
+ hasToggle: a,
76
+ indent: r,
77
+ toggleSize: h,
78
+ baseInset: l,
79
+ contentGap: g,
80
+ leafHasSpacer: p,
81
+ leafInset: u,
82
+ flagsKey: b
83
+ }), m = E.get(d);
84
+ if (m) return m;
85
+ const T = [], _ = (t) => l + R(t, r, h);
19
86
  for (let t = 0; t <= e - 2; t++)
20
- T[t + 1] === !1 && n.push({
21
- key: `trunk-${t}`,
22
- orientation: "vertical",
23
- role: "trunk",
24
- style: { left: E(l(t) - 0.5), top: "0", bottom: "0" }
25
- });
87
+ s[t + 1] === !1 && T.push(
88
+ c({
89
+ key: `trunk-${t}`,
90
+ orientation: "vertical",
91
+ role: "trunk",
92
+ style: c({ left: f(_(t) - i), top: "0", bottom: "0" })
93
+ })
94
+ );
26
95
  if (e >= 1) {
27
- const t = l(e - 1);
28
- n.push({
29
- key: `elbow-${e}`,
30
- orientation: "vertical",
31
- role: "elbow",
32
- style: s ? { left: E(t - 0.5), top: "0", height: "50%" } : { left: E(t - 0.5), top: "0", bottom: "0" }
33
- });
34
- const r = i + e * a, L = c ? Math.max(t + 5, r - 2) : l(e) + I;
35
- n.push({
36
- key: `branch-${e}`,
37
- orientation: "horizontal",
38
- role: "branch",
39
- style: {
40
- left: E(t - 0.5),
41
- top: `calc(50% - ${0.5}px)`,
42
- width: E(Math.max(0, L - t))
43
- }
44
- });
96
+ const t = _(e - 1);
97
+ T.push(
98
+ c({
99
+ key: `elbow-${e}`,
100
+ orientation: "vertical",
101
+ role: "elbow",
102
+ style: c(
103
+ o ? { left: f(t - i), top: "0", height: "50%" } : { left: f(t - i), top: "0", bottom: "0" }
104
+ )
105
+ })
106
+ );
107
+ const A = l + e * r;
108
+ let L;
109
+ a ? L = A - N : p ? L = _(e) + g : L = A + u - N;
110
+ const F = Math.max(t + y, L);
111
+ T.push(
112
+ c({
113
+ key: `branch-${e}`,
114
+ orientation: "horizontal",
115
+ role: "branch",
116
+ style: c({
117
+ left: f(t - i),
118
+ top: `calc(50% - ${i}px)`,
119
+ width: f(Math.max(0, F - t))
120
+ })
121
+ })
122
+ );
45
123
  }
46
- return n;
124
+ return M(d, T);
47
125
  }
48
126
  export {
49
- F as DEFAULT_TOGGLE_SIZE,
50
- p as DEFAULT_TREE_CONTENT_GAP,
51
- A as DEFAULT_TREE_INDENT,
52
- h as DEFAULT_TREE_LEADING,
53
- R as buildTreeConnectorSegments,
54
- N as railX
127
+ C as DEFAULT_TOGGLE_SIZE,
128
+ H as DEFAULT_TREE_CONTENT_GAP,
129
+ I as DEFAULT_TREE_INDENT,
130
+ w as DEFAULT_TREE_LEADING,
131
+ O as DEFAULT_TREE_LEAF_INSET,
132
+ k as EMPTY_ANCESTOR_LAST_FLAGS,
133
+ v as appendAncestorLastFlag,
134
+ U as buildTreeConnectorSegments,
135
+ R as railX,
136
+ x as stabilizeAncestorLastFlags
55
137
  };
@@ -1,3 +1,3 @@
1
1
  export { default as TreeConnectors } from './TreeConnectors.vue';
2
- export { buildTreeConnectorSegments, railX, guideX, DEFAULT_TREE_INDENT, DEFAULT_TOGGLE_SIZE, DEFAULT_TREE_LEADING, DEFAULT_TREE_CONTENT_GAP, } from './geometry';
2
+ export { buildTreeConnectorSegments, railX, guideX, stabilizeAncestorLastFlags, appendAncestorLastFlag, EMPTY_ANCESTOR_LAST_FLAGS, DEFAULT_TREE_INDENT, DEFAULT_TOGGLE_SIZE, DEFAULT_TREE_LEADING, DEFAULT_TREE_CONTENT_GAP, DEFAULT_TREE_LEAF_INSET, } from './geometry';
3
3
  export type { TreeConnectorInput, TreeConnectorSegment, TreeConnectorStyle, TreeConnectorOrientation, TreeConnectorRole, } from './geometry';