@dreamcommerce/aurora 2.7.1-3 → 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.
- package/build/cjs/packages/aurora/src/components/dropdown/components/content.js +6 -4
- package/build/cjs/packages/aurora/src/components/dropdown/components/content.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/dropdown/constants.js +3 -1
- package/build/cjs/packages/aurora/src/components/dropdown/constants.js.map +1 -1
- package/build/esm/packages/aurora/src/components/dropdown/components/content.js +7 -5
- package/build/esm/packages/aurora/src/components/dropdown/components/content.js.map +1 -1
- package/build/esm/packages/aurora/src/components/dropdown/constants.d.ts +1 -0
- package/build/esm/packages/aurora/src/components/dropdown/constants.js +3 -2
- package/build/esm/packages/aurora/src/components/dropdown/constants.js.map +1 -1
- package/package.json +1 -1
|
@@ -53,15 +53,17 @@ const Content = ({ headerComponent, headerGoBackText, headerGoBackIcon, children
|
|
|
53
53
|
};
|
|
54
54
|
}, [contentRef.current]);
|
|
55
55
|
const checkIfIsOutsideTopViewport = () => {
|
|
56
|
-
if (!contentRef.current || !bounding)
|
|
56
|
+
if (!contentRef.current || !bounding || !isOpen)
|
|
57
57
|
return;
|
|
58
58
|
return bounding.top <= 0;
|
|
59
59
|
};
|
|
60
60
|
const checkIfIsOutsideBottomViewport = () => {
|
|
61
|
-
if (!contentRef.current || !bounding)
|
|
61
|
+
if (!contentRef.current || !bounding || !isOpen)
|
|
62
62
|
return;
|
|
63
|
-
|
|
64
|
-
|
|
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;
|
|
65
67
|
};
|
|
66
68
|
const dropdownIsOutsideTopViewport = checkIfIsOutsideTopViewport();
|
|
67
69
|
const dropdownIsOutsideBottomViewport = checkIfIsOutsideBottomViewport();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,6BAA6B,oEAAwE;AACrG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,6BAA6B,oEAAwE;AACrG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -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,15 +44,17 @@ const Content = ({ headerComponent, headerGoBackText, headerGoBackIcon, children
|
|
|
44
44
|
};
|
|
45
45
|
}, [contentRef.current]);
|
|
46
46
|
const checkIfIsOutsideTopViewport = () => {
|
|
47
|
-
if (!contentRef.current || !bounding)
|
|
47
|
+
if (!contentRef.current || !bounding || !isOpen)
|
|
48
48
|
return;
|
|
49
49
|
return bounding.top <= 0;
|
|
50
50
|
};
|
|
51
51
|
const checkIfIsOutsideBottomViewport = () => {
|
|
52
|
-
if (!contentRef.current || !bounding)
|
|
52
|
+
if (!contentRef.current || !bounding || !isOpen)
|
|
53
53
|
return;
|
|
54
|
-
|
|
55
|
-
|
|
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;
|
|
56
58
|
};
|
|
57
59
|
const dropdownIsOutsideTopViewport = checkIfIsOutsideTopViewport();
|
|
58
60
|
const dropdownIsOutsideBottomViewport = checkIfIsOutsideBottomViewport();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA,+BAA+B,oEAAwE;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,+BAA+B,oEAAwE;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -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;"}
|