@zohodesk/components 1.0.0-temp-199.11 → 1.0.0-temp-220

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 (79) hide show
  1. package/.cli/propValidation_report.html +1 -1
  2. package/README.md +19 -0
  3. package/assets/Appearance/dark/mode/Component_DarkMode.module.css +8 -0
  4. package/assets/Appearance/light/mode/Component_LightMode.module.css +8 -0
  5. package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +8 -0
  6. package/es/Button/__tests__/__snapshots__/Button.spec.js.snap +2 -2
  7. package/es/Button/css/Button.module.css +57 -10
  8. package/es/Button/css/cssJSLogic.js +1 -1
  9. package/es/Button/props/propTypes.js +1 -1
  10. package/es/ListItem/ListContainer.js +2 -3
  11. package/es/ListItem/ListItem.js +2 -3
  12. package/es/ListItem/ListItem.module.css +2 -11
  13. package/es/ListItem/ListItemWithAvatar.js +3 -3
  14. package/es/ListItem/ListItemWithIcon.js +2 -3
  15. package/es/ListItem/props/defaultProps.js +1 -2
  16. package/es/ListItem/props/propTypes.js +1 -2
  17. package/es/MultiSelect/AdvancedGroupMultiSelect.js +14 -11
  18. package/es/MultiSelect/AdvancedMultiSelect.js +12 -6
  19. package/es/MultiSelect/MultiSelect.js +12 -11
  20. package/es/MultiSelect/MultiSelectWithAvatar.js +4 -2
  21. package/es/MultiSelect/Suggestions.js +2 -9
  22. package/es/MultiSelect/__tests__/AdvancedMultiSelect.spec.js +28 -0
  23. package/es/MultiSelect/__tests__/__snapshots__/AdvancedMultiSelect.spec.js.snap +390 -0
  24. package/es/MultiSelect/props/defaultProps.js +8 -9
  25. package/es/MultiSelect/props/propTypes.js +5 -11
  26. package/es/Popup/Popup.js +19 -22
  27. package/es/RippleEffect/RippleEffect.module.css +16 -0
  28. package/es/RippleEffect/props/propTypes.js +1 -1
  29. package/es/Select/GroupSelect.js +5 -7
  30. package/es/Select/Select.js +3 -1
  31. package/es/Select/SelectWithAvatar.js +6 -9
  32. package/es/Select/SelectWithIcon.js +2 -4
  33. package/es/Select/props/defaultProps.js +5 -4
  34. package/es/Select/props/propTypes.js +7 -8
  35. package/es/Tag/Tag.js +1 -1
  36. package/es/Textarea/Textarea.js +1 -1
  37. package/es/Textarea/Textarea.module.css +8 -8
  38. package/es/Textarea/__tests__/Textarea.spec.js +18 -0
  39. package/es/Textarea/__tests__/__snapshots__/Textarea.spec.js.snap +67 -43
  40. package/es/common/common.module.css +0 -5
  41. package/es/utils/dropDownUtils.js +10 -6
  42. package/lib/Button/__tests__/__snapshots__/Button.spec.js.snap +2 -2
  43. package/lib/Button/css/Button.module.css +57 -10
  44. package/lib/Button/css/cssJSLogic.js +1 -1
  45. package/lib/Button/props/propTypes.js +1 -1
  46. package/lib/ListItem/ListContainer.js +2 -3
  47. package/lib/ListItem/ListItem.js +2 -3
  48. package/lib/ListItem/ListItem.module.css +2 -11
  49. package/lib/ListItem/ListItemWithAvatar.js +3 -3
  50. package/lib/ListItem/ListItemWithIcon.js +2 -3
  51. package/lib/ListItem/props/defaultProps.js +1 -2
  52. package/lib/ListItem/props/propTypes.js +1 -2
  53. package/lib/MultiSelect/AdvancedGroupMultiSelect.js +14 -12
  54. package/lib/MultiSelect/AdvancedMultiSelect.js +12 -6
  55. package/lib/MultiSelect/MultiSelect.js +11 -9
  56. package/lib/MultiSelect/MultiSelectWithAvatar.js +4 -2
  57. package/lib/MultiSelect/Suggestions.js +3 -8
  58. package/lib/MultiSelect/__tests__/AdvancedMultiSelect.spec.js +28 -0
  59. package/lib/MultiSelect/__tests__/__snapshots__/AdvancedMultiSelect.spec.js.snap +390 -0
  60. package/lib/MultiSelect/props/defaultProps.js +8 -9
  61. package/lib/MultiSelect/props/propTypes.js +5 -11
  62. package/lib/Popup/Popup.js +20 -24
  63. package/lib/RippleEffect/RippleEffect.module.css +16 -0
  64. package/lib/RippleEffect/props/propTypes.js +1 -1
  65. package/lib/Select/GroupSelect.js +6 -6
  66. package/lib/Select/Select.js +3 -1
  67. package/lib/Select/SelectWithAvatar.js +7 -10
  68. package/lib/Select/SelectWithIcon.js +3 -5
  69. package/lib/Select/props/defaultProps.js +5 -4
  70. package/lib/Select/props/propTypes.js +7 -8
  71. package/lib/Tag/Tag.js +1 -1
  72. package/lib/Textarea/Textarea.js +1 -1
  73. package/lib/Textarea/Textarea.module.css +8 -8
  74. package/lib/Textarea/__tests__/Textarea.spec.js +20 -2
  75. package/lib/Textarea/__tests__/__snapshots__/Textarea.spec.js.snap +67 -43
  76. package/lib/common/common.module.css +0 -5
  77. package/lib/utils/dropDownUtils.js +12 -6
  78. package/package.json +5 -5
  79. package/result.json +1 -1
