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
package/components/Slider.vue.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as N, ref as x, watch as R, computed as r, openBlock as i, createElementBlock as v, normalizeClass as s, createBlock as F, createCommentVNode as f, toDisplayString as C, createElementVNode as p, normalizeStyle as y, withDirectives as H, vModelText as L } from "vue";
|
|
2
2
|
import U from "./Icon.vue.js";
|
|
3
|
-
|
|
3
|
+
import { $t as W } from "../utils/i18n.js";
|
|
4
|
+
const j = {
|
|
4
5
|
key: 1,
|
|
5
6
|
class: "text-sm font-medium whitespace-nowrap cursor-pointer"
|
|
6
|
-
},
|
|
7
|
+
}, q = ["min", "max", "step", "disabled"], K = /* @__PURE__ */ N({
|
|
7
8
|
__name: "Slider",
|
|
8
9
|
props: {
|
|
9
10
|
min: { default: 0 },
|
|
10
11
|
max: { default: 100 },
|
|
11
12
|
step: { default: 1 },
|
|
12
13
|
label: {},
|
|
14
|
+
labelI18n: {},
|
|
13
15
|
icon: {},
|
|
14
16
|
disabled: { type: Boolean },
|
|
15
17
|
showValue: { type: Boolean, default: !0 },
|
|
@@ -19,15 +21,15 @@ const W = {
|
|
|
19
21
|
size: { default: "md" }
|
|
20
22
|
},
|
|
21
23
|
emits: ["update:modelValue", "change", "iconClick"],
|
|
22
|
-
setup(
|
|
23
|
-
const t =
|
|
24
|
-
|
|
24
|
+
setup(a, { emit: z }) {
|
|
25
|
+
const t = a, d = z, u = x(!1), g = x(!1), o = x(t.modelValue);
|
|
26
|
+
R(
|
|
25
27
|
() => t.modelValue,
|
|
26
|
-
(
|
|
27
|
-
|
|
28
|
+
(l) => {
|
|
29
|
+
o.value = l;
|
|
28
30
|
}
|
|
29
31
|
);
|
|
30
|
-
const
|
|
32
|
+
const b = r(() => t.centerOrigin !== void 0 ? t.centerOrigin : t.min < 0 && t.max > 0), V = r(() => t.max - t.min), h = r(() => (o.value - t.min) / V.value * 100), w = r(() => (0 - t.min) / V.value * 100), $ = r(() => {
|
|
31
33
|
switch (t.size) {
|
|
32
34
|
case "xs":
|
|
33
35
|
return 10;
|
|
@@ -38,34 +40,34 @@ const W = {
|
|
|
38
40
|
default:
|
|
39
41
|
return 14;
|
|
40
42
|
}
|
|
41
|
-
}), c = (
|
|
42
|
-
const e =
|
|
43
|
-
return `calc(${
|
|
44
|
-
},
|
|
45
|
-
if (
|
|
46
|
-
const
|
|
43
|
+
}), c = (l) => {
|
|
44
|
+
const e = $.value / 2, n = $.value;
|
|
45
|
+
return `calc(${l}% + (${e}px - ${n * (l / 100)}px))`;
|
|
46
|
+
}, M = r(() => {
|
|
47
|
+
if (b.value) {
|
|
48
|
+
const l = Math.min(h.value, w.value), e = Math.max(h.value, w.value), n = c(l), E = c(e);
|
|
47
49
|
return {
|
|
48
|
-
left:
|
|
49
|
-
width: `calc(${E} - ${
|
|
50
|
+
left: n,
|
|
51
|
+
width: `calc(${E} - ${n})`
|
|
50
52
|
};
|
|
51
53
|
} else
|
|
52
54
|
return {
|
|
53
55
|
left: "0%",
|
|
54
|
-
width: c(
|
|
56
|
+
width: c(h.value)
|
|
55
57
|
};
|
|
56
|
-
}),
|
|
57
|
-
left: c(
|
|
58
|
-
})),
|
|
59
|
-
d("update:modelValue",
|
|
60
|
-
},
|
|
61
|
-
d("change",
|
|
58
|
+
}), B = r(() => b.value ? o.value < 0 ? "rounded-r-none" : o.value > 0 ? "rounded-l-none" : "" : ""), S = r(() => ({
|
|
59
|
+
left: c(h.value)
|
|
60
|
+
})), D = () => {
|
|
61
|
+
d("update:modelValue", o.value);
|
|
62
|
+
}, I = () => {
|
|
63
|
+
d("change", o.value), u.value = !1;
|
|
62
64
|
}, P = r(() => Math.abs(t.modelValue) > 1e-3), O = () => {
|
|
63
65
|
if (t.disabled) return;
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
+
const l = b.value ? 0 : t.min;
|
|
67
|
+
o.value = l, d("update:modelValue", l), d("change", l);
|
|
66
68
|
}, T = r(() => {
|
|
67
|
-
const
|
|
68
|
-
return
|
|
69
|
+
const l = t.step.toString().split(".")[1]?.length || 0;
|
|
70
|
+
return o.value.toFixed(l);
|
|
69
71
|
}), m = r(() => ({
|
|
70
72
|
xs: {
|
|
71
73
|
track: "h-0.5",
|
|
@@ -91,82 +93,82 @@ const W = {
|
|
|
91
93
|
wrapper: "h-7",
|
|
92
94
|
tick: "h-4"
|
|
93
95
|
}
|
|
94
|
-
})[t.size]);
|
|
95
|
-
return (
|
|
96
|
-
class: s(["slider-wrapper flex items-center gap-3 w-full select-none touch-none", { "opacity-50 pointer-events-none":
|
|
97
|
-
onMouseenter: e[6] || (e[6] = (
|
|
98
|
-
onMouseleave: e[7] || (e[7] = (
|
|
96
|
+
})[t.size]), k = r(() => t.labelI18n ? W(t.labelI18n) : t.label);
|
|
97
|
+
return (l, e) => (i(), v("div", {
|
|
98
|
+
class: s(["slider-wrapper flex items-center gap-3 w-full select-none touch-none", { "opacity-50 pointer-events-none": a.disabled }]),
|
|
99
|
+
onMouseenter: e[6] || (e[6] = (n) => g.value = !0),
|
|
100
|
+
onMouseleave: e[7] || (e[7] = (n) => g.value = !1)
|
|
99
101
|
}, [
|
|
100
|
-
|
|
102
|
+
k.value || a.icon ? (i(), v("div", {
|
|
101
103
|
key: 0,
|
|
102
|
-
class: s(["flex items-center gap-2 min-w-fit cursor-pointer transition-colors", [{ "text-primary":
|
|
103
|
-
onClick: e[0] || (e[0] = (
|
|
104
|
+
class: s(["flex items-center gap-2 min-w-fit cursor-pointer transition-colors", [{ "text-primary": u.value || g.value }, a.labelClass || "text-muted-foreground"]]),
|
|
105
|
+
onClick: e[0] || (e[0] = (n) => d("iconClick")),
|
|
104
106
|
title: "Double-click to reset"
|
|
105
107
|
}, [
|
|
106
|
-
|
|
108
|
+
a.icon ? (i(), F(U, {
|
|
107
109
|
key: 0,
|
|
108
|
-
icon:
|
|
110
|
+
icon: a.icon,
|
|
109
111
|
class: "h-4 w-4"
|
|
110
112
|
}, null, 8, ["icon"])) : f("", !0),
|
|
111
|
-
|
|
113
|
+
k.value ? (i(), v("label", j, C(k.value), 1)) : f("", !0)
|
|
112
114
|
], 2)) : f("", !0),
|
|
113
|
-
|
|
115
|
+
p("div", {
|
|
114
116
|
class: s(["relative flex-1 flex items-center group", m.value.wrapper])
|
|
115
117
|
}, [
|
|
116
|
-
|
|
118
|
+
p("div", {
|
|
117
119
|
class: s(["absolute w-full bg-secondary rounded-full overflow-hidden", m.value.track])
|
|
118
120
|
}, null, 2),
|
|
119
|
-
|
|
121
|
+
b.value ? (i(), v("div", {
|
|
120
122
|
key: 0,
|
|
121
123
|
class: s(["absolute top-1/2 w-0.5 bg-muted-foreground/30 rounded transform -translate-y-1/2 z-0", m.value.tick]),
|
|
122
|
-
style:
|
|
124
|
+
style: y({ left: c(w.value) })
|
|
123
125
|
}, null, 6)) : f("", !0),
|
|
124
|
-
|
|
126
|
+
p("div", {
|
|
125
127
|
class: s(["absolute bg-primary rounded-full will-change-transform", [
|
|
126
128
|
{
|
|
127
|
-
"bg-muted-foreground":
|
|
128
|
-
"transition-all duration-75 ease-out": !
|
|
129
|
-
"duration-0":
|
|
129
|
+
"bg-muted-foreground": a.disabled,
|
|
130
|
+
"transition-all duration-75 ease-out": !u.value,
|
|
131
|
+
"duration-0": u.value
|
|
130
132
|
},
|
|
131
133
|
m.value.track,
|
|
132
|
-
|
|
134
|
+
B.value
|
|
133
135
|
]]),
|
|
134
|
-
style:
|
|
136
|
+
style: y(M.value)
|
|
135
137
|
}, null, 6),
|
|
136
|
-
|
|
138
|
+
p("div", {
|
|
137
139
|
class: s(["absolute top-1/2 bg-background -ml-px border border-border shadow-sm rounded-full transform -translate-y-1/2 -translate-x-1/2 pointer-events-none transition-transform duration-100 ease-out z-10", [
|
|
138
140
|
{
|
|
139
|
-
"border-primary shadow-md scale-110":
|
|
141
|
+
"border-primary shadow-md scale-110": u.value,
|
|
140
142
|
"border-primary": P.value
|
|
141
143
|
},
|
|
142
144
|
m.value.thumb
|
|
143
145
|
]]),
|
|
144
|
-
style:
|
|
146
|
+
style: y(S.value)
|
|
145
147
|
}, null, 6),
|
|
146
|
-
|
|
148
|
+
H(p("input", {
|
|
147
149
|
type: "range",
|
|
148
|
-
"onUpdate:modelValue": e[1] || (e[1] = (
|
|
149
|
-
min:
|
|
150
|
-
max:
|
|
151
|
-
step:
|
|
152
|
-
disabled:
|
|
153
|
-
onInput:
|
|
154
|
-
onChange:
|
|
155
|
-
onMousedown: e[2] || (e[2] = (
|
|
156
|
-
onTouchstart: e[3] || (e[3] = (
|
|
157
|
-
onMouseup: e[4] || (e[4] = (
|
|
158
|
-
onTouchend: e[5] || (e[5] = (
|
|
150
|
+
"onUpdate:modelValue": e[1] || (e[1] = (n) => o.value = n),
|
|
151
|
+
min: a.min,
|
|
152
|
+
max: a.max,
|
|
153
|
+
step: a.step,
|
|
154
|
+
disabled: a.disabled,
|
|
155
|
+
onInput: D,
|
|
156
|
+
onChange: I,
|
|
157
|
+
onMousedown: e[2] || (e[2] = (n) => u.value = !0),
|
|
158
|
+
onTouchstart: e[3] || (e[3] = (n) => u.value = !0),
|
|
159
|
+
onMouseup: e[4] || (e[4] = (n) => u.value = !1),
|
|
160
|
+
onTouchend: e[5] || (e[5] = (n) => u.value = !1),
|
|
159
161
|
class: "slider-input absolute inset-0 w-full h-full opacity-0 cursor-pointer z-20 m-0 p-0"
|
|
160
|
-
}, null, 40,
|
|
162
|
+
}, null, 40, q), [
|
|
161
163
|
[
|
|
162
|
-
|
|
163
|
-
|
|
164
|
+
L,
|
|
165
|
+
o.value,
|
|
164
166
|
void 0,
|
|
165
167
|
{ number: !0 }
|
|
166
168
|
]
|
|
167
169
|
])
|
|
168
170
|
], 2),
|
|
169
|
-
|
|
171
|
+
a.showValue ? (i(), v("span", {
|
|
170
172
|
key: 1,
|
|
171
173
|
onDblclick: O,
|
|
172
174
|
class: "font-mono tabular-nums text-muted-foreground text-right min-w-6 text-sm"
|
|
@@ -175,5 +177,5 @@ const W = {
|
|
|
175
177
|
}
|
|
176
178
|
});
|
|
177
179
|
export {
|
|
178
|
-
|
|
180
|
+
K as default
|
|
179
181
|
};
|
|
@@ -2,6 +2,7 @@ interface Props {
|
|
|
2
2
|
modelValue?: boolean;
|
|
3
3
|
disabled?: boolean;
|
|
4
4
|
label?: string;
|
|
5
|
+
labelI18n?: string;
|
|
5
6
|
class?: string;
|
|
6
7
|
}
|
|
7
8
|
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
package/components/Switch.vue.js
CHANGED
|
@@ -1,40 +1,45 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
1
|
+
import { defineComponent as u, computed as c, openBlock as n, createElementBlock as i, createElementVNode as r, normalizeClass as t, toDisplayString as m, createCommentVNode as b } from "vue";
|
|
2
|
+
import { $t as f } from "../utils/i18n.js";
|
|
3
|
+
const p = { class: "flex items-center gap-2" }, g = ["aria-checked", "aria-label", "disabled"], v = /* @__PURE__ */ u({
|
|
3
4
|
__name: "Switch",
|
|
4
5
|
props: {
|
|
5
6
|
modelValue: { type: Boolean, default: !1 },
|
|
6
7
|
disabled: { type: Boolean, default: !1 },
|
|
7
8
|
label: {},
|
|
9
|
+
labelI18n: {},
|
|
8
10
|
class: { default: "" }
|
|
9
11
|
},
|
|
10
12
|
emits: ["update:modelValue"],
|
|
11
13
|
setup(e, { emit: s }) {
|
|
12
|
-
const l = e,
|
|
13
|
-
l.disabled ||
|
|
14
|
-
};
|
|
15
|
-
return (
|
|
16
|
-
|
|
14
|
+
const l = e, d = s, o = () => {
|
|
15
|
+
l.disabled || d("update:modelValue", !l.modelValue);
|
|
16
|
+
}, a = c(() => l.labelI18n ? f(l.labelI18n) : l.label);
|
|
17
|
+
return (h, k) => (n(), i("div", p, [
|
|
18
|
+
r("button", {
|
|
17
19
|
type: "button",
|
|
18
20
|
role: "switch",
|
|
19
21
|
"aria-checked": e.modelValue,
|
|
20
|
-
"aria-label":
|
|
22
|
+
"aria-label": a.value || "Toggle",
|
|
21
23
|
disabled: e.disabled,
|
|
22
|
-
class:
|
|
23
|
-
onClick:
|
|
24
|
+
class: t(["relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", [e.modelValue ? "bg-primary" : "bg-input", l.class]]),
|
|
25
|
+
onClick: o
|
|
24
26
|
}, [
|
|
25
|
-
|
|
27
|
+
r("span", {
|
|
26
28
|
"aria-hidden": "true",
|
|
27
|
-
class:
|
|
29
|
+
class: t([
|
|
30
|
+
"pointer-events-none inline-block h-5 w-5 transform rounded-full bg-background shadow-lg ring-0 transition duration-200 ease-in-out",
|
|
31
|
+
e.modelValue ? "translate-x-5 rtl:translate-x-0" : "translate-x-0 rtl:-translate-x-5"
|
|
32
|
+
])
|
|
28
33
|
}, null, 2)
|
|
29
|
-
], 10,
|
|
30
|
-
|
|
34
|
+
], 10, g),
|
|
35
|
+
a.value ? (n(), i("label", {
|
|
31
36
|
key: 0,
|
|
32
|
-
class:
|
|
33
|
-
onClick:
|
|
34
|
-
},
|
|
37
|
+
class: t([e.disabled ? "opacity-50" : "", "text-sm font-medium text-foreground cursor-pointer"]),
|
|
38
|
+
onClick: o
|
|
39
|
+
}, m(a.value), 3)) : b("", !0)
|
|
35
40
|
]));
|
|
36
41
|
}
|
|
37
42
|
});
|
|
38
43
|
export {
|
|
39
|
-
|
|
44
|
+
v as default
|
|
40
45
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { defineComponent as M, ref as g, watch as c, onMounted as j, computed as p, openBlock as i, createElementBlock as u, normalizeClass as l, normalizeStyle as A, createCommentVNode as y, Fragment as E, renderList as
|
|
1
|
+
import { defineComponent as M, ref as g, watch as c, onMounted as j, computed as p, openBlock as i, createElementBlock as u, normalizeClass as l, normalizeStyle as A, createCommentVNode as y, Fragment as E, renderList as N, createBlock as O, createElementVNode as T, toDisplayString as _, nextTick as D } from "vue";
|
|
2
2
|
import { useResizeObserver as F } from "@vueuse/core";
|
|
3
|
-
import
|
|
4
|
-
|
|
3
|
+
import q from "../Icon.vue.js";
|
|
4
|
+
import { $t as G } from "../../utils/i18n.js";
|
|
5
|
+
const H = ["aria-selected", "disabled", "onClick"], U = /* @__PURE__ */ M({
|
|
5
6
|
__name: "Tabes",
|
|
6
7
|
props: {
|
|
7
8
|
options: {},
|
|
@@ -15,7 +16,7 @@ const q = ["aria-selected", "disabled", "onClick"], K = /* @__PURE__ */ M({
|
|
|
15
16
|
setup(s, { emit: x }) {
|
|
16
17
|
const r = s, v = x, d = g(null), f = g(/* @__PURE__ */ new Map()), h = (e, n) => {
|
|
17
18
|
e ? f.value.set(n, e) : f.value.delete(n);
|
|
18
|
-
},
|
|
19
|
+
}, b = g({
|
|
19
20
|
width: "0px",
|
|
20
21
|
height: "0px",
|
|
21
22
|
transform: "translate(0px, 0px)",
|
|
@@ -24,14 +25,14 @@ const q = ["aria-selected", "disabled", "onClick"], K = /* @__PURE__ */ M({
|
|
|
24
25
|
await D();
|
|
25
26
|
const e = d.value, n = f.value.get(r.modelValue);
|
|
26
27
|
if (!e || !n) {
|
|
27
|
-
|
|
28
|
+
b.value.opacity = 0;
|
|
28
29
|
return;
|
|
29
30
|
}
|
|
30
|
-
const a = e.getBoundingClientRect(), t = n.getBoundingClientRect(),
|
|
31
|
-
|
|
32
|
-
width: `${
|
|
33
|
-
height: `${
|
|
34
|
-
transform: `translate(${
|
|
31
|
+
const a = e.getBoundingClientRect(), t = n.getBoundingClientRect(), m = t.left - a.left, B = t.top - a.top, L = t.width, I = t.height;
|
|
32
|
+
b.value = {
|
|
33
|
+
width: `${L}px`,
|
|
34
|
+
height: `${I}px`,
|
|
35
|
+
transform: `translate(${m}px, ${B}px)`,
|
|
35
36
|
opacity: 1
|
|
36
37
|
};
|
|
37
38
|
};
|
|
@@ -81,8 +82,8 @@ const q = ["aria-selected", "disabled", "onClick"], K = /* @__PURE__ */ M({
|
|
|
81
82
|
}
|
|
82
83
|
else
|
|
83
84
|
t = a ? "text-muted-foreground" : "text-muted-foreground hover:text-foreground/80";
|
|
84
|
-
const
|
|
85
|
-
return [z.value, t,
|
|
85
|
+
const m = e.disabled ? "opacity-50 cursor-not-allowed" : "";
|
|
86
|
+
return [z.value, t, m].join(" ");
|
|
86
87
|
}, R = p(() => {
|
|
87
88
|
const e = "absolute left-0 top-0 transition-all duration-300 ease-[cubic-bezier(0.25,0.1,0.25,1)] z-0 pointer-events-none";
|
|
88
89
|
return r.variant === "line" ? `${e} !h-[2px] !top-auto bottom-0` : `${e} rounded-md shadow-sm`;
|
|
@@ -94,7 +95,7 @@ const q = ["aria-selected", "disabled", "onClick"], K = /* @__PURE__ */ M({
|
|
|
94
95
|
success: "bg-success",
|
|
95
96
|
outline: "bg-accent/50 ring-1 ring-border",
|
|
96
97
|
line: "bg-primary"
|
|
97
|
-
})[r.variant];
|
|
98
|
+
})[r.variant], $ = (e) => e.labelI18n ? G(e.labelI18n) : e.label;
|
|
98
99
|
return (e, n) => (i(), u("div", {
|
|
99
100
|
ref_key: "containerRef",
|
|
100
101
|
ref: d,
|
|
@@ -104,9 +105,9 @@ const q = ["aria-selected", "disabled", "onClick"], K = /* @__PURE__ */ M({
|
|
|
104
105
|
s.modelValue !== void 0 ? (i(), u("div", {
|
|
105
106
|
key: 0,
|
|
106
107
|
class: l([R.value, S()]),
|
|
107
|
-
style: A(
|
|
108
|
+
style: A(b.value)
|
|
108
109
|
}, null, 6)) : y("", !0),
|
|
109
|
-
(i(!0), u(E, null,
|
|
110
|
+
(i(!0), u(E, null, N(s.options, (a) => (i(), u("button", {
|
|
110
111
|
key: a.value,
|
|
111
112
|
ref_for: !0,
|
|
112
113
|
ref: (t) => h(t, a.value),
|
|
@@ -117,18 +118,18 @@ const q = ["aria-selected", "disabled", "onClick"], K = /* @__PURE__ */ M({
|
|
|
117
118
|
onClick: (t) => k(a),
|
|
118
119
|
type: "button"
|
|
119
120
|
}, [
|
|
120
|
-
a.icon ? (i(),
|
|
121
|
+
a.icon ? (i(), O(q, {
|
|
121
122
|
key: 0,
|
|
122
123
|
icon: a.icon,
|
|
123
124
|
class: l(s.size === "sm" ? "w-3.5 h-3.5" : "w-4 h-4")
|
|
124
125
|
}, null, 8, ["icon", "class"])) : y("", !0),
|
|
125
126
|
T("span", {
|
|
126
127
|
class: l(["whitespace-nowrap z-20 relative", s.textClass])
|
|
127
|
-
}, _(a
|
|
128
|
-
], 10,
|
|
128
|
+
}, _($(a)), 3)
|
|
129
|
+
], 10, H))), 128))
|
|
129
130
|
], 2));
|
|
130
131
|
}
|
|
131
132
|
});
|
|
132
133
|
export {
|
|
133
|
-
|
|
134
|
+
U as default
|
|
134
135
|
};
|
|
@@ -1,34 +1,36 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
1
|
+
import { defineComponent as i, computed as r, openBlock as p, createElementBlock as m, normalizeClass as f } from "vue";
|
|
2
|
+
import { $t as b } from "../utils/i18n.js";
|
|
3
|
+
const x = ["value", "rows", "disabled", "placeholder"], g = /* @__PURE__ */ i({
|
|
3
4
|
__name: "Textarea",
|
|
4
5
|
props: {
|
|
5
6
|
modelValue: { default: "" },
|
|
6
7
|
placeholder: {},
|
|
8
|
+
placeholderI18n: {},
|
|
7
9
|
disabled: { type: Boolean, default: !1 },
|
|
8
10
|
rows: { default: 3 },
|
|
9
11
|
class: { default: "" }
|
|
10
12
|
},
|
|
11
13
|
emits: ["update:modelValue", "focus", "blur"],
|
|
12
|
-
setup(l, { emit:
|
|
13
|
-
const
|
|
14
|
+
setup(l, { emit: s }) {
|
|
15
|
+
const o = l, t = s, n = r(() => [
|
|
14
16
|
"flex min-h-[80px] w-full rounded-md border border-input px-3 py-2 text-sm placeholder:text-muted-foreground/50 focus-visible:outline-none focus-visible:border-primary disabled:cursor-not-allowed disabled:opacity-50 bg-background text-foreground",
|
|
15
|
-
|
|
16
|
-
].join(" ")), u = (
|
|
17
|
-
const e =
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
return (
|
|
17
|
+
o.class
|
|
18
|
+
].join(" ")), u = (d) => {
|
|
19
|
+
const e = d.target;
|
|
20
|
+
t("update:modelValue", e.value);
|
|
21
|
+
}, c = r(() => o.placeholderI18n ? b(o.placeholderI18n) : o.placeholder);
|
|
22
|
+
return (d, e) => (p(), m("textarea", {
|
|
21
23
|
value: l.modelValue,
|
|
22
24
|
rows: l.rows,
|
|
23
25
|
disabled: l.disabled,
|
|
24
|
-
placeholder:
|
|
25
|
-
class:
|
|
26
|
+
placeholder: c.value,
|
|
27
|
+
class: f(n.value),
|
|
26
28
|
onInput: u,
|
|
27
|
-
onFocus: e[0] || (e[0] = (
|
|
28
|
-
onBlur: e[1] || (e[1] = (
|
|
29
|
-
}, null, 42,
|
|
29
|
+
onFocus: e[0] || (e[0] = (a) => t("focus", a)),
|
|
30
|
+
onBlur: e[1] || (e[1] = (a) => t("blur", a))
|
|
31
|
+
}, null, 42, x));
|
|
30
32
|
}
|
|
31
33
|
});
|
|
32
34
|
export {
|
|
33
|
-
|
|
35
|
+
g as default
|
|
34
36
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTheme as
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { defineComponent as m, computed as d, renderSlot as u, unref as o, createVNode as h, normalizeClass as g } from "vue";
|
|
2
|
+
import { useTheme as f } from "../composables/useTheme.js";
|
|
3
|
+
import T from "./Button.vue.js";
|
|
4
|
+
import { $t as c } from "../utils/i18n.js";
|
|
5
|
+
const w = /* @__PURE__ */ m({
|
|
5
6
|
__name: "ThemeToggle",
|
|
6
7
|
props: {
|
|
7
8
|
class: {},
|
|
@@ -10,23 +11,32 @@ const g = /* @__PURE__ */ a({
|
|
|
10
11
|
variant: {}
|
|
11
12
|
},
|
|
12
13
|
setup(t) {
|
|
13
|
-
const { theme:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const { theme: i, toggleTheme: r } = f(), a = d(() => {
|
|
15
|
+
const n = i.value === "light", s = "vlite.themeToggle.switchToDark", l = "vlite.themeToggle.switchToLight";
|
|
16
|
+
if (n) {
|
|
17
|
+
const e = c(s);
|
|
18
|
+
return e !== s ? e : "Switch to dark mode";
|
|
19
|
+
} else {
|
|
20
|
+
const e = c(l);
|
|
21
|
+
return e !== l ? e : "Switch to light mode";
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
return (n, s) => u(n.$slots, "default", {
|
|
25
|
+
toggleTheme: o(r),
|
|
26
|
+
theme: o(i)
|
|
17
27
|
}, () => [
|
|
18
|
-
|
|
19
|
-
icon:
|
|
28
|
+
h(T, {
|
|
29
|
+
icon: o(i) === "light" ? "lucide:sun" : "lucide:moon",
|
|
20
30
|
variant: t.variant || "secondary",
|
|
21
31
|
rounded: t.rounded || "md",
|
|
22
32
|
size: t.size,
|
|
23
|
-
class:
|
|
24
|
-
title:
|
|
25
|
-
onClick:
|
|
33
|
+
class: g(t.class),
|
|
34
|
+
title: a.value,
|
|
35
|
+
onClick: o(r)
|
|
26
36
|
}, null, 8, ["icon", "variant", "rounded", "size", "class", "title", "onClick"])
|
|
27
37
|
]);
|
|
28
38
|
}
|
|
29
39
|
});
|
|
30
40
|
export {
|
|
31
|
-
|
|
41
|
+
w as default
|
|
32
42
|
};
|