@aplus-frontend/ui 0.1.22 → 0.1.24

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 (81) hide show
  1. package/es/index.mjs +66 -63
  2. package/es/src/ap-download/ap-download.vue.d.ts +0 -3
  3. package/es/src/ap-download/ap-download.vue.mjs +10 -10
  4. package/es/src/ap-field/number/index.vue.mjs +20 -19
  5. package/es/src/ap-form/ap-form-item.vue.mjs +27 -25
  6. package/es/src/ap-form/ap-form.vue.d.ts +1 -1
  7. package/es/src/ap-form/ap-form.vue2.mjs +18 -18
  8. package/es/src/ap-form/interface.d.ts +2 -2
  9. package/es/src/ap-form/modal-form/index.vue.d.ts +2 -2
  10. package/es/src/ap-form/search-form/index.vue.d.ts +2 -2
  11. package/es/src/ap-table/ap-table.vue.mjs +202 -198
  12. package/es/src/ap-table/interface.d.ts +1 -1
  13. package/es/src/ap-table/style/ap-table.css +3 -0
  14. package/es/src/ap-table/utils.mjs +1 -1
  15. package/es/src/business/ap-attachment/ApAttachment.d.ts +97 -0
  16. package/es/src/business/ap-attachment/ApAttachment.mjs +82 -0
  17. package/es/src/business/ap-attachment/constans.d.ts +44 -0
  18. package/es/src/business/ap-attachment/constans.mjs +42 -0
  19. package/es/src/business/ap-attachment/index.d.ts +3 -0
  20. package/es/src/business/ap-attachment/interface.d.ts +13 -0
  21. package/es/src/business/ap-attachment/style.css +62 -0
  22. package/es/src/business/ap-input-radio/ApInputRadio.vue.d.ts +2 -0
  23. package/es/src/business/ap-input-radio/ApInputRadio.vue2.mjs +25 -22
  24. package/es/src/business/ap-input-radio/interface.d.ts +8 -2
  25. package/es/src/business/ap-label/ApLabel.mjs +8 -7
  26. package/es/src/business/hooks/index.d.ts +1 -0
  27. package/es/src/business/hooks/index.mjs +4 -0
  28. package/es/src/business/hooks/usePageListApTable.d.ts +29 -0
  29. package/es/src/business/hooks/usePageListApTable.mjs +67 -0
  30. package/es/src/business/index.d.ts +123 -3
  31. package/es/src/business/index.mjs +29 -26
  32. package/es/src/editable-table/form-item.vue.mjs +80 -77
  33. package/es/src/editable-table/hooks/use-get-columns.mjs +64 -56
  34. package/es/src/editable-table/interface.d.ts +4 -4
  35. package/es/src/editable-table/utils.mjs +17 -17
  36. package/es/src/index.mjs +204 -201
  37. package/es/src/locale/lang/en.mjs +4 -0
  38. package/es/src/locale/lang/zh-cn.mjs +4 -0
  39. package/es/src/theme/ap-attachment/ap-attachment.css +62 -0
  40. package/es/src/theme/ap-table/ap-table.css +3 -0
  41. package/lib/index.js +1 -1
  42. package/lib/src/ap-download/ap-download.vue.d.ts +0 -3
  43. package/lib/src/ap-download/ap-download.vue.js +1 -1
  44. package/lib/src/ap-field/number/index.vue.js +1 -1
  45. package/lib/src/ap-form/ap-form-item.vue.js +1 -1
  46. package/lib/src/ap-form/ap-form.vue.d.ts +1 -1
  47. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  48. package/lib/src/ap-form/interface.d.ts +2 -2
  49. package/lib/src/ap-form/modal-form/index.vue.d.ts +2 -2
  50. package/lib/src/ap-form/search-form/index.vue.d.ts +2 -2
  51. package/lib/src/ap-table/ap-table.vue.js +1 -1
  52. package/lib/src/ap-table/interface.d.ts +1 -1
  53. package/lib/src/ap-table/style/ap-table.css +3 -0
  54. package/lib/src/ap-table/utils.js +1 -1
  55. package/lib/src/business/ap-attachment/ApAttachment.d.ts +97 -0
  56. package/lib/src/business/ap-attachment/ApAttachment.js +1 -0
  57. package/lib/src/business/ap-attachment/constans.d.ts +44 -0
  58. package/lib/src/business/ap-attachment/constans.js +1 -0
  59. package/lib/src/business/ap-attachment/index.d.ts +3 -0
  60. package/lib/src/business/ap-attachment/interface.d.ts +13 -0
  61. package/lib/src/business/ap-attachment/style.css +62 -0
  62. package/lib/src/business/ap-input-radio/ApInputRadio.vue.d.ts +2 -0
  63. package/lib/src/business/ap-input-radio/ApInputRadio.vue2.js +1 -1
  64. package/lib/src/business/ap-input-radio/interface.d.ts +8 -2
  65. package/lib/src/business/ap-label/ApLabel.js +1 -1
  66. package/lib/src/business/hooks/index.d.ts +1 -0
  67. package/lib/src/business/hooks/index.js +1 -0
  68. package/lib/src/business/hooks/usePageListApTable.d.ts +29 -0
  69. package/lib/src/business/hooks/usePageListApTable.js +1 -0
  70. package/lib/src/business/index.d.ts +123 -3
  71. package/lib/src/business/index.js +1 -1
  72. package/lib/src/editable-table/form-item.vue.js +1 -1
  73. package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
  74. package/lib/src/editable-table/interface.d.ts +4 -4
  75. package/lib/src/editable-table/utils.js +1 -1
  76. package/lib/src/index.js +1 -1
  77. package/lib/src/locale/lang/en.js +1 -1
  78. package/lib/src/locale/lang/zh-cn.js +1 -1
  79. package/lib/src/theme/ap-attachment/ap-attachment.css +62 -0
  80. package/lib/src/theme/ap-table/ap-table.css +3 -0
  81. package/package.json +2 -2
