@zohodesk/components 1.0.0-temp-47 → 1.0.0-temp-50

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 (173) hide show
  1. package/README.md +24 -0
  2. package/assets/Appearance/dark/mode/darkMode.module.css +2 -0
  3. package/assets/Appearance/default/mode/defaultMode.module.css +2 -0
  4. package/es/Animation/Animation.js +7 -8
  5. package/es/Avatar/Avatar.js +13 -12
  6. package/es/Avatar/__tests__/Avatar.spec.js +0 -1
  7. package/es/AvatarTeam/__tests__/AvatarTeam.spec.js +0 -1
  8. package/es/Button/Button.js +15 -16
  9. package/es/Button/Button.module.css +6 -2
  10. package/es/Button/__tests__/Button.spec.js +0 -1
  11. package/es/Buttongroup/__test__/Buttongroup.spec.js +0 -1
  12. package/es/Card/Card.js +4 -5
  13. package/es/DateTime/DateTime.js +6 -3
  14. package/es/DateTime/DateWidget.js +5 -2
  15. package/es/DateTime/YearView.js +6 -5
  16. package/es/DateTime/common.js +9 -2
  17. package/es/DateTime/dateFormatUtils/dateFormat.js +76 -57
  18. package/es/DateTime/dateFormatUtils/index.js +12 -7
  19. package/es/DateTime/dateFormatUtils/timeChange.js +4 -3
  20. package/es/DateTime/dateFormatUtils/yearChange.js +4 -3
  21. package/es/DateTime/validator.js +0 -1
  22. package/es/DropBox/DropBox.js +2 -2
  23. package/es/Label/__tests__/Label.spec.js +0 -2
  24. package/es/Layout/utils.js +2 -1
  25. package/es/ListItem/ListContainer.js +3 -8
  26. package/es/ListItem/ListItem.js +58 -39
  27. package/es/ListItem/ListItem.module.css +11 -0
  28. package/es/ListItem/ListItemWithAvatar.js +74 -53
  29. package/es/ListItem/ListItemWithCheckBox.js +54 -33
  30. package/es/ListItem/ListItemWithIcon.js +66 -47
  31. package/es/ListItem/ListItemWithRadio.js +55 -34
  32. package/es/MultiSelect/AdvancedGroupMultiSelect.js +12 -4
  33. package/es/MultiSelect/AdvancedMultiSelect.js +20 -7
  34. package/es/MultiSelect/MultiSelect.js +24 -8
  35. package/es/MultiSelect/MultiSelectWithAvatar.js +1 -1
  36. package/es/PopOver/PopOver.js +19 -20
  37. package/es/Popup/Popup.js +15 -9
  38. package/es/Popup/viewPort.js +14 -9
  39. package/es/Provider/IdProvider.js +5 -4
  40. package/es/Provider/LibraryContext.js +6 -5
  41. package/es/Provider/NumberGenerator/NumberGenerator.js +17 -15
  42. package/es/Provider/ZindexProvider.js +5 -4
  43. package/es/Responsive/CustomResponsive.js +11 -8
  44. package/es/Responsive/ResizeComponent.js +3 -1
  45. package/es/Responsive/Responsive.js +12 -9
  46. package/es/Responsive/sizeObservers.js +13 -2
  47. package/es/Ribbon/Ribbon.js +8 -8
  48. package/es/Ribbon/__tests__/Ribbon.spec.js +0 -1
  49. package/es/Select/GroupSelect.js +3 -2
  50. package/es/Select/Select.js +3 -2
  51. package/es/Select/SelectWithAvatar.js +1 -1
  52. package/es/Select/SelectWithIcon.js +1 -1
  53. package/es/Stencils/Stencils.js +5 -6
  54. package/es/Stencils/__tests__/Stencils.spec.js +0 -1
  55. package/es/Tab/Tab.js +27 -26
  56. package/es/Tab/TabContent.js +17 -14
  57. package/es/Tab/TabContentWrapper.js +17 -14
  58. package/es/Tab/TabWrapper.js +15 -14
  59. package/es/Tab/Tabs.js +2 -1
  60. package/es/TextBox/__tests__/TextBox.spec.js +0 -1
  61. package/es/TextBoxIcon/TextBoxIcon.js +1 -1
  62. package/es/TextBoxIcon/__tests__/TextBoxIcon.spec.js +0 -1
  63. package/es/Textarea/__tests__/Textarea.spec.js +0 -1
  64. package/es/Tooltip/Tooltip.js +0 -1
  65. package/es/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +1 -1
  66. package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +1 -1
  67. package/es/a11y/FocusScope/FocusScope.js +10 -4
  68. package/es/beta/FocusRing/FocusRing.js +4 -1
  69. package/es/utils/Common.js +31 -11
  70. package/es/utils/datetime/common.js +6 -3
  71. package/es/utils/dropDownUtils.js +45 -6
  72. package/es/utils/getInitial.js +3 -1
  73. package/lib/Accordion/Accordion.js +3 -3
  74. package/lib/Accordion/AccordionItem.js +3 -3
  75. package/lib/Animation/Animation.js +10 -11
  76. package/lib/AppContainer/AppContainer.js +3 -3
  77. package/lib/Avatar/Avatar.js +14 -14
  78. package/lib/AvatarTeam/AvatarTeam.js +3 -3
  79. package/lib/Button/Button.js +18 -19
  80. package/lib/Button/Button.module.css +6 -2
  81. package/lib/Buttongroup/Buttongroup.js +3 -3
  82. package/lib/Card/Card.js +8 -9
  83. package/lib/Card/__tests__/Card.spec.js +1 -1
  84. package/lib/Card/index.js +7 -7
  85. package/lib/CheckBox/CheckBox.js +3 -3
  86. package/lib/DateTime/CalendarView.js +4 -4
  87. package/lib/DateTime/DateTime.js +3 -3
  88. package/lib/DateTime/DateTimePopupFooter.js +3 -3
  89. package/lib/DateTime/DateTimePopupHeader.js +3 -3
  90. package/lib/DateTime/DateWidget.js +3 -3
  91. package/lib/DateTime/DaysRow.js +3 -3
  92. package/lib/DateTime/Time.js +3 -3
  93. package/lib/DateTime/YearView.js +3 -3
  94. package/lib/DateTime/__tests__/CalendarView.spec.js +1 -1
  95. package/lib/DateTime/__tests__/DateTime.spec.js +1 -1
  96. package/lib/DateTime/constants.js +1 -1
  97. package/lib/DateTime/dateFormatUtils/dateFormat.js +2 -2
  98. package/lib/DateTime/dateFormatUtils/index.js +13 -13
  99. package/lib/DateTime/objectUtils.js +2 -2
  100. package/lib/DropBox/DropBox.js +9 -5
  101. package/lib/DropDown/DropDown.js +4 -4
  102. package/lib/DropDown/DropDownHeading.js +3 -3
  103. package/lib/DropDown/DropDownItem.js +3 -3
  104. package/lib/DropDown/DropDownSearch.js +3 -3
  105. package/lib/DropDown/DropDownSeparator.js +3 -3
  106. package/lib/Label/Label.js +3 -3
  107. package/lib/Layout/Box.js +1 -1
  108. package/lib/Layout/Container.js +1 -1
  109. package/lib/Layout/index.js +4 -4
  110. package/lib/Layout/utils.js +2 -2
  111. package/lib/ListItem/ListContainer.js +3 -8
  112. package/lib/ListItem/ListItem.js +61 -40
  113. package/lib/ListItem/ListItem.module.css +11 -0
  114. package/lib/ListItem/ListItemWithAvatar.js +77 -56
  115. package/lib/ListItem/ListItemWithCheckBox.js +57 -36
  116. package/lib/ListItem/ListItemWithIcon.js +69 -48
  117. package/lib/ListItem/ListItemWithRadio.js +58 -37
  118. package/lib/Modal/Modal.js +3 -3
  119. package/lib/Modal/__docs__/Modal__default.docs.js +3 -3
  120. package/lib/MultiSelect/AdvancedGroupMultiSelect.js +4 -4
  121. package/lib/MultiSelect/AdvancedMultiSelect.js +20 -8
  122. package/lib/MultiSelect/EmptyState.js +3 -3
  123. package/lib/MultiSelect/MultiSelect.js +16 -7
  124. package/lib/MultiSelect/MultiSelectHeader.js +3 -3
  125. package/lib/MultiSelect/MultiSelectWithAvatar.js +4 -4
  126. package/lib/MultiSelect/SelectedOptions.js +3 -3
  127. package/lib/MultiSelect/Suggestions.js +5 -5
  128. package/lib/PopOver/PopOver.js +23 -24
  129. package/lib/Popup/Popup.js +35 -32
  130. package/lib/Popup/__tests__/Popup.spec.js +3 -3
  131. package/lib/Provider/IdProvider.js +3 -3
  132. package/lib/Provider/LibraryContext.js +3 -3
  133. package/lib/Provider/NumberGenerator/NumberGenerator.js +2 -2
  134. package/lib/Provider/ZindexProvider.js +1 -1
  135. package/lib/Provider.js +3 -3
  136. package/lib/Radio/Radio.js +3 -3
  137. package/lib/Responsive/CustomResponsive.js +4 -4
  138. package/lib/Responsive/RefWrapper.js +1 -1
  139. package/lib/Responsive/ResizeComponent.js +3 -3
  140. package/lib/Responsive/ResizeObserver.js +1 -1
  141. package/lib/Responsive/Responsive.js +6 -5
  142. package/lib/Responsive/sizeObservers.js +14 -6
  143. package/lib/Responsive/utils/index.js +3 -2
  144. package/lib/Responsive/utils/shallowCompare.js +1 -1
  145. package/lib/Ribbon/Ribbon.js +11 -11
  146. package/lib/Select/GroupSelect.js +4 -4
  147. package/lib/Select/Select.js +4 -4
  148. package/lib/Select/SelectWithAvatar.js +4 -4
  149. package/lib/Select/SelectWithIcon.js +4 -4
  150. package/lib/Stencils/Stencils.js +8 -9
  151. package/lib/Switch/Switch.js +3 -3
  152. package/lib/Tab/Tab.js +1 -1
  153. package/lib/Tab/TabWrapper.js +1 -1
  154. package/lib/Tab/Tabs.js +3 -3
  155. package/lib/Tab/index.js +10 -10
  156. package/lib/Tag/Tag.js +3 -3
  157. package/lib/TextBox/TextBox.js +3 -3
  158. package/lib/TextBoxIcon/TextBoxIcon.js +4 -4
  159. package/lib/Textarea/Textarea.js +3 -3
  160. package/lib/Tooltip/Tooltip.js +3 -3
  161. package/lib/Tooltip/__tests__/Tooltip.spec.js +3 -3
  162. package/lib/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +8 -6
  163. package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +8 -6
  164. package/lib/a11y/FocusScope/FocusScope.js +2 -2
  165. package/lib/beta/FocusRing/FocusRing.js +3 -3
  166. package/lib/deprecated/PortalLayer/PortalLayer.js +3 -3
  167. package/lib/index.js +310 -310
  168. package/lib/semantic/Button/Button.js +3 -3
  169. package/lib/utils/Common.js +20 -16
  170. package/lib/utils/datetime/common.js +10 -10
  171. package/lib/utils/dropDownUtils.js +46 -3
  172. package/lib/utils/shallowEqual.js +1 -1
  173. package/package.json +4 -4
