@elliemae/ds-form 2.0.0-rc.8 → 2.0.1
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/cjs/ComboBox/v1/DSComboBox.js +18 -22
- package/cjs/ComboBox/v1/withSelectStringValueConverter.js +3 -4
- package/cjs/ComboBox/v3/ComboBoxCTX.js +16 -17
- package/cjs/ComboBox/v3/config/useComboBox.js +6 -6
- package/cjs/ComboBox/v3/parts/container/Container.js +1 -1
- package/cjs/ComboBox/v3/parts/controls-input/ControlsInput.js +5 -3
- package/cjs/ComboBox/v3/parts/controls-input/useControlsInput.js +8 -8
- package/cjs/ComboBox/v3/parts/header-list/HeaderList.js +5 -3
- package/cjs/ComboBox/v3/parts/menu-list/MenuList.js +7 -8
- package/cjs/ComboBox/v3/parts/menu-list/styled.js +8 -4
- package/cjs/ComboBox/v3/parts/menu-list/useItemRenderer.js +10 -9
- package/cjs/ComboBox/v3/utils/hooks/useKeyboardNavigation.js +5 -5
- package/cjs/ComboBox/v3/utils/hooks/useOnElementResize.js +4 -4
- package/cjs/FloatingLabelInput/FloatingLabelInputImpl.js +4 -7
- package/cjs/FormItem/ValidationFieldWrapper.js +2 -3
- package/cjs/Input/InputAddonWrapper.js +2 -3
- package/cjs/Input/InputImpl.js +16 -18
- package/cjs/InputGroup/AddonWrapper.js +4 -6
- package/cjs/InputMask/DSInputMaskDeprecated.js +10 -12
- package/cjs/SearchBox/NavSearchBox.js +5 -1
- package/cjs/SearchBox/withSearchable.js +3 -5
- package/cjs/Toggle/DSToggleImpl.js +28 -28
- package/esm/ComboBox/v1/DSComboBox.js +17 -21
- package/esm/ComboBox/v1/withSelectStringValueConverter.js +3 -4
- package/esm/ComboBox/v3/ComboBoxCTX.js +5 -6
- package/esm/ComboBox/v3/config/useComboBox.js +6 -6
- package/esm/ComboBox/v3/parts/container/Container.js +1 -1
- package/esm/ComboBox/v3/parts/controls-input/ControlsInput.js +5 -3
- package/esm/ComboBox/v3/parts/controls-input/useControlsInput.js +8 -8
- package/esm/ComboBox/v3/parts/header-list/HeaderList.js +5 -3
- package/esm/ComboBox/v3/parts/menu-list/MenuList.js +8 -9
- package/esm/ComboBox/v3/parts/menu-list/styled.js +8 -4
- package/esm/ComboBox/v3/parts/menu-list/useItemRenderer.js +10 -9
- package/esm/ComboBox/v3/utils/hooks/useKeyboardNavigation.js +5 -5
- package/esm/ComboBox/v3/utils/hooks/useOnElementResize.js +4 -4
- package/esm/FloatingLabelInput/FloatingLabelInputImpl.js +4 -7
- package/esm/FormItem/ValidationFieldWrapper.js +2 -3
- package/esm/Input/InputAddonWrapper.js +2 -3
- package/esm/Input/InputImpl.js +15 -17
- package/esm/InputGroup/AddonWrapper.js +5 -7
- package/esm/InputMask/DSInputMaskDeprecated.js +10 -12
- package/esm/SearchBox/NavSearchBox.js +5 -1
- package/esm/SearchBox/withSearchable.js +2 -4
- package/esm/Toggle/DSToggleImpl.js +28 -28
- package/package.json +31 -23
- package/types/ComboBox/v3/parts/controls-input/useControlsInput.d.ts +3 -3
- package/types/ComboBox/v3/parts/menu-list/styled.d.ts +4 -3
- package/types/ComboBox/v3/parts/menu-list/useItemRenderer.d.ts +1 -1
- package/types/ComboBox/v3/utils/hooks/useKeyboardNavigation.d.ts +4 -1
- package/types/ComboBox/v3/utils/listHelper.d.ts +1 -1
- package/types/SearchBox/index.d.ts +1 -1
- package/cjs/ComboBox/v3/utils/hooks/useOnWindowResize.js +0 -31
- package/esm/ComboBox/v3/utils/hooks/useOnWindowResize.js +0 -27
- package/types/ComboBox/v3/utils/hooks/useOnWindowResize.d.ts +0 -5
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
require('core-js/modules/web.dom-collections.iterator.js');
|
|
6
|
-
var React = require('react');
|
|
7
|
-
|
|
8
|
-
// Taken and modified from https://stackoverflow.com/a/60218754
|
|
9
|
-
|
|
10
|
-
const useDimensions = targetRef => {
|
|
11
|
-
const queryDimension = React.useCallback(dimension => targetRef.current ? targetRef.current[dimension] : 0, []);
|
|
12
|
-
const [width, setWidth] = React.useState(targetRef.current ? targetRef.current.offsetWidth : 0);
|
|
13
|
-
const [height, setHeight] = React.useState(targetRef.current ? targetRef.current.offsetWidth : 0);
|
|
14
|
-
const handleResize = React.useCallback(() => {
|
|
15
|
-
setWidth(queryDimension('offsetWidth'));
|
|
16
|
-
setHeight(queryDimension('offsetHeight'));
|
|
17
|
-
}, []);
|
|
18
|
-
React.useEffect(() => {
|
|
19
|
-
window.addEventListener('resize', handleResize);
|
|
20
|
-
return () => window.removeEventListener('resize', handleResize);
|
|
21
|
-
}, []);
|
|
22
|
-
React.useLayoutEffect(() => {
|
|
23
|
-
handleResize();
|
|
24
|
-
}, []);
|
|
25
|
-
return React.useMemo(() => ({
|
|
26
|
-
width,
|
|
27
|
-
height
|
|
28
|
-
}), [width, height]);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
exports.useDimensions = useDimensions;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
2
|
-
import { useCallback, useState, useEffect, useLayoutEffect, useMemo } from 'react';
|
|
3
|
-
|
|
4
|
-
// Taken and modified from https://stackoverflow.com/a/60218754
|
|
5
|
-
|
|
6
|
-
const useDimensions = targetRef => {
|
|
7
|
-
const queryDimension = useCallback(dimension => targetRef.current ? targetRef.current[dimension] : 0, []);
|
|
8
|
-
const [width, setWidth] = useState(targetRef.current ? targetRef.current.offsetWidth : 0);
|
|
9
|
-
const [height, setHeight] = useState(targetRef.current ? targetRef.current.offsetWidth : 0);
|
|
10
|
-
const handleResize = useCallback(() => {
|
|
11
|
-
setWidth(queryDimension('offsetWidth'));
|
|
12
|
-
setHeight(queryDimension('offsetHeight'));
|
|
13
|
-
}, []);
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
window.addEventListener('resize', handleResize);
|
|
16
|
-
return () => window.removeEventListener('resize', handleResize);
|
|
17
|
-
}, []);
|
|
18
|
-
useLayoutEffect(() => {
|
|
19
|
-
handleResize();
|
|
20
|
-
}, []);
|
|
21
|
-
return useMemo(() => ({
|
|
22
|
-
width,
|
|
23
|
-
height
|
|
24
|
-
}), [width, height]);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export { useDimensions };
|