@aplus-frontend/ui 0.1.34 → 0.1.36

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 (63) hide show
  1. package/es/index.mjs +128 -126
  2. package/es/src/ap-button/ap-action-button.vue.d.ts +5 -0
  3. package/es/src/ap-button/ap-action-button.vue.mjs +8 -8
  4. package/es/src/ap-form/ap-form.vue2.mjs +93 -93
  5. package/es/src/ap-form/index.d.ts +3 -1
  6. package/es/src/ap-form/index.mjs +5 -1
  7. package/es/src/ap-form/interface.d.ts +4 -0
  8. package/es/src/ap-form/set/index.vue.d.ts +43 -0
  9. package/es/src/ap-form/set/index.vue.mjs +35 -0
  10. package/es/src/ap-form/set/index.vue2.mjs +4 -0
  11. package/es/src/ap-table/ap-table.vue.d.ts +1 -0
  12. package/es/src/ap-table/ap-table.vue.mjs +109 -107
  13. package/es/src/ap-table/components/setting/utils.d.ts +1 -1
  14. package/es/src/ap-table/components/setting/utils.mjs +12 -21
  15. package/es/src/ap-table/components/style/setting/modal.css +15 -3
  16. package/es/src/ap-table/interface.d.ts +5 -0
  17. package/es/src/ap-table/utils.mjs +6 -5
  18. package/es/src/ap-upload/apUpload.vue.d.ts +2 -0
  19. package/es/src/ap-upload/apUpload.vue.mjs +42 -39
  20. package/es/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +1 -1
  21. package/es/src/business/ap-table-modal/hooks/use-create-table-modal.mjs +11 -11
  22. package/es/src/business/hooks/usePageListApTable.d.ts +1 -0
  23. package/es/src/editable-table/form-item.vue.mjs +76 -97
  24. package/es/src/editable-table/hooks/use-get-columns.mjs +41 -35
  25. package/es/src/editable-table/index.vue.mjs +79 -100
  26. package/es/src/editable-table/style/index.css +12 -0
  27. package/es/src/editable-table/utils.d.ts +8 -1
  28. package/es/src/editable-table/utils.mjs +103 -69
  29. package/es/src/index.mjs +105 -103
  30. package/es/src/theme/ap-table/setting/modal.css +15 -3
  31. package/es/src/theme/editable-table/index.css +12 -0
  32. package/lib/index.js +1 -1
  33. package/lib/src/ap-button/ap-action-button.vue.d.ts +5 -0
  34. package/lib/src/ap-button/ap-action-button.vue.js +1 -1
  35. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  36. package/lib/src/ap-form/index.d.ts +3 -1
  37. package/lib/src/ap-form/index.js +1 -1
  38. package/lib/src/ap-form/interface.d.ts +4 -0
  39. package/lib/src/ap-form/set/index.vue.d.ts +43 -0
  40. package/lib/src/ap-form/set/index.vue.js +1 -0
  41. package/lib/src/ap-form/set/index.vue2.js +1 -0
  42. package/lib/src/ap-table/ap-table.vue.d.ts +1 -0
  43. package/lib/src/ap-table/ap-table.vue.js +1 -1
  44. package/lib/src/ap-table/components/setting/utils.d.ts +1 -1
  45. package/lib/src/ap-table/components/setting/utils.js +1 -1
  46. package/lib/src/ap-table/components/style/setting/modal.css +15 -3
  47. package/lib/src/ap-table/interface.d.ts +5 -0
  48. package/lib/src/ap-table/utils.js +1 -1
  49. package/lib/src/ap-upload/apUpload.vue.d.ts +2 -0
  50. package/lib/src/ap-upload/apUpload.vue.js +1 -1
  51. package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +1 -1
  52. package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.js +1 -1
  53. package/lib/src/business/hooks/usePageListApTable.d.ts +1 -0
  54. package/lib/src/editable-table/form-item.vue.js +1 -1
  55. package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
  56. package/lib/src/editable-table/index.vue.js +1 -1
  57. package/lib/src/editable-table/style/index.css +12 -0
  58. package/lib/src/editable-table/utils.d.ts +8 -1
  59. package/lib/src/editable-table/utils.js +1 -1
  60. package/lib/src/index.js +1 -1
  61. package/lib/src/theme/ap-table/setting/modal.css +15 -3
  62. package/lib/src/theme/editable-table/index.css +12 -0
  63. package/package.json +2 -2
