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