@teamix/pro 1.1.3 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +97 -0
- package/dist/pro.css +1 -1
- package/dist/pro.js +1198 -1228
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/dist/pro.min.js.LICENSE.txt +1 -1
- package/es/actions/base.d.ts +13 -0
- package/es/actions/base.js +23 -0
- package/es/actions/confirm.d.ts +7 -0
- package/es/actions/confirm.js +11 -0
- package/es/actions/danger-confirm.d.ts +7 -0
- package/es/actions/danger-confirm.js +14 -0
- package/es/actions/dialog-component.d.ts +10 -0
- package/es/actions/dialog-component.js +25 -0
- package/es/actions/dialog-form.d.ts +15 -0
- package/es/actions/dialog-form.js +129 -0
- package/es/actions/dialog-table.d.ts +9 -0
- package/es/actions/dialog-table.js +10 -0
- package/es/actions/dialog.d.ts +17 -0
- package/es/actions/dialog.js +197 -0
- package/es/actions/drawer-form.d.ts +6 -0
- package/es/actions/drawer-form.js +7 -0
- package/es/actions/drawer-table.d.ts +6 -0
- package/es/actions/drawer-table.js +7 -0
- package/es/actions/drawer.d.ts +6 -0
- package/es/actions/drawer.js +7 -0
- package/es/actions/error.d.ts +7 -0
- package/es/actions/error.js +11 -0
- package/es/actions/index.d.ts +71 -0
- package/es/actions/index.js +337 -0
- package/es/actions/index.scss +34 -0
- package/es/actions/link.d.ts +14 -0
- package/es/actions/link.js +45 -0
- package/es/actions/notice.d.ts +7 -0
- package/es/actions/notice.js +11 -0
- package/es/actions/request.d.ts +9 -0
- package/es/actions/request.js +60 -0
- package/es/card/index.d.ts +47 -0
- package/es/card/index.js +159 -0
- package/es/card/index.scss +98 -0
- package/es/field/index.d.ts +3 -0
- package/es/field/index.js +3 -0
- package/es/form/Components/Editable/index.d.ts +20 -0
- package/es/form/Components/Editable/index.js +228 -0
- package/es/form/Components/FormGroup/index.d.ts +13 -0
- package/es/form/Components/FormGroup/index.js +89 -0
- package/es/form/Components/FormGroup/index.scss +23 -0
- package/es/form/Components/ProField/index.d.ts +150 -0
- package/es/form/Components/ProField/index.js +53 -0
- package/es/form/Components/Query/index.d.ts +4 -0
- package/es/form/Components/Query/index.js +70 -0
- package/es/form/Components/Query/index.scss +90 -0
- package/es/form/Components/QueryFilter/index.d.ts +3 -0
- package/es/form/Components/QueryFilter/index.js +111 -0
- package/es/form/Components/Search/index.d.ts +11 -0
- package/es/form/Components/Search/index.js +89 -0
- package/es/form/Filter/index.d.ts +16 -0
- package/es/form/Filter/index.js +218 -0
- package/es/form/ProForm/index.d.ts +5 -0
- package/es/form/ProForm/index.js +100 -0
- package/es/form/ProForm/index.scss +254 -0
- package/es/form/SchemaForm/adapterComponent.d.ts +5 -0
- package/es/form/SchemaForm/adapterComponent.js +17 -0
- package/es/form/SchemaForm/adapterDecorator.d.ts +6 -0
- package/es/form/SchemaForm/adapterDecorator.js +28 -0
- package/es/form/SchemaForm/adapterType.d.ts +5 -0
- package/es/form/SchemaForm/adapterType.js +52 -0
- package/es/form/SchemaForm/index.d.ts +4 -0
- package/es/form/SchemaForm/index.js +259 -0
- package/es/form/SchemaForm/initializeArrayCards.d.ts +3 -0
- package/es/form/SchemaForm/initializeArrayCards.js +24 -0
- package/es/form/SchemaForm/initializeArrayCollapse.d.ts +3 -0
- package/es/form/SchemaForm/initializeArrayCollapse.js +24 -0
- package/es/form/SchemaForm/initializeArrayIcon.d.ts +3 -0
- package/es/form/SchemaForm/initializeArrayIcon.js +57 -0
- package/es/form/SchemaForm/initializeArrayItems.d.ts +3 -0
- package/es/form/SchemaForm/initializeArrayItems.js +38 -0
- package/es/form/SchemaForm/initializeArrayTable.d.ts +3 -0
- package/es/form/SchemaForm/initializeArrayTable.js +56 -0
- package/es/form/SchemaForm/initializeFormButton.d.ts +3 -0
- package/es/form/SchemaForm/initializeFormButton.js +75 -0
- package/es/form/SchemaForm/initializeFormCollapse.d.ts +3 -0
- package/es/form/SchemaForm/initializeFormCollapse.js +43 -0
- package/es/form/SchemaForm/initializeFormGroup.d.ts +3 -0
- package/es/form/SchemaForm/initializeFormGroup.js +46 -0
- package/es/form/SchemaForm/initializeFormStep.d.ts +3 -0
- package/es/form/SchemaForm/initializeFormStep.js +48 -0
- package/es/form/SchemaForm/initializeFormTab.d.ts +3 -0
- package/es/form/SchemaForm/initializeFormTab.js +53 -0
- package/es/form/SchemaForm/initializeProField.d.ts +5 -0
- package/es/form/SchemaForm/initializeProField.js +67 -0
- package/es/form/SchemaForm/initializeRequest.d.ts +11 -0
- package/es/form/SchemaForm/initializeRequest.js +25 -0
- package/es/form/SchemaForm/reactions.d.ts +4 -0
- package/es/form/SchemaForm/reactions.js +62 -0
- package/es/form/index.d.ts +27 -0
- package/es/form/index.js +35 -0
- package/es/form/typing.d.ts +69 -0
- package/es/form/typing.js +1 -0
- package/es/form/utils.d.ts +9 -0
- package/es/form/utils.js +108 -0
- package/es/form/warning.d.ts +3 -0
- package/es/form/warning.js +16 -0
- package/es/hooks/index.d.ts +2 -0
- package/es/hooks/index.js +2 -0
- package/es/index.d.ts +24 -0
- package/es/index.js +29 -0
- package/es/info/components/FormItem/index.d.ts +5 -0
- package/es/info/components/FormItem/index.js +63 -0
- package/es/info/components/FormItem/index.scss +60 -0
- package/es/info/components/InfoGroup/index.d.ts +5 -0
- package/es/info/components/InfoGroup/index.js +47 -0
- package/es/info/components/InfoGroup/index.scss +14 -0
- package/es/info/components/InfoValueItem/index.d.ts +5 -0
- package/es/info/components/InfoValueItem/index.js +223 -0
- package/es/info/components/InfoValueItem/index.scss +21 -0
- package/es/info/components/baseInfo/index.d.ts +7 -0
- package/es/info/components/baseInfo/index.js +73 -0
- package/es/info/components/baseInfo/index.scss +3 -0
- package/es/info/components/headerInfo/index.d.ts +7 -0
- package/es/info/components/headerInfo/index.js +85 -0
- package/es/info/components/headerInfo/index.scss +0 -0
- package/es/info/components/tableInfo/index.d.ts +8 -0
- package/es/info/components/tableInfo/index.js +175 -0
- package/es/info/components/tableInfo/index.scss +18 -0
- package/es/info/index.d.ts +10 -0
- package/es/info/index.js +87 -0
- package/es/info/index.scss +12 -0
- package/es/info/typing.d.ts +157 -0
- package/es/info/typing.js +1 -0
- package/es/info/utils/index.d.ts +12 -0
- package/es/info/utils/index.js +33 -0
- package/es/info/utils/layout.d.ts +2 -0
- package/es/info/utils/layout.js +58 -0
- package/es/info/utils/useInfoRequest.d.ts +14 -0
- package/es/info/utils/useInfoRequest.js +73 -0
- package/es/info/utils/utils.d.ts +1 -0
- package/es/info/utils/utils.js +13 -0
- package/es/layout/index.d.ts +2 -0
- package/es/layout/index.js +3 -0
- package/es/nocode/configurators/Card.d.ts +3 -0
- package/es/nocode/configurators/Card.js +109 -0
- package/es/nocode/configurators/PageHeader.d.ts +3 -0
- package/es/nocode/configurators/PageHeader.js +202 -0
- package/es/nocode/configurators/ProTable.d.ts +3 -0
- package/es/nocode/configurators/ProTable.js +320 -0
- package/es/nocode/configurators/common.d.ts +188 -0
- package/es/nocode/configurators/common.js +318 -0
- package/es/nocode/configurators/index.d.ts +15 -0
- package/es/nocode/configurators/index.js +27 -0
- package/es/nocode/configurators/map.d.ts +2 -0
- package/es/nocode/configurators/map.js +8 -0
- package/es/nocode/index.d.ts +8 -0
- package/es/nocode/index.js +11 -0
- package/es/nocode/index.scss +93 -0
- package/es/nocode/pages/editor.d.ts +12 -0
- package/es/nocode/pages/editor.js +40 -0
- package/es/nocode/pages/index.d.ts +14 -0
- package/es/nocode/pages/index.js +41 -0
- package/es/nocode/pages/playground.d.ts +11 -0
- package/es/nocode/pages/playground.js +130 -0
- package/es/nocode/pages/renderer.d.ts +10 -0
- package/es/nocode/pages/renderer.js +144 -0
- package/es/nocode/playground.d.ts +14 -0
- package/es/nocode/playground.js +68 -0
- package/es/page-container/index.d.ts +3 -0
- package/es/page-container/index.js +3 -0
- package/es/page-header/index.d.ts +43 -0
- package/es/page-header/index.js +233 -0
- package/es/page-header/index.scss +169 -0
- package/es/skeleton/index.d.ts +3 -0
- package/es/skeleton/index.js +3 -0
- package/es/table/components/Filter/index.d.ts +9 -0
- package/es/table/components/Filter/index.js +223 -0
- package/es/table/components/Filter/index.scss +23 -0
- package/es/table/components/Layout/index.d.ts +5 -0
- package/es/table/components/Layout/index.js +242 -0
- package/es/table/components/Layout/index.scss +39 -0
- package/es/table/components/QuickAction/index.d.ts +10 -0
- package/es/table/components/QuickAction/index.js +53 -0
- package/es/table/components/QuickAction/index.scss +0 -0
- package/es/table/components/ToolBar/DensityIcon.d.ts +4 -0
- package/es/table/components/ToolBar/DensityIcon.js +117 -0
- package/es/table/components/ToolBar/FilterColumnIcon.d.ts +4 -0
- package/es/table/components/ToolBar/FilterColumnIcon.js +284 -0
- package/es/table/components/ToolBar/FullScreenIcon.d.ts +4 -0
- package/es/table/components/ToolBar/FullScreenIcon.js +89 -0
- package/es/table/components/ToolBar/Fullscreen.d.ts +10 -0
- package/es/table/components/ToolBar/Fullscreen.js +68 -0
- package/es/table/components/ToolBar/RefreshIcon.d.ts +4 -0
- package/es/table/components/ToolBar/RefreshIcon.js +45 -0
- package/es/table/components/ToolBar/index.d.ts +5 -0
- package/es/table/components/ToolBar/index.js +79 -0
- package/es/table/components/ToolBar/index.scss +110 -0
- package/es/table/index.d.ts +6 -0
- package/es/table/index.js +607 -0
- package/es/table/index.scss +103 -0
- package/es/table/typing.d.ts +222 -0
- package/es/table/typing.js +1 -0
- package/es/table/utils/columnRender.d.ts +13 -0
- package/es/table/utils/columnRender.js +185 -0
- package/es/table/utils/genProColumnToColumn.d.ts +9 -0
- package/es/table/utils/genProColumnToColumn.js +51 -0
- package/es/table/utils/getTableProps.d.ts +2 -0
- package/es/table/utils/getTableProps.js +4 -0
- package/es/table/utils/getTableSortIcons.d.ts +3 -0
- package/es/table/utils/getTableSortIcons.js +21 -0
- package/es/table/utils/index.d.ts +4 -0
- package/es/table/utils/index.js +100 -0
- package/es/table/utils/useTableSelection.d.ts +3 -0
- package/es/table/utils/useTableSelection.js +107 -0
- package/es/templates/Detail/index.d.ts +2 -0
- package/es/templates/Detail/index.js +5 -0
- package/es/templates/Detail/index.scss +3 -0
- package/es/templates/Form/index.d.ts +2 -0
- package/es/templates/Form/index.js +5 -0
- package/es/templates/Form/index.scss +3 -0
- package/es/templates/List/index.d.ts +9 -0
- package/es/templates/List/index.js +45 -0
- package/es/templates/List/index.scss +3 -0
- package/es/templates/index.d.ts +5 -0
- package/es/templates/index.js +7 -0
- package/es/templates/index.scss +3 -0
- package/es/utils/index.d.ts +2 -0
- package/es/utils/index.js +2 -0
- package/lib/actions/base.d.ts +13 -0
- package/lib/actions/base.js +33 -0
- package/lib/actions/confirm.d.ts +7 -0
- package/lib/actions/confirm.js +25 -0
- package/lib/actions/danger-confirm.d.ts +7 -0
- package/lib/actions/danger-confirm.js +28 -0
- package/lib/actions/dialog-component.d.ts +10 -0
- package/lib/actions/dialog-component.js +39 -0
- package/lib/actions/dialog-form.d.ts +15 -0
- package/lib/actions/dialog-form.js +152 -0
- package/lib/actions/dialog-table.d.ts +9 -0
- package/lib/actions/dialog-table.js +24 -0
- package/lib/actions/dialog.d.ts +17 -0
- package/lib/actions/dialog.js +219 -0
- package/lib/actions/drawer-form.d.ts +6 -0
- package/lib/actions/drawer-form.js +18 -0
- package/lib/actions/drawer-table.d.ts +6 -0
- package/lib/actions/drawer-table.js +18 -0
- package/lib/actions/drawer.d.ts +6 -0
- package/lib/actions/drawer.js +20 -0
- package/lib/actions/error.d.ts +7 -0
- package/lib/actions/error.js +25 -0
- package/lib/actions/index.d.ts +71 -0
- package/lib/actions/index.js +380 -0
- package/lib/actions/index.scss +34 -0
- package/lib/actions/link.d.ts +14 -0
- package/lib/actions/link.js +60 -0
- package/lib/actions/notice.d.ts +7 -0
- package/lib/actions/notice.js +25 -0
- package/lib/actions/request.d.ts +9 -0
- package/lib/actions/request.js +75 -0
- package/lib/card/index.d.ts +47 -0
- package/lib/card/index.js +179 -0
- package/lib/card/index.scss +98 -0
- package/lib/field/index.d.ts +3 -0
- package/lib/field/index.js +30 -0
- package/lib/form/Components/Editable/index.d.ts +20 -0
- package/lib/form/Components/Editable/index.js +251 -0
- package/lib/form/Components/FormGroup/index.d.ts +13 -0
- package/lib/form/Components/FormGroup/index.js +103 -0
- package/lib/form/Components/FormGroup/index.scss +23 -0
- package/lib/form/Components/ProField/index.d.ts +150 -0
- package/lib/form/Components/ProField/index.js +68 -0
- package/lib/form/Components/Query/index.d.ts +4 -0
- package/lib/form/Components/Query/index.js +91 -0
- package/lib/form/Components/Query/index.scss +90 -0
- package/lib/form/Components/QueryFilter/index.d.ts +3 -0
- package/lib/form/Components/QueryFilter/index.js +130 -0
- package/lib/form/Components/Search/index.d.ts +11 -0
- package/lib/form/Components/Search/index.js +103 -0
- package/lib/form/Filter/index.d.ts +16 -0
- package/lib/form/Filter/index.js +242 -0
- package/lib/form/ProForm/index.d.ts +5 -0
- package/lib/form/ProForm/index.js +125 -0
- package/lib/form/ProForm/index.scss +254 -0
- package/lib/form/SchemaForm/adapterComponent.d.ts +5 -0
- package/lib/form/SchemaForm/adapterComponent.js +27 -0
- package/lib/form/SchemaForm/adapterDecorator.d.ts +6 -0
- package/lib/form/SchemaForm/adapterDecorator.js +34 -0
- package/lib/form/SchemaForm/adapterType.d.ts +5 -0
- package/lib/form/SchemaForm/adapterType.js +62 -0
- package/lib/form/SchemaForm/index.d.ts +4 -0
- package/lib/form/SchemaForm/index.js +302 -0
- package/lib/form/SchemaForm/initializeArrayCards.d.ts +3 -0
- package/lib/form/SchemaForm/initializeArrayCards.js +32 -0
- package/lib/form/SchemaForm/initializeArrayCollapse.d.ts +3 -0
- package/lib/form/SchemaForm/initializeArrayCollapse.js +32 -0
- package/lib/form/SchemaForm/initializeArrayIcon.d.ts +3 -0
- package/lib/form/SchemaForm/initializeArrayIcon.js +68 -0
- package/lib/form/SchemaForm/initializeArrayItems.d.ts +3 -0
- package/lib/form/SchemaForm/initializeArrayItems.js +46 -0
- package/lib/form/SchemaForm/initializeArrayTable.d.ts +3 -0
- package/lib/form/SchemaForm/initializeArrayTable.js +63 -0
- package/lib/form/SchemaForm/initializeFormButton.d.ts +3 -0
- package/lib/form/SchemaForm/initializeFormButton.js +82 -0
- package/lib/form/SchemaForm/initializeFormCollapse.d.ts +3 -0
- package/lib/form/SchemaForm/initializeFormCollapse.js +50 -0
- package/lib/form/SchemaForm/initializeFormGroup.d.ts +3 -0
- package/lib/form/SchemaForm/initializeFormGroup.js +53 -0
- package/lib/form/SchemaForm/initializeFormStep.d.ts +3 -0
- package/lib/form/SchemaForm/initializeFormStep.js +55 -0
- package/lib/form/SchemaForm/initializeFormTab.d.ts +3 -0
- package/lib/form/SchemaForm/initializeFormTab.js +60 -0
- package/lib/form/SchemaForm/initializeProField.d.ts +5 -0
- package/lib/form/SchemaForm/initializeProField.js +74 -0
- package/lib/form/SchemaForm/initializeRequest.d.ts +11 -0
- package/lib/form/SchemaForm/initializeRequest.js +34 -0
- package/lib/form/SchemaForm/reactions.d.ts +4 -0
- package/lib/form/SchemaForm/reactions.js +72 -0
- package/lib/form/index.d.ts +27 -0
- package/lib/form/index.js +139 -0
- package/lib/form/typing.d.ts +69 -0
- package/lib/form/typing.js +5 -0
- package/lib/form/utils.d.ts +9 -0
- package/lib/form/utils.js +124 -0
- package/lib/form/warning.d.ts +3 -0
- package/lib/form/warning.js +24 -0
- package/lib/hooks/index.d.ts +2 -0
- package/lib/hooks/index.js +17 -0
- package/lib/index.d.ts +24 -0
- package/lib/index.js +244 -0
- package/lib/info/components/FormItem/index.d.ts +5 -0
- package/lib/info/components/FormItem/index.js +78 -0
- package/lib/info/components/FormItem/index.scss +60 -0
- package/lib/info/components/InfoGroup/index.d.ts +5 -0
- package/lib/info/components/InfoGroup/index.js +67 -0
- package/lib/info/components/InfoGroup/index.scss +14 -0
- package/lib/info/components/InfoValueItem/index.d.ts +5 -0
- package/lib/info/components/InfoValueItem/index.js +249 -0
- package/lib/info/components/InfoValueItem/index.scss +21 -0
- package/lib/info/components/baseInfo/index.d.ts +7 -0
- package/lib/info/components/baseInfo/index.js +100 -0
- package/lib/info/components/baseInfo/index.scss +3 -0
- package/lib/info/components/headerInfo/index.d.ts +7 -0
- package/lib/info/components/headerInfo/index.js +112 -0
- package/lib/info/components/headerInfo/index.scss +0 -0
- package/lib/info/components/tableInfo/index.d.ts +8 -0
- package/lib/info/components/tableInfo/index.js +197 -0
- package/lib/info/components/tableInfo/index.scss +18 -0
- package/lib/info/index.d.ts +10 -0
- package/lib/info/index.js +123 -0
- package/lib/info/index.scss +12 -0
- package/lib/info/typing.d.ts +157 -0
- package/lib/info/typing.js +5 -0
- package/lib/info/utils/index.d.ts +12 -0
- package/lib/info/utils/index.js +50 -0
- package/lib/info/utils/layout.d.ts +2 -0
- package/lib/info/utils/layout.js +65 -0
- package/lib/info/utils/useInfoRequest.d.ts +14 -0
- package/lib/info/utils/useInfoRequest.js +82 -0
- package/lib/info/utils/utils.d.ts +1 -0
- package/lib/info/utils/utils.js +20 -0
- package/lib/layout/index.d.ts +2 -0
- package/lib/layout/index.js +10 -0
- package/lib/nocode/configurators/Card.d.ts +3 -0
- package/lib/nocode/configurators/Card.js +116 -0
- package/lib/nocode/configurators/PageHeader.d.ts +3 -0
- package/lib/nocode/configurators/PageHeader.js +211 -0
- package/lib/nocode/configurators/ProTable.d.ts +3 -0
- package/lib/nocode/configurators/ProTable.js +329 -0
- package/lib/nocode/configurators/common.d.ts +188 -0
- package/lib/nocode/configurators/common.js +329 -0
- package/lib/nocode/configurators/index.d.ts +15 -0
- package/lib/nocode/configurators/index.js +44 -0
- package/lib/nocode/configurators/map.d.ts +2 -0
- package/lib/nocode/configurators/map.js +21 -0
- package/lib/nocode/index.d.ts +8 -0
- package/lib/nocode/index.js +76 -0
- package/lib/nocode/index.scss +93 -0
- package/lib/nocode/pages/editor.d.ts +12 -0
- package/lib/nocode/pages/editor.js +58 -0
- package/lib/nocode/pages/index.d.ts +14 -0
- package/lib/nocode/pages/index.js +93 -0
- package/lib/nocode/pages/playground.d.ts +11 -0
- package/lib/nocode/pages/playground.js +158 -0
- package/lib/nocode/pages/renderer.d.ts +10 -0
- package/lib/nocode/pages/renderer.js +164 -0
- package/lib/nocode/playground.d.ts +14 -0
- package/lib/nocode/playground.js +91 -0
- package/lib/page-container/index.d.ts +3 -0
- package/lib/page-container/index.js +30 -0
- package/lib/page-header/index.d.ts +43 -0
- package/lib/page-header/index.js +252 -0
- package/lib/page-header/index.scss +169 -0
- package/lib/skeleton/index.d.ts +3 -0
- package/lib/skeleton/index.js +30 -0
- package/lib/table/components/Filter/index.d.ts +9 -0
- package/lib/table/components/Filter/index.js +244 -0
- package/lib/table/components/Filter/index.scss +23 -0
- package/lib/table/components/Layout/index.d.ts +5 -0
- package/lib/table/components/Layout/index.js +266 -0
- package/lib/table/components/Layout/index.scss +39 -0
- package/lib/table/components/QuickAction/index.d.ts +10 -0
- package/lib/table/components/QuickAction/index.js +65 -0
- package/lib/table/components/QuickAction/index.scss +0 -0
- package/lib/table/components/ToolBar/DensityIcon.d.ts +4 -0
- package/lib/table/components/ToolBar/DensityIcon.js +135 -0
- package/lib/table/components/ToolBar/FilterColumnIcon.d.ts +4 -0
- package/lib/table/components/ToolBar/FilterColumnIcon.js +303 -0
- package/lib/table/components/ToolBar/FullScreenIcon.d.ts +4 -0
- package/lib/table/components/ToolBar/FullScreenIcon.js +107 -0
- package/lib/table/components/ToolBar/Fullscreen.d.ts +10 -0
- package/lib/table/components/ToolBar/Fullscreen.js +85 -0
- package/lib/table/components/ToolBar/RefreshIcon.d.ts +4 -0
- package/lib/table/components/ToolBar/RefreshIcon.js +60 -0
- package/lib/table/components/ToolBar/index.d.ts +5 -0
- package/lib/table/components/ToolBar/index.js +96 -0
- package/lib/table/components/ToolBar/index.scss +110 -0
- package/lib/table/index.d.ts +6 -0
- package/lib/table/index.js +662 -0
- package/lib/table/index.scss +103 -0
- package/lib/table/typing.d.ts +222 -0
- package/lib/table/typing.js +5 -0
- package/lib/table/utils/columnRender.d.ts +13 -0
- package/lib/table/utils/columnRender.js +201 -0
- package/lib/table/utils/genProColumnToColumn.d.ts +9 -0
- package/lib/table/utils/genProColumnToColumn.js +62 -0
- package/lib/table/utils/getTableProps.d.ts +2 -0
- package/lib/table/utils/getTableProps.js +13 -0
- package/lib/table/utils/getTableSortIcons.d.ts +3 -0
- package/lib/table/utils/getTableSortIcons.js +34 -0
- package/lib/table/utils/index.d.ts +4 -0
- package/lib/table/utils/index.js +112 -0
- package/lib/table/utils/useTableSelection.d.ts +3 -0
- package/lib/table/utils/useTableSelection.js +112 -0
- package/lib/templates/Detail/index.d.ts +2 -0
- package/lib/templates/Detail/index.js +18 -0
- package/lib/templates/Detail/index.scss +3 -0
- package/lib/templates/Form/index.d.ts +2 -0
- package/lib/templates/Form/index.js +18 -0
- package/lib/templates/Form/index.scss +3 -0
- package/lib/templates/List/index.d.ts +9 -0
- package/lib/templates/List/index.js +67 -0
- package/lib/templates/List/index.scss +3 -0
- package/lib/templates/index.d.ts +5 -0
- package/lib/templates/index.js +59 -0
- package/lib/templates/index.scss +3 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.js +17 -0
- package/package.json +5 -5
@@ -0,0 +1,43 @@
|
|
1
|
+
var _excluded = ["children", "title", "props"],
|
2
|
+
_excluded2 = ["children"];
|
3
|
+
|
4
|
+
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; }
|
5
|
+
|
6
|
+
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; }
|
7
|
+
|
8
|
+
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; }
|
9
|
+
|
10
|
+
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; }
|
11
|
+
|
12
|
+
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; }
|
13
|
+
|
14
|
+
var initializeCollapsePanel = function initializeCollapsePanel(item) {
|
15
|
+
var _item$children = item.children,
|
16
|
+
children = _item$children === void 0 ? [] : _item$children,
|
17
|
+
title = item.title,
|
18
|
+
_item$props = item.props,
|
19
|
+
props = _item$props === void 0 ? {} : _item$props,
|
20
|
+
otherProps = _objectWithoutProperties(item, _excluded);
|
21
|
+
|
22
|
+
return _objectSpread({
|
23
|
+
component: 'FormCollapse.CollapsePanel',
|
24
|
+
props: _objectSpread({
|
25
|
+
title: title
|
26
|
+
}, props),
|
27
|
+
children: children
|
28
|
+
}, otherProps);
|
29
|
+
};
|
30
|
+
|
31
|
+
var initialize = function initialize(item) {
|
32
|
+
var _item$children2 = item.children,
|
33
|
+
children = _item$children2 === void 0 ? [] : _item$children2,
|
34
|
+
otherProps = _objectWithoutProperties(item, _excluded2);
|
35
|
+
|
36
|
+
return _objectSpread({
|
37
|
+
children: children.map(function (item) {
|
38
|
+
return initializeCollapsePanel(item);
|
39
|
+
})
|
40
|
+
}, otherProps);
|
41
|
+
};
|
42
|
+
|
43
|
+
export default initialize;
|
@@ -0,0 +1,46 @@
|
|
1
|
+
var _excluded = ["props", "children", "title"],
|
2
|
+
_excluded2 = ["props", "children"];
|
3
|
+
|
4
|
+
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; }
|
5
|
+
|
6
|
+
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; }
|
7
|
+
|
8
|
+
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; }
|
9
|
+
|
10
|
+
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; }
|
11
|
+
|
12
|
+
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; }
|
13
|
+
|
14
|
+
var initializeGroupPanel = function initializeGroupPanel(item) {
|
15
|
+
var _item$props = item.props,
|
16
|
+
props = _item$props === void 0 ? {} : _item$props,
|
17
|
+
_item$children = item.children,
|
18
|
+
children = _item$children === void 0 ? [] : _item$children,
|
19
|
+
title = item.title,
|
20
|
+
otherProps = _objectWithoutProperties(item, _excluded);
|
21
|
+
|
22
|
+
return _objectSpread({
|
23
|
+
component: 'FormGroup.GroupPanel',
|
24
|
+
props: _objectSpread({
|
25
|
+
title: title
|
26
|
+
}, props),
|
27
|
+
children: children
|
28
|
+
}, otherProps);
|
29
|
+
};
|
30
|
+
|
31
|
+
var initialize = function initialize(item) {
|
32
|
+
var _item$props2 = item.props,
|
33
|
+
props = _item$props2 === void 0 ? {} : _item$props2,
|
34
|
+
_item$children2 = item.children,
|
35
|
+
children = _item$children2 === void 0 ? [] : _item$children2,
|
36
|
+
otherProps = _objectWithoutProperties(item, _excluded2);
|
37
|
+
|
38
|
+
return _objectSpread({
|
39
|
+
props: props,
|
40
|
+
children: children.map(function (item) {
|
41
|
+
return initializeGroupPanel(item);
|
42
|
+
})
|
43
|
+
}, otherProps);
|
44
|
+
};
|
45
|
+
|
46
|
+
export default initialize;
|
@@ -0,0 +1,48 @@
|
|
1
|
+
var _excluded = ["props", "children", "title"],
|
2
|
+
_excluded2 = ["props", "children"];
|
3
|
+
|
4
|
+
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; }
|
5
|
+
|
6
|
+
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; }
|
7
|
+
|
8
|
+
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; }
|
9
|
+
|
10
|
+
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; }
|
11
|
+
|
12
|
+
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; }
|
13
|
+
|
14
|
+
var initializeStepPane = function initializeStepPane(item) {
|
15
|
+
var _item$props = item.props,
|
16
|
+
props = _item$props === void 0 ? {} : _item$props,
|
17
|
+
_item$children = item.children,
|
18
|
+
children = _item$children === void 0 ? [] : _item$children,
|
19
|
+
title = item.title,
|
20
|
+
otherProps = _objectWithoutProperties(item, _excluded);
|
21
|
+
|
22
|
+
return _objectSpread({
|
23
|
+
component: 'FormStep.StepPane',
|
24
|
+
props: _objectSpread({
|
25
|
+
title: title
|
26
|
+
}, props),
|
27
|
+
children: children
|
28
|
+
}, otherProps);
|
29
|
+
};
|
30
|
+
|
31
|
+
var initialize = function initialize(item) {
|
32
|
+
var _item$props2 = item.props,
|
33
|
+
props = _item$props2 === void 0 ? {} : _item$props2,
|
34
|
+
_item$children2 = item.children,
|
35
|
+
children = _item$children2 === void 0 ? [] : _item$children2,
|
36
|
+
otherProps = _objectWithoutProperties(item, _excluded2);
|
37
|
+
|
38
|
+
return _objectSpread({
|
39
|
+
props: _objectSpread({
|
40
|
+
labelPlacement: 'hoz'
|
41
|
+
}, props),
|
42
|
+
children: children.map(function (item) {
|
43
|
+
return initializeStepPane(item);
|
44
|
+
})
|
45
|
+
}, otherProps);
|
46
|
+
};
|
47
|
+
|
48
|
+
export default initialize;
|
@@ -0,0 +1,53 @@
|
|
1
|
+
var _excluded = ["props", "children", "title"],
|
2
|
+
_excluded2 = ["props", "children"];
|
3
|
+
|
4
|
+
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; }
|
5
|
+
|
6
|
+
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; }
|
7
|
+
|
8
|
+
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; }
|
9
|
+
|
10
|
+
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; }
|
11
|
+
|
12
|
+
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; }
|
13
|
+
|
14
|
+
var initializeTabPane = function initializeTabPane(item) {
|
15
|
+
var _item$props = item.props,
|
16
|
+
props = _item$props === void 0 ? {} : _item$props,
|
17
|
+
_item$children = item.children,
|
18
|
+
children = _item$children === void 0 ? [] : _item$children,
|
19
|
+
title = item.title,
|
20
|
+
otherProps = _objectWithoutProperties(item, _excluded);
|
21
|
+
|
22
|
+
return _objectSpread({
|
23
|
+
component: 'FormTab.TabPane',
|
24
|
+
props: _objectSpread({
|
25
|
+
tab: title
|
26
|
+
}, props),
|
27
|
+
children: children
|
28
|
+
}, otherProps);
|
29
|
+
};
|
30
|
+
|
31
|
+
var initialize = function initialize(item) {
|
32
|
+
var _item$props2 = item.props,
|
33
|
+
props = _item$props2 === void 0 ? {} : _item$props2,
|
34
|
+
_item$children2 = item.children,
|
35
|
+
children = _item$children2 === void 0 ? [] : _item$children2,
|
36
|
+
otherProps = _objectWithoutProperties(item, _excluded2);
|
37
|
+
|
38
|
+
return _objectSpread({
|
39
|
+
props: _objectSpread({
|
40
|
+
navStyle: {
|
41
|
+
lineHeight: 1.5
|
42
|
+
},
|
43
|
+
contentStyle: {
|
44
|
+
paddingTop: 16
|
45
|
+
}
|
46
|
+
}, props),
|
47
|
+
children: children.map(function (item) {
|
48
|
+
return initializeTabPane(item);
|
49
|
+
})
|
50
|
+
}, otherProps);
|
51
|
+
};
|
52
|
+
|
53
|
+
export default initialize;
|
@@ -0,0 +1,67 @@
|
|
1
|
+
var _excluded = ["component", "props"];
|
2
|
+
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
4
|
+
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
6
|
+
|
7
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
8
|
+
|
9
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
10
|
+
|
11
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
12
|
+
|
13
|
+
var proFieldTypeMap = {
|
14
|
+
Input: 'text',
|
15
|
+
Password: 'password',
|
16
|
+
TextArea: 'textArea',
|
17
|
+
NumberPicker: 'number',
|
18
|
+
Percent: 'percent',
|
19
|
+
Money: 'money',
|
20
|
+
Select: 'select',
|
21
|
+
MultipleSelect: 'multipleSelect',
|
22
|
+
TreeSelect: 'treeSelect',
|
23
|
+
Cascader: 'cascader',
|
24
|
+
MultipleCascader: 'multipleCascader',
|
25
|
+
ArbitraryCascader: 'arbitraryCascader',
|
26
|
+
Radio: 'radio',
|
27
|
+
Checkbox: 'checkbox',
|
28
|
+
Switch: 'switch',
|
29
|
+
DatePicker: 'date',
|
30
|
+
TimePicker: 'time',
|
31
|
+
DateTimePicker: 'dateTime',
|
32
|
+
WeekPicker: 'dateWeek',
|
33
|
+
MonthPicker: 'dateMonth',
|
34
|
+
YearPicker: 'dateYear',
|
35
|
+
QuarterPicker: 'dateQuarter',
|
36
|
+
DateRangePicker: 'dateRange',
|
37
|
+
TimeRangePicker: 'timeRange',
|
38
|
+
DateTimeRangePicker: 'dateTimeRange',
|
39
|
+
WeekRangePicker: 'dateWeekRange',
|
40
|
+
MonthRangePicker: 'dateMonthRange',
|
41
|
+
YearRangePicker: 'dateYearRange',
|
42
|
+
QuarterRangePicker: 'dateQuarterRange',
|
43
|
+
Transfer: 'transfer',
|
44
|
+
ColorPicker: 'color',
|
45
|
+
ColorRadio: 'colorRadio',
|
46
|
+
IconPicker: 'icon',
|
47
|
+
JsonInput: 'json',
|
48
|
+
Search: 'search' // Upload: 'upload',
|
49
|
+
|
50
|
+
};
|
51
|
+
|
52
|
+
var initialize = function initialize(item) {
|
53
|
+
var component = item.component,
|
54
|
+
_item$props = item.props,
|
55
|
+
props = _item$props === void 0 ? {} : _item$props,
|
56
|
+
otherProps = _objectWithoutProperties(item, _excluded);
|
57
|
+
|
58
|
+
return _objectSpread({
|
59
|
+
component: 'ProField',
|
60
|
+
props: _objectSpread({
|
61
|
+
type: proFieldTypeMap[component]
|
62
|
+
}, props)
|
63
|
+
}, otherProps);
|
64
|
+
};
|
65
|
+
|
66
|
+
export { proFieldTypeMap };
|
67
|
+
export default initialize;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { IRequestConfig } from '../';
|
2
|
+
interface IInitializeRequest {
|
3
|
+
(requestConfig?: IRequestConfig): {
|
4
|
+
reactions: any[];
|
5
|
+
scope: {
|
6
|
+
[x: string]: any;
|
7
|
+
};
|
8
|
+
};
|
9
|
+
}
|
10
|
+
declare const initializeRequest: IInitializeRequest;
|
11
|
+
export default initializeRequest;
|
@@ -0,0 +1,25 @@
|
|
1
|
+
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; }
|
2
|
+
|
3
|
+
import { useRequest, useAsyncDataSource } from '../SchemaForm/reactions';
|
4
|
+
import { getRandomName } from '../utils';
|
5
|
+
|
6
|
+
var initializeRequest = function initializeRequest(requestConfig) {
|
7
|
+
if (requestConfig) {
|
8
|
+
var _scope;
|
9
|
+
|
10
|
+
// todo 可根据request的功能类型配置不同内置的方法,如:useAsyncDataSource
|
11
|
+
var requestScopeName = getRandomName('$request');
|
12
|
+
var dataSourceScopeName = "$dataSource";
|
13
|
+
return {
|
14
|
+
reactions: ["{{".concat(dataSourceScopeName, "(").concat(requestScopeName, ")}}")],
|
15
|
+
scope: (_scope = {}, _defineProperty(_scope, requestScopeName, useRequest(requestConfig)), _defineProperty(_scope, dataSourceScopeName, useAsyncDataSource), _scope)
|
16
|
+
};
|
17
|
+
}
|
18
|
+
|
19
|
+
return {
|
20
|
+
reactions: [],
|
21
|
+
scope: {}
|
22
|
+
};
|
23
|
+
};
|
24
|
+
|
25
|
+
export default initializeRequest;
|
@@ -0,0 +1,62 @@
|
|
1
|
+
import { request, isObj, isFn, paramMap, listToTree } from '@teamix/utils'; // 配置请求
|
2
|
+
|
3
|
+
var useRequest = function useRequest(requestConfig) {
|
4
|
+
return function (field) {
|
5
|
+
var url = requestConfig.url,
|
6
|
+
method = requestConfig.method,
|
7
|
+
params = requestConfig.params,
|
8
|
+
data = requestConfig.data,
|
9
|
+
when = requestConfig.when,
|
10
|
+
formatResult = requestConfig.formatResult,
|
11
|
+
onSuccess = requestConfig.onSuccess,
|
12
|
+
onError = requestConfig.onError;
|
13
|
+
var whenResult = isFn(when) ? when(field) : {};
|
14
|
+
|
15
|
+
var _ref = isObj(whenResult) ? whenResult : {},
|
16
|
+
newParams = _ref.params,
|
17
|
+
newData = _ref.data;
|
18
|
+
|
19
|
+
if (when && whenResult === false) {
|
20
|
+
return Promise.reject();
|
21
|
+
}
|
22
|
+
|
23
|
+
return request({
|
24
|
+
method: method,
|
25
|
+
url: url,
|
26
|
+
params: newParams !== null && newParams !== void 0 ? newParams : params,
|
27
|
+
data: newData !== null && newData !== void 0 ? newData : data
|
28
|
+
}).then(function (data) {
|
29
|
+
// 默认按request返回res.data.data处理
|
30
|
+
var dataSource = formatResult ? formatResult(data, {
|
31
|
+
paramMap: paramMap,
|
32
|
+
listToTree: listToTree
|
33
|
+
}) : data;
|
34
|
+
onSuccess && onSuccess(dataSource, field);
|
35
|
+
return dataSource;
|
36
|
+
}).catch(function (error) {
|
37
|
+
onError && onError(error);
|
38
|
+
return error;
|
39
|
+
});
|
40
|
+
};
|
41
|
+
}; // 配置DataSource
|
42
|
+
|
43
|
+
|
44
|
+
var useAsyncDataSource = function useAsyncDataSource(services) {
|
45
|
+
return function (field) {
|
46
|
+
field.setState({
|
47
|
+
loading: true
|
48
|
+
});
|
49
|
+
services(field).then(function (dataSource) {
|
50
|
+
field.setState({
|
51
|
+
dataSource: dataSource,
|
52
|
+
loading: false
|
53
|
+
});
|
54
|
+
}).catch(function () {
|
55
|
+
field.setState({
|
56
|
+
loading: false
|
57
|
+
});
|
58
|
+
});
|
59
|
+
};
|
60
|
+
};
|
61
|
+
|
62
|
+
export { useRequest, useAsyncDataSource };
|
@@ -0,0 +1,27 @@
|
|
1
|
+
/**
|
2
|
+
* 导出ProForm的TS
|
3
|
+
*/
|
4
|
+
export * from './typing';
|
5
|
+
/**
|
6
|
+
* 使用别名导出formily相关内容
|
7
|
+
*/
|
8
|
+
export * as formilyCore from '@formily/core';
|
9
|
+
export * as formilyReact from '@formily/react';
|
10
|
+
export * as formilyReactive from '@formily/reactive';
|
11
|
+
export * as formilyTeamix from '@teamix/formily';
|
12
|
+
/**
|
13
|
+
* 导出常用formily内容,需谨慎限制
|
14
|
+
*/
|
15
|
+
import { createForm, registerValidateRules as registerRules, registerValidateFormats as registerFormats, registerValidateLocale, setValidateLanguage } from '@formily/core';
|
16
|
+
import { FormConsumer } from '@formily/react';
|
17
|
+
export { createForm, FormConsumer, registerRules, registerFormats, registerValidateLocale, setValidateLanguage, };
|
18
|
+
/**
|
19
|
+
* 导出 Filter 组件
|
20
|
+
*/
|
21
|
+
import { AdvancedFilter, SimpleFilter, QueryFilter } from './Filter';
|
22
|
+
export { AdvancedFilter, SimpleFilter, QueryFilter };
|
23
|
+
/**
|
24
|
+
* 导出 ProForm 组件,支持快速搭建表单
|
25
|
+
*/
|
26
|
+
import ProForm from './ProForm';
|
27
|
+
export default ProForm;
|
package/es/form/index.js
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
/**
|
2
|
+
* 导出ProForm的TS
|
3
|
+
*/
|
4
|
+
export * from './typing';
|
5
|
+
/**
|
6
|
+
* 使用别名导出formily相关内容
|
7
|
+
*/
|
8
|
+
|
9
|
+
import * as _formilyCore from '@formily/core';
|
10
|
+
export { _formilyCore as formilyCore };
|
11
|
+
import * as _formilyReact from '@formily/react';
|
12
|
+
export { _formilyReact as formilyReact };
|
13
|
+
import * as _formilyReactive from '@formily/reactive';
|
14
|
+
export { _formilyReactive as formilyReactive };
|
15
|
+
import * as _formilyTeamix from '@teamix/formily';
|
16
|
+
export { _formilyTeamix as formilyTeamix };
|
17
|
+
/**
|
18
|
+
* 导出常用formily内容,需谨慎限制
|
19
|
+
*/
|
20
|
+
|
21
|
+
import { createForm, registerValidateRules as registerRules, registerValidateFormats as registerFormats, registerValidateLocale, setValidateLanguage } from '@formily/core';
|
22
|
+
import { FormConsumer } from '@formily/react';
|
23
|
+
export { createForm, FormConsumer, registerRules, registerFormats, registerValidateLocale, setValidateLanguage };
|
24
|
+
/**
|
25
|
+
* 导出 Filter 组件
|
26
|
+
*/
|
27
|
+
|
28
|
+
import { AdvancedFilter, SimpleFilter, QueryFilter } from './Filter';
|
29
|
+
export { AdvancedFilter, SimpleFilter, QueryFilter };
|
30
|
+
/**
|
31
|
+
* 导出 ProForm 组件,支持快速搭建表单
|
32
|
+
*/
|
33
|
+
|
34
|
+
import ProForm from './ProForm';
|
35
|
+
export default ProForm;
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import type { ReactNode } from 'react';
|
2
|
+
import type { IFormFeedback, Form as FormType, FieldPatternTypes } from '@formily/core';
|
3
|
+
import type { IFormLayoutProps } from '@teamix/formily';
|
4
|
+
import { CommonRequestConfig } from '@teamix/utils';
|
5
|
+
export interface anyObject {
|
6
|
+
[propName: string]: any;
|
7
|
+
}
|
8
|
+
declare type FieldDisplayTypes = 'none' | 'hidden' | 'visible';
|
9
|
+
export declare type IBaseComponent = 'Input' | 'Password' | 'TextArea' | 'NumberPicker' | 'Percent' | 'Money' | 'Select' | 'MultipleSelect' | 'TreeSelect' | 'Cascader' | 'MultipleCascader' | 'ArbitraryCascader' | 'Radio' | 'Checkbox' | 'Switch' | 'DatePicker' | 'TimePicker' | 'DateTimePicker' | 'WeekPicker' | 'MonthPicker' | 'YearPicker' | 'QuarterPicker' | 'DateRangePicker' | 'TimeRangePicker' | 'DateTimeRangePicker' | 'WeekRangePicker' | 'MonthRangePicker' | 'YearRangePicker' | 'QuarterRangePicker' | 'Transfer' | 'Upload' | 'ColorPicker' | 'ColorRadio' | 'IconPicker' | 'JsonInput';
|
10
|
+
export declare type IButtonComponent = 'Submit' | 'Reset';
|
11
|
+
export declare type IComboComponent = 'ArrayCards' | 'ArrayCards.Addition' | 'ArrayCards.Remove' | 'ArrayCards.MoveUp' | 'ArrayCards.MoveDown' | 'ArrayCards.Index' | 'ArrayCollapse' | 'ArrayCollapse.CollapsePanel' | 'ArrayCollapse.Addition' | 'ArrayCollapse.Remove' | 'ArrayCollapse.MoveUp' | 'ArrayCollapse.MoveDown' | 'ArrayCollapse.Index' | 'ArrayTable' | 'ArrayTable.Column' | 'ArrayTable.SortHandle' | 'ArrayTable.Addition' | 'ArrayTable.Remove' | 'ArrayTable.MoveDown' | 'ArrayTable.MoveUp' | 'ArrayTable.Index' | 'ArrayItems' | 'ArrayItems.Item' | 'ArrayItems.SortHandle' | 'ArrayItems.Addition' | 'ArrayItems.Remove' | 'ArrayItems.MoveDown' | 'ArrayItems.MoveUp' | 'ArrayItems.Index' | 'Editable' | 'Editable.Popover' | 'Editable.Dialog' | 'Editable.Drawer';
|
12
|
+
export declare type ILayoutComponent = 'FormFlex' | 'FormGrid' | 'FormGroup' | 'FormGroup.GroupPanel' | 'Search' | 'Search.SearchPanel' | 'FormTab' | 'FormTab.TabPane' | 'FormStep' | 'FormStep.StepPane' | 'FormCollapse' | 'FormCollapse.CollapsePanel' | 'FormButtonGroup' | 'FormDialog' | 'FormDrawer' | 'FormDialog.Footer' | 'FormDrawer.Footer';
|
13
|
+
export interface IRequestConfig extends CommonRequestConfig {
|
14
|
+
when?: (field: any) => any;
|
15
|
+
formatResult?: (res: any, utils?: any) => any;
|
16
|
+
onSuccess?: (res: any, field?: any) => any;
|
17
|
+
onError?: (res: any) => any;
|
18
|
+
}
|
19
|
+
export interface IFormSchemaItem {
|
20
|
+
type?: string;
|
21
|
+
name?: string;
|
22
|
+
description?: React.ReactNode;
|
23
|
+
title?: string;
|
24
|
+
component?: IBaseComponent | IButtonComponent | IComboComponent | ILayoutComponent | 'ProField' | any;
|
25
|
+
props?: anyObject | any;
|
26
|
+
decorator?: string | null;
|
27
|
+
decoratorProps?: anyObject;
|
28
|
+
dataSource?: any[];
|
29
|
+
reactions?: any;
|
30
|
+
rules?: any;
|
31
|
+
items?: IFormSchemaItem;
|
32
|
+
children?: IFormSchemaItem[];
|
33
|
+
content?: any;
|
34
|
+
tooltip?: string;
|
35
|
+
required?: boolean;
|
36
|
+
display?: FieldDisplayTypes;
|
37
|
+
visible?: boolean;
|
38
|
+
hidden?: boolean;
|
39
|
+
disabled?: boolean;
|
40
|
+
readOnly?: boolean;
|
41
|
+
readPretty?: boolean;
|
42
|
+
pattern?: FieldPatternTypes;
|
43
|
+
default?: any;
|
44
|
+
request?: IRequestConfig;
|
45
|
+
}
|
46
|
+
export declare type IFormSchema = IFormSchemaItem[];
|
47
|
+
export interface IInitializeItem {
|
48
|
+
(item: IFormSchemaItem, props?: any): IFormSchemaItem;
|
49
|
+
}
|
50
|
+
export interface IFormProps extends IFormLayoutProps {
|
51
|
+
form?: FormType | false;
|
52
|
+
schema: IFormSchema;
|
53
|
+
scope?: any;
|
54
|
+
components?: {
|
55
|
+
[key: string]: React.FC | React.ComponentClass;
|
56
|
+
};
|
57
|
+
children?: React.ReactNode;
|
58
|
+
initialValues?: object;
|
59
|
+
previewTextPlaceholder?: ReactNode;
|
60
|
+
onChange?: (values: any) => any;
|
61
|
+
onSubmit?: (values: any) => any;
|
62
|
+
onSubmitFailed?: (feedbacks: IFormFeedback[]) => void;
|
63
|
+
}
|
64
|
+
export interface IFilterProps extends IFormProps {
|
65
|
+
triggerType?: 'keydown' | 'change' | 'submit';
|
66
|
+
onFilter?: (values: any) => void;
|
67
|
+
onReset?: (payload?: any) => void;
|
68
|
+
}
|
69
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
interface IGetRandomName {
|
2
|
+
(prefix?: string): string;
|
3
|
+
}
|
4
|
+
declare const mapSize: (props: any, field: any) => any;
|
5
|
+
declare const mapStatus: (props: any, field: any) => any;
|
6
|
+
declare const getRandomName: IGetRandomName;
|
7
|
+
declare const commonFormat: (obj: any) => any;
|
8
|
+
declare const mergeArrayValue: (arr: any[], v?: any) => any[];
|
9
|
+
export { getRandomName, mapSize, mapStatus, commonFormat, mergeArrayValue };
|
package/es/form/utils.js
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
2
|
+
|
3
|
+
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."); }
|
4
|
+
|
5
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
6
|
+
|
7
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
8
|
+
|
9
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
10
|
+
|
11
|
+
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."); }
|
12
|
+
|
13
|
+
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); }
|
14
|
+
|
15
|
+
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; }
|
16
|
+
|
17
|
+
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; }
|
18
|
+
|
19
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
20
|
+
|
21
|
+
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; }
|
22
|
+
|
23
|
+
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; }
|
24
|
+
|
25
|
+
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; }
|
26
|
+
|
27
|
+
import { useFormLayout, useFormShallowLayout } from '@teamix/formily';
|
28
|
+
import { isArr, isObj } from '@teamix/utils';
|
29
|
+
|
30
|
+
var mapSize = function mapSize(props, field) {
|
31
|
+
var layout = _objectSpread(_objectSpread({}, useFormShallowLayout()), useFormLayout());
|
32
|
+
|
33
|
+
var takeSize = function takeSize() {
|
34
|
+
return layout.size === 'default' ? 'medium' : layout.size;
|
35
|
+
};
|
36
|
+
|
37
|
+
return _objectSpread(_objectSpread({}, props), {}, {
|
38
|
+
size: props.size || takeSize()
|
39
|
+
});
|
40
|
+
};
|
41
|
+
|
42
|
+
var mapStatus = function mapStatus(props, field) {
|
43
|
+
var takeStatus = function takeStatus() {
|
44
|
+
var _field$warnings, _field$decoratorProps, _field$decoratorProps2;
|
45
|
+
|
46
|
+
if (!field) return;
|
47
|
+
if (field['loading'] || field['validating']) return 'loading';
|
48
|
+
if (field['invalid']) return 'error';
|
49
|
+
if ((_field$warnings = field['warnings']) === null || _field$warnings === void 0 ? void 0 : _field$warnings.length) return 'warning';
|
50
|
+
if (((_field$decoratorProps = field.decoratorProps) === null || _field$decoratorProps === void 0 ? void 0 : _field$decoratorProps.feedbackStatus) === 'pending') return 'loading'; // 新增
|
51
|
+
|
52
|
+
return (_field$decoratorProps2 = field.decoratorProps) === null || _field$decoratorProps2 === void 0 ? void 0 : _field$decoratorProps2.feedbackStatus;
|
53
|
+
};
|
54
|
+
|
55
|
+
var takeState = function takeState(state) {
|
56
|
+
if (state === 'validating' || state === 'pending') return 'loading';
|
57
|
+
return state;
|
58
|
+
};
|
59
|
+
|
60
|
+
return _objectSpread(_objectSpread({}, props), {}, {
|
61
|
+
state: takeState(props.state) || takeStatus()
|
62
|
+
});
|
63
|
+
};
|
64
|
+
|
65
|
+
var getRandomName = function getRandomName() {
|
66
|
+
var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'name';
|
67
|
+
return "".concat(prefix, "_").concat(Math.floor(Math.random() * Math.pow(10, 18)));
|
68
|
+
};
|
69
|
+
|
70
|
+
var commonFormat = function commonFormat(obj) {
|
71
|
+
var temp = {};
|
72
|
+
Object.entries(obj).map(function (_ref) {
|
73
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
74
|
+
key = _ref2[0],
|
75
|
+
value = _ref2[1];
|
76
|
+
|
77
|
+
if (value) {
|
78
|
+
if (isArr(value)) {
|
79
|
+
if (value.length) {
|
80
|
+
temp[key] = value;
|
81
|
+
}
|
82
|
+
} else if (isObj(value)) {
|
83
|
+
if (Object.keys(value).length) {
|
84
|
+
temp[key] = value;
|
85
|
+
}
|
86
|
+
} else {
|
87
|
+
temp[key] = value;
|
88
|
+
}
|
89
|
+
}
|
90
|
+
});
|
91
|
+
return temp;
|
92
|
+
};
|
93
|
+
|
94
|
+
var mergeArrayValue = function mergeArrayValue(arr, v) {
|
95
|
+
if (isArr(v)) {
|
96
|
+
return [].concat(_toConsumableArray(arr), _toConsumableArray(v));
|
97
|
+
}
|
98
|
+
|
99
|
+
return [].concat(_toConsumableArray(arr), [v]);
|
100
|
+
|
101
|
+
if (v !== undefined) {
|
102
|
+
return [].concat(_toConsumableArray(arr), [v]);
|
103
|
+
}
|
104
|
+
|
105
|
+
return arr;
|
106
|
+
};
|
107
|
+
|
108
|
+
export { getRandomName, mapSize, mapStatus, commonFormat, mergeArrayValue };
|