@aplus-frontend/ui 0.1.23 → 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 (69) 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/utils.mjs +1 -1
  12. package/es/src/business/ap-attachment/ApAttachment.d.ts +97 -0
  13. package/es/src/business/ap-attachment/ApAttachment.mjs +82 -0
  14. package/es/src/business/ap-attachment/constans.d.ts +44 -0
  15. package/es/src/business/ap-attachment/constans.mjs +42 -0
  16. package/es/src/business/ap-attachment/index.d.ts +3 -0
  17. package/es/src/business/ap-attachment/interface.d.ts +13 -0
  18. package/es/src/business/ap-attachment/style.css +62 -0
  19. package/es/src/business/ap-input-radio/ApInputRadio.vue.d.ts +2 -0
  20. package/es/src/business/ap-input-radio/ApInputRadio.vue2.mjs +25 -22
  21. package/es/src/business/ap-input-radio/interface.d.ts +8 -2
  22. package/es/src/business/hooks/index.d.ts +1 -0
  23. package/es/src/business/hooks/index.mjs +4 -0
  24. package/es/src/business/hooks/usePageListApTable.d.ts +29 -0
  25. package/es/src/business/hooks/usePageListApTable.mjs +67 -0
  26. package/es/src/business/index.d.ts +123 -3
  27. package/es/src/business/index.mjs +29 -26
  28. package/es/src/editable-table/form-item.vue.mjs +80 -77
  29. package/es/src/editable-table/hooks/use-get-columns.mjs +30 -30
  30. package/es/src/editable-table/interface.d.ts +2 -2
  31. package/es/src/index.mjs +204 -201
  32. package/es/src/locale/lang/en.mjs +4 -0
  33. package/es/src/locale/lang/zh-cn.mjs +4 -0
  34. package/es/src/theme/ap-attachment/ap-attachment.css +62 -0
  35. package/lib/index.js +1 -1
  36. package/lib/src/ap-download/ap-download.vue.d.ts +0 -3
  37. package/lib/src/ap-download/ap-download.vue.js +1 -1
  38. package/lib/src/ap-field/number/index.vue.js +1 -1
  39. package/lib/src/ap-form/ap-form-item.vue.js +1 -1
  40. package/lib/src/ap-form/ap-form.vue.d.ts +1 -1
  41. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  42. package/lib/src/ap-form/interface.d.ts +2 -2
  43. package/lib/src/ap-form/modal-form/index.vue.d.ts +2 -2
  44. package/lib/src/ap-form/search-form/index.vue.d.ts +2 -2
  45. package/lib/src/ap-table/utils.js +1 -1
  46. package/lib/src/business/ap-attachment/ApAttachment.d.ts +97 -0
  47. package/lib/src/business/ap-attachment/ApAttachment.js +1 -0
  48. package/lib/src/business/ap-attachment/constans.d.ts +44 -0
  49. package/lib/src/business/ap-attachment/constans.js +1 -0
  50. package/lib/src/business/ap-attachment/index.d.ts +3 -0
  51. package/lib/src/business/ap-attachment/interface.d.ts +13 -0
  52. package/lib/src/business/ap-attachment/style.css +62 -0
  53. package/lib/src/business/ap-input-radio/ApInputRadio.vue.d.ts +2 -0
  54. package/lib/src/business/ap-input-radio/ApInputRadio.vue2.js +1 -1
  55. package/lib/src/business/ap-input-radio/interface.d.ts +8 -2
  56. package/lib/src/business/hooks/index.d.ts +1 -0
  57. package/lib/src/business/hooks/index.js +1 -0
  58. package/lib/src/business/hooks/usePageListApTable.d.ts +29 -0
  59. package/lib/src/business/hooks/usePageListApTable.js +1 -0
  60. package/lib/src/business/index.d.ts +123 -3
  61. package/lib/src/business/index.js +1 -1
  62. package/lib/src/editable-table/form-item.vue.js +1 -1
  63. package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
  64. package/lib/src/editable-table/interface.d.ts +2 -2
  65. package/lib/src/index.js +1 -1
  66. package/lib/src/locale/lang/en.js +1 -1
  67. package/lib/src/locale/lang/zh-cn.js +1 -1
  68. package/lib/src/theme/ap-attachment/ap-attachment.css +62 -0
  69. package/package.json +2 -2
