@zohodesk/components 1.4.17 → 1.4.18

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 (76) hide show
  1. package/README.md +27 -0
  2. package/es/Card/__tests__/Card.spec.js +48 -0
  3. package/es/Card/__tests__/CardContent.spec.js +61 -0
  4. package/es/Card/__tests__/CardHeader.spec.js +33 -0
  5. package/es/Card/__tests__/__snapshots__/Card.spec.js.snap +125 -0
  6. package/es/Card/__tests__/__snapshots__/CardContent.spec.js.snap +177 -0
  7. package/es/Card/__tests__/__snapshots__/CardHeader.spec.js.snap +51 -0
  8. package/es/ListItem/ListItem.js +10 -3
  9. package/es/ListItem/ListItemWithAvatar.js +15 -6
  10. package/es/ListItem/ListItemWithCheckBox.js +13 -6
  11. package/es/ListItem/ListItemWithIcon.js +14 -5
  12. package/es/ListItem/ListItemWithRadio.js +13 -6
  13. package/es/ListItem/__tests__/ListItem.spec.js +19 -0
  14. package/es/ListItem/__tests__/ListItemWithAvatar.spec.js +19 -0
  15. package/es/ListItem/__tests__/ListItemWithCheckBox.spec.js +19 -0
  16. package/es/ListItem/__tests__/ListItemWithIcon.spec.js +17 -0
  17. package/es/ListItem/__tests__/ListItemWithRadio.spec.js +19 -0
  18. package/es/ListItem/__tests__/__snapshots__/ListItem.spec.js.snap +78 -0
  19. package/es/ListItem/__tests__/__snapshots__/ListItemWithAvatar.spec.js.snap +140 -46
  20. package/es/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +251 -49
  21. package/es/ListItem/__tests__/__snapshots__/ListItemWithIcon.spec.js.snap +144 -50
  22. package/es/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +252 -52
  23. package/es/ListItem/props/propTypes.js +15 -5
  24. package/es/MultiSelect/MultiSelect.js +8 -1
  25. package/es/MultiSelect/Suggestions.js +2 -1
  26. package/es/MultiSelect/__tests__/__snapshots__/MultiSelectHeader.spec.js.snap +6 -6
  27. package/es/MultiSelect/props/propTypes.js +2 -3
  28. package/es/Select/GroupSelect.js +4 -2
  29. package/es/Select/Select.js +7 -1
  30. package/es/Select/SelectWithAvatar.js +17 -4
  31. package/es/Select/SelectWithIcon.js +15 -5
  32. package/es/Select/props/defaultProps.js +2 -0
  33. package/es/Select/props/propTypes.js +5 -0
  34. package/es/Typography/__tests__/Typography.spec.js +225 -0
  35. package/es/Typography/__tests__/__snapshots__/Typography.spec.js.snap +1226 -0
  36. package/es/utils/dropDownUtils.js +13 -4
  37. package/es/v1/Switch/__tests__/Switch.spec.js +41 -6
  38. package/es/v1/Switch/__tests__/__snapshots__/Switch.spec.js.snap +176 -5
  39. package/lib/Card/__tests__/Card.spec.js +54 -6
  40. package/lib/Card/__tests__/CardContent.spec.js +68 -0
  41. package/lib/Card/__tests__/CardHeader.spec.js +40 -0
  42. package/lib/Card/__tests__/__snapshots__/Card.spec.js.snap +125 -0
  43. package/lib/Card/__tests__/__snapshots__/CardContent.spec.js.snap +177 -0
  44. package/lib/Card/__tests__/__snapshots__/CardHeader.spec.js.snap +51 -0
  45. package/lib/ListItem/ListItem.js +10 -3
  46. package/lib/ListItem/ListItemWithAvatar.js +15 -6
  47. package/lib/ListItem/ListItemWithCheckBox.js +15 -6
  48. package/lib/ListItem/ListItemWithIcon.js +13 -5
  49. package/lib/ListItem/ListItemWithRadio.js +15 -6
  50. package/lib/ListItem/__tests__/ListItem.spec.js +23 -0
  51. package/lib/ListItem/__tests__/ListItemWithAvatar.spec.js +23 -0
  52. package/lib/ListItem/__tests__/ListItemWithCheckBox.spec.js +23 -0
  53. package/lib/ListItem/__tests__/ListItemWithIcon.spec.js +21 -0
  54. package/lib/ListItem/__tests__/ListItemWithRadio.spec.js +23 -0
  55. package/lib/ListItem/__tests__/__snapshots__/ListItem.spec.js.snap +78 -0
  56. package/lib/ListItem/__tests__/__snapshots__/ListItemWithAvatar.spec.js.snap +140 -46
  57. package/lib/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +251 -49
  58. package/lib/ListItem/__tests__/__snapshots__/ListItemWithIcon.spec.js.snap +144 -50
  59. package/lib/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +252 -52
  60. package/lib/ListItem/props/propTypes.js +15 -6
  61. package/lib/MultiSelect/MultiSelect.js +6 -2
  62. package/lib/MultiSelect/Suggestions.js +2 -1
  63. package/lib/MultiSelect/__tests__/__snapshots__/MultiSelectHeader.spec.js.snap +6 -6
  64. package/lib/MultiSelect/props/propTypes.js +3 -4
  65. package/lib/Select/GroupSelect.js +4 -3
  66. package/lib/Select/Select.js +7 -1
  67. package/lib/Select/SelectWithAvatar.js +17 -7
  68. package/lib/Select/SelectWithIcon.js +15 -5
  69. package/lib/Select/props/defaultProps.js +2 -1
  70. package/lib/Select/props/propTypes.js +5 -0
  71. package/lib/Typography/__tests__/Typography.spec.js +232 -0
  72. package/lib/Typography/__tests__/__snapshots__/Typography.spec.js.snap +1226 -0
  73. package/lib/utils/dropDownUtils.js +17 -4
  74. package/lib/v1/Switch/__tests__/Switch.spec.js +41 -6
  75. package/lib/v1/Switch/__tests__/__snapshots__/Switch.spec.js.snap +176 -5
  76. package/package.json +3 -3
