@onehat/ui 0.3.237 → 0.3.238

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": "@onehat/ui",
3
- "version": "0.3.237",
3
+ "version": "0.3.238",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -2,9 +2,7 @@ import React, { useState, useEffect, useRef, } from 'react';
2
2
  import {
3
3
  Row,
4
4
  } from 'native-base';
5
- import {
6
- AUTO_SUBMIT_DELAY,
7
- } from '../../../../Constants/Input.js';
5
+ import UiGlobals from '../../../../UiGlobals.js';
8
6
  import { CKEditor } from '@ckeditor/ckeditor5-react'; // https://ckeditor.com/docs/ckeditor5/latest/installation/frameworks/react.html
9
7
  import './ckeditor.css';
10
8
  import Editor from '../../../../../ckeditor5/build/ckeditor.js'; // built using https://ckeditor.com/ckeditor-5/online-builder/
@@ -19,6 +17,7 @@ const
19
17
  const {
20
18
  value,
21
19
  setValue,
20
+ autoSubmitDelay = UiGlobals.autoSubmitDelay,
22
21
  h = 150,
23
22
  } = props,
24
23
  debouncedSetValueRef = useRef(),
@@ -30,7 +29,7 @@ const
30
29
  useEffect(() => {
31
30
  // Set up debounce fn
32
31
  // Have to do this because otherwise, lodash tries to create a debounced version of the fn from only this render
33
- debouncedSetValueRef.current = _.debounce(setValue, AUTO_SUBMIT_DELAY);
32
+ debouncedSetValueRef.current = _.debounce(setValue, autoSubmitDelay);
34
33
  }, [setValue]);
35
34
 
36
35
  return <Row h={h} flex={1} ref={props.outerRef} {...props}>
@@ -3,9 +3,6 @@ import {
3
3
  Input,
4
4
  Tooltip,
5
5
  } from 'native-base';
6
- import {
7
- AUTO_SUBMIT_DELAY,
8
- } from '../../../Constants/Input.js';
9
6
  import UiGlobals from '../../../UiGlobals.js';
10
7
  import withComponent from '../../Hoc/withComponent.js';
11
8
  import withValue from '../../Hoc/withValue.js';
@@ -16,7 +13,7 @@ function InputElement(props) {
16
13
  value,
17
14
  setValue,
18
15
  autoSubmit = true, // automatically setValue after user stops typing for autoSubmitDelay
19
- autoSubmitDelay = AUTO_SUBMIT_DELAY,
16
+ autoSubmitDelay = UiGlobals.autoSubmitDelay,
20
17
  autoCapitalize = 'none',
21
18
  maxLength,
22
19
  onKeyPress,
@@ -5,9 +5,6 @@ import {
5
5
  Input,
6
6
  Row,
7
7
  } from 'native-base';
8
- import {
9
- AUTO_SUBMIT_DELAY,
10
- } from '../../../Constants/Input.js';
11
8
  import UiGlobals from '../../../UiGlobals.js';
12
9
  import IconButton from '../../Buttons/IconButton.js';
13
10
  import withComponent from '../../Hoc/withComponent.js';
@@ -25,6 +22,7 @@ function NumberElement(props) {
25
22
  setValue,
26
23
  minValue,
27
24
  maxValue,
25
+ autoSubmitDelay = UiGlobals.autoSubmitDelay,
28
26
  tooltip = null,
29
27
  isDisabled = false,
30
28
  } = props,
@@ -94,7 +92,7 @@ function NumberElement(props) {
94
92
  useEffect(() => {
95
93
  // Set up debounce fn
96
94
  // Have to do this because otherwise, lodash tries to create a debounced version of the fn from only this render
97
- debouncedSetValueRef.current = _.debounce(setValue, AUTO_SUBMIT_DELAY);
95
+ debouncedSetValueRef.current = _.debounce(setValue, autoSubmitDelay);
98
96
  }, [setValue]);
99
97
 
100
98
  useEffect(() => {
package/src/UiGlobals.js CHANGED
@@ -9,6 +9,9 @@ const Globals = {
9
9
  // global defaults
10
10
  paginationIsShowMoreOnly: false,
11
11
  autoAdjustPageSizeToHeight: true,
12
+ doubleClickingGridRowOpensEditorInViewMode: false,
13
+ disableSavedColumnsConfig: false,
14
+ autoSubmitDelay: 500,
12
15
  };
13
16
 
14
17
  export default Globals;
@@ -1 +0,0 @@
1
- export const AUTO_SUBMIT_DELAY = 500;