@aplus-frontend/ui 7.17.0 → 7.17.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 (121) hide show
  1. package/es/src/ap-field/cascader/index.vue.mjs +86 -131
  2. package/es/src/ap-field/cascader/read.vue2.mjs +36 -35
  3. package/es/src/ap-field/checkbox/index.vue.d.ts +18 -1
  4. package/es/src/ap-field/checkbox/index.vue.mjs +42 -43
  5. package/es/src/ap-field/checkbox/read.vue2.mjs +1 -1
  6. package/es/src/ap-field/date/index.vue.mjs +48 -48
  7. package/es/src/ap-field/date/read.vue2.mjs +1 -1
  8. package/es/src/ap-field/date-range/index.vue.mjs +31 -31
  9. package/es/src/ap-field/date-range/read.vue2.mjs +1 -1
  10. package/es/src/ap-field/interface.d.ts +7 -22
  11. package/es/src/ap-field/number/index.vue.mjs +36 -34
  12. package/es/src/ap-field/number/read.vue2.mjs +1 -1
  13. package/es/src/ap-field/radio/index.vue.mjs +34 -42
  14. package/es/src/ap-field/radio/read.vue2.mjs +1 -1
  15. package/es/src/ap-field/rate/index.vue.mjs +23 -23
  16. package/es/src/ap-field/second/index.vue.mjs +27 -29
  17. package/es/src/ap-field/second/read.vue2.mjs +2 -2
  18. package/es/src/ap-field/segmented/index.vue.mjs +37 -37
  19. package/es/src/ap-field/select/index.vue.mjs +90 -92
  20. package/es/src/ap-field/select/read.vue2.mjs +1 -1
  21. package/es/src/ap-field/slider/index.vue.mjs +35 -37
  22. package/es/src/ap-field/switch/index.vue.mjs +38 -38
  23. package/es/src/ap-field/switch/read.vue2.mjs +3 -3
  24. package/es/src/ap-field/text/index.vue.d.ts +478 -3
  25. package/es/src/ap-field/text/index.vue2.mjs +47 -46
  26. package/es/src/ap-field/text/password.vue.d.ts +549 -3
  27. package/es/src/ap-field/text/password.vue.mjs +61 -56
  28. package/es/src/ap-field/text/read-password.vue2.mjs +16 -16
  29. package/es/src/ap-field/text/read.vue2.mjs +1 -1
  30. package/es/src/ap-field/text-area/index.vue.mjs +29 -31
  31. package/es/src/ap-field/text-area/read.vue2.mjs +1 -1
  32. package/es/src/ap-field/tree-select/index.vue.mjs +47 -47
  33. package/es/src/ap-field/tree-select/read.vue2.mjs +3 -3
  34. package/es/src/ap-form/drawer-form/index.vue.mjs +99 -90
  35. package/es/src/ap-form/hooks/use-regist-form.d.ts +7 -0
  36. package/es/src/ap-form/hooks/use-regist-form.mjs +24 -0
  37. package/es/src/ap-form/item/index.vue.d.ts +6 -6
  38. package/es/src/ap-form/item/index.vue.mjs +85 -94
  39. package/es/src/ap-form/item-group/index.vue.mjs +14 -14
  40. package/es/src/ap-form/items/cascader/index.vue.d.ts +2 -2
  41. package/es/src/ap-form/items/checkbox/index.vue.d.ts +159 -47
  42. package/es/src/ap-form/items/date/index.vue.d.ts +2 -2
  43. package/es/src/ap-form/items/date-range/index.vue.d.ts +2 -2
  44. package/es/src/ap-form/items/number/index.vue.d.ts +2 -2
  45. package/es/src/ap-form/items/select/index.vue.d.ts +2 -2
  46. package/es/src/ap-form/items/switch/index.vue.d.ts +2 -2
  47. package/es/src/ap-form/items/text/index.vue.d.ts +476 -4
  48. package/es/src/ap-form/items/text/password.vue.d.ts +547 -4
  49. package/es/src/ap-form/items/tree-select/index.vue.d.ts +2 -2
  50. package/es/src/ap-form/list/index.vue.mjs +29 -34
  51. package/es/src/ap-form/modal-form/index.vue.mjs +77 -68
  52. package/es/src/ap-form/set/index.vue.d.ts +2 -4
  53. package/es/src/ap-form/set/index.vue.mjs +23 -18
  54. package/es/src/ap-grid/index.vue.mjs +1 -1
  55. package/es/src/ap-table/constants.d.ts +593 -31
  56. package/es/src/ap-table/utils.d.ts +1 -1
  57. package/es/src/business/batch-input-group/index.vue.d.ts +240 -3
  58. package/es/src/business/batch-input-group/index.vue.mjs +1 -1
  59. package/es/src/version.d.ts +1 -1
  60. package/es/src/version.mjs +1 -1
  61. package/lib/src/ap-field/cascader/index.vue.js +1 -1
  62. package/lib/src/ap-field/cascader/read.vue2.js +1 -1
  63. package/lib/src/ap-field/checkbox/index.vue.d.ts +18 -1
  64. package/lib/src/ap-field/checkbox/index.vue.js +1 -1
  65. package/lib/src/ap-field/checkbox/read.vue2.js +1 -1
  66. package/lib/src/ap-field/date/index.vue.js +1 -1
  67. package/lib/src/ap-field/date/read.vue2.js +1 -1
  68. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  69. package/lib/src/ap-field/date-range/read.vue2.js +1 -1
  70. package/lib/src/ap-field/interface.d.ts +7 -22
  71. package/lib/src/ap-field/number/index.vue.js +1 -1
  72. package/lib/src/ap-field/number/read.vue2.js +1 -1
  73. package/lib/src/ap-field/radio/index.vue.js +1 -1
  74. package/lib/src/ap-field/radio/read.vue2.js +1 -1
  75. package/lib/src/ap-field/rate/index.vue.js +1 -1
  76. package/lib/src/ap-field/second/index.vue.js +1 -1
  77. package/lib/src/ap-field/second/read.vue2.js +1 -1
  78. package/lib/src/ap-field/segmented/index.vue.js +1 -1
  79. package/lib/src/ap-field/select/index.vue.js +1 -1
  80. package/lib/src/ap-field/select/read.vue2.js +1 -1
  81. package/lib/src/ap-field/slider/index.vue.js +1 -1
  82. package/lib/src/ap-field/switch/index.vue.js +1 -1
  83. package/lib/src/ap-field/switch/read.vue2.js +1 -1
  84. package/lib/src/ap-field/text/index.vue.d.ts +478 -3
  85. package/lib/src/ap-field/text/index.vue2.js +1 -1
  86. package/lib/src/ap-field/text/password.vue.d.ts +549 -3
  87. package/lib/src/ap-field/text/password.vue.js +1 -1
  88. package/lib/src/ap-field/text/read-password.vue2.js +1 -1
  89. package/lib/src/ap-field/text/read.vue2.js +1 -1
  90. package/lib/src/ap-field/text-area/index.vue.js +1 -1
  91. package/lib/src/ap-field/text-area/read.vue2.js +1 -1
  92. package/lib/src/ap-field/tree-select/index.vue.js +1 -1
  93. package/lib/src/ap-field/tree-select/read.vue2.js +1 -1
  94. package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
  95. package/lib/src/ap-form/hooks/use-regist-form.d.ts +7 -0
  96. package/lib/src/ap-form/hooks/use-regist-form.js +1 -0
  97. package/lib/src/ap-form/item/index.vue.d.ts +6 -6
  98. package/lib/src/ap-form/item/index.vue.js +1 -1
  99. package/lib/src/ap-form/item-group/index.vue.js +1 -1
  100. package/lib/src/ap-form/items/cascader/index.vue.d.ts +2 -2
  101. package/lib/src/ap-form/items/checkbox/index.vue.d.ts +159 -47
  102. package/lib/src/ap-form/items/date/index.vue.d.ts +2 -2
  103. package/lib/src/ap-form/items/date-range/index.vue.d.ts +2 -2
  104. package/lib/src/ap-form/items/number/index.vue.d.ts +2 -2
  105. package/lib/src/ap-form/items/select/index.vue.d.ts +2 -2
  106. package/lib/src/ap-form/items/switch/index.vue.d.ts +2 -2
  107. package/lib/src/ap-form/items/text/index.vue.d.ts +476 -4
  108. package/lib/src/ap-form/items/text/password.vue.d.ts +547 -4
  109. package/lib/src/ap-form/items/tree-select/index.vue.d.ts +2 -2
  110. package/lib/src/ap-form/list/index.vue.js +1 -1
  111. package/lib/src/ap-form/modal-form/index.vue.js +1 -1
  112. package/lib/src/ap-form/set/index.vue.d.ts +2 -4
  113. package/lib/src/ap-form/set/index.vue.js +1 -1
  114. package/lib/src/ap-grid/index.vue.js +1 -1
  115. package/lib/src/ap-table/constants.d.ts +593 -31
  116. package/lib/src/ap-table/utils.d.ts +1 -1
  117. package/lib/src/business/batch-input-group/index.vue.d.ts +240 -3
  118. package/lib/src/business/batch-input-group/index.vue.js +1 -1
  119. package/lib/src/version.d.ts +1 -1
  120. package/lib/src/version.js +1 -1
  121. package/package.json +1 -1
