@teamix/pro 1.4.25-bugfix → 1.4.25-bugfix.2
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.all.min.css +1 -0
- package/dist/pro.css +1 -1
- package/dist/pro.js +78506 -59443
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/dist/pro.min.js.LICENSE.txt +13 -6
- package/dist/pro.xconsole.min.css +1 -0
- package/es/actions/base.js +8 -21
- package/es/actions/dialog-component.js +2 -9
- package/es/actions/dialog-form.js +37 -75
- package/es/actions/dialog-info.js +1 -5
- package/es/actions/dialog.js +57 -95
- package/es/actions/index.d.ts +7 -0
- package/es/actions/index.js +93 -153
- package/es/actions/index.scss +6 -1
- package/es/actions/link.js +3 -5
- package/es/actions/quick.d.ts +2 -0
- package/es/actions/quick.js +26 -0
- package/es/actions/request.js +12 -27
- package/es/actions/utils.js +1 -9
- package/es/card/card-container.js +0 -5
- package/es/card/divider.js +0 -5
- package/es/card/index.js +61 -100
- package/es/card/index.scss +15 -0
- package/es/card/selectable.js +4 -13
- package/es/card/tab.js +1 -10
- package/es/card/utils.js +0 -2
- package/es/card/xconsole.scss +3 -0
- package/es/form/Components/Editable/index.js +16 -55
- package/es/form/Components/FormGroup/index.d.ts +1 -0
- package/es/form/Components/FormGroup/index.js +7 -22
- package/es/form/Components/LightFilter/index.js +15 -35
- package/es/form/Components/ProField/index.js +2 -14
- package/es/form/Components/ProField/mapDateFormat.js +2 -28
- package/es/form/Components/Text/index.d.ts +1 -0
- package/es/form/Components/Text/index.js +2 -11
- package/es/form/Filter/AdvancedFilter.js +11 -26
- package/es/form/Filter/Layout.js +11 -24
- package/es/form/Filter/LightFilter.js +13 -24
- package/es/form/Filter/SimpleFilter.js +7 -21
- package/es/form/Filter/index.js +117 -171
- package/es/form/Filter/index2.js +11 -28
- package/es/form/Filter/layout.scss +1 -1
- package/es/form/Filter/useBindUrl.js +18 -46
- package/es/form/Filter/useSpecialProps.js +8 -13
- package/es/form/ProForm/addCascadeEffect.d.ts +2 -0
- package/es/form/ProForm/addCascadeEffect.js +203 -0
- package/es/form/ProForm/customComponent.js +0 -5
- package/es/form/ProForm/index.js +30 -38
- package/es/form/ProForm/useAutoLayout.js +21 -42
- package/es/form/ProForm/useAutoSubmit.js +3 -8
- package/es/form/ProForm/useFieldRequest.js +0 -5
- package/es/form/ProForm/useFormDisplayValues.js +12 -28
- package/es/form/ProForm/useInitialRequest.js +0 -5
- package/es/form/SchemaForm/adapterComponent.js +0 -3
- package/es/form/SchemaForm/adapterDecorator.d.ts +1 -1
- package/es/form/SchemaForm/adapterDecorator.js +0 -8
- package/es/form/SchemaForm/adapterType.js +0 -2
- package/es/form/SchemaForm/index.js +78 -114
- package/es/form/SchemaForm/initializeArrayCards.js +0 -6
- package/es/form/SchemaForm/initializeArrayCollapse.js +0 -6
- package/es/form/SchemaForm/initializeArrayItems.js +2 -9
- package/es/form/SchemaForm/initializeArrayTable.js +21 -34
- package/es/form/SchemaForm/initializeDataSource.js +2 -6
- package/es/form/SchemaForm/initializeFormButton.js +14 -31
- package/es/form/SchemaForm/initializeFormCollapse.js +8 -18
- package/es/form/SchemaForm/initializeFormGroup.js +10 -20
- package/es/form/SchemaForm/initializeFormStep.js +11 -23
- package/es/form/SchemaForm/initializeFormTab.js +10 -20
- package/es/form/SchemaForm/initializeReactions.js +9 -33
- package/es/form/SchemaForm/initializeRequest.js +2 -16
- package/es/form/SchemaForm/initializeRules.js +4 -22
- package/es/form/SchemaForm/initializeSelectTable.js +7 -33
- package/es/form/SchemaForm/reactions.js +19 -34
- package/es/form/docs/ActionResponse.d.ts +1 -0
- package/es/form/index.d.ts +9 -9
- package/es/form/index.js +0 -9
- package/es/form/typing.d.ts +26 -4
- package/es/form/utils.d.ts +1 -1
- package/es/form/utils.js +4 -49
- package/es/form/warning.js +2 -7
- package/es/global.scss +3 -1
- package/es/index-without-icon.js +4 -3
- package/es/index.d.ts +1 -1
- package/es/index.js +18 -8
- package/es/info/components/InfoGroup/index.js +21 -32
- package/es/info/components/InfoValueItem/index.js +66 -119
- package/es/info/components/ProInfoItem/index.js +13 -21
- package/es/info/components/baseInfo/index.js +17 -27
- package/es/info/components/headerInfo/index.js +8 -20
- package/es/info/components/tableInfo/index.js +20 -50
- package/es/info/index.js +61 -86
- package/es/info/typing.d.ts +2 -0
- package/es/info/utils/index.js +0 -11
- package/es/next-xconsole.scss +34 -0
- package/es/nocode/configurators/ProTable.js +1 -22
- package/es/nocode/configurators/common.js +5 -6
- package/es/nocode/configurators/index.js +2 -3
- package/es/nocode/index.js +6 -6
- package/es/nocode/pages/editor.js +5 -9
- package/es/nocode/pages/index.js +5 -30
- package/es/nocode/pages/playground.js +18 -35
- package/es/nocode/pages/renderer.js +9 -42
- package/es/nocode/playground.js +10 -23
- package/es/page-header/index.d.ts +2 -2
- package/es/page-header/index.js +40 -76
- package/es/page-header/index.scss +2 -1
- package/es/page-header/xconsole.scss +5 -0
- package/es/sidebar/components/sidebar-container/index.js +54 -69
- package/es/sidebar/components/sidebar-container/index.scss +21 -14
- package/es/sidebar/components/tree/index.js +100 -138
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.js +11 -26
- package/es/sidebar/components/tree-node/components/IconAction/index.js +9 -35
- package/es/sidebar/components/tree-node/components/IconSwitch/index.d.ts +2 -2
- package/es/sidebar/components/tree-node/components/IconSwitch/index.js +12 -25
- package/es/sidebar/components/tree-node/components/IconSwitch/index.scss +1 -1
- package/es/sidebar/components/tree-node/index.js +42 -84
- package/es/sidebar/components/tree-node/index.scss +6 -0
- package/es/sidebar/index.d.ts +2 -0
- package/es/sidebar/index.js +72 -95
- package/es/sidebar/typing.d.ts +4 -0
- package/es/sidebar/utils/action-ref.js +2 -7
- package/es/sidebar/utils/index.d.ts +5 -2
- package/es/sidebar/utils/index.js +41 -98
- package/es/table/components/CardView/index.d.ts +5 -0
- package/es/table/components/CardView/index.js +392 -0
- package/es/table/components/CardView/index.scss +46 -0
- package/es/table/components/Filter/index.d.ts +6 -3
- package/es/table/components/Filter/index.js +115 -128
- package/es/table/components/Layout/index.js +32 -47
- package/es/table/components/Layout/index.scss +2 -1
- package/es/table/components/LoadMore/index.d.ts +20 -0
- package/es/table/components/LoadMore/index.js +88 -0
- package/es/table/components/LoadMore/index.scss +19 -0
- package/es/table/components/Pagination/index.js +25 -58
- package/es/table/components/QuickAction/index.d.ts +1 -0
- package/es/table/components/QuickAction/index.js +3 -11
- package/es/table/components/ToolBar/CardSwitch.d.ts +8 -0
- package/es/table/components/ToolBar/CardSwitch.js +52 -0
- package/es/table/components/ToolBar/DensityIcon.js +19 -31
- package/es/table/components/ToolBar/FilterColumnIcon.js +87 -125
- package/es/table/components/ToolBar/FullScreenIcon.js +7 -62
- package/es/table/components/ToolBar/Fullscreen.js +25 -28
- package/es/table/components/ToolBar/RefreshIcon.js +162 -27
- package/es/table/components/ToolBar/index.d.ts +1 -1
- package/es/table/components/ToolBar/index.js +130 -38
- package/es/table/components/ToolBar/index.scss +49 -3
- package/es/table/index.js +455 -423
- package/es/table/index.scss +8 -0
- package/es/table/typing.d.ts +125 -6
- package/es/table/utils/columnRender.d.ts +3 -3
- package/es/table/utils/columnRender.js +39 -79
- package/es/table/utils/genProColumnToColumn.d.ts +2 -2
- package/es/table/utils/genProColumnToColumn.js +13 -16
- package/es/table/utils/index.js +14 -47
- package/es/table/utils/pureColumnRender.js +21 -53
- package/es/table/utils/pureGenProColumnToColumn.d.ts +1 -1
- package/es/table/utils/pureGenProColumnToColumn.js +2 -10
- package/es/table/utils/useTableSelection.js +6 -33
- package/es/table/utils/util.d.ts +5 -0
- package/es/table/utils/util.js +19 -0
- package/es/templates/List/index.js +2 -9
- package/es/timeline/ProTimeLineItem/index.js +25 -65
- package/es/timeline/index.js +8 -22
- package/es/timeline/typing.d.ts +1 -0
- package/es/utils/message.d.ts +2 -2
- package/es/utils/message.js +0 -5
- package/es/xconsole.scss +503 -0
- package/lib/actions/base.js +8 -24
- package/lib/actions/confirm.js +0 -5
- package/lib/actions/danger-confirm.js +0 -5
- package/lib/actions/danger-pop-confirm.js +0 -4
- package/lib/actions/dialog-component.js +2 -15
- package/lib/actions/dialog-form.js +36 -89
- package/lib/actions/dialog-info.js +1 -10
- package/lib/actions/dialog-table.js +0 -5
- package/lib/actions/dialog.js +55 -112
- package/lib/actions/drawer-form.js +0 -3
- package/lib/actions/drawer-info.js +0 -3
- package/lib/actions/drawer-table.js +0 -3
- package/lib/actions/drawer.js +0 -4
- package/lib/actions/error.js +0 -5
- package/lib/actions/index.d.ts +7 -0
- package/lib/actions/index.js +115 -184
- package/lib/actions/index.scss +6 -1
- package/lib/actions/link.js +1 -10
- package/lib/actions/notice.js +0 -5
- package/lib/actions/pop-confirm.js +0 -5
- package/lib/actions/quick.d.ts +2 -0
- package/lib/actions/quick.js +33 -0
- package/lib/actions/request.js +8 -32
- package/lib/actions/utils.js +1 -9
- package/lib/card/card-container.js +0 -9
- package/lib/card/divider.js +0 -7
- package/lib/card/index.js +61 -127
- package/lib/card/index.scss +15 -0
- package/lib/card/selectable.js +4 -20
- package/lib/card/tab.js +1 -14
- package/lib/card/utils.js +0 -6
- package/lib/card/xconsole.scss +3 -0
- package/lib/field/index.js +0 -6
- package/lib/form/Components/Editable/index.js +15 -65
- package/lib/form/Components/FormGroup/index.d.ts +1 -0
- package/lib/form/Components/FormGroup/index.js +7 -28
- package/lib/form/Components/LightFilter/index.js +15 -47
- package/lib/form/Components/ProField/index.js +2 -21
- package/lib/form/Components/ProField/mapDateFormat.js +2 -32
- package/lib/form/Components/Text/index.d.ts +1 -0
- package/lib/form/Components/Text/index.js +2 -16
- package/lib/form/Filter/AdvancedFilter.js +11 -34
- package/lib/form/Filter/Layout.js +11 -33
- package/lib/form/Filter/LightFilter.js +13 -32
- package/lib/form/Filter/SimpleFilter.js +5 -27
- package/lib/form/Filter/index.js +116 -191
- package/lib/form/Filter/index2.js +11 -38
- package/lib/form/Filter/layout.scss +1 -1
- package/lib/form/Filter/useBindUrl.js +18 -50
- package/lib/form/Filter/useSpecialProps.js +6 -13
- package/lib/form/ProForm/addCascadeEffect.d.ts +2 -0
- package/lib/form/ProForm/addCascadeEffect.js +210 -0
- package/lib/form/ProForm/customComponent.js +0 -8
- package/lib/form/ProForm/index.js +30 -60
- package/lib/form/ProForm/useAutoLayout.js +21 -45
- package/lib/form/ProForm/useAutoSubmit.js +1 -10
- package/lib/form/ProForm/useFieldRequest.js +0 -8
- package/lib/form/ProForm/useFormDisplayValues.js +12 -34
- package/lib/form/ProForm/useInitialRequest.js +0 -6
- package/lib/form/SchemaForm/adapterComponent.js +0 -6
- package/lib/form/SchemaForm/adapterDecorator.d.ts +1 -1
- package/lib/form/SchemaForm/adapterDecorator.js +0 -12
- package/lib/form/SchemaForm/adapterType.js +0 -5
- package/lib/form/SchemaForm/index.js +78 -144
- package/lib/form/SchemaForm/initializeArrayCards.js +0 -7
- package/lib/form/SchemaForm/initializeArrayCollapse.js +0 -7
- package/lib/form/SchemaForm/initializeArrayItems.js +2 -10
- package/lib/form/SchemaForm/initializeArrayTable.js +21 -34
- package/lib/form/SchemaForm/initializeDataSource.js +2 -8
- package/lib/form/SchemaForm/initializeFormButton.js +14 -32
- package/lib/form/SchemaForm/initializeFormCollapse.js +8 -18
- package/lib/form/SchemaForm/initializeFormGroup.js +10 -20
- package/lib/form/SchemaForm/initializeFormStep.js +11 -23
- package/lib/form/SchemaForm/initializeFormTab.js +10 -20
- package/lib/form/SchemaForm/initializeReactions.js +9 -37
- package/lib/form/SchemaForm/initializeRequest.js +2 -18
- package/lib/form/SchemaForm/initializeRules.js +4 -24
- package/lib/form/SchemaForm/initializeSelectTable.js +7 -36
- package/lib/form/SchemaForm/reactions.js +17 -37
- package/lib/form/docs/ActionResponse.d.ts +1 -0
- package/lib/form/docs/ActionResponse.js +0 -5
- package/lib/form/index.d.ts +9 -9
- package/lib/form/index.js +0 -25
- package/lib/form/typing.d.ts +26 -4
- package/lib/form/utils.d.ts +1 -1
- package/lib/form/utils.js +4 -61
- package/lib/form/warning.js +2 -8
- package/lib/global.scss +3 -1
- package/lib/hooks/index.js +0 -5
- package/lib/index-without-icon.js +2 -36
- package/lib/index.d.ts +1 -1
- package/lib/index.js +13 -40
- package/lib/info/components/InfoGroup/index.js +21 -42
- package/lib/info/components/InfoValueItem/index.js +66 -134
- package/lib/info/components/ProInfoItem/index.js +13 -29
- package/lib/info/components/baseInfo/index.js +17 -39
- package/lib/info/components/headerInfo/index.js +8 -31
- package/lib/info/components/tableInfo/index.js +20 -62
- package/lib/info/index.js +61 -101
- package/lib/info/typing.d.ts +2 -0
- package/lib/info/utils/index.js +0 -19
- package/lib/info/utils/utils.js +0 -1
- package/lib/next-xconsole.scss +34 -0
- package/lib/nocode/configurators/PageHeader.js +0 -2
- package/lib/nocode/configurators/ProTable.js +1 -24
- package/lib/nocode/configurators/common.js +5 -10
- package/lib/nocode/configurators/index.js +2 -10
- package/lib/nocode/configurators/map.js +0 -5
- package/lib/nocode/index.js +0 -11
- package/lib/nocode/pages/editor.js +5 -19
- package/lib/nocode/pages/index.js +3 -35
- package/lib/nocode/pages/playground.js +18 -52
- package/lib/nocode/pages/renderer.js +9 -53
- package/lib/nocode/playground.js +10 -35
- package/lib/page-container/index.js +0 -6
- package/lib/page-header/index.d.ts +2 -2
- package/lib/page-header/index.js +39 -90
- package/lib/page-header/index.scss +2 -1
- package/lib/page-header/xconsole.scss +5 -0
- package/lib/sidebar/components/sidebar-container/index.js +54 -81
- package/lib/sidebar/components/sidebar-container/index.scss +21 -14
- package/lib/sidebar/components/tree/index.js +100 -152
- package/lib/sidebar/components/tree-node/components/HoverTooltip/index.js +11 -34
- package/lib/sidebar/components/tree-node/components/IconAction/index.js +9 -46
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.d.ts +2 -2
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.js +12 -35
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.scss +1 -1
- package/lib/sidebar/components/tree-node/index.js +42 -100
- package/lib/sidebar/components/tree-node/index.scss +6 -0
- package/lib/sidebar/index.d.ts +2 -0
- package/lib/sidebar/index.js +79 -111
- package/lib/sidebar/typing.d.ts +4 -0
- package/lib/sidebar/utils/action-ref.js +2 -8
- package/lib/sidebar/utils/index.d.ts +5 -2
- package/lib/sidebar/utils/index.js +41 -106
- package/lib/skeleton/index.js +0 -6
- package/lib/table/components/CardView/index.d.ts +5 -0
- package/lib/table/components/CardView/index.js +402 -0
- package/lib/table/components/CardView/index.scss +46 -0
- package/lib/table/components/EmptyContent/index.js +0 -6
- package/lib/table/components/Filter/index.d.ts +6 -3
- package/lib/table/components/Filter/index.js +114 -137
- package/lib/table/components/Layout/index.js +32 -60
- package/lib/table/components/Layout/index.scss +2 -1
- package/lib/table/components/LoadMore/index.d.ts +20 -0
- package/lib/table/components/LoadMore/index.js +99 -0
- package/lib/table/components/LoadMore/index.scss +19 -0
- package/lib/table/components/Pagination/index.js +25 -68
- package/lib/table/components/QuickAction/index.d.ts +1 -0
- package/lib/table/components/QuickAction/index.js +3 -15
- package/lib/table/components/ToolBar/CardSwitch.d.ts +8 -0
- package/lib/table/components/ToolBar/CardSwitch.js +60 -0
- package/lib/table/components/ToolBar/DensityIcon.js +19 -42
- package/lib/table/components/ToolBar/FilterColumnIcon.js +86 -136
- package/lib/table/components/ToolBar/FullScreenIcon.js +10 -74
- package/lib/table/components/ToolBar/Fullscreen.js +25 -35
- package/lib/table/components/ToolBar/RefreshIcon.js +164 -36
- package/lib/table/components/ToolBar/index.d.ts +1 -1
- package/lib/table/components/ToolBar/index.js +133 -47
- package/lib/table/components/ToolBar/index.scss +49 -3
- package/lib/table/index.js +454 -445
- package/lib/table/index.scss +8 -0
- package/lib/table/typing.d.ts +125 -6
- package/lib/table/utils/columnRender.d.ts +3 -3
- package/lib/table/utils/columnRender.js +39 -92
- package/lib/table/utils/genProColumnToColumn.d.ts +2 -2
- package/lib/table/utils/genProColumnToColumn.js +13 -21
- package/lib/table/utils/getTableProps.js +0 -2
- package/lib/table/utils/getTableSortIcons.js +0 -5
- package/lib/table/utils/index.js +12 -55
- package/lib/table/utils/pureColumnRender.js +21 -64
- package/lib/table/utils/pureGenProColumnToColumn.d.ts +1 -1
- package/lib/table/utils/pureGenProColumnToColumn.js +2 -11
- package/lib/table/utils/useTableSelection.js +6 -35
- package/lib/table/utils/util.d.ts +5 -0
- package/lib/table/utils/util.js +25 -0
- package/lib/templates/Detail/index.js +0 -5
- package/lib/templates/Form/index.js +0 -5
- package/lib/templates/List/index.js +2 -19
- package/lib/templates/index.js +0 -6
- package/lib/timeline/ProTimeLineItem/index.js +25 -76
- package/lib/timeline/index.js +8 -33
- package/lib/timeline/typing.d.ts +1 -0
- package/lib/utils/index.js +0 -6
- package/lib/utils/message.d.ts +2 -2
- package/lib/utils/message.js +0 -10
- package/lib/xconsole.scss +503 -0
- package/package.json +1 -1
package/lib/table/index.scss
CHANGED
@@ -89,6 +89,14 @@ $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
|
+
}
|
92
100
|
}
|
93
101
|
|
94
102
|
.teamix-pro-table-footer-suction {
|
package/lib/table/typing.d.ts
CHANGED
@@ -2,13 +2,14 @@
|
|
2
2
|
* ProTable 类型定义
|
3
3
|
*/
|
4
4
|
import { ColumnProps, TableProps } from '@alicloudfe/components/types/table';
|
5
|
-
import { ProFieldType, ProFieldRenderProps, ProFieldDataSourceItem } from '../field';
|
5
|
+
import { ProFieldType, ProFieldRenderProps, ProFieldDataSourceItem, EmptyContentProps } 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 } from 'axios';
|
10
|
+
import { Method, AxiosRequestConfig } from 'axios';
|
11
11
|
import React from 'react';
|
12
|
+
import { ProCardProps } from '../card';
|
12
13
|
declare type IFieldRenderProps = keyof ProFieldRenderProps;
|
13
14
|
/** 列record函数 */
|
14
15
|
declare type ProTableCellFunProp = (value: any, index: number, record: any, ...others: any) => any;
|
@@ -57,9 +58,11 @@ export declare type ProTableColumnProps = {
|
|
57
58
|
dataIndex?: string | string[];
|
58
59
|
/** 指定 valueType 为日期时间格式时,可以格式化日期时间 */
|
59
60
|
format?: string;
|
61
|
+
/** 多级表头 **/
|
62
|
+
children?: ProTableColumnProps[];
|
60
63
|
/** ProField 其他配置项 */
|
61
64
|
props?: any;
|
62
|
-
} & Omit<ColumnProps, 'filters' | 'dataIndex' | 'filtersMode'>;
|
65
|
+
} & Omit<ColumnProps, 'filters' | 'dataIndex' | 'filtersMode' | 'children'>;
|
63
66
|
export declare type ProColumnProps = ProTableColumnProps;
|
64
67
|
export declare type ProTableProps = {
|
65
68
|
/** ProColums 定义,取代 Table 的 columns */
|
@@ -75,9 +78,9 @@ export declare type ProTableProps = {
|
|
75
78
|
/** sort 排序请求参数处理函数 */
|
76
79
|
formatSort?: (sort: object) => object;
|
77
80
|
/** 如需自定义调用参数格式,则可以设定此值在请求前对 params 进行自定义,如果返回false则可以阻止请求 */
|
78
|
-
formatParams?: (params: any) => typeof params;
|
81
|
+
formatParams?: ((params: any) => typeof params) | string;
|
79
82
|
/** 对返回值的 data,total 进行映射处理 */
|
80
|
-
formatResult?: TDataService | ((res: any) => TDataService);
|
83
|
+
formatResult?: TDataService | ((res: any) => TDataService) | string;
|
81
84
|
/** 请求成功后经过 formatResult 转换后的回调 */
|
82
85
|
onFormatResult?: (data: any[]) => void;
|
83
86
|
/** 是否第一次加载时就发起请求 */
|
@@ -86,6 +89,8 @@ export declare type ProTableProps = {
|
|
86
89
|
onSuccess?: (res: any) => void;
|
87
90
|
/** 内部请求失败时的回调 */
|
88
91
|
onError?: (error: Error) => void;
|
92
|
+
/** 自定义的请求配置 */
|
93
|
+
requestConfig?: AxiosRequestConfig;
|
89
94
|
/** 翻页页数的请求参数名 */
|
90
95
|
pageKey?: string;
|
91
96
|
/** 翻页器页数对应字段 */
|
@@ -126,7 +131,15 @@ export declare type ProTableProps = {
|
|
126
131
|
/** 非全屏模式下是否吸底 默认状态下取用 ProPageContainer 作为参照物。如果传入了 Dom,则取用 Dom 作为参照物 */
|
127
132
|
footerSuction?: boolean | Element;
|
128
133
|
/** 当满足条件时开启自动刷新,返回值为自动刷新间隔时间,如果返回 0 或 false 则停止自动刷新,每次触发翻页、搜索都将重置时间 */
|
129
|
-
autoRefresh?: (dataSource: any[]) => number | boolean;
|
134
|
+
autoRefresh?: ((dataSource: any[]) => number | boolean) | boolean;
|
135
|
+
/** 自动刷新配置 */
|
136
|
+
autoRefreshProps?: {
|
137
|
+
/** 可选间隔列表 **/
|
138
|
+
dataSource?: {
|
139
|
+
label?: React.ReactNode;
|
140
|
+
value?: number;
|
141
|
+
}[];
|
142
|
+
};
|
130
143
|
/** 自定义请求方法,必需返回 success,data 字段,如果需要手动分页 total 也是必需的 */
|
131
144
|
customRequest?: (params: any) => Promise<{
|
132
145
|
success: boolean;
|
@@ -145,6 +158,20 @@ export declare type ProTableProps = {
|
|
145
158
|
context?: any;
|
146
159
|
/** 是否固定表格主体(开启后横向滚动条会固定在底部) */
|
147
160
|
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;
|
148
175
|
} & Omit<TableProps, 'columns'> & ProTableTopAreaProps;
|
149
176
|
export declare type rowSelectionType = {
|
150
177
|
getProps?: (record: any, index: number) => any;
|
@@ -201,6 +228,7 @@ export declare type ProTableActionType = {
|
|
201
228
|
};
|
202
229
|
/** 重置翻页器为1,不发送请求 */
|
203
230
|
resetPage?: () => void;
|
231
|
+
nextPage?: () => void;
|
204
232
|
/** 获取数据过滤区表单实例 */
|
205
233
|
dataFilterForm?: ProFormType;
|
206
234
|
/** 用于在 mount 的时候获取到表单 ref */
|
@@ -210,6 +238,15 @@ export declare type ProTableActionType = {
|
|
210
238
|
filterEnableRef?: any;
|
211
239
|
/** 表格当前的数据 */
|
212
240
|
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;
|
213
250
|
} & ProTableActionTypeMutations;
|
214
251
|
/** action State 定义 */
|
215
252
|
export declare type ProTableActionTypeMutations = {
|
@@ -256,6 +293,8 @@ export declare type ProTableTopAreaProps = {
|
|
256
293
|
mainAction?: ProActionGroupProps | React.ReactNode;
|
257
294
|
/** 工具栏区 */
|
258
295
|
toolBar?: boolean | ProTableToolBarItem[];
|
296
|
+
/** 是否开启工具栏自适应 */
|
297
|
+
toolBarAutoWidth?: boolean;
|
259
298
|
/** 快捷操作区 */
|
260
299
|
extra?: ProActionButtonProps | React.ReactNode | React.ReactNode[];
|
261
300
|
/** 数据过滤区 */
|
@@ -274,6 +313,14 @@ export declare type ProTableLayoutProps = {
|
|
274
313
|
actionRef: React.MutableRefObject<ProTableActionType | undefined>;
|
275
314
|
columns?: ProTableColumnProps[];
|
276
315
|
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'];
|
277
324
|
} & ProTableTopAreaProps;
|
278
325
|
/** columns 列过滤 */
|
279
326
|
export declare type ProTableColumnsFilterItemProps = {
|
@@ -296,4 +343,76 @@ export declare type parentPositionProps = {
|
|
296
343
|
offsetLeft: number;
|
297
344
|
offsetRight: number;
|
298
345
|
};
|
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
|
+
};
|
299
418
|
export {};
|
@@ -2,12 +2,12 @@
|
|
2
2
|
* 渲染列的逻辑函数
|
3
3
|
*/
|
4
4
|
import React from 'react';
|
5
|
-
import { ProTableColumnProps, ProTableActionType } from '../typing';
|
5
|
+
import { ProTableColumnProps, ProTableActionType, ProTableProps } 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>, bindUrl?: ProTableProps['bindUrl'], bindUrlProps?: ProTableProps['bindUrlProps']) => 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) => JSX.Element;
|
13
|
+
export declare const renderCell: (value: any, item: ProTableColumnProps, index: number, record: any, actionRef: React.MutableRefObject<ProTableActionType | undefined>, context?: any, dataTeamixSpm?: string) => JSX.Element;
|
@@ -1,86 +1,56 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
4
|
-
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
6
5
|
value: true
|
7
6
|
});
|
8
7
|
exports.renderColumnsTitle = exports.renderCell = void 0;
|
9
|
-
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
11
|
-
|
12
9
|
var _utils = require("@teamix/utils");
|
13
|
-
|
14
10
|
var _actions = require("../../actions");
|
15
|
-
|
16
11
|
var _field = _interopRequireWildcard(require("../../field"));
|
17
|
-
|
18
12
|
var _Filter = _interopRequireDefault(require("../components/Filter"));
|
19
|
-
|
20
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
21
|
-
|
22
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
23
|
-
|
24
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
25
|
-
|
26
16
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
27
|
-
|
28
17
|
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."); }
|
29
|
-
|
30
18
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
31
|
-
|
32
19
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
33
|
-
|
34
20
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
35
|
-
|
36
21
|
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."); }
|
37
|
-
|
38
22
|
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); }
|
39
|
-
|
40
23
|
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; }
|
41
|
-
|
42
24
|
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; }
|
43
|
-
|
44
25
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
45
|
-
|
46
26
|
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; }
|
47
|
-
|
48
27
|
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; }
|
49
|
-
|
50
28
|
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; }
|
51
|
-
|
52
29
|
/**
|
53
30
|
* 增加了 icon 的功能 render title
|
54
31
|
*/
|
55
|
-
var renderColumnsTitle = function renderColumnsTitle(item, actionRef) {
|
32
|
+
var renderColumnsTitle = function renderColumnsTitle(item, actionRef, bindUrl, bindUrlProps) {
|
56
33
|
var filterMode = item.filterMode,
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
34
|
+
filters = item.filters,
|
35
|
+
dataSource = item.dataSource,
|
36
|
+
dataIndex = item.dataIndex,
|
37
|
+
valueType = item.valueType;
|
38
|
+
// 为列过滤添加状态标题
|
62
39
|
var getItemLabel = function getItemLabel() {
|
63
40
|
if (filters && filterMode !== 'multiple') {
|
64
41
|
var _actionRef$current$ge, _actionRef$current, _actionRef$current$ge2;
|
65
|
-
|
66
42
|
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 : {};
|
67
|
-
|
68
43
|
if (Object.keys(selectedItem).length > 0) {
|
69
44
|
var _selectedItem$dataInd;
|
70
|
-
|
71
45
|
if ((_selectedItem$dataInd = selectedItem[dataIndex]) === null || _selectedItem$dataInd === void 0 ? void 0 : _selectedItem$dataInd.params) {
|
72
46
|
var _targetFilters$find;
|
73
|
-
|
74
47
|
// 找到对应的 label
|
75
48
|
var targetFilters = filters !== null && filters !== void 0 ? filters : [];
|
76
|
-
|
77
49
|
if (filters === true) {
|
78
50
|
targetFilters = dataSource !== null && dataSource !== void 0 ? dataSource : [];
|
79
51
|
}
|
80
|
-
|
81
52
|
var label = (_targetFilters$find = targetFilters.find(function (item) {
|
82
53
|
var _selectedItem$dataInd2;
|
83
|
-
|
84
54
|
return item.value === ((_selectedItem$dataInd2 = selectedItem[dataIndex]) === null || _selectedItem$dataInd2 === void 0 ? void 0 : _selectedItem$dataInd2.params);
|
85
55
|
})) === null || _targetFilters$find === void 0 ? void 0 : _targetFilters$find.label;
|
86
56
|
var value = "".concat(item.title, " (").concat(label, ")");
|
@@ -98,7 +68,6 @@ var renderColumnsTitle = function renderColumnsTitle(item, actionRef) {
|
|
98
68
|
}
|
99
69
|
}
|
100
70
|
}
|
101
|
-
|
102
71
|
return /*#__PURE__*/_react.default.createElement(_field.default, {
|
103
72
|
style: {
|
104
73
|
display: 'inline-flex'
|
@@ -111,40 +80,37 @@ var renderColumnsTitle = function renderColumnsTitle(item, actionRef) {
|
|
111
80
|
}
|
112
81
|
});
|
113
82
|
};
|
114
|
-
|
115
83
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_field.LabelIconTip, {
|
116
84
|
label: item.title,
|
117
85
|
tooltip: item.tooltip,
|
118
86
|
icon: item.tooltipIcon
|
119
87
|
}), item.filters && /*#__PURE__*/_react.default.createElement(_Filter.default, {
|
120
88
|
column: item,
|
121
|
-
actionRef: actionRef
|
89
|
+
actionRef: actionRef,
|
90
|
+
bindUrl: bindUrl,
|
91
|
+
bindUrlProps: bindUrlProps
|
122
92
|
}));
|
123
93
|
};
|
124
94
|
/**
|
125
95
|
* 负责单元格的具体渲染
|
126
96
|
*/
|
127
|
-
|
128
|
-
|
129
97
|
exports.renderColumnsTitle = renderColumnsTitle;
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
98
|
+
var renderCell = function renderCell(value, item, index, record, actionRef, /** 接收外部比如 dialog-table 传过来的 context,用于弹窗关闭等 */
|
99
|
+
context,
|
100
|
+
// 用于埋点
|
101
|
+
dataTeamixSpm) {
|
134
102
|
var _actionSchema$actions;
|
135
|
-
|
136
103
|
var _item$valueType = item.valueType,
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
104
|
+
valueType = _item$valueType === void 0 ? 'text' : _item$valueType,
|
105
|
+
render = item.render,
|
106
|
+
actionSchema = item.actionSchema,
|
107
|
+
dataIndex = item.dataIndex,
|
108
|
+
format = item.format;
|
109
|
+
// 如果没传 dataIndex,返回 null
|
143
110
|
if (!dataIndex) {
|
144
111
|
value = null;
|
145
|
-
}
|
146
|
-
|
147
|
-
|
112
|
+
}
|
113
|
+
// 处理 dataIndex 为数组的情况
|
148
114
|
if (Array.isArray(dataIndex)) {
|
149
115
|
value = dataIndex.map(function (item) {
|
150
116
|
return (0, _utils.getTargetValue)("{{".concat(item, "}}"), _objectSpread(_objectSpread({}, record), {}, {
|
@@ -152,18 +118,16 @@ context) {
|
|
152
118
|
}));
|
153
119
|
});
|
154
120
|
}
|
155
|
-
|
156
121
|
var newRender = null;
|
157
122
|
var newDataSource = null;
|
158
|
-
var props = item.props;
|
159
|
-
|
123
|
+
var props = item.props;
|
124
|
+
// 如果 render 直接传函数
|
160
125
|
if (typeof render === 'function') {
|
161
126
|
newRender = function newRender() {
|
162
127
|
return render === null || render === void 0 ? void 0 : render(value, index, record);
|
163
128
|
};
|
164
129
|
} else {
|
165
130
|
newRender = processBuriedPoint(processRenderFunction(render, value, index, record), record, value, index);
|
166
|
-
|
167
131
|
if (valueType === 'selectGroup') {
|
168
132
|
newRender = _objectSpread(_objectSpread({
|
169
133
|
maxShowNumber: 'auto',
|
@@ -180,15 +144,13 @@ context) {
|
|
180
144
|
}
|
181
145
|
}, props);
|
182
146
|
}
|
183
|
-
|
184
147
|
if ((render === null || render === void 0 ? void 0 : render.type) === 'step') {
|
185
148
|
newRender = _objectSpread(_objectSpread({}, newRender), {}, {
|
186
149
|
ellipsis: false
|
187
150
|
});
|
188
151
|
}
|
189
|
-
}
|
190
|
-
|
191
|
-
|
152
|
+
}
|
153
|
+
// 渲染操作组
|
192
154
|
if (actionSchema && ((_actionSchema$actions = actionSchema.actions) === null || _actionSchema$actions === void 0 ? void 0 : _actionSchema$actions.length)) {
|
193
155
|
// 默认 context
|
194
156
|
var defaultContext = _objectSpread({
|
@@ -197,28 +159,24 @@ context) {
|
|
197
159
|
record: record,
|
198
160
|
action: actionRef.current
|
199
161
|
}, context);
|
200
|
-
|
201
162
|
return /*#__PURE__*/_react.default.createElement(_actions.ProActionGroup, _objectSpread(_objectSpread({
|
202
163
|
type: "text"
|
203
164
|
}, actionSchema), {}, {
|
204
|
-
context: _objectSpread(_objectSpread({}, defaultContext), actionSchema.context)
|
165
|
+
context: _objectSpread(_objectSpread({}, defaultContext), actionSchema.context),
|
166
|
+
"data-teamix-spm": dataTeamixSpm ? "".concat(dataTeamixSpm, "-columnAction") : undefined
|
205
167
|
}));
|
206
|
-
}
|
207
|
-
|
208
|
-
|
168
|
+
}
|
169
|
+
// dataSource可传函数
|
209
170
|
if (typeof item.dataSource === 'function') {
|
210
171
|
var _item$dataSource;
|
211
|
-
|
212
172
|
newDataSource = (_item$dataSource = item.dataSource) === null || _item$dataSource === void 0 ? void 0 : _item$dataSource.call(item, value, index, record);
|
213
173
|
} else {
|
214
174
|
var _item$dataSource2;
|
215
|
-
|
216
175
|
newDataSource = ((_item$dataSource2 = item.dataSource) !== null && _item$dataSource2 !== void 0 ? _item$dataSource2 : []).map(function (item) {
|
217
176
|
return Object.fromEntries(Object.entries(item).map(function (_ref) {
|
218
177
|
var _ref2 = _slicedToArray(_ref, 2),
|
219
|
-
|
220
|
-
|
221
|
-
|
178
|
+
k = _ref2[0],
|
179
|
+
v = _ref2[1];
|
222
180
|
return [k, (0, _utils.getTargetValue)(v, _objectSpread(_objectSpread({}, record), {}, {
|
223
181
|
record: record,
|
224
182
|
value: value,
|
@@ -226,9 +184,8 @@ context) {
|
|
226
184
|
}))];
|
227
185
|
}));
|
228
186
|
});
|
229
|
-
}
|
230
|
-
|
231
|
-
|
187
|
+
}
|
188
|
+
// 渲染 ProField
|
232
189
|
return /*#__PURE__*/_react.default.createElement(_field.default, _objectSpread({
|
233
190
|
type: valueType || 'text',
|
234
191
|
value: value,
|
@@ -245,10 +202,7 @@ context) {
|
|
245
202
|
* @param record table cell record
|
246
203
|
* @returns
|
247
204
|
*/
|
248
|
-
|
249
|
-
|
250
205
|
exports.renderCell = renderCell;
|
251
|
-
|
252
206
|
var processRenderFunction = function processRenderFunction() {
|
253
207
|
var render = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
254
208
|
var value = arguments.length > 1 ? arguments[1] : undefined;
|
@@ -258,25 +212,20 @@ var processRenderFunction = function processRenderFunction() {
|
|
258
212
|
var external = ['linkOnClick', 'link', 'value', 'renderEdit', 'descriptionRenderEdit', 'editPopConfirmProps', 'descriptionEditPopConfirmProps', 'editOnClick', 'descriptionEditOnClick', 'extra', 'prefixExtra'];
|
259
213
|
return Object.fromEntries(Object.entries(render).map(function (_ref3) {
|
260
214
|
var _ref4 = _slicedToArray(_ref3, 2),
|
261
|
-
|
262
|
-
|
263
|
-
|
215
|
+
k = _ref4[0],
|
216
|
+
v = _ref4[1];
|
264
217
|
if (typeof v === 'function') {
|
265
218
|
var _v;
|
266
|
-
|
267
219
|
if (external.includes(k)) {
|
268
220
|
return [k, function () {
|
269
221
|
for (var _len = arguments.length, others = new Array(_len), _key = 0; _key < _len; _key++) {
|
270
222
|
others[_key] = arguments[_key];
|
271
223
|
}
|
272
|
-
|
273
224
|
return v === null || v === void 0 ? void 0 : v.apply(void 0, [value, index, record].concat(others));
|
274
225
|
}];
|
275
226
|
}
|
276
|
-
|
277
227
|
return [k, (_v = v === null || v === void 0 ? void 0 : v(value, index, record)) !== null && _v !== void 0 ? _v : ''];
|
278
228
|
}
|
279
|
-
|
280
229
|
return [k, v];
|
281
230
|
}));
|
282
231
|
};
|
@@ -286,20 +235,18 @@ var processRenderFunction = function processRenderFunction() {
|
|
286
235
|
* @param record table cell record
|
287
236
|
* @returns
|
288
237
|
*/
|
289
|
-
|
290
|
-
|
291
238
|
var processBuriedPoint = function processBuriedPoint() {
|
292
239
|
var render = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
293
240
|
var record = arguments.length > 1 ? arguments[1] : undefined;
|
294
241
|
var value = arguments.length > 2 ? arguments[2] : undefined;
|
295
242
|
var index = arguments.length > 3 ? arguments[3] : undefined;
|
296
|
-
return Object.fromEntries([
|
243
|
+
return Object.fromEntries([
|
244
|
+
// 默认 ellipsis、descriptionEllipsis 为 true
|
297
245
|
// emptyText 默认为 '-'
|
298
246
|
['ellipsis', true], ['descriptionEllipsis', true], ['emptyText', '-']].concat(_toConsumableArray(Object.entries(render).map(function (_ref5) {
|
299
247
|
var _ref6 = _slicedToArray(_ref5, 2),
|
300
|
-
|
301
|
-
|
302
|
-
|
248
|
+
k = _ref6[0],
|
249
|
+
v = _ref6[1];
|
303
250
|
return [k, (0, _utils.getTargetValue)(v, _objectSpread(_objectSpread({}, record), {}, {
|
304
251
|
record: record,
|
305
252
|
value: value,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import { ProTableColumnProps, ProTableActionType } from '../typing';
|
2
|
+
import { ProTableColumnProps, ProTableActionType, ProTableProps } 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): FixedColumnProps[];
|
12
|
+
showSkeleton: boolean, actionRef: React.MutableRefObject<ProTableActionType | undefined>, context?: any, dataTeamixSpm?: string, bindUrl?: ProTableProps['bindUrl'], bindUrlProps?: ProTableProps['bindUrlProps']): FixedColumnProps[];
|
13
13
|
export {};
|
@@ -4,41 +4,33 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = genProColumnToColumn;
|
7
|
-
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
9
|
-
|
10
8
|
var _columnRender = require("./columnRender");
|
11
|
-
|
12
9
|
var _skeleton = require("../../skeleton");
|
13
|
-
|
14
10
|
var _utils = require("@teamix/utils");
|
15
|
-
|
16
|
-
var _excluded = ["filters", "dataIndex"];
|
17
|
-
|
11
|
+
var _excluded = ["filters", "dataIndex", "children"];
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
|
-
|
20
13
|
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; }
|
21
|
-
|
22
14
|
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; }
|
23
|
-
|
24
15
|
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; }
|
25
|
-
|
26
16
|
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; }
|
27
|
-
|
28
17
|
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; }
|
29
|
-
|
30
18
|
/**
|
31
19
|
* ProColumn => Column
|
32
20
|
*/
|
33
|
-
function genProColumnToColumn(columns,
|
34
|
-
/** 是否渲染骨架屏 */
|
21
|
+
function genProColumnToColumn(columns, /** 是否渲染骨架屏 */
|
35
22
|
showSkeleton, actionRef) {
|
36
23
|
var context = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
24
|
+
var
|
25
|
+
// 用于埋点
|
26
|
+
dataTeamixSpm = arguments.length > 4 ? arguments[4] : undefined;
|
27
|
+
var bindUrl = arguments.length > 5 ? arguments[5] : undefined;
|
28
|
+
var bindUrlProps = arguments.length > 6 ? arguments[6] : undefined;
|
37
29
|
return columns.map(function (columnProps) {
|
38
30
|
var filters = columnProps.filters,
|
39
|
-
|
40
|
-
|
41
|
-
|
31
|
+
dataIndex = columnProps.dataIndex,
|
32
|
+
children = columnProps.children,
|
33
|
+
others = _objectWithoutProperties(columnProps, _excluded);
|
42
34
|
if (showSkeleton) {
|
43
35
|
return _objectSpread(_objectSpread({}, others), {}, {
|
44
36
|
filters: undefined,
|
@@ -50,16 +42,16 @@ showSkeleton, actionRef) {
|
|
50
42
|
}
|
51
43
|
});
|
52
44
|
}
|
53
|
-
|
54
45
|
return _objectSpread(_objectSpread({
|
55
46
|
// 金钱样式默认右对齐
|
56
47
|
align: columnProps.valueType === 'money' ? 'right' : 'left',
|
57
48
|
wordBreak: (0, _utils.getLanguage)() === 'en-us' ? 'word' : 'all'
|
58
49
|
}, others), {}, {
|
50
|
+
children: children ? genProColumnToColumn(children, showSkeleton, actionRef, context) : undefined,
|
59
51
|
dataIndex: dataIndex === null || dataIndex === void 0 ? void 0 : dataIndex.toString(),
|
60
|
-
title: (0, _columnRender.renderColumnsTitle)(columnProps, actionRef),
|
52
|
+
title: (0, _columnRender.renderColumnsTitle)(columnProps, actionRef, bindUrl, bindUrlProps),
|
61
53
|
cell: function cell(value, index, record) {
|
62
|
-
return (0, _columnRender.renderCell)(value, columnProps, index, record, actionRef, context);
|
54
|
+
return (0, _columnRender.renderCell)(value, columnProps, index, record, actionRef, context, dataTeamixSpm);
|
63
55
|
}
|
64
56
|
});
|
65
57
|
});
|
@@ -4,10 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
|
-
|
8
7
|
// 返回 Table 属性列表
|
9
8
|
var _default = function _default() {
|
10
9
|
return ['stickyHeader', 'offsetTop', 'affixProps', 'components', 'useVirtual', 'rowHeight', 'maxBodyHeight', 'primaryKey', 'dataSource', 'onBodyScroll', 'openRowKeys', 'defaultOpenRowKeys', 'onRowOpen', 'indent', 'isTree', 'locale', 'expandedRowRender', 'rowExpandable', 'expandedRowIndent', 'hasExpandedRowCtrl', 'getExpandedColProps', 'onExpandedRowClick', 'rowSelection', 'entireDataSource', 'scrollToCol', 'scrollToRow', 'hasHeader', 'fixedHeader', 'prefix', 'defaultPropsConfig', 'errorBoundary', 'pure', 'warning', 'rtl', 'device', 'children', 'popupContainer', 'tableLayout', 'tableWidth', 'style', 'size', 'onRowClick', 'onRowMouseEnter', 'onRowMouseLeave', 'onSort', 'onFilter', 'onResizeChange', 'rowProps', 'cellProps', 'hasBorder', 'isZebra', 'loading', 'loadingComponent', 'filterParams', 'sort', 'sortIcons', 'columns', 'emptyContent', 'lockType', 'wrapperContent', 'refs', 'expandedIndexSimulate', 'crossline', 'lengths'];
|
11
10
|
};
|
12
|
-
|
13
11
|
exports.default = _default;
|