@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,77 +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 { Directive, ElementRef } from '@angular/core';
|
|
6
|
-
import { isDocumentAvailable } from '@progress/kendo-angular-common';
|
|
7
|
-
import { ContextService } from '../../common/provider.service';
|
|
8
|
-
import * as i0 from "@angular/core";
|
|
9
|
-
import * as i1 from "../../common/provider.service";
|
|
10
|
-
/**
|
|
11
|
-
* A directive for toolbar elements that need to be part of TreeList keyboard navigation.
|
|
12
|
-
* Use this directive to make toolbar elements focusable and accessible with the keyboard.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```html
|
|
16
|
-
* <kendo-treelist>
|
|
17
|
-
* <kendo-toolbar>
|
|
18
|
-
* <button kendoTreeListToolbarFocusable>Custom Button</button>
|
|
19
|
-
* <button kendoTreeListCancelCommand>Cancel</button>
|
|
20
|
-
* <button kendoTreeListEditCommand>Edit</button>
|
|
21
|
-
* </kendo-toolbar>
|
|
22
|
-
* </kendo-treelist>
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
export class TreeListToolbarFocusableDirective {
|
|
26
|
-
host;
|
|
27
|
-
ctx;
|
|
28
|
-
/**
|
|
29
|
-
* @hidden
|
|
30
|
-
*/
|
|
31
|
-
get element() {
|
|
32
|
-
return this.host.nativeElement;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* @hidden
|
|
36
|
-
*/
|
|
37
|
-
get toolbarPosition() {
|
|
38
|
-
return isDocumentAvailable() && this.host.nativeElement.closest('.k-toolbar')?.getAttribute('position');
|
|
39
|
-
}
|
|
40
|
-
constructor(host, ctx) {
|
|
41
|
-
this.host = host;
|
|
42
|
-
this.ctx = ctx;
|
|
43
|
-
}
|
|
44
|
-
ngAfterViewInit() {
|
|
45
|
-
if (!isDocumentAvailable() || !this.toolbarPosition) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
this.ctx[`${this.toolbarPosition}ToolbarNavigation`]?.navigableElements.push(this.element);
|
|
49
|
-
this.ctx[`${this.toolbarPosition}ToolbarNavigation`]?.notify();
|
|
50
|
-
}
|
|
51
|
-
ngOnDestroy() {
|
|
52
|
-
if (!isDocumentAvailable() || !this.toolbarPosition) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
const elements = this.ctx[`${this.toolbarPosition}ToolbarNavigation`].navigableElements;
|
|
56
|
-
this.ctx[`${this.toolbarPosition}ToolbarNavigation`].navigableElements = elements.filter(el => el !== this.element);
|
|
57
|
-
this.ctx[`${this.toolbarPosition}ToolbarNavigation`].notify();
|
|
58
|
-
}
|
|
59
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TreeListToolbarFocusableDirective, deps: [{ token: i0.ElementRef }, { token: i1.ContextService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
60
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: TreeListToolbarFocusableDirective, isStandalone: true, selector: "\n [kendoTreeListToolbarFocusable],\n [kendoTreeListAddCommand],\n [kendoTreeListCancelCommand],\n [kendoTreeListEditCommand],\n [kendoTreeListRemoveCommand],\n [kendoTreeListSaveCommand],\n [kendoTreeListExcelCommand],\n [kendoTreeListPDFCommand]\n ", ngImport: i0 });
|
|
61
|
-
}
|
|
62
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TreeListToolbarFocusableDirective, decorators: [{
|
|
63
|
-
type: Directive,
|
|
64
|
-
args: [{
|
|
65
|
-
selector: `
|
|
66
|
-
[kendoTreeListToolbarFocusable],
|
|
67
|
-
[kendoTreeListAddCommand],
|
|
68
|
-
[kendoTreeListCancelCommand],
|
|
69
|
-
[kendoTreeListEditCommand],
|
|
70
|
-
[kendoTreeListRemoveCommand],
|
|
71
|
-
[kendoTreeListSaveCommand],
|
|
72
|
-
[kendoTreeListExcelCommand],
|
|
73
|
-
[kendoTreeListPDFCommand]
|
|
74
|
-
`,
|
|
75
|
-
standalone: true
|
|
76
|
-
}]
|
|
77
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.ContextService }] });
|
|
@@ -1,54 +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, Renderer2 } from '@angular/core';
|
|
6
|
-
import { isDocumentAvailable } from '@progress/kendo-angular-common';
|
|
7
|
-
import * as i0 from "@angular/core";
|
|
8
|
-
/**
|
|
9
|
-
* @hidden
|
|
10
|
-
*/
|
|
11
|
-
export class TreeListToolbarNavigationService {
|
|
12
|
-
renderer;
|
|
13
|
-
navigableElements = [];
|
|
14
|
-
currentActiveIndex = 0;
|
|
15
|
-
defaultFocusableSelector = `
|
|
16
|
-
[kendoTreeListToolbarFocusable],
|
|
17
|
-
[kendoTreeListAddCommand],
|
|
18
|
-
[kendoTreeListCancelCommand],
|
|
19
|
-
[kendoTreeListEditCommand],
|
|
20
|
-
[kendoTreeListRemoveCommand],
|
|
21
|
-
[kendoTreeListSaveCommand],
|
|
22
|
-
[kendoTreeListExcelCommand],
|
|
23
|
-
[kendoTreeListPDFCommand]
|
|
24
|
-
`;
|
|
25
|
-
constructor(renderer) {
|
|
26
|
-
this.renderer = renderer;
|
|
27
|
-
}
|
|
28
|
-
notify() {
|
|
29
|
-
// ensure focusable elements are in the same order as in the DOM
|
|
30
|
-
this.navigableElements = (this.navigableElements.length && this.navigableElements[0]?.parentElement) ? Array.from(this.navigableElements[0]?.parentElement?.querySelectorAll(this.defaultFocusableSelector) || []) : [];
|
|
31
|
-
this.currentActiveIndex = 0;
|
|
32
|
-
this.updateFocus();
|
|
33
|
-
}
|
|
34
|
-
focus() {
|
|
35
|
-
this.navigableElements[this.currentActiveIndex]?.focus();
|
|
36
|
-
}
|
|
37
|
-
updateFocus() {
|
|
38
|
-
if (!this.navigableElements.length) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
this.navigableElements.forEach(el => {
|
|
42
|
-
this.renderer.setAttribute(el, 'tabindex', '-1');
|
|
43
|
-
});
|
|
44
|
-
this.renderer.setAttribute(this.navigableElements[this.currentActiveIndex], 'tabindex', '0');
|
|
45
|
-
if (isDocumentAvailable() && document.activeElement.closest('.k-toolbar')) {
|
|
46
|
-
this.navigableElements[this.currentActiveIndex].focus();
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TreeListToolbarNavigationService, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
50
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TreeListToolbarNavigationService });
|
|
51
|
-
}
|
|
52
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TreeListToolbarNavigationService, decorators: [{
|
|
53
|
-
type: Injectable
|
|
54
|
-
}], ctorParameters: () => [{ type: i0.Renderer2 }] });
|
|
@@ -1,58 +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 { Directive, TemplateRef, Optional, Input } from '@angular/core';
|
|
6
|
-
import { OptionChangesService } from '../../common/option-changes.service';
|
|
7
|
-
import * as i0 from "@angular/core";
|
|
8
|
-
import * as i1 from "../../common/option-changes.service";
|
|
9
|
-
/**
|
|
10
|
-
* Represents the toolbar template of the TreeList ([see example](slug:toolbartemplate_treelist)).
|
|
11
|
-
*
|
|
12
|
-
* The template context has the following field:
|
|
13
|
-
* - `position`—The position at which the toolbar template is rendered. The possible values are `top`, `bottom`, and `both`.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```html
|
|
17
|
-
* <kendo-treelist ...>
|
|
18
|
-
* <ng-template kendoTreeListToolbarTemplate>
|
|
19
|
-
* <button kendoTreeListExcelCommand>Export to Excel</button>
|
|
20
|
-
* </ng-template>
|
|
21
|
-
* </kendo-treelist>
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export class ToolbarTemplateDirective {
|
|
25
|
-
templateRef;
|
|
26
|
-
optionChanges;
|
|
27
|
-
_position = "top";
|
|
28
|
-
/**
|
|
29
|
-
* Sets the position of the toolbar. The value can be `top`, `bottom`, or `both`.
|
|
30
|
-
* Controls whether the toolbar appears above, below, or on both sides of the TreeList. [See example.](slug:toolbartemplate_treelist#toc-setting-the-toolbar-position)
|
|
31
|
-
* @default 'top'
|
|
32
|
-
*/
|
|
33
|
-
set position(position) {
|
|
34
|
-
this._position = position;
|
|
35
|
-
this.optionChanges.optionChanged();
|
|
36
|
-
}
|
|
37
|
-
get position() {
|
|
38
|
-
return this._position;
|
|
39
|
-
}
|
|
40
|
-
constructor(templateRef, optionChanges) {
|
|
41
|
-
this.templateRef = templateRef;
|
|
42
|
-
this.optionChanges = optionChanges;
|
|
43
|
-
}
|
|
44
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ToolbarTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }, { token: i1.OptionChangesService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
45
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: ToolbarTemplateDirective, isStandalone: true, selector: "[kendoTreeListToolbarTemplate]", inputs: { position: "position" }, ngImport: i0 });
|
|
46
|
-
}
|
|
47
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ToolbarTemplateDirective, decorators: [{
|
|
48
|
-
type: Directive,
|
|
49
|
-
args: [{
|
|
50
|
-
selector: '[kendoTreeListToolbarTemplate]',
|
|
51
|
-
standalone: true
|
|
52
|
-
}]
|
|
53
|
-
}], ctorParameters: () => [{ type: i0.TemplateRef, decorators: [{
|
|
54
|
-
type: Optional
|
|
55
|
-
}] }, { type: i1.OptionChangesService }], propDecorators: { position: [{
|
|
56
|
-
type: Input,
|
|
57
|
-
args: ["position"]
|
|
58
|
-
}] } });
|
|
@@ -1,110 +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
|
-
/* eslint-disable @typescript-eslint/no-inferrable-types */
|
|
6
|
-
import { Component, Input, HostBinding, Renderer2, ElementRef } from '@angular/core';
|
|
7
|
-
import { NgTemplateOutlet } from '@angular/common';
|
|
8
|
-
import { Subscription } from 'rxjs';
|
|
9
|
-
import { Keys, isDocumentAvailable, normalizeKeys } from '@progress/kendo-angular-common';
|
|
10
|
-
import { ContextService } from './../../common/provider.service';
|
|
11
|
-
import * as i0 from "@angular/core";
|
|
12
|
-
import * as i1 from "./../../common/provider.service";
|
|
13
|
-
/**
|
|
14
|
-
* @hidden
|
|
15
|
-
*/
|
|
16
|
-
export class ToolbarComponent {
|
|
17
|
-
elem;
|
|
18
|
-
renderer;
|
|
19
|
-
ctx;
|
|
20
|
-
hostRole = 'toolbar';
|
|
21
|
-
hostClasses = true;
|
|
22
|
-
context = {};
|
|
23
|
-
set position(value) {
|
|
24
|
-
this.context.position = value;
|
|
25
|
-
}
|
|
26
|
-
navigable;
|
|
27
|
-
get toolbarTemplateRef() {
|
|
28
|
-
return this.ctx.treelist.toolbarTemplate ? this.ctx.treelist.toolbarTemplate.templateRef : undefined;
|
|
29
|
-
}
|
|
30
|
-
subs = new Subscription();
|
|
31
|
-
navigationService;
|
|
32
|
-
constructor(elem, renderer, ctx) {
|
|
33
|
-
this.elem = elem;
|
|
34
|
-
this.renderer = renderer;
|
|
35
|
-
this.ctx = ctx;
|
|
36
|
-
this.navigationService = this.ctx[`${this.elem.nativeElement.getAttribute('position')}ToolbarNavigation`];
|
|
37
|
-
}
|
|
38
|
-
ngAfterViewInit() {
|
|
39
|
-
const element = this.elem.nativeElement;
|
|
40
|
-
this.subs.add(this.renderer.listen(element, 'keydown', event => this.onKeyDown(event)));
|
|
41
|
-
}
|
|
42
|
-
ngOnDestroy() {
|
|
43
|
-
this.subs.unsubscribe();
|
|
44
|
-
}
|
|
45
|
-
onKeyDown(event) {
|
|
46
|
-
if (this.navigable && isDocumentAvailable() && this.navigationService.navigableElements.length) {
|
|
47
|
-
const keyCode = normalizeKeys(event);
|
|
48
|
-
if (keyCode === Keys.ArrowLeft || keyCode === Keys.ArrowRight) {
|
|
49
|
-
event.preventDefault();
|
|
50
|
-
const dir = keyCode === Keys.ArrowLeft ? -1 : 1;
|
|
51
|
-
this.changeFocusedItem(dir);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
changeFocusedItem(dir) {
|
|
56
|
-
this.navigationService.currentActiveIndex += dir;
|
|
57
|
-
const bottomRange = this.navigationService.currentActiveIndex < 0;
|
|
58
|
-
const topRange = this.navigationService.currentActiveIndex >= this.navigationService.navigableElements.length;
|
|
59
|
-
if (bottomRange || topRange) {
|
|
60
|
-
this.navigationService.currentActiveIndex = bottomRange ? this.navigationService.navigableElements.length - 1 : 0;
|
|
61
|
-
}
|
|
62
|
-
this.navigationService.updateFocus();
|
|
63
|
-
}
|
|
64
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ToolbarComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.ContextService }], target: i0.ɵɵFactoryTarget.Component });
|
|
65
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ToolbarComponent, isStandalone: true, selector: "kendo-treelist-toolbar", inputs: { position: "position", navigable: "navigable" }, host: { properties: { "attr.role": "this.hostRole", "class.k-grid-toolbar": "this.hostClasses", "class.k-toolbar": "this.hostClasses", "class.k-toolbar-solid": "this.hostClasses", "class.k-toolbar-md": "this.hostClasses" } }, ngImport: i0, template: `
|
|
66
|
-
@if (toolbarTemplateRef) {
|
|
67
|
-
<ng-template
|
|
68
|
-
[ngTemplateOutlet]="toolbarTemplateRef"
|
|
69
|
-
[ngTemplateOutletContext]="context"
|
|
70
|
-
>
|
|
71
|
-
</ng-template>
|
|
72
|
-
}
|
|
73
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
74
|
-
}
|
|
75
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ToolbarComponent, decorators: [{
|
|
76
|
-
type: Component,
|
|
77
|
-
args: [{
|
|
78
|
-
selector: 'kendo-treelist-toolbar',
|
|
79
|
-
template: `
|
|
80
|
-
@if (toolbarTemplateRef) {
|
|
81
|
-
<ng-template
|
|
82
|
-
[ngTemplateOutlet]="toolbarTemplateRef"
|
|
83
|
-
[ngTemplateOutletContext]="context"
|
|
84
|
-
>
|
|
85
|
-
</ng-template>
|
|
86
|
-
}
|
|
87
|
-
`,
|
|
88
|
-
standalone: true,
|
|
89
|
-
imports: [NgTemplateOutlet]
|
|
90
|
-
}]
|
|
91
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1.ContextService }], propDecorators: { hostRole: [{
|
|
92
|
-
type: HostBinding,
|
|
93
|
-
args: ['attr.role']
|
|
94
|
-
}], hostClasses: [{
|
|
95
|
-
type: HostBinding,
|
|
96
|
-
args: ['class.k-grid-toolbar']
|
|
97
|
-
}, {
|
|
98
|
-
type: HostBinding,
|
|
99
|
-
args: ['class.k-toolbar']
|
|
100
|
-
}, {
|
|
101
|
-
type: HostBinding,
|
|
102
|
-
args: ['class.k-toolbar-solid']
|
|
103
|
-
}, {
|
|
104
|
-
type: HostBinding,
|
|
105
|
-
args: ['class.k-toolbar-md']
|
|
106
|
-
}], position: [{
|
|
107
|
-
type: Input
|
|
108
|
-
}], navigable: [{
|
|
109
|
-
type: Input
|
|
110
|
-
}] } });
|
|
@@ -1,48 +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 } from "@angular/core";
|
|
6
|
-
import { RowReorderService } from './row-reorder.service';
|
|
7
|
-
import { isPresent } from "../utils";
|
|
8
|
-
import * as i0 from "@angular/core";
|
|
9
|
-
/**
|
|
10
|
-
* @hidden
|
|
11
|
-
*/
|
|
12
|
-
export class FlatRowReorderService extends RowReorderService {
|
|
13
|
-
isOverChild(targetItem) {
|
|
14
|
-
const { draggedRows } = this.rowReorderArgs(this.dragTarget, this.dropTarget, this.view);
|
|
15
|
-
const draggedItem = draggedRows[0].dataItem;
|
|
16
|
-
const hasParent = isPresent(targetItem[this.parentIdField]);
|
|
17
|
-
const sameParents = draggedItem[this.parentIdField] === targetItem[this.parentIdField];
|
|
18
|
-
if (!hasParent || sameParents) {
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
if (targetItem && targetItem.hasOwnProperty(this.parentIdField)) {
|
|
22
|
-
if (draggedItem[this.idField] === targetItem[this.parentIdField]) {
|
|
23
|
-
return true;
|
|
24
|
-
}
|
|
25
|
-
const parent = this.data.find(i => i[this.idField] === targetItem[this.parentIdField]);
|
|
26
|
-
if (parent) {
|
|
27
|
-
return this.isOverChild(parent);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
reorderRows(ev, collection) {
|
|
32
|
-
const { draggedRows, dropTargetRow } = ev;
|
|
33
|
-
const draggedDataItem = draggedRows[0].dataItem;
|
|
34
|
-
const dropTargetDataItem = dropTargetRow.dataItem;
|
|
35
|
-
let dropTargetIdx = collection.indexOf(dropTargetDataItem);
|
|
36
|
-
const draggedItemIdx = collection.indexOf(draggedDataItem);
|
|
37
|
-
collection.splice(draggedItemIdx, 1);
|
|
38
|
-
if (ev.dropPosition === 'after' && dropTargetIdx < draggedItemIdx) {
|
|
39
|
-
dropTargetIdx++;
|
|
40
|
-
}
|
|
41
|
-
collection.splice(dropTargetIdx, 0, draggedDataItem);
|
|
42
|
-
}
|
|
43
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FlatRowReorderService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
44
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FlatRowReorderService });
|
|
45
|
-
}
|
|
46
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FlatRowReorderService, decorators: [{
|
|
47
|
-
type: Injectable
|
|
48
|
-
}] });
|
|
@@ -1,55 +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 } from "@angular/core";
|
|
6
|
-
import { RowReorderService } from './row-reorder.service';
|
|
7
|
-
import { isPresent } from "../utils";
|
|
8
|
-
import { dropPosition, findParent } from "./utils";
|
|
9
|
-
import * as i0 from "@angular/core";
|
|
10
|
-
/**
|
|
11
|
-
* @hidden
|
|
12
|
-
*/
|
|
13
|
-
export class HierarchicalRowReorderService extends RowReorderService {
|
|
14
|
-
isOverChild(targetItem) {
|
|
15
|
-
const { draggedRows } = this.rowReorderArgs(this.dragTarget, this.dropTarget, this.view);
|
|
16
|
-
const draggedItem = draggedRows[0].dataItem;
|
|
17
|
-
const hasChildren = isPresent(draggedItem[this.childrenField]) && draggedItem[this.childrenField].length > 0;
|
|
18
|
-
if (!hasChildren) {
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
if (targetItem && draggedItem.hasOwnProperty(this.childrenField)) {
|
|
22
|
-
if (draggedItem[this.childrenField].includes(targetItem)) {
|
|
23
|
-
return true;
|
|
24
|
-
}
|
|
25
|
-
const parent = findParent(this.data, targetItem, this.childrenField);
|
|
26
|
-
if (parent) {
|
|
27
|
-
return this.isOverChild(parent);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
reorderRows(ev, collection, field) {
|
|
33
|
-
const draggedItem = ev.draggedRows[0].dataItem;
|
|
34
|
-
const dropTargetItem = ev.dropTargetRow.dataItem;
|
|
35
|
-
const draggedItemParent = findParent(collection, draggedItem, field);
|
|
36
|
-
const dropTargetParent = findParent(collection, dropTargetItem, field);
|
|
37
|
-
const draggedItemIdx = draggedItemParent ? draggedItemParent[field].indexOf(draggedItem) : collection.indexOf(draggedItem);
|
|
38
|
-
let dropTargetItemIdx = dropTargetParent ? dropTargetParent[field].indexOf(dropTargetItem) : collection.indexOf(dropTargetItem);
|
|
39
|
-
if (ev.dropPosition === dropPosition.after && dropTargetItemIdx < draggedItemIdx) {
|
|
40
|
-
dropTargetItemIdx++;
|
|
41
|
-
}
|
|
42
|
-
draggedItemParent ? draggedItemParent[field].splice(draggedItemIdx, 1) : collection.splice(draggedItemIdx, 1);
|
|
43
|
-
if (ev.dropPosition !== dropPosition.over) {
|
|
44
|
-
dropTargetParent ? dropTargetParent[field].splice(dropTargetItemIdx, 0, draggedItem) : collection.splice(dropTargetItemIdx, 0, draggedItem);
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
dropTargetItem[field].unshift(draggedItem);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: HierarchicalRowReorderService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
51
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: HierarchicalRowReorderService });
|
|
52
|
-
}
|
|
53
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: HierarchicalRowReorderService, decorators: [{
|
|
54
|
-
type: Injectable
|
|
55
|
-
}] });
|
|
@@ -1,273 +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 { EventEmitter, Injectable, Output, Renderer2 } from '@angular/core';
|
|
6
|
-
import { isDocumentAvailable, isPresent } from '@progress/kendo-angular-common';
|
|
7
|
-
import { getOffset, isNextSibling, isPreviousSibling, dropPosition, hintIcons, hintSVGIcons, hintClasses, hintStyles, dropIndicatorClasses, dropIndicatorStyles, defaultSelectors, rowIndexAttr } from './utils';
|
|
8
|
-
import * as i0 from "@angular/core";
|
|
9
|
-
/**
|
|
10
|
-
* @hidden
|
|
11
|
-
*/
|
|
12
|
-
export class RowReorderService {
|
|
13
|
-
renderer;
|
|
14
|
-
defaultSelectors = defaultSelectors;
|
|
15
|
-
dragTarget = null;
|
|
16
|
-
dropTarget = null;
|
|
17
|
-
view;
|
|
18
|
-
bindingDirective;
|
|
19
|
-
offsetY;
|
|
20
|
-
dropIndicator;
|
|
21
|
-
lastDropPosition = dropPosition.forbidden;
|
|
22
|
-
hintElement = null;
|
|
23
|
-
rowReorder = new EventEmitter();
|
|
24
|
-
constructor(renderer) {
|
|
25
|
-
this.renderer = renderer;
|
|
26
|
-
}
|
|
27
|
-
ngOnDestroy() {
|
|
28
|
-
this.destroyDropIndicator();
|
|
29
|
-
this.destroyHintElement();
|
|
30
|
-
}
|
|
31
|
-
press(ev) {
|
|
32
|
-
this.dragTarget = ev.dragTarget;
|
|
33
|
-
this.offsetY = ev.dragEvent.offsetY;
|
|
34
|
-
}
|
|
35
|
-
dragStart() {
|
|
36
|
-
this.createDropIndicator();
|
|
37
|
-
}
|
|
38
|
-
drag(ev) {
|
|
39
|
-
if (isPresent(ev.hintElement) && !isPresent(this.hintElement)) {
|
|
40
|
-
this.hintElement = ev.hintElement;
|
|
41
|
-
this.decorateHint();
|
|
42
|
-
}
|
|
43
|
-
const position = {
|
|
44
|
-
x: ev.dragEvent.clientX,
|
|
45
|
-
y: ev.dragEvent.clientY - this.offsetY
|
|
46
|
-
};
|
|
47
|
-
if (isPresent(this.hintElement)) {
|
|
48
|
-
this.renderer.setStyle(this.hintElement, 'left', `${position.x}px`);
|
|
49
|
-
this.renderer.setStyle(this.hintElement, 'top', `${position.y}px`);
|
|
50
|
-
}
|
|
51
|
-
this.positionDropIndicator(ev);
|
|
52
|
-
}
|
|
53
|
-
dragEnter(ev) {
|
|
54
|
-
this.dropTarget = ev.dropTarget;
|
|
55
|
-
this.view = ev.dragData;
|
|
56
|
-
}
|
|
57
|
-
dragLeave() {
|
|
58
|
-
this.dropTarget = null;
|
|
59
|
-
this.lastDropPosition === dropPosition.forbidden && this.hide();
|
|
60
|
-
}
|
|
61
|
-
dragEnd() {
|
|
62
|
-
this.destroyDropIndicator();
|
|
63
|
-
this.destroyHintElement();
|
|
64
|
-
this.dragTarget = null;
|
|
65
|
-
this.dropTarget = null;
|
|
66
|
-
this.hintElement = null;
|
|
67
|
-
}
|
|
68
|
-
drop() {
|
|
69
|
-
this.destroyDropIndicator();
|
|
70
|
-
this.destroyHintElement();
|
|
71
|
-
const rowReorderArgs = this.rowReorderArgs(this.dragTarget, this.dropTarget, this.view);
|
|
72
|
-
this.rowReorder.emit(rowReorderArgs);
|
|
73
|
-
}
|
|
74
|
-
get hintIcon() {
|
|
75
|
-
return hintIcons[this.lastDropPosition];
|
|
76
|
-
}
|
|
77
|
-
get hintSVGIcon() {
|
|
78
|
-
return hintSVGIcons[this.lastDropPosition];
|
|
79
|
-
}
|
|
80
|
-
getDefaultHintText(columns, data) {
|
|
81
|
-
let hintText = '';
|
|
82
|
-
const columnFieldsArray = columns
|
|
83
|
-
.toArray()
|
|
84
|
-
.filter(column => !column.hidden && isPresent(column.field))
|
|
85
|
-
.map(column => column.field);
|
|
86
|
-
const draggedDragRow = this.getDragRowPerElement(this.dragTarget, data);
|
|
87
|
-
const draggedDataItem = draggedDragRow?.dataItem;
|
|
88
|
-
isPresent(draggedDataItem) && columnFieldsArray.forEach(column => {
|
|
89
|
-
const columnValue = draggedDataItem[column];
|
|
90
|
-
if (isPresent(columnValue)) {
|
|
91
|
-
hintText += `${columnValue} `;
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
return hintText.trim();
|
|
95
|
-
}
|
|
96
|
-
rowReorderArgs(dragRow, dropRow, data) {
|
|
97
|
-
const dragRowData = this.getDragRowPerElement(dragRow, data);
|
|
98
|
-
const dropRowData = this.getDragRowPerElement(dropRow, data);
|
|
99
|
-
return {
|
|
100
|
-
draggedRows: [dragRowData],
|
|
101
|
-
dropTargetRow: dropRowData,
|
|
102
|
-
dropPosition: this.lastDropPosition
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
isOverChild(_item) { return false; }
|
|
106
|
-
reorderRows(_ev, _collection, _field) { }
|
|
107
|
-
/**
|
|
108
|
-
* Triggers row reordering programmatically via keyboard shortcut.
|
|
109
|
-
* @param dragRowIndex - The index of the row to move
|
|
110
|
-
* @param dropRowIndex - The index of the target row
|
|
111
|
-
* @param dropPosition - The position relative to the target row ('before' or 'after')
|
|
112
|
-
* @param data - The data array (view)
|
|
113
|
-
*/
|
|
114
|
-
reorderViaKeyboard(dragRowIndex, dropRowIndex, dropPosition, data) {
|
|
115
|
-
if (dropPosition === 'forbidden') {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
const dragRow = this.createVirtualRowElement(dragRowIndex);
|
|
119
|
-
const dropRow = this.createVirtualRowElement(dropRowIndex);
|
|
120
|
-
this.lastDropPosition = dropPosition;
|
|
121
|
-
const rowReorderArgs = this.rowReorderArgs(dragRow, dropRow, data);
|
|
122
|
-
this.rowReorder.emit(rowReorderArgs);
|
|
123
|
-
}
|
|
124
|
-
createVirtualRowElement(rowIndex) {
|
|
125
|
-
const virtualElement = {
|
|
126
|
-
getAttribute: (attr) => {
|
|
127
|
-
if (attr === rowIndexAttr) {
|
|
128
|
-
return String(rowIndex);
|
|
129
|
-
}
|
|
130
|
-
return null;
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
return virtualElement;
|
|
134
|
-
}
|
|
135
|
-
get parentIdField() {
|
|
136
|
-
return this.bindingDirective.parentIdField;
|
|
137
|
-
}
|
|
138
|
-
get idField() {
|
|
139
|
-
return this.bindingDirective.idField;
|
|
140
|
-
}
|
|
141
|
-
get childrenField() {
|
|
142
|
-
return this.bindingDirective.childrenField;
|
|
143
|
-
}
|
|
144
|
-
get data() {
|
|
145
|
-
return this.bindingDirective.data;
|
|
146
|
-
}
|
|
147
|
-
getDragRowPerElement(row, data) {
|
|
148
|
-
let rowIndex = row?.getAttribute(rowIndexAttr);
|
|
149
|
-
rowIndex = rowIndex ? parseInt(rowIndex, 10) : -1;
|
|
150
|
-
const dataItem = rowIndex === -1 ? null : data?.at(rowIndex)?.data;
|
|
151
|
-
return {
|
|
152
|
-
dataItem,
|
|
153
|
-
rowIndex,
|
|
154
|
-
element: row
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
createDropIndicator() {
|
|
158
|
-
if (!isDocumentAvailable()) {
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
this.dropIndicator = document.createElement('div');
|
|
162
|
-
this.decorateDropIndicator();
|
|
163
|
-
this.dropIndicator.innerHTML = `
|
|
164
|
-
<div class="k-drop-hint-start"></div>
|
|
165
|
-
<div class="k-drop-hint-line"></div>
|
|
166
|
-
`;
|
|
167
|
-
document.body.appendChild(this.dropIndicator);
|
|
168
|
-
this.hide();
|
|
169
|
-
}
|
|
170
|
-
destroyDropIndicator() {
|
|
171
|
-
if (!isDocumentAvailable()) {
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
if (this.dropIndicator && this.dropIndicator.parentElement) {
|
|
175
|
-
document.body.removeChild(this.dropIndicator);
|
|
176
|
-
this.dropIndicator = null;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
destroyHintElement() {
|
|
180
|
-
if (!isDocumentAvailable()) {
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
|
-
if (this.hintElement?.parentElement) {
|
|
184
|
-
this.hintElement.parentElement.removeChild(this.hintElement);
|
|
185
|
-
this.hintElement = null;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
decorateHint() {
|
|
189
|
-
hintClasses.forEach(className => this.renderer.addClass(this.hintElement, className));
|
|
190
|
-
Object.keys(hintStyles)
|
|
191
|
-
.forEach(style => this.renderer.setStyle(this.hintElement, style, hintStyles[style]));
|
|
192
|
-
}
|
|
193
|
-
positionDropIndicator(ev) {
|
|
194
|
-
this.lastDropPosition = this.getDropPosition(ev.dragEvent);
|
|
195
|
-
this.updateDropIndicatorPosition();
|
|
196
|
-
}
|
|
197
|
-
decorateDropIndicator() {
|
|
198
|
-
dropIndicatorClasses.forEach(className => this.renderer.addClass(this.dropIndicator, className));
|
|
199
|
-
Object.keys(dropIndicatorStyles)
|
|
200
|
-
.forEach(style => this.renderer.setStyle(this.dropIndicator, style, dropIndicatorStyles[style]));
|
|
201
|
-
}
|
|
202
|
-
getDropPosition(e) {
|
|
203
|
-
if (this.dropTarget === this.dragTarget || !isPresent(this.dropTarget)) {
|
|
204
|
-
return dropPosition.forbidden;
|
|
205
|
-
}
|
|
206
|
-
const itemViewPortCoords = this.dropTarget.getBoundingClientRect();
|
|
207
|
-
const itemDivisionsCount = 3;
|
|
208
|
-
const itemDivisionHeight = itemViewPortCoords.height / itemDivisionsCount;
|
|
209
|
-
const { dropTargetRow } = this.rowReorderArgs(this.dragTarget, this.dropTarget, this.view);
|
|
210
|
-
const pointerPosition = e.clientY;
|
|
211
|
-
const itemTop = itemViewPortCoords.top;
|
|
212
|
-
let currentDropPosition = null;
|
|
213
|
-
if (pointerPosition <= itemTop + itemDivisionHeight) {
|
|
214
|
-
currentDropPosition = dropPosition.before;
|
|
215
|
-
}
|
|
216
|
-
else if (pointerPosition >= itemTop + itemViewPortCoords.height - itemDivisionHeight) {
|
|
217
|
-
currentDropPosition = dropPosition.after;
|
|
218
|
-
}
|
|
219
|
-
else {
|
|
220
|
-
currentDropPosition = dropPosition.over;
|
|
221
|
-
}
|
|
222
|
-
if (currentDropPosition === dropPosition.before && isNextSibling(this.dropTarget, this.dragTarget)) {
|
|
223
|
-
currentDropPosition = dropPosition.forbidden;
|
|
224
|
-
}
|
|
225
|
-
else if (currentDropPosition === dropPosition.after && isPreviousSibling(this.dropTarget, this.dragTarget)) {
|
|
226
|
-
currentDropPosition = dropPosition.forbidden;
|
|
227
|
-
}
|
|
228
|
-
if (isPresent(dropTargetRow.dataItem)) {
|
|
229
|
-
if (this.isOverChild(dropTargetRow.dataItem)) {
|
|
230
|
-
currentDropPosition = dropPosition.forbidden;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
else {
|
|
234
|
-
currentDropPosition = dropPosition.forbidden;
|
|
235
|
-
}
|
|
236
|
-
return currentDropPosition;
|
|
237
|
-
}
|
|
238
|
-
updateDropIndicatorPosition() {
|
|
239
|
-
if (this.shouldHideDropIndicator() || !this.dropTarget) {
|
|
240
|
-
this.hide();
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
this.show();
|
|
244
|
-
const destinationItemOffset = getOffset(this.dropTarget);
|
|
245
|
-
let indicatorOffsetTop = destinationItemOffset.top;
|
|
246
|
-
const indicatorOffsetLeft = destinationItemOffset.left + this.dropIndicator.offsetWidth / 2;
|
|
247
|
-
if (this.lastDropPosition === dropPosition.after) {
|
|
248
|
-
indicatorOffsetTop += this.dropTarget.offsetHeight;
|
|
249
|
-
}
|
|
250
|
-
this.renderer.setStyle(this.dropIndicator, 'left', `${indicatorOffsetLeft}px`);
|
|
251
|
-
this.renderer.setStyle(this.dropIndicator, 'top', `${indicatorOffsetTop}px`);
|
|
252
|
-
}
|
|
253
|
-
shouldHideDropIndicator() {
|
|
254
|
-
return this.lastDropPosition === dropPosition.forbidden || this.lastDropPosition === dropPosition.over;
|
|
255
|
-
}
|
|
256
|
-
hide() {
|
|
257
|
-
if (isPresent(this.dropIndicator)) {
|
|
258
|
-
this.renderer.setStyle(this.dropIndicator, 'display', 'none');
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
show() {
|
|
262
|
-
if (isPresent(this.dropIndicator)) {
|
|
263
|
-
this.renderer.removeStyle(this.dropIndicator, 'display');
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RowReorderService, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
267
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RowReorderService });
|
|
268
|
-
}
|
|
269
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RowReorderService, decorators: [{
|
|
270
|
-
type: Injectable
|
|
271
|
-
}], ctorParameters: () => [{ type: i0.Renderer2 }], propDecorators: { rowReorder: [{
|
|
272
|
-
type: Output
|
|
273
|
-
}] } });
|