@aplus-frontend/ui 7.13.12 → 7.14.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/index.mjs +58 -56
- package/es/src/ap-field/text/index.vue2.mjs +2 -2
- package/es/src/ap-field/text/password.vue.mjs +8 -8
- package/es/src/ap-form/ap-form.vue.d.ts +1 -0
- package/es/src/ap-form/ap-form.vue2.mjs +122 -106
- package/es/src/ap-form/drawer-form/index.vue.d.ts +4 -0
- package/es/src/ap-form/drawer-form/index.vue.mjs +13 -10
- package/es/src/ap-form/interface.d.ts +5 -0
- package/es/src/ap-form/item/index.vue.d.ts +1 -0
- package/es/src/ap-form/item/index.vue.mjs +84 -70
- package/es/src/ap-form/items/checkbox/index.vue.mjs +9 -8
- package/es/src/ap-form/items/date/index.vue.mjs +10 -9
- package/es/src/ap-form/items/date-range/index.vue.mjs +10 -9
- package/es/src/ap-form/items/number/index.vue.mjs +7 -6
- package/es/src/ap-form/items/radio/index.vue.mjs +9 -8
- package/es/src/ap-form/items/select/index.vue.mjs +3 -2
- package/es/src/ap-form/items/switch/index.vue.mjs +10 -9
- package/es/src/ap-form/items/text/index.vue2.mjs +6 -5
- package/es/src/ap-form/items/text/password.vue.mjs +10 -9
- package/es/src/ap-form/items/text-area/index.vue.mjs +4 -3
- package/es/src/ap-form/items/tree-select/index.vue.mjs +1 -0
- package/es/src/ap-form/modal-form/index.vue.d.ts +4 -0
- package/es/src/ap-form/modal-form/index.vue.mjs +3 -0
- package/es/src/ap-form/render/item.vue.mjs +6 -5
- package/es/src/ap-form/search-form/index.vue.d.ts +4 -0
- package/es/src/ap-form/search-form/index.vue.mjs +26 -23
- package/es/src/ap-table/ap-table.vue2.mjs +2 -2
- package/es/src/ap-table/components/setting/index.d.ts +2 -0
- package/es/src/ap-table/components/setting/index.mjs +5 -0
- package/es/src/ap-table/components/setting/modal/index.vue.mjs +277 -2
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +2 -273
- package/es/src/ap-table/components/setting/select-group/index.vue2.mjs +11 -8
- package/es/src/ap-table/components/setting/template/edit-form.vue.d.ts +2 -0
- package/es/src/ap-table/components/setting/template/item.vue2.mjs +35 -35
- package/es/src/ap-table/hooks/use-table-template-storage.mjs +55 -54
- package/es/src/ap-table/index.d.ts +2 -2
- package/es/src/ap-table/index.mjs +7 -6
- package/es/src/ap-table/interface.d.ts +16 -0
- package/es/src/business/ap-size-input/form-item.vue.mjs +6 -5
- package/es/src/business/ap-view/components/main-button-content.vue.d.ts +2 -0
- package/es/src/business/ap-view/components/menu-list-content.vue.d.ts +2 -0
- package/es/src/business/batch-input-group/form-item.vue.mjs +8 -7
- package/es/src/index.mjs +54 -52
- package/es/src/locale/lang/en.mjs +1 -0
- package/es/src/locale/lang/zh-cn.mjs +1 -0
- package/es/src/render/render.d.ts +7 -4
- package/es/src/render/render.mjs +17 -7
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/index.js +1 -1
- package/lib/src/ap-field/text/index.vue2.js +1 -1
- package/lib/src/ap-field/text/password.vue.js +1 -1
- package/lib/src/ap-form/ap-form.vue.d.ts +1 -0
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/drawer-form/index.vue.d.ts +4 -0
- package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
- package/lib/src/ap-form/interface.d.ts +5 -0
- package/lib/src/ap-form/item/index.vue.d.ts +1 -0
- package/lib/src/ap-form/item/index.vue.js +1 -1
- package/lib/src/ap-form/items/checkbox/index.vue.js +1 -1
- package/lib/src/ap-form/items/date/index.vue.js +1 -1
- package/lib/src/ap-form/items/date-range/index.vue.js +1 -1
- package/lib/src/ap-form/items/number/index.vue.js +1 -1
- package/lib/src/ap-form/items/radio/index.vue.js +1 -1
- package/lib/src/ap-form/items/select/index.vue.js +1 -1
- package/lib/src/ap-form/items/switch/index.vue.js +1 -1
- package/lib/src/ap-form/items/text/index.vue2.js +1 -1
- package/lib/src/ap-form/items/text/password.vue.js +1 -1
- package/lib/src/ap-form/items/text-area/index.vue.js +1 -1
- package/lib/src/ap-form/items/tree-select/index.vue.js +1 -1
- package/lib/src/ap-form/modal-form/index.vue.d.ts +4 -0
- package/lib/src/ap-form/modal-form/index.vue.js +1 -1
- package/lib/src/ap-form/render/item.vue.js +1 -1
- package/lib/src/ap-form/search-form/index.vue.d.ts +4 -0
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/index.d.ts +2 -0
- package/lib/src/ap-table/components/setting/index.js +1 -0
- package/lib/src/ap-table/components/setting/modal/index.vue.js +1 -1
- package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/select-group/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/template/edit-form.vue.d.ts +2 -0
- package/lib/src/ap-table/components/setting/template/item.vue2.js +1 -1
- package/lib/src/ap-table/hooks/use-table-template-storage.js +1 -1
- package/lib/src/ap-table/index.d.ts +2 -2
- package/lib/src/ap-table/index.js +1 -1
- package/lib/src/ap-table/interface.d.ts +16 -0
- package/lib/src/business/ap-size-input/form-item.vue.js +1 -1
- package/lib/src/business/ap-view/components/main-button-content.vue.d.ts +2 -0
- package/lib/src/business/ap-view/components/menu-list-content.vue.d.ts +2 -0
- package/lib/src/business/batch-input-group/form-item.vue.js +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/render/render.d.ts +7 -4
- package/lib/src/render/render.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +5 -5
package/es/index.mjs
CHANGED
|
@@ -126,34 +126,35 @@ import { default as ap } from "./src/business/ap-descriptions/ap-descriptions.vu
|
|
|
126
126
|
import { ApFilePreview as mp } from "./src/business/ap-file-preview/index.mjs";
|
|
127
127
|
import { useTablePaging as xp } from "./src/ap-table/hooks/use-table-paging.mjs";
|
|
128
128
|
import { ApTable as sp } from "./src/ap-table/index.mjs";
|
|
129
|
-
import { default as Ap } from "./src/
|
|
130
|
-
import { default as np } from "./src/editable-table/
|
|
131
|
-
import {
|
|
132
|
-
import {
|
|
133
|
-
import { default as Tp } from "./src/scroll-bar/
|
|
134
|
-
import { default as Cp } from "./src/scroll-
|
|
135
|
-
import { default as Dp } from "./src/
|
|
136
|
-
import { default as Pp } from "./src/
|
|
137
|
-
import { default as Lp } from "./src/
|
|
138
|
-
import {
|
|
139
|
-
import {
|
|
140
|
-
import {
|
|
141
|
-
import { default as kp } from "./src/ap-grid/
|
|
142
|
-
import { default as Up } from "./src/ap-grid/editable/
|
|
143
|
-
import { default as Vp } from "./src/
|
|
144
|
-
import { default as _p } from "./src/text/
|
|
145
|
-
import { default as $p } from "./src/
|
|
146
|
-
import {
|
|
147
|
-
import {
|
|
148
|
-
import { default as Xp } from "./src/ag-grid/
|
|
149
|
-
import { default as Zp } from "./src/ag-grid/editable/
|
|
150
|
-
import {
|
|
151
|
-
import {
|
|
152
|
-
import {
|
|
153
|
-
import {
|
|
154
|
-
import {
|
|
155
|
-
import {
|
|
156
|
-
import {
|
|
129
|
+
import { default as Ap } from "./src/ap-table/components/setting/modal/index.vue.mjs";
|
|
130
|
+
import { default as np } from "./src/editable-table/index.vue.mjs";
|
|
131
|
+
import { default as Fp } from "./src/editable-table/form-item.vue.mjs";
|
|
132
|
+
import { ensureRangeValue as Ip } from "./src/scroll-bar/utils/index.mjs";
|
|
133
|
+
import { default as Tp } from "./src/scroll-bar/index.vue.mjs";
|
|
134
|
+
import { default as Cp } from "./src/scroll-bar/internal.vue.mjs";
|
|
135
|
+
import { default as Dp } from "./src/scroll-view/index.vue.mjs";
|
|
136
|
+
import { default as Pp } from "./src/portal/index.vue.mjs";
|
|
137
|
+
import { default as Lp } from "./src/full-screen/index.vue.mjs";
|
|
138
|
+
import { default as vp } from "./src/resize-observer/index.vue.mjs";
|
|
139
|
+
import { ROW_SELECTION_FIELD as Mp } from "./src/ap-grid/constants.mjs";
|
|
140
|
+
import { toTreeArray as yp } from "./src/ap-grid/utils/to-tree-array.mjs";
|
|
141
|
+
import { default as kp } from "./src/ap-grid/index.vue.mjs";
|
|
142
|
+
import { default as Up } from "./src/ap-grid/editable/index.vue.mjs";
|
|
143
|
+
import { default as Vp } from "./src/ap-grid/editable/form-item.vue.mjs";
|
|
144
|
+
import { default as _p } from "./src/text/index.vue.mjs";
|
|
145
|
+
import { default as $p } from "./src/text/group.vue.mjs";
|
|
146
|
+
import { default as Wp } from "./src/mask/index.vue.mjs";
|
|
147
|
+
import { Splitter as Jp } from "./src/splitter/index.mjs";
|
|
148
|
+
import { default as Xp } from "./src/ag-grid/index.vue.mjs";
|
|
149
|
+
import { default as Zp } from "./src/ag-grid/editable/index.vue.mjs";
|
|
150
|
+
import { default as oa } from "./src/ag-grid/editable/form-item.vue.mjs";
|
|
151
|
+
import { ApSkeleton as ta } from "./src/skeleton/index.mjs";
|
|
152
|
+
import { useMessage as aa } from "./src/hooks/useMessage.mjs";
|
|
153
|
+
import { useControllableValue as ma } from "./src/hooks/useControllableValue.mjs";
|
|
154
|
+
import { useManualRef as xa } from "./src/hooks/useManualRef.mjs";
|
|
155
|
+
import { useThrottleRef as sa } from "./src/hooks/useThrottleRef.mjs";
|
|
156
|
+
import { useFullScreen as Aa } from "./src/hooks/useFullScreen.mjs";
|
|
157
|
+
import { useResize as na } from "./src/hooks/useResize.mjs";
|
|
157
158
|
const a = console.log;
|
|
158
159
|
a(`UI version: ${p}`);
|
|
159
160
|
const l = {
|
|
@@ -166,7 +167,7 @@ const l = {
|
|
|
166
167
|
};
|
|
167
168
|
export {
|
|
168
169
|
y as APConfigProvider,
|
|
169
|
-
|
|
170
|
+
Xp as AgGrid,
|
|
170
171
|
No as ApActionButton,
|
|
171
172
|
So as ApActionGroup,
|
|
172
173
|
uo as ApActionItem,
|
|
@@ -233,7 +234,7 @@ export {
|
|
|
233
234
|
Pe as ApFormProvider,
|
|
234
235
|
Ae as ApFormSearchForm,
|
|
235
236
|
Ie as ApFormSet,
|
|
236
|
-
|
|
237
|
+
kp as ApGrid,
|
|
237
238
|
Dr as ApImage,
|
|
238
239
|
Pr as ApInputRadio,
|
|
239
240
|
Pt as ApKeepAlive,
|
|
@@ -250,17 +251,18 @@ export {
|
|
|
250
251
|
Br as ApSelectLayout,
|
|
251
252
|
_t as ApSelectedItems,
|
|
252
253
|
ut as ApSizeInput,
|
|
253
|
-
|
|
254
|
+
ta as ApSkeleton,
|
|
254
255
|
Uo as ApStatisticCard,
|
|
255
256
|
Kr as ApStatus,
|
|
256
257
|
Ur as ApStatusGroup,
|
|
257
258
|
et as ApSummary,
|
|
258
259
|
sp as ApTable,
|
|
259
260
|
Zo as ApTableModal,
|
|
261
|
+
Ap as ApTableSetting,
|
|
260
262
|
$t as ApTag,
|
|
261
263
|
Wt as ApTagGroup,
|
|
262
|
-
|
|
263
|
-
|
|
264
|
+
_p as ApText,
|
|
265
|
+
$p as ApTextGroup,
|
|
264
266
|
Vr as ApTitle,
|
|
265
267
|
Xo as ApTransformDataHelper,
|
|
266
268
|
Xt as ApUpload,
|
|
@@ -273,26 +275,26 @@ export {
|
|
|
273
275
|
N as ConfigProvider,
|
|
274
276
|
A as DEFAULT_NAMESPACE,
|
|
275
277
|
i as DEFAULT_UIMODE,
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
278
|
+
Zp as EditableAgGrid,
|
|
279
|
+
oa as EditableAgGridFormItem,
|
|
280
|
+
Up as EditableGrid,
|
|
281
|
+
Vp as EditableGridFormItem,
|
|
282
|
+
np as EditableTable,
|
|
283
|
+
Fp as EditableTableFormItem,
|
|
284
|
+
Lp as FullScreen,
|
|
283
285
|
Jo as Highlight,
|
|
284
|
-
|
|
286
|
+
Cp as InternalScrollBar,
|
|
285
287
|
Vo as LoadingBar,
|
|
286
288
|
Lt as LruCacher,
|
|
287
|
-
|
|
289
|
+
Wp as Mask,
|
|
288
290
|
Jt as NeedNameKeyDefault,
|
|
289
|
-
|
|
290
|
-
|
|
291
|
+
Pp as Portal,
|
|
292
|
+
Mp as ROW_SELECTION_FIELD,
|
|
291
293
|
_o as Render,
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
294
|
+
vp as ResizeObserver,
|
|
295
|
+
Tp as ScrollBar,
|
|
296
|
+
Dp as ScrollView,
|
|
297
|
+
Jp as Splitter,
|
|
296
298
|
$o as TimeAgo,
|
|
297
299
|
lo as adminToken,
|
|
298
300
|
xo as aplusToken,
|
|
@@ -304,7 +306,7 @@ export {
|
|
|
304
306
|
Cr as convertExportField,
|
|
305
307
|
l as default,
|
|
306
308
|
P as defaultNamespace,
|
|
307
|
-
|
|
309
|
+
Ip as ensureRangeValue,
|
|
308
310
|
Qr as flattenColumns,
|
|
309
311
|
Dt as forceStopTags,
|
|
310
312
|
Xr as formatDataIndex,
|
|
@@ -318,26 +320,26 @@ export {
|
|
|
318
320
|
Nr as locales,
|
|
319
321
|
E as namespaceContextKey,
|
|
320
322
|
g as provideGlobalConfig,
|
|
321
|
-
|
|
323
|
+
yp as toTreeArray,
|
|
322
324
|
G as translate,
|
|
323
325
|
Ut as useAgGridModal,
|
|
324
326
|
Vt as useAgGridSelectModal,
|
|
325
327
|
vt as useApKeepAliveInject,
|
|
326
|
-
|
|
327
|
-
|
|
328
|
+
ma as useControllableValue,
|
|
329
|
+
Aa as useFullScreen,
|
|
328
330
|
L as useGetDerivedNamespace,
|
|
329
331
|
I as useGlobalConfig,
|
|
330
332
|
D as useLocale,
|
|
331
|
-
|
|
332
|
-
|
|
333
|
+
xa as useManualRef,
|
|
334
|
+
aa as useMessage,
|
|
333
335
|
R as useNamespace,
|
|
334
336
|
Wr as usePageListAgGrid,
|
|
335
337
|
$r as usePageListApGrid,
|
|
336
338
|
_r as usePageListApTable,
|
|
337
|
-
|
|
339
|
+
na as useResize,
|
|
338
340
|
or as useTableModal,
|
|
339
341
|
xp as useTablePaging,
|
|
340
342
|
tr as useTableSelectModal,
|
|
341
|
-
|
|
343
|
+
sa as useThrottleRef,
|
|
342
344
|
Wo as useTimeAgo
|
|
343
345
|
};
|
|
@@ -112,13 +112,13 @@ const J = /* @__PURE__ */ h({
|
|
|
112
112
|
expose: c,
|
|
113
113
|
emit: f
|
|
114
114
|
}) {
|
|
115
|
-
const
|
|
115
|
+
const s = f, o = t, u = g(), i = w(), {
|
|
116
116
|
value: m,
|
|
117
117
|
updateValue: v
|
|
118
|
-
} = p(o,
|
|
118
|
+
} = p(o, s), y = R("TextPassword", o), {
|
|
119
119
|
value: b,
|
|
120
|
-
updateValue:
|
|
121
|
-
} = p(o,
|
|
120
|
+
updateValue: r
|
|
121
|
+
} = p(o, s, {
|
|
122
122
|
valuePropName: "visible"
|
|
123
123
|
});
|
|
124
124
|
function B() {
|
|
@@ -129,7 +129,7 @@ const J = /* @__PURE__ */ h({
|
|
|
129
129
|
value: n,
|
|
130
130
|
"onUpdate:value": v,
|
|
131
131
|
visible: l,
|
|
132
|
-
"onUpdate:visible":
|
|
132
|
+
"onUpdate:visible": r,
|
|
133
133
|
ref: i
|
|
134
134
|
}), k(u) ? u : {
|
|
135
135
|
default: () => [u]
|
|
@@ -140,7 +140,7 @@ const J = /* @__PURE__ */ h({
|
|
|
140
140
|
style: {
|
|
141
141
|
cursor: "pointer"
|
|
142
142
|
},
|
|
143
|
-
onClick: () =>
|
|
143
|
+
onClick: () => r(!l)
|
|
144
144
|
}, [l ? e(_, null, null) : e(S, null, null)])]
|
|
145
145
|
})), d;
|
|
146
146
|
}
|
|
@@ -152,8 +152,8 @@ const J = /* @__PURE__ */ h({
|
|
|
152
152
|
i.value?.blur();
|
|
153
153
|
}
|
|
154
154
|
}), (n, l) => (V(), U(a(j), {
|
|
155
|
-
|
|
156
|
-
}));
|
|
155
|
+
node: B()
|
|
156
|
+
}, null, 8, ["node"]));
|
|
157
157
|
}
|
|
158
158
|
});
|
|
159
159
|
export {
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Form as
|
|
3
|
-
import { useUrlSearchParams as
|
|
4
|
-
import { isArray as
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
|
|
1
|
+
import { defineComponent as re, reactive as oe, shallowRef as ne, ref as ie, unref as f, nextTick as le, toRaw as U, watch as ae, onWatcherCleanup as se, isVNode as ue, cloneVNode as ce, computed as fe, createBlock as b, openBlock as k, mergeProps as de, withCtx as E, renderSlot as N } from "vue";
|
|
2
|
+
import { Form as pe } from "@aplus-frontend/antdv";
|
|
3
|
+
import { useUrlSearchParams as ge } from "@vueuse/core";
|
|
4
|
+
import { isArray as R, cloneDeep as O, isEqual as me, omit as Fe } from "lodash-unified";
|
|
5
|
+
import "../render/index.mjs";
|
|
6
|
+
import { useDevWarning as he } from "../utils/warning.mjs";
|
|
7
|
+
import { getRouteType as ye } from "../utils/index.mjs";
|
|
8
|
+
import { INTERNAL_FORM_INSTANCE_MARK as W } from "./constant.mjs";
|
|
9
|
+
import { useProvideForm as Ve } from "./context.mjs";
|
|
10
|
+
import { useInjectFormProvider as Te } from "./provider/context.mjs";
|
|
11
|
+
import { getModelValue as j } from "./utils/get.mjs";
|
|
12
|
+
import { genParams as P, setToParams as S } from "./utils/params.mjs";
|
|
13
|
+
import ve from "./utils/set.mjs";
|
|
14
|
+
import { transformValues as F } from "./utils/transform.mjs";
|
|
15
|
+
import { isDef as h } from "../utils/is.mjs";
|
|
16
|
+
import Ie from "../render/render.mjs";
|
|
17
|
+
const Se = /* @__PURE__ */ re({
|
|
16
18
|
name: "ApForm",
|
|
17
19
|
__name: "ap-form",
|
|
18
20
|
props: {
|
|
@@ -42,204 +44,218 @@ const Ee = /* @__PURE__ */ Y({
|
|
|
42
44
|
initialValues: {},
|
|
43
45
|
onValuesChange: {},
|
|
44
46
|
syncToUrl: { type: [Boolean, Function], default: !1 },
|
|
45
|
-
syncToUrlPriority: { type: Boolean }
|
|
47
|
+
syncToUrlPriority: { type: Boolean },
|
|
48
|
+
autoFocusFirstInput: { type: Boolean }
|
|
46
49
|
},
|
|
47
|
-
setup(
|
|
48
|
-
const r =
|
|
50
|
+
setup(q, { expose: x }) {
|
|
51
|
+
const r = q;
|
|
49
52
|
function y(e, t, o = !0, i) {
|
|
50
|
-
if (
|
|
53
|
+
if (R(e)) {
|
|
51
54
|
let l = n;
|
|
52
|
-
for (let
|
|
53
|
-
e[
|
|
55
|
+
for (let p = 0; p < e.length - 1; p++)
|
|
56
|
+
e[p] in l || (l[e[p]] = {}), l = l[e[p]];
|
|
54
57
|
i ? i(l, e[e.length - 1]) : l[e[e.length - 1]] = t;
|
|
55
58
|
} else
|
|
56
59
|
i ? i(n, e) : n[e] = t;
|
|
57
|
-
let A =
|
|
60
|
+
let A = R(e) ? e[0] : e;
|
|
58
61
|
if (o) {
|
|
59
62
|
const l = { [A]: n[A] };
|
|
60
|
-
|
|
63
|
+
g.triggerFormChange(r.name, l), r.onValuesChange?.(l, n, e);
|
|
61
64
|
}
|
|
62
65
|
m();
|
|
63
66
|
}
|
|
64
|
-
const a =
|
|
65
|
-
r.syncToUrl ?
|
|
67
|
+
const a = ne(), V = ge(ye()), g = Te(), D = he("ApForm"), T = ie(
|
|
68
|
+
r.syncToUrl ? P(r.syncToUrl, V, "get") : {}
|
|
66
69
|
);
|
|
67
|
-
let s =
|
|
68
|
-
const n =
|
|
69
|
-
let
|
|
70
|
-
function
|
|
70
|
+
let s = O(B()), u = {};
|
|
71
|
+
const n = oe(B());
|
|
72
|
+
let d = [];
|
|
73
|
+
function B() {
|
|
71
74
|
const e = r.initialValues || {};
|
|
72
75
|
return r.syncToUrlPriority ? {
|
|
73
76
|
...e,
|
|
74
|
-
...
|
|
77
|
+
...f(T)
|
|
75
78
|
} : {
|
|
76
|
-
...
|
|
79
|
+
...f(T),
|
|
77
80
|
...e
|
|
78
81
|
};
|
|
79
82
|
}
|
|
80
|
-
function
|
|
81
|
-
const t =
|
|
83
|
+
function $(e) {
|
|
84
|
+
const t = F(
|
|
82
85
|
e,
|
|
83
86
|
u,
|
|
84
|
-
|
|
87
|
+
c
|
|
85
88
|
);
|
|
86
|
-
|
|
89
|
+
g.triggerFormFinish(r.name, e), r.syncToUrl && S(V, P(r.syncToUrl, t, "set")), r.onFinish?.(t);
|
|
87
90
|
}
|
|
88
|
-
const
|
|
89
|
-
a.value?.resetFields(), await
|
|
90
|
-
Object.keys(n).forEach((e) => delete n[e]), Object.assign(n,
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
const K = async () => {
|
|
92
|
+
a.value?.resetFields(), await le(() => {
|
|
93
|
+
Object.keys(n).forEach((e) => delete n[e]), Object.assign(n, O(s)), m(), r.syncToUrl && S(
|
|
94
|
+
V,
|
|
95
|
+
P(
|
|
93
96
|
r.syncToUrl,
|
|
94
|
-
|
|
97
|
+
F(
|
|
95
98
|
s,
|
|
96
99
|
u,
|
|
97
|
-
|
|
100
|
+
c
|
|
98
101
|
),
|
|
99
102
|
"set"
|
|
100
103
|
)
|
|
101
104
|
);
|
|
102
105
|
});
|
|
103
|
-
},
|
|
106
|
+
}, L = (e) => {
|
|
104
107
|
a.value?.clearValidate(e);
|
|
105
|
-
},
|
|
108
|
+
}, G = (e, t) => a.value?.validateFields(e, t), H = async (e, t) => {
|
|
106
109
|
const o = await a.value?.validateFields(
|
|
107
110
|
e,
|
|
108
111
|
t
|
|
109
112
|
);
|
|
110
|
-
return
|
|
113
|
+
return F(
|
|
111
114
|
o,
|
|
112
115
|
u,
|
|
113
|
-
|
|
116
|
+
c
|
|
114
117
|
);
|
|
115
|
-
},
|
|
116
|
-
const t =
|
|
117
|
-
return
|
|
118
|
-
},
|
|
118
|
+
}, c = (e) => e === !0 ? U(n) : a.value?.getFieldsValue(e), J = (e) => {
|
|
119
|
+
const t = c(e);
|
|
120
|
+
return F(t, u, c);
|
|
121
|
+
}, Q = (e, t) => a.value?.validate(e, t), X = (e, t = {}) => {
|
|
119
122
|
a.value?.scrollToField(e, t);
|
|
120
|
-
},
|
|
123
|
+
}, Y = (e) => {
|
|
121
124
|
Object.assign(n, e), m();
|
|
122
125
|
}, v = (e, t, o = !0, i) => {
|
|
123
126
|
y(e, t, o, i), m();
|
|
124
127
|
};
|
|
125
|
-
function
|
|
126
|
-
return e(U(n)),
|
|
127
|
-
|
|
128
|
+
function I(e) {
|
|
129
|
+
return e(U(n)), d.push(e), () => {
|
|
130
|
+
d = d.filter((t) => t !== e);
|
|
128
131
|
};
|
|
129
132
|
}
|
|
130
|
-
function
|
|
131
|
-
if (
|
|
133
|
+
function C(e, t) {
|
|
134
|
+
if (R(e)) {
|
|
132
135
|
let o = s;
|
|
133
136
|
for (let i = 0; i < e.length - 1; i++)
|
|
134
|
-
|
|
137
|
+
h(o[e[i]]) || (o[e[i]] = {}), o = o[e[i]];
|
|
135
138
|
o[e[e.length - 1]] = t;
|
|
136
139
|
} else
|
|
137
140
|
s[e] = t;
|
|
138
141
|
}
|
|
139
|
-
function
|
|
140
|
-
if (!
|
|
142
|
+
function Z(e, t) {
|
|
143
|
+
if (!h(e) || !h(t))
|
|
141
144
|
return;
|
|
142
|
-
const o =
|
|
143
|
-
if (
|
|
145
|
+
const o = j(s, t);
|
|
146
|
+
if (me(o, e))
|
|
144
147
|
return;
|
|
145
|
-
const i =
|
|
146
|
-
|
|
148
|
+
const i = j(f(T), t);
|
|
149
|
+
h(i) && r.syncToUrlPriority || (y(t, e, !1), C(t, e));
|
|
147
150
|
}
|
|
148
|
-
function
|
|
149
|
-
t && (u =
|
|
151
|
+
function z(e, t) {
|
|
152
|
+
t && (u = ve(
|
|
150
153
|
u,
|
|
151
154
|
[e].flat(1),
|
|
152
155
|
t,
|
|
153
156
|
!0
|
|
154
157
|
));
|
|
155
158
|
}
|
|
156
|
-
function
|
|
157
|
-
|
|
159
|
+
function M({ initialValue: e, name: t, transform: o }) {
|
|
160
|
+
Z(e, t), z(t, o);
|
|
158
161
|
}
|
|
159
|
-
function
|
|
162
|
+
function w() {
|
|
160
163
|
return s;
|
|
161
164
|
}
|
|
162
|
-
function
|
|
163
|
-
if (
|
|
164
|
-
e ===
|
|
165
|
+
function ee(e) {
|
|
166
|
+
if (D(
|
|
167
|
+
e === W,
|
|
165
168
|
"usage",
|
|
166
169
|
"getInternalInstance should only used at internal"
|
|
167
|
-
), e ===
|
|
170
|
+
), e === W)
|
|
168
171
|
return {
|
|
169
|
-
registerField:
|
|
170
|
-
registerWatch:
|
|
172
|
+
registerField: M,
|
|
173
|
+
registerWatch: I,
|
|
171
174
|
setFieldValue: v,
|
|
172
|
-
getInitialValues:
|
|
173
|
-
updateInitialModel:
|
|
175
|
+
getInitialValues: w,
|
|
176
|
+
updateInitialModel: C
|
|
174
177
|
};
|
|
175
178
|
}
|
|
176
179
|
function m() {
|
|
177
|
-
if (
|
|
180
|
+
if (d.length) {
|
|
178
181
|
const e = U(n);
|
|
179
|
-
|
|
182
|
+
d.forEach((t) => {
|
|
180
183
|
t(e);
|
|
181
184
|
});
|
|
182
185
|
}
|
|
183
186
|
}
|
|
184
|
-
const
|
|
185
|
-
resetFields:
|
|
186
|
-
clearValidate:
|
|
187
|
-
validateFields:
|
|
188
|
-
getFieldsValue:
|
|
189
|
-
validate:
|
|
190
|
-
scrollToField:
|
|
191
|
-
setFieldsValue:
|
|
187
|
+
const _ = {
|
|
188
|
+
resetFields: K,
|
|
189
|
+
clearValidate: L,
|
|
190
|
+
validateFields: G,
|
|
191
|
+
getFieldsValue: c,
|
|
192
|
+
validate: Q,
|
|
193
|
+
scrollToField: X,
|
|
194
|
+
setFieldsValue: Y,
|
|
192
195
|
setFieldValue: v,
|
|
193
|
-
registerWatch:
|
|
194
|
-
validateFieldsReturnTransformed:
|
|
195
|
-
getFieldsValueTransformed:
|
|
196
|
-
getInternalInstance:
|
|
196
|
+
registerWatch: I,
|
|
197
|
+
validateFieldsReturnTransformed: H,
|
|
198
|
+
getFieldsValueTransformed: J,
|
|
199
|
+
getInternalInstance: ee
|
|
197
200
|
};
|
|
198
|
-
|
|
201
|
+
ae(
|
|
199
202
|
() => r.name,
|
|
200
203
|
(e) => {
|
|
201
|
-
e && (
|
|
202
|
-
|
|
204
|
+
e && (g.registerForm(e, _), se(() => {
|
|
205
|
+
g.unregisterForm(r.name);
|
|
203
206
|
}));
|
|
204
207
|
},
|
|
205
208
|
{
|
|
206
209
|
immediate: !0
|
|
207
210
|
}
|
|
208
|
-
)
|
|
209
|
-
|
|
211
|
+
);
|
|
212
|
+
function te(e) {
|
|
213
|
+
return e.map((t, o) => o === 0 && ue(t) && r.autoFocusFirstInput ? ce(t, { autoFocus: r.autoFocusFirstInput }) : t);
|
|
214
|
+
}
|
|
215
|
+
return Ve({
|
|
216
|
+
model: fe(() => n),
|
|
210
217
|
updateModel: y,
|
|
211
218
|
internalInstance: {
|
|
212
|
-
registerWatch:
|
|
213
|
-
registerField:
|
|
219
|
+
registerWatch: I,
|
|
220
|
+
registerField: M,
|
|
214
221
|
setFieldValue: v,
|
|
215
|
-
getInitialValues:
|
|
216
|
-
updateInitialModel:
|
|
222
|
+
getInitialValues: w,
|
|
223
|
+
updateInitialModel: C
|
|
217
224
|
}
|
|
218
|
-
}),
|
|
225
|
+
}), x(_), (e, t) => (k(), b(f(pe), de(
|
|
219
226
|
{
|
|
220
227
|
ref_key: "formRef",
|
|
221
228
|
ref: a
|
|
222
229
|
},
|
|
223
|
-
|
|
230
|
+
f(Fe)(r, [
|
|
224
231
|
"initialValues",
|
|
225
232
|
"onValuesChange",
|
|
226
233
|
"onFinish",
|
|
227
234
|
"syncToUrl",
|
|
228
|
-
"syncToUrlPriority"
|
|
235
|
+
"syncToUrlPriority",
|
|
236
|
+
"autoFocusFirstInput"
|
|
229
237
|
]),
|
|
230
238
|
{
|
|
231
239
|
model: n,
|
|
232
240
|
"data-form-name": e.name,
|
|
233
|
-
onFinish:
|
|
241
|
+
onFinish: $
|
|
234
242
|
}
|
|
235
243
|
), {
|
|
236
|
-
default:
|
|
237
|
-
|
|
244
|
+
default: E(() => [
|
|
245
|
+
e.autoFocusFirstInput ? (k(), b(f(Ie), {
|
|
246
|
+
key: 1,
|
|
247
|
+
renderer: te
|
|
248
|
+
}, {
|
|
249
|
+
default: E(() => [
|
|
250
|
+
N(e.$slots, "default")
|
|
251
|
+
]),
|
|
252
|
+
_: 3
|
|
253
|
+
})) : N(e.$slots, "default", { key: 0 })
|
|
238
254
|
]),
|
|
239
255
|
_: 3
|
|
240
256
|
}, 16, ["model", "data-form-name"]));
|
|
241
257
|
}
|
|
242
258
|
});
|
|
243
259
|
export {
|
|
244
|
-
|
|
260
|
+
Se as default
|
|
245
261
|
};
|
|
@@ -120,6 +120,7 @@ declare function __VLS_template(): {
|
|
|
120
120
|
readonly onValuesChange?: ((changedValues: Recordable, allValues: Recordable, fieldName: NamePath) => void) | undefined;
|
|
121
121
|
readonly syncToUrl?: boolean | ((values: Recordable, type: "get" | "set") => Recordable) | undefined;
|
|
122
122
|
readonly syncToUrlPriority?: boolean | undefined;
|
|
123
|
+
readonly autoFocusFirstInput?: boolean | undefined;
|
|
123
124
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
124
125
|
$attrs: {
|
|
125
126
|
[x: string]: unknown;
|
|
@@ -845,6 +846,7 @@ declare function __VLS_template(): {
|
|
|
845
846
|
}> & {} & ComponentCustomProperties & {} & {
|
|
846
847
|
$slots: {
|
|
847
848
|
default?(_: {}): any;
|
|
849
|
+
default?(_: {}): any;
|
|
848
850
|
};
|
|
849
851
|
}) | null;
|
|
850
852
|
};
|
|
@@ -1088,6 +1090,7 @@ declare const __VLS_component: DefineComponent<ApFormDrawerFormProps, {
|
|
|
1088
1090
|
readonly onValuesChange?: ((changedValues: Recordable, allValues: Recordable, fieldName: NamePath) => void) | undefined;
|
|
1089
1091
|
readonly syncToUrl?: boolean | ((values: Recordable, type: "get" | "set") => Recordable) | undefined;
|
|
1090
1092
|
readonly syncToUrlPriority?: boolean | undefined;
|
|
1093
|
+
readonly autoFocusFirstInput?: boolean | undefined;
|
|
1091
1094
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
1092
1095
|
$attrs: {
|
|
1093
1096
|
[x: string]: unknown;
|
|
@@ -1813,6 +1816,7 @@ declare const __VLS_component: DefineComponent<ApFormDrawerFormProps, {
|
|
|
1813
1816
|
}> & {} & ComponentCustomProperties & {} & {
|
|
1814
1817
|
$slots: {
|
|
1815
1818
|
default?(_: {}): any;
|
|
1819
|
+
default?(_: {}): any;
|
|
1816
1820
|
};
|
|
1817
1821
|
}) | null;
|
|
1818
1822
|
}, any>;
|