@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,244 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports.default = void 0;
|
9
|
+
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
11
|
+
|
12
|
+
var _icon = _interopRequireDefault(require("@teamix/icon"));
|
13
|
+
|
14
|
+
var _components = require("@alicloudfe/components");
|
15
|
+
|
16
|
+
var _utils = require("@teamix/utils");
|
17
|
+
|
18
|
+
require("./index.scss");
|
19
|
+
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
21
|
+
|
22
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
23
|
+
|
24
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
25
|
+
|
26
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
27
|
+
|
28
|
+
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."); }
|
29
|
+
|
30
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
31
|
+
|
32
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
33
|
+
|
34
|
+
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; }
|
35
|
+
|
36
|
+
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; }
|
37
|
+
|
38
|
+
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; }
|
39
|
+
|
40
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
41
|
+
|
42
|
+
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."); }
|
43
|
+
|
44
|
+
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); }
|
45
|
+
|
46
|
+
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; }
|
47
|
+
|
48
|
+
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; }
|
49
|
+
|
50
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
51
|
+
|
52
|
+
var CheckboxItem = _components.Menu.CheckboxItem;
|
53
|
+
var cls = (0, _utils.baseClass)('teamix-pro-table-toolbar-filter');
|
54
|
+
var RadioItem = _components.Menu.RadioItem;
|
55
|
+
|
56
|
+
var Filter = function Filter(props) {
|
57
|
+
var column = props.column,
|
58
|
+
actionRef = props.actionRef; // 选中过滤项
|
59
|
+
|
60
|
+
var _useState = (0, _react.useState)([]),
|
61
|
+
_useState2 = _slicedToArray(_useState, 2),
|
62
|
+
selected = _useState2[0],
|
63
|
+
setSelected = _useState2[1];
|
64
|
+
|
65
|
+
var _useState3 = (0, _react.useState)(false),
|
66
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
67
|
+
visible = _useState4[0],
|
68
|
+
setVisible = _useState4[1];
|
69
|
+
|
70
|
+
(0, _react.useEffect)(function () {
|
71
|
+
var _actionRef$current$ge, _actionRef$current, _actionRef$current$ge2, _actionRef$current$ge3, _actionRef$current$ge4;
|
72
|
+
|
73
|
+
// 从全局状态中读取上次存储的条件
|
74
|
+
var rules = (_actionRef$current$ge = (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$ge2 = _actionRef$current.getState) === null || _actionRef$current$ge2 === void 0 ? void 0 : (_actionRef$current$ge3 = _actionRef$current$ge2.call(_actionRef$current).filterRules) === null || _actionRef$current$ge3 === void 0 ? void 0 : (_actionRef$current$ge4 = _actionRef$current$ge3[column.dataIndex]) === null || _actionRef$current$ge4 === void 0 ? void 0 : _actionRef$current$ge4.rules) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : [];
|
75
|
+
setSelected(rules);
|
76
|
+
}, []); // 获取过滤项
|
77
|
+
|
78
|
+
var filters = (0, _react.useMemo)(function () {
|
79
|
+
if (Array.isArray(column.filters)) {
|
80
|
+
return column.filters;
|
81
|
+
}
|
82
|
+
|
83
|
+
var filters = column.dataSource; // 转换 valueEnum 为 options
|
84
|
+
|
85
|
+
if (!Array.isArray(column.dataSource)) {
|
86
|
+
filters = Object.entries(column.dataSource).map(function (_ref) {
|
87
|
+
var _nv$label, _nv$color;
|
88
|
+
|
89
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
90
|
+
k = _ref2[0],
|
91
|
+
v = _ref2[1];
|
92
|
+
|
93
|
+
var nv = v;
|
94
|
+
return _objectSpread(_objectSpread({
|
95
|
+
value: k
|
96
|
+
}, nv), {}, {
|
97
|
+
label: (_nv$label = nv.label) !== null && _nv$label !== void 0 ? _nv$label : k,
|
98
|
+
color: (_nv$color = nv.color) !== null && _nv$color !== void 0 ? _nv$color : k
|
99
|
+
});
|
100
|
+
});
|
101
|
+
} // console.log(filters);
|
102
|
+
|
103
|
+
|
104
|
+
return filters;
|
105
|
+
}, []); // 渲染单选
|
106
|
+
|
107
|
+
var renderSingle = function renderSingle() {
|
108
|
+
return filters === null || filters === void 0 ? void 0 : filters.map(function (_ref3) {
|
109
|
+
var label = _ref3.label,
|
110
|
+
value = _ref3.value;
|
111
|
+
var valueStr = value.toString();
|
112
|
+
return /*#__PURE__*/_react.default.createElement(RadioItem, {
|
113
|
+
id: valueStr,
|
114
|
+
checked: selected.includes(valueStr),
|
115
|
+
key: valueStr,
|
116
|
+
onChange: function onChange(check) {
|
117
|
+
setSelected([valueStr]);
|
118
|
+
}
|
119
|
+
}, label);
|
120
|
+
});
|
121
|
+
}; // 渲染多选
|
122
|
+
|
123
|
+
|
124
|
+
var renderMultiple = function renderMultiple() {
|
125
|
+
return filters === null || filters === void 0 ? void 0 : filters.map(function (_ref4) {
|
126
|
+
var label = _ref4.label,
|
127
|
+
value = _ref4.value;
|
128
|
+
var valueStr = value.toString();
|
129
|
+
return /*#__PURE__*/_react.default.createElement(CheckboxItem, {
|
130
|
+
key: valueStr,
|
131
|
+
checked: selected.includes(valueStr),
|
132
|
+
onChange: function onChange(check) {
|
133
|
+
if (check) {
|
134
|
+
setSelected([].concat(_toConsumableArray(selected), [valueStr]));
|
135
|
+
} else {
|
136
|
+
setSelected(selected.filter(function (item) {
|
137
|
+
return item !== valueStr;
|
138
|
+
}));
|
139
|
+
}
|
140
|
+
}
|
141
|
+
}, label);
|
142
|
+
});
|
143
|
+
}; // 渲染选择区域
|
144
|
+
|
145
|
+
|
146
|
+
var renderSelect = function renderSelect() {
|
147
|
+
if (column.filterMode === 'multiple') {
|
148
|
+
return renderMultiple();
|
149
|
+
}
|
150
|
+
|
151
|
+
return renderSingle();
|
152
|
+
};
|
153
|
+
|
154
|
+
return /*#__PURE__*/_react.default.createElement(_components.Dropdown, {
|
155
|
+
trigger: /*#__PURE__*/_react.default.createElement(_icon.default, {
|
156
|
+
size: "small",
|
157
|
+
type: "filter-line",
|
158
|
+
className: cls({
|
159
|
+
icon: true,
|
160
|
+
'icon-selected': selected.length > 0
|
161
|
+
}),
|
162
|
+
onClick: function onClick() {
|
163
|
+
setVisible(!visible);
|
164
|
+
}
|
165
|
+
}),
|
166
|
+
triggerType: ['click'],
|
167
|
+
align: "tl bl",
|
168
|
+
visible: visible,
|
169
|
+
onVisibleChange: function onVisibleChange() {
|
170
|
+
return setVisible(false);
|
171
|
+
}
|
172
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
173
|
+
className: cls()
|
174
|
+
}, /*#__PURE__*/_react.default.createElement(_components.Menu, null, renderSelect(), /*#__PURE__*/_react.default.createElement("div", {
|
175
|
+
className: cls({
|
176
|
+
'btn-box': true
|
177
|
+
})
|
178
|
+
}, /*#__PURE__*/_react.default.createElement(_components.Button, {
|
179
|
+
type: "primary",
|
180
|
+
size: "small",
|
181
|
+
className: cls({
|
182
|
+
btn: true
|
183
|
+
}),
|
184
|
+
onClick: function onClick() {
|
185
|
+
var _actionRef$current2, _actionRef$current2$f, _actionRef$current$ge5, _actionRef$current3, _actionRef$current3$g, _actionRef$current3$g2, _actionRef$current4, _actionRef$current4$r, _actionRef$current5, _actionRef$current5$s;
|
186
|
+
|
187
|
+
(_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$f = _actionRef$current2.filterDataSource) === null || _actionRef$current2$f === void 0 ? void 0 : _actionRef$current2$f.call(_actionRef$current2, column.dataIndex); // 先获取此列的param
|
188
|
+
|
189
|
+
var param = '';
|
190
|
+
|
191
|
+
if (column.beforeFilter) {
|
192
|
+
var _column$beforeFilter;
|
193
|
+
|
194
|
+
param = (_column$beforeFilter = column.beforeFilter) === null || _column$beforeFilter === void 0 ? void 0 : _column$beforeFilter.call(column, selected);
|
195
|
+
} else {
|
196
|
+
param = selected.join(',');
|
197
|
+
} // 需要带上其他所有的信息
|
198
|
+
|
199
|
+
|
200
|
+
var rules = (_actionRef$current$ge5 = (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : (_actionRef$current3$g = _actionRef$current3.getState) === null || _actionRef$current3$g === void 0 ? void 0 : (_actionRef$current3$g2 = _actionRef$current3$g.call(_actionRef$current3)) === null || _actionRef$current3$g2 === void 0 ? void 0 : _actionRef$current3$g2.filterRules) !== null && _actionRef$current$ge5 !== void 0 ? _actionRef$current$ge5 : {};
|
201
|
+
var params = Object.fromEntries([].concat(_toConsumableArray(Object.entries(rules).map(function (_ref5) {
|
202
|
+
var _ref6 = _slicedToArray(_ref5, 2),
|
203
|
+
k = _ref6[0],
|
204
|
+
v = _ref6[1];
|
205
|
+
|
206
|
+
if (v) {
|
207
|
+
return [k, v.params];
|
208
|
+
}
|
209
|
+
|
210
|
+
return null;
|
211
|
+
})), [[column.dataIndex, param]]).filter(function (item) {
|
212
|
+
return item && (item === null || item === void 0 ? void 0 : item[1]);
|
213
|
+
})); // 先发送请求。因为这会置空组件的列筛选状态
|
214
|
+
|
215
|
+
(_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : (_actionRef$current4$r = _actionRef$current4.request) === null || _actionRef$current4$r === void 0 ? void 0 : _actionRef$current4$r.call(_actionRef$current4, _objectSpread({}, params)); // 再设置所有的列筛选状态
|
216
|
+
|
217
|
+
(_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : (_actionRef$current5$s = _actionRef$current5.setFilterRules) === null || _actionRef$current5$s === void 0 ? void 0 : _actionRef$current5$s.call(_actionRef$current5, _objectSpread(_objectSpread({}, rules), {}, _defineProperty({}, column.dataIndex, {
|
218
|
+
rules: selected,
|
219
|
+
params: param
|
220
|
+
})));
|
221
|
+
setVisible(false);
|
222
|
+
}
|
223
|
+
}, "\u786E\u5B9A"), /*#__PURE__*/_react.default.createElement(_components.Button, {
|
224
|
+
type: "normal",
|
225
|
+
size: "small",
|
226
|
+
className: cls({
|
227
|
+
btn: true
|
228
|
+
}),
|
229
|
+
onClick: function onClick() {
|
230
|
+
var _actionRef$current$ge6, _actionRef$current6, _actionRef$current6$g, _actionRef$current6$g2, _actionRef$current7, _actionRef$current7$s, _actionRef$current8, _actionRef$current8$f;
|
231
|
+
|
232
|
+
setSelected([]);
|
233
|
+
var rules = (_actionRef$current$ge6 = (_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : (_actionRef$current6$g = _actionRef$current6.getState) === null || _actionRef$current6$g === void 0 ? void 0 : (_actionRef$current6$g2 = _actionRef$current6$g.call(_actionRef$current6)) === null || _actionRef$current6$g2 === void 0 ? void 0 : _actionRef$current6$g2.filterRules) !== null && _actionRef$current$ge6 !== void 0 ? _actionRef$current$ge6 : {};
|
234
|
+
(_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$s = _actionRef$current7.setFilterRules) === null || _actionRef$current7$s === void 0 ? void 0 : _actionRef$current7$s.call(_actionRef$current7, _objectSpread(_objectSpread({}, rules), {}, _defineProperty({}, column.dataIndex, {
|
235
|
+
rules: [],
|
236
|
+
params: ''
|
237
|
+
})));
|
238
|
+
(_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : (_actionRef$current8$f = _actionRef$current8.filterDataSource) === null || _actionRef$current8$f === void 0 ? void 0 : _actionRef$current8$f.call(_actionRef$current8, column.dataIndex); // setVisible(!visible);
|
239
|
+
}
|
240
|
+
}, "\u91CD\u7F6E")))));
|
241
|
+
};
|
242
|
+
|
243
|
+
var _default = Filter;
|
244
|
+
exports.default = _default;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
.teamix-pro-table-toolbar-filter {
|
2
|
+
width: 130px;
|
3
|
+
max-height: 350px;
|
4
|
+
overflow-y: auto;
|
5
|
+
box-shadow: var(--popup-local-shadow, 0px 6px 24px 0px rgba(0, 0, 0, 0.1));
|
6
|
+
&-icon {
|
7
|
+
cursor: pointer;
|
8
|
+
margin-left: 4px;
|
9
|
+
}
|
10
|
+
&-icon-selected {
|
11
|
+
color: var(--color-brand1-6, #0064c8);
|
12
|
+
}
|
13
|
+
.teamix-pro-table-toolbar-filter-btn-box {
|
14
|
+
display: flex;
|
15
|
+
justify-content: space-around;
|
16
|
+
margin-top: 10px;
|
17
|
+
padding-bottom: 5px;
|
18
|
+
}
|
19
|
+
.teamix-pro-table-toolbar-filter-btn.teamix-pro-table-toolbar-filter-btn {
|
20
|
+
width: 48px !important;
|
21
|
+
min-width: unset !important;
|
22
|
+
}
|
23
|
+
}
|
@@ -0,0 +1,266 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
9
|
+
|
10
|
+
var _utils = require("@teamix/utils");
|
11
|
+
|
12
|
+
var _components = require("@alicloudfe/components");
|
13
|
+
|
14
|
+
var _icon = _interopRequireDefault(require("@teamix/icon"));
|
15
|
+
|
16
|
+
var _actions = require("../../../actions");
|
17
|
+
|
18
|
+
var _form = require("../../../form");
|
19
|
+
|
20
|
+
var _ToolBar = _interopRequireDefault(require("../ToolBar"));
|
21
|
+
|
22
|
+
var _QuickAction = _interopRequireDefault(require("../QuickAction"));
|
23
|
+
|
24
|
+
var _lodash = _interopRequireDefault(require("lodash.isempty"));
|
25
|
+
|
26
|
+
require("./index.scss");
|
27
|
+
|
28
|
+
var _excluded = ["header", "mainAction", "quickAction", "actionRef", "dataFilter", "dataFilterForm", "rowSelection"];
|
29
|
+
|
30
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
31
|
+
|
32
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
33
|
+
|
34
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
35
|
+
|
36
|
+
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; }
|
37
|
+
|
38
|
+
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; }
|
39
|
+
|
40
|
+
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; }
|
41
|
+
|
42
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
43
|
+
|
44
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
45
|
+
|
46
|
+
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."); }
|
47
|
+
|
48
|
+
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); }
|
49
|
+
|
50
|
+
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; }
|
51
|
+
|
52
|
+
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; }
|
53
|
+
|
54
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
55
|
+
|
56
|
+
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; }
|
57
|
+
|
58
|
+
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; }
|
59
|
+
|
60
|
+
var cls = (0, _utils.baseClass)('teamix-pro-table-layout');
|
61
|
+
var toJS = _form.formilyReactive.toJS;
|
62
|
+
|
63
|
+
var Layout = function Layout(props) {
|
64
|
+
var header = props.header,
|
65
|
+
mainAction = props.mainAction,
|
66
|
+
quickAction = props.quickAction,
|
67
|
+
actionRef = props.actionRef,
|
68
|
+
dataFilter = props.dataFilter,
|
69
|
+
dataFilterForm = props.dataFilterForm,
|
70
|
+
rowSelection = props.rowSelection,
|
71
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
72
|
+
|
73
|
+
var mode = (dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.mode) || 'inline';
|
74
|
+
|
75
|
+
var _useState = (0, _react.useState)((dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.expand) || false),
|
76
|
+
_useState2 = _slicedToArray(_useState, 2),
|
77
|
+
expand = _useState2[0],
|
78
|
+
setExpand = _useState2[1];
|
79
|
+
|
80
|
+
var _useState3 = (0, _react.useState)(false),
|
81
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
82
|
+
hasDot = _useState4[0],
|
83
|
+
setHasDot = _useState4[1];
|
84
|
+
|
85
|
+
(0, _react.useEffect)(function () {
|
86
|
+
if (dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.expand) {
|
87
|
+
setExpand(dataFilter.expand);
|
88
|
+
}
|
89
|
+
}, [dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.expand]); // 渲染主操作区
|
90
|
+
|
91
|
+
var renderMainAction = function renderMainAction() {
|
92
|
+
var _mainAction$actions;
|
93
|
+
|
94
|
+
if (_typeof(mainAction) === 'object' && (mainAction === null || mainAction === void 0 ? void 0 : (_mainAction$actions = mainAction.actions) === null || _mainAction$actions === void 0 ? void 0 : _mainAction$actions.length) > 0) {
|
95
|
+
// 默认 context
|
96
|
+
var defaultContext = {
|
97
|
+
action: actionRef.current,
|
98
|
+
rowSelection: rowSelection
|
99
|
+
};
|
100
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
101
|
+
className: cls('main-action')
|
102
|
+
}, /*#__PURE__*/_react.default.createElement(_actions.ActionGroup, _objectSpread(_objectSpread({}, mainAction), {}, {
|
103
|
+
context: _objectSpread(_objectSpread({}, defaultContext), mainAction.context)
|
104
|
+
})));
|
105
|
+
} else return mainAction;
|
106
|
+
}; // 渲染 mode='inline' 数据过滤区
|
107
|
+
|
108
|
+
|
109
|
+
var renderInlineFilter = function renderInlineFilter() {
|
110
|
+
var _dataFilter$schema;
|
111
|
+
|
112
|
+
if (dataFilter && (dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema = dataFilter.schema) === null || _dataFilter$schema === void 0 ? void 0 : _dataFilter$schema.length) > 0) {
|
113
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
114
|
+
className: cls('inline-filter')
|
115
|
+
}, /*#__PURE__*/_react.default.createElement(_form.SimpleFilter, _objectSpread({
|
116
|
+
form: dataFilterForm
|
117
|
+
}, dataFilter)));
|
118
|
+
}
|
119
|
+
}; // 渲染 mode='panel' 数据过滤区
|
120
|
+
|
121
|
+
|
122
|
+
var renderPanelFilter = function renderPanelFilter() {
|
123
|
+
var _dataFilter$schema2;
|
124
|
+
|
125
|
+
if (dataFilter && (dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema2 = dataFilter.schema) === null || _dataFilter$schema2 === void 0 ? void 0 : _dataFilter$schema2.length) > 0) {
|
126
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
127
|
+
className: cls('panel-filter'),
|
128
|
+
style: {
|
129
|
+
display: expand ? 'block' : 'none'
|
130
|
+
}
|
131
|
+
}, /*#__PURE__*/_react.default.createElement(_form.AdvancedFilter, _objectSpread({
|
132
|
+
form: dataFilterForm
|
133
|
+
}, dataFilter)));
|
134
|
+
}
|
135
|
+
}; // 渲染过滤器按钮
|
136
|
+
|
137
|
+
|
138
|
+
var renderFilterBtn = function renderFilterBtn() {
|
139
|
+
var handleBtnClick = function handleBtnClick() {
|
140
|
+
setExpand(!expand);
|
141
|
+
var filterValues = Object.values(toJS(dataFilterForm === null || dataFilterForm === void 0 ? void 0 : dataFilterForm.values)).filter(function (v) {
|
142
|
+
return !(0, _lodash.default)(v);
|
143
|
+
}); // console.log('filterValues', filterValues);
|
144
|
+
|
145
|
+
if (filterValues && (filterValues === null || filterValues === void 0 ? void 0 : filterValues.length) > 0) {
|
146
|
+
setHasDot(true);
|
147
|
+
} else {
|
148
|
+
setHasDot(false);
|
149
|
+
} // 全屏模式下展开收起过滤器需要重新计算tableMaxHeight
|
150
|
+
|
151
|
+
|
152
|
+
setTimeout(function () {
|
153
|
+
var _actionRef$current, _actionRef$current$ge;
|
154
|
+
|
155
|
+
if ((_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$ge = _actionRef$current.getState) === null || _actionRef$current$ge === void 0 ? void 0 : _actionRef$current$ge.call(_actionRef$current).fullScreenState) {
|
156
|
+
var _actionRef$current2, _actionRef$current2$r;
|
157
|
+
|
158
|
+
(_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$r = _actionRef$current2.resetTableMaxBodyHeight) === null || _actionRef$current2$r === void 0 ? void 0 : _actionRef$current2$r.call(_actionRef$current2);
|
159
|
+
}
|
160
|
+
});
|
161
|
+
};
|
162
|
+
|
163
|
+
if (mode === 'panel') {
|
164
|
+
if (expand === false && hasDot) {
|
165
|
+
return /*#__PURE__*/_react.default.createElement(_components.Badge, {
|
166
|
+
dot: true,
|
167
|
+
className: cls('filter-btn')
|
168
|
+
}, /*#__PURE__*/_react.default.createElement(_components.Button, {
|
169
|
+
onClick: handleBtnClick,
|
170
|
+
style: {
|
171
|
+
minWidth: 'unset'
|
172
|
+
}
|
173
|
+
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
174
|
+
type: expand ? 'up-line' : 'filter-line'
|
175
|
+
}), (0, _utils.getMessage)('filter')));
|
176
|
+
} else return /*#__PURE__*/_react.default.createElement(_components.Button, {
|
177
|
+
onClick: handleBtnClick,
|
178
|
+
className: cls('filter-btn'),
|
179
|
+
style: {
|
180
|
+
minWidth: 'unset'
|
181
|
+
}
|
182
|
+
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
183
|
+
type: expand ? 'up-line' : 'filter-line'
|
184
|
+
}), (0, _utils.getMessage)('filter'));
|
185
|
+
}
|
186
|
+
}; // 区域组合渲染
|
187
|
+
|
188
|
+
|
189
|
+
var renderLayout = function renderLayout() {
|
190
|
+
if (header && mainAction) {
|
191
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
192
|
+
className: cls('wrapper')
|
193
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
194
|
+
className: cls('left')
|
195
|
+
}, header && /*#__PURE__*/_react.default.createElement(_utils.Header, _objectSpread({}, header))), /*#__PURE__*/_react.default.createElement("div", {
|
196
|
+
className: cls('right')
|
197
|
+
}, quickAction && /*#__PURE__*/_react.default.createElement(_QuickAction.default, {
|
198
|
+
actionRef: actionRef,
|
199
|
+
quickAction: quickAction,
|
200
|
+
rowSelection: rowSelection
|
201
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
202
|
+
className: cls('wrapper')
|
203
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
204
|
+
className: cls('left')
|
205
|
+
}, mainAction && renderMainAction(), mode === 'panel' && renderFilterBtn(), mode === 'inline' && renderInlineFilter()), /*#__PURE__*/_react.default.createElement("div", {
|
206
|
+
className: cls('right')
|
207
|
+
}, /*#__PURE__*/_react.default.createElement(_ToolBar.default, _objectSpread({
|
208
|
+
actionRef: actionRef
|
209
|
+
}, otherProps)))), mode === 'panel' && renderPanelFilter());
|
210
|
+
} else if (header && !mainAction) {
|
211
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
212
|
+
className: cls('wrapper')
|
213
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
214
|
+
className: cls('left')
|
215
|
+
}, header && /*#__PURE__*/_react.default.createElement(_utils.Header, _objectSpread({}, header)), mode === 'panel' && renderFilterBtn(), mode === 'inline' && renderInlineFilter()), /*#__PURE__*/_react.default.createElement("div", {
|
216
|
+
className: cls('right')
|
217
|
+
}, quickAction && /*#__PURE__*/_react.default.createElement(_QuickAction.default, {
|
218
|
+
actionRef: actionRef,
|
219
|
+
quickAction: quickAction,
|
220
|
+
rowSelection: rowSelection
|
221
|
+
}), /*#__PURE__*/_react.default.createElement(_ToolBar.default, _objectSpread({
|
222
|
+
actionRef: actionRef
|
223
|
+
}, otherProps)))), mode === 'panel' && renderPanelFilter());
|
224
|
+
} else if (!header && mainAction) {
|
225
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
226
|
+
className: cls('wrapper')
|
227
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
228
|
+
className: cls('left')
|
229
|
+
}, mainAction && renderMainAction(), mode === 'panel' && renderFilterBtn(), mode === 'inline' && renderInlineFilter()), /*#__PURE__*/_react.default.createElement("div", {
|
230
|
+
className: cls('right')
|
231
|
+
}, quickAction && /*#__PURE__*/_react.default.createElement(_QuickAction.default, {
|
232
|
+
actionRef: actionRef,
|
233
|
+
quickAction: quickAction,
|
234
|
+
rowSelection: rowSelection
|
235
|
+
}), /*#__PURE__*/_react.default.createElement(_ToolBar.default, _objectSpread({
|
236
|
+
actionRef: actionRef
|
237
|
+
}, otherProps)))), mode === 'panel' && renderPanelFilter());
|
238
|
+
} else if (!header && !mainAction) {
|
239
|
+
if (!dataFilterForm && !quickAction) {
|
240
|
+
return null;
|
241
|
+
}
|
242
|
+
|
243
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
244
|
+
className: cls('wrapper')
|
245
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
246
|
+
className: cls('left')
|
247
|
+
}, mode === 'panel' && renderFilterBtn(), mode === 'inline' && renderInlineFilter()), /*#__PURE__*/_react.default.createElement("div", {
|
248
|
+
className: cls('right')
|
249
|
+
}, quickAction && /*#__PURE__*/_react.default.createElement(_QuickAction.default, {
|
250
|
+
actionRef: actionRef,
|
251
|
+
quickAction: quickAction,
|
252
|
+
rowSelection: rowSelection
|
253
|
+
}), /*#__PURE__*/_react.default.createElement(_ToolBar.default, _objectSpread({
|
254
|
+
actionRef: actionRef
|
255
|
+
}, otherProps)))), mode === 'panel' && renderPanelFilter());
|
256
|
+
}
|
257
|
+
};
|
258
|
+
|
259
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
260
|
+
className: cls()
|
261
|
+
}, renderLayout());
|
262
|
+
};
|
263
|
+
|
264
|
+
var _default = /*#__PURE__*/_react.default.memo(Layout);
|
265
|
+
|
266
|
+
exports.default = _default;
|
@@ -0,0 +1,39 @@
|
|
1
|
+
$prefix: 'teamix-pro-table-layout';
|
2
|
+
|
3
|
+
.theme-hybridcloud-dark {
|
4
|
+
--panel-filter-bg: #1f1f1f;
|
5
|
+
}
|
6
|
+
|
7
|
+
.#{$prefix} {
|
8
|
+
&-wrapper {
|
9
|
+
display: flex;
|
10
|
+
justify-content: space-between;
|
11
|
+
margin-bottom: 8px;
|
12
|
+
&:not(:first-child) {
|
13
|
+
margin-top: 8px;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
&-left {
|
17
|
+
display: flex;
|
18
|
+
align-items: center;
|
19
|
+
justify-content: flex-start;
|
20
|
+
}
|
21
|
+
&-right {
|
22
|
+
display: flex;
|
23
|
+
align-items: center;
|
24
|
+
justify-content: flex-end;
|
25
|
+
}
|
26
|
+
&-inline-filter:not(:first-child) {
|
27
|
+
margin-left: 8px;
|
28
|
+
display: flex;
|
29
|
+
align-items: center;
|
30
|
+
}
|
31
|
+
&-filter-btn:not(:first-child) {
|
32
|
+
margin-left: 8px;
|
33
|
+
}
|
34
|
+
&-panel-filter {
|
35
|
+
margin: 8px 0;
|
36
|
+
padding: 16px;
|
37
|
+
background: var(--panel-filter-bg, var(--color-fill1-2));
|
38
|
+
}
|
39
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { IActionButton } from '../../../actions';
|
3
|
+
import { ProTableActionType, innerRowSelectionType, rowSelectionType } from '../../typing';
|
4
|
+
interface QuickActionProps {
|
5
|
+
quickAction?: IActionButton | React.ReactNode | React.ReactNode[];
|
6
|
+
actionRef: React.MutableRefObject<ProTableActionType | undefined>;
|
7
|
+
rowSelection?: innerRowSelectionType | rowSelectionType;
|
8
|
+
}
|
9
|
+
declare const QuickAction: React.FC<QuickActionProps>;
|
10
|
+
export default QuickAction;
|
@@ -0,0 +1,65 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
9
|
+
|
10
|
+
var _components = require("@alicloudfe/components");
|
11
|
+
|
12
|
+
var _actions = _interopRequireDefault(require("../../../actions"));
|
13
|
+
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
|
+
|
16
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
17
|
+
|
18
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
19
|
+
|
20
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
21
|
+
|
22
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
23
|
+
|
24
|
+
var QuickAction = function QuickAction(props) {
|
25
|
+
var quickAction = props.quickAction,
|
26
|
+
actionRef = props.actionRef,
|
27
|
+
rowSelection = props.rowSelection; // 如果传对象的话,默认为主要文字类型的 ActionButton
|
28
|
+
|
29
|
+
if (_typeof(quickAction) === 'object') {
|
30
|
+
// 默认 context
|
31
|
+
var defaultContext = {
|
32
|
+
action: actionRef.current,
|
33
|
+
rowSelection: rowSelection
|
34
|
+
};
|
35
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
36
|
+
className: "teamix-pro-table-layout-quick-action"
|
37
|
+
}, /*#__PURE__*/_react.default.createElement(_actions.default, _objectSpread(_objectSpread({
|
38
|
+
type: "primary",
|
39
|
+
text: true
|
40
|
+
}, quickAction), {}, {
|
41
|
+
context: _objectSpread(_objectSpread({}, defaultContext), quickAction.context)
|
42
|
+
})));
|
43
|
+
}
|
44
|
+
|
45
|
+
if (Array.isArray(quickAction)) {
|
46
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
47
|
+
className: "teamix-pro-table-layout-quick-action"
|
48
|
+
}, /*#__PURE__*/_react.default.createElement(_components.Box, {
|
49
|
+
direction: "row",
|
50
|
+
spacing: 8,
|
51
|
+
align: "center"
|
52
|
+
}, quickAction.map(function (item, index) {
|
53
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
54
|
+
key: index
|
55
|
+
}, item);
|
56
|
+
})));
|
57
|
+
}
|
58
|
+
|
59
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
60
|
+
className: "teamix-pro-table-layout-quick-action"
|
61
|
+
}, quickAction);
|
62
|
+
};
|
63
|
+
|
64
|
+
var _default = QuickAction;
|
65
|
+
exports.default = _default;
|
File without changes
|