@teamix/pro 1.0.25 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all.css +1 -1
- package/dist/all.js +10401 -14141
- package/dist/all.min.css +1 -1
- package/dist/all.min.js +1 -1
- package/es/actions/base.d.ts +13 -0
- package/es/actions/base.js +23 -0
- package/es/actions/confirm.d.ts +7 -0
- package/es/actions/confirm.js +11 -0
- package/es/actions/danger-confirm.d.ts +7 -0
- package/es/actions/danger-confirm.js +14 -0
- package/es/actions/dialog-component.d.ts +10 -0
- package/es/actions/dialog-component.js +25 -0
- package/es/actions/dialog-form.d.ts +15 -0
- package/es/actions/dialog-form.js +129 -0
- package/es/actions/dialog-table.d.ts +4 -0
- package/es/actions/dialog-table.js +1 -0
- package/es/actions/dialog.d.ts +17 -0
- package/es/actions/dialog.js +197 -0
- package/es/actions/drawer-form.d.ts +6 -0
- package/es/actions/drawer-form.js +7 -0
- package/es/actions/drawer-table.d.ts +2 -0
- package/es/actions/drawer-table.js +1 -0
- package/es/actions/drawer.d.ts +6 -0
- package/es/actions/drawer.js +7 -0
- package/es/actions/error.d.ts +7 -0
- package/es/actions/error.js +11 -0
- package/es/actions/index.d.ts +76 -0
- package/es/actions/index.js +317 -0
- package/es/actions/index.scss +34 -0
- package/es/actions/link.d.ts +14 -0
- package/es/actions/link.js +45 -0
- package/es/actions/notice.d.ts +7 -0
- package/es/actions/notice.js +11 -0
- package/es/actions/request.d.ts +9 -0
- package/es/actions/request.js +60 -0
- package/es/card/index.d.ts +30 -0
- package/es/card/index.js +159 -0
- package/es/card/index.scss +98 -0
- package/es/field/index.d.ts +3 -0
- package/es/field/index.js +3 -0
- package/es/form/Components/Editable/index.d.ts +20 -0
- package/es/form/Components/Editable/index.js +228 -0
- package/es/form/Components/FormGroup/index.d.ts +13 -0
- package/es/form/Components/FormGroup/index.js +89 -0
- package/es/form/Components/FormGroup/index.scss +23 -0
- package/es/form/Components/ProField/index.d.ts +150 -0
- package/es/form/Components/ProField/index.js +53 -0
- package/es/form/Components/Query/index.d.ts +4 -0
- package/es/form/Components/Query/index.js +70 -0
- package/es/form/Components/Query/index.scss +90 -0
- package/es/form/Components/QueryFilter/index.d.ts +3 -0
- package/es/form/Components/QueryFilter/index.js +111 -0
- package/es/form/Components/Search/index.d.ts +11 -0
- package/es/form/Components/Search/index.js +89 -0
- package/es/form/Filter/index.d.ts +16 -0
- package/es/form/Filter/index.js +218 -0
- package/es/form/ProForm/index.d.ts +5 -0
- package/es/form/ProForm/index.js +100 -0
- package/es/form/ProForm/index.scss +248 -0
- package/es/form/SchemaForm/adapterComponent.d.ts +5 -0
- package/es/form/SchemaForm/adapterComponent.js +17 -0
- package/es/form/SchemaForm/adapterDecorator.d.ts +6 -0
- package/es/form/SchemaForm/adapterDecorator.js +28 -0
- package/es/form/SchemaForm/adapterType.d.ts +5 -0
- package/es/form/SchemaForm/adapterType.js +54 -0
- package/es/form/SchemaForm/index.d.ts +4 -0
- package/es/form/SchemaForm/index.js +258 -0
- package/es/form/SchemaForm/initializeArrayCards.d.ts +3 -0
- package/es/form/SchemaForm/initializeArrayCards.js +69 -0
- package/es/form/SchemaForm/initializeArrayCollapse.d.ts +3 -0
- package/es/form/SchemaForm/initializeArrayCollapse.js +78 -0
- package/es/form/SchemaForm/initializeArrayIcon.d.ts +3 -0
- package/es/form/SchemaForm/initializeArrayIcon.js +50 -0
- package/es/form/SchemaForm/initializeArrayItems.d.ts +3 -0
- package/es/form/SchemaForm/initializeArrayItems.js +97 -0
- package/es/form/SchemaForm/initializeArrayTable.d.ts +3 -0
- package/es/form/SchemaForm/initializeArrayTable.js +66 -0
- package/es/form/SchemaForm/initializeFormButton.d.ts +3 -0
- package/es/form/SchemaForm/initializeFormButton.js +75 -0
- package/es/form/SchemaForm/initializeFormCollapse.d.ts +3 -0
- package/es/form/SchemaForm/initializeFormCollapse.js +43 -0
- package/es/form/SchemaForm/initializeFormGroup.d.ts +3 -0
- package/es/form/SchemaForm/initializeFormGroup.js +46 -0
- package/es/form/SchemaForm/initializeFormStep.d.ts +3 -0
- package/es/form/SchemaForm/initializeFormStep.js +48 -0
- package/es/form/SchemaForm/initializeFormTab.d.ts +3 -0
- package/es/form/SchemaForm/initializeFormTab.js +53 -0
- package/es/form/SchemaForm/initializeProField.d.ts +5 -0
- package/es/form/SchemaForm/initializeProField.js +69 -0
- package/es/form/SchemaForm/initializeRequest.d.ts +11 -0
- package/es/form/SchemaForm/initializeRequest.js +25 -0
- package/es/form/SchemaForm/reactions.d.ts +4 -0
- package/es/form/SchemaForm/reactions.js +62 -0
- package/es/form/index.d.ts +20 -0
- package/es/form/index.js +24 -0
- package/es/form/typing.d.ts +78 -0
- package/es/form/typing.js +1 -0
- package/es/form/utils.d.ts +9 -0
- package/es/form/utils.js +108 -0
- package/es/form/warning.d.ts +3 -0
- package/es/form/warning.js +20 -0
- package/es/hooks/index.d.ts +2 -0
- package/es/hooks/index.js +2 -0
- package/es/index.d.ts +24 -23
- package/es/index.js +25 -24
- package/es/info/components/FormItem/index.d.ts +5 -0
- package/es/info/components/FormItem/index.js +63 -0
- package/es/info/components/FormItem/index.scss +49 -0
- package/es/info/components/InfoGroup/index.d.ts +5 -0
- package/es/info/components/InfoGroup/index.js +16 -0
- package/es/info/components/InfoGroup/index.scss +8 -0
- package/es/info/components/InfoValueItem/index.d.ts +5 -0
- package/es/info/components/InfoValueItem/index.js +211 -0
- package/es/info/components/InfoValueItem/index.scss +21 -0
- package/es/info/components/baseInfo/index.d.ts +7 -0
- package/es/info/components/baseInfo/index.js +72 -0
- package/es/info/components/baseInfo/index.scss +3 -0
- package/es/info/components/headerInfo/index.d.ts +7 -0
- package/es/info/components/headerInfo/index.js +84 -0
- package/es/info/components/headerInfo/index.scss +0 -0
- package/es/info/components/tableInfo/index.d.ts +8 -0
- package/es/info/components/tableInfo/index.js +172 -0
- package/es/info/components/tableInfo/index.scss +18 -0
- package/es/info/index.d.ts +9 -0
- package/es/info/index.js +85 -0
- package/es/info/index.scss +8 -0
- package/es/info/typing.d.ts +143 -0
- package/es/info/typing.js +1 -0
- package/es/info/utils/index.d.ts +3 -0
- package/es/info/utils/index.js +12 -0
- package/es/info/utils/layout.d.ts +2 -0
- package/es/info/utils/layout.js +58 -0
- package/es/info/utils/useInfoRequest.d.ts +14 -0
- package/es/info/utils/useInfoRequest.js +73 -0
- package/es/info/utils/utils.d.ts +1 -0
- package/es/info/utils/utils.js +13 -0
- package/es/layout/index.d.ts +3 -0
- package/es/layout/index.js +3 -0
- package/es/nocode/configurators/Card.d.ts +3 -0
- package/es/nocode/configurators/Card.js +109 -0
- package/es/nocode/configurators/PageHeader.d.ts +3 -0
- package/es/nocode/configurators/PageHeader.js +196 -0
- package/es/nocode/configurators/ProTable.d.ts +3 -0
- package/es/nocode/configurators/ProTable.js +317 -0
- package/es/nocode/configurators/common.d.ts +176 -0
- package/es/nocode/configurators/common.js +314 -0
- package/es/nocode/configurators/index.d.ts +15 -0
- package/es/nocode/configurators/index.js +27 -0
- package/es/nocode/configurators/map.d.ts +2 -0
- package/es/nocode/configurators/map.js +8 -0
- package/es/nocode/index.d.ts +8 -0
- package/es/nocode/index.js +11 -0
- package/es/nocode/index.scss +93 -0
- package/es/nocode/pages/editor.d.ts +12 -0
- package/es/nocode/pages/editor.js +40 -0
- package/es/nocode/pages/index.d.ts +14 -0
- package/es/nocode/pages/index.js +41 -0
- package/es/nocode/pages/playground.d.ts +11 -0
- package/es/nocode/pages/playground.js +130 -0
- package/es/nocode/pages/renderer.d.ts +10 -0
- package/es/nocode/pages/renderer.js +144 -0
- package/es/nocode/playground.d.ts +14 -0
- package/es/nocode/playground.js +68 -0
- package/es/page-container/index.d.ts +3 -0
- package/es/page-container/index.js +3 -0
- package/es/page-header/index.d.ts +42 -0
- package/es/page-header/index.js +222 -0
- package/es/page-header/index.scss +171 -0
- package/es/skeleton/index.d.ts +3 -0
- package/es/skeleton/index.js +3 -0
- package/es/table/components/Filter/index.d.ts +9 -0
- package/es/table/components/Filter/index.js +231 -0
- package/es/table/components/Filter/index.scss +23 -0
- package/es/table/components/Layout/index.d.ts +5 -0
- package/es/table/components/Layout/index.js +241 -0
- package/es/table/components/Layout/index.scss +39 -0
- package/es/table/components/QuickAction/index.d.ts +10 -0
- package/es/table/components/QuickAction/index.js +53 -0
- package/es/table/components/QuickAction/index.scss +0 -0
- package/es/table/components/ToolBar/DensityIcon.d.ts +4 -0
- package/es/table/components/ToolBar/DensityIcon.js +117 -0
- package/es/table/components/ToolBar/FilterColumnIcon.d.ts +4 -0
- package/es/table/components/ToolBar/FilterColumnIcon.js +284 -0
- package/es/table/components/ToolBar/FullScreenIcon.d.ts +4 -0
- package/es/table/components/ToolBar/FullScreenIcon.js +89 -0
- package/es/table/components/ToolBar/Fullscreen.d.ts +10 -0
- package/es/table/components/ToolBar/Fullscreen.js +68 -0
- package/es/table/components/ToolBar/RefreshIcon.d.ts +4 -0
- package/es/table/components/ToolBar/RefreshIcon.js +45 -0
- package/es/table/components/ToolBar/index.d.ts +5 -0
- package/es/table/components/ToolBar/index.js +79 -0
- package/es/table/components/ToolBar/index.scss +110 -0
- package/es/table/index.d.ts +7 -0
- package/es/table/index.js +620 -0
- package/es/table/index.scss +104 -0
- package/es/table/typing.d.ts +222 -0
- package/es/table/typing.js +1 -0
- package/es/table/utils/columnRender.d.ts +13 -0
- package/es/table/utils/columnRender.js +185 -0
- package/es/table/utils/genProColumnToColumn.d.ts +9 -0
- package/es/table/utils/genProColumnToColumn.js +51 -0
- package/es/table/utils/getTableProps.d.ts +2 -0
- package/es/table/utils/getTableProps.js +4 -0
- package/es/table/utils/getTableSortIcons.d.ts +3 -0
- package/es/table/utils/getTableSortIcons.js +21 -0
- package/es/table/utils/index.d.ts +4 -0
- package/es/table/utils/index.js +100 -0
- package/es/table/utils/useTableSelection.d.ts +3 -0
- package/es/table/utils/useTableSelection.js +107 -0
- package/es/templates/Detail/index.d.ts +2 -0
- package/es/templates/Detail/index.js +5 -0
- package/es/templates/Detail/index.scss +3 -0
- package/es/templates/Form/index.d.ts +2 -0
- package/es/templates/Form/index.js +5 -0
- package/es/templates/Form/index.scss +3 -0
- package/es/templates/List/index.d.ts +9 -0
- package/es/templates/List/index.js +45 -0
- package/es/templates/List/index.scss +3 -0
- package/es/templates/index.d.ts +5 -0
- package/es/templates/index.js +7 -0
- package/es/templates/index.scss +3 -0
- package/es/utils/index.d.ts +2 -0
- package/es/utils/index.js +2 -0
- package/lib/actions/base.d.ts +13 -0
- package/lib/actions/base.js +33 -0
- package/lib/actions/confirm.d.ts +7 -0
- package/lib/actions/confirm.js +25 -0
- package/lib/actions/danger-confirm.d.ts +7 -0
- package/lib/actions/danger-confirm.js +28 -0
- package/lib/actions/dialog-component.d.ts +10 -0
- package/lib/actions/dialog-component.js +39 -0
- package/lib/actions/dialog-form.d.ts +15 -0
- package/lib/actions/dialog-form.js +152 -0
- package/lib/actions/dialog-table.d.ts +4 -0
- package/lib/actions/dialog-table.js +5 -0
- package/lib/actions/dialog.d.ts +17 -0
- package/lib/actions/dialog.js +219 -0
- package/lib/actions/drawer-form.d.ts +6 -0
- package/lib/actions/drawer-form.js +18 -0
- package/lib/actions/drawer-table.d.ts +2 -0
- package/lib/actions/drawer-table.js +5 -0
- package/lib/actions/drawer.d.ts +6 -0
- package/lib/actions/drawer.js +20 -0
- package/lib/actions/error.d.ts +7 -0
- package/lib/actions/error.js +25 -0
- package/lib/actions/index.d.ts +76 -0
- package/lib/actions/index.js +356 -0
- package/lib/actions/index.scss +34 -0
- package/lib/actions/link.d.ts +14 -0
- package/lib/actions/link.js +60 -0
- package/lib/actions/notice.d.ts +7 -0
- package/lib/actions/notice.js +25 -0
- package/lib/actions/request.d.ts +9 -0
- package/lib/actions/request.js +75 -0
- package/lib/card/index.d.ts +30 -0
- package/lib/card/index.js +179 -0
- package/lib/card/index.scss +98 -0
- package/lib/field/index.d.ts +3 -0
- package/lib/field/index.js +30 -0
- package/lib/form/Components/Editable/index.d.ts +20 -0
- package/lib/form/Components/Editable/index.js +251 -0
- package/lib/form/Components/FormGroup/index.d.ts +13 -0
- package/lib/form/Components/FormGroup/index.js +103 -0
- package/lib/form/Components/FormGroup/index.scss +23 -0
- package/lib/form/Components/ProField/index.d.ts +150 -0
- package/lib/form/Components/ProField/index.js +68 -0
- package/lib/form/Components/Query/index.d.ts +4 -0
- package/lib/form/Components/Query/index.js +91 -0
- package/lib/form/Components/Query/index.scss +90 -0
- package/lib/form/Components/QueryFilter/index.d.ts +3 -0
- package/lib/form/Components/QueryFilter/index.js +130 -0
- package/lib/form/Components/Search/index.d.ts +11 -0
- package/lib/form/Components/Search/index.js +103 -0
- package/lib/form/Filter/index.d.ts +16 -0
- package/lib/form/Filter/index.js +242 -0
- package/lib/form/ProForm/index.d.ts +5 -0
- package/lib/form/ProForm/index.js +125 -0
- package/lib/form/ProForm/index.scss +248 -0
- package/lib/form/SchemaForm/adapterComponent.d.ts +5 -0
- package/lib/form/SchemaForm/adapterComponent.js +27 -0
- package/lib/form/SchemaForm/adapterDecorator.d.ts +6 -0
- package/lib/form/SchemaForm/adapterDecorator.js +34 -0
- package/lib/form/SchemaForm/adapterType.d.ts +5 -0
- package/lib/form/SchemaForm/adapterType.js +64 -0
- package/lib/form/SchemaForm/index.d.ts +4 -0
- package/lib/form/SchemaForm/index.js +301 -0
- package/lib/form/SchemaForm/initializeArrayCards.d.ts +3 -0
- package/lib/form/SchemaForm/initializeArrayCards.js +76 -0
- package/lib/form/SchemaForm/initializeArrayCollapse.d.ts +3 -0
- package/lib/form/SchemaForm/initializeArrayCollapse.js +85 -0
- package/lib/form/SchemaForm/initializeArrayIcon.d.ts +3 -0
- package/lib/form/SchemaForm/initializeArrayIcon.js +61 -0
- package/lib/form/SchemaForm/initializeArrayItems.d.ts +3 -0
- package/lib/form/SchemaForm/initializeArrayItems.js +104 -0
- package/lib/form/SchemaForm/initializeArrayTable.d.ts +3 -0
- package/lib/form/SchemaForm/initializeArrayTable.js +73 -0
- package/lib/form/SchemaForm/initializeFormButton.d.ts +3 -0
- package/lib/form/SchemaForm/initializeFormButton.js +82 -0
- package/lib/form/SchemaForm/initializeFormCollapse.d.ts +3 -0
- package/lib/form/SchemaForm/initializeFormCollapse.js +50 -0
- package/lib/form/SchemaForm/initializeFormGroup.d.ts +3 -0
- package/lib/form/SchemaForm/initializeFormGroup.js +53 -0
- package/lib/form/SchemaForm/initializeFormStep.d.ts +3 -0
- package/lib/form/SchemaForm/initializeFormStep.js +55 -0
- package/lib/form/SchemaForm/initializeFormTab.d.ts +3 -0
- package/lib/form/SchemaForm/initializeFormTab.js +60 -0
- package/lib/form/SchemaForm/initializeProField.d.ts +5 -0
- package/lib/form/SchemaForm/initializeProField.js +76 -0
- package/lib/form/SchemaForm/initializeRequest.d.ts +11 -0
- package/lib/form/SchemaForm/initializeRequest.js +34 -0
- package/lib/form/SchemaForm/reactions.d.ts +4 -0
- package/lib/form/SchemaForm/reactions.js +72 -0
- package/lib/form/index.d.ts +20 -0
- package/lib/form/index.js +149 -0
- package/lib/form/typing.d.ts +78 -0
- package/lib/form/typing.js +5 -0
- package/lib/form/utils.d.ts +9 -0
- package/lib/form/utils.js +124 -0
- package/lib/form/warning.d.ts +3 -0
- package/lib/form/warning.js +28 -0
- package/lib/hooks/index.d.ts +2 -0
- package/lib/hooks/index.js +17 -0
- package/lib/index.d.ts +24 -23
- package/lib/index.js +79 -61
- package/lib/info/components/FormItem/index.d.ts +5 -0
- package/lib/info/components/FormItem/index.js +78 -0
- package/lib/info/components/FormItem/index.scss +49 -0
- package/lib/info/components/InfoGroup/index.d.ts +5 -0
- package/lib/info/components/InfoGroup/index.js +27 -0
- package/lib/info/components/InfoGroup/index.scss +8 -0
- package/lib/info/components/InfoValueItem/index.d.ts +5 -0
- package/lib/info/components/InfoValueItem/index.js +237 -0
- package/lib/info/components/InfoValueItem/index.scss +21 -0
- package/lib/info/components/baseInfo/index.d.ts +7 -0
- package/lib/info/components/baseInfo/index.js +99 -0
- package/lib/info/components/baseInfo/index.scss +3 -0
- package/lib/info/components/headerInfo/index.d.ts +7 -0
- package/lib/info/components/headerInfo/index.js +111 -0
- package/lib/info/components/headerInfo/index.scss +0 -0
- package/lib/info/components/tableInfo/index.d.ts +8 -0
- package/lib/info/components/tableInfo/index.js +193 -0
- package/lib/info/components/tableInfo/index.scss +18 -0
- package/lib/info/index.d.ts +9 -0
- package/lib/info/index.js +121 -0
- package/lib/info/index.scss +8 -0
- package/lib/info/typing.d.ts +143 -0
- package/lib/info/typing.js +5 -0
- package/lib/info/utils/index.d.ts +3 -0
- package/lib/info/utils/index.js +19 -0
- package/lib/info/utils/layout.d.ts +2 -0
- package/lib/info/utils/layout.js +65 -0
- package/lib/info/utils/useInfoRequest.d.ts +14 -0
- package/lib/info/utils/useInfoRequest.js +82 -0
- package/lib/info/utils/utils.d.ts +1 -0
- package/lib/info/utils/utils.js +20 -0
- package/lib/layout/index.d.ts +3 -0
- package/lib/layout/index.js +30 -0
- package/lib/nocode/configurators/Card.d.ts +3 -0
- package/lib/nocode/configurators/Card.js +116 -0
- package/lib/nocode/configurators/PageHeader.d.ts +3 -0
- package/lib/nocode/configurators/PageHeader.js +205 -0
- package/lib/nocode/configurators/ProTable.d.ts +3 -0
- package/lib/nocode/configurators/ProTable.js +326 -0
- package/lib/nocode/configurators/common.d.ts +176 -0
- package/lib/nocode/configurators/common.js +325 -0
- package/lib/nocode/configurators/index.d.ts +15 -0
- package/lib/nocode/configurators/index.js +44 -0
- package/lib/nocode/configurators/map.d.ts +2 -0
- package/lib/nocode/configurators/map.js +21 -0
- package/lib/nocode/index.d.ts +8 -0
- package/lib/nocode/index.js +76 -0
- package/lib/nocode/index.scss +93 -0
- package/lib/nocode/pages/editor.d.ts +12 -0
- package/lib/nocode/pages/editor.js +58 -0
- package/lib/nocode/pages/index.d.ts +14 -0
- package/lib/nocode/pages/index.js +93 -0
- package/lib/nocode/pages/playground.d.ts +11 -0
- package/lib/nocode/pages/playground.js +158 -0
- package/lib/nocode/pages/renderer.d.ts +10 -0
- package/lib/nocode/pages/renderer.js +164 -0
- package/lib/nocode/playground.d.ts +14 -0
- package/lib/nocode/playground.js +91 -0
- package/lib/page-container/index.d.ts +3 -0
- package/lib/page-container/index.js +30 -0
- package/lib/page-header/index.d.ts +42 -0
- package/lib/page-header/index.js +240 -0
- package/lib/page-header/index.scss +171 -0
- package/lib/skeleton/index.d.ts +3 -0
- package/lib/skeleton/index.js +30 -0
- package/lib/table/components/Filter/index.d.ts +9 -0
- package/lib/table/components/Filter/index.js +252 -0
- package/lib/table/components/Filter/index.scss +23 -0
- package/lib/table/components/Layout/index.d.ts +5 -0
- package/lib/table/components/Layout/index.js +265 -0
- package/lib/table/components/Layout/index.scss +39 -0
- package/lib/table/components/QuickAction/index.d.ts +10 -0
- package/lib/table/components/QuickAction/index.js +65 -0
- package/lib/table/components/QuickAction/index.scss +0 -0
- package/lib/table/components/ToolBar/DensityIcon.d.ts +4 -0
- package/lib/table/components/ToolBar/DensityIcon.js +135 -0
- package/lib/table/components/ToolBar/FilterColumnIcon.d.ts +4 -0
- package/lib/table/components/ToolBar/FilterColumnIcon.js +303 -0
- package/lib/table/components/ToolBar/FullScreenIcon.d.ts +4 -0
- package/lib/table/components/ToolBar/FullScreenIcon.js +107 -0
- package/lib/table/components/ToolBar/Fullscreen.d.ts +10 -0
- package/lib/table/components/ToolBar/Fullscreen.js +85 -0
- package/lib/table/components/ToolBar/RefreshIcon.d.ts +4 -0
- package/lib/table/components/ToolBar/RefreshIcon.js +60 -0
- package/lib/table/components/ToolBar/index.d.ts +5 -0
- package/lib/table/components/ToolBar/index.js +96 -0
- package/lib/table/components/ToolBar/index.scss +110 -0
- package/lib/table/index.d.ts +7 -0
- package/lib/table/index.js +681 -0
- package/lib/table/index.scss +104 -0
- package/lib/table/typing.d.ts +222 -0
- package/lib/table/typing.js +5 -0
- package/lib/table/utils/columnRender.d.ts +13 -0
- package/lib/table/utils/columnRender.js +201 -0
- package/lib/table/utils/genProColumnToColumn.d.ts +9 -0
- package/lib/table/utils/genProColumnToColumn.js +62 -0
- package/lib/table/utils/getTableProps.d.ts +2 -0
- package/lib/table/utils/getTableProps.js +13 -0
- package/lib/table/utils/getTableSortIcons.d.ts +3 -0
- package/lib/table/utils/getTableSortIcons.js +34 -0
- package/lib/table/utils/index.d.ts +4 -0
- package/lib/table/utils/index.js +112 -0
- package/lib/table/utils/useTableSelection.d.ts +3 -0
- package/lib/table/utils/useTableSelection.js +112 -0
- package/lib/templates/Detail/index.d.ts +2 -0
- package/lib/templates/Detail/index.js +18 -0
- package/lib/templates/Detail/index.scss +3 -0
- package/lib/templates/Form/index.d.ts +2 -0
- package/lib/templates/Form/index.js +18 -0
- package/lib/templates/Form/index.scss +3 -0
- package/lib/templates/List/index.d.ts +9 -0
- package/lib/templates/List/index.js +67 -0
- package/lib/templates/List/index.scss +3 -0
- package/lib/templates/index.d.ts +5 -0
- package/lib/templates/index.js +59 -0
- package/lib/templates/index.scss +3 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.js +17 -0
- package/package.json +21 -11
@@ -0,0 +1,104 @@
|
|
1
|
+
$prefix: 'teamix-pro-table';
|
2
|
+
$fullscreenPadding: 24px;
|
3
|
+
|
4
|
+
.next-overlay-wrapper {
|
5
|
+
--checkbox-select-icon-content: '\ead7';
|
6
|
+
--checkbox-semi-select-icon-content: '\ead5';
|
7
|
+
}
|
8
|
+
|
9
|
+
.#{$prefix} {
|
10
|
+
background: var(--table-row-bg, #ffffff);
|
11
|
+
position: relative;
|
12
|
+
--checkbox-select-icon-content: '\ead7';
|
13
|
+
--checkbox-semi-select-icon-content: '\ead5';
|
14
|
+
&-footer {
|
15
|
+
padding: 8px 0;
|
16
|
+
}
|
17
|
+
&-footer-fixed {
|
18
|
+
position: fixed;
|
19
|
+
z-index: 3;
|
20
|
+
bottom: 0;
|
21
|
+
border-top: 1px solid var(--color-line1-2);
|
22
|
+
box-shadow: var(--shadow-1-up);
|
23
|
+
background: var(--color-fill1-1);
|
24
|
+
}
|
25
|
+
&-footer-has-rowSelection {
|
26
|
+
display: flex;
|
27
|
+
align-items: center;
|
28
|
+
padding: 8px 0;
|
29
|
+
}
|
30
|
+
&-footer-left-wrapper {
|
31
|
+
display: flex;
|
32
|
+
flex: 1;
|
33
|
+
align-items: center;
|
34
|
+
}
|
35
|
+
&-footer-right-wrapper {
|
36
|
+
display: flex;
|
37
|
+
justify-content: flex-end;
|
38
|
+
}
|
39
|
+
&-footer-action {
|
40
|
+
margin-left: 16px;
|
41
|
+
}
|
42
|
+
&-footer-checkbox-medium {
|
43
|
+
margin-left: var(--table-cell-padding-left, 16px);
|
44
|
+
}
|
45
|
+
&-footer-checkbox-small {
|
46
|
+
margin-left: var(--table-size-s-cell-padding-left, 8px);
|
47
|
+
}
|
48
|
+
&-selected-msg {
|
49
|
+
color: var(--color-fill1-6);
|
50
|
+
margin-left: 16px;
|
51
|
+
}
|
52
|
+
&-fullscreen {
|
53
|
+
padding: $fullscreenPadding $fullscreenPadding 0 $fullscreenPadding;
|
54
|
+
|
55
|
+
// 去除全屏锁列之后右侧滚动条阴影
|
56
|
+
.next-table-stickylock.next-table-scrolling-to-right {
|
57
|
+
&::after {
|
58
|
+
box-shadow: unset;
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
.teamix-pro-table-footer {
|
63
|
+
position: fixed;
|
64
|
+
bottom: 0;
|
65
|
+
left: 0;
|
66
|
+
right: 0;
|
67
|
+
padding: 10px $fullscreenPadding 8px $fullscreenPadding;
|
68
|
+
box-shadow: var(--shadow-1-up);
|
69
|
+
background-color: var(--table-row-bg, #ffffff);
|
70
|
+
margin: 0;
|
71
|
+
z-index: 2;
|
72
|
+
}
|
73
|
+
|
74
|
+
.next-table-body {
|
75
|
+
transition: all 0.1s;
|
76
|
+
}
|
77
|
+
}
|
78
|
+
// sort icon
|
79
|
+
.next-table-sort.next-table-header-icon {
|
80
|
+
line-height: 16px;
|
81
|
+
margin-left: 6px;
|
82
|
+
.teamix-icon {
|
83
|
+
position: absolute;
|
84
|
+
width: 12px;
|
85
|
+
}
|
86
|
+
& .current .teamix-icon {
|
87
|
+
color: var(--table-sort-color-current, #0064c8);
|
88
|
+
}
|
89
|
+
}
|
90
|
+
}
|
91
|
+
|
92
|
+
.teamix-pro-table-footer-suction {
|
93
|
+
margin-bottom: 50px;
|
94
|
+
.teamix-pro-table-footer {
|
95
|
+
position: fixed;
|
96
|
+
bottom: 0;
|
97
|
+
padding: 10px $fullscreenPadding 8px $fullscreenPadding;
|
98
|
+
box-shadow: var(--shadow-1-up);
|
99
|
+
background-color: var(--table-row-bg, #ffffff);
|
100
|
+
margin: 0;
|
101
|
+
z-index: 2;
|
102
|
+
transition: width .3s;
|
103
|
+
}
|
104
|
+
}
|
@@ -0,0 +1,222 @@
|
|
1
|
+
/**
|
2
|
+
* ProTable 类型定义
|
3
|
+
*/
|
4
|
+
import { ColumnProps, TableProps } from '@alicloudfe/components/types/table';
|
5
|
+
import { IProFieldType, IProFieldFormatterProps, IProFieldOptionItem, IProFieldValueEnum } from '../field';
|
6
|
+
import { IFilterProps } from '../form';
|
7
|
+
import { ActionGroupProps, IActionButton } from '../actions';
|
8
|
+
import { PaginationProps } from '@alicloudfe/components/types/pagination';
|
9
|
+
import { HeaderProps as ProTableHeaderProps } from '@teamix/utils';
|
10
|
+
import { Method } from 'axios';
|
11
|
+
import React from 'react';
|
12
|
+
import type { Form as FormType } from '@formily/core';
|
13
|
+
declare type IFieldRenderProps = keyof IProFieldFormatterProps;
|
14
|
+
declare type ITableCellRender = {
|
15
|
+
[key in IFieldRenderProps]?: IProFieldFormatterProps[key] | ((...props: any) => void);
|
16
|
+
} | ((...other: any) => React.ReactNode);
|
17
|
+
declare type TDataService = {
|
18
|
+
/** 翻页器总数 */
|
19
|
+
total?: string;
|
20
|
+
/** 表格数据 */
|
21
|
+
data?: any;
|
22
|
+
};
|
23
|
+
export declare type ProColumnProps = {
|
24
|
+
/**
|
25
|
+
* 会在 title 之后展示一个 icon,hover 之后提示一些信息
|
26
|
+
*/
|
27
|
+
tooltip?: string;
|
28
|
+
/**
|
29
|
+
* title 之后展示一个 icon 设置,可传 TeamixIcon 对应的 type,也可以是自定义 Icon
|
30
|
+
*/
|
31
|
+
tooltipIcon?: React.ReactNode;
|
32
|
+
/** 对应 ProField 里面的 type */
|
33
|
+
valueType?: IProFieldType;
|
34
|
+
/** 是否默认隐藏列 */
|
35
|
+
columnFilters?: boolean;
|
36
|
+
/** 是否禁用隐藏列 */
|
37
|
+
columnFiltersDisabled?: boolean;
|
38
|
+
/** 渲染单元格内容字段 */
|
39
|
+
render?: ITableCellRender;
|
40
|
+
/** 枚举值 */
|
41
|
+
dataSource?: IProFieldValueEnum | IProFieldOptionItem[];
|
42
|
+
/** 表头的过滤菜单项,当值为 true 时,自动使用 dataSource 生成 */
|
43
|
+
filters?: boolean | ProTableColumnsFilterItemProps[];
|
44
|
+
/** 表头的过滤菜单项过滤方式 single 单选 multiple 多选 */
|
45
|
+
filtersMode?: 'single' | 'multiple';
|
46
|
+
/** 表头的过滤菜单项在搜索之前的参数操作 */
|
47
|
+
beforeFilter?: (rules: string[]) => string;
|
48
|
+
/** 操作组配置 */
|
49
|
+
actionSchema?: ActionGroupProps;
|
50
|
+
/** 指定列对应的字段,支持`a.b`形式的快速取值 和 数组取值 */
|
51
|
+
dataIndex?: string | string[];
|
52
|
+
} & Omit<ColumnProps, 'filters' | 'dataIndex' | 'filtersMode'>;
|
53
|
+
export declare type ProTableProps = {
|
54
|
+
/** ProColums 定义,取代 Table 的 columns */
|
55
|
+
columns: ProColumnProps[];
|
56
|
+
/** 请求地址 */
|
57
|
+
url?: string;
|
58
|
+
/** 请求方法 */
|
59
|
+
method?: Method;
|
60
|
+
/** 请求参数 */
|
61
|
+
params?: object;
|
62
|
+
/** sort 排序请求参数处理函数 */
|
63
|
+
formatSort?: (sort: object) => object;
|
64
|
+
/** 如需自定义调用参数格式,则可以设定此值在请求前对 params 进行自定义,如果返回false则可以阻止请求 */
|
65
|
+
formatParams?: (params: any) => typeof params;
|
66
|
+
/** 对返回值的 data,total 进行映射处理 */
|
67
|
+
formatResult?: TDataService | ((res: any) => TDataService);
|
68
|
+
/** 请求成功后经过 formatResult 转换后的回调 */
|
69
|
+
onFormatResult?: (data: any[]) => void;
|
70
|
+
/** 是否第一次加载时就发起请求 */
|
71
|
+
requestWhenMount?: boolean;
|
72
|
+
/** 内部请求每次成功后的回调 */
|
73
|
+
onSuccess?: (res: any) => void;
|
74
|
+
/** 内部请求失败时的回调 */
|
75
|
+
onError?: (error: Error) => void;
|
76
|
+
/** 翻页页数的请求参数名 */
|
77
|
+
pageKey?: string;
|
78
|
+
/** 翻页器页数对应字段 */
|
79
|
+
pageSizeKey?: string;
|
80
|
+
/** 翻页器每页显示的条数 */
|
81
|
+
pageSize?: number;
|
82
|
+
/** 每页显示选择器可选值 */
|
83
|
+
pageSizeList?: PaginationProps['pageSizeList'];
|
84
|
+
/** 透传给翻页器的属性 */
|
85
|
+
paginationProps?: PaginationProps;
|
86
|
+
/** 是否显示翻页器 */
|
87
|
+
showPagination?: boolean;
|
88
|
+
/** 是否使用内置的 rowSelection */
|
89
|
+
useRowSelection?: boolean;
|
90
|
+
/** 内置 rowSelection 变化时的回调 */
|
91
|
+
onChangeRowSelection?: (selectedRowKeys: string[]) => void;
|
92
|
+
/** 获取内置 rowSelection */
|
93
|
+
getRowSelection?: (rowSelection: rowSelectionType) => void;
|
94
|
+
/** 表格底部(左侧)配置 */
|
95
|
+
footerAction?: ActionGroupProps | React.ReactNode;
|
96
|
+
/** 筛选区自动搜索的防抖时间(毫秒) */
|
97
|
+
filterDebounce?: number;
|
98
|
+
/** ProTable action 的引用,便于手动触发一些方法 */
|
99
|
+
actionRef?: React.MutableRefObject<ProTableActionType | undefined>;
|
100
|
+
/** 是否首次加载渲染骨架屏 */
|
101
|
+
showSkeleton?: boolean;
|
102
|
+
/** 渲染骨架屏条数 */
|
103
|
+
skeletonSize?: number;
|
104
|
+
/** 表格主题 className */
|
105
|
+
tableClassName?: string;
|
106
|
+
/** 非全屏模式下是否吸底 默认状态下取用 ProPageContainer 作为参照物。如果传入了Dom,则取用Dom作为参照物 */
|
107
|
+
footerSuction?: boolean | Element;
|
108
|
+
} & Omit<TableProps, 'columns'> & ProTableTopAreaProps;
|
109
|
+
export declare type rowSelectionType = {
|
110
|
+
getProps?: (record: any, index: number) => any;
|
111
|
+
onChange?: (selectedRowKeys: Array<any>, records: Array<any>) => void;
|
112
|
+
onSelect?: (selected: boolean, record: any, records: Array<any>) => void;
|
113
|
+
onSelectAll?: (selected: boolean, records: Array<any>) => void;
|
114
|
+
selectedRowKeys?: Array<any>;
|
115
|
+
mode?: 'single' | 'multiple';
|
116
|
+
titleProps?: () => any;
|
117
|
+
columnProps?: () => any;
|
118
|
+
titleAddons?: () => any;
|
119
|
+
};
|
120
|
+
export declare type innerRowSelectionType = {
|
121
|
+
rowSelection: rowSelectionType;
|
122
|
+
selectedRowKeys: string[];
|
123
|
+
setSelectedRowKeys: (selectedRowKeys: string[]) => void;
|
124
|
+
selectedRecords: any[];
|
125
|
+
setSelectedRecords: (selectedRecords: any[]) => void;
|
126
|
+
};
|
127
|
+
export declare type ProTableActionType = {
|
128
|
+
/** 全屏展示 */
|
129
|
+
fullScreen?: () => boolean;
|
130
|
+
/** 设置显示列 */
|
131
|
+
setColumn?: (newColumns: ProColumnProps[]) => void;
|
132
|
+
/** 设置表格大小 */
|
133
|
+
setSize?: (mode: 'small' | 'medium') => void;
|
134
|
+
/** 刷新表格 */
|
135
|
+
refresh?: (params?: any) => void;
|
136
|
+
/*** 表格内部请求方法 */
|
137
|
+
request?: (params?: any) => void;
|
138
|
+
/** 重置表格 */
|
139
|
+
reset?: () => void;
|
140
|
+
/** 清空表格选择 */
|
141
|
+
clearRowSelection?: () => void;
|
142
|
+
/** 过滤 DataSource */
|
143
|
+
filterDataSource?: (dataIndex: string) => void;
|
144
|
+
/** 翻页器当前信息 */
|
145
|
+
pageInfo?: {
|
146
|
+
/** 总数 */
|
147
|
+
total?: number;
|
148
|
+
/** 当前页 */
|
149
|
+
current?: number;
|
150
|
+
/** 每页数据量 */
|
151
|
+
pageSize?: number;
|
152
|
+
};
|
153
|
+
} & ProTableActionTypeMutations;
|
154
|
+
/** action State 定义 */
|
155
|
+
export declare type ProTableActionTypeMutations = {
|
156
|
+
/** 获取state状态 */
|
157
|
+
getState?: () => ProTableActionTypeState;
|
158
|
+
/** 设置全屏状态 */
|
159
|
+
setFullScreenState?: (state: boolean) => void;
|
160
|
+
/** 绑定state监听事件 */
|
161
|
+
on?: (...args: any) => void;
|
162
|
+
/** 销毁监听事件 */
|
163
|
+
off?: (...args: any) => void;
|
164
|
+
/** 设置 列 过滤规则 */
|
165
|
+
setFilterRules?: (rules: ProTableColumnsFilterRulesItem) => void;
|
166
|
+
/** 重新计算表格maxHeight高度 */
|
167
|
+
resetTableMaxBodyHeight?: () => void;
|
168
|
+
};
|
169
|
+
/** action Mutations 定义 */
|
170
|
+
export declare type ProTableActionTypeState = {
|
171
|
+
fullScreenState: boolean;
|
172
|
+
filterRules: ProTableColumnsFilterRulesItem;
|
173
|
+
};
|
174
|
+
export declare type dataFilterProps = {
|
175
|
+
/** 展示形式 */
|
176
|
+
mode?: 'inline' | 'panel';
|
177
|
+
/** mode='panel' 时是否默认展开 */
|
178
|
+
expand?: boolean;
|
179
|
+
} & IFilterProps;
|
180
|
+
export declare type ProTableTopAreaProps = {
|
181
|
+
/** 标题区 */
|
182
|
+
header?: ProTableHeaderProps;
|
183
|
+
/** 主操作区 */
|
184
|
+
mainAction?: ActionGroupProps | React.ReactNode;
|
185
|
+
/** 工具栏区 */
|
186
|
+
toolBar?: boolean | toolBarItem[];
|
187
|
+
/** 快捷操作区 */
|
188
|
+
quickAction?: IActionButton | React.ReactNode | React.ReactNode[];
|
189
|
+
/** 数据过滤区 */
|
190
|
+
dataFilter?: dataFilterProps;
|
191
|
+
/** 数据过滤区 form 表单模型 */
|
192
|
+
dataFilterForm?: FormType;
|
193
|
+
};
|
194
|
+
/** 单个工具栏 */
|
195
|
+
declare type toolBarItem = React.ReactNode | 'refresh' | 'density' | 'filterColumn' | 'fullscreen';
|
196
|
+
export declare type ProTableLayoutProps = {
|
197
|
+
actionRef: React.MutableRefObject<ProTableActionType | undefined>;
|
198
|
+
columns?: ProColumnProps[];
|
199
|
+
rowSelection?: innerRowSelectionType | rowSelectionType;
|
200
|
+
} & ProTableTopAreaProps;
|
201
|
+
/** columns 列过滤 */
|
202
|
+
export declare type ProTableColumnsFilterItemProps = {
|
203
|
+
/** 绑定值 */
|
204
|
+
value?: string | boolean | number;
|
205
|
+
/** 显示值 */
|
206
|
+
label?: React.ReactNode;
|
207
|
+
};
|
208
|
+
/** columns 列过滤规则 item (action ref state用) */
|
209
|
+
export declare type ProTableColumnsFilterRulesItem = {
|
210
|
+
[key: string]: {
|
211
|
+
/** 原始规则 */
|
212
|
+
rules: string[];
|
213
|
+
/** 处理过后的作为params的规则 */
|
214
|
+
params: string;
|
215
|
+
};
|
216
|
+
};
|
217
|
+
/** 非全屏模式下的吸底 useState类型定义 */
|
218
|
+
export declare type parentPositionProps = {
|
219
|
+
offsetLeft: number;
|
220
|
+
offsetRight: number;
|
221
|
+
};
|
222
|
+
export {};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/**
|
2
|
+
* 渲染列的逻辑函数
|
3
|
+
*/
|
4
|
+
import React from 'react';
|
5
|
+
import { ProColumnProps, ProTableActionType } from '../typing';
|
6
|
+
/**
|
7
|
+
* 增加了 icon 的功能 render title
|
8
|
+
*/
|
9
|
+
export declare const renderColumnsTitle: (item: ProColumnProps, actionRef: React.MutableRefObject<ProTableActionType | undefined>) => JSX.Element;
|
10
|
+
/**
|
11
|
+
* 负责单元格的具体渲染
|
12
|
+
*/
|
13
|
+
export declare const renderCell: (value: any, item: ProColumnProps, index: number, record: any, actionRef: React.MutableRefObject<ProTableActionType | undefined>) => JSX.Element;
|
@@ -0,0 +1,201 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.renderColumnsTitle = exports.renderCell = void 0;
|
7
|
+
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
9
|
+
|
10
|
+
var _utils = require("@teamix/utils");
|
11
|
+
|
12
|
+
var _actions = require("../../actions");
|
13
|
+
|
14
|
+
var _field = _interopRequireDefault(require("../../field"));
|
15
|
+
|
16
|
+
var _Filter = _interopRequireDefault(require("../components/Filter"));
|
17
|
+
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
|
+
|
20
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
21
|
+
|
22
|
+
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."); }
|
23
|
+
|
24
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
25
|
+
|
26
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
27
|
+
|
28
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
29
|
+
|
30
|
+
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."); }
|
31
|
+
|
32
|
+
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); }
|
33
|
+
|
34
|
+
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; }
|
35
|
+
|
36
|
+
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; }
|
37
|
+
|
38
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
39
|
+
|
40
|
+
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; }
|
41
|
+
|
42
|
+
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; }
|
43
|
+
|
44
|
+
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; }
|
45
|
+
|
46
|
+
/**
|
47
|
+
* 增加了 icon 的功能 render title
|
48
|
+
*/
|
49
|
+
var renderColumnsTitle = function renderColumnsTitle(item, actionRef) {
|
50
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_utils.LabelIconTip, {
|
51
|
+
label: item.title,
|
52
|
+
tooltip: item.tooltip,
|
53
|
+
icon: item.tooltipIcon
|
54
|
+
}), item.filters && /*#__PURE__*/_react.default.createElement(_Filter.default, {
|
55
|
+
column: item,
|
56
|
+
actionRef: actionRef
|
57
|
+
}));
|
58
|
+
};
|
59
|
+
/**
|
60
|
+
* 负责单元格的具体渲染
|
61
|
+
*/
|
62
|
+
|
63
|
+
|
64
|
+
exports.renderColumnsTitle = renderColumnsTitle;
|
65
|
+
|
66
|
+
var renderCell = function renderCell(value, item, index, record, actionRef) {
|
67
|
+
var _actionSchema$actions;
|
68
|
+
|
69
|
+
var _item$valueType = item.valueType,
|
70
|
+
valueType = _item$valueType === void 0 ? 'text' : _item$valueType,
|
71
|
+
render = item.render,
|
72
|
+
actionSchema = item.actionSchema,
|
73
|
+
dataIndex = item.dataIndex; // 如果没传 dataIndex,返回 null
|
74
|
+
|
75
|
+
if (!dataIndex) {
|
76
|
+
value = null;
|
77
|
+
} // 处理 dataIndex 为数组的情况
|
78
|
+
|
79
|
+
|
80
|
+
if (Array.isArray(dataIndex)) {
|
81
|
+
value = dataIndex.map(function (item) {
|
82
|
+
return (0, _utils.getTargetValue)("{{".concat(item, "}}"), _objectSpread(_objectSpread({}, record), {}, {
|
83
|
+
record: record
|
84
|
+
}));
|
85
|
+
});
|
86
|
+
}
|
87
|
+
|
88
|
+
var newRender = null; // 如果 render 直接传函数
|
89
|
+
|
90
|
+
if (typeof render === 'function') {
|
91
|
+
newRender = function newRender() {
|
92
|
+
return render === null || render === void 0 ? void 0 : render(value, index, record);
|
93
|
+
};
|
94
|
+
} else {
|
95
|
+
newRender = processBuriedPoint(processRenderFunction(render, value, index, record), record, value, index);
|
96
|
+
} // 渲染操作组
|
97
|
+
|
98
|
+
|
99
|
+
if (actionSchema && ((_actionSchema$actions = actionSchema.actions) === null || _actionSchema$actions === void 0 ? void 0 : _actionSchema$actions.length)) {
|
100
|
+
// 默认 context
|
101
|
+
var defaultContext = {
|
102
|
+
value: value,
|
103
|
+
index: index,
|
104
|
+
record: record,
|
105
|
+
action: actionRef.current
|
106
|
+
};
|
107
|
+
return /*#__PURE__*/_react.default.createElement(_actions.ActionGroup, _objectSpread(_objectSpread({
|
108
|
+
type: "text"
|
109
|
+
}, actionSchema), {}, {
|
110
|
+
context: _objectSpread(_objectSpread({}, defaultContext), actionSchema.context)
|
111
|
+
}));
|
112
|
+
} // 渲染 ProField
|
113
|
+
|
114
|
+
|
115
|
+
if (render) {
|
116
|
+
return /*#__PURE__*/_react.default.createElement(_field.default, {
|
117
|
+
type: valueType,
|
118
|
+
value: value,
|
119
|
+
render: newRender,
|
120
|
+
dataSource: item.dataSource
|
121
|
+
});
|
122
|
+
}
|
123
|
+
|
124
|
+
return /*#__PURE__*/_react.default.createElement(_field.default, {
|
125
|
+
type: valueType || 'text',
|
126
|
+
value: value,
|
127
|
+
// 默认 ellipsis、descriptionEllipsis 为 true
|
128
|
+
render: {
|
129
|
+
ellipsis: true,
|
130
|
+
descriptionEllipsis: true
|
131
|
+
}
|
132
|
+
});
|
133
|
+
};
|
134
|
+
/**
|
135
|
+
* 处理 render 配置项是函数的情况
|
136
|
+
* @param render ProFieldRender
|
137
|
+
* @param value table cell value
|
138
|
+
* @param index table cell index
|
139
|
+
* @param record table cell record
|
140
|
+
* @returns
|
141
|
+
*/
|
142
|
+
|
143
|
+
|
144
|
+
exports.renderCell = renderCell;
|
145
|
+
|
146
|
+
var processRenderFunction = function processRenderFunction() {
|
147
|
+
var render = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
148
|
+
var value = arguments.length > 1 ? arguments[1] : undefined;
|
149
|
+
var index = arguments.length > 2 ? arguments[2] : undefined;
|
150
|
+
var record = arguments.length > 3 ? arguments[3] : undefined;
|
151
|
+
var external = ['linkOnClick', 'link', 'value'];
|
152
|
+
return Object.fromEntries(Object.entries(render).map(function (_ref) {
|
153
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
154
|
+
k = _ref2[0],
|
155
|
+
v = _ref2[1];
|
156
|
+
|
157
|
+
if (typeof v === 'function') {
|
158
|
+
var _v;
|
159
|
+
|
160
|
+
if (external.includes(k)) {
|
161
|
+
return [k, function () {
|
162
|
+
for (var _len = arguments.length, others = new Array(_len), _key = 0; _key < _len; _key++) {
|
163
|
+
others[_key] = arguments[_key];
|
164
|
+
}
|
165
|
+
|
166
|
+
return v === null || v === void 0 ? void 0 : v.apply(void 0, [value, index, record].concat(others));
|
167
|
+
}];
|
168
|
+
}
|
169
|
+
|
170
|
+
return [k, (_v = v === null || v === void 0 ? void 0 : v(value, index, record)) !== null && _v !== void 0 ? _v : ''];
|
171
|
+
}
|
172
|
+
|
173
|
+
return [k, v];
|
174
|
+
}));
|
175
|
+
};
|
176
|
+
/**
|
177
|
+
* 处理 render 数据,取出 {{xxx}} 匹配值
|
178
|
+
* @param render ProFieldRender
|
179
|
+
* @param record table cell record
|
180
|
+
* @returns
|
181
|
+
*/
|
182
|
+
|
183
|
+
|
184
|
+
var processBuriedPoint = function processBuriedPoint() {
|
185
|
+
var render = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
186
|
+
var record = arguments.length > 1 ? arguments[1] : undefined;
|
187
|
+
var value = arguments.length > 2 ? arguments[2] : undefined;
|
188
|
+
var index = arguments.length > 3 ? arguments[3] : undefined;
|
189
|
+
return Object.fromEntries([// 默认 ellipsis、descriptionEllipsis 为 true
|
190
|
+
['ellipsis', true], ['descriptionEllipsis', true]].concat(_toConsumableArray(Object.entries(render).map(function (_ref3) {
|
191
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
192
|
+
k = _ref4[0],
|
193
|
+
v = _ref4[1];
|
194
|
+
|
195
|
+
return [k, (0, _utils.getTargetValue)(v, _objectSpread(_objectSpread({}, record), {}, {
|
196
|
+
record: record,
|
197
|
+
value: value,
|
198
|
+
index: index
|
199
|
+
}))];
|
200
|
+
}))));
|
201
|
+
};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ProColumnProps, ProTableActionType } from '../typing';
|
3
|
+
import { ColumnProps } from '@alicloudfe/components/types/table';
|
4
|
+
/**
|
5
|
+
* ProColumn => Column
|
6
|
+
*/
|
7
|
+
export default function genProColumnToColumn(columns: ProColumnProps[],
|
8
|
+
/** 是否渲染骨架屏 */
|
9
|
+
showSkeleton: boolean, actionRef: React.MutableRefObject<ProTableActionType | undefined>): ColumnProps[];
|
@@ -0,0 +1,62 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = genProColumnToColumn;
|
7
|
+
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
9
|
+
|
10
|
+
var _columnRender = require("./columnRender");
|
11
|
+
|
12
|
+
var _skeleton = require("../../skeleton");
|
13
|
+
|
14
|
+
var _excluded = ["filters", "dataIndex"];
|
15
|
+
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
|
+
|
18
|
+
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; }
|
19
|
+
|
20
|
+
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; }
|
21
|
+
|
22
|
+
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; }
|
23
|
+
|
24
|
+
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; }
|
25
|
+
|
26
|
+
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; }
|
27
|
+
|
28
|
+
/**
|
29
|
+
* ProColumn => Column
|
30
|
+
*/
|
31
|
+
function genProColumnToColumn(columns,
|
32
|
+
/** 是否渲染骨架屏 */
|
33
|
+
showSkeleton, actionRef) {
|
34
|
+
return columns.map(function (columnProps) {
|
35
|
+
var filters = columnProps.filters,
|
36
|
+
dataIndex = columnProps.dataIndex,
|
37
|
+
others = _objectWithoutProperties(columnProps, _excluded);
|
38
|
+
|
39
|
+
if (showSkeleton) {
|
40
|
+
return _objectSpread(_objectSpread({}, others), {}, {
|
41
|
+
filters: undefined,
|
42
|
+
sortable: false,
|
43
|
+
dataIndex: dataIndex === null || dataIndex === void 0 ? void 0 : dataIndex.toString(),
|
44
|
+
title: /*#__PURE__*/_react.default.createElement(_skeleton.BaseSkeleton.Table.TH, null),
|
45
|
+
cell: function cell() {
|
46
|
+
return /*#__PURE__*/_react.default.createElement(_skeleton.BaseSkeleton.Table.TD, null);
|
47
|
+
}
|
48
|
+
});
|
49
|
+
}
|
50
|
+
|
51
|
+
return _objectSpread(_objectSpread({
|
52
|
+
// 金钱样式默认右对齐
|
53
|
+
align: columnProps.valueType === 'money' ? 'right' : 'left'
|
54
|
+
}, others), {}, {
|
55
|
+
dataIndex: dataIndex === null || dataIndex === void 0 ? void 0 : dataIndex.toString(),
|
56
|
+
title: (0, _columnRender.renderColumnsTitle)(columnProps, actionRef),
|
57
|
+
cell: function cell(value, index, record) {
|
58
|
+
return (0, _columnRender.renderCell)(value, columnProps, index, record, actionRef);
|
59
|
+
}
|
60
|
+
});
|
61
|
+
});
|
62
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
// 返回 Table 属性列表
|
9
|
+
var _default = function _default() {
|
10
|
+
return ['stickyHeader', 'offsetTop', 'affixProps', 'components', 'useVirtual', 'rowHeight', 'maxBodyHeight', 'primaryKey', 'dataSource', 'onBodyScroll', 'openRowKeys', 'defaultOpenRowKeys', 'onRowOpen', 'indent', 'isTree', 'locale', 'expandedRowRender', 'rowExpandable', 'expandedRowIndent', 'hasExpandedRowCtrl', 'getExpandedColProps', 'onExpandedRowClick', 'rowSelection', 'entireDataSource', 'scrollToCol', 'scrollToRow', 'hasHeader', 'fixedHeader', 'prefix', 'defaultPropsConfig', 'errorBoundary', 'pure', 'warning', 'rtl', 'device', 'children', 'popupContainer', 'tableLayout', 'tableWidth', 'style', 'size', 'onRowClick', 'onRowMouseEnter', 'onRowMouseLeave', 'onSort', 'onFilter', 'onResizeChange', 'rowProps', 'cellProps', 'hasBorder', 'isZebra', 'loading', 'loadingComponent', 'filterParams', 'sort', 'sortIcons', 'columns', 'emptyContent', 'lockType', 'wrapperContent', 'refs', 'expandedIndexSimulate', 'crossline', 'lengths'];
|
11
|
+
};
|
12
|
+
|
13
|
+
exports.default = _default;
|
@@ -0,0 +1,34 @@
|
|
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 _icon = _interopRequireDefault(require("@teamix/icon"));
|
11
|
+
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
+
|
14
|
+
/** 返回自定义 sortIcons */
|
15
|
+
var _default = function _default() {
|
16
|
+
return {
|
17
|
+
asc: /*#__PURE__*/_react.default.createElement(_icon.default, {
|
18
|
+
type: "swap-up-line",
|
19
|
+
size: "small",
|
20
|
+
style: {
|
21
|
+
left: 4
|
22
|
+
}
|
23
|
+
}),
|
24
|
+
desc: /*#__PURE__*/_react.default.createElement(_icon.default, {
|
25
|
+
type: "swap-down-line",
|
26
|
+
size: "small",
|
27
|
+
style: {
|
28
|
+
left: -4
|
29
|
+
}
|
30
|
+
})
|
31
|
+
};
|
32
|
+
};
|
33
|
+
|
34
|
+
exports.default = _default;
|