vlite3 1.2.9 → 1.2.12

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 (53) hide show
  1. package/components/Button.vue.d.ts +5 -1
  2. package/components/Button.vue.js +164 -72
  3. package/components/CategoryManager/CategoryManager.vue.js +1 -1
  4. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  5. package/components/ColorPicker/ColorPicker.vue.js +2 -2
  6. package/components/Dropdown/Dropdown.vue.d.ts +3 -1
  7. package/components/Dropdown/Dropdown.vue.js +17 -15
  8. package/components/Dropdown/DropdownMenu.vue.d.ts +1 -1
  9. package/components/Form/Form.vue.d.ts +1 -0
  10. package/components/Form/Form.vue.js +1 -1
  11. package/components/Form/Form.vue2.js +29 -28
  12. package/components/Form/FormFields.vue.js +2 -2
  13. package/components/Form/FormFields.vue2.js +29 -25
  14. package/components/ImportData/ImportStep2.vue.js +6 -6
  15. package/components/Input.vue.js +6 -5
  16. package/components/Kanban/Kanban.vue.js +1 -1
  17. package/components/Kanban/Kanban.vue2.js +1 -1
  18. package/components/Kanban/KanbanBoard.vue.js +1 -1
  19. package/components/Kanban/KanbanBoard.vue2.js +17 -17
  20. package/components/Label.vue.d.ts +5 -2
  21. package/components/Label.vue.js +18 -11
  22. package/components/Modal.vue.js +1 -1
  23. package/components/Modal.vue2.js +1 -1
  24. package/components/MultiSelect/MultiSelect.vue.d.ts +1 -1
  25. package/components/PermissionMatrix/PermissionEditorMatrix.vue.js +1 -1
  26. package/components/PermissionMatrix/PermissionMatrix.vue.js +1 -1
  27. package/components/PermissionMatrix/PermissionMatrix.vue2.js +1 -1
  28. package/components/Screen/ScreenFilter.vue.js +34 -31
  29. package/components/SidePanel.vue.js +1 -1
  30. package/components/Splitter/Splitter.vue.d.ts +1 -1
  31. package/components/Tabes/Tabes.vue.js +2 -2
  32. package/components/Tabes/Tabes.vue2.js +53 -51
  33. package/components/Workbook/Sheet.vue.js +76 -70
  34. package/components/Workbook/Workbook.vue.js +2 -2
  35. package/components/Workbook/Workbook.vue2.js +88 -84
  36. package/components/Workbook/WorkbookAddButton.vue.js +9 -8
  37. package/directives/vRipple.d.ts +3 -1
  38. package/directives/vRipple.js +11 -11
  39. package/package.json +13 -1
  40. package/style.css +83 -72
  41. package/test/VliteScreen.d.ts +120 -0
  42. package/test/VliteScreen.js +328 -0
  43. package/test/createDataFactory.d.ts +24 -0
  44. package/test/createDataFactory.js +59 -0
  45. package/test/extractSchemaFields.d.ts +14 -0
  46. package/test/extractSchemaFields.js +11 -0
  47. package/test/index.d.ts +39 -0
  48. package/test/index.js +10 -0
  49. package/test/renderVlite.d.ts +30 -0
  50. package/test/renderVlite.js +12 -0
  51. package/test/types.d.ts +39 -0
  52. package/types/button.d.ts +2 -0
  53. /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
@@ -1,7 +1,7 @@
1
1
  import o from "./Workbook.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-a5e9ca6f"]]);
4
+ const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-e674bcbc"]]);
5
5
  export {
6
- m as default
6
+ p as default
7
7
  };
@@ -1,14 +1,12 @@
1
- import { defineComponent as N, ref as y, shallowRef as P, watch as A, computed as M, openBlock as o, createElementBlock as c, createElementVNode as r, renderSlot as v, createCommentVNode as m, createVNode as g, unref as W, withCtx as Y, Fragment as z, renderList as F, isMemoSame as R, createBlock as j } from "vue";
2
- import { VueDraggable as q } from "vue-draggable-plus";
3
- import G from "./Sheet.vue.js";
1
+ import { defineComponent as P, ref as y, shallowRef as A, watch as M, computed as W, openBlock as o, createElementBlock as c, createElementVNode as r, renderSlot as v, createCommentVNode as h, createVNode as g, unref as I, withCtx as Y, Fragment as j, renderList as F, isMemoSame as R, createBlock as q, normalizeClass as G } from "vue";
2
+ import { useScroll as H } from "@vueuse/core";
3
+ import { VueDraggable as J } from "vue-draggable-plus";
4
+ import K from "./Sheet.vue.js";
4
5
  import p from "./WorkbookAddButton.vue.js";
