All files / src/fieldcontrols Integer.ts

100% Statements 7/7
100% Branches 0/0
100% Functions 1/1
100% Lines 5/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29          1x   1x 1x                       1x           3x    
/**
 * @module FieldControls
 * 
 */ /** */
 
import { FieldBaseControl } from './FieldBaseControl';
import { FieldSettings } from 'sn-client-js';
import { MDCTextField } from '@material/textfield/dist/mdc.textfield';
import { customElement } from 'aurelia-framework';
 
 
/**
 * Field control for integer (whole number) fields.
 * Usage:
 * 
 * ``` html
 * <integer-field content.bind="content" settings.bind="myIntegerFieldSetting"></integer-field>
 * ```
 */
@customElement('integer-field')
export class Integer extends FieldBaseControl<number, FieldSettings.IntegerFieldSetting> {
 
    textfield: HTMLElement;
    mdcTextField: MDCTextField;
 
    attached(){
        this.mdcTextField = new MDCTextField(this.textfield);
    }
}