@teamix/pro 1.1.3 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +97 -0
- package/dist/pro.css +1 -1
- package/dist/pro.js +1198 -1228
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/dist/pro.min.js.LICENSE.txt +1 -1
- package/es/actions/base.d.ts +13 -0
- package/es/actions/base.js +23 -0
- package/es/actions/confirm.d.ts +7 -0
- package/es/actions/confirm.js +11 -0
- package/es/actions/danger-confirm.d.ts +7 -0
- package/es/actions/danger-confirm.js +14 -0
- package/es/actions/dialog-component.d.ts +10 -0
- package/es/actions/dialog-component.js +25 -0
- package/es/actions/dialog-form.d.ts +15 -0
- package/es/actions/dialog-form.js +129 -0
- package/es/actions/dialog-table.d.ts +9 -0
- package/es/actions/dialog-table.js +10 -0
- package/es/actions/dialog.d.ts +17 -0
- package/es/actions/dialog.js +197 -0
- package/es/actions/drawer-form.d.ts +6 -0
- package/es/actions/drawer-form.js +7 -0
- package/es/actions/drawer-table.d.ts +6 -0
- package/es/actions/drawer-table.js +7 -0
- package/es/actions/drawer.d.ts +6 -0
- package/es/actions/drawer.js +7 -0
- package/es/actions/error.d.ts +7 -0
- package/es/actions/error.js +11 -0
- package/es/actions/index.d.ts +71 -0
- package/es/actions/index.js +337 -0
- package/es/actions/index.scss +34 -0
- package/es/actions/link.d.ts +14 -0
- package/es/actions/link.js +45 -0
- package/es/actions/notice.d.ts +7 -0
- package/es/actions/notice.js +11 -0
- package/es/actions/request.d.ts +9 -0
- package/es/actions/request.js +60 -0
- package/es/card/index.d.ts +47 -0
- package/es/card/index.js +159 -0
- package/es/card/index.scss +98 -0
- package/es/field/index.d.ts +3 -0
- package/es/field/index.js +3 -0
- package/es/form/Components/Editable/index.d.ts +20 -0
- package/es/form/Components/Editable/index.js +228 -0
- package/es/form/Components/FormGroup/index.d.ts +13 -0
- package/es/form/Components/FormGroup/index.js +89 -0
- package/es/form/Components/FormGroup/index.scss +23 -0
- package/es/form/Components/ProField/index.d.ts +150 -0
- package/es/form/Components/ProField/index.js +53 -0
- package/es/form/Components/Query/index.d.ts +4 -0
- package/es/form/Components/Query/index.js +70 -0
- package/es/form/Components/Query/index.scss +90 -0
- package/es/form/Components/QueryFilter/index.d.ts +3 -0
- package/es/form/Components/QueryFilter/index.js +111 -0
- package/es/form/Components/Search/index.d.ts +11 -0
- package/es/form/Components/Search/index.js +89 -0
- package/es/form/Filter/index.d.ts +16 -0
- package/es/form/Filter/index.js +218 -0
- package/es/form/ProForm/index.d.ts +5 -0
- package/es/form/ProForm/index.js +100 -0
- package/es/form/ProForm/index.scss +254 -0
- package/es/form/SchemaForm/adapterComponent.d.ts +5 -0
- package/es/form/SchemaForm/adapterComponent.js +17 -0
- package/es/form/SchemaForm/adapterDecorator.d.ts +6 -0
- package/es/form/SchemaForm/adapterDecorator.js +28 -0
- package/es/form/SchemaForm/adapterType.d.ts +5 -0
- package/es/form/SchemaForm/adapterType.js +52 -0
- package/es/form/SchemaForm/index.d.ts +4 -0
- package/es/form/SchemaForm/index.js +259 -0
- package/es/form/SchemaForm/initializeArrayCards.d.ts +3 -0
- package/es/form/SchemaForm/initializeArrayCards.js +24 -0
- package/es/form/SchemaForm/initializeArrayCollapse.d.ts +3 -0
- package/es/form/SchemaForm/initializeArrayCollapse.js +24 -0
- package/es/form/SchemaForm/initializeArrayIcon.d.ts +3 -0
- package/es/form/SchemaForm/initializeArrayIcon.js +57 -0
- package/es/form/SchemaForm/initializeArrayItems.d.ts +3 -0
- package/es/form/SchemaForm/initializeArrayItems.js +38 -0
- package/es/form/SchemaForm/initializeArrayTable.d.ts +3 -0
- package/es/form/SchemaForm/initializeArrayTable.js +56 -0
- package/es/form/SchemaForm/initializeFormButton.d.ts +3 -0
- package/es/form/SchemaForm/initializeFormButton.js +75 -0
- package/es/form/SchemaForm/initializeFormCollapse.d.ts +3 -0
- package/es/form/SchemaForm/initializeFormCollapse.js +43 -0
- package/es/form/SchemaForm/initializeFormGroup.d.ts +3 -0
- package/es/form/SchemaForm/initializeFormGroup.js +46 -0
- package/es/form/SchemaForm/initializeFormStep.d.ts +3 -0
- package/es/form/SchemaForm/initializeFormStep.js +48 -0
- package/es/form/SchemaForm/initializeFormTab.d.ts +3 -0
- package/es/form/SchemaForm/initializeFormTab.js +53 -0
- package/es/form/SchemaForm/initializeProField.d.ts +5 -0
- package/es/form/SchemaForm/initializeProField.js +67 -0
- package/es/form/SchemaForm/initializeRequest.d.ts +11 -0
- package/es/form/SchemaForm/initializeRequest.js +25 -0
- package/es/form/SchemaForm/reactions.d.ts +4 -0
- package/es/form/SchemaForm/reactions.js +62 -0
- package/es/form/index.d.ts +27 -0
- package/es/form/index.js +35 -0
- package/es/form/typing.d.ts +69 -0
- package/es/form/typing.js +1 -0
- package/es/form/utils.d.ts +9 -0
- package/es/form/utils.js +108 -0
- package/es/form/warning.d.ts +3 -0
- package/es/form/warning.js +16 -0
- package/es/hooks/index.d.ts +2 -0
- package/es/hooks/index.js +2 -0
- package/es/index.d.ts +24 -0
- package/es/index.js +29 -0
- package/es/info/components/FormItem/index.d.ts +5 -0
- package/es/info/components/FormItem/index.js +63 -0
- package/es/info/components/FormItem/index.scss +60 -0
- package/es/info/components/InfoGroup/index.d.ts +5 -0
- package/es/info/components/InfoGroup/index.js +47 -0
- package/es/info/components/InfoGroup/index.scss +14 -0
- package/es/info/components/InfoValueItem/index.d.ts +5 -0
- package/es/info/components/InfoValueItem/index.js +223 -0
- package/es/info/components/InfoValueItem/index.scss +21 -0
- package/es/info/components/baseInfo/index.d.ts +7 -0
- package/es/info/components/baseInfo/index.js +73 -0
- package/es/info/components/baseInfo/index.scss +3 -0
- package/es/info/components/headerInfo/index.d.ts +7 -0
- package/es/info/components/headerInfo/index.js +85 -0
- package/es/info/components/headerInfo/index.scss +0 -0
- package/es/info/components/tableInfo/index.d.ts +8 -0
- package/es/info/components/tableInfo/index.js +175 -0
- package/es/info/components/tableInfo/index.scss +18 -0
- package/es/info/index.d.ts +10 -0
- package/es/info/index.js +87 -0
- package/es/info/index.scss +12 -0
- package/es/info/typing.d.ts +157 -0
- package/es/info/typing.js +1 -0
- package/es/info/utils/index.d.ts +12 -0
- package/es/info/utils/index.js +33 -0
- package/es/info/utils/layout.d.ts +2 -0
- package/es/info/utils/layout.js +58 -0
- package/es/info/utils/useInfoRequest.d.ts +14 -0
- package/es/info/utils/useInfoRequest.js +73 -0
- package/es/info/utils/utils.d.ts +1 -0
- package/es/info/utils/utils.js +13 -0
- package/es/layout/index.d.ts +2 -0
- package/es/layout/index.js +3 -0
- package/es/nocode/configurators/Card.d.ts +3 -0
- package/es/nocode/configurators/Card.js +109 -0
- package/es/nocode/configurators/PageHeader.d.ts +3 -0
- package/es/nocode/configurators/PageHeader.js +202 -0
- package/es/nocode/configurators/ProTable.d.ts +3 -0
- package/es/nocode/configurators/ProTable.js +320 -0
- package/es/nocode/configurators/common.d.ts +188 -0
- package/es/nocode/configurators/common.js +318 -0
- package/es/nocode/configurators/index.d.ts +15 -0
- package/es/nocode/configurators/index.js +27 -0
- package/es/nocode/configurators/map.d.ts +2 -0
- package/es/nocode/configurators/map.js +8 -0
- package/es/nocode/index.d.ts +8 -0
- package/es/nocode/index.js +11 -0
- package/es/nocode/index.scss +93 -0
- package/es/nocode/pages/editor.d.ts +12 -0
- package/es/nocode/pages/editor.js +40 -0
- package/es/nocode/pages/index.d.ts +14 -0
- package/es/nocode/pages/index.js +41 -0
- package/es/nocode/pages/playground.d.ts +11 -0
- package/es/nocode/pages/playground.js +130 -0
- package/es/nocode/pages/renderer.d.ts +10 -0
- package/es/nocode/pages/renderer.js +144 -0
- package/es/nocode/playground.d.ts +14 -0
- package/es/nocode/playground.js +68 -0
- package/es/page-container/index.d.ts +3 -0
- package/es/page-container/index.js +3 -0
- package/es/page-header/index.d.ts +43 -0
- package/es/page-header/index.js +233 -0
- package/es/page-header/index.scss +169 -0
- package/es/skeleton/index.d.ts +3 -0
- package/es/skeleton/index.js +3 -0
- package/es/table/components/Filter/index.d.ts +9 -0
- package/es/table/components/Filter/index.js +223 -0
- package/es/table/components/Filter/index.scss +23 -0
- package/es/table/components/Layout/index.d.ts +5 -0
- package/es/table/components/Layout/index.js +242 -0
- package/es/table/components/Layout/index.scss +39 -0
- package/es/table/components/QuickAction/index.d.ts +10 -0
- package/es/table/components/QuickAction/index.js +53 -0
- package/es/table/components/QuickAction/index.scss +0 -0
- package/es/table/components/ToolBar/DensityIcon.d.ts +4 -0
- package/es/table/components/ToolBar/DensityIcon.js +117 -0
- package/es/table/components/ToolBar/FilterColumnIcon.d.ts +4 -0
- package/es/table/components/ToolBar/FilterColumnIcon.js +284 -0
- package/es/table/components/ToolBar/FullScreenIcon.d.ts +4 -0
- package/es/table/components/ToolBar/FullScreenIcon.js +89 -0
- package/es/table/components/ToolBar/Fullscreen.d.ts +10 -0
- package/es/table/components/ToolBar/Fullscreen.js +68 -0
- package/es/table/components/ToolBar/RefreshIcon.d.ts +4 -0
- package/es/table/components/ToolBar/RefreshIcon.js +45 -0
- package/es/table/components/ToolBar/index.d.ts +5 -0
- package/es/table/components/ToolBar/index.js +79 -0
- package/es/table/components/ToolBar/index.scss +110 -0
- package/es/table/index.d.ts +6 -0
- package/es/table/index.js +607 -0
- package/es/table/index.scss +103 -0
- package/es/table/typing.d.ts +222 -0
- package/es/table/typing.js +1 -0
- package/es/table/utils/columnRender.d.ts +13 -0
- package/es/table/utils/columnRender.js +185 -0
- package/es/table/utils/genProColumnToColumn.d.ts +9 -0
- package/es/table/utils/genProColumnToColumn.js +51 -0
- package/es/table/utils/getTableProps.d.ts +2 -0
- package/es/table/utils/getTableProps.js +4 -0
- package/es/table/utils/getTableSortIcons.d.ts +3 -0
- package/es/table/utils/getTableSortIcons.js +21 -0
- package/es/table/utils/index.d.ts +4 -0
- package/es/table/utils/index.js +100 -0
- package/es/table/utils/useTableSelection.d.ts +3 -0
- package/es/table/utils/useTableSelection.js +107 -0
- package/es/templates/Detail/index.d.ts +2 -0
- package/es/templates/Detail/index.js +5 -0
- package/es/templates/Detail/index.scss +3 -0
- package/es/templates/Form/index.d.ts +2 -0
- package/es/templates/Form/index.js +5 -0
- package/es/templates/Form/index.scss +3 -0
- package/es/templates/List/index.d.ts +9 -0
- package/es/templates/List/index.js +45 -0
- package/es/templates/List/index.scss +3 -0
- package/es/templates/index.d.ts +5 -0
- package/es/templates/index.js +7 -0
- package/es/templates/index.scss +3 -0
- package/es/utils/index.d.ts +2 -0
- package/es/utils/index.js +2 -0
- package/lib/actions/base.d.ts +13 -0
- package/lib/actions/base.js +33 -0
- package/lib/actions/confirm.d.ts +7 -0
- package/lib/actions/confirm.js +25 -0
- package/lib/actions/danger-confirm.d.ts +7 -0
- package/lib/actions/danger-confirm.js +28 -0
- package/lib/actions/dialog-component.d.ts +10 -0
- package/lib/actions/dialog-component.js +39 -0
- package/lib/actions/dialog-form.d.ts +15 -0
- package/lib/actions/dialog-form.js +152 -0
- package/lib/actions/dialog-table.d.ts +9 -0
- package/lib/actions/dialog-table.js +24 -0
- package/lib/actions/dialog.d.ts +17 -0
- package/lib/actions/dialog.js +219 -0
- package/lib/actions/drawer-form.d.ts +6 -0
- package/lib/actions/drawer-form.js +18 -0
- package/lib/actions/drawer-table.d.ts +6 -0
- package/lib/actions/drawer-table.js +18 -0
- package/lib/actions/drawer.d.ts +6 -0
- package/lib/actions/drawer.js +20 -0
- package/lib/actions/error.d.ts +7 -0
- package/lib/actions/error.js +25 -0
- package/lib/actions/index.d.ts +71 -0
- package/lib/actions/index.js +380 -0
- package/lib/actions/index.scss +34 -0
- package/lib/actions/link.d.ts +14 -0
- package/lib/actions/link.js +60 -0
- package/lib/actions/notice.d.ts +7 -0
- package/lib/actions/notice.js +25 -0
- package/lib/actions/request.d.ts +9 -0
- package/lib/actions/request.js +75 -0
- package/lib/card/index.d.ts +47 -0
- package/lib/card/index.js +179 -0
- package/lib/card/index.scss +98 -0
- package/lib/field/index.d.ts +3 -0
- package/lib/field/index.js +30 -0
- package/lib/form/Components/Editable/index.d.ts +20 -0
- package/lib/form/Components/Editable/index.js +251 -0
- package/lib/form/Components/FormGroup/index.d.ts +13 -0
- package/lib/form/Components/FormGroup/index.js +103 -0
- package/lib/form/Components/FormGroup/index.scss +23 -0
- package/lib/form/Components/ProField/index.d.ts +150 -0
- package/lib/form/Components/ProField/index.js +68 -0
- package/lib/form/Components/Query/index.d.ts +4 -0
- package/lib/form/Components/Query/index.js +91 -0
- package/lib/form/Components/Query/index.scss +90 -0
- package/lib/form/Components/QueryFilter/index.d.ts +3 -0
- package/lib/form/Components/QueryFilter/index.js +130 -0
- package/lib/form/Components/Search/index.d.ts +11 -0
- package/lib/form/Components/Search/index.js +103 -0
- package/lib/form/Filter/index.d.ts +16 -0
- package/lib/form/Filter/index.js +242 -0
- package/lib/form/ProForm/index.d.ts +5 -0
- package/lib/form/ProForm/index.js +125 -0
- package/lib/form/ProForm/index.scss +254 -0
- package/lib/form/SchemaForm/adapterComponent.d.ts +5 -0
- package/lib/form/SchemaForm/adapterComponent.js +27 -0
- package/lib/form/SchemaForm/adapterDecorator.d.ts +6 -0
- package/lib/form/SchemaForm/adapterDecorator.js +34 -0
- package/lib/form/SchemaForm/adapterType.d.ts +5 -0
- package/lib/form/SchemaForm/adapterType.js +62 -0
- package/lib/form/SchemaForm/index.d.ts +4 -0
- package/lib/form/SchemaForm/index.js +302 -0
- package/lib/form/SchemaForm/initializeArrayCards.d.ts +3 -0
- package/lib/form/SchemaForm/initializeArrayCards.js +32 -0
- package/lib/form/SchemaForm/initializeArrayCollapse.d.ts +3 -0
- package/lib/form/SchemaForm/initializeArrayCollapse.js +32 -0
- package/lib/form/SchemaForm/initializeArrayIcon.d.ts +3 -0
- package/lib/form/SchemaForm/initializeArrayIcon.js +68 -0
- package/lib/form/SchemaForm/initializeArrayItems.d.ts +3 -0
- package/lib/form/SchemaForm/initializeArrayItems.js +46 -0
- package/lib/form/SchemaForm/initializeArrayTable.d.ts +3 -0
- package/lib/form/SchemaForm/initializeArrayTable.js +63 -0
- package/lib/form/SchemaForm/initializeFormButton.d.ts +3 -0
- package/lib/form/SchemaForm/initializeFormButton.js +82 -0
- package/lib/form/SchemaForm/initializeFormCollapse.d.ts +3 -0
- package/lib/form/SchemaForm/initializeFormCollapse.js +50 -0
- package/lib/form/SchemaForm/initializeFormGroup.d.ts +3 -0
- package/lib/form/SchemaForm/initializeFormGroup.js +53 -0
- package/lib/form/SchemaForm/initializeFormStep.d.ts +3 -0
- package/lib/form/SchemaForm/initializeFormStep.js +55 -0
- package/lib/form/SchemaForm/initializeFormTab.d.ts +3 -0
- package/lib/form/SchemaForm/initializeFormTab.js +60 -0
- package/lib/form/SchemaForm/initializeProField.d.ts +5 -0
- package/lib/form/SchemaForm/initializeProField.js +74 -0
- package/lib/form/SchemaForm/initializeRequest.d.ts +11 -0
- package/lib/form/SchemaForm/initializeRequest.js +34 -0
- package/lib/form/SchemaForm/reactions.d.ts +4 -0
- package/lib/form/SchemaForm/reactions.js +72 -0
- package/lib/form/index.d.ts +27 -0
- package/lib/form/index.js +139 -0
- package/lib/form/typing.d.ts +69 -0
- package/lib/form/typing.js +5 -0
- package/lib/form/utils.d.ts +9 -0
- package/lib/form/utils.js +124 -0
- package/lib/form/warning.d.ts +3 -0
- package/lib/form/warning.js +24 -0
- package/lib/hooks/index.d.ts +2 -0
- package/lib/hooks/index.js +17 -0
- package/lib/index.d.ts +24 -0
- package/lib/index.js +244 -0
- package/lib/info/components/FormItem/index.d.ts +5 -0
- package/lib/info/components/FormItem/index.js +78 -0
- package/lib/info/components/FormItem/index.scss +60 -0
- package/lib/info/components/InfoGroup/index.d.ts +5 -0
- package/lib/info/components/InfoGroup/index.js +67 -0
- package/lib/info/components/InfoGroup/index.scss +14 -0
- package/lib/info/components/InfoValueItem/index.d.ts +5 -0
- package/lib/info/components/InfoValueItem/index.js +249 -0
- package/lib/info/components/InfoValueItem/index.scss +21 -0
- package/lib/info/components/baseInfo/index.d.ts +7 -0
- package/lib/info/components/baseInfo/index.js +100 -0
- package/lib/info/components/baseInfo/index.scss +3 -0
- package/lib/info/components/headerInfo/index.d.ts +7 -0
- package/lib/info/components/headerInfo/index.js +112 -0
- package/lib/info/components/headerInfo/index.scss +0 -0
- package/lib/info/components/tableInfo/index.d.ts +8 -0
- package/lib/info/components/tableInfo/index.js +197 -0
- package/lib/info/components/tableInfo/index.scss +18 -0
- package/lib/info/index.d.ts +10 -0
- package/lib/info/index.js +123 -0
- package/lib/info/index.scss +12 -0
- package/lib/info/typing.d.ts +157 -0
- package/lib/info/typing.js +5 -0
- package/lib/info/utils/index.d.ts +12 -0
- package/lib/info/utils/index.js +50 -0
- package/lib/info/utils/layout.d.ts +2 -0
- package/lib/info/utils/layout.js +65 -0
- package/lib/info/utils/useInfoRequest.d.ts +14 -0
- package/lib/info/utils/useInfoRequest.js +82 -0
- package/lib/info/utils/utils.d.ts +1 -0
- package/lib/info/utils/utils.js +20 -0
- package/lib/layout/index.d.ts +2 -0
- package/lib/layout/index.js +10 -0
- package/lib/nocode/configurators/Card.d.ts +3 -0
- package/lib/nocode/configurators/Card.js +116 -0
- package/lib/nocode/configurators/PageHeader.d.ts +3 -0
- package/lib/nocode/configurators/PageHeader.js +211 -0
- package/lib/nocode/configurators/ProTable.d.ts +3 -0
- package/lib/nocode/configurators/ProTable.js +329 -0
- package/lib/nocode/configurators/common.d.ts +188 -0
- package/lib/nocode/configurators/common.js +329 -0
- package/lib/nocode/configurators/index.d.ts +15 -0
- package/lib/nocode/configurators/index.js +44 -0
- package/lib/nocode/configurators/map.d.ts +2 -0
- package/lib/nocode/configurators/map.js +21 -0
- package/lib/nocode/index.d.ts +8 -0
- package/lib/nocode/index.js +76 -0
- package/lib/nocode/index.scss +93 -0
- package/lib/nocode/pages/editor.d.ts +12 -0
- package/lib/nocode/pages/editor.js +58 -0
- package/lib/nocode/pages/index.d.ts +14 -0
- package/lib/nocode/pages/index.js +93 -0
- package/lib/nocode/pages/playground.d.ts +11 -0
- package/lib/nocode/pages/playground.js +158 -0
- package/lib/nocode/pages/renderer.d.ts +10 -0
- package/lib/nocode/pages/renderer.js +164 -0
- package/lib/nocode/playground.d.ts +14 -0
- package/lib/nocode/playground.js +91 -0
- package/lib/page-container/index.d.ts +3 -0
- package/lib/page-container/index.js +30 -0
- package/lib/page-header/index.d.ts +43 -0
- package/lib/page-header/index.js +252 -0
- package/lib/page-header/index.scss +169 -0
- package/lib/skeleton/index.d.ts +3 -0
- package/lib/skeleton/index.js +30 -0
- package/lib/table/components/Filter/index.d.ts +9 -0
- package/lib/table/components/Filter/index.js +244 -0
- package/lib/table/components/Filter/index.scss +23 -0
- package/lib/table/components/Layout/index.d.ts +5 -0
- package/lib/table/components/Layout/index.js +266 -0
- package/lib/table/components/Layout/index.scss +39 -0
- package/lib/table/components/QuickAction/index.d.ts +10 -0
- package/lib/table/components/QuickAction/index.js +65 -0
- package/lib/table/components/QuickAction/index.scss +0 -0
- package/lib/table/components/ToolBar/DensityIcon.d.ts +4 -0
- package/lib/table/components/ToolBar/DensityIcon.js +135 -0
- package/lib/table/components/ToolBar/FilterColumnIcon.d.ts +4 -0
- package/lib/table/components/ToolBar/FilterColumnIcon.js +303 -0
- package/lib/table/components/ToolBar/FullScreenIcon.d.ts +4 -0
- package/lib/table/components/ToolBar/FullScreenIcon.js +107 -0
- package/lib/table/components/ToolBar/Fullscreen.d.ts +10 -0
- package/lib/table/components/ToolBar/Fullscreen.js +85 -0
- package/lib/table/components/ToolBar/RefreshIcon.d.ts +4 -0
- package/lib/table/components/ToolBar/RefreshIcon.js +60 -0
- package/lib/table/components/ToolBar/index.d.ts +5 -0
- package/lib/table/components/ToolBar/index.js +96 -0
- package/lib/table/components/ToolBar/index.scss +110 -0
- package/lib/table/index.d.ts +6 -0
- package/lib/table/index.js +662 -0
- package/lib/table/index.scss +103 -0
- package/lib/table/typing.d.ts +222 -0
- package/lib/table/typing.js +5 -0
- package/lib/table/utils/columnRender.d.ts +13 -0
- package/lib/table/utils/columnRender.js +201 -0
- package/lib/table/utils/genProColumnToColumn.d.ts +9 -0
- package/lib/table/utils/genProColumnToColumn.js +62 -0
- package/lib/table/utils/getTableProps.d.ts +2 -0
- package/lib/table/utils/getTableProps.js +13 -0
- package/lib/table/utils/getTableSortIcons.d.ts +3 -0
- package/lib/table/utils/getTableSortIcons.js +34 -0
- package/lib/table/utils/index.d.ts +4 -0
- package/lib/table/utils/index.js +112 -0
- package/lib/table/utils/useTableSelection.d.ts +3 -0
- package/lib/table/utils/useTableSelection.js +112 -0
- package/lib/templates/Detail/index.d.ts +2 -0
- package/lib/templates/Detail/index.js +18 -0
- package/lib/templates/Detail/index.scss +3 -0
- package/lib/templates/Form/index.d.ts +2 -0
- package/lib/templates/Form/index.js +18 -0
- package/lib/templates/Form/index.scss +3 -0
- package/lib/templates/List/index.d.ts +9 -0
- package/lib/templates/List/index.js +67 -0
- package/lib/templates/List/index.scss +3 -0
- package/lib/templates/index.d.ts +5 -0
- package/lib/templates/index.js +59 -0
- package/lib/templates/index.scss +3 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.js +17 -0
- package/package.json +5 -5
@@ -0,0 +1,85 @@
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (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 = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
4
|
+
|
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; }
|
6
|
+
|
7
|
+
import { Grid } from '@alicloudfe/components';
|
8
|
+
import ProCard from '../../../card';
|
9
|
+
import React, { useContext, useRef } from 'react';
|
10
|
+
import FormItem from '../FormItem';
|
11
|
+
import './index.scss';
|
12
|
+
import defaultLayoutMap from '../../utils/layout';
|
13
|
+
import { useSize } from '@teamix/hooks';
|
14
|
+
import { getLayout } from '../../utils/utils';
|
15
|
+
import InfoValueItem from '../InfoValueItem';
|
16
|
+
import { getDataIndexValue, ProInfoGroupContext } from '../../utils';
|
17
|
+
var Row = Grid.Row,
|
18
|
+
Col = Grid.Col;
|
19
|
+
|
20
|
+
var ProHeaderInfo = function ProHeaderInfo(props) {
|
21
|
+
var _size$width;
|
22
|
+
|
23
|
+
var header = props.header,
|
24
|
+
columns = props.columns,
|
25
|
+
dataSource = props.dataSource,
|
26
|
+
layout = props.layout,
|
27
|
+
loading = props.loading,
|
28
|
+
result = props.result,
|
29
|
+
actionRef = props.actionRef;
|
30
|
+
var context = useContext(ProInfoGroupContext);
|
31
|
+
var ref = useRef();
|
32
|
+
var size = context.visible ? context.size : useSize(ref);
|
33
|
+
var defaultLayout = defaultLayoutMap[getLayout((_size$width = size === null || size === void 0 ? void 0 : size.width) !== null && _size$width !== void 0 ? _size$width : 0)];
|
34
|
+
|
35
|
+
var renderContent = function renderContent() {
|
36
|
+
return columns.map(function (item, index) {
|
37
|
+
var _item$title, _item$valueType;
|
38
|
+
|
39
|
+
var span = 24;
|
40
|
+
|
41
|
+
if (layout === null || layout === void 0 ? void 0 : layout.colNum) {
|
42
|
+
var _item$colSpan;
|
43
|
+
|
44
|
+
span = 24 / (layout === null || layout === void 0 ? void 0 : layout.colNum) * ((_item$colSpan = item === null || item === void 0 ? void 0 : item.colSpan) !== null && _item$colSpan !== void 0 ? _item$colSpan : 1);
|
45
|
+
} else {
|
46
|
+
var _item$colSpan2;
|
47
|
+
|
48
|
+
span = defaultLayout.span * ((_item$colSpan2 = item === null || item === void 0 ? void 0 : item.colSpan) !== null && _item$colSpan2 !== void 0 ? _item$colSpan2 : 1);
|
49
|
+
}
|
50
|
+
|
51
|
+
return /*#__PURE__*/React.createElement(Col, {
|
52
|
+
span: span,
|
53
|
+
key: index
|
54
|
+
}, /*#__PURE__*/React.createElement(FormItem, {
|
55
|
+
label: (_item$title = item === null || item === void 0 ? void 0 : item.title) !== null && _item$title !== void 0 ? _item$title : '',
|
56
|
+
loading: loading,
|
57
|
+
value: /*#__PURE__*/React.createElement(InfoValueItem, {
|
58
|
+
type: (_item$valueType = item === null || item === void 0 ? void 0 : item.valueType) !== null && _item$valueType !== void 0 ? _item$valueType : 'text',
|
59
|
+
value: getDataIndexValue(item.dataIndex, dataSource !== null && dataSource !== void 0 ? dataSource : result),
|
60
|
+
render: item.render,
|
61
|
+
dataSource: item.dataSource,
|
62
|
+
infoItem: item,
|
63
|
+
record: dataSource !== null && dataSource !== void 0 ? dataSource : result,
|
64
|
+
actionRef: actionRef
|
65
|
+
}),
|
66
|
+
headerInfoLayout: layout !== null && layout !== void 0 ? layout : defaultLayout,
|
67
|
+
tooltip: item.tooltip,
|
68
|
+
tooltipIcon: item.tooltipIcon
|
69
|
+
}));
|
70
|
+
});
|
71
|
+
};
|
72
|
+
|
73
|
+
return /*#__PURE__*/React.createElement("div", {
|
74
|
+
ref: ref,
|
75
|
+
className: "teamix-pro-info"
|
76
|
+
}, (size === null || size === void 0 ? void 0 : size.width) && /*#__PURE__*/React.createElement(ProCard, _objectSpread({
|
77
|
+
compacted: true,
|
78
|
+
hoveredShadow: false,
|
79
|
+
bordered: false
|
80
|
+
}, header), /*#__PURE__*/React.createElement(Row, {
|
81
|
+
wrap: true
|
82
|
+
}, renderContent())));
|
83
|
+
};
|
84
|
+
|
85
|
+
export default ProHeaderInfo;
|
File without changes
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import './index.scss';
|
3
|
+
import { IProTableInfo } from '../../typing';
|
4
|
+
import './index.scss';
|
5
|
+
import { IUseInfoRequestResult } from '../../utils/useInfoRequest';
|
6
|
+
declare type ProTableInfoProps = IProTableInfo & IUseInfoRequestResult;
|
7
|
+
declare const ProTableInfo: React.FC<ProTableInfoProps>;
|
8
|
+
export default ProTableInfo;
|
@@ -0,0 +1,175 @@
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (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 = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
4
|
+
|
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; }
|
6
|
+
|
7
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
8
|
+
|
9
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
10
|
+
|
11
|
+
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); }
|
12
|
+
|
13
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
14
|
+
|
15
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
16
|
+
|
17
|
+
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; }
|
18
|
+
|
19
|
+
import React, { useMemo } from 'react';
|
20
|
+
import './index.scss';
|
21
|
+
import { Table } from '@alicloudfe/components';
|
22
|
+
import './index.scss';
|
23
|
+
import ProCard from '../../../card';
|
24
|
+
import { LabelIconTip } from '@teamix/utils';
|
25
|
+
import InfoValueItem from '../InfoValueItem';
|
26
|
+
import { BaseSkeleton } from '../../..';
|
27
|
+
import { getDataIndexValue } from '../../utils';
|
28
|
+
|
29
|
+
var ProTableInfo = function ProTableInfo(props) {
|
30
|
+
var header = props.header,
|
31
|
+
columns = props.columns,
|
32
|
+
dataSource = props.dataSource,
|
33
|
+
_props$layout = props.layout,
|
34
|
+
layout = _props$layout === void 0 ? {} : _props$layout,
|
35
|
+
loading = props.loading,
|
36
|
+
result = props.result,
|
37
|
+
actionRef = props.actionRef;
|
38
|
+
var _layout$colNum = layout.colNum,
|
39
|
+
colNum = _layout$colNum === void 0 ? 2 : _layout$colNum,
|
40
|
+
_layout$labelGutter = layout.labelGutter,
|
41
|
+
labelGutter = _layout$labelGutter === void 0 ? '80px' : _layout$labelGutter;
|
42
|
+
|
43
|
+
var newColumns = function newColumns() {
|
44
|
+
return _toConsumableArray(new Array(colNum)).map(function (_, index) {
|
45
|
+
return [{
|
46
|
+
dataIndex: "label_".concat(index),
|
47
|
+
align: 'left',
|
48
|
+
height: 50,
|
49
|
+
width: labelGutter
|
50
|
+
}, {
|
51
|
+
dataIndex: "value_".concat(index),
|
52
|
+
align: 'left'
|
53
|
+
}];
|
54
|
+
}).reduce(function (acc, cur) {
|
55
|
+
return [].concat(_toConsumableArray(acc), _toConsumableArray(cur));
|
56
|
+
}, []);
|
57
|
+
};
|
58
|
+
|
59
|
+
var newDataSource = useMemo(function () {
|
60
|
+
var nResult = [];
|
61
|
+
var columnsCopy = JSON.parse(JSON.stringify(columns)); // 取当前行的数据。直到取完
|
62
|
+
|
63
|
+
while (columnsCopy.length > 0) {
|
64
|
+
var filterColumns = [];
|
65
|
+
var col = colNum * 2; // 需要判断是否有合并行情况
|
66
|
+
|
67
|
+
while (col >= 2) {
|
68
|
+
if (columnsCopy.length > 0) {
|
69
|
+
var _columnsItem$colSpan;
|
70
|
+
|
71
|
+
var columnsItem = columnsCopy.shift();
|
72
|
+
var needCol = 1 + ((_columnsItem$colSpan = columnsItem === null || columnsItem === void 0 ? void 0 : columnsItem.colSpan) !== null && _columnsItem$colSpan !== void 0 ? _columnsItem$colSpan : 1); // 如果剩余的col能满足下一组数据那么就放在这一组
|
73
|
+
|
74
|
+
if (needCol <= col) {
|
75
|
+
var _columnsItem$colSpan2;
|
76
|
+
|
77
|
+
col = col - 1 - ((_columnsItem$colSpan2 = columnsItem === null || columnsItem === void 0 ? void 0 : columnsItem.colSpan) !== null && _columnsItem$colSpan2 !== void 0 ? _columnsItem$colSpan2 : 1);
|
78
|
+
filterColumns.push(columnsItem);
|
79
|
+
} else {
|
80
|
+
var _filterColumns$0$colS;
|
81
|
+
|
82
|
+
// 不满足条件。再安回去。。。
|
83
|
+
columnsCopy.unshift(columnsItem); // 并且把剩余的col都分配给前一组数据
|
84
|
+
|
85
|
+
filterColumns[0].colSpan = ((_filterColumns$0$colS = filterColumns[0].colSpan) !== null && _filterColumns$0$colS !== void 0 ? _filterColumns$0$colS : 1) + col; // 置0
|
86
|
+
|
87
|
+
col = 0;
|
88
|
+
}
|
89
|
+
}
|
90
|
+
}
|
91
|
+
|
92
|
+
var itemData = filterColumns.map(function (item, index) {
|
93
|
+
var _item$title, _item$valueType, _data;
|
94
|
+
|
95
|
+
var data = (_data = {}, _defineProperty(_data, "label_".concat(index), /*#__PURE__*/React.createElement(LabelIconTip, {
|
96
|
+
label: (_item$title = item === null || item === void 0 ? void 0 : item.title) !== null && _item$title !== void 0 ? _item$title : '',
|
97
|
+
tooltip: item.tooltip,
|
98
|
+
icon: item.tooltipIcon
|
99
|
+
})), _defineProperty(_data, "value_".concat(index), /*#__PURE__*/React.createElement(React.Fragment, null, loading && /*#__PURE__*/React.createElement(BaseSkeleton.Info, null), !loading && /*#__PURE__*/React.createElement(InfoValueItem, {
|
100
|
+
type: (_item$valueType = item === null || item === void 0 ? void 0 : item.valueType) !== null && _item$valueType !== void 0 ? _item$valueType : 'text',
|
101
|
+
value: getDataIndexValue(item.dataIndex, dataSource !== null && dataSource !== void 0 ? dataSource : result),
|
102
|
+
render: item.render,
|
103
|
+
dataSource: item.dataSource,
|
104
|
+
infoItem: item,
|
105
|
+
record: dataSource !== null && dataSource !== void 0 ? dataSource : result,
|
106
|
+
actionRef: actionRef
|
107
|
+
}))), _data);
|
108
|
+
|
109
|
+
if (item.colSpan) {
|
110
|
+
data['formatter'] = {
|
111
|
+
colSpan: item.colSpan
|
112
|
+
};
|
113
|
+
}
|
114
|
+
|
115
|
+
return data;
|
116
|
+
}).reduce(function (acc, cur) {
|
117
|
+
return _objectSpread(_objectSpread({}, acc), cur);
|
118
|
+
}, {});
|
119
|
+
nResult.push(itemData);
|
120
|
+
}
|
121
|
+
|
122
|
+
return nResult;
|
123
|
+
}, [loading]);
|
124
|
+
|
125
|
+
var setCellProps = function setCellProps(rowIndex, colIndex, dataIndex, record) {
|
126
|
+
if (colIndex % 2 === 0) {
|
127
|
+
return {
|
128
|
+
className: 'key-type'
|
129
|
+
};
|
130
|
+
}
|
131
|
+
|
132
|
+
if (record.formatter) {
|
133
|
+
if (record.formatter.colSpan) {
|
134
|
+
if (colIndex === record.formatter.colSpan) {
|
135
|
+
return {
|
136
|
+
colSpan: record.formatter.colSpan
|
137
|
+
};
|
138
|
+
}
|
139
|
+
|
140
|
+
var length = Object.keys(record).length;
|
141
|
+
|
142
|
+
if (length <= 3) {
|
143
|
+
return {
|
144
|
+
colSpan: record.formatter.colSpan
|
145
|
+
};
|
146
|
+
}
|
147
|
+
|
148
|
+
if (length > 5) {
|
149
|
+
return {
|
150
|
+
colSpan: record.formatter.colSpan
|
151
|
+
};
|
152
|
+
}
|
153
|
+
}
|
154
|
+
|
155
|
+
return {
|
156
|
+
rowSpan: record.formatter.rowSpan
|
157
|
+
};
|
158
|
+
}
|
159
|
+
};
|
160
|
+
|
161
|
+
return /*#__PURE__*/React.createElement(ProCard, _objectSpread({
|
162
|
+
compacted: true,
|
163
|
+
hoveredShadow: false,
|
164
|
+
bordered: false
|
165
|
+
}, header), /*#__PURE__*/React.createElement(Table.StickyLock, {
|
166
|
+
className: "teamix-pro-info-table",
|
167
|
+
cellProps: setCellProps,
|
168
|
+
columns: newColumns(),
|
169
|
+
hasHeader: false,
|
170
|
+
hasBorder: true,
|
171
|
+
dataSource: newDataSource
|
172
|
+
}));
|
173
|
+
};
|
174
|
+
|
175
|
+
export default ProTableInfo;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
.teamix-pro-info-table {
|
2
|
+
text-align: center;
|
3
|
+
width: 100%;
|
4
|
+
color: var(--color-brand1-6);
|
5
|
+
.next-table td .next-table-cell-wrapper {
|
6
|
+
padding: 16px 24px;
|
7
|
+
}
|
8
|
+
.next-table-row.hovered {
|
9
|
+
background-color:var(--color-fill1-1);
|
10
|
+
}
|
11
|
+
.next-table-row {
|
12
|
+
color: var(--color-text1-3, #333333);
|
13
|
+
}
|
14
|
+
.key-type {
|
15
|
+
background: var(--color-fill1-2);
|
16
|
+
color: var(--color-text1-6, #666);
|
17
|
+
}
|
18
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import './index.scss';
|
3
|
+
import { ProInfoProps } from './typing';
|
4
|
+
export * from './typing';
|
5
|
+
declare const ProInfo: {
|
6
|
+
(props: ProInfoProps): JSX.Element;
|
7
|
+
Group: React.FC<import("./typing").InfoGroupProps>;
|
8
|
+
ProInfoGroup: React.FC<import("./typing").InfoGroupProps>;
|
9
|
+
};
|
10
|
+
export default ProInfo;
|
package/es/info/index.js
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
var _excluded = ["type", "url", "method", "formatResult", "params", "actionRef", "header"];
|
2
|
+
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
4
|
+
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
6
|
+
|
7
|
+
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; }
|
8
|
+
|
9
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
10
|
+
|
11
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
12
|
+
|
13
|
+
import React, { useContext, useRef } from 'react';
|
14
|
+
import ProTableInfo from './components/tableInfo';
|
15
|
+
import ProHeaderInfo from './components/headerInfo';
|
16
|
+
import ProBaseInfo from './components/baseInfo';
|
17
|
+
import ProInfoGroup from './components/InfoGroup';
|
18
|
+
import './index.scss';
|
19
|
+
import useInfoRequest from './utils/useInfoRequest';
|
20
|
+
import { ProInfoGroupContext, useActionType } from './utils';
|
21
|
+
export * from './typing';
|
22
|
+
|
23
|
+
var ProInfo = function ProInfo(props) {
|
24
|
+
var type = props.type,
|
25
|
+
url = props.url,
|
26
|
+
method = props.method,
|
27
|
+
formatResult = props.formatResult,
|
28
|
+
params = props.params,
|
29
|
+
propsActionRef = props.actionRef,
|
30
|
+
_props$header = props.header,
|
31
|
+
header = _props$header === void 0 ? {} : _props$header,
|
32
|
+
others = _objectWithoutProperties(props, _excluded);
|
33
|
+
|
34
|
+
var context = useContext(ProInfoGroupContext); // 请求数据
|
35
|
+
|
36
|
+
var _ref = context.visible ? context : useInfoRequest({
|
37
|
+
url: url,
|
38
|
+
method: method,
|
39
|
+
params: params,
|
40
|
+
formatResult: formatResult
|
41
|
+
}),
|
42
|
+
loading = _ref.loading,
|
43
|
+
result = _ref.result,
|
44
|
+
_refresh = _ref.refresh;
|
45
|
+
|
46
|
+
var actionRef = useRef(); // 将 Actions 绑定到传入的 propsActionRef 中
|
47
|
+
|
48
|
+
if (propsActionRef) {
|
49
|
+
propsActionRef.current = actionRef.current;
|
50
|
+
} // 绑定 Actions
|
51
|
+
|
52
|
+
|
53
|
+
useActionType(actionRef, {
|
54
|
+
refresh: function refresh() {
|
55
|
+
_refresh === null || _refresh === void 0 ? void 0 : _refresh();
|
56
|
+
}
|
57
|
+
});
|
58
|
+
|
59
|
+
if (type === 'table') {
|
60
|
+
return /*#__PURE__*/React.createElement(ProTableInfo, _objectSpread(_objectSpread({}, others), {}, {
|
61
|
+
header: header,
|
62
|
+
loading: loading,
|
63
|
+
result: result,
|
64
|
+
actionRef: actionRef
|
65
|
+
}));
|
66
|
+
}
|
67
|
+
|
68
|
+
if (type === 'header') {
|
69
|
+
return /*#__PURE__*/React.createElement(ProHeaderInfo, _objectSpread(_objectSpread({}, others), {}, {
|
70
|
+
header: header,
|
71
|
+
loading: loading,
|
72
|
+
result: result,
|
73
|
+
actionRef: actionRef
|
74
|
+
}));
|
75
|
+
}
|
76
|
+
|
77
|
+
return /*#__PURE__*/React.createElement(ProBaseInfo, _objectSpread(_objectSpread({}, others), {}, {
|
78
|
+
header: header,
|
79
|
+
loading: loading,
|
80
|
+
result: result,
|
81
|
+
actionRef: actionRef
|
82
|
+
}));
|
83
|
+
};
|
84
|
+
|
85
|
+
ProInfo.Group = ProInfoGroup;
|
86
|
+
ProInfo.ProInfoGroup = ProInfoGroup;
|
87
|
+
export default ProInfo;
|
@@ -0,0 +1,157 @@
|
|
1
|
+
import { IProFieldFormatterProps, IProFieldOptionItem, IProFieldProps, IProFieldType, IProFieldValueEnum } from '../field';
|
2
|
+
import { ActionGroupProps, IActionButton } from '../actions';
|
3
|
+
import { Method } from 'axios';
|
4
|
+
import React from 'react';
|
5
|
+
import { CardProps } from '../card';
|
6
|
+
import { IUseInfoRequestResult } from './utils/useInfoRequest';
|
7
|
+
/** ProInfoBaseProps info 基础定义 */
|
8
|
+
export declare type ProInfoBaseProps = {
|
9
|
+
/** ProColums 定义,取代 Table 的 columns */
|
10
|
+
columns: ProInfoItemProps[];
|
11
|
+
/** 请求地址 */
|
12
|
+
url?: string;
|
13
|
+
/** 请求方法 */
|
14
|
+
method?: Method;
|
15
|
+
/** 请求参数 */
|
16
|
+
params?: object;
|
17
|
+
/** 对返回值的 data 进行映射处理 */
|
18
|
+
formatResult?: {
|
19
|
+
[key: string]: any;
|
20
|
+
} | ((res: any) => {
|
21
|
+
[key: string]: any;
|
22
|
+
});
|
23
|
+
/** 请求成功后经过 formatResult 转换后的回调 */
|
24
|
+
onFormatResult?: (data: any[]) => void;
|
25
|
+
/** 内部请求每次成功后的回调 */
|
26
|
+
onSuccess?: (res: any) => void;
|
27
|
+
/** 内部请求失败时的回调 */
|
28
|
+
onError?: (error: Error) => void;
|
29
|
+
/** ProInfo action 的引用,便于手动触发一些方法 */
|
30
|
+
actionRef?: React.MutableRefObject<ProInfoActionType | undefined>;
|
31
|
+
/** 标题区 */
|
32
|
+
header?: ProInfoHeaderProps;
|
33
|
+
/** info 数据源 */
|
34
|
+
dataSource?: {
|
35
|
+
[key: string]: any;
|
36
|
+
};
|
37
|
+
/** 布局值 */
|
38
|
+
layout?: BaseInfoLayoutProps;
|
39
|
+
};
|
40
|
+
/** ProInfoItemProps info 单元格 定义 */
|
41
|
+
export interface ProInfoItemProps {
|
42
|
+
/** 标题 */
|
43
|
+
title: string;
|
44
|
+
/** 列表项展示的Tooltip */
|
45
|
+
tooltip?: string;
|
46
|
+
/**
|
47
|
+
* title 之后展示一个 icon 设置,可传 TeamixIcon 对应的 type,也可以是自定义 Icon
|
48
|
+
*/
|
49
|
+
tooltipIcon?: React.ReactNode;
|
50
|
+
/** 对应 ProField 里面的 type */
|
51
|
+
valueType?: IProFieldType;
|
52
|
+
/** 渲染单元格内容字段 */
|
53
|
+
render?: IProFieldFormatterProps;
|
54
|
+
/** 枚举值 */
|
55
|
+
dataSource?: IProFieldValueEnum | IProFieldOptionItem[];
|
56
|
+
/** 表头的筛选菜单项,当值为 true 时,自动使用 dataSource 生成 */
|
57
|
+
filters?: boolean;
|
58
|
+
/** 操作组配置 */
|
59
|
+
actionSchema?: ActionGroupProps;
|
60
|
+
/** 指定列对应的字段,支持`a.b`形式的快速取值 和 数组取值 */
|
61
|
+
dataIndex?: string | string[];
|
62
|
+
/** 合并行 */
|
63
|
+
colSpan?: number;
|
64
|
+
/** 是否可被编辑 */
|
65
|
+
isEdit?: boolean;
|
66
|
+
/** 点击确定的回调函数 */
|
67
|
+
editOnOk?: (form: any, e: React.MouseEvent) => void | Promise<any>;
|
68
|
+
/** 点击取消的回调函数 */
|
69
|
+
editOnCancel?: (form: any, e: React.MouseEvent) => void | Promise<any>;
|
70
|
+
/** 请求地址 */
|
71
|
+
editUrl?: string;
|
72
|
+
/** 请求方法 */
|
73
|
+
editMethod?: Method;
|
74
|
+
/** 如需自定义调用参数格式,则可以设定此值在请求前对 params 进行自定义,如果返回false则可以阻止请求 */
|
75
|
+
editFormatParams?: (params: any, record: any) => typeof params;
|
76
|
+
/** 编辑请求成功提示文案 */
|
77
|
+
successMessage?: string;
|
78
|
+
/** 列 actions 配置 */
|
79
|
+
actions?: IActionButton[];
|
80
|
+
/** 追加在列后 */
|
81
|
+
extra?: React.ReactNode;
|
82
|
+
}
|
83
|
+
export declare type ProInfoActionType = {
|
84
|
+
/** 刷新Info */
|
85
|
+
refresh?: (params?: any) => void;
|
86
|
+
};
|
87
|
+
/** FormItem 定义 */
|
88
|
+
export declare type IProFieldFormItem = {
|
89
|
+
/** label */
|
90
|
+
label: React.ReactNode;
|
91
|
+
/** 值 */
|
92
|
+
value: React.ReactNode;
|
93
|
+
/** 基础详情布局值 */
|
94
|
+
baseInfoLayout?: BaseInfoLayoutProps;
|
95
|
+
/** 头部详情布局值 */
|
96
|
+
headerInfoLayout?: HeaderInfoLayoutProps;
|
97
|
+
/** loading 状态 */
|
98
|
+
loading?: boolean;
|
99
|
+
} & Pick<ProInfoItemProps, 'tooltip' | 'tooltipIcon'>;
|
100
|
+
/** header info 定义 */
|
101
|
+
export declare type IProHeaderInfo = {
|
102
|
+
/** 布局值 */
|
103
|
+
layout?: HeaderInfoLayoutProps;
|
104
|
+
} & Omit<ProInfoBaseProps, 'layout'>;
|
105
|
+
/** table info 定义 */
|
106
|
+
export declare type IProTableInfo = {
|
107
|
+
/** 布局值 */
|
108
|
+
layout?: TableInfoLayoutProps;
|
109
|
+
} & Omit<ProInfoBaseProps, 'layout'>;
|
110
|
+
/** ProInfo */
|
111
|
+
export declare type ProInfoProps = {
|
112
|
+
/** 布局值 */
|
113
|
+
layout?: TableInfoLayoutProps | HeaderInfoLayoutProps | BaseInfoLayoutProps;
|
114
|
+
/** 类型 */
|
115
|
+
type?: 'base' | 'header' | 'table';
|
116
|
+
} & Omit<ProInfoBaseProps, 'layout'>;
|
117
|
+
export declare type IProHeaderInfoItem = {};
|
118
|
+
export declare type BaseInfoLayoutProps = {
|
119
|
+
labelCol: {
|
120
|
+
span: number;
|
121
|
+
};
|
122
|
+
wrapperCol: {
|
123
|
+
span: number;
|
124
|
+
};
|
125
|
+
};
|
126
|
+
export declare type HeaderInfoLayoutProps = {
|
127
|
+
/** label 间隔 */
|
128
|
+
labelGutter?: number | string;
|
129
|
+
/** 列数 宽度 */
|
130
|
+
colNum?: number;
|
131
|
+
};
|
132
|
+
/** infoGroup */
|
133
|
+
export declare type InfoGroupProps = {
|
134
|
+
children?: React.ReactNode[] | React.ReactNode;
|
135
|
+
} & Pick<ProInfoBaseProps, 'params' | 'method' | 'url' | 'onSuccess' | 'onError' | 'formatResult'>;
|
136
|
+
export declare type TableInfoLayoutProps = {} & HeaderInfoLayoutProps;
|
137
|
+
export declare type InfoValueItemProps = {
|
138
|
+
infoItem: ProInfoItemProps;
|
139
|
+
record: any;
|
140
|
+
actionRef?: React.MutableRefObject<ProInfoActionType | undefined>;
|
141
|
+
} & IProFieldProps;
|
142
|
+
export declare type ProInfoHeaderProps = {
|
143
|
+
extra?: CardProps['extra'] | IActionButton[];
|
144
|
+
} & Omit<CardProps, 'extra'>;
|
145
|
+
/** ProInfoGroupContextProps */
|
146
|
+
export declare type ProInfoGroupContextProps = {
|
147
|
+
/** 因为其他数据都为异步。visible 只用作标识 */
|
148
|
+
visible?: boolean;
|
149
|
+
result?: any;
|
150
|
+
layout?: ProInfoBaseProps['layout'];
|
151
|
+
loading?: IUseInfoRequestResult['loading'];
|
152
|
+
refresh?: IUseInfoRequestResult['refresh'];
|
153
|
+
size?: {
|
154
|
+
width?: number;
|
155
|
+
height?: number;
|
156
|
+
};
|
157
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ProInfoActionType, ProInfoGroupContextProps, ProInfoItemProps } from '../typing';
|
3
|
+
export declare function useActionType<T>(ref: React.MutableRefObject<ProInfoActionType | undefined>, action: ProInfoActionType): void;
|
4
|
+
/** ProInfoGroupContext */
|
5
|
+
export declare const ProInfoGroupContext: React.Context<ProInfoGroupContextProps>;
|
6
|
+
/**
|
7
|
+
* 获取 dataIndex 值
|
8
|
+
* @param dataIndex
|
9
|
+
* @param dataSource
|
10
|
+
* @returns
|
11
|
+
*/
|
12
|
+
export declare function getDataIndexValue(dataIndex: ProInfoItemProps['dataIndex'], dataSource: object): any;
|
@@ -0,0 +1,33 @@
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (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 = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
4
|
+
|
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; }
|
6
|
+
|
7
|
+
import { getDeepValue } from '@teamix/utils';
|
8
|
+
import React from 'react';
|
9
|
+
export function useActionType(ref, action) {
|
10
|
+
// 合并自定义事件
|
11
|
+
var userAction = _objectSpread({}, action);
|
12
|
+
|
13
|
+
ref.current = userAction;
|
14
|
+
}
|
15
|
+
/** ProInfoGroupContext */
|
16
|
+
|
17
|
+
export var ProInfoGroupContext = /*#__PURE__*/React.createContext({});
|
18
|
+
/**
|
19
|
+
* 获取 dataIndex 值
|
20
|
+
* @param dataIndex
|
21
|
+
* @param dataSource
|
22
|
+
* @returns
|
23
|
+
*/
|
24
|
+
|
25
|
+
export function getDataIndexValue(dataIndex, dataSource) {
|
26
|
+
if (Array.isArray(dataIndex)) {
|
27
|
+
return dataIndex.map(function (item) {
|
28
|
+
return getDeepValue(item !== null && item !== void 0 ? item : '', dataSource);
|
29
|
+
});
|
30
|
+
}
|
31
|
+
|
32
|
+
return getDeepValue(dataIndex !== null && dataIndex !== void 0 ? dataIndex : '', dataSource);
|
33
|
+
}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
var defaultLayoutMap = {
|
2
|
+
xs: {
|
3
|
+
span: 24,
|
4
|
+
formItemLayout: {
|
5
|
+
labelCol: {
|
6
|
+
span: 6
|
7
|
+
},
|
8
|
+
wrapperCol: {
|
9
|
+
span: 18
|
10
|
+
}
|
11
|
+
}
|
12
|
+
},
|
13
|
+
s: {
|
14
|
+
span: 24,
|
15
|
+
formItemLayout: {
|
16
|
+
labelCol: {
|
17
|
+
span: 6
|
18
|
+
},
|
19
|
+
wrapperCol: {
|
20
|
+
span: 18
|
21
|
+
}
|
22
|
+
}
|
23
|
+
},
|
24
|
+
m: {
|
25
|
+
span: 12,
|
26
|
+
formItemLayout: {
|
27
|
+
labelCol: {
|
28
|
+
span: 6
|
29
|
+
},
|
30
|
+
wrapperCol: {
|
31
|
+
span: 18
|
32
|
+
}
|
33
|
+
}
|
34
|
+
},
|
35
|
+
l: {
|
36
|
+
span: 8,
|
37
|
+
formItemLayout: {
|
38
|
+
labelCol: {
|
39
|
+
span: 6
|
40
|
+
},
|
41
|
+
wrapperCol: {
|
42
|
+
span: 18
|
43
|
+
}
|
44
|
+
}
|
45
|
+
},
|
46
|
+
xl: {
|
47
|
+
span: 6,
|
48
|
+
formItemLayout: {
|
49
|
+
labelCol: {
|
50
|
+
span: 8
|
51
|
+
},
|
52
|
+
wrapperCol: {
|
53
|
+
span: 16
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}
|
57
|
+
};
|
58
|
+
export default defaultLayoutMap;
|