@progress/kendo-angular-grid 19.0.0-develop.8 → 19.0.0
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/adaptiveness/adaptive-mode.d.ts +12 -0
- package/adaptiveness/adaptive-renderer.component.d.ts +89 -0
- package/codemods/template-transformer/index.js +94 -0
- package/codemods/utils.js +553 -0
- package/codemods/v19/grid-kendogridgroupbinding.js +51 -0
- package/column-menu/column-chooser.component.d.ts +4 -0
- package/column-menu/column-list.component.d.ts +10 -3
- package/column-menu/column-menu-item.component.d.ts +48 -3
- package/column-menu/column-menu-item.directive.d.ts +5 -2
- package/column-menu/column-menu.component.d.ts +4 -2
- package/columns/column-base.d.ts +5 -0
- package/columns/span-column.component.d.ts +2 -2
- package/common/adaptiveness.service.d.ts +50 -0
- package/common/single-popup.service.d.ts +3 -1
- package/common/toolbar-tool-base.directive.d.ts +26 -0
- package/directives.d.ts +13 -5
- package/editing/add-command-tool.directive.d.ts +7 -6
- package/editing/cancel-command-tool.directive.d.ts +38 -0
- package/editing/edit-command-tool.directive.d.ts +38 -0
- package/editing/edit.service.d.ts +1 -1
- package/editing/remove-command-tool.directive.d.ts +39 -0
- package/editing/save-command-tool.directive.d.ts +38 -0
- package/editing/toolbar-editing-tool-base.directive.d.ts +29 -0
- package/editing-directives/editing-directive-base.d.ts +4 -1
- package/editing-directives/external-editing.directive.d.ts +3 -1
- package/esm2022/adaptiveness/adaptive-mode.mjs +5 -0
- package/esm2022/adaptiveness/adaptive-renderer.component.mjs +1197 -0
- package/esm2022/column-menu/column-chooser.component.mjs +13 -11
- package/esm2022/column-menu/column-list.component.mjs +51 -8
- package/esm2022/column-menu/column-menu-autosize-all.component.mjs +1 -1
- package/esm2022/column-menu/column-menu-autosize.component.mjs +1 -1
- package/esm2022/column-menu/column-menu-chooser.component.mjs +1 -1
- package/esm2022/column-menu/column-menu-container.component.mjs +1 -1
- package/esm2022/column-menu/column-menu-filter.component.mjs +1 -1
- package/esm2022/column-menu/column-menu-item.component.mjs +123 -12
- package/esm2022/column-menu/column-menu-item.directive.mjs +14 -5
- package/esm2022/column-menu/column-menu-lock.component.mjs +1 -1
- package/esm2022/column-menu/column-menu-position.component.mjs +1 -1
- package/esm2022/column-menu/column-menu-sort.component.mjs +1 -1
- package/esm2022/column-menu/column-menu-stick.component.mjs +1 -1
- package/esm2022/column-menu/column-menu.component.mjs +68 -44
- package/esm2022/column-resizing/column-handle.directive.mjs +2 -2
- package/esm2022/columns/column-base.mjs +9 -0
- package/esm2022/columns/columns-container.mjs +1 -1
- package/esm2022/columns/span-column.component.mjs +9 -9
- package/esm2022/common/adaptiveness.service.mjs +72 -0
- package/esm2022/common/single-popup.service.mjs +9 -3
- package/esm2022/common/toolbar-tool-base.directive.mjs +81 -0
- package/esm2022/directives.mjs +21 -4
- package/esm2022/editing/add-command-tool.directive.mjs +12 -15
- package/esm2022/editing/cancel-command-tool.directive.mjs +64 -0
- package/esm2022/editing/edit-command-tool.directive.mjs +59 -0
- package/esm2022/editing/remove-command-tool.directive.mjs +60 -0
- package/esm2022/editing/remove-command.directive.mjs +1 -0
- package/esm2022/editing/save-command-tool.directive.mjs +64 -0
- package/esm2022/editing/toolbar-editing-tool-base.directive.mjs +94 -0
- package/esm2022/editing-directives/editing-directive-base.mjs +5 -2
- package/esm2022/editing-directives/external-editing.directive.mjs +28 -14
- package/esm2022/excel/excel-command-tool.directive.mjs +12 -17
- package/esm2022/filtering/filter-input.directive.mjs +14 -2
- package/esm2022/filtering/menu/boolean-filter-menu.component.mjs +4 -2
- package/esm2022/filtering/menu/date-filter-menu-input.component.mjs +4 -0
- package/esm2022/filtering/menu/date-filter-menu.component.mjs +6 -0
- package/esm2022/filtering/menu/filter-menu-container.component.mjs +24 -10
- package/esm2022/filtering/menu/filter-menu-input-wrapper.component.mjs +26 -4
- package/esm2022/filtering/menu/filter-menu.component.mjs +44 -29
- package/esm2022/filtering/menu/numeric-filter-menu-input.component.mjs +2 -0
- package/esm2022/filtering/menu/numeric-filter-menu.component.mjs +6 -0
- package/esm2022/filtering/menu/string-filter-menu-input.component.mjs +2 -0
- package/esm2022/filtering/menu/string-filter-menu.component.mjs +10 -1
- package/esm2022/grid.component.mjs +376 -82
- package/esm2022/grid.module.mjs +115 -101
- package/esm2022/index.mjs +11 -1
- package/esm2022/localization/messages.mjs +128 -2
- package/esm2022/navigation/toolbar-tool-name.mjs +17 -0
- package/esm2022/package-metadata.mjs +2 -2
- package/esm2022/pdf/pdf-command-tool.directive.mjs +12 -15
- package/esm2022/rendering/cell.component.mjs +3 -3
- package/esm2022/rendering/header/header.component.mjs +1 -1
- package/esm2022/rendering/list.component.mjs +1 -1
- package/esm2022/rendering/table-body.component.mjs +1 -1
- package/esm2022/rendering/toolbar/tools/column-chooser-tool.directive.mjs +210 -0
- package/esm2022/rendering/toolbar/tools/filter-command-tool.directive.mjs +69 -34
- package/esm2022/rendering/toolbar/tools/filter-tool-wrapper.component.mjs +29 -8
- package/esm2022/rendering/toolbar/tools/filter-toolbar-tool.component.mjs +78 -8
- package/esm2022/rendering/toolbar/tools/group-command-tool.directive.mjs +206 -0
- package/esm2022/rendering/toolbar/tools/group-toolbar-tool.component.mjs +425 -0
- package/esm2022/rendering/toolbar/tools/sort-command-tool.directive.mjs +54 -20
- package/esm2022/rendering/toolbar/tools/sort-toolbar-tool.component.mjs +24 -8
- package/esm2022/selection/selection.service.mjs +11 -0
- package/esm2022/state-management/grid-state.models.mjs +26 -0
- package/esm2022/state-management/redo-command-tool.mjs +66 -0
- package/esm2022/state-management/undo-command-tool.mjs +66 -0
- package/esm2022/state-management/undo-redo.directive.mjs +178 -0
- package/esm2022/state-management/undo-redo.service.mjs +22 -0
- package/esm2022/state-management/undo-redo.stack.mjs +232 -0
- package/esm2022/utils.mjs +13 -13
- package/excel/excel-command-tool.directive.d.ts +5 -5
- package/fesm2022/progress-kendo-angular-grid.mjs +7384 -3773
- package/filtering/filter-input.directive.d.ts +1 -0
- package/filtering/menu/date-filter-menu-input.component.d.ts +1 -1
- package/filtering/menu/filter-menu-container.component.d.ts +15 -4
- package/filtering/menu/filter-menu-input-wrapper.component.d.ts +8 -3
- package/filtering/menu/filter-menu.component.d.ts +6 -3
- package/filtering/menu/numeric-filter-menu-input.component.d.ts +1 -1
- package/filtering/menu/string-filter-menu-input.component.d.ts +1 -1
- package/filtering/menu/string-filter-menu.component.d.ts +1 -0
- package/grid.component.d.ts +86 -33
- package/grid.module.d.ts +108 -100
- package/index.d.ts +10 -1
- package/localization/messages.d.ts +86 -2
- package/navigation/toolbar-tool-name.d.ts +17 -0
- package/package.json +36 -20
- package/pdf/pdf-command-tool.directive.d.ts +6 -5
- package/rendering/cell.component.d.ts +1 -1
- package/{column-menu → rendering/toolbar/tools}/column-chooser-tool.directive.d.ts +18 -6
- package/rendering/toolbar/tools/filter-command-tool.directive.d.ts +10 -1
- package/rendering/toolbar/tools/filter-tool-wrapper.component.d.ts +6 -5
- package/rendering/toolbar/tools/filter-toolbar-tool.component.d.ts +11 -2
- package/rendering/toolbar/tools/group-command-tool.directive.d.ts +51 -0
- package/rendering/toolbar/tools/group-toolbar-tool.component.d.ts +61 -0
- package/rendering/toolbar/tools/sort-command-tool.directive.d.ts +10 -1
- package/rendering/toolbar/tools/sort-toolbar-tool.component.d.ts +5 -1
- package/schematics/ngAdd/index.js +4 -4
- package/selection/selection.service.d.ts +1 -0
- package/state-management/grid-state.models.d.ts +58 -0
- package/state-management/redo-command-tool.d.ts +38 -0
- package/state-management/undo-command-tool.d.ts +38 -0
- package/state-management/undo-redo.directive.d.ts +51 -0
- package/state-management/undo-redo.service.d.ts +19 -0
- package/state-management/undo-redo.stack.d.ts +104 -0
- package/utils.d.ts +11 -5
- package/esm2022/column-menu/column-chooser-tool.directive.mjs +0 -172
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2025 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
|
+
* Represents a node in the undo-redo linked list.
|
|
8
|
+
*/
|
|
9
|
+
export interface UndoRedoNode<T> {
|
|
10
|
+
/** The state data stored in the node */
|
|
11
|
+
state: T;
|
|
12
|
+
/** Reference to the previous node (the previous state) */
|
|
13
|
+
previous: UndoRedoNode<T> | null;
|
|
14
|
+
/** Reference to the next node (the next state) */
|
|
15
|
+
next: UndoRedoNode<T> | null;
|
|
16
|
+
/** Optional identifier for the node */
|
|
17
|
+
id?: string | number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @hidden
|
|
21
|
+
* A linked-list based implementation of an undo-redo stack.
|
|
22
|
+
* Maintains a chain of states that can be navigated forward and backward.
|
|
23
|
+
*/
|
|
24
|
+
export declare class UndoRedoStack<T> {
|
|
25
|
+
private maxSize;
|
|
26
|
+
/** The current active node in the undo-redo history */
|
|
27
|
+
private currentNode;
|
|
28
|
+
/** The root node of the stack (first state) */
|
|
29
|
+
private rootNode;
|
|
30
|
+
/** Track the size of the stack */
|
|
31
|
+
private _size;
|
|
32
|
+
/**
|
|
33
|
+
* Creates a new UndoRedoStack.
|
|
34
|
+
* @param maxSize Optional maximum number of states to maintain (unlimited if not provided)
|
|
35
|
+
*/
|
|
36
|
+
constructor(maxSize?: number);
|
|
37
|
+
/**
|
|
38
|
+
* Gets the current number of states in the stack
|
|
39
|
+
*/
|
|
40
|
+
get size(): number;
|
|
41
|
+
/**
|
|
42
|
+
* Gets the current active state
|
|
43
|
+
*/
|
|
44
|
+
get current(): T | null;
|
|
45
|
+
/**
|
|
46
|
+
* Checks if undo is available (if there's a previous state)
|
|
47
|
+
*/
|
|
48
|
+
get canUndo(): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Checks if redo is available (if there's a next state)
|
|
51
|
+
*/
|
|
52
|
+
get canRedo(): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Adds a new state to the undo-redo stack
|
|
55
|
+
* @param state The state to add
|
|
56
|
+
* @param id Optional identifier for the state
|
|
57
|
+
* @returns The newly created node
|
|
58
|
+
*/
|
|
59
|
+
add(state: T, id?: string | number): UndoRedoNode<T>;
|
|
60
|
+
/**
|
|
61
|
+
* Finds a node by its identifier
|
|
62
|
+
* @param id The identifier to search for
|
|
63
|
+
* @returns The found node or null if not found
|
|
64
|
+
*/
|
|
65
|
+
find(id: string | number): UndoRedoNode<T> | null;
|
|
66
|
+
/**
|
|
67
|
+
* Removes a node by its identifier
|
|
68
|
+
* @param id The identifier of the node to remove
|
|
69
|
+
* @returns True if the node was found and removed, false otherwise
|
|
70
|
+
*/
|
|
71
|
+
remove(id: string | number): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Performs an undo operation, moving to the previous state
|
|
74
|
+
* @returns The previous state or null if can't undo
|
|
75
|
+
*/
|
|
76
|
+
undo(): T | null;
|
|
77
|
+
/**
|
|
78
|
+
* Performs a redo operation, moving to the next state
|
|
79
|
+
* @returns The next state or null if can't redo
|
|
80
|
+
*/
|
|
81
|
+
redo(): T | null;
|
|
82
|
+
/**
|
|
83
|
+
* Clears all history
|
|
84
|
+
*/
|
|
85
|
+
clear(): void;
|
|
86
|
+
/**
|
|
87
|
+
* Removes all states after the specified node
|
|
88
|
+
* @param node The node to truncate from
|
|
89
|
+
* @returns The number of nodes removed
|
|
90
|
+
*/
|
|
91
|
+
private truncateForward;
|
|
92
|
+
/**
|
|
93
|
+
* Ensures the stack doesn't exceed the maximum size by removing oldest nodes
|
|
94
|
+
*/
|
|
95
|
+
private enforceMaxSize;
|
|
96
|
+
/**
|
|
97
|
+
* Gets all states in the stack as an array (from oldest to newest)
|
|
98
|
+
*/
|
|
99
|
+
toArray(): T[];
|
|
100
|
+
/**
|
|
101
|
+
* Gets the history nodes as an array (useful for debugging)
|
|
102
|
+
*/
|
|
103
|
+
getNodes(): UndoRedoNode<T>[];
|
|
104
|
+
}
|
package/utils.d.ts
CHANGED
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { QueryList, InjectionToken } from '@angular/core';
|
|
6
6
|
import { Observable } from 'rxjs';
|
|
7
|
-
import { ColumnBase
|
|
7
|
+
import { ColumnBase } from './columns/column-base';
|
|
8
|
+
import { RowArgs } from './rendering/common/row-args';
|
|
9
|
+
import { ColumnState } from './state-management/grid-state.models';
|
|
8
10
|
export { isChanged, anyChanged, hasObservers } from '@progress/kendo-angular-common';
|
|
9
11
|
/**
|
|
10
12
|
* @hidden
|
|
@@ -77,10 +79,6 @@ export declare const iterator: any;
|
|
|
77
79
|
export declare const requestAnimationFrame: any;
|
|
78
80
|
/** @hidden */
|
|
79
81
|
export declare const cancelAnimationFrame: any;
|
|
80
|
-
/**
|
|
81
|
-
* @hidden
|
|
82
|
-
*/
|
|
83
|
-
export declare const detectIE: () => boolean;
|
|
84
82
|
/**
|
|
85
83
|
* @hidden
|
|
86
84
|
*/
|
|
@@ -93,6 +91,14 @@ export declare const replaceMessagePlaceholder: (message: string, name: string,
|
|
|
93
91
|
* @hidden
|
|
94
92
|
*/
|
|
95
93
|
export declare const recursiveFlatMap: (item: any) => any[];
|
|
94
|
+
/**
|
|
95
|
+
* @hidden
|
|
96
|
+
*/
|
|
97
|
+
export declare const updateColumnFromState: (columnState: ColumnState, c: any) => void;
|
|
98
|
+
/**
|
|
99
|
+
* @hidden
|
|
100
|
+
*/
|
|
101
|
+
export declare const recursiveColumnsFlatMap: (item: any) => any[];
|
|
96
102
|
/**
|
|
97
103
|
* @hidden
|
|
98
104
|
*/
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2025 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, NgZone, Input, Renderer2 } from '@angular/core';
|
|
6
|
-
import { PopupService } from '@progress/kendo-angular-popup';
|
|
7
|
-
import { RefreshService, ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
|
|
8
|
-
import { ColumnListComponent } from './column-list.component';
|
|
9
|
-
import { closest, isPresent } from '@progress/kendo-angular-common';
|
|
10
|
-
import { Subscription } from 'rxjs';
|
|
11
|
-
import { columnsIcon } from '@progress/kendo-svg-icons';
|
|
12
|
-
import { ContextService } from '../common/provider.service';
|
|
13
|
-
import { filter, take } from 'rxjs/operators';
|
|
14
|
-
import * as i0 from "@angular/core";
|
|
15
|
-
import * as i1 from "@progress/kendo-angular-popup";
|
|
16
|
-
import * as i2 from "@progress/kendo-angular-toolbar";
|
|
17
|
-
import * as i3 from "../common/provider.service";
|
|
18
|
-
let incrementingId = 0;
|
|
19
|
-
/**
|
|
20
|
-
* Represents the `column-chooser` toolbar tool of the Grid.
|
|
21
|
-
* You can apply this directive to any `kendo-toolbar-button` element inside a
|
|
22
|
-
* ToolbarComponent used in the Grid.
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```html-no-run
|
|
26
|
-
* <kendo-grid>
|
|
27
|
-
* <kendo-toolbar>
|
|
28
|
-
* <kendo-toolbar-button kendoGridColumnChooserTool></kendo-toolbar-button>
|
|
29
|
-
* </kendo-toolbar>
|
|
30
|
-
* </kendo-grid>
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
export class ColumnChooserToolbarDirective {
|
|
34
|
-
renderer;
|
|
35
|
-
popupSerivce;
|
|
36
|
-
host;
|
|
37
|
-
ctx;
|
|
38
|
-
zone;
|
|
39
|
-
refresh;
|
|
40
|
-
/**
|
|
41
|
-
* Specifies if the changes in the visibility of the column will be immediately applied.
|
|
42
|
-
*
|
|
43
|
-
* @default false
|
|
44
|
-
*/
|
|
45
|
-
autoSync = false;
|
|
46
|
-
/**
|
|
47
|
-
* Specifies if all columns can be hidden.
|
|
48
|
-
*
|
|
49
|
-
* @default true
|
|
50
|
-
*/
|
|
51
|
-
allowHideAll = true;
|
|
52
|
-
popupRef;
|
|
53
|
-
subs = new Subscription();
|
|
54
|
-
nextId = incrementingId++;
|
|
55
|
-
constructor(renderer, popupSerivce, host, ctx, zone, refresh) {
|
|
56
|
-
this.renderer = renderer;
|
|
57
|
-
this.popupSerivce = popupSerivce;
|
|
58
|
-
this.host = host;
|
|
59
|
-
this.ctx = ctx;
|
|
60
|
-
this.zone = zone;
|
|
61
|
-
this.refresh = refresh;
|
|
62
|
-
}
|
|
63
|
-
ngOnInit() {
|
|
64
|
-
this.subs.add(this.host.click.subscribe(e => this.onClick(e)));
|
|
65
|
-
const hasToolbarIcon = isPresent(this.host.toolbarOptions.icon) && this.host.toolbarOptions.icon !== '';
|
|
66
|
-
const hasOverflowIcon = isPresent(this.host.overflowOptions.icon) && this.host.overflowOptions.icon !== '';
|
|
67
|
-
const hasIcon = hasToolbarIcon && hasOverflowIcon;
|
|
68
|
-
const hasSvgIcon = isPresent(this.host.toolbarOptions.svgIcon) && isPresent(this.host.overflowOptions.svgIcon);
|
|
69
|
-
if (!hasIcon) {
|
|
70
|
-
this.host.icon = 'columns';
|
|
71
|
-
}
|
|
72
|
-
if (!hasSvgIcon) {
|
|
73
|
-
this.host.svgIcon = columnsIcon;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
ngAfterViewInit() {
|
|
77
|
-
const hasText = isPresent(this.host.text);
|
|
78
|
-
if (!hasText) {
|
|
79
|
-
this.zone.onStable.pipe(take(1)).subscribe(() => {
|
|
80
|
-
this.host.text = this.ctx.localization.get(`columns`);
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
this.host.toolbarButtonElement.nativeElement.setAttribute('aria-haspopup', 'dialog');
|
|
84
|
-
this.host.toolbarButtonElement.nativeElement.setAttribute('aria-expanded', 'false');
|
|
85
|
-
this.host.toolbarButtonElement.nativeElement.setAttribute('title', this.ctx.localization.get('columns'));
|
|
86
|
-
this.subs.add(this.refresh.onRefresh.pipe(filter((tool) => tool === this.host)).subscribe((tool) => {
|
|
87
|
-
if (tool.overflows && this.popupRef) {
|
|
88
|
-
this.popupRef.close();
|
|
89
|
-
}
|
|
90
|
-
}));
|
|
91
|
-
}
|
|
92
|
-
ngOnDestroy() {
|
|
93
|
-
this.subs.unsubscribe();
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* @hidden
|
|
97
|
-
*/
|
|
98
|
-
onClick(e) {
|
|
99
|
-
e.preventDefault();
|
|
100
|
-
if (!this.popupRef) {
|
|
101
|
-
if (!this.host.overflows) {
|
|
102
|
-
const direction = this.ctx.localization.rtl ? 'right' : 'left';
|
|
103
|
-
this.popupRef = this.popupSerivce.open({
|
|
104
|
-
anchor: this.host.toolbarButtonElement,
|
|
105
|
-
content: ColumnListComponent,
|
|
106
|
-
positionMode: 'absolute',
|
|
107
|
-
anchorAlign: { vertical: 'bottom', horizontal: direction },
|
|
108
|
-
popupAlign: { vertical: 'top', horizontal: direction }
|
|
109
|
-
});
|
|
110
|
-
const popupElement = this.popupRef.popupElement;
|
|
111
|
-
const popupId = `k-column-chooser-tool-${this.nextId}-popup`;
|
|
112
|
-
const popupAriaElement = popupElement.querySelector('.k-popup');
|
|
113
|
-
this.zone.runOutsideAngular(() => {
|
|
114
|
-
this.renderer.listen(popupAriaElement, 'keydown', (e) => {
|
|
115
|
-
if (e.key === 'Escape') {
|
|
116
|
-
this.closePopup(true);
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
this.renderer.setAttribute(popupElement, 'dir', this.ctx.localization.rtl ? 'rtl' : 'ltr');
|
|
121
|
-
this.renderer.setAttribute(popupAriaElement, 'id', popupId);
|
|
122
|
-
this.renderer.setAttribute(popupAriaElement, 'role', 'dialog');
|
|
123
|
-
this.host.toolbarButtonElement.nativeElement.setAttribute('aria-expanded', 'true');
|
|
124
|
-
this.host.toolbarButtonElement.nativeElement.setAttribute('aria-controls', popupId);
|
|
125
|
-
const columnList = this.popupRef.content.instance;
|
|
126
|
-
columnList.isLast = true;
|
|
127
|
-
columnList.autoSync = this.autoSync;
|
|
128
|
-
columnList.allowHideAll = this.allowHideAll;
|
|
129
|
-
columnList.applyText = this.ctx.localization.get('columnsApply');
|
|
130
|
-
columnList.resetText = this.ctx.localization.get('columnsReset');
|
|
131
|
-
columnList.columns = this.ctx.grid.columns;
|
|
132
|
-
columnList.ariaLabel = this.ctx.localization.get('columns');
|
|
133
|
-
this.subs.add(this.popupRef.popup.instance.anchorViewportLeave.subscribe(() => {
|
|
134
|
-
this.closePopup(true);
|
|
135
|
-
}));
|
|
136
|
-
this.subs.add(columnList.apply.subscribe(() => {
|
|
137
|
-
this.closePopup();
|
|
138
|
-
}));
|
|
139
|
-
this.zone.runOutsideAngular(() => this.renderer.listen('document', 'click', ({ target }) => {
|
|
140
|
-
if (this.popupRef && !closest(target, node => node === this.popupRef.popupElement || node === this.host.toolbarButtonElement.nativeElement)) {
|
|
141
|
-
this.zone.run(() => {
|
|
142
|
-
this.closePopup();
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
}));
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
this.closePopup();
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
closePopup(focusAnchor = false) {
|
|
153
|
-
this.popupRef.close();
|
|
154
|
-
this.popupRef = null;
|
|
155
|
-
this.host.toolbarButtonElement.nativeElement.setAttribute('aria-expanded', 'false');
|
|
156
|
-
this.host.toolbarButtonElement.nativeElement.removeAttribute('aria-controls');
|
|
157
|
-
focusAnchor && this.host.toolbarButtonElement.nativeElement.focus();
|
|
158
|
-
}
|
|
159
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColumnChooserToolbarDirective, deps: [{ token: i0.Renderer2 }, { token: i1.PopupService }, { token: i2.ToolBarButtonComponent }, { token: i3.ContextService }, { token: i0.NgZone }, { token: i2.RefreshService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
160
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: ColumnChooserToolbarDirective, isStandalone: true, selector: "[kendoGridColumnChooserTool]", inputs: { autoSync: "autoSync", allowHideAll: "allowHideAll" }, ngImport: i0 });
|
|
161
|
-
}
|
|
162
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColumnChooserToolbarDirective, decorators: [{
|
|
163
|
-
type: Directive,
|
|
164
|
-
args: [{
|
|
165
|
-
selector: '[kendoGridColumnChooserTool]',
|
|
166
|
-
standalone: true
|
|
167
|
-
}]
|
|
168
|
-
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i1.PopupService }, { type: i2.ToolBarButtonComponent }, { type: i3.ContextService }, { type: i0.NgZone }, { type: i2.RefreshService }]; }, propDecorators: { autoSync: [{
|
|
169
|
-
type: Input
|
|
170
|
-
}], allowHideAll: [{
|
|
171
|
-
type: Input
|
|
172
|
-
}] } });
|