@aplus-frontend/ui 0.3.11 → 0.3.13

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 (79) hide show
  1. package/es/index.mjs +173 -169
  2. package/es/src/ap-field/radio/style/index.js +1 -0
  3. package/es/src/ap-form/ap-form.vue.d.ts +12 -31
  4. package/es/src/ap-form/ap-form.vue2.mjs +135 -118
  5. package/es/src/ap-form/drawer-form/index.vue.d.ts +22 -40
  6. package/es/src/ap-form/drawer-form/index.vue.mjs +3 -3
  7. package/es/src/ap-form/index.d.ts +3 -1
  8. package/es/src/ap-form/index.mjs +26 -22
  9. package/es/src/ap-form/interface.d.ts +3 -1
  10. package/es/src/ap-form/modal-form/index.vue.d.ts +23 -41
  11. package/es/src/ap-form/modal-form/index.vue.mjs +60 -59
  12. package/es/src/ap-form/provider/context.d.ts +3 -0
  13. package/es/src/ap-form/provider/context.mjs +17 -0
  14. package/es/src/ap-form/provider/index.vue.d.ts +19 -0
  15. package/es/src/ap-form/provider/index.vue.mjs +39 -0
  16. package/es/src/ap-form/provider/index.vue2.mjs +4 -0
  17. package/es/src/ap-form/provider/interface.d.ts +22 -0
  18. package/es/src/ap-form/search-form/index.vue.d.ts +22 -40
  19. package/es/src/business/ap-ladder/style/index.js +1 -0
  20. package/es/src/business/ap-table-modal/interface.d.ts +2 -0
  21. package/es/src/business/ap-table-modal/table-modal.vue2.mjs +50 -48
  22. package/es/src/business/batch-input-group/form-item.vue.d.ts +6 -0
  23. package/es/src/business/batch-input-group/form-item.vue.mjs +101 -0
  24. package/es/src/business/batch-input-group/form-item.vue2.mjs +4 -0
  25. package/es/src/business/batch-input-group/index.d.ts +2 -1
  26. package/es/src/business/batch-input-group/index.mjs +1 -0
  27. package/es/src/business/batch-input-group/index.vue.mjs +46 -44
  28. package/es/src/business/batch-input-group/interface.d.ts +8 -0
  29. package/es/src/business/batch-input-group/popover-input/index.vue2.mjs +43 -38
  30. package/es/src/config-provider/config-provider.d.ts +1 -0
  31. package/es/src/config-provider/css-var.d.ts +1 -0
  32. package/es/src/config-provider/css-var.mjs +14 -12
  33. package/es/src/config-provider/index.d.ts +5 -0
  34. package/es/src/index.mjs +154 -150
  35. package/es/src/utils/slot.mjs +6 -8
  36. package/lib/index.js +1 -1
  37. package/lib/src/ap-field/radio/style/index.js +1 -0
  38. package/lib/src/ap-form/ap-form.vue.d.ts +12 -31
  39. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  40. package/lib/src/ap-form/drawer-form/index.vue.d.ts +22 -40
  41. package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
  42. package/lib/src/ap-form/index.d.ts +3 -1
  43. package/lib/src/ap-form/index.js +1 -1
  44. package/lib/src/ap-form/interface.d.ts +3 -1
  45. package/lib/src/ap-form/modal-form/index.vue.d.ts +23 -41
  46. package/lib/src/ap-form/modal-form/index.vue.js +1 -1
  47. package/lib/src/ap-form/provider/context.d.ts +3 -0
  48. package/lib/src/ap-form/provider/context.js +1 -0
  49. package/lib/src/ap-form/provider/index.vue.d.ts +19 -0
  50. package/lib/src/ap-form/provider/index.vue.js +1 -0
  51. package/lib/src/ap-form/provider/index.vue2.js +1 -0
  52. package/lib/src/ap-form/provider/interface.d.ts +22 -0
  53. package/lib/src/ap-form/render/style/index.d.ts +1 -0
  54. package/lib/src/ap-form/render/style/index.js +1 -0
  55. package/lib/src/ap-form/search-form/index.vue.d.ts +22 -40
  56. package/lib/src/business/ap-ladder/style/index.js +1 -0
  57. package/lib/src/business/ap-table-modal/interface.d.ts +2 -0
  58. package/lib/src/business/ap-table-modal/table-modal.vue2.js +1 -1
  59. package/lib/src/business/batch-input-group/form-item.vue.d.ts +6 -0
  60. package/lib/src/business/batch-input-group/form-item.vue.js +1 -0
  61. package/lib/src/business/batch-input-group/form-item.vue2.js +1 -0
  62. package/lib/src/business/batch-input-group/index.d.ts +2 -1
  63. package/lib/src/business/batch-input-group/index.js +1 -1
  64. package/lib/src/business/batch-input-group/index.vue.js +2 -2
  65. package/lib/src/business/batch-input-group/interface.d.ts +8 -0
  66. package/lib/src/business/batch-input-group/popover-input/index.vue2.js +2 -2
  67. package/lib/src/config-provider/config-provider.d.ts +1 -0
  68. package/lib/src/config-provider/css-var.d.ts +1 -0
  69. package/lib/src/config-provider/css-var.js +1 -1
  70. package/lib/src/config-provider/index.d.ts +5 -0
  71. package/lib/src/index.js +1 -1
  72. package/lib/src/utils/slot.js +1 -1
  73. package/package.json +2 -2
  74. /package/es/src/ap-field/radio/style/{style.d.ts → index.d.ts} +0 -0
  75. /package/es/src/ap-form/render/style/{style.d.ts → index.d.ts} +0 -0
  76. /package/{lib/src/ap-form/render/style/style.d.ts → es/src/ap-form/render/style/index.js} +0 -0
  77. /package/es/src/business/ap-ladder/style/{style.d.ts → index.d.ts} +0 -0
  78. /package/lib/src/ap-field/radio/style/{style.d.ts → index.d.ts} +0 -0
  79. /package/lib/src/business/ap-ladder/style/{style.d.ts → index.d.ts} +0 -0
