vlite3 1.3.2 → 1.3.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/Button.vue.js +36 -36
- package/components/CategoryManager/CategoryManager.vue2.js +1 -1
- package/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +2 -2
- package/components/DataTable/DataTable.vue.d.ts +1 -1
- package/components/Dropdown/DropdownMenu.vue.js +2 -2
- package/components/Dropdown/DropdownMenu.vue2.js +18 -18
- package/components/FileTree/FileTree.vue.d.ts +17 -1
- package/components/FileTree/FileTree.vue.js +1 -1
- package/components/FileTree/FileTree.vue2.js +54 -44
- package/components/FileTree/FileTreeNode.vue.d.ts +22 -2
- package/components/FileTree/FileTreeNode.vue.js +119 -94
- package/components/FileTree/types.d.ts +2 -0
- package/components/Form/FormField.vue.js +5 -4
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +46 -46
- package/components/Pagination/Pagination.vue.d.ts +1 -0
- package/components/Pagination/Pagination.vue.js +121 -119
- package/components/Pagination/index.d.ts +1 -0
- package/components/Persona.vue.js +134 -0
- package/components/Persona.vue2.js +4 -0
- package/components/Screen/Screen.vue.js +3 -2
- package/components/Screen/ScreenFilter.vue.js +1 -1
- package/components/Stats/Stats.vue3.js +5 -0
- package/components/Switch.vue.d.ts +3 -0
- package/components/Switch.vue.js +13 -9
- package/components/Tabes/Tabes.vue.js +2 -2
- package/index.d.ts +1 -0
- package/index.js +382 -379
- package/package.json +1 -1
- package/style.css +30 -12
- package/components/Stats/Stats.vue2.js +0 -4
- /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { $t as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as U, computed as a, resolveComponent as A, openBlock as s, createElementBlock as d, createElementVNode as c, normalizeClass as m, normalizeStyle as y, createCommentVNode as u, withModifiers as C, createVNode as E, createBlock as f, Fragment as K, renderList as M, toDisplayString as L, renderSlot as I, isMemoSame as G, createSlots as H, withCtx as J, mergeProps as R } from "vue";
|
|
2
|
+
import x from "../Icon.vue.js";
|
|
3
|
+
import W from "../CheckBox.vue.js";
|
|
4
|
+
import { $t as X } from "../../utils/i18n.js";
|
|
5
|
+
const Y = { class: "flex flex-col select-none" }, Z = ["title"], p = {
|
|
6
6
|
key: 1,
|
|
7
7
|
class: "w-6 mr-1"
|
|
8
|
-
},
|
|
8
|
+
}, _ = { class: "mr-2 text-muted-foreground shrink-0" }, ee = { class: "flex-1 truncate text-sm font-medium" }, te = { class: "mr-2 text-gray-400 select-none shrink-0" }, ne = { class: "truncate" }, le = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "relative flex flex-col"
|
|
11
|
-
},
|
|
11
|
+
}, ae = /* @__PURE__ */ U({
|
|
12
12
|
name: "FileTreeNode",
|
|
13
13
|
__name: "FileTreeNode",
|
|
14
14
|
props: {
|
|
@@ -21,144 +21,160 @@ const H = { class: "flex flex-col select-none" }, J = ["title"], R = {
|
|
|
21
21
|
loadingKeys: {},
|
|
22
22
|
showCheckboxes: { type: Boolean, default: !1 },
|
|
23
23
|
highlightSearch: { type: Boolean, default: !1 },
|
|
24
|
-
searchQuery: {}
|
|
24
|
+
searchQuery: {},
|
|
25
|
+
variant: { default: "default" }
|
|
25
26
|
},
|
|
26
27
|
emits: ["toggle-expand", "toggle-select", "click-node"],
|
|
27
|
-
setup(e, { emit:
|
|
28
|
-
const
|
|
29
|
-
() =>
|
|
30
|
-
),
|
|
31
|
-
const t =
|
|
32
|
-
if (t.length <=
|
|
28
|
+
setup(e, { emit: P }) {
|
|
29
|
+
const l = e, v = P, w = a(() => l.selectedKeys.has(l.node.id)), Q = a(() => l.indeterminateKeys.has(l.node.id)), k = a(() => l.expandedKeys.has(l.node.id)), S = a(() => l.loadingKeys.has(l.node.id)), g = a(
|
|
30
|
+
() => l.node.isFolder || l.node.children && l.node.children.length > 0
|
|
31
|
+
), q = a(() => l.depth * 20 + "px"), $ = a(() => l.node.labelI18n ? X(l.node.labelI18n) : l.node.label), z = a(() => {
|
|
32
|
+
const t = $.value, n = 35;
|
|
33
|
+
if (t.length <= n) return t;
|
|
33
34
|
const o = t.lastIndexOf(".");
|
|
34
35
|
if (o === -1 || t.length - o > 10)
|
|
35
|
-
return t.substring(0,
|
|
36
|
-
const i = t.substring(o),
|
|
37
|
-
return
|
|
38
|
-
}),
|
|
39
|
-
const t =
|
|
40
|
-
if (!
|
|
36
|
+
return t.substring(0, n) + "...";
|
|
37
|
+
const i = t.substring(o), h = t.substring(0, o), F = Math.max(0, n - i.length - 3);
|
|
38
|
+
return h.substring(0, F) + "..." + i;
|
|
39
|
+
}), V = a(() => {
|
|
40
|
+
const t = z.value;
|
|
41
|
+
if (!l.highlightSearch || !l.searchQuery)
|
|
41
42
|
return [{ text: t, highlight: !1 }];
|
|
42
|
-
const
|
|
43
|
+
const n = l.searchQuery.toLowerCase(), o = t.toLowerCase().indexOf(n);
|
|
43
44
|
return o === -1 ? [{ text: t, highlight: !1 }] : [
|
|
44
45
|
{ text: t.slice(0, o), highlight: !1 },
|
|
45
46
|
{
|
|
46
|
-
text: t.slice(o, o +
|
|
47
|
+
text: t.slice(o, o + n.length),
|
|
47
48
|
highlight: !0
|
|
48
49
|
},
|
|
49
|
-
{ text: t.slice(o +
|
|
50
|
+
{ text: t.slice(o + n.length), highlight: !1 }
|
|
50
51
|
];
|
|
51
|
-
}),
|
|
52
|
-
const t =
|
|
52
|
+
}), D = a(() => {
|
|
53
|
+
const t = l.node.searchMatch;
|
|
53
54
|
if (!t) return [];
|
|
54
|
-
const
|
|
55
|
-
return o < 0 || o >=
|
|
56
|
-
{ text:
|
|
57
|
-
{ text:
|
|
58
|
-
{ text:
|
|
55
|
+
const n = t.line_content, o = t.match_start, i = t.match_length;
|
|
56
|
+
return o < 0 || o >= n.length ? [{ text: n, highlight: !1 }] : [
|
|
57
|
+
{ text: n.substring(0, o), highlight: !1 },
|
|
58
|
+
{ text: n.substring(o, o + i), highlight: !0 },
|
|
59
|
+
{ text: n.substring(o + i), highlight: !1 }
|
|
59
60
|
];
|
|
60
|
-
}),
|
|
61
|
-
t && t.stopPropagation(),
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
},
|
|
65
|
-
t.stopPropagation(),
|
|
61
|
+
}), N = (t) => {
|
|
62
|
+
t && t.stopPropagation(), v("toggle-expand", l.node);
|
|
63
|
+
}, O = () => {
|
|
64
|
+
v("toggle-select", l.node);
|
|
65
|
+
}, j = (t) => {
|
|
66
|
+
t.stopPropagation(), g.value ? N() : l.selectionMode !== "none" && v("toggle-select", l.node), v("click-node", l.node);
|
|
66
67
|
};
|
|
67
|
-
return (t,
|
|
68
|
-
const o =
|
|
69
|
-
return s(), d("div",
|
|
68
|
+
return (t, n) => {
|
|
69
|
+
const o = A("FileTreeNode", !0);
|
|
70
|
+
return s(), d("div", Y, [
|
|
70
71
|
c("div", {
|
|
71
|
-
class:
|
|
72
|
+
class: m(["group flex flex-col transition-colors cursor-pointer relative", {
|
|
72
73
|
"bg-accent/50 text-accent-foreground": w.value && e.selectionMode === "single" && !e.showCheckboxes,
|
|
73
74
|
"hover:bg-accent/50": !w.value || e.selectionMode !== "single",
|
|
74
|
-
"opacity-50 pointer-events-none": e.node.disabled
|
|
75
|
+
"opacity-50 pointer-events-none": e.node.disabled,
|
|
76
|
+
"rounded-none": e.variant === "bordered",
|
|
77
|
+
"rounded-md": e.variant === "default"
|
|
75
78
|
}]),
|
|
76
|
-
onClick:
|
|
77
|
-
title:
|
|
79
|
+
onClick: j,
|
|
80
|
+
title: $.value
|
|
78
81
|
}, [
|
|
82
|
+
e.variant === "bordered" ? (s(), d("div", {
|
|
83
|
+
key: 0,
|
|
84
|
+
class: "absolute bottom-0 right-0 h-[1px] bg-border pointer-events-none",
|
|
85
|
+
style: y({ left: e.depth * 20 + "px" })
|
|
86
|
+
}, null, 4)) : u("", !0),
|
|
79
87
|
c("div", {
|
|
80
|
-
class: "flex items-center
|
|
81
|
-
style:
|
|
88
|
+
class: m(["flex items-center pr-2", e.variant === "bordered" ? "py-2 min-h-[40px]" : "py-1 min-h-[32px]"]),
|
|
89
|
+
style: y({ paddingLeft: q.value })
|
|
82
90
|
}, [
|
|
83
|
-
|
|
91
|
+
g.value ? (s(), d("button", {
|
|
84
92
|
key: 0,
|
|
85
93
|
type: "button",
|
|
86
|
-
class:
|
|
87
|
-
onClick:
|
|
94
|
+
class: m(["p-1 mr-1 rounded-sm hover:bg-muted text-muted-foreground transition-transform duration-200 focus:outline-none", { "rotate-90": k.value }]),
|
|
95
|
+
onClick: C(N, ["stop"])
|
|
88
96
|
}, [
|
|
89
|
-
|
|
97
|
+
E(x, {
|
|
90
98
|
icon: "lucide:chevron-right",
|
|
91
99
|
class: "w-4 h-4"
|
|
92
100
|
})
|
|
93
|
-
], 2)) : (s(), d("div",
|
|
101
|
+
], 2)) : (s(), d("div", p)),
|
|
94
102
|
e.showCheckboxes && e.selectionMode !== "none" ? (s(), d("div", {
|
|
95
103
|
key: 2,
|
|
96
104
|
class: "mr-2 flex items-center justify-center bg-transparent",
|
|
97
|
-
onClick:
|
|
105
|
+
onClick: n[0] || (n[0] = C(() => {
|
|
98
106
|
}, ["stop"]))
|
|
99
107
|
}, [
|
|
100
|
-
|
|
108
|
+
E(W, {
|
|
101
109
|
checked: w.value,
|
|
102
|
-
indeterminate:
|
|
110
|
+
indeterminate: Q.value,
|
|
103
111
|
disabled: e.node.disabled,
|
|
104
|
-
"onUpdate:checked":
|
|
112
|
+
"onUpdate:checked": O,
|
|
105
113
|
rounded: "sm",
|
|
106
114
|
size: "sm"
|
|
107
115
|
}, null, 8, ["checked", "indeterminate", "disabled"])
|
|
108
|
-
])) :
|
|
109
|
-
c("div",
|
|
110
|
-
|
|
116
|
+
])) : u("", !0),
|
|
117
|
+
c("div", _, [
|
|
118
|
+
S.value ? (s(), f(x, {
|
|
111
119
|
key: 0,
|
|
112
120
|
icon: "lucide:loader-2",
|
|
113
121
|
class: "w-4 h-4 animate-spin"
|
|
114
|
-
})) : e.node.icon ? (s(),
|
|
122
|
+
})) : e.node.icon ? (s(), f(x, {
|
|
115
123
|
key: 1,
|
|
116
124
|
icon: e.node.icon,
|
|
117
125
|
class: "w-4 h-4"
|
|
118
|
-
}, null, 8, ["icon"])) :
|
|
126
|
+
}, null, 8, ["icon"])) : g.value ? (s(), f(x, {
|
|
119
127
|
key: 2,
|
|
120
|
-
icon:
|
|
128
|
+
icon: k.value ? "lucide:folder-open" : "lucide:folder",
|
|
121
129
|
class: "w-4 h-4"
|
|
122
|
-
}, null, 8, ["icon"])) : (s(),
|
|
130
|
+
}, null, 8, ["icon"])) : (s(), f(x, {
|
|
123
131
|
key: 3,
|
|
124
132
|
icon: "lucide:file",
|
|
125
133
|
class: "w-4 h-4"
|
|
126
134
|
}))
|
|
127
135
|
]),
|
|
128
|
-
c("div",
|
|
129
|
-
(s(!0), d(K, null,
|
|
130
|
-
key:
|
|
131
|
-
class:
|
|
136
|
+
c("div", ee, [
|
|
137
|
+
(s(!0), d(K, null, M(V.value, (i, h) => (s(), d("span", {
|
|
138
|
+
key: h,
|
|
139
|
+
class: m({
|
|
132
140
|
"bg-yellow-100 text-yellow-900 rounded-sm px-0.5": i.highlight
|
|
133
141
|
})
|
|
134
|
-
},
|
|
135
|
-
])
|
|
136
|
-
|
|
142
|
+
}, L(i.text), 3))), 128))
|
|
143
|
+
]),
|
|
144
|
+
t.$slots.actions ? (s(), d("div", {
|
|
145
|
+
key: 3,
|
|
146
|
+
class: "ml-2 flex items-center shrink-0",
|
|
147
|
+
onClick: n[1] || (n[1] = C(() => {
|
|
148
|
+
}, ["stop"]))
|
|
149
|
+
}, [
|
|
150
|
+
I(t.$slots, "actions", { node: e.node })
|
|
151
|
+
])) : u("", !0)
|
|
152
|
+
], 6),
|
|
137
153
|
e.node.searchMatch ? (s(), d("div", {
|
|
138
|
-
key:
|
|
154
|
+
key: 1,
|
|
139
155
|
class: "flex items-center text-[11px] text-gray-500 font-mono pr-2 pb-1.5 truncate",
|
|
140
|
-
style:
|
|
156
|
+
style: y({ paddingLeft: e.depth * 20 + 28 + "px" })
|
|
141
157
|
}, [
|
|
142
|
-
c("span",
|
|
143
|
-
c("div",
|
|
144
|
-
(s(!0), d(K, null,
|
|
145
|
-
key:
|
|
146
|
-
class:
|
|
158
|
+
c("span", te, "L" + L(e.node.searchMatch.line_number), 1),
|
|
159
|
+
c("div", ne, [
|
|
160
|
+
(s(!0), d(K, null, M(D.value, (i, h) => (s(), d("span", {
|
|
161
|
+
key: h,
|
|
162
|
+
class: m({
|
|
147
163
|
"bg-yellow-500/20 text-gray-900 px-0.5 rounded-[1px] font-medium border border-yellow-600/30": i.highlight
|
|
148
164
|
})
|
|
149
|
-
},
|
|
165
|
+
}, L(i.text), 3))), 128))
|
|
150
166
|
])
|
|
151
|
-
], 4)) :
|
|
152
|
-
], 10,
|
|
153
|
-
|
|
167
|
+
], 4)) : u("", !0)
|
|
168
|
+
], 10, Z),
|
|
169
|
+
k.value && g.value && !S.value ? (s(), d("div", le, [
|
|
154
170
|
c("div", {
|
|
155
171
|
class: "absolute top-1 bottom-1 border-l border-border",
|
|
156
|
-
style:
|
|
172
|
+
style: y({ left: e.depth * 20 + 10 + "px" })
|
|
157
173
|
}, null, 4),
|
|
158
|
-
e.node.children && e.node.children.length > 0 ? (s(!0), d(K, { key: 0 },
|
|
159
|
-
const
|
|
160
|
-
if (
|
|
161
|
-
const
|
|
174
|
+
e.node.children && e.node.children.length > 0 ? (s(!0), d(K, { key: 0 }, M(e.node.children, (i, h, F, b) => {
|
|
175
|
+
const T = [i, e.selectedKeys, e.expandedKeys, e.indeterminateKeys, e.loadingKeys, e.highlightSearch, e.searchQuery, e.showCheckboxes, e.variant, !!t.$slots.actions];
|
|
176
|
+
if (b && b.key === i.id && G(b, T)) return b;
|
|
177
|
+
const B = (s(), f(o, {
|
|
162
178
|
key: i.id,
|
|
163
179
|
node: i,
|
|
164
180
|
depth: e.depth + 1,
|
|
@@ -170,21 +186,30 @@ const H = { class: "flex flex-col select-none" }, J = ["title"], R = {
|
|
|
170
186
|
"show-checkboxes": e.showCheckboxes,
|
|
171
187
|
"highlight-search": e.highlightSearch,
|
|
172
188
|
"search-query": e.searchQuery,
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
189
|
+
variant: e.variant,
|
|
190
|
+
onToggleExpand: n[2] || (n[2] = (r) => t.$emit("toggle-expand", r)),
|
|
191
|
+
onToggleSelect: n[3] || (n[3] = (r) => t.$emit("toggle-select", r)),
|
|
192
|
+
onClickNode: n[4] || (n[4] = (r) => t.$emit("click-node", r))
|
|
193
|
+
}, H({ _: 2 }, [
|
|
194
|
+
t.$slots.actions ? {
|
|
195
|
+
name: "actions",
|
|
196
|
+
fn: J((r) => [
|
|
197
|
+
I(t.$slots, "actions", R({ ref_for: !0 }, r))
|
|
198
|
+
]),
|
|
199
|
+
key: "0"
|
|
200
|
+
} : void 0
|
|
201
|
+
]), 1032, ["node", "depth", "selection-mode", "selected-keys", "expanded-keys", "indeterminate-keys", "loading-keys", "show-checkboxes", "highlight-search", "search-query", "variant"]));
|
|
202
|
+
return B.memo = T, B;
|
|
203
|
+
}, n, 5), 128)) : k.value && g.value && (!e.node.children || e.node.children.length === 0) ? (s(), d("div", {
|
|
179
204
|
key: 1,
|
|
180
205
|
class: "py-0.5 text-xs text-muted-foreground italic",
|
|
181
|
-
style:
|
|
182
|
-
}, null, 4)) :
|
|
183
|
-
])) :
|
|
206
|
+
style: y({ paddingLeft: (e.depth + 1) * 20 + 26 + "px" })
|
|
207
|
+
}, null, 4)) : u("", !0)
|
|
208
|
+
])) : u("", !0)
|
|
184
209
|
]);
|
|
185
210
|
};
|
|
186
211
|
}
|
|
187
212
|
});
|
|
188
213
|
export {
|
|
189
|
-
|
|
214
|
+
ae as default
|
|
190
215
|
};
|
|
@@ -18,6 +18,7 @@ export interface FileNode {
|
|
|
18
18
|
searchMatch?: SearchMatch;
|
|
19
19
|
}
|
|
20
20
|
export type FileTreeSelectionMode = 'single' | 'multiple' | 'none';
|
|
21
|
+
export type FileTreeVariant = 'default' | 'bordered';
|
|
21
22
|
export interface FileTreeProps {
|
|
22
23
|
modelValue?: string[];
|
|
23
24
|
data?: FileNode[];
|
|
@@ -30,6 +31,7 @@ export interface FileTreeProps {
|
|
|
30
31
|
class?: string;
|
|
31
32
|
emptyText?: string;
|
|
32
33
|
emptyTextI18n?: string;
|
|
34
|
+
variant?: FileTreeVariant;
|
|
33
35
|
}
|
|
34
36
|
export interface FileTreeEvents {
|
|
35
37
|
(e: 'update:modelValue', keys: string[]): void;
|
|
@@ -19,7 +19,7 @@ import te from "../ColorPicker/ColorPicker.vue.js";
|
|
|
19
19
|
import ne from "../IconPicker.vue.js";
|
|
20
20
|
import re from "./CustomFields.vue.js";
|
|
21
21
|
import de from "../ChoiceBox/ChoiceBox.vue.js";
|
|
22
|
-
const
|
|
22
|
+
const Le = /* @__PURE__ */ H({
|
|
23
23
|
__name: "FormField",
|
|
24
24
|
props: {
|
|
25
25
|
field: {},
|
|
@@ -159,7 +159,7 @@ const Pe = /* @__PURE__ */ H({
|
|
|
159
159
|
class: e.field.className
|
|
160
160
|
};
|
|
161
161
|
if (a === "switch") {
|
|
162
|
-
const { variant: r,
|
|
162
|
+
const { variant: r, rounded: oe, error: se, switchVariant: ue, ...E } = t;
|
|
163
163
|
return {
|
|
164
164
|
...E,
|
|
165
165
|
modelValue: !!e.value,
|
|
@@ -168,7 +168,8 @@ const Pe = /* @__PURE__ */ H({
|
|
|
168
168
|
description: e.field.props?.description,
|
|
169
169
|
descriptionI18n: e.field.props?.descriptionI18n,
|
|
170
170
|
// Default to 'card' inside forms unless explicitly overridden via field.props.switchVariant
|
|
171
|
-
variant: e.field.props?.switchVariant ?? "card"
|
|
171
|
+
variant: e.field.props?.switchVariant ?? "card",
|
|
172
|
+
size: e.size
|
|
172
173
|
};
|
|
173
174
|
}
|
|
174
175
|
if (a === "check")
|
|
@@ -480,5 +481,5 @@ const Pe = /* @__PURE__ */ H({
|
|
|
480
481
|
}
|
|
481
482
|
});
|
|
482
483
|
export {
|
|
483
|
-
|
|
484
|
+
Le as default
|
|
484
485
|
};
|
|
@@ -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 p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-14e67e92"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as J, computed as K, ref as Q, openBlock as o, createElementBlock as u, normalizeClass as y, Fragment as p, renderList as W, withMemo as X, unref as d, createBlock as b, withCtx as D, resolveDynamicComponent as B, createTextVNode as
|
|
2
|
-
import { isComponent as m, getNestedValue as
|
|
1
|
+
import { defineComponent as J, computed as K, ref as Q, openBlock as o, createElementBlock as u, normalizeClass as y, Fragment as p, renderList as W, withMemo as X, unref as d, createBlock as b, withCtx as D, resolveDynamicComponent as B, createTextVNode as A, toDisplayString as k, createCommentVNode as i, createElementVNode as Y, createVNode as Z, markRaw as _ } from "vue";
|
|
2
|
+
import { isComponent as m, getNestedValue as V, resolveFieldType as ee } from "./utils/form.utils.js";
|
|
3
3
|
import q from "../Label.vue.js";
|
|
4
4
|
import te from "./FormField.vue.js";
|
|
5
5
|
import { $t as ne } from "../../utils/i18n.js";
|
|
@@ -15,7 +15,7 @@ const ae = {
|
|
|
15
15
|
}, ce = {
|
|
16
16
|
key: 2,
|
|
17
17
|
class: "mt-1 -text-fs-2.5 text-destructive"
|
|
18
|
-
},
|
|
18
|
+
}, ve = /* @__PURE__ */ J({
|
|
19
19
|
__name: "FormFields",
|
|
20
20
|
props: {
|
|
21
21
|
schema: {},
|
|
@@ -35,43 +35,43 @@ const ae = {
|
|
|
35
35
|
},
|
|
36
36
|
emits: ["change", "addonAction"],
|
|
37
37
|
setup(a, { emit: $ }) {
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
40
|
-
}),
|
|
41
|
-
values:
|
|
42
|
-
globalValues:
|
|
43
|
-
isUpdate:
|
|
44
|
-
}),
|
|
45
|
-
if (!
|
|
46
|
-
const n =
|
|
47
|
-
return !n || !
|
|
48
|
-
}, x = (t) =>
|
|
38
|
+
const r = a, F = $, E = K(() => {
|
|
39
|
+
if (r.className) return r.className;
|
|
40
|
+
}), s = (t) => ee(t, {
|
|
41
|
+
values: r.values,
|
|
42
|
+
globalValues: r.values,
|
|
43
|
+
isUpdate: r.isUpdate
|
|
44
|
+
}), I = (t) => {
|
|
45
|
+
if (!r.excludeTypes || r.excludeTypes.length === 0) return !0;
|
|
46
|
+
const n = s(t);
|
|
47
|
+
return !n || !r.excludeTypes.includes(n);
|
|
48
|
+
}, x = (t) => V(r.values, t.name), h = (t) => r.errors[t.name] || "", f = (t) => r.isFieldVisible ? r.isFieldVisible(t) : !0, C = (t) => r.isFieldDisabled ? r.isFieldDisabled(t) : t.disabled === !0, N = (t) => r.isFieldReadonly ? r.isFieldReadonly(t) : t.readonly === !0, c = (t) => t.labelI18n ? ne(t.labelI18n) : t.label, R = (t) => {
|
|
49
49
|
if (t)
|
|
50
50
|
return m(t) ? _(t) : t;
|
|
51
51
|
}, j = (t, n) => {
|
|
52
|
-
|
|
52
|
+
F("change", t.name, n);
|
|
53
53
|
}, P = (t) => t.itemClass || "", S = (t, n) => {
|
|
54
|
-
|
|
54
|
+
F("change", t, n);
|
|
55
55
|
}, H = (t) => {
|
|
56
|
-
|
|
57
|
-
},
|
|
56
|
+
F("addonAction", t);
|
|
57
|
+
}, v = (t) => t && typeof t == "object" && t.name ? t.name : null, g = Q({}), M = (t) => {
|
|
58
58
|
g.value[t] = !0;
|
|
59
59
|
}, O = (t) => {
|
|
60
60
|
g.value[t] = !1;
|
|
61
61
|
}, L = (t) => {
|
|
62
|
-
const n = x(t), e =
|
|
62
|
+
const n = x(t), e = s(t);
|
|
63
63
|
let l = n != null && n !== "" && !(Array.isArray(n) && n.length === 0);
|
|
64
64
|
const z = typeof n == "number" && !isNaN(n);
|
|
65
65
|
return e === "dateRangePicker" && n && typeof n == "object" && (l = !!(n.startDate || n.endDate || n.start || n.end)), T(t) || e === "number" ? g.value[t.name] || l || z : l || z;
|
|
66
66
|
}, T = (t) => {
|
|
67
|
-
const n =
|
|
67
|
+
const n = s(t) || "text";
|
|
68
68
|
return ["text", "email", "password", "tel", "url", "search", "textarea"].includes(n);
|
|
69
69
|
}, G = (t) => {
|
|
70
|
-
const n =
|
|
70
|
+
const n = s(t);
|
|
71
71
|
return n === "number" ? (t.props?.variant ?? "split") === "split" ? "left-4" : "left-3" : n === "date" || n === "time" || n === "color" || n === "dateRangePicker" ? "left-10" : "left-3";
|
|
72
|
-
},
|
|
73
|
-
if (
|
|
74
|
-
const n =
|
|
72
|
+
}, w = (t) => {
|
|
73
|
+
if (r.variant !== "floating") return !1;
|
|
74
|
+
const n = s(t) || "text";
|
|
75
75
|
return ![
|
|
76
76
|
"switch",
|
|
77
77
|
"check",
|
|
@@ -87,15 +87,15 @@ const ae = {
|
|
|
87
87
|
return n;
|
|
88
88
|
};
|
|
89
89
|
return (t, n) => (o(), u("div", {
|
|
90
|
-
class: y(["grid", a.variant === "floating" ? "gap-5 mt-1" : "gap-4",
|
|
90
|
+
class: y(["grid", a.variant === "floating" ? "gap-5 mt-1" : "gap-4", E.value])
|
|
91
91
|
}, [
|
|
92
92
|
(o(!0), u(p, null, W(a.schema, (e) => (o(), u(p, {
|
|
93
93
|
key: e.name
|
|
94
94
|
}, [
|
|
95
|
-
|
|
95
|
+
f(e) && I(e) ? X([
|
|
96
96
|
e,
|
|
97
97
|
x(e),
|
|
98
|
-
|
|
98
|
+
h(e),
|
|
99
99
|
C(e),
|
|
100
100
|
N(e),
|
|
101
101
|
g.value[e.name],
|
|
@@ -105,15 +105,15 @@ const ae = {
|
|
|
105
105
|
a.isUpdate,
|
|
106
106
|
a.showRequiredAsterisk,
|
|
107
107
|
a.fieldLoading[e.name],
|
|
108
|
-
|
|
109
|
-
d(m)(
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
s(e),
|
|
109
|
+
d(m)(s(e)) || s(e) === "customFields" ? a.values : null,
|
|
110
|
+
v(e.addonLeft) ? d(V)(a.values, v(e.addonLeft)) : null,
|
|
111
|
+
v(e.addonRight) ? d(V)(a.values, v(e.addonRight)) : null
|
|
112
112
|
], () => (o(), u("div", {
|
|
113
113
|
key: 0,
|
|
114
114
|
class: y(["max-md:col-span-full! form-field-item", P(e)])
|
|
115
115
|
}, [
|
|
116
|
-
c(e) &&
|
|
116
|
+
c(e) && s(e) !== "switch" && s(e) !== "check" && s(e) !== "customFields" && s(e) !== "choiceBox" && !w(e) ? (o(), b(q, {
|
|
117
117
|
key: 0,
|
|
118
118
|
size: "md",
|
|
119
119
|
for: e.name,
|
|
@@ -121,21 +121,21 @@ const ae = {
|
|
|
121
121
|
}, {
|
|
122
122
|
default: D(() => [
|
|
123
123
|
d(m)(c(e)) ? (o(), b(B(R(c(e))), { key: 0 })) : (o(), u(p, { key: 1 }, [
|
|
124
|
-
|
|
124
|
+
A(k(c(e)) + " ", 1),
|
|
125
125
|
e.required && a.showRequiredAsterisk ? (o(), u("span", ae, "*")) : i("", !0)
|
|
126
126
|
], 64))
|
|
127
127
|
]),
|
|
128
128
|
_: 2
|
|
129
129
|
}, 1032, ["for"])) : i("", !0),
|
|
130
130
|
Y("div", {
|
|
131
|
-
class: y([
|
|
132
|
-
"
|
|
133
|
-
|
|
134
|
-
]),
|
|
131
|
+
class: y(["relative", [
|
|
132
|
+
s(e) === "check" || s(e) === "switch" && e.props?.switchVariant === "basic" ? "w-auto" : "w-full",
|
|
133
|
+
s(e) === "switch" || s(e) === "check" ? "mt-auto" : ""
|
|
134
|
+
]]),
|
|
135
135
|
onFocusin: (l) => M(e.name),
|
|
136
136
|
onFocusout: (l) => O(e.name)
|
|
137
137
|
}, [
|
|
138
|
-
|
|
138
|
+
w(e) && U(e) && !T(e) ? (o(), u("label", {
|
|
139
139
|
key: 0,
|
|
140
140
|
for: e.name,
|
|
141
141
|
class: y([
|
|
@@ -144,12 +144,12 @@ const ae = {
|
|
|
144
144
|
])
|
|
145
145
|
}, [
|
|
146
146
|
d(m)(c(e)) ? (o(), b(B(R(c(e))), { key: 0 })) : (o(), u(p, { key: 1 }, [
|
|
147
|
-
|
|
147
|
+
A(k(c(e)) + " ", 1),
|
|
148
148
|
e.required ? (o(), u("span", oe, "*")) : i("", !0)
|
|
149
149
|
], 64))
|
|
150
150
|
], 10, re)) : i("", !0),
|
|
151
151
|
Z(te, {
|
|
152
|
-
field:
|
|
152
|
+
field: r.variant === "floating" ? {
|
|
153
153
|
...e,
|
|
154
154
|
placeholder: void 0,
|
|
155
155
|
placeholderI18n: void 0,
|
|
@@ -157,7 +157,7 @@ const ae = {
|
|
|
157
157
|
} : { ...e, props: { ...e.props || {}, id: e.name } },
|
|
158
158
|
value: x(e),
|
|
159
159
|
floatingActive: L(e),
|
|
160
|
-
label:
|
|
160
|
+
label: s(e) === "customFields" ? void 0 : w(e) ? U(e) : void 0,
|
|
161
161
|
values: a.values,
|
|
162
162
|
errors: a.errors,
|
|
163
163
|
variant: a.variant,
|
|
@@ -165,7 +165,7 @@ const ae = {
|
|
|
165
165
|
rounded: a.rounded,
|
|
166
166
|
disabled: C(e),
|
|
167
167
|
readonly: N(e),
|
|
168
|
-
error:
|
|
168
|
+
error: h(e),
|
|
169
169
|
isUpdate: a.isUpdate,
|
|
170
170
|
loading: a.fieldLoading[e.name],
|
|
171
171
|
onChange: (l) => j(e, l),
|
|
@@ -173,23 +173,23 @@ const ae = {
|
|
|
173
173
|
onAddonAction: H
|
|
174
174
|
}, null, 8, ["field", "value", "floatingActive", "label", "values", "errors", "variant", "size", "rounded", "disabled", "readonly", "error", "isUpdate", "loading", "onChange"])
|
|
175
175
|
], 42, se),
|
|
176
|
-
|
|
176
|
+
s(e) === "check" || s(e) === "switch" && e.props?.switchVariant === "basic" ? (o(), b(q, {
|
|
177
177
|
key: 1,
|
|
178
178
|
for: e.name,
|
|
179
179
|
class: "ml-2 text-sm font-medium cursor-pointer"
|
|
180
180
|
}, {
|
|
181
181
|
default: D(() => [
|
|
182
|
-
|
|
182
|
+
A(k(c(e)) + " ", 1),
|
|
183
183
|
e.required ? (o(), u("span", ue, "*")) : i("", !0)
|
|
184
184
|
]),
|
|
185
185
|
_: 2
|
|
186
186
|
}, 1032, ["for"])) : i("", !0),
|
|
187
|
-
|
|
187
|
+
h(e) ? (o(), u("p", ce, k(h(e)), 1)) : i("", !0)
|
|
188
188
|
], 2)), n, 0) : i("", !0)
|
|
189
189
|
], 64))), 128))
|
|
190
190
|
], 2));
|
|
191
191
|
}
|
|
192
192
|
});
|
|
193
193
|
export {
|
|
194
|
-
|
|
194
|
+
ve as default
|
|
195
195
|
};
|