@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
@@ -0,0 +1,468 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
9
|
+
|
10
|
+
var _components = require("@alicloudfe/components");
|
11
|
+
|
12
|
+
var _ = require("../../../");
|
13
|
+
|
14
|
+
var _skeleton = require("../../../skeleton");
|
15
|
+
|
16
|
+
var _utils = require("@teamix/utils");
|
17
|
+
|
18
|
+
require("./index.scss");
|
19
|
+
|
20
|
+
var _columnRender = require("../../utils/columnRender");
|
21
|
+
|
22
|
+
var _LoadMore = _interopRequireDefault(require("../LoadMore"));
|
23
|
+
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
25
|
+
|
26
|
+
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); }
|
27
|
+
|
28
|
+
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; }
|
29
|
+
|
30
|
+
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); }
|
31
|
+
|
32
|
+
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; }
|
33
|
+
|
34
|
+
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; }
|
35
|
+
|
36
|
+
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; }
|
37
|
+
|
38
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
39
|
+
|
40
|
+
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."); }
|
41
|
+
|
42
|
+
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); }
|
43
|
+
|
44
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
45
|
+
|
46
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
47
|
+
|
48
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
49
|
+
|
50
|
+
var Row = _components.Grid.Row,
|
51
|
+
Col = _components.Grid.Col;
|
52
|
+
var cls = (0, _utils.usePrefixCls)('teamix-pro-table-card-view');
|
53
|
+
|
54
|
+
var CardView = function CardView(props) {
|
55
|
+
var _cardViewProps$scroll;
|
56
|
+
|
57
|
+
var dataSource = props.dataSource,
|
58
|
+
_props$columns = props.columns,
|
59
|
+
columns = _props$columns === void 0 ? [] : _props$columns,
|
60
|
+
_props$loading = props.loading,
|
61
|
+
loading = _props$loading === void 0 ? false : _props$loading,
|
62
|
+
originColumns = props.originColumns,
|
63
|
+
_props$cardViewProps = props.cardViewProps,
|
64
|
+
cardViewProps = _props$cardViewProps === void 0 ? {} : _props$cardViewProps,
|
65
|
+
actionRef = props.actionRef,
|
66
|
+
context = props.context,
|
67
|
+
scrollHeight = props.scrollHeight,
|
68
|
+
_props$showSkeleton = props.showSkeleton,
|
69
|
+
showSkeleton = _props$showSkeleton === void 0 ? false : _props$showSkeleton; // 加载状态
|
70
|
+
|
71
|
+
var _useState = (0, _react.useState)('none'),
|
72
|
+
_useState2 = _slicedToArray(_useState, 2),
|
73
|
+
loadState = _useState2[0],
|
74
|
+
setLoadState = _useState2[1]; // 骨架屏状态
|
75
|
+
|
76
|
+
|
77
|
+
var _useState3 = (0, _react.useState)(true),
|
78
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
79
|
+
skeletonVisible = _useState4[0],
|
80
|
+
setSkeletonVisible = _useState4[1]; // 加载状态变化回调
|
81
|
+
|
82
|
+
|
83
|
+
(0, _react.useEffect)(function () {
|
84
|
+
setLoadState(loading ? 'loading' : 'loadMore');
|
85
|
+
setSkeletonVisible(showSkeleton);
|
86
|
+
|
87
|
+
if (showSkeleton) {
|
88
|
+
setLoadState('none');
|
89
|
+
}
|
90
|
+
}, [loading, skeletonVisible, showSkeleton]);
|
91
|
+
|
92
|
+
var getDataIndexValue = function getDataIndexValue(dataIndex, dataSource) {
|
93
|
+
if (Array.isArray(dataIndex)) {
|
94
|
+
return dataIndex.map(function (item) {
|
95
|
+
return (0, _.getDeepValue)(item !== null && item !== void 0 ? item : '', dataSource);
|
96
|
+
});
|
97
|
+
}
|
98
|
+
|
99
|
+
return (0, _.getDeepValue)(dataIndex !== null && dataIndex !== void 0 ? dataIndex : '', dataSource);
|
100
|
+
}; // 获取卡片 columns
|
101
|
+
|
102
|
+
|
103
|
+
var cardColumns = (0, _react.useMemo)(function () {
|
104
|
+
return columns.map(function (column) {
|
105
|
+
var _originColumn$title;
|
106
|
+
|
107
|
+
var originColumn = originColumns === null || originColumns === void 0 ? void 0 : originColumns.find(function (item) {
|
108
|
+
return item.dataIndex === column.dataIndex;
|
109
|
+
});
|
110
|
+
var render = column === null || column === void 0 ? void 0 : column.render;
|
111
|
+
|
112
|
+
if (typeof (column === null || column === void 0 ? void 0 : column.render) === 'function') {
|
113
|
+
render = function render(value, record) {
|
114
|
+
var _column$render;
|
115
|
+
|
116
|
+
return column === null || column === void 0 ? void 0 : (_column$render = column.render) === null || _column$render === void 0 ? void 0 : _column$render.call(column, value, undefined, record);
|
117
|
+
};
|
118
|
+
} else {
|
119
|
+
var _Object$entries$map, _Object$entries, _Object$entries$map2, _column$render2;
|
120
|
+
|
121
|
+
render = Object.fromEntries((_Object$entries$map = (_Object$entries = Object.entries((_column$render2 = column === null || column === void 0 ? void 0 : column.render) !== null && _column$render2 !== void 0 ? _column$render2 : {})) === null || _Object$entries === void 0 ? void 0 : (_Object$entries$map2 = _Object$entries.map) === null || _Object$entries$map2 === void 0 ? void 0 : _Object$entries$map2.call(_Object$entries, function (_ref) {
|
122
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
123
|
+
k = _ref2[0],
|
124
|
+
v = _ref2[1];
|
125
|
+
|
126
|
+
if (typeof v === 'function') {
|
127
|
+
return [k, function (value, record) {
|
128
|
+
return v === null || v === void 0 ? void 0 : v(value, undefined, record);
|
129
|
+
}];
|
130
|
+
}
|
131
|
+
|
132
|
+
return [k, v];
|
133
|
+
})) !== null && _Object$entries$map !== void 0 ? _Object$entries$map : []);
|
134
|
+
}
|
135
|
+
|
136
|
+
return _objectSpread(_objectSpread({}, column), {}, {
|
137
|
+
title: (_originColumn$title = originColumn === null || originColumn === void 0 ? void 0 : originColumn.title) !== null && _originColumn$title !== void 0 ? _originColumn$title : column.title,
|
138
|
+
render: render
|
139
|
+
});
|
140
|
+
}).filter(function (item) {
|
141
|
+
return !(item === null || item === void 0 ? void 0 : item.actionSchema);
|
142
|
+
});
|
143
|
+
}, [columns, originColumns]); // 获取单个渲染数据
|
144
|
+
|
145
|
+
var renderCardInfoItem = function renderCardInfoItem(itemProps, record, index) {
|
146
|
+
if (itemProps) {
|
147
|
+
if (typeof itemProps === 'string' || Array.isArray(itemProps)) {
|
148
|
+
var _titleColumn$cell, _titleColumn$cell2;
|
149
|
+
|
150
|
+
var titleColumn = cardColumns.find(function (item) {
|
151
|
+
return item.dataIndex === itemProps;
|
152
|
+
});
|
153
|
+
return (_titleColumn$cell = titleColumn === null || titleColumn === void 0 ? void 0 : (_titleColumn$cell2 = titleColumn.cell) === null || _titleColumn$cell2 === void 0 ? void 0 : _titleColumn$cell2.call(titleColumn, getDataIndexValue(itemProps, record), index, record)) !== null && _titleColumn$cell !== void 0 ? _titleColumn$cell : '';
|
154
|
+
}
|
155
|
+
|
156
|
+
return (0, _columnRender.renderCell)(getDataIndexValue(itemProps.dataIndex, record), itemProps, index, record, actionRef, context);
|
157
|
+
}
|
158
|
+
}; // 渲染卡片title
|
159
|
+
|
160
|
+
|
161
|
+
var renderCardTitle = function renderCardTitle(record, index) {
|
162
|
+
var _cardColumns$, _cardColumns$$render, _cardColumns$2, _cardColumns$2$cell, _cardColumns$3;
|
163
|
+
|
164
|
+
var titleProp = cardViewProps.title;
|
165
|
+
var title = titleProp;
|
166
|
+
|
167
|
+
if (typeof titleProp === 'function') {
|
168
|
+
title = titleProp === null || titleProp === void 0 ? void 0 : titleProp(index, record);
|
169
|
+
}
|
170
|
+
|
171
|
+
if (titleProp) {
|
172
|
+
return renderCardInfoItem(title, record, index);
|
173
|
+
} // 【默认情况】看看第一列有没有 description,有的话,只取 title
|
174
|
+
|
175
|
+
|
176
|
+
if (cardColumns === null || cardColumns === void 0 ? void 0 : (_cardColumns$ = cardColumns[0]) === null || _cardColumns$ === void 0 ? void 0 : (_cardColumns$$render = _cardColumns$.render) === null || _cardColumns$$render === void 0 ? void 0 : _cardColumns$$render.description) {
|
177
|
+
var _originColumn$render;
|
178
|
+
|
179
|
+
var column = cardColumns === null || cardColumns === void 0 ? void 0 : cardColumns[0];
|
180
|
+
var originColumn = originColumns === null || originColumns === void 0 ? void 0 : originColumns[0]; // 转化为新的 table columns
|
181
|
+
|
182
|
+
var _columns = _objectSpread(_objectSpread({}, originColumn), {}, {
|
183
|
+
render: _objectSpread(_objectSpread({}, originColumn === null || originColumn === void 0 ? void 0 : originColumn.render), {}, {
|
184
|
+
value: originColumn === null || originColumn === void 0 ? void 0 : (_originColumn$render = originColumn.render) === null || _originColumn$render === void 0 ? void 0 : _originColumn$render.value,
|
185
|
+
description: undefined,
|
186
|
+
descriptionCopy: undefined
|
187
|
+
})
|
188
|
+
});
|
189
|
+
|
190
|
+
return (0, _columnRender.renderCell)(getDataIndexValue(column === null || column === void 0 ? void 0 : column.dataIndex, record), _columns, index, record, actionRef, context);
|
191
|
+
} // 【默认情况】直接拿第一列的 cell
|
192
|
+
|
193
|
+
|
194
|
+
return cardColumns === null || cardColumns === void 0 ? void 0 : (_cardColumns$2 = cardColumns[0]) === null || _cardColumns$2 === void 0 ? void 0 : (_cardColumns$2$cell = _cardColumns$2.cell) === null || _cardColumns$2$cell === void 0 ? void 0 : _cardColumns$2$cell.call(_cardColumns$2, getDataIndexValue(cardColumns === null || cardColumns === void 0 ? void 0 : (_cardColumns$3 = cardColumns[0]) === null || _cardColumns$3 === void 0 ? void 0 : _cardColumns$3.dataIndex, record), index, record);
|
195
|
+
}; // 渲染卡片subTitle
|
196
|
+
|
197
|
+
|
198
|
+
var renderCardSubTitle = function renderCardSubTitle(record, index) {
|
199
|
+
var _cardColumns$4, _cardColumns$4$render;
|
200
|
+
|
201
|
+
var subTitleProp = cardViewProps.subTitle;
|
202
|
+
var subTitle = subTitleProp;
|
203
|
+
|
204
|
+
if (typeof subTitleProp === 'function') {
|
205
|
+
subTitle = subTitleProp === null || subTitleProp === void 0 ? void 0 : subTitleProp(index, record);
|
206
|
+
}
|
207
|
+
|
208
|
+
if (subTitle) {
|
209
|
+
return renderCardInfoItem(subTitle, record, index);
|
210
|
+
} // 【默认情况】看看第一列有没有 description,有的话,只取 title
|
211
|
+
|
212
|
+
|
213
|
+
if (cardColumns === null || cardColumns === void 0 ? void 0 : (_cardColumns$4 = cardColumns[0]) === null || _cardColumns$4 === void 0 ? void 0 : (_cardColumns$4$render = _cardColumns$4.render) === null || _cardColumns$4$render === void 0 ? void 0 : _cardColumns$4$render.description) {
|
214
|
+
var _originColumn$render2, _column$render3;
|
215
|
+
|
216
|
+
var column = cardColumns === null || cardColumns === void 0 ? void 0 : cardColumns[0];
|
217
|
+
var originColumn = originColumns === null || originColumns === void 0 ? void 0 : originColumns[0]; // 转化为新的 table columns
|
218
|
+
|
219
|
+
var _columns2 = _objectSpread(_objectSpread({}, originColumn), {}, {
|
220
|
+
render: {
|
221
|
+
value: originColumn === null || originColumn === void 0 ? void 0 : (_originColumn$render2 = originColumn.render) === null || _originColumn$render2 === void 0 ? void 0 : _originColumn$render2.description,
|
222
|
+
description: undefined,
|
223
|
+
descriptionCopy: undefined
|
224
|
+
}
|
225
|
+
});
|
226
|
+
|
227
|
+
return (0, _columnRender.renderCell)(getDataIndexValue(column === null || column === void 0 ? void 0 : (_column$render3 = column.render) === null || _column$render3 === void 0 ? void 0 : _column$render3.value, record), _columns2, index, record, actionRef, context);
|
228
|
+
}
|
229
|
+
}; // 获取ProInfoColumns
|
230
|
+
|
231
|
+
|
232
|
+
var getPropInfoColumns = function getPropInfoColumns(record, index) {
|
233
|
+
var contentProp = cardViewProps.content;
|
234
|
+
var content = contentProp;
|
235
|
+
|
236
|
+
if (typeof contentProp === 'function') {
|
237
|
+
content = contentProp === null || contentProp === void 0 ? void 0 : contentProp(index, record);
|
238
|
+
}
|
239
|
+
|
240
|
+
if (content) {
|
241
|
+
return content.map(function (item) {
|
242
|
+
if (typeof item === 'string') {
|
243
|
+
return cardColumns.find(function (column) {
|
244
|
+
return column.dataIndex === item;
|
245
|
+
});
|
246
|
+
}
|
247
|
+
|
248
|
+
return content;
|
249
|
+
});
|
250
|
+
} // 默认取4条数据
|
251
|
+
|
252
|
+
|
253
|
+
return cardColumns.filter(function (item, index) {
|
254
|
+
return index > 0 && index < 5;
|
255
|
+
});
|
256
|
+
}; // 从表格columns获取Action配置
|
257
|
+
|
258
|
+
|
259
|
+
var getActionGroupFromColumn = function getActionGroupFromColumn(dataIndex, record, index) {
|
260
|
+
var actionColumn;
|
261
|
+
|
262
|
+
if (dataIndex) {
|
263
|
+
actionColumn = columns === null || columns === void 0 ? void 0 : columns.find(function (item) {
|
264
|
+
return item.dataIndex.toString() === dataIndex.toString();
|
265
|
+
});
|
266
|
+
} else {
|
267
|
+
// 默认继承表格操作列
|
268
|
+
// 获取操作列,只能获取最后一列
|
269
|
+
actionColumn = columns === null || columns === void 0 ? void 0 : columns[(columns === null || columns === void 0 ? void 0 : columns.length) - 1];
|
270
|
+
}
|
271
|
+
|
272
|
+
if (actionColumn.actionSchema) {
|
273
|
+
var _actionColumn, _actionColumn$actionS;
|
274
|
+
|
275
|
+
var newActionColumn = _objectSpread(_objectSpread({}, actionColumn), {}, {
|
276
|
+
actionSchema: {
|
277
|
+
actions: (_actionColumn = actionColumn) === null || _actionColumn === void 0 ? void 0 : (_actionColumn$actionS = _actionColumn.actionSchema) === null || _actionColumn$actionS === void 0 ? void 0 : _actionColumn$actionS.actions,
|
278
|
+
max: 1
|
279
|
+
}
|
280
|
+
});
|
281
|
+
|
282
|
+
return (0, _columnRender.renderCell)(null, newActionColumn, index, record, actionRef, context);
|
283
|
+
}
|
284
|
+
|
285
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
286
|
+
}; // 获取Card操作列配置
|
287
|
+
|
288
|
+
|
289
|
+
var getProCardExtra = function getProCardExtra(record, index) {
|
290
|
+
var extraProp = cardViewProps.extra;
|
291
|
+
var extra = extraProp;
|
292
|
+
|
293
|
+
if (typeof extraProp === 'function') {
|
294
|
+
extra = extraProp === null || extraProp === void 0 ? void 0 : extraProp(index, record);
|
295
|
+
}
|
296
|
+
|
297
|
+
if (Array.isArray(extra)) {
|
298
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
299
|
+
className: cls('extra')
|
300
|
+
}, extra.map(function (item) {
|
301
|
+
if (typeof item === 'string') {
|
302
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
303
|
+
className: cls('extra-item')
|
304
|
+
}, getActionGroupFromColumn(item, record, index));
|
305
|
+
}
|
306
|
+
|
307
|
+
if ( /*#__PURE__*/(0, _react.isValidElement)(item)) {
|
308
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
309
|
+
className: cls('extra-item')
|
310
|
+
}, item);
|
311
|
+
}
|
312
|
+
|
313
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
314
|
+
className: cls('extra-item')
|
315
|
+
}, (0, _columnRender.renderCell)(null, item, index, record, actionRef, context));
|
316
|
+
}));
|
317
|
+
}
|
318
|
+
|
319
|
+
return getActionGroupFromColumn(undefined, record, index);
|
320
|
+
}; // 渲染Tag
|
321
|
+
|
322
|
+
|
323
|
+
var getTags = function getTags(record, index) {
|
324
|
+
var tagProp = cardViewProps.tags;
|
325
|
+
var tags = tagProp !== null && tagProp !== void 0 ? tagProp : [];
|
326
|
+
|
327
|
+
if (typeof tagProp === 'function') {
|
328
|
+
var _tagProp;
|
329
|
+
|
330
|
+
tags = (_tagProp = tagProp === null || tagProp === void 0 ? void 0 : tagProp(index, record)) !== null && _tagProp !== void 0 ? _tagProp : [];
|
331
|
+
}
|
332
|
+
|
333
|
+
var getTagFromColumns = function getTagFromColumns(columns, dataIndex) {
|
334
|
+
var _columns$render, _columns$render2, _columns$render4, _columns$render5, _columns$render7, _columns$render8;
|
335
|
+
|
336
|
+
var text = getDataIndexValue(dataIndex, record);
|
337
|
+
|
338
|
+
if ((columns === null || columns === void 0 ? void 0 : (_columns$render = columns.render) === null || _columns$render === void 0 ? void 0 : _columns$render.value) && typeof (columns === null || columns === void 0 ? void 0 : (_columns$render2 = columns.render) === null || _columns$render2 === void 0 ? void 0 : _columns$render2.value) === 'string') {
|
339
|
+
var _columns$render3;
|
340
|
+
|
341
|
+
text = columns === null || columns === void 0 ? void 0 : (_columns$render3 = columns.render) === null || _columns$render3 === void 0 ? void 0 : _columns$render3.value;
|
342
|
+
}
|
343
|
+
|
344
|
+
if ((columns === null || columns === void 0 ? void 0 : (_columns$render4 = columns.render) === null || _columns$render4 === void 0 ? void 0 : _columns$render4.value) && typeof (columns === null || columns === void 0 ? void 0 : (_columns$render5 = columns.render) === null || _columns$render5 === void 0 ? void 0 : _columns$render5.value) === 'function') {
|
345
|
+
var _columns$render6;
|
346
|
+
|
347
|
+
text = columns === null || columns === void 0 ? void 0 : (_columns$render6 = columns.render) === null || _columns$render6 === void 0 ? void 0 : _columns$render6.value(getDataIndexValue(dataIndex, record), index, record);
|
348
|
+
}
|
349
|
+
|
350
|
+
var color = columns === null || columns === void 0 ? void 0 : (_columns$render7 = columns.render) === null || _columns$render7 === void 0 ? void 0 : _columns$render7.color;
|
351
|
+
|
352
|
+
if (typeof (columns === null || columns === void 0 ? void 0 : (_columns$render8 = columns.render) === null || _columns$render8 === void 0 ? void 0 : _columns$render8.color) === 'function') {
|
353
|
+
var _columns$render9;
|
354
|
+
|
355
|
+
color = columns === null || columns === void 0 ? void 0 : (_columns$render9 = columns.render) === null || _columns$render9 === void 0 ? void 0 : _columns$render9.color(getDataIndexValue(dataIndex, record), index, record);
|
356
|
+
}
|
357
|
+
|
358
|
+
return {
|
359
|
+
children: text,
|
360
|
+
color: color
|
361
|
+
};
|
362
|
+
};
|
363
|
+
|
364
|
+
return tags.map(function (tagItem) {
|
365
|
+
if (typeof tagItem === 'string') {
|
366
|
+
var tagColumns = columns.find(function (item) {
|
367
|
+
return item.dataIndex === tagItem;
|
368
|
+
});
|
369
|
+
return getTagFromColumns(tagColumns, tagItem);
|
370
|
+
}
|
371
|
+
|
372
|
+
if (_typeof(tagItem) === 'object') {
|
373
|
+
return getTagFromColumns(tagItem, tagItem === null || tagItem === void 0 ? void 0 : tagItem.dataIndex);
|
374
|
+
}
|
375
|
+
});
|
376
|
+
}; // 加载下一页回调
|
377
|
+
|
378
|
+
|
379
|
+
var onLoadMore = function onLoadMore() {
|
380
|
+
var _actionRef$current, _actionRef$current$ne;
|
381
|
+
|
382
|
+
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$ne = _actionRef$current.nextPage) === null || _actionRef$current$ne === void 0 ? void 0 : _actionRef$current$ne.call(_actionRef$current);
|
383
|
+
}; // 触底回调
|
384
|
+
|
385
|
+
|
386
|
+
var onScrollBottom = function onScrollBottom() {
|
387
|
+
if (cardViewProps.autoLoadNextPage !== false) {
|
388
|
+
var _cardViewProps$onScro;
|
389
|
+
|
390
|
+
onLoadMore();
|
391
|
+
cardViewProps === null || cardViewProps === void 0 ? void 0 : (_cardViewProps$onScro = cardViewProps.onScrollBottom) === null || _cardViewProps$onScro === void 0 ? void 0 : _cardViewProps$onScro.call(cardViewProps);
|
392
|
+
}
|
393
|
+
}; // 获取ProCard配置
|
394
|
+
|
395
|
+
|
396
|
+
var getProCardProps = function getProCardProps(record, index) {
|
397
|
+
var _cardViewProps$cardPr;
|
398
|
+
|
399
|
+
var external = ['onCollapse', 'onSelect', 'onClick'];
|
400
|
+
return Object.fromEntries(Object.entries((_cardViewProps$cardPr = cardViewProps.cardProps) !== null && _cardViewProps$cardPr !== void 0 ? _cardViewProps$cardPr : {}).map(function (_ref3) {
|
401
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
402
|
+
key = _ref4[0],
|
403
|
+
value = _ref4[1];
|
404
|
+
|
405
|
+
if (typeof value === 'function' && !external.includes(key)) {
|
406
|
+
return [key, value === null || value === void 0 ? void 0 : value(index, record)];
|
407
|
+
}
|
408
|
+
|
409
|
+
if (typeof value === 'function' && external.includes(key)) {
|
410
|
+
return [key, function () {
|
411
|
+
for (var _len = arguments.length, others = new Array(_len), _key = 0; _key < _len; _key++) {
|
412
|
+
others[_key] = arguments[_key];
|
413
|
+
}
|
414
|
+
|
415
|
+
return value === null || value === void 0 ? void 0 : value.apply(void 0, [index, record].concat(others));
|
416
|
+
}];
|
417
|
+
}
|
418
|
+
|
419
|
+
return [key, value];
|
420
|
+
}));
|
421
|
+
}; // 渲染单个卡片
|
422
|
+
|
423
|
+
|
424
|
+
var renderCard = function renderCard(record, index) {
|
425
|
+
return /*#__PURE__*/_react.default.createElement(Col, {
|
426
|
+
xxs: 24,
|
427
|
+
xs: 12,
|
428
|
+
s: 8,
|
429
|
+
m: 8,
|
430
|
+
l: 6,
|
431
|
+
xl: 6,
|
432
|
+
key: index,
|
433
|
+
className: cls('card-item')
|
434
|
+
}, /*#__PURE__*/_react.default.createElement(_.ProCard, _objectSpread({
|
435
|
+
title: renderCardTitle(record, index),
|
436
|
+
subTitle: renderCardSubTitle(record, index),
|
437
|
+
extra: getProCardExtra(record, index),
|
438
|
+
tags: getTags(record, index)
|
439
|
+
}, getProCardProps(record, index)), /*#__PURE__*/_react.default.createElement(_.ProInfo, {
|
440
|
+
columns: getPropInfoColumns(record, index),
|
441
|
+
dataSource: record,
|
442
|
+
context: {
|
443
|
+
record: record,
|
444
|
+
index: index
|
445
|
+
}
|
446
|
+
})));
|
447
|
+
};
|
448
|
+
|
449
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
450
|
+
className: cls()
|
451
|
+
}, /*#__PURE__*/_react.default.createElement(_LoadMore.default, {
|
452
|
+
onScrollBottom: onScrollBottom,
|
453
|
+
onLoadMore: onLoadMore,
|
454
|
+
loadState: loadState,
|
455
|
+
scrollHeight: (_cardViewProps$scroll = cardViewProps.scrollHeight) !== null && _cardViewProps$scroll !== void 0 ? _cardViewProps$scroll : scrollHeight
|
456
|
+
}, skeletonVisible && /*#__PURE__*/_react.default.createElement(_skeleton.ProSkeletonRaw.Content, null), !skeletonVisible && /*#__PURE__*/_react.default.createElement(Row, {
|
457
|
+
gutter: 16,
|
458
|
+
wrap: true,
|
459
|
+
style: {
|
460
|
+
marginTop: '-16px'
|
461
|
+
}
|
462
|
+
}, dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item, index) {
|
463
|
+
return renderCard(item, index);
|
464
|
+
}))));
|
465
|
+
};
|
466
|
+
|
467
|
+
var _default = CardView;
|
468
|
+
exports.default = _default;
|
@@ -0,0 +1,46 @@
|
|
1
|
+
.teamix-pro-table-card-view {
|
2
|
+
&-card-item {
|
3
|
+
margin-top: 16px;
|
4
|
+
}
|
5
|
+
|
6
|
+
// 样式覆盖
|
7
|
+
.teamix-pro-card-title-name.teamix-pro-card-title-name {
|
8
|
+
|
9
|
+
.teamix-pro-field.teamix-pro-field.teamix-pro-field {
|
10
|
+
font-weight: var(--font-weight-medium);
|
11
|
+
font-size: var(--card-title-font-size, 14px);
|
12
|
+
}
|
13
|
+
|
14
|
+
.next-form-preview.next-form-preview.next-form-preview {
|
15
|
+
font-weight: var(--font-weight-medium);
|
16
|
+
font-size: var(--card-title-font-size, 14px);
|
17
|
+
}
|
18
|
+
|
19
|
+
|
20
|
+
}
|
21
|
+
|
22
|
+
.next-card-header-subtitle.next-card-header-subtitle {
|
23
|
+
|
24
|
+
.teamix-pro-field.teamix-pro-field.teamix-pro-field {
|
25
|
+
font-size: var(--card-sub-title-font-size, 12px);
|
26
|
+
color: var(--card-sub-title-color, #5a5a5a);
|
27
|
+
}
|
28
|
+
|
29
|
+
.next-form-preview.next-form-preview.next-form-preview {
|
30
|
+
font-size: var(--card-sub-title-font-size, 12px);
|
31
|
+
color: var(--card-sub-title-color, #5a5a5a);
|
32
|
+
}
|
33
|
+
|
34
|
+
|
35
|
+
}
|
36
|
+
|
37
|
+
&-extra {
|
38
|
+
display: flex;
|
39
|
+
align-items: center;
|
40
|
+
|
41
|
+
&-item {
|
42
|
+
display: inline-block;
|
43
|
+
margin-left: 8px;
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import './index.scss';
|
3
|
+
import { ProTableColumnProps, ProTableActionType } from '../../typing';
|
4
|
+
declare type ProTableFilterProps = {
|
5
|
+
column: ProTableColumnProps;
|
6
|
+
actionRef: React.MutableRefObject<ProTableActionType | undefined>;
|
7
|
+
switchCardView?: 'table' | 'card';
|
8
|
+
};
|
9
|
+
declare const Filter: React.FC<ProTableFilterProps>;
|
10
|
+
export default Filter;
|
@@ -55,7 +55,8 @@ var RadioItem = _components.Menu.RadioItem;
|
|
55
55
|
|
56
56
|
var Filter = function Filter(props) {
|
57
57
|
var column = props.column,
|
58
|
-
actionRef = props.actionRef
|
58
|
+
actionRef = props.actionRef,
|
59
|
+
switchCardView = props.switchCardView;
|
59
60
|
var _column$filtersWidth = column.filtersWidth,
|
60
61
|
filtersWidth = _column$filtersWidth === void 0 ? 130 : _column$filtersWidth; // 选中过滤项
|
61
62
|
|
@@ -191,7 +192,7 @@ var Filter = function Filter(props) {
|
|
191
192
|
btn: true
|
192
193
|
}),
|
193
194
|
onClick: function onClick() {
|
194
|
-
var _actionRef$current2, _actionRef$current2$f, _actionRef$current$ge6, _actionRef$current3, _actionRef$current3$g, _actionRef$current3$g2, _actionRef$current4, _actionRef$current4$s, _actionRef$current5, _actionRef$
|
195
|
+
var _actionRef$current2, _actionRef$current2$f, _actionRef$current$ge6, _actionRef$current3, _actionRef$current3$g, _actionRef$current3$g2, _actionRef$current4, _actionRef$current4$s, _actionRef$current5, _actionRef$current7, _actionRef$current7$r, _actionRef$current8, _actionRef$current8$r, _actionRef$current9, _actionRef$current9$c;
|
195
196
|
|
196
197
|
(_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$f = _actionRef$current2.filterDataSource) === null || _actionRef$current2$f === void 0 ? void 0 : _actionRef$current2$f.call(_actionRef$current2, column.dataIndex); // 先获取此列的param
|
197
198
|
|
@@ -217,13 +218,19 @@ var Filter = function Filter(props) {
|
|
217
218
|
|
218
219
|
if (pageInfo && (pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey)) {
|
219
220
|
targetPageKey = pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey;
|
221
|
+
}
|
222
|
+
|
223
|
+
if (switchCardView === 'card') {
|
224
|
+
var _actionRef$current6, _actionRef$current6$s;
|
225
|
+
|
226
|
+
(_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : (_actionRef$current6$s = _actionRef$current6.setData) === null || _actionRef$current6$s === void 0 ? void 0 : _actionRef$current6$s.call(_actionRef$current6, []);
|
220
227
|
} // 发送请求
|
221
228
|
|
222
229
|
|
223
|
-
(_actionRef$
|
224
|
-
(_actionRef$
|
230
|
+
(_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$r = _actionRef$current7.request) === null || _actionRef$current7$r === void 0 ? void 0 : _actionRef$current7$r.call(_actionRef$current7, _defineProperty({}, targetPageKey, 1));
|
231
|
+
(_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : (_actionRef$current8$r = _actionRef$current8.resetPage) === null || _actionRef$current8$r === void 0 ? void 0 : _actionRef$current8$r.call(_actionRef$current8); // 清空表格选择
|
225
232
|
|
226
|
-
(_actionRef$
|
233
|
+
(_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);
|
227
234
|
setVisible(false);
|
228
235
|
}
|
229
236
|
}, (0, _utils.getMessage)('ok')), /*#__PURE__*/_react.default.createElement(_components.Button, {
|
@@ -233,31 +240,31 @@ var Filter = function Filter(props) {
|
|
233
240
|
btn: true
|
234
241
|
}),
|
235
242
|
onClick: function onClick() {
|
236
|
-
var _actionRef$current$ge7, _actionRef$
|
243
|
+
var _actionRef$current$ge7, _actionRef$current10, _actionRef$current10$, _actionRef$current10$2, _actionRef$current11, _actionRef$current11$, _actionRef$current12, _actionRef$current12$;
|
237
244
|
|
238
245
|
setSelected([]);
|
239
|
-
var rules = (_actionRef$current$ge7 = (_actionRef$
|
240
|
-
(_actionRef$
|
246
|
+
var rules = (_actionRef$current$ge7 = (_actionRef$current10 = actionRef.current) === null || _actionRef$current10 === void 0 ? void 0 : (_actionRef$current10$ = _actionRef$current10.getState) === null || _actionRef$current10$ === void 0 ? void 0 : (_actionRef$current10$2 = _actionRef$current10$.call(_actionRef$current10)) === null || _actionRef$current10$2 === void 0 ? void 0 : _actionRef$current10$2.filterRules) !== null && _actionRef$current$ge7 !== void 0 ? _actionRef$current$ge7 : {};
|
247
|
+
(_actionRef$current11 = actionRef.current) === null || _actionRef$current11 === void 0 ? void 0 : (_actionRef$current11$ = _actionRef$current11.setFilterRules) === null || _actionRef$current11$ === void 0 ? void 0 : _actionRef$current11$.call(_actionRef$current11, _objectSpread(_objectSpread({}, rules), {}, _defineProperty({}, column.dataIndex, {
|
241
248
|
rules: [],
|
242
249
|
params: ''
|
243
250
|
})));
|
244
|
-
(_actionRef$
|
251
|
+
(_actionRef$current12 = actionRef.current) === null || _actionRef$current12 === void 0 ? void 0 : (_actionRef$current12$ = _actionRef$current12.filterDataSource) === null || _actionRef$current12$ === void 0 ? void 0 : _actionRef$current12$.call(_actionRef$current12, column.dataIndex);
|
245
252
|
|
246
253
|
if (selected.length > 0) {
|
247
|
-
var _actionRef$
|
254
|
+
var _actionRef$current13, _actionRef$current14, _actionRef$current14$, _actionRef$current15, _actionRef$current15$, _actionRef$current16, _actionRef$current16$;
|
248
255
|
|
249
256
|
var targetPageKey = 'currentPage';
|
250
|
-
var pageInfo = (_actionRef$
|
257
|
+
var pageInfo = (_actionRef$current13 = actionRef.current) === null || _actionRef$current13 === void 0 ? void 0 : _actionRef$current13.pageInfo;
|
251
258
|
|
252
259
|
if (pageInfo && (pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey)) {
|
253
260
|
targetPageKey = pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey;
|
254
261
|
} // 发送请求
|
255
262
|
|
256
263
|
|
257
|
-
(_actionRef$
|
258
|
-
(_actionRef$
|
264
|
+
(_actionRef$current14 = actionRef.current) === null || _actionRef$current14 === void 0 ? void 0 : (_actionRef$current14$ = _actionRef$current14.request) === null || _actionRef$current14$ === void 0 ? void 0 : _actionRef$current14$.call(_actionRef$current14, _defineProperty({}, targetPageKey, 1));
|
265
|
+
(_actionRef$current15 = actionRef.current) === null || _actionRef$current15 === void 0 ? void 0 : (_actionRef$current15$ = _actionRef$current15.resetPage) === null || _actionRef$current15$ === void 0 ? void 0 : _actionRef$current15$.call(_actionRef$current15); // 清空表格选择
|
259
266
|
|
260
|
-
(_actionRef$
|
267
|
+
(_actionRef$current16 = actionRef.current) === null || _actionRef$current16 === void 0 ? void 0 : (_actionRef$current16$ = _actionRef$current16.clearRowSelection) === null || _actionRef$current16$ === void 0 ? void 0 : _actionRef$current16$.call(_actionRef$current16);
|
261
268
|
} // setVisible(!visible);
|
262
269
|
|
263
270
|
}
|