@rjsf/chakra-ui 5.18.3 → 5.18.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rjsf/chakra-ui",
3
- "version": "5.18.3",
3
+ "version": "5.18.5",
4
4
  "description": "Chakra UI theme, fields, and widgets for react-jsonschema-form",
5
5
  "main": "dist/index.js",
6
6
  "module": "lib/index.js",
@@ -68,10 +68,10 @@
68
68
  "@emotion/jest": "^11.11.0",
69
69
  "@emotion/react": "^11.11.3",
70
70
  "@emotion/styled": "^11.11.0",
71
- "@rjsf/core": "^5.18.3",
72
- "@rjsf/snapshot-tests": "^5.18.3",
73
- "@rjsf/utils": "^5.18.3",
74
- "@rjsf/validator-ajv8": "^5.18.3",
71
+ "@rjsf/core": "^5.18.5",
72
+ "@rjsf/snapshot-tests": "^5.18.5",
73
+ "@rjsf/utils": "^5.18.5",
74
+ "@rjsf/validator-ajv8": "^5.18.5",
75
75
  "@types/jest": "^29.5.12",
76
76
  "@types/react": "^18.2.58",
77
77
  "@types/react-dom": "^18.2.19",
@@ -94,5 +94,5 @@
94
94
  "dependencies": {
95
95
  "react-select": "^5.8.0"
96
96
  },
97
- "gitHead": "2fe849078afa19e2233d84f6d870da847d22094d"
97
+ "gitHead": "d5ef055f1b40c8837c13126777478bfc30dc9ade"
98
98
  }
@@ -42,8 +42,8 @@ export default function BaseInputTemplate<
42
42
 
43
43
  const _onChange = ({ target: { value } }: ChangeEvent<HTMLInputElement>) =>
44
44
  onChange(value === '' ? options.emptyValue : value);
45
- const _onBlur = ({ target: { value } }: FocusEvent<HTMLInputElement>) => onBlur(id, value);
46
- const _onFocus = ({ target: { value } }: FocusEvent<HTMLInputElement>) => onFocus(id, value);
45
+ const _onBlur = ({ target }: FocusEvent<HTMLInputElement>) => onBlur(id, target && target.value);
46
+ const _onFocus = ({ target }: FocusEvent<HTMLInputElement>) => onFocus(id, target && target.value);
47
47
 
