@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,150 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
declare const _default: React.ForwardRefExoticComponent<(Partial<import("@teamix/pro-field/lib/components/FieldText").IProFieldText & {
|
3
|
+
type: "text";
|
4
|
+
} & {
|
5
|
+
children?: React.ReactNode;
|
6
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldTextArea").IProFieldTextArea & {
|
7
|
+
type: "textarea";
|
8
|
+
} & {
|
9
|
+
children?: React.ReactNode;
|
10
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldMoney").IProFieldMoney & {
|
11
|
+
type: "money";
|
12
|
+
} & {
|
13
|
+
children?: React.ReactNode;
|
14
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldCheckBox").IProFieldCheckBox & {
|
15
|
+
type: "checkbox";
|
16
|
+
} & {
|
17
|
+
children?: React.ReactNode;
|
18
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldRadio").IProFieldRadio & {
|
19
|
+
type: "radio";
|
20
|
+
} & {
|
21
|
+
children?: React.ReactNode;
|
22
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldSelect").IProFieldSelect & {
|
23
|
+
type: "select";
|
24
|
+
} & {
|
25
|
+
children?: React.ReactNode;
|
26
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldMultipleSelect").IProFieldMultipleSelect & {
|
27
|
+
type: "multipleSelect";
|
28
|
+
} & {
|
29
|
+
children?: React.ReactNode;
|
30
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDate & {
|
31
|
+
type: "date";
|
32
|
+
} & {
|
33
|
+
children?: React.ReactNode;
|
34
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateWeek & {
|
35
|
+
type: "dateWeek";
|
36
|
+
} & {
|
37
|
+
children?: React.ReactNode;
|
38
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateMonth & {
|
39
|
+
type: "dateMonth";
|
40
|
+
} & {
|
41
|
+
children?: React.ReactNode;
|
42
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateYear & {
|
43
|
+
type: "dateYear";
|
44
|
+
} & {
|
45
|
+
children?: React.ReactNode;
|
46
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateQuarter & {
|
47
|
+
type: "dateQuarter";
|
48
|
+
} & {
|
49
|
+
children?: React.ReactNode;
|
50
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateRange & {
|
51
|
+
type: "dateRange";
|
52
|
+
} & {
|
53
|
+
children?: React.ReactNode;
|
54
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateWeekRange & {
|
55
|
+
type: "dateWeekRange";
|
56
|
+
} & {
|
57
|
+
children?: React.ReactNode;
|
58
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateMonthRange & {
|
59
|
+
type: "dateMonthRange";
|
60
|
+
} & {
|
61
|
+
children?: React.ReactNode;
|
62
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateYearRange & {
|
63
|
+
type: "dateYearRange";
|
64
|
+
} & {
|
65
|
+
children?: React.ReactNode;
|
66
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateQuarterRange & {
|
67
|
+
type: "dateQuarterRange";
|
68
|
+
} & {
|
69
|
+
children?: React.ReactNode;
|
70
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateTime & {
|
71
|
+
type: "dateTime";
|
72
|
+
} & {
|
73
|
+
children?: React.ReactNode;
|
74
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateTimeRange & {
|
75
|
+
type: "dateTimeRange";
|
76
|
+
} & {
|
77
|
+
children?: React.ReactNode;
|
78
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldTime & {
|
79
|
+
type: "time";
|
80
|
+
} & {
|
81
|
+
children?: React.ReactNode;
|
82
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldTimeRange & {
|
83
|
+
type: "timeRange";
|
84
|
+
} & {
|
85
|
+
children?: React.ReactNode;
|
86
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldNumber").IProFieldNumber & {
|
87
|
+
type: "number";
|
88
|
+
} & {
|
89
|
+
children?: React.ReactNode;
|
90
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldPercent").IProFieldPercent & {
|
91
|
+
type: "percent";
|
92
|
+
} & {
|
93
|
+
children?: React.ReactNode;
|
94
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldCascader").IProFieldCascader & {
|
95
|
+
type: "cascader";
|
96
|
+
} & {
|
97
|
+
children?: React.ReactNode;
|
98
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldCascader").IProFieldMultipleCascader & {
|
99
|
+
type: "multipleCascader";
|
100
|
+
} & {
|
101
|
+
children?: React.ReactNode;
|
102
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldCascader").IProFieldArbitraryCascader & {
|
103
|
+
type: "arbitraryCascader";
|
104
|
+
} & {
|
105
|
+
children?: React.ReactNode;
|
106
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldSwitch").IProFieldSwitch & {
|
107
|
+
type: "switch";
|
108
|
+
} & {
|
109
|
+
children?: React.ReactNode;
|
110
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldColor").IProFieldColor & {
|
111
|
+
type: "color" | "colorSwatches" | "colorRadio" | "colorTwitter";
|
112
|
+
} & {
|
113
|
+
children?: React.ReactNode;
|
114
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldIcon").IProFieldIcon & {
|
115
|
+
type: "icon";
|
116
|
+
} & {
|
117
|
+
children?: React.ReactNode;
|
118
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldTreeSelect").IProFieldTreeSelect & {
|
119
|
+
type: "treeSelect";
|
120
|
+
} & {
|
121
|
+
children?: React.ReactNode;
|
122
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldJson").IProFieldJson & {
|
123
|
+
type: "json";
|
124
|
+
} & {
|
125
|
+
children?: React.ReactNode;
|
126
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldTransfer").IProFieldTransfer & {
|
127
|
+
type: "transfer";
|
128
|
+
} & {
|
129
|
+
children?: React.ReactNode;
|
130
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldRange").IProFieldRange & {
|
131
|
+
type: "range";
|
132
|
+
} & {
|
133
|
+
children?: React.ReactNode;
|
134
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldPassword").IProFieldPassword & {
|
135
|
+
type: "password";
|
136
|
+
} & {
|
137
|
+
children?: React.ReactNode;
|
138
|
+
}> | Partial<import("@teamix/pro-field/lib/components/FieldSearch").IProFieldSearch & {
|
139
|
+
type: "search";
|
140
|
+
} & {
|
141
|
+
children?: React.ReactNode;
|
142
|
+
}> | Pick<Partial<{
|
143
|
+
[key: string]: any;
|
144
|
+
type: string;
|
145
|
+
value?: any;
|
146
|
+
initValue?: any;
|
147
|
+
} & import("@teamix/pro-field").IProBaseField & {
|
148
|
+
children?: React.ReactNode;
|
149
|
+
}>, string | number>) & React.RefAttributes<unknown>>;
|
150
|
+
export default _default;
|
@@ -0,0 +1,53 @@
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
2
|
+
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
4
|
+
|
5
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
6
|
+
|
7
|
+
import React from 'react';
|
8
|
+
import { isVoidField } from '@formily/core';
|
9
|
+
import { connect, mapProps, mapReadPretty } from '@formily/react';
|
10
|
+
import ProField from '../../../field';
|
11
|
+
import { mapSize, mapStatus } from '../../utils';
|
12
|
+
|
13
|
+
var patchDataSource = function patchDataSource() {
|
14
|
+
var dataSource = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
15
|
+
|
16
|
+
var removeEmptyChildren = function removeEmptyChildren(data) {
|
17
|
+
var result = _objectSpread({}, data);
|
18
|
+
|
19
|
+
if (!result.children || result.children.length === 0) {
|
20
|
+
delete result.children;
|
21
|
+
} else {
|
22
|
+
result.children = result.children.map(removeEmptyChildren);
|
23
|
+
}
|
24
|
+
|
25
|
+
return result;
|
26
|
+
};
|
27
|
+
|
28
|
+
return dataSource.map(removeEmptyChildren);
|
29
|
+
};
|
30
|
+
|
31
|
+
var mapDataSource = function mapDataSource(props, field) {
|
32
|
+
var _props$dataSource;
|
33
|
+
|
34
|
+
if (isVoidField(field)) {
|
35
|
+
return props;
|
36
|
+
}
|
37
|
+
|
38
|
+
return _objectSpread(_objectSpread({}, props), {}, {
|
39
|
+
dataSource: patchDataSource((_props$dataSource = props.dataSource) !== null && _props$dataSource !== void 0 ? _props$dataSource : field === null || field === void 0 ? void 0 : field.dataSource)
|
40
|
+
});
|
41
|
+
};
|
42
|
+
|
43
|
+
var mapMode = function mapMode(props, field) {
|
44
|
+
return _objectSpread(_objectSpread({}, props), {}, {
|
45
|
+
mode: (field === null || field === void 0 ? void 0 : field.readPretty) ? 'read' : 'edit'
|
46
|
+
});
|
47
|
+
};
|
48
|
+
|
49
|
+
export default connect(ProField, mapProps(mapSize, mapStatus, mapDataSource, mapMode), mapReadPretty(function (props) {
|
50
|
+
return /*#__PURE__*/React.createElement(ProField, _objectSpread(_objectSpread({}, props), {}, {
|
51
|
+
mode: "read"
|
52
|
+
}));
|
53
|
+
}));
|
@@ -0,0 +1,70 @@
|
|
1
|
+
import React, { memo } from 'react';
|
2
|
+
import { Tag, Select } from '@alicloudfe/components';
|
3
|
+
import cls from 'classnames';
|
4
|
+
import { usePrefixCls, isArr, isObj } from '@teamix/utils';
|
5
|
+
import './index.scss';
|
6
|
+
var TagGroup = Tag.Group,
|
7
|
+
CloseableTag = Tag.Closeable;
|
8
|
+
var TagText = /*#__PURE__*/memo(function (_ref) {
|
9
|
+
var tagPrefixCls = _ref.tagPrefixCls,
|
10
|
+
title = _ref.title,
|
11
|
+
content = _ref.content;
|
12
|
+
var prefixCls = "".concat(tagPrefixCls, "-tag");
|
13
|
+
return /*#__PURE__*/React.createElement("span", {
|
14
|
+
className: prefixCls
|
15
|
+
}, /*#__PURE__*/React.createElement("span", {
|
16
|
+
className: "".concat(prefixCls, "-title")
|
17
|
+
}, title), /*#__PURE__*/React.createElement("span", {
|
18
|
+
className: "".concat(prefixCls, "-content")
|
19
|
+
}, function () {
|
20
|
+
if (isArr(content)) {
|
21
|
+
return content.join(', ');
|
22
|
+
}
|
23
|
+
|
24
|
+
if (isObj(content)) {
|
25
|
+
return /*#__PURE__*/React.createElement(TagText, {
|
26
|
+
tagPrefixCls: tagPrefixCls,
|
27
|
+
title: content.title,
|
28
|
+
content: content.content
|
29
|
+
});
|
30
|
+
}
|
31
|
+
|
32
|
+
return content;
|
33
|
+
}()));
|
34
|
+
});
|
35
|
+
var Query = /*#__PURE__*/memo(function (_ref2) {
|
36
|
+
var size = _ref2.size,
|
37
|
+
tags = _ref2.tags,
|
38
|
+
filterItems = _ref2.filterItems,
|
39
|
+
onFilterItemsChange = _ref2.onFilterItemsChange,
|
40
|
+
children = _ref2.children;
|
41
|
+
var defaultCls = usePrefixCls();
|
42
|
+
var prefixCls = usePrefixCls('filter');
|
43
|
+
return /*#__PURE__*/React.createElement("span", {
|
44
|
+
className: cls(prefixCls, "".concat(defaultCls).concat(size))
|
45
|
+
}, /*#__PURE__*/React.createElement(TagGroup, null, tags === null || tags === void 0 ? void 0 : tags.map(function (_ref3) {
|
46
|
+
var key = _ref3.key,
|
47
|
+
title = _ref3.title,
|
48
|
+
content = _ref3.content;
|
49
|
+
return /*#__PURE__*/React.createElement(CloseableTag, {
|
50
|
+
key: key,
|
51
|
+
onClose: function onClose() {
|
52
|
+
console.log('onClose', key);
|
53
|
+
return false;
|
54
|
+
}
|
55
|
+
}, /*#__PURE__*/React.createElement(TagText, {
|
56
|
+
tagPrefixCls: prefixCls,
|
57
|
+
title: title,
|
58
|
+
content: content
|
59
|
+
}));
|
60
|
+
})), /*#__PURE__*/React.createElement(Select, {
|
61
|
+
className: "".concat(prefixCls, "-select"),
|
62
|
+
placeholder: "\u8BF7\u6DFB\u52A0\u7B5B\u9009\u6761\u4EF6",
|
63
|
+
dataSource: filterItems,
|
64
|
+
onChange: onFilterItemsChange
|
65
|
+
}), children);
|
66
|
+
});
|
67
|
+
Query.defaultProps = {
|
68
|
+
size: 'medium'
|
69
|
+
};
|
70
|
+
export default Query;
|
@@ -0,0 +1,90 @@
|
|
1
|
+
@import '~@alifd/next/lib/core/index-noreset.scss';
|
2
|
+
|
3
|
+
$form-item-cls: #{$css-prefix}formily-item;
|
4
|
+
$noborder-font-weight-medium: calc(
|
5
|
+
var(--form-element-medium-height, 32px) - var(--input-border-width, 1px) * 2
|
6
|
+
);
|
7
|
+
|
8
|
+
// Query样式
|
9
|
+
.#{$css-prefix}filter {
|
10
|
+
display: flex;
|
11
|
+
width: 100%;
|
12
|
+
box-sizing: border-box;
|
13
|
+
|
14
|
+
border-color: var(--input-focus-border-color, #ababab);
|
15
|
+
border-style: solid;
|
16
|
+
transition: box-shadow var(--active-transition);
|
17
|
+
&:hover {
|
18
|
+
box-shadow: var(--active-shadow);
|
19
|
+
}
|
20
|
+
.#{$css-prefix}filter-tag {
|
21
|
+
.#{$css-prefix}filter-tag-title {
|
22
|
+
margin-right: 8px;
|
23
|
+
color: var(--color-text1-8, #848484);
|
24
|
+
}
|
25
|
+
.#{$css-prefix}filter-tag-content {
|
26
|
+
color: var(--color-text1-3, #333333);
|
27
|
+
.#{$css-prefix}filter-tag-title {
|
28
|
+
margin-right: 0;
|
29
|
+
color: var(--color-text1-3, #333333);
|
30
|
+
font-weight: bold;
|
31
|
+
&::after {
|
32
|
+
position: relative;
|
33
|
+
top: -0.5px;
|
34
|
+
content: ':';
|
35
|
+
margin: 0 4px 0 4px;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
// 表单项选择模块
|
42
|
+
.#{$css-prefix}filter-select {
|
43
|
+
min-width: auto;
|
44
|
+
.#{$css-prefix}input {
|
45
|
+
min-width: auto;
|
46
|
+
border: 0;
|
47
|
+
.#{$css-prefix}input-text-field {
|
48
|
+
padding-right: 0;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
.#{$css-prefix}input.#{$css-prefix}medium {
|
52
|
+
height: $noborder-font-weight-medium;
|
53
|
+
}
|
54
|
+
.#{$css-prefix}input-control {
|
55
|
+
display: none;
|
56
|
+
}
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
// Query尺寸
|
61
|
+
.#{$css-prefix}filter.#{$css-prefix}medium {
|
62
|
+
padding: 0 8px;
|
63
|
+
height: var(--search-normal-normal-m-height, 32px);
|
64
|
+
border-width: var(--search-normal-normal-border-width, 1px);
|
65
|
+
border-radius: var(--search-normal-corner, 2px);
|
66
|
+
.#{$css-prefix}tag-group {
|
67
|
+
.#{$css-prefix}tag-medium {
|
68
|
+
margin: 3px 4px 3px 0;
|
69
|
+
}
|
70
|
+
}
|
71
|
+
}
|
72
|
+
|
73
|
+
// Query无边框模式
|
74
|
+
.#{$form-item-cls}-bordered-none {
|
75
|
+
.#{$form-item-cls}-control {
|
76
|
+
.#{$form-item-cls}-control-content {
|
77
|
+
.#{$form-item-cls}-control-content-component {
|
78
|
+
min-height: $noborder-font-weight-medium;
|
79
|
+
.#{$css-prefix}date-picker2-input {
|
80
|
+
border: 0;
|
81
|
+
box-shadow: none !important;
|
82
|
+
}
|
83
|
+
.#{$css-prefix}date-picker2-input.#{$css-prefix}date-picker2-input-medium,
|
84
|
+
.#{$css-prefix}input.#{$css-prefix}medium {
|
85
|
+
height: $noborder-font-weight-medium;
|
86
|
+
}
|
87
|
+
}
|
88
|
+
}
|
89
|
+
}
|
90
|
+
}
|
@@ -0,0 +1,111 @@
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
2
|
+
|
3
|
+
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."); }
|
4
|
+
|
5
|
+
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); }
|
6
|
+
|
7
|
+
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; }
|
8
|
+
|
9
|
+
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; }
|
10
|
+
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
12
|
+
|
13
|
+
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; }
|
14
|
+
|
15
|
+
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; }
|
16
|
+
|
17
|
+
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; }
|
18
|
+
|
19
|
+
import React, { useState } from 'react';
|
20
|
+
import { useField, observer, useFieldSchema, RecursionField } from '@formily/react';
|
21
|
+
import { isArr } from '@teamix/utils';
|
22
|
+
import Query from '../Query';
|
23
|
+
|
24
|
+
var isValid = function isValid(v) {
|
25
|
+
if (isArr(v)) {
|
26
|
+
return v.length !== 0;
|
27
|
+
}
|
28
|
+
|
29
|
+
return v !== undefined && v !== null;
|
30
|
+
}; // 主激活区
|
31
|
+
|
32
|
+
|
33
|
+
var useMain = function useMain(active) {
|
34
|
+
var schema = useFieldSchema();
|
35
|
+
var main = [];
|
36
|
+
schema.mapProperties(function (schema, name) {
|
37
|
+
if (schema.name === active) {
|
38
|
+
main.push({
|
39
|
+
name: name,
|
40
|
+
schema: _objectSpread(_objectSpread({}, schema), {}, {
|
41
|
+
title: ''
|
42
|
+
})
|
43
|
+
});
|
44
|
+
}
|
45
|
+
});
|
46
|
+
return main;
|
47
|
+
}; // 筛选项选择
|
48
|
+
|
49
|
+
|
50
|
+
var useFilterItems = function useFilterItems() {
|
51
|
+
var schema = useFieldSchema();
|
52
|
+
var filterItems = [];
|
53
|
+
schema.mapProperties(function (schema, name) {
|
54
|
+
filterItems.push({
|
55
|
+
label: schema.title,
|
56
|
+
value: schema.name
|
57
|
+
});
|
58
|
+
});
|
59
|
+
return filterItems;
|
60
|
+
}; // 标签值
|
61
|
+
|
62
|
+
|
63
|
+
var useValues = function useValues() {
|
64
|
+
var queryField = useField();
|
65
|
+
var schema = useFieldSchema();
|
66
|
+
var values = [];
|
67
|
+
schema.mapProperties(function (schema, name) {
|
68
|
+
var field = queryField.query(queryField.address.concat(name)).take();
|
69
|
+
console.log(field);
|
70
|
+
|
71
|
+
if (isValid(field === null || field === void 0 ? void 0 : field.value)) {
|
72
|
+
values.push({
|
73
|
+
key: schema.name,
|
74
|
+
title: schema.title,
|
75
|
+
content: field.value
|
76
|
+
});
|
77
|
+
}
|
78
|
+
});
|
79
|
+
return values;
|
80
|
+
};
|
81
|
+
|
82
|
+
var QueryFilter = observer(function (props) {
|
83
|
+
var _useState = useState(),
|
84
|
+
_useState2 = _slicedToArray(_useState, 2),
|
85
|
+
active = _useState2[0],
|
86
|
+
setActive = _useState2[1];
|
87
|
+
|
88
|
+
var field = useField();
|
89
|
+
var schema = useFieldSchema();
|
90
|
+
var main = useMain(active);
|
91
|
+
var filterItems = useFilterItems();
|
92
|
+
var values = useValues();
|
93
|
+
var content = main.map(function (_ref, key) {
|
94
|
+
var schema = _ref.schema,
|
95
|
+
name = _ref.name;
|
96
|
+
return /*#__PURE__*/React.createElement(RecursionField, {
|
97
|
+
key: key,
|
98
|
+
name: name,
|
99
|
+
schema: schema,
|
100
|
+
filterProperties: function filterProperties(schema) {
|
101
|
+
return true;
|
102
|
+
}
|
103
|
+
});
|
104
|
+
});
|
105
|
+
return /*#__PURE__*/React.createElement(Query, {
|
106
|
+
tags: values,
|
107
|
+
filterItems: filterItems,
|
108
|
+
onFilterItemsChange: setActive
|
109
|
+
}, content);
|
110
|
+
});
|
111
|
+
export default QueryFilter;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
interface ISearchPanelProps {
|
3
|
+
title?: React.ReactNode;
|
4
|
+
className?: string;
|
5
|
+
}
|
6
|
+
declare type ISearchPanel = React.FC<ISearchPanelProps>;
|
7
|
+
declare type ISearch = React.FC<any> & {
|
8
|
+
SearchPanel?: ISearchPanel;
|
9
|
+
};
|
10
|
+
declare const Search: ISearch;
|
11
|
+
export default Search;
|
@@ -0,0 +1,89 @@
|
|
1
|
+
var _excluded = ["children"];
|
2
|
+
|
3
|
+
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; }
|
4
|
+
|
5
|
+
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; }
|
6
|
+
|
7
|
+
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; }
|
8
|
+
|
9
|
+
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; }
|
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 cls from 'classnames';
|
15
|
+
import { observer, useFieldSchema, useField, RecursionField } from '@formily/react';
|
16
|
+
import { Input } from '@alicloudfe/components';
|
17
|
+
import { usePrefixCls } from '@teamix/utils';
|
18
|
+
|
19
|
+
var usePanels = function usePanels() {
|
20
|
+
var searchField = useField();
|
21
|
+
var schema = useFieldSchema();
|
22
|
+
var panels = [];
|
23
|
+
schema.mapProperties(function (schema, name) {
|
24
|
+
var _schema$xComponent;
|
25
|
+
|
26
|
+
var field = searchField.query(searchField.address.concat(name)).take();
|
27
|
+
if ((field === null || field === void 0 ? void 0 : field.display) === 'none' || (field === null || field === void 0 ? void 0 : field.display) === 'hidden') return;
|
28
|
+
|
29
|
+
if (((_schema$xComponent = schema['x-component']) === null || _schema$xComponent === void 0 ? void 0 : _schema$xComponent.indexOf('SearchPanel')) > -1) {
|
30
|
+
var _schema$xComponentP, _schema$xComponentP2;
|
31
|
+
|
32
|
+
panels.push({
|
33
|
+
name: name,
|
34
|
+
props: _objectSpread(_objectSpread({}, schema === null || schema === void 0 ? void 0 : schema['x-component-props']), {}, {
|
35
|
+
title: (schema === null || schema === void 0 ? void 0 : (_schema$xComponentP = schema['x-component-props']) === null || _schema$xComponentP === void 0 ? void 0 : _schema$xComponentP.title) || (schema === null || schema === void 0 ? void 0 : schema.title),
|
36
|
+
key: (schema === null || schema === void 0 ? void 0 : (_schema$xComponentP2 = schema['x-component-props']) === null || _schema$xComponentP2 === void 0 ? void 0 : _schema$xComponentP2.key) || name
|
37
|
+
}),
|
38
|
+
schema: schema
|
39
|
+
});
|
40
|
+
}
|
41
|
+
});
|
42
|
+
return panels;
|
43
|
+
};
|
44
|
+
|
45
|
+
var Search = observer(function (_ref) {
|
46
|
+
var children = _ref.children,
|
47
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
48
|
+
|
49
|
+
var prefixCls = usePrefixCls('formily-group');
|
50
|
+
var panels = usePanels().map(function (_ref2, index) {
|
51
|
+
var props = _ref2.props,
|
52
|
+
schema = _ref2.schema,
|
53
|
+
name = _ref2.name;
|
54
|
+
return /*#__PURE__*/React.createElement(RecursionField, {
|
55
|
+
key: index,
|
56
|
+
schema: schema,
|
57
|
+
name: name
|
58
|
+
});
|
59
|
+
});
|
60
|
+
var first = null;
|
61
|
+
var middle = null;
|
62
|
+
var last = null;
|
63
|
+
|
64
|
+
if (panels.length > 1) {
|
65
|
+
first = panels[0];
|
66
|
+
middle = panels.slice(1, panels.length);
|
67
|
+
|
68
|
+
if (panels.length > 2) {
|
69
|
+
middle = panels.slice(1, panels.length - 1);
|
70
|
+
last = panels[panels.length - 1];
|
71
|
+
}
|
72
|
+
} else {
|
73
|
+
middle = panels;
|
74
|
+
}
|
75
|
+
|
76
|
+
return /*#__PURE__*/React.createElement(Input.Group, _objectSpread(_objectSpread({}, props), {}, {
|
77
|
+
className: cls(prefixCls, props.className),
|
78
|
+
addonBefore: first,
|
79
|
+
addonAfter: last
|
80
|
+
}), middle);
|
81
|
+
});
|
82
|
+
|
83
|
+
var SearchPanel = function SearchPanel(_ref3) {
|
84
|
+
var children = _ref3.children;
|
85
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
86
|
+
};
|
87
|
+
|
88
|
+
Search.SearchPanel = SearchPanel;
|
89
|
+
export default Search;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import type { IFilterProps } from '../typing';
|
3
|
+
/**
|
4
|
+
* 简单筛选
|
5
|
+
*/
|
6
|
+
declare const SimpleFilter: React.FC<IFilterProps>;
|
7
|
+
/**
|
8
|
+
* 查询筛选
|
9
|
+
*/
|
10
|
+
declare const QueryFilter: React.FC<IFilterProps>;
|
11
|
+
/**
|
12
|
+
* 高级筛选
|
13
|
+
*/
|
14
|
+
declare const AdvancedFilter: React.FC<IFilterProps>;
|
15
|
+
export { AdvancedFilter, SimpleFilter, QueryFilter };
|
16
|
+
export default AdvancedFilter;
|