@danderson00/react-forms-material 0.0.17 → 0.0.21
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/README.md +19 -0
- package/dist/index.js +6 -2
- package/dist/styles.js +1 -1
- package/package.json +3 -3
- package/src/index.js +3 -1
- package/src/styles.js +15 -0
package/README.md
CHANGED
|
@@ -124,3 +124,22 @@ component.
|
|
|
124
124
|
|
|
125
125
|
Renders a field component with a Material UI [`Checkbox` component](https://material-ui.com/api/checkbox/) as the
|
|
126
126
|
input component.
|
|
127
|
+
|
|
128
|
+
## License
|
|
129
|
+
|
|
130
|
+
**The MIT License (MIT)**
|
|
131
|
+
|
|
132
|
+
Copyright © 2022 Dale Anderson
|
|
133
|
+
|
|
134
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
|
135
|
+
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
|
|
136
|
+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
137
|
+
persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
138
|
+
|
|
139
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
|
|
140
|
+
Software.
|
|
141
|
+
|
|
142
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
|
143
|
+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
144
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
145
|
+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@ Object.defineProperty(exports, "useFormValues", {
|
|
|
10
10
|
return _reactForms.useFormValues;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
+
exports.wrapField = void 0;
|
|
13
14
|
|
|
14
15
|
var _react = require("react");
|
|
15
16
|
|
|
@@ -39,7 +40,7 @@ var _Select = _interopRequireDefault(require("@material-ui/core/Select"));
|
|
|
39
40
|
|
|
40
41
|
require("./styles");
|
|
41
42
|
|
|
42
|
-
var _excluded = ["className", "error", "hiddenLabel", "variant", "margin", "label", "helperText", "shrinkLabel"],
|
|
43
|
+
var _excluded = ["className", "error", "hiddenLabel", "variant", "margin", "label", "helperText", "shrinkLabel", "valid"],
|
|
43
44
|
_excluded2 = ["name", "values", "labels", "numeric", "required", "getFieldValue", "getFieldValues"],
|
|
44
45
|
_excluded3 = ["values", "labels"];
|
|
45
46
|
|
|
@@ -108,6 +109,7 @@ var base = function base(component) {
|
|
|
108
109
|
label = _ref3.label,
|
|
109
110
|
helperText = _ref3.helperText,
|
|
110
111
|
shrinkLabel = _ref3.shrinkLabel,
|
|
112
|
+
valid = _ref3.valid,
|
|
111
113
|
inputProps = _objectWithoutProperties(_ref3, _excluded);
|
|
112
114
|
|
|
113
115
|
return /*#__PURE__*/(0, _react.createElement)(_FormControl["default"], {
|
|
@@ -203,4 +205,6 @@ var Select = wrapped(function (_ref5) {
|
|
|
203
205
|
}, {
|
|
204
206
|
alwaysShrinkLabel: true
|
|
205
207
|
});
|
|
206
|
-
exports.Select = Select;
|
|
208
|
+
exports.Select = Select;
|
|
209
|
+
var wrapField = wrapped;
|
|
210
|
+
exports.wrapField = wrapField;
|
package/dist/styles.js
CHANGED
|
@@ -4,4 +4,4 @@ var _injectCss = _interopRequireDefault(require("@danderson00/react-forms/dist/i
|
|
|
4
4
|
|
|
5
5
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
6
6
|
|
|
7
|
-
(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");
|
|
7
|
+
(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");
|
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.21",
|
|
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 false --out-dir dist"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@danderson00/react-forms": "0.0.
|
|
13
|
+
"@danderson00/react-forms": "0.0.21",
|
|
14
14
|
"@material-ui/core": "^4.11.3"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"ui"
|
|
53
53
|
],
|
|
54
54
|
"author": "danderson00",
|
|
55
|
-
"license": "
|
|
55
|
+
"license": "MIT",
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
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 } = {}) => (
|
|
28
|
-
({ className, error, hiddenLabel, variant, margin, label, helperText, shrinkLabel, ...inputProps }) => (
|
|
28
|
+
({ className, error, hiddenLabel, variant, margin, label, helperText, shrinkLabel, valid, ...inputProps }) => (
|
|
29
29
|
createElement(MuiFormControl, {
|
|
30
30
|
className: `react-forms-material-field${options.type ? ` react-forms-material-${options.type}` : ''}${className ? ` ${className}` : ''}`,
|
|
31
31
|
error,
|
|
@@ -93,3 +93,5 @@ export const Select = wrapped(({ values, labels, ...props }) =>
|
|
|
93
93
|
{ type: 'select' },
|
|
94
94
|
{ alwaysShrinkLabel: true }
|
|
95
95
|
)
|
|
96
|
+
|
|
97
|
+
export const wrapField = wrapped
|
package/src/styles.js
CHANGED
|
@@ -21,6 +21,21 @@ injectCss('react-forms-material-styles', `
|
|
|
21
21
|
.react-forms-material-checkbox .MuiCheckbox-root {
|
|
22
22
|
transform: translate(0, 9px) scale(1);
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
/* allow forms to be embedded in dialogs - essentially replicate a few styles */
|
|
26
|
+
.MuiDialog-container form {
|
|
27
|
+
display: flex;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.MuiDialog-container form .MuiDialogContent-root {
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: flex-start;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.MuiDialog-container form .MuiDialogActions-root {
|
|
37
|
+
align-self: flex-end;
|
|
38
|
+
}
|
|
24
39
|
`)
|
|
25
40
|
|
|
26
41
|
|