vlite3 1.2.16 → 1.3.1

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 (40) hide show
  1. package/components/Button.vue.d.ts +2 -0
  2. package/components/Button.vue.js +66 -55
  3. package/components/Carousel/Carousel.vue.d.ts +210 -240
  4. package/components/Carousel/Carousel.vue.js +2 -2
  5. package/components/Carousel/Carousel.vue2.js +31 -21
  6. package/components/Carousel/types.d.ts +76 -14
  7. package/components/CategoryManager/CategoryManager.vue.d.ts +9 -1
  8. package/components/CategoryManager/CategoryManager.vue.js +5 -461
  9. package/components/CategoryManager/CategoryManager.vue2.js +515 -2
  10. package/components/CategoryManager/CategoryNode.vue.js +65 -64
  11. package/components/CategoryManager/types.d.ts +16 -0
  12. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  13. package/components/ColorPicker/ColorPicker.vue.js +2 -2
  14. package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
  15. package/components/CommandPalette/{CommandPaletteItem.vue.js → CommandPaletteItem.vue2.js} +1 -1
  16. package/components/FadeOverlay/FadeOverlay.vue.d.ts +13 -0
  17. package/components/FadeOverlay/FadeOverlay.vue.js +59 -0
  18. package/components/FadeOverlay/FadeOverlay.vue2.js +4 -0
  19. package/components/FadeOverlay/index.d.ts +2 -0
  20. package/components/FadeOverlay/types.d.ts +72 -0
  21. package/components/FadeOverlay/utils.d.ts +6 -0
  22. package/components/FadeOverlay/utils.js +31 -0
  23. package/components/NavbarCommandPalette.vue.js +1 -1
  24. package/components/NumberInput.vue.d.ts +4 -4
  25. package/components/NumberInput.vue.js +2 -2
  26. package/components/NumberInput.vue2.js +56 -56
  27. package/components/Screen/Screen.vue.js +51 -51
  28. package/components/Screen/ScreenFilter.vue.js +2 -2
  29. package/components/Screen/components/ScreenQuickFilters.vue.js +3 -3
  30. package/components/Switch.vue.js +9 -3
  31. package/components/Tabes/Tabes.vue.d.ts +2 -1
  32. package/components/Tabes/Tabes.vue.js +2 -2
  33. package/components/Tabes/Tabes.vue2.js +200 -78
  34. package/components/Workbook/WorkbookAddButton.vue.js +4 -4
  35. package/components/index.d.ts +1 -0
  36. package/index.d.ts +1 -0
  37. package/index.js +76 -74
  38. package/package.json +2 -2
  39. package/style.css +33 -32
  40. /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