@@ -1,5 +1,87 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
+ exports[`Card rendering the a11y 1`] = `
4
+ <DocumentFragment>
5
+ <div
6
+ class="flex cover coldir"
7
+ data-id="containerComponent"
8
+ data-selector-id="container"
9
+ data-test-id="containerComponent"
10
+ >
11
+ <div
12
+ class="grow basis shrinkOff scrolly"
13
+ data-id="CardContent"
14
+ data-selector-id="cardContent"
15
+ data-test-id="CardContent"
16
+ role="button"
17
+ >
18
+ Test
19
+ </div>
20
+ </div>
21
+ </DocumentFragment>
22
+ `;
23
+
24
+ exports[`Card rendering the children 1`] = `
25
+ <DocumentFragment>
26
+ <div
27
+ class="flex cover coldir"
28
+ data-id="containerComponent"
29
+ data-selector-id="container"
30
+ data-test-id="containerComponent"
31
+ >
32
+
33
+ <div
34
+ class="grow basis shrinkOff scrolly"
35
+ data-id="CardContent"
36
+ data-selector-id="cardContent"
37
+ data-test-id="CardContent"
38
+ >
39
+ Test
40
+ </div>
41
+ </div>
42
+ </DocumentFragment>
43
+ `;
44
+
45
+ exports[`Card rendering the customClass 1`] = `
46
+ <DocumentFragment>
47
+ <div
48
+ class="customClass flex cover coldir"
49
+ data-id="containerComponent"
50
+ data-selector-id="container"
51
+ data-test-id="containerComponent"
52
+ >
53
+ <div
54
+ class="grow basis shrinkOff scrolly"
55
+ data-id="CardContent"
56
+ data-selector-id="cardContent"
57
+ data-test-id="CardContent"
58
+ >
59
+ Test
60
+ </div>
61
+ </div>
62
+ </DocumentFragment>
63
+ `;
64
+
65
+ exports[`Card rendering the dataId value 1`] = `
66
+ <DocumentFragment>
67
+ <div
68
+ class="flex cover coldir"
69
+ data-id="customdataId"
70
+ data-selector-id="container"
71
+ data-test-id="customdataId"
72
+ >
73
+ <div
74
+ class="grow basis shrinkOff scrolly"
75
+ data-id="CardContent"
76
+ data-selector-id="cardContent"
77
+ data-test-id="CardContent"
78
+ >
79
+ Test
80
+ </div>
81
+ </div>
82
+ </DocumentFragment>
83
+ `;
84
+
3
85
  exports[`Card rendering the defult props 1`] = `
4
86
  <DocumentFragment>
5
87
  <div
@@ -11,6 +93,49 @@ exports[`Card rendering the defult props 1`] = `
11
93
  </DocumentFragment>
