@aplus-frontend/ui 0.1.14 → 0.1.16

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 (73) hide show
  1. package/es/index.mjs +56 -54
  2. package/es/src/ap-table/ap-table.vue.mjs +132 -129
  3. package/es/src/ap-table/interface.d.ts +20 -13
  4. package/es/src/ap-table/utils.d.ts +8340 -1
  5. package/es/src/ap-table/utils.mjs +135 -79
  6. package/es/src/business/ap-input-radio/ApInputRadio.vue2.mjs +31 -28
  7. package/es/src/business/ap-input-radio/interface.d.ts +1 -1
  8. package/es/src/business/ap-label/style.css +3 -0
  9. package/es/src/business/ap-status/ApStatusGroup.vue2.mjs +12 -14
  10. package/es/src/business/index.d.ts +2 -2
  11. package/es/src/business/index.mjs +20 -18
  12. package/es/src/config-provider/config-provider-props.d.ts +5 -1
  13. package/es/src/config-provider/config-provider-props.mjs +4 -0
  14. package/es/src/config-provider/config-provider.d.ts +10 -1
  15. package/es/src/config-provider/config-provider.mjs +18 -17
  16. package/es/src/config-provider/constants.d.ts +6 -2
  17. package/es/src/config-provider/hooks/use-global-config.d.ts +5 -1
  18. package/es/src/config-provider/index.d.ts +20 -1
  19. package/es/src/editable-table/form-item.vue.mjs +85 -72
  20. package/es/src/editable-table/index.vue.d.ts +1 -0
  21. package/es/src/editable-table/index.vue.mjs +118 -95
  22. package/es/src/editable-table/interface.d.ts +6 -1
  23. package/es/src/editable-table/utils.mjs +31 -30
  24. package/es/src/hooks/useControllableValue.mjs +3 -0
  25. package/es/src/index.mjs +45 -43
  26. package/es/src/theme/antd-global-overwrite/admin/form.css +10 -12
  27. package/es/src/theme/antd-global-overwrite/admin/index.css +117 -45
  28. package/es/src/theme/antd-global-overwrite/admin/pagination.css +54 -16
  29. package/es/src/theme/antd-global-overwrite/admin/table.css +53 -17
  30. package/es/src/theme/antd-global-overwrite/aplus/form.css +28 -21
  31. package/es/src/theme/antd-global-overwrite/aplus/index.css +159 -74
  32. package/es/src/theme/antd-global-overwrite/aplus/pagination.css +66 -20
  33. package/es/src/theme/antd-global-overwrite/aplus/table.css +65 -33
  34. package/es/src/theme/ap-label/ap-label.css +3 -0
  35. package/es/src/utils/ap-trans-data/index.d.ts +11 -0
  36. package/es/src/utils/ap-trans-data/index.mjs +20 -0
  37. package/lib/index.js +1 -1
  38. package/lib/src/ap-table/ap-table.vue.js +1 -1
  39. package/lib/src/ap-table/interface.d.ts +20 -13
  40. package/lib/src/ap-table/utils.d.ts +8340 -1
  41. package/lib/src/ap-table/utils.js +1 -1
  42. package/lib/src/business/ap-input-radio/ApInputRadio.vue2.js +1 -1
  43. package/lib/src/business/ap-input-radio/interface.d.ts +1 -1
  44. package/lib/src/business/ap-label/style.css +3 -0
  45. package/lib/src/business/ap-status/ApStatusGroup.vue2.js +1 -1
  46. package/lib/src/business/index.d.ts +2 -2
  47. package/lib/src/business/index.js +1 -1
  48. package/lib/src/config-provider/config-provider-props.d.ts +5 -1
  49. package/lib/src/config-provider/config-provider-props.js +1 -1
  50. package/lib/src/config-provider/config-provider.d.ts +10 -1
  51. package/lib/src/config-provider/config-provider.js +1 -1
  52. package/lib/src/config-provider/constants.d.ts +6 -2
  53. package/lib/src/config-provider/hooks/use-global-config.d.ts +5 -1
  54. package/lib/src/config-provider/index.d.ts +20 -1
  55. package/lib/src/editable-table/form-item.vue.js +1 -1
  56. package/lib/src/editable-table/index.vue.d.ts +1 -0
  57. package/lib/src/editable-table/index.vue.js +1 -1
  58. package/lib/src/editable-table/interface.d.ts +6 -1
  59. package/lib/src/editable-table/utils.js +1 -1
  60. package/lib/src/hooks/useControllableValue.js +1 -1
  61. package/lib/src/index.js +1 -1
  62. package/lib/src/theme/antd-global-overwrite/admin/form.css +10 -12
  63. package/lib/src/theme/antd-global-overwrite/admin/index.css +117 -45
  64. package/lib/src/theme/antd-global-overwrite/admin/pagination.css +54 -16
  65. package/lib/src/theme/antd-global-overwrite/admin/table.css +53 -17
  66. package/lib/src/theme/antd-global-overwrite/aplus/form.css +28 -21
  67. package/lib/src/theme/antd-global-overwrite/aplus/index.css +159 -74
  68. package/lib/src/theme/antd-global-overwrite/aplus/pagination.css +66 -20
  69. package/lib/src/theme/antd-global-overwrite/aplus/table.css +65 -33
  70. package/lib/src/theme/ap-label/ap-label.css +3 -0
  71. package/lib/src/utils/ap-trans-data/index.d.ts +11 -0
  72. package/lib/src/utils/ap-trans-data/index.js +1 -0
  73. package/package.json +3 -3
