@enigmatry/entry-components 15.2.0 → 16.0.0-preview
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/common/directives/auto-disable-button.directive.d.ts +1 -1
- package/dialog/dialogs/entry-dialog.component.d.ts +1 -1
- package/{esm2020 → esm2022}/button/entry-button.directive.mjs +4 -4
- package/{esm2020 → esm2022}/button/entry-button.module.mjs +7 -7
- package/{esm2020 → esm2022}/common/common.module.mjs +7 -7
- package/{esm2020 → esm2022}/common/date-time/entry-date-time-adapter.mjs +4 -4
- package/{esm2020 → esm2022}/common/directives/auto-disable-button.directive.mjs +4 -4
- package/{esm2020 → esm2022}/common/directives/scroll-to-invalid-control.directive.mjs +4 -4
- package/{esm2020 → esm2022}/common/event-plugins/debounce.plugin.mjs +4 -4
- package/{esm2020 → esm2022}/common/event-plugins/throttle.plugin.mjs +4 -4
- package/{esm2020 → esm2022}/common/interceptors/accept-language.interceptor.mjs +4 -4
- package/{esm2020 → esm2022}/dialog/dialogs/alert/entry-alert-dialog.component.mjs +4 -4
- package/{esm2020 → esm2022}/dialog/dialogs/confirm/entry-confirm-dialog.component.mjs +4 -4
- package/{esm2020 → esm2022}/dialog/dialogs/entry-dialog.component.mjs +4 -4
- package/{esm2020 → esm2022}/dialog/dialogs/error/entry-error-dialog.component.mjs +4 -4
- package/{esm2020 → esm2022}/dialog/entry-dialog.module.mjs +19 -19
- package/esm2022/dialog/entry-dialog.service.mjs +86 -0
- package/esm2022/file-input/entry-file-input.component.mjs +201 -0
- package/{esm2020 → esm2022}/file-input/entry-file-input.module.mjs +13 -13
- package/{esm2020 → esm2022}/modules/entry-components.module.mjs +21 -21
- package/{esm2020 → esm2022}/permissions/permission.directive.mjs +4 -4
- package/{esm2020 → esm2022}/permissions/permission.module.mjs +7 -7
- package/{esm2020 → esm2022}/permissions/permission.pipe.mjs +4 -4
- package/{esm2020 → esm2022}/search-filter/autocomplete/autocomplete-search-filter.component.mjs +4 -4
- package/esm2022/search-filter/date/date-search-filter.component.mjs +19 -0
- package/{esm2020 → esm2022}/search-filter/date-time/date-time-search-filter.component.mjs +7 -7
- package/{esm2020 → esm2022}/search-filter/entry-search-filter.component.mjs +4 -4
- package/{esm2020 → esm2022}/search-filter/entry-search-filter.module.mjs +28 -28
- package/{esm2020 → esm2022}/search-filter/select/select-search-filter.component.mjs +4 -4
- package/{esm2020 → esm2022}/search-filter/text/text-search-filter.component.mjs +4 -4
- package/{esm2020 → esm2022}/spinner/entry-spinner/spinner.component.mjs +10 -10
- package/{esm2020 → esm2022}/spinner/spinner-overlay-container.mjs +4 -4
- package/{esm2020 → esm2022}/spinner/spinner.module.mjs +9 -9
- package/{esm2020 → esm2022}/table/components/entry-cell/entry-cell.component.mjs +4 -4
- package/{esm2020 → esm2022}/table/components/entry-cell-context-menu/entry-cell-context-menu.component.mjs +4 -4
- package/{esm2020 → esm2022}/table/components/entry-cell-formatted-value/entry-cell-formatted-value.component.mjs +4 -4
- package/esm2022/table/components/entry-table/entry-table.component.mjs +248 -0
- package/{esm2020 → esm2022}/table/entry-table.module.mjs +33 -33
- package/{esm2020 → esm2022}/table/interfaces/entry-table-config.mjs +1 -2
- package/{esm2020 → esm2022}/validation/entry-display-control-validation.directive.mjs +4 -4
- package/{esm2020 → esm2022}/validation/entry-form-errors.component.mjs +6 -6
- package/{esm2020 → esm2022}/validation/entry-validation.module.mjs +13 -13
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-button.mjs +9 -9
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-button.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-common.mjs +24 -24
- package/{fesm2015 → fesm2022}/enigmatry-entry-components-common.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-dialog.mjs +33 -33
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-dialog.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-file-input.mjs +21 -17
- package/fesm2022/enigmatry-entry-components-file-input.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-permissions.mjs +12 -12
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-permissions.mjs.map +1 -1
- package/fesm2022/enigmatry-entry-components-search-filter.mjs +387 -0
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-search-filter.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-spinner.mjs +20 -20
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-spinner.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-table.mjs +44 -45
- package/fesm2022/enigmatry-entry-components-table.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-validation.mjs +20 -20
- package/{fesm2020 → fesm2022}/enigmatry-entry-components-validation.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/enigmatry-entry-components.mjs +20 -20
- package/{fesm2020 → fesm2022}/enigmatry-entry-components.mjs.map +1 -1
- package/file-input/entry-file-input.component.d.ts +1 -1
- package/package.json +39 -63
- package/permissions/permission.directive.d.ts +1 -1
- package/search-filter/autocomplete/autocomplete-search-filter.component.d.ts +1 -1
- package/search-filter/date/date-search-filter.component.d.ts +1 -1
- package/search-filter/date-time/date-time-search-filter.component.d.ts +1 -1
- package/search-filter/entry-search-filter.component.d.ts +1 -1
- package/search-filter/select/select-search-filter.component.d.ts +1 -1
- package/search-filter/text/text-search-filter.component.d.ts +1 -1
- package/spinner/entry-spinner/spinner.component.d.ts +1 -1
- package/table/components/entry-cell/entry-cell.component.d.ts +1 -1
- package/table/components/entry-cell-context-menu/entry-cell-context-menu.component.d.ts +1 -1
- package/table/components/entry-cell-formatted-value/entry-cell-formatted-value.component.d.ts +1 -1
- package/table/components/entry-table/entry-table.component.d.ts +1 -1
- package/validation/entry-display-control-validation.directive.d.ts +1 -1
- package/validation/entry-form-errors.component.d.ts +1 -1
- package/esm2020/dialog/entry-dialog.service.mjs +0 -86
- package/esm2020/file-input/entry-file-input.component.mjs +0 -197
- package/esm2020/search-filter/date/date-search-filter.component.mjs +0 -19
- package/esm2020/table/components/entry-table/entry-table.component.mjs +0 -248
- package/fesm2015/enigmatry-entry-components-button.mjs +0 -114
- package/fesm2015/enigmatry-entry-components-button.mjs.map +0 -1
- package/fesm2015/enigmatry-entry-components-common.mjs +0 -405
- package/fesm2015/enigmatry-entry-components-dialog.mjs +0 -333
- package/fesm2015/enigmatry-entry-components-dialog.mjs.map +0 -1
- package/fesm2015/enigmatry-entry-components-file-input.mjs +0 -237
- package/fesm2015/enigmatry-entry-components-file-input.mjs.map +0 -1
- package/fesm2015/enigmatry-entry-components-permissions.mjs +0 -98
- package/fesm2015/enigmatry-entry-components-permissions.mjs.map +0 -1
- package/fesm2015/enigmatry-entry-components-search-filter.mjs +0 -394
- package/fesm2015/enigmatry-entry-components-search-filter.mjs.map +0 -1
- package/fesm2015/enigmatry-entry-components-spinner.mjs +0 -156
- package/fesm2015/enigmatry-entry-components-spinner.mjs.map +0 -1
- package/fesm2015/enigmatry-entry-components-table.mjs +0 -462
- package/fesm2015/enigmatry-entry-components-table.mjs.map +0 -1
- package/fesm2015/enigmatry-entry-components-validation.mjs +0 -219
- package/fesm2015/enigmatry-entry-components-validation.mjs.map +0 -1
- package/fesm2015/enigmatry-entry-components.mjs +0 -87
- package/fesm2015/enigmatry-entry-components.mjs.map +0 -1
- package/fesm2020/enigmatry-entry-components-common.mjs.map +0 -1
- package/fesm2020/enigmatry-entry-components-file-input.mjs.map +0 -1
- package/fesm2020/enigmatry-entry-components-search-filter.mjs +0 -387
- package/fesm2020/enigmatry-entry-components-table.mjs.map +0 -1
- /package/{esm2020 → esm2022}/button/enigmatry-entry-components-button.mjs +0 -0
- /package/{esm2020 → esm2022}/button/entry-button-config.mjs +0 -0
- /package/{esm2020 → esm2022}/button/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/common/constants.mjs +0 -0
- /package/{esm2020 → esm2022}/common/date-time/entry-date-time.mjs +0 -0
- /package/{esm2020 → esm2022}/common/date-time/index.mjs +0 -0
- /package/{esm2020 → esm2022}/common/directives/index.mjs +0 -0
- /package/{esm2020 → esm2022}/common/enigmatry-entry-components-common.mjs +0 -0
- /package/{esm2020 → esm2022}/common/event-plugins/abstract.plugin.mjs +0 -0
- /package/{esm2020 → esm2022}/common/event-plugins/index.mjs +0 -0
- /package/{esm2020 → esm2022}/common/interceptors/index.mjs +0 -0
- /package/{esm2020 → esm2022}/common/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/common/utils/index.mjs +0 -0
- /package/{esm2020 → esm2022}/common/utils/provide-config.mjs +0 -0
- /package/{esm2020 → esm2022}/dialog/dialogs/alert/entry-alert-dialog-data.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/dialog/dialogs/confirm/entry-confirm-dialog-data.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/dialog/dialogs/error/entry-error-dialog-data.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/dialog/enigmatry-entry-components-dialog.mjs +0 -0
- /package/{esm2020 → esm2022}/dialog/entry-dialog-buttons-alignment.type.mjs +0 -0
- /package/{esm2020 → esm2022}/dialog/entry-dialog-config.model.mjs +0 -0
- /package/{esm2020 → esm2022}/dialog/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/enigmatry-entry-components.mjs +0 -0
- /package/{esm2020 → esm2022}/file-input/enigmatry-entry-components-file-input.mjs +0 -0
- /package/{esm2020 → esm2022}/file-input/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/permissions/enigmatry-entry-components-permissions.mjs +0 -0
- /package/{esm2020 → esm2022}/permissions/permission-type.mjs +0 -0
- /package/{esm2020 → esm2022}/permissions/permission.guard.mjs +0 -0
- /package/{esm2020 → esm2022}/permissions/permission.service.mjs +0 -0
- /package/{esm2020 → esm2022}/permissions/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/search-filter/autocomplete/autocomplete-search-filter.model.mjs +0 -0
- /package/{esm2020 → esm2022}/search-filter/control-type.mjs +0 -0
- /package/{esm2020 → esm2022}/search-filter/date/date-search-filter.model.mjs +0 -0
- /package/{esm2020 → esm2022}/search-filter/date-time/date-time-search-filter.model.mjs +0 -0
- /package/{esm2020 → esm2022}/search-filter/enigmatry-entry-components-search-filter.mjs +0 -0
- /package/{esm2020 → esm2022}/search-filter/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/search-filter/search-filter-base.model.mjs +0 -0
- /package/{esm2020 → esm2022}/search-filter/search-filter-config.model.mjs +0 -0
- /package/{esm2020 → esm2022}/search-filter/search-filter-params.type.mjs +0 -0
- /package/{esm2020 → esm2022}/search-filter/select/select-search-filter.model.mjs +0 -0
- /package/{esm2020 → esm2022}/search-filter/select-option.model.mjs +0 -0
- /package/{esm2020 → esm2022}/search-filter/text/text-search-filter.model.mjs +0 -0
- /package/{esm2020 → esm2022}/spinner/enigmatry-entry-components-spinner.mjs +0 -0
- /package/{esm2020 → esm2022}/spinner/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/table/components/index.mjs +0 -0
- /package/{esm2020 → esm2022}/table/enigmatry-entry-components-table.mjs +0 -0
- /package/{esm2020 → esm2022}/table/interfaces/cell-template.mjs +0 -0
- /package/{esm2020 → esm2022}/table/interfaces/column-def.mjs +0 -0
- /package/{esm2020 → esm2022}/table/interfaces/column-sort-prop.mjs +0 -0
- /package/{esm2020 → esm2022}/table/interfaces/column-type-parameter.mjs +0 -0
- /package/{esm2020 → esm2022}/table/interfaces/column-type.mjs +0 -0
- /package/{esm2020 → esm2022}/table/interfaces/context-menu-item.mjs +0 -0
- /package/{esm2020 → esm2022}/table/interfaces/index.mjs +0 -0
- /package/{esm2020 → esm2022}/table/interfaces/paged-query.mjs +0 -0
- /package/{esm2020 → esm2022}/table/interfaces/pagination.mjs +0 -0
- /package/{esm2020 → esm2022}/table/interfaces/row-class-formatter.mjs +0 -0
- /package/{esm2020 → esm2022}/table/interfaces/row-context-menu-formatter.mjs +0 -0
- /package/{esm2020 → esm2022}/table/interfaces/row-selection-formatter.mjs +0 -0
- /package/{esm2020 → esm2022}/table/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/validation/enigmatry-entry-components-validation.mjs +0 -0
- /package/{esm2020 → esm2022}/validation/entry-validation-config.model.mjs +0 -0
- /package/{esm2020 → esm2022}/validation/entry-validation.mjs +0 -0
- /package/{esm2020 → esm2022}/validation/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/validation/validation-problem-details.interface.mjs +0 -0
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, ChangeDetectionStrategy, Input, Inject, inject, EventEmitter, Output, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { FormControl, UntypedFormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import { createInjectionToken, provideConfig, ENTRY_MAT_DATE_TIME, EntryDateTimeAdapter } from '@enigmatry/entry-components/common';
|
|
6
|
+
import * as i1$1 from '@angular/common';
|
|
7
|
+
import { CommonModule } from '@angular/common';
|
|
8
|
+
import * as i3$1 from '@angular/material/button';
|
|
9
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
10
|
+
import * as i4$2 from '@enigmatry/entry-components/button';
|
|
11
|
+
import { EntryButtonModule } from '@enigmatry/entry-components/button';
|
|
12
|
+
import * as i2 from '@angular/material/input';
|
|
13
|
+
import { MatInputModule } from '@angular/material/input';
|
|
14
|
+
import * as i3 from '@angular/material/form-field';
|
|
15
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
16
|
+
import * as i4 from '@angular/material/select';
|
|
17
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
18
|
+
import * as i5 from '@angular/material/core';
|
|
19
|
+
import { MAT_DATE_FORMATS, DateAdapter } from '@angular/material/core';
|
|
20
|
+
import { of, Subject } from 'rxjs';
|
|
21
|
+
import { takeUntil, tap, filter, debounceTime } from 'rxjs/operators';
|
|
22
|
+
import * as i6 from '@angular/material/autocomplete';
|
|
23
|
+
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
24
|
+
import * as i4$1 from '@angular/material/datepicker';
|
|
25
|
+
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Used to provide entry search filter configuration on module level.
|
|
29
|
+
*/
|
|
30
|
+
class EntrySearchFilterConfig {
|
|
31
|
+
constructor(config = {}) {
|
|
32
|
+
this.applyButtonText = config.applyButtonText ?? 'Apply';
|
|
33
|
+
this.noneSelectedOptionText = config.noneSelectedOptionText ?? 'None';
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const ENTRY_SEARCH_FILTER_CONFIG = createInjectionToken(new EntrySearchFilterConfig());
|
|
37
|
+
/**
|
|
38
|
+
* Can be used to provide entry search filter configuration.
|
|
39
|
+
*/
|
|
40
|
+
function provideEntrySearchFilterConfig(config) {
|
|
41
|
+
return provideConfig(ENTRY_SEARCH_FILTER_CONFIG, () => new EntrySearchFilterConfig(config));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
var ControlType;
|
|
45
|
+
(function (ControlType) {
|
|
46
|
+
ControlType["text"] = "text-input";
|
|
47
|
+
ControlType["select"] = "select-input";
|
|
48
|
+
ControlType["autocomplete"] = "autocomplete-input";
|
|
49
|
+
ControlType["date"] = "date-input";
|
|
50
|
+
ControlType["dateTime"] = "date-time-input";
|
|
51
|
+
})(ControlType || (ControlType = {}));
|
|
52
|
+
|
|
53
|
+
class TextSearchFilterComponent {
|
|
54
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TextSearchFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
55
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TextSearchFilterComponent, selector: "entry-text-search-filter", inputs: { searchFilter: "searchFilter", form: "form" }, ngImport: i0, template: "<mat-form-field [formGroup]=\"form\" subscriptSizing=\"dynamic\">\n <mat-label [attr.for]=\"searchFilter.key\">{{searchFilter.label}}</mat-label>\n <input [formControlName]=\"searchFilter.key\" [id]=\"searchFilter.key\" [type]=\"searchFilter.type\" matInput\n [placeholder]=\"searchFilter.placeholder\" [maxlength]=\"searchFilter.maxLength\">\n</mat-form-field>", dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
56
|
+
}
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TextSearchFilterComponent, decorators: [{
|
|
58
|
+
type: Component,
|
|
59
|
+
args: [{ selector: 'entry-text-search-filter', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mat-form-field [formGroup]=\"form\" subscriptSizing=\"dynamic\">\n <mat-label [attr.for]=\"searchFilter.key\">{{searchFilter.label}}</mat-label>\n <input [formControlName]=\"searchFilter.key\" [id]=\"searchFilter.key\" [type]=\"searchFilter.type\" matInput\n [placeholder]=\"searchFilter.placeholder\" [maxlength]=\"searchFilter.maxLength\">\n</mat-form-field>" }]
|
|
60
|
+
}], propDecorators: { searchFilter: [{
|
|
61
|
+
type: Input
|
|
62
|
+
}], form: [{
|
|
63
|
+
type: Input
|
|
64
|
+
}] } });
|
|
65
|
+
|
|
66
|
+
class SelectSearchFilterComponent {
|
|
67
|
+
constructor(config) {
|
|
68
|
+
this.config = config;
|
|
69
|
+
}
|
|
70
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SelectSearchFilterComponent, deps: [{ token: ENTRY_SEARCH_FILTER_CONFIG }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
71
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: SelectSearchFilterComponent, selector: "entry-select-search-filter", inputs: { searchFilter: "searchFilter", form: "form" }, ngImport: i0, template: "<mat-form-field [formGroup]=\"form\" subscriptSizing=\"dynamic\">\n <mat-label [attr.for]=\"searchFilter.key\">{{searchFilter.label}}</mat-label>\n <mat-select [formControlName]=\"searchFilter.key\" [id]=\"searchFilter.key\" [multiple]=\"searchFilter.multiSelect\">\n <mat-option *ngIf=\"!searchFilter.multiSelect\" [value]=\"undefined\">\n {{config.noneSelectedOptionText}}\n </mat-option>\n <ng-container *ngIf=\"searchFilter.options$ !== undefined; else fixedSelectValues\">\n <mat-option *ngFor=\"let option of searchFilter.options$ | async\"\n [value]=\"option.key\">{{option.label}}</mat-option>\n </ng-container>\n <ng-template #fixedSelectValues>\n <mat-option *ngFor=\"let option of searchFilter.options\" [value]=\"option.key\">{{option.label}}</mat-option>\n </ng-template>\n </mat-select>\n</mat-form-field>", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "component", type: i4.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex", "panelWidth", "hideSingleSelectionIndicator"], exportAs: ["matSelect"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
72
|
+
}
|
|
73
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SelectSearchFilterComponent, decorators: [{
|
|
74
|
+
type: Component,
|
|
75
|
+
args: [{ selector: 'entry-select-search-filter', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mat-form-field [formGroup]=\"form\" subscriptSizing=\"dynamic\">\n <mat-label [attr.for]=\"searchFilter.key\">{{searchFilter.label}}</mat-label>\n <mat-select [formControlName]=\"searchFilter.key\" [id]=\"searchFilter.key\" [multiple]=\"searchFilter.multiSelect\">\n <mat-option *ngIf=\"!searchFilter.multiSelect\" [value]=\"undefined\">\n {{config.noneSelectedOptionText}}\n </mat-option>\n <ng-container *ngIf=\"searchFilter.options$ !== undefined; else fixedSelectValues\">\n <mat-option *ngFor=\"let option of searchFilter.options$ | async\"\n [value]=\"option.key\">{{option.label}}</mat-option>\n </ng-container>\n <ng-template #fixedSelectValues>\n <mat-option *ngFor=\"let option of searchFilter.options\" [value]=\"option.key\">{{option.label}}</mat-option>\n </ng-template>\n </mat-select>\n</mat-form-field>" }]
|
|
76
|
+
}], ctorParameters: function () { return [{ type: EntrySearchFilterConfig, decorators: [{
|
|
77
|
+
type: Inject,
|
|
78
|
+
args: [ENTRY_SEARCH_FILTER_CONFIG]
|
|
79
|
+
}] }]; }, propDecorators: { searchFilter: [{
|
|
80
|
+
type: Input
|
|
81
|
+
}], form: [{
|
|
82
|
+
type: Input
|
|
83
|
+
}] } });
|
|
84
|
+
|
|
85
|
+
class AutocompleteSearchFilterComponent {
|
|
86
|
+
constructor(cdr) {
|
|
87
|
+
this.cdr = cdr;
|
|
88
|
+
this.searchField = new FormControl('');
|
|
89
|
+
this.options$ = of([]);
|
|
90
|
+
this.destroy$ = new Subject();
|
|
91
|
+
this.displayFn = (_selectedValue) => this.searchFilter.formControl.value?.label;
|
|
92
|
+
this.onSelected = (event) => {
|
|
93
|
+
this.searchFilter.formControl.patchValue(event.option.value);
|
|
94
|
+
this.searchField.patchValue(event.option.value.label, { emitEvent: false });
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
ngAfterViewInit() {
|
|
98
|
+
this.searchField
|
|
99
|
+
.valueChanges
|
|
100
|
+
.pipe(takeUntil(this.destroy$), tap(value => this.clearFilterIfLabelMismatch(value)), filter(value => value?.length >= this.searchFilter.minimumCharacters), debounceTime(this.searchFilter.debounceTime))
|
|
101
|
+
.subscribe(searchValue => {
|
|
102
|
+
// call search and retrieve options
|
|
103
|
+
this.options$ = this.searchFilter.search(searchValue);
|
|
104
|
+
// mark for check because of the debounce
|
|
105
|
+
this.cdr.markForCheck();
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
ngOnDestroy() {
|
|
109
|
+
this.destroy$.next();
|
|
110
|
+
this.destroy$.complete();
|
|
111
|
+
}
|
|
112
|
+
clearFilterIfLabelMismatch(value) {
|
|
113
|
+
const label = this.searchFilter.formControl.value?.label;
|
|
114
|
+
if (label && label !== value) {
|
|
115
|
+
this.searchFilter.formControl.patchValue(undefined);
|
|
116
|
+
this.searchField.patchValue(null, { emitEvent: false });
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AutocompleteSearchFilterComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
120
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AutocompleteSearchFilterComponent, selector: "entry-autocomplete-search-filter", inputs: { searchFilter: "searchFilter" }, ngImport: i0, template: "<mat-form-field subscriptSizing=\"dynamic\">\n <mat-label>{{searchFilter.label}}</mat-label>\n <input type=\"text\" matInput [placeholder]=\"searchFilter.placeholder\"\n [formControl]=\"searchField\" [id]=\"searchFilter.key\" [matAutocomplete]=\"auto\">\n <mat-autocomplete [displayWith]=\"displayFn\" #auto=\"matAutocomplete\" (optionSelected)=\"onSelected($event)\">\n <mat-option *ngFor=\"let option of options$ | async\" [value]=\"option\">\n {{option.label}}\n </mat-option>\n </mat-autocomplete>\n</mat-form-field>", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "component", type: i5.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i6.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple", "hideSingleSelectionIndicator"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i6.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
121
|
+
}
|
|
122
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AutocompleteSearchFilterComponent, decorators: [{
|
|
123
|
+
type: Component,
|
|
124
|
+
args: [{ selector: 'entry-autocomplete-search-filter', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mat-form-field subscriptSizing=\"dynamic\">\n <mat-label>{{searchFilter.label}}</mat-label>\n <input type=\"text\" matInput [placeholder]=\"searchFilter.placeholder\"\n [formControl]=\"searchField\" [id]=\"searchFilter.key\" [matAutocomplete]=\"auto\">\n <mat-autocomplete [displayWith]=\"displayFn\" #auto=\"matAutocomplete\" (optionSelected)=\"onSelected($event)\">\n <mat-option *ngFor=\"let option of options$ | async\" [value]=\"option\">\n {{option.label}}\n </mat-option>\n </mat-autocomplete>\n</mat-form-field>" }]
|
|
125
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { searchFilter: [{
|
|
126
|
+
type: Input
|
|
127
|
+
}] } });
|
|
128
|
+
|
|
129
|
+
class DateTimeSearchFilterComponent {
|
|
130
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DateTimeSearchFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
131
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DateTimeSearchFilterComponent, selector: "entry-date-time-search-filter", inputs: { searchFilter: "searchFilter", form: "form" }, providers: [
|
|
132
|
+
{ provide: MAT_DATE_FORMATS, useFactory: () => inject(ENTRY_MAT_DATE_TIME).matDateFormats },
|
|
133
|
+
{ provide: DateAdapter, useClass: EntryDateTimeAdapter }
|
|
134
|
+
], ngImport: i0, template: "<mat-form-field [formGroup]=\"form\" subscriptSizing=\"dynamic\">\n <mat-label [attr.for]=\"searchFilter.key\">{{searchFilter.label}}</mat-label>\n <input matInput [formControlName]=\"searchFilter.key\" [matDatepicker]=\"picker\" [id]=\"searchFilter.key\">\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n</mat-form-field>", dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i4$1.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i4$1.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i4$1.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }] }); }
|
|
135
|
+
}
|
|
136
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DateTimeSearchFilterComponent, decorators: [{
|
|
137
|
+
type: Component,
|
|
138
|
+
args: [{ selector: 'entry-date-time-search-filter', providers: [
|
|
139
|
+
{ provide: MAT_DATE_FORMATS, useFactory: () => inject(ENTRY_MAT_DATE_TIME).matDateFormats },
|
|
140
|
+
{ provide: DateAdapter, useClass: EntryDateTimeAdapter }
|
|
141
|
+
], template: "<mat-form-field [formGroup]=\"form\" subscriptSizing=\"dynamic\">\n <mat-label [attr.for]=\"searchFilter.key\">{{searchFilter.label}}</mat-label>\n <input matInput [formControlName]=\"searchFilter.key\" [matDatepicker]=\"picker\" [id]=\"searchFilter.key\">\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n</mat-form-field>" }]
|
|
142
|
+
}], propDecorators: { searchFilter: [{
|
|
143
|
+
type: Input
|
|
144
|
+
}], form: [{
|
|
145
|
+
type: Input
|
|
146
|
+
}] } });
|
|
147
|
+
|
|
148
|
+
class DateSearchFilterComponent {
|
|
149
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DateSearchFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
150
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DateSearchFilterComponent, selector: "entry-date-search-filter", inputs: { searchFilter: "searchFilter", form: "form" }, ngImport: i0, template: "<mat-form-field [formGroup]=\"form\" subscriptSizing=\"dynamic\">\n <mat-label [attr.for]=\"searchFilter.key\">{{searchFilter.label}}</mat-label>\n <input matInput [formControlName]=\"searchFilter.key\" [matDatepicker]=\"picker\" [id]=\"searchFilter.key\">\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n</mat-form-field>", dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i4$1.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i4$1.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i4$1.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }] }); }
|
|
151
|
+
}
|
|
152
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DateSearchFilterComponent, decorators: [{
|
|
153
|
+
type: Component,
|
|
154
|
+
args: [{ selector: 'entry-date-search-filter', template: "<mat-form-field [formGroup]=\"form\" subscriptSizing=\"dynamic\">\n <mat-label [attr.for]=\"searchFilter.key\">{{searchFilter.label}}</mat-label>\n <input matInput [formControlName]=\"searchFilter.key\" [matDatepicker]=\"picker\" [id]=\"searchFilter.key\">\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n</mat-form-field>" }]
|
|
155
|
+
}], propDecorators: { searchFilter: [{
|
|
156
|
+
type: Input
|
|
157
|
+
}], form: [{
|
|
158
|
+
type: Input
|
|
159
|
+
}] } });
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Entry SearchFilter component.
|
|
163
|
+
*/
|
|
164
|
+
class EntrySearchFilterComponent {
|
|
165
|
+
constructor(config) {
|
|
166
|
+
this.config = config;
|
|
167
|
+
/** Configuration of the search filters inputs that will be displayed in the search-filter component. */
|
|
168
|
+
this.searchFilters = [];
|
|
169
|
+
/**
|
|
170
|
+
* Emits the change in SearchFilterParams so the containing component can apply them and retrieve the filtered results.
|
|
171
|
+
*/
|
|
172
|
+
this.searchFilterChange = new EventEmitter();
|
|
173
|
+
this.controlType = ControlType;
|
|
174
|
+
}
|
|
175
|
+
ngOnInit() {
|
|
176
|
+
this.searchFilterForm = this.toFormGroup(this.searchFilters);
|
|
177
|
+
}
|
|
178
|
+
onSubmit() {
|
|
179
|
+
const formValue = this.searchFilterForm.value;
|
|
180
|
+
this.searchFilterChange.emit(formValue);
|
|
181
|
+
}
|
|
182
|
+
toFormGroup(searchFilters) {
|
|
183
|
+
const group = {};
|
|
184
|
+
searchFilters.forEach(searchFilter => {
|
|
185
|
+
const formControl = searchFilter.toFormControl();
|
|
186
|
+
group[searchFilter.key] = formControl;
|
|
187
|
+
searchFilter.formControl = formControl;
|
|
188
|
+
});
|
|
189
|
+
return new UntypedFormGroup(group);
|
|
190
|
+
}
|
|
191
|
+
asTextSearchFilter(searchFilter) {
|
|
192
|
+
return searchFilter;
|
|
193
|
+
}
|
|
194
|
+
asSelectSearchFilter(searchFilter) {
|
|
195
|
+
return searchFilter;
|
|
196
|
+
}
|
|
197
|
+
asAutocompleteSearchFilter(searchFilter) {
|
|
198
|
+
return searchFilter;
|
|
199
|
+
}
|
|
200
|
+
asDateTimeSearchFilter(searchFilter) {
|
|
201
|
+
return searchFilter;
|
|
202
|
+
}
|
|
203
|
+
asDateSearchFilter(searchFilter) {
|
|
204
|
+
return searchFilter;
|
|
205
|
+
}
|
|
206
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EntrySearchFilterComponent, deps: [{ token: ENTRY_SEARCH_FILTER_CONFIG }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
207
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: EntrySearchFilterComponent, selector: "entry-search-filter", inputs: { searchFilters: "searchFilters" }, outputs: { searchFilterChange: "searchFilterChange" }, ngImport: i0, template: "<form (ngSubmit)=\"onSubmit()\" [formGroup]=\"searchFilterForm\" class=\"search-form-container entry-form\">\r\n <div *ngFor=\"let searchFilter of searchFilters\" class=\"form-field\">\r\n <ng-container [ngSwitch]=\"searchFilter.controlType\">\r\n <entry-text-search-filter *ngSwitchCase=\"controlType.text\" [searchFilter]=\"asTextSearchFilter(searchFilter)\" [form]=\"searchFilterForm\"></entry-text-search-filter>\r\n <entry-select-search-filter *ngSwitchCase=\"controlType.select\" [searchFilter]=\"asSelectSearchFilter(searchFilter)\" [form]=\"searchFilterForm\"></entry-select-search-filter>\r\n <entry-autocomplete-search-filter *ngSwitchCase=\"controlType.autocomplete\" [searchFilter]=\"asAutocompleteSearchFilter(searchFilter)\"></entry-autocomplete-search-filter>\r\n <entry-date-time-search-filter *ngSwitchCase=\"controlType.dateTime\" [searchFilter]=\"asDateTimeSearchFilter(searchFilter)\" [form]=\"searchFilterForm\"></entry-date-time-search-filter>\r\n <entry-date-search-filter *ngSwitchCase=\"controlType.date\" [searchFilter]=\"asDateSearchFilter(searchFilter)\" [form]=\"searchFilterForm\"></entry-date-search-filter>\r\n </ng-container>\r\n </div>\r\n <div class=\"entry-search-filter-actions\">\r\n <button mat-button entry-submit-button>\r\n <span>{{config.applyButtonText}}</span>\r\n </button>\r\n </div>\r\n</form>", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i4$2.EntryButtonDirective, selector: "[mat-button][entry-submit-button],[mat-button][entry-cancel-button]" }, { kind: "component", type: TextSearchFilterComponent, selector: "entry-text-search-filter", inputs: ["searchFilter", "form"] }, { kind: "component", type: SelectSearchFilterComponent, selector: "entry-select-search-filter", inputs: ["searchFilter", "form"] }, { kind: "component", type: AutocompleteSearchFilterComponent, selector: "entry-autocomplete-search-filter", inputs: ["searchFilter"] }, { kind: "component", type: DateTimeSearchFilterComponent, selector: "entry-date-time-search-filter", inputs: ["searchFilter", "form"] }, { kind: "component", type: DateSearchFilterComponent, selector: "entry-date-search-filter", inputs: ["searchFilter", "form"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
208
|
+
}
|
|
209
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EntrySearchFilterComponent, decorators: [{
|
|
210
|
+
type: Component,
|
|
211
|
+
args: [{ selector: 'entry-search-filter', changeDetection: ChangeDetectionStrategy.OnPush, template: "<form (ngSubmit)=\"onSubmit()\" [formGroup]=\"searchFilterForm\" class=\"search-form-container entry-form\">\r\n <div *ngFor=\"let searchFilter of searchFilters\" class=\"form-field\">\r\n <ng-container [ngSwitch]=\"searchFilter.controlType\">\r\n <entry-text-search-filter *ngSwitchCase=\"controlType.text\" [searchFilter]=\"asTextSearchFilter(searchFilter)\" [form]=\"searchFilterForm\"></entry-text-search-filter>\r\n <entry-select-search-filter *ngSwitchCase=\"controlType.select\" [searchFilter]=\"asSelectSearchFilter(searchFilter)\" [form]=\"searchFilterForm\"></entry-select-search-filter>\r\n <entry-autocomplete-search-filter *ngSwitchCase=\"controlType.autocomplete\" [searchFilter]=\"asAutocompleteSearchFilter(searchFilter)\"></entry-autocomplete-search-filter>\r\n <entry-date-time-search-filter *ngSwitchCase=\"controlType.dateTime\" [searchFilter]=\"asDateTimeSearchFilter(searchFilter)\" [form]=\"searchFilterForm\"></entry-date-time-search-filter>\r\n <entry-date-search-filter *ngSwitchCase=\"controlType.date\" [searchFilter]=\"asDateSearchFilter(searchFilter)\" [form]=\"searchFilterForm\"></entry-date-search-filter>\r\n </ng-container>\r\n </div>\r\n <div class=\"entry-search-filter-actions\">\r\n <button mat-button entry-submit-button>\r\n <span>{{config.applyButtonText}}</span>\r\n </button>\r\n </div>\r\n</form>" }]
|
|
212
|
+
}], ctorParameters: function () { return [{ type: EntrySearchFilterConfig, decorators: [{
|
|
213
|
+
type: Inject,
|
|
214
|
+
args: [ENTRY_SEARCH_FILTER_CONFIG]
|
|
215
|
+
}] }]; }, propDecorators: { searchFilters: [{
|
|
216
|
+
type: Input
|
|
217
|
+
}], searchFilterChange: [{
|
|
218
|
+
type: Output
|
|
219
|
+
}] } });
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Base Entry search filter input component.
|
|
223
|
+
*/
|
|
224
|
+
class SearchFilterBase {
|
|
225
|
+
constructor(options = {}) {
|
|
226
|
+
this.value = options.value;
|
|
227
|
+
this.key = options.key || '';
|
|
228
|
+
this.label = options.label || '';
|
|
229
|
+
this.placeholder = options.placeholder || '';
|
|
230
|
+
this.controlType = options.controlType || ControlType.text;
|
|
231
|
+
this.type = options.type || ControlType.text;
|
|
232
|
+
this.maxLength = options.maxLength || 256;
|
|
233
|
+
}
|
|
234
|
+
setValue(value) {
|
|
235
|
+
this.value = value;
|
|
236
|
+
if (this.formControl) {
|
|
237
|
+
this.formControl.patchValue(value);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
toFormControl() {
|
|
241
|
+
return new FormControl(this.value);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Search filter text input filed configuration.
|
|
247
|
+
*/
|
|
248
|
+
class TextSearchFilter extends SearchFilterBase {
|
|
249
|
+
constructor() {
|
|
250
|
+
super(...arguments);
|
|
251
|
+
this.controlType = ControlType.text;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Search filter select input field configuration. Select options can be provided as fixed list (`options`)
|
|
257
|
+
* or observable (dynamic) list (`options$`).
|
|
258
|
+
*/
|
|
259
|
+
class SelectSearchFilter extends SearchFilterBase {
|
|
260
|
+
constructor(options = {}) {
|
|
261
|
+
super(options);
|
|
262
|
+
this.controlType = ControlType.select;
|
|
263
|
+
/** Fixed list of select filter options (default is empty list) */
|
|
264
|
+
this.options = [];
|
|
265
|
+
/**
|
|
266
|
+
* Enables selection of multiple options (default is true).
|
|
267
|
+
* If it is set to false, 'none selected' option becomes available as a first option.
|
|
268
|
+
* */
|
|
269
|
+
this.multiSelect = true;
|
|
270
|
+
this.options = options.options;
|
|
271
|
+
this.options$ = options.options$;
|
|
272
|
+
this.multiSelect = options.multiSelect;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Search filter autocomplete field configuration. Options for the autocomplete are provided
|
|
278
|
+
* indirectly via the search function that takes a string and returns an observable array of
|
|
279
|
+
* SelectOption<T>
|
|
280
|
+
*/
|
|
281
|
+
class AutocompleteSearchFilter extends SearchFilterBase {
|
|
282
|
+
constructor(options = {}) {
|
|
283
|
+
super(options);
|
|
284
|
+
this.controlType = ControlType.autocomplete;
|
|
285
|
+
this.search = options.search;
|
|
286
|
+
this.placeholder = options.placeholder;
|
|
287
|
+
this.label = options.label;
|
|
288
|
+
this.debounceTime = options.debounceTime ?? 300;
|
|
289
|
+
this.minimumCharacters = options.minimumCharacters ?? 3;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/** Model used to populate select or autocomplete options. */
|
|
294
|
+
class SelectOption {
|
|
295
|
+
constructor(
|
|
296
|
+
/** Key used as a value for selected option */
|
|
297
|
+
key,
|
|
298
|
+
/** String value used as display label of select option */
|
|
299
|
+
label) {
|
|
300
|
+
this.key = key;
|
|
301
|
+
this.label = label;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Search filter date time input filed configuration.
|
|
307
|
+
*/
|
|
308
|
+
class DateTimeSearchFilter extends SearchFilterBase {
|
|
309
|
+
constructor() {
|
|
310
|
+
super(...arguments);
|
|
311
|
+
this.controlType = ControlType.dateTime;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Search filter date input filed configuration.
|
|
317
|
+
*/
|
|
318
|
+
class DateSearchFilter extends SearchFilterBase {
|
|
319
|
+
constructor() {
|
|
320
|
+
super(...arguments);
|
|
321
|
+
this.controlType = ControlType.date;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
class EntrySearchFilterModule {
|
|
326
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EntrySearchFilterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
327
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: EntrySearchFilterModule, declarations: [EntrySearchFilterComponent,
|
|
328
|
+
TextSearchFilterComponent,
|
|
329
|
+
SelectSearchFilterComponent,
|
|
330
|
+
AutocompleteSearchFilterComponent,
|
|
331
|
+
DateTimeSearchFilterComponent,
|
|
332
|
+
DateSearchFilterComponent], imports: [CommonModule,
|
|
333
|
+
FormsModule,
|
|
334
|
+
ReactiveFormsModule,
|
|
335
|
+
MatInputModule,
|
|
336
|
+
MatButtonModule,
|
|
337
|
+
EntryButtonModule,
|
|
338
|
+
MatSelectModule,
|
|
339
|
+
MatAutocompleteModule,
|
|
340
|
+
MatDatepickerModule,
|
|
341
|
+
MatFormFieldModule], exports: [EntrySearchFilterComponent] }); }
|
|
342
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EntrySearchFilterModule, imports: [CommonModule,
|
|
343
|
+
FormsModule,
|
|
344
|
+
ReactiveFormsModule,
|
|
345
|
+
MatInputModule,
|
|
346
|
+
MatButtonModule,
|
|
347
|
+
EntryButtonModule,
|
|
348
|
+
MatSelectModule,
|
|
349
|
+
MatAutocompleteModule,
|
|
350
|
+
MatDatepickerModule,
|
|
351
|
+
MatFormFieldModule] }); }
|
|
352
|
+
}
|
|
353
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EntrySearchFilterModule, decorators: [{
|
|
354
|
+
type: NgModule,
|
|
355
|
+
args: [{
|
|
356
|
+
declarations: [
|
|
357
|
+
EntrySearchFilterComponent,
|
|
358
|
+
TextSearchFilterComponent,
|
|
359
|
+
SelectSearchFilterComponent,
|
|
360
|
+
AutocompleteSearchFilterComponent,
|
|
361
|
+
DateTimeSearchFilterComponent,
|
|
362
|
+
DateSearchFilterComponent
|
|
363
|
+
],
|
|
364
|
+
imports: [
|
|
365
|
+
CommonModule,
|
|
366
|
+
FormsModule,
|
|
367
|
+
ReactiveFormsModule,
|
|
368
|
+
MatInputModule,
|
|
369
|
+
MatButtonModule,
|
|
370
|
+
EntryButtonModule,
|
|
371
|
+
MatSelectModule,
|
|
372
|
+
MatAutocompleteModule,
|
|
373
|
+
MatDatepickerModule,
|
|
374
|
+
MatFormFieldModule
|
|
375
|
+
],
|
|
376
|
+
exports: [
|
|
377
|
+
EntrySearchFilterComponent
|
|
378
|
+
]
|
|
379
|
+
}]
|
|
380
|
+
}] });
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Generated bundle index. Do not edit.
|
|
384
|
+
*/
|
|
385
|
+
|
|
386
|
+
export { AutocompleteSearchFilter, DateSearchFilter, DateTimeSearchFilter, ENTRY_SEARCH_FILTER_CONFIG, EntrySearchFilterComponent, EntrySearchFilterConfig, EntrySearchFilterModule, SearchFilterBase, SelectOption, SelectSearchFilter, TextSearchFilter, provideEntrySearchFilterConfig };
|
|
387
|
+
//# sourceMappingURL=enigmatry-entry-components-search-filter.mjs.map
|