@teamix/pro 1.6.0-beta.4 → 1.6.0-beta.5
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -1
- package/dist/pro.all.min.css +1 -0
- package/dist/pro.css +1 -1
- package/dist/pro.js +23217 -12214
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/dist/pro.xconsole.min.css +1 -0
- package/es/actions/base.d.ts +24 -0
- package/es/actions/base.js +1 -1
- package/es/actions/confirm.d.ts +7 -0
- package/es/actions/danger-confirm.d.ts +7 -0
- package/es/actions/danger-pop-confirm.d.ts +5 -0
- package/es/actions/dialog-component.d.ts +10 -0
- package/es/actions/dialog-component.js +4 -1
- package/es/actions/dialog-form.d.ts +29 -0
- package/es/actions/dialog-form.js +8 -8
- package/es/actions/dialog-info.d.ts +9 -0
- package/es/actions/dialog-table.d.ts +9 -0
- package/es/actions/dialog.d.ts +40 -0
- package/es/actions/dialog.js +8 -7
- package/es/actions/drawer-form.d.ts +6 -0
- package/es/actions/drawer-info.d.ts +6 -0
- package/es/actions/drawer-table.d.ts +6 -0
- package/es/actions/drawer.d.ts +6 -0
- package/es/actions/error.d.ts +7 -0
- package/es/actions/index.d.ts +114 -0
- package/es/actions/index.js +51 -44
- package/es/actions/index.scss +6 -1
- package/es/actions/link.d.ts +8 -0
- package/es/actions/link.js +4 -3
- package/es/actions/notice.d.ts +7 -0
- package/es/actions/pop-confirm.d.ts +9 -0
- package/es/actions/quick.d.ts +2 -0
- package/es/actions/quick.js +26 -0
- package/es/actions/request.d.ts +9 -0
- package/es/actions/request.js +4 -3
- package/es/actions/utils.d.ts +1 -0
- package/es/card/card-container.d.ts +18 -0
- package/es/card/card-container.js +5 -12
- package/es/card/divider.d.ts +6 -0
- package/es/card/divider.js +4 -2
- package/es/card/index.d.ts +109 -0
- package/es/card/index.js +11 -22
- package/es/card/index.scss +15 -0
- package/es/card/selectable.d.ts +13 -0
- package/es/card/selectable.js +4 -2
- package/es/card/tab.d.ts +6 -0
- package/es/card/tab.js +4 -2
- package/es/card/utils.d.ts +9 -0
- package/es/card/xconsole.scss +3 -0
- package/es/field/index.d.ts +3 -0
- package/es/form/Components/Editable/index.d.ts +20 -0
- package/es/form/Components/Editable/index.js +2 -2
- package/es/form/Components/FormGroup/index.d.ts +14 -0
- package/es/form/Components/FormGroup/index.js +3 -4
- package/es/form/Components/LightFilter/componentMap.d.ts +3 -0
- package/es/form/Components/LightFilter/index.d.ts +17 -0
- package/es/form/Components/LightFilter/index.js +2 -11
- package/es/form/Components/ProField/index.d.ts +2 -0
- package/es/form/Components/ProField/index.js +4 -2
- package/es/form/Components/ProField/mapDateFormat.d.ts +3 -0
- package/es/form/Components/Text/index.d.ts +8 -0
- package/es/form/Components/Text/index.js +4 -2
- package/es/form/Filter/AdvancedFilter.d.ts +7 -0
- package/es/form/Filter/AdvancedFilter.js +14 -16
- package/es/form/Filter/Layout.d.ts +5 -0
- package/es/form/Filter/LightFilter.d.ts +7 -0
- package/es/form/Filter/LightFilter.js +9 -13
- package/es/form/Filter/SimpleFilter.d.ts +7 -0
- package/es/form/Filter/SimpleFilter.js +5 -8
- package/es/form/Filter/index.d.ts +9 -0
- package/es/form/Filter/index.js +19 -25
- package/es/form/Filter/index.scss +1 -0
- package/es/form/Filter/index2.d.ts +13 -0
- package/es/form/Filter/index2.js +17 -22
- package/es/form/Filter/index2.scss +1 -0
- package/es/form/Filter/useBindUrl.d.ts +2 -0
- package/es/form/Filter/useBindUrl.js +0 -3
- package/es/form/Filter/useSpecialProps.d.ts +6 -0
- package/es/form/Filter/useSpecialProps.js +0 -1
- package/es/form/ProForm/addCascadeEffect.d.ts +2 -0
- package/es/form/ProForm/customComponent.d.ts +3 -0
- package/es/form/ProForm/index.d.ts +5 -0
- package/es/form/ProForm/index.js +9 -7
- package/es/form/ProForm/useAutoLayout.d.ts +9 -0
- package/es/form/ProForm/useAutoLayout.js +0 -4
- package/es/form/ProForm/useAutoSubmit.d.ts +6 -0
- package/es/form/ProForm/useAutoSubmit.js +4 -3
- package/es/form/ProForm/useFieldRequest.d.ts +5 -0
- package/es/form/ProForm/useFormDisplayValues.d.ts +4 -0
- package/es/form/ProForm/useFormDisplayValues.js +0 -1
- package/es/form/ProForm/useInitialRequest.d.ts +6 -0
- package/es/form/SchemaForm/adapterComponent.d.ts +5 -0
- package/es/form/SchemaForm/adapterComponent.js +0 -1
- package/es/form/SchemaForm/adapterDecorator.d.ts +6 -0
- package/es/form/SchemaForm/adapterDecorator.js +0 -1
- package/es/form/SchemaForm/adapterType.d.ts +5 -0
- package/es/form/SchemaForm/adapterType.js +0 -1
- package/es/form/SchemaForm/index.d.ts +4 -0
- package/es/form/SchemaForm/index.js +0 -13
- package/es/form/SchemaForm/initializeArrayCards.d.ts +3 -0
- package/es/form/SchemaForm/initializeArrayCollapse.d.ts +3 -0
- package/es/form/SchemaForm/initializeArrayItems.d.ts +3 -0
- package/es/form/SchemaForm/initializeArrayTable.d.ts +3 -0
- package/es/form/SchemaForm/initializeDataSource.d.ts +15 -0
- package/es/form/SchemaForm/initializeDataSource.js +0 -7
- package/es/form/SchemaForm/initializeFormButton.d.ts +3 -0
- package/es/form/SchemaForm/initializeFormButton.js +0 -2
- package/es/form/SchemaForm/initializeFormCollapse.d.ts +3 -0
- package/es/form/SchemaForm/initializeFormGroup.d.ts +3 -0
- package/es/form/SchemaForm/initializeFormStep.d.ts +5 -0
- package/es/form/SchemaForm/initializeFormTab.d.ts +3 -0
- package/es/form/SchemaForm/initializeReactions.d.ts +2 -0
- package/es/form/SchemaForm/initializeReactions.js +0 -1
- package/es/form/SchemaForm/initializeRequest.d.ts +11 -0
- package/es/form/SchemaForm/initializeRules.d.ts +11 -0
- package/es/form/SchemaForm/initializeSelectTable.d.ts +3 -0
- package/es/form/SchemaForm/initializeSelectTable.js +0 -1
- package/es/form/SchemaForm/reactions.d.ts +6 -0
- package/es/form/SchemaForm/reactions.js +0 -5
- package/es/form/docs/ActionResponse.d.ts +8 -0
- package/es/form/fieldTypeMap.d.ts +7 -0
- package/es/form/index.d.ts +125 -0
- package/es/form/index.js +0 -4
- package/es/form/locales/validate.d.ts +159 -0
- package/es/form/schemaNameMap.d.ts +5 -0
- package/es/form/typing.d.ts +194 -0
- package/es/form/utils/parseSchema.d.ts +3 -0
- package/es/form/utils/parseSchema.js +38 -0
- package/es/form/utils.d.ts +55 -0
- package/es/form/utils.js +0 -12
- package/es/form/warning.d.ts +3 -0
- package/es/form/warning.js +0 -2
- package/es/global.scss +3 -1
- package/es/hooks/index.d.ts +2 -0
- package/es/image/index.d.ts +22 -0
- package/es/image/index.js +73 -0
- package/es/image/index.scss +3 -0
- package/es/index-without-icon.d.ts +32 -0
- package/es/index.d.ts +34 -0
- package/es/index.js +14 -3
- package/es/info/components/InfoGroup/index.d.ts +5 -0
- package/es/info/components/InfoGroup/index.js +4 -2
- package/es/info/components/InfoValueItem/index.d.ts +5 -0
- package/es/info/components/InfoValueItem/index.js +20 -32
- package/es/info/components/ProInfoItem/index.d.ts +5 -0
- package/es/info/components/ProInfoItem/index.js +0 -1
- package/es/info/components/baseInfo/index.d.ts +8 -0
- package/es/info/components/baseInfo/index.js +4 -5
- package/es/info/components/headerInfo/index.d.ts +8 -0
- package/es/info/components/tableInfo/index.d.ts +7 -0
- package/es/info/components/tableInfo/index.js +4 -6
- package/es/info/index.d.ts +6 -0
- package/es/info/index.js +17 -21
- package/es/info/typing.d.ts +220 -0
- package/es/info/utils/index.d.ts +20 -0
- package/es/info/utils/index.js +0 -3
- package/es/info/utils/layout.d.ts +2 -0
- package/es/info/utils/utils.d.ts +1 -0
- package/es/layout/index.d.ts +2 -0
- package/es/layout/index.js +0 -2
- package/es/next-xconsole.scss +34 -0
- package/es/nocode/configurators/Card.d.ts +3 -0
- package/es/nocode/configurators/PageHeader.d.ts +3 -0
- package/es/nocode/configurators/ProTable.d.ts +3 -0
- package/es/nocode/configurators/ProTable.js +1 -22
- package/es/nocode/configurators/common.d.ts +280 -0
- package/es/nocode/configurators/index.d.ts +15 -0
- package/es/nocode/configurators/index.js +1 -0
- package/es/nocode/configurators/map.d.ts +2 -0
- package/es/nocode/index.d.ts +8 -0
- package/es/nocode/index.js +0 -2
- package/es/nocode/pages/editor.d.ts +12 -0
- package/es/nocode/pages/index.d.ts +14 -0
- package/es/nocode/pages/index.js +1 -29
- package/es/nocode/pages/playground.d.ts +11 -0
- package/es/nocode/pages/playground.js +5 -3
- package/es/nocode/pages/renderer.d.ts +10 -0
- package/es/nocode/pages/renderer.js +6 -4
- package/es/nocode/playground.d.ts +14 -0
- package/es/nocode/playground.js +4 -2
- package/es/page-container/index.d.ts +3 -0
- package/es/page-header/index.d.ts +74 -0
- package/es/page-header/index.js +13 -23
- package/es/page-header/index.scss +2 -1
- package/es/page-header/xconsole.scss +5 -0
- package/es/sidebar/components/sidebar-container/index.d.ts +5 -0
- package/es/sidebar/components/sidebar-container/index.js +7 -10
- package/es/sidebar/components/tree/index.d.ts +6 -0
- package/es/sidebar/components/tree/index.js +24 -28
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.d.ts +15 -0
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.js +4 -3
- package/es/sidebar/components/tree-node/components/IconAction/index.d.ts +12 -0
- package/es/sidebar/components/tree-node/components/IconAction/index.js +2 -4
- package/es/sidebar/components/tree-node/components/IconSwitch/index.d.ts +23 -0
- package/es/sidebar/components/tree-node/components/IconSwitch/index.js +0 -1
- package/es/sidebar/components/tree-node/components/IconSwitch/index.scss +1 -1
- package/es/sidebar/components/tree-node/index.d.ts +7 -0
- package/es/sidebar/components/tree-node/index.js +16 -29
- package/es/sidebar/index.d.ts +9 -0
- package/es/sidebar/index.js +13 -18
- package/es/sidebar/typing.d.ts +145 -0
- package/es/sidebar/utils/action-ref.d.ts +3 -0
- package/es/sidebar/utils/index.d.ts +364 -0
- package/es/sidebar/utils/index.js +18 -19
- package/es/skeleton/index.d.ts +3 -0
- package/es/table/components/CardView/index.d.ts +5 -0
- package/es/table/components/CardView/index.js +387 -0
- package/es/table/components/CardView/index.scss +46 -0
- package/es/table/components/EmptyContent/index.d.ts +2 -0
- package/es/table/components/Filter/index.d.ts +12 -0
- package/es/table/components/Filter/index.js +110 -79
- package/es/table/components/Layout/index.d.ts +5 -0
- package/es/table/components/Layout/index.js +16 -16
- package/es/table/components/Layout/index.scss +1 -0
- package/es/table/components/LoadMore/index.d.ts +20 -0
- package/es/table/components/LoadMore/index.js +88 -0
- package/es/table/components/LoadMore/index.scss +19 -0
- package/es/table/components/Pagination/index.d.ts +8 -0
- package/es/table/components/Pagination/index.js +48 -31
- package/es/table/components/QuickAction/index.d.ts +11 -0
- package/es/table/components/QuickAction/index.js +2 -3
- package/es/table/components/ToolBar/CardSwitch.d.ts +8 -0
- package/es/table/components/ToolBar/CardSwitch.js +52 -0
- package/es/table/components/ToolBar/DensityIcon.d.ts +4 -0
- package/es/table/components/ToolBar/DensityIcon.js +2 -7
- package/es/table/components/ToolBar/FilterColumnIcon.d.ts +4 -0
- package/es/table/components/ToolBar/FilterColumnIcon.js +41 -35
- package/es/table/components/ToolBar/FullScreenIcon.d.ts +4 -0
- package/es/table/components/ToolBar/FullScreenIcon.js +0 -1
- package/es/table/components/ToolBar/Fullscreen.d.ts +10 -0
- package/es/table/components/ToolBar/Fullscreen.js +10 -3
- package/es/table/components/ToolBar/RefreshIcon.d.ts +4 -0
- package/es/table/components/ToolBar/RefreshIcon.js +162 -26
- package/es/table/components/ToolBar/index.d.ts +5 -0
- package/es/table/components/ToolBar/index.js +65 -33
- package/es/table/components/ToolBar/index.scss +27 -1
- package/es/table/index.d.ts +6 -0
- package/es/table/index.js +299 -128
- package/es/table/index.scss +8 -0
- package/es/table/typing.d.ts +426 -0
- package/es/table/utils/columnRender.d.ts +13 -0
- package/es/table/utils/columnRender.js +32 -37
- package/es/table/utils/genProColumnToColumn.d.ts +13 -0
- package/es/table/utils/genProColumnToColumn.js +10 -3
- package/es/table/utils/getTableProps.d.ts +2 -0
- package/es/table/utils/getTableSortIcons.d.ts +3 -0
- package/es/table/utils/index.d.ts +19 -0
- package/es/table/utils/index.js +0 -6
- package/es/table/utils/pureColumnRender.d.ts +9 -0
- package/es/table/utils/pureColumnRender.js +1 -9
- package/es/table/utils/pureGenProColumnToColumn.d.ts +7 -0
- package/es/table/utils/useTableSelection.d.ts +3 -0
- package/es/table/utils/util.d.ts +5 -0
- package/es/table/utils/util.js +19 -0
- package/es/templates/Detail/index.d.ts +2 -0
- package/es/templates/Form/index.d.ts +2 -0
- package/es/templates/List/index.d.ts +9 -0
- package/es/templates/List/index.js +6 -4
- package/es/templates/index.d.ts +3 -0
- package/es/templates/index.js +1 -2
- package/es/timeline/ProTimeLineItem/index.d.ts +5 -0
- package/es/timeline/ProTimeLineItem/index.js +5 -9
- package/es/timeline/index.d.ts +10 -0
- package/es/timeline/index.js +5 -5
- package/es/timeline/typing.d.ts +107 -0
- package/es/utils/aspect.d.ts +2 -0
- package/es/utils/aspect.js +57 -0
- package/es/utils/index.d.ts +3 -0
- package/es/utils/message.d.ts +3 -0
- package/es/utils/message.js +5 -3
- package/es/xconsole.scss +526 -0
- package/lib/actions/base.d.ts +24 -0
- package/lib/actions/base.js +1 -1
- package/lib/actions/confirm.d.ts +7 -0
- package/lib/actions/danger-confirm.d.ts +7 -0
- package/lib/actions/danger-pop-confirm.d.ts +5 -0
- package/lib/actions/dialog-component.d.ts +10 -0
- package/lib/actions/dialog-component.js +4 -1
- package/lib/actions/dialog-form.d.ts +29 -0
- package/lib/actions/dialog-form.js +7 -9
- package/lib/actions/dialog-info.d.ts +9 -0
- package/lib/actions/dialog-table.d.ts +9 -0
- package/lib/actions/dialog.d.ts +40 -0
- package/lib/actions/dialog.js +7 -8
- package/lib/actions/drawer-form.d.ts +6 -0
- package/lib/actions/drawer-info.d.ts +6 -0
- package/lib/actions/drawer-table.d.ts +6 -0
- package/lib/actions/drawer.d.ts +6 -0
- package/lib/actions/error.d.ts +7 -0
- package/lib/actions/index.d.ts +114 -0
- package/lib/actions/index.js +73 -44
- package/lib/actions/index.scss +6 -1
- package/lib/actions/link.d.ts +8 -0
- package/lib/actions/link.js +2 -3
- package/lib/actions/notice.d.ts +7 -0
- package/lib/actions/pop-confirm.d.ts +9 -0
- package/lib/actions/quick.d.ts +2 -0
- package/lib/actions/quick.js +33 -0
- package/lib/actions/request.d.ts +9 -0
- package/lib/actions/request.js +2 -3
- package/lib/actions/utils.d.ts +1 -0
- package/lib/card/card-container.d.ts +18 -0
- package/lib/card/card-container.js +4 -6
- package/lib/card/divider.d.ts +6 -0
- package/lib/card/divider.js +4 -2
- package/lib/card/index.d.ts +109 -0
- package/lib/card/index.js +10 -20
- package/lib/card/index.scss +15 -0
- package/lib/card/selectable.d.ts +13 -0
- package/lib/card/selectable.js +4 -2
- package/lib/card/tab.d.ts +6 -0
- package/lib/card/tab.js +4 -2
- package/lib/card/utils.d.ts +9 -0
- package/lib/card/xconsole.scss +3 -0
- package/lib/field/index.d.ts +3 -0
- package/lib/form/Components/Editable/index.d.ts +20 -0
- package/lib/form/Components/Editable/index.js +2 -2
- package/lib/form/Components/FormGroup/index.d.ts +14 -0
- package/lib/form/Components/FormGroup/index.js +3 -4
- package/lib/form/Components/LightFilter/componentMap.d.ts +3 -0
- package/lib/form/Components/LightFilter/index.d.ts +17 -0
- package/lib/form/Components/LightFilter/index.js +2 -11
- package/lib/form/Components/ProField/index.d.ts +2 -0
- package/lib/form/Components/ProField/index.js +4 -2
- package/lib/form/Components/ProField/mapDateFormat.d.ts +3 -0
- package/lib/form/Components/Text/index.d.ts +8 -0
- package/lib/form/Components/Text/index.js +4 -2
- package/lib/form/Filter/AdvancedFilter.d.ts +7 -0
- package/lib/form/Filter/AdvancedFilter.js +14 -16
- package/lib/form/Filter/Layout.d.ts +5 -0
- package/lib/form/Filter/LightFilter.d.ts +7 -0
- package/lib/form/Filter/LightFilter.js +9 -13
- package/lib/form/Filter/SimpleFilter.d.ts +7 -0
- package/lib/form/Filter/SimpleFilter.js +5 -8
- package/lib/form/Filter/index.d.ts +9 -0
- package/lib/form/Filter/index.js +19 -25
- package/lib/form/Filter/index.scss +1 -0
- package/lib/form/Filter/index2.d.ts +13 -0
- package/lib/form/Filter/index2.js +17 -22
- package/lib/form/Filter/index2.scss +1 -0
- package/lib/form/Filter/useBindUrl.d.ts +2 -0
- package/lib/form/Filter/useBindUrl.js +0 -3
- package/lib/form/Filter/useSpecialProps.d.ts +6 -0
- package/lib/form/ProForm/addCascadeEffect.d.ts +2 -0
- package/lib/form/ProForm/customComponent.d.ts +3 -0
- package/lib/form/ProForm/index.d.ts +5 -0
- package/lib/form/ProForm/index.js +9 -7
- package/lib/form/ProForm/useAutoLayout.d.ts +9 -0
- package/lib/form/ProForm/useAutoLayout.js +0 -4
- package/lib/form/ProForm/useAutoSubmit.d.ts +6 -0
- package/lib/form/ProForm/useAutoSubmit.js +2 -3
- package/lib/form/ProForm/useFieldRequest.d.ts +5 -0
- package/lib/form/ProForm/useFormDisplayValues.d.ts +4 -0
- package/lib/form/ProForm/useFormDisplayValues.js +0 -1
- package/lib/form/ProForm/useInitialRequest.d.ts +6 -0
- package/lib/form/SchemaForm/adapterComponent.d.ts +5 -0
- package/lib/form/SchemaForm/adapterComponent.js +0 -1
- package/lib/form/SchemaForm/adapterDecorator.d.ts +6 -0
- package/lib/form/SchemaForm/adapterType.d.ts +5 -0
- package/lib/form/SchemaForm/adapterType.js +0 -1
- package/lib/form/SchemaForm/index.d.ts +4 -0
- package/lib/form/SchemaForm/index.js +0 -13
- package/lib/form/SchemaForm/initializeArrayCards.d.ts +3 -0
- package/lib/form/SchemaForm/initializeArrayCollapse.d.ts +3 -0
- package/lib/form/SchemaForm/initializeArrayItems.d.ts +3 -0
- package/lib/form/SchemaForm/initializeArrayTable.d.ts +3 -0
- package/lib/form/SchemaForm/initializeDataSource.d.ts +15 -0
- package/lib/form/SchemaForm/initializeDataSource.js +2 -9
- package/lib/form/SchemaForm/initializeFormButton.d.ts +3 -0
- package/lib/form/SchemaForm/initializeFormButton.js +0 -2
- package/lib/form/SchemaForm/initializeFormCollapse.d.ts +3 -0
- package/lib/form/SchemaForm/initializeFormGroup.d.ts +3 -0
- package/lib/form/SchemaForm/initializeFormStep.d.ts +5 -0
- package/lib/form/SchemaForm/initializeFormTab.d.ts +3 -0
- package/lib/form/SchemaForm/initializeReactions.d.ts +2 -0
- package/lib/form/SchemaForm/initializeReactions.js +0 -1
- package/lib/form/SchemaForm/initializeRequest.d.ts +11 -0
- package/lib/form/SchemaForm/initializeRules.d.ts +11 -0
- package/lib/form/SchemaForm/initializeSelectTable.d.ts +3 -0
- package/lib/form/SchemaForm/reactions.d.ts +6 -0
- package/lib/form/SchemaForm/reactions.js +0 -5
- package/lib/form/docs/ActionResponse.d.ts +8 -0
- package/lib/form/fieldTypeMap.d.ts +7 -0
- package/lib/form/index.d.ts +125 -0
- package/lib/form/locales/validate.d.ts +159 -0
- package/lib/form/schemaNameMap.d.ts +5 -0
- package/lib/form/typing.d.ts +194 -0
- package/lib/form/typing.js +5 -1
- package/lib/form/utils/parseSchema.d.ts +3 -0
- package/lib/form/utils/parseSchema.js +45 -0
- package/lib/form/utils.d.ts +55 -0
- package/lib/form/utils.js +0 -11
- package/lib/form/warning.d.ts +3 -0
- package/lib/form/warning.js +0 -2
- package/lib/global.scss +3 -1
- package/lib/hooks/index.d.ts +2 -0
- package/lib/image/index.d.ts +22 -0
- package/lib/image/index.js +83 -0
- package/lib/image/index.scss +3 -0
- package/lib/index-without-icon.d.ts +32 -0
- package/lib/index.d.ts +34 -0
- package/lib/index.js +31 -2
- package/lib/info/components/InfoGroup/index.d.ts +5 -0
- package/lib/info/components/InfoGroup/index.js +4 -2
- package/lib/info/components/InfoValueItem/index.d.ts +5 -0
- package/lib/info/components/InfoValueItem/index.js +20 -32
- package/lib/info/components/ProInfoItem/index.d.ts +5 -0
- package/lib/info/components/ProInfoItem/index.js +0 -1
- package/lib/info/components/baseInfo/index.d.ts +8 -0
- package/lib/info/components/baseInfo/index.js +4 -5
- package/lib/info/components/headerInfo/index.d.ts +8 -0
- package/lib/info/components/tableInfo/index.d.ts +7 -0
- package/lib/info/components/tableInfo/index.js +4 -6
- package/lib/info/index.d.ts +6 -0
- package/lib/info/index.js +16 -20
- package/lib/info/typing.d.ts +220 -0
- package/lib/info/typing.js +5 -1
- package/lib/info/utils/index.d.ts +20 -0
- package/lib/info/utils/index.js +0 -3
- package/lib/info/utils/layout.d.ts +2 -0
- package/lib/info/utils/utils.d.ts +1 -0
- package/lib/layout/index.d.ts +2 -0
- package/lib/next-xconsole.scss +34 -0
- package/lib/nocode/configurators/Card.d.ts +3 -0
- package/lib/nocode/configurators/PageHeader.d.ts +3 -0
- package/lib/nocode/configurators/ProTable.d.ts +3 -0
- package/lib/nocode/configurators/ProTable.js +1 -22
- package/lib/nocode/configurators/common.d.ts +280 -0
- package/lib/nocode/configurators/index.d.ts +15 -0
- package/lib/nocode/configurators/index.js +1 -0
- package/lib/nocode/configurators/map.d.ts +2 -0
- package/lib/nocode/index.d.ts +8 -0
- package/lib/nocode/pages/editor.d.ts +12 -0
- package/lib/nocode/pages/index.d.ts +14 -0
- package/lib/nocode/pages/index.js +2 -27
- package/lib/nocode/pages/playground.d.ts +11 -0
- package/lib/nocode/pages/playground.js +5 -3
- package/lib/nocode/pages/renderer.d.ts +10 -0
- package/lib/nocode/pages/renderer.js +6 -4
- package/lib/nocode/playground.d.ts +14 -0
- package/lib/nocode/playground.js +4 -2
- package/lib/page-container/index.d.ts +3 -0
- package/lib/page-header/index.d.ts +74 -0
- package/lib/page-header/index.js +11 -22
- package/lib/page-header/index.scss +2 -1
- package/lib/page-header/xconsole.scss +5 -0
- package/lib/sidebar/components/sidebar-container/index.d.ts +5 -0
- package/lib/sidebar/components/sidebar-container/index.js +7 -10
- package/lib/sidebar/components/tree/index.d.ts +6 -0
- package/lib/sidebar/components/tree/index.js +24 -28
- package/lib/sidebar/components/tree-node/components/HoverTooltip/index.d.ts +15 -0
- package/lib/sidebar/components/tree-node/components/HoverTooltip/index.js +4 -3
- package/lib/sidebar/components/tree-node/components/IconAction/index.d.ts +12 -0
- package/lib/sidebar/components/tree-node/components/IconAction/index.js +2 -4
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.d.ts +23 -0
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.js +0 -1
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.scss +1 -1
- package/lib/sidebar/components/tree-node/index.d.ts +7 -0
- package/lib/sidebar/components/tree-node/index.js +16 -29
- package/lib/sidebar/index.d.ts +9 -0
- package/lib/sidebar/index.js +20 -18
- package/lib/sidebar/typing.d.ts +145 -0
- package/lib/sidebar/typing.js +5 -1
- package/lib/sidebar/utils/action-ref.d.ts +3 -0
- package/lib/sidebar/utils/index.d.ts +364 -0
- package/lib/sidebar/utils/index.js +18 -19
- package/lib/skeleton/index.d.ts +3 -0
- package/lib/table/components/CardView/index.d.ts +5 -0
- package/lib/table/components/CardView/index.js +397 -0
- package/lib/table/components/CardView/index.scss +46 -0
- package/lib/table/components/EmptyContent/index.d.ts +2 -0
- package/lib/table/components/Filter/index.d.ts +12 -0
- package/lib/table/components/Filter/index.js +109 -78
- package/lib/table/components/Layout/index.d.ts +5 -0
- package/lib/table/components/Layout/index.js +17 -17
- package/lib/table/components/Layout/index.scss +1 -0
- package/lib/table/components/LoadMore/index.d.ts +20 -0
- package/lib/table/components/LoadMore/index.js +99 -0
- package/lib/table/components/LoadMore/index.scss +19 -0
- package/lib/table/components/Pagination/index.d.ts +8 -0
- package/lib/table/components/Pagination/index.js +47 -30
- package/lib/table/components/QuickAction/index.d.ts +11 -0
- package/lib/table/components/QuickAction/index.js +2 -3
- package/lib/table/components/ToolBar/CardSwitch.d.ts +8 -0
- package/lib/table/components/ToolBar/CardSwitch.js +60 -0
- package/lib/table/components/ToolBar/DensityIcon.d.ts +4 -0
- package/lib/table/components/ToolBar/DensityIcon.js +2 -7
- package/lib/table/components/ToolBar/FilterColumnIcon.d.ts +4 -0
- package/lib/table/components/ToolBar/FilterColumnIcon.js +40 -34
- package/lib/table/components/ToolBar/FullScreenIcon.d.ts +4 -0
- package/lib/table/components/ToolBar/FullScreenIcon.js +0 -1
- package/lib/table/components/ToolBar/Fullscreen.d.ts +10 -0
- package/lib/table/components/ToolBar/Fullscreen.js +10 -3
- package/lib/table/components/ToolBar/RefreshIcon.d.ts +4 -0
- package/lib/table/components/ToolBar/RefreshIcon.js +164 -29
- package/lib/table/components/ToolBar/index.d.ts +5 -0
- package/lib/table/components/ToolBar/index.js +64 -32
- package/lib/table/components/ToolBar/index.scss +27 -1
- package/lib/table/index.d.ts +6 -0
- package/lib/table/index.js +299 -128
- package/lib/table/index.scss +8 -0
- package/lib/table/typing.d.ts +426 -0
- package/lib/table/typing.js +5 -1
- package/lib/table/utils/columnRender.d.ts +13 -0
- package/lib/table/utils/columnRender.js +32 -36
- package/lib/table/utils/genProColumnToColumn.d.ts +13 -0
- package/lib/table/utils/genProColumnToColumn.js +10 -3
- package/lib/table/utils/getTableProps.d.ts +2 -0
- package/lib/table/utils/getTableSortIcons.d.ts +3 -0
- package/lib/table/utils/index.d.ts +19 -0
- package/lib/table/utils/index.js +0 -6
- package/lib/table/utils/pureColumnRender.d.ts +9 -0
- package/lib/table/utils/pureColumnRender.js +1 -9
- package/lib/table/utils/pureGenProColumnToColumn.d.ts +7 -0
- package/lib/table/utils/useTableSelection.d.ts +3 -0
- package/lib/table/utils/util.d.ts +5 -0
- package/lib/table/utils/util.js +25 -0
- package/lib/templates/Detail/index.d.ts +2 -0
- package/lib/templates/Form/index.d.ts +2 -0
- package/lib/templates/List/index.d.ts +9 -0
- package/lib/templates/List/index.js +6 -4
- package/lib/templates/index.d.ts +3 -0
- package/lib/timeline/ProTimeLineItem/index.d.ts +5 -0
- package/lib/timeline/ProTimeLineItem/index.js +5 -9
- package/lib/timeline/index.d.ts +10 -0
- package/lib/timeline/index.js +5 -5
- package/lib/timeline/typing.d.ts +107 -0
- package/lib/timeline/typing.js +5 -1
- package/lib/utils/aspect.d.ts +2 -0
- package/lib/utils/aspect.js +64 -0
- package/lib/utils/index.d.ts +3 -0
- package/lib/utils/message.d.ts +3 -0
- package/lib/utils/message.js +5 -3
- package/lib/xconsole.scss +526 -0
- package/package.json +9 -8
package/es/table/index.js
CHANGED
@@ -1,13 +1,10 @@
|
|
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
|
-
|
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", "autoRefreshProps", "customRequest", "filterColumnType", "defaultFilterParams", "reserveSelectedRecords", "size", "disableSelectAll", "context", "fixedTableBody", "isTree", "toolBarAutoWidth", "data-teamix-spm", "switchCardView", "cardViewProps", "defaultView", "emptyProps", "bindUrlProps", "bindUrl", "autoRedirect", "useMaxData"],
|
2
|
+
_excluded2 = ["onChange"];
|
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
4
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
5
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."); }
|
6
6
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
7
7
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
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; }
|
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; }
|
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; }
|
11
8
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
12
9
|
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."); }
|
13
10
|
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); }
|
@@ -16,11 +13,14 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
16
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
17
14
|
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; }
|
18
15
|
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; }
|
16
|
+
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; }
|
17
|
+
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; }
|
18
|
+
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; }
|
19
19
|
import React, { useState, useEffect, useRef, useMemo } from 'react';
|
20
20
|
import { Table, Checkbox } from '@alicloudfe/components';
|
21
21
|
import Pagination from './components/Pagination';
|
22
22
|
import genProColumnToColumn from './utils/genProColumnToColumn';
|
23
|
-
import { getGlobalConfig, useRequest, request as utilResquest, getDeepValue, getMessage, pickProps, usePrefixCls,
|
23
|
+
import { getGlobalConfig, useRequest, request as utilResquest, getDeepValue, getMessage, pickProps, usePrefixCls, getTargetValue } from '@teamix/utils';
|
24
24
|
import { ProSkeletonRaw as Skeleton } from '../skeleton';
|
25
25
|
import './index.scss';
|
26
26
|
import Layout from './components/Layout';
|
@@ -29,14 +29,17 @@ import getTableProps from './utils/getTableProps';
|
|
29
29
|
import getTableSortIcons from './utils/getTableSortIcons';
|
30
30
|
import useTableSelection from './utils/useTableSelection';
|
31
31
|
import FullScreen from './components/ToolBar/Fullscreen';
|
32
|
-
import EmptyContent from '
|
32
|
+
import { EmptyContent } from '@teamix/pro-field';
|
33
33
|
import { ProActionGroup } from '../actions';
|
34
34
|
import classNames from 'classnames';
|
35
35
|
import ProPageContainer from '../page-container';
|
36
36
|
import debounce from 'lodash.debounce';
|
37
|
+
import CardView from './components/CardView';
|
38
|
+
import { useUrlState } from '@teamix/hooks';
|
39
|
+
import { getUrlStateFilter } from './utils/util';
|
40
|
+
import { ProComponentAspect } from '../utils/aspect';
|
37
41
|
export * from './typing';
|
38
42
|
var cls = usePrefixCls('teamix-pro-table');
|
39
|
-
|
40
43
|
/**
|
41
44
|
* 处理原生传入的 columns 以便于 选择列 方便处理
|
42
45
|
* @param columns 原生传入的 columns
|
@@ -46,7 +49,7 @@ var processColumns = function processColumns(columns, initialColumns) {
|
|
46
49
|
var _getGlobalConfig;
|
47
50
|
var globalFilterColumns = (_getGlobalConfig = getGlobalConfig('ProTable')) === null || _getGlobalConfig === void 0 ? void 0 : _getGlobalConfig.filterColumns;
|
48
51
|
var filterColumns = columns.filter(function (item) {
|
49
|
-
return item.columnFilters !== false && (item === null || item === void 0 ? void 0 : item.hidden) !== true && (!globalFilterColumns || globalFilterColumns(item));
|
52
|
+
return item.columnFilters !== false && (item === null || item === void 0 ? void 0 : item.hidden) !== true && (!globalFilterColumns || globalFilterColumns(_objectSpread({}, item)));
|
50
53
|
});
|
51
54
|
// 处理只剩一列批量选择的情况下宽度错乱问题
|
52
55
|
if (filterColumns === null || filterColumns === void 0 ? void 0 : filterColumns.length) {
|
@@ -71,7 +74,6 @@ var processColumns = function processColumns(columns, initialColumns) {
|
|
71
74
|
}
|
72
75
|
return filterColumns;
|
73
76
|
};
|
74
|
-
|
75
77
|
/** 默认请求翻页参数 */
|
76
78
|
var globalPageKey = 'currentPage';
|
77
79
|
var globalPageSizeKey = 'pageSize';
|
@@ -84,7 +86,7 @@ var globalFormatSort = function globalFormatSort(sort) {
|
|
84
86
|
return {};
|
85
87
|
};
|
86
88
|
var ProTable = function ProTable(props) {
|
87
|
-
var _rowSelection$selecte;
|
89
|
+
var _urlState$currentPage, _rowSelection$selecte;
|
88
90
|
var header = props.header,
|
89
91
|
className = props.className,
|
90
92
|
tableClassName = props.tableClassName,
|
@@ -133,9 +135,8 @@ var ProTable = function ProTable(props) {
|
|
133
135
|
_props$footerSuction = props.footerSuction,
|
134
136
|
footerSuction = _props$footerSuction === void 0 ? false : _props$footerSuction,
|
135
137
|
_props$autoRefresh = props.autoRefresh,
|
136
|
-
autoRefresh = _props$autoRefresh === void 0 ?
|
137
|
-
|
138
|
-
} : _props$autoRefresh,
|
138
|
+
autoRefresh = _props$autoRefresh === void 0 ? false : _props$autoRefresh,
|
139
|
+
autoRefreshProps = props.autoRefreshProps,
|
139
140
|
customRequest = props.customRequest,
|
140
141
|
_props$filterColumnTy = props.filterColumnType,
|
141
142
|
filterColumnType = _props$filterColumnTy === void 0 ? 'auto' : _props$filterColumnTy,
|
@@ -149,15 +150,33 @@ var ProTable = function ProTable(props) {
|
|
149
150
|
_props$fixedTableBody = props.fixedTableBody,
|
150
151
|
fixedTableBody = _props$fixedTableBody === void 0 ? false : _props$fixedTableBody,
|
151
152
|
isTree = props.isTree,
|
153
|
+
_props$toolBarAutoWid = props.toolBarAutoWidth,
|
154
|
+
toolBarAutoWidth = _props$toolBarAutoWid === void 0 ? true : _props$toolBarAutoWid,
|
155
|
+
dataTeamixSpm = props['data-teamix-spm'],
|
156
|
+
_props$switchCardView = props.switchCardView,
|
157
|
+
switchCardView = _props$switchCardView === void 0 ? false : _props$switchCardView,
|
158
|
+
cardViewProps = props.cardViewProps,
|
159
|
+
_props$defaultView = props.defaultView,
|
160
|
+
defaultView = _props$defaultView === void 0 ? 'table' : _props$defaultView,
|
161
|
+
emptyProps = props.emptyProps,
|
162
|
+
bindUrlProps = props.bindUrlProps,
|
163
|
+
bindUrl = props.bindUrl,
|
164
|
+
_props$autoRedirect = props.autoRedirect,
|
165
|
+
autoRedirect = _props$autoRedirect === void 0 ? true : _props$autoRedirect,
|
166
|
+
useMaxData = props.useMaxData,
|
152
167
|
otherProps = _objectWithoutProperties(props, _excluded);
|
153
168
|
var targetPageKey = pageKey || globalPageKey;
|
154
169
|
var targetPageSizeKey = pageSizeKey || globalPageSizeKey;
|
155
170
|
var targetFormatSort = formatSort || globalFormatSort;
|
156
|
-
var
|
171
|
+
var _ref = bindUrl ? useUrlState() : [],
|
172
|
+
_ref2 = _slicedToArray(_ref, 2),
|
173
|
+
urlState = _ref2[0],
|
174
|
+
setUrlState = _ref2[1];
|
175
|
+
var _useState = useState((_urlState$currentPage = urlState === null || urlState === void 0 ? void 0 : urlState.currentPage) !== null && _urlState$currentPage !== void 0 ? _urlState$currentPage : 1),
|
157
176
|
_useState2 = _slicedToArray(_useState, 2),
|
158
177
|
currentPage = _useState2[0],
|
159
178
|
setCurrentPage = _useState2[1];
|
160
|
-
var _useState3 = useState(props.pageSize || 10),
|
179
|
+
var _useState3 = useState((urlState === null || urlState === void 0 ? void 0 : urlState.pageSize) || props.pageSize || 10),
|
161
180
|
_useState4 = _slicedToArray(_useState3, 2),
|
162
181
|
pageSize = _useState4[0],
|
163
182
|
setPageSize = _useState4[1];
|
@@ -168,12 +187,12 @@ var ProTable = function ProTable(props) {
|
|
168
187
|
var _useState7 = useState(propsDataSource !== null && propsDataSource !== void 0 ? propsDataSource : []),
|
169
188
|
_useState8 = _slicedToArray(_useState7, 2),
|
170
189
|
data = _useState8[0],
|
171
|
-
|
190
|
+
_setData = _useState8[1];
|
172
191
|
var _useState9 = useState(props.sort || {}),
|
173
192
|
_useState10 = _slicedToArray(_useState9, 2),
|
174
193
|
sort = _useState10[0],
|
175
194
|
setSort = _useState10[1];
|
176
|
-
var _useState11 = useState(!propsDataSource && requestWhenMount && propsShowSkeleton),
|
195
|
+
var _useState11 = useState(!propsDataSource && requestWhenMount && propsShowSkeleton && !!url),
|
177
196
|
_useState12 = _slicedToArray(_useState11, 2),
|
178
197
|
showSkeleton = _useState12[0],
|
179
198
|
setShowSkeleton = _useState12[1]; // 首次加载,渲染骨架屏
|
@@ -199,7 +218,24 @@ var ProTable = function ProTable(props) {
|
|
199
218
|
_useState20 = _slicedToArray(_useState19, 2),
|
200
219
|
showLoading = _useState20[0],
|
201
220
|
setShowLoading = _useState20[1];
|
202
|
-
|
221
|
+
// 表格内部用作存储的 Ref,标识 Table 组件是否被第一次渲染。用作 useUrlState filter 第一次渲染时使用 state 数据请求
|
222
|
+
var dataRef = useRef({
|
223
|
+
flag: true
|
224
|
+
});
|
225
|
+
useEffect(function () {
|
226
|
+
if (bindUrl && (bindUrlProps === null || bindUrlProps === void 0 ? void 0 : bindUrlProps.pagination) !== false) {
|
227
|
+
if ((urlState === null || urlState === void 0 ? void 0 : urlState.currentPage) !== currentPage) {
|
228
|
+
setUrlState === null || setUrlState === void 0 ? void 0 : setUrlState({
|
229
|
+
currentPage: currentPage
|
230
|
+
});
|
231
|
+
}
|
232
|
+
if ((urlState === null || urlState === void 0 ? void 0 : urlState.pageSize) !== pageSize) {
|
233
|
+
setUrlState === null || setUrlState === void 0 ? void 0 : setUrlState({
|
234
|
+
pageSize: pageSize
|
235
|
+
});
|
236
|
+
}
|
237
|
+
}
|
238
|
+
}, [currentPage, pageSize, urlState]);
|
203
239
|
// 存储能够被 on 监听到的 ProTable 状态
|
204
240
|
// 因为只做存储用。不需要更新视图以及需要同步更改。所以不使用 setState 更新
|
205
241
|
var _useState21 = useState({
|
@@ -209,17 +245,22 @@ var ProTable = function ProTable(props) {
|
|
209
245
|
}),
|
210
246
|
_useState22 = _slicedToArray(_useState21, 1),
|
211
247
|
actionRefState = _useState22[0];
|
212
|
-
|
213
248
|
// 存储 on 监听事件
|
214
249
|
var _useState23 = useState({
|
215
250
|
fullScreenState: {}
|
216
251
|
}),
|
217
252
|
_useState24 = _slicedToArray(_useState23, 1),
|
218
253
|
actionRefCallback = _useState24[0];
|
219
|
-
|
220
254
|
// 存储定时器 id
|
221
255
|
var autoRefreshTimerRef = useRef();
|
222
256
|
var onResize = null;
|
257
|
+
// useEffect(() => {
|
258
|
+
// setShowSkeleton(propsShowSkeleton);
|
259
|
+
// }, [propsShowSkeleton]);
|
260
|
+
// useEffect(() => {
|
261
|
+
// console.log('传入的props变化', propsLoading);
|
262
|
+
// setShowLoading(propsLoading ?? false);
|
263
|
+
// }, [propsLoading]);
|
223
264
|
useEffect(function () {
|
224
265
|
var _propsDataFilter$sche, _propsDataFilter$sche2;
|
225
266
|
getHeaderHeight(fullscreenState);
|
@@ -246,7 +287,6 @@ var ProTable = function ProTable(props) {
|
|
246
287
|
}
|
247
288
|
}, 500);
|
248
289
|
}
|
249
|
-
|
250
290
|
// 如果不传 dataFilter,则在这里初始化请求
|
251
291
|
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;
|
252
292
|
if (requestWhenMount && !hasDataFilter) {
|
@@ -265,7 +305,6 @@ var ProTable = function ProTable(props) {
|
|
265
305
|
actionRef.current = undefined;
|
266
306
|
};
|
267
307
|
}, []);
|
268
|
-
|
269
308
|
// 获取header高度,用作全屏吸底吸底高度计算以及固定body高度计算(滚动条在底部)
|
270
309
|
var getHeaderHeight = function getHeaderHeight(isFullscreen, offset) {
|
271
310
|
var _tableDom$getElements, _tableDom$getElements2, _document$querySelect, _document$querySelect2, _document$querySelect3;
|
@@ -296,23 +335,22 @@ var ProTable = function ProTable(props) {
|
|
296
335
|
// 16px 为 padding
|
297
336
|
var pageHeaderHeight = ((_pageContainerDom$off = pageContainerDom === null || pageContainerDom === void 0 ? void 0 : pageContainerDom.offsetHeight) !== null && _pageContainerDom$off !== void 0 ? _pageContainerDom$off : 0) + 16;
|
298
337
|
var teamixNavHeight = (_teamixNavDom$offsetH = teamixNavDom === null || teamixNavDom === void 0 ? void 0 : teamixNavDom.offsetHeight) !== null && _teamixNavDom$offsetH !== void 0 ? _teamixNavDom$offsetH : 0;
|
299
|
-
|
300
338
|
// 1 为预留值,js无法取出精确高度,会被四舍五入
|
301
339
|
var offsetHeaderHeight = headerHeight + tableHeaderHeight + pageHeaderHeight + teamixNavHeight + footerRowSelectionHeight + 16 + (offset !== null && offset !== void 0 ? offset : 0) + 1;
|
302
|
-
if (
|
340
|
+
if (switchViewState === 'card') {
|
341
|
+
offsetHeaderHeight = offsetHeaderHeight - tableHeaderHeight - footerRowSelectionHeight;
|
342
|
+
}
|
343
|
+
if ((tableBodyDom === null || tableBodyDom === void 0 ? void 0 : tableBodyDom.clientHeight) < (tableBodyDom === null || tableBodyDom === void 0 ? void 0 : tableBodyDom.scrollHeight)) {
|
303
344
|
setFooterSuctionState(true);
|
304
345
|
} else {
|
305
346
|
setFooterSuctionState(false);
|
306
347
|
}
|
307
|
-
|
308
348
|
// 如果有切换区tab,那么重新计算
|
309
349
|
if (headerFixedTopSectionDom.clientHeight) {
|
310
350
|
var _headerFixedTopSectio;
|
311
351
|
var headerFixedTopSectionHeight = (_headerFixedTopSectio = headerFixedTopSectionDom.clientHeight) !== null && _headerFixedTopSectio !== void 0 ? _headerFixedTopSectio : 0;
|
312
|
-
|
313
352
|
// const clientTableBodyHeight =
|
314
353
|
// document.body.clientHeight - offsetHeaderHeight;
|
315
|
-
|
316
354
|
setHeaderHeight(headerFixedTopSectionHeight + teamixNavHeight + footerRowSelectionHeight + tableHeaderHeight + 1);
|
317
355
|
return;
|
318
356
|
}
|
@@ -323,40 +361,44 @@ var ProTable = function ProTable(props) {
|
|
323
361
|
}
|
324
362
|
}, 50);
|
325
363
|
};
|
326
|
-
|
327
364
|
// header 区域高度。用作全屏计算吸顶吸底高度。默认不做计算
|
328
365
|
var _useState25 = useState(0),
|
329
366
|
_useState26 = _slicedToArray(_useState25, 2),
|
330
367
|
headerHeight = _useState26[0],
|
331
368
|
setHeaderHeight = _useState26[1];
|
332
|
-
|
333
369
|
// 全屏显示 className
|
334
370
|
var _useState27 = useState(false),
|
335
371
|
_useState28 = _slicedToArray(_useState27, 2),
|
336
372
|
fullscreenState = _useState28[0],
|
337
373
|
setFullscreenState = _useState28[1];
|
374
|
+
// 切换视角
|
375
|
+
var _useState29 = useState(defaultView !== null && defaultView !== void 0 ? defaultView : 'table'),
|
376
|
+
_useState30 = _slicedToArray(_useState29, 2),
|
377
|
+
switchViewState = _useState30[0],
|
378
|
+
setSwitchViewState = _useState30[1];
|
338
379
|
// 切换全屏搜索开关
|
339
380
|
var filterEnableRef = useRef({
|
340
381
|
fullscreen: false,
|
341
382
|
normal: true
|
342
383
|
});
|
343
|
-
|
384
|
+
// 全局状态 : 大数据截断
|
385
|
+
var globalUseMaxData = useMemo(function () {
|
386
|
+
var _getGlobalConfig2;
|
387
|
+
return (_getGlobalConfig2 = getGlobalConfig('ProTable')) === null || _getGlobalConfig2 === void 0 ? void 0 : _getGlobalConfig2.useMaxData;
|
388
|
+
}, []);
|
344
389
|
// 非全屏状态下的
|
345
390
|
var normalDataFilterFormRef = useRef();
|
346
391
|
var fullscreenDataFilterFormRef = useRef();
|
347
392
|
var normalDataFilterForm = normalDataFilterFormRef.current;
|
348
393
|
var fullscreenDataFilterForm = fullscreenDataFilterFormRef.current;
|
349
|
-
|
350
394
|
// 传给 QueryFilter 的 formRef
|
351
395
|
var dataFilterFormRef = !fullscreenState ? normalDataFilterFormRef : fullscreenDataFilterFormRef;
|
352
396
|
// let dataFilterForm = dataFilterFormRef.current;
|
353
|
-
|
354
397
|
// 整个内容区是否超过一屏。用于表格在非全屏模式下的吸底
|
355
|
-
var
|
356
|
-
|
357
|
-
footerSuctionState =
|
358
|
-
setFooterSuctionState =
|
359
|
-
|
398
|
+
var _useState31 = useState(false),
|
399
|
+
_useState32 = _slicedToArray(_useState31, 2),
|
400
|
+
footerSuctionState = _useState32[0],
|
401
|
+
setFooterSuctionState = _useState32[1];
|
360
402
|
// TODO 获取内容区是否超出一屏(暂时仅支持全家桶)
|
361
403
|
var getFooterSuctionState = function getFooterSuctionState() {
|
362
404
|
if (!footerSuction) {
|
@@ -378,7 +420,6 @@ var ProTable = function ProTable(props) {
|
|
378
420
|
}
|
379
421
|
}
|
380
422
|
};
|
381
|
-
|
382
423
|
// rowSelection 相关
|
383
424
|
var rowSelectionHook = useTableSelection(_objectSpread(_objectSpread({}, propsRowSelection), {}, {
|
384
425
|
// 当初始出现骨架屏的时候,不可选择
|
@@ -409,17 +450,15 @@ var ProTable = function ProTable(props) {
|
|
409
450
|
useEffect(function () {
|
410
451
|
getRowSelection && getRowSelection(rowSelectionHook);
|
411
452
|
}, [rowSelectionHook]);
|
412
|
-
|
413
453
|
// 获取 table 左下角 checkbox 属性
|
414
454
|
function getCheckAllProps() {
|
415
|
-
var
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
getProps = _ref.getProps;
|
455
|
+
var _rowSelection$onChang = rowSelection.onChange,
|
456
|
+
_onChange = _rowSelection$onChang === void 0 ? function () {} : _rowSelection$onChang,
|
457
|
+
_rowSelection$onSelec = rowSelection.onSelectAll,
|
458
|
+
onSelectAll = _rowSelection$onSelec === void 0 ? function () {} : _rowSelection$onSelec,
|
459
|
+
_rowSelection$selecte2 = rowSelection.selectedRowKeys,
|
460
|
+
selectedRowKeys = _rowSelection$selecte2 === void 0 ? [] : _rowSelection$selecte2,
|
461
|
+
getProps = rowSelection.getProps;
|
423
462
|
var dataSource = data;
|
424
463
|
var allRowKeys = dataSource.filter(function (d, i) {
|
425
464
|
var _getProps;
|
@@ -463,14 +502,12 @@ var ProTable = function ProTable(props) {
|
|
463
502
|
setFilteredColumns(columns);
|
464
503
|
(_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);
|
465
504
|
}, [propsColumns]);
|
466
|
-
|
467
505
|
// dataSource 受控
|
468
506
|
useEffect(function () {
|
469
507
|
if (propsDataSource) {
|
470
|
-
|
508
|
+
_setData(propsDataSource);
|
471
509
|
}
|
472
510
|
}, [propsDataSource]);
|
473
|
-
|
474
511
|
// 初始化 ActionRef。
|
475
512
|
initActionRef(actionRef, {
|
476
513
|
getState: function getState() {
|
@@ -490,20 +527,19 @@ var ProTable = function ProTable(props) {
|
|
490
527
|
actionRefCallback[state][name] = fun;
|
491
528
|
},
|
492
529
|
off: function off(name) {
|
493
|
-
actionRefCallback = Object.fromEntries(Object.entries(actionRefCallback).map(function (
|
494
|
-
var
|
495
|
-
k =
|
496
|
-
v =
|
497
|
-
var filterV = Object.fromEntries(Object.entries(v).filter(function (
|
498
|
-
var
|
499
|
-
k =
|
530
|
+
actionRefCallback = Object.fromEntries(Object.entries(actionRefCallback).map(function (_ref3) {
|
531
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
532
|
+
k = _ref4[0],
|
533
|
+
v = _ref4[1];
|
534
|
+
var filterV = Object.fromEntries(Object.entries(v).filter(function (_ref5) {
|
535
|
+
var _ref6 = _slicedToArray(_ref5, 1),
|
536
|
+
k = _ref6[0];
|
500
537
|
return k !== name;
|
501
538
|
}));
|
502
539
|
return [k, filterV];
|
503
540
|
}));
|
504
541
|
}
|
505
542
|
});
|
506
|
-
|
507
543
|
// 绑定 Actions
|
508
544
|
useActionType(actionRef, {
|
509
545
|
fullScreen: function fullScreen() {
|
@@ -530,7 +566,14 @@ var ProTable = function ProTable(props) {
|
|
530
566
|
_setSize(mode);
|
531
567
|
},
|
532
568
|
refresh: function refresh(params) {
|
533
|
-
|
569
|
+
// card视角的刷新等于重新请求
|
570
|
+
if (switchViewState === 'card' && !propsDataSource) {
|
571
|
+
setCurrentPage(1);
|
572
|
+
_request(_objectSpread(_objectSpread({}, params), {}, _defineProperty({}, targetPageKey, 1)), undefined, undefined, true);
|
573
|
+
setShowSkeleton(true);
|
574
|
+
} else {
|
575
|
+
_request(params);
|
576
|
+
}
|
534
577
|
},
|
535
578
|
request: function request(params) {
|
536
579
|
// 如果请求中还有翻页相关信息,需要自动设置到指定页
|
@@ -549,11 +592,20 @@ var ProTable = function ProTable(props) {
|
|
549
592
|
(_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, {});
|
550
593
|
(_dataFilterFormRef$cu = dataFilterFormRef.current) === null || _dataFilterFormRef$cu === void 0 ? void 0 : _dataFilterFormRef$cu.reset();
|
551
594
|
setCurrentPage(1);
|
552
|
-
_request(_defineProperty({}, targetPageKey, 1));
|
595
|
+
_request(_defineProperty({}, targetPageKey, 1), undefined, undefined, true);
|
553
596
|
},
|
554
597
|
resetPage: function resetPage() {
|
555
598
|
setCurrentPage(1);
|
556
599
|
},
|
600
|
+
nextPage: function nextPage() {
|
601
|
+
var _props$paginationProp, _props$paginationProp2;
|
602
|
+
var newCurrentPage = currentPage + 1;
|
603
|
+
setCurrentPage(newCurrentPage);
|
604
|
+
props === null || props === void 0 ? void 0 : (_props$paginationProp = props.paginationProps) === null || _props$paginationProp === void 0 ? void 0 : (_props$paginationProp2 = _props$paginationProp.onChange) === null || _props$paginationProp2 === void 0 ? void 0 : _props$paginationProp2.call(_props$paginationProp, newCurrentPage, {});
|
605
|
+
if (!propsDataSource) {
|
606
|
+
_request(_defineProperty({}, targetPageKey, newCurrentPage));
|
607
|
+
}
|
608
|
+
},
|
557
609
|
rowSelection: rowSelection,
|
558
610
|
clearRowSelection: function clearRowSelection() {
|
559
611
|
rowSelectionHook.setSelectedRowKeys([]);
|
@@ -573,31 +625,94 @@ var ProTable = function ProTable(props) {
|
|
573
625
|
normalDataFilterForm: normalDataFilterForm,
|
574
626
|
fullscreenDataFilterForm: fullscreenDataFilterForm,
|
575
627
|
filterEnableRef: filterEnableRef,
|
628
|
+
setData: function setData(data) {
|
629
|
+
_setData(data);
|
630
|
+
},
|
576
631
|
resetTableMaxBodyHeight: function resetTableMaxBodyHeight(offset) {
|
577
632
|
getHeaderHeight(fullscreenState, offset);
|
633
|
+
},
|
634
|
+
switchView: function switchView(view) {
|
635
|
+
setSwitchViewState(view);
|
636
|
+
if (!propsDataSource) {
|
637
|
+
setCurrentPage(1);
|
638
|
+
}
|
639
|
+
if (view === 'table') {
|
640
|
+
setPageSize(pageSize !== null && pageSize !== void 0 ? pageSize : 20);
|
641
|
+
if (!propsDataSource) {
|
642
|
+
var _request4;
|
643
|
+
setShowSkeleton(true);
|
644
|
+
_request((_request4 = {}, _defineProperty(_request4, targetPageSizeKey, pageSize !== null && pageSize !== void 0 ? pageSize : 20), _defineProperty(_request4, targetPageKey, 1), _request4));
|
645
|
+
}
|
646
|
+
}
|
647
|
+
if (view === 'card') {
|
648
|
+
var _cardViewProps$pageSi;
|
649
|
+
setPageSize((_cardViewProps$pageSi = cardViewProps === null || cardViewProps === void 0 ? void 0 : cardViewProps.pageSize) !== null && _cardViewProps$pageSi !== void 0 ? _cardViewProps$pageSi : 12);
|
650
|
+
if (!propsDataSource) {
|
651
|
+
var _cardViewProps$pageSi2, _request5;
|
652
|
+
setShowSkeleton(true);
|
653
|
+
_request((_request5 = {}, _defineProperty(_request5, targetPageSizeKey, (_cardViewProps$pageSi2 = cardViewProps === null || cardViewProps === void 0 ? void 0 : cardViewProps.pageSize) !== null && _cardViewProps$pageSi2 !== void 0 ? _cardViewProps$pageSi2 : 12), _defineProperty(_request5, targetPageKey, 1), _request5));
|
654
|
+
}
|
655
|
+
}
|
656
|
+
getHeaderHeight(fullscreenState);
|
657
|
+
},
|
658
|
+
setAutoRefreshTimers: function setAutoRefreshTimers(timers) {
|
659
|
+
clearTimeout(autoRefreshTimerRef.current);
|
660
|
+
autoRefreshTimerRef.current = null;
|
661
|
+
autoRefreshTimerRef.current = setTimeout(function () {
|
662
|
+
var _actionRef$current5, _actionRef$current5$r;
|
663
|
+
(_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : (_actionRef$current5$r = _actionRef$current5.refresh) === null || _actionRef$current5$r === void 0 ? void 0 : _actionRef$current5$r.call(_actionRef$current5);
|
664
|
+
}, timers);
|
665
|
+
emit('PRO_TABLE_REFRESH_TIMER_FLAG', timers);
|
666
|
+
},
|
667
|
+
clearAutoRefreshTimers: function clearAutoRefreshTimers() {
|
668
|
+
clearTimeout(autoRefreshTimerRef.current);
|
669
|
+
autoRefreshTimerRef.current = null;
|
578
670
|
}
|
579
671
|
});
|
580
|
-
|
581
672
|
// 将 Actions 绑定到传入的 propsActionRef 中
|
582
673
|
if (propsActionRef) {
|
583
674
|
propsActionRef.current = actionRef.current;
|
584
675
|
}
|
585
676
|
function onFormatResult(next) {
|
586
|
-
var _next$data;
|
587
677
|
props.onFormatResult && props.onFormatResult(next);
|
588
|
-
|
678
|
+
// 如果开启了 autoRedirect 当当前页数不为1,并且data为空的时候,重定向到第一页
|
679
|
+
if (autoRedirect) {
|
680
|
+
var _next$data;
|
681
|
+
if (!(next === null || next === void 0 ? void 0 : (_next$data = next.data) === null || _next$data === void 0 ? void 0 : _next$data.length) && currentPage > 1) {
|
682
|
+
setCurrentPage(1);
|
683
|
+
setShowLoading(true);
|
684
|
+
setTimeout(function () {
|
685
|
+
_request(_defineProperty({}, targetPageKey, 1));
|
686
|
+
});
|
687
|
+
}
|
688
|
+
}
|
689
|
+
var time = 0;
|
690
|
+
if (autoRefresh) {
|
691
|
+
time = 60 * 1000;
|
692
|
+
}
|
693
|
+
if (autoRefresh && typeof autoRefresh !== 'boolean') {
|
694
|
+
time = autoRefresh ? autoRefresh(next.data) : 0;
|
695
|
+
}
|
589
696
|
if (Number.isInteger(time) && time >= 1000) {
|
590
697
|
autoRefreshTimerRef.current = setTimeout(function () {
|
591
698
|
// 自动刷新不显示 loading
|
592
699
|
_request({}, true);
|
593
700
|
}, Number(time));
|
701
|
+
emit('PRO_TABLE_REFRESH_TIMER_FLAG', Number(time));
|
594
702
|
}
|
595
703
|
// 设置 dataSource、total
|
596
|
-
|
597
|
-
|
704
|
+
if (switchViewState === 'table' || currentPage === 1 || (cardViewProps === null || cardViewProps === void 0 ? void 0 : cardViewProps.useTablePagination)) {
|
705
|
+
var _next$data2;
|
706
|
+
_setData(next.data || []);
|
707
|
+
setTotal(next.total || ((_next$data2 = next.data) === null || _next$data2 === void 0 ? void 0 : _next$data2.length));
|
708
|
+
}
|
709
|
+
if (switchViewState === 'card' && currentPage !== 1 && !(cardViewProps === null || cardViewProps === void 0 ? void 0 : cardViewProps.useTablePagination)) {
|
710
|
+
var _next$data3;
|
711
|
+
_setData([].concat(_toConsumableArray(data), _toConsumableArray(next.data || [])));
|
712
|
+
setTotal(total + (next.total || ((_next$data3 = next.data) === null || _next$data3 === void 0 ? void 0 : _next$data3.length)));
|
713
|
+
}
|
598
714
|
setShowSkeleton(false);
|
599
715
|
}
|
600
|
-
|
601
716
|
// 请求表格数据工具函数
|
602
717
|
var getData = useRequest(function (params) {
|
603
718
|
return _defineProperty({
|
@@ -623,6 +738,10 @@ var ProTable = function ProTable(props) {
|
|
623
738
|
data: getDeepValue(formatResult.data, result) || [],
|
624
739
|
total: isNaN(dataTotal) ? 0 : Number(dataTotal)
|
625
740
|
};
|
741
|
+
} else if (typeof formatResult === 'string') {
|
742
|
+
nextData = getTargetValue(formatResult, {
|
743
|
+
res: result
|
744
|
+
});
|
626
745
|
}
|
627
746
|
}
|
628
747
|
if (nextData instanceof Promise) {
|
@@ -658,10 +777,14 @@ var ProTable = function ProTable(props) {
|
|
658
777
|
}
|
659
778
|
}
|
660
779
|
});
|
661
|
-
|
662
780
|
// 请求函数
|
663
|
-
function _request(params, noLoading, filterParams) {
|
664
|
-
var _dataFilterFormRef$cu2, _actionRef$current$ge, _actionRef$
|
781
|
+
function _request(params, noLoading, filterParams, isReset) {
|
782
|
+
var _dataFilterFormRef$cu2, _actionRef$current$ge, _actionRef$current6, _actionRef$current6$g, _objectSpread3;
|
783
|
+
// 首次渲染表格,获取 urlState 上的 表头 filter 数据
|
784
|
+
if (bindUrl && (bindUrlProps === null || bindUrlProps === void 0 ? void 0 : bindUrlProps.headerFilters) !== false && dataRef.current.flag) {
|
785
|
+
getUrlStateFilter(urlState !== null && urlState !== void 0 ? urlState : {}, actionRef);
|
786
|
+
dataRef.current.flag = false;
|
787
|
+
}
|
665
788
|
// 如果没有传 url 且没有 customRequest,直接返回
|
666
789
|
if (!url && !customRequest) {
|
667
790
|
return;
|
@@ -674,10 +797,17 @@ var ProTable = function ProTable(props) {
|
|
674
797
|
// 筛选区请求参数
|
675
798
|
var dataFilterParams = filterParams !== null && filterParams !== void 0 ? filterParams : (_dataFilterFormRef$cu2 = dataFilterFormRef.current) === null || _dataFilterFormRef$cu2 === void 0 ? void 0 : _dataFilterFormRef$cu2.values;
|
676
799
|
// 列过滤请求参数
|
677
|
-
var columnsFilterParams = (_actionRef$current$ge = (_actionRef$
|
678
|
-
|
800
|
+
var columnsFilterParams = (_actionRef$current$ge = (_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : (_actionRef$current6$g = _actionRef$current6.getFilterRules) === null || _actionRef$current6$g === void 0 ? void 0 : _actionRef$current6$g.call(_actionRef$current6)) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : {};
|
679
801
|
// 格式化后的请求参数
|
680
|
-
var requestData =
|
802
|
+
var requestData = {};
|
803
|
+
var preParams = _objectSpread(_objectSpread({}, !showPagination ? _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams) : _objectSpread(_objectSpread(_objectSpread(_objectSpread((_objectSpread3 = {}, _defineProperty(_objectSpread3, targetPageKey, currentPage), _defineProperty(_objectSpread3, targetPageSizeKey, pageSize), _objectSpread3), dataFilterParams), propsParams), sortParams), columnsFilterParams)), params);
|
804
|
+
if (typeof formatParams === 'string') {
|
805
|
+
requestData = getTargetValue(formatParams, {
|
806
|
+
params: preParams
|
807
|
+
});
|
808
|
+
} else {
|
809
|
+
requestData = formatParams(preParams);
|
810
|
+
}
|
681
811
|
if (requestData) {
|
682
812
|
if (autoRefreshTimerRef.current) {
|
683
813
|
clearTimeout(autoRefreshTimerRef.current);
|
@@ -699,19 +829,38 @@ var ProTable = function ProTable(props) {
|
|
699
829
|
}
|
700
830
|
// 如果使用自定义请求
|
701
831
|
if (customRequest && typeof customRequest === 'function') {
|
702
|
-
|
832
|
+
if (isReset) {
|
833
|
+
setShowSkeleton(true);
|
834
|
+
} else {
|
835
|
+
setCustomTableLoading(true);
|
836
|
+
}
|
703
837
|
customRequest(requestData).then(function (res) {
|
704
|
-
var
|
705
|
-
|
838
|
+
var dataRes = res.data,
|
839
|
+
totalRes = res.total,
|
706
840
|
success = res.success;
|
707
841
|
if (success === true) {
|
842
|
+
// 如果开启了 autoRedirect 当当前页数不为1,并且data为空的时候,重定向到第一页
|
843
|
+
if (autoRedirect) {
|
844
|
+
if (!(dataRes === null || dataRes === void 0 ? void 0 : dataRes.length) && currentPage > 1) {
|
845
|
+
setCurrentPage(1);
|
846
|
+
setShowLoading(true);
|
847
|
+
setTimeout(function () {
|
848
|
+
_request(_defineProperty({}, targetPageKey, 1));
|
849
|
+
});
|
850
|
+
}
|
851
|
+
}
|
708
852
|
// 设置 dataSource、total
|
709
|
-
|
710
|
-
|
853
|
+
if (switchViewState === 'table' || params[targetPageKey] === 1 || isReset || (cardViewProps === null || cardViewProps === void 0 ? void 0 : cardViewProps.useTablePagination)) {
|
854
|
+
_setData(dataRes || []);
|
855
|
+
setTotal(totalRes || (dataRes === null || dataRes === void 0 ? void 0 : dataRes.length));
|
856
|
+
}
|
857
|
+
if (switchViewState === 'card' && params[targetPageKey] !== 1 && !isReset && !(cardViewProps === null || cardViewProps === void 0 ? void 0 : cardViewProps.useTablePagination)) {
|
858
|
+
_setData([].concat(_toConsumableArray(data), _toConsumableArray(dataRes || [])));
|
859
|
+
setTotal(total + (totalRes || (dataRes === null || dataRes === void 0 ? void 0 : dataRes.length)));
|
860
|
+
}
|
711
861
|
setShowSkeleton(false);
|
712
862
|
setCustomTableLoading(false);
|
713
863
|
}
|
714
|
-
|
715
864
|
// 重新计算是否需要吸底
|
716
865
|
if (footerSuction) {
|
717
866
|
getFooterSuctionState();
|
@@ -719,15 +868,23 @@ var ProTable = function ProTable(props) {
|
|
719
868
|
if (fixedTableBody) {
|
720
869
|
getHeaderHeight(fullscreenState);
|
721
870
|
}
|
722
|
-
|
723
871
|
// customRequest 中支持 autoRefresh
|
724
|
-
var time =
|
872
|
+
var time = 0;
|
873
|
+
if (autoRefresh) {
|
874
|
+
time = 60 * 1000;
|
875
|
+
}
|
876
|
+
if (autoRefresh && typeof autoRefresh !== 'boolean') {
|
877
|
+
time = autoRefresh ? autoRefresh(data) : 0;
|
878
|
+
}
|
725
879
|
if (Number.isInteger(time) && time >= 1000) {
|
726
880
|
autoRefreshTimerRef.current = setTimeout(function () {
|
727
881
|
// 自动刷新不显示 loading
|
728
|
-
_request(
|
882
|
+
_request({}, true);
|
729
883
|
}, Number(time));
|
884
|
+
emit('PRO_TABLE_REFRESH_TIMER_FLAG', Number(time));
|
730
885
|
}
|
886
|
+
}).finally(function () {
|
887
|
+
setCustomTableLoading(false);
|
731
888
|
});
|
732
889
|
} else {
|
733
890
|
getData.run(requestData);
|
@@ -739,7 +896,6 @@ var ProTable = function ProTable(props) {
|
|
739
896
|
setSort(nextSort);
|
740
897
|
_request(targetFormatSort(nextSort));
|
741
898
|
}
|
742
|
-
|
743
899
|
// 处理 dataFilter 中的 onFilter、onReset
|
744
900
|
var dataFilter = _objectSpread(_objectSpread({
|
745
901
|
mode: 'inline',
|
@@ -753,7 +909,7 @@ var ProTable = function ProTable(props) {
|
|
753
909
|
return true;
|
754
910
|
} : undefined,
|
755
911
|
onFilter: function onFilter(values) {
|
756
|
-
var _actionRef$
|
912
|
+
var _actionRef$current7, _actionRef$current7$c;
|
757
913
|
// 全屏状态,判断全屏表单onFilter是否禁用
|
758
914
|
if (fullscreenState && !filterEnableRef.current.fullscreen) {
|
759
915
|
filterEnableRef.current.fullscreen = true;
|
@@ -766,9 +922,8 @@ var ProTable = function ProTable(props) {
|
|
766
922
|
}
|
767
923
|
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter(values));
|
768
924
|
// 搜索变化时,暂时先清空选择
|
769
|
-
(_actionRef$
|
925
|
+
(_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);
|
770
926
|
setCurrentPage(1);
|
771
|
-
console.log('currentPageSize1', pageSize);
|
772
927
|
_request(_defineProperty({}, targetPageKey, 1), false, values);
|
773
928
|
},
|
774
929
|
onReset: function onReset(values) {
|
@@ -776,7 +931,6 @@ var ProTable = function ProTable(props) {
|
|
776
931
|
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset());
|
777
932
|
(_dataFilterFormRef$cu3 = dataFilterFormRef.current) === null || _dataFilterFormRef$cu3 === void 0 ? void 0 : _dataFilterFormRef$cu3.reset();
|
778
933
|
setCurrentPage(1);
|
779
|
-
console.log('currentPageSize2', pageSize);
|
780
934
|
_request(_defineProperty({}, targetPageKey, 1), false, values);
|
781
935
|
}
|
782
936
|
});
|
@@ -790,10 +944,8 @@ var ProTable = function ProTable(props) {
|
|
790
944
|
var renderTable = function renderTable(isFullScreen) {
|
791
945
|
if (propsColumns) {
|
792
946
|
return /*#__PURE__*/React.createElement("div", {
|
793
|
-
className: classNames('teamix-pro-table-container', className
|
794
|
-
"data-teamix-
|
795
|
-
"data-teamix-test-params": getTestRequestParams(propsParams),
|
796
|
-
"data-teamix-test-data": getTestRequestData(propsColumns)
|
947
|
+
className: classNames('teamix-pro-table-container', className),
|
948
|
+
"data-teamix-spm": dataTeamixSpm
|
797
949
|
}, /*#__PURE__*/React.createElement(Layout, {
|
798
950
|
header: header,
|
799
951
|
mainAction: mainAction,
|
@@ -806,11 +958,19 @@ var ProTable = function ProTable(props) {
|
|
806
958
|
dataFilterFormRef: isFullScreen ? fullscreenDataFilterFormRef : normalDataFilterFormRef,
|
807
959
|
rowSelection: rowSelection,
|
808
960
|
filterColumnType: filterColumnType,
|
809
|
-
fullScreenState: isFullScreen
|
810
|
-
|
961
|
+
fullScreenState: isFullScreen,
|
962
|
+
toolBarAutoWidth: toolBarAutoWidth,
|
963
|
+
dataTeamixSpm: dataTeamixSpm,
|
964
|
+
switchCardView: switchCardView,
|
965
|
+
defaultView: defaultView,
|
966
|
+
autoRefresh: autoRefresh,
|
967
|
+
autoRefreshProps: autoRefreshProps,
|
968
|
+
bindUrlProps: bindUrlProps,
|
969
|
+
bindUrl: bindUrl
|
970
|
+
}), switchViewState === 'table' && /*#__PURE__*/React.createElement(Table.StickyLock, _objectSpread({
|
811
971
|
hasBorder: false,
|
812
972
|
dataSource: showSkeleton ? skeletonDataSource : data || props.dataSource,
|
813
|
-
columns: genProColumnToColumn(filteredColumns, showSkeleton, actionRef, context),
|
973
|
+
columns: genProColumnToColumn(filteredColumns, showSkeleton, actionRef, context, dataTeamixSpm, bindUrl, bindUrlProps),
|
814
974
|
loading: getTableLoading(),
|
815
975
|
className: classNames('teamix-pro-table', tableClassName, {
|
816
976
|
'with-row-select': rowSelection,
|
@@ -822,22 +982,33 @@ var ProTable = function ProTable(props) {
|
|
822
982
|
sort: sort,
|
823
983
|
primaryKey: primaryKey,
|
824
984
|
rowSelection: rowSelection,
|
825
|
-
emptyContent: /*#__PURE__*/React.createElement(EmptyContent,
|
985
|
+
emptyContent: /*#__PURE__*/React.createElement(EmptyContent, _objectSpread({}, emptyProps)),
|
826
986
|
sortIcons: getTableSortIcons(),
|
827
987
|
fixedHeader: fullscreenState || fixedTableBody,
|
828
988
|
maxBodyHeight: "calc(100vh - ".concat(headerHeight, "px)")
|
829
|
-
|
830
|
-
|
989
|
+
}, pickProps(getTableProps(), otherProps))), switchViewState === 'card' && /*#__PURE__*/React.createElement(CardView, {
|
990
|
+
dataSource: showSkeleton ? skeletonDataSource : data || props.dataSource,
|
991
|
+
showSkeleton: showSkeleton,
|
992
|
+
loading: getTableLoading(),
|
993
|
+
originColumns: propsColumns,
|
994
|
+
cardViewProps: cardViewProps,
|
995
|
+
scrollHeight: fullscreenState || fixedTableBody ? "calc(100vh - ".concat(headerHeight, "px)") : undefined,
|
996
|
+
actionRef: actionRef,
|
997
|
+
context: context,
|
998
|
+
columns: genProColumnToColumn(filteredColumns, showSkeleton, actionRef, context),
|
999
|
+
emptyProps: emptyProps,
|
1000
|
+
emptyContent: otherProps === null || otherProps === void 0 ? void 0 : otherProps.emptyContent
|
1001
|
+
}));
|
831
1002
|
} else {
|
832
1003
|
// 不传 columns 直接返回原始 Table
|
833
|
-
return /*#__PURE__*/React.createElement(Table,
|
1004
|
+
return /*#__PURE__*/React.createElement(Table, _objectSpread({
|
834
1005
|
className: cls()
|
835
1006
|
}, pickProps(getTableProps(), otherProps)));
|
836
1007
|
}
|
837
1008
|
};
|
838
1009
|
var renderFooterAction = function renderFooterAction() {
|
839
|
-
var
|
840
|
-
if (_typeof(footerAction) === 'object' && (footerAction === null || footerAction === void 0 ? void 0 : (
|
1010
|
+
var _footerAction$actions;
|
1011
|
+
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) {
|
841
1012
|
// 默认 context
|
842
1013
|
var defaultContext = {
|
843
1014
|
action: actionRef.current,
|
@@ -854,8 +1025,9 @@ var ProTable = function ProTable(props) {
|
|
854
1025
|
});
|
855
1026
|
return /*#__PURE__*/React.createElement("div", {
|
856
1027
|
className: cls('footer-action')
|
857
|
-
}, /*#__PURE__*/React.createElement(ProActionGroup,
|
858
|
-
context: _objectSpread(_objectSpread({}, defaultContext), targetFooterActions === null || targetFooterActions === void 0 ? void 0 : targetFooterActions.context)
|
1028
|
+
}, /*#__PURE__*/React.createElement(ProActionGroup, _objectSpread(_objectSpread({}, targetFooterActions), {}, {
|
1029
|
+
context: _objectSpread(_objectSpread({}, defaultContext), targetFooterActions === null || targetFooterActions === void 0 ? void 0 : targetFooterActions.context),
|
1030
|
+
"data-teamix-spm": dataTeamixSpm ? "".concat(dataTeamixSpm, "-footerAction") : undefined
|
859
1031
|
})));
|
860
1032
|
} else return footerAction;
|
861
1033
|
};
|
@@ -864,22 +1036,22 @@ var ProTable = function ProTable(props) {
|
|
864
1036
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
865
1037
|
// 翻页默认清空选择
|
866
1038
|
if (!reserveSelectedRecords) {
|
867
|
-
var _actionRef$
|
868
|
-
(_actionRef$
|
1039
|
+
var _actionRef$current8, _actionRef$current8$c;
|
1040
|
+
(_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);
|
869
1041
|
}
|
870
1042
|
setCurrentPage(currentPage);
|
871
1043
|
_request(_objectSpread(_defineProperty({}, targetPageKey, currentPage), params));
|
872
1044
|
}
|
873
1045
|
function onChangePaginationSize(currentPageSize) {
|
874
|
-
var
|
1046
|
+
var _request10;
|
875
1047
|
// 翻页默认清空选择
|
876
1048
|
if (!reserveSelectedRecords) {
|
877
|
-
var _actionRef$
|
878
|
-
(_actionRef$
|
1049
|
+
var _actionRef$current9, _actionRef$current9$c;
|
1050
|
+
(_actionRef$current9 = actionRef.current) === null || _actionRef$current9 === void 0 ? void 0 : (_actionRef$current9$c = _actionRef$current9.clearRowSelection) === null || _actionRef$current9$c === void 0 ? void 0 : _actionRef$current9$c.call(_actionRef$current9);
|
879
1051
|
}
|
880
1052
|
setPageSize(currentPageSize);
|
881
1053
|
setCurrentPage(1);
|
882
|
-
_request((
|
1054
|
+
_request((_request10 = {}, _defineProperty(_request10, targetPageSizeKey, currentPageSize), _defineProperty(_request10, targetPageKey, 1), _request10));
|
883
1055
|
}
|
884
1056
|
function renderRowSelection() {
|
885
1057
|
if (rowSelection) {
|
@@ -890,13 +1062,13 @@ var ProTable = function ProTable(props) {
|
|
890
1062
|
} else {
|
891
1063
|
return /*#__PURE__*/React.createElement("div", {
|
892
1064
|
className: cls('footer-left-wrapper')
|
893
|
-
}, rowSelection.mode !== 'single' && /*#__PURE__*/React.createElement(Checkbox,
|
1065
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, rowSelection.mode !== 'single' && /*#__PURE__*/React.createElement(Checkbox, _objectSpread({
|
894
1066
|
className: cls("footer-checkbox-".concat(size))
|
895
1067
|
}, getCheckAllProps())), footerAction && renderFooterAction(), /*#__PURE__*/React.createElement("span", {
|
896
1068
|
className: cls('selected-msg')
|
897
1069
|
}, getMessage('selected', {
|
898
1070
|
count: selectedCount
|
899
|
-
})));
|
1071
|
+
}))));
|
900
1072
|
}
|
901
1073
|
} else if (footerAction) {
|
902
1074
|
if (showSkeleton) {
|
@@ -910,7 +1082,11 @@ var ProTable = function ProTable(props) {
|
|
910
1082
|
}
|
911
1083
|
}
|
912
1084
|
}
|
913
|
-
if (showPagination) {
|
1085
|
+
if (showPagination && switchViewState === 'table' || (cardViewProps === null || cardViewProps === void 0 ? void 0 : cardViewProps.useTablePagination) && switchViewState === 'card') {
|
1086
|
+
var _props$paginationProp3;
|
1087
|
+
var _ref8 = (_props$paginationProp3 = props === null || props === void 0 ? void 0 : props.paginationProps) !== null && _props$paginationProp3 !== void 0 ? _props$paginationProp3 : {},
|
1088
|
+
onPaginationPropsChange = _ref8.onChange,
|
1089
|
+
othersPaginationProps = _objectWithoutProperties(_ref8, _excluded2);
|
914
1090
|
return /*#__PURE__*/React.createElement("div", {
|
915
1091
|
className: cls('footer', {
|
916
1092
|
'footer-has-rowSelection': rowSelection,
|
@@ -918,21 +1094,16 @@ var ProTable = function ProTable(props) {
|
|
918
1094
|
})
|
919
1095
|
}, renderRowSelection(), /*#__PURE__*/React.createElement("div", {
|
920
1096
|
className: cls('footer-right-wrapper')
|
921
|
-
}, showSkeleton ? /*#__PURE__*/React.createElement(Skeleton.Footer.Pagination, null) : /*#__PURE__*/React.createElement(React.Fragment, null, data.length > 0 && /*#__PURE__*/React.createElement(Pagination,
|
1097
|
+
}, showSkeleton ? /*#__PURE__*/React.createElement(Skeleton.Footer.Pagination, null) : /*#__PURE__*/React.createElement(React.Fragment, null, data.length > 0 && /*#__PURE__*/React.createElement(Pagination, _objectSpread({
|
922
1098
|
className: cls('pagination'),
|
923
|
-
onChange: function onChange(number) {
|
924
|
-
|
1099
|
+
onChange: function onChange(number, e) {
|
1100
|
+
onChangePagination(number);
|
1101
|
+
onPaginationPropsChange === null || onPaginationPropsChange === void 0 ? void 0 : onPaginationPropsChange(number, e);
|
925
1102
|
},
|
926
1103
|
total: total,
|
927
|
-
responsivePaginationType: responsivePaginationType
|
1104
|
+
responsivePaginationType: responsivePaginationType,
|
928
1105
|
// shape="arrow-only"
|
929
1106
|
// pageSizePosition="end"
|
930
|
-
,
|
931
|
-
totalRender: function totalRender(total) {
|
932
|
-
return getMessage('total', {
|
933
|
-
total: new Intl.NumberFormat().format(total)
|
934
|
-
});
|
935
|
-
},
|
936
1107
|
pageSize: pageSize,
|
937
1108
|
current: currentPage,
|
938
1109
|
pageSizeList: pageSizeList,
|
@@ -940,9 +1111,10 @@ var ProTable = function ProTable(props) {
|
|
940
1111
|
type: total / pageSize <= 2 ? 'simple' : 'normal',
|
941
1112
|
onPageSizeChange: function onPageSizeChange(number) {
|
942
1113
|
return onChangePaginationSize(number);
|
943
|
-
}
|
944
|
-
|
945
|
-
|
1114
|
+
},
|
1115
|
+
useMaxData: globalUseMaxData !== null && globalUseMaxData !== void 0 ? globalUseMaxData : useMaxData
|
1116
|
+
}, othersPaginationProps)))));
|
1117
|
+
} else if (!showPagination && (footerAction || rowSelection || useRowSelection)) {
|
946
1118
|
return /*#__PURE__*/React.createElement("div", {
|
947
1119
|
className: cls('footer', {
|
948
1120
|
'footer-has-rowSelection': rowSelection
|
@@ -952,10 +1124,10 @@ var ProTable = function ProTable(props) {
|
|
952
1124
|
}, showSkeleton ? /*#__PURE__*/React.createElement(Skeleton.Footer.Pagination, null) : footer));
|
953
1125
|
}
|
954
1126
|
};
|
955
|
-
|
956
1127
|
// 判断是否需要吸底
|
957
1128
|
var fixFooterState = useMemo(function () {
|
958
1129
|
if (fullscreenState) {
|
1130
|
+
// TODO XXX
|
959
1131
|
return false;
|
960
1132
|
}
|
961
1133
|
if (fixedTableBody || footerSuction) {
|
@@ -972,12 +1144,11 @@ var ProTable = function ProTable(props) {
|
|
972
1144
|
return /*#__PURE__*/React.createElement("div", {
|
973
1145
|
className: cls({
|
974
1146
|
'': true,
|
975
|
-
fullscreen:
|
1147
|
+
fullscreen: isFullScreen
|
976
1148
|
// 'footer-suction': footerSuctionState && footerSuction,
|
977
1149
|
}),
|
978
|
-
|
979
1150
|
ref: tableRef
|
980
1151
|
}, renderTable(isFullScreen), fixFooterState && /*#__PURE__*/React.createElement(ProPageContainer.FixedFooter, null, renderFooter()), !fixFooterState && renderFooter());
|
981
1152
|
});
|
982
1153
|
};
|
983
|
-
export default ProTable;
|
1154
|
+
export default ProComponentAspect(ProTable, 'ProTable');
|