@zohodesk/components 1.0.0-alpha-226 → 1.0.0-alpha-229

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 (68) hide show
  1. package/README.md +20 -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 +10 -10
  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/DateTime/DateWidget.module.css +0 -4
  10. package/es/DropBox/DropBox.js +2 -2
  11. package/es/ListItem/ListContainer.js +3 -8
  12. package/es/MultiSelect/AdvancedGroupMultiSelect.js +7 -4
  13. package/es/MultiSelect/AdvancedMultiSelect.js +21 -7
  14. package/es/MultiSelect/AdvancedMultiSelect.module.css +8 -8
  15. package/es/MultiSelect/MultiSelect.js +18 -7
  16. package/es/MultiSelect/MultiSelect.module.css +8 -13
  17. package/es/MultiSelect/MultiSelectWithAvatar.js +6 -3
  18. package/es/MultiSelect/SelectedOptions.js +3 -2
  19. package/es/PopOver/PopOver.js +19 -20
  20. package/es/Popup/Popup.js +1 -1
  21. package/es/Radio/Radio.js +1 -2
  22. package/es/Radio/Radio.module.css +2 -2
  23. package/es/Ribbon/Ribbon.js +8 -8
  24. package/es/RippleEffect/RippleEffect.js +7 -4
  25. package/es/RippleEffect/RippleEffect.module.css +3 -0
  26. package/es/Select/Select.module.css +1 -1
  27. package/es/Select/SelectWithAvatar.js +7 -4
  28. package/es/Stencils/Stencils.js +5 -6
  29. package/es/Tag/Tag.js +10 -4
  30. package/es/Tag/Tag.module.css +14 -11
  31. package/es/TextBoxIcon/TextBoxIcon.js +1 -1
  32. package/es/TextBoxIcon/TextBoxIcon.module.css +5 -2
  33. package/es/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +1 -1
  34. package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +1 -1
  35. package/es/utils/dropDownUtils.js +39 -1
  36. package/lib/Animation/Animation.js +7 -8
  37. package/lib/Avatar/Avatar.js +10 -10
  38. package/lib/Button/Button.js +15 -16
  39. package/lib/Button/Button.module.css +6 -2
  40. package/lib/Card/Card.js +4 -5
  41. package/lib/DateTime/DateWidget.module.css +0 -4
  42. package/lib/DropBox/DropBox.js +6 -2
  43. package/lib/ListItem/ListContainer.js +3 -8
  44. package/lib/MultiSelect/AdvancedGroupMultiSelect.js +7 -4
  45. package/lib/MultiSelect/AdvancedMultiSelect.js +21 -6
  46. package/lib/MultiSelect/AdvancedMultiSelect.module.css +8 -8
  47. package/lib/MultiSelect/MultiSelect.js +18 -6
  48. package/lib/MultiSelect/MultiSelect.module.css +8 -13
  49. package/lib/MultiSelect/MultiSelectWithAvatar.js +6 -3
  50. package/lib/MultiSelect/SelectedOptions.js +3 -2
  51. package/lib/PopOver/PopOver.js +19 -20
  52. package/lib/Popup/Popup.js +32 -29
  53. package/lib/Radio/Radio.js +1 -3
  54. package/lib/Radio/Radio.module.css +2 -2
  55. package/lib/Ribbon/Ribbon.js +8 -8
  56. package/lib/RippleEffect/RippleEffect.js +7 -4
  57. package/lib/RippleEffect/RippleEffect.module.css +3 -0
  58. package/lib/Select/Select.module.css +1 -1
  59. package/lib/Select/SelectWithAvatar.js +7 -4
  60. package/lib/Stencils/Stencils.js +5 -6
  61. package/lib/Tag/Tag.js +10 -4
  62. package/lib/Tag/Tag.module.css +14 -11
  63. package/lib/TextBoxIcon/TextBoxIcon.js +1 -1
  64. package/lib/TextBoxIcon/TextBoxIcon.module.css +5 -2
  65. package/lib/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +5 -3
  66. package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +5 -3
  67. package/lib/utils/dropDownUtils.js +45 -2
  68. package/package.json +4 -4
