@zohodesk/components 1.0.0-temp-199.16 → 1.0.0-temp-220.4
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/.cli/propValidation_report.html +1 -1
- package/es/ListItem/ListContainer.js +2 -3
- package/es/ListItem/ListItem.js +2 -2
- package/es/ListItem/ListItem.module.css +2 -39
- package/es/ListItem/ListItemWithAvatar.js +4 -6
- package/es/ListItem/ListItemWithCheckBox.js +3 -6
- package/es/ListItem/ListItemWithIcon.js +4 -8
- package/es/ListItem/ListItemWithRadio.js +3 -6
- package/es/ListItem/props/defaultProps.js +5 -13
- package/es/ListItem/props/propTypes.js +1 -9
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +2 -7
- package/es/MultiSelect/MultiSelect.js +2 -7
- package/es/MultiSelect/Suggestions.js +2 -9
- package/es/MultiSelect/props/defaultProps.js +1 -4
- package/es/MultiSelect/props/propTypes.js +3 -11
- package/es/Popup/Popup.js +104 -30
- package/es/Select/GroupSelect.js +1 -5
- package/es/Select/SelectWithAvatar.js +2 -7
- package/es/Select/SelectWithIcon.js +4 -13
- package/es/Select/props/defaultProps.js +2 -4
- package/es/Select/props/propTypes.js +3 -11
- package/es/common/common.module.css +0 -11
- package/lib/ListItem/ListContainer.js +2 -3
- package/lib/ListItem/ListItem.js +2 -2
- package/lib/ListItem/ListItem.module.css +2 -39
- package/lib/ListItem/ListItemWithAvatar.js +4 -6
- package/lib/ListItem/ListItemWithCheckBox.js +3 -6
- package/lib/ListItem/ListItemWithIcon.js +4 -8
- package/lib/ListItem/ListItemWithRadio.js +3 -6
- package/lib/ListItem/props/defaultProps.js +5 -13
- package/lib/ListItem/props/propTypes.js +2 -9
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +3 -8
- package/lib/MultiSelect/MultiSelect.js +3 -6
- package/lib/MultiSelect/Suggestions.js +3 -9
- package/lib/MultiSelect/props/defaultProps.js +1 -4
- package/lib/MultiSelect/props/propTypes.js +3 -10
- package/lib/Popup/Popup.js +168 -83
- package/lib/Select/GroupSelect.js +2 -4
- package/lib/Select/SelectWithAvatar.js +3 -8
- package/lib/Select/SelectWithIcon.js +5 -13
- package/lib/Select/props/defaultProps.js +2 -3
- package/lib/Select/props/propTypes.js +3 -11
- package/lib/common/common.module.css +0 -11
- package/package.json +3 -3
- package/result.json +1 -1
package/lib/Popup/Popup.js
CHANGED
|
@@ -97,6 +97,54 @@ var defaultState = {
|
|
|
97
97
|
//{height: ‘’, width: ‘’,}
|
|
98
98
|
isAbsolutePositioningNeeded: true
|
|
99
99
|
};
|
|
100
|
+
var SCROLL_BLOCK_EVENTS = Object.freeze([{
|
|
101
|
+
name: 'wheel',
|
|
102
|
+
handlerName: 'handleBlockScroll',
|
|
103
|
+
options: {
|
|
104
|
+
capture: true,
|
|
105
|
+
passive: false
|
|
106
|
+
}
|
|
107
|
+
}, {
|
|
108
|
+
name: 'touchmove',
|
|
109
|
+
handlerName: 'handleBlockScroll',
|
|
110
|
+
options: {
|
|
111
|
+
capture: true,
|
|
112
|
+
passive: false
|
|
113
|
+
}
|
|
114
|
+
}, {
|
|
115
|
+
name: 'scroll',
|
|
116
|
+
handlerName: 'handlePositionChange',
|
|
117
|
+
options: {
|
|
118
|
+
capture: true,
|
|
119
|
+
passive: false
|
|
120
|
+
}
|
|
121
|
+
}, {
|
|
122
|
+
name: 'keydown',
|
|
123
|
+
handlerName: 'preventKeyboardScroll',
|
|
124
|
+
options: {
|
|
125
|
+
capture: true,
|
|
126
|
+
passive: false
|
|
127
|
+
}
|
|
128
|
+
}]);
|
|
129
|
+
var IFRAME_SCROLL_BLOCK_EVENTS = Object.freeze(SCROLL_BLOCK_EVENTS.filter(function (event) {
|
|
130
|
+
return event.name !== 'keydown';
|
|
131
|
+
}));
|
|
132
|
+
var CLICK_EVENTS = Object.freeze([{
|
|
133
|
+
name: 'click',
|
|
134
|
+
handlerName: 'documentClickHandler',
|
|
135
|
+
options: {
|
|
136
|
+
capture: false,
|
|
137
|
+
passive: false
|
|
138
|
+
}
|
|
139
|
+
}, {
|
|
140
|
+
name: 'click',
|
|
141
|
+
handlerName: 'documentClickHandler1',
|
|
142
|
+
options: {
|
|
143
|
+
capture: true,
|
|
144
|
+
passive: false
|
|
145
|
+
}
|
|
146
|
+
}]);
|
|
147
|
+
var iframeSelector = '[data-scroll=true] iframe';
|
|
100
148
|
/* eslint-disable react/no-deprecated */
|
|
101
149
|
|
|
102
150
|
/* eslint-disable react/prop-types */
|
|
@@ -172,6 +220,7 @@ var Popup = function Popup(Component) {
|
|
|
172
220
|
_this.handleBlockScroll = _this.handleBlockScroll.bind(_assertThisInitialized(_this));
|
|
173
221
|
_this.handlePositionChange = _this.handlePositionChange.bind(_assertThisInitialized(_this));
|
|
174
222
|
_this.preventKeyboardScroll = _this.preventKeyboardScroll.bind(_assertThisInitialized(_this));
|
|
223
|
+
_this.updateListeners = _this.updateListeners.bind(_assertThisInitialized(_this));
|
|
175
224
|
_this.addScrollBlockListeners = _this.addScrollBlockListeners.bind(_assertThisInitialized(_this));
|
|
176
225
|
_this.removeScrollBlockListeners = _this.removeScrollBlockListeners.bind(_assertThisInitialized(_this));
|
|
177
226
|
_this.handleAddingScrollBlock = _this.handleAddingScrollBlock.bind(_assertThisInitialized(_this));
|
|
@@ -184,6 +233,7 @@ var Popup = function Popup(Component) {
|
|
|
184
233
|
_this.setContainerDynamicPositioning = _this.setContainerDynamicPositioning.bind(_assertThisInitialized(_this));
|
|
185
234
|
_this.updatePopupState = _this.updatePopupState.bind(_assertThisInitialized(_this));
|
|
186
235
|
_this.handleScrollAndBlockEvents = _this.handleScrollAndBlockEvents.bind(_assertThisInitialized(_this));
|
|
236
|
+
_this.handleIframeClickEvents = _this.handleIframeClickEvents.bind(_assertThisInitialized(_this));
|
|
187
237
|
_this.handleDropElementStyleUpdate = _this.handleDropElementStyleUpdate.bind(_assertThisInitialized(_this));
|
|
188
238
|
_this.positionRef = /*#__PURE__*/_react["default"].createRef();
|
|
189
239
|
_this.popupObserver = new _ResizeObserver["default"](_this.handlePopupResize); //dropBoxSize
|
|
@@ -242,6 +292,25 @@ var Popup = function Popup(Component) {
|
|
|
242
292
|
this.handleRemovingScrollToUpdatePosition();
|
|
243
293
|
}
|
|
244
294
|
}
|
|
295
|
+
}, {
|
|
296
|
+
key: "handleIframeClickEvents",
|
|
297
|
+
value: function handleIframeClickEvents(isPopupReady, isMobile) {
|
|
298
|
+
var _this2 = this;
|
|
299
|
+
|
|
300
|
+
var toggleListeners = function toggleListeners(add) {
|
|
301
|
+
_this2.updateListeners(add, CLICK_EVENTS, document);
|
|
302
|
+
|
|
303
|
+
document.querySelectorAll(iframeSelector).forEach(function (frame) {
|
|
304
|
+
var frameDocument = frame.contentDocument;
|
|
305
|
+
|
|
306
|
+
if (frameDocument) {
|
|
307
|
+
_this2.updateListeners(add, CLICK_EVENTS, frameDocument);
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
toggleListeners(isPopupReady && !isMobile);
|
|
313
|
+
}
|
|
245
314
|
}, {
|
|
246
315
|
key: "componentDidUpdate",
|
|
247
316
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
@@ -268,19 +337,20 @@ var Popup = function Popup(Component) {
|
|
|
268
337
|
|
|
269
338
|
if (oldStateOpen !== isPopupReady && !isMobile || oldIsMobileState !== isMobile) {
|
|
270
339
|
this.handleScrollAndBlockEvents(isPopupReady, isMobile);
|
|
340
|
+
this.handleIframeClickEvents(isPopupReady, isMobile);
|
|
271
341
|
}
|
|
272
342
|
}
|
|
273
343
|
}, {
|
|
274
344
|
key: "componentWillUnmount",
|
|
275
345
|
value: function componentWillUnmount() {
|
|
276
|
-
var
|
|
346
|
+
var _this3 = this;
|
|
277
347
|
|
|
278
348
|
var group = this.getGroup();
|
|
279
349
|
popups = Object.keys(popups).reduce(function (res, groupName) {
|
|
280
350
|
if (groupName === group) {
|
|
281
351
|
var groupPopups = popups[group];
|
|
282
352
|
var newGroupPopups = groupPopups.filter(function (popup) {
|
|
283
|
-
return popup !==
|
|
353
|
+
return popup !== _this3;
|
|
284
354
|
});
|
|
285
355
|
newGroupPopups.length === 0 && lastOpenedGroup.indexOf(group) >= 0 && lastOpenedGroup.splice(lastOpenedGroup.indexOf(group), 1);
|
|
286
356
|
res[group] = newGroupPopups;
|
|
@@ -427,44 +497,59 @@ var Popup = function Popup(Component) {
|
|
|
427
497
|
this.handlePopupPosition(defaultPosition, true);
|
|
428
498
|
}
|
|
429
499
|
}
|
|
500
|
+
}, {
|
|
501
|
+
key: "updateListeners",
|
|
502
|
+
value: function updateListeners() {
|
|
503
|
+
var _this4 = this;
|
|
504
|
+
|
|
505
|
+
var add = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
506
|
+
var eventList = arguments.length > 1 ? arguments[1] : undefined;
|
|
507
|
+
var element = arguments.length > 2 ? arguments[2] : undefined;
|
|
508
|
+
var method = add ? 'addEventListener' : 'removeEventListener';
|
|
509
|
+
|
|
510
|
+
var applyListeners = function applyListeners(target) {
|
|
511
|
+
eventList.forEach(function (_ref5) {
|
|
512
|
+
var name = _ref5.name,
|
|
513
|
+
handlerName = _ref5.handlerName,
|
|
514
|
+
options = _ref5.options;
|
|
515
|
+
var handler = _this4[handlerName];
|
|
516
|
+
|
|
517
|
+
if (handler) {
|
|
518
|
+
target[method](name, handler, options);
|
|
519
|
+
}
|
|
520
|
+
});
|
|
521
|
+
};
|
|
522
|
+
|
|
523
|
+
applyListeners(element);
|
|
524
|
+
}
|
|
430
525
|
}, {
|
|
431
526
|
key: "addScrollBlockListeners",
|
|
432
527
|
value: function addScrollBlockListeners() {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
});
|
|
445
|
-
document.addEventListener('keydown', this.preventKeyboardScroll, {
|
|
446
|
-
capture: true,
|
|
447
|
-
passive: false
|
|
528
|
+
var _this5 = this;
|
|
529
|
+
|
|
530
|
+
// Main document
|
|
531
|
+
this.updateListeners(true, SCROLL_BLOCK_EVENTS, document); // Attach event listeners to all iframes within elements that have the attribute data-scroll=true
|
|
532
|
+
|
|
533
|
+
document.querySelectorAll(iframeSelector).forEach(function (frame) {
|
|
534
|
+
var frameDocument = frame.contentDocument;
|
|
535
|
+
|
|
536
|
+
if (frameDocument) {
|
|
537
|
+
_this5.updateListeners(true, IFRAME_SCROLL_BLOCK_EVENTS, frameDocument);
|
|
538
|
+
}
|
|
448
539
|
});
|
|
449
540
|
}
|
|
450
541
|
}, {
|
|
451
542
|
key: "removeScrollBlockListeners",
|
|
452
543
|
value: function removeScrollBlockListeners() {
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
capture: true,
|
|
463
|
-
passive: false
|
|
464
|
-
});
|
|
465
|
-
document.removeEventListener('keydown', this.preventKeyboardScroll, {
|
|
466
|
-
capture: true,
|
|
467
|
-
passive: false
|
|
544
|
+
var _this6 = this;
|
|
545
|
+
|
|
546
|
+
this.updateListeners(false, SCROLL_BLOCK_EVENTS, document);
|
|
547
|
+
document.querySelectorAll(iframeSelector).forEach(function (frame) {
|
|
548
|
+
var frameDocument = frame.contentDocument;
|
|
549
|
+
|
|
550
|
+
if (frameDocument) {
|
|
551
|
+
_this6.updateListeners(false, IFRAME_SCROLL_BLOCK_EVENTS, frameDocument);
|
|
552
|
+
}
|
|
468
553
|
});
|
|
469
554
|
}
|
|
470
555
|
}, {
|
|
@@ -572,7 +657,7 @@ var Popup = function Popup(Component) {
|
|
|
572
657
|
}, {
|
|
573
658
|
key: "togglePopup",
|
|
574
659
|
value: function togglePopup(e, defaultPosition) {
|
|
575
|
-
var
|
|
660
|
+
var _this7 = this;
|
|
576
661
|
|
|
577
662
|
var group = this.getGroup();
|
|
578
663
|
this.removeClose(e);
|
|
@@ -581,7 +666,7 @@ var Popup = function Popup(Component) {
|
|
|
581
666
|
lastOpenedGroup = !isPopupOpen && lastOpenedGroup.indexOf(group) === -1 ? [group].concat(_toConsumableArray(lastOpenedGroup)) : lastOpenedGroup;
|
|
582
667
|
isPopupOpen && lastOpenedGroup.splice(0, 1);
|
|
583
668
|
groupPopups.forEach(function (popup) {
|
|
584
|
-
if (popup !==
|
|
669
|
+
if (popup !== _this7 && popup.state.isPopupOpen) {
|
|
585
670
|
popup.setState({
|
|
586
671
|
isPopupOpen: false,
|
|
587
672
|
isPopupReady: false
|
|
@@ -751,14 +836,14 @@ var Popup = function Popup(Component) {
|
|
|
751
836
|
}, {
|
|
752
837
|
key: "handlePopupPosition",
|
|
753
838
|
value: function handlePopupPosition() {
|
|
754
|
-
var
|
|
839
|
+
var _this8 = this;
|
|
755
840
|
|
|
756
841
|
var defaultPosition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'bottomCenter';
|
|
757
842
|
var isUpdatePosition = arguments.length > 1 ? arguments[1] : undefined;
|
|
758
843
|
|
|
759
844
|
// isUpdatePosition --->>> Window resize and dropBox resize and to update the position
|
|
760
|
-
var
|
|
761
|
-
direction =
|
|
845
|
+
var _ref6 = this.context || {},
|
|
846
|
+
direction = _ref6.direction;
|
|
762
847
|
|
|
763
848
|
var placeHolderElement = this.placeHolderElement,
|
|
764
849
|
dropElement = this.dropElement;
|
|
@@ -784,11 +869,11 @@ var Popup = function Popup(Component) {
|
|
|
784
869
|
|
|
785
870
|
var setPosition = function setPosition() {
|
|
786
871
|
requestAnimationFrame(function () {
|
|
787
|
-
var placeHolderElement =
|
|
788
|
-
dropElement =
|
|
789
|
-
var
|
|
790
|
-
position =
|
|
791
|
-
isPopupReady =
|
|
872
|
+
var placeHolderElement = _this8.placeHolderElement,
|
|
873
|
+
dropElement = _this8.dropElement;
|
|
874
|
+
var _this8$state = _this8.state,
|
|
875
|
+
position = _this8$state.position,
|
|
876
|
+
isPopupReady = _this8$state.isPopupReady;
|
|
792
877
|
var scrollContainer = placeHolderElement.closest('[data-scroll=true]') || document.body;
|
|
793
878
|
|
|
794
879
|
var betterPosition = _viewPort["default"].betterView(dropElement, placeHolderElement, defaultPosition, scrollContainer, {
|
|
@@ -797,26 +882,26 @@ var Popup = function Popup(Component) {
|
|
|
797
882
|
customOrder: customOrder
|
|
798
883
|
});
|
|
799
884
|
|
|
800
|
-
var
|
|
801
|
-
view =
|
|
802
|
-
views =
|
|
803
|
-
viewsOffset =
|
|
804
|
-
targetOffset =
|
|
805
|
-
popupOffset =
|
|
885
|
+
var _ref7 = betterPosition || _Common.DUMMY_OBJECT,
|
|
886
|
+
view = _ref7.view,
|
|
887
|
+
views = _ref7.views,
|
|
888
|
+
viewsOffset = _ref7.viewsOffset,
|
|
889
|
+
targetOffset = _ref7.targetOffset,
|
|
890
|
+
popupOffset = _ref7.popupOffset;
|
|
806
891
|
|
|
807
892
|
if (!isAbsolute) {
|
|
808
893
|
if (!isPopupReady) {
|
|
809
|
-
|
|
894
|
+
_this8.updatePopupState(view, views, viewsOffset, targetOffset, popupOffset, isAbsolute);
|
|
810
895
|
}
|
|
811
896
|
|
|
812
897
|
if (!dropElement) {
|
|
813
898
|
return;
|
|
814
899
|
}
|
|
815
900
|
|
|
816
|
-
|
|
901
|
+
_this8.setContainerDynamicPositioning(betterPosition, needArrow);
|
|
817
902
|
} else {
|
|
818
903
|
if (position !== view || !isPopupReady) {
|
|
819
|
-
|
|
904
|
+
_this8.updatePopupState(view, views, viewsOffset, targetOffset, popupOffset, isAbsolute);
|
|
820
905
|
}
|
|
821
906
|
}
|
|
822
907
|
});
|
|
@@ -835,7 +920,7 @@ var Popup = function Popup(Component) {
|
|
|
835
920
|
}, {
|
|
836
921
|
key: "handleOpenPopupPositionChange",
|
|
837
922
|
value: function handleOpenPopupPositionChange() {
|
|
838
|
-
var
|
|
923
|
+
var _this9 = this;
|
|
839
924
|
|
|
840
925
|
Object.keys(popups).forEach(function (groupName) {
|
|
841
926
|
var groupPopups = popups[groupName] || [];
|
|
@@ -852,11 +937,11 @@ var Popup = function Popup(Component) {
|
|
|
852
937
|
if (placeHolderElement && dropElement) {
|
|
853
938
|
var scrollContainer = placeHolderElement.closest('[data-scroll=true]') || document.body;
|
|
854
939
|
requestAnimationFrame(function () {
|
|
855
|
-
var needArrow =
|
|
940
|
+
var needArrow = _this9.getNeedArrow(popup);
|
|
856
941
|
|
|
857
|
-
var isAbsolute =
|
|
942
|
+
var isAbsolute = _this9.getIsAbsolutePopup(popup);
|
|
858
943
|
|
|
859
|
-
var customOrder =
|
|
944
|
+
var customOrder = _this9.getCustomPositionOrder(popup);
|
|
860
945
|
|
|
861
946
|
var isMobile = (0, _isMobilePopover["default"])(true);
|
|
862
947
|
|
|
@@ -866,33 +951,33 @@ var Popup = function Popup(Component) {
|
|
|
866
951
|
customOrder: customOrder
|
|
867
952
|
});
|
|
868
953
|
|
|
869
|
-
var
|
|
870
|
-
view =
|
|
871
|
-
views =
|
|
872
|
-
|
|
873
|
-
viewsOffset =
|
|
874
|
-
targetOffset =
|
|
875
|
-
popupOffset =
|
|
876
|
-
|
|
877
|
-
var
|
|
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] || {},
|
|
954
|
+
var _ref8 = betterPosition || {},
|
|
955
|
+
view = _ref8.view,
|
|
956
|
+
views = _ref8.views,
|
|
957
|
+
_ref8$viewsOffset = _ref8.viewsOffset,
|
|
958
|
+
viewsOffset = _ref8$viewsOffset === void 0 ? {} : _ref8$viewsOffset,
|
|
959
|
+
targetOffset = _ref8.targetOffset,
|
|
960
|
+
popupOffset = _ref8.popupOffset;
|
|
961
|
+
|
|
962
|
+
var _ref9 = positionsOffset[position] || {},
|
|
888
963
|
_ref9$left = _ref9.left,
|
|
889
|
-
|
|
964
|
+
oldLeft = _ref9$left === void 0 ? '' : _ref9$left,
|
|
890
965
|
_ref9$top = _ref9.top,
|
|
891
|
-
|
|
966
|
+
oldTop = _ref9$top === void 0 ? '' : _ref9$top,
|
|
892
967
|
_ref9$bottom = _ref9.bottom,
|
|
893
|
-
|
|
968
|
+
oldBottom = _ref9$bottom === void 0 ? '' : _ref9$bottom,
|
|
894
969
|
_ref9$right = _ref9.right,
|
|
895
|
-
|
|
970
|
+
oldRight = _ref9$right === void 0 ? '' : _ref9$right;
|
|
971
|
+
|
|
972
|
+
var _ref10 = viewsOffset[view] || {},
|
|
973
|
+
_ref10$left = _ref10.left,
|
|
974
|
+
left = _ref10$left === void 0 ? '' : _ref10$left,
|
|
975
|
+
_ref10$top = _ref10.top,
|
|
976
|
+
top = _ref10$top === void 0 ? '' : _ref10$top,
|
|
977
|
+
_ref10$bottom = _ref10.bottom,
|
|
978
|
+
bottom = _ref10$bottom === void 0 ? '' : _ref10$bottom,
|
|
979
|
+
_ref10$right = _ref10.right,
|
|
980
|
+
right = _ref10$right === void 0 ? '' : _ref10$right;
|
|
896
981
|
|
|
897
982
|
var changeState = isAbsolute ? position !== view : oldLeft !== left || oldTop !== top || oldBottom !== bottom || oldRight !== right; // let isInViewPort = viewPort.isInViewPort(
|
|
898
983
|
// placeHolderElement,
|
|
@@ -951,11 +1036,11 @@ var Popup = function Popup(Component) {
|
|
|
951
1036
|
var height = popupSize.height,
|
|
952
1037
|
width = popupSize.width;
|
|
953
1038
|
|
|
954
|
-
var
|
|
955
|
-
|
|
956
|
-
oldHeight =
|
|
957
|
-
|
|
958
|
-
oldWidth =
|
|
1039
|
+
var _ref11 = this.size || {},
|
|
1040
|
+
_ref11$height = _ref11.height,
|
|
1041
|
+
oldHeight = _ref11$height === void 0 ? 0 : _ref11$height,
|
|
1042
|
+
_ref11$width = _ref11.width,
|
|
1043
|
+
oldWidth = _ref11$width === void 0 ? 0 : _ref11$width;
|
|
959
1044
|
|
|
960
1045
|
var _this$state2 = this.state,
|
|
961
1046
|
isPopupReady = _this$state2.isPopupReady,
|
|
@@ -670,8 +670,6 @@ var GroupSelectComponent = /*#__PURE__*/function (_PureComponent) {
|
|
|
670
670
|
isLoading = _this$props9.isLoading,
|
|
671
671
|
dataSelectorId = _this$props9.dataSelectorId,
|
|
672
672
|
customProps = _this$props9.customProps;
|
|
673
|
-
var _customProps$Suggesti = customProps.SuggestionsProps,
|
|
674
|
-
SuggestionsProps = _customProps$Suggesti === void 0 ? {} : _customProps$Suggesti;
|
|
675
673
|
i18nKeys = Object.assign({}, i18nKeys, {
|
|
676
674
|
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
677
675
|
searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage
|
|
@@ -848,7 +846,7 @@ var GroupSelectComponent = /*#__PURE__*/function (_PureComponent) {
|
|
|
848
846
|
a11y: {
|
|
849
847
|
role: 'heading'
|
|
850
848
|
}
|
|
851
|
-
})), /*#__PURE__*/_react["default"].createElement(_Suggestions["default"],
|
|
849
|
+
})), /*#__PURE__*/_react["default"].createElement(_Suggestions["default"], {
|
|
852
850
|
activeId: selectedId,
|
|
853
851
|
suggestions: options,
|
|
854
852
|
getRef: _this7.suggestionItemRef,
|
|
@@ -864,7 +862,7 @@ var GroupSelectComponent = /*#__PURE__*/function (_PureComponent) {
|
|
|
864
862
|
role: 'option'
|
|
865
863
|
},
|
|
866
864
|
dataId: "".concat(dataId, "_Options")
|
|
867
|
-
}
|
|
865
|
+
}));
|
|
868
866
|
}) : /*#__PURE__*/_react["default"].createElement(_EmptyState["default"], {
|
|
869
867
|
options: revampedGroups,
|
|
870
868
|
searchString: searchStr,
|
|
@@ -51,8 +51,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
51
51
|
|
|
52
52
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
53
53
|
|
|
54
|
-
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); }
|
|
55
|
-
|
|
56
54
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
57
55
|
|
|
58
56
|
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); } }
|
|
@@ -217,10 +215,7 @@ var SelectWithAvatarComponent = /*#__PURE__*/function (_SelectComponent) {
|
|
|
217
215
|
needEffect = _this$props.needEffect,
|
|
218
216
|
isLoading = _this$props.isLoading,
|
|
219
217
|
dataSelectorId = _this$props.dataSelectorId,
|
|
220
|
-
getTargetRef = _this$props.getTargetRef
|
|
221
|
-
customProps = _this$props.customProps;
|
|
222
|
-
var _customProps$Suggesti = customProps.SuggestionsProps,
|
|
223
|
-
SuggestionsProps = _customProps$Suggesti === void 0 ? {} : _customProps$Suggesti;
|
|
218
|
+
getTargetRef = _this$props.getTargetRef;
|
|
224
219
|
i18nKeys = Object.assign({}, i18nKeys, {
|
|
225
220
|
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
226
221
|
searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage
|
|
@@ -359,7 +354,7 @@ var SelectWithAvatarComponent = /*#__PURE__*/function (_SelectComponent) {
|
|
|
359
354
|
a11y: {
|
|
360
355
|
role: 'heading'
|
|
361
356
|
}
|
|
362
|
-
})) : null, suggestions.length ? /*#__PURE__*/_react["default"].createElement(_Suggestions["default"],
|
|
357
|
+
})) : null, suggestions.length ? /*#__PURE__*/_react["default"].createElement(_Suggestions["default"], {
|
|
363
358
|
dataId: "".concat(dataId, "_Options"),
|
|
364
359
|
activeId: selectedId,
|
|
365
360
|
suggestions: suggestions,
|
|
@@ -376,7 +371,7 @@ var SelectWithAvatarComponent = /*#__PURE__*/function (_SelectComponent) {
|
|
|
376
371
|
ariaParentRole: 'listbox',
|
|
377
372
|
role: 'option'
|
|
378
373
|
}
|
|
379
|
-
}
|
|
374
|
+
}) : /*#__PURE__*/_react["default"].createElement(_EmptyState["default"], {
|
|
380
375
|
isLoading: isFetchingOptions,
|
|
381
376
|
options: options,
|
|
382
377
|
searchString: searchStr,
|
|
@@ -423,8 +423,7 @@ var SelectWithIcon = /*#__PURE__*/function (_Component) {
|
|
|
423
423
|
htmlId = _this$props7.htmlId,
|
|
424
424
|
isLoading = _this$props7.isLoading,
|
|
425
425
|
dataSelectorId = _this$props7.dataSelectorId,
|
|
426
|
-
customProps = _this$props7.customProps
|
|
427
|
-
customClass = _this$props7.customClass;
|
|
426
|
+
customProps = _this$props7.customProps;
|
|
428
427
|
i18nKeys = Object.assign({}, i18nKeys, {
|
|
429
428
|
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
430
429
|
searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage
|
|
@@ -441,11 +440,7 @@ var SelectWithIcon = /*#__PURE__*/function (_Component) {
|
|
|
441
440
|
_customProps$Dropdown = customProps.DropdownSearchTextBoxProps,
|
|
442
441
|
DropdownSearchTextBoxProps = _customProps$Dropdown === void 0 ? {} : _customProps$Dropdown,
|
|
443
442
|
_customProps$TextBoxI = customProps.TextBoxIconProps,
|
|
444
|
-
TextBoxIconProps = _customProps$TextBoxI === void 0 ? {} : _customProps$TextBoxI
|
|
445
|
-
_customProps$ListItem = customProps.ListItemProps,
|
|
446
|
-
ListItemProps = _customProps$ListItem === void 0 ? {} : _customProps$ListItem;
|
|
447
|
-
var _customClass$dropBoxC = customClass.dropBoxClass,
|
|
448
|
-
dropBoxClass = _customClass$dropBoxC === void 0 ? '' : _customClass$dropBoxC;
|
|
443
|
+
TextBoxIconProps = _customProps$TextBoxI === void 0 ? {} : _customProps$TextBoxI;
|
|
449
444
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
450
445
|
className: "".concat(_SelectModule["default"].container, " ").concat(_SelectModule["default"]["box_".concat(size)], " ").concat(isReadOnly ? _SelectModule["default"].readonly : '', " ").concat(borderColor === 'transparent' ? _SelectModule["default"].transparentContainer : ''),
|
|
451
446
|
"data-title": isDisabled ? title : null,
|
|
@@ -538,10 +533,7 @@ var SelectWithIcon = /*#__PURE__*/function (_Component) {
|
|
|
538
533
|
size: boxSize,
|
|
539
534
|
isPadding: false,
|
|
540
535
|
isResponsivePadding: true,
|
|
541
|
-
alignBox: "row"
|
|
542
|
-
customClass: {
|
|
543
|
-
customDropBox: dropBoxClass
|
|
544
|
-
}
|
|
536
|
+
alignBox: "row"
|
|
545
537
|
}, isLoading ? /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
546
538
|
align: "both",
|
|
547
539
|
className: _SelectModule["default"].loader
|
|
@@ -581,7 +573,7 @@ var SelectWithIcon = /*#__PURE__*/function (_Component) {
|
|
|
581
573
|
var iconName = options.iconName,
|
|
582
574
|
iconSize = options.iconSize,
|
|
583
575
|
iconColor = options.iconColor;
|
|
584
|
-
return /*#__PURE__*/_react["default"].createElement(_ListItemWithIcon["default"],
|
|
576
|
+
return /*#__PURE__*/_react["default"].createElement(_ListItemWithIcon["default"], {
|
|
585
577
|
key: options[idKey],
|
|
586
578
|
value: options[valueKey],
|
|
587
579
|
size: "medium",
|
|
@@ -605,7 +597,7 @@ var SelectWithIcon = /*#__PURE__*/function (_Component) {
|
|
|
605
597
|
ariaSelected: selectedId === options[idKey],
|
|
606
598
|
ariaLabel: options[valueKey]
|
|
607
599
|
}
|
|
608
|
-
}
|
|
600
|
+
});
|
|
609
601
|
})) : /*#__PURE__*/_react["default"].createElement(_EmptyState["default"], {
|
|
610
602
|
isLoading: isFetchingOptions,
|
|
611
603
|
options: options,
|
|
@@ -112,8 +112,7 @@ var SelectWithAvatar_defaultProps = {
|
|
|
112
112
|
isRestrictScroll: false,
|
|
113
113
|
i18nKeys: {},
|
|
114
114
|
needEffect: true,
|
|
115
|
-
isLoading: false
|
|
116
|
-
customProps: {}
|
|
115
|
+
isLoading: false
|
|
117
116
|
};
|
|
118
117
|
exports.SelectWithAvatar_defaultProps = SelectWithAvatar_defaultProps;
|
|
119
118
|
var SelectWithIcon_defaultProps = (_SelectWithIcon_defau = {
|
|
@@ -125,5 +124,5 @@ var SelectWithIcon_defaultProps = (_SelectWithIcon_defau = {
|
|
|
125
124
|
needListBorder: false,
|
|
126
125
|
needSearch: false,
|
|
127
126
|
boxSize: 'default'
|
|
128
|
-
}, _defineProperty(_SelectWithIcon_defau, "needListBorder", false), _defineProperty(_SelectWithIcon_defau, "needCloseOnSelect", true), _defineProperty(_SelectWithIcon_defau, "borderColor", 'default'), _defineProperty(_SelectWithIcon_defau, "needTick", true), _defineProperty(_SelectWithIcon_defau, "searchBoxSize", 'small'), _defineProperty(_SelectWithIcon_defau, "size", 'medium'), _defineProperty(_SelectWithIcon_defau, "textBoxSize", 'medium'), _defineProperty(_SelectWithIcon_defau, "textBoxVariant", 'default'), _defineProperty(_SelectWithIcon_defau, "dataId", 'selectWithIcon'), _defineProperty(_SelectWithIcon_defau, "dataSelectorId", 'selectWithIcon'), _defineProperty(_SelectWithIcon_defau, "dropBoxSize", 'small'), _defineProperty(_SelectWithIcon_defau, "needIcon", true), _defineProperty(_SelectWithIcon_defau, "iconSize", '14'), _defineProperty(_SelectWithIcon_defau, "i18nKeys", {}), _defineProperty(_SelectWithIcon_defau, "isLoading", false), _defineProperty(_SelectWithIcon_defau, "isAbsolutePositioningNeeded", true), _defineProperty(_SelectWithIcon_defau, "isRestrictScroll", false), _defineProperty(_SelectWithIcon_defau, "customProps", {}),
|
|
127
|
+
}, _defineProperty(_SelectWithIcon_defau, "needListBorder", false), _defineProperty(_SelectWithIcon_defau, "needCloseOnSelect", true), _defineProperty(_SelectWithIcon_defau, "borderColor", 'default'), _defineProperty(_SelectWithIcon_defau, "needTick", true), _defineProperty(_SelectWithIcon_defau, "searchBoxSize", 'small'), _defineProperty(_SelectWithIcon_defau, "size", 'medium'), _defineProperty(_SelectWithIcon_defau, "textBoxSize", 'medium'), _defineProperty(_SelectWithIcon_defau, "textBoxVariant", 'default'), _defineProperty(_SelectWithIcon_defau, "dataId", 'selectWithIcon'), _defineProperty(_SelectWithIcon_defau, "dataSelectorId", 'selectWithIcon'), _defineProperty(_SelectWithIcon_defau, "dropBoxSize", 'small'), _defineProperty(_SelectWithIcon_defau, "needIcon", true), _defineProperty(_SelectWithIcon_defau, "iconSize", '14'), _defineProperty(_SelectWithIcon_defau, "i18nKeys", {}), _defineProperty(_SelectWithIcon_defau, "isLoading", false), _defineProperty(_SelectWithIcon_defau, "isAbsolutePositioningNeeded", true), _defineProperty(_SelectWithIcon_defau, "isRestrictScroll", false), _defineProperty(_SelectWithIcon_defau, "customProps", {}), _SelectWithIcon_defau);
|
|
129
128
|
exports.SelectWithIcon_defaultProps = SelectWithIcon_defaultProps;
|
|
@@ -195,8 +195,7 @@ var GroupSelect_propTypes = {
|
|
|
195
195
|
isDefaultSelectValue: _propTypes["default"].bool,
|
|
196
196
|
customProps: _propTypes["default"].shape({
|
|
197
197
|
TextBoxProps: _propTypes["default"].object,
|
|
198
|
-
TextBoxIconProps: _propTypes["default"].object
|
|
199
|
-
SuggestionsProps: _propTypes["default"].object
|
|
198
|
+
TextBoxIconProps: _propTypes["default"].object
|
|
200
199
|
}),
|
|
201
200
|
allowValueFallback: _propTypes["default"].bool
|
|
202
201
|
};
|
|
@@ -261,10 +260,7 @@ var SelectWithAvatar_propTypes = _objectSpread(_objectSpread({}, Select_propType
|
|
|
261
260
|
htmlId: _propTypes["default"].string,
|
|
262
261
|
needEffect: _propTypes["default"].bool,
|
|
263
262
|
isLoading: _propTypes["default"].bool,
|
|
264
|
-
dataSelectorId: _propTypes["default"].string
|
|
265
|
-
customProps: _propTypes["default"].shape({
|
|
266
|
-
SuggestionsProps: _propTypes["default"].object
|
|
267
|
-
})
|
|
263
|
+
dataSelectorId: _propTypes["default"].string
|
|
268
264
|
});
|
|
269
265
|
|
|
270
266
|
exports.SelectWithAvatar_propTypes = SelectWithAvatar_propTypes;
|
|
@@ -328,11 +324,7 @@ var SelectWithIcon_propTypes = {
|
|
|
328
324
|
customProps: _propTypes["default"].shape({
|
|
329
325
|
TextBoxProps: _propTypes["default"].object,
|
|
330
326
|
DropdownSearchTextBoxProps: _propTypes["default"].object,
|
|
331
|
-
TextBoxIconProps: _propTypes["default"].object
|
|
332
|
-
ListItemProps: _propTypes["default"].object
|
|
333
|
-
}),
|
|
334
|
-
customClass: _propTypes["default"].shape({
|
|
335
|
-
dropBoxClass: _propTypes["default"].string
|
|
327
|
+
TextBoxIconProps: _propTypes["default"].object
|
|
336
328
|
})
|
|
337
329
|
};
|
|
338
330
|
exports.SelectWithIcon_propTypes = SelectWithIcon_propTypes;
|
|
@@ -260,12 +260,6 @@
|
|
|
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
|
-
|
|
269
263
|
.justifyFend {
|
|
270
264
|
-webkit-box-pack: flex-end;
|
|
271
265
|
-ms-flex-pack: flex-end;
|
|
@@ -500,11 +494,6 @@
|
|
|
500
494
|
overflow: hidden;
|
|
501
495
|
}
|
|
502
496
|
|
|
503
|
-
.lineClamp {
|
|
504
|
-
composes: wbreak clamp;
|
|
505
|
-
-webkit-line-clamp: var(--line-clamp,3);
|
|
506
|
-
}
|
|
507
|
-
|
|
508
497
|
.offSelection {
|
|
509
498
|
-webkit-user-select: none;
|
|
510
499
|
-moz-user-select: none;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/components",
|
|
3
|
-
"version": "1.0.0-temp-
|
|
3
|
+
"version": "1.0.0-temp-220.4",
|
|
4
4
|
"main": "es/index.js",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"private": false,
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@zohodesk/a11y": "2.3.4",
|
|
72
72
|
"@zohodesk/docstool": "1.0.0-alpha-2",
|
|
73
73
|
"@zohodesk/hooks": "2.0.5",
|
|
74
|
-
"@zohodesk/icons": "1.0.
|
|
74
|
+
"@zohodesk/icons": "1.0.72",
|
|
75
75
|
"@zohodesk/svg": "1.1.22",
|
|
76
76
|
"@zohodesk/utils": "1.3.14",
|
|
77
77
|
"@zohodesk/variables": "1.0.0",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"selectn": "1.1.2"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
|
-
"@zohodesk/icons": "1.0.
|
|
89
|
+
"@zohodesk/icons": "1.0.72",
|
|
90
90
|
"@zohodesk/variables": "1.0.0",
|
|
91
91
|
"@zohodesk/svg": "1.1.22",
|
|
92
92
|
"@zohodesk/virtualizer": "1.0.3",
|