@zohodesk/components 1.0.0-temp-199.9 → 1.0.0-temp-216.1

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.
Files changed (98) hide show
  1. package/.cli/propValidation_report.html +1 -1
  2. package/README.md +0 -9
  3. package/assets/Appearance/dark/mode/Component_DarkMode.module.css +9 -5
  4. package/assets/Appearance/dark/themes/blue/blue_ComponentTheme_DarkTheme.module.css +5 -0
  5. package/assets/Appearance/dark/themes/green/green_ComponentTheme_DarkTheme.module.css +5 -0
  6. package/assets/Appearance/dark/themes/orange/orange_ComponentTheme_DarkTheme.module.css +5 -0
  7. package/assets/Appearance/dark/themes/red/red_ComponentTheme_DarkTheme.module.css +5 -0
  8. package/assets/Appearance/dark/themes/yellow/yellow_ComponentTheme_DarkTheme.module.css +5 -0
  9. package/assets/Appearance/light/mode/Component_LightMode.module.css +9 -5
  10. package/assets/Appearance/light/themes/blue/blue_ComponentTheme_LightTheme.module.css +5 -0
  11. package/assets/Appearance/light/themes/green/green_ComponentTheme_LightTheme.module.css +5 -0
  12. package/assets/Appearance/light/themes/orange/orange_ComponentTheme_LightTheme.module.css +5 -0
  13. package/assets/Appearance/light/themes/red/red_ComponentTheme_LightTheme.module.css +5 -0
  14. package/assets/Appearance/light/themes/yellow/yellow_ComponentTheme_LightTheme.module.css +5 -0
  15. package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +9 -5
  16. package/assets/Appearance/pureDark/themes/blue/blue_ComponentTheme_PureDarkTheme.module.css +5 -0
  17. package/assets/Appearance/pureDark/themes/green/green_ComponentTheme_PureDarkTheme.module.css +5 -0
  18. package/assets/Appearance/pureDark/themes/orange/orange_ComponentTheme_PureDarkTheme.module.css +5 -0
  19. package/assets/Appearance/pureDark/themes/red/red_ComponentTheme_PureDarkTheme.module.css +5 -0
  20. package/assets/Appearance/pureDark/themes/yellow/yellow_ComponentTheme_PureDarkTheme.module.css +5 -0
  21. package/es/Button/Button.js +0 -2
  22. package/es/Button/css/Button.module.css +37 -1
  23. package/es/Button/css/cssJSLogic.js +10 -1
  24. package/es/DropBox/DropBoxElement/DropBoxElement.js +1 -3
  25. package/es/DropBox/DropBoxElement/__tests__/__snapshots__/DropBoxElement.spec.js.snap +2 -4
  26. package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +53 -56
  27. package/es/DropBox/DropBoxElement/css/cssJSLogic.js +4 -4
  28. package/es/DropBox/__tests__/__snapshots__/DropBox.spec.js.snap +2 -4
  29. package/es/DropDown/__tests__/__snapshots__/DropDown.spec.js.snap +1 -3
  30. package/es/ListItem/ListItem.js +2 -2
  31. package/es/ListItem/ListItem.module.css +2 -15
  32. package/es/ListItem/ListItemWithAvatar.js +3 -3
  33. package/es/ListItem/ListItemWithIcon.js +2 -2
  34. package/es/MultiSelect/AdvancedGroupMultiSelect.js +2 -7
  35. package/es/MultiSelect/MultiSelect.js +2 -7
  36. package/es/MultiSelect/Suggestions.js +5 -14
  37. package/es/MultiSelect/props/defaultProps.js +4 -9
  38. package/es/MultiSelect/props/propTypes.js +3 -9
  39. package/es/Popup/Popup.js +83 -232
  40. package/es/Provider/LibraryContext.js +3 -1
  41. package/es/ResponsiveDropBox/__tests__/__snapshots__/ResponsiveDropBox.spec.js.snap +2 -4
  42. package/es/Select/GroupSelect.js +1 -5
  43. package/es/Select/SelectWithAvatar.js +2 -7
  44. package/es/Select/SelectWithIcon.js +2 -4
  45. package/es/Select/props/defaultProps.js +1 -2
  46. package/es/Select/props/propTypes.js +2 -4
  47. package/es/common/common.module.css +0 -5
  48. package/es/utils/Common.js +1 -2
  49. package/es/v1/ListItem/ListItem.js +1 -1
  50. package/es/v1/MultiSelect/AdvancedMultiSelect.js +1 -2
  51. package/es/v1/MultiSelect/MultiSelect.js +2 -7
  52. package/es/v1/MultiSelect/Suggestions.js +4 -8
  53. package/es/v1/MultiSelect/props/defaultProps.js +2 -4
  54. package/es/v1/MultiSelect/props/propTypes.js +2 -6
  55. package/es/v1/Select/GroupSelect.js +2 -7
  56. package/es/v1/Select/SelectWithAvatar.js +2 -7
  57. package/es/v1/Select/props/defaultProps.js +2 -4
  58. package/es/v1/Select/props/propTypes.js +2 -6
  59. package/lib/Button/Button.js +0 -2
  60. package/lib/Button/css/Button.module.css +37 -1
  61. package/lib/Button/css/cssJSLogic.js +15 -2
  62. package/lib/DropBox/DropBoxElement/DropBoxElement.js +1 -3
  63. package/lib/DropBox/DropBoxElement/__tests__/__snapshots__/DropBoxElement.spec.js.snap +2 -4
  64. package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +53 -56
  65. package/lib/DropBox/DropBoxElement/css/cssJSLogic.js +2 -2
  66. package/lib/DropBox/__tests__/__snapshots__/DropBox.spec.js.snap +2 -4
  67. package/lib/DropDown/__tests__/__snapshots__/DropDown.spec.js.snap +1 -3
  68. package/lib/ListItem/ListItem.js +2 -2
  69. package/lib/ListItem/ListItem.module.css +2 -15
  70. package/lib/ListItem/ListItemWithAvatar.js +3 -3
  71. package/lib/ListItem/ListItemWithIcon.js +2 -2
  72. package/lib/MultiSelect/AdvancedGroupMultiSelect.js +3 -7
  73. package/lib/MultiSelect/MultiSelect.js +3 -6
  74. package/lib/MultiSelect/Suggestions.js +5 -12
  75. package/lib/MultiSelect/props/defaultProps.js +4 -9
  76. package/lib/MultiSelect/props/propTypes.js +3 -8
  77. package/lib/Popup/Popup.js +114 -282
  78. package/lib/Provider/LibraryContext.js +3 -1
  79. package/lib/ResponsiveDropBox/__tests__/__snapshots__/ResponsiveDropBox.spec.js.snap +2 -4
  80. package/lib/Select/GroupSelect.js +2 -4
  81. package/lib/Select/SelectWithAvatar.js +3 -8
  82. package/lib/Select/SelectWithIcon.js +3 -5
  83. package/lib/Select/props/defaultProps.js +1 -2
  84. package/lib/Select/props/propTypes.js +2 -4
  85. package/lib/common/common.module.css +0 -5
  86. package/lib/utils/Common.js +1 -5
  87. package/lib/v1/ListItem/ListItem.js +1 -1
  88. package/lib/v1/MultiSelect/AdvancedMultiSelect.js +1 -3
  89. package/lib/v1/MultiSelect/MultiSelect.js +3 -8
  90. package/lib/v1/MultiSelect/Suggestions.js +4 -8
  91. package/lib/v1/MultiSelect/props/defaultProps.js +2 -4
  92. package/lib/v1/MultiSelect/props/propTypes.js +2 -6
  93. package/lib/v1/Select/GroupSelect.js +3 -8
  94. package/lib/v1/Select/SelectWithAvatar.js +3 -8
  95. package/lib/v1/Select/props/defaultProps.js +2 -4
  96. package/lib/v1/Select/props/propTypes.js +2 -6
  97. package/package.json +2 -2
  98. package/result.json +1 -1
