vlite3 0.3.6 → 0.3.8

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,4 +1,4 @@
1
- import { defineComponent as o, computed as a, openBlock as c, createElementBlock as i, normalizeClass as d, renderSlot as u } from "vue";
1
+ import { defineComponent as o, computed as a, openBlock as c, createElementBlock as d, normalizeClass as i, renderSlot as u } from "vue";
2
2
  const g = /* @__PURE__ */ o({
3
3
  __name: "Badge",
4
4
  props: {
@@ -6,7 +6,7 @@ const g = /* @__PURE__ */ o({
6
6
  class: { default: "" }
7
7
  },
8
8
  setup(n) {
9
- const e = n, t = a(() => ["inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", {
9
+ const e = n, t = a(() => ["inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", {
10
10
  default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
11
11
  secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
12
12
  danger: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
@@ -15,8 +15,8 @@ const g = /* @__PURE__ */ o({
15
15
  success: "border-transparent bg-success text-success-fg hover:bg-success/80",
16
16
  outline: "text-foreground border-border"
17
17
  }[e.variant], e.class].join(" "));
18
- return (r, s) => (c(), i("div", {
19
- class: d(t.value)
18
+ return (r, s) => (c(), d("div", {
19
+ class: i(t.value)
20
20
  }, [
21
21
  u(r.$slots, "default")
22
22
  ], 2));
@@ -3,6 +3,7 @@ declare function __VLS_template(): {
3
3
  attrs: Partial<{}>;
4
4
  slots: {
5
5
  default?(_: {}): any;
6
+ default?(_: {}): any;
6
7
  };
7
8
  refs: {};
8
9
  rootEl: HTMLButtonElement;
@@ -1,7 +1,7 @@
1
- import { defineComponent as y, useSlots as z, computed as i, inject as k, withDirectives as B, openBlock as r, createElementBlock as C, normalizeClass as s, createBlock as u, createCommentVNode as g, renderSlot as S, createTextVNode as G, toDisplayString as I, unref as R } from "vue";
1
+ import { defineComponent as B, useSlots as I, computed as r, inject as R, withDirectives as S, openBlock as s, createElementBlock as g, normalizeClass as o, createBlock as u, createCommentVNode as h, renderSlot as f, createTextVNode as m, toDisplayString as b, unref as G } from "vue";
2
2
  import d from "./Icon.vue.js";
3
3
  import { vRipple as j } from "../directives/vRipple.js";
4
- const V = ["type", "disabled"], E = /* @__PURE__ */ y({
4
+ const V = ["type", "disabled"], E = /* @__PURE__ */ B({
5
5
  __name: "Button",
6
6
  props: {
7
7
  variant: { default: "primary" },
@@ -13,11 +13,15 @@ const V = ["type", "disabled"], E = /* @__PURE__ */ y({
13
13
  iconRight: {},
14
14
  type: { default: "button" },
15
15
  text: {},
16
- rounded: { default: "md" }
16
+ rounded: { default: "md" },
17
+ textClass: {},
18
+ iconClass: {},
19
+ iconRightClass: {},
20
+ asIcon: { type: Boolean }
17
21
  },
18
22
  setup(e) {
19
- const n = e, h = z(), l = i(() => n.icon && !n.text && !h.default), f = k("buttonGroup", null), m = i(() => !!f?.isInGroup), b = i(() => {
20
- const t = "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 active:scale-[0.98] cursor-pointer gap-2", o = {
23
+ const t = e, x = I(), l = r(() => t?.asIcon || t.icon && !t.text && !x.default), v = R("buttonGroup", null), w = r(() => !!v?.isInGroup), y = r(() => {
24
+ const n = "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 active:scale-[0.98] cursor-pointer gap-2", i = {
21
25
  primary: "bg-primary text-primary-foreground hover:bg-primary/90",
22
26
  "primary-light": "bg-primary-light text-primary-fg-light hover:bg-primary/20",
23
27
  secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
@@ -37,25 +41,25 @@ const V = ["type", "disabled"], E = /* @__PURE__ */ y({
37
41
  "outline-success": "border border-success text-success hover:bg-success/10",
38
42
  ghost: "hover:bg-accent hover:text-accent-foreground text-foreground",
39
43
  link: "text-primary underline-offset-4 hover:underline"
40
- }, x = {
44
+ }, p = {
41
45
  xs: "h-6.5 px-2",
42
46
  sm: "h-7.5 px-3",
43
47
  md: "h-9 px-4 py-2",
44
48
  lg: "h-10 px-6",
45
49
  xl: "h-12 px-10"
46
- }, v = {
50
+ }, z = {
47
51
  xs: "h-6.5 w-6.5 min-h-6.5 min-w-6.5",
48
52
  sm: "h-7 w-7 min-h-7 min-w-7",
49
53
  md: "h-7.5 w-7.5 min-h-7.5 min-w-7.5",
50
54
  lg: "h-8 w-8 min-h-8 min-w-8",
51
55
  xl: "h-8.5 w-8.5 min-h-8.5 min-w-8.5"
52
- }, p = {
56
+ }, C = {
53
57
  xs: "px-2",
54
58
  sm: "px-3",
55
59
  md: "px-4",
56
60
  lg: "px-6",
57
61
  xl: "px-10"
58
- }, w = {
62
+ }, k = {
59
63
  none: "rounded-none",
60
64
  sm: "rounded-sm",
61
65
  md: "rounded",
@@ -64,54 +68,61 @@ const V = ["type", "disabled"], E = /* @__PURE__ */ y({
64
68
  "2xl": "rounded-2xl",
65
69
  full: "rounded-full"
66
70
  };
67
- let a;
68
- return l.value ? a = m.value ? p[n.size] : v[n.size] : a = x[n.size], [
69
- t,
70
- o[n.variant],
71
- w[n.rounded],
72
- a,
73
- n.class
71
+ let c;
72
+ return l.value ? c = w.value ? C[t.size] : z[t.size] : c = p[t.size], [
73
+ n,
74
+ i[t.variant],
75
+ k[t.rounded],
76
+ c,
77
+ t.class
74
78
  ].join(" ");
75
- }), c = i(() => {
76
- const t = {
79
+ }), a = r(() => {
80
+ const n = {
77
81
  xs: "w-3 h-3",
78
82
  sm: "w-4 h-4",
79
83
  md: "w-4 h-4",
80
84
  lg: "w-4 h-4",
81
85
  xl: "w-4 h-4"
82
- }, o = {
86
+ }, i = {
83
87
  xs: "w-3 h-3",
84
88
  sm: "w-3.5 h-3.5",
85
89
  md: "w-3.5 h-3.5",
86
90
  lg: "w-4 h-4",
87
91
  xl: "w-4 h-4"
88
92
  };
89
- return l.value ? o[n.size] : t[n.size];
93
+ return l.value ? i[t.size] : n[t.size];
90
94
  });
91
- return (t, o) => B((r(), C("button", {
95
+ return (n, i) => S((s(), g("button", {
92
96
  type: e.type,
93
- class: s(b.value),
97
+ class: o(y.value),
94
98
  disabled: e.disabled || e.loading
95
99
  }, [
96
- e.loading ? (r(), u(d, {
100
+ e.loading ? (s(), u(d, {
97
101
  key: 0,
98
102
  icon: "lucide:loader-2",
99
- class: s(["animate-spin pointer-events-none", c.value])
100
- }, null, 8, ["class"])) : e.icon ? (r(), u(d, {
103
+ class: o(["animate-spin pointer-events-none", a.value])
104
+ }, null, 8, ["class"])) : e.icon ? (s(), u(d, {
101
105
  key: 1,
102
106
  icon: e.icon,
103
- class: s(["pointer-events-none", [c.value, l.value ? "mx-auto" : ""]])
104
- }, null, 8, ["icon", "class"])) : g("", !0),
105
- S(t.$slots, "default", {}, () => [
106
- G(I(e.text), 1)
107
- ]),
108
- e.iconRight && !e.loading ? (r(), u(d, {
107
+ class: o(["pointer-events-none", [e.iconClass, a.value, l.value ? "mx-auto" : ""]])
108
+ }, null, 8, ["icon", "class"])) : h("", !0),
109
+ e.textClass ? (s(), g("span", {
109
110
  key: 2,
111
+ class: o(e.textClass)
112
+ }, [
113
+ f(n.$slots, "default", {}, () => [
114
+ m(b(e.text), 1)
115
+ ])
116
+ ], 2)) : f(n.$slots, "default", { key: 3 }, () => [
117
+ m(b(e.text), 1)
118
+ ]),
119
+ e.iconRight && !e.loading ? (s(), u(d, {
120
+ key: 4,
110
121
  icon: e.iconRight,
111
- class: s([c.value, "h-4 w-4 pointer-events-none"])
112
- }, null, 8, ["icon", "class"])) : g("", !0)
122
+ class: o([[e.iconRightClass, a.value], "h-4 w-4 pointer-events-none"])
123
+ }, null, 8, ["icon", "class"])) : h("", !0)
113
124
  ], 10, V)), [
114
- [R(j)]
125
+ [G(j)]
115
126
  ]);
116
127
  }
117
128
  });
@@ -1,16 +1,13 @@
1
- import { defineComponent as B, ref as D, watch as u, computed as f, openBlock as a, createElementBlock as n, normalizeClass as y, Fragment as P, renderList as h, renderSlot as i, createBlock as k, resolveDynamicComponent as v, createElementVNode as d, createVNode as I, toDisplayString as p, mergeProps as x, createCommentVNode as b, unref as L } from "vue";
2
- import j from "../Pagination/Pagination.vue.js";
3
- import E from "../Icon.vue.js";
4
- const S = { class: "flex flex-col w-full" }, z = {
1
+ import { defineComponent as b, ref as D, watch as r, computed as u, openBlock as a, createElementBlock as o, normalizeClass as f, Fragment as P, renderList as y, renderSlot as s, createBlock as k, resolveDynamicComponent as h, createVNode as I, unref as v, mergeProps as p, createCommentVNode as C } from "vue";
2
+ import L from "../Pagination/Pagination.vue.js";
3
+ import x from "../Empty/Empty.vue.js";
4
+ const z = { class: "flex flex-col w-full" }, E = {
5
5
  key: 1,
6
6
  class: "h-48 rounded-lg bg-gray-200 animate-pulse w-full"
7
7
  }, F = {
8
- key: 1,
9
- class: "flex flex-col items-center justify-center p-12 text-center bg-gray-50 border border-gray-200 rounded-lg"
10
- }, O = { class: "flex h-12 w-12 items-center justify-center rounded-full bg-gray-100 mb-4" }, U = { class: "text-lg font-semibold text-gray-900" }, V = { class: "mt-2 text-sm text-gray-500" }, W = {
11
8
  key: 3,
12
9
  class: "mt-8 w-full"
13
- }, H = /* @__PURE__ */ B({
10
+ }, W = /* @__PURE__ */ b({
14
11
  __name: "DataList",
15
12
  props: {
16
13
  data: { default: () => [] },
@@ -31,90 +28,86 @@ const S = { class: "flex flex-col w-full" }, z = {
31
28
  showItemsPerPage: !1,
32
29
  itemsPerPageOptions: [10, 25, 50, 100],
33
30
  showPageInfo: !1
34
- }) }
31
+ }) },
32
+ delete: {}
35
33
  },
36
34
  emits: ["change"],
37
- setup(e, { emit: w }) {
38
- const o = e, C = w, s = D(o.pageInfo?.itemsPerPage || o.paginationProps?.itemsPerPage || 10);
39
- u(
40
- () => o.pageInfo?.itemsPerPage,
35
+ setup(e, { emit: T }) {
36
+ const n = e, w = T, i = D(n.pageInfo?.itemsPerPage || n.paginationProps?.itemsPerPage || 10);
37
+ r(
38
+ () => n.pageInfo?.itemsPerPage,
41
39
  (t) => {
42
- t !== void 0 && (s.value = t);
40
+ t !== void 0 && (i.value = t);
43
41
  }
44
- ), u(
45
- () => o.paginationProps?.itemsPerPage,
42
+ ), r(
43
+ () => n.paginationProps?.itemsPerPage,
46
44
  (t) => {
47
- t !== void 0 && (s.value = t);
45
+ t !== void 0 && (i.value = t);
48
46
  }
49
47
  );
50
- let r = null;
51
- const g = (t, m) => {
52
- r && clearTimeout(r), r = setTimeout(() => {
53
- C("change", { page: t, limit: m });
48
+ let m = null;
49
+ const g = (t, c) => {
50
+ m && clearTimeout(m), m = setTimeout(() => {
51
+ w("change", { page: t, limit: c });
54
52
  }, 10);
55
53
  }, N = (t) => {
56
- g(t, s.value);
57
- }, T = (t) => {
58
- s.value = t, g(o.pageInfo?.currentPage || 1, t);
54
+ g(t, i.value);
55
+ }, $ = (t) => {
56
+ i.value = t, g(n.pageInfo?.currentPage || 1, t);
59
57
  };
60
- f(() => o.pageInfo?.currentPage || 1);
61
- const $ = f(() => o.pageInfo?.totalPages || 1);
62
- return (t, m) => (a(), n("div", S, [
63
- e.loading ? (a(), n("div", {
58
+ u(() => n.pageInfo?.currentPage || 1);
59
+ const B = u(() => n.pageInfo?.totalPages || 1);
60
+ return (t, c) => (a(), o("div", z, [
61
+ e.loading ? (a(), o("div", {
64
62
  key: 0,
65
- class: y(e.className)
63
+ class: f(e.className)
66
64
  }, [
67
- (a(), n(P, null, h(8, (l) => i(t.$slots, "skeleton", {
65
+ (a(), o(P, null, y(8, (l) => s(t.$slots, "skeleton", {
68
66
  key: "skeleton-" + l,
69
67
  index: l
70
68
  }, () => [
71
- i(t.$slots, "skelton", { index: l }, () => [
72
- e.skeleton || e.skelton ? (a(), k(v(e.skeleton || e.skelton), { key: 0 })) : (a(), n("div", z))
69
+ s(t.$slots, "skelton", { index: l }, () => [
70
+ e.skeleton || e.skelton ? (a(), k(h(e.skeleton || e.skelton), { key: 0 })) : (a(), o("div", E))
73
71
  ])
74
72
  ])), 64))
75
- ], 2)) : !e.data || e.data.length === 0 ? (a(), n("div", F, [
76
- i(t.$slots, "empty", {}, () => [
77
- d("div", O, [
78
- I(E, {
79
- icon: e.emptyIcon,
80
- class: "h-6 w-6 text-gray-500"
81
- }, null, 8, ["icon"])
82
- ]),
83
- d("h3", U, p(e.emptyTitle), 1),
84
- d("p", V, p(e.emptyDescription), 1)
85
- ])
86
- ])) : (a(), n("div", {
73
+ ], 2)) : !e.data || e.data.length === 0 ? s(t.$slots, "empty", { key: 1 }, () => [
74
+ I(v(x), {
75
+ title: e.emptyTitle,
76
+ description: e.emptyDescription,
77
+ icon: e.emptyIcon
78
+ }, null, 8, ["title", "description", "icon"])
79
+ ]) : (a(), o("div", {
87
80
  key: 2,
88
- class: y(e.className)
81
+ class: f(e.className)
89
82
  }, [
90
- (a(!0), n(P, null, h(e.data, (l, c) => i(t.$slots, "item", {
91
- key: c,
83
+ (a(!0), o(P, null, y(e.data, (l, d) => s(t.$slots, "item", {
84
+ key: d,
92
85
  item: l,
93
86
  data: e.data,
94
- index: c
87
+ index: d
95
88
  }, () => [
96
- e.item ? (a(), k(v(e.item), x({
89
+ e.item ? (a(), k(h(e.item), p({
97
90
  key: 0,
98
91
  item: l,
99
92
  data: e.data,
100
- index: c
101
- }, { ref_for: !0 }, e.itemProps), null, 16, ["item", "data", "index"])) : b("", !0)
93
+ index: d
94
+ }, { ref_for: !0 }, e.itemProps), null, 16, ["item", "data", "index"])) : C("", !0)
102
95
  ])), 128))
103
96
  ], 2)),
104
- e.showPagination && e.pageInfo && $.value > 1 ? (a(), n("div", W, [
105
- I(L(j), x({
97
+ e.showPagination && e.pageInfo && B.value > 1 ? (a(), o("div", F, [
98
+ I(v(L), p({
106
99
  "current-page": e.pageInfo?.currentPage,
107
100
  "total-pages": e.pageInfo?.totalPages,
108
101
  "total-items": e.pageInfo?.totalItems,
109
102
  navType: "icon"
110
103
  }, e.paginationProps, {
111
104
  onChange: N,
112
- "onUpdate:itemsPerPage": T
105
+ "onUpdate:itemsPerPage": $
113
106
  }), null, 16, ["current-page", "total-pages", "total-items"])
114
- ])) : b("", !0)
107
+ ])) : C("", !0)
115
108
  ]));
116
109
  }
117
110
  });
118
111
  export {
119
- H as default
112
+ W as default
120
113
  };
@@ -14,4 +14,5 @@ export interface DataListProps {
14
14
  emptyIcon?: string;
15
15
  showPagination?: boolean;
16
16
  paginationProps?: DataListMetaInfo;
17
+ delete?: (items: any[]) => void;
17
18
  }
@@ -9,7 +9,7 @@ declare function __VLS_template(): {
9
9
  }) => any>> & {
10
10
  'toolbar-left'?(_: {}): any;
11
11
  'toolbar-right'?(_: {}): any;
12
- 'empty-description'?(_: {}): any;
12
+ empty?(_: {}): any;
13
13
  'empty-action'?(_: {}): any;
14
14
  };
15
15
  refs: {};