trithuc-mvc-react 2.4.2 → 2.4.3

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.
@@ -91,6 +91,29 @@ function FormField({
91
91
  />
92
92
  );
93
93
  case "text":
94
+ case "color":
95
+ return (
96
+ <Controller
97
+ name={name}
98
+ control={control}
99
+ render={({ field, fieldState: { error } }) => {
100
+ return (
101
+ <TextField
102
+ {...field}
103
+ type={type}
104
+ label={label + (required ? "*" : "")}
105
+ error={Boolean(error)}
106
+ helperText={error?.message}
107
+ fullWidth
108
+ placeholder={label}
109
+ disabled={disabled}
110
+ size={size}
111
+ {...rest}
112
+ />
113
+ );
114
+ }}
115
+ />
116
+ );
94
117
  case "number":
95
118
  return (
96
119
  <Controller
@@ -26,7 +26,7 @@ DataManagement.propTypes = {
26
26
  field: PropTypes.string,
27
27
  label: PropTypes.string,
28
28
  placeHolder: PropTypes.string,
29
- type: PropTypes.oneOf(["text", "number", "date", "autocomplete", "checkbox", "radio", "switch"]),
29
+ type: PropTypes.oneOf(["text", "color", "number", "date", "autocomplete", "checkbox", "radio", "switch"]),
30
30
  onChangeAfter: PropTypes.func,
31
31
  filters: PropTypes.array
32
32
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trithuc-mvc-react",
3
- "version": "2.4.2",
3
+ "version": "2.4.3",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"