@danderson00/react-forms-material 0.0.33 → 0.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -53,7 +53,7 @@ var _Select = _interopRequireDefault(require("@material-ui/core/Select"));
53
53
 
54
54
  require("./styles");
55
55
 
56
- var _excluded = ["className", "error", "hiddenLabel", "variant", "margin", "label", "helperText", "shrinkLabel", "valid"],
56
+ var _excluded = ["className", "error", "hiddenLabel", "variant", "margin", "label", "helperText", "shrinkLabel", "valid", "pattern"],
57
57
  _excluded2 = ["name", "values", "labels", "numeric", "required", "getFieldValue", "getFieldValues"],
58
58
  _excluded3 = ["values", "labels"];
59
59
 
@@ -124,6 +124,7 @@ var base = function base(component) {
124
124
  helperText = _ref3.helperText,
125
125
  shrinkLabel = _ref3.shrinkLabel,
126
126
  valid = _ref3.valid,
127
+ pattern = _ref3.pattern,
127
128
  inputProps = _objectWithoutProperties(_ref3, _excluded);
128
129
 
129
130
  return /*#__PURE__*/(0, _react.createElement)(_FormControl["default"], {
@@ -142,12 +143,16 @@ var base = function base(component) {
142
143
  shrink: false
143
144
  }), (alwaysShrinkLabel || shrinkLabel) && {
144
145
  className: 'MuiInputLabel-shrink'
145
- }))] : []), [/*#__PURE__*/(0, _react.createElement)(component, _objectSpread(_objectSpread({
146
+ }))] : []), [/*#__PURE__*/(0, _react.createElement)(component, _objectSpread(_objectSpread(_objectSpread({
146
147
  key: 'input',
147
148
  variant: variant
148
149
  }, passError && {
149
150
  error: error
150
- }), inputProps))], _toConsumableArray(helperText ? [/*#__PURE__*/(0, _react.createElement)(_FormHelperText["default"], {
151
+ }), inputProps), {}, {
152
+ inputProps: _objectSpread(_objectSpread({}, pattern && {
153
+ pattern: pattern
154
+ }), inputProps.inputProps)
155
+ }))], _toConsumableArray(helperText ? [/*#__PURE__*/(0, _react.createElement)(_FormHelperText["default"], {
151
156
  key: 'helperText',
152
157
  children: helperText
153
158
  })] : []))
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ErrorMessage","error","createElement","MuiFormHelperText","children","extractErrorMessage","Form","FormProvider","context","Provider","margin","Submit","wrapSubmit","MuiButton","Button","wrapped","component","options","baseOptions","wrapInput","base","passErrorProp","alwaysShrinkLabel","shrinkLabel","shrinkLabelOption","passError","className","hiddenLabel","variant","label","helperText","valid","inputProps","MuiFormControl","type","fullWidth","required","MuiInputLabel","key","htmlFor","id","shrink","Input","MuiInput","Text","Checkbox","MuiCheckbox","RadioButton","MuiRadio","Radio","createRawConsumer","name","values","labels","numeric","getFieldValue","getFieldValues","props","MuiRadioGroup","map","value","index","Select","MuiSelect","MuiMenuItem","wrapField"],"sources":["../src/index.js"],"sourcesContent":["import { createElement } from 'react'\nimport { FormProvider, Group, context, createRawConsumer, wrapInput, wrapSubmit, useFormValues } from '@danderson00/react-forms'\nimport { extractErrorMessage } from '@danderson00/react-forms/dist/ErrorMessage'\nimport MuiButton from '@material-ui/core/Button'\nimport MuiCheckbox from '@material-ui/core/Checkbox'\nimport MuiFormControl from '@material-ui/core/FormControl'\nimport MuiFormHelperText from '@material-ui/core/FormHelperText'\nimport MuiInput from '@material-ui/core/Input'\nimport MuiInputLabel from '@material-ui/core/InputLabel'\nimport MuiMenuItem from '@material-ui/core/MenuItem'\nimport MuiRadio from '@material-ui/core/Radio'\nimport MuiRadioGroup from '@material-ui/core/RadioGroup'\nimport MuiSelect from '@material-ui/core/Select'\nimport './styles'\n\nexport const ErrorMessage = ({ error }) => createElement(MuiFormHelperText, { children: extractErrorMessage(error), error: true })\nexport const Form = FormProvider(context.Provider, { margin: 'dense' }, ErrorMessage)\nexport const Submit = wrapSubmit(MuiButton)\nexport const Button = MuiButton\nexport { useFormValues, Group, wrapInput }\n\nconst wrapped = (component, options, baseOptions) => wrapInput(\n base(component, options, baseOptions),\n { passErrorProp: true, ...options }\n)\n\nconst base = (component, options = {}, { alwaysShrinkLabel, shrinkLabel: shrinkLabelOption = true, passError } = {}) => (\n ({ className, error, hiddenLabel, variant, margin, label, helperText, shrinkLabel, valid, ...inputProps }) => (\n createElement(MuiFormControl, {\n className: `react-forms-material-field${options.type ? ` react-forms-material-${options.type}` : ''}${className ? ` ${className}` : ''}`,\n error,\n fullWidth: inputProps.fullWidth,\n hiddenLabel,\n required: inputProps.required,\n variant,\n margin,\n children: [\n ...(label ? [createElement(MuiInputLabel, {\n key: 'label',\n htmlFor: inputProps.id,\n children: label,\n ...(shrinkLabelOption === false && { shrink: false }),\n ...((alwaysShrinkLabel || shrinkLabel) && { className: 'MuiInputLabel-shrink' }),\n })] : []),\n\n createElement(component, {\n key: 'input',\n variant,\n ...(passError && { error }),\n ...inputProps\n }),\n\n ...(helperText ? [createElement(MuiFormHelperText, {\n key: 'helperText',\n children: helperText\n })] : [])\n ]\n })\n )\n)\n\nexport const Input = wrapInput(MuiInput)\nexport const Text = wrapped(MuiInput)\nexport const Checkbox = wrapped(MuiCheckbox, { type: 'checkbox' }, { alwaysShrinkLabel: true })\nexport const RadioButton = wrapped(MuiRadio, { type: 'radio' }, { shrinkLabel: false })\n\nexport const Radio = createRawConsumer(base(\n ({ name, values, labels, numeric, required, getFieldValue, getFieldValues, ...props }) => (\n createElement(MuiRadioGroup, { ...props, children: [\n values.map((value, index) =>\n createElement(RadioButton, {\n name,\n value,\n numeric,\n key: value,\n label: (labels && labels[index]) || value,\n margin: props.margin,\n ...(required && { required })\n })\n )\n ] })\n ),\n { type: 'radiogroup' },\n { alwaysShrinkLabel: true }\n))\n\nexport const Select = wrapped(({ values, labels, ...props }) =>\n createElement(MuiSelect, { ...props, children:\n values.map((value, index) =>\n createElement(MuiMenuItem, {\n value,\n key: value,\n children: (labels && labels[index]) || value,\n ...(props.required && { required: props.required })\n })\n )\n }),\n { type: 'select' },\n { alwaysShrinkLabel: true }\n)\n\nexport const wrapField = wrapped"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA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AA,CADyC,EAgBzC;EAAEF,IAAI,EAAE;AAAR,CAhByC,EAiBzC;EAAEZ,iBAAiB,EAAE;AAArB,CAjByC,CAAtB,CAAd;;AAoBA,IAAMwC,MAAM,GAAG/C,OAAO,CAAC;EAAA,IAAGqC,MAAH,SAAGA,MAAH;EAAA,IAAWC,MAAX,SAAWA,MAAX;EAAA,IAAsBI,KAAtB;;EAAA,oBAC5B,IAAAvD,oBAAA,EAAc6D,kBAAd,kCAA8BN,KAA9B;IAAqCrD,QAAQ,EAC3CgD,MAAM,CAACO,GAAP,CAAW,UAACC,KAAD,EAAQC,KAAR;MAAA,oBACT,IAAA3D,oBAAA,EAAc8D,oBAAd;QACEJ,KAAK,EAALA,KADF;QAEEtB,GAAG,EAAEsB,KAFP;QAGExD,QAAQ,EAAGiD,MAAM,IAAIA,MAAM,CAACQ,KAAD,CAAjB,IAA6BD;MAHzC,GAIMH,KAAK,CAACrB,QAAN,IAAkB;QAAEA,QAAQ,EAAEqB,KAAK,CAACrB;MAAlB,CAJxB,EADS;IAAA,CAAX;EADF,GAD4B;AAAA,CAAD,EAW3B;EAAEF,IAAI,EAAE;AAAR,CAX2B,EAY3B;EAAEZ,iBAAiB,EAAE;AAArB,CAZ2B,CAAtB;;AAeA,IAAM2C,SAAS,GAAGlD,OAAlB"}
1
+ {"version":3,"file":"index.js","names":["ErrorMessage","error","createElement","MuiFormHelperText","children","extractErrorMessage","Form","FormProvider","context","Provider","margin","Submit","wrapSubmit","MuiButton","Button","wrapped","component","options","baseOptions","wrapInput","base","passErrorProp","alwaysShrinkLabel","shrinkLabel","shrinkLabelOption","passError","className","hiddenLabel","variant","label","helperText","valid","pattern","inputProps","MuiFormControl","type","fullWidth","required","MuiInputLabel","key","htmlFor","id","shrink","Input","MuiInput","Text","Checkbox","MuiCheckbox","RadioButton","MuiRadio","Radio","createRawConsumer","name","values","labels","numeric","getFieldValue","getFieldValues","props","MuiRadioGroup","map","value","index","Select","MuiSelect","MuiMenuItem","wrapField"],"sources":["../src/index.js"],"sourcesContent":["import { createElement } from 'react'\nimport { FormProvider, Group, context, createRawConsumer, wrapInput, wrapSubmit, useFormValues } from '@danderson00/react-forms'\nimport { extractErrorMessage } from '@danderson00/react-forms/dist/ErrorMessage'\nimport MuiButton from '@material-ui/core/Button'\nimport MuiCheckbox from '@material-ui/core/Checkbox'\nimport MuiFormControl from '@material-ui/core/FormControl'\nimport MuiFormHelperText from '@material-ui/core/FormHelperText'\nimport MuiInput from '@material-ui/core/Input'\nimport MuiInputLabel from '@material-ui/core/InputLabel'\nimport MuiMenuItem from '@material-ui/core/MenuItem'\nimport MuiRadio from '@material-ui/core/Radio'\nimport MuiRadioGroup from '@material-ui/core/RadioGroup'\nimport MuiSelect from '@material-ui/core/Select'\nimport './styles'\n\nexport const ErrorMessage = ({ error }) => createElement(MuiFormHelperText, { children: extractErrorMessage(error), error: true })\nexport const Form = FormProvider(context.Provider, { margin: 'dense' }, ErrorMessage)\nexport const Submit = wrapSubmit(MuiButton)\nexport const Button = MuiButton\nexport { useFormValues, Group, wrapInput }\n\nconst wrapped = (component, options, baseOptions) => wrapInput(\n base(component, options, baseOptions),\n { passErrorProp: true, ...options }\n)\n\nconst base = (component, options = {}, { alwaysShrinkLabel, shrinkLabel: shrinkLabelOption = true, passError } = {}) => (\n ({ className, error, hiddenLabel, variant, margin, label, helperText, shrinkLabel, valid, pattern, ...inputProps }) => (\n createElement(MuiFormControl, {\n className: `react-forms-material-field${options.type ? ` react-forms-material-${options.type}` : ''}${className ? ` ${className}` : ''}`,\n error,\n fullWidth: inputProps.fullWidth,\n hiddenLabel,\n required: inputProps.required,\n variant,\n margin,\n children: [\n ...(label ? [createElement(MuiInputLabel, {\n key: 'label',\n htmlFor: inputProps.id,\n children: label,\n ...(shrinkLabelOption === false && { shrink: false }),\n ...((alwaysShrinkLabel || shrinkLabel) && { className: 'MuiInputLabel-shrink' }),\n })] : []),\n\n createElement(component, {\n key: 'input',\n variant,\n ...(passError && { error }),\n ...inputProps,\n inputProps: { ...(pattern && { pattern }), ...inputProps.inputProps }\n }),\n\n ...(helperText ? [createElement(MuiFormHelperText, {\n key: 'helperText',\n children: helperText\n })] : [])\n ]\n })\n )\n)\n\nexport const Input = wrapInput(MuiInput)\nexport const Text = wrapped(MuiInput)\nexport const Checkbox = wrapped(MuiCheckbox, { type: 'checkbox' }, { alwaysShrinkLabel: true })\nexport const RadioButton = wrapped(MuiRadio, { type: 'radio' }, { shrinkLabel: false })\n\nexport const Radio = createRawConsumer(base(\n ({ name, values, labels, numeric, required, getFieldValue, getFieldValues, ...props }) => (\n createElement(MuiRadioGroup, { ...props, children: [\n values.map((value, index) =>\n createElement(RadioButton, {\n name,\n value,\n numeric,\n key: value,\n label: (labels && labels[index]) || value,\n margin: props.margin,\n ...(required && { required })\n })\n )\n ] })\n ),\n { type: 'radiogroup' },\n { alwaysShrinkLabel: true }\n))\n\nexport const Select = wrapped(({ values, labels, ...props }) =>\n createElement(MuiSelect, { ...props, children:\n values.map((value, index) =>\n createElement(MuiMenuItem, {\n value,\n key: value,\n children: (labels && labels[index]) || value,\n ...(props.required && { required: props.required })\n })\n )\n }),\n { type: 'select' },\n { alwaysShrinkLabel: true }\n)\n\nexport const wrapField = wrapped"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,IAAMA,YAAY,GAAG,SAAfA,YAAe;EAAA,IAAGC,KAAH,QAAGA,KAAH;EAAA,oBAAe,IAAAC,oBAAA,EAAcC,0BAAd,EAAiC;IAAEC,QAAQ,EAAE,IAAAC,iCAAA,EAAoBJ,KAApB,CAAZ;IAAwCA,KAAK,EAAE;EAA/C,CAAjC,CAAf;AAAA,CAArB;;;AACA,IAAMK,IAAI,GAAG,IAAAC,wBAAA,EAAaC,mBAAA,CAAQC,QAArB,EAA+B;EAAEC,M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AAc8D,kBAAd,kCAA8BN,KAA9B;IAAqCtD,QAAQ,EAC3CiD,MAAM,CAACO,GAAP,CAAW,UAACC,KAAD,EAAQC,KAAR;MAAA,oBACT,IAAA5D,oBAAA,EAAc+D,oBAAd;QACEJ,KAAK,EAALA,KADF;QAEEtB,GAAG,EAAEsB,KAFP;QAGEzD,QAAQ,EAAGkD,MAAM,IAAIA,MAAM,CAACQ,KAAD,CAAjB,IAA6BD;MAHzC,GAIMH,KAAK,CAACrB,QAAN,IAAkB;QAAEA,QAAQ,EAAEqB,KAAK,CAACrB;MAAlB,CAJxB,EADS;IAAA,CAAX;EADF,GAD4B;AAAA,CAAD,EAW3B;EAAEF,IAAI,EAAE;AAAR,CAX2B,EAY3B;EAAEb,iBAAiB,EAAE;AAArB,CAZ2B,CAAtB;;AAeA,IAAM4C,SAAS,GAAGnD,OAAlB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danderson00/react-forms-material",
3
- "version": "0.0.33",
3
+ "version": "0.0.36",
4
4
  "description": "Beautiful, ultra simple, stateless, validated forms for use in React function components",
5
5
  "main": "dist/index.js",
6
6
  "module": "src/index.js",
@@ -10,7 +10,7 @@
10
10
  "prepare": "babel src --source-maps --out-dir dist"
11
11
  },
12
12
  "dependencies": {
13
- "@danderson00/react-forms": "0.0.33",
13
+ "@danderson00/react-forms": "0.0.36",
14
14
  "@material-ui/core": "^4.11.3"
15
15
  },
16
16
  "peerDependencies": {
package/src/index.js CHANGED
@@ -25,7 +25,7 @@ const wrapped = (component, options, baseOptions) => wrapInput(
25
25
  )
26
26
 
27
27
  const base = (component, options = {}, { alwaysShrinkLabel, shrinkLabel: shrinkLabelOption = true, passError } = {}) => (
28
- ({ className, error, hiddenLabel, variant, margin, label, helperText, shrinkLabel, valid, ...inputProps }) => (
28
+ ({ className, error, hiddenLabel, variant, margin, label, helperText, shrinkLabel, valid, pattern, ...inputProps }) => (
29
29
  createElement(MuiFormControl, {
30
30
  className: `react-forms-material-field${options.type ? ` react-forms-material-${options.type}` : ''}${className ? ` ${className}` : ''}`,
31
31
  error,
@@ -47,7 +47,8 @@ const base = (component, options = {}, { alwaysShrinkLabel, shrinkLabel: shrinkL
47
47
  key: 'input',
48
48
  variant,
49
49
  ...(passError && { error }),
50
- ...inputProps
50
+ ...inputProps,
51
+ inputProps: { ...(pattern && { pattern }), ...inputProps.inputProps }
51
52
  }),
52
53
 
53
54
  ...(helperText ? [createElement(MuiFormHelperText, {