@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,152 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports.default = void 0;
|
9
|
+
exports.useDialogFormAction = useDialogFormAction;
|
10
|
+
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
12
|
+
|
13
|
+
var _components = require("@alicloudfe/components");
|
14
|
+
|
15
|
+
var _form = _interopRequireWildcard(require("../form"));
|
16
|
+
|
17
|
+
var _utils = require("@teamix/utils");
|
18
|
+
|
19
|
+
var _request = require("./request");
|
20
|
+
|
21
|
+
var _dialog = _interopRequireDefault(require("./dialog"));
|
22
|
+
|
23
|
+
var _excluded = ["schema", "useFieldValuesForRequest", "initialValues", "initialRequest", "formProps", "size", "onFinish"];
|
24
|
+
|
25
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
26
|
+
|
27
|
+
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); }
|
28
|
+
|
29
|
+
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; }
|
30
|
+
|
31
|
+
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; }
|
32
|
+
|
33
|
+
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; }
|
34
|
+
|
35
|
+
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; }
|
36
|
+
|
37
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
38
|
+
|
39
|
+
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."); }
|
40
|
+
|
41
|
+
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); }
|
42
|
+
|
43
|
+
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; }
|
44
|
+
|
45
|
+
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; }
|
46
|
+
|
47
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
48
|
+
|
49
|
+
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; }
|
50
|
+
|
51
|
+
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; }
|
52
|
+
|
53
|
+
function getDefaultFormPropsByDialogSize(size) {
|
54
|
+
if (size === 'small') {
|
55
|
+
return {
|
56
|
+
layout: 'horizontal',
|
57
|
+
labelCol: 6,
|
58
|
+
wrapperCol: 18
|
59
|
+
};
|
60
|
+
}
|
61
|
+
|
62
|
+
if (size === 'medium') {
|
63
|
+
return {
|
64
|
+
layout: 'horizontal',
|
65
|
+
labelCol: 6,
|
66
|
+
wrapperCol: 18
|
67
|
+
};
|
68
|
+
}
|
69
|
+
|
70
|
+
if (size === 'large') {
|
71
|
+
return {
|
72
|
+
layout: 'horizontal',
|
73
|
+
labelCol: 4,
|
74
|
+
wrapperCol: 12
|
75
|
+
};
|
76
|
+
}
|
77
|
+
|
78
|
+
return {
|
79
|
+
layout: 'vertical',
|
80
|
+
labelCol: 24,
|
81
|
+
wrapperCol: 24
|
82
|
+
};
|
83
|
+
}
|
84
|
+
|
85
|
+
function useDialogFormAction(action, context) {
|
86
|
+
var schema = action.schema,
|
87
|
+
_action$useFieldValue = action.useFieldValuesForRequest,
|
88
|
+
useFieldValuesForRequest = _action$useFieldValue === void 0 ? true : _action$useFieldValue,
|
89
|
+
initialValues = action.initialValues,
|
90
|
+
initialRequest = action.initialRequest,
|
91
|
+
_action$formProps = action.formProps,
|
92
|
+
formProps = _action$formProps === void 0 ? {} : _action$formProps,
|
93
|
+
_action$size = action.size,
|
94
|
+
size = _action$size === void 0 ? 'small' : _action$size,
|
95
|
+
_onFinish = action.onFinish,
|
96
|
+
others = _objectWithoutProperties(action, _excluded);
|
97
|
+
|
98
|
+
var form = (0, _react.useMemo)(function () {
|
99
|
+
return (0, _form.createForm)({
|
100
|
+
initialValues: (0, _utils.getTargetValue)(initialValues, context)
|
101
|
+
});
|
102
|
+
}, []);
|
103
|
+
|
104
|
+
var _useState = (0, _react.useState)(false),
|
105
|
+
_useState2 = _slicedToArray(_useState, 2),
|
106
|
+
loading = _useState2[0],
|
107
|
+
setLoading = _useState2[1];
|
108
|
+
|
109
|
+
return (0, _dialog.default)(Object.assign({
|
110
|
+
content: /*#__PURE__*/_react.default.createElement(_components.Loading, {
|
111
|
+
visible: loading,
|
112
|
+
style: {
|
113
|
+
display: 'block'
|
114
|
+
}
|
115
|
+
}, /*#__PURE__*/_react.default.createElement(_form.default, _objectSpread(_objectSpread({
|
116
|
+
form: form,
|
117
|
+
schema: (0, _utils.getTargetValue)(schema, context)
|
118
|
+
}, getDefaultFormPropsByDialogSize(size)), (0, _utils.getTargetValue)(formProps, context)))),
|
119
|
+
size: size,
|
120
|
+
closeable: true,
|
121
|
+
extendParams: useFieldValuesForRequest ? '{{fields}}' : undefined,
|
122
|
+
beforeRequest: function beforeRequest() {
|
123
|
+
return new Promise(function (resolve) {
|
124
|
+
form.validate().then(function () {
|
125
|
+
resolve({
|
126
|
+
fields: form.values
|
127
|
+
});
|
128
|
+
}).catch(function () {
|
129
|
+
resolve(false);
|
130
|
+
});
|
131
|
+
});
|
132
|
+
},
|
133
|
+
onTrigger: function onTrigger() {
|
134
|
+
if (initialRequest) {
|
135
|
+
setLoading(true);
|
136
|
+
(0, _request.doRequest)(initialRequest, context).then(function (res) {
|
137
|
+
form.setValues(res);
|
138
|
+
setLoading(false);
|
139
|
+
}).catch(function () {
|
140
|
+
setLoading(false);
|
141
|
+
});
|
142
|
+
}
|
143
|
+
},
|
144
|
+
onFinish: function onFinish() {
|
145
|
+
form.reset();
|
146
|
+
_onFinish && _onFinish(form.values);
|
147
|
+
}
|
148
|
+
}, others), context);
|
149
|
+
}
|
150
|
+
|
151
|
+
var _default = useDialogFormAction;
|
152
|
+
exports.default = _default;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { DialogAction } from './dialog';
|
2
|
+
import { ProTableProps } from '..';
|
3
|
+
export interface DialogTableAction extends DialogAction {
|
4
|
+
schema: ProTableProps;
|
5
|
+
}
|
6
|
+
export declare function useDialogTableAction(action: DialogTableAction, context?: any): {
|
7
|
+
[x: string]: (e: import("react").MouseEvent<HTMLElement, MouseEvent>) => void;
|
8
|
+
};
|
9
|
+
export default useDialogTableAction;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
exports.useDialogTableAction = useDialogTableAction;
|
8
|
+
|
9
|
+
var _dialog = _interopRequireDefault(require("./dialog"));
|
10
|
+
|
11
|
+
var _ = require("..");
|
12
|
+
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
14
|
+
|
15
|
+
function useDialogTableAction(action, context) {
|
16
|
+
return (0, _dialog.default)(Object.assign({
|
17
|
+
component: _.ProTable,
|
18
|
+
closeable: true,
|
19
|
+
size: 'medium'
|
20
|
+
}, action), context);
|
21
|
+
}
|
22
|
+
|
23
|
+
var _default = useDialogTableAction;
|
24
|
+
exports.default = _default;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { QuickShowConfig } from '@alicloudfe/components/types/dialog';
|
3
|
+
import { quickShowDrawerProps } from '@alicloudfe/components/types/drawer';
|
4
|
+
import { LinkBase } from './link';
|
5
|
+
import { RequestAction } from './request';
|
6
|
+
export interface DialogAction extends Omit<RequestAction, 'url'>, Omit<QuickShowConfig, 'onError' | 'type'>, Omit<quickShowDrawerProps, 'trigger' | 'animation' | 'height' | 'locale' | 'onOk' | 'onCancel' | 'onError'> {
|
7
|
+
url?: string;
|
8
|
+
dialogType?: 'dialog' | 'drawer';
|
9
|
+
dialogQuickShowType?: 'alert' | 'confirm';
|
10
|
+
messageType?: 'success' | 'warning' | 'error' | 'notice' | 'help' | 'loading';
|
11
|
+
beforeRequest?: () => Promise<any>;
|
12
|
+
link?: LinkBase;
|
13
|
+
}
|
14
|
+
export declare function useDialogAction(action: DialogAction, context?: any): {
|
15
|
+
[x: string]: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
16
|
+
};
|
17
|
+
export default useDialogAction;
|
@@ -0,0 +1,219 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports.default = void 0;
|
9
|
+
exports.useDialogAction = useDialogAction;
|
10
|
+
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
12
|
+
|
13
|
+
var _reactRouterDom = require("react-router-dom");
|
14
|
+
|
15
|
+
var _components = require("@alicloudfe/components");
|
16
|
+
|
17
|
+
var _utils = require("@teamix/utils");
|
18
|
+
|
19
|
+
var _base = require("./base");
|
20
|
+
|
21
|
+
var _link = require("./link");
|
22
|
+
|
23
|
+
var _request = require("./request");
|
24
|
+
|
25
|
+
var _excluded = ["url", "method", "params", "data", "extendParams", "successMsg", "errorMsg", "formatParams", "formatResult", "onSuccess", "onError"],
|
26
|
+
_excluded2 = ["title", "content", "component", "schema", "onFinish", "dialogType", "dialogQuickShowType", "messageType", "beforeRequest", "onTrigger", "link"];
|
27
|
+
|
28
|
+
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); }
|
29
|
+
|
30
|
+
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; }
|
31
|
+
|
32
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
33
|
+
|
34
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
35
|
+
|
36
|
+
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; }
|
37
|
+
|
38
|
+
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; }
|
39
|
+
|
40
|
+
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; }
|
41
|
+
|
42
|
+
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; }
|
43
|
+
|
44
|
+
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; }
|
45
|
+
|
46
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
47
|
+
|
48
|
+
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."); }
|
49
|
+
|
50
|
+
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); }
|
51
|
+
|
52
|
+
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; }
|
53
|
+
|
54
|
+
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; }
|
55
|
+
|
56
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
57
|
+
|
58
|
+
function addContextForReactNode(content, context) {
|
59
|
+
if (typeof content === 'function' && context) {
|
60
|
+
return content(context);
|
61
|
+
}
|
62
|
+
|
63
|
+
return content;
|
64
|
+
} // 弹窗 -> 请求(点击确认,发送数据请求)
|
65
|
+
|
66
|
+
|
67
|
+
function useDialogAction(action, context) {
|
68
|
+
var _useState = (0, _react.useState)(false),
|
69
|
+
_useState2 = _slicedToArray(_useState, 2),
|
70
|
+
loading = _useState2[0],
|
71
|
+
setLoading = _useState2[1];
|
72
|
+
|
73
|
+
var history = (0, _reactRouterDom.useHistory)();
|
74
|
+
return _objectSpread({}, (0, _base.eventHandler)(action, function () {
|
75
|
+
var url = action.url,
|
76
|
+
method = action.method,
|
77
|
+
params = action.params,
|
78
|
+
data = action.data,
|
79
|
+
extendParams = action.extendParams,
|
80
|
+
successMsg = action.successMsg,
|
81
|
+
errorMsg = action.errorMsg,
|
82
|
+
formatParams = action.formatParams,
|
83
|
+
formatResult = action.formatResult,
|
84
|
+
onSuccess = action.onSuccess,
|
85
|
+
onError = action.onError,
|
86
|
+
others = _objectWithoutProperties(action, _excluded);
|
87
|
+
|
88
|
+
var _getTargetValue = (0, _utils.getTargetValue)(others, context),
|
89
|
+
title = _getTargetValue.title,
|
90
|
+
content = _getTargetValue.content,
|
91
|
+
Component = _getTargetValue.component,
|
92
|
+
schema = _getTargetValue.schema,
|
93
|
+
onFinish = _getTargetValue.onFinish,
|
94
|
+
dialogType = _getTargetValue.dialogType,
|
95
|
+
dialogQuickShowType = _getTargetValue.dialogQuickShowType,
|
96
|
+
_getTargetValue$messa = _getTargetValue.messageType,
|
97
|
+
messageType = _getTargetValue$messa === void 0 ? 'notice' : _getTargetValue$messa,
|
98
|
+
beforeRequest = _getTargetValue.beforeRequest,
|
99
|
+
onTrigger = _getTargetValue.onTrigger,
|
100
|
+
link = _getTargetValue.link,
|
101
|
+
dialogOtherProps = _objectWithoutProperties(_getTargetValue, _excluded2);
|
102
|
+
|
103
|
+
var dialogMethod = dialogType === 'drawer' ? _components.Drawer : _components.Dialog;
|
104
|
+
var dialogProps = dialogType === 'drawer' ? {} : {
|
105
|
+
type: dialogQuickShowType,
|
106
|
+
messageProps: {
|
107
|
+
type: messageType
|
108
|
+
}
|
109
|
+
};
|
110
|
+
|
111
|
+
var onOk = function onOk() {
|
112
|
+
return new Promise( /*#__PURE__*/function () {
|
113
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(resolve) {
|
114
|
+
var beforeRequestContext, res;
|
115
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
116
|
+
while (1) {
|
117
|
+
switch (_context.prev = _context.next) {
|
118
|
+
case 0:
|
119
|
+
if (!link) {
|
120
|
+
_context.next = 5;
|
121
|
+
break;
|
122
|
+
}
|
123
|
+
|
124
|
+
(0, _link.goToLink)(link, history);
|
125
|
+
resolve(true);
|
126
|
+
onFinish && onFinish();
|
127
|
+
return _context.abrupt("return");
|
128
|
+
|
129
|
+
case 5:
|
130
|
+
if (!beforeRequest) {
|
131
|
+
_context.next = 13;
|
132
|
+
break;
|
133
|
+
}
|
134
|
+
|
135
|
+
_context.next = 8;
|
136
|
+
return beforeRequest();
|
137
|
+
|
138
|
+
case 8:
|
139
|
+
res = _context.sent;
|
140
|
+
|
141
|
+
if (!(res === false)) {
|
142
|
+
_context.next = 12;
|
143
|
+
break;
|
144
|
+
}
|
145
|
+
|
146
|
+
resolve(false);
|
147
|
+
return _context.abrupt("return");
|
148
|
+
|
149
|
+
case 12:
|
150
|
+
beforeRequestContext = res;
|
151
|
+
|
152
|
+
case 13:
|
153
|
+
if (url) {
|
154
|
+
_context.next = 17;
|
155
|
+
break;
|
156
|
+
}
|
157
|
+
|
158
|
+
resolve(true);
|
159
|
+
onFinish && onFinish();
|
160
|
+
return _context.abrupt("return");
|
161
|
+
|
162
|
+
case 17:
|
163
|
+
setLoading(true);
|
164
|
+
_context.prev = 18;
|
165
|
+
_context.next = 21;
|
166
|
+
return (0, _request.doRequest)(action, Object.assign({}, context, beforeRequestContext));
|
167
|
+
|
168
|
+
case 21:
|
169
|
+
setLoading(false);
|
170
|
+
resolve(true);
|
171
|
+
onFinish && onFinish();
|
172
|
+
_context.next = 30;
|
173
|
+
break;
|
174
|
+
|
175
|
+
case 26:
|
176
|
+
_context.prev = 26;
|
177
|
+
_context.t0 = _context["catch"](18);
|
178
|
+
setLoading(false);
|
179
|
+
resolve(false);
|
180
|
+
|
181
|
+
case 30:
|
182
|
+
case "end":
|
183
|
+
return _context.stop();
|
184
|
+
}
|
185
|
+
}
|
186
|
+
}, _callee, null, [[18, 26]]);
|
187
|
+
}));
|
188
|
+
|
189
|
+
return function (_x) {
|
190
|
+
return _ref.apply(this, arguments);
|
191
|
+
};
|
192
|
+
}());
|
193
|
+
};
|
194
|
+
|
195
|
+
var store = {
|
196
|
+
hide: function hide() {}
|
197
|
+
};
|
198
|
+
|
199
|
+
var hide = function hide() {
|
200
|
+
store.hide && store.hide();
|
201
|
+
};
|
202
|
+
|
203
|
+
var componentProps = schema ? schema : {};
|
204
|
+
var dialogContext = Object.assign({}, context, {
|
205
|
+
hide: hide
|
206
|
+
});
|
207
|
+
var ret = dialogMethod.show(_objectSpread(_objectSpread({
|
208
|
+
// @ts-ignore
|
209
|
+
onOk: onOk,
|
210
|
+
title: addContextForReactNode(title, dialogContext),
|
211
|
+
content: Component ? /*#__PURE__*/_react.default.createElement(Component, _objectSpread({}, componentProps)) : addContextForReactNode(content, dialogContext),
|
212
|
+
closeable: !loading
|
213
|
+
}, dialogProps), dialogOtherProps));
|
214
|
+
store.hide = ret.hide;
|
215
|
+
}));
|
216
|
+
}
|
217
|
+
|
218
|
+
var _default = useDialogAction;
|
219
|
+
exports.default = _default;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { DialogFormAction } from './dialog-form';
|
2
|
+
export declare type DrawerFormAction = DialogFormAction;
|
3
|
+
export declare function useDrawerFormAction(action: DrawerFormAction, context?: any): {
|
4
|
+
[x: string]: (e: import("react").MouseEvent<HTMLElement, MouseEvent>) => void;
|
5
|
+
};
|
6
|
+
export default useDrawerFormAction;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
exports.useDrawerFormAction = useDrawerFormAction;
|
8
|
+
|
9
|
+
var _dialogForm = require("./dialog-form");
|
10
|
+
|
11
|
+
function useDrawerFormAction(action, context) {
|
12
|
+
return (0, _dialogForm.useDialogFormAction)(Object.assign({
|
13
|
+
dialogType: 'drawer'
|
14
|
+
}, action), context);
|
15
|
+
}
|
16
|
+
|
17
|
+
var _default = useDrawerFormAction;
|
18
|
+
exports.default = _default;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { DialogTableAction } from './dialog-table';
|
2
|
+
export declare type DrawerTableAction = DialogTableAction;
|
3
|
+
export declare function useDrawerTableAction(action: DrawerTableAction, context?: any): {
|
4
|
+
[x: string]: (e: import("react").MouseEvent<HTMLElement, MouseEvent>) => void;
|
5
|
+
};
|
6
|
+
export default useDrawerTableAction;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
exports.useDrawerTableAction = useDrawerTableAction;
|
8
|
+
|
9
|
+
var _dialogTable = require("./dialog-table");
|
10
|
+
|
11
|
+
function useDrawerTableAction(action, context) {
|
12
|
+
return (0, _dialogTable.useDialogTableAction)(Object.assign({
|
13
|
+
dialogType: 'drawer'
|
14
|
+
}, action), context);
|
15
|
+
}
|
16
|
+
|
17
|
+
var _default = useDrawerTableAction;
|
18
|
+
exports.default = _default;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { DialogAction } from './dialog';
|
2
|
+
export declare type DrawerAction = Omit<DialogAction, 'dialogQuickShowType' | 'messageType'>;
|
3
|
+
export declare function useDrawerAction(action: DrawerAction, context?: any): {
|
4
|
+
[x: string]: (e: import("react").MouseEvent<HTMLElement, MouseEvent>) => void;
|
5
|
+
};
|
6
|
+
export default useDrawerAction;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
exports.useDrawerAction = useDrawerAction;
|
8
|
+
|
9
|
+
var _dialog = _interopRequireDefault(require("./dialog"));
|
10
|
+
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
12
|
+
|
13
|
+
function useDrawerAction(action, context) {
|
14
|
+
return (0, _dialog.default)(Object.assign({
|
15
|
+
dialogType: 'drawer'
|
16
|
+
}, action), context);
|
17
|
+
}
|
18
|
+
|
19
|
+
var _default = useDrawerAction;
|
20
|
+
exports.default = _default;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { DialogAction } from './dialog';
|
2
|
+
export interface ErrorAction extends DialogAction {
|
3
|
+
}
|
4
|
+
export declare function useErrorAction(action: DialogAction, context?: any): {
|
5
|
+
[x: string]: (e: import("react").MouseEvent<HTMLElement, MouseEvent>) => void;
|
6
|
+
};
|
7
|
+
export default useErrorAction;
|
@@ -0,0 +1,25 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
exports.useErrorAction = useErrorAction;
|
8
|
+
|
9
|
+
var _utils = require("@teamix/utils");
|
10
|
+
|
11
|
+
var _dialog = _interopRequireDefault(require("./dialog"));
|
12
|
+
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
14
|
+
|
15
|
+
function useErrorAction(action, context) {
|
16
|
+
return (0, _dialog.default)((0, _utils.deepMerge)({
|
17
|
+
dialogQuickShowType: 'confirm',
|
18
|
+
messageProps: {
|
19
|
+
type: 'error'
|
20
|
+
}
|
21
|
+
}, action), context);
|
22
|
+
}
|
23
|
+
|
24
|
+
var _default = useErrorAction;
|
25
|
+
exports.default = _default;
|
@@ -0,0 +1,71 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ButtonProps } from '@alicloudfe/components/types/button';
|
3
|
+
import { MenuButtonProps } from '@alicloudfe/components/types/menu-button';
|
4
|
+
import { LinkAction } from './link';
|
5
|
+
import { RequestAction } from './request';
|
6
|
+
import { DialogAction } from './dialog';
|
7
|
+
import { ConfirmAction } from './confirm';
|
8
|
+
import { DangerConfirmAction } from './danger-confirm';
|
9
|
+
import { NoticeAction } from './notice';
|
10
|
+
import { ErrorAction } from './error';
|
11
|
+
import { DialogFormAction } from './dialog-form';
|
12
|
+
import { DialogTableAction } from './dialog-table';
|
13
|
+
import { DrawerAction } from './drawer';
|
14
|
+
import { DrawerFormAction } from './drawer-form';
|
15
|
+
import { DrawerTableAction } from './drawer-table';
|
16
|
+
import './index.scss';
|
17
|
+
export declare type ActionConfig = ({
|
18
|
+
type: 'link';
|
19
|
+
} & LinkAction) | ({
|
20
|
+
type: 'request';
|
21
|
+
} & RequestAction) | ({
|
22
|
+
type: 'dialog';
|
23
|
+
} & DialogAction) | ({
|
24
|
+
type: 'confirm';
|
25
|
+
} & ConfirmAction) | ({
|
26
|
+
type: 'danger-confirm';
|
27
|
+
} & DangerConfirmAction) | ({
|
28
|
+
type: 'notice';
|
29
|
+
} & NoticeAction) | ({
|
30
|
+
type: 'error';
|
31
|
+
} & ErrorAction) | ({
|
32
|
+
type: 'dialog-form';
|
33
|
+
} & DialogFormAction) | ({
|
34
|
+
type: 'drawer';
|
35
|
+
} & DrawerAction) | ({
|
36
|
+
type: 'drawer-form';
|
37
|
+
} & DrawerFormAction) | ({
|
38
|
+
type: 'dialog-table';
|
39
|
+
} & DialogTableAction) | ({
|
40
|
+
type: 'drawer-table';
|
41
|
+
} & DrawerTableAction);
|
42
|
+
export declare function registerActionHandler(id: string, extendActionId: string, defaultConfig: any): void;
|
43
|
+
export declare const useAction: any;
|
44
|
+
export interface IActionButton extends ButtonProps {
|
45
|
+
config?: ActionConfig;
|
46
|
+
visible?: any;
|
47
|
+
disabled?: any;
|
48
|
+
icon?: string;
|
49
|
+
context?: any;
|
50
|
+
onClick?: (event: React.MouseEvent<Element, MouseEvent>, context?: any) => void;
|
51
|
+
}
|
52
|
+
export declare const ActionButton: (props: IActionButton) => JSX.Element;
|
53
|
+
export interface IActionMenuButton extends MenuButtonProps {
|
54
|
+
actions: ICommonActionButton[];
|
55
|
+
visible?: any;
|
56
|
+
icon?: string;
|
57
|
+
context?: any;
|
58
|
+
}
|
59
|
+
export declare const ActionMenuButton: (props: IActionMenuButton) => JSX.Element;
|
60
|
+
export declare type ICommonActionButton = IActionButton | IActionMenuButton;
|
61
|
+
export declare type ActionGroupProps = {
|
62
|
+
type?: 'button' | 'text';
|
63
|
+
context?: any;
|
64
|
+
actions: ICommonActionButton[];
|
65
|
+
max?: number;
|
66
|
+
moreText?: string;
|
67
|
+
divider?: boolean;
|
68
|
+
} & React.HTMLAttributes<HTMLElement>;
|
69
|
+
export declare function ActionGroup(props: ActionGroupProps): JSX.Element;
|
70
|
+
declare const _default: (props: ICommonActionButton) => JSX.Element;
|
71
|
+
export default _default;
|