@zohodesk/components 1.0.0-alpha-227 → 1.0.0-alpha-230

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 (99) hide show
  1. package/README.md +12 -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 +11 -11
  6. package/es/Button/Button.js +15 -16
  7. package/es/Button/Button.module.css +6 -2
  8. package/es/Card/Card.js +4 -5
  9. package/es/DropBox/DropBox.js +2 -2
  10. package/es/ListItem/ListContainer.js +3 -8
  11. package/es/ListItem/ListItem.module.css +0 -1
  12. package/es/MultiSelect/AdvancedGroupMultiSelect.js +1 -1
  13. package/es/MultiSelect/AdvancedMultiSelect.js +17 -6
  14. package/es/MultiSelect/MultiSelect.js +21 -11
  15. package/es/MultiSelect/MultiSelectWithAvatar.js +1 -1
  16. package/es/PopOver/PopOver.js +19 -20
  17. package/es/Popup/Popup.js +1 -1
  18. package/es/Responsive/sizeObservers.js +8 -1
  19. package/es/Ribbon/Ribbon.js +8 -8
  20. package/es/Select/GroupSelect.js +1 -1
  21. package/es/Select/Select.js +4 -5
  22. package/es/Select/SelectWithAvatar.js +1 -1
  23. package/es/Select/SelectWithIcon.js +1 -1
  24. package/es/Stencils/Stencils.js +5 -6
  25. package/es/TextBoxIcon/TextBoxIcon.js +1 -1
  26. package/es/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +1 -1
  27. package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +1 -1
  28. package/es/utils/dropDownUtils.js +39 -1
  29. package/lib/Accordion/Accordion.js +1 -1
  30. package/lib/Accordion/AccordionItem.js +1 -1
  31. package/lib/Animation/Animation.js +8 -9
  32. package/lib/AppContainer/AppContainer.js +1 -1
  33. package/lib/Avatar/Avatar.js +12 -12
  34. package/lib/AvatarTeam/AvatarTeam.js +1 -1
  35. package/lib/Button/Button.js +16 -17
  36. package/lib/Button/Button.module.css +6 -2
  37. package/lib/Buttongroup/Buttongroup.js +1 -1
  38. package/lib/Card/Card.js +5 -6
  39. package/lib/CheckBox/CheckBox.js +1 -1
  40. package/lib/DateTime/CalendarView.js +1 -1
  41. package/lib/DateTime/DateTime.js +1 -1
  42. package/lib/DateTime/DateTimePopupFooter.js +1 -1
  43. package/lib/DateTime/DateTimePopupHeader.js +1 -1
  44. package/lib/DateTime/DateWidget.js +1 -1
  45. package/lib/DateTime/DaysRow.js +1 -1
  46. package/lib/DateTime/Time.js +1 -1
  47. package/lib/DateTime/YearView.js +1 -1
  48. package/lib/DropBox/DropBox.js +7 -3
  49. package/lib/DropDown/DropDown.js +1 -1
  50. package/lib/DropDown/DropDownHeading.js +1 -1
  51. package/lib/DropDown/DropDownItem.js +1 -1
  52. package/lib/DropDown/DropDownSearch.js +1 -1
  53. package/lib/DropDown/DropDownSeparator.js +1 -1
  54. package/lib/Label/Label.js +1 -1
  55. package/lib/ListItem/ListContainer.js +3 -8
  56. package/lib/ListItem/ListItem.js +1 -1
  57. package/lib/ListItem/ListItem.module.css +0 -1
  58. package/lib/ListItem/ListItemWithAvatar.js +1 -1
  59. package/lib/ListItem/ListItemWithCheckBox.js +1 -1
  60. package/lib/ListItem/ListItemWithIcon.js +1 -1
  61. package/lib/ListItem/ListItemWithRadio.js +1 -1
  62. package/lib/Modal/Modal.js +1 -1
  63. package/lib/Modal/__docs__/Modal__default.docs.js +1 -1
  64. package/lib/MultiSelect/AdvancedGroupMultiSelect.js +2 -2
  65. package/lib/MultiSelect/AdvancedMultiSelect.js +18 -6
  66. package/lib/MultiSelect/EmptyState.js +1 -1
  67. package/lib/MultiSelect/MultiSelect.js +22 -11
  68. package/lib/MultiSelect/MultiSelectHeader.js +1 -1
  69. package/lib/MultiSelect/MultiSelectWithAvatar.js +2 -2
  70. package/lib/MultiSelect/SelectedOptions.js +1 -1
  71. package/lib/MultiSelect/Suggestions.js +1 -1
  72. package/lib/PopOver/PopOver.js +20 -21
  73. package/lib/Popup/Popup.js +33 -30
  74. package/lib/Popup/__tests__/Popup.spec.js +1 -1
  75. package/lib/Provider.js +1 -1
  76. package/lib/Radio/Radio.js +1 -1
  77. package/lib/Responsive/ResizeComponent.js +1 -1
  78. package/lib/Responsive/Responsive.js +1 -1
  79. package/lib/Responsive/sizeObservers.js +9 -2
  80. package/lib/Ribbon/Ribbon.js +9 -9
  81. package/lib/Select/GroupSelect.js +2 -2
  82. package/lib/Select/Select.js +5 -6
  83. package/lib/Select/SelectWithAvatar.js +2 -2
  84. package/lib/Select/SelectWithIcon.js +2 -2
  85. package/lib/Stencils/Stencils.js +6 -7
  86. package/lib/Switch/Switch.js +1 -1
  87. package/lib/Tab/Tabs.js +1 -1
  88. package/lib/Tag/Tag.js +1 -1
  89. package/lib/TextBox/TextBox.js +1 -1
  90. package/lib/TextBoxIcon/TextBoxIcon.js +2 -2
  91. package/lib/Textarea/Textarea.js +1 -1
  92. package/lib/Tooltip/Tooltip.js +1 -1
  93. package/lib/Tooltip/__tests__/Tooltip.spec.js +1 -1
  94. package/lib/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +6 -4
  95. package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +6 -4
  96. package/lib/deprecated/PortalLayer/PortalLayer.js +1 -1
  97. package/lib/semantic/Button/Button.js +1 -1
  98. package/lib/utils/dropDownUtils.js +45 -2
  99. package/package.json +4 -4
