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/ui / dist / inputs / TextBox / State.js
Size: Mime:
"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