@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,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;
|
@@ -0,0 +1,337 @@
|
|
1
|
+
var _excluded = ["type"],
|
2
|
+
_excluded2 = ["config", "icon", "iconSize", "type", "context", "children", "visible", "onClick"],
|
3
|
+
_excluded3 = ["loading"],
|
4
|
+
_excluded4 = ["icon", "iconSize", "label", "actions", "children", "context", "type"],
|
5
|
+
_excluded5 = ["context", "text"],
|
6
|
+
_excluded6 = ["actions"],
|
7
|
+
_excluded7 = ["config"],
|
8
|
+
_excluded8 = ["type", "divider", "max", "moreText", "context", "actions", "className"];
|
9
|
+
|
10
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
11
|
+
|
12
|
+
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."); }
|
13
|
+
|
14
|
+
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); }
|
15
|
+
|
16
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
17
|
+
|
18
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
19
|
+
|
20
|
+
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; }
|
21
|
+
|
22
|
+
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; }
|
23
|
+
|
24
|
+
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; }
|
25
|
+
|
26
|
+
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; }
|
27
|
+
|
28
|
+
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; }
|
29
|
+
|
30
|
+
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; }
|
31
|
+
|
32
|
+
import React from 'react';
|
33
|
+
import cls from 'classnames';
|
34
|
+
import { Button, MenuButton, Menu, Divider } from '@alicloudfe/components';
|
35
|
+
import Icon from '@teamix/icon';
|
36
|
+
import { getTargetValue } from '@teamix/utils';
|
37
|
+
import { useLinkAction } from './link';
|
38
|
+
import { useRequestAction } from './request';
|
39
|
+
import { useDialogAction } from './dialog';
|
40
|
+
import { useConfirmAction } from './confirm';
|
41
|
+
import { useDangerConfirmAction } from './danger-confirm';
|
42
|
+
import { useNoticeAction } from './notice';
|
43
|
+
import { useErrorAction } from './error';
|
44
|
+
import { useDialogFormAction } from './dialog-form';
|
45
|
+
import { useDialogTableAction } from './dialog-table';
|
46
|
+
import { useDrawerAction } from './drawer';
|
47
|
+
import { useDrawerFormAction } from './drawer-form';
|
48
|
+
import { useDrawerTableAction } from './drawer-table';
|
49
|
+
import './index.scss';
|
50
|
+
var RegistedActions = new Map();
|
51
|
+
export function registerActionHandler(id, extendActionId, defaultConfig) {
|
52
|
+
RegistedActions.set(id, {
|
53
|
+
extendActionId: extendActionId,
|
54
|
+
defaultConfig: defaultConfig
|
55
|
+
});
|
56
|
+
}
|
57
|
+
export var useAction = function useAction(config, context) {
|
58
|
+
if (!config) {
|
59
|
+
return {};
|
60
|
+
}
|
61
|
+
|
62
|
+
var type = config.type,
|
63
|
+
others = _objectWithoutProperties(config, _excluded);
|
64
|
+
|
65
|
+
if (type === 'request') {
|
66
|
+
return useRequestAction(others, context);
|
67
|
+
}
|
68
|
+
|
69
|
+
if (type === 'link') {
|
70
|
+
return useLinkAction(others, context);
|
71
|
+
}
|
72
|
+
|
73
|
+
if (type === 'dialog') {
|
74
|
+
return useDialogAction(others, context);
|
75
|
+
}
|
76
|
+
|
77
|
+
if (type === 'confirm') {
|
78
|
+
return useConfirmAction(others, context);
|
79
|
+
}
|
80
|
+
|
81
|
+
if (type === 'danger-confirm') {
|
82
|
+
return useDangerConfirmAction(others, context);
|
83
|
+
}
|
84
|
+
|
85
|
+
if (type === 'notice') {
|
86
|
+
return useNoticeAction(others, context);
|
87
|
+
}
|
88
|
+
|
89
|
+
if (type === 'error') {
|
90
|
+
return useErrorAction(others, context);
|
91
|
+
}
|
92
|
+
|
93
|
+
if (type === 'dialog-form') {
|
94
|
+
return useDialogFormAction(others, context);
|
95
|
+
}
|
96
|
+
|
97
|
+
if (type === 'dialog-table') {
|
98
|
+
return useDialogTableAction(others, context);
|
99
|
+
}
|
100
|
+
|
101
|
+
if (type === 'drawer') {
|
102
|
+
return useDrawerAction(others, context);
|
103
|
+
}
|
104
|
+
|
105
|
+
if (type === 'drawer-form') {
|
106
|
+
return useDrawerFormAction(others, context);
|
107
|
+
}
|
108
|
+
|
109
|
+
if (type === 'drawer-table') {
|
110
|
+
return useDrawerTableAction(others, context);
|
111
|
+
}
|
112
|
+
|
113
|
+
var registedAction = RegistedActions.get(type);
|
114
|
+
|
115
|
+
if (!registedAction) {
|
116
|
+
return {};
|
117
|
+
}
|
118
|
+
|
119
|
+
return useAction(_objectSpread(_objectSpread({
|
120
|
+
type: registedAction.extendActionId
|
121
|
+
}, registedAction.defaultConfig), others), context);
|
122
|
+
};
|
123
|
+
|
124
|
+
var buttonContent = function buttonContent(content, iconType, iconSize) {
|
125
|
+
if (!iconType) {
|
126
|
+
return content;
|
127
|
+
}
|
128
|
+
|
129
|
+
return [/*#__PURE__*/React.createElement(Icon, {
|
130
|
+
type: iconType,
|
131
|
+
size: iconSize,
|
132
|
+
key: "teamix-button-icon"
|
133
|
+
}), content];
|
134
|
+
};
|
135
|
+
|
136
|
+
export var ActionButton = function ActionButton(props) {
|
137
|
+
var config = props.config,
|
138
|
+
icon = props.icon,
|
139
|
+
_props$iconSize = props.iconSize,
|
140
|
+
iconSize = _props$iconSize === void 0 ? 'medium' : _props$iconSize,
|
141
|
+
_props$type = props.type,
|
142
|
+
type = _props$type === void 0 ? 'primary' : _props$type,
|
143
|
+
context = props.context,
|
144
|
+
children = props.children,
|
145
|
+
visible = props.visible,
|
146
|
+
_onClick = props.onClick,
|
147
|
+
others = _objectWithoutProperties(props, _excluded2);
|
148
|
+
|
149
|
+
var actionProps = useAction(config, context);
|
150
|
+
var buttonProps = _onClick ? _objectSpread(_objectSpread(_objectSpread({}, actionProps), others), {}, {
|
151
|
+
onClick: function onClick(e) {
|
152
|
+
return _onClick(e, context);
|
153
|
+
}
|
154
|
+
}) : _objectSpread(_objectSpread({}, actionProps), others);
|
155
|
+
return /*#__PURE__*/React.createElement(Button, _objectSpread({
|
156
|
+
type: type
|
157
|
+
}, buttonProps), buttonContent(children, icon, iconSize));
|
158
|
+
};
|
159
|
+
|
160
|
+
function renderMenuButtonItem(item, key, context) {
|
161
|
+
var menuItemActionConfig = Object.assign({}, item.config, {
|
162
|
+
trigger: 'onClick'
|
163
|
+
});
|
164
|
+
|
165
|
+
var _useAction = useAction(menuItemActionConfig, item.context || context),
|
166
|
+
loading = _useAction.loading,
|
167
|
+
menuItemProps = _objectWithoutProperties(_useAction, _excluded3);
|
168
|
+
|
169
|
+
var buttonProps = item.onClick ? _objectSpread(_objectSpread({}, menuItemProps), {}, {
|
170
|
+
onClick: function onClick(e) {
|
171
|
+
return item.onClick(e, context);
|
172
|
+
}
|
173
|
+
}) : _objectSpread({}, menuItemProps);
|
174
|
+
return /*#__PURE__*/React.createElement(MenuButton.Item, _objectSpread({
|
175
|
+
key: key
|
176
|
+
}, buttonProps), buttonContent(item.children, item.icon));
|
177
|
+
}
|
178
|
+
|
179
|
+
function renderCommonActionButtonMenuItem(action, key, context) {
|
180
|
+
// @ts-ignore
|
181
|
+
if (action.actions && action.actions.length) {
|
182
|
+
return /*#__PURE__*/React.createElement(Menu.SubMenu, {
|
183
|
+
key: key,
|
184
|
+
label: // @ts-ignore
|
185
|
+
action.label || action.children
|
186
|
+
}, //@ts-ignore
|
187
|
+
action.actions.map(function (a, j) {
|
188
|
+
return renderCommonActionButtonMenuItem(a, j, context);
|
189
|
+
}));
|
190
|
+
}
|
191
|
+
|
192
|
+
return renderMenuButtonItem(action, key, context);
|
193
|
+
}
|
194
|
+
|
195
|
+
export var ActionMenuButton = function ActionMenuButton(props) {
|
196
|
+
var icon = props.icon,
|
197
|
+
iconSize = props.iconSize,
|
198
|
+
label = props.label,
|
199
|
+
actions = props.actions,
|
200
|
+
children = props.children,
|
201
|
+
context = props.context,
|
202
|
+
_props$type2 = props.type,
|
203
|
+
type = _props$type2 === void 0 ? 'primary' : _props$type2,
|
204
|
+
others = _objectWithoutProperties(props, _excluded4);
|
205
|
+
|
206
|
+
return /*#__PURE__*/React.createElement(MenuButton, _objectSpread({
|
207
|
+
popupTriggerType: "hover",
|
208
|
+
menuProps: {
|
209
|
+
mode: 'popup',
|
210
|
+
triggerType: 'hover'
|
211
|
+
},
|
212
|
+
type: type,
|
213
|
+
label: buttonContent(label || children, icon, iconSize)
|
214
|
+
}, others), actions.map(function (action, i) {
|
215
|
+
return renderCommonActionButtonMenuItem(action, i, context);
|
216
|
+
}));
|
217
|
+
}; // 如果 actions 数量超过了 max,则把第 max 个和剩余超出部分折叠起来成为一个 menu
|
218
|
+
|
219
|
+
function formatGroupActions(actions, max, moreConfig) {
|
220
|
+
var MAX = max < 1 ? MAX_ACTTIONS : max;
|
221
|
+
|
222
|
+
if (actions.length <= MAX) {
|
223
|
+
return actions;
|
224
|
+
}
|
225
|
+
|
226
|
+
return [].concat(_toConsumableArray(actions.slice(0, MAX - 1)), [_objectSpread(_objectSpread({}, moreConfig), {}, {
|
227
|
+
actions: actions.slice(MAX - 1)
|
228
|
+
})]);
|
229
|
+
} // 渲染一个 button 或者 menu button
|
230
|
+
|
231
|
+
|
232
|
+
function renderCommonActionButton(button, context, isTypeText) {
|
233
|
+
var buttonContext = button.context,
|
234
|
+
text = button.text,
|
235
|
+
others = _objectWithoutProperties(button, _excluded5);
|
236
|
+
|
237
|
+
var buttonProps = _objectSpread({
|
238
|
+
context: Object.assign({}, context, buttonContext),
|
239
|
+
text: text || isTypeText
|
240
|
+
}, others); // @ts-ignore
|
241
|
+
|
242
|
+
|
243
|
+
if (!button.actions) {
|
244
|
+
return (
|
245
|
+
/*#__PURE__*/
|
246
|
+
// @ts-ignore
|
247
|
+
React.createElement(ActionButton, _objectSpread({}, buttonProps))
|
248
|
+
);
|
249
|
+
} // @ts-ignore
|
250
|
+
|
251
|
+
|
252
|
+
return /*#__PURE__*/React.createElement(ActionMenuButton, _objectSpread({}, buttonProps));
|
253
|
+
}
|
254
|
+
|
255
|
+
function getDefaultMoreButton(type, moreText) {
|
256
|
+
if (type === 'button') {
|
257
|
+
return {
|
258
|
+
label: moreText || '更多'
|
259
|
+
};
|
260
|
+
}
|
261
|
+
|
262
|
+
if (moreText) {
|
263
|
+
return {
|
264
|
+
label: moreText
|
265
|
+
};
|
266
|
+
}
|
267
|
+
|
268
|
+
return {
|
269
|
+
icon: 'more-line',
|
270
|
+
// iconSize: 'small',
|
271
|
+
autoWidth: false,
|
272
|
+
className: 'teamix-pro-actions-text-menu-btn-no-arrow'
|
273
|
+
};
|
274
|
+
}
|
275
|
+
|
276
|
+
var MAX_ACTTIONS = 4;
|
277
|
+
|
278
|
+
function getActionConfig(action, context) {
|
279
|
+
// @ts-ignore
|
280
|
+
if (action.actions) {
|
281
|
+
// @ts-ignore
|
282
|
+
var actions = action.actions,
|
283
|
+
_others = _objectWithoutProperties(action, _excluded6);
|
284
|
+
|
285
|
+
return _objectSpread({
|
286
|
+
actions: actions.map(function (a) {
|
287
|
+
return getActionConfig(a, context);
|
288
|
+
})
|
289
|
+
}, getTargetValue(_others, context));
|
290
|
+
} // @ts-ignore
|
291
|
+
|
292
|
+
|
293
|
+
var config = action.config,
|
294
|
+
others = _objectWithoutProperties(action, _excluded7);
|
295
|
+
|
296
|
+
return _objectSpread({
|
297
|
+
config: config
|
298
|
+
}, getTargetValue(others, context));
|
299
|
+
}
|
300
|
+
|
301
|
+
export function ActionGroup(props) {
|
302
|
+
var _props$type3 = props.type,
|
303
|
+
type = _props$type3 === void 0 ? 'button' : _props$type3,
|
304
|
+
_props$divider = props.divider,
|
305
|
+
divider = _props$divider === void 0 ? true : _props$divider,
|
306
|
+
_props$max = props.max,
|
307
|
+
max = _props$max === void 0 ? MAX_ACTTIONS : _props$max,
|
308
|
+
moreText = props.moreText,
|
309
|
+
context = props.context,
|
310
|
+
_props$actions = props.actions,
|
311
|
+
actions = _props$actions === void 0 ? [] : _props$actions,
|
312
|
+
className = props.className,
|
313
|
+
containerProps = _objectWithoutProperties(props, _excluded8);
|
314
|
+
|
315
|
+
var isTypeText = type === 'text';
|
316
|
+
var filteredActions = actions.map(function (action) {
|
317
|
+
return getActionConfig(action, context);
|
318
|
+
}).filter(function (action) {
|
319
|
+
return action.visible !== false;
|
320
|
+
});
|
321
|
+
var formatedActions = formatGroupActions(filteredActions, max, getDefaultMoreButton(type, moreText));
|
322
|
+
return /*#__PURE__*/React.createElement("div", _objectSpread({
|
323
|
+
className: cls('teamix-pro-actions', type, className, {
|
324
|
+
divider: divider
|
325
|
+
})
|
326
|
+
}, containerProps), formatedActions.map(function (actionBtn, i) {
|
327
|
+
var isLastOne = i === formatedActions.length - 1;
|
328
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
329
|
+
key: i
|
330
|
+
}, renderCommonActionButton(actionBtn, context, isTypeText), isTypeText && divider && !isLastOne && /*#__PURE__*/React.createElement(Divider, {
|
331
|
+
direction: "ver"
|
332
|
+
}));
|
333
|
+
}));
|
334
|
+
}
|
335
|
+
export default (function (props) {
|
336
|
+
return renderCommonActionButton(props);
|
337
|
+
});
|
@@ -0,0 +1,34 @@
|
|
1
|
+
.teamix-pro-actions {
|
2
|
+
display: flex;
|
3
|
+
align-items: center;
|
4
|
+
flex-wrap: wrap;
|
5
|
+
&.button {
|
6
|
+
& > button {
|
7
|
+
&:not(:last-child) {
|
8
|
+
margin-right: var(--s-2);
|
9
|
+
}
|
10
|
+
}
|
11
|
+
}
|
12
|
+
|
13
|
+
&.text:not(.divider) {
|
14
|
+
& > button {
|
15
|
+
&:not(:last-child) {
|
16
|
+
margin-right: var(--s-4);
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
&-text-menu-btn-no-arrow {
|
22
|
+
.next-menu-btn-arrow {
|
23
|
+
display: none;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
& > .next-divider-ver {
|
28
|
+
flex-shrink: 0;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
.next-menu-divider + .next-menu-divider {
|
33
|
+
display: none;
|
34
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { BaseAction } from './base';
|
2
|
+
export interface LinkBase {
|
3
|
+
to: string;
|
4
|
+
search?: string;
|
5
|
+
hash?: string;
|
6
|
+
blank?: boolean;
|
7
|
+
}
|
8
|
+
export interface LinkAction extends BaseAction, LinkBase {
|
9
|
+
}
|
10
|
+
export declare function goToLink(link: LinkBase, history: any): void;
|
11
|
+
export declare function useLinkAction(action: LinkAction, context?: any): {
|
12
|
+
[x: string]: (e: import("react").MouseEvent<HTMLElement, MouseEvent>) => void;
|
13
|
+
};
|
14
|
+
export default useLinkAction;
|
@@ -0,0 +1,45 @@
|
|
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 { useHistory } from 'react-router-dom';
|
8
|
+
import { getTargetValue } from '@teamix/utils';
|
9
|
+
import { eventHandler } from './base';
|
10
|
+
export function goToLink(link, history) {
|
11
|
+
var to = link.to,
|
12
|
+
search = link.search,
|
13
|
+
hash = link.hash,
|
14
|
+
blank = link.blank;
|
15
|
+
|
16
|
+
if (blank) {
|
17
|
+
window.open("".concat(to).concat(search ? "?".concat(search) : '').concat(hash ? "#".concat(hash) : ''));
|
18
|
+
return;
|
19
|
+
}
|
20
|
+
|
21
|
+
history.push({
|
22
|
+
pathname: to,
|
23
|
+
search: search,
|
24
|
+
hash: hash
|
25
|
+
});
|
26
|
+
}
|
27
|
+
export function useLinkAction(action, context) {
|
28
|
+
var history = useHistory();
|
29
|
+
|
30
|
+
var _getTargetValue = getTargetValue(action, context),
|
31
|
+
to = _getTargetValue.to,
|
32
|
+
search = _getTargetValue.search,
|
33
|
+
hash = _getTargetValue.hash,
|
34
|
+
blank = _getTargetValue.blank;
|
35
|
+
|
36
|
+
return _objectSpread({}, eventHandler(action, function () {
|
37
|
+
goToLink({
|
38
|
+
to: to,
|
39
|
+
search: search,
|
40
|
+
hash: hash,
|
41
|
+
blank: blank
|
42
|
+
}, history);
|
43
|
+
}));
|
44
|
+
}
|
45
|
+
export default useLinkAction;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { DialogAction } from './dialog';
|
2
|
+
export interface NoticeAction extends DialogAction {
|
3
|
+
}
|
4
|
+
export declare function useNoticeAction(action: DialogAction, context?: any): {
|
5
|
+
[x: string]: (e: import("react").MouseEvent<HTMLElement, MouseEvent>) => void;
|
6
|
+
};
|
7
|
+
export default useNoticeAction;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { deepMerge } from '@teamix/utils';
|
2
|
+
import useDialogAction from './dialog';
|
3
|
+
export function useNoticeAction(action, context) {
|
4
|
+
return useDialogAction(deepMerge({
|
5
|
+
dialogQuickShowType: 'confirm',
|
6
|
+
messageProps: {
|
7
|
+
type: 'notice'
|
8
|
+
}
|
9
|
+
}, action), context);
|
10
|
+
}
|
11
|
+
export default useNoticeAction;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { CommonRequestConfig } from '@teamix/utils';
|
2
|
+
import { BaseAction } from './base';
|
3
|
+
export interface RequestAction extends CommonRequestConfig, BaseAction {
|
4
|
+
}
|
5
|
+
export declare function doRequest(action: RequestAction, context?: any): Promise<unknown>;
|
6
|
+
export declare function useRequestAction(action: RequestAction, context?: any): {
|
7
|
+
loading: boolean;
|
8
|
+
};
|
9
|
+
export default useRequestAction;
|
@@ -0,0 +1,60 @@
|
|
1
|
+
var _excluded = ["method"],
|
2
|
+
_excluded2 = ["onFinish"];
|
3
|
+
|
4
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
5
|
+
|
6
|
+
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."); }
|
7
|
+
|
8
|
+
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); }
|
9
|
+
|
10
|
+
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; }
|
11
|
+
|
12
|
+
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; }
|
13
|
+
|
14
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
15
|
+
|
16
|
+
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; }
|
17
|
+
|
18
|
+
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; }
|
19
|
+
|
20
|
+
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; }
|
21
|
+
|
22
|
+
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; }
|
23
|
+
|
24
|
+
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; }
|
25
|
+
|
26
|
+
import { useState } from 'react';
|
27
|
+
import { doCommonRequest } from '@teamix/utils';
|
28
|
+
import { eventHandler } from './base'; // action 里的数据请求都默认是 post 类型
|
29
|
+
|
30
|
+
export function doRequest(action, context) {
|
31
|
+
var _action$method = action.method,
|
32
|
+
method = _action$method === void 0 ? 'post' : _action$method,
|
33
|
+
others = _objectWithoutProperties(action, _excluded);
|
34
|
+
|
35
|
+
return doCommonRequest(_objectSpread({
|
36
|
+
method: method
|
37
|
+
}, others), context);
|
38
|
+
}
|
39
|
+
export function useRequestAction(action, context) {
|
40
|
+
var _useState = useState(false),
|
41
|
+
_useState2 = _slicedToArray(_useState, 2),
|
42
|
+
loading = _useState2[0],
|
43
|
+
setLoading = _useState2[1];
|
44
|
+
|
45
|
+
var onFinish = action.onFinish,
|
46
|
+
others = _objectWithoutProperties(action, _excluded2);
|
47
|
+
|
48
|
+
return _objectSpread(_objectSpread({}, eventHandler(action, function () {
|
49
|
+
setLoading(true);
|
50
|
+
doRequest(_objectSpread({}, others), context).then(function () {
|
51
|
+
setLoading(false);
|
52
|
+
onFinish && onFinish();
|
53
|
+
}).catch(function () {
|
54
|
+
setLoading(false);
|
55
|
+
});
|
56
|
+
})), {}, {
|
57
|
+
loading: loading
|
58
|
+
});
|
59
|
+
}
|
60
|
+
export default useRequestAction;
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { IActionButton } from '../actions';
|
3
|
+
import './index.scss';
|
4
|
+
export declare type CardContainerProps = {
|
5
|
+
direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
6
|
+
spacing?: [number, number] | number;
|
7
|
+
wrap?: boolean;
|
8
|
+
} & React.HTMLAttributes<HTMLElement>;
|
9
|
+
export declare const CardContainer: React.FC<CardContainerProps>;
|
10
|
+
export interface CardProps {
|
11
|
+
/** 内容部分 */
|
12
|
+
children?: React.ReactNode;
|
13
|
+
/**卡片标题 */
|
14
|
+
title?: React.ReactNode;
|
15
|
+
/**卡片副标题 */
|
16
|
+
subTitle?: React.ReactNode;
|
17
|
+
/**额外信息区域,位于卡片右上角,可以配置一些常用轻量操作 */
|
18
|
+
extra?: React.ReactNode | IActionButton[];
|
19
|
+
/**卡片背景图 */
|
20
|
+
image?: string;
|
21
|
+
/**卡片标题下方是否有分割线 */
|
22
|
+
divider?: boolean;
|
23
|
+
/**卡片是否有边框 */
|
24
|
+
bordered?: boolean;
|
25
|
+
/**卡片在hovers时是否有阴影 */
|
26
|
+
hoveredShadow?: boolean;
|
27
|
+
/**卡片是否为紧凑模式,紧凑模式下卡片无内边距 */
|
28
|
+
compacted?: boolean;
|
29
|
+
/**卡片内容是否居中展示 */
|
30
|
+
centered?: boolean;
|
31
|
+
/**加载中状态 */
|
32
|
+
loading?: boolean;
|
33
|
+
/**背景色 */
|
34
|
+
backgroundColor?: 'blue' | 'green' | 'red' | 'orange' | 'yellow' | 'grey' | 'transparent';
|
35
|
+
/**卡片嵌套使用的模式下,卡片占父卡片内容区域的栅格数量 */
|
36
|
+
col?: number | string;
|
37
|
+
/**卡片 class */
|
38
|
+
className?: string;
|
39
|
+
/**卡片样式 */
|
40
|
+
style?: React.CSSProperties;
|
41
|
+
/**卡片内容 class */
|
42
|
+
contentClassName?: string;
|
43
|
+
/**卡片内容样式 */
|
44
|
+
contentStyle?: React.CSSProperties;
|
45
|
+
}
|
46
|
+
declare const Card: React.FC<CardProps>;
|
47
|
+
export default Card;
|