@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,32 @@
|
|
|
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
|
+
"use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
var tslib_1 = require("tslib");
|
|
8
|
+
var core_1 = require("@angular/core");
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
var AriaLabelValueDirective = /** @class */ (function () {
|
|
13
|
+
function AriaLabelValueDirective(hostElement, renderer) {
|
|
14
|
+
this.hostElement = hostElement;
|
|
15
|
+
this.renderer = renderer;
|
|
16
|
+
}
|
|
17
|
+
AriaLabelValueDirective.prototype.ngOnChanges = function () {
|
|
18
|
+
var target = this.hostElement.nativeElement.querySelector('input') || this.hostElement.nativeElement;
|
|
19
|
+
this.renderer.setAttribute(target, 'aria-label', this.ariaLabel);
|
|
20
|
+
};
|
|
21
|
+
tslib_1.__decorate([
|
|
22
|
+
core_1.Input('kendoAriaLabelValue'),
|
|
23
|
+
tslib_1.__metadata("design:type", String)
|
|
24
|
+
], AriaLabelValueDirective.prototype, "ariaLabel", void 0);
|
|
25
|
+
AriaLabelValueDirective = tslib_1.__decorate([
|
|
26
|
+
core_1.Directive({ selector: '[kendoAriaLabelValue]' }),
|
|
27
|
+
tslib_1.__metadata("design:paramtypes", [core_1.ElementRef,
|
|
28
|
+
core_1.Renderer2])
|
|
29
|
+
], AriaLabelValueDirective);
|
|
30
|
+
return AriaLabelValueDirective;
|
|
31
|
+
}());
|
|
32
|
+
exports.AriaLabelValueDirective = AriaLabelValueDirective;
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
"use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
var tslib_1 = require("tslib");
|
|
8
|
+
var core_1 = require("@angular/core");
|
|
9
|
+
var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
var FilterBooleanEditorComponent = /** @class */ (function () {
|
|
14
|
+
function FilterBooleanEditorComponent(localization, cdr) {
|
|
15
|
+
this.localization = localization;
|
|
16
|
+
this.cdr = cdr;
|
|
17
|
+
this.valueChange = new core_1.EventEmitter();
|
|
18
|
+
this.items = this.getValueItems();
|
|
19
|
+
this.defaultItem = this.getDefaultItem();
|
|
20
|
+
}
|
|
21
|
+
FilterBooleanEditorComponent.prototype.ngOnInit = function () {
|
|
22
|
+
var _this = this;
|
|
23
|
+
this.localizationSubscription = this.localization.changes.subscribe(function () {
|
|
24
|
+
_this.defaultItem = _this.getDefaultItem();
|
|
25
|
+
_this.items = _this.getValueItems();
|
|
26
|
+
_this.cdr.detectChanges();
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
FilterBooleanEditorComponent.prototype.getDefaultItem = function () {
|
|
30
|
+
return { text: this.localization.get("filterBooleanAll"), value: null };
|
|
31
|
+
};
|
|
32
|
+
FilterBooleanEditorComponent.prototype.getValueItems = function () {
|
|
33
|
+
return [
|
|
34
|
+
{ text: this.localization.get("filterIsTrue"), value: true },
|
|
35
|
+
{ text: this.localization.get("filterIsFalse"), value: false }
|
|
36
|
+
];
|
|
37
|
+
};
|
|
38
|
+
FilterBooleanEditorComponent.prototype.ngOnDestroy = function () {
|
|
39
|
+
if (this.localizationSubscription) {
|
|
40
|
+
this.localizationSubscription.unsubscribe();
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
FilterBooleanEditorComponent.prototype.messageFor = function (key) {
|
|
44
|
+
return this.localization.get(key);
|
|
45
|
+
};
|
|
46
|
+
tslib_1.__decorate([
|
|
47
|
+
core_1.Input(),
|
|
48
|
+
tslib_1.__metadata("design:type", Object)
|
|
49
|
+
], FilterBooleanEditorComponent.prototype, "currentItem", void 0);
|
|
50
|
+
tslib_1.__decorate([
|
|
51
|
+
core_1.Output(),
|
|
52
|
+
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
53
|
+
], FilterBooleanEditorComponent.prototype, "valueChange", void 0);
|
|
54
|
+
FilterBooleanEditorComponent = tslib_1.__decorate([
|
|
55
|
+
core_1.Component({
|
|
56
|
+
selector: 'kendo-filter-boolean-editor',
|
|
57
|
+
template: "\n <kendo-dropdownlist\n [kendoAriaLabelValue]=\"messageFor('filterValueAriaLabel')\"\n class=\"k-filter-toolbar-item k-filter-value\"\n [(value)]=\"currentItem.value\"\n (valueChange)=\"valueChange.emit()\"\n [data]=\"items\"\n [defaultItem]=\"defaultItem\"\n [valuePrimitive]=\"true\"\n textField=\"text\"\n valueField=\"value\"\n >\n </kendo-dropdownlist>\n "
|
|
58
|
+
}),
|
|
59
|
+
tslib_1.__metadata("design:paramtypes", [kendo_angular_l10n_1.LocalizationService, core_1.ChangeDetectorRef])
|
|
60
|
+
], FilterBooleanEditorComponent);
|
|
61
|
+
return FilterBooleanEditorComponent;
|
|
62
|
+
}());
|
|
63
|
+
exports.FilterBooleanEditorComponent = FilterBooleanEditorComponent;
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
"use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
var tslib_1 = require("tslib");
|
|
8
|
+
var core_1 = require("@angular/core");
|
|
9
|
+
var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
|
|
10
|
+
var filter_service_1 = require("../filter.service");
|
|
11
|
+
/**
|
|
12
|
+
* @hidden
|
|
13
|
+
*/
|
|
14
|
+
var FilterDateEditorComponent = /** @class */ (function () {
|
|
15
|
+
function FilterDateEditorComponent(localization, filterService) {
|
|
16
|
+
this.localization = localization;
|
|
17
|
+
this.filterService = filterService;
|
|
18
|
+
this.valueChange = new core_1.EventEmitter();
|
|
19
|
+
}
|
|
20
|
+
FilterDateEditorComponent.prototype.messageFor = function (key) {
|
|
21
|
+
return this.localization.get(key);
|
|
22
|
+
};
|
|
23
|
+
FilterDateEditorComponent.prototype.isDisabled = function () {
|
|
24
|
+
var isDisabled = this.filterService.isEditorDisabled;
|
|
25
|
+
if (isDisabled) {
|
|
26
|
+
this.currentItem.value = null;
|
|
27
|
+
}
|
|
28
|
+
return isDisabled;
|
|
29
|
+
};
|
|
30
|
+
tslib_1.__decorate([
|
|
31
|
+
core_1.Input(),
|
|
32
|
+
tslib_1.__metadata("design:type", Object)
|
|
33
|
+
], FilterDateEditorComponent.prototype, "currentItem", void 0);
|
|
34
|
+
tslib_1.__decorate([
|
|
35
|
+
core_1.Output(),
|
|
36
|
+
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
37
|
+
], FilterDateEditorComponent.prototype, "valueChange", void 0);
|
|
38
|
+
FilterDateEditorComponent = tslib_1.__decorate([
|
|
39
|
+
core_1.Component({
|
|
40
|
+
selector: 'kendo-filter-date-editor',
|
|
41
|
+
template: "\n <kendo-datepicker\n [kendoAriaLabelValue]=\"messageFor('filterValueAriaLabel')\"\n class=\"k-filter-toolbar-item k-filter-value\"\n [(value)]=\"currentItem.value\"\n (valueChange)=\"valueChange.emit()\"\n [disabled]=\"isDisabled()\">\n <kendo-datepicker-messages\n [toggle]=\"messageFor('editorDateToggleText')\"\n [today]=\"messageFor('editorDateTodayText')\">\n </kendo-datepicker-messages>\n </kendo-datepicker>\n "
|
|
42
|
+
}),
|
|
43
|
+
tslib_1.__metadata("design:paramtypes", [kendo_angular_l10n_1.LocalizationService, filter_service_1.FilterService])
|
|
44
|
+
], FilterDateEditorComponent);
|
|
45
|
+
return FilterDateEditorComponent;
|
|
46
|
+
}());
|
|
47
|
+
exports.FilterDateEditorComponent = FilterDateEditorComponent;
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
"use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
var tslib_1 = require("tslib");
|
|
8
|
+
var core_1 = require("@angular/core");
|
|
9
|
+
var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
|
|
10
|
+
var filter_service_1 = require("../filter.service");
|
|
11
|
+
/**
|
|
12
|
+
* @hidden
|
|
13
|
+
*/
|
|
14
|
+
var FilterNumericEditorComponent = /** @class */ (function () {
|
|
15
|
+
function FilterNumericEditorComponent(localization, filterService) {
|
|
16
|
+
this.localization = localization;
|
|
17
|
+
this.filterService = filterService;
|
|
18
|
+
this.valueChange = new core_1.EventEmitter();
|
|
19
|
+
}
|
|
20
|
+
FilterNumericEditorComponent.prototype.messageFor = function (key) {
|
|
21
|
+
return this.localization.get(key);
|
|
22
|
+
};
|
|
23
|
+
FilterNumericEditorComponent.prototype.isDisabled = function () {
|
|
24
|
+
var isDisabled = this.filterService.isEditorDisabled;
|
|
25
|
+
if (isDisabled) {
|
|
26
|
+
this.currentItem.value = null;
|
|
27
|
+
}
|
|
28
|
+
return isDisabled;
|
|
29
|
+
};
|
|
30
|
+
tslib_1.__decorate([
|
|
31
|
+
core_1.Input(),
|
|
32
|
+
tslib_1.__metadata("design:type", Object)
|
|
33
|
+
], FilterNumericEditorComponent.prototype, "currentItem", void 0);
|
|
34
|
+
tslib_1.__decorate([
|
|
35
|
+
core_1.Output(),
|
|
36
|
+
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
37
|
+
], FilterNumericEditorComponent.prototype, "valueChange", void 0);
|
|
38
|
+
FilterNumericEditorComponent = tslib_1.__decorate([
|
|
39
|
+
core_1.Component({
|
|
40
|
+
selector: 'kendo-filter-numeric-editor',
|
|
41
|
+
template: "\n <kendo-numerictextbox\n [kendoAriaLabelValue]=\"messageFor('filterValueAriaLabel')\"\n class=\"k-filter-toolbar-item k-filter-value\"\n [(value)]=\"currentItem.value\"\n (valueChange)=\"valueChange.emit()\"\n [disabled]=\"isDisabled()\">\n <kendo-numerictextbox-messages\n [increment]=\"messageFor('editorNumericIncrement')\"\n [decrement]=\"messageFor('editorNumericDecrement')\">\n </kendo-numerictextbox-messages>\n </kendo-numerictextbox>\n "
|
|
42
|
+
}),
|
|
43
|
+
tslib_1.__metadata("design:paramtypes", [kendo_angular_l10n_1.LocalizationService, filter_service_1.FilterService])
|
|
44
|
+
], FilterNumericEditorComponent);
|
|
45
|
+
return FilterNumericEditorComponent;
|
|
46
|
+
}());
|
|
47
|
+
exports.FilterNumericEditorComponent = FilterNumericEditorComponent;
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
"use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
var tslib_1 = require("tslib");
|
|
8
|
+
var core_1 = require("@angular/core");
|
|
9
|
+
var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
|
|
10
|
+
var filter_service_1 = require("../filter.service");
|
|
11
|
+
/**
|
|
12
|
+
* @hidden
|
|
13
|
+
*/
|
|
14
|
+
var FilterTextEditorComponent = /** @class */ (function () {
|
|
15
|
+
function FilterTextEditorComponent(localization, filterService) {
|
|
16
|
+
this.localization = localization;
|
|
17
|
+
this.filterService = filterService;
|
|
18
|
+
this.valueChange = new core_1.EventEmitter();
|
|
19
|
+
}
|
|
20
|
+
FilterTextEditorComponent.prototype.isDisabled = function () {
|
|
21
|
+
var isDisabled = this.filterService.isEditorDisabled;
|
|
22
|
+
if (isDisabled) {
|
|
23
|
+
this.currentItem.value = null;
|
|
24
|
+
}
|
|
25
|
+
return isDisabled;
|
|
26
|
+
};
|
|
27
|
+
FilterTextEditorComponent.prototype.messageFor = function (key) {
|
|
28
|
+
return this.localization.get(key);
|
|
29
|
+
};
|
|
30
|
+
tslib_1.__decorate([
|
|
31
|
+
core_1.Input(),
|
|
32
|
+
tslib_1.__metadata("design:type", Object)
|
|
33
|
+
], FilterTextEditorComponent.prototype, "currentItem", void 0);
|
|
34
|
+
tslib_1.__decorate([
|
|
35
|
+
core_1.Output(),
|
|
36
|
+
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
37
|
+
], FilterTextEditorComponent.prototype, "valueChange", void 0);
|
|
38
|
+
FilterTextEditorComponent = tslib_1.__decorate([
|
|
39
|
+
core_1.Component({
|
|
40
|
+
selector: 'kendo-filter-text-editor',
|
|
41
|
+
template: "\n <kendo-textbox\n [kendoAriaLabelValue]=\"messageFor('filterValueAriaLabel')\"\n class=\"k-filter-toolbar-item k-filter-value\"\n [(value)]=\"currentItem.value\"\n (valueChange)=\"valueChange.emit()\"\n [disabled]=\"isDisabled()\">\n </kendo-textbox>\n "
|
|
42
|
+
}),
|
|
43
|
+
tslib_1.__metadata("design:paramtypes", [kendo_angular_l10n_1.LocalizationService, filter_service_1.FilterService])
|
|
44
|
+
], FilterTextEditorComponent);
|
|
45
|
+
return FilterTextEditorComponent;
|
|
46
|
+
}());
|
|
47
|
+
exports.FilterTextEditorComponent = FilterTextEditorComponent;
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
"use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
var tslib_1 = require("tslib");
|
|
8
|
+
var core_1 = require("@angular/core");
|
|
9
|
+
var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
|
|
10
|
+
var filter_service_1 = require("./filter.service");
|
|
11
|
+
var util_1 = require("./util");
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
var FilterExpressionOperatorsComponent = /** @class */ (function () {
|
|
16
|
+
function FilterExpressionOperatorsComponent(filterService, localization) {
|
|
17
|
+
this.filterService = filterService;
|
|
18
|
+
this.localization = localization;
|
|
19
|
+
this.valueChange = new core_1.EventEmitter();
|
|
20
|
+
this.operators = [];
|
|
21
|
+
}
|
|
22
|
+
FilterExpressionOperatorsComponent.prototype.messageFor = function (key) {
|
|
23
|
+
return this.localization.get(key);
|
|
24
|
+
};
|
|
25
|
+
FilterExpressionOperatorsComponent.prototype.operatorValueChange = function (value) {
|
|
26
|
+
this.valueChange.emit();
|
|
27
|
+
this.filterService.isEditorDisabled = util_1.nullOperators.indexOf(value) >= 0;
|
|
28
|
+
};
|
|
29
|
+
tslib_1.__decorate([
|
|
30
|
+
core_1.Input(),
|
|
31
|
+
tslib_1.__metadata("design:type", Object)
|
|
32
|
+
], FilterExpressionOperatorsComponent.prototype, "currentItem", void 0);
|
|
33
|
+
tslib_1.__decorate([
|
|
34
|
+
core_1.Output(),
|
|
35
|
+
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
36
|
+
], FilterExpressionOperatorsComponent.prototype, "valueChange", void 0);
|
|
37
|
+
tslib_1.__decorate([
|
|
38
|
+
core_1.Input(),
|
|
39
|
+
tslib_1.__metadata("design:type", Array)
|
|
40
|
+
], FilterExpressionOperatorsComponent.prototype, "operators", void 0);
|
|
41
|
+
FilterExpressionOperatorsComponent = tslib_1.__decorate([
|
|
42
|
+
core_1.Component({
|
|
43
|
+
selector: 'kendo-filter-expression-operators',
|
|
44
|
+
template: "\n <kendo-dropdownlist\n [kendoAriaLabelValue]=\"messageFor('filterOperatorAriaLabel')\"\n [data]=\"operators\"\n [title]=\"messageFor('filterExpressionOperators')\"\n [(value)]=\"currentItem.operator\"\n (valueChange)=\"operatorValueChange($event)\"\n [valuePrimitive]=\"true\"\n textField=\"text\"\n valueField=\"value\"\n >\n </kendo-dropdownlist>\n "
|
|
45
|
+
}),
|
|
46
|
+
tslib_1.__metadata("design:paramtypes", [filter_service_1.FilterService, kendo_angular_l10n_1.LocalizationService])
|
|
47
|
+
], FilterExpressionOperatorsComponent);
|
|
48
|
+
return FilterExpressionOperatorsComponent;
|
|
49
|
+
}());
|
|
50
|
+
exports.FilterExpressionOperatorsComponent = FilterExpressionOperatorsComponent;
|
|
@@ -0,0 +1,138 @@
|
|
|
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
|
+
"use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
var tslib_1 = require("tslib");
|
|
8
|
+
var core_1 = require("@angular/core");
|
|
9
|
+
var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
|
|
10
|
+
var filter_service_1 = require("./filter.service");
|
|
11
|
+
var util_1 = require("./util");
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
var FilterExpressionComponent = /** @class */ (function () {
|
|
16
|
+
function FilterExpressionComponent(filterService, localization, cdr) {
|
|
17
|
+
this.filterService = filterService;
|
|
18
|
+
this.localization = localization;
|
|
19
|
+
this.cdr = cdr;
|
|
20
|
+
this.valueChange = new core_1.EventEmitter();
|
|
21
|
+
this.operators = [];
|
|
22
|
+
this.filters = [];
|
|
23
|
+
this.isBoolean = false;
|
|
24
|
+
this.isEditorDisabled = false;
|
|
25
|
+
}
|
|
26
|
+
FilterExpressionComponent.prototype.ngOnInit = function () {
|
|
27
|
+
var _this = this;
|
|
28
|
+
this.filters = this.filterService.filters;
|
|
29
|
+
var foundFilter = this.getFilterExpressionByField(this.currentItem.field);
|
|
30
|
+
if (this.currentItem.field) {
|
|
31
|
+
this.setOperators(foundFilter);
|
|
32
|
+
}
|
|
33
|
+
var defaultFilter = this.getFilterExpressionByField(this.filterService.filters[0].field);
|
|
34
|
+
if (!this.currentItem.field) {
|
|
35
|
+
this.currentItem.field = this.filterService.filters[0].field;
|
|
36
|
+
this.setOperators(defaultFilter);
|
|
37
|
+
}
|
|
38
|
+
this.localizationSubscription = this.localization.changes.subscribe(function () {
|
|
39
|
+
_this.setOperators(foundFilter || defaultFilter);
|
|
40
|
+
_this.cdr.detectChanges();
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
FilterExpressionComponent.prototype.ngOnDestroy = function () {
|
|
44
|
+
if (this.localizationSubscription) {
|
|
45
|
+
this.localizationSubscription.unsubscribe();
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
FilterExpressionComponent.prototype.normalizeOperators = function (filterEditor, operators) {
|
|
49
|
+
var result = [];
|
|
50
|
+
for (var j = 0; j < operators.length; j++) {
|
|
51
|
+
if (util_1.isFilterEditor(filterEditor)) {
|
|
52
|
+
result.push({
|
|
53
|
+
value: operators[j],
|
|
54
|
+
text: this.localization.get(util_1.getKeyByValue(util_1.defaultOperators[filterEditor], operators[j]))
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return result;
|
|
59
|
+
};
|
|
60
|
+
FilterExpressionComponent.prototype.messageFor = function (key) {
|
|
61
|
+
return this.localization.get(key);
|
|
62
|
+
};
|
|
63
|
+
FilterExpressionComponent.prototype.getFilterExpressionByField = function (name) {
|
|
64
|
+
var foundFilter = this.filterService.filters.find(function (filter) { return filter.field === name; });
|
|
65
|
+
if (foundFilter) {
|
|
66
|
+
return foundFilter;
|
|
67
|
+
}
|
|
68
|
+
return null;
|
|
69
|
+
};
|
|
70
|
+
FilterExpressionComponent.prototype.filterValueChange = function (value) {
|
|
71
|
+
this.currentItem.value = null;
|
|
72
|
+
this.currentItem.field = value;
|
|
73
|
+
var foundFilter = this.getFilterExpressionByField(this.currentItem.field);
|
|
74
|
+
this.setOperators(foundFilter);
|
|
75
|
+
this.valueChange.emit();
|
|
76
|
+
};
|
|
77
|
+
FilterExpressionComponent.prototype.getDefaultOperators = function (operatorsType) {
|
|
78
|
+
switch (operatorsType) {
|
|
79
|
+
case 'string':
|
|
80
|
+
return util_1.localizeOperators(util_1.defaultStringOperators)(this.localization);
|
|
81
|
+
case 'number':
|
|
82
|
+
return util_1.localizeOperators(util_1.defaultNumericOperators)(this.localization);
|
|
83
|
+
case 'date':
|
|
84
|
+
return util_1.localizeOperators(util_1.defaultDateOperators)(this.localization);
|
|
85
|
+
default:
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
FilterExpressionComponent.prototype.getEditorType = function () {
|
|
90
|
+
var _this = this;
|
|
91
|
+
var item = this.filterService.filters.find(function (filterExpression) { return filterExpression.field === _this.currentItem.field; });
|
|
92
|
+
return item.editor;
|
|
93
|
+
};
|
|
94
|
+
FilterExpressionComponent.prototype.removeFilterExpression = function () {
|
|
95
|
+
this.filterService.remove(this.currentItem, this.index);
|
|
96
|
+
this.valueChange.emit();
|
|
97
|
+
};
|
|
98
|
+
FilterExpressionComponent.prototype.setOperators = function (filter) {
|
|
99
|
+
this.isBoolean = filter.editor === 'boolean';
|
|
100
|
+
if (this.isBoolean) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (filter.operators) {
|
|
104
|
+
var localizedOperators = this.normalizeOperators(filter.editor, filter.operators);
|
|
105
|
+
this.operators = localizedOperators;
|
|
106
|
+
if (!this.currentItem.operator) {
|
|
107
|
+
this.currentItem.operator = localizedOperators[0].value;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
this.operators = this.getDefaultOperators(filter.editor);
|
|
112
|
+
if (!this.currentItem.operator) {
|
|
113
|
+
this.currentItem.operator = this.operators[0].value;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
tslib_1.__decorate([
|
|
118
|
+
core_1.Input(),
|
|
119
|
+
tslib_1.__metadata("design:type", Number)
|
|
120
|
+
], FilterExpressionComponent.prototype, "index", void 0);
|
|
121
|
+
tslib_1.__decorate([
|
|
122
|
+
core_1.Input(),
|
|
123
|
+
tslib_1.__metadata("design:type", Object)
|
|
124
|
+
], FilterExpressionComponent.prototype, "currentItem", void 0);
|
|
125
|
+
tslib_1.__decorate([
|
|
126
|
+
core_1.Output(),
|
|
127
|
+
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
128
|
+
], FilterExpressionComponent.prototype, "valueChange", void 0);
|
|
129
|
+
FilterExpressionComponent = tslib_1.__decorate([
|
|
130
|
+
core_1.Component({
|
|
131
|
+
selector: 'kendo-filter-expression',
|
|
132
|
+
template: "\n <div class=\"k-filter-toolbar\" role=\"group\" [attr.aria-label]=\"messageFor('filterAriaLabel')\">\n <div class=\"k-toolbar\">\n <div class=\"k-filter-toolbar-item k-filter-field\">\n <kendo-dropdownlist\n [kendoAriaLabelValue]=\"messageFor('filterFieldAriaLabel')\"\n [title]=\"messageFor('filterExpressionFilters')\"\n [data]=\"filters\"\n textField=\"title\"\n valueField=\"field\"\n [value]=\"currentItem.field\"\n [valuePrimitive]=\"true\"\n (valueChange)=\"filterValueChange($event)\">\n </kendo-dropdownlist>\n </div>\n <div *ngIf=\"!isBoolean\" class=\"k-filter-toolbar-item k-filter-operator\">\n <kendo-filter-expression-operators\n [currentItem]=\"currentItem\"\n [operators]=\"operators\"\n (valueChange)=\"valueChange.emit();\">\n </kendo-filter-expression-operators>\n </div>\n\n <ng-container [ngSwitch]=\"getEditorType()\">\n <kendo-filter-text-editor *ngSwitchCase=\"'string'\" [currentItem]=\"currentItem\" (valueChange)=\"valueChange.emit()\"></kendo-filter-text-editor>\n <kendo-filter-numeric-editor *ngSwitchCase=\"'number'\" [currentItem]=\"currentItem\" (valueChange)=\"valueChange.emit()\"></kendo-filter-numeric-editor>\n <kendo-filter-boolean-editor *ngSwitchCase=\"'boolean'\" [currentItem]=\"currentItem\" (valueChange)=\"valueChange.emit()\"></kendo-filter-boolean-editor>\n <kendo-filter-date-editor *ngSwitchCase=\"'date'\" [currentItem]=\"currentItem\" (valueChange)=\"valueChange.emit()\"></kendo-filter-date-editor>\n </ng-container>\n\n <div class=\"k-filter-toolbar-item\">\n <button\n kendoButton\n icon=\"close\"\n fillMode=\"flat\"\n [title]=\"messageFor('remove')\"\n (click)=\"removeFilterExpression()\">\n </button>\n </div>\n </div>\n </div>\n "
|
|
133
|
+
}),
|
|
134
|
+
tslib_1.__metadata("design:paramtypes", [filter_service_1.FilterService, kendo_angular_l10n_1.LocalizationService, core_1.ChangeDetectorRef])
|
|
135
|
+
], FilterExpressionComponent);
|
|
136
|
+
return FilterExpressionComponent;
|
|
137
|
+
}());
|
|
138
|
+
exports.FilterExpressionComponent = FilterExpressionComponent;
|
|
@@ -0,0 +1,86 @@
|
|
|
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
|
+
"use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
var tslib_1 = require("tslib");
|
|
8
|
+
var core_1 = require("@angular/core");
|
|
9
|
+
var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
|
|
10
|
+
var filter_service_1 = require("./filter.service");
|
|
11
|
+
var util_1 = require("./util");
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
var FilterGroupComponent = /** @class */ (function () {
|
|
16
|
+
function FilterGroupComponent(filterService, localization, cdr) {
|
|
17
|
+
this.filterService = filterService;
|
|
18
|
+
this.localization = localization;
|
|
19
|
+
this.cdr = cdr;
|
|
20
|
+
this.index = 0;
|
|
21
|
+
this.currentItem = {
|
|
22
|
+
logic: 'or',
|
|
23
|
+
filters: []
|
|
24
|
+
};
|
|
25
|
+
this.valueChange = new core_1.EventEmitter();
|
|
26
|
+
this.operators = [];
|
|
27
|
+
}
|
|
28
|
+
FilterGroupComponent.prototype.ngOnInit = function () {
|
|
29
|
+
var _this = this;
|
|
30
|
+
this.operators = this.getLogicOperators();
|
|
31
|
+
this.localizationSubscription = this.localization.changes.subscribe(function () {
|
|
32
|
+
_this.operators = _this.getLogicOperators();
|
|
33
|
+
_this.cdr.detectChanges();
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
FilterGroupComponent.prototype.ngOnDestroy = function () {
|
|
37
|
+
if (this.localizationSubscription) {
|
|
38
|
+
this.localizationSubscription.unsubscribe();
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
FilterGroupComponent.prototype.getLogicOperators = function () {
|
|
42
|
+
return util_1.localizeOperators(util_1.logicOperators)(this.localization);
|
|
43
|
+
};
|
|
44
|
+
FilterGroupComponent.prototype.messageFor = function (key) {
|
|
45
|
+
return this.localization.get(key);
|
|
46
|
+
};
|
|
47
|
+
FilterGroupComponent.prototype.selectedChange = function (logicOperator) {
|
|
48
|
+
if (this.currentItem.logic !== logicOperator) {
|
|
49
|
+
this.currentItem.logic = logicOperator;
|
|
50
|
+
this.valueChange.emit();
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
FilterGroupComponent.prototype.addFilterExpression = function () {
|
|
54
|
+
this.filterService.addFilterExpression(this.currentItem);
|
|
55
|
+
this.valueChange.emit();
|
|
56
|
+
};
|
|
57
|
+
FilterGroupComponent.prototype.addFilterGroup = function () {
|
|
58
|
+
this.filterService.addFilterGroup(this.currentItem);
|
|
59
|
+
this.valueChange.emit();
|
|
60
|
+
};
|
|
61
|
+
FilterGroupComponent.prototype.removeFilterGroup = function () {
|
|
62
|
+
this.filterService.remove(this.currentItem, this.index);
|
|
63
|
+
this.valueChange.emit();
|
|
64
|
+
};
|
|
65
|
+
tslib_1.__decorate([
|
|
66
|
+
core_1.Input(),
|
|
67
|
+
tslib_1.__metadata("design:type", Number)
|
|
68
|
+
], FilterGroupComponent.prototype, "index", void 0);
|
|
69
|
+
tslib_1.__decorate([
|
|
70
|
+
core_1.Input(),
|
|
71
|
+
tslib_1.__metadata("design:type", Object)
|
|
72
|
+
], FilterGroupComponent.prototype, "currentItem", void 0);
|
|
73
|
+
tslib_1.__decorate([
|
|
74
|
+
core_1.Output(),
|
|
75
|
+
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
76
|
+
], FilterGroupComponent.prototype, "valueChange", void 0);
|
|
77
|
+
FilterGroupComponent = tslib_1.__decorate([
|
|
78
|
+
core_1.Component({
|
|
79
|
+
selector: 'kendo-filter-group',
|
|
80
|
+
template: "\n <div class=\"k-filter-toolbar\" role=\"toolbar\" [attr.aria-label]=\"messageFor('filterToolbarAriaLabel')\">\n <div class=\"k-toolbar\">\n <div class=\"k-filter-toolbar-item\">\n <div class=\"k-widget k-button-group\" role=\"group\">\n <button\n *ngFor=\"let operator of operators\"\n kendoButton\n [ngClass]=\"{'k-group-start': operator.value === 'and', 'k-group-end': operator.value === 'or'}\"\n [selected]=\"currentItem.logic === operator.value\"\n [title]=\"operator.text\"\n (click)=\"selectedChange(operator.value)\"\n >\n {{operator.text}}\n </button>\n </div>\n </div>\n <div class=\"k-filter-toolbar-item\">\n <button\n kendoButton\n [title]=\"messageFor('addFilter')\"\n icon=\"filter-add-expression\"\n (click)=\"addFilterExpression()\">\n {{messageFor('addFilter')}}\n </button>\n </div>\n <div class=\"k-filter-toolbar-item\">\n <button\n kendoButton\n [title]=\"messageFor('addGroup')\"\n icon=\"filter-add-group\"\n (click)=\"addFilterGroup()\">\n {{messageFor('addGroup')}}\n </button>\n </div>\n <div class=\"k-filter-toolbar-item\">\n <button\n kendoButton\n icon=\"close\"\n fillMode=\"flat\"\n [title]=\"messageFor('remove')\"\n (click)=\"removeFilterGroup()\">\n </button>\n </div>\n </div>\n </div>\n\n <ul class=\"k-filter-lines\" *ngIf=\"currentItem.filters\">\n <ng-container *ngFor=\"let item of currentItem.filters; let i = index;\">\n <li class=\"k-filter-item\" *ngIf=\"!item.filters\">\n <kendo-filter-expression (valueChange)=\"valueChange.emit()\" [currentItem]=\"item\" [index]=\"i\">\n </kendo-filter-expression>\n </li>\n <li class=\"k-filter-item\" *ngIf=\"item.filters\" >\n <kendo-filter-group\n (valueChange)=\"valueChange.emit()\"\n [currentItem]=\"item\"\n [index]=\"i\"\n >\n </kendo-filter-group>\n </li>\n </ng-container>\n </ul>\n "
|
|
81
|
+
}),
|
|
82
|
+
tslib_1.__metadata("design:paramtypes", [filter_service_1.FilterService, kendo_angular_l10n_1.LocalizationService, core_1.ChangeDetectorRef])
|
|
83
|
+
], FilterGroupComponent);
|
|
84
|
+
return FilterGroupComponent;
|
|
85
|
+
}());
|
|
86
|
+
exports.FilterGroupComponent = FilterGroupComponent;
|