@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,130 @@
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
2
|
+
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
4
|
+
|
5
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
6
|
+
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
8
|
+
|
9
|
+
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."); }
|
10
|
+
|
11
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
12
|
+
|
13
|
+
function _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; }
|
14
|
+
|
15
|
+
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; }
|
16
|
+
|
17
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
18
|
+
|
19
|
+
import React, { useState, useMemo } from 'react';
|
20
|
+
import { Balloon } from '@alicloudfe/components';
|
21
|
+
import { useDebounceFn } from '@teamix/hooks';
|
22
|
+
import Icon from '@teamix/icon';
|
23
|
+
import SVG from '@teamix/svg';
|
24
|
+
import { baseClass } from '@teamix/utils';
|
25
|
+
import { useAction } from '../../actions';
|
26
|
+
import { initConfigurator } from '../configurators';
|
27
|
+
import { ComponentConfiguratorMap } from '../configurators/map';
|
28
|
+
import { PlayGroundLayout } from '../playground';
|
29
|
+
var cls = baseClass('teamix-nocode');
|
30
|
+
export var PagePlayground = function PagePlayground(props) {
|
31
|
+
var _useState = useState(undefined),
|
32
|
+
_useState2 = _slicedToArray(_useState, 2),
|
33
|
+
selectedComponent = _useState2[0],
|
34
|
+
setSelectedComponent = _useState2[1];
|
35
|
+
|
36
|
+
var PageContainer = props.page,
|
37
|
+
initialValues = props.initialValues,
|
38
|
+
onValuesChange = props.onValuesChange,
|
39
|
+
configuratorMap = props.configuratorMap;
|
40
|
+
|
41
|
+
var _useState3 = useState(initialValues || {}),
|
42
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
43
|
+
pageProps = _useState4[0],
|
44
|
+
setPageProps = _useState4[1];
|
45
|
+
|
46
|
+
var setterAction = useAction({
|
47
|
+
type: 'drawer-form',
|
48
|
+
initialValues: {
|
49
|
+
pageProps: pageProps
|
50
|
+
},
|
51
|
+
title: '编辑元数据',
|
52
|
+
schema: [{
|
53
|
+
name: 'pageProps',
|
54
|
+
component: 'JsonInput',
|
55
|
+
props: {
|
56
|
+
height: 600
|
57
|
+
}
|
58
|
+
}],
|
59
|
+
onFinish: function onFinish(form) {
|
60
|
+
setPageProps(form.pageProps);
|
61
|
+
|
62
|
+
if (!onValuesChange) {
|
63
|
+
return;
|
64
|
+
}
|
65
|
+
|
66
|
+
try {
|
67
|
+
onValuesChange(JSON.parse(JSON.stringify(form.pageProps)));
|
68
|
+
} catch (error) {
|
69
|
+
onValuesChange(form.pageProps);
|
70
|
+
}
|
71
|
+
}
|
72
|
+
});
|
73
|
+
var configuratorId = "".concat(selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.component, "-").concat(selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id);
|
74
|
+
var configuratorInitialValues = pageProps[selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id];
|
75
|
+
var pageContainerProps = {
|
76
|
+
editable: true,
|
77
|
+
selectedComponent: selectedComponent,
|
78
|
+
onSelectComponent: function onSelectComponent(c) {
|
79
|
+
setSelectedComponent(c);
|
80
|
+
},
|
81
|
+
pageProps: pageProps
|
82
|
+
};
|
83
|
+
var maper = Object.assign({}, ComponentConfiguratorMap, configuratorMap);
|
84
|
+
var configurator = maper[selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.component];
|
85
|
+
|
86
|
+
var _useDebounceFn = useDebounceFn(function (values) {
|
87
|
+
var newValues = {};
|
88
|
+
newValues[selectedComponent === null || selectedComponent === void 0 ? void 0 : selectedComponent.id] = Object.assign({}, values);
|
89
|
+
var newPageProps = Object.assign({}, pageProps, newValues);
|
90
|
+
setPageProps(newPageProps);
|
91
|
+
onValuesChange && onValuesChange(newPageProps);
|
92
|
+
}, {
|
93
|
+
wait: 200
|
94
|
+
}),
|
95
|
+
onConfiguratorValuesChange = _useDebounceFn.run;
|
96
|
+
|
97
|
+
var Configurator = useMemo(function () {
|
98
|
+
if (!configurator) {
|
99
|
+
return;
|
100
|
+
}
|
101
|
+
|
102
|
+
return initConfigurator(configurator.schema, configurator.initialValues, configurator.defaultValues);
|
103
|
+
}, [configurator]);
|
104
|
+
var pageKey = useMemo(function () {
|
105
|
+
return "page-".concat(Math.random());
|
106
|
+
}, [pageProps]);
|
107
|
+
return /*#__PURE__*/React.createElement(PlayGroundLayout, {
|
108
|
+
component: /*#__PURE__*/React.createElement(PageContainer, _objectSpread({
|
109
|
+
key: pageKey
|
110
|
+
}, pageContainerProps)),
|
111
|
+
configurator: Configurator ? /*#__PURE__*/React.createElement(Configurator, {
|
112
|
+
key: configuratorId,
|
113
|
+
initialValues: configuratorInitialValues,
|
114
|
+
onValuesChange: onConfiguratorValuesChange
|
115
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
116
|
+
className: cls('empty')
|
117
|
+
}, /*#__PURE__*/React.createElement(SVG.NoData, {
|
118
|
+
width: 160,
|
119
|
+
height: 160
|
120
|
+
}), /*#__PURE__*/React.createElement("p", null, "\u8BF7\u9009\u62E9\u4E00\u4E2A\u7EC4\u4EF6\u8FDB\u884C\u7F16\u8F91")),
|
121
|
+
tools: /*#__PURE__*/React.createElement(Balloon, {
|
122
|
+
align: "l",
|
123
|
+
trigger: /*#__PURE__*/React.createElement(Icon, _objectSpread({
|
124
|
+
type: "set-line",
|
125
|
+
size: "large"
|
126
|
+
}, setterAction)),
|
127
|
+
closable: false
|
128
|
+
}, "\u5143\u6570\u636E\u914D\u7F6E")
|
129
|
+
});
|
130
|
+
};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { PageProps } from '../../page-container';
|
2
|
+
import { PageMap, PageType } from '.';
|
3
|
+
export interface PageRendererProps<T = any> extends PageProps<T> {
|
4
|
+
type?: PageType;
|
5
|
+
error?: any;
|
6
|
+
title?: string;
|
7
|
+
pageMap?: PageMap;
|
8
|
+
}
|
9
|
+
export declare const PageRenderer: (props: PageRendererProps) => JSX.Element;
|
10
|
+
export default PageRenderer;
|
@@ -0,0 +1,144 @@
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
2
|
+
|
3
|
+
var _excluded = ["type", "loading", "pageProps", "error", "title", "pageMap"];
|
4
|
+
|
5
|
+
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; }
|
6
|
+
|
7
|
+
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; }
|
8
|
+
|
9
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
10
|
+
|
11
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
12
|
+
|
13
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
14
|
+
|
15
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
16
|
+
|
17
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
18
|
+
|
19
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
20
|
+
|
21
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
22
|
+
|
23
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
24
|
+
|
25
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
26
|
+
|
27
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
28
|
+
|
29
|
+
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; }
|
30
|
+
|
31
|
+
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; }
|
32
|
+
|
33
|
+
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; }
|
34
|
+
|
35
|
+
import React from 'react';
|
36
|
+
import Helmet from 'react-helmet';
|
37
|
+
import SVG from '@teamix/svg';
|
38
|
+
import PageContainer from '../../page-container';
|
39
|
+
import PageHeader from '../../page-header';
|
40
|
+
import { BaseSkeleton } from '../../skeleton';
|
41
|
+
import { baseClass } from '@teamix/utils';
|
42
|
+
import { PageMap } from '.';
|
43
|
+
var cls = baseClass('teamix-nocode');
|
44
|
+
|
45
|
+
var Loading = function Loading(props) {
|
46
|
+
return /*#__PURE__*/React.createElement(PageContainer, _objectSpread({
|
47
|
+
header: /*#__PURE__*/React.createElement(PageHeader, {
|
48
|
+
loading: true,
|
49
|
+
title: "",
|
50
|
+
breadcrumb: []
|
51
|
+
}),
|
52
|
+
content: /*#__PURE__*/React.createElement(BaseSkeleton.Content, null)
|
53
|
+
}, props));
|
54
|
+
};
|
55
|
+
|
56
|
+
var Error = function Error(_ref) {
|
57
|
+
var message = _ref.message,
|
58
|
+
type = _ref.type;
|
59
|
+
var ErrorSvg = type === '404' ? SVG.Status404 : SVG.BrowserError;
|
60
|
+
return /*#__PURE__*/React.createElement("div", {
|
61
|
+
className: cls('empty')
|
62
|
+
}, /*#__PURE__*/React.createElement(ErrorSvg, {
|
63
|
+
width: 160,
|
64
|
+
height: 160
|
65
|
+
}), /*#__PURE__*/React.createElement("p", null, message || '页面加载失败'));
|
66
|
+
};
|
67
|
+
|
68
|
+
var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
69
|
+
_inherits(ErrorBoundary, _React$Component);
|
70
|
+
|
71
|
+
var _super = _createSuper(ErrorBoundary);
|
72
|
+
|
73
|
+
function ErrorBoundary(props) {
|
74
|
+
var _this;
|
75
|
+
|
76
|
+
_classCallCheck(this, ErrorBoundary);
|
77
|
+
|
78
|
+
_this = _super.call(this, props);
|
79
|
+
_this.state = {
|
80
|
+
error: false
|
81
|
+
};
|
82
|
+
return _this;
|
83
|
+
}
|
84
|
+
|
85
|
+
_createClass(ErrorBoundary, [{
|
86
|
+
key: "render",
|
87
|
+
value: function render() {
|
88
|
+
if (this.state.error) {
|
89
|
+
return /*#__PURE__*/React.createElement(Error, {
|
90
|
+
message: this.state.error.message
|
91
|
+
});
|
92
|
+
}
|
93
|
+
|
94
|
+
return this.props.children;
|
95
|
+
}
|
96
|
+
}], [{
|
97
|
+
key: "getDerivedStateFromError",
|
98
|
+
value: function getDerivedStateFromError(error) {
|
99
|
+
console.error(error);
|
100
|
+
return {
|
101
|
+
error: error
|
102
|
+
};
|
103
|
+
}
|
104
|
+
}]);
|
105
|
+
|
106
|
+
return ErrorBoundary;
|
107
|
+
}(React.Component);
|
108
|
+
|
109
|
+
export var PageRenderer = function PageRenderer(props) {
|
110
|
+
var type = props.type,
|
111
|
+
loading = props.loading,
|
112
|
+
pageProps = props.pageProps,
|
113
|
+
error = props.error,
|
114
|
+
title = props.title,
|
115
|
+
pageMap = props.pageMap,
|
116
|
+
others = _objectWithoutProperties(props, _excluded);
|
117
|
+
|
118
|
+
if (error) {
|
119
|
+
return /*#__PURE__*/React.createElement(Error, {
|
120
|
+
message: error.message
|
121
|
+
});
|
122
|
+
}
|
123
|
+
|
124
|
+
if (!type) {
|
125
|
+
return /*#__PURE__*/React.createElement(Loading, _objectSpread({}, others));
|
126
|
+
}
|
127
|
+
|
128
|
+
var Page = PageMap[type] || (pageMap === null || pageMap === void 0 ? void 0 : pageMap[type]);
|
129
|
+
|
130
|
+
if (!Page) {
|
131
|
+
return /*#__PURE__*/React.createElement(Error, {
|
132
|
+
message: "\u9519\u8BEF\u7684\u9875\u9762\u7C7B\u578B",
|
133
|
+
type: "404"
|
134
|
+
});
|
135
|
+
}
|
136
|
+
|
137
|
+
return /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(Helmet, {
|
138
|
+
title: title
|
139
|
+
}), /*#__PURE__*/React.createElement(Page, _objectSpread({
|
140
|
+
loading: loading,
|
141
|
+
pageProps: pageProps || {}
|
142
|
+
}, others)));
|
143
|
+
};
|
144
|
+
export default PageRenderer;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Configurator } from './configurators';
|
3
|
+
export interface PlayGroundLayoutProps {
|
4
|
+
component: React.ReactNode;
|
5
|
+
configurator: React.ReactNode;
|
6
|
+
tools?: React.ReactNode;
|
7
|
+
}
|
8
|
+
export declare const PlayGroundLayout: (props: PlayGroundLayoutProps) => JSX.Element;
|
9
|
+
export interface PlayGround<T = any> {
|
10
|
+
component: React.FC<T>;
|
11
|
+
configurator: Configurator;
|
12
|
+
initialValues: T;
|
13
|
+
}
|
14
|
+
export declare const PlayGround: <T extends {}>(props: PlayGround<T>) => JSX.Element;
|
@@ -0,0 +1,68 @@
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
2
|
+
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
4
|
+
|
5
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
6
|
+
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
8
|
+
|
9
|
+
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."); }
|
10
|
+
|
11
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
12
|
+
|
13
|
+
function _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; }
|
14
|
+
|
15
|
+
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; }
|
16
|
+
|
17
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
18
|
+
|
19
|
+
import React, { useMemo } from 'react';
|
20
|
+
import { baseClass } from '@teamix/utils';
|
21
|
+
import { useDebounceFn } from '@teamix/hooks';
|
22
|
+
import { initConfigurator } from './configurators';
|
23
|
+
var cls = baseClass('teamix-nocode-playground');
|
24
|
+
export var PlayGroundLayout = function PlayGroundLayout(props) {
|
25
|
+
return /*#__PURE__*/React.createElement("div", {
|
26
|
+
className: cls()
|
27
|
+
}, /*#__PURE__*/React.createElement("div", {
|
28
|
+
className: cls('component')
|
29
|
+
}, props.component), /*#__PURE__*/React.createElement("div", {
|
30
|
+
className: cls('configurator')
|
31
|
+
}, props.configurator), /*#__PURE__*/React.createElement("div", {
|
32
|
+
className: cls('tools')
|
33
|
+
}, props.tools));
|
34
|
+
};
|
35
|
+
export var PlayGround = function PlayGround(props) {
|
36
|
+
var Component = props.component,
|
37
|
+
configurator = props.configurator,
|
38
|
+
initialValues = props.initialValues;
|
39
|
+
|
40
|
+
var _React$useState = React.useState(initialValues),
|
41
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
42
|
+
componentState = _React$useState2[0],
|
43
|
+
setComponentState = _React$useState2[1];
|
44
|
+
|
45
|
+
var componentKey = useMemo(function () {
|
46
|
+
return "component-".concat(Math.random());
|
47
|
+
}, [componentState]);
|
48
|
+
var Configurator = useMemo(function () {
|
49
|
+
return initConfigurator(configurator.schema, configurator.initialValues);
|
50
|
+
}, [configurator]);
|
51
|
+
|
52
|
+
var _useDebounceFn = useDebounceFn(function (values) {
|
53
|
+
setComponentState(values);
|
54
|
+
}, {
|
55
|
+
wait: 500
|
56
|
+
}),
|
57
|
+
onValuesChange = _useDebounceFn.run;
|
58
|
+
|
59
|
+
return /*#__PURE__*/React.createElement(PlayGroundLayout, {
|
60
|
+
component: /*#__PURE__*/React.createElement(Component, _objectSpread({
|
61
|
+
key: componentKey
|
62
|
+
}, componentState)),
|
63
|
+
configurator: /*#__PURE__*/React.createElement(Configurator, {
|
64
|
+
initialValues: initialValues,
|
65
|
+
onValuesChange: onValuesChange
|
66
|
+
})
|
67
|
+
});
|
68
|
+
};
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { IActionButton } from '../actions';
|
3
|
+
import './index.scss';
|
4
|
+
export interface BreadcrumbItem {
|
5
|
+
link?: string;
|
6
|
+
text: string;
|
7
|
+
}
|
8
|
+
export interface LinkItem {
|
9
|
+
link?: string;
|
10
|
+
icon?: string;
|
11
|
+
text: string;
|
12
|
+
onClick?: (e?: React.MouseEvent<Element, MouseEvent>) => void;
|
13
|
+
}
|
14
|
+
export interface TagItem {
|
15
|
+
type?: 'normal' | 'primary';
|
16
|
+
color?: string;
|
17
|
+
text: string;
|
18
|
+
}
|
19
|
+
declare type Color = 'blue' | 'green' | 'orange' | 'red' | 'yellow' | string;
|
20
|
+
export interface DataItem {
|
21
|
+
title: string;
|
22
|
+
num: number;
|
23
|
+
color?: Color;
|
24
|
+
}
|
25
|
+
export declare type PageHeaderProps = {
|
26
|
+
title?: React.ReactNode;
|
27
|
+
description?: React.ReactNode;
|
28
|
+
icon?: string;
|
29
|
+
iconColor?: Color;
|
30
|
+
iconBackgroundType?: 'circle' | 'square';
|
31
|
+
iconBackgroundColor?: Color;
|
32
|
+
goback?: string | boolean;
|
33
|
+
image?: string;
|
34
|
+
loading?: boolean;
|
35
|
+
breadcrumb?: BreadcrumbItem[];
|
36
|
+
extra?: IActionButton[] | React.ReactNode;
|
37
|
+
operation?: IActionButton[] | React.ReactNode;
|
38
|
+
tags?: TagItem[];
|
39
|
+
data?: DataItem[];
|
40
|
+
} & React.HTMLAttributes<HTMLElement>;
|
41
|
+
declare const PageHeader: React.FC<PageHeaderProps>;
|
42
|
+
export default PageHeader;
|
@@ -0,0 +1,222 @@
|
|
1
|
+
var _excluded = ["title", "description", "icon", "iconColor", "iconBackgroundType", "iconBackgroundColor", "goback", "operation", "extra", "image", "loading", "breadcrumb", "tags", "data", "children", "className", "style"];
|
2
|
+
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
4
|
+
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
6
|
+
|
7
|
+
function _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; }
|
8
|
+
|
9
|
+
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; }
|
10
|
+
|
11
|
+
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; }
|
12
|
+
|
13
|
+
import React from 'react';
|
14
|
+
import classnames from 'classnames';
|
15
|
+
import TeamixIcon from '@teamix/icon';
|
16
|
+
import { Breadcrumb, Tag } from '@alicloudfe/components';
|
17
|
+
import { baseClass } from '@teamix/utils';
|
18
|
+
import { ActionGroup } from '../actions';
|
19
|
+
import { BaseSkeleton } from '../skeleton';
|
20
|
+
import './index.scss';
|
21
|
+
var cls = baseClass('teamix-pro-page-header');
|
22
|
+
|
23
|
+
var renderNav = function renderNav(breadcrumbs) {
|
24
|
+
if (breadcrumbs && breadcrumbs.length) {
|
25
|
+
return /*#__PURE__*/React.createElement(Breadcrumb, null, breadcrumbs.map(function (b, i) {
|
26
|
+
return /*#__PURE__*/React.createElement(Breadcrumb.Item, {
|
27
|
+
key: i,
|
28
|
+
link: b.link
|
29
|
+
}, b.text);
|
30
|
+
}));
|
31
|
+
}
|
32
|
+
|
33
|
+
return null;
|
34
|
+
};
|
35
|
+
|
36
|
+
var renderExtra = function renderExtra(helps) {
|
37
|
+
if (!helps) {
|
38
|
+
return null;
|
39
|
+
}
|
40
|
+
|
41
|
+
if (helps instanceof Array && helps.length) {
|
42
|
+
return /*#__PURE__*/React.createElement(ActionGroup, {
|
43
|
+
actions: helps,
|
44
|
+
type: "text",
|
45
|
+
divider: false
|
46
|
+
});
|
47
|
+
}
|
48
|
+
|
49
|
+
return helps;
|
50
|
+
};
|
51
|
+
|
52
|
+
var renderTags = function renderTags(tags) {
|
53
|
+
if (!tags) {
|
54
|
+
return null;
|
55
|
+
}
|
56
|
+
|
57
|
+
return /*#__PURE__*/React.createElement(Tag.Group, {
|
58
|
+
className: cls('tags')
|
59
|
+
}, tags.map(function (tag, i) {
|
60
|
+
return /*#__PURE__*/React.createElement(Tag, {
|
61
|
+
key: i,
|
62
|
+
size: "large",
|
63
|
+
type: tag.type,
|
64
|
+
color: tag.color,
|
65
|
+
style: {
|
66
|
+
marginBottom: 0
|
67
|
+
}
|
68
|
+
}, tag.text);
|
69
|
+
}));
|
70
|
+
};
|
71
|
+
|
72
|
+
var isPresetColor = function isPresetColor(color) {
|
73
|
+
if (!color) {
|
74
|
+
return false;
|
75
|
+
}
|
76
|
+
|
77
|
+
var PRESET_COLOR_REG = /blue|green|orange|red|yellow/;
|
78
|
+
return PRESET_COLOR_REG.test(color);
|
79
|
+
};
|
80
|
+
|
81
|
+
var renderOperations = function renderOperations(operations) {
|
82
|
+
if (!operations) {
|
83
|
+
return null;
|
84
|
+
}
|
85
|
+
|
86
|
+
if (operations instanceof Array && operations.length) {
|
87
|
+
return /*#__PURE__*/React.createElement(ActionGroup, {
|
88
|
+
actions: operations
|
89
|
+
});
|
90
|
+
}
|
91
|
+
|
92
|
+
return operations;
|
93
|
+
};
|
94
|
+
|
95
|
+
var getColorAndStyle = function getColorAndStyle(color, backgroundColor, backgroundType) {
|
96
|
+
var _classnames;
|
97
|
+
|
98
|
+
var isColorPresetColor = isPresetColor(color);
|
99
|
+
var isBgColorPresetColor = isPresetColor(backgroundColor);
|
100
|
+
var className = classnames((_classnames = {}, _defineProperty(_classnames, "".concat(cls("color-".concat(color))), isColorPresetColor), _defineProperty(_classnames, "".concat(cls("color-bg-".concat(color))), isBgColorPresetColor), _defineProperty(_classnames, "".concat(cls("bg-type-".concat(backgroundType))), !!backgroundType), _classnames));
|
101
|
+
var styleColor = isColorPresetColor ? undefined : color;
|
102
|
+
var styleBgColor = isBgColorPresetColor ? undefined : backgroundColor;
|
103
|
+
var style = {
|
104
|
+
color: styleColor,
|
105
|
+
backgroundColor: styleBgColor
|
106
|
+
};
|
107
|
+
return {
|
108
|
+
className: className,
|
109
|
+
style: style
|
110
|
+
};
|
111
|
+
};
|
112
|
+
|
113
|
+
var renderData = function renderData(data) {
|
114
|
+
if (!data) {
|
115
|
+
return null;
|
116
|
+
}
|
117
|
+
|
118
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, data.map(function (item, i) {
|
119
|
+
var _getColorAndStyle = getColorAndStyle(item.color),
|
120
|
+
className = _getColorAndStyle.className,
|
121
|
+
style = _getColorAndStyle.style;
|
122
|
+
|
123
|
+
return /*#__PURE__*/React.createElement("div", {
|
124
|
+
key: i,
|
125
|
+
className: cls('data-item')
|
126
|
+
}, /*#__PURE__*/React.createElement("div", {
|
127
|
+
className: cls('data-item-title')
|
128
|
+
}, item.title), /*#__PURE__*/React.createElement("div", {
|
129
|
+
className: classnames(cls('data-item-num'), className),
|
130
|
+
style: style
|
131
|
+
}, item.num));
|
132
|
+
}));
|
133
|
+
};
|
134
|
+
|
135
|
+
var PageHeader = function PageHeader(props) {
|
136
|
+
var title = props.title,
|
137
|
+
description = props.description,
|
138
|
+
icon = props.icon,
|
139
|
+
iconColor = props.iconColor,
|
140
|
+
_props$iconBackground = props.iconBackgroundType,
|
141
|
+
iconBackgroundType = _props$iconBackground === void 0 ? 'square' : _props$iconBackground,
|
142
|
+
iconBackgroundColor = props.iconBackgroundColor,
|
143
|
+
goback = props.goback,
|
144
|
+
operation = props.operation,
|
145
|
+
extra = props.extra,
|
146
|
+
image = props.image,
|
147
|
+
loading = props.loading,
|
148
|
+
breadcrumb = props.breadcrumb,
|
149
|
+
tags = props.tags,
|
150
|
+
data = props.data,
|
151
|
+
children = props.children,
|
152
|
+
className = props.className,
|
153
|
+
style = props.style,
|
154
|
+
others = _objectWithoutProperties(props, _excluded);
|
155
|
+
|
156
|
+
var backgroundImage = image ? "url('".concat(image, "')") : undefined;
|
157
|
+
|
158
|
+
var showList = function showList(list) {
|
159
|
+
if (loading) {
|
160
|
+
return !!list;
|
161
|
+
}
|
162
|
+
|
163
|
+
return list && list.length > 0;
|
164
|
+
};
|
165
|
+
|
166
|
+
var renderTitle = function renderTitle() {
|
167
|
+
var _getColorAndStyle2 = getColorAndStyle(iconColor, iconBackgroundColor, iconBackgroundType),
|
168
|
+
iconClass = _getColorAndStyle2.className,
|
169
|
+
iconStyle = _getColorAndStyle2.style;
|
170
|
+
|
171
|
+
var onBack = function onBack() {
|
172
|
+
if (goback === true) {
|
173
|
+
history.go(-1);
|
174
|
+
} else if (typeof goback === 'string') {
|
175
|
+
location.href = goback;
|
176
|
+
}
|
177
|
+
};
|
178
|
+
|
179
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, goback && /*#__PURE__*/React.createElement(TeamixIcon, {
|
180
|
+
className: cls('goback'),
|
181
|
+
onClick: onBack,
|
182
|
+
type: "return-line",
|
183
|
+
size: "large"
|
184
|
+
}), icon && /*#__PURE__*/React.createElement(TeamixIcon, {
|
185
|
+
className: classnames(iconClass, cls('title-icon')),
|
186
|
+
style: iconStyle,
|
187
|
+
type: icon,
|
188
|
+
size: "large"
|
189
|
+
}), /*#__PURE__*/React.createElement("span", null, title), renderTags(tags));
|
190
|
+
};
|
191
|
+
|
192
|
+
return /*#__PURE__*/React.createElement("header", _objectSpread({
|
193
|
+
className: classnames(cls(), className),
|
194
|
+
style: _objectSpread({
|
195
|
+
backgroundImage: loading ? undefined : backgroundImage
|
196
|
+
}, style)
|
197
|
+
}, others), (showList(breadcrumb) || showList(extra)) && /*#__PURE__*/React.createElement("section", {
|
198
|
+
className: cls('section')
|
199
|
+
}, /*#__PURE__*/React.createElement("nav", {
|
200
|
+
className: cls('nav')
|
201
|
+
}, loading && /*#__PURE__*/React.createElement(BaseSkeleton.Header.Nav, null), !loading && renderNav(breadcrumb)), /*#__PURE__*/React.createElement("section", {
|
202
|
+
className: cls('extra')
|
203
|
+
}, !loading && renderExtra(extra))), (goback || icon || title !== undefined || description !== undefined || data || tags || operation) && /*#__PURE__*/React.createElement("section", {
|
204
|
+
className: classnames(cls('section'), {
|
205
|
+
'with-description': description
|
206
|
+
})
|
207
|
+
}, /*#__PURE__*/React.createElement("section", {
|
208
|
+
className: cls('left')
|
209
|
+
}, /*#__PURE__*/React.createElement("section", {
|
210
|
+
className: cls('title')
|
211
|
+
}, loading && /*#__PURE__*/React.createElement(BaseSkeleton.Header.Title, null), !loading && renderTitle()), description !== undefined && /*#__PURE__*/React.createElement("section", {
|
212
|
+
className: cls('description')
|
213
|
+
}, loading && /*#__PURE__*/React.createElement(BaseSkeleton.Header.Description, null), !loading && /*#__PURE__*/React.createElement(React.Fragment, null, description))), /*#__PURE__*/React.createElement("section", {
|
214
|
+
className: cls('right')
|
215
|
+
}, data && !loading && /*#__PURE__*/React.createElement("section", {
|
216
|
+
className: cls('data')
|
217
|
+
}, renderData(data)), /*#__PURE__*/React.createElement("section", {
|
218
|
+
className: cls('operation')
|
219
|
+
}, !loading && renderOperations(operation)))), children);
|
220
|
+
};
|
221
|
+
|
222
|
+
export default PageHeader;
|