How to use the react-form-validator-core.ValidatorComponent function in react-form-validator-core

To help you get started, we’ve selected a few react-form-validator-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github unosquare / uno-material-ui / dist / TextValidator.js View on Github external
var TextValidator = /** @class */ (function (_super) {
    __extends(TextValidator, _super);
    function TextValidator() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.state = {
            isValid: true,
        };
        return _this;
    }
    TextValidator.prototype.render = function () {
        var _a = this.props, error = _a.error, errorMessages = _a.errorMessages, validators = _a.validators, requiredError = _a.requiredError, helperText = _a.helperText, validatorListener = _a.validatorListener, withRequiredValidator = _a.withRequiredValidator, label = _a.label, id = _a.id, rest = __rest(_a, ["error", "errorMessages", "validators", "requiredError", "helperText", "validatorListener", "withRequiredValidator", "label", "id"]);
        var isValid = this.state.isValid;
        return (React.createElement(TextField_1.default, __assign({}, rest, { id: id, label: label || uno_react_1.humanize(id), error: !isValid || error, helperText: (!isValid && this.getErrorMessage()) || helperText })));
    };
    return TextValidator;
}(react_form_validator_core_1.ValidatorComponent));
exports.TextValidator = TextValidator;
//# sourceMappingURL=TextValidator.js.map
github unosquare / uno-react / lib / classes / TextValidator.js View on Github external
validatorListener = _this$props.validatorListener,
          withRequiredValidator = _this$props.withRequiredValidator,
          label = _this$props.label,
          id = _this$props.id,
          rest = (0, _objectWithoutProperties2.default)(_this$props, ["error", "errorMessages", "validators", "requiredError", "helperText", "validatorListener", "withRequiredValidator", "label", "id"]);
      var isValid = this.state.isValid;
      return React.createElement(_TextField.default, (0, _extends2.default)({}, rest, {
        id: id,
        label: label || (0, _humanize.default)(id),
        error: !isValid || error,
        helperText: !isValid && this.getErrorMessage() || helperText
      }));
    }
  }]);
  return TextValidator;
}(_reactFormValidatorCore.ValidatorComponent);

exports.default = TextValidator;

react-form-validator-core

Core validator component for react forms.

MIT
Latest version published 2 years ago

Package Health Score

53 / 100
Full package analysis