@aplus-frontend/ui 0.1.13 → 0.1.15

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 (45) hide show
  1. package/es/src/ap-download/ap-download.vue.mjs +27 -27
  2. package/es/src/ap-download/hooks/useStyle.d.ts +1 -1
  3. package/es/src/ap-download/hooks/useStyle.mjs +13 -13
  4. package/es/src/business/ap-input-radio/ApInputRadio.vue2.mjs +31 -28
  5. package/es/src/business/ap-input-radio/interface.d.ts +1 -1
  6. package/es/src/business/ap-label/style.css +3 -0
  7. package/es/src/business/ap-status/ApStatusGroup.vue2.mjs +12 -14
  8. package/es/src/business/index.d.ts +0 -2
  9. package/es/src/editable-table/index.vue.d.ts +1 -0
  10. package/es/src/editable-table/index.vue.mjs +97 -87
  11. package/es/src/editable-table/interface.d.ts +6 -1
  12. package/es/src/hooks/useControllableValue.mjs +3 -0
  13. package/es/src/theme/antd-global-overwrite/admin/form.css +5 -12
  14. package/es/src/theme/antd-global-overwrite/admin/index.css +128 -28
  15. package/es/src/theme/antd-global-overwrite/admin/pagination.css +16 -16
  16. package/es/src/theme/antd-global-overwrite/admin/table.css +107 -0
  17. package/es/src/theme/antd-global-overwrite/aplus/form.css +14 -21
  18. package/es/src/theme/antd-global-overwrite/aplus/index.css +174 -74
  19. package/es/src/theme/antd-global-overwrite/aplus/pagination.css +20 -20
  20. package/es/src/theme/antd-global-overwrite/aplus/table.css +140 -33
  21. package/es/src/theme/ap-label/ap-label.css +3 -0
  22. package/es/src/utils/ap-trans-data/index.d.ts +12 -0
  23. package/lib/src/ap-download/ap-download.vue.js +1 -1
  24. package/lib/src/ap-download/hooks/useStyle.d.ts +1 -1
  25. package/lib/src/ap-download/hooks/useStyle.js +1 -1
  26. package/lib/src/business/ap-input-radio/ApInputRadio.vue2.js +1 -1
  27. package/lib/src/business/ap-input-radio/interface.d.ts +1 -1
  28. package/lib/src/business/ap-label/style.css +3 -0
  29. package/lib/src/business/ap-status/ApStatusGroup.vue2.js +1 -1
  30. package/lib/src/business/index.d.ts +0 -2
  31. package/lib/src/editable-table/index.vue.d.ts +1 -0
  32. package/lib/src/editable-table/index.vue.js +1 -1
  33. package/lib/src/editable-table/interface.d.ts +6 -1
  34. package/lib/src/hooks/useControllableValue.js +1 -1
  35. package/lib/src/theme/antd-global-overwrite/admin/form.css +5 -12
  36. package/lib/src/theme/antd-global-overwrite/admin/index.css +128 -28
  37. package/lib/src/theme/antd-global-overwrite/admin/pagination.css +16 -16
  38. package/lib/src/theme/antd-global-overwrite/admin/table.css +107 -0
  39. package/lib/src/theme/antd-global-overwrite/aplus/form.css +14 -21
  40. package/lib/src/theme/antd-global-overwrite/aplus/index.css +174 -74
  41. package/lib/src/theme/antd-global-overwrite/aplus/pagination.css +20 -20
  42. package/lib/src/theme/antd-global-overwrite/aplus/table.css +140 -33
  43. package/lib/src/theme/ap-label/ap-label.css +3 -0
  44. package/lib/src/utils/ap-trans-data/index.d.ts +12 -0
  45. package/package.json +1 -1
@@ -1,12 +1,12 @@
1
- import { defineComponent as g, computed as a, unref as s, openBlock as _, createElementBlock as C, normalizeStyle as y, normalizeClass as n, createElementVNode as t, renderSlot as w, toDisplayString as z } from "vue";
1
+ import { defineComponent as y, computed as s, unref as t, openBlock as w, createElementBlock as z, normalizeStyle as b, normalizeClass as n, createElementVNode as a, renderSlot as N, toDisplayString as O } from "vue";
2
2
  import "../config-provider/index.mjs";
3
- import { useOssInit as N } from "./hooks/index.mjs";
3
+ import { useOssInit as S } from "./hooks/index.mjs";
4
4
  import "./style/ap-download.css";