12
94
  `;
13
95
 
96
+ exports[`Card rendering the htmlId 1`] = `
97
+ <DocumentFragment>
98
+ <div
99
+ class="flex cover coldir"
100
+ data-id="containerComponent"
101
+ data-selector-id="container"
102
+ data-test-id="containerComponent"
103
+ >
104
+ <div
105
+ class="grow basis shrinkOff scrolly"
106
+ data-id="CardContent"
107
+ data-selector-id="cardContent"
108
+ data-test-id="CardContent"
109
+ id="customHtmlId"
110
+ >
111
+ Test
112
+ </div>
113
+ </div>
114
+ </DocumentFragment>
115
+ `;
116
+
117
+ exports[`Card rendering the isScrollAttribute is true 1`] = `
118
+ <DocumentFragment>
119
+ <div
120
+ class="flex cover coldir"
121
+ data-id="containerComponent"
122
+ data-scroll="true"
123
+ data-selector-id="container"
124
+ data-test-id="containerComponent"
125
+ >
126
+
127
+ <div
128
+ class="grow basis shrinkOff scrolly"
129
+ data-id="CardContent"
130
+ data-selector-id="cardContent"
131
+ data-test-id="CardContent"
132
+ >
133
+ Test
134
+ </div>
135
+ </div>
136
+ </DocumentFragment>
137
+ `;
138
+
14
139
  exports[`Card should trigger fetch, when scroll to the bottom of the card while isRecentOnBottom = false 1`] = `
15
140
  <DocumentFragment>
16
141
  <div
