@zohodesk/components 1.6.13 → 1.6.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/es/Avatar/Avatar.js +1 -2
- package/es/Button/css/cssJSLogic.js +4 -5
- package/es/DateTime/DateTime.js +3 -6
- package/es/DateTime/DateWidget.js +2 -5
- package/es/DateTime/YearView.js +5 -6
- package/es/DateTime/common.js +2 -9
- package/es/DateTime/dateFormatUtils/dateFormat.js +55 -76
- package/es/DateTime/dateFormatUtils/index.js +7 -12
- package/es/DateTime/dateFormatUtils/timeChange.js +3 -4
- package/es/DateTime/dateFormatUtils/yearChange.js +3 -4
- package/es/DropBox/DropBoxElement/css/cssJSLogic.js +5 -6
- package/es/Layout/utils.js +1 -2
- package/es/ListItem/ListContainer.js +4 -5
- package/es/Modal/Portal/Portal.js +4 -5
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +91 -103
- package/es/MultiSelect/AdvancedMultiSelect.js +74 -80
- package/es/MultiSelect/MultiSelect.js +4 -13
- package/es/MultiSelect/Suggestions.js +14 -17
- package/es/Popup/Popup.js +1 -4
- package/es/Provider/IdProvider.js +4 -5
- package/es/Provider/LibraryContext.js +11 -12
- package/es/Provider/NumberGenerator/NumberGenerator.js +15 -17
- package/es/Provider/ZindexProvider.js +4 -5
- package/es/Responsive/CustomResponsive.js +8 -11
- package/es/Responsive/ResizeComponent.js +1 -3
- package/es/Responsive/Responsive.js +9 -12
- package/es/Responsive/sizeObservers.js +1 -5
- package/es/ResponsiveDropBox/ResponsiveDropBox.js +10 -14
- package/es/Select/GroupSelect.js +98 -103
- package/es/Select/Select.js +110 -114
- package/es/Select/SelectWithAvatar.js +91 -95
- package/es/Select/SelectWithIcon.js +104 -109
- package/es/Select/__tests__/Select.spec.js +6 -9
- package/es/Tab/Tab.js +29 -30
- package/es/Tab/TabContent.js +16 -19
- package/es/Tab/TabContentWrapper.js +19 -22
- package/es/Tab/TabWrapper.js +15 -16
- package/es/Tab/Tabs.js +80 -87
- package/es/Typography/css/cssJSLogic.js +4 -5
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +1 -2
- package/es/utils/Common.js +10 -31
- package/es/utils/datetime/common.js +2 -6
- package/es/utils/dropDownUtils.js +7 -11
- package/es/utils/getInitial.js +1 -3
- package/es/v1/Button/Button.js +5 -3
- package/es/v1/Button/__tests__/Button.spec.js +5 -2
- package/es/v1/Button/__tests__/__snapshots__/Button.spec.js.snap +8 -1
- package/es/v1/Button/css/cssJSLogic.js +11 -10
- package/es/v1/Label/css/cssJSLogic.js +4 -5
- package/es/v1/Switch/css/cssJSLogic.js +4 -5
- package/es/v1/helpers/colorHelpers/colorHelper.js +36 -44
- package/es/v1/helpers/colorHelpers/paletteUtilities.README.md +30 -30
- package/es/v1/{Button/_shared → shared}/Loader/Loader.js +3 -3
- package/es/v1/{Button/_shared → shared}/Loader/__tests__/Loader.spec.js +1 -1
- package/es/v1/shared/Loader/props/defaultProps.js +5 -0
- package/es/v1/{Button/_shared → shared}/Loader/props/propTypes.js +1 -1
- package/es/v1/{Button/_shared → shared}/SuccessTick/SuccessTick.js +3 -3
- package/es/v1/{Button/_shared → shared}/SuccessTick/__tests__/SuccessTick.spec.js +1 -1
- package/es/v1/shared/SuccessTick/props/defaultProps.js +5 -0
- package/es/v1/{Button/_shared → shared}/SuccessTick/props/propTypes.js +1 -1
- package/lib/Select/Select.js +3 -1
- package/lib/v1/Button/Button.js +5 -3
- package/lib/v1/Button/__tests__/Button.spec.js +5 -2
- package/lib/v1/Button/__tests__/__snapshots__/Button.spec.js.snap +8 -1
- package/lib/v1/Button/css/cssJSLogic.js +9 -5
- package/lib/v1/helpers/colorHelpers/colorHelper.js +8 -5
- package/lib/v1/helpers/colorHelpers/paletteUtilities.README.md +30 -30
- package/lib/v1/{Button/_shared → shared}/Loader/Loader.js +5 -5
- package/lib/v1/{Button/_shared → shared}/Loader/__tests__/Loader.spec.js +1 -1
- package/lib/v1/{Button/_shared/SuccessTick → shared/Loader}/props/defaultProps.js +4 -1
- package/lib/v1/{Button/_shared → shared}/Loader/props/propTypes.js +1 -1
- package/lib/v1/{Button/_shared → shared}/SuccessTick/SuccessTick.js +5 -5
- package/lib/v1/{Button/_shared → shared}/SuccessTick/__tests__/SuccessTick.spec.js +1 -1
- package/lib/v1/{Button/_shared/Loader → shared/SuccessTick}/props/defaultProps.js +4 -1
- package/lib/v1/{Button/_shared → shared}/SuccessTick/props/propTypes.js +1 -1
- package/package.json +11 -10
- package/es/v1/Button/_shared/Loader/props/defaultProps.js +0 -4
- package/es/v1/Button/_shared/SuccessTick/props/defaultProps.js +0 -4
- /package/es/v1/{Button/_shared → shared}/Loader/Loader_v1.module.css +0 -0
- /package/es/v1/{Button/_shared → shared}/Loader/__tests__/__snapshots__/Loader.spec.js.snap +0 -0
- /package/es/v1/{Button/_shared → shared}/SuccessTick/SuccessTick_v1.module.css +0 -0
- /package/es/v1/{Button/_shared → shared}/SuccessTick/__tests__/__snapshots__/SuccessTick.spec.js.snap +0 -0
- /package/lib/v1/{Button/_shared → shared}/Loader/Loader_v1.module.css +0 -0
- /package/lib/v1/{Button/_shared → shared}/Loader/__tests__/__snapshots__/Loader.spec.js.snap +0 -0
- /package/lib/v1/{Button/_shared → shared}/SuccessTick/SuccessTick_v1.module.css +0 -0
- /package/lib/v1/{Button/_shared → shared}/SuccessTick/__tests__/__snapshots__/SuccessTick.spec.js.snap +0 -0
|
@@ -118,10 +118,9 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
responsiveFunc(
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
} = _ref;
|
|
121
|
+
responsiveFunc({
|
|
122
|
+
mediaQueryOR
|
|
123
|
+
}) {
|
|
125
124
|
return {
|
|
126
125
|
tabletMode: mediaQueryOR([{
|
|
127
126
|
maxWidth: 700
|
|
@@ -268,97 +267,94 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
268
267
|
}, TextBoxProps)))), !isReadOnly && !isDisabled && isPopupOpen ? /*#__PURE__*/React.createElement(ResponsiveReceiver, {
|
|
269
268
|
query: this.responsiveFunc,
|
|
270
269
|
responsiveId: "Helmet"
|
|
271
|
-
},
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
align: "both"
|
|
360
|
-
}, /*#__PURE__*/React.createElement(Loader, null))))));
|
|
361
|
-
}) : null);
|
|
270
|
+
}, ({
|
|
271
|
+
tabletMode
|
|
272
|
+
}) => /*#__PURE__*/React.createElement(ResponsiveDropBox, {
|
|
273
|
+
animationStyle: animationStyle,
|
|
274
|
+
boxPosition: position || `${defaultDropBoxPosition}Center`,
|
|
275
|
+
getRef: getContainerRef,
|
|
276
|
+
isActive: isPopupReady,
|
|
277
|
+
isAnimate: true,
|
|
278
|
+
isArrow: false,
|
|
279
|
+
onClick: removeClose,
|
|
280
|
+
needResponsive: needResponsive,
|
|
281
|
+
isAbsolutePositioningNeeded: isAbsolutePositioningNeeded,
|
|
282
|
+
positionsOffset: positionsOffset,
|
|
283
|
+
targetOffset: targetOffset,
|
|
284
|
+
isRestrictScroll: isRestrictScroll,
|
|
285
|
+
isPadding: false,
|
|
286
|
+
isResponsivePadding: true,
|
|
287
|
+
alignBox: "row",
|
|
288
|
+
dataId: `${dataId}_dropbox`,
|
|
289
|
+
customClass: {
|
|
290
|
+
customDropBox: dropBoxClass
|
|
291
|
+
}
|
|
292
|
+
}, isLoading ? /*#__PURE__*/React.createElement(Container, {
|
|
293
|
+
align: "both",
|
|
294
|
+
className: style.loader
|
|
295
|
+
}, /*#__PURE__*/React.createElement(Loader, null)) : /*#__PURE__*/React.createElement(Box, {
|
|
296
|
+
flexible: true
|
|
297
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
298
|
+
onScroll: this.handleScroll
|
|
299
|
+
}, needSearch ? /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement("div", {
|
|
300
|
+
className: `${selectStyle.search} ${selectStyle[size]}`
|
|
301
|
+
}, /*#__PURE__*/React.createElement(TextBoxIcon, _extends({
|
|
302
|
+
inputRef: this.searchInputRef,
|
|
303
|
+
maxLength: maxLength,
|
|
304
|
+
onChange: this.handleSearch,
|
|
305
|
+
onKeyDown: this.handleKeyDown,
|
|
306
|
+
placeHolder: searchBoxPlaceHolder,
|
|
307
|
+
size: searchBoxSize,
|
|
308
|
+
value: searchStr,
|
|
309
|
+
onClear: this.handleClearSearch,
|
|
310
|
+
dataId: `${dataId}_search`,
|
|
311
|
+
a11y: {
|
|
312
|
+
ariaAutocomplete: 'list',
|
|
313
|
+
ariaControls: setAriaId,
|
|
314
|
+
ariaDescribedby: ariaErrorId
|
|
315
|
+
},
|
|
316
|
+
autoComplete: false
|
|
317
|
+
}, DropdownSearchTextBoxProps)))) : null, /*#__PURE__*/React.createElement(CardContent, {
|
|
318
|
+
shrink: true,
|
|
319
|
+
customClass: `${!tabletMode && dropBoxSize ? style[dropBoxSize] : ''} ${cardContentClass}`,
|
|
320
|
+
eleRef: this.suggestionContainerRef
|
|
321
|
+
}, groupName ? /*#__PURE__*/React.createElement("div", {
|
|
322
|
+
className: style.title
|
|
323
|
+
}, /*#__PURE__*/React.createElement(DropDownHeading, {
|
|
324
|
+
text: groupName,
|
|
325
|
+
a11y: {
|
|
326
|
+
role: 'heading'
|
|
327
|
+
}
|
|
328
|
+
})) : null, suggestions.length ? /*#__PURE__*/React.createElement(Suggestions, _extends({
|
|
329
|
+
dataId: `${dataId}_Options`,
|
|
330
|
+
activeId: selectedId,
|
|
331
|
+
suggestions: suggestions,
|
|
332
|
+
getRef: this.suggestionItemRef,
|
|
333
|
+
hoverOption: hoverIndex,
|
|
334
|
+
onClick: this.handleChange,
|
|
335
|
+
onMouseEnter: this.handleMouseEnter,
|
|
336
|
+
needTick: true,
|
|
337
|
+
needBorder: false,
|
|
338
|
+
selectedOptions: [selectedId],
|
|
339
|
+
className: selectStyle.listItemContainer,
|
|
340
|
+
htmlId: setAriaId,
|
|
341
|
+
a11y: {
|
|
342
|
+
ariaParentRole: 'listbox',
|
|
343
|
+
role: 'option'
|
|
344
|
+
}
|
|
345
|
+
}, SuggestionsProps)) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
346
|
+
isLoading: isFetchingOptions,
|
|
347
|
+
options: options,
|
|
348
|
+
searchString: searchStr,
|
|
349
|
+
suggestions: suggestions,
|
|
350
|
+
renderCustomEmptyState: renderCustomEmptyState,
|
|
351
|
+
dataId: dataId,
|
|
352
|
+
i18nKeys: i18nKeys,
|
|
353
|
+
htmlId: ariaErrorId
|
|
354
|
+
}), isFetchingOptions && /*#__PURE__*/React.createElement(Container, {
|
|
355
|
+
isCover: false,
|
|
356
|
+
align: "both"
|
|
357
|
+
}, /*#__PURE__*/React.createElement(Loader, null))))))) : null);
|
|
362
358
|
}
|
|
363
359
|
|
|
364
360
|
}
|
|
@@ -268,8 +268,7 @@ class SelectWithIcon extends Component {
|
|
|
268
268
|
isNextOptions && getNextOptions && this.handleFetchOptions(getNextOptions, searchValue);
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
-
handleFetchOptions(APICall) {
|
|
272
|
-
let searchValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
271
|
+
handleFetchOptions(APICall, searchValue = '') {
|
|
273
272
|
let {
|
|
274
273
|
isFetchingOptions = false
|
|
275
274
|
} = this.state;
|
|
@@ -300,10 +299,9 @@ class SelectWithIcon extends Component {
|
|
|
300
299
|
}
|
|
301
300
|
}
|
|
302
301
|
|
|
303
|
-
responsiveFunc(
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
} = _ref;
|
|
302
|
+
responsiveFunc({
|
|
303
|
+
mediaQueryOR
|
|
304
|
+
}) {
|
|
307
305
|
return {
|
|
308
306
|
tabletMode: mediaQueryOR([{
|
|
309
307
|
maxWidth: 700
|
|
@@ -459,112 +457,109 @@ class SelectWithIcon extends Component {
|
|
|
459
457
|
})))))), !isReadOnly && !isDisabled && isPopupOpen ? /*#__PURE__*/React.createElement(ResponsiveReceiver, {
|
|
460
458
|
query: this.responsiveFunc,
|
|
461
459
|
responsiveId: "Helmet"
|
|
462
|
-
},
|
|
460
|
+
}, ({
|
|
461
|
+
tabletMode
|
|
462
|
+
}) => /*#__PURE__*/React.createElement(ResponsiveDropBox, {
|
|
463
|
+
animationStyle: animationStyle,
|
|
464
|
+
boxPosition: position,
|
|
465
|
+
isActive: isPopupReady,
|
|
466
|
+
isAnimate: true,
|
|
467
|
+
isArrow: false,
|
|
468
|
+
onClick: removeClose,
|
|
469
|
+
getRef: getContainerRef,
|
|
470
|
+
needResponsive: needResponsive,
|
|
471
|
+
isAbsolutePositioningNeeded: isAbsolutePositioningNeeded,
|
|
472
|
+
positionsOffset: positionsOffset,
|
|
473
|
+
targetOffset: targetOffset,
|
|
474
|
+
isRestrictScroll: isRestrictScroll,
|
|
475
|
+
dataId: `${dataId}_suggestions`,
|
|
476
|
+
size: boxSize,
|
|
477
|
+
isPadding: false,
|
|
478
|
+
isResponsivePadding: true,
|
|
479
|
+
alignBox: "row",
|
|
480
|
+
customClass: {
|
|
481
|
+
customDropBox: dropBoxClass
|
|
482
|
+
}
|
|
483
|
+
}, isLoading ? /*#__PURE__*/React.createElement(Container, {
|
|
484
|
+
align: "both",
|
|
485
|
+
className: style.loader
|
|
486
|
+
}, /*#__PURE__*/React.createElement(Loader, null)) : /*#__PURE__*/React.createElement(Box, {
|
|
487
|
+
flexible: true
|
|
488
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
489
|
+
onScroll: this.handleScroll,
|
|
490
|
+
htmlId: setAriaId,
|
|
491
|
+
a11y: {
|
|
492
|
+
role: 'listbox'
|
|
493
|
+
}
|
|
494
|
+
}, needSearch ? /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement("div", {
|
|
495
|
+
className: `${style.search} ${style[size]}`
|
|
496
|
+
}, /*#__PURE__*/React.createElement(TextBoxIcon, {
|
|
497
|
+
onClear: this.onSearchClear,
|
|
498
|
+
onChange: this.onSearch,
|
|
499
|
+
placeHolder: searchBoxPlaceHolder,
|
|
500
|
+
value: searchValue,
|
|
501
|
+
maxLength: maxLength,
|
|
502
|
+
onKeyDown: this.handleKeyDown,
|
|
503
|
+
inputRef: this.searchInputRef,
|
|
504
|
+
size: searchBoxSize,
|
|
505
|
+
dataId: `${dataId}_search`,
|
|
506
|
+
a11y: {
|
|
507
|
+
ariaDescribedby: ariaErrorId
|
|
508
|
+
},
|
|
509
|
+
autoComplete: false,
|
|
510
|
+
customProps: {
|
|
511
|
+
TextBoxProps: DropdownSearchTextBoxProps
|
|
512
|
+
}
|
|
513
|
+
}))) : null, /*#__PURE__*/React.createElement(CardContent, {
|
|
514
|
+
customClass: `${tabletMode ? style.responsivedropBoxList : style.dropBoxList} ${!tabletMode && dropBoxSize ? style[dropBoxSize] : ''} ${cardContentClass}`,
|
|
515
|
+
shrink: true,
|
|
516
|
+
eleRef: this.scrollContentRef,
|
|
517
|
+
dataId: `${dataId}_Options`
|
|
518
|
+
}, options.length ? /*#__PURE__*/React.createElement(React.Fragment, null, options.map((options, i) => {
|
|
463
519
|
let {
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
align: "both",
|
|
489
|
-
className: style.loader
|
|
490
|
-
}, /*#__PURE__*/React.createElement(Loader, null)) : /*#__PURE__*/React.createElement(Box, {
|
|
491
|
-
flexible: true
|
|
492
|
-
}, /*#__PURE__*/React.createElement(Card, {
|
|
493
|
-
onScroll: this.handleScroll,
|
|
494
|
-
htmlId: setAriaId,
|
|
520
|
+
iconName,
|
|
521
|
+
iconSize,
|
|
522
|
+
iconColor
|
|
523
|
+
} = options;
|
|
524
|
+
return /*#__PURE__*/React.createElement(ListItemWithIcon, _extends({
|
|
525
|
+
key: options[idKey],
|
|
526
|
+
value: options[valueKey],
|
|
527
|
+
secondaryValue: options[secondaryValueKey],
|
|
528
|
+
size: "medium",
|
|
529
|
+
onClick: this.handleChange,
|
|
530
|
+
id: options[idKey],
|
|
531
|
+
index: i,
|
|
532
|
+
title: options[valueKey],
|
|
533
|
+
palette: "default",
|
|
534
|
+
dataId: options[idKey],
|
|
535
|
+
iconName: iconName,
|
|
536
|
+
iconSize: iconSize,
|
|
537
|
+
iconClass: iconColor,
|
|
538
|
+
active: selectedId === options[idKey],
|
|
539
|
+
needBorder: needListBorder,
|
|
540
|
+
needTick: needTick,
|
|
541
|
+
onMouseEnter: this.handleMouseEnter,
|
|
542
|
+
highlight: selectedIndex === i,
|
|
543
|
+
getRef: this.itemRef,
|
|
495
544
|
a11y: {
|
|
496
|
-
role: '
|
|
545
|
+
role: 'option',
|
|
546
|
+
ariaSelected: selectedId === options[idKey],
|
|
547
|
+
ariaLabel: options[valueKey]
|
|
497
548
|
}
|
|
498
|
-
},
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
},
|
|
513
|
-
autoComplete: false,
|
|
514
|
-
customProps: {
|
|
515
|
-
TextBoxProps: DropdownSearchTextBoxProps
|
|
516
|
-
}
|
|
517
|
-
}))) : null, /*#__PURE__*/React.createElement(CardContent, {
|
|
518
|
-
customClass: `${tabletMode ? style.responsivedropBoxList : style.dropBoxList} ${!tabletMode && dropBoxSize ? style[dropBoxSize] : ''} ${cardContentClass}`,
|
|
519
|
-
shrink: true,
|
|
520
|
-
eleRef: this.scrollContentRef,
|
|
521
|
-
dataId: `${dataId}_Options`
|
|
522
|
-
}, options.length ? /*#__PURE__*/React.createElement(React.Fragment, null, options.map((options, i) => {
|
|
523
|
-
let {
|
|
524
|
-
iconName,
|
|
525
|
-
iconSize,
|
|
526
|
-
iconColor
|
|
527
|
-
} = options;
|
|
528
|
-
return /*#__PURE__*/React.createElement(ListItemWithIcon, _extends({
|
|
529
|
-
key: options[idKey],
|
|
530
|
-
value: options[valueKey],
|
|
531
|
-
secondaryValue: options[secondaryValueKey],
|
|
532
|
-
size: "medium",
|
|
533
|
-
onClick: this.handleChange,
|
|
534
|
-
id: options[idKey],
|
|
535
|
-
index: i,
|
|
536
|
-
title: options[valueKey],
|
|
537
|
-
palette: "default",
|
|
538
|
-
dataId: options[idKey],
|
|
539
|
-
iconName: iconName,
|
|
540
|
-
iconSize: iconSize,
|
|
541
|
-
iconClass: iconColor,
|
|
542
|
-
active: selectedId === options[idKey],
|
|
543
|
-
needBorder: needListBorder,
|
|
544
|
-
needTick: needTick,
|
|
545
|
-
onMouseEnter: this.handleMouseEnter,
|
|
546
|
-
highlight: selectedIndex === i,
|
|
547
|
-
getRef: this.itemRef,
|
|
548
|
-
a11y: {
|
|
549
|
-
role: 'option',
|
|
550
|
-
ariaSelected: selectedId === options[idKey],
|
|
551
|
-
ariaLabel: options[valueKey]
|
|
552
|
-
}
|
|
553
|
-
}, ListItemProps));
|
|
554
|
-
})) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
555
|
-
isLoading: isFetchingOptions,
|
|
556
|
-
options: options,
|
|
557
|
-
searchString: searchValue,
|
|
558
|
-
suggestions: options,
|
|
559
|
-
renderCustomEmptyState: renderCustomEmptyState,
|
|
560
|
-
dataId: dataId,
|
|
561
|
-
i18nKeys: i18nKeys,
|
|
562
|
-
htmlId: ariaErrorId
|
|
563
|
-
}), isFetchingOptions && /*#__PURE__*/React.createElement(Container, {
|
|
564
|
-
isCover: false,
|
|
565
|
-
align: "both"
|
|
566
|
-
}, /*#__PURE__*/React.createElement(Loader, null))))));
|
|
567
|
-
}) : null);
|
|
549
|
+
}, ListItemProps));
|
|
550
|
+
})) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
551
|
+
isLoading: isFetchingOptions,
|
|
552
|
+
options: options,
|
|
553
|
+
searchString: searchValue,
|
|
554
|
+
suggestions: options,
|
|
555
|
+
renderCustomEmptyState: renderCustomEmptyState,
|
|
556
|
+
dataId: dataId,
|
|
557
|
+
i18nKeys: i18nKeys,
|
|
558
|
+
htmlId: ariaErrorId
|
|
559
|
+
}), isFetchingOptions && /*#__PURE__*/React.createElement(Container, {
|
|
560
|
+
isCover: false,
|
|
561
|
+
align: "both"
|
|
562
|
+
}, /*#__PURE__*/React.createElement(Loader, null))))))) : null);
|
|
568
563
|
}
|
|
569
564
|
|
|
570
565
|
}
|
|
@@ -618,15 +618,12 @@ describe('Select -', () => {
|
|
|
618
618
|
});
|
|
619
619
|
test('Should trigger onAddNewOption, when click on the custom search empty state button', () => {
|
|
620
620
|
const addMessage = 'Add New Option';
|
|
621
|
-
const getCustomEmptyState = jest.fn(
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
onClick: onAddNewOption
|
|
628
|
-
}, addMessage);
|
|
629
|
-
});
|
|
621
|
+
const getCustomEmptyState = jest.fn(({
|
|
622
|
+
searchString,
|
|
623
|
+
onAddNewOption
|
|
624
|
+
}) => /*#__PURE__*/React.createElement("button", {
|
|
625
|
+
onClick: onAddNewOption
|
|
626
|
+
}, addMessage));
|
|
630
627
|
const mockOnAddNewOption = jest.fn();
|
|
631
628
|
const {
|
|
632
629
|
getByRole,
|
package/es/Tab/Tab.js
CHANGED
|
@@ -24,36 +24,35 @@ const tabTypes = {
|
|
|
24
24
|
tab: 'tabDelta'
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
|
-
export default function Tab(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
} = _ref;
|
|
27
|
+
export default function Tab({
|
|
28
|
+
id,
|
|
29
|
+
style,
|
|
30
|
+
text,
|
|
31
|
+
children,
|
|
32
|
+
className,
|
|
33
|
+
dataId,
|
|
34
|
+
dataSelectorId,
|
|
35
|
+
title,
|
|
36
|
+
titlePosition,
|
|
37
|
+
activeClass,
|
|
38
|
+
href,
|
|
39
|
+
isLink,
|
|
40
|
+
isDisabled,
|
|
41
|
+
tourId,
|
|
42
|
+
onClick,
|
|
43
|
+
isActive,
|
|
44
|
+
getTabRef,
|
|
45
|
+
onSelect,
|
|
46
|
+
type,
|
|
47
|
+
isAnimate,
|
|
48
|
+
needBorder,
|
|
49
|
+
needAppearance,
|
|
50
|
+
align,
|
|
51
|
+
isVirtual,
|
|
52
|
+
contentAlign,
|
|
53
|
+
contentAlignBox,
|
|
54
|
+
customProps
|
|
55
|
+
}) {
|
|
57
56
|
let clickListener = useCallback(event => {
|
|
58
57
|
if (isLink && event && (event.metaKey || event.altKey || event.ctrlKey || event.shiftKey)) {
|
|
59
58
|
event && event.stopPropagation();
|
package/es/Tab/TabContent.js
CHANGED
|
@@ -5,25 +5,22 @@ import { Container } from "../Layout";
|
|
|
5
5
|
import style from "./TabContent.module.css";
|
|
6
6
|
/* eslint-disable react/forbid-component-props */
|
|
7
7
|
|
|
8
|
-
const TabContent =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
dataSelectorId: dataSelectorId
|
|
25
|
-
}, children);
|
|
26
|
-
};
|
|
8
|
+
const TabContent = ({
|
|
9
|
+
children,
|
|
10
|
+
scroll,
|
|
11
|
+
dataId,
|
|
12
|
+
id,
|
|
13
|
+
dataSelectorId
|
|
14
|
+
}) => /*#__PURE__*/React.createElement(Container, {
|
|
15
|
+
className: style.container,
|
|
16
|
+
scroll: scroll,
|
|
17
|
+
dataId: `${dataId}_TabContent`,
|
|
18
|
+
isScrollAttribute: true,
|
|
19
|
+
"aria-labelledby": id,
|
|
20
|
+
tabindex: "-1",
|
|
21
|
+
role: "tabpanel",
|
|
22
|
+
dataSelectorId: dataSelectorId
|
|
23
|
+
}, children);
|
|
27
24
|
|
|
28
25
|
TabContent.defaultProps = TabContent_defaultProps;
|
|
29
26
|
TabContent.propTypes = TabContent_propTypes;
|
|
@@ -6,28 +6,25 @@ import { TabContentWrapper_propTypes } from "./props/propTypes";
|
|
|
6
6
|
import { Box } from "../Layout";
|
|
7
7
|
/* eslint-disable react/forbid-component-props */
|
|
8
8
|
|
|
9
|
-
const TabContentWrapper =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
tagName: tagName
|
|
29
|
-
}, a11y), React.Children.map(children, child => /*#__PURE__*/React.isValidElement(child) && child.props.id === selectedTab ? child : null));
|
|
30
|
-
};
|
|
9
|
+
const TabContentWrapper = ({
|
|
10
|
+
style,
|
|
11
|
+
className,
|
|
12
|
+
children,
|
|
13
|
+
dataId,
|
|
14
|
+
selectedTab,
|
|
15
|
+
onScroll,
|
|
16
|
+
dataSelectorId,
|
|
17
|
+
tagName,
|
|
18
|
+
a11y
|
|
19
|
+
}) => /*#__PURE__*/React.createElement(Box, _extends({
|
|
20
|
+
flexible: true,
|
|
21
|
+
style: style,
|
|
22
|
+
dataId: dataId,
|
|
23
|
+
className: className,
|
|
24
|
+
onScroll: onScroll,
|
|
25
|
+
dataSelectorId: dataSelectorId,
|
|
26
|
+
tagName: tagName
|
|
27
|
+
}, a11y), React.Children.map(children, child => /*#__PURE__*/React.isValidElement(child) && child.props.id === selectedTab ? child : null));
|
|
31
28
|
|
|
32
29
|
TabContentWrapper.defaultProps = TabContentWrapper_defaultProps;
|
|
33
30
|
TabContentWrapper.propTypes = TabContentWrapper_propTypes;
|
package/es/Tab/TabWrapper.js
CHANGED
|
@@ -6,22 +6,21 @@ import { TabWrapper_propTypes } from "./props/propTypes";
|
|
|
6
6
|
import { Container } from "../Layout";
|
|
7
7
|
import { TAB_ALIGN_MAPPING } from "./utils/tabConfigs";
|
|
8
8
|
|
|
9
|
-
function TabWrapper(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} = _ref;
|
|
9
|
+
function TabWrapper({
|
|
10
|
+
defaultTab,
|
|
11
|
+
hookToDisableInternalState,
|
|
12
|
+
onSelect,
|
|
13
|
+
type,
|
|
14
|
+
isAnimate,
|
|
15
|
+
needTabBorder,
|
|
16
|
+
needBorder,
|
|
17
|
+
needPadding,
|
|
18
|
+
needAppearance,
|
|
19
|
+
align,
|
|
20
|
+
dataId,
|
|
21
|
+
children,
|
|
22
|
+
dataSelectorId
|
|
23
|
+
}) {
|
|
25
24
|
let [selectedTabInternal, setSelected] = useState(!hookToDisableInternalState ? defaultTab || 0 : null);
|
|
26
25
|
const setSelectedTab = useCallback(id => {
|
|
27
26
|
if (!hookToDisableInternalState) {
|