@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.
Files changed (87) hide show
  1. package/README.md +14 -0
  2. package/es/Avatar/Avatar.js +1 -2
  3. package/es/Button/css/cssJSLogic.js +4 -5
  4. package/es/DateTime/DateTime.js +3 -6
  5. package/es/DateTime/DateWidget.js +2 -5
  6. package/es/DateTime/YearView.js +5 -6
  7. package/es/DateTime/common.js +2 -9
  8. package/es/DateTime/dateFormatUtils/dateFormat.js +55 -76
  9. package/es/DateTime/dateFormatUtils/index.js +7 -12
  10. package/es/DateTime/dateFormatUtils/timeChange.js +3 -4
  11. package/es/DateTime/dateFormatUtils/yearChange.js +3 -4
  12. package/es/DropBox/DropBoxElement/css/cssJSLogic.js +5 -6
  13. package/es/Layout/utils.js +1 -2
  14. package/es/ListItem/ListContainer.js +4 -5
  15. package/es/Modal/Portal/Portal.js +4 -5
  16. package/es/MultiSelect/AdvancedGroupMultiSelect.js +91 -103
  17. package/es/MultiSelect/AdvancedMultiSelect.js +74 -80
  18. package/es/MultiSelect/MultiSelect.js +4 -13
  19. package/es/MultiSelect/Suggestions.js +14 -17
  20. package/es/Popup/Popup.js +1 -4
  21. package/es/Provider/IdProvider.js +4 -5
  22. package/es/Provider/LibraryContext.js +11 -12
  23. package/es/Provider/NumberGenerator/NumberGenerator.js +15 -17
  24. package/es/Provider/ZindexProvider.js +4 -5
  25. package/es/Responsive/CustomResponsive.js +8 -11
  26. package/es/Responsive/ResizeComponent.js +1 -3
  27. package/es/Responsive/Responsive.js +9 -12
  28. package/es/Responsive/sizeObservers.js +1 -5
  29. package/es/ResponsiveDropBox/ResponsiveDropBox.js +10 -14
  30. package/es/Select/GroupSelect.js +98 -103
  31. package/es/Select/Select.js +110 -114
  32. package/es/Select/SelectWithAvatar.js +91 -95
  33. package/es/Select/SelectWithIcon.js +104 -109
  34. package/es/Select/__tests__/Select.spec.js +6 -9
  35. package/es/Tab/Tab.js +29 -30
  36. package/es/Tab/TabContent.js +16 -19
  37. package/es/Tab/TabContentWrapper.js +19 -22
  38. package/es/Tab/TabWrapper.js +15 -16
  39. package/es/Tab/Tabs.js +80 -87
  40. package/es/Typography/css/cssJSLogic.js +4 -5
  41. package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +1 -2
  42. package/es/utils/Common.js +10 -31
  43. package/es/utils/datetime/common.js +2 -6
  44. package/es/utils/dropDownUtils.js +7 -11
  45. package/es/utils/getInitial.js +1 -3
  46. package/es/v1/Button/Button.js +5 -3
  47. package/es/v1/Button/__tests__/Button.spec.js +5 -2
  48. package/es/v1/Button/__tests__/__snapshots__/Button.spec.js.snap +8 -1
  49. package/es/v1/Button/css/cssJSLogic.js +11 -10
  50. package/es/v1/Label/css/cssJSLogic.js +4 -5
  51. package/es/v1/Switch/css/cssJSLogic.js +4 -5
  52. package/es/v1/helpers/colorHelpers/colorHelper.js +36 -44
  53. package/es/v1/helpers/colorHelpers/paletteUtilities.README.md +30 -30
  54. package/es/v1/{Button/_shared → shared}/Loader/Loader.js +3 -3
  55. package/es/v1/{Button/_shared → shared}/Loader/__tests__/Loader.spec.js +1 -1
  56. package/es/v1/shared/Loader/props/defaultProps.js +5 -0
  57. package/es/v1/{Button/_shared → shared}/Loader/props/propTypes.js +1 -1
  58. package/es/v1/{Button/_shared → shared}/SuccessTick/SuccessTick.js +3 -3
  59. package/es/v1/{Button/_shared → shared}/SuccessTick/__tests__/SuccessTick.spec.js +1 -1
  60. package/es/v1/shared/SuccessTick/props/defaultProps.js +5 -0
  61. package/es/v1/{Button/_shared → shared}/SuccessTick/props/propTypes.js +1 -1
  62. package/lib/Select/Select.js +3 -1
  63. package/lib/v1/Button/Button.js +5 -3
  64. package/lib/v1/Button/__tests__/Button.spec.js +5 -2
  65. package/lib/v1/Button/__tests__/__snapshots__/Button.spec.js.snap +8 -1
  66. package/lib/v1/Button/css/cssJSLogic.js +9 -5
  67. package/lib/v1/helpers/colorHelpers/colorHelper.js +8 -5
  68. package/lib/v1/helpers/colorHelpers/paletteUtilities.README.md +30 -30
  69. package/lib/v1/{Button/_shared → shared}/Loader/Loader.js +5 -5
  70. package/lib/v1/{Button/_shared → shared}/Loader/__tests__/Loader.spec.js +1 -1
  71. package/lib/v1/{Button/_shared/SuccessTick → shared/Loader}/props/defaultProps.js +4 -1
  72. package/lib/v1/{Button/_shared → shared}/Loader/props/propTypes.js +1 -1
  73. package/lib/v1/{Button/_shared → shared}/SuccessTick/SuccessTick.js +5 -5
  74. package/lib/v1/{Button/_shared → shared}/SuccessTick/__tests__/SuccessTick.spec.js +1 -1
  75. package/lib/v1/{Button/_shared/Loader → shared/SuccessTick}/props/defaultProps.js +4 -1
  76. package/lib/v1/{Button/_shared → shared}/SuccessTick/props/propTypes.js +1 -1
  77. package/package.json +11 -10
  78. package/es/v1/Button/_shared/Loader/props/defaultProps.js +0 -4
  79. package/es/v1/Button/_shared/SuccessTick/props/defaultProps.js +0 -4
  80. /package/es/v1/{Button/_shared → shared}/Loader/Loader_v1.module.css +0 -0
  81. /package/es/v1/{Button/_shared → shared}/Loader/__tests__/__snapshots__/Loader.spec.js.snap +0 -0
  82. /package/es/v1/{Button/_shared → shared}/SuccessTick/SuccessTick_v1.module.css +0 -0
  83. /package/es/v1/{Button/_shared → shared}/SuccessTick/__tests__/__snapshots__/SuccessTick.spec.js.snap +0 -0
  84. /package/lib/v1/{Button/_shared → shared}/Loader/Loader_v1.module.css +0 -0
  85. /package/lib/v1/{Button/_shared → shared}/Loader/__tests__/__snapshots__/Loader.spec.js.snap +0 -0
  86. /package/lib/v1/{Button/_shared → shared}/SuccessTick/SuccessTick_v1.module.css +0 -0
  87. /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(_ref) {
122
- let {
123
- mediaQueryOR
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
- }, _ref2 => {
272
- let {
273
- tabletMode
274
- } = _ref2;
275
- return /*#__PURE__*/React.createElement(ResponsiveDropBox, {
276
- animationStyle: animationStyle,
277
- boxPosition: position || `${defaultDropBoxPosition}Center`,
278
- getRef: getContainerRef,
279
- isActive: isPopupReady,
280
- isAnimate: true,
281
- isArrow: false,
282
- onClick: removeClose,
283
- needResponsive: needResponsive,
284
- isAbsolutePositioningNeeded: isAbsolutePositioningNeeded,
285
- positionsOffset: positionsOffset,
286
- targetOffset: targetOffset,
287
- isRestrictScroll: isRestrictScroll,
288
- isPadding: false,
289
- isResponsivePadding: true,
290
- alignBox: "row",
291
- dataId: `${dataId}_dropbox`,
292
- customClass: {
293
- customDropBox: dropBoxClass
294
- }
295
- }, isLoading ? /*#__PURE__*/React.createElement(Container, {
296
- align: "both",
297
- className: style.loader
298
- }, /*#__PURE__*/React.createElement(Loader, null)) : /*#__PURE__*/React.createElement(Box, {
299
- flexible: true
300
- }, /*#__PURE__*/React.createElement(Card, {
301
- onScroll: this.handleScroll
302
- }, needSearch ? /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement("div", {
303
- className: `${selectStyle.search} ${selectStyle[size]}`
304
- }, /*#__PURE__*/React.createElement(TextBoxIcon, _extends({
305
- inputRef: this.searchInputRef,
306
- maxLength: maxLength,
307
- onChange: this.handleSearch,
308
- onKeyDown: this.handleKeyDown,
309
- placeHolder: searchBoxPlaceHolder,
310
- size: searchBoxSize,
311
- value: searchStr,
312
- onClear: this.handleClearSearch,
313
- dataId: `${dataId}_search`,
314
- a11y: {
315
- ariaAutocomplete: 'list',
316
- ariaControls: setAriaId,
317
- ariaDescribedby: ariaErrorId
318
- },
319
- autoComplete: false
320
- }, DropdownSearchTextBoxProps)))) : null, /*#__PURE__*/React.createElement(CardContent, {
321
- shrink: true,
322
- customClass: `${!tabletMode && dropBoxSize ? style[dropBoxSize] : ''} ${cardContentClass}`,
323
- eleRef: this.suggestionContainerRef
324
- }, groupName ? /*#__PURE__*/React.createElement("div", {
325
- className: style.title
326
- }, /*#__PURE__*/React.createElement(DropDownHeading, {
327
- text: groupName,
328
- a11y: {
329
- role: 'heading'
330
- }
331
- })) : null, suggestions.length ? /*#__PURE__*/React.createElement(Suggestions, _extends({
332
- dataId: `${dataId}_Options`,
333
- activeId: selectedId,
334
- suggestions: suggestions,
335
- getRef: this.suggestionItemRef,
336
- hoverOption: hoverIndex,
337
- onClick: this.handleChange,
338
- onMouseEnter: this.handleMouseEnter,
339
- needTick: true,
340
- needBorder: false,
341
- selectedOptions: [selectedId],
342
- className: selectStyle.listItemContainer,
343
- htmlId: setAriaId,
344
- a11y: {
345
- ariaParentRole: 'listbox',
346
- role: 'option'
347
- }
348
- }, SuggestionsProps)) : /*#__PURE__*/React.createElement(EmptyState, {
349
- isLoading: isFetchingOptions,
350
- options: options,
351
- searchString: searchStr,
352
- suggestions: suggestions,
353
- renderCustomEmptyState: renderCustomEmptyState,
354
- dataId: dataId,
355
- i18nKeys: i18nKeys,
356
- htmlId: ariaErrorId
357
- }), isFetchingOptions && /*#__PURE__*/React.createElement(Container, {
358
- isCover: false,
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(_ref) {
304
- let {
305
- mediaQueryOR
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
- }, _ref2 => {
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
- tabletMode
465
- } = _ref2;
466
- return /*#__PURE__*/React.createElement(ResponsiveDropBox, {
467
- animationStyle: animationStyle,
468
- boxPosition: position,
469
- isActive: isPopupReady,
470
- isAnimate: true,
471
- isArrow: false,
472
- onClick: removeClose,
473
- getRef: getContainerRef,
474
- needResponsive: needResponsive,
475
- isAbsolutePositioningNeeded: isAbsolutePositioningNeeded,
476
- positionsOffset: positionsOffset,
477
- targetOffset: targetOffset,
478
- isRestrictScroll: isRestrictScroll,
479
- dataId: `${dataId}_suggestions`,
480
- size: boxSize,
481
- isPadding: false,
482
- isResponsivePadding: true,
483
- alignBox: "row",
484
- customClass: {
485
- customDropBox: dropBoxClass
486
- }
487
- }, isLoading ? /*#__PURE__*/React.createElement(Container, {
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: 'listbox'
545
+ role: 'option',
546
+ ariaSelected: selectedId === options[idKey],
547
+ ariaLabel: options[valueKey]
497
548
  }
498
- }, needSearch ? /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement("div", {
499
- className: `${style.search} ${style[size]}`
500
- }, /*#__PURE__*/React.createElement(TextBoxIcon, {
501
- onClear: this.onSearchClear,
502
- onChange: this.onSearch,
503
- placeHolder: searchBoxPlaceHolder,
504
- value: searchValue,
505
- maxLength: maxLength,
506
- onKeyDown: this.handleKeyDown,
507
- inputRef: this.searchInputRef,
508
- size: searchBoxSize,
509
- dataId: `${dataId}_search`,
510
- a11y: {
511
- ariaDescribedby: ariaErrorId
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(_ref => {
622
- let {
623
- searchString,
624
- onAddNewOption
625
- } = _ref;
626
- return /*#__PURE__*/React.createElement("button", {
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(_ref) {
28
- let {
29
- id,
30
- style,
31
- text,
32
- children,
33
- className,
34
- dataId,
35
- dataSelectorId,
36
- title,
37
- titlePosition,
38
- activeClass,
39
- href,
40
- isLink,
41
- isDisabled,
42
- tourId,
43
- onClick,
44
- isActive,
45
- getTabRef,
46
- onSelect,
47
- type,
48
- isAnimate,
49
- needBorder,
50
- needAppearance,
51
- align,
52
- isVirtual,
53
- contentAlign,
54
- contentAlignBox,
55
- customProps
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();
@@ -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 = _ref => {
9
- let {
10
- children,
11
- scroll,
12
- dataId,
13
- id,
14
- dataSelectorId
15
- } = _ref;
16
- return /*#__PURE__*/React.createElement(Container, {
17
- className: style.container,
18
- scroll: scroll,
19
- dataId: `${dataId}_TabContent`,
20
- isScrollAttribute: true,
21
- "aria-labelledby": id,
22
- tabindex: "-1",
23
- role: "tabpanel",
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 = _ref => {
10
- let {
11
- style,
12
- className,
13
- children,
14
- dataId,
15
- selectedTab,
16
- onScroll,
17
- dataSelectorId,
18
- tagName,
19
- a11y
20
- } = _ref;
21
- return /*#__PURE__*/React.createElement(Box, _extends({
22
- flexible: true,
23
- style: style,
24
- dataId: dataId,
25
- className: className,
26
- onScroll: onScroll,
27
- dataSelectorId: dataSelectorId,
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;
@@ -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(_ref) {
10
- let {
11
- defaultTab,
12
- hookToDisableInternalState,
13
- onSelect,
14
- type,
15
- isAnimate,
16
- needTabBorder,
17
- needBorder,
18
- needPadding,
19
- needAppearance,
20
- align,
21
- dataId,
22
- children,
23
- dataSelectorId
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) {