vft 0.0.392 → 0.0.394
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/autocomplete/autocomplete.vue.d.ts +3 -3
- package/es/components/autocomplete/index.d.ts +7 -7
- package/es/components/button/button.vue.d.ts +1 -1
- package/es/components/button/index.d.ts +12 -12
- package/es/components/button/use-button.d.ts +1 -1
- package/es/components/carousel/use-carousel.js +1 -1
- package/es/components/cascader/cascader.vue.d.ts +2 -2
- package/es/components/checkbox/index.d.ts +27 -27
- package/es/components/color-picker/index.d.ts +6 -6
- package/es/components/date-picker/date-picker-com/panel-date-pick.vue.d.ts +2 -2
- package/es/components/date-picker/date-picker-com/panel-date-range.vue.d.ts +2 -2
- package/es/components/date-picker/date-picker.d.ts +3 -3
- package/es/components/date-picker/date-picker.js +8 -8
- package/es/components/date-picker/index.d.ts +6 -6
- package/es/components/date-picker/panel-utils.d.ts +6 -6
- package/es/components/date-picker/props/date-picker.d.ts +1 -1
- package/es/components/date-picker/props/panel-date-pick.d.ts +1 -1
- package/es/components/date-picker/props/panel-date-range.d.ts +1 -1
- package/es/components/date-picker/props/shared.d.ts +1 -1
- package/es/components/dropdown/index.d.ts +9 -9
- package/es/components/form/index.d.ts +18 -18
- package/es/components/index.js +155 -163
- package/es/components/input/index.d.ts +5 -5
- package/es/components/input/input.vue.d.ts +2 -2
- package/es/components/input/input.vue2.js +4 -4
- package/es/components/input-number/index.d.ts +1 -1
- package/es/components/input-number/input-number.vue.d.ts +1 -1
- package/es/components/input-tag/composables/use-input-tag.js +1 -1
- package/es/components/input-tag/input-tag.vue.d.ts +4 -4
- package/es/components/radio/index.d.ts +18 -18
- package/es/components/search/index.d.ts +3 -3
- package/es/components/search/search.vue.d.ts +1 -1
- package/es/components/select/index.d.ts +2 -2
- package/es/components/select/select.vue.d.ts +2 -2
- package/es/components/slider/index.d.ts +1 -1
- package/es/components/slider/slider.vue.d.ts +1 -1
- package/es/components/super-form/component-map.d.ts +4 -45
- package/es/components/super-form/component-map.js +30 -60
- package/es/components/super-form/index.js +12 -20
- package/es/components/super-form/super-form-item.vue2.js +7 -6
- package/es/components/super-form/types.d.ts +3 -3
- package/es/components/super-form/types.js +5 -1
- package/es/components/super-form/use/helper.d.ts +3 -3
- package/es/components/super-form/use/helper.js +37 -32
- package/es/components/super-form/use/use-auto-focus.js +18 -14
- package/es/components/super-form/use/use-form-events.js +84 -81
- package/es/components/switch/index.d.ts +6 -6
- package/es/components/table/index.d.ts +9 -9
- package/es/components/table/table.vue2.js +22 -22
- package/es/components/tabs/index.d.ts +2 -2
- package/es/components/tabs/tabs.vue.d.ts +2 -2
- package/es/components/time-picker/common/picker.vue.d.ts +2 -2
- package/es/components/time-picker/time-picker.js +1 -1
- package/es/components/time-select/time-select.vue2.js +1 -1
- package/es/components/tree/tree-node.vue.d.ts +18 -18
- package/es/index.js +2 -1
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/es/utils/form-register.d.ts +43 -0
- package/es/utils/form-register.js +68 -0
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +80 -71
- package/es/utils/vue/vnode.js +1 -1
- package/lib/components/autocomplete/autocomplete.vue.d.ts +3 -3
- package/lib/components/autocomplete/index.d.ts +7 -7
- package/lib/components/button/button.vue.d.ts +1 -1
- package/lib/components/button/index.d.ts +12 -12
- package/lib/components/button/use-button.d.ts +1 -1
- package/lib/components/cascader/cascader.vue.d.ts +2 -2
- package/lib/components/checkbox/index.d.ts +27 -27
- package/lib/components/color-picker/index.d.ts +6 -6
- package/lib/components/date-picker/date-picker-com/panel-date-pick.vue.d.ts +2 -2
- package/lib/components/date-picker/date-picker-com/panel-date-range.vue.d.ts +2 -2
- package/lib/components/date-picker/date-picker.cjs +1 -1
- package/lib/components/date-picker/date-picker.d.ts +3 -3
- package/lib/components/date-picker/index.d.ts +6 -6
- package/lib/components/date-picker/panel-utils.d.ts +6 -6
- package/lib/components/date-picker/props/date-picker.d.ts +1 -1
- package/lib/components/date-picker/props/panel-date-pick.d.ts +1 -1
- package/lib/components/date-picker/props/panel-date-range.d.ts +1 -1
- package/lib/components/date-picker/props/shared.d.ts +1 -1
- package/lib/components/dropdown/index.d.ts +9 -9
- package/lib/components/form/index.d.ts +18 -18
- package/lib/components/index.cjs +1 -1
- package/lib/components/input/index.d.ts +5 -5
- package/lib/components/input/input.vue.d.ts +2 -2
- package/lib/components/input/input.vue2.cjs +1 -1
- package/lib/components/input-number/index.d.ts +1 -1
- package/lib/components/input-number/input-number.vue.d.ts +1 -1
- package/lib/components/input-tag/input-tag.vue.d.ts +4 -4
- package/lib/components/radio/index.d.ts +18 -18
- package/lib/components/search/index.d.ts +3 -3
- package/lib/components/search/search.vue.d.ts +1 -1
- package/lib/components/select/index.d.ts +2 -2
- package/lib/components/select/select.vue.d.ts +2 -2
- package/lib/components/slider/index.d.ts +1 -1
- package/lib/components/slider/slider.vue.d.ts +1 -1
- package/lib/components/super-form/component-map.cjs +1 -1
- package/lib/components/super-form/component-map.d.ts +4 -45
- package/lib/components/super-form/index.cjs +1 -1
- package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
- package/lib/components/super-form/types.cjs +1 -1
- package/lib/components/super-form/types.d.ts +3 -3
- package/lib/components/super-form/use/helper.cjs +1 -1
- package/lib/components/super-form/use/helper.d.ts +3 -3
- package/lib/components/super-form/use/use-auto-focus.cjs +1 -1
- package/lib/components/super-form/use/use-form-events.cjs +1 -1
- package/lib/components/switch/index.d.ts +6 -6
- package/lib/components/table/index.d.ts +9 -9
- package/lib/components/table/table.vue2.cjs +1 -1
- package/lib/components/tabs/index.d.ts +2 -2
- package/lib/components/tabs/tabs.vue.d.ts +2 -2
- package/lib/components/time-picker/common/picker.vue.d.ts +2 -2
- package/lib/components/time-picker/time-picker.cjs +1 -1
- package/lib/components/time-select/time-select.vue2.cjs +1 -1
- package/lib/components/tree/tree-node.vue.d.ts +18 -18
- package/lib/index.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/lib/utils/form-register.cjs +1 -0
- package/lib/utils/form-register.d.ts +43 -0
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/package.json +2 -2
- package/web-types.json +1 -1
|
@@ -1,37 +1,42 @@
|
|
|
1
|
-
import { isNumber as
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { isNumber as i } from "@vft/utils";
|
|
2
|
+
import { isInput as n } from "../component-map.js";
|
|
3
|
+
import { FormCompEnum as r } from "../../../utils/form-register.js";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import "../../config-provider/hooks/use-global-config.js";
|
|
6
|
+
import "vue";
|
|
7
|
+
import "lodash-es";
|
|
8
|
+
function A(e, E = "") {
|
|
4
9
|
return E = (E || "").replace(":", "") || "", [
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
].includes(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
].includes(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
].includes(
|
|
10
|
+
r.INPUT,
|
|
11
|
+
r.INPUT_NUMBER,
|
|
12
|
+
r.TEXTAREA,
|
|
13
|
+
r.AUTOCOMPLETE
|
|
14
|
+
].includes(e) ? "请输入" + E : [r.PASSWORD].includes(e) ? "请输入密码" : [
|
|
15
|
+
r.SELECT,
|
|
16
|
+
r.RADIO,
|
|
17
|
+
r.RADIO_SINGLE,
|
|
18
|
+
r.RADIO_BUTTON,
|
|
19
|
+
r.Cascader,
|
|
20
|
+
r.ColorPicker,
|
|
21
|
+
r.CHECKBOX,
|
|
22
|
+
r.CHECKBOX_BUTTON
|
|
23
|
+
].includes(e) ? "请选择" + E : [r.CHECKBOX_SINGLE].includes(e) ? "请勾选" + E : [r.SEARCH].includes(e) ? "请输入要搜索的内容" : [r.INPUT_TAG].includes(e) ? "请输入标签内容" : [r.Upload].includes(e) ? "请选择上传文件" : [r.Slider].includes(e) ? "请拖动滑块" : [
|
|
24
|
+
r.TIME_PICKER,
|
|
25
|
+
r.YEAR_PICKER,
|
|
26
|
+
r.MONTH_PICKER,
|
|
27
|
+
r.DATE_PICKER,
|
|
28
|
+
r.DATES_PICKER,
|
|
29
|
+
r.DATETIME_PICKER,
|
|
30
|
+
r.WEEK_PICKER,
|
|
31
|
+
r.DATETIMERANGE_PICKER,
|
|
32
|
+
r.DATERANGE_PICKER,
|
|
33
|
+
r.MONTHRANGE_PICKER
|
|
34
|
+
].includes(e) ? "请选择时间" : "";
|
|
30
35
|
}
|
|
31
|
-
function
|
|
32
|
-
return
|
|
36
|
+
function t(e, E) {
|
|
37
|
+
return e && n(e) && E && i(E) ? `${E}` : E;
|
|
33
38
|
}
|
|
34
39
|
export {
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
A as createPlaceholderMessage,
|
|
41
|
+
t as handleInputNumberValue
|
|
37
42
|
};
|
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { FormCompEnum as m } from "../../../utils/form-register.js";
|
|
2
|
+
import "@vueuse/core";
|
|
3
|
+
import "@vft/utils";
|
|
4
|
+
import "../../config-provider/hooks/use-global-config.js";
|
|
5
|
+
import { watchEffect as u, unref as t, nextTick as p } from "vue";
|
|
6
|
+
import "lodash-es";
|
|
7
|
+
async function w({
|
|
8
|
+
getSchema: n,
|
|
9
|
+
getProps: c,
|
|
10
|
+
formElRef: s,
|
|
11
|
+
isInitedDefault: f
|
|
8
12
|
}) {
|
|
9
13
|
u(async () => {
|
|
10
|
-
if (t(
|
|
14
|
+
if (t(f) || !t(c).autoFocusFirstItem)
|
|
11
15
|
return;
|
|
12
|
-
await
|
|
13
|
-
const r = t(
|
|
14
|
-
if (!o || !e || !r || r.length === 0 || r[0].type !==
|
|
16
|
+
await p();
|
|
17
|
+
const r = t(n), o = t(s), e = o?.$el;
|
|
18
|
+
if (!o || !e || !r || r.length === 0 || r[0].type !== m.INPUT)
|
|
15
19
|
return;
|
|
16
|
-
const
|
|
20
|
+
const i = e.querySelector(
|
|
17
21
|
".vft-row:first-child input"
|
|
18
22
|
);
|
|
19
|
-
|
|
23
|
+
i && i?.focus();
|
|
20
24
|
});
|
|
21
25
|
}
|
|
22
26
|
export {
|
|
23
|
-
|
|
27
|
+
w as useAutoFocus
|
|
24
28
|
};
|
|
@@ -1,105 +1,108 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
1
|
+
import { FormCompEnum as j } from "../../../utils/form-register.js";
|
|
2
|
+
import "@vueuse/core";
|
|
3
|
+
import { isDef as H, isFunction as A, isString as x, isObject as V, isArray as m, deepMerge as nt, findDifferentValuesForObj as rt, isNullOrUndefined as J, isEmpty as st, isEmptyObject as lt } from "@vft/utils";
|
|
4
|
+
import "../../config-provider/hooks/use-global-config.js";
|
|
5
|
+
import { unref as n, toRaw as S, nextTick as Q } from "vue";
|
|
6
|
+
import { get as ot, cloneDeep as I, uniqBy as at, isEqual as ft, set as X } from "lodash-es";
|
|
7
|
+
import { formatToDate as W } from "@vft/utils/date";
|
|
8
|
+
import { isInput as ct, isDatePicker as ut } from "../component-map.js";
|
|
6
9
|
import { handleInputNumberValue as dt } from "./helper.js";
|
|
7
|
-
function _(
|
|
8
|
-
const { show: o, ifShow:
|
|
9
|
-
let
|
|
10
|
-
return typeof o == "boolean" ?
|
|
11
|
-
field:
|
|
10
|
+
function _(p, y) {
|
|
11
|
+
const { show: o, ifShow: f } = p;
|
|
12
|
+
let h = !0, c = !0;
|
|
13
|
+
return typeof o == "boolean" ? h = o : typeof o == "function" && (h = o({
|
|
14
|
+
field: p.field,
|
|
12
15
|
model: y,
|
|
13
16
|
values: {
|
|
14
17
|
...y
|
|
15
18
|
},
|
|
16
|
-
schema:
|
|
17
|
-
})), typeof
|
|
18
|
-
field:
|
|
19
|
+
schema: p
|
|
20
|
+
})), typeof f == "boolean" ? c = f : typeof f == "function" && (c = f({
|
|
21
|
+
field: p.field,
|
|
19
22
|
model: y,
|
|
20
23
|
values: {
|
|
21
24
|
...y
|
|
22
25
|
},
|
|
23
|
-
schema:
|
|
24
|
-
})),
|
|
26
|
+
schema: p
|
|
27
|
+
})), h && c;
|
|
25
28
|
}
|
|
26
|
-
function
|
|
29
|
+
function pt(p, y = {}) {
|
|
27
30
|
const o = /^\[(.+)\]$/;
|
|
28
|
-
if (o.test(
|
|
29
|
-
const
|
|
30
|
-
if (
|
|
31
|
-
const
|
|
32
|
-
if (!
|
|
31
|
+
if (o.test(p)) {
|
|
32
|
+
const f = p.match(o);
|
|
33
|
+
if (f && f[1]) {
|
|
34
|
+
const h = f[1].split(",");
|
|
35
|
+
if (!h.length)
|
|
33
36
|
return;
|
|
34
|
-
const
|
|
35
|
-
return
|
|
36
|
-
X(
|
|
37
|
-
}),
|
|
37
|
+
const c = [];
|
|
38
|
+
return h.forEach((F, B) => {
|
|
39
|
+
X(c, B, y[F.trim()]);
|
|
40
|
+
}), c.filter(Boolean).length ? c : void 0;
|
|
38
41
|
}
|
|
39
42
|
}
|
|
40
43
|
}
|
|
41
|
-
function
|
|
44
|
+
function ht(p, y = {}) {
|
|
42
45
|
const o = /^\{(.+)\}$/;
|
|
43
|
-
if (o.test(
|
|
44
|
-
const
|
|
45
|
-
if (
|
|
46
|
-
const
|
|
47
|
-
if (!
|
|
46
|
+
if (o.test(p)) {
|
|
47
|
+
const f = p.match(o);
|
|
48
|
+
if (f && f[1]) {
|
|
49
|
+
const h = f[1].split(",");
|
|
50
|
+
if (!h.length)
|
|
48
51
|
return;
|
|
49
|
-
const
|
|
50
|
-
return
|
|
51
|
-
X(
|
|
52
|
-
}), Object.values(
|
|
52
|
+
const c = {};
|
|
53
|
+
return h.forEach((F) => {
|
|
54
|
+
X(c, F.trim(), y[F.trim()]);
|
|
55
|
+
}), Object.values(c).filter(Boolean).length ? c : void 0;
|
|
53
56
|
}
|
|
54
57
|
}
|
|
55
58
|
}
|
|
56
|
-
function
|
|
57
|
-
emit:
|
|
59
|
+
function It({
|
|
60
|
+
emit: p,
|
|
58
61
|
getProps: y,
|
|
59
62
|
formModel: o,
|
|
60
|
-
getSchema:
|
|
61
|
-
defaultValueRef:
|
|
62
|
-
formElRef:
|
|
63
|
+
getSchema: f,
|
|
64
|
+
defaultValueRef: h,
|
|
65
|
+
formElRef: c,
|
|
63
66
|
schemaRef: F,
|
|
64
67
|
handleFormValues: B,
|
|
65
68
|
initValues: T
|
|
66
69
|
}) {
|
|
67
70
|
async function Y(t) {
|
|
68
71
|
const { resetFunc: e, submitOnReset: s } = n(y);
|
|
69
|
-
e &&
|
|
70
|
-
const r = n(
|
|
72
|
+
e && A(e) && await e();
|
|
73
|
+
const r = n(c);
|
|
71
74
|
if (r) {
|
|
72
75
|
if (t?.length)
|
|
73
76
|
return r.resetFields(t);
|
|
74
77
|
Object.keys(o).forEach((a) => {
|
|
75
|
-
const l = n(
|
|
76
|
-
o[a] =
|
|
77
|
-
}),
|
|
78
|
+
const l = n(f).find((u) => u.field === a), i = I(h.value[a]);
|
|
79
|
+
o[a] = ct(l?.type) ? i || "" : i;
|
|
80
|
+
}), Q(() => D()), p("reset", S(o)), s && await U();
|
|
78
81
|
}
|
|
79
82
|
}
|
|
80
83
|
async function q(t, e = !0) {
|
|
81
|
-
const s = n(
|
|
84
|
+
const s = n(f).map((i) => i.field).filter(Boolean), r = ".", a = s.filter(
|
|
82
85
|
(i) => String(i).indexOf(r) >= 0
|
|
83
86
|
), l = [];
|
|
84
87
|
s.forEach((i) => {
|
|
85
|
-
const u = n(
|
|
88
|
+
const u = n(f).find((d) => d.field === i);
|
|
86
89
|
let b = ot(t, i);
|
|
87
90
|
const C = Reflect.has(t, i);
|
|
88
91
|
b = dt(u?.type, b);
|
|
89
92
|
const { componentProps: z } = u || {};
|
|
90
93
|
let w = z;
|
|
91
94
|
typeof z == "function" && (w = w({ formModel: n(o) }));
|
|
92
|
-
const G =
|
|
95
|
+
const G = pt(i, t) || ht(i, t);
|
|
93
96
|
if (C || G) {
|
|
94
97
|
const d = G || b;
|
|
95
98
|
if (M(i))
|
|
96
99
|
if (Array.isArray(d)) {
|
|
97
100
|
const v = [];
|
|
98
101
|
for (const E of d)
|
|
99
|
-
v.push(E ?
|
|
102
|
+
v.push(E ? W(E) : null);
|
|
100
103
|
n(o)[i] = v;
|
|
101
104
|
} else
|
|
102
|
-
n(o)[i] = d ? w?.valueFormat ? d :
|
|
105
|
+
n(o)[i] = d ? w?.valueFormat ? d : W(d) : null;
|
|
103
106
|
else
|
|
104
107
|
n(o)[i] = d;
|
|
105
108
|
w?.onChange && w?.onChange(d), l.push(i);
|
|
@@ -109,34 +112,34 @@ function Et({
|
|
|
109
112
|
const v = d.split(".").reduce((E, it) => E[it], t);
|
|
110
113
|
H(v) && (n(o)[d] = n(v), l.push(d));
|
|
111
114
|
} catch {
|
|
112
|
-
H(
|
|
113
|
-
n(
|
|
115
|
+
H(h.value[d]) && (n(o)[d] = I(
|
|
116
|
+
n(h.value[d])
|
|
114
117
|
));
|
|
115
118
|
}
|
|
116
119
|
});
|
|
117
|
-
}), e &&
|
|
120
|
+
}), e && Q(async () => {
|
|
118
121
|
await $(l).catch((i) => {
|
|
119
122
|
});
|
|
120
123
|
});
|
|
121
124
|
}
|
|
122
125
|
async function Z(t) {
|
|
123
|
-
const e =
|
|
126
|
+
const e = I(n(f));
|
|
124
127
|
if (!t)
|
|
125
128
|
return;
|
|
126
|
-
let s =
|
|
127
|
-
|
|
129
|
+
let s = x(t) ? [t] : t;
|
|
130
|
+
x(t) && (s = [t]);
|
|
128
131
|
for (const r of s)
|
|
129
132
|
L(r, e);
|
|
130
133
|
F.value = e;
|
|
131
134
|
}
|
|
132
135
|
function L(t, e) {
|
|
133
|
-
if (
|
|
136
|
+
if (x(t)) {
|
|
134
137
|
const s = e.findIndex((r) => r.field === t);
|
|
135
138
|
s !== -1 && (delete o[t], e.splice(s, 1));
|
|
136
139
|
}
|
|
137
140
|
}
|
|
138
141
|
async function K(t, e, s = !1) {
|
|
139
|
-
const r =
|
|
142
|
+
const r = I(n(f)), a = r.findIndex((i) => i.field === e), l = V(t) ? [t] : t;
|
|
140
143
|
if (!e || a === -1 || s) {
|
|
141
144
|
s ? r.unshift(...l) : r.push(...l), F.value = r, O(t);
|
|
142
145
|
return;
|
|
@@ -145,8 +148,8 @@ function Et({
|
|
|
145
148
|
}
|
|
146
149
|
async function R(t) {
|
|
147
150
|
let e = [];
|
|
148
|
-
if (V(t) && e.push(t),
|
|
149
|
-
(r) => r.type ===
|
|
151
|
+
if (V(t) && e.push(t), m(t) && (e = [...t]), !e.every(
|
|
152
|
+
(r) => r.type === j.DIVIDER || Reflect.has(r, "field") && r.field
|
|
150
153
|
)) {
|
|
151
154
|
console.error(
|
|
152
155
|
"All children of the form Schema array that need to be updated must contain the `field` field"
|
|
@@ -157,8 +160,8 @@ function Et({
|
|
|
157
160
|
}
|
|
158
161
|
async function N(t) {
|
|
159
162
|
let e = [];
|
|
160
|
-
if (V(t) && e.push(t),
|
|
161
|
-
(l) => l.type ===
|
|
163
|
+
if (V(t) && e.push(t), m(t) && (e = [...t]), !e.every(
|
|
164
|
+
(l) => l.type === j.DIVIDER || Reflect.has(l, "field") && l.field
|
|
162
165
|
)) {
|
|
163
166
|
console.error(
|
|
164
167
|
"All children of the form Schema array that need to be updated must contain the `field` field"
|
|
@@ -166,7 +169,7 @@ function Et({
|
|
|
166
169
|
return;
|
|
167
170
|
}
|
|
168
171
|
const r = [], a = [];
|
|
169
|
-
n(
|
|
172
|
+
n(f).forEach((l) => {
|
|
170
173
|
let i;
|
|
171
174
|
if (e.forEach((u) => {
|
|
172
175
|
l.field === u.field && (i = u), u.defaultValue && u.field && r.push(u.field);
|
|
@@ -178,65 +181,65 @@ function Et({
|
|
|
178
181
|
}), O(a, r), F.value = at(a, "field");
|
|
179
182
|
}
|
|
180
183
|
function O(t, e, s = !0) {
|
|
181
|
-
if (
|
|
184
|
+
if (m(e) && e?.length === 0)
|
|
182
185
|
return;
|
|
183
186
|
let r = [];
|
|
184
|
-
V(t) && r.push(t),
|
|
187
|
+
V(t) && r.push(t), m(t) && (r = [...t]);
|
|
185
188
|
const a = {}, l = g();
|
|
186
189
|
r.forEach((i) => {
|
|
187
|
-
i.type !==
|
|
190
|
+
i.type !== j.DIVIDER && Reflect.has(i, "field") && i.field && !J(i.defaultValue) && (!(i.field in l) || J(l[i.field]) || st(l[i.field])) && (a[i.field] = i.defaultValue);
|
|
188
191
|
}), lt(a) || q(a, s);
|
|
189
192
|
}
|
|
190
193
|
function g(t = !1) {
|
|
191
|
-
if (!n(
|
|
192
|
-
const s = B(
|
|
194
|
+
if (!n(c)) return {};
|
|
195
|
+
const s = B(S(n(o)));
|
|
193
196
|
if (t)
|
|
194
197
|
return s;
|
|
195
|
-
const r = n(
|
|
198
|
+
const r = n(f).filter((l) => _(l, n(o))).map((l) => l.field).filter(Boolean), a = {};
|
|
196
199
|
return r.forEach((l) => {
|
|
197
200
|
l in s && (a[l] = s[l]);
|
|
198
201
|
}), a;
|
|
199
202
|
}
|
|
200
203
|
function k(t) {
|
|
201
|
-
return n(
|
|
204
|
+
return n(c) ? S(n(o))[t] : {};
|
|
202
205
|
}
|
|
203
206
|
function M(t) {
|
|
204
|
-
return n(
|
|
207
|
+
return n(f).some((e) => e.field === t ? ut(e.type) : !1);
|
|
205
208
|
}
|
|
206
209
|
async function $(t) {
|
|
207
|
-
return t || (t = n(
|
|
210
|
+
return t || (t = n(f).filter((s) => _(s, n(o))).map((s) => s.field).filter(Boolean)), n(c)?.validateField(t);
|
|
208
211
|
}
|
|
209
212
|
async function P(t) {
|
|
210
|
-
return t || (t = n(
|
|
213
|
+
return t || (t = n(f).filter((s) => _(s, n(o))).map((s) => s.field).filter(Boolean)), await n(c)?.validate(t, () => {
|
|
211
214
|
});
|
|
212
215
|
}
|
|
213
216
|
async function D(t) {
|
|
214
|
-
await n(
|
|
217
|
+
await n(c)?.clearValidate(t);
|
|
215
218
|
}
|
|
216
219
|
async function tt(t, e) {
|
|
217
220
|
await D(t), await N([{ field: t, itemProps: { error: e } }]);
|
|
218
221
|
}
|
|
219
222
|
async function et(t, e) {
|
|
220
|
-
await n(
|
|
223
|
+
await n(c)?.scrollToField(t, e);
|
|
221
224
|
}
|
|
222
225
|
async function U(t) {
|
|
223
226
|
const { autoCleanErrorMessage: e, watchDataIsChange: s } = n(y);
|
|
224
227
|
t && t.preventDefault(), e && await D();
|
|
225
228
|
const { submitFunc: r, beforeSubmitFunc: a } = n(y);
|
|
226
|
-
if (a &&
|
|
229
|
+
if (a && A(a) && await a(), r && A(r)) {
|
|
227
230
|
await r();
|
|
228
231
|
return;
|
|
229
232
|
}
|
|
230
|
-
if (n(
|
|
233
|
+
if (n(c))
|
|
231
234
|
try {
|
|
232
235
|
if (!await P())
|
|
233
236
|
return;
|
|
234
237
|
const u = g();
|
|
235
238
|
if (s) {
|
|
236
|
-
const b =
|
|
237
|
-
|
|
239
|
+
const b = ft(T.value, u), C = rt(T.value, u);
|
|
240
|
+
p("submit", u, !b, C);
|
|
238
241
|
} else
|
|
239
|
-
|
|
242
|
+
p("submit", u);
|
|
240
243
|
} catch (i) {
|
|
241
244
|
if (i?.outOfDate === !1 && i?.errorFields)
|
|
242
245
|
return;
|
|
@@ -261,5 +264,5 @@ function Et({
|
|
|
261
264
|
};
|
|
262
265
|
}
|
|
263
266
|
export {
|
|
264
|
-
|
|
267
|
+
It as useFormEvents
|
|
265
268
|
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export declare const VftSwitch: import("vft/es/utils").SFCWithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
size: {
|
|
3
|
+
type: import("vue").PropType<import("vft/es/constants").ComponentSize>;
|
|
4
|
+
};
|
|
2
5
|
disabled: {
|
|
3
6
|
type: import("vue").PropType<boolean>;
|
|
4
7
|
default: boolean;
|
|
@@ -19,9 +22,6 @@ export declare const VftSwitch: import("vft/es/utils").SFCWithInstall<import("vu
|
|
|
19
22
|
id: {
|
|
20
23
|
type: import("vue").PropType<string>;
|
|
21
24
|
};
|
|
22
|
-
size: {
|
|
23
|
-
type: import("vue").PropType<import("vft/es/constants").ComponentSize>;
|
|
24
|
-
};
|
|
25
25
|
modelValue: {
|
|
26
26
|
type: import("vue").PropType<string | number | boolean>;
|
|
27
27
|
default: boolean;
|
|
@@ -78,6 +78,9 @@ export declare const VftSwitch: import("vft/es/utils").SFCWithInstall<import("vu
|
|
|
78
78
|
"update:modelValue": (...args: any[]) => void;
|
|
79
79
|
change: (...args: any[]) => void;
|
|
80
80
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
81
|
+
size: {
|
|
82
|
+
type: import("vue").PropType<import("vft/es/constants").ComponentSize>;
|
|
83
|
+
};
|
|
81
84
|
disabled: {
|
|
82
85
|
type: import("vue").PropType<boolean>;
|
|
83
86
|
default: boolean;
|
|
@@ -98,9 +101,6 @@ export declare const VftSwitch: import("vft/es/utils").SFCWithInstall<import("vu
|
|
|
98
101
|
id: {
|
|
99
102
|
type: import("vue").PropType<string>;
|
|
100
103
|
};
|
|
101
|
-
size: {
|
|
102
|
-
type: import("vue").PropType<import("vft/es/constants").ComponentSize>;
|
|
103
|
-
};
|
|
104
104
|
modelValue: {
|
|
105
105
|
type: import("vue").PropType<string | number | boolean>;
|
|
106
106
|
default: boolean;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
|
|
2
2
|
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
|
|
3
|
+
size: {
|
|
4
|
+
type: import("vue").PropType<import("vxe-table").VxeComponentSizeType>;
|
|
5
|
+
};
|
|
3
6
|
data: {
|
|
4
7
|
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.Data<any>>;
|
|
5
8
|
};
|
|
@@ -29,9 +32,6 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
|
|
|
29
32
|
params: {
|
|
30
33
|
type: import("vue").PropType<any>;
|
|
31
34
|
};
|
|
32
|
-
size: {
|
|
33
|
-
type: import("vue").PropType<import("vxe-table").VxeComponentSizeType>;
|
|
34
|
-
};
|
|
35
35
|
immediate: {
|
|
36
36
|
type: import("vue").PropType<boolean>;
|
|
37
37
|
default: boolean;
|
|
@@ -686,6 +686,9 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
|
|
|
686
686
|
M: {};
|
|
687
687
|
Defaults: {};
|
|
688
688
|
}, Readonly<import("vue").ExtractPropTypes<{
|
|
689
|
+
size: {
|
|
690
|
+
type: import("vue").PropType<import("vxe-table").VxeComponentSizeType>;
|
|
691
|
+
};
|
|
689
692
|
data: {
|
|
690
693
|
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.Data<any>>;
|
|
691
694
|
};
|
|
@@ -715,9 +718,6 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
|
|
|
715
718
|
params: {
|
|
716
719
|
type: import("vue").PropType<any>;
|
|
717
720
|
};
|
|
718
|
-
size: {
|
|
719
|
-
type: import("vue").PropType<import("vxe-table").VxeComponentSizeType>;
|
|
720
|
-
};
|
|
721
721
|
immediate: {
|
|
722
722
|
type: import("vue").PropType<boolean>;
|
|
723
723
|
default: boolean;
|
|
@@ -1256,6 +1256,9 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
|
|
|
1256
1256
|
__isTeleport?: never;
|
|
1257
1257
|
__isSuspense?: never;
|
|
1258
1258
|
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
1259
|
+
size: {
|
|
1260
|
+
type: import("vue").PropType<import("vxe-table").VxeComponentSizeType>;
|
|
1261
|
+
};
|
|
1259
1262
|
data: {
|
|
1260
1263
|
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.Data<any>>;
|
|
1261
1264
|
};
|
|
@@ -1285,9 +1288,6 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
|
|
|
1285
1288
|
params: {
|
|
1286
1289
|
type: import("vue").PropType<any>;
|
|
1287
1290
|
};
|
|
1288
|
-
size: {
|
|
1289
|
-
type: import("vue").PropType<import("vxe-table").VxeComponentSizeType>;
|
|
1290
|
-
};
|
|
1291
1291
|
immediate: {
|
|
1292
1292
|
type: import("vue").PropType<boolean>;
|
|
1293
1293
|
default: boolean;
|
|
@@ -2,24 +2,24 @@ import { defineComponent as T, useAttrs as ee, ref as d, getCurrentInstance as a
|
|
|
2
2
|
import { VftEmpty as se } from "../empty/index.js";
|
|
3
3
|
import { vLoading as ge } from "../loading/directive.js";
|
|
4
4
|
import { deepMerge as _, omit as de, isFunction as ue } from "@vft/utils";
|
|
5
|
+
import { FormCompEnum as fe } from "../../utils/form-register.js";
|
|
5
6
|
import "@vueuse/core";
|
|
6
7
|
import "../config-provider/hooks/use-global-config.js";
|
|
7
8
|
import "lodash-es";
|
|
8
|
-
import { useNamespace as
|
|
9
|
+
import { useNamespace as me } from "../../hooks/use-namespace/index.js";
|
|
9
10
|
import "../../hooks/use-model-toggle/index.js";
|
|
10
11
|
import "@popperjs/core";
|
|
11
12
|
import "../../hooks/use-z-index/index.js";
|
|
12
13
|
import "../icon/index.js";
|
|
13
|
-
import { VftPagination as
|
|
14
|
-
import { VftSuperForm as
|
|
15
|
-
import { VxeGrid as
|
|
16
|
-
import
|
|
17
|
-
import { PAGE_SIZE as
|
|
18
|
-
import { useColumns as
|
|
19
|
-
import { useDataSource as
|
|
20
|
-
import { useLoading as
|
|
21
|
-
import { usePagination as
|
|
22
|
-
import { FormCompEnum as ke } from "../super-form/component-map.js";
|
|
14
|
+
import { VftPagination as pe } from "../pagination/index.js";
|
|
15
|
+
import { VftSuperForm as he } from "../super-form/index.js";
|
|
16
|
+
import { VxeGrid as be } from "vxe-table";
|
|
17
|
+
import Ce from "xe-utils";
|
|
18
|
+
import { PAGE_SIZE as ye } from "./constants.js";
|
|
19
|
+
import { useColumns as we } from "./use/use-columns.js";
|
|
20
|
+
import { useDataSource as ve } from "./use/use-data-source.js";
|
|
21
|
+
import { useLoading as xe } from "./use/use-loading.js";
|
|
22
|
+
import { usePagination as ke } from "./use/use-pagination.js";
|
|
23
23
|
import { useForm as Se } from "../super-form/use/use-form.js";
|
|
24
24
|
import { EmptyEnum as Be } from "../empty/constants.js";
|
|
25
25
|
const ze = {
|
|
@@ -34,7 +34,7 @@ const ze = {
|
|
|
34
34
|
},
|
|
35
35
|
api: {},
|
|
36
36
|
pageSize: {
|
|
37
|
-
default:
|
|
37
|
+
default: ye
|
|
38
38
|
},
|
|
39
39
|
total: {},
|
|
40
40
|
rowkey: {
|
|
@@ -387,18 +387,18 @@ const ze = {
|
|
|
387
387
|
expose: F,
|
|
388
388
|
emit: A
|
|
389
389
|
}) {
|
|
390
|
-
const i =
|
|
390
|
+
const i = me("table"), l = A, E = ee(), p = d(), N = d([]), s = d(), O = ae(), t = u(() => _(O.props, e(s))), {
|
|
391
391
|
getLoading: V,
|
|
392
392
|
setLoading: I
|
|
393
|
-
} =
|
|
393
|
+
} = xe(t), {
|
|
394
394
|
getPaginationInfo: c,
|
|
395
395
|
setPagination: g,
|
|
396
396
|
getShowPagination: h,
|
|
397
397
|
getCurrentPage: q
|
|
398
|
-
} =
|
|
398
|
+
} = ke(t), {
|
|
399
399
|
getViewColumns: G,
|
|
400
400
|
setColumns: K
|
|
401
|
-
} =
|
|
401
|
+
} = we(t);
|
|
402
402
|
te(() => q(), (a) => {
|
|
403
403
|
oe(() => {
|
|
404
404
|
b({
|
|
@@ -428,7 +428,7 @@ const ze = {
|
|
|
428
428
|
getDataSource: W,
|
|
429
429
|
getRawDataSource: w,
|
|
430
430
|
tableSearch: v
|
|
431
|
-
} =
|
|
431
|
+
} = ve(t, {
|
|
432
432
|
tableData: N,
|
|
433
433
|
setLoading: I,
|
|
434
434
|
getPaginationInfo: c,
|
|
@@ -565,7 +565,7 @@ const ze = {
|
|
|
565
565
|
"toolbar-tool-click",
|
|
566
566
|
"zoom"
|
|
567
567
|
].forEach((a) => {
|
|
568
|
-
const o =
|
|
568
|
+
const o = Ce.camelCase(`on-${a}`);
|
|
569
569
|
k[o] = (...n) => l(a, ...n);
|
|
570
570
|
});
|
|
571
571
|
const r = u(() => {
|
|
@@ -600,7 +600,7 @@ const ze = {
|
|
|
600
600
|
const Z = {
|
|
601
601
|
field: "_filterTableData",
|
|
602
602
|
label: "",
|
|
603
|
-
type:
|
|
603
|
+
type: fe.SEARCH,
|
|
604
604
|
componentProps: ({}) => ({
|
|
605
605
|
onChange: (a) => {
|
|
606
606
|
B({
|
|
@@ -637,11 +637,11 @@ const ze = {
|
|
|
637
637
|
...S
|
|
638
638
|
}), (a, o) => (f(), re("div", {
|
|
639
639
|
class: ne(e(i).b())
|
|
640
|
-
}, [z(e(
|
|
640
|
+
}, [z(e(be), D({
|
|
641
641
|
ref_key: "xGrid",
|
|
642
642
|
ref: p
|
|
643
643
|
}, r.value), {
|
|
644
|
-
toolbarButtons: m(() => [H(a.$slots, "toolbar-left"), r.value?.formOptions?.showActionForm ? (f(), R(e(
|
|
644
|
+
toolbarButtons: m(() => [H(a.$slots, "toolbar-left"), r.value?.formOptions?.showActionForm ? (f(), R(e(he), {
|
|
645
645
|
key: 0,
|
|
646
646
|
onRegister: e(J),
|
|
647
647
|
onSubmit: B,
|
|
@@ -652,7 +652,7 @@ const ze = {
|
|
|
652
652
|
}, null, 8, ["type"])]),
|
|
653
653
|
loading: m(() => [ce(ie("div", ze, null, 512), [[e(ge), r.value.loading]])]),
|
|
654
654
|
_: 3
|
|
655
|
-
}, 16), r.value.showPager && e(h) ? (f(), R(e(
|
|
655
|
+
}, 16), r.value.showPager && e(h) ? (f(), R(e(pe), D({
|
|
656
656
|
key: 0
|
|
657
657
|
}, e(c), {
|
|
658
658
|
class: [e(i).e("pager"), e(i).m("pager-" + e(c).pagePlacement)],
|