@@ -25,7 +25,14 @@ function rangeCheck(minValue, maxValue, screenValue) {
25
25
  return minValue <= screenValue && maxValue >= screenValue;
26
26
  }
27
27
 
28
- export const isTouchDevice = 'ontouchstart' in window && navigator.userAgent.match(/mobi/i) ? true : false;
28
+ function isTouchDeviceFunc() {
29
+ // return window.matchMedia("(pointer: coarse)").matches
30
+ return 'ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
31
+ } // export const isTouchDevice =
32
+ // 'ontouchstart' in window && navigator.userAgent.match(/mobi/i) ? true : false;
33
+
34
+
35
+ export const isTouchDevice = isTouchDeviceFunc();
29
36
  export function isBreackPointMatched(object, screen) {
30
37
  if (!isValideBreakPoint(object)) {
31
38
  // eslint-disable-next-line no-console
@@ -68,7 +75,11 @@ export class Subscribale {
68
75
  this.subscribers.length && this.disconnect();
69
76
  }
70
77
 
71
- dispatch(...args) {
78
+ dispatch() {
79
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
80
+ args[_key] = arguments[_key];
81
+ }
82
+
72
83
  this.subscribers.forEach(subscriber => {
73
84
  subscriber(...args);
74
85
  });
@@ -38,14 +38,14 @@ Ribbon.propTypes = {
38
38
  text: PropTypes.string,
39
39
  type: PropTypes.oneOf(['default', 'flag', 'plain', 'ribbon', 'box', 'stamp', 'sticker', 'tag']),
40
40
  customClass: PropTypes.string
41
- };
42
- Ribbon.propTypesDescription = {
43
- text: ' ',
44
- type: ' ',
45
- children: ' ',
46
- palette: ' ',
47
- size: ' '
48
- };
41
+ }; // Ribbon.propTypesDescription = {
42
+ // text: ' ',
43
+ // type: ' ',
44
+ // children: ' ',
45
+ // palette: ' ',
46
+ // size: ' '
47
+ // };
48
+
49
49
  Ribbon.defaultProps = {
50
50
  palette: 'default',
51
51
  size: 'large',
@@ -1,4 +1,3 @@
1
- import "core-js/modules/web.url.to-json";
2
1
  import React from 'react';
3
2
  import Ribbon from '../Ribbon';
4
3
  import renderer from 'react-test-renderer';
@@ -489,7 +489,8 @@ export class GroupSelectComponent extends PureComponent {
489
489
  }
490
490
  }
491
491
 
492
- handleFetchOptions(APICall, searchStr = '') {
492
+ handleFetchOptions(APICall) {
493
+ let searchStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
493
494
  // let funcArgs = args.slice(1, args.length);
494
495
  let {
495
496
  isFetchingOptions = false
@@ -598,7 +599,7 @@ export class GroupSelectComponent extends PureComponent {
598
599
  return /*#__PURE__*/React.createElement("div", {
599
600
  className: `${style.container} ${style[`box_${size}`]} ${isReadOnly ? style.readonly : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${iconOnHover && (isReadOnly || isDisabled) ? style.iconOnHoverReadonly : iconOnHover && !(isReadOnly || isDisabled) ? style.iconOnHoverStyle : ''}`,
600
601
  "data-id": dataIdSlctComp,
601
- "data-title": isDisabled ? title : ''
602
+ "data-title": isDisabled ? title : null
602
603
  }, /*#__PURE__*/React.createElement("div", {
603
604
  className: `${className ? className : ''}`,
604
605
  onClick: isDisabled || isReadOnly ? null : this.togglePopup,
@@ -455,7 +455,8 @@ export class SelectComponent extends Component {
455
455
  }
456
456
  }
457
457
 
458
- handleFetchOptions(APICall, searchStr = '') {
458
+ handleFetchOptions(APICall) {
459
+ let searchStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
459
460
  // let funcArgs = args.slice(1, args.length);
460
461
  let {
461
462
  isFetchingOptions = false
@@ -742,7 +743,7 @@ export class SelectComponent extends Component {
742
743
  } = customProps;
743
744
  return /*#__PURE__*/React.createElement("div", {
744
745
  className: `${isParentBased || isReadOnly || isDisabled ? style.container : ''} ${style[`box_${size}`]} ${isReadOnly ? style.readonly : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${iconOnHover && (isReadOnly || isDisabled) ? style.iconOnHoverReadonly : iconOnHover && !(isReadOnly || isDisabled) ? style.iconOnHoverStyle : ''}`,
745
- "data-title": isDisabled ? title : ''
746
+ "data-title": isDisabled ? title : null
746
747
  }, /*#__PURE__*/React.createElement("div", {
747
748
  className: `${className ? className : ''}`,
748
749
  onClick: isDisabled || isReadOnly ? null : this.togglePopup,
@@ -167,7 +167,7 @@ class SelectWithAvatarComponent extends SelectComponent {
167
167
  return /*#__PURE__*/React.createElement("div", {
168
168
  className: `${style.wrapper} ${isDisabled ? style.disabled : ''} ${isReadOnly ? style.readOnly : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''} ${className ? className : ''}`,
169
169
  "data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
170
- "data-title": isDisabled ? title : ''
170
+ "data-title": isDisabled ? title : null
171
171
  }, /*#__PURE__*/React.createElement(Container, {
172
172
  align: "vertical",
173
173
  alignBox: "row",
@@ -289,7 +289,7 @@ class SelectWithIcon extends Component {
289
289
  let ariaErrorId = this.getNextAriaId();
290
290
  return /*#__PURE__*/React.createElement("div", {
291
291
  className: `${style.container} ${style[`box_${size}`]} ${isReadOnly ? style.readonly : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''}`,
292
- "data-title": isDisabled ? title : ''
292
+ "data-title": isDisabled ? title : null
293
293
  }, /*#__PURE__*/React.createElement("div", {
294
294
  className: `${className ? className : ''}`,
295
295
  onClick: isDisabled || isReadOnly ? null : this.togglePopup,
@@ -30,12 +30,11 @@ Stencils.defaultProps = {
30
30
  shape: 'rect',
31
31
  size: 'medium',
32
32
  customClass: ''
33
- };
34
- Stencils.propTypesDescription = {
35
- shape: ' ',
36
- size: ' ',
37
- palette: ' '
38
- };
33
+ }; // Stencils.propTypesDescription = {
34
+ // shape: ' ',
35
+ // size: ' ',
36
+ // palette: ' '
37
+ // };
39
38
 
40
39
  if (false) {
41
40
  Stencils.docs = {
@@ -1,4 +1,3 @@
1
- import "core-js/modules/web.url.to-json";
2
1
  import React from 'react';
3
2
  import Stencils from '../Stencils';
4
3
  import renderer from 'react-test-renderer';
package/es/Tab/Tab.js CHANGED
@@ -22,32 +22,33 @@ const tabTypes = {
22
22
  tab: 'tabDelta'
23
23
  }
24
24
  };
25
- export default function Tab({
26
- id,
27
- style,
28
- text,
29
- children,
30
- className,
31
- dataId,
32
- title,
33
- titlePosition,
34
- activeClass,
35
- href,
36
- isLink,
37
- isDisabled,
38
- tourId,
39
- onClick,
40
- isActive,
41
- getTabRef,
42
- onSelect,
43
- type,
44
- isAnimate,
45
- needBorder,
46
- needAppearance,
47
- align,
48
- isVirtual,
49
- customProps
50
- }) {
25
+ export default function Tab(_ref) {
26
+ let {
27
+ id,
28
+ style,
29
+ text,
30
+ children,
31
+ className,
32
+ dataId,
33
+ title,
34
+ titlePosition,
35
+ activeClass,
36
+ href,
37
+ isLink,
38
+ isDisabled,
39
+ tourId,
40
+ onClick,
41
+ isActive,
42
+ getTabRef,
43
+ onSelect,
44
+ type,
45
+ isAnimate,
46
+ needBorder,
47
+ needAppearance,
48
+ align,
49
+ isVirtual,
50
+ customProps
51
+ } = _ref;
51
52
  let clickListener = useCallback(event => {
52
53
  if (isLink && event && (event.metaKey || event.altKey || event.ctrlKey || event.shiftKey)) {
53
54
  event && event.stopPropagation();
@@ -4,20 +4,23 @@ import { Container } from '../Layout';
4
4
  import style from './TabContent.module.css';
5
5
  /* eslint-disable react/forbid-component-props */
6
6
 
7
- const TabContent = ({
8
- children,
9
- scroll,
10
- dataId,
11
- id
12
- }) => /*#__PURE__*/React.createElement(Container, {
13
- className: style.container,
14
- scroll: scroll,
15
- dataId: `${dataId}_TabContent`,
16
- isScrollAttribute: true,
17
- "aria-labelledby": id,
18
- tabindex: "0",
19
- role: "tabpanel"
20
- }, children);
7
+ const TabContent = _ref => {
8
+ let {
9
+ children,
10
+ scroll,
11
+ dataId,
12
+ id
13
+ } = _ref;
14
+ return /*#__PURE__*/React.createElement(Container, {
15
+ className: style.container,
16
+ scroll: scroll,
17
+ dataId: `${dataId}_TabContent`,
18
+ isScrollAttribute: true,
19
+ "aria-labelledby": id,
20
+ tabindex: "0",
21
+ role: "tabpanel"
22
+ }, children);
23
+ };
21
24
 
22
25
  TabContent.defaultProps = {
23
26
  dataId: 'tabContent'
@@ -3,20 +3,23 @@ import { PropTypes } from 'prop-types';
3
3
  import { Box } from '../Layout';
4
4
  /* eslint-disable react/forbid-component-props */
5
5
 
6
- const TabContentWrapper = ({
7
- style,
8
- className,
9
- children,
10
- dataId,
11
- selectedTab,
12
- onScroll
13
- }) => /*#__PURE__*/React.createElement(Box, {
14
- flexible: true,
15
- style: style,
16
- dataId: dataId,
17
- className: className,
18
- onScroll: onScroll
19
- }, React.Children.map(children, child => /*#__PURE__*/React.isValidElement(child) && child.props.id === selectedTab ? child : null));
6
+ const TabContentWrapper = _ref => {
7
+ let {
8
+ style,
9
+ className,
10
+ children,
11
+ dataId,
12
+ selectedTab,
13
+ onScroll
14
+ } = _ref;
15
+ return /*#__PURE__*/React.createElement(Box, {
16
+ flexible: true,
17
+ style: style,
18
+ dataId: dataId,
19
+ className: className,
20
+ onScroll: onScroll
21
+ }, React.Children.map(children, child => /*#__PURE__*/React.isValidElement(child) && child.props.id === selectedTab ? child : null));
22
+ };
20
23
 
21
24
  TabContentWrapper.defaultProps = {
22
25
  children: []
@@ -4,20 +4,21 @@ import React, { useState, useCallback } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import { Container } from '../Layout';
6
6
 
7
- function TabWrapper({
8
- defaultTab,
9
- hookToDisableInternalState,
10
- onSelect,
11
- type,
12
- isAnimate,
13
- needTabBorder,
14
- needBorder,
15
- needPadding,
16
- needAppearance,
17
- align,
18
- dataId,
19
- children
20
- }) {
7
+ function TabWrapper(_ref) {
8
+ let {
9
+ defaultTab,
10
+ hookToDisableInternalState,
11
+ onSelect,
12
+ type,
13
+ isAnimate,
14
+ needTabBorder,
15
+ needBorder,
16
+ needPadding,
17
+ needAppearance,
18
+ align,
19
+ dataId,
20
+ children
21
+ } = _ref;
21
22
  let [selectedTabInternal, setSelected] = useState(!hookToDisableInternalState ? defaultTab || 0 : null);
22
23
  const setSelectedTab = useCallback(id => {
23
24
  if (!hookToDisableInternalState) {
package/es/Tab/Tabs.js CHANGED
@@ -95,7 +95,8 @@ class Tabs extends React.Component {
95
95
  }
96
96
  }
97
97
 
98
- setMaxDim(totalDimension = 0) {
98
+ setMaxDim() {
99
+ let totalDimension = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
99
100
  let {
100
101
  selectedTab
101
102
  } = this.props; // let actual = Object.keys(tabDimensions).reduce(
@@ -1,4 +1,3 @@
1
- import "core-js/modules/web.url.to-json";
2
1
  import React from 'react';
3
2
  import TextBox from '../TextBox';
4
3
  import renderer from 'react-test-renderer';
@@ -101,7 +101,7 @@ export default class TextBoxIcon extends React.Component {
101
101
  alignBox: "row",
102
102
  isCover: false,
103
103
  className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? needEffect ? style.effect : style.readonly : style.effect} ${isActive || isFocus ? style.effectFocused : ''} ${customTBoxWrap} ${iconOnHover && (isReadOnly || isDisabled) ? style.iconOnHoverReadonly : iconOnHover && !(isReadOnly || isDisabled) ? style.iconOnHoverStyle : ''}`,
104
- "data-title": isDisabled ? title : ''
104
+ "data-title": isDisabled ? title : null
105
105
  }, /*#__PURE__*/React.createElement(Box, {
106
106
  flexible: true
107
107
  }, /*#__PURE__*/React.createElement(TextBox, _extends({}, this.props, {
@@ -1,4 +1,3 @@
1
- import "core-js/modules/web.url.to-json";
2
1
  import React from 'react';
3
2
  import TextBoxIcon from '../TextBoxIcon';
4
3
  import renderer from 'react-test-renderer'; // children: PropTypes.node,
@@ -1,4 +1,3 @@
1
- import "core-js/modules/web.url.to-json";
2
1
  import React from 'react';
3
2
  import Textarea from '../Textarea';
4
3
  import renderer from 'react-test-renderer';
@@ -1,4 +1,3 @@
1
- import "core-js/modules/es.string.replace";
2
1
  import React from 'react';
3
2
  import PropTypes from 'prop-types';
4
3
  import style from './Tooltip.module.css';
@@ -23,7 +23,7 @@ export default class VelocityAnimation extends React.Component {
23
23
  let {
24
24
  direction,
25
25
  isReducedMotion
26
- } = this.context;
26
+ } = this.context || {};
27
27
  let enterAnimationObj = {
28
28
  fade: 'transition.fadeIn',
29
29
  slideDown: 'slideDown',
@@ -41,7 +41,7 @@ export default class VelocityAnimationGroup extends React.Component {
41
41
  let {
42
42
  direction,
43
43
  isReducedMotion
44
- } = this.context;
44
+ } = this.context || {};
45
45
  let childProps = clearProps(this.props);
46
46
  let enterAnimationObj = {
47
47
  fade: 'transition.fadeIn',
@@ -225,7 +225,9 @@ function useFocusContainment(scopeRef, contain) {
225
225
  }, [raf]);
226
226
  }
227
227
 
228
- function isElementInAnyScope(element, scopes = []) {
228
+ function isElementInAnyScope(element) {
229
+ let scopes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
230
+
229
231
  for (let scope of scopes.values()) {
230
232
  if (isElementInScope(element, scope.current)) {
231
233
  return true;
@@ -235,11 +237,14 @@ function isElementInAnyScope(element, scopes = []) {
235
237
  return false;
236
238
  }
237
239
 
238
- function isElementInScope(element, scope = []) {
240
+ function isElementInScope(element) {
241
+ let scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
239
242
  return scope.some(node => node.contains(element));
240
243
  }
241
244
 
242
- function focusElement(element = null) {
245
+ function focusElement() {
246
+ let element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
247
+
243
248
  if (element != null) {
244
249
  element.focus();
245
250
  }
@@ -259,7 +264,8 @@ function findElement(elements) {
259
264
  return ele.length ? ele[0] : null;
260
265
  }
261
266
 
262
- function focusFirstInScope(scope = []) {
267
+ function focusFirstInScope() {
268
+ let scope = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
263
269
  let elements = getFocusableElementsInScope(scope, {
264
270
  tabbable: true
265
271
  });
@@ -16,7 +16,10 @@ const FOCUS_VISIBLE_INPUT_KEYS = {
16
16
  Escape: false
17
17
  };
18
18
 
19
- function triggerChangeHandlers(evType = eventFrom, e = eventType) {
19
+ function triggerChangeHandlers() {
20
+ let evType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : eventFrom;
21
+ let e = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : eventType;
22
+
20
23
  for (let handler of changeHandlers) {
21
24
  handler(evType, e);
22
25
  }
@@ -1,4 +1,3 @@
1
- import "core-js/modules/es.string.replace";
2
1
  //$Id$//
3
2
  import viewPort from '../Popup/viewPort';
4
3
  const {
@@ -39,11 +38,14 @@ export function encodeForHtml(str) {
39
38
 
40
39
  return str;
41
40
  }
42
- export function getListOfDetails(Obj = {}, fn) {
41
+ export function getListOfDetails() {
42
+ let Obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
43
+ let fn = arguments.length > 1 ? arguments[1] : undefined;
43
44
  const ids = Object.keys(Obj) || [];
44
45
  return ids.map(id => fn(Obj[id]));
45
46
  }
46
- export function capitalize(value = '') {
47
+ export function capitalize() {
48
+ let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
47
49
  let newValue = '';
48
50
 
49
51
  for (let i = 0; i < value.length; i++) {
@@ -56,12 +58,18 @@ export function capitalize(value = '') {
56
58
 
57
59
  return newValue;
58
60
  }
59
- export function bind(...handlers) {
61
+ export function bind() {
62
+ for (var _len = arguments.length, handlers = new Array(_len), _key = 0; _key < _len; _key++) {
63
+ handlers[_key] = arguments[_key];
64
+ }
65
+
60
66
  handlers.forEach(handler => {
61
67
  this[handler] = this[handler].bind(this);
62
68
  });
63
69
  }
64
- export function getFullName(firstName = '', lastName = '') {
70
+ export function getFullName() {
71
+ let firstName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
72
+ let lastName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
65
73
  let fullName = '';
66
74
 
67
75
  if (firstName !== null && firstName !== '') {
@@ -74,7 +82,8 @@ export function getFullName(firstName = '', lastName = '') {
74
82
 
75
83
  return fullName;
76
84
  }
77
- export function getStringifiedOutputForJson(input = {}) {
85
+ export function getStringifiedOutputForJson() {
86
+ let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
78
87
  const keys = Object.keys(input);
79
88
  const modifiedInput = keys.reduce((curr, next) => {
80
89
  const values = input[next] || [];
@@ -110,14 +119,19 @@ export function filterValue(obj, val) {
110
119
  });
111
120
  return result;
112
121
  }
113
- export function merge(oldObj = {}, newObj) {
122
+ export function merge() {
123
+ let oldObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
124
+ let newObj = arguments.length > 1 ? arguments[1] : undefined;
114
125
  const copyOfOld = Object.assign({}, oldObj);
115
126
  return Object.keys(newObj).reduce((res, key) => {
116
127
  res[key] = Object.assign({}, res[key] || {}, newObj[key]);
117
128
  return res;
118
129
  }, copyOfOld);
119
130
  }
120
- export function formatValue(values = [], valueField = 'id', textField = 'name') {
131
+ export function formatValue() {
132
+ let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
133
+ let valueField = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'id';
134
+ let textField = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'name';
121
135
  return values && values.map(value => {
122
136
  let formattedValue = value;
123
137
 
@@ -141,7 +155,8 @@ export function bytesToSize(bytes) {
141
155
  const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)), 10);
142
156
  return `${Math.round(bytes / Math.pow(1024, i), 2)} ${sizes[i]}`;
143
157
  }
144
- export function getMemSize(bytes, size = !0) {
158
+ export function getMemSize(bytes) {
159
+ let size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
145
160
  const thresh = size ? 1000 : 1024;
146
161
 
147
162
  if (Math.abs(bytes) < thresh) {
@@ -274,7 +289,11 @@ export const debounce = function (func, wait) {
274
289
  };
275
290
  };
276
291
  let timerId;
277
- export const throttle = (func, wait, ...args) => {
292
+ export const throttle = function (func, wait) {
293
+ for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
294
+ args[_key2 - 2] = arguments[_key2];
295
+ }
296
+
278
297
  if (timerId) {
279
298
  return;
280
299
  }
@@ -344,6 +363,7 @@ export function getElementSpace(elementRef) {
344
363
  availableInsideSpace: availableInsideSpace
345
364
  };
346
365
  }
347
- export function getSearchString(charachers = '') {
366
+ export function getSearchString() {
367
+ let charachers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
348
368
  return (charachers || '').toString().toLowerCase(); //.replace(/\s+/g, '');
349
369
  }
@@ -1,10 +1,11 @@
1
- import "core-js/modules/es.string.replace";
2
1
  let dateFormat = {
3
2
  dayNames: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
4
3
  monthNames: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
5
4
  timeNames: ['a', 'p', 'am', 'pm', 'A', 'P', 'AM', 'PM']
6
5
  };
7
- export function pad(n, width = 1, z) {
6
+ export function pad(n) {
7
+ let width = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
8
+ let z = arguments.length > 2 ? arguments[2] : undefined;
8
9
  z = z || '0';
9
10
  n = `${n}`;
10
11
  return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
@@ -76,7 +77,9 @@ export function replaceI18NValuesWithRegex(i18nStr, values) {
76
77
  export function unescapeUnicode(str) {
77
78
  return str.replace(/\\u([a-fA-F0-9]{4})/g, (g, m1) => String.fromCharCode(parseInt(m1, 16)));
78
79
  }
79
- export function getValues(params = [], diff) {
80
+ export function getValues() {
81
+ let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
82
+ let diff = arguments.length > 1 ? arguments[1] : undefined;
80
83
  return params.map(param => diff[param]);
81
84
  }
82
85
  export function getI18NValue(i18n) {
@@ -377,11 +377,12 @@ export const makeGetOptionIdChange = () => createSelector([getOptions, getValueF
377
377
  return changedOptions;
378
378
  }, newOptions);
379
379
  });
380
- export const filterSelectedOptions = ({
381
- selectedOptions = dummyArray,
382
- propSelectedOptions = dummyArray,
383
- disabledOptions = dummyArray
384
- } = {}) => {
380
+ export const filterSelectedOptions = function () {
381
+ let {
382
+ selectedOptions = dummyArray,
383
+ propSelectedOptions = dummyArray,
384
+ disabledOptions = dummyArray
385
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
385
386
  // eslint-disable-next-line no-param-reassign
386
387
  selectedOptions = selectedOptions || dummyArray; // eslint-disable-next-line no-param-reassign
387
388
 
@@ -405,4 +406,42 @@ export const filterSelectedOptions = ({
405
406
  return {
406
407
  newSelectedOptions: [...oldValidSelectedOptions, ...newlyAddedOptions]
407
408
  };
408
- };
409
+ };
410
+ export const makeGetIsShowClearIcon = () => createSelector([getSelectedOptionsSel, getDisabledOptions], (selectedOptions, disabledOptions) => {
411
+ let countForShowClear = 2;
412
+ let enabledOptionsLength = 0;
413
+ let isShowClearIcon = selectedOptions.length >= countForShowClear;
414
+
415
+ if (disabledOptions.length) {
416
+ let isHaveEnabledOptions = false;
417
+ let isAllDisabled = disabledOptions.length === selectedOptions.length;
418
+
419
+ if (!isAllDisabled) {
420
+ isHaveEnabledOptions = selectedOptions.some(option => {
421
+ let {
422
+ isDisabled = false
423
+ } = option || {};
424
+
425
+ if (!isDisabled) {
426
+ enabledOptionsLength += 1;
427
+
428
+ if (enabledOptionsLength === countForShowClear) {
429
+ return true;
430
+ }
431
+
432
+ return false;
433
+ }
434
+
435
+ return false;
436
+ });
437
+ }
438
+
439
+ return {
440
+ isShowClearIcon: isAllDisabled ? !isAllDisabled : isHaveEnabledOptions
441
+ };
442
+ }
443
+
444
+ return {
445
+ isShowClearIcon
446
+ };
447
+ });
@@ -1,4 +1,6 @@
1
- export function getInitial(firstName = '', lastName = '') {
1
+ export function getInitial() {
2
+ let firstName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
3
+ let lastName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
2
4
  let initial = '';
3
5
 
4
6
  if (firstName) {