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 / module / forms / input / plugins / Text / TextInput.js
Size: Mime:
import React from 'react';
import { isUndefined } from 'exotic';
import TextBox from "../../../../../inputs/TextBox";
import { validators } from "../../../../../forms/deps/_validators";
import { InputChain } from "../../../../../forms/input/InputChain";

class TextBoxInput extends InputChain {
  constructor() {
    super(...arguments);

    this.validate = () => {
      const state = this.get('state');
      const props = this.get('props');
      /**
       * !!!!!!!!
       * @note - this uses props.validationType while the others use state
       */

      this.isValid = validators.isValid(state.value, props.validationType);
    };
  }
  /**
   * this handles all text inputs, and is the default
   * @note !!!! added || true so it is always the fallback
   */


  static isSatisfiedByProps(props) {
    const typesSupported = ['text', 'confirmPassword', 'telephone'];
    return isUndefined(props.type) || typesSupported.includes(props.type) || props.identity !== 'SecurityCode' && props.type === 'password' || true;
  }

  render() {
    const props = this.get('props');
    const attributes = Object.assign({}, props);
    return React.createElement(TextBox, Object.assign({}, attributes));
  }

}

export { TextBoxInput };
export default TextBoxInput; //# sourceMappingURL=TextInput.js.map