@@ -0,0 +1,177 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`CardContent Should render with name - both 1`] = `
4
+ <DocumentFragment>
5
+ <div
6
+ class="grow basis shrinkOff scrollboth"
7
+ data-id="CardContent"
8
+ data-scroll="true"
9
+ data-selector-id="cardContent"
10
+ data-test-id="CardContent"
11
+ >
12
+ <div>
13
+ Test Animation
14
+ </div>
15
+ </div>
16
+ </DocumentFragment>
17
+ `;
18
+
19
+ exports[`CardContent Should render with name - both 2`] = `
20
+ <DocumentFragment>
21
+ <div
22
+ class="grow basis shrinkOff scrolly preventScrollBubbleBoth"
23
+ data-id="CardContent"
24
+ data-scroll="true"
25
+ data-selector-id="cardContent"
26
+ data-test-id="CardContent"
27
+ >
28
+ <div>
29
+ Test
30
+ </div>
31
+ </div>
32
+ </DocumentFragment>
33
+ `;
34
+
35
+ exports[`CardContent Should render with name - horizontal 1`] = `
36
+ <DocumentFragment>
37
+ <div
38
+ class="grow basis shrinkOff scrollx"
39
+ data-id="CardContent"
40
+ data-scroll="true"
41
+ data-selector-id="cardContent"
42
+ data-test-id="CardContent"
43
+ >
44
+ <div>
45
+ Test Animation
46
+ </div>
47
+ </div>
48
+ </DocumentFragment>
49
+ `;
50
+
51
+ exports[`CardContent Should render with name - horizontal 2`] = `
52
+ <DocumentFragment>
53
+ <div
54
+ class="grow basis shrinkOff scrolly preventScrollBubbleX"
55
+ data-id="CardContent"
56
+ data-scroll="true"
57
+ data-selector-id="cardContent"
58
+ data-test-id="CardContent"
59
+ >
60
+ <div>
61
+ Test
62
+ </div>
63
+ </div>
64
+ </DocumentFragment>
65
+ `;
66
+
67
+ exports[`CardContent Should render with name - none 1`] = `
68
+ <DocumentFragment>
69
+ <div
70
+ class="grow basis shrinkOff scrollnone"
71
+ data-id="CardContent"
72
+ data-scroll="true"
73
+ data-selector-id="cardContent"
74
+ data-test-id="CardContent"
75
+ >
76
+ <div>
77
+ Test Animation
78
+ </div>
79
+ </div>
80
+ </DocumentFragment>
81
+ `;
82
+
83
+ exports[`CardContent Should render with name - vertical 1`] = `
84
+ <DocumentFragment>
85
+ <div
86
+ class="grow basis shrinkOff scrolly"
87
+ data-id="CardContent"
88
+ data-scroll="true"
89
+ data-selector-id="cardContent"
90
+ data-test-id="CardContent"
91
+ >
92
+ <div>
93
+ Test Animation
94
+ </div>
95
+ </div>
96
+ </DocumentFragment>
97
+ `;
98
+
99
+ exports[`CardContent Should render with name - vertical 2`] = `
100
+ <DocumentFragment>
101
+ <div
102
+ class="grow basis shrinkOff scrolly preventScrollBubbleY"
103
+ data-id="CardContent"
104
+ data-scroll="true"
105
+ data-selector-id="cardContent"
106
+ data-test-id="CardContent"
107
+ >
108
+ <div>
109
+ Test
110
+ </div>
111
+ </div>
112
+ </DocumentFragment>
113
+ `;
114
+
115
+ exports[`CardContent rendering children 1`] = `
116
+ <DocumentFragment>
117
+ <div
118
+ class="grow basis shrinkOff scrolly"
119
+ data-id="CardContent"
120
+ data-selector-id="cardContent"
121
+ data-test-id="CardContent"
122
+ >
123
+ Test
124
+ </div>
125
+ </DocumentFragment>
126
+ `;
127
+
128
+ exports[`CardContent rendering customClass is true 1`] = `
129
+ <DocumentFragment>
130
+ <div
131
+ class="cardCustomClass grow basis shrinkOff scrolly"
132
+ data-id="CardContent"
133
+ data-selector-id="cardContent"
134
+ data-test-id="CardContent"
135
+ >
136
+ Test
137
+ </div>
138
+ </DocumentFragment>
139
+ `;
140
+
141
+ exports[`CardContent rendering isScrollAttribute is true 1`] = `
142
+ <DocumentFragment>
143
+ <div
144
+ class="grow basis shrinkOff scrolly"
145
+ data-id="CardContent"
146
+ data-scroll="true"
147
+ data-selector-id="cardContent"
148
+ data-test-id="CardContent"
149
+ >
150
+ Test
151
+ </div>
152
+ </DocumentFragment>
153
+ `;
154
+
155
+ exports[`CardContent rendering shrink is true 1`] = `
156
+ <DocumentFragment>
157
+ <div
158
+ class="grow basis shrinkOn scrolly"
159
+ data-id="CardContent"
160
+ data-selector-id="cardContent"
161
+ data-test-id="CardContent"
162
+ >
163
+ Test
164
+ </div>
165
+ </DocumentFragment>
166
+ `;
167
+
168
+ exports[`CardContent rendering the defult props 1`] = `
169
+ <DocumentFragment>
170
+ <div
171
+ class="grow basis shrinkOff scrolly"
172
+ data-id="CardContent"
173
+ data-selector-id="cardContent"
174
+ data-test-id="CardContent"
175
+ />
176
+ </DocumentFragment>
177
+ `;
@@ -0,0 +1,51 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`CardHeader rendering the Children is true 1`] = `
4
+ <DocumentFragment>
5
+ <div
6
+ class="notScroll shrinkOff"
7
+ data-id="CardHeader"
8
+ data-selector-id="cardHeader"
9
+ data-test-id="CardHeader"
10
+ >
11
+ Children
12
+ </div>
13
+ </DocumentFragment>
14
+ `;
15
+
16
+ exports[`CardHeader rendering the customClass 1`] = `
17
+ <DocumentFragment>
18
+ <div
19
+ class="notScroll cardHeader-class shrinkOff"
20
+ data-id="CardHeader"
21
+ data-selector-id="cardHeader"
22
+ data-test-id="CardHeader"
23
+ >
24
+ Children
25
+ </div>
26
+ </DocumentFragment>
27
+ `;
28
+
29
+ exports[`CardHeader rendering the defult props 1`] = `
30
+ <DocumentFragment>
31
+ <div
32
+ class="notScroll shrinkOff"
33
+ data-id="CardHeader"
34
+ data-selector-id="cardHeader"
35
+ data-test-id="CardHeader"
36
+ />
37
+ </DocumentFragment>
38
+ `;
39
+
40
+ exports[`CardHeader rendering the isScroll is true 1`] = `
41
+ <DocumentFragment>
42
+ <div
43
+ class="scroll shrinkOff"
44
+ data-id="CardHeader"
45
+ data-selector-id="cardHeader"
46
+ data-test-id="CardHeader"
47
+ >
48
+ Children
49
+ </div>
50
+ </DocumentFragment>
51
+ `;
@@ -19,6 +19,8 @@ var _propTypes = require("./props/propTypes");
19
19
 
20
20
  var _icons = require("@zohodesk/icons");
21
21
 
22
+ var _utils = require("@zohodesk/utils");
23
+
22
24
  var _ListItemModule = _interopRequireDefault(require("./ListItem.module.css"));
