@progress/kendo-angular-grid 19.0.0-develop.3 → 19.0.0-develop.31
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 +84 -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 +12 -5
- package/dragdrop/drag-hint.service.d.ts +3 -2
- 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 +1108 -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 +18 -3
- package/esm2022/dragdrop/drag-hint.service.mjs +7 -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/form/form-formfield.component.mjs +1 -1
- 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/cell/autocomplete-filter-cell.component.mjs +1 -1
- package/esm2022/filtering/cell/boolean-filter-cell.component.mjs +1 -1
- package/esm2022/filtering/cell/date-filter-cell.component.mjs +1 -1
- package/esm2022/filtering/cell/filter-cell-operators.component.mjs +1 -1
- 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 +5 -1
- package/esm2022/filtering/menu/date-filter-menu.component.mjs +7 -1
- package/esm2022/filtering/menu/filter-menu-container.component.mjs +21 -10
- package/esm2022/filtering/menu/filter-menu-input-wrapper.component.mjs +27 -5
- 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 +7 -1
- package/esm2022/filtering/menu/string-filter-menu-input.component.mjs +2 -0
- package/esm2022/filtering/menu/string-filter-menu.component.mjs +11 -2
- package/esm2022/grid.component.mjs +358 -82
- package/esm2022/grid.module.mjs +114 -101
- package/esm2022/index.mjs +10 -1
- package/esm2022/localization/messages.mjs +104 -2
- package/esm2022/navigation/navigation.service.mjs +1 -1
- 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 +4 -4
- package/esm2022/rendering/header/header.component.mjs +1 -1
- package/esm2022/rendering/list.component.mjs +1 -1
- package/esm2022/rendering/table-body.component.mjs +11 -3
- package/esm2022/rendering/toolbar/tools/column-chooser-tool.directive.mjs +203 -0
- package/esm2022/rendering/toolbar/tools/filter-command-tool.directive.mjs +61 -34
- package/esm2022/rendering/toolbar/tools/filter-tool-wrapper.component.mjs +29 -8
- package/esm2022/rendering/toolbar/tools/filter-toolbar-tool.component.mjs +73 -8
- package/esm2022/rendering/toolbar/tools/sort-command-tool.directive.mjs +46 -20
- package/esm2022/rendering/toolbar/tools/sort-toolbar-tool.component.mjs +24 -8
- package/esm2022/row-reordering/row-reorder.service.mjs +15 -0
- 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 +4672 -1798
- 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 +14 -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 +107 -100
- package/index.d.ts +9 -1
- package/localization/messages.d.ts +70 -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 +17 -6
- package/rendering/toolbar/tools/filter-command-tool.directive.d.ts +9 -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/sort-command-tool.directive.d.ts +9 -1
- package/rendering/toolbar/tools/sort-toolbar-tool.component.d.ts +5 -1
- package/row-reordering/row-reorder.service.d.ts +2 -0
- 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
|
@@ -2,14 +2,16 @@
|
|
|
2
2
|
* Copyright © 2025 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 } from '@angular/core';
|
|
5
|
+
import { ChangeDetectorRef, Directive, NgZone } from '@angular/core';
|
|
6
6
|
import { PDFService } from './pdf.service';
|
|
7
7
|
import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { ContextService } from '../common/provider.service';
|
|
9
|
+
import { ToolbarToolBase } from '../common/toolbar-tool-base.directive';
|
|
10
|
+
import { ToolbarToolName } from '../navigation/toolbar-tool-name';
|
|
10
11
|
import * as i0 from "@angular/core";
|
|
11
12
|
import * as i1 from "./pdf.service";
|
|
12
13
|
import * as i2 from "@progress/kendo-angular-toolbar";
|
|
14
|
+
import * as i3 from "../common/provider.service";
|
|
13
15
|
/**
|
|
14
16
|
* Represents the `export-to-PDF` toolbar tool of the Grid.
|
|
15
17
|
* You can apply this directive to any `kendo-toolbar-button` element inside a
|
|
@@ -30,22 +32,17 @@ import * as i2 from "@progress/kendo-angular-toolbar";
|
|
|
30
32
|
* </kendo-grid>
|
|
31
33
|
* ```
|
|
32
34
|
*/
|
|
33
|
-
export class PDFCommandToolbarDirective {
|
|
35
|
+
export class PDFCommandToolbarDirective extends ToolbarToolBase {
|
|
34
36
|
pdfService;
|
|
35
37
|
host;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
constructor(pdfService, host, ctx, zone, cdr) {
|
|
39
|
+
super(host, ToolbarToolName.pdfExport, ctx, zone, cdr);
|
|
38
40
|
this.pdfService = pdfService;
|
|
39
41
|
this.host = host;
|
|
40
42
|
}
|
|
41
43
|
ngOnInit() {
|
|
42
|
-
|
|
44
|
+
super.ngOnInit();
|
|
43
45
|
this.host.className = 'k-grid-pdf';
|
|
44
|
-
this.host.svgIcon = filePdfIcon;
|
|
45
|
-
this.host.icon = 'file-pdf';
|
|
46
|
-
}
|
|
47
|
-
ngOnDestroy() {
|
|
48
|
-
this.clickSub.unsubscribe();
|
|
49
46
|
}
|
|
50
47
|
/**
|
|
51
48
|
* @hidden
|
|
@@ -54,8 +51,8 @@ export class PDFCommandToolbarDirective {
|
|
|
54
51
|
e.preventDefault();
|
|
55
52
|
this.pdfService.exportClick.emit();
|
|
56
53
|
}
|
|
57
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFCommandToolbarDirective, deps: [{ token: i1.PDFService }, { token: i2.ToolBarButtonComponent }], target: i0.ɵɵFactoryTarget.Directive });
|
|
58
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: PDFCommandToolbarDirective, isStandalone: true, selector: "[kendoGridPDFTool]", ngImport: i0 });
|
|
54
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFCommandToolbarDirective, deps: [{ token: i1.PDFService }, { token: i2.ToolBarButtonComponent }, { token: i3.ContextService }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
55
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: PDFCommandToolbarDirective, isStandalone: true, selector: "[kendoGridPDFTool]", usesInheritance: true, ngImport: i0 });
|
|
59
56
|
}
|
|
60
57
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFCommandToolbarDirective, decorators: [{
|
|
61
58
|
type: Directive,
|
|
@@ -63,4 +60,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
63
60
|
selector: '[kendoGridPDFTool]',
|
|
64
61
|
standalone: true
|
|
65
62
|
}]
|
|
66
|
-
}], ctorParameters: function () { return [{ type: i1.PDFService }, { type: i2.ToolBarButtonComponent }]; } });
|
|
63
|
+
}], ctorParameters: function () { return [{ type: i1.PDFService }, { type: i2.ToolBarButtonComponent }, { type: i3.ContextService }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }]; } });
|
|
@@ -110,7 +110,7 @@ export class CellComponent {
|
|
|
110
110
|
get isSpanColumn() {
|
|
111
111
|
return isSpanColumn(this.column) && !this.column.templateRef;
|
|
112
112
|
}
|
|
113
|
-
get
|
|
113
|
+
get children() {
|
|
114
114
|
return columnsToRender([this.column]);
|
|
115
115
|
}
|
|
116
116
|
get isRowReorderColumn() {
|
|
@@ -183,7 +183,7 @@ export class CellComponent {
|
|
|
183
183
|
[ngTemplateOutletContext]="templateContext">
|
|
184
184
|
</ng-template>
|
|
185
185
|
<ng-container *ngIf="isSpanColumn">
|
|
186
|
-
<ng-container *ngFor="let childColumn of
|
|
186
|
+
<ng-container *ngFor="let childColumn of children">
|
|
187
187
|
{{ dataItem | valueOf: childColumn.field: childColumn.format}}
|
|
188
188
|
</ng-container>
|
|
189
189
|
</ng-container>
|
|
@@ -260,7 +260,7 @@ export class CellComponent {
|
|
|
260
260
|
</ng-container>
|
|
261
261
|
</ng-container>
|
|
262
262
|
</ng-container>
|
|
263
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: FocusableDirective, selector: "[kendoGridFocusable],\n [kendoGridEditCommand],\n [kendoGridRemoveCommand],\n [kendoGridSaveCommand],\n [kendoGridCancelCommand],\n [kendoGridSelectionCheckbox]\n ", inputs: ["kendoGridFocusable"] }, { kind: "directive", type: SelectionCheckboxDirective, selector: "[kendoGridSelectionCheckbox]", inputs: ["kendoGridSelectionCheckbox"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "component", type: NumericTextBoxComponent, selector: "kendo-numerictextbox", inputs: ["focusableId", "disabled", "readonly", "title", "autoCorrect", "format", "max", "min", "decimals", "placeholder", "step", "spinners", "rangeValidation", "tabindex", "tabIndex", "changeValueOnScroll", "selectOnFocus", "value", "maxlength", "size", "rounded", "fillMode", "inputAttributes"], outputs: ["valueChange", "focus", "blur", "inputFocus", "inputBlur"], exportAs: ["kendoNumericTextBox"] }, { kind: "component", type: DatePickerComponent, selector: "kendo-datepicker", inputs: ["focusableId", "cellTemplate", "clearButton", "inputAttributes", "monthCellTemplate", "yearCellTemplate", "decadeCellTemplate", "centuryCellTemplate", "weekNumberTemplate", "headerTitleTemplate", "headerTemplate", "footerTemplate", "footer", "navigationItemTemplate", "weekDaysFormat", "showOtherMonthDays", "activeView", "bottomView", "topView", "calendarType", "animateCalendarNavigation", "disabled", "readonly", "readOnlyInput", "popupSettings", "navigation", "min", "max", "incompleteDateValidation", "autoCorrectParts", "autoSwitchParts", "autoSwitchKeys", "enableMouseWheel", "allowCaretMode", "autoFill", "focusedDate", "value", "format", "twoDigitYearMax", "formatPlaceholder", "placeholder", "tabindex", "tabIndex", "disabledDates", "
|
|
263
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: FocusableDirective, selector: "[kendoGridFocusable],\n [kendoGridEditCommand],\n [kendoGridRemoveCommand],\n [kendoGridSaveCommand],\n [kendoGridCancelCommand],\n [kendoGridSelectionCheckbox]\n ", inputs: ["kendoGridFocusable"] }, { kind: "directive", type: SelectionCheckboxDirective, selector: "[kendoGridSelectionCheckbox]", inputs: ["kendoGridSelectionCheckbox"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "component", type: NumericTextBoxComponent, selector: "kendo-numerictextbox", inputs: ["focusableId", "disabled", "readonly", "title", "autoCorrect", "format", "max", "min", "decimals", "placeholder", "step", "spinners", "rangeValidation", "tabindex", "tabIndex", "changeValueOnScroll", "selectOnFocus", "value", "maxlength", "size", "rounded", "fillMode", "inputAttributes"], outputs: ["valueChange", "focus", "blur", "inputFocus", "inputBlur"], exportAs: ["kendoNumericTextBox"] }, { kind: "component", type: DatePickerComponent, selector: "kendo-datepicker", inputs: ["focusableId", "cellTemplate", "clearButton", "inputAttributes", "monthCellTemplate", "yearCellTemplate", "decadeCellTemplate", "centuryCellTemplate", "weekNumberTemplate", "headerTitleTemplate", "headerTemplate", "footerTemplate", "footer", "navigationItemTemplate", "weekDaysFormat", "showOtherMonthDays", "activeView", "bottomView", "topView", "calendarType", "animateCalendarNavigation", "disabled", "readonly", "readOnlyInput", "popupSettings", "navigation", "min", "max", "incompleteDateValidation", "autoCorrectParts", "autoSwitchParts", "autoSwitchKeys", "enableMouseWheel", "allowCaretMode", "autoFill", "focusedDate", "value", "format", "twoDigitYearMax", "formatPlaceholder", "placeholder", "tabindex", "tabIndex", "disabledDates", "adaptiveTitle", "adaptiveSubtitle", "rangeValidation", "disabledDatesValidation", "weekNumber", "size", "rounded", "fillMode", "adaptiveMode"], outputs: ["valueChange", "focus", "blur", "open", "close", "escape"], exportAs: ["kendo-datepicker"] }, { kind: "directive", type: NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "pipe", type: FieldAccessorPipe, name: "valueOf" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: CheckBoxComponent, selector: "kendo-checkbox", inputs: ["checkedState", "rounded"], outputs: ["checkedStateChange"], exportAs: ["kendoCheckBox"] }, { kind: "component", type: TextBoxComponent, selector: "kendo-textbox", inputs: ["focusableId", "title", "type", "disabled", "readonly", "tabindex", "value", "selectOnFocus", "showSuccessIcon", "showErrorIcon", "clearButton", "successIcon", "successSvgIcon", "errorIcon", "errorSvgIcon", "clearButtonIcon", "clearButtonSvgIcon", "size", "rounded", "fillMode", "tabIndex", "placeholder", "maxlength", "inputAttributes"], outputs: ["valueChange", "inputFocus", "inputBlur", "focus", "blur"], exportAs: ["kendoTextBox"] }] });
|
|
264
264
|
}
|
|
265
265
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CellComponent, decorators: [{
|
|
266
266
|
type: Component,
|
|
@@ -275,7 +275,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
275
275
|
[ngTemplateOutletContext]="templateContext">
|
|
276
276
|
</ng-template>
|
|
277
277
|
<ng-container *ngIf="isSpanColumn">
|
|
278
|
-
<ng-container *ngFor="let childColumn of
|
|
278
|
+
<ng-container *ngFor="let childColumn of children">
|
|
279
279
|
{{ dataItem | valueOf: childColumn.field: childColumn.format}}
|
|
280
280
|
</ng-container>
|
|
281
281
|
</ng-container>
|
|
@@ -433,7 +433,7 @@ export class HeaderComponent {
|
|
|
433
433
|
const arr = this.dropTargets.toArray();
|
|
434
434
|
const firstSpan = arr.find(t => t.context.column.parent === parent);
|
|
435
435
|
const index = arr.indexOf(firstSpan);
|
|
436
|
-
const adjust = e.before ? 0 : parent.
|
|
436
|
+
const adjust = e.before ? 0 : parent.children.length - 1;
|
|
437
437
|
target = arr[index + adjust];
|
|
438
438
|
}
|
|
439
439
|
return mergeObjects(e, { target });
|
|
@@ -616,7 +616,7 @@ export class ListComponent {
|
|
|
616
616
|
for (let idx = 0; idx < leafColumns.length; idx++) {
|
|
617
617
|
const column = leafColumns[idx];
|
|
618
618
|
if (column.isSpanColumn) {
|
|
619
|
-
viewportEnd += column.
|
|
619
|
+
viewportEnd += column.children.length;
|
|
620
620
|
}
|
|
621
621
|
}
|
|
622
622
|
this.navigationService.setColumnViewport(viewportStart, viewportEnd);
|
|
@@ -348,7 +348,7 @@ export class TableBodyComponent {
|
|
|
348
348
|
}
|
|
349
349
|
get footerColumns() {
|
|
350
350
|
const colsToRender = Array.from(this.columns).reduce((cols, col) => {
|
|
351
|
-
const newCols = (col instanceof SpanColumnComponent) ? Array.from(col.
|
|
351
|
+
const newCols = (col instanceof SpanColumnComponent) ? Array.from(col.children) : [col];
|
|
352
352
|
return [...cols, ...newCols];
|
|
353
353
|
}, []);
|
|
354
354
|
return colsToRender;
|
|
@@ -369,6 +369,15 @@ export class TableBodyComponent {
|
|
|
369
369
|
clickHandler(eventArg) {
|
|
370
370
|
const element = this.element.nativeElement;
|
|
371
371
|
const target = this.eventTarget(eventArg);
|
|
372
|
+
const selectionEnabled = this.selectable && this.selectable.enabled !== false;
|
|
373
|
+
if (eventArg.keyCode === Keys.Space) {
|
|
374
|
+
if (!selectionEnabled) {
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
if (!this.editService.isEditing()) {
|
|
378
|
+
eventArg.preventDefault();
|
|
379
|
+
}
|
|
380
|
+
}
|
|
372
381
|
let cell, row, body, gridElement;
|
|
373
382
|
let currentTarget = target;
|
|
374
383
|
do {
|
|
@@ -386,7 +395,6 @@ export class TableBodyComponent {
|
|
|
386
395
|
if (!focusable && !matchesNodeName('label')(target) && !hasClasses(target, IGNORE_TARGET_CLASSSES) &&
|
|
387
396
|
!closestInScope(target, matchesClasses(IGNORE_CONTAINER_CLASSES), cell)) {
|
|
388
397
|
const args = this.cellClickArgs(cell, row, eventArg);
|
|
389
|
-
const selectionEnabled = this.selectable && this.selectable.enabled !== false;
|
|
390
398
|
if (selectionEnabled && !this.isRowSelectable({ index: args.rowIndex, dataItem: args.dataItem })) {
|
|
391
399
|
return;
|
|
392
400
|
}
|
|
@@ -417,7 +425,7 @@ export class TableBodyComponent {
|
|
|
417
425
|
}));
|
|
418
426
|
}
|
|
419
427
|
cellKeydownHandler(args) {
|
|
420
|
-
if (args.keyCode === Keys.Enter) {
|
|
428
|
+
if (args.keyCode === Keys.Enter || args.keyCode === Keys.Space) {
|
|
421
429
|
this.clickHandler(args);
|
|
422
430
|
}
|
|
423
431
|
}
|
|
@@ -0,0 +1,203 @@
|
|
|
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, ChangeDetectorRef } 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-menu/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 { AdaptiveGridService } from '../../../common/adaptiveness.service';
|
|
15
|
+
import { ColumnInfoService } from '../../../common/column-info.service';
|
|
16
|
+
import { ToolbarToolBase } from '../../../common/toolbar-tool-base.directive';
|
|
17
|
+
import { ToolbarToolName } from '../../../navigation/toolbar-tool-name';
|
|
18
|
+
import * as i0 from "@angular/core";
|
|
19
|
+
import * as i1 from "@progress/kendo-angular-popup";
|
|
20
|
+
import * as i2 from "@progress/kendo-angular-toolbar";
|
|
21
|
+
import * as i3 from "../../../common/provider.service";
|
|
22
|
+
import * as i4 from "../../../common/adaptiveness.service";
|
|
23
|
+
import * as i5 from "../../../common/column-info.service";
|
|
24
|
+
let incrementingId = 0;
|
|
25
|
+
/**
|
|
26
|
+
* Represents the `column-chooser` toolbar tool of the Grid.
|
|
27
|
+
* You can apply this directive to any `kendo-toolbar-button` element inside a
|
|
28
|
+
* ToolbarComponent used in the Grid.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```html-no-run
|
|
32
|
+
* <kendo-grid>
|
|
33
|
+
* <kendo-toolbar>
|
|
34
|
+
* <kendo-toolbar-button kendoGridColumnChooserTool></kendo-toolbar-button>
|
|
35
|
+
* </kendo-toolbar>
|
|
36
|
+
* </kendo-grid>
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export class ColumnChooserToolbarDirective extends ToolbarToolBase {
|
|
40
|
+
renderer;
|
|
41
|
+
popupSerivce;
|
|
42
|
+
host;
|
|
43
|
+
ctx;
|
|
44
|
+
zone;
|
|
45
|
+
refresh;
|
|
46
|
+
adaptiveGridService;
|
|
47
|
+
columnInfoService;
|
|
48
|
+
/**
|
|
49
|
+
* Specifies if the changes in the visibility of the column will be immediately applied.
|
|
50
|
+
*
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
autoSync = false;
|
|
54
|
+
/**
|
|
55
|
+
* Specifies if all columns can be hidden.
|
|
56
|
+
*
|
|
57
|
+
* @default true
|
|
58
|
+
*/
|
|
59
|
+
allowHideAll = true;
|
|
60
|
+
/**
|
|
61
|
+
* @hidden
|
|
62
|
+
*/
|
|
63
|
+
get columns() {
|
|
64
|
+
return this.columnInfoService.leafNamedColumns;
|
|
65
|
+
}
|
|
66
|
+
popupRef;
|
|
67
|
+
subs = new Subscription();
|
|
68
|
+
nextId = incrementingId++;
|
|
69
|
+
constructor(renderer, popupSerivce, host, ctx, zone, refresh, adaptiveGridService, columnInfoService, cdr) {
|
|
70
|
+
super(host, ToolbarToolName.columns, ctx, zone, cdr);
|
|
71
|
+
this.renderer = renderer;
|
|
72
|
+
this.popupSerivce = popupSerivce;
|
|
73
|
+
this.host = host;
|
|
74
|
+
this.ctx = ctx;
|
|
75
|
+
this.zone = zone;
|
|
76
|
+
this.refresh = refresh;
|
|
77
|
+
this.adaptiveGridService = adaptiveGridService;
|
|
78
|
+
this.columnInfoService = columnInfoService;
|
|
79
|
+
}
|
|
80
|
+
ngOnInit() {
|
|
81
|
+
this.subs.add(this.host.click.subscribe(e => this.onClick(e)));
|
|
82
|
+
const hasToolbarIcon = isPresent(this.host.toolbarOptions.icon) && this.host.toolbarOptions.icon !== '';
|
|
83
|
+
const hasOverflowIcon = isPresent(this.host.overflowOptions.icon) && this.host.overflowOptions.icon !== '';
|
|
84
|
+
const hasIcon = hasToolbarIcon && hasOverflowIcon;
|
|
85
|
+
const hasSvgIcon = isPresent(this.host.toolbarOptions.svgIcon) && isPresent(this.host.overflowOptions.svgIcon);
|
|
86
|
+
if (!hasIcon) {
|
|
87
|
+
this.host.icon = 'columns';
|
|
88
|
+
}
|
|
89
|
+
if (!hasSvgIcon) {
|
|
90
|
+
this.host.svgIcon = columnsIcon;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
ngAfterViewInit() {
|
|
94
|
+
super.ngAfterViewInit();
|
|
95
|
+
this.zone.onStable.pipe(take(1)).subscribe(() => {
|
|
96
|
+
this.buttonElement?.setAttribute('aria-haspopup', 'dialog');
|
|
97
|
+
this.buttonElement?.setAttribute('aria-expanded', 'false');
|
|
98
|
+
this.buttonElement?.setAttribute('title', this.ctx.localization.get('columns'));
|
|
99
|
+
});
|
|
100
|
+
this.subs.add(this.refresh.onRefresh.pipe(filter((tool) => tool === this.host)).subscribe((tool) => {
|
|
101
|
+
if (tool.overflows && this.popupRef) {
|
|
102
|
+
this.popupRef.close();
|
|
103
|
+
}
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
ngOnDestroy() {
|
|
107
|
+
super.ngOnDestroy();
|
|
108
|
+
this.subs.unsubscribe();
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* @hidden
|
|
112
|
+
*/
|
|
113
|
+
onClick(e) {
|
|
114
|
+
e.preventDefault();
|
|
115
|
+
if (this.ctx.grid.adaptiveMode === 'auto' && this.adaptiveGridService.windowSize !== 'large') {
|
|
116
|
+
if (!this.ctx.grid.isActionSheetExpanded) {
|
|
117
|
+
this.adaptiveGridService.viewType = 'columnChooserToolbarTool';
|
|
118
|
+
this.adaptiveGridService.columns = this.columns;
|
|
119
|
+
this.ctx.grid.adaptiveRenderer.actionSheet.toggle(true);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
this.togglePopup();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
togglePopup() {
|
|
127
|
+
if (!this.popupRef) {
|
|
128
|
+
const direction = this.ctx.localization.rtl ? 'right' : 'left';
|
|
129
|
+
this.popupRef = this.popupSerivce.open({
|
|
130
|
+
anchor: this.buttonElement,
|
|
131
|
+
content: ColumnListComponent,
|
|
132
|
+
positionMode: 'absolute',
|
|
133
|
+
anchorAlign: { vertical: 'bottom', horizontal: direction },
|
|
134
|
+
popupAlign: { vertical: 'top', horizontal: direction }
|
|
135
|
+
});
|
|
136
|
+
this.adaptiveGridService.popupRef = this.popupRef;
|
|
137
|
+
const popupElement = this.popupRef.popupElement;
|
|
138
|
+
const popupId = `k-column-chooser-tool-${this.nextId}-popup`;
|
|
139
|
+
const popupAriaElement = popupElement.querySelector('.k-popup');
|
|
140
|
+
this.zone.runOutsideAngular(() => {
|
|
141
|
+
this.renderer.listen(popupAriaElement, 'keydown', (e) => {
|
|
142
|
+
if (e.key === 'Escape') {
|
|
143
|
+
this.closePopup(true);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
this.renderer.setAttribute(popupElement, 'dir', this.ctx.localization.rtl ? 'rtl' : 'ltr');
|
|
148
|
+
this.renderer.setAttribute(popupAriaElement, 'id', popupId);
|
|
149
|
+
this.renderer.setAttribute(popupAriaElement, 'role', 'dialog');
|
|
150
|
+
this.buttonElement?.setAttribute('aria-expanded', 'true');
|
|
151
|
+
this.buttonElement?.setAttribute('aria-controls', popupId);
|
|
152
|
+
this.host.selected = true;
|
|
153
|
+
const columnList = this.popupRef.content.instance;
|
|
154
|
+
columnList.isLast = true;
|
|
155
|
+
columnList.autoSync = this.autoSync;
|
|
156
|
+
columnList.allowHideAll = this.allowHideAll;
|
|
157
|
+
columnList.applyText = this.ctx.localization.get('columnsApply');
|
|
158
|
+
columnList.resetText = this.ctx.localization.get('columnsReset');
|
|
159
|
+
columnList.columns = this.ctx.grid.columns;
|
|
160
|
+
columnList.ariaLabel = this.ctx.localization.get('columns');
|
|
161
|
+
this.subs.add(this.popupRef.popup.instance.anchorViewportLeave.subscribe(() => {
|
|
162
|
+
this.closePopup(true);
|
|
163
|
+
}));
|
|
164
|
+
this.subs.add(columnList.apply.subscribe(() => {
|
|
165
|
+
this.closePopup();
|
|
166
|
+
}));
|
|
167
|
+
this.zone.runOutsideAngular(() => this.renderer.listen('document', 'click', ({ target }) => {
|
|
168
|
+
if (this.popupRef && !closest(target, node => node === this.popupRef.popupElement || node === this.buttonElement)) {
|
|
169
|
+
this.zone.run(() => {
|
|
170
|
+
this.closePopup();
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}));
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
this.closePopup();
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
closePopup(focusAnchor = false) {
|
|
180
|
+
this.popupRef.close();
|
|
181
|
+
this.popupRef = null;
|
|
182
|
+
this.buttonElement?.setAttribute('aria-expanded', 'false');
|
|
183
|
+
this.buttonElement?.removeAttribute('aria-controls');
|
|
184
|
+
this.host.selected = false;
|
|
185
|
+
focusAnchor && this.buttonElement?.focus();
|
|
186
|
+
}
|
|
187
|
+
get buttonElement() {
|
|
188
|
+
return this.host.getButton();
|
|
189
|
+
}
|
|
190
|
+
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 }, { token: i4.AdaptiveGridService }, { token: i5.ColumnInfoService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
191
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: ColumnChooserToolbarDirective, isStandalone: true, selector: "[kendoGridColumnChooserTool]", inputs: { autoSync: "autoSync", allowHideAll: "allowHideAll" }, usesInheritance: true, ngImport: i0 });
|
|
192
|
+
}
|
|
193
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColumnChooserToolbarDirective, decorators: [{
|
|
194
|
+
type: Directive,
|
|
195
|
+
args: [{
|
|
196
|
+
selector: '[kendoGridColumnChooserTool]',
|
|
197
|
+
standalone: true
|
|
198
|
+
}]
|
|
199
|
+
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i1.PopupService }, { type: i2.ToolBarButtonComponent }, { type: i3.ContextService }, { type: i0.NgZone }, { type: i2.RefreshService }, { type: i4.AdaptiveGridService }, { type: i5.ColumnInfoService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { autoSync: [{
|
|
200
|
+
type: Input
|
|
201
|
+
}], allowHideAll: [{
|
|
202
|
+
type: Input
|
|
203
|
+
}] } });
|
|
@@ -13,12 +13,14 @@ import { ColumnInfoService } from '../../../common/column-info.service';
|
|
|
13
13
|
import { take } from 'rxjs/operators';
|
|
14
14
|
import { FilterService } from '../../../filtering/filter.service';
|
|
15
15
|
import { FilterToolWrapperComponent } from './filter-tool-wrapper.component';
|
|
16
|
+
import { AdaptiveGridService } from '../../../common/adaptiveness.service';
|
|
16
17
|
import * as i0 from "@angular/core";
|
|
17
18
|
import * as i1 from "@progress/kendo-angular-toolbar";
|
|
18
19
|
import * as i2 from "@progress/kendo-angular-popup";
|
|
19
20
|
import * as i3 from "../../../common/provider.service";
|
|
20
21
|
import * as i4 from "../../../filtering/filter.service";
|
|
21
22
|
import * as i5 from "../../../common/column-info.service";
|
|
23
|
+
import * as i6 from "../../../common/adaptiveness.service";
|
|
22
24
|
let incrementingId = 0;
|
|
23
25
|
/**
|
|
24
26
|
* Represents the toolbar tool for filtering columns of the Grid.
|
|
@@ -45,12 +47,19 @@ export class FilterCommandToolbarDirective {
|
|
|
45
47
|
columnInfoService;
|
|
46
48
|
ngZone;
|
|
47
49
|
renderer;
|
|
50
|
+
adaptiveGridService;
|
|
48
51
|
popupRef;
|
|
49
52
|
nextId = incrementingId++;
|
|
50
53
|
toolSubs = new Subscription();
|
|
51
54
|
popupSubs;
|
|
52
55
|
removeClickListener;
|
|
53
|
-
|
|
56
|
+
/**
|
|
57
|
+
* @hidden
|
|
58
|
+
*/
|
|
59
|
+
isFilterApplied(filter) {
|
|
60
|
+
return isPresent(filter) && filter.filters?.length > 0;
|
|
61
|
+
}
|
|
62
|
+
constructor(host, popupService, ctx, filterService, columnInfoService, ngZone, renderer, adaptiveGridService) {
|
|
54
63
|
this.host = host;
|
|
55
64
|
this.popupService = popupService;
|
|
56
65
|
this.ctx = ctx;
|
|
@@ -58,18 +67,20 @@ export class FilterCommandToolbarDirective {
|
|
|
58
67
|
this.columnInfoService = columnInfoService;
|
|
59
68
|
this.ngZone = ngZone;
|
|
60
69
|
this.renderer = renderer;
|
|
70
|
+
this.adaptiveGridService = adaptiveGridService;
|
|
61
71
|
}
|
|
62
72
|
ngOnInit() {
|
|
63
73
|
this.toolSubs = this.host.click.subscribe(e => this.onClick(e));
|
|
64
74
|
this.toolSubs.add(this.filterService.changes.subscribe(filter => {
|
|
65
|
-
this.host.showBadge =
|
|
75
|
+
this.host.showBadge = this.isFilterApplied(filter);
|
|
66
76
|
}));
|
|
77
|
+
this.host.showBadge = this.isFilterApplied(this.ctx.grid.filter);
|
|
67
78
|
const hasToolbarIcon = isPresent(this.host.toolbarOptions.icon) && this.host.toolbarOptions.icon !== '';
|
|
68
79
|
const hasOverflowIcon = isPresent(this.host.overflowOptions.icon) && this.host.overflowOptions.icon !== '';
|
|
69
80
|
const hasIcon = hasToolbarIcon && hasOverflowIcon;
|
|
70
81
|
const hasSvgIcon = isPresent(this.host.toolbarOptions.svgIcon) && isPresent(this.host.overflowOptions.svgIcon);
|
|
71
82
|
if (!hasIcon) {
|
|
72
|
-
this.host.icon = '
|
|
83
|
+
this.host.icon = 'filter';
|
|
73
84
|
}
|
|
74
85
|
if (!hasSvgIcon) {
|
|
75
86
|
this.host.svgIcon = filterIcon;
|
|
@@ -81,9 +92,9 @@ export class FilterCommandToolbarDirective {
|
|
|
81
92
|
this.host.text = this.ctx.localization.get(`filterToolbarToolText`);
|
|
82
93
|
});
|
|
83
94
|
}
|
|
84
|
-
this.
|
|
85
|
-
this.
|
|
86
|
-
this.
|
|
95
|
+
this.buttonElement?.setAttribute('aria-haspopup', 'dialog');
|
|
96
|
+
this.buttonElement?.setAttribute('aria-expanded', 'false');
|
|
97
|
+
this.buttonElement?.setAttribute('title', this.ctx.localization.get('filterToolbarToolText'));
|
|
87
98
|
}
|
|
88
99
|
ngOnDestroy() {
|
|
89
100
|
if (this.toolSubs) {
|
|
@@ -111,31 +122,43 @@ export class FilterCommandToolbarDirective {
|
|
|
111
122
|
}
|
|
112
123
|
openPopup() {
|
|
113
124
|
const direction = this.ctx.localization.rtl ? 'right' : 'left';
|
|
114
|
-
this.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
positionMode: 'absolute',
|
|
119
|
-
anchorAlign: { vertical: 'bottom', horizontal: direction },
|
|
120
|
-
popupAlign: { vertical: 'top', horizontal: direction }
|
|
121
|
-
});
|
|
122
|
-
this.setPopupAttributes();
|
|
123
|
-
this.ngZone.runOutsideAngular(() => {
|
|
124
|
-
if (!isDocumentAvailable()) {
|
|
125
|
-
return;
|
|
125
|
+
if (this.ctx.grid.adaptiveMode === 'auto' && this.adaptiveGridService.windowSize !== 'large') {
|
|
126
|
+
if (!this.ctx.grid.isActionSheetExpanded) {
|
|
127
|
+
this.adaptiveGridService.viewType = 'filterToolbarTool';
|
|
128
|
+
this.ctx.grid.adaptiveRenderer.actionSheet.toggle(true);
|
|
126
129
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
this.popupRef = this.popupService.open({
|
|
133
|
+
anchor: this.buttonElement,
|
|
134
|
+
content: FilterToolWrapperComponent,
|
|
135
|
+
popupClass: 'k-grid-columnmenu-popup',
|
|
136
|
+
positionMode: 'absolute',
|
|
137
|
+
anchorAlign: { vertical: 'bottom', horizontal: direction },
|
|
138
|
+
popupAlign: { vertical: 'top', horizontal: direction }
|
|
139
|
+
});
|
|
140
|
+
this.adaptiveGridService.popupRef = this.popupRef;
|
|
141
|
+
this.setPopupAttributes();
|
|
142
|
+
this.host.selected = true;
|
|
143
|
+
this.ngZone.runOutsideAngular(() => {
|
|
144
|
+
if (!isDocumentAvailable()) {
|
|
145
|
+
return;
|
|
130
146
|
}
|
|
147
|
+
this.removeClickListener = this.renderer.listen('document', 'click', (e) => {
|
|
148
|
+
if (this.popupRef && !closest(e.target, node => node === this.popupRef.popupElement || node === this.buttonElement)) {
|
|
149
|
+
this.ngZone.run(() => {
|
|
150
|
+
this.closePopup();
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
});
|
|
131
154
|
});
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
155
|
+
this.popupSubs = this.popupRef.popup.instance.anchorViewportLeave.subscribe(() => {
|
|
156
|
+
this.popupSubs?.unsubscribe();
|
|
157
|
+
this.popupSubs = null;
|
|
158
|
+
this.closePopup();
|
|
159
|
+
});
|
|
160
|
+
this.initPopupProperties();
|
|
161
|
+
}
|
|
139
162
|
}
|
|
140
163
|
setPopupAttributes() {
|
|
141
164
|
const popupElement = this.popupRef.popupElement;
|
|
@@ -144,8 +167,8 @@ export class FilterCommandToolbarDirective {
|
|
|
144
167
|
this.renderer.setAttribute(popupElement, 'dir', this.ctx.localization.rtl ? 'rtl' : 'ltr');
|
|
145
168
|
this.renderer.setAttribute(popupAriaElement, 'id', popupId);
|
|
146
169
|
this.renderer.setAttribute(popupAriaElement, 'role', 'dialog');
|
|
147
|
-
this.
|
|
148
|
-
this.
|
|
170
|
+
this.buttonElement?.setAttribute('aria-expanded', 'true');
|
|
171
|
+
this.buttonElement?.setAttribute('aria-controls', popupId);
|
|
149
172
|
}
|
|
150
173
|
initPopupProperties() {
|
|
151
174
|
this.popupRef.content.instance.columnInfoService = this.columnInfoService;
|
|
@@ -157,8 +180,9 @@ export class FilterCommandToolbarDirective {
|
|
|
157
180
|
}));
|
|
158
181
|
}
|
|
159
182
|
closePopup() {
|
|
160
|
-
this.
|
|
161
|
-
this.
|
|
183
|
+
this.buttonElement?.setAttribute('aria-expanded', 'false');
|
|
184
|
+
this.buttonElement?.removeAttribute('aria-controls');
|
|
185
|
+
this.host.selected = false;
|
|
162
186
|
if (this.popupRef) {
|
|
163
187
|
this.popupRef.close();
|
|
164
188
|
this.popupRef = null;
|
|
@@ -172,7 +196,10 @@ export class FilterCommandToolbarDirective {
|
|
|
172
196
|
this.removeClickListener = null;
|
|
173
197
|
}
|
|
174
198
|
}
|
|
175
|
-
|
|
199
|
+
get buttonElement() {
|
|
200
|
+
return this.host.getButton();
|
|
201
|
+
}
|
|
202
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterCommandToolbarDirective, deps: [{ token: i1.ToolBarButtonComponent }, { token: i2.PopupService }, { token: i3.ContextService }, { token: i4.FilterService }, { token: i5.ColumnInfoService }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i6.AdaptiveGridService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
176
203
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: FilterCommandToolbarDirective, isStandalone: true, selector: "[kendoGridFilterTool]", ngImport: i0 });
|
|
177
204
|
}
|
|
178
205
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterCommandToolbarDirective, decorators: [{
|
|
@@ -181,4 +208,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
181
208
|
selector: '[kendoGridFilterTool]',
|
|
182
209
|
standalone: true
|
|
183
210
|
}]
|
|
184
|
-
}], ctorParameters: function () { return [{ type: i1.ToolBarButtonComponent }, { type: i2.PopupService }, { type: i3.ContextService }, { type: i4.FilterService }, { type: i5.ColumnInfoService }, { type: i0.NgZone }, { type: i0.Renderer2 }]; } });
|
|
211
|
+
}], ctorParameters: function () { return [{ type: i1.ToolBarButtonComponent }, { type: i2.PopupService }, { type: i3.ContextService }, { type: i4.FilterService }, { type: i5.ColumnInfoService }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: i6.AdaptiveGridService }]; } });
|