vlite3 0.6.1 → 0.6.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/CheckBox.vue.js +13 -12
- package/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +2 -2
- package/components/CommandPaletteContent.vue.js +1 -1
- package/components/CommandPaletteContent.vue2.js +2 -2
- package/components/Dropdown/Dropdown.vue.js +123 -106
- package/components/Form/Form.vue.d.ts +0 -23
- package/components/Form/Form.vue.js +1 -1
- package/components/Form/Form.vue2.js +146 -141
- package/components/Form/FormField.vue.js +6 -5
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +8 -8
- package/components/Input.vue.js +13 -13
- package/components/Modal.vue.js +1 -1
- package/components/Modal.vue2.js +66 -63
- package/components/Navbar/NavbarTabs.vue.js +3 -3
- package/components/Pagination/Pagination.vue.d.ts +2 -0
- package/components/Pagination/Pagination.vue.js +163 -118
- package/components/Pagination/index.d.ts +6 -0
- package/components/Screen/ScreenFilter.vue.js +1 -1
- package/components/SidePanel.vue.js +61 -59
- package/components/SidebarMenu/SidebarMenu.vue.js +89 -87
- package/components/SidebarMenu/SidebarMenuItem.vue.js +161 -139
- package/components/Switch.vue.js +2 -2
- package/components/Textarea.vue.js +4 -2
- package/components/Tooltip.vue.js +5 -4
- package/package.json +2 -2
- package/style.css +8 -8
- /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useForm as
|
|
1
|
+
import { defineComponent as le, inject as oe, computed as n, ref as ne, watch as $, onUnmounted as re, openBlock as o, createElementBlock as d, withModifiers as ue, normalizeClass as g, createVNode as N, unref as s, createCommentVNode as c, Fragment as de, renderList as ce, createElementVNode as p, toDisplayString as U, renderSlot as me, createBlock as S, mergeProps as j } from "vue";
|
|
2
|
+
import { useForm as ve } from "./composables/useForm.js";
|
|
3
3
|
import H from "./FormFields.vue.js";
|
|
4
4
|
import C from "../Button.vue.js";
|
|
5
|
-
import
|
|
5
|
+
import fe from "../Timeline/Timeline.vue.js";
|
|
6
6
|
import "@iconify/vue";
|
|
7
|
-
import { useVLiteConfig as
|
|
8
|
-
const
|
|
7
|
+
import { useVLiteConfig as ge } from "../../core/config.js";
|
|
8
|
+
const he = {
|
|
9
9
|
key: 1,
|
|
10
10
|
class: "form-fields-single"
|
|
11
|
-
},
|
|
11
|
+
}, be = {
|
|
12
12
|
key: 2,
|
|
13
13
|
class: "form-groups space-y-6"
|
|
14
|
-
},
|
|
14
|
+
}, ye = { class: "text-base font-semibold text-foreground" }, pe = {
|
|
15
15
|
key: 0,
|
|
16
16
|
class: "text-sm text-muted-foreground mt-1"
|
|
17
|
-
},
|
|
17
|
+
}, Se = { class: "form-group-body p-4.5" }, Ce = {
|
|
18
18
|
key: 3,
|
|
19
19
|
class: "form-step"
|
|
20
|
-
},
|
|
20
|
+
}, ke = { class: "text-lg font-semibold text-foreground" }, xe = {
|
|
21
21
|
key: 0,
|
|
22
22
|
class: "text-sm text-muted-foreground mt-1"
|
|
23
|
-
}, Fe = { class: "flex items-center gap-3" },
|
|
23
|
+
}, Fe = { class: "flex items-center gap-3" }, Ae = { class: "flex items-center gap-3 ml-auto" }, Te = /* @__PURE__ */ le({
|
|
24
24
|
__name: "Form",
|
|
25
25
|
props: {
|
|
26
26
|
schema: {},
|
|
@@ -50,19 +50,19 @@ const ge = {
|
|
|
50
50
|
},
|
|
51
51
|
emits: ["onSubmit", "onCancel", "onStepChange", "onAddonAction"],
|
|
52
52
|
setup(e, { emit: I }) {
|
|
53
|
-
const
|
|
53
|
+
const i = e, m = I, v = oe(
|
|
54
54
|
"modal-context",
|
|
55
55
|
null
|
|
56
|
-
),
|
|
57
|
-
() =>
|
|
58
|
-
),
|
|
59
|
-
id:
|
|
60
|
-
title:
|
|
61
|
-
icon:
|
|
62
|
-
description:
|
|
63
|
-
status:
|
|
64
|
-
})) : []), h = n(() =>
|
|
65
|
-
formValues:
|
|
56
|
+
), K = ge(), k = n(() => K?.components?.form || {}), z = n(() => i.variant ?? k.value.variant ?? "outline"), D = n(() => i.size ?? k.value.size ?? "md"), P = n(() => i.rounded ?? k.value.rounded ?? "md"), q = n(
|
|
57
|
+
() => i.showRequiredAsterisk ?? k.value.showRequiredAsterisk ?? !0
|
|
58
|
+
), J = n(() => i.showCancel || !!v), O = n(() => !!v), x = n(() => !i.schema || i.schema.length === 0 ? !1 : Array.isArray(i.schema[0])), u = n(() => i.tabs && i.tabs.length > 0 && x.value), l = ne(0), M = n(() => i.tabs ? i.tabs.map((a, t) => ({
|
|
59
|
+
id: a.id?.toString() || t.toString(),
|
|
60
|
+
title: a.title,
|
|
61
|
+
icon: a.icon,
|
|
62
|
+
description: a.description,
|
|
63
|
+
status: t < l.value ? "completed" : t === l.value ? "current" : "upcoming"
|
|
64
|
+
})) : []), h = n(() => x.value ? i.schema : [i.schema]), E = n(() => u.value ? h.value[l.value] || [] : []), {
|
|
65
|
+
formValues: F,
|
|
66
66
|
errors: b,
|
|
67
67
|
isSubmitting: y,
|
|
68
68
|
handleFieldChange: Q,
|
|
@@ -70,63 +70,63 @@ const ge = {
|
|
|
70
70
|
validateAll: X,
|
|
71
71
|
isFieldVisible: A,
|
|
72
72
|
isFieldDisabled: w,
|
|
73
|
-
isFieldReadonly:
|
|
74
|
-
getFieldValue:
|
|
73
|
+
isFieldReadonly: T,
|
|
74
|
+
getFieldValue: we,
|
|
75
75
|
handleSubmit: Y,
|
|
76
|
-
flatSchema:
|
|
77
|
-
} =
|
|
78
|
-
schema:
|
|
79
|
-
values:
|
|
80
|
-
isUpdate:
|
|
81
|
-
folderId:
|
|
82
|
-
emitFields:
|
|
83
|
-
onSubmit: (
|
|
84
|
-
m("onSubmit",
|
|
76
|
+
flatSchema: Re
|
|
77
|
+
} = ve({
|
|
78
|
+
schema: i.schema,
|
|
79
|
+
values: i.values,
|
|
80
|
+
isUpdate: i.isUpdate,
|
|
81
|
+
folderId: i.folderId,
|
|
82
|
+
emitFields: i.emitFields,
|
|
83
|
+
onSubmit: (a) => {
|
|
84
|
+
m("onSubmit", a, v?.close || (() => {
|
|
85
85
|
}));
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
88
|
$(
|
|
89
|
-
() =>
|
|
90
|
-
(
|
|
91
|
-
v?.setSubmitting && v.setSubmitting(
|
|
89
|
+
() => i.loading || y.value,
|
|
90
|
+
(a) => {
|
|
91
|
+
v?.setSubmitting && v.setSubmitting(a);
|
|
92
92
|
},
|
|
93
93
|
{ immediate: !0 }
|
|
94
|
-
),
|
|
94
|
+
), re(() => {
|
|
95
95
|
v?.setSubmitting && v.setSubmitting(!1);
|
|
96
96
|
}), $(
|
|
97
|
-
() =>
|
|
98
|
-
(
|
|
97
|
+
() => i.values,
|
|
98
|
+
(a) => {
|
|
99
99
|
},
|
|
100
100
|
{ deep: !0 }
|
|
101
101
|
);
|
|
102
|
-
const
|
|
103
|
-
Q(
|
|
102
|
+
const B = (a, t) => {
|
|
103
|
+
Q(a, t.value, t.data);
|
|
104
104
|
}, Z = () => {
|
|
105
|
-
if (!
|
|
106
|
-
const
|
|
107
|
-
let
|
|
108
|
-
for (const
|
|
109
|
-
if (!A(
|
|
110
|
-
W(
|
|
105
|
+
if (!u.value) return !0;
|
|
106
|
+
const a = E.value;
|
|
107
|
+
let t = !0;
|
|
108
|
+
for (const r of a) {
|
|
109
|
+
if (!A(r) || w(r)) continue;
|
|
110
|
+
W(r) && (t = !1);
|
|
111
111
|
}
|
|
112
|
-
return
|
|
113
|
-
}, _ = n(() =>
|
|
114
|
-
_.value && Z() && (
|
|
112
|
+
return t;
|
|
113
|
+
}, _ = n(() => u.value ? l.value < h.value.length - 1 : !1), L = n(() => u.value ? l.value > 0 : !1), R = n(() => u.value ? l.value === h.value.length - 1 : !0), G = () => {
|
|
114
|
+
_.value && Z() && (l.value++, m("onStepChange", l.value));
|
|
115
115
|
}, ee = () => {
|
|
116
|
-
|
|
117
|
-
}, te = (
|
|
118
|
-
|
|
119
|
-
},
|
|
120
|
-
if (
|
|
121
|
-
if (!R.value && !
|
|
122
|
-
|
|
116
|
+
L.value && (l.value--, m("onStepChange", l.value));
|
|
117
|
+
}, te = (a, t) => {
|
|
118
|
+
t <= l.value && (l.value = t, m("onStepChange", l.value));
|
|
119
|
+
}, V = async () => {
|
|
120
|
+
if (u.value) {
|
|
121
|
+
if (!R.value && !i.isUpdate) {
|
|
122
|
+
G();
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
125
|
if (!X()) {
|
|
126
|
-
const
|
|
127
|
-
(
|
|
126
|
+
const t = h.value.findIndex(
|
|
127
|
+
(r) => r.some((f) => !!b.value[f.name])
|
|
128
128
|
);
|
|
129
|
-
|
|
129
|
+
t !== -1 && t !== l.value && (l.value = t, m("onStepChange", l.value));
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
132
|
}
|
|
@@ -134,106 +134,111 @@ const ge = {
|
|
|
134
134
|
await Y();
|
|
135
135
|
} catch {
|
|
136
136
|
}
|
|
137
|
-
}, ie = () => {
|
|
137
|
+
}, ie = (a) => {
|
|
138
|
+
if (a.key !== "Enter") return;
|
|
139
|
+
const r = a.target.tagName.toLowerCase();
|
|
140
|
+
r !== "textarea" && r !== "button" && (a.preventDefault(), V());
|
|
141
|
+
}, ae = () => {
|
|
138
142
|
m("onCancel"), v && v?.close?.();
|
|
139
143
|
};
|
|
140
|
-
return (
|
|
141
|
-
class: g(["form-container",
|
|
142
|
-
onSubmit:
|
|
144
|
+
return (a, t) => (o(), d("form", {
|
|
145
|
+
class: g(["form-container", i.class]),
|
|
146
|
+
onSubmit: ue(V, ["prevent"]),
|
|
147
|
+
onKeydown: ie
|
|
143
148
|
}, [
|
|
144
|
-
|
|
149
|
+
u.value && M.value.length > 0 ? (o(), d("div", {
|
|
145
150
|
key: 0,
|
|
146
151
|
class: g(["form-timeline", e.timelineTextPosition == "right" ? "mb-6.5" : "mb-13"])
|
|
147
152
|
}, [
|
|
148
|
-
|
|
153
|
+
N(s(fe), {
|
|
149
154
|
steps: M.value,
|
|
150
|
-
activeStep:
|
|
155
|
+
activeStep: l.value,
|
|
151
156
|
direction: "horizontal",
|
|
152
157
|
textPosition: e.timelineTextPosition,
|
|
153
158
|
clickable: !0,
|
|
154
159
|
onStepClick: te
|
|
155
160
|
}, null, 8, ["steps", "activeStep", "textPosition"])
|
|
156
|
-
], 2)) :
|
|
157
|
-
|
|
158
|
-
(o(!0),
|
|
161
|
+
], 2)) : c("", !0),
|
|
162
|
+
x.value ? x.value && !u.value ? (o(), d("div", be, [
|
|
163
|
+
(o(!0), d(de, null, ce(h.value, (r, f) => (o(), d("div", {
|
|
159
164
|
key: f,
|
|
160
|
-
class: g(["form-group border rounded
|
|
165
|
+
class: g(["form-group border rounded overflow-hidden", e.groupClass])
|
|
161
166
|
}, [
|
|
162
|
-
e.groupsHeadings?.[f] ? (o(),
|
|
167
|
+
e.groupsHeadings?.[f] ? (o(), d("div", {
|
|
163
168
|
key: 0,
|
|
164
|
-
class: g(["form-group-header bg-muted/50 px-
|
|
169
|
+
class: g(["form-group-header bg-muted/50 px-4 py-2.5 border-b", e.headerClass])
|
|
165
170
|
}, [
|
|
166
|
-
p("h3",
|
|
167
|
-
e.groupHeadingsDescription?.[f] ? (o(),
|
|
168
|
-
], 2)) :
|
|
169
|
-
p("div",
|
|
170
|
-
|
|
171
|
-
schema:
|
|
172
|
-
values:
|
|
173
|
-
errors:
|
|
174
|
-
variant:
|
|
175
|
-
size:
|
|
171
|
+
p("h3", ye, U(e.groupsHeadings[f]), 1),
|
|
172
|
+
e.groupHeadingsDescription?.[f] ? (o(), d("p", pe, U(e.groupHeadingsDescription[f]), 1)) : c("", !0)
|
|
173
|
+
], 2)) : c("", !0),
|
|
174
|
+
p("div", Se, [
|
|
175
|
+
N(H, {
|
|
176
|
+
schema: r,
|
|
177
|
+
values: s(F),
|
|
178
|
+
errors: s(b),
|
|
179
|
+
variant: z.value,
|
|
180
|
+
size: D.value,
|
|
176
181
|
rounded: P.value,
|
|
177
182
|
className: e.className,
|
|
178
183
|
isUpdate: e.isUpdate,
|
|
179
|
-
showRequiredAsterisk:
|
|
180
|
-
isFieldVisible:
|
|
181
|
-
isFieldDisabled:
|
|
182
|
-
isFieldReadonly:
|
|
183
|
-
onChange:
|
|
184
|
-
onAddonAction:
|
|
184
|
+
showRequiredAsterisk: q.value,
|
|
185
|
+
isFieldVisible: s(A),
|
|
186
|
+
isFieldDisabled: s(w),
|
|
187
|
+
isFieldReadonly: s(T),
|
|
188
|
+
onChange: B,
|
|
189
|
+
onAddonAction: t[1] || (t[1] = (se) => m("onAddonAction", se))
|
|
185
190
|
}, null, 8, ["schema", "values", "errors", "variant", "size", "rounded", "className", "isUpdate", "showRequiredAsterisk", "isFieldVisible", "isFieldDisabled", "isFieldReadonly"])
|
|
186
191
|
])
|
|
187
192
|
], 2))), 128))
|
|
188
|
-
])) :
|
|
189
|
-
e.tabs?.[
|
|
193
|
+
])) : u.value ? (o(), d("div", Ce, [
|
|
194
|
+
e.tabs?.[l.value] ? (o(), d("div", {
|
|
190
195
|
key: 0,
|
|
191
196
|
class: g(["form-step-header mb-6", e.headerClass])
|
|
192
197
|
}, [
|
|
193
|
-
p("h2",
|
|
194
|
-
e.tabs[
|
|
195
|
-
], 2)) :
|
|
196
|
-
|
|
198
|
+
p("h2", ke, U(e.tabs[l.value].title), 1),
|
|
199
|
+
e.tabs[l.value].description ? (o(), d("p", xe, U(e.tabs[l.value].description), 1)) : c("", !0)
|
|
200
|
+
], 2)) : c("", !0),
|
|
201
|
+
N(H, {
|
|
197
202
|
schema: E.value,
|
|
198
|
-
values:
|
|
199
|
-
errors:
|
|
200
|
-
variant:
|
|
201
|
-
size:
|
|
203
|
+
values: s(F),
|
|
204
|
+
errors: s(b),
|
|
205
|
+
variant: z.value,
|
|
206
|
+
size: D.value,
|
|
202
207
|
rounded: P.value,
|
|
203
208
|
className: e.className,
|
|
204
209
|
isUpdate: e.isUpdate,
|
|
205
|
-
showRequiredAsterisk:
|
|
206
|
-
isFieldVisible:
|
|
207
|
-
isFieldDisabled:
|
|
208
|
-
isFieldReadonly:
|
|
209
|
-
onChange:
|
|
210
|
-
onAddonAction:
|
|
210
|
+
showRequiredAsterisk: q.value,
|
|
211
|
+
isFieldVisible: s(A),
|
|
212
|
+
isFieldDisabled: s(w),
|
|
213
|
+
isFieldReadonly: s(T),
|
|
214
|
+
onChange: B,
|
|
215
|
+
onAddonAction: t[2] || (t[2] = (r) => m("onAddonAction", r))
|
|
211
216
|
}, null, 8, ["schema", "values", "errors", "variant", "size", "rounded", "className", "isUpdate", "showRequiredAsterisk", "isFieldVisible", "isFieldDisabled", "isFieldReadonly"])
|
|
212
|
-
])) :
|
|
213
|
-
|
|
217
|
+
])) : c("", !0) : (o(), d("div", he, [
|
|
218
|
+
N(H, {
|
|
214
219
|
schema: e.schema,
|
|
215
|
-
values:
|
|
216
|
-
errors:
|
|
217
|
-
variant:
|
|
218
|
-
size:
|
|
220
|
+
values: s(F),
|
|
221
|
+
errors: s(b),
|
|
222
|
+
variant: z.value,
|
|
223
|
+
size: D.value,
|
|
219
224
|
rounded: P.value,
|
|
220
225
|
className: e.className,
|
|
221
226
|
isUpdate: e.isUpdate,
|
|
222
|
-
showRequiredAsterisk:
|
|
223
|
-
isFieldVisible:
|
|
224
|
-
isFieldDisabled:
|
|
225
|
-
isFieldReadonly:
|
|
226
|
-
onChange:
|
|
227
|
-
onAddonAction:
|
|
227
|
+
showRequiredAsterisk: q.value,
|
|
228
|
+
isFieldVisible: s(A),
|
|
229
|
+
isFieldDisabled: s(w),
|
|
230
|
+
isFieldReadonly: s(T),
|
|
231
|
+
onChange: B,
|
|
232
|
+
onAddonAction: t[0] || (t[0] = (r) => m("onAddonAction", r))
|
|
228
233
|
}, null, 8, ["schema", "values", "errors", "variant", "size", "rounded", "className", "isUpdate", "showRequiredAsterisk", "isFieldVisible", "isFieldDisabled", "isFieldReadonly"])
|
|
229
234
|
])),
|
|
230
|
-
|
|
231
|
-
values:
|
|
232
|
-
errors:
|
|
233
|
-
isSubmitting:
|
|
234
|
-
handleSubmit:
|
|
235
|
+
me(a.$slots, "default", {
|
|
236
|
+
values: s(F),
|
|
237
|
+
errors: s(b),
|
|
238
|
+
isSubmitting: s(y),
|
|
239
|
+
handleSubmit: V
|
|
235
240
|
}, void 0, !0),
|
|
236
|
-
e.footer ? (o(),
|
|
241
|
+
e.footer ? (o(), d("div", {
|
|
237
242
|
key: 4,
|
|
238
243
|
class: g([
|
|
239
244
|
"form-footer flex items-center justify-between gap-3",
|
|
@@ -242,54 +247,54 @@ const ge = {
|
|
|
242
247
|
])
|
|
243
248
|
}, [
|
|
244
249
|
p("div", Fe, [
|
|
245
|
-
|
|
250
|
+
J.value ? (o(), S(C, {
|
|
246
251
|
key: 0,
|
|
247
252
|
type: "button",
|
|
248
253
|
variant: "outline",
|
|
249
254
|
text: e.cancelText,
|
|
250
|
-
disabled: e.loading ||
|
|
251
|
-
onClick:
|
|
252
|
-
}, null, 8, ["text", "disabled"])) :
|
|
253
|
-
|
|
255
|
+
disabled: e.loading || s(y),
|
|
256
|
+
onClick: ae
|
|
257
|
+
}, null, 8, ["text", "disabled"])) : c("", !0),
|
|
258
|
+
u.value && e.isUpdate && !R.value ? (o(), S(C, j({
|
|
254
259
|
key: 1,
|
|
255
260
|
type: "button",
|
|
256
261
|
variant: "primary",
|
|
257
262
|
text: e.submitText
|
|
258
263
|
}, e.submitProps, {
|
|
259
|
-
loading: e.loading ||
|
|
260
|
-
onClick:
|
|
261
|
-
}), null, 16, ["text", "loading"])) :
|
|
264
|
+
loading: e.loading || s(y),
|
|
265
|
+
onClick: V
|
|
266
|
+
}), null, 16, ["text", "loading"])) : c("", !0)
|
|
262
267
|
]),
|
|
263
|
-
p("div",
|
|
264
|
-
|
|
268
|
+
p("div", Ae, [
|
|
269
|
+
u.value && L.value ? (o(), S(C, {
|
|
265
270
|
key: 0,
|
|
266
271
|
type: "button",
|
|
267
272
|
variant: "outline",
|
|
268
273
|
icon: "lucide:arrow-left",
|
|
269
274
|
text: "Previous",
|
|
270
275
|
onClick: ee
|
|
271
|
-
})) :
|
|
272
|
-
|
|
276
|
+
})) : c("", !0),
|
|
277
|
+
u.value && !R.value ? (o(), S(C, {
|
|
273
278
|
key: 1,
|
|
274
279
|
type: "button",
|
|
275
280
|
variant: e.isUpdate ? "outline" : "primary",
|
|
276
281
|
text: "Next",
|
|
277
282
|
iconRight: "lucide:arrow-right",
|
|
278
|
-
onClick:
|
|
279
|
-
}, null, 8, ["variant"])) :
|
|
280
|
-
!
|
|
283
|
+
onClick: G
|
|
284
|
+
}, null, 8, ["variant"])) : c("", !0),
|
|
285
|
+
!u.value || R.value ? (o(), S(C, j({
|
|
281
286
|
key: 2,
|
|
282
287
|
type: "submit",
|
|
283
288
|
variant: "primary",
|
|
284
289
|
text: e.submitText
|
|
285
290
|
}, e.submitProps, {
|
|
286
|
-
loading: e.loading ||
|
|
287
|
-
}), null, 16, ["text", "loading"])) :
|
|
291
|
+
loading: e.loading || s(y)
|
|
292
|
+
}), null, 16, ["text", "loading"])) : c("", !0)
|
|
288
293
|
])
|
|
289
|
-
], 2)) :
|
|
294
|
+
], 2)) : c("", !0)
|
|
290
295
|
], 34));
|
|
291
296
|
}
|
|
292
297
|
});
|
|
293
298
|
export {
|
|
294
|
-
|
|
299
|
+
Te as default
|
|
295
300
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as U, computed as o, markRaw as I, openBlock as r, createBlock as f, mergeProps as s, toHandlers as S, createSlots as N, unref as
|
|
1
|
+
import { defineComponent as U, computed as o, markRaw as I, openBlock as r, createBlock as f, mergeProps as s, toHandlers as S, createSlots as N, unref as z, withCtx as n, createVNode as R, createTextVNode as c, toDisplayString as m, createCommentVNode as L, resolveDynamicComponent as B } from "vue";
|
|
2
2
|
import { isComponent as h, isAddonObject as p } from "./utils/form.utils.js";
|
|
3
3
|
import O from "../NumberInput.vue.js";
|
|
4
4
|
import v from "../Button.vue.js";
|
|
@@ -119,6 +119,7 @@ const ue = /* @__PURE__ */ U({
|
|
|
119
119
|
} : t === "switch" ? {
|
|
120
120
|
...a,
|
|
121
121
|
modelValue: !!e.value,
|
|
122
|
+
size: "sm",
|
|
122
123
|
label: ""
|
|
123
124
|
// Label handled externally
|
|
124
125
|
} : t === "check" ? {
|
|
@@ -240,7 +241,7 @@ const ue = /* @__PURE__ */ U({
|
|
|
240
241
|
...b.value,
|
|
241
242
|
...l.field?.props || {}
|
|
242
243
|
}, S(x.value)), N({ _: 2 }, [
|
|
243
|
-
|
|
244
|
+
z(p)(l.field.addonLeft) ? {
|
|
244
245
|
name: "addon-left",
|
|
245
246
|
fn: n(() => [
|
|
246
247
|
l.field.addonLeft.type === "select" ? (r(), f(y, s({
|
|
@@ -251,7 +252,7 @@ const ue = /* @__PURE__ */ U({
|
|
|
251
252
|
onOnSelect: a[0] || (a[0] = (i) => V(l.field.addonLeft, i))
|
|
252
253
|
}), {
|
|
253
254
|
trigger: n(({ selectedLabel: i }) => [
|
|
254
|
-
|
|
255
|
+
R(v, { variant: "outline" }, {
|
|
255
256
|
default: n(() => [
|
|
256
257
|
c(m(i), 1)
|
|
257
258
|
]),
|
|
@@ -273,7 +274,7 @@ const ue = /* @__PURE__ */ U({
|
|
|
273
274
|
]),
|
|
274
275
|
key: "0"
|
|
275
276
|
} : void 0,
|
|
276
|
-
|
|
277
|
+
z(p)(l.field.addonRight) ? {
|
|
277
278
|
name: "addon-right",
|
|
278
279
|
fn: n(() => [
|
|
279
280
|
l.field.addonRight.type === "select" ? (r(), f(y, s({
|
|
@@ -284,7 +285,7 @@ const ue = /* @__PURE__ */ U({
|
|
|
284
285
|
onOnSelect: a[2] || (a[2] = (i) => V(l.field.addonRight, i))
|
|
285
286
|
}), {
|
|
286
287
|
trigger: n(({ selectedLabel: i }) => [
|
|
287
|
-
|
|
288
|
+
R(v, { variant: "outline" }, {
|
|
288
289
|
default: n(() => [
|
|
289
290
|
c(m(i), 1)
|
|
290
291
|
]),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./FormFields.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-0fe8a23f"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
@@ -33,17 +33,17 @@ const W = {
|
|
|
33
33
|
},
|
|
34
34
|
emits: ["change", "addonAction"],
|
|
35
35
|
setup(c, { emit: N }) {
|
|
36
|
-
const a = c,
|
|
36
|
+
const a = c, h = N, L = O(() => {
|
|
37
37
|
if (a.className) return a.className;
|
|
38
|
-
}), k = (t) => M(a.values, t.name),
|
|
38
|
+
}), k = (t) => M(a.values, t.name), y = (t) => a.errors[t.name] || "", z = (t) => a.isFieldVisible ? a.isFieldVisible(t) : !0, D = (t) => a.isFieldDisabled ? a.isFieldDisabled(t) : t.disabled === !0, R = (t) => a.isFieldReadonly ? a.isFieldReadonly(t) : t.readonly === !0, o = (t) => t.labelI18n ? Q(t.labelI18n) : t.label, x = (t) => {
|
|
39
39
|
if (t)
|
|
40
40
|
return p(t), t;
|
|
41
41
|
}, $ = (t, n) => {
|
|
42
|
-
|
|
42
|
+
h("change", t.name, n);
|
|
43
43
|
}, q = (t) => t.itemClass || "", B = (t, n) => {
|
|
44
|
-
|
|
44
|
+
h("change", t, n);
|
|
45
45
|
}, I = (t) => {
|
|
46
|
-
|
|
46
|
+
h("addonAction", t);
|
|
47
47
|
}, v = j({}), U = (t) => {
|
|
48
48
|
v.value[t] = !0;
|
|
49
49
|
}, E = (t) => {
|
|
@@ -96,7 +96,7 @@ const W = {
|
|
|
96
96
|
for: e.name,
|
|
97
97
|
class: i([
|
|
98
98
|
"absolute transition-all duration-200 ease-in-out pointer-events-none z-20",
|
|
99
|
-
f(e) ? "-top-2.5 left-3 text-xs bg-background px-1 text-
|
|
99
|
+
f(e) ? "-top-2.5 left-3 text-xs bg-background px-1 text-black shadow-[0_4px_4px_-4px_bg-background]" : `top-2.5 text-sm text-muted-foreground/70 ${S(e)}`
|
|
100
100
|
])
|
|
101
101
|
}, [
|
|
102
102
|
_(p)(o(e)) ? (s(), d(w(x(o(e))), { key: 0 })) : (s(), r(l, { key: 1 }, [
|
|
@@ -119,7 +119,7 @@ const W = {
|
|
|
119
119
|
rounded: c.rounded,
|
|
120
120
|
disabled: D(e),
|
|
121
121
|
readonly: R(e),
|
|
122
|
-
error:
|
|
122
|
+
error: y(e),
|
|
123
123
|
isUpdate: c.isUpdate,
|
|
124
124
|
onChange: (F) => $(e, F),
|
|
125
125
|
onAddonChange: B,
|
|
@@ -137,7 +137,7 @@ const W = {
|
|
|
137
137
|
]),
|
|
138
138
|
_: 2
|
|
139
139
|
}, 1032, ["for"])) : u("", !0),
|
|
140
|
-
|
|
140
|
+
y(e) ? (s(), r("p", te, m(y(e)), 1)) : u("", !0)
|
|
141
141
|
], 2)) : u("", !0)
|
|
142
142
|
], 64))), 128))
|
|
143
143
|
], 2));
|
package/components/Input.vue.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Y, computed as a, useSlots as Z, ref as b, onMounted as _, nextTick as z, openBlock as d, createElementBlock as u, normalizeClass as r, createBlock as R, withCtx as ee, createTextVNode as $, toDisplayString as w, createCommentVNode as i, createElementVNode as A, renderSlot as T, createVNode as
|
|
1
|
+
import { defineComponent as Y, computed as a, useSlots as Z, ref as b, onMounted as _, nextTick as z, openBlock as d, createElementBlock as u, normalizeClass as r, createBlock as R, withCtx as ee, createTextVNode as $, toDisplayString as w, createCommentVNode as i, createElementVNode as A, renderSlot as T, createVNode as k } from "vue";
|
|
2
2
|
import v from "./Icon.vue.js";
|
|
3
3
|
import te from "./Label.vue.js";
|
|
4
4
|
import le from "./Textarea.vue.js";
|
|
@@ -40,7 +40,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
|
|
|
40
40
|
setup(t, { emit: D }) {
|
|
41
41
|
const e = t, c = D, s = a(() => e.labelI18n ? E(e.labelI18n) : e.label), I = a(
|
|
42
42
|
() => e.placeholderI18n ? E(e.placeholderI18n) : e.placeholder
|
|
43
|
-
), g = Z(), m = b(null), x = b(!1), y = b(!1), H = a(() => e.type === "password" && x.value ? "text" : e.type),
|
|
43
|
+
), g = Z(), m = b(null), x = b(!1), y = b(!1), H = a(() => e.type === "password" && x.value ? "text" : e.type), C = a(() => e.modelValue !== "" && e.modelValue !== null && e.modelValue !== void 0), V = a(() => h.value || C.value || y.value), p = a(() => !!e.addonLeft || !!g["addon-left"]), B = a(() => !!e.addonRight || !!g["addon-right"]), U = a(() => [
|
|
44
44
|
"relative w-full",
|
|
45
45
|
e.class,
|
|
46
46
|
e.labelPosition === "left" ? "flex items-center gap-4" : "",
|
|
@@ -49,11 +49,11 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
|
|
|
49
49
|
" "
|
|
50
50
|
)), S = a(() => {
|
|
51
51
|
const l = "block w-full bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground/70 disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none relative focus:z-10", n = {
|
|
52
|
-
solid: "bg-muted border-transparent focus-visible:border-
|
|
53
|
-
outline: "border border-input focus-visible:border-
|
|
54
|
-
"outline-b": "border-b border-input bg-transparent rounded-none focus-visible:border-
|
|
52
|
+
solid: "bg-muted border-transparent focus-visible:border-black",
|
|
53
|
+
outline: "border border-input focus-visible:border-black",
|
|
54
|
+
"outline-b": "border-b border-input bg-transparent rounded-none focus-visible:border-black",
|
|
55
55
|
transparent: "border-none bg-transparent shadow-none",
|
|
56
|
-
floating: "border border-input focus-visible:border-
|
|
56
|
+
floating: "border border-input focus-visible:border-black"
|
|
57
57
|
}, f = {
|
|
58
58
|
sm: "h-7.5 text-xs",
|
|
59
59
|
md: "h-9 text-sm",
|
|
@@ -77,7 +77,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
|
|
|
77
77
|
o,
|
|
78
78
|
e.error ? "border-destructive focus-visible:ring-destructive" : "",
|
|
79
79
|
e.icon ? "pl-9" : M && !p.value ? "pl-0" : "",
|
|
80
|
-
e.showClearButton &&
|
|
80
|
+
e.showClearButton && C.value || e.type === "password" || e.loading || e.iconRight ? "pr-9" : M && !B.value ? "pr-0" : "",
|
|
81
81
|
// Keyframe name used to detect browser autofill via animationstart event
|
|
82
82
|
e.variant === "floating" ? "autofill-detect" : "",
|
|
83
83
|
e.inputClass
|
|
@@ -188,7 +188,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
|
|
|
188
188
|
for: s.value,
|
|
189
189
|
class: r([
|
|
190
190
|
"absolute transition-all duration-200 ease-in-out pointer-events-none z-20",
|
|
191
|
-
V.value ? "-top-2.5 left-3 text-xs bg-background px-1 text-
|
|
191
|
+
V.value ? "-top-2.5 left-3 text-xs bg-background px-1 text-black shadow-[0_4px_4px_-4px_bg-background] translate-y-0" : t.type === "textarea" ? `top-2 text-sm text-muted-foreground/70 ${t.icon ? "left-9" : "left-3"} translate-y-0` : `top-1/2 -translate-y-1/2 text-sm text-muted-foreground/70 ${t.icon ? "left-9" : "left-3"}`
|
|
192
192
|
])
|
|
193
193
|
}, w(s.value), 11, ne)) : i("", !0),
|
|
194
194
|
t.type === "textarea" ? (d(), R(le, {
|
|
@@ -226,7 +226,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
|
|
|
226
226
|
t.disabled ? "opacity-50" : ""
|
|
227
227
|
])
|
|
228
228
|
}, [
|
|
229
|
-
|
|
229
|
+
k(v, {
|
|
230
230
|
icon: t.icon,
|
|
231
231
|
class: r(["h-4 w-4", t.iconClass])
|
|
232
232
|
}, null, 8, ["icon", "class"])
|
|
@@ -245,7 +245,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
|
|
|
245
245
|
]),
|
|
246
246
|
onClick: n[1] || (n[1] = (f) => !t.disabled && c("click:icon-right", f))
|
|
247
247
|
}, [
|
|
248
|
-
|
|
248
|
+
k(v, {
|
|
249
249
|
icon: t.iconRight,
|
|
250
250
|
class: r(["h-4 w-4", t.iconRightClass])
|
|
251
251
|
}, null, 8, ["icon", "class"])
|
|
@@ -257,19 +257,19 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
|
|
|
257
257
|
class: "flex items-center justify-center text-muted-foreground hover:text-foreground focus:outline-none",
|
|
258
258
|
onClick: O
|
|
259
259
|
}, [
|
|
260
|
-
|
|
260
|
+
k(v, {
|
|
261
261
|
icon: x.value ? "lucide:eye-off" : "lucide:eye",
|
|
262
262
|
class: "h-4 w-4"
|
|
263
263
|
}, null, 8, ["icon"])
|
|
264
264
|
])) : i("", !0),
|
|
265
|
-
t.showClearButton &&
|
|
265
|
+
t.showClearButton && C.value && !t.disabled && !t.loading && t.type !== "textarea" && t.type !== "password" && (h.value || j.value) ? (d(), u("button", {
|
|
266
266
|
key: 3,
|
|
267
267
|
type: "button",
|
|
268
268
|
tabindex: "-1",
|
|
269
269
|
class: "flex items-center justify-center text-muted-foreground hover:text-foreground focus:outline-none transition-opacity duration-200",
|
|
270
270
|
onClick: Q
|
|
271
271
|
}, [
|
|
272
|
-
|
|
272
|
+
k(v, {
|
|
273
273
|
icon: "lucide:x-circle",
|
|
274
274
|
class: "h-4 w-4"
|
|
275
275
|
})
|
package/components/Modal.vue.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Modal.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-c26acbd9"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|