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    
Size: Mime:
"use strict";

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

const tslib_1 = require("tslib");

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

const mobx_react_1 = require("xmobx/mobx-react");

const exotic_1 = require("exotic");

const forms_1 = require("../../../../../forms");

const fixture_1 = require("./fixture");

const styled_1 = require("./styled");

class FormStateCard extends forms_1.FormState {
  constructor() {
    super(...arguments);
    this.inputsList = fixture_1.inputList;
  }

}

const formStateCard = new FormStateCard();

class SubmitFormButton extends react_1.default.PureComponent {
  render() {
    return react_1.default.createElement(styled_1.StyledPrimaryButton, Object.assign({}, this.props, {
      "data-input-eh": true,
      "data-qa": 'qa-continue-button',
      text: fixture_1.wording.submit
    }));
  }

}

class CancelFormButton extends react_1.default.PureComponent {
  render() {
    return react_1.default.createElement(styled_1.StyledSecondaryButton, Object.assign({}, this.props, {
      "data-input-eh": true,
      "data-qa": 'qa-cancel-button',
      text: fixture_1.wording.cancel
    }));
  }

}

let FormCard = class FormCard extends forms_1.ObserverForm {
  constructor() {
    super(...arguments);
    this.SubmitButton = SubmitFormButton;
    this.isCancelButtonNeeded = true;
    this.CancelButton = CancelFormButton;

    this.handleSubmit = event => {
      const {
        onContinueClick
      } = this.props;
      event.preventDefault();

      if (this.validateForm()) {
        if (exotic_1.isFunction(onContinueClick)) {
          const changeArgs = {
            event
          };
          onContinueClick(this.state);
        }
      }
    };

    this.handleCancel = event => {
      const {
        onCancelClick
      } = this.props;
      event.preventDefault();

      if (exotic_1.isFunction(onCancelClick)) {
        const changeArgs = {
          event
        };
        onCancelClick(this.state);
      }
    };
  }

};
FormCard.FormState = formStateCard;
FormCard.defaultProps = {
  state: formStateCard
};
FormCard = tslib_1.__decorate([mobx_react_1.observer], FormCard);

class Form extends react_1.default.Component {
  render() {
    return react_1.default.createElement(styled_1.StyledResetPasswordForm, null, react_1.default.createElement(FormCard, Object.assign({}, this.props)));
  }

}

exports.Form = Form;
exports.default = Form; //# sourceMappingURL=index.js.map