@@ -0,0 +1,67 @@
1
+ import "../../index.mjs";
2
+ import { merge as p } from "lodash-unified";
3
+ import { ref as m } from "vue";
4
+ import { useGlobalConfig as d } from "../../config-provider/hooks/use-global-config.mjs";
5
+ function A(l) {
6
+ const t = m(null), n = d("uiMode", "aplus");
7
+ console.log("mode", n.value);
8
+ const {
9
+ isShowRowSelection: c = !0,
10
+ transformSearchFormValues: o,
11
+ api: a,
12
+ ...u
13
+ } = l || {};
14
+ return [p(
15
+ {
16
+ // scroll,tableLayout,columnResizable设置表格可拖动
17
+ scroll: { x: "100%", y: "100%" },
18
+ tableLayout: "fixed",
19
+ columnResizable: !0,
20
+ // 表格header吸顶效果
21
+ class: "ap-table--sticky",
22
+ request: a ? async (e) => {
23
+ const r = o ? o(e) : e;
24
+ try {
25
+ if (!a) throw new Error("api is not defined");
26
+ const { records: s, total: i } = await a(r);
27
+ return {
28
+ data: s,
29
+ total: i
30
+ };
31
+ } catch (s) {
32
+ return console.error(s), {
33
+ data: [],
34
+ total: 0
35
+ };
36
+ }
37
+ } : void 0,
38
+ rowSelection: c ? {
39
+ mode: "internal",
40
+ fixed: "left",
41
+ columnWidth: 50
42
+ } : void 0,
43
+ ref(e) {
44
+ t.value = e;
45
+ }
46
+ },
47
+ u
48
+ ), {
49
+ reload: () => {
50
+ var e;
51
+ (e = t.value) == null || e.submit();
52
+ },
53
+ reset: () => {
54
+ var e;
55
+ (e = t.value) == null || e.reset();
56
+ },
57
+ getSearchFormValues: () => {
58
+ var r;
59
+ const e = ((r = t.value) == null ? void 0 : r.getSearchFormValues()) || {};
60
+ return o ? o(e) : e;
61
+ },
62
+ getApTableInstance: () => t.value
63
+ }];
64
+ }
65
+ export {
66
+ A as usePageListApTable
67
+ };
@@ -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 t, useSlots as G, watch as H, openBlock as m, createBlock as C, mergeProps as b, withCtx as d, 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";
13
- import { useNamespace as de } from "../config-provider/hooks/use-namespace.mjs";
14
- import { useGlobalConfig as me } from "../config-provider/hooks/use-global-config.mjs";
15
- const ve = /* @__PURE__ */ q({
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
+ import { useNamespace as me } from "../config-provider/hooks/use-namespace.mjs";
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(), s = y(((h = t(D)) == null ? void 0 : h[l.name]) || []), L = G(), T = B.useWatch(l.name);
123
- H(() => T.value, (e) => {
124
- var o;
125
- s.value = e, (o = l.onChange) == null || o.call(l, 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) => {
127
+ var t;
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
- } = de("editable-table"), c = y(), N = me("valueTypeMap"), [, S] = ue(), _ = le(l, N);
133
- function V(e, o) {
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 = t(s)) == 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 r = [...t(s) || []];
139
- p(o) ? r.splice(o, 0, {
141
+ const n = [...a(s) || []];
142
+ c(t) ? n.splice(t, 0, {
140
143
  ...e || {}
141
- }) : r.push({
144
+ }) : n.push({
142
145
  ...e || {}
143
- }), n == null || n.setFieldValue(l.name, r);
146
+ }), r == null || r.setFieldValue(l.name, n);
144
147
  }
145
- function z(e, o = "suffix") {
148
+ function z(e, t = "suffix") {
146
149
  var g;
147
- const a = ((g = t(s)) == null ? void 0 : g.length) || 0, r = i(e) ? e : e.length;
148
- if (p(l.maxLength) && a + r > 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 = [...t(s) || []], x = i(e) ? new Array(e).fill({}) : f(e);
151
- o === "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
156
  function P(e) {
154
- let o = f(t(s) || []);
155
- const a = i(e) ? [e] : e;
156
- o = o.filter((r, u) => !a.includes(u)), n == null || n.setFieldValue(l.name, o);
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 t(s);
162
+ return a(s);
160
163
  }
161
- function O(e) {
162
- var o;
163
- return (o = t(s)) == null ? void 0 : o[e];
164
+ function A(e) {
165
+ var t;
166
+ return (t = a(s)) == null ? void 0 : t[e];
164
167
  }
165
- function A(e, o) {
166
- const a = f(t(s));
167
- a[e] && (a[e] = {
168
- ...a[e],
169
- ...o
170
- }, n == null || n.setFieldValue(l.name, [...a]));
168
+ function O(e, t) {
169
+ const o = f(a(s));
170
+ o[e] && (o[e] = {
171
+ ...o[e],
172
+ ...t
173
+ }, r == null || r.setFieldValue(l.name, [...o]));
171
174
  }
172
- function K(e, o) {
173
- var r;
174
- const a = e === "end" ? s.value.length - 1 : e;
175
- ne(a, (r = c.value) == null ? void 0 : r.$el, o);
175
+ function K(e, 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: V,
180
+ return k({
181
+ add: v,
179
182
  remove: P,
180
- getRowData: O,
183
+ getRowData: A,
181
184
  getRowsData: j,
182
- setRowData: A,
185
+ setRowData: O,
183
186
  addMultiple: z,
184
187
  scrollTo: K
185
- }), (e, o) => (m(), C(t(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: d(() => [w(t(ee), b(t(te)(l, ["name", "maxLength", "onChange"]), {
190
- class: t(E)(),
191
- columns: t(_),
192
+ default: d(() => [b(a(ee), C(a(ae)(l, ["name", "maxLength", "onChange"]), {
193
+ class: a(F)(),
194
+ columns: a(_),
192
195
  "data-source": s.value,
193
196
  ref_key: "tableRef",
194
- ref: c
195
- }), I({
197
+ ref: p
198
+ }), H({
196
199
  headerCell: d(({
197
- column: a
198
- }) => [t(re)(a) ? (m(), M("span", {
200
+ column: o
201
+ }) => [a(se)(o) ? (m(), I("span", {
199
202
  key: 0,
200
- class: W(t(F)("header-cell", "required"))
201
- }, "*", 2)) : R("", !0), $("span", null, Q(a.title), 1), a.tooltip ? (m(), C(t(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: d(() => [w(t(se), {
209
+ default: d(() => [b(a(ue), {
207
210
  style: U({
208
211
  paddingLeft: "4px",
209
- color: t(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, r) => ({
216
- name: r,
217
- fn: d((u) => [X(e.$slots, r, 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,63 @@
1
- import { computed as b, unref as h } from "vue";
2
- import { omit as I, isFunction as R, isArray as C } from "lodash-unified";
3
- import { mergeClass as y, getFinalNode as T } from "../utils.mjs";
4
- import { updateFormProps as N, getFieldProps as v, getPlaceholder as w, getTableRenderProps as A } 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
6
  import { useLocale as G } from "../../config-provider/hooks/use-locale.mjs";
7
- const B = (l, m) => {
7
+ const D = (d, f) => {
8
8
  const {
9
- t: f
9
+ t: x
10
10
  } = G();
11
- return b(() => {
12
- const t = l.columns;
11
+ return h(() => {
12
+ const t = d.columns;
13
13
  if (!t)
14
14
  return [];
15
- function c(x) {
16
- return x.map((e) => ({
17
- ...I(e, ["ellipsis"]),
15
+ function c(g) {
16
+ return g.map((e) => ({
17
+ ...R(e, ["ellipsis"]),
18
18
  children: c(e.children || []),
19
19
  customRender({
20
- value: o,
20
+ value: l,
21
21
  ...n
22
22
  }) {
23
- const a = R(e.editable) ? e.editable(n.text, n.record, n.index) : !!e.editable;
23
+ const o = C(e.editable) ? e.editable(n.text, n.record, n.index) : !!e.editable;
24
24
  if (!e.valueType && !e.customRender && !e.customRenderFormItem)
25
25
  return console.warn("can not render table cell because no `valueType` / `customRender` / `customRenderFormItem`"), null;
26
26
  let r;
27
- if (a) {
28
- const d = N(e, v(e.fieldProps, {
29
- value: o,
27
+ if (o) {
28
+ const a = T(e, v(e.fieldProps, {
29
+ value: l,
30
30
  ...n
31
31
  })), i = {};
32
- l.onFieldChange && (i[`onUpdate:${d.valuePropName || "value"}`] = (F) => {
33
- var s;
34
- return (s = l.onFieldChange) == null ? void 0 : s.call(l, n.index, e.dataIndex, F);
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
35
  });
36
- const g = C(e.dataIndex) ? e.dataIndex : [e.dataIndex];
36
+ const F = s(e.dataIndex) ? e.dataIndex : [e.dataIndex];
37
37
  r = {
38
- name: [l.name, n.index, ...g],
39
- ...d || {},
38
+ name: [...s(d.name) ? d.name : [d.name], n.index, ...F],
39
+ ...a || {},
40
40
  // 格式化placeholder
41
- placeholder: w(f, e.valueType, d == null ? void 0 : d.placeholder),
41
+ placeholder: w(x, e.valueType, a == null ? void 0 : a.placeholder),
42
42
  field: {
43
43
  style: "width: 100%",
44
- ...(d == null ? void 0 : d.field) || {},
44
+ ...(a == null ? void 0 : a.field) || {},
45
45
  ...i,
46
- class: y("is-editable", d.class)
46
+ class: y("is-editable", a.class)
47
47
  }
48
48
  };
49
49
  } else
50
50
  r = {
51
51
  field: A(e, {
52
- value: o,
52
+ value: l,
53
53
  ...n
54
54
  })
55
55
  };
56
- const u = T(e, a, r, o, n.record, h(m));
56
+ const u = N(e, o, r, l, n.record, I(f));
57
57
  return e.customRender ? e.customRender({
58
- value: o,
58
+ value: l,
59
59
  ...n,
60
- editable: a,
60
+ editable: o,
61
61
  originalNode: u
62
62
  }) : u;
63
63
  }
@@ -67,5 +67,5 @@ const B = (l, m) => {
67
67
  });
68
68
  };
69
69
  export {
70
- B as default
70
+ D as default
71
71
  };
@@ -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
  */