@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
|
@@ -1 +0,0 @@
|
|
|
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 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\n onTouched = () => { };\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 <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/>","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,IAAI;AACZ,KAAA;AACD,IAAA;AACE,QAAA,OAAO,EAAE,aAAa;AACtB,QAAA,WAAW,EAAE,UAAU,CAAC,MAAM,uBAAuB,CAAC;AACtD,QAAA,KAAK,EAAE,IAAI;AACZ,KAAA;CACF,CAAC;MASW,uBAAuB,CAAA;AAiBlC;;AAEG;IACH,IACI,QAAQ,CAAC,QAAsB,EAAA;AACjC,QAAA,IAAI,CAAC,SAAS,GAAG,qBAAqB,C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ACf,iBAAiB,aAGjB,uBAAuB,CAAA,EAAA,CAAA,CAAA;AAGd,oBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,YAV7B,YAAY;QACZ,WAAW;QACX,aAAa;QACb,eAAe;QACf,iBAAiB,CAAA,EAAA,CAAA,CAAA;4FAMR,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAfhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,uBAAuB;AACxB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,WAAW;wBACX,aAAa;wBACb,eAAe;wBACf,iBAAiB;AAClB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,uBAAuB;AACxB,qBAAA;iBACF,CAAA;;;ACtBD;;AAEG;;;;"}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Pipe, inject, Directive, Input, NgModule } from '@angular/core';
|
|
3
|
-
import * as i1 from '@angular/common';
|
|
4
|
-
import { NgIf, CommonModule } from '@angular/common';
|
|
5
|
-
|
|
6
|
-
class EntryPermissionService {
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
class EntryPermissionPipe {
|
|
10
|
-
constructor(permissionsService) {
|
|
11
|
-
this.permissionsService = permissionsService;
|
|
12
|
-
}
|
|
13
|
-
transform(permissions) {
|
|
14
|
-
return this.permissionsService.hasPermissions(permissions);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
EntryPermissionPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntryPermissionPipe, deps: [{ token: EntryPermissionService }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
18
|
-
EntryPermissionPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: EntryPermissionPipe, name: "entryHasPermissions" });
|
|
19
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntryPermissionPipe, decorators: [{
|
|
20
|
-
type: Pipe,
|
|
21
|
-
args: [{
|
|
22
|
-
name: 'entryHasPermissions'
|
|
23
|
-
}]
|
|
24
|
-
}], ctorParameters: function () { return [{ type: EntryPermissionService }]; } });
|
|
25
|
-
|
|
26
|
-
class EntryPermissionDirective {
|
|
27
|
-
constructor() {
|
|
28
|
-
this.ngIfDirective = inject(NgIf);
|
|
29
|
-
this.permissionService = inject((EntryPermissionService));
|
|
30
|
-
}
|
|
31
|
-
set only(permissions) {
|
|
32
|
-
this.ngIfDirective.ngIf = this.permissionService.hasPermissions(permissions);
|
|
33
|
-
}
|
|
34
|
-
set except(permissions) {
|
|
35
|
-
this.ngIfDirective.ngIf = !this.permissionService.hasPermissions(permissions);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
EntryPermissionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntryPermissionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
39
|
-
EntryPermissionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: EntryPermissionDirective, selector: "[entryPermissionsOnly],[entryPermissionsExcept]", inputs: { only: ["entryPermissionsOnly", "only"], except: ["entryPermissionsExcept", "except"] }, hostDirectives: [{ directive: i1.NgIf }], ngImport: i0 });
|
|
40
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntryPermissionDirective, decorators: [{
|
|
41
|
-
type: Directive,
|
|
42
|
-
args: [{
|
|
43
|
-
selector: '[entryPermissionsOnly],[entryPermissionsExcept]',
|
|
44
|
-
hostDirectives: [{
|
|
45
|
-
directive: NgIf
|
|
46
|
-
}]
|
|
47
|
-
}]
|
|
48
|
-
}], propDecorators: { only: [{
|
|
49
|
-
type: Input,
|
|
50
|
-
args: ['entryPermissionsOnly']
|
|
51
|
-
}], except: [{
|
|
52
|
-
type: Input,
|
|
53
|
-
args: ['entryPermissionsExcept']
|
|
54
|
-
}] } });
|
|
55
|
-
|
|
56
|
-
const entryPermissionGuard = (route, _state) => {
|
|
57
|
-
var _a;
|
|
58
|
-
const permissionService = inject(EntryPermissionService);
|
|
59
|
-
const routePermissions = (_a = route.data.permissions) !== null && _a !== void 0 ? _a : {};
|
|
60
|
-
if (routePermissions.only) {
|
|
61
|
-
return permissionService.hasPermissions(routePermissions.only);
|
|
62
|
-
}
|
|
63
|
-
if (routePermissions.except) {
|
|
64
|
-
return !permissionService.hasPermissions(routePermissions.except);
|
|
65
|
-
}
|
|
66
|
-
return false;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
class EntryPermissionModule {
|
|
70
|
-
}
|
|
71
|
-
EntryPermissionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntryPermissionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
72
|
-
EntryPermissionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: EntryPermissionModule, declarations: [EntryPermissionDirective,
|
|
73
|
-
EntryPermissionPipe], imports: [CommonModule], exports: [EntryPermissionDirective,
|
|
74
|
-
EntryPermissionPipe] });
|
|
75
|
-
EntryPermissionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntryPermissionModule, imports: [CommonModule] });
|
|
76
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntryPermissionModule, decorators: [{
|
|
77
|
-
type: NgModule,
|
|
78
|
-
args: [{
|
|
79
|
-
declarations: [
|
|
80
|
-
EntryPermissionDirective,
|
|
81
|
-
EntryPermissionPipe
|
|
82
|
-
],
|
|
83
|
-
imports: [
|
|
84
|
-
CommonModule
|
|
85
|
-
],
|
|
86
|
-
exports: [
|
|
87
|
-
EntryPermissionDirective,
|
|
88
|
-
EntryPermissionPipe
|
|
89
|
-
]
|
|
90
|
-
}]
|
|
91
|
-
}] });
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Generated bundle index. Do not edit.
|
|
95
|
-
*/
|
|
96
|
-
|
|
97
|
-
export { EntryPermissionDirective, EntryPermissionModule, EntryPermissionPipe, EntryPermissionService, entryPermissionGuard };
|
|
98
|
-
//# sourceMappingURL=enigmatry-entry-components-permissions.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
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})\nexport class EntryPermissionPipe<T extends PermissionType> implements PipeTransform {\n constructor(private permissionsService: EntryPermissionService<T>) { }\n\n transform(permissions: T[]): boolean {\n return this.permissionsService.hasPermissions(permissions);\n }\n}\n","import { NgIf } from '@angular/common';\nimport { Directive, Input, inject } from '@angular/core';\nimport { PermissionType } from './permission-type';\nimport { EntryPermissionService } from './permission.service';\n\n@Directive({\n selector: '[entryPermissionsOnly],[entryPermissionsExcept]',\n hostDirectives: [{\n directive: NgIf\n }]\n})\nexport class EntryPermissionDirective<T extends PermissionType> {\n private ngIfDirective = inject(NgIf);\n private permissionService = inject(EntryPermissionService<T>);\n\n @Input('entryPermissionsOnly') set only(permissions: T[]) {\n this.ngIfDirective.ngIf = this.permissionService.hasPermissions(permissions);\n }\n\n @Input('entryPermissionsExcept') set except(permissions: T[]) {\n this.ngIfDirective.ngIf = !this.permissionService.hasPermissions(permissions);\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 { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\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":["i1.EntryPermissionService"],"mappings":";;;;;MAEsB,sBAAsB,CAAA;AAE3C;;MCGY,mBAAmB,CAAA;AAC9B,IAAA,WAAA,CAAoB,kBAA6C,EAAA;AAA7C,QAAA,IAAkB,CAAA,kBAAA,GAAlB,kBAAk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A,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,iBAX9B,wBAAwB;QACxB,mBAAmB,CAAA,EAAA,OAAA,EAAA,CAGnB,YAAY,CAAA,EAAA,OAAA,EAAA,CAGZ,wBAAwB;QACxB,mBAAmB,CAAA,EAAA,CAAA,CAAA;AAGV,qBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,YAP9B,YAAY,CAAA,EAAA,CAAA,CAAA;4FAOH,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAbjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,wBAAwB;wBACxB,mBAAmB;AACpB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,wBAAwB;wBACxB,mBAAmB;AACpB,qBAAA;iBACF,CAAA;;;ACjBD;;AAEG;;;;"}
|
|
@@ -1,394 +0,0 @@
|
|
|
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
|
-
var _a, _b;
|
|
33
|
-
this.applyButtonText = (_a = config.applyButtonText) !== null && _a !== void 0 ? _a : 'Apply';
|
|
34
|
-
this.noneSelectedOptionText = (_b = config.noneSelectedOptionText) !== null && _b !== void 0 ? _b : 'None';
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
const ENTRY_SEARCH_FILTER_CONFIG = createInjectionToken(new EntrySearchFilterConfig());
|
|
38
|
-
/**
|
|
39
|
-
* Can be used to provide entry search filter configuration.
|
|
40
|
-
*/
|
|
41
|
-
function provideEntrySearchFilterConfig(config) {
|
|
42
|
-
return provideConfig(ENTRY_SEARCH_FILTER_CONFIG, () => new EntrySearchFilterConfig(config));
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
var ControlType;
|
|
46
|
-
(function (ControlType) {
|
|
47
|
-
ControlType["text"] = "text-input";
|
|
48
|
-
ControlType["select"] = "select-input";
|
|
49
|
-
ControlType["autocomplete"] = "autocomplete-input";
|
|
50
|
-
ControlType["date"] = "date-input";
|
|
51
|
-
ControlType["dateTime"] = "date-time-input";
|
|
52
|
-
})(ControlType || (ControlType = {}));
|
|
53
|
-
|
|
54
|
-
class TextSearchFilterComponent {
|
|
55
|
-
}
|
|
56
|
-
TextSearchFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TextSearchFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
57
|
-
TextSearchFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", 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 });
|
|
58
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TextSearchFilterComponent, decorators: [{
|
|
59
|
-
type: Component,
|
|
60
|
-
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>" }]
|
|
61
|
-
}], propDecorators: { searchFilter: [{
|
|
62
|
-
type: Input
|
|
63
|
-
}], form: [{
|
|
64
|
-
type: Input
|
|
65
|
-
}] } });
|
|
66
|
-
|
|
67
|
-
class SelectSearchFilterComponent {
|
|
68
|
-
constructor(config) {
|
|
69
|
-
this.config = config;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
SelectSearchFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SelectSearchFilterComponent, deps: [{ token: ENTRY_SEARCH_FILTER_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
|
|
73
|
-
SelectSearchFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", 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", "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 });
|
|
74
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SelectSearchFilterComponent, decorators: [{
|
|
75
|
-
type: Component,
|
|
76
|
-
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>" }]
|
|
77
|
-
}], ctorParameters: function () {
|
|
78
|
-
return [{ type: EntrySearchFilterConfig, decorators: [{
|
|
79
|
-
type: Inject,
|
|
80
|
-
args: [ENTRY_SEARCH_FILTER_CONFIG]
|
|
81
|
-
}] }];
|
|
82
|
-
}, propDecorators: { searchFilter: [{
|
|
83
|
-
type: Input
|
|
84
|
-
}], form: [{
|
|
85
|
-
type: Input
|
|
86
|
-
}] } });
|
|
87
|
-
|
|
88
|
-
class AutocompleteSearchFilterComponent {
|
|
89
|
-
constructor(cdr) {
|
|
90
|
-
this.cdr = cdr;
|
|
91
|
-
this.searchField = new FormControl('');
|
|
92
|
-
this.options$ = of([]);
|
|
93
|
-
this.destroy$ = new Subject();
|
|
94
|
-
this.displayFn = (_selectedValue) => { var _a; return (_a = this.searchFilter.formControl.value) === null || _a === void 0 ? void 0 : _a.label; };
|
|
95
|
-
this.onSelected = (event) => {
|
|
96
|
-
this.searchFilter.formControl.patchValue(event.option.value);
|
|
97
|
-
this.searchField.patchValue(event.option.value.label, { emitEvent: false });
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
ngAfterViewInit() {
|
|
101
|
-
this.searchField
|
|
102
|
-
.valueChanges
|
|
103
|
-
.pipe(takeUntil(this.destroy$), tap(value => this.clearFilterIfLabelMismatch(value)), filter(value => (value === null || value === void 0 ? void 0 : value.length) >= this.searchFilter.minimumCharacters), debounceTime(this.searchFilter.debounceTime))
|
|
104
|
-
.subscribe(searchValue => {
|
|
105
|
-
// call search and retrieve options
|
|
106
|
-
this.options$ = this.searchFilter.search(searchValue);
|
|
107
|
-
// mark for check because of the debounce
|
|
108
|
-
this.cdr.markForCheck();
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
ngOnDestroy() {
|
|
112
|
-
this.destroy$.next();
|
|
113
|
-
this.destroy$.complete();
|
|
114
|
-
}
|
|
115
|
-
clearFilterIfLabelMismatch(value) {
|
|
116
|
-
var _a;
|
|
117
|
-
const label = (_a = this.searchFilter.formControl.value) === null || _a === void 0 ? void 0 : _a.label;
|
|
118
|
-
if (label && label !== value) {
|
|
119
|
-
this.searchFilter.formControl.patchValue(undefined);
|
|
120
|
-
this.searchField.patchValue(null, { emitEvent: false });
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
AutocompleteSearchFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AutocompleteSearchFilterComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
125
|
-
AutocompleteSearchFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", 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 });
|
|
126
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AutocompleteSearchFilterComponent, decorators: [{
|
|
127
|
-
type: Component,
|
|
128
|
-
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>" }]
|
|
129
|
-
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { searchFilter: [{
|
|
130
|
-
type: Input
|
|
131
|
-
}] } });
|
|
132
|
-
|
|
133
|
-
class DateTimeSearchFilterComponent {
|
|
134
|
-
}
|
|
135
|
-
DateTimeSearchFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DateTimeSearchFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
136
|
-
DateTimeSearchFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DateTimeSearchFilterComponent, selector: "entry-date-time-search-filter", inputs: { searchFilter: "searchFilter", form: "form" }, providers: [
|
|
137
|
-
{ provide: MAT_DATE_FORMATS, useFactory: () => inject(ENTRY_MAT_DATE_TIME).matDateFormats },
|
|
138
|
-
{ provide: DateAdapter, useClass: EntryDateTimeAdapter }
|
|
139
|
-
], 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"] }] });
|
|
140
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DateTimeSearchFilterComponent, decorators: [{
|
|
141
|
-
type: Component,
|
|
142
|
-
args: [{ selector: 'entry-date-time-search-filter', providers: [
|
|
143
|
-
{ provide: MAT_DATE_FORMATS, useFactory: () => inject(ENTRY_MAT_DATE_TIME).matDateFormats },
|
|
144
|
-
{ provide: DateAdapter, useClass: EntryDateTimeAdapter }
|
|
145
|
-
], 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>" }]
|
|
146
|
-
}], propDecorators: { searchFilter: [{
|
|
147
|
-
type: Input
|
|
148
|
-
}], form: [{
|
|
149
|
-
type: Input
|
|
150
|
-
}] } });
|
|
151
|
-
|
|
152
|
-
class DateSearchFilterComponent {
|
|
153
|
-
}
|
|
154
|
-
DateSearchFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DateSearchFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
155
|
-
DateSearchFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", 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"] }] });
|
|
156
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DateSearchFilterComponent, decorators: [{
|
|
157
|
-
type: Component,
|
|
158
|
-
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>" }]
|
|
159
|
-
}], propDecorators: { searchFilter: [{
|
|
160
|
-
type: Input
|
|
161
|
-
}], form: [{
|
|
162
|
-
type: Input
|
|
163
|
-
}] } });
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Entry SearchFilter component.
|
|
167
|
-
*/
|
|
168
|
-
class EntrySearchFilterComponent {
|
|
169
|
-
constructor(config) {
|
|
170
|
-
this.config = config;
|
|
171
|
-
/** Configuration of the search filters inputs that will be displayed in the search-filter component. */
|
|
172
|
-
this.searchFilters = [];
|
|
173
|
-
/**
|
|
174
|
-
* Emits the change in SearchFilterParams so the containing component can apply them and retrieve the filtered results.
|
|
175
|
-
*/
|
|
176
|
-
this.searchFilterChange = new EventEmitter();
|
|
177
|
-
this.controlType = ControlType;
|
|
178
|
-
}
|
|
179
|
-
ngOnInit() {
|
|
180
|
-
this.searchFilterForm = this.toFormGroup(this.searchFilters);
|
|
181
|
-
}
|
|
182
|
-
onSubmit() {
|
|
183
|
-
const formValue = this.searchFilterForm.value;
|
|
184
|
-
this.searchFilterChange.emit(formValue);
|
|
185
|
-
}
|
|
186
|
-
toFormGroup(searchFilters) {
|
|
187
|
-
const group = {};
|
|
188
|
-
searchFilters.forEach(searchFilter => {
|
|
189
|
-
const formControl = searchFilter.toFormControl();
|
|
190
|
-
group[searchFilter.key] = formControl;
|
|
191
|
-
searchFilter.formControl = formControl;
|
|
192
|
-
});
|
|
193
|
-
return new UntypedFormGroup(group);
|
|
194
|
-
}
|
|
195
|
-
asTextSearchFilter(searchFilter) {
|
|
196
|
-
return searchFilter;
|
|
197
|
-
}
|
|
198
|
-
asSelectSearchFilter(searchFilter) {
|
|
199
|
-
return searchFilter;
|
|
200
|
-
}
|
|
201
|
-
asAutocompleteSearchFilter(searchFilter) {
|
|
202
|
-
return searchFilter;
|
|
203
|
-
}
|
|
204
|
-
asDateTimeSearchFilter(searchFilter) {
|
|
205
|
-
return searchFilter;
|
|
206
|
-
}
|
|
207
|
-
asDateSearchFilter(searchFilter) {
|
|
208
|
-
return searchFilter;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
EntrySearchFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntrySearchFilterComponent, deps: [{ token: ENTRY_SEARCH_FILTER_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
|
|
212
|
-
EntrySearchFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", 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 });
|
|
213
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntrySearchFilterComponent, decorators: [{
|
|
214
|
-
type: Component,
|
|
215
|
-
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>" }]
|
|
216
|
-
}], ctorParameters: function () {
|
|
217
|
-
return [{ type: EntrySearchFilterConfig, decorators: [{
|
|
218
|
-
type: Inject,
|
|
219
|
-
args: [ENTRY_SEARCH_FILTER_CONFIG]
|
|
220
|
-
}] }];
|
|
221
|
-
}, propDecorators: { searchFilters: [{
|
|
222
|
-
type: Input
|
|
223
|
-
}], searchFilterChange: [{
|
|
224
|
-
type: Output
|
|
225
|
-
}] } });
|
|
226
|
-
|
|
227
|
-
/**
|
|
228
|
-
* Base Entry search filter input component.
|
|
229
|
-
*/
|
|
230
|
-
class SearchFilterBase {
|
|
231
|
-
constructor(options = {}) {
|
|
232
|
-
this.value = options.value;
|
|
233
|
-
this.key = options.key || '';
|
|
234
|
-
this.label = options.label || '';
|
|
235
|
-
this.placeholder = options.placeholder || '';
|
|
236
|
-
this.controlType = options.controlType || ControlType.text;
|
|
237
|
-
this.type = options.type || ControlType.text;
|
|
238
|
-
this.maxLength = options.maxLength || 256;
|
|
239
|
-
}
|
|
240
|
-
setValue(value) {
|
|
241
|
-
this.value = value;
|
|
242
|
-
if (this.formControl) {
|
|
243
|
-
this.formControl.patchValue(value);
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
toFormControl() {
|
|
247
|
-
return new FormControl(this.value);
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* Search filter text input filed configuration.
|
|
253
|
-
*/
|
|
254
|
-
class TextSearchFilter extends SearchFilterBase {
|
|
255
|
-
constructor() {
|
|
256
|
-
super(...arguments);
|
|
257
|
-
this.controlType = ControlType.text;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Search filter select input field configuration. Select options can be provided as fixed list (`options`)
|
|
263
|
-
* or observable (dynamic) list (`options$`).
|
|
264
|
-
*/
|
|
265
|
-
class SelectSearchFilter extends SearchFilterBase {
|
|
266
|
-
constructor(options = {}) {
|
|
267
|
-
super(options);
|
|
268
|
-
this.controlType = ControlType.select;
|
|
269
|
-
/** Fixed list of select filter options (default is empty list) */
|
|
270
|
-
this.options = [];
|
|
271
|
-
/**
|
|
272
|
-
* Enables selection of multiple options (default is true).
|
|
273
|
-
* If it is set to false, 'none selected' option becomes available as a first option.
|
|
274
|
-
* */
|
|
275
|
-
this.multiSelect = true;
|
|
276
|
-
this.options = options.options;
|
|
277
|
-
this.options$ = options.options$;
|
|
278
|
-
this.multiSelect = options.multiSelect;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* Search filter autocomplete field configuration. Options for the autocomplete are provided
|
|
284
|
-
* indirectly via the search function that takes a string and returns an observable array of
|
|
285
|
-
* SelectOption<T>
|
|
286
|
-
*/
|
|
287
|
-
class AutocompleteSearchFilter extends SearchFilterBase {
|
|
288
|
-
constructor(options = {}) {
|
|
289
|
-
var _a, _b;
|
|
290
|
-
super(options);
|
|
291
|
-
this.controlType = ControlType.autocomplete;
|
|
292
|
-
this.search = options.search;
|
|
293
|
-
this.placeholder = options.placeholder;
|
|
294
|
-
this.label = options.label;
|
|
295
|
-
this.debounceTime = (_a = options.debounceTime) !== null && _a !== void 0 ? _a : 300;
|
|
296
|
-
this.minimumCharacters = (_b = options.minimumCharacters) !== null && _b !== void 0 ? _b : 3;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
/** Model used to populate select or autocomplete options. */
|
|
301
|
-
class SelectOption {
|
|
302
|
-
constructor(
|
|
303
|
-
/** Key used as a value for selected option */
|
|
304
|
-
key,
|
|
305
|
-
/** String value used as display label of select option */
|
|
306
|
-
label) {
|
|
307
|
-
this.key = key;
|
|
308
|
-
this.label = label;
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* Search filter date time input filed configuration.
|
|
314
|
-
*/
|
|
315
|
-
class DateTimeSearchFilter extends SearchFilterBase {
|
|
316
|
-
constructor() {
|
|
317
|
-
super(...arguments);
|
|
318
|
-
this.controlType = ControlType.dateTime;
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* Search filter date input filed configuration.
|
|
324
|
-
*/
|
|
325
|
-
class DateSearchFilter extends SearchFilterBase {
|
|
326
|
-
constructor() {
|
|
327
|
-
super(...arguments);
|
|
328
|
-
this.controlType = ControlType.date;
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
class EntrySearchFilterModule {
|
|
333
|
-
}
|
|
334
|
-
EntrySearchFilterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntrySearchFilterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
335
|
-
EntrySearchFilterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: EntrySearchFilterModule, declarations: [EntrySearchFilterComponent,
|
|
336
|
-
TextSearchFilterComponent,
|
|
337
|
-
SelectSearchFilterComponent,
|
|
338
|
-
AutocompleteSearchFilterComponent,
|
|
339
|
-
DateTimeSearchFilterComponent,
|
|
340
|
-
DateSearchFilterComponent], imports: [CommonModule,
|
|
341
|
-
FormsModule,
|
|
342
|
-
ReactiveFormsModule,
|
|
343
|
-
MatInputModule,
|
|
344
|
-
MatButtonModule,
|
|
345
|
-
EntryButtonModule,
|
|
346
|
-
MatSelectModule,
|
|
347
|
-
MatAutocompleteModule,
|
|
348
|
-
MatDatepickerModule,
|
|
349
|
-
MatFormFieldModule], exports: [EntrySearchFilterComponent] });
|
|
350
|
-
EntrySearchFilterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntrySearchFilterModule, imports: [CommonModule,
|
|
351
|
-
FormsModule,
|
|
352
|
-
ReactiveFormsModule,
|
|
353
|
-
MatInputModule,
|
|
354
|
-
MatButtonModule,
|
|
355
|
-
EntryButtonModule,
|
|
356
|
-
MatSelectModule,
|
|
357
|
-
MatAutocompleteModule,
|
|
358
|
-
MatDatepickerModule,
|
|
359
|
-
MatFormFieldModule] });
|
|
360
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EntrySearchFilterModule, decorators: [{
|
|
361
|
-
type: NgModule,
|
|
362
|
-
args: [{
|
|
363
|
-
declarations: [
|
|
364
|
-
EntrySearchFilterComponent,
|
|
365
|
-
TextSearchFilterComponent,
|
|
366
|
-
SelectSearchFilterComponent,
|
|
367
|
-
AutocompleteSearchFilterComponent,
|
|
368
|
-
DateTimeSearchFilterComponent,
|
|
369
|
-
DateSearchFilterComponent
|
|
370
|
-
],
|
|
371
|
-
imports: [
|
|
372
|
-
CommonModule,
|
|
373
|
-
FormsModule,
|
|
374
|
-
ReactiveFormsModule,
|
|
375
|
-
MatInputModule,
|
|
376
|
-
MatButtonModule,
|
|
377
|
-
EntryButtonModule,
|
|
378
|
-
MatSelectModule,
|
|
379
|
-
MatAutocompleteModule,
|
|
380
|
-
MatDatepickerModule,
|
|
381
|
-
MatFormFieldModule
|
|
382
|
-
],
|
|
383
|
-
exports: [
|
|
384
|
-
EntrySearchFilterComponent
|
|
385
|
-
]
|
|
386
|
-
}]
|
|
387
|
-
}] });
|
|
388
|
-
|
|
389
|
-
/**
|
|
390
|
-
* Generated bundle index. Do not edit.
|
|
391
|
-
*/
|
|
392
|
-
|
|
393
|
-
export { AutocompleteSearchFilter, DateSearchFilter, DateTimeSearchFilter, ENTRY_SEARCH_FILTER_CONFIG, EntrySearchFilterComponent, EntrySearchFilterConfig, EntrySearchFilterModule, SearchFilterBase, SelectOption, SelectSearchFilter, TextSearchFilter, provideEntrySearchFilterConfig };
|
|
394
|
-
//# sourceMappingURL=enigmatry-entry-components-search-filter.mjs.map
|