@aplus-frontend/ui 0.1.15 → 0.1.17

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 (117) hide show
  1. package/es/index.mjs +99 -95
  2. package/es/src/ap-form/ap-form-item-group/index.vue.mjs +26 -24
  3. package/es/src/ap-modal/index.d.ts +2 -2
  4. package/es/src/ap-modal/index.mjs +1 -1
  5. package/es/src/ap-modal/{type.d.ts → interface.d.ts} +3 -3
  6. package/es/src/ap-modal/utils/createModal.d.ts +1 -1
  7. package/es/src/ap-table/ap-table.vue.mjs +132 -129
  8. package/es/src/ap-table/interface.d.ts +19 -13
  9. package/es/src/ap-table/utils.d.ts +8340 -1
  10. package/es/src/ap-table/utils.mjs +134 -78
  11. package/es/src/business/ap-batch-action/index.css +2 -0
  12. package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue.d.ts +13 -0
  13. package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue.mjs +4 -0
  14. package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +110 -0
  15. package/es/src/business/ap-batch-action-group/MenuItemGroup.vue.d.ts +17 -0
  16. package/es/src/business/ap-batch-action-group/MenuItemGroup.vue.mjs +4 -0
  17. package/es/src/business/ap-batch-action-group/MenuItemGroup.vue2.mjs +50 -0
  18. package/es/src/business/ap-batch-action-group/interface.d.ts +41 -0
  19. package/es/src/business/ap-batch-action-group/interface.mjs +1 -0
  20. package/es/src/business/ap-image/ApImage.vue.d.ts +65 -0
  21. package/es/src/business/ap-image/ApImage.vue.mjs +4 -0
  22. package/es/src/business/ap-image/ApImage.vue2.mjs +56 -0
  23. package/es/src/business/ap-image/hooks/useOss.d.ts +11 -0
  24. package/es/src/business/ap-image/hooks/useOss.mjs +37 -0
  25. package/es/src/business/ap-image/imgs/admin-fallback.jpg.mjs +4 -0
  26. package/es/src/business/ap-image/imgs/aplus-fallback.jpg.mjs +4 -0
  27. package/es/src/business/index.d.ts +662 -1
  28. package/es/src/business/index.mjs +25 -16
  29. package/es/src/config-provider/config-provider-props.d.ts +5 -1
  30. package/es/src/config-provider/config-provider-props.mjs +4 -0
  31. package/es/src/config-provider/config-provider.d.ts +10 -1
  32. package/es/src/config-provider/config-provider.mjs +18 -17
  33. package/es/src/config-provider/constants.d.ts +6 -2
  34. package/es/src/config-provider/hooks/use-global-config.d.ts +5 -1
  35. package/es/src/config-provider/index.d.ts +20 -1
  36. package/es/src/editable-table/form-item.vue.mjs +85 -71
  37. package/es/src/editable-table/hooks/use-get-columns.d.ts +3 -2
  38. package/es/src/editable-table/hooks/use-get-columns.mjs +32 -32
  39. package/es/src/editable-table/index.vue.mjs +106 -92
  40. package/es/src/editable-table/interface.d.ts +7 -13
  41. package/es/src/editable-table/utils.d.ts +14 -2
  42. package/es/src/editable-table/utils.mjs +67 -57
  43. package/es/src/index.mjs +211 -207
  44. package/es/src/locale/lang/en.mjs +10 -7
  45. package/es/src/locale/lang/zh-cn.mjs +3 -0
  46. package/es/src/pro-form/hooks/use-label-width.d.ts +1 -1
  47. package/es/src/theme/antd-global-overwrite/admin/form.css +10 -5
  48. package/es/src/theme/antd-global-overwrite/admin/index.css +117 -38
  49. package/es/src/theme/antd-global-overwrite/admin/pagination.css +54 -16
  50. package/es/src/theme/antd-global-overwrite/admin/table.css +53 -17
  51. package/es/src/theme/antd-global-overwrite/aplus/form.css +28 -14
  52. package/es/src/theme/antd-global-overwrite/aplus/index.css +159 -67
  53. package/es/src/theme/antd-global-overwrite/aplus/pagination.css +66 -20
  54. package/es/src/theme/antd-global-overwrite/aplus/table.css +65 -33
  55. package/es/src/theme/ap-batch-action/ap-batch-action.css +2 -0
  56. package/es/src/utils/ap-trans-data/index.d.ts +9 -10
  57. package/es/src/utils/ap-trans-data/index.mjs +20 -0
  58. package/lib/index.js +1 -1
  59. package/lib/src/ap-form/ap-form-item-group/index.vue.js +1 -1
  60. package/lib/src/ap-modal/index.d.ts +2 -2
  61. package/lib/src/ap-modal/index.js +1 -1
  62. package/lib/src/ap-modal/{type.d.ts → interface.d.ts} +3 -3
  63. package/lib/src/ap-modal/utils/createModal.d.ts +1 -1
  64. package/lib/src/ap-table/ap-table.vue.js +1 -1
  65. package/lib/src/ap-table/interface.d.ts +19 -13
  66. package/lib/src/ap-table/utils.d.ts +8340 -1
  67. package/lib/src/ap-table/utils.js +1 -1
  68. package/lib/src/business/ap-batch-action/index.css +2 -0
  69. package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue.d.ts +13 -0
  70. package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue.js +1 -0
  71. package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.js +1 -0
  72. package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue.d.ts +17 -0
  73. package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue.js +1 -0
  74. package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue2.js +1 -0
  75. package/lib/src/business/ap-batch-action-group/interface.d.ts +41 -0
  76. package/lib/src/business/ap-batch-action-group/interface.js +1 -0
  77. package/lib/src/business/ap-image/ApImage.vue.d.ts +65 -0
  78. package/lib/src/business/ap-image/ApImage.vue.js +1 -0
  79. package/lib/src/business/ap-image/ApImage.vue2.js +1 -0
  80. package/lib/src/business/ap-image/hooks/useOss.d.ts +11 -0
  81. package/lib/src/business/ap-image/hooks/useOss.js +1 -0
  82. package/lib/src/business/ap-image/imgs/admin-fallback.jpg.js +1 -0
  83. package/lib/src/business/ap-image/imgs/aplus-fallback.jpg.js +1 -0
  84. package/lib/src/business/index.d.ts +662 -1
  85. package/lib/src/business/index.js +1 -1
  86. package/lib/src/config-provider/config-provider-props.d.ts +5 -1
  87. package/lib/src/config-provider/config-provider-props.js +1 -1
  88. package/lib/src/config-provider/config-provider.d.ts +10 -1
  89. package/lib/src/config-provider/config-provider.js +1 -1
  90. package/lib/src/config-provider/constants.d.ts +6 -2
  91. package/lib/src/config-provider/hooks/use-global-config.d.ts +5 -1
  92. package/lib/src/config-provider/index.d.ts +20 -1
  93. package/lib/src/editable-table/form-item.vue.js +1 -1
  94. package/lib/src/editable-table/hooks/use-get-columns.d.ts +3 -2
  95. package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
  96. package/lib/src/editable-table/index.vue.js +1 -1
  97. package/lib/src/editable-table/interface.d.ts +7 -13
  98. package/lib/src/editable-table/utils.d.ts +14 -2
  99. package/lib/src/editable-table/utils.js +1 -1
  100. package/lib/src/index.js +1 -1
  101. package/lib/src/locale/lang/en.js +1 -1
  102. package/lib/src/locale/lang/zh-cn.js +1 -1
  103. package/lib/src/pro-form/hooks/use-label-width.d.ts +1 -1
  104. package/lib/src/theme/antd-global-overwrite/admin/form.css +10 -5
  105. package/lib/src/theme/antd-global-overwrite/admin/index.css +117 -38
  106. package/lib/src/theme/antd-global-overwrite/admin/pagination.css +54 -16
  107. package/lib/src/theme/antd-global-overwrite/admin/table.css +53 -17
  108. package/lib/src/theme/antd-global-overwrite/aplus/form.css +28 -14
  109. package/lib/src/theme/antd-global-overwrite/aplus/index.css +159 -67
  110. package/lib/src/theme/antd-global-overwrite/aplus/pagination.css +66 -20
  111. package/lib/src/theme/antd-global-overwrite/aplus/table.css +65 -33
  112. package/lib/src/theme/ap-batch-action/ap-batch-action.css +2 -0
  113. package/lib/src/utils/ap-trans-data/index.d.ts +9 -10
  114. package/lib/src/utils/ap-trans-data/index.js +1 -0
  115. package/package.json +2 -2
  116. /package/es/src/ap-modal/{type.mjs → interface.mjs} +0 -0
  117. /package/lib/src/ap-modal/{type.js → interface.js} +0 -0