23
25
 
24
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -123,7 +125,8 @@ var ListItem = /*#__PURE__*/function (_React$Component) {
123
125
  customClass = _this$props4.customClass,
124
126
  customProps = _this$props4.customProps,
125
127
  needMultiLineText = _this$props4.needMultiLineText,
126
- secondaryValue = _this$props4.secondaryValue;
128
+ secondaryValue = _this$props4.secondaryValue,
129
+ renderValueRightPlaceholderNode = _this$props4.renderValueRightPlaceholderNode;
127
130
  var _customProps$ListItem = customProps.ListItemProps,
128
131
  ListItemProps = _customProps$ListItem === void 0 ? {} : _customProps$ListItem,
129
132
  _customProps$Containe = customProps.ContainerProps,
@@ -131,7 +134,9 @@ var ListItem = /*#__PURE__*/function (_React$Component) {
131
134
  var _customClass$customLi = customClass.customListItem,
132
135
  customListItem = _customClass$customLi === void 0 ? '' : _customClass$customLi,
133
136
  _customClass$customTi = customClass.customTickIcon,
134
- customTickIcon = _customClass$customTi === void 0 ? '' : _customClass$customTi;
137
+ customTickIcon = _customClass$customTi === void 0 ? '' : _customClass$customTi,
138
+ _customClass$customVa = customClass.customValueRightPlaceholder,
139
+ customValueRightPlaceholder = _customClass$customVa === void 0 ? '' : _customClass$customVa;
135
140
 
136
141
  var listA11y = _objectSpread({
137
142
  ariaHidden: true,
@@ -172,7 +177,9 @@ var ListItem = /*#__PURE__*/function (_React$Component) {
172
177
  shrink: true,
173
178
  adjust: true,
174
179
  className: needMultiLineText ? _ListItemModule["default"].multiLineValue : _ListItemModule["default"].value
175
- }, value) : null, children ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
180
+ }, value) : null, (0, _utils.isRenderable)(renderValueRightPlaceholderNode) ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
181
+ className: customValueRightPlaceholder
182
+ }, (0, _utils.renderNode)(renderValueRightPlaceholderNode)) : null, children ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
176
183
  shrink: true,
177
184
  adjust: true,
178
185
  className: _ListItemModule["default"].children
@@ -23,6 +23,8 @@ var _AvatarTeam = _interopRequireDefault(require("../AvatarTeam/AvatarTeam"));
23
23
 
24
24
  var _icons = require("@zohodesk/icons");
25
25
 
26
+ var _utils = require("@zohodesk/utils");
27
+
26
28
  var _ListItemModule = _interopRequireDefault(require("./ListItem.module.css"));
27
29
 
28
30
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -130,6 +132,7 @@ var ListItemWithAvatar = /*#__PURE__*/function (_React$PureComponent) {
130
132
  customProps = _this$props4.customProps,
131
133
  needMultiLineText = _this$props4.needMultiLineText,
132
134
  secondaryValue = _this$props4.secondaryValue,
135
+ renderValueRightPlaceholderNode = _this$props4.renderValueRightPlaceholderNode,
133
136
  lhsAlignContent = _this$props4.lhsAlignContent;
134
137
  var _customProps$ListItem = customProps.ListItemProps,
135
138
  ListItemProps = _customProps$ListItem === void 0 ? {} : _customProps$ListItem,
@@ -144,7 +147,9 @@ var ListItemWithAvatar = /*#__PURE__*/function (_React$PureComponent) {
144
147
  _customClass$customAv = customClass.customAvatar,
145
148
  customAvatar = _customClass$customAv === void 0 ? '' : _customClass$customAv,
146
149
  _customClass$customAv2 = customClass.customAvatarTeam,
147
- customAvatarTeam = _customClass$customAv2 === void 0 ? '' : _customClass$customAv2;
150
+ customAvatarTeam = _customClass$customAv2 === void 0 ? '' : _customClass$customAv2,
151
+ _customClass$customVa = customClass.customValueRightPlaceholder,
152
+ customValueRightPlaceholder = _customClass$customVa === void 0 ? '' : _customClass$customVa;
148
153
 
149
154
  var listA11y = _objectSpread({
150
155
  ariaHidden: true,
@@ -200,16 +205,20 @@ var ListItemWithAvatar = /*#__PURE__*/function (_React$PureComponent) {
200
205
  customClass: customAvatar
201
206
  }, AvatarProps)))) : null, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