@@ -14,14 +14,17 @@ import { ItemType, MenuTheme, MenuMode } from 'ant-design-vue';
14
14
  import { CSSMotionProps } from 'ant-design-vue/es/_util/transition';
15
15
  import { BuiltinPlacements, TriggerSubMenuAction, SelectEventHandler, MenuClickEventHandler } from 'ant-design-vue/es/menu/src/interface';
16
16
  import { accessCreate } from '@aplus-frontend/oss';
17
+ import { AttachmentItemProps, ApAttachmentProps } from './ap-attachment';
18
+ export * from './hooks/index';
17
19
  export type { ApTitleProps } from './title/interface';
18
20
  export type { ApExpandAlertProps } from './expandAlert/interface';
19
21
  export type { ApLabelProps, ApLabelGroupProps, ApLabelGroupItemProps } from './ap-label/interface';
20
22
  export type { ApStatusProps, ApStatusGroupProps, ApStatusGroupItemProps } from './ap-status/interface';
21
23
  export type { ApSelectItem, ApSelectLayoutProps } from './ap-select-layout/interface';
22
- export type { ApInputRadioProps } from './ap-input-radio/interface';
24
+ export type { ApInputRadioProps, ApInputValType } from './ap-input-radio/interface';
23
25
  export type { ApExportGroupProps } from './ap-export-group/interface';
24
26
  export * from './ap-batch-action-group/interface';
27
+ export type { AttachmentItemProps, ApAttachmentProps } from './ap-attachment';
25
28
  export declare const ApTitle: {
26
29
  new (...args: any[]): CreateComponentPublicInstance<Readonly< ExtractPropTypes<{
27
30
  title: {
@@ -1098,7 +1101,11 @@ export declare const ApInputRadio: DefineComponent<{
1098
1101
  type: PropType<(text: string) => void>;
1099
1102
  };
1100
1103
  value: {
1101
- type: PropType<Record<"inputval" | "radioVal", string | number>>;
1104
+ type: PropType<{
1105
+ inputval: string | number;
1106
+ radioVal: string | number;
1107
+ }>;
1108
+ required: true;
1102
1109
  };
1103
1110
  disabled: {
1104
1111
  type: PropType<boolean>;
@@ -1152,8 +1159,16 @@ export declare const ApInputRadio: DefineComponent<{
1152
1159
  type: "up" | "down";
1153
1160
  }) => void>;
1154
1161
  };
1162
+ onInputRadioChange: {
1163
+ type: PropType<(value: {
1164
+ inputval: string | number;
1165
+ radioVal: string | number;
1166
+ }) => void>;
1167
+ required: true;
1168
+ };
1155
1169
  }, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
1156
1170
  "update:value": (...args: any[]) => void;
1171
+ InputRadioChange: (...args: any[]) => void;
1157
1172
  }, string, PublicProps, Readonly< ExtractPropTypes<{
1158
1173
  onBlur: {
1159
1174
  type: PropType<(e: FocusEvent) => void>;
@@ -1168,7 +1183,11 @@ export declare const ApInputRadio: DefineComponent<{
1168
1183
  type: PropType<(text: string) => void>;
1169
1184
  };
1170
1185
  value: {
1171
- type: PropType<Record<"inputval" | "radioVal", string | number>>;
1186
+ type: PropType<{
1187
+ inputval: string | number;
1188
+ radioVal: string | number;
1189
+ }>;
1190
+ required: true;
1172
1191
  };
1173
1192
  disabled: {
1174
1193
  type: PropType<boolean>;
@@ -1222,8 +1241,16 @@ export declare const ApInputRadio: DefineComponent<{
1222
1241
  type: "up" | "down";
1223
1242
  }) => void>;
1224
1243
  };
1244
+ onInputRadioChange: {
1245
+ type: PropType<(value: {
1246
+ inputval: string | number;
1247
+ radioVal: string | number;
1248
+ }) => void>;
1249
+ required: true;
1250
+ };
1225
1251
  }>> & {
1226
1252
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
1253
+ onInputRadioChange?: ((...args: never) => any) | undefined;
1227
1254
  }, {
1228
1255
  bordered: boolean;
1229
1256
  stringMode: boolean;
@@ -1970,5 +1997,98 @@ export declare const ApImage: DefineComponent<{
1970
1997
  current?: number;
1971
1998
  };
1972
1999
  }, {}>;
