import { ChangeDetectorRef, ElementRef, EventEmitter, OnInit } from '@angular/core'; import { FormGroup } from '@angular/forms'; import { CanColor } from '@angular/material/core'; import { Constructor } from '@angular/material/core/common-behaviors/constructor'; import { Option, OptionSet, PackagingFormat } from '@mtna/rds-packaging-ui'; /** * Change event for when selection changes on a RdsPackagingOptionComponent. */ export declare class RdsPackagingOptionChangeEvent { selected: boolean; format: PackagingFormat; optionSet: OptionSet; /** * Creates an instance of RdsPackagingOptionChangeEvent. * @param selected Whether the option is selected * @param format packaging format * @param optionSet packaging format options */ constructor(selected: boolean, format: PackagingFormat, optionSet: OptionSet); } export declare class RdsPackagingOptionBase { _elementRef: ElementRef; constructor(_elementRef: ElementRef); } export declare const _RdsPackagingOptionMixinBase: Constructor & typeof RdsPackagingOptionBase; /** * Displays a signle packaging format with any given options. * Can be selected or deselected. Once selcted, the options become disabled. * If the user wants to change the options, they will need to deselect it first. * * @author Will Davis */ export declare class RdsPackagingOptionComponent extends _RdsPackagingOptionMixinBase implements CanColor, OnInit { private cdr; isSelected: boolean; /** Theme color, defaults to primary */ color: 'primary' | 'accent'; /** Required packaging format */ format: PackagingFormat; /** Required option set for this packaging format. Describes any additional options. */ optionSet: OptionSet; /** Whether this packaging format is selected. If it is selected, the form becomes disabled. */ get selected(): boolean; set selected(value: boolean); private _selected; /** Fired when this format is selected or deselected */ change: EventEmitter; /** Internal reactive form for the format's options */ form: FormGroup; constructor(cdr: ChangeDetectorRef, elementRef: ElementRef); ngOnInit(): void; /** * When the form is "Submitted", the user is toggling the selected state of the format. * Flip the value of the selected property, extract new values from the form, emit a change event. */ toggleSelected(): void; _trackByOption(index: number, option: Option): string; private _disableFormControls; private _enableFormControls; /** * Gets the initial form value for a given `Option`. * If it has a default value use that, otherwise depending on * the data type, give an initial default value. * @param option option from which to get the initial form value * @returns an initial or default value */ private _getInitialFormValue; /** * @returns Whether the option set has any options */ private _hasOptions; }