@@ -1,9 +1,10 @@
1
- import { isVNode as q, defineComponent as A, useSlots as E, shallowRef as L, ref as v, watch as G, computed as T, unref as l, cloneVNode as H, createVNode as o, mergeProps as m, createElementBlock as J, openBlock as h, Fragment as K, createBlock as w, createCommentVNode as Q, withCtx as c, renderSlot as B, resolveDynamicComponent as R, createTextVNode as X, toDisplayString as Y } from "vue";
2
- import { Button as b, Flex as Z, Space as ee, Drawer as te } from "@aplus-frontend/antdv";
3
- import { isBoolean as ie, isUndefined as ae, omit as le } from "lodash-unified";
1
+ import { isVNode as A, defineComponent as E, computed as m, useSlots as L, shallowRef as G, ref as h, watch as H, unref as i, cloneVNode as J, createVNode as o, mergeProps as c, createElementBlock as K, openBlock as b, Fragment as Q, createBlock as w, createCommentVNode as B, withCtx as f, renderSlot as R, createTextVNode as X, toDisplayString as Y } from "vue";
2
+ import { Button as F, Flex as Z, Space as ee, Drawer as te } from "@aplus-frontend/antdv";
3
+ import { omit as ae, isBoolean as le, isUndefined as ie } from "lodash-unified";
4
+ import "../../render/index.mjs";
4
5
  import "../../config-provider/index.mjs";
