@dreamcommerce/aurora 2.7.1-5 → 2.7.1-6

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.
@@ -53,17 +53,17 @@ const Content = ({ headerComponent, headerGoBackText, headerGoBackIcon, children
53
53
  };
54
54
  }, [contentRef.current]);
55
55
  const checkIfIsOutsideTopViewport = () => {
56
- console.log('checkIfIsOutsideTopViewport');
57
56
  if (!contentRef.current || !bounding || !isOpen)
58
57
  return;
59
58
  return bounding.top <= 0;
60
59
  };
61
60
  const checkIfIsOutsideBottomViewport = () => {
62
- console.log('checkIfIsOutsideBottomViewport');
63
61
  if (!contentRef.current || !bounding || !isOpen)
64
62
  return;
65
- const elementHeight = bounding.height;
66
- return elementHeight + bounding.top > window.innerHeight + windowYScroll;
63
+ console.log('left', bounding.height + bounding.top + constants.DROPDOWN_CONTENT_ARROW_HEIGHT);
64
+ console.log('right', window.innerHeight);
65
+ console.log(bounding.height + bounding.top + constants.DROPDOWN_CONTENT_ARROW_HEIGHT > window.innerHeight);
66
+ return bounding.height + bounding.top + constants.DROPDOWN_CONTENT_ARROW_HEIGHT > window.innerHeight;
67
67
  };
68
68
  const dropdownIsOutsideTopViewport = checkIfIsOutsideTopViewport();
69
69
  const dropdownIsOutsideBottomViewport = checkIfIsOutsideBottomViewport();
@@ -9,8 +9,10 @@ const DROPDOWN_TEST_ID = {
9
9
  label: DROPDOWN_LABEL_TEST_ID
10
10
  };
11
11
  const DROPDOWN_Z_INDEX = 1200;
12
- const DROPDOWN_ON_MODAL_Z_INDEX = 2200;
12
+ const DROPDOWN_ON_MODAL_Z_INDEX = 2200;
13
+ const DROPDOWN_CONTENT_ARROW_HEIGHT = 13;
13
14
 
15
+ exports.DROPDOWN_CONTENT_ARROW_HEIGHT = DROPDOWN_CONTENT_ARROW_HEIGHT;
14
16
  exports.DROPDOWN_ON_MODAL_Z_INDEX = DROPDOWN_ON_MODAL_Z_INDEX;
15
17
  exports.DROPDOWN_TEST_ID = DROPDOWN_TEST_ID;
16
18
  exports.DROPDOWN_Z_INDEX = DROPDOWN_Z_INDEX;
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -9,7 +9,7 @@ import { useScreenDetect } from '../../../hooks/use_screen_detect.js';
9
9
  import { UiDomUtils } from '@dreamcommerce/utilities';
10
10
  import withTranslation from '../../../utilities/translation/with_translation.js';
11
11
  import { TransitionGroup, CSSTransition } from 'react-transition-group';
12
- import { DROPDOWN_Z_INDEX, DROPDOWN_ON_MODAL_Z_INDEX } from '../constants.js';
12
+ import { DROPDOWN_Z_INDEX, DROPDOWN_CONTENT_ARROW_HEIGHT, DROPDOWN_ON_MODAL_Z_INDEX } from '../constants.js';
13
13
  import { cssDropdownContent, cssDropdownContentOnTop, cssDropdownContentOnBottom, cssDropdownArrowHorizontalDirectionRight, cssDropdownArrowVerticalDirectionBottom, cssDropdownHeader, cssDropdownHeaderContent, cssDropdownHeaderTitle } from '../css_classes.js';
14
14
  import cssClasses from '../../../css/dropdown/main.module.less.js';
15
15
  import { getBounding, getXYModifiersForNestedDropdowns, isChildOfModal } from '../utilities.js';
@@ -44,17 +44,17 @@ const Content = ({ headerComponent, headerGoBackText, headerGoBackIcon, children
44
44
  };
45
45
  }, [contentRef.current]);
46
46
  const checkIfIsOutsideTopViewport = () => {
47
- console.log('checkIfIsOutsideTopViewport');
48
47
  if (!contentRef.current || !bounding || !isOpen)
49
48
  return;
50
49
  return bounding.top <= 0;
51
50
  };
52
51
  const checkIfIsOutsideBottomViewport = () => {
53
- console.log('checkIfIsOutsideBottomViewport');
54
52
  if (!contentRef.current || !bounding || !isOpen)
55
53
  return;
56
- const elementHeight = bounding.height;
57
- return elementHeight + bounding.top > window.innerHeight + windowYScroll;
54
+ console.log('left', bounding.height + bounding.top + DROPDOWN_CONTENT_ARROW_HEIGHT);
55
+ console.log('right', window.innerHeight);
56
+ console.log(bounding.height + bounding.top + DROPDOWN_CONTENT_ARROW_HEIGHT > window.innerHeight);
57
+ return bounding.height + bounding.top + DROPDOWN_CONTENT_ARROW_HEIGHT > window.innerHeight;
58
58
  };
59
59
  const dropdownIsOutsideTopViewport = checkIfIsOutsideTopViewport();
60
60
  const dropdownIsOutsideBottomViewport = checkIfIsOutsideBottomViewport();
@@ -4,3 +4,4 @@ export declare const DROPDOWN_TEST_ID: {
4
4
  };
5
5
  export declare const DROPDOWN_Z_INDEX = 1200;
6
6
  export declare const DROPDOWN_ON_MODAL_Z_INDEX = 2200;
7
+ export declare const DROPDOWN_CONTENT_ARROW_HEIGHT = 13;
@@ -5,7 +5,8 @@ const DROPDOWN_TEST_ID = {
5
5
  label: DROPDOWN_LABEL_TEST_ID
6
6
  };
7
7
  const DROPDOWN_Z_INDEX = 1200;
8
- const DROPDOWN_ON_MODAL_Z_INDEX = 2200;
8
+ const DROPDOWN_ON_MODAL_Z_INDEX = 2200;
9
+ const DROPDOWN_CONTENT_ARROW_HEIGHT = 13;
9
10
 
10
- export { DROPDOWN_ON_MODAL_Z_INDEX, DROPDOWN_TEST_ID, DROPDOWN_Z_INDEX };
11
+ export { DROPDOWN_CONTENT_ARROW_HEIGHT, DROPDOWN_ON_MODAL_Z_INDEX, DROPDOWN_TEST_ID, DROPDOWN_Z_INDEX };
11
12
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@dreamcommerce/aurora",
3
3
  "packageManager": "yarn@3.2.0",
4
4
  "sideEffects": false,
5
- "version": "2.7.1-5",
5
+ "version": "2.7.1-6",
6
6
  "description": "aurora",
7
7
  "author": "k0ssak",
8
8
  "license": "MIT",