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 / forms / input / plugins / Text / TextInput.js
Size: Mime:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});

const tslib_1 = require("tslib");

const react_1 = tslib_1.__importDefault(require("react"));

const exotic_1 = require("exotic");

const TextBox_1 = tslib_1.__importDefault(require("../../../../inputs/TextBox"));

const _validators_1 = require("../../../deps/_validators");

const InputChain_1 = require("../../InputChain");

class TextBoxInput extends InputChain_1.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_1.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 exotic_1.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_1.default.createElement(TextBox_1.default, Object.assign({}, attributes));
  }

}

exports.TextBoxInput = TextBoxInput;
exports.default = TextBoxInput; //# sourceMappingURL=TextInput.js.map