package/README.md CHANGED
@@ -32,6 +32,18 @@ In this Package, we Provide Some Basic Components to Build Web App
32
32
  - TextBoxIcon
33
33
  - Tooltip
34
34
 
35
+ # 1.0.0-alpha-230
36
+
37
+ - Avatar, AdvancedGroupMultiSelect, AdvancedMultiSelect, MultiSelect, MultiSelectWithAvatar, GroupSelect, Select, SelectWithAvatar, SelectWithIcon, TextBoxIcon => Tooltip undefined case solved
38
+ - Select , MultiSelect => boxSize prop added
39
+
40
+ # 1.0.0-alpha-229
41
+
42
+ - MultiSelect, AdvancedMultiSelect => disabledOption Clear icon handled properly
43
+
44
+ # 1.0.0-alpha-228
45
+
46
+ - Button => danger, primary loader color issue solved
35
47
  # 1.0.0-alpha-227
36
48
 
37
49
  - isReadOnly and needEffect prop added in Tag Component for read-only case
@@ -66,6 +66,8 @@
66
66
  --zdt_button_tick_primary_border: var(--zdt_cta_secondary_text);
67
67
  --zdt_button_loading_default_bg: var(--dot_ebonyclay);
68
68
  --zdt_button_loading_linear_gradient: linear-gradient(0deg, rgba(255, 255, 255, 1) 50%, rgba(255, 255, 255, 0.9) 100%) 0% 0%, linear-gradient(90deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.6) 100%) 100% 0%, linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.3) 100%) 100% 100%, linear-gradient(360deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 100%) 0% 100%;
69
+ --zdt_button_loading_primary_linear_gradient: linear-gradient(0deg, rgba(71, 157, 255, 1) 50%, rgba(71, 157, 255, 0.9) 100%) 0% 0%, linear-gradient(90deg, rgba(71, 157, 255, 0.9) 0%, rgba(71, 157, 255, 0.6) 100%) 100% 0%, linear-gradient(180deg, rgba(71, 157, 255, 0.6) 0%, rgba(71, 157, 255, 0.3) 100%) 100% 100%, linear-gradient(360deg, rgba(71, 157, 255, 0.3) 0%, rgba(71, 157, 255, 0) 100%) 0% 100%;
70
+ --zdt_button_loading_danger_linear_gradient: linear-gradient(0deg, rgba(255, 107, 107, 1) 50%, rgba(255, 107, 107, 0.9) 100%) 0% 0%, linear-gradient(90deg, rgba(255, 107, 107, 0.9) 0%, rgba(255, 107, 107, 0.6) 100%) 100% 0%, linear-gradient(180deg, rgba(255, 107, 107, 0.6) 0%, rgba(255, 107, 107, 0.3) 100%) 100% 100%, linear-gradient(360deg, rgba(255, 107, 107, 0.3) 0%, rgba(255, 107, 107, 0) 100%) 0% 100%;
69
71
 
70
72
  /* button group */
71
73
  --zdt_buttongroup_default_bg: var(--dot_ebonyclay);
@@ -66,6 +66,8 @@
66
66
  --zdt_button_tick_primary_border: var(--zdt_cta_secondary_text);
67
67
  --zdt_button_loading_default_bg: var(--dot_white);