@@ -1,13 +1,13 @@
1
1
  import { ApFormModalFormProps } from '../interface';
2
2
  import { VNode, ComponentInternalInstance, ExtractPropTypes, PropType, HTMLAttributes, VNodeProps, AllowedComponentProps, ComponentCustomProps, Slot, ComponentPublicInstance, ComponentOptionsBase, ComponentOptionsMixin, GlobalComponents, GlobalDirectives, ComponentProvideOptions, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties, DefineComponent, PublicProps, CSSProperties } from 'vue';
3
3
  import { InternalNamePath, NamePath, ValidateOptions, ValidateMessages, FormLabelAlign, FieldData, ValidateErrorEntity } from '@aplus-frontend/antdv/es/form/interface';
4
+ import { Recordable } from '../../type';
4
5
  import { ButtonSize, ButtonType, ButtonShape } from '@aplus-frontend/antdv/es/button';
5
6
  import { RequiredMark } from '@aplus-frontend/antdv/es/form/Form';
6
7
  import { ColSize } from '@aplus-frontend/antdv/es/grid';
7
8
  import { RuleObject } from '@aplus-frontend/antdv/es/form';
8
9
  import { Options } from '../../../node_modules/scroll-into-view-if-needed';
9
- import { Recordable } from '../../type';
10
- import { ApFormProps, WatchFunc, RegistedFieldType, ApFormInternalInstance, ApFormSubmitterConfig } from '..';
10
+ import { ApFormProps, ApFormInternalInstance, WatchFunc, ApFormSubmitterConfig } from '..';
11
11
  import { OnCleanup } from '@vue/reactivity';
12
12
  import { VueTypeValidableDef } from '../../../node_modules/vue-types';
13
13
  import { LegacyButtonType, ButtonHTMLType } from '@aplus-frontend/antdv/es/button/buttonTypes';