@@ -9,25 +9,34 @@ import "./ap-select-layout/select-layout.vue.mjs";
9
9
  import "./ap-export-group/ApExportGroup.vue.mjs";
10
10
  import "./ap-input-radio/ApInputRadio.vue.mjs";
11
11
  import "./ap-batch-action/ApBatchAction.vue.mjs";
12
+ import "./ap-batch-action-group/ApBatchActionGroup.vue.mjs";
13
+ import "./ap-image/ApImage.vue.mjs";
14
+ import { ApTransformDataHelper as Y } from "../utils/ap-trans-data/index.mjs";
15
+ import "./ap-batch-action-group/interface.mjs";
12
16
  import m from "./title/ApTitle.vue2.mjs";
13
- import p from "./expandAlert/ApExpandAlert.vue2.mjs";
14
- import r from "./ap-label/ApLabel.vue2.mjs";
17
+ import r from "./expandAlert/ApExpandAlert.vue2.mjs";
18
+ import p from "./ap-label/ApLabel.vue2.mjs";
15
19
  import i from "./ap-status/ApStatus.vue2.mjs";
16
20
  import n from "./ap-status/ApStatusGroup.vue2.mjs";
17
21
  import c from "./ap-select-layout/select-layout.vue2.mjs";
18
- import s from "./ap-export-group/ApExportGroup.vue2.mjs";
19
- import f from "./ap-input-radio/ApInputRadio.vue2.mjs";
20
- import a from "./ap-batch-action/ApBatchAction.vue2.mjs";
21
- const g = o(m), j = p, k = o(r), q = o(i), v = o(n), z = o(c), C = o(s), D = f, F = a, H = t;
22
+ import a from "./ap-export-group/ApExportGroup.vue2.mjs";
23
+ import s from "./ap-input-radio/ApInputRadio.vue2.mjs";
24
+ import f from "./ap-batch-action/ApBatchAction.vue2.mjs";
25
+ import _ from "./ap-batch-action-group/ApBatchActionGroup.vue2.mjs";
26
+ import A from "./ap-image/ApImage.vue2.mjs";
27
+ const z = o(m), C = r, F = o(p), J = o(i), K = o(n), M = o(c), N = o(a), O = s, P = f, Q = t, U = _, V = A;
22
28
  export {
23
- F as ApBatchAction,
24
- j as ApExpandAlert,
25
- C as ApExportGroup,
26
- D as ApInputRadio,
27
- k as ApLabel,
28
- H as ApLabelGroup,
29
- z as ApSelectLayout,
30
- q as ApStatus,
31
- v as ApStatusGroup,
32
- g as ApTitle
29
+ P as ApBatchAction,
30
+ U as ApBatchActionGroup,
31
+ C as ApExpandAlert,
32
+ N as ApExportGroup,
33
+ V as ApImage,
34
+ O as ApInputRadio,
35
+ F as ApLabel,
36
+ Q as ApLabelGroup,
37
+ M as ApSelectLayout,
38
+ J as ApStatus,
39
+ K as ApStatusGroup,
40
+ z as ApTitle,
41
+ Y as ApTransformDataHelper
33
42
  };
