@teamix/pro 1.5.1-aplha.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pro.css +1 -1
- package/dist/pro.js +65730 -78948
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/actions/base.d.ts +24 -0
- 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 +7 -1
- package/es/actions/dialog-form.d.ts +29 -0
- package/es/actions/dialog-form.js +3 -5
- 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 +1 -1
- 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 +111 -0
- package/es/actions/index.js +23 -32
- package/es/actions/index.scss +5 -0
- package/es/actions/link.d.ts +8 -0
- package/es/actions/notice.d.ts +7 -0
- package/es/actions/pop-confirm.d.ts +9 -0
- package/es/actions/request.d.ts +9 -0
- package/es/actions/request.js +2 -2
- package/es/actions/utils.d.ts +1 -0
- package/es/card/card-container.d.ts +18 -0
- package/es/card/card-container.js +9 -9
- package/es/card/divider.d.ts +6 -0
- package/es/card/divider.js +6 -2
- package/es/card/index.d.ts +109 -0
- package/es/card/index.js +8 -14
- package/es/card/index.scss +7 -0
- package/es/card/selectable.d.ts +13 -0
- package/es/card/selectable.js +6 -2
- package/es/card/tab.d.ts +6 -0
- package/es/card/tab.js +6 -2
- package/es/card/utils.d.ts +9 -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 +1 -1
- package/es/form/Components/FormGroup/index.d.ts +13 -0
- package/es/form/Components/FormGroup/index.js +3 -5
- 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 -8
- package/es/form/Components/ProField/index.d.ts +2 -0
- package/es/form/Components/ProField/index.js +6 -2
- package/es/form/Components/ProField/mapDateFormat.d.ts +3 -0
- package/es/form/Components/Text/index.d.ts +7 -0
- package/es/form/Components/Text/index.js +6 -2
- package/es/form/Filter/AdvancedFilter.d.ts +7 -0
- package/es/form/Filter/AdvancedFilter.js +15 -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 +10 -13
- package/es/form/Filter/SimpleFilter.d.ts +7 -0
- package/es/form/Filter/SimpleFilter.js +6 -10
- package/es/form/Filter/index.d.ts +9 -0
- package/es/form/Filter/index.js +10 -7
- package/es/form/Filter/index2.d.ts +13 -0
- package/es/form/Filter/index2.js +17 -21
- package/es/form/Filter/useBindUrl.d.ts +2 -0
- package/es/form/Filter/useSpecialProps.d.ts +6 -0
- 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 +2 -4
- package/es/form/ProForm/useAutoLayout.d.ts +9 -0
- package/es/form/ProForm/useAutoSubmit.d.ts +6 -0
- package/es/form/ProForm/useFieldRequest.d.ts +5 -0
- package/es/form/ProForm/useFormDisplayValues.d.ts +4 -0
- package/es/form/ProForm/useFormDisplayValues.js +1 -1
- package/es/form/ProForm/useInitialRequest.d.ts +6 -0
- package/es/form/SchemaForm/adapterComponent.d.ts +5 -0
- package/es/form/SchemaForm/adapterDecorator.d.ts +6 -0
- package/es/form/SchemaForm/adapterType.d.ts +5 -0
- package/es/form/SchemaForm/index.d.ts +4 -0
- 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/initializeFormButton.d.ts +3 -0
- 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/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/reactions.d.ts +6 -0
- package/es/form/SchemaForm/reactions.js +1 -2
- package/es/form/docs/ActionResponse.d.ts +7 -0
- package/es/form/fieldTypeMap.d.ts +7 -0
- package/es/form/index.d.ts +125 -0
- package/es/form/locales/validate.d.ts +159 -0
- package/es/form/schemaNameMap.d.ts +5 -0
- package/es/form/typing.d.ts +192 -0
- package/es/form/utils.d.ts +55 -0
- package/es/form/utils.js +1 -8
- package/es/form/warning.d.ts +3 -0
- package/es/hooks/index.d.ts +2 -0
- package/es/index-without-icon.d.ts +32 -0
- package/es/index.d.ts +32 -0
- package/es/index.js +1 -1
- package/es/info/components/InfoGroup/index.d.ts +5 -0
- package/es/info/components/InfoGroup/index.js +6 -2
- package/es/info/components/InfoValueItem/index.d.ts +5 -0
- package/es/info/components/InfoValueItem/index.js +21 -23
- package/es/info/components/ProInfoItem/index.d.ts +5 -0
- package/es/info/components/baseInfo/index.d.ts +8 -0
- 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 -5
- package/es/info/index.d.ts +10 -0
- package/es/info/index.js +5 -8
- package/es/info/typing.d.ts +218 -0
- package/es/info/utils/index.d.ts +20 -0
- 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/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/common.d.ts +280 -0
- package/es/nocode/configurators/index.d.ts +15 -0
- package/es/nocode/configurators/map.d.ts +2 -0
- package/es/nocode/index.d.ts +8 -0
- package/es/nocode/index.js +2 -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 +3 -4
- package/es/nocode/pages/playground.d.ts +11 -0
- package/es/nocode/pages/playground.js +7 -3
- package/es/nocode/pages/renderer.d.ts +10 -0
- package/es/nocode/pages/renderer.js +8 -4
- package/es/nocode/playground.d.ts +14 -0
- package/es/nocode/playground.js +6 -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 +7 -12
- package/es/sidebar/components/sidebar-container/index.d.ts +5 -0
- package/es/sidebar/components/sidebar-container/index.js +9 -5
- package/es/sidebar/components/tree/index.d.ts +6 -0
- package/es/sidebar/components/tree/index.js +6 -2
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.d.ts +15 -0
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.js +6 -2
- 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.scss +1 -1
- package/es/sidebar/components/tree-node/index.d.ts +7 -0
- package/es/sidebar/components/tree-node/index.js +18 -21
- package/es/sidebar/index.d.ts +9 -0
- package/es/sidebar/index.js +8 -4
- package/es/sidebar/typing.d.ts +141 -0
- package/es/sidebar/utils/action-ref.d.ts +3 -0
- package/es/sidebar/utils/index.d.ts +361 -0
- package/es/sidebar/utils/index.js +11 -11
- 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 +446 -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 +10 -0
- package/es/table/components/Filter/index.js +21 -14
- package/es/table/components/Layout/index.d.ts +5 -0
- package/es/table/components/Layout/index.js +8 -10
- package/es/table/components/LoadMore/index.d.ts +20 -0
- package/es/table/components/LoadMore/index.js +107 -0
- package/es/table/components/LoadMore/index.scss +19 -0
- package/es/table/components/Pagination/index.d.ts +7 -0
- package/es/table/components/Pagination/index.js +14 -10
- package/es/table/components/QuickAction/index.d.ts +11 -0
- package/es/table/components/QuickAction/index.js +2 -4
- package/es/table/components/ToolBar/CardSwitch.d.ts +8 -0
- package/es/table/components/ToolBar/CardSwitch.js +63 -0
- package/es/table/components/ToolBar/DensityIcon.d.ts +4 -0
- package/es/table/components/ToolBar/DensityIcon.js +3 -2
- package/es/table/components/ToolBar/FilterColumnIcon.d.ts +4 -0
- package/es/table/components/ToolBar/FilterColumnIcon.js +13 -2
- package/es/table/components/ToolBar/FullScreenIcon.d.ts +4 -0
- package/es/table/components/ToolBar/Fullscreen.d.ts +10 -0
- package/es/table/components/ToolBar/Fullscreen.js +15 -2
- package/es/table/components/ToolBar/RefreshIcon.d.ts +4 -0
- package/es/table/components/ToolBar/RefreshIcon.js +1 -2
- package/es/table/components/ToolBar/index.d.ts +5 -0
- package/es/table/components/ToolBar/index.js +69 -34
- package/es/table/components/ToolBar/index.scss +10 -1
- package/es/table/index.d.ts +5 -0
- package/es/table/index.js +150 -59
- package/es/table/typing.d.ts +371 -0
- package/es/table/utils/columnRender.d.ts +13 -0
- package/es/table/utils/columnRender.js +28 -28
- package/es/table/utils/genProColumnToColumn.d.ts +13 -0
- package/es/table/utils/genProColumnToColumn.js +4 -2
- 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 +2 -2
- package/es/table/utils/pureColumnRender.d.ts +9 -0
- package/es/table/utils/pureColumnRender.js +2 -4
- package/es/table/utils/pureGenProColumnToColumn.d.ts +7 -0
- package/es/table/utils/pureGenProColumnToColumn.js +1 -1
- package/es/table/utils/useTableSelection.d.ts +3 -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 +8 -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 +6 -2
- package/es/timeline/index.d.ts +10 -0
- package/es/timeline/index.js +7 -3
- package/es/timeline/typing.d.ts +106 -0
- package/es/utils/index.d.ts +3 -0
- package/es/utils/message.d.ts +3 -0
- package/es/utils/message.js +7 -3
- package/lib/actions/base.d.ts +24 -0
- 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 +7 -1
- package/lib/actions/dialog-form.d.ts +29 -0
- package/lib/actions/dialog-form.js +3 -5
- 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 +1 -1
- 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 +111 -0
- package/lib/actions/index.js +23 -32
- package/lib/actions/index.scss +5 -0
- package/lib/actions/link.d.ts +8 -0
- package/lib/actions/notice.d.ts +7 -0
- package/lib/actions/pop-confirm.d.ts +9 -0
- package/lib/actions/request.d.ts +9 -0
- package/lib/actions/utils.d.ts +1 -0
- package/lib/card/card-container.d.ts +18 -0
- package/lib/card/card-container.js +7 -5
- package/lib/card/divider.d.ts +6 -0
- package/lib/card/divider.js +6 -2
- package/lib/card/index.d.ts +109 -0
- package/lib/card/index.js +7 -14
- package/lib/card/index.scss +7 -0
- package/lib/card/selectable.d.ts +13 -0
- package/lib/card/selectable.js +6 -2
- package/lib/card/tab.d.ts +6 -0
- package/lib/card/tab.js +6 -2
- package/lib/card/utils.d.ts +9 -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 +1 -1
- package/lib/form/Components/FormGroup/index.d.ts +13 -0
- package/lib/form/Components/FormGroup/index.js +3 -5
- 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 -8
- package/lib/form/Components/ProField/index.d.ts +2 -0
- package/lib/form/Components/ProField/index.js +6 -2
- package/lib/form/Components/ProField/mapDateFormat.d.ts +3 -0
- package/lib/form/Components/Text/index.d.ts +7 -0
- package/lib/form/Components/Text/index.js +6 -2
- package/lib/form/Filter/AdvancedFilter.d.ts +7 -0
- package/lib/form/Filter/AdvancedFilter.js +14 -17
- 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 -12
- 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 +9 -6
- package/lib/form/Filter/index2.d.ts +13 -0
- package/lib/form/Filter/index2.js +17 -21
- package/lib/form/Filter/useBindUrl.d.ts +2 -0
- 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 +2 -4
- package/lib/form/ProForm/useAutoLayout.d.ts +9 -0
- package/lib/form/ProForm/useAutoSubmit.d.ts +6 -0
- package/lib/form/ProForm/useFieldRequest.d.ts +5 -0
- package/lib/form/ProForm/useFormDisplayValues.d.ts +4 -0
- package/lib/form/ProForm/useInitialRequest.d.ts +6 -0
- package/lib/form/SchemaForm/adapterComponent.d.ts +5 -0
- package/lib/form/SchemaForm/adapterDecorator.d.ts +6 -0
- package/lib/form/SchemaForm/adapterType.d.ts +5 -0
- package/lib/form/SchemaForm/index.d.ts +4 -0
- 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/initializeFormButton.d.ts +3 -0
- 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/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/docs/ActionResponse.d.ts +7 -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 +192 -0
- package/lib/form/typing.js +5 -1
- package/lib/form/utils.d.ts +55 -0
- package/lib/form/utils.js +0 -7
- package/lib/form/warning.d.ts +3 -0
- package/lib/hooks/index.d.ts +2 -0
- package/lib/index-without-icon.d.ts +32 -0
- package/lib/index.d.ts +32 -0
- package/lib/index.js +1 -1
- package/lib/info/components/InfoGroup/index.d.ts +5 -0
- package/lib/info/components/InfoGroup/index.js +6 -2
- package/lib/info/components/InfoValueItem/index.d.ts +5 -0
- package/lib/info/components/InfoValueItem/index.js +21 -23
- package/lib/info/components/ProInfoItem/index.d.ts +5 -0
- package/lib/info/components/baseInfo/index.d.ts +8 -0
- 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 -5
- package/lib/info/index.d.ts +10 -0
- package/lib/info/index.js +5 -8
- package/lib/info/typing.d.ts +218 -0
- package/lib/info/typing.js +5 -1
- package/lib/info/utils/index.d.ts +20 -0
- 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/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/common.d.ts +280 -0
- package/lib/nocode/configurators/index.d.ts +15 -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 -2
- package/lib/nocode/pages/playground.d.ts +11 -0
- package/lib/nocode/pages/playground.js +7 -3
- package/lib/nocode/pages/renderer.d.ts +10 -0
- package/lib/nocode/pages/renderer.js +8 -4
- package/lib/nocode/playground.d.ts +14 -0
- package/lib/nocode/playground.js +6 -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 +6 -12
- package/lib/sidebar/components/sidebar-container/index.d.ts +5 -0
- package/lib/sidebar/components/sidebar-container/index.js +9 -5
- package/lib/sidebar/components/tree/index.d.ts +6 -0
- package/lib/sidebar/components/tree/index.js +6 -2
- package/lib/sidebar/components/tree-node/components/HoverTooltip/index.d.ts +15 -0
- package/lib/sidebar/components/tree-node/components/HoverTooltip/index.js +6 -2
- 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.scss +1 -1
- package/lib/sidebar/components/tree-node/index.d.ts +7 -0
- package/lib/sidebar/components/tree-node/index.js +18 -21
- package/lib/sidebar/index.d.ts +9 -0
- package/lib/sidebar/index.js +17 -4
- package/lib/sidebar/typing.d.ts +141 -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 +361 -0
- package/lib/sidebar/utils/index.js +11 -11
- 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 +468 -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 +10 -0
- package/lib/table/components/Filter/index.js +21 -14
- package/lib/table/components/Layout/index.d.ts +5 -0
- package/lib/table/components/Layout/index.js +9 -11
- package/lib/table/components/LoadMore/index.d.ts +20 -0
- package/lib/table/components/LoadMore/index.js +128 -0
- package/lib/table/components/LoadMore/index.scss +19 -0
- package/lib/table/components/Pagination/index.d.ts +7 -0
- package/lib/table/components/Pagination/index.js +14 -10
- package/lib/table/components/QuickAction/index.d.ts +11 -0
- package/lib/table/components/QuickAction/index.js +2 -4
- package/lib/table/components/ToolBar/CardSwitch.d.ts +8 -0
- package/lib/table/components/ToolBar/CardSwitch.js +82 -0
- package/lib/table/components/ToolBar/DensityIcon.d.ts +4 -0
- package/lib/table/components/ToolBar/DensityIcon.js +3 -2
- package/lib/table/components/ToolBar/FilterColumnIcon.d.ts +4 -0
- package/lib/table/components/ToolBar/FilterColumnIcon.js +13 -2
- package/lib/table/components/ToolBar/FullScreenIcon.d.ts +4 -0
- package/lib/table/components/ToolBar/Fullscreen.d.ts +10 -0
- package/lib/table/components/ToolBar/Fullscreen.js +15 -2
- package/lib/table/components/ToolBar/RefreshIcon.d.ts +4 -0
- package/lib/table/components/ToolBar/RefreshIcon.js +1 -2
- package/lib/table/components/ToolBar/index.d.ts +5 -0
- package/lib/table/components/ToolBar/index.js +70 -33
- package/lib/table/components/ToolBar/index.scss +10 -1
- package/lib/table/index.d.ts +5 -0
- package/lib/table/index.js +153 -60
- package/lib/table/typing.d.ts +371 -0
- package/lib/table/typing.js +5 -1
- package/lib/table/utils/columnRender.d.ts +13 -0
- package/lib/table/utils/columnRender.js +28 -28
- package/lib/table/utils/genProColumnToColumn.d.ts +13 -0
- package/lib/table/utils/genProColumnToColumn.js +3 -1
- 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/pureColumnRender.d.ts +9 -0
- package/lib/table/utils/pureColumnRender.js +1 -3
- package/lib/table/utils/pureGenProColumnToColumn.d.ts +7 -0
- package/lib/table/utils/useTableSelection.d.ts +3 -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 +8 -4
- package/lib/templates/index.d.ts +3 -0
- package/lib/timeline/ProTimeLineItem/index.d.ts +5 -0
- package/lib/timeline/ProTimeLineItem/index.js +6 -2
- package/lib/timeline/index.d.ts +10 -0
- package/lib/timeline/index.js +7 -3
- package/lib/timeline/typing.d.ts +106 -0
- package/lib/timeline/typing.js +5 -1
- package/lib/utils/index.d.ts +3 -0
- package/lib/utils/message.d.ts +3 -0
- package/lib/utils/message.js +7 -3
- package/package.json +1 -1
@@ -1,3 +1,7 @@
|
|
1
|
+
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; }
|
2
|
+
|
3
|
+
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; }
|
4
|
+
|
1
5
|
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; }
|
2
6
|
|
3
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
@@ -13,7 +17,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
13
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
14
18
|
|
15
19
|
import { usePrefixCls } from '@teamix/utils';
|
16
|
-
import React, { useEffect, useRef } from 'react';
|
20
|
+
import React, { useEffect, useMemo, useRef } from 'react';
|
17
21
|
import { Button, Balloon } from '@alicloudfe/components';
|
18
22
|
import TeamixIcon from '@teamix/icon';
|
19
23
|
import FullScreenIcon from './FullScreenIcon';
|
@@ -23,12 +27,15 @@ import RefreshIcon from './RefreshIcon';
|
|
23
27
|
import { useSize, useSafeState } from '@teamix/hooks';
|
24
28
|
import debounce from 'lodash.debounce';
|
25
29
|
import './index.scss';
|
30
|
+
import CardSwitch from './CardSwitch';
|
31
|
+
import cloneDeep from 'lodash.clonedeep';
|
26
32
|
var cls = usePrefixCls('teamix-pro-table-toolbar');
|
27
33
|
var presetToolBarMap = {
|
28
34
|
refresh: RefreshIcon,
|
29
35
|
density: DensityIcon,
|
30
36
|
filtercolumn: FilterColumnIcon,
|
31
|
-
fullscreen: FullScreenIcon
|
37
|
+
fullscreen: FullScreenIcon,
|
38
|
+
switchcard: CardSwitch
|
32
39
|
};
|
33
40
|
var presetToolBarName = ['refresh', 'density', 'filtercolumn', 'fullscreen'];
|
34
41
|
var presetToolBar = [{
|
@@ -53,7 +60,10 @@ var ToolBar = function ToolBar(props) {
|
|
53
60
|
var _toolBarRef$current, _toolBarRef$current$p, _toolBarRef$current$p2;
|
54
61
|
|
55
62
|
var toolBar = props.toolBar,
|
56
|
-
fullScreenState = props.fullScreenState
|
63
|
+
fullScreenState = props.fullScreenState,
|
64
|
+
switchCardView = props.switchCardView,
|
65
|
+
_props$toolBarAutoWid = props.toolBarAutoWidth,
|
66
|
+
toolBarAutoWidth = _props$toolBarAutoWid === void 0 ? true : _props$toolBarAutoWid;
|
57
67
|
var toolBarRef = useRef(null); // const toolBarSize = useSize(toolBarRef);
|
58
68
|
// 用于获取内容宽度
|
59
69
|
|
@@ -73,44 +83,69 @@ var ToolBar = function ToolBar(props) {
|
|
73
83
|
|
74
84
|
|
75
85
|
useEffect(debounce(function () {
|
76
|
-
|
77
|
-
// layoutInlineSize?.width,
|
78
|
-
// leftWidth,
|
79
|
-
// toolBarContentRef.current?.clientWidth,
|
80
|
-
// );
|
81
|
-
if ((layoutInlineSize === null || layoutInlineSize === void 0 ? void 0 : layoutInlineSize.width) && leftWidth && toolBarContentRef.current) {
|
86
|
+
if ((layoutInlineSize === null || layoutInlineSize === void 0 ? void 0 : layoutInlineSize.width) && leftWidth && toolBarContentRef.current && toolBarAutoWidth) {
|
82
87
|
var _toolBarContentRef$cu;
|
83
88
|
|
84
|
-
var width = layoutInlineSize.width
|
89
|
+
var width = layoutInlineSize.width,
|
90
|
+
height = layoutInlineSize.height;
|
85
91
|
|
86
|
-
if (width - leftWidth <= ((_toolBarContentRef$cu = toolBarContentRef.current) === null || _toolBarContentRef$cu === void 0 ? void 0 : _toolBarContentRef$cu.clientWidth) + 8) {
|
92
|
+
if (width - leftWidth <= ((_toolBarContentRef$cu = toolBarContentRef.current) === null || _toolBarContentRef$cu === void 0 ? void 0 : _toolBarContentRef$cu.clientWidth) + 8 || height > 40) {
|
87
93
|
setFlat(false);
|
88
|
-
} else {
|
94
|
+
} else if (height === 40) {
|
89
95
|
setFlat(true);
|
90
96
|
}
|
91
97
|
}
|
92
|
-
}, 300));
|
93
|
-
|
98
|
+
}, 300)); // 初始态
|
99
|
+
|
100
|
+
useEffect(function () {
|
101
|
+
if (!((layoutInlineSize === null || layoutInlineSize === void 0 ? void 0 : layoutInlineSize.width) && leftWidth)) {
|
102
|
+
setFlat(true);
|
103
|
+
}
|
104
|
+
}, []);
|
105
|
+
var toolBarList = useMemo(function () {
|
106
|
+
var result = toolBar !== false ? cloneDeep(presetToolBar) : [];
|
107
|
+
|
108
|
+
if (switchCardView && !result.find(function (item) {
|
109
|
+
return item.name === 'switchCard';
|
110
|
+
})) {
|
111
|
+
result.push({
|
112
|
+
type: 'preset',
|
113
|
+
name: 'switchCard',
|
114
|
+
component: presetToolBarMap['switchcard']
|
115
|
+
});
|
116
|
+
}
|
117
|
+
|
118
|
+
if (Array.isArray(toolBar)) {
|
119
|
+
result = toolBar.map(function (item, index) {
|
120
|
+
if (typeof item === 'string' && presetToolBarName.includes(item.toLowerCase())) {
|
121
|
+
return {
|
122
|
+
type: 'preset',
|
123
|
+
name: item,
|
124
|
+
component: presetToolBarMap[item.toLowerCase()]
|
125
|
+
};
|
126
|
+
}
|
94
127
|
|
95
|
-
if (Array.isArray(toolBar)) {
|
96
|
-
toolBarList = toolBar.map(function (item, index) {
|
97
|
-
if (typeof item === 'string' && presetToolBarName.includes(item.toLowerCase())) {
|
98
128
|
return {
|
99
|
-
type: '
|
100
|
-
name:
|
101
|
-
component:
|
129
|
+
type: 'custom',
|
130
|
+
name: "custom".concat(index),
|
131
|
+
component: item
|
102
132
|
};
|
103
|
-
}
|
133
|
+
});
|
104
134
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
135
|
+
if (!toolBar.includes('switchCard') && switchCardView && !result.find(function (item) {
|
136
|
+
return item.name === 'switchCard';
|
137
|
+
})) {
|
138
|
+
result.push({
|
139
|
+
type: 'preset',
|
140
|
+
name: 'switchCard',
|
141
|
+
component: presetToolBarMap['switchcard']
|
142
|
+
});
|
143
|
+
}
|
144
|
+
}
|
112
145
|
|
113
|
-
|
146
|
+
return result;
|
147
|
+
}, [toolBar]);
|
148
|
+
var renderFlatShape = useMemo(function () {
|
114
149
|
return /*#__PURE__*/React.createElement("div", {
|
115
150
|
className: cls('content')
|
116
151
|
}, toolBarList.map(function (_ref) {
|
@@ -120,13 +155,13 @@ var ToolBar = function ToolBar(props) {
|
|
120
155
|
return /*#__PURE__*/React.createElement("span", {
|
121
156
|
className: cls('item', _defineProperty({}, name, true)),
|
122
157
|
key: name
|
123
|
-
}, type === 'preset' && /*#__PURE__*/React.createElement(Component, props), type === 'custom' && /*#__PURE__*/React.createElement("div", {
|
158
|
+
}, type === 'preset' && /*#__PURE__*/React.createElement(Component, _objectSpread({}, props)), type === 'custom' && /*#__PURE__*/React.createElement("div", {
|
124
159
|
className: cls({
|
125
160
|
custom: true
|
126
161
|
})
|
127
162
|
}, Component));
|
128
163
|
}));
|
129
|
-
};
|
164
|
+
}, [toolBarList]);
|
130
165
|
|
131
166
|
var renderUnFlatShape = function renderUnFlatShape() {
|
132
167
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Balloon.Tooltip, {
|
@@ -141,7 +176,7 @@ var ToolBar = function ToolBar(props) {
|
|
141
176
|
type: "more-line"
|
142
177
|
})),
|
143
178
|
align: "tr"
|
144
|
-
}, renderFlatShape
|
179
|
+
}, renderFlatShape));
|
145
180
|
};
|
146
181
|
|
147
182
|
return /*#__PURE__*/React.createElement("div", {
|
@@ -149,10 +184,10 @@ var ToolBar = function ToolBar(props) {
|
|
149
184
|
flat: flat
|
150
185
|
}),
|
151
186
|
ref: toolBarRef
|
152
|
-
}, !flat && !fullScreenState ? renderUnFlatShape() : renderFlatShape
|
187
|
+
}, !flat && !fullScreenState ? renderUnFlatShape() : renderFlatShape, /*#__PURE__*/React.createElement("div", {
|
153
188
|
className: cls('shadow'),
|
154
189
|
ref: toolBarContentRef
|
155
|
-
}, renderFlatShape
|
190
|
+
}, renderFlatShape));
|
156
191
|
};
|
157
192
|
|
158
193
|
export default ToolBar;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
.teamix-pro-table-toolbar {
|
2
2
|
width: 100%;
|
3
3
|
text-align: right;
|
4
|
-
margin-bottom: 8px;
|
4
|
+
// margin-bottom: 8px;
|
5
5
|
&-flat {
|
6
6
|
margin-left: 8px;
|
7
7
|
}
|
@@ -149,3 +149,12 @@
|
|
149
149
|
}
|
150
150
|
}
|
151
151
|
}
|
152
|
+
|
153
|
+
// switch card
|
154
|
+
.teamix-pro-table-toolbar-switch-card {
|
155
|
+
margin-left: 8px;
|
156
|
+
label {
|
157
|
+
padding-left: 8px;
|
158
|
+
padding-right: 8px;
|
159
|
+
}
|
160
|
+
}
|
package/es/table/index.js
CHANGED
@@ -1,6 +1,4 @@
|
|
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", "data-teamix-spm"];
|
2
|
-
|
3
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
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", "toolBarAutoWidth", "data-teamix-spm", "switchCardView", "cardViewProps", "defaultView"];
|
4
2
|
|
5
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); }
|
6
4
|
|
@@ -52,6 +50,8 @@ import { ProActionGroup } from '../actions';
|
|
52
50
|
import classNames from 'classnames';
|
53
51
|
import ProPageContainer from '../page-container';
|
54
52
|
import debounce from 'lodash.debounce';
|
53
|
+
import CardView from './components/CardView';
|
54
|
+
import columns from '../../demos/table/columns';
|
55
55
|
export * from './typing';
|
56
56
|
var cls = usePrefixCls('teamix-pro-table');
|
57
57
|
/**
|
@@ -179,7 +179,14 @@ var ProTable = function ProTable(props) {
|
|
179
179
|
_props$fixedTableBody = props.fixedTableBody,
|
180
180
|
fixedTableBody = _props$fixedTableBody === void 0 ? false : _props$fixedTableBody,
|
181
181
|
isTree = props.isTree,
|
182
|
+
_props$toolBarAutoWid = props.toolBarAutoWidth,
|
183
|
+
toolBarAutoWidth = _props$toolBarAutoWid === void 0 ? true : _props$toolBarAutoWid,
|
182
184
|
dataTeamixSpm = props['data-teamix-spm'],
|
185
|
+
_props$switchCardView = props.switchCardView,
|
186
|
+
switchCardView = _props$switchCardView === void 0 ? false : _props$switchCardView,
|
187
|
+
cardViewProps = props.cardViewProps,
|
188
|
+
_props$defaultView = props.defaultView,
|
189
|
+
defaultView = _props$defaultView === void 0 ? 'table' : _props$defaultView,
|
183
190
|
otherProps = _objectWithoutProperties(props, _excluded);
|
184
191
|
|
185
192
|
var targetPageKey = pageKey || globalPageKey;
|
@@ -204,7 +211,7 @@ var ProTable = function ProTable(props) {
|
|
204
211
|
var _useState7 = useState(propsDataSource !== null && propsDataSource !== void 0 ? propsDataSource : []),
|
205
212
|
_useState8 = _slicedToArray(_useState7, 2),
|
206
213
|
data = _useState8[0],
|
207
|
-
|
214
|
+
_setData = _useState8[1];
|
208
215
|
|
209
216
|
var _useState9 = useState(props.sort || {}),
|
210
217
|
_useState10 = _slicedToArray(_useState9, 2),
|
@@ -356,7 +363,11 @@ var ProTable = function ProTable(props) {
|
|
356
363
|
|
357
364
|
var offsetHeaderHeight = headerHeight + tableHeaderHeight + pageHeaderHeight + teamixNavHeight + footerRowSelectionHeight + 16 + (offset !== null && offset !== void 0 ? offset : 0) + 1;
|
358
365
|
|
359
|
-
if (
|
366
|
+
if (switchViewState === 'card') {
|
367
|
+
offsetHeaderHeight = offsetHeaderHeight - tableHeaderHeight - footerRowSelectionHeight;
|
368
|
+
}
|
369
|
+
|
370
|
+
if ((tableBodyDom === null || tableBodyDom === void 0 ? void 0 : tableBodyDom.clientHeight) < (tableBodyDom === null || tableBodyDom === void 0 ? void 0 : tableBodyDom.scrollHeight)) {
|
360
371
|
setFooterSuctionState(true);
|
361
372
|
} else {
|
362
373
|
setFooterSuctionState(false);
|
@@ -391,7 +402,13 @@ var ProTable = function ProTable(props) {
|
|
391
402
|
var _useState27 = useState(false),
|
392
403
|
_useState28 = _slicedToArray(_useState27, 2),
|
393
404
|
fullscreenState = _useState28[0],
|
394
|
-
setFullscreenState = _useState28[1]; //
|
405
|
+
setFullscreenState = _useState28[1]; // 切换视角
|
406
|
+
|
407
|
+
|
408
|
+
var _useState29 = useState(defaultView !== null && defaultView !== void 0 ? defaultView : 'table'),
|
409
|
+
_useState30 = _slicedToArray(_useState29, 2),
|
410
|
+
switchViewState = _useState30[0],
|
411
|
+
setSwitchViewState = _useState30[1]; // 切换全屏搜索开关
|
395
412
|
|
396
413
|
|
397
414
|
var filterEnableRef = useRef({
|
@@ -407,10 +424,10 @@ var ProTable = function ProTable(props) {
|
|
407
424
|
var dataFilterFormRef = !fullscreenState ? normalDataFilterFormRef : fullscreenDataFilterFormRef; // let dataFilterForm = dataFilterFormRef.current;
|
408
425
|
// 整个内容区是否超过一屏。用于表格在非全屏模式下的吸底
|
409
426
|
|
410
|
-
var
|
411
|
-
|
412
|
-
footerSuctionState =
|
413
|
-
setFooterSuctionState =
|
427
|
+
var _useState31 = useState(false),
|
428
|
+
_useState32 = _slicedToArray(_useState31, 2),
|
429
|
+
footerSuctionState = _useState32[0],
|
430
|
+
setFooterSuctionState = _useState32[1]; // TODO 获取内容区是否超出一屏(暂时仅支持全家桶)
|
414
431
|
|
415
432
|
|
416
433
|
var getFooterSuctionState = function getFooterSuctionState() {
|
@@ -475,14 +492,13 @@ var ProTable = function ProTable(props) {
|
|
475
492
|
}, [rowSelectionHook]); // 获取 table 左下角 checkbox 属性
|
476
493
|
|
477
494
|
function getCheckAllProps() {
|
478
|
-
var
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
getProps = _ref.getProps;
|
495
|
+
var _rowSelection$onChang = rowSelection.onChange,
|
496
|
+
_onChange = _rowSelection$onChang === void 0 ? function () {} : _rowSelection$onChang,
|
497
|
+
_rowSelection$onSelec = rowSelection.onSelectAll,
|
498
|
+
onSelectAll = _rowSelection$onSelec === void 0 ? function () {} : _rowSelection$onSelec,
|
499
|
+
_rowSelection$selecte2 = rowSelection.selectedRowKeys,
|
500
|
+
selectedRowKeys = _rowSelection$selecte2 === void 0 ? [] : _rowSelection$selecte2,
|
501
|
+
getProps = rowSelection.getProps;
|
486
502
|
|
487
503
|
var dataSource = data;
|
488
504
|
var allRowKeys = dataSource.filter(function (d, i) {
|
@@ -536,7 +552,7 @@ var ProTable = function ProTable(props) {
|
|
536
552
|
|
537
553
|
useEffect(function () {
|
538
554
|
if (propsDataSource) {
|
539
|
-
|
555
|
+
_setData(propsDataSource);
|
540
556
|
}
|
541
557
|
}, [propsDataSource]); // 初始化 ActionRef。
|
542
558
|
|
@@ -559,14 +575,14 @@ var ProTable = function ProTable(props) {
|
|
559
575
|
actionRefCallback[state][name] = fun;
|
560
576
|
},
|
561
577
|
off: function off(name) {
|
562
|
-
actionRefCallback = Object.fromEntries(Object.entries(actionRefCallback).map(function (
|
563
|
-
var
|
564
|
-
k =
|
565
|
-
v =
|
578
|
+
actionRefCallback = Object.fromEntries(Object.entries(actionRefCallback).map(function (_ref) {
|
579
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
580
|
+
k = _ref2[0],
|
581
|
+
v = _ref2[1];
|
566
582
|
|
567
|
-
var filterV = Object.fromEntries(Object.entries(v).filter(function (
|
568
|
-
var
|
569
|
-
k =
|
583
|
+
var filterV = Object.fromEntries(Object.entries(v).filter(function (_ref3) {
|
584
|
+
var _ref4 = _slicedToArray(_ref3, 1),
|
585
|
+
k = _ref4[0];
|
570
586
|
|
571
587
|
return k !== name;
|
572
588
|
}));
|
@@ -603,7 +619,16 @@ var ProTable = function ProTable(props) {
|
|
603
619
|
_setSize(mode);
|
604
620
|
},
|
605
621
|
refresh: function refresh(params) {
|
606
|
-
|
622
|
+
// card视角的刷新等于重新请求
|
623
|
+
if (switchViewState === 'card') {
|
624
|
+
setCurrentPage(1);
|
625
|
+
|
626
|
+
_request(_objectSpread(_objectSpread({}, params), {}, _defineProperty({}, targetPageKey, 1)));
|
627
|
+
|
628
|
+
setShowSkeleton(true);
|
629
|
+
} else {
|
630
|
+
_request(params);
|
631
|
+
}
|
607
632
|
},
|
608
633
|
request: function request(params) {
|
609
634
|
// 如果请求中还有翻页相关信息,需要自动设置到指定页
|
@@ -631,6 +656,12 @@ var ProTable = function ProTable(props) {
|
|
631
656
|
resetPage: function resetPage() {
|
632
657
|
setCurrentPage(1);
|
633
658
|
},
|
659
|
+
nextPage: function nextPage() {
|
660
|
+
var newCurrentPage = currentPage + 1;
|
661
|
+
setCurrentPage(newCurrentPage);
|
662
|
+
|
663
|
+
_request(_defineProperty({}, targetPageKey, newCurrentPage));
|
664
|
+
},
|
634
665
|
rowSelection: rowSelection,
|
635
666
|
clearRowSelection: function clearRowSelection() {
|
636
667
|
rowSelectionHook.setSelectedRowKeys([]);
|
@@ -650,8 +681,34 @@ var ProTable = function ProTable(props) {
|
|
650
681
|
normalDataFilterForm: normalDataFilterForm,
|
651
682
|
fullscreenDataFilterForm: fullscreenDataFilterForm,
|
652
683
|
filterEnableRef: filterEnableRef,
|
684
|
+
setData: function setData(data) {
|
685
|
+
_setData(data);
|
686
|
+
},
|
653
687
|
resetTableMaxBodyHeight: function resetTableMaxBodyHeight(offset) {
|
654
688
|
getHeaderHeight(fullscreenState, offset);
|
689
|
+
},
|
690
|
+
switchView: function switchView(view) {
|
691
|
+
setSwitchViewState(view);
|
692
|
+
setShowSkeleton(true);
|
693
|
+
setCurrentPage(1);
|
694
|
+
|
695
|
+
if (view === 'table') {
|
696
|
+
var _request4;
|
697
|
+
|
698
|
+
setPageSize(pageSize !== null && pageSize !== void 0 ? pageSize : 20);
|
699
|
+
|
700
|
+
_request((_request4 = {}, _defineProperty(_request4, targetPageSizeKey, pageSize !== null && pageSize !== void 0 ? pageSize : 20), _defineProperty(_request4, targetPageKey, 1), _request4));
|
701
|
+
}
|
702
|
+
|
703
|
+
if (view === 'card') {
|
704
|
+
var _cardViewProps$pageSi, _cardViewProps$pageSi2, _request5;
|
705
|
+
|
706
|
+
setPageSize((_cardViewProps$pageSi = cardViewProps === null || cardViewProps === void 0 ? void 0 : cardViewProps.pageSize) !== null && _cardViewProps$pageSi !== void 0 ? _cardViewProps$pageSi : 12);
|
707
|
+
|
708
|
+
_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));
|
709
|
+
}
|
710
|
+
|
711
|
+
getHeaderHeight(fullscreenState);
|
655
712
|
}
|
656
713
|
}); // 将 Actions 绑定到传入的 propsActionRef 中
|
657
714
|
|
@@ -660,8 +717,6 @@ var ProTable = function ProTable(props) {
|
|
660
717
|
}
|
661
718
|
|
662
719
|
function onFormatResult(next) {
|
663
|
-
var _next$data;
|
664
|
-
|
665
720
|
props.onFormatResult && props.onFormatResult(next);
|
666
721
|
var time = autoRefresh ? autoRefresh(next.data) : false;
|
667
722
|
|
@@ -673,8 +728,22 @@ var ProTable = function ProTable(props) {
|
|
673
728
|
} // 设置 dataSource、total
|
674
729
|
|
675
730
|
|
676
|
-
|
677
|
-
|
731
|
+
if (switchViewState === 'table' || currentPage === 1) {
|
732
|
+
var _next$data;
|
733
|
+
|
734
|
+
_setData(next.data || []);
|
735
|
+
|
736
|
+
setTotal(next.total || ((_next$data = next.data) === null || _next$data === void 0 ? void 0 : _next$data.length));
|
737
|
+
}
|
738
|
+
|
739
|
+
if (switchViewState === 'card' && currentPage !== 1) {
|
740
|
+
var _next$data2;
|
741
|
+
|
742
|
+
_setData([].concat(_toConsumableArray(data), _toConsumableArray(next.data || [])));
|
743
|
+
|
744
|
+
setTotal(total + (next.total || ((_next$data2 = next.data) === null || _next$data2 === void 0 ? void 0 : _next$data2.length)));
|
745
|
+
}
|
746
|
+
|
678
747
|
setShowSkeleton(false);
|
679
748
|
} // 请求表格数据工具函数
|
680
749
|
|
@@ -746,7 +815,7 @@ var ProTable = function ProTable(props) {
|
|
746
815
|
}); // 请求函数
|
747
816
|
|
748
817
|
function _request(params, noLoading, filterParams) {
|
749
|
-
var _dataFilterFormRef$cu2, _actionRef$current$ge, _actionRef$current5, _actionRef$current5$g,
|
818
|
+
var _dataFilterFormRef$cu2, _actionRef$current$ge, _actionRef$current5, _actionRef$current5$g, _objectSpread3;
|
750
819
|
|
751
820
|
// 如果没有传 url 且没有 customRequest,直接返回
|
752
821
|
if (!url && !customRequest) {
|
@@ -763,7 +832,7 @@ var ProTable = function ProTable(props) {
|
|
763
832
|
|
764
833
|
var columnsFilterParams = (_actionRef$current$ge = (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : (_actionRef$current5$g = _actionRef$current5.getFilterRules) === null || _actionRef$current5$g === void 0 ? void 0 : _actionRef$current5$g.call(_actionRef$current5)) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : {}; // 格式化后的请求参数
|
765
834
|
|
766
|
-
var requestData = formatParams(_objectSpread(_objectSpread({}, !showPagination ? _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams) : _objectSpread(_objectSpread(_objectSpread(_objectSpread((
|
835
|
+
var requestData = formatParams(_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));
|
767
836
|
|
768
837
|
if (requestData) {
|
769
838
|
if (autoRefreshTimerRef.current) {
|
@@ -791,14 +860,24 @@ var ProTable = function ProTable(props) {
|
|
791
860
|
if (customRequest && typeof customRequest === 'function') {
|
792
861
|
setCustomTableLoading(true);
|
793
862
|
customRequest(requestData).then(function (res) {
|
794
|
-
var
|
795
|
-
|
863
|
+
var dataRes = res.data,
|
864
|
+
totalRes = res.total,
|
796
865
|
success = res.success;
|
797
866
|
|
798
867
|
if (success === true) {
|
799
868
|
// 设置 dataSource、total
|
800
|
-
|
801
|
-
|
869
|
+
if (switchViewState === 'table' || params['targetPageKey'] === 1) {
|
870
|
+
_setData(dataRes || []);
|
871
|
+
|
872
|
+
setTotal(totalRes || (dataRes === null || dataRes === void 0 ? void 0 : dataRes.length));
|
873
|
+
}
|
874
|
+
|
875
|
+
if (switchViewState === 'card' && params['targetPageKey'] !== 1) {
|
876
|
+
_setData([].concat(_toConsumableArray(data), _toConsumableArray(dataRes || [])));
|
877
|
+
|
878
|
+
setTotal(total + (totalRes || (dataRes === null || dataRes === void 0 ? void 0 : dataRes.length)));
|
879
|
+
}
|
880
|
+
|
802
881
|
setShowSkeleton(false);
|
803
882
|
setCustomTableLoading(false);
|
804
883
|
} // 重新计算是否需要吸底
|
@@ -868,7 +947,6 @@ var ProTable = function ProTable(props) {
|
|
868
947
|
|
869
948
|
(_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : (_actionRef$current6$c = _actionRef$current6.clearRowSelection) === null || _actionRef$current6$c === void 0 ? void 0 : _actionRef$current6$c.call(_actionRef$current6);
|
870
949
|
setCurrentPage(1);
|
871
|
-
console.log('currentPageSize1', pageSize);
|
872
950
|
|
873
951
|
_request(_defineProperty({}, targetPageKey, 1), false, values);
|
874
952
|
},
|
@@ -878,7 +956,6 @@ var ProTable = function ProTable(props) {
|
|
878
956
|
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset());
|
879
957
|
(_dataFilterFormRef$cu3 = dataFilterFormRef.current) === null || _dataFilterFormRef$cu3 === void 0 ? void 0 : _dataFilterFormRef$cu3.reset();
|
880
958
|
setCurrentPage(1);
|
881
|
-
console.log('currentPageSize2', pageSize);
|
882
959
|
|
883
960
|
_request(_defineProperty({}, targetPageKey, 1), false, values);
|
884
961
|
}
|
@@ -913,11 +990,14 @@ var ProTable = function ProTable(props) {
|
|
913
990
|
rowSelection: rowSelection,
|
914
991
|
filterColumnType: filterColumnType,
|
915
992
|
fullScreenState: isFullScreen,
|
916
|
-
|
917
|
-
|
993
|
+
toolBarAutoWidth: toolBarAutoWidth,
|
994
|
+
dataTeamixSpm: dataTeamixSpm,
|
995
|
+
switchCardView: switchCardView,
|
996
|
+
defaultView: defaultView
|
997
|
+
}), switchViewState === 'table' && /*#__PURE__*/React.createElement(Table.StickyLock, _objectSpread({
|
918
998
|
hasBorder: false,
|
919
999
|
dataSource: showSkeleton ? skeletonDataSource : data || props.dataSource,
|
920
|
-
columns: genProColumnToColumn(filteredColumns, showSkeleton, actionRef, context),
|
1000
|
+
columns: genProColumnToColumn(filteredColumns, showSkeleton, actionRef, context, dataTeamixSpm),
|
921
1001
|
loading: getTableLoading(),
|
922
1002
|
className: classNames('teamix-pro-table', tableClassName, {
|
923
1003
|
'with-row-select': rowSelection,
|
@@ -932,21 +1012,30 @@ var ProTable = function ProTable(props) {
|
|
932
1012
|
emptyContent: /*#__PURE__*/React.createElement(EmptyContent, null),
|
933
1013
|
sortIcons: getTableSortIcons(),
|
934
1014
|
fixedHeader: fullscreenState || fixedTableBody,
|
935
|
-
maxBodyHeight: "calc(100vh - ".concat(headerHeight, "px)")
|
936
|
-
|
937
|
-
|
1015
|
+
maxBodyHeight: "calc(100vh - ".concat(headerHeight, "px)")
|
1016
|
+
}, pickProps(getTableProps(), otherProps))), switchViewState === 'card' && /*#__PURE__*/React.createElement(CardView, {
|
1017
|
+
dataSource: showSkeleton ? skeletonDataSource : data || props.dataSource,
|
1018
|
+
showSkeleton: showSkeleton,
|
1019
|
+
loading: getTableLoading(),
|
1020
|
+
originColumns: columns,
|
1021
|
+
cardViewProps: cardViewProps,
|
1022
|
+
scrollHeight: fullscreenState || fixedTableBody ? "calc(100vh - ".concat(headerHeight, "px)") : undefined,
|
1023
|
+
actionRef: actionRef,
|
1024
|
+
context: context,
|
1025
|
+
columns: genProColumnToColumn(filteredColumns, showSkeleton, actionRef, context)
|
1026
|
+
}));
|
938
1027
|
} else {
|
939
1028
|
// 不传 columns 直接返回原始 Table
|
940
|
-
return /*#__PURE__*/React.createElement(Table,
|
1029
|
+
return /*#__PURE__*/React.createElement(Table, _objectSpread({
|
941
1030
|
className: cls()
|
942
1031
|
}, pickProps(getTableProps(), otherProps)));
|
943
1032
|
}
|
944
1033
|
};
|
945
1034
|
|
946
1035
|
var renderFooterAction = function renderFooterAction() {
|
947
|
-
var
|
1036
|
+
var _footerAction$actions;
|
948
1037
|
|
949
|
-
if (_typeof(footerAction) === 'object' && (footerAction === null || footerAction === void 0 ? void 0 : (
|
1038
|
+
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) {
|
950
1039
|
// 默认 context
|
951
1040
|
var defaultContext = {
|
952
1041
|
action: actionRef.current,
|
@@ -965,8 +1054,9 @@ var ProTable = function ProTable(props) {
|
|
965
1054
|
|
966
1055
|
return /*#__PURE__*/React.createElement("div", {
|
967
1056
|
className: cls('footer-action')
|
968
|
-
}, /*#__PURE__*/React.createElement(ProActionGroup,
|
969
|
-
context: _objectSpread(_objectSpread({}, defaultContext), targetFooterActions === null || targetFooterActions === void 0 ? void 0 : targetFooterActions.context)
|
1057
|
+
}, /*#__PURE__*/React.createElement(ProActionGroup, _objectSpread(_objectSpread({}, targetFooterActions), {}, {
|
1058
|
+
context: _objectSpread(_objectSpread({}, defaultContext), targetFooterActions === null || targetFooterActions === void 0 ? void 0 : targetFooterActions.context),
|
1059
|
+
"data-teamix-spm": dataTeamixSpm ? "".concat(dataTeamixSpm, "-footerAction") : undefined
|
970
1060
|
})));
|
971
1061
|
} else return footerAction;
|
972
1062
|
};
|
@@ -988,7 +1078,7 @@ var ProTable = function ProTable(props) {
|
|
988
1078
|
}
|
989
1079
|
|
990
1080
|
function onChangePaginationSize(currentPageSize) {
|
991
|
-
var
|
1081
|
+
var _request8;
|
992
1082
|
|
993
1083
|
// 翻页默认清空选择
|
994
1084
|
if (!reserveSelectedRecords) {
|
@@ -1000,7 +1090,7 @@ var ProTable = function ProTable(props) {
|
|
1000
1090
|
setPageSize(currentPageSize);
|
1001
1091
|
setCurrentPage(1);
|
1002
1092
|
|
1003
|
-
_request((
|
1093
|
+
_request((_request8 = {}, _defineProperty(_request8, targetPageSizeKey, currentPageSize), _defineProperty(_request8, targetPageKey, 1), _request8));
|
1004
1094
|
}
|
1005
1095
|
|
1006
1096
|
function renderRowSelection() {
|
@@ -1012,13 +1102,13 @@ var ProTable = function ProTable(props) {
|
|
1012
1102
|
} else {
|
1013
1103
|
return /*#__PURE__*/React.createElement("div", {
|
1014
1104
|
className: cls('footer-left-wrapper')
|
1015
|
-
}, rowSelection.mode !== 'single' && /*#__PURE__*/React.createElement(Checkbox,
|
1105
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, rowSelection.mode !== 'single' && /*#__PURE__*/React.createElement(Checkbox, _objectSpread({
|
1016
1106
|
className: cls("footer-checkbox-".concat(size))
|
1017
1107
|
}, getCheckAllProps())), footerAction && renderFooterAction(), /*#__PURE__*/React.createElement("span", {
|
1018
1108
|
className: cls('selected-msg')
|
1019
1109
|
}, getMessage('selected', {
|
1020
1110
|
count: selectedCount
|
1021
|
-
})));
|
1111
|
+
}))));
|
1022
1112
|
}
|
1023
1113
|
} else if (footerAction) {
|
1024
1114
|
if (showSkeleton) {
|
@@ -1033,7 +1123,7 @@ var ProTable = function ProTable(props) {
|
|
1033
1123
|
}
|
1034
1124
|
}
|
1035
1125
|
|
1036
|
-
if (showPagination) {
|
1126
|
+
if (showPagination && switchViewState === 'table') {
|
1037
1127
|
return /*#__PURE__*/React.createElement("div", {
|
1038
1128
|
className: cls('footer', {
|
1039
1129
|
'footer-has-rowSelection': rowSelection,
|
@@ -1041,15 +1131,15 @@ var ProTable = function ProTable(props) {
|
|
1041
1131
|
})
|
1042
1132
|
}, renderRowSelection(), /*#__PURE__*/React.createElement("div", {
|
1043
1133
|
className: cls('footer-right-wrapper')
|
1044
|
-
}, showSkeleton ? /*#__PURE__*/React.createElement(Skeleton.Footer.Pagination, null) : /*#__PURE__*/React.createElement(React.Fragment, null, data.length > 0 && /*#__PURE__*/React.createElement(Pagination,
|
1134
|
+
}, showSkeleton ? /*#__PURE__*/React.createElement(Skeleton.Footer.Pagination, null) : /*#__PURE__*/React.createElement(React.Fragment, null, data.length > 0 && /*#__PURE__*/React.createElement(Pagination, _objectSpread({
|
1045
1135
|
className: cls('pagination'),
|
1046
1136
|
onChange: function onChange(number) {
|
1047
1137
|
return onChangePagination(number);
|
1048
1138
|
},
|
1049
1139
|
total: total,
|
1050
|
-
responsivePaginationType: responsivePaginationType
|
1140
|
+
responsivePaginationType: responsivePaginationType,
|
1141
|
+
// shape="arrow-only"
|
1051
1142
|
// pageSizePosition="end"
|
1052
|
-
,
|
1053
1143
|
totalRender: function totalRender(total) {
|
1054
1144
|
return getMessage('total', {
|
1055
1145
|
total: new Intl.NumberFormat().format(total)
|
@@ -1064,7 +1154,7 @@ var ProTable = function ProTable(props) {
|
|
1064
1154
|
return onChangePaginationSize(number);
|
1065
1155
|
}
|
1066
1156
|
}, props.paginationProps)))));
|
1067
|
-
} else if (!showPagination) {
|
1157
|
+
} else if (!showPagination && (footerAction || rowSelection || useRowSelection)) {
|
1068
1158
|
return /*#__PURE__*/React.createElement("div", {
|
1069
1159
|
className: cls('footer', {
|
1070
1160
|
'footer-has-rowSelection': rowSelection
|
@@ -1078,6 +1168,7 @@ var ProTable = function ProTable(props) {
|
|
1078
1168
|
|
1079
1169
|
var fixFooterState = useMemo(function () {
|
1080
1170
|
if (fullscreenState) {
|
1171
|
+
// TODO XXX
|
1081
1172
|
return false;
|
1082
1173
|
}
|
1083
1174
|
|