5
- import { getFileInfo as O } from "./utils/getFileInfo.mjs";
6
- import { useStyle as S } from "./hooks/useStyle.mjs";
7
- import { useLocale as b } from "../config-provider/hooks/use-locale.mjs";
8
- import { useGlobalConfig as h } from "../config-provider/hooks/use-global-config.mjs";
9
- const A = { class: "icon" }, B = { class: "text" }, W = /* @__PURE__ */ g({
5
+ import { getFileInfo as h } from "./utils/getFileInfo.mjs";
6
+ import { useStyle as A } from "./hooks/useStyle.mjs";
7
+ import { useLocale as B } from "../config-provider/hooks/use-locale.mjs";
8
+ import { useGlobalConfig as F } from "../config-provider/hooks/use-global-config.mjs";
9
+ const k = { class: "icon" }, v = { class: "text" }, V = /* @__PURE__ */ y({
10
10
  name: "ApDownload",
11
11
  __name: "ap-download",
12
12
  props: {
@@ -19,35 +19,35 @@ const A = { class: "icon" }, B = { class: "text" }, W = /* @__PURE__ */ g({
19
19
  getOssAccess: {}
20
20
  },
21
21
  setup(l) {
22
- const { lang: r } = b(), c = a(() => r.value === "zh-cn" ? "zh_CN" : "en_US"), e = l, i = h("apUpload"), { wrapperStyle: p, getWrapperClass: d, getInnerWrapperClass: m } = S(
23
- e.color,
24
- e.size,
25
- e.disabled
26
- ), f = a(() => {
22
+ const { lang: r } = B(), c = s(() => r.value === "zh-cn" ? "zh_CN" : "en_US"), e = l, i = F("apUpload"), p = s(() => e.disabled), d = s(() => e.color), m = s(() => e.size), { wrapperStyle: f, getWrapperClass: u, getInnerWrapperClass: g } = A(
23
+ d,
24
+ m,
25
+ p
26
+ ), _ = s(() => {
27
27
  var o;
28
28
  return e.getOssAccess || ((o = i.value) == null ? void 0 : o.getOssAccess);
29
- }), u = async () => {
30
- e.disabled || await (await N(
31
- f.value,
32
- s(c)
33
- )).downloadFile(O(e.needName, e.fileName));
29
+ }), C = async () => {
30
+ e.disabled || await (await S(
31
+ _.value,
32
+ t(c)
33
+ )).downloadFile(h(e.needName, e.fileName));
34
34
  };
35
- return (o, F) => (_(), C("span", {
36
- style: y(s(p)),
37
- class: n(s(d)),
38
- onClick: u
35
+ return (o, x) => (w(), z("span", {
36
+ style: b(t(f)),
37
+ class: n(t(u)),
38
+ onClick: C
39
39
  }, [
40
- t("span", {
41
- class: n(s(m))
40
+ a("span", {
41
+ class: n(t(g))
42
42
  }, [
43
- t("span", A, [
44
- w(o.$slots, "icon")
43
+ a("span", k, [
44
+ N(o.$slots, "icon")
45
45
  ]),
46
- t("span", B, z(o.text), 1)
46
+ a("span", v, O(o.text), 1)
47
47
  ], 2)
48
48
  ], 6));
49
49
  }
50
50
  });
51
51
  export {
52
- W as default
52
+ V as default
53
53
  };
@@ -1,5 +1,5 @@
1
1
  import { ComputedRef } from 'vue';
2
- export declare function useStyle(color: string, size: string, disabled: boolean): {
2
+ export declare function useStyle(color: ComputedRef<string>, size: ComputedRef<string>, disabled: ComputedRef<boolean>): {
3
3
  wrapperStyle: ComputedRef<Record<string, any>>;
4
4
  getWrapperClass: ComputedRef<string[]>;
5
5
  getInnerWrapperClass: ComputedRef<string[]>;
@@ -1,22 +1,22 @@
1
- import { computed as o } from "vue";
2
- import { getHexWithOpacity as u } from "../utils/getFileInfo.mjs";
1
+ import { computed as a } from "vue";
2
+ import { getHexWithOpacity as m } from "../utils/getFileInfo.mjs";
3
3
  import "../../config-provider/index.mjs";
4
4
  import { useNamespace as d } from "../../config-provider/hooks/use-namespace.mjs";
5
5
  import { useGlobalConfig as c } from "../../config-provider/hooks/use-global-config.mjs";
6
- function h(p, n, t) {
7
- const { b: a, bm: r } = d("ap-download"), i = c("uiMode"), s = o(() => ({
8
- "--download-main-color": p,
9
- "--download-main-color-opacity": u(p, 0.6)
10
- })), l = o(() => [a("wrapper"), r("wrapper", n)].filter(Boolean)), m = o(() => {
11
- const e = [a("inner-wrapper"), r("inner-wrapper", n)];
12
- return t && (i.value === "aplus" ? e.push(r("inner-wrapper", "disabled")) : e.push(r("inner-wrapper", "disabled-admin"))), e;
6
+ function y(o, p, t) {
7
+ const { b: n, bm: e } = d("ap-download"), i = c("uiMode"), l = a(() => ({
8
+ "--download-main-color": o.value,
9
+ "--download-main-color-opacity": m(o.value, 0.6)
10
+ })), s = a(() => [n("wrapper"), e("wrapper", p.value)].filter(Boolean)), u = a(() => {
11
+ const r = [n("inner-wrapper"), e("inner-wrapper", p.value)];
12
+ return t.value && (i.value === "aplus" ? r.push(e("inner-wrapper", "disabled")) : r.push(e("inner-wrapper", "disabled-admin"))), r;
13
13
  });
14
14
  return {
15
- wrapperStyle: s,
16
- getWrapperClass: l,
17
- getInnerWrapperClass: m
15
+ wrapperStyle: l,
16
+ getWrapperClass: s,
17
+ getInnerWrapperClass: u
18
18
  };
19
19
  }
20
20
  export {
21
- h as useStyle
21
+ y as useStyle
22
22
  };
@@ -1,10 +1,10 @@
1
- import { defineComponent as d, openBlock as f, createElementBlock as v, normalizeClass as g, unref as t, createVNode as a, mergeProps as C } from "vue";
1
+ import { defineComponent as f, openBlock as g, createElementBlock as C, normalizeClass as h, unref as t, createVNode as u, mergeProps as B } from "vue";
2
2
  import "../../config-provider/index.mjs";
3
- import { Form as h, InputNumber as B, RadioGroup as I } from "ant-design-vue";
4
- import { omit as b } from "lodash-unified";
3
+ import { Form as I, InputNumber as b, RadioGroup as _ } from "ant-design-vue";
4
+ import { omit as x } from "lodash-unified";
5
5
  import "./style.css";
6
- import { useNamespace as _ } from "../../config-provider/hooks/use-namespace.mjs";
7
- const A = /* @__PURE__ */ d({
6
+ import { useNamespace as y } from "../../config-provider/hooks/use-namespace.mjs";
7
+ const G = /* @__PURE__ */ f({
8
8
  name: "ApInputRadio",
9
9
  __name: "ApInputRadio",
10
10
  props: {
@@ -29,31 +29,34 @@ const A = /* @__PURE__ */ d({
29
29
  options: {}
30
30
  },
31
31
  emits: ["update:value"],
32
- setup(r, { emit: u }) {
33
- const p = h.useInjectFormItemContext(), o = r, { b: l, e: s } = _("ap-input-radio"), i = u, n = (e) => {
34
- i("update:value", { ...o.value, ...e }), p.onFieldChange();
35
- }, m = (e) => {
36
- n({ inputval: e });
37
- }, c = (e) => {
38
- n({ radioVal: e.target.value });
32
+ setup(p, { emit: l }) {
33
+ const s = I.useInjectFormItemContext(), e = p, { b: i, e: m } = y("ap-input-radio"), c = l, n = (o) => {
34
+ c("update:value", { ...e.value, ...o }), s.onFieldChange();
35
+ }, d = (o) => {
36
+ n({ inputval: o });
37
+ }, v = (o) => {
38
+ n({ radioVal: o.target.value });
39
+ };
40
+ return (o, F) => {
41
+ var a, r;
42
+ return g(), C("div", {
43
+ class: h([t(i)()])
44
+ }, [
45
+ u(t(b), B({
46
+ class: t(m)("input-number")
47
+ }, t(x)(e, ["value", "options"]), {
48
+ value: e.value ? (a = e.value) == null ? void 0 : a.inputval : "",
49
+ onChange: d
50
+ }), null, 16, ["class", "value"]),
51
+ u(t(_), {
52
+ value: e.value ? (r = e.value) == null ? void 0 : r.radioVal : "",
53
+ options: e.options,
54
+ onChange: v
55
+ }, null, 8, ["value", "options"])
56
+ ], 2);
39
57
  };
40
- return (e, x) => (f(), v("div", {
41
- class: g([t(l)()])
42
- }, [
43
- a(t(B), C({
44
- class: t(s)("input-number")
45
- }, t(b)(o, ["value", "options"]), {
46
- value: o.value.inputval,
47
- onChange: m
48
- }), null, 16, ["class", "value"]),
49
- a(t(I), {
50
- value: o.value.radioVal,
51
- options: o.options,
52
- onChange: c
53
- }, null, 8, ["value", "options"])
54
- ], 2));
55
58
  }
56
59
  });
57
60
  export {
58
- A as default
61
+ G as default
59
62
  };
@@ -2,7 +2,7 @@ import { InputNumberProps } from 'ant-design-vue/es/input-number';
2
2
  type ApInputProps = Pick<InputNumberProps, 'disabled' | 'stringMode' | 'precision' | 'max' | 'min' | 'step' | 'bordered' | 'autofocus' | 'decimalSeparator' | 'controls' | 'formatter' | 'onInput' | 'onChange' | 'onPressEnter' | 'onStep' | 'onBlur' | 'onFocus'>;
3
3
  type ApInputValyeName = 'inputval' | 'radioVal';
4
4
  export type ApInputValType = {
5
- value: Record<ApInputValyeName, string | number>;
5
+ value?: Record<ApInputValyeName, string | number>;
6
6
  };
7
7
  export type ApInputRadioOptions = Array<{
8
8
  value: string | number;
@@ -9,6 +9,9 @@
9
9
  flex-direction: row;
10
10
  align-items: center;
11
11
  }
12
+ .aplus-ap-label__custom {
13
+ margin-top: 2px;
14
+ }
12
15
  .aplus-ap-label__custom .ant-tag {
13
16
  height: 24px;
14
17
  line-height: 24px;
@@ -1,8 +1,8 @@
1
- import { defineComponent as p, computed as d, openBlock as a, createElementBlock as r, normalizeClass as c, unref as i, normalizeStyle as o, Fragment as m, renderList as f, createBlock as g, createCommentVNode as y } from "vue";
1
+ import { defineComponent as p, computed as c, openBlock as r, createElementBlock as o, normalizeClass as d, unref as m, normalizeStyle as a, Fragment as i, renderList as f, createBlock as y, createCommentVNode as _ } from "vue";
2
2
  import "../../config-provider/index.mjs";
3
3
  import "./ApStatus.vue.mjs";
4
- import { useNamespace as _ } from "../../config-provider/hooks/use-namespace.mjs";
5
- import x from "./ApStatus.vue2.mjs";
4
+ import { useNamespace as g } from "../../config-provider/hooks/use-namespace.mjs";
5
+ import k from "./ApStatus.vue2.mjs";
6
6
  const w = /* @__PURE__ */ p({
7
7
  name: "ApStatusGroup",
8
8
  __name: "ApStatusGroup",
@@ -14,25 +14,23 @@ const w = /* @__PURE__ */ p({
14
14
  show: { type: Boolean, default: !0 }
15
15
  },
16
16
  setup(s) {
17
- const t = s, l = d(() => ({
18
- "padding-left": t.padding + "px",
19
- "padding-right": t.padding + "px",
17
+ const t = s, u = c(() => ({
20
18
  ...t.style
21
- })), { b: n } = _("ap-status-group");
22
- return (u, h) => t.statusList ? (a(), r("div", {
19
+ })), { b: l } = g("ap-status-group");
20
+ return (n, S) => t.statusList ? (r(), o("div", {
23
21
  key: 0,
24
- class: c([i(n)()]),
25
- style: o(l.value)
22
+ class: d([m(l)()]),
23
+ style: a(u.value)
26
24
  }, [
27
- (a(!0), r(m, null, f(t.statusList, (e) => (a(), g(x, {
25
+ (r(!0), o(i, null, f(t.statusList, (e) => (r(), y(k, {
28
26
  key: e.value,
29
- show: e.value === u.currentValue,
27
+ show: e.value === n.currentValue,
30
28
  color: e.color,
31
29
  text: e.text,
32
30
  padding: t.padding,
33
- style: o(t.style)
31
+ style: a(t.style)
34
32
  }, null, 8, ["show", "color", "text", "padding", "style"]))), 128))
35
- ], 6)) : y("", !0);
33
+ ], 6)) : _("", !0);
36
34
  }
37
35
  });
38
36
  export {
@@ -1095,7 +1095,6 @@ export declare const ApInputRadio: DefineComponent<{
1095
1095
  };
1096
1096
  value: {
1097
1097
  type: PropType<Record<"inputval" | "radioVal", string | number>>;
1098
- required: true;
1099
1098
  };
1100
1099
  options: {
1101
1100
  type: PropType<ApInputRadioOptions>;
@@ -1166,7 +1165,6 @@ export declare const ApInputRadio: DefineComponent<{
1166
1165
  };
1167
1166
  value: {
1168
1167
  type: PropType<Record<"inputval" | "radioVal", string | number>>;
1169
- required: true;
1170
1168
  };
1171
1169
  options: {
1172
1170
  type: PropType<ApInputRadioOptions>;
@@ -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,16 @@
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 W, useSlots as $, ref as v, watch as w, unref as l, openBlock as R, createBlock as G, withCtx as c, createVNode as b, mergeProps as J, createSlots as Q, createElementBlock as X, Fragment as Y, createElementVNode as F, normalizeClass as Z, toDisplayString as ee, createCommentVNode as te, renderList as ae, renderSlot as ne, normalizeProps as oe, guardReactiveProps as le } from "vue";
2
+ import { Table as re } from "ant-design-vue";
3
+ import { ApForm as p } from "../ap-form/index.mjs";
4
+ import { isEqual as se, isArray as B, isNumber as h, cloneDeep as x, omit as ue } 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 g } from "../utils/index.mjs";
8
+ import { scrollToRowIndex as de, getColumnIsRequired as ie } from "./utils.mjs";
9
+ import me 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 { useNamespace as ce } from "../config-provider/hooks/use-namespace.mjs";
12
+ import { useControllableValue as fe } from "../hooks/useControllableValue.mjs";
13
+ const Ee = /* @__PURE__ */ W({
14
14
  name: "EditableTable",
15
15
  __name: "index",
16
16
  props: {
@@ -109,121 +109,131 @@ const Be = /* @__PURE__ */ M({
109
109
  onFieldChange: {}
110
110
  },
111
111
  emits: ["update:value"],
112
- setup(B, {
113
- expose: F,
114
- emit: D
112
+ setup(E, {
113
+ expose: N,
114
+ emit: V
115
115
  }) {
116
- const o = B, {
117
- b: _,
118
- em: N
119
- } = ie("editable-table"), k = U(), E = D, g = y(), {
116
+ const o = E, {
117
+ b: k,
118
+ em: D
119
+ } = ce("editable-table"), L = $(), _ = V, C = v(), {
120
120
  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);
121
+ updateValue: S
122
+ } = fe(o, _), u = v(), f = p.useWatch(o.name, u);
123
+ w(() => f.value, (e) => {
124
+ var t;
125
+ S(e), (t = o.onChange) == null || t.call(o, e);
126
+ }, {
127
+ deep: !0
128
+ }), w(s, (e) => {
129
+ var t;
130
+ e !== l(f) && (se(e, l(f)) || (t = u.value) == null || t.setFieldValue(o.name, e));
126
131
  }, {
127
132
  deep: !0
128
133
  });
129
- const V = de(o);
130
- function A() {
134
+ const A = me(o);
135
+ function T() {
131
136
  var e;
132
137
  (e = u.value) == null || e.resetFields();
133
138
  }
134
- function T(e) {
135
- return e ? (R(e) ? e : [e]).map((t) => R(t) ? [o.name, ...t] : [o.name, t]) : void 0;
139
+ function z(e) {
140
+ return e ? (B(e) ? e : [e]).map((a) => B(a) ? [o.name, ...a] : [o.name, a]) : void 0;
136
141
  }
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];
142
+ async function I(e, t) {
143
+ var n;
144
+ const a = await ((n = u.value) == null ? void 0 : n.validateFields(z(e), t));
145
+ return a == null ? void 0 : a[o.name];
141
146
  }
142
- function I(e, n) {
147
+ function P(e, t) {
143
148
  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
+ const a = ((r = l(s)) == null ? void 0 : r.length) || 0;
150
+ if (g(o.maxLength) && a >= o.maxLength)
146
151
  return;
147
- const a = [...l(s) || []];
148
- x(n) ? a.splice(n, 0, {
152
+ const n = [...l(s) || []];
153
+ g(t) ? n.splice(t, 0, {
149
154
  ...e || {}
150
- }) : a.push({
155
+ }) : n.push({
151
156
  ...e || {}
152
- }), (i = (d = u.value) == null ? void 0 : d.setFieldValue) == null || i.call(d, o.name, a);
157
+ }), (i = (d = u.value) == null ? void 0 : d.setFieldValue) == null || i.call(d, o.name, n);
153
158
  }
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)
159
+ function j(e, t = "suffix") {
160
+ var i, m, y;
161
+ const a = ((i = l(s)) == null ? void 0 : i.length) || 0, n = h(e) ? e : e.length;
162
+ if (g(o.maxLength) && a + n > o.maxLength)
158
163
  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);
164
+ const r = [...l(s) || []], d = h(e) ? new Array(e).fill({}) : x(e);
165
+ t === "suffix" ? r.push(...d) : r.unshift(...d), (y = (m = u.value) == null ? void 0 : m.setFieldValue) == null || y.call(m, o.name, r);
161
166
  }
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);
167
+ function O(e) {
168
+ var n, r;
169
+ let t = x(l(s) || []);
170
+ const a = h(e) ? [e] : e;
171
+ t = t.filter((d, i) => !a.includes(i)), (r = (n = u.value) == null ? void 0 : n.setFieldValue) == null || r.call(n, o.name, t);
167
172
  }
168
- function O() {
173
+ function q() {
169
174
  return l(s);
170
175
  }
171
176
  function K(e) {
172
- var n;
173
- return (n = l(s)) == null ? void 0 : n[e];
177
+ var t;
178
+ return (t = l(s)) == null ? void 0 : t[e];
179
+ }
180
+ function H(e, t) {
181
+ var n, r;
182
+ const a = x(l(s));
183
+ a[e] && (a[e] = {
184
+ ...a[e],
185
+ ...t
186
+ }, (r = (n = u.value) == null ? void 0 : n.setFieldValue) == null || r.call(n, o.name, [...a]));
174
187
  }
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]));
188
+ function M(e, t) {
189
+ var n;
190
+ const a = e === "end" ? s.value.length - 1 : e;
191
+ de(a, (n = C.value) == null ? void 0 : n.$el, t);
182
192
  }
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);
193
+ function U() {
194
+ var e, t;
195
+ (t = (e = u.value) == null ? void 0 : e.setFieldValue) == null || t.call(e, o.name, []);
187
196
  }
188
- return F({
189
- resetFields: A,
190
- validateFields: z,
191
- add: I,
192
- remove: j,
197
+ return N({
198
+ resetFields: T,
199
+ validateFields: I,
200
+ add: P,
201
+ remove: O,
193
202
  getRowData: K,
194
- getRowsData: O,
195
- setRowData: q,
196
- addMultiple: P,
197
- scrollTo: H
198
- }), (e, n) => (w(), $(l(f), {
203
+ getRowsData: q,
204
+ setRowData: H,
205
+ addMultiple: j,
206
+ scrollTo: M,
207
+ clear: U
208
+ }), (e, t) => (R(), G(l(p), {
199
209
  "initial-values": {
200
210
  [o.name]: l(s)
201
211
  },
202
212
  ref_key: "formRef",
203
213
  ref: u
204
214
  }, {
205
- default: c(() => [v(l(f).FormItem, {
215
+ default: c(() => [b(l(p).FormItem, {
206
216
  name: e.name,
207
217
  "no-style": ""
208
218
  }, {
209
- default: c(() => [v(l(le), G(l(re)(o, ["name", "value", "onUpdate:value", "maxLength", "onChange"]), {
210
- class: l(_)(),
211
- columns: l(V),
219
+ default: c(() => [b(l(re), J(l(ue)(o, ["name", "value", "onUpdate:value", "maxLength", "onChange"]), {
220
+ class: l(k)(),
221
+ columns: l(A),
212
222
  "data-source": l(s),
213
223
  ref_key: "tableRef",
214
- ref: g
215
- }), J({
224
+ ref: C
225
+ }), Q({
216
226
  headerCell: c(({
217
- column: t
218
- }) => [l(ue)(t) ? (w(), Q(X, {
227
+ column: a
228
+ }) => [l(ie)(a) ? (R(), X(Y, {
219
229
  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)]),
230
+ }, [F("span", {
231
+ class: Z(l(D)("header-cell", "required"))
232
+ }, "*", 2), F("span", null, ee(a.title), 1)], 64)) : te("", !0)]),
223
233
  _: 2
224
- }, [te(k, (t, a) => ({
225
- name: a,
226
- fn: c((r) => [ae(e.$slots, a, ne(oe(r || {})))])
234
+ }, [ae(L, (a, n) => ({
235
+ name: n,
236
+ fn: c((r) => [ne(e.$slots, n, oe(le(r || {})))])
227
237
  }))]), 1040, ["class", "columns", "data-source"])]),
228
238
  _: 3
229
239
  }, 8, ["name"])]),
@@ -232,5 +242,5 @@ const Be = /* @__PURE__ */ M({
232
242
  }
233
243
  });
234
244
  export {
235
- Be as default
245
+ Ee as default
236
246
  };
@@ -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'>;
@@ -12,6 +12,9 @@ function P(u, t, e) {
12
12
  () => u[a],
13
13
  (l) => {
14
14
  r.value = l;
15
+ },
16
+ {
17
+ deep: !0
15
18
  }
16
19
  ), {
17
20
  value: r,
@@ -10,13 +10,6 @@
10
10
  .ant-form .ant-form-item-control .ant-form-item-explain-error {
11
11
  font-size: 12px;
12
12
  }
13
- .ant-form .ant-form-item-control .ant-radio-wrapper .ant-radio.ant-radio-checked .ant-radio-inner {
14
- background-color: #ffffff;
15
- border-color: #34b77c;
16
- }
17
- .ant-form .ant-form-item-control .ant-radio-wrapper .ant-radio.ant-radio-checked .ant-radio-inner::after {
18
- background-color: #34b77c;
19
- }
20
13
  .ant-form .ant-form-item-control .ant-select.ant-select-open .ant-select-selection-item {
21
14
  color: #bfbfbf;
22
15
  }
@@ -44,22 +37,22 @@
44
37
  input.ant-input[disabled] {
45
38
  color: #666666;
46
39
  }
47
- div[class$='-basic-table-form-container'] form[class$='-basic-form--compact'] {
40
+ div[class*='-basic-table-form-container'] form[class$='-basic-form--compact'] {
48
41
  padding: 16px;
49
42
  }
50
- div[class$='-basic-table-form-container'] form[class$='-basic-form--compact'] div.ant-col[tableaction] .ant-form-item-control-input-content {
43
+ div[class*='-basic-table-form-container'] form[class$='-basic-form--compact'] div.ant-col[tableaction] .ant-form-item-control-input-content {
51
44
  display: flex;
52
45
  align-items: center;
53
46
  justify-content: flex-end;
54
47
  }
55
- div[class$='-basic-table-form-container'] form[class$='-basic-form--compact'] div.ant-col[tableaction] .ant-form-item-control-input-content button.ant-btn-primary {
48
+ div[class*='-basic-table-form-container'] form[class$='-basic-form--compact'] div.ant-col[tableaction] .ant-form-item-control-input-content button.ant-btn-primary {
56
49
  order: 1;
57
50
  }
58
- div[class$='-basic-table-form-container'] form[class$='-basic-form--compact'] div.ant-col[tableaction] .ant-form-item-control-input-content button.ant-btn-default {
51
+ div[class*='-basic-table-form-container'] form[class$='-basic-form--compact'] div.ant-col[tableaction] .ant-form-item-control-input-content button.ant-btn-default {
59
52
  order: 2;
60
53
  margin-right: 0;
61
54
  }
62
- div[class$='-basic-table-form-container'] form[class$='-basic-form--compact'] div.ant-col[tableaction] .ant-form-item-control-input-content button.ant-btn-link {
55
+ div[class*='-basic-table-form-container'] form[class$='-basic-form--compact'] div.ant-col[tableaction] .ant-form-item-control-input-content button.ant-btn-link {
63
56
  order: 3;
64
57
  margin-left: 0.5rem;
65
58
  }