@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.
- package/es/index.mjs +99 -95
- package/es/src/ap-form/ap-form-item-group/index.vue.mjs +26 -24
- package/es/src/ap-modal/index.d.ts +2 -2
- package/es/src/ap-modal/index.mjs +1 -1
- package/es/src/ap-modal/{type.d.ts → interface.d.ts} +3 -3
- package/es/src/ap-modal/utils/createModal.d.ts +1 -1
- package/es/src/ap-table/ap-table.vue.mjs +132 -129
- package/es/src/ap-table/interface.d.ts +19 -13
- package/es/src/ap-table/utils.d.ts +8340 -1
- package/es/src/ap-table/utils.mjs +134 -78
- package/es/src/business/ap-batch-action/index.css +2 -0
- package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue.d.ts +13 -0
- package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue.mjs +4 -0
- package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +110 -0
- package/es/src/business/ap-batch-action-group/MenuItemGroup.vue.d.ts +17 -0
- package/es/src/business/ap-batch-action-group/MenuItemGroup.vue.mjs +4 -0
- package/es/src/business/ap-batch-action-group/MenuItemGroup.vue2.mjs +50 -0
- package/es/src/business/ap-batch-action-group/interface.d.ts +41 -0
- package/es/src/business/ap-batch-action-group/interface.mjs +1 -0
- package/es/src/business/ap-image/ApImage.vue.d.ts +65 -0
- package/es/src/business/ap-image/ApImage.vue.mjs +4 -0
- package/es/src/business/ap-image/ApImage.vue2.mjs +56 -0
- package/es/src/business/ap-image/hooks/useOss.d.ts +11 -0
- package/es/src/business/ap-image/hooks/useOss.mjs +37 -0
- package/es/src/business/ap-image/imgs/admin-fallback.jpg.mjs +4 -0
- package/es/src/business/ap-image/imgs/aplus-fallback.jpg.mjs +4 -0
- package/es/src/business/index.d.ts +662 -1
- package/es/src/business/index.mjs +25 -16
- package/es/src/config-provider/config-provider-props.d.ts +5 -1
- package/es/src/config-provider/config-provider-props.mjs +4 -0
- package/es/src/config-provider/config-provider.d.ts +10 -1
- package/es/src/config-provider/config-provider.mjs +18 -17
- package/es/src/config-provider/constants.d.ts +6 -2
- package/es/src/config-provider/hooks/use-global-config.d.ts +5 -1
- package/es/src/config-provider/index.d.ts +20 -1
- package/es/src/editable-table/form-item.vue.mjs +85 -71
- package/es/src/editable-table/hooks/use-get-columns.d.ts +3 -2
- package/es/src/editable-table/hooks/use-get-columns.mjs +32 -32
- package/es/src/editable-table/index.vue.mjs +106 -92
- package/es/src/editable-table/interface.d.ts +7 -13
- package/es/src/editable-table/utils.d.ts +14 -2
- package/es/src/editable-table/utils.mjs +67 -57
- package/es/src/index.mjs +211 -207
- package/es/src/locale/lang/en.mjs +10 -7
- package/es/src/locale/lang/zh-cn.mjs +3 -0
- package/es/src/pro-form/hooks/use-label-width.d.ts +1 -1
- package/es/src/theme/antd-global-overwrite/admin/form.css +10 -5
- package/es/src/theme/antd-global-overwrite/admin/index.css +117 -38
- package/es/src/theme/antd-global-overwrite/admin/pagination.css +54 -16
- package/es/src/theme/antd-global-overwrite/admin/table.css +53 -17
- package/es/src/theme/antd-global-overwrite/aplus/form.css +28 -14
- package/es/src/theme/antd-global-overwrite/aplus/index.css +159 -67
- package/es/src/theme/antd-global-overwrite/aplus/pagination.css +66 -20
- package/es/src/theme/antd-global-overwrite/aplus/table.css +65 -33
- package/es/src/theme/ap-batch-action/ap-batch-action.css +2 -0
- package/es/src/utils/ap-trans-data/index.d.ts +9 -10
- package/es/src/utils/ap-trans-data/index.mjs +20 -0
- package/lib/index.js +1 -1
- package/lib/src/ap-form/ap-form-item-group/index.vue.js +1 -1
- package/lib/src/ap-modal/index.d.ts +2 -2
- package/lib/src/ap-modal/index.js +1 -1
- package/lib/src/ap-modal/{type.d.ts → interface.d.ts} +3 -3
- package/lib/src/ap-modal/utils/createModal.d.ts +1 -1
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/interface.d.ts +19 -13
- package/lib/src/ap-table/utils.d.ts +8340 -1
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/business/ap-batch-action/index.css +2 -0
- package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue.d.ts +13 -0
- package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue.js +1 -0
- package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.js +1 -0
- package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue.d.ts +17 -0
- package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue.js +1 -0
- package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue2.js +1 -0
- package/lib/src/business/ap-batch-action-group/interface.d.ts +41 -0
- package/lib/src/business/ap-batch-action-group/interface.js +1 -0
- package/lib/src/business/ap-image/ApImage.vue.d.ts +65 -0
- package/lib/src/business/ap-image/ApImage.vue.js +1 -0
- package/lib/src/business/ap-image/ApImage.vue2.js +1 -0
- package/lib/src/business/ap-image/hooks/useOss.d.ts +11 -0
- package/lib/src/business/ap-image/hooks/useOss.js +1 -0
- package/lib/src/business/ap-image/imgs/admin-fallback.jpg.js +1 -0
- package/lib/src/business/ap-image/imgs/aplus-fallback.jpg.js +1 -0
- package/lib/src/business/index.d.ts +662 -1
- package/lib/src/business/index.js +1 -1
- package/lib/src/config-provider/config-provider-props.d.ts +5 -1
- package/lib/src/config-provider/config-provider-props.js +1 -1
- package/lib/src/config-provider/config-provider.d.ts +10 -1
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/config-provider/constants.d.ts +6 -2
- package/lib/src/config-provider/hooks/use-global-config.d.ts +5 -1
- package/lib/src/config-provider/index.d.ts +20 -1
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/hooks/use-get-columns.d.ts +3 -2
- package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/editable-table/interface.d.ts +7 -13
- package/lib/src/editable-table/utils.d.ts +14 -2
- package/lib/src/editable-table/utils.js +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/pro-form/hooks/use-label-width.d.ts +1 -1
- package/lib/src/theme/antd-global-overwrite/admin/form.css +10 -5
- package/lib/src/theme/antd-global-overwrite/admin/index.css +117 -38
- package/lib/src/theme/antd-global-overwrite/admin/pagination.css +54 -16
- package/lib/src/theme/antd-global-overwrite/admin/table.css +53 -17
- package/lib/src/theme/antd-global-overwrite/aplus/form.css +28 -14
- package/lib/src/theme/antd-global-overwrite/aplus/index.css +159 -67
- package/lib/src/theme/antd-global-overwrite/aplus/pagination.css +66 -20
- package/lib/src/theme/antd-global-overwrite/aplus/table.css +65 -33
- package/lib/src/theme/ap-batch-action/ap-batch-action.css +2 -0
- package/lib/src/utils/ap-trans-data/index.d.ts +9 -10
- package/lib/src/utils/ap-trans-data/index.js +1 -0
- package/package.json +2 -2
- /package/es/src/ap-modal/{type.mjs → interface.mjs} +0 -0
- /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
|
|
14
|
-
import
|
|
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
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
C as
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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>>>;
|
|
@@ -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
|
|
2
|
-
import { ConfigProvider as
|
|
3
|
-
import { provideGlobalConfig as
|
|
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
|
|
7
|
-
import { setCSSVariables as
|
|
8
|
-
function
|
|
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
|
|
11
|
+
const i = u({}), N = /* @__PURE__ */ d({
|
|
12
12
|
name: "AplusConfigProvider",
|
|
13
13
|
props: g(),
|
|
14
14
|
setup(e, {
|
|
15
|
-
slots:
|
|
15
|
+
slots: r
|
|
16
16
|
}) {
|
|
17
|
-
const l =
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
}),
|
|
36
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
2
|
-
import { Table as
|
|
3
|
-
import { ApForm as
|
|
4
|
-
import { isNumber as
|
|
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
|
|
6
|
+
import { useInjectForm as ae } from "../ap-form/context.mjs";
|
|
7
7
|
import "./style/index.css";
|
|
8
|
-
import { isDef as
|
|
9
|
-
import
|
|
10
|
-
import { scrollToRowIndex as
|
|
11
|
-
import {
|
|
12
|
-
|
|
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(
|
|
113
|
-
expose:
|
|
115
|
+
setup(k, {
|
|
116
|
+
expose: v
|
|
114
117
|
}) {
|
|
115
|
-
var
|
|
116
|
-
const
|
|
117
|
-
internalInstance:
|
|
118
|
+
var h;
|
|
119
|
+
const l = k, {
|
|
120
|
+
internalInstance: n,
|
|
118
121
|
model: D
|
|
119
|
-
} =
|
|
120
|
-
|
|
121
|
-
var
|
|
122
|
-
r.value = 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:
|
|
129
|
-
} =
|
|
130
|
-
function
|
|
131
|
-
var
|
|
132
|
-
const a = ((
|
|
133
|
-
if (
|
|
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 = [...
|
|
136
|
-
|
|
138
|
+
const s = [...o(r) || []];
|
|
139
|
+
p(t) ? s.splice(t, 0, {
|
|
137
140
|
...e || {}
|
|
138
141
|
}) : s.push({
|
|
139
142
|
...e || {}
|
|
140
|
-
}),
|
|
143
|
+
}), n == null || n.setFieldValue(l.name, [...o(r) || [], e || {}]);
|
|
141
144
|
}
|
|
142
|
-
function
|
|
145
|
+
function P(e, t = "suffix") {
|
|
143
146
|
var g;
|
|
144
|
-
const a = ((g =
|
|
145
|
-
if (
|
|
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
|
|
148
|
-
|
|
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
|
|
151
|
-
let
|
|
152
|
-
const a =
|
|
153
|
-
|
|
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
|
|
156
|
-
return
|
|
158
|
+
function j() {
|
|
159
|
+
return o(r);
|
|
157
160
|
}
|
|
158
|
-
function
|
|
159
|
-
var
|
|
160
|
-
return (
|
|
161
|
+
function O(e) {
|
|
162
|
+
var t;
|
|
163
|
+
return (t = o(r)) == null ? void 0 : t[e];
|
|
161
164
|
}
|
|
162
|
-
function
|
|
163
|
-
const a = f(
|
|
165
|
+
function A(e, t) {
|
|
166
|
+
const a = f(o(r));
|
|
164
167
|
a[e] && (a[e] = {
|
|
165
168
|
...a[e],
|
|
166
|
-
...
|
|
167
|
-
},
|
|
169
|
+
...t
|
|
170
|
+
}, n == null || n.setFieldValue(l.name, [...a]));
|
|
168
171
|
}
|
|
169
|
-
function
|
|
172
|
+
function K(e, t) {
|
|
170
173
|
var s;
|
|
171
174
|
const a = e === "end" ? r.value.length - 1 : e;
|
|
172
|
-
|
|
175
|
+
ne(a, (s = c.value) == null ? void 0 : s.$el, t);
|
|
173
176
|
}
|
|
174
|
-
return
|
|
175
|
-
add:
|
|
176
|
-
remove:
|
|
177
|
-
getRowData:
|
|
178
|
-
getRowsData:
|
|
179
|
-
setRowData:
|
|
180
|
-
addMultiple:
|
|
181
|
-
scrollTo:
|
|
182
|
-
}), (e,
|
|
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:
|
|
187
|
-
class:
|
|
188
|
-
columns:
|
|
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:
|
|
192
|
-
}),
|
|
193
|
-
headerCell:
|
|
194
|
+
ref: c
|
|
195
|
+
}), I({
|
|
196
|
+
headerCell: m(({
|
|
194
197
|
column: a
|
|
195
|
-
}) => [
|
|
196
|
-
key: 0
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
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
|
-
}, [
|
|
215
|
+
}, [J(L, (a, s) => ({
|
|
202
216
|
name: s,
|
|
203
|
-
fn:
|
|
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
|
-
|
|
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
|
|
2
|
-
import { omit as
|
|
3
|
-
import { mergeClass as
|
|
4
|
-
import { updateFormProps as
|
|
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
|
|
7
|
-
const
|
|
6
|
+
import { useLocale as N } from "../../config-provider/hooks/use-locale.mjs";
|
|
7
|
+
const k = (o, i) => {
|
|
8
8
|
const {
|
|
9
|
-
t:
|
|
10
|
-
} =
|
|
11
|
-
return
|
|
9
|
+
t: s
|
|
10
|
+
} = N();
|
|
11
|
+
return g(() => {
|
|
12
12
|
let d = o.columns;
|
|
13
13
|
return d ? (d = d.map((e) => ({
|
|
14
|
-
...
|
|
14
|
+
...b(e, ["ellipsis"]),
|
|
15
15
|
customRender({
|
|
16
|
-
value:
|
|
17
|
-
...
|
|
16
|
+
value: a,
|
|
17
|
+
...n
|
|
18
18
|
}) {
|
|
19
|
-
const
|
|
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 (
|
|
24
|
-
const
|
|
25
|
-
value:
|
|
26
|
-
...
|
|
23
|
+
if (t) {
|
|
24
|
+
const l = C(e, I(e.fieldProps, {
|
|
25
|
+
value: a,
|
|
26
|
+
...n
|
|
27
27
|
})), u = {};
|
|
28
|
-
o.onFieldChange && (u[`onUpdate:${
|
|
28
|
+
o.onFieldChange && (u[`onUpdate:${l.valuePropName || "value"}`] = (f) => {
|
|
29
29
|
var m;
|
|
30
|
-
return (m = o.onFieldChange) == null ? void 0 : m.call(o,
|
|
30
|
+
return (m = o.onFieldChange) == null ? void 0 : m.call(o, n.index, e.dataIndex, f);
|
|
31
31
|
}), c = {
|
|
32
|
-
name: [o.name,
|
|
33
|
-
...
|
|
32
|
+
name: [o.name, n.index, e.dataIndex],
|
|
33
|
+
...l || {},
|
|
34
34
|
// 格式化placeholder
|
|
35
|
-
placeholder:
|
|
35
|
+
placeholder: y(s, e.valueType, l == null ? void 0 : l.placeholder),
|
|
36
36
|
field: {
|
|
37
37
|
style: "width: 100%",
|
|
38
|
-
...(
|
|
38
|
+
...(l == null ? void 0 : l.field) || {},
|
|
39
39
|
...u,
|
|
40
|
-
class:
|
|
40
|
+
class: R("is-editable", l.class)
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
} else
|
|
44
44
|
c = {
|
|
45
|
-
field:
|
|
46
|
-
value:
|
|
47
|
-
...
|
|
45
|
+
field: T(e, {
|
|
46
|
+
value: a,
|
|
47
|
+
...n
|
|
48
48
|
})
|
|
49
49
|
};
|
|
50
|
-
const r =
|
|
50
|
+
const r = h(e, t, c, a, n.record, F(i));
|
|
51
51
|
return e.customRender ? e.customRender({
|
|
52
|
-
value:
|
|
53
|
-
...
|
|
54
|
-
editable:
|
|
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
|
-
|
|
62
|
+
k as default
|
|
63
63
|
};
|