import { OnChanges, OnDestroy } from '@angular/core'; import { ControlValueAccessor, FormArray, FormBuilder, FormControl, FormGroup } from '@angular/forms'; import { OverrideStyleConfig } from '@pv-frontend/pv-shared-components/common/types'; import { IncrementDecrementStyleOverride } from '@pv-frontend/pv-shared-components/increment-decrement-button'; import { TypedSimpleChanges } from '@pv-frontend/pv-shared-services/common'; import { Subscription } from 'rxjs'; import { AmountType, Denomination, DenominationAmountInputOutput } from './amount-quantity-input.types'; import * as i0 from "@angular/core"; export interface DenominationFormControl { denomination: FormControl; quantity: FormControl; allowedQuantity: FormControl; } export interface AmountQuantityInputStyleOverrideConfig { incrementDecrement?: IncrementDecrementStyleOverride; addMoreButton?: OverrideStyleConfig; } export declare class AmountQuantityInputComponent implements OnDestroy, ControlValueAccessor, OnChanges { #private; private fb; constructor(fb: FormBuilder); ngOnChanges(changes: TypedSimpleChanges): void; DEFAULT_MAX_ALLOWED_QUANTITY_PER_DENOMINATION: number; private destroy$; defaultValueRangeErrorMessage: string; _denominations: Denomination[]; private DEFAULT_AMOUNT_QUANTITY_STYLE; _style: AmountQuantityInputStyleOverrideConfig; _currentUsedDenominations: Set; /** needed for range types */ denominationExistsErrorIndex: Set; denominationOutOfRange: Set; /** control value accessor stuff */ onChange?: (value: DenominationAmountInputOutput) => void; onTouched?: () => void; /** needed for slab type */ chipsToShow: Denomination[]; subscriptionMap: Record; _inputs: FormArray>; set style(newStyle: AmountQuantityInputStyleOverrideConfig | undefined); get style(): AmountQuantityInputStyleOverrideConfig | undefined; type: AmountType; minPriceAllowed: number; maxPriceAllowed: number; maximumOrderValueAllowed?: number | null; addMoreLabel: string; maxAllowedUniqueDenominations: number; /** * This is only read for range types, for slab types, please pass value in denomination */ maxAllowedQuantityPerDenomination: number; valueOutOfRangeErrorMessage?: string; denominationAlreadyExistsErrorMessage?: string; set denominations(denoms: Denomination[]); private setupDenominationsAndInputs; ngOnDestroy(): void; writeValue(obj: DenominationAmountInputOutput): void; registerOnChange(fn: (value: DenominationAmountInputOutput) => void): void; registerOnTouched(fn: () => void): void; setDisabledState?(isDisabled: boolean): void; handleInput(event: Event, index: number): void; private disableInputsExceptPassedIndex; handleKeyDown(event: KeyboardEvent): void; handleDenominationChange(value: Denomination): void; handleNewEntryAddition(): void; handleQuantityValueChanges(quantity: number | null, denomination: number | null): void; private updateChipsToShow; private createFormArrayForSlabType; private createFormArrayForRangeType; private addFormGroupToFormArray; private createFormGroup; private addFormGroupQuantitySubscription; private handleFormGroupQuantitySubscriptionRemoval; private clearSubscriptions; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } //# sourceMappingURL=amount-quantity-input.component.d.ts.map