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