@progress/kendo-angular-pivotgrid 0.2.0-dev.202209020712 → 0.2.0-dev.202209020832
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/bundles/kendo-angular-pivotgrid.umd.js +1 -1
- package/configurator/chip-menu/chip-menu-container.component.d.ts +21 -0
- package/configurator/chip-menu/chip-menu-filter.component.d.ts +44 -0
- package/configurator/chip-menu/chip-menu-item-base.d.ts +22 -0
- package/configurator/chip-menu/chip-menu-item-content-template.directive.d.ts +18 -0
- package/configurator/chip-menu/chip-menu-item.component.d.ts +50 -0
- package/configurator/chip-menu/chip-menu-item.directive.d.ts +32 -0
- package/configurator/chip-menu/chip-menu-sort.component.d.ts +33 -0
- package/configurator/chip-menu/chip-menu.component.d.ts +35 -0
- package/configurator/chip-menu/chip-menu.module.d.ts +26 -0
- package/configurator/chip-menu/chip-menu.service.d.ts +22 -0
- package/configurator/chip-menu/filtering/filter-menu-container.component.d.ts +47 -0
- package/configurator/chip-menu/filtering/filter-menu-dropdownlist.directive.d.ts +19 -0
- package/configurator/chip-menu/filtering/menu-tabbing.service.d.ts +17 -0
- package/configurator/chip-menu/filtering/string-filter-menu.component.d.ts +53 -0
- package/configurator/chip-menu/single-popup.service.d.ts +50 -0
- package/configurator/configurator.component.d.ts +4 -1
- package/data-binding/base-binding-directive.d.ts +10 -1
- package/esm2015/configurator/chip-menu/chip-menu-container.component.js +46 -0
- package/esm2015/configurator/chip-menu/chip-menu-filter.component.js +112 -0
- package/esm2015/configurator/chip-menu/chip-menu-item-base.js +36 -0
- package/esm2015/configurator/chip-menu/chip-menu-item-content-template.directive.js +27 -0
- package/esm2015/configurator/chip-menu/chip-menu-item.component.js +157 -0
- package/esm2015/configurator/chip-menu/chip-menu-item.directive.js +88 -0
- package/esm2015/configurator/chip-menu/chip-menu-sort.component.js +89 -0
- package/esm2015/configurator/chip-menu/chip-menu.component.js +130 -0
- package/esm2015/configurator/chip-menu/chip-menu.module.js +83 -0
- package/esm2015/configurator/chip-menu/chip-menu.service.js +28 -0
- package/esm2015/configurator/chip-menu/filtering/filter-menu-container.component.js +173 -0
- package/esm2015/configurator/chip-menu/filtering/filter-menu-dropdownlist.directive.js +38 -0
- package/esm2015/configurator/chip-menu/filtering/menu-tabbing.service.js +20 -0
- package/esm2015/configurator/chip-menu/filtering/string-filter-menu.component.js +133 -0
- package/esm2015/configurator/chip-menu/single-popup.service.js +121 -0
- package/esm2015/configurator/configurator.component.js +56 -33
- package/esm2015/configurator/configurator.service.js +2 -2
- package/esm2015/data-binding/base-binding-directive.js +16 -4
- package/esm2015/data-binding/local-binding.directive.js +3 -3
- package/esm2015/data-binding/olap-binding.directive.js +6 -4
- package/esm2015/localization/messages.js +3 -1
- package/esm2015/localization/pivot-localization.service.js +28 -0
- package/esm2015/models/configurator-settings.js +3 -1
- package/esm2015/package-metadata.js +1 -1
- package/esm2015/pivotgrid.component.js +14 -5
- package/esm2015/pivotgrid.module.js +9 -12
- package/esm2015/shared.module.js +40 -0
- package/esm2015/util.js +13 -0
- package/fesm2015/kendo-angular-pivotgrid.js +1331 -75
- package/localization/messages.d.ts +23 -1
- package/localization/pivot-localization.service.d.ts +19 -0
- package/models/configurator-settings.d.ts +4 -1
- package/package.json +1 -1
- package/pivotgrid.module.d.ts +6 -7
- package/shared.module.d.ts +17 -0
- package/util.d.ts +12 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { NgModule } from '@angular/core';
|
|
6
|
+
import { ChipMenuItemComponent } from './chip-menu-item.component';
|
|
7
|
+
import { ChipMenuSortComponent } from './chip-menu-sort.component';
|
|
8
|
+
import { ChipMenuComponent } from './chip-menu.component';
|
|
9
|
+
import { ChipMenuContainerComponent } from './chip-menu-container.component';
|
|
10
|
+
import { ChipMenuItemDirective } from './chip-menu-item.directive';
|
|
11
|
+
import { ChipMenuFilterComponent } from './chip-menu-filter.component';
|
|
12
|
+
import { ChipMenuItemContentTemplateDirective } from './chip-menu-item-content-template.directive';
|
|
13
|
+
import { FilterMenuContainerComponent } from './filtering/filter-menu-container.component';
|
|
14
|
+
import { StringFilterMenuComponent } from './filtering/string-filter-menu.component';
|
|
15
|
+
import { FilterMenuDropDownListDirective } from './filtering/filter-menu-dropdownlist.directive';
|
|
16
|
+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
17
|
+
import { SharedModule } from '../../shared.module';
|
|
18
|
+
import * as i0 from "@angular/core";
|
|
19
|
+
const COMPONENTS = [
|
|
20
|
+
ChipMenuItemComponent,
|
|
21
|
+
ChipMenuSortComponent,
|
|
22
|
+
ChipMenuComponent,
|
|
23
|
+
ChipMenuFilterComponent,
|
|
24
|
+
ChipMenuItemContentTemplateDirective,
|
|
25
|
+
FilterMenuContainerComponent,
|
|
26
|
+
StringFilterMenuComponent,
|
|
27
|
+
FilterMenuDropDownListDirective,
|
|
28
|
+
ChipMenuContainerComponent,
|
|
29
|
+
ChipMenuItemDirective
|
|
30
|
+
];
|
|
31
|
+
/**
|
|
32
|
+
* @hidden
|
|
33
|
+
*/
|
|
34
|
+
export class ChipMenuModule {
|
|
35
|
+
static exports() {
|
|
36
|
+
return [
|
|
37
|
+
ChipMenuItemComponent,
|
|
38
|
+
ChipMenuSortComponent,
|
|
39
|
+
ChipMenuContainerComponent,
|
|
40
|
+
ChipMenuItemDirective,
|
|
41
|
+
ChipMenuComponent
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
ChipMenuModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
46
|
+
ChipMenuModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipMenuModule, declarations: [ChipMenuItemComponent,
|
|
47
|
+
ChipMenuSortComponent,
|
|
48
|
+
ChipMenuComponent,
|
|
49
|
+
ChipMenuFilterComponent,
|
|
50
|
+
ChipMenuItemContentTemplateDirective,
|
|
51
|
+
FilterMenuContainerComponent,
|
|
52
|
+
StringFilterMenuComponent,
|
|
53
|
+
FilterMenuDropDownListDirective,
|
|
54
|
+
ChipMenuContainerComponent,
|
|
55
|
+
ChipMenuItemDirective], imports: [SharedModule,
|
|
56
|
+
ReactiveFormsModule,
|
|
57
|
+
FormsModule], exports: [ChipMenuItemComponent,
|
|
58
|
+
ChipMenuSortComponent,
|
|
59
|
+
ChipMenuComponent,
|
|
60
|
+
ChipMenuFilterComponent,
|
|
61
|
+
ChipMenuItemContentTemplateDirective,
|
|
62
|
+
FilterMenuContainerComponent,
|
|
63
|
+
StringFilterMenuComponent,
|
|
64
|
+
FilterMenuDropDownListDirective,
|
|
65
|
+
ChipMenuContainerComponent,
|
|
66
|
+
ChipMenuItemDirective] });
|
|
67
|
+
ChipMenuModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipMenuModule, imports: [[
|
|
68
|
+
SharedModule,
|
|
69
|
+
ReactiveFormsModule,
|
|
70
|
+
FormsModule
|
|
71
|
+
]] });
|
|
72
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipMenuModule, decorators: [{
|
|
73
|
+
type: NgModule,
|
|
74
|
+
args: [{
|
|
75
|
+
declarations: [COMPONENTS],
|
|
76
|
+
imports: [
|
|
77
|
+
SharedModule,
|
|
78
|
+
ReactiveFormsModule,
|
|
79
|
+
FormsModule
|
|
80
|
+
],
|
|
81
|
+
exports: [COMPONENTS]
|
|
82
|
+
}]
|
|
83
|
+
}] });
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Injectable, EventEmitter } from '@angular/core';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
import * as i1 from "./filtering/menu-tabbing.service";
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
* Represents the service that is passed to the ChipMenuFilterComponent and ChipMenuSortComponent.
|
|
11
|
+
*/
|
|
12
|
+
export class ChipMenuService {
|
|
13
|
+
constructor(menuTabbingService) {
|
|
14
|
+
this.closeMenu = new EventEmitter();
|
|
15
|
+
this.menuTabbingService = menuTabbingService;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Closes the chip menu.
|
|
19
|
+
*/
|
|
20
|
+
close() {
|
|
21
|
+
this.closeMenu.emit();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
ChipMenuService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipMenuService, deps: [{ token: i1.MenuTabbingService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
25
|
+
ChipMenuService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipMenuService });
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipMenuService, decorators: [{
|
|
27
|
+
type: Injectable
|
|
28
|
+
}], ctorParameters: function () { return [{ type: i1.MenuTabbingService }]; } });
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { MenuTabbingService } from './menu-tabbing.service';
|
|
6
|
+
import { Component, Input, Output, EventEmitter, ViewChild } from '@angular/core';
|
|
7
|
+
import { isNullOrEmptyString } from "../../../util";
|
|
8
|
+
import { PIVOT_CONFIGURATOR_ACTION } from '@progress/kendo-pivotgrid-common';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
import * as i1 from "../../../localization/pivot-localization.service";
|
|
11
|
+
import * as i2 from "./menu-tabbing.service";
|
|
12
|
+
import * as i3 from "../../configurator.service";
|
|
13
|
+
import * as i4 from "./string-filter-menu.component";
|
|
14
|
+
import * as i5 from "@angular/forms";
|
|
15
|
+
import * as i6 from "@angular/common";
|
|
16
|
+
import * as i7 from "@progress/kendo-angular-buttons";
|
|
17
|
+
const isNoValueOperator = operator => (operator === "isnull"
|
|
18
|
+
|| operator === "isnotnull"
|
|
19
|
+
|| operator === "isempty"
|
|
20
|
+
|| operator === "isnotempty");
|
|
21
|
+
const validFilter = ({ value, operator }) => !isNullOrEmptyString(value) || isNoValueOperator(operator);
|
|
22
|
+
/**
|
|
23
|
+
* @hidden
|
|
24
|
+
*/
|
|
25
|
+
export class FilterMenuContainerComponent {
|
|
26
|
+
constructor(localization, cd, menuTabbingService, configuratorService) {
|
|
27
|
+
this.localization = localization;
|
|
28
|
+
this.cd = cd;
|
|
29
|
+
this.configuratorService = configuratorService;
|
|
30
|
+
this.close = new EventEmitter();
|
|
31
|
+
this.actionsClass = 'k-action-buttons k-button-group';
|
|
32
|
+
this.menuTabbingService = menuTabbingService;
|
|
33
|
+
}
|
|
34
|
+
ngOnInit() {
|
|
35
|
+
}
|
|
36
|
+
ngAfterViewChecked() {
|
|
37
|
+
if (!this.menuTabbingService.isColumnMenu || (this.isLast && this.isExpanded)) {
|
|
38
|
+
this.menuTabbingService.lastFocusable = this.disabled ?
|
|
39
|
+
this.resetButton.nativeElement : this.filterButton.nativeElement;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
ngOnDestroy() {
|
|
43
|
+
this.menuTabbingService.lastFocusable = null;
|
|
44
|
+
}
|
|
45
|
+
get disabled() {
|
|
46
|
+
return !(this.filterDescriptorValue && validFilter(this.filterDescriptorValue));
|
|
47
|
+
}
|
|
48
|
+
submit() {
|
|
49
|
+
const filterDescriptor = Object.assign({ field: this.chip.name.toString() }, this.filterDescriptorValue);
|
|
50
|
+
const payload = !this.configuratorService.state.filter ?
|
|
51
|
+
[filterDescriptor] :
|
|
52
|
+
[
|
|
53
|
+
...this.configuratorService.state.filter.filter(descriptor => descriptor.field !== filterDescriptor.field),
|
|
54
|
+
filterDescriptor
|
|
55
|
+
];
|
|
56
|
+
this.configuratorService.parseConfiguratorState({ type: PIVOT_CONFIGURATOR_ACTION.setFilter, payload: payload });
|
|
57
|
+
this.close.emit();
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
reset() {
|
|
61
|
+
const filters = this.configuratorService.state.filter.filter(descriptor => descriptor.field !== this.chip.name.toString());
|
|
62
|
+
this.configuratorService.parseConfiguratorState({ type: PIVOT_CONFIGURATOR_ACTION.setFilter, payload: filters });
|
|
63
|
+
this.close.emit();
|
|
64
|
+
}
|
|
65
|
+
onTab(e, buttonType) {
|
|
66
|
+
if (this.menuTabbingService.firstFocusable && (!this.menuTabbingService.isColumnMenu || this.isLast)) {
|
|
67
|
+
e.preventDefault();
|
|
68
|
+
if (buttonType === 'reset') {
|
|
69
|
+
// eslint-disable-next-line no-unused-expressions
|
|
70
|
+
this.disabled ? this.menuTabbingService.firstFocusable.focus() : this.filterButton.nativeElement.focus();
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
this.menuTabbingService.firstFocusable.focus();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Returns the localized message for a given token
|
|
79
|
+
*/
|
|
80
|
+
messageFor(localizationToken) {
|
|
81
|
+
return this.localization.get(localizationToken);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
FilterMenuContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterMenuContainerComponent, deps: [{ token: i1.PivotLocalizationService }, { token: i0.ChangeDetectorRef }, { token: i2.MenuTabbingService }, { token: i3.ConfiguratorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
85
|
+
FilterMenuContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterMenuContainerComponent, selector: "kendo-pivot-filter-menu-container", inputs: { chip: "chip", isLast: "isLast", isExpanded: "isExpanded", menuTabbingService: "menuTabbingService", actionsClass: "actionsClass" }, outputs: { close: "close" }, providers: [
|
|
86
|
+
MenuTabbingService
|
|
87
|
+
], viewQueries: [{ propertyName: "resetButton", first: true, predicate: ["resetButton"], descendants: true }, { propertyName: "filterButton", first: true, predicate: ["filterButton"], descendants: true }], ngImport: i0, template: `
|
|
88
|
+
<form (submit)="submit()" (reset)="reset()"
|
|
89
|
+
class="k-filter-menu k-group k-reset k-state-border-up">
|
|
90
|
+
<div class="k-filter-menu-container">
|
|
91
|
+
<kendo-pivot-string-filter-menu
|
|
92
|
+
[(ngModel)]="filterDescriptorValue"
|
|
93
|
+
name="'filterDescriptorValue'"
|
|
94
|
+
[chip]="chip"
|
|
95
|
+
[menuTabbingService]="menuTabbingService">
|
|
96
|
+
</kendo-pivot-string-filter-menu>
|
|
97
|
+
<div [ngClass]="actionsClass">
|
|
98
|
+
<button
|
|
99
|
+
#resetButton
|
|
100
|
+
type="reset"
|
|
101
|
+
kendoButton
|
|
102
|
+
(keydown.tab)="onTab($event, 'reset')">{{messageFor('filterClearButton')}}</button>
|
|
103
|
+
<button #filterButton
|
|
104
|
+
type="submit"
|
|
105
|
+
[disabled]="disabled"
|
|
106
|
+
kendoButton
|
|
107
|
+
themeColor="primary"
|
|
108
|
+
(keydown.tab)="onTab($event, 'filter')">{{messageFor('filterFilterButton')}}</button>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</form>
|
|
112
|
+
`, isInline: true, styles: ["\n kendo-pivot-string-filter-menu {\n display: flex;\n flex-flow: column nowrap;\n align-items: stretch;\n gap: 8px;\n }\n "], components: [{ type: i4.StringFilterMenuComponent, selector: "kendo-pivot-string-filter-menu", inputs: ["chip", "menuTabbingService"] }], directives: [{ type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i7.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }] });
|
|
113
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterMenuContainerComponent, decorators: [{
|
|
114
|
+
type: Component,
|
|
115
|
+
args: [{
|
|
116
|
+
providers: [
|
|
117
|
+
MenuTabbingService
|
|
118
|
+
],
|
|
119
|
+
selector: 'kendo-pivot-filter-menu-container',
|
|
120
|
+
template: `
|
|
121
|
+
<form (submit)="submit()" (reset)="reset()"
|
|
122
|
+
class="k-filter-menu k-group k-reset k-state-border-up">
|
|
123
|
+
<div class="k-filter-menu-container">
|
|
124
|
+
<kendo-pivot-string-filter-menu
|
|
125
|
+
[(ngModel)]="filterDescriptorValue"
|
|
126
|
+
name="'filterDescriptorValue'"
|
|
127
|
+
[chip]="chip"
|
|
128
|
+
[menuTabbingService]="menuTabbingService">
|
|
129
|
+
</kendo-pivot-string-filter-menu>
|
|
130
|
+
<div [ngClass]="actionsClass">
|
|
131
|
+
<button
|
|
132
|
+
#resetButton
|
|
133
|
+
type="reset"
|
|
134
|
+
kendoButton
|
|
135
|
+
(keydown.tab)="onTab($event, 'reset')">{{messageFor('filterClearButton')}}</button>
|
|
136
|
+
<button #filterButton
|
|
137
|
+
type="submit"
|
|
138
|
+
[disabled]="disabled"
|
|
139
|
+
kendoButton
|
|
140
|
+
themeColor="primary"
|
|
141
|
+
(keydown.tab)="onTab($event, 'filter')">{{messageFor('filterFilterButton')}}</button>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
</form>
|
|
145
|
+
`,
|
|
146
|
+
styles: [`
|
|
147
|
+
kendo-pivot-string-filter-menu {
|
|
148
|
+
display: flex;
|
|
149
|
+
flex-flow: column nowrap;
|
|
150
|
+
align-items: stretch;
|
|
151
|
+
gap: 8px;
|
|
152
|
+
}
|
|
153
|
+
`]
|
|
154
|
+
}]
|
|
155
|
+
}], ctorParameters: function () { return [{ type: i1.PivotLocalizationService }, { type: i0.ChangeDetectorRef }, { type: i2.MenuTabbingService }, { type: i3.ConfiguratorService }]; }, propDecorators: { close: [{
|
|
156
|
+
type: Output
|
|
157
|
+
}], chip: [{
|
|
158
|
+
type: Input
|
|
159
|
+
}], isLast: [{
|
|
160
|
+
type: Input
|
|
161
|
+
}], isExpanded: [{
|
|
162
|
+
type: Input
|
|
163
|
+
}], menuTabbingService: [{
|
|
164
|
+
type: Input
|
|
165
|
+
}], actionsClass: [{
|
|
166
|
+
type: Input
|
|
167
|
+
}], resetButton: [{
|
|
168
|
+
type: ViewChild,
|
|
169
|
+
args: ['resetButton']
|
|
170
|
+
}], filterButton: [{
|
|
171
|
+
type: ViewChild,
|
|
172
|
+
args: ['filterButton']
|
|
173
|
+
}] } });
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 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, Input } from '@angular/core';
|
|
6
|
+
import { Keys } from '@progress/kendo-angular-common';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
import * as i1 from "@progress/kendo-angular-dropdowns";
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export class FilterMenuDropDownListDirective {
|
|
13
|
+
constructor(host) {
|
|
14
|
+
this.host = host;
|
|
15
|
+
this.keydownHandler = (e) => {
|
|
16
|
+
if (e.keyCode === Keys.Escape && this.host.isOpen) {
|
|
17
|
+
e.stopPropagation();
|
|
18
|
+
this.host.toggle(false);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
ngAfterViewInit() {
|
|
23
|
+
const wrapperElement = this.host.wrapper.nativeElement;
|
|
24
|
+
wrapperElement.setAttribute('aria-label', this.filterMenuDropDownLabel);
|
|
25
|
+
wrapperElement.addEventListener('keydown', this.keydownHandler, true);
|
|
26
|
+
}
|
|
27
|
+
ngOnDestroy() {
|
|
28
|
+
this.host.wrapper.nativeElement.removeEventListener('keydown', this.keydownHandler);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
FilterMenuDropDownListDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterMenuDropDownListDirective, deps: [{ token: i1.DropDownListComponent }], target: i0.ɵɵFactoryTarget.Directive });
|
|
32
|
+
FilterMenuDropDownListDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FilterMenuDropDownListDirective, selector: "[kendoFilterMenuDropDown]", inputs: { filterMenuDropDownLabel: "filterMenuDropDownLabel" }, ngImport: i0 });
|
|
33
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterMenuDropDownListDirective, decorators: [{
|
|
34
|
+
type: Directive,
|
|
35
|
+
args: [{ selector: '[kendoFilterMenuDropDown]' }]
|
|
36
|
+
}], ctorParameters: function () { return [{ type: i1.DropDownListComponent }]; }, propDecorators: { filterMenuDropDownLabel: [{
|
|
37
|
+
type: Input
|
|
38
|
+
}] } });
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Injectable } from '@angular/core';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* @hidden
|
|
9
|
+
*/
|
|
10
|
+
export class MenuTabbingService {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.isColumnMenu = false;
|
|
13
|
+
this.isPopupOpen = false;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
MenuTabbingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MenuTabbingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
17
|
+
MenuTabbingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MenuTabbingService });
|
|
18
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MenuTabbingService, decorators: [{
|
|
19
|
+
type: Injectable
|
|
20
|
+
}] });
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 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, Input, forwardRef } from '@angular/core';
|
|
6
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
7
|
+
import { Subscription } from 'rxjs';
|
|
8
|
+
import { replaceMessagePlaceholder } from '../../../util';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
import * as i1 from "../../../localization/pivot-localization.service";
|
|
11
|
+
import * as i2 from "../../configurator.service";
|
|
12
|
+
import * as i3 from "@angular/forms";
|
|
13
|
+
import * as i4 from "@progress/kendo-angular-dropdowns";
|
|
14
|
+
import * as i5 from "./filter-menu-dropdownlist.directive";
|
|
15
|
+
import * as i6 from "@progress/kendo-angular-inputs";
|
|
16
|
+
/**
|
|
17
|
+
* @hidden
|
|
18
|
+
*/
|
|
19
|
+
export const localizeOperators = operators => localization => Object.keys(operators).map(key => ({
|
|
20
|
+
text: localization.get(key),
|
|
21
|
+
value: operators[key]
|
|
22
|
+
}));
|
|
23
|
+
const stringOperators = localizeOperators({
|
|
24
|
+
"filterEqOperator": "eq",
|
|
25
|
+
"filterNotEqOperator": "neq",
|
|
26
|
+
"filterContainsOperator": "contains",
|
|
27
|
+
"filterNotContainsOperator": "doesnotcontain",
|
|
28
|
+
"filterStartsWithOperator": "startswith",
|
|
29
|
+
"filterEndsWithOperator": "endswith",
|
|
30
|
+
"filterIsNullOperator": "isnull",
|
|
31
|
+
"filterIsNotNullOperator": "isnotnull",
|
|
32
|
+
"filterIsEmptyOperator": "isempty",
|
|
33
|
+
"filterIsNotEmptyOperator": "isnotempty"
|
|
34
|
+
});
|
|
35
|
+
/**
|
|
36
|
+
* @hidden
|
|
37
|
+
*
|
|
38
|
+
* Represents a string-filter menu component.
|
|
39
|
+
*/
|
|
40
|
+
export class StringFilterMenuComponent {
|
|
41
|
+
constructor(localization, configuratorService, fb) {
|
|
42
|
+
this.localization = localization;
|
|
43
|
+
this.configuratorService = configuratorService;
|
|
44
|
+
this.fb = fb;
|
|
45
|
+
this.subscription = new Subscription();
|
|
46
|
+
this.onTouched = () => { };
|
|
47
|
+
}
|
|
48
|
+
get currentFilter() {
|
|
49
|
+
var _a;
|
|
50
|
+
const filterValue = (_a = this.configuratorService.state.filter) === null || _a === void 0 ? void 0 : _a.filter(x => x.field === this.chip.name.toString());
|
|
51
|
+
return filterValue && filterValue[0];
|
|
52
|
+
}
|
|
53
|
+
registerOnChange(fn) {
|
|
54
|
+
this.filterFormGroup.valueChanges.subscribe(fn);
|
|
55
|
+
}
|
|
56
|
+
registerOnTouched(fn) {
|
|
57
|
+
this.onTouched = fn;
|
|
58
|
+
}
|
|
59
|
+
writeValue(val) {
|
|
60
|
+
if (val) {
|
|
61
|
+
this.filterFormGroup.setValue(val, { emitEvent: false });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
get filterMenuDropDownLabel() {
|
|
65
|
+
const localizationMsg = this.localization.get('filterOperatorsDropDownLabel') || '';
|
|
66
|
+
const chipName = this.chip.name.toString();
|
|
67
|
+
return replaceMessagePlaceholder(localizationMsg, 'fields', chipName);
|
|
68
|
+
}
|
|
69
|
+
ngOnInit() {
|
|
70
|
+
this.filterFormGroup = this.fb.group({
|
|
71
|
+
operator: [this.currentFilter ? this.currentFilter.operator : ''],
|
|
72
|
+
value: [this.currentFilter ? this.currentFilter.value : '']
|
|
73
|
+
});
|
|
74
|
+
this.operators = stringOperators(this.localization);
|
|
75
|
+
}
|
|
76
|
+
ngOnDestroy() {
|
|
77
|
+
this.subscription.unsubscribe();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
StringFilterMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: StringFilterMenuComponent, deps: [{ token: i1.PivotLocalizationService }, { token: i2.ConfiguratorService }, { token: i3.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
81
|
+
StringFilterMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: StringFilterMenuComponent, selector: "kendo-pivot-string-filter-menu", inputs: { chip: "chip", menuTabbingService: "menuTabbingService" }, providers: [{
|
|
82
|
+
provide: NG_VALUE_ACCESSOR,
|
|
83
|
+
useExisting: forwardRef(() => StringFilterMenuComponent),
|
|
84
|
+
multi: true
|
|
85
|
+
}], ngImport: i0, template: `
|
|
86
|
+
<ng-container [formGroup]="filterFormGroup">
|
|
87
|
+
<kendo-dropdownlist
|
|
88
|
+
kendoFilterMenuDropDown
|
|
89
|
+
[filterMenuDropDownLabel]="filterMenuDropDownLabel"
|
|
90
|
+
[data]="operators"
|
|
91
|
+
formControlName="operator"
|
|
92
|
+
[valuePrimitive]="true"
|
|
93
|
+
textField="text"
|
|
94
|
+
valueField="value">
|
|
95
|
+
</kendo-dropdownlist>
|
|
96
|
+
<input
|
|
97
|
+
kendoTextBox
|
|
98
|
+
formControlName="value"
|
|
99
|
+
/>
|
|
100
|
+
</ng-container>
|
|
101
|
+
`, isInline: true, components: [{ type: i4.DropDownListComponent, selector: "kendo-dropdownlist", inputs: ["iconClass", "loading", "data", "value", "textField", "valueField", "popupSettings", "listHeight", "defaultItem", "disabled", "itemDisabled", "readonly", "filterable", "virtual", "ignoreCase", "delay", "valuePrimitive", "tabindex", "tabIndex", "size", "rounded", "fillMode", "id"], outputs: ["valueChange", "filterChange", "selectionChange", "open", "opened", "close", "closed", "focus", "blur"], exportAs: ["kendoDropDownList"] }], directives: [{ type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5.FilterMenuDropDownListDirective, selector: "[kendoFilterMenuDropDown]", inputs: ["filterMenuDropDownLabel"] }, { type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i6.TextBoxDirective, selector: "input[kendoTextBox]", inputs: ["value"] }, { type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }] });
|
|
102
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: StringFilterMenuComponent, decorators: [{
|
|
103
|
+
type: Component,
|
|
104
|
+
args: [{
|
|
105
|
+
selector: 'kendo-pivot-string-filter-menu',
|
|
106
|
+
providers: [{
|
|
107
|
+
provide: NG_VALUE_ACCESSOR,
|
|
108
|
+
useExisting: forwardRef(() => StringFilterMenuComponent),
|
|
109
|
+
multi: true
|
|
110
|
+
}],
|
|
111
|
+
template: `
|
|
112
|
+
<ng-container [formGroup]="filterFormGroup">
|
|
113
|
+
<kendo-dropdownlist
|
|
114
|
+
kendoFilterMenuDropDown
|
|
115
|
+
[filterMenuDropDownLabel]="filterMenuDropDownLabel"
|
|
116
|
+
[data]="operators"
|
|
117
|
+
formControlName="operator"
|
|
118
|
+
[valuePrimitive]="true"
|
|
119
|
+
textField="text"
|
|
120
|
+
valueField="value">
|
|
121
|
+
</kendo-dropdownlist>
|
|
122
|
+
<input
|
|
123
|
+
kendoTextBox
|
|
124
|
+
formControlName="value"
|
|
125
|
+
/>
|
|
126
|
+
</ng-container>
|
|
127
|
+
`
|
|
128
|
+
}]
|
|
129
|
+
}], ctorParameters: function () { return [{ type: i1.PivotLocalizationService }, { type: i2.ConfiguratorService }, { type: i3.FormBuilder }]; }, propDecorators: { chip: [{
|
|
130
|
+
type: Input
|
|
131
|
+
}], menuTabbingService: [{
|
|
132
|
+
type: Input
|
|
133
|
+
}] } });
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Injectable } from '@angular/core';
|
|
6
|
+
import { Subject, Subscription } from 'rxjs';
|
|
7
|
+
import { PreventableEvent } from '@progress/kendo-angular-common';
|
|
8
|
+
import { isPresent } from '../../util';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
import * as i1 from "@progress/kendo-angular-popup";
|
|
11
|
+
import * as i2 from "../../localization/pivot-localization.service";
|
|
12
|
+
const contains = (node, predicate) => {
|
|
13
|
+
while (node) {
|
|
14
|
+
if (predicate(node)) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
node = node.parentNode;
|
|
18
|
+
}
|
|
19
|
+
return false;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* @hidden
|
|
23
|
+
* Arguments for the `close` event of the chip-menu popup.
|
|
24
|
+
*/
|
|
25
|
+
export class PopupCloseEvent extends PreventableEvent {
|
|
26
|
+
constructor(e) {
|
|
27
|
+
super();
|
|
28
|
+
this.originalEvent = e;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const DEFAULT_POPUP_CLASS = 'k-grid-filter-popup';
|
|
32
|
+
/**
|
|
33
|
+
* @hidden
|
|
34
|
+
* The service that is used for the popups of the chip menus.
|
|
35
|
+
*/
|
|
36
|
+
export class SinglePopupService {
|
|
37
|
+
constructor(popupService, renderer, ngZone, localization) {
|
|
38
|
+
this.popupService = popupService;
|
|
39
|
+
this.renderer = renderer;
|
|
40
|
+
this.ngZone = ngZone;
|
|
41
|
+
this.localization = localization;
|
|
42
|
+
/**
|
|
43
|
+
* Fires when the chip menus are about to close because the user clicked outside their popups.
|
|
44
|
+
* Used to prevent the popup from closing.
|
|
45
|
+
*/
|
|
46
|
+
this.onClose = new Subject();
|
|
47
|
+
this.pointerEventsSub = new Subscription();
|
|
48
|
+
this.scrollSubscription = new Subscription();
|
|
49
|
+
}
|
|
50
|
+
open(anchor, template, popupRef, popupClass = DEFAULT_POPUP_CLASS) {
|
|
51
|
+
var _a;
|
|
52
|
+
const toggle = isPresent(popupRef) && this.popupRef === popupRef;
|
|
53
|
+
this.destroy();
|
|
54
|
+
if (!toggle) {
|
|
55
|
+
const direction = this.localization.rtl ? 'right' : 'left';
|
|
56
|
+
this.popupRef = this.popupService.open({
|
|
57
|
+
anchorAlign: { vertical: 'bottom', horizontal: direction },
|
|
58
|
+
popupAlign: { vertical: 'top', horizontal: direction },
|
|
59
|
+
anchor: anchor,
|
|
60
|
+
popupClass: popupClass,
|
|
61
|
+
content: template,
|
|
62
|
+
positionMode: "absolute"
|
|
63
|
+
});
|
|
64
|
+
this.renderer.setAttribute(this.popupRef.popupElement, 'dir', this.localization.rtl ? 'rtl' : 'ltr');
|
|
65
|
+
this.attachClose(anchor);
|
|
66
|
+
}
|
|
67
|
+
const popupEl = (_a = this.popupRef) === null || _a === void 0 ? void 0 : _a.popupElement;
|
|
68
|
+
if (popupEl) {
|
|
69
|
+
this.attachMouseListeners(popupEl);
|
|
70
|
+
}
|
|
71
|
+
return this.popupRef;
|
|
72
|
+
}
|
|
73
|
+
destroy() {
|
|
74
|
+
if (this.popupRef) {
|
|
75
|
+
this.detachClose();
|
|
76
|
+
this.pointerEventsSub.unsubscribe();
|
|
77
|
+
this.pointerEventsSub = null;
|
|
78
|
+
this.popupRef.close();
|
|
79
|
+
this.popupRef = null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
ngOnDestroy() {
|
|
83
|
+
this.destroy();
|
|
84
|
+
this.scrollSubscription.unsubscribe();
|
|
85
|
+
}
|
|
86
|
+
detachClose() {
|
|
87
|
+
if (this.removeClick) {
|
|
88
|
+
this.removeClick();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
attachClose(skipElement) {
|
|
92
|
+
this.detachClose();
|
|
93
|
+
this.ngZone.runOutsideAngular(() => this.removeClick = this.renderer.listen('document', 'click', (e) => {
|
|
94
|
+
if (!contains(e.target, x => this.popupRef.popupElement === x || x === skipElement)) {
|
|
95
|
+
const args = new PopupCloseEvent(e);
|
|
96
|
+
this.onClose.next(args);
|
|
97
|
+
if (!args.isDefaultPrevented() && this.canClosePopup) {
|
|
98
|
+
this.destroy();
|
|
99
|
+
}
|
|
100
|
+
this.canClosePopup = true;
|
|
101
|
+
}
|
|
102
|
+
}));
|
|
103
|
+
}
|
|
104
|
+
attachMouseListeners(el) {
|
|
105
|
+
this.pointerEventsSub = new Subscription();
|
|
106
|
+
this.ngZone.runOutsideAngular(() => {
|
|
107
|
+
this.pointerEventsSub.add(this.renderer.listen(el, 'pointerdown', (e) => {
|
|
108
|
+
e.stopImmediatePropagation();
|
|
109
|
+
this.canClosePopup = false;
|
|
110
|
+
}));
|
|
111
|
+
this.pointerEventsSub.add(this.renderer.listen(el, 'pointerup', () => {
|
|
112
|
+
this.canClosePopup = true;
|
|
113
|
+
}));
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
SinglePopupService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SinglePopupService, deps: [{ token: i1.PopupService }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: i2.PivotLocalizationService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
118
|
+
SinglePopupService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SinglePopupService });
|
|
119
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SinglePopupService, decorators: [{
|
|
120
|
+
type: Injectable
|
|
121
|
+
}], ctorParameters: function () { return [{ type: i1.PopupService }, { type: i0.Renderer2 }, { type: i0.NgZone }, { type: i2.PivotLocalizationService }]; } });
|