package/README.md CHANGED
@@ -32,6 +32,26 @@ 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-229
36
+
37
+ - MultiSelect, AdvancedMultiSelect => disabledOption Clear icon handled properly
38
+
39
+ # 1.0.0-alpha-228
40
+
41
+ - Button => danger, primary loader color issue solved
42
+ # 1.0.0-alpha-227
43
+
44
+ - isReadOnly and needEffect prop added in Tag Component for read-only case
45
+ - needEffect prop added for the below components: ( This props has been added for read-only case )
46
+ => Advanced Group Multi Select
47
+ => Advanced Multi Select
48
+ => Multi Select
49
+ => Multi Select With Avatar
50
+ => Select With Avatar
51
+ - isReadonly prop added for SelectedOption component
52
+ - Read-only class added for TextBoxIcon component
53
+ - Removed click action in tag multi select component for read-only case
54
+ - Changed the cursor default to not-allowed in Radio component for read-only case
35
55
  # 1.0.0-alpha-226
36
56
 
37
57
  - ListContainer Implemented in => ListItem,ListItemWithAvatar,ListItemWithIcon,ListItemWithRadio,ListItemWithCheckBox
@@ -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 = {
@@ -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 = {
@@ -6,10 +6,6 @@
6
6
  .readOnly, .readOnly > input, .disabled {
7
7
  cursor: not-allowed;
8
8
  }
9
- .readOnly,
10
- .disabled {
11
- composes: readonly from '../common/common.module.css';
12
- }
13
9
  .enabled {
14
10
  cursor: pointer;
15
11
  }
@@ -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) {
@@ -855,7 +855,8 @@ class AdvancedGroupMultiSelect extends React.Component {
855
855
  i18nKeys,
856
856
  a11y,
857
857
  isSearchClearOnSelect,
858
- palette
858
+ palette,
859
+ needEffect
859
860
  } = this.props;
860
861
  let {
861
862
  clearText = 'Clear all'
@@ -884,7 +885,7 @@ class AdvancedGroupMultiSelect extends React.Component {
884
885
  let setAriaId = this.getNextAriaId();
885
886
  let ariaErrorId = this.getNextAriaId();
886
887
  return /*#__PURE__*/React.createElement("div", {
887
- className: `${style.wrapper} ${isDisabled ? style.disabled : ''}`,
888
+ className: `${style.wrapper} ${isDisabled ? style.disabled : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''}`,
888
889
  "data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
889
890
  "data-title": isDisabled ? title : '',
890
891
  onClick: this.handleInputFocus
@@ -1060,7 +1061,8 @@ AdvancedGroupMultiSelect.defaultProps = {
1060
1061
  isPadding: false,
1061
1062
  i18nKeys: {},
1062
1063
  a11y: {},
1063
- isSearchClearOnSelect: true
1064
+ isSearchClearOnSelect: true,
1065
+ needEffect: PropTypes.bool
1064
1066
  };
1065
1067
  AdvancedGroupMultiSelect.propTypes = {
1066
1068
  animationStyle: PropTypes.string,
@@ -1110,7 +1112,8 @@ AdvancedGroupMultiSelect.propTypes = {
1110
1112
  variant: PropTypes.string,
1111
1113
  htmlId: PropTypes.string,
1112
1114
  isSearchClearOnSelect: PropTypes.bool,
1113
- palette: PropTypes.oneOf(['default', 'dark'])
1115
+ palette: PropTypes.oneOf(['default', 'dark']),
1116
+ needEffect: true
1114
1117
  };
1115
1118
 
1116
1119
  if (false) {
@@ -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
 
@@ -349,7 +352,9 @@ export class AdvancedMultiSelectComponent extends MultiSelectComponent {
349
352
  borderColor,
350
353
  isBoxPaddingNeed,
351
354
  getFooter,
352
- customProps
355
+ customProps,
356
+ needEffect,
357
+ disabledOptions
353
358
  } = this.props;
354
359
  let {
355
360
  SuggestionsProps = {},
@@ -381,8 +386,15 @@ export class AdvancedMultiSelectComponent extends MultiSelectComponent {
381
386
  const moreCount = allselectedOptionIdsLen - showedSelectedOptionsCount;
382
387
  const setAriaId = this.getNextAriaId();
383
388
  const ariaErrorId = this.getNextAriaId();
389
+ let {
390
+ isShowClearIcon: isShowClear
391
+ } = this.getIsShowClearIcon({
392
+ selectedOptions,
393
+ disabledOptions
394
+ });
395
+ let isShowClearIcon = !isReadOnly && !isDisabled && isShowClear;
384
396
  return /*#__PURE__*/React.createElement("div", {
385
- className: `${style.wrapper} ${isDisabled ? style.disabled : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''}`,
397
+ className: `${style.wrapper} ${isDisabled ? style.disabled : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''}`,
386
398
  "data-id": dataIdMultiSelectComp,
387
399
  "data-title": isDisabled ? title : '',
388
400
  onClick: this.handleInputFocus
@@ -430,7 +442,7 @@ export class AdvancedMultiSelectComponent extends MultiSelectComponent {
430
442
  ariaDescribedby: ariaErrorId
431
443
  },
432
444
  autoComplete: false
433
- })), !isReadOnly && !isDisabled && selectedOptions.length > 1 ? /*#__PURE__*/React.createElement(Box, {
445
+ })), isShowClearIcon ? /*#__PURE__*/React.createElement(Box, {
434
446
  className: style.delete,
435
447
  dataId: dataIdClearIcon,
436
448
  "data-title": clearText,
@@ -525,6 +537,7 @@ AdvancedMultiSelectComponent.propTypes = {
525
537
  //For grouping multiSelect
526
538
  getPublicMethods: PropTypes.func,
527
539
  optionType: PropTypes.oneOf(['default', 'avatar', 'icon']),
540
+ needEffect: PropTypes.bool,
528
541
  animationStyle: PropTypes.string,
529
542
  defaultDropBoxPosition: PropTypes.oneOf(['bottom', 'top', 'left', 'right']),
530
543
  dropBoxSize: PropTypes.oneOf(['small', 'medium', 'large']),
@@ -599,7 +612,8 @@ AdvancedMultiSelectComponent.defaultProps = {
599
612
  borderColor: 'default',
600
613
  isBoxPaddingNeed: true,
601
614
  isSearchClearOnSelect: true,
602
- customProps: {}
615
+ customProps: {},
616
+ needEffect: true
603
617
  };
604
618
  AdvancedMultiSelectComponent.displayName = 'AdvancedMultiSelect';
605
619
  const AdvancedMultiSelect = Popup(AdvancedMultiSelectComponent);
@@ -1,8 +1,8 @@
1
1
  .wrapper {
2
2
  position: relative;
3
3
  }
4
- .disabled {
5
- composes: disabled from '../common/common.module.css';
4
+ .disabled, .readOnly {
5
+ cursor: not-allowed;
6
6
  }
7
7
  .container {
8
8
  max-height: var(--zd_size120);
@@ -16,28 +16,28 @@
16
16
  .borderColor_transparent {
17
17
  border-bottom-color: var(--zdt_advancedmultiselect_transparent_border);
18
18
  }
19
- .borderColor_transparent:hover {
19
+ .effect .borderColor_transparent:hover {
20
20
  border-bottom-color: var(--zdt_advancedmultiselect_transparent_hover_border);
21
21
  }
22
- .borderColor_transparent.active {
22
+ .effect .borderColor_transparent.active {
23
23
  border-bottom-color: var(--zdt_advancedmultiselect_transparent_active_border);
24
24
  }
25
25
  .borderColor_default {
26
26
  border-bottom-color: var(--zdt_advancedmultiselect_default_border);
27
27
  }
28
- .borderColor_default:hover {
28
+ .effect .borderColor_default:hover {
29
29
  border-bottom-color: var(--zdt_advancedmultiselect_default_hover_border);
30
30
  }
31
- .borderColor_default.active {
31
+ .effect .borderColor_default.active {
32
32
  border-bottom-color: var(--zdt_advancedmultiselect_default_active_border);
33
33
  }
34
34
  .borderColor_dark {
35
35
  border-bottom-color: var(--zdt_advancedmultiselect_dark_border);
36
36
  }
37
- .borderColor_dark:hover {
37
+ .effect .borderColor_dark:hover {
38
38
  border-bottom-color: var(--zdt_advancedmultiselect_dark_hover_border);
39
39
  }
40
- .borderColor_dark.active {
40
+ .effect .borderColor_dark.active {
41
41
  border-bottom-color: var(--zdt_advancedmultiselect_dark_active_border);
42
42
  }
43
43
  [dir=ltr] .container.medium {
@@ -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();
@@ -870,7 +871,9 @@ export class MultiSelectComponent extends React.Component {
870
871
  a11y,
871
872
  children,
872
873
  customChildrenClass,
873
- getFooter
874
+ getFooter,
875
+ needEffect,
876
+ disabledOptions
874
877
  } = this.props;
875
878
  const {
876
879
  clearText = 'Clear all',
@@ -896,9 +899,15 @@ export class MultiSelectComponent extends React.Component {
896
899
  const suggestions = this.handleFilterSuggestions();
897
900
  const setAriaId = this.getNextAriaId();
898
901
  const ariaErrorId = this.getNextAriaId();
899
- const isShowClearIcon = !isReadOnly && !isDisabled && !disableAction && selectedOptions.length > 1;
902
+ let {
903
+ isShowClearIcon: isShowClear
904
+ } = this.getIsShowClearIcon({
905
+ selectedOptions,
906
+ disabledOptions
907
+ });
908
+ const isShowClearIcon = !isReadOnly && !isDisabled && !disableAction && isShowClear;
900
909
  return /*#__PURE__*/React.createElement("div", {
901
- className: `${style.wrapper} ${isDisabled ? style.disabled : ''} ${isReadOnly ? style.readOnly : ''} ${disableAction ? CssProvider('isBlock') : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''}`,
910
+ className: `${style.wrapper} ${isDisabled ? style.disabled : ''} ${isReadOnly ? style.readOnly : ''} ${disableAction ? CssProvider('isBlock') : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''}`,
902
911
  "data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
903
912
  "data-title": isDisabled ? title : '',
904
913
  onClick: this.handleInputFocus
@@ -1102,7 +1111,8 @@ MultiSelectComponent.propTypes = {
1102
1111
  children: PropTypes.node,
1103
1112
  customChildrenClass: PropTypes.string,
1104
1113
  disabledOptions: PropTypes.arrayOf(PropTypes.string),
1105
- getFooter: PropTypes.func
1114
+ getFooter: PropTypes.func,
1115
+ needEffect: PropTypes.bool
1106
1116
  };
1107
1117
  MultiSelectComponent.defaultProps = {
1108
1118
  animationStyle: 'bounce',
@@ -1132,7 +1142,8 @@ MultiSelectComponent.defaultProps = {
1132
1142
  a11y: {},
1133
1143
  textBoxClass: '',
1134
1144
  palette: 'default',
1135
- isSearchClearOnSelect: true
1145
+ isSearchClearOnSelect: true,
1146
+ needEffect: true
1136
1147
  };
1137
1148
 
1138
1149
  if (false) {
@@ -2,14 +2,9 @@
2
2
  position: relative;
3
3
  }
4
4
 
5
- .disabled {
6
- composes: disabled from '../common/common.module.css';
5
+ .disabled, .readOnly {
6
+ cursor: not-allowed;
7
7
  }
8
-
9
- .readOnly {
10
- composes: readonly from '../common/common.module.css';
11
- }
12
-
13
8
  .container {
14
9
  max-height: var(--zd_size120);
15
10
  composes: oflowy from '../common/common.module.css';
@@ -22,28 +17,28 @@
22
17
  .borderColor_transparent {
23
18
  border-bottom-color: var(--zdt_multiselect_transparent_border);
24
19
  }
25
- .borderColor_transparent:hover {
20
+ .effect .borderColor_transparent:hover {
26
21
  border-bottom-color: var(--zdt_multiselect_transparent_hover_border);
27
22
  }
28
- .borderColor_transparent.active {
23
+ .effect .borderColor_transparent.active {
29
24
  border-bottom-color: var(--zdt_multiselect_transparent_active_border);
30
25
  }
31
26
  .borderColor_default {
32
27
  border-bottom-color: var(--zdt_multiselect_default_border);
33
28
  }
34
- .borderColor_default:hover {
29
+ .effect .borderColor_default:hover {
35
30
  border-bottom-color: var(--zdt_multiselect_default_hover_border);
36
31
  }
37
- .borderColor_default.active {
32
+ .effect .borderColor_default.active {
38
33
  border-bottom-color: var(--zdt_multiselect_default_active_border);
39
34
  }
40
35
  .borderColor_dark {
41
36
  border-bottom-color: var(--zdt_multiselect_dark_border);
42
37
  }
43
- .borderColor_dark:hover {
38
+ .effect .borderColor_dark:hover {
44
39
  border-bottom-color: var(--zdt_multiselect_dark_hover_border);
45
40
  }
46
- .borderColor_dark.active {
41
+ .effect .borderColor_dark.active {
47
42
  border-bottom-color: var(--zdt_multiselect_dark_active_border);
48
43
  }
49
44
 
@@ -87,7 +87,8 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
87
87
  a11y,
88
88
  children,
89
89
  customChildrenClass,
90
- isBoxPaddingNeed
90
+ isBoxPaddingNeed,
91
+ needEffect
91
92
  } = this.props;
92
93
  const {
93
94
  clearText = 'Clear all'
@@ -115,7 +116,7 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
115
116
  const popUpState = !isReadOnly && !isDisabled && !disableAction && isPopupOpen;
116
117
  const isShowClearIcon = !isReadOnly && !isDisabled && !disableAction && selectedOptions.length > 1;
117
118
  return /*#__PURE__*/React.createElement("div", {
118
- className: ` ${style.wrapper} ${isDisabled ? style.disabled : ''} ${isReadOnly ? style.readOnly : ''} ${disableAction ? CssProvider('isBlock') : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''}`,
119
+ className: ` ${style.wrapper} ${isDisabled ? style.disabled : ''} ${isReadOnly ? style.readOnly : ''} ${disableAction ? CssProvider('isBlock') : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''}`,
119
120
  "data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
120
121
  "data-title": isDisabled ? title : '',
121
122
  onClick: this.handleInputFocus
@@ -288,6 +289,7 @@ MultiSelectWithAvatarComponent.propTypes = {
288
289
  palette: PropTypes.oneOf(['default', 'dark']),
289
290
  htmlId: PropTypes.string,
290
291
  isBoxPaddingNeed: PropTypes.bool,
292
+ needEffect: PropTypes.bool,
291
293
 
292
294
  /**** Popup props ****/
293
295
  isPopupOpen: PropTypes.bool,
@@ -337,7 +339,8 @@ MultiSelectWithAvatarComponent.defaultProps = {
337
339
  a11y: {},
338
340
  palette: 'default',
339
341
  isBoxPaddingNeed: true,
340
- isSearchClearOnSelect: true
342
+ isSearchClearOnSelect: true,
343
+ needEffect: true
341
344
  };
342
345
  MultiSelectWithAvatarComponent.displayName = 'MultiSelectWithAvatar';
343
346
  const MultiSelectWithAvatar = Popup(MultiSelectWithAvatarComponent);
@@ -37,13 +37,14 @@ export default class SelectedOptions extends React.PureComponent {
37
37
  } = option;
38
38
  const commonProps = {
39
39
  disabled: isDisabled,
40
- onRemove: isDisabled ? null : onRemove,
40
+ onRemove: isDisabled || isReadOnly ? null : onRemove,
41
41
  text: value,
42
42
  palette: isDarkPalette,
43
43
  onSelectTag: isReadOnly ? null : onSelect,
44
44
  getRef: getRef,
45
45
  initial: value,
46
- id: id
46
+ id: id,
47
+ isReadOnly: isReadOnly
47
48
  };
48
49
 
49
50
  if (optionType === 'avatar') {
@@ -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 = {