@lemon-fe/kits 0.1.136 → 1.0.0-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/README.md +27 -5
- package/es/app.d.ts +1 -0
- package/es/app.js +3 -0
- package/es/components/Actions/index.d.ts +26 -0
- package/es/components/Actions/index.js +169 -0
- package/es/components/Actions/index.less +67 -0
- package/es/components/BaseTable/Actions.d.ts +9 -0
- package/es/components/BaseTable/Actions.js +136 -0
- package/es/components/BaseTable/BaseTableContext.d.ts +7 -0
- package/es/components/BaseTable/BaseTableContext.js +7 -0
- package/es/components/BaseTable/ResizeHeaderCell.d.ts +8 -0
- package/es/components/BaseTable/ResizeHeaderCell.js +130 -0
- package/es/components/BaseTable/VirtualBody.d.ts +8 -0
- package/es/components/BaseTable/VirtualBody.js +163 -0
- package/es/components/BaseTable/empty.png +0 -0
- package/es/components/BaseTable/index.d.ts +9 -0
- package/es/components/BaseTable/index.js +482 -0
- package/es/components/BaseTable/index.less +189 -0
- package/es/components/BaseTable/typings.d.ts +48 -0
- package/es/components/BaseTable/utils.d.ts +4 -0
- package/es/components/BaseTable/utils.js +26 -0
- package/es/components/ColorPicker/index.d.ts +13 -0
- package/es/components/ColorPicker/index.js +114 -0
- package/es/components/ColorPicker/index.less +47 -0
- package/es/components/DataGrid/Actions.d.ts +9 -0
- package/es/components/DataGrid/Actions.js +119 -0
- package/es/components/DataGrid/CellRenderer.d.ts +4 -0
- package/es/components/DataGrid/CellRenderer.js +68 -0
- package/es/components/DataGrid/GridContext.d.ts +4 -0
- package/es/components/DataGrid/GridContext.js +4 -0
- package/es/components/DataGrid/HeaderRenderer.d.ts +6 -0
- package/es/components/DataGrid/HeaderRenderer.js +93 -0
- package/es/components/DataGrid/cell-editors/Custom.d.ts +9 -0
- package/es/components/DataGrid/cell-editors/Custom.js +105 -0
- package/es/components/DataGrid/cell-editors/Date.d.ts +8 -0
- package/es/components/DataGrid/cell-editors/Date.js +78 -0
- package/es/components/DataGrid/cell-editors/Number.d.ts +9 -0
- package/es/components/DataGrid/cell-editors/Number.js +86 -0
- package/es/components/DataGrid/cell-editors/Select.d.ts +7 -0
- package/es/components/DataGrid/cell-editors/Select.js +70 -0
- package/es/components/DataGrid/cell-editors/Text.d.ts +5 -0
- package/es/components/DataGrid/cell-editors/Text.js +60 -0
- package/es/components/DataGrid/cell-editors/Wrapper.d.ts +4 -0
- package/es/components/DataGrid/cell-editors/Wrapper.js +7 -0
- package/es/components/DataGrid/cell-editors/utils.d.ts +1 -0
- package/es/components/DataGrid/cell-editors/utils.js +2 -0
- package/es/components/DataGrid/empty.png +0 -0
- package/es/components/DataGrid/hooks.d.ts +2 -0
- package/es/components/DataGrid/hooks.js +45 -0
- package/es/components/DataGrid/index.d.ts +77 -0
- package/es/components/DataGrid/index.js +1051 -0
- package/es/components/DataGrid/index.less +304 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/clientSideNodeManager.d.ts +57 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/clientSideNodeManager.js +378 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/clientSideRowModel.d.ts +120 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/clientSideRowModel.js +1160 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/filterService.d.ts +7 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/filterService.js +137 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/filterStage.d.ts +5 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/filterStage.js +60 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/flattenStage.d.ts +10 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/flattenStage.js +199 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/immutableService.d.ts +13 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/immutableService.js +175 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/sortService.d.ts +21 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/sortService.js +330 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/sortStage.d.ts +7 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/sortStage.js +75 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModelModule.d.ts +15 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModelModule.js +15 -0
- package/es/components/DataGrid/modules/client-side-row-model/index.d.ts +1 -0
- package/es/components/DataGrid/modules/client-side-row-model/index.js +1 -0
- package/es/components/DataGrid/modules/clipboard/clipboard/clipboardService.d.ts +62 -0
- package/es/components/DataGrid/modules/clipboard/clipboard/clipboardService.js +923 -0
- package/es/components/DataGrid/modules/clipboard/clipboardModule.d.ts +7 -0
- package/es/components/DataGrid/modules/clipboard/clipboardModule.js +8 -0
- package/es/components/DataGrid/modules/clipboard/index.d.ts +1 -0
- package/es/components/DataGrid/modules/clipboard/index.js +1 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/columnModelItem.d.ts +32 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/columnModelItem.js +100 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/columnToolPanel.d.ts +51 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/columnToolPanel.js +320 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/modelItemUtils.d.ts +20 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/modelItemUtils.js +247 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/pivotModePanel.d.ts +9 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/pivotModePanel.js +93 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsHeaderPanel.d.ts +32 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsHeaderPanel.js +186 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsListPanel.d.ts +49 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsListPanel.js +546 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsListPanelItemDragFeature.d.ts +26 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsListPanelItemDragFeature.js +264 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsPanel.d.ts +32 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsPanel.js +151 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/toolPanelColumnComp.d.ts +43 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/toolPanelColumnComp.js +369 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/toolPanelColumnGroupComp.d.ts +62 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/toolPanelColumnGroupComp.js +475 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/toolPanelContextMenu.d.ts +24 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/toolPanelContextMenu.js +322 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnsToolPanelModule.d.ts +24 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnsToolPanelModule.js +24 -0
- package/es/components/DataGrid/modules/column-tool-panel/index.d.ts +2 -0
- package/es/components/DataGrid/modules/column-tool-panel/index.js +3 -0
- package/es/components/DataGrid/modules/menu/index.d.ts +1 -0
- package/es/components/DataGrid/modules/menu/index.js +1 -0
- package/es/components/DataGrid/modules/menu/menu/contextMenu.d.ts +26 -0
- package/es/components/DataGrid/modules/menu/menu/contextMenu.js +329 -0
- package/es/components/DataGrid/modules/menu/menu/enterpriseMenu.d.ts +85 -0
- package/es/components/DataGrid/modules/menu/menu/enterpriseMenu.js +639 -0
- package/es/components/DataGrid/modules/menu/menu/menuItemMapper.d.ts +15 -0
- package/es/components/DataGrid/modules/menu/menu/menuItemMapper.js +565 -0
- package/es/components/DataGrid/modules/menu/menuModule.d.ts +8 -0
- package/es/components/DataGrid/modules/menu/menuModule.js +8 -0
- package/es/components/DataGrid/modules/row-grouping/index.d.ts +4 -0
- package/es/components/DataGrid/modules/row-grouping/index.js +4 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/aggFuncService.d.ts +23 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/aggFuncService.js +303 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/aggregationStage.d.ts +20 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/aggregationStage.js +326 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/batchRemover.d.ts +10 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/batchRemover.js +71 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/baseDropZonePanel.d.ts +75 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/baseDropZonePanel.js +618 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/dropZoneColumnComp.d.ts +40 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/dropZoneColumnComp.js +460 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/gridHeaderDropZones.d.ts +11 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/gridHeaderDropZones.js +108 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/pivotDropZonePanel.d.ts +17 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/pivotDropZonePanel.js +170 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/rowGroupDropZonePanel.d.ts +15 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/rowGroupDropZonePanel.js +133 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/valueDropZonePanel.d.ts +15 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/valueDropZonePanel.js +133 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/filterAggregatesStage.d.ts +9 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/filterAggregatesStage.js +175 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/groupStage.d.ts +47 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/groupStage.js +814 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/pivotColDefService.d.ts +24 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/pivotColDefService.js +478 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/pivotStage.d.ts +19 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/pivotStage.js +219 -0
- package/es/components/DataGrid/modules/row-grouping/rowGroupingModule.d.ts +16 -0
- package/es/components/DataGrid/modules/row-grouping/rowGroupingModule.js +16 -0
- package/es/components/DataGrid/modules/server-side-row-model/index.d.ts +1 -0
- package/es/components/DataGrid/modules/server-side-row-model/index.js +1 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/blocks/blockUtils.d.ts +47 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/blocks/blockUtils.js +444 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/blocks/infiniteStoreBlock.d.ts +92 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/blocks/infiniteStoreBlock.js +510 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/expandListener.d.ts +9 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/expandListener.js +115 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/filterListener.d.ts +9 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/filterListener.js +114 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/listenerUtils.d.ts +5 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/listenerUtils.js +68 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/sortListener.d.ts +13 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/sortListener.js +194 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/nodeManager.d.ts +7 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/nodeManager.js +63 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/serverSideRowModel.d.ts +88 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/serverSideRowModel.js +572 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/fullStore.d.ts +108 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/fullStore.js +876 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/infiniteStore.d.ts +102 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/infiniteStore.js +918 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/storeFactory.d.ts +12 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/storeFactory.js +141 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/storeUtils.d.ts +35 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/storeUtils.js +154 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/transactionManager.d.ts +23 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/transactionManager.js +210 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModelModule.d.ts +18 -0
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModelModule.js +18 -0
- package/es/components/DataGrid/modules/side-bar/index.d.ts +2 -0
- package/es/components/DataGrid/modules/side-bar/index.js +2 -0
- package/es/components/DataGrid/modules/side-bar/sideBar/common/toolPanelColDefService.d.ts +11 -0
- package/es/components/DataGrid/modules/side-bar/sideBar/common/toolPanelColDefService.js +280 -0
- package/es/components/DataGrid/modules/side-bar/sideBar/horizontalResizeComp.d.ts +19 -0
- package/es/components/DataGrid/modules/side-bar/sideBar/horizontalResizeComp.js +132 -0
- package/es/components/DataGrid/modules/side-bar/sideBar/sideBarButtonComp.d.ts +16 -0
- package/es/components/DataGrid/modules/side-bar/sideBar/sideBarButtonComp.js +108 -0
- package/es/components/DataGrid/modules/side-bar/sideBar/sideBarButtonsComp.d.ts +18 -0
- package/es/components/DataGrid/modules/side-bar/sideBar/sideBarButtonsComp.js +115 -0
- package/es/components/DataGrid/modules/side-bar/sideBar/sideBarComp.d.ts +29 -0
- package/es/components/DataGrid/modules/side-bar/sideBar/sideBarComp.js +353 -0
- package/es/components/DataGrid/modules/side-bar/sideBar/toolPanelWrapper.d.ts +17 -0
- package/es/components/DataGrid/modules/side-bar/sideBar/toolPanelWrapper.js +128 -0
- package/es/components/DataGrid/modules/side-bar/sideBarModule.d.ts +19 -0
- package/es/components/DataGrid/modules/side-bar/sideBarModule.js +19 -0
- package/es/components/DataGrid/typings.d.ts +138 -0
- package/es/components/DataGrid/typings.js +1 -0
- package/es/components/DataGrid/utils.d.ts +43 -0
- package/es/components/DataGrid/utils.js +242 -0
- package/es/components/Dropdown/index.d.ts +15 -0
- package/es/components/Dropdown/index.js +55 -0
- package/es/components/Dropdown/index.less +13 -0
- package/es/components/DurationPicker/index.d.ts +26 -0
- package/es/components/DurationPicker/index.js +204 -0
- package/es/components/DurationPicker/index.less +61 -0
- package/es/components/EditableTable/EditableCell.d.ts +12 -0
- package/es/components/EditableTable/EditableCell.js +41 -0
- package/es/components/EditableTable/EditableTableFormItem.d.ts +6 -0
- package/es/components/EditableTable/EditableTableFormItem.js +47 -0
- package/es/components/EditableTable/Table.d.ts +6 -0
- package/es/components/EditableTable/Table.js +362 -0
- package/es/components/EditableTable/index.d.ts +9 -0
- package/es/components/EditableTable/index.js +8 -0
- package/es/components/EditableTable/index.less +29 -0
- package/es/components/EditableTable/typings.d.ts +90 -0
- package/es/components/EditableTable/util.d.ts +25 -0
- package/es/components/EditableTable/util.js +399 -0
- package/es/components/Filter/index.d.ts +15 -0
- package/es/components/Filter/index.js +644 -0
- package/es/components/Filter/index.less +82 -0
- package/es/components/Filter/typings.d.ts +35 -0
- package/es/components/FormLayout/index.d.ts +32 -0
- package/es/components/FormLayout/index.js +41 -0
- package/es/components/FormLayout/index.less +109 -0
- package/es/components/Icons/BigTip/error.png +0 -0
- package/es/components/Icons/BigTip/index.d.ts +6 -0
- package/es/components/Icons/BigTip/index.js +46 -0
- package/es/components/Icons/BigTip/info.png +0 -0
- package/es/components/Icons/BigTip/success.png +0 -0
- package/es/components/Icons/BigTip/warning.png +0 -0
- package/es/components/Icons/Calendar.d.ts +5 -0
- package/es/components/Icons/Calendar.js +43 -0
- package/es/components/Icons/Close.d.ts +5 -0
- package/es/components/Icons/Close.js +25 -0
- package/es/components/Icons/CollapseUp.d.ts +5 -0
- package/es/components/Icons/CollapseUp.js +27 -0
- package/es/components/Icons/DarkSearch.d.ts +5 -0
- package/es/components/Icons/DarkSearch.js +34 -0
- package/es/components/Icons/Down.d.ts +5 -0
- package/es/components/Icons/Down.js +31 -0
- package/es/components/Icons/Empty.d.ts +3 -0
- package/es/components/Icons/Empty.js +267 -0
- package/es/components/Icons/LookUp.d.ts +5 -0
- package/es/components/Icons/LookUp.js +70 -0
- package/es/components/Icons/More.d.ts +5 -0
- package/es/components/Icons/More.js +40 -0
- package/es/components/Icons/Search.d.ts +5 -0
- package/es/components/Icons/Search.js +31 -0
- package/es/components/Icons/Tip.d.ts +6 -0
- package/es/components/Icons/Tip.js +165 -0
- package/es/components/Icons/index.d.ts +25 -0
- package/es/components/Icons/index.js +25 -0
- package/es/components/Layout/index.d.ts +41 -0
- package/es/components/Layout/index.js +173 -0
- package/es/components/Layout/index.less +136 -0
- package/es/components/PageLoading/index.d.ts +5 -0
- package/es/components/PageLoading/index.js +15 -0
- package/es/components/PageLoading/index.less +8 -0
- package/es/components/Popup/index.d.ts +39 -0
- package/es/components/Popup/index.js +223 -0
- package/es/components/Popup/index.less +12 -0
- package/es/components/Portal/index.d.ts +17 -0
- package/es/components/Portal/index.js +141 -0
- package/es/components/Section/TabBar.d.ts +12 -0
- package/es/components/Section/TabBar.js +51 -0
- package/es/components/Section/index.d.ts +54 -0
- package/es/components/Section/index.js +96 -0
- package/es/components/Section/index.less +130 -0
- package/es/components/SelectView/index.d.ts +47 -0
- package/es/components/SelectView/index.js +244 -0
- package/es/components/SelectView/index.less +60 -0
- package/es/components/SiderTree/TreeNodeTitle.d.ts +9 -0
- package/es/components/SiderTree/TreeNodeTitle.js +107 -0
- package/es/components/SiderTree/empty.png +0 -0
- package/es/components/SiderTree/index.d.ts +37 -0
- package/es/components/SiderTree/index.js +217 -0
- package/es/components/SiderTree/index.less +222 -0
- package/es/components/SiderTree/typings.d.ts +19 -0
- package/es/components/SymbolIcon/index.d.ts +8 -0
- package/es/components/SymbolIcon/index.js +32 -0
- package/es/components/SymbolIcon/index.less +7 -0
- package/es/components/TabBar/index.d.ts +14 -0
- package/es/components/TabBar/index.js +52 -0
- package/es/components/TabBar/index.less +31 -0
- package/es/components/Table/index.d.ts +3 -0
- package/es/components/Table/index.js +242 -0
- package/es/components/Table/typings.d.ts +25 -0
- package/es/components/Table/utils.d.ts +2 -0
- package/es/components/Table/utils.js +3 -0
- package/es/components/utils.d.ts +3 -0
- package/es/components/utils.js +20 -0
- package/es/constants.d.ts +1 -0
- package/es/constants.js +1 -0
- package/es/{useBatchOperator → hooks/useBatchOperator}/index.d.ts +2 -2
- package/es/{useBatchOperator → hooks/useBatchOperator}/index.js +120 -57
- package/es/{usePageTrack → hooks/usePageTrack}/index.d.ts +0 -0
- package/es/{usePageTrack → hooks/usePageTrack}/index.js +0 -0
- package/es/index.d.ts +33 -6
- package/es/index.js +30 -6
- package/es/index.less +25 -1
- package/es/init.d.ts +3 -0
- package/es/init.js +153 -0
- package/es/layouts/BasicLayout/components/Main.d.ts +10 -0
- package/es/layouts/BasicLayout/components/Main.js +390 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/DropMenu/index.d.ts +11 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/DropMenu/index.js +104 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/DropMenu/index.less +59 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/Menu/index.d.ts +10 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/Menu/index.js +667 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/Menu/index.less +445 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/RefreshButton/index.d.ts +6 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/RefreshButton/index.js +72 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/RefreshButton/index.less +30 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/TabBar/index.d.ts +10 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/TabBar/index.js +116 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/TabBar/index.less +155 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/WaterMark/index.d.ts +6 -0
- package/es/layouts/BasicLayout/components/MainFramework/components/WaterMark/index.js +70 -0
- package/es/layouts/BasicLayout/components/MainFramework/index.d.ts +28 -0
- package/es/layouts/BasicLayout/components/MainFramework/index.js +78 -0
- package/es/layouts/BasicLayout/components/MainFramework/index.less +97 -0
- package/es/layouts/BasicLayout/components/MainFramework/typings.d.ts +10 -0
- package/es/layouts/BasicLayout/index.d.ts +3 -0
- package/es/layouts/BasicLayout/index.js +98 -0
- package/es/layouts/BasicLayout/typings.d.ts +82 -0
- package/es/layouts/BlankLayout/index.d.ts +5 -0
- package/es/layouts/BlankLayout/index.js +5 -0
- package/es/layouts/Breadcrumb/index.d.ts +6 -0
- package/es/layouts/Breadcrumb/index.js +75 -0
- package/es/layouts/MicroLayout/index.d.ts +10 -0
- package/es/layouts/MicroLayout/index.js +105 -0
- package/es/layouts/MicroLayout/typings.d.ts +25 -0
- package/es/layouts/components/CachableRoute.d.ts +2 -0
- package/es/layouts/components/CachableRoute.js +38 -0
- package/es/layouts/components/RouteTab.d.ts +20 -0
- package/es/layouts/components/RouteTab.js +40 -0
- package/es/layouts/components/Switch.d.ts +2 -0
- package/es/layouts/components/Switch.js +63 -0
- package/es/layouts/index.d.ts +4 -0
- package/es/layouts/index.js +4 -0
- package/es/layouts/typings.d.ts +29 -0
- package/es/layouts/utils.d.ts +23 -0
- package/es/layouts/utils.js +175 -0
- package/es/styles/overrides.less +191 -0
- package/es/styles/theme.less +9 -0
- package/es/styles/utils.less +110 -0
- package/package.json +75 -22
- package/es/subject.d.ts +0 -12
- package/es/subject.js +0 -30
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
var _excluded = ["children"];
|
|
2
|
+
|
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
|
|
5
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
+
|
|
7
|
+
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."); }
|
|
8
|
+
|
|
9
|
+
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); }
|
|
10
|
+
|
|
11
|
+
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; }
|
|
12
|
+
|
|
13
|
+
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; }
|
|
14
|
+
|
|
15
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
+
|
|
17
|
+
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; }
|
|
18
|
+
|
|
19
|
+
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; }
|
|
20
|
+
|
|
21
|
+
import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
22
|
+
import { useThrottle } from '@lemon-fe/hooks';
|
|
23
|
+
import { get } from 'lodash';
|
|
24
|
+
import BaseTableContext from "./BaseTableContext";
|
|
25
|
+
import { PREFIX_CLS } from "../../constants";
|
|
26
|
+
export default function VirtualList(props) {
|
|
27
|
+
var children = props.children,
|
|
28
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
29
|
+
|
|
30
|
+
var ref = useRef(null);
|
|
31
|
+
|
|
32
|
+
var _useContext = useContext(BaseTableContext),
|
|
33
|
+
scrollY = _useContext.scrollY,
|
|
34
|
+
_useContext$rowHeight = _useContext.rowHeight,
|
|
35
|
+
rowHeight = _useContext$rowHeight === void 0 ? 37 : _useContext$rowHeight,
|
|
36
|
+
antPrefixCls = _useContext.antPrefixCls;
|
|
37
|
+
|
|
38
|
+
var _useState = useState(null),
|
|
39
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
40
|
+
range = _useState2[0],
|
|
41
|
+
setRange = _useState2[1];
|
|
42
|
+
|
|
43
|
+
var getRange = function getRange() {
|
|
44
|
+
var height = Number(scrollY);
|
|
45
|
+
|
|
46
|
+
if (isNaN(height)) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
var body = ref.current;
|
|
51
|
+
|
|
52
|
+
if (body === null) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
var scroller = body.closest(".".concat(antPrefixCls, "-body"));
|
|
57
|
+
|
|
58
|
+
if (scroller === null) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
var pageSize = Math.ceil(height / rowHeight);
|
|
63
|
+
var offset = Math.round(scroller.scrollTop / rowHeight);
|
|
64
|
+
var start = offset - Math.floor(pageSize / 2);
|
|
65
|
+
|
|
66
|
+
if (start < 0) {
|
|
67
|
+
start = 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
var end = offset + pageSize + Math.ceil(pageSize / 2) - 1;
|
|
71
|
+
var bufferSpace = height * 0.3;
|
|
72
|
+
return {
|
|
73
|
+
start: start,
|
|
74
|
+
end: end,
|
|
75
|
+
isTop: scroller.scrollTop - body.offsetTop <= bufferSpace,
|
|
76
|
+
isBottom: body.offsetHeight + body.offsetTop - (scroller.scrollTop + height) <= bufferSpace
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
var handleScroll = useThrottle(function () {
|
|
81
|
+
var mRange = getRange();
|
|
82
|
+
|
|
83
|
+
if (mRange === null) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
var isTop = mRange.isTop,
|
|
88
|
+
isBottom = mRange.isBottom;
|
|
89
|
+
|
|
90
|
+
if (!isTop && !isBottom) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
setRange(mRange);
|
|
95
|
+
}, 300, {
|
|
96
|
+
trailing: true
|
|
97
|
+
});
|
|
98
|
+
useEffect(function () {
|
|
99
|
+
setRange(getRange());
|
|
100
|
+
}, [get(children, ['1', 'length']), rowHeight, scrollY]);
|
|
101
|
+
var render = useMemo(function () {
|
|
102
|
+
var _ref = children,
|
|
103
|
+
_ref2 = _slicedToArray(_ref, 2),
|
|
104
|
+
measureRow = _ref2[0],
|
|
105
|
+
rows = _ref2[1];
|
|
106
|
+
|
|
107
|
+
if (!Array.isArray(rows)) {
|
|
108
|
+
return [children, 0, 0];
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (range === null) {
|
|
112
|
+
return [measureRow, 0, 0];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
var list = [];
|
|
116
|
+
var max = rows.length - 1;
|
|
117
|
+
var start = range.start,
|
|
118
|
+
end = range.end;
|
|
119
|
+
|
|
120
|
+
if (end > max) {
|
|
121
|
+
end = max;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
for (var i = start; i <= end; i += 1) {
|
|
125
|
+
list.push(rows[i]);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return [[measureRow, list], start * rowHeight, (max - end) * rowHeight];
|
|
129
|
+
}, [children, range]);
|
|
130
|
+
useEffect(function () {
|
|
131
|
+
var _ref$current;
|
|
132
|
+
|
|
133
|
+
if (ref.current === null) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
var tableBody = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.closest(".".concat(antPrefixCls, "-body"));
|
|
138
|
+
|
|
139
|
+
if (tableBody === null) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
tableBody.addEventListener('scroll', handleScroll);
|
|
144
|
+
return function () {
|
|
145
|
+
tableBody.removeEventListener('scroll', handleScroll);
|
|
146
|
+
};
|
|
147
|
+
}, []);
|
|
148
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("tbody", {
|
|
149
|
+
className: "".concat(PREFIX_CLS, "-table-append-before"),
|
|
150
|
+
style: {
|
|
151
|
+
display: 'block',
|
|
152
|
+
height: render[1]
|
|
153
|
+
}
|
|
154
|
+
}), /*#__PURE__*/React.createElement("tbody", _extends({}, restProps, {
|
|
155
|
+
ref: ref
|
|
156
|
+
}), render[0]), /*#__PURE__*/React.createElement("tbody", {
|
|
157
|
+
className: "".concat(PREFIX_CLS, "-table-append-after"),
|
|
158
|
+
style: {
|
|
159
|
+
display: 'block',
|
|
160
|
+
height: render[2]
|
|
161
|
+
}
|
|
162
|
+
}));
|
|
163
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Table as AntdTable } from 'antd';
|
|
3
|
+
import type { BaseTableProps } from './typings';
|
|
4
|
+
interface BaseTableType {
|
|
5
|
+
<T>(props: BaseTableProps<T>): JSX.Element;
|
|
6
|
+
Summary: typeof AntdTable.Summary;
|
|
7
|
+
}
|
|
8
|
+
declare const ForwardTable: BaseTableType;
|
|
9
|
+
export default ForwardTable;
|
|
@@ -0,0 +1,482 @@
|
|
|
1
|
+
var _excluded = ["onWidthChange", "width", "fullTableRef", "children", "className"],
|
|
2
|
+
_excluded2 = ["id", "columns", "defaultColumnProps", "rowKey", "children", "summaryTitle", "summaryRecord", "dataSource", "onSortChange", "sort", "scroll", "virtual", "components", "pagination", "rowHeight", "tableLayout", "rowActions", "style", "className", "locale"];
|
|
3
|
+
|
|
4
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
5
|
+
|
|
6
|
+
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."); }
|
|
7
|
+
|
|
8
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
9
|
+
|
|
10
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
11
|
+
|
|
12
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
13
|
+
|
|
14
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
15
|
+
|
|
16
|
+
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."); }
|
|
17
|
+
|
|
18
|
+
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); }
|
|
19
|
+
|
|
20
|
+
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; }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
25
|
+
|
|
26
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
32
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
33
|
+
|
|
34
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
35
|
+
|
|
36
|
+
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; }
|
|
37
|
+
|
|
38
|
+
import React, { useMemo, useState, useEffect, useRef, forwardRef, useContext } from 'react';
|
|
39
|
+
import { Table as AntdTable, ConfigProvider } from 'antd';
|
|
40
|
+
import classNames from 'classnames';
|
|
41
|
+
import { get } from 'lodash';
|
|
42
|
+
import ResizeObserver from 'rc-resize-observer';
|
|
43
|
+
import { isColumnType, getColumnKey } from "./utils";
|
|
44
|
+
import ResizeHeaderCell from "./ResizeHeaderCell";
|
|
45
|
+
import { PREFIX_CLS } from "../../constants";
|
|
46
|
+
import VirtualList from "./VirtualBody";
|
|
47
|
+
import BaseTableContext from "./BaseTableContext";
|
|
48
|
+
import Actions from "./Actions";
|
|
49
|
+
import empty from "./empty.png";
|
|
50
|
+
|
|
51
|
+
function formatSummary(summary) {
|
|
52
|
+
if (!summary) {
|
|
53
|
+
return summary;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
var obj = _objectSpread({}, summary);
|
|
57
|
+
|
|
58
|
+
var pretty = new Intl.NumberFormat('en-US', {
|
|
59
|
+
minimumFractionDigits: 2,
|
|
60
|
+
maximumFractionDigits: 2
|
|
61
|
+
});
|
|
62
|
+
Object.keys(obj).forEach(function (key) {
|
|
63
|
+
if (obj.hasOwnProperty(key) && typeof obj[key] === 'number') {
|
|
64
|
+
obj[key] = pretty.format(obj[key]);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
return obj;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function Th(props) {
|
|
71
|
+
var onWidthChange = props.onWidthChange,
|
|
72
|
+
width = props.width,
|
|
73
|
+
fullTableRef = props.fullTableRef,
|
|
74
|
+
children = props.children,
|
|
75
|
+
className = props.className,
|
|
76
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
77
|
+
|
|
78
|
+
var _useContext = useContext(BaseTableContext),
|
|
79
|
+
antPrefixCls = _useContext.antPrefixCls;
|
|
80
|
+
|
|
81
|
+
var reg = new RegExp("\\b".concat(antPrefixCls, "-cell-ellipsis\\b"));
|
|
82
|
+
var content = children;
|
|
83
|
+
var mClassName = className;
|
|
84
|
+
|
|
85
|
+
if (mClassName && reg.test(mClassName)) {
|
|
86
|
+
mClassName = mClassName.replace(reg, '');
|
|
87
|
+
content = /*#__PURE__*/React.createElement("div", {
|
|
88
|
+
className: "".concat(antPrefixCls, "-cell-ellipsis")
|
|
89
|
+
}, content);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (!width || !onWidthChange) {
|
|
93
|
+
return /*#__PURE__*/React.createElement("th", _extends({}, restProps, {
|
|
94
|
+
className: mClassName
|
|
95
|
+
}), content);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return /*#__PURE__*/React.createElement(ResizeHeaderCell, {
|
|
99
|
+
width: width,
|
|
100
|
+
onChange: onWidthChange,
|
|
101
|
+
fullTableRef: fullTableRef,
|
|
102
|
+
prefixCls: "".concat(PREFIX_CLS, "-table")
|
|
103
|
+
}, /*#__PURE__*/React.createElement("th", _extends({}, restProps, {
|
|
104
|
+
className: mClassName
|
|
105
|
+
}), content));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function BaseTable(props, _ref) {
|
|
109
|
+
var id = props.id,
|
|
110
|
+
columns = props.columns,
|
|
111
|
+
defaultColumnProps = props.defaultColumnProps,
|
|
112
|
+
rowKey = props.rowKey,
|
|
113
|
+
children = props.children,
|
|
114
|
+
summaryTitle = props.summaryTitle,
|
|
115
|
+
summaryRecord = props.summaryRecord,
|
|
116
|
+
_props$dataSource = props.dataSource,
|
|
117
|
+
dataSource = _props$dataSource === void 0 ? [] : _props$dataSource,
|
|
118
|
+
onSortChange = props.onSortChange,
|
|
119
|
+
defaultSort = props.sort,
|
|
120
|
+
scroll = props.scroll,
|
|
121
|
+
virtual = props.virtual,
|
|
122
|
+
componentsProp = props.components,
|
|
123
|
+
paginationProp = props.pagination,
|
|
124
|
+
rowHeight = props.rowHeight,
|
|
125
|
+
_props$tableLayout = props.tableLayout,
|
|
126
|
+
tableLayout = _props$tableLayout === void 0 ? 'fixed' : _props$tableLayout,
|
|
127
|
+
rowActions = props.rowActions,
|
|
128
|
+
style = props.style,
|
|
129
|
+
className = props.className,
|
|
130
|
+
localeProp = props.locale,
|
|
131
|
+
restProps = _objectWithoutProperties(props, _excluded2);
|
|
132
|
+
|
|
133
|
+
var antPrefixCls = useContext(ConfigProvider.ConfigContext).getPrefixCls('table');
|
|
134
|
+
var fullTableRef = useRef(null);
|
|
135
|
+
|
|
136
|
+
var _useState = useState(new Map()),
|
|
137
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
138
|
+
colsState = _useState2[0],
|
|
139
|
+
setColsState = _useState2[1];
|
|
140
|
+
|
|
141
|
+
var scrollYProp = scroll === null || scroll === void 0 ? void 0 : scroll.y;
|
|
142
|
+
|
|
143
|
+
var _useState3 = useState(scrollYProp === true ? 0 : scrollYProp),
|
|
144
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
145
|
+
scrollY = _useState4[0],
|
|
146
|
+
setScrollY = _useState4[1];
|
|
147
|
+
|
|
148
|
+
var memoHeight = useRef(0);
|
|
149
|
+
/** auto scroll y */
|
|
150
|
+
|
|
151
|
+
var calcScrollY = function calcScrollY() {
|
|
152
|
+
var wrapper = fullTableRef.current;
|
|
153
|
+
|
|
154
|
+
if (wrapper === null) {
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
var table = wrapper.querySelector(".".concat(antPrefixCls));
|
|
159
|
+
var tableBody = wrapper.querySelector(".".concat(antPrefixCls, "-body"));
|
|
160
|
+
|
|
161
|
+
if (tableBody === null || table === null) {
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
var parent = wrapper.parentElement;
|
|
166
|
+
|
|
167
|
+
if (parent === null) {
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
var style = getComputedStyle(parent);
|
|
172
|
+
var contentHeight = parent.offsetHeight - (parseFloat(style.getPropertyValue('padding-top')) || 0) - (parseFloat(style.getPropertyValue('padding-bottom')) || 0);
|
|
173
|
+
var nodes = [];
|
|
174
|
+
|
|
175
|
+
if (tableBody.previousElementSibling !== null) {
|
|
176
|
+
nodes.push(tableBody.previousElementSibling);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (tableBody.nextElementSibling !== null) {
|
|
180
|
+
nodes.push(tableBody.nextElementSibling);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (table.nextElementSibling !== null) {
|
|
184
|
+
nodes.push(table.nextElementSibling);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
contentHeight -= nodes.reduce(function (prev, dom) {
|
|
188
|
+
var cpStyle = window.getComputedStyle(dom);
|
|
189
|
+
var height = dom.offsetHeight + (parseFloat(cpStyle.getPropertyValue('margin-top')) || 0) + (parseFloat(cpStyle.getPropertyValue('margin-bottom')) || 0);
|
|
190
|
+
return prev + height;
|
|
191
|
+
}, 0);
|
|
192
|
+
return contentHeight;
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
var changeScrollY = function changeScrollY(height) {
|
|
196
|
+
if (height === memoHeight.current) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
memoHeight.current = height;
|
|
201
|
+
|
|
202
|
+
if (memoHeight.current === 0) {
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
setScrollY(calcScrollY() || undefined);
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
var hasPagination = false;
|
|
210
|
+
|
|
211
|
+
if (paginationProp !== false) {
|
|
212
|
+
hasPagination = paginationProp !== undefined && !!paginationProp.total || dataSource.length > 0;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
useEffect(function () {
|
|
216
|
+
if (scrollYProp === true) {
|
|
217
|
+
setScrollY(calcScrollY() || 0);
|
|
218
|
+
}
|
|
219
|
+
}, [hasPagination]);
|
|
220
|
+
useEffect(function () {
|
|
221
|
+
if (scrollYProp !== true) {
|
|
222
|
+
setScrollY(scrollYProp);
|
|
223
|
+
}
|
|
224
|
+
}, [scrollYProp]);
|
|
225
|
+
useEffect(function () {
|
|
226
|
+
if (scrollY !== undefined && fullTableRef.current !== null) {
|
|
227
|
+
var body = fullTableRef.current.querySelector(".".concat(antPrefixCls, "-body"));
|
|
228
|
+
|
|
229
|
+
if (body !== null) {
|
|
230
|
+
var dataType = _typeof(scrollY);
|
|
231
|
+
|
|
232
|
+
switch (dataType) {
|
|
233
|
+
case 'string':
|
|
234
|
+
body.style.height = scrollY;
|
|
235
|
+
break;
|
|
236
|
+
|
|
237
|
+
case 'number':
|
|
238
|
+
body.style.height = scrollY + 'px';
|
|
239
|
+
break;
|
|
240
|
+
|
|
241
|
+
default:
|
|
242
|
+
body.style.height = 'auto';
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}, [scrollY]);
|
|
247
|
+
/** resizable column */
|
|
248
|
+
|
|
249
|
+
var _useMemo = useMemo(function () {
|
|
250
|
+
var flattenCols = [];
|
|
251
|
+
var isFixedLayout = tableLayout === 'fixed';
|
|
252
|
+
var hasAutoWidthCol = false;
|
|
253
|
+
|
|
254
|
+
var traverse = function traverse(cols) {
|
|
255
|
+
var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
256
|
+
return cols.map(function (col, index) {
|
|
257
|
+
var currPath = [].concat(_toConsumableArray(path), [index]);
|
|
258
|
+
|
|
259
|
+
if (isColumnType(col)) {
|
|
260
|
+
var colKey = getColumnKey(col);
|
|
261
|
+
|
|
262
|
+
var nextCol = _objectSpread(_objectSpread({}, defaultColumnProps), col);
|
|
263
|
+
|
|
264
|
+
var colState = colsState.get(colKey);
|
|
265
|
+
|
|
266
|
+
if (colState && colState.width !== undefined) {
|
|
267
|
+
nextCol.width = colState.width;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
if (isFixedLayout && !!nextCol.title) {
|
|
271
|
+
if (nextCol.width === undefined) {
|
|
272
|
+
nextCol.width = 160;
|
|
273
|
+
} else if (nextCol.width === 'auto') {
|
|
274
|
+
nextCol.width = undefined;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
if (!nextCol.width) {
|
|
279
|
+
hasAutoWidthCol = true;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
if (nextCol.width && !nextCol.fixed) {
|
|
283
|
+
if (nextCol.ellipsis === undefined) {
|
|
284
|
+
nextCol.ellipsis = true;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
nextCol.onHeaderCell = function () {
|
|
288
|
+
return {
|
|
289
|
+
width: nextCol.width,
|
|
290
|
+
fullTableRef: fullTableRef,
|
|
291
|
+
onWidthChange: function onWidthChange(size) {
|
|
292
|
+
setColsState(function (prev) {
|
|
293
|
+
var prevItem = prev.get(colKey);
|
|
294
|
+
|
|
295
|
+
if (prevItem !== undefined && prevItem.width === size) {
|
|
296
|
+
return prev;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
prevItem = _objectSpread(_objectSpread({}, prevItem), {}, {
|
|
300
|
+
width: size
|
|
301
|
+
});
|
|
302
|
+
var next = new Map(prev);
|
|
303
|
+
next.set(colKey, prevItem);
|
|
304
|
+
return next;
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
flattenCols.push(nextCol);
|
|
312
|
+
return nextCol;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
return _objectSpread(_objectSpread(_objectSpread({}, defaultColumnProps), col), {}, {
|
|
316
|
+
children: traverse(col.children, currPath)
|
|
317
|
+
});
|
|
318
|
+
});
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
var newColumns = traverse(columns);
|
|
322
|
+
|
|
323
|
+
if (isFixedLayout && !hasAutoWidthCol) {
|
|
324
|
+
var emptyCol = {
|
|
325
|
+
title: ''
|
|
326
|
+
};
|
|
327
|
+
newColumns.push(emptyCol);
|
|
328
|
+
flattenCols.push(emptyCol);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
return [newColumns, flattenCols];
|
|
332
|
+
}, [columns, colsState, tableLayout]),
|
|
333
|
+
_useMemo2 = _slicedToArray(_useMemo, 2),
|
|
334
|
+
formatedColumns = _useMemo2[0],
|
|
335
|
+
flattenColumns = _useMemo2[1];
|
|
336
|
+
/** row actions */
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
var _useMemo3 = useMemo(function () {
|
|
340
|
+
if (rowActions !== undefined) {
|
|
341
|
+
var actionCol = {
|
|
342
|
+
title: '',
|
|
343
|
+
className: "".concat(PREFIX_CLS, "-table-operator-column"),
|
|
344
|
+
width: 1,
|
|
345
|
+
fixed: 'right',
|
|
346
|
+
render: function render(_, row, index) {
|
|
347
|
+
return /*#__PURE__*/React.createElement(Actions, {
|
|
348
|
+
actions: rowActions,
|
|
349
|
+
row: row,
|
|
350
|
+
index: index
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
return [[].concat(_toConsumableArray(formatedColumns), [actionCol]), [].concat(_toConsumableArray(flattenColumns), [actionCol])];
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
return [formatedColumns, flattenColumns];
|
|
358
|
+
}, [rowActions, flattenColumns, formatedColumns]);
|
|
359
|
+
|
|
360
|
+
var _useMemo4 = _slicedToArray(_useMemo3, 2);
|
|
361
|
+
|
|
362
|
+
formatedColumns = _useMemo4[0];
|
|
363
|
+
flattenColumns = _useMemo4[1];
|
|
364
|
+
|
|
365
|
+
/** virtualize scroll */
|
|
366
|
+
var _useMemo5 = useMemo(function () {
|
|
367
|
+
return {
|
|
368
|
+
components: _objectSpread({
|
|
369
|
+
header: {
|
|
370
|
+
cell: Th
|
|
371
|
+
},
|
|
372
|
+
body: virtual ? {
|
|
373
|
+
wrapper: VirtualList
|
|
374
|
+
} : undefined
|
|
375
|
+
}, componentsProp)
|
|
376
|
+
};
|
|
377
|
+
}, [virtual]),
|
|
378
|
+
components = _useMemo5.components;
|
|
379
|
+
/** summary row */
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
var summary = useMemo(function () {
|
|
383
|
+
var Summary = AntdTable.Summary;
|
|
384
|
+
|
|
385
|
+
if (!summaryRecord) {
|
|
386
|
+
return undefined;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
return function () {
|
|
390
|
+
var _props$rowSelection;
|
|
391
|
+
|
|
392
|
+
var data = formatSummary(summaryRecord);
|
|
393
|
+
var offset = 0;
|
|
394
|
+
return /*#__PURE__*/React.createElement(Summary, {
|
|
395
|
+
fixed: true
|
|
396
|
+
}, /*#__PURE__*/React.createElement(Summary.Row, null, ((_props$rowSelection = props.rowSelection) === null || _props$rowSelection === void 0 ? void 0 : _props$rowSelection.type) !== undefined && /*#__PURE__*/React.createElement(Summary.Cell, {
|
|
397
|
+
index: offset++
|
|
398
|
+
}), flattenColumns.map(function (item, index) {
|
|
399
|
+
var value;
|
|
400
|
+
|
|
401
|
+
if (index === 0) {
|
|
402
|
+
value = summaryTitle;
|
|
403
|
+
} else if (item.dataIndex) {
|
|
404
|
+
value = get(data, item.dataIndex);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
return /*#__PURE__*/React.createElement(Summary.Cell, {
|
|
408
|
+
index: index + offset,
|
|
409
|
+
key: getColumnKey(item) || index,
|
|
410
|
+
align: item.align
|
|
411
|
+
}, value);
|
|
412
|
+
})));
|
|
413
|
+
};
|
|
414
|
+
}, [flattenColumns, summaryRecord, summaryTitle]);
|
|
415
|
+
var ctx = useMemo(function () {
|
|
416
|
+
return {
|
|
417
|
+
scrollY: scrollY,
|
|
418
|
+
rowHeight: rowHeight,
|
|
419
|
+
antPrefixCls: antPrefixCls
|
|
420
|
+
};
|
|
421
|
+
}, [scrollY, rowHeight, antPrefixCls]);
|
|
422
|
+
var tableNode = /*#__PURE__*/React.createElement(AntdTable, _extends({
|
|
423
|
+
size: "small",
|
|
424
|
+
ref: function ref(elm) {
|
|
425
|
+
fullTableRef.current = elm;
|
|
426
|
+
|
|
427
|
+
if (typeof _ref === 'function') {
|
|
428
|
+
_ref(elm);
|
|
429
|
+
} else if (_ref !== null) {
|
|
430
|
+
_ref.current = elm;
|
|
431
|
+
}
|
|
432
|
+
},
|
|
433
|
+
className: classNames("".concat(PREFIX_CLS, "-table"), className),
|
|
434
|
+
columns: formatedColumns,
|
|
435
|
+
dataSource: dataSource,
|
|
436
|
+
rowKey: rowKey,
|
|
437
|
+
summary: summary,
|
|
438
|
+
components: components,
|
|
439
|
+
tableLayout: tableLayout,
|
|
440
|
+
scroll: {
|
|
441
|
+
x: (scroll === null || scroll === void 0 ? void 0 : scroll.x) || '100%',
|
|
442
|
+
y: scrollY
|
|
443
|
+
},
|
|
444
|
+
style: scrollYProp === true ? _objectSpread(_objectSpread({}, style), {}, {
|
|
445
|
+
height: '100%'
|
|
446
|
+
}) : style,
|
|
447
|
+
locale: _objectSpread({
|
|
448
|
+
emptyText: /*#__PURE__*/React.createElement("div", {
|
|
449
|
+
className: "".concat(PREFIX_CLS, "-table-empty")
|
|
450
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
451
|
+
src: empty
|
|
452
|
+
}), /*#__PURE__*/React.createElement("div", null, "\u6682\u65E0\u6570\u636E"))
|
|
453
|
+
}, localeProp)
|
|
454
|
+
}, restProps, {
|
|
455
|
+
pagination: paginationProp !== false ? _objectSpread({
|
|
456
|
+
size: 'small',
|
|
457
|
+
pageSizeOptions: ['10', '20', '50', '100'],
|
|
458
|
+
showSizeChanger: true,
|
|
459
|
+
showQuickJumper: true,
|
|
460
|
+
showTotal: function showTotal(val) {
|
|
461
|
+
return "\u5171".concat(val, "\u6761");
|
|
462
|
+
},
|
|
463
|
+
defaultPageSize: 20
|
|
464
|
+
}, paginationProp) : false
|
|
465
|
+
}));
|
|
466
|
+
|
|
467
|
+
if (scrollYProp === true) {
|
|
468
|
+
tableNode = /*#__PURE__*/React.createElement(ResizeObserver, {
|
|
469
|
+
onResize: function onResize(size) {
|
|
470
|
+
changeScrollY(size.height);
|
|
471
|
+
}
|
|
472
|
+
}, tableNode);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
return /*#__PURE__*/React.createElement(BaseTableContext.Provider, {
|
|
476
|
+
value: ctx
|
|
477
|
+
}, tableNode);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
var ForwardTable = /*#__PURE__*/forwardRef(BaseTable);
|
|
481
|
+
ForwardTable.Summary = AntdTable.Summary;
|
|
482
|
+
export default ForwardTable;
|