@aplus-frontend/ui 7.19.0-beta.2 → 7.19.0
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/ag-grid/editable/form-item.vue.mjs +87 -77
- package/es/src/ag-grid/editable/interface.d.ts +15 -1
- package/es/src/ap-form/ap-form.vue2.mjs +63 -61
- package/es/src/ap-form/interface.d.ts +4 -0
- package/es/src/ap-table/components/setting/modal/index.vue.mjs +59 -59
- package/es/src/ap-table/hooks/use-table-template-storage.mjs +41 -40
- package/es/src/business/ap-upload/components/MultipleFile.vue2.mjs +128 -112
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ag-grid/editable/interface.d.ts +15 -1
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/interface.d.ts +4 -0
- package/lib/src/ap-table/components/setting/modal/index.vue.js +1 -1
- package/lib/src/ap-table/hooks/use-table-template-storage.js +1 -1
- package/lib/src/business/ap-upload/components/MultipleFile.vue2.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { cloneDeep as u, isEqual as
|
|
3
|
-
import { ApForm as
|
|
4
|
-
import { useInjectForm as
|
|
5
|
-
import { useWatch as
|
|
6
|
-
import { getModelValue as
|
|
7
|
-
import { transformValues as
|
|
1
|
+
import { defineComponent as G, useSlots as W, ref as y, onMounted as U, watch as $, unref as r, createElementBlock as q, openBlock as J, Fragment as Q, createVNode as f, mergeProps as h, withCtx as C, createSlots as X, renderList as Y, renderSlot as Z, normalizeProps as ee, guardReactiveProps as oe } from "vue";
|
|
2
|
+
import { cloneDeep as u, isEqual as te, omit as ae } from "lodash-unified";
|
|
3
|
+
import { ApForm as b } from "../../ap-form/index.mjs";
|
|
4
|
+
import { useInjectForm as ne } from "../../ap-form/context.mjs";
|
|
5
|
+
import { useWatch as le } from "../../ap-form/hooks/use-watch.mjs";
|
|
6
|
+
import { getModelValue as re } from "../../ap-form/utils/get.mjs";
|
|
7
|
+
import { transformValues as ie } from "../../ap-form/utils/transform.mjs";
|
|
8
8
|
import "../../config-provider/index.mjs";
|
|
9
|
-
import { useGetEditableColumns as
|
|
10
|
-
import { useEditableFormItemApi as
|
|
9
|
+
import { useGetEditableColumns as se } from "../hooks/use-editable-columns.mjs";
|
|
10
|
+
import { useEditableFormItemApi as me } from "../hooks/use-editable-form-item-api.mjs";
|
|
11
11
|
import "../index.vue2.mjs";
|
|
12
|
-
import
|
|
13
|
-
import { getShadowName as
|
|
14
|
-
import { getColumnTransformOptions as
|
|
15
|
-
import { useNamespace as
|
|
16
|
-
import { useGlobalConfig as
|
|
17
|
-
import
|
|
18
|
-
const
|
|
12
|
+
import ue from "../style/editable.mjs";
|
|
13
|
+
import { getShadowName as de } from "../utils.mjs";
|
|
14
|
+
import { getColumnTransformOptions as pe, arrayToObject as R, getRowKey as fe } from "./utils.mjs";
|
|
15
|
+
import { useNamespace as ce } from "../../config-provider/hooks/use-namespace.mjs";
|
|
16
|
+
import { useGlobalConfig as we } from "../../config-provider/hooks/use-global-config.mjs";
|
|
17
|
+
import ge from "../index.vue.mjs";
|
|
18
|
+
const Ke = /* @__PURE__ */ G({
|
|
19
19
|
name: "EditableGrid",
|
|
20
20
|
__name: "form-item",
|
|
21
21
|
props: {
|
|
@@ -138,112 +138,122 @@ const Ne = /* @__PURE__ */ L({
|
|
|
138
138
|
name: {},
|
|
139
139
|
formItem: {}
|
|
140
140
|
},
|
|
141
|
-
setup(
|
|
141
|
+
setup(v, {
|
|
142
142
|
expose: B
|
|
143
143
|
}) {
|
|
144
|
-
const
|
|
145
|
-
b:
|
|
146
|
-
} =
|
|
147
|
-
internalInstance:
|
|
148
|
-
} =
|
|
149
|
-
function
|
|
150
|
-
const
|
|
151
|
-
if (!Object.keys(
|
|
144
|
+
const x = W(), a = v, {
|
|
145
|
+
b: S
|
|
146
|
+
} = ce("editable-aggrid"), I = ue("editable-aggrid"), m = y(), {
|
|
147
|
+
internalInstance: n
|
|
148
|
+
} = ne();
|
|
149
|
+
function F(e) {
|
|
150
|
+
const o = pe(a.columns || []);
|
|
151
|
+
if (!Object.keys(o).length || !e?.length)
|
|
152
152
|
return e;
|
|
153
|
-
let
|
|
154
|
-
for (const
|
|
155
|
-
|
|
156
|
-
return
|
|
153
|
+
let t = [];
|
|
154
|
+
for (const s of e)
|
|
155
|
+
t.push(ie(s, o));
|
|
156
|
+
return t;
|
|
157
157
|
}
|
|
158
|
-
const i =
|
|
159
|
-
let
|
|
160
|
-
|
|
161
|
-
const e =
|
|
162
|
-
e && (
|
|
158
|
+
const i = de(a.name);
|
|
159
|
+
let c = [];
|
|
160
|
+
U(() => {
|
|
161
|
+
const e = a.formItem?.initialValue ?? re(n?.getInitialValues() ?? {}, a.name);
|
|
162
|
+
e && (n?.updateInitialModel(i, R(u(e), a.rowKey)), c = u(e), l.value || j(u(e), "suffix", !0));
|
|
163
163
|
});
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
|
|
164
|
+
const l = y([]), T = le(a.name);
|
|
165
|
+
$(() => T.value, (e) => {
|
|
166
|
+
te(e, l.value) || w(e ?? u(c));
|
|
167
167
|
}, {
|
|
168
168
|
deep: !0,
|
|
169
169
|
flush: "post",
|
|
170
170
|
immediate: !0
|
|
171
171
|
});
|
|
172
|
-
const E =
|
|
173
|
-
add:
|
|
174
|
-
addMultiple:
|
|
175
|
-
__addMultiple:
|
|
176
|
-
remove:
|
|
172
|
+
const E = we("valueTypeMap"), V = se(a, E, i), {
|
|
173
|
+
add: N,
|
|
174
|
+
addMultiple: _,
|
|
175
|
+
__addMultiple: j,
|
|
176
|
+
remove: K,
|
|
177
177
|
removeByKey: k,
|
|
178
178
|
getRowData: D,
|
|
179
179
|
getRowsData: O,
|
|
180
180
|
setRowData: z,
|
|
181
181
|
clear: H,
|
|
182
182
|
refreshRowIds: d
|
|
183
|
-
} =
|
|
184
|
-
function
|
|
185
|
-
const e =
|
|
183
|
+
} = me(a, n, l, i);
|
|
184
|
+
function L() {
|
|
185
|
+
const e = m.value?._internalGridApi;
|
|
186
186
|
if (!d.value?.length || !e)
|
|
187
187
|
return;
|
|
188
|
-
const
|
|
188
|
+
const o = d.value.map((t) => e.getRowNode(t)).filter((t) => !!t);
|
|
189
189
|
e.refreshCells({
|
|
190
|
-
rowNodes:
|
|
190
|
+
rowNodes: o,
|
|
191
191
|
force: !0
|
|
192
192
|
}), d.value = [];
|
|
193
193
|
}
|
|
194
|
-
function
|
|
195
|
-
|
|
196
|
-
const
|
|
197
|
-
|
|
194
|
+
function w(e) {
|
|
195
|
+
l.value = [...e];
|
|
196
|
+
const o = R(e, a.rowKey);
|
|
197
|
+
n?.setFieldValue(a.name, [...e]), n?.setFieldValue(i, o);
|
|
198
198
|
}
|
|
199
|
-
function
|
|
200
|
-
const
|
|
201
|
-
|
|
199
|
+
function g(e, o) {
|
|
200
|
+
const t = e === "end" ? l.value.length - 1 : e;
|
|
201
|
+
m.value?.scrollToRow(t, o);
|
|
202
202
|
}
|
|
203
|
-
function M(e,
|
|
204
|
-
|
|
203
|
+
function M(e, o) {
|
|
204
|
+
m.value?.scrollToColumn(e, o);
|
|
205
|
+
}
|
|
206
|
+
function P(e, o) {
|
|
207
|
+
const t = [i, String(e), o].flat();
|
|
208
|
+
return n?.validateFields([t]);
|
|
209
|
+
}
|
|
210
|
+
function A(e) {
|
|
211
|
+
const t = r(l).map((s, p) => [i, String(fe(s, p, a.rowKey)), e].flat());
|
|
212
|
+
return n?.validateFields(t);
|
|
205
213
|
}
|
|
206
214
|
return B({
|
|
207
|
-
add:
|
|
208
|
-
addMultiple:
|
|
209
|
-
remove:
|
|
215
|
+
add: N,
|
|
216
|
+
addMultiple: _,
|
|
217
|
+
remove: K,
|
|
210
218
|
removeByKey: k,
|
|
211
219
|
getRowData: D,
|
|
212
220
|
getRowsData: O,
|
|
213
221
|
setRowData: z,
|
|
214
222
|
clear: H,
|
|
215
|
-
setTableData:
|
|
216
|
-
scrollTo:
|
|
217
|
-
scrollToRow:
|
|
223
|
+
setTableData: w,
|
|
224
|
+
scrollTo: g,
|
|
225
|
+
scrollToRow: g,
|
|
218
226
|
scrollToColumn: M,
|
|
219
|
-
|
|
220
|
-
|
|
227
|
+
validateCell: P,
|
|
228
|
+
validateColumn: A,
|
|
229
|
+
table: m
|
|
230
|
+
}), (e, o) => (J(), q(Q, null, [f(r(b).FormItem, {
|
|
221
231
|
hidden: "",
|
|
222
232
|
name: e.name,
|
|
223
233
|
"initial-value": e.formItem?.initialValue,
|
|
224
|
-
transform:
|
|
225
|
-
}, null, 8, ["name", "initial-value"]),
|
|
234
|
+
transform: F
|
|
235
|
+
}, null, 8, ["name", "initial-value"]), f(r(b).FormItem, h({
|
|
226
236
|
label: e.label
|
|
227
237
|
}, e.formItem), {
|
|
228
|
-
default:
|
|
238
|
+
default: C(() => [f(ge, h(r(ae)(a, ["name", "maxLength", "onChange", "defaultValue", "formItem"]), {
|
|
229
239
|
ref_key: "tableRef",
|
|
230
|
-
ref:
|
|
231
|
-
class: [
|
|
240
|
+
ref: m,
|
|
241
|
+
class: [r(S)(), r(I)],
|
|
232
242
|
size: "mini",
|
|
233
|
-
columns:
|
|
234
|
-
"data-source":
|
|
243
|
+
columns: r(V),
|
|
244
|
+
"data-source": l.value,
|
|
235
245
|
"search-form": !1,
|
|
236
|
-
onUpdate:
|
|
237
|
-
}),
|
|
246
|
+
onUpdate: L
|
|
247
|
+
}), X({
|
|
238
248
|
_: 2
|
|
239
|
-
}, [
|
|
240
|
-
name:
|
|
241
|
-
fn:
|
|
249
|
+
}, [Y(x, (t, s) => ({
|
|
250
|
+
name: s,
|
|
251
|
+
fn: C((p) => [Z(e.$slots, s, ee(oe(p || {})))])
|
|
242
252
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
243
253
|
_: 3
|
|
244
254
|
}, 16, ["label"])], 64));
|
|
245
255
|
}
|
|
246
256
|
});
|
|
247
257
|
export {
|
|
248
|
-
|
|
258
|
+
Ke as default
|
|
249
259
|
};
|
|
@@ -87,7 +87,21 @@ export type EditableAgGridExpose<RecordType = any, ModelType = RecordType[]> = O
|
|
|
87
87
|
validateFieldsReturnTransformed: EditableTableExpose<ModelType, RecordType>['validateFields'];
|
|
88
88
|
table: AgGridExpose;
|
|
89
89
|
};
|
|
90
|
-
export type EditableAgGridFormItemExpose<RecordType = any, ModelType = RecordType[]> = Omit<EditableAgGridExpose<RecordType, ModelType>, 'resetFields' | 'validateFields' | 'validateFieldsReturnTransformed'
|
|
90
|
+
export type EditableAgGridFormItemExpose<RecordType = any, ModelType = RecordType[]> = Omit<EditableAgGridExpose<RecordType, ModelType>, 'resetFields' | 'validateFields' | 'validateFieldsReturnTransformed'> & {
|
|
91
|
+
/**
|
|
92
|
+
* 校验单元格
|
|
93
|
+
* @param rowId 行唯一标识
|
|
94
|
+
* @param field 字段
|
|
95
|
+
* @returns
|
|
96
|
+
*/
|
|
97
|
+
validateCell: (rowId: any, field: NamePath) => any;
|
|
98
|
+
/**
|
|
99
|
+
* 校验列
|
|
100
|
+
* @param colKey 列唯一标识
|
|
101
|
+
* @returns
|
|
102
|
+
*/
|
|
103
|
+
validateColumn: (colKey: string | number) => any;
|
|
104
|
+
};
|
|
91
105
|
export type EditableAgGridFormItemProps<RecordType = any> = Omit<EditableAgGridProps<RecordType>, 'name' | 'value' | 'onUpdate:value'> & {
|
|
92
106
|
label?: string;
|
|
93
107
|
/**
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as re, reactive as oe, shallowRef as ne, ref as ie, unref as f, nextTick as le, toRaw as
|
|
1
|
+
import { defineComponent as re, reactive as oe, shallowRef as ne, ref as ie, unref as f, nextTick as le, toRaw as R, watch as ae, onWatcherCleanup as se, isVNode as ue, cloneVNode as ce, computed as fe, createBlock as k, openBlock as E, mergeProps as de, withCtx as N, renderSlot as O } from "vue";
|
|
2
2
|
import { Form as pe } from "@aplus-frontend/antdv";
|
|
3
3
|
import { useUrlSearchParams as ge } from "@vueuse/core";
|
|
4
|
-
import { isArray as
|
|
4
|
+
import { isArray as P, cloneDeep as W, isEqual as me, omit as Fe } from "lodash-unified";
|
|
5
5
|
import "../render/index.mjs";
|
|
6
6
|
import { useDevWarning as he } from "../utils/warning.mjs";
|
|
7
7
|
import { getRouteType as ye } from "../utils/index.mjs";
|
|
8
|
-
import { INTERNAL_FORM_INSTANCE_MARK as
|
|
8
|
+
import { INTERNAL_FORM_INSTANCE_MARK as j } from "./constant.mjs";
|
|
9
9
|
import { useProvideForm as Ve } from "./context.mjs";
|
|
10
10
|
import { useInjectFormProvider as Te } from "./provider/context.mjs";
|
|
11
|
-
import { getModelValue as
|
|
12
|
-
import { genParams as
|
|
11
|
+
import { getModelValue as S } from "./utils/get.mjs";
|
|
12
|
+
import { genParams as B, setToParams as q } from "./utils/params.mjs";
|
|
13
13
|
import ve from "./utils/set.mjs";
|
|
14
14
|
import { transformValues as F } from "./utils/transform.mjs";
|
|
15
15
|
import { isDef as h } from "../utils/is.mjs";
|
|
@@ -47,30 +47,30 @@ const Se = /* @__PURE__ */ re({
|
|
|
47
47
|
syncToUrlPriority: { type: Boolean },
|
|
48
48
|
autoFocusFirstInput: { type: Boolean }
|
|
49
49
|
},
|
|
50
|
-
setup(
|
|
51
|
-
const r =
|
|
50
|
+
setup(x, { expose: D }) {
|
|
51
|
+
const r = x;
|
|
52
52
|
function y(e, t, o = !0, i) {
|
|
53
|
-
if (
|
|
53
|
+
if (P(e)) {
|
|
54
54
|
let l = n;
|
|
55
55
|
for (let p = 0; p < e.length - 1; p++)
|
|
56
56
|
e[p] in l || (l[e[p]] = {}), l = l[e[p]];
|
|
57
57
|
i ? i(l, e[e.length - 1]) : l[e[e.length - 1]] = t;
|
|
58
58
|
} else
|
|
59
59
|
i ? i(n, e) : n[e] = t;
|
|
60
|
-
let
|
|
60
|
+
let b = P(e) ? e[0] : e;
|
|
61
61
|
if (o) {
|
|
62
|
-
const l = { [
|
|
62
|
+
const l = { [b]: n[b] };
|
|
63
63
|
g.triggerFormChange(r.name, l), r.onValuesChange?.(l, n, e);
|
|
64
64
|
}
|
|
65
65
|
m();
|
|
66
66
|
}
|
|
67
|
-
const a = ne(), V = ge(ye()), g = Te(),
|
|
68
|
-
r.syncToUrl ?
|
|
67
|
+
const a = ne(), V = ge(ye()), g = Te(), $ = he("ApForm"), T = ie(
|
|
68
|
+
r.syncToUrl ? B(r.syncToUrl, V, "get") : {}
|
|
69
69
|
);
|
|
70
|
-
let s =
|
|
71
|
-
const n = oe(
|
|
70
|
+
let s = W(M()), u = {};
|
|
71
|
+
const n = oe(M());
|
|
72
72
|
let d = [];
|
|
73
|
-
function
|
|
73
|
+
function M() {
|
|
74
74
|
const e = r.initialValues || {};
|
|
75
75
|
return r.syncToUrlPriority ? {
|
|
76
76
|
...e,
|
|
@@ -80,19 +80,19 @@ const Se = /* @__PURE__ */ re({
|
|
|
80
80
|
...e
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function K(e) {
|
|
84
84
|
const t = F(
|
|
85
85
|
e,
|
|
86
86
|
u,
|
|
87
87
|
c
|
|
88
88
|
);
|
|
89
|
-
g.triggerFormFinish(r.name, e), r.syncToUrl &&
|
|
89
|
+
g.triggerFormFinish(r.name, e), r.syncToUrl && q(V, B(r.syncToUrl, t, "set")), r.onFinish?.(t);
|
|
90
90
|
}
|
|
91
|
-
const
|
|
91
|
+
const L = async () => {
|
|
92
92
|
a.value?.resetFields(), await le(() => {
|
|
93
|
-
Object.keys(n).forEach((e) => delete n[e]), Object.assign(n,
|
|
93
|
+
Object.keys(n).forEach((e) => delete n[e]), Object.assign(n, W(s)), m(), r.syncToUrl && q(
|
|
94
94
|
V,
|
|
95
|
-
|
|
95
|
+
B(
|
|
96
96
|
r.syncToUrl,
|
|
97
97
|
F(
|
|
98
98
|
s,
|
|
@@ -103,9 +103,9 @@ const Se = /* @__PURE__ */ re({
|
|
|
103
103
|
)
|
|
104
104
|
);
|
|
105
105
|
});
|
|
106
|
-
},
|
|
106
|
+
}, G = (e) => {
|
|
107
107
|
a.value?.clearValidate(e);
|
|
108
|
-
},
|
|
108
|
+
}, v = (e, t) => a.value?.validateFields(e, t), H = async (e, t) => {
|
|
109
109
|
const o = await a.value?.validateFields(
|
|
110
110
|
e,
|
|
111
111
|
t
|
|
@@ -115,23 +115,23 @@ const Se = /* @__PURE__ */ re({
|
|
|
115
115
|
u,
|
|
116
116
|
c
|
|
117
117
|
);
|
|
118
|
-
}, c = (e) => e === !0 ?
|
|
118
|
+
}, c = (e) => e === !0 ? R(n) : a.value?.getFieldsValue(e), J = (e) => {
|
|
119
119
|
const t = c(e);
|
|
120
120
|
return F(t, u, c);
|
|
121
121
|
}, Q = (e, t) => a.value?.validate(e, t), X = (e, t = {}) => {
|
|
122
122
|
a.value?.scrollToField(e, t);
|
|
123
123
|
}, Y = (e) => {
|
|
124
124
|
Object.assign(n, e), m();
|
|
125
|
-
},
|
|
125
|
+
}, I = (e, t, o = !0, i) => {
|
|
126
126
|
y(e, t, o, i), m();
|
|
127
127
|
};
|
|
128
|
-
function
|
|
129
|
-
return e(
|
|
128
|
+
function C(e) {
|
|
129
|
+
return e(R(n)), d.push(e), () => {
|
|
130
130
|
d = d.filter((t) => t !== e);
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
-
function
|
|
134
|
-
if (
|
|
133
|
+
function U(e, t) {
|
|
134
|
+
if (P(e)) {
|
|
135
135
|
let o = s;
|
|
136
136
|
for (let i = 0; i < e.length - 1; i++)
|
|
137
137
|
h(o[e[i]]) || (o[e[i]] = {}), o = o[e[i]];
|
|
@@ -142,11 +142,11 @@ const Se = /* @__PURE__ */ re({
|
|
|
142
142
|
function Z(e, t) {
|
|
143
143
|
if (!h(e) || !h(t))
|
|
144
144
|
return;
|
|
145
|
-
const o =
|
|
145
|
+
const o = S(s, t);
|
|
146
146
|
if (me(o, e))
|
|
147
147
|
return;
|
|
148
|
-
const i =
|
|
149
|
-
h(i) && r.syncToUrlPriority || (y(t, e, !1),
|
|
148
|
+
const i = S(f(T), t);
|
|
149
|
+
h(i) && r.syncToUrlPriority || (y(t, e, !1), U(t, e));
|
|
150
150
|
}
|
|
151
151
|
function z(e, t) {
|
|
152
152
|
t && (u = ve(
|
|
@@ -156,44 +156,45 @@ const Se = /* @__PURE__ */ re({
|
|
|
156
156
|
!0
|
|
157
157
|
));
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function w({ initialValue: e, name: t, transform: o }) {
|
|
160
160
|
Z(e, t), z(t, o);
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function _() {
|
|
163
163
|
return s;
|
|
164
164
|
}
|
|
165
165
|
function ee(e) {
|
|
166
|
-
if (
|
|
167
|
-
e ===
|
|
166
|
+
if ($(
|
|
167
|
+
e === j,
|
|
168
168
|
"usage",
|
|
169
169
|
"getInternalInstance should only used at internal"
|
|
170
|
-
), e ===
|
|
170
|
+
), e === j)
|
|
171
171
|
return {
|
|
172
|
-
registerField:
|
|
173
|
-
registerWatch:
|
|
174
|
-
setFieldValue:
|
|
175
|
-
getInitialValues:
|
|
176
|
-
updateInitialModel:
|
|
172
|
+
registerField: w,
|
|
173
|
+
registerWatch: C,
|
|
174
|
+
setFieldValue: I,
|
|
175
|
+
getInitialValues: _,
|
|
176
|
+
updateInitialModel: U,
|
|
177
|
+
validateFields: v
|
|
177
178
|
};
|
|
178
179
|
}
|
|
179
180
|
function m() {
|
|
180
181
|
if (d.length) {
|
|
181
|
-
const e =
|
|
182
|
+
const e = R(n);
|
|
182
183
|
d.forEach((t) => {
|
|
183
184
|
t(e);
|
|
184
185
|
});
|
|
185
186
|
}
|
|
186
187
|
}
|
|
187
|
-
const
|
|
188
|
-
resetFields:
|
|
189
|
-
clearValidate:
|
|
190
|
-
validateFields:
|
|
188
|
+
const A = {
|
|
189
|
+
resetFields: L,
|
|
190
|
+
clearValidate: G,
|
|
191
|
+
validateFields: v,
|
|
191
192
|
getFieldsValue: c,
|
|
192
193
|
validate: Q,
|
|
193
194
|
scrollToField: X,
|
|
194
195
|
setFieldsValue: Y,
|
|
195
|
-
setFieldValue:
|
|
196
|
-
registerWatch:
|
|
196
|
+
setFieldValue: I,
|
|
197
|
+
registerWatch: C,
|
|
197
198
|
validateFieldsReturnTransformed: H,
|
|
198
199
|
getFieldsValueTransformed: J,
|
|
199
200
|
getInternalInstance: ee
|
|
@@ -201,7 +202,7 @@ const Se = /* @__PURE__ */ re({
|
|
|
201
202
|
ae(
|
|
202
203
|
() => r.name,
|
|
203
204
|
(e) => {
|
|
204
|
-
e && (g.registerForm(e,
|
|
205
|
+
e && (g.registerForm(e, A), se(() => {
|
|
205
206
|
g.unregisterForm(r.name);
|
|
206
207
|
}));
|
|
207
208
|
},
|
|
@@ -216,13 +217,14 @@ const Se = /* @__PURE__ */ re({
|
|
|
216
217
|
model: fe(() => n),
|
|
217
218
|
updateModel: y,
|
|
218
219
|
internalInstance: {
|
|
219
|
-
registerWatch:
|
|
220
|
-
registerField:
|
|
221
|
-
setFieldValue:
|
|
222
|
-
getInitialValues:
|
|
223
|
-
updateInitialModel:
|
|
220
|
+
registerWatch: C,
|
|
221
|
+
registerField: w,
|
|
222
|
+
setFieldValue: I,
|
|
223
|
+
getInitialValues: _,
|
|
224
|
+
updateInitialModel: U,
|
|
225
|
+
validateFields: v
|
|
224
226
|
}
|
|
225
|
-
}),
|
|
227
|
+
}), D(A), (e, t) => (E(), k(f(pe), de(
|
|
226
228
|
{
|
|
227
229
|
ref_key: "formRef",
|
|
228
230
|
ref: a
|
|
@@ -238,19 +240,19 @@ const Se = /* @__PURE__ */ re({
|
|
|
238
240
|
{
|
|
239
241
|
model: n,
|
|
240
242
|
"data-form-name": e.name,
|
|
241
|
-
onFinish:
|
|
243
|
+
onFinish: K
|
|
242
244
|
}
|
|
243
245
|
), {
|
|
244
|
-
default:
|
|
245
|
-
e.autoFocusFirstInput ? (
|
|
246
|
+
default: N(() => [
|
|
247
|
+
e.autoFocusFirstInput ? (E(), k(f(Ie), {
|
|
246
248
|
key: 1,
|
|
247
249
|
renderer: te
|
|
248
250
|
}, {
|
|
249
|
-
default:
|
|
250
|
-
|
|
251
|
+
default: N(() => [
|
|
252
|
+
O(e.$slots, "default")
|
|
251
253
|
]),
|
|
252
254
|
_: 3
|
|
253
|
-
})) :
|
|
255
|
+
})) : O(e.$slots, "default", { key: 0 })
|
|
254
256
|
]),
|
|
255
257
|
_: 3
|
|
256
258
|
}, 16, ["model", "data-form-name"]));
|
|
@@ -149,6 +149,10 @@ export type ApFormInternalInstance = {
|
|
|
149
149
|
* 更新表单的初始值(仅用于某些组件内部调用的情况)
|
|
150
150
|
*/
|
|
151
151
|
updateInitialModel: (name: FormItemProps['name'], val: any) => void;
|
|
152
|
+
/**
|
|
153
|
+
* 表单校验
|
|
154
|
+
*/
|
|
155
|
+
validateFields: ApFormExpose['validateFields'];
|
|
152
156
|
};
|
|
153
157
|
export type ApFormItemExpose = FormItemExpose & {
|
|
154
158
|
/**
|