vlite3 0.7.11 → 0.7.12
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 +1 -1
- package/components/DatePicker.vue.js +1 -1
- package/components/FilePicker/FilePicker.vue.js +56 -54
- package/components/Form/Form.vue.d.ts +12 -2
- package/components/Form/Form.vue.js +1 -1
- package/components/Form/Form.vue2.js +228 -191
- package/components/Form/FormField.vue.d.ts +3 -0
- package/components/Form/FormField.vue.js +87 -81
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +59 -51
- package/components/List/ListFieldRow.vue.d.ts +4 -0
- package/components/List/ListFieldRow.vue.js +198 -113
- package/components/NumberInput.vue.js +2 -2
- package/components/NumberInput.vue2.js +36 -35
- package/components/PermissionMatrix/PermissionEditor.vue.js +72 -129
- package/components/PermissionMatrix/PermissionEditorList.vue.js +1 -1
- package/components/PermissionMatrix/PermissionEditorList.vue2.js +101 -111
- package/components/PermissionMatrix/PermissionEditorMatrix.vue.js +1 -1
- package/components/PermissionMatrix/PermissionEditorMatrix.vue2.js +129 -133
- package/components/PermissionMatrix/PermissionMatrix.vue.js +1 -1
- package/components/PermissionMatrix/PermissionMatrix.vue2.js +171 -156
- package/components/PermissionMatrix/usePermissionSearch.d.ts +13 -0
- package/components/PermissionMatrix/usePermissionSearch.js +71 -0
- package/components/PermissionMatrix/usePermissionState.d.ts +22 -0
- package/components/PermissionMatrix/usePermissionState.js +77 -0
- package/components/Screen/ScreenFilter.vue.js +32 -32
- package/package.json +1 -1
- package/style.css +1 -1
package/components/Button.vue.js
CHANGED
|
@@ -38,7 +38,7 @@ const D = ["type", "disabled"], q = /* @__PURE__ */ B({
|
|
|
38
38
|
success: "bg-success text-success-fg hover:bg-success/80",
|
|
39
39
|
"success-light": "bg-success-light text-success-fg-light hover:bg-success/20",
|
|
40
40
|
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground text-foreground",
|
|
41
|
-
"outline-floating": "border border-input bg-transparent hover:bg-transparent text-foreground border-input",
|
|
41
|
+
"outline-floating": "border px-3.5! border-input bg-transparent hover:bg-transparent text-foreground border-input active:scale-100!",
|
|
42
42
|
"outline-primary": "border border-primary text-primary hover:bg-primary/10",
|
|
43
43
|
"outline-danger": "border border-destructive text-destructive hover:bg-destructive/10",
|
|
44
44
|
"outline-warning": "border border-warning text-warning hover:bg-warning/10",
|
|
@@ -52,7 +52,7 @@ const S = { class: "overflow-hidden min-w-[300px]" }, U = /* @__PURE__ */ P({
|
|
|
52
52
|
}
|
|
53
53
|
}), s = n(() => {
|
|
54
54
|
if (l.placeholderI18n) return y(l.placeholderI18n);
|
|
55
|
-
if (l.placeholder) return l.placeholder;
|
|
55
|
+
if (l.placeholder !== void 0) return l.placeholder;
|
|
56
56
|
const t = y("vlite.datePicker.placeholder");
|
|
57
57
|
return t !== "vlite.datePicker.placeholder" ? t : "Select date";
|
|
58
58
|
}), c = (t) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as Y, computed as f, ref as S, useSlots as Z, openBlock as
|
|
1
|
+
import { defineComponent as Y, computed as f, ref as S, useSlots as Z, openBlock as r, createElementBlock as c, createElementVNode as n, renderSlot as _, normalizeClass as C, createBlock as y, withModifiers as M, createVNode as V, toDisplayString as b, createTextVNode as ee, createCommentVNode as F, Fragment as le, renderList as te } from "vue";
|
|
2
2
|
import p from "../Icon.vue.js";
|
|
3
3
|
import P from "../Button.vue.js";
|
|
4
4
|
import { $t as k } from "../../utils/i18n.js";
|
|
5
|
-
const ie = { class: "w-full" },
|
|
5
|
+
const ie = { class: "w-full" }, oe = ["multiple", "accept"], ae = ["value", "placeholder", "disabled"], re = { class: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center justify-center gap-2 bg-background" }, se = { class: "p-3 bg-muted rounded-full text-muted-foreground" }, ne = { class: "space-y-1" }, de = { class: "text-sm font-medium text-foreground" }, ue = { class: "text-primary hover:underline" }, ce = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "text-xs text-muted-foreground"
|
|
8
8
|
}, fe = {
|
|
@@ -35,7 +35,9 @@ const ie = { class: "w-full" }, ae = ["multiple", "accept"], re = ["value", "pla
|
|
|
35
35
|
},
|
|
36
36
|
emits: ["update:modelValue", "change", "error"],
|
|
37
37
|
setup(i, { emit: $ }) {
|
|
38
|
-
const e = i, d = $, I = f(
|
|
38
|
+
const e = i, d = $, I = f(
|
|
39
|
+
() => e.placeholderI18n ? k(e.placeholderI18n) : e.placeholder !== void 0 ? e.placeholder : "Select file..."
|
|
40
|
+
), N = f(() => {
|
|
39
41
|
if (e.textI18n) return k(e.textI18n);
|
|
40
42
|
const l = k("vlite.filePicker.clickToUpload");
|
|
41
43
|
return l !== "vlite.filePicker.clickToUpload" ? l : "Click to upload";
|
|
@@ -51,9 +53,9 @@ const ie = { class: "w-full" }, ae = ["multiple", "accept"], re = ["value", "pla
|
|
|
51
53
|
let l = [];
|
|
52
54
|
return Array.isArray(e.modelValue) ? l = e.modelValue : e.modelValue && (l = [e.modelValue]), l.map((t) => {
|
|
53
55
|
if (typeof t == "string") {
|
|
54
|
-
const
|
|
56
|
+
const a = t.split("/").pop() || "Unknown File";
|
|
55
57
|
return {
|
|
56
|
-
fileName: decodeURIComponent(
|
|
58
|
+
fileName: decodeURIComponent(a),
|
|
57
59
|
fileType: "unknown",
|
|
58
60
|
fileSize: 0,
|
|
59
61
|
file: null,
|
|
@@ -82,63 +84,63 @@ const ie = { class: "w-full" }, ae = ["multiple", "accept"], re = ["value", "pla
|
|
|
82
84
|
t.files && D(t.files), t.value = "";
|
|
83
85
|
}, G = (l) => {
|
|
84
86
|
if (l === 0 || !l) return "";
|
|
85
|
-
const t = 1024,
|
|
86
|
-
return parseFloat((l / Math.pow(t, s)).toFixed(2)) + " " +
|
|
87
|
-
}, K = (l) => new Promise((t,
|
|
87
|
+
const t = 1024, a = ["Bytes", "KB", "MB", "GB", "TB"], s = Math.floor(Math.log(l) / Math.log(t));
|
|
88
|
+
return parseFloat((l / Math.pow(t, s)).toFixed(2)) + " " + a[s];
|
|
89
|
+
}, K = (l) => new Promise((t, a) => {
|
|
88
90
|
const s = new FileReader();
|
|
89
91
|
s.readAsDataURL(l), s.onload = () => {
|
|
90
|
-
typeof s.result == "string" ? t(s.result) :
|
|
91
|
-
}, s.onerror = (m) =>
|
|
92
|
+
typeof s.result == "string" ? t(s.result) : a(new Error("Failed to read file as base64"));
|
|
93
|
+
}, s.onerror = (m) => a(m);
|
|
92
94
|
}), D = async (l) => {
|
|
93
95
|
if (l.length === 0) return;
|
|
94
96
|
u.value = !0;
|
|
95
|
-
const t = [],
|
|
97
|
+
const t = [], a = [], s = Array.from(l);
|
|
96
98
|
let m = e.multiSelect ? s : [s[0]];
|
|
97
99
|
if (e.multiSelect && e.maxFiles) {
|
|
98
|
-
const
|
|
100
|
+
const o = Array.isArray(e.modelValue) ? e.modelValue.length : e.modelValue ? 1 : 0, g = e.maxFiles - o;
|
|
99
101
|
if (g <= 0) {
|
|
100
102
|
d("error", `Maximum ${e.maxFiles} files allowed`), u.value = !1;
|
|
101
103
|
return;
|
|
102
104
|
}
|
|
103
|
-
m.length > g && (
|
|
105
|
+
m.length > g && (a.push(`Only ${g} more file(s) allowed. Maximum ${e.maxFiles} files.`), m = m.slice(0, g));
|
|
104
106
|
}
|
|
105
107
|
try {
|
|
106
|
-
for (const
|
|
108
|
+
for (const o of m) {
|
|
107
109
|
if (e.fileTypes.length > 0 && !e.fileTypes.some((x) => {
|
|
108
110
|
if (x.startsWith("."))
|
|
109
|
-
return
|
|
111
|
+
return o.name.toLowerCase().endsWith(x.toLowerCase());
|
|
110
112
|
if (x.endsWith("/*")) {
|
|
111
113
|
const X = x.split("/")[0];
|
|
112
|
-
return
|
|
114
|
+
return o.type.startsWith(X);
|
|
113
115
|
}
|
|
114
|
-
return
|
|
116
|
+
return o.type === x;
|
|
115
117
|
})) {
|
|
116
|
-
|
|
118
|
+
a.push(`File type not allowed: ${o.name}`);
|
|
117
119
|
continue;
|
|
118
120
|
}
|
|
119
121
|
let g = !1;
|
|
120
|
-
e.maxSize &&
|
|
122
|
+
e.maxSize && o.size > e.maxSize && (a.push(`File too large: ${o.name}`), g = !0);
|
|
121
123
|
let T = "";
|
|
122
124
|
if (e.returnFormat === "base64" && !g)
|
|
123
125
|
try {
|
|
124
|
-
T = await K(
|
|
126
|
+
T = await K(o);
|
|
125
127
|
} catch (B) {
|
|
126
128
|
console.error("Base64 read failed", B);
|
|
127
129
|
}
|
|
128
130
|
t.push({
|
|
129
|
-
fileName:
|
|
130
|
-
fileType:
|
|
131
|
-
fileSize:
|
|
132
|
-
file:
|
|
131
|
+
fileName: o.name,
|
|
132
|
+
fileType: o.type,
|
|
133
|
+
fileSize: o.size,
|
|
134
|
+
file: o,
|
|
133
135
|
base64: T
|
|
134
136
|
});
|
|
135
137
|
}
|
|
136
|
-
if (
|
|
137
|
-
let
|
|
138
|
-
e.multiSelect ?
|
|
138
|
+
if (a.length > 0 && d("error", a.join("; ")), t.length > 0) {
|
|
139
|
+
let o;
|
|
140
|
+
e.multiSelect ? o = [...Array.isArray(e.modelValue) ? e.modelValue : e.modelValue ? [e.modelValue] : [], ...t] : o = t[0], d("update:modelValue", o), d("change", o);
|
|
139
141
|
}
|
|
140
|
-
} catch (
|
|
141
|
-
console.error("Error processing files:",
|
|
142
|
+
} catch (o) {
|
|
143
|
+
console.error("Error processing files:", o), d("error", "Failed to process files");
|
|
142
144
|
} finally {
|
|
143
145
|
u.value = !1;
|
|
144
146
|
}
|
|
@@ -156,7 +158,7 @@ const ie = { class: "w-full" }, ae = ["multiple", "accept"], re = ["value", "pla
|
|
|
156
158
|
sm: "h-8 text-xs",
|
|
157
159
|
md: "h-10 text-sm",
|
|
158
160
|
lg: "h-12 text-base"
|
|
159
|
-
},
|
|
161
|
+
}, a = {
|
|
160
162
|
none: "rounded-none",
|
|
161
163
|
sm: "rounded-sm",
|
|
162
164
|
md: "rounded-md",
|
|
@@ -170,13 +172,13 @@ const ie = { class: "w-full" }, ae = ["multiple", "accept"], re = ["value", "pla
|
|
|
170
172
|
"border border-input focus-visible:border-primary",
|
|
171
173
|
// Default outline style
|
|
172
174
|
t[e.size],
|
|
173
|
-
|
|
175
|
+
a[e.rounded],
|
|
174
176
|
"pr-10",
|
|
175
177
|
// Space for icon
|
|
176
178
|
e.disabled ? "cursor-not-allowed opacity-50" : ""
|
|
177
179
|
].join(" ");
|
|
178
180
|
});
|
|
179
|
-
return (l, t) => (
|
|
181
|
+
return (l, t) => (r(), c("div", ie, [
|
|
180
182
|
n("input", {
|
|
181
183
|
ref_key: "fileInput",
|
|
182
184
|
ref: z,
|
|
@@ -185,14 +187,14 @@ const ie = { class: "w-full" }, ae = ["multiple", "accept"], re = ["value", "pla
|
|
|
185
187
|
accept: U.value,
|
|
186
188
|
class: "hidden",
|
|
187
189
|
onChange: O
|
|
188
|
-
}, null, 40,
|
|
190
|
+
}, null, 40, oe),
|
|
189
191
|
_(l.$slots, "trigger", {
|
|
190
192
|
trigger: v,
|
|
191
193
|
isDragging: h.value,
|
|
192
194
|
isLoading: i.loading || u.value,
|
|
193
195
|
files: w.value
|
|
194
196
|
}, () => [
|
|
195
|
-
i.variant === "input" ? (
|
|
197
|
+
i.variant === "input" ? (r(), c("div", {
|
|
196
198
|
key: 0,
|
|
197
199
|
class: "relative",
|
|
198
200
|
onClick: v
|
|
@@ -204,13 +206,13 @@ const ie = { class: "w-full" }, ae = ["multiple", "accept"], re = ["value", "pla
|
|
|
204
206
|
readonly: "",
|
|
205
207
|
class: C(Q.value),
|
|
206
208
|
disabled: i.disabled || i.loading || u.value
|
|
207
|
-
}, null, 10,
|
|
208
|
-
n("div",
|
|
209
|
-
i.loading || u.value ? (
|
|
209
|
+
}, null, 10, ae),
|
|
210
|
+
n("div", re, [
|
|
211
|
+
i.loading || u.value ? (r(), y(p, {
|
|
210
212
|
key: 0,
|
|
211
213
|
icon: "lucide:loader-2",
|
|
212
214
|
class: "h-4 w-4 animate-spin text-muted-foreground"
|
|
213
|
-
})) : A.value && !i.disabled ? (
|
|
215
|
+
})) : A.value && !i.disabled ? (r(), c("button", {
|
|
214
216
|
key: 1,
|
|
215
217
|
type: "button",
|
|
216
218
|
class: "text-muted-foreground hover:text-foreground focus:outline-none",
|
|
@@ -220,23 +222,23 @@ const ie = { class: "w-full" }, ae = ["multiple", "accept"], re = ["value", "pla
|
|
|
220
222
|
icon: "lucide:x-circle",
|
|
221
223
|
class: "h-4 w-4"
|
|
222
224
|
})
|
|
223
|
-
])) : (
|
|
225
|
+
])) : (r(), y(p, {
|
|
224
226
|
key: 2,
|
|
225
227
|
icon: "lucide:upload",
|
|
226
228
|
class: "h-4 w-4 text-muted-foreground"
|
|
227
229
|
}))
|
|
228
230
|
])
|
|
229
|
-
])) : (
|
|
231
|
+
])) : (r(), c("div", {
|
|
230
232
|
key: 1,
|
|
231
233
|
class: "relative",
|
|
232
234
|
onDragover: E,
|
|
233
235
|
onDragleave: W,
|
|
234
236
|
onDrop: R
|
|
235
237
|
}, [
|
|
236
|
-
A.value ? (
|
|
237
|
-
(
|
|
238
|
+
A.value ? (r(), c("div", fe, [
|
|
239
|
+
(r(!0), c(le, null, te(w.value, (a, s) => (r(), c("div", {
|
|
238
240
|
key: s,
|
|
239
|
-
class: C(["relative flex items-center p-3 border border-border rounded-lg bg-
|
|
241
|
+
class: C(["relative flex items-center p-3 border border-border rounded-lg bg-body shadow-sm transition-colors group", [!i.multiSelect && !i.disabled ? "cursor-pointer hover:border-primary/50" : ""]]),
|
|
240
242
|
onClick: t[0] || (t[0] = (m) => !i.multiSelect && !i.disabled ? v() : null)
|
|
241
243
|
}, [
|
|
242
244
|
n("div", me, [
|
|
@@ -248,11 +250,11 @@ const ie = { class: "w-full" }, ae = ["multiple", "accept"], re = ["value", "pla
|
|
|
248
250
|
])
|
|
249
251
|
]),
|
|
250
252
|
n("div", pe, [
|
|
251
|
-
n("p", he, b(
|
|
252
|
-
n("p", ve, b(G(
|
|
253
|
+
n("p", he, b(a.fileName), 1),
|
|
254
|
+
n("p", ve, b(G(a.fileSize)), 1)
|
|
253
255
|
]),
|
|
254
256
|
n("div", xe, [
|
|
255
|
-
!i.disabled && !i.loading ? (
|
|
257
|
+
!i.disabled && !i.loading ? (r(), y(P, {
|
|
256
258
|
key: 0,
|
|
257
259
|
size: "xs",
|
|
258
260
|
variant: "ghost",
|
|
@@ -263,7 +265,7 @@ const ie = { class: "w-full" }, ae = ["multiple", "accept"], re = ["value", "pla
|
|
|
263
265
|
}, null, 8, ["onClick"])) : F("", !0)
|
|
264
266
|
])
|
|
265
267
|
], 2))), 128)),
|
|
266
|
-
i.multiSelect && (!i.maxFiles || w.value.length < i.maxFiles) ? (
|
|
268
|
+
i.multiSelect && (!i.maxFiles || w.value.length < i.maxFiles) ? (r(), c("div", ye, [
|
|
267
269
|
V(P, {
|
|
268
270
|
size: "sm",
|
|
269
271
|
variant: "outline",
|
|
@@ -273,20 +275,20 @@ const ie = { class: "w-full" }, ae = ["multiple", "accept"], re = ["value", "pla
|
|
|
273
275
|
onClick: v
|
|
274
276
|
}, null, 8, ["text", "disabled"])
|
|
275
277
|
])) : F("", !0)
|
|
276
|
-
])) : (
|
|
278
|
+
])) : (r(), c("div", {
|
|
277
279
|
key: 0,
|
|
278
|
-
class: C(["border-2 border-dashed border-border rounded-lg p-6 transition-all duration-200 ease-in-out cursor-pointer flex flex-col items-center justify-center text-center gap-2", [
|
|
279
|
-
h.value ? "border-primary bg-primary/5" : "hover:border-primary/50
|
|
280
|
+
class: C(["border-2 bg-body border-dashed border-border rounded-lg p-6 transition-all duration-200 ease-in-out cursor-pointer flex flex-col items-center justify-center text-center gap-2", [
|
|
281
|
+
h.value ? "border-primary bg-primary/5" : "hover:border-primary/50 ",
|
|
280
282
|
i.disabled || i.loading || u.value ? "opacity-50 cursor-not-allowed" : ""
|
|
281
283
|
]]),
|
|
282
284
|
onClick: v
|
|
283
285
|
}, [
|
|
284
286
|
n("div", se, [
|
|
285
|
-
i.loading || u.value ? (
|
|
287
|
+
i.loading || u.value ? (r(), y(p, {
|
|
286
288
|
key: 0,
|
|
287
289
|
icon: "lucide:loader-2",
|
|
288
290
|
class: "w-6 h-6 animate-spin"
|
|
289
|
-
})) : (
|
|
291
|
+
})) : (r(), y(p, {
|
|
290
292
|
key: 1,
|
|
291
293
|
icon: "lucide:upload-cloud",
|
|
292
294
|
class: "w-6 h-6"
|
|
@@ -297,10 +299,10 @@ const ie = { class: "w-full" }, ae = ["multiple", "accept"], re = ["value", "pla
|
|
|
297
299
|
n("span", ue, b(N.value), 1),
|
|
298
300
|
ee(" " + b(j.value), 1)
|
|
299
301
|
]),
|
|
300
|
-
i.fileTypes.length ? (
|
|
302
|
+
i.fileTypes.length ? (r(), c("p", ce, b(i.fileTypes.join(", ")), 1)) : F("", !0)
|
|
301
303
|
])
|
|
302
304
|
], 2)),
|
|
303
|
-
i.loading || u.value ? (
|
|
305
|
+
i.loading || u.value ? (r(), c("div", be, [
|
|
304
306
|
n("div", ke, [
|
|
305
307
|
V(p, {
|
|
306
308
|
icon: "lucide:loader-2",
|
|
@@ -25,6 +25,8 @@ interface Props {
|
|
|
25
25
|
timelineTextPosition?: TimelineTextPosition;
|
|
26
26
|
emitFields?: string[];
|
|
27
27
|
showRequiredAsterisk?: boolean;
|
|
28
|
+
/** Pin footer to bottom of viewport/container */
|
|
29
|
+
stickyFooter?: boolean;
|
|
28
30
|
}
|
|
29
31
|
declare function __VLS_template(): {
|
|
30
32
|
attrs: Partial<{}>;
|
|
@@ -36,7 +38,10 @@ declare function __VLS_template(): {
|
|
|
36
38
|
handleSubmit: () => Promise<void>;
|
|
37
39
|
}): any;
|
|
38
40
|
};
|
|
39
|
-
refs: {
|
|
41
|
+
refs: {
|
|
42
|
+
sentinelRef: HTMLDivElement;
|
|
43
|
+
footerRef: HTMLDivElement;
|
|
44
|
+
};
|
|
40
45
|
rootEl: HTMLFormElement;
|
|
41
46
|
};
|
|
42
47
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
@@ -53,6 +58,7 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
|
|
|
53
58
|
}>, {
|
|
54
59
|
values: Record<string, any>;
|
|
55
60
|
footer: boolean;
|
|
61
|
+
size: InputSize;
|
|
56
62
|
class: string;
|
|
57
63
|
loading: boolean;
|
|
58
64
|
isUpdate: boolean;
|
|
@@ -68,7 +74,11 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
|
|
|
68
74
|
groupClass: string;
|
|
69
75
|
timelineTextPosition: TimelineTextPosition;
|
|
70
76
|
emitFields: string[];
|
|
71
|
-
|
|
77
|
+
stickyFooter: boolean;
|
|
78
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
79
|
+
sentinelRef: HTMLDivElement;
|
|
80
|
+
footerRef: HTMLDivElement;
|
|
81
|
+
}, HTMLFormElement>;
|
|
72
82
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
73
83
|
export default _default;
|
|
74
84
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Form.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-
|
|
4
|
+
const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-1a2b21d0"]]);
|
|
5
5
|
export {
|
|
6
6
|
p as default
|
|
7
7
|
};
|