48
48
  return (
49
49
  <FormControl
@@ -46,8 +46,8 @@ export default function CheckboxWidget<
46
46
  const description = options.description || schema.description;
47
47
 
48
48
  const _onChange = ({ target: { checked } }: ChangeEvent<HTMLInputElement>) => onChange(checked);
49
- const _onBlur = ({ target: { value } }: FocusEvent<HTMLInputElement | any>) => onBlur(id, value);
50
- const _onFocus = ({ target: { value } }: FocusEvent<HTMLInputElement | any>) => onFocus(id, value);
49
+ const _onBlur = ({ target }: FocusEvent<HTMLInputElement | any>) => onBlur(id, target && target.value);
50
+ const _onFocus = ({ target }: FocusEvent<HTMLInputElement | any>) => onFocus(id, target && target.value);
51
51
 
52
52
  return (
53
53
  <FormControl mb={1} {...chakraProps} isRequired={required}>
@@ -38,10 +38,10 @@ export default function CheckboxesWidget<
38
38
  const chakraProps = getChakra({ uiSchema });
39
39
  const checkboxesValues = Array.isArray(value) ? value : [value];
40
40
 
41
- const _onBlur = ({ target: { value } }: FocusEvent<HTMLInputElement | any>) =>
42
- onBlur(id, enumOptionsValueForIndex<S>(value, enumOptions, emptyValue));
43
- const _onFocus = ({ target: { value } }: FocusEvent<HTMLInputElement | any>) =>
44
- onFocus(id, enumOptionsValueForIndex<S>(value, enumOptions, emptyValue));
41
+ const _onBlur = ({ target }: FocusEvent<HTMLInputElement | any>) =>
42
+ onBlur(id, enumOptionsValueForIndex<S>(target && target.value, enumOptions, emptyValue));
43
+ const _onFocus = ({ target }: FocusEvent<HTMLInputElement | any>) =>
44
+ onFocus(id, enumOptionsValueForIndex<S>(target && target.value, enumOptions, emptyValue));
45
45
 
46
46
  const row = options ? options.inline : false;
47
47
  const selectedIndexes = enumOptionsIndexForValue<S>(value, enumOptions, true) as string[];
@@ -30,8 +30,8 @@ export default function RangeWidget<T = any, S extends StrictRJSFSchema = RJSFSc
30
30
  const sliderWidgetProps = { value, label, id, ...rangeSpec<S>(schema) };
31
31
 
32
32
  const _onChange = (value: undefined | number) => onChange(value === undefined ? options.emptyValue : value);
33
- const _onBlur = ({ target: { value } }: FocusEvent<HTMLInputElement>) => onBlur(id, value);
34
- const _onFocus = ({ target: { value } }: FocusEvent<HTMLInputElement>) => onFocus(id, value);
33
+ const _onBlur = ({ target }: FocusEvent<HTMLInputElement>) => onBlur(id, target && target.value);
34
+ const _onFocus = ({ target }: FocusEvent<HTMLInputElement>) => onFocus(id, target && target.value);
35
35
 
36
36
  return (
37
37
  <FormControl mb={1} {...chakraProps}>
@@ -54,11 +54,11 @@ export default function SelectWidget<T = any, S extends StrictRJSFSchema = RJSFS
54
54
  return onChange(enumOptionsValueForIndex<S>(e.value, enumOptions, emptyValue));
55
55
  };
56
56
 
57
- const _onBlur = ({ target: { value } }: FocusEvent<HTMLInputElement>) =>
58
- onBlur(id, enumOptionsValueForIndex<S>(value, enumOptions, emptyValue));
57
+ const _onBlur = ({ target }: FocusEvent<HTMLInputElement>) =>
58
+ onBlur(id, enumOptionsValueForIndex<S>(target && target.value, enumOptions, emptyValue));
59
59
 
60
- const _onFocus = ({ target: { value } }: FocusEvent<HTMLInputElement>) =>
61
- onFocus(id, enumOptionsValueForIndex<S>(value, enumOptions, emptyValue));
60
+ const _onFocus = ({ target }: FocusEvent<HTMLInputElement>) =>
61
+ onFocus(id, enumOptionsValueForIndex<S>(target && target.value, enumOptions, emptyValue));
62
62
 
63
63
  const _valueLabelMap: any = {};
64
64
  const displayEnumOptions: OptionsOrGroups<any, any> = Array.isArray(enumOptions)
@@ -35,8 +35,8 @@ export default function TextareaWidget<
35
35
 
36
36
  const _onChange = ({ target: { value } }: ChangeEvent<HTMLTextAreaElement>) =>
37
37
  onChange(value === '' ? options.emptyValue : value);
38
- const _onBlur = ({ target: { value } }: FocusEvent<HTMLTextAreaElement>) => onBlur(id, value);
39
- const _onFocus = ({ target: { value } }: FocusEvent<HTMLTextAreaElement>) => onFocus(id, value);
38
+ const _onBlur = ({ target }: FocusEvent<HTMLTextAreaElement>) => onBlur(id, target && target.value);
39
+ const _onFocus = ({ target }: FocusEvent<HTMLTextAreaElement>) => onFocus(id, target && target.value);
40
40
 
41
41
  return (
42
42
  <FormControl
@@ -27,8 +27,8 @@ export default function UpDownWidget<T = any, S extends StrictRJSFSchema = RJSFS
27
27
  const chakraProps = getChakra({ uiSchema });
28
28
 
29
29
  const _onChange = (value: string | number) => onChange(value);
30
- const _onBlur = ({ target: { value } }: FocusEvent<HTMLInputElement | any>) => onBlur(id, value);
31
- const _onFocus = ({ target: { value } }: FocusEvent<HTMLInputElement | any>) => onFocus(id, value);
30
+ const _onBlur = ({ target }: FocusEvent<HTMLInputElement | any>) => onBlur(id, target && target.value);
31
+ const _onFocus = ({ target }: FocusEvent<HTMLInputElement | any>) => onFocus(id, target && target.value);
32
32
 
33
33
  return (
34
34
  <FormControl