@dreamcommerce/aurora 2.4.5 → 2.4.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 +3 -3
- package/build/cjs/packages/aurora/src/components/tooltip/index.js +2 -2
- package/build/cjs/packages/aurora/src/css/tooltip/main.module.less.js +1 -1
- package/build/esm/packages/aurora/src/components/dropdown/components/content.js +3 -3
- package/build/esm/packages/aurora/src/components/tooltip/index.js +2 -2
- package/build/esm/packages/aurora/src/css/tooltip/main.module.less.js +1 -1
- package/package.json +1 -1
|
@@ -35,7 +35,7 @@ var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
|
35
35
|
const Content = ({ headerComponent, headerGoBackText, headerGoBackIcon, children, arrowSide = 'left', horizontalPosition = 'left', verticalPosition = 'bottom', cssClass, portalContainer }) => {
|
|
36
36
|
const [t] = useTranslation.useTranslation();
|
|
37
37
|
const contentRef = React.useRef(null);
|
|
38
|
-
const { wrapperRef, toggleDropdown, isOpen
|
|
38
|
+
const { wrapperRef, toggleDropdown, isOpen } = index.useDropdownContext();
|
|
39
39
|
const [styles, setStyles] = React.useState({
|
|
40
40
|
top: '0px',
|
|
41
41
|
bottom: '0px',
|
|
@@ -128,8 +128,8 @@ const Content = ({ headerComponent, headerGoBackText, headerGoBackIcon, children
|
|
|
128
128
|
return;
|
|
129
129
|
const scrollableParent = (_a = utilities$1.UiDomUtils.getFirstScrollableParent(wrapperRef.current)) !== null && _a !== void 0 ? _a : document.body;
|
|
130
130
|
const handleWindowScroll = () => {
|
|
131
|
-
if (typeof
|
|
132
|
-
|
|
131
|
+
if (typeof toggleDropdown === 'function') {
|
|
132
|
+
toggleDropdown();
|
|
133
133
|
}
|
|
134
134
|
};
|
|
135
135
|
scrollableParent.addEventListener('scroll', handleWindowScroll, { once: true });
|
|
@@ -18,10 +18,10 @@ const Tooltip = ({ left, top, disabled, onToggle, children, content }) => {
|
|
|
18
18
|
const [isOpen, toggleDropdown] = use_toggle.useToggle(false, onToggle);
|
|
19
19
|
const value = React__default['default'].useMemo(() => ({ wrapperRef, isOpen, toggleDropdown }), [isOpen, toggleDropdown]);
|
|
20
20
|
const handleOnMouseEnter = () => {
|
|
21
|
-
toggleDropdown();
|
|
21
|
+
!isOpen && toggleDropdown();
|
|
22
22
|
};
|
|
23
23
|
const handleOnMouseLeave = () => {
|
|
24
|
-
toggleDropdown();
|
|
24
|
+
isOpen && toggleDropdown();
|
|
25
25
|
};
|
|
26
26
|
return (React__default['default'].createElement(index.DropdownContext.Provider, { value: value },
|
|
27
27
|
React__default['default'].createElement("span", { className: main_module['default'][css_classes.cssTooltip], ref: wrapperRef, onMouseEnter: handleOnMouseEnter, onMouseLeave: handleOnMouseLeave },
|
|
@@ -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_tooltip__container__1T35Q {\n padding-right: 0.5rem;\n padding-left: 0.5rem;\n white-space: nowrap;\n color: #ffffff;\n font-size: 12px;\n text-align: center;\n background-color: #2d3748;\n}\n.main-module_tooltip__container__1T35Q::before {\n display: none;\n}\n";
|
|
7
|
+
var css_248z = "/* font colors */\n/* actions */\n/* background */\n/* errors */\n/* borders */\n/* grid */\n/* scrollBar */\n/* sizes */\n.main-module_tooltip__container__1T35Q {\n padding-right: 0.5rem;\n padding-left: 0.5rem;\n white-space: nowrap;\n color: #ffffff;\n font-size: 12px;\n text-align: center;\n background-color: #2d3748;\n box-shadow: none;\n pointer-events: none;\n}\n.main-module_tooltip__container__1T35Q::before {\n display: none;\n}\n";
|
|
8
8
|
var cssClasses = {"tooltip__container":"main-module_tooltip__container__1T35Q"};
|
|
9
9
|
styleInject_es['default'](css_248z);
|
|
10
10
|
|
|
@@ -26,7 +26,7 @@ import cssClasses$1 from '../../../css/hint/main.module.less.js';
|
|
|
26
26
|
const Content = ({ headerComponent, headerGoBackText, headerGoBackIcon, children, arrowSide = 'left', horizontalPosition = 'left', verticalPosition = 'bottom', cssClass, portalContainer }) => {
|
|
27
27
|
const [t] = useTranslation();
|
|
28
28
|
const contentRef = useRef(null);
|
|
29
|
-
const { wrapperRef, toggleDropdown, isOpen
|
|
29
|
+
const { wrapperRef, toggleDropdown, isOpen } = useDropdownContext();
|
|
30
30
|
const [styles, setStyles] = useState({
|
|
31
31
|
top: '0px',
|
|
32
32
|
bottom: '0px',
|
|
@@ -119,8 +119,8 @@ const Content = ({ headerComponent, headerGoBackText, headerGoBackIcon, children
|
|
|
119
119
|
return;
|
|
120
120
|
const scrollableParent = (_a = UiDomUtils.getFirstScrollableParent(wrapperRef.current)) !== null && _a !== void 0 ? _a : document.body;
|
|
121
121
|
const handleWindowScroll = () => {
|
|
122
|
-
if (typeof
|
|
123
|
-
|
|
122
|
+
if (typeof toggleDropdown === 'function') {
|
|
123
|
+
toggleDropdown();
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
126
|
scrollableParent.addEventListener('scroll', handleWindowScroll, { once: true });
|
|
@@ -10,10 +10,10 @@ const Tooltip = ({ left, top, disabled, onToggle, children, content }) => {
|
|
|
10
10
|
const [isOpen, toggleDropdown] = useToggle(false, onToggle);
|
|
11
11
|
const value = React.useMemo(() => ({ wrapperRef, isOpen, toggleDropdown }), [isOpen, toggleDropdown]);
|
|
12
12
|
const handleOnMouseEnter = () => {
|
|
13
|
-
toggleDropdown();
|
|
13
|
+
!isOpen && toggleDropdown();
|
|
14
14
|
};
|
|
15
15
|
const handleOnMouseLeave = () => {
|
|
16
|
-
toggleDropdown();
|
|
16
|
+
isOpen && toggleDropdown();
|
|
17
17
|
};
|
|
18
18
|
return (React.createElement(DropdownContext.Provider, { value: value },
|
|
19
19
|
React.createElement("span", { className: cssClasses[cssTooltip], ref: wrapperRef, onMouseEnter: handleOnMouseEnter, onMouseLeave: handleOnMouseLeave },
|
|
@@ -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_tooltip__container__1T35Q {\n padding-right: 0.5rem;\n padding-left: 0.5rem;\n white-space: nowrap;\n color: #ffffff;\n font-size: 12px;\n text-align: center;\n background-color: #2d3748;\n}\n.main-module_tooltip__container__1T35Q::before {\n display: none;\n}\n";
|
|
3
|
+
var css_248z = "/* font colors */\n/* actions */\n/* background */\n/* errors */\n/* borders */\n/* grid */\n/* scrollBar */\n/* sizes */\n.main-module_tooltip__container__1T35Q {\n padding-right: 0.5rem;\n padding-left: 0.5rem;\n white-space: nowrap;\n color: #ffffff;\n font-size: 12px;\n text-align: center;\n background-color: #2d3748;\n box-shadow: none;\n pointer-events: none;\n}\n.main-module_tooltip__container__1T35Q::before {\n display: none;\n}\n";
|
|
4
4
|
var cssClasses = {"tooltip__container":"main-module_tooltip__container__1T35Q"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|