@@ -135,27 +135,18 @@ declare function __VLS_template(): {
135
135
  $emit: (event: string, ...args: any[]) => void;
136
136
  $el: any;
137
137
  $options: ComponentOptionsBase<Readonly< ApFormProps> & Readonly<{}>, {
138
+ setFieldsValue: (fields: Partial<any>) => void;
139
+ setFieldValue: (name: NamePath, value: any, triggerChange?: boolean) => void;
138
140
  resetFields: () => Promise<void>;
139
- clearValidate: (name?: NamePath | NamePath[]) => void;
140
- validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<{
141
- [key: string]: any;
142
- }> | undefined;
143
- getFieldsValue: (nameList?: InternalNamePath[] | true) => {
144
- [key: string]: any;
145
- } | undefined;
146
- validate: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<{
147
- [key: string]: any;
148
- }> | undefined;
149
- scrollToField: (name: NamePath, options?: {}) => void;
150
- setFieldsValue: (values: Record<string, any>) => void;
151
- setFieldValue: (name: NamePath, newValue: any, triggerChange?: boolean) => void;
141
+ clearValidate: (name?: NamePath) => void;
142
+ validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
143
+ getFieldsValue: (nameList?: true | InternalNamePath[]) => Partial<any> | undefined;
144
+ validate: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
145
+ scrollToField: (name: NamePath, options?: any) => void;
146
+ getInternalInstance: (mark: string) => ApFormInternalInstance | undefined;
147
+ validateFieldsReturnTransformed: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
148
+ getFieldsValueTransformed: (nameList?: true | InternalNamePath[]) => Partial<any> | undefined;
152
149
  registerWatch: (callback: WatchFunc, inner: boolean) => () => void;
153
- validateFieldsReturnTransformed: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<any>;
154
- getFieldsValueTransformed: (nameList?: InternalNamePath[] | true) => any;
155
- getInternalInstance: (mark: string) => {
156
- registerField: ({ initialValue, name, transform }: RegistedFieldType) => void;
157
- registerWatch: (callback: WatchFunc, inner: boolean) => () => void;
158
- } | undefined;
159
150
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
160
151
  layout: string;
161
152
  colon: boolean;
@@ -192,28 +183,19 @@ declare function __VLS_template(): {
192
183
  hideRequiredMark: boolean;
193
184
  validateOnRuleChange: boolean;
194
185
  syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
195
- }> & Omit<Readonly< ApFormProps> & Readonly<{}>, "validate" | "resetFields" | "clearValidate" | "validateFields" | "getFieldsValue" | "scrollToField" | "registerWatch" | "setFieldValue" | "setFieldsValue" | "validateFieldsReturnTransformed" | "getFieldsValueTransformed" | "getInternalInstance" | ("layout" | "colon" | "labelAlign" | "validateTrigger" | "hideRequiredMark" | "validateOnRuleChange" | "syncToUrl")> & ShallowUnwrapRef<{
186
+ }> & Omit<Readonly< ApFormProps> & Readonly<{}>, "validate" | "resetFields" | "clearValidate" | "validateFields" | "getFieldsValue" | "scrollToField" | "registerWatch" | "setFieldValue" | ("layout" | "colon" | "labelAlign" | "validateTrigger" | "hideRequiredMark" | "validateOnRuleChange" | "syncToUrl") | "setFieldsValue" | "getInternalInstance" | "validateFieldsReturnTransformed" | "getFieldsValueTransformed"> & ShallowUnwrapRef<{
187
+ setFieldsValue: (fields: Partial<any>) => void;
188
+ setFieldValue: (name: NamePath, value: any, triggerChange?: boolean) => void;
196
189
  resetFields: () => Promise<void>;
197
- clearValidate: (name?: NamePath | NamePath[]) => void;
198
- validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<{
199
- [key: string]: any;
200
- }> | undefined;
201
- getFieldsValue: (nameList?: InternalNamePath[] | true) => {
202
- [key: string]: any;
203
- } | undefined;
204
- validate: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<{
205
- [key: string]: any;
206
- }> | undefined;
207
- scrollToField: (name: NamePath, options?: {}) => void;
208
- setFieldsValue: (values: Record<string, any>) => void;
209
- setFieldValue: (name: NamePath, newValue: any, triggerChange?: boolean) => void;
190
+ clearValidate: (name?: NamePath) => void;
191
+ validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
192
+ getFieldsValue: (nameList?: true | InternalNamePath[]) => Partial<any> | undefined;
193
+ validate: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
194
+ scrollToField: (name: NamePath, options?: any) => void;
195
+ getInternalInstance: (mark: string) => ApFormInternalInstance | undefined;
196
+ validateFieldsReturnTransformed: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
197
+ getFieldsValueTransformed: (nameList?: true | InternalNamePath[]) => Partial<any> | undefined;
210
198
  registerWatch: (callback: WatchFunc, inner: boolean) => () => void;
211
- validateFieldsReturnTransformed: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<any>;
212
- getFieldsValueTransformed: (nameList?: InternalNamePath[] | true) => any;
213
- getInternalInstance: (mark: string) => {
214
- registerField: ({ initialValue, name, transform }: RegistedFieldType) => void;
215
- registerWatch: (callback: WatchFunc, inner: boolean) => () => void;
216
- } | undefined;
217
199
  }> & {} & ComponentCustomProperties & {} & {
218
200
  $slots: {
219
201
  default?(_: {}): any;
@@ -1,20 +1,19 @@
1
- import { isVNode as q, defineComponent as D, useSlots as L, ref as g, watch as A, cloneVNode as G, computed as I, createVNode as u, mergeProps as p, unref as n, openBlock as F, createElementBlock as W, Fragment as H, withCtx as h, renderSlot as w, createTextVNode as J, toDisplayString as K, createElementVNode as Q, normalizeClass as X, createBlock as P, resolveDynamicComponent as x, createCommentVNode as Y } from "vue";
1
+ import { isVNode as q, defineComponent as D, useSlots as L, ref as h, watch as A, cloneVNode as G, computed as I, createVNode as u, mergeProps as p, unref as n, openBlock as g, createElementBlock as W, Fragment as H, withCtx as F, renderSlot as P, createTextVNode as J, toDisplayString as K, createElementVNode as Q, normalizeClass as X, createBlock as w, resolveDynamicComponent as x, createCommentVNode as Y } from "vue";
2
2
  import { Button as V, Flex as Z, Space as ee, Modal as te } from "@aplus-frontend/antdv";
3
3
  import "../ap-form.vue.mjs";
4
4
  import "../../hooks/index.mjs";
5
5
  import { getSingleVNode as le } from "../../utils/slot.mjs";
6
6
  import "../../config-provider/index.mjs";
7
7
  import { omit as oe } from "lodash-unified";
8
- import { convertReactiveToRaw as ae } from "../../utils/index.mjs";
9
- import { useControllableValue as ie } from "../../hooks/useControllableValue.mjs";
8
+ import { useControllableValue as ae } from "../../hooks/useControllableValue.mjs";
10
9
  import { useLocale as ne } from "../../config-provider/hooks/use-locale.mjs";
11
10
  import { useGlobalConfig as se } from "../../config-provider/hooks/use-global-config.mjs";
12
- import { useNamespace as re } from "../../config-provider/hooks/use-namespace.mjs";
13
- import ue from "../ap-form.vue2.mjs";
14
- function N(d) {
15
- return typeof d == "function" || Object.prototype.toString.call(d) === "[object Object]" && !q(d);
11
+ import { useNamespace as ie } from "../../config-provider/hooks/use-namespace.mjs";
12
+ import re from "../ap-form.vue2.mjs";
13
+ function N(c) {
14
+ return typeof c == "function" || Object.prototype.toString.call(c) === "[object Object]" && !q(c);
16
15
  }
17
- const Me = /* @__PURE__ */ D({
16
+ const Se = /* @__PURE__ */ D({
18
17
  __name: "index",
19
18
  props: {
20
19
  layout: {
@@ -91,14 +90,14 @@ const Me = /* @__PURE__ */ D({
91
90
  submitTimeout: {}
92
91
  },
93
92
  emits: ["update:open"],
94
- setup(d, {
93
+ setup(c, {
95
94
  expose: S,
96
- emit: R
95
+ emit: _
97
96
  }) {
98
- const o = d, b = L(), _ = R, a = g(), c = g(), s = g(!1), {
99
- value: M,
100
- updateValue: m
101
- } = ie(o, _, {
97
+ const o = c, b = L(), M = _, a = h(), m = h(), i = h(!1), {
98
+ value: R,
99
+ updateValue: f
100
+ } = ae(o, M, {
102
101
  valuePropName: "open",
103
102
  defaultValue: !1
104
103
  }), {
@@ -106,48 +105,49 @@ const Me = /* @__PURE__ */ D({
106
105
  } = ne(), y = se("uiMode", "aplus"), {
107
106
  b: j,
108
107
  e: C
109
- } = re("ap-form-modal-form");
108
+ } = ie("ap-form-modal-form");
110
109
  A(() => a.value, (e) => {
111
110
  var t;
112
- e && c.value && ((t = e.setFieldsValue) == null || t.call(e, c.value), c.value = void 0);
111
+ e && m.value && ((t = e.setFieldsValue) == null || t.call(e, m.value), m.value = void 0);
113
112
  });
114
- const B = le(b.trigger), T = B ? G(B, {
113
+ const T = le(b.trigger), B = T ? G(T, {
115
114
  onClick: () => {
116
- m(!0);
115
+ f(!0);
117
116
  }
118
117
  }) : null, O = I(() => {
119
- var t, l, r, f;
118
+ var t, l, r, d;
120
119
  const e = [];
121
120
  if (o.submitter === !1)
122
121
  return null;
123
122
  if (o.showCancel) {
124
- let i;
123
+ let s;
125
124
  e.push(u(V, {
126
125
  onClick: k,
127
- disabled: s.value
128
- }, N(i = v("ap.common.cancelText")) ? i : {
129
- default: () => [i]
126
+ disabled: i.value
127
+ }, N(s = v("ap.common.cancelText")) ? s : {
128
+ default: () => [s]
130
129
  }));
131
130
  }
132
131
  return ((t = o.submitter) == null ? void 0 : t.resetButtonProps) !== !1 && e.push(u(V, p(((l = o.submitter) == null ? void 0 : l.resetButtonProps) || {}, {
133
- key: "submit",
134
- disabled: s.value,
135
- onClick: U
132
+ key: "reset",
133
+ disabled: i.value,
134
+ onClick: U,
135
+ htmlType: "reset"
136
136
  }), {
137
137
  default: () => {
138
- var i;
139
- return [((i = o.submitter) == null ? void 0 : i.resetText) || v("ap.common.resetText")];
138
+ var s;
139
+ return [((s = o.submitter) == null ? void 0 : s.resetText) || v("ap.common.resetText")];
140
140
  }
141
141
  })), ((r = o.submitter) == null ? void 0 : r.submitButtonProps) !== !1 && e.push(u(V, p({
142
142
  type: "primary",
143
- key: "submit"
144
- }, ((f = o.submitter) == null ? void 0 : f.submitButtonProps) || {}, {
145
- loading: s.value,
146
- onClick: z
143
+ key: "submit",
144
+ htmlType: "submit"
145
+ }, ((d = o.submitter) == null ? void 0 : d.submitButtonProps) || {}, {
146
+ loading: i.value
147
147
  }), {
148
148
  default: () => {
149
- var i;
150
- return [((i = o.submitter) == null ? void 0 : i.submitText) || v("ap.common.okText")];
149
+ var s;
150
+ return [((s = o.submitter) == null ? void 0 : s.submitText) || v("ap.common.okText")];
151
151
  }
152
152
  })), u(Z, {
153
153
  justify: "flex-end",
@@ -162,29 +162,28 @@ const Me = /* @__PURE__ */ D({
162
162
  var e, t, l;
163
163
  o.submitter !== !1 && ((e = a.value) == null || e.resetFields(), (l = (t = o.submitter) == null ? void 0 : t.onReset) == null || l.call(t));
164
164
  }
165
- async function z() {
166
- var e, t, l, r;
165
+ async function z(e) {
166
+ var t, l, r;
167
167
  if (o.submitter !== !1)
168
168
  try {
169
- const f = await ((e = a.value) == null ? void 0 : e.validateFields());
170
- (l = (t = o.submitter) == null ? void 0 : t.onSubmit) == null || l.call(t), s.value = !0;
171
- const i = (r = o.onFinish) == null ? void 0 : r.call(o, ae(f));
172
- if (o.submitTimeout && i instanceof Promise) {
173
- const $ = setTimeout(() => s.value = !1, o.submitTimeout);
174
- i.finally(() => {
175
- clearTimeout($), s.value = !1;
169
+ (l = (t = o.submitter) == null ? void 0 : t.onSubmit) == null || l.call(t), i.value = !0;
170
+ const d = (r = o.onFinish) == null ? void 0 : r.call(o, e);
171
+ if (o.submitTimeout && d instanceof Promise) {
172
+ const $ = setTimeout(() => i.value = !1, o.submitTimeout);
173
+ d.finally(() => {
174
+ clearTimeout($), i.value = !1;
176
175
  });
177
176
  }
178
- await i && m(!1);
177
+ await d && f(!1);
179
178
  } finally {
180
- s.value = !1;
179
+ i.value = !1;
181
180
  }
182
181
  }
183
182
  function k() {
184
- n(s) || m(!1);
183
+ n(i) || f(!1);
185
184
  }
186
185
  function E(e) {
187
- !e && n(s) || m(e);
186
+ !e && n(i) || f(e);
188
187
  }
189
188
  return S({
190
189
  resetFields: () => {
@@ -218,7 +217,7 @@ const Me = /* @__PURE__ */ D({
218
217
  setFieldsValue: (e) => {
219
218
  var t, l;
220
219
  if (!a.value) {
221
- c.value = e;
220
+ m.value = e;
222
221
  return;
223
222
  }
224
223
  (l = (t = a.value) == null ? void 0 : t.setFieldsValue) == null || l.call(t, e);
@@ -229,8 +228,8 @@ const Me = /* @__PURE__ */ D({
229
228
  }
230
229
  }), (e, t) => {
231
230
  var l;
232
- return F(), W(H, null, [u(n(te), p(e.modalProps, {
233
- open: n(M),
231
+ return g(), W(H, null, [u(n(te), p(e.modalProps, {
232
+ open: n(R),
234
233
  footer: null,
235
234
  width: e.width,
236
235
  class: n(j)(),
@@ -243,23 +242,25 @@ const Me = /* @__PURE__ */ D({
243
242
  "onUpdate:open": E,
244
243
  onCancel: k
245
244
  }), {
246
- title: h(() => [w(e.$slots, "title", {}, () => [J(K(o.title), 1)])]),
247
- default: h(() => [Q("div", {
248
- class: X(n(C)(n(y) === "admin" ? "content-admin" : "content"))
249
- }, [u(ue, p({
245
+ title: F(() => [P(e.$slots, "title", {}, () => [J(K(o.title), 1)])]),
246
+ default: F(() => [u(re, p({
250
247
  ref_key: "formRef",
251
248
  ref: a
252
- }, n(oe)(o, ["modalProps", "open", "onUpdate:open", "title", "width", "onFinish", "submitter"])), {
253
- default: h(() => [w(e.$slots, "default")]),
249
+ }, n(oe)(o, ["modalProps", "open", "onUpdate:open", "title", "width", "onFinish", "submitter"]), {
250
+ onFinish: z
251
+ }), {
252
+ default: F(() => [Q("div", {
253
+ class: X(n(C)(n(y) === "admin" ? "content-admin" : "content"))
254
+ }, [P(e.$slots, "default")], 2), (g(), w(x(O.value)))]),
254
255
  _: 3
255
- }, 16)], 2), (F(), P(x(O.value)))]),
256
+ }, 16)]),
256
257
  _: 3
257
- }, 16, ["open", "width", "class", "body-style"]), n(T) ? (F(), P(x(n(T)), {
258
+ }, 16, ["open", "width", "class", "body-style"]), n(B) ? (g(), w(x(n(B)), {
258
259
  key: 0
259
260
  })) : Y("", !0)], 64);
260
261
  };
261
262
  }
262
263
  });
263
264
  export {
264
- Me as default
265
+ Se as default
265
266
  };
@@ -0,0 +1,3 @@
1
+ import { InternalFormProviderContext } from './interface';
2
+ export declare const useProvideFormProvider: (config: InternalFormProviderContext) => void;
3
+ export declare const useInjectFormProvider: () => InternalFormProviderContext;
@@ -0,0 +1,17 @@
1
+ import { provide as e, inject as t } from "vue";
2
+ const r = Symbol("InternalContextProps"), m = (o) => {
3
+ e(r, o);
4
+ }, n = {
5
+ triggerFormChange: () => {
6
+ },
7
+ triggerFormFinish: () => {
8
+ },
9
+ registerForm: () => {
10
+ },
11
+ unregisterForm: () => {
12
+ }
13
+ }, s = () => t(r, n);
14
+ export {
15
+ s as useInjectFormProvider,
16
+ m as useProvideFormProvider
17
+ };
@@ -0,0 +1,19 @@
1
+ import { ApFormProviderProps } from './interface';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
+ declare function __VLS_template(): {
4
+ attrs: Partial<{}>;
5
+ slots: {
6
+ default?(_: {}): any;
7
+ };
8
+ refs: {};
9
+ rootEl: any;
10
+ };
11
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
12
+ declare const __VLS_component: DefineComponent<ApFormProviderProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ApFormProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
14
+ export default _default;
15
+ type __VLS_WithTemplateSlots<T, S> = T & {
16
+ new (): {
17
+ $slots: S;
18
+ };
19
+ };
@@ -0,0 +1,39 @@
1
+ import { defineComponent as s, ref as g, renderSlot as t } from "vue";
2
+ import { useInjectFormProvider as u, useProvideFormProvider as m } from "./context.mjs";
3
+ const h = /* @__PURE__ */ s({
4
+ __name: "index",
5
+ props: {
6
+ onFormChange: { type: Function },
7
+ onFormFinish: { type: Function }
8
+ },
9
+ setup(F) {
10
+ const o = F, n = g({}), e = u();
11
+ return m({
12
+ triggerFormChange(r, i) {
13
+ o != null && o.onFormChange && o.onFormChange(r, {
14
+ changedFields: i,
15
+ forms: n.value
16
+ }), e == null || e.triggerFormChange(r, i);
17
+ },
18
+ triggerFormFinish: (r, i) => {
19
+ o != null && o.onFormFinish && o.onFormFinish(r, {
20
+ values: i,
21
+ forms: n.value
22
+ }), e == null || e.triggerFormFinish(r, i);
23
+ },
24
+ registerForm: (r, i) => {
25
+ r && (n.value = {
26
+ ...n.value,
27
+ [r]: i
28
+ }), e == null || e.registerForm(r, i);
29
+ },
30
+ unregisterForm: (r) => {
31
+ const i = { ...n.value };
32
+ delete i[r], n.value = i, e == null || e.unregisterForm(r);
33
+ }
34
+ }), (r, i) => t(r.$slots, "default");
35
+ }
36
+ });
37
+ export {
38
+ h as default
39
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./index.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,22 @@
1
+ import { Store } from '@aplus-frontend/antdv/es/form/interface';
2
+ import { ApFormExpose } from '../interface';
3
+ export type ApFormInstance = ApFormExpose;
4
+ export type Forms = Record<string, ApFormInstance>;
5
+ export interface ApFormChangeInfo {
6
+ changedFields: any;
7
+ forms: Forms;
8
+ }
9
+ export interface ApFormFinishInfo {
10
+ values: Store;
11
+ forms: Forms;
12
+ }
13
+ export type ApFormProviderProps = {
14
+ onFormChange?: (name: string, info: ApFormChangeInfo) => void;
15
+ onFormFinish?: (name: string, info: ApFormFinishInfo) => void;
16
+ };
17
+ export interface InternalFormProviderContext {
18
+ triggerFormChange: (name: string, changedFields: any) => void;
19
+ triggerFormFinish: (name: string, values: Store) => void;
20
+ registerForm: (name: string, form: ApFormInstance) => void;
21
+ unregisterForm: (name: string) => void;
22
+ }
@@ -7,7 +7,7 @@ import { ColSize } from '@aplus-frontend/antdv/es/grid';
7
7
  import { RuleObject } from '@aplus-frontend/antdv/es/form';
8
8
  import { Options } from '../../../node_modules/scroll-into-view-if-needed';
9
9
  import { Recordable } from '../../type';
10
- import { ApFormProps, WatchFunc, RegistedFieldType } from '..';
10
+ import { ApFormProps, ApFormInternalInstance, WatchFunc } from '..';
11
11
  import { OnCleanup } from '@vue/reactivity';
12
12
  declare function __VLS_template(): {
13
13
  attrs: Partial<{}>;
@@ -131,27 +131,18 @@ declare function __VLS_template(): {
131
131
  $emit: (event: string, ...args: any[]) => void;
132
132
  $el: any;
133
133
  $options: ComponentOptionsBase<Readonly< ApFormProps> & Readonly<{}>, {
134
+ setFieldsValue: (fields: Partial<any>) => void;
135
+ setFieldValue: (name: NamePath, value: any, triggerChange?: boolean) => void;
134
136
  resetFields: () => Promise<void>;
135
- clearValidate: (name?: NamePath | NamePath[]) => void;
136
- validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<{
137
- [key: string]: any;
138
- }> | undefined;
139
- getFieldsValue: (nameList?: InternalNamePath[] | true) => {
140
- [key: string]: any;
141
- } | undefined;
142
- validate: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<{
143
- [key: string]: any;
144
- }> | undefined;
145
- scrollToField: (name: NamePath, options?: {}) => void;
146
- setFieldsValue: (values: Record<string, any>) => void;
147
- setFieldValue: (name: NamePath, newValue: any, triggerChange?: boolean) => void;
137
+ clearValidate: (name?: NamePath) => void;
138
+ validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
139
+ getFieldsValue: (nameList?: true | InternalNamePath[]) => Partial<any> | undefined;
140
+ validate: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
141
+ scrollToField: (name: NamePath, options?: any) => void;
142
+ getInternalInstance: (mark: string) => ApFormInternalInstance | undefined;
143
+ validateFieldsReturnTransformed: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
144
+ getFieldsValueTransformed: (nameList?: true | InternalNamePath[]) => Partial<any> | undefined;
148
145
  registerWatch: (callback: WatchFunc, inner: boolean) => () => void;
149
- validateFieldsReturnTransformed: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<any>;
150
- getFieldsValueTransformed: (nameList?: InternalNamePath[] | true) => any;
151
- getInternalInstance: (mark: string) => {
152
- registerField: ({ initialValue, name, transform }: RegistedFieldType) => void;
153
- registerWatch: (callback: WatchFunc, inner: boolean) => () => void;
154
- } | undefined;
155
146
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
156
147
  layout: string;
157
148
  colon: boolean;
@@ -188,28 +179,19 @@ declare function __VLS_template(): {
188
179
  hideRequiredMark: boolean;
189
180
  validateOnRuleChange: boolean;
190
181
  syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
191
- }> & Omit<Readonly< ApFormProps> & Readonly<{}>, "validate" | "resetFields" | "clearValidate" | "validateFields" | "getFieldsValue" | "scrollToField" | "registerWatch" | "setFieldValue" | "setFieldsValue" | "validateFieldsReturnTransformed" | "getFieldsValueTransformed" | "getInternalInstance" | ("layout" | "colon" | "labelAlign" | "validateTrigger" | "hideRequiredMark" | "validateOnRuleChange" | "syncToUrl")> & ShallowUnwrapRef<{
182
+ }> & Omit<Readonly< ApFormProps> & Readonly<{}>, "validate" | "resetFields" | "clearValidate" | "validateFields" | "getFieldsValue" | "scrollToField" | "registerWatch" | "setFieldValue" | ("layout" | "colon" | "labelAlign" | "validateTrigger" | "hideRequiredMark" | "validateOnRuleChange" | "syncToUrl") | "setFieldsValue" | "getInternalInstance" | "validateFieldsReturnTransformed" | "getFieldsValueTransformed"> & ShallowUnwrapRef<{
183
+ setFieldsValue: (fields: Partial<any>) => void;
184
+ setFieldValue: (name: NamePath, value: any, triggerChange?: boolean) => void;
192
185
  resetFields: () => Promise<void>;
193
- clearValidate: (name?: NamePath | NamePath[]) => void;
194
- validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<{
195
- [key: string]: any;
196
- }> | undefined;
197
- getFieldsValue: (nameList?: InternalNamePath[] | true) => {
198
- [key: string]: any;
199
- } | undefined;
200
- validate: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<{
201
- [key: string]: any;
202
- }> | undefined;
203
- scrollToField: (name: NamePath, options?: {}) => void;
204
- setFieldsValue: (values: Record<string, any>) => void;
205
- setFieldValue: (name: NamePath, newValue: any, triggerChange?: boolean) => void;
186
+ clearValidate: (name?: NamePath) => void;
187
+ validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
188
+ getFieldsValue: (nameList?: true | InternalNamePath[]) => Partial<any> | undefined;
189
+ validate: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
190
+ scrollToField: (name: NamePath, options?: any) => void;
191
+ getInternalInstance: (mark: string) => ApFormInternalInstance | undefined;
192
+ validateFieldsReturnTransformed: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
193
+ getFieldsValueTransformed: (nameList?: true | InternalNamePath[]) => Partial<any> | undefined;
206
194
  registerWatch: (callback: WatchFunc, inner: boolean) => () => void;
207
- validateFieldsReturnTransformed: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<any>;
208
- getFieldsValueTransformed: (nameList?: InternalNamePath[] | true) => any;
209
- getInternalInstance: (mark: string) => {
210
- registerField: ({ initialValue, name, transform }: RegistedFieldType) => void;
211
- registerWatch: (callback: WatchFunc, inner: boolean) => () => void;
212
- } | undefined;
213
195
  }> & {} & ComponentCustomProperties & {} & {
214
196
  $slots: {
215
197
  default?(_: {}): any;
@@ -0,0 +1 @@
1
+ import '@aplus-frontend/ui-theme/src/ap-ladder/ap-ladder.less';
@@ -24,6 +24,8 @@ export interface ApTableModalProps<TableRowType = any> extends Omit<ModalProps,
24
24
  rowSelection?: TableProps['rowSelection'];
25
25
  /** 表格布局配置 */
26
26
  tableLayoutConfig?: TableLayoutConfig;
27
+ /** 渲染头部信息 */
28
+ renderHeader?: () => VNodeChild;
27
29
  }
28
30
  /** useCreateTableModal参数类型 */
29
31
  export interface UseCreateTableModalProps extends ApTableModalProps {