dynamic-formik-form 1.0.3 → 1.0.4
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 +22 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -91,16 +91,25 @@ var defaultAdapter = {
|
|
|
91
91
|
)
|
|
92
92
|
};
|
|
93
93
|
var createMUIAdapter = (Box, Button, Checkbox, FormControl, FormControlLabel, FormHelperText, IconButton, MenuItem, Paper, Popover, Radio, RadioGroup, Switch, TextField2, Typography, DatePicker, DateTimePicker) => {
|
|
94
|
+
const filterMUIProps = (props) => {
|
|
95
|
+
const filtered = { ...props };
|
|
96
|
+
delete filtered.error;
|
|
97
|
+
delete filtered.fullWidth;
|
|
98
|
+
delete filtered.select;
|
|
99
|
+
delete filtered.multiline;
|
|
100
|
+
delete filtered.variant;
|
|
101
|
+
return filtered;
|
|
102
|
+
};
|
|
94
103
|
return {
|
|
95
104
|
Input: ({ className, disabled, error, type, ...props }) => {
|
|
96
|
-
const
|
|
105
|
+
const filteredProps = filterMUIProps(props);
|
|
97
106
|
return /* @__PURE__ */ jsx(
|
|
98
107
|
TextField2,
|
|
99
108
|
{
|
|
100
|
-
...
|
|
109
|
+
...filteredProps,
|
|
101
110
|
type,
|
|
102
111
|
disabled,
|
|
103
|
-
error:
|
|
112
|
+
...error ? { error: true } : {},
|
|
104
113
|
className,
|
|
105
114
|
fullWidth: true,
|
|
106
115
|
variant: "outlined"
|
|
@@ -108,15 +117,15 @@ var createMUIAdapter = (Box, Button, Checkbox, FormControl, FormControlLabel, Fo
|
|
|
108
117
|
);
|
|
109
118
|
},
|
|
110
119
|
Textarea: ({ className, disabled, error, rows, ...props }) => {
|
|
111
|
-
const
|
|
120
|
+
const filteredProps = filterMUIProps(props);
|
|
112
121
|
return /* @__PURE__ */ jsx(
|
|
113
122
|
TextField2,
|
|
114
123
|
{
|
|
115
|
-
...
|
|
124
|
+
...filteredProps,
|
|
116
125
|
multiline: true,
|
|
117
126
|
rows: rows || 4,
|
|
118
127
|
disabled,
|
|
119
|
-
error:
|
|
128
|
+
...error ? { error: true } : {},
|
|
120
129
|
className,
|
|
121
130
|
fullWidth: true,
|
|
122
131
|
variant: "outlined"
|
|
@@ -124,14 +133,14 @@ var createMUIAdapter = (Box, Button, Checkbox, FormControl, FormControlLabel, Fo
|
|
|
124
133
|
);
|
|
125
134
|
},
|
|
126
135
|
Select: ({ className, disabled, error, children, ...props }) => {
|
|
127
|
-
const
|
|
136
|
+
const filteredProps = filterMUIProps(props);
|
|
128
137
|
return /* @__PURE__ */ jsx(
|
|
129
138
|
TextField2,
|
|
130
139
|
{
|
|
131
|
-
...
|
|
140
|
+
...filteredProps,
|
|
132
141
|
select: true,
|
|
133
142
|
disabled,
|
|
134
|
-
error:
|
|
143
|
+
...error ? { error: true } : {},
|
|
135
144
|
className,
|
|
136
145
|
fullWidth: true,
|
|
137
146
|
variant: "outlined",
|
|
@@ -194,7 +203,7 @@ var createMUIAdapter = (Box, Button, Checkbox, FormControl, FormControlLabel, Fo
|
|
|
194
203
|
{
|
|
195
204
|
className,
|
|
196
205
|
required,
|
|
197
|
-
error:
|
|
206
|
+
...error ? { error: true } : {},
|
|
198
207
|
fullWidth: true,
|
|
199
208
|
children
|
|
200
209
|
}
|
|
@@ -257,7 +266,7 @@ var createMUIAdapter = (Box, Button, Checkbox, FormControl, FormControlLabel, Fo
|
|
|
257
266
|
}
|
|
258
267
|
) : void 0,
|
|
259
268
|
TextField: TextField2 ? ({ inputRef, inputProps, label, id, error, helperText, ...props }) => {
|
|
260
|
-
const
|
|
269
|
+
const filteredProps = filterMUIProps(props);
|
|
261
270
|
return /* @__PURE__ */ jsx(
|
|
262
271
|
TextField2,
|
|
263
272
|
{
|
|
@@ -265,9 +274,9 @@ var createMUIAdapter = (Box, Button, Checkbox, FormControl, FormControlLabel, Fo
|
|
|
265
274
|
inputProps,
|
|
266
275
|
label,
|
|
267
276
|
id,
|
|
268
|
-
error:
|
|
277
|
+
...error ? { error: true } : {},
|
|
269
278
|
helperText,
|
|
270
|
-
...
|
|
279
|
+
...filteredProps,
|
|
271
280
|
fullWidth: true,
|
|
272
281
|
variant: "outlined"
|
|
273
282
|
}
|