@aplus-frontend/ui 7.13.12 → 7.14.1

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.
Files changed (103) hide show
  1. package/es/index.mjs +58 -56
  2. package/es/src/ap-field/text/index.vue2.mjs +2 -2
  3. package/es/src/ap-field/text/password.vue.mjs +8 -8
  4. package/es/src/ap-form/ap-form.vue.d.ts +1 -0
  5. package/es/src/ap-form/ap-form.vue2.mjs +122 -106
  6. package/es/src/ap-form/drawer-form/index.vue.d.ts +4 -0
  7. package/es/src/ap-form/drawer-form/index.vue.mjs +13 -10
  8. package/es/src/ap-form/interface.d.ts +5 -0
  9. package/es/src/ap-form/item/index.vue.d.ts +1 -0
  10. package/es/src/ap-form/item/index.vue.mjs +84 -70
  11. package/es/src/ap-form/items/checkbox/index.vue.mjs +9 -8
  12. package/es/src/ap-form/items/date/index.vue.mjs +10 -9
  13. package/es/src/ap-form/items/date-range/index.vue.mjs +10 -9
  14. package/es/src/ap-form/items/number/index.vue.mjs +7 -6
  15. package/es/src/ap-form/items/radio/index.vue.mjs +9 -8
  16. package/es/src/ap-form/items/select/index.vue.mjs +3 -2
  17. package/es/src/ap-form/items/switch/index.vue.mjs +10 -9
  18. package/es/src/ap-form/items/text/index.vue2.mjs +6 -5
  19. package/es/src/ap-form/items/text/password.vue.mjs +10 -9
  20. package/es/src/ap-form/items/text-area/index.vue.mjs +4 -3
  21. package/es/src/ap-form/items/tree-select/index.vue.mjs +1 -0
  22. package/es/src/ap-form/modal-form/index.vue.d.ts +4 -0
  23. package/es/src/ap-form/modal-form/index.vue.mjs +3 -0
  24. package/es/src/ap-form/render/item.vue.mjs +6 -5
  25. package/es/src/ap-form/search-form/index.vue.d.ts +4 -0
  26. package/es/src/ap-form/search-form/index.vue.mjs +26 -23
  27. package/es/src/ap-table/ap-table.vue2.mjs +2 -2
  28. package/es/src/ap-table/components/setting/index.d.ts +2 -0
  29. package/es/src/ap-table/components/setting/index.mjs +5 -0
  30. package/es/src/ap-table/components/setting/modal/index.vue.mjs +277 -2
  31. package/es/src/ap-table/components/setting/modal/index.vue2.mjs +2 -273
  32. package/es/src/ap-table/components/setting/select-group/index.vue2.mjs +11 -8
  33. package/es/src/ap-table/components/setting/template/edit-form.vue.d.ts +2 -0
  34. package/es/src/ap-table/components/setting/template/item.vue2.mjs +35 -35
  35. package/es/src/ap-table/hooks/use-table-template-storage.mjs +55 -54
  36. package/es/src/ap-table/index.d.ts +2 -2
  37. package/es/src/ap-table/index.mjs +7 -6
  38. package/es/src/ap-table/interface.d.ts +16 -0
  39. package/es/src/business/ap-image/ApImage.vue2.mjs +32 -32
  40. package/es/src/business/ap-image/style/index.mjs +9 -8
  41. package/es/src/business/ap-size-input/form-item.vue.mjs +6 -5
  42. package/es/src/business/ap-view/components/main-button-content.vue.d.ts +2 -0
  43. package/es/src/business/ap-view/components/menu-list-content.vue.d.ts +2 -0
  44. package/es/src/business/batch-input-group/form-item.vue.mjs +8 -7
  45. package/es/src/index.mjs +54 -52
  46. package/es/src/locale/lang/en.mjs +1 -0
  47. package/es/src/locale/lang/zh-cn.mjs +1 -0
  48. package/es/src/render/render.d.ts +7 -4
  49. package/es/src/render/render.mjs +17 -7
  50. package/es/src/version.d.ts +1 -1
  51. package/es/src/version.mjs +1 -1
  52. package/lib/index.js +1 -1
  53. package/lib/src/ap-field/text/index.vue2.js +1 -1
  54. package/lib/src/ap-field/text/password.vue.js +1 -1
  55. package/lib/src/ap-form/ap-form.vue.d.ts +1 -0
  56. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  57. package/lib/src/ap-form/drawer-form/index.vue.d.ts +4 -0
  58. package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
  59. package/lib/src/ap-form/interface.d.ts +5 -0
  60. package/lib/src/ap-form/item/index.vue.d.ts +1 -0
  61. package/lib/src/ap-form/item/index.vue.js +1 -1
  62. package/lib/src/ap-form/items/checkbox/index.vue.js +1 -1
  63. package/lib/src/ap-form/items/date/index.vue.js +1 -1
  64. package/lib/src/ap-form/items/date-range/index.vue.js +1 -1
  65. package/lib/src/ap-form/items/number/index.vue.js +1 -1
  66. package/lib/src/ap-form/items/radio/index.vue.js +1 -1
  67. package/lib/src/ap-form/items/select/index.vue.js +1 -1
  68. package/lib/src/ap-form/items/switch/index.vue.js +1 -1
  69. package/lib/src/ap-form/items/text/index.vue2.js +1 -1
  70. package/lib/src/ap-form/items/text/password.vue.js +1 -1
  71. package/lib/src/ap-form/items/text-area/index.vue.js +1 -1
  72. package/lib/src/ap-form/items/tree-select/index.vue.js +1 -1
  73. package/lib/src/ap-form/modal-form/index.vue.d.ts +4 -0
  74. package/lib/src/ap-form/modal-form/index.vue.js +1 -1
  75. package/lib/src/ap-form/render/item.vue.js +1 -1
  76. package/lib/src/ap-form/search-form/index.vue.d.ts +4 -0
  77. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  78. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  79. package/lib/src/ap-table/components/setting/index.d.ts +2 -0
  80. package/lib/src/ap-table/components/setting/index.js +1 -0
  81. package/lib/src/ap-table/components/setting/modal/index.vue.js +1 -1
  82. package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
  83. package/lib/src/ap-table/components/setting/select-group/index.vue2.js +1 -1
  84. package/lib/src/ap-table/components/setting/template/edit-form.vue.d.ts +2 -0
  85. package/lib/src/ap-table/components/setting/template/item.vue2.js +1 -1
  86. package/lib/src/ap-table/hooks/use-table-template-storage.js +1 -1
  87. package/lib/src/ap-table/index.d.ts +2 -2
  88. package/lib/src/ap-table/index.js +1 -1
  89. package/lib/src/ap-table/interface.d.ts +16 -0
  90. package/lib/src/business/ap-image/ApImage.vue2.js +1 -1
  91. package/lib/src/business/ap-image/style/index.js +1 -1
  92. package/lib/src/business/ap-size-input/form-item.vue.js +1 -1
  93. package/lib/src/business/ap-view/components/main-button-content.vue.d.ts +2 -0
  94. package/lib/src/business/ap-view/components/menu-list-content.vue.d.ts +2 -0
  95. package/lib/src/business/batch-input-group/form-item.vue.js +1 -1
  96. package/lib/src/index.js +1 -1
  97. package/lib/src/locale/lang/en.js +1 -1
  98. package/lib/src/locale/lang/zh-cn.js +1 -1
  99. package/lib/src/render/render.d.ts +7 -4
  100. package/lib/src/render/render.js +1 -1
  101. package/lib/src/version.d.ts +1 -1
  102. package/lib/src/version.js +1 -1
  103. package/package.json +3 -3
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/editable-table/index.vue.mjs";
130
- import { default as np } from "./src/editable-table/form-item.vue.mjs";
131
- import { ensureRangeValue as Fp } from "./src/scroll-bar/utils/index.mjs";
132
- import { default as Ip } from "./src/scroll-bar/index.vue.mjs";
133
- import { default as Tp } from "./src/scroll-bar/internal.vue.mjs";
134
- import { default as Cp } from "./src/scroll-view/index.vue.mjs";
135
- import { default as Dp } from "./src/portal/index.vue.mjs";
136
- import { default as Pp } from "./src/full-screen/index.vue.mjs";
137
- import { default as Lp } from "./src/resize-observer/index.vue.mjs";
138
- import { ROW_SELECTION_FIELD as vp } from "./src/ap-grid/constants.mjs";
139
- import { toTreeArray as Mp } from "./src/ap-grid/utils/to-tree-array.mjs";
140
- import { default as yp } from "./src/ap-grid/index.vue.mjs";
141
- import { default as kp } from "./src/ap-grid/editable/index.vue.mjs";
142
- import { default as Up } from "./src/ap-grid/editable/form-item.vue.mjs";
143
- import { default as Vp } from "./src/text/index.vue.mjs";
144
- import { default as _p } from "./src/text/group.vue.mjs";
145
- import { default as $p } from "./src/mask/index.vue.mjs";
146
- import { Splitter as Wp } from "./src/splitter/index.mjs";
147
- import { default as Jp } from "./src/ag-grid/index.vue.mjs";
148
- import { default as Xp } from "./src/ag-grid/editable/index.vue.mjs";
149
- import { default as Zp } from "./src/ag-grid/editable/form-item.vue.mjs";
150
- import { ApSkeleton as oa } from "./src/skeleton/index.mjs";
151
- import { useMessage as ta } from "./src/hooks/useMessage.mjs";
152
- import { useControllableValue as aa } from "./src/hooks/useControllableValue.mjs";
153
- import { useManualRef as ma } from "./src/hooks/useManualRef.mjs";
154
- import { useThrottleRef as xa } from "./src/hooks/useThrottleRef.mjs";
155
- import { useFullScreen as sa } from "./src/hooks/useFullScreen.mjs";
156
- import { useResize as Aa } from "./src/hooks/useResize.mjs";
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
- Jp as AgGrid,
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
- yp as ApGrid,
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
- oa as ApSkeleton,
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
- Vp as ApText,
263
- _p as ApTextGroup,
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
- Xp as EditableAgGrid,
277
- Zp as EditableAgGridFormItem,
278
- kp as EditableGrid,
279
- Up as EditableGridFormItem,
280
- Ap as EditableTable,
281
- np as EditableTableFormItem,
282
- Pp as FullScreen,
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
- Tp as InternalScrollBar,
286
+ Cp as InternalScrollBar,
285
287
  Vo as LoadingBar,
