How to use the mobx-react-form function in mobx-react-form

To help you get started, we’ve selected a few mobx-react-form 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 codeamp / panel / src / components / Project / Secrets / paginator.js View on Github external
}
    const initials = formInitials
    const types = {
      'isSecret': 'checkbox'
    }
    const keys = {}
    const disabled = {
      'key': false
    }
    const extra = {
      'type': [{key: 'build', value: 'Build'}, {key: 'env', value: 'Normal' },{key: 'file', value: 'File'}]
    }
    const hooks = {}
    const plugins = { dvr: validatorjs }

    return new MobxReactForm({ fields, rules, disabled, labels, initials, extra, hooks, types, keys }, { plugins });
  }
github codeamp / panel / src / components / Project / Services / content.js View on Github external
const plugins = {
      dvr: {
        package: validatorjs,
        extend ($validator) {
          const messages = $validator.getMessages('en');
          messages.regex = "The name MUST NOT start or end with a '-', consist of all numeric values, or contain upper letters.";
          $validator.setMessages('en', messages);
        }
      }
    };

    const options = {
      autoParseNumbers: true
    }

    return new MobxReactForm({ fields, rules, labels, initials, extra, hooks, types, keys }, { plugins, options });
  }
github codeamp / panel / src / components / Project / Extensions / IngressKong / index.js View on Github external
'type': [
          {
            "key": "loadbalancer",
            "value": "Loadbalancer"
          },
          {
            "key": "clusterip",
            "value": "Cluster IP"
          }
        ],
        'protocol': ["TCP", "UDP"],
    }
    const hooks = {};

    const plugins = { dvr: validatorjs }
    this.form = new MobxReactForm({ fields, rules, labels, initials, types, extra, hooks }, {plugins })
  }
github codeamp / panel / src / components / Project / Extensions / Ingress / index.js View on Github external
'type': [
          {
            "key": "loadbalancer",
            "value": "Loadbalancer"
          },
          {
            "key": "clusterip",
            "value": "Cluster IP"
          }
        ],
        'protocol': ["TCP", "UDP"]
    }
    const hooks = {};

    const plugins = { dvr: validatorjs }
    this.form = new MobxReactForm({ fields, rules, labels, initials, types, extra, hooks }, {plugins })
  }
github codeamp / panel / src / components / Admin / Extensions / index.js View on Github external
const hooks = {
      'name': $hooks,
      'key': $hooks,
      'type': $hooks,
      'config': $hooks,
      'config[]': $hooks,
      'config[].key': $hooks,
      'config[].value': $hooks,
      'config[].allowOverride': $hooks,
      'environmentID': $hooks,
      'component': $hooks,
    }

    const handlers = {};
    const plugins = { dvr: validatorjs };
    return new MobxReactForm({ fields, rules, labels, initials, extra, hooks, types }, { handlers , plugins })    
  }
github codeamp / panel / src / components / Project / Settings / index.js View on Github external
const labels = {
      'gitBranch': 'Git Branch',
      'gitUrl': 'Git Url',
      'continuousDeploy': 'Continuous Deploy',
    };
    const initials = {
    };
    const types = {
      'environments[].grant': 'checkbox',
      'continuousDeploy': 'checkbox',
    };
    const extra = {};
    const hooks = {};
    const handlers = {};
    const plugins = { dvr: validatorjs };
    this.form = new MobxReactForm({ fields, rules, labels, initials, extra, hooks, types }, { handlers }, { plugins })    
  }
github codeamp / panel / src / components / Admin / Users / index.js View on Github external
};
    const keys = {};
    const disabled = {
      'name': false,
    }
    const initials = {
      'permissions': [],
    }    
    const defaults = {
      'permissions': [],
    }
    const extra = {}
    const hooks = {};
    const plugins = { dvr: validatorjs };

    this.form = new MobxReactForm({ fields, rules, disabled, labels, initials, defaults, extra, hooks, types, keys }, { plugins });    
  }

mobx-react-form

Automagically manage React forms state and automatic validation with MobX.

MIT
Latest version published 4 months ago

Package Health Score

73 / 100
Full package analysis

Popular mobx-react-form functions