@zohodesk/components 1.0.0-temp-220.6 → 1.0.0-temp-223

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 (72) hide show
  1. package/.cli/config/variables/variableMapping.json +6 -0
  2. package/.cli/propValidation_report.html +1 -1
  3. package/README.md +8 -0
  4. package/assets/Appearance/dark/mode/Component_DarkMode.module.css +1 -0
  5. package/assets/Appearance/light/mode/Component_LightMode.module.css +1 -0
  6. package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +1 -0
  7. package/es/ListItem/ListContainer.js +3 -2
  8. package/es/ListItem/ListItem.module.css +52 -6
  9. package/es/ListItem/ListItemWithAvatar.js +17 -6
  10. package/es/ListItem/ListItemWithCheckBox.js +18 -6
  11. package/es/ListItem/ListItemWithIcon.js +20 -7
  12. package/es/ListItem/ListItemWithRadio.js +19 -6
  13. package/es/ListItem/__tests__/ListContainer.spec.js +8 -0
  14. package/es/ListItem/__tests__/ListItemWithAvatar.spec.js +35 -0
  15. package/es/ListItem/__tests__/ListItemWithCheckBox.spec.js +35 -0
  16. package/es/ListItem/__tests__/ListItemWithIcon.spec.js +35 -0
  17. package/es/ListItem/__tests__/ListItemWithRadio.spec.js +35 -0
  18. package/es/ListItem/__tests__/__snapshots__/ListContainer.spec.js.snap +13 -0
  19. package/es/ListItem/__tests__/__snapshots__/ListItemWithAvatar.spec.js.snap +200 -2
  20. package/es/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +451 -30
  21. package/es/ListItem/__tests__/__snapshots__/ListItemWithIcon.spec.js.snap +202 -4
  22. package/es/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +447 -30
  23. package/es/ListItem/props/defaultProps.js +13 -5
  24. package/es/ListItem/props/propTypes.js +13 -1
  25. package/es/MultiSelect/AdvancedMultiSelect.js +10 -4
  26. package/es/MultiSelect/MultiSelect.js +8 -4
  27. package/es/MultiSelect/MultiSelect.module.css +9 -1
  28. package/es/MultiSelect/MultiSelectWithAvatar.js +6 -2
  29. package/es/MultiSelect/Suggestions.js +5 -2
  30. package/es/MultiSelect/__tests__/__snapshots__/MultiSelectHeader.spec.js.snap +34 -13
  31. package/es/MultiSelect/props/propTypes.js +3 -0
  32. package/es/Popup/Popup.js +37 -116
  33. package/es/Provider/Config.js +1 -2
  34. package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +21 -2
  35. package/es/VelocityAnimation/VelocityAnimationGroup/props/defaultProps.js +2 -1
  36. package/es/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +2 -1
  37. package/es/common/common.module.css +10 -0
  38. package/es/utils/dropDownUtils.js +33 -8
  39. package/lib/ListItem/ListContainer.js +3 -2
  40. package/lib/ListItem/ListItem.module.css +52 -6
  41. package/lib/ListItem/ListItemWithAvatar.js +16 -5
  42. package/lib/ListItem/ListItemWithCheckBox.js +17 -5
  43. package/lib/ListItem/ListItemWithIcon.js +19 -6
  44. package/lib/ListItem/ListItemWithRadio.js +18 -5
  45. package/lib/ListItem/__tests__/ListContainer.spec.js +8 -0
  46. package/lib/ListItem/__tests__/ListItemWithAvatar.spec.js +35 -0
  47. package/lib/ListItem/__tests__/ListItemWithCheckBox.spec.js +35 -0
  48. package/lib/ListItem/__tests__/ListItemWithIcon.spec.js +35 -0
  49. package/lib/ListItem/__tests__/ListItemWithRadio.spec.js +35 -0
  50. package/lib/ListItem/__tests__/__snapshots__/ListContainer.spec.js.snap +13 -0
  51. package/lib/ListItem/__tests__/__snapshots__/ListItemWithAvatar.spec.js.snap +200 -2
  52. package/lib/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +451 -30
  53. package/lib/ListItem/__tests__/__snapshots__/ListItemWithIcon.spec.js.snap +202 -4
  54. package/lib/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +447 -30
  55. package/lib/ListItem/props/defaultProps.js +13 -5
  56. package/lib/ListItem/props/propTypes.js +12 -2
  57. package/lib/MultiSelect/AdvancedMultiSelect.js +76 -69
  58. package/lib/MultiSelect/MultiSelect.js +8 -4
  59. package/lib/MultiSelect/MultiSelect.module.css +9 -1
  60. package/lib/MultiSelect/MultiSelectWithAvatar.js +6 -2
  61. package/lib/MultiSelect/Suggestions.js +5 -2
  62. package/lib/MultiSelect/__tests__/__snapshots__/MultiSelectHeader.spec.js.snap +34 -13
  63. package/lib/MultiSelect/props/propTypes.js +4 -1
  64. package/lib/Popup/Popup.js +90 -181
  65. package/lib/Provider/Config.js +1 -2
  66. package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +49 -9
  67. package/lib/VelocityAnimation/VelocityAnimationGroup/props/defaultProps.js +2 -1
  68. package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +2 -1
  69. package/lib/common/common.module.css +10 -0
  70. package/lib/utils/dropDownUtils.js +41 -11
  71. package/package.json +3 -3
  72. package/result.json +0 -1
