vlite3 1.4.26 → 1.4.28
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/CategoryManager/CategoryManager.vue2.js +4 -3
- package/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.d.ts +20 -1
- package/components/ColorPicker/ColorPicker.vue.js +98 -72
- package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
- package/components/CommandPalette/{CommandPaletteItem.vue.js → CommandPaletteItem.vue2.js} +1 -1
- package/components/DateRangePicker.vue.js +5 -239
- package/components/DateRangePicker.vue2.js +239 -2
- package/components/FilePicker/index.vue.js +1 -1
- package/components/Form/FormField.vue.js +71 -68
- package/components/Form/TableRow.vue.js +55 -40
- package/components/Form/TableView.vue.js +36 -31
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/Screen/ScreenFilter.vue.js +4 -3
- package/components/Stats/StatItem.vue.js +127 -123
- package/package.json +2 -2
- package/style.css +1 -1
- /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
|
@@ -1,4 +1,241 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineComponent as $, ref as b, watch as F, computed as u, openBlock as d, createBlock as m, unref as v, withCtx as D, createElementVNode as i, createElementBlock as w, Fragment as L, renderList as T, createCommentVNode as z, createVNode as h, normalizeClass as y, toDisplayString as x, createTextVNode as B } from "vue";
|
|
2
|
+
import E from "./Dropdown/Dropdown.vue.js";
|
|
3
|
+
import R from "./Icon.vue.js";
|
|
4
|
+
import { $t as l } from "../utils/i18n.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
/* empty css */
|
|
7
|
+
/* empty css */
|
|
8
|
+
import P from "./Button.vue.js";
|
|
9
|
+
import p from "v-datepicker-lite";
|
|
10
|
+
import "v-datepicker-lite/style.css";
|
|
11
|
+
const j = { class: "flex items-center justify-start gap-2 w-full" }, H = { class: "flex flex-col sm:flex-row bg-background rounded-md" }, Q = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "flex flex-col gap-1 sm:pr-3 py-2 sm:border-r border-border max-h-[280px]"
|
|
14
|
+
}, O = { class: "flex flex-col sm:flex-row items-center gap-4 py-2 p-3" }, I = { class: "border border-border rounded-md overflow-hidden bg-background" }, U = { class: "flex items-center justify-center shrink-0" }, q = { class: "border border-border rounded-md overflow-hidden bg-background" }, le = /* @__PURE__ */ $({
|
|
15
|
+
__name: "DateRangePicker",
|
|
16
|
+
props: {
|
|
17
|
+
modelValue: {},
|
|
18
|
+
placeholderStart: { default: "Start Date" },
|
|
19
|
+
placeholderEnd: { default: "End Date" },
|
|
20
|
+
minDate: {},
|
|
21
|
+
maxDate: {},
|
|
22
|
+
disabled: { type: Boolean },
|
|
23
|
+
readonly: { type: Boolean },
|
|
24
|
+
size: {},
|
|
25
|
+
variant: {},
|
|
26
|
+
showQuickRanges: { type: Boolean, default: !0 },
|
|
27
|
+
triggerClass: {}
|
|
28
|
+
},
|
|
29
|
+
emits: ["update:modelValue", "change"],
|
|
30
|
+
setup(s, { emit: M }) {
|
|
31
|
+
const g = s, k = M, o = b(!1), c = b(0);
|
|
32
|
+
F(o, (a) => {
|
|
33
|
+
a && c.value++;
|
|
34
|
+
});
|
|
35
|
+
const n = u({
|
|
36
|
+
get: () => {
|
|
37
|
+
const a = g.modelValue;
|
|
38
|
+
return a ? {
|
|
39
|
+
startDate: a.startDate !== void 0 ? a.startDate : a.start,
|
|
40
|
+
endDate: a.endDate !== void 0 ? a.endDate : a.end
|
|
41
|
+
} : { startDate: null, endDate: null };
|
|
42
|
+
},
|
|
43
|
+
set: (a) => {
|
|
44
|
+
k("update:modelValue", a), k("change", a);
|
|
45
|
+
}
|
|
46
|
+
}), Y = (a) => {
|
|
47
|
+
n.value = { ...n.value, startDate: a };
|
|
48
|
+
}, S = (a) => {
|
|
49
|
+
n.value = { ...n.value, endDate: a };
|
|
50
|
+
}, C = u(() => {
|
|
51
|
+
if (n.value.endDate) {
|
|
52
|
+
const a = new Date(n.value.endDate);
|
|
53
|
+
if (!isNaN(a.getTime())) return a.toISOString();
|
|
54
|
+
}
|
|
55
|
+
return g.maxDate;
|
|
56
|
+
}), N = u(() => {
|
|
57
|
+
if (n.value.startDate) {
|
|
58
|
+
const a = new Date(n.value.startDate);
|
|
59
|
+
if (!isNaN(a.getTime())) return a.toISOString();
|
|
60
|
+
}
|
|
61
|
+
return g.minDate;
|
|
62
|
+
}), f = (a) => {
|
|
63
|
+
if (!a) return "";
|
|
64
|
+
try {
|
|
65
|
+
const e = new Date(a);
|
|
66
|
+
return isNaN(e.getTime()) ? "" : e.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
|
|
67
|
+
} catch {
|
|
68
|
+
return "";
|
|
69
|
+
}
|
|
70
|
+
}, V = u(() => [
|
|
71
|
+
{
|
|
72
|
+
label: l("vlite.dateRangePicker.today") !== "vlite.dateRangePicker.today" ? l("vlite.dateRangePicker.today") : "Today",
|
|
73
|
+
value: "today",
|
|
74
|
+
icon: "lucide:calendar"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
label: l("vlite.dateRangePicker.yesterday") !== "vlite.dateRangePicker.yesterday" ? l("vlite.dateRangePicker.yesterday") : "Yesterday",
|
|
78
|
+
value: "yesterday",
|
|
79
|
+
icon: "lucide:calendar-minus"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
label: l("vlite.dateRangePicker.last7Days") !== "vlite.dateRangePicker.last7Days" ? l("vlite.dateRangePicker.last7Days") : "Last 7 Days",
|
|
83
|
+
value: "last_7_days",
|
|
84
|
+
icon: "lucide:calendar-days"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
label: l("vlite.dateRangePicker.last30Days") !== "vlite.dateRangePicker.last30Days" ? l("vlite.dateRangePicker.last30Days") : "Last 30 Days",
|
|
88
|
+
value: "last_30_days",
|
|
89
|
+
icon: "lucide:calendar-days"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
label: l("vlite.dateRangePicker.thisMonth") !== "vlite.dateRangePicker.thisMonth" ? l("vlite.dateRangePicker.thisMonth") : "This Month",
|
|
93
|
+
value: "this_month",
|
|
94
|
+
icon: "lucide:calendar-range"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
label: l("vlite.dateRangePicker.lastMonth") !== "vlite.dateRangePicker.lastMonth" ? l("vlite.dateRangePicker.lastMonth") : "Last Month",
|
|
98
|
+
value: "last_month",
|
|
99
|
+
icon: "lucide:calendar-range"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
label: l("vlite.dateRangePicker.last6Months") !== "vlite.dateRangePicker.last6Months" ? l("vlite.dateRangePicker.last6Months") : "Last 6 Months",
|
|
103
|
+
value: "last_6_months",
|
|
104
|
+
icon: "lucide:history"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
label: l("vlite.dateRangePicker.thisYear") !== "vlite.dateRangePicker.thisYear" ? l("vlite.dateRangePicker.thisYear") : "This Year",
|
|
108
|
+
value: "this_year",
|
|
109
|
+
icon: "lucide:calendar-check"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
label: l("vlite.dateRangePicker.lastYear") !== "vlite.dateRangePicker.lastYear" ? l("vlite.dateRangePicker.lastYear") : "Last Year",
|
|
113
|
+
value: "last_year",
|
|
114
|
+
icon: "lucide:history"
|
|
115
|
+
}
|
|
116
|
+
]), _ = (a) => {
|
|
117
|
+
const e = /* @__PURE__ */ new Date();
|
|
118
|
+
let t = /* @__PURE__ */ new Date(), r = /* @__PURE__ */ new Date();
|
|
119
|
+
switch (e.setHours(0, 0, 0, 0), t.setHours(0, 0, 0, 0), r.setHours(0, 0, 0, 0), a.value) {
|
|
120
|
+
case "today":
|
|
121
|
+
t = new Date(e), r = new Date(e);
|
|
122
|
+
break;
|
|
123
|
+
case "yesterday":
|
|
124
|
+
t = new Date(e), t.setDate(t.getDate() - 1), r = new Date(t);
|
|
125
|
+
break;
|
|
126
|
+
case "last_7_days":
|
|
127
|
+
t = new Date(e), t.setDate(t.getDate() - 6), r = new Date(e);
|
|
128
|
+
break;
|
|
129
|
+
case "last_30_days":
|
|
130
|
+
t = new Date(e), t.setDate(t.getDate() - 29), r = new Date(e);
|
|
131
|
+
break;
|
|
132
|
+
case "this_month":
|
|
133
|
+
t = new Date(e.getFullYear(), e.getMonth(), 1), r = new Date(e);
|
|
134
|
+
break;
|
|
135
|
+
case "last_month":
|
|
136
|
+
t = new Date(e.getFullYear(), e.getMonth() - 1, 1), r = new Date(e.getFullYear(), e.getMonth(), 0);
|
|
137
|
+
break;
|
|
138
|
+
case "last_6_months":
|
|
139
|
+
t = new Date(e.getFullYear(), e.getMonth() - 5, 1), r = new Date(e);
|
|
140
|
+
break;
|
|
141
|
+
case "this_year":
|
|
142
|
+
t = new Date(e.getFullYear(), 0, 1), r = new Date(e);
|
|
143
|
+
break;
|
|
144
|
+
case "last_year":
|
|
145
|
+
t = new Date(e.getFullYear() - 1, 0, 1), r = new Date(e.getFullYear() - 1, 11, 31);
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
n.value = { startDate: t, endDate: r }, c.value++, o.value = !1;
|
|
149
|
+
};
|
|
150
|
+
return (a, e) => (d(), m(v(E), {
|
|
151
|
+
isOpen: o.value,
|
|
152
|
+
"onUpdate:isOpen": e[0] || (e[0] = (t) => o.value = t),
|
|
153
|
+
position: "bottom-start",
|
|
154
|
+
disabled: s.disabled || s.readonly,
|
|
155
|
+
class: "w-full sm:w-auto inline-block",
|
|
156
|
+
maxHeight: "none"
|
|
157
|
+
}, {
|
|
158
|
+
trigger: D(({ isOpen: t }) => [
|
|
159
|
+
h(P, {
|
|
160
|
+
icon: "lucide:calendar",
|
|
161
|
+
variant: s.variant || "outline",
|
|
162
|
+
size: s.size || "md",
|
|
163
|
+
disabled: s.disabled,
|
|
164
|
+
class: y(["w-full justify-between text-left font-normal", [s.triggerClass, { "ring-1 ring-ring ring-offset-[1]": t }]]),
|
|
165
|
+
"data-testid": a.$attrs["data-testid"] || (a.$attrs.name ? `daterange-${a.$attrs.name}` : "daterange")
|
|
166
|
+
}, {
|
|
167
|
+
default: D(() => [
|
|
168
|
+
i("div", j, [
|
|
169
|
+
i("span", {
|
|
170
|
+
class: y({ "text-muted-foreground": !n.value.startDate })
|
|
171
|
+
}, x(n.value.startDate ? f(n.value.startDate) : s.placeholderStart), 3),
|
|
172
|
+
e[1] || (e[1] = B(" — ", -1)),
|
|
173
|
+
i("span", {
|
|
174
|
+
class: y({ "text-muted-foreground": !n.value.endDate })
|
|
175
|
+
}, x(n.value.endDate ? f(n.value.endDate) : s.placeholderEnd), 3)
|
|
176
|
+
])
|
|
177
|
+
]),
|
|
178
|
+
_: 1
|
|
179
|
+
}, 8, ["variant", "size", "disabled", "class", "data-testid"])
|
|
180
|
+
]),
|
|
181
|
+
menu: D(() => [
|
|
182
|
+
i("div", H, [
|
|
183
|
+
s.showQuickRanges ? (d(), w("div", Q, [
|
|
184
|
+
e[2] || (e[2] = i("div", { class: "text-xs pl-2 pb-2 font-semibold text-muted-foreground uppercase tracking-wider" }, " Quick Ranges ", -1)),
|
|
185
|
+
(d(!0), w(L, null, T(V.value, (t) => (d(), m(P, {
|
|
186
|
+
key: t.value,
|
|
187
|
+
text: t.label,
|
|
188
|
+
icon: t.icon,
|
|
189
|
+
variant: "ghost",
|
|
190
|
+
size: "sm",
|
|
191
|
+
class: "justify-start w-full font-normal",
|
|
192
|
+
onClick: (r) => _(t)
|
|
193
|
+
}, null, 8, ["text", "icon", "onClick"]))), 128))
|
|
194
|
+
])) : z("", !0),
|
|
195
|
+
i("div", O, [
|
|
196
|
+
i("div", I, [
|
|
197
|
+
(d(), m(v(p), {
|
|
198
|
+
key: "start-" + c.value,
|
|
199
|
+
value: n.value.startDate,
|
|
200
|
+
onChange: Y,
|
|
201
|
+
mode: "date",
|
|
202
|
+
"max-date": C.value,
|
|
203
|
+
"min-date": s.minDate,
|
|
204
|
+
disabled: s.disabled,
|
|
205
|
+
class: "min-w-[270px]",
|
|
206
|
+
readonly: s.readonly
|
|
207
|
+
}, null, 8, ["value", "max-date", "min-date", "disabled", "readonly"]))
|
|
208
|
+
]),
|
|
209
|
+
i("div", U, [
|
|
210
|
+
h(R, {
|
|
211
|
+
icon: "lucide:arrow-right",
|
|
212
|
+
class: "w-5 h-5 text-muted-foreground hidden sm:block opacity-50"
|
|
213
|
+
}),
|
|
214
|
+
h(R, {
|
|
215
|
+
icon: "lucide:arrow-down",
|
|
216
|
+
class: "w-5 h-5 text-muted-foreground sm:hidden opacity-50"
|
|
217
|
+
})
|
|
218
|
+
]),
|
|
219
|
+
i("div", q, [
|
|
220
|
+
(d(), m(v(p), {
|
|
221
|
+
key: "end-" + c.value,
|
|
222
|
+
value: n.value.endDate,
|
|
223
|
+
onChange: S,
|
|
224
|
+
mode: "date",
|
|
225
|
+
"min-date": N.value,
|
|
226
|
+
"max-date": s.maxDate,
|
|
227
|
+
class: "min-w-[270px]",
|
|
228
|
+
disabled: s.disabled,
|
|
229
|
+
readonly: s.readonly
|
|
230
|
+
}, null, 8, ["value", "min-date", "max-date", "disabled", "readonly"]))
|
|
231
|
+
])
|
|
232
|
+
])
|
|
233
|
+
])
|
|
234
|
+
]),
|
|
235
|
+
_: 1
|
|
236
|
+
}, 8, ["isOpen", "disabled"]));
|
|
237
|
+
}
|
|
238
|
+
});
|
|
2
239
|
export {
|
|
3
|
-
|
|
240
|
+
le as default
|
|
4
241
|
};
|
|
@@ -63,7 +63,7 @@ const j = ["multiple", "accept", "data-testid"], O = /* @__PURE__ */ V({
|
|
|
63
63
|
return a["data-testid"] ? `${a["data-testid"]}-input` : a.name ? `filepicker-input-${a.name}` : "filepicker-input";
|
|
64
64
|
}), o = () => e.triggerInput(p.value), T = n(() => e.acceptAttribute.value);
|
|
65
65
|
return (a, r) => (u(), N("div", {
|
|
66
|
-
class: C(["vl-file-picker w-full min-w-0", { "vl-file-picker--input": l.variant === "input" }])
|
|
66
|
+
class: C(["vl-file-picker mb-4! w-full min-w-0", { "vl-file-picker--input": l.variant === "input" }])
|
|
67
67
|
}, [
|
|
68
68
|
E("input", {
|
|
69
69
|
ref_key: "fileInput",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as E, computed as f, markRaw as O, openBlock as c, createBlock as m, mergeProps as p, toHandlers as
|
|
2
|
-
import { resolveFieldType as G, isComponent as
|
|
1
|
+
import { defineComponent as E, computed as f, markRaw as O, openBlock as c, createBlock as m, mergeProps as p, toHandlers as P, createSlots as M, unref as L, withCtx as u, createVNode as N, createTextVNode as y, toDisplayString as x, createCommentVNode as T, resolveDynamicComponent as q } from "vue";
|
|
2
|
+
import { resolveFieldType as G, isComponent as R, isAddonObject as B } from "./utils/form.utils.js";
|
|
3
3
|
import J from "../NumberInput.vue.js";
|
|
4
4
|
import z from "../Button.vue.js";
|
|
5
5
|
import { resolveI18nText as K } from "../../utils/i18n.js";
|
|
@@ -11,7 +11,7 @@ import X from "../FilePicker/index.vue.js";
|
|
|
11
11
|
import Y from "../AvatarUploader/AvatarUploader.vue.js";
|
|
12
12
|
import Z from "../ThumbnailSelector/ThumbnailSelector.vue.js";
|
|
13
13
|
import _ from "../TagInput/TagInput.vue.js";
|
|
14
|
-
import
|
|
14
|
+
import w from "../Dropdown/Dropdown.vue.js";
|
|
15
15
|
import ee from "../MultiSelect/MultiSelect.vue.js";
|
|
16
16
|
import ae from "../DatePicker.vue.js";
|
|
17
17
|
import le from "../DateRangePicker.vue.js";
|
|
@@ -40,8 +40,8 @@ const Ne = /* @__PURE__ */ E({
|
|
|
40
40
|
loading: { type: Boolean, default: !1 }
|
|
41
41
|
},
|
|
42
42
|
emits: ["change", "addonChange", "addonAction"],
|
|
43
|
-
setup(
|
|
44
|
-
const e =
|
|
43
|
+
setup(t, { emit: U }) {
|
|
44
|
+
const e = t, v = U, d = (a, l) => {
|
|
45
45
|
v("change", { value: a, data: l });
|
|
46
46
|
}, S = (a) => {
|
|
47
47
|
v("change", { value: a });
|
|
@@ -51,9 +51,9 @@ const Ne = /* @__PURE__ */ E({
|
|
|
51
51
|
isUpdate: e.isUpdate
|
|
52
52
|
})), b = f(
|
|
53
53
|
() => o.value === "number" && e.field.isSensitiveField === !0
|
|
54
|
-
),
|
|
54
|
+
), D = f(() => {
|
|
55
55
|
const a = o.value;
|
|
56
|
-
if (
|
|
56
|
+
if (R(a))
|
|
57
57
|
return O(a);
|
|
58
58
|
switch (a) {
|
|
59
59
|
case "text":
|
|
@@ -71,7 +71,7 @@ const Ne = /* @__PURE__ */ E({
|
|
|
71
71
|
case "check":
|
|
72
72
|
return W;
|
|
73
73
|
case "select":
|
|
74
|
-
return
|
|
74
|
+
return w;
|
|
75
75
|
case "multiSelect":
|
|
76
76
|
return ee;
|
|
77
77
|
case "choiceBox":
|
|
@@ -101,8 +101,8 @@ const Ne = /* @__PURE__ */ E({
|
|
|
101
101
|
default:
|
|
102
102
|
return V;
|
|
103
103
|
}
|
|
104
|
-
}),
|
|
105
|
-
const a = o.value, { disabled: l, readonly: r, ...g } = e.field,
|
|
104
|
+
}), A = f(() => {
|
|
105
|
+
const a = o.value, { disabled: l, readonly: r, ...g } = e.field, i = {
|
|
106
106
|
...g,
|
|
107
107
|
disabled: e.disabled || l === !0,
|
|
108
108
|
readonly: e.readonly || r === !0,
|
|
@@ -116,7 +116,7 @@ const Ne = /* @__PURE__ */ E({
|
|
|
116
116
|
), I = e.variant === "floating" && e.label && !e.floatingActive, s = I ? "" : h;
|
|
117
117
|
if (a === "text" || a === "email" || a === "password" || a === "tel" || a === "url" || a === "search" || a === "textarea" || !a)
|
|
118
118
|
return {
|
|
119
|
-
...
|
|
119
|
+
...i,
|
|
120
120
|
modelValue: e.value ?? "",
|
|
121
121
|
type: a || "text",
|
|
122
122
|
placeholder: s,
|
|
@@ -137,7 +137,7 @@ const Ne = /* @__PURE__ */ E({
|
|
|
137
137
|
};
|
|
138
138
|
if (a === "number" && b.value)
|
|
139
139
|
return {
|
|
140
|
-
...
|
|
140
|
+
...i,
|
|
141
141
|
// Convert numeric value to string so Input.vue (string-based) displays it correctly
|
|
142
142
|
modelValue: e.value !== void 0 && e.value !== null ? String(e.value) : "",
|
|
143
143
|
// 'password' activates the eye-toggle inside Input.vue
|
|
@@ -154,7 +154,7 @@ const Ne = /* @__PURE__ */ E({
|
|
|
154
154
|
};
|
|
155
155
|
if (a === "number")
|
|
156
156
|
return {
|
|
157
|
-
...
|
|
157
|
+
...i,
|
|
158
158
|
modelValue: e.value ?? void 0,
|
|
159
159
|
min: e.field.min,
|
|
160
160
|
max: e.field.max,
|
|
@@ -172,10 +172,11 @@ const Ne = /* @__PURE__ */ E({
|
|
|
172
172
|
rounded: oe,
|
|
173
173
|
error: se,
|
|
174
174
|
switchVariant: ue,
|
|
175
|
-
...
|
|
176
|
-
} =
|
|
175
|
+
...k
|
|
176
|
+
} = i;
|
|
177
177
|
return {
|
|
178
|
-
...
|
|
178
|
+
...k,
|
|
179
|
+
disabled: k.disabled || k.readonly,
|
|
179
180
|
modelValue: !!e.value,
|
|
180
181
|
label: e.field.label,
|
|
181
182
|
labelI18n: e.field.labelI18n,
|
|
@@ -188,14 +189,15 @@ const Ne = /* @__PURE__ */ E({
|
|
|
188
189
|
}
|
|
189
190
|
if (a === "check")
|
|
190
191
|
return {
|
|
191
|
-
...
|
|
192
|
+
...i,
|
|
193
|
+
disabled: i.disabled || i.readonly,
|
|
192
194
|
modelValue: !!e.value,
|
|
193
195
|
label: ""
|
|
194
196
|
// Label handled externally
|
|
195
197
|
};
|
|
196
198
|
if (a === "select")
|
|
197
199
|
return {
|
|
198
|
-
...
|
|
200
|
+
...i,
|
|
199
201
|
modelValue: e.value,
|
|
200
202
|
options: e.field.options || [],
|
|
201
203
|
placeholder: s,
|
|
@@ -209,7 +211,7 @@ const Ne = /* @__PURE__ */ E({
|
|
|
209
211
|
};
|
|
210
212
|
if (a === "multiSelect")
|
|
211
213
|
return {
|
|
212
|
-
...
|
|
214
|
+
...i,
|
|
213
215
|
modelValue: Array.isArray(e.value) ? e.value : [],
|
|
214
216
|
options: e.field.options || [],
|
|
215
217
|
placeholder: h,
|
|
@@ -219,7 +221,7 @@ const Ne = /* @__PURE__ */ E({
|
|
|
219
221
|
};
|
|
220
222
|
if (a === "choiceBox")
|
|
221
223
|
return {
|
|
222
|
-
...
|
|
224
|
+
...i,
|
|
223
225
|
modelValue: e.value,
|
|
224
226
|
title: e.label,
|
|
225
227
|
titleI18n: e.field.labelI18n,
|
|
@@ -244,7 +246,7 @@ const Ne = /* @__PURE__ */ E({
|
|
|
244
246
|
};
|
|
245
247
|
if (a === "date" || a === "time")
|
|
246
248
|
return {
|
|
247
|
-
...
|
|
249
|
+
...i,
|
|
248
250
|
modelValue: e.value,
|
|
249
251
|
mode: a === "time" ? "time" : "date",
|
|
250
252
|
placeholder: s,
|
|
@@ -257,14 +259,14 @@ const Ne = /* @__PURE__ */ E({
|
|
|
257
259
|
};
|
|
258
260
|
if (a === "dateRangePicker")
|
|
259
261
|
return {
|
|
260
|
-
...
|
|
262
|
+
...i,
|
|
261
263
|
modelValue: e.value,
|
|
262
264
|
variant: e.variant === "floating" ? "outline-floating" : e.variant || "outline",
|
|
263
265
|
size: e.size
|
|
264
266
|
};
|
|
265
267
|
if (a === "fileUploader" || a === "file")
|
|
266
268
|
return {
|
|
267
|
-
...
|
|
269
|
+
...i,
|
|
268
270
|
modelValue: e.value,
|
|
269
271
|
multiSelect: e.field.props?.multiple || !1,
|
|
270
272
|
maxFiles: e.field.maxFiles || e.field.props?.maxFiles,
|
|
@@ -281,7 +283,7 @@ const Ne = /* @__PURE__ */ E({
|
|
|
281
283
|
if (a === "avatarUpload")
|
|
282
284
|
return {
|
|
283
285
|
size: "2xl",
|
|
284
|
-
...
|
|
286
|
+
...i,
|
|
285
287
|
modelValue: e.value,
|
|
286
288
|
editable: !e.readonly,
|
|
287
289
|
maxSize: e.field.maxFileSize ? e.field.maxFileSize * 1024 * 1024 : void 0,
|
|
@@ -289,7 +291,7 @@ const Ne = /* @__PURE__ */ E({
|
|
|
289
291
|
};
|
|
290
292
|
if (a === "tags")
|
|
291
293
|
return {
|
|
292
|
-
...
|
|
294
|
+
...i,
|
|
293
295
|
modelValue: Array.isArray(e.value) ? e.value : [],
|
|
294
296
|
placeholder: s,
|
|
295
297
|
variant: e.variant,
|
|
@@ -300,7 +302,7 @@ const Ne = /* @__PURE__ */ E({
|
|
|
300
302
|
};
|
|
301
303
|
if (a === "richTextEditor")
|
|
302
304
|
return {
|
|
303
|
-
...
|
|
305
|
+
...i,
|
|
304
306
|
modelValue: e.value ?? "",
|
|
305
307
|
placeholder: s,
|
|
306
308
|
label: void 0,
|
|
@@ -312,7 +314,8 @@ const Ne = /* @__PURE__ */ E({
|
|
|
312
314
|
};
|
|
313
315
|
if (a === "color")
|
|
314
316
|
return {
|
|
315
|
-
...
|
|
317
|
+
...i,
|
|
318
|
+
disabled: i.disabled || i.readonly,
|
|
316
319
|
modelValue: e.value || "#000000",
|
|
317
320
|
variant: e.variant,
|
|
318
321
|
size: e.size,
|
|
@@ -320,12 +323,12 @@ const Ne = /* @__PURE__ */ E({
|
|
|
320
323
|
};
|
|
321
324
|
if (a === "iconPicker")
|
|
322
325
|
return {
|
|
323
|
-
...
|
|
326
|
+
...i,
|
|
324
327
|
value: e.value || "lucide:smile"
|
|
325
328
|
};
|
|
326
329
|
if (a === "customFields")
|
|
327
330
|
return {
|
|
328
|
-
...
|
|
331
|
+
...i,
|
|
329
332
|
name: e.field.name,
|
|
330
333
|
label: e?.field?.label,
|
|
331
334
|
labelI18n: e?.field?.labelI18n,
|
|
@@ -343,7 +346,7 @@ const Ne = /* @__PURE__ */ E({
|
|
|
343
346
|
if (a === "thumbnailSelector") {
|
|
344
347
|
const n = e.value && typeof e.value == "object" ? e.value : { images: [], thumbnail: null };
|
|
345
348
|
return {
|
|
346
|
-
...
|
|
349
|
+
...i,
|
|
347
350
|
images: Array.isArray(n.images) ? n.images : [],
|
|
348
351
|
thumbnail: n.thumbnail ?? null,
|
|
349
352
|
disabled: e.disabled || l === !0,
|
|
@@ -352,12 +355,12 @@ const Ne = /* @__PURE__ */ E({
|
|
|
352
355
|
label: e.field.label
|
|
353
356
|
};
|
|
354
357
|
}
|
|
355
|
-
return
|
|
356
|
-
...
|
|
358
|
+
return R(a) ? {
|
|
359
|
+
...i,
|
|
357
360
|
value: e.field.props?.multiple && (e.value === null || e.value === void 0) ? [] : e.value,
|
|
358
361
|
values: e.values
|
|
359
|
-
} :
|
|
360
|
-
}),
|
|
362
|
+
} : i;
|
|
363
|
+
}), F = f(() => {
|
|
361
364
|
const a = o.value;
|
|
362
365
|
return a === "text" || a === "email" || a === "password" || a === "tel" || a === "url" || a === "search" || a === "textarea" || a === "switch" || a === "check" || !a ? {
|
|
363
366
|
"update:modelValue": S
|
|
@@ -379,8 +382,8 @@ const Ne = /* @__PURE__ */ E({
|
|
|
379
382
|
const r = e.field.props?.multiple;
|
|
380
383
|
let g = null;
|
|
381
384
|
r && Array.isArray(l) ? g = l.map(
|
|
382
|
-
(
|
|
383
|
-
) : g = e.field.options?.find((
|
|
385
|
+
(i) => e.field.options?.find((h) => (h.value ?? h.label) === i)?.data
|
|
386
|
+
) : g = e.field.options?.find((i) => (i.value ?? i.label) === l)?.data, d(l, g);
|
|
384
387
|
}
|
|
385
388
|
} : a === "date" || a === "time" || a === "dateRangePicker" ? {
|
|
386
389
|
change: (l) => d(l)
|
|
@@ -421,7 +424,7 @@ const Ne = /* @__PURE__ */ E({
|
|
|
421
424
|
const r = e.value && typeof e.value == "object" ? e.value : { images: [], thumbnail: null };
|
|
422
425
|
d({ ...r, thumbnail: l });
|
|
423
426
|
}
|
|
424
|
-
} :
|
|
427
|
+
} : R(a) ? {
|
|
425
428
|
onChange: (l) => {
|
|
426
429
|
d(l.value, l.data);
|
|
427
430
|
}
|
|
@@ -429,82 +432,82 @@ const Ne = /* @__PURE__ */ E({
|
|
|
429
432
|
}), H = f(() => {
|
|
430
433
|
const a = o.value;
|
|
431
434
|
return a === "text" || a === "email" || a === "password" || a === "tel" || a === "url" || a === "search" || !a;
|
|
432
|
-
}), j = f(() => H.value || o.value === "textarea" || b.value),
|
|
435
|
+
}), j = f(() => H.value || o.value === "textarea" || b.value), C = (a, l) => {
|
|
433
436
|
v("addonChange", a.name, { value: l.value });
|
|
434
437
|
}, $ = (a) => {
|
|
435
438
|
a.action && v("addonAction", a.action);
|
|
436
439
|
};
|
|
437
|
-
return (a, l) => j.value ? (c(), m(V, p({ key: 0 },
|
|
438
|
-
|
|
440
|
+
return (a, l) => j.value ? (c(), m(V, p({ key: 0 }, A.value, P(F.value)), M({ _: 2 }, [
|
|
441
|
+
L(B)(t.field.addonLeft) ? {
|
|
439
442
|
name: "addon-left",
|
|
440
443
|
fn: u(() => [
|
|
441
|
-
|
|
444
|
+
t.field.addonLeft.type === "select" ? (c(), m(w, p({
|
|
442
445
|
key: 0,
|
|
443
|
-
modelValue:
|
|
444
|
-
options:
|
|
445
|
-
},
|
|
446
|
-
onOnSelect: l[0] || (l[0] = (r) =>
|
|
446
|
+
modelValue: t.field.addonLeft.name ? t.values[t.field.addonLeft.name] : void 0,
|
|
447
|
+
options: t.field.addonLeft.options || []
|
|
448
|
+
}, t.field.addonLeft.props || {}, {
|
|
449
|
+
onOnSelect: l[0] || (l[0] = (r) => C(t.field.addonLeft, r))
|
|
447
450
|
}), {
|
|
448
451
|
trigger: u(({ selectedLabel: r }) => [
|
|
449
|
-
|
|
452
|
+
N(z, { variant: "outline" }, {
|
|
450
453
|
default: u(() => [
|
|
451
|
-
x(
|
|
454
|
+
y(x(r), 1)
|
|
452
455
|
]),
|
|
453
456
|
_: 2
|
|
454
457
|
}, 1024)
|
|
455
458
|
]),
|
|
456
459
|
_: 1
|
|
457
|
-
}, 16, ["modelValue", "options"])) :
|
|
460
|
+
}, 16, ["modelValue", "options"])) : t.field.addonLeft.type === "button" ? (c(), m(z, p({
|
|
458
461
|
key: 1,
|
|
459
462
|
variant: "outline"
|
|
460
|
-
},
|
|
461
|
-
onClick: l[1] || (l[1] = (r) => $(
|
|
463
|
+
}, t.field.addonLeft.props || {}, {
|
|
464
|
+
onClick: l[1] || (l[1] = (r) => $(t.field.addonLeft))
|
|
462
465
|
}), {
|
|
463
466
|
default: u(() => [
|
|
464
|
-
x(
|
|
467
|
+
y(x(t.field.addonLeft.text), 1)
|
|
465
468
|
]),
|
|
466
469
|
_: 1
|
|
467
|
-
}, 16)) :
|
|
470
|
+
}, 16)) : T("", !0)
|
|
468
471
|
]),
|
|
469
472
|
key: "0"
|
|
470
473
|
} : void 0,
|
|
471
|
-
|
|
474
|
+
L(B)(t.field.addonRight) ? {
|
|
472
475
|
name: "addon-right",
|
|
473
476
|
fn: u(() => [
|
|
474
|
-
|
|
477
|
+
t.field.addonRight.type === "select" ? (c(), m(w, p({
|
|
475
478
|
key: 0,
|
|
476
|
-
modelValue:
|
|
477
|
-
options:
|
|
478
|
-
},
|
|
479
|
-
onOnSelect: l[2] || (l[2] = (r) =>
|
|
479
|
+
modelValue: t.field.addonRight.name ? t.values[t.field.addonRight.name] : void 0,
|
|
480
|
+
options: t.field.addonRight.options || []
|
|
481
|
+
}, t.field.addonRight.props || {}, {
|
|
482
|
+
onOnSelect: l[2] || (l[2] = (r) => C(t.field.addonRight, r))
|
|
480
483
|
}), {
|
|
481
484
|
trigger: u(({ selectedLabel: r }) => [
|
|
482
|
-
|
|
485
|
+
N(z, { variant: "outline" }, {
|
|
483
486
|
default: u(() => [
|
|
484
|
-
x(
|
|
487
|
+
y(x(r), 1)
|
|
485
488
|
]),
|
|
486
489
|
_: 2
|
|
487
490
|
}, 1024)
|
|
488
491
|
]),
|
|
489
492
|
_: 1
|
|
490
|
-
}, 16, ["modelValue", "options"])) :
|
|
493
|
+
}, 16, ["modelValue", "options"])) : t.field.addonRight.type === "button" ? (c(), m(z, p({
|
|
491
494
|
key: 1,
|
|
492
495
|
variant: "outline"
|
|
493
|
-
},
|
|
494
|
-
onClick: l[3] || (l[3] = (r) => $(
|
|
496
|
+
}, t.field.addonRight.props || {}, {
|
|
497
|
+
onClick: l[3] || (l[3] = (r) => $(t.field.addonRight))
|
|
495
498
|
}), {
|
|
496
499
|
default: u(() => [
|
|
497
|
-
x(
|
|
500
|
+
y(x(t.field.addonRight.text), 1)
|
|
498
501
|
]),
|
|
499
502
|
_: 1
|
|
500
|
-
}, 16)) :
|
|
503
|
+
}, 16)) : T("", !0)
|
|
501
504
|
]),
|
|
502
505
|
key: "1"
|
|
503
506
|
} : void 0
|
|
504
|
-
]), 1040)) : (c(), m(q(
|
|
507
|
+
]), 1040)) : (c(), m(q(D.value), p({
|
|
505
508
|
key: 1,
|
|
506
|
-
class: o.value === "check" || o.value === "switch" &&
|
|
507
|
-
},
|
|
509
|
+
class: o.value === "check" || o.value === "switch" && t.field.props?.switchVariant === "basic" ? "" : "w-full"
|
|
510
|
+
}, A.value, P(F.value)), null, 16, ["class"]));
|
|
508
511
|
}
|
|
509
512
|
});
|
|
510
513
|
export {
|