@@ -1,8 +1,9 @@
1
- import { defineComponent as T, ref as u, watch as l, onMounted as D, computed as p, openBlock as i, createElementBlock as v, normalizeClass as d, normalizeStyle as N, createCommentVNode as x, Fragment as O, renderList as P, createBlock as h, resolveDynamicComponent as F, mergeProps as _, withCtx as q, createElementVNode as G, toDisplayString as H, nextTick as J } from "vue";
2
- import { useResizeObserver as K } from "@vueuse/core";
3
- import Q from "../Icon.vue.js";
4
- import { $t as U } from "../../utils/i18n.js";
5
- const ee = /* @__PURE__ */ T({
1
+ import { defineComponent as Z, ref as d, watch as m, onMounted as _, computed as v, openBlock as g, createElementBlock as z, normalizeClass as l, withDirectives as x, createVNode as h, vShow as y, createElementVNode as f, normalizeStyle as ee, createCommentVNode as j, Fragment as te, renderList as re, createBlock as M, resolveDynamicComponent as ne, mergeProps as ae, withCtx as se, toDisplayString as oe, nextTick as le } from "vue";
2
+ import { useResizeObserver as T } from "@vueuse/core";
3
+ import R from "../Icon.vue.js";
4
+ import A from "../FadeOverlay/FadeOverlay.vue.js";
5
+ import { $t as ie } from "../../utils/i18n.js";
6
+ const me = /* @__PURE__ */ Z({
6
7
  __name: "Tabes",
7
8
  props: {
8
9
  options: {},
@@ -15,36 +16,92 @@ const ee = /* @__PURE__ */ T({
15
16
  tabClass: {}
16
17
  },
17
18
  emits: ["update:modelValue", "change"],
18
- setup(s, { emit: C }) {
19
- const r = s, y = C, f = u(null), b = u(/* @__PURE__ */ new Map()), k = (e, n) => {
20
- e ? b.value.set(n, e) : b.value.delete(n);
21
- }, m = u({
19
+ setup(c, { emit: E }) {
20
+ const t = c, $ = E, b = d(null), i = d(null), p = d(/* @__PURE__ */ new Map()), w = d(!1), C = d(!1), s = () => {
21
+ if (!i.value) return;
22
+ const { scrollLeft: e, scrollWidth: n, clientWidth: r } = i.value;
23
+ w.value = e > 1, C.value = Math.ceil(e + r) < n - 1;
24
+ }, S = (e) => {
25
+ i.value && i.value.scrollBy({ left: e, behavior: "smooth" });
26
+ }, V = () => {
27
+ if (!i.value || !b.value) return;
28
+ const e = p.value.get(t.modelValue);
29
+ if (!e) return;
30
+ const n = i.value, r = e.getBoundingClientRect(), a = n.getBoundingClientRect(), o = 40;
31
+ r.left < a.left + o ? n.scrollBy({
32
+ left: r.left - a.left - o,
33
+ behavior: "smooth"
34
+ }) : r.right > a.right - o && n.scrollBy({
35
+ left: r.right - a.right + o,
36
+ behavior: "smooth"
37
+ });
38
+ };
39
+ T(i, s);
40
+ const O = (e, n) => {
41
+ e ? p.value.set(n, e) : p.value.delete(n);
42
+ }, k = d({
22
43
  width: "0px",
23
44
  height: "0px",
24
45
  transform: "translate(0px, 0px)",
25
46
  opacity: 0
26
- }), g = u(!1), o = async () => {
27
- await J();
28
- const e = f.value, n = b.value.get(r.modelValue);
47
+ }), B = d(!1), u = async () => {
48
+ await le();
49
+ const e = b.value, n = p.value.get(t.modelValue);
29
50
  if (!e || !n) {
30
- m.value.opacity = 0;
51
+ k.value.opacity = 0;
31
52
  return;
32
53
  }
33
- const t = e.getBoundingClientRect(), a = n.getBoundingClientRect(), c = a.left - t.left, j = a.top - t.top, A = a.width, E = a.height;
34
- m.value = {
35
- width: `${A}px`,
36
- height: `${E}px`,
37
- transform: `translate(${c}px, ${j}px)`,
54
+ const r = e.getBoundingClientRect(), a = n.getBoundingClientRect(), o = a.left - r.left, U = a.top - r.top, X = a.width, Y = a.height;
55
+ k.value = {
56
+ width: `${X}px`,
57
+ height: `${Y}px`,
58
+ transform: `translate(${o}px, ${U}px)`,
38
59
  opacity: 1
39
- }, g.value || setTimeout(() => {
40
- g.value = !0;
60
+ }, B.value || setTimeout(() => {
61
+ B.value = !0;
41
62
  }, 50);
42
63
  };
43
- K(f, o), l(() => r.modelValue, o), l(() => r.options, o, { deep: !0 }), l(() => r.size, o), l(() => r.block, o), l(() => r.wrap, o), D(o);
44
- const w = (e) => {
45
- e.disabled || (y("update:modelValue", e.value), y("change", e.value));
46
- }, z = p(() => {
47
- const e = r.variant === "line", n = {
64
+ T(b, () => {
65
+ u(), s();
66
+ }), m(
67
+ () => t.modelValue,
68
+ async () => {
69
+ await u(), V();
70
+ }
71
+ ), m(
72
+ () => t.options,
73
+ async () => {
74
+ await u(), s();
75
+ },
76
+ { deep: !0 }
77
+ ), m(
78
+ () => t.size,
79
+ async () => {
80
+ await u(), s();
81
+ }
82
+ ), m(
83
+ () => t.block,
84
+ async () => {
85
+ await u(), s();
86
+ }
87
+ ), m(
88
+ () => t.wrap,
89
+ async () => {
90
+ await u(), s();
91
+ }
92
+ ), _(async () => {
93
+ await u(), s(), setTimeout(s, 100), setTimeout(V, 100);
94
+ });
95
+ const D = v(() => {
96
+ const e = t.variant === "line";
97
+ return t.block || e ? "flex w-full relative" : "inline-flex max-w-full relative";
98
+ }), L = v(() => [
99
+ "absolute top-0 bottom-0 z-20 flex items-center pointer-events-none transition-opacity duration-200",
100
+ t.variant === "line" ? "pb-[10px]" : ""
101
+ ]), N = (e) => {
102
+ e.disabled || ($("update:modelValue", e.value), $("change", e.value));
103
+ }, P = v(() => {
104
+ const e = t.variant === "line", n = {
48
105
  surface: "bg-secondary/80 p-1",
49
106
  primary: "bg-secondary p-1",
50
107
  secondary: "bg-secondary p-1",
@@ -52,23 +109,23 @@ const ee = /* @__PURE__ */ T({
52
109
  success: "bg-success/10 p-1",
53
110
  outline: "bg-transparent border border-border p-1",
54
111
  line: "bg-transparent gap-6 rounded-none p-0 border-b border-border"
55
- }, t = r.wrap && !e ? "flex-wrap" : "";
56
- return [`${r.block || e ? "flex w-full" : "inline-flex"} rounded-lg relative isolate ${t}`, n[r.variant]];
57
- }), $ = {
112
+ }, r = t.wrap && !e ? "flex-wrap" : "";
113
+ return [`${t.block || e ? "flex min-w-full w-max" : "inline-flex"} rounded-lg relative isolate ${r}`, n[t.variant]];
114
+ }), I = v(() => t.variant === "surface" || t.variant === "primary" || t.variant === "secondary" ? "var(--color-secondary)" : t.variant === "danger" ? "color-mix(in srgb, var(--color-danger) 10%, transparent)" : t.variant === "success" ? "color-mix(in srgb, var(--color-success) 10%, transparent)" : "var(--color-background)"), W = {
58
115
  sm: "text-xs px-2.5 py-1",
59
116
  md: "-text-fs-2 px-3 py-1",
60
117
  lg: "-text-fs-1 px-4 py-1"
61
- }, V = p(() => {
62
- const e = r.variant === "line", n = e ? "relative z-10 flex items-center justify-center gap-2 font-medium transition-colors duration-50 ease-out cursor-pointer select-none outline-none focus-visible:ring-2 focus-visible:ring-primary/50 pb-2 border-b-2 border-transparent hover:text-foreground" : "relative z-10 flex items-center justify-center gap-2 font-medium transition-colors duration-50 ease-out cursor-pointer select-none rounded-md outline-none focus-visible:ring-2 focus-visible:ring-primary/50", t = (r.block || r.wrap) && !e ? "flex-1" : "";
63
- return [n, t];
64
- }), R = (e) => {
65
- const n = e.value === r.modelValue, t = r.variant === "line";
118
+ }, F = v(() => {
119
+ const e = t.variant === "line", n = e ? "relative z-10 flex items-center justify-center gap-2 font-medium transition-colors duration-50 ease-out cursor-pointer select-none outline-none focus-visible:ring-2 focus-visible:ring-primary/50 pb-3 border-b-2 border-transparent hover:text-foreground shrink-0" : "relative z-10 flex items-center justify-center gap-2 font-medium transition-colors duration-50 ease-out cursor-pointer select-none rounded-md outline-none focus-visible:ring-2 focus-visible:ring-primary/50 shrink-0", r = (t.block || t.wrap) && !e ? "flex-1" : "";
120
+ return [n, r];
121
+ }), q = (e) => {
122
+ const n = e.value === t.modelValue, r = t.variant === "line";
66
123
  let a = "";
67
124
  if (n)
68
- if (t)
125
+ if (r)
69
126
  a = "text-primary";
70
127
  else
71
- switch (r.variant) {
128
+ switch (t.variant) {
72
129
  case "surface":
73
130
  a = "text-foreground";
74
131
  break;
@@ -91,59 +148,124 @@ const ee = /* @__PURE__ */ T({
91
148
  a = "text-foreground";
92
149
  }
93
150
  else
94
- a = t ? "text-muted-foreground" : "text-muted-foreground hover:text-foreground/80";
95
- const c = e.disabled ? "opacity-50 cursor-not-allowed" : "";
96
- return [V.value, a, r?.tabClass, c].join(" ");
97
- }, B = p(() => {
98
- const n = `absolute left-0 top-0 z-0 pointer-events-none ${g.value ? "transition-all duration-300 ease-[cubic-bezier(0.25,0.1,0.25,1)]" : ""}`;
99
- return r.variant === "line" ? `${n} !h-[2px] !top-auto bottom-0` : `${n} rounded-md shadow-sm`;
100
- }), S = () => ({
101
- surface: "bg-background",
151
+ a = r ? "text-muted-foreground" : "text-muted-foreground hover:text-foreground/80";
152
+ const o = e.disabled ? "opacity-50 cursor-not-allowed" : "";
153
+ return [F.value, a, t?.tabClass, o].join(" ");
154
+ }, G = v(() => {
155
+ const n = `absolute left-0 top-0 z-0 pointer-events-none ${B.value ? "transition-all duration-300 ease-[cubic-bezier(0.25,0.1,0.25,1)]" : ""}`;
156
+ return t.variant === "line" ? `${n} !h-[2px] !top-auto bottom-0` : `${n} rounded-md shadow-sm`;
157
+ }), H = () => ({
158
+ surface: "bg-[#ffff] dark:bg-[#0B0B0B]",
102
159
  primary: "bg-primary",
103
160
  secondary: "bg-secondary-foreground",
104
161
  danger: "bg-danger",
105
162
  success: "bg-success",
106
163
  outline: "bg-accent/50 ring-1 ring-border",
107
164
  line: "bg-primary"
108
- })[r.variant], I = (e) => e.labelI18n ? U(e.labelI18n) : e.label, L = (e) => e.to ? "router-link" : e.href ? "a" : "button", M = (e) => e.to ? { to: e.to } : e.href ? { href: e.href, target: "_blank", rel: "noopener noreferrer" } : { type: "button" };
109
- return (e, n) => (i(), v("div", {
110
- ref_key: "containerRef",
111
- ref: f,
112
- class: d(z.value),
113
- role: "tablist",
114
- "data-tabes": ""
165
+ })[t.variant], J = (e) => e.labelI18n ? ie(e.labelI18n) : e.label, K = (e) => e.to ? "router-link" : e.href ? "a" : "button", Q = (e) => e.to ? { to: e.to } : e.href ? { href: e.href, target: "_blank", rel: "noopener noreferrer" } : { type: "button" };
166
+ return (e, n) => (g(), z("div", {
167
+ class: l([D.value, "group"])
115
168
  }, [
116
- s.modelValue !== void 0 && !s.wrap ? (i(), v("div", {
117
- key: 0,
118
- class: d([B.value, S()]),
119
- style: N(m.value)
120
- }, null, 6)) : x("", !0),
121
- (i(!0), v(O, null, P(s.options, (t) => (i(), h(F(L(t)), _({
122
- key: t.value,
123
- ref_for: !0,
124
- ref: (a) => k(a?.$el || a, t.value),
125
- role: "tab",
126
- "aria-selected": s.modelValue === t.value,
127
- disabled: t.disabled,
128
- class: [R(t), $[r.size]]
129
- }, { ref_for: !0 }, M(t), {
130
- onClick: (a) => w(t)
131
- }), {
132
- default: q(() => [
133
- t.icon ? (i(), h(Q, {
169
+ x(h(A, {
170
+ direction: "left",
171
+ color: I.value,
172
+ coverage: "100px",
173
+ blur: "40px",
174
+ easing: "smooth",
175
+ tintOpacity: 1,
176
+ class: l(["z-10 pointer-events-none", t.variant === "line" ? "" : "rounded-l-lg"])
177
+ }, null, 8, ["color", "class"]), [
178
+ [y, w.value]
179
+ ]),
180
+ x(f("div", {
181
+ class: l(["left-0 pl-1", L.value])
182
+ }, [
183
+ f("button", {
184
+ onClick: n[0] || (n[0] = (r) => S(-200)),
185
+ class: "pointer-events-auto h-full px-1 flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors focus:outline-none",
186
+ "aria-label": "Scroll left"
187
+ }, [
188
+ h(R, {
189
+ icon: "lucide:chevron-left",
190
+ class: "w-5 h-5"
191
+ })
192
+ ])
193
+ ], 2), [
194
+ [y, w.value]
195
+ ]),
196
+ f("div", {
197
+ ref_key: "scrollRef",
198
+ ref: i,
199
+ class: "flex-1 min-w-0 max-w-full overflow-x-auto scrollbar-hide scroll-smooth",
200
+ onScroll: s
201
+ }, [
202
+ f("div", {
203
+ ref_key: "containerRef",
204
+ ref: b,
205
+ class: l([P.value, "tabes-container"]),
206
+ role: "tablist",
207
+ "data-tabes": ""
208
+ }, [
209
+ c.modelValue !== void 0 && !c.wrap ? (g(), z("div", {
134
210
  key: 0,
135
- icon: t.icon,
136
- class: d(s.size === "sm" ? "w-3.5 h-3.5" : "w-4 h-4")
137
- }, null, 8, ["icon", "class"])) : x("", !0),
138
- G("span", {
139
- class: d(["whitespace-nowrap z-20 relative", s.textClass])
140
- }, H(I(t)), 3)
141
- ]),
142
- _: 2
143
- }, 1040, ["aria-selected", "disabled", "class", "onClick"]))), 128))
211
+ class: l([G.value, H()]),
212
+ style: ee(k.value)
213
+ }, null, 6)) : j("", !0),
214
+ (g(!0), z(te, null, re(c.options, (r) => (g(), M(ne(K(r)), ae({
215
+ key: r.value,
216
+ ref_for: !0,
217
+ ref: (a) => O(a?.$el || a, r.value),
218
+ role: "tab",
219
+ "aria-selected": c.modelValue === r.value,
220
+ disabled: r.disabled,
221
+ class: [q(r), W[t.size]]
222
+ }, { ref_for: !0 }, Q(r), {
223
+ onClick: (a) => N(r)
224
+ }), {
225
+ default: se(() => [
226
+ r.icon ? (g(), M(R, {
227
+ key: 0,
228
+ icon: r.icon,
229
+ class: l(c.size === "sm" ? "w-3.5 h-3.5" : "w-4 h-4")
230
+ }, null, 8, ["icon", "class"])) : j("", !0),
231
+ f("span", {
232
+ class: l(["whitespace-nowrap z-20 relative", c.textClass])
233
+ }, oe(J(r)), 3)
234
+ ]),
235
+ _: 2
236
+ }, 1040, ["aria-selected", "disabled", "class", "onClick"]))), 128))
237
+ ], 2)
238
+ ], 544),
239
+ x(h(A, {
240
+ direction: "right",
241
+ color: I.value,
242
+ coverage: "100px",
243
+ blur: "40",
244
+ easing: "smooth",
245
+ tintOpacity: 1,
246
+ class: l(["z-10 pointer-events-none", t.variant === "line" ? "" : "rounded-r-lg"])
247
+ }, null, 8, ["color", "class"]), [
248
+ [y, C.value]
249
+ ]),
250
+ x(f("div", {
251
+ class: l(["right-0 pr-1", L.value])
252
+ }, [
253
+ f("button", {
254
+ onClick: n[1] || (n[1] = (r) => S(200)),
255
+ class: "pointer-events-auto h-full px-1 flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors focus:outline-none",
256
+ "aria-label": "Scroll right"
257
+ }, [
258
+ h(R, {
259
+ icon: "lucide:chevron-right",
260
+ class: "w-5 h-5"
261
+ })
262
+ ])
263
+ ], 2), [
264
+ [y, C.value]
265
+ ])
144
266
  ], 2));
145
267
  }
146
268
  });
147
269
  export {
148
- ee as default
270
+ me as default
149
271
  };
@@ -5,7 +5,7 @@ const _ = /* @__PURE__ */ l({
5
5
  __name: "WorkbookAddButton",
6
6
  emits: ["click"],
7
7
  setup(a, { emit: o }) {
8
- const n = o, i = c(() => {
8
+ const r = o, n = c(() => {
9
9
  const t = u("vlite.workbook.addSheet");
10
10
  return t !== "vlite.workbook.addSheet" ? t : "Add New Sheet";
11
11
  });
@@ -13,10 +13,10 @@ const _ = /* @__PURE__ */ l({
13
13
  variant: "ghost",
14
14
  size: "md",
15
15
  icon: "lucide:plus",
16
- title: i.value,
16
+ title: n.value,
17
17
  rounded: "none",
18
- class: "h-full!",
19
- onClick: e[0] || (e[0] = (r) => n("click", r))
18
+ class: "h-full! hover:bg-gray-250!",
19
+ onClick: e[0] || (e[0] = (i) => r("click", i))
20
20
  }, null, 8, ["title"]));
21
21
  }
22
22
  });
@@ -25,6 +25,7 @@ export { Dropdown } from './Dropdown';
25
25
  export { Empty } from './Empty';
26
26
  export { FilePicker } from './FilePicker';
27
27
  export { FileTree } from './FileTree';
28
+ export { FadeOverlay } from './FadeOverlay';
28
29
  export { Footer } from './Footer';
29
30
  export { Form } from './Form';
30
31
  export { default as FormFields } from './Form/FormFields.vue';
package/index.d.ts CHANGED
@@ -77,6 +77,7 @@ export { default as CheckBox } from './components/CheckBox.vue';
77
77
  export { default as Textarea } from './components/Textarea.vue';
78
78
  export { default as Radio } from './components/Radio.vue';
79
79
  export { default as RadioGroup } from './components/RadioGroup.vue';
80
+ export * from './components/FadeOverlay';
80
81
  export { default as SidePanel } from './components/SidePanel.vue';
81
82
  export { default as DatePicker } from './components/DatePicker.vue';
82
83
  export { default as IconPicker } from './components/IconPicker.vue';