@teamix/pro 1.0.22 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all.css +1 -1
- package/dist/all.js +12421 -13334
- package/dist/all.min.css +1 -1
- package/dist/all.min.js +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 +4 -0
- package/es/actions/dialog-table.js +1 -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 +2 -0
- package/es/actions/drawer-table.js +1 -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 +76 -0
- package/es/actions/index.js +317 -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 +30 -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 +248 -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 +54 -0
- package/es/form/SchemaForm/index.d.ts +4 -0
- package/es/form/SchemaForm/index.js +258 -0
- package/es/form/SchemaForm/initializeArrayCards.d.ts +3 -0
- package/es/form/SchemaForm/initializeArrayCards.js +69 -0
- package/es/form/SchemaForm/initializeArrayCollapse.d.ts +3 -0
- package/es/form/SchemaForm/initializeArrayCollapse.js +78 -0
- package/es/form/SchemaForm/initializeArrayIcon.d.ts +3 -0
- package/es/form/SchemaForm/initializeArrayIcon.js +50 -0
- package/es/form/SchemaForm/initializeArrayItems.d.ts +3 -0
- package/es/form/SchemaForm/initializeArrayItems.js +97 -0
- package/es/form/SchemaForm/initializeArrayTable.d.ts +3 -0
- package/es/form/SchemaForm/initializeArrayTable.js +66 -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 +69 -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 +20 -0
- package/es/form/index.js +24 -0
- package/es/form/typing.d.ts +78 -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 +20 -0
- package/es/hooks/index.d.ts +2 -0
- package/es/hooks/index.js +2 -0
- package/es/index.d.ts +24 -22
- package/es/index.js +25 -23
- 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 +49 -0
- package/es/info/components/InfoGroup/index.d.ts +5 -0
- package/es/info/components/InfoGroup/index.js +16 -0
- package/es/info/components/InfoGroup/index.scss +8 -0
- package/es/info/components/InfoValueItem/index.d.ts +5 -0
- package/es/info/components/InfoValueItem/index.js +211 -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 +72 -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 +84 -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 +172 -0
- package/es/info/components/tableInfo/index.scss +18 -0
- package/es/info/index.d.ts +9 -0
- package/es/info/index.js +85 -0
- package/es/info/index.scss +8 -0
- package/es/info/typing.d.ts +143 -0
- package/es/info/typing.js +1 -0
- package/es/info/utils/index.d.ts +3 -0
- package/es/info/utils/index.js +12 -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 +3 -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 +196 -0
- package/es/nocode/configurators/ProTable.d.ts +3 -0
- package/es/nocode/configurators/ProTable.js +317 -0
- package/es/nocode/configurators/common.d.ts +176 -0
- package/es/nocode/configurators/common.js +314 -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 +42 -0
- package/es/page-header/index.js +222 -0
- package/es/page-header/index.scss +171 -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 +231 -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 +241 -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 +7 -0
- package/es/table/index.js +620 -0
- package/es/table/index.scss +104 -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 +4 -0
- package/lib/actions/dialog-table.js +5 -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 +2 -0
- package/lib/actions/drawer-table.js +5 -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 +76 -0
- package/lib/actions/index.js +356 -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 +30 -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 +248 -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 +64 -0
- package/lib/form/SchemaForm/index.d.ts +4 -0
- package/lib/form/SchemaForm/index.js +301 -0
- package/lib/form/SchemaForm/initializeArrayCards.d.ts +3 -0
- package/lib/form/SchemaForm/initializeArrayCards.js +76 -0
- package/lib/form/SchemaForm/initializeArrayCollapse.d.ts +3 -0
- package/lib/form/SchemaForm/initializeArrayCollapse.js +85 -0
- package/lib/form/SchemaForm/initializeArrayIcon.d.ts +3 -0
- package/lib/form/SchemaForm/initializeArrayIcon.js +61 -0
- package/lib/form/SchemaForm/initializeArrayItems.d.ts +3 -0
- package/lib/form/SchemaForm/initializeArrayItems.js +104 -0
- package/lib/form/SchemaForm/initializeArrayTable.d.ts +3 -0
- package/lib/form/SchemaForm/initializeArrayTable.js +73 -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 +76 -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 +20 -0
- package/lib/form/index.js +149 -0
- package/lib/form/typing.d.ts +78 -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 +28 -0
- package/lib/hooks/index.d.ts +2 -0
- package/lib/hooks/index.js +17 -0
- package/lib/index.d.ts +24 -22
- package/lib/index.js +84 -57
- 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 +49 -0
- package/lib/info/components/InfoGroup/index.d.ts +5 -0
- package/lib/info/components/InfoGroup/index.js +27 -0
- package/lib/info/components/InfoGroup/index.scss +8 -0
- package/lib/info/components/InfoValueItem/index.d.ts +5 -0
- package/lib/info/components/InfoValueItem/index.js +237 -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 +99 -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 +111 -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 +193 -0
- package/lib/info/components/tableInfo/index.scss +18 -0
- package/lib/info/index.d.ts +9 -0
- package/lib/info/index.js +121 -0
- package/lib/info/index.scss +8 -0
- package/lib/info/typing.d.ts +143 -0
- package/lib/info/typing.js +5 -0
- package/lib/info/utils/index.d.ts +3 -0
- package/lib/info/utils/index.js +19 -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 +3 -0
- package/lib/layout/index.js +30 -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 +205 -0
- package/lib/nocode/configurators/ProTable.d.ts +3 -0
- package/lib/nocode/configurators/ProTable.js +326 -0
- package/lib/nocode/configurators/common.d.ts +176 -0
- package/lib/nocode/configurators/common.js +325 -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 +42 -0
- package/lib/page-header/index.js +240 -0
- package/lib/page-header/index.scss +171 -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 +252 -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 +265 -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 +7 -0
- package/lib/table/index.js +681 -0
- package/lib/table/index.scss +104 -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 +21 -11
@@ -0,0 +1,356 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.ActionButton = void 0;
|
7
|
+
exports.ActionGroup = ActionGroup;
|
8
|
+
exports.default = exports.ActionMenuButton = void 0;
|
9
|
+
exports.registerActionHandler = registerActionHandler;
|
10
|
+
exports.useAction = void 0;
|
11
|
+
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
13
|
+
|
14
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
15
|
+
|
16
|
+
var _components = require("@alicloudfe/components");
|
17
|
+
|
18
|
+
var _icon = _interopRequireDefault(require("@teamix/icon"));
|
19
|
+
|
20
|
+
var _utils = require("@teamix/utils");
|
21
|
+
|
22
|
+
var _link = require("./link");
|
23
|
+
|
24
|
+
var _request = require("./request");
|
25
|
+
|
26
|
+
var _dialog = require("./dialog");
|
27
|
+
|
28
|
+
var _confirm = require("./confirm");
|
29
|
+
|
30
|
+
var _dangerConfirm = require("./danger-confirm");
|
31
|
+
|
32
|
+
var _notice = require("./notice");
|
33
|
+
|
34
|
+
var _error = require("./error");
|
35
|
+
|
36
|
+
var _dialogForm = require("./dialog-form");
|
37
|
+
|
38
|
+
var _drawer = require("./drawer");
|
39
|
+
|
40
|
+
var _drawerForm = require("./drawer-form");
|
41
|
+
|
42
|
+
require("./index.scss");
|
43
|
+
|
44
|
+
var _excluded = ["type"],
|
45
|
+
_excluded2 = ["config", "icon", "iconSize", "type", "context", "children", "visible", "onClick"],
|
46
|
+
_excluded3 = ["loading"],
|
47
|
+
_excluded4 = ["icon", "iconSize", "label", "actions", "children", "context", "type"],
|
48
|
+
_excluded5 = ["context", "text"],
|
49
|
+
_excluded6 = ["actions"],
|
50
|
+
_excluded7 = ["config"],
|
51
|
+
_excluded8 = ["type", "divider", "max", "moreText", "context", "actions", "className"];
|
52
|
+
|
53
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
54
|
+
|
55
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
56
|
+
|
57
|
+
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."); }
|
58
|
+
|
59
|
+
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); }
|
60
|
+
|
61
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
62
|
+
|
63
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
64
|
+
|
65
|
+
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; }
|
66
|
+
|
67
|
+
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; }
|
68
|
+
|
69
|
+
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; }
|
70
|
+
|
71
|
+
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; }
|
72
|
+
|
73
|
+
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; }
|
74
|
+
|
75
|
+
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; }
|
76
|
+
|
77
|
+
var RegistedActions = new Map();
|
78
|
+
|
79
|
+
function registerActionHandler(id, extendActionId, defaultConfig) {
|
80
|
+
RegistedActions.set(id, {
|
81
|
+
extendActionId: extendActionId,
|
82
|
+
defaultConfig: defaultConfig
|
83
|
+
});
|
84
|
+
}
|
85
|
+
|
86
|
+
var useAction = function useAction(config, context) {
|
87
|
+
if (!config) {
|
88
|
+
return {};
|
89
|
+
}
|
90
|
+
|
91
|
+
var type = config.type,
|
92
|
+
others = _objectWithoutProperties(config, _excluded);
|
93
|
+
|
94
|
+
if (type === 'request') {
|
95
|
+
return (0, _request.useRequestAction)(others, context);
|
96
|
+
}
|
97
|
+
|
98
|
+
if (type === 'link') {
|
99
|
+
return (0, _link.useLinkAction)(others, context);
|
100
|
+
}
|
101
|
+
|
102
|
+
if (type === 'dialog') {
|
103
|
+
return (0, _dialog.useDialogAction)(others, context);
|
104
|
+
}
|
105
|
+
|
106
|
+
if (type === 'confirm') {
|
107
|
+
return (0, _confirm.useConfirmAction)(others, context);
|
108
|
+
}
|
109
|
+
|
110
|
+
if (type === 'danger-confirm') {
|
111
|
+
return (0, _dangerConfirm.useDangerConfirmAction)(others, context);
|
112
|
+
}
|
113
|
+
|
114
|
+
if (type === 'notice') {
|
115
|
+
return (0, _notice.useNoticeAction)(others, context);
|
116
|
+
}
|
117
|
+
|
118
|
+
if (type === 'error') {
|
119
|
+
return (0, _error.useErrorAction)(others, context);
|
120
|
+
}
|
121
|
+
|
122
|
+
if (type === 'dialog-form') {
|
123
|
+
return (0, _dialogForm.useDialogFormAction)(others, context);
|
124
|
+
}
|
125
|
+
|
126
|
+
if (type === 'drawer') {
|
127
|
+
return (0, _drawer.useDrawerAction)(others, context);
|
128
|
+
}
|
129
|
+
|
130
|
+
if (type === 'drawer-form') {
|
131
|
+
return (0, _drawerForm.useDrawerFormAction)(others, context);
|
132
|
+
}
|
133
|
+
|
134
|
+
var registedAction = RegistedActions.get(type);
|
135
|
+
|
136
|
+
if (!registedAction) {
|
137
|
+
return {};
|
138
|
+
}
|
139
|
+
|
140
|
+
return useAction(_objectSpread(_objectSpread({
|
141
|
+
type: registedAction.extendActionId
|
142
|
+
}, registedAction.defaultConfig), others), context);
|
143
|
+
};
|
144
|
+
|
145
|
+
exports.useAction = useAction;
|
146
|
+
|
147
|
+
var buttonContent = function buttonContent(content, iconType, iconSize) {
|
148
|
+
if (!iconType) {
|
149
|
+
return content;
|
150
|
+
}
|
151
|
+
|
152
|
+
return [/*#__PURE__*/_react.default.createElement(_icon.default, {
|
153
|
+
type: iconType,
|
154
|
+
size: iconSize,
|
155
|
+
key: "teamix-button-icon"
|
156
|
+
}), content];
|
157
|
+
};
|
158
|
+
|
159
|
+
var ActionButton = function ActionButton(props) {
|
160
|
+
var config = props.config,
|
161
|
+
icon = props.icon,
|
162
|
+
_props$iconSize = props.iconSize,
|
163
|
+
iconSize = _props$iconSize === void 0 ? 'medium' : _props$iconSize,
|
164
|
+
_props$type = props.type,
|
165
|
+
type = _props$type === void 0 ? 'primary' : _props$type,
|
166
|
+
context = props.context,
|
167
|
+
children = props.children,
|
168
|
+
visible = props.visible,
|
169
|
+
_onClick = props.onClick,
|
170
|
+
others = _objectWithoutProperties(props, _excluded2);
|
171
|
+
|
172
|
+
var actionProps = useAction(config, context);
|
173
|
+
var buttonProps = _onClick ? _objectSpread(_objectSpread(_objectSpread({}, actionProps), others), {}, {
|
174
|
+
onClick: function onClick(e) {
|
175
|
+
return _onClick(e, context);
|
176
|
+
}
|
177
|
+
}) : _objectSpread(_objectSpread({}, actionProps), others);
|
178
|
+
return /*#__PURE__*/_react.default.createElement(_components.Button, _objectSpread({
|
179
|
+
type: type
|
180
|
+
}, buttonProps), buttonContent(children, icon, iconSize));
|
181
|
+
};
|
182
|
+
|
183
|
+
exports.ActionButton = ActionButton;
|
184
|
+
|
185
|
+
function renderMenuButtonItem(item, key, context) {
|
186
|
+
var menuItemActionConfig = Object.assign({}, item.config, {
|
187
|
+
trigger: 'onClick'
|
188
|
+
});
|
189
|
+
|
190
|
+
var _useAction = useAction(menuItemActionConfig, item.context || context),
|
191
|
+
loading = _useAction.loading,
|
192
|
+
menuItemProps = _objectWithoutProperties(_useAction, _excluded3);
|
193
|
+
|
194
|
+
var buttonProps = item.onClick ? _objectSpread(_objectSpread({}, menuItemProps), {}, {
|
195
|
+
onClick: function onClick(e) {
|
196
|
+
return item.onClick(e, context);
|
197
|
+
}
|
198
|
+
}) : _objectSpread({}, menuItemProps);
|
199
|
+
return /*#__PURE__*/_react.default.createElement(_components.MenuButton.Item, _objectSpread(_objectSpread({}, buttonProps), {}, {
|
200
|
+
key: key
|
201
|
+
}), buttonContent(item.children, item.icon));
|
202
|
+
}
|
203
|
+
|
204
|
+
var ActionMenuButton = function ActionMenuButton(props) {
|
205
|
+
var icon = props.icon,
|
206
|
+
iconSize = props.iconSize,
|
207
|
+
label = props.label,
|
208
|
+
actions = props.actions,
|
209
|
+
children = props.children,
|
210
|
+
context = props.context,
|
211
|
+
_props$type2 = props.type,
|
212
|
+
type = _props$type2 === void 0 ? 'primary' : _props$type2,
|
213
|
+
others = _objectWithoutProperties(props, _excluded4);
|
214
|
+
|
215
|
+
return /*#__PURE__*/_react.default.createElement(_components.MenuButton, _objectSpread({
|
216
|
+
popupTriggerType: "hover",
|
217
|
+
type: type,
|
218
|
+
label: buttonContent(label || children, icon, iconSize)
|
219
|
+
}, others), actions.map(function (child, i) {
|
220
|
+
// @ts-ignore
|
221
|
+
if (child.actions && child.actions.length) {
|
222
|
+
return [/*#__PURE__*/_react.default.createElement(_components.MenuButton.Divider, null),
|
223
|
+
/*#__PURE__*/
|
224
|
+
// @ts-ignore
|
225
|
+
_react.default.createElement(_components.MenuButton.Group, {
|
226
|
+
label: child.label || child.children
|
227
|
+
}, //@ts-ignore
|
228
|
+
child.actions.map(function (action, j) {
|
229
|
+
return renderMenuButtonItem(action, "".concat(i, "-").concat(j), context);
|
230
|
+
})), /*#__PURE__*/_react.default.createElement(_components.MenuButton.Divider, null), /*#__PURE__*/_react.default.createElement(_components.MenuButton.Divider, null)];
|
231
|
+
}
|
232
|
+
|
233
|
+
return renderMenuButtonItem(child, "".concat(i), context);
|
234
|
+
}));
|
235
|
+
};
|
236
|
+
|
237
|
+
exports.ActionMenuButton = ActionMenuButton;
|
238
|
+
|
239
|
+
function formatGroupActions(actions, max, moreConfig) {
|
240
|
+
var MAX = max < 1 ? MAX_ACTTIONS : max;
|
241
|
+
|
242
|
+
if (actions.length <= MAX) {
|
243
|
+
return actions;
|
244
|
+
}
|
245
|
+
|
246
|
+
return [].concat(_toConsumableArray(actions.slice(0, MAX - 1)), [_objectSpread(_objectSpread({}, moreConfig), {}, {
|
247
|
+
actions: actions.slice(MAX - 1)
|
248
|
+
})]);
|
249
|
+
}
|
250
|
+
|
251
|
+
function renderCommonActionButton(button, context, isTypeText) {
|
252
|
+
var buttonContext = button.context,
|
253
|
+
text = button.text,
|
254
|
+
others = _objectWithoutProperties(button, _excluded5);
|
255
|
+
|
256
|
+
var buttonProps = _objectSpread({
|
257
|
+
context: Object.assign({}, context, buttonContext),
|
258
|
+
text: text || isTypeText
|
259
|
+
}, others); // @ts-ignore
|
260
|
+
|
261
|
+
|
262
|
+
if (!button.actions) {
|
263
|
+
return (
|
264
|
+
/*#__PURE__*/
|
265
|
+
// @ts-ignore
|
266
|
+
_react.default.createElement(ActionButton, _objectSpread({}, buttonProps))
|
267
|
+
);
|
268
|
+
} // @ts-ignore
|
269
|
+
|
270
|
+
|
271
|
+
return /*#__PURE__*/_react.default.createElement(ActionMenuButton, _objectSpread({}, buttonProps));
|
272
|
+
}
|
273
|
+
|
274
|
+
function getDefaultMoreButton(type, moreText) {
|
275
|
+
if (type === 'button') {
|
276
|
+
return {
|
277
|
+
label: moreText || '更多'
|
278
|
+
};
|
279
|
+
}
|
280
|
+
|
281
|
+
if (moreText) {
|
282
|
+
return {
|
283
|
+
label: moreText
|
284
|
+
};
|
285
|
+
}
|
286
|
+
|
287
|
+
return {
|
288
|
+
icon: 'more-line',
|
289
|
+
// iconSize: 'small',
|
290
|
+
autoWidth: false,
|
291
|
+
className: 'teamix-pro-actions-text-menu-btn-no-arrow'
|
292
|
+
};
|
293
|
+
}
|
294
|
+
|
295
|
+
var MAX_ACTTIONS = 4;
|
296
|
+
|
297
|
+
function getActionConfig(action, context) {
|
298
|
+
// @ts-ignore
|
299
|
+
if (action.actions) {
|
300
|
+
// @ts-ignore
|
301
|
+
var actions = action.actions,
|
302
|
+
_others = _objectWithoutProperties(action, _excluded6);
|
303
|
+
|
304
|
+
return _objectSpread({
|
305
|
+
actions: actions.map(function (a) {
|
306
|
+
return getActionConfig(a, context);
|
307
|
+
})
|
308
|
+
}, (0, _utils.getTargetValue)(_others, context));
|
309
|
+
} // @ts-ignore
|
310
|
+
|
311
|
+
|
312
|
+
var config = action.config,
|
313
|
+
others = _objectWithoutProperties(action, _excluded7);
|
314
|
+
|
315
|
+
return _objectSpread({
|
316
|
+
config: config
|
317
|
+
}, (0, _utils.getTargetValue)(others, context));
|
318
|
+
}
|
319
|
+
|
320
|
+
function ActionGroup(props) {
|
321
|
+
var _props$type3 = props.type,
|
322
|
+
type = _props$type3 === void 0 ? 'button' : _props$type3,
|
323
|
+
_props$divider = props.divider,
|
324
|
+
divider = _props$divider === void 0 ? true : _props$divider,
|
325
|
+
_props$max = props.max,
|
326
|
+
max = _props$max === void 0 ? MAX_ACTTIONS : _props$max,
|
327
|
+
moreText = props.moreText,
|
328
|
+
context = props.context,
|
329
|
+
_props$actions = props.actions,
|
330
|
+
actions = _props$actions === void 0 ? [] : _props$actions,
|
331
|
+
className = props.className,
|
332
|
+
containerProps = _objectWithoutProperties(props, _excluded8);
|
333
|
+
|
334
|
+
var isTypeText = type === 'text';
|
335
|
+
var filteredActions = actions.map(function (action) {
|
336
|
+
return getActionConfig(action, context);
|
337
|
+
}).filter(function (action) {
|
338
|
+
return action.visible !== false;
|
339
|
+
});
|
340
|
+
var formatedActions = formatGroupActions(filteredActions, max, getDefaultMoreButton(type, moreText));
|
341
|
+
return /*#__PURE__*/_react.default.createElement("div", _objectSpread({
|
342
|
+
className: (0, _classnames.default)('teamix-pro-actions', type, className, {
|
343
|
+
divider: divider
|
344
|
+
})
|
345
|
+
}, containerProps), formatedActions.map(function (actionBtn, i) {
|
346
|
+
var isLastOne = i === formatedActions.length - 1;
|
347
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
348
|
+
key: i
|
349
|
+
}, renderCommonActionButton(actionBtn, context, isTypeText), isTypeText && divider && !isLastOne && /*#__PURE__*/_react.default.createElement(_components.Divider, {
|
350
|
+
direction: "ver"
|
351
|
+
}));
|
352
|
+
}));
|
353
|
+
}
|
354
|
+
|
355
|
+
var _default = ActionButton;
|
356
|
+
exports.default = _default;
|
@@ -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-2);
|
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,60 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
exports.goToLink = goToLink;
|
8
|
+
exports.useLinkAction = useLinkAction;
|
9
|
+
|
10
|
+
var _reactRouterDom = require("react-router-dom");
|
11
|
+
|
12
|
+
var _utils = require("@teamix/utils");
|
13
|
+
|
14
|
+
var _base = require("./base");
|
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 goToLink(link, history) {
|
23
|
+
var to = link.to,
|
24
|
+
search = link.search,
|
25
|
+
hash = link.hash,
|
26
|
+
blank = link.blank;
|
27
|
+
|
28
|
+
if (blank) {
|
29
|
+
window.open("".concat(to).concat(search ? "?".concat(search) : '').concat(hash ? "#".concat(hash) : ''));
|
30
|
+
return;
|
31
|
+
}
|
32
|
+
|
33
|
+
history.push({
|
34
|
+
pathname: to,
|
35
|
+
search: search,
|
36
|
+
hash: hash
|
37
|
+
});
|
38
|
+
}
|
39
|
+
|
40
|
+
function useLinkAction(action, context) {
|
41
|
+
var history = (0, _reactRouterDom.useHistory)();
|
42
|
+
|
43
|
+
var _getTargetValue = (0, _utils.getTargetValue)(action, context),
|
44
|
+
to = _getTargetValue.to,
|
45
|
+
search = _getTargetValue.search,
|
46
|
+
hash = _getTargetValue.hash,
|
47
|
+
blank = _getTargetValue.blank;
|
48
|
+
|
49
|
+
return _objectSpread({}, (0, _base.eventHandler)(action, function () {
|
50
|
+
goToLink({
|
51
|
+
to: to,
|
52
|
+
search: search,
|
53
|
+
hash: hash,
|
54
|
+
blank: blank
|
55
|
+
}, history);
|
56
|
+
}));
|
57
|
+
}
|
58
|
+
|
59
|
+
var _default = useLinkAction;
|
60
|
+
exports.default = _default;
|
@@ -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,25 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
exports.useNoticeAction = useNoticeAction;
|
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 useNoticeAction(action, context) {
|
16
|
+
return (0, _dialog.default)((0, _utils.deepMerge)({
|
17
|
+
dialogQuickShowType: 'confirm',
|
18
|
+
messageProps: {
|
19
|
+
type: 'notice'
|
20
|
+
}
|
21
|
+
}, action), context);
|
22
|
+
}
|
23
|
+
|
24
|
+
var _default = useNoticeAction;
|
25
|
+
exports.default = _default;
|
@@ -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,75 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
exports.doRequest = doRequest;
|
8
|
+
exports.useRequestAction = useRequestAction;
|
9
|
+
|
10
|
+
var _react = require("react");
|
11
|
+
|
12
|
+
var _utils = require("@teamix/utils");
|
13
|
+
|
14
|
+
var _base = require("./base");
|
15
|
+
|
16
|
+
var _excluded = ["method"],
|
17
|
+
_excluded2 = ["onFinish"];
|
18
|
+
|
19
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
20
|
+
|
21
|
+
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."); }
|
22
|
+
|
23
|
+
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); }
|
24
|
+
|
25
|
+
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; }
|
26
|
+
|
27
|
+
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; }
|
28
|
+
|
29
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
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 _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; }
|
38
|
+
|
39
|
+
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; }
|
40
|
+
|
41
|
+
// action 里的数据请求都默认是 post 类型
|
42
|
+
function doRequest(action, context) {
|
43
|
+
var _action$method = action.method,
|
44
|
+
method = _action$method === void 0 ? 'post' : _action$method,
|
45
|
+
others = _objectWithoutProperties(action, _excluded);
|
46
|
+
|
47
|
+
return (0, _utils.doCommonRequest)(_objectSpread({
|
48
|
+
method: method
|
49
|
+
}, others), context);
|
50
|
+
}
|
51
|
+
|
52
|
+
function useRequestAction(action, context) {
|
53
|
+
var _useState = (0, _react.useState)(false),
|
54
|
+
_useState2 = _slicedToArray(_useState, 2),
|
55
|
+
loading = _useState2[0],
|
56
|
+
setLoading = _useState2[1];
|
57
|
+
|
58
|
+
var onFinish = action.onFinish,
|
59
|
+
others = _objectWithoutProperties(action, _excluded2);
|
60
|
+
|
61
|
+
return _objectSpread(_objectSpread({}, (0, _base.eventHandler)(action, function () {
|
62
|
+
setLoading(true);
|
63
|
+
doRequest(_objectSpread({}, others), context).then(function () {
|
64
|
+
setLoading(false);
|
65
|
+
onFinish && onFinish();
|
66
|
+
}).catch(function () {
|
67
|
+
setLoading(false);
|
68
|
+
});
|
69
|
+
})), {}, {
|
70
|
+
loading: loading
|
71
|
+
});
|
72
|
+
}
|
73
|
+
|
74
|
+
var _default = useRequestAction;
|
75
|
+
exports.default = _default;
|
@@ -0,0 +1,30 @@
|
|
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
|
+
children?: React.ReactNode;
|
12
|
+
title?: React.ReactNode;
|
13
|
+
subTitle?: React.ReactNode;
|
14
|
+
extra?: React.ReactNode | IActionButton[];
|
15
|
+
image?: string;
|
16
|
+
divider?: boolean;
|
17
|
+
bordered?: boolean;
|
18
|
+
hoveredShadow?: boolean;
|
19
|
+
compacted?: boolean;
|
20
|
+
centered?: boolean;
|
21
|
+
loading?: boolean;
|
22
|
+
backgroundColor?: 'blue' | 'green' | 'red' | 'orange' | 'yellow' | 'grey' | 'transparent';
|
23
|
+
col?: number | string;
|
24
|
+
className?: string;
|
25
|
+
style?: React.CSSProperties;
|
26
|
+
contentClassName?: string;
|
27
|
+
contentStyle?: React.CSSProperties;
|
28
|
+
}
|
29
|
+
declare const Card: React.FC<CardProps>;
|
30
|
+
export default Card;
|