202
207
  flexible: true,
203
- shrink: true
204
- }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
205
- alignBox: "column"
208
+ className: _ListItemModule["default"].leftBox
209
+ }, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
210
+ className: _ListItemModule["default"].titleBox
206
211
  }, value ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
212
+ shrink: true,
213
+ adjust: true,
207
214
  "data-title": isDisabled ? null : title,
208
215
  className: needMultiLineText ? _ListItemModule["default"].multiLineValue : _ListItemModule["default"].value
209
- }, value) : null, secondaryValue ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
216
+ }, value) : null, (0, _utils.isRenderable)(renderValueRightPlaceholderNode) ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
217
+ className: customValueRightPlaceholder
218
+ }, (0, _utils.renderNode)(renderValueRightPlaceholderNode)) : null), secondaryValue ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
210
219
  "data-title": isDisabled ? null : secondaryValue,
211
220
  className: "".concat(_ListItemModule["default"].secondaryField, " ").concat(needMultiLineText ? _ListItemModule["default"].multiLine : _ListItemModule["default"].secondaryValue)
212
- }, secondaryValue) : null)), needTick && active ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
221
+ }, secondaryValue) : null), needTick && active ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
213
222
  className: _ListItemModule["default"].tickIcon,
214
223
  "aria-hidden": ariaHidden,
215
224
  dataId: "".concat(dataIdString, "_tickIcon"),
@@ -19,6 +19,8 @@ var _CheckBox = _interopRequireDefault(require("../CheckBox/CheckBox"));
19
19
 
20
20
  var _Layout = require("../Layout");
21
21
 
22
+ var _utils = require("@zohodesk/utils");
23
+
22
24
  var _ListItemModule = _interopRequireDefault(require("./ListItem.module.css"));
23
25
 
24
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -118,6 +120,7 @@ var ListItemWithCheckBox = /*#__PURE__*/function (_React$Component) {
118
120
  customProps = _this$props4.customProps,
119
121
  needMultiLineText = _this$props4.needMultiLineText,
120
122
  secondaryValue = _this$props4.secondaryValue,
123
+ renderValueRightPlaceholderNode = _this$props4.renderValueRightPlaceholderNode,
121
124
  lhsAlignContent = _this$props4.lhsAlignContent,
122
125
  lhsJustifyContent = _this$props4.lhsJustifyContent;
123
126
 
@@ -134,7 +137,9 @@ var ListItemWithCheckBox = /*#__PURE__*/function (_React$Component) {
134
137
  _customClass$customCh = customClass.customCheckBox,
135
138
  customCheckBox = _customClass$customCh === void 0 ? '' : _customClass$customCh,
136
139
  _customClass$customLa = customClass.customLabel,
137
- customLabel = _customClass$customLa === void 0 ? '' : _customClass$customLa;
140
+ customLabel = _customClass$customLa === void 0 ? '' : _customClass$customLa,
141
+ _customClass$customVa = customClass.customValueRightPlaceholder,
142
+ customValueRightPlaceholder = _customClass$customVa === void 0 ? '' : _customClass$customVa;
138
143
  return /*#__PURE__*/_react["default"].createElement(_ListContainer["default"], _extends({
139
144
  a11y: listA11y,
140
145
  size: size,
@@ -169,16 +174,20 @@ var ListItemWithCheckBox = /*#__PURE__*/function (_React$Component) {
169
174
  }
170
175
  }))), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
171
176
  flexible: true,
172
- shrink: true
173
- }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
174
- alignBox: "column"
177
+ className: _ListItemModule["default"].leftBox
178
+ }, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
179
+ className: _ListItemModule["default"].titleBox
175
180
  }, value ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
181
+ shrink: true,
182
+ adjust: true,
176
183
  "data-title": isDisabled ? null : title,
177
184
  className: needMultiLineText ? _ListItemModule["default"].multiLineValue : _ListItemModule["default"].value
178
- }, value) : null, secondaryValue ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
185
+ }, value) : null, (0, _utils.isRenderable)(renderValueRightPlaceholderNode) ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
186
+ className: customValueRightPlaceholder
187
+ }, (0, _utils.renderNode)(renderValueRightPlaceholderNode)) : null), secondaryValue ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
179
188
  "data-title": isDisabled ? null : secondaryValue,
180
189
  className: "".concat(_ListItemModule["default"].secondaryField, " ").concat(needMultiLineText ? _ListItemModule["default"].multiLine : _ListItemModule["default"].secondaryValue)
