@teamix/pro 1.4.25-bugfix.2 → 1.4.25-bugfix.3
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/dist/pro.css +1 -1
- package/dist/pro.js +64943 -84006
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/dist/pro.min.js.LICENSE.txt +6 -13
- package/es/actions/base.js +21 -8
- package/es/actions/dialog-component.js +9 -2
- package/es/actions/dialog-form.js +75 -37
- package/es/actions/dialog-info.js +5 -1
- package/es/actions/dialog.js +95 -57
- package/es/actions/index.d.ts +0 -7
- package/es/actions/index.js +153 -93
- package/es/actions/index.scss +1 -6
- package/es/actions/link.js +5 -3
- package/es/actions/request.js +27 -12
- package/es/actions/utils.js +9 -1
- package/es/card/card-container.js +5 -0
- package/es/card/divider.js +5 -0
- package/es/card/index.js +100 -61
- package/es/card/index.scss +0 -15
- package/es/card/selectable.js +13 -4
- package/es/card/tab.js +10 -1
- package/es/card/utils.js +2 -0
- package/es/form/Components/Editable/index.js +55 -16
- package/es/form/Components/FormGroup/index.d.ts +0 -1
- package/es/form/Components/FormGroup/index.js +22 -7
- package/es/form/Components/LightFilter/index.js +35 -15
- package/es/form/Components/ProField/index.js +14 -2
- package/es/form/Components/ProField/mapDateFormat.js +28 -2
- package/es/form/Components/Text/index.d.ts +0 -1
- package/es/form/Components/Text/index.js +11 -2
- package/es/form/Filter/AdvancedFilter.js +26 -11
- package/es/form/Filter/Layout.js +24 -11
- package/es/form/Filter/LightFilter.js +24 -13
- package/es/form/Filter/SimpleFilter.js +21 -7
- package/es/form/Filter/index.js +171 -117
- package/es/form/Filter/index2.js +28 -11
- package/es/form/Filter/layout.scss +1 -1
- package/es/form/Filter/useBindUrl.js +46 -18
- package/es/form/Filter/useSpecialProps.js +13 -8
- package/es/form/ProForm/customComponent.js +5 -0
- package/es/form/ProForm/index.js +38 -30
- package/es/form/ProForm/useAutoLayout.js +42 -21
- package/es/form/ProForm/useAutoSubmit.js +8 -3
- package/es/form/ProForm/useFieldRequest.js +5 -0
- package/es/form/ProForm/useFormDisplayValues.js +28 -12
- package/es/form/ProForm/useInitialRequest.js +5 -0
- package/es/form/SchemaForm/adapterComponent.js +3 -0
- package/es/form/SchemaForm/adapterDecorator.d.ts +1 -1
- package/es/form/SchemaForm/adapterDecorator.js +8 -0
- package/es/form/SchemaForm/adapterType.js +2 -0
- package/es/form/SchemaForm/index.js +114 -78
- package/es/form/SchemaForm/initializeArrayCards.js +6 -0
- package/es/form/SchemaForm/initializeArrayCollapse.js +6 -0
- package/es/form/SchemaForm/initializeArrayItems.js +9 -2
- package/es/form/SchemaForm/initializeArrayTable.js +34 -21
- package/es/form/SchemaForm/initializeDataSource.js +6 -2
- package/es/form/SchemaForm/initializeFormButton.js +31 -14
- package/es/form/SchemaForm/initializeFormCollapse.js +18 -8
- package/es/form/SchemaForm/initializeFormGroup.js +20 -10
- package/es/form/SchemaForm/initializeFormStep.js +23 -11
- package/es/form/SchemaForm/initializeFormTab.js +20 -10
- package/es/form/SchemaForm/initializeReactions.js +33 -9
- package/es/form/SchemaForm/initializeRequest.js +16 -2
- package/es/form/SchemaForm/initializeRules.js +22 -4
- package/es/form/SchemaForm/initializeSelectTable.js +33 -7
- package/es/form/SchemaForm/reactions.js +34 -19
- package/es/form/docs/ActionResponse.d.ts +0 -1
- package/es/form/index.d.ts +9 -9
- package/es/form/index.js +9 -0
- package/es/form/typing.d.ts +4 -26
- package/es/form/utils.d.ts +1 -1
- package/es/form/utils.js +49 -4
- package/es/form/warning.js +7 -2
- package/es/global.scss +1 -3
- package/es/index-without-icon.js +3 -4
- package/es/index.d.ts +1 -1
- package/es/index.js +8 -18
- package/es/info/components/InfoGroup/index.js +32 -21
- package/es/info/components/InfoValueItem/index.js +119 -66
- package/es/info/components/ProInfoItem/index.js +21 -13
- package/es/info/components/baseInfo/index.js +27 -17
- package/es/info/components/headerInfo/index.js +20 -8
- package/es/info/components/tableInfo/index.js +50 -20
- package/es/info/index.js +86 -61
- package/es/info/typing.d.ts +0 -2
- package/es/info/utils/index.js +11 -0
- package/es/nocode/configurators/ProTable.js +22 -1
- package/es/nocode/configurators/common.js +6 -5
- package/es/nocode/configurators/index.js +3 -2
- package/es/nocode/index.js +6 -6
- package/es/nocode/pages/editor.js +9 -5
- package/es/nocode/pages/index.js +30 -5
- package/es/nocode/pages/playground.js +35 -18
- package/es/nocode/pages/renderer.js +42 -9
- package/es/nocode/playground.js +23 -10
- package/es/page-header/index.d.ts +2 -2
- package/es/page-header/index.js +76 -40
- package/es/page-header/index.scss +1 -2
- package/es/sidebar/components/sidebar-container/index.js +69 -54
- package/es/sidebar/components/sidebar-container/index.scss +14 -21
- package/es/sidebar/components/tree/index.js +138 -100
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.js +26 -11
- package/es/sidebar/components/tree-node/components/IconAction/index.js +35 -9
- package/es/sidebar/components/tree-node/components/IconSwitch/index.d.ts +2 -2
- package/es/sidebar/components/tree-node/components/IconSwitch/index.js +25 -12
- package/es/sidebar/components/tree-node/components/IconSwitch/index.scss +1 -1
- package/es/sidebar/components/tree-node/index.js +84 -42
- package/es/sidebar/components/tree-node/index.scss +0 -6
- package/es/sidebar/index.d.ts +0 -2
- package/es/sidebar/index.js +95 -72
- package/es/sidebar/typing.d.ts +0 -4
- package/es/sidebar/utils/action-ref.js +7 -2
- package/es/sidebar/utils/index.d.ts +2 -5
- package/es/sidebar/utils/index.js +98 -41
- package/es/table/components/Filter/index.d.ts +3 -6
- package/es/table/components/Filter/index.js +128 -115
- package/es/table/components/Layout/index.js +47 -32
- package/es/table/components/Layout/index.scss +1 -2
- package/es/table/components/Pagination/index.js +58 -25
- package/es/table/components/QuickAction/index.d.ts +0 -1
- package/es/table/components/QuickAction/index.js +11 -3
- package/es/table/components/ToolBar/DensityIcon.js +31 -19
- package/es/table/components/ToolBar/FilterColumnIcon.js +125 -87
- package/es/table/components/ToolBar/FullScreenIcon.js +62 -7
- package/es/table/components/ToolBar/Fullscreen.js +28 -25
- package/es/table/components/ToolBar/RefreshIcon.js +27 -162
- package/es/table/components/ToolBar/index.d.ts +1 -1
- package/es/table/components/ToolBar/index.js +38 -130
- package/es/table/components/ToolBar/index.scss +3 -49
- package/es/table/index.js +423 -455
- package/es/table/index.scss +0 -8
- package/es/table/typing.d.ts +6 -125
- package/es/table/utils/columnRender.d.ts +3 -3
- package/es/table/utils/columnRender.js +79 -39
- package/es/table/utils/genProColumnToColumn.d.ts +2 -2
- package/es/table/utils/genProColumnToColumn.js +16 -13
- package/es/table/utils/index.js +47 -14
- package/es/table/utils/pureColumnRender.js +53 -21
- package/es/table/utils/pureGenProColumnToColumn.d.ts +1 -1
- package/es/table/utils/pureGenProColumnToColumn.js +10 -2
- package/es/table/utils/useTableSelection.js +33 -6
- package/es/templates/List/index.js +9 -2
- package/es/timeline/ProTimeLineItem/index.js +65 -25
- package/es/timeline/index.js +22 -8
- package/es/timeline/typing.d.ts +0 -1
- package/es/utils/message.d.ts +2 -2
- package/es/utils/message.js +5 -0
- package/lib/actions/base.js +24 -8
- package/lib/actions/confirm.js +5 -0
- package/lib/actions/danger-confirm.js +5 -0
- package/lib/actions/danger-pop-confirm.js +4 -0
- package/lib/actions/dialog-component.js +15 -2
- package/lib/actions/dialog-form.js +89 -36
- package/lib/actions/dialog-info.js +10 -1
- package/lib/actions/dialog-table.js +5 -0
- package/lib/actions/dialog.js +112 -55
- package/lib/actions/drawer-form.js +3 -0
- package/lib/actions/drawer-info.js +3 -0
- package/lib/actions/drawer-table.js +3 -0
- package/lib/actions/drawer.js +4 -0
- package/lib/actions/error.js +5 -0
- package/lib/actions/index.d.ts +0 -7
- package/lib/actions/index.js +184 -115
- package/lib/actions/index.scss +1 -6
- package/lib/actions/link.js +10 -1
- package/lib/actions/notice.js +5 -0
- package/lib/actions/pop-confirm.js +5 -0
- package/lib/actions/request.js +32 -8
- package/lib/actions/utils.js +9 -1
- package/lib/card/card-container.js +9 -0
- package/lib/card/divider.js +7 -0
- package/lib/card/index.js +127 -61
- package/lib/card/index.scss +0 -15
- package/lib/card/selectable.js +20 -4
- package/lib/card/tab.js +14 -1
- package/lib/card/utils.js +6 -0
- package/lib/field/index.js +6 -0
- package/lib/form/Components/Editable/index.js +65 -15
- package/lib/form/Components/FormGroup/index.d.ts +0 -1
- package/lib/form/Components/FormGroup/index.js +28 -7
- package/lib/form/Components/LightFilter/index.js +47 -15
- package/lib/form/Components/ProField/index.js +21 -2
- package/lib/form/Components/ProField/mapDateFormat.js +32 -2
- package/lib/form/Components/Text/index.d.ts +0 -1
- package/lib/form/Components/Text/index.js +16 -2
- package/lib/form/Filter/AdvancedFilter.js +34 -11
- package/lib/form/Filter/Layout.js +33 -11
- package/lib/form/Filter/LightFilter.js +32 -13
- package/lib/form/Filter/SimpleFilter.js +27 -5
- package/lib/form/Filter/index.js +191 -116
- package/lib/form/Filter/index2.js +38 -11
- package/lib/form/Filter/layout.scss +1 -1
- package/lib/form/Filter/useBindUrl.js +50 -18
- package/lib/form/Filter/useSpecialProps.js +13 -6
- package/lib/form/ProForm/customComponent.js +8 -0
- package/lib/form/ProForm/index.js +60 -30
- package/lib/form/ProForm/useAutoLayout.js +45 -21
- package/lib/form/ProForm/useAutoSubmit.js +10 -1
- package/lib/form/ProForm/useFieldRequest.js +8 -0
- package/lib/form/ProForm/useFormDisplayValues.js +34 -12
- package/lib/form/ProForm/useInitialRequest.js +6 -0
- package/lib/form/SchemaForm/adapterComponent.js +6 -0
- package/lib/form/SchemaForm/adapterDecorator.d.ts +1 -1
- package/lib/form/SchemaForm/adapterDecorator.js +12 -0
- package/lib/form/SchemaForm/adapterType.js +5 -0
- package/lib/form/SchemaForm/index.js +144 -78
- package/lib/form/SchemaForm/initializeArrayCards.js +7 -0
- package/lib/form/SchemaForm/initializeArrayCollapse.js +7 -0
- package/lib/form/SchemaForm/initializeArrayItems.js +10 -2
- package/lib/form/SchemaForm/initializeArrayTable.js +34 -21
- package/lib/form/SchemaForm/initializeDataSource.js +8 -2
- package/lib/form/SchemaForm/initializeFormButton.js +32 -14
- package/lib/form/SchemaForm/initializeFormCollapse.js +18 -8
- package/lib/form/SchemaForm/initializeFormGroup.js +20 -10
- package/lib/form/SchemaForm/initializeFormStep.js +23 -11
- package/lib/form/SchemaForm/initializeFormTab.js +20 -10
- package/lib/form/SchemaForm/initializeReactions.js +37 -9
- package/lib/form/SchemaForm/initializeRequest.js +18 -2
- package/lib/form/SchemaForm/initializeRules.js +24 -4
- package/lib/form/SchemaForm/initializeSelectTable.js +36 -7
- package/lib/form/SchemaForm/reactions.js +37 -17
- package/lib/form/docs/ActionResponse.d.ts +0 -1
- package/lib/form/docs/ActionResponse.js +5 -0
- package/lib/form/index.d.ts +9 -9
- package/lib/form/index.js +25 -0
- package/lib/form/typing.d.ts +4 -26
- package/lib/form/utils.d.ts +1 -1
- package/lib/form/utils.js +61 -4
- package/lib/form/warning.js +8 -2
- package/lib/global.scss +1 -3
- package/lib/hooks/index.js +5 -0
- package/lib/index-without-icon.js +36 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +40 -13
- package/lib/info/components/InfoGroup/index.js +42 -21
- package/lib/info/components/InfoValueItem/index.js +134 -66
- package/lib/info/components/ProInfoItem/index.js +29 -13
- package/lib/info/components/baseInfo/index.js +39 -17
- package/lib/info/components/headerInfo/index.js +31 -8
- package/lib/info/components/tableInfo/index.js +62 -20
- package/lib/info/index.js +101 -61
- package/lib/info/typing.d.ts +0 -2
- package/lib/info/utils/index.js +19 -0
- package/lib/info/utils/utils.js +1 -0
- package/lib/nocode/configurators/PageHeader.js +2 -0
- package/lib/nocode/configurators/ProTable.js +24 -1
- package/lib/nocode/configurators/common.js +10 -5
- package/lib/nocode/configurators/index.js +10 -2
- package/lib/nocode/configurators/map.js +5 -0
- package/lib/nocode/index.js +11 -0
- package/lib/nocode/pages/editor.js +19 -5
- package/lib/nocode/pages/index.js +35 -3
- package/lib/nocode/pages/playground.js +52 -18
- package/lib/nocode/pages/renderer.js +53 -9
- package/lib/nocode/playground.js +35 -10
- package/lib/page-container/index.js +6 -0
- package/lib/page-header/index.d.ts +2 -2
- package/lib/page-header/index.js +90 -39
- package/lib/page-header/index.scss +1 -2
- package/lib/sidebar/components/sidebar-container/index.js +81 -54
- package/lib/sidebar/components/sidebar-container/index.scss +14 -21
- package/lib/sidebar/components/tree/index.js +152 -100
- package/lib/sidebar/components/tree-node/components/HoverTooltip/index.js +34 -11
- package/lib/sidebar/components/tree-node/components/IconAction/index.js +46 -9
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.d.ts +2 -2
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.js +35 -12
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.scss +1 -1
- package/lib/sidebar/components/tree-node/index.js +100 -42
- package/lib/sidebar/components/tree-node/index.scss +0 -6
- package/lib/sidebar/index.d.ts +0 -2
- package/lib/sidebar/index.js +111 -79
- package/lib/sidebar/typing.d.ts +0 -4
- package/lib/sidebar/utils/action-ref.js +8 -2
- package/lib/sidebar/utils/index.d.ts +2 -5
- package/lib/sidebar/utils/index.js +106 -41
- package/lib/skeleton/index.js +6 -0
- package/lib/table/components/EmptyContent/index.js +6 -0
- package/lib/table/components/Filter/index.d.ts +3 -6
- package/lib/table/components/Filter/index.js +137 -114
- package/lib/table/components/Layout/index.js +60 -32
- package/lib/table/components/Layout/index.scss +1 -2
- package/lib/table/components/Pagination/index.js +68 -25
- package/lib/table/components/QuickAction/index.d.ts +0 -1
- package/lib/table/components/QuickAction/index.js +15 -3
- package/lib/table/components/ToolBar/DensityIcon.js +42 -19
- package/lib/table/components/ToolBar/FilterColumnIcon.js +136 -86
- package/lib/table/components/ToolBar/FullScreenIcon.js +74 -10
- package/lib/table/components/ToolBar/Fullscreen.js +35 -25
- package/lib/table/components/ToolBar/RefreshIcon.js +36 -164
- package/lib/table/components/ToolBar/index.d.ts +1 -1
- package/lib/table/components/ToolBar/index.js +47 -133
- package/lib/table/components/ToolBar/index.scss +3 -49
- package/lib/table/index.js +445 -454
- package/lib/table/index.scss +0 -8
- package/lib/table/typing.d.ts +6 -125
- package/lib/table/utils/columnRender.d.ts +3 -3
- package/lib/table/utils/columnRender.js +92 -39
- package/lib/table/utils/genProColumnToColumn.d.ts +2 -2
- package/lib/table/utils/genProColumnToColumn.js +21 -13
- package/lib/table/utils/getTableProps.js +2 -0
- package/lib/table/utils/getTableSortIcons.js +5 -0
- package/lib/table/utils/index.js +55 -12
- package/lib/table/utils/pureColumnRender.js +64 -21
- package/lib/table/utils/pureGenProColumnToColumn.d.ts +1 -1
- package/lib/table/utils/pureGenProColumnToColumn.js +11 -2
- package/lib/table/utils/useTableSelection.js +35 -6
- package/lib/templates/Detail/index.js +5 -0
- package/lib/templates/Form/index.js +5 -0
- package/lib/templates/List/index.js +19 -2
- package/lib/templates/index.js +6 -0
- package/lib/timeline/ProTimeLineItem/index.js +76 -25
- package/lib/timeline/index.js +33 -8
- package/lib/timeline/typing.d.ts +0 -1
- package/lib/utils/index.js +6 -0
- package/lib/utils/message.d.ts +2 -2
- package/lib/utils/message.js +10 -0
- package/package.json +1 -1
- package/dist/pro.all.min.css +0 -1
- package/dist/pro.xconsole.min.css +0 -1
- package/es/actions/quick.d.ts +0 -2
- package/es/actions/quick.js +0 -26
- package/es/card/xconsole.scss +0 -3
- package/es/form/ProForm/addCascadeEffect.d.ts +0 -2
- package/es/form/ProForm/addCascadeEffect.js +0 -203
- package/es/next-xconsole.scss +0 -34
- package/es/page-header/xconsole.scss +0 -5
- package/es/table/components/CardView/index.d.ts +0 -5
- package/es/table/components/CardView/index.js +0 -392
- package/es/table/components/CardView/index.scss +0 -46
- package/es/table/components/LoadMore/index.d.ts +0 -20
- package/es/table/components/LoadMore/index.js +0 -88
- package/es/table/components/LoadMore/index.scss +0 -19
- package/es/table/components/ToolBar/CardSwitch.d.ts +0 -8
- package/es/table/components/ToolBar/CardSwitch.js +0 -52
- package/es/table/utils/util.d.ts +0 -5
- package/es/table/utils/util.js +0 -19
- package/es/xconsole.scss +0 -503
- package/lib/actions/quick.d.ts +0 -2
- package/lib/actions/quick.js +0 -33
- package/lib/card/xconsole.scss +0 -3
- package/lib/form/ProForm/addCascadeEffect.d.ts +0 -2
- package/lib/form/ProForm/addCascadeEffect.js +0 -210
- package/lib/next-xconsole.scss +0 -34
- package/lib/page-header/xconsole.scss +0 -5
- package/lib/table/components/CardView/index.d.ts +0 -5
- package/lib/table/components/CardView/index.js +0 -402
- package/lib/table/components/CardView/index.scss +0 -46
- package/lib/table/components/LoadMore/index.d.ts +0 -20
- package/lib/table/components/LoadMore/index.js +0 -99
- package/lib/table/components/LoadMore/index.scss +0 -19
- package/lib/table/components/ToolBar/CardSwitch.d.ts +0 -8
- package/lib/table/components/ToolBar/CardSwitch.js +0 -60
- package/lib/table/utils/util.d.ts +0 -5
- package/lib/table/utils/util.js +0 -25
- package/lib/xconsole.scss +0 -503
package/es/table/index.scss
CHANGED
@@ -89,14 +89,6 @@ $fullscreenPadding: 24px;
|
|
89
89
|
color: var(--table-sort-color-current, #0064c8);
|
90
90
|
}
|
91
91
|
}
|
92
|
-
.next-table-empty {
|
93
|
-
padding: 0;
|
94
|
-
}
|
95
|
-
.next-table-wrap-empty {
|
96
|
-
.next-table-body tr td{
|
97
|
-
border-bottom: 0;
|
98
|
-
}
|
99
|
-
}
|
100
92
|
}
|
101
93
|
|
102
94
|
.teamix-pro-table-footer-suction {
|
package/es/table/typing.d.ts
CHANGED
@@ -2,14 +2,13 @@
|
|
2
2
|
* ProTable 类型定义
|
3
3
|
*/
|
4
4
|
import { ColumnProps, TableProps } from '@alicloudfe/components/types/table';
|
5
|
-
import { ProFieldType, ProFieldRenderProps, ProFieldDataSourceItem
|
5
|
+
import { ProFieldType, ProFieldRenderProps, ProFieldDataSourceItem } from '../field';
|
6
6
|
import { QueryFilterProps, ProFormType } from '../form';
|
7
7
|
import { ProActionGroupProps, ProActionButtonProps } from '../actions';
|
8
8
|
import { PaginationProps } from '@alicloudfe/components/types/pagination';
|
9
9
|
import { HeaderProps as ProTableHeaderProps } from '../field';
|
10
|
-
import { Method
|
10
|
+
import { Method } from 'axios';
|
11
11
|
import React from 'react';
|
12
|
-
import { ProCardProps } from '../card';
|
13
12
|
declare type IFieldRenderProps = keyof ProFieldRenderProps;
|
14
13
|
/** 列record函数 */
|
15
14
|
declare type ProTableCellFunProp = (value: any, index: number, record: any, ...others: any) => any;
|
@@ -58,11 +57,9 @@ export declare type ProTableColumnProps = {
|
|
58
57
|
dataIndex?: string | string[];
|
59
58
|
/** 指定 valueType 为日期时间格式时,可以格式化日期时间 */
|
60
59
|
format?: string;
|
61
|
-
/** 多级表头 **/
|
62
|
-
children?: ProTableColumnProps[];
|
63
60
|
/** ProField 其他配置项 */
|
64
61
|
props?: any;
|
65
|
-
} & Omit<ColumnProps, 'filters' | 'dataIndex' | 'filtersMode'
|
62
|
+
} & Omit<ColumnProps, 'filters' | 'dataIndex' | 'filtersMode'>;
|
66
63
|
export declare type ProColumnProps = ProTableColumnProps;
|
67
64
|
export declare type ProTableProps = {
|
68
65
|
/** ProColums 定义,取代 Table 的 columns */
|
@@ -78,9 +75,9 @@ export declare type ProTableProps = {
|
|
78
75
|
/** sort 排序请求参数处理函数 */
|
79
76
|
formatSort?: (sort: object) => object;
|
80
77
|
/** 如需自定义调用参数格式,则可以设定此值在请求前对 params 进行自定义,如果返回false则可以阻止请求 */
|
81
|
-
formatParams?: (
|
78
|
+
formatParams?: (params: any) => typeof params;
|
82
79
|
/** 对返回值的 data,total 进行映射处理 */
|
83
|
-
formatResult?: TDataService | ((res: any) => TDataService)
|
80
|
+
formatResult?: TDataService | ((res: any) => TDataService);
|
84
81
|
/** 请求成功后经过 formatResult 转换后的回调 */
|
85
82
|
onFormatResult?: (data: any[]) => void;
|
86
83
|
/** 是否第一次加载时就发起请求 */
|
@@ -89,8 +86,6 @@ export declare type ProTableProps = {
|
|
89
86
|
onSuccess?: (res: any) => void;
|
90
87
|
/** 内部请求失败时的回调 */
|
91
88
|
onError?: (error: Error) => void;
|
92
|
-
/** 自定义的请求配置 */
|
93
|
-
requestConfig?: AxiosRequestConfig;
|
94
89
|
/** 翻页页数的请求参数名 */
|
95
90
|
pageKey?: string;
|
96
91
|
/** 翻页器页数对应字段 */
|
@@ -131,15 +126,7 @@ export declare type ProTableProps = {
|
|
131
126
|
/** 非全屏模式下是否吸底 默认状态下取用 ProPageContainer 作为参照物。如果传入了 Dom,则取用 Dom 作为参照物 */
|
132
127
|
footerSuction?: boolean | Element;
|
133
128
|
/** 当满足条件时开启自动刷新,返回值为自动刷新间隔时间,如果返回 0 或 false 则停止自动刷新,每次触发翻页、搜索都将重置时间 */
|
134
|
-
autoRefresh?: (
|
135
|
-
/** 自动刷新配置 */
|
136
|
-
autoRefreshProps?: {
|
137
|
-
/** 可选间隔列表 **/
|
138
|
-
dataSource?: {
|
139
|
-
label?: React.ReactNode;
|
140
|
-
value?: number;
|
141
|
-
}[];
|
142
|
-
};
|
129
|
+
autoRefresh?: (dataSource: any[]) => number | boolean;
|
143
130
|
/** 自定义请求方法,必需返回 success,data 字段,如果需要手动分页 total 也是必需的 */
|
144
131
|
customRequest?: (params: any) => Promise<{
|
145
132
|
success: boolean;
|
@@ -158,20 +145,6 @@ export declare type ProTableProps = {
|
|
158
145
|
context?: any;
|
159
146
|
/** 是否固定表格主体(开启后横向滚动条会固定在底部) */
|
160
147
|
fixedTableBody?: boolean;
|
161
|
-
/** 用于埋点 */
|
162
|
-
'data-teamix-spm'?: string;
|
163
|
-
/** 是否切换卡片视角 **/
|
164
|
-
switchCardView?: boolean;
|
165
|
-
/** 卡片视角配置 **/
|
166
|
-
cardViewProps?: ProTableCardProps;
|
167
|
-
/** 默认展示维度 **/
|
168
|
-
defaultView?: 'table' | 'card';
|
169
|
-
/** 空状态配置 **/
|
170
|
-
emptyProps?: EmptyContentProps;
|
171
|
-
/** 是否绑定 url **/
|
172
|
-
bindUrl?: boolean;
|
173
|
-
/** 绑定 url 配置 **/
|
174
|
-
bindUrlProps?: ProTableBindUrlProps;
|
175
148
|
} & Omit<TableProps, 'columns'> & ProTableTopAreaProps;
|
176
149
|
export declare type rowSelectionType = {
|
177
150
|
getProps?: (record: any, index: number) => any;
|
@@ -228,7 +201,6 @@ export declare type ProTableActionType = {
|
|
228
201
|
};
|
229
202
|
/** 重置翻页器为1,不发送请求 */
|
230
203
|
resetPage?: () => void;
|
231
|
-
nextPage?: () => void;
|
232
204
|
/** 获取数据过滤区表单实例 */
|
233
205
|
dataFilterForm?: ProFormType;
|
234
206
|
/** 用于在 mount 的时候获取到表单 ref */
|
@@ -238,15 +210,6 @@ export declare type ProTableActionType = {
|
|
238
210
|
filterEnableRef?: any;
|
239
211
|
/** 表格当前的数据 */
|
240
212
|
data?: any[];
|
241
|
-
/** 切换视角 **/
|
242
|
-
switchView?: (view: 'card' | 'table') => void;
|
243
|
-
/** 设置数据源 **/
|
244
|
-
setData?: (data: any[]) => void;
|
245
|
-
setCardViewScrollPosition?: (scrollTop: number) => void;
|
246
|
-
/** 刷新定时器间隔时间 */
|
247
|
-
setAutoRefreshTimers?: (timers: number) => void;
|
248
|
-
/** 清除刷新定时器 */
|
249
|
-
clearAutoRefreshTimers?: () => void;
|
250
213
|
} & ProTableActionTypeMutations;
|
251
214
|
/** action State 定义 */
|
252
215
|
export declare type ProTableActionTypeMutations = {
|
@@ -293,8 +256,6 @@ export declare type ProTableTopAreaProps = {
|
|
293
256
|
mainAction?: ProActionGroupProps | React.ReactNode;
|
294
257
|
/** 工具栏区 */
|
295
258
|
toolBar?: boolean | ProTableToolBarItem[];
|
296
|
-
/** 是否开启工具栏自适应 */
|
297
|
-
toolBarAutoWidth?: boolean;
|
298
259
|
/** 快捷操作区 */
|
299
260
|
extra?: ProActionButtonProps | React.ReactNode | React.ReactNode[];
|
300
261
|
/** 数据过滤区 */
|
@@ -313,14 +274,6 @@ export declare type ProTableLayoutProps = {
|
|
313
274
|
actionRef: React.MutableRefObject<ProTableActionType | undefined>;
|
314
275
|
columns?: ProTableColumnProps[];
|
315
276
|
rowSelection?: innerRowSelectionType | rowSelectionType;
|
316
|
-
fullScreenState?: boolean;
|
317
|
-
dataTeamixSpm?: string;
|
318
|
-
switchCardView?: boolean;
|
319
|
-
defaultView?: 'table' | 'card';
|
320
|
-
autoRefresh?: ProTableProps['autoRefresh'];
|
321
|
-
autoRefreshProps?: ProTableProps['autoRefreshProps'];
|
322
|
-
bindUrl?: ProTableProps['bindUrl'];
|
323
|
-
bindUrlProps?: ProTableProps['bindUrlProps'];
|
324
277
|
} & ProTableTopAreaProps;
|
325
278
|
/** columns 列过滤 */
|
326
279
|
export declare type ProTableColumnsFilterItemProps = {
|
@@ -343,76 +296,4 @@ export declare type parentPositionProps = {
|
|
343
296
|
offsetLeft: number;
|
344
297
|
offsetRight: number;
|
345
298
|
};
|
346
|
-
/** card props **/
|
347
|
-
export declare type ProTableCardProps = {
|
348
|
-
/** 标题 dataIndex **/
|
349
|
-
title?: (ProTableColumnProps['dataIndex'] | ProTableColumnProps) | ((index: number, record: any) => ProTableColumnProps['dataIndex'] | ProTableColumnProps);
|
350
|
-
/** 副标题 dataIndex **/
|
351
|
-
subTitle?: (ProTableColumnProps['dataIndex'] | ProTableColumnProps) | ((index: number, record: any) => ProTableColumnProps['dataIndex'] | ProTableColumnProps);
|
352
|
-
/** 内容区域 dataIndex **/
|
353
|
-
content?: (ProTableColumnProps['dataIndex'] | ProTableColumnProps)[] | ((index: number, record: any) => (ProTableColumnProps['dataIndex'] | ProTableColumnProps)[]);
|
354
|
-
/** extra 区域 **/
|
355
|
-
extra?: (ProActionGroupProps | React.ReactNode | ProTableColumnProps['dataIndex'])[] | ((index: number, record: any) => (ProActionGroupProps | React.ReactNode | ProTableColumnProps['dataIndex'])[]);
|
356
|
-
/** 标签区域 **/
|
357
|
-
tags?: (ProTableColumnProps['dataIndex'] | ProTableColumnProps)[] | ((index: number, record: any) => (ProTableColumnProps['dataIndex'] | ProTableColumnProps)[]);
|
358
|
-
/** 分页器条数 **/
|
359
|
-
pageSize?: 12 | 24 | 48 | 96 | number;
|
360
|
-
/** 卡片区域滚动高度 **/
|
361
|
-
scrollHeight?: number | string;
|
362
|
-
/** 自动加载下一页 **/
|
363
|
-
autoLoadNextPage?: boolean;
|
364
|
-
/** 滚动容器 用于监听触底事件 **/
|
365
|
-
scrollDom?: HTMLElement;
|
366
|
-
/** 触底事件 **/
|
367
|
-
onScrollBottom?: () => void;
|
368
|
-
/** 使用表格分页 **/
|
369
|
-
useTablePagination?: boolean;
|
370
|
-
/** 使用响应式 **/
|
371
|
-
cardResponsiveProps?: {
|
372
|
-
xxs?: number;
|
373
|
-
xs?: number;
|
374
|
-
s?: number;
|
375
|
-
m?: number;
|
376
|
-
l?: number;
|
377
|
-
xl?: number;
|
378
|
-
};
|
379
|
-
/** 卡片配置 **/
|
380
|
-
cardProps?: {
|
381
|
-
[key in keyof ProCardProps]?: ProCardProps[key] | ((index: number, record: any) => ProCardProps[key]);
|
382
|
-
};
|
383
|
-
/** 是否展示卡片骨架 **/
|
384
|
-
showSkeleton?: boolean;
|
385
|
-
};
|
386
|
-
/** card 视角 Props (内部组件) **/
|
387
|
-
export declare type ProTableCardViewProps = {
|
388
|
-
/** 卡片视角配置 **/
|
389
|
-
cardViewProps?: ProTableCardProps;
|
390
|
-
/** 数据源 **/
|
391
|
-
dataSource?: any[];
|
392
|
-
/** 原始 columns **/
|
393
|
-
originColumns?: any[];
|
394
|
-
/** 处理过后的 columns **/
|
395
|
-
columns?: any[];
|
396
|
-
/** 加载动画 **/
|
397
|
-
loading?: boolean;
|
398
|
-
/** 上下文 **/
|
399
|
-
context?: any;
|
400
|
-
actionRef?: React.MutableRefObject<ProTableActionType | undefined>;
|
401
|
-
/** 卡片区域滚动高度 **/
|
402
|
-
scrollHeight?: number | string;
|
403
|
-
/** 骨架屏状态 **/
|
404
|
-
showSkeleton?: boolean;
|
405
|
-
/** ProCard 卡片配置 **/
|
406
|
-
cardProps?: ProTableCardProps['cardProps'];
|
407
|
-
/** 表格分页器参数 **/
|
408
|
-
tablePaginationProps?: PaginationProps;
|
409
|
-
};
|
410
|
-
export declare type ProTableBindUrlProps = {
|
411
|
-
/** 翻页器区域 **/
|
412
|
-
pagination?: boolean;
|
413
|
-
/** 搜索区域 **/
|
414
|
-
filters?: boolean;
|
415
|
-
/** 表格标题过滤器区域 **/
|
416
|
-
headerFilters?: boolean;
|
417
|
-
};
|
418
299
|
export {};
|
@@ -2,12 +2,12 @@
|
|
2
2
|
* 渲染列的逻辑函数
|
3
3
|
*/
|
4
4
|
import React from 'react';
|
5
|
-
import { ProTableColumnProps, ProTableActionType
|
5
|
+
import { ProTableColumnProps, ProTableActionType } from '../typing';
|
6
6
|
/**
|
7
7
|
* 增加了 icon 的功能 render title
|
8
8
|
*/
|
9
|
-
export declare const renderColumnsTitle: (item: ProTableColumnProps, actionRef: React.MutableRefObject<ProTableActionType | undefined
|
9
|
+
export declare const renderColumnsTitle: (item: ProTableColumnProps, actionRef: React.MutableRefObject<ProTableActionType | undefined>) => JSX.Element;
|
10
10
|
/**
|
11
11
|
* 负责单元格的具体渲染
|
12
12
|
*/
|
13
|
-
export declare const renderCell: (value: any, item: ProTableColumnProps, index: number, record: any, actionRef: React.MutableRefObject<ProTableActionType | undefined>, context?: any
|
13
|
+
export declare const renderCell: (value: any, item: ProTableColumnProps, index: number, record: any, actionRef: React.MutableRefObject<ProTableActionType | undefined>, context?: any) => JSX.Element;
|
@@ -1,16 +1,29 @@
|
|
1
1
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
2
|
+
|
2
3
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
4
|
+
|
3
5
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
6
|
+
|
4
7
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
8
|
+
|
5
9
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
10
|
+
|
6
11
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
12
|
+
|
7
13
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
14
|
+
|
8
15
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
16
|
+
|
9
17
|
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
18
|
+
|
10
19
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
20
|
+
|
11
21
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
22
|
+
|
12
23
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
24
|
+
|
13
25
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
26
|
+
|
14
27
|
/**
|
15
28
|
* 渲染列的逻辑函数
|
16
29
|
*/
|
@@ -22,28 +35,36 @@ import Filter from '../components/Filter';
|
|
22
35
|
/**
|
23
36
|
* 增加了 icon 的功能 render title
|
24
37
|
*/
|
25
|
-
|
38
|
+
|
39
|
+
export var renderColumnsTitle = function renderColumnsTitle(item, actionRef) {
|
26
40
|
var filterMode = item.filterMode,
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
41
|
+
filters = item.filters,
|
42
|
+
dataSource = item.dataSource,
|
43
|
+
dataIndex = item.dataIndex,
|
44
|
+
valueType = item.valueType; // 为列过滤添加状态标题
|
45
|
+
|
32
46
|
var getItemLabel = function getItemLabel() {
|
33
47
|
if (filters && filterMode !== 'multiple') {
|
34
48
|
var _actionRef$current$ge, _actionRef$current, _actionRef$current$ge2;
|
49
|
+
|
35
50
|
var selectedItem = (_actionRef$current$ge = (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$ge2 = _actionRef$current.getState) === null || _actionRef$current$ge2 === void 0 ? void 0 : _actionRef$current$ge2.call(_actionRef$current).filterRules) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : {};
|
51
|
+
|
36
52
|
if (Object.keys(selectedItem).length > 0) {
|
37
53
|
var _selectedItem$dataInd;
|
54
|
+
|
38
55
|
if ((_selectedItem$dataInd = selectedItem[dataIndex]) === null || _selectedItem$dataInd === void 0 ? void 0 : _selectedItem$dataInd.params) {
|
39
56
|
var _targetFilters$find;
|
57
|
+
|
40
58
|
// 找到对应的 label
|
41
59
|
var targetFilters = filters !== null && filters !== void 0 ? filters : [];
|
60
|
+
|
42
61
|
if (filters === true) {
|
43
62
|
targetFilters = dataSource !== null && dataSource !== void 0 ? dataSource : [];
|
44
63
|
}
|
64
|
+
|
45
65
|
var label = (_targetFilters$find = targetFilters.find(function (item) {
|
46
66
|
var _selectedItem$dataInd2;
|
67
|
+
|
47
68
|
return item.value === ((_selectedItem$dataInd2 = selectedItem[dataIndex]) === null || _selectedItem$dataInd2 === void 0 ? void 0 : _selectedItem$dataInd2.params);
|
48
69
|
})) === null || _targetFilters$find === void 0 ? void 0 : _targetFilters$find.label;
|
49
70
|
var value = "".concat(item.title, " (").concat(label, ")");
|
@@ -61,6 +82,7 @@ export var renderColumnsTitle = function renderColumnsTitle(item, actionRef, bin
|
|
61
82
|
}
|
62
83
|
}
|
63
84
|
}
|
85
|
+
|
64
86
|
return /*#__PURE__*/React.createElement(ProField, {
|
65
87
|
style: {
|
66
88
|
display: 'inline-flex'
|
@@ -73,36 +95,37 @@ export var renderColumnsTitle = function renderColumnsTitle(item, actionRef, bin
|
|
73
95
|
}
|
74
96
|
});
|
75
97
|
};
|
98
|
+
|
76
99
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelIconTip, {
|
77
100
|
label: item.title,
|
78
101
|
tooltip: item.tooltip,
|
79
102
|
icon: item.tooltipIcon
|
80
103
|
}), item.filters && /*#__PURE__*/React.createElement(Filter, {
|
81
104
|
column: item,
|
82
|
-
actionRef: actionRef
|
83
|
-
bindUrl: bindUrl,
|
84
|
-
bindUrlProps: bindUrlProps
|
105
|
+
actionRef: actionRef
|
85
106
|
}));
|
86
107
|
};
|
87
108
|
/**
|
88
109
|
* 负责单元格的具体渲染
|
89
110
|
*/
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
111
|
+
|
112
|
+
export var renderCell = function renderCell(value, item, index, record, actionRef,
|
113
|
+
/** 接收外部比如 dialog-table 传过来的 context,用于弹窗关闭等 */
|
114
|
+
context) {
|
94
115
|
var _actionSchema$actions;
|
116
|
+
|
95
117
|
var _item$valueType = item.valueType,
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
118
|
+
valueType = _item$valueType === void 0 ? 'text' : _item$valueType,
|
119
|
+
render = item.render,
|
120
|
+
actionSchema = item.actionSchema,
|
121
|
+
dataIndex = item.dataIndex,
|
122
|
+
format = item.format; // 如果没传 dataIndex,返回 null
|
123
|
+
|
102
124
|
if (!dataIndex) {
|
103
125
|
value = null;
|
104
|
-
}
|
105
|
-
|
126
|
+
} // 处理 dataIndex 为数组的情况
|
127
|
+
|
128
|
+
|
106
129
|
if (Array.isArray(dataIndex)) {
|
107
130
|
value = dataIndex.map(function (item) {
|
108
131
|
return getTargetValue("{{".concat(item, "}}"), _objectSpread(_objectSpread({}, record), {}, {
|
@@ -110,16 +133,18 @@ dataTeamixSpm) {
|
|
110
133
|
}));
|
111
134
|
});
|
112
135
|
}
|
136
|
+
|
113
137
|
var newRender = null;
|
114
138
|
var newDataSource = null;
|
115
|
-
var props = item.props;
|
116
|
-
|
139
|
+
var props = item.props; // 如果 render 直接传函数
|
140
|
+
|
117
141
|
if (typeof render === 'function') {
|
118
142
|
newRender = function newRender() {
|
119
143
|
return render === null || render === void 0 ? void 0 : render(value, index, record);
|
120
144
|
};
|
121
145
|
} else {
|
122
146
|
newRender = processBuriedPoint(processRenderFunction(render, value, index, record), record, value, index);
|
147
|
+
|
123
148
|
if (valueType === 'selectGroup') {
|
124
149
|
newRender = _objectSpread(_objectSpread({
|
125
150
|
maxShowNumber: 'auto',
|
@@ -136,13 +161,15 @@ dataTeamixSpm) {
|
|
136
161
|
}
|
137
162
|
}, props);
|
138
163
|
}
|
164
|
+
|
139
165
|
if ((render === null || render === void 0 ? void 0 : render.type) === 'step') {
|
140
166
|
newRender = _objectSpread(_objectSpread({}, newRender), {}, {
|
141
167
|
ellipsis: false
|
142
168
|
});
|
143
169
|
}
|
144
|
-
}
|
145
|
-
|
170
|
+
} // 渲染操作组
|
171
|
+
|
172
|
+
|
146
173
|
if (actionSchema && ((_actionSchema$actions = actionSchema.actions) === null || _actionSchema$actions === void 0 ? void 0 : _actionSchema$actions.length)) {
|
147
174
|
// 默认 context
|
148
175
|
var defaultContext = _objectSpread({
|
@@ -151,24 +178,28 @@ dataTeamixSpm) {
|
|
151
178
|
record: record,
|
152
179
|
action: actionRef.current
|
153
180
|
}, context);
|
181
|
+
|
154
182
|
return /*#__PURE__*/React.createElement(ProActionGroup, _objectSpread(_objectSpread({
|
155
183
|
type: "text"
|
156
184
|
}, actionSchema), {}, {
|
157
|
-
context: _objectSpread(_objectSpread({}, defaultContext), actionSchema.context)
|
158
|
-
"data-teamix-spm": dataTeamixSpm ? "".concat(dataTeamixSpm, "-columnAction") : undefined
|
185
|
+
context: _objectSpread(_objectSpread({}, defaultContext), actionSchema.context)
|
159
186
|
}));
|
160
|
-
}
|
161
|
-
|
187
|
+
} // dataSource可传函数
|
188
|
+
|
189
|
+
|
162
190
|
if (typeof item.dataSource === 'function') {
|
163
191
|
var _item$dataSource;
|
192
|
+
|
164
193
|
newDataSource = (_item$dataSource = item.dataSource) === null || _item$dataSource === void 0 ? void 0 : _item$dataSource.call(item, value, index, record);
|
165
194
|
} else {
|
166
195
|
var _item$dataSource2;
|
196
|
+
|
167
197
|
newDataSource = ((_item$dataSource2 = item.dataSource) !== null && _item$dataSource2 !== void 0 ? _item$dataSource2 : []).map(function (item) {
|
168
198
|
return Object.fromEntries(Object.entries(item).map(function (_ref) {
|
169
199
|
var _ref2 = _slicedToArray(_ref, 2),
|
170
|
-
|
171
|
-
|
200
|
+
k = _ref2[0],
|
201
|
+
v = _ref2[1];
|
202
|
+
|
172
203
|
return [k, getTargetValue(v, _objectSpread(_objectSpread({}, record), {}, {
|
173
204
|
record: record,
|
174
205
|
value: value,
|
@@ -176,8 +207,9 @@ dataTeamixSpm) {
|
|
176
207
|
}))];
|
177
208
|
}));
|
178
209
|
});
|
179
|
-
}
|
180
|
-
|
210
|
+
} // 渲染 ProField
|
211
|
+
|
212
|
+
|
181
213
|
return /*#__PURE__*/React.createElement(ProField, _objectSpread({
|
182
214
|
type: valueType || 'text',
|
183
215
|
value: value,
|
@@ -194,6 +226,7 @@ dataTeamixSpm) {
|
|
194
226
|
* @param record table cell record
|
195
227
|
* @returns
|
196
228
|
*/
|
229
|
+
|
197
230
|
var processRenderFunction = function processRenderFunction() {
|
198
231
|
var render = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
199
232
|
var value = arguments.length > 1 ? arguments[1] : undefined;
|
@@ -203,20 +236,25 @@ var processRenderFunction = function processRenderFunction() {
|
|
203
236
|
var external = ['linkOnClick', 'link', 'value', 'renderEdit', 'descriptionRenderEdit', 'editPopConfirmProps', 'descriptionEditPopConfirmProps', 'editOnClick', 'descriptionEditOnClick', 'extra', 'prefixExtra'];
|
204
237
|
return Object.fromEntries(Object.entries(render).map(function (_ref3) {
|
205
238
|
var _ref4 = _slicedToArray(_ref3, 2),
|
206
|
-
|
207
|
-
|
239
|
+
k = _ref4[0],
|
240
|
+
v = _ref4[1];
|
241
|
+
|
208
242
|
if (typeof v === 'function') {
|
209
243
|
var _v;
|
244
|
+
|
210
245
|
if (external.includes(k)) {
|
211
246
|
return [k, function () {
|
212
247
|
for (var _len = arguments.length, others = new Array(_len), _key = 0; _key < _len; _key++) {
|
213
248
|
others[_key] = arguments[_key];
|
214
249
|
}
|
250
|
+
|
215
251
|
return v === null || v === void 0 ? void 0 : v.apply(void 0, [value, index, record].concat(others));
|
216
252
|
}];
|
217
253
|
}
|
254
|
+
|
218
255
|
return [k, (_v = v === null || v === void 0 ? void 0 : v(value, index, record)) !== null && _v !== void 0 ? _v : ''];
|
219
256
|
}
|
257
|
+
|
220
258
|
return [k, v];
|
221
259
|
}));
|
222
260
|
};
|
@@ -226,18 +264,20 @@ var processRenderFunction = function processRenderFunction() {
|
|
226
264
|
* @param record table cell record
|
227
265
|
* @returns
|
228
266
|
*/
|
267
|
+
|
268
|
+
|
229
269
|
var processBuriedPoint = function processBuriedPoint() {
|
230
270
|
var render = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
231
271
|
var record = arguments.length > 1 ? arguments[1] : undefined;
|
232
272
|
var value = arguments.length > 2 ? arguments[2] : undefined;
|
233
273
|
var index = arguments.length > 3 ? arguments[3] : undefined;
|
234
|
-
return Object.fromEntries([
|
235
|
-
// 默认 ellipsis、descriptionEllipsis 为 true
|
274
|
+
return Object.fromEntries([// 默认 ellipsis、descriptionEllipsis 为 true
|
236
275
|
// emptyText 默认为 '-'
|
237
276
|
['ellipsis', true], ['descriptionEllipsis', true], ['emptyText', '-']].concat(_toConsumableArray(Object.entries(render).map(function (_ref5) {
|
238
277
|
var _ref6 = _slicedToArray(_ref5, 2),
|
239
|
-
|
240
|
-
|
278
|
+
k = _ref6[0],
|
279
|
+
v = _ref6[1];
|
280
|
+
|
241
281
|
return [k, getTargetValue(v, _objectSpread(_objectSpread({}, record), {}, {
|
242
282
|
record: record,
|
243
283
|
value: value,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import { ProTableColumnProps, ProTableActionType
|
2
|
+
import { ProTableColumnProps, ProTableActionType } from '../typing';
|
3
3
|
import { ColumnProps } from '@alicloudfe/components/types/table';
|
4
4
|
declare type FixedColumnProps = ColumnProps & {
|
5
5
|
wordBreak?: string;
|
@@ -9,5 +9,5 @@ declare type FixedColumnProps = ColumnProps & {
|
|
9
9
|
*/
|
10
10
|
export default function genProColumnToColumn(columns: ProTableColumnProps[],
|
11
11
|
/** 是否渲染骨架屏 */
|
12
|
-
showSkeleton: boolean, actionRef: React.MutableRefObject<ProTableActionType | undefined>, context?: any
|
12
|
+
showSkeleton: boolean, actionRef: React.MutableRefObject<ProTableActionType | undefined>, context?: any): FixedColumnProps[];
|
13
13
|
export {};
|
@@ -1,9 +1,15 @@
|
|
1
|
-
var _excluded = ["filters", "dataIndex"
|
1
|
+
var _excluded = ["filters", "dataIndex"];
|
2
|
+
|
2
3
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
4
|
+
|
3
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
6
|
+
|
4
7
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
8
|
+
|
5
9
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
10
|
+
|
6
11
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
12
|
+
|
7
13
|
import React from 'react';
|
8
14
|
import { renderColumnsTitle, renderCell } from './columnRender';
|
9
15
|
import { ProSkeletonRaw as Skeleton } from '../../skeleton';
|
@@ -11,19 +17,16 @@ import { getLanguage } from '@teamix/utils';
|
|
11
17
|
/**
|
12
18
|
* ProColumn => Column
|
13
19
|
*/
|
14
|
-
|
20
|
+
|
21
|
+
export default function genProColumnToColumn(columns,
|
22
|
+
/** 是否渲染骨架屏 */
|
15
23
|
showSkeleton, actionRef) {
|
16
24
|
var context = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
17
|
-
var
|
18
|
-
// 用于埋点
|
19
|
-
dataTeamixSpm = arguments.length > 4 ? arguments[4] : undefined;
|
20
|
-
var bindUrl = arguments.length > 5 ? arguments[5] : undefined;
|
21
|
-
var bindUrlProps = arguments.length > 6 ? arguments[6] : undefined;
|
22
25
|
return columns.map(function (columnProps) {
|
23
26
|
var filters = columnProps.filters,
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
+
dataIndex = columnProps.dataIndex,
|
28
|
+
others = _objectWithoutProperties(columnProps, _excluded);
|
29
|
+
|
27
30
|
if (showSkeleton) {
|
28
31
|
return _objectSpread(_objectSpread({}, others), {}, {
|
29
32
|
filters: undefined,
|
@@ -35,16 +38,16 @@ showSkeleton, actionRef) {
|
|
35
38
|
}
|
36
39
|
});
|
37
40
|
}
|
41
|
+
|
38
42
|
return _objectSpread(_objectSpread({
|
39
43
|
// 金钱样式默认右对齐
|
40
44
|
align: columnProps.valueType === 'money' ? 'right' : 'left',
|
41
45
|
wordBreak: getLanguage() === 'en-us' ? 'word' : 'all'
|
42
46
|
}, others), {}, {
|
43
|
-
children: children ? genProColumnToColumn(children, showSkeleton, actionRef, context) : undefined,
|
44
47
|
dataIndex: dataIndex === null || dataIndex === void 0 ? void 0 : dataIndex.toString(),
|
45
|
-
title: renderColumnsTitle(columnProps, actionRef
|
48
|
+
title: renderColumnsTitle(columnProps, actionRef),
|
46
49
|
cell: function cell(value, index, record) {
|
47
|
-
return renderCell(value, columnProps, index, record, actionRef, context
|
50
|
+
return renderCell(value, columnProps, index, record, actionRef, context);
|
48
51
|
}
|
49
52
|
});
|
50
53
|
});
|