@@ -23,22 +23,10 @@ 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
-
34
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
35
27
 
36
28
  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); }
37
29
 
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
-
42
30
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
43
31
 
44
32
  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."); }
@@ -115,9 +103,7 @@ var Popup = function Popup(Component) {
115
103
  _ref$scrollDebounceTi = _ref.scrollDebounceTime,
116
104
  popupScrollDebounceTime = _ref$scrollDebounceTi === void 0 ? 0 : _ref$scrollDebounceTi,
117
105
  _ref$closeOnScroll = _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;
106
+ closeOnScrollPopup = _ref$closeOnScroll === void 0 ? false : _ref$closeOnScroll;
121
107
 
122
108
  var Popup = /*#__PURE__*/function (_React$Component) {
123
109
  _inherits(Popup, _React$Component);
@@ -143,8 +129,7 @@ var Popup = function Popup(Component) {
143
129
  //{height: ‘’, width: ‘’,}
144
130
  popupOffset: {},
145
131
  //{height: ‘’, width: ‘’,}
146
- isAbsolutePositioningNeeded: true,
147
- isMobile: false
132
+ isAbsolutePositioningNeeded: true
148
133
  };
149
134
  _this.togglePopup = _this.togglePopup.bind(_assertThisInitialized(_this));
150
135
  _this.documentClickHandler = _this.documentClickHandler.bind(_assertThisInitialized(_this));
@@ -159,11 +144,10 @@ var Popup = function Popup(Component) {
159
144
  _this.handleResize = (0, _Common.debounce)(_this.handleResize.bind(_assertThisInitialized(_this)), 300);
160
145
  _this.handlePopupResize = _this.handlePopupResize.bind(_assertThisInitialized(_this));
161
146
  _this.getIsAbsolutePopup = _this.getIsAbsolutePopup.bind(_assertThisInitialized(_this));
162
- _this.getIsOutsideScrollBlocked = _this.getIsOutsideScrollBlocked.bind(_assertThisInitialized(_this));
163
147
  _this.getNeedArrow = _this.getNeedArrow.bind(_assertThisInitialized(_this));
164
148
  _this.getCustomPositionOrder = _this.getCustomPositionOrder.bind(_assertThisInitialized(_this));
165
- _this.handleOpenPopupPositionChange = _this.handleOpenPopupPositionChange.bind(_assertThisInitialized(_this)); // this.getScrollDebounceTime = this.getScrollDebounceTime.bind(this);
166
-
149
+ _this.handleOpenPopupPositionChange = _this.handleOpenPopupPositionChange.bind(_assertThisInitialized(_this));
150
+ _this.getScrollDebounceTime = _this.getScrollDebounceTime.bind(_assertThisInitialized(_this));
167
151
  _this.getCloseOnScrollPopup = _this.getCloseOnScrollPopup.bind(_assertThisInitialized(_this));
168
152
  _this.handleCloseLastOpenedGroup = _this.handleCloseLastOpenedGroup.bind(_assertThisInitialized(_this));
169
153
  _this.handleDocumentMouseDown = _this.handleDocumentMouseDown.bind(_assertThisInitialized(_this));
@@ -177,27 +161,20 @@ var Popup = function Popup(Component) {
177
161
  _this.handleAddingScrollBlock = _this.handleAddingScrollBlock.bind(_assertThisInitialized(_this));
178
162
  _this.handleRemovingScrollBlock = _this.handleRemovingScrollBlock.bind(_assertThisInitialized(_this));
179
163
  _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();
189
164
  _this.popupObserver = new _ResizeObserver["default"](_this.handlePopupResize); //dropBoxSize
190
165
 
191
166
  _this.size = null;
192
- _this.isTargetElementVisible = false;
193
167
  _this.isAbsolutePopup = isAbsolutePopup;
194
168
  _this.needPopupArrow = needPopupArrow;
195
169
  _this.customPositionOrder = customPositionOrder;
196
170
  _this.scrollDebounceTime = popupScrollDebounceTime;
197
171
  _this.closeOnScroll = closeOnScrollPopup;
198
- _this.isOutsideScrollBlock = isOutsideScrollBlock; // const { scrollDebounceTime } = this.getScrollDebounceTime(this);
199
- // this.handleScroll = debounce(this.handleScroll.bind(this), scrollDebounceTime);
200
172
 
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);
201
178
  return _this;
202
179
  }
203
180
 
@@ -231,28 +208,14 @@ var Popup = function Popup(Component) {
231
208
  });
232
209
  }