181
- }, secondaryValue) : null)));
190
+ }, secondaryValue) : null));
182
191
  }
183
192
  }]);
184
193
 
@@ -19,6 +19,8 @@ var _defaultProps = require("./props/defaultProps");
19
19
 
20
20
  var _propTypes = require("./props/propTypes");
21
21
 
22
+ var _utils = require("@zohodesk/utils");
23
+
22
24
  var _ListItemModule = _interopRequireDefault(require("./ListItem.module.css"));
23
25
 
24
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -123,9 +125,11 @@ var ListItemWithIcon = /*#__PURE__*/function (_React$Component) {
123
125
  disableTitle = _this$props4.disableTitle,
124
126
  a11y = _this$props4.a11y,
125
127
  customClass = _this$props4.customClass,
128
+ customValueRightPlaceholderClass = _this$props4.customValueRightPlaceholderClass,
126
129
  customProps = _this$props4.customProps,
127
130
  needMultiLineText = _this$props4.needMultiLineText,
128
131
  secondaryValue = _this$props4.secondaryValue,
132
+ renderValueRightPlaceholderNode = _this$props4.renderValueRightPlaceholderNode,
129
133
  lhsAlignContent = _this$props4.lhsAlignContent,
130
134
  lhsJustifyContent = _this$props4.lhsJustifyContent;
131
135
  var _customProps$ListItem = customProps.ListItemProps,
@@ -178,17 +182,21 @@ var ListItemWithIcon = /*#__PURE__*/function (_React$Component) {
178
182
  className: iconClass
179
183
  }) : null, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
180
184
  flexible: true,
181
- shrink: true
182
- }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
183
- alignBox: "column"
185
+ className: _ListItemModule["default"].leftBox
186
+ }, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
187
+ className: _ListItemModule["default"].titleBox
184
188
  }, value ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
189
+ shrink: true,
190
+ adjust: true,
185
191
  className: needMultiLineText ? _ListItemModule["default"].multiLineValue : _ListItemModule["default"].value,
186
192
  "data-title": isDisabled ? null : title,
187
193
  dataId: "".concat(dataIdString, "_Text")
188
- }, value) : null, secondaryValue ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
194
+ }, value) : null, (0, _utils.isRenderable)(renderValueRightPlaceholderNode) ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
195
+ className: customValueRightPlaceholderClass
196
+ }, (0, _utils.renderNode)(renderValueRightPlaceholderNode)) : null), secondaryValue ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
189
197
  "data-title": isDisabled ? null : secondaryValue,
190
198
  className: "".concat(_ListItemModule["default"].secondaryField, " ").concat(needMultiLineText ? _ListItemModule["default"].multiLine : _ListItemModule["default"].secondaryValue)
191
- }, secondaryValue) : null)), needTick && active ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
199
+ }, secondaryValue) : null), needTick && active ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
192
200
  className: _ListItemModule["default"].tickIcon,
193
201
  "aria-hidden": ariaHidden,
194
202
  dataId: "".concat(dataIdString, "_tickIcon"),
@@ -19,6 +19,8 @@ var _defaultProps = require("./props/defaultProps");
19
19
 
20
20
  var _propTypes = require("./props/propTypes");
21
21
 
22
+ var _utils = require("@zohodesk/utils");
23
+
22
24
  var _ListItemModule = _interopRequireDefault(require("./ListItem.module.css"));
23
25
 
24
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -119,6 +121,7 @@ var ListItemWithRadio = /*#__PURE__*/function (_React$Component) {
119
121
  customProps = _this$props4.customProps,
120
122
  needMultiLineText = _this$props4.needMultiLineText,
121
123
  secondaryValue = _this$props4.secondaryValue,
124
+ renderValueRightPlaceholderNode = _this$props4.renderValueRightPlaceholderNode,
122
125
  lhsAlignContent = _this$props4.lhsAlignContent,
123
126
  lhsJustifyContent = _this$props4.lhsJustifyContent;
124
127
  var _customProps$ListItem = customProps.ListItemProps,
@@ -135,7 +138,9 @@ var ListItemWithRadio = /*#__PURE__*/function (_React$Component) {
135
138
  _customClass$customRa = customClass.customRadio,
136
139
  customRadio = _customClass$customRa === void 0 ? '' : _customClass$customRa,
137
140
  _customClass$customRa2 = customClass.customRadioWrap,
138
- customRadioWrap = _customClass$customRa2 === void 0 ? '' : _customClass$customRa2;
141
+ customRadioWrap = _customClass$customRa2 === void 0 ? '' : _customClass$customRa2,
142
+ _customClass$customVa = customClass.customValueRightPlaceholder,
143
+ customValueRightPlaceholder = _customClass$customVa === void 0 ? '' : _customClass$customVa;
139
144
  return /*#__PURE__*/_react["default"].createElement(_ListContainer["default"], _extends({
140
145
  a11y: listA11y,
141
146
  size: size,
@@ -172,16 +177,20 @@ var ListItemWithRadio = /*#__PURE__*/function (_React$Component) {
172
177
  }
173
178
  }))), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
174
179
  flexible: true,
175
- shrink: true
176
- }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
177
- alignBox: "column"
180
+ className: _ListItemModule["default"].leftBox
181
+ }, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
182
+ className: _ListItemModule["default"].titleBox
178
183
  }, value ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