@@ -1,6 +1,6 @@
1
1
  import { ExtractPropTypes, PropType } from 'vue';
2
2
  import { LocaleType } from '../locale/interface';
3
- import { ApiType, ScrollbarGlobalConfig, TableDefaultConfig, ApUploadConfig, ApDescriptionsConfig } from './constants';
3
+ import { ApiType, ScrollbarGlobalConfig, TableDefaultConfig, ApUploadConfig, ApDescriptionsConfig, ValueTypeRenderConfig } from './constants';
4
4
  import { default as __DTS_DEFAULT_0__ } from 'ant-design-vue/es/config-provider/renderEmpty';
5
5
  import { TransformCellTextProps } from 'ant-design-vue/es/table/interface';
6
6
  import { CSPConfig, SizeType, ThemeConfig } from 'ant-design-vue/es/config-provider/context';
@@ -155,5 +155,9 @@ export declare const configProviderProps: () => {
155
155
  type: PropType<ApDescriptionsConfig>;
156
156
  default: () => {};
157
157
  };
158
+ valueTypeMap: {
159
+ type: PropType<Record<string, ValueTypeRenderConfig>>;
160
+ default: () => {};
161
+ };
158
162
  };
159
163
  export type ConfigProviderProps = Partial<ExtractPropTypes<ReturnType<typeof configProviderProps>>>;
@@ -33,6 +33,10 @@ const p = () => ({
33
33
  type: Object,
34
34
  default: () => ({})
35
35
  },
36
+ valueTypeMap: {
37
+ type: Object,
38
+ default: () => ({})
39
+ },
36
40
  ...e()
37
41
  });
