Quantity field is a form control element that switches between a native select and input element.
import { DaffQuantityFieldComponent } from '@daffodil/design/quantity-field'
@Component()
class DaffQuantityFieldComponent extends DaffFormFieldControl<number> implements ControlValueAccessor, DaffFormFieldControl<number> {
@ViewChild() input: DaffQuantityInputComponent
@ViewChild() select: DaffQuantitySelectComponent
get focused(): boolean
quantity: number
get _maxFloor(): number
get controlType(): "native-input" | "native-select"
get showInputField(): boolean
get showSelectField(): boolean
@Optional() @Self() ngControl: NgControl
get value()
@Input() min: number = 1
@Input() max: number = 500
@Input() selectMax: number = 10
@Input() id: string = ''
writeValue(quantity: number): void
registerOnChange(fn: (quantity: number) => void): void
registerOnTouched(fn: any): void
setDisabledState(isDisabled: boolean): void
focus(): void
}
number| Default | 1 |
|---|---|
| Description |
number| Default | 500 |
|---|---|
| Description |
number| Default | 10 |
|---|---|
| Description |
string| Default | '' |
|---|---|
| Description |
DaffQuantityInputComponent| Default | – |
|---|---|
| Description |
DaffQuantitySelectComponent| Default | – |
|---|---|
| Description |
boolean| Default | – |
|---|---|
| Description |
number| Default | – |
|---|---|
| Description |
number| Default | – |
|---|---|
| Description | Returns the lesser of max and selectMax. |
"native-input" | "native-select"| Default | – |
|---|---|
| Description |
boolean| Default | – |
|---|---|
| Description |
boolean| Default | – |
|---|---|
| Description |
NgControl| Default | – |
|---|---|
| Description |
| Default | – |
|---|---|
| Description |
void| Parameter | quantity: number |
|---|---|
| Description |
void| Parameter | fn: (quantity: number) => void |
|---|---|
| Description |
void| Parameter | fn: any |
|---|---|
| Description |
void| Parameter | isDisabled: boolean |
|---|---|
| Description |
voidimport { DaffQuantityFieldModule } from '@daffodil/design/quantity-field'
@NgModule()
class DaffQuantityFieldModule {}