@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/lib/Popup/Popup.js
CHANGED
|
@@ -23,10 +23,22 @@ var _ResizeObserver = _interopRequireDefault(require("@zohodesk/virtualizer/lib/
|
|
|
23
23
|
|
|
24
24
|
var _intersectionObserver = require("./intersectionObserver");
|
|
25
25
|
|
|
26
|
+
var _DropBoxPositionMapping = require("../DropBox/DropBoxPositionMapping.js");
|
|
27
|
+
|
|
28
|
+
var _isMobilePopover = _interopRequireDefault(require("../DropBox/utils/isMobilePopover.js"));
|
|
29
|
+
|
|
30
|
+
var _selectn = _interopRequireDefault(require("selectn"));
|
|
31
|
+
|
|
32
|
+
var _excluded = ["isMobile"];
|
|
33
|
+
|
|
26
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
35
|
|
|
28
36
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
29
37
|
|
|
38
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
39
|
+
|
|
40
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
41
|
+
|
|
30
42
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
31
43
|
|
|
32
44
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -103,7 +115,9 @@ var Popup = function Popup(Component) {
|
|
|
103
115
|
_ref$scrollDebounceTi = _ref.scrollDebounceTime,
|
|
104
116
|
popupScrollDebounceTime = _ref$scrollDebounceTi === void 0 ? 0 : _ref$scrollDebounceTi,
|
|
105
117
|
_ref$closeOnScroll = _ref.closeOnScroll,
|
|
106
|
-
closeOnScrollPopup = _ref$closeOnScroll === void 0 ? false : _ref$closeOnScroll
|
|
118
|
+
closeOnScrollPopup = _ref$closeOnScroll === void 0 ? false : _ref$closeOnScroll,
|
|
119
|
+
_ref$isOutsideScrollB = _ref.isOutsideScrollBlocked,
|
|
120
|
+
isOutsideScrollBlock = _ref$isOutsideScrollB === void 0 ? false : _ref$isOutsideScrollB;
|
|
107
121
|
|
|
108
122
|
var Popup = /*#__PURE__*/function (_React$Component) {
|
|
109
123
|
_inherits(Popup, _React$Component);
|
|
@@ -129,7 +143,8 @@ var Popup = function Popup(Component) {
|
|
|
129
143
|
//{height: ‘’, width: ‘’,}
|
|
130
144
|
popupOffset: {},
|
|
131
145
|
//{height: ‘’, width: ‘’,}
|
|
132
|
-
isAbsolutePositioningNeeded: true
|
|
146
|
+
isAbsolutePositioningNeeded: true,
|
|
147
|
+
isMobile: false
|
|
133
148
|
};
|
|
134
149
|
_this.togglePopup = _this.togglePopup.bind(_assertThisInitialized(_this));
|
|
135
150
|
_this.documentClickHandler = _this.documentClickHandler.bind(_assertThisInitialized(_this));
|
|
@@ -144,10 +159,11 @@ var Popup = function Popup(Component) {
|
|
|
144
159
|
_this.handleResize = (0, _Common.debounce)(_this.handleResize.bind(_assertThisInitialized(_this)), 300);
|
|
145
160
|
_this.handlePopupResize = _this.handlePopupResize.bind(_assertThisInitialized(_this));
|
|
146
161
|
_this.getIsAbsolutePopup = _this.getIsAbsolutePopup.bind(_assertThisInitialized(_this));
|
|
162
|
+
_this.getIsOutsideScrollBlocked = _this.getIsOutsideScrollBlocked.bind(_assertThisInitialized(_this));
|
|
147
163
|
_this.getNeedArrow = _this.getNeedArrow.bind(_assertThisInitialized(_this));
|
|
148
164
|
_this.getCustomPositionOrder = _this.getCustomPositionOrder.bind(_assertThisInitialized(_this));
|
|
149
|
-
_this.handleOpenPopupPositionChange = _this.handleOpenPopupPositionChange.bind(_assertThisInitialized(_this));
|
|
150
|
-
|
|
165
|
+
_this.handleOpenPopupPositionChange = _this.handleOpenPopupPositionChange.bind(_assertThisInitialized(_this)); // this.getScrollDebounceTime = this.getScrollDebounceTime.bind(this);
|
|
166
|
+
|
|
151
167
|
_this.getCloseOnScrollPopup = _this.getCloseOnScrollPopup.bind(_assertThisInitialized(_this));
|
|
152
168
|
_this.handleCloseLastOpenedGroup = _this.handleCloseLastOpenedGroup.bind(_assertThisInitialized(_this));
|
|
153
169
|
_this.handleDocumentMouseDown = _this.handleDocumentMouseDown.bind(_assertThisInitialized(_this));
|
|
@@ -161,20 +177,27 @@ var Popup = function Popup(Component) {
|
|
|
161
177
|
_this.handleAddingScrollBlock = _this.handleAddingScrollBlock.bind(_assertThisInitialized(_this));
|
|
162
178
|
_this.handleRemovingScrollBlock = _this.handleRemovingScrollBlock.bind(_assertThisInitialized(_this));
|
|
163
179
|
_this.handleIntersectionObserver = _this.handleIntersectionObserver.bind(_assertThisInitialized(_this));
|
|
180
|
+
_this.updateVisibilityOnIntersection = _this.updateVisibilityOnIntersection.bind(_assertThisInitialized(_this));
|
|
181
|
+
_this.handleAddingScrollToUpdatePosition = _this.handleAddingScrollToUpdatePosition.bind(_assertThisInitialized(_this));
|
|
182
|
+
_this.handleRemovingScrollToUpdatePosition = _this.handleRemovingScrollToUpdatePosition.bind(_assertThisInitialized(_this));
|
|
183
|
+
_this.updatePositionOnScroll = _this.updatePositionOnScroll.bind(_assertThisInitialized(_this));
|
|
184
|
+
_this.setContainerDynamicPositioning = _this.setContainerDynamicPositioning.bind(_assertThisInitialized(_this));
|
|
185
|
+
_this.updatePopupState = _this.updatePopupState.bind(_assertThisInitialized(_this));
|
|
186
|
+
_this.handleScrollAndBlockEvents = _this.handleScrollAndBlockEvents.bind(_assertThisInitialized(_this));
|
|
187
|
+
_this.handleDropElementStyleUpdate = _this.handleDropElementStyleUpdate.bind(_assertThisInitialized(_this));
|
|
188
|
+
_this.positionRef = /*#__PURE__*/_react["default"].createRef();
|
|
164
189
|
_this.popupObserver = new _ResizeObserver["default"](_this.handlePopupResize); //dropBoxSize
|
|
165
190
|
|
|
166
191
|
_this.size = null;
|
|
192
|
+
_this.isTargetElementVisible = false;
|
|
167
193
|
_this.isAbsolutePopup = isAbsolutePopup;
|
|
168
194
|
_this.needPopupArrow = needPopupArrow;
|
|
169
195
|
_this.customPositionOrder = customPositionOrder;
|
|
170
196
|
_this.scrollDebounceTime = popupScrollDebounceTime;
|
|
171
197
|
_this.closeOnScroll = closeOnScrollPopup;
|
|
198
|
+
_this.isOutsideScrollBlock = isOutsideScrollBlock; // const { scrollDebounceTime } = this.getScrollDebounceTime(this);
|
|
199
|
+
// this.handleScroll = debounce(this.handleScroll.bind(this), scrollDebounceTime);
|
|
172
200
|
|
|
173
|
-
var _this$getScrollDeboun = _this.getScrollDebounceTime(_assertThisInitialized(_this)),
|
|
174
|
-
scrollDebounceTime = _this$getScrollDeboun.scrollDebounceTime;
|
|
175
|
-
|
|
176
|
-
_this.handleScroll = (0, _Common.debounce)(_this.handleScroll.bind(_assertThisInitialized(_this)), scrollDebounceTime);
|
|
177
|
-
_this.handleDebouncedPositionChange = (0, _Common.debounce)(_this.handlePositionChange.bind(_assertThisInitialized(_this)), 100);
|
|
178
201
|
return _this;
|
|
179
202
|
}
|
|
180
203
|
|
|
@@ -208,14 +231,28 @@ var Popup = function Popup(Component) {
|
|
|
208
231
|
});
|
|
209
232
|
}
|
|
210
233
|
}
|
|
234
|
+
}, {
|
|
235
|
+
key: "handleScrollAndBlockEvents",
|
|
236
|
+
value: function handleScrollAndBlockEvents(isPopupReady, isMobile) {
|
|
237
|
+
if (isPopupReady && !isMobile) {
|
|
238
|
+
this.handleAddingScrollBlock();
|
|
239
|
+
this.handleAddingScrollToUpdatePosition();
|
|
240
|
+
} else {
|
|
241
|
+
this.handleRemovingScrollBlock();
|
|
242
|
+
this.handleRemovingScrollToUpdatePosition();
|
|
243
|
+
}
|
|
244
|
+
}
|
|
211
245
|
}, {
|
|
212
246
|
key: "componentDidUpdate",
|
|
213
247
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
214
|
-
var
|
|
248
|
+
var _this$state = this.state,
|
|
249
|
+
isPopupReady = _this$state.isPopupReady,
|
|
250
|
+
isMobile = _this$state.isMobile;
|
|
215
251
|
|
|
216
252
|
var _ref2 = prevState || {},
|
|
217
253
|
_ref2$isPopupReady = _ref2.isPopupReady,
|
|
218
|
-
oldStateOpen = _ref2$isPopupReady === void 0 ? false : _ref2$isPopupReady
|
|
254
|
+
oldStateOpen = _ref2$isPopupReady === void 0 ? false : _ref2$isPopupReady,
|
|
255
|
+
oldIsMobileState = _ref2.isMobile;
|
|
219
256
|
|
|
220
257
|
var dropElement = this.dropElement;
|
|
221
258
|
var propResizeHandling = this.props.needResizeHandling;
|
|
@@ -227,12 +264,10 @@ var Popup = function Popup(Component) {
|
|
|
227
264
|
this.size = null;
|
|
228
265
|
this.popupObserver.disconnect();
|
|
229
266
|
}
|
|
267
|
+
}
|
|
230
268
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
} else {
|
|
234
|
-
this.handleRemovingScrollBlock();
|
|
235
|
-
}
|
|
269
|
+
if (oldStateOpen !== isPopupReady && !isMobile || oldIsMobileState !== isMobile) {
|
|
270
|
+
this.handleScrollAndBlockEvents(isPopupReady, isMobile);
|
|
236
271
|
}
|
|
237
272
|
}
|
|
238
273
|
}, {
|
|
@@ -254,6 +289,7 @@ var Popup = function Popup(Component) {
|
|
|
254
289
|
return res;
|
|
255
290
|
}, popups);
|
|
256
291
|
this.handleRemovingScrollBlock();
|
|
292
|
+
this.handleRemovingScrollToUpdatePosition();
|
|
257
293
|
var noPopups = true;
|
|
258
294
|
|
|
259
295
|
for (var i in popups) {
|
|
@@ -280,9 +316,8 @@ var Popup = function Popup(Component) {
|
|
|
280
316
|
}, {
|
|
281
317
|
key: "handleAddingScrollBlock",
|
|
282
318
|
value: function handleAddingScrollBlock() {
|
|
283
|
-
var
|
|
284
|
-
|
|
285
|
-
isOutsideScrollBlocked = _this$props.isOutsideScrollBlocked;
|
|
319
|
+
var isAbsolutePositioningNeeded = this.getIsAbsolutePopup(this);
|
|
320
|
+
var isOutsideScrollBlocked = this.getIsOutsideScrollBlocked(this);
|
|
286
321
|
|
|
287
322
|
if (isOutsideScrollBlocked && !isAbsolutePositioningNeeded) {
|
|
288
323
|
(0, _intersectionObserver.addIntersectionObserver)(this.placeHolderElement, this.handleIntersectionObserver);
|
|
@@ -292,15 +327,106 @@ var Popup = function Popup(Component) {
|
|
|
292
327
|
}, {
|
|
293
328
|
key: "handleRemovingScrollBlock",
|
|
294
329
|
value: function handleRemovingScrollBlock() {
|
|
295
|
-
var
|
|
296
|
-
|
|
297
|
-
isOutsideScrollBlocked = _this$props2.isOutsideScrollBlocked;
|
|
330
|
+
var isAbsolutePositioningNeeded = this.getIsAbsolutePopup(this);
|
|
331
|
+
var isOutsideScrollBlocked = this.getIsOutsideScrollBlocked(this);
|
|
298
332
|
|
|
299
333
|
if (isOutsideScrollBlocked && !isAbsolutePositioningNeeded) {
|
|
300
334
|
(0, _intersectionObserver.removeIntersectionObserver)(this.placeHolderElement, this.handleIntersectionObserver);
|
|
301
335
|
this.removeScrollBlockListeners();
|
|
302
336
|
}
|
|
303
337
|
}
|
|
338
|
+
}, {
|
|
339
|
+
key: "handleAddingScrollToUpdatePosition",
|
|
340
|
+
value: function handleAddingScrollToUpdatePosition() {
|
|
341
|
+
var isAbsolutePositioningNeeded = this.getIsAbsolutePopup(this);
|
|
342
|
+
var isOutsideScrollBlocked = this.getIsOutsideScrollBlocked(this);
|
|
343
|
+
|
|
344
|
+
if (!isOutsideScrollBlocked && !isAbsolutePositioningNeeded) {
|
|
345
|
+
(0, _intersectionObserver.addIntersectionObserver)(this.placeHolderElement, this.updateVisibilityOnIntersection);
|
|
346
|
+
document.addEventListener('scroll', this.updatePositionOnScroll, {
|
|
347
|
+
capture: true,
|
|
348
|
+
passive: false
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}, {
|
|
353
|
+
key: "handleRemovingScrollToUpdatePosition",
|
|
354
|
+
value: function handleRemovingScrollToUpdatePosition() {
|
|
355
|
+
var isAbsolutePositioningNeeded = this.getIsAbsolutePopup(this);
|
|
356
|
+
var isOutsideScrollBlocked = this.getIsOutsideScrollBlocked(this);
|
|
357
|
+
|
|
358
|
+
if (!isOutsideScrollBlocked && !isAbsolutePositioningNeeded) {
|
|
359
|
+
(0, _intersectionObserver.removeIntersectionObserver)(this.placeHolderElement, this.updateVisibilityOnIntersection);
|
|
360
|
+
document.removeEventListener('scroll', this.updatePositionOnScroll, {
|
|
361
|
+
capture: true,
|
|
362
|
+
passive: false
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}, {
|
|
367
|
+
key: "handleDropElementStyleUpdate",
|
|
368
|
+
value: function handleDropElementStyleUpdate(_ref3) {
|
|
369
|
+
var _ref3$top = _ref3.top,
|
|
370
|
+
top = _ref3$top === void 0 ? '' : _ref3$top,
|
|
371
|
+
_ref3$left = _ref3.left,
|
|
372
|
+
left = _ref3$left === void 0 ? '' : _ref3$left,
|
|
373
|
+
_ref3$bottom = _ref3.bottom,
|
|
374
|
+
bottom = _ref3$bottom === void 0 ? '' : _ref3$bottom,
|
|
375
|
+
_ref3$right = _ref3.right,
|
|
376
|
+
right = _ref3$right === void 0 ? '' : _ref3$right;
|
|
377
|
+
var dropElement = this.dropElement;
|
|
378
|
+
Object.assign(dropElement.style, {
|
|
379
|
+
top: top ? "".concat(top, "px") : '',
|
|
380
|
+
left: left ? "".concat(left, "px") : '',
|
|
381
|
+
right: right ? "".concat(right, "px") : '',
|
|
382
|
+
bottom: bottom ? "".concat(bottom, "px") : ''
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
}, {
|
|
386
|
+
key: "setContainerDynamicPositioning",
|
|
387
|
+
value: function setContainerDynamicPositioning(betterPosition, needArrow) {
|
|
388
|
+
var dropElement = this.dropElement;
|
|
389
|
+
var isMobile = this.state.isMobile;
|
|
390
|
+
|
|
391
|
+
var _ref4 = betterPosition || _Common.DUMMY_OBJECT,
|
|
392
|
+
view = _ref4.view,
|
|
393
|
+
viewsOffset = _ref4.viewsOffset;
|
|
394
|
+
|
|
395
|
+
var styleToApply = (0, _selectn["default"])("".concat(view), viewsOffset);
|
|
396
|
+
|
|
397
|
+
if (isMobile) {
|
|
398
|
+
this.handleDropElementStyleUpdate({
|
|
399
|
+
top: '',
|
|
400
|
+
left: '',
|
|
401
|
+
right: '',
|
|
402
|
+
bottom: ''
|
|
403
|
+
});
|
|
404
|
+
} else {
|
|
405
|
+
this.handleDropElementStyleUpdate(styleToApply);
|
|
406
|
+
|
|
407
|
+
if (this.positionRef.current !== view) {
|
|
408
|
+
dropElement.setAttribute('data-position', "".concat(view));
|
|
409
|
+
dropElement.setAttribute('data-box-direction', (0, _selectn["default"])("".concat(view, ".direction"), _DropBoxPositionMapping.positionMapping));
|
|
410
|
+
|
|
411
|
+
if (needArrow) {
|
|
412
|
+
dropElement.setAttribute('data-arrow-position', (0, _selectn["default"])("".concat(view, ".arrowPosition"), _DropBoxPositionMapping.positionMapping));
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
this.positionRef.current = view;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}, {
|
|
420
|
+
key: "updatePositionOnScroll",
|
|
421
|
+
value: function updatePositionOnScroll(e) {
|
|
422
|
+
var placeHolderElement = this.placeHolderElement,
|
|
423
|
+
defaultPosition = this.defaultPosition,
|
|
424
|
+
isTargetElementVisible = this.isTargetElementVisible;
|
|
425
|
+
|
|
426
|
+
if (e.target.contains(placeHolderElement) && isTargetElementVisible) {
|
|
427
|
+
this.handlePopupPosition(defaultPosition, true);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
304
430
|
}, {
|
|
305
431
|
key: "addScrollBlockListeners",
|
|
306
432
|
value: function addScrollBlockListeners() {
|
|
@@ -312,7 +438,7 @@ var Popup = function Popup(Component) {
|
|
|
312
438
|
capture: true,
|
|
313
439
|
passive: false
|
|
314
440
|
});
|
|
315
|
-
document.addEventListener('scroll', this.
|
|
441
|
+
document.addEventListener('scroll', this.handlePositionChange, {
|
|
316
442
|
capture: true,
|
|
317
443
|
passive: false
|
|
318
444
|
});
|
|
@@ -332,7 +458,7 @@ var Popup = function Popup(Component) {
|
|
|
332
458
|
capture: true,
|
|
333
459
|
passive: false
|
|
334
460
|
});
|
|
335
|
-
document.removeEventListener('scroll', this.
|
|
461
|
+
document.removeEventListener('scroll', this.handlePositionChange, {
|
|
336
462
|
capture: true,
|
|
337
463
|
passive: false
|
|
338
464
|
});
|
|
@@ -363,7 +489,7 @@ var Popup = function Popup(Component) {
|
|
|
363
489
|
var containerElement = this.dropElement;
|
|
364
490
|
|
|
365
491
|
if (containerElement && containerElement !== event.target && !containerElement.contains(event.target) && targetElement && targetElement !== event.target && !targetElement.contains(event.target) && event.target.contains(targetElement)) {
|
|
366
|
-
this.handlePopupPosition(this.state.position); // this.closePopupOnly(event);
|
|
492
|
+
this.handlePopupPosition(this.state.position, true); // this.closePopupOnly(event);
|
|
367
493
|
}
|
|
368
494
|
}
|
|
369
495
|
}, {
|
|
@@ -379,10 +505,23 @@ var Popup = function Popup(Component) {
|
|
|
379
505
|
}, {
|
|
380
506
|
key: "handleIntersectionObserver",
|
|
381
507
|
value: function handleIntersectionObserver(entry) {
|
|
382
|
-
if (entry.intersectionRatio === 0) {
|
|
508
|
+
if (entry.intersectionRatio === 0 && entry.isIntersecting === false) {
|
|
383
509
|
this.closePopupOnly();
|
|
384
510
|
}
|
|
385
511
|
}
|
|
512
|
+
}, {
|
|
513
|
+
key: "updateVisibilityOnIntersection",
|
|
514
|
+
value: function updateVisibilityOnIntersection(entry) {
|
|
515
|
+
var dropElement = this.dropElement;
|
|
516
|
+
|
|
517
|
+
if (entry.isIntersecting === true) {
|
|
518
|
+
this.isTargetElementVisible = true;
|
|
519
|
+
dropElement.setAttribute('data-visible', 'visible');
|
|
520
|
+
} else if (entry.intersectionRatio === 0 && entry.isIntersecting === false) {
|
|
521
|
+
this.isTargetElementVisible = false;
|
|
522
|
+
dropElement.setAttribute('data-visible', 'hidden');
|
|
523
|
+
}
|
|
524
|
+
}
|
|
386
525
|
}, {
|
|
387
526
|
key: "getGroup",
|
|
388
527
|
value: function getGroup() {
|
|
@@ -395,14 +534,12 @@ var Popup = function Popup(Component) {
|
|
|
395
534
|
var isArrow = popup.props.isArrow;
|
|
396
535
|
var needPopupArrow = popup.needPopupArrow;
|
|
397
536
|
return isArrow !== undefined ? isArrow : needPopupArrow;
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
return scrollDebounceTime !== undefined ? scrollDebounceTime : popupScrollDebounceTime;
|
|
405
|
-
}
|
|
537
|
+
} // getScrollDebounceTime(popup) {
|
|
538
|
+
// const { scrollDebounceTime } = popup.props;
|
|
539
|
+
// const { scrollDebounceTime: popupScrollDebounceTime } = popup;
|
|
540
|
+
// return scrollDebounceTime !== undefined ? scrollDebounceTime : popupScrollDebounceTime;
|
|
541
|
+
// }
|
|
542
|
+
|
|
406
543
|
}, {
|
|
407
544
|
key: "getCloseOnScrollPopup",
|
|
408
545
|
value: function getCloseOnScrollPopup(popup) {
|
|
@@ -417,6 +554,13 @@ var Popup = function Popup(Component) {
|
|
|
417
554
|
var isAbsolutePopup = popup.isAbsolutePopup;
|
|
418
555
|
return isAbsolutePositioningNeeded !== undefined ? isAbsolutePositioningNeeded : isAbsolutePopup;
|
|
419
556
|
}
|
|
557
|
+
}, {
|
|
558
|
+
key: "getIsOutsideScrollBlocked",
|
|
559
|
+
value: function getIsOutsideScrollBlocked(popup) {
|
|
560
|
+
var isOutsideScrollBlocked = popup.props.isOutsideScrollBlocked;
|
|
561
|
+
var isOutsideScrollBlock = popup.isOutsideScrollBlock;
|
|
562
|
+
return isOutsideScrollBlocked !== undefined ? isOutsideScrollBlocked : isOutsideScrollBlock;
|
|
563
|
+
}
|
|
420
564
|
}, {
|
|
421
565
|
key: "getCustomPositionOrder",
|
|
422
566
|
value: function getCustomPositionOrder(popup) {
|
|
@@ -589,17 +733,32 @@ var Popup = function Popup(Component) {
|
|
|
589
733
|
// e && e.preventDefault && e.preventDefault();
|
|
590
734
|
(0, _Common.cancelBubblingEffect)(e);
|
|
591
735
|
}
|
|
736
|
+
}, {
|
|
737
|
+
key: "updatePopupState",
|
|
738
|
+
value: function updatePopupState(view, views, viewsOffset, targetOffset, popupOffset, isAbsolute) {
|
|
739
|
+
var isMobile = (0, _isMobilePopover["default"])(true);
|
|
740
|
+
this.setState({
|
|
741
|
+
isPopupReady: true,
|
|
742
|
+
position: view,
|
|
743
|
+
positions: views,
|
|
744
|
+
positionsOffset: viewsOffset,
|
|
745
|
+
targetOffset: targetOffset,
|
|
746
|
+
popupOffset: popupOffset,
|
|
747
|
+
isAbsolutePositioningNeeded: isAbsolute,
|
|
748
|
+
isMobile: isMobile
|
|
749
|
+
});
|
|
750
|
+
}
|
|
592
751
|
}, {
|
|
593
752
|
key: "handlePopupPosition",
|
|
594
753
|
value: function handlePopupPosition() {
|
|
595
754
|
var _this4 = this;
|
|
596
755
|
|
|
597
756
|
var defaultPosition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'bottomCenter';
|
|
598
|
-
var
|
|
757
|
+
var isUpdatePosition = arguments.length > 1 ? arguments[1] : undefined;
|
|
599
758
|
|
|
600
|
-
//
|
|
601
|
-
var
|
|
602
|
-
direction =
|
|
759
|
+
// isUpdatePosition --->>> Window resize and dropBox resize and to update the position
|
|
760
|
+
var _ref5 = this.context || {},
|
|
761
|
+
direction = _ref5.direction;
|
|
603
762
|
|
|
604
763
|
var placeHolderElement = this.placeHolderElement,
|
|
605
764
|
dropElement = this.dropElement;
|
|
@@ -614,9 +773,11 @@ var Popup = function Popup(Component) {
|
|
|
614
773
|
}
|
|
615
774
|
|
|
616
775
|
if (!placeHolderElement && !dropElement) {
|
|
776
|
+
var isMobile = (0, _isMobilePopover["default"])(true);
|
|
617
777
|
this.setState({
|
|
618
778
|
isPopupOpen: true,
|
|
619
|
-
isPopupReady: true
|
|
779
|
+
isPopupReady: true,
|
|
780
|
+
isMobile: isMobile
|
|
620
781
|
});
|
|
621
782
|
return;
|
|
622
783
|
}
|
|
@@ -636,28 +797,32 @@ var Popup = function Popup(Component) {
|
|
|
636
797
|
customOrder: customOrder
|
|
637
798
|
});
|
|
638
799
|
|
|
639
|
-
var
|
|
640
|
-
view =
|
|
641
|
-
views =
|
|
642
|
-
viewsOffset =
|
|
643
|
-
targetOffset =
|
|
644
|
-
popupOffset =
|
|
645
|
-
|
|
646
|
-
if (
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
800
|
+
var _ref6 = betterPosition || _Common.DUMMY_OBJECT,
|
|
801
|
+
view = _ref6.view,
|
|
802
|
+
views = _ref6.views,
|
|
803
|
+
viewsOffset = _ref6.viewsOffset,
|
|
804
|
+
targetOffset = _ref6.targetOffset,
|
|
805
|
+
popupOffset = _ref6.popupOffset;
|
|
806
|
+
|
|
807
|
+
if (!isAbsolute) {
|
|
808
|
+
if (!isPopupReady) {
|
|
809
|
+
_this4.updatePopupState(view, views, viewsOffset, targetOffset, popupOffset, isAbsolute);
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
if (!dropElement) {
|
|
813
|
+
return;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
_this4.setContainerDynamicPositioning(betterPosition, needArrow);
|
|
817
|
+
} else {
|
|
818
|
+
if (position !== view || !isPopupReady) {
|
|
819
|
+
_this4.updatePopupState(view, views, viewsOffset, targetOffset, popupOffset, isAbsolute);
|
|
820
|
+
}
|
|
656
821
|
}
|
|
657
822
|
});
|
|
658
823
|
};
|
|
659
824
|
|
|
660
|
-
if (
|
|
825
|
+
if (isUpdatePosition) {
|
|
661
826
|
setPosition();
|
|
662
827
|
} else {
|
|
663
828
|
this.defaultPosition = defaultPosition;
|
|
@@ -693,37 +858,43 @@ var Popup = function Popup(Component) {
|
|
|
693
858
|
|
|
694
859
|
var customOrder = _this5.getCustomPositionOrder(popup);
|
|
695
860
|
|
|
861
|
+
var isMobile = (0, _isMobilePopover["default"])(true);
|
|
862
|
+
|
|
696
863
|
var betterPosition = _viewPort["default"].betterView(dropElement, placeHolderElement, defaultPosition, scrollContainer, {
|
|
697
864
|
needArrow: needArrow,
|
|
698
865
|
isAbsolute: isAbsolute,
|
|
699
866
|
customOrder: customOrder
|
|
700
867
|
});
|
|
701
868
|
|
|
702
|
-
var
|
|
703
|
-
view =
|
|
704
|
-
views =
|
|
705
|
-
|
|
706
|
-
viewsOffset =
|
|
707
|
-
targetOffset =
|
|
708
|
-
popupOffset =
|
|
709
|
-
|
|
710
|
-
var
|
|
711
|
-
|
|
712
|
-
oldLeft =
|
|
713
|
-
|
|
714
|
-
oldTop =
|
|
715
|
-
|
|
716
|
-
oldBottom =
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
869
|
+
var _ref7 = betterPosition || {},
|
|
870
|
+
view = _ref7.view,
|
|
871
|
+
views = _ref7.views,
|
|
872
|
+
_ref7$viewsOffset = _ref7.viewsOffset,
|
|
873
|
+
viewsOffset = _ref7$viewsOffset === void 0 ? {} : _ref7$viewsOffset,
|
|
874
|
+
targetOffset = _ref7.targetOffset,
|
|
875
|
+
popupOffset = _ref7.popupOffset;
|
|
876
|
+
|
|
877
|
+
var _ref8 = positionsOffset[position] || {},
|
|
878
|
+
_ref8$left = _ref8.left,
|
|
879
|
+
oldLeft = _ref8$left === void 0 ? '' : _ref8$left,
|
|
880
|
+
_ref8$top = _ref8.top,
|
|
881
|
+
oldTop = _ref8$top === void 0 ? '' : _ref8$top,
|
|
882
|
+
_ref8$bottom = _ref8.bottom,
|
|
883
|
+
oldBottom = _ref8$bottom === void 0 ? '' : _ref8$bottom,
|
|
884
|
+
_ref8$right = _ref8.right,
|
|
885
|
+
oldRight = _ref8$right === void 0 ? '' : _ref8$right;
|
|
886
|
+
|
|
887
|
+
var _ref9 = viewsOffset[view] || {},
|
|
888
|
+
_ref9$left = _ref9.left,
|
|
889
|
+
left = _ref9$left === void 0 ? '' : _ref9$left,
|
|
890
|
+
_ref9$top = _ref9.top,
|
|
891
|
+
top = _ref9$top === void 0 ? '' : _ref9$top,
|
|
892
|
+
_ref9$bottom = _ref9.bottom,
|
|
893
|
+
bottom = _ref9$bottom === void 0 ? '' : _ref9$bottom,
|
|
894
|
+
_ref9$right = _ref9.right,
|
|
895
|
+
right = _ref9$right === void 0 ? '' : _ref9$right;
|
|
896
|
+
|
|
897
|
+
var changeState = isAbsolute ? position !== view : oldLeft !== left || oldTop !== top || oldBottom !== bottom || oldRight !== right; // let isInViewPort = viewPort.isInViewPort(
|
|
727
898
|
// placeHolderElement,
|
|
728
899
|
// scrollContainer
|
|
729
900
|
// );
|
|
@@ -735,7 +906,8 @@ var Popup = function Popup(Component) {
|
|
|
735
906
|
positionsOffset: viewsOffset,
|
|
736
907
|
targetOffset: targetOffset,
|
|
737
908
|
popupOffset: popupOffset,
|
|
738
|
-
isAbsolutePositioningNeeded: isAbsolute
|
|
909
|
+
isAbsolutePositioningNeeded: isAbsolute,
|
|
910
|
+
isMobile: isMobile
|
|
739
911
|
});
|
|
740
912
|
} // if (!isInViewPort && !isAbsolute) {
|
|
741
913
|
// popup.setState({ isPopupOpen: false, isPopupReady: false });
|
|
@@ -760,40 +932,34 @@ var Popup = function Popup(Component) {
|
|
|
760
932
|
key: "handleResize",
|
|
761
933
|
value: function handleResize() {
|
|
762
934
|
this.handleOpenPopupPositionChange();
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
}
|
|
935
|
+
} // handleScroll(e) {
|
|
936
|
+
// // this.handleOpenPopupPositionChange();
|
|
937
|
+
// const { closeOnScroll } = this.getCloseOnScrollPopup(this);
|
|
938
|
+
// const { isPopupReady } = this.state;
|
|
939
|
+
// if (isPopupReady) {
|
|
940
|
+
// console.log('onscrollPopupREady');
|
|
941
|
+
// }
|
|
942
|
+
// if (isPopupReady && closeOnScroll) {
|
|
943
|
+
// console.log(this, 'handle Scroll');
|
|
944
|
+
// this.togglePopup(e);
|
|
945
|
+
// }
|
|
946
|
+
// }
|
|
776
947
|
|
|
777
|
-
if (isPopupReady && closeOnScroll) {
|
|
778
|
-
console.log(this, 'handle Scroll');
|
|
779
|
-
this.togglePopup(e);
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
948
|
}, {
|
|
783
949
|
key: "handlePopupResize",
|
|
784
950
|
value: function handlePopupResize(popupSize) {
|
|
785
951
|
var height = popupSize.height,
|
|
786
952
|
width = popupSize.width;
|
|
787
953
|
|
|
788
|
-
var
|
|
789
|
-
|
|
790
|
-
oldHeight =
|
|
791
|
-
|
|
792
|
-
oldWidth =
|
|
954
|
+
var _ref10 = this.size || {},
|
|
955
|
+
_ref10$height = _ref10.height,
|
|
956
|
+
oldHeight = _ref10$height === void 0 ? 0 : _ref10$height,
|
|
957
|
+
_ref10$width = _ref10.width,
|
|
958
|
+
oldWidth = _ref10$width === void 0 ? 0 : _ref10$width;
|
|
793
959
|
|
|
794
|
-
var _this$
|
|
795
|
-
isPopupReady = _this$
|
|
796
|
-
position = _this$
|
|
960
|
+
var _this$state2 = this.state,
|
|
961
|
+
isPopupReady = _this$state2.isPopupReady,
|
|
962
|
+
position = _this$state2.position;
|
|
797
963
|
|
|
798
964
|
if (isPopupReady && this.size && (oldHeight !== height || width !== oldWidth)) {
|
|
799
965
|
this.handlePopupPosition(position, true);
|
|
@@ -814,11 +980,13 @@ var Popup = function Popup(Component) {
|
|
|
814
980
|
}, {
|
|
815
981
|
key: "render",
|
|
816
982
|
value: function render() {
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
983
|
+
// const { isPopupReady, isPopupOpen } = this.state;
|
|
984
|
+
var _this$state3 = this.state,
|
|
985
|
+
isMobile = _this$state3.isMobile,
|
|
986
|
+
restState = _objectWithoutProperties(_this$state3, _excluded); // const localState = isPopupReady ? this.state : {};
|
|
987
|
+
|
|
988
|
+
|
|
989
|
+
return /*#__PURE__*/_react["default"].createElement(Component, _extends({}, this.props, restState, {
|
|
822
990
|
openPopupOnly: this.openPopupOnly,
|
|
823
991
|
closePopupOnly: this.closePopupOnly,
|
|
824
992
|
togglePopup: this.togglePopup,
|
|
@@ -5,6 +5,8 @@ exports[`ResponsiveDropBox rendering the defult props 1`] = `
|
|
|
5
5
|
<div
|
|
6
6
|
class="main hidden container bottomStart default"
|
|
7
7
|
data-a11y-focus-main-area="true"
|
|
8
|
+
data-arrow-position="end"
|
|
9
|
+
data-box-direction="bottom"
|
|
8
10
|
data-id="dropBox"
|
|
9
11
|
data-position="bottomStart"
|
|
10
12
|
data-selector-id="dropBox"
|
|
@@ -12,14 +14,14 @@ exports[`ResponsiveDropBox rendering the defult props 1`] = `
|
|
|
12
14
|
dot-ui-element="dropbox"
|
|
13
15
|
>
|
|
14
16
|
<div
|
|
15
|
-
class="subContainer
|
|
17
|
+
class="subContainer shadow radius defaultPalette"
|
|
16
18
|
data-id="dropBox_subcontainer"
|
|
17
19
|
data-selector-id="dropBox_subcontainer"
|
|
18
20
|
data-test-id="dropBox_subcontainer"
|
|
19
21
|
tabindex="-1"
|
|
20
22
|
>
|
|
21
23
|
<div
|
|
22
|
-
class="
|
|
24
|
+
class="arrowPosition"
|
|
23
25
|
data-id="dropBox_arrow"
|
|
24
26
|
data-selector-id="dropBox_arrow"
|
|
25
27
|
data-test-id="dropBox_arrow"
|
package/lib/utils/Common.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.DUMMY_OBJECT = void 0;
|
|
6
7
|
exports.bind = bind;
|
|
7
8
|
exports.bytesToSize = bytesToSize;
|
|
8
9
|
exports.cancelBubblingEffect = cancelBubblingEffect;
|
|
@@ -512,4 +513,7 @@ function isTextSelected() {
|
|
|
512
513
|
}
|
|
513
514
|
|
|
514
515
|
return false;
|
|
515
|
-
}
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
var DUMMY_OBJECT = {};
|
|
519
|
+
exports.DUMMY_OBJECT = DUMMY_OBJECT;
|