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,52 +1,59 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { defineComponent as V, computed as d, openBlock as t, createElementBlock as o, normalizeClass as n, renderSlot as s, createCommentVNode as u, createElementVNode as m, createVNode as b } from "vue";
|
|
2
|
+
import g from "../Input.vue.js";
|
|
3
|
+
import { $t as i } from "../../utils/i18n.js";
|
|
4
|
+
const w = {
|
|
4
5
|
key: 0,
|
|
5
6
|
class: "flex items-center gap-3 mr-auto"
|
|
6
|
-
},
|
|
7
|
+
}, $ = { class: "ml-auto" }, k = { class: "flex items-center gap-3" }, T = /* @__PURE__ */ V({
|
|
7
8
|
__name: "DataTableToolbar",
|
|
8
9
|
props: {
|
|
9
10
|
modelValue: { default: "" },
|
|
10
11
|
showSearch: { type: Boolean, default: !0 },
|
|
11
|
-
placeholder: {
|
|
12
|
+
placeholder: {},
|
|
13
|
+
placeholderI18n: {},
|
|
12
14
|
class: { default: "" },
|
|
13
15
|
searchClass: { default: "" }
|
|
14
16
|
},
|
|
15
17
|
emits: ["update:modelValue"],
|
|
16
|
-
setup(
|
|
17
|
-
const
|
|
18
|
-
get: () =>
|
|
19
|
-
set: (e) =>
|
|
18
|
+
setup(a, { emit: h }) {
|
|
19
|
+
const l = a, p = h, r = d({
|
|
20
|
+
get: () => l.modelValue,
|
|
21
|
+
set: (e) => p("update:modelValue", e)
|
|
22
|
+
}), f = d(() => {
|
|
23
|
+
if (l.placeholderI18n) return i(l.placeholderI18n);
|
|
24
|
+
if (l.placeholder) return l.placeholder;
|
|
25
|
+
const e = i("vlite.dataTable.searchPlaceholder");
|
|
26
|
+
return e !== "vlite.dataTable.searchPlaceholder" ? e : "Search...";
|
|
20
27
|
});
|
|
21
|
-
return (e, c) => (
|
|
22
|
-
class:
|
|
28
|
+
return (e, c) => (t(), o("div", {
|
|
29
|
+
class: n(["flex flex-col sm:flex-row items-center gap-4 p-1", l.class])
|
|
23
30
|
}, [
|
|
24
|
-
e.$slots?.left ? (
|
|
25
|
-
|
|
31
|
+
e.$slots?.left ? (t(), o("div", w, [
|
|
32
|
+
s(e.$slots, "left")
|
|
26
33
|
])) : u("", !0),
|
|
27
|
-
|
|
28
|
-
|
|
34
|
+
m("div", $, [
|
|
35
|
+
s(e.$slots, "delete")
|
|
29
36
|
]),
|
|
30
|
-
|
|
37
|
+
a.showSearch ? (t(), o("div", {
|
|
31
38
|
key: 1,
|
|
32
|
-
class:
|
|
39
|
+
class: n(["w-full sm:w-72!", a.searchClass])
|
|
33
40
|
}, [
|
|
34
|
-
|
|
41
|
+
b(g, {
|
|
35
42
|
modelValue: r.value,
|
|
36
|
-
"onUpdate:modelValue": c[0] || (c[0] = (
|
|
37
|
-
placeholder:
|
|
43
|
+
"onUpdate:modelValue": c[0] || (c[0] = (v) => r.value = v),
|
|
44
|
+
placeholder: f.value,
|
|
38
45
|
icon: "lucide:search",
|
|
39
46
|
variant: "outline",
|
|
40
47
|
class: "bg-background",
|
|
41
48
|
"show-clear-button": !0
|
|
42
49
|
}, null, 8, ["modelValue", "placeholder"])
|
|
43
50
|
], 2)) : u("", !0),
|
|
44
|
-
|
|
45
|
-
|
|
51
|
+
m("div", k, [
|
|
52
|
+
s(e.$slots, "right")
|
|
46
53
|
])
|
|
47
54
|
], 2));
|
|
48
55
|
}
|
|
49
56
|
});
|
|
50
57
|
export {
|
|
51
|
-
|
|
58
|
+
T as default
|
|
52
59
|
};
|
|
@@ -25,6 +25,7 @@ export interface TableFilter {
|
|
|
25
25
|
export interface TableHeader {
|
|
26
26
|
field: string;
|
|
27
27
|
title: string;
|
|
28
|
+
titleI18n?: string;
|
|
28
29
|
width?: string;
|
|
29
30
|
minWidth?: string;
|
|
30
31
|
sortable?: boolean;
|
|
@@ -42,6 +43,7 @@ export interface DataTableProps {
|
|
|
42
43
|
search?: string;
|
|
43
44
|
showSearch?: boolean;
|
|
44
45
|
searchPlaceholder?: string;
|
|
46
|
+
searchPlaceholderI18n?: string;
|
|
45
47
|
toolbarClass?: string;
|
|
46
48
|
toolbarSearchClass?: string;
|
|
47
49
|
headers: TableHeader[];
|
|
@@ -49,7 +51,9 @@ export interface DataTableProps {
|
|
|
49
51
|
loading?: boolean;
|
|
50
52
|
selectable?: boolean;
|
|
51
53
|
emptyTitle?: string;
|
|
54
|
+
emptyTitleI18n?: string;
|
|
52
55
|
emptyDescription?: string;
|
|
56
|
+
emptyDescriptionI18n?: string;
|
|
53
57
|
emptyIcon?: string;
|
|
54
58
|
showPagination?: boolean;
|
|
55
59
|
paginationProps?: DataTablePaginationProps;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as P, computed as n, openBlock as f, createBlock as v, unref as o, withCtx as r, createElementVNode as k, createVNode as m, renderSlot as w, mergeProps as h } from "vue";
|
|
2
2
|
import b from "./Button.vue.js";
|
|
3
|
-
import
|
|
3
|
+
import I from "./Dropdown/Dropdown.vue.js";
|
|
4
4
|
import "@iconify/vue";
|
|
5
|
-
import
|
|
5
|
+
import { $t as y } from "../utils/i18n.js";
|
|
6
|
+
import V, { TimePicker as z } from "v-datepicker-lite";
|
|
6
7
|
import "v-datepicker-lite/style.css";
|
|
7
|
-
const
|
|
8
|
+
const S = { class: "overflow-hidden min-w-[300px]" }, H = /* @__PURE__ */ P({
|
|
8
9
|
__name: "DatePicker",
|
|
9
10
|
props: {
|
|
10
11
|
placeholder: {},
|
|
12
|
+
placeholderI18n: {},
|
|
11
13
|
modelValue: {},
|
|
12
14
|
value: {},
|
|
13
15
|
mode: {},
|
|
@@ -25,19 +27,19 @@ const z = { class: "overflow-hidden min-w-[300px]" }, $ = /* @__PURE__ */ g({
|
|
|
25
27
|
readonly: { type: Boolean }
|
|
26
28
|
},
|
|
27
29
|
emits: ["update:modelValue", "change"],
|
|
28
|
-
setup(e, { emit:
|
|
29
|
-
const l = e,
|
|
30
|
+
setup(e, { emit: x }) {
|
|
31
|
+
const l = e, u = x, a = n({
|
|
30
32
|
get: () => l.modelValue ?? l.value,
|
|
31
33
|
set: (t) => {
|
|
32
|
-
|
|
34
|
+
u("update:modelValue", t), u("change", t);
|
|
33
35
|
}
|
|
34
|
-
}),
|
|
36
|
+
}), g = (t) => t instanceof Date ? t.getHours() !== 0 || t.getMinutes() !== 0 : typeof t == "string" ? t.includes("T") || /\d{2}:\d{2}/.test(t) : !1, i = n(() => {
|
|
35
37
|
if (!a.value) return "";
|
|
36
38
|
if (l.mode === "time") return a.value;
|
|
37
39
|
try {
|
|
38
40
|
const t = new Date(a.value);
|
|
39
41
|
if (isNaN(t.getTime())) return String(a.value);
|
|
40
|
-
const d = l.mode === "dateTime" &&
|
|
42
|
+
const d = l.mode === "dateTime" && g(a.value);
|
|
41
43
|
return t.toLocaleDateString("en-US", {
|
|
42
44
|
month: "short",
|
|
43
45
|
day: "numeric",
|
|
@@ -47,10 +49,15 @@ const z = { class: "overflow-hidden min-w-[300px]" }, $ = /* @__PURE__ */ g({
|
|
|
47
49
|
} catch {
|
|
48
50
|
return String(a.value);
|
|
49
51
|
}
|
|
50
|
-
}),
|
|
52
|
+
}), s = n(() => {
|
|
53
|
+
if (l.placeholderI18n) return y(l.placeholderI18n);
|
|
54
|
+
if (l.placeholder) return l.placeholder;
|
|
55
|
+
const t = y("vlite.datePicker.placeholder");
|
|
56
|
+
return t !== "vlite.datePicker.placeholder" ? t : "Select date";
|
|
57
|
+
}), c = (t) => {
|
|
51
58
|
a.value = t;
|
|
52
59
|
};
|
|
53
|
-
return (t, d) => e.mode !== "time" ? (
|
|
60
|
+
return (t, d) => e.mode !== "time" ? (f(), v(o(I), {
|
|
54
61
|
key: 0,
|
|
55
62
|
position: "bottom-start",
|
|
56
63
|
class: "w-full",
|
|
@@ -58,13 +65,13 @@ const z = { class: "overflow-hidden min-w-[300px]" }, $ = /* @__PURE__ */ g({
|
|
|
58
65
|
teleport: e.teleport,
|
|
59
66
|
disabled: e.disabled || e.readonly
|
|
60
67
|
}, {
|
|
61
|
-
trigger:
|
|
68
|
+
trigger: r(() => [
|
|
62
69
|
w(t.$slots, "default", {
|
|
63
70
|
value: a.value,
|
|
64
71
|
displayValue: i.value
|
|
65
72
|
}, () => [
|
|
66
|
-
|
|
67
|
-
text: i.value ||
|
|
73
|
+
m(b, h({
|
|
74
|
+
text: i.value || s.value,
|
|
68
75
|
variant: e.variant || "outline",
|
|
69
76
|
size: e.size || "md",
|
|
70
77
|
icon: e.icon || "lucide:calendar",
|
|
@@ -72,9 +79,9 @@ const z = { class: "overflow-hidden min-w-[300px]" }, $ = /* @__PURE__ */ g({
|
|
|
72
79
|
}, e.btnProps, { class: "w-full justify-start text-left font-normal" }), null, 16, ["text", "variant", "size", "icon", "disabled"])
|
|
73
80
|
])
|
|
74
81
|
]),
|
|
75
|
-
default:
|
|
76
|
-
|
|
77
|
-
|
|
82
|
+
default: r(() => [
|
|
83
|
+
k("div", S, [
|
|
84
|
+
m(o(V), {
|
|
78
85
|
value: a.value,
|
|
79
86
|
mode: e.mode,
|
|
80
87
|
"min-date": e.minDate,
|
|
@@ -85,17 +92,17 @@ const z = { class: "overflow-hidden min-w-[300px]" }, $ = /* @__PURE__ */ g({
|
|
|
85
92
|
"time-format": "12h",
|
|
86
93
|
disabled: e.disabled,
|
|
87
94
|
readonly: e.readonly,
|
|
88
|
-
onChange:
|
|
95
|
+
onChange: c
|
|
89
96
|
}, null, 8, ["value", "mode", "min-date", "max-date", "disabled-dates", "minuteInterval", "disabled", "readonly"])
|
|
90
97
|
])
|
|
91
98
|
]),
|
|
92
99
|
_: 3
|
|
93
|
-
}, 8, ["teleport", "disabled"])) : (
|
|
100
|
+
}, 8, ["teleport", "disabled"])) : (f(), v(o(z), {
|
|
94
101
|
key: 1,
|
|
95
102
|
"model-value": a.value,
|
|
96
103
|
"onUpdate:modelValue": [
|
|
97
|
-
d[0] || (d[0] = (
|
|
98
|
-
|
|
104
|
+
d[0] || (d[0] = (D) => a.value = D),
|
|
105
|
+
c
|
|
99
106
|
],
|
|
100
107
|
mode: e.mode,
|
|
101
108
|
"min-date": e.minDate,
|
|
@@ -107,9 +114,9 @@ const z = { class: "overflow-hidden min-w-[300px]" }, $ = /* @__PURE__ */ g({
|
|
|
107
114
|
disabled: e.disabled,
|
|
108
115
|
readonly: e.readonly
|
|
109
116
|
}, {
|
|
110
|
-
default:
|
|
111
|
-
|
|
112
|
-
text: i.value ||
|
|
117
|
+
default: r(() => [
|
|
118
|
+
m(b, h({
|
|
119
|
+
text: i.value || s.value,
|
|
113
120
|
variant: e.variant || "outline",
|
|
114
121
|
size: e.size || "md",
|
|
115
122
|
icon: e.icon || (e.mode === "time" ? "lucide:clock" : "lucide:calendar"),
|
|
@@ -121,5 +128,5 @@ const z = { class: "overflow-hidden min-w-[300px]" }, $ = /* @__PURE__ */ g({
|
|
|
121
128
|
}
|
|
122
129
|
});
|
|
123
130
|
export {
|
|
124
|
-
|
|
131
|
+
H as default
|
|
125
132
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { defineComponent as m, computed as d, openBlock as l, createElementBlock as u, withModifiers as p, normalizeClass as f, createElementVNode as a, createBlock as g, createCommentVNode as v, toDisplayString as h, createVNode as x } from "vue";
|
|
2
|
+
import y from "../Switch.vue.js";
|
|
3
|
+
import b from "../Icon.vue.js";
|
|
4
|
+
import { $t as k } from "../../utils/i18n.js";
|
|
5
|
+
const w = { class: "flex items-center gap-2 flex-1 min-w-0" }, B = { class: "truncate font-medium" }, D = /* @__PURE__ */ m({
|
|
5
6
|
__name: "DropdownBooleanItem",
|
|
6
7
|
props: {
|
|
7
8
|
option: {},
|
|
@@ -9,33 +10,33 @@ const k = { class: "flex items-center gap-2 flex-1 min-w-0" }, y = { class: "tru
|
|
|
9
10
|
focused: { type: Boolean }
|
|
10
11
|
},
|
|
11
12
|
emits: ["change"],
|
|
12
|
-
setup(e, { emit:
|
|
13
|
-
const
|
|
14
|
-
s("change",
|
|
13
|
+
setup(e, { emit: c }) {
|
|
14
|
+
const o = e, s = c, r = d(() => o.option.labelI18n ? k(o.option.labelI18n) : o.option.label), t = (n) => {
|
|
15
|
+
s("change", n, o.option);
|
|
15
16
|
};
|
|
16
|
-
return (
|
|
17
|
+
return (n, i) => (l(), u("div", {
|
|
17
18
|
"data-dropdown-item": "",
|
|
18
|
-
class:
|
|
19
|
+
class: f(["relative flex cursor-pointer select-none items-center justify-between rounded-sm px-2 py-1.5 text-sm outline-none transition-colors", [
|
|
19
20
|
e.focused ? "bg-accent text-accent-foreground" : "hover:bg-accent hover:text-accent-foreground"
|
|
20
21
|
]]),
|
|
21
|
-
onClick:
|
|
22
|
+
onClick: i[0] || (i[0] = p((C) => t(!e.value), ["stop"]))
|
|
22
23
|
}, [
|
|
23
|
-
|
|
24
|
-
e.option.icon ? (
|
|
24
|
+
a("div", w, [
|
|
25
|
+
e.option.icon ? (l(), g(b, {
|
|
25
26
|
key: 0,
|
|
26
27
|
icon: e.option.icon,
|
|
27
28
|
class: "h-4 w-4 shrink-0 opacity-70"
|
|
28
|
-
}, null, 8, ["icon"])) :
|
|
29
|
-
|
|
29
|
+
}, null, 8, ["icon"])) : v("", !0),
|
|
30
|
+
a("span", B, h(r.value), 1)
|
|
30
31
|
]),
|
|
31
|
-
|
|
32
|
+
x(y, {
|
|
32
33
|
"model-value": e.value,
|
|
33
34
|
class: "ml-3 shrink-0 scale-75 origin-right",
|
|
34
|
-
"onUpdate:modelValue":
|
|
35
|
+
"onUpdate:modelValue": t
|
|
35
36
|
}, null, 8, ["model-value"])
|
|
36
37
|
], 2));
|
|
37
38
|
}
|
|
38
39
|
});
|
|
39
40
|
export {
|
|
40
|
-
|
|
41
|
+
D as default
|
|
41
42
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as _, computed as C, openBlock as t, createElementBlock as c, normalizeStyle as $, Fragment as a, renderList as i, createElementVNode as m, normalizeClass as h, toDisplayString as w, createBlock as d, createCommentVNode as f, createVNode as B } from "vue";
|
|
2
|
+
import N from "../Icon.vue.js";
|
|
3
3
|
import y from "./DropdownItem.vue.js";
|
|
4
|
-
|
|
4
|
+
import { $t as S } from "../../utils/i18n.js";
|
|
5
|
+
const L = { class: "font-semibold text-sm text-foreground" }, V = { class: "flex flex-col space-y-1" }, z = {
|
|
5
6
|
key: 0,
|
|
6
7
|
class: "flex flex-col space-y-1 ml-3 pl-3 border-l border-border mt-0.5 mb-1.5"
|
|
7
|
-
},
|
|
8
|
+
}, A = {
|
|
8
9
|
key: 1,
|
|
9
10
|
class: "px-2 text-xs text-muted-foreground italic"
|
|
10
|
-
},
|
|
11
|
+
}, F = /* @__PURE__ */ _({
|
|
11
12
|
__name: "DropdownGroupedLayout",
|
|
12
13
|
props: {
|
|
13
14
|
options: { default: () => [] },
|
|
@@ -18,56 +19,56 @@ const N = { class: "font-semibold text-sm text-foreground" }, S = { class: "flex
|
|
|
18
19
|
headerClass: {}
|
|
19
20
|
},
|
|
20
21
|
emits: ["select", "mouseenter"],
|
|
21
|
-
setup(o, { emit:
|
|
22
|
-
const l = o, k =
|
|
22
|
+
setup(o, { emit: D }) {
|
|
23
|
+
const l = o, k = C(() => {
|
|
23
24
|
const e = l.columns;
|
|
24
25
|
return typeof e == "number" ? { gridTemplateColumns: `repeat(${e}, minmax(0, 1fr))` } : { gridTemplateColumns: e };
|
|
25
|
-
}), u = (e) => l.selected ? Array.isArray(l.selected) ? l.selected.includes(e.value) : typeof l.selected == "object" && l.selected !== null && e.key && e.key in l.selected ? l.selected[e.key] === e.value : l.selected === e.value : !1;
|
|
26
|
-
return (e,
|
|
26
|
+
}), u = (e) => l.selected ? Array.isArray(l.selected) ? l.selected.includes(e.value) : typeof l.selected == "object" && l.selected !== null && e.key && e.key in l.selected ? l.selected[e.key] === e.value : l.selected === e.value : !1, b = (e) => e.labelI18n ? S(e.labelI18n) : e.label;
|
|
27
|
+
return (e, E) => (t(), c("div", {
|
|
27
28
|
class: "grid gap-6 p-4",
|
|
28
|
-
style:
|
|
29
|
+
style: $(k.value)
|
|
29
30
|
}, [
|
|
30
|
-
(t(!0),
|
|
31
|
+
(t(!0), c(a, null, i(o.options, (s, p) => (t(), c("div", {
|
|
31
32
|
key: s.key || s.value || p,
|
|
32
33
|
class: "flex flex-col space-y-2 min-w-[150px]"
|
|
33
34
|
}, [
|
|
34
35
|
m("div", {
|
|
35
|
-
class:
|
|
36
|
+
class: h(["flex items-center gap-2 px-2 py-1 mb-1", o.headerClass])
|
|
36
37
|
}, [
|
|
37
|
-
m("span",
|
|
38
|
-
s.icon ? (t(), d(
|
|
38
|
+
m("span", L, w(b(s)), 1),
|
|
39
|
+
s.icon ? (t(), d(N, {
|
|
39
40
|
key: 0,
|
|
40
41
|
icon: s.icon,
|
|
41
42
|
class: "w-4 h-4 text-muted-foreground"
|
|
42
43
|
}, null, 8, ["icon"])) : f("", !0)
|
|
43
44
|
], 2),
|
|
44
|
-
m("div",
|
|
45
|
-
s.children && s.children.length ? (t(!0),
|
|
46
|
-
key:
|
|
45
|
+
m("div", V, [
|
|
46
|
+
s.children && s.children.length ? (t(!0), c(a, { key: 0 }, i(s.children, (n, x) => (t(), c(a, {
|
|
47
|
+
key: n.key || n.value || x
|
|
47
48
|
}, [
|
|
48
|
-
|
|
49
|
-
option:
|
|
50
|
-
selected: u(
|
|
49
|
+
B(y, {
|
|
50
|
+
option: n,
|
|
51
|
+
selected: u(n),
|
|
51
52
|
selectable: o.selectable,
|
|
52
53
|
class: "w-full",
|
|
53
|
-
onClick: (r) => e.$emit("select",
|
|
54
|
+
onClick: (r) => e.$emit("select", n)
|
|
54
55
|
}, null, 8, ["option", "selected", "selectable", "onClick"]),
|
|
55
|
-
|
|
56
|
-
(t(!0),
|
|
57
|
-
key: r.key || r.value ||
|
|
56
|
+
n.children && n.children.length ? (t(), c("div", z, [
|
|
57
|
+
(t(!0), c(a, null, i(n.children, (r, v) => (t(), d(y, {
|
|
58
|
+
key: r.key || r.value || v,
|
|
58
59
|
option: r,
|
|
59
60
|
selected: u(r),
|
|
60
61
|
selectable: o.selectable,
|
|
61
62
|
class: "w-full text-xs",
|
|
62
|
-
onClick: (
|
|
63
|
+
onClick: (G) => e.$emit("select", r)
|
|
63
64
|
}, null, 8, ["option", "selected", "selectable", "onClick"]))), 128))
|
|
64
65
|
])) : f("", !0)
|
|
65
|
-
], 64))), 128)) : (t(),
|
|
66
|
+
], 64))), 128)) : (t(), c("div", A, "No items"))
|
|
66
67
|
])
|
|
67
68
|
]))), 128))
|
|
68
69
|
], 4));
|
|
69
70
|
}
|
|
70
71
|
});
|
|
71
72
|
export {
|
|
72
|
-
|
|
73
|
+
F as default
|
|
73
74
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { defineComponent as k, computed as l, openBlock as o, createElementBlock as s, normalizeClass as h, renderSlot as g, normalizeProps as w, guardReactiveProps as I, createBlock as p, createCommentVNode as i, createElementVNode as a, toDisplayString as c } from "vue";
|
|
2
|
+
import f from "../Icon.vue.js";
|
|
3
|
+
import { $t as d } from "../../utils/i18n.js";
|
|
4
|
+
const B = ["data-disabled"], $ = { class: "flex flex-col flex-1 min-w-0" }, C = { class: "flex items-center justify-between gap-2" }, D = { class: "truncate font-medium" }, S = {
|
|
4
5
|
key: 0,
|
|
5
6
|
class: "text-xs text-muted-foreground whitespace-nowrap opacity-90"
|
|
6
|
-
},
|
|
7
|
+
}, z = {
|
|
7
8
|
key: 0,
|
|
8
9
|
class: "text-[10px] text-muted-foreground truncate opacity-70"
|
|
9
|
-
},
|
|
10
|
+
}, V = /* @__PURE__ */ k({
|
|
10
11
|
__name: "DropdownItem",
|
|
11
12
|
props: {
|
|
12
13
|
option: {},
|
|
@@ -16,41 +17,41 @@ const h = ["data-disabled"], v = { class: "flex flex-col flex-1 min-w-0" }, g =
|
|
|
16
17
|
index: {}
|
|
17
18
|
},
|
|
18
19
|
emits: ["click", "mouseenter"],
|
|
19
|
-
setup(e, { emit:
|
|
20
|
-
const u =
|
|
21
|
-
return (
|
|
20
|
+
setup(e, { emit: b }) {
|
|
21
|
+
const t = e, x = b, y = l(() => t.option.labelI18n ? d(t.option.labelI18n) : t.option.label), r = l(() => t.option.subtitleI18n ? d(t.option.subtitleI18n) : t.option.subtitle), u = l(() => t.option.descriptionI18n ? d(t.option.descriptionI18n) : t.option.description);
|
|
22
|
+
return (m, n) => (o(), s("div", {
|
|
22
23
|
"data-dropdown-item": "",
|
|
23
|
-
class:
|
|
24
|
+
class: h(["relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-disabled:pointer-events-none data-disabled:opacity-50", [
|
|
24
25
|
e.selectable && e.selected && !e.option.children ? "bg-accent" : "",
|
|
25
26
|
e.focused ? "bg-accent text-accent-foreground" : "hover:bg-accent hover:text-accent-foreground",
|
|
26
27
|
e.option.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
|
|
27
28
|
]]),
|
|
28
29
|
"data-disabled": e.option.disabled ? !0 : void 0,
|
|
29
|
-
onClick:
|
|
30
|
-
onMouseenter:
|
|
30
|
+
onClick: n[0] || (n[0] = (v) => x("click", e.option)),
|
|
31
|
+
onMouseenter: n[1] || (n[1] = (v) => m.$emit("mouseenter", e.index ?? -1))
|
|
31
32
|
}, [
|
|
32
|
-
|
|
33
|
-
e.option.icon ? (
|
|
33
|
+
g(m.$slots, "default", w(I({ option: e.option, index: e.index, selected: e.selected })), () => [
|
|
34
|
+
e.option.icon ? (o(), p(f, {
|
|
34
35
|
key: 0,
|
|
35
36
|
icon: e.option.icon,
|
|
36
37
|
class: "mr-2 h-4 w-4 shrink-0 mt-0.5"
|
|
37
|
-
}, null, 8, ["icon"])) :
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
}, null, 8, ["icon"])) : i("", !0),
|
|
39
|
+
a("div", $, [
|
|
40
|
+
a("div", C, [
|
|
41
|
+
a("span", D, c(y.value), 1),
|
|
42
|
+
r.value ? (o(), s("span", S, c(r.value), 1)) : i("", !0)
|
|
42
43
|
]),
|
|
43
|
-
|
|
44
|
+
u.value ? (o(), s("span", z, c(u.value), 1)) : i("", !0)
|
|
44
45
|
]),
|
|
45
|
-
e.selectable && e.selected ? (
|
|
46
|
+
e.selectable && e.selected ? (o(), p(f, {
|
|
46
47
|
key: 1,
|
|
47
48
|
icon: "lucide:check",
|
|
48
49
|
class: "ml-2 h-4 w-4 shrink-0 text-primary"
|
|
49
|
-
})) :
|
|
50
|
+
})) : i("", !0)
|
|
50
51
|
])
|
|
51
|
-
], 42,
|
|
52
|
+
], 42, B));
|
|
52
53
|
}
|
|
53
54
|
});
|
|
54
55
|
export {
|
|
55
|
-
|
|
56
|
+
V as default
|
|
56
57
|
};
|