@teamix/pro 1.5.0-beta.1 → 1.6.0-beta.0
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/README.md +1 -1
- package/dist/pro.css +1 -1
- package/dist/pro.js +77100 -67703
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/dist/pro.min.js.LICENSE.txt +13 -6
- package/es/actions/base.js +8 -21
- package/es/actions/dialog-component.js +3 -13
- package/es/actions/dialog-form.js +41 -79
- package/es/actions/dialog-info.js +1 -5
- package/es/actions/dialog.js +57 -96
- package/es/actions/index.js +94 -161
- package/es/actions/link.js +3 -6
- package/es/actions/request.js +12 -28
- package/es/actions/utils.js +1 -9
- package/es/card/card-container.js +11 -9
- package/es/card/divider.js +2 -9
- package/es/card/index.js +70 -98
- package/es/card/selectable.js +6 -17
- package/es/card/tab.js +3 -14
- package/es/card/utils.js +0 -2
- package/es/form/Components/Editable/index.js +17 -56
- package/es/form/Components/FormGroup/index.js +11 -25
- package/es/form/Components/LightFilter/index.js +22 -33
- package/es/form/Components/ProField/index.js +4 -18
- package/es/form/Components/ProField/mapDateFormat.js +2 -28
- package/es/form/Components/Text/index.js +4 -15
- package/es/form/Filter/AdvancedFilter.js +16 -29
- package/es/form/Filter/Layout.js +11 -24
- package/es/form/Filter/LightFilter.js +17 -24
- package/es/form/Filter/SimpleFilter.js +12 -23
- package/es/form/Filter/index.js +113 -161
- package/es/form/Filter/index2.js +22 -34
- package/es/form/Filter/layout.scss +1 -1
- package/es/form/Filter/useBindUrl.js +18 -43
- package/es/form/Filter/useSpecialProps.js +8 -12
- package/es/form/ProForm/addCascadeEffect.js +203 -0
- package/es/form/ProForm/customComponent.js +0 -5
- package/es/form/ProForm/index.js +33 -38
- package/es/form/ProForm/useAutoLayout.js +21 -38
- package/es/form/ProForm/useAutoSubmit.js +3 -9
- package/es/form/ProForm/useFieldRequest.js +0 -5
- package/es/form/ProForm/useFormDisplayValues.js +12 -27
- package/es/form/ProForm/useInitialRequest.js +0 -5
- package/es/form/SchemaForm/adapterComponent.js +1 -3
- package/es/form/SchemaForm/adapterDecorator.js +1 -8
- package/es/form/SchemaForm/adapterType.js +1 -2
- package/es/form/SchemaForm/index.js +82 -105
- 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 -29
- 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 -32
- package/es/form/SchemaForm/initializeRequest.js +2 -16
- package/es/form/SchemaForm/initializeRules.js +4 -22
- package/es/form/SchemaForm/initializeSelectTable.js +8 -33
- package/es/form/SchemaForm/reactions.js +19 -29
- package/es/form/index.js +4 -9
- package/es/form/utils.js +15 -48
- package/es/form/warning.js +3 -6
- package/es/index-without-icon.js +4 -3
- package/es/index.js +8 -7
- package/es/info/components/InfoGroup/index.js +23 -36
- package/es/info/components/InfoValueItem/index.js +85 -126
- package/es/info/components/ProInfoItem/index.js +13 -20
- package/es/info/components/baseInfo/index.js +14 -23
- package/es/info/components/headerInfo/index.js +8 -20
- package/es/info/components/tableInfo/index.js +22 -50
- package/es/info/index.js +59 -82
- package/es/info/utils/index.js +3 -11
- package/es/layout/index.js +2 -0
- package/es/nocode/configurators/common.js +5 -6
- package/es/nocode/configurators/index.js +1 -3
- package/es/nocode/index.js +7 -5
- package/es/nocode/pages/editor.js +5 -9
- package/es/nocode/pages/index.js +6 -3
- package/es/nocode/pages/playground.js +21 -40
- package/es/nocode/pages/renderer.js +13 -48
- package/es/nocode/playground.js +12 -27
- package/es/page-header/index.js +54 -80
- package/es/sidebar/components/sidebar-container/index.js +59 -71
- package/es/sidebar/components/sidebar-container/index.scss +21 -14
- package/es/sidebar/components/tree/index.js +107 -127
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.js +13 -29
- package/es/sidebar/components/tree-node/components/IconAction/index.js +12 -36
- package/es/sidebar/components/tree-node/components/IconSwitch/index.js +12 -24
- package/es/sidebar/components/tree-node/index.js +55 -84
- package/es/sidebar/index.js +73 -87
- package/es/sidebar/utils/action-ref.js +2 -7
- package/es/sidebar/utils/index.js +59 -108
- package/es/table/components/Filter/index.js +41 -72
- package/es/table/components/Layout/index.js +34 -49
- package/es/table/components/Pagination/index.js +35 -66
- package/es/table/components/QuickAction/index.js +6 -13
- package/es/table/components/ToolBar/DensityIcon.js +24 -31
- package/es/table/components/ToolBar/FilterColumnIcon.js +47 -91
- package/es/table/components/ToolBar/FullScreenIcon.js +7 -61
- package/es/table/components/ToolBar/Fullscreen.js +15 -25
- package/es/table/components/ToolBar/RefreshIcon.js +4 -5
- package/es/table/components/ToolBar/index.js +88 -25
- package/es/table/components/ToolBar/index.scss +22 -2
- package/es/table/index.js +242 -356
- package/es/table/utils/columnRender.js +52 -87
- package/es/table/utils/genProColumnToColumn.js +3 -13
- package/es/table/utils/index.js +18 -45
- package/es/table/utils/pureColumnRender.js +26 -50
- package/es/table/utils/pureGenProColumnToColumn.js +2 -10
- package/es/table/utils/useTableSelection.js +6 -33
- package/es/templates/List/index.js +6 -15
- package/es/templates/index.js +2 -1
- package/es/timeline/ProTimeLineItem/index.js +30 -66
- package/es/timeline/index.js +11 -25
- package/es/utils/message.js +3 -10
- 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 +3 -19
- package/lib/actions/dialog-form.js +41 -92
- package/lib/actions/dialog-info.js +1 -10
- package/lib/actions/dialog-table.js +0 -5
- package/lib/actions/dialog.js +56 -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.js +93 -191
- package/lib/actions/link.js +3 -11
- package/lib/actions/notice.js +0 -5
- package/lib/actions/pop-confirm.js +0 -5
- package/lib/actions/request.js +10 -33
- package/lib/actions/utils.js +1 -9
- package/lib/card/card-container.js +6 -13
- package/lib/card/divider.js +2 -11
- package/lib/card/index.js +68 -124
- package/lib/card/selectable.js +6 -24
- package/lib/card/tab.js +3 -18
- package/lib/card/utils.js +0 -6
- package/lib/field/index.js +0 -6
- package/lib/form/Components/Editable/index.js +16 -66
- package/lib/form/Components/FormGroup/index.js +11 -31
- package/lib/form/Components/LightFilter/index.js +22 -45
- package/lib/form/Components/ProField/index.js +4 -25
- package/lib/form/Components/ProField/mapDateFormat.js +2 -32
- package/lib/form/Components/Text/index.js +4 -20
- package/lib/form/Filter/AdvancedFilter.js +16 -37
- package/lib/form/Filter/Layout.js +11 -33
- package/lib/form/Filter/LightFilter.js +17 -32
- package/lib/form/Filter/SimpleFilter.js +10 -29
- package/lib/form/Filter/index.js +112 -181
- package/lib/form/Filter/index2.js +22 -44
- package/lib/form/Filter/layout.scss +1 -1
- package/lib/form/Filter/useBindUrl.js +18 -47
- package/lib/form/Filter/useSpecialProps.js +6 -13
- package/lib/form/ProForm/addCascadeEffect.js +210 -0
- package/lib/form/ProForm/customComponent.js +0 -8
- package/lib/form/ProForm/index.js +33 -60
- package/lib/form/ProForm/useAutoLayout.js +21 -41
- package/lib/form/ProForm/useAutoSubmit.js +3 -11
- package/lib/form/ProForm/useFieldRequest.js +0 -8
- package/lib/form/ProForm/useFormDisplayValues.js +12 -33
- package/lib/form/ProForm/useInitialRequest.js +0 -6
- package/lib/form/SchemaForm/adapterComponent.js +1 -6
- package/lib/form/SchemaForm/adapterDecorator.js +0 -12
- package/lib/form/SchemaForm/adapterType.js +1 -5
- package/lib/form/SchemaForm/index.js +82 -135
- 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 -30
- 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 -36
- 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 -32
- package/lib/form/docs/ActionResponse.js +0 -5
- package/lib/form/index.js +0 -25
- package/lib/form/typing.js +1 -5
- package/lib/form/utils.js +14 -60
- package/lib/form/warning.js +3 -7
- package/lib/hooks/index.js +0 -5
- package/lib/index-without-icon.js +2 -36
- package/lib/index.js +2 -39
- package/lib/info/components/InfoGroup/index.js +23 -46
- package/lib/info/components/InfoValueItem/index.js +85 -141
- package/lib/info/components/ProInfoItem/index.js +14 -29
- package/lib/info/components/baseInfo/index.js +15 -36
- package/lib/info/components/headerInfo/index.js +8 -31
- package/lib/info/components/tableInfo/index.js +22 -62
- package/lib/info/index.js +59 -97
- package/lib/info/typing.js +1 -5
- package/lib/info/utils/index.js +3 -19
- package/lib/info/utils/utils.js +0 -1
- package/lib/nocode/configurators/PageHeader.js +0 -2
- package/lib/nocode/configurators/ProTable.js +0 -2
- package/lib/nocode/configurators/common.js +5 -10
- package/lib/nocode/configurators/index.js +1 -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 +2 -9
- package/lib/nocode/pages/playground.js +21 -57
- package/lib/nocode/pages/renderer.js +13 -59
- package/lib/nocode/playground.js +12 -39
- package/lib/page-container/index.js +0 -6
- package/lib/page-header/index.js +53 -93
- package/lib/sidebar/components/sidebar-container/index.js +59 -83
- package/lib/sidebar/components/sidebar-container/index.scss +21 -14
- package/lib/sidebar/components/tree/index.js +107 -141
- package/lib/sidebar/components/tree-node/components/HoverTooltip/index.js +13 -37
- package/lib/sidebar/components/tree-node/components/IconAction/index.js +12 -47
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.js +12 -34
- package/lib/sidebar/components/tree-node/index.js +55 -100
- package/lib/sidebar/index.js +73 -103
- package/lib/sidebar/typing.js +1 -5
- package/lib/sidebar/utils/action-ref.js +2 -8
- package/lib/sidebar/utils/index.js +59 -116
- package/lib/skeleton/index.js +0 -6
- package/lib/table/components/EmptyContent/index.js +0 -6
- package/lib/table/components/Filter/index.js +41 -82
- package/lib/table/components/Layout/index.js +35 -63
- package/lib/table/components/Pagination/index.js +35 -76
- package/lib/table/components/QuickAction/index.js +6 -17
- package/lib/table/components/ToolBar/DensityIcon.js +24 -42
- package/lib/table/components/ToolBar/FilterColumnIcon.js +47 -103
- package/lib/table/components/ToolBar/FullScreenIcon.js +10 -73
- package/lib/table/components/ToolBar/Fullscreen.js +15 -32
- package/lib/table/components/ToolBar/RefreshIcon.js +5 -12
- package/lib/table/components/ToolBar/index.js +91 -34
- package/lib/table/components/ToolBar/index.scss +22 -2
- package/lib/table/index.js +243 -380
- package/lib/table/typing.js +1 -5
- package/lib/table/utils/columnRender.js +51 -100
- package/lib/table/utils/genProColumnToColumn.js +3 -18
- package/lib/table/utils/getTableProps.js +0 -2
- package/lib/table/utils/getTableSortIcons.js +0 -5
- package/lib/table/utils/index.js +16 -53
- package/lib/table/utils/pureColumnRender.js +26 -61
- package/lib/table/utils/pureGenProColumnToColumn.js +2 -11
- package/lib/table/utils/useTableSelection.js +6 -35
- package/lib/templates/Detail/index.js +0 -5
- package/lib/templates/Form/index.js +0 -5
- package/lib/templates/List/index.js +6 -25
- package/lib/templates/index.js +0 -6
- package/lib/timeline/ProTimeLineItem/index.js +30 -77
- package/lib/timeline/index.js +11 -36
- package/lib/timeline/typing.js +1 -5
- package/lib/utils/index.js +0 -6
- package/lib/utils/message.js +3 -15
- package/package.json +5 -6
- package/es/actions/base.d.ts +0 -24
- package/es/actions/confirm.d.ts +0 -7
- package/es/actions/danger-confirm.d.ts +0 -7
- package/es/actions/danger-pop-confirm.d.ts +0 -5
- package/es/actions/dialog-component.d.ts +0 -10
- package/es/actions/dialog-form.d.ts +0 -29
- package/es/actions/dialog-info.d.ts +0 -9
- package/es/actions/dialog-table.d.ts +0 -9
- package/es/actions/dialog.d.ts +0 -40
- package/es/actions/drawer-form.d.ts +0 -6
- package/es/actions/drawer-info.d.ts +0 -6
- package/es/actions/drawer-table.d.ts +0 -6
- package/es/actions/drawer.d.ts +0 -6
- package/es/actions/error.d.ts +0 -7
- package/es/actions/index.d.ts +0 -107
- package/es/actions/link.d.ts +0 -8
- package/es/actions/notice.d.ts +0 -7
- package/es/actions/pop-confirm.d.ts +0 -9
- package/es/actions/request.d.ts +0 -9
- package/es/actions/utils.d.ts +0 -1
- package/es/card/card-container.d.ts +0 -18
- package/es/card/divider.d.ts +0 -6
- package/es/card/index.d.ts +0 -109
- package/es/card/selectable.d.ts +0 -13
- package/es/card/tab.d.ts +0 -6
- package/es/card/utils.d.ts +0 -9
- package/es/field/index.d.ts +0 -3
- package/es/form/Components/Editable/index.d.ts +0 -20
- package/es/form/Components/FormGroup/index.d.ts +0 -13
- package/es/form/Components/LightFilter/componentMap.d.ts +0 -3
- package/es/form/Components/LightFilter/index.d.ts +0 -17
- package/es/form/Components/ProField/index.d.ts +0 -2
- package/es/form/Components/ProField/mapDateFormat.d.ts +0 -3
- package/es/form/Components/Text/index.d.ts +0 -7
- package/es/form/Filter/AdvancedFilter.d.ts +0 -7
- package/es/form/Filter/Layout.d.ts +0 -5
- package/es/form/Filter/LightFilter.d.ts +0 -7
- package/es/form/Filter/SimpleFilter.d.ts +0 -7
- package/es/form/Filter/index.d.ts +0 -9
- package/es/form/Filter/index2.d.ts +0 -13
- package/es/form/Filter/useBindUrl.d.ts +0 -2
- package/es/form/Filter/useSpecialProps.d.ts +0 -6
- package/es/form/ProForm/customComponent.d.ts +0 -3
- package/es/form/ProForm/index.d.ts +0 -5
- package/es/form/ProForm/useAutoLayout.d.ts +0 -9
- package/es/form/ProForm/useAutoSubmit.d.ts +0 -6
- package/es/form/ProForm/useFieldRequest.d.ts +0 -5
- package/es/form/ProForm/useFormDisplayValues.d.ts +0 -4
- package/es/form/ProForm/useInitialRequest.d.ts +0 -6
- package/es/form/SchemaForm/adapterComponent.d.ts +0 -5
- package/es/form/SchemaForm/adapterDecorator.d.ts +0 -6
- package/es/form/SchemaForm/adapterType.d.ts +0 -5
- package/es/form/SchemaForm/index.d.ts +0 -4
- package/es/form/SchemaForm/initializeArrayCards.d.ts +0 -3
- package/es/form/SchemaForm/initializeArrayCollapse.d.ts +0 -3
- package/es/form/SchemaForm/initializeArrayItems.d.ts +0 -3
- package/es/form/SchemaForm/initializeArrayTable.d.ts +0 -3
- package/es/form/SchemaForm/initializeDataSource.d.ts +0 -15
- package/es/form/SchemaForm/initializeFormButton.d.ts +0 -3
- package/es/form/SchemaForm/initializeFormCollapse.d.ts +0 -3
- package/es/form/SchemaForm/initializeFormGroup.d.ts +0 -3
- package/es/form/SchemaForm/initializeFormStep.d.ts +0 -5
- package/es/form/SchemaForm/initializeFormTab.d.ts +0 -3
- package/es/form/SchemaForm/initializeReactions.d.ts +0 -2
- package/es/form/SchemaForm/initializeRequest.d.ts +0 -11
- package/es/form/SchemaForm/initializeRules.d.ts +0 -11
- package/es/form/SchemaForm/initializeSelectTable.d.ts +0 -3
- package/es/form/SchemaForm/reactions.d.ts +0 -6
- package/es/form/docs/ActionResponse.d.ts +0 -7
- package/es/form/fieldTypeMap.d.ts +0 -7
- package/es/form/index.d.ts +0 -125
- package/es/form/locales/validate.d.ts +0 -159
- package/es/form/schemaNameMap.d.ts +0 -5
- package/es/form/typing.d.ts +0 -172
- package/es/form/utils.d.ts +0 -55
- package/es/form/warning.d.ts +0 -3
- package/es/hooks/index.d.ts +0 -2
- package/es/index-without-icon.d.ts +0 -32
- package/es/index.d.ts +0 -32
- package/es/info/components/InfoGroup/index.d.ts +0 -5
- package/es/info/components/InfoValueItem/index.d.ts +0 -5
- package/es/info/components/ProInfoItem/index.d.ts +0 -5
- package/es/info/components/baseInfo/index.d.ts +0 -8
- package/es/info/components/headerInfo/index.d.ts +0 -8
- package/es/info/components/tableInfo/index.d.ts +0 -7
- package/es/info/index.d.ts +0 -10
- package/es/info/typing.d.ts +0 -218
- package/es/info/utils/index.d.ts +0 -20
- package/es/info/utils/layout.d.ts +0 -2
- package/es/info/utils/utils.d.ts +0 -1
- package/es/layout/index.d.ts +0 -2
- package/es/nocode/configurators/Card.d.ts +0 -3
- package/es/nocode/configurators/PageHeader.d.ts +0 -3
- package/es/nocode/configurators/ProTable.d.ts +0 -3
- package/es/nocode/configurators/common.d.ts +0 -280
- package/es/nocode/configurators/index.d.ts +0 -15
- package/es/nocode/configurators/map.d.ts +0 -2
- package/es/nocode/index.d.ts +0 -8
- package/es/nocode/pages/editor.d.ts +0 -12
- package/es/nocode/pages/index.d.ts +0 -14
- package/es/nocode/pages/playground.d.ts +0 -11
- package/es/nocode/pages/renderer.d.ts +0 -10
- package/es/nocode/playground.d.ts +0 -14
- package/es/page-container/index.d.ts +0 -3
- package/es/page-header/index.d.ts +0 -74
- package/es/sidebar/components/sidebar-container/index.d.ts +0 -5
- package/es/sidebar/components/tree/index.d.ts +0 -6
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.d.ts +0 -15
- package/es/sidebar/components/tree-node/components/IconAction/index.d.ts +0 -12
- package/es/sidebar/components/tree-node/components/IconSwitch/index.d.ts +0 -23
- package/es/sidebar/components/tree-node/index.d.ts +0 -7
- package/es/sidebar/index.d.ts +0 -7
- package/es/sidebar/typing.d.ts +0 -137
- package/es/sidebar/utils/action-ref.d.ts +0 -3
- package/es/sidebar/utils/index.d.ts +0 -361
- package/es/skeleton/index.d.ts +0 -3
- package/es/table/components/EmptyContent/index.d.ts +0 -2
- package/es/table/components/Filter/index.d.ts +0 -9
- package/es/table/components/Layout/index.d.ts +0 -5
- package/es/table/components/Pagination/index.d.ts +0 -7
- package/es/table/components/QuickAction/index.d.ts +0 -10
- package/es/table/components/ToolBar/DensityIcon.d.ts +0 -4
- package/es/table/components/ToolBar/FilterColumnIcon.d.ts +0 -4
- package/es/table/components/ToolBar/FullScreenIcon.d.ts +0 -4
- package/es/table/components/ToolBar/Fullscreen.d.ts +0 -10
- package/es/table/components/ToolBar/RefreshIcon.d.ts +0 -4
- package/es/table/components/ToolBar/index.d.ts +0 -5
- package/es/table/index.d.ts +0 -5
- package/es/table/typing.d.ts +0 -299
- package/es/table/utils/columnRender.d.ts +0 -13
- package/es/table/utils/genProColumnToColumn.d.ts +0 -13
- package/es/table/utils/getTableProps.d.ts +0 -2
- package/es/table/utils/getTableSortIcons.d.ts +0 -3
- package/es/table/utils/index.d.ts +0 -19
- package/es/table/utils/pureColumnRender.d.ts +0 -9
- package/es/table/utils/pureGenProColumnToColumn.d.ts +0 -7
- package/es/table/utils/useTableSelection.d.ts +0 -3
- package/es/templates/Detail/index.d.ts +0 -2
- package/es/templates/Form/index.d.ts +0 -2
- package/es/templates/List/index.d.ts +0 -9
- package/es/templates/index.d.ts +0 -3
- package/es/timeline/ProTimeLineItem/index.d.ts +0 -5
- package/es/timeline/index.d.ts +0 -10
- package/es/timeline/typing.d.ts +0 -106
- package/es/utils/index.d.ts +0 -3
- package/es/utils/message.d.ts +0 -3
- package/lib/actions/base.d.ts +0 -24
- package/lib/actions/confirm.d.ts +0 -7
- package/lib/actions/danger-confirm.d.ts +0 -7
- package/lib/actions/danger-pop-confirm.d.ts +0 -5
- package/lib/actions/dialog-component.d.ts +0 -10
- package/lib/actions/dialog-form.d.ts +0 -29
- package/lib/actions/dialog-info.d.ts +0 -9
- package/lib/actions/dialog-table.d.ts +0 -9
- package/lib/actions/dialog.d.ts +0 -40
- package/lib/actions/drawer-form.d.ts +0 -6
- package/lib/actions/drawer-info.d.ts +0 -6
- package/lib/actions/drawer-table.d.ts +0 -6
- package/lib/actions/drawer.d.ts +0 -6
- package/lib/actions/error.d.ts +0 -7
- package/lib/actions/index.d.ts +0 -107
- package/lib/actions/link.d.ts +0 -8
- package/lib/actions/notice.d.ts +0 -7
- package/lib/actions/pop-confirm.d.ts +0 -9
- package/lib/actions/request.d.ts +0 -9
- package/lib/actions/utils.d.ts +0 -1
- package/lib/card/card-container.d.ts +0 -18
- package/lib/card/divider.d.ts +0 -6
- package/lib/card/index.d.ts +0 -109
- package/lib/card/selectable.d.ts +0 -13
- package/lib/card/tab.d.ts +0 -6
- package/lib/card/utils.d.ts +0 -9
- package/lib/field/index.d.ts +0 -3
- package/lib/form/Components/Editable/index.d.ts +0 -20
- package/lib/form/Components/FormGroup/index.d.ts +0 -13
- package/lib/form/Components/LightFilter/componentMap.d.ts +0 -3
- package/lib/form/Components/LightFilter/index.d.ts +0 -17
- package/lib/form/Components/ProField/index.d.ts +0 -2
- package/lib/form/Components/ProField/mapDateFormat.d.ts +0 -3
- package/lib/form/Components/Text/index.d.ts +0 -7
- package/lib/form/Filter/AdvancedFilter.d.ts +0 -7
- package/lib/form/Filter/Layout.d.ts +0 -5
- package/lib/form/Filter/LightFilter.d.ts +0 -7
- package/lib/form/Filter/SimpleFilter.d.ts +0 -7
- package/lib/form/Filter/index.d.ts +0 -9
- package/lib/form/Filter/index2.d.ts +0 -13
- package/lib/form/Filter/useBindUrl.d.ts +0 -2
- package/lib/form/Filter/useSpecialProps.d.ts +0 -6
- package/lib/form/ProForm/customComponent.d.ts +0 -3
- package/lib/form/ProForm/index.d.ts +0 -5
- package/lib/form/ProForm/useAutoLayout.d.ts +0 -9
- package/lib/form/ProForm/useAutoSubmit.d.ts +0 -6
- package/lib/form/ProForm/useFieldRequest.d.ts +0 -5
- package/lib/form/ProForm/useFormDisplayValues.d.ts +0 -4
- package/lib/form/ProForm/useInitialRequest.d.ts +0 -6
- package/lib/form/SchemaForm/adapterComponent.d.ts +0 -5
- package/lib/form/SchemaForm/adapterDecorator.d.ts +0 -6
- package/lib/form/SchemaForm/adapterType.d.ts +0 -5
- package/lib/form/SchemaForm/index.d.ts +0 -4
- package/lib/form/SchemaForm/initializeArrayCards.d.ts +0 -3
- package/lib/form/SchemaForm/initializeArrayCollapse.d.ts +0 -3
- package/lib/form/SchemaForm/initializeArrayItems.d.ts +0 -3
- package/lib/form/SchemaForm/initializeArrayTable.d.ts +0 -3
- package/lib/form/SchemaForm/initializeDataSource.d.ts +0 -15
- package/lib/form/SchemaForm/initializeFormButton.d.ts +0 -3
- package/lib/form/SchemaForm/initializeFormCollapse.d.ts +0 -3
- package/lib/form/SchemaForm/initializeFormGroup.d.ts +0 -3
- package/lib/form/SchemaForm/initializeFormStep.d.ts +0 -5
- package/lib/form/SchemaForm/initializeFormTab.d.ts +0 -3
- package/lib/form/SchemaForm/initializeReactions.d.ts +0 -2
- package/lib/form/SchemaForm/initializeRequest.d.ts +0 -11
- package/lib/form/SchemaForm/initializeRules.d.ts +0 -11
- package/lib/form/SchemaForm/initializeSelectTable.d.ts +0 -3
- package/lib/form/SchemaForm/reactions.d.ts +0 -6
- package/lib/form/docs/ActionResponse.d.ts +0 -7
- package/lib/form/fieldTypeMap.d.ts +0 -7
- package/lib/form/index.d.ts +0 -125
- package/lib/form/locales/validate.d.ts +0 -159
- package/lib/form/schemaNameMap.d.ts +0 -5
- package/lib/form/typing.d.ts +0 -172
- package/lib/form/utils.d.ts +0 -55
- package/lib/form/warning.d.ts +0 -3
- package/lib/hooks/index.d.ts +0 -2
- package/lib/index-without-icon.d.ts +0 -32
- package/lib/index.d.ts +0 -32
- package/lib/info/components/InfoGroup/index.d.ts +0 -5
- package/lib/info/components/InfoValueItem/index.d.ts +0 -5
- package/lib/info/components/ProInfoItem/index.d.ts +0 -5
- package/lib/info/components/baseInfo/index.d.ts +0 -8
- package/lib/info/components/headerInfo/index.d.ts +0 -8
- package/lib/info/components/tableInfo/index.d.ts +0 -7
- package/lib/info/index.d.ts +0 -10
- package/lib/info/typing.d.ts +0 -218
- package/lib/info/utils/index.d.ts +0 -20
- package/lib/info/utils/layout.d.ts +0 -2
- package/lib/info/utils/utils.d.ts +0 -1
- package/lib/layout/index.d.ts +0 -2
- package/lib/nocode/configurators/Card.d.ts +0 -3
- package/lib/nocode/configurators/PageHeader.d.ts +0 -3
- package/lib/nocode/configurators/ProTable.d.ts +0 -3
- package/lib/nocode/configurators/common.d.ts +0 -280
- package/lib/nocode/configurators/index.d.ts +0 -15
- package/lib/nocode/configurators/map.d.ts +0 -2
- package/lib/nocode/index.d.ts +0 -8
- package/lib/nocode/pages/editor.d.ts +0 -12
- package/lib/nocode/pages/index.d.ts +0 -14
- package/lib/nocode/pages/playground.d.ts +0 -11
- package/lib/nocode/pages/renderer.d.ts +0 -10
- package/lib/nocode/playground.d.ts +0 -14
- package/lib/page-container/index.d.ts +0 -3
- package/lib/page-header/index.d.ts +0 -74
- package/lib/sidebar/components/sidebar-container/index.d.ts +0 -5
- package/lib/sidebar/components/tree/index.d.ts +0 -6
- package/lib/sidebar/components/tree-node/components/HoverTooltip/index.d.ts +0 -15
- package/lib/sidebar/components/tree-node/components/IconAction/index.d.ts +0 -12
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.d.ts +0 -23
- package/lib/sidebar/components/tree-node/index.d.ts +0 -7
- package/lib/sidebar/index.d.ts +0 -7
- package/lib/sidebar/typing.d.ts +0 -137
- package/lib/sidebar/utils/action-ref.d.ts +0 -3
- package/lib/sidebar/utils/index.d.ts +0 -361
- package/lib/skeleton/index.d.ts +0 -3
- package/lib/table/components/EmptyContent/index.d.ts +0 -2
- package/lib/table/components/Filter/index.d.ts +0 -9
- package/lib/table/components/Layout/index.d.ts +0 -5
- package/lib/table/components/Pagination/index.d.ts +0 -7
- package/lib/table/components/QuickAction/index.d.ts +0 -10
- package/lib/table/components/ToolBar/DensityIcon.d.ts +0 -4
- package/lib/table/components/ToolBar/FilterColumnIcon.d.ts +0 -4
- package/lib/table/components/ToolBar/FullScreenIcon.d.ts +0 -4
- package/lib/table/components/ToolBar/Fullscreen.d.ts +0 -10
- package/lib/table/components/ToolBar/RefreshIcon.d.ts +0 -4
- package/lib/table/components/ToolBar/index.d.ts +0 -5
- package/lib/table/index.d.ts +0 -5
- package/lib/table/typing.d.ts +0 -299
- package/lib/table/utils/columnRender.d.ts +0 -13
- package/lib/table/utils/genProColumnToColumn.d.ts +0 -13
- package/lib/table/utils/getTableProps.d.ts +0 -2
- package/lib/table/utils/getTableSortIcons.d.ts +0 -3
- package/lib/table/utils/index.d.ts +0 -19
- package/lib/table/utils/pureColumnRender.d.ts +0 -9
- package/lib/table/utils/pureGenProColumnToColumn.d.ts +0 -7
- package/lib/table/utils/useTableSelection.d.ts +0 -3
- package/lib/templates/Detail/index.d.ts +0 -2
- package/lib/templates/Form/index.d.ts +0 -2
- package/lib/templates/List/index.d.ts +0 -9
- package/lib/templates/index.d.ts +0 -3
- package/lib/timeline/ProTimeLineItem/index.d.ts +0 -5
- package/lib/timeline/index.d.ts +0 -10
- package/lib/timeline/typing.d.ts +0 -106
- package/lib/utils/index.d.ts +0 -3
- package/lib/utils/message.d.ts +0 -3
package/es/table/index.js
CHANGED
|
@@ -1,37 +1,21 @@
|
|
|
1
|
-
var _excluded = ["header", "className", "tableClassName", "mainAction", "extra", "dataFilter", "afterDataFilter", "toolBar", "columns", "useRowSelection", "rowSelection", "onChangeRowSelection", "getRowSelection", "primaryKey", "footerAction", "footer", "url", "pageKey", "pageSizeKey", "method", "params", "formatSort", "formatParams", "formatResult", "requestWhenMount", "showPagination", "pageSizeList", "responsivePaginationType", "showSkeleton", "skeletonSize", "actionRef", "dataSource", "filterDebounce", "footerSuction", "autoRefresh", "customRequest", "filterColumnType", "defaultFilterParams", "reserveSelectedRecords", "size", "disableSelectAll", "context", "fixedTableBody", "isTree"];
|
|
2
|
-
|
|
1
|
+
var _excluded = ["header", "className", "tableClassName", "mainAction", "extra", "dataFilter", "afterDataFilter", "toolBar", "columns", "useRowSelection", "rowSelection", "onChangeRowSelection", "getRowSelection", "primaryKey", "footerAction", "footer", "url", "pageKey", "pageSizeKey", "method", "params", "formatSort", "formatParams", "formatResult", "requestConfig", "requestWhenMount", "showPagination", "pageSizeList", "responsivePaginationType", "showSkeleton", "skeletonSize", "actionRef", "dataSource", "filterDebounce", "footerSuction", "autoRefresh", "customRequest", "filterColumnType", "defaultFilterParams", "reserveSelectedRecords", "size", "disableSelectAll", "context", "fixedTableBody", "isTree"];
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
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
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
6
|
-
|
|
7
5
|
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."); }
|
|
8
|
-
|
|
9
6
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
10
|
-
|
|
11
7
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
|
-
|
|
13
8
|
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; }
|
|
14
|
-
|
|
15
9
|
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; }
|
|
16
|
-
|
|
17
10
|
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; }
|
|
18
|
-
|
|
19
11
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
20
|
-
|
|
21
12
|
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."); }
|
|
22
|
-
|
|
23
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); }
|
|
24
|
-
|
|
25
14
|
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; }
|
|
26
|
-
|
|
27
15
|
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; }
|
|
28
|
-
|
|
29
16
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
30
|
-
|
|
31
17
|
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; }
|
|
32
|
-
|
|
33
18
|
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; }
|
|
34
|
-
|
|
35
19
|
import React, { useState, useEffect, useRef, useMemo } from 'react';
|
|
36
20
|
import { Table, Checkbox } from '@alicloudfe/components';
|
|
37
21
|
import Pagination from './components/Pagination';
|
|
@@ -52,230 +36,202 @@ import ProPageContainer from '../page-container';
|
|
|
52
36
|
import debounce from 'lodash.debounce';
|
|
53
37
|
export * from './typing';
|
|
54
38
|
var cls = usePrefixCls('teamix-pro-table');
|
|
39
|
+
|
|
55
40
|
/**
|
|
56
41
|
* 处理原生传入的 columns 以便于 选择列 方便处理
|
|
57
42
|
* @param columns 原生传入的 columns
|
|
58
43
|
* @returns
|
|
59
44
|
*/
|
|
60
|
-
|
|
61
45
|
var processColumns = function processColumns(columns, initialColumns) {
|
|
62
46
|
var _getGlobalConfig;
|
|
63
|
-
|
|
64
47
|
var globalFilterColumns = (_getGlobalConfig = getGlobalConfig('ProTable')) === null || _getGlobalConfig === void 0 ? void 0 : _getGlobalConfig.filterColumns;
|
|
65
48
|
var filterColumns = columns.filter(function (item) {
|
|
66
49
|
return item.columnFilters !== false && (item === null || item === void 0 ? void 0 : item.hidden) !== true && (!globalFilterColumns || globalFilterColumns(item));
|
|
67
|
-
});
|
|
68
|
-
|
|
50
|
+
});
|
|
51
|
+
// 处理只剩一列批量选择的情况下宽度错乱问题
|
|
69
52
|
if (filterColumns === null || filterColumns === void 0 ? void 0 : filterColumns.length) {
|
|
70
53
|
var _initialColumns$;
|
|
71
|
-
|
|
72
54
|
if ((filterColumns === null || filterColumns === void 0 ? void 0 : filterColumns.length) === 1) {
|
|
73
55
|
var _filterColumns$, _filterColumns$2;
|
|
74
|
-
|
|
75
56
|
if ((_filterColumns$ = filterColumns[0]) === null || _filterColumns$ === void 0 ? void 0 : _filterColumns$.width) {
|
|
76
57
|
delete filterColumns[0].width;
|
|
77
58
|
}
|
|
78
|
-
|
|
79
59
|
if ((_filterColumns$2 = filterColumns[0]) === null || _filterColumns$2 === void 0 ? void 0 : _filterColumns$2.lock) {
|
|
80
60
|
filterColumns[0].lock = false;
|
|
81
61
|
}
|
|
82
62
|
} else if (((_initialColumns$ = initialColumns[0]) === null || _initialColumns$ === void 0 ? void 0 : _initialColumns$.columnFilters) !== false) {
|
|
83
63
|
var _initialColumns$2, _initialColumns$3;
|
|
84
|
-
|
|
85
64
|
if ((_initialColumns$2 = initialColumns[0]) === null || _initialColumns$2 === void 0 ? void 0 : _initialColumns$2.width) {
|
|
86
65
|
filterColumns[0].width = initialColumns[0].width;
|
|
87
66
|
}
|
|
88
|
-
|
|
89
67
|
if ((_initialColumns$3 = initialColumns[0]) === null || _initialColumns$3 === void 0 ? void 0 : _initialColumns$3.lock) {
|
|
90
68
|
filterColumns[0].lock = initialColumns[0].lock;
|
|
91
69
|
}
|
|
92
70
|
}
|
|
93
71
|
}
|
|
94
|
-
|
|
95
72
|
return filterColumns;
|
|
96
73
|
};
|
|
97
|
-
/** 默认请求翻页参数 */
|
|
98
|
-
|
|
99
74
|
|
|
75
|
+
/** 默认请求翻页参数 */
|
|
100
76
|
var globalPageKey = 'currentPage';
|
|
101
77
|
var globalPageSizeKey = 'pageSize';
|
|
102
|
-
|
|
103
78
|
var globalFormatSort = function globalFormatSort(sort) {
|
|
104
79
|
if (Object.keys(sort).length > 0) {
|
|
105
80
|
return {
|
|
106
81
|
sort: sort
|
|
107
82
|
};
|
|
108
83
|
}
|
|
109
|
-
|
|
110
84
|
return {};
|
|
111
85
|
};
|
|
112
|
-
|
|
113
86
|
var ProTable = function ProTable(props) {
|
|
114
87
|
var _rowSelection$selecte;
|
|
115
|
-
|
|
116
88
|
var header = props.header,
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
89
|
+
className = props.className,
|
|
90
|
+
tableClassName = props.tableClassName,
|
|
91
|
+
mainAction = props.mainAction,
|
|
92
|
+
extra = props.extra,
|
|
93
|
+
propsDataFilter = props.dataFilter,
|
|
94
|
+
afterDataFilter = props.afterDataFilter,
|
|
95
|
+
toolBar = props.toolBar,
|
|
96
|
+
propsColumns = props.columns,
|
|
97
|
+
useRowSelection = props.useRowSelection,
|
|
98
|
+
propsRowSelection = props.rowSelection,
|
|
99
|
+
onChangeRowSelection = props.onChangeRowSelection,
|
|
100
|
+
getRowSelection = props.getRowSelection,
|
|
101
|
+
primaryKey = props.primaryKey,
|
|
102
|
+
footerAction = props.footerAction,
|
|
103
|
+
footer = props.footer,
|
|
104
|
+
url = props.url,
|
|
105
|
+
pageKey = props.pageKey,
|
|
106
|
+
pageSizeKey = props.pageSizeKey,
|
|
107
|
+
_props$method = props.method,
|
|
108
|
+
method = _props$method === void 0 ? 'get' : _props$method,
|
|
109
|
+
_props$params = props.params,
|
|
110
|
+
propsParams = _props$params === void 0 ? {} : _props$params,
|
|
111
|
+
formatSort = props.formatSort,
|
|
112
|
+
_props$formatParams = props.formatParams,
|
|
113
|
+
formatParams = _props$formatParams === void 0 ? function (params) {
|
|
114
|
+
return params;
|
|
115
|
+
} : _props$formatParams,
|
|
116
|
+
formatResult = props.formatResult,
|
|
117
|
+
requestConfig = props.requestConfig,
|
|
118
|
+
_props$requestWhenMou = props.requestWhenMount,
|
|
119
|
+
requestWhenMount = _props$requestWhenMou === void 0 ? true : _props$requestWhenMou,
|
|
120
|
+
_props$showPagination = props.showPagination,
|
|
121
|
+
showPagination = _props$showPagination === void 0 ? true : _props$showPagination,
|
|
122
|
+
_props$pageSizeList = props.pageSizeList,
|
|
123
|
+
pageSizeList = _props$pageSizeList === void 0 ? [5, 10, 20, 50, 100] : _props$pageSizeList,
|
|
124
|
+
responsivePaginationType = props.responsivePaginationType,
|
|
125
|
+
_props$showSkeleton = props.showSkeleton,
|
|
126
|
+
propsShowSkeleton = _props$showSkeleton === void 0 ? true : _props$showSkeleton,
|
|
127
|
+
_props$skeletonSize = props.skeletonSize,
|
|
128
|
+
skeletonSize = _props$skeletonSize === void 0 ? 5 : _props$skeletonSize,
|
|
129
|
+
propsActionRef = props.actionRef,
|
|
130
|
+
propsDataSource = props.dataSource,
|
|
131
|
+
_props$filterDebounce = props.filterDebounce,
|
|
132
|
+
filterDebounce = _props$filterDebounce === void 0 ? 300 : _props$filterDebounce,
|
|
133
|
+
_props$footerSuction = props.footerSuction,
|
|
134
|
+
footerSuction = _props$footerSuction === void 0 ? false : _props$footerSuction,
|
|
135
|
+
_props$autoRefresh = props.autoRefresh,
|
|
136
|
+
autoRefresh = _props$autoRefresh === void 0 ? function () {
|
|
137
|
+
return false;
|
|
138
|
+
} : _props$autoRefresh,
|
|
139
|
+
customRequest = props.customRequest,
|
|
140
|
+
_props$filterColumnTy = props.filterColumnType,
|
|
141
|
+
filterColumnType = _props$filterColumnTy === void 0 ? 'auto' : _props$filterColumnTy,
|
|
142
|
+
defaultFilterParams = props.defaultFilterParams,
|
|
143
|
+
_props$reserveSelecte = props.reserveSelectedRecords,
|
|
144
|
+
reserveSelectedRecords = _props$reserveSelecte === void 0 ? false : _props$reserveSelecte,
|
|
145
|
+
_props$size = props.size,
|
|
146
|
+
propsSize = _props$size === void 0 ? 'medium' : _props$size,
|
|
147
|
+
disableSelectAll = props.disableSelectAll,
|
|
148
|
+
context = props.context,
|
|
149
|
+
_props$fixedTableBody = props.fixedTableBody,
|
|
150
|
+
fixedTableBody = _props$fixedTableBody === void 0 ? false : _props$fixedTableBody,
|
|
151
|
+
isTree = props.isTree,
|
|
152
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
181
153
|
var targetPageKey = pageKey || globalPageKey;
|
|
182
154
|
var targetPageSizeKey = pageSizeKey || globalPageSizeKey;
|
|
183
155
|
var targetFormatSort = formatSort || globalFormatSort;
|
|
184
|
-
|
|
185
156
|
var _useState = useState(1),
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
157
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
158
|
+
currentPage = _useState2[0],
|
|
159
|
+
setCurrentPage = _useState2[1];
|
|
190
160
|
var _useState3 = useState(props.pageSize || 10),
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
161
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
162
|
+
pageSize = _useState4[0],
|
|
163
|
+
setPageSize = _useState4[1];
|
|
195
164
|
var _useState5 = useState(0),
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
165
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
166
|
+
total = _useState6[0],
|
|
167
|
+
setTotal = _useState6[1];
|
|
200
168
|
var _useState7 = useState(propsDataSource !== null && propsDataSource !== void 0 ? propsDataSource : []),
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
169
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
170
|
+
data = _useState8[0],
|
|
171
|
+
setData = _useState8[1];
|
|
205
172
|
var _useState9 = useState(props.sort || {}),
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
173
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
174
|
+
sort = _useState10[0],
|
|
175
|
+
setSort = _useState10[1];
|
|
210
176
|
var _useState11 = useState(!propsDataSource && requestWhenMount && propsShowSkeleton),
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
177
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
178
|
+
showSkeleton = _useState12[0],
|
|
179
|
+
setShowSkeleton = _useState12[1]; // 首次加载,渲染骨架屏
|
|
216
180
|
var skeletonDataSource = new Array(skeletonSize).fill({});
|
|
217
|
-
var requestDataKey = method.toLowerCase() === 'get' ? 'params' : 'data';
|
|
218
|
-
|
|
181
|
+
var requestDataKey = method.toLowerCase() === 'get' ? 'params' : 'data';
|
|
182
|
+
// 如果使用 customRequest 的话,内置 loading
|
|
219
183
|
var _useState13 = useState(requestWhenMount),
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
184
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
185
|
+
customTableLoading = _useState14[0],
|
|
186
|
+
setCustomTableLoading = _useState14[1];
|
|
224
187
|
var tableRef = useRef(null);
|
|
225
|
-
var actionRef = useRef();
|
|
226
|
-
|
|
188
|
+
var actionRef = useRef();
|
|
189
|
+
// 传给 table 的过滤后的 columns
|
|
227
190
|
var _useState15 = useState(processColumns(propsColumns !== null && propsColumns !== void 0 ? propsColumns : [], propsColumns)),
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
191
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
192
|
+
filteredColumns = _useState16[0],
|
|
193
|
+
setFilteredColumns = _useState16[1];
|
|
232
194
|
var _useState17 = useState(propsSize),
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
195
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
196
|
+
size = _useState18[0],
|
|
197
|
+
_setSize = _useState18[1];
|
|
237
198
|
var _useState19 = useState(true),
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
// 因为只做存储用。不需要更新视图以及需要同步更改。所以不使用 setState 更新
|
|
242
|
-
|
|
199
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
200
|
+
showLoading = _useState20[0],
|
|
201
|
+
setShowLoading = _useState20[1];
|
|
243
202
|
|
|
203
|
+
// 存储能够被 on 监听到的 ProTable 状态
|
|
204
|
+
// 因为只做存储用。不需要更新视图以及需要同步更改。所以不使用 setState 更新
|
|
244
205
|
var _useState21 = useState({
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
206
|
+
fullScreenState: false,
|
|
207
|
+
filterRules: {},
|
|
208
|
+
filterColumns: []
|
|
209
|
+
}),
|
|
210
|
+
_useState22 = _slicedToArray(_useState21, 1),
|
|
211
|
+
actionRefState = _useState22[0];
|
|
212
|
+
|
|
213
|
+
// 存储 on 监听事件
|
|
253
214
|
var _useState23 = useState({
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
215
|
+
fullScreenState: {}
|
|
216
|
+
}),
|
|
217
|
+
_useState24 = _slicedToArray(_useState23, 1),
|
|
218
|
+
actionRefCallback = _useState24[0];
|
|
259
219
|
|
|
220
|
+
// 存储定时器 id
|
|
260
221
|
var autoRefreshTimerRef = useRef();
|
|
261
222
|
var onResize = null;
|
|
262
223
|
useEffect(function () {
|
|
263
224
|
var _propsDataFilter$sche, _propsDataFilter$sche2;
|
|
264
|
-
|
|
265
225
|
getHeaderHeight(fullscreenState);
|
|
266
226
|
getFooterSuctionState();
|
|
267
|
-
|
|
268
227
|
if (window.onresize) {
|
|
269
228
|
onResize = window.onresize;
|
|
270
229
|
window.onresize = debounce(function () {
|
|
271
230
|
var _onResize;
|
|
272
|
-
|
|
273
231
|
(_onResize = onResize) === null || _onResize === void 0 ? void 0 : _onResize();
|
|
274
|
-
|
|
275
232
|
if (footerSuction) {
|
|
276
233
|
getFooterSuctionState();
|
|
277
234
|
}
|
|
278
|
-
|
|
279
235
|
if (fixedTableBody) {
|
|
280
236
|
getHeaderHeight(fullscreenState);
|
|
281
237
|
}
|
|
@@ -285,44 +241,37 @@ var ProTable = function ProTable(props) {
|
|
|
285
241
|
if (footerSuction) {
|
|
286
242
|
getFooterSuctionState();
|
|
287
243
|
}
|
|
288
|
-
|
|
289
244
|
if (fixedTableBody) {
|
|
290
245
|
getHeaderHeight(fullscreenState);
|
|
291
246
|
}
|
|
292
247
|
}, 500);
|
|
293
|
-
}
|
|
294
|
-
|
|
248
|
+
}
|
|
295
249
|
|
|
250
|
+
// 如果不传 dataFilter,则在这里初始化请求
|
|
296
251
|
var hasDataFilter = (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : (_propsDataFilter$sche = propsDataFilter.schema) === null || _propsDataFilter$sche === void 0 ? void 0 : _propsDataFilter$sche.length) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : (_propsDataFilter$sche2 = propsDataFilter.schema) === null || _propsDataFilter$sche2 === void 0 ? void 0 : _propsDataFilter$sche2.length) > 0;
|
|
297
|
-
|
|
298
252
|
if (requestWhenMount && !hasDataFilter) {
|
|
299
253
|
processDefaultFilter(propsColumns, actionRef, defaultFilterParams);
|
|
300
|
-
|
|
301
254
|
_request();
|
|
302
255
|
}
|
|
303
|
-
|
|
304
256
|
return function () {
|
|
305
257
|
if (onResize) {
|
|
306
258
|
window.onresize = onResize;
|
|
307
259
|
} else {
|
|
308
260
|
window.onresize = null;
|
|
309
261
|
}
|
|
310
|
-
|
|
311
262
|
if (autoRefreshTimerRef.current) {
|
|
312
263
|
clearTimeout(autoRefreshTimerRef.current);
|
|
313
264
|
}
|
|
314
|
-
|
|
315
265
|
actionRef.current = undefined;
|
|
316
266
|
};
|
|
317
|
-
}, []);
|
|
267
|
+
}, []);
|
|
318
268
|
|
|
269
|
+
// 获取header高度,用作全屏吸底吸底高度计算以及固定body高度计算(滚动条在底部)
|
|
319
270
|
var getHeaderHeight = function getHeaderHeight(isFullscreen, offset) {
|
|
320
271
|
var _tableDom$getElements, _tableDom$getElements2, _document$querySelect, _document$querySelect2, _document$querySelect3;
|
|
321
|
-
|
|
322
272
|
if (!fixedTableBody) {
|
|
323
273
|
return;
|
|
324
274
|
}
|
|
325
|
-
|
|
326
275
|
var tableDom = tableRef.current;
|
|
327
276
|
var headerDom = tableDom === null || tableDom === void 0 ? void 0 : (_tableDom$getElements = tableDom.getElementsByClassName('teamix-pro-table-layout')) === null || _tableDom$getElements === void 0 ? void 0 : _tableDom$getElements[0];
|
|
328
277
|
var basePrefix = usePrefixCls('', {
|
|
@@ -331,95 +280,92 @@ var ProTable = function ProTable(props) {
|
|
|
331
280
|
var tableHeaderDom = tableDom === null || tableDom === void 0 ? void 0 : (_tableDom$getElements2 = tableDom.getElementsByClassName(basePrefix('table-header-inner'))) === null || _tableDom$getElements2 === void 0 ? void 0 : _tableDom$getElements2[0];
|
|
332
281
|
var pageContainerDom = document.querySelector('.teamix-pro-page-container-header');
|
|
333
282
|
var teamixNavDom = document.querySelector('.teamix-nav-console');
|
|
334
|
-
var footerRowSelectionDom = document.querySelector('.teamix-pro-page-container-footer');
|
|
335
|
-
|
|
283
|
+
var footerRowSelectionDom = document.querySelector('.teamix-pro-page-container-footer');
|
|
284
|
+
// 这边不能直接取 next-table-body
|
|
336
285
|
var tableBodyDom = (_document$querySelect = document.querySelector('.teamix-pro-table')) === null || _document$querySelect === void 0 ? void 0 : (_document$querySelect2 = _document$querySelect.getElementsByTagName('table')) === null || _document$querySelect2 === void 0 ? void 0 : (_document$querySelect3 = _document$querySelect2[1]) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.parentNode;
|
|
337
286
|
var headerFixedTopSectionDom = document.querySelector('.teamix-pro-page-container-fixed-top');
|
|
338
287
|
setTimeout(function () {
|
|
339
288
|
var _headerDom$offsetHeig, _tableHeaderDom$offse;
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
289
|
+
var headerHeight = (_headerDom$offsetHeig = headerDom === null || headerDom === void 0 ? void 0 : headerDom.offsetHeight) !== null && _headerDom$offsetHeig !== void 0 ? _headerDom$offsetHeig : 0;
|
|
290
|
+
// table表头默认一行。即42px
|
|
343
291
|
var tableHeaderHeight = (_tableHeaderDom$offse = tableHeaderDom === null || tableHeaderDom === void 0 ? void 0 : tableHeaderDom.offsetHeight) !== null && _tableHeaderDom$offse !== void 0 ? _tableHeaderDom$offse : 42;
|
|
344
|
-
var footerRowSelectionHeight = (footerRowSelectionDom === null || footerRowSelectionDom === void 0 ? void 0 : footerRowSelectionDom.offsetHeight) || 50;
|
|
345
|
-
|
|
292
|
+
var footerRowSelectionHeight = (footerRowSelectionDom === null || footerRowSelectionDom === void 0 ? void 0 : footerRowSelectionDom.offsetHeight) || 50;
|
|
293
|
+
// 固定表格主体高度
|
|
346
294
|
if (fixedTableBody && !isFullscreen) {
|
|
347
295
|
var _pageContainerDom$off, _teamixNavDom$offsetH;
|
|
348
|
-
|
|
349
296
|
// 16px 为 padding
|
|
350
297
|
var pageHeaderHeight = ((_pageContainerDom$off = pageContainerDom === null || pageContainerDom === void 0 ? void 0 : pageContainerDom.offsetHeight) !== null && _pageContainerDom$off !== void 0 ? _pageContainerDom$off : 0) + 16;
|
|
351
|
-
var teamixNavHeight = (_teamixNavDom$offsetH = teamixNavDom === null || teamixNavDom === void 0 ? void 0 : teamixNavDom.offsetHeight) !== null && _teamixNavDom$offsetH !== void 0 ? _teamixNavDom$offsetH : 0;
|
|
298
|
+
var teamixNavHeight = (_teamixNavDom$offsetH = teamixNavDom === null || teamixNavDom === void 0 ? void 0 : teamixNavDom.offsetHeight) !== null && _teamixNavDom$offsetH !== void 0 ? _teamixNavDom$offsetH : 0;
|
|
352
299
|
|
|
300
|
+
// 1 为预留值,js无法取出精确高度,会被四舍五入
|
|
353
301
|
var offsetHeaderHeight = headerHeight + tableHeaderHeight + pageHeaderHeight + teamixNavHeight + footerRowSelectionHeight + 16 + (offset !== null && offset !== void 0 ? offset : 0) + 1;
|
|
354
|
-
|
|
355
302
|
if (tableBodyDom.clientHeight < tableBodyDom.scrollHeight) {
|
|
356
303
|
setFooterSuctionState(true);
|
|
357
304
|
} else {
|
|
358
305
|
setFooterSuctionState(false);
|
|
359
|
-
}
|
|
360
|
-
|
|
306
|
+
}
|
|
361
307
|
|
|
308
|
+
// 如果有切换区tab,那么重新计算
|
|
362
309
|
if (headerFixedTopSectionDom.clientHeight) {
|
|
363
310
|
var _headerFixedTopSectio;
|
|
311
|
+
var headerFixedTopSectionHeight = (_headerFixedTopSectio = headerFixedTopSectionDom.clientHeight) !== null && _headerFixedTopSectio !== void 0 ? _headerFixedTopSectio : 0;
|
|
364
312
|
|
|
365
|
-
|
|
313
|
+
// const clientTableBodyHeight =
|
|
366
314
|
// document.body.clientHeight - offsetHeaderHeight;
|
|
367
315
|
|
|
368
316
|
setHeaderHeight(headerFixedTopSectionHeight + teamixNavHeight + footerRowSelectionHeight + tableHeaderHeight + 1);
|
|
369
317
|
return;
|
|
370
318
|
}
|
|
371
|
-
|
|
372
319
|
setHeaderHeight(offsetHeaderHeight);
|
|
373
320
|
} else {
|
|
374
321
|
// 24px 为 padding
|
|
375
322
|
setHeaderHeight(headerHeight + tableHeaderHeight + footerRowSelectionHeight + 24 + (offset !== null && offset !== void 0 ? offset : 0) + 1);
|
|
376
323
|
}
|
|
377
324
|
}, 50);
|
|
378
|
-
};
|
|
379
|
-
|
|
325
|
+
};
|
|
380
326
|
|
|
327
|
+
// header 区域高度。用作全屏计算吸顶吸底高度。默认不做计算
|
|
381
328
|
var _useState25 = useState(0),
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
329
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
330
|
+
headerHeight = _useState26[0],
|
|
331
|
+
setHeaderHeight = _useState26[1];
|
|
386
332
|
|
|
333
|
+
// 全屏显示 className
|
|
387
334
|
var _useState27 = useState(false),
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
335
|
+
_useState28 = _slicedToArray(_useState27, 2),
|
|
336
|
+
fullscreenState = _useState28[0],
|
|
337
|
+
setFullscreenState = _useState28[1];
|
|
338
|
+
// 切换全屏搜索开关
|
|
393
339
|
var filterEnableRef = useRef({
|
|
394
340
|
fullscreen: false,
|
|
395
341
|
normal: true
|
|
396
|
-
});
|
|
342
|
+
});
|
|
397
343
|
|
|
344
|
+
// 非全屏状态下的
|
|
398
345
|
var normalDataFilterFormRef = useRef();
|
|
399
346
|
var fullscreenDataFilterFormRef = useRef();
|
|
400
347
|
var normalDataFilterForm = normalDataFilterFormRef.current;
|
|
401
|
-
var fullscreenDataFilterForm = fullscreenDataFilterFormRef.current;
|
|
348
|
+
var fullscreenDataFilterForm = fullscreenDataFilterFormRef.current;
|
|
402
349
|
|
|
403
|
-
|
|
404
|
-
|
|
350
|
+
// 传给 QueryFilter 的 formRef
|
|
351
|
+
var dataFilterFormRef = !fullscreenState ? normalDataFilterFormRef : fullscreenDataFilterFormRef;
|
|
352
|
+
// let dataFilterForm = dataFilterFormRef.current;
|
|
405
353
|
|
|
354
|
+
// 整个内容区是否超过一屏。用于表格在非全屏模式下的吸底
|
|
406
355
|
var _useState29 = useState(false),
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
356
|
+
_useState30 = _slicedToArray(_useState29, 2),
|
|
357
|
+
footerSuctionState = _useState30[0],
|
|
358
|
+
setFooterSuctionState = _useState30[1];
|
|
411
359
|
|
|
360
|
+
// TODO 获取内容区是否超出一屏(暂时仅支持全家桶)
|
|
412
361
|
var getFooterSuctionState = function getFooterSuctionState() {
|
|
413
362
|
if (!footerSuction) {
|
|
414
363
|
return;
|
|
415
364
|
}
|
|
416
|
-
|
|
417
365
|
var containerDom = document.querySelector('.teamix-pro-page-container-scroll-container');
|
|
418
|
-
|
|
419
366
|
if (containerDom) {
|
|
420
367
|
var offsetHeight = containerDom.offsetHeight;
|
|
421
368
|
var scrollHeight = containerDom.scrollHeight;
|
|
422
|
-
|
|
423
369
|
if (offsetHeight < scrollHeight) {
|
|
424
370
|
setFooterSuctionState(true);
|
|
425
371
|
} else {
|
|
@@ -431,35 +377,29 @@ var ProTable = function ProTable(props) {
|
|
|
431
377
|
setFooterSuctionState(true);
|
|
432
378
|
}
|
|
433
379
|
}
|
|
434
|
-
};
|
|
435
|
-
|
|
380
|
+
};
|
|
436
381
|
|
|
382
|
+
// rowSelection 相关
|
|
437
383
|
var rowSelectionHook = useTableSelection(_objectSpread(_objectSpread({}, propsRowSelection), {}, {
|
|
438
384
|
// 当初始出现骨架屏的时候,不可选择
|
|
439
385
|
getProps: function getProps(record, index) {
|
|
440
386
|
var result = {};
|
|
441
|
-
|
|
442
387
|
if (propsRowSelection === null || propsRowSelection === void 0 ? void 0 : propsRowSelection.getProps) {
|
|
443
388
|
result = propsRowSelection.getProps(record, index);
|
|
444
389
|
}
|
|
445
|
-
|
|
446
390
|
if (showSkeleton && result) {
|
|
447
391
|
result.disabled = true;
|
|
448
392
|
}
|
|
449
|
-
|
|
450
393
|
return result;
|
|
451
394
|
},
|
|
452
395
|
titleProps: function titleProps() {
|
|
453
396
|
var result = {};
|
|
454
|
-
|
|
455
397
|
if (propsRowSelection === null || propsRowSelection === void 0 ? void 0 : propsRowSelection.titleProps) {
|
|
456
398
|
result = propsRowSelection.titleProps();
|
|
457
399
|
}
|
|
458
|
-
|
|
459
400
|
if (showSkeleton || disableSelectAll) {
|
|
460
401
|
result.disabled = true;
|
|
461
402
|
}
|
|
462
|
-
|
|
463
403
|
return result;
|
|
464
404
|
},
|
|
465
405
|
onChange: onChangeRowSelection
|
|
@@ -468,21 +408,21 @@ var ProTable = function ProTable(props) {
|
|
|
468
408
|
var selectedCount = (rowSelection === null || rowSelection === void 0 ? void 0 : (_rowSelection$selecte = rowSelection.selectedRowKeys) === null || _rowSelection$selecte === void 0 ? void 0 : _rowSelection$selecte.length) || 0;
|
|
469
409
|
useEffect(function () {
|
|
470
410
|
getRowSelection && getRowSelection(rowSelectionHook);
|
|
471
|
-
}, [rowSelectionHook]);
|
|
411
|
+
}, [rowSelectionHook]);
|
|
472
412
|
|
|
413
|
+
// 获取 table 左下角 checkbox 属性
|
|
473
414
|
function getCheckAllProps() {
|
|
474
|
-
var
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
415
|
+
var _ref = rowSelection,
|
|
416
|
+
_ref$onChange = _ref.onChange,
|
|
417
|
+
_onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
|
|
418
|
+
_ref$onSelectAll = _ref.onSelectAll,
|
|
419
|
+
onSelectAll = _ref$onSelectAll === void 0 ? function () {} : _ref$onSelectAll,
|
|
420
|
+
_ref$selectedRowKeys = _ref.selectedRowKeys,
|
|
421
|
+
selectedRowKeys = _ref$selectedRowKeys === void 0 ? [] : _ref$selectedRowKeys,
|
|
422
|
+
getProps = _ref.getProps;
|
|
482
423
|
var dataSource = data;
|
|
483
424
|
var allRowKeys = dataSource.filter(function (d, i) {
|
|
484
425
|
var _getProps;
|
|
485
|
-
|
|
486
426
|
return getProps ? !((_getProps = getProps(d, i)) === null || _getProps === void 0 ? void 0 : _getProps.disabled) : true;
|
|
487
427
|
}).map(function (d) {
|
|
488
428
|
return getDeepValue(primaryKey || 'id', d);
|
|
@@ -498,15 +438,12 @@ var ProTable = function ProTable(props) {
|
|
|
498
438
|
result.push.apply(result, _toConsumableArray(allRowKeys.filter(function (k) {
|
|
499
439
|
return !selectedRowKeys.includes(k);
|
|
500
440
|
})));
|
|
501
|
-
|
|
502
441
|
_onChange(result, dataSource);
|
|
503
|
-
|
|
504
442
|
onSelectAll(check, dataSource);
|
|
505
443
|
} else {
|
|
506
444
|
_onChange(selectedRowKeys.filter(function (k) {
|
|
507
445
|
return !allRowKeys.includes(k);
|
|
508
446
|
}), []);
|
|
509
|
-
|
|
510
447
|
onSelectAll(check, []);
|
|
511
448
|
}
|
|
512
449
|
},
|
|
@@ -514,7 +451,6 @@ var ProTable = function ProTable(props) {
|
|
|
514
451
|
checked: nowCheckedKeys.length !== 0 && nowCheckedKeys.length === allRowKeys.length
|
|
515
452
|
};
|
|
516
453
|
}
|
|
517
|
-
|
|
518
454
|
useEffect(function () {
|
|
519
455
|
if (typeof propsActionRef === 'function' && actionRef.current) {
|
|
520
456
|
// @ts-ignore
|
|
@@ -523,18 +459,19 @@ var ProTable = function ProTable(props) {
|
|
|
523
459
|
}, [propsActionRef]);
|
|
524
460
|
useEffect(function () {
|
|
525
461
|
var _actionRef$current, _actionRef$current$se;
|
|
526
|
-
|
|
527
462
|
var columns = processColumns(propsColumns !== null && propsColumns !== void 0 ? propsColumns : [], propsColumns);
|
|
528
463
|
setFilteredColumns(columns);
|
|
529
464
|
(_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$se = _actionRef$current.setState) === null || _actionRef$current$se === void 0 ? void 0 : _actionRef$current$se.call(_actionRef$current, 'filterColumns', columns);
|
|
530
|
-
}, [propsColumns]);
|
|
465
|
+
}, [propsColumns]);
|
|
531
466
|
|
|
467
|
+
// dataSource 受控
|
|
532
468
|
useEffect(function () {
|
|
533
469
|
if (propsDataSource) {
|
|
534
470
|
setData(propsDataSource);
|
|
535
471
|
}
|
|
536
|
-
}, [propsDataSource]);
|
|
472
|
+
}, [propsDataSource]);
|
|
537
473
|
|
|
474
|
+
// 初始化 ActionRef。
|
|
538
475
|
initActionRef(actionRef, {
|
|
539
476
|
getState: function getState() {
|
|
540
477
|
return actionRefState;
|
|
@@ -550,32 +487,29 @@ var ProTable = function ProTable(props) {
|
|
|
550
487
|
if (!actionRefCallback[state]) {
|
|
551
488
|
actionRefCallback[state] = {};
|
|
552
489
|
}
|
|
553
|
-
|
|
554
490
|
actionRefCallback[state][name] = fun;
|
|
555
491
|
},
|
|
556
492
|
off: function off(name) {
|
|
557
|
-
actionRefCallback = Object.fromEntries(Object.entries(actionRefCallback).map(function (
|
|
558
|
-
var
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
k = _ref4[0];
|
|
565
|
-
|
|
493
|
+
actionRefCallback = Object.fromEntries(Object.entries(actionRefCallback).map(function (_ref2) {
|
|
494
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
495
|
+
k = _ref3[0],
|
|
496
|
+
v = _ref3[1];
|
|
497
|
+
var filterV = Object.fromEntries(Object.entries(v).filter(function (_ref4) {
|
|
498
|
+
var _ref5 = _slicedToArray(_ref4, 1),
|
|
499
|
+
k = _ref5[0];
|
|
566
500
|
return k !== name;
|
|
567
501
|
}));
|
|
568
502
|
return [k, filterV];
|
|
569
503
|
}));
|
|
570
504
|
}
|
|
571
|
-
});
|
|
505
|
+
});
|
|
572
506
|
|
|
507
|
+
// 绑定 Actions
|
|
573
508
|
useActionType(actionRef, {
|
|
574
509
|
fullScreen: function fullScreen() {
|
|
575
510
|
var _actionRef$current2, _actionRef$current2$s;
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
511
|
+
var state = !fullscreenState;
|
|
512
|
+
// 全屏时需要重新计算header高度
|
|
579
513
|
setFullscreenState(state);
|
|
580
514
|
getHeaderHeight(state);
|
|
581
515
|
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$s = _actionRef$current2.setState) === null || _actionRef$current2$s === void 0 ? void 0 : _actionRef$current2$s.call(_actionRef$current2, 'fullScreenState', state);
|
|
@@ -583,12 +517,10 @@ var ProTable = function ProTable(props) {
|
|
|
583
517
|
},
|
|
584
518
|
setColumn: function setColumn(newColumns) {
|
|
585
519
|
var _actionRef$current3, _actionRef$current3$s;
|
|
586
|
-
|
|
587
520
|
var update = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
588
521
|
var columns = processColumns(newColumns, propsColumns);
|
|
589
522
|
setFilteredColumns(columns);
|
|
590
523
|
(_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : (_actionRef$current3$s = _actionRef$current3.setState) === null || _actionRef$current3$s === void 0 ? void 0 : _actionRef$current3$s.call(_actionRef$current3, 'filterColumns', columns);
|
|
591
|
-
|
|
592
524
|
if (update) {
|
|
593
525
|
emit('refreshFilterState', newColumns);
|
|
594
526
|
}
|
|
@@ -605,22 +537,18 @@ var ProTable = function ProTable(props) {
|
|
|
605
537
|
if (params === null || params === void 0 ? void 0 : params[targetPageKey]) {
|
|
606
538
|
setCurrentPage(params[targetPageKey]);
|
|
607
539
|
}
|
|
608
|
-
|
|
609
540
|
if (params === null || params === void 0 ? void 0 : params[targetPageSizeKey]) {
|
|
610
541
|
setPageSize(params[targetPageSizeKey]);
|
|
611
542
|
}
|
|
612
|
-
|
|
613
543
|
_request(params);
|
|
614
544
|
},
|
|
615
545
|
reset: function reset() {
|
|
616
546
|
var _actionRef$current4, _actionRef$current4$s, _dataFilterFormRef$cu;
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
547
|
+
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset());
|
|
548
|
+
// 清空列过滤参数
|
|
620
549
|
(_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : (_actionRef$current4$s = _actionRef$current4.setFilterRules) === null || _actionRef$current4$s === void 0 ? void 0 : _actionRef$current4$s.call(_actionRef$current4, {});
|
|
621
550
|
(_dataFilterFormRef$cu = dataFilterFormRef.current) === null || _dataFilterFormRef$cu === void 0 ? void 0 : _dataFilterFormRef$cu.reset();
|
|
622
551
|
setCurrentPage(1);
|
|
623
|
-
|
|
624
552
|
_request(_defineProperty({}, targetPageKey, 1));
|
|
625
553
|
},
|
|
626
554
|
resetPage: function resetPage() {
|
|
@@ -648,32 +576,29 @@ var ProTable = function ProTable(props) {
|
|
|
648
576
|
resetTableMaxBodyHeight: function resetTableMaxBodyHeight(offset) {
|
|
649
577
|
getHeaderHeight(fullscreenState, offset);
|
|
650
578
|
}
|
|
651
|
-
});
|
|
579
|
+
});
|
|
652
580
|
|
|
581
|
+
// 将 Actions 绑定到传入的 propsActionRef 中
|
|
653
582
|
if (propsActionRef) {
|
|
654
583
|
propsActionRef.current = actionRef.current;
|
|
655
584
|
}
|
|
656
|
-
|
|
657
585
|
function onFormatResult(next) {
|
|
658
586
|
var _next$data;
|
|
659
|
-
|
|
660
587
|
props.onFormatResult && props.onFormatResult(next);
|
|
661
588
|
var time = autoRefresh ? autoRefresh(next.data) : false;
|
|
662
|
-
|
|
663
589
|
if (Number.isInteger(time) && time >= 1000) {
|
|
664
590
|
autoRefreshTimerRef.current = setTimeout(function () {
|
|
665
591
|
// 自动刷新不显示 loading
|
|
666
592
|
_request({}, true);
|
|
667
593
|
}, Number(time));
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
|
|
594
|
+
}
|
|
595
|
+
// 设置 dataSource、total
|
|
671
596
|
setData(next.data || []);
|
|
672
597
|
setTotal(next.total || ((_next$data = next.data) === null || _next$data === void 0 ? void 0 : _next$data.length));
|
|
673
598
|
setShowSkeleton(false);
|
|
674
|
-
}
|
|
675
|
-
|
|
599
|
+
}
|
|
676
600
|
|
|
601
|
+
// 请求表格数据工具函数
|
|
677
602
|
var getData = useRequest(function (params) {
|
|
678
603
|
return _defineProperty({
|
|
679
604
|
url: url,
|
|
@@ -682,13 +607,13 @@ var ProTable = function ProTable(props) {
|
|
|
682
607
|
}, {
|
|
683
608
|
// 使用 request 方法代替 fetch
|
|
684
609
|
requestMethod: function requestMethod(params) {
|
|
685
|
-
|
|
610
|
+
// 支持使用 requestConfig 自定义请求配置
|
|
611
|
+
return utilResquest(_objectSpread(_objectSpread({}, params), requestConfig));
|
|
686
612
|
},
|
|
687
613
|
manual: true,
|
|
688
614
|
onSuccess: function onSuccess(result) {
|
|
689
615
|
props.onSuccess && props.onSuccess(result);
|
|
690
616
|
var nextData = result;
|
|
691
|
-
|
|
692
617
|
if (formatResult) {
|
|
693
618
|
if (typeof formatResult === 'function') {
|
|
694
619
|
nextData = formatResult(result) || {};
|
|
@@ -700,7 +625,6 @@ var ProTable = function ProTable(props) {
|
|
|
700
625
|
};
|
|
701
626
|
}
|
|
702
627
|
}
|
|
703
|
-
|
|
704
628
|
if (nextData instanceof Promise) {
|
|
705
629
|
nextData.then(function (res) {
|
|
706
630
|
onFormatResult(res);
|
|
@@ -709,62 +633,56 @@ var ProTable = function ProTable(props) {
|
|
|
709
633
|
});
|
|
710
634
|
} else {
|
|
711
635
|
onFormatResult(nextData);
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
|
|
636
|
+
}
|
|
637
|
+
// 重新计算是否需要吸底
|
|
715
638
|
if (footerSuction) {
|
|
716
639
|
getFooterSuctionState();
|
|
717
640
|
}
|
|
718
|
-
|
|
719
641
|
if (fixedTableBody) {
|
|
720
642
|
getHeaderHeight(fullscreenState);
|
|
721
643
|
}
|
|
722
644
|
},
|
|
723
645
|
onError: function onError(error) {
|
|
724
646
|
setShowSkeleton(false);
|
|
725
|
-
|
|
726
647
|
if (props.onError) {
|
|
727
648
|
props.onError(error);
|
|
728
|
-
} else {
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
649
|
+
} else {
|
|
650
|
+
// Message.error(error.toString());
|
|
651
|
+
}
|
|
652
|
+
// 重新计算是否需要吸底
|
|
732
653
|
if (footerSuction) {
|
|
733
654
|
getFooterSuctionState();
|
|
734
655
|
}
|
|
735
|
-
|
|
736
656
|
if (fixedTableBody) {
|
|
737
657
|
getHeaderHeight(fullscreenState);
|
|
738
658
|
}
|
|
739
659
|
}
|
|
740
|
-
});
|
|
660
|
+
});
|
|
741
661
|
|
|
662
|
+
// 请求函数
|
|
742
663
|
function _request(params, noLoading, filterParams) {
|
|
743
664
|
var _dataFilterFormRef$cu2, _actionRef$current$ge, _actionRef$current5, _actionRef$current5$g, _objectSpread2;
|
|
744
|
-
|
|
745
665
|
// 如果没有传 url 且没有 customRequest,直接返回
|
|
746
666
|
if (!url && !customRequest) {
|
|
747
667
|
return;
|
|
748
668
|
}
|
|
749
|
-
|
|
750
669
|
var nextShowLoading = !noLoading;
|
|
751
|
-
nextShowLoading !== showLoading && setShowLoading(nextShowLoading);
|
|
670
|
+
nextShowLoading !== showLoading && setShowLoading(nextShowLoading);
|
|
671
|
+
// 请求前需要优先清空列过滤条件
|
|
752
672
|
// actionRef.current?.setFilterRules?.({});
|
|
673
|
+
var sortParams = targetFormatSort(sort);
|
|
674
|
+
// 筛选区请求参数
|
|
675
|
+
var dataFilterParams = filterParams !== null && filterParams !== void 0 ? filterParams : (_dataFilterFormRef$cu2 = dataFilterFormRef.current) === null || _dataFilterFormRef$cu2 === void 0 ? void 0 : _dataFilterFormRef$cu2.values;
|
|
676
|
+
// 列过滤请求参数
|
|
677
|
+
var columnsFilterParams = (_actionRef$current$ge = (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : (_actionRef$current5$g = _actionRef$current5.getFilterRules) === null || _actionRef$current5$g === void 0 ? void 0 : _actionRef$current5$g.call(_actionRef$current5)) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : {};
|
|
753
678
|
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
var dataFilterParams = filterParams !== null && filterParams !== void 0 ? filterParams : (_dataFilterFormRef$cu2 = dataFilterFormRef.current) === null || _dataFilterFormRef$cu2 === void 0 ? void 0 : _dataFilterFormRef$cu2.values; // 列过滤请求参数
|
|
757
|
-
|
|
758
|
-
var columnsFilterParams = (_actionRef$current$ge = (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : (_actionRef$current5$g = _actionRef$current5.getFilterRules) === null || _actionRef$current5$g === void 0 ? void 0 : _actionRef$current5$g.call(_actionRef$current5)) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : {}; // 格式化后的请求参数
|
|
759
|
-
|
|
679
|
+
// 格式化后的请求参数
|
|
760
680
|
var requestData = formatParams(_objectSpread(_objectSpread({}, !showPagination ? _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams) : _objectSpread(_objectSpread(_objectSpread(_objectSpread((_objectSpread2 = {}, _defineProperty(_objectSpread2, targetPageKey, currentPage), _defineProperty(_objectSpread2, targetPageSizeKey, pageSize), _objectSpread2), dataFilterParams), propsParams), sortParams), columnsFilterParams)), params));
|
|
761
|
-
|
|
762
681
|
if (requestData) {
|
|
763
682
|
if (autoRefreshTimerRef.current) {
|
|
764
683
|
clearTimeout(autoRefreshTimerRef.current);
|
|
765
684
|
autoRefreshTimerRef.current = null;
|
|
766
685
|
}
|
|
767
|
-
|
|
768
686
|
if (!(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.searchUndefined)) {
|
|
769
687
|
Object.keys(requestData).forEach(function (key) {
|
|
770
688
|
if (requestData[key] === undefined) {
|
|
@@ -772,43 +690,38 @@ var ProTable = function ProTable(props) {
|
|
|
772
690
|
}
|
|
773
691
|
});
|
|
774
692
|
}
|
|
775
|
-
|
|
776
693
|
if (!(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.searchEmptyString)) {
|
|
777
694
|
Object.keys(requestData).forEach(function (key) {
|
|
778
695
|
if (requestData[key] === '') {
|
|
779
696
|
delete requestData[key];
|
|
780
697
|
}
|
|
781
698
|
});
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
|
|
699
|
+
}
|
|
700
|
+
// 如果使用自定义请求
|
|
785
701
|
if (customRequest && typeof customRequest === 'function') {
|
|
786
702
|
setCustomTableLoading(true);
|
|
787
703
|
customRequest(requestData).then(function (res) {
|
|
788
704
|
var data = res.data,
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
705
|
+
total = res.total,
|
|
706
|
+
success = res.success;
|
|
792
707
|
if (success === true) {
|
|
793
708
|
// 设置 dataSource、total
|
|
794
709
|
setData(data || []);
|
|
795
710
|
setTotal(total || (data === null || data === void 0 ? void 0 : data.length));
|
|
796
711
|
setShowSkeleton(false);
|
|
797
712
|
setCustomTableLoading(false);
|
|
798
|
-
}
|
|
799
|
-
|
|
713
|
+
}
|
|
800
714
|
|
|
715
|
+
// 重新计算是否需要吸底
|
|
801
716
|
if (footerSuction) {
|
|
802
717
|
getFooterSuctionState();
|
|
803
718
|
}
|
|
804
|
-
|
|
805
719
|
if (fixedTableBody) {
|
|
806
720
|
getHeaderHeight(fullscreenState);
|
|
807
|
-
}
|
|
808
|
-
|
|
721
|
+
}
|
|
809
722
|
|
|
723
|
+
// customRequest 中支持 autoRefresh
|
|
810
724
|
var time = autoRefresh ? autoRefresh(data) : false;
|
|
811
|
-
|
|
812
725
|
if (Number.isInteger(time) && time >= 1000) {
|
|
813
726
|
autoRefreshTimerRef.current = setTimeout(function () {
|
|
814
727
|
// 自动刷新不显示 loading
|
|
@@ -821,23 +734,19 @@ var ProTable = function ProTable(props) {
|
|
|
821
734
|
}
|
|
822
735
|
}
|
|
823
736
|
}
|
|
824
|
-
|
|
825
737
|
function onSort(dataIndex, order) {
|
|
826
738
|
var nextSort = _defineProperty({}, dataIndex, order);
|
|
827
|
-
|
|
828
739
|
setSort(nextSort);
|
|
829
|
-
|
|
830
740
|
_request(targetFormatSort(nextSort));
|
|
831
|
-
}
|
|
832
|
-
|
|
741
|
+
}
|
|
833
742
|
|
|
743
|
+
// 处理 dataFilter 中的 onFilter、onReset
|
|
834
744
|
var dataFilter = _objectSpread(_objectSpread({
|
|
835
745
|
mode: 'inline',
|
|
836
746
|
forceClear: true
|
|
837
747
|
}, propsDataFilter), {}, {
|
|
838
748
|
onInit: (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onInit) || requestWhenMount ? function (values) {
|
|
839
749
|
var _propsDataFilter$onIn;
|
|
840
|
-
|
|
841
750
|
// 表单初始化请求处理
|
|
842
751
|
propsDataFilter === null || propsDataFilter === void 0 ? void 0 : (_propsDataFilter$onIn = propsDataFilter.onInit) === null || _propsDataFilter$onIn === void 0 ? void 0 : _propsDataFilter$onIn.call(propsDataFilter, values);
|
|
843
752
|
!fullscreenState && requestWhenMount && _request({}, false, values);
|
|
@@ -845,39 +754,32 @@ var ProTable = function ProTable(props) {
|
|
|
845
754
|
} : undefined,
|
|
846
755
|
onFilter: function onFilter(values) {
|
|
847
756
|
var _actionRef$current6, _actionRef$current6$c;
|
|
848
|
-
|
|
849
757
|
// 全屏状态,判断全屏表单onFilter是否禁用
|
|
850
758
|
if (fullscreenState && !filterEnableRef.current.fullscreen) {
|
|
851
759
|
filterEnableRef.current.fullscreen = true;
|
|
852
760
|
return;
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
|
|
761
|
+
}
|
|
762
|
+
// 非全屏状态,判断普通表单onFiler是否禁用
|
|
856
763
|
if (!fullscreenState && !filterEnableRef.current.normal) {
|
|
857
764
|
filterEnableRef.current.normal = true;
|
|
858
765
|
return;
|
|
859
766
|
}
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
767
|
+
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter(values));
|
|
768
|
+
// 搜索变化时,暂时先清空选择
|
|
863
769
|
(_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : (_actionRef$current6$c = _actionRef$current6.clearRowSelection) === null || _actionRef$current6$c === void 0 ? void 0 : _actionRef$current6$c.call(_actionRef$current6);
|
|
864
770
|
setCurrentPage(1);
|
|
865
771
|
console.log('currentPageSize1', pageSize);
|
|
866
|
-
|
|
867
772
|
_request(_defineProperty({}, targetPageKey, 1), false, values);
|
|
868
773
|
},
|
|
869
774
|
onReset: function onReset(values) {
|
|
870
775
|
var _dataFilterFormRef$cu3;
|
|
871
|
-
|
|
872
776
|
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset());
|
|
873
777
|
(_dataFilterFormRef$cu3 = dataFilterFormRef.current) === null || _dataFilterFormRef$cu3 === void 0 ? void 0 : _dataFilterFormRef$cu3.reset();
|
|
874
778
|
setCurrentPage(1);
|
|
875
779
|
console.log('currentPageSize2', pageSize);
|
|
876
|
-
|
|
877
780
|
_request(_defineProperty({}, targetPageKey, 1), false, values);
|
|
878
781
|
}
|
|
879
782
|
});
|
|
880
|
-
|
|
881
783
|
var getTableLoading = function getTableLoading() {
|
|
882
784
|
if (!customRequest) {
|
|
883
785
|
return showLoading && !showSkeleton && (getData.loading || props.loading);
|
|
@@ -885,7 +787,6 @@ var ProTable = function ProTable(props) {
|
|
|
885
787
|
return showLoading && !showSkeleton && (customTableLoading || props.loading);
|
|
886
788
|
}
|
|
887
789
|
};
|
|
888
|
-
|
|
889
790
|
var renderTable = function renderTable(isFullScreen) {
|
|
890
791
|
if (propsColumns) {
|
|
891
792
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -904,8 +805,9 @@ var ProTable = function ProTable(props) {
|
|
|
904
805
|
afterDataFilter: afterDataFilter,
|
|
905
806
|
dataFilterFormRef: isFullScreen ? fullscreenDataFilterFormRef : normalDataFilterFormRef,
|
|
906
807
|
rowSelection: rowSelection,
|
|
907
|
-
filterColumnType: filterColumnType
|
|
908
|
-
|
|
808
|
+
filterColumnType: filterColumnType,
|
|
809
|
+
fullScreenState: isFullScreen
|
|
810
|
+
}), /*#__PURE__*/React.createElement(Table.StickyLock, _extends({
|
|
909
811
|
hasBorder: false,
|
|
910
812
|
dataSource: showSkeleton ? skeletonDataSource : data || props.dataSource,
|
|
911
813
|
columns: genProColumnToColumn(filteredColumns, showSkeleton, actionRef, context),
|
|
@@ -924,75 +826,61 @@ var ProTable = function ProTable(props) {
|
|
|
924
826
|
sortIcons: getTableSortIcons(),
|
|
925
827
|
fixedHeader: fullscreenState || fixedTableBody,
|
|
926
828
|
maxBodyHeight: "calc(100vh - ".concat(headerHeight, "px)")
|
|
829
|
+
// 过滤出可以传到 Table 的 Props
|
|
927
830
|
}, pickProps(getTableProps(), otherProps))));
|
|
928
831
|
} else {
|
|
929
832
|
// 不传 columns 直接返回原始 Table
|
|
930
|
-
return /*#__PURE__*/React.createElement(Table,
|
|
833
|
+
return /*#__PURE__*/React.createElement(Table, _extends({
|
|
931
834
|
className: cls()
|
|
932
835
|
}, pickProps(getTableProps(), otherProps)));
|
|
933
836
|
}
|
|
934
837
|
};
|
|
935
|
-
|
|
936
838
|
var renderFooterAction = function renderFooterAction() {
|
|
937
|
-
var
|
|
938
|
-
|
|
939
|
-
if (_typeof(footerAction) === 'object' && (footerAction === null || footerAction === void 0 ? void 0 : (_footerAction$actions = footerAction.actions) === null || _footerAction$actions === void 0 ? void 0 : _footerAction$actions.length) >= 0) {
|
|
839
|
+
var _actions;
|
|
840
|
+
if (_typeof(footerAction) === 'object' && (footerAction === null || footerAction === void 0 ? void 0 : (_actions = footerAction.actions) === null || _actions === void 0 ? void 0 : _actions.length) >= 0) {
|
|
940
841
|
// 默认 context
|
|
941
842
|
var defaultContext = {
|
|
942
843
|
action: actionRef.current,
|
|
943
844
|
rowSelection: rowSelection
|
|
944
|
-
};
|
|
945
|
-
|
|
845
|
+
};
|
|
846
|
+
// 未选择的时候所有 button 默认 disabled
|
|
946
847
|
var targetActions = footerAction.actions.map(function (action) {
|
|
947
848
|
return _objectSpread(_objectSpread({}, action), {}, {
|
|
948
849
|
disabled: (action === null || action === void 0 ? void 0 : action.disabled) || selectedCount === 0
|
|
949
850
|
});
|
|
950
851
|
});
|
|
951
|
-
|
|
952
852
|
var targetFooterActions = _objectSpread(_objectSpread({}, footerAction), {}, {
|
|
953
853
|
actions: targetActions
|
|
954
854
|
});
|
|
955
|
-
|
|
956
855
|
return /*#__PURE__*/React.createElement("div", {
|
|
957
856
|
className: cls('footer-action')
|
|
958
|
-
}, /*#__PURE__*/React.createElement(ProActionGroup,
|
|
857
|
+
}, /*#__PURE__*/React.createElement(ProActionGroup, _extends({}, targetFooterActions, {
|
|
959
858
|
context: _objectSpread(_objectSpread({}, defaultContext), targetFooterActions === null || targetFooterActions === void 0 ? void 0 : targetFooterActions.context)
|
|
960
859
|
})));
|
|
961
860
|
} else return footerAction;
|
|
962
861
|
};
|
|
963
|
-
|
|
964
862
|
var renderFooter = function renderFooter() {
|
|
965
863
|
function onChangePagination(currentPage) {
|
|
966
864
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
967
|
-
|
|
968
865
|
// 翻页默认清空选择
|
|
969
866
|
if (!reserveSelectedRecords) {
|
|
970
867
|
var _actionRef$current7, _actionRef$current7$c;
|
|
971
|
-
|
|
972
868
|
(_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$c = _actionRef$current7.clearRowSelection) === null || _actionRef$current7$c === void 0 ? void 0 : _actionRef$current7$c.call(_actionRef$current7);
|
|
973
869
|
}
|
|
974
|
-
|
|
975
870
|
setCurrentPage(currentPage);
|
|
976
|
-
|
|
977
871
|
_request(_objectSpread(_defineProperty({}, targetPageKey, currentPage), params));
|
|
978
872
|
}
|
|
979
|
-
|
|
980
873
|
function onChangePaginationSize(currentPageSize) {
|
|
981
874
|
var _request5;
|
|
982
|
-
|
|
983
875
|
// 翻页默认清空选择
|
|
984
876
|
if (!reserveSelectedRecords) {
|
|
985
877
|
var _actionRef$current8, _actionRef$current8$c;
|
|
986
|
-
|
|
987
878
|
(_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : (_actionRef$current8$c = _actionRef$current8.clearRowSelection) === null || _actionRef$current8$c === void 0 ? void 0 : _actionRef$current8$c.call(_actionRef$current8);
|
|
988
879
|
}
|
|
989
|
-
|
|
990
880
|
setPageSize(currentPageSize);
|
|
991
881
|
setCurrentPage(1);
|
|
992
|
-
|
|
993
882
|
_request((_request5 = {}, _defineProperty(_request5, targetPageSizeKey, currentPageSize), _defineProperty(_request5, targetPageKey, 1), _request5));
|
|
994
883
|
}
|
|
995
|
-
|
|
996
884
|
function renderRowSelection() {
|
|
997
885
|
if (rowSelection) {
|
|
998
886
|
if (showSkeleton) {
|
|
@@ -1002,7 +890,7 @@ var ProTable = function ProTable(props) {
|
|
|
1002
890
|
} else {
|
|
1003
891
|
return /*#__PURE__*/React.createElement("div", {
|
|
1004
892
|
className: cls('footer-left-wrapper')
|
|
1005
|
-
}, rowSelection.mode !== 'single' && /*#__PURE__*/React.createElement(Checkbox,
|
|
893
|
+
}, rowSelection.mode !== 'single' && /*#__PURE__*/React.createElement(Checkbox, _extends({
|
|
1006
894
|
className: cls("footer-checkbox-".concat(size))
|
|
1007
895
|
}, getCheckAllProps())), footerAction && renderFooterAction(), /*#__PURE__*/React.createElement("span", {
|
|
1008
896
|
className: cls('selected-msg')
|
|
@@ -1022,7 +910,6 @@ var ProTable = function ProTable(props) {
|
|
|
1022
910
|
}
|
|
1023
911
|
}
|
|
1024
912
|
}
|
|
1025
|
-
|
|
1026
913
|
if (showPagination) {
|
|
1027
914
|
return /*#__PURE__*/React.createElement("div", {
|
|
1028
915
|
className: cls('footer', {
|
|
@@ -1031,15 +918,16 @@ var ProTable = function ProTable(props) {
|
|
|
1031
918
|
})
|
|
1032
919
|
}, renderRowSelection(), /*#__PURE__*/React.createElement("div", {
|
|
1033
920
|
className: cls('footer-right-wrapper')
|
|
1034
|
-
}, showSkeleton ? /*#__PURE__*/React.createElement(Skeleton.Footer.Pagination, null) : /*#__PURE__*/React.createElement(React.Fragment, null, data.length > 0 && /*#__PURE__*/React.createElement(Pagination,
|
|
921
|
+
}, showSkeleton ? /*#__PURE__*/React.createElement(Skeleton.Footer.Pagination, null) : /*#__PURE__*/React.createElement(React.Fragment, null, data.length > 0 && /*#__PURE__*/React.createElement(Pagination, _extends({
|
|
1035
922
|
className: cls('pagination'),
|
|
1036
923
|
onChange: function onChange(number) {
|
|
1037
924
|
return onChangePagination(number);
|
|
1038
925
|
},
|
|
1039
926
|
total: total,
|
|
1040
|
-
responsivePaginationType: responsivePaginationType
|
|
927
|
+
responsivePaginationType: responsivePaginationType
|
|
1041
928
|
// shape="arrow-only"
|
|
1042
929
|
// pageSizePosition="end"
|
|
930
|
+
,
|
|
1043
931
|
totalRender: function totalRender(total) {
|
|
1044
932
|
return getMessage('total', {
|
|
1045
933
|
total: new Intl.NumberFormat().format(total)
|
|
@@ -1063,20 +951,18 @@ var ProTable = function ProTable(props) {
|
|
|
1063
951
|
className: cls('footer-right-wrapper')
|
|
1064
952
|
}, showSkeleton ? /*#__PURE__*/React.createElement(Skeleton.Footer.Pagination, null) : footer));
|
|
1065
953
|
}
|
|
1066
|
-
};
|
|
1067
|
-
|
|
954
|
+
};
|
|
1068
955
|
|
|
956
|
+
// 判断是否需要吸底
|
|
1069
957
|
var fixFooterState = useMemo(function () {
|
|
1070
958
|
if (fullscreenState) {
|
|
1071
959
|
return false;
|
|
1072
960
|
}
|
|
1073
|
-
|
|
1074
961
|
if (fixedTableBody || footerSuction) {
|
|
1075
962
|
if (footerSuctionState) {
|
|
1076
963
|
return true;
|
|
1077
964
|
}
|
|
1078
965
|
}
|
|
1079
|
-
|
|
1080
966
|
return false;
|
|
1081
967
|
}, [fullscreenState, fixedTableBody, footerSuction, footerSuctionState]);
|
|
1082
968
|
return /*#__PURE__*/React.createElement(FullScreen, {
|
|
@@ -1086,12 +972,12 @@ var ProTable = function ProTable(props) {
|
|
|
1086
972
|
return /*#__PURE__*/React.createElement("div", {
|
|
1087
973
|
className: cls({
|
|
1088
974
|
'': true,
|
|
1089
|
-
fullscreen: fullscreenState
|
|
1090
|
-
|
|
975
|
+
fullscreen: fullscreenState
|
|
976
|
+
// 'footer-suction': footerSuctionState && footerSuction,
|
|
1091
977
|
}),
|
|
978
|
+
|
|
1092
979
|
ref: tableRef
|
|
1093
980
|
}, renderTable(isFullScreen), fixFooterState && /*#__PURE__*/React.createElement(ProPageContainer.FixedFooter, null, renderFooter()), !fixFooterState && renderFooter());
|
|
1094
981
|
});
|
|
1095
982
|
};
|
|
1096
|
-
|
|
1097
983
|
export default ProTable;
|