38
42
  export {
@@ -9,7 +9,7 @@ import { ValidateMessages } from 'ant-design-vue/es/form/interface';
9
9
  import { RequiredMark } from 'ant-design-vue/es/form/Form';
10
10
  import { ThemeConfig } from 'ant-design-vue/es/config-provider/context';
11
11
  import { LocaleType } from '..';
12
- import { ApiType, TableDefaultConfig, ScrollbarGlobalConfig, ApUploadConfig, ApDescriptionsConfig } from './constants';
12
+ import { ApiType, TableDefaultConfig, ScrollbarGlobalConfig, ApUploadConfig, ApDescriptionsConfig, ValueTypeRenderConfig } from './constants';
13
13
  export declare const globalConfigCached: Ref<ConfigProviderProps>;
14
14
  export declare const ConfigProvider: DefineComponent<{
15
15
  iconPrefixCls: StringConstructor;
@@ -156,6 +156,10 @@ export declare const ConfigProvider: DefineComponent<{
156
156
  type: PropType<ApDescriptionsConfig>;
157
157
  default: () => {};
158
158
  };
159
+ valueTypeMap: {
160
+ type: PropType<Record<string, ValueTypeRenderConfig>>;
161
+ default: () => {};
162
+ };
159
163
  }, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
160
164
  iconPrefixCls: StringConstructor;
161
165
  getTargetContainer: {
@@ -301,6 +305,10 @@ export declare const ConfigProvider: DefineComponent<{
301
305
  type: PropType<ApDescriptionsConfig>;
302
306
  default: () => {};
303
307
  };
308
+ valueTypeMap: {
309
+ type: PropType<Record<string, ValueTypeRenderConfig>>;
310
+ default: () => {};
311
+ };
304
312
  }>>, {
305
313
  input: {
306
314
  autocomplete?: string;
@@ -339,5 +347,6 @@ export declare const ConfigProvider: DefineComponent<{
339
347
  uiMode: "aplus" | "admin";
340
348
  apUpload: ApUploadConfig;
341
349
  apDescriptions: ApDescriptionsConfig;
350
+ valueTypeMap: Record<string, ValueTypeRenderConfig>;
342
351
  }, {}>;
343
352
  export type ConfigProviderInstance = InstanceType<typeof ConfigProvider>;
@@ -1,20 +1,20 @@
1
- import { isVNode as n, ref as d, defineComponent as f, computed as m, watch as r, createVNode as c, renderSlot as u } from "vue";
2
- import { ConfigProvider as s } from "ant-design-vue";
3
- import { provideGlobalConfig as p } from "./hooks/use-global-config.mjs";
1
+ import { isVNode as n, ref as u, defineComponent as d, computed as f, watch as a, createVNode as m, renderSlot as c } from "vue";
2
+ import { ConfigProvider as p } from "ant-design-vue";
3
+ import { provideGlobalConfig as s } from "./hooks/use-global-config.mjs";
4
4
  import { configProviderProps as g } from "./config-provider-props.mjs";
5
5
  import { tableDefaultConfig as C } from "./constants.mjs";
6
- import { mergeAntdProvideConfig as b } from "../utils/config-provider-preset.mjs";
7
- import { setCSSVariables as v, aplusCssVar as P, adminCssVar as S } from "../theme/css-var/index.mjs";
8
- function V(e) {
6
+ import { mergeAntdProvideConfig as v } from "../utils/config-provider-preset.mjs";
7
+ import { setCSSVariables as b, aplusCssVar as P, adminCssVar as M } from "../theme/css-var/index.mjs";
8
+ function S(e) {
9
9
  return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !n(e);
10
10
  }
11
- const a = d({}), N = /* @__PURE__ */ f({
11
+ const i = u({}), N = /* @__PURE__ */ d({
12
12
  name: "AplusConfigProvider",
13
13
  props: g(),
14
14
  setup(e, {
15
- slots: i
15
+ slots: r
16
16
  }) {
17
- const l = m(() => ({
17
+ const l = f(() => ({
18
18
  namespace: e.namespace,
19
19
  aplusLocale: e.aplusLocale,
20
20
  api: e.api,
@@ -25,20 +25,21 @@ const a = d({}), N = /* @__PURE__ */ f({
25
25
  scrollbar: e.scrollbar,
26
26
  uiMode: e.uiMode,
27
27
  apUpload: e.apUpload,
28
- apDescriptions: e.apDescriptions
29
- })), t = p(l);
30
- return r(() => e, (o) => {
31
- a.value = b(o);
28
+ apDescriptions: e.apDescriptions,
29
+ valueTypeMap: e.valueTypeMap
30
+ })), t = s(l);
31
+ return a(() => e, (o) => {
32
+ i.value = v(o);
32
33
  }, {
33
34
  deep: !0,
34
35
  immediate: !0
35
- }), r(() => e.uiMode, (o) => {
36
- v(o === "aplus" ? P : S);
36
+ }), a(() => e.uiMode, (o) => {
37
+ b(o === "aplus" ? P : M);
37
38
  }, {
38
39
  immediate: !0
39
40
  }), () => {
40
41
  let o;
41
- return c(s, a.value, V(o = u(i, "default", {
42
+ return m(p, i.value, S(o = c(r, "default", {
42
43
  config: t == null ? void 0 : t.value
43
44
  })) ? o : {
44
45
  default: () => [o]
@@ -48,5 +49,5 @@ const a = d({}), N = /* @__PURE__ */ f({
48
49
  });
49
50
  export {
50
51
  N as ConfigProvider,
51
- a as globalConfigCached
52
+ i as globalConfigCached
52
53
  };
@@ -1,7 +1,7 @@
1
1
  import { ConfigProviderProps } from './config-provider-props';
2
- import { InjectionKey, Ref } from 'vue';
2
+ import { InjectionKey, Ref, VNode } from 'vue';
3
3
  import { SizeType, SorterResult } from '../pro-table/types/table';
4
- import { Fn } from '../type';
4
+ import { Fn, Recordable } from '../type';
5
5
  import { CommonOptionItem, ApiSelectOption } from '../pro-form/components/interface';
6
6
  import { client } from '@aplus-frontend/oss';
7
7
  export type ConfigProviderContext = Partial<ConfigProviderProps>;
@@ -38,6 +38,10 @@ export type ApUploadConfig = {
38
38
  };
39
39
  accept?: string;
40
40
  };
41
+ export type ValueTypeRenderConfig = {
42
+ render?: (text: any, record: Recordable, renderProps: Recordable) => VNode;
43
+ renderFormItem?: (fieldProps: Recordable) => VNode;
44
+ };
41
45
  export type ApDescriptionsConfig = {
42
46
  downloadFile?: (url: string, name: string) => void;
43
47
  };
@@ -1,6 +1,6 @@
1
1
  import { MaybeRef } from '@aplus-frontend/utils';
2
2
  import { App, Ref, ComputedRef, ExtractPropTypes, PropType } from 'vue';
3
- import { ConfigProviderContext, ApiType, TableDefaultConfig, ScrollbarGlobalConfig, ApUploadConfig, ApDescriptionsConfig } from '../constants';
3
+ import { ConfigProviderContext, ApiType, TableDefaultConfig, ScrollbarGlobalConfig, ApUploadConfig, ApDescriptionsConfig, ValueTypeRenderConfig } from '../constants';
4
4
  import { default as __DTS_DEFAULT_0__ } from 'ant-design-vue/es/config-provider/renderEmpty';
5
5
  import { TransformCellTextProps } from 'ant-design-vue/es/table/interface';
6
6
  import { CSPConfig } from 'ant-design-vue/es/config-provider';
@@ -158,4 +158,8 @@ export declare const provideGlobalConfig: (config: MaybeRef<ConfigProviderContex
158
158
  type: PropType<ApDescriptionsConfig>;
159
159
  default: () => {};
160
160
  };
161
+ valueTypeMap: {
162
+ type: PropType<Record<string, ValueTypeRenderConfig>>;
163
+ default: () => {};
164
+ };
161
165
  }>>>> | undefined;
@@ -8,7 +8,7 @@ import { ValidateMessages } from 'ant-design-vue/es/form/interface';
8
8
  import { RequiredMark } from 'ant-design-vue/es/form/Form';
9
9
  import { ThemeConfig } from 'ant-design-vue/es/config-provider/context';
10
10
  import { LocaleType } from '..';
11
- import { ApiType, TableDefaultConfig, ScrollbarGlobalConfig, ApUploadConfig, ApDescriptionsConfig } from './constants';
11
+ import { ApiType, TableDefaultConfig, ScrollbarGlobalConfig, ApUploadConfig, ApDescriptionsConfig, ValueTypeRenderConfig } from './constants';
12
12
  export * from './config-provider-props';
13
13
  export * from './constants';
14
14
  export * from './hooks/use-global-config';
@@ -161,6 +161,10 @@ export declare const APConfigProvider: {
161
161
  type: PropType<ApDescriptionsConfig>;
162
162
  default: () => {};
163
163
  };
164
+ valueTypeMap: {
165
+ type: PropType<Record<string, ValueTypeRenderConfig>>;
166
+ default: () => {};
167
+ };
164
168
  }>>, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, VNodeProps & AllowedComponentProps & ComponentCustomProps & Readonly< ExtractPropTypes<{
165
169
  iconPrefixCls: StringConstructor;
166
170
  getTargetContainer: {
@@ -306,6 +310,10 @@ export declare const APConfigProvider: {
306
310
  type: PropType<ApDescriptionsConfig>;
307
311
  default: () => {};
308
312
  };
313
+ valueTypeMap: {
314
+ type: PropType<Record<string, ValueTypeRenderConfig>>;
315
+ default: () => {};
316
+ };
309
317
  }>>, {
310
318
  input: {
311
319
  autocomplete?: string;
@@ -344,6 +352,7 @@ export declare const APConfigProvider: {
344
352
  uiMode: "aplus" | "admin";
345
353
  apUpload: ApUploadConfig;
346
354
  apDescriptions: ApDescriptionsConfig;
355
+ valueTypeMap: Record<string, ValueTypeRenderConfig>;
347
356
  }, true, {}, {}, {
348
357
  P: {};
349
358
  B: {};
@@ -496,6 +505,10 @@ export declare const APConfigProvider: {
496
505
  type: PropType<ApDescriptionsConfig>;
497
506
  default: () => {};
498
507
  };
508
+ valueTypeMap: {
509
+ type: PropType<Record<string, ValueTypeRenderConfig>>;
510
+ default: () => {};
511
+ };
499
512
  }>>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
500
513
  input: {
501
514
  autocomplete?: string;
@@ -534,6 +547,7 @@ export declare const APConfigProvider: {
534
547
  uiMode: "aplus" | "admin";
535
548
  apUpload: ApUploadConfig;
536
549
  apDescriptions: ApDescriptionsConfig;
550
+ valueTypeMap: Record<string, ValueTypeRenderConfig>;
537
551
  }>;
538
552
  __isFragment?: never;
539
553
  __isTeleport?: never;
@@ -683,6 +697,10 @@ export declare const APConfigProvider: {
683
697
  type: PropType<ApDescriptionsConfig>;
684
698
  default: () => {};
685
699
  };
700
+ valueTypeMap: {
701
+ type: PropType<Record<string, ValueTypeRenderConfig>>;
702
+ default: () => {};
703
+ };
686
704
  }>>, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
687
705
  input: {
688
706
  autocomplete?: string;
@@ -721,6 +739,7 @@ export declare const APConfigProvider: {
721
739
  uiMode: "aplus" | "admin";
722
740
  apUpload: ApUploadConfig;
723
741
  apDescriptions: ApDescriptionsConfig;
742
+ valueTypeMap: Record<string, ValueTypeRenderConfig>;
724
743
  }, {}, string, {}> & ( VNodeProps & ( AllowedComponentProps & ComponentCustomProps & ( Plugin & (new (...args: any[]) => {
725
744
  $props: {
726
745
  onClick?: () => void;
@@ -1,15 +1,18 @@
1
- import { defineComponent as V, ref as x, unref as t, useSlots as A, watch as O, openBlock as C, createBlock as K, mergeProps as w, withCtx as u, createVNode as q, createSlots as H, createElementBlock as I, Fragment as W, createElementVNode as b, normalizeClass as $, toDisplayString as G, createCommentVNode as M, renderList as U, renderSlot as J, normalizeProps as Q, guardReactiveProps as X } from "vue";
2
- import { Table as Y } from "ant-design-vue";
3
- import { ApForm as y } from "../ap-form/index.mjs";
4
- import { isNumber as m, cloneDeep as f, omit as Z } from "lodash-unified";
1
+ import { defineComponent as 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";
5
5
  import "../config-provider/index.mjs";
6
- import { useInjectForm as ee } from "../ap-form/context.mjs";
6
+ import { useInjectForm as ae } from "../ap-form/context.mjs";
7
7
  import "./style/index.css";
8
- import { isDef as c } from "../utils/index.mjs";
9
- import oe from "./hooks/use-get-columns.mjs";
10
- import { scrollToRowIndex as te, getColumnIsRequired as ae } from "./utils.mjs";
11
- import { useNamespace as ne } from "../config-provider/hooks/use-namespace.mjs";
12
- const ge = /* @__PURE__ */ V({
8
+ import { isDef as p } from "../utils/index.mjs";
9
+ import 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 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({
13
16
  name: "EditableTableInner",
14
17
  __name: "form-item",
15
18
  props: {
@@ -109,103 +112,114 @@ const ge = /* @__PURE__ */ V({
109
112
  default: () => ({})
110
113
  }
111
114
  },
112
- setup(R, {
113
- expose: B
115
+ setup(k, {
116
+ expose: v
114
117
  }) {
115
- var p;
116
- const n = R, {
117
- internalInstance: l,
118
+ var h;
119
+ const l = k, {
120
+ internalInstance: n,
118
121
  model: D
119
- } = ee(), r = x(((p = t(D)) == null ? void 0 : p[n.name]) || []), v = A(), F = y.useWatch(n.name);
120
- O(() => F.value, (e) => {
121
- var o;
122
- r.value = e, (o = n.onChange) == null || o.call(n, e);
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) => {
124
+ var t;
125
+ r.value = e, (t = l.onChange) == null || t.call(l, e);
123
126
  }, {
124
127
  deep: !0
125
128
  });
126
129
  const {
127
130
  b: E,
128
- em: L
129
- } = ne("editable-table"), i = x(), N = oe(n);
130
- function k(e, o) {
131
- var d;
132
- const a = ((d = t(r)) == null ? void 0 : d.length) || 0;
133
- if (c(n.maxLength) && a >= n.maxLength)
131
+ em: F
132
+ } = me("editable-table"), c = y(), N = de("valueTypeMap"), [, S] = ue(), _ = le(l, N);
133
+ function z(e, t) {
134
+ var u;
135
+ const a = ((u = o(r)) == null ? void 0 : u.length) || 0;
136
+ if (p(l.maxLength) && a >= l.maxLength)
134
137
  return;
135
- const s = [...t(r) || []];
136
- c(o) ? s.splice(o, 0, {
138
+ const s = [...o(r) || []];
139
+ p(t) ? s.splice(t, 0, {
137
140
  ...e || {}
138
141
  }) : s.push({
139
142
  ...e || {}
140
- }), l == null || l.setFieldValue(n.name, [...t(r) || [], e || {}]);
143
+ }), n == null || n.setFieldValue(l.name, [...o(r) || [], e || {}]);
141
144
  }
142
- function S(e, o = "suffix") {
145
+ function P(e, t = "suffix") {
143
146
  var g;
144
- const a = ((g = t(r)) == null ? void 0 : g.length) || 0, s = m(e) ? e : e.length;
145
- if (c(n.maxLength) && a + s > n.maxLength)
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)
146
149
  return;
147
- const d = [...t(r) || []], h = m(e) ? new Array(e).fill({}) : f(e);
148
- o === "suffix" ? d.push(...h) : d.unshift(...h), l == null || l.setFieldValue(n.name, d);
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);
149
152
  }
150
- function _(e) {
151
- let o = f(t(r) || []);
152
- const a = m(e) ? [e] : e;
153
- o = o.filter((s, d) => !a.includes(d)), l == null || l.setFieldValue(n.name, o);
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);
154
157
  }
155
- function T() {
156
- return t(r);
158
+ function j() {
159
+ return o(r);
157
160
  }
158
- function j(e) {
159
- var o;
160
- return (o = t(r)) == null ? void 0 : o[e];
161
+ function O(e) {
162
+ var t;
163
+ return (t = o(r)) == null ? void 0 : t[e];
161
164
  }
162
- function z(e, o) {
163
- const a = f(t(r));
165
+ function A(e, t) {
166
+ const a = f(o(r));
164
167
  a[e] && (a[e] = {
165
168
  ...a[e],
166
- ...o
167
- }, l == null || l.setFieldValue(n.name, [...a]));
169
+ ...t
170
+ }, n == null || n.setFieldValue(l.name, [...a]));
168
171
  }
169
- function P(e, o) {
172
+ function K(e, t) {
170
173
  var s;
171
174
  const a = e === "end" ? r.value.length - 1 : e;
172
- te(a, (s = i.value) == null ? void 0 : s.$el, o);
175
+ ne(a, (s = c.value) == null ? void 0 : s.$el, t);
173
176
  }
174
- return B({
175
- add: k,
176
- remove: _,
177
- getRowData: j,
178
- getRowsData: T,
179
- setRowData: z,
180
- addMultiple: S,
181
- scrollTo: P
182
- }), (e, o) => (C(), K(t(y).FormItem, w(e.formItem, {
177
+ return v({
178
+ add: z,
179
+ remove: V,
180
+ getRowData: O,
181
+ getRowsData: j,
182
+ setRowData: A,
183
+ addMultiple: P,
184
+ scrollTo: K
185
+ }), (e, t) => (d(), C(o(B).FormItem, b(e.formItem, {
183
186
  name: e.name,
184
187
  label: e.label
185
188
  }), {
186
- default: u(() => [q(t(Y), w(t(Z)(n, ["name", "maxLength", "onChange"]), {
187
- class: t(E)(),
188
- columns: t(N),
189
+ default: m(() => [w(o(ee), b(o(te)(l, ["name", "maxLength", "onChange"]), {
190
+ class: o(E)(),
191
+ columns: o(_),
189
192
  "data-source": r.value,
190
193
  ref_key: "tableRef",
191
- ref: i
192
- }), H({
193
- headerCell: u(({
194
+ ref: c
195
+ }), I({
196
+ headerCell: m(({
194
197
  column: a
195
- }) => [t(ae)(a) ? (C(), I(W, {
196
- key: 0
197
- }, [b("span", {
198
- class: $(t(L)("header-cell", "required"))
199
- }, "*", 2), b("span", null, G(a.title), 1)], 64)) : M("", !0)]),
198
+ }) => [o(re)(a) ? (d(), M("span", {
199
+ 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), {
202
+ key: 1,
203
+ title: a.tooltip,
204
+ placement: "bottom"
205
+ }, {
206
+ default: m(() => [w(o(se), {
207
+ style: U({
208
+ paddingLeft: "4px",
209
+ color: o(S).colorPrimary
210
+ })
211
+ }, null, 8, ["style"])]),
212
+ _: 2
213
+ }, 1032, ["title"])) : R("", !0)]),
200
214
  _: 2
201
- }, [U(v, (a, s) => ({
215
+ }, [J(L, (a, s) => ({
202
216
  name: s,
203
- fn: u((d) => [J(e.$slots, s, Q(X(d || {})))])
217
+ fn: m((u) => [X(e.$slots, s, Y(Z(u || {})))])
204
218
  }))]), 1040, ["class", "columns", "data-source"])]),
205
219
  _: 3
206
220
  }, 16, ["name", "label"]));
207
221
  }
208
222
  });
209
223
  export {
210
- ge as default
224
+ ve as default
211
225
  };
@@ -1,5 +1,6 @@
1
- import { ComputedRef } from 'vue';
1
+ import { ComputedRef, Ref } from 'vue';
2
2
  import { EditableTableFormItemProps, EditableTableProps } from '../interface';
3
+ import { ValueTypeRenderConfig } from '../../config-provider';
3
4
  import { ColumnType } from 'ant-design-vue/es/table';
4
- declare const useGetColumns: (props: EditableTableProps | EditableTableFormItemProps) => ComputedRef<ColumnType<any>[]>;
5
+ declare const useGetColumns: (props: EditableTableProps | EditableTableFormItemProps, extraValueTypes: Ref<Record<string, ValueTypeRenderConfig> | undefined>) => ComputedRef<ColumnType<any>[]>;
5
6
  export default useGetColumns;
@@ -1,57 +1,57 @@
1
- import { computed as f } from "vue";
2
- import { omit as g, isFunction as F } from "lodash-unified";
3
- import { mergeClass as b, getFinalNode as x } from "../utils.mjs";
4
- import { updateFormProps as R, getFieldProps as h, getPlaceholder as C, getTableRenderProps as I } from "../../ap-table/utils.mjs";
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";
5
5
  import "../../config-provider/index.mjs";
6
- import { useLocale as y } from "../../config-provider/hooks/use-locale.mjs";
7
- const $ = (o) => {
6
+ import { useLocale as N } from "../../config-provider/hooks/use-locale.mjs";
7
+ const k = (o, i) => {
8
8
  const {
9
- t: i
10
- } = y();
11
- return f(() => {
9
+ t: s
10
+ } = N();
11
+ return g(() => {
12
12
  let d = o.columns;
13
13
  return d ? (d = d.map((e) => ({
14
- ...g(e, ["ellipsis"]),
14
+ ...b(e, ["ellipsis"]),
15
15
  customRender({
16
- value: t,
17
- ...l
16
+ value: a,
17
+ ...n
18
18
  }) {
19
- const a = F(e.editable) ? e.editable(l.text, l.record, l.index) : !!e.editable;
19
+ const t = x(e.editable) ? e.editable(n.text, n.record, n.index) : !!e.editable;
20
20
  if (!e.valueType && !e.customRender && !e.customRenderFormItem)
21
21
  return console.warn("can not render table cell because no `valueType` / `customRender` / `customRenderFormItem`"), null;
22
22
  let c;
23
- if (a) {
24
- const n = R(e, h(e.fieldProps, {
25
- value: t,
26
- ...l
23
+ if (t) {
24
+ const l = C(e, I(e.fieldProps, {
25
+ value: a,
26
+ ...n
27
27
  })), u = {};
28
- o.onFieldChange && (u[`onUpdate:${n.valuePropName || "value"}`] = (s) => {
28
+ o.onFieldChange && (u[`onUpdate:${l.valuePropName || "value"}`] = (f) => {
29
29
  var m;
30
- return (m = o.onFieldChange) == null ? void 0 : m.call(o, l.index, e.dataIndex, s);
30
+ return (m = o.onFieldChange) == null ? void 0 : m.call(o, n.index, e.dataIndex, f);
31
31
  }), c = {
32
- name: [o.name, l.index, e.dataIndex],
33
- ...n || {},
32
+ name: [o.name, n.index, e.dataIndex],
33
+ ...l || {},
34
34
  // 格式化placeholder
35
- placeholder: C(i, e.valueType, n == null ? void 0 : n.placeholder),
35
+ placeholder: y(s, e.valueType, l == null ? void 0 : l.placeholder),
36
36
  field: {
37
37
  style: "width: 100%",
38
- ...(n == null ? void 0 : n.field) || {},
38
+ ...(l == null ? void 0 : l.field) || {},
39
39
  ...u,
40
- class: b("is-editable", n.class)
40
+ class: R("is-editable", l.class)
41
41
  }
42
42
  };
43
43
  } else
44
44
  c = {
45
- field: I(e, {
46
- value: t,
47
- ...l
45
+ field: T(e, {
46
+ value: a,
47
+ ...n
48
48
  })
49
49
  };
50
- const r = x(e, a, c, t);
50
+ const r = h(e, t, c, a, n.record, F(i));
51
51
  return e.customRender ? e.customRender({
52
- value: t,
53
- ...l,
54
- editable: a,
52
+ value: a,
53
+ ...n,
54
+ editable: t,
55
55
  originalNode: r
56
56
  }) : r;
57
57
  }
@@ -59,5 +59,5 @@ const $ = (o) => {
59
59
  });
60
60
  };
61
61
  export {
62
- $ as default
62
+ k as default
63
63
  };