@danderson00/react-forms-material 0.0.40 → 0.0.42
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 +31 -62
- package/dist/index.js.map +1 -1
- package/dist/styles.js +0 -2
- package/dist/styles.js.map +1 -1
- package/package.json +2 -2
- package/src/index.js +2 -2
package/dist/index.js
CHANGED
|
@@ -11,6 +11,12 @@ Object.defineProperty(exports, "Group", {
|
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
13
|
exports.Text = exports.Submit = exports.Select = exports.RadioButton = exports.Radio = exports.Input = void 0;
|
|
14
|
+
Object.defineProperty(exports, "useForm", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function get() {
|
|
17
|
+
return _reactForms.useForm;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
14
20
|
Object.defineProperty(exports, "useFormValues", {
|
|
15
21
|
enumerable: true,
|
|
16
22
|
get: function get() {
|
|
@@ -24,63 +30,35 @@ Object.defineProperty(exports, "wrapInput", {
|
|
|
24
30
|
return _reactForms.wrapInput;
|
|
25
31
|
}
|
|
26
32
|
});
|
|
27
|
-
|
|
28
33
|
var _react = require("react");
|
|
29
|
-
|
|
30
34
|
var _reactForms = require("@danderson00/react-forms");
|
|
31
|
-
|
|
32
35
|
var _ErrorMessage = require("@danderson00/react-forms/dist/ErrorMessage");
|
|
33
|
-
|
|
34
36
|
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
|
|
35
|
-
|
|
36
37
|
var _Checkbox = _interopRequireDefault(require("@material-ui/core/Checkbox"));
|
|
37
|
-
|
|
38
38
|
var _FormControl = _interopRequireDefault(require("@material-ui/core/FormControl"));
|
|
39
|
-
|
|
40
39
|
var _FormHelperText = _interopRequireDefault(require("@material-ui/core/FormHelperText"));
|
|
41
|
-
|
|
42
40
|
var _Input = _interopRequireDefault(require("@material-ui/core/Input"));
|
|
43
|
-
|
|
44
41
|
var _InputLabel = _interopRequireDefault(require("@material-ui/core/InputLabel"));
|
|
45
|
-
|
|
46
42
|
var _MenuItem = _interopRequireDefault(require("@material-ui/core/MenuItem"));
|
|
47
|
-
|
|
48
43
|
var _Radio = _interopRequireDefault(require("@material-ui/core/Radio"));
|
|
49
|
-
|
|
50
44
|
var _RadioGroup = _interopRequireDefault(require("@material-ui/core/RadioGroup"));
|
|
51
|
-
|
|
52
45
|
var _Select = _interopRequireDefault(require("@material-ui/core/Select"));
|
|
53
|
-
|
|
54
46
|
require("./styles");
|
|
55
|
-
|
|
56
47
|
var _excluded = ["className", "error", "hiddenLabel", "variant", "margin", "label", "helperText", "shrinkLabel", "valid", "pattern"],
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
48
|
+
_excluded2 = ["name", "values", "labels", "numeric", "required", "getFieldValue", "getFieldValues"],
|
|
49
|
+
_excluded3 = ["values", "labels"];
|
|
60
50
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
61
|
-
|
|
62
51
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
63
|
-
|
|
64
52
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
65
|
-
|
|
66
53
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
67
|
-
|
|
68
54
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
69
|
-
|
|
70
55
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
71
|
-
|
|
72
56
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
73
|
-
|
|
74
57
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
75
|
-
|
|
76
58
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
77
|
-
|
|
78
59
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
79
|
-
|
|
80
60
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
81
|
-
|
|
82
61
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
83
|
-
|
|
84
62
|
var ErrorMessage = function ErrorMessage(_ref) {
|
|
85
63
|
var error = _ref.error;
|
|
86
64
|
return /*#__PURE__*/(0, _react.createElement)(_FormHelperText["default"], {
|
|
@@ -88,7 +66,6 @@ var ErrorMessage = function ErrorMessage(_ref) {
|
|
|
88
66
|
error: true
|
|
89
67
|
});
|
|
90
68
|
};
|
|
91
|
-
|
|
92
69
|
exports.ErrorMessage = ErrorMessage;
|
|
93
70
|
var Form = (0, _reactForms.FormProvider)(_reactForms.context.Provider, {
|
|
94
71
|
margin: 'dense'
|
|
@@ -98,35 +75,30 @@ var Submit = (0, _reactForms.wrapSubmit)(_Button["default"]);
|
|
|
98
75
|
exports.Submit = Submit;
|
|
99
76
|
var Button = _Button["default"];
|
|
100
77
|
exports.Button = Button;
|
|
101
|
-
|
|
102
78
|
var wrapped = function wrapped(component, options, baseOptions) {
|
|
103
79
|
return (0, _reactForms.wrapInput)(base(component, options, baseOptions), _objectSpread({
|
|
104
80
|
passErrorProp: true
|
|
105
81
|
}, options));
|
|
106
82
|
};
|
|
107
|
-
|
|
108
83
|
var base = function base(component) {
|
|
109
84
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
110
|
-
|
|
111
85
|
var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
86
|
+
alwaysShrinkLabel = _ref2.alwaysShrinkLabel,
|
|
87
|
+
_ref2$shrinkLabel = _ref2.shrinkLabel,
|
|
88
|
+
shrinkLabelOption = _ref2$shrinkLabel === void 0 ? true : _ref2$shrinkLabel,
|
|
89
|
+
passError = _ref2.passError;
|
|
117
90
|
return function (_ref3) {
|
|
118
91
|
var className = _ref3.className,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
92
|
+
error = _ref3.error,
|
|
93
|
+
hiddenLabel = _ref3.hiddenLabel,
|
|
94
|
+
variant = _ref3.variant,
|
|
95
|
+
margin = _ref3.margin,
|
|
96
|
+
label = _ref3.label,
|
|
97
|
+
helperText = _ref3.helperText,
|
|
98
|
+
shrinkLabel = _ref3.shrinkLabel,
|
|
99
|
+
valid = _ref3.valid,
|
|
100
|
+
pattern = _ref3.pattern,
|
|
101
|
+
inputProps = _objectWithoutProperties(_ref3, _excluded);
|
|
130
102
|
return /*#__PURE__*/(0, _react.createElement)(_FormControl["default"], {
|
|
131
103
|
className: "react-forms-material-field".concat(options.type ? " react-forms-material-".concat(options.type) : '').concat(className ? " ".concat(className) : ''),
|
|
132
104
|
error: error,
|
|
@@ -159,7 +131,6 @@ var base = function base(component) {
|
|
|
159
131
|
});
|
|
160
132
|
};
|
|
161
133
|
};
|
|
162
|
-
|
|
163
134
|
var Input = (0, _reactForms.wrapInput)(_Input["default"]);
|
|
164
135
|
exports.Input = Input;
|
|
165
136
|
var Text = wrapped(_Input["default"]);
|
|
@@ -178,14 +149,13 @@ var RadioButton = wrapped(_Radio["default"], {
|
|
|
178
149
|
exports.RadioButton = RadioButton;
|
|
179
150
|
var Radio = (0, _reactForms.createRawConsumer)(base(function (_ref4) {
|
|
180
151
|
var name = _ref4.name,
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
152
|
+
values = _ref4.values,
|
|
153
|
+
labels = _ref4.labels,
|
|
154
|
+
numeric = _ref4.numeric,
|
|
155
|
+
required = _ref4.required,
|
|
156
|
+
getFieldValue = _ref4.getFieldValue,
|
|
157
|
+
getFieldValues = _ref4.getFieldValues,
|
|
158
|
+
props = _objectWithoutProperties(_ref4, _excluded2);
|
|
189
159
|
return /*#__PURE__*/(0, _react.createElement)(_RadioGroup["default"], _objectSpread(_objectSpread({}, props), {}, {
|
|
190
160
|
children: [values.map(function (value, index) {
|
|
191
161
|
return /*#__PURE__*/(0, _react.createElement)(RadioButton, _objectSpread({
|
|
@@ -208,9 +178,8 @@ var Radio = (0, _reactForms.createRawConsumer)(base(function (_ref4) {
|
|
|
208
178
|
exports.Radio = Radio;
|
|
209
179
|
var Select = wrapped(function (_ref5) {
|
|
210
180
|
var values = _ref5.values,
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
181
|
+
labels = _ref5.labels,
|
|
182
|
+
props = _objectWithoutProperties(_ref5, _excluded3);
|
|
214
183
|
return /*#__PURE__*/(0, _react.createElement)(_Select["default"], _objectSpread(_objectSpread({}, props), {}, {
|
|
215
184
|
children: values.map(function (value, index) {
|
|
216
185
|
return /*#__PURE__*/(0, _react.createElement)(_MenuItem["default"], _objectSpread({
|
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","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":"
|
|
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, useForm, 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 { useForm, 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;AAAiB;EAAA;EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEV,IAAMA,YAAY,GAAG,SAAfA,YAAY;EAAA,IAAMC,KAAK,QAALA,KAAK;EAAA,oBAAO,IAAAC,oBAAa,EAACC,0BAAiB,EAAE;IAAEC,QAAQ,EAAE,IAAAC,iCAAmB,EAACJ,KAAK,CAAC;IAAEA,KAAK,EAAE;EAAK,CAAC,CAAC;AAAA;AAAA;AAC3H,IAAMK,IAAI,GAAG,IAAAC,wBAAY,EAACC,mBAAO,CAACC,QAAQ,EAAE;EAAEC,MAAM,EAAE;AAAQ,CAAC,EAAEV,YAAY,CAAC;AAAA;AAC9E,IAAMW,MAAM,GAAG,IAAAC,sBAAU,EAACC,kBAAS,CAAC;AAAA;AACpC,IAAMC,MAAM,GAAGD,kBAAS;AAAA;AAG/B,IAAME,OAAO,GAAG,SAAVA,OAAO,CAAIC,SAAS,EAAEC,OAAO,EAAEC,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M4C,SAAS,GAAGnD,OAAO;AAAA"}
|
package/dist/styles.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _injectCss = _interopRequireDefault(require("@danderson00/react-forms/dist/injectCss"));
|
|
4
|
-
|
|
5
4
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
6
|
-
|
|
7
5
|
(0, _injectCss["default"])('react-forms-material-styles', "\n .react-forms-material-radiogroup.MuiFormControl-root {\n overflow: hidden;\n }\n\n .react-forms-material-radio.MuiFormControl-root {\n flex-direction: row-reverse;\n justify-content: flex-end;\n }\n \n .react-forms-material-radio .MuiInputLabel-formControl {\n position: static;\n }\n\n .react-forms-material-radio .MuiRadio-root {\n transform: translate(0, 9px) scale(1);\n } \n \n .react-forms-material-checkbox .MuiCheckbox-root {\n transform: translate(0, 9px) scale(1);\n }\n \n /* allow forms to be embedded in dialogs - essentially replicate a few styles */\n .MuiDialog-container form {\n display: flex;\n }\n \n .MuiDialog-container form .MuiDialogContent-root {\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n }\n\n .MuiDialog-container form .MuiDialogActions-root {\n align-self: flex-end;\n }\n \n .react-forms input::-webkit-outer-spin-button,\n .react-forms input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n .react-forms input[type=number] {\n -moz-appearance: textfield;\n }\n");
|
|
8
6
|
//# sourceMappingURL=styles.js.map
|
package/dist/styles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["injectCss"],"sources":["../src/styles.js"],"sourcesContent":["import injectCss from '@danderson00/react-forms/dist/injectCss'\n\ninjectCss('react-forms-material-styles', `\n .react-forms-material-radiogroup.MuiFormControl-root {\n overflow: hidden;\n }\n\n .react-forms-material-radio.MuiFormControl-root {\n flex-direction: row-reverse;\n justify-content: flex-end;\n }\n \n .react-forms-material-radio .MuiInputLabel-formControl {\n position: static;\n }\n\n .react-forms-material-radio .MuiRadio-root {\n transform: translate(0, 9px) scale(1);\n } \n \n .react-forms-material-checkbox .MuiCheckbox-root {\n transform: translate(0, 9px) scale(1);\n }\n \n /* allow forms to be embedded in dialogs - essentially replicate a few styles */\n .MuiDialog-container form {\n display: flex;\n }\n \n .MuiDialog-container form .MuiDialogContent-root {\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n }\n\n .MuiDialog-container form .MuiDialogActions-root {\n align-self: flex-end;\n }\n \n .react-forms input::-webkit-outer-spin-button,\n .react-forms input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n .react-forms input[type=number] {\n -moz-appearance: textfield;\n }\n`)\n\n\n"],"mappings":";;AAAA
|
|
1
|
+
{"version":3,"file":"styles.js","names":["injectCss"],"sources":["../src/styles.js"],"sourcesContent":["import injectCss from '@danderson00/react-forms/dist/injectCss'\n\ninjectCss('react-forms-material-styles', `\n .react-forms-material-radiogroup.MuiFormControl-root {\n overflow: hidden;\n }\n\n .react-forms-material-radio.MuiFormControl-root {\n flex-direction: row-reverse;\n justify-content: flex-end;\n }\n \n .react-forms-material-radio .MuiInputLabel-formControl {\n position: static;\n }\n\n .react-forms-material-radio .MuiRadio-root {\n transform: translate(0, 9px) scale(1);\n } \n \n .react-forms-material-checkbox .MuiCheckbox-root {\n transform: translate(0, 9px) scale(1);\n }\n \n /* allow forms to be embedded in dialogs - essentially replicate a few styles */\n .MuiDialog-container form {\n display: flex;\n }\n \n .MuiDialog-container form .MuiDialogContent-root {\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n }\n\n .MuiDialog-container form .MuiDialogActions-root {\n align-self: flex-end;\n }\n \n .react-forms input::-webkit-outer-spin-button,\n .react-forms input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n .react-forms input[type=number] {\n -moz-appearance: textfield;\n }\n`)\n\n\n"],"mappings":";;AAAA;AAA+D;AAE/D,IAAAA,qBAAS,EAAC,6BAA6B,umCA8CrC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danderson00/react-forms-material",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.42",
|
|
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.
|
|
13
|
+
"@danderson00/react-forms": "0.0.42",
|
|
14
14
|
"@material-ui/core": "^4.11.3"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
package/src/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createElement } from 'react'
|
|
2
|
-
import { FormProvider, Group, context, createRawConsumer, wrapInput, wrapSubmit, useFormValues } from '@danderson00/react-forms'
|
|
2
|
+
import { FormProvider, Group, context, createRawConsumer, wrapInput, wrapSubmit, useForm, useFormValues } from '@danderson00/react-forms'
|
|
3
3
|
import { extractErrorMessage } from '@danderson00/react-forms/dist/ErrorMessage'
|
|
4
4
|
import MuiButton from '@material-ui/core/Button'
|
|
5
5
|
import MuiCheckbox from '@material-ui/core/Checkbox'
|
|
@@ -17,7 +17,7 @@ export const ErrorMessage = ({ error }) => createElement(MuiFormHelperText, { ch
|
|
|
17
17
|
export const Form = FormProvider(context.Provider, { margin: 'dense' }, ErrorMessage)
|
|
18
18
|
export const Submit = wrapSubmit(MuiButton)
|
|
19
19
|
export const Button = MuiButton
|
|
20
|
-
export { useFormValues, Group, wrapInput }
|
|
20
|
+
export { useForm, useFormValues, Group, wrapInput }
|
|
21
21
|
|
|
22
22
|
const wrapped = (component, options, baseOptions) => wrapInput(
|
|
23
23
|
base(component, options, baseOptions),
|