@guajiritos/general-autocomplete 19.0.1 → 19.0.3
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.
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"guajiritos-general-autocomplete.mjs","sources":["../../../projects/guachos-general-autocomplete/src/utils/constants/constants.ts","../../../projects/guachos-general-autocomplete/src/utils/services/utils.service.ts","../../../projects/guachos-general-autocomplete/src/utils/pipes/resolve-property-path.pipe.ts","../../../projects/guachos-general-autocomplete/src/lib/guachos-general-autocomplete.component.ts","../../../projects/guachos-general-autocomplete/src/lib/guachos-general-autocomplete.component.html","../../../projects/guachos-general-autocomplete/src/public-api.ts","../../../projects/guachos-general-autocomplete/src/guajiritos-general-autocomplete.ts"],"sourcesContent":["import { DisplayOption, DisplayOptionItemType } from '@guajiritos/services';\nimport {DisplayOptionItem} from \"@guajiritos/services/lib/interfaces/interfaces\";\n\n\nexport const GENERAL_DISPLAY_OPTIONS: DisplayOption = {\n firthLabel: [\n {\n type: DisplayOptionItemType.PATH,\n path: ['name']\n }\n ],\n applyTranslate: true\n};\n\nexport interface ServiceConfig {\n service: any;\n method: string;\n postBody: any;\n searchProperty: string;\n}\n","import {Injectable} from '@angular/core';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class UtilsService {\n /**\n * Resolves the value of a property in an object by providing a path.\n *\n * @param {any} obj - The object to traverse.\n * @param {string[]} path - An array of strings representing the path to the desired property.\n * @return {any} The value of the property at the given path, or null if the path is invalid.\n */\n public static resolvePropertyByPath(obj: any, path: string[]): any {\n return path.reduce((prev, curr: string) => {\n return prev ? prev[curr] : null;\n }, obj || self);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { DisplayOptionItem, DisplayOptionItemType } from '@guajiritos/services';\n\nimport { UtilsService } from '../services/utils.service';\n\n@Pipe({\n name: 'resolvePropertyPath',\n standalone: true\n})\nexport class ResolvePropertyPath implements PipeTransform {\n /**\n * Transforms the given object based on the provided path and returns the transformed string.\n *\n * @param {any} obj - The object to be transformed.\n * @param {DisplayOptionItem[]} path - The array of display option items used for transformation.\n * @return {string} The transformed string.\n */\n transform(obj: any, path: DisplayOptionItem[]): string {\n let result: string = '';\n\n path?.forEach((item: DisplayOptionItem): void => {\n if (item?.type === DisplayOptionItemType.DIVIDER) {\n result += item?.divider;\n } else {\n if (item?.path) {\n result += UtilsService.resolvePropertyByPath(obj, item.path);\n }\n }\n });\n\n return result;\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component, DestroyRef,\n ElementRef,\n EventEmitter,\n forwardRef,\n Input,\n NgZone,\n Output,\n signal,\n TemplateRef,\n ViewChild,\n WritableSignal\n} from '@angular/core';\nimport {\n AbstractControl,\n ControlValueAccessor,\n NG_VALUE_ACCESSOR,\n ReactiveFormsModule,\n UntypedFormControl, ValidationErrors,\n ValidatorFn,\n Validators\n} from '@angular/forms';\nimport {MatAutocompleteModule, MatAutocompleteTrigger} from '@angular/material/autocomplete';\nimport {MatButtonModule} from '@angular/material/button';\nimport {ThemePalette} from '@angular/material/core';\nimport {\n FloatLabelType,\n MatFormFieldAppearance,\n MatFormFieldModule,\n SubscriptSizing\n} from '@angular/material/form-field';\nimport {MatIconModule} from '@angular/material/icon';\nimport {MatInputModule} from '@angular/material/input';\nimport {MatProgressSpinnerModule} from '@angular/material/progress-spinner';\nimport {TranslateModule, TranslateService} from '@ngx-translate/core';\nimport {debounceTime, distinctUntilChanged, finalize, Observable, Subject} from 'rxjs';\nimport {takeUntilDestroyed} from \"@angular/core/rxjs-interop\";\n\nimport {\n ApiFormData,\n AutocompleteService,\n DisplayOption,\n DisplayOptionItemType,\n I18nPipe,\n RestrictionFilter\n} from '@guajiritos/services';\n\nimport {GENERAL_DISPLAY_OPTIONS, ServiceConfig} from '../utils/constants/constants';\nimport {ResolvePropertyPath} from '../utils/pipes/resolve-property-path.pipe';\nimport {UtilsService} from '../utils/services/utils.service';\n\n@Component({\n selector: 'guajiritos-general-autocomplete',\n templateUrl: './guachos-general-autocomplete.component.html',\n styleUrls: ['./guachos-general-autocomplete.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n CommonModule,\n MatFormFieldModule,\n TranslateModule,\n MatIconModule,\n ReactiveFormsModule,\n MatInputModule,\n MatButtonModule,\n MatProgressSpinnerModule,\n MatAutocompleteModule,\n I18nPipe,\n ResolvePropertyPath\n ],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => GuajiritosGeneralAutocomplete),\n multi: true\n }\n ]\n})\nexport class GuajiritosGeneralAutocomplete implements ControlValueAccessor {\n\n constructor(\n private _autocompleteService: AutocompleteService,\n private _zone: NgZone,\n private _destroyRef: DestroyRef,\n public translateService: TranslateService\n ) {\n }\n\n private wasSelected: boolean = false;\n private firstCall: boolean = true;\n private clearData$: Subject<void>;\n private doFocusSubject$: Subject<void>;\n private selectedElement: any = null;\n private _url: string = null;\n private restrictionsFilters: RestrictionFilter[] = [];\n\n public disabled: WritableSignal<boolean> = signal(false);\n public loading: WritableSignal<boolean> = signal(false);\n public required: WritableSignal<boolean> = signal(false);\n public filteredOptions: WritableSignal<any[]> = signal([]);\n public originalOptions: WritableSignal<any[]> = signal([]);\n public notAllowedOption: WritableSignal<any> = signal(null);\n public component: UntypedFormControl = new UntypedFormControl({value: null, disabled: false});\n\n @ViewChild('inputText', {static: true}) inputText: ElementRef;\n /**\n * Possible values 'never', 'auto' or 'always'\n */\n @Input() floatLabel: FloatLabelType = 'auto';\n @Input() color: ThemePalette = 'accent';\n @Input() appearance: MatFormFieldAppearance = 'outline';\n @Input() subscriptSizing: SubscriptSizing = 'dynamic';\n @Input() bodyRequest: ApiFormData;\n @Input() debounceTimeValue: number = 300;\n @Input() detailsTemplate: TemplateRef<any>;\n @Input() label: string = 'Seleccione';\n @Input() showLabel: boolean = true;\n @Input() placeholder: string = 'Seleccione un elemento';\n @Input() field: string[] = ['name'];\n @Input() filterString: string[] | string = 'filter[$and][name][$like]';\n @Input() displayOptions: DisplayOption = GENERAL_DISPLAY_OPTIONS;\n @Input() withoutPaddingBottom: boolean = true;\n @Input() valueId: boolean = false;\n @Input() showSuffix: boolean = false;\n @Input() requireSelection: boolean = false;\n @Input() order: string;\n @Input() serviceConfig: ServiceConfig;\n @Input() suffixIcon: string = 'search';\n @Input() removeProperties: string[] = [];\n @Input() modifyResultFn: (options: any) => any = () => null;\n\n @Output() SelectElement: EventEmitter<any> = new EventEmitter<any>();\n @Output() clearElement: EventEmitter<any> = new EventEmitter<any>();\n\n @Input() set url(data: string) {\n if (data) {\n this._url = data;\n this.subscribeComponentChanges();\n }\n }\n\n @Input() set clearData(value: Subject<void>) {\n this.clearData$ = value;\n if (this.clearData$) {\n this.clearData$\n .pipe(takeUntilDestroyed(this._destroyRef))\n .subscribe({\n next: (): void => {\n this.component.setValue(null, {emitEvent: false});\n this.selectedElement = null;\n this.SelectElement.emit(null);\n this.filteredOptions.set([]);\n this.propagateChange(null);\n }\n });\n }\n }\n\n @Input() set initialValue(value: any) {\n this.component.setValue(value);\n }\n\n /**\n * Añade o elimina restricciones para la búsqueda\n *\n * @param restrictions - Restricciones para la búsqueda\n */\n @Input() set restrictions(restrictions: RestrictionFilter[]) {\n if (restrictions?.length) {\n this.restrictionsFilters = [...restrictions];\n } else {\n this.restrictionsFilters = [];\n }\n }\n\n /**\n * Añade o elimina la validación de que el campo sea requerido\n *\n * @param required - Define si es requerido o no\n */\n @Input() set isRequired(required: boolean) {\n this.required.set(required);\n if (required) {\n this.component.setValidators([Validators.required, autocompleteValidator]);\n } else {\n this.component.clearValidators();\n this.component.setValidators([autocompleteValidator]);\n }\n\n this.component.updateValueAndValidity();\n }\n\n /**\n * Define si vamos a realizar una búsqueda al elemento estar en el focus de la aplicación\n *\n * @param focusSubject - Observable para la subscripción al evento Focus\n */\n @Input() set doFocus(focusSubject: Subject<void>) {\n this.doFocusSubject$ = focusSubject;\n\n if (this.doFocusSubject$) {\n this.doFocusSubject$\n .pipe(debounceTime(this.debounceTimeValue), takeUntilDestroyed(this._destroyRef))\n .subscribe({\n next: (): void => {\n this._zone.run((): void => {\n setTimeout((): void => {\n this.inputText?.nativeElement?.focus();\n }, 500);\n });\n }\n });\n }\n }\n\n @Input() set notAllowedElements(element: any) {\n if (element) {\n this.notAllowedOption.set(element);\n\n if (this.originalOptions()?.length) {\n this.filteredOptions.set(this.originalOptions()?.filter((option: any): any => JSON.stringify(option) !== JSON.stringify(this.notAllowedOption())));\n }\n }\n }\n\n /**\n * Subscripción a los cambios del input de búsqueda\n */\n private subscribeComponentChanges(): void {\n this.component.valueChanges\n .pipe(debounceTime(this.debounceTimeValue), takeUntilDestroyed(this._destroyRef))\n .subscribe({\n next: (): void => {\n if (!this.firstCall && !this.wasSelected) {\n this.getAutocompleteByTextHandler(this.getAutocompleteSearchText());\n }\n\n this.firstCall = false;\n this.wasSelected = false;\n }\n });\n }\n\n /**\n * Búsqueda de los elementos a mostrar en el componente de auto-completamiento\n *\n * @param text - Texto a buscar\n */\n private getAutocompleteByTextHandler(text?: string): void {\n this.loading.set(true);\n this.propagateChange(null);\n this.selectedElement = null;\n this.SelectElement.emit(null);\n if (!this.serviceConfig) {\n this._autocompleteService\n .getAutocompleteByText(this._url, text, this.filterString, this.restrictionsFilters, this.removeProperties, this.order, this.bodyRequest)\n .then((resp: Observable<any>): void => {\n resp?.pipe(finalize((): void => this.loading.set(false))).subscribe({\n next: (result: any): void => {\n this.originalOptions.set(result?.payload?.data ?? result?.data);\n\n // Modifica los options con una función que se le pase como parámetro\n const modifiedOptions = this.modifyResultFn(this.originalOptions());\n if (modifiedOptions) this.filteredOptions.set(modifiedOptions);\n\n if (this.notAllowedOption()) {\n this.filteredOptions.set(this.originalOptions()?.filter((option: any): any => JSON.stringify(option) !== JSON.stringify(this.notAllowedOption())));\n } else {\n this.filteredOptions.set(this.originalOptions());\n }\n }\n });\n });\n } else {\n let body: any = { ...this.serviceConfig };\n body[this.serviceConfig.searchProperty] = text;\n delete body.service;\n this.serviceConfig.service[this.serviceConfig.method](body)\n .pipe(takeUntilDestroyed(this._destroyRef), debounceTime(this.debounceTimeValue || 300), finalize((): void => this.loading.set(false)))\n .subscribe({\n next: (result: any): void => {\n this.originalOptions.set(result?.payload?.data ?? result?.data);\n\n // Modifica los options con una función que se le pase como parámetro\n const modifiedOptions = this.modifyResultFn(this.originalOptions());\n if (modifiedOptions) this.filteredOptions.set(modifiedOptions);\n\n if (this.notAllowedOption()) {\n this.filteredOptions.set(this.originalOptions()?.filter((option: any): any => JSON.stringify(option) !== JSON.stringify(this.notAllowedOption())));\n } else {\n this.filteredOptions.set(this.originalOptions());\n }\n },\n error: (err: any): void => {\n console.log('aki esta el error =>', err);\n }\n });\n }\n }\n\n /**\n * Define el texto por el que se va a realizar la búsqueda\n *\n * @return {string} Texto de la búsqueda\n */\n private getAutocompleteSearchText(): string {\n let text: string = '';\n\n if (this.component.value) {\n if (typeof this.component.value === 'object') {\n const componentValue = this.component.value?.[this.field?.[0]];\n if (typeof componentValue === 'object') {\n let lang: string = 'es';\n if (this.field?.[1]) {\n lang = this.field?.[1];\n }\n\n text = componentValue?.[lang];\n }\n } else if (typeof this.component.value === 'string') {\n text = this.component.value;\n }\n }\n\n return text;\n }\n\n propagateChange = (_: any): void => {\n };\n\n registerOnChange(fn: (_: any) => void): void {\n this.propagateChange = fn;\n }\n\n registerOnTouched(): void {\n }\n\n /**\n * Recibe el valor del FormControl\n *\n * @param value - Valor entrado por FormControl\n */\n writeValue(value: any): void {\n if (value) {\n this.component.setValue(value, {emitEvent: false});\n\n if (typeof value === 'object' && this.valueId) {\n this.selectedElement = value?.id;\n } else {\n this.selectedElement = value;\n }\n } else {\n this.selectedElement = null;\n }\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled.set(isDisabled);\n\n if (this.disabled()) {\n this.component.disable();\n } else {\n this.component.enable();\n }\n }\n\n /**\n * Función para mostrar los elementos a seleccionar\n *\n * @param value - Valor a mostrar\n */\n public displayFn = (value: any): string => {\n if (value) {\n if (typeof value === 'string') {\n return value;\n }\n\n let displayText: string = '';\n if (!this.displayOptions) {\n this.displayOptions = GENERAL_DISPLAY_OPTIONS;\n }\n\n this.displayOptions?.firthLabel?.forEach((field: any): void => {\n if (field?.type === DisplayOptionItemType.PATH) {\n displayText += UtilsService.resolvePropertyByPath(value, field?.path);\n } else {\n displayText += field?.divider;\n }\n });\n\n return displayText;\n }\n };\n\n /**\n * Acción al limpiar el valor del input\n *\n * @param trigger\n */\n public clear(trigger: MatAutocompleteTrigger): void {\n this.clearElement.emit(this.component.value);\n this.component.setValue(null);\n this.selectedElement = null;\n this.SelectElement.emit(null);\n this.propagateChange(null);\n\n this._zone.run((): void => {\n setTimeout((): void => {\n trigger.openPanel();\n }, 100);\n });\n }\n\n /**\n * Acción en el Focus del elemento\n */\n public onFocus(): void {\n if (!this.selectedElement) {\n this.getAutocompleteByTextHandler(this.getAutocompleteSearchText());\n }\n }\n\n public optionSelected($event: any): void {\n if ($event?.option?.value) {\n this.wasSelected = true;\n this.selectedElement = $event.option.value;\n this.SelectElement.emit($event.option.value);\n\n if (this.valueId) {\n this.propagateChange(typeof $event.option.value === 'object' ? $event.option.value?.id : $event.option.value);\n } else {\n this.propagateChange($event.option.value);\n }\n } else {\n this.propagateChange($event.option.value);\n }\n }\n}\n\n/**\n * Validación customizada para la selección de elementos\n */\nexport function autocompleteValidator(control: AbstractControl): ValidationErrors | null {\n if (control?.value?.constructor !== Object || !control?.value?.id) {\n return {invalidSelection: true};\n }\n return null;\n}\n","<mat-form-field [floatLabel]=\"floatLabel\" class=\"w-100\" [appearance]=\"appearance\" [color]=\"color\"\n [subscriptSizing]=\"subscriptSizing\">\n\n @if (showLabel) {\n <mat-label>{{ label | translate }}</mat-label>\n }\n @if (showSuffix) {\n <mat-icon matSuffix>{{ suffixIcon ?? \"search\" }}</mat-icon>\n }\n <input #inputText #trigger=\"matAutocompleteTrigger\" (focus)=\"onFocus()\" [formControl]=\"component\" type=\"text\"\n [matAutocomplete]=\"autocomplete\" [placeholder]=\"placeholder | translate\" aria-label=\"autocomplete\"\n autocomplete=\"off\" matInput [required]=\"required()\">\n @if (!loading() && component.value) {\n <button (click)=\"clear(trigger)\" [disabled]=\"disabled()\"\n aria-label=\"Clear\" mat-icon-button matSuffix>\n <mat-icon>close</mat-icon>\n </button>\n }\n @if (loading()) {\n <button aria-label=\"search\" mat-icon-button matSuffix>\n <mat-spinner [value]=\"90\" color=\"accent\" diameter=\"25\"></mat-spinner>\n </button>\n }\n <mat-autocomplete #autocomplete=\"matAutocomplete\" [displayWith]=\"displayFn\" [requireSelection]=\"requireSelection\"\n (optionSelected)=\"optionSelected($event)\">\n @for (option of filteredOptions(); track option) {\n <mat-option [value]=\"option\">\n @if (!displayOptions && !detailsTemplate) {\n {{ option?.name | i18n: translateService.currentLang }}\n }\n @if (!detailsTemplate) {\n <div class=\"display-options\">\n <span [ngStyle]=\"{'line-height': displayOptions?.secondLabel ? '16px' : ''}\">\n {{ option | resolvePropertyPath:displayOptions.firthLabel | i18n: translateService.currentLang }}\n </span>\n @if (displayOptions?.secondLabel) {\n <span class=\"mat-caption\">\n {{ option | resolvePropertyPath: displayOptions.secondLabel | i18n: translateService.currentLang }}\n </span>\n }\n </div>\n }\n @if (detailsTemplate) {\n <ng-container *ngTemplateOutlet=\"detailsTemplate;context:{$implicit: option }\"></ng-container>\n }\n </mat-option>\n }\n </mat-autocomplete>\n\n @if (component.invalid) {\n <mat-error>\n {{ 'Este campo es requerido.' | translate }}\n </mat-error>\n }\n</mat-form-field>\n","/*\n * Public API Surface of guachos-general-autocomplete\n */\n\nexport * from './utils/constants/constants';\nexport * from './lib/guachos-general-autocomplete.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAIa,MAAA,uBAAuB,GAAkB;AAClD,IAAA,UAAU,EAAE;AACR,QAAA;YACI,IAAI,EAAE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BACQ,aAAa,EAAA,CAAA;sBAArB;gBACQ,UAAU,EAAA,CAAA;sBAAlB;gBACQ,gBAAgB,EAAA,CAAA;sBAAxB;gBACQ,cAAc,EAAA,CAAA;sBAAtB;gBAES,aAAa,EAAA,CAAA;sBAAtB;gBACS,YAAY,EAAA,CAAA;sBAArB;gBAEY,GAAG,EAAA,CAAA;sBAAf;gBAOY,SAAS,EAAA,CAAA;sBAArB;gBAiBY,YAAY,EAAA,CAAA;sBAAxB;gBASY,YAAY,EAAA,CAAA;sBAAxB;gBAaY,UAAU,EAAA,CAAA;sBAAtB;gBAiBY,OAAO,EAAA,CAAA;sBAAnB;gBAkBY,kBAAkB,EAAA,CAAA;sBAA9B;;AAgOH;;AAEG;AACG,SAAU,qBAAqB,CAAC,OAAwB,EAAA;AAC1D,IAAA,IAAI,OAAO,EAAE,KAAK,EAAE,WAAW,KAAK,MAAM,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE;AACjE,QAAA,OAAO,EAAC,gBAAgB,EAAE,IAAI,EAAC;;AAEjC,IAAA,OAAO,IAAI;AACf;;AEhcA;;AAEG;;ACFH;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"guajiritos-general-autocomplete.mjs","sources":["../../../projects/guachos-general-autocomplete/src/utils/constants/constants.ts","../../../projects/guachos-general-autocomplete/src/utils/services/utils.service.ts","../../../projects/guachos-general-autocomplete/src/utils/pipes/resolve-property-path.pipe.ts","../../../projects/guachos-general-autocomplete/src/lib/guachos-general-autocomplete.component.ts","../../../projects/guachos-general-autocomplete/src/lib/guachos-general-autocomplete.component.html","../../../projects/guachos-general-autocomplete/src/public-api.ts","../../../projects/guachos-general-autocomplete/src/guajiritos-general-autocomplete.ts"],"sourcesContent":["import { DisplayOption, DisplayOptionItemType } from '@guajiritos/services';\nimport {DisplayOptionItem} from \"@guajiritos/services/lib/interfaces/interfaces\";\n\n\nexport const GENERAL_DISPLAY_OPTIONS: DisplayOption = {\n firthLabel: [\n {\n type: DisplayOptionItemType.PATH,\n path: ['name']\n }\n ],\n applyTranslate: true\n};\n\nexport interface ServiceConfig {\n service: any;\n method: string;\n postBody: any;\n searchProperty: string;\n}\n","import {Injectable} from '@angular/core';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class UtilsService {\n /**\n * Resolves the value of a property in an object by providing a path.\n *\n * @param {any} obj - The object to traverse.\n * @param {string[]} path - An array of strings representing the path to the desired property.\n * @return {any} The value of the property at the given path, or null if the path is invalid.\n */\n public static resolvePropertyByPath(obj: any, path: string[]): any {\n return path.reduce((prev, curr: string) => {\n return prev ? prev[curr] : null;\n }, obj || self);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { DisplayOptionItem, DisplayOptionItemType } from '@guajiritos/services';\n\nimport { UtilsService } from '../services/utils.service';\n\n@Pipe({\n name: 'resolvePropertyPath',\n standalone: true\n})\nexport class ResolvePropertyPath implements PipeTransform {\n /**\n * Transforms the given object based on the provided path and returns the transformed string.\n *\n * @param {any} obj - The object to be transformed.\n * @param {DisplayOptionItem[]} path - The array of display option items used for transformation.\n * @return {string} The transformed string.\n */\n transform(obj: any, path: DisplayOptionItem[]): string {\n let result: string = '';\n\n path?.forEach((item: DisplayOptionItem): void => {\n if (item?.type === DisplayOptionItemType.DIVIDER) {\n result += item?.divider;\n } else {\n if (item?.path) {\n result += UtilsService.resolvePropertyByPath(obj, item.path);\n }\n }\n });\n\n return result;\n }\n}\n","import { CommonModule } from \"@angular/common\";\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n EventEmitter,\n forwardRef,\n Input,\n NgZone,\n Output,\n signal,\n TemplateRef,\n ViewChild,\n WritableSignal,\n} from \"@angular/core\";\nimport {\n AbstractControl,\n ControlValueAccessor,\n NG_VALUE_ACCESSOR,\n ReactiveFormsModule,\n UntypedFormControl,\n ValidationErrors,\n ValidatorFn,\n Validators,\n} from \"@angular/forms\";\nimport {\n MatAutocomplete,\n MatAutocompleteModule,\n MatAutocompleteTrigger,\n} from \"@angular/material/autocomplete\";\nimport { MatButtonModule } from \"@angular/material/button\";\nimport { ThemePalette } from \"@angular/material/core\";\nimport {\n FloatLabelType,\n MatFormFieldAppearance,\n MatFormFieldModule,\n SubscriptSizing,\n} from \"@angular/material/form-field\";\nimport { MatIconModule } from \"@angular/material/icon\";\nimport { MatInputModule } from \"@angular/material/input\";\nimport { MatProgressSpinnerModule } from \"@angular/material/progress-spinner\";\nimport { TranslateModule, TranslateService } from \"@ngx-translate/core\";\nimport {\n debounceTime,\n finalize,\n Observable,\n Subject,\n from,\n switchMap,\n tap,\n} from \"rxjs\";\nimport { takeUntilDestroyed } from \"@angular/core/rxjs-interop\";\n\nimport {\n ApiFormData,\n AutocompleteService,\n DisplayOption,\n DisplayOptionItemType,\n I18nPipe,\n RestrictionFilter,\n} from \"@guajiritos/services\";\n\nimport {\n GENERAL_DISPLAY_OPTIONS,\n ServiceConfig,\n} from \"../utils/constants/constants\";\nimport { ResolvePropertyPath } from \"../utils/pipes/resolve-property-path.pipe\";\nimport { UtilsService } from \"../utils/services/utils.service\";\n\n@Component({\n selector: \"guajiritos-general-autocomplete\",\n templateUrl: \"./guachos-general-autocomplete.component.html\",\n styleUrls: [\"./guachos-general-autocomplete.component.scss\"],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [\n CommonModule,\n MatFormFieldModule,\n TranslateModule,\n MatIconModule,\n ReactiveFormsModule,\n MatInputModule,\n MatButtonModule,\n MatProgressSpinnerModule,\n MatAutocompleteModule,\n I18nPipe,\n ResolvePropertyPath,\n ],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => GuajiritosGeneralAutocomplete),\n multi: true,\n },\n ],\n})\nexport class GuajiritosGeneralAutocomplete\n implements ControlValueAccessor, AfterViewInit\n{\n constructor(\n private _autocompleteService: AutocompleteService,\n private _zone: NgZone,\n private _destroyRef: DestroyRef,\n public translateService: TranslateService,\n ) {}\n\n // --- Private Properties ---\n // Indica si la última actualización del input fue por una selección explícita desde el autocomplete\n private _isOptionSelected: boolean = false;\n private _clearDataSubject: Subject<void> = new Subject<void>();\n private _doFocusSubject: Subject<void> = new Subject<void>();\n private _selectedElement: any = null; // Almacena el objeto completo seleccionado\n private _url: string | null = null;\n private _limit: number = 20;\n private _offset: number = 0;\n private _restrictionsFilters: RestrictionFilter[] = [];\n private _lastSearchText: string = \"\"; // Almacena el texto usado en la última búsqueda de API\n\n // --- Public Signals ---\n public disabled: WritableSignal<boolean> = signal(false);\n public loading: WritableSignal<boolean> = signal(false);\n public required: WritableSignal<boolean> = signal(false);\n public filteredOptions: WritableSignal<any[]> = signal([]);\n public originalOptions: WritableSignal<any[]> = signal([]);\n public notAllowedOption: WritableSignal<any> = signal(null);\n public component: UntypedFormControl = new UntypedFormControl({\n value: null,\n disabled: false,\n });\n public hasMore: WritableSignal<boolean> = signal(true); // Indica si hay más datos para cargar\n\n // --- ViewChildren ---\n @ViewChild(\"inputText\", { static: true }) inputText!: ElementRef;\n @ViewChild(\"auto\") matAutocomplete!: MatAutocomplete;\n @ViewChild(MatAutocompleteTrigger)\n autocompleteTrigger!: MatAutocompleteTrigger;\n // --- Inputs ---\n @Input() floatLabel: FloatLabelType = \"auto\";\n @Input() color: ThemePalette = \"accent\";\n @Input() appearance: MatFormFieldAppearance = \"outline\";\n @Input() subscriptSizing: SubscriptSizing = \"dynamic\";\n @Input() bodyRequest?: ApiFormData;\n @Input() debounceTimeValue: number = 300;\n @Input() detailsTemplate?: TemplateRef<any>;\n @Input() label: string = \"Seleccione\";\n @Input() showLabel: boolean = true;\n @Input() placeholder: string = \"Seleccione un elemento\";\n @Input() field: string[] = [\"name\"];\n @Input() filterString: string[] | string = \"filter[$and][name][$like]\";\n @Input() displayOptions: DisplayOption = GENERAL_DISPLAY_OPTIONS;\n @Input() withoutPaddingBottom: boolean = true;\n @Input() valueId: boolean = false;\n @Input() showSuffix: boolean = false;\n @Input() requireSelection: boolean = false;\n @Input() order?: string;\n @Input() serviceConfig?: ServiceConfig;\n @Input() suffixIcon: string = \"search\";\n @Input() removeProperties: string[] = [];\n @Input() modifyResultFn: (options: any[]) => any[] = (options: any[]) =>\n options;\n\n // --- Outputs ---\n @Output() selectElement: EventEmitter<any> = new EventEmitter<any>();\n @Output() clearElement: EventEmitter<any> = new EventEmitter<any>();\n\n // --- Setters for Inputs ---\n @Input() set url(data: string) {\n if (data) {\n this._url = data;\n // Suscribirse a los cambios del componente una vez que la URL está disponible\n this.subscribeToComponentChanges();\n }\n }\n\n @Input() set limit(value: number) {\n if (value && !isNaN(value)) {\n this._limit = value;\n }\n }\n\n @Input() set clearData(value: Subject<void>) {\n this._clearDataSubject = value;\n this._clearDataSubject\n .pipe(takeUntilDestroyed(this._destroyRef))\n .subscribe({\n next: (): void => {\n this.resetAutocompleteState();\n this.component.setValue(null, { emitEvent: false }); // No emitir para evitar ciclo de valueChanges\n this.propagateChange(null);\n this.selectElement.emit(null);\n },\n });\n }\n\n @Input() set initialValue(value: any) {\n // Si el valor inicial es el mismo que el valor actual del control, no hacer nada para evitar bucles\n if (value === this.component.value) {\n return;\n }\n\n this._selectedElement = value;\n this._isOptionSelected = !!value; // Marcar como seleccionado si hay un valor inicial\n\n // Establecer el valor en el formControl sin emitir el evento\n // para evitar que subscribeToComponentChanges reaccione a esta carga inicial.\n this.component.setValue(value, { emitEvent: false });\n\n // Actualizar _lastSearchText basado en el valor inicial\n if (value) {\n this._lastSearchText = this.displayFn(value);\n console.log(\"initialValue set: _lastSearchText =\", this._lastSearchText);\n } else {\n this._lastSearchText = \"\";\n }\n }\n\n /**\n * Adds or removes search restrictions\n */\n @Input() set restrictions(restrictions: RestrictionFilter[]) {\n this._restrictionsFilters = restrictions?.length ? [...restrictions] : [];\n this.resetAutocompleteState();\n // Re-ejecutar búsqueda si el input tiene texto y hay restricciones\n const currentSearchText = this.getAutocompleteSearchText();\n if (currentSearchText) {\n this.getAutocompleteByTextHandler(currentSearchText);\n }\n }\n\n /**\n * Adds or removes required validation\n */\n @Input() set isRequired(required: boolean) {\n this.required.set(required);\n const validators: ValidatorFn[] = [autocompleteValidator];\n if (required) {\n validators.push(Validators.required);\n }\n this.component.setValidators(validators);\n this.component.updateValueAndValidity();\n }\n\n /**\n * Defines whether to perform a search when the element is in focus\n */\n @Input() set doFocus(focusSubject: Subject<void>) {\n this._doFocusSubject = focusSubject;\n this._doFocusSubject\n .pipe(\n debounceTime(this.debounceTimeValue), // Retrasar para evitar llamadas excesivas\n takeUntilDestroyed(this._destroyRef),\n )\n .subscribe({\n next: (): void => {\n this._zone.run((): void => {\n setTimeout((): void => {\n this.inputText?.nativeElement?.focus();\n // Forzar la apertura del panel y una posible carga si es necesario\n // Simular input para disparar valueChanges, lo que a menudo abre el panel si el texto cambia\n (\n this.inputText?.nativeElement as HTMLInputElement\n )?.dispatchEvent(new Event(\"input\"));\n // Abrir explícitamente el panel usando el MatAutocompleteTrigger\n this.autocompleteTrigger?.openPanel(); // <--- EL CAMBIO ES AQUÍ\n }, 50); // Un pequeño retraso para asegurar el foco y la apertura\n });\n },\n });\n }\n\n @Input() set notAllowedElements(element: any) {\n if (element) {\n this.notAllowedOption.set(element);\n this.filterOptionsBasedOnNotAllowed();\n }\n }\n\n /**\n * Resets the autocomplete pagination and options state.\n * Centralizes the logic to avoid duplication.\n */\n private resetAutocompleteState(): void {\n this._offset = 0;\n this.originalOptions.set([]);\n this.filteredOptions.set([]);\n this.hasMore.set(true);\n // IMPORTANTE: _selectedElement NO se resetea aquí, solo si se borra explícitamente\n // _lastSearchText se actualiza en writeValue y optionSelected\n console.log(\"Autocomplete state reset (pagination/options).\");\n }\n\n /**\n * Subscription to search input changes\n */\n private subscribeToComponentChanges(): void {\n this.component.valueChanges\n .pipe(\n // Utiliza tap para observar el valor antes del debounce y el switchMap\n tap((value) => {\n // Si el cambio viene de una selección programática (e.g., this.component.setValue(obj))\n // O de una selección del usuario en el autocomplete, marcamos que no necesitamos buscar.\n if (\n typeof value === \"object\" &&\n value !== null &&\n this._isOptionSelected\n ) {\n console.log(\n \"Value change detected: Object selected, skipping search.\",\n );\n // Resetear la bandera después de procesar\n this._isOptionSelected = false;\n return; // Salir del tap, el debounce/switchMap no se ejecutará para este valor.\n }\n }),\n debounceTime(this.debounceTimeValue),\n takeUntilDestroyed(this._destroyRef),\n )\n .subscribe({\n next: (value: any): void => {\n const currentSearchText = this.getAutocompleteSearchText();\n\n // Si el valor actual es un objeto (ya seleccionado), no necesitamos buscar\n // A menos que el texto en el input haya sido modificado por el usuario\n if (typeof value === \"object\" && value !== null) {\n const displayText = this.displayFn(value);\n if (\n currentSearchText === displayText &&\n this._selectedElement === value\n ) {\n console.log(\n \"Value is selected object and matches display text, skipping search.\",\n );\n return;\n }\n }\n\n // Si el valor del input es un string (el usuario está escribiendo o borró)\n // Y el texto actual es diferente al último texto buscado\n // O si el texto está vacío (para cargar las opciones iniciales si se borra)\n if (\n (typeof value === \"string\" &&\n currentSearchText !== this._lastSearchText) ||\n (currentSearchText === \"\" && this._lastSearchText !== \"\") // Para cuando el usuario borra todo\n ) {\n this.resetAutocompleteState(); // Reiniciar paginación y opciones\n this._lastSearchText = currentSearchText; // Actualizar el último texto buscado\n console.log(\n \"Value changed, initiating new search for:\",\n currentSearchText,\n );\n this.getAutocompleteByTextHandler(currentSearchText);\n } else if (currentSearchText === \"\" && this._lastSearchText === \"\") {\n // Si el input está vacío y ya lo estaba, y el componente no tiene valor seleccionado,\n // podría ser un buen momento para recargar las opciones iniciales si el panel está abierto\n if (\n this.matAutocomplete._isOpen &&\n this.originalOptions().length === 0 &&\n !this.loading()\n ) {\n console.log(\n \"Input empty, no options, panel open. Loading initial set.\",\n );\n this.getAutocompleteByTextHandler(\"\");\n }\n }\n },\n });\n }\n\n ngAfterViewInit(): void {\n // Suscribirse a la apertura del panel para añadir el listener de scroll\n this.matAutocomplete.opened\n .pipe(takeUntilDestroyed(this._destroyRef))\n .subscribe(() => {\n if (this.matAutocomplete?.panel) {\n // Asegurarse de que el listener sea removido antes de añadirlo para prevenir duplicados\n this.matAutocomplete.panel.nativeElement.removeEventListener(\n \"scroll\",\n this.onScroll.bind(this),\n );\n this.matAutocomplete.panel.nativeElement.addEventListener(\n \"scroll\",\n this.onScroll.bind(this),\n );\n\n // Si el panel se abre y no hay opciones cargadas, o si el input está vacío\n // y no hay una selección activa, cargar las opciones iniciales.\n const currentSearchText = this.getAutocompleteSearchText();\n if (\n this.originalOptions().length === 0 ||\n (!this._selectedElement && currentSearchText === \"\")\n ) {\n console.log(\"Panel opened, loading initial set of options.\");\n this.getAutocompleteByTextHandler(currentSearchText);\n }\n }\n });\n\n // Suscribirse al cierre del panel para remover el listener de scroll y manejar la deselección\n this.matAutocomplete.closed\n .pipe(takeUntilDestroyed(this._destroyRef))\n .subscribe(() => {\n if (this.matAutocomplete?.panel) {\n this.matAutocomplete.panel.nativeElement.removeEventListener(\n \"scroll\",\n this.onScroll.bind(this),\n );\n }\n\n const currentInputValue = this.component.value;\n const currentInputText = this.getAutocompleteSearchText();\n\n console.log(\n \"Autocomplete closed. Current Input Value:\",\n currentInputValue,\n \"Selected Element:\",\n this._selectedElement,\n \"Current Input Text:\",\n currentInputText,\n );\n\n // Lógica para manejar el borrado del input si no hay una selección válida\n // o si el texto no coincide con el elemento seleccionado.\n if (typeof currentInputValue === \"string\") {\n // Si el valor del input es un string (el usuario está escribiendo o ha modificado)\n if (this.requireSelection) {\n // Si se requiere selección y el texto no coincide con un elemento seleccionado,\n // o no hay ningún elemento seleccionado, entonces se borra.\n if (\n !this._selectedElement ||\n currentInputText !== this.displayFn(this._selectedElement)\n ) {\n console.warn(\n \"Autocomplete closed: Input cleared because selection is required and no valid match found.\",\n );\n this.clearInternalState(); // Usa un método para limpiar\n }\n } else {\n // Si NO se requiere selección, pero el usuario ha editado el texto de un elemento previamente seleccionado.\n // En este caso, NO borramos, sino que revertimos al texto del elemento seleccionado si existe.\n if (\n this._selectedElement &&\n currentInputText !== this.displayFn(this._selectedElement)\n ) {\n console.log(\n \"Autocomplete closed: Text edited for a selected item, reverting to original.\",\n );\n // Revertir al texto del elemento seleccionado.\n this.component.setValue(this._selectedElement, {\n emitEvent: false,\n });\n this._lastSearchText = this.displayFn(this._selectedElement);\n this.propagateChange(this._selectedElement); // Propagar el valor original si se revierte\n } else if (currentInputText === \"\" && this._selectedElement) {\n // Si el input está vacío pero había un elemento seleccionado, deseleccionar\n console.log(\n \"Autocomplete closed: Input cleared by user, deselecting element.\",\n );\n this.clearInternalState();\n } else if (currentInputText === \"\" && !this._selectedElement) {\n // Si el input está vacío y no había selección, simplemente asegúrate de que el estado interno refleje esto.\n console.log(\"Autocomplete closed: Input empty, no selection.\");\n this.clearInternalState(); // Asegura el estado\n }\n // Si el texto del input es un string y no se requiere selección,\n // y no hay _selectedElement, asumimos que el usuario quiere el texto libre.\n // No hacemos nada, el texto permanece.\n if (\n typeof currentInputValue === \"string\" &&\n !this.requireSelection &&\n !this._selectedElement\n ) {\n // Si no hay un elemento seleccionado pero el usuario escribió algo\n // y no se requiere selección, dejamos el texto tal cual.\n // Aseguramos que _lastSearchText se actualice para evitar re-búsquedas innecesarias.\n this._lastSearchText = currentInputText;\n this.propagateChange(currentInputText);\n }\n }\n }\n // Si el valor ya es un objeto (porque se seleccionó), no hacemos nada aquí\n // a menos que el usuario haya borrado manualmente el texto del input.\n // Esa última parte se cubre con la condición currentInputText === \"\"\n });\n }\n\n /**\n * Helper method to clear the internal state of the autocomplete.\n */\n private clearInternalState(): void {\n this.component.setValue(null, { emitEvent: false }); // Evitar bucle con valueChanges\n this.propagateChange(null);\n this.selectElement.emit(null);\n this._selectedElement = null;\n this._lastSearchText = \"\";\n this.resetAutocompleteState(); // Resetear opciones y paginación\n console.log(\"Internal autocomplete state cleared.\");\n }\n\n /**\n * Searches for elements to display in the autocomplete component.\n * Now supports pagination.\n * @param text - Text to search\n */\n private getAutocompleteByTextHandler(text?: string): void {\n // Si no hay más datos Y ya cargamos algo (offset > 0) Y el texto de búsqueda no ha cambiado,\n // y no estamos actualmente cargando, salir.\n if (\n !this.hasMore() &&\n this._offset > 0 &&\n text === this._lastSearchText && // Verificar que el texto de búsqueda actual sea el mismo\n !this.loading()\n ) {\n console.log(\n \"No more data for current search text, stopping further loads.\",\n );\n return;\n }\n\n if (this.loading()) {\n console.log(\"Already loading, exiting getAutocompleteByTextHandler.\");\n return;\n }\n\n this.loading.set(true);\n\n const currentOffset = this._offset; // Capturar el offset actual antes de la llamada\n const currentSearchTextForApi = text; // Usar el texto pasado, no el global _lastSearchText\n\n if (!this._url && !this.serviceConfig) {\n console.warn(\"Autocomplete: 'url' or 'serviceConfig' input is required.\");\n this.loading.set(false);\n this.hasMore.set(false);\n return;\n }\n\n let apiCall: Observable<any>;\n\n if (this._url) {\n apiCall = from(\n this._autocompleteService.getAutocompleteByText(\n this._url,\n currentSearchTextForApi, // Usar el texto de búsqueda actual\n this.filterString,\n this._restrictionsFilters,\n this.removeProperties,\n this.order,\n this.bodyRequest,\n { limit: this._limit, offset: currentOffset },\n ),\n ).pipe(switchMap((innerObservable) => innerObservable));\n } else if (this.serviceConfig) {\n let body: any = { ...this.serviceConfig };\n body[this.serviceConfig.searchProperty] = currentSearchTextForApi; // Usar el texto de búsqueda actual\n body[\"limit\"] = this._limit;\n body[\"offset\"] = currentOffset;\n apiCall = this.serviceConfig.service[this.serviceConfig.method](body);\n } else {\n this.loading.set(false);\n this.hasMore.set(false);\n return;\n }\n\n // Guardar la posición de scroll antes de la actualización\n let panelScrollTop = 0;\n if (this.matAutocomplete?.panel) {\n panelScrollTop = this.matAutocomplete.panel.nativeElement.scrollTop;\n }\n\n apiCall\n .pipe(\n finalize((): void => {\n this.loading.set(false);\n }),\n takeUntilDestroyed(this._destroyRef),\n )\n .subscribe({\n next: (result: any): void => {\n const newData = result?.payload?.data ?? result?.data ?? [];\n console.log(\n \"New Data received:\",\n newData.length,\n \"items. Current offset before update:\",\n this._offset,\n );\n\n this._offset += newData.length; // Actualizar offset con la cantidad de nuevos ítems\n\n if (newData.length < this._limit) {\n this.hasMore.set(false);\n console.log(\"No more data, hasMore = false\");\n } else {\n this.hasMore.set(true);\n console.log(\"Potentially more data, hasMore = true\");\n }\n\n // Actualizar las opciones originales\n this.originalOptions.update((currentOptions) => {\n const updatedOptions = [...currentOptions, ...newData];\n console.log(\"Total options after merge:\", updatedOptions.length);\n return updatedOptions;\n });\n this.filterOptionsBasedOnNotAllowed();\n\n // Restaurar la posición de scroll después de que Angular haya actualizado el DOM\n // Esto debe hacerse fuera de la zona de Angular o con un pequeño retardo.\n if (this.matAutocomplete?.panel && panelScrollTop > 0) {\n this._zone.runOutsideAngular(() => {\n setTimeout(() => {\n this.matAutocomplete.panel.nativeElement.scrollTop =\n panelScrollTop;\n console.log(\"Scroll position restored to:\", panelScrollTop);\n }, 0); // Un pequeño retardo para asegurar que el DOM se haya renderizado\n });\n }\n },\n error: (error) => {\n console.error(\"Error fetching autocomplete data:\", error);\n this.loading.set(false);\n this.hasMore.set(false);\n },\n });\n }\n\n private filterOptionsBasedOnNotAllowed(): void {\n let currentOptions = this.originalOptions();\n const modifiedOptions = this.modifyResultFn(currentOptions);\n if (modifiedOptions !== null && modifiedOptions !== undefined) {\n currentOptions = modifiedOptions;\n }\n\n if (this.notAllowedOption()) {\n this.filteredOptions.set(\n currentOptions.filter(\n (option: any): boolean =>\n JSON.stringify(option) !== JSON.stringify(this.notAllowedOption()),\n ),\n );\n } else {\n this.filteredOptions.set(currentOptions);\n }\n }\n\n /**\n * Defines the text to be used for the search\n */\n private getAutocompleteSearchText(): string {\n const value = this.component.value;\n if (typeof value === \"object\" && value !== null) {\n // Si el valor es un objeto, usa displayFn para obtener el texto\n return this.displayFn(value);\n } else if (typeof value === \"string\") {\n return value;\n }\n return \"\";\n }\n\n // --- ControlValueAccessor methods ---\n propagateChange = (_: any): void => {};\n\n registerOnChange(fn: (_: any) => void): void {\n this.propagateChange = fn;\n }\n\n registerOnTouched(): void {}\n\n /**\n * Recibe el valor desde el FormControl externo.\n */\n writeValue(value: any): void {\n // Establecer la bandera para indicar que el cambio viene de un setValue programático\n this._isOptionSelected = typeof value === \"object\" && value !== null;\n this.component.setValue(value, { emitEvent: false }); // No emitir evento para evitar bucles.\n\n this._selectedElement = value\n ? this.valueId && typeof value === \"object\"\n ? value?.id\n : value\n : null;\n\n // Actualizar _lastSearchText basado en el valor que se está escribiendo.\n if (value) {\n this._lastSearchText = this.displayFn(value);\n console.log(\"writeValue: Last search text set to:\", this._lastSearchText);\n } else {\n this._lastSearchText = \"\";\n console.log(\"writeValue: Last search text cleared.\");\n }\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled.set(isDisabled);\n if (isDisabled) {\n this.component.disable();\n } else {\n this.component.enable();\n }\n }\n\n /**\n * Function to display selected elements\n */\n public displayFn = (value: any): string => {\n if (!value) {\n return \"\";\n }\n // Si el valor ya es una cadena, devuélvelo directamente\n if (typeof value === \"string\") {\n return value;\n }\n\n let displayText: string = \"\";\n const options = this.displayOptions || GENERAL_DISPLAY_OPTIONS;\n\n options?.firthLabel?.forEach((field: any): void => {\n if (field?.type === DisplayOptionItemType.PATH) {\n displayText +=\n UtilsService.resolvePropertyByPath(value, field?.path) || \"\";\n } else {\n displayText += field?.divider || \"\";\n }\n });\n\n return displayText;\n };\n\n /**\n * Action on clearing the input value\n */\n public clear(trigger: MatAutocompleteTrigger): void {\n this.clearElement.emit(this.component.value);\n this.clearInternalState(); // Usa el método auxiliar para limpiar\n // this.component.setValue(null); // Ya se llama dentro de clearInternalState\n // this.propagateChange(null);\n // this.selectElement.emit(null);\n // this._selectedElement = null;\n // this._lastSearchText = \"\";\n\n this._zone.run((): void => {\n setTimeout((): void => {\n trigger.openPanel(); // Reabrir el panel después de borrar\n this.getAutocompleteByTextHandler(\"\"); // Cargar opciones iniciales (o todas) después de borrar\n }, 100);\n });\n }\n\n /**\n * Action on element Focus\n */\n public onFocus(): void {\n const currentSearchText = this.getAutocompleteSearchText();\n // Si no hay opciones cargadas O el input está vacío y no hay un elemento seleccionado\n if (\n this.originalOptions().length === 0 ||\n (currentSearchText === \"\" && !this._selectedElement)\n ) {\n this.resetAutocompleteState(); // Reiniciar estado antes de una nueva búsqueda\n this._lastSearchText = currentSearchText;\n console.log(\"On focus, initiating search for:\", currentSearchText);\n this.getAutocompleteByTextHandler(currentSearchText);\n } else if (\n this.matAutocomplete._isOpen &&\n currentSearchText === this._lastSearchText\n ) {\n // Si el panel ya está abierto y el texto no ha cambiado, no hacer nada para evitar re-cargas innecesarias.\n // Si el panel no estaba abierto, la apertura de `matAutocomplete.opened` se encargará de la carga.\n console.log(\n \"On focus, panel already open with same text, skipping search.\",\n );\n }\n }\n\n public optionSelected($event: any): void {\n const selectedValue = $event?.option?.value;\n if (selectedValue) {\n this._isOptionSelected = true; // Establecer la bandera de selección\n this._selectedElement = selectedValue;\n this.selectElement.emit(selectedValue);\n\n if (this.valueId && typeof selectedValue === \"object\") {\n this.propagateChange(selectedValue?.id);\n } else {\n this.propagateChange(selectedValue);\n }\n // Cuando un ítem es seleccionado, actualizar _lastSearchText con su valor de display.\n // Esto es crucial para que el valueChanges no vuelva a disparar una búsqueda para este valor.\n this._lastSearchText = this.displayFn(selectedValue);\n console.log(\n \"Option selected. Last search text set to:\",\n this._lastSearchText,\n );\n } else {\n // Si se deselecciona o selecciona nulo\n // Esto rara vez debería ocurrir si se selecciona una opción válida, pero es un fallback.\n console.log(\"Option selected is null or undefined, clearing state.\");\n this.clearInternalState();\n }\n // Después de la selección, el panel se cierra automáticamente en la mayoría de los casos de MatAutocomplete.\n // this.matAutocomplete.closePanel(); // Descomentar si el panel no se cierra automáticamente\n }\n\n /**\n * Handles the scroll event in the autocomplete panel to load more data.\n */\n onScroll(event: Event): void {\n const element = event.target as HTMLElement;\n const scrollPosition = element.scrollTop + element.clientHeight;\n const scrollHeight = element.scrollHeight;\n const threshold = 50; // Pixels before the end to load more\n\n // console.log(\"--- Scroll Event ---\");\n // console.log(\"Scroll Top:\", element.scrollTop);\n // console.log(\"Client Height:\", element.clientHeight);\n // console.log(\"Scroll Position (Top + Client):\", scrollPosition);\n // console.log(\"Scroll Height (Total):\", scrollHeight);\n // console.log(\"Remaining distance to bottom:\", scrollHeight - scrollPosition);\n // console.log(\"Is Loading:\", this.loading());\n // console.log(\"Has More:\", this.hasMore());\n\n if (\n scrollHeight - scrollPosition <= threshold &&\n !this.loading() &&\n this.hasMore()\n ) {\n console.log(\"Loading more data for infinity scroll...\");\n // Usar el texto de búsqueda actual (que puede ser el texto del ítem seleccionado o lo que el usuario escribió)\n this.getAutocompleteByTextHandler(this.getAutocompleteSearchText());\n }\n }\n}\n\n/**\n * Custom validation for element selection\n */\nexport function autocompleteValidator(\n control: AbstractControl,\n): ValidationErrors | null {\n // Un valor válido es un objeto no nulo que tiene una propiedad 'id'.\n // Esto asegura que realmente se ha seleccionado un objeto del autocomplete, no solo texto libre.\n if (\n typeof control?.value === \"object\" &&\n control?.value !== null &&\n \"id\" in control.value\n ) {\n return null;\n }\n return { invalidSelection: true };\n}\n","<mat-form-field [floatLabel]=\"floatLabel\" class=\"w-100\" [appearance]=\"appearance\" [color]=\"color\"\n [subscriptSizing]=\"subscriptSizing\">\n\n @if (showLabel) {\n <mat-label>{{ label | translate }}</mat-label>\n }\n @if (showSuffix) {\n <mat-icon matSuffix>{{ suffixIcon ?? \"search\" }}</mat-icon>\n }\n <input #inputText #trigger=\"matAutocompleteTrigger\" (focus)=\"onFocus()\" [formControl]=\"component\" type=\"text\"\n [matAutocomplete]=\"auto\" [placeholder]=\"placeholder | translate\" aria-label=\"autocomplete\"\n autocomplete=\"off\" matInput [required]=\"required()\">\n @if (!loading() && component.value) {\n <button (click)=\"clear(trigger)\" [disabled]=\"disabled()\"\n aria-label=\"Clear\" mat-icon-button matSuffix>\n <mat-icon>close</mat-icon>\n </button>\n }\n @if (loading()) {\n <button aria-label=\"search\" mat-icon-button matSuffix>\n <mat-spinner [value]=\"90\" color=\"accent\" diameter=\"25\"></mat-spinner>\n </button>\n }\n <mat-autocomplete #auto=\"matAutocomplete\" [displayWith]=\"displayFn\" [requireSelection]=\"requireSelection\"\n (optionSelected)=\"optionSelected($event)\">\n @for (option of filteredOptions(); track option) {\n <mat-option [value]=\"option\">\n @if (!displayOptions && !detailsTemplate) {\n {{ option?.name | i18n: translateService.currentLang }}\n }\n @if (!detailsTemplate) {\n <div class=\"display-options\">\n <span [ngStyle]=\"{'line-height': displayOptions?.secondLabel ? '16px' : ''}\">\n {{ option | resolvePropertyPath:displayOptions.firthLabel | i18n: translateService.currentLang }}\n </span>\n @if (displayOptions?.secondLabel) {\n <span class=\"mat-caption\">\n {{ option | resolvePropertyPath: displayOptions.secondLabel | i18n: translateService.currentLang }}\n </span>\n }\n </div>\n }\n @if (detailsTemplate) {\n <ng-container *ngTemplateOutlet=\"detailsTemplate;context:{$implicit: option }\"></ng-container>\n }\n </mat-option>\n }\n </mat-autocomplete>\n\n @if (component.invalid) {\n <mat-error>\n {{ 'Este campo es requerido.' | translate }}\n </mat-error>\n }\n</mat-form-field>\n","/*\n * Public API Surface of guachos-general-autocomplete\n */\n\nexport * from './utils/constants/constants';\nexport * from './lib/guachos-general-autocomplete.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAIa,MAAA,uBAAuB,GAAkB;AAClD,IAAA,UAAU,EAAE;AACR,QAAA;YACI,IAAI,EAAE,qBAAqB,CAAC,IAAI;YAChC,IAAI,EAAE,CAAC,MAAM;AAChB;AACJ,KAAA;AACD,IAAA,cAAc,EAAE;;;MCNP,YAAY,CAAA;AACrB;;;;;;AAMG;AACI,IAAA,OAAO,qBAAqB,CAAC,GAAQ,EAAE,IAAc,EAAA;QACxD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,IAAY,KAAI;AACtC,YAAA,OAAO,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI;AACnC,SAAC,EAAE,GAAG,IAAI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I;;AAEb,IAAA,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE;AACnC;;AEj1BA;;AAEG;;ACFH;;AAEG;;;;"}
|
@@ -1,26 +1,28 @@
|
|
1
|
-
import { DestroyRef, ElementRef, EventEmitter, NgZone, TemplateRef, WritableSignal } from
|
2
|
-
import { AbstractControl, ControlValueAccessor, UntypedFormControl, ValidationErrors } from
|
3
|
-
import { MatAutocompleteTrigger } from
|
4
|
-
import { ThemePalette } from
|
5
|
-
import { FloatLabelType, MatFormFieldAppearance, SubscriptSizing } from
|
6
|
-
import { TranslateService } from
|
7
|
-
import { Subject } from
|
8
|
-
import { ApiFormData, AutocompleteService, DisplayOption, RestrictionFilter } from
|
9
|
-
import { ServiceConfig } from
|
1
|
+
import { AfterViewInit, DestroyRef, ElementRef, EventEmitter, NgZone, TemplateRef, WritableSignal } from "@angular/core";
|
2
|
+
import { AbstractControl, ControlValueAccessor, UntypedFormControl, ValidationErrors } from "@angular/forms";
|
3
|
+
import { MatAutocomplete, MatAutocompleteTrigger } from "@angular/material/autocomplete";
|
4
|
+
import { ThemePalette } from "@angular/material/core";
|
5
|
+
import { FloatLabelType, MatFormFieldAppearance, SubscriptSizing } from "@angular/material/form-field";
|
6
|
+
import { TranslateService } from "@ngx-translate/core";
|
7
|
+
import { Subject } from "rxjs";
|
8
|
+
import { ApiFormData, AutocompleteService, DisplayOption, RestrictionFilter } from "@guajiritos/services";
|
9
|
+
import { ServiceConfig } from "../utils/constants/constants";
|
10
10
|
import * as i0 from "@angular/core";
|
11
|
-
export declare class GuajiritosGeneralAutocomplete implements ControlValueAccessor {
|
11
|
+
export declare class GuajiritosGeneralAutocomplete implements ControlValueAccessor, AfterViewInit {
|
12
12
|
private _autocompleteService;
|
13
13
|
private _zone;
|
14
14
|
private _destroyRef;
|
15
15
|
translateService: TranslateService;
|
16
16
|
constructor(_autocompleteService: AutocompleteService, _zone: NgZone, _destroyRef: DestroyRef, translateService: TranslateService);
|
17
|
-
private
|
18
|
-
private
|
19
|
-
private
|
20
|
-
private
|
21
|
-
private selectedElement;
|
17
|
+
private _isOptionSelected;
|
18
|
+
private _clearDataSubject;
|
19
|
+
private _doFocusSubject;
|
20
|
+
private _selectedElement;
|
22
21
|
private _url;
|
23
|
-
private
|
22
|
+
private _limit;
|
23
|
+
private _offset;
|
24
|
+
private _restrictionsFilters;
|
25
|
+
private _lastSearchText;
|
24
26
|
disabled: WritableSignal<boolean>;
|
25
27
|
loading: WritableSignal<boolean>;
|
26
28
|
required: WritableSignal<boolean>;
|
@@ -28,17 +30,17 @@ export declare class GuajiritosGeneralAutocomplete implements ControlValueAccess
|
|
28
30
|
originalOptions: WritableSignal<any[]>;
|
29
31
|
notAllowedOption: WritableSignal<any>;
|
30
32
|
component: UntypedFormControl;
|
33
|
+
hasMore: WritableSignal<boolean>;
|
31
34
|
inputText: ElementRef;
|
32
|
-
|
33
|
-
|
34
|
-
*/
|
35
|
+
matAutocomplete: MatAutocomplete;
|
36
|
+
autocompleteTrigger: MatAutocompleteTrigger;
|
35
37
|
floatLabel: FloatLabelType;
|
36
38
|
color: ThemePalette;
|
37
39
|
appearance: MatFormFieldAppearance;
|
38
40
|
subscriptSizing: SubscriptSizing;
|
39
|
-
bodyRequest
|
41
|
+
bodyRequest?: ApiFormData;
|
40
42
|
debounceTimeValue: number;
|
41
|
-
detailsTemplate
|
43
|
+
detailsTemplate?: TemplateRef<any>;
|
42
44
|
label: string;
|
43
45
|
showLabel: boolean;
|
44
46
|
placeholder: string;
|
@@ -49,82 +51,84 @@ export declare class GuajiritosGeneralAutocomplete implements ControlValueAccess
|
|
49
51
|
valueId: boolean;
|
50
52
|
showSuffix: boolean;
|
51
53
|
requireSelection: boolean;
|
52
|
-
order
|
53
|
-
serviceConfig
|
54
|
+
order?: string;
|
55
|
+
serviceConfig?: ServiceConfig;
|
54
56
|
suffixIcon: string;
|
55
57
|
removeProperties: string[];
|
56
|
-
modifyResultFn: (options: any) => any;
|
57
|
-
|
58
|
+
modifyResultFn: (options: any[]) => any[];
|
59
|
+
selectElement: EventEmitter<any>;
|
58
60
|
clearElement: EventEmitter<any>;
|
59
61
|
set url(data: string);
|
62
|
+
set limit(value: number);
|
60
63
|
set clearData(value: Subject<void>);
|
61
64
|
set initialValue(value: any);
|
62
65
|
/**
|
63
|
-
*
|
64
|
-
*
|
65
|
-
* @param restrictions - Restricciones para la búsqueda
|
66
|
+
* Adds or removes search restrictions
|
66
67
|
*/
|
67
68
|
set restrictions(restrictions: RestrictionFilter[]);
|
68
69
|
/**
|
69
|
-
*
|
70
|
-
*
|
71
|
-
* @param required - Define si es requerido o no
|
70
|
+
* Adds or removes required validation
|
72
71
|
*/
|
73
72
|
set isRequired(required: boolean);
|
74
73
|
/**
|
75
|
-
*
|
76
|
-
*
|
77
|
-
* @param focusSubject - Observable para la subscripción al evento Focus
|
74
|
+
* Defines whether to perform a search when the element is in focus
|
78
75
|
*/
|
79
76
|
set doFocus(focusSubject: Subject<void>);
|
80
77
|
set notAllowedElements(element: any);
|
81
78
|
/**
|
82
|
-
*
|
79
|
+
* Resets the autocomplete pagination and options state.
|
80
|
+
* Centralizes the logic to avoid duplication.
|
81
|
+
*/
|
82
|
+
private resetAutocompleteState;
|
83
|
+
/**
|
84
|
+
* Subscription to search input changes
|
83
85
|
*/
|
84
|
-
private
|
86
|
+
private subscribeToComponentChanges;
|
87
|
+
ngAfterViewInit(): void;
|
85
88
|
/**
|
86
|
-
*
|
87
|
-
|
88
|
-
|
89
|
+
* Helper method to clear the internal state of the autocomplete.
|
90
|
+
*/
|
91
|
+
private clearInternalState;
|
92
|
+
/**
|
93
|
+
* Searches for elements to display in the autocomplete component.
|
94
|
+
* Now supports pagination.
|
95
|
+
* @param text - Text to search
|
89
96
|
*/
|
90
97
|
private getAutocompleteByTextHandler;
|
98
|
+
private filterOptionsBasedOnNotAllowed;
|
91
99
|
/**
|
92
|
-
*
|
93
|
-
*
|
94
|
-
* @return {string} Texto de la búsqueda
|
100
|
+
* Defines the text to be used for the search
|
95
101
|
*/
|
96
102
|
private getAutocompleteSearchText;
|
97
103
|
propagateChange: (_: any) => void;
|
98
104
|
registerOnChange(fn: (_: any) => void): void;
|
99
105
|
registerOnTouched(): void;
|
100
106
|
/**
|
101
|
-
* Recibe el valor
|
102
|
-
*
|
103
|
-
* @param value - Valor entrado por FormControl
|
107
|
+
* Recibe el valor desde el FormControl externo.
|
104
108
|
*/
|
105
109
|
writeValue(value: any): void;
|
106
110
|
setDisabledState(isDisabled: boolean): void;
|
107
111
|
/**
|
108
|
-
*
|
109
|
-
*
|
110
|
-
* @param value - Valor a mostrar
|
112
|
+
* Function to display selected elements
|
111
113
|
*/
|
112
114
|
displayFn: (value: any) => string;
|
113
115
|
/**
|
114
|
-
*
|
115
|
-
*
|
116
|
-
* @param trigger
|
116
|
+
* Action on clearing the input value
|
117
117
|
*/
|
118
118
|
clear(trigger: MatAutocompleteTrigger): void;
|
119
119
|
/**
|
120
|
-
*
|
120
|
+
* Action on element Focus
|
121
121
|
*/
|
122
122
|
onFocus(): void;
|
123
123
|
optionSelected($event: any): void;
|
124
|
+
/**
|
125
|
+
* Handles the scroll event in the autocomplete panel to load more data.
|
126
|
+
*/
|
127
|
+
onScroll(event: Event): void;
|
124
128
|
static ɵfac: i0.ɵɵFactoryDeclaration<GuajiritosGeneralAutocomplete, never>;
|
125
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<GuajiritosGeneralAutocomplete, "guajiritos-general-autocomplete", never, { "floatLabel": { "alias": "floatLabel"; "required": false; }; "color": { "alias": "color"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; "subscriptSizing": { "alias": "subscriptSizing"; "required": false; }; "bodyRequest": { "alias": "bodyRequest"; "required": false; }; "debounceTimeValue": { "alias": "debounceTimeValue"; "required": false; }; "detailsTemplate": { "alias": "detailsTemplate"; "required": false; }; "label": { "alias": "label"; "required": false; }; "showLabel": { "alias": "showLabel"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "field": { "alias": "field"; "required": false; }; "filterString": { "alias": "filterString"; "required": false; }; "displayOptions": { "alias": "displayOptions"; "required": false; }; "withoutPaddingBottom": { "alias": "withoutPaddingBottom"; "required": false; }; "valueId": { "alias": "valueId"; "required": false; }; "showSuffix": { "alias": "showSuffix"; "required": false; }; "requireSelection": { "alias": "requireSelection"; "required": false; }; "order": { "alias": "order"; "required": false; }; "serviceConfig": { "alias": "serviceConfig"; "required": false; }; "suffixIcon": { "alias": "suffixIcon"; "required": false; }; "removeProperties": { "alias": "removeProperties"; "required": false; }; "modifyResultFn": { "alias": "modifyResultFn"; "required": false; }; "url": { "alias": "url"; "required": false; }; "clearData": { "alias": "clearData"; "required": false; }; "initialValue": { "alias": "initialValue"; "required": false; }; "restrictions": { "alias": "restrictions"; "required": false; }; "isRequired": { "alias": "isRequired"; "required": false; }; "doFocus": { "alias": "doFocus"; "required": false; }; "notAllowedElements": { "alias": "notAllowedElements"; "required": false; }; }, { "
|
129
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GuajiritosGeneralAutocomplete, "guajiritos-general-autocomplete", never, { "floatLabel": { "alias": "floatLabel"; "required": false; }; "color": { "alias": "color"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; "subscriptSizing": { "alias": "subscriptSizing"; "required": false; }; "bodyRequest": { "alias": "bodyRequest"; "required": false; }; "debounceTimeValue": { "alias": "debounceTimeValue"; "required": false; }; "detailsTemplate": { "alias": "detailsTemplate"; "required": false; }; "label": { "alias": "label"; "required": false; }; "showLabel": { "alias": "showLabel"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "field": { "alias": "field"; "required": false; }; "filterString": { "alias": "filterString"; "required": false; }; "displayOptions": { "alias": "displayOptions"; "required": false; }; "withoutPaddingBottom": { "alias": "withoutPaddingBottom"; "required": false; }; "valueId": { "alias": "valueId"; "required": false; }; "showSuffix": { "alias": "showSuffix"; "required": false; }; "requireSelection": { "alias": "requireSelection"; "required": false; }; "order": { "alias": "order"; "required": false; }; "serviceConfig": { "alias": "serviceConfig"; "required": false; }; "suffixIcon": { "alias": "suffixIcon"; "required": false; }; "removeProperties": { "alias": "removeProperties"; "required": false; }; "modifyResultFn": { "alias": "modifyResultFn"; "required": false; }; "url": { "alias": "url"; "required": false; }; "limit": { "alias": "limit"; "required": false; }; "clearData": { "alias": "clearData"; "required": false; }; "initialValue": { "alias": "initialValue"; "required": false; }; "restrictions": { "alias": "restrictions"; "required": false; }; "isRequired": { "alias": "isRequired"; "required": false; }; "doFocus": { "alias": "doFocus"; "required": false; }; "notAllowedElements": { "alias": "notAllowedElements"; "required": false; }; }, { "selectElement": "selectElement"; "clearElement": "clearElement"; }, never, never, true, never>;
|
126
130
|
}
|
127
131
|
/**
|
128
|
-
*
|
132
|
+
* Custom validation for element selection
|
129
133
|
*/
|
130
134
|
export declare function autocompleteValidator(control: AbstractControl): ValidationErrors | null;
|