@@ -29,8 +29,6 @@ var _isMobilePopover = _interopRequireDefault(require("../DropBox/utils/isMobile
29
29
 
30
30
  var _selectn = _interopRequireDefault(require("selectn"));
31
31
 
32
- var _Config = require("../Provider/Config.js");
33
-
34
32
  var _excluded = ["isMobile"];
35
33
 
36
34
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -99,53 +97,6 @@ var defaultState = {
99
97
  //{height: ‘’, width: ‘’,}
100
98
  isAbsolutePositioningNeeded: true
101
99
  };
102
- var SCROLL_BLOCK_EVENTS = Object.freeze([{
103
- name: 'wheel',
104
- handlerName: 'handleBlockScroll',
105
- options: {
106
- capture: true,
107
- passive: false
108
- }
109
- }, {
110
- name: 'touchmove',
111
- handlerName: 'handleBlockScroll',
112
- options: {
113
- capture: true,
114
- passive: false
115
- }
116
- }, {
117
- name: 'scroll',
118
- handlerName: 'handlePositionChange',
119
- options: {
120
- capture: true,
121
- passive: false
122
- }
123
- }, {
124
- name: 'keydown',
125
- handlerName: 'preventKeyboardScroll',
126
- options: {
127
- capture: true,
128
- passive: false
129
- }
130
- }]);
131
- var IFRAME_SCROLL_BLOCK_EVENTS = Object.freeze(SCROLL_BLOCK_EVENTS.filter(function (event) {
132
- return event.name !== 'keydown';
133
- }));
134
- var CLICK_EVENTS = Object.freeze([{
135
- name: 'click',
136
- handlerName: 'documentClickHandler',
137
- options: {
138
- capture: false,
139
- passive: false
140
- }
141
- }, {
142
- name: 'click',
143
- handlerName: 'documentClickHandler1',
144
- options: {
145
- capture: true,
146
- passive: false
147
- }
148
- }]);
149
100
  /* eslint-disable react/no-deprecated */
150
101
 
151
102
  /* eslint-disable react/prop-types */
@@ -221,7 +172,6 @@ var Popup = function Popup(Component) {
221
172
  _this.handleBlockScroll = _this.handleBlockScroll.bind(_assertThisInitialized(_this));
222
173
  _this.handlePositionChange = _this.handlePositionChange.bind(_assertThisInitialized(_this));
223
174
  _this.preventKeyboardScroll = _this.preventKeyboardScroll.bind(_assertThisInitialized(_this));
224
- _this.updateListeners = _this.updateListeners.bind(_assertThisInitialized(_this));
225
175
  _this.addScrollBlockListeners = _this.addScrollBlockListeners.bind(_assertThisInitialized(_this));
226
176
  _this.removeScrollBlockListeners = _this.removeScrollBlockListeners.bind(_assertThisInitialized(_this));
227
177
  _this.handleAddingScrollBlock = _this.handleAddingScrollBlock.bind(_assertThisInitialized(_this));
@@ -234,11 +184,8 @@ var Popup = function Popup(Component) {
234
184
  _this.setContainerDynamicPositioning = _this.setContainerDynamicPositioning.bind(_assertThisInitialized(_this));
235
185
  _this.updatePopupState = _this.updatePopupState.bind(_assertThisInitialized(_this));
236
186
  _this.handleScrollAndBlockEvents = _this.handleScrollAndBlockEvents.bind(_assertThisInitialized(_this));
237
- _this.handleIframeClickEvents = _this.handleIframeClickEvents.bind(_assertThisInitialized(_this));
238
187
  _this.handleDropElementStyleUpdate = _this.handleDropElementStyleUpdate.bind(_assertThisInitialized(_this));
239
- _this.getParentContainerElement = _this.getParentContainerElement.bind(_assertThisInitialized(_this));
240
188
  _this.positionRef = /*#__PURE__*/_react["default"].createRef();
241
- _this.parentContainerElement = _this.getParentContainerElement();
242
189
  _this.popupObserver = new _ResizeObserver["default"](_this.handlePopupResize); //dropBoxSize
243
190
 
244
191
  _this.size = null;
@@ -263,10 +210,11 @@ var Popup = function Popup(Component) {
263
210
  popups[group] = groupPopups;
264
211
 
265
212
  if (Object.keys(popups).length === 1 && groupPopups.length === 1) {
266
- this.updateListeners(true, CLICK_EVENTS, document);
213
+ document.addEventListener('click', this.documentClickHandler, false);
267
214
  document.addEventListener('keyup', this.documentKeyupHandler, false); // document.addEventListener('scroll', this.handleScroll, true);
268
215
 
269
216
  window.addEventListener('resize', this.handleResize);
217
+ document.addEventListener('click', this.documentClickHandler1, true);
270
218
  document.addEventListener('mousedown', this.handleDocumentMouseDown, true);
271
219
  document.addEventListener('focus', this.handleDocumentFocus, true);
272
220
  }
@@ -283,25 +231,10 @@ var Popup = function Popup(Component) {
283
231
  });
284
232
  }
285
233
  }
286
- }, {
287
- key: "getParentContainerElement",
288
- value: function getParentContainerElement() {
289
- var getParentContainer = (0, _Config.getLibraryConfig)('getParentContainer');
290
-
291
- if (getParentContainer && typeof getParentContainer === 'function') {
292
- var parent = getParentContainer();
293
-
294
- if (parent) {
295
- return parent;
296
- }
297
- }
298
-
299
- return document;
300
- }
301
234
  }, {
302
235
  key: "handleScrollAndBlockEvents",
303
- value: function handleScrollAndBlockEvents(shouldAdd) {
304
- if (shouldAdd) {
236
+ value: function handleScrollAndBlockEvents(isPopupReady, isMobile) {
237
+ if (isPopupReady && !isMobile) {
305
238
  this.handleAddingScrollBlock();
306
239
  this.handleAddingScrollToUpdatePosition();
307
240
  } else {
@@ -309,19 +242,6 @@ var Popup = function Popup(Component) {
309
242
  this.handleRemovingScrollToUpdatePosition();
310
243
  }
311
244
  }
312
- }, {
313
- key: "handleIframeClickEvents",
314
- value: function handleIframeClickEvents(shouldAdd) {
315
- var _this2 = this;
316
-
317
- this.parentContainerElement.querySelectorAll('iframe').forEach(function (frame) {
318
- var frameDocument = frame.contentDocument;
319
-
320
- if (frameDocument) {
321
- _this2.updateListeners(shouldAdd, CLICK_EVENTS, frameDocument);
322
- }
323
- });
324
- }
325
245
  }, {
326
246
  key: "componentDidUpdate",
327
247
  value: function componentDidUpdate(prevProps, prevState) {
@@ -347,21 +267,20 @@ var Popup = function Popup(Component) {
347
267
  }
348
268
 
349
269
  if (oldStateOpen !== isPopupReady && !isMobile || oldIsMobileState !== isMobile) {
350
- this.handleScrollAndBlockEvents(isPopupReady && !isMobile);
351
- this.handleIframeClickEvents(isPopupReady && !isMobile);
270
+ this.handleScrollAndBlockEvents(isPopupReady, isMobile);
352
271
  }
353
272
  }
354
273
  }, {
355
274
  key: "componentWillUnmount",
356
275
  value: function componentWillUnmount() {
357
- var _this3 = this;
276
+ var _this2 = this;
358
277
 
359
278
  var group = this.getGroup();
360
279
  popups = Object.keys(popups).reduce(function (res, groupName) {
361
280
  if (groupName === group) {
362
281
  var groupPopups = popups[group];
363
282
  var newGroupPopups = groupPopups.filter(function (popup) {
364
- return popup !== _this3;
283
+ return popup !== _this2;
365
284
  });
366
285
  newGroupPopups.length === 0 && lastOpenedGroup.indexOf(group) >= 0 && lastOpenedGroup.splice(lastOpenedGroup.indexOf(group), 1);
367
286
  res[group] = newGroupPopups;
@@ -371,7 +290,6 @@ var Popup = function Popup(Component) {
371
290
  }, popups);
372
291
  this.handleRemovingScrollBlock();
373
292
  this.handleRemovingScrollToUpdatePosition();
374
- this.handleIframeClickEvents(false);
375
293
  var noPopups = true;
376
294
 
377
295
  for (var i in popups) {
@@ -386,10 +304,11 @@ var Popup = function Popup(Component) {
386
304
  }
387
305
 
388
306
  if (noPopups) {
389
- this.updateListeners(false, CLICK_EVENTS, document);
307
+ document.removeEventListener('click', this.documentClickHandler);
390
308
  document.removeEventListener('keyup', this.documentKeyupHandler); // document.removeEventListener('scroll', this.handleScroll);
391
309
 
392
310
  window.removeEventListener('resize', this.handleResize);
311
+ document.removeEventListener('click', this.documentClickHandler1, true);
393
312
  document.removeEventListener('mousedown', this.handleDocumentMouseDown, true);
394
313
  document.removeEventListener('focus', this.handleDocumentFocus, true);
395
314
  }
@@ -508,54 +427,44 @@ var Popup = function Popup(Component) {
508
427
  this.handlePopupPosition(defaultPosition, true);
509
428
  }
510
429
  }
511
- }, {
512
- key: "updateListeners",
513
- value: function updateListeners() {
514
- var _this4 = this;
515
-
516
- var add = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
517
- var eventList = arguments.length > 1 ? arguments[1] : undefined;
518
- var element = arguments.length > 2 ? arguments[2] : undefined;
519
- var method = add ? 'addEventListener' : 'removeEventListener';
520
- eventList.forEach(function (_ref5) {
521
- var name = _ref5.name,
522
- handlerName = _ref5.handlerName,
523
- options = _ref5.options;
524
- var handler = _this4[handlerName];
525
-
526
- if (handler) {
527
- element[method](name, handler, options);
528
- }
529
- });
530
- }
531
430
  }, {
532
431
  key: "addScrollBlockListeners",
533
432
  value: function addScrollBlockListeners() {
534
- var _this5 = this;
535
-
536
- // Main document
537
- this.updateListeners(true, SCROLL_BLOCK_EVENTS, document); // Attach event listeners to all iframes within parentContainerElement
538
-
539
- this.parentContainerElement.querySelectorAll('iframe').forEach(function (frame) {
540
- var frameDocument = frame.contentDocument;
541
-
542
- if (frameDocument) {
543
- _this5.updateListeners(true, IFRAME_SCROLL_BLOCK_EVENTS, frameDocument);
544
- }
433
+ document.addEventListener('wheel', this.handleBlockScroll, {
434
+ capture: true,
435
+ passive: false
436
+ });
437
+ document.addEventListener('touchmove', this.handleBlockScroll, {
438
+ capture: true,
439
+ passive: false
440
+ });
441
+ document.addEventListener('scroll', this.handlePositionChange, {
442
+ capture: true,
443
+ passive: false
444
+ });
445
+ document.addEventListener('keydown', this.preventKeyboardScroll, {
446
+ capture: true,
447
+ passive: false
545
448
  });
546
449
  }
547
450
  }, {
548
451
  key: "removeScrollBlockListeners",
549
452
  value: function removeScrollBlockListeners() {
550
- var _this6 = this;
551
-
552
- this.updateListeners(false, SCROLL_BLOCK_EVENTS, document);
553
- this.parentContainerElement.querySelectorAll('iframe').forEach(function (frame) {
554
- var frameDocument = frame.contentDocument;
555
-
556
- if (frameDocument) {
557
- _this6.updateListeners(false, IFRAME_SCROLL_BLOCK_EVENTS, frameDocument);
558
- }
453
+ document.removeEventListener('wheel', this.handleBlockScroll, {
454
+ capture: true,
455
+ passive: false
456
+ });
457
+ document.removeEventListener('touchmove', this.handleBlockScroll, {
458
+ capture: true,
459
+ passive: false
460
+ });
461
+ document.removeEventListener('scroll', this.handlePositionChange, {
462
+ capture: true,
463
+ passive: false
464
+ });
465
+ document.removeEventListener('keydown', this.preventKeyboardScroll, {
466
+ capture: true,
467
+ passive: false
559
468
  });
560
469
  }
561
470
  }, {
@@ -663,7 +572,7 @@ var Popup = function Popup(Component) {
663
572
  }, {
664
573
  key: "togglePopup",
665
574
  value: function togglePopup(e, defaultPosition) {
666
- var _this7 = this;
575
+ var _this3 = this;
667
576
 
668
577
  var group = this.getGroup();
669
578
  this.removeClose(e);
@@ -672,7 +581,7 @@ var Popup = function Popup(Component) {
672
581
  lastOpenedGroup = !isPopupOpen && lastOpenedGroup.indexOf(group) === -1 ? [group].concat(_toConsumableArray(lastOpenedGroup)) : lastOpenedGroup;
673
582
  isPopupOpen && lastOpenedGroup.splice(0, 1);
674
583
  groupPopups.forEach(function (popup) {
675
- if (popup !== _this7 && popup.state.isPopupOpen) {
584
+ if (popup !== _this3 && popup.state.isPopupOpen) {
676
585
  popup.setState({
677
586
  isPopupOpen: false,
678
587
  isPopupReady: false
@@ -842,14 +751,14 @@ var Popup = function Popup(Component) {
842
751
  }, {
843
752
  key: "handlePopupPosition",
844
753
  value: function handlePopupPosition() {
845
- var _this8 = this;
754
+ var _this4 = this;
846
755
 
847
756
  var defaultPosition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'bottomCenter';
848
757
  var isUpdatePosition = arguments.length > 1 ? arguments[1] : undefined;
849
758
 
850
759
  // isUpdatePosition --->>> Window resize and dropBox resize and to update the position
851
- var _ref6 = this.context || {},
852
- direction = _ref6.direction;
760
+ var _ref5 = this.context || {},
761
+ direction = _ref5.direction;
853
762
 
854
763
  var placeHolderElement = this.placeHolderElement,
855
764
  dropElement = this.dropElement;
@@ -875,11 +784,11 @@ var Popup = function Popup(Component) {
875
784
 
876
785
  var setPosition = function setPosition() {
877
786
  requestAnimationFrame(function () {
878
- var placeHolderElement = _this8.placeHolderElement,
879
- dropElement = _this8.dropElement;
880
- var _this8$state = _this8.state,
881
- position = _this8$state.position,
882
- isPopupReady = _this8$state.isPopupReady;
787
+ var placeHolderElement = _this4.placeHolderElement,
788
+ dropElement = _this4.dropElement;
789
+ var _this4$state = _this4.state,
790
+ position = _this4$state.position,
791
+ isPopupReady = _this4$state.isPopupReady;
883
792
  var scrollContainer = placeHolderElement.closest('[data-scroll=true]') || document.body;
884
793
 
885
794
  var betterPosition = _viewPort["default"].betterView(dropElement, placeHolderElement, defaultPosition, scrollContainer, {
@@ -888,26 +797,26 @@ var Popup = function Popup(Component) {
888
797
  customOrder: customOrder
889
798
  });
890
799
 
891
- var _ref7 = betterPosition || _Common.DUMMY_OBJECT,
892
- view = _ref7.view,
893
- views = _ref7.views,
894
- viewsOffset = _ref7.viewsOffset,
895
- targetOffset = _ref7.targetOffset,
896
- popupOffset = _ref7.popupOffset;
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;
897
806
 
898
807
  if (!isAbsolute) {
899
808
  if (!isPopupReady) {
900
- _this8.updatePopupState(view, views, viewsOffset, targetOffset, popupOffset, isAbsolute);
809
+ _this4.updatePopupState(view, views, viewsOffset, targetOffset, popupOffset, isAbsolute);
901
810
  }
902
811
 
903
812
  if (!dropElement) {
904
813
  return;
905
814
  }
906
815
 
907
- _this8.setContainerDynamicPositioning(betterPosition, needArrow);
816
+ _this4.setContainerDynamicPositioning(betterPosition, needArrow);
908
817
  } else {
909
818
  if (position !== view || !isPopupReady) {
910
- _this8.updatePopupState(view, views, viewsOffset, targetOffset, popupOffset, isAbsolute);
819
+ _this4.updatePopupState(view, views, viewsOffset, targetOffset, popupOffset, isAbsolute);
911
820
  }
912
821
  }
913
822
  });
@@ -926,7 +835,7 @@ var Popup = function Popup(Component) {
926
835
  }, {
927
836
  key: "handleOpenPopupPositionChange",
928
837
  value: function handleOpenPopupPositionChange() {
929
- var _this9 = this;
838
+ var _this5 = this;
930
839
 
931
840
  Object.keys(popups).forEach(function (groupName) {
932
841
  var groupPopups = popups[groupName] || [];
@@ -943,11 +852,11 @@ var Popup = function Popup(Component) {
943
852
  if (placeHolderElement && dropElement) {
944
853
  var scrollContainer = placeHolderElement.closest('[data-scroll=true]') || document.body;
945
854
  requestAnimationFrame(function () {
946
- var needArrow = _this9.getNeedArrow(popup);
855
+ var needArrow = _this5.getNeedArrow(popup);
947
856
 
948
- var isAbsolute = _this9.getIsAbsolutePopup(popup);
857
+ var isAbsolute = _this5.getIsAbsolutePopup(popup);
949
858
 
950
- var customOrder = _this9.getCustomPositionOrder(popup);
859
+ var customOrder = _this5.getCustomPositionOrder(popup);
951
860
 
952
861
  var isMobile = (0, _isMobilePopover["default"])(true);
953
862
 
@@ -957,33 +866,33 @@ var Popup = function Popup(Component) {
957
866
  customOrder: customOrder
958
867
  });
959
868
 
960
- var _ref8 = betterPosition || {},
961
- view = _ref8.view,
962
- views = _ref8.views,
963
- _ref8$viewsOffset = _ref8.viewsOffset,
964
- viewsOffset = _ref8$viewsOffset === void 0 ? {} : _ref8$viewsOffset,
965
- targetOffset = _ref8.targetOffset,
966
- popupOffset = _ref8.popupOffset;
967
-
968
- var _ref9 = positionsOffset[position] || {},
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] || {},
969
888
  _ref9$left = _ref9.left,
970
- oldLeft = _ref9$left === void 0 ? '' : _ref9$left,
889
+ left = _ref9$left === void 0 ? '' : _ref9$left,
971
890
  _ref9$top = _ref9.top,
972
- oldTop = _ref9$top === void 0 ? '' : _ref9$top,
891
+ top = _ref9$top === void 0 ? '' : _ref9$top,
973
892
  _ref9$bottom = _ref9.bottom,
974
- oldBottom = _ref9$bottom === void 0 ? '' : _ref9$bottom,
893
+ bottom = _ref9$bottom === void 0 ? '' : _ref9$bottom,
975
894
  _ref9$right = _ref9.right,
976
- oldRight = _ref9$right === void 0 ? '' : _ref9$right;
977
-
978
- var _ref10 = viewsOffset[view] || {},
979
- _ref10$left = _ref10.left,
980
- left = _ref10$left === void 0 ? '' : _ref10$left,
981
- _ref10$top = _ref10.top,
982
- top = _ref10$top === void 0 ? '' : _ref10$top,
983
- _ref10$bottom = _ref10.bottom,
984
- bottom = _ref10$bottom === void 0 ? '' : _ref10$bottom,
985
- _ref10$right = _ref10.right,
986
- right = _ref10$right === void 0 ? '' : _ref10$right;
895
+ right = _ref9$right === void 0 ? '' : _ref9$right;
987
896
 
988
897
  var changeState = isAbsolute ? position !== view : oldLeft !== left || oldTop !== top || oldBottom !== bottom || oldRight !== right; // let isInViewPort = viewPort.isInViewPort(
989
898
  // placeHolderElement,
@@ -1042,11 +951,11 @@ var Popup = function Popup(Component) {
1042
951
  var height = popupSize.height,
1043
952
  width = popupSize.width;
1044
953
 
1045
- var _ref11 = this.size || {},
1046
- _ref11$height = _ref11.height,
1047
- oldHeight = _ref11$height === void 0 ? 0 : _ref11$height,
1048
- _ref11$width = _ref11.width,
1049
- oldWidth = _ref11$width === void 0 ? 0 : _ref11$width;
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;
1050
959
 
1051
960
  var _this$state2 = this.state,
1052
961
  isPopupReady = _this$state2.isPopupReady,
@@ -15,8 +15,7 @@ var id = {
15
15
  direction: 'ltr',
16
16
  tooltipDebounce: 175,
17
17
  getTooltipContainer: function getTooltipContainer() {},
18
- autoComplete: false,
19
- getParentContainer: function getParentContainer() {}
18
+ autoComplete: false
20
19
  };
21
20
 
22
21
  function getLibraryConfig(key) {
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
@@ -29,6 +27,20 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
29
27
 
30
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); }
31
29
 
30
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
31
+
32
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
33
+
34
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
35
+
36
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
37
+
38
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
39
+
40
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
41
+
42
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
43
+
32
44
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
33
45
 
34
46
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@@ -63,14 +75,37 @@ var VelocityAnimationGroup = /*#__PURE__*/function (_React$Component) {
63
75
  var _super = _createSuper(VelocityAnimationGroup);
64
76
 
65
77
  function VelocityAnimationGroup(props) {
78
+ var _this;
79
+
66
80
  _classCallCheck(this, VelocityAnimationGroup);
67
81
 
68
- return _super.call(this, props);
82
+ _this = _super.call(this, props);
83
+ _this.handleOnEnterComplete = _this.handleOnEnterComplete.bind(_assertThisInitialized(_this));
84
+ return _this;
69
85
  }
70
86
 
71
87
  _createClass(VelocityAnimationGroup, [{
88
+ key: "handleOnEnterComplete",
89
+ value: function handleOnEnterComplete(onEnterComplete, elements) {
90
+ if (typeof onEnterComplete === 'function') {
91
+ onEnterComplete(elements);
92
+ } else if (onEnterComplete && _typeof(onEnterComplete) === 'object') {
93
+ elements.forEach(function (rootElement) {
94
+ Object.entries(onEnterComplete).forEach(function (_ref) {
95
+ var _ref2 = _slicedToArray(_ref, 2),
96
+ cssProperty = _ref2[0],
97
+ cssValue = _ref2[1];
98
+
99
+ if (cssProperty.includes) rootElement.style[cssProperty] = cssValue;
100
+ });
101
+ });
102
+ }
103
+ }
104
+ }, {
72
105
  key: "render",
73
106
  value: function render() {
107
+ var _this2 = this;
108
+
74
109
  var _this$props = this.props,
75
110
  children = _this$props.children,
76
111
  enterName = _this$props.enterName,
@@ -87,11 +122,12 @@ var VelocityAnimationGroup = /*#__PURE__*/function (_React$Component) {
87
122
  enterDelay = _this$props.enterDelay,
88
123
  isCustomized = _this$props.isCustomized,
89
124
  name = _this$props.name,
90
- needUIPack = _this$props.needUIPack;
125
+ needUIPack = _this$props.needUIPack,
126
+ onEnterComplete = _this$props.onEnterComplete;
91
127
 
92
- var _ref = this.context || {},
93
- direction = _ref.direction,
94
- isReducedMotion = _ref.isReducedMotion;
128
+ var _ref3 = this.context || {},
129
+ direction = _ref3.direction,
130
+ isReducedMotion = _ref3.isReducedMotion;
95
131
 
96
132
  var childProps = clearProps(this.props);
97
133
  var enterAnimationObj = {
@@ -128,7 +164,10 @@ var VelocityAnimationGroup = /*#__PURE__*/function (_React$Component) {
128
164
  animation: isCustomized ? enterAnimationObj[name] : needUIPack ? "transition.".concat(enterName, "In") : enterName,
129
165
  duration: !isReducedMotion ? enterDuration : 0,
130
166
  delay: enterDelay ? enterDelay : 0,
131
- display: isFlex ? 'flex' : ''
167
+ display: isFlex ? 'flex' : '',
168
+ complete: function complete(elements) {
169
+ _this2.handleOnEnterComplete(onEnterComplete, elements);
170
+ }
132
171
  };
133
172
  var exitAnimation = {
134
173
  animation: isCustomized ? exitAnimationObj[name] : needUIPack ? "transition.".concat(exitName ? exitName : enterName, "Out") : exitName ? exitName : enterName,
@@ -142,7 +181,8 @@ var VelocityAnimationGroup = /*#__PURE__*/function (_React$Component) {
142
181
  component: component && component,
143
182
  runOnMount: runOnMount,
144
183
  enterHideStyle: enterHideStyle,
145
- enterShowStyle: enterShowStyle
184
+ enterShowStyle: enterShowStyle,
185
+ onEnterComplete: onEnterComplete
146
186
  }, childProps), isActive ? children : null);
147
187
  }
148
188
  }]);
@@ -17,6 +17,7 @@ var defaultProps = {
17
17
  exitDuration: 300,
18
18
  isActive: false,
19
19
  isCustomized: true,
20
- needUIPack: true
20
+ needUIPack: true,
21
+ onEnterComplete: {}
21
22
  };
22
23
  exports.defaultProps = defaultProps;
@@ -25,6 +25,7 @@ var propTypes = {
25
25
  isFlex: _propTypes["default"].bool,
26
26
  name: _propTypes["default"].oneOf(['fade', 'slideDown', 'flyDown', 'slideRight', 'shrink', 'expand', 'slideLeft']),
27
27
  needUIPack: _propTypes["default"].bool,
28
- runOnMount: _propTypes["default"].bool
28
+ runOnMount: _propTypes["default"].bool,
29
+ onEnterComplete: _propTypes["default"].oneOfType([_propTypes["default"].object, _propTypes["default"].func])
29
30
  };
30
31
  exports.propTypes = propTypes;
@@ -260,6 +260,12 @@
260
260
  justify-content: space-between;
261
261
  }
262
262
 
263
+ .justifyFstart {
264
+ -webkit-box-pack: flex-start;
265
+ -ms-flex-pack: flex-start;
266
+ justify-content: flex-start;
267
+ }
268
+
263
269
  .justifyFend {
264
270
  -webkit-box-pack: flex-end;
265
271
  -ms-flex-pack: flex-end;
@@ -493,6 +499,10 @@
493
499
  display: -webkit-box;
494
500
  overflow: hidden;
495
501
  }
502
+ .lineClamp {
503
+ composes: wbreak clamp;
504
+ -webkit-line-clamp: var(--line-clamp,2);
505
+ }
496
506
 
497
507
  .offSelection {
498
508
  -webkit-user-select: none;