@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,918 @@
|
|
|
1
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2
|
+
|
|
3
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
4
|
+
|
|
5
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
6
|
+
|
|
7
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
8
|
+
|
|
9
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
10
|
+
|
|
11
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
|
+
|
|
13
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
14
|
+
|
|
15
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
16
|
+
|
|
17
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
18
|
+
|
|
19
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
20
|
+
|
|
21
|
+
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); }
|
|
22
|
+
|
|
23
|
+
var __decorate = this && this.__decorate || function (decorators, target, key, desc) {
|
|
24
|
+
var c = arguments.length,
|
|
25
|
+
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
26
|
+
d;
|
|
27
|
+
if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === 'object' && typeof Reflect.decorate === 'function') r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
|
|
28
|
+
if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
29
|
+
}
|
|
30
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
var __param = this && this.__param || function (paramIndex, decorator) {
|
|
34
|
+
return function (target, key) {
|
|
35
|
+
decorator(target, key, paramIndex);
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
import { _, Autowired, BeanStub, Events, NumberSequence, PostConstruct, PreDestroy, Qualifier, ServerSideTransactionResultStatus } from '@ag-grid-community/core';
|
|
40
|
+
import { InfiniteStoreBlock } from "../blocks/infiniteStoreBlock";
|
|
41
|
+
var FindResult;
|
|
42
|
+
|
|
43
|
+
(function (FindResult) {
|
|
44
|
+
FindResult[FindResult['FOUND'] = 0] = 'FOUND';
|
|
45
|
+
FindResult[FindResult['CONTINUE_FIND'] = 1] = 'CONTINUE_FIND';
|
|
46
|
+
FindResult[FindResult['BREAK_FIND'] = 2] = 'BREAK_FIND';
|
|
47
|
+
})(FindResult || (FindResult = {}));
|
|
48
|
+
|
|
49
|
+
export var InfiniteStore = /*#__PURE__*/function (_BeanStub) {
|
|
50
|
+
_inherits(InfiniteStore, _BeanStub);
|
|
51
|
+
|
|
52
|
+
var _super = _createSuper(InfiniteStore);
|
|
53
|
+
|
|
54
|
+
function InfiniteStore(ssrmParams, storeParams, parentRowNode) {
|
|
55
|
+
var _this;
|
|
56
|
+
|
|
57
|
+
_classCallCheck(this, InfiniteStore);
|
|
58
|
+
|
|
59
|
+
_this = _super.call(this);
|
|
60
|
+
_this.blocks = {};
|
|
61
|
+
_this.blockHeights = {};
|
|
62
|
+
_this.lastRowIndexKnown = false; // this will always be zero for the top level cache only,
|
|
63
|
+
// all the other ones change as the groups open and close
|
|
64
|
+
|
|
65
|
+
_this.displayIndexStart = 0;
|
|
66
|
+
_this.displayIndexEnd = 0; // not sure if setting this one to zero is necessary
|
|
67
|
+
|
|
68
|
+
_this.cacheTopPixel = 0;
|
|
69
|
+
_this.info = {};
|
|
70
|
+
_this.refreshedNodeCache = {};
|
|
71
|
+
_this.ssrmParams = ssrmParams;
|
|
72
|
+
_this.storeParams = storeParams;
|
|
73
|
+
_this.parentRowNode = parentRowNode;
|
|
74
|
+
return _this;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
_createClass(InfiniteStore, [{
|
|
78
|
+
key: "postConstruct",
|
|
79
|
+
value: function postConstruct() {
|
|
80
|
+
this.defaultRowHeight = this.gridOptionsWrapper.getRowHeightAsNumber();
|
|
81
|
+
var isRootStore = this.parentRowNode.level === -1;
|
|
82
|
+
var initialRowCount = isRootStore ? this.gridOptionsWrapper.getServerSideInitialRowCount() : InfiniteStore.INITIAL_ROW_COUNT;
|
|
83
|
+
this.rowCount = initialRowCount;
|
|
84
|
+
}
|
|
85
|
+
}, {
|
|
86
|
+
key: "destroyAllBlocks",
|
|
87
|
+
value: function destroyAllBlocks() {
|
|
88
|
+
var _this2 = this;
|
|
89
|
+
|
|
90
|
+
this.getBlocksInOrder().forEach(function (block) {
|
|
91
|
+
return _this2.destroyBlock(block);
|
|
92
|
+
});
|
|
93
|
+
this.blockUtils.destroyRowNodes(Object.values(this.refreshedNodeCache));
|
|
94
|
+
}
|
|
95
|
+
}, {
|
|
96
|
+
key: "setBeans",
|
|
97
|
+
value: function setBeans(loggerFactory) {
|
|
98
|
+
this.logger = loggerFactory.create('ServerSideCache');
|
|
99
|
+
}
|
|
100
|
+
}, {
|
|
101
|
+
key: "getRowCount",
|
|
102
|
+
value: function getRowCount() {
|
|
103
|
+
return this.rowCount;
|
|
104
|
+
}
|
|
105
|
+
}, {
|
|
106
|
+
key: "isLastRowIndexKnown",
|
|
107
|
+
value: function isLastRowIndexKnown() {
|
|
108
|
+
return this.lastRowIndexKnown;
|
|
109
|
+
}
|
|
110
|
+
}, {
|
|
111
|
+
key: "retryLoads",
|
|
112
|
+
value: function retryLoads() {
|
|
113
|
+
this.getBlocksInOrder().forEach(function (block) {
|
|
114
|
+
return block.retryLoads();
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}, {
|
|
118
|
+
key: "onBlockLoadFailed",
|
|
119
|
+
value: function onBlockLoadFailed(block) {
|
|
120
|
+
block.setData([], true);
|
|
121
|
+
this.fireCacheUpdatedEvent();
|
|
122
|
+
}
|
|
123
|
+
}, {
|
|
124
|
+
key: "onBlockLoaded",
|
|
125
|
+
value: function onBlockLoaded(block, params) {
|
|
126
|
+
this.logger.log("onPageLoaded: page = ".concat(block.getId(), ", lastRow = ").concat(params.rowCount));
|
|
127
|
+
var info = params.storeInfo || params.groupLevelInfo;
|
|
128
|
+
|
|
129
|
+
if (info) {
|
|
130
|
+
Object.assign(this.info, info);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (!params.rowData) {
|
|
134
|
+
var message = 'AG Grid: "params.rowData" is missing from Server-Side Row Model success() callback. Please use the "rowData" attribute. If no data is returned, set an empty list.';
|
|
135
|
+
|
|
136
|
+
_.doOnce(function () {
|
|
137
|
+
return console.warn(message, params);
|
|
138
|
+
}, 'InfiniteStore.noData');
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
var finalRowCount = params.rowCount != null && params.rowCount >= 0 ? params.rowCount : undefined; // if we are not active, then we ignore all events, otherwise we could end up getting the
|
|
142
|
+
// grid to refresh even though we are no longer the active cache
|
|
143
|
+
|
|
144
|
+
if (!this.isAlive()) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
this.checkRowCount(block, finalRowCount);
|
|
149
|
+
block.setData(params.rowData); // if the virtualRowCount is shortened, then it's possible blocks exist that are no longer
|
|
150
|
+
// in the valid range. so we must remove these. this can happen if the datasource returns a
|
|
151
|
+
// result and sets lastRow to something less than virtualRowCount (can happen if user scrolls
|
|
152
|
+
// down, server reduces dataset size).
|
|
153
|
+
|
|
154
|
+
this.destroyAllBlocksPastVirtualRowCount();
|
|
155
|
+
this.fireCacheUpdatedEvent();
|
|
156
|
+
}
|
|
157
|
+
}, {
|
|
158
|
+
key: "purgeBlocksIfNeeded",
|
|
159
|
+
value: function purgeBlocksIfNeeded(blockToExclude) {
|
|
160
|
+
var _this3 = this;
|
|
161
|
+
|
|
162
|
+
// we exclude checking for the page just created, as this has yet to be accessed and hence
|
|
163
|
+
// the lastAccessed stamp will not be updated for the first time yet
|
|
164
|
+
var blocksForPurging = this.getBlocksInOrder().filter(function (b) {
|
|
165
|
+
return b != blockToExclude;
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
var lastAccessedComparator = function lastAccessedComparator(a, b) {
|
|
169
|
+
return b.getLastAccessed() - a.getLastAccessed();
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
blocksForPurging.sort(lastAccessedComparator); // we remove (maxBlocksInCache - 1) as we already excluded the 'just created' page.
|
|
173
|
+
// in other words, after the splice operation below, we have taken out the blocks
|
|
174
|
+
// we want to keep, which means we are left with blocks that we can potentially purge
|
|
175
|
+
|
|
176
|
+
var maxBlocksProvided = this.storeParams.maxBlocksInCache > 0;
|
|
177
|
+
var blocksToKeep = maxBlocksProvided ? this.storeParams.maxBlocksInCache - 1 : null;
|
|
178
|
+
var emptyBlocksToKeep = InfiniteStore.MAX_EMPTY_BLOCKS_TO_KEEP - 1;
|
|
179
|
+
blocksForPurging.forEach(function (block, index) {
|
|
180
|
+
var purgeBecauseBlockEmpty = block.getState() === InfiniteStoreBlock.STATE_WAITING_TO_LOAD && index >= emptyBlocksToKeep;
|
|
181
|
+
var purgeBecauseCacheFull = maxBlocksProvided ? index >= blocksToKeep : false;
|
|
182
|
+
|
|
183
|
+
if (purgeBecauseBlockEmpty || purgeBecauseCacheFull) {
|
|
184
|
+
// we never purge blocks if they are open, as purging them would mess up with
|
|
185
|
+
// our indexes, it would be very messy to restore the purged block to it's
|
|
186
|
+
// previous state if it had open children.
|
|
187
|
+
if (block.isAnyNodeOpen()) {
|
|
188
|
+
return;
|
|
189
|
+
} // if the block currently has rows been displayed, then don't remove it either.
|
|
190
|
+
// this can happen if user has maxBlocks=2, and blockSize=5 (thus 10 max rows in cache)
|
|
191
|
+
// but the screen is showing 20 rows, so at least 4 blocks are needed.
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
if (_this3.isBlockCurrentlyDisplayed(block)) {
|
|
195
|
+
return;
|
|
196
|
+
} // don't want to loose keyboard focus, so keyboard navigation can continue. so keep focused blocks.
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
if (_this3.isBlockFocused(block)) {
|
|
200
|
+
return;
|
|
201
|
+
} // at this point, block is not needed, and no open nodes, so burn baby burn
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
_this3.destroyBlock(block);
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
}, {
|
|
209
|
+
key: "isBlockFocused",
|
|
210
|
+
value: function isBlockFocused(block) {
|
|
211
|
+
var focusedCell = this.focusService.getFocusCellToUseAfterRefresh();
|
|
212
|
+
|
|
213
|
+
if (!focusedCell) {
|
|
214
|
+
return false;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
if (focusedCell.rowPinned != null) {
|
|
218
|
+
return false;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
var blockIndexStart = block.getDisplayIndexStart();
|
|
222
|
+
var blockIndexEnd = block.getDisplayIndexEnd();
|
|
223
|
+
|
|
224
|
+
if (blockIndexEnd == null || blockIndexStart == null) {
|
|
225
|
+
return false;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
var hasFocus = focusedCell.rowIndex >= blockIndexStart && focusedCell.rowIndex < blockIndexEnd;
|
|
229
|
+
return hasFocus;
|
|
230
|
+
}
|
|
231
|
+
}, {
|
|
232
|
+
key: "isBlockCurrentlyDisplayed",
|
|
233
|
+
value: function isBlockCurrentlyDisplayed(block) {
|
|
234
|
+
var startIndex = block.getDisplayIndexStart();
|
|
235
|
+
var endIndex = block.getDisplayIndexEnd() - 1;
|
|
236
|
+
return this.rowRenderer.isRangeInRenderedViewport(startIndex, endIndex);
|
|
237
|
+
}
|
|
238
|
+
}, {
|
|
239
|
+
key: "removeDuplicateNode",
|
|
240
|
+
value: function removeDuplicateNode(id) {
|
|
241
|
+
this.getBlocksInOrder().forEach(function (block) {
|
|
242
|
+
return block.removeDuplicateNode(id);
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
}, {
|
|
246
|
+
key: "checkRowCount",
|
|
247
|
+
value: function checkRowCount(block, lastRow) {
|
|
248
|
+
// if client provided a last row, we always use it, as it could change between server calls
|
|
249
|
+
// if user deleted data and then called refresh on the grid.
|
|
250
|
+
if (typeof lastRow === 'number' && lastRow >= 0) {
|
|
251
|
+
this.rowCount = lastRow;
|
|
252
|
+
this.lastRowIndexKnown = true;
|
|
253
|
+
} else if (!this.lastRowIndexKnown) {
|
|
254
|
+
// otherwise, see if we need to add some virtual rows
|
|
255
|
+
var lastRowIndex = (block.getId() + 1) * this.storeParams.cacheBlockSize;
|
|
256
|
+
var lastRowIndexPlusOverflow = lastRowIndex + InfiniteStore.OVERFLOW_SIZE;
|
|
257
|
+
|
|
258
|
+
if (this.rowCount < lastRowIndexPlusOverflow) {
|
|
259
|
+
this.rowCount = lastRowIndexPlusOverflow;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}, {
|
|
264
|
+
key: "forEachNodeDeep",
|
|
265
|
+
value: function forEachNodeDeep(callback) {
|
|
266
|
+
var sequence = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new NumberSequence();
|
|
267
|
+
this.getBlocksInOrder().forEach(function (block) {
|
|
268
|
+
return block.forEachNodeDeep(callback, sequence);
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
}, {
|
|
272
|
+
key: "forEachNodeDeepAfterFilterAndSort",
|
|
273
|
+
value: function forEachNodeDeepAfterFilterAndSort(callback) {
|
|
274
|
+
var sequence = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new NumberSequence();
|
|
275
|
+
this.getBlocksInOrder().forEach(function (block) {
|
|
276
|
+
return block.forEachNodeAfterFilterAndSort(callback, sequence);
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
}, {
|
|
280
|
+
key: "getBlocksInOrder",
|
|
281
|
+
value: function getBlocksInOrder() {
|
|
282
|
+
// get all page id's as NUMBERS (not strings, as we need to sort as numbers) and in descending order
|
|
283
|
+
var blockComparator = function blockComparator(a, b) {
|
|
284
|
+
return a.getId() - b.getId();
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
var blocks = _.getAllValuesInObject(this.blocks).sort(blockComparator);
|
|
288
|
+
|
|
289
|
+
return blocks;
|
|
290
|
+
}
|
|
291
|
+
}, {
|
|
292
|
+
key: "destroyBlock",
|
|
293
|
+
value: function destroyBlock(block) {
|
|
294
|
+
delete this.blocks[block.getId()];
|
|
295
|
+
this.destroyBean(block);
|
|
296
|
+
this.rowNodeBlockLoader.removeBlock(block);
|
|
297
|
+
} // gets called 1) row count changed 2) cache purged 3) items inserted
|
|
298
|
+
|
|
299
|
+
}, {
|
|
300
|
+
key: "fireCacheUpdatedEvent",
|
|
301
|
+
value: function fireCacheUpdatedEvent() {
|
|
302
|
+
// this results in row model firing ModelUpdated.
|
|
303
|
+
// server side row model also updates the row indexes first
|
|
304
|
+
var event = {
|
|
305
|
+
type: Events.EVENT_STORE_UPDATED
|
|
306
|
+
};
|
|
307
|
+
this.eventService.dispatchEvent(event);
|
|
308
|
+
}
|
|
309
|
+
}, {
|
|
310
|
+
key: "destroyAllBlocksPastVirtualRowCount",
|
|
311
|
+
value: function destroyAllBlocksPastVirtualRowCount() {
|
|
312
|
+
var _this4 = this;
|
|
313
|
+
|
|
314
|
+
var blocksToDestroy = [];
|
|
315
|
+
this.getBlocksInOrder().forEach(function (block) {
|
|
316
|
+
var startRow = block.getId() * _this4.storeParams.cacheBlockSize;
|
|
317
|
+
|
|
318
|
+
if (startRow >= _this4.rowCount) {
|
|
319
|
+
blocksToDestroy.push(block);
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
if (blocksToDestroy.length > 0) {
|
|
324
|
+
blocksToDestroy.forEach(function (block) {
|
|
325
|
+
return _this4.destroyBlock(block);
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}, {
|
|
330
|
+
key: "refreshStore",
|
|
331
|
+
value: function refreshStore(purge) {
|
|
332
|
+
var noBlocksToRefresh = this.getRowCount() == 0;
|
|
333
|
+
|
|
334
|
+
if (noBlocksToRefresh || purge) {
|
|
335
|
+
this.resetStore();
|
|
336
|
+
} else {
|
|
337
|
+
this.refreshBlocks();
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
this.fireCacheUpdatedEvent();
|
|
341
|
+
}
|
|
342
|
+
}, {
|
|
343
|
+
key: "isNodeCached",
|
|
344
|
+
value: function isNodeCached(id) {
|
|
345
|
+
return !!this.refreshedNodeCache[id];
|
|
346
|
+
}
|
|
347
|
+
}, {
|
|
348
|
+
key: "retrieveNodeFromCache",
|
|
349
|
+
value: function retrieveNodeFromCache(id) {
|
|
350
|
+
var node = this.refreshedNodeCache[id];
|
|
351
|
+
|
|
352
|
+
if (node) {
|
|
353
|
+
delete this.refreshedNodeCache[id];
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
return node;
|
|
357
|
+
}
|
|
358
|
+
}, {
|
|
359
|
+
key: "buildRowNodeCache",
|
|
360
|
+
value: function buildRowNodeCache() {
|
|
361
|
+
var rowCache = {};
|
|
362
|
+
this.getBlocksInOrder().forEach(function (block) {
|
|
363
|
+
block.rowNodes.forEach(function (row) {
|
|
364
|
+
if (row.group) {
|
|
365
|
+
rowCache[row.id] = row;
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
});
|
|
369
|
+
this.refreshedNodeCache = rowCache;
|
|
370
|
+
}
|
|
371
|
+
}, {
|
|
372
|
+
key: "refreshBlocks",
|
|
373
|
+
value: function refreshBlocks() {
|
|
374
|
+
this.buildRowNodeCache();
|
|
375
|
+
this.getBlocksInOrder().forEach(function (block) {
|
|
376
|
+
block.refresh();
|
|
377
|
+
});
|
|
378
|
+
this.lastRowIndexKnown = false;
|
|
379
|
+
this.rowNodeBlockLoader.checkBlockToLoad();
|
|
380
|
+
}
|
|
381
|
+
}, {
|
|
382
|
+
key: "resetStore",
|
|
383
|
+
value: function resetStore() {
|
|
384
|
+
this.destroyAllBlocks();
|
|
385
|
+
this.lastRowIndexKnown = false; // if zero rows in the cache, we need to get the SSRM to start asking for rows again.
|
|
386
|
+
// otherwise if set to zero rows last time, and we don't update the row count, then after
|
|
387
|
+
// the purge there will still be zero rows, meaning the SSRM won't request any rows.
|
|
388
|
+
// to kick things off, at least one row needs to be asked for.
|
|
389
|
+
|
|
390
|
+
if (this.columnModel.isAutoRowHeightActive() || this.rowCount === 0) {
|
|
391
|
+
this.rowCount = InfiniteStore.INITIAL_ROW_COUNT;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}, {
|
|
395
|
+
key: "getRowNodesInRange",
|
|
396
|
+
value: function getRowNodesInRange(firstInRange, lastInRange) {
|
|
397
|
+
var result = [];
|
|
398
|
+
var lastBlockId = -1;
|
|
399
|
+
var inActiveRange = false; // if only one node passed, we start the selection at the top
|
|
400
|
+
|
|
401
|
+
if (_.missing(firstInRange)) {
|
|
402
|
+
inActiveRange = true;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
var foundGapInSelection = false;
|
|
406
|
+
this.getBlocksInOrder().forEach(function (block) {
|
|
407
|
+
if (foundGapInSelection) {
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
if (inActiveRange && lastBlockId + 1 !== block.getId()) {
|
|
412
|
+
foundGapInSelection = true;
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
lastBlockId = block.getId();
|
|
417
|
+
block.forEachNodeShallow(function (rowNode) {
|
|
418
|
+
var hitFirstOrLast = rowNode === firstInRange || rowNode === lastInRange;
|
|
419
|
+
|
|
420
|
+
if (inActiveRange || hitFirstOrLast) {
|
|
421
|
+
result.push(rowNode);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
if (hitFirstOrLast) {
|
|
425
|
+
inActiveRange = !inActiveRange;
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
}); // inActiveRange will be still true if we never hit the second rowNode
|
|
429
|
+
|
|
430
|
+
var invalidRange = foundGapInSelection || inActiveRange;
|
|
431
|
+
return invalidRange ? [] : result;
|
|
432
|
+
}
|
|
433
|
+
}, {
|
|
434
|
+
key: "findBlockAndExecute",
|
|
435
|
+
value: function findBlockAndExecute(matchBlockFunc, blockFoundFunc, blockNotFoundFunc) {
|
|
436
|
+
var blockFound = false;
|
|
437
|
+
var breakSearch = false;
|
|
438
|
+
var lastBlock = null;
|
|
439
|
+
var res;
|
|
440
|
+
this.getBlocksInOrder().forEach(function (block) {
|
|
441
|
+
if (blockFound || breakSearch) {
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
var comparatorResult = matchBlockFunc(block);
|
|
446
|
+
|
|
447
|
+
if (comparatorResult == FindResult.FOUND) {
|
|
448
|
+
res = blockFoundFunc(block);
|
|
449
|
+
blockFound = true;
|
|
450
|
+
} else if (comparatorResult == FindResult.CONTINUE_FIND) {
|
|
451
|
+
lastBlock = block;
|
|
452
|
+
} else if (comparatorResult == FindResult.BREAK_FIND) {
|
|
453
|
+
breakSearch = true;
|
|
454
|
+
}
|
|
455
|
+
});
|
|
456
|
+
|
|
457
|
+
if (!blockFound) {
|
|
458
|
+
res = blockNotFoundFunc(lastBlock);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
return res;
|
|
462
|
+
}
|
|
463
|
+
}, {
|
|
464
|
+
key: "getRowBounds",
|
|
465
|
+
value: function getRowBounds(index) {
|
|
466
|
+
var _this5 = this;
|
|
467
|
+
|
|
468
|
+
var matchBlockFunc = function matchBlockFunc(block) {
|
|
469
|
+
if (block.isDisplayIndexInBlock(index)) {
|
|
470
|
+
return FindResult.FOUND;
|
|
471
|
+
} else {
|
|
472
|
+
return block.isBlockBefore(index) ? FindResult.CONTINUE_FIND : FindResult.BREAK_FIND;
|
|
473
|
+
}
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
var blockFoundFunc = function blockFoundFunc(foundBlock) {
|
|
477
|
+
return foundBlock.getRowBounds(index);
|
|
478
|
+
};
|
|
479
|
+
|
|
480
|
+
var blockNotFoundFunc = function blockNotFoundFunc(previousBlock) {
|
|
481
|
+
var nextRowTop;
|
|
482
|
+
var nextRowIndex;
|
|
483
|
+
|
|
484
|
+
if (previousBlock !== null) {
|
|
485
|
+
nextRowTop = previousBlock.getBlockTopPx() + previousBlock.getBlockHeightPx();
|
|
486
|
+
nextRowIndex = previousBlock.getDisplayIndexEnd();
|
|
487
|
+
} else {
|
|
488
|
+
nextRowTop = _this5.cacheTopPixel;
|
|
489
|
+
nextRowIndex = _this5.displayIndexStart;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
var rowsBetween = index - nextRowIndex;
|
|
493
|
+
return {
|
|
494
|
+
rowHeight: _this5.defaultRowHeight,
|
|
495
|
+
rowTop: nextRowTop + rowsBetween * _this5.defaultRowHeight
|
|
496
|
+
};
|
|
497
|
+
};
|
|
498
|
+
|
|
499
|
+
return this.findBlockAndExecute(matchBlockFunc, blockFoundFunc, blockNotFoundFunc);
|
|
500
|
+
}
|
|
501
|
+
}, {
|
|
502
|
+
key: "getRowIndexAtPixel",
|
|
503
|
+
value: function getRowIndexAtPixel(pixel) {
|
|
504
|
+
var _this6 = this;
|
|
505
|
+
|
|
506
|
+
var matchBlockFunc = function matchBlockFunc(block) {
|
|
507
|
+
if (block.isPixelInRange(pixel)) {
|
|
508
|
+
return FindResult.FOUND;
|
|
509
|
+
} else {
|
|
510
|
+
return block.getBlockTopPx() < pixel ? FindResult.CONTINUE_FIND : FindResult.BREAK_FIND;
|
|
511
|
+
}
|
|
512
|
+
};
|
|
513
|
+
|
|
514
|
+
var blockFoundFunc = function blockFoundFunc(foundBlock) {
|
|
515
|
+
return foundBlock.getRowIndexAtPixel(pixel);
|
|
516
|
+
};
|
|
517
|
+
|
|
518
|
+
var blockNotFoundFunc = function blockNotFoundFunc(previousBlock) {
|
|
519
|
+
var nextRowTop;
|
|
520
|
+
var nextRowIndex;
|
|
521
|
+
|
|
522
|
+
if (previousBlock) {
|
|
523
|
+
nextRowTop = previousBlock.getBlockTopPx() + previousBlock.getBlockHeightPx();
|
|
524
|
+
nextRowIndex = previousBlock.getDisplayIndexEnd();
|
|
525
|
+
} else {
|
|
526
|
+
nextRowTop = _this6.cacheTopPixel;
|
|
527
|
+
nextRowIndex = _this6.displayIndexStart;
|
|
528
|
+
} // we start at the last loaded block before this block, and go down
|
|
529
|
+
// block by block, adding in the block sizes (using cached sizes if available)
|
|
530
|
+
// until we get to a block that does should have the pixel
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
var blockSize = _this6.storeParams.cacheBlockSize;
|
|
534
|
+
var defaultBlockHeight = _this6.defaultRowHeight * blockSize;
|
|
535
|
+
var nextBlockId = previousBlock ? previousBlock.getId() + 1 : 0;
|
|
536
|
+
|
|
537
|
+
var getBlockDetails = function getBlockDetails(id) {
|
|
538
|
+
var cachedBlockHeight = _this6.getCachedBlockHeight(id);
|
|
539
|
+
|
|
540
|
+
var blockHeight = cachedBlockHeight != null ? cachedBlockHeight : defaultBlockHeight;
|
|
541
|
+
var pixelInBlock = pixel <= blockHeight + nextRowTop;
|
|
542
|
+
return {
|
|
543
|
+
height: blockHeight,
|
|
544
|
+
pixelInBlock: pixelInBlock
|
|
545
|
+
};
|
|
546
|
+
};
|
|
547
|
+
|
|
548
|
+
var blockDetails = getBlockDetails(nextBlockId);
|
|
549
|
+
|
|
550
|
+
while (!blockDetails.pixelInBlock) {
|
|
551
|
+
nextRowTop += blockDetails.height;
|
|
552
|
+
nextRowIndex += blockSize;
|
|
553
|
+
nextBlockId++;
|
|
554
|
+
blockDetails = getBlockDetails(nextBlockId);
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
var pixelsBetween = pixel - nextRowTop;
|
|
558
|
+
var rowHeight = blockDetails.height / blockSize;
|
|
559
|
+
var rowsBetween = Math.floor(pixelsBetween / rowHeight) | 0;
|
|
560
|
+
return nextRowIndex + rowsBetween;
|
|
561
|
+
};
|
|
562
|
+
|
|
563
|
+
var result = this.findBlockAndExecute(matchBlockFunc, blockFoundFunc, blockNotFoundFunc);
|
|
564
|
+
var lastAllowedIndex = this.getDisplayIndexEnd() - 1;
|
|
565
|
+
result = Math.min(result, lastAllowedIndex);
|
|
566
|
+
return result;
|
|
567
|
+
}
|
|
568
|
+
}, {
|
|
569
|
+
key: "clearDisplayIndexes",
|
|
570
|
+
value: function clearDisplayIndexes() {
|
|
571
|
+
this.displayIndexStart = undefined;
|
|
572
|
+
this.displayIndexEnd = undefined;
|
|
573
|
+
this.getBlocksInOrder().forEach(function (block) {
|
|
574
|
+
return block.clearDisplayIndexes();
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
}, {
|
|
578
|
+
key: "setDisplayIndexes",
|
|
579
|
+
value: function setDisplayIndexes(displayIndexSeq, nextRowTop) {
|
|
580
|
+
var _this7 = this;
|
|
581
|
+
|
|
582
|
+
this.displayIndexStart = displayIndexSeq.peek();
|
|
583
|
+
this.cacheTopPixel = nextRowTop.value;
|
|
584
|
+
var lastBlockId = -1;
|
|
585
|
+
var blockSize = this.storeParams.cacheBlockSize;
|
|
586
|
+
this.getBlocksInOrder().forEach(function (currentBlock) {
|
|
587
|
+
// if we skipped blocks, then we need to skip the row indexes. we assume that all missing
|
|
588
|
+
// blocks are made up of closed RowNodes only (if they were groups), as we never expire from
|
|
589
|
+
// the cache if any row nodes are open.
|
|
590
|
+
var blockId = currentBlock.getId();
|
|
591
|
+
var blocksSkippedCount = blockId - lastBlockId - 1;
|
|
592
|
+
var rowsSkippedCount = blocksSkippedCount * blockSize;
|
|
593
|
+
|
|
594
|
+
if (rowsSkippedCount > 0) {
|
|
595
|
+
displayIndexSeq.skip(rowsSkippedCount);
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
for (var i = 1; i <= blocksSkippedCount; i++) {
|
|
599
|
+
var blockToAddId = blockId - i;
|
|
600
|
+
|
|
601
|
+
if (_.exists(_this7.blockHeights[blockToAddId])) {
|
|
602
|
+
nextRowTop.value += _this7.blockHeights[blockToAddId];
|
|
603
|
+
} else {
|
|
604
|
+
nextRowTop.value += blockSize * _this7.defaultRowHeight;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
lastBlockId = blockId;
|
|
609
|
+
currentBlock.setDisplayIndexes(displayIndexSeq, nextRowTop);
|
|
610
|
+
_this7.blockHeights[blockId] = currentBlock.getBlockHeightPx();
|
|
611
|
+
}); // if any blocks missing at the end, need to increase the row index for them also
|
|
612
|
+
// eg if block size = 10, we have total rows of 25 (indexes 0 .. 24), but first 2 blocks loaded (because
|
|
613
|
+
// last row was ejected from cache), then:
|
|
614
|
+
// lastVisitedRow = 19, virtualRowCount = 25, rows not accounted for = 5 (24 - 19)
|
|
615
|
+
|
|
616
|
+
var lastVisitedRow = (lastBlockId + 1) * blockSize - 1;
|
|
617
|
+
var rowCount = this.getRowCount();
|
|
618
|
+
var rowsNotAccountedFor = rowCount - lastVisitedRow - 1;
|
|
619
|
+
|
|
620
|
+
if (rowsNotAccountedFor > 0) {
|
|
621
|
+
displayIndexSeq.skip(rowsNotAccountedFor);
|
|
622
|
+
nextRowTop.value += rowsNotAccountedFor * this.defaultRowHeight;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
this.displayIndexEnd = displayIndexSeq.peek();
|
|
626
|
+
this.cacheHeightPixels = nextRowTop.value - this.cacheTopPixel;
|
|
627
|
+
} // gets called in a) init() above and b) by the grid
|
|
628
|
+
|
|
629
|
+
}, {
|
|
630
|
+
key: "getRowUsingDisplayIndex",
|
|
631
|
+
value: function getRowUsingDisplayIndex(displayRowIndex) {
|
|
632
|
+
var _this8 = this;
|
|
633
|
+
|
|
634
|
+
var dontCreateBlock = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
635
|
+
|
|
636
|
+
// this can happen if asking for a row that doesn't exist in the model,
|
|
637
|
+
// eg if a cell range is selected, and the user filters so rows no longer exists
|
|
638
|
+
if (!this.isDisplayIndexInStore(displayRowIndex)) {
|
|
639
|
+
return undefined;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
var matchBlockFunc = function matchBlockFunc(block) {
|
|
643
|
+
if (block.isDisplayIndexInBlock(displayRowIndex)) {
|
|
644
|
+
return FindResult.FOUND;
|
|
645
|
+
} else {
|
|
646
|
+
return block.isBlockBefore(displayRowIndex) ? FindResult.CONTINUE_FIND : FindResult.BREAK_FIND;
|
|
647
|
+
}
|
|
648
|
+
};
|
|
649
|
+
|
|
650
|
+
var blockFoundFunc = function blockFoundFunc(foundBlock) {
|
|
651
|
+
return foundBlock.getRowUsingDisplayIndex(displayRowIndex);
|
|
652
|
+
};
|
|
653
|
+
|
|
654
|
+
var blockNotFoundFunc = function blockNotFoundFunc(previousBlock) {
|
|
655
|
+
if (dontCreateBlock) {
|
|
656
|
+
return;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
var blockNumber;
|
|
660
|
+
var displayIndexStart;
|
|
661
|
+
var nextRowTop;
|
|
662
|
+
var blockSize = _this8.storeParams.cacheBlockSize; // because missing blocks are always fully closed, we can work out
|
|
663
|
+
// the start index of the block we want by hopping from the closest block,
|
|
664
|
+
// as we know the row count in closed blocks is equal to the page size
|
|
665
|
+
|
|
666
|
+
if (previousBlock) {
|
|
667
|
+
blockNumber = previousBlock.getId() + 1;
|
|
668
|
+
displayIndexStart = previousBlock.getDisplayIndexEnd();
|
|
669
|
+
nextRowTop = previousBlock.getBlockHeightPx() + previousBlock.getBlockTopPx();
|
|
670
|
+
|
|
671
|
+
var isInRange = function isInRange() {
|
|
672
|
+
return displayRowIndex >= displayIndexStart && displayRowIndex < displayIndexStart + blockSize;
|
|
673
|
+
};
|
|
674
|
+
|
|
675
|
+
while (!isInRange()) {
|
|
676
|
+
displayIndexStart += blockSize;
|
|
677
|
+
var cachedBlockHeight = _this8.blockHeights[blockNumber];
|
|
678
|
+
|
|
679
|
+
if (_.exists(cachedBlockHeight)) {
|
|
680
|
+
nextRowTop += cachedBlockHeight;
|
|
681
|
+
} else {
|
|
682
|
+
nextRowTop += _this8.defaultRowHeight * blockSize;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
blockNumber++;
|
|
686
|
+
}
|
|
687
|
+
} else {
|
|
688
|
+
var localIndex = displayRowIndex - _this8.displayIndexStart;
|
|
689
|
+
blockNumber = Math.floor(localIndex / blockSize);
|
|
690
|
+
displayIndexStart = _this8.displayIndexStart + blockNumber * blockSize;
|
|
691
|
+
nextRowTop = _this8.cacheTopPixel + blockNumber * blockSize * _this8.defaultRowHeight;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
_this8.logger.log("block missing, rowIndex = ".concat(displayRowIndex, ", creating #").concat(blockNumber, ", displayIndexStart = ").concat(displayIndexStart));
|
|
695
|
+
|
|
696
|
+
var newBlock = _this8.createBlock(blockNumber, displayIndexStart, {
|
|
697
|
+
value: nextRowTop
|
|
698
|
+
});
|
|
699
|
+
|
|
700
|
+
return newBlock.getRowUsingDisplayIndex(displayRowIndex);
|
|
701
|
+
};
|
|
702
|
+
|
|
703
|
+
return this.findBlockAndExecute(matchBlockFunc, blockFoundFunc, blockNotFoundFunc);
|
|
704
|
+
}
|
|
705
|
+
}, {
|
|
706
|
+
key: "getTopLevelRowDisplayedIndex",
|
|
707
|
+
value: function getTopLevelRowDisplayedIndex(topLevelIndex) {
|
|
708
|
+
var blockSize = this.storeParams.cacheBlockSize;
|
|
709
|
+
var blockId = Math.floor(topLevelIndex / blockSize);
|
|
710
|
+
|
|
711
|
+
var matchBlockFunc = function matchBlockFunc(block) {
|
|
712
|
+
if (block.getId() === blockId) {
|
|
713
|
+
return FindResult.FOUND;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
return block.getId() < blockId ? FindResult.CONTINUE_FIND : FindResult.BREAK_FIND;
|
|
717
|
+
};
|
|
718
|
+
|
|
719
|
+
var blockFoundFunc = function blockFoundFunc(foundBlock) {
|
|
720
|
+
var rowNode = foundBlock.getRowUsingLocalIndex(topLevelIndex);
|
|
721
|
+
return rowNode.rowIndex;
|
|
722
|
+
};
|
|
723
|
+
|
|
724
|
+
var blockNotFoundFunc = function blockNotFoundFunc(previousBlock) {
|
|
725
|
+
if (!previousBlock) {
|
|
726
|
+
return topLevelIndex;
|
|
727
|
+
} // note: the local index is the same as the top level index, two terms for same thing
|
|
728
|
+
//
|
|
729
|
+
// get index of the last row before this row
|
|
730
|
+
// eg if blocksize = 100, then:
|
|
731
|
+
// last row of first block is 99 (100 * 1) -1;
|
|
732
|
+
// last row of second block is 199 (100 * 2) -1;
|
|
733
|
+
|
|
734
|
+
|
|
735
|
+
var lastRowTopLevelIndex = blockSize * (previousBlock.getId() + 1) - 1; // get the last top level node in the block before the wanted block. this will be the last
|
|
736
|
+
// loaded displayed top level node.
|
|
737
|
+
|
|
738
|
+
var lastRowNode = previousBlock.getRowUsingLocalIndex(lastRowTopLevelIndex); // we want the index of the last displayed node, not just the top level node, so if the last top level node
|
|
739
|
+
// is open, we get the index of the last displayed child node.
|
|
740
|
+
|
|
741
|
+
var lastDisplayedNodeIndexInBlockBefore;
|
|
742
|
+
|
|
743
|
+
if (lastRowNode.expanded && lastRowNode.childStore) {
|
|
744
|
+
var serverSideCache = lastRowNode.childStore;
|
|
745
|
+
lastDisplayedNodeIndexInBlockBefore = serverSideCache.getDisplayIndexEnd() - 1;
|
|
746
|
+
} else if (lastRowNode.expanded && lastRowNode.detailNode) {
|
|
747
|
+
lastDisplayedNodeIndexInBlockBefore = lastRowNode.detailNode.rowIndex;
|
|
748
|
+
} else {
|
|
749
|
+
lastDisplayedNodeIndexInBlockBefore = lastRowNode.rowIndex;
|
|
750
|
+
} // we are guaranteed no rows are open. so the difference between the topTopIndex will be the
|
|
751
|
+
// same as the difference between the displayed index
|
|
752
|
+
|
|
753
|
+
|
|
754
|
+
var indexDiff = topLevelIndex - lastRowTopLevelIndex;
|
|
755
|
+
return lastDisplayedNodeIndexInBlockBefore + indexDiff;
|
|
756
|
+
};
|
|
757
|
+
|
|
758
|
+
return this.findBlockAndExecute(matchBlockFunc, blockFoundFunc, blockNotFoundFunc);
|
|
759
|
+
}
|
|
760
|
+
}, {
|
|
761
|
+
key: "addStoreStates",
|
|
762
|
+
value: function addStoreStates(result) {
|
|
763
|
+
result.push({
|
|
764
|
+
infiniteScroll: true,
|
|
765
|
+
route: this.parentRowNode.getGroupKeys(),
|
|
766
|
+
rowCount: this.rowCount,
|
|
767
|
+
lastRowIndexKnown: this.lastRowIndexKnown,
|
|
768
|
+
info: this.info,
|
|
769
|
+
maxBlocksInCache: this.storeParams.maxBlocksInCache,
|
|
770
|
+
cacheBlockSize: this.storeParams.cacheBlockSize
|
|
771
|
+
});
|
|
772
|
+
this.forEachChildStoreShallow(function (childStore) {
|
|
773
|
+
return childStore.addStoreStates(result);
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
}, {
|
|
777
|
+
key: "getCachedBlockHeight",
|
|
778
|
+
value: function getCachedBlockHeight(blockNumber) {
|
|
779
|
+
return this.blockHeights[blockNumber];
|
|
780
|
+
}
|
|
781
|
+
}, {
|
|
782
|
+
key: "createBlock",
|
|
783
|
+
value: function createBlock(blockNumber, displayIndex, nextRowTop) {
|
|
784
|
+
var block = this.createBean(new InfiniteStoreBlock(blockNumber, this.parentRowNode, this.ssrmParams, this.storeParams, this));
|
|
785
|
+
block.setDisplayIndexes(new NumberSequence(displayIndex), nextRowTop);
|
|
786
|
+
this.blocks[block.getId()] = block;
|
|
787
|
+
this.purgeBlocksIfNeeded(block);
|
|
788
|
+
this.rowNodeBlockLoader.addBlock(block);
|
|
789
|
+
return block;
|
|
790
|
+
}
|
|
791
|
+
}, {
|
|
792
|
+
key: "getDisplayIndexEnd",
|
|
793
|
+
value: function getDisplayIndexEnd() {
|
|
794
|
+
return this.displayIndexEnd;
|
|
795
|
+
}
|
|
796
|
+
}, {
|
|
797
|
+
key: "isDisplayIndexInStore",
|
|
798
|
+
value: function isDisplayIndexInStore(displayIndex) {
|
|
799
|
+
if (this.getRowCount() === 0) {
|
|
800
|
+
return false;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
return displayIndex >= this.displayIndexStart && displayIndex < this.displayIndexEnd;
|
|
804
|
+
}
|
|
805
|
+
}, {
|
|
806
|
+
key: "applyTransaction",
|
|
807
|
+
value: function applyTransaction(transaction) {
|
|
808
|
+
return {
|
|
809
|
+
status: ServerSideTransactionResultStatus.StoreWrongType
|
|
810
|
+
};
|
|
811
|
+
}
|
|
812
|
+
}, {
|
|
813
|
+
key: "getChildStore",
|
|
814
|
+
value: function getChildStore(keys) {
|
|
815
|
+
var _this9 = this;
|
|
816
|
+
|
|
817
|
+
var findNodeCallback = function findNodeCallback(key) {
|
|
818
|
+
var nextNode = null;
|
|
819
|
+
|
|
820
|
+
_this9.getBlocksInOrder().forEach(function (block) {
|
|
821
|
+
block.forEachNodeShallow(function (rowNode) {
|
|
822
|
+
if (rowNode.key == key) {
|
|
823
|
+
nextNode = rowNode;
|
|
824
|
+
}
|
|
825
|
+
}, new NumberSequence());
|
|
826
|
+
});
|
|
827
|
+
|
|
828
|
+
return nextNode;
|
|
829
|
+
};
|
|
830
|
+
|
|
831
|
+
return this.storeUtils.getChildStore(keys, this, findNodeCallback);
|
|
832
|
+
}
|
|
833
|
+
}, {
|
|
834
|
+
key: "isPixelInRange",
|
|
835
|
+
value: function isPixelInRange(pixel) {
|
|
836
|
+
if (this.getRowCount() === 0) {
|
|
837
|
+
return false;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
return pixel >= this.cacheTopPixel && pixel < this.cacheTopPixel + this.cacheHeightPixels;
|
|
841
|
+
}
|
|
842
|
+
}, {
|
|
843
|
+
key: "refreshAfterFilter",
|
|
844
|
+
value: function refreshAfterFilter(params) {
|
|
845
|
+
var serverFiltersAllLevels = this.gridOptionsWrapper.isServerSideFilterAllLevels();
|
|
846
|
+
|
|
847
|
+
if (serverFiltersAllLevels || this.storeUtils.isServerRefreshNeeded(this.parentRowNode, this.ssrmParams.rowGroupCols, params)) {
|
|
848
|
+
this.resetStore();
|
|
849
|
+
return;
|
|
850
|
+
} // call refreshAfterSort on children, as we did not purge.
|
|
851
|
+
// if we did purge, no need to do this as all children were destroyed
|
|
852
|
+
|
|
853
|
+
|
|
854
|
+
this.forEachChildStoreShallow(function (store) {
|
|
855
|
+
return store.refreshAfterFilter(params);
|
|
856
|
+
});
|
|
857
|
+
}
|
|
858
|
+
}, {
|
|
859
|
+
key: "refreshAfterSort",
|
|
860
|
+
value: function refreshAfterSort(params) {
|
|
861
|
+
var serverSortsAllLevels = this.gridOptionsWrapper.isServerSideSortAllLevels();
|
|
862
|
+
|
|
863
|
+
if (serverSortsAllLevels || this.storeUtils.isServerRefreshNeeded(this.parentRowNode, this.ssrmParams.rowGroupCols, params)) {
|
|
864
|
+
this.resetStore();
|
|
865
|
+
return;
|
|
866
|
+
} // call refreshAfterSort on children, as we did not purge.
|
|
867
|
+
// if we did purge, no need to do this as all children were destroyed
|
|
868
|
+
|
|
869
|
+
|
|
870
|
+
this.forEachChildStoreShallow(function (store) {
|
|
871
|
+
return store.refreshAfterSort(params);
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
}, {
|
|
875
|
+
key: "forEachChildStoreShallow",
|
|
876
|
+
value: function forEachChildStoreShallow(callback) {
|
|
877
|
+
this.getBlocksInOrder().forEach(function (block) {
|
|
878
|
+
if (block.isGroupLevel()) {
|
|
879
|
+
var innerCallback = function innerCallback(rowNode) {
|
|
880
|
+
var nextCache = rowNode.childStore;
|
|
881
|
+
|
|
882
|
+
if (nextCache) {
|
|
883
|
+
callback(nextCache);
|
|
884
|
+
}
|
|
885
|
+
};
|
|
886
|
+
|
|
887
|
+
block.forEachNodeShallow(innerCallback, new NumberSequence());
|
|
888
|
+
}
|
|
889
|
+
});
|
|
890
|
+
}
|
|
891
|
+
}]);
|
|
892
|
+
|
|
893
|
+
return InfiniteStore;
|
|
894
|
+
}(BeanStub); // this property says how many empty blocks should be in a cache, eg if scrolls down fast and creates 10
|
|
895
|
+
// blocks all for loading, the grid will only load the last 2 - it will assume the blocks the user quickly
|
|
896
|
+
// scrolled over are not needed to be loaded.
|
|
897
|
+
|
|
898
|
+
InfiniteStore.MAX_EMPTY_BLOCKS_TO_KEEP = 2;
|
|
899
|
+
InfiniteStore.INITIAL_ROW_COUNT = 1;
|
|
900
|
+
InfiniteStore.OVERFLOW_SIZE = 1;
|
|
901
|
+
|
|
902
|
+
__decorate([Autowired('rowRenderer')], InfiniteStore.prototype, 'rowRenderer', void 0);
|
|
903
|
+
|
|
904
|
+
__decorate([Autowired('rowNodeBlockLoader')], InfiniteStore.prototype, 'rowNodeBlockLoader', void 0);
|
|
905
|
+
|
|
906
|
+
__decorate([Autowired('ssrmStoreUtils')], InfiniteStore.prototype, 'storeUtils', void 0);
|
|
907
|
+
|
|
908
|
+
__decorate([Autowired('focusService')], InfiniteStore.prototype, 'focusService', void 0);
|
|
909
|
+
|
|
910
|
+
__decorate([Autowired('columnModel')], InfiniteStore.prototype, 'columnModel', void 0);
|
|
911
|
+
|
|
912
|
+
__decorate([Autowired('ssrmBlockUtils')], InfiniteStore.prototype, 'blockUtils', void 0);
|
|
913
|
+
|
|
914
|
+
__decorate([PostConstruct], InfiniteStore.prototype, 'postConstruct', null);
|
|
915
|
+
|
|
916
|
+
__decorate([PreDestroy], InfiniteStore.prototype, 'destroyAllBlocks', null);
|
|
917
|
+
|
|
918
|
+
__decorate([__param(0, Qualifier('loggerFactory'))], InfiniteStore.prototype, 'setBeans', null);
|