68
68
  --zdt_button_loading_linear_gradient: linear-gradient(0deg, rgba(255, 255, 255, 1) 50%, rgba(255, 255, 255, 0.9) 100%) 0% 0%, linear-gradient(90deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.6) 100%) 100% 0%, linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.3) 100%) 100% 100%, linear-gradient(360deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 100%) 0% 100%;
69
+ --zdt_button_loading_primary_linear_gradient: linear-gradient(0deg, rgba(10, 115, 235, 1) 50%, rgba(10, 115, 235, 0.9) 100%) 0% 0%, linear-gradient(90deg, rgba(10, 115, 235, 0.9) 0%, rgba(10, 115, 235, 0.6) 100%) 100% 0%, linear-gradient(180deg, rgba(10, 115, 235, 0.6) 0%, rgba(10, 115, 235, 0.3) 100%) 100% 100%, linear-gradient(360deg, rgba(10, 115, 235, 0.3) 0%, rgba(10, 115, 235, 0) 100%) 0% 100%;
70
+ --zdt_button_loading_danger_linear_gradient: linear-gradient(0deg, rgba(222, 53, 53, 1) 50%, rgba(222, 53, 53, 0.9) 100%) 0% 0%, linear-gradient(90deg, rgba(222, 53, 53, 0.9) 0%, rgba(222, 53, 53, 0.6) 100%) 100% 0%, linear-gradient(180deg, rgba(222, 53, 53, 0.6) 0%, rgba(222, 53, 53, 0.3) 100%) 100% 100%, linear-gradient(360deg, rgba(222, 53, 53, 0.3) 0%, rgba(222, 53, 53, 0) 100%) 0% 100%;
69
71
 
70
72
  /* button group */
71
73
  --zdt_buttongroup_default_bg: var(--dot_white);
@@ -139,14 +139,13 @@ Animation.defaultProps = {
139
139
  isActive: false,
140
140
  name: 'fadeIn',
141
141
  unmountOnExit: true
142
- };
143
- Animation.propTypesDescription = {
144
- name: ' ',
145
- children: ' ',
146
- enterDuration: ' ',
147
- exitDuration: ' ',
148
- isActive: ' '
149
- };
142
+ }; // Animation.propTypesDescription = {
143
+ // name: ' ',
144
+ // children: ' ',
145
+ // enterDuration: ' ',
146
+ // exitDuration: ' ',
147
+ // isActive: ' '
148
+ // };
150
149
 
