@teamix/pro 1.6.0-beta.4 → 1.6.0-beta.6
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.all.min.css +1 -0
- package/dist/pro.css +1 -1
- package/dist/pro.js +70007 -54355
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/dist/pro.min.js.LICENSE.txt +9 -0
- 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 +69 -60
- package/es/actions/index.scss +10 -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/FormItem2/animation.scss +72 -0
- package/es/form/Components/FormItem2/grid.scss +173 -0
- package/es/form/Components/FormItem2/index.d.ts +41 -0
- package/es/form/Components/FormItem2/index.js +286 -0
- package/es/form/Components/FormItem2/main.scss +413 -0
- package/es/form/Components/FormItem2/scss/variable.scss +118 -0
- package/es/form/Components/FormItem2/style.d.ts +1 -0
- package/es/form/Components/FormItem2/style.js +1 -0
- 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/LightFilter/index.scss +4 -0
- 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/Components/__builtins__/empty.d.ts +1 -0
- package/es/form/Components/__builtins__/empty.js +51 -0
- package/es/form/Components/__builtins__/hooks/index.d.ts +2 -0
- package/es/form/Components/__builtins__/hooks/index.js +2 -0
- package/es/form/Components/__builtins__/hooks/useClickAway.d.ts +5 -0
- package/es/form/Components/__builtins__/hooks/useClickAway.js +37 -0
- package/es/form/Components/__builtins__/hooks/usePrefixCls.d.ts +3 -0
- package/es/form/Components/__builtins__/hooks/usePrefixCls.js +8 -0
- package/es/form/Components/__builtins__/icons.d.ts +20 -0
- package/es/form/Components/__builtins__/icons.js +153 -0
- package/es/form/Components/__builtins__/index.d.ts +8 -0
- package/es/form/Components/__builtins__/index.js +8 -0
- package/es/form/Components/__builtins__/loading.d.ts +1 -0
- package/es/form/Components/__builtins__/loading.js +41 -0
- package/es/form/Components/__builtins__/mapSize.d.ts +1 -0
- package/es/form/Components/__builtins__/mapSize.js +13 -0
- package/es/form/Components/__builtins__/mapStatus.d.ts +2 -0
- package/es/form/Components/__builtins__/mapStatus.js +20 -0
- package/es/form/Components/__builtins__/moment.d.ts +2 -0
- package/es/form/Components/__builtins__/moment.js +47 -0
- package/es/form/Components/__builtins__/pickDataProps.d.ts +1 -0
- package/es/form/Components/__builtins__/pickDataProps.js +9 -0
- package/es/form/Components/form-layout/index.d.ts +74 -0
- package/es/form/Components/form-layout/index.js +71 -0
- package/es/form/Components/form-layout/main.scss +0 -0
- package/es/form/Components/form-layout/style.d.ts +1 -0
- package/es/form/Components/form-layout/style.js +3 -0
- package/es/form/Components/form-layout/useResponsiveFormLayout.d.ts +18 -0
- package/es/form/Components/form-layout/useResponsiveFormLayout.js +87 -0
- package/es/form/Filter/AdvancedFilter.d.ts +7 -0
- package/es/form/Filter/AdvancedFilter.js +16 -18
- 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 +20 -25
- 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 +21 -17
- 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 +308 -137
- 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 +60 -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 +527 -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 +89 -58
- package/lib/actions/index.scss +10 -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/FormItem2/animation.scss +72 -0
- package/lib/form/Components/FormItem2/grid.scss +173 -0
- package/lib/form/Components/FormItem2/index.d.ts +41 -0
- package/lib/form/Components/FormItem2/index.js +299 -0
- package/lib/form/Components/FormItem2/main.scss +413 -0
- package/lib/form/Components/FormItem2/scss/variable.scss +118 -0
- package/lib/form/Components/FormItem2/style.d.ts +1 -0
- package/lib/form/Components/FormItem2/style.js +3 -0
- 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/LightFilter/index.scss +4 -0
- 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/Components/__builtins__/empty.d.ts +1 -0
- package/lib/form/Components/__builtins__/empty.js +59 -0
- package/lib/form/Components/__builtins__/hooks/index.d.ts +2 -0
- package/lib/form/Components/__builtins__/hooks/index.js +27 -0
- package/lib/form/Components/__builtins__/hooks/useClickAway.d.ts +5 -0
- package/lib/form/Components/__builtins__/hooks/useClickAway.js +44 -0
- package/lib/form/Components/__builtins__/hooks/usePrefixCls.d.ts +3 -0
- package/lib/form/Components/__builtins__/hooks/usePrefixCls.js +15 -0
- package/lib/form/Components/__builtins__/icons.d.ts +20 -0
- package/lib/form/Components/__builtins__/icons.js +174 -0
- package/lib/form/Components/__builtins__/index.d.ts +8 -0
- package/lib/form/Components/__builtins__/index.js +93 -0
- package/lib/form/Components/__builtins__/loading.d.ts +1 -0
- package/lib/form/Components/__builtins__/loading.js +48 -0
- package/lib/form/Components/__builtins__/mapSize.d.ts +1 -0
- package/lib/form/Components/__builtins__/mapSize.js +20 -0
- package/lib/form/Components/__builtins__/mapStatus.d.ts +2 -0
- package/lib/form/Components/__builtins__/mapStatus.js +27 -0
- package/lib/form/Components/__builtins__/moment.d.ts +2 -0
- package/lib/form/Components/__builtins__/moment.js +56 -0
- package/lib/form/Components/__builtins__/pickDataProps.d.ts +1 -0
- package/lib/form/Components/__builtins__/pickDataProps.js +16 -0
- package/lib/form/Components/form-layout/index.d.ts +74 -0
- package/lib/form/Components/form-layout/index.js +88 -0
- package/lib/form/Components/form-layout/main.scss +0 -0
- package/lib/form/Components/form-layout/style.d.ts +1 -0
- package/lib/form/Components/form-layout/style.js +3 -0
- package/lib/form/Components/form-layout/useResponsiveFormLayout.d.ts +18 -0
- package/lib/form/Components/form-layout/useResponsiveFormLayout.js +94 -0
- package/lib/form/Filter/AdvancedFilter.d.ts +7 -0
- package/lib/form/Filter/AdvancedFilter.js +16 -18
- 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 +20 -25
- 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 +20 -16
- 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 +307 -136
- 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 +67 -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 +527 -0
- package/package.json +9 -8
package/lib/table/index.js
CHANGED
|
@@ -5,24 +5,28 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {};
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
8
|
var _components = require("@alicloudfe/components");
|
|
10
|
-
var
|
|
11
|
-
var
|
|
9
|
+
var _hooks = require("@teamix/hooks");
|
|
10
|
+
var _proField = require("@teamix/pro-field");
|
|
12
11
|
var _utils = require("@teamix/utils");
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
var _lodash = _interopRequireDefault(require("lodash.debounce"));
|
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
+
var _actions = require("../actions");
|
|
16
|
+
var _pageContainer = _interopRequireDefault(require("../page-container"));
|
|
13
17
|
var _skeleton = require("../skeleton");
|
|
14
|
-
require("
|
|
18
|
+
var _aspect = require("../utils/aspect");
|
|
19
|
+
var _CardView = _interopRequireDefault(require("./components/CardView"));
|
|
15
20
|
var _Layout = _interopRequireDefault(require("./components/Layout"));
|
|
21
|
+
var _Pagination = _interopRequireDefault(require("./components/Pagination"));
|
|
22
|
+
var _Fullscreen = _interopRequireDefault(require("./components/ToolBar/Fullscreen"));
|
|
23
|
+
require("./index.scss");
|
|
16
24
|
var _utils2 = require("./utils");
|
|
25
|
+
var _genProColumnToColumn = _interopRequireDefault(require("./utils/genProColumnToColumn"));
|
|
17
26
|
var _getTableProps = _interopRequireDefault(require("./utils/getTableProps"));
|
|
18
27
|
var _getTableSortIcons = _interopRequireDefault(require("./utils/getTableSortIcons"));
|
|
19
28
|
var _useTableSelection = _interopRequireDefault(require("./utils/useTableSelection"));
|
|
20
|
-
var
|
|
21
|
-
var _EmptyContent = _interopRequireDefault(require("./components/EmptyContent"));
|
|
22
|
-
var _actions2 = require("../actions");
|
|
23
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
24
|
-
var _pageContainer = _interopRequireDefault(require("../page-container"));
|
|
25
|
-
var _lodash = _interopRequireDefault(require("lodash.debounce"));
|
|
29
|
+
var _util = require("./utils/util");
|
|
26
30
|
var _typing = require("./typing");
|
|
27
31
|
Object.keys(_typing).forEach(function (key) {
|
|
28
32
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -35,19 +39,16 @@ Object.keys(_typing).forEach(function (key) {
|
|
|
35
39
|
}
|
|
36
40
|
});
|
|
37
41
|
});
|
|
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"]
|
|
39
|
-
|
|
42
|
+
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"],
|
|
43
|
+
_excluded2 = ["onChange"];
|
|
40
44
|
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); }
|
|
41
45
|
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; }
|
|
42
|
-
function
|
|
46
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
43
47
|
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); }
|
|
44
48
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
45
49
|
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."); }
|
|
46
50
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
47
51
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
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; }
|
|
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; }
|
|
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; }
|
|
51
52
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
52
53
|
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."); }
|
|
53
54
|
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); }
|
|
@@ -56,8 +57,10 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
56
57
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
57
58
|
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; }
|
|
58
59
|
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; }
|
|
60
|
+
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; }
|
|
61
|
+
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; }
|
|
62
|
+
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; }
|
|
59
63
|
var cls = (0, _utils.usePrefixCls)('teamix-pro-table');
|
|
60
|
-
|
|
61
64
|
/**
|
|
62
65
|
* 处理原生传入的 columns 以便于 选择列 方便处理
|
|
63
66
|
* @param columns 原生传入的 columns
|
|
@@ -67,7 +70,7 @@ var processColumns = function processColumns(columns, initialColumns) {
|
|
|
67
70
|
var _getGlobalConfig;
|
|
68
71
|
var globalFilterColumns = (_getGlobalConfig = (0, _utils.getGlobalConfig)('ProTable')) === null || _getGlobalConfig === void 0 ? void 0 : _getGlobalConfig.filterColumns;
|
|
69
72
|
var filterColumns = columns.filter(function (item) {
|
|
70
|
-
return item.columnFilters !== false && (item === null || item === void 0 ? void 0 : item.hidden) !== true && (!globalFilterColumns || globalFilterColumns(item));
|
|
73
|
+
return item.columnFilters !== false && (item === null || item === void 0 ? void 0 : item.hidden) !== true && (!globalFilterColumns || globalFilterColumns(_objectSpread({}, item)));
|
|
71
74
|
});
|
|
72
75
|
// 处理只剩一列批量选择的情况下宽度错乱问题
|
|
73
76
|
if (filterColumns === null || filterColumns === void 0 ? void 0 : filterColumns.length) {
|
|
@@ -92,7 +95,6 @@ var processColumns = function processColumns(columns, initialColumns) {
|
|
|
92
95
|
}
|
|
93
96
|
return filterColumns;
|
|
94
97
|
};
|
|
95
|
-
|
|
96
98
|
/** 默认请求翻页参数 */
|
|
97
99
|
var globalPageKey = 'currentPage';
|
|
98
100
|
var globalPageSizeKey = 'pageSize';
|
|
@@ -105,7 +107,7 @@ var globalFormatSort = function globalFormatSort(sort) {
|
|
|
105
107
|
return {};
|
|
106
108
|
};
|
|
107
109
|
var ProTable = function ProTable(props) {
|
|
108
|
-
var _rowSelection$selecte;
|
|
110
|
+
var _urlState$currentPage, _rowSelection$selecte;
|
|
109
111
|
var header = props.header,
|
|
110
112
|
className = props.className,
|
|
111
113
|
tableClassName = props.tableClassName,
|
|
@@ -154,9 +156,8 @@ var ProTable = function ProTable(props) {
|
|
|
154
156
|
_props$footerSuction = props.footerSuction,
|
|
155
157
|
footerSuction = _props$footerSuction === void 0 ? false : _props$footerSuction,
|
|
156
158
|
_props$autoRefresh = props.autoRefresh,
|
|
157
|
-
autoRefresh = _props$autoRefresh === void 0 ?
|
|
158
|
-
|
|
159
|
-
} : _props$autoRefresh,
|
|
159
|
+
autoRefresh = _props$autoRefresh === void 0 ? false : _props$autoRefresh,
|
|
160
|
+
autoRefreshProps = props.autoRefreshProps,
|
|
160
161
|
customRequest = props.customRequest,
|
|
161
162
|
_props$filterColumnTy = props.filterColumnType,
|
|
162
163
|
filterColumnType = _props$filterColumnTy === void 0 ? 'auto' : _props$filterColumnTy,
|
|
@@ -170,15 +171,33 @@ var ProTable = function ProTable(props) {
|
|
|
170
171
|
_props$fixedTableBody = props.fixedTableBody,
|
|
171
172
|
fixedTableBody = _props$fixedTableBody === void 0 ? false : _props$fixedTableBody,
|
|
172
173
|
isTree = props.isTree,
|
|
174
|
+
_props$toolBarAutoWid = props.toolBarAutoWidth,
|
|
175
|
+
toolBarAutoWidth = _props$toolBarAutoWid === void 0 ? true : _props$toolBarAutoWid,
|
|
176
|
+
dataTeamixSpm = props['data-teamix-spm'],
|
|
177
|
+
_props$switchCardView = props.switchCardView,
|
|
178
|
+
switchCardView = _props$switchCardView === void 0 ? false : _props$switchCardView,
|
|
179
|
+
cardViewProps = props.cardViewProps,
|
|
180
|
+
_props$defaultView = props.defaultView,
|
|
181
|
+
defaultView = _props$defaultView === void 0 ? 'table' : _props$defaultView,
|
|
182
|
+
emptyProps = props.emptyProps,
|
|
183
|
+
bindUrlProps = props.bindUrlProps,
|
|
184
|
+
bindUrl = props.bindUrl,
|
|
185
|
+
_props$autoRedirect = props.autoRedirect,
|
|
186
|
+
autoRedirect = _props$autoRedirect === void 0 ? true : _props$autoRedirect,
|
|
187
|
+
useMaxData = props.useMaxData,
|
|
173
188
|
otherProps = _objectWithoutProperties(props, _excluded);
|
|
174
189
|
var targetPageKey = pageKey || globalPageKey;
|
|
175
190
|
var targetPageSizeKey = pageSizeKey || globalPageSizeKey;
|
|
176
191
|
var targetFormatSort = formatSort || globalFormatSort;
|
|
177
|
-
var
|
|
192
|
+
var _ref = bindUrl ? (0, _hooks.useUrlState)() : [],
|
|
193
|
+
_ref2 = _slicedToArray(_ref, 2),
|
|
194
|
+
urlState = _ref2[0],
|
|
195
|
+
setUrlState = _ref2[1];
|
|
196
|
+
var _useState = (0, _react.useState)((_urlState$currentPage = urlState === null || urlState === void 0 ? void 0 : urlState.currentPage) !== null && _urlState$currentPage !== void 0 ? _urlState$currentPage : 1),
|
|
178
197
|
_useState2 = _slicedToArray(_useState, 2),
|
|
179
198
|
currentPage = _useState2[0],
|
|
180
199
|
setCurrentPage = _useState2[1];
|
|
181
|
-
var _useState3 = (0, _react.useState)(props.pageSize || 10),
|
|
200
|
+
var _useState3 = (0, _react.useState)((urlState === null || urlState === void 0 ? void 0 : urlState.pageSize) || props.pageSize || 10),
|
|
182
201
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
183
202
|
pageSize = _useState4[0],
|
|
184
203
|
setPageSize = _useState4[1];
|
|
@@ -189,7 +208,7 @@ var ProTable = function ProTable(props) {
|
|
|
189
208
|
var _useState7 = (0, _react.useState)(propsDataSource !== null && propsDataSource !== void 0 ? propsDataSource : []),
|
|
190
209
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
191
210
|
data = _useState8[0],
|
|
192
|
-
|
|
211
|
+
_setData = _useState8[1];
|
|
193
212
|
var _useState9 = (0, _react.useState)(props.sort || {}),
|
|
194
213
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
195
214
|
sort = _useState10[0],
|
|
@@ -220,7 +239,24 @@ var ProTable = function ProTable(props) {
|
|
|
220
239
|
_useState20 = _slicedToArray(_useState19, 2),
|
|
221
240
|
showLoading = _useState20[0],
|
|
222
241
|
setShowLoading = _useState20[1];
|
|
223
|
-
|
|
242
|
+
// 表格内部用作存储的 Ref,标识 Table 组件是否被第一次渲染。用作 useUrlState filter 第一次渲染时使用 state 数据请求
|
|
243
|
+
var dataRef = (0, _react.useRef)({
|
|
244
|
+
flag: true
|
|
245
|
+
});
|
|
246
|
+
(0, _react.useEffect)(function () {
|
|
247
|
+
if (bindUrl && (bindUrlProps === null || bindUrlProps === void 0 ? void 0 : bindUrlProps.pagination) !== false) {
|
|
248
|
+
if ((urlState === null || urlState === void 0 ? void 0 : urlState.currentPage) !== currentPage) {
|
|
249
|
+
setUrlState === null || setUrlState === void 0 ? void 0 : setUrlState({
|
|
250
|
+
currentPage: currentPage
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
if ((urlState === null || urlState === void 0 ? void 0 : urlState.pageSize) !== pageSize) {
|
|
254
|
+
setUrlState === null || setUrlState === void 0 ? void 0 : setUrlState({
|
|
255
|
+
pageSize: pageSize
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}, [currentPage, pageSize, urlState]);
|
|
224
260
|
// 存储能够被 on 监听到的 ProTable 状态
|
|
225
261
|
// 因为只做存储用。不需要更新视图以及需要同步更改。所以不使用 setState 更新
|
|
226
262
|
var _useState21 = (0, _react.useState)({
|
|
@@ -230,17 +266,22 @@ var ProTable = function ProTable(props) {
|
|
|
230
266
|
}),
|
|
231
267
|
_useState22 = _slicedToArray(_useState21, 1),
|
|
232
268
|
actionRefState = _useState22[0];
|
|
233
|
-
|
|
234
269
|
// 存储 on 监听事件
|
|
235
270
|
var _useState23 = (0, _react.useState)({
|
|
236
271
|
fullScreenState: {}
|
|
237
272
|
}),
|
|
238
273
|
_useState24 = _slicedToArray(_useState23, 1),
|
|
239
274
|
actionRefCallback = _useState24[0];
|
|
240
|
-
|
|
241
275
|
// 存储定时器 id
|
|
242
276
|
var autoRefreshTimerRef = (0, _react.useRef)();
|
|
243
277
|
var onResize = null;
|
|
278
|
+
// useEffect(() => {
|
|
279
|
+
// setShowSkeleton(propsShowSkeleton);
|
|
280
|
+
// }, [propsShowSkeleton]);
|
|
281
|
+
// useEffect(() => {
|
|
282
|
+
// console.log('传入的props变化', propsLoading);
|
|
283
|
+
// setShowLoading(propsLoading ?? false);
|
|
284
|
+
// }, [propsLoading]);
|
|
244
285
|
(0, _react.useEffect)(function () {
|
|
245
286
|
var _propsDataFilter$sche, _propsDataFilter$sche2;
|
|
246
287
|
getHeaderHeight(fullscreenState);
|
|
@@ -267,7 +308,6 @@ var ProTable = function ProTable(props) {
|
|
|
267
308
|
}
|
|
268
309
|
}, 500);
|
|
269
310
|
}
|
|
270
|
-
|
|
271
311
|
// 如果不传 dataFilter,则在这里初始化请求
|
|
272
312
|
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;
|
|
273
313
|
if (requestWhenMount && !hasDataFilter) {
|
|
@@ -286,7 +326,6 @@ var ProTable = function ProTable(props) {
|
|
|
286
326
|
actionRef.current = undefined;
|
|
287
327
|
};
|
|
288
328
|
}, []);
|
|
289
|
-
|
|
290
329
|
// 获取header高度,用作全屏吸底吸底高度计算以及固定body高度计算(滚动条在底部)
|
|
291
330
|
var getHeaderHeight = function getHeaderHeight(isFullscreen, offset) {
|
|
292
331
|
var _tableDom$getElements, _tableDom$getElements2, _document$querySelect, _document$querySelect2, _document$querySelect3;
|
|
@@ -317,23 +356,22 @@ var ProTable = function ProTable(props) {
|
|
|
317
356
|
// 16px 为 padding
|
|
318
357
|
var pageHeaderHeight = ((_pageContainerDom$off = pageContainerDom === null || pageContainerDom === void 0 ? void 0 : pageContainerDom.offsetHeight) !== null && _pageContainerDom$off !== void 0 ? _pageContainerDom$off : 0) + 16;
|
|
319
358
|
var teamixNavHeight = (_teamixNavDom$offsetH = teamixNavDom === null || teamixNavDom === void 0 ? void 0 : teamixNavDom.offsetHeight) !== null && _teamixNavDom$offsetH !== void 0 ? _teamixNavDom$offsetH : 0;
|
|
320
|
-
|
|
321
359
|
// 1 为预留值,js无法取出精确高度,会被四舍五入
|
|
322
360
|
var offsetHeaderHeight = headerHeight + tableHeaderHeight + pageHeaderHeight + teamixNavHeight + footerRowSelectionHeight + 16 + (offset !== null && offset !== void 0 ? offset : 0) + 1;
|
|
323
|
-
if (
|
|
361
|
+
if (switchViewState === 'card') {
|
|
362
|
+
offsetHeaderHeight = offsetHeaderHeight - tableHeaderHeight - footerRowSelectionHeight;
|
|
363
|
+
}
|
|
364
|
+
if ((tableBodyDom === null || tableBodyDom === void 0 ? void 0 : tableBodyDom.clientHeight) < (tableBodyDom === null || tableBodyDom === void 0 ? void 0 : tableBodyDom.scrollHeight)) {
|
|
324
365
|
setFooterSuctionState(true);
|
|
325
366
|
} else {
|
|
326
367
|
setFooterSuctionState(false);
|
|
327
368
|
}
|
|
328
|
-
|
|
329
369
|
// 如果有切换区tab,那么重新计算
|
|
330
370
|
if (headerFixedTopSectionDom.clientHeight) {
|
|
331
371
|
var _headerFixedTopSectio;
|
|
332
372
|
var headerFixedTopSectionHeight = (_headerFixedTopSectio = headerFixedTopSectionDom.clientHeight) !== null && _headerFixedTopSectio !== void 0 ? _headerFixedTopSectio : 0;
|
|
333
|
-
|
|
334
373
|
// const clientTableBodyHeight =
|
|
335
374
|
// document.body.clientHeight - offsetHeaderHeight;
|
|
336
|
-
|
|
337
375
|
setHeaderHeight(headerFixedTopSectionHeight + teamixNavHeight + footerRowSelectionHeight + tableHeaderHeight + 1);
|
|
338
376
|
return;
|
|
339
377
|
}
|
|
@@ -344,40 +382,44 @@ var ProTable = function ProTable(props) {
|
|
|
344
382
|
}
|
|
345
383
|
}, 50);
|
|
346
384
|
};
|
|
347
|
-
|
|
348
385
|
// header 区域高度。用作全屏计算吸顶吸底高度。默认不做计算
|
|
349
386
|
var _useState25 = (0, _react.useState)(0),
|
|
350
387
|
_useState26 = _slicedToArray(_useState25, 2),
|
|
351
388
|
headerHeight = _useState26[0],
|
|
352
389
|
setHeaderHeight = _useState26[1];
|
|
353
|
-
|
|
354
390
|
// 全屏显示 className
|
|
355
391
|
var _useState27 = (0, _react.useState)(false),
|
|
356
392
|
_useState28 = _slicedToArray(_useState27, 2),
|
|
357
393
|
fullscreenState = _useState28[0],
|
|
358
394
|
setFullscreenState = _useState28[1];
|
|
395
|
+
// 切换视角
|
|
396
|
+
var _useState29 = (0, _react.useState)(defaultView !== null && defaultView !== void 0 ? defaultView : 'table'),
|
|
397
|
+
_useState30 = _slicedToArray(_useState29, 2),
|
|
398
|
+
switchViewState = _useState30[0],
|
|
399
|
+
setSwitchViewState = _useState30[1];
|
|
359
400
|
// 切换全屏搜索开关
|
|
360
401
|
var filterEnableRef = (0, _react.useRef)({
|
|
361
402
|
fullscreen: false,
|
|
362
403
|
normal: true
|
|
363
404
|
});
|
|
364
|
-
|
|
405
|
+
// 全局状态 : 大数据截断
|
|
406
|
+
var globalUseMaxData = (0, _react.useMemo)(function () {
|
|
407
|
+
var _getGlobalConfig2;
|
|
408
|
+
return (_getGlobalConfig2 = (0, _utils.getGlobalConfig)('ProTable')) === null || _getGlobalConfig2 === void 0 ? void 0 : _getGlobalConfig2.useMaxData;
|
|
409
|
+
}, []);
|
|
365
410
|
// 非全屏状态下的
|
|
366
411
|
var normalDataFilterFormRef = (0, _react.useRef)();
|
|
367
412
|
var fullscreenDataFilterFormRef = (0, _react.useRef)();
|
|
368
413
|
var normalDataFilterForm = normalDataFilterFormRef.current;
|
|
369
414
|
var fullscreenDataFilterForm = fullscreenDataFilterFormRef.current;
|
|
370
|
-
|
|
371
415
|
// 传给 QueryFilter 的 formRef
|
|
372
416
|
var dataFilterFormRef = !fullscreenState ? normalDataFilterFormRef : fullscreenDataFilterFormRef;
|
|
373
417
|
// let dataFilterForm = dataFilterFormRef.current;
|
|
374
|
-
|
|
375
418
|
// 整个内容区是否超过一屏。用于表格在非全屏模式下的吸底
|
|
376
|
-
var
|
|
377
|
-
|
|
378
|
-
footerSuctionState =
|
|
379
|
-
setFooterSuctionState =
|
|
380
|
-
|
|
419
|
+
var _useState31 = (0, _react.useState)(false),
|
|
420
|
+
_useState32 = _slicedToArray(_useState31, 2),
|
|
421
|
+
footerSuctionState = _useState32[0],
|
|
422
|
+
setFooterSuctionState = _useState32[1];
|
|
381
423
|
// TODO 获取内容区是否超出一屏(暂时仅支持全家桶)
|
|
382
424
|
var getFooterSuctionState = function getFooterSuctionState() {
|
|
383
425
|
if (!footerSuction) {
|
|
@@ -399,7 +441,6 @@ var ProTable = function ProTable(props) {
|
|
|
399
441
|
}
|
|
400
442
|
}
|
|
401
443
|
};
|
|
402
|
-
|
|
403
444
|
// rowSelection 相关
|
|
404
445
|
var rowSelectionHook = (0, _useTableSelection.default)(_objectSpread(_objectSpread({}, propsRowSelection), {}, {
|
|
405
446
|
// 当初始出现骨架屏的时候,不可选择
|
|
@@ -430,17 +471,15 @@ var ProTable = function ProTable(props) {
|
|
|
430
471
|
(0, _react.useEffect)(function () {
|
|
431
472
|
getRowSelection && getRowSelection(rowSelectionHook);
|
|
432
473
|
}, [rowSelectionHook]);
|
|
433
|
-
|
|
434
474
|
// 获取 table 左下角 checkbox 属性
|
|
435
475
|
function getCheckAllProps() {
|
|
436
|
-
var
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
getProps = _ref.getProps;
|
|
476
|
+
var _rowSelection$onChang = rowSelection.onChange,
|
|
477
|
+
_onChange = _rowSelection$onChang === void 0 ? function () {} : _rowSelection$onChang,
|
|
478
|
+
_rowSelection$onSelec = rowSelection.onSelectAll,
|
|
479
|
+
onSelectAll = _rowSelection$onSelec === void 0 ? function () {} : _rowSelection$onSelec,
|
|
480
|
+
_rowSelection$selecte2 = rowSelection.selectedRowKeys,
|
|
481
|
+
selectedRowKeys = _rowSelection$selecte2 === void 0 ? [] : _rowSelection$selecte2,
|
|
482
|
+
getProps = rowSelection.getProps;
|
|
444
483
|
var dataSource = data;
|
|
445
484
|
var allRowKeys = dataSource.filter(function (d, i) {
|
|
446
485
|
var _getProps;
|
|
@@ -484,14 +523,12 @@ var ProTable = function ProTable(props) {
|
|
|
484
523
|
setFilteredColumns(columns);
|
|
485
524
|
(_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);
|
|
486
525
|
}, [propsColumns]);
|
|
487
|
-
|
|
488
526
|
// dataSource 受控
|
|
489
527
|
(0, _react.useEffect)(function () {
|
|
490
528
|
if (propsDataSource) {
|
|
491
|
-
|
|
529
|
+
_setData(propsDataSource);
|
|
492
530
|
}
|
|
493
531
|
}, [propsDataSource]);
|
|
494
|
-
|
|
495
532
|
// 初始化 ActionRef。
|
|
496
533
|
(0, _utils2.initActionRef)(actionRef, {
|
|
497
534
|
getState: function getState() {
|
|
@@ -511,20 +548,19 @@ var ProTable = function ProTable(props) {
|
|
|
511
548
|
actionRefCallback[state][name] = fun;
|
|
512
549
|
},
|
|
513
550
|
off: function off(name) {
|
|
514
|
-
actionRefCallback = Object.fromEntries(Object.entries(actionRefCallback).map(function (
|
|
515
|
-
var
|
|
516
|
-
k =
|
|
517
|
-
v =
|
|
518
|
-
var filterV = Object.fromEntries(Object.entries(v).filter(function (
|
|
519
|
-
var
|
|
520
|
-
k =
|
|
551
|
+
actionRefCallback = Object.fromEntries(Object.entries(actionRefCallback).map(function (_ref3) {
|
|
552
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
553
|
+
k = _ref4[0],
|
|
554
|
+
v = _ref4[1];
|
|
555
|
+
var filterV = Object.fromEntries(Object.entries(v).filter(function (_ref5) {
|
|
556
|
+
var _ref6 = _slicedToArray(_ref5, 1),
|
|
557
|
+
k = _ref6[0];
|
|
521
558
|
return k !== name;
|
|
522
559
|
}));
|
|
523
560
|
return [k, filterV];
|
|
524
561
|
}));
|
|
525
562
|
}
|
|
526
563
|
});
|
|
527
|
-
|
|
528
564
|
// 绑定 Actions
|
|
529
565
|
(0, _utils2.useActionType)(actionRef, {
|
|
530
566
|
fullScreen: function fullScreen() {
|
|
@@ -551,7 +587,14 @@ var ProTable = function ProTable(props) {
|
|
|
551
587
|
_setSize(mode);
|
|
552
588
|
},
|
|
553
589
|
refresh: function refresh(params) {
|
|
554
|
-
|
|
590
|
+
// card视角的刷新等于重新请求
|
|
591
|
+
if (switchViewState === 'card' && !propsDataSource) {
|
|
592
|
+
setCurrentPage(1);
|
|
593
|
+
_request(_objectSpread(_objectSpread({}, params), {}, _defineProperty({}, targetPageKey, 1)), undefined, undefined, true);
|
|
594
|
+
setShowSkeleton(true);
|
|
595
|
+
} else {
|
|
596
|
+
_request(params);
|
|
597
|
+
}
|
|
555
598
|
},
|
|
556
599
|
request: function request(params) {
|
|
557
600
|
// 如果请求中还有翻页相关信息,需要自动设置到指定页
|
|
@@ -570,11 +613,20 @@ var ProTable = function ProTable(props) {
|
|
|
570
613
|
(_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, {});
|
|
571
614
|
(_dataFilterFormRef$cu = dataFilterFormRef.current) === null || _dataFilterFormRef$cu === void 0 ? void 0 : _dataFilterFormRef$cu.reset();
|
|
572
615
|
setCurrentPage(1);
|
|
573
|
-
_request(_defineProperty({}, targetPageKey, 1));
|
|
616
|
+
_request(_defineProperty({}, targetPageKey, 1), undefined, undefined, true);
|
|
574
617
|
},
|
|
575
618
|
resetPage: function resetPage() {
|
|
576
619
|
setCurrentPage(1);
|
|
577
620
|
},
|
|
621
|
+
nextPage: function nextPage() {
|
|
622
|
+
var _props$paginationProp, _props$paginationProp2;
|
|
623
|
+
var newCurrentPage = currentPage + 1;
|
|
624
|
+
setCurrentPage(newCurrentPage);
|
|
625
|
+
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, {});
|
|
626
|
+
if (!propsDataSource) {
|
|
627
|
+
_request(_defineProperty({}, targetPageKey, newCurrentPage));
|
|
628
|
+
}
|
|
629
|
+
},
|
|
578
630
|
rowSelection: rowSelection,
|
|
579
631
|
clearRowSelection: function clearRowSelection() {
|
|
580
632
|
rowSelectionHook.setSelectedRowKeys([]);
|
|
@@ -594,31 +646,94 @@ var ProTable = function ProTable(props) {
|
|
|
594
646
|
normalDataFilterForm: normalDataFilterForm,
|
|
595
647
|
fullscreenDataFilterForm: fullscreenDataFilterForm,
|
|
596
648
|
filterEnableRef: filterEnableRef,
|
|
649
|
+
setData: function setData(data) {
|
|
650
|
+
_setData(data);
|
|
651
|
+
},
|
|
597
652
|
resetTableMaxBodyHeight: function resetTableMaxBodyHeight(offset) {
|
|
598
653
|
getHeaderHeight(fullscreenState, offset);
|
|
654
|
+
},
|
|
655
|
+
switchView: function switchView(view) {
|
|
656
|
+
setSwitchViewState(view);
|
|
657
|
+
if (!propsDataSource) {
|
|
658
|
+
setCurrentPage(1);
|
|
659
|
+
}
|
|
660
|
+
if (view === 'table') {
|
|
661
|
+
setPageSize(pageSize !== null && pageSize !== void 0 ? pageSize : 20);
|
|
662
|
+
if (!propsDataSource) {
|
|
663
|
+
var _request4;
|
|
664
|
+
setShowSkeleton(true);
|
|
665
|
+
_request((_request4 = {}, _defineProperty(_request4, targetPageSizeKey, pageSize !== null && pageSize !== void 0 ? pageSize : 20), _defineProperty(_request4, targetPageKey, 1), _request4));
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
if (view === 'card') {
|
|
669
|
+
var _cardViewProps$pageSi;
|
|
670
|
+
setPageSize((_cardViewProps$pageSi = cardViewProps === null || cardViewProps === void 0 ? void 0 : cardViewProps.pageSize) !== null && _cardViewProps$pageSi !== void 0 ? _cardViewProps$pageSi : 12);
|
|
671
|
+
if (!propsDataSource) {
|
|
672
|
+
var _cardViewProps$pageSi2, _request5;
|
|
673
|
+
setShowSkeleton(true);
|
|
674
|
+
_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));
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
getHeaderHeight(fullscreenState);
|
|
678
|
+
},
|
|
679
|
+
setAutoRefreshTimers: function setAutoRefreshTimers(timers) {
|
|
680
|
+
clearTimeout(autoRefreshTimerRef.current);
|
|
681
|
+
autoRefreshTimerRef.current = null;
|
|
682
|
+
autoRefreshTimerRef.current = setTimeout(function () {
|
|
683
|
+
var _actionRef$current5, _actionRef$current5$r;
|
|
684
|
+
(_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);
|
|
685
|
+
}, timers);
|
|
686
|
+
(0, _utils2.emit)('PRO_TABLE_REFRESH_TIMER_FLAG', timers);
|
|
687
|
+
},
|
|
688
|
+
clearAutoRefreshTimers: function clearAutoRefreshTimers() {
|
|
689
|
+
clearTimeout(autoRefreshTimerRef.current);
|
|
690
|
+
autoRefreshTimerRef.current = null;
|
|
599
691
|
}
|
|
600
692
|
});
|
|
601
|
-
|
|
602
693
|
// 将 Actions 绑定到传入的 propsActionRef 中
|
|
603
694
|
if (propsActionRef) {
|
|
604
695
|
propsActionRef.current = actionRef.current;
|
|
605
696
|
}
|
|
606
697
|
function onFormatResult(next) {
|
|
607
|
-
var _next$data;
|
|
608
698
|
props.onFormatResult && props.onFormatResult(next);
|
|
609
|
-
|
|
699
|
+
// 如果开启了 autoRedirect 当当前页数不为1,并且data为空的时候,重定向到第一页
|
|
700
|
+
if (autoRedirect) {
|
|
701
|
+
var _next$data;
|
|
702
|
+
if (!(next === null || next === void 0 ? void 0 : (_next$data = next.data) === null || _next$data === void 0 ? void 0 : _next$data.length) && currentPage > 1) {
|
|
703
|
+
setCurrentPage(1);
|
|
704
|
+
setShowLoading(true);
|
|
705
|
+
setTimeout(function () {
|
|
706
|
+
_request(_defineProperty({}, targetPageKey, 1));
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
var time = 0;
|
|
711
|
+
if (autoRefresh) {
|
|
712
|
+
time = 60 * 1000;
|
|
713
|
+
}
|
|
714
|
+
if (autoRefresh && typeof autoRefresh !== 'boolean') {
|
|
715
|
+
time = autoRefresh ? autoRefresh(next.data) : 0;
|
|
716
|
+
}
|
|
610
717
|
if (Number.isInteger(time) && time >= 1000) {
|
|
611
718
|
autoRefreshTimerRef.current = setTimeout(function () {
|
|
612
719
|
// 自动刷新不显示 loading
|
|
613
720
|
_request({}, true);
|
|
614
721
|
}, Number(time));
|
|
722
|
+
(0, _utils2.emit)('PRO_TABLE_REFRESH_TIMER_FLAG', Number(time));
|
|
615
723
|
}
|
|
616
724
|
// 设置 dataSource、total
|
|
617
|
-
|
|
618
|
-
|
|
725
|
+
if (switchViewState === 'table' || currentPage === 1 || (cardViewProps === null || cardViewProps === void 0 ? void 0 : cardViewProps.useTablePagination)) {
|
|
726
|
+
var _next$data2;
|
|
727
|
+
_setData(next.data || []);
|
|
728
|
+
setTotal(next.total || ((_next$data2 = next.data) === null || _next$data2 === void 0 ? void 0 : _next$data2.length));
|
|
729
|
+
}
|
|
730
|
+
if (switchViewState === 'card' && currentPage !== 1 && !(cardViewProps === null || cardViewProps === void 0 ? void 0 : cardViewProps.useTablePagination)) {
|
|
731
|
+
var _next$data3;
|
|
732
|
+
_setData([].concat(_toConsumableArray(data), _toConsumableArray(next.data || [])));
|
|
733
|
+
setTotal(total + (next.total || ((_next$data3 = next.data) === null || _next$data3 === void 0 ? void 0 : _next$data3.length)));
|
|
734
|
+
}
|
|
619
735
|
setShowSkeleton(false);
|
|
620
736
|
}
|
|
621
|
-
|
|
622
737
|
// 请求表格数据工具函数
|
|
623
738
|
var getData = (0, _utils.useRequest)(function (params) {
|
|
624
739
|
return _defineProperty({
|
|
@@ -644,6 +759,10 @@ var ProTable = function ProTable(props) {
|
|
|
644
759
|
data: (0, _utils.getDeepValue)(formatResult.data, result) || [],
|
|
645
760
|
total: isNaN(dataTotal) ? 0 : Number(dataTotal)
|
|
646
761
|
};
|
|
762
|
+
} else if (typeof formatResult === 'string') {
|
|
763
|
+
nextData = (0, _utils.getTargetValue)(formatResult, {
|
|
764
|
+
res: result
|
|
765
|
+
});
|
|
647
766
|
}
|
|
648
767
|
}
|
|
649
768
|
if (nextData instanceof Promise) {
|
|
@@ -679,10 +798,14 @@ var ProTable = function ProTable(props) {
|
|
|
679
798
|
}
|
|
680
799
|
}
|
|
681
800
|
});
|
|
682
|
-
|
|
683
801
|
// 请求函数
|
|
684
|
-
function _request(params, noLoading, filterParams) {
|
|
685
|
-
var _dataFilterFormRef$cu2, _actionRef$current$ge, _actionRef$
|
|
802
|
+
function _request(params, noLoading, filterParams, isReset) {
|
|
803
|
+
var _dataFilterFormRef$cu2, _actionRef$current$ge, _actionRef$current6, _actionRef$current6$g, _objectSpread3;
|
|
804
|
+
// 首次渲染表格,获取 urlState 上的 表头 filter 数据
|
|
805
|
+
if (bindUrl && (bindUrlProps === null || bindUrlProps === void 0 ? void 0 : bindUrlProps.headerFilters) !== false && dataRef.current.flag) {
|
|
806
|
+
(0, _util.getUrlStateFilter)(urlState !== null && urlState !== void 0 ? urlState : {}, actionRef);
|
|
807
|
+
dataRef.current.flag = false;
|
|
808
|
+
}
|
|
686
809
|
// 如果没有传 url 且没有 customRequest,直接返回
|
|
687
810
|
if (!url && !customRequest) {
|
|
688
811
|
return;
|
|
@@ -695,10 +818,17 @@ var ProTable = function ProTable(props) {
|
|
|
695
818
|
// 筛选区请求参数
|
|
696
819
|
var dataFilterParams = filterParams !== null && filterParams !== void 0 ? filterParams : (_dataFilterFormRef$cu2 = dataFilterFormRef.current) === null || _dataFilterFormRef$cu2 === void 0 ? void 0 : _dataFilterFormRef$cu2.values;
|
|
697
820
|
// 列过滤请求参数
|
|
698
|
-
var columnsFilterParams = (_actionRef$current$ge = (_actionRef$
|
|
699
|
-
|
|
821
|
+
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 : {};
|
|
700
822
|
// 格式化后的请求参数
|
|
701
|
-
var requestData =
|
|
823
|
+
var requestData = {};
|
|
824
|
+
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);
|
|
825
|
+
if (typeof formatParams === 'string') {
|
|
826
|
+
requestData = (0, _utils.getTargetValue)(formatParams, {
|
|
827
|
+
params: preParams
|
|
828
|
+
});
|
|
829
|
+
} else {
|
|
830
|
+
requestData = formatParams(preParams);
|
|
831
|
+
}
|
|
702
832
|
if (requestData) {
|
|
703
833
|
if (autoRefreshTimerRef.current) {
|
|
704
834
|
clearTimeout(autoRefreshTimerRef.current);
|
|
@@ -720,19 +850,38 @@ var ProTable = function ProTable(props) {
|
|
|
720
850
|
}
|
|
721
851
|
// 如果使用自定义请求
|
|
722
852
|
if (customRequest && typeof customRequest === 'function') {
|
|
723
|
-
|
|
853
|
+
if (isReset) {
|
|
854
|
+
setShowSkeleton(true);
|
|
855
|
+
} else {
|
|
856
|
+
setCustomTableLoading(true);
|
|
857
|
+
}
|
|
724
858
|
customRequest(requestData).then(function (res) {
|
|
725
|
-
var
|
|
726
|
-
|
|
859
|
+
var dataRes = res.data,
|
|
860
|
+
totalRes = res.total,
|
|
727
861
|
success = res.success;
|
|
728
862
|
if (success === true) {
|
|
863
|
+
// 如果开启了 autoRedirect 当当前页数不为1,并且data为空的时候,重定向到第一页
|
|
864
|
+
if (autoRedirect) {
|
|
865
|
+
if (!(dataRes === null || dataRes === void 0 ? void 0 : dataRes.length) && currentPage > 1) {
|
|
866
|
+
setCurrentPage(1);
|
|
867
|
+
setShowLoading(true);
|
|
868
|
+
setTimeout(function () {
|
|
869
|
+
_request(_defineProperty({}, targetPageKey, 1));
|
|
870
|
+
});
|
|
871
|
+
}
|
|
872
|
+
}
|
|
729
873
|
// 设置 dataSource、total
|
|
730
|
-
|
|
731
|
-
|
|
874
|
+
if (switchViewState === 'table' || params[targetPageKey] === 1 || isReset || (cardViewProps === null || cardViewProps === void 0 ? void 0 : cardViewProps.useTablePagination)) {
|
|
875
|
+
_setData(dataRes || []);
|
|
876
|
+
setTotal(totalRes || (dataRes === null || dataRes === void 0 ? void 0 : dataRes.length));
|
|
877
|
+
}
|
|
878
|
+
if (switchViewState === 'card' && params[targetPageKey] !== 1 && !isReset && !(cardViewProps === null || cardViewProps === void 0 ? void 0 : cardViewProps.useTablePagination)) {
|
|
879
|
+
_setData([].concat(_toConsumableArray(data), _toConsumableArray(dataRes || [])));
|
|
880
|
+
setTotal(total + (totalRes || (dataRes === null || dataRes === void 0 ? void 0 : dataRes.length)));
|
|
881
|
+
}
|
|
732
882
|
setShowSkeleton(false);
|
|
733
883
|
setCustomTableLoading(false);
|
|
734
884
|
}
|
|
735
|
-
|
|
736
885
|
// 重新计算是否需要吸底
|
|
737
886
|
if (footerSuction) {
|
|
738
887
|
getFooterSuctionState();
|
|
@@ -740,15 +889,23 @@ var ProTable = function ProTable(props) {
|
|
|
740
889
|
if (fixedTableBody) {
|
|
741
890
|
getHeaderHeight(fullscreenState);
|
|
742
891
|
}
|
|
743
|
-
|
|
744
892
|
// customRequest 中支持 autoRefresh
|
|
745
|
-
var time =
|
|
893
|
+
var time = 0;
|
|
894
|
+
if (autoRefresh) {
|
|
895
|
+
time = 60 * 1000;
|
|
896
|
+
}
|
|
897
|
+
if (autoRefresh && typeof autoRefresh !== 'boolean') {
|
|
898
|
+
time = autoRefresh ? autoRefresh(dataRes) : 0;
|
|
899
|
+
}
|
|
746
900
|
if (Number.isInteger(time) && time >= 1000) {
|
|
747
901
|
autoRefreshTimerRef.current = setTimeout(function () {
|
|
748
902
|
// 自动刷新不显示 loading
|
|
749
|
-
_request(
|
|
903
|
+
_request({}, true);
|
|
750
904
|
}, Number(time));
|
|
905
|
+
(0, _utils2.emit)('PRO_TABLE_REFRESH_TIMER_FLAG', Number(time));
|
|
751
906
|
}
|
|
907
|
+
}).finally(function () {
|
|
908
|
+
setCustomTableLoading(false);
|
|
752
909
|
});
|
|
753
910
|
} else {
|
|
754
911
|
getData.run(requestData);
|
|
@@ -760,7 +917,6 @@ var ProTable = function ProTable(props) {
|
|
|
760
917
|
setSort(nextSort);
|
|
761
918
|
_request(targetFormatSort(nextSort));
|
|
762
919
|
}
|
|
763
|
-
|
|
764
920
|
// 处理 dataFilter 中的 onFilter、onReset
|
|
765
921
|
var dataFilter = _objectSpread(_objectSpread({
|
|
766
922
|
mode: 'inline',
|
|
@@ -774,7 +930,7 @@ var ProTable = function ProTable(props) {
|
|
|
774
930
|
return true;
|
|
775
931
|
} : undefined,
|
|
776
932
|
onFilter: function onFilter(values) {
|
|
777
|
-
var _actionRef$
|
|
933
|
+
var _actionRef$current7, _actionRef$current7$c;
|
|
778
934
|
// 全屏状态,判断全屏表单onFilter是否禁用
|
|
779
935
|
if (fullscreenState && !filterEnableRef.current.fullscreen) {
|
|
780
936
|
filterEnableRef.current.fullscreen = true;
|
|
@@ -787,9 +943,8 @@ var ProTable = function ProTable(props) {
|
|
|
787
943
|
}
|
|
788
944
|
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter(values));
|
|
789
945
|
// 搜索变化时,暂时先清空选择
|
|
790
|
-
(_actionRef$
|
|
946
|
+
(_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);
|
|
791
947
|
setCurrentPage(1);
|
|
792
|
-
console.log('currentPageSize1', pageSize);
|
|
793
948
|
_request(_defineProperty({}, targetPageKey, 1), false, values);
|
|
794
949
|
},
|
|
795
950
|
onReset: function onReset(values) {
|
|
@@ -797,7 +952,6 @@ var ProTable = function ProTable(props) {
|
|
|
797
952
|
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset());
|
|
798
953
|
(_dataFilterFormRef$cu3 = dataFilterFormRef.current) === null || _dataFilterFormRef$cu3 === void 0 ? void 0 : _dataFilterFormRef$cu3.reset();
|
|
799
954
|
setCurrentPage(1);
|
|
800
|
-
console.log('currentPageSize2', pageSize);
|
|
801
955
|
_request(_defineProperty({}, targetPageKey, 1), false, values);
|
|
802
956
|
}
|
|
803
957
|
});
|
|
@@ -811,10 +965,8 @@ var ProTable = function ProTable(props) {
|
|
|
811
965
|
var renderTable = function renderTable(isFullScreen) {
|
|
812
966
|
if (propsColumns) {
|
|
813
967
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
814
|
-
className: (0, _classnames.default)('teamix-pro-table-container', className
|
|
815
|
-
"data-teamix-
|
|
816
|
-
"data-teamix-test-params": (0, _utils.getTestRequestParams)(propsParams),
|
|
817
|
-
"data-teamix-test-data": (0, _utils.getTestRequestData)(propsColumns)
|
|
968
|
+
className: (0, _classnames.default)('teamix-pro-table-container', className),
|
|
969
|
+
"data-teamix-spm": dataTeamixSpm
|
|
818
970
|
}, /*#__PURE__*/_react.default.createElement(_Layout.default, {
|
|
819
971
|
header: header,
|
|
820
972
|
mainAction: mainAction,
|
|
@@ -827,11 +979,19 @@ var ProTable = function ProTable(props) {
|
|
|
827
979
|
dataFilterFormRef: isFullScreen ? fullscreenDataFilterFormRef : normalDataFilterFormRef,
|
|
828
980
|
rowSelection: rowSelection,
|
|
829
981
|
filterColumnType: filterColumnType,
|
|
830
|
-
fullScreenState: isFullScreen
|
|
831
|
-
|
|
982
|
+
fullScreenState: isFullScreen,
|
|
983
|
+
toolBarAutoWidth: toolBarAutoWidth,
|
|
984
|
+
dataTeamixSpm: dataTeamixSpm,
|
|
985
|
+
switchCardView: switchCardView,
|
|
986
|
+
defaultView: defaultView,
|
|
987
|
+
autoRefresh: autoRefresh,
|
|
988
|
+
autoRefreshProps: autoRefreshProps,
|
|
989
|
+
bindUrlProps: bindUrlProps,
|
|
990
|
+
bindUrl: bindUrl
|
|
991
|
+
}), switchViewState === 'table' && /*#__PURE__*/_react.default.createElement(_components.Table.StickyLock, _objectSpread({
|
|
832
992
|
hasBorder: false,
|
|
833
993
|
dataSource: showSkeleton ? skeletonDataSource : data || props.dataSource,
|
|
834
|
-
columns: (0, _genProColumnToColumn.default)(filteredColumns, showSkeleton, actionRef, context),
|
|
994
|
+
columns: (0, _genProColumnToColumn.default)(filteredColumns, showSkeleton, actionRef, context, dataTeamixSpm, bindUrl, bindUrlProps),
|
|
835
995
|
loading: getTableLoading(),
|
|
836
996
|
className: (0, _classnames.default)('teamix-pro-table', tableClassName, {
|
|
837
997
|
'with-row-select': rowSelection,
|
|
@@ -843,22 +1003,33 @@ var ProTable = function ProTable(props) {
|
|
|
843
1003
|
sort: sort,
|
|
844
1004
|
primaryKey: primaryKey,
|
|
845
1005
|
rowSelection: rowSelection,
|
|
846
|
-
emptyContent: /*#__PURE__*/_react.default.createElement(
|
|
1006
|
+
emptyContent: /*#__PURE__*/_react.default.createElement(_proField.EmptyContent, _objectSpread({}, emptyProps)),
|
|
847
1007
|
sortIcons: (0, _getTableSortIcons.default)(),
|
|
848
1008
|
fixedHeader: fullscreenState || fixedTableBody,
|
|
849
1009
|
maxBodyHeight: "calc(100vh - ".concat(headerHeight, "px)")
|
|
850
|
-
|
|
851
|
-
|
|
1010
|
+
}, (0, _utils.pickProps)((0, _getTableProps.default)(), otherProps))), switchViewState === 'card' && /*#__PURE__*/_react.default.createElement(_CardView.default, {
|
|
1011
|
+
dataSource: showSkeleton ? skeletonDataSource : data || props.dataSource,
|
|
1012
|
+
showSkeleton: showSkeleton,
|
|
1013
|
+
loading: getTableLoading(),
|
|
1014
|
+
originColumns: propsColumns,
|
|
1015
|
+
cardViewProps: cardViewProps,
|
|
1016
|
+
scrollHeight: fullscreenState || fixedTableBody ? "calc(100vh - ".concat(headerHeight, "px)") : undefined,
|
|
1017
|
+
actionRef: actionRef,
|
|
1018
|
+
context: context,
|
|
1019
|
+
columns: (0, _genProColumnToColumn.default)(filteredColumns, showSkeleton, actionRef, context),
|
|
1020
|
+
emptyProps: emptyProps,
|
|
1021
|
+
emptyContent: otherProps === null || otherProps === void 0 ? void 0 : otherProps.emptyContent
|
|
1022
|
+
}));
|
|
852
1023
|
} else {
|
|
853
1024
|
// 不传 columns 直接返回原始 Table
|
|
854
|
-
return /*#__PURE__*/_react.default.createElement(_components.Table,
|
|
1025
|
+
return /*#__PURE__*/_react.default.createElement(_components.Table, _objectSpread({
|
|
855
1026
|
className: cls()
|
|
856
1027
|
}, (0, _utils.pickProps)((0, _getTableProps.default)(), otherProps)));
|
|
857
1028
|
}
|
|
858
1029
|
};
|
|
859
1030
|
var renderFooterAction = function renderFooterAction() {
|
|
860
|
-
var
|
|
861
|
-
if (_typeof(footerAction) === 'object' && (footerAction === null || footerAction === void 0 ? void 0 : (
|
|
1031
|
+
var _footerAction$actions;
|
|
1032
|
+
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) {
|
|
862
1033
|
// 默认 context
|
|
863
1034
|
var defaultContext = {
|
|
864
1035
|
action: actionRef.current,
|
|
@@ -875,8 +1046,9 @@ var ProTable = function ProTable(props) {
|
|
|
875
1046
|
});
|
|
876
1047
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
877
1048
|
className: cls('footer-action')
|
|
878
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
879
|
-
context: _objectSpread(_objectSpread({}, defaultContext), targetFooterActions === null || targetFooterActions === void 0 ? void 0 : targetFooterActions.context)
|
|
1049
|
+
}, /*#__PURE__*/_react.default.createElement(_actions.ProActionGroup, _objectSpread(_objectSpread({}, targetFooterActions), {}, {
|
|
1050
|
+
context: _objectSpread(_objectSpread({}, defaultContext), targetFooterActions === null || targetFooterActions === void 0 ? void 0 : targetFooterActions.context),
|
|
1051
|
+
"data-teamix-spm": dataTeamixSpm ? "".concat(dataTeamixSpm, "-footerAction") : undefined
|
|
880
1052
|
})));
|
|
881
1053
|
} else return footerAction;
|
|
882
1054
|
};
|
|
@@ -885,22 +1057,22 @@ var ProTable = function ProTable(props) {
|
|
|
885
1057
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
886
1058
|
// 翻页默认清空选择
|
|
887
1059
|
if (!reserveSelectedRecords) {
|
|
888
|
-
var _actionRef$
|
|
889
|
-
(_actionRef$
|
|
1060
|
+
var _actionRef$current8, _actionRef$current8$c;
|
|
1061
|
+
(_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);
|
|
890
1062
|
}
|
|
891
1063
|
setCurrentPage(currentPage);
|
|
892
1064
|
_request(_objectSpread(_defineProperty({}, targetPageKey, currentPage), params));
|
|
893
1065
|
}
|
|
894
1066
|
function onChangePaginationSize(currentPageSize) {
|
|
895
|
-
var
|
|
1067
|
+
var _request10;
|
|
896
1068
|
// 翻页默认清空选择
|
|
897
1069
|
if (!reserveSelectedRecords) {
|
|
898
|
-
var _actionRef$
|
|
899
|
-
(_actionRef$
|
|
1070
|
+
var _actionRef$current9, _actionRef$current9$c;
|
|
1071
|
+
(_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);
|
|
900
1072
|
}
|
|
901
1073
|
setPageSize(currentPageSize);
|
|
902
1074
|
setCurrentPage(1);
|
|
903
|
-
_request((
|
|
1075
|
+
_request((_request10 = {}, _defineProperty(_request10, targetPageSizeKey, currentPageSize), _defineProperty(_request10, targetPageKey, 1), _request10));
|
|
904
1076
|
}
|
|
905
1077
|
function renderRowSelection() {
|
|
906
1078
|
if (rowSelection) {
|
|
@@ -911,13 +1083,13 @@ var ProTable = function ProTable(props) {
|
|
|
911
1083
|
} else {
|
|
912
1084
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
913
1085
|
className: cls('footer-left-wrapper')
|
|
914
|
-
}, rowSelection.mode !== 'single' && /*#__PURE__*/_react.default.createElement(_components.Checkbox,
|
|
1086
|
+
}, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, rowSelection.mode !== 'single' && /*#__PURE__*/_react.default.createElement(_components.Checkbox, _objectSpread({
|
|
915
1087
|
className: cls("footer-checkbox-".concat(size))
|
|
916
1088
|
}, getCheckAllProps())), footerAction && renderFooterAction(), /*#__PURE__*/_react.default.createElement("span", {
|
|
917
1089
|
className: cls('selected-msg')
|
|
918
1090
|
}, (0, _utils.getMessage)('selected', {
|
|
919
1091
|
count: selectedCount
|
|
920
|
-
})));
|
|
1092
|
+
}))));
|
|
921
1093
|
}
|
|
922
1094
|
} else if (footerAction) {
|
|
923
1095
|
if (showSkeleton) {
|
|
@@ -931,7 +1103,11 @@ var ProTable = function ProTable(props) {
|
|
|
931
1103
|
}
|
|
932
1104
|
}
|
|
933
1105
|
}
|
|
934
|
-
if (showPagination) {
|
|
1106
|
+
if (showPagination && switchViewState === 'table' || (cardViewProps === null || cardViewProps === void 0 ? void 0 : cardViewProps.useTablePagination) && switchViewState === 'card') {
|
|
1107
|
+
var _props$paginationProp3;
|
|
1108
|
+
var _ref8 = (_props$paginationProp3 = props === null || props === void 0 ? void 0 : props.paginationProps) !== null && _props$paginationProp3 !== void 0 ? _props$paginationProp3 : {},
|
|
1109
|
+
onPaginationPropsChange = _ref8.onChange,
|
|
1110
|
+
othersPaginationProps = _objectWithoutProperties(_ref8, _excluded2);
|
|
935
1111
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
936
1112
|
className: cls('footer', {
|
|
937
1113
|
'footer-has-rowSelection': rowSelection,
|
|
@@ -939,21 +1115,16 @@ var ProTable = function ProTable(props) {
|
|
|
939
1115
|
})
|
|
940
1116
|
}, renderRowSelection(), /*#__PURE__*/_react.default.createElement("div", {
|
|
941
1117
|
className: cls('footer-right-wrapper')
|
|
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,
|
|
1118
|
+
}, 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, _objectSpread({
|
|
943
1119
|
className: cls('pagination'),
|
|
944
|
-
onChange: function onChange(number) {
|
|
945
|
-
|
|
1120
|
+
onChange: function onChange(number, e) {
|
|
1121
|
+
onChangePagination(number);
|
|
1122
|
+
onPaginationPropsChange === null || onPaginationPropsChange === void 0 ? void 0 : onPaginationPropsChange(number, e);
|
|
946
1123
|
},
|
|
947
1124
|
total: total,
|
|
948
|
-
responsivePaginationType: responsivePaginationType
|
|
1125
|
+
responsivePaginationType: responsivePaginationType,
|
|
949
1126
|
// shape="arrow-only"
|
|
950
1127
|
// pageSizePosition="end"
|
|
951
|
-
,
|
|
952
|
-
totalRender: function totalRender(total) {
|
|
953
|
-
return (0, _utils.getMessage)('total', {
|
|
954
|
-
total: new Intl.NumberFormat().format(total)
|
|
955
|
-
});
|
|
956
|
-
},
|
|
957
1128
|
pageSize: pageSize,
|
|
958
1129
|
current: currentPage,
|
|
959
1130
|
pageSizeList: pageSizeList,
|
|
@@ -961,9 +1132,10 @@ var ProTable = function ProTable(props) {
|
|
|
961
1132
|
type: total / pageSize <= 2 ? 'simple' : 'normal',
|
|
962
1133
|
onPageSizeChange: function onPageSizeChange(number) {
|
|
963
1134
|
return onChangePaginationSize(number);
|
|
964
|
-
}
|
|
965
|
-
|
|
966
|
-
|
|
1135
|
+
},
|
|
1136
|
+
useMaxData: globalUseMaxData !== null && globalUseMaxData !== void 0 ? globalUseMaxData : useMaxData
|
|
1137
|
+
}, othersPaginationProps)))));
|
|
1138
|
+
} else if (!showPagination && (footerAction || rowSelection || useRowSelection)) {
|
|
967
1139
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
968
1140
|
className: cls('footer', {
|
|
969
1141
|
'footer-has-rowSelection': rowSelection
|
|
@@ -973,10 +1145,10 @@ var ProTable = function ProTable(props) {
|
|
|
973
1145
|
}, showSkeleton ? /*#__PURE__*/_react.default.createElement(_skeleton.ProSkeletonRaw.Footer.Pagination, null) : footer));
|
|
974
1146
|
}
|
|
975
1147
|
};
|
|
976
|
-
|
|
977
1148
|
// 判断是否需要吸底
|
|
978
1149
|
var fixFooterState = (0, _react.useMemo)(function () {
|
|
979
1150
|
if (fullscreenState) {
|
|
1151
|
+
// TODO XXX
|
|
980
1152
|
return false;
|
|
981
1153
|
}
|
|
982
1154
|
if (fixedTableBody || footerSuction) {
|
|
@@ -993,13 +1165,12 @@ var ProTable = function ProTable(props) {
|
|
|
993
1165
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
994
1166
|
className: cls({
|
|
995
1167
|
'': true,
|
|
996
|
-
fullscreen:
|
|
1168
|
+
fullscreen: isFullScreen
|
|
997
1169
|
// 'footer-suction': footerSuctionState && footerSuction,
|
|
998
1170
|
}),
|
|
999
|
-
|
|
1000
1171
|
ref: tableRef
|
|
1001
1172
|
}, renderTable(isFullScreen), fixFooterState && /*#__PURE__*/_react.default.createElement(_pageContainer.default.FixedFooter, null, renderFooter()), !fixFooterState && renderFooter());
|
|
1002
1173
|
});
|
|
1003
1174
|
};
|
|
1004
|
-
var _default = ProTable;
|
|
1175
|
+
var _default = (0, _aspect.ProComponentAspect)(ProTable, 'ProTable');
|
|
1005
1176
|
exports.default = _default;
|