vlite3 0.4.6 → 0.4.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.
- package/components/Accordion/AccordionItem.vue.js +33 -32
- package/components/Accordion/types.d.ts +2 -0
- package/components/Alert.vue.d.ts +2 -0
- package/components/Alert.vue.js +38 -36
- package/components/AvatarUploader/AvatarUploader.vue.d.ts +1 -1
- package/components/AvatarUploader/AvatarUploader.vue.js +25 -24
- package/components/Button.vue.d.ts +1 -1
- package/components/Button.vue.js +37 -35
- package/components/CheckBox.vue.d.ts +1 -0
- package/components/CheckBox.vue.js +40 -40
- package/components/Chip/Chip.vue.js +55 -55
- package/components/Chip/types.d.ts +1 -0
- package/components/ChoiceBox/ChoiceBox.vue.d.ts +5 -0
- package/components/ChoiceBox/ChoiceBox.vue.js +61 -58
- package/components/ColorPicker/ColorPicker.vue.js +3 -2
- package/components/ConfirmationModal.vue.d.ts +4 -2
- package/components/ConfirmationModal.vue.js +48 -33
- package/components/DataList/DataList.vue.d.ts +0 -2
- package/components/DataList/DataList.vue.js +39 -35
- package/components/DataList/types.d.ts +2 -0
- package/components/DataTable/DataTable.vue.d.ts +0 -5
- package/components/DataTable/DataTable.vue.js +177 -158
- package/components/DataTable/DataTableHeader.vue.js +15 -14
- package/components/DataTable/DataTableToolbar.vue.d.ts +1 -1
- package/components/DataTable/DataTableToolbar.vue.js +30 -23
- package/components/DataTable/types.d.ts +4 -0
- package/components/DatePicker.vue.d.ts +1 -0
- package/components/DatePicker.vue.js +32 -25
- package/components/Dropdown/DropdownBooleanItem.vue.js +18 -17
- package/components/Dropdown/DropdownGroupedLayout.vue.js +28 -27
- package/components/Dropdown/DropdownItem.vue.js +24 -23
- package/components/Dropdown/DropdownMenu.vue.js +100 -91
- package/components/Dropdown/composables/useDropdownNavigation.js +24 -23
- package/components/Dropdown/composables/useDropdownSelection.js +19 -17
- package/components/Empty/Empty.vue.d.ts +2 -2
- package/components/Empty/Empty.vue.js +32 -18
- package/components/FilePicker/FilePicker.vue.d.ts +3 -1
- package/components/FilePicker/FilePicker.vue.js +140 -127
- package/components/FileTree/FileTree.vue.js +68 -58
- package/components/FileTree/FileTreeNode.vue.js +35 -34
- package/components/FileTree/types.d.ts +3 -0
- package/components/Form/CustomFields.vue.d.ts +3 -1
- package/components/Form/CustomFields.vue.js +2 -2
- package/components/Form/CustomFields.vue2.js +92 -80
- package/components/Form/Form.vue.d.ts +1 -1
- package/components/Form/FormField.vue.d.ts +1 -1
- package/components/Form/FormField.vue.js +60 -59
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +58 -57
- package/components/Form/composables/useForm.js +102 -90
- package/components/Form/types.d.ts +4 -0
- package/components/GoogleLogin.vue.d.ts +1 -1
- package/components/GoogleLogin.vue.js +39 -32
- package/components/Heatmap/Heatmap.vue2.js +3 -2
- package/components/IconPicker.vue.d.ts +2 -0
- package/components/IconPicker.vue.js +37 -29
- package/components/Input.vue.d.ts +1 -1
- package/components/Input.vue.js +96 -98
- package/components/Kanban/KanbanBoard.vue.js +1 -1
- package/components/Kanban/KanbanBoard.vue2.js +55 -54
- package/components/Kanban/types.d.ts +1 -0
- package/components/Masonry/Masonry.vue2.js +3 -2
- package/components/Modal.vue.d.ts +2 -0
- package/components/Modal.vue.js +62 -57
- package/components/MultiSelect/MultiSelect.vue.d.ts +1 -1
- package/components/MultiSelect/MultiSelect.vue.js +61 -54
- package/components/Navbar/Navbar.vue.js +46 -46
- package/components/Pagination/Pagination.vue.js +116 -97
- package/components/PricingPlan/PricingPlanItem.vue.js +60 -47
- package/components/PricingPlan/types.d.ts +5 -0
- package/components/Screen/Screen.vue.d.ts +0 -4
- package/components/Screen/Screen.vue.js +231 -189
- package/components/Screen/ScreenFilter.vue.js +73 -63
- package/components/Screen/types.d.ts +5 -0
- package/components/SidePanel.vue.d.ts +2 -0
- package/components/SidePanel.vue.js +140 -5
- package/components/SidePanel.vue2.js +2 -135
- package/components/SidebarMenu/SidebarMenuItem.vue.js +131 -130
- package/components/SidebarMenu/types.d.ts +1 -0
- package/components/Slider.vue.d.ts +1 -0
- package/components/Slider.vue.js +71 -69
- package/components/Switch.vue.d.ts +1 -0
- package/components/Switch.vue.js +23 -18
- package/components/Tabes/Tabes.vue.js +20 -19
- package/components/Tabes/types.d.ts +1 -0
- package/components/Textarea.vue.d.ts +1 -0
- package/components/Textarea.vue.js +18 -16
- package/components/ThemeToggle.vue.js +24 -14
- package/components/Timeline.vue.js +68 -82
- package/components/ToastNotification.vue.js +2 -2
- package/components/Tooltip.vue.d.ts +4 -3
- package/components/Tooltip.vue.js +17 -15
- package/components/Workbook/Sheet.vue.js +80 -71
- package/components/Workbook/WorkbookAddButton.vue.js +14 -10
- package/components/Workbook/types.d.ts +1 -0
- package/core/config.d.ts +2 -0
- package/index.d.ts +1 -0
- package/index.js +28 -26
- package/package.json +1 -1
- package/style.css +1 -2
- package/types/button.d.ts +1 -0
- package/types/config.type.d.ts +10 -0
- package/types/form.type.d.ts +2 -0
- package/types/styles.d.ts +3 -0
- package/types/timeline.type.d.ts +2 -0
- package/utils/i18n.d.ts +8 -0
- package/utils/i18n.js +5 -0
- package/utils/index.d.ts +1 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { defineComponent as B, computed as r, openBlock as c, createElementBlock as m, normalizeClass as u, renderSlot as f, createVNode as p, withCtx as v, createElementVNode as V, toDisplayString as x, createCommentVNode as $, withDirectives as O, createBlock as T, resolveDynamicComponent as A, vShow as D } from "vue";
|
|
2
|
+
import P from "./AccordionTrigger.vue.js";
|
|
3
|
+
import N from "./AccordionContent.vue.js";
|
|
4
|
+
import { $t as h } from "../../utils/i18n.js";
|
|
5
|
+
const S = { class: "font-medium" }, E = {
|
|
5
6
|
key: 0,
|
|
6
7
|
class: "ml-2 text-sm text-muted-foreground font-normal"
|
|
7
|
-
},
|
|
8
|
+
}, H = ["innerHTML"], G = /* @__PURE__ */ B({
|
|
8
9
|
__name: "AccordionItem",
|
|
9
10
|
props: {
|
|
10
11
|
item: {},
|
|
@@ -25,13 +26,13 @@ const T = { class: "font-medium" }, D = {
|
|
|
25
26
|
class: { default: "" }
|
|
26
27
|
},
|
|
27
28
|
emits: ["toggle"],
|
|
28
|
-
setup(e, { emit:
|
|
29
|
-
const n = e,
|
|
30
|
-
n.item.disabled || n.disabled ||
|
|
31
|
-
},
|
|
29
|
+
setup(e, { emit: C }) {
|
|
30
|
+
const n = e, y = C, l = () => {
|
|
31
|
+
n.item.disabled || n.disabled || y("toggle", n.item.id);
|
|
32
|
+
}, I = r(() => {
|
|
32
33
|
const { variant: t, attached: a } = n;
|
|
33
34
|
return a ? "transition-all first:rounded-t-lg last:rounded-b-lg border-b last:border-0" : t === "solid" ? "mb-2 border rounded-lg overflow-hidden transition-all duration-200" : t === "outline" ? "border mb-2 rounded-lg overflow-hidden" : t === "separated" ? "border mb-4 rounded-lg overflow-hidden" : t === "ghost" ? "border-none bg-transparent mb-1 rounded-lg overflow-hidden" : "border-b";
|
|
34
|
-
}), g =
|
|
35
|
+
}), g = r(() => {
|
|
35
36
|
const { variant: t, size: a, isOpen: d } = n, i = n.triggerClass || "", o = "transition-all duration-200 ease-in-out", s = {
|
|
36
37
|
sm: "px-3.5 py-2.5 text-sm",
|
|
37
38
|
md: "px-4 py-3 text-base",
|
|
@@ -42,7 +43,7 @@ const T = { class: "font-medium" }, D = {
|
|
|
42
43
|
md: "py-3 text-base",
|
|
43
44
|
lg: "py-4 text-lg"
|
|
44
45
|
}[a]} px-0 hover:no-underline ${o}` : `${i} ${s} hover:bg-muted/5 ${o}`;
|
|
45
|
-
}),
|
|
46
|
+
}), w = r(() => {
|
|
46
47
|
const { variant: t, size: a, attached: d } = n, i = n.contentClass || "", o = {
|
|
47
48
|
sm: "px-3.5 pb-3.5 pt-2.5 text-sm",
|
|
48
49
|
md: "px-4 pb-4 pt-4 text-sm",
|
|
@@ -53,17 +54,17 @@ const T = { class: "font-medium" }, D = {
|
|
|
53
54
|
md: "pb-4 pt-4 text-sm",
|
|
54
55
|
lg: "pb-5 pt-5 text-base"
|
|
55
56
|
}[a]} px-0`;
|
|
56
|
-
});
|
|
57
|
-
return (t, a) => (
|
|
58
|
-
class: u([
|
|
57
|
+
}), k = r(() => n.item.titleI18n ? h(n.item.titleI18n) : n.item.title), b = r(() => n.item.descriptionI18n ? h(n.item.descriptionI18n) : n.item.description);
|
|
58
|
+
return (t, a) => (c(), m("div", {
|
|
59
|
+
class: u([I.value, n.class, n.itemClass])
|
|
59
60
|
}, [
|
|
60
|
-
|
|
61
|
+
f(t.$slots, "trigger", {
|
|
61
62
|
item: e.item,
|
|
62
63
|
open: e.isOpen,
|
|
63
|
-
toggle:
|
|
64
|
+
toggle: l,
|
|
64
65
|
triggerClass: g.value
|
|
65
66
|
}, () => [
|
|
66
|
-
|
|
67
|
+
p(P, {
|
|
67
68
|
open: e.isOpen,
|
|
68
69
|
size: e.size,
|
|
69
70
|
disabled: e.item.disabled || e.disabled,
|
|
@@ -75,41 +76,41 @@ const T = { class: "font-medium" }, D = {
|
|
|
75
76
|
"icon-variant": e.iconVariant,
|
|
76
77
|
"active-icon-variant": e.activeIconVariant,
|
|
77
78
|
class: u(g.value),
|
|
78
|
-
onClick:
|
|
79
|
+
onClick: l
|
|
79
80
|
}, {
|
|
80
|
-
default:
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
default: v(() => [
|
|
82
|
+
V("span", S, x(k.value), 1),
|
|
83
|
+
b.value ? (c(), m("span", E, x(b.value), 1)) : $("", !0)
|
|
83
84
|
]),
|
|
84
85
|
_: 1
|
|
85
86
|
}, 8, ["open", "size", "disabled", "icon", "index", "show-index", "open-icon", "close-icon", "icon-variant", "active-icon-variant", "class"])
|
|
86
87
|
]),
|
|
87
|
-
|
|
88
|
-
class: u(
|
|
88
|
+
O(p(N, {
|
|
89
|
+
class: u(w.value)
|
|
89
90
|
}, {
|
|
90
|
-
default:
|
|
91
|
-
|
|
91
|
+
default: v(() => [
|
|
92
|
+
f(t.$slots, "content", {
|
|
92
93
|
item: e.item,
|
|
93
|
-
close:
|
|
94
|
+
close: l
|
|
94
95
|
}, () => [
|
|
95
|
-
e.item.bodyComponent ? (
|
|
96
|
+
e.item.bodyComponent ? (c(), T(A(e.item.bodyComponent), {
|
|
96
97
|
key: 0,
|
|
97
98
|
item: e.item,
|
|
98
|
-
close:
|
|
99
|
-
}, null, 8, ["item"])) : e.item.content ? (
|
|
99
|
+
close: l
|
|
100
|
+
}, null, 8, ["item"])) : e.item.content ? (c(), m("div", {
|
|
100
101
|
key: 1,
|
|
101
102
|
class: "text-muted-foreground leading-relaxed",
|
|
102
103
|
innerHTML: e.item.content
|
|
103
|
-
}, null, 8,
|
|
104
|
+
}, null, 8, H)) : $("", !0)
|
|
104
105
|
])
|
|
105
106
|
]),
|
|
106
107
|
_: 3
|
|
107
108
|
}, 8, ["class"]), [
|
|
108
|
-
[
|
|
109
|
+
[D, e.isOpen]
|
|
109
110
|
])
|
|
110
111
|
], 2));
|
|
111
112
|
}
|
|
112
113
|
});
|
|
113
114
|
export {
|
|
114
|
-
|
|
115
|
+
G as default
|
|
115
116
|
};
|
|
@@ -5,7 +5,9 @@ export type IconVariant = 'simple' | 'solid' | 'outline' | 'primary' | 'ghost';
|
|
|
5
5
|
export interface AccordionItemSchema {
|
|
6
6
|
id: string;
|
|
7
7
|
title: string;
|
|
8
|
+
titleI18n?: string;
|
|
8
9
|
description?: string;
|
|
10
|
+
descriptionI18n?: string;
|
|
9
11
|
content?: string;
|
|
10
12
|
icon?: string;
|
|
11
13
|
disabled?: boolean;
|
package/components/Alert.vue.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
|
|
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";
|
|
4
|
+
const D = ["role"], E = {
|
|
4
5
|
key: 1,
|
|
5
6
|
class: "text-sm opacity-90 [&_p]:leading-relaxed"
|
|
6
|
-
},
|
|
7
|
+
}, R = /* @__PURE__ */ V({
|
|
7
8
|
__name: "Alert",
|
|
8
9
|
props: {
|
|
9
10
|
title: {},
|
|
11
|
+
titleI18n: {},
|
|
10
12
|
description: {},
|
|
13
|
+
descriptionI18n: {},
|
|
11
14
|
icon: {},
|
|
12
15
|
variant: { default: "primary" },
|
|
13
16
|
closable: { type: Boolean, default: !1 },
|
|
@@ -15,70 +18,69 @@ const j = ["role"], E = {
|
|
|
15
18
|
class: { default: "" }
|
|
16
19
|
},
|
|
17
20
|
emits: ["close"],
|
|
18
|
-
setup(
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
},
|
|
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(() => ({
|
|
22
25
|
primary: "bg-primary-light text-primary border-primary/15",
|
|
23
26
|
success: "bg-success-light text-success-dark border-success/25",
|
|
24
27
|
warning: "bg-warning-light text-warning-dark border-warning/20",
|
|
25
28
|
danger: "bg-danger-light text-danger-dark border-danger/15"
|
|
26
|
-
})[
|
|
29
|
+
})[e.variant]), w = t(() => ({
|
|
27
30
|
primary: "text-primary!",
|
|
28
31
|
success: "text-success-dark!",
|
|
29
32
|
warning: "text-warning-dark!",
|
|
30
33
|
danger: "text-danger-dark!"
|
|
31
|
-
})[
|
|
34
|
+
})[e.variant]), l = t(() => !c.value && !N().default), C = t(() => [
|
|
32
35
|
"relative w-full rounded-lg border px-4 [&>svg]:absolute [&>svg]:left-4 [&>svg]:text-foreground",
|
|
33
36
|
l.value ? "py-3" : "pt-4 pb-2",
|
|
34
|
-
// Icon Position: Center vertically if title only, otherwise top-4
|
|
35
37
|
l.value ? "[&>svg]:top-1/2 [&>svg]:-translate-y-1/2" : "[&>svg]:top-4 top-4 [&>svg+div]:translate-y-[-3px]",
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
].join(" ")),
|
|
38
|
+
h.value,
|
|
39
|
+
e.class
|
|
40
|
+
].join(" ")), I = t(() => [
|
|
39
41
|
"font-medium leading-none tracking-tight text-inherit!",
|
|
40
42
|
l.value ? "" : "mb-1"
|
|
41
|
-
].join(" ")),
|
|
42
|
-
return (
|
|
43
|
+
].join(" ")), $ = t(() => e.role ? e.role : ["danger", "warning"].includes(e.variant) ? "alert" : "status");
|
|
44
|
+
return (n, g) => u.value ? (a(), i("div", {
|
|
43
45
|
key: 0,
|
|
44
|
-
class: r(
|
|
45
|
-
role:
|
|
46
|
+
class: r(C.value),
|
|
47
|
+
role: $.value
|
|
46
48
|
}, [
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
p(n.$slots, "icon", {}, () => [
|
|
50
|
+
s.icon ? (a(), S(f, {
|
|
49
51
|
key: 0,
|
|
50
|
-
icon:
|
|
51
|
-
class: r(["h-4 w-4",
|
|
52
|
+
icon: s.icon,
|
|
53
|
+
class: r(["h-4 w-4", w.value])
|
|
52
54
|
}, null, 8, ["icon", "class"])) : o("", !0)
|
|
53
55
|
]),
|
|
54
|
-
|
|
55
|
-
class: r({ "pl-7":
|
|
56
|
+
v("div", {
|
|
57
|
+
class: r({ "pl-7": s.icon || n.$slots.icon, "pr-6": s.closable })
|
|
56
58
|
}, [
|
|
57
|
-
|
|
59
|
+
d.value ? (a(), i("h5", {
|
|
58
60
|
key: 0,
|
|
59
|
-
class: r(
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
class: r(I.value)
|
|
62
|
+
}, m(d.value), 3)) : o("", !0),
|
|
63
|
+
c.value || n.$slots.default ? (a(), i("div", E, [
|
|
64
|
+
p(n.$slots, "default", {}, () => [
|
|
65
|
+
T(m(c.value), 1)
|
|
64
66
|
])
|
|
65
67
|
])) : o("", !0)
|
|
66
68
|
], 2),
|
|
67
|
-
|
|
69
|
+
s.closable ? (a(), i("button", {
|
|
68
70
|
key: 0,
|
|
69
71
|
type: "button",
|
|
70
|
-
onClick:
|
|
72
|
+
onClick: x,
|
|
71
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"]])
|
|
72
74
|
}, [
|
|
73
|
-
|
|
75
|
+
j(f, {
|
|
74
76
|
icon: "lucide:x",
|
|
75
77
|
class: "h-4 w-4"
|
|
76
78
|
}),
|
|
77
|
-
|
|
79
|
+
g[0] || (g[0] = v("span", { class: "sr-only" }, "Close", -1))
|
|
78
80
|
], 2)) : o("", !0)
|
|
79
|
-
], 10,
|
|
81
|
+
], 10, D)) : o("", !0);
|
|
80
82
|
}
|
|
81
83
|
});
|
|
82
84
|
export {
|
|
83
|
-
|
|
85
|
+
R as default
|
|
84
86
|
};
|
|
@@ -25,8 +25,8 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
25
25
|
alt: string;
|
|
26
26
|
size: AvatarSize;
|
|
27
27
|
modelValue: any;
|
|
28
|
-
loading: boolean;
|
|
29
28
|
rounded: AvatarRounded;
|
|
29
|
+
loading: boolean;
|
|
30
30
|
editable: boolean;
|
|
31
31
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
32
32
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as x, ref as w, computed as z, openBlock as i, createElementBlock as r, createElementVNode as
|
|
1
|
+
import { defineComponent as x, ref as w, computed as z, openBlock as i, createElementBlock as r, createElementVNode as b, normalizeClass as o, createVNode as n, withCtx as V, createCommentVNode as g, withModifiers as C } from "vue";
|
|
2
2
|
import c from "../Icon.vue.js";
|
|
3
3
|
import U from "../FilePicker/FilePicker.vue.js";
|
|
4
|
-
import
|
|
4
|
+
import A from "../Avatar.vue.js";
|
|
5
5
|
const R = { class: "inline-block" }, j = ["onClick"], F = /* @__PURE__ */ x({
|
|
6
6
|
name: "AvatarUploader",
|
|
7
7
|
__name: "AvatarUploader",
|
|
@@ -19,39 +19,40 @@ const R = { class: "inline-block" }, j = ["onClick"], F = /* @__PURE__ */ x({
|
|
|
19
19
|
},
|
|
20
20
|
emits: ["update:modelValue", "change", "error"],
|
|
21
21
|
setup(e, { emit: v }) {
|
|
22
|
-
const
|
|
22
|
+
const a = e, t = v, d = w(null), m = z(() => {
|
|
23
23
|
if (d.value) return d.value;
|
|
24
|
-
if (typeof
|
|
25
|
-
if (
|
|
26
|
-
if (
|
|
24
|
+
if (typeof a.modelValue == "string") return a.modelValue;
|
|
25
|
+
if (a.modelValue && a.modelValue.fileUrl) return a.modelValue.fileUrl;
|
|
26
|
+
if (a.modelValue && a.modelValue.base64) return a.modelValue.base64;
|
|
27
|
+
if (a.modelValue && a.modelValue.file instanceof File)
|
|
27
28
|
try {
|
|
28
|
-
return URL.createObjectURL(
|
|
29
|
+
return URL.createObjectURL(a.modelValue.file);
|
|
29
30
|
} catch {
|
|
30
31
|
}
|
|
31
32
|
return null;
|
|
32
|
-
}), h = (
|
|
33
|
-
if (!
|
|
34
|
-
Array.isArray(
|
|
33
|
+
}), h = (l) => {
|
|
34
|
+
if (!l || Array.isArray(l)) {
|
|
35
|
+
Array.isArray(l) && l.length === 0 && f();
|
|
35
36
|
return;
|
|
36
37
|
}
|
|
37
|
-
if (
|
|
38
|
-
d.value =
|
|
39
|
-
else if (
|
|
38
|
+
if (l.base64)
|
|
39
|
+
d.value = l.base64, t("update:modelValue", l.base64);
|
|
40
|
+
else if (l.file)
|
|
40
41
|
try {
|
|
41
|
-
d.value = URL.createObjectURL(
|
|
42
|
+
d.value = URL.createObjectURL(l.file), t("update:modelValue", l);
|
|
42
43
|
} catch {
|
|
43
44
|
}
|
|
44
|
-
t("change",
|
|
45
|
-
}, y = (
|
|
46
|
-
t("error",
|
|
47
|
-
},
|
|
45
|
+
t("change", l);
|
|
46
|
+
}, y = (l) => {
|
|
47
|
+
t("error", l);
|
|
48
|
+
}, f = () => {
|
|
48
49
|
d.value = null, t("update:modelValue", null), t("change", null);
|
|
49
50
|
};
|
|
50
|
-
return (
|
|
51
|
-
|
|
51
|
+
return (l, u) => (i(), r("div", R, [
|
|
52
|
+
b("div", {
|
|
52
53
|
class: o(["relative inline-block group", e.rounded === "full" ? "rounded-full" : "rounded-md"])
|
|
53
54
|
}, [
|
|
54
|
-
n(
|
|
55
|
+
n(A, {
|
|
55
56
|
src: m.value || void 0,
|
|
56
57
|
fallback: e.fallback,
|
|
57
58
|
alt: e.alt,
|
|
@@ -68,8 +69,8 @@ const R = { class: "inline-block" }, j = ["onClick"], F = /* @__PURE__ */ x({
|
|
|
68
69
|
onChange: u[0] || (u[0] = (s) => h(s)),
|
|
69
70
|
onError: y
|
|
70
71
|
}, {
|
|
71
|
-
trigger:
|
|
72
|
-
|
|
72
|
+
trigger: V(({ trigger: s, isLoading: k }) => [
|
|
73
|
+
b("button", {
|
|
73
74
|
type: "button",
|
|
74
75
|
class: o(["absolute inset-0 cursor-pointer", { "cursor-default": !e.editable || e.disabled }]),
|
|
75
76
|
onClick: (B) => e.editable && !e.disabled ? s() : null
|
|
@@ -99,7 +100,7 @@ const R = { class: "inline-block" }, j = ["onClick"], F = /* @__PURE__ */ x({
|
|
|
99
100
|
key: 0,
|
|
100
101
|
type: "button",
|
|
101
102
|
class: "absolute -top-1 -right-1 z-10 p-1 bg-background border border-border rounded-full text-muted-foreground shadow-sm hover:text-destructive hover:border-destructive transition-all opacity-0 group-hover:opacity-100 scale-75 group-hover:scale-100",
|
|
102
|
-
onClick:
|
|
103
|
+
onClick: C(f, ["stop"]),
|
|
103
104
|
title: "Remove image"
|
|
104
105
|
}, [
|
|
105
106
|
n(c, {
|
|
@@ -15,8 +15,8 @@ declare const __VLS_component: import('vue').DefineComponent<ButtonProps, {}, {}
|
|
|
15
15
|
class: any;
|
|
16
16
|
size: ButtonSize;
|
|
17
17
|
variant: ButtonVariant;
|
|
18
|
-
loading: boolean;
|
|
19
18
|
rounded: ButtonRounded;
|
|
19
|
+
loading: boolean;
|
|
20
20
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLButtonElement>;
|
|
21
21
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
22
22
|
export default _default;
|
package/components/Button.vue.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { defineComponent as B,
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as B, computed as s, useSlots as R, inject as S, withDirectives as G, openBlock as o, createElementBlock as h, normalizeClass as i, createBlock as d, createCommentVNode as m, renderSlot as f, createTextVNode as x, toDisplayString as b, unref as $ } from "vue";
|
|
2
|
+
import g from "./Icon.vue.js";
|
|
3
3
|
import { vRipple as j } from "../directives/vRipple.js";
|
|
4
|
-
|
|
4
|
+
import { $t as V } from "../utils/i18n.js";
|
|
5
|
+
const D = ["type", "disabled"], q = /* @__PURE__ */ B({
|
|
5
6
|
__name: "Button",
|
|
6
7
|
props: {
|
|
7
8
|
variant: { default: "primary" },
|
|
@@ -13,6 +14,7 @@ const V = ["type", "disabled"], E = /* @__PURE__ */ B({
|
|
|
13
14
|
iconRight: {},
|
|
14
15
|
type: { default: "button" },
|
|
15
16
|
text: {},
|
|
17
|
+
textI18n: {},
|
|
16
18
|
rounded: { default: "md" },
|
|
17
19
|
textClass: {},
|
|
18
20
|
iconClass: {},
|
|
@@ -20,8 +22,8 @@ const V = ["type", "disabled"], E = /* @__PURE__ */ B({
|
|
|
20
22
|
asIcon: { type: Boolean }
|
|
21
23
|
},
|
|
22
24
|
setup(e) {
|
|
23
|
-
const n = e,
|
|
24
|
-
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",
|
|
25
|
+
const n = e, l = s(() => n.textI18n ? V(n.textI18n) : n.text), v = R(), a = s(() => n?.asIcon || n.icon && !l.value && !v.default), p = S("buttonGroup", null), w = s(() => !!p?.isInGroup), y = s(() => {
|
|
26
|
+
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", r = {
|
|
25
27
|
primary: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
26
28
|
"primary-light": "bg-primary-light text-primary-fg-light hover:bg-primary/20",
|
|
27
29
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
@@ -41,28 +43,28 @@ const V = ["type", "disabled"], E = /* @__PURE__ */ B({
|
|
|
41
43
|
"outline-success": "border border-success text-success hover:bg-success/10",
|
|
42
44
|
ghost: "hover:bg-accent hover:text-accent-foreground text-foreground",
|
|
43
45
|
link: "text-primary underline-offset-4 hover:underline"
|
|
44
|
-
},
|
|
46
|
+
}, z = {
|
|
45
47
|
xs: "h-6.5 px-2",
|
|
46
48
|
sm: "h-7.5 px-3",
|
|
47
49
|
sm2: "h-8 px-3",
|
|
48
50
|
md: "h-9 px-4 py-2",
|
|
49
51
|
lg: "h-10 px-6",
|
|
50
52
|
xl: "h-12 px-10"
|
|
51
|
-
},
|
|
53
|
+
}, C = {
|
|
52
54
|
xs: "h-6.5 w-6.5 min-h-6.5 min-w-6.5",
|
|
53
55
|
sm: "h-7 w-7 min-h-7 min-w-7",
|
|
54
56
|
sm2: "h-7 w-7 min-h-7 min-w-7",
|
|
55
57
|
md: "h-7.5 w-7.5 min-h-7.5 min-w-7.5",
|
|
56
58
|
lg: "h-8 w-8 min-h-8 min-w-8",
|
|
57
59
|
xl: "h-8.5 w-8.5 min-h-8.5 min-w-8.5"
|
|
58
|
-
},
|
|
60
|
+
}, k = {
|
|
59
61
|
xs: "px-2",
|
|
60
62
|
sm: "px-3",
|
|
61
63
|
sm2: "px-3",
|
|
62
64
|
md: "px-4",
|
|
63
65
|
lg: "px-6",
|
|
64
66
|
xl: "px-10"
|
|
65
|
-
},
|
|
67
|
+
}, I = {
|
|
66
68
|
none: "rounded-none",
|
|
67
69
|
sm: "rounded-sm",
|
|
68
70
|
sm2: "rounded-sm",
|
|
@@ -72,15 +74,15 @@ const V = ["type", "disabled"], E = /* @__PURE__ */ B({
|
|
|
72
74
|
"2xl": "rounded-2xl",
|
|
73
75
|
full: "rounded-full"
|
|
74
76
|
};
|
|
75
|
-
let
|
|
76
|
-
return
|
|
77
|
+
let u;
|
|
78
|
+
return a.value ? u = w.value ? k[n.size] : C[n.size] : u = z[n.size], [
|
|
77
79
|
t,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
r[n.variant],
|
|
81
|
+
I[n.rounded],
|
|
82
|
+
u,
|
|
81
83
|
n.class
|
|
82
84
|
].join(" ");
|
|
83
|
-
}),
|
|
85
|
+
}), c = s(() => {
|
|
84
86
|
const t = {
|
|
85
87
|
xs: "w-3 h-3",
|
|
86
88
|
sm: "w-4 h-4",
|
|
@@ -88,7 +90,7 @@ const V = ["type", "disabled"], E = /* @__PURE__ */ B({
|
|
|
88
90
|
md: "w-4 h-4",
|
|
89
91
|
lg: "w-4 h-4",
|
|
90
92
|
xl: "w-4 h-4"
|
|
91
|
-
},
|
|
93
|
+
}, r = {
|
|
92
94
|
xs: "w-3 h-3",
|
|
93
95
|
sm: "w-3.5 h-3.5",
|
|
94
96
|
sm2: "w-3.5 h-3.5",
|
|
@@ -96,42 +98,42 @@ const V = ["type", "disabled"], E = /* @__PURE__ */ B({
|
|
|
96
98
|
lg: "w-4 h-4",
|
|
97
99
|
xl: "w-4 h-4"
|
|
98
100
|
};
|
|
99
|
-
return
|
|
101
|
+
return a.value ? r[n.size] : t[n.size];
|
|
100
102
|
});
|
|
101
|
-
return (t,
|
|
103
|
+
return (t, r) => G((o(), h("button", {
|
|
102
104
|
type: e.type,
|
|
103
|
-
class: i(
|
|
105
|
+
class: i(y.value),
|
|
104
106
|
disabled: e.disabled || e.loading
|
|
105
107
|
}, [
|
|
106
|
-
e.loading ? (
|
|
108
|
+
e.loading ? (o(), d(g, {
|
|
107
109
|
key: 0,
|
|
108
110
|
icon: "lucide:loader-2",
|
|
109
|
-
class: i(["animate-spin pointer-events-none",
|
|
110
|
-
}, null, 8, ["class"])) : e.icon ? (
|
|
111
|
+
class: i(["animate-spin pointer-events-none", c.value])
|
|
112
|
+
}, null, 8, ["class"])) : e.icon ? (o(), d(g, {
|
|
111
113
|
key: 1,
|
|
112
114
|
icon: e.icon,
|
|
113
|
-
class: i(["pointer-events-none", [e.iconClass,
|
|
114
|
-
}, null, 8, ["icon", "class"])) :
|
|
115
|
-
e.textClass ? (
|
|
115
|
+
class: i(["pointer-events-none", [e.iconClass, c.value, a.value ? "mx-auto" : ""]])
|
|
116
|
+
}, null, 8, ["icon", "class"])) : m("", !0),
|
|
117
|
+
e.textClass ? (o(), h("span", {
|
|
116
118
|
key: 2,
|
|
117
119
|
class: i(e.textClass)
|
|
118
120
|
}, [
|
|
119
|
-
|
|
120
|
-
|
|
121
|
+
f(t.$slots, "default", {}, () => [
|
|
122
|
+
x(b(l.value), 1)
|
|
121
123
|
])
|
|
122
|
-
], 2)) :
|
|
123
|
-
|
|
124
|
+
], 2)) : f(t.$slots, "default", { key: 3 }, () => [
|
|
125
|
+
x(b(l.value), 1)
|
|
124
126
|
]),
|
|
125
|
-
e.iconRight && !e.loading ? (
|
|
127
|
+
e.iconRight && !e.loading ? (o(), d(g, {
|
|
126
128
|
key: 4,
|
|
127
129
|
icon: e.iconRight,
|
|
128
|
-
class: i([[e.iconRightClass,
|
|
129
|
-
}, null, 8, ["icon", "class"])) :
|
|
130
|
-
], 10,
|
|
131
|
-
[
|
|
130
|
+
class: i([[e.iconRightClass, c.value], "h-4 w-4 pointer-events-none"])
|
|
131
|
+
}, null, 8, ["icon", "class"])) : m("", !0)
|
|
132
|
+
], 10, D)), [
|
|
133
|
+
[$(j)]
|
|
132
134
|
]);
|
|
133
135
|
}
|
|
134
136
|
});
|
|
135
137
|
export {
|
|
136
|
-
|
|
138
|
+
q as default
|
|
137
139
|
};
|