@lemon-fe/kits 1.0.0-21 → 1.0.0-210
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 +5 -0
- package/es/components/Actions/index.d.ts +8 -5
- package/es/components/Actions/index.js +44 -28
- package/es/components/Actions/index.less +5 -4
- package/es/components/Alert/index.d.ts +3 -0
- package/es/components/Alert/index.js +23 -0
- package/es/components/BaseTable/Actions.js +2 -2
- package/es/components/BaseTable/VirtualBody.js +2 -2
- package/es/components/BaseTable/index.js +2 -2
- package/es/components/BaseTable/utils.d.ts +1 -1
- package/es/components/DataGrid/cell-editors/Date.d.ts +15 -5
- package/es/components/DataGrid/cell-editors/Date.js +52 -14
- package/es/components/DataGrid/cell-editors/Number.d.ts +14 -6
- package/es/components/DataGrid/cell-editors/Number.js +94 -34
- package/es/components/DataGrid/cell-editors/Row.d.ts +23 -0
- package/es/components/DataGrid/cell-editors/Row.js +146 -0
- package/es/components/DataGrid/cell-editors/Select.d.ts +29 -3
- package/es/components/DataGrid/cell-editors/Select.js +82 -18
- package/es/components/DataGrid/cell-editors/Text.d.ts +7 -5
- package/es/components/DataGrid/cell-editors/Text.js +55 -9
- package/es/components/DataGrid/cell-editors/Wrapper.d.ts +2 -1
- package/es/components/DataGrid/cell-editors/Wrapper.js +4 -2
- package/es/components/DataGrid/cell-editors/utils.d.ts +9 -0
- package/es/components/DataGrid/cell-editors/utils.js +56 -1
- package/es/components/DataGrid/components/CustomColumnPanel/DragContext.d.ts +4 -0
- package/es/components/DataGrid/components/CustomColumnPanel/DragContext.js +3 -0
- package/es/components/DataGrid/components/CustomColumnPanel/FieldModal.d.ts +10 -0
- package/es/components/DataGrid/components/CustomColumnPanel/FieldModal.js +256 -0
- package/es/components/DataGrid/components/CustomColumnPanel/Item.d.ts +14 -0
- package/es/components/DataGrid/components/CustomColumnPanel/Item.js +200 -0
- package/es/components/DataGrid/components/CustomColumnPanel/index.d.ts +5 -0
- package/es/components/DataGrid/components/CustomColumnPanel/index.js +366 -0
- package/es/components/DataGrid/components/CustomColumnPanel/typings.d.ts +25 -0
- package/es/components/DataGrid/components/Search.d.ts +4 -0
- package/es/components/DataGrid/components/Search.js +186 -0
- package/es/components/DataGrid/components/Selected.d.ts +7 -0
- package/es/components/DataGrid/components/Selected.js +32 -0
- package/es/components/DataGrid/context/GridStore.d.ts +4 -0
- package/es/components/DataGrid/context/GridStore.js +4 -0
- package/es/components/DataGrid/hooks.d.ts +18 -0
- package/es/components/DataGrid/hooks.js +46 -3
- package/es/components/DataGrid/index.d.ts +62 -25
- package/es/components/DataGrid/index.js +1288 -503
- package/es/components/DataGrid/index.less +382 -41
- package/es/components/DataGrid/modules/clipboard/clipboard/clipboardService.d.ts +60 -60
- package/es/components/DataGrid/modules/clipboard/clipboard/clipboardService.js +359 -69
- package/es/components/DataGrid/modules/clipboard/clipboardModule.d.ts +2 -7
- package/es/components/DataGrid/modules/clipboard/clipboardModule.js +4 -2
- package/es/components/DataGrid/modules/clipboard/main.d.ts +1 -0
- package/es/components/DataGrid/modules/clipboard/version.d.ts +1 -0
- package/es/components/DataGrid/modules/clipboard/version.js +2 -0
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/columnModelItem.d.ts +24 -30
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/columnModelItem.js +1 -1
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/columnToolPanel.d.ts +30 -49
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/columnToolPanel.js +7 -7
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/modelItemUtils.d.ts +14 -18
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/modelItemUtils.js +7 -7
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/pivotModePanel.d.ts +7 -7
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/pivotModePanel.js +8 -8
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsHeaderPanel.d.ts +28 -28
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsHeaderPanel.js +17 -17
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsListPanel.d.ts +42 -47
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsListPanel.js +8 -8
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsListPanelItemDragFeature.d.ts +24 -24
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsListPanelItemDragFeature.js +6 -6
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsPanel.d.ts +23 -31
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/primaryColsPanel.js +9 -16
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/toolPanelColumnComp.d.ts +35 -41
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/toolPanelColumnComp.js +18 -18
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/toolPanelColumnGroupComp.d.ts +49 -60
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/toolPanelColumnGroupComp.js +21 -20
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/toolPanelContextMenu.d.ts +22 -22
- package/es/components/DataGrid/modules/column-tool-panel/columnToolPanel/toolPanelContextMenu.js +16 -16
- package/es/components/DataGrid/modules/column-tool-panel/columnsToolPanelModule.d.ts +2 -24
- package/es/components/DataGrid/modules/column-tool-panel/columnsToolPanelModule.js +8 -3
- package/es/components/DataGrid/modules/column-tool-panel/main.d.ts +2 -0
- package/es/components/DataGrid/modules/column-tool-panel/version.d.ts +1 -0
- package/es/components/DataGrid/modules/column-tool-panel/version.js +2 -0
- package/es/components/DataGrid/modules/master-detail/main.d.ts +1 -0
- package/es/components/DataGrid/modules/master-detail/main.js +1 -0
- package/es/components/DataGrid/modules/master-detail/masterDetail/detailCellRenderer.d.ts +14 -0
- package/es/components/DataGrid/modules/master-detail/masterDetail/detailCellRenderer.js +170 -0
- package/es/components/DataGrid/modules/master-detail/masterDetail/detailCellRendererCtrl.d.ts +19 -0
- package/es/components/DataGrid/modules/master-detail/masterDetail/detailCellRendererCtrl.js +245 -0
- package/es/components/DataGrid/modules/master-detail/masterDetailModule.d.ts +2 -0
- package/es/components/DataGrid/modules/master-detail/masterDetailModule.js +18 -0
- package/es/components/DataGrid/modules/master-detail/version.d.ts +1 -0
- package/es/components/DataGrid/modules/master-detail/version.js +2 -0
- package/es/components/DataGrid/modules/menu/menu/chartMenuItemMapper.d.ts +13 -0
- package/es/components/DataGrid/modules/menu/menu/chartMenuItemMapper.js +417 -0
- package/es/components/DataGrid/modules/menu/menu/contextMenu.d.ts +11 -24
- package/es/components/DataGrid/modules/menu/menu/contextMenu.js +32 -25
- package/es/components/DataGrid/modules/menu/menu/enterpriseMenu.d.ts +60 -79
- package/es/components/DataGrid/modules/menu/menu/enterpriseMenu.js +182 -129
- package/es/components/DataGrid/modules/menu/menu/menuItemMapper.d.ts +10 -12
- package/es/components/DataGrid/modules/menu/menu/menuItemMapper.js +81 -249
- package/es/components/DataGrid/modules/menu/menuModule.d.ts +2 -8
- package/es/components/DataGrid/modules/menu/menuModule.js +6 -2
- package/es/components/DataGrid/modules/menu/version.d.ts +1 -0
- package/es/components/DataGrid/modules/menu/version.js +2 -0
- package/es/components/DataGrid/modules/row-grouping/main.d.ts +4 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/aggFuncService.js +1 -1
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/aggregationStage.d.ts +3 -1
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/aggregationStage.js +30 -12
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/batchRemover.d.ts +2 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/batchRemover.js +12 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/baseDropZonePanel.d.ts +2 -2
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/baseDropZonePanel.js +12 -10
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/dropZoneColumnComp.js +20 -21
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/gridHeaderDropZones.js +5 -5
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/pivotDropZonePanel.js +7 -7
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/rowGroupDropZonePanel.js +6 -6
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/columnDropZones/valueDropZonePanel.js +6 -6
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/filterAggregatesStage.js +2 -2
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/groupFilter/groupFilter.d.ts +39 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/groupFilter/groupFilter.js +395 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/groupFilter/groupFloatingFilter.d.ts +23 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/groupFilter/groupFloatingFilter.js +207 -0
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/groupStage.d.ts +2 -1
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/groupStage.js +66 -20
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/pivotColDefService.js +8 -8
- package/es/components/DataGrid/modules/row-grouping/rowGrouping/pivotStage.js +19 -15
- package/es/components/DataGrid/modules/row-grouping/rowGroupingModule.d.ts +2 -16
- package/es/components/DataGrid/modules/row-grouping/rowGroupingModule.js +14 -2
- package/es/components/DataGrid/modules/row-grouping/version.d.ts +1 -0
- package/es/components/DataGrid/modules/row-grouping/version.js +2 -0
- package/es/components/DataGrid/modules/side-bar/main.d.ts +2 -0
- package/es/components/DataGrid/modules/side-bar/sideBar/common/toolPanelColDefService.d.ts +9 -9
- package/es/components/DataGrid/modules/side-bar/sideBar/common/toolPanelColDefService.js +3 -8
- package/es/components/DataGrid/modules/side-bar/sideBar/horizontalResizeComp.d.ts +17 -17
- package/es/components/DataGrid/modules/side-bar/sideBar/horizontalResizeComp.js +5 -5
- package/es/components/DataGrid/modules/side-bar/sideBar/sideBarButtonComp.d.ts +14 -14
- package/es/components/DataGrid/modules/side-bar/sideBar/sideBarButtonComp.js +8 -8
- package/es/components/DataGrid/modules/side-bar/sideBar/sideBarButtonsComp.d.ts +14 -14
- package/es/components/DataGrid/modules/side-bar/sideBar/sideBarButtonsComp.js +6 -6
- package/es/components/DataGrid/modules/side-bar/sideBar/sideBarComp.d.ts +26 -27
- package/es/components/DataGrid/modules/side-bar/sideBar/sideBarComp.js +82 -45
- package/es/components/DataGrid/modules/side-bar/sideBar/sideBarDefParser.d.ts +10 -0
- package/es/components/DataGrid/modules/side-bar/sideBar/sideBarDefParser.js +111 -0
- package/es/components/DataGrid/modules/side-bar/sideBar/toolPanelWrapper.d.ts +15 -15
- package/es/components/DataGrid/modules/side-bar/sideBar/toolPanelWrapper.js +5 -5
- package/es/components/DataGrid/modules/side-bar/sideBarModule.d.ts +2 -19
- package/es/components/DataGrid/modules/side-bar/sideBarModule.js +5 -2
- package/es/components/DataGrid/modules/side-bar/version.d.ts +1 -0
- package/es/components/DataGrid/modules/side-bar/version.js +2 -0
- package/es/components/DataGrid/{Actions.d.ts → renderer/Actions.d.ts} +1 -1
- package/es/components/DataGrid/{Actions.js → renderer/Actions.js} +4 -4
- package/es/components/DataGrid/renderer/CellDeleteRenderer.d.ts +5 -0
- package/es/components/DataGrid/renderer/CellDeleteRenderer.js +64 -0
- package/es/components/DataGrid/renderer/CellIndexRenderer.d.ts +4 -0
- package/es/components/DataGrid/renderer/CellIndexRenderer.js +53 -0
- package/es/components/DataGrid/{CellRenderer.d.ts → renderer/CellRenderer.d.ts} +2 -2
- package/es/components/DataGrid/{CellRenderer.js → renderer/CellRenderer.js} +18 -8
- package/es/components/DataGrid/renderer/DetailCellRenderer.d.ts +9 -0
- package/es/components/DataGrid/renderer/DetailCellRenderer.js +71 -0
- package/es/components/DataGrid/{HeaderRenderer.d.ts → renderer/HeaderRenderer.d.ts} +3 -3
- package/es/components/DataGrid/{HeaderRenderer.js → renderer/HeaderRenderer.js} +35 -15
- package/es/components/DataGrid/typings.d.ts +108 -32
- package/es/components/DataGrid/utils.d.ts +13 -6
- package/es/components/DataGrid/utils.js +115 -28
- package/es/components/Dropdown/index.d.ts +7 -8
- package/es/components/Dropdown/index.js +40 -47
- package/es/components/Dropdown/index.less +2 -10
- package/es/components/DurationPicker/index.d.ts +12 -9
- package/es/components/DurationPicker/index.js +87 -57
- package/es/components/DurationPicker/index.less +3 -52
- package/es/components/EditableTable/EditableCell.d.ts +1 -1
- package/es/components/EditableTable/EditableTableFormItem.d.ts +1 -1
- package/es/components/EditableTable/Table.d.ts +1 -1
- package/es/components/EditableTable/Table.js +7 -7
- package/es/components/EditableTable/typings.d.ts +1 -1
- package/es/components/Filter/index.js +157 -98
- package/es/components/Filter/index.less +1 -5
- package/es/components/Filter/typings.d.ts +36 -2
- package/es/components/FormLayout/index.d.ts +5 -1
- package/es/components/FormLayout/index.js +5 -4
- package/es/components/FormLayout/index.less +18 -8
- package/es/components/GreyPanel/index.d.ts +6 -0
- package/es/components/GreyPanel/index.js +20 -0
- package/es/components/GreyPanel/index.less +11 -0
- package/es/components/Icons/Add.d.ts +6 -0
- package/es/components/Icons/Add.js +42 -0
- package/es/components/Icons/BigTip/index.d.ts +1 -1
- package/es/components/Icons/Calendar.d.ts +1 -1
- package/es/components/Icons/Calendar.js +12 -17
- package/es/components/Icons/Clear.d.ts +3 -0
- package/es/components/Icons/Clear.js +21 -0
- package/es/components/Icons/Clock.d.ts +5 -0
- package/es/components/Icons/Clock.js +30 -0
- package/es/components/Icons/Close.d.ts +1 -1
- package/es/components/Icons/CloseLight.d.ts +5 -0
- package/es/components/Icons/CloseLight.js +34 -0
- package/es/components/Icons/CollapseUp.d.ts +1 -1
- package/es/components/Icons/DarkSearch.d.ts +1 -1
- package/es/components/Icons/Delete.d.ts +3 -0
- package/es/components/Icons/Delete.js +40 -0
- package/es/components/Icons/Down.d.ts +3 -5
- package/es/components/Icons/Down.js +5 -15
- package/es/components/Icons/Drag/drag.svg +7 -0
- package/es/components/Icons/Drag/index.d.ts +3 -0
- package/es/components/Icons/Drag/index.js +34 -0
- package/es/components/Icons/LookUp.d.ts +1 -1
- package/es/components/Icons/More.d.ts +3 -5
- package/es/components/Icons/NewTag.d.ts +3 -0
- package/es/components/Icons/NewTag.js +22 -0
- package/es/components/Icons/Plus/index.d.ts +3 -0
- package/es/components/Icons/Plus/index.js +30 -0
- package/es/components/Icons/Plus/plus.svg +6 -0
- package/es/components/Icons/Question.d.ts +3 -0
- package/es/components/Icons/Question.js +21 -0
- package/es/components/Icons/Reload.d.ts +3 -0
- package/es/components/Icons/Reload.js +21 -0
- package/es/components/Icons/Search.d.ts +3 -5
- package/es/components/Icons/Search.js +7 -17
- package/es/components/Icons/Tip.d.ts +4 -5
- package/es/components/Icons/Tip.js +59 -68
- package/es/components/Icons/index.d.ts +27 -7
- package/es/components/Icons/index.js +29 -9
- package/es/components/InputCompact/index.d.ts +11 -0
- package/es/components/InputCompact/index.js +80 -0
- package/es/components/InputCompact/index.less +33 -0
- package/es/components/InputNumber/index.d.ts +8 -0
- package/es/components/InputNumber/index.js +38 -0
- package/es/components/InputNumber/index.less +58 -0
- package/es/components/Layout/index.d.ts +26 -8
- package/es/components/Layout/index.js +159 -54
- package/es/components/Layout/index.less +58 -33
- package/es/components/Popup/index.d.ts +43 -7
- package/es/components/Popup/index.js +183 -89
- package/es/components/Popup/index.less +23 -1
- package/es/components/Portal/index.d.ts +7 -6
- package/es/components/Portal/index.js +57 -12
- package/es/components/Section/TabBar.d.ts +2 -1
- package/es/components/Section/index.d.ts +6 -2
- package/es/components/Section/index.js +30 -23
- package/es/components/Section/index.less +6 -2
- package/es/components/SelectPanel/index.d.ts +17 -0
- package/es/components/SelectPanel/index.js +70 -0
- package/es/components/SelectPanel/index.less +112 -0
- package/es/components/SelectView/index.d.ts +16 -5
- package/es/components/SelectView/index.js +162 -119
- package/es/components/SelectView/index.less +23 -26
- package/es/components/SiderTree/TreeNodeTitle.js +2 -2
- package/es/components/SiderTree/index.d.ts +4 -2
- package/es/components/SiderTree/index.js +50 -71
- package/es/components/SiderTree/index.less +23 -77
- package/es/components/State/index.d.ts +8 -0
- package/es/components/State/index.js +25 -0
- package/es/components/State/index.less +131 -0
- package/es/components/TabBar/index.d.ts +2 -3
- package/es/components/TabBar/index.js +24 -42
- package/es/components/TabBar/index.less +2 -28
- package/es/components/Table/typings.d.ts +1 -2
- package/es/components/Table/utils.d.ts +1 -1
- package/es/components/TipMark/index.d.ts +8 -0
- package/es/components/{DataGrid/cell-editors/Custom.js → TipMark/index.js} +40 -12
- package/es/components/utils.d.ts +1 -1
- package/es/components/utils.js +2 -2
- package/es/hooks/useBatchOperator/index.d.ts +83 -10
- package/es/hooks/useBatchOperator/index.js +644 -300
- package/es/hooks/useHistoryBlock/index.d.ts +8 -0
- package/es/hooks/useHistoryBlock/index.js +30 -0
- package/es/index.d.ts +20 -4
- package/es/index.js +15 -2
- package/es/index.less +5 -0
- package/es/init.js +82 -24
- package/es/layouts/BasicLayout/components/Main.js +37 -4
- package/es/layouts/BasicLayout/components/MainFramework/components/Menu/index.js +23 -22
- package/es/layouts/BasicLayout/components/MainFramework/index.less +19 -0
- package/es/layouts/BasicLayout/typings.d.ts +3 -3
- package/es/layouts/Breadcrumb/index.d.ts +13 -5
- package/es/layouts/Breadcrumb/index.js +31 -10
- package/es/layouts/Breadcrumb/index.less +5 -1
- package/es/layouts/MicroLayout/index.js +69 -5
- package/es/layouts/MicroLayout/typings.d.ts +5 -3
- package/es/layouts/TabInstance.d.ts +31 -0
- package/es/layouts/TabInstance.js +115 -0
- package/es/layouts/components/RouteTab.d.ts +7 -3
- package/es/layouts/components/RouteTab.js +6 -2
- package/es/layouts/typings.d.ts +0 -2
- package/es/layouts/utils.d.ts +1 -1
- package/es/layouts/utils.js +4 -4
- package/es/styles/empty.png +0 -0
- package/es/styles/overrides.less +203 -59
- package/es/styles/theme.less +21 -1
- package/es/styles/utils.less +18 -18
- package/package.json +28 -12
- package/es/components/DataGrid/GridContext.d.ts +0 -4
- package/es/components/DataGrid/GridContext.js +0 -4
- package/es/components/DataGrid/cell-editors/Custom.d.ts +0 -9
- package/es/components/DataGrid/empty.png +0 -0
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/clientSideNodeManager.d.ts +0 -35
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/clientSideNodeManager.js +0 -378
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/clientSideRowModel.d.ts +0 -99
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/clientSideRowModel.js +0 -1160
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/filterService.d.ts +0 -7
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/filterService.js +0 -137
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/filterStage.d.ts +0 -5
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/filterStage.js +0 -60
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/flattenStage.d.ts +0 -10
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/flattenStage.js +0 -199
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/immutableService.d.ts +0 -13
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/immutableService.js +0 -175
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/sortService.d.ts +0 -14
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/sortService.js +0 -330
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/sortStage.d.ts +0 -7
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModel/sortStage.js +0 -75
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModelModule.d.ts +0 -2
- package/es/components/DataGrid/modules/client-side-row-model/clientSideRowModelModule.js +0 -15
- package/es/components/DataGrid/modules/client-side-row-model/index.d.ts +0 -1
- package/es/components/DataGrid/modules/client-side-row-model/index.js +0 -1
- package/es/components/DataGrid/modules/clipboard/index.d.ts +0 -1
- package/es/components/DataGrid/modules/column-tool-panel/index.d.ts +0 -2
- package/es/components/DataGrid/modules/row-grouping/index.d.ts +0 -4
- package/es/components/DataGrid/modules/server-side-row-model/index.d.ts +0 -1
- package/es/components/DataGrid/modules/server-side-row-model/index.js +0 -1
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/blocks/blockUtils.d.ts +0 -47
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/blocks/blockUtils.js +0 -444
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/blocks/infiniteStoreBlock.d.ts +0 -92
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/blocks/infiniteStoreBlock.js +0 -510
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/expandListener.d.ts +0 -9
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/expandListener.js +0 -115
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/filterListener.d.ts +0 -9
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/filterListener.js +0 -114
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/listenerUtils.d.ts +0 -5
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/listenerUtils.js +0 -68
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/sortListener.d.ts +0 -13
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/listeners/sortListener.js +0 -194
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/nodeManager.d.ts +0 -7
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/nodeManager.js +0 -63
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/serverSideRowModel.d.ts +0 -88
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/serverSideRowModel.js +0 -572
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/fullStore.d.ts +0 -108
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/fullStore.js +0 -876
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/infiniteStore.d.ts +0 -102
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/infiniteStore.js +0 -918
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/storeFactory.d.ts +0 -12
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/storeFactory.js +0 -141
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/storeUtils.d.ts +0 -35
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/stores/storeUtils.js +0 -154
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/transactionManager.d.ts +0 -23
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModel/transactionManager.js +0 -210
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModelModule.d.ts +0 -18
- package/es/components/DataGrid/modules/server-side-row-model/serverSideRowModelModule.js +0 -18
- package/es/components/DataGrid/modules/side-bar/index.d.ts +0 -2
- /package/es/components/DataGrid/modules/clipboard/{index.js → main.js} +0 -0
- /package/es/components/DataGrid/modules/column-tool-panel/{index.js → main.js} +0 -0
- /package/es/components/DataGrid/modules/menu/{index.d.ts → main.d.ts} +0 -0
- /package/es/components/DataGrid/modules/menu/{index.js → main.js} +0 -0
- /package/es/components/DataGrid/modules/row-grouping/{index.js → main.js} +0 -0
- /package/es/components/DataGrid/modules/side-bar/{index.js → main.js} +0 -0
|
@@ -1,1160 +0,0 @@
|
|
|
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
|
-
import { _, Autowired, Bean, BeanStub, ChangedPath, Constants, Events, GridOptionsWrapper, Optional, PostConstruct, ClientSideRowModelSteps, RowNode, RowHighlightPosition } from "@ag-grid-community/core";
|
|
34
|
-
import { ClientSideNodeManager } from "./clientSideNodeManager";
|
|
35
|
-
var RecursionType;
|
|
36
|
-
|
|
37
|
-
(function (RecursionType) {
|
|
38
|
-
RecursionType[RecursionType["Normal"] = 0] = "Normal";
|
|
39
|
-
RecursionType[RecursionType["AfterFilter"] = 1] = "AfterFilter";
|
|
40
|
-
RecursionType[RecursionType["AfterFilterAndSort"] = 2] = "AfterFilterAndSort";
|
|
41
|
-
RecursionType[RecursionType["PivotNodes"] = 3] = "PivotNodes";
|
|
42
|
-
})(RecursionType || (RecursionType = {}));
|
|
43
|
-
|
|
44
|
-
var ClientSideRowModel = /*#__PURE__*/function (_BeanStub) {
|
|
45
|
-
_inherits(ClientSideRowModel, _BeanStub);
|
|
46
|
-
|
|
47
|
-
var _super = _createSuper(ClientSideRowModel);
|
|
48
|
-
|
|
49
|
-
function ClientSideRowModel() {
|
|
50
|
-
var _this;
|
|
51
|
-
|
|
52
|
-
_classCallCheck(this, ClientSideRowModel);
|
|
53
|
-
|
|
54
|
-
_this = _super.apply(this, arguments);
|
|
55
|
-
_this.onRowHeightChanged_debounced = _.debounce(_this.onRowHeightChanged.bind(_assertThisInitialized(_this)), 100);
|
|
56
|
-
_this.rowsToDisplay = []; // the rows mapped to rows to display
|
|
57
|
-
|
|
58
|
-
return _this;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
_createClass(ClientSideRowModel, [{
|
|
62
|
-
key: "init",
|
|
63
|
-
value: function init() {
|
|
64
|
-
var refreshEverythingFunc = this.refreshModel.bind(this, {
|
|
65
|
-
step: ClientSideRowModelSteps.EVERYTHING
|
|
66
|
-
});
|
|
67
|
-
var animate = !this.gridOptionsWrapper.isSuppressAnimationFrame();
|
|
68
|
-
var refreshEverythingAfterColsChangedFunc = this.refreshModel.bind(this, {
|
|
69
|
-
step: ClientSideRowModelSteps.EVERYTHING,
|
|
70
|
-
afterColumnsChanged: true,
|
|
71
|
-
keepRenderedRows: true,
|
|
72
|
-
animate: animate
|
|
73
|
-
});
|
|
74
|
-
this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, refreshEverythingAfterColsChangedFunc);
|
|
75
|
-
this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, refreshEverythingFunc);
|
|
76
|
-
this.addManagedListener(this.eventService, Events.EVENT_COLUMN_VALUE_CHANGED, this.onValueChanged.bind(this));
|
|
77
|
-
this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_CHANGED, this.refreshModel.bind(this, {
|
|
78
|
-
step: ClientSideRowModelSteps.PIVOT
|
|
79
|
-
})); // this.addManagedListener(this.eventService, Events.EVENT_FILTER_CHANGED, this.onFilterChanged.bind(this));
|
|
80
|
-
// this.addManagedListener(this.eventService, Events.EVENT_SORT_CHANGED, this.onSortChanged.bind(this));
|
|
81
|
-
|
|
82
|
-
this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, refreshEverythingFunc);
|
|
83
|
-
var refreshMapListener = this.refreshModel.bind(this, {
|
|
84
|
-
step: ClientSideRowModelSteps.MAP,
|
|
85
|
-
keepRenderedRows: true,
|
|
86
|
-
animate: animate
|
|
87
|
-
});
|
|
88
|
-
this.addManagedListener(this.gridOptionsWrapper, GridOptionsWrapper.PROP_GROUP_REMOVE_SINGLE_CHILDREN, refreshMapListener);
|
|
89
|
-
this.addManagedListener(this.gridOptionsWrapper, GridOptionsWrapper.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN, refreshMapListener);
|
|
90
|
-
this.rootNode = new RowNode(this.beans);
|
|
91
|
-
this.nodeManager = new ClientSideNodeManager(this.rootNode, this.gridOptionsWrapper, this.eventService, this.columnModel, this.selectionService, this.beans);
|
|
92
|
-
}
|
|
93
|
-
}, {
|
|
94
|
-
key: "start",
|
|
95
|
-
value: function start() {
|
|
96
|
-
var rowData = this.gridOptionsWrapper.getRowData();
|
|
97
|
-
|
|
98
|
-
if (rowData) {
|
|
99
|
-
this.setRowData(rowData);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}, {
|
|
103
|
-
key: "ensureRowHeightsValid",
|
|
104
|
-
value: function ensureRowHeightsValid(startPixel, endPixel, startLimitIndex, endLimitIndex) {
|
|
105
|
-
var atLeastOneChange;
|
|
106
|
-
var res = false; // we do this multiple times as changing the row heights can also change the first and last rows,
|
|
107
|
-
// so the first pass can make lots of rows smaller, which means the second pass we end up changing
|
|
108
|
-
// more rows.
|
|
109
|
-
|
|
110
|
-
do {
|
|
111
|
-
atLeastOneChange = false;
|
|
112
|
-
var rowAtStartPixel = this.getRowIndexAtPixel(startPixel);
|
|
113
|
-
var rowAtEndPixel = this.getRowIndexAtPixel(endPixel); // keep check to current page if doing pagination
|
|
114
|
-
|
|
115
|
-
var firstRow = Math.max(rowAtStartPixel, startLimitIndex);
|
|
116
|
-
var lastRow = Math.min(rowAtEndPixel, endLimitIndex);
|
|
117
|
-
|
|
118
|
-
for (var rowIndex = firstRow; rowIndex <= lastRow; rowIndex++) {
|
|
119
|
-
var rowNode = this.getRow(rowIndex);
|
|
120
|
-
|
|
121
|
-
if (rowNode.rowHeightEstimated) {
|
|
122
|
-
var rowHeight = this.gridOptionsWrapper.getRowHeightForNode(rowNode);
|
|
123
|
-
rowNode.setRowHeight(rowHeight.height);
|
|
124
|
-
atLeastOneChange = true;
|
|
125
|
-
res = true;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if (atLeastOneChange) {
|
|
130
|
-
this.setRowTopAndRowIndex();
|
|
131
|
-
}
|
|
132
|
-
} while (atLeastOneChange);
|
|
133
|
-
|
|
134
|
-
return res;
|
|
135
|
-
}
|
|
136
|
-
}, {
|
|
137
|
-
key: "setRowTopAndRowIndex",
|
|
138
|
-
value: function setRowTopAndRowIndex() {
|
|
139
|
-
var defaultRowHeight = this.gridOptionsWrapper.getDefaultRowHeight();
|
|
140
|
-
var nextRowTop = 0; // mapping displayed rows is not needed for this method, however it's used in
|
|
141
|
-
// clearRowTopAndRowIndex(), and given we are looping through this.rowsToDisplay here,
|
|
142
|
-
// we create the map here for performance reasons, so we don't loop a second time
|
|
143
|
-
// in clearRowTopAndRowIndex()
|
|
144
|
-
|
|
145
|
-
var displayedRowsMapped = new Set(); // we don't estimate if doing fullHeight or autoHeight, as all rows get rendered all the time
|
|
146
|
-
// with these two layouts.
|
|
147
|
-
|
|
148
|
-
var allowEstimate = this.gridOptionsWrapper.getDomLayout() === Constants.DOM_LAYOUT_NORMAL;
|
|
149
|
-
|
|
150
|
-
for (var i = 0; i < this.rowsToDisplay.length; i++) {
|
|
151
|
-
var rowNode = this.rowsToDisplay[i];
|
|
152
|
-
|
|
153
|
-
if (rowNode.id != null) {
|
|
154
|
-
displayedRowsMapped.add(rowNode.id);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
if (rowNode.rowHeight == null) {
|
|
158
|
-
var rowHeight = this.gridOptionsWrapper.getRowHeightForNode(rowNode, allowEstimate, defaultRowHeight);
|
|
159
|
-
rowNode.setRowHeight(rowHeight.height, rowHeight.estimated);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
rowNode.setRowTop(nextRowTop);
|
|
163
|
-
rowNode.setRowIndex(i);
|
|
164
|
-
nextRowTop += rowNode.rowHeight;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
return displayedRowsMapped;
|
|
168
|
-
}
|
|
169
|
-
}, {
|
|
170
|
-
key: "clearRowTopAndRowIndex",
|
|
171
|
-
value: function clearRowTopAndRowIndex(changedPath, displayedRowsMapped) {
|
|
172
|
-
var changedPathActive = changedPath.isActive();
|
|
173
|
-
|
|
174
|
-
var clearIfNotDisplayed = function clearIfNotDisplayed(rowNode) {
|
|
175
|
-
if (rowNode && rowNode.id != null && !displayedRowsMapped.has(rowNode.id)) {
|
|
176
|
-
rowNode.clearRowTopAndRowIndex();
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
var recurse = function recurse(rowNode) {
|
|
181
|
-
clearIfNotDisplayed(rowNode);
|
|
182
|
-
clearIfNotDisplayed(rowNode.detailNode);
|
|
183
|
-
clearIfNotDisplayed(rowNode.sibling);
|
|
184
|
-
|
|
185
|
-
if (rowNode.hasChildren()) {
|
|
186
|
-
if (rowNode.childrenAfterGroup) {
|
|
187
|
-
// if a changedPath is active, it means we are here because of a transaction update or
|
|
188
|
-
// a change detection. neither of these impacts the open/closed state of groups. so if
|
|
189
|
-
// a group is not open this time, it was not open last time. so we know all closed groups
|
|
190
|
-
// already have their top positions cleared. so there is no need to traverse all the way
|
|
191
|
-
// when changedPath is active and the rowNode is not expanded.
|
|
192
|
-
var isRootNode = rowNode.level == -1; // we need to give special consideration for root node,
|
|
193
|
-
// as expanded=undefined for root node
|
|
194
|
-
|
|
195
|
-
var skipChildren = changedPathActive && !isRootNode && !rowNode.expanded;
|
|
196
|
-
|
|
197
|
-
if (!skipChildren) {
|
|
198
|
-
rowNode.childrenAfterGroup.forEach(recurse);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
recurse(this.rootNode);
|
|
205
|
-
} // returns false if row was moved, otherwise true
|
|
206
|
-
|
|
207
|
-
}, {
|
|
208
|
-
key: "ensureRowsAtPixel",
|
|
209
|
-
value: function ensureRowsAtPixel(rowNodes, pixel) {
|
|
210
|
-
var _this2 = this;
|
|
211
|
-
|
|
212
|
-
var increment = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
213
|
-
var indexAtPixelNow = this.getRowIndexAtPixel(pixel);
|
|
214
|
-
var rowNodeAtPixelNow = this.getRow(indexAtPixelNow);
|
|
215
|
-
var animate = !this.gridOptionsWrapper.isSuppressAnimationFrame();
|
|
216
|
-
|
|
217
|
-
if (rowNodeAtPixelNow === rowNodes[0]) {
|
|
218
|
-
return false;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
rowNodes.forEach(function (rowNode) {
|
|
222
|
-
_.removeFromArray(_this2.rootNode.allLeafChildren, rowNode);
|
|
223
|
-
});
|
|
224
|
-
rowNodes.forEach(function (rowNode, idx) {
|
|
225
|
-
_.insertIntoArray(_this2.rootNode.allLeafChildren, rowNode, Math.max(indexAtPixelNow + increment, 0) + idx);
|
|
226
|
-
});
|
|
227
|
-
this.refreshModel({
|
|
228
|
-
step: ClientSideRowModelSteps.EVERYTHING,
|
|
229
|
-
keepRenderedRows: true,
|
|
230
|
-
keepEditingRows: true,
|
|
231
|
-
animate: animate
|
|
232
|
-
});
|
|
233
|
-
return true;
|
|
234
|
-
}
|
|
235
|
-
}, {
|
|
236
|
-
key: "highlightRowAtPixel",
|
|
237
|
-
value: function highlightRowAtPixel(rowNode, pixel) {
|
|
238
|
-
var indexAtPixelNow = pixel != null ? this.getRowIndexAtPixel(pixel) : null;
|
|
239
|
-
var rowNodeAtPixelNow = indexAtPixelNow != null ? this.getRow(indexAtPixelNow) : null;
|
|
240
|
-
|
|
241
|
-
if (!rowNodeAtPixelNow || !rowNode || rowNodeAtPixelNow === rowNode || pixel == null) {
|
|
242
|
-
if (this.lastHighlightedRow) {
|
|
243
|
-
this.lastHighlightedRow.setHighlighted(null);
|
|
244
|
-
this.lastHighlightedRow = null;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
return;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
var highlight = this.getHighlightPosition(pixel, rowNodeAtPixelNow);
|
|
251
|
-
|
|
252
|
-
if (this.lastHighlightedRow && this.lastHighlightedRow !== rowNodeAtPixelNow) {
|
|
253
|
-
this.lastHighlightedRow.setHighlighted(null);
|
|
254
|
-
this.lastHighlightedRow = null;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
rowNodeAtPixelNow.setHighlighted(highlight);
|
|
258
|
-
this.lastHighlightedRow = rowNodeAtPixelNow;
|
|
259
|
-
}
|
|
260
|
-
}, {
|
|
261
|
-
key: "getHighlightPosition",
|
|
262
|
-
value: function getHighlightPosition(pixel, rowNode) {
|
|
263
|
-
if (!rowNode) {
|
|
264
|
-
var index = this.getRowIndexAtPixel(pixel);
|
|
265
|
-
rowNode = this.getRow(index || 0);
|
|
266
|
-
|
|
267
|
-
if (!rowNode) {
|
|
268
|
-
return RowHighlightPosition.Below;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
var _rowNode = rowNode,
|
|
273
|
-
rowTop = _rowNode.rowTop,
|
|
274
|
-
rowHeight = _rowNode.rowHeight;
|
|
275
|
-
return pixel - rowTop < rowHeight / 2 ? RowHighlightPosition.Above : RowHighlightPosition.Below;
|
|
276
|
-
}
|
|
277
|
-
}, {
|
|
278
|
-
key: "getLastHighlightedRowNode",
|
|
279
|
-
value: function getLastHighlightedRowNode() {
|
|
280
|
-
return this.lastHighlightedRow;
|
|
281
|
-
}
|
|
282
|
-
}, {
|
|
283
|
-
key: "isLastRowIndexKnown",
|
|
284
|
-
value: function isLastRowIndexKnown() {
|
|
285
|
-
return true;
|
|
286
|
-
}
|
|
287
|
-
}, {
|
|
288
|
-
key: "getRowCount",
|
|
289
|
-
value: function getRowCount() {
|
|
290
|
-
if (this.rowsToDisplay) {
|
|
291
|
-
return this.rowsToDisplay.length;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
return 0;
|
|
295
|
-
}
|
|
296
|
-
}, {
|
|
297
|
-
key: "getTopLevelRowCount",
|
|
298
|
-
value: function getTopLevelRowCount() {
|
|
299
|
-
var showingRootNode = this.rowsToDisplay && this.rowsToDisplay[0] === this.rootNode;
|
|
300
|
-
|
|
301
|
-
if (showingRootNode) {
|
|
302
|
-
return 1;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
var filteredChildren = this.rootNode.childrenAfterAggFilter;
|
|
306
|
-
return filteredChildren ? filteredChildren.length : 0;
|
|
307
|
-
}
|
|
308
|
-
}, {
|
|
309
|
-
key: "getTopLevelRowDisplayedIndex",
|
|
310
|
-
value: function getTopLevelRowDisplayedIndex(topLevelIndex) {
|
|
311
|
-
var showingRootNode = this.rowsToDisplay && this.rowsToDisplay[0] === this.rootNode;
|
|
312
|
-
|
|
313
|
-
if (showingRootNode) {
|
|
314
|
-
return topLevelIndex;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
var rowNode = this.rootNode.childrenAfterSort[topLevelIndex];
|
|
318
|
-
|
|
319
|
-
if (this.gridOptionsWrapper.isGroupHideOpenParents()) {
|
|
320
|
-
// if hideOpenParents, and this row open, then this row is now displayed at this index, first child is
|
|
321
|
-
while (rowNode.expanded && rowNode.childrenAfterSort && rowNode.childrenAfterSort.length > 0) {
|
|
322
|
-
rowNode = rowNode.childrenAfterSort[0];
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
return rowNode.rowIndex;
|
|
327
|
-
}
|
|
328
|
-
}, {
|
|
329
|
-
key: "getRowBounds",
|
|
330
|
-
value: function getRowBounds(index) {
|
|
331
|
-
if (_.missing(this.rowsToDisplay)) {
|
|
332
|
-
return null;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
var rowNode = this.rowsToDisplay[index];
|
|
336
|
-
|
|
337
|
-
if (rowNode) {
|
|
338
|
-
return {
|
|
339
|
-
rowTop: rowNode.rowTop,
|
|
340
|
-
rowHeight: rowNode.rowHeight
|
|
341
|
-
};
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
return null;
|
|
345
|
-
}
|
|
346
|
-
}, {
|
|
347
|
-
key: "onRowGroupOpened",
|
|
348
|
-
value: function onRowGroupOpened() {
|
|
349
|
-
var animate = this.gridOptionsWrapper.isAnimateRows();
|
|
350
|
-
this.refreshModel({
|
|
351
|
-
step: ClientSideRowModelSteps.MAP,
|
|
352
|
-
keepRenderedRows: true,
|
|
353
|
-
animate: animate
|
|
354
|
-
});
|
|
355
|
-
}
|
|
356
|
-
}, {
|
|
357
|
-
key: "onFilterChanged",
|
|
358
|
-
value: function onFilterChanged(event) {
|
|
359
|
-
if (event.afterDataChange) {
|
|
360
|
-
return;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
var animate = this.gridOptionsWrapper.isAnimateRows();
|
|
364
|
-
var primaryOrQuickFilterChanged = event.columns.length === 0 || event.columns.some(function (col) {
|
|
365
|
-
return col.isPrimary();
|
|
366
|
-
});
|
|
367
|
-
var step = primaryOrQuickFilterChanged ? ClientSideRowModelSteps.FILTER : ClientSideRowModelSteps.FILTER_AGGREGATES;
|
|
368
|
-
this.refreshModel({
|
|
369
|
-
step: step,
|
|
370
|
-
keepRenderedRows: true,
|
|
371
|
-
animate: animate
|
|
372
|
-
});
|
|
373
|
-
}
|
|
374
|
-
}, {
|
|
375
|
-
key: "onSortChanged",
|
|
376
|
-
value: function onSortChanged() {
|
|
377
|
-
var animate = this.gridOptionsWrapper.isAnimateRows();
|
|
378
|
-
this.refreshModel({
|
|
379
|
-
step: ClientSideRowModelSteps.SORT,
|
|
380
|
-
keepRenderedRows: true,
|
|
381
|
-
animate: animate,
|
|
382
|
-
keepEditingRows: true
|
|
383
|
-
});
|
|
384
|
-
}
|
|
385
|
-
}, {
|
|
386
|
-
key: "getType",
|
|
387
|
-
value: function getType() {
|
|
388
|
-
return Constants.ROW_MODEL_TYPE_CLIENT_SIDE;
|
|
389
|
-
}
|
|
390
|
-
}, {
|
|
391
|
-
key: "onValueChanged",
|
|
392
|
-
value: function onValueChanged() {
|
|
393
|
-
if (this.columnModel.isPivotActive()) {
|
|
394
|
-
this.refreshModel({
|
|
395
|
-
step: ClientSideRowModelSteps.PIVOT
|
|
396
|
-
});
|
|
397
|
-
} else {
|
|
398
|
-
this.refreshModel({
|
|
399
|
-
step: ClientSideRowModelSteps.AGGREGATE
|
|
400
|
-
});
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
}, {
|
|
404
|
-
key: "createChangePath",
|
|
405
|
-
value: function createChangePath(rowNodeTransactions) {
|
|
406
|
-
// for updates, if the row is updated at all, then we re-calc all the values
|
|
407
|
-
// in that row. we could compare each value to each old value, however if we
|
|
408
|
-
// did this, we would be calling the valueService twice, once on the old value
|
|
409
|
-
// and once on the new value. so it's less valueGetter calls if we just assume
|
|
410
|
-
// each column is different. that way the changedPath is used so that only
|
|
411
|
-
// the impacted parent rows are recalculated, parents who's children have
|
|
412
|
-
// not changed are not impacted.
|
|
413
|
-
var noTransactions = _.missingOrEmpty(rowNodeTransactions);
|
|
414
|
-
|
|
415
|
-
var changedPath = new ChangedPath(false, this.rootNode);
|
|
416
|
-
|
|
417
|
-
if (noTransactions || this.gridOptionsWrapper.isTreeData()) {
|
|
418
|
-
changedPath.setInactive();
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
return changedPath;
|
|
422
|
-
}
|
|
423
|
-
}, {
|
|
424
|
-
key: "isSuppressModelUpdateAfterUpdateTransaction",
|
|
425
|
-
value: function isSuppressModelUpdateAfterUpdateTransaction(params) {
|
|
426
|
-
if (!this.gridOptionsWrapper.isSuppressModelUpdateAfterUpdateTransaction()) {
|
|
427
|
-
return false;
|
|
428
|
-
} // return true if we are only doing update transactions
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
if (params.rowNodeTransactions == null) {
|
|
432
|
-
return false;
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
var transWithAddsOrDeletes = params.rowNodeTransactions.filter(function (tx) {
|
|
436
|
-
return tx.add != null && tx.add.length > 0 || tx.remove != null && tx.remove.length > 0;
|
|
437
|
-
});
|
|
438
|
-
var transactionsContainUpdatesOnly = transWithAddsOrDeletes == null || transWithAddsOrDeletes.length == 0;
|
|
439
|
-
return transactionsContainUpdatesOnly;
|
|
440
|
-
}
|
|
441
|
-
}, {
|
|
442
|
-
key: "refreshModel",
|
|
443
|
-
value: function refreshModel(params) {
|
|
444
|
-
if (this.isSuppressModelUpdateAfterUpdateTransaction(params)) {
|
|
445
|
-
return;
|
|
446
|
-
} // this goes through the pipeline of stages. what's in my head is similar
|
|
447
|
-
// to the diagram on this page:
|
|
448
|
-
// http://commons.apache.org/sandbox/commons-pipeline/pipeline_basics.html
|
|
449
|
-
// however we want to keep the results of each stage, hence we manually call
|
|
450
|
-
// each step rather than have them chain each other.
|
|
451
|
-
// fallthrough in below switch is on purpose,
|
|
452
|
-
// eg if STEP_FILTER, then all steps below this
|
|
453
|
-
// step get done
|
|
454
|
-
// let start: number;
|
|
455
|
-
// console.log('======= start =======');
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
var changedPath = this.createChangePath(params.rowNodeTransactions);
|
|
459
|
-
|
|
460
|
-
switch (params.step) {
|
|
461
|
-
case ClientSideRowModelSteps.EVERYTHING:
|
|
462
|
-
this.doRowGrouping(params.groupState, params.rowNodeTransactions, params.rowNodeOrder, changedPath, !!params.afterColumnsChanged);
|
|
463
|
-
|
|
464
|
-
case ClientSideRowModelSteps.FILTER:
|
|
465
|
-
this.doFilter(changedPath);
|
|
466
|
-
|
|
467
|
-
case ClientSideRowModelSteps.PIVOT:
|
|
468
|
-
this.doPivot(changedPath);
|
|
469
|
-
|
|
470
|
-
case ClientSideRowModelSteps.AGGREGATE:
|
|
471
|
-
// depends on agg fields
|
|
472
|
-
this.doAggregate(changedPath);
|
|
473
|
-
|
|
474
|
-
case ClientSideRowModelSteps.FILTER_AGGREGATES:
|
|
475
|
-
this.doFilterAggregates(changedPath);
|
|
476
|
-
|
|
477
|
-
case ClientSideRowModelSteps.SORT:
|
|
478
|
-
this.doSort(params.rowNodeTransactions, changedPath);
|
|
479
|
-
|
|
480
|
-
case ClientSideRowModelSteps.MAP:
|
|
481
|
-
this.doRowsToDisplay();
|
|
482
|
-
} // set all row tops to null, then set row tops on all visible rows. if we don't
|
|
483
|
-
// do this, then the algorithm below only sets row tops, old row tops from old rows
|
|
484
|
-
// will still lie around
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
var displayedNodesMapped = this.setRowTopAndRowIndex();
|
|
488
|
-
this.clearRowTopAndRowIndex(changedPath, displayedNodesMapped);
|
|
489
|
-
var event = {
|
|
490
|
-
type: Events.EVENT_MODEL_UPDATED,
|
|
491
|
-
animate: params.animate,
|
|
492
|
-
keepRenderedRows: params.keepRenderedRows,
|
|
493
|
-
newData: params.newData,
|
|
494
|
-
newPage: false,
|
|
495
|
-
keepUndoRedoStack: params.keepUndoRedoStack
|
|
496
|
-
};
|
|
497
|
-
this.eventService.dispatchEvent(event);
|
|
498
|
-
}
|
|
499
|
-
}, {
|
|
500
|
-
key: "isEmpty",
|
|
501
|
-
value: function isEmpty() {
|
|
502
|
-
var rowsMissing = _.missing(this.rootNode.allLeafChildren) || this.rootNode.allLeafChildren.length === 0;
|
|
503
|
-
return _.missing(this.rootNode) || rowsMissing || !this.columnModel.isReady();
|
|
504
|
-
}
|
|
505
|
-
}, {
|
|
506
|
-
key: "isRowsToRender",
|
|
507
|
-
value: function isRowsToRender() {
|
|
508
|
-
return _.exists(this.rowsToDisplay) && this.rowsToDisplay.length > 0;
|
|
509
|
-
}
|
|
510
|
-
}, {
|
|
511
|
-
key: "getNodesInRangeForSelection",
|
|
512
|
-
value: function getNodesInRangeForSelection(firstInRange, lastInRange) {
|
|
513
|
-
// if lastSelectedNode is missing, we start at the first row
|
|
514
|
-
var firstRowHit = !lastInRange;
|
|
515
|
-
var lastRowHit = false;
|
|
516
|
-
var lastRow;
|
|
517
|
-
var result = [];
|
|
518
|
-
var groupsSelectChildren = this.gridOptionsWrapper.isGroupSelectsChildren();
|
|
519
|
-
this.forEachNodeAfterFilterAndSort(function (rowNode) {
|
|
520
|
-
var lookingForLastRow = firstRowHit && !lastRowHit; // check if we need to flip the select switch
|
|
521
|
-
|
|
522
|
-
if (!firstRowHit) {
|
|
523
|
-
if (rowNode === lastInRange || rowNode === firstInRange) {
|
|
524
|
-
firstRowHit = true;
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
var skipThisGroupNode = rowNode.group && groupsSelectChildren;
|
|
529
|
-
|
|
530
|
-
if (!skipThisGroupNode) {
|
|
531
|
-
var inRange = firstRowHit && !lastRowHit;
|
|
532
|
-
var childOfLastRow = rowNode.isParentOfNode(lastRow);
|
|
533
|
-
|
|
534
|
-
if (inRange || childOfLastRow) {
|
|
535
|
-
result.push(rowNode);
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
if (lookingForLastRow) {
|
|
540
|
-
if (rowNode === lastInRange || rowNode === firstInRange) {
|
|
541
|
-
lastRowHit = true;
|
|
542
|
-
|
|
543
|
-
if (rowNode === lastInRange) {
|
|
544
|
-
lastRow = lastInRange;
|
|
545
|
-
} else {
|
|
546
|
-
lastRow = firstInRange;
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
});
|
|
551
|
-
return result;
|
|
552
|
-
}
|
|
553
|
-
}, {
|
|
554
|
-
key: "setDatasource",
|
|
555
|
-
value: function setDatasource(datasource) {
|
|
556
|
-
console.error('AG Grid: should never call setDatasource on clientSideRowController');
|
|
557
|
-
}
|
|
558
|
-
}, {
|
|
559
|
-
key: "getTopLevelNodes",
|
|
560
|
-
value: function getTopLevelNodes() {
|
|
561
|
-
return this.rootNode ? this.rootNode.childrenAfterGroup : null;
|
|
562
|
-
}
|
|
563
|
-
}, {
|
|
564
|
-
key: "getRootNode",
|
|
565
|
-
value: function getRootNode() {
|
|
566
|
-
return this.rootNode;
|
|
567
|
-
}
|
|
568
|
-
}, {
|
|
569
|
-
key: "getRow",
|
|
570
|
-
value: function getRow(index) {
|
|
571
|
-
return this.rowsToDisplay[index];
|
|
572
|
-
}
|
|
573
|
-
}, {
|
|
574
|
-
key: "isRowPresent",
|
|
575
|
-
value: function isRowPresent(rowNode) {
|
|
576
|
-
return this.rowsToDisplay.indexOf(rowNode) >= 0;
|
|
577
|
-
}
|
|
578
|
-
}, {
|
|
579
|
-
key: "getRowIndexAtPixel",
|
|
580
|
-
value: function getRowIndexAtPixel(pixelToMatch) {
|
|
581
|
-
if (this.isEmpty() || this.rowsToDisplay.length === 0) {
|
|
582
|
-
return -1;
|
|
583
|
-
} // do binary search of tree
|
|
584
|
-
// http://oli.me.uk/2013/06/08/searching-javascript-arrays-with-a-binary-search/
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
var bottomPointer = 0;
|
|
588
|
-
var topPointer = this.rowsToDisplay.length - 1; // quick check, if the pixel is out of bounds, then return last row
|
|
589
|
-
|
|
590
|
-
if (pixelToMatch <= 0) {
|
|
591
|
-
// if pixel is less than or equal zero, it's always the first row
|
|
592
|
-
return 0;
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
var lastNode = _.last(this.rowsToDisplay);
|
|
596
|
-
|
|
597
|
-
if (lastNode.rowTop <= pixelToMatch) {
|
|
598
|
-
return this.rowsToDisplay.length - 1;
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
var oldBottomPointer = -1;
|
|
602
|
-
var oldTopPointer = -1;
|
|
603
|
-
|
|
604
|
-
while (true) {
|
|
605
|
-
var midPointer = Math.floor((bottomPointer + topPointer) / 2);
|
|
606
|
-
var currentRowNode = this.rowsToDisplay[midPointer];
|
|
607
|
-
|
|
608
|
-
if (this.isRowInPixel(currentRowNode, pixelToMatch)) {
|
|
609
|
-
return midPointer;
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
if (currentRowNode.rowTop < pixelToMatch) {
|
|
613
|
-
bottomPointer = midPointer + 1;
|
|
614
|
-
} else if (currentRowNode.rowTop > pixelToMatch) {
|
|
615
|
-
topPointer = midPointer - 1;
|
|
616
|
-
} // infinite loops happen when there is space between rows. this can happen
|
|
617
|
-
// when Auto Height is active, cos we re-calculate row tops asyncronously
|
|
618
|
-
// when row heights change, which can temporarly result in gaps between rows.
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
var caughtInInfiniteLoop = oldBottomPointer === bottomPointer && oldTopPointer === topPointer;
|
|
622
|
-
|
|
623
|
-
if (caughtInInfiniteLoop) {
|
|
624
|
-
return midPointer;
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
oldBottomPointer = bottomPointer;
|
|
628
|
-
oldTopPointer = topPointer;
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
}, {
|
|
632
|
-
key: "isRowInPixel",
|
|
633
|
-
value: function isRowInPixel(rowNode, pixelToMatch) {
|
|
634
|
-
var topPixel = rowNode.rowTop;
|
|
635
|
-
var bottomPixel = rowNode.rowTop + rowNode.rowHeight;
|
|
636
|
-
var pixelInRow = topPixel <= pixelToMatch && bottomPixel > pixelToMatch;
|
|
637
|
-
return pixelInRow;
|
|
638
|
-
}
|
|
639
|
-
}, {
|
|
640
|
-
key: "forEachLeafNode",
|
|
641
|
-
value: function forEachLeafNode(callback) {
|
|
642
|
-
if (this.rootNode.allLeafChildren) {
|
|
643
|
-
this.rootNode.allLeafChildren.forEach(function (rowNode, index) {
|
|
644
|
-
return callback(rowNode, index);
|
|
645
|
-
});
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
}, {
|
|
649
|
-
key: "forEachNode",
|
|
650
|
-
value: function forEachNode(callback) {
|
|
651
|
-
this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterGroup, callback, RecursionType.Normal, 0);
|
|
652
|
-
}
|
|
653
|
-
}, {
|
|
654
|
-
key: "forEachNodeAfterFilter",
|
|
655
|
-
value: function forEachNodeAfterFilter(callback) {
|
|
656
|
-
this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterAggFilter, callback, RecursionType.AfterFilter, 0);
|
|
657
|
-
}
|
|
658
|
-
}, {
|
|
659
|
-
key: "forEachNodeAfterFilterAndSort",
|
|
660
|
-
value: function forEachNodeAfterFilterAndSort(callback) {
|
|
661
|
-
this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterSort, callback, RecursionType.AfterFilterAndSort, 0);
|
|
662
|
-
}
|
|
663
|
-
}, {
|
|
664
|
-
key: "forEachPivotNode",
|
|
665
|
-
value: function forEachPivotNode(callback) {
|
|
666
|
-
this.recursivelyWalkNodesAndCallback([this.rootNode], callback, RecursionType.PivotNodes, 0);
|
|
667
|
-
} // iterates through each item in memory, and calls the callback function
|
|
668
|
-
// nodes - the rowNodes to traverse
|
|
669
|
-
// callback - the user provided callback
|
|
670
|
-
// recursion type - need this to know what child nodes to recurse, eg if looking at all nodes, or filtered notes etc
|
|
671
|
-
// index - works similar to the index in forEach in javascript's array function
|
|
672
|
-
|
|
673
|
-
}, {
|
|
674
|
-
key: "recursivelyWalkNodesAndCallback",
|
|
675
|
-
value: function recursivelyWalkNodesAndCallback(nodes, callback, recursionType, index) {
|
|
676
|
-
if (!nodes) {
|
|
677
|
-
return index;
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
for (var i = 0; i < nodes.length; i++) {
|
|
681
|
-
var node = nodes[i];
|
|
682
|
-
callback(node, index++); // go to the next level if it is a group
|
|
683
|
-
|
|
684
|
-
if (node.hasChildren()) {
|
|
685
|
-
// depending on the recursion type, we pick a difference set of children
|
|
686
|
-
var nodeChildren = null;
|
|
687
|
-
|
|
688
|
-
switch (recursionType) {
|
|
689
|
-
case RecursionType.Normal:
|
|
690
|
-
nodeChildren = node.childrenAfterGroup;
|
|
691
|
-
break;
|
|
692
|
-
|
|
693
|
-
case RecursionType.AfterFilter:
|
|
694
|
-
nodeChildren = node.childrenAfterAggFilter;
|
|
695
|
-
break;
|
|
696
|
-
|
|
697
|
-
case RecursionType.AfterFilterAndSort:
|
|
698
|
-
nodeChildren = node.childrenAfterSort;
|
|
699
|
-
break;
|
|
700
|
-
|
|
701
|
-
case RecursionType.PivotNodes:
|
|
702
|
-
// for pivot, we don't go below leafGroup levels
|
|
703
|
-
nodeChildren = !node.leafGroup ? node.childrenAfterSort : null;
|
|
704
|
-
break;
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
if (nodeChildren) {
|
|
708
|
-
index = this.recursivelyWalkNodesAndCallback(nodeChildren, callback, recursionType, index);
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
return index;
|
|
714
|
-
} // it's possible to recompute the aggregate without doing the other parts
|
|
715
|
-
// + gridApi.recomputeAggregates()
|
|
716
|
-
|
|
717
|
-
}, {
|
|
718
|
-
key: "doAggregate",
|
|
719
|
-
value: function doAggregate(changedPath) {
|
|
720
|
-
if (this.aggregationStage) {
|
|
721
|
-
this.aggregationStage.execute({
|
|
722
|
-
rowNode: this.rootNode,
|
|
723
|
-
changedPath: changedPath
|
|
724
|
-
});
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
}, {
|
|
728
|
-
key: "doFilterAggregates",
|
|
729
|
-
value: function doFilterAggregates(changedPath) {
|
|
730
|
-
if (this.filterAggregatesStage) {
|
|
731
|
-
this.filterAggregatesStage.execute({
|
|
732
|
-
rowNode: this.rootNode,
|
|
733
|
-
changedPath: changedPath
|
|
734
|
-
});
|
|
735
|
-
} else {
|
|
736
|
-
// If filterAggregatesStage is undefined, then so is the grouping stage, so all children should be on the rootNode.
|
|
737
|
-
this.rootNode.childrenAfterAggFilter = this.rootNode.childrenAfterFilter;
|
|
738
|
-
}
|
|
739
|
-
} // + gridApi.expandAll()
|
|
740
|
-
// + gridApi.collapseAll()
|
|
741
|
-
|
|
742
|
-
}, {
|
|
743
|
-
key: "expandOrCollapseAll",
|
|
744
|
-
value: function expandOrCollapseAll(expand) {
|
|
745
|
-
var usingTreeData = this.gridOptionsWrapper.isTreeData();
|
|
746
|
-
var usingPivotMode = this.columnModel.isPivotActive();
|
|
747
|
-
|
|
748
|
-
var recursiveExpandOrCollapse = function recursiveExpandOrCollapse(rowNodes) {
|
|
749
|
-
if (!rowNodes) {
|
|
750
|
-
return;
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
rowNodes.forEach(function (rowNode) {
|
|
754
|
-
var actionRow = function actionRow() {
|
|
755
|
-
rowNode.expanded = expand;
|
|
756
|
-
recursiveExpandOrCollapse(rowNode.childrenAfterGroup);
|
|
757
|
-
};
|
|
758
|
-
|
|
759
|
-
if (usingTreeData) {
|
|
760
|
-
var hasChildren = _.exists(rowNode.childrenAfterGroup);
|
|
761
|
-
|
|
762
|
-
if (hasChildren) {
|
|
763
|
-
actionRow();
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
return;
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
if (usingPivotMode) {
|
|
770
|
-
var notLeafGroup = !rowNode.leafGroup;
|
|
771
|
-
|
|
772
|
-
if (notLeafGroup) {
|
|
773
|
-
actionRow();
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
return;
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
var isRowGroup = rowNode.group;
|
|
780
|
-
|
|
781
|
-
if (isRowGroup) {
|
|
782
|
-
actionRow();
|
|
783
|
-
}
|
|
784
|
-
});
|
|
785
|
-
};
|
|
786
|
-
|
|
787
|
-
if (this.rootNode) {
|
|
788
|
-
recursiveExpandOrCollapse(this.rootNode.childrenAfterGroup);
|
|
789
|
-
}
|
|
790
|
-
|
|
791
|
-
this.refreshModel({
|
|
792
|
-
step: ClientSideRowModelSteps.MAP
|
|
793
|
-
});
|
|
794
|
-
var eventSource = expand ? 'expandAll' : 'collapseAll';
|
|
795
|
-
var event = {
|
|
796
|
-
type: Events.EVENT_EXPAND_COLLAPSE_ALL,
|
|
797
|
-
source: eventSource
|
|
798
|
-
};
|
|
799
|
-
this.eventService.dispatchEvent(event);
|
|
800
|
-
}
|
|
801
|
-
}, {
|
|
802
|
-
key: "doSort",
|
|
803
|
-
value: function doSort(rowNodeTransactions, changedPath) {
|
|
804
|
-
this.sortStage.execute({
|
|
805
|
-
rowNode: this.rootNode,
|
|
806
|
-
rowNodeTransactions: rowNodeTransactions,
|
|
807
|
-
changedPath: changedPath
|
|
808
|
-
});
|
|
809
|
-
}
|
|
810
|
-
}, {
|
|
811
|
-
key: "doRowGrouping",
|
|
812
|
-
value: function doRowGrouping(groupState, rowNodeTransactions, rowNodeOrder, changedPath, afterColumnsChanged) {
|
|
813
|
-
if (this.groupStage) {
|
|
814
|
-
if (rowNodeTransactions) {
|
|
815
|
-
this.groupStage.execute({
|
|
816
|
-
rowNode: this.rootNode,
|
|
817
|
-
rowNodeTransactions: rowNodeTransactions,
|
|
818
|
-
rowNodeOrder: rowNodeOrder,
|
|
819
|
-
changedPath: changedPath
|
|
820
|
-
});
|
|
821
|
-
} else {
|
|
822
|
-
this.groupStage.execute({
|
|
823
|
-
rowNode: this.rootNode,
|
|
824
|
-
changedPath: changedPath,
|
|
825
|
-
afterColumnsChanged: afterColumnsChanged
|
|
826
|
-
}); // set open/closed state on groups
|
|
827
|
-
|
|
828
|
-
this.restoreGroupState(groupState);
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
if (this.gridOptionsWrapper.isGroupSelectsChildren()) {
|
|
832
|
-
this.selectionService.updateGroupsFromChildrenSelections(changedPath);
|
|
833
|
-
}
|
|
834
|
-
} else {
|
|
835
|
-
this.rootNode.childrenAfterGroup = this.rootNode.allLeafChildren;
|
|
836
|
-
|
|
837
|
-
if (this.rootNode.sibling) {
|
|
838
|
-
this.rootNode.sibling.childrenAfterGroup = this.rootNode.childrenAfterGroup;
|
|
839
|
-
}
|
|
840
|
-
|
|
841
|
-
this.rootNode.updateHasChildren();
|
|
842
|
-
}
|
|
843
|
-
}
|
|
844
|
-
}, {
|
|
845
|
-
key: "restoreGroupState",
|
|
846
|
-
value: function restoreGroupState(groupState) {
|
|
847
|
-
if (!groupState) {
|
|
848
|
-
return;
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
_.traverseNodesWithKey(this.rootNode.childrenAfterGroup, function (node, key) {
|
|
852
|
-
// if the group was open last time, then open it this time. however
|
|
853
|
-
// if was not open last time, then don't touch the group, so the 'groupDefaultExpanded'
|
|
854
|
-
// setting will take effect.
|
|
855
|
-
if (typeof groupState[key] === 'boolean') {
|
|
856
|
-
node.expanded = groupState[key];
|
|
857
|
-
}
|
|
858
|
-
});
|
|
859
|
-
}
|
|
860
|
-
}, {
|
|
861
|
-
key: "doFilter",
|
|
862
|
-
value: function doFilter(changedPath) {
|
|
863
|
-
this.filterStage.execute({
|
|
864
|
-
rowNode: this.rootNode,
|
|
865
|
-
changedPath: changedPath
|
|
866
|
-
});
|
|
867
|
-
}
|
|
868
|
-
}, {
|
|
869
|
-
key: "doPivot",
|
|
870
|
-
value: function doPivot(changedPath) {
|
|
871
|
-
if (this.pivotStage) {
|
|
872
|
-
this.pivotStage.execute({
|
|
873
|
-
rowNode: this.rootNode,
|
|
874
|
-
changedPath: changedPath
|
|
875
|
-
});
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
}, {
|
|
879
|
-
key: "getGroupState",
|
|
880
|
-
value: function getGroupState() {
|
|
881
|
-
if (!this.rootNode.childrenAfterGroup || !this.gridOptionsWrapper.isRememberGroupStateWhenNewData()) {
|
|
882
|
-
return null;
|
|
883
|
-
}
|
|
884
|
-
|
|
885
|
-
var result = {};
|
|
886
|
-
|
|
887
|
-
_.traverseNodesWithKey(this.rootNode.childrenAfterGroup, function (node, key) {
|
|
888
|
-
return result[key] = node.expanded;
|
|
889
|
-
});
|
|
890
|
-
|
|
891
|
-
return result;
|
|
892
|
-
}
|
|
893
|
-
}, {
|
|
894
|
-
key: "getCopyOfNodesMap",
|
|
895
|
-
value: function getCopyOfNodesMap() {
|
|
896
|
-
return this.nodeManager.getCopyOfNodesMap();
|
|
897
|
-
}
|
|
898
|
-
}, {
|
|
899
|
-
key: "getRowNode",
|
|
900
|
-
value: function getRowNode(id) {
|
|
901
|
-
// although id is typed a string, this could be called by the user, and they could have passed a number
|
|
902
|
-
var idIsGroup = typeof id == 'string' && id.indexOf(RowNode.ID_PREFIX_ROW_GROUP) == 0;
|
|
903
|
-
|
|
904
|
-
if (idIsGroup) {
|
|
905
|
-
// only one users complained about getRowNode not working for groups, after years of
|
|
906
|
-
// this working for normal rows. so have done quick implementation. if users complain
|
|
907
|
-
// about performance, then GroupStage should store / manage created groups in a map,
|
|
908
|
-
// which is a chunk of work.
|
|
909
|
-
var res = undefined;
|
|
910
|
-
this.forEachNode(function (node) {
|
|
911
|
-
if (node.id === id) {
|
|
912
|
-
res = node;
|
|
913
|
-
}
|
|
914
|
-
});
|
|
915
|
-
return res;
|
|
916
|
-
}
|
|
917
|
-
|
|
918
|
-
return this.nodeManager.getRowNode(id);
|
|
919
|
-
} // rows: the rows to put into the model
|
|
920
|
-
|
|
921
|
-
}, {
|
|
922
|
-
key: "setRowData",
|
|
923
|
-
value: function setRowData(rowData) {
|
|
924
|
-
// no need to invalidate cache, as the cache is stored on the rowNode,
|
|
925
|
-
// so new rowNodes means the cache is wiped anyway.
|
|
926
|
-
// remember group state, so we can expand groups that should be expanded
|
|
927
|
-
var groupState = this.getGroupState();
|
|
928
|
-
this.nodeManager.setRowData(rowData); // - clears selection
|
|
929
|
-
|
|
930
|
-
this.selectionService.reset(); // - updates filters
|
|
931
|
-
|
|
932
|
-
this.filterManager.onNewRowsLoaded('rowDataUpdated'); // this event kicks off:
|
|
933
|
-
// - shows 'no rows' overlay if needed
|
|
934
|
-
|
|
935
|
-
var rowDataUpdatedEvent = {
|
|
936
|
-
type: Events.EVENT_ROW_DATA_UPDATED
|
|
937
|
-
};
|
|
938
|
-
this.eventService.dispatchEvent(rowDataUpdatedEvent);
|
|
939
|
-
this.refreshModel({
|
|
940
|
-
step: ClientSideRowModelSteps.EVERYTHING,
|
|
941
|
-
groupState: groupState,
|
|
942
|
-
newData: true
|
|
943
|
-
});
|
|
944
|
-
}
|
|
945
|
-
}, {
|
|
946
|
-
key: "batchUpdateRowData",
|
|
947
|
-
value: function batchUpdateRowData(rowDataTransaction, callback) {
|
|
948
|
-
var _this3 = this;
|
|
949
|
-
|
|
950
|
-
if (this.applyAsyncTransactionsTimeout == null) {
|
|
951
|
-
this.rowDataTransactionBatch = [];
|
|
952
|
-
var waitMillis = this.gridOptionsWrapper.getAsyncTransactionWaitMillis();
|
|
953
|
-
this.applyAsyncTransactionsTimeout = window.setTimeout(function () {
|
|
954
|
-
_this3.executeBatchUpdateRowData();
|
|
955
|
-
}, waitMillis);
|
|
956
|
-
}
|
|
957
|
-
|
|
958
|
-
this.rowDataTransactionBatch.push({
|
|
959
|
-
rowDataTransaction: rowDataTransaction,
|
|
960
|
-
callback: callback
|
|
961
|
-
});
|
|
962
|
-
}
|
|
963
|
-
}, {
|
|
964
|
-
key: "flushAsyncTransactions",
|
|
965
|
-
value: function flushAsyncTransactions() {
|
|
966
|
-
if (this.applyAsyncTransactionsTimeout != null) {
|
|
967
|
-
clearTimeout(this.applyAsyncTransactionsTimeout);
|
|
968
|
-
this.executeBatchUpdateRowData();
|
|
969
|
-
}
|
|
970
|
-
}
|
|
971
|
-
}, {
|
|
972
|
-
key: "executeBatchUpdateRowData",
|
|
973
|
-
value: function executeBatchUpdateRowData() {
|
|
974
|
-
var _this4 = this;
|
|
975
|
-
|
|
976
|
-
this.valueCache.onDataChanged();
|
|
977
|
-
var callbackFuncsBound = [];
|
|
978
|
-
var rowNodeTrans = []; // The rowGroup stage uses rowNodeOrder if order was provided. if we didn't pass 'true' to
|
|
979
|
-
// commonUpdateRowData, using addIndex would have no effect when grouping.
|
|
980
|
-
|
|
981
|
-
var forceRowNodeOrder = false;
|
|
982
|
-
|
|
983
|
-
if (this.rowDataTransactionBatch) {
|
|
984
|
-
this.rowDataTransactionBatch.forEach(function (tranItem) {
|
|
985
|
-
var rowNodeTran = _this4.nodeManager.updateRowData(tranItem.rowDataTransaction, undefined);
|
|
986
|
-
|
|
987
|
-
rowNodeTrans.push(rowNodeTran);
|
|
988
|
-
|
|
989
|
-
if (tranItem.callback) {
|
|
990
|
-
callbackFuncsBound.push(tranItem.callback.bind(null, rowNodeTran));
|
|
991
|
-
}
|
|
992
|
-
|
|
993
|
-
if (typeof tranItem.rowDataTransaction.addIndex === 'number') {
|
|
994
|
-
forceRowNodeOrder = true;
|
|
995
|
-
}
|
|
996
|
-
});
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
this.commonUpdateRowData(rowNodeTrans, undefined, forceRowNodeOrder); // do callbacks in next VM turn so it's async
|
|
1000
|
-
|
|
1001
|
-
if (callbackFuncsBound.length > 0) {
|
|
1002
|
-
window.setTimeout(function () {
|
|
1003
|
-
callbackFuncsBound.forEach(function (func) {
|
|
1004
|
-
return func();
|
|
1005
|
-
});
|
|
1006
|
-
}, 0);
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1009
|
-
if (rowNodeTrans.length > 0) {
|
|
1010
|
-
var event = {
|
|
1011
|
-
type: Events.EVENT_ASYNC_TRANSACTIONS_FLUSHED,
|
|
1012
|
-
results: rowNodeTrans
|
|
1013
|
-
};
|
|
1014
|
-
this.eventService.dispatchEvent(event);
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
|
-
this.rowDataTransactionBatch = null;
|
|
1018
|
-
this.applyAsyncTransactionsTimeout = undefined;
|
|
1019
|
-
}
|
|
1020
|
-
}, {
|
|
1021
|
-
key: "updateRowData",
|
|
1022
|
-
value: function updateRowData(rowDataTran, rowNodeOrder) {
|
|
1023
|
-
this.valueCache.onDataChanged();
|
|
1024
|
-
var rowNodeTran = this.nodeManager.updateRowData(rowDataTran, rowNodeOrder); // if doing immutableData, addIndex is never present. however if doing standard transaction, and user
|
|
1025
|
-
// provided addIndex, then this is used in updateRowData. However if doing Enterprise, then the rowGroup
|
|
1026
|
-
// stage also uses the
|
|
1027
|
-
|
|
1028
|
-
var forceRowNodeOrder = typeof rowDataTran.addIndex === 'number';
|
|
1029
|
-
this.commonUpdateRowData([rowNodeTran], rowNodeOrder, forceRowNodeOrder);
|
|
1030
|
-
return rowNodeTran;
|
|
1031
|
-
}
|
|
1032
|
-
}, {
|
|
1033
|
-
key: "createRowNodeOrder",
|
|
1034
|
-
value: function createRowNodeOrder() {
|
|
1035
|
-
var suppressSortOrder = this.gridOptionsWrapper.isSuppressMaintainUnsortedOrder();
|
|
1036
|
-
|
|
1037
|
-
if (suppressSortOrder) {
|
|
1038
|
-
return;
|
|
1039
|
-
}
|
|
1040
|
-
|
|
1041
|
-
var orderMap = {};
|
|
1042
|
-
|
|
1043
|
-
if (this.rootNode && this.rootNode.allLeafChildren) {
|
|
1044
|
-
for (var index = 0; index < this.rootNode.allLeafChildren.length; index++) {
|
|
1045
|
-
var node = this.rootNode.allLeafChildren[index];
|
|
1046
|
-
orderMap[node.id] = index;
|
|
1047
|
-
}
|
|
1048
|
-
}
|
|
1049
|
-
|
|
1050
|
-
return orderMap;
|
|
1051
|
-
} // common to updateRowData and batchUpdateRowData
|
|
1052
|
-
|
|
1053
|
-
}, {
|
|
1054
|
-
key: "commonUpdateRowData",
|
|
1055
|
-
value: function commonUpdateRowData(rowNodeTrans, rowNodeOrder, forceRowNodeOrder) {
|
|
1056
|
-
var animate = !this.gridOptionsWrapper.isSuppressAnimationFrame();
|
|
1057
|
-
|
|
1058
|
-
if (forceRowNodeOrder) {
|
|
1059
|
-
rowNodeOrder = this.createRowNodeOrder();
|
|
1060
|
-
}
|
|
1061
|
-
|
|
1062
|
-
this.refreshModel({
|
|
1063
|
-
step: ClientSideRowModelSteps.EVERYTHING,
|
|
1064
|
-
rowNodeTransactions: rowNodeTrans,
|
|
1065
|
-
rowNodeOrder: rowNodeOrder,
|
|
1066
|
-
keepRenderedRows: true,
|
|
1067
|
-
keepEditingRows: true,
|
|
1068
|
-
animate: animate
|
|
1069
|
-
}); // - updates filters
|
|
1070
|
-
|
|
1071
|
-
this.filterManager.onNewRowsLoaded('rowDataUpdated');
|
|
1072
|
-
var event = {
|
|
1073
|
-
type: Events.EVENT_ROW_DATA_UPDATED
|
|
1074
|
-
};
|
|
1075
|
-
this.eventService.dispatchEvent(event);
|
|
1076
|
-
}
|
|
1077
|
-
}, {
|
|
1078
|
-
key: "doRowsToDisplay",
|
|
1079
|
-
value: function doRowsToDisplay() {
|
|
1080
|
-
this.rowsToDisplay = this.flattenStage.execute({
|
|
1081
|
-
rowNode: this.rootNode
|
|
1082
|
-
});
|
|
1083
|
-
}
|
|
1084
|
-
}, {
|
|
1085
|
-
key: "onRowHeightChanged",
|
|
1086
|
-
value: function onRowHeightChanged() {
|
|
1087
|
-
this.refreshModel({
|
|
1088
|
-
step: ClientSideRowModelSteps.MAP,
|
|
1089
|
-
keepRenderedRows: true,
|
|
1090
|
-
keepEditingRows: true,
|
|
1091
|
-
keepUndoRedoStack: true
|
|
1092
|
-
});
|
|
1093
|
-
}
|
|
1094
|
-
/** This method is debounced. It is used for row auto-height. If we don't debounce,
|
|
1095
|
-
* then the Row Models will end up recalculating each row position
|
|
1096
|
-
* for each row height change and result in the Row Renderer laying out rows.
|
|
1097
|
-
* This is particularly bad if using print layout, and showing eg 1,000 rows,
|
|
1098
|
-
* each row will change it's height, causing Row Model to update 1,000 times.
|
|
1099
|
-
*/
|
|
1100
|
-
|
|
1101
|
-
}, {
|
|
1102
|
-
key: "onRowHeightChangedDebounced",
|
|
1103
|
-
value: function onRowHeightChangedDebounced() {
|
|
1104
|
-
this.onRowHeightChanged_debounced();
|
|
1105
|
-
}
|
|
1106
|
-
}, {
|
|
1107
|
-
key: "resetRowHeights",
|
|
1108
|
-
value: function resetRowHeights() {
|
|
1109
|
-
var atLeastOne = false;
|
|
1110
|
-
this.forEachNode(function (rowNode) {
|
|
1111
|
-
rowNode.setRowHeight(rowNode.rowHeight, true); // we keep the height each row is at, however we set estimated=true rather than clear the height.
|
|
1112
|
-
// this means the grid will not reset the row heights back to defaults, rather it will re-calc
|
|
1113
|
-
// the height for each row as the row is displayed. otherwise the scroll will jump when heights are reset.
|
|
1114
|
-
|
|
1115
|
-
var detailNode = rowNode.detailNode;
|
|
1116
|
-
|
|
1117
|
-
if (detailNode) {
|
|
1118
|
-
detailNode.setRowHeight(detailNode.rowHeight, true);
|
|
1119
|
-
}
|
|
1120
|
-
|
|
1121
|
-
atLeastOne = true;
|
|
1122
|
-
});
|
|
1123
|
-
|
|
1124
|
-
if (atLeastOne) {
|
|
1125
|
-
this.onRowHeightChanged();
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
}]);
|
|
1129
|
-
|
|
1130
|
-
return ClientSideRowModel;
|
|
1131
|
-
}(BeanStub);
|
|
1132
|
-
|
|
1133
|
-
__decorate([Autowired('columnModel')], ClientSideRowModel.prototype, "columnModel", void 0);
|
|
1134
|
-
|
|
1135
|
-
__decorate([Autowired('selectionService')], ClientSideRowModel.prototype, "selectionService", void 0);
|
|
1136
|
-
|
|
1137
|
-
__decorate([Autowired('filterManager')], ClientSideRowModel.prototype, "filterManager", void 0);
|
|
1138
|
-
|
|
1139
|
-
__decorate([Autowired('valueCache')], ClientSideRowModel.prototype, "valueCache", void 0);
|
|
1140
|
-
|
|
1141
|
-
__decorate([Autowired('beans')], ClientSideRowModel.prototype, "beans", void 0);
|
|
1142
|
-
|
|
1143
|
-
__decorate([Autowired('filterStage')], ClientSideRowModel.prototype, "filterStage", void 0);
|
|
1144
|
-
|
|
1145
|
-
__decorate([Autowired('sortStage')], ClientSideRowModel.prototype, "sortStage", void 0);
|
|
1146
|
-
|
|
1147
|
-
__decorate([Autowired('flattenStage')], ClientSideRowModel.prototype, "flattenStage", void 0);
|
|
1148
|
-
|
|
1149
|
-
__decorate([Optional('groupStage')], ClientSideRowModel.prototype, "groupStage", void 0);
|
|
1150
|
-
|
|
1151
|
-
__decorate([Optional('aggregationStage')], ClientSideRowModel.prototype, "aggregationStage", void 0);
|
|
1152
|
-
|
|
1153
|
-
__decorate([Optional('pivotStage')], ClientSideRowModel.prototype, "pivotStage", void 0);
|
|
1154
|
-
|
|
1155
|
-
__decorate([Optional('filterAggregatesStage')], ClientSideRowModel.prototype, "filterAggregatesStage", void 0);
|
|
1156
|
-
|
|
1157
|
-
__decorate([PostConstruct], ClientSideRowModel.prototype, "init", null);
|
|
1158
|
-
|
|
1159
|
-
ClientSideRowModel = __decorate([Bean('rowModel')], ClientSideRowModel);
|
|
1160
|
-
export { ClientSideRowModel };
|