@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,70 +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 { Injectable, EventEmitter } from '@angular/core';
|
|
6
|
-
import { MenuTabbingService } from '../filtering/menu/menu-tabbing.service';
|
|
7
|
-
import * as i0 from "@angular/core";
|
|
8
|
-
import * as i1 from "../filtering/menu/menu-tabbing.service";
|
|
9
|
-
/**
|
|
10
|
-
* Represents the service passed to the [`ColumnMenuTemplate`]({% slug api_treelist_columnmenutemplatedirective %}) directive.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```html
|
|
14
|
-
* <kendo-treelist ...>
|
|
15
|
-
* <ng-template
|
|
16
|
-
* kendoTreeListColumnMenuTemplate
|
|
17
|
-
* let-service="service"
|
|
18
|
-
* let-column="column">
|
|
19
|
-
* <kendo-treelist-columnmenu-sort [service]="service">
|
|
20
|
-
* </ng-template>
|
|
21
|
-
* </kendo-treelist>
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export class ColumnMenuService {
|
|
25
|
-
/**
|
|
26
|
-
* @hidden
|
|
27
|
-
*/
|
|
28
|
-
menuTabbingService;
|
|
29
|
-
/**
|
|
30
|
-
* @hidden
|
|
31
|
-
*/
|
|
32
|
-
closeMenu = new EventEmitter();
|
|
33
|
-
/**
|
|
34
|
-
* @hidden
|
|
35
|
-
*/
|
|
36
|
-
column;
|
|
37
|
-
/**
|
|
38
|
-
* @hidden
|
|
39
|
-
*/
|
|
40
|
-
sort;
|
|
41
|
-
/**
|
|
42
|
-
* @hidden
|
|
43
|
-
*/
|
|
44
|
-
filter;
|
|
45
|
-
/**
|
|
46
|
-
* @hidden
|
|
47
|
-
*/
|
|
48
|
-
sortable;
|
|
49
|
-
/**
|
|
50
|
-
* @hidden
|
|
51
|
-
*/
|
|
52
|
-
columnMenuContainer;
|
|
53
|
-
/**
|
|
54
|
-
* @hidden
|
|
55
|
-
*/
|
|
56
|
-
constructor(menuTabbingService) {
|
|
57
|
-
this.menuTabbingService = menuTabbingService;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Closes the column menu.
|
|
61
|
-
*/
|
|
62
|
-
close() {
|
|
63
|
-
this.closeMenu.emit();
|
|
64
|
-
}
|
|
65
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ColumnMenuService, deps: [{ token: i1.MenuTabbingService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
66
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ColumnMenuService });
|
|
67
|
-
}
|
|
68
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ColumnMenuService, decorators: [{
|
|
69
|
-
type: Injectable
|
|
70
|
-
}], ctorParameters: () => [{ type: i1.MenuTabbingService }] });
|
|
@@ -1,19 +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
|
-
/**
|
|
6
|
-
* Represents the arguments for the `columnVisibilityChange` event.
|
|
7
|
-
*/
|
|
8
|
-
export class ColumnVisibilityChangeEvent {
|
|
9
|
-
/**
|
|
10
|
-
* Contains the columns whose visibility changes.
|
|
11
|
-
*/
|
|
12
|
-
columns;
|
|
13
|
-
/**
|
|
14
|
-
* @hidden
|
|
15
|
-
*/
|
|
16
|
-
constructor(columns) {
|
|
17
|
-
this.columns = columns;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,44 +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
|
-
/**
|
|
6
|
-
* @hidden
|
|
7
|
-
*/
|
|
8
|
-
export const hasFilter = (settings, column) => settings.filter !== false && column.field && column.filterable;
|
|
9
|
-
/**
|
|
10
|
-
* @hidden
|
|
11
|
-
*/
|
|
12
|
-
export const hasSort = (settings, column) => settings.sort !== false && column.field && column.sortable;
|
|
13
|
-
/**
|
|
14
|
-
* @hidden
|
|
15
|
-
*/
|
|
16
|
-
export const hasLock = (settings, column) => settings.lock && column.lockable && !(column.parent && !column.parent.isSpanColumn);
|
|
17
|
-
/**
|
|
18
|
-
* @hidden
|
|
19
|
-
*/
|
|
20
|
-
export const hasColumnChooser = (settings) => settings.columnChooser !== false;
|
|
21
|
-
/**
|
|
22
|
-
* @hidden
|
|
23
|
-
*/
|
|
24
|
-
export const hasAutoSizeColumn = (settings) => settings.autoSizeColumn;
|
|
25
|
-
/**
|
|
26
|
-
* @hidden
|
|
27
|
-
*/
|
|
28
|
-
export const hasAutoSizeAllColumns = (settings) => settings.autoSizeAllColumns;
|
|
29
|
-
/**
|
|
30
|
-
* @hidden
|
|
31
|
-
*/
|
|
32
|
-
export const autoSizeColumn = (treelist, service, column) => {
|
|
33
|
-
column ? treelist.autoFitColumn(column) : treelist.autoFitColumns();
|
|
34
|
-
service.close();
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* @hidden
|
|
38
|
-
*/
|
|
39
|
-
export const hasItems = (settings, column) => hasAutoSizeAllColumns(settings) ||
|
|
40
|
-
hasColumnChooser(settings) ||
|
|
41
|
-
hasFilter(settings, column) ||
|
|
42
|
-
hasAutoSizeColumn(settings) ||
|
|
43
|
-
hasLock(settings, column) ||
|
|
44
|
-
hasSort(settings, column);
|
|
@@ -1,226 +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 { ChangeDetectorRef, Directive, ElementRef, Host, HostBinding, HostListener, Input, NgZone } from '@angular/core';
|
|
6
|
-
import { Subscription, of } from 'rxjs';
|
|
7
|
-
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
8
|
-
import { isBlank, isPresent, isTruthy } from '../utils';
|
|
9
|
-
import { ColumnBase } from '../columns/column-base';
|
|
10
|
-
import { expandColumns, leafColumns, columnsToRender } from '../columns/column-common';
|
|
11
|
-
import { DraggableDirective } from '@progress/kendo-angular-common';
|
|
12
|
-
import { ColumnResizingService } from './column-resizing.service';
|
|
13
|
-
import { delay, takeUntil, filter, take, tap, switchMap, map } from 'rxjs/operators';
|
|
14
|
-
import * as i0 from "@angular/core";
|
|
15
|
-
import * as i1 from "@progress/kendo-angular-common";
|
|
16
|
-
import * as i2 from "./column-resizing.service";
|
|
17
|
-
import * as i3 from "@progress/kendo-angular-l10n";
|
|
18
|
-
/**
|
|
19
|
-
* @hidden
|
|
20
|
-
*/
|
|
21
|
-
const fromPercentage = (value, percent) => {
|
|
22
|
-
const sign = percent < 0 ? -1 : 1;
|
|
23
|
-
return Math.ceil((Math.abs(percent) / 100) * value) * sign;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* @hidden
|
|
27
|
-
*/
|
|
28
|
-
const toPercentage = (value, whole) => (value / whole) * 100;
|
|
29
|
-
/**
|
|
30
|
-
* @hidden
|
|
31
|
-
*/
|
|
32
|
-
const headerWidth = (handle) => handle.nativeElement.parentElement.offsetWidth;
|
|
33
|
-
/**
|
|
34
|
-
* @hidden
|
|
35
|
-
*/
|
|
36
|
-
const allLeafColumns = columns => expandColumns(columns)
|
|
37
|
-
.filter(c => !c.isColumnGroup);
|
|
38
|
-
/**
|
|
39
|
-
* @hidden
|
|
40
|
-
*/
|
|
41
|
-
const stopPropagation = ({ originalEvent: event }) => {
|
|
42
|
-
event.stopPropagation();
|
|
43
|
-
event.preventDefault();
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* @hidden
|
|
47
|
-
*/
|
|
48
|
-
const createMoveStream = (service, draggable) => mouseDown => draggable.kendoDrag.pipe(takeUntil(draggable.kendoRelease.pipe(tap(() => service.end()))), map(({ pageX }) => ({
|
|
49
|
-
originalX: mouseDown.pageX,
|
|
50
|
-
pageX
|
|
51
|
-
})));
|
|
52
|
-
/**
|
|
53
|
-
* @hidden
|
|
54
|
-
*/
|
|
55
|
-
const preventOnDblClick = release => mouseDown => of(mouseDown).pipe(delay(150), takeUntil(release));
|
|
56
|
-
/**
|
|
57
|
-
* @hidden
|
|
58
|
-
*/
|
|
59
|
-
const isInSpanColumn = column => !!(column.parent && column.parent.isSpanColumn);
|
|
60
|
-
/**
|
|
61
|
-
* @hidden
|
|
62
|
-
*
|
|
63
|
-
* Calculates the column index. If the column is stated in `SpanColumn`,
|
|
64
|
-
* the index for all child columns equals the index of the first child.
|
|
65
|
-
*/
|
|
66
|
-
const indexOf = (target, list) => {
|
|
67
|
-
let index = 0;
|
|
68
|
-
let ignore = 0;
|
|
69
|
-
let skip = 0;
|
|
70
|
-
while (index < list.length) {
|
|
71
|
-
const current = list[index];
|
|
72
|
-
const isParentSpanColumn = isInSpanColumn(current);
|
|
73
|
-
if (current === target) {
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
76
|
-
if ((ignore-- <= 0) && isParentSpanColumn) {
|
|
77
|
-
ignore = current.parent.childColumns.length - 1;
|
|
78
|
-
skip += ignore;
|
|
79
|
-
}
|
|
80
|
-
index++;
|
|
81
|
-
}
|
|
82
|
-
return index - skip;
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* @hidden
|
|
86
|
-
*/
|
|
87
|
-
export class ColumnHandleDirective {
|
|
88
|
-
draggable;
|
|
89
|
-
element;
|
|
90
|
-
service;
|
|
91
|
-
zone;
|
|
92
|
-
cdr;
|
|
93
|
-
localization;
|
|
94
|
-
columns = [];
|
|
95
|
-
column;
|
|
96
|
-
get visible() {
|
|
97
|
-
return this.column.resizable ? 'block' : 'none';
|
|
98
|
-
}
|
|
99
|
-
get leftStyle() {
|
|
100
|
-
return isTruthy(this.rtl) ? 0 : null;
|
|
101
|
-
}
|
|
102
|
-
get rightStyle() {
|
|
103
|
-
return isTruthy(this.rtl) ? null : 0;
|
|
104
|
-
}
|
|
105
|
-
subscriptions = new Subscription();
|
|
106
|
-
rtl = false;
|
|
107
|
-
autoFit() {
|
|
108
|
-
const allLeafs = allLeafColumns(this.columns);
|
|
109
|
-
const currentLeafs = leafColumns([this.column]).filter(column => isTruthy(column.resizable));
|
|
110
|
-
const columnInfo = currentLeafs.map(column => {
|
|
111
|
-
const isParentSpan = isInSpanColumn(column);
|
|
112
|
-
const isLastInSpan = isParentSpan ? column.parent.childColumns.last === column : false;
|
|
113
|
-
const index = indexOf(column, allLeafs);
|
|
114
|
-
return {
|
|
115
|
-
column,
|
|
116
|
-
headerIndex: this.columnsForLevel(column.level).indexOf(column),
|
|
117
|
-
index,
|
|
118
|
-
isLastInSpan,
|
|
119
|
-
isParentSpan,
|
|
120
|
-
level: column.level
|
|
121
|
-
};
|
|
122
|
-
});
|
|
123
|
-
currentLeafs.forEach(column => column.width = 0);
|
|
124
|
-
this.service.measureColumns(columnInfo);
|
|
125
|
-
}
|
|
126
|
-
constructor(draggable, element, service, zone, cdr, localization) {
|
|
127
|
-
this.draggable = draggable;
|
|
128
|
-
this.element = element;
|
|
129
|
-
this.service = service;
|
|
130
|
-
this.zone = zone;
|
|
131
|
-
this.cdr = cdr;
|
|
132
|
-
this.localization = localization;
|
|
133
|
-
}
|
|
134
|
-
ngOnInit() {
|
|
135
|
-
const service = this.service.changes.pipe(filter(() => this.column.resizable), filter(e => isPresent(e.columns.find(column => column === this.column))));
|
|
136
|
-
this.subscriptions.add(service.pipe(filter(e => e.type === 'start'))
|
|
137
|
-
.subscribe(this.initState.bind(this)));
|
|
138
|
-
this.subscriptions.add(service.pipe(filter(e => e.type === 'resizeColumn'))
|
|
139
|
-
.subscribe(this.resize.bind(this)));
|
|
140
|
-
this.subscriptions.add(this.service.changes.pipe(filter(e => e.type === 'start'), filter(this.shouldUpdate.bind(this)), take(1) //on first resize only
|
|
141
|
-
).subscribe(this.initColumnWidth.bind(this)));
|
|
142
|
-
this.subscriptions.add(this.zone.runOutsideAngular(() => this.draggable.kendoPress.pipe(tap(stopPropagation), tap(() => this.service.start(this.column)), switchMap(preventOnDblClick(this.draggable.kendoRelease)), switchMap(createMoveStream(this.service, this.draggable)))
|
|
143
|
-
.subscribe(({ pageX, originalX }) => {
|
|
144
|
-
const delta = pageX - originalX;
|
|
145
|
-
const percent = toPercentage(delta, this.column.resizeStartWidth || this.column.width);
|
|
146
|
-
this.service.resizeColumns(percent);
|
|
147
|
-
})));
|
|
148
|
-
this.subscriptions.add(service.pipe(filter(e => e.type === 'autoFitComplete'))
|
|
149
|
-
.subscribe(this.sizeToFit.bind(this)));
|
|
150
|
-
this.subscriptions.add(service.pipe(filter(e => e.type === 'triggerAutoFit'))
|
|
151
|
-
.subscribe(this.autoFit.bind(this)));
|
|
152
|
-
this.subscriptions.add(this.localization.changes.subscribe(({ rtl }) => this.rtl = rtl));
|
|
153
|
-
}
|
|
154
|
-
ngOnDestroy() {
|
|
155
|
-
if (this.subscriptions) {
|
|
156
|
-
this.subscriptions.unsubscribe();
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
shouldUpdate() {
|
|
160
|
-
return !allLeafColumns(this.columns)
|
|
161
|
-
.map(column => column.width)
|
|
162
|
-
.some(isBlank);
|
|
163
|
-
}
|
|
164
|
-
initColumnWidth() {
|
|
165
|
-
this.column.width = headerWidth(this.element);
|
|
166
|
-
}
|
|
167
|
-
initState() {
|
|
168
|
-
this.column.resizeStartWidth = headerWidth(this.element);
|
|
169
|
-
this.service.resizedColumn({
|
|
170
|
-
column: this.column,
|
|
171
|
-
oldWidth: this.column.resizeStartWidth
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
resize({ deltaPercent }) {
|
|
175
|
-
let delta = fromPercentage(this.column.resizeStartWidth, deltaPercent);
|
|
176
|
-
if (isTruthy(this.rtl)) {
|
|
177
|
-
delta *= -1;
|
|
178
|
-
}
|
|
179
|
-
const newWidth = Math.max(this.column.resizeStartWidth + delta, this.column.minResizableWidth);
|
|
180
|
-
const tableDelta = newWidth > this.column.minResizableWidth ?
|
|
181
|
-
delta : this.column.minResizableWidth - this.column.resizeStartWidth;
|
|
182
|
-
this.updateWidth(this.column, newWidth);
|
|
183
|
-
this.service.resizeTable(this.column, tableDelta);
|
|
184
|
-
}
|
|
185
|
-
sizeToFit({ columns, widths }) {
|
|
186
|
-
const index = columns.indexOf(this.column);
|
|
187
|
-
const width = Math.max(...widths.map(w => w[index])) + 1; //add 1px for IE
|
|
188
|
-
const tableDelta = width - this.column.resizeStartWidth;
|
|
189
|
-
this.updateWidth(this.column, width);
|
|
190
|
-
this.service.resizeTable(this.column, tableDelta);
|
|
191
|
-
}
|
|
192
|
-
updateWidth(column, width) {
|
|
193
|
-
column.width = width;
|
|
194
|
-
this.cdr.markForCheck(); //force CD cycle
|
|
195
|
-
}
|
|
196
|
-
columnsForLevel(level) {
|
|
197
|
-
return columnsToRender(this.columns ? this.columns.filter(column => column.level === level) : []);
|
|
198
|
-
}
|
|
199
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ColumnHandleDirective, deps: [{ token: i1.DraggableDirective, host: true }, { token: i0.ElementRef }, { token: i2.ColumnResizingService }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: i3.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
200
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: ColumnHandleDirective, isStandalone: true, selector: "[kendoTreeListColumnHandle]", inputs: { columns: "columns", column: "column" }, host: { listeners: { "dblclick": "autoFit()" }, properties: { "style.display": "this.visible", "style.left": "this.leftStyle", "style.right": "this.rightStyle" } }, ngImport: i0 });
|
|
201
|
-
}
|
|
202
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ColumnHandleDirective, decorators: [{
|
|
203
|
-
type: Directive,
|
|
204
|
-
args: [{
|
|
205
|
-
selector: '[kendoTreeListColumnHandle]',
|
|
206
|
-
standalone: true
|
|
207
|
-
}]
|
|
208
|
-
}], ctorParameters: () => [{ type: i1.DraggableDirective, decorators: [{
|
|
209
|
-
type: Host
|
|
210
|
-
}] }, { type: i0.ElementRef }, { type: i2.ColumnResizingService }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }, { type: i3.LocalizationService }], propDecorators: { columns: [{
|
|
211
|
-
type: Input
|
|
212
|
-
}], column: [{
|
|
213
|
-
type: Input
|
|
214
|
-
}], visible: [{
|
|
215
|
-
type: HostBinding,
|
|
216
|
-
args: ['style.display']
|
|
217
|
-
}], leftStyle: [{
|
|
218
|
-
type: HostBinding,
|
|
219
|
-
args: ['style.left']
|
|
220
|
-
}], rightStyle: [{
|
|
221
|
-
type: HostBinding,
|
|
222
|
-
args: ['style.right']
|
|
223
|
-
}], autoFit: [{
|
|
224
|
-
type: HostListener,
|
|
225
|
-
args: ['dblclick']
|
|
226
|
-
}] } });
|
|
@@ -1,5 +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
|
-
export {};
|
|
@@ -1,143 +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 { Injectable, EventEmitter } from '@angular/core';
|
|
6
|
-
import { zip } from 'rxjs';
|
|
7
|
-
import { leafColumns } from '../columns/column-common';
|
|
8
|
-
import { take } from 'rxjs/operators';
|
|
9
|
-
import * as i0 from "@angular/core";
|
|
10
|
-
/**
|
|
11
|
-
* @hidden
|
|
12
|
-
*/
|
|
13
|
-
const isLocked = column => column.parent ? isLocked(column.parent) : !!column.locked;
|
|
14
|
-
/**
|
|
15
|
-
* @hidden
|
|
16
|
-
*/
|
|
17
|
-
const resizeArgs = (column, extra) => Object.assign({
|
|
18
|
-
columns: leafColumns([column]),
|
|
19
|
-
locked: isLocked(column)
|
|
20
|
-
}, extra);
|
|
21
|
-
/**
|
|
22
|
-
* @hidden
|
|
23
|
-
*/
|
|
24
|
-
export class ColumnResizingService {
|
|
25
|
-
changes = new EventEmitter();
|
|
26
|
-
column;
|
|
27
|
-
resizedColumns;
|
|
28
|
-
tables = [];
|
|
29
|
-
batch = null;
|
|
30
|
-
start(column) {
|
|
31
|
-
this.trackColumns(column);
|
|
32
|
-
const columns = (this.column.isColumnGroup ? [column] : [])
|
|
33
|
-
.concat(leafColumns([column]));
|
|
34
|
-
this.changes.emit({
|
|
35
|
-
columns: columns,
|
|
36
|
-
locked: isLocked(this.column),
|
|
37
|
-
type: 'start'
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
resizeColumns(deltaPercent) {
|
|
41
|
-
const action = resizeArgs(this.column, {
|
|
42
|
-
deltaPercent,
|
|
43
|
-
type: 'resizeColumn'
|
|
44
|
-
});
|
|
45
|
-
this.changes.emit(action);
|
|
46
|
-
}
|
|
47
|
-
resizeTable(column, delta) {
|
|
48
|
-
const action = resizeArgs(column, {
|
|
49
|
-
delta,
|
|
50
|
-
type: 'resizeTable'
|
|
51
|
-
});
|
|
52
|
-
this.changes.emit(action);
|
|
53
|
-
}
|
|
54
|
-
resizedColumn(state) {
|
|
55
|
-
this.resizedColumns.push(state);
|
|
56
|
-
}
|
|
57
|
-
end() {
|
|
58
|
-
this.changes.emit({
|
|
59
|
-
columns: [],
|
|
60
|
-
resizedColumns: this.resizedColumns,
|
|
61
|
-
type: 'end'
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
registerTable(tableMetadata) {
|
|
65
|
-
this.tables.push(tableMetadata);
|
|
66
|
-
const unregisterTable = () => {
|
|
67
|
-
this.tables.splice(this.tables.indexOf(tableMetadata), 1);
|
|
68
|
-
};
|
|
69
|
-
return unregisterTable;
|
|
70
|
-
}
|
|
71
|
-
measureColumns(info) {
|
|
72
|
-
if (this.batch !== null) {
|
|
73
|
-
this.batch.push(...info);
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
this.autoFitBatch(info, () => this.end());
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
autoFit(...columns) {
|
|
80
|
-
const nonLockedColumns = columns.filter(column => !column.isLocked);
|
|
81
|
-
this.autoFitStart(nonLockedColumns);
|
|
82
|
-
this.autoFitBatch(this.batch, () => {
|
|
83
|
-
if (nonLockedColumns.length < columns.length) {
|
|
84
|
-
const lockedColumns = columns.filter(column => column.isLocked);
|
|
85
|
-
this.autoFitStart(lockedColumns);
|
|
86
|
-
this.autoFitBatch(this.batch, () => this.end());
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
this.end();
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
trackColumns(column) {
|
|
94
|
-
this.resizedColumns = [];
|
|
95
|
-
this.column = column;
|
|
96
|
-
}
|
|
97
|
-
autoFitStart(columns) {
|
|
98
|
-
this.batch = [];
|
|
99
|
-
this.resizedColumns = [];
|
|
100
|
-
if (columns.length === 0) {
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
const locked = columns[0].isLocked;
|
|
104
|
-
this.changes.emit({
|
|
105
|
-
type: 'start',
|
|
106
|
-
columns,
|
|
107
|
-
locked
|
|
108
|
-
});
|
|
109
|
-
this.changes.emit({
|
|
110
|
-
type: 'triggerAutoFit',
|
|
111
|
-
columns,
|
|
112
|
-
locked
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
autoFitBatch(info, onComplete) {
|
|
116
|
-
const locked = info.length > 0 ? info[0].column.isLocked : false;
|
|
117
|
-
const observables = this.tables
|
|
118
|
-
.filter(table => table.locked === locked)
|
|
119
|
-
.map(table => table.autoFit(info));
|
|
120
|
-
zip(...observables)
|
|
121
|
-
.pipe(take(1))
|
|
122
|
-
.subscribe(widths => {
|
|
123
|
-
this.changes.emit({
|
|
124
|
-
columns: info.map(i => i.column),
|
|
125
|
-
type: 'autoFitComplete',
|
|
126
|
-
widths,
|
|
127
|
-
locked
|
|
128
|
-
});
|
|
129
|
-
if (onComplete) {
|
|
130
|
-
onComplete();
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
this.batch = null;
|
|
134
|
-
}
|
|
135
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ColumnResizingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
136
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ColumnResizingService, providedIn: 'root' });
|
|
137
|
-
}
|
|
138
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ColumnResizingService, decorators: [{
|
|
139
|
-
type: Injectable,
|
|
140
|
-
args: [{
|
|
141
|
-
providedIn: 'root'
|
|
142
|
-
}]
|
|
143
|
-
}] });
|
|
@@ -1,130 +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 { ChangeDetectorRef, Directive, ElementRef, HostBinding, Input, NgZone, Renderer2 } from '@angular/core';
|
|
6
|
-
import { Observable } from 'rxjs';
|
|
7
|
-
import { resizableColumns } from '../columns/column-common';
|
|
8
|
-
import { ColumnResizingService } from './column-resizing.service';
|
|
9
|
-
import { filter, tap, map, switchMap, bufferCount } from 'rxjs/operators';
|
|
10
|
-
import * as i0 from "@angular/core";
|
|
11
|
-
import * as i1 from "./column-resizing.service";
|
|
12
|
-
/**
|
|
13
|
-
* @hidden
|
|
14
|
-
*/
|
|
15
|
-
const columnsToResize = ({ columns }) => Math.max(1, resizableColumns(columns).length);
|
|
16
|
-
/**
|
|
17
|
-
* @hidden
|
|
18
|
-
*/
|
|
19
|
-
const row = selector => element => element.querySelector(selector);
|
|
20
|
-
/**
|
|
21
|
-
* @hidden
|
|
22
|
-
*/
|
|
23
|
-
const headerRow = index => element => element.querySelectorAll('thead>tr')[index];
|
|
24
|
-
/**
|
|
25
|
-
* @hidden
|
|
26
|
-
*/
|
|
27
|
-
const cell = (index, selector = 'td') => element => element.querySelectorAll(`${selector}:not(.k-group-cell):not(.k-hierarchy-cell)`)[index];
|
|
28
|
-
/**
|
|
29
|
-
* @hidden
|
|
30
|
-
*/
|
|
31
|
-
const offsetWidth = element => element.offsetWidth;
|
|
32
|
-
/**
|
|
33
|
-
* @hidden
|
|
34
|
-
*/
|
|
35
|
-
const pipe = (...fns) => data => fns.reduce((state, fn) => state ? fn(state) : 0, data);
|
|
36
|
-
/**
|
|
37
|
-
* @hidden
|
|
38
|
-
*/
|
|
39
|
-
export class TableDirective {
|
|
40
|
-
element;
|
|
41
|
-
renderer;
|
|
42
|
-
service;
|
|
43
|
-
zone;
|
|
44
|
-
cdr;
|
|
45
|
-
locked = false;
|
|
46
|
-
virtualColumns;
|
|
47
|
-
get minWidth() {
|
|
48
|
-
return this.firstResize ? 0 : null;
|
|
49
|
-
}
|
|
50
|
-
originalWidth;
|
|
51
|
-
firstResize = false;
|
|
52
|
-
subscription;
|
|
53
|
-
autoFitSubscription;
|
|
54
|
-
constructor(element, renderer, service, zone, cdr) {
|
|
55
|
-
this.element = element;
|
|
56
|
-
this.renderer = renderer;
|
|
57
|
-
this.service = service;
|
|
58
|
-
this.zone = zone;
|
|
59
|
-
this.cdr = cdr;
|
|
60
|
-
}
|
|
61
|
-
ngOnInit() {
|
|
62
|
-
const obs = this.service
|
|
63
|
-
.changes.pipe(filter(e => this.locked === e.locked));
|
|
64
|
-
this.subscription = obs.pipe(filter(e => e.type === 'start'), tap(this.initState.bind(this)), map(columnsToResize), switchMap((take) => obs.pipe(filter(e => e.type === 'resizeTable'), map(e => e.delta), bufferCount(take)))).subscribe(this.resize.bind(this));
|
|
65
|
-
this.autoFitSubscription = this.service
|
|
66
|
-
.registerTable({
|
|
67
|
-
autoFit: this.autoFitObservable.bind(this),
|
|
68
|
-
locked: this.locked
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
ngOnDestroy() {
|
|
72
|
-
if (this.subscription) {
|
|
73
|
-
this.subscription.unsubscribe();
|
|
74
|
-
}
|
|
75
|
-
if (this.autoFitSubscription) {
|
|
76
|
-
this.autoFitSubscription();
|
|
77
|
-
this.autoFitSubscription = null;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
initState() {
|
|
81
|
-
this.firstResize = true;
|
|
82
|
-
if (!this.virtualColumns || this.locked) {
|
|
83
|
-
this.originalWidth = offsetWidth(this.element.nativeElement);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
resize(deltas) {
|
|
87
|
-
if (!this.virtualColumns || this.locked) {
|
|
88
|
-
const delta = deltas.reduce((sum, item) => sum + item, 0);
|
|
89
|
-
const width = this.originalWidth + delta;
|
|
90
|
-
this.renderer.setStyle(this.element.nativeElement, 'width', width + 'px');
|
|
91
|
-
}
|
|
92
|
-
this.cdr.detectChanges();
|
|
93
|
-
}
|
|
94
|
-
autoFitObservable(columnInfo) {
|
|
95
|
-
return Observable.create(observer => {
|
|
96
|
-
this.zone.runOutsideAngular(() => {
|
|
97
|
-
this.renderer.addClass(this.element.nativeElement, 'k-autofitting');
|
|
98
|
-
this.cdr.detectChanges();
|
|
99
|
-
const widths = columnInfo.map(this.measureColumn.bind(this));
|
|
100
|
-
this.renderer.removeClass(this.element.nativeElement, 'k-autofitting');
|
|
101
|
-
observer.next(widths);
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
measureColumn(info) {
|
|
106
|
-
const dom = this.element.nativeElement;
|
|
107
|
-
const header = pipe(headerRow(info.level), cell(info.headerIndex, 'th'), offsetWidth)(dom);
|
|
108
|
-
let data = 0;
|
|
109
|
-
if (!info.isParentSpan || (info.isParentSpan && info.isLastInSpan)) {
|
|
110
|
-
data = pipe(row('tbody>tr:not(.k-grouping-row):not(.k-grid-norecords)'), cell(info.index), offsetWidth)(dom);
|
|
111
|
-
}
|
|
112
|
-
return Math.max(header, data);
|
|
113
|
-
}
|
|
114
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TableDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.ColumnResizingService }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
115
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: TableDirective, isStandalone: true, selector: "[kendoTreeListResizableTable]", inputs: { locked: "locked", virtualColumns: "virtualColumns" }, host: { properties: { "style.min-width": "this.minWidth" } }, ngImport: i0 });
|
|
116
|
-
}
|
|
117
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TableDirective, decorators: [{
|
|
118
|
-
type: Directive,
|
|
119
|
-
args: [{
|
|
120
|
-
selector: '[kendoTreeListResizableTable]',
|
|
121
|
-
standalone: true
|
|
122
|
-
}]
|
|
123
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1.ColumnResizingService }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }], propDecorators: { locked: [{
|
|
124
|
-
type: Input
|
|
125
|
-
}], virtualColumns: [{
|
|
126
|
-
type: Input
|
|
127
|
-
}], minWidth: [{
|
|
128
|
-
type: HostBinding,
|
|
129
|
-
args: ['style.min-width']
|
|
130
|
-
}] } });
|