@enigmatry/entry-components 19.0.1-preview.5 → 20.0.1-preview.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/README.md +1 -0
- package/button/index.d.ts +54 -3
- package/common/index.d.ts +243 -3
- package/date-time-picker/index.d.ts +100 -3
- package/dialog/index.d.ts +197 -3
- package/fesm2022/enigmatry-entry-components-button.mjs +19 -30
- package/fesm2022/enigmatry-entry-components-button.mjs.map +1 -1
- package/fesm2022/enigmatry-entry-components-common.mjs +129 -133
- package/fesm2022/enigmatry-entry-components-common.mjs.map +1 -1
- package/fesm2022/enigmatry-entry-components-date-time-picker.mjs +53 -50
- package/fesm2022/enigmatry-entry-components-date-time-picker.mjs.map +1 -1
- package/fesm2022/enigmatry-entry-components-dialog.mjs +53 -78
- package/fesm2022/enigmatry-entry-components-dialog.mjs.map +1 -1
- package/fesm2022/enigmatry-entry-components-file-input.mjs +55 -51
- package/fesm2022/enigmatry-entry-components-file-input.mjs.map +1 -1
- package/fesm2022/enigmatry-entry-components-permissions.mjs +28 -23
- package/fesm2022/enigmatry-entry-components-permissions.mjs.map +1 -1
- package/fesm2022/enigmatry-entry-components-search-filter.mjs +55 -59
- package/fesm2022/enigmatry-entry-components-search-filter.mjs.map +1 -1
- package/fesm2022/enigmatry-entry-components-spinner.mjs +21 -21
- package/fesm2022/enigmatry-entry-components-spinner.mjs.map +1 -1
- package/fesm2022/enigmatry-entry-components-table.mjs +77 -86
- package/fesm2022/enigmatry-entry-components-table.mjs.map +1 -1
- package/fesm2022/enigmatry-entry-components-validation.mjs +43 -47
- package/fesm2022/enigmatry-entry-components-validation.mjs.map +1 -1
- package/fesm2022/enigmatry-entry-components.mjs +6 -6
- package/fesm2022/enigmatry-entry-components.mjs.map +1 -1
- package/file-input/index.d.ts +87 -5
- package/index.d.ts +37 -3
- package/package.json +10 -8
- package/permissions/index.d.ts +40 -5
- package/search-filter/index.d.ts +228 -3
- package/spinner/index.d.ts +34 -5
- package/table/README.md +6 -3
- package/table/index.d.ts +260 -4
- package/validation/index.d.ts +123 -3
- package/button/entry-button-config.d.ts +0 -30
- package/button/entry-button.directive.d.ts +0 -18
- package/button/entry-button.module.d.ts +0 -9
- package/button/public-api.d.ts +0 -3
- package/common/common.module.d.ts +0 -14
- package/common/constants.d.ts +0 -2
- package/common/date-time/entry-date-time-adapter.d.ts +0 -41
- package/common/date-time/entry-date-time-formats.d.ts +0 -25
- package/common/date-time/entry-time-adapter.d.ts +0 -9
- package/common/date-time/index.d.ts +0 -4
- package/common/date-time/native-time-adapter.d.ts +0 -13
- package/common/directives/auto-disable-button.directive.d.ts +0 -26
- package/common/directives/index.d.ts +0 -4
- package/common/directives/ng-control-accessor.directive.d.ts +0 -12
- package/common/directives/noop-control-value-accessor.d.ts +0 -10
- package/common/directives/scroll-to-invalid-control.directive.d.ts +0 -18
- package/common/event-plugins/abstract.plugin.d.ts +0 -40
- package/common/event-plugins/debounce.plugin.d.ts +0 -15
- package/common/event-plugins/index.d.ts +0 -2
- package/common/event-plugins/throttle.plugin.d.ts +0 -15
- package/common/interceptors/accept-language.interceptor.d.ts +0 -16
- package/common/interceptors/index.d.ts +0 -1
- package/common/public-api.d.ts +0 -6
- package/common/utils/index.d.ts +0 -1
- package/common/utils/provide-config.d.ts +0 -3
- package/date-time-picker/date-time-picker-config.model.d.ts +0 -20
- package/date-time-picker/date-time-picker.component.d.ts +0 -38
- package/date-time-picker/date-time-picker.module.d.ts +0 -17
- package/date-time-picker/public-api.d.ts +0 -3
- package/date-time-picker/time-picker.component.d.ts +0 -26
- package/dialog/dialogs/alert/entry-alert-dialog-data.interface.d.ts +0 -18
- package/dialog/dialogs/alert/entry-alert-dialog.component.d.ts +0 -13
- package/dialog/dialogs/confirm/entry-confirm-dialog-data.interface.d.ts +0 -8
- package/dialog/dialogs/confirm/entry-confirm-dialog.component.d.ts +0 -13
- package/dialog/dialogs/entry-dialog.component.d.ts +0 -43
- package/dialog/dialogs/error/entry-error-dialog-data.interface.d.ts +0 -9
- package/dialog/dialogs/error/entry-error-dialog.component.d.ts +0 -15
- package/dialog/entry-dialog-buttons-alignment.type.d.ts +0 -2
- package/dialog/entry-dialog-config.model.d.ts +0 -33
- package/dialog/entry-dialog.module.d.ts +0 -15
- package/dialog/entry-dialog.service.d.ts +0 -55
- package/dialog/public-api.d.ts +0 -11
- package/file-input/entry-file-input.component.d.ts +0 -74
- package/file-input/entry-file-input.module.d.ts +0 -12
- package/file-input/public-api.d.ts +0 -2
- package/modules/entry-components.module.d.ts +0 -28
- package/permissions/permission-type.d.ts +0 -3
- package/permissions/permission.directive.d.ts +0 -11
- package/permissions/permission.guard.d.ts +0 -2
- package/permissions/permission.module.d.ts +0 -9
- package/permissions/permission.pipe.d.ts +0 -11
- package/permissions/permission.service.d.ts +0 -4
- package/permissions/public-api.d.ts +0 -5
- package/public-api.d.ts +0 -10
- package/search-filter/autocomplete/autocomplete-search-filter.component.d.ts +0 -22
- package/search-filter/autocomplete/autocomplete-search-filter.model.d.ts +0 -19
- package/search-filter/control-type.d.ts +0 -7
- package/search-filter/date/date-search-filter.component.d.ts +0 -10
- package/search-filter/date/date-search-filter.model.d.ts +0 -8
- package/search-filter/date-time/date-time-search-filter.component.d.ts +0 -10
- package/search-filter/date-time/date-time-search-filter.model.d.ts +0 -8
- package/search-filter/entry-search-filter.component.d.ts +0 -38
- package/search-filter/entry-search-filter.module.d.ts +0 -22
- package/search-filter/public-api.d.ts +0 -11
- package/search-filter/search-filter-base.model.d.ts +0 -29
- package/search-filter/search-filter-config.model.d.ts +0 -16
- package/search-filter/search-filter-params.type.d.ts +0 -7
- package/search-filter/select/select-search-filter.component.d.ts +0 -14
- package/search-filter/select/select-search-filter.model.d.ts +0 -22
- package/search-filter/select-option.model.d.ts +0 -12
- package/search-filter/text/text-search-filter.component.d.ts +0 -10
- package/search-filter/text/text-search-filter.model.d.ts +0 -8
- package/spinner/entry-spinner/spinner.component.d.ts +0 -24
- package/spinner/public-api.d.ts +0 -2
- package/spinner/spinner-overlay-container.d.ts +0 -17
- package/spinner/spinner.module.d.ts +0 -10
- package/table/components/entry-cell/entry-cell.component.d.ts +0 -10
- package/table/components/entry-cell-context-menu/entry-cell-context-menu.component.d.ts +0 -18
- package/table/components/entry-cell-formatted-value/entry-cell-formatted-value.component.d.ts +0 -10
- package/table/components/entry-table/entry-table.component.d.ts +0 -82
- package/table/components/index.d.ts +0 -4
- package/table/entry-table.module.d.ts +0 -20
- package/table/interfaces/cell-template.d.ts +0 -4
- package/table/interfaces/column-def.d.ts +0 -20
- package/table/interfaces/column-sort-prop.d.ts +0 -5
- package/table/interfaces/column-type-parameter.d.ts +0 -9
- package/table/interfaces/column-type.d.ts +0 -1
- package/table/interfaces/context-menu-item.d.ts +0 -7
- package/table/interfaces/entry-table-config.d.ts +0 -33
- package/table/interfaces/index.d.ts +0 -12
- package/table/interfaces/paged-query.d.ts +0 -15
- package/table/interfaces/pagination.d.ts +0 -19
- package/table/interfaces/row-class-formatter.d.ts +0 -3
- package/table/interfaces/row-context-menu-formatter.d.ts +0 -4
- package/table/interfaces/row-selection-formatter.d.ts +0 -4
- package/table/public-api.d.ts +0 -3
- package/validation/entry-display-control-validation.directive.d.ts +0 -27
- package/validation/entry-form-errors.component.d.ts +0 -18
- package/validation/entry-validation-config.model.d.ts +0 -48
- package/validation/entry-validation.d.ts +0 -15
- package/validation/entry-validation.module.d.ts +0 -11
- package/validation/public-api.d.ts +0 -6
- package/validation/validation-problem-details.interface.d.ts +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enigmatry-entry-components-file-input.mjs","sources":["../../../../libs/entry-components/file-input/entry-file-input.component.ts","../../../../libs/entry-components/file-input/entry-file-input.component.html","../../../../libs/entry-components/file-input/entry-file-input.module.ts","../../../../libs/entry-components/file-input/enigmatry-entry-components-file-input.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/member-ordering */\nimport { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n ChangeDetectionStrategy,\n Component, ElementRef, EventEmitter, Input, NgZone,\n OnDestroy, OnInit, Output, Renderer2, ViewChild, forwardRef\n} from '@angular/core';\nimport {\n AbstractControl, ControlValueAccessor, NG_VALIDATORS,\n NG_VALUE_ACCESSOR, ValidationErrors, Validator\n} from '@angular/forms';\nimport { Subject, fromEvent } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nconst providers = [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => EntryFileInputComponent),\n multi: true\n },\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => EntryFileInputComponent),\n multi: true\n }\n];\n\n@Component({\n standalone: false,\n selector: 'entry-file-input',\n templateUrl: './entry-file-input.component.html',\n styleUrls: ['./entry-file-input.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers\n})\nexport class EntryFileInputComponent implements OnInit, OnDestroy, ControlValueAccessor, Validator {\n\n /**\n * Label for the select file button. Defaults to 'Choose file...'\n */\n @Input() label = 'Choose file...';\n\n /**\n * MatIcon for the select file button. Defaults to 'insert_drive_file' (optional)\n */\n @Input() matIcon?= 'insert_drive_file';\n\n /**\n * Same as 'accept' attribute in <input/> element.\n */\n @Input() accept?: string;\n\n /**\n * Same as 'multiple' attribute in <input/> element.\n */\n @Input()\n set multiple(multiple: BooleanInput) {\n this._multiple = coerceBooleanProperty(multiple);\n }\n get multiple(): boolean {\n return this._multiple;\n }\n private _multiple = false;\n\n /**\n * Same as 'disabled' attribute in <input/> element.\n */\n @Input()\n set disabled(disabled: BooleanInput) {\n this._disabled = coerceBooleanProperty(disabled);\n }\n get disabled(): boolean {\n return this._disabled;\n }\n private _disabled = false;\n\n /**\n * Same as 'readonly' attribute in <input/> element.\n */\n @Input()\n set readonly(readonly: BooleanInput) {\n this._readonly = coerceBooleanProperty(readonly);\n }\n get readonly(): boolean {\n return this._readonly;\n }\n private _readonly = false;\n\n /**\n * Size limit per file in KB (kilobytes)\n */\n @Input() maxFileSizeInKb?: number = undefined;\n\n /**\n * Number of files allowed when multiple=true\n */\n @Input() maxFileCount?: number = undefined;\n\n /**\n * Current selected [File | FileList] object.\n */\n value: File | FileList | undefined;\n\n /**\n * Event emitted when a file is selected. Emits a [File | FileList] object.\n */\n @Output() selectedFile = new EventEmitter<File | FileList>();\n\n\n @ViewChild('fileButton', { static: true, read: ElementRef })\n _fileButton!: ElementRef<HTMLElement>;\n\n @ViewChild('fileInput', { static: true })\n _fileInput!: ElementRef<HTMLInputElement>;\n\n private _destroy$ = new Subject<void>();\n\n constructor(\n private readonly _ngZone: NgZone,\n private readonly _renderer: Renderer2) {\n }\n\n get fileNames(): string {\n if (this.value instanceof File) {\n return this.value.name;\n }\n if (this.value instanceof FileList) {\n return `${this.value.length} files`;\n }\n return '';\n }\n\n ngOnInit(): void {\n // Handle click event on custom file button and trigger click on native file input\n this._ngZone.runOutsideAngular(() => {\n fromEvent(this._fileButton.nativeElement, 'click')\n .pipe(takeUntil(this._destroy$))\n .subscribe(() => {\n this._fileInput.nativeElement.click();\n });\n });\n }\n\n ngOnDestroy(): void {\n this._destroy$.next();\n }\n\n onFileSelect(event: Event): void {\n const fileInputEl = event.target as HTMLInputElement;\n const files: FileList = fileInputEl.files;\n\n const value = this._multiple\n ? files?.length > 1 ? files : files[0]\n : files[0];\n\n this.value = value;\n this.onChange(value);\n this.onTouched();\n\n if (value) {\n this.selectedFile.emit(value);\n }\n }\n\n clear(): void {\n this.value = undefined;\n this.onChange(undefined);\n this._renderer.setProperty(this._fileInput.nativeElement, 'value', '');\n }\n\n // implements ControlValueAccessor interface\n\n onChange = (_: any) => { \n // set by registerOnChange\n };\n\n onTouched = () => {\n // set by registerOnTouched\n };\n\n writeValue(value: any): void {\n this.value = value;\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n setDisabledState?(isDisabled: boolean): void {\n this._disabled = isDisabled;\n }\n\n // implements Validator interface\n\n validate(control: AbstractControl<File | FileList | undefined>): ValidationErrors {\n const isSizeLimitExceeded = this.isFileSizeLimitExceeded(control.value);\n const isCountLimitExceeded = this.isFileCountLimitExceeded(control.value);\n\n if (!isSizeLimitExceeded && !isCountLimitExceeded) {\n return null;\n }\n return {\n ...(isSizeLimitExceeded ? { maxFileSize: true } : {}),\n ...(isCountLimitExceeded ? { maxFileCount: true } : {})\n };\n }\n\n private isFileCountLimitExceeded(files: File | FileList): boolean {\n const isMultiple = this.multiple && files instanceof FileList;\n const maxFileCount = this.maxFileCount;\n const actualFileCount = (files as FileList)?.length;\n\n return isMultiple && maxFileCount && actualFileCount > maxFileCount;\n }\n\n private isFileSizeLimitExceeded(files: File | FileList): boolean {\n if (!this.maxFileSizeInKb) {\n return false;\n }\n const maxFileSizeInBytes = this.maxFileSizeInKb * 1024;\n\n if (files instanceof File) {\n return files.size > maxFileSizeInBytes;\n }\n if (files instanceof FileList) {\n return Array.from(files).some(file => file.size > maxFileSizeInBytes);\n }\n return false;\n }\n}\n","<button\r\n #fileButton\r\n mat-button\r\n entry-submit-button\r\n type=\"button\"\r\n [disabled]=\"disabled || readonly\"\r\n aria-controls=\"fileInput\"\r\n aria-label=\"Upload Files\">\r\n <mat-icon *ngIf=\"matIcon\">{{matIcon}}</mat-icon>\r\n <span>{{label}}</span>\r\n</button>\r\n<ng-container *ngIf=\"value\">\r\n {{fileNames}}\r\n</ng-container>\r\n<input\r\n #fileInput\r\n type=\"file\"\r\n class=\"file-input-hidden\"\r\n [accept]=\"accept\"\r\n [multiple]=\"multiple\"\r\n [disabled]=\"disabled\"\r\n [readonly]=\"readonly\"\r\n (change)=\"onFileSelect($event)\"\r\n aria-label=\"File Upload\"\r\n id=\"fileInput\"\r\n/>","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { EntryFileInputComponent } from './entry-file-input.component';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatButtonModule } from '@angular/material/button';\nimport { FormsModule } from '@angular/forms';\nimport { EntryButtonModule } from '@enigmatry/entry-components/button';\n\n@NgModule({\n declarations: [\n EntryFileInputComponent\n ],\n imports: [\n CommonModule,\n FormsModule,\n MatIconModule,\n MatButtonModule,\n EntryButtonModule\n ],\n exports: [\n EntryFileInputComponent\n ]\n})\nexport class EntryFileInputModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;AAcA,MAAM,SAAS,GAAG;AAChB,IAAA;AACE,QAAA,OAAO,EAAE,iBAAiB;AAC1B,QAAA,WAAW,EAAE,UAAU,CAAC,MAAM,uBAAuB,CAAC;AACtD,QAAA,KAAK,EAAE;AACR,KAAA;AACD,IAAA;AACE,QAAA,OAAO,EAAE,aAAa;AACtB,QAAA,WAAW,EAAE,UAAU,CAAC,MAAM,uBAAuB,CAAC;AACtD,QAAA,KAAK,EAAE;AACR;CACF;MAUY,uBAAuB,CAAA;AAiBlC;;AAEG;IACH,IACI,QAAQ,CAAC,QAAsB,EAAA;AACjC,QAAA,IAAI,CAAC,SAAS,GAAG,qBAAqB,CAAC,QAAQ,CAAC;;AAElD,IAAA,IAAI,QAAQ,GAAA;QACV,OAAO,IAAI,CAAC,SAAS;;AAIvB;;AAEG;IACH,IACI,QAAQ,CAAC,QAAsB,EAAA;AACjC,QAAA,IAAI,CAAC,SAAS,GAAG,qBAAqB,CAAC,QAAQ,CAAC;;AAElD,IAAA,IAAI,QAAQ,GAAA;QACV,OAAO,IAAI,CAAC,SAAS;;AAIvB;;AAEG;IACH,IACI,QAAQ,CAAC,QAAsB,EAAA;AACjC,QAAA,IAAI,CAAC,SAAS,GAAG,qBAAqB,CAAC,QAAQ,CAAC;;AAElD,IAAA,IAAI,QAAQ,GAAA;QACV,OAAO,IAAI,CAAC,SAAS;;IAiCvB,WACmB,CAAA,OAAe,EACf,SAAoB,EAAA;QADpB,IAAO,CAAA,OAAA,GAAP,OAAO;QACP,IAAS,CAAA,SAAA,GAAT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AAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,YAV7B,YAAY;YACZ,WAAW;YACX,aAAa;YACb,eAAe;YACf,iBAAiB,CAAA,EAAA,CAAA,CAAA;;2FAMR,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAfhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,WAAW;wBACX,aAAa;wBACb,eAAe;wBACf;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP;AACD;AACF,iBAAA;;;ACtBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"enigmatry-entry-components-file-input.mjs","sources":["../../../../libs/entry-components/file-input/entry-file-input.component.ts","../../../../libs/entry-components/file-input/entry-file-input.component.html","../../../../libs/entry-components/file-input/entry-file-input.module.ts","../../../../libs/entry-components/file-input/enigmatry-entry-components-file-input.ts"],"sourcesContent":["/* eslint-disable max-lines */\n\nimport { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n ChangeDetectionStrategy,\n Component, ElementRef, EventEmitter, Input, NgZone,\n OnDestroy, OnInit, Output, Renderer2, ViewChild, forwardRef,\n inject\n} from '@angular/core';\nimport {\n AbstractControl, ControlValueAccessor, NG_VALIDATORS,\n NG_VALUE_ACCESSOR, ValidationErrors, Validator\n} from '@angular/forms';\nimport { Subject, fromEvent } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nconst providers = [\n {\n provide: NG_VALUE_ACCESSOR,\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n useExisting: forwardRef(() => EntryFileInputComponent),\n multi: true\n },\n {\n provide: NG_VALIDATORS,\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n useExisting: forwardRef(() => EntryFileInputComponent),\n multi: true\n }\n];\n\n@Component({\n standalone: false,\n selector: 'entry-file-input',\n templateUrl: './entry-file-input.component.html',\n styleUrls: ['./entry-file-input.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers\n})\nexport class EntryFileInputComponent implements OnInit, OnDestroy, ControlValueAccessor, Validator {\n private readonly _ngZone: NgZone = inject(NgZone);\n private readonly _renderer: Renderer2 = inject(Renderer2);\n\n /**\n * Label for the select file button. Defaults to 'Choose file...'\n */\n @Input() label = 'Choose file...';\n\n /**\n * MatIcon for the select file button. Defaults to 'insert_drive_file' (optional)\n */\n @Input() matIcon? = 'insert_drive_file';\n\n /**\n * Same as 'accept' attribute in <input/> element.\n */\n @Input() accept?: string;\n\n /**\n * Same as 'multiple' attribute in <input/> element.\n */\n @Input()\n set multiple(multiple: BooleanInput) {\n this._multiple = coerceBooleanProperty(multiple);\n }\n get multiple(): boolean {\n return this._multiple;\n }\n private _multiple = false;\n\n /**\n * Same as 'disabled' attribute in <input/> element.\n */\n @Input()\n set disabled(disabled: BooleanInput) {\n this._disabled = coerceBooleanProperty(disabled);\n }\n get disabled(): boolean {\n return this._disabled;\n }\n private _disabled = false;\n\n /**\n * Same as 'readonly' attribute in <input/> element.\n */\n @Input()\n set readonly(readonly: BooleanInput) {\n this._readonly = coerceBooleanProperty(readonly);\n }\n get readonly(): boolean {\n return this._readonly;\n }\n private _readonly = false;\n\n /**\n * Size limit per file in KB (kilobytes)\n */\n @Input() maxFileSizeInKb?: number = undefined;\n\n /**\n * Number of files allowed when multiple=true\n */\n @Input() maxFileCount?: number = undefined;\n\n /**\n * Current selected [File | FileList] object.\n */\n value: File | FileList | undefined;\n\n /**\n * Event emitted when a file is selected. Emits a [File | FileList] object.\n */\n @Output() selectedFile = new EventEmitter<File | FileList>();\n\n\n @ViewChild('fileButton', { static: true, read: ElementRef })\n _fileButton!: ElementRef<HTMLElement>;\n\n @ViewChild('fileInput', { static: true })\n _fileInput!: ElementRef<HTMLInputElement>;\n\n private _destroy$ = new Subject<void>();\n\n get fileNames(): string {\n if (this.value instanceof File) {\n return this.value.name;\n }\n if (this.value instanceof FileList) {\n return `${this.value.length} files`;\n }\n return '';\n }\n\n ngOnInit(): void {\n // Handle click event on custom file button and trigger click on native file input\n this._ngZone.runOutsideAngular(() => {\n fromEvent(this._fileButton.nativeElement, 'click')\n .pipe(takeUntil(this._destroy$))\n .subscribe(() => {\n this._fileInput.nativeElement.click();\n });\n });\n }\n\n ngOnDestroy(): void {\n this._destroy$.next();\n }\n\n onFileSelect(event: Event): void {\n const fileInputEl = event.target as HTMLInputElement;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const files: FileList = fileInputEl.files!;\n\n const value = this._multiple\n ? files.length > 1 ? files : files[0]\n : files[0];\n\n this.value = value;\n this.onChange(value);\n this.onTouched();\n\n if (value) {\n this.selectedFile.emit(value);\n }\n }\n\n clear(): void {\n this.value = undefined;\n this.onChange(undefined);\n this._renderer.setProperty(this._fileInput.nativeElement, 'value', '');\n }\n\n // implements ControlValueAccessor interface\n\n onChange = (_: any) => {\n // set by registerOnChange\n };\n\n onTouched = () => {\n // set by registerOnTouched\n };\n\n writeValue(value: any): void {\n this.value = value;\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n setDisabledState?(isDisabled: boolean): void {\n this._disabled = isDisabled;\n }\n\n // implements Validator interface\n\n validate(control: AbstractControl<File | FileList | undefined>): ValidationErrors | null {\n const isSizeLimitExceeded = this.isFileSizeLimitExceeded(control.value);\n const isCountLimitExceeded = this.isFileCountLimitExceeded(control.value);\n\n if (!isSizeLimitExceeded && !isCountLimitExceeded) {\n return null;\n }\n return {\n ...isSizeLimitExceeded ? { maxFileSize: true } : {},\n ...isCountLimitExceeded ? { maxFileCount: true } : {}\n };\n }\n\n private isFileCountLimitExceeded(files: File | FileList | undefined): boolean {\n const isMultiple = this.multiple && files instanceof FileList;\n const maxFileCount = this.maxFileCount;\n const actualFileCount = (files as FileList)?.length;\n\n return isMultiple && !!maxFileCount && actualFileCount > maxFileCount;\n }\n\n private isFileSizeLimitExceeded(files: File | FileList | undefined): boolean {\n if (!this.maxFileSizeInKb) {\n return false;\n }\n const kilobyte = 1024;\n const maxFileSizeInBytes = this.maxFileSizeInKb * kilobyte;\n\n if (files instanceof File) {\n return files.size > maxFileSizeInBytes;\n }\n if (files instanceof FileList) {\n return Array.from(files).some(file => file.size > maxFileSizeInBytes);\n }\n return false;\n }\n}\n","<button\r\n #fileButton\r\n mat-button\r\n entry-submit-button\r\n type=\"button\"\r\n [disabled]=\"disabled || readonly\"\r\n aria-controls=\"fileInput\"\r\n aria-label=\"Upload Files\">\r\n <mat-icon *ngIf=\"matIcon\">{{matIcon}}</mat-icon>\r\n <span>{{label}}</span>\r\n</button>\r\n<ng-container *ngIf=\"value\">\r\n {{fileNames}}\r\n</ng-container>\r\n<input\r\n #fileInput\r\n type=\"file\"\r\n class=\"file-input-hidden\"\r\n [accept]=\"accept\"\r\n [multiple]=\"multiple\"\r\n [disabled]=\"disabled\"\r\n [readonly]=\"readonly\"\r\n (change)=\"onFileSelect($event)\"\r\n aria-label=\"File Upload\"\r\n id=\"fileInput\"\r\n/>","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { EntryButtonModule } from '@enigmatry/entry-components/button';\nimport { EntryFileInputComponent } from './entry-file-input.component';\n\n@NgModule({\n declarations: [\n EntryFileInputComponent\n ],\n imports: [\n CommonModule,\n FormsModule,\n MatIconModule,\n MatButtonModule,\n EntryButtonModule\n ],\n exports: [\n EntryFileInputComponent\n ]\n})\nexport class EntryFileInputModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAA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EAAA,UAAA,EAAA,CAAA;kBAfhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,WAAW;wBACX,aAAa;wBACb,eAAe;wBACf;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP;AACD;AACF,iBAAA;;;ACtBD;;AAEG;;;;"}
|
|
@@ -1,50 +1,55 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Pipe,
|
|
3
|
-
import
|
|
4
|
-
import { NgIf, CommonModule } from '@angular/common';
|
|
2
|
+
import { inject, Pipe, ElementRef, Renderer2, Input, Directive, NgModule } from '@angular/core';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
5
4
|
|
|
6
5
|
class EntryPermissionService {
|
|
7
6
|
}
|
|
8
7
|
|
|
9
8
|
class EntryPermissionPipe {
|
|
10
|
-
constructor(
|
|
11
|
-
this.permissionsService =
|
|
9
|
+
constructor() {
|
|
10
|
+
this.permissionsService = inject((EntryPermissionService));
|
|
12
11
|
}
|
|
13
12
|
transform(permissions) {
|
|
14
13
|
return this.permissionsService.hasPermissions(permissions);
|
|
15
14
|
}
|
|
16
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
17
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
15
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: EntryPermissionPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
16
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.1.2", ngImport: i0, type: EntryPermissionPipe, isStandalone: false, name: "entryHasPermissions" }); }
|
|
18
17
|
}
|
|
19
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
18
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: EntryPermissionPipe, decorators: [{
|
|
20
19
|
type: Pipe,
|
|
21
20
|
args: [{
|
|
22
21
|
name: 'entryHasPermissions',
|
|
23
22
|
standalone: false
|
|
24
23
|
}]
|
|
25
|
-
}]
|
|
24
|
+
}] });
|
|
26
25
|
|
|
27
26
|
class EntryPermissionDirective {
|
|
28
27
|
constructor() {
|
|
29
|
-
this.
|
|
28
|
+
this.elementRef = inject(ElementRef);
|
|
29
|
+
this.renderer = inject(Renderer2);
|
|
30
30
|
this.permissionService = inject((EntryPermissionService));
|
|
31
31
|
}
|
|
32
32
|
set only(permissions) {
|
|
33
|
-
this.
|
|
33
|
+
this.toggleVisibility(this.permissionService.hasPermissions(permissions));
|
|
34
34
|
}
|
|
35
35
|
set except(permissions) {
|
|
36
|
-
this.
|
|
36
|
+
this.toggleVisibility(!this.permissionService.hasPermissions(permissions));
|
|
37
|
+
}
|
|
38
|
+
toggleVisibility(show) {
|
|
39
|
+
if (show) {
|
|
40
|
+
this.renderer.removeStyle(this.elementRef.nativeElement, 'display');
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
this.renderer.setStyle(this.elementRef.nativeElement, 'display', 'none');
|
|
44
|
+
}
|
|
37
45
|
}
|
|
38
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
39
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
46
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: EntryPermissionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
47
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.2", type: EntryPermissionDirective, isStandalone: false, selector: "[entryPermissionsOnly],[entryPermissionsExcept]", inputs: { only: ["entryPermissionsOnly", "only"], except: ["entryPermissionsExcept", "except"] }, ngImport: i0 }); }
|
|
40
48
|
}
|
|
41
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: EntryPermissionDirective, decorators: [{
|
|
42
50
|
type: Directive,
|
|
43
51
|
args: [{
|
|
44
52
|
selector: '[entryPermissionsOnly],[entryPermissionsExcept]',
|
|
45
|
-
hostDirectives: [{
|
|
46
|
-
directive: NgIf
|
|
47
|
-
}],
|
|
48
53
|
standalone: false
|
|
49
54
|
}]
|
|
50
55
|
}], propDecorators: { only: [{
|
|
@@ -57,7 +62,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
|
|
|
57
62
|
|
|
58
63
|
const entryPermissionGuard = (route, _state) => {
|
|
59
64
|
const permissionService = inject(EntryPermissionService);
|
|
60
|
-
const routePermissions = route.data
|
|
65
|
+
const routePermissions = route.data['permissions'] ?? {};
|
|
61
66
|
if (routePermissions.only) {
|
|
62
67
|
return permissionService.hasPermissions(routePermissions.only);
|
|
63
68
|
}
|
|
@@ -68,13 +73,13 @@ const entryPermissionGuard = (route, _state) => {
|
|
|
68
73
|
};
|
|
69
74
|
|
|
70
75
|
class EntryPermissionModule {
|
|
71
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
72
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
76
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: EntryPermissionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
77
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.2", ngImport: i0, type: EntryPermissionModule, declarations: [EntryPermissionDirective,
|
|
73
78
|
EntryPermissionPipe], imports: [CommonModule], exports: [EntryPermissionDirective,
|
|
74
79
|
EntryPermissionPipe] }); }
|
|
75
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
80
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: EntryPermissionModule, imports: [CommonModule] }); }
|
|
76
81
|
}
|
|
77
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
82
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: EntryPermissionModule, decorators: [{
|
|
78
83
|
type: NgModule,
|
|
79
84
|
args: [{
|
|
80
85
|
declarations: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enigmatry-entry-components-permissions.mjs","sources":["../../../../libs/entry-components/permissions/permission.service.ts","../../../../libs/entry-components/permissions/permission.pipe.ts","../../../../libs/entry-components/permissions/permission.directive.ts","../../../../libs/entry-components/permissions/permission.guard.ts","../../../../libs/entry-components/permissions/permission.module.ts","../../../../libs/entry-components/permissions/enigmatry-entry-components-permissions.ts"],"sourcesContent":["import { PermissionType } from './permission-type';\r\n\r\nexport abstract class EntryPermissionService<T extends PermissionType> {\r\n public abstract hasPermissions(permissions: T[]): boolean;\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { PermissionType } from './permission-type';\nimport { EntryPermissionService } from './permission.service';\n\n@Pipe({\n name: 'entryHasPermissions',\n standalone: false\n})\nexport class EntryPermissionPipe<T extends PermissionType> implements PipeTransform {\n
|
|
1
|
+
{"version":3,"file":"enigmatry-entry-components-permissions.mjs","sources":["../../../../libs/entry-components/permissions/permission.service.ts","../../../../libs/entry-components/permissions/permission.pipe.ts","../../../../libs/entry-components/permissions/permission.directive.ts","../../../../libs/entry-components/permissions/permission.guard.ts","../../../../libs/entry-components/permissions/permission.module.ts","../../../../libs/entry-components/permissions/enigmatry-entry-components-permissions.ts"],"sourcesContent":["import { PermissionType } from './permission-type';\r\n\r\nexport abstract class EntryPermissionService<T extends PermissionType> {\r\n public abstract hasPermissions(permissions: T[]): boolean;\r\n}\r\n","import { inject, Pipe, PipeTransform } from '@angular/core';\nimport { PermissionType } from './permission-type';\nimport { EntryPermissionService } from './permission.service';\n\n@Pipe({\n name: 'entryHasPermissions',\n standalone: false\n})\nexport class EntryPermissionPipe<T extends PermissionType> implements PipeTransform {\n private readonly permissionsService = inject(EntryPermissionService<T>);\n\n transform(permissions: T[]): boolean {\n return this.permissionsService.hasPermissions(permissions);\n }\n}\n","import { Directive, Input, inject, ElementRef, Renderer2 } from '@angular/core';\nimport { PermissionType } from './permission-type';\nimport { EntryPermissionService } from './permission.service';\n\n@Directive({\n selector: '[entryPermissionsOnly],[entryPermissionsExcept]',\n standalone: false\n})\nexport class EntryPermissionDirective<T extends PermissionType> {\n private elementRef = inject(ElementRef);\n private renderer = inject(Renderer2);\n private permissionService = inject(EntryPermissionService<T>);\n\n @Input('entryPermissionsOnly') set only(permissions: T[]) {\n this.toggleVisibility(this.permissionService.hasPermissions(permissions));\n }\n\n @Input('entryPermissionsExcept') set except(permissions: T[]) {\n this.toggleVisibility(!this.permissionService.hasPermissions(permissions));\n }\n\n private toggleVisibility(show: boolean): void {\n if (show) {\n this.renderer.removeStyle(this.elementRef.nativeElement, 'display');\n } else {\n this.renderer.setStyle(this.elementRef.nativeElement, 'display', 'none');\n }\n }\n}\n","import { inject } from '@angular/core';\r\nimport { CanActivateFn, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';\r\nimport { PermissionType } from './permission-type';\r\nimport { EntryPermissionService } from './permission.service';\r\n\r\ninterface RoutePermissionConfig<T extends PermissionType> {\r\n only?: T[];\r\n except?: T[];\r\n}\r\n\r\nexport const entryPermissionGuard: CanActivateFn =\r\n<T extends PermissionType> (route: ActivatedRouteSnapshot, _state: RouterStateSnapshot) => {\r\n const permissionService = inject(EntryPermissionService);\r\n const routePermissions = route.data['permissions'] as RoutePermissionConfig<T> ?? {};\r\n\r\n if (routePermissions.only) {\r\n return permissionService.hasPermissions(routePermissions.only);\r\n }\r\n if (routePermissions.except) {\r\n return !permissionService.hasPermissions(routePermissions.except);\r\n }\r\n\r\n return false;\r\n};\r\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { EntryPermissionDirective } from './permission.directive';\nimport { EntryPermissionPipe } from './permission.pipe';\n\n@NgModule({\n declarations: [\n EntryPermissionDirective,\n EntryPermissionPipe\n ],\n imports: [\n CommonModule\n ],\n exports: [\n EntryPermissionDirective,\n EntryPermissionPipe\n ]\n})\nexport class EntryPermissionModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAEsB,sBAAsB,CAAA;AAE3C;;MCIY,mBAAmB,CAAA;AAJhC,IAAA,WAAA,GAAA;AAKmB,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,EAAC,sBAAyB,EAAC;AAKxE;AAHC,IAAA,SAAS,CAAC,WAAgB,EAAA;QACxB,OAAO,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,WAAW,CAAC;;8GAJjD,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAAnB,mBAAmB,EAAA,YAAA,EAAA,KAAA,EAAA,IAAA,EAAA,qBAAA,EAAA,CAAA,CAAA;;2FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAJ/B,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACF,oBAAA,IAAI,EAAE,qBAAqB;AAC3B,oBAAA,UAAU,EAAE;AACf,iBAAA;;;MCCY,wBAAwB,CAAA;AAJrC,IAAA,WAAA,GAAA;AAKU,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAC/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AA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,wBAAwB;wBACxB;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,wBAAwB;wBACxB;AACD;AACF,iBAAA;;;ACjBD;;AAEG;;;;"}
|
|
@@ -1,31 +1,29 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Input, ChangeDetectionStrategy, Component, inject, ChangeDetectorRef, EventEmitter, DestroyRef, Output, NgModule } from '@angular/core';
|
|
3
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
3
4
|
import * as i1 from '@angular/forms';
|
|
4
5
|
import { FormControl, UntypedFormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
-
import { createInjectionToken, provideConfig,
|
|
6
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
|
+
import { createInjectionToken, provideConfig, EntryDateTimeAdapter, ENTRY_MAT_DATE_TIME_FORMATS } from '@enigmatry/entry-components/common';
|
|
7
7
|
import * as i1$1 from '@angular/common';
|
|
8
8
|
import { CommonModule } from '@angular/common';
|
|
9
9
|
import * as i3$1 from '@angular/material/button';
|
|
10
10
|
import { MatButtonModule } from '@angular/material/button';
|
|
11
11
|
import * as i4$2 from '@enigmatry/entry-components/button';
|
|
12
12
|
import { EntryButtonModule } from '@enigmatry/entry-components/button';
|
|
13
|
-
import * as
|
|
13
|
+
import * as i4 from '@enigmatry/entry-components/validation';
|
|
14
14
|
import { EntryValidationModule } from '@enigmatry/entry-components/validation';
|
|
15
15
|
import * as i2 from '@angular/material/input';
|
|
16
16
|
import { MatInputModule } from '@angular/material/input';
|
|
17
|
-
import * as
|
|
18
|
-
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
19
|
-
import * as i4 from '@angular/material/select';
|
|
17
|
+
import * as i4$1 from '@angular/material/select';
|
|
20
18
|
import { MatSelectModule } from '@angular/material/select';
|
|
21
|
-
import * as i5$1 from '@angular/material/core';
|
|
22
|
-
import { MAT_DATE_FORMATS, DateAdapter } from '@angular/material/core';
|
|
23
19
|
import { of, Subject } from 'rxjs';
|
|
24
20
|
import { takeUntil, tap, filter, debounceTime } from 'rxjs/operators';
|
|
25
|
-
import * as
|
|
21
|
+
import * as i5 from '@angular/material/autocomplete';
|
|
26
22
|
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
27
|
-
import
|
|
23
|
+
import { MAT_DATE_FORMATS, DateAdapter } from '@angular/material/core';
|
|
24
|
+
import * as i3 from '@angular/material/datepicker';
|
|
28
25
|
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
26
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
29
27
|
|
|
30
28
|
var ControlType;
|
|
31
29
|
(function (ControlType) {
|
|
@@ -49,17 +47,15 @@ const ENTRY_SEARCH_FILTER_CONFIG = createInjectionToken(new EntrySearchFilterCon
|
|
|
49
47
|
/**
|
|
50
48
|
* Can be used to provide entry search filter configuration.
|
|
51
49
|
*/
|
|
52
|
-
|
|
53
|
-
return provideConfig(ENTRY_SEARCH_FILTER_CONFIG, () => new EntrySearchFilterConfig(config));
|
|
54
|
-
}
|
|
50
|
+
const provideEntrySearchFilterConfig = (config) => provideConfig(ENTRY_SEARCH_FILTER_CONFIG, () => new EntrySearchFilterConfig(config));
|
|
55
51
|
|
|
56
52
|
class TextSearchFilterComponent {
|
|
57
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
58
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
53
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: TextSearchFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
54
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.2", type: TextSearchFilterComponent, isStandalone: false, 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-error entryDisplayControlValidation [control]=\"form.get(searchFilter.key)!\"></mat-error>\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", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i4.EntryDisplayControlValidationDirective, selector: "[entryDisplayControlValidation]", inputs: ["control"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
59
55
|
}
|
|
60
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
56
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: TextSearchFilterComponent, decorators: [{
|
|
61
57
|
type: Component,
|
|
62
|
-
args: [{ selector: 'entry-text-search-filter', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, 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-error entryDisplayControlValidation [control]=\"form.get(searchFilter.key)
|
|
58
|
+
args: [{ selector: 'entry-text-search-filter', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, 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-error entryDisplayControlValidation [control]=\"form.get(searchFilter.key)!\"></mat-error>\n</mat-form-field>" }]
|
|
63
59
|
}], propDecorators: { searchFilter: [{
|
|
64
60
|
type: Input
|
|
65
61
|
}], form: [{
|
|
@@ -67,31 +63,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
|
|
|
67
63
|
}] } });
|
|
68
64
|
|
|
69
65
|
class SelectSearchFilterComponent {
|
|
70
|
-
constructor(
|
|
71
|
-
this.config =
|
|
66
|
+
constructor() {
|
|
67
|
+
this.config = inject(ENTRY_SEARCH_FILTER_CONFIG);
|
|
72
68
|
}
|
|
73
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
74
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
69
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SelectSearchFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
70
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.2", type: SelectSearchFilterComponent, isStandalone: false, 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 && searchFilter.showNoneOption\" [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-error entryDisplayControlValidation [control]=\"form.get(searchFilter.key)!\"></mat-error>\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: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: i4$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i4$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i4.EntryDisplayControlValidationDirective, selector: "[entryDisplayControlValidation]", inputs: ["control"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
75
71
|
}
|
|
76
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
72
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SelectSearchFilterComponent, decorators: [{
|
|
77
73
|
type: Component,
|
|
78
|
-
args: [{ selector: 'entry-select-search-filter', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, 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 && searchFilter.showNoneOption\" [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-error entryDisplayControlValidation [control]=\"form.get(searchFilter.key)
|
|
79
|
-
}],
|
|
80
|
-
type: Inject,
|
|
81
|
-
args: [ENTRY_SEARCH_FILTER_CONFIG]
|
|
82
|
-
}] }], propDecorators: { searchFilter: [{
|
|
74
|
+
args: [{ selector: 'entry-select-search-filter', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, 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 && searchFilter.showNoneOption\" [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-error entryDisplayControlValidation [control]=\"form.get(searchFilter.key)!\"></mat-error>\n</mat-form-field>" }]
|
|
75
|
+
}], propDecorators: { searchFilter: [{
|
|
83
76
|
type: Input
|
|
84
77
|
}], form: [{
|
|
85
78
|
type: Input
|
|
86
79
|
}] } });
|
|
87
80
|
|
|
88
81
|
class AutocompleteSearchFilterComponent {
|
|
89
|
-
constructor(
|
|
90
|
-
this.cdr = cdr;
|
|
82
|
+
constructor() {
|
|
91
83
|
this.searchField = new FormControl('');
|
|
92
84
|
this.options$ = of([]);
|
|
93
85
|
this.destroy$ = new Subject();
|
|
94
|
-
this.
|
|
86
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
87
|
+
this.displayFn = (_selectedValue) => this.searchFilter.formControl.value?.label ?? '';
|
|
95
88
|
this.onSelected = (event) => {
|
|
96
89
|
this.searchFilter.formControl.patchValue(event.option.value);
|
|
97
90
|
this.searchField.patchValue(event.option.value.label, { emitEvent: false });
|
|
@@ -100,7 +93,7 @@ class AutocompleteSearchFilterComponent {
|
|
|
100
93
|
ngAfterViewInit() {
|
|
101
94
|
this.searchField
|
|
102
95
|
.valueChanges
|
|
103
|
-
.pipe(takeUntil(this.destroy$), tap(value => this.clearFilterIfLabelMismatch(value)), filter(value => value
|
|
96
|
+
.pipe(takeUntil(this.destroy$), tap(value => this.clearFilterIfLabelMismatch(value)), filter(value => !!value && value.length >= this.searchFilter.minimumCharacters), debounceTime(this.searchFilter.debounceTime))
|
|
104
97
|
.subscribe(searchValue => {
|
|
105
98
|
// call search and retrieve options
|
|
106
99
|
this.options$ = this.searchFilter.search(searchValue);
|
|
@@ -119,29 +112,29 @@ class AutocompleteSearchFilterComponent {
|
|
|
119
112
|
this.searchField.patchValue(null, { emitEvent: false });
|
|
120
113
|
}
|
|
121
114
|
}
|
|
122
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
123
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
115
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: AutocompleteSearchFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
116
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.2", type: AutocompleteSearchFilterComponent, isStandalone: false, 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-error entryDisplayControlValidation [control]=\"searchField\"></mat-error>\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", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: i4$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i5.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i5.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "directive", type: i4.EntryDisplayControlValidationDirective, selector: "[entryDisplayControlValidation]", inputs: ["control"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
124
117
|
}
|
|
125
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
118
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: AutocompleteSearchFilterComponent, decorators: [{
|
|
126
119
|
type: Component,
|
|
127
120
|
args: [{ selector: 'entry-autocomplete-search-filter', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, 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-error entryDisplayControlValidation [control]=\"searchField\"></mat-error>\n</mat-form-field>" }]
|
|
128
|
-
}],
|
|
121
|
+
}], propDecorators: { searchFilter: [{
|
|
129
122
|
type: Input
|
|
130
123
|
}] } });
|
|
131
124
|
|
|
132
125
|
class DateTimeSearchFilterComponent {
|
|
133
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
134
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
126
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: DateTimeSearchFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
127
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.2", type: DateTimeSearchFilterComponent, isStandalone: false, selector: "entry-date-time-search-filter", inputs: { searchFilter: "searchFilter", form: "form" }, providers: [
|
|
135
128
|
{ provide: MAT_DATE_FORMATS, useFactory: () => inject(ENTRY_MAT_DATE_TIME_FORMATS) },
|
|
136
129
|
{ provide: DateAdapter, useClass: EntryDateTimeAdapter }
|
|
137
|
-
], ngImport: i0, template: "<mat-form-field class=\"date-time-search-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-error entryDisplayControlValidation [control]=\"form.get(searchFilter.key)
|
|
130
|
+
], ngImport: i0, template: "<mat-form-field class=\"date-time-search-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-error entryDisplayControlValidation [control]=\"form.get(searchFilter.key)!\"></mat-error>\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", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i3.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i3.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i3.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "directive", type: i4.EntryDisplayControlValidationDirective, selector: "[entryDisplayControlValidation]", inputs: ["control"] }] }); }
|
|
138
131
|
}
|
|
139
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
132
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: DateTimeSearchFilterComponent, decorators: [{
|
|
140
133
|
type: Component,
|
|
141
134
|
args: [{ selector: 'entry-date-time-search-filter', providers: [
|
|
142
135
|
{ provide: MAT_DATE_FORMATS, useFactory: () => inject(ENTRY_MAT_DATE_TIME_FORMATS) },
|
|
143
136
|
{ provide: DateAdapter, useClass: EntryDateTimeAdapter }
|
|
144
|
-
], standalone: false, template: "<mat-form-field class=\"date-time-search-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-error entryDisplayControlValidation [control]=\"form.get(searchFilter.key)
|
|
137
|
+
], standalone: false, template: "<mat-form-field class=\"date-time-search-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-error entryDisplayControlValidation [control]=\"form.get(searchFilter.key)!\"></mat-error>\n</mat-form-field>" }]
|
|
145
138
|
}], propDecorators: { searchFilter: [{
|
|
146
139
|
type: Input
|
|
147
140
|
}], form: [{
|
|
@@ -149,12 +142,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
|
|
|
149
142
|
}] } });
|
|
150
143
|
|
|
151
144
|
class DateSearchFilterComponent {
|
|
152
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
153
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
145
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: DateSearchFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
146
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.2", type: DateSearchFilterComponent, isStandalone: false, 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-error entryDisplayControlValidation [control]=\"form.get(searchFilter.key)!\"></mat-error>\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", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i3.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i3.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i3.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "directive", type: i4.EntryDisplayControlValidationDirective, selector: "[entryDisplayControlValidation]", inputs: ["control"] }] }); }
|
|
154
147
|
}
|
|
155
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
148
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: DateSearchFilterComponent, decorators: [{
|
|
156
149
|
type: Component,
|
|
157
|
-
args: [{ selector: 'entry-date-search-filter', standalone: false, 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-error entryDisplayControlValidation [control]=\"form.get(searchFilter.key)
|
|
150
|
+
args: [{ selector: 'entry-date-search-filter', standalone: false, 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-error entryDisplayControlValidation [control]=\"form.get(searchFilter.key)!\"></mat-error>\n</mat-form-field>" }]
|
|
158
151
|
}], propDecorators: { searchFilter: [{
|
|
159
152
|
type: Input
|
|
160
153
|
}], form: [{
|
|
@@ -205,10 +198,10 @@ class EntrySearchFilterComponent {
|
|
|
205
198
|
const formValue = this.searchFilterForm.value;
|
|
206
199
|
this.searchFilterChange.emit(formValue);
|
|
207
200
|
}
|
|
208
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
209
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
201
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: EntrySearchFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
202
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.2", type: EntrySearchFilterComponent, isStandalone: false, 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 <entry-form-errors [form]=\"searchFilterForm\"></entry-form-errors>\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[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: i4$2.EntryButtonDirective, selector: "[mat-button][entry-submit-button],[mat-button][entry-cancel-button]" }, { kind: "component", type: i4.EntryFormErrorsComponent, selector: "entry-form-errors", inputs: ["form"] }, { 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 }); }
|
|
210
203
|
}
|
|
211
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
204
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: EntrySearchFilterComponent, decorators: [{
|
|
212
205
|
type: Component,
|
|
213
206
|
args: [{ selector: 'entry-search-filter', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<form (ngSubmit)=\"onSubmit()\" [formGroup]=\"searchFilterForm\" class=\"search-form-container entry-form\">\r\n <entry-form-errors [form]=\"searchFilterForm\"></entry-form-errors>\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>" }]
|
|
214
207
|
}], propDecorators: { searchFilters: [{
|
|
@@ -269,10 +262,10 @@ class SelectSearchFilter extends SearchFilterBase {
|
|
|
269
262
|
* */
|
|
270
263
|
this.multiSelect = true;
|
|
271
264
|
this.showNoneOption = true;
|
|
272
|
-
this.options = options.options;
|
|
265
|
+
this.options = options.options ?? [];
|
|
273
266
|
this.options$ = options.options$;
|
|
274
|
-
this.multiSelect = options.multiSelect;
|
|
275
|
-
this.showNoneOption = options.showNoneOption;
|
|
267
|
+
this.multiSelect = !!options.multiSelect;
|
|
268
|
+
this.showNoneOption = !!options.showNoneOption;
|
|
276
269
|
}
|
|
277
270
|
}
|
|
278
271
|
|
|
@@ -285,11 +278,14 @@ class AutocompleteSearchFilter extends SearchFilterBase {
|
|
|
285
278
|
constructor(options = {}) {
|
|
286
279
|
super(options);
|
|
287
280
|
this.controlType = ControlType.autocomplete;
|
|
281
|
+
this.defaultMinimumCharacters = 3;
|
|
282
|
+
this.defaultDebounceTime = 300;
|
|
283
|
+
if (!options.search) {
|
|
284
|
+
throw new Error('Search function must be provided for AutocompleteSearchFilter');
|
|
285
|
+
}
|
|
288
286
|
this.search = options.search;
|
|
289
|
-
this.
|
|
290
|
-
this.
|
|
291
|
-
this.debounceTime = options.debounceTime ?? 300;
|
|
292
|
-
this.minimumCharacters = options.minimumCharacters ?? 3;
|
|
287
|
+
this.debounceTime = options.debounceTime ?? this.defaultDebounceTime;
|
|
288
|
+
this.minimumCharacters = options.minimumCharacters ?? this.defaultMinimumCharacters;
|
|
293
289
|
}
|
|
294
290
|
}
|
|
295
291
|
|
|
@@ -326,8 +322,8 @@ class DateSearchFilter extends SearchFilterBase {
|
|
|
326
322
|
}
|
|
327
323
|
|
|
328
324
|
class EntrySearchFilterModule {
|
|
329
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
330
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
325
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: EntrySearchFilterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
326
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.2", ngImport: i0, type: EntrySearchFilterModule, declarations: [EntrySearchFilterComponent,
|
|
331
327
|
TextSearchFilterComponent,
|
|
332
328
|
SelectSearchFilterComponent,
|
|
333
329
|
AutocompleteSearchFilterComponent,
|
|
@@ -343,7 +339,7 @@ class EntrySearchFilterModule {
|
|
|
343
339
|
MatDatepickerModule,
|
|
344
340
|
MatFormFieldModule,
|
|
345
341
|
EntryValidationModule], exports: [EntrySearchFilterComponent] }); }
|
|
346
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
342
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: EntrySearchFilterModule, imports: [CommonModule,
|
|
347
343
|
FormsModule,
|
|
348
344
|
ReactiveFormsModule,
|
|
349
345
|
MatInputModule,
|
|
@@ -355,7 +351,7 @@ class EntrySearchFilterModule {
|
|
|
355
351
|
MatFormFieldModule,
|
|
356
352
|
EntryValidationModule] }); }
|
|
357
353
|
}
|
|
358
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
354
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: EntrySearchFilterModule, decorators: [{
|
|
359
355
|
type: NgModule,
|
|
360
356
|
args: [{
|
|
361
357
|
declarations: [
|