@zohodesk/components 1.2.41 → 1.2.43
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/README.md +17 -0
- package/es/DateTime/__tests__/__snapshots__/DateTime.spec.js.snap +1 -1
- package/es/DateTime/__tests__/__snapshots__/DateTimePopupHeader.spec.js.snap +1 -1
- package/es/DateTime/__tests__/__snapshots__/YearView.spec.js.snap +1 -1
- package/es/Heading/Heading.js +5 -2
- package/es/Heading/__tests__/Heading.spec.js +9 -0
- package/es/Heading/__tests__/__snapshots__/Heading.spec.js.snap +55 -1
- package/es/Heading/props/propTypes.js +2 -1
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +12 -2
- package/es/MultiSelect/AdvancedMultiSelect.js +9 -1
- package/es/MultiSelect/MultiSelect.js +8 -0
- package/es/MultiSelect/MultiSelectWithAvatar.js +8 -0
- package/es/MultiSelect/props/defaultProps.js +9 -1
- package/es/MultiSelect/props/propTypes.js +8 -0
- package/es/Select/GroupSelect.js +8 -0
- package/es/Select/SelectWithAvatar.js +11 -2
- package/es/Select/SelectWithIcon.js +8 -0
- package/es/Select/props/defaultProps.js +6 -0
- package/es/Select/props/propTypes.js +10 -2
- package/es/Tooltip/Tooltip.js +13 -3
- package/es/Tooltip/Tooltip.module.css +0 -8
- package/es/common/common.module.css +24 -0
- package/es/utils/cssUtils.js +11 -0
- package/es/v1/Heading/Heading.js +5 -2
- package/es/v1/Heading/props/propTypes.js +2 -1
- package/es/v1/MultiSelect/AdvancedGroupMultiSelect.js +8 -2
- package/es/v1/MultiSelect/AdvancedMultiSelect.js +9 -1
- package/es/v1/MultiSelect/MultiSelect.js +8 -0
- package/es/v1/MultiSelect/MultiSelectWithAvatar.js +8 -0
- package/es/v1/MultiSelect/props/defaultProps.js +9 -1
- package/es/v1/MultiSelect/props/propTypes.js +8 -0
- package/es/v1/Select/GroupSelect.js +8 -0
- package/es/v1/Select/SelectWithAvatar.js +11 -2
- package/es/v1/Select/SelectWithIcon.js +8 -0
- package/es/v1/Select/props/defaultProps.js +6 -0
- package/es/v1/Select/props/propTypes.js +9 -1
- package/es/v1/Tooltip/Tooltip.js +13 -3
- package/lib/DateTime/__tests__/__snapshots__/DateTime.spec.js.snap +1 -1
- package/lib/DateTime/__tests__/__snapshots__/DateTimePopupHeader.spec.js.snap +1 -1
- package/lib/DateTime/__tests__/__snapshots__/YearView.spec.js.snap +1 -1
- package/lib/Heading/Heading.js +7 -3
- package/lib/Heading/__tests__/Heading.spec.js +9 -0
- package/lib/Heading/__tests__/__snapshots__/Heading.spec.js.snap +55 -1
- package/lib/Heading/props/propTypes.js +2 -1
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +12 -2
- package/lib/MultiSelect/AdvancedMultiSelect.js +10 -2
- package/lib/MultiSelect/MultiSelect.js +8 -0
- package/lib/MultiSelect/MultiSelectWithAvatar.js +8 -0
- package/lib/MultiSelect/props/defaultProps.js +9 -1
- package/lib/MultiSelect/props/propTypes.js +8 -0
- package/lib/Select/GroupSelect.js +8 -0
- package/lib/Select/SelectWithAvatar.js +11 -2
- package/lib/Select/SelectWithIcon.js +8 -0
- package/lib/Select/props/defaultProps.js +5 -1
- package/lib/Select/props/propTypes.js +10 -2
- package/lib/Tooltip/Tooltip.js +15 -4
- package/lib/Tooltip/Tooltip.module.css +0 -8
- package/lib/common/common.module.css +24 -0
- package/lib/utils/cssUtils.js +22 -0
- package/lib/v1/Heading/Heading.js +7 -3
- package/lib/v1/Heading/props/propTypes.js +2 -1
- package/lib/v1/MultiSelect/AdvancedGroupMultiSelect.js +8 -2
- package/lib/v1/MultiSelect/AdvancedMultiSelect.js +10 -2
- package/lib/v1/MultiSelect/MultiSelect.js +8 -0
- package/lib/v1/MultiSelect/MultiSelectWithAvatar.js +8 -0
- package/lib/v1/MultiSelect/props/defaultProps.js +9 -1
- package/lib/v1/MultiSelect/props/propTypes.js +8 -0
- package/lib/v1/Select/GroupSelect.js +8 -0
- package/lib/v1/Select/SelectWithAvatar.js +11 -2
- package/lib/v1/Select/SelectWithIcon.js +8 -0
- package/lib/v1/Select/props/defaultProps.js +5 -1
- package/lib/v1/Select/props/propTypes.js +9 -1
- package/lib/v1/Tooltip/Tooltip.js +15 -4
- package/package.json +6 -6
- package/result.json +1 -1
|
@@ -368,7 +368,11 @@ export class AdvancedMultiSelectComponent extends MultiSelectComponent {
|
|
|
368
368
|
disabledOptions,
|
|
369
369
|
isLoading,
|
|
370
370
|
dataSelectorId,
|
|
371
|
-
customClass
|
|
371
|
+
customClass,
|
|
372
|
+
isAbsolutePositioningNeeded,
|
|
373
|
+
positionsOffset,
|
|
374
|
+
targetOffset,
|
|
375
|
+
isRestrictScroll
|
|
372
376
|
} = this.props;
|
|
373
377
|
let {
|
|
374
378
|
SuggestionsProps = {},
|
|
@@ -508,6 +512,10 @@ export class AdvancedMultiSelectComponent extends MultiSelectComponent {
|
|
|
508
512
|
ariaMultiselectable: true
|
|
509
513
|
},
|
|
510
514
|
dataId: `${dataIdMultiSelectComp}_dropbox`,
|
|
515
|
+
isAbsolutePositioningNeeded: isAbsolutePositioningNeeded,
|
|
516
|
+
positionsOffset: positionsOffset,
|
|
517
|
+
targetOffset: targetOffset,
|
|
518
|
+
isRestrictScroll: isRestrictScroll,
|
|
511
519
|
...DropBoxProps,
|
|
512
520
|
alignBox: "row",
|
|
513
521
|
isResponsivePadding: getFooter ? false : true
|
|
@@ -985,6 +985,10 @@ export class MultiSelectComponent extends React.Component {
|
|
|
985
985
|
borderColor,
|
|
986
986
|
disableAction,
|
|
987
987
|
isBoxPaddingNeed,
|
|
988
|
+
isAbsolutePositioningNeeded,
|
|
989
|
+
positionsOffset,
|
|
990
|
+
targetOffset,
|
|
991
|
+
isRestrictScroll,
|
|
988
992
|
palette,
|
|
989
993
|
i18nKeys,
|
|
990
994
|
getFooter,
|
|
@@ -1032,6 +1036,10 @@ export class MultiSelectComponent extends React.Component {
|
|
|
1032
1036
|
needResponsive: needResponsive,
|
|
1033
1037
|
isPadding: false,
|
|
1034
1038
|
isBoxPaddingNeed: isBoxPaddingNeed,
|
|
1039
|
+
isAbsolutePositioningNeeded: isAbsolutePositioningNeeded,
|
|
1040
|
+
positionsOffset: positionsOffset,
|
|
1041
|
+
targetOffset: targetOffset,
|
|
1042
|
+
isRestrictScroll: isRestrictScroll,
|
|
1035
1043
|
palette: palette,
|
|
1036
1044
|
htmlId: setAriaId,
|
|
1037
1045
|
a11y: {
|
|
@@ -71,6 +71,10 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
71
71
|
selectAllText,
|
|
72
72
|
getContainerRef,
|
|
73
73
|
removeClose,
|
|
74
|
+
isAbsolutePositioningNeeded,
|
|
75
|
+
positionsOffset,
|
|
76
|
+
targetOffset,
|
|
77
|
+
isRestrictScroll,
|
|
74
78
|
isAnimate,
|
|
75
79
|
animationStyle,
|
|
76
80
|
isDisabled,
|
|
@@ -127,6 +131,10 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
127
131
|
needResponsive: needResponsive,
|
|
128
132
|
isPadding: false,
|
|
129
133
|
isBoxPaddingNeed: isBoxPaddingNeed,
|
|
134
|
+
isAbsolutePositioningNeeded: isAbsolutePositioningNeeded,
|
|
135
|
+
positionsOffset: positionsOffset,
|
|
136
|
+
targetOffset: targetOffset,
|
|
137
|
+
isRestrictScroll: isRestrictScroll,
|
|
130
138
|
palette: palette,
|
|
131
139
|
htmlId: setAriaId,
|
|
132
140
|
a11y: {
|
|
@@ -32,6 +32,8 @@ export const AdvancedGroupMultiSelect_defaultProps = {
|
|
|
32
32
|
i18nKeys: {},
|
|
33
33
|
a11y: {},
|
|
34
34
|
isSearchClearOnSelect: true,
|
|
35
|
+
isAbsolutePositioningNeeded: true,
|
|
36
|
+
isRestrictScroll: false,
|
|
35
37
|
needEffect: true,
|
|
36
38
|
palette: 'default',
|
|
37
39
|
isLoading: false,
|
|
@@ -67,7 +69,9 @@ export const AdvancedMultiSelect_defaultProps = {
|
|
|
67
69
|
needEffect: true,
|
|
68
70
|
isLoading: false,
|
|
69
71
|
dataSelectorId: 'advancedMultiSelect',
|
|
70
|
-
customClass: {}
|
|
72
|
+
customClass: {},
|
|
73
|
+
isAbsolutePositioningNeeded: true,
|
|
74
|
+
isRestrictScroll: false
|
|
71
75
|
};
|
|
72
76
|
export const EmptyState_defaultProps = {
|
|
73
77
|
dataId: 'empty',
|
|
@@ -104,6 +108,8 @@ export const MultiSelect_defaultProps = {
|
|
|
104
108
|
textBoxClass: '',
|
|
105
109
|
palette: 'default',
|
|
106
110
|
isSearchClearOnSelect: true,
|
|
111
|
+
isAbsolutePositioningNeeded: true,
|
|
112
|
+
isRestrictScroll: false,
|
|
107
113
|
needEffect: true,
|
|
108
114
|
boxSize: 'default',
|
|
109
115
|
isLoading: false,
|
|
@@ -141,6 +147,8 @@ export const MultiSelectWithAvatar_defaultProps = {
|
|
|
141
147
|
palette: 'default',
|
|
142
148
|
isBoxPaddingNeed: true,
|
|
143
149
|
isSearchClearOnSelect: true,
|
|
150
|
+
isAbsolutePositioningNeeded: true,
|
|
151
|
+
isRestrictScroll: false,
|
|
144
152
|
needEffect: true,
|
|
145
153
|
isLoading: false,
|
|
146
154
|
dataSelectorId: 'multiSelectWithAvatar',
|
|
@@ -98,6 +98,10 @@ export const MultiSelect_propTypes = {
|
|
|
98
98
|
getFooter: PropTypes.func,
|
|
99
99
|
needEffect: PropTypes.bool,
|
|
100
100
|
boxSize: PropTypes.string,
|
|
101
|
+
isAbsolutePositioningNeeded: PropTypes.bool,
|
|
102
|
+
isRestrictScroll: PropTypes.bool,
|
|
103
|
+
positionsOffset: PropTypes.object,
|
|
104
|
+
targetOffset: PropTypes.object,
|
|
101
105
|
isLoading: PropTypes.bool,
|
|
102
106
|
dataSelectorId: PropTypes.string,
|
|
103
107
|
keepSelectedOptions: PropTypes.bool,
|
|
@@ -227,6 +231,10 @@ export const AdvancedGroupMultiSelect_propTypes = {
|
|
|
227
231
|
textField: PropTypes.string,
|
|
228
232
|
getTargetRef: PropTypes.func,
|
|
229
233
|
togglePopup: PropTypes.func,
|
|
234
|
+
isAbsolutePositioningNeeded: PropTypes.bool,
|
|
235
|
+
isRestrictScroll: PropTypes.bool,
|
|
236
|
+
positionsOffset: PropTypes.object,
|
|
237
|
+
targetOffset: PropTypes.object,
|
|
230
238
|
needLocalSearch: PropTypes.bool,
|
|
231
239
|
isNextOptions: PropTypes.bool,
|
|
232
240
|
getNextOptions: PropTypes.func,
|
|
@@ -578,6 +578,10 @@ export class GroupSelectComponent extends PureComponent {
|
|
|
578
578
|
getContainerRef,
|
|
579
579
|
isPopupReady,
|
|
580
580
|
removeClose,
|
|
581
|
+
isAbsolutePositioningNeeded,
|
|
582
|
+
positionsOffset,
|
|
583
|
+
targetOffset,
|
|
584
|
+
isRestrictScroll,
|
|
581
585
|
borderColor,
|
|
582
586
|
needTick,
|
|
583
587
|
children,
|
|
@@ -707,6 +711,10 @@ export class GroupSelectComponent extends PureComponent {
|
|
|
707
711
|
onClick: removeClose,
|
|
708
712
|
needResponsive: needResponsive,
|
|
709
713
|
isPadding: false,
|
|
714
|
+
isAbsolutePositioningNeeded: isAbsolutePositioningNeeded,
|
|
715
|
+
positionsOffset: positionsOffset,
|
|
716
|
+
targetOffset: targetOffset,
|
|
717
|
+
isRestrictScroll: isRestrictScroll,
|
|
710
718
|
isResponsivePadding: getFooter ? false : true,
|
|
711
719
|
alignBox: "row",
|
|
712
720
|
dataId: `${dataId}_suggestionBox`
|
|
@@ -133,6 +133,10 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
133
133
|
isPopupOpen,
|
|
134
134
|
removeClose,
|
|
135
135
|
isPopupReady,
|
|
136
|
+
isAbsolutePositioningNeeded,
|
|
137
|
+
positionsOffset,
|
|
138
|
+
targetOffset,
|
|
139
|
+
isRestrictScroll,
|
|
136
140
|
animationStyle,
|
|
137
141
|
textBoxSize,
|
|
138
142
|
textBoxVariant,
|
|
@@ -158,7 +162,8 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
158
162
|
htmlId,
|
|
159
163
|
needEffect,
|
|
160
164
|
isLoading,
|
|
161
|
-
dataSelectorId
|
|
165
|
+
dataSelectorId,
|
|
166
|
+
getTargetRef
|
|
162
167
|
} = this.props;
|
|
163
168
|
i18nKeys = Object.assign({}, i18nKeys, {
|
|
164
169
|
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
@@ -190,7 +195,7 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
190
195
|
align: "vertical",
|
|
191
196
|
alignBox: "row",
|
|
192
197
|
className: `${style.container} ${style[size]} ${style[`borderColor_${borderColor}`]} ${isActive && needBorder ? style.active : ''} ${textBoxClass ? textBoxClass : ''} ${needBorder ? style.hasBorder : ''}`,
|
|
193
|
-
eleRef:
|
|
198
|
+
eleRef: getTargetRef,
|
|
194
199
|
onClick: !isDisabled && this.togglePopup
|
|
195
200
|
}, selectedId ? /*#__PURE__*/React.createElement(Box, {
|
|
196
201
|
className: style.tag,
|
|
@@ -256,6 +261,10 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
256
261
|
isArrow: false,
|
|
257
262
|
onClick: removeClose,
|
|
258
263
|
needResponsive: needResponsive,
|
|
264
|
+
isAbsolutePositioningNeeded: isAbsolutePositioningNeeded,
|
|
265
|
+
positionsOffset: positionsOffset,
|
|
266
|
+
targetOffset: targetOffset,
|
|
267
|
+
isRestrictScroll: isRestrictScroll,
|
|
259
268
|
isPadding: false,
|
|
260
269
|
isResponsivePadding: true,
|
|
261
270
|
alignBox: "row",
|
|
@@ -325,6 +325,10 @@ class SelectWithIcon extends Component {
|
|
|
325
325
|
isPopupReady,
|
|
326
326
|
position,
|
|
327
327
|
getContainerRef,
|
|
328
|
+
isAbsolutePositioningNeeded,
|
|
329
|
+
positionsOffset,
|
|
330
|
+
targetOffset,
|
|
331
|
+
isRestrictScroll,
|
|
328
332
|
valueKey,
|
|
329
333
|
idKey,
|
|
330
334
|
needListBorder,
|
|
@@ -438,6 +442,10 @@ class SelectWithIcon extends Component {
|
|
|
438
442
|
onClick: removeClose,
|
|
439
443
|
getRef: getContainerRef,
|
|
440
444
|
needResponsive: needResponsive,
|
|
445
|
+
isAbsolutePositioningNeeded: isAbsolutePositioningNeeded,
|
|
446
|
+
positionsOffset: positionsOffset,
|
|
447
|
+
targetOffset: targetOffset,
|
|
448
|
+
isRestrictScroll: isRestrictScroll,
|
|
441
449
|
dataId: `${dataId}_suggestions`,
|
|
442
450
|
size: boxSize,
|
|
443
451
|
isPadding: false,
|
|
@@ -65,6 +65,8 @@ export const GroupSelect_defaultProps = {
|
|
|
65
65
|
needTick: true,
|
|
66
66
|
needLocalSearch: true,
|
|
67
67
|
isSearchClearOnClose: true,
|
|
68
|
+
isAbsolutePositioningNeeded: true,
|
|
69
|
+
isRestrictScroll: false,
|
|
68
70
|
i18nKeys: {},
|
|
69
71
|
iconOnHover: false,
|
|
70
72
|
isLoading: false
|
|
@@ -89,6 +91,8 @@ export const SelectWithAvatar_defaultProps = {
|
|
|
89
91
|
dataSelectorId: 'selectWithAvatar',
|
|
90
92
|
borderColor: 'default',
|
|
91
93
|
isSearchClearOnClose: true,
|
|
94
|
+
isAbsolutePositioningNeeded: true,
|
|
95
|
+
isRestrictScroll: false,
|
|
92
96
|
i18nKeys: {},
|
|
93
97
|
needEffect: true,
|
|
94
98
|
isLoading: false
|
|
@@ -116,5 +120,7 @@ export const SelectWithIcon_defaultProps = {
|
|
|
116
120
|
needIcon: true,
|
|
117
121
|
iconSize: '14',
|
|
118
122
|
i18nKeys: {},
|
|
123
|
+
isAbsolutePositioningNeeded: true,
|
|
124
|
+
isRestrictScroll: false,
|
|
119
125
|
isLoading: false
|
|
120
126
|
};
|
|
@@ -162,6 +162,10 @@ export const GroupSelect_propTypes = {
|
|
|
162
162
|
closePopupOnly: PropTypes.func,
|
|
163
163
|
position: PropTypes.string,
|
|
164
164
|
removeClose: PropTypes.func,
|
|
165
|
+
isAbsolutePositioningNeeded: PropTypes.bool,
|
|
166
|
+
isRestrictScroll: PropTypes.bool,
|
|
167
|
+
positionsOffset: PropTypes.object,
|
|
168
|
+
targetOffset: PropTypes.object,
|
|
165
169
|
i18nKeys: PropTypes.shape({
|
|
166
170
|
loadingText: PropTypes.string,
|
|
167
171
|
emptyText: PropTypes.string,
|
|
@@ -285,5 +289,9 @@ export const SelectWithIcon_propTypes = {
|
|
|
285
289
|
searchBoxSize: PropTypes.string,
|
|
286
290
|
needResponsive: PropTypes.bool,
|
|
287
291
|
boxSize: PropTypes.string,
|
|
288
|
-
emptyMessage: PropTypes.string
|
|
292
|
+
emptyMessage: PropTypes.string,
|
|
293
|
+
isAbsolutePositioningNeeded: PropTypes.bool,
|
|
294
|
+
isRestrictScroll: PropTypes.bool,
|
|
295
|
+
positionsOffset: PropTypes.object,
|
|
296
|
+
targetOffset: PropTypes.object
|
|
289
297
|
};
|
package/es/v1/Tooltip/Tooltip.js
CHANGED
|
@@ -2,9 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import { defaultProps } from './props/defaultProps';
|
|
3
3
|
import { propTypes } from './props/propTypes';
|
|
4
4
|
import { getLibraryConfig } from '../../Provider/Config';
|
|
5
|
-
import style from '../../Tooltip/Tooltip.module.css';
|
|
6
5
|
import ResizeObserver from '../../Responsive/ResizeObserver';
|
|
7
6
|
import selectn from 'selectn';
|
|
7
|
+
import { whiteSpaceClassMapping } from '../../utils/cssUtils';
|
|
8
|
+
import style from '../../Tooltip/Tooltip.module.css';
|
|
8
9
|
export default class Tooltip extends React.Component {
|
|
9
10
|
constructor(props) {
|
|
10
11
|
super(props);
|
|
@@ -192,7 +193,8 @@ export default class Tooltip extends React.Component {
|
|
|
192
193
|
|
|
193
194
|
let isHtml = titleDiv.getAttribute('data-ishtml');
|
|
194
195
|
let dataTooltipnoArrow = titleDiv.getAttribute('data-tooltip-noarrow') === 'true' ? true : false;
|
|
195
|
-
let dataTooltipWrap = titleDiv.getAttribute('data-title-wrap')
|
|
196
|
+
let dataTooltipWrap = titleDiv.getAttribute('data-title-wrap') || 'normal'; // values: normal, pre, pre-wrap, pre-line, nowrap, break-spaces
|
|
197
|
+
|
|
196
198
|
let clientRect = titleDiv.getBoundingClientRect();
|
|
197
199
|
let boxLayout = this.getClientRectOfContEl(containerElement);
|
|
198
200
|
this.setState({
|
|
@@ -481,7 +483,15 @@ export default class Tooltip extends React.Component {
|
|
|
481
483
|
} = this.props;
|
|
482
484
|
let arrowStyle = isArrowHorizontal ? isArrowRight ? style.arrowRight : style.arrowLeft : isArrowDown ? style.arrowDown : style.arrowUp;
|
|
483
485
|
title = title ? title.trim() : null;
|
|
484
|
-
let
|
|
486
|
+
let tooltipWhiteSpaceModification = dataTooltipWrap;
|
|
487
|
+
|
|
488
|
+
if (dataTooltipWrap == 'pre') {
|
|
489
|
+
tooltipWhiteSpaceModification = 'pre-wrap';
|
|
490
|
+
} else if (dataTooltipWrap == 'nowrap') {
|
|
491
|
+
tooltipWhiteSpaceModification = 'normal';
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
let tooltipCss = `${style.tooltipcont} ${whiteSpaceClassMapping[tooltipWhiteSpaceModification]}`;
|
|
485
495
|
return title ? /*#__PURE__*/React.createElement("div", {
|
|
486
496
|
className: `${customClass} ${style.tooltiptext}`,
|
|
487
497
|
style: {
|
package/lib/Heading/Heading.js
CHANGED
|
@@ -13,6 +13,8 @@ var _defaultProps = require("./props/defaultProps");
|
|
|
13
13
|
|
|
14
14
|
var _propTypes = require("./props/propTypes");
|
|
15
15
|
|
|
16
|
+
var _cssUtils = require("../utils/cssUtils");
|
|
17
|
+
|
|
16
18
|
var _HeadingModule = _interopRequireDefault(require("./Heading.module.css"));
|
|
17
19
|
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -65,14 +67,16 @@ var Heading = /*#__PURE__*/function (_React$Component) {
|
|
|
65
67
|
title = _this$props.title,
|
|
66
68
|
dataTitle = _this$props.dataTitle,
|
|
67
69
|
dataId = _this$props.dataId,
|
|
68
|
-
a11y = _this$props.a11y
|
|
70
|
+
a11y = _this$props.a11y,
|
|
71
|
+
whiteSpace = _this$props.whiteSpace;
|
|
69
72
|
return /*#__PURE__*/_react["default"].createElement(tagName, _objectSpread({
|
|
70
|
-
className: "".concat(_HeadingModule["default"].reset, " ").concat(className),
|
|
73
|
+
className: "".concat(_HeadingModule["default"].reset, " ").concat(whiteSpace ? _cssUtils.whiteSpaceClassMapping[whiteSpace] : '', " ").concat(className),
|
|
71
74
|
onClick: onClick,
|
|
72
75
|
onDoubleClick: onDoubleClick,
|
|
73
76
|
'data-title': dataTitle || title,
|
|
74
77
|
'data-id': dataId,
|
|
75
|
-
'data-test-id': dataId
|
|
78
|
+
'data-test-id': dataId,
|
|
79
|
+
'data-title-wrap': whiteSpace
|
|
76
80
|
}, a11y), title);
|
|
77
81
|
}
|
|
78
82
|
}]);
|
|
@@ -15,4 +15,13 @@ describe('Heading', function () {
|
|
|
15
15
|
|
|
16
16
|
expect(asFragment()).toMatchSnapshot();
|
|
17
17
|
});
|
|
18
|
+
var whiteSpace = ['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'break-spaces'];
|
|
19
|
+
test.each(whiteSpace)('Should render whiteSpace of Heading - %s', function (whiteSpace) {
|
|
20
|
+
var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Heading["default"], {
|
|
21
|
+
whiteSpace: whiteSpace
|
|
22
|
+
})),
|
|
23
|
+
asFragment = _render2.asFragment;
|
|
24
|
+
|
|
25
|
+
expect(asFragment()).toMatchSnapshot();
|
|
26
|
+
});
|
|
18
27
|
});
|
|
@@ -1,9 +1,63 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
+
exports[`Heading Should render whiteSpace of Heading - break-spaces 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<h1
|
|
6
|
+
class="reset whiteSpace_breakSpaces "
|
|
7
|
+
data-title-wrap="break-spaces"
|
|
8
|
+
/>
|
|
9
|
+
</DocumentFragment>
|
|
10
|
+
`;
|
|
11
|
+
|
|
12
|
+
exports[`Heading Should render whiteSpace of Heading - normal 1`] = `
|
|
13
|
+
<DocumentFragment>
|
|
14
|
+
<h1
|
|
15
|
+
class="reset whiteSpace_normal "
|
|
16
|
+
data-title-wrap="normal"
|
|
17
|
+
/>
|
|
18
|
+
</DocumentFragment>
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
exports[`Heading Should render whiteSpace of Heading - nowrap 1`] = `
|
|
22
|
+
<DocumentFragment>
|
|
23
|
+
<h1
|
|
24
|
+
class="reset whiteSpace_nowrap "
|
|
25
|
+
data-title-wrap="nowrap"
|
|
26
|
+
/>
|
|
27
|
+
</DocumentFragment>
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
exports[`Heading Should render whiteSpace of Heading - pre 1`] = `
|
|
31
|
+
<DocumentFragment>
|
|
32
|
+
<h1
|
|
33
|
+
class="reset whiteSpace_pre "
|
|
34
|
+
data-title-wrap="pre"
|
|
35
|
+
/>
|
|
36
|
+
</DocumentFragment>
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
exports[`Heading Should render whiteSpace of Heading - pre-line 1`] = `
|
|
40
|
+
<DocumentFragment>
|
|
41
|
+
<h1
|
|
42
|
+
class="reset whiteSpace_preLine "
|
|
43
|
+
data-title-wrap="pre-line"
|
|
44
|
+
/>
|
|
45
|
+
</DocumentFragment>
|
|
46
|
+
`;
|
|
47
|
+
|
|
48
|
+
exports[`Heading Should render whiteSpace of Heading - pre-wrap 1`] = `
|
|
49
|
+
<DocumentFragment>
|
|
50
|
+
<h1
|
|
51
|
+
class="reset whiteSpace_preWrap "
|
|
52
|
+
data-title-wrap="pre-wrap"
|
|
53
|
+
/>
|
|
54
|
+
</DocumentFragment>
|
|
55
|
+
`;
|
|
56
|
+
|
|
3
57
|
exports[`Heading rendering the defult props 1`] = `
|
|
4
58
|
<DocumentFragment>
|
|
5
59
|
<h1
|
|
6
|
-
class="reset
|
|
60
|
+
class="reset "
|
|
7
61
|
/>
|
|
8
62
|
</DocumentFragment>
|
|
9
63
|
`;
|
|
@@ -17,6 +17,7 @@ var propTypes = {
|
|
|
17
17
|
dataTitle: _propTypes["default"].string,
|
|
18
18
|
onClick: _propTypes["default"].func,
|
|
19
19
|
onDoubleClick: _propTypes["default"].func,
|
|
20
|
-
a11y: _propTypes["default"].object
|
|
20
|
+
a11y: _propTypes["default"].object,
|
|
21
|
+
whiteSpace: _propTypes["default"].oneOf(['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'break-spaces'])
|
|
21
22
|
};
|
|
22
23
|
exports.propTypes = propTypes;
|
|
@@ -942,6 +942,10 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
942
942
|
dropBoxSize = _this$props8.dropBoxSize,
|
|
943
943
|
position = _this$props8.position,
|
|
944
944
|
getContainerRef = _this$props8.getContainerRef,
|
|
945
|
+
isAbsolutePositioningNeeded = _this$props8.isAbsolutePositioningNeeded,
|
|
946
|
+
positionsOffset = _this$props8.positionsOffset,
|
|
947
|
+
targetOffset = _this$props8.targetOffset,
|
|
948
|
+
isRestrictScroll = _this$props8.isRestrictScroll,
|
|
945
949
|
emptyMessage = _this$props8.emptyMessage,
|
|
946
950
|
searchEmptyMessage = _this$props8.searchEmptyMessage,
|
|
947
951
|
title = _this$props8.title,
|
|
@@ -960,7 +964,8 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
960
964
|
a11y = _this$props8.a11y,
|
|
961
965
|
palette = _this$props8.palette,
|
|
962
966
|
needEffect = _this$props8.needEffect,
|
|
963
|
-
autoComplete = _this$props8.autoComplete
|
|
967
|
+
autoComplete = _this$props8.autoComplete,
|
|
968
|
+
getTargetRef = _this$props8.getTargetRef;
|
|
964
969
|
var _i18nKeys = i18nKeys,
|
|
965
970
|
_i18nKeys$clearText = _i18nKeys.clearText,
|
|
966
971
|
clearText = _i18nKeys$clearText === void 0 ? 'Clear all' : _i18nKeys$clearText;
|
|
@@ -999,7 +1004,8 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
999
1004
|
align: "vertical",
|
|
1000
1005
|
alignBox: "row",
|
|
1001
1006
|
onClick: this.togglePopup,
|
|
1002
|
-
className: customClass
|
|
1007
|
+
className: customClass,
|
|
1008
|
+
eleRef: getTargetRef
|
|
1003
1009
|
}, children) : /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
1004
1010
|
align: "vertical",
|
|
1005
1011
|
alignBox: "row",
|
|
@@ -1080,6 +1086,10 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
1080
1086
|
needResponsive: needResponsive,
|
|
1081
1087
|
isPadding: isPadding,
|
|
1082
1088
|
isBoxPaddingNeed: !needSelectAll,
|
|
1089
|
+
isAbsolutePositioningNeeded: isAbsolutePositioningNeeded,
|
|
1090
|
+
positionsOffset: positionsOffset,
|
|
1091
|
+
targetOffset: targetOffset,
|
|
1092
|
+
isRestrictScroll: isRestrictScroll,
|
|
1083
1093
|
htmlId: setAriaId,
|
|
1084
1094
|
a11y: {
|
|
1085
1095
|
role: 'listbox',
|
|
@@ -436,7 +436,11 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
436
436
|
disabledOptions = _this$props5.disabledOptions,
|
|
437
437
|
isLoading = _this$props5.isLoading,
|
|
438
438
|
dataSelectorId = _this$props5.dataSelectorId,
|
|
439
|
-
customClass = _this$props5.customClass
|
|
439
|
+
customClass = _this$props5.customClass,
|
|
440
|
+
isAbsolutePositioningNeeded = _this$props5.isAbsolutePositioningNeeded,
|
|
441
|
+
positionsOffset = _this$props5.positionsOffset,
|
|
442
|
+
targetOffset = _this$props5.targetOffset,
|
|
443
|
+
isRestrictScroll = _this$props5.isRestrictScroll;
|
|
440
444
|
var _customProps$Suggesti = customProps.SuggestionsProps,
|
|
441
445
|
SuggestionsProps = _customProps$Suggesti === void 0 ? {} : _customProps$Suggesti,
|
|
442
446
|
_customProps$DropBoxP = customProps.DropBoxProps,
|
|
@@ -569,7 +573,11 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
569
573
|
role: 'listbox',
|
|
570
574
|
ariaMultiselectable: true
|
|
571
575
|
},
|
|
572
|
-
dataId: "".concat(dataIdMultiSelectComp, "_dropbox")
|
|
576
|
+
dataId: "".concat(dataIdMultiSelectComp, "_dropbox"),
|
|
577
|
+
isAbsolutePositioningNeeded: isAbsolutePositioningNeeded,
|
|
578
|
+
positionsOffset: positionsOffset,
|
|
579
|
+
targetOffset: targetOffset,
|
|
580
|
+
isRestrictScroll: isRestrictScroll
|
|
573
581
|
}, DropBoxProps, {
|
|
574
582
|
alignBox: "row",
|
|
575
583
|
isResponsivePadding: getFooter ? false : true
|
|
@@ -1070,6 +1070,10 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1070
1070
|
borderColor = _this$props15.borderColor,
|
|
1071
1071
|
disableAction = _this$props15.disableAction,
|
|
1072
1072
|
isBoxPaddingNeed = _this$props15.isBoxPaddingNeed,
|
|
1073
|
+
isAbsolutePositioningNeeded = _this$props15.isAbsolutePositioningNeeded,
|
|
1074
|
+
positionsOffset = _this$props15.positionsOffset,
|
|
1075
|
+
targetOffset = _this$props15.targetOffset,
|
|
1076
|
+
isRestrictScroll = _this$props15.isRestrictScroll,
|
|
1073
1077
|
palette = _this$props15.palette,
|
|
1074
1078
|
i18nKeys = _this$props15.i18nKeys,
|
|
1075
1079
|
getFooter = _this$props15.getFooter,
|
|
@@ -1115,6 +1119,10 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1115
1119
|
needResponsive: needResponsive,
|
|
1116
1120
|
isPadding: false,
|
|
1117
1121
|
isBoxPaddingNeed: isBoxPaddingNeed,
|
|
1122
|
+
isAbsolutePositioningNeeded: isAbsolutePositioningNeeded,
|
|
1123
|
+
positionsOffset: positionsOffset,
|
|
1124
|
+
targetOffset: targetOffset,
|
|
1125
|
+
isRestrictScroll: isRestrictScroll,
|
|
1118
1126
|
palette: palette,
|
|
1119
1127
|
htmlId: setAriaId,
|
|
1120
1128
|
a11y: {
|
|
@@ -126,6 +126,10 @@ var MultiSelectWithAvatarComponent = /*#__PURE__*/function (_MultiSelectComponen
|
|
|
126
126
|
selectAllText = _this$props.selectAllText,
|
|
127
127
|
getContainerRef = _this$props.getContainerRef,
|
|
128
128
|
removeClose = _this$props.removeClose,
|
|
129
|
+
isAbsolutePositioningNeeded = _this$props.isAbsolutePositioningNeeded,
|
|
130
|
+
positionsOffset = _this$props.positionsOffset,
|
|
131
|
+
targetOffset = _this$props.targetOffset,
|
|
132
|
+
isRestrictScroll = _this$props.isRestrictScroll,
|
|
129
133
|
isAnimate = _this$props.isAnimate,
|
|
130
134
|
animationStyle = _this$props.animationStyle,
|
|
131
135
|
isDisabled = _this$props.isDisabled,
|
|
@@ -179,6 +183,10 @@ var MultiSelectWithAvatarComponent = /*#__PURE__*/function (_MultiSelectComponen
|
|
|
179
183
|
needResponsive: needResponsive,
|
|
180
184
|
isPadding: false,
|
|
181
185
|
isBoxPaddingNeed: isBoxPaddingNeed,
|
|
186
|
+
isAbsolutePositioningNeeded: isAbsolutePositioningNeeded,
|
|
187
|
+
positionsOffset: positionsOffset,
|
|
188
|
+
targetOffset: targetOffset,
|
|
189
|
+
isRestrictScroll: isRestrictScroll,
|
|
182
190
|
palette: palette,
|
|
183
191
|
htmlId: setAriaId,
|
|
184
192
|
a11y: {
|
|
@@ -40,6 +40,8 @@ var AdvancedGroupMultiSelect_defaultProps = {
|
|
|
40
40
|
i18nKeys: {},
|
|
41
41
|
a11y: {},
|
|
42
42
|
isSearchClearOnSelect: true,
|
|
43
|
+
isAbsolutePositioningNeeded: true,
|
|
44
|
+
isRestrictScroll: false,
|
|
43
45
|
needEffect: true,
|
|
44
46
|
palette: 'default',
|
|
45
47
|
isLoading: false,
|
|
@@ -76,7 +78,9 @@ var AdvancedMultiSelect_defaultProps = {
|
|
|
76
78
|
needEffect: true,
|
|
77
79
|
isLoading: false,
|
|
78
80
|
dataSelectorId: 'advancedMultiSelect',
|
|
79
|
-
customClass: {}
|
|
81
|
+
customClass: {},
|
|
82
|
+
isAbsolutePositioningNeeded: true,
|
|
83
|
+
isRestrictScroll: false
|
|
80
84
|
};
|
|
81
85
|
exports.AdvancedMultiSelect_defaultProps = AdvancedMultiSelect_defaultProps;
|
|
82
86
|
var EmptyState_defaultProps = {
|
|
@@ -115,6 +119,8 @@ var MultiSelect_defaultProps = {
|
|
|
115
119
|
textBoxClass: '',
|
|
116
120
|
palette: 'default',
|
|
117
121
|
isSearchClearOnSelect: true,
|
|
122
|
+
isAbsolutePositioningNeeded: true,
|
|
123
|
+
isRestrictScroll: false,
|
|
118
124
|
needEffect: true,
|
|
119
125
|
boxSize: 'default',
|
|
120
126
|
isLoading: false,
|
|
@@ -155,6 +161,8 @@ var MultiSelectWithAvatar_defaultProps = {
|
|
|
155
161
|
palette: 'default',
|
|
156
162
|
isBoxPaddingNeed: true,
|
|
157
163
|
isSearchClearOnSelect: true,
|
|
164
|
+
isAbsolutePositioningNeeded: true,
|
|
165
|
+
isRestrictScroll: false,
|
|
158
166
|
needEffect: true,
|
|
159
167
|
isLoading: false,
|
|
160
168
|
dataSelectorId: 'multiSelectWithAvatar',
|
|
@@ -115,6 +115,10 @@ var MultiSelect_propTypes = {
|
|
|
115
115
|
getFooter: _propTypes["default"].func,
|
|
116
116
|
needEffect: _propTypes["default"].bool,
|
|
117
117
|
boxSize: _propTypes["default"].string,
|
|
118
|
+
isAbsolutePositioningNeeded: _propTypes["default"].bool,
|
|
119
|
+
isRestrictScroll: _propTypes["default"].bool,
|
|
120
|
+
positionsOffset: _propTypes["default"].object,
|
|
121
|
+
targetOffset: _propTypes["default"].object,
|
|
118
122
|
isLoading: _propTypes["default"].bool,
|
|
119
123
|
dataSelectorId: _propTypes["default"].string,
|
|
120
124
|
keepSelectedOptions: _propTypes["default"].bool,
|
|
@@ -254,6 +258,10 @@ var AdvancedGroupMultiSelect_propTypes = _defineProperty({
|
|
|
254
258
|
textField: _propTypes["default"].string,
|
|
255
259
|
getTargetRef: _propTypes["default"].func,
|
|
256
260
|
togglePopup: _propTypes["default"].func,
|
|
261
|
+
isAbsolutePositioningNeeded: _propTypes["default"].bool,
|
|
262
|
+
isRestrictScroll: _propTypes["default"].bool,
|
|
263
|
+
positionsOffset: _propTypes["default"].object,
|
|
264
|
+
targetOffset: _propTypes["default"].object,
|
|
257
265
|
needLocalSearch: _propTypes["default"].bool,
|
|
258
266
|
isNextOptions: _propTypes["default"].bool,
|
|
259
267
|
getNextOptions: _propTypes["default"].func,
|
|
@@ -652,6 +652,10 @@ var GroupSelectComponent = /*#__PURE__*/function (_PureComponent) {
|
|
|
652
652
|
getContainerRef = _this$props9.getContainerRef,
|
|
653
653
|
isPopupReady = _this$props9.isPopupReady,
|
|
654
654
|
removeClose = _this$props9.removeClose,
|
|
655
|
+
isAbsolutePositioningNeeded = _this$props9.isAbsolutePositioningNeeded,
|
|
656
|
+
positionsOffset = _this$props9.positionsOffset,
|
|
657
|
+
targetOffset = _this$props9.targetOffset,
|
|
658
|
+
isRestrictScroll = _this$props9.isRestrictScroll,
|
|
655
659
|
borderColor = _this$props9.borderColor,
|
|
656
660
|
needTick = _this$props9.needTick,
|
|
657
661
|
children = _this$props9.children,
|
|
@@ -777,6 +781,10 @@ var GroupSelectComponent = /*#__PURE__*/function (_PureComponent) {
|
|
|
777
781
|
onClick: removeClose,
|
|
778
782
|
needResponsive: needResponsive,
|
|
779
783
|
isPadding: false,
|
|
784
|
+
isAbsolutePositioningNeeded: isAbsolutePositioningNeeded,
|
|
785
|
+
positionsOffset: positionsOffset,
|
|
786
|
+
targetOffset: targetOffset,
|
|
787
|
+
isRestrictScroll: isRestrictScroll,
|
|
780
788
|
isResponsivePadding: getFooter ? false : true,
|
|
781
789
|
alignBox: "row",
|
|
782
790
|
dataId: "".concat(dataId, "_suggestionBox")
|