@@ -334,6 +334,11 @@ export type ApTableExpose<SearchParamsType = Recordable, RecordType = any> = {
334
334
  * 查询表单重置
335
335
  */
336
336
  reset: () => void;
337
+ /**
338
+ * 刷新表格数据
339
+ * @returns
340
+ */
341
+ refresh: () => void;
337
342
  /**
338
343
  * 设置查询表单的值
339
344
  * @param fields
@@ -1,5 +1,5 @@
1
1
  import { isVNode as m, createVNode as u, mergeProps as f, cloneVNode as T, Fragment as b } from "vue";
2
- import { isObject as c, isArray as p, isUndefined as y, isFunction as g, omit as h, isBoolean as j, isString as a } from "lodash-unified";
2
+ import { isObject as c, isArray as p, isUndefined as h, isFunction as y, omit as g, isBoolean as j, isString as a } from "lodash-unified";
3
3
  import { apTableRenderItemMap as F, apTableFormItemMap as O } from "./constants.mjs";
4
4
  import { isType as E } from "@fruits-chain/utils";
5
5
  import "../ap-form/index.mjs";
@@ -63,7 +63,7 @@ const V = (t) => P(t) === "map" ? t : new Map(Object.entries(t || {})), d = (t)
63
63
  });
64
64
  }
65
65
  }), e;
66
- }, L = (t) => y(t) || t < 0 ? 0 : t, Q = (t, e, n) => {
66
+ }, L = (t) => h(t) || t < 0 ? 0 : t, Q = (t, e, n) => {
67
67
  if (n)
68
68
  return n;
69
69
  const r = ["select", "date"], o = ["text", "textArea", "number"];
@@ -75,7 +75,7 @@ const V = (t) => P(t) === "map" ? t : new Map(Object.entries(t || {})), d = (t)
75
75
  return t("ap.common.inputText");
76
76
  };
77
77
  function w(t, e) {
78
- return !t || !g(t) ? t : t(e);
78
+ return !t || !y(t) ? t : t(e);
79
79
  }
80
80
  function U(t) {
81
81
  let e = t.valueType || "text";
@@ -122,7 +122,7 @@ function K(t, e) {
122
122
  value: i ? e.index + 1 : e.value
123
123
  };
124
124
  return t.valueEnum && (r.valueEnum = t.valueEnum), {
125
- ...h(r, ["request"]),
125
+ ...g(r, ["request"]),
126
126
  ...s
127
127
  };
128
128
  }
@@ -163,7 +163,8 @@ function k(t, e, n, r) {
163
163
  return l ? u("span", {
164
164
  style: {
165
165
  display: "inline-flex",
166
- alignItems: "center"
166
+ alignItems: "center",
167
+ maxWidth: "100%"
167
168
  }
168
169
  }, [s, u(x, {
169
170
  title: l,
@@ -43,6 +43,7 @@ declare const _default: DefineComponent<{
43
43
  getOssAccess: {
44
44
  type: PropType<GetOssAccess>;
45
45
  };
46
+ onChange: FunctionConstructor;
46
47
  }, {
47
48
  done: ComputedRef<boolean>;
48
49
  clear: typeof clear;
@@ -89,6 +90,7 @@ declare const _default: DefineComponent<{
89
90
  getOssAccess: {
90
91
  type: PropType<GetOssAccess>;
91
92
  };
93
+ onChange: FunctionConstructor;
92
94
  }>> & {
93
95
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
94
96
  }, {
@@ -1,18 +1,19 @@
1
- import { defineComponent as F, computed as c, provide as e, ref as u, openBlock as d, createElementBlock as U, normalizeClass as T, unref as j, createBlock as z, resolveDynamicComponent as h, normalizeProps as k, mergeProps as B, createCommentVNode as $ } from "vue";
1
+ import { defineComponent as U, computed as d, provide as t, ref as f, openBlock as g, createElementBlock as j, normalizeClass as T, unref as z, createBlock as k, resolveDynamicComponent as B, normalizeProps as $, mergeProps as q, createCommentVNode as L } from "vue";
2
2
  import "../config-provider/index.mjs";
3
3
  import "./components/SingleFile.vue.mjs";
4
4
  import "./components/MultipleFile.vue.mjs";
5
5
  import "./components/Picture.vue.mjs";
6
6
  import "./styles/upload.css";
7
- import { injectLocaleToAccept as q } from "./utils/accept.mjs";
8
- import { injectLocaleToOss as L } from "./hooks/useOss.mjs";
9
- import { useLocale as R } from "../config-provider/hooks/use-locale.mjs";
10
- import { useNamespace as M } from "../config-provider/hooks/use-namespace.mjs";
11
- import P from "./components/SingleFile.vue2.mjs";
12
- import w from "./components/MultipleFile.vue2.mjs";
13
- import D from "./components/Picture.vue2.mjs";
14
- import { useGlobalConfig as f } from "../config-provider/hooks/use-global-config.mjs";
15
- const ae = /* @__PURE__ */ F({
7
+ import { injectLocaleToAccept as R } from "./utils/accept.mjs";
8
+ import { injectLocaleToOss as M } from "./hooks/useOss.mjs";
9
+ import { Form as P } from "ant-design-vue";
10
+ import { useLocale as w } from "../config-provider/hooks/use-locale.mjs";
11
+ import { useNamespace as D } from "../config-provider/hooks/use-namespace.mjs";
12
+ import E from "./components/SingleFile.vue2.mjs";
13
+ import G from "./components/MultipleFile.vue2.mjs";
14
+ import I from "./components/Picture.vue2.mjs";
15
+ import { useGlobalConfig as v } from "../config-provider/hooks/use-global-config.mjs";
16
+ const me = /* @__PURE__ */ U({
16
17
  name: "AplusFileUpload",
17
18
  __name: "apUpload",
18
19
  props: {
@@ -55,50 +56,52 @@ const ae = /* @__PURE__ */ F({
55
56
  },
56
57
  getOssAccess: {
57
58
  type: Function
58
- }
59
+ },
60
+ onChange: Function
59
61
  },
60
62
  emits: ["update:value"],
61
- setup(g, { expose: v, emit: y }) {
62
- var r, i, m, l;
63
- const { t: s, lang: b } = R();
64
- q(s), L(s, b);
65
- const { b: N } = M("ap-upload"), t = g, C = y, _ = {
66
- singleFile: P,
67
- multipleFile: w,
68
- picture: D
69
- }, S = c({
63
+ setup(y, { expose: C, emit: b }) {
64
+ var c, l, p, u;
65
+ const { t: r, lang: N } = w();
66
+ R(r), M(r, N);
67
+ const { b: _ } = D("ap-upload"), e = y, F = b, S = {
68
+ singleFile: E,
69
+ multipleFile: G,
70
+ picture: I
71
+ }, n = P.useInjectFormItemContext(), x = d({
70
72
  get() {
71
- return t.value;
73
+ return e.value;
72
74
  },
73
- set(n) {
74
- C("update:value", n);
75
+ set(a) {
76
+ var m;
77
+ F("update:value", a), n == null || n.onFieldChange(), (m = e.onChange) == null || m.call(e, a);
75
78
  }
76
- }), x = f("uiMode"), o = f("apUpload");
77
- e("theme", x.value), e("value", S), e("dirName", t.dirName ?? ((r = o.value) == null ? void 0 : r.dirName)), e(
79
+ }), O = v("uiMode"), o = v("apUpload");
80
+ t("theme", O.value), t("value", x), t("dirName", e.dirName ?? ((c = o.value) == null ? void 0 : c.dirName)), t(
78
81
  "needName",
79
- t.needName ?? ((i = o.value) == null ? void 0 : i.needName) ?? !1
80
- ), e("accept", t.accept ?? ((m = o.value) == null ? void 0 : m.accept) ?? ""), e("maxSize", t.maxSize), e("title", t.title), e("subTitle", t.subTitle), e("maxCount", t.maxCount), e("beforeUpload", t.beforeUpload), e("customRequest", t.customRequest), e(
82
+ e.needName ?? ((l = o.value) == null ? void 0 : l.needName) ?? !1
83
+ ), t("accept", e.accept ?? ((p = o.value) == null ? void 0 : p.accept) ?? ""), t("maxSize", e.maxSize), t("title", e.title), t("subTitle", e.subTitle), t("maxCount", e.maxCount), t("beforeUpload", e.beforeUpload), t("customRequest", e.customRequest), t(
81
84
  "getOssAccess",
82
- t.getOssAccess ?? ((l = o.value) == null ? void 0 : l.getOssAccess)
85
+ e.getOssAccess ?? ((u = o.value) == null ? void 0 : u.getOssAccess)
83
86
  );
84
- const O = c(() => p.value === 0), p = u(0);
85
- e("uploadingCount", p);
86
- const a = u(!0);
87
+ const h = d(() => s.value === 0), s = f(0);
88
+ t("uploadingCount", s);
89
+ const i = f(!0);
87
90
  function A() {
88
- a.value = !1, setTimeout(() => {
89
- a.value = !0;
91
+ i.value = !1, setTimeout(() => {
92
+ i.value = !0;
90
93
  });
91
94
  }
92
- return v({
93
- done: O,
95
+ return C({
96
+ done: h,
94
97
  clear: A
95
- }), (n, E) => (d(), U("div", {
96
- class: T(j(N)())
98
+ }), (a, m) => (g(), j("div", {
99
+ class: T(z(_)())
97
100
  }, [
98
- a.value ? (d(), z(h(_[t.type]), k(B({ key: 0 }, n.$attrs)), null, 16)) : $("", !0)
101
+ i.value ? (g(), k(B(S[e.type]), $(q({ key: 0 }, a.$attrs)), null, 16)) : L("", !0)
99
102
  ], 2));
100
103
  }
101
104
  });
102
105
  export {
103
- ae as default
106
+ me as default
104
107
  };
@@ -3,5 +3,5 @@ export declare function useCreateTableModal(props: UseCreateTableModalProps): {
3
3
  readonly openModal: <T>(selected?: any[], options?: OpenOptions) => Promise< OpenReturnType<T> | undefined>;
4
4
  readonly closeModal: () => void;
5
5
  readonly destroy: () => void;
6
- readonly isDestroyed: false;
6
+ readonly isDestroyed: true;
7
7
  };
@@ -1,12 +1,12 @@
1
- import { ref as v, defineComponent as C, h as r, render as m, onUnmounted as y } from "vue";
1
+ import { ref as v, defineComponent as C, h as r, render as a, onUnmounted as y } from "vue";
2
2
  import "../table-modal.vue.mjs";
3
3
  import "../../../index.mjs";
4
4
  import { omit as h } from "lodash-unified";
5
5
  import { ConfigProvider as M, globalConfigCached as b } from "../../../config-provider/config-provider.mjs";
6
6
  import g from "../table-modal.vue2.mjs";
7
7
  function E(d) {
8
- let o = !1;
9
- const l = document.body, t = v(), { destroyOnUnmounted: s = !0 } = d, n = document.createElement("div"), c = () => {
8
+ let o = !0;
9
+ const i = document.body, t = v(), { destroyOnUnmounted: s = !0 } = d, n = document.createElement("div"), u = () => {
10
10
  const e = C({
11
11
  setup() {
12
12
  return () => r(
@@ -19,22 +19,22 @@ function E(d) {
19
19
  );
20
20
  }
21
21
  });
22
- l.appendChild(n), m(r(e), n), o = !1;
23
- }, i = () => {
22
+ i.appendChild(n), a(r(e), n), o = !1;
23
+ }, l = () => {
24
24
  var e;
25
25
  (e = t.value) == null || e.close(), o || setTimeout(() => {
26
- m(null, n), l.removeChild(n), o = !0;
26
+ a(null, n), i.removeChild(n), o = !0;
27
27
  }, 400);
28
- }, u = async (e = [], p = {}) => {
29
- var a;
30
- return t.value || c(), (a = t.value) == null ? void 0 : a.open(e, p);
28
+ }, c = async (e = [], p = {}) => {
29
+ var m;
30
+ return t.value || u(), (m = t.value) == null ? void 0 : m.open(e, p);
31
31
  }, f = () => {
32
32
  var e;
33
33
  o || (e = t.value) == null || e.close();
34
34
  };
35
35
  return y(() => {
36
- s && i();
37
- }), { openModal: u, closeModal: f, destroy: i, isDestroyed: o };
36
+ s && l();
37
+ }), { openModal: c, closeModal: f, destroy: l, isDestroyed: o };
38
38
  }
39
39
  export {
40
40
  E as useCreateTableModal
@@ -34,6 +34,7 @@ export declare function usePageListApTable(props?: UsePageListApTable): [ApTable
34
34
  getApTableInstance: () => {
35
35
  submit: () => void;
36
36
  reset: () => void;
37
+ refresh: () => void;
37
38
  setSearchFormValues: (fields: Partial< Recordable>) => void;
38
39
  getSearchFormValues: () => Partial< Recordable>;
39
40
  dataSource: any;
@@ -1,18 +1,16 @@
1
- import { defineComponent as q, ref as x, unref as l, useSlots as G, watch as H, openBlock as m, createBlock as y, mergeProps as C, withCtx as d, createVNode as b, createSlots as W, createElementBlock as $, normalizeClass as Q, createCommentVNode as w, createElementVNode as U, toDisplayString as I, normalizeStyle as J, renderList as X, renderSlot as Y, normalizeProps as Z, guardReactiveProps as ee } from "vue";
2
- import { Table as te, Tooltip as oe } from "ant-design-vue";
3
- import { ApForm as R } from "../ap-form/index.mjs";
4
- import { isArray as ae, isNumber as i, cloneDeep as f, omit as le } from "lodash-unified";
1
+ import { defineComponent as P, ref as h, unref as l, useSlots as z, watch as O, openBlock as K, createBlock as M, mergeProps as x, withCtx as g, createVNode as G, createSlots as H, renderList as W, renderSlot as $, normalizeProps as U, guardReactiveProps as q } from "vue";
2
+ import { Table as J } from "ant-design-vue";
3
+ import { ApForm as b } from "../ap-form/index.mjs";
4
+ import { isArray as Q, isNumber as d, cloneDeep as f, omit as w } from "lodash-unified";
5
5
  import "../config-provider/index.mjs";
6
- import { useInjectForm as ne } from "../ap-form/context.mjs";
6
+ import { useInjectForm as X } from "../ap-form/context.mjs";
7
7
  import "./style/index.css";
8
- import { isDef as p } from "../utils/index.mjs";
9
- import re from "./hooks/use-get-columns.mjs";
10
- import { scrollToRowIndex as ue, getColumnIsRequired as se } from "./utils.mjs";
11
- import { QuestionCircleOutlined as de } from "@ant-design/icons-vue";
12
- import { useToken as me } from "ant-design-vue/es/theme/internal";
13
- import { useNamespace as ie } from "../config-provider/hooks/use-namespace.mjs";
14
- import { useGlobalConfig as fe } from "../config-provider/hooks/use-global-config.mjs";
15
- const Fe = /* @__PURE__ */ q({
8
+ import { isDef as m } from "../utils/index.mjs";
9
+ import Y from "./hooks/use-get-columns.mjs";
10
+ import { scrollToRowIndex as Z } from "./utils.mjs";
11
+ import { useNamespace as I } from "../config-provider/hooks/use-namespace.mjs";
12
+ import { useGlobalConfig as ee } from "../config-provider/hooks/use-global-config.mjs";
13
+ const ce = /* @__PURE__ */ P({
16
14
  name: "EditableTableInner",
17
15
  __name: "form-item",
18
16
  props: {
@@ -112,121 +110,102 @@ const Fe = /* @__PURE__ */ q({
112
110
  default: () => ({})
113
111
  }
114
112
  },
115
- setup(B, {
116
- expose: D
113
+ setup(C, {
114
+ expose: y
117
115
  }) {
118
- const n = B;
119
- function k(e, t) {
120
- return ae(t) ? t.reduce((o, a) => o == null ? void 0 : o[a], e) : e == null ? void 0 : e[t];
116
+ const a = C;
117
+ function R(e, o) {
118
+ return Q(o) ? o.reduce((r, t) => r == null ? void 0 : r[t], e) : e == null ? void 0 : e[o];
121
119
  }
122
120
  const {
123
- internalInstance: r,
124
- model: T
125
- } = ne(), u = x(k(l(T), n.name) || []), F = G(), L = R.useWatch(n.name);
126
- H(() => L.value, (e) => {
127
- var t;
128
- u.value = e, (t = n.onChange) == null || t.call(n, e);
121
+ internalInstance: n,
122
+ model: B
123
+ } = X(), u = h(R(l(B), a.name) || []), D = z(), F = b.useWatch(a.name);
124
+ O(() => F.value, (e) => {
125
+ var o;
126
+ u.value = e, (o = a.onChange) == null || o.call(a, e);
129
127
  }, {
130
128
  deep: !0
131
129
  });
132
130
  const {
133
- b: E,
134
- em: N
135
- } = ie("editable-table"), c = x(), S = fe("valueTypeMap"), [, V] = me(), _ = re(n, S);
136
- function v(e, t) {
131
+ b: L
132
+ } = I("editable-table"), i = h(), T = ee("valueTypeMap"), v = Y(a, T);
133
+ function E(e, o) {
137
134
  var s;
138
- const o = ((s = l(u)) == null ? void 0 : s.length) || 0;
139
- if (p(n.maxLength) && o >= n.maxLength)
135
+ const r = ((s = l(u)) == null ? void 0 : s.length) || 0;
136
+ if (m(a.maxLength) && r >= a.maxLength)
140
137
  return;
141
- const a = [...l(u) || []];
142
- p(t) ? a.splice(t, 0, {
138
+ const t = [...l(u) || []];
139
+ m(o) ? t.splice(o, 0, {
143
140
  ...e || {}
144
- }) : a.push({
141
+ }) : t.push({
145
142
  ...e || {}
146
- }), r == null || r.setFieldValue(n.name, a);
143
+ }), n == null || n.setFieldValue(a.name, t);
147
144
  }
148
- function z(e, t = "suffix") {
149
- var g;
150
- const o = ((g = l(u)) == null ? void 0 : g.length) || 0, a = i(e) ? e : e.length;
151
- if (p(n.maxLength) && o + a > n.maxLength)
145
+ function N(e, o = "suffix") {
146
+ var p;
147
+ const r = ((p = l(u)) == null ? void 0 : p.length) || 0, t = d(e) ? e : e.length;
148
+ if (m(a.maxLength) && r + t > a.maxLength)
152
149
  return;
153
- const s = [...l(u) || []], h = i(e) ? new Array(e).fill({}) : f(e);
154
- t === "suffix" ? s.push(...h) : s.unshift(...h), r == null || r.setFieldValue(n.name, s);
150
+ const s = [...l(u) || []], c = d(e) ? new Array(e).fill({}) : f(e);
151
+ o === "suffix" ? s.push(...c) : s.unshift(...c), n == null || n.setFieldValue(a.name, s);
155
152
  }
156
- function P(e) {
157
- let t = f(l(u) || []);
158
- const o = i(e) ? [e] : e;
159
- t = t.filter((a, s) => !o.includes(s)), r == null || r.setFieldValue(n.name, t);
153
+ function S(e) {
154
+ let o = f(l(u) || []);
155
+ const r = d(e) ? [e] : e;
156
+ o = o.filter((t, s) => !r.includes(s)), n == null || n.setFieldValue(a.name, o);
160
157
  }
161
- function j() {
158
+ function V() {
162
159
  return l(u);
163
160
  }
164
- function A(e) {
165
- var t;
166
- return (t = l(u)) == null ? void 0 : t[e];
161
+ function _(e) {
162
+ var o;
163
+ return (o = l(u)) == null ? void 0 : o[e];
167
164
  }
168
- function O(e, t, o = !0) {
169
- const a = f(l(u));
170
- a[e] && (a[e] = {
171
- ...o ? a[e] : {},
172
- ...t
173
- }, r == null || r.setFieldValue(n.name, [...a]));
165
+ function k(e, o, r = !0) {
166
+ const t = f(l(u));
167
+ t[e] && (t[e] = {
168
+ ...r ? t[e] : {},
169
+ ...o
170
+ }, n == null || n.setFieldValue(a.name, [...t]));
174
171
  }
175
- function K(e) {
176
- r == null || r.setFieldValue(n.name, e);
172
+ function j(e) {
173
+ n == null || n.setFieldValue(a.name, e);
177
174
  }
178
- function M(e, t) {
179
- var a;
180
- const o = e === "end" ? u.value.length - 1 : e;
181
- ue(o, (a = c.value) == null ? void 0 : a.$el, t);
175
+ function A(e, o) {
176
+ var t;
177
+ const r = e === "end" ? u.value.length - 1 : e;
178
+ Z(r, (t = i.value) == null ? void 0 : t.$el, o);
182
179
  }
183
- return D({
184
- add: v,
185
- remove: P,
186
- getRowData: A,
187
- getRowsData: j,
188
- setRowData: O,
189
- addMultiple: z,
190
- scrollTo: M,
191
- setTableData: K
192
- }), (e, t) => (m(), y(l(R).FormItem, C(e.formItem, {
180
+ return y({
181
+ add: E,
182
+ remove: S,
183
+ getRowData: _,
184
+ getRowsData: V,
185
+ setRowData: k,
186
+ addMultiple: N,
187
+ scrollTo: A,
188
+ setTableData: j
189
+ }), (e, o) => (K(), M(l(b).FormItem, x(e.formItem, {
193
190
  name: e.name,
194
191
  label: e.label
195
192
  }), {
196
- default: d(() => [b(l(te), C(l(le)(n, ["name", "maxLength", "onChange"]), {
197
- class: l(E)(),
198
- columns: l(_),
193
+ default: g(() => [G(l(J), x(l(w)(a, ["name", "maxLength", "onChange"]), {
194
+ class: l(L)(),
195
+ columns: l(v),
199
196
  "data-source": u.value,
200
197
  ref_key: "tableRef",
201
- ref: c
202
- }), W({
203
- headerCell: d(({
204
- column: o
205
- }) => [l(se)(o) ? (m(), $("span", {
206
- key: 0,
207
- class: Q(l(N)("header-cell", "required"))
208
- }, "*", 2)) : w("", !0), U("span", null, I(o.title), 1), o.tooltip ? (m(), y(l(oe), {
209
- key: 1,
210
- title: o.tooltip,
211
- placement: "bottom"
212
- }, {
213
- default: d(() => [b(l(de), {
214
- style: J({
215
- paddingLeft: "4px",
216
- color: l(V).colorPrimary
217
- })
218
- }, null, 8, ["style"])]),
219
- _: 2
220
- }, 1032, ["title"])) : w("", !0)]),
198
+ ref: i
199
+ }), H({
221
200
  _: 2
222
- }, [X(F, (o, a) => ({
223
- name: a,
224
- fn: d((s) => [Y(e.$slots, a, Z(ee(s || {})))])
201
+ }, [W(l(w)(D, ["headerCell"]), (r, t) => ({
202
+ name: t,
203
+ fn: g((s) => [$(e.$slots, t, U(q(s || {})))])
225
204
  }))]), 1040, ["class", "columns", "data-source"])]),
226
205
  _: 3
227
206
  }, 16, ["name", "label"]));
228
207
  }
229
208
  });
230
209
  export {
231
- Fe as default
210
+ ce as default
232
211
  };
@@ -1,71 +1,77 @@
1
- import { computed as h, unref as I } from "vue";
2
- import { omit as R, isFunction as C, isArray as s } from "lodash-unified";
3
- import { mergeClass as y, getFinalNode as N } from "../utils.mjs";
4
- import { updateFormProps as T, getFieldProps as v, getPlaceholder as w, getTableRenderProps as A } from "../../ap-table/utils.mjs";
1
+ import { useSlots as y, computed as N, unref as m } from "vue";
2
+ import { omit as k, isFunction as v, isArray as f } from "lodash-unified";
3
+ import { getEditableTableTitle as w, mergeClass as A, getFinalNode as q } from "../utils.mjs";
4
+ import { updateFormProps as E, getFieldProps as G, getPlaceholder as L, getTableRenderProps as S } from "../../ap-table/utils.mjs";
5
5
  import "../../config-provider/index.mjs";
6
- import { useLocale as G } from "../../config-provider/hooks/use-locale.mjs";
7
- const D = (d, f) => {
6
+ import { useToken as U } from "ant-design-vue/es/theme/internal";
7
+ import { useLocale as $ } from "../../config-provider/hooks/use-locale.mjs";
8
+ import { useNamespace as j } from "../../config-provider/hooks/use-namespace.mjs";
9
+ const W = (a, b) => {
8
10
  const {
9
- t: x
10
- } = G();
11
- return h(() => {
12
- const t = d.columns;
13
- if (!t)
11
+ t: g
12
+ } = $(), {
13
+ em: h,
14
+ be: x
15
+ } = j("editable-table"), F = y(), [, I] = U();
16
+ return N(() => {
17
+ const d = a.columns;
18
+ if (!d)
14
19
  return [];
15
- function c(g) {
16
- return g.map((e) => ({
17
- ...R(e, ["ellipsis"]),
20
+ function c(R) {
21
+ return R.map((e) => ({
22
+ ...k(e, ["ellipsis"]),
18
23
  children: c(e.children || []),
24
+ title: w(e, x("table-header", "title"), h("header-cell", "required"), F.headerCell, m(I).colorPrimary),
19
25
  customRender({
20
- value: l,
26
+ value: o,
21
27
  ...n
22
28
  }) {
23
- const o = C(e.editable) ? e.editable(n.text, n.record, n.index) : !!e.editable;
29
+ const t = v(e.editable) ? e.editable(n.text, n.record, n.index) : !!e.editable;
24
30
  if (!e.valueType && !e.customRender && !e.customRenderFormItem)
25
31
  return console.warn("can not render table cell because no `valueType` / `customRender` / `customRenderFormItem`"), null;
26
32
  let r;
27
- if (o) {
28
- const a = T(e, v(e.fieldProps, {
29
- value: l,
33
+ if (t) {
34
+ const l = E(e, G(e.fieldProps, {
35
+ value: o,
30
36
  ...n
31
37
  })), i = {};
32
- d.onFieldChange && (i[`onUpdate:${a.valuePropName || "value"}`] = (b) => {
33
- var m;
34
- return (m = d.onFieldChange) == null ? void 0 : m.call(d, n.index, e.dataIndex, b);
38
+ a.onFieldChange && (i[`onUpdate:${l.valuePropName || "value"}`] = (T) => {
39
+ var s;
40
+ return (s = a.onFieldChange) == null ? void 0 : s.call(a, n.index, e.dataIndex, T);
35
41
  });
36
- const F = s(e.dataIndex) ? e.dataIndex : [e.dataIndex];
42
+ const C = f(e.dataIndex) ? e.dataIndex : [e.dataIndex];
37
43
  r = {
38
- name: [...s(d.name) ? d.name : [d.name], n.index, ...F],
39
- ...a || {},
44
+ name: [...f(a.name) ? a.name : [a.name], n.index, ...C],
45
+ ...l || {},
40
46
  // 格式化placeholder
41
- placeholder: w(x, e.valueType, a == null ? void 0 : a.placeholder),
47
+ placeholder: L(g, e.valueType, l == null ? void 0 : l.placeholder),
42
48
  field: {
43
49
  style: "width: 100%",
44
- ...(a == null ? void 0 : a.field) || {},
50
+ ...(l == null ? void 0 : l.field) || {},
45
51
  ...i,
46
- class: y("is-editable", a.class)
52
+ class: A("is-editable", l.class)
47
53
  }
48
54
  };
49
55
  } else
50
56
  r = {
51
- field: A(e, {
52
- value: l,
57
+ field: S(e, {
58
+ value: o,
53
59
  ...n
54
60
  })
55
61
  };
56
- const u = N(e, o, r, l, n.record, I(f));
62
+ const u = q(e, t, r, o, n.record, m(b));
57
63
  return e.customRender ? e.customRender({
58
- value: l,
64
+ value: o,
59
65
  ...n,
60
- editable: o,
66
+ editable: t,
61
67
  originalNode: u
62
68
  }) : u;
63
69
  }
64
70
  }));
65
71
  }
66
- return c(t);
72
+ return c(d);
67
73
  });
68
74
  };
69
75
  export {
70
- D as default
76
+ W as default
71
77
  };