vlite3 0.9.1 → 0.9.3
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/Alert.vue.js +40 -38
- package/components/Carousel/Carousel.vue.d.ts +2 -2
- package/components/Carousel/Carousel.vue.js +2 -2
- package/components/Carousel/Carousel.vue2.js +1 -1
- package/components/Chat/ChatBubble.vue.d.ts +18 -0
- package/components/Chat/ChatInterface.vue.d.ts +45 -0
- package/components/Chat/index.d.ts +2 -0
- package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
- package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
- package/components/DataTable/DataTableRow.vue.js +1 -1
- package/components/DateTime/DateTime.vue.js +31 -0
- package/components/DateTime/DateTime.vue2.js +4 -0
- package/components/DateTime/index.d.ts +1 -0
- package/components/FilePicker/FilePicker.vue.d.ts +4 -1
- package/components/FilePicker/FilePicker.vue.js +189 -139
- package/components/Form/CustomFields.vue.d.ts +2 -0
- package/components/Form/CustomFields.vue.js +2 -2
- package/components/Form/CustomFields.vue2.js +121 -99
- package/components/Form/FormField.vue.js +3 -1
- package/components/Form/types.d.ts +1 -0
- package/components/List/ListFieldRow.vue.js +1 -1
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/Screen/Screen.vue.d.ts +1 -0
- package/components/Screen/Screen.vue.js +112 -107
- package/components/Screen/ScreenFilter.vue.js +3 -2
- package/components/Screen/components/ScreenEmptyState.vue.js +11 -10
- package/components/Screen/components/ScreenHeaderTitle.vue.d.ts +2 -0
- package/components/Screen/components/ScreenHeaderTitle.vue.js +28 -24
- package/components/Screen/components/ScreenQuickFilters.vue.js +1 -1
- package/components/Screen/types.d.ts +3 -0
- package/core/config.d.ts +2 -2
- package/core/config.js +7 -7
- package/core/index.js +3 -3
- package/index.d.ts +1 -1
- package/index.js +2 -2
- package/package.json +2 -2
- package/style.css +9 -10
- package/types/config.type.d.ts +1 -1
- package/components/Date/Date.vue.js +0 -21
- package/components/Date/Date.vue2.js +0 -4
- package/components/Date/index.d.ts +0 -1
- /package/components/{Date/Date.vue.d.ts → DateTime/DateTime.vue.d.ts} +0 -0
|
@@ -1,27 +1,32 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
import { defineComponent as H, computed as c, shallowRef as q, watch as G, openBlock as o, createElementBlock as n, createElementVNode as g, createBlock as J, withCtx as B, createTextVNode as K, toDisplayString as m, createCommentVNode as i, createVNode as b, Fragment as y, renderList as p, normalizeClass as x, unref as O, isMemoSame as P } from "vue";
|
|
2
|
+
import { VueDraggable as Q } from "vue-draggable-plus";
|
|
3
|
+
import W from "./FormField.vue.js";
|
|
4
|
+
import F from "../Button.vue.js";
|
|
5
|
+
import X from "../Label.vue.js";
|
|
6
|
+
import Y from "../Icon.vue.js";
|
|
7
|
+
import { $t as h } from "../../utils/i18n.js";
|
|
8
|
+
const Z = { class: "custom-fields-wrapper" }, ee = { class: "flex justify-between items-center mb-2" }, te = { class: "custom-fields-table border border-border rounded overflow-hidden bg-background" }, ae = {
|
|
7
9
|
key: 0,
|
|
8
10
|
class: "flex border-b border-border bg-muted/50 text-gray-800 text-xs font-semibold uppercase tracking-wider"
|
|
9
|
-
},
|
|
11
|
+
}, le = {
|
|
10
12
|
key: 0,
|
|
11
|
-
class: "w-10 flex-none p-3
|
|
12
|
-
},
|
|
13
|
+
class: "w-10 flex-none p-3 border-r border-border"
|
|
14
|
+
}, re = {
|
|
13
15
|
key: 1,
|
|
14
|
-
class: "w-10 flex-none p-3"
|
|
16
|
+
class: "w-10 flex-none p-3 text-center border-r border-border"
|
|
15
17
|
}, se = {
|
|
16
|
-
key:
|
|
17
|
-
class: "w-10 flex-none
|
|
18
|
-
},
|
|
18
|
+
key: 2,
|
|
19
|
+
class: "w-10 flex-none p-3"
|
|
20
|
+
}, oe = {
|
|
19
21
|
key: 1,
|
|
22
|
+
class: "w-10 flex-none flex items-center justify-center text-xs text-muted-foreground border-r border-border bg-muted/20"
|
|
23
|
+
}, ne = {
|
|
24
|
+
key: 2,
|
|
20
25
|
class: "w-10 flex-none flex items-center justify-center border-l border-border bg-muted/20"
|
|
21
|
-
},
|
|
26
|
+
}, de = {
|
|
22
27
|
key: 1,
|
|
23
28
|
class: "flex flex-col items-center justify-center py-6 text-center bg-muted/5"
|
|
24
|
-
},
|
|
29
|
+
}, ie = { class: "text-sm font-medium text-foreground" }, ue = { class: "text-xs text-muted-foreground mt-1" }, ye = /* @__PURE__ */ H({
|
|
25
30
|
__name: "CustomFields",
|
|
26
31
|
props: {
|
|
27
32
|
modelValue: { default: () => [] },
|
|
@@ -31,6 +36,7 @@ const W = { class: "custom-fields-wrapper" }, X = { class: "flex justify-between
|
|
|
31
36
|
size: { default: "md" },
|
|
32
37
|
rounded: { default: "md" },
|
|
33
38
|
disabled: { type: Boolean, default: !1 },
|
|
39
|
+
draggable: { type: Boolean, default: !1 },
|
|
34
40
|
minRows: { default: 0 },
|
|
35
41
|
maxRows: {},
|
|
36
42
|
addButtonText: { default: "Add Row" },
|
|
@@ -42,144 +48,160 @@ const W = { class: "custom-fields-wrapper" }, X = { class: "flex justify-between
|
|
|
42
48
|
isUpdate: { type: Boolean, default: !1 }
|
|
43
49
|
},
|
|
44
50
|
emits: ["update:modelValue", "change"],
|
|
45
|
-
setup(
|
|
46
|
-
const t =
|
|
47
|
-
const e =
|
|
51
|
+
setup(r, { emit: $ }) {
|
|
52
|
+
const t = r, R = $, k = c(() => t.labelI18n ? h(t.labelI18n) : t.label), D = c(() => {
|
|
53
|
+
const e = h("vlite.customFields.emptyTitle");
|
|
48
54
|
return e !== "vlite.customFields.emptyTitle" ? e : "No items added";
|
|
49
|
-
}),
|
|
50
|
-
const e =
|
|
55
|
+
}), U = c(() => {
|
|
56
|
+
const e = h("vlite.customFields.emptyDescription");
|
|
51
57
|
return e !== "vlite.customFields.emptyDescription" ? e : "Add a new item to get started";
|
|
52
|
-
}), l =
|
|
53
|
-
|
|
58
|
+
}), l = q([]), _ = () => `row_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
59
|
+
G(
|
|
54
60
|
() => t.modelValue,
|
|
55
61
|
(e) => {
|
|
56
|
-
Array.isArray(e) ? l.value = e.map((
|
|
57
|
-
const
|
|
62
|
+
Array.isArray(e) ? l.value = e.map((a, d) => {
|
|
63
|
+
const s = l.value[d];
|
|
58
64
|
return {
|
|
59
|
-
...
|
|
60
|
-
_id:
|
|
65
|
+
...a,
|
|
66
|
+
_id: s?._id || _()
|
|
61
67
|
};
|
|
62
68
|
}) : l.value = [];
|
|
63
69
|
},
|
|
64
70
|
{ immediate: !0, deep: !0 }
|
|
65
71
|
);
|
|
66
|
-
const
|
|
72
|
+
const j = () => {
|
|
67
73
|
const e = {};
|
|
68
|
-
for (const
|
|
69
|
-
const
|
|
70
|
-
e[
|
|
74
|
+
for (const a of t.schema) {
|
|
75
|
+
const d = typeof a.value == "function" ? a.value() : a.value;
|
|
76
|
+
e[a.name] = d ?? null;
|
|
71
77
|
}
|
|
72
|
-
return { ...e, _id:
|
|
73
|
-
},
|
|
78
|
+
return { ...e, _id: _() };
|
|
79
|
+
}, z = () => {
|
|
74
80
|
if (t.disabled || t.maxRows && l.value.length >= t.maxRows) return;
|
|
75
|
-
const e = [...l.value,
|
|
76
|
-
l.value = e,
|
|
77
|
-
},
|
|
81
|
+
const e = [...l.value, j()];
|
|
82
|
+
l.value = e, f(e);
|
|
83
|
+
}, A = (e) => {
|
|
78
84
|
if (t.disabled || l.value.length <= t.minRows) return;
|
|
79
|
-
const s = [...l.value];
|
|
80
|
-
s.splice(e, 1), l.value = s, h(s);
|
|
81
|
-
}, U = (e, s, r) => {
|
|
82
85
|
const a = [...l.value];
|
|
83
|
-
a
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
86
|
+
a.splice(e, 1), l.value = a, f(a);
|
|
87
|
+
}, E = (e, a, d) => {
|
|
88
|
+
const s = [...l.value];
|
|
89
|
+
s[e] = {
|
|
90
|
+
...s[e],
|
|
91
|
+
[a]: d.value
|
|
92
|
+
}, l.value = s, f(s);
|
|
93
|
+
}, T = (e) => {
|
|
94
|
+
l.value = e, f(e);
|
|
95
|
+
}, f = (e) => {
|
|
96
|
+
const a = e.map(({ _id: d, ...s }) => s);
|
|
97
|
+
R("update:modelValue", a), R("change", a);
|
|
98
|
+
}, S = (e, a) => l.value[e]?.[a], I = c(() => !(t.disabled || t.maxRows && l.value.length >= t.maxRows)), w = c(() => t.disabled ? !1 : l.value.length > t.minRows), C = c(() => t.headers && t.headers.length > 0 ? t.headers : t.schema.map((e) => e.labelI18n ? h(e.labelI18n) : e.label || e.name));
|
|
99
|
+
return (e, a) => (o(), n("div", Z, [
|
|
100
|
+
g("div", ee, [
|
|
101
|
+
k.value ? (o(), J(X, {
|
|
94
102
|
key: 0,
|
|
95
103
|
class: "text-sm font-medium text-foreground"
|
|
96
104
|
}, {
|
|
97
|
-
default:
|
|
98
|
-
|
|
105
|
+
default: B(() => [
|
|
106
|
+
K(m(k.value), 1)
|
|
99
107
|
]),
|
|
100
108
|
_: 1
|
|
101
|
-
})) :
|
|
102
|
-
|
|
109
|
+
})) : i("", !0),
|
|
110
|
+
b(F, {
|
|
103
111
|
type: "button",
|
|
104
112
|
variant: "outline",
|
|
105
113
|
size: "xs",
|
|
106
114
|
rounded: "full",
|
|
107
115
|
icon: "lucide:plus",
|
|
108
|
-
disabled: !
|
|
109
|
-
onClick:
|
|
116
|
+
disabled: !I.value,
|
|
117
|
+
onClick: z
|
|
110
118
|
}, null, 8, ["disabled"])
|
|
111
119
|
]),
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
(o(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
g("div", te, [
|
|
121
|
+
C.value.length > 0 ? (o(), n("div", ae, [
|
|
122
|
+
r.draggable ? (o(), n("div", le)) : i("", !0),
|
|
123
|
+
r.showRowNumbers ? (o(), n("div", re, " # ")) : i("", !0),
|
|
124
|
+
(o(!0), n(y, null, p(C.value, (d, s) => (o(), n("div", {
|
|
125
|
+
key: s,
|
|
126
|
+
class: x(["flex-1 p-3 min-w-0 truncate", { "border-l border-border": s > 0 }])
|
|
127
|
+
}, m(d), 3))), 128)),
|
|
128
|
+
w.value ? (o(), n("div", se)) : i("", !0)
|
|
129
|
+
])) : i("", !0),
|
|
130
|
+
b(O(Q), {
|
|
131
|
+
"model-value": l.value,
|
|
132
|
+
"onUpdate:modelValue": T,
|
|
133
|
+
disabled: !r.draggable || r.disabled,
|
|
134
|
+
animation: 150,
|
|
135
|
+
handle: ".drag-handle",
|
|
136
|
+
"ghost-class": "opacity-50",
|
|
124
137
|
class: "divide-y divide-border"
|
|
125
138
|
}, {
|
|
126
|
-
default:
|
|
127
|
-
(o(!0), n(
|
|
128
|
-
const
|
|
129
|
-
if (
|
|
130
|
-
const
|
|
131
|
-
key:
|
|
139
|
+
default: B(() => [
|
|
140
|
+
(o(!0), n(y, null, p(l.value, (d, s, ce, v) => {
|
|
141
|
+
const V = [d, r.disabled, r.isUpdate, r.showRowNumbers, w.value, r.draggable, s];
|
|
142
|
+
if (v && v.key === d._id && P(v, V)) return v;
|
|
143
|
+
const N = (o(), n("div", {
|
|
144
|
+
key: d._id,
|
|
132
145
|
class: "flex group bg-white transition-colors"
|
|
133
146
|
}, [
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
147
|
+
r.draggable ? (o(), n("div", {
|
|
148
|
+
key: 0,
|
|
149
|
+
class: x(["w-10 flex-none flex items-center justify-center border-r border-border bg-muted/5 drag-handle transition-colors", r.disabled ? "cursor-not-allowed opacity-50" : "cursor-grab active:cursor-grabbing hover:bg-muted/10 text-muted-foreground hover:text-foreground"])
|
|
150
|
+
}, [
|
|
151
|
+
b(Y, {
|
|
152
|
+
icon: "lucide:grip-vertical",
|
|
153
|
+
class: "w-4 h-4"
|
|
154
|
+
})
|
|
155
|
+
], 2)) : i("", !0),
|
|
156
|
+
r.showRowNumbers ? (o(), n("div", oe, m(s + 1), 1)) : i("", !0),
|
|
157
|
+
(o(!0), n(y, null, p(r.schema, (u, L) => (o(), n("div", {
|
|
158
|
+
key: u.name,
|
|
159
|
+
class: x(["flex-1 min-w-0 relative", { "border-l border-border": L > 0 }])
|
|
138
160
|
}, [
|
|
139
|
-
|
|
161
|
+
b(W, {
|
|
140
162
|
field: {
|
|
141
|
-
...
|
|
163
|
+
...u,
|
|
142
164
|
props: {
|
|
143
|
-
...
|
|
144
|
-
...
|
|
165
|
+
...u.type === "multiSelect" ? { showControls: !1, wrap: !1 } : {},
|
|
166
|
+
...u.props || {}
|
|
145
167
|
},
|
|
146
168
|
label: void 0
|
|
147
169
|
},
|
|
148
|
-
value:
|
|
149
|
-
values:
|
|
170
|
+
value: S(s, u.name),
|
|
171
|
+
values: r.values || {},
|
|
150
172
|
variant: "transparent",
|
|
151
173
|
size: "sm",
|
|
152
174
|
rounded: "none",
|
|
153
|
-
disabled:
|
|
154
|
-
isUpdate:
|
|
175
|
+
disabled: r.disabled,
|
|
176
|
+
isUpdate: r.isUpdate,
|
|
155
177
|
class: "w-full h-full min-h-[40px]",
|
|
156
|
-
onChange: (
|
|
178
|
+
onChange: (M) => E(s, u.name, M)
|
|
157
179
|
}, null, 8, ["field", "value", "values", "disabled", "isUpdate", "onChange"])
|
|
158
180
|
], 2))), 128)),
|
|
159
|
-
w.value ? (o(), n("div",
|
|
160
|
-
|
|
181
|
+
w.value ? (o(), n("div", ne, [
|
|
182
|
+
b(F, {
|
|
161
183
|
type: "button",
|
|
162
184
|
variant: "ghost",
|
|
163
185
|
size: "xs",
|
|
164
186
|
icon: "lucide:trash-2",
|
|
165
|
-
disabled:
|
|
166
|
-
onClick: (
|
|
187
|
+
disabled: r.disabled,
|
|
188
|
+
onClick: (u) => A(s)
|
|
167
189
|
}, null, 8, ["disabled", "onClick"])
|
|
168
|
-
])) :
|
|
190
|
+
])) : i("", !0)
|
|
169
191
|
]));
|
|
170
|
-
return
|
|
171
|
-
},
|
|
192
|
+
return N.memo = V, N;
|
|
193
|
+
}, a, 0), 128))
|
|
172
194
|
]),
|
|
173
195
|
_: 1
|
|
174
|
-
}),
|
|
175
|
-
l.value.length === 0 ? (o(), n("div",
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
])) :
|
|
196
|
+
}, 8, ["model-value", "disabled"]),
|
|
197
|
+
l.value.length === 0 ? (o(), n("div", de, [
|
|
198
|
+
g("p", ie, m(D.value), 1),
|
|
199
|
+
g("p", ue, m(U.value), 1)
|
|
200
|
+
])) : i("", !0)
|
|
179
201
|
])
|
|
180
202
|
]));
|
|
181
203
|
}
|
|
182
204
|
});
|
|
183
205
|
export {
|
|
184
|
-
|
|
206
|
+
ye as default
|
|
185
207
|
};
|
|
@@ -189,7 +189,8 @@ const pe = /* @__PURE__ */ I({
|
|
|
189
189
|
size: e.size,
|
|
190
190
|
rounded: e.rounded,
|
|
191
191
|
maxSize: e.field.maxFileSize ? e.field.maxFileSize * 1024 * 1024 : void 0,
|
|
192
|
-
loading: e.loading
|
|
192
|
+
loading: e.loading,
|
|
193
|
+
allowRename: e.field.props?.allowRename ?? !0
|
|
193
194
|
} : a === "avatarUpload" ? {
|
|
194
195
|
size: "2xl",
|
|
195
196
|
...l,
|
|
@@ -210,6 +211,7 @@ const pe = /* @__PURE__ */ I({
|
|
|
210
211
|
modelValue: Array.isArray(e.value) ? e.value : [],
|
|
211
212
|
schema: e.field.props?.schema || [],
|
|
212
213
|
headers: e.field.props?.headers || [],
|
|
214
|
+
draggable: e.field.props?.draggable || !1,
|
|
213
215
|
values: e.values,
|
|
214
216
|
variant: e.variant,
|
|
215
217
|
size: e.size,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as V, ref as D, computed as f, openBlock as l, createElementBlock as a, normalizeClass as s, createElementVNode as v, createBlock as u, createCommentVNode as T, toDisplayString as w, renderSlot as C, resolveDynamicComponent as B, Fragment as m, createVNode as S } from "vue";
|
|
2
2
|
import x from "../Icon.vue.js";
|
|
3
3
|
import b from "../Price/Price.vue.js";
|
|
4
|
-
import h from "../
|
|
4
|
+
import h from "../DateTime/DateTime.vue.js";
|
|
5
5
|
import { $t as I } from "../../utils/i18n.js";
|
|
6
6
|
import { getObjectValue as N, formatNumber as Y, getStatusColorClass as F } from "./utils.js";
|
|
7
7
|
const A = { class: "flex items-center gap-2 min-w-0" }, E = { class: "text-xs font-normal text-muted-foreground leading-snug truncate" }, O = { class: "min-w-0" }, z = {
|
|
@@ -3,7 +3,7 @@ import L from "./Icon.vue.js";
|
|
|
3
3
|
import v from "./Modal.vue.js";
|
|
4
4
|
import N from "./CommandPalette/CommandPaletteContent.vue.js";
|
|
5
5
|
import { $t as R } from "../utils/i18n.js";
|
|
6
|
-
/* empty css
|
|
6
|
+
/* empty css */
|
|
7
7
|
const U = { class: "block truncate -text-fs-1.5" }, V = { class: "ml-auto inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] font-mono font-medium border border-border/80 bg-background text-muted-foreground ml-1" }, q = /* @__PURE__ */ x({
|
|
8
8
|
__name: "NavbarCommandPalette",
|
|
9
9
|
props: {
|
|
@@ -139,6 +139,7 @@ declare const __VLS_component: import('vue').DefineComponent<ScreenProps, {}, {}
|
|
|
139
139
|
showRefresh: boolean;
|
|
140
140
|
viewProps: Record<string, any>;
|
|
141
141
|
hideSelectable: boolean;
|
|
142
|
+
hideDeleteBtn: boolean;
|
|
142
143
|
quickFilters: import('./types').ScreenQuickFilter[];
|
|
143
144
|
quickFilterKey: string;
|
|
144
145
|
quickFilterVariant: import('../Tabes').TabesVariant;
|