@progress/kendo-angular-filter 2.0.1-dev.202205130803 → 2.0.1-dev.202205190755
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-filter.umd.js +1 -1
- package/editors/date-editor.component.d.ts +3 -5
- package/editors/numeric-editor.component.d.ts +3 -5
- package/editors/text-editor.component.d.ts +3 -5
- package/esm2015/editors/date-editor.component.js +11 -18
- package/esm2015/editors/numeric-editor.component.js +11 -18
- package/esm2015/editors/text-editor.component.js +11 -18
- package/esm2015/filter-expression-operators.component.js +15 -19
- package/esm2015/filter-expression.component.js +21 -10
- package/esm2015/filter.component.js +23 -11
- package/esm2015/filter.service.js +1 -3
- package/esm2015/package-metadata.js +1 -1
- package/esm2015/util.js +4 -0
- package/fesm2015/kendo-angular-filter.js +91 -86
- package/filter-expression-operators.component.d.ts +2 -4
- package/filter-expression.component.d.ts +2 -1
- package/filter.component.d.ts +2 -0
- package/filter.service.d.ts +1 -2
- package/package.json +1 -1
- package/util.d.ts +4 -0
|
@@ -7,11 +7,11 @@ import { Injectable, Directive, Input, EventEmitter, Component, Output, forwardR
|
|
|
7
7
|
import * as i1 from '@progress/kendo-angular-l10n';
|
|
8
8
|
import { ComponentMessages, LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
9
9
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
10
|
-
import * as
|
|
10
|
+
import * as i2 from '@progress/kendo-angular-dropdowns';
|
|
11
11
|
import { DropDownsModule } from '@progress/kendo-angular-dropdowns';
|
|
12
|
-
import * as
|
|
12
|
+
import * as i2$1 from '@progress/kendo-angular-inputs';
|
|
13
13
|
import { InputsModule } from '@progress/kendo-angular-inputs';
|
|
14
|
-
import * as
|
|
14
|
+
import * as i2$2 from '@progress/kendo-angular-dateinputs';
|
|
15
15
|
import { DateInputsModule } from '@progress/kendo-angular-dateinputs';
|
|
16
16
|
import * as i10 from '@angular/common';
|
|
17
17
|
import { CommonModule } from '@angular/common';
|
|
@@ -24,9 +24,7 @@ import { LabelModule } from '@progress/kendo-angular-label';
|
|
|
24
24
|
*/
|
|
25
25
|
class FilterService {
|
|
26
26
|
constructor() {
|
|
27
|
-
this.value = { filters: [], logic: 'or' };
|
|
28
27
|
this.filters = [];
|
|
29
|
-
this.isEditorDisabled = false;
|
|
30
28
|
}
|
|
31
29
|
addFilterGroup(item) {
|
|
32
30
|
let filterGroup = { logic: 'or', filters: [] };
|
|
@@ -38,7 +36,7 @@ class FilterService {
|
|
|
38
36
|
}
|
|
39
37
|
remove(item, positionIndex, parentItem) {
|
|
40
38
|
if (!parentItem) {
|
|
41
|
-
parentItem = this.
|
|
39
|
+
parentItem = this.normalizedValue;
|
|
42
40
|
}
|
|
43
41
|
if (item === parentItem) {
|
|
44
42
|
parentItem.filters = [];
|
|
@@ -190,6 +188,10 @@ const localizeOperators = operators => localization => Object.keys(operators).ma
|
|
|
190
188
|
text: localization.get(key),
|
|
191
189
|
value: operators[key]
|
|
192
190
|
}));
|
|
191
|
+
/**
|
|
192
|
+
* @hidden
|
|
193
|
+
*/
|
|
194
|
+
const isPresent = (value) => value !== null && value !== undefined;
|
|
193
195
|
|
|
194
196
|
/**
|
|
195
197
|
* @hidden
|
|
@@ -198,7 +200,7 @@ const packageMetadata = {
|
|
|
198
200
|
name: '@progress/kendo-angular-filter',
|
|
199
201
|
productName: 'Kendo UI for Angular',
|
|
200
202
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
201
|
-
publishDate:
|
|
203
|
+
publishDate: 1652946928,
|
|
202
204
|
version: '',
|
|
203
205
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
|
|
204
206
|
};
|
|
@@ -230,21 +232,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
230
232
|
* @hidden
|
|
231
233
|
*/
|
|
232
234
|
class FilterExpressionOperatorsComponent {
|
|
233
|
-
constructor(
|
|
234
|
-
this.filterService = filterService;
|
|
235
|
+
constructor(localization) {
|
|
235
236
|
this.localization = localization;
|
|
236
|
-
this.valueChange = new EventEmitter();
|
|
237
237
|
this.operators = [];
|
|
238
|
+
this.valueChange = new EventEmitter();
|
|
238
239
|
}
|
|
239
240
|
messageFor(key) {
|
|
240
241
|
return this.localization.get(key);
|
|
241
242
|
}
|
|
242
243
|
operatorValueChange(value) {
|
|
243
|
-
this.valueChange.emit();
|
|
244
|
-
this.filterService.isEditorDisabled = nullOperators.indexOf(value) >= 0;
|
|
244
|
+
this.valueChange.emit(value);
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
-
FilterExpressionOperatorsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterExpressionOperatorsComponent, deps: [{ token:
|
|
247
|
+
FilterExpressionOperatorsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterExpressionOperatorsComponent, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
248
248
|
FilterExpressionOperatorsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterExpressionOperatorsComponent, selector: "kendo-filter-expression-operators", inputs: { currentItem: "currentItem", operators: "operators" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
|
|
249
249
|
<kendo-dropdownlist
|
|
250
250
|
[kendoAriaLabelValue]="messageFor('filterOperatorAriaLabel')"
|
|
@@ -255,13 +255,13 @@ FilterExpressionOperatorsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersio
|
|
|
255
255
|
[valuePrimitive]="true"
|
|
256
256
|
textField="text"
|
|
257
257
|
valueField="value"
|
|
258
|
-
|
|
258
|
+
>
|
|
259
259
|
</kendo-dropdownlist>
|
|
260
|
-
|
|
260
|
+
`, isInline: true, components: [{ type: i2.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: AriaLabelValueDirective, selector: "[kendoAriaLabelValue]", inputs: ["kendoAriaLabelValue"] }] });
|
|
261
261
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterExpressionOperatorsComponent, decorators: [{
|
|
262
262
|
type: Component,
|
|
263
263
|
args: [{
|
|
264
|
-
selector:
|
|
264
|
+
selector: "kendo-filter-expression-operators",
|
|
265
265
|
template: `
|
|
266
266
|
<kendo-dropdownlist
|
|
267
267
|
[kendoAriaLabelValue]="messageFor('filterOperatorAriaLabel')"
|
|
@@ -272,48 +272,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
272
272
|
[valuePrimitive]="true"
|
|
273
273
|
textField="text"
|
|
274
274
|
valueField="value"
|
|
275
|
-
|
|
275
|
+
>
|
|
276
276
|
</kendo-dropdownlist>
|
|
277
|
-
|
|
277
|
+
`
|
|
278
278
|
}]
|
|
279
|
-
}], ctorParameters: function () { return [{ type:
|
|
279
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }]; }, propDecorators: { currentItem: [{
|
|
280
280
|
type: Input
|
|
281
|
-
}], valueChange: [{
|
|
282
|
-
type: Output
|
|
283
281
|
}], operators: [{
|
|
284
282
|
type: Input
|
|
283
|
+
}], valueChange: [{
|
|
284
|
+
type: Output
|
|
285
285
|
}] } });
|
|
286
286
|
|
|
287
287
|
/**
|
|
288
288
|
* @hidden
|
|
289
289
|
*/
|
|
290
290
|
class FilterTextEditorComponent {
|
|
291
|
-
constructor(localization
|
|
291
|
+
constructor(localization) {
|
|
292
292
|
this.localization = localization;
|
|
293
|
-
this.filterService = filterService;
|
|
294
293
|
this.valueChange = new EventEmitter();
|
|
295
294
|
}
|
|
296
|
-
isDisabled() {
|
|
297
|
-
const isDisabled = this.filterService.isEditorDisabled;
|
|
298
|
-
if (isDisabled) {
|
|
299
|
-
this.currentItem.value = null;
|
|
300
|
-
}
|
|
301
|
-
return isDisabled;
|
|
302
|
-
}
|
|
303
295
|
messageFor(key) {
|
|
304
296
|
return this.localization.get(key);
|
|
305
297
|
}
|
|
306
298
|
}
|
|
307
|
-
FilterTextEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterTextEditorComponent, deps: [{ token: i1.LocalizationService }
|
|
308
|
-
FilterTextEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterTextEditorComponent, selector: "kendo-filter-text-editor", inputs: { currentItem: "currentItem" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
|
|
299
|
+
FilterTextEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterTextEditorComponent, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
300
|
+
FilterTextEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterTextEditorComponent, selector: "kendo-filter-text-editor", inputs: { currentItem: "currentItem", isDisabled: "isDisabled" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
|
|
309
301
|
<kendo-textbox
|
|
310
302
|
[kendoAriaLabelValue]="messageFor('filterValueAriaLabel')"
|
|
311
303
|
class="k-filter-toolbar-item k-filter-value"
|
|
312
304
|
[(value)]="currentItem.value"
|
|
313
305
|
(valueChange)="valueChange.emit()"
|
|
314
|
-
[disabled]="isDisabled
|
|
306
|
+
[disabled]="isDisabled">
|
|
315
307
|
</kendo-textbox>
|
|
316
|
-
`, isInline: true, components: [{ type:
|
|
308
|
+
`, isInline: true, components: [{ type: i2$1.TextBoxComponent, selector: "kendo-textbox", inputs: ["focusableId", "title", "disabled", "readonly", "tabindex", "value", "selectOnFocus", "showSuccessIcon", "showErrorIcon", "clearButton", "successIcon", "errorIcon", "clearButtonIcon", "size", "rounded", "fillMode", "tabIndex", "placeholder", "maxlength"], outputs: ["valueChange", "inputFocus", "inputBlur", "focus", "blur"], exportAs: ["kendoTextBox"] }], directives: [{ type: AriaLabelValueDirective, selector: "[kendoAriaLabelValue]", inputs: ["kendoAriaLabelValue"] }] });
|
|
317
309
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterTextEditorComponent, decorators: [{
|
|
318
310
|
type: Component,
|
|
319
311
|
args: [{
|
|
@@ -324,11 +316,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
324
316
|
class="k-filter-toolbar-item k-filter-value"
|
|
325
317
|
[(value)]="currentItem.value"
|
|
326
318
|
(valueChange)="valueChange.emit()"
|
|
327
|
-
[disabled]="isDisabled
|
|
319
|
+
[disabled]="isDisabled">
|
|
328
320
|
</kendo-textbox>
|
|
329
321
|
`
|
|
330
322
|
}]
|
|
331
|
-
}], ctorParameters: function () { return [{ type: i1.LocalizationService }
|
|
323
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }]; }, propDecorators: { currentItem: [{
|
|
324
|
+
type: Input
|
|
325
|
+
}], isDisabled: [{
|
|
332
326
|
type: Input
|
|
333
327
|
}], valueChange: [{
|
|
334
328
|
type: Output
|
|
@@ -338,36 +332,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
338
332
|
* @hidden
|
|
339
333
|
*/
|
|
340
334
|
class FilterNumericEditorComponent {
|
|
341
|
-
constructor(localization
|
|
335
|
+
constructor(localization) {
|
|
342
336
|
this.localization = localization;
|
|
343
|
-
this.filterService = filterService;
|
|
344
337
|
this.valueChange = new EventEmitter();
|
|
345
338
|
}
|
|
346
339
|
messageFor(key) {
|
|
347
340
|
return this.localization.get(key);
|
|
348
341
|
}
|
|
349
|
-
isDisabled() {
|
|
350
|
-
const isDisabled = this.filterService.isEditorDisabled;
|
|
351
|
-
if (isDisabled) {
|
|
352
|
-
this.currentItem.value = null;
|
|
353
|
-
}
|
|
354
|
-
return isDisabled;
|
|
355
|
-
}
|
|
356
342
|
}
|
|
357
|
-
FilterNumericEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterNumericEditorComponent, deps: [{ token: i1.LocalizationService }
|
|
358
|
-
FilterNumericEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterNumericEditorComponent, selector: "kendo-filter-numeric-editor", inputs: { currentItem: "currentItem" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
|
|
343
|
+
FilterNumericEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterNumericEditorComponent, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
344
|
+
FilterNumericEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterNumericEditorComponent, selector: "kendo-filter-numeric-editor", inputs: { currentItem: "currentItem", isDisabled: "isDisabled" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
|
|
359
345
|
<kendo-numerictextbox
|
|
360
346
|
[kendoAriaLabelValue]="messageFor('filterValueAriaLabel')"
|
|
361
347
|
class="k-filter-toolbar-item k-filter-value"
|
|
362
348
|
[(value)]="currentItem.value"
|
|
363
349
|
(valueChange)="valueChange.emit()"
|
|
364
|
-
[disabled]="isDisabled
|
|
350
|
+
[disabled]="isDisabled">
|
|
365
351
|
<kendo-numerictextbox-messages
|
|
366
352
|
[increment]="messageFor('editorNumericIncrement')"
|
|
367
353
|
[decrement]="messageFor('editorNumericDecrement')">
|
|
368
354
|
</kendo-numerictextbox-messages>
|
|
369
355
|
</kendo-numerictextbox>
|
|
370
|
-
`, isInline: true, components: [{ type:
|
|
356
|
+
`, isInline: true, components: [{ type: i2$1.NumericTextBoxComponent, selector: "kendo-numerictextbox", inputs: ["focusableId", "disabled", "readonly", "title", "autoCorrect", "format", "max", "min", "decimals", "placeholder", "step", "spinners", "rangeValidation", "tabindex", "tabIndex", "changeValueOnScroll", "selectOnFocus", "value", "maxlength", "size", "rounded", "fillMode"], outputs: ["valueChange", "focus", "blur"], exportAs: ["kendoNumericTextBox"] }, { type: i2$1.NumericTextBoxCustomMessagesComponent, selector: "kendo-numerictextbox-messages" }], directives: [{ type: AriaLabelValueDirective, selector: "[kendoAriaLabelValue]", inputs: ["kendoAriaLabelValue"] }] });
|
|
371
357
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterNumericEditorComponent, decorators: [{
|
|
372
358
|
type: Component,
|
|
373
359
|
args: [{
|
|
@@ -378,7 +364,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
378
364
|
class="k-filter-toolbar-item k-filter-value"
|
|
379
365
|
[(value)]="currentItem.value"
|
|
380
366
|
(valueChange)="valueChange.emit()"
|
|
381
|
-
[disabled]="isDisabled
|
|
367
|
+
[disabled]="isDisabled">
|
|
382
368
|
<kendo-numerictextbox-messages
|
|
383
369
|
[increment]="messageFor('editorNumericIncrement')"
|
|
384
370
|
[decrement]="messageFor('editorNumericDecrement')">
|
|
@@ -386,7 +372,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
386
372
|
</kendo-numerictextbox>
|
|
387
373
|
`
|
|
388
374
|
}]
|
|
389
|
-
}], ctorParameters: function () { return [{ type: i1.LocalizationService }
|
|
375
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }]; }, propDecorators: { currentItem: [{
|
|
376
|
+
type: Input
|
|
377
|
+
}], isDisabled: [{
|
|
390
378
|
type: Input
|
|
391
379
|
}], valueChange: [{
|
|
392
380
|
type: Output
|
|
@@ -442,7 +430,7 @@ FilterBooleanEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12
|
|
|
442
430
|
valueField="value"
|
|
443
431
|
>
|
|
444
432
|
</kendo-dropdownlist>
|
|
445
|
-
`, isInline: true, components: [{ type:
|
|
433
|
+
`, isInline: true, components: [{ type: i2.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: AriaLabelValueDirective, selector: "[kendoAriaLabelValue]", inputs: ["kendoAriaLabelValue"] }] });
|
|
446
434
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterBooleanEditorComponent, decorators: [{
|
|
447
435
|
type: Component,
|
|
448
436
|
args: [{
|
|
@@ -472,36 +460,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
472
460
|
* @hidden
|
|
473
461
|
*/
|
|
474
462
|
class FilterDateEditorComponent {
|
|
475
|
-
constructor(localization
|
|
463
|
+
constructor(localization) {
|
|
476
464
|
this.localization = localization;
|
|
477
|
-
this.filterService = filterService;
|
|
478
465
|
this.valueChange = new EventEmitter();
|
|
479
466
|
}
|
|
480
467
|
messageFor(key) {
|
|
481
468
|
return this.localization.get(key);
|
|
482
469
|
}
|
|
483
|
-
isDisabled() {
|
|
484
|
-
const isDisabled = this.filterService.isEditorDisabled;
|
|
485
|
-
if (isDisabled) {
|
|
486
|
-
this.currentItem.value = null;
|
|
487
|
-
}
|
|
488
|
-
return isDisabled;
|
|
489
|
-
}
|
|
490
470
|
}
|
|
491
|
-
FilterDateEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterDateEditorComponent, deps: [{ token: i1.LocalizationService }
|
|
492
|
-
FilterDateEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterDateEditorComponent, selector: "kendo-filter-date-editor", inputs: { currentItem: "currentItem" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
|
|
471
|
+
FilterDateEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterDateEditorComponent, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
472
|
+
FilterDateEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterDateEditorComponent, selector: "kendo-filter-date-editor", inputs: { currentItem: "currentItem", isDisabled: "isDisabled" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
|
|
493
473
|
<kendo-datepicker
|
|
494
474
|
[kendoAriaLabelValue]="messageFor('filterValueAriaLabel')"
|
|
495
475
|
class="k-filter-toolbar-item k-filter-value"
|
|
496
476
|
[(value)]="currentItem.value"
|
|
497
477
|
(valueChange)="valueChange.emit()"
|
|
498
|
-
[disabled]="isDisabled
|
|
478
|
+
[disabled]="isDisabled">
|
|
499
479
|
<kendo-datepicker-messages
|
|
500
480
|
[toggle]="messageFor('editorDateToggleText')"
|
|
501
481
|
[today]="messageFor('editorDateTodayText')">
|
|
502
482
|
</kendo-datepicker-messages>
|
|
503
483
|
</kendo-datepicker>
|
|
504
|
-
`, isInline: true, components: [{ type:
|
|
484
|
+
`, isInline: true, components: [{ type: i2$2.DatePickerComponent, selector: "kendo-datepicker", inputs: ["cellTemplate", "monthCellTemplate", "yearCellTemplate", "decadeCellTemplate", "centuryCellTemplate", "weekNumberTemplate", "headerTitleTemplate", "navigationItemTemplate", "focusableId", "activeView", "bottomView", "topView", "calendarType", "animateCalendarNavigation", "disabled", "readonly", "readOnlyInput", "popupSettings", "navigation", "min", "max", "incompleteDateValidation", "focusedDate", "value", "format", "twoDigitYearMax", "formatPlaceholder", "placeholder", "tabindex", "tabIndex", "disabledDates", "title", "rangeValidation", "disabledDatesValidation", "weekNumber", "size", "rounded", "fillMode"], outputs: ["valueChange", "focus", "blur", "open", "close"], exportAs: ["kendo-datepicker"] }, { type: i2$2.DatePickerCustomMessagesComponent, selector: "kendo-datepicker-messages" }], directives: [{ type: AriaLabelValueDirective, selector: "[kendoAriaLabelValue]", inputs: ["kendoAriaLabelValue"] }] });
|
|
505
485
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterDateEditorComponent, decorators: [{
|
|
506
486
|
type: Component,
|
|
507
487
|
args: [{
|
|
@@ -512,7 +492,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
512
492
|
class="k-filter-toolbar-item k-filter-value"
|
|
513
493
|
[(value)]="currentItem.value"
|
|
514
494
|
(valueChange)="valueChange.emit()"
|
|
515
|
-
[disabled]="isDisabled
|
|
495
|
+
[disabled]="isDisabled">
|
|
516
496
|
<kendo-datepicker-messages
|
|
517
497
|
[toggle]="messageFor('editorDateToggleText')"
|
|
518
498
|
[today]="messageFor('editorDateTodayText')">
|
|
@@ -520,7 +500,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
520
500
|
</kendo-datepicker>
|
|
521
501
|
`
|
|
522
502
|
}]
|
|
523
|
-
}], ctorParameters: function () { return [{ type: i1.LocalizationService }
|
|
503
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }]; }, propDecorators: { currentItem: [{
|
|
504
|
+
type: Input
|
|
505
|
+
}], isDisabled: [{
|
|
524
506
|
type: Input
|
|
525
507
|
}], valueChange: [{
|
|
526
508
|
type: Output
|
|
@@ -541,6 +523,7 @@ class FilterExpressionComponent {
|
|
|
541
523
|
this.isEditorDisabled = false;
|
|
542
524
|
}
|
|
543
525
|
ngOnInit() {
|
|
526
|
+
this.isEditorDisabled = nullOperators.indexOf(this.currentItem.operator) >= 0;
|
|
544
527
|
this.filters = this.filterService.filters;
|
|
545
528
|
const foundFilter = this.getFilterExpressionByField(this.currentItem.field);
|
|
546
529
|
if (this.currentItem.field) {
|
|
@@ -629,6 +612,16 @@ class FilterExpressionComponent {
|
|
|
629
612
|
}
|
|
630
613
|
}
|
|
631
614
|
}
|
|
615
|
+
onOperatorChange(value) {
|
|
616
|
+
this.valueChange.emit();
|
|
617
|
+
if (nullOperators.indexOf(value) >= 0) {
|
|
618
|
+
this.currentItem.value = null;
|
|
619
|
+
this.isEditorDisabled = true;
|
|
620
|
+
}
|
|
621
|
+
else {
|
|
622
|
+
this.isEditorDisabled = false;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
632
625
|
}
|
|
633
626
|
FilterExpressionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterExpressionComponent, deps: [{ token: FilterService }, { token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
634
627
|
FilterExpressionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterExpressionComponent, selector: "kendo-filter-expression", inputs: { index: "index", currentItem: "currentItem" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
|
|
@@ -650,15 +643,15 @@ FilterExpressionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.
|
|
|
650
643
|
<kendo-filter-expression-operators
|
|
651
644
|
[currentItem]="currentItem"
|
|
652
645
|
[operators]="operators"
|
|
653
|
-
(valueChange)="
|
|
646
|
+
(valueChange)="onOperatorChange($event);">
|
|
654
647
|
</kendo-filter-expression-operators>
|
|
655
648
|
</div>
|
|
656
649
|
|
|
657
650
|
<ng-container [ngSwitch]="getEditorType()">
|
|
658
|
-
<kendo-filter-text-editor *ngSwitchCase="'string'" [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-text-editor>
|
|
659
|
-
<kendo-filter-numeric-editor *ngSwitchCase="'number'" [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-numeric-editor>
|
|
651
|
+
<kendo-filter-text-editor *ngSwitchCase="'string'" [currentItem]="currentItem" [isDisabled]="isEditorDisabled" (valueChange)="valueChange.emit()"></kendo-filter-text-editor>
|
|
652
|
+
<kendo-filter-numeric-editor *ngSwitchCase="'number'" [currentItem]="currentItem" [isDisabled]="isEditorDisabled" (valueChange)="valueChange.emit()"></kendo-filter-numeric-editor>
|
|
660
653
|
<kendo-filter-boolean-editor *ngSwitchCase="'boolean'" [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-boolean-editor>
|
|
661
|
-
<kendo-filter-date-editor *ngSwitchCase="'date'" [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-date-editor>
|
|
654
|
+
<kendo-filter-date-editor *ngSwitchCase="'date'" [currentItem]="currentItem" [isDisabled]="isEditorDisabled" (valueChange)="valueChange.emit()"></kendo-filter-date-editor>
|
|
662
655
|
</ng-container>
|
|
663
656
|
|
|
664
657
|
<div class="k-filter-toolbar-item">
|
|
@@ -672,7 +665,7 @@ FilterExpressionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.
|
|
|
672
665
|
</div>
|
|
673
666
|
</div>
|
|
674
667
|
</div>
|
|
675
|
-
`, isInline: true, components: [{ type:
|
|
668
|
+
`, isInline: true, components: [{ type: i2.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: FilterExpressionOperatorsComponent, selector: "kendo-filter-expression-operators", inputs: ["currentItem", "operators"], outputs: ["valueChange"] }, { type: FilterTextEditorComponent, selector: "kendo-filter-text-editor", inputs: ["currentItem", "isDisabled"], outputs: ["valueChange"] }, { type: FilterNumericEditorComponent, selector: "kendo-filter-numeric-editor", inputs: ["currentItem", "isDisabled"], outputs: ["valueChange"] }, { type: FilterBooleanEditorComponent, selector: "kendo-filter-boolean-editor", inputs: ["currentItem"], outputs: ["valueChange"] }, { type: FilterDateEditorComponent, selector: "kendo-filter-date-editor", inputs: ["currentItem", "isDisabled"], outputs: ["valueChange"] }], directives: [{ type: 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", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }] });
|
|
676
669
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterExpressionComponent, decorators: [{
|
|
677
670
|
type: Component,
|
|
678
671
|
args: [{
|
|
@@ -696,15 +689,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
696
689
|
<kendo-filter-expression-operators
|
|
697
690
|
[currentItem]="currentItem"
|
|
698
691
|
[operators]="operators"
|
|
699
|
-
(valueChange)="
|
|
692
|
+
(valueChange)="onOperatorChange($event);">
|
|
700
693
|
</kendo-filter-expression-operators>
|
|
701
694
|
</div>
|
|
702
695
|
|
|
703
696
|
<ng-container [ngSwitch]="getEditorType()">
|
|
704
|
-
<kendo-filter-text-editor *ngSwitchCase="'string'" [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-text-editor>
|
|
705
|
-
<kendo-filter-numeric-editor *ngSwitchCase="'number'" [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-numeric-editor>
|
|
697
|
+
<kendo-filter-text-editor *ngSwitchCase="'string'" [currentItem]="currentItem" [isDisabled]="isEditorDisabled" (valueChange)="valueChange.emit()"></kendo-filter-text-editor>
|
|
698
|
+
<kendo-filter-numeric-editor *ngSwitchCase="'number'" [currentItem]="currentItem" [isDisabled]="isEditorDisabled" (valueChange)="valueChange.emit()"></kendo-filter-numeric-editor>
|
|
706
699
|
<kendo-filter-boolean-editor *ngSwitchCase="'boolean'" [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-boolean-editor>
|
|
707
|
-
<kendo-filter-date-editor *ngSwitchCase="'date'" [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-date-editor>
|
|
700
|
+
<kendo-filter-date-editor *ngSwitchCase="'date'" [currentItem]="currentItem" [isDisabled]="isEditorDisabled" (valueChange)="valueChange.emit()"></kendo-filter-date-editor>
|
|
708
701
|
</ng-container>
|
|
709
702
|
|
|
710
703
|
<div class="k-filter-toolbar-item">
|
|
@@ -1082,6 +1075,7 @@ class FilterComponent {
|
|
|
1082
1075
|
* That is each time a Filter Group or Filter Expression is added, removed, or updated.
|
|
1083
1076
|
*/
|
|
1084
1077
|
this.valueChange = new EventEmitter();
|
|
1078
|
+
this._value = { filters: [], logic: 'and' };
|
|
1085
1079
|
validatePackage(packageMetadata);
|
|
1086
1080
|
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
1087
1081
|
}
|
|
@@ -1099,6 +1093,7 @@ class FilterComponent {
|
|
|
1099
1093
|
}
|
|
1100
1094
|
return clonedFilter;
|
|
1101
1095
|
});
|
|
1096
|
+
this.setValue(this.value);
|
|
1102
1097
|
}
|
|
1103
1098
|
get filters() {
|
|
1104
1099
|
return this.filterService.filters;
|
|
@@ -1108,11 +1103,11 @@ class FilterComponent {
|
|
|
1108
1103
|
*/
|
|
1109
1104
|
set value(value) {
|
|
1110
1105
|
const clonedValue = JSON.parse(JSON.stringify(value));
|
|
1111
|
-
this.
|
|
1112
|
-
this.
|
|
1106
|
+
this._value = clonedValue;
|
|
1107
|
+
this.setValue(this.value);
|
|
1113
1108
|
}
|
|
1114
1109
|
get value() {
|
|
1115
|
-
return this.
|
|
1110
|
+
return this._value;
|
|
1116
1111
|
}
|
|
1117
1112
|
ngOnInit() {
|
|
1118
1113
|
if (this.filters.length === 0) {
|
|
@@ -1132,13 +1127,13 @@ class FilterComponent {
|
|
|
1132
1127
|
* @hidden
|
|
1133
1128
|
*/
|
|
1134
1129
|
getCurrentFilter() {
|
|
1135
|
-
return this.
|
|
1130
|
+
return this.filterService.normalizedValue;
|
|
1136
1131
|
}
|
|
1137
1132
|
/**
|
|
1138
1133
|
* @hidden
|
|
1139
1134
|
*/
|
|
1140
1135
|
onValueChange() {
|
|
1141
|
-
this.valueChange.emit(this.filterService.
|
|
1136
|
+
this.valueChange.emit(this.filterService.normalizedValue);
|
|
1142
1137
|
}
|
|
1143
1138
|
normalizeFilter(filterDescriptor) {
|
|
1144
1139
|
const foundFilter = this.filterService.filters.find((filter) => filter.field === filterDescriptor.field);
|
|
@@ -1157,12 +1152,22 @@ class FilterComponent {
|
|
|
1157
1152
|
if (foundFilter.editor === 'date' && filterDescriptor.value) {
|
|
1158
1153
|
filterDescriptor.value = new Date(filterDescriptor.value);
|
|
1159
1154
|
}
|
|
1160
|
-
if (!filterDescriptor.value
|
|
1155
|
+
if (!isPresent(filterDescriptor.value)) {
|
|
1161
1156
|
filterDescriptor.value = null;
|
|
1162
1157
|
}
|
|
1158
|
+
if (nullOperators.indexOf(filterDescriptor.operator) >= 0) {
|
|
1159
|
+
filterDescriptor.value = null;
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
setValue(items) {
|
|
1163
|
+
this.normalizeValue(items);
|
|
1164
|
+
this.filterService.normalizedValue = items;
|
|
1163
1165
|
}
|
|
1164
|
-
normalizeValue(
|
|
1165
|
-
|
|
1166
|
+
normalizeValue(items) {
|
|
1167
|
+
if (!this.filterService.filters.length) {
|
|
1168
|
+
return;
|
|
1169
|
+
}
|
|
1170
|
+
items.filters.forEach((item) => {
|
|
1166
1171
|
if (item.filters) {
|
|
1167
1172
|
this.normalizeValue(item);
|
|
1168
1173
|
}
|
|
@@ -1305,7 +1310,7 @@ FilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versio
|
|
|
1305
1310
|
</li>
|
|
1306
1311
|
</ul>
|
|
1307
1312
|
</div>
|
|
1308
|
-
`, isInline: true, components: [{ type: FilterGroupComponent, selector: "kendo-filter-group", inputs: ["index", "currentItem"], outputs: ["valueChange"] }], directives: [{ type: LocalizedMessagesDirective, selector: "[kendoFilterLocalizedMessages]" }] });
|
|
1313
|
+
`, isInline: true, components: [{ type: FilterGroupComponent, selector: "kendo-filter-group", inputs: ["index", "currentItem"], outputs: ["valueChange"] }], directives: [{ type: LocalizedMessagesDirective, selector: "[kendoFilterLocalizedMessages]" }] });
|
|
1309
1314
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterComponent, decorators: [{
|
|
1310
1315
|
type: Component,
|
|
1311
1316
|
args: [{
|
|
@@ -1443,7 +1448,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
1443
1448
|
</li>
|
|
1444
1449
|
</ul>
|
|
1445
1450
|
</div>
|
|
1446
|
-
`
|
|
1451
|
+
`
|
|
1447
1452
|
}]
|
|
1448
1453
|
}], ctorParameters: function () { return [{ type: FilterService }, { type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { direction: [{
|
|
1449
1454
|
type: HostBinding,
|
|
@@ -5,21 +5,19 @@
|
|
|
5
5
|
import { EventEmitter } from '@angular/core';
|
|
6
6
|
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
7
7
|
import { FilterDescriptor } from '@progress/kendo-data-query';
|
|
8
|
-
import { FilterService } from './filter.service';
|
|
9
8
|
import * as i0 from "@angular/core";
|
|
10
9
|
/**
|
|
11
10
|
* @hidden
|
|
12
11
|
*/
|
|
13
12
|
export declare class FilterExpressionOperatorsComponent {
|
|
14
|
-
private filterService;
|
|
15
13
|
private localization;
|
|
16
14
|
currentItem: FilterDescriptor;
|
|
17
|
-
valueChange: EventEmitter<void>;
|
|
18
15
|
operators: {
|
|
19
16
|
text: string;
|
|
20
17
|
value: string;
|
|
21
18
|
}[];
|
|
22
|
-
|
|
19
|
+
valueChange: EventEmitter<string>;
|
|
20
|
+
constructor(localization: LocalizationService);
|
|
23
21
|
messageFor(key: string): string;
|
|
24
22
|
operatorValueChange(value: string): void;
|
|
25
23
|
static ɵfac: i0.ɵɵFactoryDeclaration<FilterExpressionOperatorsComponent, never>;
|
|
@@ -23,8 +23,8 @@ export declare class FilterExpressionComponent implements OnInit, OnDestroy {
|
|
|
23
23
|
operators: any[];
|
|
24
24
|
filters: FilterExpression[];
|
|
25
25
|
isBoolean: boolean;
|
|
26
|
-
isEditorDisabled: boolean;
|
|
27
26
|
editorType: FilterEditor;
|
|
27
|
+
isEditorDisabled: boolean;
|
|
28
28
|
private localizationSubscription;
|
|
29
29
|
constructor(filterService: FilterService, localization: LocalizationService, cdr: ChangeDetectorRef);
|
|
30
30
|
ngOnInit(): void;
|
|
@@ -43,6 +43,7 @@ export declare class FilterExpressionComponent implements OnInit, OnDestroy {
|
|
|
43
43
|
getEditorType(): FilterEditor;
|
|
44
44
|
removeFilterExpression(): void;
|
|
45
45
|
private setOperators;
|
|
46
|
+
onOperatorChange(value: string): void;
|
|
46
47
|
static ɵfac: i0.ɵɵFactoryDeclaration<FilterExpressionComponent, never>;
|
|
47
48
|
static ɵcmp: i0.ɵɵComponentDeclaration<FilterExpressionComponent, "kendo-filter-expression", never, { "index": "index"; "currentItem": "currentItem"; }, { "valueChange": "valueChange"; }, never, never>;
|
|
48
49
|
}
|
package/filter.component.d.ts
CHANGED
|
@@ -64,6 +64,7 @@ export declare class FilterComponent implements OnInit, OnDestroy {
|
|
|
64
64
|
*/
|
|
65
65
|
valueChange: EventEmitter<CompositeFilterDescriptor>;
|
|
66
66
|
private localizationSubscription;
|
|
67
|
+
private _value;
|
|
67
68
|
constructor(filterService: FilterService, localization: LocalizationService, cdr: ChangeDetectorRef);
|
|
68
69
|
ngOnInit(): void;
|
|
69
70
|
ngOnDestroy(): void;
|
|
@@ -76,6 +77,7 @@ export declare class FilterComponent implements OnInit, OnDestroy {
|
|
|
76
77
|
*/
|
|
77
78
|
onValueChange(): void;
|
|
78
79
|
private normalizeFilter;
|
|
80
|
+
private setValue;
|
|
79
81
|
private normalizeValue;
|
|
80
82
|
static ɵfac: i0.ɵɵFactoryDeclaration<FilterComponent, never>;
|
|
81
83
|
static ɵcmp: i0.ɵɵComponentDeclaration<FilterComponent, "kendo-filter", never, { "filters": "filters"; "value": "value"; }, { "valueChange": "valueChange"; }, never, never>;
|
package/filter.service.d.ts
CHANGED
|
@@ -9,9 +9,8 @@ import * as i0 from "@angular/core";
|
|
|
9
9
|
* @hidden
|
|
10
10
|
*/
|
|
11
11
|
export declare class FilterService {
|
|
12
|
-
|
|
12
|
+
normalizedValue: CompositeFilterDescriptor;
|
|
13
13
|
filters: FilterExpression[];
|
|
14
|
-
isEditorDisabled: boolean;
|
|
15
14
|
addFilterGroup(item: CompositeFilterDescriptor): void;
|
|
16
15
|
addFilterExpression(item: CompositeFilterDescriptor): void;
|
|
17
16
|
remove(item: CompositeFilterDescriptor | FilterDescriptor, positionIndex: number, parentItem?: CompositeFilterDescriptor): void;
|
package/package.json
CHANGED