@progress/kendo-angular-filter 1.0.0-next.202204011458 → 1.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/dist/cdn/js/kendo-angular-filter.js +20 -0
- package/dist/cdn/main.js +5 -0
- package/dist/es/aria-label.directive.js +30 -0
- package/dist/es/editors/boolean-editor.component.js +61 -0
- package/dist/es/editors/date-editor.component.js +45 -0
- package/dist/es/editors/numeric-editor.component.js +45 -0
- package/dist/es/editors/text-editor.component.js +45 -0
- package/dist/es/filter-expression-operators.component.js +48 -0
- package/dist/es/filter-expression.component.js +136 -0
- package/dist/es/filter-group.component.js +84 -0
- package/dist/es/filter.component.js +185 -0
- package/dist/es/filter.module.js +91 -0
- package/dist/es/filter.service.js +45 -0
- package/{esm2015/main.js → dist/es/index.js} +8 -3
- package/dist/es/localization/custom-messages.component.js +44 -0
- package/dist/es/localization/localized-messages.directive.js +35 -0
- package/dist/es/localization/messages.js +166 -0
- package/dist/es/main.js +6 -0
- package/{esm2015 → dist/es}/model/filter-expression.js +0 -1
- package/dist/es/package-metadata.js +15 -0
- package/dist/es/shared.module.js +35 -0
- package/dist/es/util.js +136 -0
- package/{aria-label.directive.d.ts → dist/es2015/aria-label.directive.d.ts} +0 -3
- package/dist/es2015/aria-label.directive.js +29 -0
- package/{editors → dist/es2015/editors}/boolean-editor.component.d.ts +0 -3
- package/dist/es2015/editors/boolean-editor.component.js +72 -0
- package/{editors → dist/es2015/editors}/date-editor.component.d.ts +0 -3
- package/dist/es2015/editors/date-editor.component.js +56 -0
- package/{editors → dist/es2015/editors}/numeric-editor.component.d.ts +0 -3
- package/dist/es2015/editors/numeric-editor.component.js +56 -0
- package/{editors → dist/es2015/editors}/text-editor.component.d.ts +0 -3
- package/dist/es2015/editors/text-editor.component.js +52 -0
- package/{filter-expression-operators.component.d.ts → dist/es2015/filter-expression-operators.component.d.ts} +0 -3
- package/dist/es2015/filter-expression-operators.component.js +59 -0
- package/{filter-expression.component.d.ts → dist/es2015/filter-expression.component.d.ts} +0 -5
- package/{esm2015 → dist/es2015}/filter-expression.component.js +26 -71
- package/{filter-group.component.d.ts → dist/es2015/filter-group.component.d.ts} +2 -7
- package/dist/es2015/filter-group.component.js +145 -0
- package/{filter.component.d.ts → dist/es2015/filter.component.d.ts} +2 -7
- package/{esm2015 → dist/es2015}/filter.component.js +34 -151
- package/dist/es2015/filter.module.d.ts +37 -0
- package/dist/es2015/filter.module.js +88 -0
- package/{filter.service.d.ts → dist/es2015/filter.service.d.ts} +0 -3
- package/{esm2015 → dist/es2015}/filter.service.js +10 -8
- package/{main.d.ts → dist/es2015/index.d.ts} +8 -4
- package/dist/es2015/index.js +21 -0
- package/dist/es2015/index.metadata.json +1 -0
- package/{localization → dist/es2015/localization}/custom-messages.component.d.ts +1 -4
- package/dist/es2015/localization/custom-messages.component.js +36 -0
- package/{localization → dist/es2015/localization}/localized-messages.directive.d.ts +0 -3
- package/dist/es2015/localization/localized-messages.directive.js +31 -0
- package/{localization → dist/es2015/localization}/messages.d.ts +0 -3
- package/dist/es2015/localization/messages.js +160 -0
- package/dist/es2015/main.d.ts +7 -0
- package/dist/es2015/main.js +6 -0
- package/{model → dist/es2015/model}/filter-expression.d.ts +0 -0
- package/{esm2015/kendo-angular-filter.js → dist/es2015/model/filter-expression.js} +1 -2
- package/{package-metadata.d.ts → dist/es2015/package-metadata.d.ts} +0 -0
- package/{esm2015 → dist/es2015}/package-metadata.js +1 -1
- package/{kendo-angular-filter.d.ts → dist/es2015/shared.module.d.ts} +3 -3
- package/dist/es2015/shared.module.js +32 -0
- package/dist/es2015/util.d.ts +147 -0
- package/{esm2015 → dist/es2015}/util.js +3 -3
- package/dist/fesm2015/index.js +1316 -0
- package/dist/fesm5/index.js +1076 -0
- package/dist/npm/aria-label.directive.js +32 -0
- package/dist/npm/editors/boolean-editor.component.js +63 -0
- package/dist/npm/editors/date-editor.component.js +47 -0
- package/dist/npm/editors/numeric-editor.component.js +47 -0
- package/dist/npm/editors/text-editor.component.js +47 -0
- package/dist/npm/filter-expression-operators.component.js +50 -0
- package/dist/npm/filter-expression.component.js +138 -0
- package/dist/npm/filter-group.component.js +86 -0
- package/dist/npm/filter.component.js +187 -0
- package/dist/npm/filter.module.js +93 -0
- package/dist/npm/filter.service.js +47 -0
- package/dist/npm/index.js +37 -0
- package/dist/npm/localization/custom-messages.component.js +46 -0
- package/dist/npm/localization/localized-messages.directive.js +37 -0
- package/dist/npm/localization/messages.js +168 -0
- package/dist/npm/main.js +10 -0
- package/dist/npm/model/filter-expression.js +9 -0
- package/dist/npm/package-metadata.js +17 -0
- package/dist/npm/shared.module.js +37 -0
- package/dist/npm/util.js +138 -0
- package/dist/systemjs/kendo-angular-filter.js +5 -0
- package/package.json +109 -38
- package/schematics/ngAdd/index.js +2 -5
- package/schematics/ngAdd/index.js.map +1 -1
- package/bundles/kendo-angular-filter.umd.js +0 -5
- package/esm2015/aria-label.directive.js +0 -28
- package/esm2015/editors/boolean-editor.component.js +0 -84
- package/esm2015/editors/date-editor.component.js +0 -67
- package/esm2015/editors/numeric-editor.component.js +0 -67
- package/esm2015/editors/text-editor.component.js +0 -59
- package/esm2015/filter-expression-operators.component.js +0 -68
- package/esm2015/filter-group.component.js +0 -206
- package/esm2015/filter.module.js +0 -117
- package/esm2015/localization/custom-messages.component.js +0 -41
- package/esm2015/localization/localized-messages.directive.js +0 -36
- package/esm2015/localization/messages.js +0 -95
- package/esm2015/shared.module.js +0 -50
- package/fesm2015/kendo-angular-filter.js +0 -1622
- package/filter.module.d.ts +0 -53
- package/shared.module.d.ts +0 -19
- package/util.d.ts +0 -147
|
@@ -0,0 +1,56 @@
|
|
|
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 * as tslib_1 from "tslib";
|
|
6
|
+
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
7
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
8
|
+
import { FilterService } from '../filter.service';
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
let FilterNumericEditorComponent = class FilterNumericEditorComponent {
|
|
13
|
+
constructor(localization, filterService) {
|
|
14
|
+
this.localization = localization;
|
|
15
|
+
this.filterService = filterService;
|
|
16
|
+
this.valueChange = new EventEmitter();
|
|
17
|
+
}
|
|
18
|
+
messageFor(key) {
|
|
19
|
+
return this.localization.get(key);
|
|
20
|
+
}
|
|
21
|
+
isDisabled() {
|
|
22
|
+
const isDisabled = this.filterService.isEditorDisabled;
|
|
23
|
+
if (isDisabled) {
|
|
24
|
+
this.currentItem.value = null;
|
|
25
|
+
}
|
|
26
|
+
return isDisabled;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
tslib_1.__decorate([
|
|
30
|
+
Input(),
|
|
31
|
+
tslib_1.__metadata("design:type", Object)
|
|
32
|
+
], FilterNumericEditorComponent.prototype, "currentItem", void 0);
|
|
33
|
+
tslib_1.__decorate([
|
|
34
|
+
Output(),
|
|
35
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
36
|
+
], FilterNumericEditorComponent.prototype, "valueChange", void 0);
|
|
37
|
+
FilterNumericEditorComponent = tslib_1.__decorate([
|
|
38
|
+
Component({
|
|
39
|
+
selector: 'kendo-filter-numeric-editor',
|
|
40
|
+
template: `
|
|
41
|
+
<kendo-numerictextbox
|
|
42
|
+
[kendoAriaLabelValue]="messageFor('filterValueAriaLabel')"
|
|
43
|
+
class="k-filter-toolbar-item k-filter-value"
|
|
44
|
+
[(value)]="currentItem.value"
|
|
45
|
+
(valueChange)="valueChange.emit()"
|
|
46
|
+
[disabled]="isDisabled()">
|
|
47
|
+
<kendo-numerictextbox-messages
|
|
48
|
+
[increment]="messageFor('editorNumericIncrement')"
|
|
49
|
+
[decrement]="messageFor('editorNumericDecrement')">
|
|
50
|
+
</kendo-numerictextbox-messages>
|
|
51
|
+
</kendo-numerictextbox>
|
|
52
|
+
`
|
|
53
|
+
}),
|
|
54
|
+
tslib_1.__metadata("design:paramtypes", [LocalizationService, FilterService])
|
|
55
|
+
], FilterNumericEditorComponent);
|
|
56
|
+
export { FilterNumericEditorComponent };
|
|
@@ -6,7 +6,6 @@ import { EventEmitter } from '@angular/core';
|
|
|
6
6
|
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
7
7
|
import { FilterDescriptor } from '@progress/kendo-data-query';
|
|
8
8
|
import { FilterService } from '../filter.service';
|
|
9
|
-
import * as i0 from "@angular/core";
|
|
10
9
|
/**
|
|
11
10
|
* @hidden
|
|
12
11
|
*/
|
|
@@ -18,6 +17,4 @@ export declare class FilterTextEditorComponent {
|
|
|
18
17
|
constructor(localization: LocalizationService, filterService: FilterService);
|
|
19
18
|
isDisabled(): boolean;
|
|
20
19
|
messageFor(key: string): string;
|
|
21
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FilterTextEditorComponent, never>;
|
|
22
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FilterTextEditorComponent, "kendo-filter-text-editor", never, { "currentItem": "currentItem"; }, { "valueChange": "valueChange"; }, never, never>;
|
|
23
20
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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 * as tslib_1 from "tslib";
|
|
6
|
+
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
7
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
8
|
+
import { FilterService } from '../filter.service';
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
let FilterTextEditorComponent = class FilterTextEditorComponent {
|
|
13
|
+
constructor(localization, filterService) {
|
|
14
|
+
this.localization = localization;
|
|
15
|
+
this.filterService = filterService;
|
|
16
|
+
this.valueChange = new EventEmitter();
|
|
17
|
+
}
|
|
18
|
+
isDisabled() {
|
|
19
|
+
const isDisabled = this.filterService.isEditorDisabled;
|
|
20
|
+
if (isDisabled) {
|
|
21
|
+
this.currentItem.value = null;
|
|
22
|
+
}
|
|
23
|
+
return isDisabled;
|
|
24
|
+
}
|
|
25
|
+
messageFor(key) {
|
|
26
|
+
return this.localization.get(key);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
tslib_1.__decorate([
|
|
30
|
+
Input(),
|
|
31
|
+
tslib_1.__metadata("design:type", Object)
|
|
32
|
+
], FilterTextEditorComponent.prototype, "currentItem", void 0);
|
|
33
|
+
tslib_1.__decorate([
|
|
34
|
+
Output(),
|
|
35
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
36
|
+
], FilterTextEditorComponent.prototype, "valueChange", void 0);
|
|
37
|
+
FilterTextEditorComponent = tslib_1.__decorate([
|
|
38
|
+
Component({
|
|
39
|
+
selector: 'kendo-filter-text-editor',
|
|
40
|
+
template: `
|
|
41
|
+
<kendo-textbox
|
|
42
|
+
[kendoAriaLabelValue]="messageFor('filterValueAriaLabel')"
|
|
43
|
+
class="k-filter-toolbar-item k-filter-value"
|
|
44
|
+
[(value)]="currentItem.value"
|
|
45
|
+
(valueChange)="valueChange.emit()"
|
|
46
|
+
[disabled]="isDisabled()">
|
|
47
|
+
</kendo-textbox>
|
|
48
|
+
`
|
|
49
|
+
}),
|
|
50
|
+
tslib_1.__metadata("design:paramtypes", [LocalizationService, FilterService])
|
|
51
|
+
], FilterTextEditorComponent);
|
|
52
|
+
export { FilterTextEditorComponent };
|
|
@@ -6,7 +6,6 @@ import { EventEmitter } from '@angular/core';
|
|
|
6
6
|
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
7
7
|
import { FilterDescriptor } from '@progress/kendo-data-query';
|
|
8
8
|
import { FilterService } from './filter.service';
|
|
9
|
-
import * as i0 from "@angular/core";
|
|
10
9
|
/**
|
|
11
10
|
* @hidden
|
|
12
11
|
*/
|
|
@@ -22,6 +21,4 @@ export declare class FilterExpressionOperatorsComponent {
|
|
|
22
21
|
constructor(filterService: FilterService, localization: LocalizationService);
|
|
23
22
|
messageFor(key: string): string;
|
|
24
23
|
operatorValueChange(value: string): void;
|
|
25
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FilterExpressionOperatorsComponent, never>;
|
|
26
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FilterExpressionOperatorsComponent, "kendo-filter-expression-operators", never, { "currentItem": "currentItem"; "operators": "operators"; }, { "valueChange": "valueChange"; }, never, never>;
|
|
27
24
|
}
|
|
@@ -0,0 +1,59 @@
|
|
|
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 * as tslib_1 from "tslib";
|
|
6
|
+
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
7
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
8
|
+
import { FilterService } from './filter.service';
|
|
9
|
+
import { nullOperators } from './util';
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
let FilterExpressionOperatorsComponent = class FilterExpressionOperatorsComponent {
|
|
14
|
+
constructor(filterService, localization) {
|
|
15
|
+
this.filterService = filterService;
|
|
16
|
+
this.localization = localization;
|
|
17
|
+
this.valueChange = new EventEmitter();
|
|
18
|
+
this.operators = [];
|
|
19
|
+
}
|
|
20
|
+
messageFor(key) {
|
|
21
|
+
return this.localization.get(key);
|
|
22
|
+
}
|
|
23
|
+
operatorValueChange(value) {
|
|
24
|
+
this.valueChange.emit();
|
|
25
|
+
this.filterService.isEditorDisabled = nullOperators.indexOf(value) >= 0;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
tslib_1.__decorate([
|
|
29
|
+
Input(),
|
|
30
|
+
tslib_1.__metadata("design:type", Object)
|
|
31
|
+
], FilterExpressionOperatorsComponent.prototype, "currentItem", void 0);
|
|
32
|
+
tslib_1.__decorate([
|
|
33
|
+
Output(),
|
|
34
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
35
|
+
], FilterExpressionOperatorsComponent.prototype, "valueChange", void 0);
|
|
36
|
+
tslib_1.__decorate([
|
|
37
|
+
Input(),
|
|
38
|
+
tslib_1.__metadata("design:type", Array)
|
|
39
|
+
], FilterExpressionOperatorsComponent.prototype, "operators", void 0);
|
|
40
|
+
FilterExpressionOperatorsComponent = tslib_1.__decorate([
|
|
41
|
+
Component({
|
|
42
|
+
selector: 'kendo-filter-expression-operators',
|
|
43
|
+
template: `
|
|
44
|
+
<kendo-dropdownlist
|
|
45
|
+
[kendoAriaLabelValue]="messageFor('filterOperatorAriaLabel')"
|
|
46
|
+
[data]="operators"
|
|
47
|
+
[title]="messageFor('filterExpressionOperators')"
|
|
48
|
+
[(value)]="currentItem.operator"
|
|
49
|
+
(valueChange)="operatorValueChange($event)"
|
|
50
|
+
[valuePrimitive]="true"
|
|
51
|
+
textField="text"
|
|
52
|
+
valueField="value"
|
|
53
|
+
>
|
|
54
|
+
</kendo-dropdownlist>
|
|
55
|
+
`
|
|
56
|
+
}),
|
|
57
|
+
tslib_1.__metadata("design:paramtypes", [FilterService, LocalizationService])
|
|
58
|
+
], FilterExpressionOperatorsComponent);
|
|
59
|
+
export { FilterExpressionOperatorsComponent };
|
|
@@ -4,11 +4,9 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { ChangeDetectorRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
6
6
|
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
7
|
-
import { CompositeFilterDescriptor } from '@progress/kendo-data-query';
|
|
8
7
|
import { FilterDescriptor } from '@progress/kendo-data-query';
|
|
9
8
|
import { FilterService } from './filter.service';
|
|
10
9
|
import { FilterEditor, FilterExpression, FilterOperator } from './model/filter-expression';
|
|
11
|
-
import * as i0 from "@angular/core";
|
|
12
10
|
/**
|
|
13
11
|
* @hidden
|
|
14
12
|
*/
|
|
@@ -16,7 +14,6 @@ export declare class FilterExpressionComponent implements OnInit, OnDestroy {
|
|
|
16
14
|
private filterService;
|
|
17
15
|
protected localization: LocalizationService;
|
|
18
16
|
private cdr;
|
|
19
|
-
static ngAcceptInputType_currentItem: FilterDescriptor | CompositeFilterDescriptor;
|
|
20
17
|
index: number;
|
|
21
18
|
currentItem: FilterDescriptor;
|
|
22
19
|
valueChange: EventEmitter<void>;
|
|
@@ -43,6 +40,4 @@ export declare class FilterExpressionComponent implements OnInit, OnDestroy {
|
|
|
43
40
|
getEditorType(): FilterEditor;
|
|
44
41
|
removeFilterExpression(): void;
|
|
45
42
|
private setOperators;
|
|
46
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FilterExpressionComponent, never>;
|
|
47
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FilterExpressionComponent, "kendo-filter-expression", never, { "index": "index"; "currentItem": "currentItem"; }, { "valueChange": "valueChange"; }, never, never>;
|
|
48
43
|
}
|
|
@@ -2,24 +2,15 @@
|
|
|
2
2
|
* Copyright © 2021 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
|
|
5
|
+
import * as tslib_1 from "tslib";
|
|
6
|
+
import { ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angular/core';
|
|
7
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
8
|
+
import { FilterService } from './filter.service';
|
|
6
9
|
import { defaultDateOperators, defaultNumericOperators, defaultOperators, defaultStringOperators, getKeyByValue, isFilterEditor, localizeOperators } from './util';
|
|
7
|
-
import * as i0 from "@angular/core";
|
|
8
|
-
import * as i1 from "./filter.service";
|
|
9
|
-
import * as i2 from "@progress/kendo-angular-l10n";
|
|
10
|
-
import * as i3 from "@progress/kendo-angular-dropdowns";
|
|
11
|
-
import * as i4 from "./filter-expression-operators.component";
|
|
12
|
-
import * as i5 from "./editors/text-editor.component";
|
|
13
|
-
import * as i6 from "./editors/numeric-editor.component";
|
|
14
|
-
import * as i7 from "./editors/boolean-editor.component";
|
|
15
|
-
import * as i8 from "./editors/date-editor.component";
|
|
16
|
-
import * as i9 from "./aria-label.directive";
|
|
17
|
-
import * as i10 from "@angular/common";
|
|
18
|
-
import * as i11 from "@progress/kendo-angular-buttons";
|
|
19
10
|
/**
|
|
20
11
|
* @hidden
|
|
21
12
|
*/
|
|
22
|
-
|
|
13
|
+
let FilterExpressionComponent = class FilterExpressionComponent {
|
|
23
14
|
constructor(filterService, localization, cdr) {
|
|
24
15
|
this.filterService = filterService;
|
|
25
16
|
this.localization = localization;
|
|
@@ -119,55 +110,23 @@ export class FilterExpressionComponent {
|
|
|
119
110
|
}
|
|
120
111
|
}
|
|
121
112
|
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
<div *ngIf="!isBoolean" class="k-filter-toolbar-item k-filter-operator">
|
|
140
|
-
<kendo-filter-expression-operators
|
|
141
|
-
[currentItem]="currentItem"
|
|
142
|
-
[operators]="operators"
|
|
143
|
-
(valueChange)="valueChange.emit();">
|
|
144
|
-
</kendo-filter-expression-operators>
|
|
145
|
-
</div>
|
|
146
|
-
|
|
147
|
-
<ng-container [ngSwitch]="getEditorType()">
|
|
148
|
-
<kendo-filter-text-editor *ngSwitchCase="'string'" [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-text-editor>
|
|
149
|
-
<kendo-filter-numeric-editor *ngSwitchCase="'number'" [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-numeric-editor>
|
|
150
|
-
<kendo-filter-boolean-editor *ngSwitchCase="'boolean'" [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-boolean-editor>
|
|
151
|
-
<kendo-filter-date-editor *ngSwitchCase="'date'" [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-date-editor>
|
|
152
|
-
</ng-container>
|
|
153
|
-
|
|
154
|
-
<div class="k-filter-toolbar-item">
|
|
155
|
-
<button
|
|
156
|
-
kendoButton
|
|
157
|
-
icon="close"
|
|
158
|
-
fillMode="flat"
|
|
159
|
-
[title]="messageFor('remove')"
|
|
160
|
-
(click)="removeFilterExpression()">
|
|
161
|
-
</button>
|
|
162
|
-
</div>
|
|
163
|
-
</div>
|
|
164
|
-
</div>
|
|
165
|
-
`, isInline: true, components: [{ type: i3.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"] }, { type: i4.FilterExpressionOperatorsComponent, selector: "kendo-filter-expression-operators", inputs: ["currentItem", "operators"], outputs: ["valueChange"] }, { type: i5.FilterTextEditorComponent, selector: "kendo-filter-text-editor", inputs: ["currentItem"], outputs: ["valueChange"] }, { type: i6.FilterNumericEditorComponent, selector: "kendo-filter-numeric-editor", inputs: ["currentItem"], outputs: ["valueChange"] }, { type: i7.FilterBooleanEditorComponent, selector: "kendo-filter-boolean-editor", inputs: ["currentItem"], outputs: ["valueChange"] }, { type: i8.FilterDateEditorComponent, selector: "kendo-filter-date-editor", inputs: ["currentItem"], outputs: ["valueChange"] }], directives: [{ type: i9.AriaLabelValueDirective, selector: "[kendoAriaLabelValue]", inputs: ["kendoAriaLabelValue"] }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i10.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i11.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "shape", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }] });
|
|
166
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterExpressionComponent, decorators: [{
|
|
167
|
-
type: Component,
|
|
168
|
-
args: [{
|
|
169
|
-
selector: 'kendo-filter-expression',
|
|
170
|
-
template: `
|
|
113
|
+
};
|
|
114
|
+
tslib_1.__decorate([
|
|
115
|
+
Input(),
|
|
116
|
+
tslib_1.__metadata("design:type", Number)
|
|
117
|
+
], FilterExpressionComponent.prototype, "index", void 0);
|
|
118
|
+
tslib_1.__decorate([
|
|
119
|
+
Input(),
|
|
120
|
+
tslib_1.__metadata("design:type", Object)
|
|
121
|
+
], FilterExpressionComponent.prototype, "currentItem", void 0);
|
|
122
|
+
tslib_1.__decorate([
|
|
123
|
+
Output(),
|
|
124
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
125
|
+
], FilterExpressionComponent.prototype, "valueChange", void 0);
|
|
126
|
+
FilterExpressionComponent = tslib_1.__decorate([
|
|
127
|
+
Component({
|
|
128
|
+
selector: 'kendo-filter-expression',
|
|
129
|
+
template: `
|
|
171
130
|
<div class="k-filter-toolbar" role="group" [attr.aria-label]="messageFor('filterAriaLabel')">
|
|
172
131
|
<div class="k-toolbar">
|
|
173
132
|
<div class="k-filter-toolbar-item k-filter-field">
|
|
@@ -209,11 +168,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
209
168
|
</div>
|
|
210
169
|
</div>
|
|
211
170
|
`
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
type: Input
|
|
217
|
-
}], valueChange: [{
|
|
218
|
-
type: Output
|
|
219
|
-
}] } });
|
|
171
|
+
}),
|
|
172
|
+
tslib_1.__metadata("design:paramtypes", [FilterService, LocalizationService, ChangeDetectorRef])
|
|
173
|
+
], FilterExpressionComponent);
|
|
174
|
+
export { FilterExpressionComponent };
|
|
@@ -4,10 +4,8 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { ChangeDetectorRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
6
6
|
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
7
|
-
import { FilterDescriptor } from '@progress/kendo-data-query';
|
|
8
7
|
import { CompositeFilterDescriptor } from '@progress/kendo-data-query';
|
|
9
8
|
import { FilterService } from './filter.service';
|
|
10
|
-
import * as i0 from "@angular/core";
|
|
11
9
|
/**
|
|
12
10
|
* @hidden
|
|
13
11
|
*/
|
|
@@ -15,13 +13,12 @@ export declare class FilterGroupComponent implements OnInit, OnDestroy {
|
|
|
15
13
|
private filterService;
|
|
16
14
|
localization: LocalizationService;
|
|
17
15
|
private cdr;
|
|
18
|
-
static ngAcceptInputType_currentItem: FilterDescriptor | CompositeFilterDescriptor;
|
|
19
16
|
index: number;
|
|
20
17
|
currentItem: CompositeFilterDescriptor;
|
|
21
18
|
valueChange: EventEmitter<void>;
|
|
22
19
|
operators: {
|
|
23
20
|
text: string;
|
|
24
|
-
value:
|
|
21
|
+
value: string;
|
|
25
22
|
}[];
|
|
26
23
|
private localizationSubscription;
|
|
27
24
|
constructor(filterService: FilterService, localization: LocalizationService, cdr: ChangeDetectorRef);
|
|
@@ -29,13 +26,11 @@ export declare class FilterGroupComponent implements OnInit, OnDestroy {
|
|
|
29
26
|
ngOnDestroy(): void;
|
|
30
27
|
getLogicOperators(): {
|
|
31
28
|
text: string;
|
|
32
|
-
value:
|
|
29
|
+
value: string;
|
|
33
30
|
}[];
|
|
34
31
|
messageFor(key: string): string;
|
|
35
32
|
selectedChange(logicOperator: 'or' | 'and'): void;
|
|
36
33
|
addFilterExpression(): void;
|
|
37
34
|
addFilterGroup(): void;
|
|
38
35
|
removeFilterGroup(): void;
|
|
39
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FilterGroupComponent, never>;
|
|
40
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FilterGroupComponent, "kendo-filter-group", never, { "index": "index"; "currentItem": "currentItem"; }, { "valueChange": "valueChange"; }, never, never>;
|
|
41
36
|
}
|
|
@@ -0,0 +1,145 @@
|
|
|
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 * as tslib_1 from "tslib";
|
|
6
|
+
import { ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angular/core';
|
|
7
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
8
|
+
import { FilterService } from './filter.service';
|
|
9
|
+
import { localizeOperators, logicOperators } from './util';
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
let FilterGroupComponent = class FilterGroupComponent {
|
|
14
|
+
constructor(filterService, localization, cdr) {
|
|
15
|
+
this.filterService = filterService;
|
|
16
|
+
this.localization = localization;
|
|
17
|
+
this.cdr = cdr;
|
|
18
|
+
this.index = 0;
|
|
19
|
+
this.currentItem = {
|
|
20
|
+
logic: 'or',
|
|
21
|
+
filters: []
|
|
22
|
+
};
|
|
23
|
+
this.valueChange = new EventEmitter();
|
|
24
|
+
this.operators = [];
|
|
25
|
+
}
|
|
26
|
+
ngOnInit() {
|
|
27
|
+
this.operators = this.getLogicOperators();
|
|
28
|
+
this.localizationSubscription = this.localization.changes.subscribe(() => {
|
|
29
|
+
this.operators = this.getLogicOperators();
|
|
30
|
+
this.cdr.detectChanges();
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
ngOnDestroy() {
|
|
34
|
+
if (this.localizationSubscription) {
|
|
35
|
+
this.localizationSubscription.unsubscribe();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
getLogicOperators() {
|
|
39
|
+
return localizeOperators(logicOperators)(this.localization);
|
|
40
|
+
}
|
|
41
|
+
messageFor(key) {
|
|
42
|
+
return this.localization.get(key);
|
|
43
|
+
}
|
|
44
|
+
selectedChange(logicOperator) {
|
|
45
|
+
if (this.currentItem.logic !== logicOperator) {
|
|
46
|
+
this.currentItem.logic = logicOperator;
|
|
47
|
+
this.valueChange.emit();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
addFilterExpression() {
|
|
51
|
+
this.filterService.addFilterExpression(this.currentItem);
|
|
52
|
+
this.valueChange.emit();
|
|
53
|
+
}
|
|
54
|
+
addFilterGroup() {
|
|
55
|
+
this.filterService.addFilterGroup(this.currentItem);
|
|
56
|
+
this.valueChange.emit();
|
|
57
|
+
}
|
|
58
|
+
removeFilterGroup() {
|
|
59
|
+
this.filterService.remove(this.currentItem, this.index);
|
|
60
|
+
this.valueChange.emit();
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
tslib_1.__decorate([
|
|
64
|
+
Input(),
|
|
65
|
+
tslib_1.__metadata("design:type", Number)
|
|
66
|
+
], FilterGroupComponent.prototype, "index", void 0);
|
|
67
|
+
tslib_1.__decorate([
|
|
68
|
+
Input(),
|
|
69
|
+
tslib_1.__metadata("design:type", Object)
|
|
70
|
+
], FilterGroupComponent.prototype, "currentItem", void 0);
|
|
71
|
+
tslib_1.__decorate([
|
|
72
|
+
Output(),
|
|
73
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
74
|
+
], FilterGroupComponent.prototype, "valueChange", void 0);
|
|
75
|
+
FilterGroupComponent = tslib_1.__decorate([
|
|
76
|
+
Component({
|
|
77
|
+
selector: 'kendo-filter-group',
|
|
78
|
+
template: `
|
|
79
|
+
<div class="k-filter-toolbar" role="toolbar" [attr.aria-label]="messageFor('filterToolbarAriaLabel')">
|
|
80
|
+
<div class="k-toolbar">
|
|
81
|
+
<div class="k-filter-toolbar-item">
|
|
82
|
+
<div class="k-widget k-button-group" role="group">
|
|
83
|
+
<button
|
|
84
|
+
*ngFor="let operator of operators"
|
|
85
|
+
kendoButton
|
|
86
|
+
[ngClass]="{'k-group-start': operator.value === 'and', 'k-group-end': operator.value === 'or'}"
|
|
87
|
+
[selected]="currentItem.logic === operator.value"
|
|
88
|
+
[title]="operator.text"
|
|
89
|
+
(click)="selectedChange(operator.value)"
|
|
90
|
+
>
|
|
91
|
+
{{operator.text}}
|
|
92
|
+
</button>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
<div class="k-filter-toolbar-item">
|
|
96
|
+
<button
|
|
97
|
+
kendoButton
|
|
98
|
+
[title]="messageFor('addFilter')"
|
|
99
|
+
icon="filter-add-expression"
|
|
100
|
+
(click)="addFilterExpression()">
|
|
101
|
+
{{messageFor('addFilter')}}
|
|
102
|
+
</button>
|
|
103
|
+
</div>
|
|
104
|
+
<div class="k-filter-toolbar-item">
|
|
105
|
+
<button
|
|
106
|
+
kendoButton
|
|
107
|
+
[title]="messageFor('addGroup')"
|
|
108
|
+
icon="filter-add-group"
|
|
109
|
+
(click)="addFilterGroup()">
|
|
110
|
+
{{messageFor('addGroup')}}
|
|
111
|
+
</button>
|
|
112
|
+
</div>
|
|
113
|
+
<div class="k-filter-toolbar-item">
|
|
114
|
+
<button
|
|
115
|
+
kendoButton
|
|
116
|
+
icon="close"
|
|
117
|
+
fillMode="flat"
|
|
118
|
+
[title]="messageFor('remove')"
|
|
119
|
+
(click)="removeFilterGroup()">
|
|
120
|
+
</button>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
<ul class="k-filter-lines" *ngIf="currentItem.filters">
|
|
126
|
+
<ng-container *ngFor="let item of currentItem.filters; let i = index;">
|
|
127
|
+
<li class="k-filter-item" *ngIf="!item.filters">
|
|
128
|
+
<kendo-filter-expression (valueChange)="valueChange.emit()" [currentItem]="item" [index]="i">
|
|
129
|
+
</kendo-filter-expression>
|
|
130
|
+
</li>
|
|
131
|
+
<li class="k-filter-item" *ngIf="item.filters" >
|
|
132
|
+
<kendo-filter-group
|
|
133
|
+
(valueChange)="valueChange.emit()"
|
|
134
|
+
[currentItem]="item"
|
|
135
|
+
[index]="i"
|
|
136
|
+
>
|
|
137
|
+
</kendo-filter-group>
|
|
138
|
+
</li>
|
|
139
|
+
</ng-container>
|
|
140
|
+
</ul>
|
|
141
|
+
`
|
|
142
|
+
}),
|
|
143
|
+
tslib_1.__metadata("design:paramtypes", [FilterService, LocalizationService, ChangeDetectorRef])
|
|
144
|
+
], FilterGroupComponent);
|
|
145
|
+
export { FilterGroupComponent };
|
|
@@ -10,7 +10,6 @@ import { FilterExpression } from './model/filter-expression';
|
|
|
10
10
|
import { Direction } from './util';
|
|
11
11
|
import { ChangeDetectorRef } from '@angular/core';
|
|
12
12
|
import { OnDestroy } from '@angular/core';
|
|
13
|
-
import * as i0 from "@angular/core";
|
|
14
13
|
/**
|
|
15
14
|
* Represents the [Kendo UI Filter component for Angular]({% slug overview_filter %}).
|
|
16
15
|
* The Filter component can be used to apply any user defined filter criteria.
|
|
@@ -51,13 +50,11 @@ export declare class FilterComponent implements OnInit, OnDestroy {
|
|
|
51
50
|
/**
|
|
52
51
|
* Specifies the available user-defined filters. At least one filter should be provided.
|
|
53
52
|
*/
|
|
54
|
-
|
|
55
|
-
get filters(): FilterExpression[];
|
|
53
|
+
filters: FilterExpression[];
|
|
56
54
|
/**
|
|
57
55
|
* Sets the initial `value` of the Filter component.
|
|
58
56
|
*/
|
|
59
|
-
|
|
60
|
-
get value(): CompositeFilterDescriptor;
|
|
57
|
+
value: CompositeFilterDescriptor;
|
|
61
58
|
/**
|
|
62
59
|
* Fires every time the Filter component value is updated.
|
|
63
60
|
* That is each time a Filter Group or Filter Expression is added, removed, or updated.
|
|
@@ -77,6 +74,4 @@ export declare class FilterComponent implements OnInit, OnDestroy {
|
|
|
77
74
|
onValueChange(): void;
|
|
78
75
|
private normalizeFilter;
|
|
79
76
|
private normalizeValue;
|
|
80
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FilterComponent, never>;
|
|
81
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FilterComponent, "kendo-filter", never, { "filters": "filters"; "value": "value"; }, { "valueChange": "valueChange"; }, never, never>;
|
|
82
77
|
}
|