151
150
  if (false) {
152
151
  Animation.docs = {
@@ -145,7 +145,7 @@ export default class Avatar extends React.Component {
145
145
  borderStyle = showAlternateAvatar ? '' : borderStyle;
146
146
  return /*#__PURE__*/React.createElement("div", _extends({
147
147
  className: `${style.avatar} ${style[size]} ${AvatarSize(size)} ${style[shapeStyle]} ${style[palette]} ${textStyle} ${borderStyle} ${customClass ? customClass : ''}`,
148
- "data-title": needTitle ? title ? title : name : '',
148
+ "data-title": needTitle ? title ? title : name : null,
149
149
  "data-id": dataId,
150
150
  onClick: onClick
151
151
  }, AvatarProps), showInitial && !showAlternateAvatar && /*#__PURE__*/React.createElement("span", {
@@ -197,16 +197,16 @@ Avatar.propTypes = {
197
197
  customProps: PropTypes.shape({
198
198
  AvatarProps: PropTypes.object
199
199
  })
200
- };
201
- Avatar.propTypesDescription = {
202
- name: ' ',
203
- size: ' ',
204
- src: ' ',
205
- palette: ' ',
206
- onClick: ' ',
207
- shape: ' ',
208
- title: ' '
209
- };
200
+ }; // Avatar.propTypesDescription = {
201
+ // name: ' ',
202
+ // size: ' ',
203
+ // src: ' ',
204
+ // palette: ' ',
205
+ // onClick: ' ',
206
+ // shape: ' ',
207
+ // title: ' '
208
+ // };
209
+
210
210
  Avatar.invalidImageURLs = [];
211
211
  Avatar.validImageURLs = [];
212
212
 
@@ -36,7 +36,7 @@ export default class Button extends React.Component {
36
36
  let paletteLower = palette.toLowerCase();
37
37
  let statusLower = status.toLowerCase();
38
38
  let classList = needAppearance ? `${style[paletteLower]} ${rounded ? style.rounded : ''} ${!children ? style[size.toLowerCase()] : `${style[`${size}Btn`]}
39
- ${rounded ? style[`${size}Btn${paletteLower}`] : ''}`}` : `${style.default}`;
39
+ ${rounded ? style[`${size}Btn${paletteLower}`] : ''}`} ${statusLower !== 'none' ? style.loader : ''}` : `${style.default}`;
40
40
  return /*#__PURE__*/React.createElement("button", {
41
41
  className: `${customButton} ${classList} ${isBold ? style.bold : ''} `,
42
42
  "data-id": disabled ? `${dataId}_disabled` : dataId,
@@ -45,12 +45,12 @@ export default class Button extends React.Component {
45
45
  "data-title": title,
46
46
  type: "button",
47
47
  ref: getRef
48
- }, children ? children : text, status !== 'none' && needAppearance && /*#__PURE__*/React.createElement("div", {
48
+ }, children ? children : text, statusLower !== 'none' && needAppearance && /*#__PURE__*/React.createElement("div", {
49
49
  className: style.overlay
50
50
  }, /*#__PURE__*/React.createElement("div", {
51
- className: `${customStatusSize} ${statusLower === 'loading' ? `${style.loading} ${style[`${size}loading`]}` : style.success}`
51
+ className: `${customStatusSize} ${statusLower === 'loading' ? `${style.loading} ${style[`${size}loading`] ? style[`${size}loading`] : ''}` : style.success}`
52
52
  }, /*#__PURE__*/React.createElement("div", {
53
- className: `${customStatus} ${statusLower === 'loading' ? `${style.loadingelement} ${style[`${paletteLower}element`]}` : `${style.successelement} ${style[`${paletteLower}success`]}`}`
53
+ className: `${customStatus} ${statusLower === 'loading' ? `${style.loadingelement} ${style[`${paletteLower}element`] ? style[`${paletteLower}element`] : ''}` : `${style.successelement} ${style[`${paletteLower}success`] ? style[`${paletteLower}success`] : ''}`}`
54
54
  }))));
55
55
  }
56
56
 
@@ -89,18 +89,17 @@ Button.propTypes = {
89
89
  customStatus: PropTypes.string,
90
90
  customStatusSize: PropTypes.string
91
91
  })
92
- };
93
- Button.propTypesDescription = {
94
- onClick: ' ',
95
- text: ' ',
96
- palette: ' ',
97
- disabled: ' ',
98
- size: ' ',
99
- rounded: ' ',
100
- status: ' ',
101
- isBold: ' ',
102
- children: ' '
103
- };
92
+ }; // Button.propTypesDescription = {
93
+ // onClick: ' ',
94
+ // text: ' ',
95
+ // palette: ' ',
96
+ // disabled: ' ',
97
+ // size: ' ',
98
+ // rounded: ' ',
99
+ // status: ' ',
100
+ // isBold: ' ',
101
+ // children: ' '
102
+ // };
104
103
 
105
104
  if (false) {
106
105
  Button.docs = {
@@ -362,17 +362,20 @@
362
362
 
363
363
  .primaryelement:before {
364
364
  --button_loading_bg_color: var(--zdt_button_primaryfill_bg);
365
+ --zdt_button_loading_linear_gradient:var(--zdt_button_loading_primary_linear_gradient);
365
366
  transform: rotateX(180deg);
366
367
  }
367
368
 
368
369
  .dangerelement:before {
369
370
  --button_loading_bg_color: var(--zdt_button_dangerfill_bg);
371
+ --zdt_button_loading_linear_gradient:var(--zdt_button_loading_danger_linear_gradient);
370
372
  transform: rotateX(180deg);
371
373
  }
372
374
 
373
375
  .primarysuccess {
374
376
  --button_success_border_color: var(--zdt_button_default_border);
375
377
  }
378
+
376
379
  .primaryfilled .successelement {
377
380
  --button_success_border_color: var(--zdt_button_tick_primary_border);
378
381
  }
@@ -456,7 +459,6 @@
456
459
  top: calc(var(--zd_size2) * -1);
457
460
  width: var(--zd_size6);
458
461
  transform: scaleX(-1) rotate(135deg);
459
- -ms-transform: scaleX(-1) rotate(135deg);
460
462
  -moz-transform: scaleX(-1) rotate(135deg);
461
463
  -webkit-transform: scaleX(-1) rotate(135deg);
462
464
  transform-origin: center;
@@ -515,4 +517,6 @@
515
517
  height: var(--zd_size15);
516
518
  width: var(--zd_size6);
517
519
  }
518
- }
520
+ }
521
+
522
+ .loader{color:var(--dot_mirror)}
package/es/Card/Card.js CHANGED
@@ -278,11 +278,10 @@ Card.defaultProps = {
278
278
  scrollAt: '10',
279
279
  a11y: {},
280
280
  isPercentageScroll: false
281
- };
282
- Card.propTypesDescription = {
283
- children: ' ',
284
- isScrollAttribute: ' '
285
- };
281
+ }; // Card.propTypesDescription = {
282
+ // children: ' ',
283
+ // isScrollAttribute: ' '
284
+ // };
286
285
 
287
286
  if (false) {
288
287
  Card.docs = {
@@ -66,7 +66,7 @@ export class DropBoxElement extends React.Component {
66
66
  } = this.props;
67
67
  let {
68
68
  isReducedMotion
69
- } = this.context;
69
+ } = this.context || {};
70
70
 
71
71
  if (!isAbsolutePositioningNeeded && size === 'default' && !isActive) {
72
72
  isAbsolutePositioningNeeded = true;
@@ -212,7 +212,7 @@ export default class DropBox extends React.Component {
212
212
  } : {};
213
213
  const {
214
214
  direction
215
- } = this.context;
215
+ } = this.context || {};
216
216
  const dropBoxEle = /*#__PURE__*/React.createElement(DropBoxElement, _extends({
217
217
  isModel: isModel,
218
218
  direction: direction
@@ -79,7 +79,7 @@ ListContainer.defaultProps = {
79
79
  target: 'blank',
80
80
  needBorder: true,
81
81
  a11y: {},
82
- customClass: {},
82
+ customClass: '',
83
83
  customProps: {}
84
84
  };
85
85
  export default ListContainer;
@@ -106,13 +106,8 @@ ListContainer.propTypes = {
106
106
  role: PropTypes.string,
107
107
  ariaSelected: PropTypes.bool
108
108
  }),
109
- customClass: PropTypes.shape({
110
- customListItem: PropTypes.string,
111
- customTickIcon: PropTypes.string
112
- }),
113
- customProps: PropTypes.shape({
114
- ListItemProps: PropTypes.object
115
- })
109
+ customClass: PropTypes.string,
110
+ customProps: PropTypes.object
116
111
  };
117
112
 
118
113
  if (false) {
@@ -70,7 +70,6 @@
70
70
  [dir=rtl] .large {
71
71
  --listitem_padding: var(--zd_size10) var(--zd_size25) var(--zd_size10) var(--zd_size3);
72
72
  }
73
-
74
73
  .value,
75
74
  .children {
76
75
  composes: dotted from '../common/common.module.css';
@@ -887,7 +887,7 @@ class AdvancedGroupMultiSelect extends React.Component {
887
887
  return /*#__PURE__*/React.createElement("div", {
888
888
  className: `${style.wrapper} ${isDisabled ? style.disabled : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''}`,
889
889
  "data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
890
- "data-title": isDisabled ? title : '',
890
+ "data-title": isDisabled ? title : null,
891
891
  onClick: this.handleInputFocus
892
892
  }, children ? /*#__PURE__*/React.createElement(Container, {
893
893
  align: "vertical",
@@ -23,7 +23,7 @@ import style from './AdvancedMultiSelect.module.css';
23
23
  /**** Methods ****/
24
24
 
25
25
  import { getIsEmptyValue, getSearchString } from '../utils/Common.js';
26
- import { filterSelectedOptions } from '../utils/dropDownUtils';
26
+ import { filterSelectedOptions, makeGetIsShowClearIcon } from '../utils/dropDownUtils';
27
27
  /* eslint-disable react/sort-prop-types */
28
28
 
29
29
  /* eslint-disable react/no-unused-prop-types */
@@ -45,6 +45,7 @@ export class AdvancedMultiSelectComponent extends MultiSelectComponent {
45
45
  this.state = Object.assign({}, oldState, {
46
46
  showedSelectedOptionsCount: !getIsEmptyValue(selectedOptionsLimit) && selectedOptionsLen > selectedOptionsLimit ? selectedOptionsLimit : selectedOptionsLen
47
47
  });
48
+ this.getIsShowClearIcon = makeGetIsShowClearIcon();
48
49
  this.handleFilterSuggestions = this.handleFilterSuggestions.bind(this);
49
50
  this.handleChange = this.handleChange.bind(this);
50
51
  this.handleSelectOption = this.handleSelectOption.bind(this);
@@ -191,7 +192,8 @@ export class AdvancedMultiSelectComponent extends MultiSelectComponent {
191
192
  imageField,
192
193
  optionType,
193
194
  iconName,
194
- iconSize
195
+ iconSize,
196
+ disabledOptions
195
197
  } = props;
196
198
  return this.formatSelectedOptions({
197
199
  options: selectedOptionDetails,
@@ -200,7 +202,8 @@ export class AdvancedMultiSelectComponent extends MultiSelectComponent {
200
202
  imageField,
201
203
  optionType,
202
204
  iconName,
203
- iconSize
205
+ iconSize,
206
+ disabledOptions
204
207
  });
205
208
  }
206
209
 
@@ -350,7 +353,8 @@ export class AdvancedMultiSelectComponent extends MultiSelectComponent {
350
353
  isBoxPaddingNeed,
351
354
  getFooter,
352
355
  customProps,
353
- needEffect
356
+ needEffect,
357
+ disabledOptions
354
358
  } = this.props;
355
359
  let {
356
360
  SuggestionsProps = {},
@@ -382,10 +386,17 @@ export class AdvancedMultiSelectComponent extends MultiSelectComponent {
382
386
  const moreCount = allselectedOptionIdsLen - showedSelectedOptionsCount;
383
387
  const setAriaId = this.getNextAriaId();
384
388
  const ariaErrorId = this.getNextAriaId();
389
+ let {
390
+ isShowClearIcon: isShowClear
391
+ } = this.getIsShowClearIcon({
392
+ selectedOptions,
393
+ disabledOptions
394
+ });
395
+ let isShowClearIcon = !isReadOnly && !isDisabled && isShowClear;
385
396
  return /*#__PURE__*/React.createElement("div", {
386
397
  className: `${style.wrapper} ${isDisabled ? style.disabled : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''}`,
387
398
  "data-id": dataIdMultiSelectComp,
388
- "data-title": isDisabled ? title : '',
399
+ "data-title": isDisabled ? title : null,
389
400
  onClick: this.handleInputFocus
390
401
  }, /*#__PURE__*/React.createElement(Container, {
391
402
  align: "vertical",
@@ -431,7 +442,7 @@ export class AdvancedMultiSelectComponent extends MultiSelectComponent {
431
442
  ariaDescribedby: ariaErrorId
432
443
  },
433
444
  autoComplete: false
434
- })), !isReadOnly && !isDisabled && selectedOptions.length > 1 ? /*#__PURE__*/React.createElement(Box, {
445
+ })), isShowClearIcon ? /*#__PURE__*/React.createElement(Box, {
435
446
  className: style.delete,
436
447
  dataId: dataIdClearIcon,
437
448
  "data-title": clearText,
@@ -23,7 +23,7 @@ import style from './MultiSelect.module.css';
23
23
  /**** Methods ****/
24
24
 
25
25
  import { debounce, scrollTo, bind, getIsEmptyValue, getSearchString } from '../utils/Common.js';
26
- import { makeFormatOptions, makeGetMultiSelectFilterSuggestions as makeGetFilterSuggestions, makeGetMultiSelectSelectedOptions as makeGetSelectedOptions, makeObjectConcat, filterSelectedOptions } from '../utils/dropDownUtils';
26
+ import { makeFormatOptions, makeGetMultiSelectFilterSuggestions as makeGetFilterSuggestions, makeGetMultiSelectSelectedOptions as makeGetSelectedOptions, makeObjectConcat, filterSelectedOptions, makeGetIsShowClearIcon } from '../utils/dropDownUtils';
27
27
  /* eslint-disable react/forbid-component-props */
28
28
 
29
29
  /* eslint-disable react/no-unused-prop-types */
@@ -35,7 +35,8 @@ export class MultiSelectComponent extends React.Component {
35
35
  this.getNextAriaId = getUniqueId(this);
36
36
  this.getFilterSuggestions = makeGetFilterSuggestions();
37
37
  this.formatOptions = makeFormatOptions();
38
- this.getSelectedOptions = makeGetSelectedOptions(); //Use in AdvancedMultiSelect component
38
+ this.getSelectedOptions = makeGetSelectedOptions();
39
+ this.getIsShowClearIcon = makeGetIsShowClearIcon(); //Use in AdvancedMultiSelect component
39
40
 
40
41
  this.objectConcat = makeObjectConcat();
41
42
  this.formatSelectedOptions = makeFormatOptions();
@@ -740,7 +741,7 @@ export class MultiSelectComponent extends React.Component {
740
741
  defaultDropBoxPosition,
741
742
  isReadOnly
742
743
  } = this.props;
743
- !isReadOnly && togglePopup(e, defaultDropBoxPosition ? `${defaultDropBoxPosition}Center` : null);
744
+ !isReadOnly && togglePopup(e, defaultDropBoxPosition ? `${defaultDropBoxPosition}` : null);
744
745
  }
745
746
 
746
747
  handlePopupClose(e) {
@@ -871,7 +872,9 @@ export class MultiSelectComponent extends React.Component {
871
872
  children,
872
873
  customChildrenClass,
873
874
  getFooter,
874
- needEffect
875
+ needEffect,
876
+ disabledOptions,
877
+ boxSize
875
878
  } = this.props;
876
879
  const {
877
880
  clearText = 'Clear all',
@@ -897,11 +900,17 @@ export class MultiSelectComponent extends React.Component {
897
900
  const suggestions = this.handleFilterSuggestions();
898
901
  const setAriaId = this.getNextAriaId();
899
902
  const ariaErrorId = this.getNextAriaId();
900
- const isShowClearIcon = !isReadOnly && !isDisabled && !disableAction && selectedOptions.length > 1;
903
+ let {
904
+ isShowClearIcon: isShowClear
905
+ } = this.getIsShowClearIcon({
906
+ selectedOptions,
907
+ disabledOptions
908
+ });
909
+ const isShowClearIcon = !isReadOnly && !isDisabled && !disableAction && isShowClear;
901
910
  return /*#__PURE__*/React.createElement("div", {
902
911
  className: `${style.wrapper} ${isDisabled ? style.disabled : ''} ${isReadOnly ? style.readOnly : ''} ${disableAction ? CssProvider('isBlock') : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''}`,
903
912
  "data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
904
- "data-title": isDisabled ? title : '',
913
+ "data-title": isDisabled ? title : null,
905
914
  onClick: this.handleInputFocus
906
915
  }, /*#__PURE__*/React.createElement(Container, {
907
916
  align: "vertical",
@@ -974,7 +983,7 @@ export class MultiSelectComponent extends React.Component {
974
983
  dataId: `${dataId}_children`
975
984
  }, children) : null)))), !isReadOnly && !isDisabled && !disableAction && isPopupOpen ? /*#__PURE__*/React.createElement(DropBox, {
976
985
  animationStyle: animationStyle,
977
- boxPosition: position || `${defaultDropBoxPosition}Center`,
986
+ boxPosition: position || `${defaultDropBoxPosition}`,
978
987
  getRef: getContainerRef,
979
988
  isActive: isPopupReady,
980
989
  isAnimate: isAnimate,
@@ -988,7 +997,8 @@ export class MultiSelectComponent extends React.Component {
988
997
  a11y: {
989
998
  role: 'listbox',
990
999
  ariaMultiselectable: true
991
- }
1000
+ },
1001
+ size: boxSize
992
1002
  }, /*#__PURE__*/React.createElement(Card, {
993
1003
  customClass: `${style.box} ${style[`${palette}Box`]}`,
994
1004
  onScroll: this.handleScroll
@@ -1033,7 +1043,7 @@ MultiSelectComponent.propTypes = {
1033
1043
  borderColor: PropTypes.oneOf(['transparent', 'default', 'dark']),
1034
1044
  closePopupOnly: PropTypes.func,
1035
1045
  dataId: PropTypes.string,
1036
- defaultDropBoxPosition: PropTypes.oneOf(['bottom', 'top', 'left', 'right']),
1046
+ defaultDropBoxPosition: PropTypes.string,
1037
1047
  disableAction: PropTypes.bool,
1038
1048
  dropBoxSize: PropTypes.oneOf(['small', 'medium', 'large']),
1039
1049
  emptyMessage: PropTypes.string.isRequired,
@@ -1104,12 +1114,12 @@ MultiSelectComponent.propTypes = {
1104
1114
  customChildrenClass: PropTypes.string,
1105
1115
  disabledOptions: PropTypes.arrayOf(PropTypes.string),
1106
1116
  getFooter: PropTypes.func,
1107
- needEffect: PropTypes.bool
1117
+ needEffect: PropTypes.bool,
1118
+ boxSize: PropTypes.string
1108
1119
  };
1109
1120
  MultiSelectComponent.defaultProps = {
1110
1121
  animationStyle: 'bounce',
1111
1122
  dataId: 'multiSelect',
1112
- defaultDropBoxPosition: 'bottom',
1113
1123
  dropBoxSize: 'small',
1114
1124
  isAnimate: true,
1115
1125
  isDisabled: false,
@@ -118,7 +118,7 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
118
118
  return /*#__PURE__*/React.createElement("div", {
119
119
  className: ` ${style.wrapper} ${isDisabled ? style.disabled : ''} ${isReadOnly ? style.readOnly : ''} ${disableAction ? CssProvider('isBlock') : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''}`,
120
120
  "data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
121
- "data-title": isDisabled ? title : '',
121
+ "data-title": isDisabled ? title : null,
122
122
  onClick: this.handleInputFocus
123
123
  }, /*#__PURE__*/React.createElement(Container, {
124
124
  align: "vertical",
@@ -135,26 +135,25 @@ PopOver.propTypes = {
135
135
  size: PropTypes.string,
136
136
  togglePopup: PropTypes.func,
137
137
  top: PropTypes.string
138
- };
139
- PopOver.propTypesDescription = {
140
- right: ' ',
141
- left: ' ',
142
- top: ' ',
143
- bottom: ' ',
144
- arrowRight: ' ',
145
- arrowLeft: ' ',
146
- arrowTop: ' ',
147
- arrowBottom: ' ',
148
- arrowPosition: ' ',
149
- boxPosition: ' ',
150
- size: ' ',
151
- children: ' ',
152
- onPopupOpen: ' ',
153
- isPopupOpen: ' ',
154
- onPopupClose: ' ',
155
- getTargetRef: ' ',
156
- getContainerRef: ' '
157
- };
138
+ }; // PopOver.propTypesDescription = {
139
+ // right: ' ',
140
+ // left: ' ',
141
+ // top: ' ',
142
+ // bottom: ' ',
143
+ // arrowRight: ' ',
144
+ // arrowLeft: ' ',
145
+ // arrowTop: ' ',
146
+ // arrowBottom: ' ',
147
+ // arrowPosition: ' ',
148
+ // boxPosition: ' ',
149
+ // size: ' ',
150
+ // children: ' ',
151
+ // onPopupOpen: ' ',
152
+ // isPopupOpen: ' ',
153
+ // onPopupClose: ' ',
154
+ // getTargetRef: ' ',
155
+ // getContainerRef: ' '
156
+ // };
158
157
 
159
158
  if (false) {
160
159
  PopOver.docs = {
package/es/Popup/Popup.js CHANGED
@@ -422,7 +422,7 @@ const Popup = function (Component) {
422
422
  // isResizeHandling --->>> Window resize and dropBox resize
423
423
  const {
424
424
  direction
425
- } = this.context;
425
+ } = this.context || {};
426
426
  const {
427
427
  placeHolderElement,
428
428
  dropElement
@@ -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
@@ -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',
@@ -599,7 +599,7 @@ export class GroupSelectComponent extends PureComponent {
599
599
  return /*#__PURE__*/React.createElement("div", {
600
600
  className: `${style.container} ${style[`box_${size}`]} ${isReadOnly ? style.readonly : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${iconOnHover && (isReadOnly || isDisabled) ? style.iconOnHoverReadonly : iconOnHover && !(isReadOnly || isDisabled) ? style.iconOnHoverStyle : ''}`,
601
601
  "data-id": dataIdSlctComp,
602
- "data-title": isDisabled ? title : ''
602
+ "data-title": isDisabled ? title : null
603
603
  }, /*#__PURE__*/React.createElement("div", {
604
604
  className: `${className ? className : ''}`,
605
605
  onClick: isDisabled || isReadOnly ? null : this.togglePopup,
@@ -507,7 +507,7 @@ export class SelectComponent extends Component {
507
507
  onFocus,
508
508
  isPopupOpen
509
509
  } = this.props;
510
- !isReadOnly && togglePopup(e, defaultDropBoxPosition ? `${defaultDropBoxPosition}Center` : null);
510
+ !isReadOnly && togglePopup(e, defaultDropBoxPosition ? `${defaultDropBoxPosition}` : null);
511
511
  !isPopupOpen && typeof onFocus === 'function' && onFocus(e);
512
512
  }
513
513
 
@@ -743,7 +743,7 @@ export class SelectComponent extends Component {
743
743
  } = customProps;
744
744
  return /*#__PURE__*/React.createElement("div", {
745
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 : ''}`,
746
- "data-title": isDisabled ? title : ''
746
+ "data-title": isDisabled ? title : null
747
747
  }, /*#__PURE__*/React.createElement("div", {
748
748
  className: `${className ? className : ''}`,
749
749
  onClick: isDisabled || isReadOnly ? null : this.togglePopup,
@@ -835,7 +835,7 @@ export class SelectComponent extends Component {
835
835
  customProps: TextBoxProps
836
836
  })), !isReadOnly && !isDisabled && isPopupOpen ? /*#__PURE__*/React.createElement(DropBox, {
837
837
  animationStyle: animationStyle,
838
- boxPosition: position || `${defaultDropBoxPosition}Center`,
838
+ boxPosition: position || `${defaultDropBoxPosition}`,
839
839
  getRef: getContainerRef,
840
840
  isActive: isPopupReady,
841
841
  isAnimate: true,
@@ -912,7 +912,7 @@ SelectComponent.propTypes = {
912
912
  className: PropTypes.string,
913
913
  closePopupOnly: PropTypes.func,
914
914
  dataId: PropTypes.string,
915
- defaultDropBoxPosition: PropTypes.oneOf(['bottom', 'top', 'left', 'right']),
915
+ defaultDropBoxPosition: PropTypes.string,
916
916
  dropBoxSize: PropTypes.oneOf(['small', 'medium', 'large']),
917
917
  emptyMessage: PropTypes.string,
918
918
  excludeOptions: PropTypes.array,
@@ -992,7 +992,6 @@ SelectComponent.defaultProps = {
992
992
  animationStyle: 'bounce',
993
993
  autoSelectOnType: true,
994
994
  dataId: 'selectComponent',
995
- defaultDropBoxPosition: 'bottom',
996
995
  dropBoxSize: 'small',
997
996
  isDefaultSelectValue: true,
998
997
  isDisabled: false,
@@ -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,