@dartech/arsenal-ui 1.3.65 → 1.3.67

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/index.js CHANGED
@@ -1212,30 +1212,30 @@ const deepParseJson = value => {
1212
1212
 
1213
1213
  const JsonView = /*#__PURE__*/forwardRef(({
1214
1214
  value,
1215
- height: _height = '200px',
1215
+ height: _height = 200,
1216
1216
  fontSize: _fontSize = 16
1217
1217
  }, ref) => {
1218
1218
  const [loading, setLoading] = useState(true);
1219
1219
  const onCreateEditor = useCallback(view => {
1220
1220
  const onScroll = e => {
1221
+ if (e.target.scrollTop === view.scrollDOM.scrollHeight - view.scrollDOM.offsetHeight) {
1222
+ setTimeout(() => view.scrollDOM.scrollTo(0, 0), 200);
1223
+ }
1221
1224
  if (e.target.scrollTop === 0) {
1222
1225
  setLoading(false);
1223
1226
  view.scrollDOM.removeEventListener('scroll', onScroll);
1224
1227
  }
1225
1228
  };
1226
- if (view.scrollDOM.scrollHeight > 38300) {
1229
+ if (view.scrollDOM.scrollHeight > 30000) {
1227
1230
  setLoading(true);
1228
1231
  view.scrollDOM.addEventListener('scroll', onScroll);
1229
- view.scrollDOM.scrollTo(0, view.scrollDOM.scrollHeight - 300);
1232
+ view.scrollDOM.scrollTo(0, view.scrollDOM.scrollHeight - 1000);
1230
1233
  setTimeout(() => {
1231
1234
  view.scrollDOM.scrollTo({
1232
1235
  top: view.scrollDOM.scrollHeight,
1233
1236
  behavior: 'smooth'
1234
1237
  });
1235
1238
  }, 300);
1236
- setTimeout(() => {
1237
- view.scrollDOM.scrollTo(0, 0);
1238
- }, 500);
1239
1239
  } else {
1240
1240
  setLoading(false);
1241
1241
  }
@@ -1250,7 +1250,7 @@ const JsonView = /*#__PURE__*/forwardRef(({
1250
1250
  readOnly: true,
1251
1251
  width: "100%",
1252
1252
  value: typeof value === 'string' ? value : JSON.stringify(value, null, 2),
1253
- height: _height,
1253
+ height: `${_height}px`,
1254
1254
  basicSetup: {
1255
1255
  autocompletion: true,
1256
1256
  history: true,
@@ -3124,7 +3124,7 @@ const InfoItem = ({
3124
3124
  children: text
3125
3125
  })), json && jsx(JsonView, {
3126
3126
  value: json,
3127
- height: "300px"
3127
+ height: 300
3128
3128
  })]
3129
3129
  }));
3130
3130
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dartech/arsenal-ui",
3
- "version": "1.3.65",
3
+ "version": "1.3.67",
4
4
  "author": "DAR",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -2,7 +2,7 @@
2
2
  import { ReactCodeMirrorRef } from '@uiw/react-codemirror';
3
3
  type Props = {
4
4
  value: unknown;
5
- height?: string;
5
+ height?: number;
6
6
  fontSize?: number;
7
7
  };
8
8
  export declare const JsonView: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<ReactCodeMirrorRef>>;
@@ -4,7 +4,7 @@ type Props = {
4
4
  value: string;
5
5
  onClose: () => void;
6
6
  jsonViewProps?: {
7
- height?: string;
7
+ height?: number;
8
8
  fontSize?: number;
9
9
  };
10
10
  };