2000
+ export declare const ApAttachment: DefineComponent<{
2001
+ attachmentList: {
2002
+ type: PropType<Array< AttachmentItemProps>>;
2003
+ default: never[];
2004
+ required: boolean;
2005
+ };
2006
+ textToolTipPlacement: {
2007
+ type: PropType< ApAttachmentProps["textToolTipPlacement"]>;
2008
+ default: string;
2009
+ };
2010
+ fileMorePopoverPlacement: {
2011
+ type: PropType< ApAttachmentProps["fileMorePopoverPlacement"]>;
2012
+ default: string;
2013
+ };
2014
+ color: {
2015
+ type: StringConstructor;
2016
+ };
2017
+ size: {
2018
+ type: StringConstructor;
2019
+ default: string;
2020
+ };
2021
+ needName: {
2022
+ type: PropType<{
2023
+ nameKey?: string;
2024
+ pathKey?: string;
2025
+ }>;
2026
+ default: () => {
2027
+ nameKey: string;
2028
+ pathKey: string;
2029
+ };
2030
+ };
2031
+ getOssAccess: {
2032
+ type: PropType< ApAttachmentProps["getOssAccess"]>;
2033
+ };
2034
+ disabled: {
2035
+ type: BooleanConstructor;
2036
+ default: boolean;
2037
+ };
2038
+ toolTipBgColor: {
2039
+ type: StringConstructor;
2040
+ };
2041
+ }, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
2042
+ attachmentList: {
2043
+ type: PropType<Array< AttachmentItemProps>>;
2044
+ default: never[];
2045
+ required: boolean;
2046
+ };
2047
+ textToolTipPlacement: {
2048
+ type: PropType< ApAttachmentProps["textToolTipPlacement"]>;
2049
+ default: string;
2050
+ };
2051
+ fileMorePopoverPlacement: {
2052
+ type: PropType< ApAttachmentProps["fileMorePopoverPlacement"]>;
2053
+ default: string;
2054
+ };
2055
+ color: {
2056
+ type: StringConstructor;
2057
+ };
2058
+ size: {
2059
+ type: StringConstructor;
2060
+ default: string;
2061
+ };
2062
+ needName: {
2063
+ type: PropType<{
2064
+ nameKey?: string;
2065
+ pathKey?: string;
2066
+ }>;
2067
+ default: () => {
2068
+ nameKey: string;
2069
+ pathKey: string;
2070
+ };
2071
+ };
2072
+ getOssAccess: {
2073
+ type: PropType< ApAttachmentProps["getOssAccess"]>;
2074
+ };
2075
+ disabled: {
2076
+ type: BooleanConstructor;
2077
+ default: boolean;
2078
+ };
2079
+ toolTipBgColor: {
2080
+ type: StringConstructor;
2081
+ };
2082
+ }>>, {
2083
+ size: string;
2084
+ disabled: boolean;
2085
+ needName: {
2086
+ nameKey?: string;
2087
+ pathKey?: string;
2088
+ };
2089
+ textToolTipPlacement: TooltipPlacement;
2090
+ attachmentList: AttachmentItemProps[];
2091
+ fileMorePopoverPlacement: TooltipPlacement;
2092
+ }, {}>;
1973
2093
  export { ApTransformDataHelper };
