@etsoo/materialui 1.0.39 → 1.0.40

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/lib/DataSteps.js CHANGED
@@ -64,6 +64,10 @@ export function DataSteps(props) {
64
64
  }
65
65
  });
66
66
  };
67
+ const cancelInput = (event) => {
68
+ event.stopPropagation();
69
+ event.preventDefault();
70
+ };
67
71
  React.useEffect(() => {
68
72
  if (jsonValue) {
69
73
  dataRef.current = JSON.parse(jsonValue);
@@ -71,9 +75,10 @@ export function DataSteps(props) {
71
75
  }
72
76
  }, [jsonValue]);
73
77
  return (React.createElement(TextField, { InputLabelProps: InputLabelProps, InputProps: {
74
- readOnly: true,
78
+ onKeyDown: cancelInput,
79
+ onPaste: cancelInput,
75
80
  endAdornment: (React.createElement(InputAdornment, { position: "end" },
76
81
  React.createElement(IconButton, { edge: "end", size: "small" },
77
82
  React.createElement(StartIcon, null))))
78
- }, onClick: () => showStep(0), value: localValue, ...rest }));
83
+ }, sx: { cursor: 'pointer' }, onClick: () => showStep(0), value: localValue, ...rest }));
79
84
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.0.39",
3
+ "version": "1.0.40",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
package/src/DataSteps.tsx CHANGED
@@ -166,6 +166,11 @@ export function DataSteps<T extends object>(props: DataStepsProps<T>) {
166
166
  });
167
167
  };
168
168
 
169
+ const cancelInput = (event: React.SyntheticEvent) => {
170
+ event.stopPropagation();
171
+ event.preventDefault();
172
+ };
173
+
169
174
  React.useEffect(() => {
170
175
  if (jsonValue) {
171
176
  dataRef.current = JSON.parse(jsonValue);
@@ -177,7 +182,8 @@ export function DataSteps<T extends object>(props: DataStepsProps<T>) {
177
182
  <TextField
178
183
  InputLabelProps={InputLabelProps}
179
184
  InputProps={{
180
- readOnly: true,
185
+ onKeyDown: cancelInput,
186
+ onPaste: cancelInput,
181
187
  endAdornment: (
182
188
  <InputAdornment position="end">
183
189
  <IconButton edge="end" size="small">
@@ -186,6 +192,7 @@ export function DataSteps<T extends object>(props: DataStepsProps<T>) {
186
192
  </InputAdornment>
187
193
  )
188
194
  }}
195
+ sx={{ cursor: 'pointer' }}
189
196
  onClick={() => showStep(0)}
190
197
  value={localValue}
191
198
  {...rest}