@dreamcommerce/aurora 2.23.5 → 2.23.6-2
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 +26 -5
- package/build/cjs/packages/aurora/src/components/dropdown/components/content.js.map +1 -1
- package/build/cjs/packages/aurora/src/css/image_picker/main.module.less.js +1 -1
- package/build/esm/packages/aurora/src/components/dropdown/components/content.js +26 -5
- package/build/esm/packages/aurora/src/components/dropdown/components/content.js.map +1 -1
- package/build/esm/packages/aurora/src/css/image_picker/main.module.less.js +1 -1
- package/package.json +1 -1
|
@@ -81,6 +81,11 @@ var Content = function Content(_ref) {
|
|
|
81
81
|
parentScrollTop = _useState4[0],
|
|
82
82
|
setParentScrollTop = _useState4[1];
|
|
83
83
|
|
|
84
|
+
var _useState5 = React.useState(false),
|
|
85
|
+
_useState6 = _rollupPluginBabelHelpers.slicedToArray(_useState5, 2),
|
|
86
|
+
fitOnBottomOfScrollableParent = _useState6[0],
|
|
87
|
+
setFitOnBottomOfScrollableParent = _useState6[1];
|
|
88
|
+
|
|
84
89
|
var dropdownIdRef = React.useRef("dropdown-".concat(v4['default']()));
|
|
85
90
|
|
|
86
91
|
var _useDropdownsManagerC = use_dropdowns_manager_context.useDropdownsManagerContext(),
|
|
@@ -90,15 +95,15 @@ var Content = function Content(_ref) {
|
|
|
90
95
|
|
|
91
96
|
var dropdown = getDropdown(dropdownIdRef.current);
|
|
92
97
|
|
|
93
|
-
var
|
|
98
|
+
var _useState7 = React.useState({
|
|
94
99
|
top: '0px',
|
|
95
100
|
bottom: '0px',
|
|
96
101
|
left: '0px',
|
|
97
102
|
zIndex: constants.DROPDOWN_Z_INDEX
|
|
98
103
|
}),
|
|
99
|
-
|
|
100
|
-
styles =
|
|
101
|
-
setStyles =
|
|
104
|
+
_useState8 = _rollupPluginBabelHelpers.slicedToArray(_useState7, 2),
|
|
105
|
+
styles = _useState8[0],
|
|
106
|
+
setStyles = _useState8[1];
|
|
102
107
|
|
|
103
108
|
var windowYScroll = window.scrollY;
|
|
104
109
|
var windowHeightMinusYOffset = window.innerHeight - windowYScroll;
|
|
@@ -138,7 +143,7 @@ var Content = function Content(_ref) {
|
|
|
138
143
|
|
|
139
144
|
var dropdownIsOutsideTopViewport = checkIfIsOutsideTopViewport();
|
|
140
145
|
var dropdownIsOutsideBottomViewport = checkIfIsOutsideBottomViewport();
|
|
141
|
-
var contentShouldAppearOnTop = dropdownIsOutsideBottomViewport || verticalPosition === 'top' && !dropdownIsOutsideTopViewport;
|
|
146
|
+
var contentShouldAppearOnTop = (dropdownIsOutsideBottomViewport || verticalPosition === 'top' && !dropdownIsOutsideTopViewport) && !fitOnBottomOfScrollableParent;
|
|
142
147
|
var contentShouldAppearOnBottom = dropdownIsOutsideTopViewport || verticalPosition === 'bottom' && !dropdownIsOutsideBottomViewport;
|
|
143
148
|
var contentClassName = classnames__default['default'](css_classes.jsDropdownContentClass, main_module['default'][css_classes.cssDropdownContent], contentShouldAppearOnTop && "".concat(main_module$1['default'][css_classes.cssDropdownContentOnTop], " ").concat(main_module$2['default'][css_classes.cssDropdownContentOnTop]), contentShouldAppearOnBottom && "".concat(main_module$1['default'][css_classes.cssDropdownContentOnBottom], " ").concat(main_module$2['default'][css_classes.cssDropdownContentOnBottom]), arrowSide === 'right' && main_module['default'][css_classes.cssDropdownArrowHorizontalDirectionRight], contentShouldAppearOnTop && main_module['default'][css_classes.cssDropdownArrowVerticalDirectionBottom], cssClass);
|
|
144
149
|
var screenWidthName = use_screen_detect.useScreenDetect();
|
|
@@ -223,6 +228,7 @@ var Content = function Content(_ref) {
|
|
|
223
228
|
|
|
224
229
|
if (!(wrapperRef !== null && wrapperRef !== void 0 && wrapperRef.current) || !isOpen) return;
|
|
225
230
|
var scrollableParent = (_UiDomUtils$getFirstS = utilities$1.UiDomUtils.getFirstScrollableParent(wrapperRef.current)) !== null && _UiDomUtils$getFirstS !== void 0 ? _UiDomUtils$getFirstS : document.body;
|
|
231
|
+
var wrapperRect = wrapperRef.current.getBoundingClientRect();
|
|
226
232
|
|
|
227
233
|
var handleWindowScroll = function handleWindowScroll() {
|
|
228
234
|
if (typeof toggleDropdown === 'function' && shouldCloseOnScroll) {
|
|
@@ -238,11 +244,26 @@ var Content = function Content(_ref) {
|
|
|
238
244
|
once: true
|
|
239
245
|
});
|
|
240
246
|
scrollableParent.addEventListener('scroll', setParentScrollTopValue);
|
|
247
|
+
var checkIfFitInScrollableParent = setTimeout(function () {
|
|
248
|
+
var _contentRef$current;
|
|
249
|
+
|
|
250
|
+
var scrollableParentHeight = scrollableParent === null || scrollableParent === void 0 ? void 0 : scrollableParent.scrollHeight;
|
|
251
|
+
var scrollableParentBottomSpace = scrollableParentHeight - wrapperRect.bottom;
|
|
252
|
+
var dropdownHeight = contentRef === null || contentRef === void 0 || (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.offsetHeight;
|
|
253
|
+
if (dropdownHeight) setFitOnBottomOfScrollableParent(scrollableParentBottomSpace > dropdownHeight);
|
|
254
|
+
});
|
|
241
255
|
return function () {
|
|
242
256
|
scrollableParent.removeEventListener('scroll', handleWindowScroll);
|
|
243
257
|
scrollableParent.removeEventListener('scroll', setParentScrollTopValue);
|
|
258
|
+
clearTimeout(checkIfFitInScrollableParent);
|
|
244
259
|
};
|
|
245
260
|
}, [isOpen]);
|
|
261
|
+
React.useEffect(function () {
|
|
262
|
+
console.log('fitOnBottomOfScrollableParent', fitOnBottomOfScrollableParent);
|
|
263
|
+
}, [fitOnBottomOfScrollableParent]);
|
|
264
|
+
React.useEffect(function () {
|
|
265
|
+
console.log('contentShouldAppearOnTop', contentShouldAppearOnTop);
|
|
266
|
+
}, [contentShouldAppearOnTop]);
|
|
246
267
|
return /*#__PURE__*/reactDom.createPortal( /*#__PURE__*/React__default['default'].createElement(reactTransitionGroup.TransitionGroup, {
|
|
247
268
|
component: null
|
|
248
269
|
}, isOpen === true ? /*#__PURE__*/React__default['default'].createElement(reactTransitionGroup.CSSTransition, {
|
|
@@ -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,iBAAiB,wDAA4D;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,iBAAiB,wDAA4D;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var styleInject_es = require('../../../../../external/style-inject/dist/style-inject.es.js');
|
|
6
6
|
|
|
7
|
-
var css_248z = "/* font colors */\n/* actions */\n/* background */\n/* errors */\n/* borders */\n/* grid */\n/* scrollBar */\n/* sizes */\n.main-module_image-picker__wrapper__2RK3f {\n position: relative;\n border: 1px dashed #abb4cd;\n border-radius: 2px;\n}\n.main-module_image-picker__wrapper-error__kCZeA {\n border-color: #e60c54;\n}\n.main-module_image-picker__wrapper-error__kCZeA:hover {\n border-color: #e60c54;\n}\n.main-module_image-picker__wrapper-has-file__2zmRc {\n position: relative;\n}\n.main-module_image-picker__wrapper-has-file__2zmRc .main-module_image-picker__label__1i_Fq {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 46px;\n left: 0;\n}\n.main-module_image-picker__wrapper-has-file__2zmRc .main-module_image-picker__description__1v13N {\n display: none;\n}\n.main-module_image-picker__wrapper__2RK3f:hover {\n border-color: #135cc8;\n}\n.main-module_image-picker__wrapper__2RK3f:hover .main-module_image-picker__upload-icon__3sMvN {\n fill: #3c83ec;\n}\n.main-module_image-picker__wrapper-top-buttons__241RY {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n top: 1rem;\n right: 1rem;\n z-index: 10;\n}\n.main-module_image-picker__edit-button__3O-iq {\n display: flex;\n align-items: center;\n gap: 4px;\n background-color: #ffffff;\n background-image: none;\n border: 1px solid #3c83ec;\n border-radius: 2px;\n padding: 0.5rem;\n color: #3c83ec;\n cursor: pointer;\n}\n.main-module_image-picker__edit-button__3O-iq svg {\n fill: #3c83ec;\n}\n.main-module_image-picker__edit-button__3O-iq:hover {\n border-color: #135cc8;\n color: #135cc8;\n}\n.main-module_image-picker__edit-button__3O-iq:hover svg {\n fill: #135cc8;\n}\n.main-module_image-picker__label__1i_Fq {\n cursor: pointer;\n}\n.main-module_image-picker__input__3Wu2I {\n display: none;\n}\n.main-module_image-picker__description__1v13N {\n padding: 2rem 0;\n text-align: center;\n color: #3c83ec;\n}\n.main-module_image-picker__supported-formats__1_R_X {\n font-size: 12px;\n color: #59687e;\n}\n.main-module_image-picker__upload-icon__3sMvN {\n width: 1rem;\n height: auto;\n margin-bottom: 1rem;\n fill: #abb4cd;\n}\n.main-module_image-picker__delete-button__21_kT {\n display: flex;\n align-items: center;\n
|
|
7
|
+
var css_248z = "/* font colors */\n/* actions */\n/* background */\n/* errors */\n/* borders */\n/* grid */\n/* scrollBar */\n/* sizes */\n.main-module_image-picker__wrapper__2RK3f {\n position: relative;\n border: 1px dashed #abb4cd;\n border-radius: 2px;\n}\n.main-module_image-picker__wrapper-error__kCZeA {\n border-color: #e60c54;\n}\n.main-module_image-picker__wrapper-error__kCZeA:hover {\n border-color: #e60c54;\n}\n.main-module_image-picker__wrapper-has-file__2zmRc {\n position: relative;\n}\n.main-module_image-picker__wrapper-has-file__2zmRc .main-module_image-picker__label__1i_Fq {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 46px;\n left: 0;\n}\n.main-module_image-picker__wrapper-has-file__2zmRc .main-module_image-picker__description__1v13N {\n display: none;\n}\n.main-module_image-picker__wrapper__2RK3f:hover {\n border-color: #135cc8;\n}\n.main-module_image-picker__wrapper__2RK3f:hover .main-module_image-picker__upload-icon__3sMvN {\n fill: #3c83ec;\n}\n.main-module_image-picker__wrapper-top-buttons__241RY {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n top: 1rem;\n right: 1rem;\n z-index: 10;\n}\n.main-module_image-picker__edit-button__3O-iq {\n display: flex;\n align-items: center;\n gap: 4px;\n background-color: #ffffff;\n background-image: none;\n border: 1px solid #3c83ec;\n border-radius: 2px;\n padding: 0.5rem;\n color: #3c83ec;\n cursor: pointer;\n}\n.main-module_image-picker__edit-button__3O-iq svg {\n fill: #3c83ec;\n}\n.main-module_image-picker__edit-button__3O-iq:hover {\n border-color: #135cc8;\n color: #135cc8;\n}\n.main-module_image-picker__edit-button__3O-iq:hover svg {\n fill: #135cc8;\n}\n.main-module_image-picker__label__1i_Fq {\n cursor: pointer;\n}\n.main-module_image-picker__input__3Wu2I {\n display: none;\n}\n.main-module_image-picker__description__1v13N {\n padding: 2rem 0;\n text-align: center;\n color: #3c83ec;\n}\n.main-module_image-picker__supported-formats__1_R_X {\n font-size: 12px;\n color: #59687e;\n}\n.main-module_image-picker__upload-icon__3sMvN {\n width: 1rem;\n height: auto;\n margin-bottom: 1rem;\n fill: #abb4cd;\n}\n.main-module_image-picker__delete-button__21_kT {\n display: flex;\n align-items: center;\n color: #3c83ec;\n cursor: pointer;\n background: transparent;\n}\n.main-module_image-picker__delete-button__21_kT:hover .main-module_image-picker__delete-label__3v2ot {\n text-decoration: underline;\n}\n.main-module_image-picker__delete-button__21_kT .main-module_image-picker__delete-label__3v2ot {\n color: #3c83ec;\n}\n.main-module_image-picker__delete-button__21_kT svg {\n fill: #3c83ec;\n}\n.main-module_image-picker__wrong-file-format-icon__X-NL0 {\n margin: 2rem 0 0.5rem;\n fill: #ffffff;\n}\n.main-module_image-picker__delete-icon__30pkO {\n fill: #3c83ec;\n margin-right: 0.5rem;\n}\n.main-module_image-picker__selected-file__3bRqa {\n display: flex;\n align-items: center;\n justify-content: space-between;\n height: 46px;\n}\n.main-module_image-picker__selected-file-name-wrapper__37MKd,\n.main-module_image-picker__selected-file-remove-wrapper__2v4W2 {\n padding: 1rem;\n}\n.main-module_image-picker__selected-file-remove-wrapper__2v4W2 {\n display: flex;\n justify-content: flex-end;\n}\n.main-module_image-picker__selected-file-name-wrapper__37MKd {\n color: #59687e;\n}\n.main-module_image-picker__image-preview-wrapper__1jPXU {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 130px;\n}\n.main-module_image-picker__image-preview-wrapper__1jPXU svg {\n fill: transparent;\n}\n.main-module_image-picker__image-preview__12pRu {\n max-width: 100%;\n max-height: 100%;\n}\n.main-module_image-picker__error-text__rXAvw {\n margin-top: 0.5rem;\n color: #e60c54;\n}\n.main-module_image-picker__loading-wrapper__gBtlh {\n position: relative;\n}\n.main-module_image-picker__loading-wrapper-content__21jzx {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n background-color: #ffffff;\n width: 100%;\n height: 100%;\n border: 1px dashed #abb4cd;\n border-radius: 2px;\n}\n.main-module_image-picker__loading-wrapper-content-text__2-Fup {\n color: #5c657e;\n margin-top: 0.5rem;\n}\n";
|
|
8
8
|
var styles = {
|
|
9
9
|
"image-picker__wrapper": "main-module_image-picker__wrapper__2RK3f",
|
|
10
10
|
"image-picker__wrapper-error": "main-module_image-picker__wrapper-error__kCZeA",
|
|
@@ -72,6 +72,11 @@ var Content = function Content(_ref) {
|
|
|
72
72
|
parentScrollTop = _useState4[0],
|
|
73
73
|
setParentScrollTop = _useState4[1];
|
|
74
74
|
|
|
75
|
+
var _useState5 = useState(false),
|
|
76
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
77
|
+
fitOnBottomOfScrollableParent = _useState6[0],
|
|
78
|
+
setFitOnBottomOfScrollableParent = _useState6[1];
|
|
79
|
+
|
|
75
80
|
var dropdownIdRef = useRef("dropdown-".concat(v4()));
|
|
76
81
|
|
|
77
82
|
var _useDropdownsManagerC = useDropdownsManagerContext(),
|
|
@@ -81,15 +86,15 @@ var Content = function Content(_ref) {
|
|
|
81
86
|
|
|
82
87
|
var dropdown = getDropdown(dropdownIdRef.current);
|
|
83
88
|
|
|
84
|
-
var
|
|
89
|
+
var _useState7 = useState({
|
|
85
90
|
top: '0px',
|
|
86
91
|
bottom: '0px',
|
|
87
92
|
left: '0px',
|
|
88
93
|
zIndex: DROPDOWN_Z_INDEX
|
|
89
94
|
}),
|
|
90
|
-
|
|
91
|
-
styles =
|
|
92
|
-
setStyles =
|
|
95
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
96
|
+
styles = _useState8[0],
|
|
97
|
+
setStyles = _useState8[1];
|
|
93
98
|
|
|
94
99
|
var windowYScroll = window.scrollY;
|
|
95
100
|
var windowHeightMinusYOffset = window.innerHeight - windowYScroll;
|
|
@@ -129,7 +134,7 @@ var Content = function Content(_ref) {
|
|
|
129
134
|
|
|
130
135
|
var dropdownIsOutsideTopViewport = checkIfIsOutsideTopViewport();
|
|
131
136
|
var dropdownIsOutsideBottomViewport = checkIfIsOutsideBottomViewport();
|
|
132
|
-
var contentShouldAppearOnTop = dropdownIsOutsideBottomViewport || verticalPosition === 'top' && !dropdownIsOutsideTopViewport;
|
|
137
|
+
var contentShouldAppearOnTop = (dropdownIsOutsideBottomViewport || verticalPosition === 'top' && !dropdownIsOutsideTopViewport) && !fitOnBottomOfScrollableParent;
|
|
133
138
|
var contentShouldAppearOnBottom = dropdownIsOutsideTopViewport || verticalPosition === 'bottom' && !dropdownIsOutsideBottomViewport;
|
|
134
139
|
var contentClassName = classnames(jsDropdownContentClass, cssClasses[cssDropdownContent], contentShouldAppearOnTop && "".concat(cssClasses$1[cssDropdownContentOnTop], " ").concat(cssClasses$2[cssDropdownContentOnTop]), contentShouldAppearOnBottom && "".concat(cssClasses$1[cssDropdownContentOnBottom], " ").concat(cssClasses$2[cssDropdownContentOnBottom]), arrowSide === 'right' && cssClasses[cssDropdownArrowHorizontalDirectionRight], contentShouldAppearOnTop && cssClasses[cssDropdownArrowVerticalDirectionBottom], cssClass);
|
|
135
140
|
var screenWidthName = useScreenDetect();
|
|
@@ -214,6 +219,7 @@ var Content = function Content(_ref) {
|
|
|
214
219
|
|
|
215
220
|
if (!(wrapperRef !== null && wrapperRef !== void 0 && wrapperRef.current) || !isOpen) return;
|
|
216
221
|
var scrollableParent = (_UiDomUtils$getFirstS = UiDomUtils.getFirstScrollableParent(wrapperRef.current)) !== null && _UiDomUtils$getFirstS !== void 0 ? _UiDomUtils$getFirstS : document.body;
|
|
222
|
+
var wrapperRect = wrapperRef.current.getBoundingClientRect();
|
|
217
223
|
|
|
218
224
|
var handleWindowScroll = function handleWindowScroll() {
|
|
219
225
|
if (typeof toggleDropdown === 'function' && shouldCloseOnScroll) {
|
|
@@ -229,11 +235,26 @@ var Content = function Content(_ref) {
|
|
|
229
235
|
once: true
|
|
230
236
|
});
|
|
231
237
|
scrollableParent.addEventListener('scroll', setParentScrollTopValue);
|
|
238
|
+
var checkIfFitInScrollableParent = setTimeout(function () {
|
|
239
|
+
var _contentRef$current;
|
|
240
|
+
|
|
241
|
+
var scrollableParentHeight = scrollableParent === null || scrollableParent === void 0 ? void 0 : scrollableParent.scrollHeight;
|
|
242
|
+
var scrollableParentBottomSpace = scrollableParentHeight - wrapperRect.bottom;
|
|
243
|
+
var dropdownHeight = contentRef === null || contentRef === void 0 || (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.offsetHeight;
|
|
244
|
+
if (dropdownHeight) setFitOnBottomOfScrollableParent(scrollableParentBottomSpace > dropdownHeight);
|
|
245
|
+
});
|
|
232
246
|
return function () {
|
|
233
247
|
scrollableParent.removeEventListener('scroll', handleWindowScroll);
|
|
234
248
|
scrollableParent.removeEventListener('scroll', setParentScrollTopValue);
|
|
249
|
+
clearTimeout(checkIfFitInScrollableParent);
|
|
235
250
|
};
|
|
236
251
|
}, [isOpen]);
|
|
252
|
+
useEffect(function () {
|
|
253
|
+
console.log('fitOnBottomOfScrollableParent', fitOnBottomOfScrollableParent);
|
|
254
|
+
}, [fitOnBottomOfScrollableParent]);
|
|
255
|
+
useEffect(function () {
|
|
256
|
+
console.log('contentShouldAppearOnTop', contentShouldAppearOnTop);
|
|
257
|
+
}, [contentShouldAppearOnTop]);
|
|
237
258
|
return /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement(TransitionGroup, {
|
|
238
259
|
component: null
|
|
239
260
|
}, isOpen === true ? /*#__PURE__*/React.createElement(CSSTransition, {
|
|
@@ -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,eAAe,wDAA4D;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,eAAe,wDAA4D;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,6 +1,6 @@
|
|
|
1
1
|
import styleInject from '../../../../../external/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = "/* font colors */\n/* actions */\n/* background */\n/* errors */\n/* borders */\n/* grid */\n/* scrollBar */\n/* sizes */\n.main-module_image-picker__wrapper__2RK3f {\n position: relative;\n border: 1px dashed #abb4cd;\n border-radius: 2px;\n}\n.main-module_image-picker__wrapper-error__kCZeA {\n border-color: #e60c54;\n}\n.main-module_image-picker__wrapper-error__kCZeA:hover {\n border-color: #e60c54;\n}\n.main-module_image-picker__wrapper-has-file__2zmRc {\n position: relative;\n}\n.main-module_image-picker__wrapper-has-file__2zmRc .main-module_image-picker__label__1i_Fq {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 46px;\n left: 0;\n}\n.main-module_image-picker__wrapper-has-file__2zmRc .main-module_image-picker__description__1v13N {\n display: none;\n}\n.main-module_image-picker__wrapper__2RK3f:hover {\n border-color: #135cc8;\n}\n.main-module_image-picker__wrapper__2RK3f:hover .main-module_image-picker__upload-icon__3sMvN {\n fill: #3c83ec;\n}\n.main-module_image-picker__wrapper-top-buttons__241RY {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n top: 1rem;\n right: 1rem;\n z-index: 10;\n}\n.main-module_image-picker__edit-button__3O-iq {\n display: flex;\n align-items: center;\n gap: 4px;\n background-color: #ffffff;\n background-image: none;\n border: 1px solid #3c83ec;\n border-radius: 2px;\n padding: 0.5rem;\n color: #3c83ec;\n cursor: pointer;\n}\n.main-module_image-picker__edit-button__3O-iq svg {\n fill: #3c83ec;\n}\n.main-module_image-picker__edit-button__3O-iq:hover {\n border-color: #135cc8;\n color: #135cc8;\n}\n.main-module_image-picker__edit-button__3O-iq:hover svg {\n fill: #135cc8;\n}\n.main-module_image-picker__label__1i_Fq {\n cursor: pointer;\n}\n.main-module_image-picker__input__3Wu2I {\n display: none;\n}\n.main-module_image-picker__description__1v13N {\n padding: 2rem 0;\n text-align: center;\n color: #3c83ec;\n}\n.main-module_image-picker__supported-formats__1_R_X {\n font-size: 12px;\n color: #59687e;\n}\n.main-module_image-picker__upload-icon__3sMvN {\n width: 1rem;\n height: auto;\n margin-bottom: 1rem;\n fill: #abb4cd;\n}\n.main-module_image-picker__delete-button__21_kT {\n display: flex;\n align-items: center;\n
|
|
3
|
+
var css_248z = "/* font colors */\n/* actions */\n/* background */\n/* errors */\n/* borders */\n/* grid */\n/* scrollBar */\n/* sizes */\n.main-module_image-picker__wrapper__2RK3f {\n position: relative;\n border: 1px dashed #abb4cd;\n border-radius: 2px;\n}\n.main-module_image-picker__wrapper-error__kCZeA {\n border-color: #e60c54;\n}\n.main-module_image-picker__wrapper-error__kCZeA:hover {\n border-color: #e60c54;\n}\n.main-module_image-picker__wrapper-has-file__2zmRc {\n position: relative;\n}\n.main-module_image-picker__wrapper-has-file__2zmRc .main-module_image-picker__label__1i_Fq {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 46px;\n left: 0;\n}\n.main-module_image-picker__wrapper-has-file__2zmRc .main-module_image-picker__description__1v13N {\n display: none;\n}\n.main-module_image-picker__wrapper__2RK3f:hover {\n border-color: #135cc8;\n}\n.main-module_image-picker__wrapper__2RK3f:hover .main-module_image-picker__upload-icon__3sMvN {\n fill: #3c83ec;\n}\n.main-module_image-picker__wrapper-top-buttons__241RY {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n top: 1rem;\n right: 1rem;\n z-index: 10;\n}\n.main-module_image-picker__edit-button__3O-iq {\n display: flex;\n align-items: center;\n gap: 4px;\n background-color: #ffffff;\n background-image: none;\n border: 1px solid #3c83ec;\n border-radius: 2px;\n padding: 0.5rem;\n color: #3c83ec;\n cursor: pointer;\n}\n.main-module_image-picker__edit-button__3O-iq svg {\n fill: #3c83ec;\n}\n.main-module_image-picker__edit-button__3O-iq:hover {\n border-color: #135cc8;\n color: #135cc8;\n}\n.main-module_image-picker__edit-button__3O-iq:hover svg {\n fill: #135cc8;\n}\n.main-module_image-picker__label__1i_Fq {\n cursor: pointer;\n}\n.main-module_image-picker__input__3Wu2I {\n display: none;\n}\n.main-module_image-picker__description__1v13N {\n padding: 2rem 0;\n text-align: center;\n color: #3c83ec;\n}\n.main-module_image-picker__supported-formats__1_R_X {\n font-size: 12px;\n color: #59687e;\n}\n.main-module_image-picker__upload-icon__3sMvN {\n width: 1rem;\n height: auto;\n margin-bottom: 1rem;\n fill: #abb4cd;\n}\n.main-module_image-picker__delete-button__21_kT {\n display: flex;\n align-items: center;\n color: #3c83ec;\n cursor: pointer;\n background: transparent;\n}\n.main-module_image-picker__delete-button__21_kT:hover .main-module_image-picker__delete-label__3v2ot {\n text-decoration: underline;\n}\n.main-module_image-picker__delete-button__21_kT .main-module_image-picker__delete-label__3v2ot {\n color: #3c83ec;\n}\n.main-module_image-picker__delete-button__21_kT svg {\n fill: #3c83ec;\n}\n.main-module_image-picker__wrong-file-format-icon__X-NL0 {\n margin: 2rem 0 0.5rem;\n fill: #ffffff;\n}\n.main-module_image-picker__delete-icon__30pkO {\n fill: #3c83ec;\n margin-right: 0.5rem;\n}\n.main-module_image-picker__selected-file__3bRqa {\n display: flex;\n align-items: center;\n justify-content: space-between;\n height: 46px;\n}\n.main-module_image-picker__selected-file-name-wrapper__37MKd,\n.main-module_image-picker__selected-file-remove-wrapper__2v4W2 {\n padding: 1rem;\n}\n.main-module_image-picker__selected-file-remove-wrapper__2v4W2 {\n display: flex;\n justify-content: flex-end;\n}\n.main-module_image-picker__selected-file-name-wrapper__37MKd {\n color: #59687e;\n}\n.main-module_image-picker__image-preview-wrapper__1jPXU {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 130px;\n}\n.main-module_image-picker__image-preview-wrapper__1jPXU svg {\n fill: transparent;\n}\n.main-module_image-picker__image-preview__12pRu {\n max-width: 100%;\n max-height: 100%;\n}\n.main-module_image-picker__error-text__rXAvw {\n margin-top: 0.5rem;\n color: #e60c54;\n}\n.main-module_image-picker__loading-wrapper__gBtlh {\n position: relative;\n}\n.main-module_image-picker__loading-wrapper-content__21jzx {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n background-color: #ffffff;\n width: 100%;\n height: 100%;\n border: 1px dashed #abb4cd;\n border-radius: 2px;\n}\n.main-module_image-picker__loading-wrapper-content-text__2-Fup {\n color: #5c657e;\n margin-top: 0.5rem;\n}\n";
|
|
4
4
|
var styles = {
|
|
5
5
|
"image-picker__wrapper": "main-module_image-picker__wrapper__2RK3f",
|
|
6
6
|
"image-picker__wrapper-error": "main-module_image-picker__wrapper-error__kCZeA",
|