Repository URL to install this package:
|
Version:
3.0.1 ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
}); // import { isSafe } from 'exotic'
// import { observable, extendObservable } from 'xmobx/mobx'
// import { isValid } from 'src/forms/deps'
// import { InputType } from 'src/forms'
// import { fromEventToValue as toValue } from './_deps'
// import { TextBoxState, TextBoxComponent } from './typings'
const InputState_1 = require("../../forms/input/InputState");
exports.State = InputState_1.InputState; // /**
// * @todo - should be replaced by uxui form state
// */
// class State implements TextBoxState {
// input: TextBoxComponent
// value: string = ''
// isFocused: boolean = false
// hasValidationError: boolean = false
// isValidInput: boolean = true
// type: InputType
// static types = {
// value: '',
// isFocused: false,
// hasValidationError: false,
// isValidInput: true,
// }
// constructor() {
// extendObservable(this, State.types)
// }
// updateFocused(event: Event, instance: any) {
// if (!event || event.target.value === '') {
// this.isFocused = !this.isFocused
// }
// }
// // don't think this is as applicable for textbox eh :-D
// // would make to extend this for DropDown
// setType(type: InputType) {
// this.type = type
// }
// setIsValid(state: boolean) {
// this.isValidInput = state
// return this
// }
// validateInput = (event: Event, instance: TextBoxComponent) => {
// const value = toValue(event)
// this.isValidInput = isValid(value, this.validationType)
// }
// setValue = (value: string) => {
// if (isSafe(value)) {
// this.value = value
// } else {
// this.value = ''
// }
// }
// setInputReference = dom => {
// this.input = dom
// }
// }
console.log('State: ', InputState_1.InputState);
exports.default = InputState_1.InputState; //# sourceMappingURL=State.js.map