@@ -170,10 +170,12 @@ export class GroupSelectComponent extends PureComponent {
170
170
 
171
171
  handleGetGroupSelectOptions(props) {
172
172
  let {
173
- groupedOptions
173
+ groupedOptions,
174
+ allowValueFallback
174
175
  } = props;
175
176
  return this.getGroupSelectOptions({
176
- groupedOptions
177
+ groupedOptions,
178
+ allowValueFallback
177
179
  });
178
180
  }
179
181
 
@@ -591,9 +593,6 @@ export class GroupSelectComponent extends PureComponent {
591
593
  dataSelectorId,
592
594
  customProps
593
595
  } = this.props;
594
- const {
595
- SuggestionsProps = {}
596
- } = customProps;
597
596
  i18nKeys = Object.assign({}, i18nKeys, {
598
597
  emptyText: i18nKeys.emptyText || emptyMessage,
599
598
  searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage
@@ -792,8 +791,7 @@ export class GroupSelectComponent extends PureComponent {
792
791
  ariaParentRole: 'listbox',
793
792
  role: 'option'
794
793
  },
795
- dataId: `${dataId}_Options`,
796
- ...SuggestionsProps
794
+ dataId: `${dataId}_Options`
797
795
  }));
798
796
  }) : /*#__PURE__*/React.createElement(EmptyState, {
799
797
  options: revampedGroups,
@@ -250,6 +250,7 @@ export class SelectComponent extends Component {
250
250
  options,
251
251
  valueField,
252
252
  textField,
253
+ allowValueFallback,
253
254
  customProps = {}
254
255
  } = props;
255
256
  let {
@@ -259,7 +260,8 @@ export class SelectComponent extends Component {
259
260
  options,
260
261
  valueField,
261
262
  textField,
262
- listItemProps
263
+ listItemProps,
264
+ allowValueFallback
263
265
  });
264
266
  }
265
267
 
@@ -40,14 +40,16 @@ class SelectWithAvatarComponent extends SelectComponent {
40
40
  options,
41
41
  valueField,
42
42
  textField,
43
- imageField
43
+ imageField,
44
+ allowValueFallback
44
45
  } = props;
45
46
  return this.formatOptions({
46
47
  options,
47
48
  valueField,
48
49
  textField,
49
50
  imageField,
50
- optionType: 'avatar'
51
+ optionType: 'avatar',
52
+ allowValueFallback
51
53
  });
52
54
  }
53
55
 
@@ -163,12 +165,8 @@ class SelectWithAvatarComponent extends SelectComponent {
163
165
  needEffect,
164
166
  isLoading,
165
167
  dataSelectorId,
166
- getTargetRef,
167
- customProps
168
+ getTargetRef
168
169
  } = this.props;
