vft 0.0.295 → 0.0.296
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/es/components/button/index.d.ts +9 -9
- package/es/components/dropdown/dropdown.vue.d.ts +1 -1
- package/es/components/modal/index.d.ts +15 -15
- package/es/components/modal/modal.vue.d.ts +1 -1
- package/es/components/super-form/use/use-form-events.js +15 -14
- package/es/components/super-form/use/use-form-values.js +7 -6
- package/es/components/table/field.d.ts +4 -4
- package/es/components/table/field.js +41 -40
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/lib/components/button/index.d.ts +9 -9
- package/lib/components/dropdown/dropdown.vue.d.ts +1 -1
- package/lib/components/modal/index.d.ts +15 -15
- package/lib/components/modal/modal.vue.d.ts +1 -1
- package/lib/components/super-form/use/use-form-events.cjs +1 -1
- package/lib/components/super-form/use/use-form-values.cjs +1 -1
- package/lib/components/table/field.cjs +1 -1
- package/lib/components/table/field.d.ts +4 -4
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +6 -6
- package/web-types.json +1 -1
|
@@ -30,9 +30,6 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
|
|
|
30
30
|
dark: {
|
|
31
31
|
type: import("vue").PropType<boolean>;
|
|
32
32
|
};
|
|
33
|
-
bg: {
|
|
34
|
-
type: import("vue").PropType<boolean>;
|
|
35
|
-
};
|
|
36
33
|
loading: {
|
|
37
34
|
type: import("vue").PropType<boolean>;
|
|
38
35
|
};
|
|
@@ -56,6 +53,9 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
|
|
|
56
53
|
loadingIcon: {
|
|
57
54
|
type: import("vue").PropType<import("vft/es/vft").IconProps>;
|
|
58
55
|
};
|
|
56
|
+
bg: {
|
|
57
|
+
type: import("vue").PropType<boolean>;
|
|
58
|
+
};
|
|
59
59
|
autoInsertSpace: {
|
|
60
60
|
type: import("vue").PropType<boolean>;
|
|
61
61
|
};
|
|
@@ -120,9 +120,6 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
|
|
|
120
120
|
dark: {
|
|
121
121
|
type: import("vue").PropType<boolean>;
|
|
122
122
|
};
|
|
123
|
-
bg: {
|
|
124
|
-
type: import("vue").PropType<boolean>;
|
|
125
|
-
};
|
|
126
123
|
loading: {
|
|
127
124
|
type: import("vue").PropType<boolean>;
|
|
128
125
|
};
|
|
@@ -146,6 +143,9 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
|
|
|
146
143
|
loadingIcon: {
|
|
147
144
|
type: import("vue").PropType<import("vft/es/vft").IconProps>;
|
|
148
145
|
};
|
|
146
|
+
bg: {
|
|
147
|
+
type: import("vue").PropType<boolean>;
|
|
148
|
+
};
|
|
149
149
|
autoInsertSpace: {
|
|
150
150
|
type: import("vue").PropType<boolean>;
|
|
151
151
|
};
|
|
@@ -205,9 +205,6 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
|
|
|
205
205
|
dark: {
|
|
206
206
|
type: import("vue").PropType<boolean>;
|
|
207
207
|
};
|
|
208
|
-
bg: {
|
|
209
|
-
type: import("vue").PropType<boolean>;
|
|
210
|
-
};
|
|
211
208
|
loading: {
|
|
212
209
|
type: import("vue").PropType<boolean>;
|
|
213
210
|
};
|
|
@@ -231,6 +228,9 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
|
|
|
231
228
|
loadingIcon: {
|
|
232
229
|
type: import("vue").PropType<import("vft/es/vft").IconProps>;
|
|
233
230
|
};
|
|
231
|
+
bg: {
|
|
232
|
+
type: import("vue").PropType<boolean>;
|
|
233
|
+
};
|
|
234
234
|
autoInsertSpace: {
|
|
235
235
|
type: import("vue").PropType<boolean>;
|
|
236
236
|
};
|
|
@@ -53,8 +53,8 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
53
53
|
effect: "light" | "dark";
|
|
54
54
|
tabindex: number | string;
|
|
55
55
|
trigger: import("vft/es/components/tooltip").TooltipTriggerType;
|
|
56
|
-
loop: boolean;
|
|
57
56
|
teleported: boolean;
|
|
57
|
+
loop: boolean;
|
|
58
58
|
popperClass: string;
|
|
59
59
|
showTimeout: number;
|
|
60
60
|
hideTimeout: number;
|
|
@@ -30,10 +30,6 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
30
30
|
type: import("vue").PropType<boolean>;
|
|
31
31
|
default: boolean;
|
|
32
32
|
};
|
|
33
|
-
trapFocus: {
|
|
34
|
-
type: import("vue").PropType<boolean>;
|
|
35
|
-
default: boolean;
|
|
36
|
-
};
|
|
37
33
|
closeOnPressEscape: {
|
|
38
34
|
type: import("vue").PropType<boolean>;
|
|
39
35
|
default: boolean;
|
|
@@ -90,6 +86,10 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
90
86
|
modalClass: {
|
|
91
87
|
type: import("vue").PropType<string>;
|
|
92
88
|
};
|
|
89
|
+
trapFocus: {
|
|
90
|
+
type: import("vue").PropType<boolean>;
|
|
91
|
+
default: boolean;
|
|
92
|
+
};
|
|
93
93
|
showSubmitButton: {
|
|
94
94
|
type: import("vue").PropType<boolean>;
|
|
95
95
|
default: boolean;
|
|
@@ -119,7 +119,6 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
119
119
|
fullscreen: boolean;
|
|
120
120
|
draggable: boolean;
|
|
121
121
|
modelValue: boolean;
|
|
122
|
-
trapFocus: boolean;
|
|
123
122
|
closeOnPressEscape: boolean;
|
|
124
123
|
showClose: boolean;
|
|
125
124
|
customClass: string;
|
|
@@ -131,6 +130,7 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
131
130
|
modal: boolean;
|
|
132
131
|
openDelay: number;
|
|
133
132
|
closeDelay: number;
|
|
133
|
+
trapFocus: boolean;
|
|
134
134
|
showSubmitButton: boolean;
|
|
135
135
|
showActionButtonGroup: boolean;
|
|
136
136
|
showCancelButton: boolean;
|
|
@@ -171,10 +171,6 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
171
171
|
type: import("vue").PropType<boolean>;
|
|
172
172
|
default: boolean;
|
|
173
173
|
};
|
|
174
|
-
trapFocus: {
|
|
175
|
-
type: import("vue").PropType<boolean>;
|
|
176
|
-
default: boolean;
|
|
177
|
-
};
|
|
178
174
|
closeOnPressEscape: {
|
|
179
175
|
type: import("vue").PropType<boolean>;
|
|
180
176
|
default: boolean;
|
|
@@ -231,6 +227,10 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
231
227
|
modalClass: {
|
|
232
228
|
type: import("vue").PropType<string>;
|
|
233
229
|
};
|
|
230
|
+
trapFocus: {
|
|
231
|
+
type: import("vue").PropType<boolean>;
|
|
232
|
+
default: boolean;
|
|
233
|
+
};
|
|
234
234
|
showSubmitButton: {
|
|
235
235
|
type: import("vue").PropType<boolean>;
|
|
236
236
|
default: boolean;
|
|
@@ -260,7 +260,6 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
260
260
|
fullscreen: boolean;
|
|
261
261
|
draggable: boolean;
|
|
262
262
|
modelValue: boolean;
|
|
263
|
-
trapFocus: boolean;
|
|
264
263
|
closeOnPressEscape: boolean;
|
|
265
264
|
showClose: boolean;
|
|
266
265
|
customClass: string;
|
|
@@ -272,6 +271,7 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
272
271
|
modal: boolean;
|
|
273
272
|
openDelay: number;
|
|
274
273
|
closeDelay: number;
|
|
274
|
+
trapFocus: boolean;
|
|
275
275
|
showSubmitButton: boolean;
|
|
276
276
|
showActionButtonGroup: boolean;
|
|
277
277
|
showCancelButton: boolean;
|
|
@@ -309,10 +309,6 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
309
309
|
type: import("vue").PropType<boolean>;
|
|
310
310
|
default: boolean;
|
|
311
311
|
};
|
|
312
|
-
trapFocus: {
|
|
313
|
-
type: import("vue").PropType<boolean>;
|
|
314
|
-
default: boolean;
|
|
315
|
-
};
|
|
316
312
|
closeOnPressEscape: {
|
|
317
313
|
type: import("vue").PropType<boolean>;
|
|
318
314
|
default: boolean;
|
|
@@ -369,6 +365,10 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
369
365
|
modalClass: {
|
|
370
366
|
type: import("vue").PropType<string>;
|
|
371
367
|
};
|
|
368
|
+
trapFocus: {
|
|
369
|
+
type: import("vue").PropType<boolean>;
|
|
370
|
+
default: boolean;
|
|
371
|
+
};
|
|
372
372
|
showSubmitButton: {
|
|
373
373
|
type: import("vue").PropType<boolean>;
|
|
374
374
|
default: boolean;
|
|
@@ -398,7 +398,6 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
398
398
|
fullscreen: boolean;
|
|
399
399
|
draggable: boolean;
|
|
400
400
|
modelValue: boolean;
|
|
401
|
-
trapFocus: boolean;
|
|
402
401
|
closeOnPressEscape: boolean;
|
|
403
402
|
showClose: boolean;
|
|
404
403
|
customClass: string;
|
|
@@ -410,6 +409,7 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
410
409
|
modal: boolean;
|
|
411
410
|
openDelay: number;
|
|
412
411
|
closeDelay: number;
|
|
412
|
+
trapFocus: boolean;
|
|
413
413
|
showSubmitButton: boolean;
|
|
414
414
|
showActionButtonGroup: boolean;
|
|
415
415
|
showCancelButton: boolean;
|
|
@@ -57,7 +57,6 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
57
57
|
fullscreen: boolean;
|
|
58
58
|
draggable: boolean;
|
|
59
59
|
modelValue: boolean;
|
|
60
|
-
trapFocus: boolean;
|
|
61
60
|
closeOnPressEscape: boolean;
|
|
62
61
|
showClose: boolean;
|
|
63
62
|
customClass: string;
|
|
@@ -69,6 +68,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
69
68
|
modal: boolean;
|
|
70
69
|
openDelay: number;
|
|
71
70
|
closeDelay: number;
|
|
71
|
+
trapFocus: boolean;
|
|
72
72
|
showSubmitButton: boolean;
|
|
73
73
|
showActionButtonGroup: boolean;
|
|
74
74
|
showCancelButton: boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isDef as U, isFunction as j, isString as A, isObject as w, isArray as V, deepMerge as tt, findDifferentValuesForObj as et, isNullOrUndefined as z, isEmpty as nt, isEmptyObject as it } from "@vft/utils";
|
|
2
|
+
import { formatToDate as G } from "@vft/utils/date";
|
|
2
3
|
import { get as rt, cloneDeep as I, uniqBy as st, isEqual as ct, set as J } from "lodash-es";
|
|
3
4
|
import { unref as r, toRaw as B, nextTick as H } from "vue";
|
|
4
5
|
import { isInput as at, FormCompEnum as x, isDatePicker as ot } from "../component-map.js";
|
|
@@ -33,7 +34,7 @@ function ft(p, v = {}) {
|
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
+
function Dt({
|
|
37
38
|
emit: p,
|
|
38
39
|
getProps: v,
|
|
39
40
|
formModel: a,
|
|
@@ -75,21 +76,21 @@ function Ft({
|
|
|
75
76
|
if (R(e))
|
|
76
77
|
if (Array.isArray(f)) {
|
|
77
78
|
const F = [];
|
|
78
|
-
for (const
|
|
79
|
-
F.push(
|
|
79
|
+
for (const m of f)
|
|
80
|
+
F.push(m ? G(m) : null);
|
|
80
81
|
r(a)[e] = F;
|
|
81
82
|
} else
|
|
82
|
-
r(a)[e] = f ? D?.valueFormat ? f :
|
|
83
|
+
r(a)[e] = f ? D?.valueFormat ? f : G(f) : null;
|
|
83
84
|
else
|
|
84
85
|
r(a)[e] = f;
|
|
85
86
|
D?.onChange && D?.onChange(f), s.push(e);
|
|
86
87
|
} else
|
|
87
88
|
i.forEach((f) => {
|
|
88
89
|
try {
|
|
89
|
-
const F = f.split(".").reduce((
|
|
90
|
-
|
|
90
|
+
const F = f.split(".").reduce((m, M) => m[M], t);
|
|
91
|
+
U(F) && (r(a)[f] = r(F), s.push(f));
|
|
91
92
|
} catch {
|
|
92
|
-
|
|
93
|
+
U(y.value[f]) && (r(a)[f] = I(
|
|
93
94
|
r(y.value[f])
|
|
94
95
|
));
|
|
95
96
|
}
|
|
@@ -116,7 +117,7 @@ function Ft({
|
|
|
116
117
|
}
|
|
117
118
|
}
|
|
118
119
|
async function X(t, n, c = !1) {
|
|
119
|
-
const i = I(r(d)), s = i.findIndex((o) => o.field === n), e =
|
|
120
|
+
const i = I(r(d)), s = i.findIndex((o) => o.field === n), e = w(t) ? [t] : t;
|
|
120
121
|
if (!n || s === -1 || c) {
|
|
121
122
|
c ? i.unshift(...e) : i.push(...e), h.value = i, g(t);
|
|
122
123
|
return;
|
|
@@ -125,7 +126,7 @@ function Ft({
|
|
|
125
126
|
}
|
|
126
127
|
async function Y(t) {
|
|
127
128
|
let n = [];
|
|
128
|
-
if (
|
|
129
|
+
if (w(t) && n.push(t), V(t) && (n = [...t]), !n.every(
|
|
129
130
|
(i) => i.type === x.DIVIDER || Reflect.has(i, "field") && i.field
|
|
130
131
|
)) {
|
|
131
132
|
console.error(
|
|
@@ -137,7 +138,7 @@ function Ft({
|
|
|
137
138
|
}
|
|
138
139
|
async function Z(t) {
|
|
139
140
|
let n = [];
|
|
140
|
-
if (
|
|
141
|
+
if (w(t) && n.push(t), V(t) && (n = [...t]), !n.every(
|
|
141
142
|
(e) => e.type === x.DIVIDER || Reflect.has(e, "field") && e.field
|
|
142
143
|
)) {
|
|
143
144
|
console.error(
|
|
@@ -161,10 +162,10 @@ function Ft({
|
|
|
161
162
|
if (V(n) && n?.length === 0)
|
|
162
163
|
return;
|
|
163
164
|
let c = [];
|
|
164
|
-
|
|
165
|
+
w(t) && c.push(t), V(t) && (c = [...t]);
|
|
165
166
|
const i = {}, s = T();
|
|
166
167
|
c.forEach((e) => {
|
|
167
|
-
e.type !== x.DIVIDER && Reflect.has(e, "field") && e.field && !
|
|
168
|
+
e.type !== x.DIVIDER && Reflect.has(e, "field") && e.field && !z(e.defaultValue) && (!(e.field in s) || z(s[e.field]) || nt(s[e.field])) && (i[e.field] = e.defaultValue);
|
|
168
169
|
}), it(i) || _(i);
|
|
169
170
|
}
|
|
170
171
|
function T() {
|
|
@@ -227,5 +228,5 @@ function Ft({
|
|
|
227
228
|
};
|
|
228
229
|
}
|
|
229
230
|
export {
|
|
230
|
-
|
|
231
|
+
Dt as useFormEvents
|
|
231
232
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { isNullOrUndefined as F, isObject as
|
|
1
|
+
import { isNullOrUndefined as F, isObject as l, isArray as b, isFunction as j, isString as O } from "@vft/utils";
|
|
2
|
+
import { formatToDate as p } from "@vft/utils/date";
|
|
2
3
|
import { cloneDeep as V, set as y } from "lodash-es";
|
|
3
4
|
import { unref as Y } from "vue";
|
|
4
5
|
function g(c, i, m) {
|
|
@@ -19,20 +20,20 @@ function E(c, i, m) {
|
|
|
19
20
|
const o = c.match(f);
|
|
20
21
|
if (o && o[1]) {
|
|
21
22
|
const u = o[1].split(",");
|
|
22
|
-
return i =
|
|
23
|
+
return i = l(i) ? i : {}, u.forEach((a) => {
|
|
23
24
|
y(m, a.trim(), i[a.trim()]);
|
|
24
25
|
}), !0;
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
+
function $({
|
|
29
30
|
defaultValueRef: c,
|
|
30
31
|
getSchema: i,
|
|
31
32
|
formModel: m,
|
|
32
33
|
getProps: f
|
|
33
34
|
}) {
|
|
34
35
|
function o(r) {
|
|
35
|
-
if (!
|
|
36
|
+
if (!l(r))
|
|
36
37
|
return {};
|
|
37
38
|
const n = {};
|
|
38
39
|
for (const e of Object.entries(r)) {
|
|
@@ -58,7 +59,7 @@ function P({
|
|
|
58
59
|
continue;
|
|
59
60
|
}
|
|
60
61
|
const [T, h] = r[e], [A, D] = Array.isArray(d) ? d : [d, d];
|
|
61
|
-
r[t] =
|
|
62
|
+
r[t] = p(T, A), r[s] = p(h, D), Reflect.deleteProperty(r, e);
|
|
62
63
|
}
|
|
63
64
|
return r;
|
|
64
65
|
}
|
|
@@ -72,5 +73,5 @@ function P({
|
|
|
72
73
|
return { handleFormValues: o, initDefault: a };
|
|
73
74
|
}
|
|
74
75
|
export {
|
|
75
|
-
|
|
76
|
+
$ as useFormValues
|
|
76
77
|
};
|
|
@@ -13,7 +13,7 @@ export declare const DATE_FIELD: ({ format, field, title, }?: {
|
|
|
13
13
|
title: string;
|
|
14
14
|
formatter: ({ row }: {
|
|
15
15
|
row: any;
|
|
16
|
-
}) =>
|
|
16
|
+
}) => any;
|
|
17
17
|
};
|
|
18
18
|
export declare const DATE_TIME_FIELD: ({ format, field, title, }?: {
|
|
19
19
|
format?: string | undefined;
|
|
@@ -25,7 +25,7 @@ export declare const DATE_TIME_FIELD: ({ format, field, title, }?: {
|
|
|
25
25
|
title: string;
|
|
26
26
|
formatter: ({ row }: {
|
|
27
27
|
row: any;
|
|
28
|
-
}) =>
|
|
28
|
+
}) => any;
|
|
29
29
|
};
|
|
30
30
|
export declare const CREATE_TIME_FIELD: ({ format, field, title, }?: {
|
|
31
31
|
format?: string | undefined;
|
|
@@ -37,7 +37,7 @@ export declare const CREATE_TIME_FIELD: ({ format, field, title, }?: {
|
|
|
37
37
|
title: string;
|
|
38
38
|
formatter: ({ row }: {
|
|
39
39
|
row: any;
|
|
40
|
-
}) =>
|
|
40
|
+
}) => any;
|
|
41
41
|
};
|
|
42
42
|
export declare const UPDATE_TIME_FIELD: ({ format, field, title, }?: {
|
|
43
43
|
format?: string | undefined;
|
|
@@ -49,7 +49,7 @@ export declare const UPDATE_TIME_FIELD: ({ format, field, title, }?: {
|
|
|
49
49
|
title: string;
|
|
50
50
|
formatter: ({ row }: {
|
|
51
51
|
row: any;
|
|
52
|
-
}) =>
|
|
52
|
+
}) => any;
|
|
53
53
|
};
|
|
54
54
|
export declare const STATUS_FIELD: ({ field, title, normalText, disabledText, strToNumber, }?: {
|
|
55
55
|
field?: string | undefined;
|
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
import { createVNode as r, ref as I, Fragment as Y, isVNode as _ } from "vue";
|
|
2
|
-
import { formatToDateTime as D
|
|
2
|
+
import { formatToDateTime as D } from "@vft/utils/date";
|
|
3
|
+
import { isNullOrUndefined as h } from "@vft/utils";
|
|
3
4
|
import { VftButton as c } from "../button/index.js";
|
|
4
5
|
import { VftPopconfirm as M } from "../popconfirm/index.js";
|
|
5
6
|
import { VftTag as d } from "../tag/index.js";
|
|
6
|
-
function
|
|
7
|
+
function m(t) {
|
|
7
8
|
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !_(t);
|
|
8
9
|
}
|
|
9
|
-
const
|
|
10
|
+
const H = {
|
|
10
11
|
type: "seq",
|
|
11
12
|
title: "序号",
|
|
12
13
|
fixed: "left",
|
|
13
14
|
width: 53
|
|
14
|
-
},
|
|
15
|
+
}, T = {
|
|
15
16
|
type: "checkbox",
|
|
16
17
|
title: "",
|
|
17
18
|
minWidth: 60,
|
|
18
19
|
fixed: "left"
|
|
19
|
-
},
|
|
20
|
+
}, W = {
|
|
20
21
|
field: "id",
|
|
21
22
|
title: "Id",
|
|
22
23
|
minWidth: 100
|
|
23
|
-
},
|
|
24
|
+
}, N = {
|
|
24
25
|
field: "name",
|
|
25
26
|
title: "名称",
|
|
26
27
|
minWidth: 100
|
|
27
|
-
},
|
|
28
|
+
}, V = ({
|
|
28
29
|
format: t = "YYYY-MM-DD",
|
|
29
30
|
field: e = "date",
|
|
30
31
|
title: i = "时间"
|
|
@@ -35,7 +36,7 @@ const A = {
|
|
|
35
36
|
formatter: ({
|
|
36
37
|
row: n
|
|
37
38
|
}) => n[e] ? D(n[e], t) : "-"
|
|
38
|
-
}),
|
|
39
|
+
}), p = ({
|
|
39
40
|
format: t = "YYYY-MM-DD HH:mm:ss",
|
|
40
41
|
field: e = "date",
|
|
41
42
|
title: i = "时间"
|
|
@@ -46,23 +47,23 @@ const A = {
|
|
|
46
47
|
formatter: ({
|
|
47
48
|
row: n
|
|
48
49
|
}) => n[e] ? D(n[e], t) : "-"
|
|
49
|
-
}),
|
|
50
|
+
}), S = ({
|
|
50
51
|
format: t = "YYYY-MM-DD HH:mm:ss",
|
|
51
52
|
field: e = "createTime",
|
|
52
53
|
title: i = "创建时间"
|
|
53
|
-
} = {}) =>
|
|
54
|
+
} = {}) => p({
|
|
54
55
|
format: t,
|
|
55
56
|
field: e,
|
|
56
57
|
title: i
|
|
57
|
-
}),
|
|
58
|
+
}), k = ({
|
|
58
59
|
format: t = "YYYY-MM-DD HH:mm:ss",
|
|
59
60
|
field: e = "updateTime",
|
|
60
61
|
title: i = "更新时间"
|
|
61
|
-
} = {}) =>
|
|
62
|
+
} = {}) => p({
|
|
62
63
|
format: t,
|
|
63
64
|
field: e,
|
|
64
65
|
title: i
|
|
65
|
-
}),
|
|
66
|
+
}), O = ({
|
|
66
67
|
field: t = "status",
|
|
67
68
|
title: e = "状态",
|
|
68
69
|
normalText: i = "正常",
|
|
@@ -74,25 +75,25 @@ const A = {
|
|
|
74
75
|
minWidth: 100,
|
|
75
76
|
slots: {
|
|
76
77
|
default: ({
|
|
77
|
-
row:
|
|
78
|
+
row: a
|
|
78
79
|
}) => {
|
|
79
|
-
let o =
|
|
80
|
-
return h(o) ? "-" : (l && Number(o) === 0 && (o = !1), o ? r(d, null,
|
|
80
|
+
let o = a?.[t];
|
|
81
|
+
return h(o) ? "-" : (l && Number(o) === 0 && (o = !1), o ? r(d, null, m(i) ? i : {
|
|
81
82
|
default: () => [i]
|
|
82
83
|
}) : r(d, {
|
|
83
84
|
type: "danger"
|
|
84
|
-
},
|
|
85
|
+
}, m(n) ? n : {
|
|
85
86
|
default: () => [n]
|
|
86
87
|
}));
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
|
-
}),
|
|
90
|
+
}), P = ({
|
|
90
91
|
confirmText: t = "确认删除?",
|
|
91
92
|
leftCallback: e,
|
|
92
93
|
rightCallback: i,
|
|
93
94
|
leftText: n = "编辑",
|
|
94
95
|
rightText: l = "删除",
|
|
95
|
-
showLeft:
|
|
96
|
+
showLeft: a = !0,
|
|
96
97
|
showRight: o = !0
|
|
97
98
|
} = {}) => ({
|
|
98
99
|
title: "操作栏",
|
|
@@ -100,34 +101,34 @@ const A = {
|
|
|
100
101
|
fixed: "right",
|
|
101
102
|
slots: {
|
|
102
103
|
default: ({
|
|
103
|
-
row:
|
|
104
|
+
row: u
|
|
104
105
|
}) => {
|
|
105
|
-
const s = I(!1),
|
|
106
|
-
s.value = !0, i?.(
|
|
106
|
+
const s = I(!1), E = () => {
|
|
107
|
+
s.value = !0, i?.(u)?.finally(() => {
|
|
107
108
|
s.value = !1;
|
|
108
109
|
});
|
|
109
110
|
};
|
|
110
|
-
return r(Y, null, [
|
|
111
|
+
return r(Y, null, [a ? r(c, {
|
|
111
112
|
size: "small",
|
|
112
113
|
type: "primary",
|
|
113
|
-
onClick: (
|
|
114
|
-
|
|
114
|
+
onClick: (f) => {
|
|
115
|
+
f.stopPropagation(), e?.(u);
|
|
115
116
|
}
|
|
116
|
-
},
|
|
117
|
+
}, m(n) ? n : {
|
|
117
118
|
default: () => [n]
|
|
118
119
|
}) : null, o ? r(M, {
|
|
119
120
|
width: "150",
|
|
120
|
-
onConfirm:
|
|
121
|
+
onConfirm: E,
|
|
121
122
|
title: t
|
|
122
123
|
}, {
|
|
123
124
|
reference: () => r(c, {
|
|
124
125
|
loading: s.value,
|
|
125
126
|
size: "small",
|
|
126
127
|
type: "danger",
|
|
127
|
-
onClick: (
|
|
128
|
-
|
|
128
|
+
onClick: (f) => {
|
|
129
|
+
f.stopPropagation();
|
|
129
130
|
}
|
|
130
|
-
},
|
|
131
|
+
}, m(l) ? l : {
|
|
131
132
|
default: () => [l]
|
|
132
133
|
})
|
|
133
134
|
}) : null]);
|
|
@@ -135,14 +136,14 @@ const A = {
|
|
|
135
136
|
}
|
|
136
137
|
});
|
|
137
138
|
export {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
139
|
+
P as ACTION_FIELD,
|
|
140
|
+
T as CHECKED_FIELD,
|
|
141
|
+
S as CREATE_TIME_FIELD,
|
|
142
|
+
V as DATE_FIELD,
|
|
143
|
+
p as DATE_TIME_FIELD,
|
|
144
|
+
W as ID_FIELD,
|
|
145
|
+
N as NAME_FIELD,
|
|
146
|
+
H as SEQ_FIELD,
|
|
147
|
+
O as STATUS_FIELD,
|
|
148
|
+
k as UPDATE_TIME_FIELD
|
|
148
149
|
};
|
package/es/package.json.d.ts
CHANGED
package/es/package.json.js
CHANGED
|
@@ -30,9 +30,6 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
|
|
|
30
30
|
dark: {
|
|
31
31
|
type: import("vue").PropType<boolean>;
|
|
32
32
|
};
|
|
33
|
-
bg: {
|
|
34
|
-
type: import("vue").PropType<boolean>;
|
|
35
|
-
};
|
|
36
33
|
loading: {
|
|
37
34
|
type: import("vue").PropType<boolean>;
|
|
38
35
|
};
|
|
@@ -56,6 +53,9 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
|
|
|
56
53
|
loadingIcon: {
|
|
57
54
|
type: import("vue").PropType<import("vft/es/vft").IconProps>;
|
|
58
55
|
};
|
|
56
|
+
bg: {
|
|
57
|
+
type: import("vue").PropType<boolean>;
|
|
58
|
+
};
|
|
59
59
|
autoInsertSpace: {
|
|
60
60
|
type: import("vue").PropType<boolean>;
|
|
61
61
|
};
|
|
@@ -120,9 +120,6 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
|
|
|
120
120
|
dark: {
|
|
121
121
|
type: import("vue").PropType<boolean>;
|
|
122
122
|
};
|
|
123
|
-
bg: {
|
|
124
|
-
type: import("vue").PropType<boolean>;
|
|
125
|
-
};
|
|
126
123
|
loading: {
|
|
127
124
|
type: import("vue").PropType<boolean>;
|
|
128
125
|
};
|
|
@@ -146,6 +143,9 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
|
|
|
146
143
|
loadingIcon: {
|
|
147
144
|
type: import("vue").PropType<import("vft/es/vft").IconProps>;
|
|
148
145
|
};
|
|
146
|
+
bg: {
|
|
147
|
+
type: import("vue").PropType<boolean>;
|
|
148
|
+
};
|
|
149
149
|
autoInsertSpace: {
|
|
150
150
|
type: import("vue").PropType<boolean>;
|
|
151
151
|
};
|
|
@@ -205,9 +205,6 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
|
|
|
205
205
|
dark: {
|
|
206
206
|
type: import("vue").PropType<boolean>;
|
|
207
207
|
};
|
|
208
|
-
bg: {
|
|
209
|
-
type: import("vue").PropType<boolean>;
|
|
210
|
-
};
|
|
211
208
|
loading: {
|
|
212
209
|
type: import("vue").PropType<boolean>;
|
|
213
210
|
};
|
|
@@ -231,6 +228,9 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
|
|
|
231
228
|
loadingIcon: {
|
|
232
229
|
type: import("vue").PropType<import("vft/es/vft").IconProps>;
|
|
233
230
|
};
|
|
231
|
+
bg: {
|
|
232
|
+
type: import("vue").PropType<boolean>;
|
|
233
|
+
};
|
|
234
234
|
autoInsertSpace: {
|
|
235
235
|
type: import("vue").PropType<boolean>;
|
|
236
236
|
};
|
|
@@ -53,8 +53,8 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
53
53
|
effect: "light" | "dark";
|
|
54
54
|
tabindex: number | string;
|
|
55
55
|
trigger: import("vft/es/components/tooltip").TooltipTriggerType;
|
|
56
|
-
loop: boolean;
|
|
57
56
|
teleported: boolean;
|
|
57
|
+
loop: boolean;
|
|
58
58
|
popperClass: string;
|
|
59
59
|
showTimeout: number;
|
|
60
60
|
hideTimeout: number;
|
|
@@ -30,10 +30,6 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
30
30
|
type: import("vue").PropType<boolean>;
|
|
31
31
|
default: boolean;
|
|
32
32
|
};
|
|
33
|
-
trapFocus: {
|
|
34
|
-
type: import("vue").PropType<boolean>;
|
|
35
|
-
default: boolean;
|
|
36
|
-
};
|
|
37
33
|
closeOnPressEscape: {
|
|
38
34
|
type: import("vue").PropType<boolean>;
|
|
39
35
|
default: boolean;
|
|
@@ -90,6 +86,10 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
90
86
|
modalClass: {
|
|
91
87
|
type: import("vue").PropType<string>;
|
|
92
88
|
};
|
|
89
|
+
trapFocus: {
|
|
90
|
+
type: import("vue").PropType<boolean>;
|
|
91
|
+
default: boolean;
|
|
92
|
+
};
|
|
93
93
|
showSubmitButton: {
|
|
94
94
|
type: import("vue").PropType<boolean>;
|
|
95
95
|
default: boolean;
|
|
@@ -119,7 +119,6 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
119
119
|
fullscreen: boolean;
|
|
120
120
|
draggable: boolean;
|
|
121
121
|
modelValue: boolean;
|
|
122
|
-
trapFocus: boolean;
|
|
123
122
|
closeOnPressEscape: boolean;
|
|
124
123
|
showClose: boolean;
|
|
125
124
|
customClass: string;
|
|
@@ -131,6 +130,7 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
131
130
|
modal: boolean;
|
|
132
131
|
openDelay: number;
|
|
133
132
|
closeDelay: number;
|
|
133
|
+
trapFocus: boolean;
|
|
134
134
|
showSubmitButton: boolean;
|
|
135
135
|
showActionButtonGroup: boolean;
|
|
136
136
|
showCancelButton: boolean;
|
|
@@ -171,10 +171,6 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
171
171
|
type: import("vue").PropType<boolean>;
|
|
172
172
|
default: boolean;
|
|
173
173
|
};
|
|
174
|
-
trapFocus: {
|
|
175
|
-
type: import("vue").PropType<boolean>;
|
|
176
|
-
default: boolean;
|
|
177
|
-
};
|
|
178
174
|
closeOnPressEscape: {
|
|
179
175
|
type: import("vue").PropType<boolean>;
|
|
180
176
|
default: boolean;
|
|
@@ -231,6 +227,10 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
231
227
|
modalClass: {
|
|
232
228
|
type: import("vue").PropType<string>;
|
|
233
229
|
};
|
|
230
|
+
trapFocus: {
|
|
231
|
+
type: import("vue").PropType<boolean>;
|
|
232
|
+
default: boolean;
|
|
233
|
+
};
|
|
234
234
|
showSubmitButton: {
|
|
235
235
|
type: import("vue").PropType<boolean>;
|
|
236
236
|
default: boolean;
|
|
@@ -260,7 +260,6 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
260
260
|
fullscreen: boolean;
|
|
261
261
|
draggable: boolean;
|
|
262
262
|
modelValue: boolean;
|
|
263
|
-
trapFocus: boolean;
|
|
264
263
|
closeOnPressEscape: boolean;
|
|
265
264
|
showClose: boolean;
|
|
266
265
|
customClass: string;
|
|
@@ -272,6 +271,7 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
272
271
|
modal: boolean;
|
|
273
272
|
openDelay: number;
|
|
274
273
|
closeDelay: number;
|
|
274
|
+
trapFocus: boolean;
|
|
275
275
|
showSubmitButton: boolean;
|
|
276
276
|
showActionButtonGroup: boolean;
|
|
277
277
|
showCancelButton: boolean;
|
|
@@ -309,10 +309,6 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
309
309
|
type: import("vue").PropType<boolean>;
|
|
310
310
|
default: boolean;
|
|
311
311
|
};
|
|
312
|
-
trapFocus: {
|
|
313
|
-
type: import("vue").PropType<boolean>;
|
|
314
|
-
default: boolean;
|
|
315
|
-
};
|
|
316
312
|
closeOnPressEscape: {
|
|
317
313
|
type: import("vue").PropType<boolean>;
|
|
318
314
|
default: boolean;
|
|
@@ -369,6 +365,10 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
369
365
|
modalClass: {
|
|
370
366
|
type: import("vue").PropType<string>;
|
|
371
367
|
};
|
|
368
|
+
trapFocus: {
|
|
369
|
+
type: import("vue").PropType<boolean>;
|
|
370
|
+
default: boolean;
|
|
371
|
+
};
|
|
372
372
|
showSubmitButton: {
|
|
373
373
|
type: import("vue").PropType<boolean>;
|
|
374
374
|
default: boolean;
|
|
@@ -398,7 +398,6 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
398
398
|
fullscreen: boolean;
|
|
399
399
|
draggable: boolean;
|
|
400
400
|
modelValue: boolean;
|
|
401
|
-
trapFocus: boolean;
|
|
402
401
|
closeOnPressEscape: boolean;
|
|
403
402
|
showClose: boolean;
|
|
404
403
|
customClass: string;
|
|
@@ -410,6 +409,7 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
410
409
|
modal: boolean;
|
|
411
410
|
openDelay: number;
|
|
412
411
|
closeDelay: number;
|
|
412
|
+
trapFocus: boolean;
|
|
413
413
|
showSubmitButton: boolean;
|
|
414
414
|
showActionButtonGroup: boolean;
|
|
415
415
|
showCancelButton: boolean;
|
|
@@ -57,7 +57,6 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
57
57
|
fullscreen: boolean;
|
|
58
58
|
draggable: boolean;
|
|
59
59
|
modelValue: boolean;
|
|
60
|
-
trapFocus: boolean;
|
|
61
60
|
closeOnPressEscape: boolean;
|
|
62
61
|
showClose: boolean;
|
|
63
62
|
customClass: string;
|
|
@@ -69,6 +68,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
69
68
|
modal: boolean;
|
|
70
69
|
openDelay: number;
|
|
71
70
|
closeDelay: number;
|
|
71
|
+
trapFocus: boolean;
|
|
72
72
|
showSubmitButton: boolean;
|
|
73
73
|
showActionButtonGroup: boolean;
|
|
74
74
|
showCancelButton: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@vft/utils"),v=require("lodash-es"),r=require("vue"),w=require("../component-map.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@vft/utils"),_=require("@vft/utils/date"),v=require("lodash-es"),r=require("vue"),w=require("../component-map.cjs"),W=require("./helper.cjs");function X(y,D={}){const a=/^\[(.+)\]$/;if(a.test(y)){const h=y.match(a);if(h&&h[1]){const F=h[1].split(",");if(!F.length)return;const l=[];return F.forEach((p,g)=>{v.set(l,g,D[p.trim()])}),l.filter(Boolean).length?l:void 0}}}function Y(y,D={}){const a=/^\{(.+)\}$/;if(a.test(y)){const h=y.match(a);if(h&&h[1]){const F=h[1].split(",");if(!F.length)return;const l={};return F.forEach(p=>{v.set(l,p.trim(),D[p.trim()])}),Object.values(l).filter(Boolean).length?l:void 0}}}function Z({emit:y,getProps:D,formModel:a,getSchema:h,defaultValueRef:F,formElRef:l,schemaRef:p,handleFormValues:g,initValues:A}){async function L(e){const{resetFunc:t,submitOnReset:c}=r.unref(D);t&&u.isFunction(t)&&await t();const i=r.unref(l);if(i){if(e?.length)return i.resetFields(e);Object.keys(a).forEach(s=>{const n=r.unref(h).find(f=>f.field===s),o=v.cloneDeep(F.value[s]);a[s]=w.isInput(n?.type)?o||"":o}),r.nextTick(()=>I()),y("reset",r.toRaw(a)),c&&await B()}}async function C(e){const t=r.unref(h).map(n=>n.field).filter(Boolean),c=".",i=t.filter(n=>String(n).indexOf(c)>=0),s=[];t.forEach(n=>{const o=r.unref(h).find(d=>d.field===n);let f=v.get(e,n);const j=Reflect.has(e,n);f=W.handleInputNumberValue(o?.type,f);const{componentProps:O}=o||{};let E=O;typeof O=="function"&&(E=E({formModel:r.unref(a)}));const x=X(n,e)||Y(n,e);if(j||x){const d=x||f;if(H(n))if(Array.isArray(d)){const b=[];for(const m of d)b.push(m?_.formatToDate(m):null);r.unref(a)[n]=b}else r.unref(a)[n]=d?E?.valueFormat?d:_.formatToDate(d):null;else r.unref(a)[n]=d;E?.onChange&&E?.onChange(d),s.push(n)}else i.forEach(d=>{try{const b=d.split(".").reduce((m,Q)=>m[Q],e);u.isDef(b)&&(r.unref(a)[d]=r.unref(b),s.push(d))}catch{u.isDef(F.value[d])&&(r.unref(a)[d]=v.cloneDeep(r.unref(F.value[d])))}})}),r.nextTick(async()=>{await q(s).catch(n=>{})})}async function N(e){const t=v.cloneDeep(r.unref(h));if(!e)return;let c=u.isString(e)?[e]:e;u.isString(e)&&(c=[e]);for(const i of c)U(i,t);p.value=t}function U(e,t){if(u.isString(e)){const c=t.findIndex(i=>i.field===e);c!==-1&&(delete a[e],t.splice(c,1))}}async function $(e,t,c=!1){const i=v.cloneDeep(r.unref(h)),s=i.findIndex(o=>o.field===t),n=u.isObject(e)?[e]:e;if(!t||s===-1||c){c?i.unshift(...n):i.push(...n),p.value=i,V(e);return}s!==-1&&i.splice(s+1,0,...n),V(e),p.value=i}async function P(e){let t=[];if(u.isObject(e)&&t.push(e),u.isArray(e)&&(t=[...e]),!t.every(i=>i.type===w.FormCompEnum.DIVIDER||Reflect.has(i,"field")&&i.field)){console.error("All children of the form Schema array that need to be updated must contain the `field` field");return}p.value=t}async function z(e){let t=[];if(u.isObject(e)&&t.push(e),u.isArray(e)&&(t=[...e]),!t.every(n=>n.type===w.FormCompEnum.DIVIDER||Reflect.has(n,"field")&&n.field)){console.error("All children of the form Schema array that need to be updated must contain the `field` field");return}const i=[],s=[];r.unref(h).forEach(n=>{let o;if(t.forEach(f=>{n.field===f.field&&(o=f),f.defaultValue&&f.field&&i.push(f.field)}),o!==void 0&&n.field===o.field){const f=u.deepMerge(n,o);s.push(f)}else s.push(n)}),V(s,i),p.value=v.uniqBy(s,"field")}function V(e,t){if(u.isArray(t)&&t?.length===0)return;let c=[];u.isObject(e)&&c.push(e),u.isArray(e)&&(c=[...e]);const i={},s=S();c.forEach(n=>{n.type!==w.FormCompEnum.DIVIDER&&Reflect.has(n,"field")&&n.field&&!u.isNullOrUndefined(n.defaultValue)&&(!(n.field in s)||u.isNullOrUndefined(s[n.field])||u.isEmpty(s[n.field]))&&(i[n.field]=n.defaultValue)}),u.isEmptyObject(i)||C(i)}function S(){return r.unref(l)?g(r.toRaw(r.unref(a))):{}}function G(e){return r.unref(l)?r.toRaw(r.unref(a))[e]:{}}function H(e){return r.unref(h).some(t=>t.field===e?w.isDatePicker(t.type):!1)}async function q(e){return r.unref(l)?.validateField(e)}async function T(e){return await r.unref(l)?.validate(e)}async function I(e){await r.unref(l)?.clearValidate(e)}async function J(e,t){await r.unref(l)?.scrollToField(e,t)}async function B(e){const{autoCleanErrorMessage:t,watchDataIsChange:c}=r.unref(D);e&&e.preventDefault(),t&&await I();const{submitFunc:i,beforeSubmitFunc:s}=r.unref(D);if(s&&u.isFunction(s)&&await s(),i&&u.isFunction(i)){await i();return}if(r.unref(l))try{const o=await T(),f=g(o);if(c){const j=v.isEqual(A.value,f),O=u.findDifferentValuesForObj(A.value,f);y("submit",f,!j,O)}else y("submit",f)}catch(o){if(o?.outOfDate===!1&&o?.errorFields)return;throw new Error(o.message)}}return{handleSubmit:B,clearValidate:I,validate:T,validateField:q,getFieldsValue:S,updateSchema:z,resetSchema:P,appendSchemaByField:$,removeSchemaByField:N,resetFields:L,setFieldsValue:C,scrollToField:J,getFieldValue:G}}exports.useFormEvents=Z;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("@vft/utils"),T=require("@vft/utils/date"),y=require("lodash-es"),b=require("vue");function j(c,i,a){const s=/^\[(.+)\]$/;if(s.test(c)){const o=c.match(s);if(o&&o[1]){const d=o[1].split(",");return i=Array.isArray(i)?i:[i],d.forEach((u,e)=>{y.set(a,u.trim(),i[e])}),!0}}}function F(c,i,a){const s=/^\{(.+)\}$/;if(s.test(c)){const o=c.match(s);if(o&&o[1]){const d=o[1].split(",");return i=m.isObject(i)?i:{},d.forEach(u=>{y.set(a,u.trim(),i[u.trim()])}),!0}}}function O({defaultValueRef:c,getSchema:i,formModel:a,getProps:s}){function o(e){if(!m.isObject(e))return{};const n={};for(const r of Object.entries(e)){let[,t]=r;const[f]=r;!f||m.isArray(t)&&t.length===0||m.isFunction(t)||(m.isString(t)&&(t===""?t=void 0:t=t.trim()),!j(f,t,n)&&!F(f,t,n)&&y.set(n,f,t))}return d(n)}function d(e){const n=b.unref(s).fieldMapToTime;if(!n||!Array.isArray(n))return e;for(const[r,[t,f],l="YYYY-MM-DD"]of n){if(!r||!t||!f)continue;if(!e[r]){Reflect.deleteProperty(e,r);continue}const[h,p]=e[r],[A,D]=Array.isArray(l)?l:[l,l];e[t]=T.formatToDate(h,A),e[f]=T.formatToDate(p,D),Reflect.deleteProperty(e,r)}return e}function u(){const e=i.value,n={};e?.forEach(r=>{const{defaultValue:t}=r;m.isNullOrUndefined(t)||(n[r.field]=t,a[r.field]===void 0&&(a[r.field]=t))}),c.value=y.cloneDeep(n)}return{handleFormValues:o,initDefault:u}}exports.useFormValues=O;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),I=require("@vft/utils/date"),_=require("@vft/utils"),d=require("../button/index.cjs"),F=require("../popconfirm/index.cjs"),f=require("../tag/index.cjs");function l(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!r.isVNode(t)}const L={type:"seq",title:"序号",fixed:"left",width:53},T={type:"checkbox",title:"",minWidth:60,fixed:"left"},M={field:"id",title:"Id",minWidth:100},p={field:"name",title:"名称",minWidth:100},Y=({format:t="YYYY-MM-DD",field:e="date",title:n="时间"}={})=>({minWidth:100,field:e,title:n,formatter:({row:i})=>i[e]?I.formatToDateTime(i[e],t):"-"}),c=({format:t="YYYY-MM-DD HH:mm:ss",field:e="date",title:n="时间"}={})=>({minWidth:190,field:e,title:n,formatter:({row:i})=>i[e]?I.formatToDateTime(i[e],t):"-"}),A=({format:t="YYYY-MM-DD HH:mm:ss",field:e="createTime",title:n="创建时间"}={})=>c({format:t,field:e,title:n}),g=({format:t="YYYY-MM-DD HH:mm:ss",field:e="updateTime",title:n="更新时间"}={})=>c({format:t,field:e,title:n}),N=({field:t="status",title:e="状态",normalText:n="正常",disabledText:i="禁用",strToNumber:a=!0}={})=>({field:t,title:e,minWidth:100,slots:{default:({row:u})=>{let o=u?.[t];return _.isNullOrUndefined(o)?"-":(a&&Number(o)===0&&(o=!1),o?r.createVNode(f.VftTag,null,l(n)?n:{default:()=>[n]}):r.createVNode(f.VftTag,{type:"danger"},l(i)?i:{default:()=>[i]}))}}}),V=({confirmText:t="确认删除?",leftCallback:e,rightCallback:n,leftText:i="编辑",rightText:a="删除",showLeft:u=!0,showRight:o=!0}={})=>({title:"操作栏",minWidth:180,fixed:"right",slots:{default:({row:D})=>{const E=r.ref(!1),m=()=>{E.value=!0,n?.(D)?.finally(()=>{E.value=!1})};return r.createVNode(r.Fragment,null,[u?r.createVNode(d.VftButton,{size:"small",type:"primary",onClick:s=>{s.stopPropagation(),e?.(D)}},l(i)?i:{default:()=>[i]}):null,o?r.createVNode(F.VftPopconfirm,{width:"150",onConfirm:m,title:t},{reference:()=>r.createVNode(d.VftButton,{loading:E.value,size:"small",type:"danger",onClick:s=>{s.stopPropagation()}},l(a)?a:{default:()=>[a]})}):null])}}});exports.ACTION_FIELD=V;exports.CHECKED_FIELD=T;exports.CREATE_TIME_FIELD=A;exports.DATE_FIELD=Y;exports.DATE_TIME_FIELD=c;exports.ID_FIELD=M;exports.NAME_FIELD=p;exports.SEQ_FIELD=L;exports.STATUS_FIELD=N;exports.UPDATE_TIME_FIELD=g;
|
|
@@ -13,7 +13,7 @@ export declare const DATE_FIELD: ({ format, field, title, }?: {
|
|
|
13
13
|
title: string;
|
|
14
14
|
formatter: ({ row }: {
|
|
15
15
|
row: any;
|
|
16
|
-
}) =>
|
|
16
|
+
}) => any;
|
|
17
17
|
};
|
|
18
18
|
export declare const DATE_TIME_FIELD: ({ format, field, title, }?: {
|
|
19
19
|
format?: string | undefined;
|
|
@@ -25,7 +25,7 @@ export declare const DATE_TIME_FIELD: ({ format, field, title, }?: {
|
|
|
25
25
|
title: string;
|
|
26
26
|
formatter: ({ row }: {
|
|
27
27
|
row: any;
|
|
28
|
-
}) =>
|
|
28
|
+
}) => any;
|
|
29
29
|
};
|
|
30
30
|
export declare const CREATE_TIME_FIELD: ({ format, field, title, }?: {
|
|
31
31
|
format?: string | undefined;
|
|
@@ -37,7 +37,7 @@ export declare const CREATE_TIME_FIELD: ({ format, field, title, }?: {
|
|
|
37
37
|
title: string;
|
|
38
38
|
formatter: ({ row }: {
|
|
39
39
|
row: any;
|
|
40
|
-
}) =>
|
|
40
|
+
}) => any;
|
|
41
41
|
};
|
|
42
42
|
export declare const UPDATE_TIME_FIELD: ({ format, field, title, }?: {
|
|
43
43
|
format?: string | undefined;
|
|
@@ -49,7 +49,7 @@ export declare const UPDATE_TIME_FIELD: ({ format, field, title, }?: {
|
|
|
49
49
|
title: string;
|
|
50
50
|
formatter: ({ row }: {
|
|
51
51
|
row: any;
|
|
52
|
-
}) =>
|
|
52
|
+
}) => any;
|
|
53
53
|
};
|
|
54
54
|
export declare const STATUS_FIELD: ({ field, title, normalText, disabledText, strToNumber, }?: {
|
|
55
55
|
field?: string | undefined;
|
package/lib/package.json.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.296";exports.version=e;
|
package/lib/package.json.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vft",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.296",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -54,12 +54,12 @@
|
|
|
54
54
|
"qrcode": "1.5.3",
|
|
55
55
|
"resize-detector": "0.3.0",
|
|
56
56
|
"sortablejs": "1.15.0",
|
|
57
|
-
"@vft/
|
|
58
|
-
"@vft/utils": "0.0.116",
|
|
59
|
-
"@vft/directives": "0.0.33",
|
|
60
|
-
"@vft/constants": "0.0.72",
|
|
57
|
+
"@vft/use": "0.0.69",
|
|
61
58
|
"@vft/router": "0.0.65",
|
|
62
|
-
"@vft/
|
|
59
|
+
"@vft/constants": "0.0.72",
|
|
60
|
+
"@vft/store": "0.0.53",
|
|
61
|
+
"@vft/directives": "0.0.33",
|
|
62
|
+
"@vft/utils": "0.0.120"
|
|
63
63
|
},
|
|
64
64
|
"vetur": {
|
|
65
65
|
"tags": "tags.json",
|
package/web-types.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"http://json.schemastore.org/web-types","framework":"vue","name":"vft","version":"0.0.
|
|
1
|
+
{"$schema":"http://json.schemastore.org/web-types","framework":"vue","name":"vft","version":"0.0.296","js-types-syntax":"typescript","description-markup":"markdown","contributions":{"html":{}}}
|