1974
2094
  export * from './ap-table-modal';
@@ -1,8 +1,9 @@
1
1
  import { withInstall as o } from "@aplus-frontend/utils";
2
+ import "./hooks/index.mjs";
2
3
  import "./title/ApTitle.vue.mjs";
3
4
  import "./expandAlert/ApExpandAlert.vue.mjs";
4
5
  import t from "./ap-label/ApLabel.mjs";
5
- import p from "./ap-label/ApLabelGroup.mjs";
6
+ import m from "./ap-label/ApLabelGroup.mjs";
6
7
  import "./ap-status/ApStatus.vue.mjs";
7
8
  import "./ap-status/ApStatusGroup.vue.mjs";
8
9
  import "./ap-select-layout/select-layout.vue.mjs";
@@ -11,33 +12,35 @@ import "./ap-input-radio/ApInputRadio.vue.mjs";
11
12
  import "./ap-batch-action/ApBatchAction.vue.mjs";
12
13
  import "./ap-batch-action-group/ApBatchActionGroup.vue.mjs";
13
14
  import "./ap-image/ApImage.vue.mjs";
14
- import { ApTransformDataHelper as X } from "../utils/ap-trans-data/index.mjs";
15
+ import p from "./ap-attachment/ApAttachment.mjs";
16
+ import { ApTransformDataHelper as to } from "../utils/ap-trans-data/index.mjs";
15
17
  import "./ap-batch-action-group/interface.mjs";
16
- import { default as Z } from "./ap-table-modal/index.mjs";
18
+ import { default as po } from "./ap-table-modal/index.mjs";
17
19
  import r from "./title/ApTitle.vue2.mjs";
18
- import m from "./expandAlert/ApExpandAlert.vue2.mjs";
19
- import i from "./ap-status/ApStatus.vue2.mjs";
20
- import a from "./ap-status/ApStatusGroup.vue2.mjs";
21
- import n from "./ap-select-layout/select-layout.vue2.mjs";
22
- import c from "./ap-export-group/ApExportGroup.vue2.mjs";
23
- import f from "./ap-input-radio/ApInputRadio.vue2.mjs";
24
- import s from "./ap-batch-action/ApBatchAction.vue2.mjs";
20
+ import i from "./expandAlert/ApExpandAlert.vue2.mjs";
21
+ import a from "./ap-status/ApStatus.vue2.mjs";
22
+ import n from "./ap-status/ApStatusGroup.vue2.mjs";
23
+ import c from "./ap-select-layout/select-layout.vue2.mjs";
24
+ import f from "./ap-export-group/ApExportGroup.vue2.mjs";
25
+ import s from "./ap-input-radio/ApInputRadio.vue2.mjs";
26
+ import A from "./ap-batch-action/ApBatchAction.vue2.mjs";
25
27
  import _ from "./ap-batch-action-group/ApBatchActionGroup.vue2.mjs";
26
- import A from "./ap-image/ApImage.vue2.mjs";
27
- const q = o(r), v = m, z = o(t), C = o(i), F = o(a), J = o(n), K = o(c), N = f, O = s, P = p, Q = _, U = A;
28
+ import e from "./ap-image/ApImage.vue2.mjs";
29
+ const C = o(r), F = i, J = o(t), K = o(a), N = o(n), O = o(c), P = o(f), Q = s, U = A, V = m, W = _, X = e, Y = p;
28
30
  export {
29
- O as ApBatchAction,
30
- Q as ApBatchActionGroup,
31
- v as ApExpandAlert,
32
- K as ApExportGroup,
33
- U as ApImage,
34
- N as ApInputRadio,
35
- z as ApLabel,
36
- P as ApLabelGroup,
37
- J as ApSelectLayout,
38
- C as ApStatus,
39
- F as ApStatusGroup,
40
- Z as ApTableModal,
41
- q as ApTitle,
42
- X as ApTransformDataHelper
31
+ Y as ApAttachment,
32
+ U as ApBatchAction,
33
+ W as ApBatchActionGroup,
34
+ F as ApExpandAlert,
35
+ P as ApExportGroup,
36
+ X as ApImage,
37
+ Q as ApInputRadio,
38
+ J as ApLabel,
39
+ V as ApLabelGroup,
40
+ O as ApSelectLayout,
41
+ K as ApStatus,
42
+ N as ApStatusGroup,
43
+ po as ApTableModal,
44
+ C as ApTitle,
45
+ to as ApTransformDataHelper
43
46
  };
