@zohodesk/components 1.2.55 → 1.2.57
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/README.md +14 -0
- package/es/Accordion/Accordion.js +2 -2
- package/es/Accordion/AccordionItem.js +4 -4
- package/es/Accordion/__tests__/Accordion.spec.js +1 -1
- package/es/Accordion/__tests__/AccordionItem.spec.js +1 -1
- package/es/Accordion/index.js +2 -2
- package/es/Animation/Animation.js +3 -3
- package/es/Animation/__tests__/Animation.spec.js +1 -1
- package/es/Animation/utils.js +1 -1
- package/es/AppContainer/AppContainer.js +9 -9
- package/es/AppContainer/__tests__/AppContainer.spec.js +1 -1
- package/es/Avatar/Avatar.js +5 -5
- package/es/Avatar/__tests__/Avatar.spec.js +1 -1
- package/es/AvatarTeam/AvatarTeam.js +4 -4
- package/es/AvatarTeam/__tests__/AvatarTeam.spec.js +1 -1
- package/es/AvatarTeam/props/propTypes.js +1 -1
- package/es/Button/Button.js +4 -4
- package/es/Button/__tests__/Button.spec.js +1 -1
- package/es/Button/index.js +2 -2
- package/es/Button/props/defaultProps.js +1 -1
- package/es/Buttongroup/Buttongroup.js +3 -3
- package/es/Buttongroup/__tests__/Buttongroup.spec.js +1 -1
- package/es/Card/Card.js +5 -5
- package/es/Card/__tests__/Card.spec.js +1 -1
- package/es/Card/index.js +4 -4
- package/es/CheckBox/CheckBox.js +7 -7
- package/es/CheckBox/__tests__/CheckBox.spec.js +1 -1
- package/es/CheckBox/__tests__/__snapshots__/CheckBox.spec.js.snap +2 -2
- package/es/DateTime/CalendarView.js +6 -6
- package/es/DateTime/DateTime.js +15 -15
- package/es/DateTime/DateTimePopupFooter.js +5 -5
- package/es/DateTime/DateTimePopupHeader.js +4 -4
- package/es/DateTime/DateWidget.js +17 -17
- package/es/DateTime/DaysRow.js +3 -3
- package/es/DateTime/Time.js +5 -5
- package/es/DateTime/YearView.js +6 -6
- package/es/DateTime/__tests__/CalendarView.spec.js +1 -1
- package/es/DateTime/__tests__/DateTime.spec.js +1 -1
- package/es/DateTime/__tests__/DateTimePopupFooter.spec.js +1 -1
- package/es/DateTime/__tests__/DateTimePopupHeader.spec.js +1 -1
- package/es/DateTime/__tests__/DateWidget.spec.js +1 -1
- package/es/DateTime/__tests__/DaysRow.spec.js +1 -1
- package/es/DateTime/__tests__/Time.spec.js +1 -1
- package/es/DateTime/__tests__/YearView.spec.js +1 -1
- package/es/DateTime/dateFormatUtils/dateFormat.js +4 -4
- package/es/DateTime/dateFormatUtils/dayChange.js +2 -2
- package/es/DateTime/dateFormatUtils/index.js +3 -3
- package/es/DateTime/dateFormatUtils/monthChange.js +2 -2
- package/es/DateTime/dateFormatUtils/timeChange.js +2 -2
- package/es/DateTime/dateFormatUtils/yearChange.js +2 -2
- package/es/DateTime/index.js +1 -1
- package/es/DateTime/props/propTypes.js +1 -1
- package/es/DateTime/validator.js +2 -2
- package/es/DropBox/DropBox.js +9 -9
- package/es/DropBox/DropBoxElement/DropBoxElement.js +9 -7
- package/es/DropBox/DropBoxElement/__tests__/DropBoxElement.spec.js +1 -1
- package/es/DropBox/DropBoxElement/__tests__/__snapshots__/DropBoxElement.spec.js.snap +4 -2
- package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +54 -51
- package/es/DropBox/DropBoxElement/css/cssJSLogic.js +5 -5
- package/es/DropBox/DropBoxElement/useDropboxPosCalc.js +1 -1
- package/es/DropBox/__tests__/DropBox.spec.js +1 -1
- package/es/DropBox/__tests__/__snapshots__/DropBox.spec.js.snap +4 -2
- package/es/DropBox/css/cssJSLogic.js +1 -1
- package/es/DropBox/props/defaultProps.js +1 -1
- package/es/DropBox/props/propTypes.js +1 -1
- package/es/DropBox/utils/isMobilePopover.js +1 -1
- package/es/DropDown/DropDown.js +4 -4
- package/es/DropDown/DropDownHeading.js +3 -3
- package/es/DropDown/DropDownItem.js +3 -3
- package/es/DropDown/DropDownSearch.js +4 -4
- package/es/DropDown/DropDownSeparator.js +2 -2
- package/es/DropDown/__tests__/DropDown.spec.js +1 -1
- package/es/DropDown/__tests__/DropDownHeading.spec.js +1 -1
- package/es/DropDown/__tests__/DropDownItem.spec.js +1 -1
- package/es/DropDown/__tests__/DropDownSearch.spec.js +1 -1
- package/es/DropDown/__tests__/DropDownSeparator.spec.js +1 -1
- package/es/DropDown/__tests__/__snapshots__/DropDown.spec.js.snap +3 -1
- package/es/DropDown/index.js +7 -7
- package/es/DropDown/props/propTypes.js +1 -1
- package/es/Heading/Heading.js +4 -4
- package/es/Heading/__tests__/Heading.spec.js +1 -1
- package/es/Label/Label.js +4 -4
- package/es/Label/__tests__/Label.spec.js +1 -1
- package/es/Layout/Box.js +4 -4
- package/es/Layout/Container.js +4 -4
- package/es/Layout/__tests__/Box.spec.js +1 -1
- package/es/Layout/__tests__/Container.spec.js +1 -1
- package/es/Layout/index.js +2 -2
- package/es/ListItem/ListContainer.js +6 -6
- package/es/ListItem/ListItem.js +5 -5
- package/es/ListItem/ListItemWithAvatar.js +7 -7
- package/es/ListItem/ListItemWithCheckBox.js +6 -6
- package/es/ListItem/ListItemWithIcon.js +5 -5
- package/es/ListItem/ListItemWithRadio.js +6 -6
- package/es/ListItem/__tests__/ListContainer.spec.js +1 -1
- package/es/ListItem/__tests__/ListItem.spec.js +1 -1
- package/es/ListItem/__tests__/ListItemWithAvatar.spec.js +1 -1
- package/es/ListItem/__tests__/ListItemWithCheckBox.spec.js +1 -1
- package/es/ListItem/__tests__/ListItemWithIcon.spec.js +1 -1
- package/es/ListItem/__tests__/ListItemWithRadio.spec.js +1 -1
- package/es/ListItem/index.js +6 -6
- package/es/ListItem/props/propTypes.js +2 -2
- package/es/Modal/Modal.js +3 -3
- package/es/Modal/__tests__/Modal.spec.js +1 -1
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +17 -17
- package/es/MultiSelect/AdvancedMultiSelect.js +17 -17
- package/es/MultiSelect/EmptyState.js +3 -3
- package/es/MultiSelect/MobileHeader/MobileHeader.js +5 -5
- package/es/MultiSelect/MobileHeader/__tests__/MobileHeader.spec.js +1 -1
- package/es/MultiSelect/MultiSelect.js +20 -20
- package/es/MultiSelect/MultiSelectHeader.js +4 -4
- package/es/MultiSelect/MultiSelectWithAvatar.js +16 -16
- package/es/MultiSelect/SelectedOptions.js +5 -5
- package/es/MultiSelect/Suggestions.js +6 -6
- package/es/MultiSelect/__tests__/AdvancedGroupMultiSelect.spec.js +1 -1
- package/es/MultiSelect/__tests__/AdvancedMultiSelect.spec.js +1 -1
- package/es/MultiSelect/__tests__/EmptyState.spec.js +1 -1
- package/es/MultiSelect/__tests__/MultiSelect.spec.js +1 -1
- package/es/MultiSelect/__tests__/MultiSelectHeader.spec.js +1 -1
- package/es/MultiSelect/__tests__/MultiSelectWithAvatar.spec.js +1 -1
- package/es/MultiSelect/__tests__/SelectedOptions.spec.js +1 -1
- package/es/MultiSelect/__tests__/Suggestions.spec.js +1 -1
- package/es/MultiSelect/index.js +4 -4
- package/es/MultiSelect/props/defaultProps.js +1 -1
- package/es/PopOver/PopOver.js +6 -6
- package/es/PopOver/__tests__/PopOver.spec.js +1 -1
- package/es/PopOver/index.js +3 -3
- package/es/Popup/Popup.js +236 -87
- package/es/Provider/AvatarSize.js +1 -1
- package/es/Provider/CssProvider.js +1 -1
- package/es/Provider/IdProvider.js +2 -2
- package/es/Provider/LibraryContext.js +2 -2
- package/es/Provider/ZindexProvider.js +2 -2
- package/es/Provider/index.js +4 -4
- package/es/Radio/Radio.js +6 -6
- package/es/Radio/__tests__/Radio.spec.js +1 -1
- package/es/Responsive/CustomResponsive.js +7 -7
- package/es/Responsive/ResizeComponent.js +2 -2
- package/es/Responsive/Responsive.js +6 -6
- package/es/Responsive/index.js +3 -3
- package/es/Responsive/utils/index.js +1 -1
- package/es/Responsive/windowResizeObserver.js +1 -1
- package/es/ResponsiveDropBox/ResponsiveDropBox.js +6 -6
- package/es/ResponsiveDropBox/__tests__/ResponsiveDropBox.spec.js +1 -1
- package/es/ResponsiveDropBox/__tests__/__snapshots__/ResponsiveDropBox.spec.js.snap +4 -2
- package/es/ResponsiveDropBox/props/propTypes.js +1 -1
- package/es/Ribbon/Ribbon.js +3 -3
- package/es/Ribbon/__tests__/Ribbon.spec.js +1 -1
- package/es/RippleEffect/RippleEffect.js +4 -4
- package/es/RippleEffect/__tests__/RippleEffect.spec.js +1 -1
- package/es/Select/GroupSelect.js +16 -16
- package/es/Select/Select.js +15 -15
- package/es/Select/SelectWithAvatar.js +17 -17
- package/es/Select/SelectWithIcon.js +13 -13
- package/es/Select/__tests__/GroupSelect.spec.js +1 -1
- package/es/Select/__tests__/Select.spec.js +1 -1
- package/es/Select/__tests__/SelectWithAvatar.spec.js +1 -1
- package/es/Select/__tests__/SelectWithIcon.spec.js +1 -1
- package/es/Select/index.js +4 -4
- package/es/Select/props/defaultProps.js +1 -1
- package/es/Stencils/Stencils.js +3 -3
- package/es/Stencils/__tests__/Stencils.spec.js +1 -1
- package/es/Switch/Switch.js +5 -5
- package/es/Switch/__tests__/Switch.spec.js +1 -1
- package/es/Tab/Tab.js +5 -5
- package/es/Tab/TabContent.js +4 -4
- package/es/Tab/TabContentWrapper.js +3 -3
- package/es/Tab/TabWrapper.js +3 -3
- package/es/Tab/Tabs.js +13 -13
- package/es/Tab/__tests__/Tab.spec.js +1 -1
- package/es/Tab/__tests__/TabContent.spec.js +1 -1
- package/es/Tab/__tests__/TabContentWrapper.spec.js +1 -1
- package/es/Tab/__tests__/TabWrapper.spec.js +1 -1
- package/es/Tab/__tests__/Tabs.spec.js +1 -1
- package/es/Tab/index.js +5 -5
- package/es/Tag/Tag.js +7 -7
- package/es/Tag/__tests__/Tag.spec.js +1 -1
- package/es/Tag/props/propTypes.js +1 -1
- package/es/TextBox/TextBox.js +3 -3
- package/es/TextBox/__tests__/TextBox.spec.js +1 -1
- package/es/TextBoxIcon/TextBoxIcon.js +6 -6
- package/es/TextBoxIcon/__tests__/TextBoxIcon.spec.js +1 -1
- package/es/TextBoxIcon/props/propTypes.js +1 -1
- package/es/Textarea/Textarea.js +3 -3
- package/es/Textarea/__tests__/Textarea.spec.js +1 -1
- package/es/Tooltip/Tooltip.js +6 -6
- package/es/Typography/Typography.js +4 -4
- package/es/Typography/css/cssJSLogic.js +1 -1
- package/es/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +3 -3
- package/es/VelocityAnimation/VelocityAnimation/__tests__/VelocityAnimation.spec.js +1 -1
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +3 -3
- package/es/VelocityAnimation/VelocityAnimationGroup/__tests__/VelocityAnimationGroup.spec.js +1 -1
- package/es/VelocityAnimation/index.js +2 -2
- package/es/css.js +37 -37
- package/es/deprecated/PortalLayer/PortalLayer.js +3 -3
- package/es/index.js +39 -39
- package/es/semantic/Button/Button.js +3 -3
- package/es/semantic/Button/__tests__/Button.spec.js +1 -1
- package/es/semantic/index.js +1 -1
- package/es/utils/Common.js +3 -2
- package/es/utils/ContextOptimizer.js +1 -1
- package/es/utils/cssUtils.js +1 -1
- package/es/utils/datetime/common.js +1 -1
- package/es/utils/dropDownUtils.js +1 -1
- package/es/utils/index.js +1 -1
- package/es/v1/Accordion/Accordion.js +2 -2
- package/es/v1/Accordion/AccordionItem.js +4 -4
- package/es/v1/Accordion/index.js +2 -2
- package/es/v1/Animation/Animation.js +3 -3
- package/es/v1/Animation/utils.js +1 -1
- package/es/v1/AppContainer/AppContainer.js +8 -8
- package/es/v1/Avatar/Avatar.js +5 -5
- package/es/v1/AvatarTeam/AvatarTeam.js +4 -4
- package/es/v1/Button/Button.js +4 -4
- package/es/v1/Button/props/defaultProps.js +1 -1
- package/es/v1/Buttongroup/Buttongroup.js +3 -3
- package/es/v1/Card/Card.js +5 -5
- package/es/v1/Card/index.js +4 -4
- package/es/v1/CheckBox/CheckBox.js +6 -6
- package/es/v1/DateTime/CalendarView.js +7 -7
- package/es/v1/DateTime/DateTime.js +15 -15
- package/es/v1/DateTime/DateTimePopupFooter.js +5 -5
- package/es/v1/DateTime/DateTimePopupHeader.js +4 -4
- package/es/v1/DateTime/DateWidget.js +17 -17
- package/es/v1/DateTime/DaysRow.js +3 -3
- package/es/v1/DateTime/Time.js +5 -5
- package/es/v1/DateTime/YearView.js +6 -6
- package/es/v1/DateTime/index.js +1 -1
- package/es/v1/DateTime/props/propTypes.js +1 -1
- package/es/v1/DropBox/DropBox.js +9 -9
- package/es/v1/DropBox/DropBoxElement/DropBoxElement.js +6 -6
- package/es/v1/DropBox/props/defaultProps.js +1 -1
- package/es/v1/DropBox/props/propTypes.js +1 -1
- package/es/v1/DropBox/utils/isMobilePopover.js +1 -1
- package/es/v1/DropDown/DropDown.js +4 -4
- package/es/v1/DropDown/DropDownHeading.js +3 -3
- package/es/v1/DropDown/DropDownItem.js +3 -3
- package/es/v1/DropDown/DropDownSearch.js +4 -4
- package/es/v1/DropDown/DropDownSeparator.js +2 -2
- package/es/v1/DropDown/props/propTypes.js +1 -1
- package/es/v1/Heading/Heading.js +4 -4
- package/es/v1/Label/Label.js +4 -4
- package/es/v1/Layout/Box.js +4 -4
- package/es/v1/Layout/Container.js +4 -4
- package/es/v1/Layout/index.js +2 -2
- package/es/v1/ListItem/ListContainer.js +6 -6
- package/es/v1/ListItem/ListItem.js +5 -5
- package/es/v1/ListItem/ListItemWithAvatar.js +7 -7
- package/es/v1/ListItem/ListItemWithCheckBox.js +6 -6
- package/es/v1/ListItem/ListItemWithIcon.js +5 -5
- package/es/v1/ListItem/ListItemWithRadio.js +6 -6
- package/es/v1/ListItem/index.js +6 -6
- package/es/v1/Modal/Modal.js +3 -3
- package/es/v1/MultiSelect/AdvancedGroupMultiSelect.js +17 -17
- package/es/v1/MultiSelect/AdvancedMultiSelect.js +17 -17
- package/es/v1/MultiSelect/EmptyState.js +3 -3
- package/es/v1/MultiSelect/MobileHeader/MobileHeader.js +5 -5
- package/es/v1/MultiSelect/MultiSelect.js +19 -19
- package/es/v1/MultiSelect/MultiSelectHeader.js +4 -4
- package/es/v1/MultiSelect/MultiSelectWithAvatar.js +16 -16
- package/es/v1/MultiSelect/SelectedOptions.js +5 -5
- package/es/v1/MultiSelect/Suggestions.js +6 -6
- package/es/v1/MultiSelect/index.js +4 -4
- package/es/v1/MultiSelect/props/defaultProps.js +1 -1
- package/es/v1/PopOver/PopOver.js +6 -6
- package/es/v1/Popup/Popup.js +3 -3
- package/es/v1/Radio/Radio.js +5 -5
- package/es/v1/ResponsiveDropBox/ResponsiveDropBox.js +6 -6
- package/es/v1/ResponsiveDropBox/props/propTypes.js +1 -1
- package/es/v1/Ribbon/Ribbon.js +3 -3
- package/es/v1/RippleEffect/RippleEffect.js +4 -4
- package/es/v1/Select/GroupSelect.js +16 -16
- package/es/v1/Select/Select.js +15 -15
- package/es/v1/Select/SelectWithAvatar.js +17 -17
- package/es/v1/Select/SelectWithIcon.js +13 -13
- package/es/v1/Select/index.js +4 -4
- package/es/v1/Select/props/defaultProps.js +1 -1
- package/es/v1/Stencils/Stencils.js +3 -3
- package/es/v1/Switch/Switch.js +5 -5
- package/es/v1/Tab/Tab.js +5 -5
- package/es/v1/Tab/TabContent.js +4 -4
- package/es/v1/Tab/TabContentWrapper.js +3 -3
- package/es/v1/Tab/TabWrapper.js +3 -3
- package/es/v1/Tab/Tabs.js +13 -13
- package/es/v1/Tab/index.js +5 -5
- package/es/v1/Tag/Tag.js +7 -7
- package/es/v1/TextBox/TextBox.js +3 -3
- package/es/v1/TextBoxIcon/TextBoxIcon.js +6 -6
- package/es/v1/TextBoxIcon/props/propTypes.js +1 -1
- package/es/v1/Textarea/Textarea.js +3 -3
- package/es/v1/Tooltip/Tooltip.js +6 -6
- package/es/v1/Typography/Typography.js +4 -4
- package/es/v1/Typography/css/cssJSLogic.js +1 -1
- package/es/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +3 -3
- package/es/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +3 -3
- package/es/v1/semantic/Button/Button.js +3 -3
- package/es/v1/semantic/index.js +1 -1
- package/lib/CheckBox/CheckBox.js +1 -1
- package/lib/CheckBox/__tests__/__snapshots__/CheckBox.spec.js.snap +2 -2
- package/lib/DropBox/DropBoxElement/DropBoxElement.js +3 -1
- package/lib/DropBox/DropBoxElement/__tests__/__snapshots__/DropBoxElement.spec.js.snap +4 -2
- package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +54 -51
- package/lib/DropBox/DropBoxElement/css/cssJSLogic.js +2 -2
- package/lib/DropBox/__tests__/__snapshots__/DropBox.spec.js.snap +4 -2
- package/lib/DropDown/__tests__/__snapshots__/DropDown.spec.js.snap +3 -1
- package/lib/Popup/Popup.js +282 -114
- package/lib/ResponsiveDropBox/__tests__/__snapshots__/ResponsiveDropBox.spec.js.snap +4 -2
- package/lib/utils/Common.js +5 -1
- package/package.json +2 -2
- package/result.json +1 -1
package/es/Popup/Popup.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
/**** Libraries ****/
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import hoistStatics from 'hoist-non-react-statics';
|
|
4
|
-
import { PopupPropTypes, ContextTypes } from
|
|
4
|
+
import { PopupPropTypes, ContextTypes } from "./props/propTypes";
|
|
5
5
|
/**** Methods ****/
|
|
6
6
|
|
|
7
|
-
import { debounce, isDescendant, isTextSelected, cancelBubblingEffect } from
|
|
8
|
-
import viewPort from
|
|
9
|
-
import { absolutePositionMapping, rtlAbsolutePositionMapping, rtlFixedPositionMapping } from
|
|
7
|
+
import { debounce, isDescendant, isTextSelected, cancelBubblingEffect, DUMMY_OBJECT } from "../utils/Common.js";
|
|
8
|
+
import viewPort from "./viewPort";
|
|
9
|
+
import { absolutePositionMapping, rtlAbsolutePositionMapping, rtlFixedPositionMapping } from "./PositionMapping.js";
|
|
10
10
|
import ResizeObserver from '@zohodesk/virtualizer/lib/commons/ResizeObserver.js';
|
|
11
|
-
import { addIntersectionObserver, removeIntersectionObserver } from
|
|
11
|
+
import { addIntersectionObserver, removeIntersectionObserver } from "./intersectionObserver";
|
|
12
|
+
import { positionMapping } from "../DropBox/DropBoxPositionMapping.js";
|
|
13
|
+
import isMobilePopover from "../DropBox/utils/isMobilePopover.js";
|
|
14
|
+
import selectn from 'selectn';
|
|
12
15
|
let lastOpenedGroup = [];
|
|
13
16
|
let popups = {};
|
|
14
17
|
|
|
@@ -47,7 +50,8 @@ const Popup = function (Component) {
|
|
|
47
50
|
isArrow: needPopupArrow = false,
|
|
48
51
|
customOrder: customPositionOrder = [],
|
|
49
52
|
scrollDebounceTime: popupScrollDebounceTime = 0,
|
|
50
|
-
closeOnScroll: closeOnScrollPopup = false
|
|
53
|
+
closeOnScroll: closeOnScrollPopup = false,
|
|
54
|
+
isOutsideScrollBlocked: isOutsideScrollBlock = false
|
|
51
55
|
} = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
52
56
|
|
|
53
57
|
class Popup extends React.Component {
|
|
@@ -66,7 +70,8 @@ const Popup = function (Component) {
|
|
|
66
70
|
//{height: ‘’, width: ‘’,}
|
|
67
71
|
popupOffset: {},
|
|
68
72
|
//{height: ‘’, width: ‘’,}
|
|
69
|
-
isAbsolutePositioningNeeded: true
|
|
73
|
+
isAbsolutePositioningNeeded: true,
|
|
74
|
+
isMobile: false
|
|
70
75
|
};
|
|
71
76
|
this.togglePopup = this.togglePopup.bind(this);
|
|
72
77
|
this.documentClickHandler = this.documentClickHandler.bind(this);
|
|
@@ -81,10 +86,11 @@ const Popup = function (Component) {
|
|
|
81
86
|
this.handleResize = debounce(this.handleResize.bind(this), 300);
|
|
82
87
|
this.handlePopupResize = this.handlePopupResize.bind(this);
|
|
83
88
|
this.getIsAbsolutePopup = this.getIsAbsolutePopup.bind(this);
|
|
89
|
+
this.getIsOutsideScrollBlocked = this.getIsOutsideScrollBlocked.bind(this);
|
|
84
90
|
this.getNeedArrow = this.getNeedArrow.bind(this);
|
|
85
91
|
this.getCustomPositionOrder = this.getCustomPositionOrder.bind(this);
|
|
86
|
-
this.handleOpenPopupPositionChange = this.handleOpenPopupPositionChange.bind(this);
|
|
87
|
-
|
|
92
|
+
this.handleOpenPopupPositionChange = this.handleOpenPopupPositionChange.bind(this); // this.getScrollDebounceTime = this.getScrollDebounceTime.bind(this);
|
|
93
|
+
|
|
88
94
|
this.getCloseOnScrollPopup = this.getCloseOnScrollPopup.bind(this);
|
|
89
95
|
this.handleCloseLastOpenedGroup = this.handleCloseLastOpenedGroup.bind(this);
|
|
90
96
|
this.handleDocumentMouseDown = this.handleDocumentMouseDown.bind(this);
|
|
@@ -98,19 +104,26 @@ const Popup = function (Component) {
|
|
|
98
104
|
this.handleAddingScrollBlock = this.handleAddingScrollBlock.bind(this);
|
|
99
105
|
this.handleRemovingScrollBlock = this.handleRemovingScrollBlock.bind(this);
|
|
100
106
|
this.handleIntersectionObserver = this.handleIntersectionObserver.bind(this);
|
|
107
|
+
this.updateVisibilityOnIntersection = this.updateVisibilityOnIntersection.bind(this);
|
|
108
|
+
this.handleAddingScrollToUpdatePosition = this.handleAddingScrollToUpdatePosition.bind(this);
|
|
109
|
+
this.handleRemovingScrollToUpdatePosition = this.handleRemovingScrollToUpdatePosition.bind(this);
|
|
110
|
+
this.updatePositionOnScroll = this.updatePositionOnScroll.bind(this);
|
|
111
|
+
this.setContainerDynamicPositioning = this.setContainerDynamicPositioning.bind(this);
|
|
112
|
+
this.updatePopupState = this.updatePopupState.bind(this);
|
|
113
|
+
this.handleScrollAndBlockEvents = this.handleScrollAndBlockEvents.bind(this);
|
|
114
|
+
this.handleDropElementStyleUpdate = this.handleDropElementStyleUpdate.bind(this);
|
|
115
|
+
this.positionRef = /*#__PURE__*/React.createRef();
|
|
101
116
|
this.popupObserver = new ResizeObserver(this.handlePopupResize); //dropBoxSize
|
|
102
117
|
|
|
103
118
|
this.size = null;
|
|
119
|
+
this.isTargetElementVisible = false;
|
|
104
120
|
this.isAbsolutePopup = isAbsolutePopup;
|
|
105
121
|
this.needPopupArrow = needPopupArrow;
|
|
106
122
|
this.customPositionOrder = customPositionOrder;
|
|
107
123
|
this.scrollDebounceTime = popupScrollDebounceTime;
|
|
108
124
|
this.closeOnScroll = closeOnScrollPopup;
|
|
109
|
-
const {
|
|
110
|
-
|
|
111
|
-
} = this.getScrollDebounceTime(this);
|
|
112
|
-
this.handleScroll = debounce(this.handleScroll.bind(this), scrollDebounceTime);
|
|
113
|
-
this.handleDebouncedPositionChange = debounce(this.handlePositionChange.bind(this), 100);
|
|
125
|
+
this.isOutsideScrollBlock = isOutsideScrollBlock; // const { scrollDebounceTime } = this.getScrollDebounceTime(this);
|
|
126
|
+
// this.handleScroll = debounce(this.handleScroll.bind(this), scrollDebounceTime);
|
|
114
127
|
}
|
|
115
128
|
|
|
116
129
|
componentDidMount() {
|
|
@@ -143,12 +156,24 @@ const Popup = function (Component) {
|
|
|
143
156
|
}
|
|
144
157
|
}
|
|
145
158
|
|
|
159
|
+
handleScrollAndBlockEvents(isPopupReady, isMobile) {
|
|
160
|
+
if (isPopupReady && !isMobile) {
|
|
161
|
+
this.handleAddingScrollBlock();
|
|
162
|
+
this.handleAddingScrollToUpdatePosition();
|
|
163
|
+
} else {
|
|
164
|
+
this.handleRemovingScrollBlock();
|
|
165
|
+
this.handleRemovingScrollToUpdatePosition();
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
146
169
|
componentDidUpdate(prevProps, prevState) {
|
|
147
170
|
const {
|
|
148
|
-
isPopupReady
|
|
171
|
+
isPopupReady,
|
|
172
|
+
isMobile
|
|
149
173
|
} = this.state;
|
|
150
174
|
const {
|
|
151
|
-
isPopupReady: oldStateOpen = false
|
|
175
|
+
isPopupReady: oldStateOpen = false,
|
|
176
|
+
isMobile: oldIsMobileState
|
|
152
177
|
} = prevState || {};
|
|
153
178
|
const {
|
|
154
179
|
dropElement
|
|
@@ -164,12 +189,10 @@ const Popup = function (Component) {
|
|
|
164
189
|
this.size = null;
|
|
165
190
|
this.popupObserver.disconnect();
|
|
166
191
|
}
|
|
192
|
+
}
|
|
167
193
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
} else {
|
|
171
|
-
this.handleRemovingScrollBlock();
|
|
172
|
-
}
|
|
194
|
+
if (oldStateOpen !== isPopupReady && !isMobile || oldIsMobileState !== isMobile) {
|
|
195
|
+
this.handleScrollAndBlockEvents(isPopupReady, isMobile);
|
|
173
196
|
}
|
|
174
197
|
}
|
|
175
198
|
|
|
@@ -186,6 +209,7 @@ const Popup = function (Component) {
|
|
|
186
209
|
return res;
|
|
187
210
|
}, popups);
|
|
188
211
|
this.handleRemovingScrollBlock();
|
|
212
|
+
this.handleRemovingScrollToUpdatePosition();
|
|
189
213
|
let noPopups = true;
|
|
190
214
|
|
|
191
215
|
for (const i in popups) {
|
|
@@ -211,10 +235,8 @@ const Popup = function (Component) {
|
|
|
211
235
|
}
|
|
212
236
|
|
|
213
237
|
handleAddingScrollBlock() {
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
isOutsideScrollBlocked
|
|
217
|
-
} = this.props;
|
|
238
|
+
const isAbsolutePositioningNeeded = this.getIsAbsolutePopup(this);
|
|
239
|
+
const isOutsideScrollBlocked = this.getIsOutsideScrollBlocked(this);
|
|
218
240
|
|
|
219
241
|
if (isOutsideScrollBlocked && !isAbsolutePositioningNeeded) {
|
|
220
242
|
addIntersectionObserver(this.placeHolderElement, this.handleIntersectionObserver);
|
|
@@ -223,10 +245,8 @@ const Popup = function (Component) {
|
|
|
223
245
|
}
|
|
224
246
|
|
|
225
247
|
handleRemovingScrollBlock() {
|
|
226
|
-
const
|
|
227
|
-
|
|
228
|
-
isOutsideScrollBlocked
|
|
229
|
-
} = this.props;
|
|
248
|
+
const isAbsolutePositioningNeeded = this.getIsAbsolutePopup(this);
|
|
249
|
+
const isOutsideScrollBlocked = this.getIsOutsideScrollBlocked(this);
|
|
230
250
|
|
|
231
251
|
if (isOutsideScrollBlocked && !isAbsolutePositioningNeeded) {
|
|
232
252
|
removeIntersectionObserver(this.placeHolderElement, this.handleIntersectionObserver);
|
|
@@ -234,6 +254,98 @@ const Popup = function (Component) {
|
|
|
234
254
|
}
|
|
235
255
|
}
|
|
236
256
|
|
|
257
|
+
handleAddingScrollToUpdatePosition() {
|
|
258
|
+
const isAbsolutePositioningNeeded = this.getIsAbsolutePopup(this);
|
|
259
|
+
const isOutsideScrollBlocked = this.getIsOutsideScrollBlocked(this);
|
|
260
|
+
|
|
261
|
+
if (!isOutsideScrollBlocked && !isAbsolutePositioningNeeded) {
|
|
262
|
+
addIntersectionObserver(this.placeHolderElement, this.updateVisibilityOnIntersection);
|
|
263
|
+
document.addEventListener('scroll', this.updatePositionOnScroll, {
|
|
264
|
+
capture: true,
|
|
265
|
+
passive: false
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
handleRemovingScrollToUpdatePosition() {
|
|
271
|
+
const isAbsolutePositioningNeeded = this.getIsAbsolutePopup(this);
|
|
272
|
+
const isOutsideScrollBlocked = this.getIsOutsideScrollBlocked(this);
|
|
273
|
+
|
|
274
|
+
if (!isOutsideScrollBlocked && !isAbsolutePositioningNeeded) {
|
|
275
|
+
removeIntersectionObserver(this.placeHolderElement, this.updateVisibilityOnIntersection);
|
|
276
|
+
document.removeEventListener('scroll', this.updatePositionOnScroll, {
|
|
277
|
+
capture: true,
|
|
278
|
+
passive: false
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
handleDropElementStyleUpdate(_ref) {
|
|
284
|
+
let {
|
|
285
|
+
top = '',
|
|
286
|
+
left = '',
|
|
287
|
+
bottom = '',
|
|
288
|
+
right = ''
|
|
289
|
+
} = _ref;
|
|
290
|
+
const {
|
|
291
|
+
dropElement
|
|
292
|
+
} = this;
|
|
293
|
+
Object.assign(dropElement.style, {
|
|
294
|
+
top: top ? `${top}px` : '',
|
|
295
|
+
left: left ? `${left}px` : '',
|
|
296
|
+
right: right ? `${right}px` : '',
|
|
297
|
+
bottom: bottom ? `${bottom}px` : ''
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
setContainerDynamicPositioning(betterPosition, needArrow) {
|
|
302
|
+
const {
|
|
303
|
+
dropElement
|
|
304
|
+
} = this;
|
|
305
|
+
const {
|
|
306
|
+
isMobile
|
|
307
|
+
} = this.state;
|
|
308
|
+
const {
|
|
309
|
+
view,
|
|
310
|
+
viewsOffset
|
|
311
|
+
} = betterPosition || DUMMY_OBJECT;
|
|
312
|
+
const styleToApply = selectn(`${view}`, viewsOffset);
|
|
313
|
+
|
|
314
|
+
if (isMobile) {
|
|
315
|
+
this.handleDropElementStyleUpdate({
|
|
316
|
+
top: '',
|
|
317
|
+
left: '',
|
|
318
|
+
right: '',
|
|
319
|
+
bottom: ''
|
|
320
|
+
});
|
|
321
|
+
} else {
|
|
322
|
+
this.handleDropElementStyleUpdate(styleToApply);
|
|
323
|
+
|
|
324
|
+
if (this.positionRef.current !== view) {
|
|
325
|
+
dropElement.setAttribute('data-position', `${view}`);
|
|
326
|
+
dropElement.setAttribute('data-box-direction', selectn(`${view}.direction`, positionMapping));
|
|
327
|
+
|
|
328
|
+
if (needArrow) {
|
|
329
|
+
dropElement.setAttribute('data-arrow-position', selectn(`${view}.arrowPosition`, positionMapping));
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
this.positionRef.current = view;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
updatePositionOnScroll(e) {
|
|
338
|
+
const {
|
|
339
|
+
placeHolderElement,
|
|
340
|
+
defaultPosition,
|
|
341
|
+
isTargetElementVisible
|
|
342
|
+
} = this;
|
|
343
|
+
|
|
344
|
+
if (e.target.contains(placeHolderElement) && isTargetElementVisible) {
|
|
345
|
+
this.handlePopupPosition(defaultPosition, true);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
237
349
|
addScrollBlockListeners() {
|
|
238
350
|
document.addEventListener('wheel', this.handleBlockScroll, {
|
|
239
351
|
capture: true,
|
|
@@ -243,7 +355,7 @@ const Popup = function (Component) {
|
|
|
243
355
|
capture: true,
|
|
244
356
|
passive: false
|
|
245
357
|
});
|
|
246
|
-
document.addEventListener('scroll', this.
|
|
358
|
+
document.addEventListener('scroll', this.handlePositionChange, {
|
|
247
359
|
capture: true,
|
|
248
360
|
passive: false
|
|
249
361
|
});
|
|
@@ -262,7 +374,7 @@ const Popup = function (Component) {
|
|
|
262
374
|
capture: true,
|
|
263
375
|
passive: false
|
|
264
376
|
});
|
|
265
|
-
document.removeEventListener('scroll', this.
|
|
377
|
+
document.removeEventListener('scroll', this.handlePositionChange, {
|
|
266
378
|
capture: true,
|
|
267
379
|
passive: false
|
|
268
380
|
});
|
|
@@ -291,7 +403,7 @@ const Popup = function (Component) {
|
|
|
291
403
|
const containerElement = this.dropElement;
|
|
292
404
|
|
|
293
405
|
if (containerElement && containerElement !== event.target && !containerElement.contains(event.target) && targetElement && targetElement !== event.target && !targetElement.contains(event.target) && event.target.contains(targetElement)) {
|
|
294
|
-
this.handlePopupPosition(this.state.position); // this.closePopupOnly(event);
|
|
406
|
+
this.handlePopupPosition(this.state.position, true); // this.closePopupOnly(event);
|
|
295
407
|
}
|
|
296
408
|
}
|
|
297
409
|
|
|
@@ -305,11 +417,25 @@ const Popup = function (Component) {
|
|
|
305
417
|
}
|
|
306
418
|
|
|
307
419
|
handleIntersectionObserver(entry) {
|
|
308
|
-
if (entry.intersectionRatio === 0) {
|
|
420
|
+
if (entry.intersectionRatio === 0 && entry.isIntersecting === false) {
|
|
309
421
|
this.closePopupOnly();
|
|
310
422
|
}
|
|
311
423
|
}
|
|
312
424
|
|
|
425
|
+
updateVisibilityOnIntersection(entry) {
|
|
426
|
+
const {
|
|
427
|
+
dropElement
|
|
428
|
+
} = this;
|
|
429
|
+
|
|
430
|
+
if (entry.isIntersecting === true) {
|
|
431
|
+
this.isTargetElementVisible = true;
|
|
432
|
+
dropElement.setAttribute('data-visible', 'visible');
|
|
433
|
+
} else if (entry.intersectionRatio === 0 && entry.isIntersecting === false) {
|
|
434
|
+
this.isTargetElementVisible = false;
|
|
435
|
+
dropElement.setAttribute('data-visible', 'hidden');
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
|
|
313
439
|
getGroup() {
|
|
314
440
|
const {
|
|
315
441
|
popupGroup
|
|
@@ -325,17 +451,12 @@ const Popup = function (Component) {
|
|
|
325
451
|
needPopupArrow
|
|
326
452
|
} = popup;
|
|
327
453
|
return isArrow !== undefined ? isArrow : needPopupArrow;
|
|
328
|
-
}
|
|
454
|
+
} // getScrollDebounceTime(popup) {
|
|
455
|
+
// const { scrollDebounceTime } = popup.props;
|
|
456
|
+
// const { scrollDebounceTime: popupScrollDebounceTime } = popup;
|
|
457
|
+
// return scrollDebounceTime !== undefined ? scrollDebounceTime : popupScrollDebounceTime;
|
|
458
|
+
// }
|
|
329
459
|
|
|
330
|
-
getScrollDebounceTime(popup) {
|
|
331
|
-
const {
|
|
332
|
-
scrollDebounceTime
|
|
333
|
-
} = popup.props;
|
|
334
|
-
const {
|
|
335
|
-
scrollDebounceTime: popupScrollDebounceTime
|
|
336
|
-
} = popup;
|
|
337
|
-
return scrollDebounceTime !== undefined ? scrollDebounceTime : popupScrollDebounceTime;
|
|
338
|
-
}
|
|
339
460
|
|
|
340
461
|
getCloseOnScrollPopup(popup) {
|
|
341
462
|
const {
|
|
@@ -357,6 +478,16 @@ const Popup = function (Component) {
|
|
|
357
478
|
return isAbsolutePositioningNeeded !== undefined ? isAbsolutePositioningNeeded : isAbsolutePopup;
|
|
358
479
|
}
|
|
359
480
|
|
|
481
|
+
getIsOutsideScrollBlocked(popup) {
|
|
482
|
+
const {
|
|
483
|
+
isOutsideScrollBlocked
|
|
484
|
+
} = popup.props;
|
|
485
|
+
const {
|
|
486
|
+
isOutsideScrollBlock
|
|
487
|
+
} = popup;
|
|
488
|
+
return isOutsideScrollBlocked !== undefined ? isOutsideScrollBlocked : isOutsideScrollBlock;
|
|
489
|
+
}
|
|
490
|
+
|
|
360
491
|
getCustomPositionOrder(popup) {
|
|
361
492
|
const {
|
|
362
493
|
customOrder = []
|
|
@@ -527,10 +658,24 @@ const Popup = function (Component) {
|
|
|
527
658
|
cancelBubblingEffect(e);
|
|
528
659
|
}
|
|
529
660
|
|
|
661
|
+
updatePopupState(view, views, viewsOffset, targetOffset, popupOffset, isAbsolute) {
|
|
662
|
+
const isMobile = isMobilePopover(true);
|
|
663
|
+
this.setState({
|
|
664
|
+
isPopupReady: true,
|
|
665
|
+
position: view,
|
|
666
|
+
positions: views,
|
|
667
|
+
positionsOffset: viewsOffset,
|
|
668
|
+
targetOffset,
|
|
669
|
+
popupOffset,
|
|
670
|
+
isAbsolutePositioningNeeded: isAbsolute,
|
|
671
|
+
isMobile: isMobile
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
|
|
530
675
|
handlePopupPosition() {
|
|
531
676
|
let defaultPosition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'bottomCenter';
|
|
532
|
-
let
|
|
533
|
-
//
|
|
677
|
+
let isUpdatePosition = arguments.length > 1 ? arguments[1] : undefined;
|
|
678
|
+
// isUpdatePosition --->>> Window resize and dropBox resize and to update the position
|
|
534
679
|
const {
|
|
535
680
|
direction
|
|
536
681
|
} = this.context || {};
|
|
@@ -549,9 +694,11 @@ const Popup = function (Component) {
|
|
|
549
694
|
}
|
|
550
695
|
|
|
551
696
|
if (!placeHolderElement && !dropElement) {
|
|
697
|
+
const isMobile = isMobilePopover(true);
|
|
552
698
|
this.setState({
|
|
553
699
|
isPopupOpen: true,
|
|
554
|
-
isPopupReady: true
|
|
700
|
+
isPopupReady: true,
|
|
701
|
+
isMobile: isMobile
|
|
555
702
|
});
|
|
556
703
|
return;
|
|
557
704
|
}
|
|
@@ -578,23 +725,27 @@ const Popup = function (Component) {
|
|
|
578
725
|
viewsOffset,
|
|
579
726
|
targetOffset,
|
|
580
727
|
popupOffset
|
|
581
|
-
} = betterPosition ||
|
|
582
|
-
|
|
583
|
-
if (
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
728
|
+
} = betterPosition || DUMMY_OBJECT;
|
|
729
|
+
|
|
730
|
+
if (!isAbsolute) {
|
|
731
|
+
if (!isPopupReady) {
|
|
732
|
+
this.updatePopupState(view, views, viewsOffset, targetOffset, popupOffset, isAbsolute);
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
if (!dropElement) {
|
|
736
|
+
return;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
this.setContainerDynamicPositioning(betterPosition, needArrow);
|
|
740
|
+
} else {
|
|
741
|
+
if (position !== view || !isPopupReady) {
|
|
742
|
+
this.updatePopupState(view, views, viewsOffset, targetOffset, popupOffset, isAbsolute);
|
|
743
|
+
}
|
|
593
744
|
}
|
|
594
745
|
});
|
|
595
746
|
};
|
|
596
747
|
|
|
597
|
-
if (
|
|
748
|
+
if (isUpdatePosition) {
|
|
598
749
|
setPosition();
|
|
599
750
|
} else {
|
|
600
751
|
this.defaultPosition = defaultPosition;
|
|
@@ -626,6 +777,7 @@ const Popup = function (Component) {
|
|
|
626
777
|
const needArrow = this.getNeedArrow(popup);
|
|
627
778
|
const isAbsolute = this.getIsAbsolutePopup(popup);
|
|
628
779
|
const customOrder = this.getCustomPositionOrder(popup);
|
|
780
|
+
const isMobile = isMobilePopover(true);
|
|
629
781
|
const betterPosition = viewPort.betterView(dropElement, placeHolderElement, defaultPosition, scrollContainer, {
|
|
630
782
|
needArrow,
|
|
631
783
|
isAbsolute,
|
|
@@ -641,14 +793,16 @@ const Popup = function (Component) {
|
|
|
641
793
|
const {
|
|
642
794
|
left: oldLeft = '',
|
|
643
795
|
top: oldTop = '',
|
|
644
|
-
bottom: oldBottom = ''
|
|
796
|
+
bottom: oldBottom = '',
|
|
797
|
+
right: oldRight = ''
|
|
645
798
|
} = positionsOffset[position] || {};
|
|
646
799
|
const {
|
|
647
800
|
left = '',
|
|
648
801
|
top = '',
|
|
649
|
-
bottom = ''
|
|
802
|
+
bottom = '',
|
|
803
|
+
right = ''
|
|
650
804
|
} = viewsOffset[view] || {};
|
|
651
|
-
const changeState = isAbsolute ? position !== view : oldLeft !== left || oldTop !== top || oldBottom !== bottom; // let isInViewPort = viewPort.isInViewPort(
|
|
805
|
+
const changeState = isAbsolute ? position !== view : oldLeft !== left || oldTop !== top || oldBottom !== bottom || oldRight !== right; // let isInViewPort = viewPort.isInViewPort(
|
|
652
806
|
// placeHolderElement,
|
|
653
807
|
// scrollContainer
|
|
654
808
|
// );
|
|
@@ -660,7 +814,8 @@ const Popup = function (Component) {
|
|
|
660
814
|
positionsOffset: viewsOffset,
|
|
661
815
|
targetOffset,
|
|
662
816
|
popupOffset,
|
|
663
|
-
isAbsolutePositioningNeeded: isAbsolute
|
|
817
|
+
isAbsolutePositioningNeeded: isAbsolute,
|
|
818
|
+
isMobile: isMobile
|
|
664
819
|
});
|
|
665
820
|
} // if (!isInViewPort && !isAbsolute) {
|
|
666
821
|
// popup.setState({ isPopupOpen: false, isPopupReady: false });
|
|
@@ -684,26 +839,19 @@ const Popup = function (Component) {
|
|
|
684
839
|
|
|
685
840
|
handleResize() {
|
|
686
841
|
this.handleOpenPopupPositionChange();
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
console.log('onscrollPopupREady');
|
|
700
|
-
}
|
|
842
|
+
} // handleScroll(e) {
|
|
843
|
+
// // this.handleOpenPopupPositionChange();
|
|
844
|
+
// const { closeOnScroll } = this.getCloseOnScrollPopup(this);
|
|
845
|
+
// const { isPopupReady } = this.state;
|
|
846
|
+
// if (isPopupReady) {
|
|
847
|
+
// console.log('onscrollPopupREady');
|
|
848
|
+
// }
|
|
849
|
+
// if (isPopupReady && closeOnScroll) {
|
|
850
|
+
// console.log(this, 'handle Scroll');
|
|
851
|
+
// this.togglePopup(e);
|
|
852
|
+
// }
|
|
853
|
+
// }
|
|
701
854
|
|
|
702
|
-
if (isPopupReady && closeOnScroll) {
|
|
703
|
-
console.log(this, 'handle Scroll');
|
|
704
|
-
this.togglePopup(e);
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
855
|
|
|
708
856
|
handlePopupResize(popupSize) {
|
|
709
857
|
const {
|
|
@@ -735,13 +883,14 @@ const Popup = function (Component) {
|
|
|
735
883
|
}
|
|
736
884
|
|
|
737
885
|
render() {
|
|
886
|
+
// const { isPopupReady, isPopupOpen } = this.state;
|
|
738
887
|
const {
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
} = this.state;
|
|
742
|
-
|
|
888
|
+
isMobile,
|
|
889
|
+
...restState
|
|
890
|
+
} = this.state; // const localState = isPopupReady ? this.state : {};
|
|
891
|
+
|
|
743
892
|
return /*#__PURE__*/React.createElement(Component, { ...this.props,
|
|
744
|
-
...
|
|
893
|
+
...restState,
|
|
745
894
|
openPopupOnly: this.openPopupOnly,
|
|
746
895
|
closePopupOnly: this.closePopupOnly,
|
|
747
896
|
togglePopup: this.togglePopup,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useNumberGenerator, getNumberGenerators } from
|
|
2
|
-
import { getLibraryConfig } from
|
|
1
|
+
import { useNumberGenerator, getNumberGenerators } from "./NumberGenerator/NumberGenerator";
|
|
2
|
+
import { getLibraryConfig } from "./Config";
|
|
3
3
|
let globalId = getLibraryConfig('idCounter'),
|
|
4
4
|
deletedIndexes = [],
|
|
5
5
|
globalPrefix;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import LibraryContextInit from
|
|
4
|
-
import { getLibraryConfig } from
|
|
3
|
+
import LibraryContextInit from "./LibraryContextInit";
|
|
4
|
+
import { getLibraryConfig } from "./Config";
|
|
5
5
|
|
|
6
6
|
const LibraryContextProvider = _ref => {
|
|
7
7
|
let {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useNumberGenerator, getNumberGenerators } from
|
|
2
|
-
import { getLibraryConfig } from
|
|
1
|
+
import { useNumberGenerator, getNumberGenerators } from "./NumberGenerator/NumberGenerator";
|
|
2
|
+
import { getLibraryConfig } from "./Config";
|
|
3
3
|
let globalId = getLibraryConfig('zindexCounter'),
|
|
4
4
|
deletedIndexes = [],
|
|
5
5
|
globalPrefix;
|
package/es/Provider/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { getLibraryConfig, setLibraryConfig } from
|
|
2
|
-
export { default as LibraryContextProvider } from
|
|
3
|
-
export { removeGlobalZIndexPrefix, setInitialZIndex, useZIndex, getZIndex } from
|
|
4
|
-
export { setGlobalIdPrefix, removeGlobalIdPrefix, useUniqueId, getUniqueId } from
|
|
1
|
+
export { getLibraryConfig, setLibraryConfig } from "./Config";
|
|
2
|
+
export { default as LibraryContextProvider } from "./LibraryContext";
|
|
3
|
+
export { removeGlobalZIndexPrefix, setInitialZIndex, useZIndex, getZIndex } from "./ZindexProvider";
|
|
4
|
+
export { setGlobalIdPrefix, removeGlobalIdPrefix, useUniqueId, getUniqueId } from "./IdProvider";
|
package/es/Radio/Radio.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* eslint css-modules/no-unused-class: [2, { markAsUsed: ['small', 'medium'] }] */
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { defaultProps } from
|
|
4
|
-
import { propTypes } from
|
|
5
|
-
import Label from
|
|
6
|
-
import { Container, Box } from
|
|
7
|
-
import CssProvider from
|
|
8
|
-
import style from
|
|
3
|
+
import { defaultProps } from "./props/defaultProps";
|
|
4
|
+
import { propTypes } from "./props/propTypes";
|
|
5
|
+
import Label from "../Label/Label";
|
|
6
|
+
import { Container, Box } from "../Layout";
|
|
7
|
+
import CssProvider from "../Provider/CssProvider";
|
|
8
|
+
import style from "./Radio.module.css";
|
|
9
9
|
export default class Radio extends React.Component {
|
|
10
10
|
constructor(props) {
|
|
11
11
|
super(props);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { useContext, useEffect, useState, useRef, useMemo } from 'react';
|
|
2
|
-
import { CustomResponsiveSender_defaultProps, CustomResponsiveReceiver_defaultProps } from
|
|
3
|
-
import { CustomResponsiveSender_propTypes, CustomResponsiveReceiver_propTypes } from
|
|
4
|
-
import ResizeObserver from
|
|
5
|
-
import DOMRefWrapper from
|
|
6
|
-
import shallowCompare from
|
|
7
|
-
import { isBreackPointMatched, Subscribale, isTouchDevice, windowResizeObserver } from
|
|
8
|
-
import { ContextOptimizer } from
|
|
2
|
+
import { CustomResponsiveSender_defaultProps, CustomResponsiveReceiver_defaultProps } from "./props/defaultProps";
|
|
3
|
+
import { CustomResponsiveSender_propTypes, CustomResponsiveReceiver_propTypes } from "./props/propTypes";
|
|
4
|
+
import ResizeObserver from "./ResizeObserver";
|
|
5
|
+
import DOMRefWrapper from "./RefWrapper";
|
|
6
|
+
import shallowCompare from "./utils/shallowCompare";
|
|
7
|
+
import { isBreackPointMatched, Subscribale, isTouchDevice, windowResizeObserver } from "./sizeObservers";
|
|
8
|
+
import { ContextOptimizer } from "../utils/ContextOptimizer"; // const commonBreakPoints = [ 480, 640, 768, 1024, 1440 ];
|
|
9
9
|
// const otherBreakPoints = [320, 360, 375, 720, 1280, 1600, 1920];
|
|
10
10
|
// defaultResponsiveId means if ResponsiveSender do not recive id This will be id
|
|
11
11
|
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
// 2) debounce Mutation observer and resize observer
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
|
-
import ResizeObserver from
|
|
8
|
-
import { getElementSpace, debounce } from
|
|
7
|
+
import ResizeObserver from "./ResizeObserver";
|
|
8
|
+
import { getElementSpace, debounce } from "../utils/Common";
|
|
9
9
|
export default class ResizeComponent extends React.Component {
|
|
10
10
|
constructor(props) {
|
|
11
11
|
super(props);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { useContext, useEffect, useState, useMemo } from 'react'; // import React, { useState, useMemo, useCallback, useContext } from 'react';
|
|
2
2
|
|
|
3
|
-
import { ResponsiveSender_defaultProps, ResponsiveReceiver_defaultProps } from
|
|
4
|
-
import { ResponsiveSender_propTypes, ResponsiveReceiver_propTypes } from
|
|
5
|
-
import ResizeObserver from
|
|
6
|
-
import DOMRefWrapper from
|
|
7
|
-
import { windowResizeObserver } from
|
|
8
|
-
import { getBreakPointValue, defaultMatcher } from
|
|
3
|
+
import { ResponsiveSender_defaultProps, ResponsiveReceiver_defaultProps } from "./props/defaultProps";
|
|
4
|
+
import { ResponsiveSender_propTypes, ResponsiveReceiver_propTypes } from "./props/propTypes";
|
|
5
|
+
import ResizeObserver from "./ResizeObserver";
|
|
6
|
+
import DOMRefWrapper from "./RefWrapper";
|
|
7
|
+
import { windowResizeObserver } from "./windowResizeObserver";
|
|
8
|
+
import { getBreakPointValue, defaultMatcher } from "./utils/"; // const sortedBreackPointKey = [ 'MOBILE_XS', 'MOBILE_S', 'MOBILE_M', 'MOBILE', 'TABLET_S', 'TABLET_M', 'TABLET', 'LAPTOP_S', 'LAPTOP_M', 'LAPTOP', 'MONITOR_M', 'MONITOR'];
|
|
9
9
|
|
|
10
10
|
export const ResponsiveContext = /*#__PURE__*/React.createContext({});
|
|
11
11
|
const defaultResponsiveId = 'parentReceiver';
|