184
+ shrink: true,
185
+ adjust: true,
179
186
  "data-title": disableTitle ? null : title,
180
187
  className: needMultiLineText ? _ListItemModule["default"].multiLineValue : _ListItemModule["default"].value
181
- }, value) : null, secondaryValue ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
188
+ }, value) : null, (0, _utils.isRenderable)(renderValueRightPlaceholderNode) ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
189
+ className: customValueRightPlaceholder
190
+ }, (0, _utils.renderNode)(renderValueRightPlaceholderNode)) : null), secondaryValue ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
182
191
  "data-title": isDisabled ? null : secondaryValue,
183
192
  className: "".concat(_ListItemModule["default"].secondaryField, " ").concat(needMultiLineText ? _ListItemModule["default"].multiLine : _ListItemModule["default"].secondaryValue)
184
- }, secondaryValue) : null)));
193
+ }, secondaryValue) : null));
185
194
  }
186
195
  }]);
187
196
 
@@ -15,4 +15,27 @@ describe('ListItem', function () {
15
15
 
16
16
  expect(asFragment()).toMatchSnapshot();
17
17
  });
18
+ test('ListItem with renderValueRightPlaceholderNode', function () {
19
+ var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ListItem["default"], {
20
+ renderValueRightPlaceholderNode: function renderValueRightPlaceholderNode() {
21
+ return /*#__PURE__*/_react["default"].createElement("div", null, "Custom Placeholder");
22
+ }
23
+ })),
24
+ asFragment = _render2.asFragment;
25
+
26
+ expect(asFragment()).toMatchSnapshot();
27
+ });
28
+ test('ListItem with renderValueRightPlaceholderNode & it\'s custom class', function () {
29
+ var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ListItem["default"], {
30
+ renderValueRightPlaceholderNode: function renderValueRightPlaceholderNode() {
31
+ return /*#__PURE__*/_react["default"].createElement("div", null, "Custom Placeholder");
32
+ },
33
+ customClass: {
34
+ customValueRightPlaceholder: "customValueRightPlaceholderClass"
35
+ }
36
+ })),
37
+ asFragment = _render3.asFragment;
38
+
39
+ expect(asFragment()).toMatchSnapshot();
40
+ });
18
41
  });
@@ -50,4 +50,27 @@ describe('ListItemWithAvatar', function () {
50
50
 
51
51
  expect(asFragment()).toMatchSnapshot();
52
52
  });
53
+ test('ListItemWithAvatar with renderValueRightPlaceholderNode', function () {
54
+ var _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ListItemWithAvatar["default"], {
55
+ renderValueRightPlaceholderNode: function renderValueRightPlaceholderNode() {
56
+ return /*#__PURE__*/_react["default"].createElement("div", null, "Custom Placeholder");
57
+ }
58
+ })),
59
+ asFragment = _render6.asFragment;
60
+
61
+ expect(asFragment()).toMatchSnapshot();
62
+ });
63
+ test('ListItemWithAvatar with renderValueRightPlaceholderNode & it\'s custom class', function () {
64
+ var _render7 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ListItemWithAvatar["default"], {
65
+ renderValueRightPlaceholderNode: function renderValueRightPlaceholderNode() {
66
+ return /*#__PURE__*/_react["default"].createElement("div", null, "Custom Placeholder");
67
+ },
68
+ customClass: {
69
+ customValueRightPlaceholder: "customValueRightPlaceholderClass"
70
+ }
71
+ })),
72
+ asFragment = _render7.asFragment;
73
+
74
+ expect(asFragment()).toMatchSnapshot();
75
+ });
53
76
  });