286
288
  Lt as LruCacher,
287
- $p as Mask,
289
+ Wp as Mask,
288
290
  Jt as NeedNameKeyDefault,
289
- Dp as Portal,
290
- vp as ROW_SELECTION_FIELD,
291
+ Pp as Portal,
292
+ Mp as ROW_SELECTION_FIELD,
291
293
  _o as Render,
292
- Lp as ResizeObserver,
293
- Ip as ScrollBar,
294
- Cp as ScrollView,
295
- Wp as Splitter,
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
- Fp as ensureRangeValue,
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
- Mp as toTreeArray,
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
- aa as useControllableValue,
327
- sa as useFullScreen,
328
+ ma as useControllableValue,
329
+ Aa as useFullScreen,
328
330
  L as useGetDerivedNamespace,
329
331
  I as useGlobalConfig,
330
332
  D as useLocale,
331
- ma as useManualRef,
332
- ta as useMessage,
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
- Aa as useResize,
339
+ na as useResize,
338
340
  or as useTableModal,
339
341
  xp as useTablePaging,
340
342
  tr as useTableSelectModal,
341
- xa as useThrottleRef,
343
+ sa as useThrottleRef,
342
344
  Wo as useTimeAgo
343
345
  };
@@ -132,8 +132,8 @@ const $ = /* @__PURE__ */ C({
132
132
  select: b,
133
133
  input: w(() => t.value?.input)
134
134
  }), (o, u) => (T(), V(r(M), {
135
- renderer: I
136
- }));
135
+ node: I()
136
+ }, null, 8, ["node"]));
137
137
  }
