How to use the formsy-react.HOC function in formsy-react

To help you get started, we’ve selected a few formsy-react 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 Syncano / website / components / FormInputElement.js View on Github external
setValue(e.target.value)}
        {...this.props}
      />
    );
  };
};

FormInputElement.contextTypes = {
  displayValidationErrors: PropTypes.bool
};

export default HOC(FormInputElement);
github appirio-tech / connect-app / src / components / ColorSelector / ColorSelector.jsx View on Github external
)
  }
  
}

ColorSelector.propTypes = {
  defaultColors: PropTypes.array.isRequired
}

ColorSelector.defaultProps = {
  onChange: () => {},
  value: [],
  defaultColors: []
}

export default hoc(ColorSelector)
github graphitejs / server / examples / school / components / Input.js View on Github external
<span>{errorMessage}</span>
      
    );
  }

  changeValue(event) {
    this.setState({ init: false });
    const { setValue, type } = this.props;
    const target = event.currentTarget;
    if (type !== 'checkbox') {
      setValue(target.value);
    }
  }
}

export default HOC(Input);
github gocms-io / gocms / content / gocms / src / base / components / gForm / GInput.js View on Github external
transitionLeaveTimeout={500}&gt;
                        {errorMessage != "" ? <span>{errorMessage}</span> : null}
                    
                
                <input value="{this.props.getValue()" name="{this.props.name}" type="{this.props.type}">
            
        );
    }

}
export default HOC(GInput);
github appirio-tech / connect-app / src / projects / create / components / Devices.jsx View on Github external
{ hasError ? (<p>{errorMessage}</p>) : null}
      
    )
  }
}
DevicesComponent.defaultProps = {
  optionsSet: deviceSets,
  onChange: () =&gt; {}
}

DevicesComponent.propTypes = {
  optionsSet: PropTypes.arrayOf(PropTypes.object).isRequired
}

export default hoc(DevicesComponent)
github appirio-tech / connect-app / src / projects / detail / components / SpecScreens.jsx View on Github external
}
}

SpecScreens.propTypes = {
  screens: PropTypes.arrayOf(PropTypes.object).isRequired,
  questions: PropTypes.arrayOf(PropTypes.object).isRequired,
  project: PropTypes.object.isRequired,
  dirtyProject: PropTypes.object.isRequired,
  additionalClass: PropTypes.string
}

SpecScreens.defaultProps = {
  additionalClass: '',
}

export default hoc(SpecScreens)
github appirio-tech / connect-app / src / components / SelectDropdown / SelectDropdown.jsx View on Github external
}

SelectDropdown.propTypes = {
  onSelect       : PT.func,
  options        : PT.arrayOf(PT.shape({
    title: PT.string.isRequired,
    value: PT.string.isRequired,
    disabled: PT.bool,
    confirm: PT.oneOfType([PT.string, PT.bool]),
    toolTipMessage: PT.string,
  })).isRequired,
  theme          : PT.string,
  selectedOption : PT.object
}

export default hoc(SelectDropdown)
github appirio-tech / connect-app / src / projects / detail / components / SkillsQuestion / SkillsQuestion.jsx View on Github external
noOptionsMessage={() =&gt; 'No results found'}
            options={selectGroupOptions}
            isDisabled={questionDisabled}
          /&gt;
        
        { hasError &amp;&amp; (<p>{errorMessage}</p>) }
      
    )
  }
}

SkillsQuestion.defaultProps = {
  onChange: () =&gt; {}
}

export default hoc(SkillsQuestion)
github graphitejs / server / examples / school / components / Select.js View on Github external
}

  changeValue(event) {
    const hasMultiple = get(event.target.attributes, 'multiple', false);
    const { setValue } = this.props;
    const selected = event.target;
    const values = [...selected.options].filter(option => option.selected).map(option => option.value);
    if (!hasMultiple) {
      setValue(values[0]);
    } else {
      setValue(values);
    }
  }
}

export default HOC(Select);
github LLK / scratch-www / src / components / forms / general-error.jsx View on Github external
var Formsy = require('formsy-react');
var React = require('react');

require('./general-error.scss');

/*
 * A special formsy-react component that only outputs
 * error messages. If you want to display errors that
 * don't apply to a specific field, insert one of these,
 * give it a name, and apply your validation error to
 * the name of the GeneralError component.
 */
module.exports = Formsy.HOC(React.createClass({
    render: function () {
        if (!this.props.showError()) return null;
        return (
            <p>
                {this.props.getErrorMessage()}
            </p>
        );
    }
}));

formsy-react

A form input builder and validator for React

MIT
Latest version published 5 months ago

Package Health Score

76 / 100
Full package analysis