Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/forms / build / dist / new-forms / CommonState.js
Size: Mime:
import * as tslib_1 from "tslib";
import { action, observable } from 'mobx';
import { toValue } from './deps';
export class CommonState {
    constructor() {
        /**
         * @note: these seem attribute-like
         */
        /** @description for inputs, this is `isFocused` */
        this.isActive = false;
        /** @description for inputs, this is value for checkbox? or something else... */
        this.isSelected = false;
        /** @description for inputs, this is what was @name labelText */
        this.label = '';
        /** @description for inputs, the VALUE OF THE INPUT */
        this.value = '';
        /** @description for disabling inputs from being changed */
        this.isDisabled = false;
        /** @description for hiding / showing inputs so we can adjust them dynamically */
        this.isVisible = true;
    }
    setValue(value) {
        this.value = toValue(value);
    }
    setLabel(label) {
        this.label = label;
    }
    setIsDisabled(isDisabled) {
        this.isDisabled = isDisabled;
    }
    setIsVisible(isVisible) {
        this.isVisible = isVisible;
    }
    setIsSelected(isSelected) {
        this.isSelected = isSelected;
    }
    /** @description for inputs, this is `isFocused` */
    setIsActive(isActive) {
        this.isActive = isActive;
    }
}
tslib_1.__decorate([
    observable
], CommonState.prototype, "isActive", void 0);
tslib_1.__decorate([
    observable
], CommonState.prototype, "isSelected", void 0);
tslib_1.__decorate([
    observable
], CommonState.prototype, "label", void 0);
tslib_1.__decorate([
    observable
], CommonState.prototype, "value", void 0);
tslib_1.__decorate([
    observable
], CommonState.prototype, "isDisabled", void 0);
tslib_1.__decorate([
    observable
], CommonState.prototype, "isVisible", void 0);
tslib_1.__decorate([
    action
], CommonState.prototype, "setValue", null);
tslib_1.__decorate([
    action
], CommonState.prototype, "setLabel", null);
tslib_1.__decorate([
    action
], CommonState.prototype, "setIsDisabled", null);
tslib_1.__decorate([
    action
], CommonState.prototype, "setIsVisible", null);
tslib_1.__decorate([
    action
], CommonState.prototype, "setIsSelected", null);
tslib_1.__decorate([
    action
], CommonState.prototype, "setIsActive", null);
//# sourceMappingURL=CommonState.js.map