@@ -1,18 +1,18 @@
1
- import { defineComponent as q, ref as y, unref as o, useSlots as G, watch as H, openBlock as d, createBlock as C, mergeProps as b, withCtx as m, createVNode as w, createSlots as I, createElementBlock as M, normalizeClass as W, createCommentVNode as R, createElementVNode as $, toDisplayString as Q, normalizeStyle as U, renderList as J, renderSlot as X, normalizeProps as Y, guardReactiveProps as Z } from "vue";
2
- import { Table as ee, Tooltip as oe } from "ant-design-vue";
3
- import { ApForm as B } from "../ap-form/index.mjs";
4
- import { isNumber as i, cloneDeep as f, omit as te } from "lodash-unified";
1
+ import { defineComponent as M, ref as x, unref as a, useSlots as q, watch as G, openBlock as m, createBlock as y, mergeProps as C, withCtx as d, createVNode as b, createSlots as H, createElementBlock as I, normalizeClass as W, createCommentVNode as w, createElementVNode as $, toDisplayString as Q, normalizeStyle as U, renderList as J, renderSlot as X, normalizeProps as Y, guardReactiveProps as Z } from "vue";
2
+ import { Table as ee, Tooltip as te } from "ant-design-vue";
3
+ import { ApForm as R } from "../ap-form/index.mjs";
4
+ import { isArray as oe, isNumber as i, cloneDeep as f, omit as ae } from "lodash-unified";
5
5
  import "../config-provider/index.mjs";
6
- import { useInjectForm as ae } from "../ap-form/context.mjs";
6
+ import { useInjectForm as le } from "../ap-form/context.mjs";
7
7
  import "./style/index.css";
8
- import { isDef as p } from "../utils/index.mjs";
9
- import le from "./hooks/use-get-columns.mjs";
10
- import { scrollToRowIndex as ne, getColumnIsRequired as re } from "./utils.mjs";
11
- import { QuestionCircleOutlined as se } from "@ant-design/icons-vue";
12
- import { useToken as ue } from "ant-design-vue/es/theme/internal";
8
+ import { isDef as c } from "../utils/index.mjs";
9
+ import ne from "./hooks/use-get-columns.mjs";
10
+ import { scrollToRowIndex as re, getColumnIsRequired as se } from "./utils.mjs";
11
+ import { QuestionCircleOutlined as ue } from "@ant-design/icons-vue";
12
+ import { useToken as de } from "ant-design-vue/es/theme/internal";
13
13
  import { useNamespace as me } from "../config-provider/hooks/use-namespace.mjs";