@@ -8,7 +8,7 @@ import { ValidateMessages } from 'ant-design-vue/es/form/interface';
8
8
  import { RequiredMark } from 'ant-design-vue/es/form/Form';
9
9
  import { ThemeConfig } from 'ant-design-vue/es/config-provider/context';
10
10
  import { LocaleType } from '..';
11
- import { ApiType, TableDefaultConfig, ScrollbarGlobalConfig, ApUploadConfig, ApDescriptionsConfig } from './constants';
11
+ import { ApiType, TableDefaultConfig, ScrollbarGlobalConfig, ApUploadConfig, ApDescriptionsConfig, ValueTypeRenderConfig } from './constants';
12
12
  export * from './config-provider-props';
13
13
  export * from './constants';
14
14
  export * from './hooks/use-global-config';
@@ -161,6 +161,10 @@ export declare const APConfigProvider: {
161
161
  type: PropType<ApDescriptionsConfig>;
162
162
  default: () => {};
163
163
  };
164
+ valueTypeMap: {
165
+ type: PropType<Record<string, ValueTypeRenderConfig>>;
166
+ default: () => {};
167
+ };
164
168
  }>>, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, VNodeProps & AllowedComponentProps & ComponentCustomProps & Readonly< ExtractPropTypes<{
165
169
  iconPrefixCls: StringConstructor;
166
170
  getTargetContainer: {
@@ -306,6 +310,10 @@ export declare const APConfigProvider: {
306
310
  type: PropType<ApDescriptionsConfig>;
307
311
  default: () => {};
308
312
  };
313
+ valueTypeMap: {
314
+ type: PropType<Record<string, ValueTypeRenderConfig>>;
315
+ default: () => {};
316
+ };
309
317
  }>>, {
310
318
  input: {
311
319
  autocomplete?: string;
@@ -344,6 +352,7 @@ export declare const APConfigProvider: {
344
352
  uiMode: "aplus" | "admin";
345
353
  apUpload: ApUploadConfig;
346
354
  apDescriptions: ApDescriptionsConfig;
355
+ valueTypeMap: Record<string, ValueTypeRenderConfig>;
347
356
  }, true, {}, {}, {
348
357
  P: {};
349
358
  B: {};
@@ -496,6 +505,10 @@ export declare const APConfigProvider: {
496
505
  type: PropType<ApDescriptionsConfig>;
497
506
  default: () => {};
498
507
  };
508
+ valueTypeMap: {
509
+ type: PropType<Record<string, ValueTypeRenderConfig>>;
510
+ default: () => {};
511
+ };
499
512
  }>>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
500
513
  input: {
501
514
  autocomplete?: string;
@@ -534,6 +547,7 @@ export declare const APConfigProvider: {
534
547
  uiMode: "aplus" | "admin";
535
548
  apUpload: ApUploadConfig;
536
549
  apDescriptions: ApDescriptionsConfig;
550
+ valueTypeMap: Record<string, ValueTypeRenderConfig>;
537
551
  }>;
538
552
  __isFragment?: never;
539
553
  __isTeleport?: never;
@@ -683,6 +697,10 @@ export declare const APConfigProvider: {
683
697
  type: PropType<ApDescriptionsConfig>;
684
698
  default: () => {};
685
699
  };
700
+ valueTypeMap: {
701
+ type: PropType<Record<string, ValueTypeRenderConfig>>;
702
+ default: () => {};
703
+ };
686
704
  }>>, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
687
705
  input: {
688
706
  autocomplete?: string;
@@ -721,6 +739,7 @@ export declare const APConfigProvider: {
721
739
  uiMode: "aplus" | "admin";
722
740
  apUpload: ApUploadConfig;
723
741
  apDescriptions: ApDescriptionsConfig;
742
+ valueTypeMap: Record<string, ValueTypeRenderConfig>;
724
743
  }, {}, string, {}> & ( VNodeProps & ( AllowedComponentProps & ComponentCustomProps & ( Plugin & (new (...args: any[]) => {
725
744
  $props: {
726
745
  onClick?: () => void;
@@ -1,15 +1,17 @@
1
- import { defineComponent as V, ref as x, unref as t, useSlots as A, watch as O, openBlock as C, createBlock as K, mergeProps as w, withCtx as u, createVNode as q, createSlots as H, createElementBlock as I, Fragment as W, createElementVNode as b, normalizeClass as $, toDisplayString as G, createCommentVNode as M, renderList as U, renderSlot as J, normalizeProps as Q, guardReactiveProps as X } from "vue";
2
- import { Table as Y } from "ant-design-vue";
3
- import { ApForm as y } from "../ap-form/index.mjs";
4
- import { isNumber as m, cloneDeep as f, omit as Z } from "lodash-unified";
1
+ import { defineComponent as K, ref as y, unref as o, useSlots as q, watch as H, openBlock as u, createBlock as C, mergeProps as b, withCtx as m, createVNode as w, createSlots as I, createElementBlock as W, normalizeClass as $, createCommentVNode as R, createElementVNode as G, toDisplayString as M, normalizeStyle as Q, renderList as U, renderSlot as J, normalizeProps as X, guardReactiveProps as Y } from "vue";
2
+ import { Table as Z, Tooltip as ee } from "ant-design-vue";
3
+ import { ApForm as B } from "../ap-form/index.mjs";
4
+ import { isNumber as i, cloneDeep as f, omit as oe } from "lodash-unified";
5
5
  import "../config-provider/index.mjs";
6
- import { useInjectForm as ee } from "../ap-form/context.mjs";
6
+ import { useInjectForm as te } from "../ap-form/context.mjs";
7
7
  import "./style/index.css";
8
- import { isDef as c } from "../utils/index.mjs";
9
- import oe from "./hooks/use-get-columns.mjs";
10
- import { scrollToRowIndex as te, getColumnIsRequired as ae } from "./utils.mjs";
11
- import { useNamespace as ne } from "../config-provider/hooks/use-namespace.mjs";
12
- const ge = /* @__PURE__ */ V({
8
+ import { isDef as p } from "../utils/index.mjs";
9
+ import ae from "./hooks/use-get-columns.mjs";
10
+ import { scrollToRowIndex as le, getColumnIsRequired as ne } from "./utils.mjs";
11
+ import { QuestionCircleOutlined as re } from "@ant-design/icons-vue";
12
+ import { useToken as se } from "ant-design-vue/es/theme/internal";
13
+ import { useNamespace as de } from "../config-provider/hooks/use-namespace.mjs";
14
+ const Re = /* @__PURE__ */ K({
13
15
  name: "EditableTableInner",
14
16
  __name: "form-item",
15
17
  props: {
@@ -109,103 +111,114 @@ const ge = /* @__PURE__ */ V({
109
111
  default: () => ({})
110
112
  }
111
113
  },
112
- setup(R, {
113
- expose: B
114
+ setup(k, {
115
+ expose: D
114
116
  }) {
115
- var p;
116
- const n = R, {
117
- internalInstance: l,
118
- model: D
119
- } = ee(), r = x(((p = t(D)) == null ? void 0 : p[n.name]) || []), v = A(), F = y.useWatch(n.name);
120
- O(() => F.value, (e) => {
121
- var o;
122
- r.value = e, (o = n.onChange) == null || o.call(n, e);
117
+ var h;
118
+ const l = k, {
119
+ internalInstance: n,
120
+ model: v
121
+ } = te(), r = y(((h = o(v)) == null ? void 0 : h[l.name]) || []), L = q(), E = B.useWatch(l.name);
122
+ H(() => E.value, (e) => {
123
+ var t;
124
+ r.value = e, (t = l.onChange) == null || t.call(l, e);
123
125
  }, {
124
126
  deep: !0
125
127
  });
126
128
  const {
127
- b: E,
128
- em: L
129
- } = ne("editable-table"), i = x(), N = oe(n);
130
- function k(e, o) {
129
+ b: F,
130
+ em: N
131
+ } = de("editable-table"), c = y(), [, S] = se(), T = ae(l);
132
+ function _(e, t) {
131
133
  var d;
132
- const a = ((d = t(r)) == null ? void 0 : d.length) || 0;
133
- if (c(n.maxLength) && a >= n.maxLength)
134
+ const a = ((d = o(r)) == null ? void 0 : d.length) || 0;
135
+ if (p(l.maxLength) && a >= l.maxLength)
134
136
  return;
135
- const s = [...t(r) || []];
136
- c(o) ? s.splice(o, 0, {
137
+ const s = [...o(r) || []];
138
+ p(t) ? s.splice(t, 0, {
137
139
  ...e || {}
138
140
  }) : s.push({
139
141
  ...e || {}
140
- }), l == null || l.setFieldValue(n.name, [...t(r) || [], e || {}]);
142
+ }), n == null || n.setFieldValue(l.name, [...o(r) || [], e || {}]);
141
143
  }
142
- function S(e, o = "suffix") {
144
+ function z(e, t = "suffix") {
143
145
  var g;
144
- const a = ((g = t(r)) == null ? void 0 : g.length) || 0, s = m(e) ? e : e.length;
145
- if (c(n.maxLength) && a + s > n.maxLength)
146
+ const a = ((g = o(r)) == null ? void 0 : g.length) || 0, s = i(e) ? e : e.length;
147
+ if (p(l.maxLength) && a + s > l.maxLength)
146
148
  return;
147
- const d = [...t(r) || []], h = m(e) ? new Array(e).fill({}) : f(e);
148
- o === "suffix" ? d.push(...h) : d.unshift(...h), l == null || l.setFieldValue(n.name, d);
149
+ const d = [...o(r) || []], x = i(e) ? new Array(e).fill({}) : f(e);
150
+ t === "suffix" ? d.push(...x) : d.unshift(...x), n == null || n.setFieldValue(l.name, d);
149
151
  }
150
- function _(e) {
151
- let o = f(t(r) || []);
152
- const a = m(e) ? [e] : e;
153
- o = o.filter((s, d) => !a.includes(d)), l == null || l.setFieldValue(n.name, o);
152
+ function P(e) {
153
+ let t = f(o(r) || []);
154
+ const a = i(e) ? [e] : e;
155
+ t = t.filter((s, d) => !a.includes(d)), n == null || n.setFieldValue(l.name, t);
154
156
  }
155
- function T() {
156
- return t(r);
157
+ function j() {
158
+ return o(r);
157
159
  }
158
- function j(e) {
159
- var o;
160
- return (o = t(r)) == null ? void 0 : o[e];
160
+ function O(e) {
161
+ var t;
162
+ return (t = o(r)) == null ? void 0 : t[e];
161
163
  }
162
- function z(e, o) {
163
- const a = f(t(r));
164
+ function V(e, t) {
165
+ const a = f(o(r));
164
166
  a[e] && (a[e] = {
165
167
  ...a[e],
166
- ...o
167
- }, l == null || l.setFieldValue(n.name, [...a]));
168
+ ...t
169
+ }, n == null || n.setFieldValue(l.name, [...a]));
168
170
  }
169
- function P(e, o) {
171
+ function A(e, t) {
170
172
  var s;
171
173
  const a = e === "end" ? r.value.length - 1 : e;
172
- te(a, (s = i.value) == null ? void 0 : s.$el, o);
174
+ le(a, (s = c.value) == null ? void 0 : s.$el, t);
173
175
  }
174
- return B({
175
- add: k,
176
- remove: _,
177
- getRowData: j,
178
- getRowsData: T,
179
- setRowData: z,
180
- addMultiple: S,
181
- scrollTo: P
182
- }), (e, o) => (C(), K(t(y).FormItem, w(e.formItem, {
176
+ return D({
177
+ add: _,
178
+ remove: P,
179
+ getRowData: O,
180
+ getRowsData: j,
181
+ setRowData: V,
182
+ addMultiple: z,
183
+ scrollTo: A
184
+ }), (e, t) => (u(), C(o(B).FormItem, b(e.formItem, {
183
185
  name: e.name,
184
186
  label: e.label
185
187
  }), {
186
- default: u(() => [q(t(Y), w(t(Z)(n, ["name", "maxLength", "onChange"]), {
187
- class: t(E)(),
188
- columns: t(N),
188
+ default: m(() => [w(o(Z), b(o(oe)(l, ["name", "maxLength", "onChange"]), {
189
+ class: o(F)(),
190
+ columns: o(T),
189
191
  "data-source": r.value,
190
192
  ref_key: "tableRef",
191
- ref: i
192
- }), H({
193
- headerCell: u(({
193
+ ref: c
194
+ }), I({
195
+ headerCell: m(({
194
196
  column: a
195
- }) => [t(ae)(a) ? (C(), I(W, {
196
- key: 0
197
- }, [b("span", {
198
- class: $(t(L)("header-cell", "required"))
199
- }, "*", 2), b("span", null, G(a.title), 1)], 64)) : M("", !0)]),
197
+ }) => [o(ne)(a) ? (u(), W("span", {
198
+ key: 0,
199
+ class: $(o(N)("header-cell", "required"))
200
+ }, "*", 2)) : R("", !0), G("span", null, M(a.title), 1), a.tooltip ? (u(), C(o(ee), {
201
+ key: 1,
202
+ title: a.tooltip,
203
+ placement: "bottom"
204
+ }, {
205
+ default: m(() => [w(o(re), {
206
+ style: Q({
207
+ paddingLeft: "4px",
208
+ color: o(S).colorPrimary
209
+ })
210
+ }, null, 8, ["style"])]),
211
+ _: 2
212
+ }, 1032, ["title"])) : R("", !0)]),
200
213
  _: 2
201
- }, [U(v, (a, s) => ({
214
+ }, [U(L, (a, s) => ({
202
215
  name: s,
203
- fn: u((d) => [J(e.$slots, s, Q(X(d || {})))])
216
+ fn: m((d) => [J(e.$slots, s, X(Y(d || {})))])
204
217
  }))]), 1040, ["class", "columns", "data-source"])]),
205
218
  _: 3
206
219
  }, 16, ["name", "label"]));
207
220
  }
208
221
  });
209
222
  export {
210
- ge as default
223
+ Re as default
211
224
  };
@@ -19,6 +19,7 @@ declare const _default: <RecordType extends Recordable = any>(__VLS_props: NonNu
19
19
  setRowData: (index: number, payload: any) => void;
20
20
  addMultiple: (list: number | Partial<RecordType>[], insetIn?: "prefix" | "suffix") => void;
21
21
  scrollTo: (index: number | "end", options?: StandardBehaviorOptions) => void;
22
+ clear: () => void;
22
23
  }>): void;
23
24
  attrs: any;
24
25
  slots: ReturnType<() => Readonly<{
@@ -1,16 +1,18 @@
1
- import { defineComponent as M, useSlots as U, ref as y, watch as W, unref as l, openBlock as w, createBlock as $, withCtx as c, createVNode as v, mergeProps as G, createSlots as J, createElementBlock as Q, Fragment as X, createElementVNode as b, normalizeClass as Y, toDisplayString as Z, createCommentVNode as ee, renderList as te, renderSlot as ae, normalizeProps as ne, guardReactiveProps as oe } from "vue";
2
- import { Table as le } from "ant-design-vue";
3
- import { ApForm as f } from "../ap-form/index.mjs";
4
- import { isArray as R, isNumber as p, cloneDeep as h, omit as re } from "lodash-unified";
1
+ import { defineComponent as G, useSlots as Q, ref as R, watch as b, unref as o, openBlock as p, createBlock as B, withCtx as m, createVNode as x, mergeProps as J, createSlots as X, createElementBlock as Y, normalizeClass as Z, createCommentVNode as F, createElementVNode as ee, toDisplayString as te, normalizeStyle as ae, renderList as ne, renderSlot as oe, normalizeProps as le, guardReactiveProps as re } from "vue";
2
+ import { Table as se, Tooltip as ue } from "ant-design-vue";
3
+ import { ApForm as h } from "../ap-form/index.mjs";
4
+ import { isEqual as ie, isArray as k, isNumber as y, cloneDeep as g, omit as de } from "lodash-unified";
5
5
  import "../config-provider/index.mjs";
6
6
  import "../hooks/index.mjs";
7
- import { isDef as x } from "../utils/index.mjs";
8
- import { scrollToRowIndex as se, getColumnIsRequired as ue } from "./utils.mjs";
9
- import de from "./hooks/use-get-columns.mjs";
7
+ import { isDef as C } from "../utils/index.mjs";
8
+ import { scrollToRowIndex as me, getColumnIsRequired as fe } from "./utils.mjs";
9
+ import ce from "./hooks/use-get-columns.mjs";
10
10
  import "./style/index.css";
11
- import { useNamespace as ie } from "../config-provider/hooks/use-namespace.mjs";
12
- import { useControllableValue as me } from "../hooks/useControllableValue.mjs";
13
- const Be = /* @__PURE__ */ M({
11
+ import { useToken as pe } from "ant-design-vue/es/theme/internal";
12
+ import { QuestionCircleOutlined as xe } from "@ant-design/icons-vue";
13
+ import { useNamespace as he } from "../config-provider/hooks/use-namespace.mjs";
14
+ import { useControllableValue as ye } from "../hooks/useControllableValue.mjs";
15
+ const De = /* @__PURE__ */ G({
14
16
  name: "EditableTable",
15
17
  __name: "index",
16
18
  props: {
@@ -109,121 +111,142 @@ const Be = /* @__PURE__ */ M({
109
111
  onFieldChange: {}
110
112
  },
111
113
  emits: ["update:value"],
112
- setup(B, {
113
- expose: F,
114
- emit: D
114
+ setup(E, {
115
+ expose: L,
116
+ emit: N
115
117
  }) {
116
- const o = B, {
117
- b: _,
118
- em: N
119
- } = ie("editable-table"), k = U(), E = D, g = y(), {
118
+ const l = E, {
119
+ b: V,
120
+ em: _
121
+ } = he("editable-table"), D = Q(), S = N, v = R(), {
120
122
  value: s,
121
- updateValue: L
122
- } = me(o, E), u = y(), S = f.useWatch(o.name, u);
123
- W(() => S.value, (e) => {
124
- var n;
125
- L(e), (n = o.onChange) == null || n.call(o, e);
123
+ updateValue: T
124
+ } = ye(l, S), u = R(), [, A] = pe(), c = h.useWatch(l.name, u);
125
+ b(() => c.value, (e) => {
126
+ var t;
127
+ T(e), (t = l.onChange) == null || t.call(l, e);
128
+ }, {
129
+ deep: !0
130
+ }), b(s, (e) => {
131
+ var t;
132
+ e !== o(c) && (ie(e, o(c)) || (t = u.value) == null || t.setFieldValue(l.name, e));
126
133
  }, {
127
134
  deep: !0
128
135
  });
129
- const V = de(o);
130
- function A() {
136
+ const z = ce(l);
137
+ function P() {
131
138
  var e;
132
139
  (e = u.value) == null || e.resetFields();
133
140
  }
134
- function T(e) {
135
- return e ? (R(e) ? e : [e]).map((t) => R(t) ? [o.name, ...t] : [o.name, t]) : void 0;
141
+ function I(e) {
142
+ return e ? (k(e) ? e : [e]).map((a) => k(a) ? [l.name, ...a] : [l.name, a]) : void 0;
136
143
  }
137
- async function z(e, n) {
138
- var a;
139
- const t = await ((a = u.value) == null ? void 0 : a.validateFields(T(e), n));
140
- return t == null ? void 0 : t[o.name];
144
+ async function O(e, t) {
145
+ var n;
146
+ const a = await ((n = u.value) == null ? void 0 : n.validateFields(I(e), t));
147
+ return a == null ? void 0 : a[l.name];
141
148
  }
142
- function I(e, n) {
143
- var r, d, i;
144
- const t = ((r = l(s)) == null ? void 0 : r.length) || 0;
145
- if (x(o.maxLength) && t >= o.maxLength)
149
+ function j(e, t) {
150
+ var r, i, d;
151
+ const a = ((r = o(s)) == null ? void 0 : r.length) || 0;
152
+ if (C(l.maxLength) && a >= l.maxLength)
146
153
  return;
147
- const a = [...l(s) || []];
148
- x(n) ? a.splice(n, 0, {
154
+ const n = [...o(s) || []];
155
+ C(t) ? n.splice(t, 0, {
149
156
  ...e || {}
150
- }) : a.push({
157
+ }) : n.push({
151
158
  ...e || {}
152
- }), (i = (d = u.value) == null ? void 0 : d.setFieldValue) == null || i.call(d, o.name, a);
159
+ }), (d = (i = u.value) == null ? void 0 : i.setFieldValue) == null || d.call(i, l.name, n);
153
160
  }
154
- function P(e, n = "suffix") {
155
- var i, m, C;
156
- const t = ((i = l(s)) == null ? void 0 : i.length) || 0, a = p(e) ? e : e.length;
157
- if (x(o.maxLength) && t + a > o.maxLength)
161
+ function q(e, t = "suffix") {
162
+ var d, f, w;
163
+ const a = ((d = o(s)) == null ? void 0 : d.length) || 0, n = y(e) ? e : e.length;
164
+ if (C(l.maxLength) && a + n > l.maxLength)
158
165
  return;
159
- const r = [...l(s) || []], d = p(e) ? new Array(e).fill({}) : h(e);
160
- n === "suffix" ? r.push(...d) : r.unshift(...d), (C = (m = u.value) == null ? void 0 : m.setFieldValue) == null || C.call(m, o.name, r);
166
+ const r = [...o(s) || []], i = y(e) ? new Array(e).fill({}) : g(e);
167
+ t === "suffix" ? r.push(...i) : r.unshift(...i), (w = (f = u.value) == null ? void 0 : f.setFieldValue) == null || w.call(f, l.name, r);
161
168
  }
162
- function j(e) {
163
- var a, r;
164
- let n = h(l(s) || []);
165
- const t = p(e) ? [e] : e;
166
- n = n.filter((d, i) => !t.includes(i)), (r = (a = u.value) == null ? void 0 : a.setFieldValue) == null || r.call(a, o.name, n);
169
+ function K(e) {
170
+ var n, r;
171
+ let t = g(o(s) || []);
172
+ const a = y(e) ? [e] : e;
173
+ t = t.filter((i, d) => !a.includes(d)), (r = (n = u.value) == null ? void 0 : n.setFieldValue) == null || r.call(n, l.name, t);
167
174
  }
168
- function O() {
169
- return l(s);
175
+ function H() {
176
+ return o(s);
170
177
  }
171
- function K(e) {
172
- var n;
173
- return (n = l(s)) == null ? void 0 : n[e];
178
+ function M(e) {
179
+ var t;
180
+ return (t = o(s)) == null ? void 0 : t[e];
174
181
  }
175
- function q(e, n) {
176
- var a, r;
177
- const t = h(l(s));
178
- t[e] && (t[e] = {
179
- ...t[e],
180
- ...n
181
- }, (r = (a = u.value) == null ? void 0 : a.setFieldValue) == null || r.call(a, o.name, [...t]));
182
+ function U(e, t) {
183
+ var n, r;
184
+ const a = g(o(s));
185
+ a[e] && (a[e] = {
186
+ ...a[e],
187
+ ...t
188
+ }, (r = (n = u.value) == null ? void 0 : n.setFieldValue) == null || r.call(n, l.name, [...a]));
189
+ }
190
+ function W(e, t) {
191
+ var n;
192
+ const a = e === "end" ? s.value.length - 1 : e;
193
+ me(a, (n = v.value) == null ? void 0 : n.$el, t);
182
194
  }
183
- function H(e, n) {
184
- var a;
185
- const t = e === "end" ? s.value.length - 1 : e;
186
- se(t, (a = g.value) == null ? void 0 : a.$el, n);
195
+ function $() {
196
+ var e, t;
197
+ (t = (e = u.value) == null ? void 0 : e.setFieldValue) == null || t.call(e, l.name, []);
187
198
  }
188
- return F({
189
- resetFields: A,
190
- validateFields: z,
191
- add: I,
192
- remove: j,
193
- getRowData: K,
194
- getRowsData: O,
195
- setRowData: q,
196
- addMultiple: P,
197
- scrollTo: H
198
- }), (e, n) => (w(), $(l(f), {
199
+ return L({
200
+ resetFields: P,
201
+ validateFields: O,
202
+ add: j,
203
+ remove: K,
204
+ getRowData: M,
205
+ getRowsData: H,
206
+ setRowData: U,
207
+ addMultiple: q,
208
+ scrollTo: W,
209
+ clear: $
210
+ }), (e, t) => (p(), B(o(h), {
199
211
  "initial-values": {
200
- [o.name]: l(s)
212
+ [l.name]: o(s)
201
213
  },
202
214
  ref_key: "formRef",
203
215
  ref: u
204
216
  }, {
205
- default: c(() => [v(l(f).FormItem, {
217
+ default: m(() => [x(o(h).FormItem, {
206
218
  name: e.name,
207
219
  "no-style": ""
208
220
  }, {
209
- default: c(() => [v(l(le), G(l(re)(o, ["name", "value", "onUpdate:value", "maxLength", "onChange"]), {
210
- class: l(_)(),
211
- columns: l(V),
212
- "data-source": l(s),
221
+ default: m(() => [x(o(se), J(o(de)(l, ["name", "value", "onUpdate:value", "maxLength", "onChange"]), {
222
+ class: o(V)(),
223
+ columns: o(z),
224
+ "data-source": o(s),
213
225
  ref_key: "tableRef",
214
- ref: g
215
- }), J({
216
- headerCell: c(({
217
- column: t
218
- }) => [l(ue)(t) ? (w(), Q(X, {
219
- key: 0
220
- }, [b("span", {
221
- class: Y(l(N)("header-cell", "required"))
222
- }, "*", 2), b("span", null, Z(t.title), 1)], 64)) : ee("", !0)]),
226
+ ref: v
227
+ }), X({
228
+ headerCell: m(({
229
+ column: a
230
+ }) => [o(fe)(a) ? (p(), Y("span", {
231
+ key: 0,
232
+ class: Z(o(_)("header-cell", "required"))
233
+ }, "*", 2)) : F("", !0), ee("span", null, te(a.title), 1), a.tooltip ? (p(), B(o(ue), {
234
+ key: 1,
235
+ title: a.tooltip,
236
+ placement: "bottom"
237
+ }, {
238
+ default: m(() => [x(o(xe), {
239
+ style: ae({
240
+ paddingLeft: "4px",
241
+ color: o(A).colorPrimary
242
+ })
243
+ }, null, 8, ["style"])]),
244
+ _: 2
245
+ }, 1032, ["title"])) : F("", !0)]),
223
246
  _: 2
224
- }, [te(k, (t, a) => ({
225
- name: a,
226
- fn: c((r) => [ae(e.$slots, a, ne(oe(r || {})))])
247
+ }, [ne(D, (a, n) => ({
248
+ name: n,
249
+ fn: m((r) => [oe(e.$slots, n, le(re(r || {})))])
227
250
  }))]), 1040, ["class", "columns", "data-source"])]),
228
251
  _: 3
229
252
  }, 8, ["name"])]),
@@ -232,5 +255,5 @@ const Be = /* @__PURE__ */ M({
232
255
  }
233
256
  });
234
257
  export {
235
- Be as default
258
+ De as default
236
259
  };
@@ -140,6 +140,11 @@ export type EditableTableExpose<ModelType = any, RecordType = any> = {
140
140
  * @returns
141
141
  */
142
142
  remove: (index: number | number[]) => void;
143
+ /**
144
+ * 清空所有数据
145
+ * @returns
146
+ */
147
+ clear: () => void;
143
148
  /**
144
149
  * 获取所有行的数据
145
150
  * @returns
@@ -169,4 +174,4 @@ export type EditableTableExpose<ModelType = any, RecordType = any> = {
169
174
  * 可编辑表格作为表单项暴露的实例
170
175
  * @description 作为Form表单使用时不再暴露表单相关的API
171
176
  */
172
- export type EditableTableFormItemExpose<ModelType = any, RecordType = any> = Omit<EditableTableExpose<ModelType, RecordType>, 'resetFields' | 'validateFields'>;
177
+ export type EditableTableFormItemExpose<ModelType = any, RecordType = any> = Omit<EditableTableExpose<ModelType, RecordType>, 'resetFields' | 'validateFields' | 'clear'>;