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,30 +1,31 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { useDropdownNavigation as
|
|
8
|
-
import { useDropdownIds as
|
|
9
|
-
|
|
1
|
+
import { defineComponent as Y, defineAsyncComponent as Z, ref as C, computed as v, watch as T, toRef as ee, onMounted as te, onBeforeUnmount as le, openBlock as o, createElementBlock as c, createVNode as x, createCommentVNode as i, renderSlot as g, unref as n, normalizeStyle as se, normalizeClass as D, toDisplayString as E, createBlock as m, Fragment as N, renderList as oe, withCtx as V, createElementVNode as S, createSlots as ne, mergeProps as re, nextTick as de } from "vue";
|
|
2
|
+
import $ from "../Icon.vue.js";
|
|
3
|
+
import ce from "../Input.vue.js";
|
|
4
|
+
import ae from "./DropdownItem.vue.js";
|
|
5
|
+
import ie from "./DropdownBooleanItem.vue.js";
|
|
6
|
+
import ue from "./DropdownGroupedLayout.vue.js";
|
|
7
|
+
import { useDropdownNavigation as fe } from "./composables/useDropdownNavigation.js";
|
|
8
|
+
import { useDropdownIds as me } from "./composables/useDropdownIds.js";
|
|
9
|
+
import { $t as I } from "../../utils/i18n.js";
|
|
10
|
+
const he = ["dir"], ye = {
|
|
10
11
|
key: 0,
|
|
11
12
|
class: "bg-body border-b mb-1 z-10 rounded-t-md shrink-0"
|
|
12
|
-
},
|
|
13
|
+
}, ve = {
|
|
13
14
|
key: 1,
|
|
14
15
|
class: "shrink-0"
|
|
15
|
-
},
|
|
16
|
+
}, ge = {
|
|
16
17
|
key: 0,
|
|
17
18
|
class: "px-2 py-6 text-center text-sm text-muted-foreground"
|
|
18
|
-
},
|
|
19
|
+
}, ke = {
|
|
19
20
|
key: 0,
|
|
20
21
|
class: "h-px bg-border my-1 mx-1"
|
|
21
|
-
},
|
|
22
|
+
}, be = ["onMouseenter"], we = { class: "flex items-center gap-2 flex-1 min-w-0" }, pe = { class: "truncate" }, xe = {
|
|
22
23
|
key: 3,
|
|
23
24
|
class: "flex justify-center py-2"
|
|
24
|
-
},
|
|
25
|
+
}, Se = {
|
|
25
26
|
key: 3,
|
|
26
27
|
class: "shrink-0 border-t mt-1 pt-1"
|
|
27
|
-
},
|
|
28
|
+
}, Ne = /* @__PURE__ */ Y({
|
|
28
29
|
__name: "DropdownMenu",
|
|
29
30
|
props: {
|
|
30
31
|
options: { default: () => [] },
|
|
@@ -46,37 +47,43 @@ const ie = ["dir"], ue = {
|
|
|
46
47
|
},
|
|
47
48
|
emits: ["select", "close", "load-more", "search"],
|
|
48
49
|
setup(r, { emit: j }) {
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
const P = Z(() => import("./Dropdown.vue2.js")), t = r, u = j, M = C(null), f = C(""), { getMenuId: _, getAllRecursiveIds: H } = me(), R = v(() => {
|
|
51
|
+
const e = I("vlite.dropdown.empty");
|
|
52
|
+
return e !== "vlite.dropdown.empty" ? e : "No options found";
|
|
53
|
+
}), z = v(() => {
|
|
54
|
+
const e = I("vlite.dropdown.search");
|
|
55
|
+
return e !== "vlite.dropdown.search" ? e : "Search...";
|
|
56
|
+
}), A = v(() => t.remote ? t.searchable : t.searchable && (t.options?.length || 0) > 9);
|
|
57
|
+
let k = null;
|
|
58
|
+
T(f, (e) => {
|
|
59
|
+
t.remote && (k && clearTimeout(k), k = setTimeout(() => {
|
|
53
60
|
e && u("search", e);
|
|
54
61
|
}, 100));
|
|
55
62
|
});
|
|
56
|
-
const
|
|
63
|
+
const L = (e) => {
|
|
57
64
|
const s = e.target;
|
|
58
65
|
s.scrollTop + s.clientHeight >= s.scrollHeight - 50 && t.hasMore && !t.loading && u("load-more");
|
|
59
|
-
},
|
|
66
|
+
}, b = (e, s) => {
|
|
60
67
|
e.disabled || u("select", e);
|
|
61
68
|
}, {
|
|
62
69
|
focusedIndex: h,
|
|
63
|
-
isKeyboardMode:
|
|
64
|
-
filteredOptions:
|
|
70
|
+
isKeyboardMode: w,
|
|
71
|
+
filteredOptions: F,
|
|
65
72
|
// rename
|
|
66
|
-
handleKeyDown:
|
|
67
|
-
handleMouseMove:
|
|
68
|
-
onMouseEnterItem:
|
|
69
|
-
scrollToIndex:
|
|
70
|
-
} =
|
|
71
|
-
options:
|
|
73
|
+
handleKeyDown: O,
|
|
74
|
+
handleMouseMove: B,
|
|
75
|
+
onMouseEnterItem: p,
|
|
76
|
+
scrollToIndex: K
|
|
77
|
+
} = fe({
|
|
78
|
+
options: ee(t, "options"),
|
|
72
79
|
searchQuery: f,
|
|
73
|
-
containerRef:
|
|
80
|
+
containerRef: M,
|
|
74
81
|
emit: (e, ...s) => u(e, ...s),
|
|
75
|
-
handleSelect: (e, s) =>
|
|
76
|
-
}), y =
|
|
82
|
+
handleSelect: (e, s) => b(e)
|
|
83
|
+
}), y = v(() => t.remote ? f.value ? t.options : t.cachedOptions.length ? t.cachedOptions : t.options : F.value), U = (e) => {
|
|
77
84
|
if (!(!t.selected || typeof t.selected != "object") && e.key && e.key in t.selected)
|
|
78
85
|
return t.selected[e.key];
|
|
79
|
-
},
|
|
86
|
+
}, q = (e) => e.disabled ? !1 : Array.isArray(t.selected) ? t.selected.includes(e.value) : t.selected && typeof t.selected == "object" && e.key ? t.selected[e.key] === e.value : t.selected === e.value, G = (e) => !e.key || !t.selected || typeof t.selected != "object" ? !1 : !!t.selected[e.key], J = (e, s) => {
|
|
80
87
|
if (!s.key) return;
|
|
81
88
|
const l = {
|
|
82
89
|
label: s.label,
|
|
@@ -85,7 +92,7 @@ const ie = ["dir"], ue = {
|
|
|
85
92
|
data: s.data
|
|
86
93
|
};
|
|
87
94
|
u("select", l);
|
|
88
|
-
},
|
|
95
|
+
}, Q = (e, s) => {
|
|
89
96
|
let l = s.value;
|
|
90
97
|
e.key && (l = { [e.key]: l });
|
|
91
98
|
const d = {
|
|
@@ -95,142 +102,144 @@ const ie = ["dir"], ue = {
|
|
|
95
102
|
key: e.key
|
|
96
103
|
};
|
|
97
104
|
u("select", d);
|
|
98
|
-
},
|
|
99
|
-
await
|
|
105
|
+
}, W = async () => {
|
|
106
|
+
await de();
|
|
100
107
|
let e = -1;
|
|
101
|
-
t.layout !== "grouped" && (t.selectedIndex !== null && t.selectedIndex >= 0 ? e = t.selectedIndex : t.selected !== void 0 && typeof t.selected != "object" && (e = t.options.findIndex((s) => s.value === t.selected)), e !== -1 &&
|
|
108
|
+
t.layout !== "grouped" && (t.selectedIndex !== null && t.selectedIndex >= 0 ? e = t.selectedIndex : t.selected !== void 0 && typeof t.selected != "object" && (e = t.options.findIndex((s) => s.value === t.selected)), e !== -1 && K(e));
|
|
102
109
|
};
|
|
103
|
-
|
|
110
|
+
T(
|
|
104
111
|
() => y.value,
|
|
105
112
|
() => {
|
|
106
113
|
h.value = -1;
|
|
107
114
|
}
|
|
108
|
-
),
|
|
109
|
-
|
|
110
|
-
}),
|
|
111
|
-
window.removeEventListener("keydown",
|
|
112
|
-
})
|
|
115
|
+
), te(() => {
|
|
116
|
+
W(), window.addEventListener("keydown", O);
|
|
117
|
+
}), le(() => {
|
|
118
|
+
window.removeEventListener("keydown", O);
|
|
119
|
+
});
|
|
120
|
+
const X = (e) => e.labelI18n ? I(e.labelI18n) : e.label;
|
|
121
|
+
return (e, s) => (o(), c("div", {
|
|
113
122
|
class: "dropdown-menu w-full min-w-[150px] flex flex-col",
|
|
114
123
|
dir: r.direction
|
|
115
124
|
}, [
|
|
116
|
-
|
|
117
|
-
x(
|
|
125
|
+
A.value ? (o(), c("div", ye, [
|
|
126
|
+
x(ce, {
|
|
118
127
|
modelValue: f.value,
|
|
119
128
|
"onUpdate:modelValue": s[0] || (s[0] = (l) => f.value = l),
|
|
120
|
-
placeholder:
|
|
129
|
+
placeholder: z.value,
|
|
121
130
|
icon: "lucide:search",
|
|
122
131
|
size: "sm",
|
|
123
132
|
class: "font-medium!",
|
|
124
133
|
variant: "transparent",
|
|
125
134
|
"show-clear-button": !1
|
|
126
|
-
}, null, 8, ["modelValue"])
|
|
135
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
127
136
|
])) : i("", !0),
|
|
128
|
-
e.$slots.header ? (o(), c("div",
|
|
129
|
-
|
|
137
|
+
e.$slots.header ? (o(), c("div", ve, [
|
|
138
|
+
g(e.$slots, "header")
|
|
130
139
|
])) : i("", !0),
|
|
131
140
|
t?.options.length > 0 || e.$slots.menu ? (o(), c("div", {
|
|
132
141
|
key: 2,
|
|
133
142
|
ref_key: "containerRef",
|
|
134
|
-
ref:
|
|
143
|
+
ref: M,
|
|
135
144
|
tabindex: "0",
|
|
136
145
|
role: "menu",
|
|
137
|
-
class:
|
|
146
|
+
class: D([
|
|
138
147
|
"w-full p-1 space-y-0.5 overflow-y-auto overflow-x-hidden focus:outline-none flex-1",
|
|
139
148
|
t.class
|
|
140
149
|
]),
|
|
141
|
-
style:
|
|
150
|
+
style: se({ maxHeight: t.maxHeight }),
|
|
142
151
|
onMousemove: s[1] || (s[1] = //@ts-ignore
|
|
143
|
-
(...l) => n(
|
|
144
|
-
onScroll:
|
|
152
|
+
(...l) => n(B) && n(B)(...l)),
|
|
153
|
+
onScroll: L
|
|
145
154
|
}, [
|
|
146
|
-
y.value.length === 0 && r.options?.length > 0 && !r.loading ? (o(), c("div",
|
|
147
|
-
r.layout === "grouped" ? (o(), m(
|
|
155
|
+
y.value.length === 0 && r.options?.length > 0 && !r.loading ? (o(), c("div", ge, E(R.value), 1)) : i("", !0),
|
|
156
|
+
r.layout === "grouped" ? (o(), m(ue, {
|
|
148
157
|
key: 1,
|
|
149
158
|
options: y.value,
|
|
150
159
|
selected: r.selected,
|
|
151
160
|
selectable: r.selectable,
|
|
152
161
|
columns: r.columns,
|
|
153
|
-
onSelect:
|
|
154
|
-
}, null, 8, ["options", "selected", "selectable", "columns"])) : (o(!0), c(N, { key: 2 },
|
|
155
|
-
l.label === "---" ? (o(), c("div",
|
|
162
|
+
onSelect: b
|
|
163
|
+
}, null, 8, ["options", "selected", "selectable", "columns"])) : (o(!0), c(N, { key: 2 }, oe(y.value, (l, d) => (o(), c(N, { key: d }, [
|
|
164
|
+
l.label === "---" ? (o(), c("div", ke)) : l.data?.isBoolean ? (o(), m(ie, {
|
|
156
165
|
key: 1,
|
|
157
166
|
option: l,
|
|
158
|
-
value:
|
|
159
|
-
focused: n(
|
|
160
|
-
onChange:
|
|
161
|
-
onMouseenter: (a) => n(
|
|
162
|
-
}, null, 8, ["option", "value", "focused", "onMouseenter"])) : l.children && l.children.length > 0 ? (o(), m(n(
|
|
167
|
+
value: G(l),
|
|
168
|
+
focused: n(w) && n(h) === d,
|
|
169
|
+
onChange: J,
|
|
170
|
+
onMouseenter: (a) => n(p)(d)
|
|
171
|
+
}, null, 8, ["option", "value", "focused", "onMouseenter"])) : l.children && l.children.length > 0 ? (o(), m(n(P), {
|
|
163
172
|
key: 2,
|
|
164
173
|
position: l.position || t.nestedPosition,
|
|
165
174
|
offset: l.offset || t.nestedOffset,
|
|
166
175
|
class: "w-full",
|
|
167
176
|
options: l.children,
|
|
168
|
-
selected:
|
|
169
|
-
menuId: n(
|
|
177
|
+
selected: U(l),
|
|
178
|
+
menuId: n(_)(l),
|
|
170
179
|
nestedPosition: t.nestedPosition,
|
|
171
180
|
nestedOffset: t.nestedOffset,
|
|
172
181
|
selectable: t.selectable,
|
|
173
|
-
ignoreClickOutside: n(
|
|
182
|
+
ignoreClickOutside: n(H)(l.children),
|
|
174
183
|
direction: r.direction,
|
|
175
|
-
onOnSelect: (a) =>
|
|
184
|
+
onOnSelect: (a) => Q(l, a)
|
|
176
185
|
}, {
|
|
177
186
|
trigger: V(() => [
|
|
178
|
-
|
|
187
|
+
S("div", {
|
|
179
188
|
"data-dropdown-item": "",
|
|
180
|
-
class:
|
|
181
|
-
n(
|
|
189
|
+
class: D(["relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm font-medium outline-none transition-colors justify-between w-full", [
|
|
190
|
+
n(w) && n(h) === d ? "bg-accent text-accent-foreground" : "hover:bg-accent hover:text-accent-foreground",
|
|
182
191
|
l.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
183
192
|
]]),
|
|
184
|
-
onMouseenter: (a) => n(
|
|
193
|
+
onMouseenter: (a) => n(p)(d)
|
|
185
194
|
}, [
|
|
186
|
-
|
|
187
|
-
l.icon ? (o(), m(
|
|
195
|
+
S("div", we, [
|
|
196
|
+
l.icon ? (o(), m($, {
|
|
188
197
|
key: 0,
|
|
189
198
|
icon: l.icon,
|
|
190
199
|
class: "mr-2 h-4 w-4 shrink-0 mt-0.5"
|
|
191
200
|
}, null, 8, ["icon"])) : i("", !0),
|
|
192
|
-
|
|
201
|
+
S("span", pe, E(X(l)), 1)
|
|
193
202
|
]),
|
|
194
|
-
x(
|
|
203
|
+
x($, {
|
|
195
204
|
icon: r.direction === "rtl" ? "lucide:chevron-left" : "lucide:chevron-right",
|
|
196
205
|
class: "h-4 w-4 text-muted-foreground shrink-0 ml-2"
|
|
197
206
|
}, null, 8, ["icon"])
|
|
198
|
-
], 42,
|
|
207
|
+
], 42, be)
|
|
199
208
|
]),
|
|
200
209
|
_: 2
|
|
201
|
-
}, 1032, ["position", "offset", "options", "selected", "menuId", "nestedPosition", "nestedOffset", "selectable", "ignoreClickOutside", "direction", "onOnSelect"])) : (o(), m(
|
|
210
|
+
}, 1032, ["position", "offset", "options", "selected", "menuId", "nestedPosition", "nestedOffset", "selectable", "ignoreClickOutside", "direction", "onOnSelect"])) : (o(), m(ae, {
|
|
202
211
|
key: 3,
|
|
203
212
|
option: l,
|
|
204
213
|
index: d,
|
|
205
|
-
selected:
|
|
206
|
-
focused: n(
|
|
214
|
+
selected: q(l),
|
|
215
|
+
focused: n(w) && n(h) === d,
|
|
207
216
|
selectable: r.selectable,
|
|
208
|
-
onClick: (a) =>
|
|
209
|
-
onMouseenter: (a) => n(
|
|
210
|
-
},
|
|
217
|
+
onClick: (a) => b(l),
|
|
218
|
+
onMouseenter: (a) => n(p)(d)
|
|
219
|
+
}, ne({ _: 2 }, [
|
|
211
220
|
e.$slots.item ? {
|
|
212
221
|
name: "default",
|
|
213
222
|
fn: V((a) => [
|
|
214
|
-
|
|
223
|
+
g(e.$slots, "item", re({ ref_for: !0 }, a))
|
|
215
224
|
]),
|
|
216
225
|
key: "0"
|
|
217
226
|
} : void 0
|
|
218
227
|
]), 1032, ["option", "index", "selected", "focused", "selectable", "onClick", "onMouseenter"]))
|
|
219
228
|
], 64))), 128)),
|
|
220
|
-
r.loading ? (o(), c("div",
|
|
221
|
-
x(
|
|
229
|
+
r.loading ? (o(), c("div", xe, [
|
|
230
|
+
x($, {
|
|
222
231
|
icon: "lucide:loader-2",
|
|
223
232
|
class: "w-4 h-4 animate-spin text-muted-foreground"
|
|
224
233
|
})
|
|
225
234
|
])) : i("", !0),
|
|
226
|
-
|
|
235
|
+
g(e.$slots, "menu")
|
|
227
236
|
], 38)) : i("", !0),
|
|
228
|
-
e.$slots.footer ? (o(), c("div",
|
|
229
|
-
|
|
237
|
+
e.$slots.footer ? (o(), c("div", Se, [
|
|
238
|
+
g(e.$slots, "footer")
|
|
230
239
|
])) : i("", !0)
|
|
231
|
-
], 8,
|
|
240
|
+
], 8, he));
|
|
232
241
|
}
|
|
233
242
|
});
|
|
234
243
|
export {
|
|
235
|
-
|
|
244
|
+
Ne as default
|
|
236
245
|
};
|
|
@@ -1,42 +1,43 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { ref as u, computed as i } from "vue";
|
|
2
|
+
import { $t as c } from "../../../utils/i18n.js";
|
|
3
|
+
function b(n) {
|
|
4
|
+
const t = u(-1), o = u(!1), s = i(() => {
|
|
5
|
+
const e = n.options.value;
|
|
6
|
+
if (!n.searchQuery.value) return e;
|
|
7
|
+
const a = n.searchQuery.value.toLowerCase();
|
|
8
|
+
return e.filter((l) => (l.labelI18n ? c(l.labelI18n) : l.label).toLowerCase().includes(a));
|
|
8
9
|
}), r = (e) => {
|
|
9
|
-
if (!
|
|
10
|
-
const
|
|
11
|
-
|
|
10
|
+
if (!n.containerRef.value || e < 0) return;
|
|
11
|
+
const l = n.containerRef.value.querySelectorAll("[data-dropdown-item]")[e];
|
|
12
|
+
l && l.scrollIntoView({ block: "nearest" });
|
|
12
13
|
};
|
|
13
14
|
return {
|
|
14
15
|
focusedIndex: t,
|
|
15
|
-
isKeyboardMode:
|
|
16
|
-
filteredOptions:
|
|
16
|
+
isKeyboardMode: o,
|
|
17
|
+
filteredOptions: s,
|
|
17
18
|
handleKeyDown: (e) => {
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
20
|
-
switch (["ArrowDown", "ArrowUp", "Enter"].includes(e.key) && (
|
|
19
|
+
const a = s.value;
|
|
20
|
+
if (a.length !== 0)
|
|
21
|
+
switch (["ArrowDown", "ArrowUp", "Enter"].includes(e.key) && (o.value = !0), e.key) {
|
|
21
22
|
case "ArrowDown":
|
|
22
|
-
e.preventDefault(), e.stopPropagation(), t.value <
|
|
23
|
+
e.preventDefault(), e.stopPropagation(), t.value < a.length - 1 ? t.value++ : t.value = 0, r(t.value);
|
|
23
24
|
break;
|
|
24
25
|
case "ArrowUp":
|
|
25
|
-
e.preventDefault(), e.stopPropagation(), t.value > 0 ? t.value-- : (t.value, t.value =
|
|
26
|
+
e.preventDefault(), e.stopPropagation(), t.value > 0 ? t.value-- : (t.value, t.value = a.length - 1), r(t.value);
|
|
26
27
|
break;
|
|
27
28
|
case "Enter":
|
|
28
|
-
if (e.preventDefault(), e.stopPropagation(), t.value >= 0 && t.value <
|
|
29
|
-
const
|
|
30
|
-
|
|
29
|
+
if (e.preventDefault(), e.stopPropagation(), t.value >= 0 && t.value < a.length) {
|
|
30
|
+
const l = a[t.value];
|
|
31
|
+
l.children || n.handleSelect(l, t.value);
|
|
31
32
|
}
|
|
32
33
|
break;
|
|
33
34
|
case "Escape":
|
|
34
|
-
e.preventDefault(), e.stopPropagation(),
|
|
35
|
+
e.preventDefault(), e.stopPropagation(), n.emit("close");
|
|
35
36
|
break;
|
|
36
37
|
}
|
|
37
38
|
},
|
|
38
39
|
handleMouseMove: () => {
|
|
39
|
-
|
|
40
|
+
o.value && (o.value = !1);
|
|
40
41
|
},
|
|
41
42
|
onMouseEnterItem: (e) => {
|
|
42
43
|
t.value = e;
|
|
@@ -45,5 +46,5 @@ function h(a) {
|
|
|
45
46
|
};
|
|
46
47
|
}
|
|
47
48
|
export {
|
|
48
|
-
|
|
49
|
+
b as useDropdownNavigation
|
|
49
50
|
};
|
|
@@ -1,41 +1,43 @@
|
|
|
1
|
-
import { computed as
|
|
1
|
+
import { computed as f } from "vue";
|
|
2
2
|
import { deepMerge as g } from "../../../utils/object.js";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { $t as k } from "../../../utils/i18n.js";
|
|
4
|
+
function h(r, n) {
|
|
5
|
+
const u = f(() => r.modelValue !== void 0 ? r.modelValue : r.selected), o = (l = [], t) => {
|
|
5
6
|
for (const e of l) {
|
|
6
|
-
|
|
7
|
+
const a = e.labelI18n ? k(e.labelI18n) : e.label;
|
|
8
|
+
if (e.value === t) return a;
|
|
7
9
|
if (e.key && typeof t == "object" && t !== null && e.key in t) {
|
|
8
10
|
if (e.children) {
|
|
9
11
|
const c = o(e.children, t[e.key]);
|
|
10
|
-
if (c) return `${
|
|
12
|
+
if (c) return `${a} / ${c}`;
|
|
11
13
|
}
|
|
12
|
-
return e.value === t[e.key],
|
|
14
|
+
return e.value === t[e.key], a;
|
|
13
15
|
}
|
|
14
16
|
}
|
|
15
17
|
return "";
|
|
16
|
-
}, i =
|
|
18
|
+
}, i = f(() => !r.showSelectedLabel || !r.selectable || !r.options?.length ? "" : o(r.options, u.value));
|
|
17
19
|
return {
|
|
18
|
-
currentValue:
|
|
20
|
+
currentValue: u,
|
|
19
21
|
selectedLabel: i,
|
|
20
22
|
selectOption: (l) => {
|
|
21
23
|
if (typeof l != "string" && l?.disabled) return;
|
|
22
|
-
const t =
|
|
24
|
+
const t = u.value;
|
|
23
25
|
let e = l?.value ?? l?.label;
|
|
24
|
-
const
|
|
26
|
+
const a = l.data;
|
|
25
27
|
if (l.key && (typeof e == "object" && e !== null && l.key in e || (e = { [l.key]: e })), t && typeof t == "object" && !Array.isArray(t) && l.key) {
|
|
26
|
-
const
|
|
27
|
-
if (
|
|
28
|
+
const c = l.key, y = l.value ?? l.label, b = t[c] === y;
|
|
29
|
+
if (r.toggleSelection && b) {
|
|
28
30
|
const d = { ...t };
|
|
29
|
-
delete d[
|
|
31
|
+
delete d[c], n("update:modelValue", d), n("onSelect", { value: d, data: a });
|
|
30
32
|
return;
|
|
31
33
|
}
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
+
const s = g(t, e);
|
|
35
|
+
n("update:modelValue", s), n("onSelect", { value: s, data: a });
|
|
34
36
|
} else
|
|
35
|
-
|
|
37
|
+
r.toggleSelection && t === (l.value ?? l.label) ? (n("update:modelValue", void 0), n("onSelect", { value: void 0, data: a })) : (n("update:modelValue", e), n("onSelect", { value: e, data: a }));
|
|
36
38
|
}
|
|
37
39
|
};
|
|
38
40
|
}
|
|
39
41
|
export {
|
|
40
|
-
|
|
42
|
+
h as useDropdownSelection
|
|
41
43
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
interface Props {
|
|
2
2
|
title?: string;
|
|
3
|
+
titleI18n?: string;
|
|
3
4
|
description?: string;
|
|
5
|
+
descriptionI18n?: string;
|
|
4
6
|
icon?: string;
|
|
5
7
|
}
|
|
6
8
|
declare function __VLS_template(): {
|
|
@@ -14,8 +16,6 @@ declare function __VLS_template(): {
|
|
|
14
16
|
};
|
|
15
17
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
16
18
|
declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
17
|
-
title: string;
|
|
18
|
-
description: string;
|
|
19
19
|
icon: string;
|
|
20
20
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
21
21
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -1,33 +1,47 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { defineComponent as d, computed as o, openBlock as a, createElementBlock as p, createElementVNode as i, createVNode as u, toDisplayString as f, renderSlot as s } from "vue";
|
|
2
|
+
import m from "../Icon.vue.js";
|
|
3
|
+
import { $t as n } from "../../utils/i18n.js";
|
|
4
|
+
const h = { class: "flex flex-col items-center justify-center py-28 gap-5 rounded-3xl border border-gray-150 bg-muted/50 w-full mt-4" }, y = { class: "w-17 h-17 rounded-full bg-gray-200/60 border border-gray-250 shadow-inner flex items-center justify-center" }, g = { class: "text-center space-y-1" }, _ = { class: "text-fs-5 font-semibold text-foreground tracking-tight" }, x = ["innerHTML"], k = /* @__PURE__ */ d({
|
|
4
5
|
__name: "Empty",
|
|
5
6
|
props: {
|
|
6
|
-
title: {
|
|
7
|
-
|
|
7
|
+
title: {},
|
|
8
|
+
titleI18n: {},
|
|
9
|
+
description: {},
|
|
10
|
+
descriptionI18n: {},
|
|
8
11
|
icon: { default: "lucide:inbox" }
|
|
9
12
|
},
|
|
10
|
-
setup(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
setup(r) {
|
|
14
|
+
const t = r, l = o(() => {
|
|
15
|
+
if (t.titleI18n) return n(t.titleI18n);
|
|
16
|
+
if (t.title) return t.title;
|
|
17
|
+
const e = n("vlite.empty.title");
|
|
18
|
+
return e !== "vlite.empty.title" ? e : "No data found";
|
|
19
|
+
}), c = o(() => {
|
|
20
|
+
if (t.descriptionI18n) return n(t.descriptionI18n);
|
|
21
|
+
if (t.description) return t.description;
|
|
22
|
+
const e = n("vlite.empty.description");
|
|
23
|
+
return e !== "vlite.empty.description" ? e : "There is nothing to display here right now.";
|
|
24
|
+
});
|
|
25
|
+
return (e, v) => (a(), p("div", h, [
|
|
26
|
+
i("div", y, [
|
|
27
|
+
u(m, {
|
|
28
|
+
icon: r.icon,
|
|
15
29
|
class: "w-7 h-7 text-muted-foreground",
|
|
16
30
|
"stroke-width": "1.2"
|
|
17
31
|
}, null, 8, ["icon"])
|
|
18
32
|
]),
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
33
|
+
i("div", g, [
|
|
34
|
+
i("h3", _, f(l.value), 1),
|
|
35
|
+
i("p", {
|
|
22
36
|
class: "text-sm text-gray-700 font-light leading-relaxed",
|
|
23
|
-
innerHTML:
|
|
24
|
-
}, null, 8,
|
|
37
|
+
innerHTML: c.value
|
|
38
|
+
}, null, 8, x)
|
|
25
39
|
]),
|
|
26
|
-
|
|
27
|
-
|
|
40
|
+
s(e.$slots, "action"),
|
|
41
|
+
s(e.$slots, "default")
|
|
28
42
|
]));
|
|
29
43
|
}
|
|
30
44
|
});
|
|
31
45
|
export {
|
|
32
|
-
|
|
46
|
+
k as default
|
|
33
47
|
};
|
|
@@ -17,6 +17,8 @@ interface Props {
|
|
|
17
17
|
maxFiles?: number;
|
|
18
18
|
variant?: 'dropzone' | 'input';
|
|
19
19
|
placeholder?: string;
|
|
20
|
+
placeholderI18n?: string;
|
|
21
|
+
textI18n?: string;
|
|
20
22
|
size?: InputSize;
|
|
21
23
|
rounded?: InputRounded;
|
|
22
24
|
}
|
|
@@ -49,8 +51,8 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
|
|
|
49
51
|
size: InputSize;
|
|
50
52
|
variant: "dropzone" | "input";
|
|
51
53
|
modelValue: FilePickerValue | FilePickerValue[] | null;
|
|
52
|
-
loading: boolean;
|
|
53
54
|
rounded: InputRounded;
|
|
55
|
+
loading: boolean;
|
|
54
56
|
multiSelect: boolean;
|
|
55
57
|
fileTypes: string[];
|
|
56
58
|
returnFormat: "file" | "base64";
|