vlite3 1.1.2 → 1.1.4
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/AttachmentsList/AttachmentsList.vue.d.ts +1 -1
- package/components/AttachmentsList/AttachmentsList.vue.js +237 -163
- package/components/Avatar.vue.js +1 -1
- package/components/AvatarUploader/AvatarUploader.vue.js +40 -37
- package/components/Button.vue.js +30 -28
- package/components/Carousel/Carousel.vue.d.ts +2 -2
- package/components/CategoryManager/CategoryManager.vue.d.ts +10 -2
- package/components/CategoryManager/CategoryManager.vue.js +137 -118
- package/components/CategoryManager/CategoryNode.vue.d.ts +2 -0
- package/components/CategoryManager/CategoryNode.vue.js +93 -88
- package/components/Chat/ChatBubble.vue.js +22 -22
- package/components/CheckBox.vue.js +29 -28
- package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
- package/components/CommandPalette/{CommandPaletteItem.vue.js → CommandPaletteItem.vue2.js} +1 -1
- package/components/ConfirmationModal.vue.js +30 -28
- package/components/CopyButton.vue.d.ts +50 -0
- package/components/CopyButton.vue.js +69 -0
- package/components/CopyButton.vue2.js +4 -0
- package/components/DataTable/DataTable.vue.js +44 -44
- package/components/DatePicker.vue.js +41 -35
- package/components/DateRangePicker.vue.js +18 -17
- package/components/Dropdown/Dropdown.vue.d.ts +3 -0
- package/components/Dropdown/Dropdown.vue.js +117 -115
- package/components/Dropdown/DropdownBooleanItem.vue.js +16 -15
- package/components/Dropdown/DropdownItem.vue.js +21 -20
- package/components/Dropdown/DropdownMenu.vue.js +1 -1
- package/components/Dropdown/DropdownMenu.vue2.js +13 -12
- package/components/Dropdown/DropdownTrigger.vue.d.ts +2 -0
- package/components/Dropdown/DropdownTrigger.vue.js +10 -6
- package/components/Dropdown/composables/useDropdownHydration.d.ts +2 -0
- package/components/Dropdown/composables/useDropdownSelection.d.ts +1 -0
- package/components/Dropdown/composables/useDropdownSelection.js +46 -31
- package/components/FilePicker/FilePicker.vue.js +93 -90
- package/components/Form/CustomFields.vue.js +2 -2
- package/components/Form/Form.vue.js +2 -2
- package/components/Form/Form.vue2.js +68 -64
- package/components/Form/FormField.vue.js +204 -148
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +28 -27
- package/components/Form/types.d.ts +2 -2
- package/components/Form/utils/form.utils.d.ts +3 -3
- package/components/Form/utils/form.utils.js +37 -37
- package/components/Input.vue.js +64 -62
- package/components/Invoice/Invoice.vue.js +9 -7
- package/components/Invoice/InvoiceTotals.vue.d.ts +14 -0
- package/components/Invoice/InvoiceTotals.vue.js +86 -0
- package/components/Invoice/InvoiceTotals.vue2.js +4 -0
- package/components/Invoice/InvoiceVariant1.vue.d.ts +3 -1
- package/components/Invoice/InvoiceVariant1.vue.js +194 -207
- package/components/Invoice/InvoiceVariant2.vue.d.ts +3 -1
- package/components/Invoice/InvoiceVariant2.vue.js +109 -118
- package/components/Invoice/InvoiceVariant3.vue.d.ts +3 -1
- package/components/Invoice/InvoiceVariant3.vue.js +157 -167
- package/components/Invoice/InvoiceVariant4.vue.d.ts +3 -1
- package/components/Invoice/InvoiceVariant4.vue.js +192 -202
- package/components/Invoice/index.d.ts +1 -0
- package/components/Invoice/types.d.ts +22 -0
- package/components/Masonry/Masonry.vue.d.ts +1 -1
- package/components/Modal.vue.js +1 -1
- package/components/Modal.vue2.js +60 -54
- package/components/MultiSelect/MultiSelect.vue.js +47 -46
- package/components/MultiSelect/composables/useMultiSelectHydration.d.ts +2 -0
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/NumberInput.vue.js +2 -2
- package/components/NumberInput.vue2.js +121 -116
- package/components/PricingPlan/PricingPlan.vue.d.ts +1 -1
- package/components/SidePanel.vue.js +2 -2
- package/components/SidePanel.vue2.js +58 -52
- package/components/Stats/StatItem.vue.js +96 -91
- package/components/Stats/types.d.ts +1 -0
- package/components/Switch.vue.d.ts +6 -1
- package/components/Switch.vue.js +61 -24
- package/components/TagInput/TagInput.vue.d.ts +187 -0
- package/components/TagInput/TagInput.vue.js +113 -0
- package/components/TagInput/TagInput.vue2.js +4 -0
- package/components/TagInput/index.d.ts +1 -0
- package/components/Textarea.vue.js +19 -18
- package/components/ThumbnailSelector/ThumbnailSelector.vue.js +2 -2
- package/components/ThumbnailSelector/ThumbnailSelector.vue2.js +19 -16
- package/core/config.d.ts +36 -0
- package/index.d.ts +2 -0
- package/index.js +130 -124
- package/package.json +1 -1
- package/style.css +616 -1
- package/types/button.d.ts +1 -1
- package/types/styles.d.ts +1 -0
- package/utils/functions.js +9 -9
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { $t as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import { defineComponent as B, computed as k, openBlock as e, createElementBlock as i, normalizeStyle as I, normalizeClass as n, Fragment as b, createElementVNode as r, toDisplayString as o, unref as y, createBlock as c, createCommentVNode as d } from "vue";
|
|
2
|
+
import { $t as s } from "../../utils/i18n.js";
|
|
3
|
+
import { formatCurrency as C } from "../../utils/functions.js";
|
|
4
|
+
import f from "./components/StatTrend.vue.js";
|
|
5
|
+
import g from "./components/StatIconBox.vue.js";
|
|
6
|
+
const j = { class: "flex items-center justify-between w-full mt-1" }, $ = {
|
|
6
7
|
key: 0,
|
|
7
8
|
class: "h-8 w-24 bg-gray-50 animate-pulse rounded-md"
|
|
8
|
-
},
|
|
9
|
+
}, N = {
|
|
9
10
|
key: 0,
|
|
10
11
|
class: "h-9 w-24 bg-gray-50 animate-pulse rounded-md"
|
|
11
|
-
},
|
|
12
|
+
}, V = {
|
|
12
13
|
key: 1,
|
|
13
14
|
class: "h-8 w-20 bg-gray-50 animate-pulse rounded-md mt-1"
|
|
14
15
|
}, E = {
|
|
@@ -17,13 +18,13 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
|
|
|
17
18
|
}, M = {
|
|
18
19
|
key: 0,
|
|
19
20
|
class: "h-9 w-24 bg-gray-50 animate-pulse rounded-md mt-0.5"
|
|
20
|
-
},
|
|
21
|
+
}, D = {
|
|
21
22
|
key: 1,
|
|
22
23
|
class: "h-6 w-5 bg-gray-50 animate-pulse rounded-sm shrink-0"
|
|
23
|
-
},
|
|
24
|
+
}, F = { class: "flex-1 flex flex-col justify-center min-w-0" }, L = { class: "flex items-baseline gap-2 mt-1" }, P = {
|
|
24
25
|
key: 0,
|
|
25
26
|
class: "h-8 w-24 bg-gray-50 animate-pulse rounded-md"
|
|
26
|
-
},
|
|
27
|
+
}, K = /* @__PURE__ */ B({
|
|
27
28
|
__name: "StatItem",
|
|
28
29
|
props: {
|
|
29
30
|
item: {},
|
|
@@ -38,8 +39,12 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
|
|
|
38
39
|
iconBoxStyle: { default: "filled" }
|
|
39
40
|
},
|
|
40
41
|
setup(t) {
|
|
41
|
-
const
|
|
42
|
-
|
|
42
|
+
const l = t;
|
|
43
|
+
function m(a) {
|
|
44
|
+
return a.isPrice ? C(Number(a.value)) : a.value;
|
|
45
|
+
}
|
|
46
|
+
const S = k(() => {
|
|
47
|
+
const a = l.layout === "inline-label-value" ? "flex px-3.5 py-3" : "flex p-3", x = {
|
|
43
48
|
"icon-left": "flex-row items-center gap-3 text-left",
|
|
44
49
|
"icon-right": "flex-row items-center justify-between gap-3 text-left",
|
|
45
50
|
"icon-top": "flex-col items-start gap-1 px-5! pt-2! text-left",
|
|
@@ -48,14 +53,14 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
|
|
|
48
53
|
"floating-icon": "flex-col items-start gap-1 text-left relative",
|
|
49
54
|
"split-bar": "flex-row items-center gap-3 text-left border-l-4",
|
|
50
55
|
"inline-label-value": "flex-row items-center gap-2.5 text-left"
|
|
51
|
-
},
|
|
56
|
+
}, h = x[l.layout] || x["icon-left"];
|
|
52
57
|
let u = "";
|
|
53
|
-
if (
|
|
54
|
-
|
|
58
|
+
if (l.attached)
|
|
59
|
+
l.variant === "transparent" ? u = "border-b border-r border-transparent bg-transparent hover:bg-muted/30 transition-colors" : l.variant === "outline" ? u = "border-b border-r border-border bg-transparent hover:bg-muted/30 transition-colors" : u = "border-b border-r border-border bg-card hover:bg-muted/30 transition-colors";
|
|
55
60
|
else {
|
|
56
|
-
switch (
|
|
61
|
+
switch (l.variant) {
|
|
57
62
|
case "solid": {
|
|
58
|
-
const
|
|
63
|
+
const w = l.item.color || "primary", v = {
|
|
59
64
|
primary: "bg-primary-light",
|
|
60
65
|
secondary: "bg-secondary",
|
|
61
66
|
success: "bg-success-light",
|
|
@@ -63,7 +68,7 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
|
|
|
63
68
|
danger: "bg-danger-light",
|
|
64
69
|
info: "bg-info-light"
|
|
65
70
|
};
|
|
66
|
-
u = `${
|
|
71
|
+
u = `${v[w] || v.primary}`;
|
|
67
72
|
break;
|
|
68
73
|
}
|
|
69
74
|
case "outline":
|
|
@@ -78,15 +83,15 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
|
|
|
78
83
|
}
|
|
79
84
|
u += " rounded-lg";
|
|
80
85
|
}
|
|
81
|
-
return [
|
|
82
|
-
}),
|
|
83
|
-
if (
|
|
84
|
-
const
|
|
85
|
-
if (
|
|
86
|
-
return { backgroundColor: `${
|
|
86
|
+
return [a, h, u].join(" ");
|
|
87
|
+
}), z = k(() => {
|
|
88
|
+
if (l.variant === "solid" && !l.attached) {
|
|
89
|
+
const a = l.item.color;
|
|
90
|
+
if (a && !["primary", "secondary", "success", "warning", "danger", "info"].includes(a))
|
|
91
|
+
return { backgroundColor: `${a}15` };
|
|
87
92
|
}
|
|
88
|
-
if (
|
|
89
|
-
const
|
|
93
|
+
if (l.layout === "split-bar") {
|
|
94
|
+
const a = l.item.color, x = {
|
|
90
95
|
primary: "var(--color-primary)",
|
|
91
96
|
secondary: "var(--color-secondary)",
|
|
92
97
|
success: "var(--color-success)",
|
|
@@ -94,32 +99,32 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
|
|
|
94
99
|
danger: "var(--color-danger)",
|
|
95
100
|
info: "var(--color-info)"
|
|
96
101
|
};
|
|
97
|
-
if (
|
|
98
|
-
return { borderLeftColor:
|
|
102
|
+
if (a)
|
|
103
|
+
return { borderLeftColor: x[a] || a };
|
|
99
104
|
}
|
|
100
105
|
return {};
|
|
101
106
|
});
|
|
102
|
-
return (
|
|
103
|
-
class:
|
|
104
|
-
style:
|
|
107
|
+
return (a, x) => (e(), i("div", {
|
|
108
|
+
class: n(S.value),
|
|
109
|
+
style: I(z.value)
|
|
105
110
|
}, [
|
|
106
|
-
t.layout === "title-top-icon-bottom-right" ? (e(), i(
|
|
111
|
+
t.layout === "title-top-icon-bottom-right" ? (e(), i(b, { key: 0 }, [
|
|
107
112
|
r("h3", {
|
|
108
|
-
class:
|
|
109
|
-
},
|
|
110
|
-
r("div",
|
|
113
|
+
class: n(t.titleSize || "text-sm font-medium text-muted-foreground truncate w-full")
|
|
114
|
+
}, o(t.item.titleI18n ? y(s)(t.item.titleI18n) : t.item.title), 3),
|
|
115
|
+
r("div", j, [
|
|
111
116
|
r("div", null, [
|
|
112
|
-
t.loading ? (e(), i("div",
|
|
117
|
+
t.loading ? (e(), i("div", $)) : (e(), i("p", {
|
|
113
118
|
key: 1,
|
|
114
|
-
class:
|
|
115
|
-
},
|
|
116
|
-
t.item.trend && !t.loading ? (e(),
|
|
119
|
+
class: n(t.valueSize || "text-2xl font-bold text-foreground truncate")
|
|
120
|
+
}, o(m(t.item)), 3)),
|
|
121
|
+
t.item.trend && !t.loading ? (e(), c(f, {
|
|
117
122
|
key: 2,
|
|
118
123
|
trend: t.item.trend,
|
|
119
124
|
layout: t.layout
|
|
120
|
-
}, null, 8, ["trend", "layout"])) :
|
|
125
|
+
}, null, 8, ["trend", "layout"])) : d("", !0)
|
|
121
126
|
]),
|
|
122
|
-
t.item.icon ? (e(),
|
|
127
|
+
t.item.icon ? (e(), c(g, {
|
|
123
128
|
key: 0,
|
|
124
129
|
item: t.item,
|
|
125
130
|
variant: t.variant,
|
|
@@ -128,23 +133,23 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
|
|
|
128
133
|
"icon-box-shape": t.iconBoxShape,
|
|
129
134
|
"icon-box-style": t.iconBoxStyle,
|
|
130
135
|
"icon-size": t.iconSize
|
|
131
|
-
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) :
|
|
136
|
+
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0)
|
|
132
137
|
])
|
|
133
|
-
], 64)) : t.layout === "centered-value-title" ? (e(), i(
|
|
134
|
-
t.loading ? (e(), i("div",
|
|
138
|
+
], 64)) : t.layout === "centered-value-title" ? (e(), i(b, { key: 1 }, [
|
|
139
|
+
t.loading ? (e(), i("div", N)) : (e(), i("p", {
|
|
135
140
|
key: 1,
|
|
136
|
-
class:
|
|
137
|
-
},
|
|
141
|
+
class: n(t.valueSize || "text-3xl font-bold text-foreground")
|
|
142
|
+
}, o(m(t.item)), 3)),
|
|
138
143
|
r("h3", {
|
|
139
|
-
class:
|
|
140
|
-
},
|
|
141
|
-
t.item.trend && !t.loading ? (e(),
|
|
144
|
+
class: n(t.titleSize || "text-sm font-medium text-muted-foreground")
|
|
145
|
+
}, o(t.item.titleI18n ? y(s)(t.item.titleI18n) : t.item.title), 3),
|
|
146
|
+
t.item.trend && !t.loading ? (e(), c(f, {
|
|
142
147
|
key: 2,
|
|
143
148
|
trend: t.item.trend,
|
|
144
149
|
layout: t.layout
|
|
145
|
-
}, null, 8, ["trend", "layout"])) :
|
|
146
|
-
], 64)) : t.layout === "floating-icon" ? (e(), i(
|
|
147
|
-
t.item.icon ? (e(),
|
|
150
|
+
}, null, 8, ["trend", "layout"])) : d("", !0)
|
|
151
|
+
], 64)) : t.layout === "floating-icon" ? (e(), i(b, { key: 2 }, [
|
|
152
|
+
t.item.icon ? (e(), c(g, {
|
|
148
153
|
key: 0,
|
|
149
154
|
item: t.item,
|
|
150
155
|
variant: t.variant,
|
|
@@ -154,36 +159,36 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
|
|
|
154
159
|
"icon-box-style": t.iconBoxStyle,
|
|
155
160
|
"icon-size": t.iconSize,
|
|
156
161
|
class: "absolute top-4 right-4"
|
|
157
|
-
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) :
|
|
162
|
+
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0),
|
|
158
163
|
r("h3", {
|
|
159
|
-
class:
|
|
160
|
-
},
|
|
161
|
-
t.loading ? (e(), i("div",
|
|
164
|
+
class: n(t.titleSize || "text-sm font-medium text-muted-foreground truncate pr-12")
|
|
165
|
+
}, o(t.item.titleI18n ? y(s)(t.item.titleI18n) : t.item.title), 3),
|
|
166
|
+
t.loading ? (e(), i("div", V)) : (e(), i("p", {
|
|
162
167
|
key: 2,
|
|
163
|
-
class:
|
|
164
|
-
},
|
|
165
|
-
t.item.trend && !t.loading ? (e(),
|
|
168
|
+
class: n(t.valueSize || "text-2xl font-bold text-foreground truncate mt-1")
|
|
169
|
+
}, o(m(t.item)), 3)),
|
|
170
|
+
t.item.trend && !t.loading ? (e(), c(f, {
|
|
166
171
|
key: 3,
|
|
167
172
|
trend: t.item.trend,
|
|
168
173
|
layout: t.layout
|
|
169
|
-
}, null, 8, ["trend", "layout"])) :
|
|
174
|
+
}, null, 8, ["trend", "layout"])) : d("", !0)
|
|
170
175
|
], 64)) : t.layout === "split-bar" ? (e(), i("div", E, [
|
|
171
176
|
r("h3", {
|
|
172
|
-
class:
|
|
177
|
+
class: n(
|
|
173
178
|
t.titleSize || "text-xs font-semibold uppercase tracking-widest text-muted-foreground truncate"
|
|
174
179
|
)
|
|
175
|
-
},
|
|
180
|
+
}, o(t.item.titleI18n ? y(s)(t.item.titleI18n) : t.item.title), 3),
|
|
176
181
|
t.loading ? (e(), i("div", M)) : (e(), i("p", {
|
|
177
182
|
key: 1,
|
|
178
|
-
class:
|
|
179
|
-
},
|
|
180
|
-
t.item.trend && !t.loading ? (e(),
|
|
183
|
+
class: n(t.valueSize || "text-3xl font-black text-foreground truncate mt-0.5")
|
|
184
|
+
}, o(m(t.item)), 3)),
|
|
185
|
+
t.item.trend && !t.loading ? (e(), c(f, {
|
|
181
186
|
key: 2,
|
|
182
187
|
trend: t.item.trend,
|
|
183
188
|
layout: t.layout
|
|
184
|
-
}, null, 8, ["trend", "layout"])) :
|
|
185
|
-
])) : t.layout === "inline-label-value" ? (e(), i(
|
|
186
|
-
t.item.icon ? (e(),
|
|
189
|
+
}, null, 8, ["trend", "layout"])) : d("", !0)
|
|
190
|
+
])) : t.layout === "inline-label-value" ? (e(), i(b, { key: 4 }, [
|
|
191
|
+
t.item.icon ? (e(), c(g, {
|
|
187
192
|
key: 0,
|
|
188
193
|
item: t.item,
|
|
189
194
|
variant: t.variant,
|
|
@@ -192,21 +197,21 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
|
|
|
192
197
|
"icon-box-shape": t.iconBoxShape,
|
|
193
198
|
"icon-box-style": t.iconBoxStyle,
|
|
194
199
|
"icon-size": t.iconSize
|
|
195
|
-
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) :
|
|
200
|
+
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0),
|
|
196
201
|
r("span", {
|
|
197
|
-
class:
|
|
198
|
-
},
|
|
199
|
-
t.loading ? (e(), i("div",
|
|
202
|
+
class: n([t.titleSize || "-text-fs-2 font-medium text-muted-foreground truncate", "flex-1 min-w-0"])
|
|
203
|
+
}, o(t.item.titleI18n ? y(s)(t.item.titleI18n) : t.item.title), 3),
|
|
204
|
+
t.loading ? (e(), i("div", D)) : (e(), i("span", {
|
|
200
205
|
key: 2,
|
|
201
|
-
class:
|
|
202
|
-
},
|
|
203
|
-
t.item.trend && !t.loading ? (e(),
|
|
206
|
+
class: n(t.valueSize || "-text-fs-1 font-semibold text-foreground tabular-nums shrink-0")
|
|
207
|
+
}, o(m(t.item)), 3)),
|
|
208
|
+
t.item.trend && !t.loading ? (e(), c(f, {
|
|
204
209
|
key: 3,
|
|
205
210
|
trend: t.item.trend,
|
|
206
211
|
layout: t.layout
|
|
207
|
-
}, null, 8, ["trend", "layout"])) :
|
|
208
|
-
], 64)) : (e(), i(
|
|
209
|
-
t.item.icon && t.layout !== "icon-right" ? (e(),
|
|
212
|
+
}, null, 8, ["trend", "layout"])) : d("", !0)
|
|
213
|
+
], 64)) : (e(), i(b, { key: 5 }, [
|
|
214
|
+
t.item.icon && t.layout !== "icon-right" ? (e(), c(g, {
|
|
210
215
|
key: 0,
|
|
211
216
|
item: t.item,
|
|
212
217
|
variant: t.variant,
|
|
@@ -215,24 +220,24 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
|
|
|
215
220
|
"icon-box-shape": t.iconBoxShape,
|
|
216
221
|
"icon-box-style": t.iconBoxStyle,
|
|
217
222
|
"icon-size": t.iconSize
|
|
218
|
-
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) :
|
|
219
|
-
r("div",
|
|
223
|
+
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0),
|
|
224
|
+
r("div", F, [
|
|
220
225
|
r("h3", {
|
|
221
|
-
class:
|
|
222
|
-
},
|
|
223
|
-
r("div",
|
|
224
|
-
t.loading ? (e(), i("div",
|
|
226
|
+
class: n(t.titleSize || "text-sm font-medium text-muted-foreground truncate")
|
|
227
|
+
}, o(t.item.titleI18n ? y(s)(t.item.titleI18n) : t.item.title), 3),
|
|
228
|
+
r("div", L, [
|
|
229
|
+
t.loading ? (e(), i("div", P)) : (e(), i("p", {
|
|
225
230
|
key: 1,
|
|
226
|
-
class:
|
|
227
|
-
},
|
|
231
|
+
class: n(t.valueSize || "text-2xl font-bold text-foreground truncate")
|
|
232
|
+
}, o(m(t.item)), 3))
|
|
228
233
|
]),
|
|
229
|
-
t.item.trend && !t.loading ? (e(),
|
|
234
|
+
t.item.trend && !t.loading ? (e(), c(f, {
|
|
230
235
|
key: 0,
|
|
231
236
|
trend: t.item.trend,
|
|
232
237
|
layout: t.layout
|
|
233
|
-
}, null, 8, ["trend", "layout"])) :
|
|
238
|
+
}, null, 8, ["trend", "layout"])) : d("", !0)
|
|
234
239
|
]),
|
|
235
|
-
t.item.icon && t.layout === "icon-right" ? (e(),
|
|
240
|
+
t.item.icon && t.layout === "icon-right" ? (e(), c(g, {
|
|
236
241
|
key: 1,
|
|
237
242
|
item: t.item,
|
|
238
243
|
variant: t.variant,
|
|
@@ -241,11 +246,11 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
|
|
|
241
246
|
"icon-box-shape": t.iconBoxShape,
|
|
242
247
|
"icon-box-style": t.iconBoxStyle,
|
|
243
248
|
"icon-size": t.iconSize
|
|
244
|
-
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) :
|
|
249
|
+
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0)
|
|
245
250
|
], 64))
|
|
246
251
|
], 6));
|
|
247
252
|
}
|
|
248
253
|
});
|
|
249
254
|
export {
|
|
250
|
-
|
|
255
|
+
K as default
|
|
251
256
|
};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
type SwitchVariant = 'basic' | 'card';
|
|
1
2
|
interface Props {
|
|
2
3
|
modelValue?: boolean;
|
|
3
4
|
disabled?: boolean;
|
|
4
5
|
label?: string;
|
|
5
6
|
labelI18n?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
descriptionI18n?: string;
|
|
9
|
+
variant?: SwitchVariant;
|
|
6
10
|
class?: string;
|
|
7
11
|
id?: string;
|
|
8
12
|
}
|
|
@@ -12,7 +16,8 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
12
16
|
"onUpdate:modelValue"?: (value: boolean) => any;
|
|
13
17
|
}>, {
|
|
14
18
|
class: string;
|
|
19
|
+
variant: SwitchVariant;
|
|
15
20
|
disabled: boolean;
|
|
16
21
|
modelValue: boolean;
|
|
17
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {},
|
|
22
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
18
23
|
export default _default;
|
package/components/Switch.vue.js
CHANGED
|
@@ -1,47 +1,84 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { $t as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as h, computed as b, openBlock as n, createElementBlock as s, normalizeClass as i, createElementVNode as o, toDisplayString as d, createCommentVNode as u, withModifiers as v } from "vue";
|
|
2
|
+
import { $t as m } from "../utils/i18n.js";
|
|
3
|
+
const w = { class: "flex flex-col gap-0.5 min-w-0" }, p = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "text-sm font-medium text-foreground leading-snug select-none"
|
|
6
|
+
}, k = {
|
|
7
|
+
key: 1,
|
|
8
|
+
class: "text-xs text-muted-foreground leading-snug select-none"
|
|
9
|
+
}, y = ["id", "aria-checked", "aria-label", "disabled", "data-testid"], x = ["id", "aria-checked", "aria-label", "disabled", "data-testid"], I = /* @__PURE__ */ h({
|
|
4
10
|
__name: "Switch",
|
|
5
11
|
props: {
|
|
6
12
|
modelValue: { type: Boolean, default: !1 },
|
|
7
13
|
disabled: { type: Boolean, default: !1 },
|
|
8
14
|
label: {},
|
|
9
15
|
labelI18n: {},
|
|
16
|
+
description: {},
|
|
17
|
+
descriptionI18n: {},
|
|
18
|
+
variant: { default: "basic" },
|
|
10
19
|
class: { default: "" },
|
|
11
20
|
id: {}
|
|
12
21
|
},
|
|
13
22
|
emits: ["update:modelValue"],
|
|
14
|
-
setup(e, { emit:
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
setup(e, { emit: f }) {
|
|
24
|
+
const a = e, g = f, r = () => {
|
|
25
|
+
a.disabled || g("update:modelValue", !a.modelValue);
|
|
26
|
+
}, t = b(() => a.labelI18n ? m(a.labelI18n) : a.label), c = b(
|
|
27
|
+
() => a.descriptionI18n ? m(a.descriptionI18n) : a.description
|
|
28
|
+
);
|
|
29
|
+
return (l, $) => e.variant === "card" ? (n(), s("div", {
|
|
30
|
+
key: 0,
|
|
31
|
+
class: i(["flex items-start justify-between gap-4 w-full rounded-md border border-border bg-background px-4 py-3 cursor-pointer", e.disabled ? "opacity-50 pointer-events-none" : ""]),
|
|
32
|
+
onClick: r
|
|
33
|
+
}, [
|
|
34
|
+
o("div", w, [
|
|
35
|
+
t.value ? (n(), s("span", p, d(t.value), 1)) : u("", !0),
|
|
36
|
+
c.value ? (n(), s("span", k, d(c.value), 1)) : u("", !0)
|
|
37
|
+
]),
|
|
38
|
+
o("button", {
|
|
20
39
|
id: e.id,
|
|
21
40
|
type: "button",
|
|
22
41
|
role: "switch",
|
|
23
42
|
"aria-checked": e.modelValue,
|
|
24
|
-
"aria-label":
|
|
43
|
+
"aria-label": t.value || "Toggle",
|
|
25
44
|
disabled: e.disabled,
|
|
26
|
-
class:
|
|
27
|
-
|
|
45
|
+
class: i(["relative mt-0.5 inline-flex h-5.5 w-10.5 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"]),
|
|
46
|
+
"data-testid": l.$attrs["data-testid"] || (l.$attrs.name ? `switch-${l.$attrs.name}` : e.id ? `switch-${e.id}` : t.value ? `switch-${t.value.toString().toLowerCase().replace(/[^a-z0-9]+/g, "-")}` : "switch"),
|
|
47
|
+
onClick: v(r, ["stop"])
|
|
28
48
|
}, [
|
|
29
|
-
|
|
49
|
+
o("span", {
|
|
30
50
|
"aria-hidden": "true",
|
|
31
|
-
class:
|
|
32
|
-
"pointer-events-none inline-block h-4.5 w-4.5 transform rounded-full bg-background shadow-lg ring-0 transition duration-200 ease-in-out",
|
|
33
|
-
e.modelValue ? "translate-x-5 rtl:translate-x-0" : "translate-x-0 rtl:-translate-x-5"
|
|
34
|
-
])
|
|
51
|
+
class: i(["pointer-events-none inline-block h-4.5 w-4.5 transform rounded-full bg-background shadow-lg ring-0 transition duration-200 ease-in-out", e.modelValue ? "translate-x-5 rtl:translate-x-0" : "translate-x-0 rtl:-translate-x-5"])
|
|
35
52
|
}, null, 2)
|
|
36
|
-
], 10,
|
|
37
|
-
|
|
53
|
+
], 10, y)
|
|
54
|
+
], 2)) : (n(), s("div", {
|
|
55
|
+
key: 1,
|
|
56
|
+
class: i(["inline-flex items-center gap-2", a.class])
|
|
57
|
+
}, [
|
|
58
|
+
o("button", {
|
|
59
|
+
id: e.id,
|
|
60
|
+
type: "button",
|
|
61
|
+
role: "switch",
|
|
62
|
+
"aria-checked": e.modelValue,
|
|
63
|
+
"aria-label": t.value || "Toggle",
|
|
64
|
+
disabled: e.disabled,
|
|
65
|
+
class: i(["relative inline-flex h-5.5 w-10.5 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"]),
|
|
66
|
+
"data-testid": l.$attrs["data-testid"] || (l.$attrs.name ? `switch-${l.$attrs.name}` : e.id ? `switch-${e.id}` : t.value ? `switch-${t.value.toString().toLowerCase().replace(/[^a-z0-9]+/g, "-")}` : "switch"),
|
|
67
|
+
onClick: r
|
|
68
|
+
}, [
|
|
69
|
+
o("span", {
|
|
70
|
+
"aria-hidden": "true",
|
|
71
|
+
class: i(["pointer-events-none inline-block h-4.5 w-4.5 transform rounded-full bg-background shadow-lg ring-0 transition duration-200 ease-in-out", e.modelValue ? "translate-x-5 rtl:translate-x-0" : "translate-x-0 rtl:-translate-x-5"])
|
|
72
|
+
}, null, 2)
|
|
73
|
+
], 10, x),
|
|
74
|
+
t.value ? (n(), s("label", {
|
|
38
75
|
key: 0,
|
|
39
|
-
class:
|
|
40
|
-
onClick:
|
|
41
|
-
},
|
|
42
|
-
]));
|
|
76
|
+
class: i([e.disabled ? "opacity-50" : "", "text-sm font-medium text-foreground cursor-pointer"]),
|
|
77
|
+
onClick: r
|
|
78
|
+
}, d(t.value), 3)) : u("", !0)
|
|
79
|
+
], 2));
|
|
43
80
|
}
|
|
44
81
|
});
|
|
45
82
|
export {
|
|
46
|
-
|
|
83
|
+
I as default
|
|
47
84
|
};
|