233
210
  }
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
- }
245
211
  }, {
246
212
  key: "componentDidUpdate",
247
213
  value: function componentDidUpdate(prevProps, prevState) {
248
- var _this$state = this.state,
249
- isPopupReady = _this$state.isPopupReady,
250
- isMobile = _this$state.isMobile;
214
+ var isPopupReady = this.state.isPopupReady;
251
215
 
252
216
  var _ref2 = prevState || {},
253
217
  _ref2$isPopupReady = _ref2.isPopupReady,
254
- oldStateOpen = _ref2$isPopupReady === void 0 ? false : _ref2$isPopupReady,
255
- oldIsMobileState = _ref2.isMobile;
218
+ oldStateOpen = _ref2$isPopupReady === void 0 ? false : _ref2$isPopupReady;
256
219
 
257
220
  var dropElement = this.dropElement;
258
221
  var propResizeHandling = this.props.needResizeHandling;
@@ -264,10 +227,12 @@ var Popup = function Popup(Component) {
264
227
  this.size = null;
265
228
  this.popupObserver.disconnect();
266
229
  }
267
- }
268
230
 
269
- if (oldStateOpen !== isPopupReady && !isMobile || oldIsMobileState !== isMobile) {
270
- this.handleScrollAndBlockEvents(isPopupReady, isMobile);
231
+ if (isPopupReady) {
232
+ this.handleAddingScrollBlock();
233
+ } else {
234
+ this.handleRemovingScrollBlock();
235
+ }
271
236
  }
272
237
  }
