@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.
Files changed (54) hide show
  1. package/cjs/ComboBox/v1/DSComboBox.js +18 -22
  2. package/cjs/ComboBox/v1/withSelectStringValueConverter.js +3 -4
  3. package/cjs/ComboBox/v3/ComboBoxCTX.js +16 -17
  4. package/cjs/ComboBox/v3/config/useComboBox.js +6 -6
  5. package/cjs/ComboBox/v3/parts/container/Container.js +1 -1
  6. package/cjs/ComboBox/v3/parts/controls-input/ControlsInput.js +5 -3
  7. package/cjs/ComboBox/v3/parts/controls-input/useControlsInput.js +8 -8
  8. package/cjs/ComboBox/v3/parts/header-list/HeaderList.js +5 -3
  9. package/cjs/ComboBox/v3/parts/menu-list/MenuList.js +7 -8
  10. package/cjs/ComboBox/v3/parts/menu-list/styled.js +8 -4
  11. package/cjs/ComboBox/v3/parts/menu-list/useItemRenderer.js +10 -9
  12. package/cjs/ComboBox/v3/utils/hooks/useKeyboardNavigation.js +5 -5
  13. package/cjs/ComboBox/v3/utils/hooks/useOnElementResize.js +4 -4
  14. package/cjs/FloatingLabelInput/FloatingLabelInputImpl.js +4 -7
  15. package/cjs/FormItem/ValidationFieldWrapper.js +2 -3
  16. package/cjs/Input/InputAddonWrapper.js +2 -3
  17. package/cjs/Input/InputImpl.js +16 -18
  18. package/cjs/InputGroup/AddonWrapper.js +4 -6
  19. package/cjs/InputMask/DSInputMaskDeprecated.js +10 -12
  20. package/cjs/SearchBox/NavSearchBox.js +5 -1
  21. package/cjs/SearchBox/withSearchable.js +3 -5
  22. package/cjs/Toggle/DSToggleImpl.js +28 -28
  23. package/esm/ComboBox/v1/DSComboBox.js +17 -21
  24. package/esm/ComboBox/v1/withSelectStringValueConverter.js +3 -4
  25. package/esm/ComboBox/v3/ComboBoxCTX.js +5 -6
  26. package/esm/ComboBox/v3/config/useComboBox.js +6 -6
  27. package/esm/ComboBox/v3/parts/container/Container.js +1 -1
  28. package/esm/ComboBox/v3/parts/controls-input/ControlsInput.js +5 -3
  29. package/esm/ComboBox/v3/parts/controls-input/useControlsInput.js +8 -8
  30. package/esm/ComboBox/v3/parts/header-list/HeaderList.js +5 -3
  31. package/esm/ComboBox/v3/parts/menu-list/MenuList.js +8 -9
  32. package/esm/ComboBox/v3/parts/menu-list/styled.js +8 -4
  33. package/esm/ComboBox/v3/parts/menu-list/useItemRenderer.js +10 -9
  34. package/esm/ComboBox/v3/utils/hooks/useKeyboardNavigation.js +5 -5
  35. package/esm/ComboBox/v3/utils/hooks/useOnElementResize.js +4 -4
  36. package/esm/FloatingLabelInput/FloatingLabelInputImpl.js +4 -7
  37. package/esm/FormItem/ValidationFieldWrapper.js +2 -3
  38. package/esm/Input/InputAddonWrapper.js +2 -3
  39. package/esm/Input/InputImpl.js +15 -17
  40. package/esm/InputGroup/AddonWrapper.js +5 -7
  41. package/esm/InputMask/DSInputMaskDeprecated.js +10 -12
  42. package/esm/SearchBox/NavSearchBox.js +5 -1
  43. package/esm/SearchBox/withSearchable.js +2 -4
  44. package/esm/Toggle/DSToggleImpl.js +28 -28
  45. package/package.json +31 -23
  46. package/types/ComboBox/v3/parts/controls-input/useControlsInput.d.ts +3 -3
  47. package/types/ComboBox/v3/parts/menu-list/styled.d.ts +4 -3
  48. package/types/ComboBox/v3/parts/menu-list/useItemRenderer.d.ts +1 -1
  49. package/types/ComboBox/v3/utils/hooks/useKeyboardNavigation.d.ts +4 -1
  50. package/types/ComboBox/v3/utils/listHelper.d.ts +1 -1
  51. package/types/SearchBox/index.d.ts +1 -1
  52. package/cjs/ComboBox/v3/utils/hooks/useOnWindowResize.js +0 -31
  53. package/esm/ComboBox/v3/utils/hooks/useOnWindowResize.js +0 -27
  54. 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 };
@@ -1,5 +0,0 @@
1
- declare const useDimensions: (targetRef: any) => {
2
- width: any;
3
- height: any;
4
- };
5
- export { useDimensions };