138
138
  });
139
139
  export {
@@ -112,13 +112,13 @@ const J = /* @__PURE__ */ h({
112
112
  expose: c,
113
113
  emit: f
114
114
  }) {
115
- const r = f, o = t, u = g(), i = w(), {
115
+ const s = f, o = t, u = g(), i = w(), {
116
116
  value: m,
117
117
  updateValue: v
118
- } = p(o, r), y = R("TextPassword", o), {
118
+ } = p(o, s), y = R("TextPassword", o), {
119
119
  value: b,
120
- updateValue: s
121
- } = p(o, r, {
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": s,
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: () => s(!l)
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
- renderer: B
156
- }));
155
+ node: B()
156
+ }, null, 8, ["node"]));
157
157
  }
158
158
  });
159
159
  export {
@@ -13,6 +13,7 @@ declare function __VLS_template(): {
13
13
  attrs: Partial<{}>;
14
14
  slots: {
15
15
  default?(_: {}): any;
16
+ default?(_: {}): any;
16
17
  };
17
18
  refs: {
18
19
  formRef: CreateComponentPublicInstanceWithMixins<Readonly< ExtractPropTypes<{
@@ -1,18 +1,20 @@
1
- import { defineComponent as Y, reactive as Z, shallowRef as z, ref as ee, unref as g, nextTick as te, toRaw as U, watch as re, onWatcherCleanup as oe, computed as ne, createBlock as ie, openBlock as le, mergeProps as ae, withCtx as se, renderSlot as ue } from "vue";
2
- import { Form as fe } from "@aplus-frontend/antdv";
3
- import { useUrlSearchParams as ce } from "@vueuse/core";
4
- import { isArray as P, cloneDeep as b, isEqual as de, omit as ge } from "lodash-unified";
5
- import { useDevWarning as pe } from "../utils/warning.mjs";
6
- import { getRouteType as me } from "../utils/index.mjs";
7
- import { INTERNAL_FORM_INSTANCE_MARK as E } from "./constant.mjs";
8
- import { useProvideForm as he } from "./context.mjs";
9
- import { useInjectFormProvider as Fe } from "./provider/context.mjs";
10
- import { getModelValue as x } from "./utils/get.mjs";
11
- import { genParams as R, setToParams as O } from "./utils/params.mjs";
12
- import ye from "./utils/set.mjs";
13
- import { transformValues as h } from "./utils/transform.mjs";
14
- import { isDef as F } from "../utils/is.mjs";
15
- const Ee = /* @__PURE__ */ Y({
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(W, { expose: j }) {
48
- const r = W;
50
+ setup(q, { expose: x }) {
51
+ const r = q;
49
52
  function y(e, t, o = !0, i) {
50
- if (P(e)) {
53
+ if (R(e)) {
51
54
  let l = n;
52
- for (let d = 0; d < e.length - 1; d++)
53
- e[d] in l || (l[e[d]] = {}), l = l[e[d]];
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 = P(e) ? e[0] : e;
60
+ let A = R(e) ? e[0] : e;
58
61
  if (o) {
59
62
  const l = { [A]: n[A] };
60
- p.triggerFormChange(r.name, l), r.onValuesChange?.(l, n, e);
63
+ g.triggerFormChange(r.name, l), r.onValuesChange?.(l, n, e);
61
64
  }
62
65
  m();
63
66
  }
64
- const a = z(), T = ce(me()), p = Fe(), k = pe("ApForm"), V = ee(
65
- r.syncToUrl ? R(r.syncToUrl, T, "get") : {}
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 = b(M()), u = {};
68
- const n = Z(M());
69
- let c = [];
70
- function M() {
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
- ...g(V)
77
+ ...f(T)
75
78
  } : {
76
- ...g(V),
79
+ ...f(T),
77
80
  ...e
78
81
  };
79
82
  }
80
- function N(e) {
81
- const t = h(
83
+ function $(e) {
84
+ const t = F(
82
85
  e,
83
86
  u,
84
- f
87
+ c
85
88
  );
86
- p.triggerFormFinish(r.name, e), r.syncToUrl && O(T, R(r.syncToUrl, t, "set")), r.onFinish?.(t);
89
+ g.triggerFormFinish(r.name, e), r.syncToUrl && S(V, P(r.syncToUrl, t, "set")), r.onFinish?.(t);
87
90
  }
88
- const S = async () => {
89
- a.value?.resetFields(), await te(() => {
90
- Object.keys(n).forEach((e) => delete n[e]), Object.assign(n, b(s)), m(), r.syncToUrl && O(
91
- T,
92
- R(
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
- h(
97
+ F(
95
98
  s,
96
99
  u,
97
- f
100
+ c
98
101
  ),
99
102
  "set"
100
103
  )
101
104
  );
102
105
  });
103
- }, q = (e) => {
106
+ }, L = (e) => {
104
107
  a.value?.clearValidate(e);
105
- }, D = (e, t) => a.value?.validateFields(e, t), K = async (e, t) => {
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 h(
113
+ return F(
111
114
  o,
112
115
  u,
113
- f
116
+ c
114
117
  );
115
- }, f = (e) => e === !0 ? U(n) : a.value?.getFieldsValue(e), L = (e) => {
116
- const t = f(e);
117
- return h(t, u, f);
118
- }, $ = (e, t) => a.value?.validate(e, t), G = (e, t = {}) => {
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
- }, H = (e) => {
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 C(e) {
126
- return e(U(n)), c.push(e), () => {
127
- c = c.filter((t) => t !== e);
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 I(e, t) {
131
- if (P(e)) {
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
- F(o[e[i]]) || (o[e[i]] = {}), o = o[e[i]];
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 J(e, t) {
140
- if (!F(e) || !F(t))
142
+ function Z(e, t) {
143
+ if (!h(e) || !h(t))
141
144
  return;
142
- const o = x(s, t);
143
- if (de(o, e))
145
+ const o = j(s, t);
146
+ if (me(o, e))
144
147
  return;
145
- const i = x(g(V), t);
146
- F(i) && r.syncToUrlPriority || (y(t, e, !1), I(t, e));
148
+ const i = j(f(T), t);
149
+ h(i) && r.syncToUrlPriority || (y(t, e, !1), C(t, e));
147
150
  }
148
- function Q(e, t) {
149
- t && (u = ye(
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 B({ initialValue: e, name: t, transform: o }) {
157
- J(e, t), Q(t, o);
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 X(e) {
163
- if (k(
164
- e === E,
165
+ function ee(e) {
166
+ if (D(
167
+ e === W,
165
168
  "usage",
166
169
  "getInternalInstance should only used at internal"
167
- ), e === E)
170
+ ), e === W)
168
171
  return {
169
- registerField: B,
170
- registerWatch: C,
172
+ registerField: M,
173
+ registerWatch: I,
171
174
  setFieldValue: v,
172
- getInitialValues: _,
173
- updateInitialModel: I
175
+ getInitialValues: w,
176
+ updateInitialModel: C
174
177
  };
175
178
  }
176
179
  function m() {
177
- if (c.length) {
180
+ if (d.length) {
178
181
  const e = U(n);
179
- c.forEach((t) => {
182
+ d.forEach((t) => {
180
183
  t(e);
181
184
  });
182
185
  }
183
186
  }
184
- const w = {
185
- resetFields: S,
186
- clearValidate: q,
187
- validateFields: D,
188
- getFieldsValue: f,
189
- validate: $,
190
- scrollToField: G,
191
- setFieldsValue: H,
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: C,
194
- validateFieldsReturnTransformed: K,
195
- getFieldsValueTransformed: L,
196
- getInternalInstance: X
196
+ registerWatch: I,
197
+ validateFieldsReturnTransformed: H,
198
+ getFieldsValueTransformed: J,
199
+ getInternalInstance: ee
197
200
  };
198
- return re(
201
+ ae(
199
202
  () => r.name,
200
203
  (e) => {
201
- e && (p.registerForm(e, w), oe(() => {
202
- p.unregisterForm(r.name);
204
+ e && (g.registerForm(e, _), se(() => {
205
+ g.unregisterForm(r.name);
203
206
  }));
204
207
  },
205
208
  {
206
209
  immediate: !0
207
210
  }
208
- ), he({
209
- model: ne(() => n),
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: C,
213
- registerField: B,
219
+ registerWatch: I,
220
+ registerField: M,
214
221
  setFieldValue: v,
215
- getInitialValues: _,
216
- updateInitialModel: I
222
+ getInitialValues: w,
223
+ updateInitialModel: C
217
224
  }
218
- }), j(w), (e, t) => (le(), ie(g(fe), ae(
225
+ }), x(_), (e, t) => (k(), b(f(pe), de(
219
226
  {
220
227
  ref_key: "formRef",
221
228
  ref: a
222
229
  },
223
- g(ge)(r, [
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: N
241
+ onFinish: $
234
242
  }
235
243
  ), {
236
- default: se(() => [
237
- ue(e.$slots, "default")
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
- Ee as default
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>;