@etsoo/materialui 1.0.63 → 1.0.65

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.
@@ -50,14 +50,17 @@ export function TwoFieldInput(props) {
50
50
  return DateUtils.formatForInput(v, true);
51
51
  return v;
52
52
  };
53
+ React.useEffect(() => {
54
+ valueRef.current = localValues;
55
+ }, [localValues]);
53
56
  // Layout
54
- return (React.createElement(InputField, { name: `${name}-start`, type: type, defaultValue: formatValue(localValues[0], type), ref: dimensions[0][0], inputProps: inputProps, InputProps: {
57
+ return (React.createElement(InputField, { name: `${name}-start`, type: type, value: formatValue(localValues[0], type), ref: dimensions[0][0], inputProps: inputProps, InputProps: {
55
58
  endAdornment: (React.createElement(InputAdornment, { position: "end", sx: {
56
59
  display: 'flex',
57
60
  alignItems: 'center',
58
61
  gap: 1
59
62
  } },
60
63
  React.createElement(ArrowRightAltIcon, null),
61
- React.createElement(Input, { type: type, name: `${name}-end`, defaultValue: formatValue(localValues[1], type), disableUnderline: true, onInput: onInput, onChange: handleChange, inputProps: inputProps })))
64
+ React.createElement(Input, { type: type, name: `${name}-end`, value: formatValue(localValues[1], type), disableUnderline: true, onInput: onInput, onChange: handleChange, inputProps: inputProps })))
62
65
  }, onInput: onInput, onChange: handleChange, ...rest }));
63
66
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.0.63",
3
+ "version": "1.0.65",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -54,7 +54,7 @@
54
54
  "@etsoo/appscript": "^1.3.29",
55
55
  "@etsoo/notificationbase": "^1.1.14",
56
56
  "@etsoo/react": "^1.6.24",
57
- "@etsoo/shared": "^1.1.73",
57
+ "@etsoo/shared": "^1.1.74",
58
58
  "@mui/icons-material": "^5.10.9",
59
59
  "@mui/material": "^5.10.13",
60
60
  "@types/pica": "^9.0.1",
@@ -89,8 +89,8 @@
89
89
  "eslint-config-airbnb-base": "^15.0.0",
90
90
  "eslint-plugin-import": "^2.26.0",
91
91
  "eslint-plugin-react": "^7.31.10",
92
- "jest": "^29.3.0",
93
- "jest-environment-jsdom": "^29.3.0",
92
+ "jest": "^29.3.1",
93
+ "jest-environment-jsdom": "^29.3.1",
94
94
  "ts-jest": "^29.0.3",
95
95
  "typescript": "^4.8.4"
96
96
  }
@@ -88,12 +88,16 @@ export function TwoFieldInput(props: TwoFieldInputProps) {
88
88
  return v;
89
89
  };
90
90
 
91
+ React.useEffect(() => {
92
+ valueRef.current = localValues;
93
+ }, [localValues]);
94
+
91
95
  // Layout
92
96
  return (
93
97
  <InputField
94
98
  name={`${name}-start`}
95
99
  type={type}
96
- defaultValue={formatValue(localValues[0], type)}
100
+ value={formatValue(localValues[0], type)}
97
101
  ref={dimensions[0][0]}
98
102
  inputProps={inputProps}
99
103
  InputProps={{
@@ -110,7 +114,7 @@ export function TwoFieldInput(props: TwoFieldInputProps) {
110
114
  <Input
111
115
  type={type}
112
116
  name={`${name}-end`}
113
- defaultValue={formatValue(localValues[1], type)}
117
+ value={formatValue(localValues[1], type)}
114
118
  disableUnderline
115
119
  onInput={onInput}
116
120
  onChange={handleChange}