@pepperi-addons/ngx-lib 0.2.55 → 0.2.58-beta.1
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/attachment/attachment.component.d.ts +1 -0
- package/attachment/pepperi-addons-ngx-lib-attachment.metadata.json +1 -1
- package/bundles/pepperi-addons-ngx-lib-attachment.umd.js +6 -1
- package/bundles/pepperi-addons-ngx-lib-attachment.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-checkbox.umd.js +3 -0
- package/bundles/pepperi-addons-ngx-lib-checkbox.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-color.umd.js +6 -1
- package/bundles/pepperi-addons-ngx-lib-color.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-date.umd.js +4 -1
- package/bundles/pepperi-addons-ngx-lib-date.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-form.umd.js +20 -15
- package/bundles/pepperi-addons-ngx-lib-form.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-image.umd.js +6 -1
- package/bundles/pepperi-addons-ngx-lib-image.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-images-filmstrip.umd.js +6 -1
- package/bundles/pepperi-addons-ngx-lib-images-filmstrip.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-list.umd.js +4 -2
- package/bundles/pepperi-addons-ngx-lib-list.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-quantity-selector.umd.js +6 -1
- package/bundles/pepperi-addons-ngx-lib-quantity-selector.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-rich-html-textarea.umd.js +6 -1
- package/bundles/pepperi-addons-ngx-lib-rich-html-textarea.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-select.umd.js +6 -1
- package/bundles/pepperi-addons-ngx-lib-select.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-separator.umd.js +8 -0
- package/bundles/pepperi-addons-ngx-lib-separator.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-signature.umd.js +6 -1
- package/bundles/pepperi-addons-ngx-lib-signature.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-slider.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-smart-filters.umd.js +1432 -173
- package/bundles/pepperi-addons-ngx-lib-smart-filters.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-textarea.umd.js +6 -1
- package/bundles/pepperi-addons-ngx-lib-textarea.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-textbox.umd.js +4 -2
- package/bundles/pepperi-addons-ngx-lib-textbox.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-top-bar.umd.js +1 -1
- package/bundles/pepperi-addons-ngx-lib.umd.js +4 -2
- package/bundles/pepperi-addons-ngx-lib.umd.js.map +1 -1
- package/color/color.component.d.ts +1 -0
- package/color/pepperi-addons-ngx-lib-color.metadata.json +1 -1
- package/core/customization/customization.service.d.ts +1 -0
- package/esm2015/attachment/attachment.component.js +7 -2
- package/esm2015/checkbox/checkbox.component.js +4 -1
- package/esm2015/color/color.component.js +7 -2
- package/esm2015/core/common/services/translate.service.js +1 -1
- package/esm2015/core/customization/customization.service.js +4 -2
- package/esm2015/date/date.component.js +4 -1
- package/esm2015/form/form.component.js +2 -1
- package/esm2015/form/internal-button.component.js +20 -17
- package/esm2015/form/internal-carusel.component.js +2 -1
- package/esm2015/image/image.component.js +7 -2
- package/esm2015/image/image.service.js +1 -1
- package/esm2015/images-filmstrip/images-filmstrip.component.js +7 -2
- package/esm2015/list/list-total.component.js +5 -3
- package/esm2015/quantity-selector/quantity-selector.component.js +7 -2
- package/esm2015/rich-html-textarea/rich-html-textarea.component.js +7 -2
- package/esm2015/select/select.component.js +7 -2
- package/esm2015/separator/separator.component.js +9 -1
- package/esm2015/signature/signature.component.js +7 -2
- package/esm2015/slider/slider.component.js +1 -1
- package/esm2015/smart-filters/boolean-filter/boolean-filter.component.js +12 -2
- package/esm2015/smart-filters/common/model/base-filter-component.js +40 -10
- package/esm2015/smart-filters/common/model/creator.js +8 -2
- package/esm2015/smart-filters/common/model/field.js +12 -1
- package/esm2015/smart-filters/common/model/operator.js +8 -8
- package/esm2015/smart-filters/common/model/type.js +1 -1
- package/esm2015/smart-filters/date-filter/date-filter.component.js +45 -2
- package/esm2015/smart-filters/filter-builder/common/model/filter.js +2 -0
- package/esm2015/smart-filters/filter-builder/common/model/legacy.js +2 -0
- package/esm2015/smart-filters/filter-builder/common/model/operator-unit.js +42 -0
- package/esm2015/smart-filters/filter-builder/common/model/operator.js +207 -0
- package/esm2015/smart-filters/filter-builder/common/model/type-map.js +27 -0
- package/esm2015/smart-filters/filter-builder/common/model/type.js +6 -0
- package/esm2015/smart-filters/filter-builder/common/pipes/filter-item-counter.pipe.js +18 -0
- package/esm2015/smart-filters/filter-builder/common/services/output-filter.service.js +132 -0
- package/esm2015/smart-filters/filter-builder/common/services/type-convertor.service.js +44 -0
- package/esm2015/smart-filters/filter-builder/filter-builder-item/filter-builder-item.component.js +106 -0
- package/esm2015/smart-filters/filter-builder/filter-builder-section/filter-builder-section.component.js +50 -0
- package/esm2015/smart-filters/filter-builder/filter-builder.component.js +65 -0
- package/esm2015/smart-filters/filter-builder/filter-builder.service.js +261 -0
- package/esm2015/smart-filters/index.js +5 -0
- package/esm2015/smart-filters/multi-select-filter/multi-select-filter.component.js +53 -14
- package/esm2015/smart-filters/number-filter/number-filter.component.js +25 -2
- package/esm2015/smart-filters/pepperi-addons-ngx-lib-smart-filters.js +8 -1
- package/esm2015/smart-filters/public-api.js +2 -1
- package/esm2015/smart-filters/smart-filters.module.js +14 -2
- package/esm2015/smart-filters/text-filter/text-filter.component.js +79 -0
- package/esm2015/textarea/textarea.component.js +7 -2
- package/esm2015/textbox/textbox.component.js +5 -3
- package/esm2015/top-bar/top-bar.component.js +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-attachment.js +6 -1
- package/fesm2015/pepperi-addons-ngx-lib-attachment.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-checkbox.js +3 -0
- package/fesm2015/pepperi-addons-ngx-lib-checkbox.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-color.js +6 -1
- package/fesm2015/pepperi-addons-ngx-lib-color.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-date.js +3 -0
- package/fesm2015/pepperi-addons-ngx-lib-date.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-form.js +20 -15
- package/fesm2015/pepperi-addons-ngx-lib-form.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-image.js +6 -1
- package/fesm2015/pepperi-addons-ngx-lib-image.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-images-filmstrip.js +6 -1
- package/fesm2015/pepperi-addons-ngx-lib-images-filmstrip.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-list.js +4 -2
- package/fesm2015/pepperi-addons-ngx-lib-list.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-quantity-selector.js +6 -1
- package/fesm2015/pepperi-addons-ngx-lib-quantity-selector.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-rich-html-textarea.js +6 -1
- package/fesm2015/pepperi-addons-ngx-lib-rich-html-textarea.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-select.js +6 -1
- package/fesm2015/pepperi-addons-ngx-lib-select.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-separator.js +8 -0
- package/fesm2015/pepperi-addons-ngx-lib-separator.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-signature.js +6 -1
- package/fesm2015/pepperi-addons-ngx-lib-signature.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-slider.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-smart-filters.js +1293 -128
- package/fesm2015/pepperi-addons-ngx-lib-smart-filters.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-textarea.js +6 -1
- package/fesm2015/pepperi-addons-ngx-lib-textarea.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-textbox.js +4 -2
- package/fesm2015/pepperi-addons-ngx-lib-textbox.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-top-bar.js +1 -1
- package/fesm2015/pepperi-addons-ngx-lib.js +3 -1
- package/fesm2015/pepperi-addons-ngx-lib.js.map +1 -1
- package/form/internal-button.component.d.ts +0 -1
- package/image/image.component.d.ts +1 -0
- package/image/pepperi-addons-ngx-lib-image.metadata.json +1 -1
- package/images-filmstrip/images-filmstrip.component.d.ts +1 -0
- package/images-filmstrip/pepperi-addons-ngx-lib-images-filmstrip.metadata.json +1 -1
- package/list/list-total.component.d.ts +2 -0
- package/list/pepperi-addons-ngx-lib-list.metadata.json +1 -1
- package/package.json +4 -4
- package/pepperi-addons-ngx-lib.metadata.json +1 -1
- package/quantity-selector/pepperi-addons-ngx-lib-quantity-selector.metadata.json +1 -1
- package/quantity-selector/quantity-selector.component.d.ts +1 -0
- package/rich-html-textarea/pepperi-addons-ngx-lib-rich-html-textarea.metadata.json +1 -1
- package/rich-html-textarea/rich-html-textarea.component.d.ts +1 -0
- package/select/pepperi-addons-ngx-lib-select.metadata.json +1 -1
- package/select/select.component.d.ts +1 -0
- package/separator/pepperi-addons-ngx-lib-separator.metadata.json +1 -1
- package/signature/pepperi-addons-ngx-lib-signature.metadata.json +1 -1
- package/signature/signature.component.d.ts +1 -0
- package/smart-filters/boolean-filter/boolean-filter.component.d.ts +5 -1
- package/smart-filters/common/model/base-filter-component.d.ts +10 -1
- package/smart-filters/common/model/field.d.ts +4 -0
- package/smart-filters/common/model/operator.d.ts +1 -0
- package/smart-filters/common/model/type.d.ts +2 -2
- package/smart-filters/date-filter/date-filter.component.d.ts +8 -1
- package/smart-filters/filter-builder/common/model/filter.d.ts +6 -0
- package/smart-filters/filter-builder/common/model/legacy.d.ts +23 -0
- package/smart-filters/filter-builder/common/model/operator-unit.d.ts +13 -0
- package/smart-filters/filter-builder/common/model/operator.d.ts +21 -0
- package/smart-filters/filter-builder/common/model/type-map.d.ts +12 -0
- package/smart-filters/filter-builder/common/model/type.d.ts +4 -0
- package/smart-filters/filter-builder/common/pipes/filter-item-counter.pipe.d.ts +5 -0
- package/smart-filters/filter-builder/common/services/output-filter.service.d.ts +52 -0
- package/smart-filters/filter-builder/common/services/type-convertor.service.d.ts +10 -0
- package/smart-filters/filter-builder/filter-builder-item/filter-builder-item.component.d.ts +32 -0
- package/smart-filters/filter-builder/filter-builder-section/filter-builder-section.component.d.ts +22 -0
- package/smart-filters/filter-builder/filter-builder-section/filter-builder-section.component.theme.scss +6 -0
- package/smart-filters/filter-builder/filter-builder.component.d.ts +22 -0
- package/smart-filters/filter-builder/filter-builder.service.d.ts +90 -0
- package/smart-filters/index.d.ts +1 -0
- package/smart-filters/multi-select-filter/multi-select-filter.component.d.ts +6 -0
- package/smart-filters/number-filter/number-filter.component.d.ts +5 -0
- package/smart-filters/pepperi-addons-ngx-lib-smart-filters.d.ts +7 -0
- package/smart-filters/pepperi-addons-ngx-lib-smart-filters.metadata.json +1 -1
- package/smart-filters/public-api.d.ts +1 -0
- package/smart-filters/text-filter/text-filter.component.d.ts +17 -0
- package/src/assets/i18n/en.ngx-lib.json +2 -1
- package/src/core/style/components/general.scss +4 -2
- package/textarea/pepperi-addons-ngx-lib-textarea.metadata.json +1 -1
- package/textarea/textarea.component.d.ts +1 -0
- package/theming.scss +4 -0
- package/top-bar/pepperi-addons-ngx-lib-top-bar.metadata.json +1 -1
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
1
2
|
import { BaseFilterComponent } from '../common/model/base-filter-component';
|
|
2
3
|
import { IPepSmartFilterOperator } from '../common/model/operator';
|
|
3
4
|
import { IPepSmartFilterDataValue } from '../common/model/filter';
|
|
4
|
-
export declare class PepBooleanFilterComponent extends BaseFilterComponent {
|
|
5
|
+
export declare class PepBooleanFilterComponent extends BaseFilterComponent implements OnInit {
|
|
6
|
+
ngOnInit(): void;
|
|
5
7
|
getDefaultOperator(): IPepSmartFilterOperator;
|
|
6
8
|
getFilterValue(): IPepSmartFilterDataValue;
|
|
9
|
+
onRadioChanged(): void;
|
|
10
|
+
onValueChanged(value: any): void;
|
|
7
11
|
}
|
|
@@ -5,6 +5,7 @@ import { IPepSmartFilterOperator, IPepSmartFilterOperatorUnit } from './operator
|
|
|
5
5
|
import { IPepSmartFilterData, IPepSmartFilterDataValue } from './filter';
|
|
6
6
|
import { PepSmartFilterBaseField } from './field';
|
|
7
7
|
import { TranslateService } from '@ngx-translate/core';
|
|
8
|
+
import { PepTypeConvertorService } from '../../filter-builder/common/services/type-convertor.service';
|
|
8
9
|
export declare abstract class BaseFilterComponent implements OnInit, OnChanges, OnDestroy {
|
|
9
10
|
private viewContainerRef;
|
|
10
11
|
private injector;
|
|
@@ -13,6 +14,7 @@ export declare abstract class BaseFilterComponent implements OnInit, OnChanges,
|
|
|
13
14
|
protected translate: TranslateService;
|
|
14
15
|
protected validator: PepValidatorService;
|
|
15
16
|
protected renderer: Renderer2;
|
|
17
|
+
typeConvertorService: PepTypeConvertorService;
|
|
16
18
|
private readonly _destroyed;
|
|
17
19
|
private actionsContainerRef;
|
|
18
20
|
private _fieldIdWithNoDots;
|
|
@@ -22,6 +24,12 @@ export declare abstract class BaseFilterComponent implements OnInit, OnChanges,
|
|
|
22
24
|
private _filter;
|
|
23
25
|
set filter(value: IPepSmartFilterData);
|
|
24
26
|
get filter(): IPepSmartFilterData;
|
|
27
|
+
protected _parentForm: FormGroup;
|
|
28
|
+
set parentForm(form: FormGroup);
|
|
29
|
+
emitOnChange: boolean;
|
|
30
|
+
inline: boolean;
|
|
31
|
+
showActionButtons: boolean;
|
|
32
|
+
renderTitle: boolean;
|
|
25
33
|
filterClear: EventEmitter<void>;
|
|
26
34
|
filterChange: EventEmitter<IPepSmartFilterData>;
|
|
27
35
|
private _operator;
|
|
@@ -39,11 +47,12 @@ export declare abstract class BaseFilterComponent implements OnInit, OnChanges,
|
|
|
39
47
|
protected readonly OPERATORS_TRANSLATION_PREFIX = "SMART_FILTERS.OPERATORS";
|
|
40
48
|
protected readonly OPERATOR_UNITS_TRANSLATION_PREFIX = "SMART_FILTERS.OPERATOR_UNITS";
|
|
41
49
|
form: FormGroup;
|
|
42
|
-
constructor(viewContainerRef: ViewContainerRef, injector: Injector, resolver: ComponentFactoryResolver, builder: FormBuilder, translate: TranslateService, validator: PepValidatorService, renderer: Renderer2);
|
|
50
|
+
constructor(viewContainerRef: ViewContainerRef, injector: Injector, resolver: ComponentFactoryResolver, builder: FormBuilder, translate: TranslateService, validator: PepValidatorService, renderer: Renderer2, typeConvertorService: PepTypeConvertorService);
|
|
43
51
|
private createActionsComponent;
|
|
44
52
|
private setupForm;
|
|
45
53
|
private setupOperators;
|
|
46
54
|
private setupFilter;
|
|
55
|
+
protected updateParentForm(): void;
|
|
47
56
|
protected getDestroyer(): import("rxjs").MonoTypeOperatorFunction<unknown>;
|
|
48
57
|
private updateValidity;
|
|
49
58
|
protected loadOperatorsOptions(): void;
|
|
@@ -25,6 +25,10 @@ export declare abstract class PepSmartFilterBaseField implements IPepSmartFilter
|
|
|
25
25
|
constructor(field: IPepSmartFilterField);
|
|
26
26
|
protected abstract getType(): PepSmartFilterType;
|
|
27
27
|
}
|
|
28
|
+
export declare class PepSmartFilterTextField extends PepSmartFilterBaseField {
|
|
29
|
+
constructor(field: IPepSmartFilterField);
|
|
30
|
+
getType(): PepSmartFilterType;
|
|
31
|
+
}
|
|
28
32
|
export declare class PepSmartFilterBooleanField extends PepSmartFilterBaseField {
|
|
29
33
|
constructor(field: IPepSmartFilterField);
|
|
30
34
|
getType(): PepSmartFilterType;
|
|
@@ -11,6 +11,7 @@ export declare const PepSmartFilterOperators: {
|
|
|
11
11
|
LessThan: IPepSmartFilterOperator;
|
|
12
12
|
GreaterThan: IPepSmartFilterOperator;
|
|
13
13
|
NumberRange: IPepSmartFilterOperator;
|
|
14
|
+
Contains: IPepSmartFilterOperator;
|
|
14
15
|
InTheLast: IPepSmartFilterOperator;
|
|
15
16
|
Today: IPepSmartFilterOperator;
|
|
16
17
|
ThisWeek: IPepSmartFilterOperator;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare type PepSmartFilterComponentType = 'number' | 'date' | 'multi-select' | 'boolean';
|
|
2
|
-
export declare type PepSmartFilterType = 'boolean' | 'currency' | 'date' | 'date-time' | 'int' | 'multi-select' | 'percentage' | 'real';
|
|
1
|
+
export declare type PepSmartFilterComponentType = 'text' | 'number' | 'date' | 'multi-select' | 'boolean';
|
|
2
|
+
export declare type PepSmartFilterType = 'text' | 'boolean' | 'currency' | 'date' | 'date-time' | 'int' | 'multi-select' | 'percentage' | 'real';
|
|
3
3
|
export declare type PepSmartFilterOperatorType = 'eq' | 'neq' | 'lt' | 'gt' | 'ltoe' | 'gtoe' | 'numberRange' | 'contains' | 'beginsWith' | 'endsWith' | 'after' | 'before' | 'inTheLast' | 'today' | 'thisWeek' | 'thisMonth' | 'dateRange' | 'dueIn' | 'on' | 'notInTheLast' | 'notDueIn' | 'isEmpty' | 'isNotEmpty' | 'in';
|
|
4
4
|
export declare type PepSmartFilterOperatorUnitType = 'days' | 'weeks' | 'months' | 'years';
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
1
2
|
import { BaseFilterComponent } from '../common/model/base-filter-component';
|
|
2
3
|
import { IPepSmartFilterOperator, IPepSmartFilterOperatorUnit } from '../common/model/operator';
|
|
3
4
|
import { IPepSmartFilterDataValue } from '../common/model/filter';
|
|
4
5
|
import { IPepOption } from '@pepperi-addons/ngx-lib';
|
|
5
|
-
export declare class PepDateFilterComponent extends BaseFilterComponent {
|
|
6
|
+
export declare class PepDateFilterComponent extends BaseFilterComponent implements OnInit {
|
|
6
7
|
PepSmartFilterOperators: {
|
|
7
8
|
Equals: IPepSmartFilterOperator;
|
|
8
9
|
NotEqual: IPepSmartFilterOperator;
|
|
9
10
|
LessThan: IPepSmartFilterOperator;
|
|
10
11
|
GreaterThan: IPepSmartFilterOperator;
|
|
11
12
|
NumberRange: IPepSmartFilterOperator;
|
|
13
|
+
Contains: IPepSmartFilterOperator;
|
|
12
14
|
InTheLast: IPepSmartFilterOperator;
|
|
13
15
|
Today: IPepSmartFilterOperator;
|
|
14
16
|
ThisWeek: IPepSmartFilterOperator;
|
|
@@ -24,11 +26,16 @@ export declare class PepDateFilterComponent extends BaseFilterComponent {
|
|
|
24
26
|
};
|
|
25
27
|
chooseTimeOptions: Array<IPepOption>;
|
|
26
28
|
chooseTimeUnitOptions: Array<IPepOption>;
|
|
29
|
+
operatorWidth: string;
|
|
30
|
+
fieldsWidth: string;
|
|
31
|
+
ngOnInit(): void;
|
|
27
32
|
getDefaultOperator(): IPepSmartFilterOperator;
|
|
28
33
|
getDefaultOperatorUnit(): IPepSmartFilterOperatorUnit;
|
|
29
34
|
getFilterValue(): IPepSmartFilterDataValue;
|
|
30
35
|
loadOperatorsOptions(): void;
|
|
31
36
|
setFieldsStateAndValidators(): void;
|
|
37
|
+
setControlsWidth(): void;
|
|
32
38
|
onOperatorChanged(value: string): void;
|
|
33
39
|
onTimeUnitChanged(value: string): void;
|
|
40
|
+
onDateValueChanged(): void;
|
|
34
41
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { PepOperatorTypes } from './type';
|
|
2
|
+
export interface IPepField {
|
|
3
|
+
FieldID: string;
|
|
4
|
+
FieldType: string;
|
|
5
|
+
Title: string;
|
|
6
|
+
OptionalValues: IPepFieldOptionalValues[];
|
|
7
|
+
}
|
|
8
|
+
export interface IPepFieldOptionalValues {
|
|
9
|
+
Key: string;
|
|
10
|
+
Value: string;
|
|
11
|
+
}
|
|
12
|
+
export interface IPepJSONSection {
|
|
13
|
+
ComplexId: string;
|
|
14
|
+
Operation: PepOperatorTypes;
|
|
15
|
+
LeftNode?: IPepJSONSection | IPepJSONItem;
|
|
16
|
+
RightNode?: IPepJSONSection | IPepJSONItem;
|
|
17
|
+
}
|
|
18
|
+
export interface IPepJSONItem {
|
|
19
|
+
ExpressionId: string;
|
|
20
|
+
ApiName: string;
|
|
21
|
+
Operation: string;
|
|
22
|
+
Values: any[];
|
|
23
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IPepSmartFilterOperatorUnit } from '../../../common/model/operator';
|
|
2
|
+
/**
|
|
3
|
+
* gets a smart filter operation unit item
|
|
4
|
+
* @param operationUnit legacy operation unit
|
|
5
|
+
* @returns smart filter operation unit item
|
|
6
|
+
*/
|
|
7
|
+
export declare function getSmartBuilderOperationUnit(operationUnit: string): IPepSmartFilterOperatorUnit | null;
|
|
8
|
+
/**
|
|
9
|
+
* gets a legacy operation unit value
|
|
10
|
+
* @param operationUnit smart filter operation unit item
|
|
11
|
+
* @returns legacy operation unit value
|
|
12
|
+
*/
|
|
13
|
+
export declare function getLegacyOperationUnit(operationUnit: IPepSmartFilterOperatorUnit): string | null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IPepSmartFilterOperator } from '../../../common/model/operator';
|
|
2
|
+
import { PepSmartFilterType } from '../../../common/model/type';
|
|
3
|
+
export interface IPepFilterBuilderOperator {
|
|
4
|
+
legacy: string;
|
|
5
|
+
smartFilter: IPepSmartFilterOperator;
|
|
6
|
+
type: PepSmartFilterType[] | null;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* gets a smart filter operator item
|
|
10
|
+
* @param operator legacy operator
|
|
11
|
+
* @param type smart filter's type
|
|
12
|
+
* @returns smart filter operator item
|
|
13
|
+
*/
|
|
14
|
+
export declare function getSmartBuilderOperator(operator: string, type: PepSmartFilterType): IPepSmartFilterOperator | null;
|
|
15
|
+
/**
|
|
16
|
+
* gets a legacy operator value
|
|
17
|
+
* @param operator smart filter operator item
|
|
18
|
+
* @param type smart filter's type
|
|
19
|
+
* @returns legacy operator value
|
|
20
|
+
*/
|
|
21
|
+
export declare function getLegacyOperator(operator: IPepSmartFilterOperator, type: PepSmartFilterType): string | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PepSmartFilterType } from '../../../common/model/type';
|
|
2
|
+
export declare class PepFilterBuilderTypeMap {
|
|
3
|
+
private map;
|
|
4
|
+
constructor();
|
|
5
|
+
private loadTypes;
|
|
6
|
+
/**
|
|
7
|
+
* Converts legacy field type to smart builder type
|
|
8
|
+
* @param type legacy type
|
|
9
|
+
* @returns smart builder field type
|
|
10
|
+
*/
|
|
11
|
+
getSmartBuilderType(key: string): PepSmartFilterType | null;
|
|
12
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { IPepSmartFilterField } from 'projects/ngx-lib/smart-filters';
|
|
2
|
+
export declare class PepOutputFilterService {
|
|
3
|
+
private _json;
|
|
4
|
+
private _fields;
|
|
5
|
+
private _firstItem;
|
|
6
|
+
private _complexIdCounter;
|
|
7
|
+
private _expressionIdCounter;
|
|
8
|
+
constructor();
|
|
9
|
+
/**
|
|
10
|
+
* generates a legacy JSON
|
|
11
|
+
* @param json UI smart filters structure
|
|
12
|
+
* @param fields smart filter field
|
|
13
|
+
* @returns legacy JSON
|
|
14
|
+
*/
|
|
15
|
+
generateJson(json: any, fields: Array<IPepSmartFilterField>): any;
|
|
16
|
+
/**
|
|
17
|
+
* reset properties
|
|
18
|
+
*/
|
|
19
|
+
private initProperties;
|
|
20
|
+
/**
|
|
21
|
+
* a recursive function dynamically builds legacy JSON structure
|
|
22
|
+
* @param current UI object represents either a section or filter component
|
|
23
|
+
*/
|
|
24
|
+
private treeWalk;
|
|
25
|
+
/**
|
|
26
|
+
* adds a filter to json and wrap it with complex operator
|
|
27
|
+
* @param item expression item
|
|
28
|
+
* @param operator complex operator
|
|
29
|
+
*/
|
|
30
|
+
private createItem;
|
|
31
|
+
/**
|
|
32
|
+
* creates a legacy complex object
|
|
33
|
+
* @param left LeftNode object
|
|
34
|
+
* @param right RightNode object
|
|
35
|
+
* @param operator AND/OR operator
|
|
36
|
+
* @returns complex object
|
|
37
|
+
*/
|
|
38
|
+
private createSection;
|
|
39
|
+
/**
|
|
40
|
+
* gets legacy filter values object
|
|
41
|
+
* @param current UI filter object's values
|
|
42
|
+
* @returns an array represents legacy values
|
|
43
|
+
*/
|
|
44
|
+
private getItemValues;
|
|
45
|
+
/**
|
|
46
|
+
* generates an array of keys of multi-select control
|
|
47
|
+
* @param values an array of the selected values
|
|
48
|
+
* @param id filter's selected field
|
|
49
|
+
* @returns an array of keys
|
|
50
|
+
*/
|
|
51
|
+
private getFieldKeys;
|
|
52
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IPepOption } from '@pepperi-addons/ngx-lib';
|
|
2
|
+
export declare class PepTypeConvertorService {
|
|
3
|
+
private readonly _operators;
|
|
4
|
+
private readonly _booleans;
|
|
5
|
+
get operators(): IPepOption[];
|
|
6
|
+
get booleans(): IPepOption[];
|
|
7
|
+
constructor();
|
|
8
|
+
private initOperators;
|
|
9
|
+
private initBooleans;
|
|
10
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { FormBuilder, FormGroup } from '@angular/forms';
|
|
3
|
+
import { PepSmartFilterBaseField, IPepSmartFilterField } from '../../common/model/field';
|
|
4
|
+
import { IPepSmartFilterData } from '../../common/model/filter';
|
|
5
|
+
import { IPepOption } from '@pepperi-addons/ngx-lib';
|
|
6
|
+
export declare class FilterBuilderItemComponent {
|
|
7
|
+
private _fb;
|
|
8
|
+
formKey: string;
|
|
9
|
+
_fields: Array<any>;
|
|
10
|
+
_options: IPepOption[];
|
|
11
|
+
set fields(list: Array<IPepSmartFilterField>);
|
|
12
|
+
_selectedField: PepSmartFilterBaseField;
|
|
13
|
+
set selected(value: any);
|
|
14
|
+
_filter: IPepSmartFilterData;
|
|
15
|
+
set filter(value: IPepSmartFilterData);
|
|
16
|
+
_parentForm: FormGroup;
|
|
17
|
+
set parentForm(value: FormGroup);
|
|
18
|
+
filterChange: EventEmitter<any>;
|
|
19
|
+
remove: EventEmitter<any>;
|
|
20
|
+
test: any;
|
|
21
|
+
_form: FormGroup;
|
|
22
|
+
fieldWidth: number;
|
|
23
|
+
filterWidth: number;
|
|
24
|
+
binWidth: number;
|
|
25
|
+
constructor(_fb: FormBuilder);
|
|
26
|
+
ngOnInit(): void;
|
|
27
|
+
setupForm(): void;
|
|
28
|
+
addToParentForm(): void;
|
|
29
|
+
onFieldChanged(key: any): void;
|
|
30
|
+
onFilterChanged(): void;
|
|
31
|
+
onDeleteItemClicked(): void;
|
|
32
|
+
}
|
package/smart-filters/filter-builder/filter-builder-section/filter-builder-section.component.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { EventEmitter, ViewContainerRef } from '@angular/core';
|
|
2
|
+
import { FormGroup } from '@angular/forms';
|
|
3
|
+
import { FilterBuilderService } from '../filter-builder.service';
|
|
4
|
+
import { PepTypeConvertorService } from '../common/services/type-convertor.service';
|
|
5
|
+
export declare class FilterBuilderSectionComponent {
|
|
6
|
+
filterBuilderService: FilterBuilderService;
|
|
7
|
+
typeConvertorService: PepTypeConvertorService;
|
|
8
|
+
form: FormGroup;
|
|
9
|
+
depth: number;
|
|
10
|
+
remove: EventEmitter<any>;
|
|
11
|
+
operatorChange: EventEmitter<any>;
|
|
12
|
+
sectionContainer: ViewContainerRef;
|
|
13
|
+
constructor(filterBuilderService: FilterBuilderService, typeConvertorService: PepTypeConvertorService);
|
|
14
|
+
ngOnInit(): void;
|
|
15
|
+
get f(): {
|
|
16
|
+
[key: string]: import("@angular/forms").AbstractControl;
|
|
17
|
+
};
|
|
18
|
+
onOperatorChanged(value: any): void;
|
|
19
|
+
onAddRuleClicked(): void;
|
|
20
|
+
onAddRuleSetClicked(): void;
|
|
21
|
+
onDeleteSectionClicked(): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { EventEmitter, OnInit, OnDestroy, ViewContainerRef } from '@angular/core';
|
|
2
|
+
import { IPepField, IPepJSONSection } from './common/model/legacy';
|
|
3
|
+
import { FilterBuilderService } from './filter-builder.service';
|
|
4
|
+
import { FormGroup, FormBuilder } from '@angular/forms';
|
|
5
|
+
import { Subscription } from 'rxjs';
|
|
6
|
+
export declare class FilterBuilderComponent implements OnInit, OnDestroy {
|
|
7
|
+
private _fb;
|
|
8
|
+
private _filterBuilderService;
|
|
9
|
+
json: IPepJSONSection;
|
|
10
|
+
fields: Array<IPepField>;
|
|
11
|
+
filters: EventEmitter<any>;
|
|
12
|
+
formValidationChange: EventEmitter<boolean>;
|
|
13
|
+
filterRoot: ViewContainerRef;
|
|
14
|
+
_formSubscription$: Subscription;
|
|
15
|
+
_outputJsonSubscription$: Subscription;
|
|
16
|
+
_isFormValid: boolean;
|
|
17
|
+
form: FormGroup;
|
|
18
|
+
constructor(_fb: FormBuilder, _filterBuilderService: FilterBuilderService);
|
|
19
|
+
setupForm(): void;
|
|
20
|
+
ngOnInit(): void;
|
|
21
|
+
ngOnDestroy(): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { ViewContainerRef, ComponentFactoryResolver } from '@angular/core';
|
|
2
|
+
import { FormBuilder, FormGroup } from '@angular/forms';
|
|
3
|
+
import { IPepField, IPepJSONSection, IPepJSONItem } from './common/model/legacy';
|
|
4
|
+
import { PepOutputFilterService } from './common/services/output-filter.service';
|
|
5
|
+
import { PepOperatorTypes } from './common/model/type';
|
|
6
|
+
export declare class FilterBuilderService {
|
|
7
|
+
private _fb;
|
|
8
|
+
private _resolver;
|
|
9
|
+
private _outputJsonService;
|
|
10
|
+
private readonly MAX_STRUCTURE_DEPTH;
|
|
11
|
+
private _outputJsonSubject;
|
|
12
|
+
private _smartFilterFields;
|
|
13
|
+
private _form;
|
|
14
|
+
triggerOutputJson: import("rxjs").Observable<any>;
|
|
15
|
+
constructor(_fb: FormBuilder, _resolver: ComponentFactoryResolver, _outputJsonService: PepOutputFilterService);
|
|
16
|
+
get maxDepth(): number;
|
|
17
|
+
/**
|
|
18
|
+
* creates a dynamic filter structure
|
|
19
|
+
* might has a different structure than the input's due to merge of parent-child elements
|
|
20
|
+
* @param json legacy JSON
|
|
21
|
+
* @param fields an array of legacy fields
|
|
22
|
+
* @param containerRef reference to root element
|
|
23
|
+
*/
|
|
24
|
+
createFilterTree(json: IPepJSONSection | null, fields: Array<IPepField>, form: FormGroup, containerRef: ViewContainerRef): void;
|
|
25
|
+
/**
|
|
26
|
+
* checks if the object contains property
|
|
27
|
+
* @param obj object
|
|
28
|
+
* @param prop property name
|
|
29
|
+
* @returns true if contains, false otherwise
|
|
30
|
+
*/
|
|
31
|
+
private hasProperty;
|
|
32
|
+
/**
|
|
33
|
+
* a recursive function dynamically builds filters structure
|
|
34
|
+
* @param parent legacy complex object
|
|
35
|
+
* @param current child legacy object (either another complex or expression type)
|
|
36
|
+
* @param containerRef parent element
|
|
37
|
+
* @param parentForm parent form
|
|
38
|
+
*/
|
|
39
|
+
private flatten;
|
|
40
|
+
/**
|
|
41
|
+
* creates a container object of two or more child filter items
|
|
42
|
+
* @param operator AND/OR operator
|
|
43
|
+
* @param containerRef parent element
|
|
44
|
+
* @param parentForm parent form
|
|
45
|
+
* @param depth
|
|
46
|
+
* @returns an object containing the current element and current form
|
|
47
|
+
*/
|
|
48
|
+
createSection(operator: PepOperatorTypes, containerRef: ViewContainerRef, parentForm: FormGroup, depth: number): {
|
|
49
|
+
containerRef: ViewContainerRef;
|
|
50
|
+
parentForm: FormGroup;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* creates a component represents filter item (leaf element - has no childs)
|
|
54
|
+
* @param current filter legacy element
|
|
55
|
+
* @param containerRef parent element
|
|
56
|
+
* @param parentForm parent form
|
|
57
|
+
*/
|
|
58
|
+
createItem(current: IPepJSONItem, containerRef: ViewContainerRef, parentForm: FormGroup): void;
|
|
59
|
+
/**
|
|
60
|
+
* creates a smart filter object
|
|
61
|
+
* @param current filter legacy element
|
|
62
|
+
* @param field filter's selected field
|
|
63
|
+
* @returns smart filter object
|
|
64
|
+
*/
|
|
65
|
+
private getFilter;
|
|
66
|
+
/**
|
|
67
|
+
* get smart filter field
|
|
68
|
+
* @param current filter legacy element
|
|
69
|
+
* @returns smart filter field, if not found returns the first fields
|
|
70
|
+
*/
|
|
71
|
+
private getSelectedField;
|
|
72
|
+
/**
|
|
73
|
+
* gets smart filter's values data
|
|
74
|
+
* @param current filter legacy element
|
|
75
|
+
* @param operator smart filter operator
|
|
76
|
+
* @param field filter's selected field
|
|
77
|
+
* @returns object contains the filter values data
|
|
78
|
+
*/
|
|
79
|
+
private getFilterValues;
|
|
80
|
+
/**
|
|
81
|
+
* converts legacy fields to smart filter fields
|
|
82
|
+
* @param fields legacy fields array
|
|
83
|
+
* @returns smart filter fields array
|
|
84
|
+
*/
|
|
85
|
+
private convertToSmartFilterFields;
|
|
86
|
+
/**
|
|
87
|
+
* creates a legacy output JSON
|
|
88
|
+
*/
|
|
89
|
+
private createOutputJson;
|
|
90
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './public-api';
|
|
@@ -2,6 +2,7 @@ import { AfterViewInit, ElementRef } from '@angular/core';
|
|
|
2
2
|
import { OnInit } from '@angular/core';
|
|
3
3
|
import { BaseFilterComponent } from '../common/model/base-filter-component';
|
|
4
4
|
import { IPepSmartFilterOperator } from '../common/model/operator';
|
|
5
|
+
import { IPepOption } from '@pepperi-addons/ngx-lib';
|
|
5
6
|
import { IPepSmartFilterDataValue } from '../common/model/filter';
|
|
6
7
|
import { IPepSmartFilterFieldOption } from '../common/model/field';
|
|
7
8
|
import { Observable } from 'rxjs';
|
|
@@ -16,12 +17,16 @@ export declare class PepMultiSelectFilterComponent extends BaseFilterComponent i
|
|
|
16
17
|
options: PepMultiSelectFilterOption[];
|
|
17
18
|
filteredOptions$: Observable<any>;
|
|
18
19
|
searchControl: FormControl;
|
|
20
|
+
selected: string;
|
|
21
|
+
inlineOptions: IPepOption[];
|
|
19
22
|
optionsContainer: ElementRef;
|
|
20
23
|
private readonly MAX_OPTIONS_TO_SHOW;
|
|
21
24
|
private virtualScroller;
|
|
22
25
|
numberOptionsToShowSearch: number;
|
|
23
26
|
ngOnInit(): void;
|
|
24
27
|
ngAfterViewInit(): void;
|
|
28
|
+
private inlineControlInit;
|
|
29
|
+
private noneInlineControlInit;
|
|
25
30
|
initOptionsSelectedValues(selectedValues: string[]): void;
|
|
26
31
|
private calcOptionsHeight;
|
|
27
32
|
private filterOptions;
|
|
@@ -29,5 +34,6 @@ export declare class PepMultiSelectFilterComponent extends BaseFilterComponent i
|
|
|
29
34
|
getFilterValue(): IPepSmartFilterDataValue;
|
|
30
35
|
initFilter(): void;
|
|
31
36
|
onOptionChange(option: PepMultiSelectFilterOption, event: MatCheckboxChange): void;
|
|
37
|
+
onMultiSelectChanged(value: string): void;
|
|
32
38
|
}
|
|
33
39
|
export {};
|
|
@@ -10,6 +10,7 @@ export declare class PepNumberFilterComponent extends BaseFilterComponent implem
|
|
|
10
10
|
LessThan: IPepSmartFilterOperator;
|
|
11
11
|
GreaterThan: IPepSmartFilterOperator;
|
|
12
12
|
NumberRange: IPepSmartFilterOperator;
|
|
13
|
+
Contains: IPepSmartFilterOperator;
|
|
13
14
|
InTheLast: IPepSmartFilterOperator;
|
|
14
15
|
Today: IPepSmartFilterOperator;
|
|
15
16
|
ThisWeek: IPepSmartFilterOperator;
|
|
@@ -24,10 +25,14 @@ export declare class PepNumberFilterComponent extends BaseFilterComponent implem
|
|
|
24
25
|
In: IPepSmartFilterOperator;
|
|
25
26
|
};
|
|
26
27
|
chooseTypeOptions: Array<IPepOption>;
|
|
28
|
+
operatorWidth: string;
|
|
29
|
+
firstControlWidth: string;
|
|
27
30
|
ngOnInit(): void;
|
|
28
31
|
getDefaultOperator(): IPepSmartFilterOperator;
|
|
29
32
|
getFilterValue(): IPepSmartFilterDataValue;
|
|
30
33
|
loadOperatorsOptions(): void;
|
|
31
34
|
setFieldsStateAndValidators(): void;
|
|
35
|
+
setControlsWidth(): void;
|
|
32
36
|
onOperatorChanged(value: string): void;
|
|
37
|
+
onValueChanged(): void;
|
|
33
38
|
}
|
|
@@ -2,3 +2,10 @@
|
|
|
2
2
|
* Generated bundle index. Do not edit.
|
|
3
3
|
*/
|
|
4
4
|
export * from './public-api';
|
|
5
|
+
export { FilterItemCounterPipe as ɵg } from './filter-builder/common/pipes/filter-item-counter.pipe';
|
|
6
|
+
export { PepOutputFilterService as ɵb } from './filter-builder/common/services/output-filter.service';
|
|
7
|
+
export { PepTypeConvertorService as ɵd } from './filter-builder/common/services/type-convertor.service';
|
|
8
|
+
export { FilterBuilderItemComponent as ɵf } from './filter-builder/filter-builder-item/filter-builder-item.component';
|
|
9
|
+
export { FilterBuilderSectionComponent as ɵe } from './filter-builder/filter-builder-section/filter-builder-section.component';
|
|
10
|
+
export { FilterBuilderService as ɵa } from './filter-builder/filter-builder.service';
|
|
11
|
+
export { PepTextFilterComponent as ɵc } from './text-filter/text-filter.component';
|