import { FormDetailModel } from './form-detail';

/**
 * 表单项模型
 *
 * @export
 * @class FormItemModel
 * @extends {FormDetailModel}
 */
export class FormItemModel extends FormDetailModel {

    public disabled: boolean = false;
    public isAllowEmpty: boolean = true;

    constructor(opts: any = {}) {
        super(opts);
        this.disabled = opts.disabled ? true : false;
        this.isAllowEmpty = opts.isAllowEmpty ? true : false;
    }

    public setAllowEmpty(state: boolean): void {
        this.isAllowEmpty = state;
    }
    public setDisabled(state: boolean): void {
        this.disabled = state;
    }

} 