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