273
238
  }, {
@@ -289,7 +254,6 @@ var Popup = function Popup(Component) {
289
254
  return res;
290
255
  }, popups);
291
256
  this.handleRemovingScrollBlock();
292
- this.handleRemovingScrollToUpdatePosition();
293
257
  var noPopups = true;
294
258
 
295
259
  for (var i in popups) {
@@ -316,8 +280,9 @@ var Popup = function Popup(Component) {
316
280
  }, {
317
281
  key: "handleAddingScrollBlock",
318
282
  value: function handleAddingScrollBlock() {
319
- var isAbsolutePositioningNeeded = this.getIsAbsolutePopup(this);
320
- var isOutsideScrollBlocked = this.getIsOutsideScrollBlocked(this);
283
+ var _this$props = this.props,
284
+ isAbsolutePositioningNeeded = _this$props.isAbsolutePositioningNeeded,
285
+ isOutsideScrollBlocked = _this$props.isOutsideScrollBlocked;
321
286
 
322
287
  if (isOutsideScrollBlocked && !isAbsolutePositioningNeeded) {
323
288
  (0, _intersectionObserver.addIntersectionObserver)(this.placeHolderElement, this.handleIntersectionObserver);
@@ -327,106 +292,15 @@ var Popup = function Popup(Component) {
327
292
  }, {
328
293
  key: "handleRemovingScrollBlock",
329
294
  value: function handleRemovingScrollBlock() {
330
- var isAbsolutePositioningNeeded = this.getIsAbsolutePopup(this);
331
- var isOutsideScrollBlocked = this.getIsOutsideScrollBlocked(this);
295
+ var _this$props2 = this.props,
296
+ isAbsolutePositioningNeeded = _this$props2.isAbsolutePositioningNeeded,
297
+ isOutsideScrollBlocked = _this$props2.isOutsideScrollBlocked;
332
298
 
333
299
  if (isOutsideScrollBlocked && !isAbsolutePositioningNeeded) {
334
300
  (0, _intersectionObserver.removeIntersectionObserver)(this.placeHolderElement, this.handleIntersectionObserver);
335
301
  this.removeScrollBlockListeners();
336
302
  }
337
303
  }
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
- }
430
304
  }, {
431
305
  key: "addScrollBlockListeners",
432
306
  value: function addScrollBlockListeners() {
@@ -438,7 +312,7 @@ var Popup = function Popup(Component) {
438
312
  capture: true,
439
313
  passive: false
440
314
  });
441
- document.addEventListener('scroll', this.handlePositionChange, {
315
+ document.addEventListener('scroll', this.handleDebouncedPositionChange, {
442
316
  capture: true,
443
317
  passive: false
444
318
  });
@@ -458,7 +332,7 @@ var Popup = function Popup(Component) {
458
332
  capture: true,
459
333
  passive: false
460
334
  });
461
- document.removeEventListener('scroll', this.handlePositionChange, {
335
+ document.removeEventListener('scroll', this.handleDebouncedPositionChange, {
462
336
  capture: true,
463
337
  passive: false
464
338
  });
@@ -489,7 +363,7 @@ var Popup = function Popup(Component) {
489
363
  var containerElement = this.dropElement;
490
364
 
491
365
  if (containerElement && containerElement !== event.target && !containerElement.contains(event.target) && targetElement && targetElement !== event.target && !targetElement.contains(event.target) && event.target.contains(targetElement)) {
492
- this.handlePopupPosition(this.state.position, true); // this.closePopupOnly(event);
366
+ this.handlePopupPosition(this.state.position); // this.closePopupOnly(event);
493
367
  }
494
368
  }
495
369
  }, {
@@ -505,23 +379,10 @@ var Popup = function Popup(Component) {
505
379
  }, {
506
380
  key: "handleIntersectionObserver",
507
381
  value: function handleIntersectionObserver(entry) {
508
- if (entry.intersectionRatio === 0 && entry.isIntersecting === false) {
382
+ if (entry.intersectionRatio === 0) {
509
383
  this.closePopupOnly();
510
384
  }
511
385
  }
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
- }
525
386
  }, {
526
387
  key: "getGroup",
527
388
  value: function getGroup() {
@@ -534,12 +395,14 @@ var Popup = function Popup(Component) {
534
395
  var isArrow = popup.props.isArrow;
535
396
  var needPopupArrow = popup.needPopupArrow;
536
397
  return isArrow !== undefined ? isArrow : needPopupArrow;
537
- } // getScrollDebounceTime(popup) {
538
- // const { scrollDebounceTime } = popup.props;
539
- // const { scrollDebounceTime: popupScrollDebounceTime } = popup;
540
- // return scrollDebounceTime !== undefined ? scrollDebounceTime : popupScrollDebounceTime;
541
- // }
542
-
398
+ }
399
+ }, {
400
+ key: "getScrollDebounceTime",
401
+ value: function getScrollDebounceTime(popup) {
402
+ var scrollDebounceTime = popup.props.scrollDebounceTime;
403
+ var popupScrollDebounceTime = popup.scrollDebounceTime;
404
+ return scrollDebounceTime !== undefined ? scrollDebounceTime : popupScrollDebounceTime;
405
+ }
543
406
  }, {
544
407
  key: "getCloseOnScrollPopup",
545
408
  value: function getCloseOnScrollPopup(popup) {
@@ -554,13 +417,6 @@ var Popup = function Popup(Component) {
554
417
  var isAbsolutePopup = popup.isAbsolutePopup;
555
418
  return isAbsolutePositioningNeeded !== undefined ? isAbsolutePositioningNeeded : isAbsolutePopup;
556
419
  }
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
- }
564
420
  }, {
565
421
  key: "getCustomPositionOrder",
566
422
  value: function getCustomPositionOrder(popup) {
@@ -733,32 +589,17 @@ var Popup = function Popup(Component) {
733
589
  // e && e.preventDefault && e.preventDefault();
734
590
  (0, _Common.cancelBubblingEffect)(e);
735
591
  }
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
- }
751
592
  }, {
752
593
  key: "handlePopupPosition",
753
594
  value: function handlePopupPosition() {
754
595
  var _this4 = this;
755
596
 
756
597
  var defaultPosition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'bottomCenter';
757
- var isUpdatePosition = arguments.length > 1 ? arguments[1] : undefined;
598
+ var isResizeHandling = arguments.length > 1 ? arguments[1] : undefined;
758
599
 
759
- // isUpdatePosition --->>> Window resize and dropBox resize and to update the position
760
- var _ref5 = this.context || {},
761
- direction = _ref5.direction;
600
+ // isResizeHandling --->>> Window resize and dropBox resize
601
+ var _ref3 = this.context || {},
602
+ direction = _ref3.direction;
762
603
 
763
604
  var placeHolderElement = this.placeHolderElement,
764
605
  dropElement = this.dropElement;
@@ -773,11 +614,9 @@ var Popup = function Popup(Component) {
773
614
  }
774
615
 
775
616
  if (!placeHolderElement && !dropElement) {
776
- var isMobile = (0, _isMobilePopover["default"])(true);
777
617
  this.setState({
778
618
  isPopupOpen: true,
779
- isPopupReady: true,
780
- isMobile: isMobile
619
+ isPopupReady: true
781
620
  });
782
621
  return;
783
622
  }
@@ -797,32 +636,28 @@ var Popup = function Popup(Component) {
797
636
  customOrder: customOrder
798
637
  });
799
638
 
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
- }
639
+ var _ref4 = betterPosition || {},
640
+ view = _ref4.view,
641
+ views = _ref4.views,
642
+ viewsOffset = _ref4.viewsOffset,
643
+ targetOffset = _ref4.targetOffset,
644
+ popupOffset = _ref4.popupOffset;
645
+
646
+ if (position !== view || !isPopupReady) {
647
+ _this4.setState({
648
+ isPopupReady: true,
649
+ position: view,
650
+ positions: views,
651
+ positionsOffset: viewsOffset,
652
+ targetOffset: targetOffset,
653
+ popupOffset: popupOffset,
654
+ isAbsolutePositioningNeeded: isAbsolute
655
+ });
821
656
  }
822
657
  });
823
658
  };
824
659
 
825
- if (isUpdatePosition) {
660
+ if (isResizeHandling) {
826
661
  setPosition();
827
662
  } else {
828
663
  this.defaultPosition = defaultPosition;
@@ -858,43 +693,37 @@ var Popup = function Popup(Component) {
858
693
 
859
694
  var customOrder = _this5.getCustomPositionOrder(popup);
860
695
 
861
- var isMobile = (0, _isMobilePopover["default"])(true);
862
-
863
696
  var betterPosition = _viewPort["default"].betterView(dropElement, placeHolderElement, defaultPosition, scrollContainer, {
864
697
  needArrow: needArrow,
865
698
  isAbsolute: isAbsolute,
866
699
  customOrder: customOrder
867
700
  });
868
701
 
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(
702
+ var _ref5 = betterPosition || {},
703
+ view = _ref5.view,
704
+ views = _ref5.views,
705
+ _ref5$viewsOffset = _ref5.viewsOffset,
706
+ viewsOffset = _ref5$viewsOffset === void 0 ? {} : _ref5$viewsOffset,
707
+ targetOffset = _ref5.targetOffset,
708
+ popupOffset = _ref5.popupOffset;
709
+
710
+ var _ref6 = positionsOffset[position] || {},
711
+ _ref6$left = _ref6.left,
712
+ oldLeft = _ref6$left === void 0 ? '' : _ref6$left,
713
+ _ref6$top = _ref6.top,
714
+ oldTop = _ref6$top === void 0 ? '' : _ref6$top,
715
+ _ref6$bottom = _ref6.bottom,
716
+ oldBottom = _ref6$bottom === void 0 ? '' : _ref6$bottom;
717
+
718
+ var _ref7 = viewsOffset[view] || {},
719
+ _ref7$left = _ref7.left,
720
+ left = _ref7$left === void 0 ? '' : _ref7$left,
721
+ _ref7$top = _ref7.top,
722
+ top = _ref7$top === void 0 ? '' : _ref7$top,
723
+ _ref7$bottom = _ref7.bottom,
724
+ bottom = _ref7$bottom === void 0 ? '' : _ref7$bottom;
725
+
726
+ var changeState = isAbsolute ? position !== view : oldLeft !== left || oldTop !== top || oldBottom !== bottom; // let isInViewPort = viewPort.isInViewPort(
898
727
  // placeHolderElement,
899
728
  // scrollContainer
900
729
  // );
@@ -906,8 +735,7 @@ var Popup = function Popup(Component) {
906
735
  positionsOffset: viewsOffset,
907
736
  targetOffset: targetOffset,
908
737
  popupOffset: popupOffset,
909
- isAbsolutePositioningNeeded: isAbsolute,
910
- isMobile: isMobile
738
+ isAbsolutePositioningNeeded: isAbsolute
911
739
  });
912
740
  } // if (!isInViewPort && !isAbsolute) {
913
741
  // popup.setState({ isPopupOpen: false, isPopupReady: false });
@@ -932,34 +760,40 @@ var Popup = function Popup(Component) {
932
760
  key: "handleResize",
933
761
  value: function handleResize() {
934
762
  this.handleOpenPopupPositionChange();
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
- // }
763
+ }
764
+ }, {
765
+ key: "handleScroll",
766
+ value: function handleScroll(e) {
767
+ // this.handleOpenPopupPositionChange();
768
+ var _this$getCloseOnScrol = this.getCloseOnScrollPopup(this),
769
+ closeOnScroll = _this$getCloseOnScrol.closeOnScroll;
770
+
771
+ var isPopupReady = this.state.isPopupReady;
772
+
773
+ if (isPopupReady) {
774
+ console.log('onscrollPopupREady');
775
+ }
947
776
 
777
+ if (isPopupReady && closeOnScroll) {
778
+ console.log(this, 'handle Scroll');
779
+ this.togglePopup(e);
780
+ }
781
+ }
948
782
  }, {
949
783
  key: "handlePopupResize",
950
784
  value: function handlePopupResize(popupSize) {
951
785
  var height = popupSize.height,
952
786
  width = popupSize.width;
953
787
 
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;
788
+ var _ref8 = this.size || {},
789
+ _ref8$height = _ref8.height,
790
+ oldHeight = _ref8$height === void 0 ? 0 : _ref8$height,
791
+ _ref8$width = _ref8.width,
792
+ oldWidth = _ref8$width === void 0 ? 0 : _ref8$width;
959
793
 
960
- var _this$state2 = this.state,
961
- isPopupReady = _this$state2.isPopupReady,
962
- position = _this$state2.position;
794
+ var _this$state = this.state,
795
+ isPopupReady = _this$state.isPopupReady,
796
+ position = _this$state.position;
963
797
 
964
798
  if (isPopupReady && this.size && (oldHeight !== height || width !== oldWidth)) {
965
799
  this.handlePopupPosition(position, true);
@@ -980,13 +814,11 @@ var Popup = function Popup(Component) {
980
814
  }, {
981
815
  key: "render",
982
816
  value: function render() {
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, {
817
+ var _this$state2 = this.state,
818
+ isPopupReady = _this$state2.isPopupReady,
819
+ isPopupOpen = _this$state2.isPopupOpen;
820
+ var localState = isPopupReady ? this.state : {};
821
+ return /*#__PURE__*/_react["default"].createElement(Component, _extends({}, this.props, this.state, {
990
822
  openPopupOnly: this.openPopupOnly,
991
823
  closePopupOnly: this.closePopupOnly,
992
824
  togglePopup: this.togglePopup,
@@ -44,13 +44,15 @@ var LibraryContextProvider = function LibraryContextProvider(_ref) {
44
44
  direction = _ref.direction,
45
45
  coloredTagVariant = _ref.coloredTagVariant,
46
46
  hasTagColorInheritedToText = _ref.hasTagColorInheritedToText,
47
+ shouldStrikeThroughDisabledButton = _ref.shouldStrikeThroughDisabledButton,
47
48
  children = _ref.children;
48
49
 
49
50
  var _useState = (0, _react.useState)({
50
51
  isReducedMotion: isReducedMotion,
51
52
  direction: direction,
52
53
  coloredTagVariant: coloredTagVariant,
53
- hasTagColorInheritedToText: hasTagColorInheritedToText
54
+ hasTagColorInheritedToText: hasTagColorInheritedToText,
55
+ shouldStrikeThroughDisabledButton: shouldStrikeThroughDisabledButton
54
56
  }),
55
57
  _useState2 = _slicedToArray(_useState, 2),
56
58
  value = _useState2[0],
@@ -5,8 +5,6 @@ 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"
10
8
  data-id="dropBox"
11
9
  data-position="bottomStart"
12
10
  data-selector-id="dropBox"
@@ -14,14 +12,14 @@ exports[`ResponsiveDropBox rendering the defult props 1`] = `
14
12
  dot-ui-element="dropbox"
15
13
  >
16
14
  <div
17
- class="subContainer shadow radius defaultPalette"
15
+ class="subContainer bottom_shadow radius defaultPalette"
18
16
  data-id="dropBox_subcontainer"
19
17
  data-selector-id="dropBox_subcontainer"
20
18
  data-test-id="dropBox_subcontainer"
21
19
  tabindex="-1"
22
20
  >
23
21
  <div
24
- class="arrowPosition"
22
+ class="end"
25
23
  data-id="dropBox_arrow"
26
24
  data-selector-id="dropBox_arrow"
27
25
  data-test-id="dropBox_arrow"