169
- const {
170
- SuggestionsProps = {}
171
- } = customProps;
172
170
  i18nKeys = Object.assign({}, i18nKeys, {
173
171
  emptyText: i18nKeys.emptyText || emptyMessage,
174
172
  searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage
@@ -325,8 +323,7 @@ class SelectWithAvatarComponent extends SelectComponent {
325
323
  a11y: {
326
324
  ariaParentRole: 'listbox',
327
325
  role: 'option'
328
- },
329
- ...SuggestionsProps
326
+ }
330
327
  }) : /*#__PURE__*/React.createElement(EmptyState, {
331
328
  isLoading: isFetchingOptions,
332
329
  options: options,
@@ -367,8 +367,7 @@ class SelectWithIcon extends Component {
367
367
  let {
368
368
  TextBoxProps = {},
369
369
  DropdownSearchTextBoxProps = {},
370
- TextBoxIconProps = {},
371
- ListItemProps = {}
370
+ TextBoxIconProps = {}
372
371
  } = customProps;
373
372
  return /*#__PURE__*/React.createElement("div", {
374
373
  className: `${style.container} ${style[`box_${size}`]} ${isReadOnly ? style.readonly : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''}`,
@@ -531,8 +530,7 @@ class SelectWithIcon extends Component {
531
530
  role: 'option',
532
531
  ariaSelected: selectedId === options[idKey],
533
532
  ariaLabel: options[valueKey]
534
- },
535
- ...ListItemProps
533
+ }
536
534
  });
537
535
  })) : /*#__PURE__*/React.createElement(EmptyState, {
538
536
  isLoading: isFetchingOptions,
@@ -33,7 +33,8 @@ export const Select_defaultProps = {
33
33
  iconOnHover: false,
34
34
  customProps: {},
35
35
  isLoading: false,
36
- isAbsolutePositioningNeeded: true
36
+ isAbsolutePositioningNeeded: true,
37
+ allowValueFallback: true
37
38
  };
38
39
  export const GroupSelect_defaultProps = {
39
40
  animationStyle: 'bounce',
@@ -70,7 +71,8 @@ export const GroupSelect_defaultProps = {
70
71
  i18nKeys: {},
71
72
  iconOnHover: false,
72
73
  isLoading: false,
73
- customProps: {}
74
+ customProps: {},
75
+ allowValueFallback: true
74
76
  };
75
77
  export const SelectWithAvatar_defaultProps = {
76
78
  animationStyle: 'bounce',
@@ -96,8 +98,7 @@ export const SelectWithAvatar_defaultProps = {
96
98
  isRestrictScroll: false,
97
99
  i18nKeys: {},
98
100
  needEffect: true,
99
- isLoading: false,
100
- customProps: {}
101
+ isLoading: false
101
102
  };
102
103
  export const SelectWithIcon_defaultProps = {
103
104
  isReadOnly: false,
@@ -93,7 +93,8 @@ export const Select_propTypes = {
93
93
  positionsOffset: PropTypes.object,
94
94
  targetOffset: PropTypes.object,
95
95
  isRestrictScroll: PropTypes.bool,
96
- dropBoxPortalId: PropTypes.string
96
+ dropBoxPortalId: PropTypes.string,
97
+ allowValueFallback: PropTypes.bool
97
98
  };
98
99
  export const GroupSelect_propTypes = {
99
100
  groupedOptions: PropTypes.arrayOf(PropTypes.shape({
@@ -177,9 +178,9 @@ export const GroupSelect_propTypes = {
177
178
  isDefaultSelectValue: PropTypes.bool,
178
179
  customProps: PropTypes.shape({
179
180
  TextBoxProps: PropTypes.object,
180
- TextBoxIconProps: PropTypes.object,
181
- suggestionsProps: PropTypes.object
182
- })
181
+ TextBoxIconProps: PropTypes.object
182
+ }),
183
+ allowValueFallback: PropTypes.bool
183
184
  };
184
185
  export const SelectWithAvatar_propTypes = { ...Select_propTypes,
185
186
  textBoxClass: PropTypes.string,
@@ -240,8 +241,7 @@ export const SelectWithAvatar_propTypes = { ...Select_propTypes,
240
241
  htmlId: PropTypes.string,
241
242
  needEffect: PropTypes.bool,
242
243
  isLoading: PropTypes.bool,
243
- dataSelectorId: PropTypes.string,
244
- customProps: PropTypes.object
244
+ dataSelectorId: PropTypes.string
245
245
  };
246
246
  export const SelectWithIcon_propTypes = {
247
247
  animationStyle: PropTypes.oneOf(['default', 'bounce']),
@@ -303,7 +303,6 @@ export const SelectWithIcon_propTypes = {
303
303
  customProps: PropTypes.shape({
304
304
  TextBoxProps: PropTypes.object,
305
305
  DropdownSearchTextBoxProps: PropTypes.object,
306
- TextBoxIconProps: PropTypes.object,
307
- ListItemProps: PropTypes.object
306
+ TextBoxIconProps: PropTypes.object
308
307
  })
309
308
  };
package/es/Tag/Tag.js CHANGED
@@ -47,7 +47,7 @@ export default class Tag extends PureComponent {
47
47
  e && e.preventDefault();
48
48
  e.stopPropagation && e.stopPropagation();
49
49
  e.nativeEvent.stopImmediatePropagation && e.nativeEvent.stopImmediatePropagation();
50
- onRemove && onRemove(id);
50
+ onRemove && onRemove(id, e);
51
51
  }
52
52
 
53
53
  getRef(el) {
@@ -89,7 +89,7 @@ export default class Textarea extends React.Component {
89
89
  }
90
90
 
91
91
  const isEditable = !(isReadOnly || isDisabled);
92
- let classList = needAppearance ? `${style.container} ${size !== 'default' ? style[size] : ''} ${style[variant]} ${needBorder ? style.needBorder : style.noBorder} ${resize ? style[resizes[resize]] : style[resizes.none]} ${animated && size !== 'default' ? `${style[`${size}animated`]}` : ''} ${isDisabled && !needEffect || isReadOnly && !needEffect ? '' : style.effect} ${isEditable && isFocus ? style.active : ''}` : `${style.basic}`;
92
+ let classList = needAppearance ? `${style.container} ${size !== 'default' ? style[size] : ''} ${!rows && size === 'default' ? style.defaultHeight : ''} ${!cols ? style.defaultWidth : ''} ${style[variant]} ${needBorder ? style.needBorder : style.noBorder} ${resize ? style[resizes[resize]] : style[resizes.none]} ${animated && size !== 'default' ? `${style[`${size}animated`]}` : ''} ${isDisabled && !needEffect || isReadOnly && !needEffect ? '' : style.effect} ${isEditable && isFocus ? style.active : ''}` : `${style.basic}`;
93
93
  return /*#__PURE__*/React.createElement("textarea", {
94
94
  "aria-label": ariaLabel,
95
95
  "aria-labelledby": ariaLabelledby,
@@ -92,6 +92,13 @@
92
92
  .effect:focus,.effect.active {
93
93
  --textarea_border_color: var(--zdt_textarea_focus_border);
94
94
  }
95
+
96
+ .defaultHeight{
97
+ --textarea_height: var(--zd_size30);
98
+ }
99
+ .defaultWidth {
100
+ --textarea_width: 100%;
101
+ }
95
102
  .xsmall,
96
103
  .xmedium {
97
104
  vertical-align: middle;
@@ -108,7 +115,7 @@
108
115
  --textarea_height: var(--zd_size25);
109
116
  --textarea_line_height: 1.3077;
110
117
  }
111
- .small {
118
+ .small{
112
119
  --textarea_height: var(--zd_size30);
113
120
  --textarea_padding: var(--zd_size2) 0;
114
121
  }
@@ -139,10 +146,3 @@
139
146
  composes: semibold from '../common/common.module.css';
140
147
  --textarea_text_color: var(--zdt_textarea_black_text);
141
148
  }
142
- .xsmall,
143
- .small,
144
- .xmedium,
145
- .medium,
146
- .large {
147
- --textarea_width: 100%;
148
- }
@@ -235,6 +235,24 @@ describe('Textarea component', () => {
235
235
  }));
236
236
  expect(asFragment()).toMatchSnapshot();
237
237
  });
238
+ test('Should be render rows only ', () => {
239
+ const {
240
+ asFragment
241
+ } = render( /*#__PURE__*/React.createElement(Textarea, {
242
+ size: "default",
243
+ rows: "3"
244
+ }));
245
+ expect(asFragment()).toMatchSnapshot();
246
+ });
247
+ test('Should be render cols only ', () => {
248
+ const {
249
+ asFragment
250
+ } = render( /*#__PURE__*/React.createElement(Textarea, {
251
+ size: "default",
252
+ cols: "3"
253
+ }));
254
+ expect(asFragment()).toMatchSnapshot();
255
+ });
238
256
  test('Should be render custom Attributes ', () => {
239
257
  const {
240
258
  asFragment