5
6
  import "../../hooks/index.mjs";
6
- import { getNumberPx as F, convertReactiveToRaw as ne } from "../../utils/index.mjs";
7
+ import { getNumberPx as g, convertReactiveToRaw as ne } from "../../utils/index.mjs";
7
8
  import { getSingleVNode as oe } from "../../utils/slot.mjs";
8
9
  import "../ap-form.vue.mjs";
9
10
  import se from "../style/drawer-form.mjs";
@@ -11,10 +12,11 @@ import { useControllableValue as re } from "../../hooks/useControllableValue.mjs
11
12
  import { useLocale as ue } from "../../config-provider/hooks/use-locale.mjs";
12
13
  import { useNamespace as de } from "../../config-provider/hooks/use-namespace.mjs";
13
14
  import me from "../ap-form.vue2.mjs";
14
- function x(s) {
15
- return typeof s == "function" || Object.prototype.toString.call(s) === "[object Object]" && !q(s);
15
+ import x from "../../render/render.mjs";
16
+ function O(s) {
17
+ return typeof s == "function" || Object.prototype.toString.call(s) === "[object Object]" && !A(s);
16
18
  }
17
- const Se = /* @__PURE__ */ A({
19
+ const Ie = /* @__PURE__ */ E({
18
20
  name: "ApFormDrawerForm",
19
21
  __name: "index",
20
22
  props: {
@@ -101,24 +103,24 @@ const Se = /* @__PURE__ */ A({
101
103
  },
102
104
  emits: ["update:open"],
103
105
  setup(s, {
104
- expose: O,
105
- emit: k
106
+ expose: k,
107
+ emit: W
106
108
  }) {
107
- const t = s, f = E(), W = k, a = L(), r = v(), n = v(!1), {
108
- value: P,
109
+ const t = s, P = m(() => ae(t, ["drawerProps", "open", "onUpdate:open", "title", "width", "onFinish", "submitter"])), p = L(), N = W, l = G(), r = h(), n = h(!1), {
110
+ value: S,
109
111
  updateValue: u
110
- } = re(t, W, {
112
+ } = re(t, N, {
111
113
  valuePropName: "open",
112
114
  defaultValue: !1
113
115
  }), {
114
- t: p
115
- } = ue(), N = se("ap-form-drawer-form"), {
116
- b: S
116
+ t: v
117
+ } = ue(), _ = se("ap-form-drawer-form"), {
118
+ b: I
117
119
  } = de("ap-form-drawer-form");
118
- G(() => a.value, (e) => {
120
+ H(() => l.value, (e) => {
119
121
  e && r.value && (e.setFieldsValue?.(r.value), r.value = void 0);
120
122
  });
121
- const d = T(() => {
123
+ const d = m(() => {
122
124
  const e = {
123
125
  onResize: () => {
124
126
  },
@@ -126,143 +128,150 @@ const Se = /* @__PURE__ */ A({
126
128
  maxWidth: window.innerWidth * 0.8,
127
129
  resizeOnOpen: !0
128
130
  };
129
- return ie(t.resize) ? t.resize ? e : {} : {
131
+ return le(t.resize) ? t.resize ? e : {} : {
130
132
  minWidth: t.resize?.minWidth ?? e.minWidth,
131
133
  maxWidth: t.resize?.maxWidth ?? e.maxWidth,
132
134
  onResize: t.resize?.onResize ?? e.onResize,
133
- resizeOnOpen: ae(t.resize?.resizeOnOpen) ? e.resizeOnOpen : t.resize.resizeOnOpen
135
+ resizeOnOpen: ie(t.resize?.resizeOnOpen) ? e.resizeOnOpen : t.resize.resizeOnOpen
134
136
  };
135
137
  });
136
- function _() {
137
- const e = l(d)?.minWidth;
138
+ function j() {
139
+ const e = i(d)?.minWidth;
138
140
  return !e || e && e < t.width ? t.width : e;
139
141
  }
140
- const g = v(F(_()));
141
- function I(e) {
142
+ const y = h(g(j()));
143
+ function U(e) {
142
144
  const {
143
- resizeOnOpen: i,
144
- onResize: C
145
+ resizeOnOpen: a,
146
+ onResize: T
145
147
  } = d.value;
146
- i && (g.value = e, C?.(e));
148
+ a && (y.value = e, T?.(e));
147
149
  }
148
- const y = oe(f.trigger), z = y ? H(y, {
149
- onClick: () => {
150
- u(!0);
151
- }
152
- }) : null, j = T(() => {
150
+ const z = m(() => {
151
+ const e = oe(p.trigger);
152
+ return e ? J(e, {
153
+ onClick: () => {
154
+ u(!0);
155
+ }
156
+ }) : null;
157
+ }), V = m(() => {
153
158
  const e = [];
154
159
  if (t.submitter === !1)
155
160
  return null;
156
161
  if (t.showCancel) {
157
- let i;
158
- e.push(o(b, {
159
- onClick: V,
162
+ let a;
163
+ e.push(o(F, {
164
+ onClick: C,
160
165
  disabled: n.value
161
- }, x(i = p("ap.common.cancelText")) ? i : {
162
- default: () => [i]
166
+ }, O(a = v("ap.common.cancelText")) ? a : {
167
+ default: () => [a]
163
168
  }));
164
169
  }
165
- return t.submitter?.resetButtonProps !== !1 && e.push(o(b, m(t.submitter?.resetButtonProps || {}, {
166
- key: "submit",
170
+ return t.submitter?.resetButtonProps !== !1 && e.push(o(F, c(t.submitter?.resetButtonProps || {}, {
171
+ key: "reset",
167
172
  disabled: n.value,
168
- onClick: U
173
+ onClick: M
169
174
  }), {
170
- default: () => [t.submitter?.resetText || p("ap.common.resetText")]
171
- })), t.submitter?.submitButtonProps !== !1 && e.push(o(b, m({
175
+ default: () => [t.submitter?.resetText || v("ap.common.resetText")]
176
+ })), t.submitter?.submitButtonProps !== !1 && e.push(o(F, c({
172
177
  type: "primary",
173
178
  key: "submit"
174
179
  }, t.submitter?.submitButtonProps || {}, {
175
180
  loading: n.value,
176
181
  onClick: D
177
182
  }), {
178
- default: () => [t.submitter?.submitText || p("ap.common.okText")]
183
+ default: () => [t.submitter?.submitText || v("ap.common.okText")]
179
184
  })), o(Z, {
180
185
  justify: "flex-end"
181
186
  }, {
182
- default: () => [f.submitter ? f.submitter(e) : o(ee, null, x(e) ? e : {
187
+ default: () => [p.submitter ? p.submitter(e) : o(ee, null, O(e) ? e : {
183
188
  default: () => [e]
184
189
  })]
185
190
  });
186
191
  });
187
- function U() {
188
- t.submitter !== !1 && (a.value?.resetFields(), t.submitter?.onReset?.());
192
+ function M() {
193
+ t.submitter !== !1 && (l.value?.resetFields(), t.submitter?.onReset?.());
189
194
  }
190
195
  async function D() {
191
196
  if (t.submitter !== !1)
192
197
  try {
193
- const e = await a.value?.validateFieldsReturnTransformed();
198
+ const e = await l.value?.validateFieldsReturnTransformed();
194
199
  t.submitter?.onSubmit?.(), n.value = !0;
195
- const i = t.onFinish?.(ne(e));
196
- if (t.submitTimeout && i instanceof Promise) {
197
- const $ = setTimeout(() => n.value = !1, t.submitTimeout);
198
- i.finally(() => {
199
- clearTimeout($), n.value = !1;
200
+ const a = t.onFinish?.(ne(e));
201
+ if (t.submitTimeout && a instanceof Promise) {
202
+ const q = setTimeout(() => n.value = !1, t.submitTimeout);
203
+ a.finally(() => {
204
+ clearTimeout(q), n.value = !1;
200
205
  });
201
206
  }
202
- await i && u(!1);
207
+ await a && u(!1);
203
208
  } finally {
204
209
  n.value = !1;
205
210
  }
206
211
  }
207
- function V() {
208
- l(n) || u(!1);
212
+ function C() {
213
+ i(n) || u(!1);
209
214
  }
210
- function M(e) {
211
- !e && l(n) || u(e);
215
+ function $(e) {
216
+ !e && i(n) || u(e);
212
217
  }
213
- return O({
218
+ return k({
214
219
  resetFields: async () => {
215
- a.value?.resetFields();
220
+ l.value?.resetFields();
216
221
  },
217
222
  clearValidate: (e) => {
218
- a.value?.clearValidate(e);
223
+ l.value?.clearValidate(e);
219
224
  },
220
- validateFields: (e, i) => a.value?.validateFields(e, i),
221
- getFieldsValue: (e) => a.value?.getFieldsValue(e),
222
- validate: (e, i) => a.value?.validate(e, i),
223
- scrollToField: (e, i = {}) => {
224
- a.value?.scrollToField(e, i);
225
+ validateFields: (e, a) => l.value?.validateFields(e, a),
226
+ getFieldsValue: (e) => l.value?.getFieldsValue(e),
227
+ validate: (e, a) => l.value?.validate(e, a),
228
+ scrollToField: (e, a = {}) => {
229
+ l.value?.scrollToField(e, a);
225
230
  },
226
- setFieldValue: (e, i) => {
227
- a.value?.setFieldValue?.(e, i);
231
+ setFieldValue: (e, a) => {
232
+ l.value?.setFieldValue?.(e, a);
228
233
  },
229
234
  setFieldsValue: (e) => {
230
- if (!a.value) {
235
+ if (!l.value) {
231
236
  r.value = e;
232
237
  return;
233
238
  }
234
- a.value?.setFieldsValue?.(e);
239
+ l.value?.setFieldsValue?.(e);
235
240
  },
236
- getInternalInstance: (e) => a.value?.getInternalInstance(e),
237
- getFieldsValueTransformed: (e) => a.value?.getFieldsValueTransformed(e),
238
- validateFieldsReturnTransformed: (e) => a.value?.validateFieldsReturnTransformed(e)
239
- }), (e, i) => (h(), J(K, null, [o(l(te), m(e.drawerProps, {
240
- open: l(P),
241
- size: g.value,
242
- "max-size": l(F)(d.value.maxWidth),
243
- "min-size": l(F)(d.value.minWidth),
241
+ getInternalInstance: (e) => l.value?.getInternalInstance(e),
242
+ getFieldsValueTransformed: (e) => l.value?.getFieldsValueTransformed(e),
243
+ validateFieldsReturnTransformed: (e) => l.value?.validateFieldsReturnTransformed(e)
244
+ }), (e, a) => (b(), K(Q, null, [o(i(te), c(e.drawerProps, {
245
+ open: i(S),
246
+ size: y.value,
247
+ "max-size": i(g)(d.value.maxWidth),
248
+ "min-size": i(g)(d.value.minWidth),
244
249
  resizable: {
245
- onResize: I
250
+ onResize: U
246
251
  },
247
- class: [l(S)(), l(N)],
248
- "onUpdate:open": M,
249
- onCancel: V
252
+ class: [i(I)(), i(_)],
253
+ "onUpdate:open": $,
254
+ onCancel: C
250
255
  }), {
251
- title: c(() => [B(e.$slots, "title", {}, () => [X(Y(t.title), 1)])]),
252
- footer: c(() => [(h(), w(R(j.value)))]),
253
- default: c(() => [o(me, m({
256
+ title: f(() => [R(e.$slots, "title", {}, () => [X(Y(t.title), 1)])]),
257
+ footer: f(() => [V.value ? (b(), w(i(x), {
258
+ key: 0,
259
+ node: V.value
260
+ }, null, 8, ["node"])) : B("", !0)]),
261
+ default: f(() => [o(me, c({
254
262
  ref_key: "formRef",
255
- ref: a
256
- }, l(le)(t, ["drawerProps", "open", "onUpdate:open", "title", "width", "onFinish", "submitter"])), {
257
- default: c(() => [B(e.$slots, "default")]),
263
+ ref: l
264
+ }, P.value), {
265
+ default: f(() => [R(e.$slots, "default")]),
258
266
  _: 3
259
267
  }, 16)]),
260
268
  _: 3
261
- }, 16, ["open", "size", "max-size", "min-size", "resizable", "class"]), l(z) ? (h(), w(R(l(z)), {
262
- key: 0
263
- })) : Q("", !0)], 64));
269
+ }, 16, ["open", "size", "max-size", "min-size", "resizable", "class"]), z.value ? (b(), w(i(x), {
270
+ key: 0,
271
+ node: z.value
272
+ }, null, 8, ["node"])) : B("", !0)], 64));
264
273
  }
265
274
  });
266
275
  export {
267
- Se as default
276
+ Ie as default
268
277
  };
@@ -0,0 +1,7 @@
1
+ import { ApFormItemProps, ApFormListProps, ApFormSetProps } from '../interface';
2
+ /**
3
+ * 表单项(列表、集合)注册
4
+ * @param props
5
+ */
6
+ declare const useRegistForm: (props: ApFormItemProps | ApFormListProps | ApFormSetProps) => void;
7
+ export default useRegistForm;
@@ -0,0 +1,24 @@
1
+ import { isFunction as o, cloneDeep as r } from "lodash-unified";
2
+ import { onMounted as l, onBeforeUnmount as m } from "vue";
3
+ import { isPromise as u } from "../../utils/is.mjs";
4
+ import { useInjectForm as s } from "../context.mjs";
5
+ const V = (e) => {
6
+ let t = !1;
7
+ const { internalInstance: n } = s();
8
+ l(() => {
9
+ a();
10
+ }), m(() => {
11
+ t = !0;
12
+ });
13
+ async function a() {
14
+ let i = o(e.initialValue) ? e.initialValue() : e.initialValue;
15
+ u(i) && (i = await i), !t && n?.registerField({
16
+ name: e.name,
17
+ initialValue: r(i),
18
+ transform: e.transform
19
+ });
20
+ }
21
+ };
22
+ export {
23
+ V as default
24
+ };
@@ -446,7 +446,7 @@ declare function __VLS_template(): {
446
446
  default: string | number | ColSize;
447
447
  };
448
448
  xxl: {
449
- type: PropType<string | number | ColSize>;
449
+ type: PropType<string | number | ** @type { [typeof __VLS_components.Render, typeof __VLS_components.Render, ] } */).ColSize>;
450
450
  default: string | number | ColSize;
451
451
  };
452
452
  prefixCls: StringConstructor;
@@ -548,7 +548,7 @@ declare function __VLS_template(): {
548
548
  default: string | number | ColSize;
549
549
  };
550
550
  xxl: {
551
- type: PropType<string | number | ColSize>;
551
+ type: PropType<string | number | ** @type { [typeof __VLS_components.Render, typeof __VLS_components.Render, ] } */).ColSize>;
552
552
  default: string | number | ColSize;
553
553
  };
554
554
  prefixCls: StringConstructor;
@@ -704,7 +704,7 @@ declare function __VLS_template(): {
704
704
  default: string | number | ColSize;
705
705
  };
706
706
  xxl: {
707
- type: PropType<string | number | ColSize>;
707
+ type: PropType<string | number | ** @type { [typeof __VLS_components.Render, typeof __VLS_components.Render, ] } */).ColSize>;
708
708
  default: string | number | ColSize;
709
709
  };
710
710
  prefixCls: StringConstructor;
@@ -1241,7 +1241,7 @@ declare const __VLS_component: DefineComponent<ApFormItemProps, {
1241
1241
  default: string | number | ColSize;
1242
1242
  };
1243
1243
  xxl: {
1244
- type: PropType<string | number | ColSize>;
1244
+ type: PropType<string | number | ** @type { [typeof __VLS_components.Render, typeof __VLS_components.Render, ] } */).ColSize>;
1245
1245
  default: string | number | ColSize;
1246
1246
  };
1247
1247
  prefixCls: StringConstructor;
@@ -1343,7 +1343,7 @@ declare const __VLS_component: DefineComponent<ApFormItemProps, {
1343
1343
  default: string | number | ColSize;
1344
1344
  };
1345
1345
  xxl: {
1346
- type: PropType<string | number | ColSize>;
1346
+ type: PropType<string | number | ** @type { [typeof __VLS_components.Render, typeof __VLS_components.Render, ] } */).ColSize>;
1347
1347
  default: string | number | ColSize;
1348
1348
  };
1349
1349
  prefixCls: StringConstructor;
@@ -1499,7 +1499,7 @@ declare const __VLS_component: DefineComponent<ApFormItemProps, {
1499
1499
  default: string | number | ColSize;
1500
1500
  };
1501
1501
  xxl: {
1502
- type: PropType<string | number | ColSize>;
1502
+ type: PropType<string | number | ** @type { [typeof __VLS_components.Render, typeof __VLS_components.Render, ] } */).ColSize>;
1503
1503
  default: string | number | ColSize;
1504
1504
  };
1505
1505
  prefixCls: StringConstructor;
@@ -1,18 +1,18 @@
1
- import { defineComponent as L, useSlots as _, ref as $, shallowRef as j, onMounted as D, computed as E, unref as r, cloneVNode as M, createBlock as O, openBlock as q, mergeProps as K, createSlots as Q, withCtx as n, createVNode as u, renderSlot as c, renderList as U, createElementVNode as Y, normalizeClass as G, normalizeStyle as H, normalizeProps as J, guardReactiveProps as W } from "vue";
2
- import { QuestionCircleOutlined as X } from "@ant-design/icons-vue";
3
- import { Form as Z, Tooltip as ee, TypographyText as oe } from "@aplus-frontend/antdv";
4
- import { useToken as te } from "@aplus-frontend/antdv/es/theme/internal";
5
- import { isFunction as y, cloneDeep as re, isArray as le, omit as b } from "lodash-unified";
1
+ import { defineComponent as L, computed as c, useSlots as _, ref as $, shallowRef as j, unref as r, cloneVNode as E, createBlock as O, openBlock as q, mergeProps as D, createSlots as K, withCtx as n, createVNode as u, renderSlot as b, renderList as M, createElementVNode as Q, normalizeClass as U, normalizeStyle as Y, normalizeProps as G, guardReactiveProps as H } from "vue";
2
+ import { QuestionCircleOutlined as J } from "@ant-design/icons-vue";
3
+ import { Form as W, Tooltip as X, TypographyText as Z } from "@aplus-frontend/antdv";
4
+ import { useToken as ee } from "@aplus-frontend/antdv/es/theme/internal";
5
+ import { omit as y, isArray as oe, isFunction as te } from "lodash-unified";
6
6
  import "../../render/index.mjs";
7
- import { isPromise as ae } from "../../utils/is.mjs";
8
7
  import "../../config-provider/index.mjs";
9
- import { getValidVNodeList as ne } from "../../utils/slot.mjs";
10
- import { apFormItemColPropKeys as ie } from "../constant.mjs";
11
- import { useInjectForm as se } from "../context.mjs";
12
- import ue from "../style/item.mjs";
13
- import { useNamespace as de } from "../../config-provider/hooks/use-namespace.mjs";
14
- import fe from "../../render/render.mjs";
15
- const Ne = /* @__PURE__ */ L({
8
+ import { getValidVNodeList as re } from "../../utils/slot.mjs";
9
+ import { apFormItemColPropKeys as le } from "../constant.mjs";
10
+ import { useInjectForm as ae } from "../context.mjs";
11
+ import ne from "../hooks/use-regist-form.mjs";
12
+ import se from "../style/item.mjs";
13
+ import { useNamespace as ie } from "../../config-provider/hooks/use-namespace.mjs";
14
+ import ue from "../../render/render.mjs";
15
+ const Ce = /* @__PURE__ */ L({
16
16
  name: "ApFormItem",
17
17
  __name: "index",
18
18
  props: {
@@ -61,120 +61,111 @@ const Ne = /* @__PURE__ */ L({
61
61
  autoFocus: { type: Boolean, default: void 0 }
62
62
  },
63
63
  setup(v, { expose: F }) {
64
- const o = v, V = _(), { model: p, updateModel: h, internalInstance: g } = se(), { m: d, b: B } = de("ap-form-item"), k = ue("ap-form-item"), f = $(!1), i = j(), [, C] = te();
65
- D(async () => {
66
- let e = y(o.initialValue) ? o.initialValue() : o.initialValue;
67
- ae(e) && (e = await e), g?.registerField({
68
- name: o.name,
69
- initialValue: re(e),
70
- transform: o.transform
71
- });
72
- });
73
- const m = E(() => o.name ? le(o.name) ? o.name.reduce((e, t) => e?.[t], r(p)) : p?.value[o.name] : null);
74
- function P(e, t) {
64
+ const e = v, h = c(
65
+ () => y(e, [
66
+ ...le,
67
+ "tooltip",
68
+ "label",
69
+ "description",
70
+ "autoFocus"
71
+ ])
72
+ ), g = _(), { model: p, updateModel: B } = ae(), { m: d, b: V } = ie("ap-form-item"), k = se("ap-form-item"), f = $(!1), s = j(), [, C] = ee();
73
+ ne(e);
74
+ const m = c(() => e.name ? oe(e.name) ? e.name.reduce((o, t) => o?.[t], r(p)) : p?.value[e.name] : null);
75
+ function P(o, t) {
75
76
  const l = Object.keys(t), a = { ...t };
76
- return l.forEach((s) => {
77
- s in e || delete a[s];
77
+ return l.forEach((i) => {
78
+ i in o || delete a[i];
78
79
  }), a;
79
80
  }
80
- function N(e) {
81
- if (!o.name)
82
- return e[0];
83
- const t = ne(e)[0];
81
+ function N(o) {
82
+ if (!e.name)
83
+ return o[0];
84
+ const t = re(o)[0];
84
85
  if (!t)
85
86
  return null;
86
87
  const l = t?.type?.props ?? {}, a = {
87
- autofocus: o.autoFocus ?? t?.props?.autofocus,
88
- variant: o.bordered ? "borderless" : t?.props?.variant,
89
- bordered: o.bordered ? !1 : t?.props?.bordered,
90
- onFocus: I,
91
- onBlur: S
88
+ autofocus: e.autoFocus ?? t?.props?.autofocus,
89
+ variant: e.bordered ? "borderless" : t?.props?.variant,
90
+ bordered: e.bordered ? !1 : t?.props?.bordered,
91
+ onFocus: S,
92
+ onBlur: I
92
93
  };
93
- return M(t, {
94
+ return E(t, {
94
95
  ...P(l, a),
95
- [o.valuePropName]: r(m),
96
- [`onUpdate:${o.valuePropName}`]: x
96
+ [e.valuePropName]: r(m),
97
+ [`onUpdate:${e.valuePropName}`]: x
97
98
  });
98
99
  }
99
- function x(e) {
100
- h?.(o.name, e);
100
+ function x(o) {
101
+ B?.(e.name, o);
101
102
  }
102
- function I() {
103
+ function S() {
103
104
  f.value = !0;
104
105
  }
105
- function S() {
106
+ function I() {
106
107
  f.value = !1;
107
108
  }
109
+ function R() {
110
+ s.value?.onFieldBlur();
111
+ }
108
112
  function T() {
109
- i.value?.onFieldBlur();
113
+ s.value?.onFieldChange();
110
114
  }
111
115
  function w() {
112
- i.value?.onFieldChange();
113
- }
114
- function R() {
115
- i.value?.clearValidate();
116
+ s.value?.clearValidate();
116
117
  }
117
118
  function z() {
118
- i.value?.resetField();
119
+ s.value?.resetField();
119
120
  }
120
- function A(e = !1) {
121
+ function A(o = !1) {
121
122
  const t = r(m);
122
- if (!e || !o.transform)
123
+ if (!o || !e.transform)
123
124
  return t;
124
- const l = y(o.transform) ? o.transform : o.transform.transformer;
125
- return o.transform ? l(t) : t;
125
+ const l = te(e.transform) ? e.transform : e.transform.transformer;
126
+ return e.transform ? l(t) : t;
126
127
  }
127
128
  return F({
128
- onFieldBlur: T,
129
- onFieldChange: w,
130
- clearValidate: R,
129
+ onFieldBlur: R,
130
+ onFieldChange: T,
131
+ clearValidate: w,
131
132
  resetField: z,
132
133
  getFieldValue: A
133
- }), (e, t) => (q(), O(r(Z).Item, K(
134
- {
135
- ref_key: "formItemRef",
136
- ref: i
134
+ }), (o, t) => (q(), O(r(W).Item, D({
135
+ ref_key: "formItemRef",
136
+ ref: s
137
+ }, h.value, {
138
+ class: {
139
+ [r(d)("bordered")]: o.bordered,
140
+ [r(d)("focused")]: o.bordered && f.value,
141
+ [r(d)("disabled")]: o.bordered && o.disabled,
142
+ [r(V)()]: !0,
143
+ [r(k)]: !0
137
144
  },
138
- r(b)(o, [
139
- ...r(ie),
140
- "tooltip",
141
- "label",
142
- "description",
143
- "autoFocus"
144
- ]),
145
- {
146
- class: {
147
- [r(d)("bordered")]: e.bordered,
148
- [r(d)("focused")]: e.bordered && f.value,
149
- [r(d)("disabled")]: e.bordered && e.disabled,
150
- [r(B)()]: !0,
151
- [r(k)]: !0
152
- },
153
- colon: e.bordered ? !1 : o.colon
154
- }
155
- ), Q({
145
+ colon: o.bordered ? !1 : e.colon
146
+ }), K({
156
147
  default: n(() => [
157
- u(r(fe), { renderer: N }, {
148
+ u(r(ue), { renderer: N }, {
158
149
  default: n(() => [
159
- c(e.$slots, "default")
150
+ b(o.$slots, "default")
160
151
  ]),
161
152
  _: 3
162
153
  })
163
154
  ]),
164
155
  _: 2
165
156
  }, [
166
- o.tooltip ? {
157
+ e.tooltip ? {
167
158
  name: "tooltip",
168
159
  fn: n(({ class: l }) => [
169
- Y("span", {
170
- class: G(l)
160
+ Q("span", {
161
+ class: U(l)
171
162
  }, [
172
- u(r(ee), {
173
- title: o.tooltip
163
+ u(r(X), {
164
+ title: e.tooltip
174
165
  }, {
175
166
  default: n(() => [
176
- u(r(X), {
177
- style: H({
167
+ u(r(J), {
168
+ style: Y({
178
169
  color: r(C).colorTextTertiary,
179
170
  fontSize: "14px",
180
171
  transform: "translateY(1px)"
@@ -187,26 +178,26 @@ const Ne = /* @__PURE__ */ L({
187
178
  ]),
188
179
  key: "0"
189
180
  } : void 0,
190
- e.label ? {
181
+ o.label ? {
191
182
  name: "label",
192
183
  fn: n(() => [
193
- u(r(oe), {
194
- content: e.label,
195
- ellipsis: { tooltip: e.label },
184
+ u(r(Z), {
185
+ content: o.label,
186
+ ellipsis: { tooltip: o.label },
196
187
  style: { "min-width": "0px", flex: "1" }
197
188
  }, null, 8, ["content", "ellipsis"])
198
189
  ]),
199
190
  key: "1"
200
191
  } : void 0,
201
- U(r(b)(V, "default"), (l, a) => ({
192
+ M(r(y)(g, "default"), (l, a) => ({
202
193
  name: a,
203
- fn: n((s) => [
204
- c(e.$slots, a, J(W(s || {})))
194
+ fn: n((i) => [
195
+ b(o.$slots, a, G(H(i || {})))
205
196
  ])
206
197
  }))
207
198
  ]), 1040, ["class", "colon"]));
208
199
  }
209
200
  });
210
201
  export {
211
- Ne as default
202
+ Ce as default
212
203
  };