14
- import { useGlobalConfig as de } from "../config-provider/hooks/use-global-config.mjs";
15
- const ve = /* @__PURE__ */ q({
14
+ import { useGlobalConfig as ie } from "../config-provider/hooks/use-global-config.mjs";
15
+ const Le = /* @__PURE__ */ M({
16
16
  name: "EditableTableInner",
17
17
  __name: "form-item",
18
18
  props: {
@@ -112,114 +112,117 @@ const ve = /* @__PURE__ */ q({
112
112
  default: () => ({})
113
113
  }
114
114
  },
115
- setup(k, {
116
- expose: v
115
+ setup(B, {
116
+ expose: k
117
117
  }) {
118
- var h;
119
- const l = k, {
120
- internalInstance: n,
121
- model: D
122
- } = ae(), r = y(((h = o(D)) == null ? void 0 : h[l.name]) || []), L = G(), T = B.useWatch(l.name);
123
- H(() => T.value, (e) => {
118
+ const l = B;
119
+ function D(e, t) {
120
+ return oe(t) ? t.reduce((o, n) => o == null ? void 0 : o[n], e) : e == null ? void 0 : e[t];
121
+ }
122
+ const {
123
+ internalInstance: r,
124
+ model: L
125
+ } = le(), s = x(D(a(L), l.name) || []), T = q(), E = R.useWatch(l.name);
126
+ G(() => E.value, (e) => {
124
127
  var t;
125
- r.value = e, (t = l.onChange) == null || t.call(l, e);
128
+ s.value = e, (t = l.onChange) == null || t.call(l, e);
126
129
  }, {
127
130
  deep: !0
128
131
  });
129
132
  const {
130
- b: E,
131
- em: F
132
- } = me("editable-table"), c = y(), N = de("valueTypeMap"), [, S] = ue(), _ = le(l, N);
133
- function z(e, t) {
133
+ b: F,
134
+ em: N
135
+ } = me("editable-table"), p = x(), S = ie("valueTypeMap"), [, V] = de(), _ = ne(l, S);
136
+ function v(e, t) {
134
137
  var u;
135
- const a = ((u = o(r)) == null ? void 0 : u.length) || 0;
136
- if (p(l.maxLength) && a >= l.maxLength)
138
+ const o = ((u = a(s)) == null ? void 0 : u.length) || 0;
139
+ if (c(l.maxLength) && o >= l.maxLength)
137
140
  return;
138
- const s = [...o(r) || []];
139
- p(t) ? s.splice(t, 0, {
141
+ const n = [...a(s) || []];
142
+ c(t) ? n.splice(t, 0, {
140
143
  ...e || {}
141
- }) : s.push({
144
+ }) : n.push({
142
145
  ...e || {}
143
- }), n == null || n.setFieldValue(l.name, [...o(r) || [], e || {}]);
146
+ }), r == null || r.setFieldValue(l.name, n);
144
147
  }
145
- function P(e, t = "suffix") {
148
+ function z(e, t = "suffix") {
146
149
  var g;
147
- const a = ((g = o(r)) == null ? void 0 : g.length) || 0, s = i(e) ? e : e.length;
148
- if (p(l.maxLength) && a + s > l.maxLength)
150
+ const o = ((g = a(s)) == null ? void 0 : g.length) || 0, n = i(e) ? e : e.length;
151
+ if (c(l.maxLength) && o + n > l.maxLength)
149
152
  return;
150
- const u = [...o(r) || []], x = i(e) ? new Array(e).fill({}) : f(e);
151
- t === "suffix" ? u.push(...x) : u.unshift(...x), n == null || n.setFieldValue(l.name, u);
153
+ const u = [...a(s) || []], h = i(e) ? new Array(e).fill({}) : f(e);
154
+ t === "suffix" ? u.push(...h) : u.unshift(...h), r == null || r.setFieldValue(l.name, u);
152
155
  }
153
- function V(e) {
154
- let t = f(o(r) || []);
155
- const a = i(e) ? [e] : e;
156
- t = t.filter((s, u) => !a.includes(u)), n == null || n.setFieldValue(l.name, t);
156
+ function P(e) {
157
+ let t = f(a(s) || []);
158
+ const o = i(e) ? [e] : e;
159
+ t = t.filter((n, u) => !o.includes(u)), r == null || r.setFieldValue(l.name, t);
157
160
  }
158
161
  function j() {
159
- return o(r);
162
+ return a(s);
160
163
  }
161
- function O(e) {
164
+ function A(e) {
162
165
  var t;
163
- return (t = o(r)) == null ? void 0 : t[e];
166
+ return (t = a(s)) == null ? void 0 : t[e];
164
167
  }
165
- function A(e, t) {
166
- const a = f(o(r));
167
- a[e] && (a[e] = {
168
- ...a[e],
168
+ function O(e, t) {
169
+ const o = f(a(s));
170
+ o[e] && (o[e] = {
171
+ ...o[e],
169
172
  ...t
170
- }, n == null || n.setFieldValue(l.name, [...a]));
173
+ }, r == null || r.setFieldValue(l.name, [...o]));
171
174
  }
172
175
  function K(e, t) {
173
- var s;
174
- const a = e === "end" ? r.value.length - 1 : e;
175
- ne(a, (s = c.value) == null ? void 0 : s.$el, t);
176
+ var n;
177
+ const o = e === "end" ? s.value.length - 1 : e;
178
+ re(o, (n = p.value) == null ? void 0 : n.$el, t);
176
179
  }
177
- return v({
178
- add: z,
179
- remove: V,
180
- getRowData: O,
180
+ return k({
181
+ add: v,
182
+ remove: P,
183
+ getRowData: A,
181
184
  getRowsData: j,
182
- setRowData: A,
183
- addMultiple: P,
185
+ setRowData: O,
186
+ addMultiple: z,
184
187
  scrollTo: K
185
- }), (e, t) => (d(), C(o(B).FormItem, b(e.formItem, {
188
+ }), (e, t) => (m(), y(a(R).FormItem, C(e.formItem, {
186
189
  name: e.name,
187
190
  label: e.label
188
191
  }), {
189
- default: m(() => [w(o(ee), b(o(te)(l, ["name", "maxLength", "onChange"]), {
190
- class: o(E)(),
191
- columns: o(_),
192
- "data-source": r.value,
192
+ default: d(() => [b(a(ee), C(a(ae)(l, ["name", "maxLength", "onChange"]), {
193
+ class: a(F)(),
194
+ columns: a(_),
195
+ "data-source": s.value,
193
196
  ref_key: "tableRef",
194
- ref: c
195
- }), I({
196
- headerCell: m(({
197
- column: a
198
- }) => [o(re)(a) ? (d(), M("span", {
197
+ ref: p
198
+ }), H({
199
+ headerCell: d(({
200
+ column: o
201
+ }) => [a(se)(o) ? (m(), I("span", {
199
202
  key: 0,
200
- class: W(o(F)("header-cell", "required"))
201
- }, "*", 2)) : R("", !0), $("span", null, Q(a.title), 1), a.tooltip ? (d(), C(o(oe), {
203
+ class: W(a(N)("header-cell", "required"))
204
+ }, "*", 2)) : w("", !0), $("span", null, Q(o.title), 1), o.tooltip ? (m(), y(a(te), {
202
205
  key: 1,
203
- title: a.tooltip,
206
+ title: o.tooltip,
204
207
  placement: "bottom"
205
208
  }, {
206
- default: m(() => [w(o(se), {
209
+ default: d(() => [b(a(ue), {
207
210
  style: U({
208
211
  paddingLeft: "4px",
209
- color: o(S).colorPrimary
212
+ color: a(V).colorPrimary
210
213
  })
211
214
  }, null, 8, ["style"])]),
212
215
  _: 2
213
- }, 1032, ["title"])) : R("", !0)]),
216
+ }, 1032, ["title"])) : w("", !0)]),
214
217
  _: 2
215
- }, [J(L, (a, s) => ({
216
- name: s,
217
- fn: m((u) => [X(e.$slots, s, Y(Z(u || {})))])
218
+ }, [J(T, (o, n) => ({
219
+ name: n,
220
+ fn: d((u) => [X(e.$slots, n, Y(Z(u || {})))])
218
221
  }))]), 1040, ["class", "columns", "data-source"])]),
219
222
  _: 3
220
223
  }, 16, ["name", "label"]));
221
224
  }
222
225
  });
223
226
  export {
224
- ve as default
227
+ Le as default
225
228
  };
@@ -1,63 +1,71 @@
1
- import { computed as g, unref as F } from "vue";
2
- import { omit as b, isFunction as x } from "lodash-unified";
3
- import { mergeClass as R, getFinalNode as h } from "../utils.mjs";
4
- import { updateFormProps as C, getFieldProps as I, getPlaceholder as y, getTableRenderProps as T } from "../../ap-table/utils.mjs";
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";
5
5
  import "../../config-provider/index.mjs";
6
- import { useLocale as N } from "../../config-provider/hooks/use-locale.mjs";
7
- const k = (o, i) => {
6
+ import { useLocale as G } from "../../config-provider/hooks/use-locale.mjs";
7
+ const D = (d, f) => {
8
8
  const {
9
- t: s
10
- } = N();
11
- return g(() => {
12
- let d = o.columns;
13
- return d ? (d = d.map((e) => ({
14
- ...b(e, ["ellipsis"]),
15
- customRender({
16
- value: a,
17
- ...n
18
- }) {
19
- const t = x(e.editable) ? e.editable(n.text, n.record, n.index) : !!e.editable;
20
- if (!e.valueType && !e.customRender && !e.customRenderFormItem)
21
- return console.warn("can not render table cell because no `valueType` / `customRender` / `customRenderFormItem`"), null;
22
- let c;
23
- if (t) {
24
- const l = C(e, I(e.fieldProps, {
25
- value: a,
26
- ...n
27
- })), u = {};
28
- o.onFieldChange && (u[`onUpdate:${l.valuePropName || "value"}`] = (f) => {
29
- var m;
30
- return (m = o.onFieldChange) == null ? void 0 : m.call(o, n.index, e.dataIndex, f);
31
- }), c = {
32
- name: [o.name, n.index, e.dataIndex],
33
- ...l || {},
34
- // 格式化placeholder
35
- placeholder: y(s, e.valueType, l == null ? void 0 : l.placeholder),
36
- field: {
37
- style: "width: 100%",
38
- ...(l == null ? void 0 : l.field) || {},
39
- ...u,
40
- class: R("is-editable", l.class)
41
- }
42
- };
43
- } else
44
- c = {
45
- field: T(e, {
46
- value: a,
9
+ t: x
10
+ } = G();
11
+ return h(() => {
12
+ const t = d.columns;
13
+ if (!t)
14
+ return [];
15
+ function c(g) {
16
+ return g.map((e) => ({
17
+ ...R(e, ["ellipsis"]),
18
+ children: c(e.children || []),
19
+ customRender({
20
+ value: l,
21
+ ...n
22
+ }) {
23
+ const o = C(e.editable) ? e.editable(n.text, n.record, n.index) : !!e.editable;
24
+ if (!e.valueType && !e.customRender && !e.customRenderFormItem)
25
+ return console.warn("can not render table cell because no `valueType` / `customRender` / `customRenderFormItem`"), null;
26
+ let r;
27
+ if (o) {
28
+ const a = T(e, v(e.fieldProps, {
29
+ value: l,
47
30
  ...n
48
- })
49
- };
50
- const r = h(e, t, c, a, n.record, F(i));
51
- return e.customRender ? e.customRender({
52
- value: a,
53
- ...n,
54
- editable: t,
55
- originalNode: r
56
- }) : r;
57
- }
58
- })), d) : [];
31
+ })), 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);
35
+ });
36
+ const F = s(e.dataIndex) ? e.dataIndex : [e.dataIndex];
37
+ r = {
38
+ name: [...s(d.name) ? d.name : [d.name], n.index, ...F],
39
+ ...a || {},
40
+ // 格式化placeholder
41
+ placeholder: w(x, e.valueType, a == null ? void 0 : a.placeholder),
42
+ field: {
43
+ style: "width: 100%",
44
+ ...(a == null ? void 0 : a.field) || {},
45
+ ...i,
46
+ class: y("is-editable", a.class)
47
+ }
48
+ };
49
+ } else
50
+ r = {
51
+ field: A(e, {
52
+ value: l,
53
+ ...n
54
+ })
55
+ };
56
+ const u = N(e, o, r, l, n.record, I(f));
57
+ return e.customRender ? e.customRender({
58
+ value: l,
59
+ ...n,
60
+ editable: o,
61
+ originalNode: u
62
+ }) : u;
63
+ }
64
+ }));
65
+ }
66
+ return c(t);
59
67
  });
60
68
  };
61
69
  export {
62
- k as default
70
+ D as default
63
71
  };
@@ -8,7 +8,7 @@ import { EllipsisConfig } from 'ant-design-vue/es/typography/Base';
8
8
  import { StandardBehaviorOptions } from '../../node_modules/scroll-into-view-if-needed';
9
9
  import { Recordable } from '../type';
10
10
  export type EditableColumnType<RecordType = any, ExtraValueType = 'text', ValueType extends ApTableValueTypes = ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType = ExtraValueType | ValueType> = MergedValueType extends ExtraValueType | ValueType ? Omit<ColumnType<RecordType>, 'children' | 'customRender' | 'ellipsis'> & {
11
- children?: EditableColumnType<RecordType, ExtraValueType, ValueType, MergedValueType>;
11
+ children?: EditableColumnType<RecordType, ExtraValueType, ValueType, MergedValueType>[];
12
12
  /**
13
13
  * 在title之后展示一个icon并触发tooltip
14
14
  */
@@ -32,7 +32,7 @@ export type EditableColumnType<RecordType = any, ExtraValueType = 'text', ValueT
32
32
  /**
33
33
  * 自定义表单,适用于内置`valueType`不满足的情况下使用
34
34
  */
35
- customRenderFormItem?: (config: EditableColumnType<RecordType>, fieldProps: Recordable, editable: boolean) => any;
35
+ customRenderFormItem?: (config: EditableColumnType<RecordType>, fieldProps: Recordable, editable: boolean, record: RecordType) => any;
36
36
  /**
37
37
  * 指定值类型(将会用于普通列和可编辑表格的渲染)
38
38
  */
@@ -94,9 +94,9 @@ export type EditableTableProps<RecordType = any> = Omit<TableProps<RecordType>,
94
94
  export type EditableTableFormItemProps<RecordType = any> = Omit<EditableTableProps<RecordType>, 'name'> & {
95
95
  label?: string;
96
96
  /**
97
- * FormItem的name 暂不支持传入数组类型
97
+ * FormItem的name
98
98
  */
99
- name: string;
99
+ name: NamePath;
100
100
  /**
101
101
  * 额外的表单项配置属性
102
102
  */