@progress/kendo-angular-treelist 13.0.0-develop.3 → 13.0.0-develop.5
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 +5 -1
- package/binding-directives/data-bound-tree-component.d.ts +9 -0
- package/binding-directives/flat-binding.directive.d.ts +14 -3
- package/binding-directives/hierarchy-binding.directive.d.ts +12 -3
- package/columns/column-base.d.ts +4 -0
- package/columns/rowreorder-column.component.d.ts +19 -0
- package/esm2020/binding-directives/base-binding.directive.mjs +9 -3
- package/esm2020/binding-directives/flat-binding.directive.mjs +56 -6
- package/esm2020/binding-directives/hierarchy-binding.directive.mjs +46 -6
- package/esm2020/columns/column-base.mjs +4 -0
- package/esm2020/columns/rowreorder-column.component.mjs +47 -0
- package/esm2020/index.mjs +2 -0
- package/esm2020/localization/messages.mjs +3 -1
- package/esm2020/package-metadata.mjs +2 -2
- package/esm2020/rendering/cell.component.mjs +47 -16
- package/esm2020/rendering/constants.mjs +4 -0
- package/esm2020/rendering/table-body.component.mjs +5 -3
- package/esm2020/row-reordering/flat-reorder.service.mjs +48 -0
- package/esm2020/row-reordering/hierarchical-reorder.service.mjs +55 -0
- package/esm2020/row-reordering/row-reorder.service.mjs +220 -0
- package/esm2020/row-reordering/types.mjs +5 -0
- package/esm2020/row-reordering/utils.mjs +129 -0
- package/esm2020/shared.module.mjs +8 -3
- package/esm2020/treelist.component.mjs +161 -23
- package/esm2020/treelist.module.mjs +71 -66
- package/fesm2015/progress-kendo-angular-treelist.mjs +808 -62
- package/fesm2020/progress-kendo-angular-treelist.mjs +799 -62
- package/index.d.ts +2 -0
- package/localization/messages.d.ts +5 -1
- package/package.json +16 -15
- package/rendering/cell.component.d.ts +6 -1
- package/rendering/constants.d.ts +4 -0
- package/row-reordering/flat-reorder.service.d.ts +16 -0
- package/row-reordering/hierarchical-reorder.service.d.ts +16 -0
- package/row-reordering/row-reorder.service.d.ts +61 -0
- package/row-reordering/types.d.ts +39 -0
- package/row-reordering/utils.d.ts +85 -0
- package/schematics/ngAdd/index.js +3 -3
- package/shared.module.d.ts +5 -4
- package/treelist.component.d.ts +42 -2
- package/treelist.module.d.ts +68 -66
|
@@ -6,9 +6,12 @@ import { SimpleChange, OnInit, OnDestroy, OnChanges, DoCheck } from '@angular/co
|
|
|
6
6
|
import { State, CompositeFilterDescriptor, SortDescriptor } from '@progress/kendo-data-query';
|
|
7
7
|
import { DataBoundTreeComponent } from './data-bound-tree-component';
|
|
8
8
|
import { DataStateChangeEvent } from '../data/change-event-args.interface';
|
|
9
|
+
import { RowReorderEvent } from '../row-reordering/types';
|
|
10
|
+
import { RowReorderService } from './../row-reordering/row-reorder.service';
|
|
9
11
|
import * as i0 from "@angular/core";
|
|
10
12
|
export declare abstract class BaseBindingDirective implements OnInit, OnDestroy, OnChanges, DoCheck {
|
|
11
13
|
protected component: DataBoundTreeComponent;
|
|
14
|
+
protected rowReorderService?: RowReorderService;
|
|
12
15
|
/**
|
|
13
16
|
* Defines the descriptors by which the data will be sorted.
|
|
14
17
|
*/
|
|
@@ -28,7 +31,7 @@ export declare abstract class BaseBindingDirective implements OnInit, OnDestroy,
|
|
|
28
31
|
protected originalData: any[];
|
|
29
32
|
protected _aggregate: any;
|
|
30
33
|
private subscriptions;
|
|
31
|
-
constructor(component: DataBoundTreeComponent);
|
|
34
|
+
constructor(component: DataBoundTreeComponent, rowReorderService?: RowReorderService);
|
|
32
35
|
/**
|
|
33
36
|
* @hidden
|
|
34
37
|
*/
|
|
@@ -54,6 +57,7 @@ export declare abstract class BaseBindingDirective implements OnInit, OnDestroy,
|
|
|
54
57
|
rebind(): void;
|
|
55
58
|
protected abstract getChildren(item?: any): any;
|
|
56
59
|
protected abstract itemKey(item: any): any;
|
|
60
|
+
protected onRowReorder(_event: RowReorderEvent): void;
|
|
57
61
|
protected applyState({ sort, filter }: State): void;
|
|
58
62
|
protected fetchChildren(item?: any): any;
|
|
59
63
|
protected hasChildren(item: any): boolean;
|
|
@@ -6,6 +6,7 @@ import { EventEmitter } from '@angular/core';
|
|
|
6
6
|
import { CompositeFilterDescriptor, SortDescriptor } from '@progress/kendo-data-query';
|
|
7
7
|
import { Observable } from 'rxjs';
|
|
8
8
|
import { LocalEditService } from '../editing-directives/local-edit.service';
|
|
9
|
+
import { RowReorderEvent } from '../row-reordering/types';
|
|
9
10
|
import * as i0 from "@angular/core";
|
|
10
11
|
/**
|
|
11
12
|
* @hidden
|
|
@@ -41,6 +42,14 @@ export declare abstract class DataBoundTreeComponent {
|
|
|
41
42
|
* Fires when the data state of the component is changed.
|
|
42
43
|
*/
|
|
43
44
|
abstract dataStateChange: EventEmitter<any>;
|
|
45
|
+
/**
|
|
46
|
+
* Fires when row reordering is performed.
|
|
47
|
+
*/
|
|
48
|
+
abstract rowReorder?: EventEmitter<RowReorderEvent>;
|
|
49
|
+
/**
|
|
50
|
+
* Specifies if row reordering is enabled.
|
|
51
|
+
*/
|
|
52
|
+
abstract rowReorderable?: boolean;
|
|
44
53
|
/**
|
|
45
54
|
* Holds the local edit service implementation, configured by the data-binding directives and accessed by the editing ones.
|
|
46
55
|
*/
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { BaseBindingDirective } from './base-binding.directive';
|
|
6
6
|
import { DataBoundTreeComponent } from './data-bound-tree-component';
|
|
7
|
+
import { RowReorderService } from '../row-reordering/row-reorder.service';
|
|
8
|
+
import { RowReorderEvent } from '../row-reordering/types';
|
|
7
9
|
import * as i0 from "@angular/core";
|
|
8
10
|
/**
|
|
9
11
|
* A directive which binds the TreeList to an array of objects by using
|
|
@@ -15,14 +17,17 @@ import * as i0 from "@angular/core";
|
|
|
15
17
|
*/
|
|
16
18
|
export declare class FlatBindingDirective extends BaseBindingDirective {
|
|
17
19
|
protected component: DataBoundTreeComponent;
|
|
20
|
+
protected rowReorderService: RowReorderService;
|
|
18
21
|
/**
|
|
19
22
|
* The name of the field which contains the identifier of the parent node.
|
|
20
23
|
*/
|
|
21
24
|
set parentIdField(value: string);
|
|
25
|
+
get parentIdField(): string;
|
|
22
26
|
/**
|
|
23
27
|
* The name of the field which contains the unique identifier of the node.
|
|
24
28
|
*/
|
|
25
29
|
set idField(value: string);
|
|
30
|
+
get idField(): string;
|
|
26
31
|
/**
|
|
27
32
|
* The array of data which will be used to populate the TreeList.
|
|
28
33
|
*/
|
|
@@ -31,9 +36,15 @@ export declare class FlatBindingDirective extends BaseBindingDirective {
|
|
|
31
36
|
idSetter: any;
|
|
32
37
|
parentIdGetter: any;
|
|
33
38
|
parentIdSetter: any;
|
|
34
|
-
constructor(component: DataBoundTreeComponent);
|
|
35
|
-
|
|
39
|
+
constructor(component: DataBoundTreeComponent, rowReorderService: RowReorderService);
|
|
40
|
+
private _parentIdField;
|
|
41
|
+
private _idField;
|
|
42
|
+
/**
|
|
43
|
+
* @hidden
|
|
44
|
+
*/
|
|
45
|
+
getChildren(item?: any): any;
|
|
36
46
|
protected itemKey(item: any): void;
|
|
37
|
-
|
|
47
|
+
protected onRowReorder(ev: RowReorderEvent): void;
|
|
48
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FlatBindingDirective, [null, { optional: true; }]>;
|
|
38
49
|
static ɵdir: i0.ɵɵDirectiveDeclaration<FlatBindingDirective, "[kendoTreeListFlatBinding]", ["kendoTreeListFlatBinding"], { "parentIdField": "parentIdField"; "idField": "idField"; "data": "kendoTreeListFlatBinding"; }, {}, never>;
|
|
39
50
|
}
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { BaseBindingDirective } from './base-binding.directive';
|
|
6
6
|
import { DataBoundTreeComponent } from './data-bound-tree-component';
|
|
7
|
+
import { RowReorderService } from '../row-reordering/row-reorder.service';
|
|
8
|
+
import { RowReorderEvent } from '../row-reordering/types';
|
|
7
9
|
import * as i0 from "@angular/core";
|
|
8
10
|
/**
|
|
9
11
|
* A directive which binds the TreeList to a tree of objects.
|
|
@@ -14,19 +16,26 @@ import * as i0 from "@angular/core";
|
|
|
14
16
|
*/
|
|
15
17
|
export declare class HierarchyBindingDirective extends BaseBindingDirective {
|
|
16
18
|
protected component: DataBoundTreeComponent;
|
|
19
|
+
protected rowReorderService: RowReorderService;
|
|
17
20
|
/**
|
|
18
21
|
* The name of the field which holds the child data items of the node.
|
|
19
22
|
*/
|
|
20
23
|
set childrenField(value: string);
|
|
24
|
+
get childrenField(): string;
|
|
21
25
|
/**
|
|
22
26
|
* The array of data which will be used to populate the TreeList.
|
|
23
27
|
*/
|
|
24
28
|
data: any[];
|
|
25
29
|
childrenGetter: any;
|
|
26
30
|
childrenSetter: any;
|
|
27
|
-
constructor(component: DataBoundTreeComponent);
|
|
28
|
-
|
|
31
|
+
constructor(component: DataBoundTreeComponent, rowReorderService: RowReorderService);
|
|
32
|
+
private _childrenField;
|
|
33
|
+
/**
|
|
34
|
+
* @hidden
|
|
35
|
+
*/
|
|
36
|
+
getChildren(item?: any): any[];
|
|
29
37
|
protected itemKey(item: any): void;
|
|
30
|
-
|
|
38
|
+
protected onRowReorder(ev: RowReorderEvent): void;
|
|
39
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HierarchyBindingDirective, [null, { optional: true; }]>;
|
|
31
40
|
static ɵdir: i0.ɵɵDirectiveDeclaration<HierarchyBindingDirective, "[kendoTreeListHierarchyBinding]", ["kendoTreeListHierarchyBinding"], { "childrenField": "childrenField"; "data": "kendoTreeListHierarchyBinding"; }, {}, never>;
|
|
32
41
|
}
|
package/columns/column-base.d.ts
CHANGED
|
@@ -16,6 +16,10 @@ export declare const isSpanColumn: (column: any) => any;
|
|
|
16
16
|
* @hidden
|
|
17
17
|
*/
|
|
18
18
|
export declare const isCheckboxColumn: (column: any) => any;
|
|
19
|
+
/**
|
|
20
|
+
* @hidden
|
|
21
|
+
*/
|
|
22
|
+
export declare const isRowReorderColumn: (column: any) => any;
|
|
19
23
|
/**
|
|
20
24
|
* The base class for the column components of the TreeList.
|
|
21
25
|
*/
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { ColumnBase } from './column-base';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* Represents the drag handle for reordering rows in the TreeList.
|
|
9
|
+
*/
|
|
10
|
+
export declare class RowReorderColumnComponent extends ColumnBase {
|
|
11
|
+
parent?: ColumnBase;
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
readonly isRowReorderColumn: boolean;
|
|
16
|
+
constructor(parent?: ColumnBase);
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RowReorderColumnComponent, [{ optional: true; host: true; skipSelf: true; }]>;
|
|
18
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RowReorderColumnComponent, "kendo-treelist-rowreorder-column", never, {}, {}, never, never>;
|
|
19
|
+
}
|
|
@@ -8,11 +8,14 @@ import { process, aggregateBy } from '@progress/kendo-data-query';
|
|
|
8
8
|
import { isChanged } from '@progress/kendo-angular-common';
|
|
9
9
|
import { DataBoundTreeComponent } from './data-bound-tree-component';
|
|
10
10
|
import { anyChanged } from '../utils';
|
|
11
|
+
import { RowReorderService } from './../row-reordering/row-reorder.service';
|
|
11
12
|
import * as i0 from "@angular/core";
|
|
12
13
|
import * as i1 from "./data-bound-tree-component";
|
|
14
|
+
import * as i2 from "./../row-reordering/row-reorder.service";
|
|
13
15
|
export class BaseBindingDirective {
|
|
14
|
-
constructor(component) {
|
|
16
|
+
constructor(component, rowReorderService) {
|
|
15
17
|
this.component = component;
|
|
18
|
+
this.rowReorderService = rowReorderService;
|
|
16
19
|
this.state = {};
|
|
17
20
|
this.cache = new Map();
|
|
18
21
|
this.originalData = [];
|
|
@@ -45,6 +48,8 @@ export class BaseBindingDirective {
|
|
|
45
48
|
this.applyState(this.state);
|
|
46
49
|
this.subscriptions.add(this.component.dataStateChange
|
|
47
50
|
.subscribe(this.onStateChange.bind(this)));
|
|
51
|
+
this.component.rowReorderable && this.subscriptions.add(this.rowReorderService.rowReorder
|
|
52
|
+
.subscribe(this.onRowReorder.bind(this)));
|
|
48
53
|
}
|
|
49
54
|
/**
|
|
50
55
|
* @hidden
|
|
@@ -85,6 +90,7 @@ export class BaseBindingDirective {
|
|
|
85
90
|
this.cache.clear();
|
|
86
91
|
this.component.data = this.fetchChildren();
|
|
87
92
|
}
|
|
93
|
+
onRowReorder(_event) { }
|
|
88
94
|
applyState({ sort, filter }) {
|
|
89
95
|
this.sort = sort;
|
|
90
96
|
this.filter = filter;
|
|
@@ -153,12 +159,12 @@ export class BaseBindingDirective {
|
|
|
153
159
|
this.dataChanged = true;
|
|
154
160
|
}
|
|
155
161
|
}
|
|
156
|
-
BaseBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaseBindingDirective, deps: [{ token: i1.DataBoundTreeComponent }], target: i0.ɵɵFactoryTarget.Directive });
|
|
162
|
+
BaseBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaseBindingDirective, deps: [{ token: i1.DataBoundTreeComponent }, { token: i2.RowReorderService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
157
163
|
BaseBindingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: BaseBindingDirective, inputs: { sort: "sort", filter: "filter", aggregate: "aggregate" }, usesOnChanges: true, ngImport: i0 });
|
|
158
164
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaseBindingDirective, decorators: [{
|
|
159
165
|
type: Directive,
|
|
160
166
|
args: [{}]
|
|
161
|
-
}], ctorParameters: function () { return [{ type: i1.DataBoundTreeComponent }]; }, propDecorators: { sort: [{
|
|
167
|
+
}], ctorParameters: function () { return [{ type: i1.DataBoundTreeComponent }, { type: i2.RowReorderService }]; }, propDecorators: { sort: [{
|
|
162
168
|
type: Input
|
|
163
169
|
}], filter: [{
|
|
164
170
|
type: Input
|
|
@@ -2,14 +2,17 @@
|
|
|
2
2
|
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Directive, Input } from '@angular/core';
|
|
5
|
+
import { Directive, Input, Optional } from '@angular/core';
|
|
6
6
|
import { getter, setter } from '@progress/kendo-common';
|
|
7
7
|
import { BaseBindingDirective } from './base-binding.directive';
|
|
8
8
|
import { FlatEditService } from '../editing-directives/flat-edit.service';
|
|
9
9
|
import { DataBoundTreeComponent } from './data-bound-tree-component';
|
|
10
10
|
import { isPresent } from '../utils';
|
|
11
|
+
import { RowReorderService } from '../row-reordering/row-reorder.service';
|
|
12
|
+
import { FlatRowReorderService } from '../row-reordering/flat-reorder.service';
|
|
11
13
|
import * as i0 from "@angular/core";
|
|
12
14
|
import * as i1 from "./data-bound-tree-component";
|
|
15
|
+
import * as i2 from "../row-reordering/row-reorder.service";
|
|
13
16
|
const ROOT_ID = null;
|
|
14
17
|
/**
|
|
15
18
|
* A directive which binds the TreeList to an array of objects by using
|
|
@@ -20,14 +23,18 @@ const ROOT_ID = null;
|
|
|
20
23
|
* and [filtering]({% slug filtering_treelist %}) ([more information and examples]({% slug databinding_treelist %})).
|
|
21
24
|
*/
|
|
22
25
|
export class FlatBindingDirective extends BaseBindingDirective {
|
|
23
|
-
constructor(component) {
|
|
26
|
+
constructor(component, rowReorderService) {
|
|
24
27
|
super(component);
|
|
25
28
|
this.component = component;
|
|
29
|
+
this.rowReorderService = rowReorderService;
|
|
26
30
|
this.idGetter = getter('id');
|
|
27
31
|
this.idSetter = setter('id');
|
|
28
32
|
this.parentIdGetter = getter('parentId');
|
|
29
33
|
this.parentIdSetter = setter('parentId');
|
|
30
34
|
component.localEditService = new FlatEditService(this);
|
|
35
|
+
if (this.rowReorderService) {
|
|
36
|
+
this.rowReorderService.bindingDirective = this;
|
|
37
|
+
}
|
|
31
38
|
}
|
|
32
39
|
/**
|
|
33
40
|
* The name of the field which contains the identifier of the parent node.
|
|
@@ -35,6 +42,10 @@ export class FlatBindingDirective extends BaseBindingDirective {
|
|
|
35
42
|
set parentIdField(value) {
|
|
36
43
|
this.parentIdGetter = getter(value);
|
|
37
44
|
this.parentIdSetter = setter(value);
|
|
45
|
+
this._parentIdField = value;
|
|
46
|
+
}
|
|
47
|
+
get parentIdField() {
|
|
48
|
+
return this._parentIdField;
|
|
38
49
|
}
|
|
39
50
|
/**
|
|
40
51
|
* The name of the field which contains the unique identifier of the node.
|
|
@@ -42,7 +53,14 @@ export class FlatBindingDirective extends BaseBindingDirective {
|
|
|
42
53
|
set idField(value) {
|
|
43
54
|
this.idGetter = getter(value);
|
|
44
55
|
this.idSetter = setter(value);
|
|
56
|
+
this._idField = value;
|
|
57
|
+
}
|
|
58
|
+
get idField() {
|
|
59
|
+
return this._idField;
|
|
45
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* @hidden
|
|
63
|
+
*/
|
|
46
64
|
getChildren(item) {
|
|
47
65
|
const id = this.itemKey(item);
|
|
48
66
|
const children = id === ROOT_ID ?
|
|
@@ -53,16 +71,48 @@ export class FlatBindingDirective extends BaseBindingDirective {
|
|
|
53
71
|
itemKey(item) {
|
|
54
72
|
return item ? this.idGetter(item) : ROOT_ID;
|
|
55
73
|
}
|
|
74
|
+
onRowReorder(ev) {
|
|
75
|
+
if (ev.dropPosition === 'forbidden') {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const draggedItem = ev.draggedRows[0].dataItem;
|
|
79
|
+
const dropTargetItem = ev.dropTargetRow.dataItem;
|
|
80
|
+
if (ev.dropPosition === 'over') {
|
|
81
|
+
const dropItemId = this.itemKey(dropTargetItem);
|
|
82
|
+
if (draggedItem[this.parentIdField] !== dropItemId) {
|
|
83
|
+
draggedItem[this.parentIdField] = dropItemId;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
const dropItemParentId = dropTargetItem[this.parentIdField];
|
|
88
|
+
draggedItem[this.parentIdField] = dropItemParentId;
|
|
89
|
+
this.rowReorderService.reorderRows(ev, this.originalData);
|
|
90
|
+
}
|
|
91
|
+
this.rebind();
|
|
92
|
+
}
|
|
56
93
|
}
|
|
57
|
-
FlatBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FlatBindingDirective, deps: [{ token: i1.DataBoundTreeComponent }], target: i0.ɵɵFactoryTarget.Directive });
|
|
58
|
-
FlatBindingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: FlatBindingDirective, selector: "[kendoTreeListFlatBinding]", inputs: { parentIdField: "parentIdField", idField: "idField", data: ["kendoTreeListFlatBinding", "data"] },
|
|
94
|
+
FlatBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FlatBindingDirective, deps: [{ token: i1.DataBoundTreeComponent }, { token: i2.RowReorderService, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
95
|
+
FlatBindingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: FlatBindingDirective, selector: "[kendoTreeListFlatBinding]", inputs: { parentIdField: "parentIdField", idField: "idField", data: ["kendoTreeListFlatBinding", "data"] }, providers: [
|
|
96
|
+
{
|
|
97
|
+
provide: RowReorderService,
|
|
98
|
+
useClass: FlatRowReorderService
|
|
99
|
+
}
|
|
100
|
+
], exportAs: ["kendoTreeListFlatBinding"], usesInheritance: true, ngImport: i0 });
|
|
59
101
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FlatBindingDirective, decorators: [{
|
|
60
102
|
type: Directive,
|
|
61
103
|
args: [{
|
|
62
104
|
exportAs: 'kendoTreeListFlatBinding',
|
|
63
|
-
selector: '[kendoTreeListFlatBinding]'
|
|
105
|
+
selector: '[kendoTreeListFlatBinding]',
|
|
106
|
+
providers: [
|
|
107
|
+
{
|
|
108
|
+
provide: RowReorderService,
|
|
109
|
+
useClass: FlatRowReorderService
|
|
110
|
+
}
|
|
111
|
+
]
|
|
64
112
|
}]
|
|
65
|
-
}], ctorParameters: function () { return [{ type: i1.DataBoundTreeComponent }
|
|
113
|
+
}], ctorParameters: function () { return [{ type: i1.DataBoundTreeComponent }, { type: i2.RowReorderService, decorators: [{
|
|
114
|
+
type: Optional
|
|
115
|
+
}] }]; }, propDecorators: { parentIdField: [{
|
|
66
116
|
type: Input
|
|
67
117
|
}], idField: [{
|
|
68
118
|
type: Input
|
|
@@ -2,13 +2,16 @@
|
|
|
2
2
|
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Directive, Input } from '@angular/core';
|
|
5
|
+
import { Directive, Input, Optional } from '@angular/core';
|
|
6
6
|
import { getter, setter } from '@progress/kendo-common';
|
|
7
7
|
import { BaseBindingDirective } from './base-binding.directive';
|
|
8
8
|
import { HierarchyEditService } from '../editing-directives/hierarchy-edit.service';
|
|
9
9
|
import { DataBoundTreeComponent } from './data-bound-tree-component';
|
|
10
|
+
import { RowReorderService } from '../row-reordering/row-reorder.service';
|
|
11
|
+
import { HierarchicalRowReorderService } from '../row-reordering/hierarchical-reorder.service';
|
|
10
12
|
import * as i0 from "@angular/core";
|
|
11
13
|
import * as i1 from "./data-bound-tree-component";
|
|
14
|
+
import * as i2 from "../row-reordering/row-reorder.service";
|
|
12
15
|
/**
|
|
13
16
|
* A directive which binds the TreeList to a tree of objects.
|
|
14
17
|
*
|
|
@@ -17,12 +20,16 @@ import * as i1 from "./data-bound-tree-component";
|
|
|
17
20
|
* and [filtering]({% slug filtering_treelist %}) ([more information and examples](slug:databinding_treelist#toc-binding-to-hierarchical-data)).
|
|
18
21
|
*/
|
|
19
22
|
export class HierarchyBindingDirective extends BaseBindingDirective {
|
|
20
|
-
constructor(component) {
|
|
23
|
+
constructor(component, rowReorderService) {
|
|
21
24
|
super(component);
|
|
22
25
|
this.component = component;
|
|
26
|
+
this.rowReorderService = rowReorderService;
|
|
23
27
|
this.childrenGetter = getter('items');
|
|
24
28
|
this.childrenSetter = setter('items');
|
|
25
29
|
component.localEditService = new HierarchyEditService(this);
|
|
30
|
+
if (this.rowReorderService) {
|
|
31
|
+
this.rowReorderService.bindingDirective = this;
|
|
32
|
+
}
|
|
26
33
|
}
|
|
27
34
|
/**
|
|
28
35
|
* The name of the field which holds the child data items of the node.
|
|
@@ -30,23 +37,56 @@ export class HierarchyBindingDirective extends BaseBindingDirective {
|
|
|
30
37
|
set childrenField(value) {
|
|
31
38
|
this.childrenGetter = getter(value);
|
|
32
39
|
this.childrenSetter = setter(value);
|
|
40
|
+
this._childrenField = value;
|
|
33
41
|
}
|
|
42
|
+
get childrenField() {
|
|
43
|
+
return this._childrenField;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* @hidden
|
|
47
|
+
*/
|
|
34
48
|
getChildren(item) {
|
|
35
49
|
return item ? this.childrenGetter(item) || [] : this.originalData;
|
|
36
50
|
}
|
|
37
51
|
itemKey(item) {
|
|
38
52
|
return item;
|
|
39
53
|
}
|
|
54
|
+
onRowReorder(ev) {
|
|
55
|
+
if (ev.dropPosition === 'forbidden') {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const dropTargetItem = ev.dropTargetRow.dataItem;
|
|
59
|
+
if (ev.dropPosition === 'over') {
|
|
60
|
+
if (!dropTargetItem.hasOwnProperty(this.childrenField)) {
|
|
61
|
+
dropTargetItem[this.childrenField] = [];
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
this.rowReorderService.reorderRows(ev, this.originalData, this.childrenField);
|
|
65
|
+
this.rebind();
|
|
66
|
+
}
|
|
40
67
|
}
|
|
41
|
-
HierarchyBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: HierarchyBindingDirective, deps: [{ token: i1.DataBoundTreeComponent }], target: i0.ɵɵFactoryTarget.Directive });
|
|
42
|
-
HierarchyBindingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: HierarchyBindingDirective, selector: "[kendoTreeListHierarchyBinding]", inputs: { childrenField: "childrenField", data: ["kendoTreeListHierarchyBinding", "data"] },
|
|
68
|
+
HierarchyBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: HierarchyBindingDirective, deps: [{ token: i1.DataBoundTreeComponent }, { token: i2.RowReorderService, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
69
|
+
HierarchyBindingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: HierarchyBindingDirective, selector: "[kendoTreeListHierarchyBinding]", inputs: { childrenField: "childrenField", data: ["kendoTreeListHierarchyBinding", "data"] }, providers: [
|
|
70
|
+
{
|
|
71
|
+
provide: RowReorderService,
|
|
72
|
+
useClass: HierarchicalRowReorderService
|
|
73
|
+
}
|
|
74
|
+
], exportAs: ["kendoTreeListHierarchyBinding"], usesInheritance: true, ngImport: i0 });
|
|
43
75
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: HierarchyBindingDirective, decorators: [{
|
|
44
76
|
type: Directive,
|
|
45
77
|
args: [{
|
|
46
78
|
exportAs: 'kendoTreeListHierarchyBinding',
|
|
47
|
-
selector: '[kendoTreeListHierarchyBinding]'
|
|
79
|
+
selector: '[kendoTreeListHierarchyBinding]',
|
|
80
|
+
providers: [
|
|
81
|
+
{
|
|
82
|
+
provide: RowReorderService,
|
|
83
|
+
useClass: HierarchicalRowReorderService
|
|
84
|
+
}
|
|
85
|
+
]
|
|
48
86
|
}]
|
|
49
|
-
}], ctorParameters: function () { return [{ type: i1.DataBoundTreeComponent }
|
|
87
|
+
}], ctorParameters: function () { return [{ type: i1.DataBoundTreeComponent }, { type: i2.RowReorderService, decorators: [{
|
|
88
|
+
type: Optional
|
|
89
|
+
}] }]; }, propDecorators: { childrenField: [{
|
|
50
90
|
type: Input
|
|
51
91
|
}], data: [{
|
|
52
92
|
type: Input,
|
|
@@ -17,6 +17,10 @@ export const isSpanColumn = column => column.isSpanColumn;
|
|
|
17
17
|
* @hidden
|
|
18
18
|
*/
|
|
19
19
|
export const isCheckboxColumn = column => column.isCheckboxColumn;
|
|
20
|
+
/**
|
|
21
|
+
* @hidden
|
|
22
|
+
*/
|
|
23
|
+
export const isRowReorderColumn = column => column.isRowReorderColumn;
|
|
20
24
|
const isColumnContainer = column => column.isColumnGroup || isSpanColumn(column);
|
|
21
25
|
/**
|
|
22
26
|
* The base class for the column components of the TreeList.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Component, forwardRef, SkipSelf, Host, Optional } from '@angular/core';
|
|
6
|
+
import { ColumnBase } from './column-base';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
import * as i1 from "./column-base";
|
|
9
|
+
/**
|
|
10
|
+
* Represents the drag handle for reordering rows in the TreeList.
|
|
11
|
+
*/
|
|
12
|
+
export class RowReorderColumnComponent extends ColumnBase {
|
|
13
|
+
constructor(parent) {
|
|
14
|
+
super(parent);
|
|
15
|
+
this.parent = parent;
|
|
16
|
+
/**
|
|
17
|
+
* @hidden
|
|
18
|
+
*/
|
|
19
|
+
this.isRowReorderColumn = true;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
RowReorderColumnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: RowReorderColumnComponent, deps: [{ token: i1.ColumnBase, host: true, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
23
|
+
RowReorderColumnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: RowReorderColumnComponent, selector: "kendo-treelist-rowreorder-column", providers: [
|
|
24
|
+
{
|
|
25
|
+
provide: ColumnBase,
|
|
26
|
+
useExisting: forwardRef(() => RowReorderColumnComponent)
|
|
27
|
+
}
|
|
28
|
+
], usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
29
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: RowReorderColumnComponent, decorators: [{
|
|
30
|
+
type: Component,
|
|
31
|
+
args: [{
|
|
32
|
+
providers: [
|
|
33
|
+
{
|
|
34
|
+
provide: ColumnBase,
|
|
35
|
+
useExisting: forwardRef(() => RowReorderColumnComponent)
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
selector: 'kendo-treelist-rowreorder-column',
|
|
39
|
+
template: ``
|
|
40
|
+
}]
|
|
41
|
+
}], ctorParameters: function () { return [{ type: i1.ColumnBase, decorators: [{
|
|
42
|
+
type: SkipSelf
|
|
43
|
+
}, {
|
|
44
|
+
type: Host
|
|
45
|
+
}, {
|
|
46
|
+
type: Optional
|
|
47
|
+
}] }]; } });
|
package/esm2020/index.mjs
CHANGED
|
@@ -107,6 +107,8 @@ export { SinglePopupService, PopupCloseEvent } from './common/single-popup.servi
|
|
|
107
107
|
export { ExpandEvent } from './expand-state/expand-event';
|
|
108
108
|
export { ExpandableDirective } from './expand-state/expandable.directive';
|
|
109
109
|
export { ExpandableTreeComponent } from './expand-state/expandable-tree-component';
|
|
110
|
+
export { RowReorderColumnComponent } from './columns/rowreorder-column.component';
|
|
111
|
+
export * from './row-reordering/types';
|
|
110
112
|
// addresses error NG3001: Unsupported private class
|
|
111
113
|
export { ColumnMenuTemplateDirective } from './column-menu/column-menu-template.directive';
|
|
112
114
|
export { EditCommandDirective } from './editing/edit-command.directive';
|
|
@@ -11,7 +11,7 @@ import * as i0 from "@angular/core";
|
|
|
11
11
|
export class Messages extends ComponentMessages {
|
|
12
12
|
}
|
|
13
13
|
Messages.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: Messages, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
14
|
-
Messages.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: Messages, inputs: { groupPanelEmpty: "groupPanelEmpty", noRecords: "noRecords", pagerLabel: "pagerLabel", pagerFirstPage: "pagerFirstPage", pagerLastPage: "pagerLastPage", pagerPreviousPage: "pagerPreviousPage", pagerNextPage: "pagerNextPage", pagerPage: "pagerPage", pagerPageNumberInputTitle: "pagerPageNumberInputTitle", pagerItemsPerPage: "pagerItemsPerPage", pagerOf: "pagerOf", pagerItemsTotal: "pagerItemsTotal", selectPage: "selectPage", filter: "filter", filterEqOperator: "filterEqOperator", filterNotEqOperator: "filterNotEqOperator", filterIsNullOperator: "filterIsNullOperator", filterIsNotNullOperator: "filterIsNotNullOperator", filterIsEmptyOperator: "filterIsEmptyOperator", filterIsNotEmptyOperator: "filterIsNotEmptyOperator", filterStartsWithOperator: "filterStartsWithOperator", filterContainsOperator: "filterContainsOperator", filterNotContainsOperator: "filterNotContainsOperator", filterEndsWithOperator: "filterEndsWithOperator", filterGteOperator: "filterGteOperator", filterGtOperator: "filterGtOperator", filterLteOperator: "filterLteOperator", filterLtOperator: "filterLtOperator", filterIsTrue: "filterIsTrue", filterIsFalse: "filterIsFalse", filterBooleanAll: "filterBooleanAll", filterAfterOrEqualOperator: "filterAfterOrEqualOperator", filterAfterOperator: "filterAfterOperator", filterBeforeOperator: "filterBeforeOperator", filterBeforeOrEqualOperator: "filterBeforeOrEqualOperator", filterFilterButton: "filterFilterButton", filterClearButton: "filterClearButton", filterAndLogic: "filterAndLogic", filterOrLogic: "filterOrLogic", loading: "loading", columnMenu: "columnMenu", columns: "columns", lock: "lock", unlock: "unlock", sortable: "sortable", sortAscending: "sortAscending", sortDescending: "sortDescending", sortedAscending: "sortedAscending", sortedDescending: "sortedDescending", sortedDefault: "sortedDefault", columnsApply: "columnsApply", columnsReset: "columnsReset", topToolbarLabel: "topToolbarLabel", bottomToolbarLabel: "bottomToolbarLabel" }, usesInheritance: true, ngImport: i0 });
|
|
14
|
+
Messages.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: Messages, inputs: { groupPanelEmpty: "groupPanelEmpty", noRecords: "noRecords", pagerLabel: "pagerLabel", pagerFirstPage: "pagerFirstPage", pagerLastPage: "pagerLastPage", pagerPreviousPage: "pagerPreviousPage", pagerNextPage: "pagerNextPage", pagerPage: "pagerPage", pagerPageNumberInputTitle: "pagerPageNumberInputTitle", pagerItemsPerPage: "pagerItemsPerPage", pagerOf: "pagerOf", pagerItemsTotal: "pagerItemsTotal", selectPage: "selectPage", filter: "filter", filterEqOperator: "filterEqOperator", filterNotEqOperator: "filterNotEqOperator", filterIsNullOperator: "filterIsNullOperator", filterIsNotNullOperator: "filterIsNotNullOperator", filterIsEmptyOperator: "filterIsEmptyOperator", filterIsNotEmptyOperator: "filterIsNotEmptyOperator", filterStartsWithOperator: "filterStartsWithOperator", filterContainsOperator: "filterContainsOperator", filterNotContainsOperator: "filterNotContainsOperator", filterEndsWithOperator: "filterEndsWithOperator", filterGteOperator: "filterGteOperator", filterGtOperator: "filterGtOperator", filterLteOperator: "filterLteOperator", filterLtOperator: "filterLtOperator", filterIsTrue: "filterIsTrue", filterIsFalse: "filterIsFalse", filterBooleanAll: "filterBooleanAll", filterAfterOrEqualOperator: "filterAfterOrEqualOperator", filterAfterOperator: "filterAfterOperator", filterBeforeOperator: "filterBeforeOperator", filterBeforeOrEqualOperator: "filterBeforeOrEqualOperator", filterFilterButton: "filterFilterButton", filterClearButton: "filterClearButton", filterAndLogic: "filterAndLogic", filterOrLogic: "filterOrLogic", loading: "loading", columnMenu: "columnMenu", columns: "columns", lock: "lock", unlock: "unlock", sortable: "sortable", sortAscending: "sortAscending", sortDescending: "sortDescending", sortedAscending: "sortedAscending", sortedDescending: "sortedDescending", sortedDefault: "sortedDefault", columnsApply: "columnsApply", columnsReset: "columnsReset", topToolbarLabel: "topToolbarLabel", bottomToolbarLabel: "bottomToolbarLabel", dragRowHandleLabel: "dragRowHandleLabel" }, usesInheritance: true, ngImport: i0 });
|
|
15
15
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: Messages, decorators: [{
|
|
16
16
|
type: Directive,
|
|
17
17
|
args: [{}]
|
|
@@ -123,4 +123,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
123
123
|
type: Input
|
|
124
124
|
}], bottomToolbarLabel: [{
|
|
125
125
|
type: Input
|
|
126
|
+
}], dragRowHandleLabel: [{
|
|
127
|
+
type: Input
|
|
126
128
|
}] } });
|
|
@@ -9,7 +9,7 @@ export const packageMetadata = {
|
|
|
9
9
|
name: '@progress/kendo-angular-treelist',
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate:
|
|
13
|
-
version: '13.0.0-develop.
|
|
12
|
+
publishDate: 1685016622,
|
|
13
|
+
version: '13.0.0-develop.5',
|
|
14
14
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
15
15
|
};
|