@aplus-frontend/ui 0.5.23 → 0.5.24
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/src/ap-form/ap-form.vue.d.ts +2 -2
- package/es/src/ap-form/ap-form.vue2.mjs +124 -124
- package/es/src/ap-form/drawer-form/index.vue.d.ts +5 -5
- package/es/src/ap-form/interface.d.ts +3 -2
- package/es/src/ap-form/modal-form/index.vue.d.ts +5 -5
- package/es/src/ap-form/search-form/index.vue.d.ts +5 -5
- package/es/src/ap-grid/editable/form-item.vue.mjs +65 -61
- package/es/src/ap-grid/editable/index.vue.mjs +86 -81
- package/es/src/ap-grid/index.vue.mjs +22 -22
- package/es/src/ap-grid/interface.d.ts +4 -0
- package/es/src/ap-grid/utils/table.d.ts +1 -1
- package/es/src/ap-grid/utils/table.mjs +42 -41
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +108 -102
- package/es/src/work-order-modal/work-order-modal.vue.d.ts +3 -3
- package/lib/src/ap-form/ap-form.vue.d.ts +2 -2
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/drawer-form/index.vue.d.ts +5 -5
- package/lib/src/ap-form/interface.d.ts +3 -2
- package/lib/src/ap-form/modal-form/index.vue.d.ts +5 -5
- package/lib/src/ap-form/search-form/index.vue.d.ts +5 -5
- package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ap-grid/editable/index.vue.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/interface.d.ts +4 -0
- package/lib/src/ap-grid/utils/table.d.ts +1 -1
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
- package/lib/src/work-order-modal/work-order-modal.vue.d.ts +3 -3
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApFormProps, WatchFunc, ApFormInternalInstance } from './interface';
|
|
1
|
+
import { ApFormProps, UpdateModelOptimizeFn, WatchFunc, ApFormInternalInstance } from './interface';
|
|
2
2
|
import { InternalNamePath, NamePath, ValidateOptions, FormLabelAlign, ValidateMessages, FieldData, ValidateErrorEntity } from '@aplus-frontend/antdv/es/form/interface';
|
|
3
3
|
import { Recordable } from '../type';
|
|
4
4
|
import { CreateComponentPublicInstanceWithMixins, ExtractPropTypes, PropType, HTMLAttributes, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, DefineComponent } from 'vue';
|
|
@@ -655,7 +655,7 @@ declare function __VLS_template(): {
|
|
|
655
655
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
656
656
|
declare const __VLS_component: DefineComponent<ApFormProps, {
|
|
657
657
|
setFieldsValue: (fields: Partial<any>) => void;
|
|
658
|
-
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean) => void;
|
|
658
|
+
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean, optimizeFn?: UpdateModelOptimizeFn) => void;
|
|
659
659
|
resetFields: () => Promise<void>;
|
|
660
660
|
clearValidate: (name?: NamePath) => void;
|
|
661
661
|
validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Form as
|
|
3
|
-
import { useProvideForm as
|
|
4
|
-
import { isArray as f, cloneDeep as ae, isFunction as
|
|
1
|
+
import { defineComponent as Q, reactive as X, ref as j, unref as p, nextTick as Y, toRaw as x, watch as Z, onWatcherCleanup as z, computed as ee, createBlock as te, openBlock as re, mergeProps as le, withCtx as oe, renderSlot as se } from "vue";
|
|
2
|
+
import { Form as ie } from "@aplus-frontend/antdv";
|
|
3
|
+
import { useProvideForm as ne } from "./context.mjs";
|
|
4
|
+
import { isArray as f, cloneDeep as ae, isFunction as _, isPlainObject as B, omit as ue } from "lodash-unified";
|
|
5
5
|
import { useUrlSearchParams as ce } from "@vueuse/core";
|
|
6
6
|
import { INTERNAL_FORM_INSTANCE_MARK as fe } from "./constant.mjs";
|
|
7
|
-
import { getRouteType as de, isDef as
|
|
8
|
-
import
|
|
9
|
-
import { genParams as
|
|
10
|
-
import { useInjectFormProvider as
|
|
11
|
-
const Re = /* @__PURE__ */
|
|
7
|
+
import { getRouteType as de, isDef as V } from "../utils/index.mjs";
|
|
8
|
+
import ge from "./utils/set.mjs";
|
|
9
|
+
import { genParams as M, setToParams as E } from "./utils/params.mjs";
|
|
10
|
+
import { useInjectFormProvider as Fe } from "./provider/context.mjs";
|
|
11
|
+
const Re = /* @__PURE__ */ Q({
|
|
12
12
|
__name: "ap-form",
|
|
13
13
|
props: {
|
|
14
14
|
layout: { default: "horizontal" },
|
|
@@ -38,197 +38,197 @@ const Re = /* @__PURE__ */ J({
|
|
|
38
38
|
syncToUrl: { type: [Boolean, Function], default: !1 },
|
|
39
39
|
syncToUrlPriority: { type: Boolean }
|
|
40
40
|
},
|
|
41
|
-
setup(
|
|
42
|
-
function
|
|
43
|
-
return f(t) ? t.reduce((r,
|
|
41
|
+
setup(A, { expose: C }) {
|
|
42
|
+
function N(e, t) {
|
|
43
|
+
return f(t) ? t.reduce((r, o) => r == null ? void 0 : r[o], e) : e == null ? void 0 : e[t];
|
|
44
44
|
}
|
|
45
|
-
const
|
|
46
|
-
function
|
|
47
|
-
var
|
|
45
|
+
const l = A;
|
|
46
|
+
function v(e, t, r = !0, o) {
|
|
47
|
+
var s;
|
|
48
48
|
if (f(e)) {
|
|
49
|
-
let
|
|
50
|
-
for (let
|
|
51
|
-
e[
|
|
52
|
-
|
|
49
|
+
let a = n;
|
|
50
|
+
for (let d = 0; d < e.length - 1; d++)
|
|
51
|
+
e[d] in a || (a[e[d]] = {}), a = a[e[d]];
|
|
52
|
+
o ? o(a, e[e.length - 1]) : a[e[e.length - 1]] = t;
|
|
53
53
|
} else
|
|
54
|
-
|
|
54
|
+
o ? o(n, e) : n[e] = t;
|
|
55
55
|
let i = f(e) ? e[0] : e;
|
|
56
56
|
if (r) {
|
|
57
|
-
const
|
|
58
|
-
|
|
57
|
+
const a = { [i]: n[i] };
|
|
58
|
+
y.triggerFormChange(l.name, a), (s = l.onValuesChange) == null || s.call(l, a, n, e);
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
T();
|
|
61
61
|
}
|
|
62
|
-
const
|
|
63
|
-
|
|
62
|
+
const u = j(), I = ce(de()), y = Fe(), P = j(
|
|
63
|
+
l.syncToUrl ? M(l.syncToUrl, I, "get") : {}
|
|
64
64
|
);
|
|
65
|
-
let m = ae(
|
|
66
|
-
const
|
|
65
|
+
let m = ae(b()), g = {};
|
|
66
|
+
const n = X(b());
|
|
67
67
|
let F = [];
|
|
68
|
-
function
|
|
69
|
-
const e =
|
|
70
|
-
return
|
|
68
|
+
function b() {
|
|
69
|
+
const e = l.initialValues || {};
|
|
70
|
+
return l.syncToUrlPriority ? {
|
|
71
71
|
...e,
|
|
72
|
-
...
|
|
72
|
+
...p(P)
|
|
73
73
|
} : {
|
|
74
|
-
...
|
|
74
|
+
...p(P),
|
|
75
75
|
...e
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function S(e) {
|
|
79
79
|
var r;
|
|
80
|
-
const t =
|
|
81
|
-
|
|
80
|
+
const t = h(e, g);
|
|
81
|
+
y.triggerFormFinish(l.name, e), l.syncToUrl && E(I, M(l.syncToUrl, t, "set")), (r = l.onFinish) == null || r.call(l, t);
|
|
82
82
|
}
|
|
83
|
-
const
|
|
83
|
+
const W = async () => {
|
|
84
84
|
var e;
|
|
85
|
-
(e =
|
|
86
|
-
Object.keys(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
(e = u.value) == null || e.resetFields(), await Y(() => {
|
|
86
|
+
Object.keys(n).forEach((t) => delete n[t]), Object.assign(n, m), T(), l.syncToUrl && E(
|
|
87
|
+
I,
|
|
88
|
+
M(
|
|
89
|
+
l.syncToUrl,
|
|
90
|
+
h(m, g),
|
|
91
91
|
"set"
|
|
92
92
|
)
|
|
93
93
|
);
|
|
94
94
|
});
|
|
95
|
-
},
|
|
95
|
+
}, q = (e) => {
|
|
96
96
|
var t;
|
|
97
|
-
(t =
|
|
98
|
-
},
|
|
97
|
+
(t = u.value) == null || t.clearValidate(e);
|
|
98
|
+
}, D = (e, t) => {
|
|
99
99
|
var r;
|
|
100
|
-
return (r =
|
|
101
|
-
},
|
|
102
|
-
var
|
|
103
|
-
const r = await ((
|
|
100
|
+
return (r = u.value) == null ? void 0 : r.validateFields(e, t);
|
|
101
|
+
}, L = async (e, t) => {
|
|
102
|
+
var o;
|
|
103
|
+
const r = await ((o = u.value) == null ? void 0 : o.validateFields(
|
|
104
104
|
e,
|
|
105
105
|
t
|
|
106
106
|
));
|
|
107
|
-
return
|
|
108
|
-
},
|
|
107
|
+
return h(r, g);
|
|
108
|
+
}, k = (e) => {
|
|
109
109
|
var t;
|
|
110
|
-
return (t =
|
|
111
|
-
},
|
|
110
|
+
return (t = u.value) == null ? void 0 : t.getFieldsValue(e);
|
|
111
|
+
}, K = (e) => {
|
|
112
112
|
var r;
|
|
113
|
-
const t = (r =
|
|
114
|
-
return
|
|
115
|
-
},
|
|
113
|
+
const t = (r = u.value) == null ? void 0 : r.getFieldsValue(e);
|
|
114
|
+
return h(t, g);
|
|
115
|
+
}, $ = (e, t) => {
|
|
116
116
|
var r;
|
|
117
|
-
return (r =
|
|
118
|
-
},
|
|
117
|
+
return (r = u.value) == null ? void 0 : r.validate(e, t);
|
|
118
|
+
}, G = (e, t = {}) => {
|
|
119
119
|
var r;
|
|
120
|
-
(r =
|
|
121
|
-
},
|
|
122
|
-
Object.assign(
|
|
123
|
-
},
|
|
124
|
-
|
|
120
|
+
(r = u.value) == null || r.scrollToField(e, t);
|
|
121
|
+
}, H = (e) => {
|
|
122
|
+
Object.assign(n, e), T();
|
|
123
|
+
}, U = (e, t, r = !0, o) => {
|
|
124
|
+
v(e, t, r, o), T();
|
|
125
125
|
};
|
|
126
|
-
function
|
|
127
|
-
return t || e(
|
|
126
|
+
function R(e, t) {
|
|
127
|
+
return t || e(x(n)), F.push(e), () => {
|
|
128
128
|
F = F.filter((r) => r !== e);
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
|
-
function
|
|
132
|
-
if (
|
|
133
|
-
const
|
|
134
|
-
if (!
|
|
135
|
-
if (
|
|
136
|
-
let
|
|
137
|
-
for (let
|
|
138
|
-
|
|
139
|
-
|
|
131
|
+
function w({ initialValue: e, name: t, transform: r }) {
|
|
132
|
+
if (V(e) && V(t)) {
|
|
133
|
+
const o = N(p(P), t);
|
|
134
|
+
if (!V(o) || !l.syncToUrlPriority)
|
|
135
|
+
if (v(t, e, !1), f(t)) {
|
|
136
|
+
let i = m;
|
|
137
|
+
for (let s = 0; s < t.length - 1; s++)
|
|
138
|
+
V(i[t[s]]) || (i[t[s]] = {}), i = i[t[s]];
|
|
139
|
+
i[t[t.length - 1]] = e;
|
|
140
140
|
} else
|
|
141
141
|
m[t] = e;
|
|
142
142
|
}
|
|
143
|
-
r && (
|
|
144
|
-
|
|
143
|
+
r && (g = ge(
|
|
144
|
+
g,
|
|
145
145
|
[t].flat(1),
|
|
146
146
|
r,
|
|
147
147
|
!0
|
|
148
148
|
));
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function J(e) {
|
|
151
151
|
if (e !== fe) {
|
|
152
152
|
console.warn("getInternalInstance should only used at internal");
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
155
|
return {
|
|
156
|
-
registerField:
|
|
157
|
-
registerWatch:
|
|
158
|
-
setFieldValue:
|
|
156
|
+
registerField: w,
|
|
157
|
+
registerWatch: R,
|
|
158
|
+
setFieldValue: U
|
|
159
159
|
};
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function T() {
|
|
162
162
|
if (F.length) {
|
|
163
|
-
const e =
|
|
163
|
+
const e = x(n);
|
|
164
164
|
F.forEach((t) => {
|
|
165
165
|
t(e);
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function h(e, t) {
|
|
170
170
|
if (e == null)
|
|
171
171
|
return;
|
|
172
172
|
let r = f(e) ? [] : {};
|
|
173
|
-
return Object.keys(e).forEach((
|
|
174
|
-
const
|
|
175
|
-
if (
|
|
176
|
-
const c =
|
|
177
|
-
|
|
173
|
+
return Object.keys(e).forEach((o) => {
|
|
174
|
+
const i = e[o], s = t == null ? void 0 : t[o], a = _(s) ? s : s == null ? void 0 : s.transformer, d = _(s) ? !0 : s == null ? void 0 : s.flat;
|
|
175
|
+
if (_(a)) {
|
|
176
|
+
const c = a(i);
|
|
177
|
+
d ? f(c) && f(r) ? r = [...r, ...c] : B(c) && B(r) ? r = {
|
|
178
178
|
...r,
|
|
179
179
|
...c
|
|
180
|
-
} : r[
|
|
181
|
-
} else if (
|
|
182
|
-
const c =
|
|
183
|
-
|
|
184
|
-
|
|
180
|
+
} : r[o] = c : r[o] = c;
|
|
181
|
+
} else if (B(i) || f(i)) {
|
|
182
|
+
const c = h(
|
|
183
|
+
i,
|
|
184
|
+
s
|
|
185
185
|
);
|
|
186
|
-
r[
|
|
186
|
+
r[o] = c;
|
|
187
187
|
} else
|
|
188
|
-
r[
|
|
188
|
+
r[o] = i;
|
|
189
189
|
}), r;
|
|
190
190
|
}
|
|
191
|
-
const
|
|
192
|
-
resetFields:
|
|
193
|
-
clearValidate:
|
|
194
|
-
validateFields:
|
|
195
|
-
getFieldsValue:
|
|
196
|
-
validate:
|
|
197
|
-
scrollToField:
|
|
198
|
-
setFieldsValue:
|
|
199
|
-
setFieldValue:
|
|
200
|
-
registerWatch:
|
|
201
|
-
validateFieldsReturnTransformed:
|
|
202
|
-
getFieldsValueTransformed:
|
|
203
|
-
getInternalInstance:
|
|
191
|
+
const O = {
|
|
192
|
+
resetFields: W,
|
|
193
|
+
clearValidate: q,
|
|
194
|
+
validateFields: D,
|
|
195
|
+
getFieldsValue: k,
|
|
196
|
+
validate: $,
|
|
197
|
+
scrollToField: G,
|
|
198
|
+
setFieldsValue: H,
|
|
199
|
+
setFieldValue: U,
|
|
200
|
+
registerWatch: R,
|
|
201
|
+
validateFieldsReturnTransformed: L,
|
|
202
|
+
getFieldsValueTransformed: K,
|
|
203
|
+
getInternalInstance: J
|
|
204
204
|
};
|
|
205
|
-
return
|
|
206
|
-
() =>
|
|
205
|
+
return Z(
|
|
206
|
+
() => l.name,
|
|
207
207
|
(e) => {
|
|
208
|
-
e && (
|
|
209
|
-
|
|
208
|
+
e && (y.registerForm(e, O), z(() => {
|
|
209
|
+
y.unregisterForm(l.name);
|
|
210
210
|
}));
|
|
211
211
|
},
|
|
212
212
|
{
|
|
213
213
|
immediate: !0
|
|
214
214
|
}
|
|
215
|
-
),
|
|
216
|
-
model: ee(() =>
|
|
217
|
-
updateModel:
|
|
215
|
+
), ne({
|
|
216
|
+
model: ee(() => n),
|
|
217
|
+
updateModel: v,
|
|
218
218
|
internalInstance: {
|
|
219
|
-
registerWatch:
|
|
220
|
-
registerField:
|
|
221
|
-
setFieldValue:
|
|
219
|
+
registerWatch: R,
|
|
220
|
+
registerField: w,
|
|
221
|
+
setFieldValue: U
|
|
222
222
|
}
|
|
223
|
-
}),
|
|
223
|
+
}), C(O), (e, t) => (re(), te(p(ie), le({
|
|
224
224
|
ref_key: "formRef",
|
|
225
|
-
ref:
|
|
226
|
-
},
|
|
227
|
-
model:
|
|
228
|
-
onFinish:
|
|
225
|
+
ref: u
|
|
226
|
+
}, p(ue)(l, ["initialValues", "onValuesChange", "onFinish"]), {
|
|
227
|
+
model: n,
|
|
228
|
+
onFinish: S
|
|
229
229
|
}), {
|
|
230
230
|
default: oe(() => [
|
|
231
|
-
|
|
231
|
+
se(e.$slots, "default")
|
|
232
232
|
]),
|
|
233
233
|
_: 3
|
|
234
234
|
}, 16, ["model"]));
|
|
@@ -9,7 +9,7 @@ import { Options } from '../../../node_modules/scroll-into-view-if-needed';
|
|
|
9
9
|
import { Recordable } from '../../type';
|
|
10
10
|
import { VueTypeDef, VueTypeValidableDef } from '../../../node_modules/vue-types';
|
|
11
11
|
import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
|
|
12
|
-
import { ApFormProps, ApFormInternalInstance, WatchFunc, ApFormSubmitterConfig } from '..';
|
|
12
|
+
import { ApFormProps, UpdateModelOptimizeFn, ApFormInternalInstance, WatchFunc, ApFormSubmitterConfig } from '..';
|
|
13
13
|
import { OnCleanup } from '@vue/reactivity';
|
|
14
14
|
import { PushState } from '@aplus-frontend/antdv/es/drawer';
|
|
15
15
|
import { MouseEventHandler, KeyboardEventHandler } from '@aplus-frontend/antdv/es/_util/EventInterface';
|
|
@@ -771,7 +771,7 @@ declare function __VLS_template(): {
|
|
|
771
771
|
$el: any;
|
|
772
772
|
$options: ComponentOptionsBase<Readonly< ApFormProps> & Readonly<{}>, {
|
|
773
773
|
setFieldsValue: (fields: Partial<any>) => void;
|
|
774
|
-
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean) => void;
|
|
774
|
+
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean, optimizeFn?: UpdateModelOptimizeFn) => void;
|
|
775
775
|
resetFields: () => Promise<void>;
|
|
776
776
|
clearValidate: (name?: NamePath) => void;
|
|
777
777
|
validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
|
|
@@ -820,7 +820,7 @@ declare function __VLS_template(): {
|
|
|
820
820
|
syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
|
|
821
821
|
}> & Omit<Readonly< ApFormProps> & Readonly<{}>, "validate" | "resetFields" | "clearValidate" | "validateFields" | "getFieldsValue" | "scrollToField" | "registerWatch" | "setFieldValue" | ("layout" | "colon" | "labelAlign" | "validateTrigger" | "hideRequiredMark" | "validateOnRuleChange" | "syncToUrl") | "setFieldsValue" | "getInternalInstance" | "validateFieldsReturnTransformed" | "getFieldsValueTransformed"> & ShallowUnwrapRef<{
|
|
822
822
|
setFieldsValue: (fields: Partial<any>) => void;
|
|
823
|
-
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean) => void;
|
|
823
|
+
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean, optimizeFn?: UpdateModelOptimizeFn) => void;
|
|
824
824
|
resetFields: () => Promise<void>;
|
|
825
825
|
clearValidate: (name?: NamePath) => void;
|
|
826
826
|
validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
|
|
@@ -1713,7 +1713,7 @@ declare const __VLS_component: DefineComponent<ApFormDrawerFormProps, {
|
|
|
1713
1713
|
$el: any;
|
|
1714
1714
|
$options: ComponentOptionsBase<Readonly< ApFormProps> & Readonly<{}>, {
|
|
1715
1715
|
setFieldsValue: (fields: Partial<any>) => void;
|
|
1716
|
-
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean) => void;
|
|
1716
|
+
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean, optimizeFn?: UpdateModelOptimizeFn) => void;
|
|
1717
1717
|
resetFields: () => Promise<void>;
|
|
1718
1718
|
clearValidate: (name?: NamePath) => void;
|
|
1719
1719
|
validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
|
|
@@ -1762,7 +1762,7 @@ declare const __VLS_component: DefineComponent<ApFormDrawerFormProps, {
|
|
|
1762
1762
|
syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
|
|
1763
1763
|
}> & Omit<Readonly< ApFormProps> & Readonly<{}>, "validate" | "resetFields" | "clearValidate" | "validateFields" | "getFieldsValue" | "scrollToField" | "registerWatch" | "setFieldValue" | ("layout" | "colon" | "labelAlign" | "validateTrigger" | "hideRequiredMark" | "validateOnRuleChange" | "syncToUrl") | "setFieldsValue" | "getInternalInstance" | "validateFieldsReturnTransformed" | "getFieldsValueTransformed"> & ShallowUnwrapRef<{
|
|
1764
1764
|
setFieldsValue: (fields: Partial<any>) => void;
|
|
1765
|
-
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean) => void;
|
|
1765
|
+
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean, optimizeFn?: UpdateModelOptimizeFn) => void;
|
|
1766
1766
|
resetFields: () => Promise<void>;
|
|
1767
1767
|
clearValidate: (name?: NamePath) => void;
|
|
1768
1768
|
validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
|
|
@@ -58,9 +58,10 @@ export type ApFormProps = Omit<FormProps, 'model' | 'onValuesChange'> & {
|
|
|
58
58
|
syncToUrlPriority?: boolean;
|
|
59
59
|
};
|
|
60
60
|
export type WatchFunc = (values?: Recordable) => void;
|
|
61
|
+
export type UpdateModelOptimizeFn = (currentModelValue: any, name: string | number) => void;
|
|
61
62
|
export type ApFormExpose<ModelType = any> = {
|
|
62
63
|
setFieldsValue: (fields: Partial<ModelType>) => void;
|
|
63
|
-
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean) => void;
|
|
64
|
+
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean, optimizeFn?: UpdateModelOptimizeFn) => void;
|
|
64
65
|
resetFields: () => Promise<void>;
|
|
65
66
|
clearValidate: (name?: NamePath) => void;
|
|
66
67
|
validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<ModelType>> | undefined;
|
|
@@ -117,7 +118,7 @@ export type ApFormInternalInstance = {
|
|
|
117
118
|
* @param triggerChange
|
|
118
119
|
* @returns
|
|
119
120
|
*/
|
|
120
|
-
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean) => void;
|
|
121
|
+
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean, optimizeFn?: UpdateModelOptimizeFn) => void;
|
|
121
122
|
};
|
|
122
123
|
export type ApFormItemExpose = FormItemExpose & {
|
|
123
124
|
/**
|
|
@@ -9,7 +9,7 @@ import { RuleObject } from '@aplus-frontend/antdv/es/form';
|
|
|
9
9
|
import { Options } from '../../../node_modules/scroll-into-view-if-needed';
|
|
10
10
|
import { VueTypeDef, VueTypeValidableDef } from '../../../node_modules/vue-types';
|
|
11
11
|
import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
|
|
12
|
-
import { ApFormProps, ApFormInternalInstance, WatchFunc, ApFormSubmitterConfig } from '..';
|
|
12
|
+
import { ApFormProps, UpdateModelOptimizeFn, ApFormInternalInstance, WatchFunc, ApFormSubmitterConfig } from '..';
|
|
13
13
|
import { OnCleanup } from '@vue/reactivity';
|
|
14
14
|
import { LegacyButtonType, ButtonHTMLType } from '@aplus-frontend/antdv/es/button/buttonTypes';
|
|
15
15
|
import { MouseEventHandler } from '@aplus-frontend/antdv/es/_util/EventInterface';
|
|
@@ -771,7 +771,7 @@ declare function __VLS_template(): {
|
|
|
771
771
|
$el: any;
|
|
772
772
|
$options: ComponentOptionsBase<Readonly< ApFormProps> & Readonly<{}>, {
|
|
773
773
|
setFieldsValue: (fields: Partial<any>) => void;
|
|
774
|
-
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean) => void;
|
|
774
|
+
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean, optimizeFn?: UpdateModelOptimizeFn) => void;
|
|
775
775
|
resetFields: () => Promise<void>;
|
|
776
776
|
clearValidate: (name?: NamePath) => void;
|
|
777
777
|
validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
|
|
@@ -820,7 +820,7 @@ declare function __VLS_template(): {
|
|
|
820
820
|
syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
|
|
821
821
|
}> & Omit<Readonly< ApFormProps> & Readonly<{}>, "validate" | "resetFields" | "clearValidate" | "validateFields" | "getFieldsValue" | "scrollToField" | "registerWatch" | "setFieldValue" | ("layout" | "colon" | "labelAlign" | "validateTrigger" | "hideRequiredMark" | "validateOnRuleChange" | "syncToUrl") | "setFieldsValue" | "getInternalInstance" | "validateFieldsReturnTransformed" | "getFieldsValueTransformed"> & ShallowUnwrapRef<{
|
|
822
822
|
setFieldsValue: (fields: Partial<any>) => void;
|
|
823
|
-
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean) => void;
|
|
823
|
+
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean, optimizeFn?: UpdateModelOptimizeFn) => void;
|
|
824
824
|
resetFields: () => Promise<void>;
|
|
825
825
|
clearValidate: (name?: NamePath) => void;
|
|
826
826
|
validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
|
|
@@ -1901,7 +1901,7 @@ declare const __VLS_component: DefineComponent<ApFormModalFormProps, {
|
|
|
1901
1901
|
$el: any;
|
|
1902
1902
|
$options: ComponentOptionsBase<Readonly< ApFormProps> & Readonly<{}>, {
|
|
1903
1903
|
setFieldsValue: (fields: Partial<any>) => void;
|
|
1904
|
-
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean) => void;
|
|
1904
|
+
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean, optimizeFn?: UpdateModelOptimizeFn) => void;
|
|
1905
1905
|
resetFields: () => Promise<void>;
|
|
1906
1906
|
clearValidate: (name?: NamePath) => void;
|
|
1907
1907
|
validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
|
|
@@ -1950,7 +1950,7 @@ declare const __VLS_component: DefineComponent<ApFormModalFormProps, {
|
|
|
1950
1950
|
syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
|
|
1951
1951
|
}> & Omit<Readonly< ApFormProps> & Readonly<{}>, "validate" | "resetFields" | "clearValidate" | "validateFields" | "getFieldsValue" | "scrollToField" | "registerWatch" | "setFieldValue" | ("layout" | "colon" | "labelAlign" | "validateTrigger" | "hideRequiredMark" | "validateOnRuleChange" | "syncToUrl") | "setFieldsValue" | "getInternalInstance" | "validateFieldsReturnTransformed" | "getFieldsValueTransformed"> & ShallowUnwrapRef<{
|
|
1952
1952
|
setFieldsValue: (fields: Partial<any>) => void;
|
|
1953
|
-
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean) => void;
|
|
1953
|
+
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean, optimizeFn?: UpdateModelOptimizeFn) => void;
|
|
1954
1954
|
resetFields: () => Promise<void>;
|
|
1955
1955
|
clearValidate: (name?: NamePath) => void;
|
|
1956
1956
|
validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
|
|
@@ -9,7 +9,7 @@ import { Options } from '../../../node_modules/scroll-into-view-if-needed';
|
|
|
9
9
|
import { Recordable } from '../../type';
|
|
10
10
|
import { VueTypeDef, VueTypeValidableDef } from '../../../node_modules/vue-types';
|
|
11
11
|
import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
|
|
12
|
-
import { ApFormProps, ApFormInternalInstance, WatchFunc } from '..';
|
|
12
|
+
import { ApFormProps, UpdateModelOptimizeFn, ApFormInternalInstance, WatchFunc } from '..';
|
|
13
13
|
import { OnCleanup } from '@vue/reactivity';
|
|
14
14
|
declare function __VLS_template(): {
|
|
15
15
|
attrs: Partial<{}>;
|
|
@@ -769,7 +769,7 @@ declare function __VLS_template(): {
|
|
|
769
769
|
$el: any;
|
|
770
770
|
$options: ComponentOptionsBase<Readonly< ApFormProps> & Readonly<{}>, {
|
|
771
771
|
setFieldsValue: (fields: Partial<any>) => void;
|
|
772
|
-
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean) => void;
|
|
772
|
+
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean, optimizeFn?: UpdateModelOptimizeFn) => void;
|
|
773
773
|
resetFields: () => Promise<void>;
|
|
774
774
|
clearValidate: (name?: NamePath) => void;
|
|
775
775
|
validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
|
|
@@ -818,7 +818,7 @@ declare function __VLS_template(): {
|
|
|
818
818
|
syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
|
|
819
819
|
}> & Omit<Readonly< ApFormProps> & Readonly<{}>, "validate" | "resetFields" | "clearValidate" | "validateFields" | "getFieldsValue" | "scrollToField" | "registerWatch" | "setFieldValue" | ("layout" | "colon" | "labelAlign" | "validateTrigger" | "hideRequiredMark" | "validateOnRuleChange" | "syncToUrl") | "setFieldsValue" | "getInternalInstance" | "validateFieldsReturnTransformed" | "getFieldsValueTransformed"> & ShallowUnwrapRef<{
|
|
820
820
|
setFieldsValue: (fields: Partial<any>) => void;
|
|
821
|
-
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean) => void;
|
|
821
|
+
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean, optimizeFn?: UpdateModelOptimizeFn) => void;
|
|
822
822
|
resetFields: () => Promise<void>;
|
|
823
823
|
clearValidate: (name?: NamePath) => void;
|
|
824
824
|
validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
|
|
@@ -1606,7 +1606,7 @@ declare const __VLS_component: DefineComponent<ApFormSearchFormProps, {
|
|
|
1606
1606
|
$el: any;
|
|
1607
1607
|
$options: ComponentOptionsBase<Readonly< ApFormProps> & Readonly<{}>, {
|
|
1608
1608
|
setFieldsValue: (fields: Partial<any>) => void;
|
|
1609
|
-
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean) => void;
|
|
1609
|
+
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean, optimizeFn?: UpdateModelOptimizeFn) => void;
|
|
1610
1610
|
resetFields: () => Promise<void>;
|
|
1611
1611
|
clearValidate: (name?: NamePath) => void;
|
|
1612
1612
|
validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
|
|
@@ -1655,7 +1655,7 @@ declare const __VLS_component: DefineComponent<ApFormSearchFormProps, {
|
|
|
1655
1655
|
syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
|
|
1656
1656
|
}> & Omit<Readonly< ApFormProps> & Readonly<{}>, "validate" | "resetFields" | "clearValidate" | "validateFields" | "getFieldsValue" | "scrollToField" | "registerWatch" | "setFieldValue" | ("layout" | "colon" | "labelAlign" | "validateTrigger" | "hideRequiredMark" | "validateOnRuleChange" | "syncToUrl") | "setFieldsValue" | "getInternalInstance" | "validateFieldsReturnTransformed" | "getFieldsValueTransformed"> & ShallowUnwrapRef<{
|
|
1657
1657
|
setFieldsValue: (fields: Partial<any>) => void;
|
|
1658
|
-
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean) => void;
|
|
1658
|
+
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean, optimizeFn?: UpdateModelOptimizeFn) => void;
|
|
1659
1659
|
resetFields: () => Promise<void>;
|
|
1660
1660
|
clearValidate: (name?: NamePath) => void;
|
|
1661
1661
|
validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
|