@progress/kendo-angular-treelist 21.4.1-develop.1 → 22.0.0-develop.1
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/binding-directives/base-binding.directive.d.ts +1 -1
- package/column-menu/column-menu-item-base.d.ts +1 -1
- package/columns/column-base.d.ts +1 -1
- package/editing-directives/editing-directive-base.d.ts +1 -1
- package/editing-directives/row-editing-directive-base.d.ts +1 -1
- package/fesm2022/progress-kendo-angular-treelist.mjs +519 -519
- package/filtering/base-filter-cell.component.d.ts +1 -1
- package/filtering/boolean-filter.component.d.ts +1 -1
- package/filtering/date-filter.component.d.ts +1 -1
- package/filtering/filter-host.directive.d.ts +1 -1
- package/filtering/filter-input-wrapper.component.d.ts +1 -1
- package/filtering/numeric-filter.component.d.ts +1 -1
- package/filtering/operators/filter-operator.base.d.ts +1 -1
- package/filtering/string-filter.component.d.ts +1 -1
- package/localization/messages.d.ts +1 -1
- package/package.json +23 -31
- package/schematics/ngAdd/index.js +3 -3
- package/esm2022/binding-directives/base-binding.directive.mjs +0 -180
- package/esm2022/binding-directives/data-bound-tree-component.mjs +0 -18
- package/esm2022/binding-directives/flat-binding.directive.mjs +0 -130
- package/esm2022/binding-directives/hierarchy-binding.directive.mjs +0 -109
- package/esm2022/column-menu/column-chooser-item-checked.directive.mjs +0 -45
- package/esm2022/column-menu/column-chooser.component.mjs +0 -221
- package/esm2022/column-menu/column-list-kb-nav.service.mjs +0 -40
- package/esm2022/column-menu/column-list.component.mjs +0 -380
- package/esm2022/column-menu/column-locked-change-event.mjs +0 -21
- package/esm2022/column-menu/column-menu-autosize-all.component.mjs +0 -78
- package/esm2022/column-menu/column-menu-autosize.component.mjs +0 -86
- package/esm2022/column-menu/column-menu-chooser.component.mjs +0 -164
- package/esm2022/column-menu/column-menu-container.component.mjs +0 -58
- package/esm2022/column-menu/column-menu-expandable-item.interface.mjs +0 -5
- package/esm2022/column-menu/column-menu-filter.component.mjs +0 -141
- package/esm2022/column-menu/column-menu-item-base.mjs +0 -41
- package/esm2022/column-menu/column-menu-item-content-template.directive.mjs +0 -43
- package/esm2022/column-menu/column-menu-item.component.mjs +0 -329
- package/esm2022/column-menu/column-menu-item.directive.mjs +0 -147
- package/esm2022/column-menu/column-menu-lock.component.mjs +0 -112
- package/esm2022/column-menu/column-menu-settings.interface.mjs +0 -5
- package/esm2022/column-menu/column-menu-sort.component.mjs +0 -115
- package/esm2022/column-menu/column-menu-template.directive.mjs +0 -47
- package/esm2022/column-menu/column-menu.component.mjs +0 -470
- package/esm2022/column-menu/column-menu.service.mjs +0 -70
- package/esm2022/column-menu/column-visibility-change-event.mjs +0 -19
- package/esm2022/column-menu/utils.mjs +0 -44
- package/esm2022/column-resizing/column-handle.directive.mjs +0 -226
- package/esm2022/column-resizing/column-resize.interface.mjs +0 -5
- package/esm2022/column-resizing/column-resizing.service.mjs +0 -143
- package/esm2022/column-resizing/table.directive.mjs +0 -130
- package/esm2022/columns/checkbox-column.component.mjs +0 -88
- package/esm2022/columns/column-base.mjs +0 -319
- package/esm2022/columns/column-common.mjs +0 -73
- package/esm2022/columns/column-group.component.mjs +0 -115
- package/esm2022/columns/column-list.mjs +0 -94
- package/esm2022/columns/column.component.mjs +0 -165
- package/esm2022/columns/columns-container.mjs +0 -90
- package/esm2022/columns/command-column.component.mjs +0 -77
- package/esm2022/columns/rowreorder-column.component.mjs +0 -57
- package/esm2022/columns/sort-settings.mjs +0 -17
- package/esm2022/columns/span-column.component.mjs +0 -201
- package/esm2022/common/cell-click-event-args.interface.mjs +0 -5
- package/esm2022/common/column-info.service.mjs +0 -54
- package/esm2022/common/create-form-group.mjs +0 -5
- package/esm2022/common/default-track-by.mjs +0 -13
- package/esm2022/common/dom-events.service.mjs +0 -24
- package/esm2022/common/error-messages.mjs +0 -15
- package/esm2022/common/filter-descriptor-differ.mjs +0 -69
- package/esm2022/common/filter-operator.interface.mjs +0 -5
- package/esm2022/common/id.service.mjs +0 -34
- package/esm2022/common/option-changes.service.mjs +0 -24
- package/esm2022/common/pager-settings.mjs +0 -19
- package/esm2022/common/preventable-event.mjs +0 -28
- package/esm2022/common/provider.service.mjs +0 -34
- package/esm2022/common/remove-confirmation.mjs +0 -5
- package/esm2022/common/single-popup.service.mjs +0 -132
- package/esm2022/common/sort.service.mjs +0 -14
- package/esm2022/data/change-event-args.interface.mjs +0 -5
- package/esm2022/data/change-notification.service.mjs +0 -30
- package/esm2022/data/data-item.interface.mjs +0 -5
- package/esm2022/data/data.collection.mjs +0 -503
- package/esm2022/data/treelist-item.interface.mjs +0 -5
- package/esm2022/directives.mjs +0 -291
- package/esm2022/dragdrop/column-reorder-config.mjs +0 -5
- package/esm2022/dragdrop/column-reorder-event.mjs +0 -31
- package/esm2022/dragdrop/column-reorder.service.mjs +0 -20
- package/esm2022/dragdrop/common.mjs +0 -69
- package/esm2022/dragdrop/context-types.mjs +0 -5
- package/esm2022/dragdrop/drag-and-drop.service.mjs +0 -65
- package/esm2022/dragdrop/drag-hint.service.mjs +0 -137
- package/esm2022/dragdrop/draggable-column.directive.mjs +0 -141
- package/esm2022/dragdrop/drop-cue.service.mjs +0 -46
- package/esm2022/dragdrop/drop-target.directive.mjs +0 -71
- package/esm2022/editing/add-command-tool.directive.mjs +0 -60
- package/esm2022/editing/add-command.directive.mjs +0 -96
- package/esm2022/editing/add-event-args.interface.mjs +0 -5
- package/esm2022/editing/base-command.directive.mjs +0 -95
- package/esm2022/editing/cancel-command.directive.mjs +0 -97
- package/esm2022/editing/cancel-event-args.interface.mjs +0 -5
- package/esm2022/editing/cell-close-event.mjs +0 -34
- package/esm2022/editing/edit-command.directive.mjs +0 -96
- package/esm2022/editing/edit-event-args.interface.mjs +0 -5
- package/esm2022/editing/edit-template.directive.mjs +0 -45
- package/esm2022/editing/edit.service.mjs +0 -174
- package/esm2022/editing/remove-command.directive.mjs +0 -96
- package/esm2022/editing/remove-event-args.interface.mjs +0 -5
- package/esm2022/editing/save-command.directive.mjs +0 -96
- package/esm2022/editing/save-event-args.interface.mjs +0 -5
- package/esm2022/editing-directives/create-form-group-args.interface.mjs +0 -5
- package/esm2022/editing-directives/edit-service.interface.mjs +0 -5
- package/esm2022/editing-directives/editing-directive-base.mjs +0 -137
- package/esm2022/editing-directives/flat-edit.service.mjs +0 -52
- package/esm2022/editing-directives/hierarchy-edit.service.mjs +0 -48
- package/esm2022/editing-directives/in-cell-editing.directive.mjs +0 -89
- package/esm2022/editing-directives/local-edit.service.mjs +0 -28
- package/esm2022/editing-directives/reactive-editing.directive.mjs +0 -61
- package/esm2022/editing-directives/row-editing-directive-base.mjs +0 -39
- package/esm2022/editing-directives/template-editing.directive.mjs +0 -68
- package/esm2022/editing-directives/utils.mjs +0 -41
- package/esm2022/excel/excel-command-tool.directive.mjs +0 -64
- package/esm2022/excel/excel-command.directive.mjs +0 -97
- package/esm2022/excel/excel-export-data.interface.mjs +0 -5
- package/esm2022/excel/excel-export-event.mjs +0 -15
- package/esm2022/excel/excel.component.mjs +0 -277
- package/esm2022/excel/excel.module.mjs +0 -45
- package/esm2022/excel/excel.service.mjs +0 -34
- package/esm2022/expand-state/expand-event.mjs +0 -30
- package/esm2022/expand-state/expand-state.service.mjs +0 -38
- package/esm2022/expand-state/expandable-tree-component.mjs +0 -18
- package/esm2022/expand-state/expandable.directive.mjs +0 -119
- package/esm2022/filtering/base-filter-cell.component.mjs +0 -172
- package/esm2022/filtering/boolean-filter.component.mjs +0 -91
- package/esm2022/filtering/cell/autocomplete-filter-cell.component.mjs +0 -113
- package/esm2022/filtering/cell/boolean-filter-cell.component.mjs +0 -107
- package/esm2022/filtering/cell/date-filter-cell.component.mjs +0 -132
- package/esm2022/filtering/cell/filter-cell-component.factory.mjs +0 -19
- package/esm2022/filtering/cell/filter-cell-host.directive.mjs +0 -33
- package/esm2022/filtering/cell/filter-cell-operators.component.mjs +0 -235
- package/esm2022/filtering/cell/filter-cell-template.directive.mjs +0 -46
- package/esm2022/filtering/cell/filter-cell-wrapper.component.mjs +0 -74
- package/esm2022/filtering/cell/filter-cell.component.mjs +0 -91
- package/esm2022/filtering/cell/numeric-filter-cell.component.mjs +0 -143
- package/esm2022/filtering/cell/string-filter-cell.component.mjs +0 -115
- package/esm2022/filtering/date-filter.component.mjs +0 -176
- package/esm2022/filtering/filter-component.interface.mjs +0 -5
- package/esm2022/filtering/filter-host.directive.mjs +0 -56
- package/esm2022/filtering/filter-input-wrapper.component.mjs +0 -119
- package/esm2022/filtering/filter-input.directive.mjs +0 -114
- package/esm2022/filtering/filter-row.component.mjs +0 -79
- package/esm2022/filtering/filter.service.mjs +0 -42
- package/esm2022/filtering/filterable.mjs +0 -16
- package/esm2022/filtering/menu/boolean-filter-menu.component.mjs +0 -168
- package/esm2022/filtering/menu/date-filter-menu-input.component.mjs +0 -174
- package/esm2022/filtering/menu/date-filter-menu.component.mjs +0 -207
- package/esm2022/filtering/menu/filter-menu-component.factory.mjs +0 -19
- package/esm2022/filtering/menu/filter-menu-container.component.mjs +0 -299
- package/esm2022/filtering/menu/filter-menu-dropdownlist.directive.mjs +0 -44
- package/esm2022/filtering/menu/filter-menu-host.directive.mjs +0 -46
- package/esm2022/filtering/menu/filter-menu-input-wrapper.component.mjs +0 -136
- package/esm2022/filtering/menu/filter-menu-template.directive.mjs +0 -43
- package/esm2022/filtering/menu/filter-menu.component.mjs +0 -202
- package/esm2022/filtering/menu/filter-radio-button.directive.mjs +0 -34
- package/esm2022/filtering/menu/menu-tabbing.service.mjs +0 -22
- package/esm2022/filtering/menu/numeric-filter-menu-input.component.mjs +0 -152
- package/esm2022/filtering/menu/numeric-filter-menu.component.mjs +0 -224
- package/esm2022/filtering/menu/string-filter-menu-input.component.mjs +0 -105
- package/esm2022/filtering/menu/string-filter-menu.component.mjs +0 -183
- package/esm2022/filtering/numeric-filter.component.mjs +0 -144
- package/esm2022/filtering/operators/after-eq-filter-operator.component.mjs +0 -72
- package/esm2022/filtering/operators/after-filter-operator.component.mjs +0 -72
- package/esm2022/filtering/operators/before-eq-filter-operator.component.mjs +0 -72
- package/esm2022/filtering/operators/before-filter-operator.component.mjs +0 -72
- package/esm2022/filtering/operators/contains-filter-operator.component.mjs +0 -64
- package/esm2022/filtering/operators/ends-with-filter-operator.component.mjs +0 -64
- package/esm2022/filtering/operators/eq-filter-operator.component.mjs +0 -112
- package/esm2022/filtering/operators/filter-operator.base.mjs +0 -98
- package/esm2022/filtering/operators/gt-filter-operator.component.mjs +0 -63
- package/esm2022/filtering/operators/gte-filter-operator.component.mjs +0 -63
- package/esm2022/filtering/operators/is-empty-filter-operator.component.mjs +0 -64
- package/esm2022/filtering/operators/is-not-empty-filter-operator.component.mjs +0 -64
- package/esm2022/filtering/operators/is-not-null-filter-operator.component.mjs +0 -112
- package/esm2022/filtering/operators/isnull-filter-operator.component.mjs +0 -112
- package/esm2022/filtering/operators/lt-filter-operator.component.mjs +0 -63
- package/esm2022/filtering/operators/lte-filter-operator.component.mjs +0 -63
- package/esm2022/filtering/operators/neq-filter-operator.component.mjs +0 -112
- package/esm2022/filtering/operators/not-contains-filter-operator.component.mjs +0 -64
- package/esm2022/filtering/operators/starts-with-filter-operator.component.mjs +0 -64
- package/esm2022/filtering/string-filter.component.mjs +0 -89
- package/esm2022/index.mjs +0 -146
- package/esm2022/layout/browser-support.service.mjs +0 -85
- package/esm2022/layout/resizable.directive.mjs +0 -83
- package/esm2022/layout/resize.service.mjs +0 -29
- package/esm2022/layout/responsive.service.mjs +0 -34
- package/esm2022/layout/row-sync.mjs +0 -47
- package/esm2022/localization/custom-messages.component.mjs +0 -53
- package/esm2022/localization/localized-messages.directive.mjs +0 -39
- package/esm2022/localization/messages.mjs +0 -510
- package/esm2022/navigation/default-focusable-element.mjs +0 -47
- package/esm2022/navigation/focus-group.mjs +0 -105
- package/esm2022/navigation/focus-root.mjs +0 -50
- package/esm2022/navigation/focusable-element.interface.mjs +0 -5
- package/esm2022/navigation/focusable.directive.mjs +0 -174
- package/esm2022/navigation/item-map.mjs +0 -59
- package/esm2022/navigation/logical-cell.directive.mjs +0 -187
- package/esm2022/navigation/logical-cell.interface.mjs +0 -5
- package/esm2022/navigation/logical-row.directive.mjs +0 -135
- package/esm2022/navigation/logical-row.interface.mjs +0 -5
- package/esm2022/navigation/model-cell.mjs +0 -37
- package/esm2022/navigation/navigation-cell.interface.mjs +0 -5
- package/esm2022/navigation/navigation-change.interface.mjs +0 -5
- package/esm2022/navigation/navigation-cursor.mjs +0 -176
- package/esm2022/navigation/navigation-metadata.mjs +0 -31
- package/esm2022/navigation/navigation-mode.mjs +0 -5
- package/esm2022/navigation/navigation-model.mjs +0 -126
- package/esm2022/navigation/navigation-row.interface.mjs +0 -5
- package/esm2022/navigation/navigation.service.mjs +0 -695
- package/esm2022/navigation/treelist-focusable-element.mjs +0 -28
- package/esm2022/package-metadata.mjs +0 -16
- package/esm2022/pdf/export-element.mjs +0 -129
- package/esm2022/pdf/pdf-command-tool.directive.mjs +0 -68
- package/esm2022/pdf/pdf-command.directive.mjs +0 -101
- package/esm2022/pdf/pdf-export-event.mjs +0 -18
- package/esm2022/pdf/pdf-margin.component.mjs +0 -33
- package/esm2022/pdf/pdf-margin.interface.mjs +0 -5
- package/esm2022/pdf/pdf-template.directive.mjs +0 -45
- package/esm2022/pdf/pdf.component.mjs +0 -269
- package/esm2022/pdf/pdf.module.mjs +0 -48
- package/esm2022/pdf/pdf.service.mjs +0 -40
- package/esm2022/pdf/treelist-query.mjs +0 -45
- package/esm2022/progress-kendo-angular-treelist.mjs +0 -8
- package/esm2022/rendering/cell-template.directive.mjs +0 -49
- package/esm2022/rendering/cell.component.mjs +0 -383
- package/esm2022/rendering/common/col-group.component.mjs +0 -39
- package/esm2022/rendering/common/dom-queries.mjs +0 -158
- package/esm2022/rendering/common/field-accessor.pipe.mjs +0 -48
- package/esm2022/rendering/common/level-items.pipe.mjs +0 -30
- package/esm2022/rendering/common/loading.component.mjs +0 -42
- package/esm2022/rendering/common/row-class.mjs +0 -5
- package/esm2022/rendering/common/spacer.component.mjs +0 -61
- package/esm2022/rendering/constants.mjs +0 -28
- package/esm2022/rendering/footer-template.directive.mjs +0 -45
- package/esm2022/rendering/header/header-template.directive.mjs +0 -45
- package/esm2022/rendering/header/header.component.mjs +0 -978
- package/esm2022/rendering/header/select-all-checkbox.directive.mjs +0 -90
- package/esm2022/rendering/list.component.mjs +0 -850
- package/esm2022/rendering/no-records-template.directive.mjs +0 -40
- package/esm2022/rendering/table-body.component.mjs +0 -665
- package/esm2022/rendering/toolbar/toolbar-focusable.directive.mjs +0 -77
- package/esm2022/rendering/toolbar/toolbar-navigation.service.mjs +0 -54
- package/esm2022/rendering/toolbar/toolbar-template.directive.mjs +0 -58
- package/esm2022/rendering/toolbar/toolbar.component.mjs +0 -110
- package/esm2022/row-reordering/flat-reorder.service.mjs +0 -48
- package/esm2022/row-reordering/hierarchical-reorder.service.mjs +0 -55
- package/esm2022/row-reordering/row-reorder.service.mjs +0 -273
- package/esm2022/row-reordering/types.mjs +0 -5
- package/esm2022/row-reordering/utils.mjs +0 -128
- package/esm2022/scrolling/content-scroll-event.mjs +0 -5
- package/esm2022/scrolling/row-height.service.mjs +0 -30
- package/esm2022/scrolling/scroll-bottom-event.mjs +0 -5
- package/esm2022/scrolling/scroll-request.service.mjs +0 -21
- package/esm2022/scrolling/scroll-sync.service.mjs +0 -80
- package/esm2022/scrolling/scroller.service.mjs +0 -112
- package/esm2022/scrolling/scrollmode.mjs +0 -5
- package/esm2022/scrolling/suspend.service.mjs +0 -17
- package/esm2022/selection/is-selected.mjs +0 -5
- package/esm2022/selection/marquee.directive.mjs +0 -196
- package/esm2022/selection/selectable-settings.mjs +0 -5
- package/esm2022/selection/selectable.directive.mjs +0 -223
- package/esm2022/selection/selection-change-event.mjs +0 -28
- package/esm2022/selection/selection-state.mjs +0 -104
- package/esm2022/selection/selection.service.mjs +0 -264
- package/esm2022/treelist.component.mjs +0 -3111
- package/esm2022/treelist.module.mjs +0 -183
- package/esm2022/utils.mjs +0 -113
|
@@ -1,850 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Component, Input, Output, EventEmitter, HostBinding, ViewChild, ElementRef, Inject, InjectionToken, QueryList, NgZone, Renderer2, ViewChildren, ChangeDetectorRef } from '@angular/core';
|
|
6
|
-
import { Subscription, Subject, fromEvent, merge } from 'rxjs';
|
|
7
|
-
import { delay, map, filter, tap } from 'rxjs/operators';
|
|
8
|
-
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
9
|
-
import { RowHeightService } from '../scrolling/row-height.service';
|
|
10
|
-
import { ScrollerService, PageAction, ScrollAction, ScrollBottomAction } from '../scrolling/scroller.service';
|
|
11
|
-
import { ScrollRequestService } from '../scrolling/scroll-request.service';
|
|
12
|
-
import { ColumnBase } from '../columns/column-base';
|
|
13
|
-
import { isChanged, isPresent, isUniversal, anyChanged, isNumber, requestAnimationFrame, cancelAnimationFrame } from '../utils';
|
|
14
|
-
import { ColumnsContainer } from '../columns/columns-container';
|
|
15
|
-
import { ChangeNotificationService } from '../data/change-notification.service';
|
|
16
|
-
import { syncRowsHeight } from '../layout/row-sync';
|
|
17
|
-
import { NoRecordsTemplateDirective } from './no-records-template.directive';
|
|
18
|
-
import { SuspendService } from '../scrolling/suspend.service';
|
|
19
|
-
import { expandColumns, sumColumnWidths } from "../columns/column-common";
|
|
20
|
-
import { ScrollSyncService } from "../scrolling/scroll-sync.service";
|
|
21
|
-
import { ResizeService } from "../layout/resize.service";
|
|
22
|
-
import { EventsOutsideAngularDirective, normalizeKeys, ResizeSensorComponent } from "@progress/kendo-angular-common";
|
|
23
|
-
import { BrowserSupportService } from "../layout/browser-support.service";
|
|
24
|
-
import { EditService } from '../editing/edit.service';
|
|
25
|
-
import { NavigationService } from '../navigation/navigation.service';
|
|
26
|
-
import { Keys } from '@progress/kendo-angular-common';
|
|
27
|
-
import { ColumnResizingService } from "../column-resizing/column-resizing.service";
|
|
28
|
-
import { defaultTrackBy } from '../common/default-track-by';
|
|
29
|
-
import { hasClasses, rtlScrollPosition } from './common/dom-queries';
|
|
30
|
-
import { PDFService } from '../pdf/pdf.service';
|
|
31
|
-
import { ColumnInfoService } from '../common/column-info.service';
|
|
32
|
-
import { NON_DATA_CELL_CLASSES } from './constants';
|
|
33
|
-
import { LoadingComponent } from './common/loading.component';
|
|
34
|
-
import { ResizableContainerDirective } from '../layout/resizable.directive';
|
|
35
|
-
import { TableBodyComponent } from './table-body.component';
|
|
36
|
-
import { ColGroupComponent } from './common/col-group.component';
|
|
37
|
-
import { TableDirective } from '../column-resizing/table.directive';
|
|
38
|
-
import * as i0 from "@angular/core";
|
|
39
|
-
import * as i1 from "../data/change-notification.service";
|
|
40
|
-
import * as i2 from "../scrolling/suspend.service";
|
|
41
|
-
import * as i3 from "../scrolling/scroll-sync.service";
|
|
42
|
-
import * as i4 from "../layout/resize.service";
|
|
43
|
-
import * as i5 from "../editing/edit.service";
|
|
44
|
-
import * as i6 from "../layout/browser-support.service";
|
|
45
|
-
import * as i7 from "../navigation/navigation.service";
|
|
46
|
-
import * as i8 from "../scrolling/scroll-request.service";
|
|
47
|
-
import * as i9 from "@progress/kendo-angular-l10n";
|
|
48
|
-
import * as i10 from "../column-resizing/column-resizing.service";
|
|
49
|
-
import * as i11 from "../pdf/pdf.service";
|
|
50
|
-
import * as i12 from "../common/column-info.service";
|
|
51
|
-
const elementAt = (index, elements, elementOffset) => {
|
|
52
|
-
for (let idx = 0, elementIdx = 0; idx < elements.length; idx++) {
|
|
53
|
-
const offset = elementOffset(elements[idx]);
|
|
54
|
-
if (elementIdx <= index && index <= elementIdx + offset - 1) {
|
|
55
|
-
return elements[idx];
|
|
56
|
-
}
|
|
57
|
-
elementIdx += offset;
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
const rowAt = (index, rows) => elementAt(index, rows, row => row.hasAttribute('data-treelist-view-index') ? 1 : 0);
|
|
61
|
-
const cellAt = (index, cells) => elementAt(index, cells, cell => !hasClasses(cell, NON_DATA_CELL_CLASSES) ? parseInt(cell.getAttribute('colSpan'), 10) || 1 : 0);
|
|
62
|
-
const EMPTY_OBJECT = {};
|
|
63
|
-
/**
|
|
64
|
-
* @hidden
|
|
65
|
-
*/
|
|
66
|
-
export const SCROLLER_FACTORY_TOKEN = new InjectionToken('treelist-scroll-service-factory');
|
|
67
|
-
/**
|
|
68
|
-
* @hidden
|
|
69
|
-
*/
|
|
70
|
-
export function DEFAULT_SCROLLER_FACTORY(observable) {
|
|
71
|
-
return new ScrollerService(observable);
|
|
72
|
-
}
|
|
73
|
-
const wheelDeltaY = (e) => {
|
|
74
|
-
const deltaY = e.wheelDeltaY;
|
|
75
|
-
if (e.wheelDelta && (deltaY === undefined || deltaY)) {
|
|
76
|
-
return e.wheelDelta;
|
|
77
|
-
}
|
|
78
|
-
else if (e.detail && e.axis === e.VERTICAL_AXIS) {
|
|
79
|
-
return (-e.detail) * 10;
|
|
80
|
-
}
|
|
81
|
-
return 0;
|
|
82
|
-
};
|
|
83
|
-
const preventLockedScroll = (args, element) => {
|
|
84
|
-
const delta = wheelDeltaY(args);
|
|
85
|
-
const scrollTop = element.scrollTop;
|
|
86
|
-
const allowScroll = (scrollTop === 0 && 0 < delta) || (element.scrollHeight <= element.offsetHeight + scrollTop && delta < 0);
|
|
87
|
-
if (!allowScroll) {
|
|
88
|
-
event.preventDefault();
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
const translateY = (renderer, value) => el => renderer.setStyle(el, "transform", `translateY(${value}px)`);
|
|
92
|
-
const maybeNativeElement = el => el ? el.nativeElement : null;
|
|
93
|
-
const hasScrollbar = (el, parent) => el.nativeElement.offsetWidth > parent.nativeElement.clientWidth;
|
|
94
|
-
const setHeight = renderer => ({ el, height }) => renderer.setStyle(el, "height", `${height}px`);
|
|
95
|
-
const bufferSize = 1;
|
|
96
|
-
/**
|
|
97
|
-
* @hidden
|
|
98
|
-
*/
|
|
99
|
-
export class ListComponent {
|
|
100
|
-
changeNotification;
|
|
101
|
-
suspendService;
|
|
102
|
-
ngZone;
|
|
103
|
-
renderer;
|
|
104
|
-
scrollSyncService;
|
|
105
|
-
resizeService;
|
|
106
|
-
editService;
|
|
107
|
-
supportService;
|
|
108
|
-
navigationService;
|
|
109
|
-
localization;
|
|
110
|
-
columnResizingService;
|
|
111
|
-
changeDetector;
|
|
112
|
-
pdfService;
|
|
113
|
-
columnInfo;
|
|
114
|
-
get hostClass() {
|
|
115
|
-
return true;
|
|
116
|
-
}
|
|
117
|
-
get hostRole() {
|
|
118
|
-
return 'presentation';
|
|
119
|
-
}
|
|
120
|
-
view;
|
|
121
|
-
total;
|
|
122
|
-
rowHeight;
|
|
123
|
-
take;
|
|
124
|
-
skip = 0;
|
|
125
|
-
columns = new ColumnsContainer(() => []);
|
|
126
|
-
noRecordsTemplate;
|
|
127
|
-
filterable;
|
|
128
|
-
rowClass;
|
|
129
|
-
loading;
|
|
130
|
-
trackBy = defaultTrackBy;
|
|
131
|
-
virtualColumns;
|
|
132
|
-
isVirtual;
|
|
133
|
-
expandIcons;
|
|
134
|
-
contentScroll = new EventEmitter();
|
|
135
|
-
pageChange = new EventEmitter();
|
|
136
|
-
scrollBottom = new EventEmitter();
|
|
137
|
-
totalHeight;
|
|
138
|
-
columnsStartIdx = 0;
|
|
139
|
-
get totalWidth() {
|
|
140
|
-
if (this.virtualColumns && this.columns.unlockedWidth) {
|
|
141
|
-
return this.columns.unlockedWidth;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
container;
|
|
145
|
-
table;
|
|
146
|
-
lockedContainer;
|
|
147
|
-
lockedTable;
|
|
148
|
-
resizeSensors = new QueryList();
|
|
149
|
-
scroller;
|
|
150
|
-
subscriptions = new Subscription();
|
|
151
|
-
scrollerSubscription;
|
|
152
|
-
dispatcher = new Subject();
|
|
153
|
-
rowHeightService;
|
|
154
|
-
skipScroll;
|
|
155
|
-
rebind;
|
|
156
|
-
containerScrollTop = 0;
|
|
157
|
-
viewportColumns;
|
|
158
|
-
columnsEndIdx;
|
|
159
|
-
viewportColumnsWidth;
|
|
160
|
-
scrollLeft = 0;
|
|
161
|
-
get lockedLeafColumns() {
|
|
162
|
-
return this.columns.lockedLeafColumns;
|
|
163
|
-
}
|
|
164
|
-
get nonLockedLeafColumns() {
|
|
165
|
-
return this.columns.nonLockedLeafColumns;
|
|
166
|
-
}
|
|
167
|
-
get nonLockedColumnsToRender() {
|
|
168
|
-
if (this.virtualColumns && !this.pdfService.exporting) {
|
|
169
|
-
return this.viewportColumns;
|
|
170
|
-
}
|
|
171
|
-
return this.nonLockedLeafColumns;
|
|
172
|
-
}
|
|
173
|
-
get leafColumns() {
|
|
174
|
-
return this.columns.leafColumnsToRender;
|
|
175
|
-
}
|
|
176
|
-
get lockedWidth() {
|
|
177
|
-
return expandColumns(this.lockedLeafColumns.toArray()).reduce((prev, curr) => prev + (curr.width || 0), 0);
|
|
178
|
-
}
|
|
179
|
-
get nonLockedWidth() {
|
|
180
|
-
if ((!this.rtl && this.lockedLeafColumns.length) || this.virtualColumns) {
|
|
181
|
-
return sumColumnWidths(expandColumns(this.nonLockedColumnsToRender.toArray()));
|
|
182
|
-
}
|
|
183
|
-
return undefined;
|
|
184
|
-
}
|
|
185
|
-
get isLocked() {
|
|
186
|
-
return this.lockedLeafColumns.length > 0;
|
|
187
|
-
}
|
|
188
|
-
rtl = false;
|
|
189
|
-
columnUpdateFrame;
|
|
190
|
-
hasLockedContainer;
|
|
191
|
-
constructor(scrollerFactory, changeNotification, suspendService, ngZone, renderer, scrollSyncService, resizeService, editService, supportService, navigationService, scrollRequestService, localization, columnResizingService, changeDetector, pdfService, columnInfo) {
|
|
192
|
-
this.changeNotification = changeNotification;
|
|
193
|
-
this.suspendService = suspendService;
|
|
194
|
-
this.ngZone = ngZone;
|
|
195
|
-
this.renderer = renderer;
|
|
196
|
-
this.scrollSyncService = scrollSyncService;
|
|
197
|
-
this.resizeService = resizeService;
|
|
198
|
-
this.editService = editService;
|
|
199
|
-
this.supportService = supportService;
|
|
200
|
-
this.navigationService = navigationService;
|
|
201
|
-
this.localization = localization;
|
|
202
|
-
this.columnResizingService = columnResizingService;
|
|
203
|
-
this.changeDetector = changeDetector;
|
|
204
|
-
this.pdfService = pdfService;
|
|
205
|
-
this.columnInfo = columnInfo;
|
|
206
|
-
this.scroller = scrollerFactory(this.dispatcher);
|
|
207
|
-
this.subscriptions = scrollRequestService.requests.subscribe(x => this.scrollTo(x));
|
|
208
|
-
}
|
|
209
|
-
ngOnInit() {
|
|
210
|
-
this.init();
|
|
211
|
-
this.subscriptions.add(this.ngZone.runOutsideAngular(this.handleRowSync.bind(this)));
|
|
212
|
-
this.subscriptions.add(this.ngZone.runOutsideAngular(this.handleRowNavigationLocked.bind(this)));
|
|
213
|
-
this.subscriptions.add(merge(this.columns.changes, this.resizeService.changes).subscribe(() => {
|
|
214
|
-
if (this.virtualColumns) {
|
|
215
|
-
this.ngZone.run(() => {
|
|
216
|
-
this.updateViewportColumns();
|
|
217
|
-
this.changeDetector.markForCheck();
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
}));
|
|
221
|
-
this.subscriptions.add(this.localization.changes.subscribe(({ rtl }) => this.rtl = rtl));
|
|
222
|
-
}
|
|
223
|
-
ngOnChanges(changes) {
|
|
224
|
-
if (isChanged("skip", changes) && !this.rebind) {
|
|
225
|
-
this.skipScroll = true;
|
|
226
|
-
this.container.nativeElement.scrollTop = this.rowHeightService.offset(this.skip);
|
|
227
|
-
}
|
|
228
|
-
if (anyChanged(["total", "take"], changes)) {
|
|
229
|
-
this.init();
|
|
230
|
-
}
|
|
231
|
-
this.rebind = false;
|
|
232
|
-
}
|
|
233
|
-
ngDoCheck() {
|
|
234
|
-
if (this.virtualColumns && (!this.viewportColumns || this.viewportWidthChange())) {
|
|
235
|
-
this.updateViewportColumns();
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
ngAfterViewInit() {
|
|
239
|
-
if (this.skip && this.isVirtual) {
|
|
240
|
-
this.container.nativeElement.scrollTop = this.rowHeightService.offset(this.skip);
|
|
241
|
-
}
|
|
242
|
-
this.resetNavigationViewport();
|
|
243
|
-
this.attachContainerScroll();
|
|
244
|
-
this.initResizeService();
|
|
245
|
-
}
|
|
246
|
-
ngAfterViewChecked() {
|
|
247
|
-
const isLocked = this.isLocked;
|
|
248
|
-
if (isLocked && !this.hasLockedContainer) {
|
|
249
|
-
this.syncRowsHeight();
|
|
250
|
-
}
|
|
251
|
-
this.hasLockedContainer = isLocked;
|
|
252
|
-
}
|
|
253
|
-
syncRowsHeight() {
|
|
254
|
-
if (this.lockedContainer) {
|
|
255
|
-
syncRowsHeight(this.lockedTable.nativeElement, this.table.nativeElement);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
ngOnDestroy() {
|
|
259
|
-
if (this.subscriptions) {
|
|
260
|
-
this.subscriptions.unsubscribe();
|
|
261
|
-
}
|
|
262
|
-
if (this.resizeService) {
|
|
263
|
-
this.resizeService.destroy();
|
|
264
|
-
}
|
|
265
|
-
this.cleanupScroller();
|
|
266
|
-
}
|
|
267
|
-
init() {
|
|
268
|
-
if (this.suspendService.scroll) {
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
271
|
-
this.rowHeightService = new RowHeightService(this.total, this.rowHeight);
|
|
272
|
-
this.totalHeight = this.rowHeightService.totalHeight();
|
|
273
|
-
if (!isUniversal()) {
|
|
274
|
-
this.ngZone.runOutsideAngular(this.createScroller.bind(this));
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
lockedScroll() {
|
|
278
|
-
if (!this.suspendService.scroll) {
|
|
279
|
-
const lockedScrollTop = this.lockedContainer.nativeElement.scrollTop;
|
|
280
|
-
if (lockedScrollTop !== this.containerScrollTop) {
|
|
281
|
-
this.container.nativeElement.scrollTop = this.containerScrollTop = lockedScrollTop;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
lockedMousewheel(args) {
|
|
286
|
-
if (!args.ctrlKey) {
|
|
287
|
-
preventLockedScroll(args, this.container.nativeElement);
|
|
288
|
-
const scrollDelta = wheelDeltaY(args);
|
|
289
|
-
this.container.nativeElement.scrollTop -= scrollDelta;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
lockedKeydown(args) {
|
|
293
|
-
// on some keyboards arrow keys, PageUp/Down, and Home/End are mapped to Numpad keys
|
|
294
|
-
const code = normalizeKeys(args);
|
|
295
|
-
if (code === Keys.PageDown || code === Keys.PageUp) {
|
|
296
|
-
const dir = code === Keys.PageDown ? 1 : -1;
|
|
297
|
-
const element = this.container.nativeElement;
|
|
298
|
-
element.scrollTop += element.offsetHeight * dir * 0.8;
|
|
299
|
-
args.preventDefault();
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
updateViewportColumns(range) {
|
|
303
|
-
const columns = this.columns.nonLockedLeafColumns.toArray();
|
|
304
|
-
// eslint-disable-next-line prefer-const
|
|
305
|
-
let { startIdx, endIdx, offset } = range || this.calculateViewportColumns();
|
|
306
|
-
const start = Math.max(0, startIdx - bufferSize);
|
|
307
|
-
const end = Math.min(endIdx + bufferSize, columns.length - 1);
|
|
308
|
-
if (start < startIdx) {
|
|
309
|
-
for (let idx = startIdx - 1; idx >= start; idx--) {
|
|
310
|
-
offset -= columns[idx].width;
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
const currentColumns = columns.slice(start, end + 1);
|
|
314
|
-
this.viewportColumnsWidth = currentColumns.reduce((total, column) => total + column.width, 0);
|
|
315
|
-
if (start > 0) {
|
|
316
|
-
const offsetColumn = new ColumnBase();
|
|
317
|
-
offsetColumn.width = offset;
|
|
318
|
-
currentColumns.unshift(offsetColumn);
|
|
319
|
-
}
|
|
320
|
-
this.viewportColumns = new QueryList();
|
|
321
|
-
this.viewportColumns.reset(currentColumns);
|
|
322
|
-
this.columnsStartIdx = start;
|
|
323
|
-
this.columnsEndIdx = end;
|
|
324
|
-
this.columnInfo.columnRangeChange.emit({ start, end, offset });
|
|
325
|
-
if (!range) {
|
|
326
|
-
this.updateColumnViewport(startIdx, endIdx);
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
attachContainerScroll() {
|
|
330
|
-
if (isUniversal()) {
|
|
331
|
-
return;
|
|
332
|
-
}
|
|
333
|
-
this.ngZone.runOutsideAngular(() => {
|
|
334
|
-
this.subscriptions.add(fromEvent(this.container.nativeElement, 'scroll').pipe(map((event) => event.target), filter(() => !this.suspendService.scroll), tap((target) => {
|
|
335
|
-
this.onContainerScroll(target);
|
|
336
|
-
this.resetNavigationViewport();
|
|
337
|
-
if (this.virtualColumns) {
|
|
338
|
-
this.handleColumnScroll();
|
|
339
|
-
}
|
|
340
|
-
const rowViewport = this.navigationService.viewport || EMPTY_OBJECT;
|
|
341
|
-
const columnViewport = this.navigationService.columnViewport || EMPTY_OBJECT;
|
|
342
|
-
this.contentScroll.emit({
|
|
343
|
-
scrollLeft: target.scrollLeft,
|
|
344
|
-
scrollTop: target.scrollTop,
|
|
345
|
-
startRow: rowViewport.firstItemIndex,
|
|
346
|
-
endRow: rowViewport.lastItemIndex,
|
|
347
|
-
startColumn: columnViewport.firstItemIndex,
|
|
348
|
-
endColumn: columnViewport.lastItemIndex
|
|
349
|
-
});
|
|
350
|
-
})).subscribe(this.dispatcher));
|
|
351
|
-
});
|
|
352
|
-
this.scrollSyncService.registerEmitter(this.container.nativeElement, "body");
|
|
353
|
-
}
|
|
354
|
-
createScroller() {
|
|
355
|
-
this.cleanupScroller();
|
|
356
|
-
const observable = this.scroller
|
|
357
|
-
.create(this.rowHeightService, this.skip, this.take, this.total, this.containerScrollTop);
|
|
358
|
-
this.skipScroll = false;
|
|
359
|
-
this.scrollerSubscription = observable.pipe(filter((x) => x instanceof PageAction), filter(() => {
|
|
360
|
-
const temp = this.skipScroll;
|
|
361
|
-
this.skipScroll = false;
|
|
362
|
-
return !temp;
|
|
363
|
-
}), tap(() => this.rebind = true))
|
|
364
|
-
.subscribe((x) => this.ngZone.run(() => this.pageChange.emit(x)));
|
|
365
|
-
this.scrollerSubscription.add(observable.pipe(filter((x) => x instanceof ScrollAction))
|
|
366
|
-
.subscribe(this.scroll.bind(this)));
|
|
367
|
-
this.scrollerSubscription.add(observable.pipe(filter((x) => x instanceof ScrollBottomAction))
|
|
368
|
-
.subscribe(() => this.scrollBottom.emit()));
|
|
369
|
-
}
|
|
370
|
-
scroll({ offset = 0 }) {
|
|
371
|
-
if (this.isVirtual) {
|
|
372
|
-
[
|
|
373
|
-
maybeNativeElement(this.table),
|
|
374
|
-
maybeNativeElement(this.lockedTable)
|
|
375
|
-
].filter(isPresent).forEach(translateY(this.renderer, offset));
|
|
376
|
-
}
|
|
377
|
-
this.resetNavigationViewport();
|
|
378
|
-
}
|
|
379
|
-
onContainerScroll({ scrollTop }) {
|
|
380
|
-
this.containerScrollTop = scrollTop;
|
|
381
|
-
if (this.lockedContainer) {
|
|
382
|
-
this.lockedContainer.nativeElement.scrollTop = scrollTop;
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
handleRowSync() {
|
|
386
|
-
const isLocked = () => isPresent(this.lockedContainer);
|
|
387
|
-
return merge(this.changeNotification.changes, this.editService.changed, this.resizeService.changes, this.columnResizingService.changes
|
|
388
|
-
.pipe(filter(change => change.type === 'end')), this.supportService.changes)
|
|
389
|
-
.pipe(tap(() => this.resetNavigationViewport()), filter(isLocked))
|
|
390
|
-
.subscribe(() => {
|
|
391
|
-
const scrollTop = this.container.nativeElement.scrollTop;
|
|
392
|
-
const scrollLeft = this.container.nativeElement.scrollLeft;
|
|
393
|
-
this.syncRowsHeight();
|
|
394
|
-
this.syncContainerHeight();
|
|
395
|
-
this.lockedContainer.nativeElement.scrollTop = this.container.nativeElement.scrollTop = scrollTop;
|
|
396
|
-
// fixes scroll left position in IE when editing
|
|
397
|
-
this.container.nativeElement.scrollLeft = scrollLeft;
|
|
398
|
-
this.resizeSensors.forEach(sensor => sensor.acceptSize());
|
|
399
|
-
});
|
|
400
|
-
}
|
|
401
|
-
handleRowNavigationLocked() {
|
|
402
|
-
return this.navigationService.changes.pipe(filter(() => isPresent(this.lockedContainer)), delay(10)).subscribe((args) => {
|
|
403
|
-
if (this.lockedLeafColumns.length <= args.prevColIndex && args.colIndex < this.lockedLeafColumns.length) {
|
|
404
|
-
const cell = this.navigationService.activeCell;
|
|
405
|
-
if (cell && cell.colIndex + cell.colSpan < args.prevColIndex) {
|
|
406
|
-
this.container.nativeElement.scrollLeft = 0;
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
});
|
|
410
|
-
}
|
|
411
|
-
scrollToVirtualRow(itemIndex) {
|
|
412
|
-
const offset = this.rowHeightService.offset(itemIndex);
|
|
413
|
-
this.container.nativeElement.scrollTop = offset;
|
|
414
|
-
this.resetNavigationViewport();
|
|
415
|
-
}
|
|
416
|
-
scrollTo({ row, column }) {
|
|
417
|
-
if (isNumber(row)) {
|
|
418
|
-
if (this.isVirtual) {
|
|
419
|
-
this.scrollToVirtualRow(row);
|
|
420
|
-
}
|
|
421
|
-
else {
|
|
422
|
-
const element = rowAt(row, this.table.nativeElement.rows);
|
|
423
|
-
if (element) {
|
|
424
|
-
this.container.nativeElement.scrollTop = element.offsetTop;
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
if (isNumber(column)) {
|
|
429
|
-
column -= this.lockedLeafColumns.length;
|
|
430
|
-
if (this.virtualColumns) {
|
|
431
|
-
const columns = this.columns.leafColumnsToRender;
|
|
432
|
-
let offset = 0;
|
|
433
|
-
for (let idx = 0; idx < column; idx++) {
|
|
434
|
-
offset += columns[idx].width || 0;
|
|
435
|
-
}
|
|
436
|
-
this.container.nativeElement.scrollLeft = this.normalizeScrollLeft(offset);
|
|
437
|
-
}
|
|
438
|
-
else {
|
|
439
|
-
const firstRow = rowAt(0, this.table.nativeElement.rows);
|
|
440
|
-
if (firstRow) {
|
|
441
|
-
const element = cellAt(column, firstRow.cells);
|
|
442
|
-
if (element) {
|
|
443
|
-
this.container.nativeElement.scrollLeft = this.elementScrollLeft(element);
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
resetNavigationViewport() {
|
|
450
|
-
if (!this.container ||
|
|
451
|
-
!this.navigationService.needsViewport() || this.view.length === 0) {
|
|
452
|
-
return;
|
|
453
|
-
}
|
|
454
|
-
const { scrollTop, offsetHeight } = this.container.nativeElement;
|
|
455
|
-
const scrollBottom = scrollTop + offsetHeight;
|
|
456
|
-
const firstItemIndex = this.rowHeightService.index(scrollTop);
|
|
457
|
-
let lastItemIndex = this.rowHeightService.index(scrollBottom);
|
|
458
|
-
const lastItemOffset = this.rowHeightService.offset(lastItemIndex);
|
|
459
|
-
const lastItemOverflows = lastItemOffset + this.rowHeight > scrollBottom;
|
|
460
|
-
if (lastItemIndex > 0 && lastItemOverflows) {
|
|
461
|
-
lastItemIndex--;
|
|
462
|
-
}
|
|
463
|
-
this.navigationService.setViewport(firstItemIndex, lastItemIndex);
|
|
464
|
-
}
|
|
465
|
-
cleanupScroller() {
|
|
466
|
-
if (this.scrollerSubscription) {
|
|
467
|
-
this.scrollerSubscription.unsubscribe();
|
|
468
|
-
}
|
|
469
|
-
if (this.scroller) {
|
|
470
|
-
this.scroller.destroy();
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
initResizeService() {
|
|
474
|
-
this.resizeService.connect(merge(...this.resizeSensors.map(sensor => sensor.resize)));
|
|
475
|
-
}
|
|
476
|
-
syncContainerHeight() {
|
|
477
|
-
[maybeNativeElement(this.lockedContainer)]
|
|
478
|
-
.filter(isPresent)
|
|
479
|
-
.map(el => {
|
|
480
|
-
el.style.height = '';
|
|
481
|
-
let height = this.container.nativeElement.offsetHeight;
|
|
482
|
-
if (hasScrollbar(this.table, this.container)) {
|
|
483
|
-
height -= this.supportService.scrollbarWidth;
|
|
484
|
-
}
|
|
485
|
-
return { el, height };
|
|
486
|
-
})
|
|
487
|
-
.forEach(setHeight(this.renderer));
|
|
488
|
-
}
|
|
489
|
-
handleColumnScroll() {
|
|
490
|
-
const container = this.container.nativeElement;
|
|
491
|
-
const scrollLeft = container.scrollLeft;
|
|
492
|
-
if (this.scrollLeft !== scrollLeft) {
|
|
493
|
-
this.scrollLeft = scrollLeft;
|
|
494
|
-
const range = this.calculateViewportColumns();
|
|
495
|
-
this.updateColumnViewport(range.startIdx, range.endIdx);
|
|
496
|
-
if (range.startIdx < this.columnsStartIdx || this.columnsEndIdx < range.endIdx) {
|
|
497
|
-
cancelAnimationFrame(this.columnUpdateFrame);
|
|
498
|
-
this.columnUpdateFrame = requestAnimationFrame(() => {
|
|
499
|
-
this.ngZone.run(() => {
|
|
500
|
-
this.updateViewportColumns(range);
|
|
501
|
-
this.changeDetector.markForCheck();
|
|
502
|
-
});
|
|
503
|
-
});
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
updateColumnViewport(startIdx, endIdx) {
|
|
508
|
-
const lockedCount = this.lockedLeafColumns.length;
|
|
509
|
-
const leafColumns = this.nonLockedLeafColumns.toArray();
|
|
510
|
-
const viewportStart = lockedCount + startIdx;
|
|
511
|
-
let viewportEnd = lockedCount + endIdx;
|
|
512
|
-
for (let idx = 0; idx < leafColumns.length; idx++) {
|
|
513
|
-
const column = leafColumns[idx];
|
|
514
|
-
if (column.isSpanColumn) {
|
|
515
|
-
viewportEnd += column.childColumns.length;
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
this.navigationService.setColumnViewport(viewportStart, viewportEnd);
|
|
519
|
-
}
|
|
520
|
-
calculateViewportColumns() {
|
|
521
|
-
const { scrollLeft, clientWidth } = this.container.nativeElement;
|
|
522
|
-
const columns = this.columns.nonLockedLeafColumns.toArray();
|
|
523
|
-
const normalizedScrollLeft = this.normalizeScrollLeft(scrollLeft);
|
|
524
|
-
const viewportEnd = normalizedScrollLeft + clientWidth;
|
|
525
|
-
let startIdx;
|
|
526
|
-
let endIdx = 0;
|
|
527
|
-
let current = 0;
|
|
528
|
-
let offset = 0;
|
|
529
|
-
let idx;
|
|
530
|
-
for (idx = 0; idx < columns.length; idx++) {
|
|
531
|
-
const column = columns[idx];
|
|
532
|
-
current += column.width || 0;
|
|
533
|
-
if (startIdx === undefined && current > normalizedScrollLeft) {
|
|
534
|
-
startIdx = idx;
|
|
535
|
-
offset = current - (column.width || 0);
|
|
536
|
-
}
|
|
537
|
-
if (current >= viewportEnd) {
|
|
538
|
-
endIdx = idx;
|
|
539
|
-
break;
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
if (!endIdx && idx > 0) {
|
|
543
|
-
endIdx = columns.length - 1;
|
|
544
|
-
}
|
|
545
|
-
return { startIdx, endIdx, offset };
|
|
546
|
-
}
|
|
547
|
-
viewportWidthChange() {
|
|
548
|
-
const currentWidth = this.viewportColumns.toArray().reduce((total, column) => total + column.width, 0);
|
|
549
|
-
return currentWidth !== this.viewportColumnsWidth;
|
|
550
|
-
}
|
|
551
|
-
normalizeScrollLeft(position) {
|
|
552
|
-
return this.rtl ? rtlScrollPosition(position, this.container.nativeElement, this.supportService.rtlScrollLeft) : position;
|
|
553
|
-
}
|
|
554
|
-
elementScrollLeft(element) {
|
|
555
|
-
if (this.rtl) {
|
|
556
|
-
return this.normalizeScrollLeft(this.container.nativeElement.scrollWidth - element.offsetLeft - element.offsetWidth);
|
|
557
|
-
}
|
|
558
|
-
return element.offsetLeft;
|
|
559
|
-
}
|
|
560
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ListComponent, deps: [{ token: SCROLLER_FACTORY_TOKEN }, { token: i1.ChangeNotificationService }, { token: i2.SuspendService }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i3.ScrollSyncService }, { token: i4.ResizeService }, { token: i5.EditService }, { token: i6.BrowserSupportService }, { token: i7.NavigationService }, { token: i8.ScrollRequestService }, { token: i9.LocalizationService }, { token: i10.ColumnResizingService }, { token: i0.ChangeDetectorRef }, { token: i11.PDFService }, { token: i12.ColumnInfoService }], target: i0.ɵɵFactoryTarget.Component });
|
|
561
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ListComponent, isStandalone: true, selector: "kendo-treelist-list", inputs: { view: "view", total: "total", rowHeight: "rowHeight", take: "take", skip: "skip", columns: "columns", noRecordsTemplate: "noRecordsTemplate", filterable: "filterable", rowClass: "rowClass", loading: "loading", trackBy: "trackBy", virtualColumns: "virtualColumns", isVirtual: "isVirtual", expandIcons: "expandIcons" }, outputs: { contentScroll: "contentScroll", pageChange: "pageChange", scrollBottom: "scrollBottom" }, host: { properties: { "class.k-grid-container": "this.hostClass", "attr.role": "this.hostRole" } }, providers: [
|
|
562
|
-
{
|
|
563
|
-
provide: SCROLLER_FACTORY_TOKEN,
|
|
564
|
-
useValue: DEFAULT_SCROLLER_FACTORY
|
|
565
|
-
}
|
|
566
|
-
], viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, static: true }, { propertyName: "table", first: true, predicate: ["table"], descendants: true, static: true }, { propertyName: "lockedContainer", first: true, predicate: ["lockedContainer"], descendants: true }, { propertyName: "lockedTable", first: true, predicate: ["lockedTable"], descendants: true }, { propertyName: "resizeSensors", predicate: ResizeSensorComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: `
|
|
567
|
-
@if (isLocked) {
|
|
568
|
-
<div #lockedContainer class="k-grid-content-locked" role="presentation"
|
|
569
|
-
[style.width.px]="lockedWidth"
|
|
570
|
-
[kendoEventsOutsideAngular]="{
|
|
571
|
-
keydown: lockedKeydown,
|
|
572
|
-
scroll: lockedScroll,
|
|
573
|
-
mousewheel: lockedMousewheel,
|
|
574
|
-
DOMMouseScroll: lockedMousewheel
|
|
575
|
-
}"
|
|
576
|
-
[scope]="this">
|
|
577
|
-
<div role="presentation">
|
|
578
|
-
<table
|
|
579
|
-
kendoTreeListResizableTable
|
|
580
|
-
[locked]="true"
|
|
581
|
-
#lockedTable
|
|
582
|
-
class="k-table k-grid-table k-table-md"
|
|
583
|
-
role="presentation"
|
|
584
|
-
[style.width.px]="lockedWidth">
|
|
585
|
-
<colgroup
|
|
586
|
-
kendoTreeListColGroup
|
|
587
|
-
[columns]="$any(lockedLeafColumns)">
|
|
588
|
-
</colgroup>
|
|
589
|
-
<tbody kendoTreeListTableBody
|
|
590
|
-
role="presentation"
|
|
591
|
-
[isLocked]="true"
|
|
592
|
-
[view]="view"
|
|
593
|
-
[noRecordsText]="''"
|
|
594
|
-
[columns]="$any(lockedLeafColumns)"
|
|
595
|
-
[totalColumnsCount]="leafColumns.length"
|
|
596
|
-
[totalColumns]="columns"
|
|
597
|
-
[skip]="skip"
|
|
598
|
-
[trackBy]="trackBy"
|
|
599
|
-
[filterable]="filterable"
|
|
600
|
-
[rowClass]="rowClass"
|
|
601
|
-
[expandIcons]="expandIcons">
|
|
602
|
-
</tbody>
|
|
603
|
-
</table>
|
|
604
|
-
<kendo-resize-sensor></kendo-resize-sensor>
|
|
605
|
-
</div>
|
|
606
|
-
@if (isVirtual) {
|
|
607
|
-
<div class="k-height-container" role="presentation">
|
|
608
|
-
<div [style.height.px]="totalHeight"></div>
|
|
609
|
-
</div>
|
|
610
|
-
}
|
|
611
|
-
</div>
|
|
612
|
-
}
|
|
613
|
-
<div
|
|
614
|
-
#container
|
|
615
|
-
class="k-grid-content k-virtual-content"
|
|
616
|
-
[kendoTreeListResizableContainer]="lockedLeafColumns.length > 0"
|
|
617
|
-
[lockedWidth]="lockedWidth + 1"
|
|
618
|
-
tabindex="-1"
|
|
619
|
-
>
|
|
620
|
-
<div role="presentation">
|
|
621
|
-
<table
|
|
622
|
-
[style.width.px]="nonLockedWidth"
|
|
623
|
-
#table
|
|
624
|
-
kendoTreeListResizableTable
|
|
625
|
-
[virtualColumns]="virtualColumns"
|
|
626
|
-
class="k-table k-grid-table k-table-md"
|
|
627
|
-
role="presentation">
|
|
628
|
-
<colgroup
|
|
629
|
-
kendoTreeListColGroup
|
|
630
|
-
[columns]="$any(nonLockedColumnsToRender)">
|
|
631
|
-
</colgroup>
|
|
632
|
-
<tbody kendoTreeListTableBody
|
|
633
|
-
role="rowgroup"
|
|
634
|
-
[view]="view"
|
|
635
|
-
[columns]="$any(nonLockedColumnsToRender)"
|
|
636
|
-
[allColumns]="$any(nonLockedLeafColumns)"
|
|
637
|
-
[noRecordsTemplate]="noRecordsTemplate"
|
|
638
|
-
[lockedColumnsCount]="lockedLeafColumns.length"
|
|
639
|
-
[totalColumnsCount]="leafColumns.length"
|
|
640
|
-
[totalColumns]="columns"
|
|
641
|
-
[skip]="skip"
|
|
642
|
-
[trackBy]="trackBy"
|
|
643
|
-
[filterable]="filterable"
|
|
644
|
-
[rowClass]="rowClass"
|
|
645
|
-
[virtualColumns]="virtualColumns"
|
|
646
|
-
[expandIcons]="expandIcons">
|
|
647
|
-
</tbody>
|
|
648
|
-
</table>
|
|
649
|
-
@if (isLocked) {
|
|
650
|
-
<kendo-resize-sensor></kendo-resize-sensor>
|
|
651
|
-
}
|
|
652
|
-
</div>
|
|
653
|
-
@if (isLocked || virtualColumns) {
|
|
654
|
-
<kendo-resize-sensor></kendo-resize-sensor>
|
|
655
|
-
}
|
|
656
|
-
@if (isVirtual) {
|
|
657
|
-
<div class="k-height-container" role="presentation">
|
|
658
|
-
<div [style.height.px]="totalHeight"></div>
|
|
659
|
-
</div>
|
|
660
|
-
}
|
|
661
|
-
@if (virtualColumns) {
|
|
662
|
-
<div class="k-width-container" role="presentation">
|
|
663
|
-
<div [style.width.px]="totalWidth"></div>
|
|
664
|
-
</div>
|
|
665
|
-
}
|
|
666
|
-
</div>
|
|
667
|
-
@if (loading) {
|
|
668
|
-
<div kendoTreeListLoading>
|
|
669
|
-
</div>
|
|
670
|
-
}
|
|
671
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { kind: "directive", type: TableDirective, selector: "[kendoTreeListResizableTable]", inputs: ["locked", "virtualColumns"] }, { kind: "component", type: ColGroupComponent, selector: "[kendoTreeListColGroup]", inputs: ["columns"] }, { kind: "component", type: TableBodyComponent, selector: "[kendoTreeListTableBody]", inputs: ["columns", "allColumns", "noRecordsTemplate", "view", "skip", "filterable", "noRecordsText", "isLocked", "lockedColumnsCount", "totalColumnsCount", "virtualColumns", "expandIcons", "trackBy", "totalColumns", "rowClass"] }, { kind: "component", type: ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }, { kind: "directive", type: ResizableContainerDirective, selector: "[kendoTreeListResizableContainer]", inputs: ["lockedWidth", "kendoTreeListResizableContainer"] }, { kind: "component", type: LoadingComponent, selector: "[kendoTreeListLoading]" }] });
|
|
672
|
-
}
|
|
673
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ListComponent, decorators: [{
|
|
674
|
-
type: Component,
|
|
675
|
-
args: [{
|
|
676
|
-
providers: [
|
|
677
|
-
{
|
|
678
|
-
provide: SCROLLER_FACTORY_TOKEN,
|
|
679
|
-
useValue: DEFAULT_SCROLLER_FACTORY
|
|
680
|
-
}
|
|
681
|
-
],
|
|
682
|
-
selector: 'kendo-treelist-list',
|
|
683
|
-
template: `
|
|
684
|
-
@if (isLocked) {
|
|
685
|
-
<div #lockedContainer class="k-grid-content-locked" role="presentation"
|
|
686
|
-
[style.width.px]="lockedWidth"
|
|
687
|
-
[kendoEventsOutsideAngular]="{
|
|
688
|
-
keydown: lockedKeydown,
|
|
689
|
-
scroll: lockedScroll,
|
|
690
|
-
mousewheel: lockedMousewheel,
|
|
691
|
-
DOMMouseScroll: lockedMousewheel
|
|
692
|
-
}"
|
|
693
|
-
[scope]="this">
|
|
694
|
-
<div role="presentation">
|
|
695
|
-
<table
|
|
696
|
-
kendoTreeListResizableTable
|
|
697
|
-
[locked]="true"
|
|
698
|
-
#lockedTable
|
|
699
|
-
class="k-table k-grid-table k-table-md"
|
|
700
|
-
role="presentation"
|
|
701
|
-
[style.width.px]="lockedWidth">
|
|
702
|
-
<colgroup
|
|
703
|
-
kendoTreeListColGroup
|
|
704
|
-
[columns]="$any(lockedLeafColumns)">
|
|
705
|
-
</colgroup>
|
|
706
|
-
<tbody kendoTreeListTableBody
|
|
707
|
-
role="presentation"
|
|
708
|
-
[isLocked]="true"
|
|
709
|
-
[view]="view"
|
|
710
|
-
[noRecordsText]="''"
|
|
711
|
-
[columns]="$any(lockedLeafColumns)"
|
|
712
|
-
[totalColumnsCount]="leafColumns.length"
|
|
713
|
-
[totalColumns]="columns"
|
|
714
|
-
[skip]="skip"
|
|
715
|
-
[trackBy]="trackBy"
|
|
716
|
-
[filterable]="filterable"
|
|
717
|
-
[rowClass]="rowClass"
|
|
718
|
-
[expandIcons]="expandIcons">
|
|
719
|
-
</tbody>
|
|
720
|
-
</table>
|
|
721
|
-
<kendo-resize-sensor></kendo-resize-sensor>
|
|
722
|
-
</div>
|
|
723
|
-
@if (isVirtual) {
|
|
724
|
-
<div class="k-height-container" role="presentation">
|
|
725
|
-
<div [style.height.px]="totalHeight"></div>
|
|
726
|
-
</div>
|
|
727
|
-
}
|
|
728
|
-
</div>
|
|
729
|
-
}
|
|
730
|
-
<div
|
|
731
|
-
#container
|
|
732
|
-
class="k-grid-content k-virtual-content"
|
|
733
|
-
[kendoTreeListResizableContainer]="lockedLeafColumns.length > 0"
|
|
734
|
-
[lockedWidth]="lockedWidth + 1"
|
|
735
|
-
tabindex="-1"
|
|
736
|
-
>
|
|
737
|
-
<div role="presentation">
|
|
738
|
-
<table
|
|
739
|
-
[style.width.px]="nonLockedWidth"
|
|
740
|
-
#table
|
|
741
|
-
kendoTreeListResizableTable
|
|
742
|
-
[virtualColumns]="virtualColumns"
|
|
743
|
-
class="k-table k-grid-table k-table-md"
|
|
744
|
-
role="presentation">
|
|
745
|
-
<colgroup
|
|
746
|
-
kendoTreeListColGroup
|
|
747
|
-
[columns]="$any(nonLockedColumnsToRender)">
|
|
748
|
-
</colgroup>
|
|
749
|
-
<tbody kendoTreeListTableBody
|
|
750
|
-
role="rowgroup"
|
|
751
|
-
[view]="view"
|
|
752
|
-
[columns]="$any(nonLockedColumnsToRender)"
|
|
753
|
-
[allColumns]="$any(nonLockedLeafColumns)"
|
|
754
|
-
[noRecordsTemplate]="noRecordsTemplate"
|
|
755
|
-
[lockedColumnsCount]="lockedLeafColumns.length"
|
|
756
|
-
[totalColumnsCount]="leafColumns.length"
|
|
757
|
-
[totalColumns]="columns"
|
|
758
|
-
[skip]="skip"
|
|
759
|
-
[trackBy]="trackBy"
|
|
760
|
-
[filterable]="filterable"
|
|
761
|
-
[rowClass]="rowClass"
|
|
762
|
-
[virtualColumns]="virtualColumns"
|
|
763
|
-
[expandIcons]="expandIcons">
|
|
764
|
-
</tbody>
|
|
765
|
-
</table>
|
|
766
|
-
@if (isLocked) {
|
|
767
|
-
<kendo-resize-sensor></kendo-resize-sensor>
|
|
768
|
-
}
|
|
769
|
-
</div>
|
|
770
|
-
@if (isLocked || virtualColumns) {
|
|
771
|
-
<kendo-resize-sensor></kendo-resize-sensor>
|
|
772
|
-
}
|
|
773
|
-
@if (isVirtual) {
|
|
774
|
-
<div class="k-height-container" role="presentation">
|
|
775
|
-
<div [style.height.px]="totalHeight"></div>
|
|
776
|
-
</div>
|
|
777
|
-
}
|
|
778
|
-
@if (virtualColumns) {
|
|
779
|
-
<div class="k-width-container" role="presentation">
|
|
780
|
-
<div [style.width.px]="totalWidth"></div>
|
|
781
|
-
</div>
|
|
782
|
-
}
|
|
783
|
-
</div>
|
|
784
|
-
@if (loading) {
|
|
785
|
-
<div kendoTreeListLoading>
|
|
786
|
-
</div>
|
|
787
|
-
}
|
|
788
|
-
`,
|
|
789
|
-
standalone: true,
|
|
790
|
-
imports: [EventsOutsideAngularDirective, TableDirective, ColGroupComponent, TableBodyComponent, ResizeSensorComponent, ResizableContainerDirective, LoadingComponent]
|
|
791
|
-
}]
|
|
792
|
-
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
793
|
-
type: Inject,
|
|
794
|
-
args: [SCROLLER_FACTORY_TOKEN]
|
|
795
|
-
}] }, { type: i1.ChangeNotificationService }, { type: i2.SuspendService }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: i3.ScrollSyncService }, { type: i4.ResizeService }, { type: i5.EditService }, { type: i6.BrowserSupportService }, { type: i7.NavigationService }, { type: i8.ScrollRequestService }, { type: i9.LocalizationService }, { type: i10.ColumnResizingService }, { type: i0.ChangeDetectorRef }, { type: i11.PDFService }, { type: i12.ColumnInfoService }], propDecorators: { hostClass: [{
|
|
796
|
-
type: HostBinding,
|
|
797
|
-
args: ["class.k-grid-container"]
|
|
798
|
-
}], hostRole: [{
|
|
799
|
-
type: HostBinding,
|
|
800
|
-
args: ["attr.role"]
|
|
801
|
-
}], view: [{
|
|
802
|
-
type: Input
|
|
803
|
-
}], total: [{
|
|
804
|
-
type: Input
|
|
805
|
-
}], rowHeight: [{
|
|
806
|
-
type: Input
|
|
807
|
-
}], take: [{
|
|
808
|
-
type: Input
|
|
809
|
-
}], skip: [{
|
|
810
|
-
type: Input
|
|
811
|
-
}], columns: [{
|
|
812
|
-
type: Input
|
|
813
|
-
}], noRecordsTemplate: [{
|
|
814
|
-
type: Input
|
|
815
|
-
}], filterable: [{
|
|
816
|
-
type: Input
|
|
817
|
-
}], rowClass: [{
|
|
818
|
-
type: Input
|
|
819
|
-
}], loading: [{
|
|
820
|
-
type: Input
|
|
821
|
-
}], trackBy: [{
|
|
822
|
-
type: Input
|
|
823
|
-
}], virtualColumns: [{
|
|
824
|
-
type: Input
|
|
825
|
-
}], isVirtual: [{
|
|
826
|
-
type: Input
|
|
827
|
-
}], expandIcons: [{
|
|
828
|
-
type: Input
|
|
829
|
-
}], contentScroll: [{
|
|
830
|
-
type: Output
|
|
831
|
-
}], pageChange: [{
|
|
832
|
-
type: Output
|
|
833
|
-
}], scrollBottom: [{
|
|
834
|
-
type: Output
|
|
835
|
-
}], container: [{
|
|
836
|
-
type: ViewChild,
|
|
837
|
-
args: ['container', { static: true }]
|
|
838
|
-
}], table: [{
|
|
839
|
-
type: ViewChild,
|
|
840
|
-
args: ['table', { static: true }]
|
|
841
|
-
}], lockedContainer: [{
|
|
842
|
-
type: ViewChild,
|
|
843
|
-
args: ['lockedContainer', { static: false }]
|
|
844
|
-
}], lockedTable: [{
|
|
845
|
-
type: ViewChild,
|
|
846
|
-
args: ['lockedTable', { static: false }]
|
|
847
|
-
}], resizeSensors: [{
|
|
848
|
-
type: ViewChildren,
|
|
849
|
-
args: [ResizeSensorComponent]
|
|
850
|
-
}] } });
|