vlite3 0.4.4 → 0.4.7
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 +91 -88
- package/components/Form/types.d.ts +4 -0
- package/components/Form/utils/form.utils.js +104 -98
- 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 v, computed as s, openBlock as l, createElementBlock as f, createElementVNode as g, normalizeClass as d, createVNode as w, Transition as C, withCtx as h, createBlock as o, createCommentVNode as r, createTextVNode as V, toDisplayString as z } from "vue";
|
|
2
|
+
import p from "./Icon.vue.js";
|
|
3
|
+
import B from "./Label.vue.js";
|
|
4
|
+
import { $t as N } from "../utils/i18n.js";
|
|
5
|
+
const _ = { class: "flex items-center space-x-2" }, j = ["aria-checked", "data-state", "disabled", "id"], I = {
|
|
5
6
|
key: 0,
|
|
6
7
|
class: "flex items-center justify-center text-current w-full h-full"
|
|
7
|
-
},
|
|
8
|
+
}, L = /* @__PURE__ */ v({
|
|
8
9
|
__name: "CheckBox",
|
|
9
10
|
props: {
|
|
10
11
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -12,30 +13,31 @@ const B = { class: "flex items-center space-x-2" }, N = ["aria-checked", "data-s
|
|
|
12
13
|
disabled: { type: Boolean, default: !1 },
|
|
13
14
|
indeterminate: { type: Boolean, default: !1 },
|
|
14
15
|
label: {},
|
|
16
|
+
labelI18n: {},
|
|
15
17
|
id: {},
|
|
16
18
|
class: { default: "" },
|
|
17
19
|
size: { default: "md" },
|
|
18
20
|
rounded: {}
|
|
19
21
|
},
|
|
20
22
|
emits: ["update:modelValue", "update:checked"],
|
|
21
|
-
setup(t, { emit:
|
|
22
|
-
const e = t,
|
|
23
|
+
setup(t, { emit: b }) {
|
|
24
|
+
const e = t, c = b, u = s(() => e.labelI18n ? N(e.labelI18n) : e.label), m = () => {
|
|
23
25
|
if (e.disabled) return;
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
},
|
|
26
|
+
const i = !(e.modelValue || e.checked);
|
|
27
|
+
c("update:modelValue", i), c("update:checked", i);
|
|
28
|
+
}, k = {
|
|
27
29
|
xs: "h-3.5 w-3.5",
|
|
28
30
|
sm: "h-4 w-4",
|
|
29
31
|
md: "h-4.5 w-4.5",
|
|
30
32
|
lg: "h-5 w-5",
|
|
31
33
|
xl: "h-5.5 w-5.5"
|
|
32
|
-
},
|
|
34
|
+
}, n = {
|
|
33
35
|
xs: "h-2.5 w-2.5",
|
|
34
36
|
sm: "h-3 w-3",
|
|
35
37
|
md: "h-3.5 w-3.5",
|
|
36
38
|
lg: "h-4 w-4",
|
|
37
39
|
xl: "h-5 w-5"
|
|
38
|
-
},
|
|
40
|
+
}, x = {
|
|
39
41
|
none: "rounded-none",
|
|
40
42
|
xs: "rounded-[3px]",
|
|
41
43
|
sm: "rounded-[4px]",
|
|
@@ -44,36 +46,34 @@ const B = { class: "flex items-center space-x-2" }, N = ["aria-checked", "data-s
|
|
|
44
46
|
xl: "rounded-lg",
|
|
45
47
|
"2xl": "rounded-xl",
|
|
46
48
|
full: "rounded-full"
|
|
47
|
-
},
|
|
49
|
+
}, y = s(() => [
|
|
48
50
|
"peer shrink-0 border border-primary transition-all duration-200 ease-in-out",
|
|
49
51
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",
|
|
50
|
-
// Kept ring for accessibility visibility on small elements
|
|
51
52
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
52
53
|
"data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
|
|
53
54
|
"data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground",
|
|
54
55
|
"cursor-pointer bg-transparent",
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
p[e.rounded || e.size],
|
|
56
|
+
k[e.size],
|
|
57
|
+
x[e.rounded || e.size],
|
|
58
58
|
e.class
|
|
59
|
-
].join(" ")), a =
|
|
60
|
-
return
|
|
59
|
+
].join(" ")), a = s(() => e.indeterminate ? "indeterminate" : e.modelValue || e.checked ? "checked" : "unchecked");
|
|
60
|
+
return s(() => [
|
|
61
61
|
"transition-transform duration-200",
|
|
62
62
|
a.value === "checked" || a.value === "indeterminate" ? "scale-100" : "scale-0",
|
|
63
|
-
|
|
64
|
-
].join(" ")), (
|
|
65
|
-
|
|
63
|
+
n[e.size]
|
|
64
|
+
].join(" ")), (i, $) => (l(), f("div", _, [
|
|
65
|
+
g("button", {
|
|
66
66
|
type: "button",
|
|
67
67
|
role: "checkbox",
|
|
68
68
|
"aria-checked": t.indeterminate ? "mixed" : t.modelValue,
|
|
69
69
|
"data-state": a.value,
|
|
70
70
|
disabled: t.disabled,
|
|
71
|
-
class:
|
|
71
|
+
class: d(y.value),
|
|
72
72
|
id: t.id,
|
|
73
|
-
onClick:
|
|
73
|
+
onClick: m
|
|
74
74
|
}, [
|
|
75
|
-
a.value === "checked" || a.value === "indeterminate" ? (l(),
|
|
76
|
-
|
|
75
|
+
a.value === "checked" || a.value === "indeterminate" ? (l(), f("div", I, [
|
|
76
|
+
w(C, {
|
|
77
77
|
"enter-active-class": "transition duration-200 ease-out",
|
|
78
78
|
"enter-from-class": "scale-50 opacity-0",
|
|
79
79
|
"enter-to-class": "scale-100 opacity-100",
|
|
@@ -81,35 +81,35 @@ const B = { class: "flex items-center space-x-2" }, N = ["aria-checked", "data-s
|
|
|
81
81
|
"leave-from-class": "scale-100 opacity-100",
|
|
82
82
|
"leave-to-class": "scale-50 opacity-0"
|
|
83
83
|
}, {
|
|
84
|
-
default:
|
|
85
|
-
a.value === "checked" ? (l(), o(
|
|
84
|
+
default: h(() => [
|
|
85
|
+
a.value === "checked" ? (l(), o(p, {
|
|
86
86
|
key: 0,
|
|
87
87
|
icon: "lucide:check",
|
|
88
|
-
class:
|
|
89
|
-
}, null, 8, ["class"])) : a.value === "indeterminate" ? (l(), o(
|
|
88
|
+
class: d(n[t.size])
|
|
89
|
+
}, null, 8, ["class"])) : a.value === "indeterminate" ? (l(), o(p, {
|
|
90
90
|
key: 1,
|
|
91
91
|
icon: "lucide:minus",
|
|
92
|
-
class:
|
|
93
|
-
}, null, 8, ["class"])) :
|
|
92
|
+
class: d(n[t.size])
|
|
93
|
+
}, null, 8, ["class"])) : r("", !0)
|
|
94
94
|
]),
|
|
95
95
|
_: 1
|
|
96
96
|
})
|
|
97
|
-
])) :
|
|
98
|
-
], 10,
|
|
99
|
-
|
|
97
|
+
])) : r("", !0)
|
|
98
|
+
], 10, j),
|
|
99
|
+
u.value ? (l(), o(B, {
|
|
100
100
|
key: 0,
|
|
101
101
|
for: t.id,
|
|
102
102
|
class: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",
|
|
103
|
-
onClick:
|
|
103
|
+
onClick: m
|
|
104
104
|
}, {
|
|
105
|
-
default:
|
|
106
|
-
|
|
105
|
+
default: h(() => [
|
|
106
|
+
V(z(u.value), 1)
|
|
107
107
|
]),
|
|
108
108
|
_: 1
|
|
109
|
-
}, 8, ["for"])) :
|
|
109
|
+
}, 8, ["for"])) : r("", !0)
|
|
110
110
|
]));
|
|
111
111
|
}
|
|
112
112
|
});
|
|
113
113
|
export {
|
|
114
|
-
|
|
114
|
+
L as default
|
|
115
115
|
};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as C, computed as s, openBlock as o, createElementBlock as u, normalizeClass as i, renderSlot as d, createBlock as f, createCommentVNode as c, createTextVNode as z, toDisplayString as B, withCtx as D, createVNode as I } from "vue";
|
|
2
|
+
import b from "../Icon.vue.js";
|
|
3
3
|
import S from "../Button.vue.js";
|
|
4
|
-
|
|
4
|
+
import { $t as N } from "../../utils/i18n.js";
|
|
5
|
+
const V = ["role", "tabindex"], j = {
|
|
5
6
|
key: 0,
|
|
6
7
|
class: "truncate"
|
|
7
|
-
},
|
|
8
|
+
}, E = "inline-flex items-center justify-center font-medium rounded-full transition-all duration-200 border box-border whitespace-nowrap focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-primary", q = /* @__PURE__ */ C({
|
|
8
9
|
__name: "Chip",
|
|
9
10
|
props: {
|
|
10
11
|
text: { default: "" },
|
|
12
|
+
textI18n: {},
|
|
11
13
|
icon: {},
|
|
12
14
|
variant: { default: "subtle" },
|
|
13
15
|
size: { default: "medium" },
|
|
@@ -17,15 +19,15 @@ const N = ["role", "tabindex"], V = {
|
|
|
17
19
|
class: { default: "" }
|
|
18
20
|
},
|
|
19
21
|
emits: ["click", "delete"],
|
|
20
|
-
setup(
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
switch (
|
|
22
|
+
setup(r, { emit: v }) {
|
|
23
|
+
const e = r, n = v, l = s(() => e.textI18n ? N(e.textI18n) : e.text), a = s(() => e.clickable && !e.disabled), g = (t) => {
|
|
24
|
+
e.disabled || e.clickable && n("click", t);
|
|
25
|
+
}, m = (t) => {
|
|
26
|
+
e.disabled || (t.stopPropagation(), n("delete", t));
|
|
27
|
+
}, h = (t) => {
|
|
28
|
+
e.disabled || !e.clickable && !e.deletable || ((t.key === "Enter" || t.key === " ") && (t.preventDefault(), e.clickable && n("click", t)), (t.key === "Backspace" || t.key === "Delete") && e.deletable && (t.preventDefault(), n("delete", t)));
|
|
29
|
+
}, p = s(() => {
|
|
30
|
+
switch (e.size) {
|
|
29
31
|
case "small":
|
|
30
32
|
return "h-5 text-[10px] px-1.5 gap-1";
|
|
31
33
|
case "large":
|
|
@@ -34,24 +36,22 @@ const N = ["role", "tabindex"], V = {
|
|
|
34
36
|
return "h-6 text-xs px-2.5 gap-1.5";
|
|
35
37
|
}
|
|
36
38
|
}), x = s(() => {
|
|
37
|
-
if (
|
|
39
|
+
if (e.disabled)
|
|
38
40
|
return "bg-muted text-muted-foreground border-transparent opacity-50 cursor-not-allowed";
|
|
39
|
-
const
|
|
41
|
+
const t = a.value ? "cursor-pointer hover:shadow-sm active:scale-[0.98]" : "cursor-default";
|
|
40
42
|
return `${{
|
|
41
|
-
solid: `bg-primary text-primary-fg border-transparent ${
|
|
42
|
-
outline: `bg-transparent border-input text-foreground ${
|
|
43
|
-
ghost: `bg-transparent border-transparent text-muted-foreground ${
|
|
44
|
-
subtle: `bg-accent/50 text-foreground border-transparent ${
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}), p = s(() => [j, h.value, x.value, t.class].join(" ")), k = s(() => {
|
|
54
|
-
switch (t.size) {
|
|
43
|
+
solid: `bg-primary text-primary-fg border-transparent ${a.value ? "hover:bg-primary/90" : ""}`,
|
|
44
|
+
outline: `bg-transparent border-input text-foreground ${a.value ? "hover:bg-accent hover:text-accent-foreground" : ""}`,
|
|
45
|
+
ghost: `bg-transparent border-transparent text-muted-foreground ${a.value ? "hover:bg-accent hover:text-accent-foreground" : ""}`,
|
|
46
|
+
subtle: `bg-accent/50 text-foreground border-transparent ${a.value ? "hover:bg-accent" : ""}`,
|
|
47
|
+
secondary: `bg-secondary text-secondary-foreground border-transparent ${a.value ? "hover:bg-secondary/80" : ""}`,
|
|
48
|
+
success: `bg-success text-success-fg border-transparent ${a.value ? "hover:bg-success/80" : ""}`,
|
|
49
|
+
warning: `bg-warning text-warning-fg border-transparent ${a.value ? "hover:bg-warning/80" : ""}`,
|
|
50
|
+
danger: `bg-destructive text-destructive-foreground border-transparent ${a.value ? "hover:bg-destructive/90" : ""}`,
|
|
51
|
+
info: `bg-info text-info-fg border-transparent ${a.value ? "hover:bg-info/80" : ""}`
|
|
52
|
+
}[e.variant]} ${t}`;
|
|
53
|
+
}), k = s(() => [E, p.value, x.value, e.class].join(" ")), y = s(() => {
|
|
54
|
+
switch (e.size) {
|
|
55
55
|
case "small":
|
|
56
56
|
return "h-3 w-3";
|
|
57
57
|
case "large":
|
|
@@ -59,8 +59,8 @@ const N = ["role", "tabindex"], V = {
|
|
|
59
59
|
default:
|
|
60
60
|
return "h-3.5 w-3.5";
|
|
61
61
|
}
|
|
62
|
-
}),
|
|
63
|
-
switch (
|
|
62
|
+
}), w = s(() => {
|
|
63
|
+
switch (e.size) {
|
|
64
64
|
case "small":
|
|
65
65
|
return "h-2.5 w-2.5";
|
|
66
66
|
case "large":
|
|
@@ -69,45 +69,45 @@ const N = ["role", "tabindex"], V = {
|
|
|
69
69
|
return "h-3 w-3";
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
|
-
return (
|
|
73
|
-
class:
|
|
74
|
-
role:
|
|
75
|
-
tabindex:
|
|
72
|
+
return (t, $) => (o(), u("div", {
|
|
73
|
+
class: i(k.value),
|
|
74
|
+
role: r.clickable ? "button" : "status",
|
|
75
|
+
tabindex: a.value || r.deletable ? 0 : void 0,
|
|
76
76
|
onClick: g,
|
|
77
|
-
onKeydown:
|
|
77
|
+
onKeydown: h
|
|
78
78
|
}, [
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
d(t.$slots, "icon", {}, () => [
|
|
80
|
+
r.icon ? (o(), f(b, {
|
|
81
81
|
key: 0,
|
|
82
|
-
icon:
|
|
83
|
-
class:
|
|
84
|
-
}, null, 8, ["icon", "class"])) :
|
|
82
|
+
icon: r.icon,
|
|
83
|
+
class: i([y.value, "shrink-0", l.value ? "-ml-0.5" : ""])
|
|
84
|
+
}, null, 8, ["icon", "class"])) : c("", !0)
|
|
85
85
|
]),
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
l.value || t.$slots.default ? (o(), u("span", j, [
|
|
87
|
+
d(t.$slots, "default", {}, () => [
|
|
88
|
+
z(B(l.value), 1)
|
|
89
89
|
])
|
|
90
|
-
])) :
|
|
91
|
-
|
|
90
|
+
])) : c("", !0),
|
|
91
|
+
r.deletable ? (o(), f(S, {
|
|
92
92
|
key: 1,
|
|
93
93
|
variant: "ghost",
|
|
94
94
|
size: "xs",
|
|
95
95
|
rounded: "full",
|
|
96
|
-
disabled:
|
|
97
|
-
class:
|
|
98
|
-
onClick:
|
|
96
|
+
disabled: r.disabled,
|
|
97
|
+
class: i(["ml-auto p-0.5! h-auto! w-auto! hover:bg-[#8282823c]", [l.value ? r.size === "small" ? "-mr-0.5" : "-mr-1" : ""]]),
|
|
98
|
+
onClick: m
|
|
99
99
|
}, {
|
|
100
|
-
default:
|
|
101
|
-
|
|
100
|
+
default: D(() => [
|
|
101
|
+
I(b, {
|
|
102
102
|
icon: "lucide:x",
|
|
103
|
-
class:
|
|
103
|
+
class: i(w.value)
|
|
104
104
|
}, null, 8, ["class"])
|
|
105
105
|
]),
|
|
106
106
|
_: 1
|
|
107
|
-
}, 8, ["disabled", "class"])) :
|
|
108
|
-
], 42,
|
|
107
|
+
}, 8, ["disabled", "class"])) : c("", !0)
|
|
108
|
+
], 42, V));
|
|
109
109
|
}
|
|
110
110
|
});
|
|
111
111
|
export {
|
|
112
|
-
|
|
112
|
+
q as default
|
|
113
113
|
};
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
export interface ChoiceBoxOption {
|
|
2
2
|
id: string | number;
|
|
3
3
|
title: string;
|
|
4
|
+
titleI18n?: string;
|
|
4
5
|
description?: string;
|
|
6
|
+
descriptionI18n?: string;
|
|
5
7
|
icon?: string;
|
|
6
8
|
disabled?: boolean;
|
|
7
9
|
badge?: string;
|
|
10
|
+
badgeI18n?: string;
|
|
8
11
|
}
|
|
9
12
|
interface Props {
|
|
10
13
|
modelValue?: string | number | (string | number)[] | null;
|
|
11
14
|
options: ChoiceBoxOption[];
|
|
12
15
|
multiple?: boolean;
|
|
13
16
|
title?: string;
|
|
17
|
+
titleI18n?: string;
|
|
14
18
|
description?: string;
|
|
19
|
+
descriptionI18n?: string;
|
|
15
20
|
disabled?: boolean;
|
|
16
21
|
grid?: number;
|
|
17
22
|
gap?: number;
|
|
@@ -1,48 +1,51 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { defineComponent as O, computed as m, openBlock as r, createElementBlock as i, toDisplayString as c, createCommentVNode as n, createElementVNode as a, normalizeClass as o, Fragment as A, renderList as $, withKeys as D, withModifiers as K, createVNode as N, createBlock as v } from "vue";
|
|
2
|
+
import y from "../Icon.vue.js";
|
|
3
|
+
import { $t as u } from "../../utils/i18n.js";
|
|
4
|
+
const E = { class: "w-full" }, S = {
|
|
4
5
|
key: 0,
|
|
5
6
|
class: "mb-4"
|
|
6
|
-
},
|
|
7
|
+
}, T = {
|
|
7
8
|
key: 0,
|
|
8
9
|
class: "text-base font-semibold text-foreground"
|
|
9
|
-
},
|
|
10
|
+
}, j = {
|
|
10
11
|
key: 1,
|
|
11
12
|
class: "text-sm text-muted-foreground mt-1"
|
|
12
|
-
},
|
|
13
|
+
}, q = ["onClick", "onKeydown"], z = { class: "flex flex-1 gap-3" }, F = {
|
|
13
14
|
key: 0,
|
|
14
15
|
class: "shrink-0 pt-0.5"
|
|
15
|
-
},
|
|
16
|
+
}, L = { class: "flex flex-col" }, M = { class: "flex items-center gap-2" }, G = {
|
|
16
17
|
key: 0,
|
|
17
18
|
class: "mt-1 -text-fs-3 text-muted leading-relaxed"
|
|
18
|
-
},
|
|
19
|
+
}, H = {
|
|
19
20
|
key: 0,
|
|
20
21
|
class: "absolute top-4 right-4 text-primary"
|
|
21
|
-
},
|
|
22
|
+
}, R = /* @__PURE__ */ O({
|
|
22
23
|
__name: "ChoiceBox",
|
|
23
24
|
props: {
|
|
24
25
|
modelValue: { default: void 0 },
|
|
25
26
|
options: {},
|
|
26
27
|
multiple: { type: Boolean, default: !1 },
|
|
27
28
|
title: {},
|
|
29
|
+
titleI18n: {},
|
|
28
30
|
description: {},
|
|
31
|
+
descriptionI18n: {},
|
|
29
32
|
disabled: { type: Boolean, default: !1 },
|
|
30
33
|
grid: { default: 1 },
|
|
31
34
|
gap: { default: 4 }
|
|
32
35
|
},
|
|
33
36
|
emits: ["update:modelValue", "change"],
|
|
34
|
-
setup(
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
37
|
+
setup(g, { emit: _ }) {
|
|
38
|
+
const s = g, x = _, f = m(() => s.titleI18n ? u(s.titleI18n) : s.title), p = m(() => s.descriptionI18n ? u(s.descriptionI18n) : s.description), k = (t) => t.titleI18n ? u(t.titleI18n) : t.title, I = (t) => t.descriptionI18n ? u(t.descriptionI18n) : t.description, w = (t) => t.badgeI18n ? u(t.badgeI18n) : t.badge, d = (t) => Array.isArray(s.modelValue) ? s.modelValue.includes(t) : s.modelValue === t, b = (t) => {
|
|
39
|
+
if (s.disabled || s.options.find((l) => l.id === t)?.disabled) return;
|
|
37
40
|
let e;
|
|
38
|
-
if (
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
+
if (s.multiple) {
|
|
42
|
+
const l = Array.isArray(s.modelValue) ? [...s.modelValue] : [], h = l.indexOf(t);
|
|
43
|
+
h === -1 ? l.push(t) : l.splice(h, 1), e = l;
|
|
41
44
|
} else
|
|
42
|
-
e =
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
switch (
|
|
45
|
+
e = t;
|
|
46
|
+
x("update:modelValue", e), x("change", e);
|
|
47
|
+
}, V = m(() => {
|
|
48
|
+
switch (s.grid) {
|
|
46
49
|
case 1:
|
|
47
50
|
return "grid-cols-1";
|
|
48
51
|
case 2:
|
|
@@ -54,8 +57,8 @@ const K = { class: "w-full" }, N = {
|
|
|
54
57
|
default:
|
|
55
58
|
return "grid-cols-1";
|
|
56
59
|
}
|
|
57
|
-
}),
|
|
58
|
-
switch (
|
|
60
|
+
}), C = m(() => {
|
|
61
|
+
switch (s.gap) {
|
|
59
62
|
case 2:
|
|
60
63
|
return "gap-2";
|
|
61
64
|
case 3:
|
|
@@ -70,72 +73,72 @@ const K = { class: "w-full" }, N = {
|
|
|
70
73
|
return "gap-4";
|
|
71
74
|
}
|
|
72
75
|
});
|
|
73
|
-
return (
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
])) :
|
|
78
|
-
|
|
79
|
-
class:
|
|
76
|
+
return (t, B) => (r(), i("div", E, [
|
|
77
|
+
f.value || p.value ? (r(), i("div", S, [
|
|
78
|
+
f.value ? (r(), i("h3", T, c(f.value), 1)) : n("", !0),
|
|
79
|
+
p.value ? (r(), i("p", j, c(p.value), 1)) : n("", !0)
|
|
80
|
+
])) : n("", !0),
|
|
81
|
+
a("div", {
|
|
82
|
+
class: o(["grid", [V.value, C.value]])
|
|
80
83
|
}, [
|
|
81
|
-
(
|
|
84
|
+
(r(!0), i(A, null, $(g.options, (e) => (r(), i("div", {
|
|
82
85
|
key: e.id,
|
|
83
|
-
class:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
class: o(["relative flex cursor-pointer rounded-xl border border-border p-4 transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2", [
|
|
87
|
+
d(e.id) ? "border-primary bg-accent" : "bg-card hover:border-primary/50 hover:bg-accent",
|
|
88
|
+
g.disabled || e.disabled ? "opacity-50 cursor-not-allowed grayscale" : ""
|
|
86
89
|
]]),
|
|
87
|
-
onClick: (
|
|
90
|
+
onClick: (l) => b(e.id),
|
|
88
91
|
tabindex: "0",
|
|
89
|
-
onKeydown:
|
|
92
|
+
onKeydown: D(K((l) => b(e.id), ["prevent"]), ["enter", "space"])
|
|
90
93
|
}, [
|
|
91
|
-
|
|
92
|
-
e.icon ? (
|
|
93
|
-
|
|
94
|
-
class:
|
|
94
|
+
a("div", z, [
|
|
95
|
+
e.icon ? (r(), i("div", F, [
|
|
96
|
+
a("div", {
|
|
97
|
+
class: o([
|
|
95
98
|
"flex h-10 w-10 items-center justify-center rounded-full transition-colors",
|
|
96
|
-
|
|
99
|
+
d(e.id) ? "bg-primary/10 text-primary" : "bg-muted text-muted-foreground"
|
|
97
100
|
])
|
|
98
101
|
}, [
|
|
99
|
-
|
|
102
|
+
N(y, {
|
|
100
103
|
icon: e.icon,
|
|
101
104
|
class: "h-5 w-5"
|
|
102
105
|
}, null, 8, ["icon"])
|
|
103
106
|
], 2)
|
|
104
|
-
])) :
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
class:
|
|
109
|
-
"text-primary":
|
|
107
|
+
])) : n("", !0),
|
|
108
|
+
a("div", L, [
|
|
109
|
+
a("div", M, [
|
|
110
|
+
a("span", {
|
|
111
|
+
class: o(["font-semibold text-foreground text-fs-1", {
|
|
112
|
+
"text-primary": d(e.id)
|
|
110
113
|
}])
|
|
111
|
-
},
|
|
112
|
-
e.badge ? (
|
|
114
|
+
}, c(k(e)), 3),
|
|
115
|
+
e.badge || e.badgeI18n ? (r(), i("span", {
|
|
113
116
|
key: 0,
|
|
114
|
-
class:
|
|
117
|
+
class: o([
|
|
115
118
|
"inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium",
|
|
116
|
-
|
|
119
|
+
d(e.id) ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground"
|
|
117
120
|
])
|
|
118
|
-
},
|
|
121
|
+
}, c(w(e)), 3)) : n("", !0)
|
|
119
122
|
]),
|
|
120
|
-
e.description ? (
|
|
123
|
+
e.description || e.descriptionI18n ? (r(), i("span", G, c(I(e)), 1)) : n("", !0)
|
|
121
124
|
])
|
|
122
125
|
]),
|
|
123
|
-
|
|
124
|
-
|
|
126
|
+
d(e.id) ? (r(), i("div", H, [
|
|
127
|
+
g.multiple ? (r(), v(y, {
|
|
125
128
|
key: 0,
|
|
126
129
|
icon: "lucide:check-square",
|
|
127
130
|
class: "h-5 w-5"
|
|
128
|
-
})) : (
|
|
131
|
+
})) : (r(), v(y, {
|
|
129
132
|
key: 1,
|
|
130
133
|
icon: "lucide:check-circle-2",
|
|
131
134
|
class: "h-5 w-5"
|
|
132
135
|
}))
|
|
133
|
-
])) :
|
|
134
|
-
], 42,
|
|
136
|
+
])) : n("", !0)
|
|
137
|
+
], 42, q))), 128))
|
|
135
138
|
], 2)
|
|
136
139
|
]));
|
|
137
140
|
}
|
|
138
141
|
});
|
|
139
142
|
export {
|
|
140
|
-
|
|
143
|
+
R as default
|
|
141
144
|
};
|
|
@@ -2,6 +2,7 @@ import { defineComponent as z, ref as p, watch as i, openBlock as a, createBlock
|
|
|
2
2
|
import B from "../Dropdown/Dropdown.vue.js";
|
|
3
3
|
import "@iconify/vue";
|
|
4
4
|
import O from "../Input.vue.js";
|
|
5
|
+
import "../../core/config.js";
|
|
5
6
|
import y from "../Button.vue.js";
|
|
6
7
|
import E from "./ColorIro.vue.js";
|
|
7
8
|
/* empty css */
|
|
@@ -12,7 +13,7 @@ const I = {
|
|
|
12
13
|
}, N = {
|
|
13
14
|
key: 0,
|
|
14
15
|
class: "flex items-center gap-1.5 w-full"
|
|
15
|
-
}, D = { class: "w-32" },
|
|
16
|
+
}, D = { class: "w-32" }, J = /* @__PURE__ */ z({
|
|
16
17
|
__name: "ColorPicker",
|
|
17
18
|
props: {
|
|
18
19
|
modelValue: { default: "#000000" },
|
|
@@ -107,5 +108,5 @@ const I = {
|
|
|
107
108
|
}
|
|
108
109
|
});
|
|
109
110
|
export {
|
|
110
|
-
|
|
111
|
+
J as default
|
|
111
112
|
};
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
interface Props {
|
|
2
2
|
show?: boolean;
|
|
3
3
|
title: string;
|
|
4
|
+
titleI18n?: string;
|
|
4
5
|
description: string;
|
|
6
|
+
descriptionI18n?: string;
|
|
5
7
|
loading?: boolean;
|
|
6
8
|
confirmText?: string;
|
|
9
|
+
confirmTextI18n?: string;
|
|
7
10
|
cancelText?: string;
|
|
11
|
+
cancelTextI18n?: string;
|
|
8
12
|
variant?: 'danger' | 'primary' | 'warning' | 'success' | 'info';
|
|
9
13
|
}
|
|
10
14
|
declare function __VLS_template(): {
|
|
@@ -27,8 +31,6 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
|
|
|
27
31
|
variant: "danger" | "primary" | "warning" | "success" | "info";
|
|
28
32
|
loading: boolean;
|
|
29
33
|
show: boolean;
|
|
30
|
-
confirmText: string;
|
|
31
|
-
cancelText: string;
|
|
32
34
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
33
35
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
34
36
|
export default _default;
|