5
- const H = { class: "flex flex-col w-full font-sans" }, J = { class: "flex items-end w-full border-b px-1" }, K = {
6
+ const O = { class: "flex flex-col w-full font-sans" }, Q = { class: "flex items-end w-full border-b px-1" }, X = {
6
7
  key: 0,
7
8
  class: "flex items-center"
8
- }, O = {
9
- key: 0,
10
- class: "shrink-0 mb-1"
11
- }, Q = { class: "flex items-center mb-0.5 z-20 sticky right-0 ml-auto box-decoration-clone" }, X = { key: 0 }, Z = { key: 1 }, _ = { class: "flex-1 relative bg-white w-full" }, ne = /* @__PURE__ */ N({
9
+ }, Z = { class: "flex items-center mb-0.5 z-20 sticky right-0 ml-auto box-decoration-clone" }, _ = { key: 0 }, ee = { key: 1 }, te = { class: "flex-1 relative bg-white w-full" }, de = /* @__PURE__ */ P({
12
10
  __name: "Workbook",
13
11
  props: {
14
12
  modelValue: { default: "" },
@@ -28,141 +26,147 @@ const H = { class: "flex flex-col w-full font-sans" }, J = { class: "flex items-
28
26
  allowIconChange: { type: Boolean, default: !0 }
29
27
  },
30
28
  emits: ["update:modelValue", "update:sheets", "change", "add", "delete", "duplicate", "edit-start", "edit-end"],
31
- setup(a, { emit: I }) {
32
- const i = a, d = I, h = y(null), u = y(null), s = P([...i.sheets]);
33
- A(
34
- () => i.sheets,
29
+ setup(l, { emit: D }) {
30
+ const i = l, s = D, f = y(null), u = y(null), { arrivedState: V } = H(f), d = A([...i.sheets]);
31
+ M(
32
+ () => [...i.sheets],
35
33
  (e) => {
36
34
  let n = !1;
37
- if (e.length !== s.value.length)
35
+ if (e.length !== d.value.length)
38
36
  n = !0;
39
37
  else
40
38
  for (let t = 0; t < e.length; t++)
41
- if (e[t] !== s.value[t] || e[t].id !== s.value[t].id) {
39
+ if (e[t] !== d.value[t] || e[t].id !== d.value[t].id) {
42
40
  n = !0;
43
41
  break;
44
42
  }
45
- n && (s.value = [...e]);
46
- },
47
- { deep: !0 }
48
- // Must be true so parent mutating the array via .push() correctly triggers the watcher
43
+ n && (d.value = e);
44
+ }
49
45
  );
50
- const D = (e) => {
51
- s.value = e, d("update:sheets", e);
52
- }, V = (e) => {
53
- d("update:modelValue", e), d("change", e);
46
+ const B = (e) => {
47
+ d.value = e, s("update:sheets", e);
48
+ }, S = (e) => {
49
+ s("update:modelValue", e), s("change", e);
54
50
  }, x = () => {
55
- i.sheets.length >= i.maxSheets || d("add");
56
- }, B = (e, n) => {
57
- const t = i.sheets.findIndex((l) => l.id === e);
51
+ i.sheets.length >= i.maxSheets || s("add");
52
+ }, E = (e, n) => {
53
+ const t = i.sheets.findIndex((a) => a.id === e);
58
54
  if (t !== -1) {
59
- const l = [...i.sheets];
60
- l[t] = { ...l[t], title: n }, d("update:sheets", l);
55
+ const a = [...i.sheets];
56
+ a[t] = { ...a[t], title: n }, s("update:sheets", a);
61
57
  }
62
- }, S = (e, n) => {
63
- const t = i.sheets.findIndex((l) => l.id === e);
58
+ }, U = (e, n) => {
59
+ const t = i.sheets.findIndex((a) => a.id === e);
64
60
  if (t !== -1) {
65
- const l = [...i.sheets];
66
- l[t] = { ...l[t], icon: n }, d("update:sheets", l);
61
+ const a = [...i.sheets];
62
+ a[t] = { ...a[t], icon: n }, s("update:sheets", a);
67
63
  }
68
- }, E = (e) => {
69
- u.value = e, d("edit-start", e);
70
- }, U = (e) => {
71
- u.value = null, d("edit-end", e);
72
64
  }, $ = (e) => {
73
- d("duplicate", e);
65
+ u.value = e, s("edit-start", e);
74
66
  }, T = (e) => {
75
- const n = i.sheets.findIndex((l) => l.id === e);
67
+ u.value = null, s("edit-end", e);
68
+ }, z = (e) => {
69
+ s("duplicate", e);
70
+ }, L = (e) => {
71
+ const n = i.sheets.findIndex((a) => a.id === e);
76
72
  if (n === -1) return;
77
73
  const t = [...i.sheets];
78
- if (t.splice(n, 1), d("update:sheets", t), d("delete", e), i.modelValue === e) {
79
- let l = "";
74
+ if (t.splice(n, 1), s("update:sheets", t), s("delete", e), i.modelValue === e) {
75
+ let a = "";
80
76
  if (t.length > 0) {
81
77
  const k = Math.min(n, t.length - 1);
82
- l = t[k].id;
78
+ a = t[k].id;
83
79
  }
84
- d("update:modelValue", l), d("change", l);
80
+ s("update:modelValue", a), s("change", a);
85
81
  }
86
- }, L = (e) => {
87
- h.value && e.deltaY !== 0 && (h.value.scrollLeft += e.deltaY, e.preventDefault());
88
- }, b = M(() => i.sheets.length > 1);
89
- return (e, n) => (o(), c("div", H, [
90
- r("div", J, [
91
- e.$slots["left-addons"] ? (o(), c("div", K, [
82
+ }, N = (e) => {
83
+ f.value && e.deltaY !== 0 && (f.value.scrollLeft += e.deltaY, e.preventDefault());
84
+ }, b = W(() => i.sheets.length > 1);
85
+ return (e, n) => (o(), c("div", O, [
86
+ r("div", Q, [
87
+ e.$slots["left-addons"] ? (o(), c("div", X, [
92
88
  v(e.$slots, "left-addons", {}, void 0, !0)
93
- ])) : m("", !0),
89
+ ])) : h("", !0),
94
90
  r("div", {
95
91
  ref_key: "scrollContainer",
96
- ref: h,
92
+ ref: f,
97
93
  class: "flex-1 flex items-end overflow-x-auto scrollbar-none overscroll-contain sheet-container",
98
94
  style: { "scrollbar-width": "none", "-ms-overflow-style": "none" },
99
- onWheel: L
95
+ onWheel: N
100
96
  }, [
101
- g(W(q), {
102
- "model-value": s.value,
103
- "onUpdate:modelValue": D,
97
+ g(I(J), {
98
+ "model-value": d.value,
99
+ "onUpdate:modelValue": B,
104
100
  disabled: !i.draggable || !!u.value,
105
101
  animation: 150,
106
102
  class: "flex items-end min-w-max"
107
103
  }, {
108
104
  default: Y(() => [
109
- (o(!0), c(z, null, F(s.value, (t, l, k, f) => {
110
- const w = [
105
+ (o(!0), c(j, null, F(d.value, (t, a, k, m) => {
106
+ const C = [
111
107
  t.id,
112
108
  t.title,
113
109
  t.icon,
114
- a.modelValue === t.id,
110
+ l.modelValue === t.id,
115
111
  u.value === t.id,
116
112
  b.value,
117
- a.confirmDelete,
118
- a.allowIconChange
113
+ l.confirmDelete,
114
+ l.allowIconChange,
115
+ l.itemClass,
116
+ l.activeItemClass,
117
+ l.inactiveItemClass
119
118
  ];
120
- if (f && f.key === t.id && R(f, w)) return f;
121
- const C = (o(), j(G, {
119
+ if (m && m.key === t.id && R(m, C)) return m;
120
+ const w = (o(), q(K, {
122
121
  key: t.id,
123
122
  sheet: t,
124
- "is-active": a.modelValue === t.id,
123
+ "is-active": l.modelValue === t.id,
125
124
  "is-editing": u.value === t.id,
126
125
  "can-delete": b.value,
127
- "confirm-delete": a.confirmDelete,
128
- "confirm-delete-texts": a.confirmDeleteTexts,
129
- "allow-icon-change": a.allowIconChange,
130
- "item-class": a.itemClass,
131
- "active-item-class": a.activeItemClass,
132
- "inactive-item-class": a.inactiveItemClass,
133
- onSelect: V,
134
- "onUpdate:title": B,
135
- "onUpdate:icon": S,
136
- onEditStart: E,
137
- onEditEnd: U,
138
- onDuplicate: $,
139
- onDelete: T
126
+ "confirm-delete": l.confirmDelete,
127
+ "confirm-delete-texts": l.confirmDeleteTexts,
128
+ "allow-icon-change": l.allowIconChange,
129
+ "item-class": l.itemClass,
130
+ "active-item-class": l.activeItemClass,
131
+ "inactive-item-class": l.inactiveItemClass,
132
+ onSelect: S,
133
+ "onUpdate:title": E,
134
+ "onUpdate:icon": U,
135
+ onEditStart: $,
136
+ onEditEnd: T,
137
+ onDuplicate: z,
138
+ onDelete: L
140
139
  }, null, 8, ["sheet", "is-active", "is-editing", "can-delete", "confirm-delete", "confirm-delete-texts", "allow-icon-change", "item-class", "active-item-class", "inactive-item-class"]));
141
- return C.memo = w, C;
140
+ return w.memo = C, w;
142
141
  }, n, 0), 128))
143
142
  ]),
144
143
  _: 1
145
144
  }, 8, ["model-value", "disabled"]),
146
- a.addable && a.addButtonPosition === "attached" ? (o(), c("div", O, [
145
+ l.addable && l.addButtonPosition === "attached" ? (o(), c("div", {
146
+ key: 0,
147
+ class: G(["shrink-0 sticky right-0 z-10 bg-body flex items-center justify-center h-full", {
148
+ "shadow-[-18px_0_24px_-4px_#fff] dark:shadow-[-18px_0_24px_-4px_#000]": !I(V).right
149
+ }])
150
+ }, [
147
151
  g(p, { onClick: x })
148
- ])) : m("", !0),
152
+ ], 2)) : h("", !0),
149
153
  n[2] || (n[2] = r("div", { class: "w-1 shrink-0" }, null, -1))
150
154
  ], 544),
151
- r("div", Q, [
152
- a.addable && a.addButtonPosition === "fixed-right" ? (o(), c("div", X, [
155
+ r("div", Z, [
156
+ l.addable && l.addButtonPosition === "fixed-right" ? (o(), c("div", _, [
153
157
  g(p, { onClick: x })
154
- ])) : m("", !0),
155
- e.$slots["right-addons"] ? (o(), c("div", Z, [
158
+ ])) : h("", !0),
159
+ e.$slots["right-addons"] ? (o(), c("div", ee, [
156
160
  v(e.$slots, "right-addons", {}, void 0, !0)
157
- ])) : m("", !0)
161
+ ])) : h("", !0)
158
162
  ])
159
163
  ]),
160
- r("div", _, [
164
+ r("div", te, [
161
165
  v(e.$slots, "default", {}, void 0, !0)
162
166
  ])
163
167
  ]));
164
168
  }
165
169
  });
166
170
  export {
167
- ne as default
171
+ de as default
168
172
  };
@@ -1,24 +1,25 @@
1
- import { defineComponent as c, computed as l, openBlock as m, createBlock as s } from "vue";
2
- import d from "../Button.vue.js";
1
+ import { defineComponent as l, computed as c, openBlock as s, createBlock as d } from "vue";
2
+ import m from "../Button.vue.js";
3
3
  import { $t as u } from "../../utils/i18n.js";
4
- const f = /* @__PURE__ */ c({
4
+ const _ = /* @__PURE__ */ l({
5
5
  __name: "WorkbookAddButton",
6
6
  emits: ["click"],
7
- setup(k, { emit: o }) {
8
- const n = o, i = l(() => {
7
+ setup(a, { emit: o }) {
8
+ const n = o, i = c(() => {
9
9
  const t = u("vlite.workbook.addSheet");
10
10
  return t !== "vlite.workbook.addSheet" ? t : "Add New Sheet";
11
11
  });
12
- return (t, e) => (m(), s(d, {
12
+ return (t, e) => (s(), d(m, {
13
13
  variant: "ghost",
14
- size: "sm",
14
+ size: "md",
15
15
  icon: "lucide:plus",
16
16
  title: i.value,
17
17
  rounded: "none",
18
+ class: "h-full!",
18
19
  onClick: e[0] || (e[0] = (r) => n("click", r))
19
20
  }, null, 8, ["title"]));
20
21
  }
21
22
  });
22
23
  export {
23
- f as default
24
+ _ as default
24
25
  };
@@ -2,7 +2,9 @@ interface RippleElement extends HTMLElement {
2
2
  _rippleHandler?: (ev: MouseEvent) => void;
3
3
  }
4
4
  export declare const vRipple: {
5
- mounted(el: RippleElement): void;
5
+ mounted(el: RippleElement, binding: {
6
+ value?: boolean;
7
+ }): void;
6
8
  unmounted(el: RippleElement): void;
7
9
  };
8
10
  export {};
@@ -1,8 +1,8 @@
1
- const y = (e, t) => {
2
- const i = t.getBoundingClientRect(), p = e.clientX - i.left, d = e.clientY - i.top, s = Math.max(i.width, i.height), c = s / 2;
1
+ const f = (e, t) => {
2
+ const o = t.getBoundingClientRect(), p = e.clientX - o.left, d = e.clientY - o.top, s = Math.max(o.width, o.height), c = s / 2;
3
3
  t.querySelectorAll(".ripple").forEach((r) => r.remove());
4
- const o = document.createElement("span");
5
- o.style.cssText = `
4
+ const n = document.createElement("span");
5
+ n.style.cssText = `
6
6
  width: ${s}px;
7
7
  height: ${s}px;
8
8
  left: ${p - c}px;
@@ -14,22 +14,22 @@ const y = (e, t) => {
14
14
  opacity: 0;
15
15
  will-change: transform, opacity;
16
16
  background-color: rgba(255, 255, 255, 1);
17
- `, o.classList.add("ripple"), t.appendChild(o);
17
+ `, n.classList.add("ripple"), t.appendChild(n);
18
18
  let a = null;
19
19
  const m = 400, l = (r) => {
20
20
  a || (a = r);
21
- const n = Math.min((r - a) / m, 1), u = (1 - Math.pow(1 - n, 3)) * 2.5, h = n < 0.4 ? n * 0.2 : 0.08 * (1 - (n - 0.4) / 0.6);
22
- o.style.transform = `scale(${u})`, o.style.opacity = `${h}`, n < 1 ? requestAnimationFrame(l) : o.remove();
21
+ const i = Math.min((r - a) / m, 1), u = (1 - Math.pow(1 - i, 3)) * 2.5, h = i < 0.4 ? i * 0.2 : 0.08 * (1 - (i - 0.4) / 0.6);
22
+ n.style.transform = `scale(${u})`, n.style.opacity = `${h}`, i < 1 ? requestAnimationFrame(l) : n.remove();
23
23
  };
24
24
  requestAnimationFrame(l);
25
- }, g = {
26
- mounted(e) {
27
- window.getComputedStyle(e).position === "static" && (e.style.position = "relative"), e.style.overflow = "hidden", e._rippleHandler = (t) => y(t, e), e.addEventListener("click", e._rippleHandler);
25
+ }, v = {
26
+ mounted(e, t) {
27
+ t.value !== !1 && (window.getComputedStyle(e).position === "static" && (e.style.position = "relative"), e.style.overflow = "hidden", e._rippleHandler = (o) => f(o, e), e.addEventListener("click", e._rippleHandler));
28
28
  },
29
29
  unmounted(e) {
30
30
  e._rippleHandler && e.removeEventListener("click", e._rippleHandler), e.querySelectorAll(".ripple").forEach((t) => t.remove());
31
31
  }
32
32
  };
33
33
  export {
34
- g as vRipple
34
+ v as vRipple
35
35
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "private": false,
4
4
  "description": "A Vue 3 UI component library built with Tailwind CSS.",
5
5
  "license": "MIT",
6
- "version": "1.2.9",
6
+ "version": "1.2.12",
7
7
  "type": "module",
8
8
  "main": "index.js",
9
9
  "module": "index.js",
@@ -28,6 +28,11 @@
28
28
  "import": "./index.js",
29
29
  "require": "./index.js"
30
30
  },
31
+ "./test": {
32
+ "types": "./test/index.d.ts",
33
+ "import": "./test/index.js",
34
+ "require": "./test/index.js"
35
+ },
31
36
  "./style.css": "./style.css"
32
37
  },
33
38
  "dependencies": {
@@ -57,15 +62,22 @@
57
62
  "xlsx": "^0.18.5"
58
63
  },
59
64
  "peerDependencies": {
65
+ "@vue/test-utils": "^2.4.0",
60
66
  "vue": "^3.5.24",
61
67
  "vue-router": "4"
62
68
  },
69
+ "peerDependenciesMeta": {
70
+ "@vue/test-utils": {
71
+ "optional": true
72
+ }
73
+ },
63
74
  "devDependencies": {
64
75
  "@types/jsbarcode": "^3.11.4",
65
76
  "@types/node": "^25.0.10",
66
77
  "@types/qrcode": "^1.5.6",
67
78
  "@vitejs/plugin-vue": "^6.0.1",
68
79
  "@vitejs/plugin-vue-jsx": "^4.1.1",
80
+ "@vue/test-utils": "^2.4.8",
69
81
  "@vue/tsconfig": "^0.8.1",
70
82
  "typescript": "~5.9.3",
71
83
  "vite": "^7.2.4",