@zohodesk/components 1.0.0-temp-233 → 1.0.0-temp-234
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.
- package/.cli/propValidation_report.html +1 -1
- package/README.md +35 -0
- package/assets/Appearance/dark/mode/Component_DarkMode.module.css +4 -4
- package/assets/Appearance/dark/themes/blue/blue_CTA_DarkModifyCategory.module.css +461 -8
- package/assets/Appearance/dark/themes/green/green_CTA_DarkModifyCategory.module.css +461 -8
- package/assets/Appearance/dark/themes/orange/orange_CTA_DarkModifyCategory.module.css +461 -8
- package/assets/Appearance/dark/themes/red/red_CTA_DarkModifyCategory.module.css +461 -8
- package/assets/Appearance/dark/themes/yellow/yellow_CTA_DarkModifyCategory.module.css +461 -8
- package/assets/Appearance/light/mode/Component_LightMode.module.css +6 -6
- package/assets/Appearance/light/themes/blue/blue_CTA_LightModifyCategory.module.css +461 -8
- package/assets/Appearance/light/themes/green/green_CTA_LightModifyCategory.module.css +461 -8
- package/assets/Appearance/light/themes/orange/orange_CTA_LightModifyCategory.module.css +461 -8
- package/assets/Appearance/light/themes/red/red_CTA_LightModifyCategory.module.css +461 -8
- package/assets/Appearance/light/themes/yellow/yellow_CTA_LightModifyCategory.module.css +461 -8
- package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +3 -3
- package/assets/Appearance/pureDark/themes/blue/blue_CTA_PureDarkModifyCategory.module.css +461 -8
- package/assets/Appearance/pureDark/themes/green/green_CTA_PureDarkModifyCategory.module.css +461 -8
- package/assets/Appearance/pureDark/themes/orange/orange_CTA_PureDarkModifyCategory.module.css +461 -8
- package/assets/Appearance/pureDark/themes/red/red_CTA_PureDarkModifyCategory.module.css +461 -8
- package/assets/Appearance/pureDark/themes/yellow/yellow_CTA_PureDarkModifyCategory.module.css +461 -8
- package/es/ListItem/ListItem.js +7 -3
- package/es/ListItem/ListItemWithAvatar.js +12 -6
- package/es/ListItem/ListItemWithCheckBox.js +12 -6
- package/es/ListItem/ListItemWithIcon.js +11 -5
- package/es/ListItem/ListItemWithRadio.js +12 -6
- package/es/ListItem/__tests__/ListItem.spec.js +19 -0
- package/es/ListItem/__tests__/ListItemWithAvatar.spec.js +19 -0
- package/es/ListItem/__tests__/ListItemWithCheckBox.spec.js +19 -0
- package/es/ListItem/__tests__/ListItemWithIcon.spec.js +17 -0
- package/es/ListItem/__tests__/ListItemWithRadio.spec.js +19 -0
- package/es/ListItem/__tests__/__snapshots__/ListItem.spec.js.snap +78 -0
- package/es/ListItem/__tests__/__snapshots__/ListItemWithAvatar.spec.js.snap +140 -46
- package/es/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +251 -49
- package/es/ListItem/__tests__/__snapshots__/ListItemWithIcon.spec.js.snap +144 -50
- package/es/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +252 -52
- package/es/ListItem/props/propTypes.js +15 -5
- package/es/MultiSelect/MultiSelect.js +44 -13
- package/es/MultiSelect/Suggestions.js +171 -100
- package/es/MultiSelect/props/defaultProps.js +2 -0
- package/es/MultiSelect/props/propTypes.js +4 -0
- package/es/Select/GroupSelect.js +4 -2
- package/es/Select/Select.js +47 -12
- package/es/Select/SelectWithAvatar.js +14 -3
- package/es/Select/SelectWithIcon.js +6 -2
- package/es/Select/props/defaultProps.js +2 -0
- package/es/Select/props/propTypes.js +6 -0
- package/es/utils/Common.js +2 -1
- package/es/utils/dropDownUtils.js +15 -4
- package/lib/ListItem/ListItem.js +8 -3
- package/lib/ListItem/ListItemWithAvatar.js +13 -6
- package/lib/ListItem/ListItemWithCheckBox.js +13 -6
- package/lib/ListItem/ListItemWithIcon.js +11 -5
- package/lib/ListItem/ListItemWithRadio.js +13 -6
- package/lib/ListItem/__tests__/ListItem.spec.js +23 -0
- package/lib/ListItem/__tests__/ListItemWithAvatar.spec.js +23 -0
- package/lib/ListItem/__tests__/ListItemWithCheckBox.spec.js +23 -0
- package/lib/ListItem/__tests__/ListItemWithIcon.spec.js +21 -0
- package/lib/ListItem/__tests__/ListItemWithRadio.spec.js +23 -0
- package/lib/ListItem/__tests__/__snapshots__/ListItem.spec.js.snap +78 -0
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithAvatar.spec.js.snap +140 -46
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +251 -49
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithIcon.spec.js.snap +144 -50
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +252 -52
- package/lib/ListItem/props/propTypes.js +15 -6
- package/lib/MultiSelect/MultiSelect.js +42 -12
- package/lib/MultiSelect/Suggestions.js +174 -104
- package/lib/MultiSelect/props/defaultProps.js +2 -0
- package/lib/MultiSelect/props/propTypes.js +4 -0
- package/lib/Select/GroupSelect.js +4 -3
- package/lib/Select/Select.js +46 -9
- package/lib/Select/SelectWithAvatar.js +14 -6
- package/lib/Select/SelectWithIcon.js +6 -3
- package/lib/Select/props/defaultProps.js +2 -0
- package/lib/Select/props/propTypes.js +6 -0
- package/lib/utils/Common.js +4 -2
- package/lib/utils/dropDownUtils.js +17 -4
- package/package.json +6 -6
|
@@ -41,6 +41,7 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
41
41
|
valueField,
|
|
42
42
|
textField,
|
|
43
43
|
imageField,
|
|
44
|
+
secondaryField,
|
|
44
45
|
allowValueFallback
|
|
45
46
|
} = props;
|
|
46
47
|
return this.formatOptions({
|
|
@@ -48,6 +49,7 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
48
49
|
valueField,
|
|
49
50
|
textField,
|
|
50
51
|
imageField,
|
|
52
|
+
secondaryField,
|
|
51
53
|
optionType: 'avatar',
|
|
52
54
|
allowValueFallback
|
|
53
55
|
});
|
|
@@ -165,6 +167,7 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
165
167
|
needEffect,
|
|
166
168
|
isLoading,
|
|
167
169
|
dataSelectorId,
|
|
170
|
+
customProps,
|
|
168
171
|
getTargetRef
|
|
169
172
|
} = this.props;
|
|
170
173
|
i18nKeys = Object.assign({}, i18nKeys, {
|
|
@@ -187,6 +190,11 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
187
190
|
} = this.normalizedFormatOptions[selectedId] || {};
|
|
188
191
|
let setAriaId = this.getNextAriaId();
|
|
189
192
|
let ariaErrorId = this.getNextAriaId();
|
|
193
|
+
let {
|
|
194
|
+
TextBoxProps,
|
|
195
|
+
DropdownSearchTextBoxProps,
|
|
196
|
+
SuggestionsProps
|
|
197
|
+
} = customProps;
|
|
190
198
|
return /*#__PURE__*/React.createElement("div", {
|
|
191
199
|
className: `${style.wrapper} ${isDisabled ? style.disabled : ''} ${isReadOnly ? style.readOnly : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''} ${className ? className : ''}`,
|
|
192
200
|
"data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
|
|
@@ -246,7 +254,8 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
246
254
|
isClickable: isReadOnly || isDisabled ? false : true,
|
|
247
255
|
borderColor: borderColor,
|
|
248
256
|
htmlId: htmlId,
|
|
249
|
-
autoComplete: false
|
|
257
|
+
autoComplete: false,
|
|
258
|
+
...TextBoxProps
|
|
250
259
|
}))), !isReadOnly && !isDisabled && isPopupOpen ? /*#__PURE__*/React.createElement(ResponsiveReceiver, {
|
|
251
260
|
query: this.responsiveFunc,
|
|
252
261
|
responsiveId: "Helmet"
|
|
@@ -295,7 +304,8 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
295
304
|
ariaControls: setAriaId,
|
|
296
305
|
ariaDescribedby: ariaErrorId
|
|
297
306
|
},
|
|
298
|
-
autoComplete: false
|
|
307
|
+
autoComplete: false,
|
|
308
|
+
...DropdownSearchTextBoxProps
|
|
299
309
|
}))) : null, /*#__PURE__*/React.createElement(CardContent, {
|
|
300
310
|
shrink: true,
|
|
301
311
|
customClass: !tabletMode && dropBoxSize ? style[dropBoxSize] : '',
|
|
@@ -323,7 +333,8 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
323
333
|
a11y: {
|
|
324
334
|
ariaParentRole: 'listbox',
|
|
325
335
|
role: 'option'
|
|
326
|
-
}
|
|
336
|
+
},
|
|
337
|
+
...SuggestionsProps
|
|
327
338
|
}) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
328
339
|
isLoading: isFetchingOptions,
|
|
329
340
|
options: options,
|
|
@@ -328,6 +328,7 @@ class SelectWithIcon extends Component {
|
|
|
328
328
|
targetOffset,
|
|
329
329
|
isRestrictScroll,
|
|
330
330
|
valueKey,
|
|
331
|
+
secondaryValueKey,
|
|
331
332
|
idKey,
|
|
332
333
|
needListBorder,
|
|
333
334
|
needTick,
|
|
@@ -367,7 +368,8 @@ class SelectWithIcon extends Component {
|
|
|
367
368
|
let {
|
|
368
369
|
TextBoxProps = {},
|
|
369
370
|
DropdownSearchTextBoxProps = {},
|
|
370
|
-
TextBoxIconProps = {}
|
|
371
|
+
TextBoxIconProps = {},
|
|
372
|
+
ListItemProps
|
|
371
373
|
} = customProps;
|
|
372
374
|
return /*#__PURE__*/React.createElement("div", {
|
|
373
375
|
className: `${style.container} ${style[`box_${size}`]} ${isReadOnly ? style.readonly : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''}`,
|
|
@@ -510,6 +512,7 @@ class SelectWithIcon extends Component {
|
|
|
510
512
|
return /*#__PURE__*/React.createElement(ListItemWithIcon, {
|
|
511
513
|
key: options[idKey],
|
|
512
514
|
value: options[valueKey],
|
|
515
|
+
secondaryValue: options[secondaryValueKey],
|
|
513
516
|
size: "medium",
|
|
514
517
|
onClick: this.handleChange,
|
|
515
518
|
id: options[idKey],
|
|
@@ -530,7 +533,8 @@ class SelectWithIcon extends Component {
|
|
|
530
533
|
role: 'option',
|
|
531
534
|
ariaSelected: selectedId === options[idKey],
|
|
532
535
|
ariaLabel: options[valueKey]
|
|
533
|
-
}
|
|
536
|
+
},
|
|
537
|
+
...ListItemProps
|
|
534
538
|
});
|
|
535
539
|
})) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
536
540
|
isLoading: isFetchingOptions,
|
|
@@ -6,6 +6,7 @@ export const Select_defaultProps = {
|
|
|
6
6
|
dataId: 'selectComponent',
|
|
7
7
|
dataSelectorId: 'select',
|
|
8
8
|
dropBoxSize: 'small',
|
|
9
|
+
isVirtualizerEnabled: false,
|
|
9
10
|
isDefaultSelectValue: true,
|
|
10
11
|
isDisabled: false,
|
|
11
12
|
isPopupOpenOnEnter: false,
|
|
@@ -97,6 +98,7 @@ export const SelectWithAvatar_defaultProps = {
|
|
|
97
98
|
isAbsolutePositioningNeeded: true,
|
|
98
99
|
isRestrictScroll: false,
|
|
99
100
|
i18nKeys: {},
|
|
101
|
+
customProps: {},
|
|
100
102
|
needEffect: true,
|
|
101
103
|
isLoading: false
|
|
102
104
|
};
|
|
@@ -12,6 +12,7 @@ export const Select_propTypes = {
|
|
|
12
12
|
defaultDropBoxPosition: PropTypes.string,
|
|
13
13
|
dropBoxSize: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
14
14
|
emptyMessage: PropTypes.string,
|
|
15
|
+
isVirtualizerEnabled: PropTypes.bool,
|
|
15
16
|
excludeOptions: PropTypes.array,
|
|
16
17
|
getChildren: PropTypes.func,
|
|
17
18
|
getContainerRef: PropTypes.func,
|
|
@@ -63,6 +64,8 @@ export const Select_propTypes = {
|
|
|
63
64
|
searchBoxSize: PropTypes.string,
|
|
64
65
|
searchDebounceTime: PropTypes.number,
|
|
65
66
|
searchEmptyMessage: PropTypes.string,
|
|
67
|
+
searchFields: PropTypes.arrayOf(PropTypes.string),
|
|
68
|
+
secondaryField: PropTypes.string,
|
|
66
69
|
selectedValue: PropTypes.oneOfType([PropTypes.oneOfType([PropTypes.string, PropTypes.number]), PropTypes.shape({
|
|
67
70
|
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
68
71
|
text: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
@@ -120,6 +123,7 @@ export const GroupSelect_propTypes = {
|
|
|
120
123
|
searchBoxPlaceHolder: PropTypes.string,
|
|
121
124
|
needSearch: PropTypes.bool,
|
|
122
125
|
searchEmptyMessage: PropTypes.string,
|
|
126
|
+
secondaryField: PropTypes.string,
|
|
123
127
|
getRef: PropTypes.func,
|
|
124
128
|
isDisabled: PropTypes.bool,
|
|
125
129
|
isReadOnly: PropTypes.bool,
|
|
@@ -281,6 +285,7 @@ export const SelectWithIcon_propTypes = {
|
|
|
281
285
|
removeClose: PropTypes.func,
|
|
282
286
|
searchBoxPlaceHolder: PropTypes.string,
|
|
283
287
|
searchEmptyMessage: PropTypes.string,
|
|
288
|
+
secondaryValueKey: PropTypes.string,
|
|
284
289
|
selectedId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
285
290
|
selectedValue: PropTypes.string,
|
|
286
291
|
size: PropTypes.oneOf(['small', 'medium']),
|
|
@@ -305,6 +310,7 @@ export const SelectWithIcon_propTypes = {
|
|
|
305
310
|
customProps: PropTypes.shape({
|
|
306
311
|
TextBoxProps: PropTypes.object,
|
|
307
312
|
DropdownSearchTextBoxProps: PropTypes.object,
|
|
313
|
+
SuggestionsProps: PropTypes.object,
|
|
308
314
|
TextBoxIconProps: PropTypes.object
|
|
309
315
|
})
|
|
310
316
|
};
|
package/es/utils/Common.js
CHANGED
|
@@ -43,8 +43,12 @@ const getDisabledOptions = props => props.disabledOptions || dummyArray;
|
|
|
43
43
|
|
|
44
44
|
const getListItemProps = props => props.listItemProps || '';
|
|
45
45
|
|
|
46
|
+
const getlistItemCustomProps = props => props.listItemCustomProps || dummyObj;
|
|
47
|
+
|
|
48
|
+
const defaultSearchFields = ['value'];
|
|
49
|
+
|
|
46
50
|
const getSearchFields = props => {
|
|
47
|
-
return props.searchFields ||
|
|
51
|
+
return props.searchFields || defaultSearchFields;
|
|
48
52
|
}; // const isObjectContainsSearchString = (searchFields = [], searchStr = '', obj) => {
|
|
49
53
|
// const matchedFields = searchFields.filter(element => {
|
|
50
54
|
// return getSearchString(obj[element]).indexOf(searchStr) !== -1
|
|
@@ -131,7 +135,7 @@ export const extractOptionId = id => {
|
|
|
131
135
|
}
|
|
132
136
|
};
|
|
133
137
|
export const extractOptionIdFromJson = (id, localData) => localData[id] || {};
|
|
134
|
-
export const makeFormatOptions = () => createSelector([getOptions, getValueField, getTextField, getImageField, getPrefixText, getIconName, getIconSize, getOptionType, getDisabledOptions, getListItemProps, getAllowValueFallback, getSearchFields, getSecondaryField], (options, valueField, textField, imageField, prefixText, iconName, iconSize, optionType, disabledOptions, listItemProps, allowValueFallback, searchFields, secondaryField) => {
|
|
138
|
+
export const makeFormatOptions = () => createSelector([getOptions, getValueField, getTextField, getImageField, getPrefixText, getIconName, getIconSize, getOptionType, getDisabledOptions, getListItemProps, getlistItemCustomProps, getAllowValueFallback, getSearchFields, getSecondaryField], (options, valueField, textField, imageField, prefixText, iconName, iconSize, optionType, disabledOptions, listItemProps, listItemCustomProps, allowValueFallback, searchFields, secondaryField) => {
|
|
135
139
|
const revampOptions = [];
|
|
136
140
|
const remvampOptionIds = [];
|
|
137
141
|
const normalizedAllOptions = {};
|
|
@@ -147,7 +151,8 @@ export const makeFormatOptions = () => createSelector([getOptions, getValueField
|
|
|
147
151
|
optionType: impOptionType,
|
|
148
152
|
iconName: impIconName,
|
|
149
153
|
iconSize: impIconSize,
|
|
150
|
-
listItemProps: listStyle
|
|
154
|
+
listItemProps: listStyle,
|
|
155
|
+
listItemCustomProps: listStyleCustomProps
|
|
151
156
|
} = option;
|
|
152
157
|
let id = typeof option === 'object' ? option[impValueField || valueField] : option;
|
|
153
158
|
const value = typeof option === 'object' ? option[impTextField || textField] : allowValueFallback ? option : '';
|
|
@@ -193,6 +198,10 @@ export const makeFormatOptions = () => createSelector([getOptions, getValueField
|
|
|
193
198
|
optionDetails.listItemProps = listStyle || listItemProps;
|
|
194
199
|
}
|
|
195
200
|
|
|
201
|
+
if (listStyleCustomProps || listItemCustomProps) {
|
|
202
|
+
optionDetails.listItemCustomProps = listStyleCustomProps || listItemCustomProps;
|
|
203
|
+
}
|
|
204
|
+
|
|
196
205
|
normalizedFormatOptions[id] = optionDetails;
|
|
197
206
|
normalizedAllOptions[id] = { ...option,
|
|
198
207
|
groupId: prefixText
|
|
@@ -319,7 +328,8 @@ export const makeGetGroupSelectOptions = () => createSelector([getGroupedOptions
|
|
|
319
328
|
id: groupId,
|
|
320
329
|
name,
|
|
321
330
|
valueField,
|
|
322
|
-
textField
|
|
331
|
+
textField,
|
|
332
|
+
secondaryField
|
|
323
333
|
} = group;
|
|
324
334
|
|
|
325
335
|
if (!getIsEmptyValue(groupId) && groupIds.indexOf(groupId) === -1) {
|
|
@@ -334,6 +344,7 @@ export const makeGetGroupSelectOptions = () => createSelector([getGroupedOptions
|
|
|
334
344
|
options,
|
|
335
345
|
valueField,
|
|
336
346
|
textField,
|
|
347
|
+
secondaryField,
|
|
337
348
|
prefixText: groupId,
|
|
338
349
|
allowValueFallback
|
|
339
350
|
});
|
package/lib/ListItem/ListItem.js
CHANGED
|
@@ -123,7 +123,8 @@ var ListItem = /*#__PURE__*/function (_React$Component) {
|
|
|
123
123
|
customClass = _this$props4.customClass,
|
|
124
124
|
customProps = _this$props4.customProps,
|
|
125
125
|
needMultiLineText = _this$props4.needMultiLineText,
|
|
126
|
-
secondaryValue = _this$props4.secondaryValue
|
|
126
|
+
secondaryValue = _this$props4.secondaryValue,
|
|
127
|
+
renderValueRightPlaceholderNode = _this$props4.renderValueRightPlaceholderNode;
|
|
127
128
|
var _customProps$ListItem = customProps.ListItemProps,
|
|
128
129
|
ListItemProps = _customProps$ListItem === void 0 ? {} : _customProps$ListItem,
|
|
129
130
|
_customProps$Containe = customProps.ContainerProps,
|
|
@@ -131,7 +132,9 @@ var ListItem = /*#__PURE__*/function (_React$Component) {
|
|
|
131
132
|
var _customClass$customLi = customClass.customListItem,
|
|
132
133
|
customListItem = _customClass$customLi === void 0 ? '' : _customClass$customLi,
|
|
133
134
|
_customClass$customTi = customClass.customTickIcon,
|
|
134
|
-
customTickIcon = _customClass$customTi === void 0 ? '' : _customClass$customTi
|
|
135
|
+
customTickIcon = _customClass$customTi === void 0 ? '' : _customClass$customTi,
|
|
136
|
+
_customClass$customVa = customClass.customValueRightPlaceholder,
|
|
137
|
+
customValueRightPlaceholder = _customClass$customVa === void 0 ? '' : _customClass$customVa;
|
|
135
138
|
|
|
136
139
|
var listA11y = _objectSpread({
|
|
137
140
|
ariaHidden: true,
|
|
@@ -172,7 +175,9 @@ var ListItem = /*#__PURE__*/function (_React$Component) {
|
|
|
172
175
|
shrink: true,
|
|
173
176
|
adjust: true,
|
|
174
177
|
className: needMultiLineText ? _ListItemModule["default"].multiLineValue : _ListItemModule["default"].value
|
|
175
|
-
}, value) : null,
|
|
178
|
+
}, value) : null, typeof renderValueRightPlaceholderNode === 'function' ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
179
|
+
className: customValueRightPlaceholder
|
|
180
|
+
}, renderValueRightPlaceholderNode()) : null, children ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
176
181
|
shrink: true,
|
|
177
182
|
adjust: true,
|
|
178
183
|
className: _ListItemModule["default"].children
|
|
@@ -130,6 +130,7 @@ var ListItemWithAvatar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
130
130
|
customProps = _this$props4.customProps,
|
|
131
131
|
needMultiLineText = _this$props4.needMultiLineText,
|
|
132
132
|
secondaryValue = _this$props4.secondaryValue,
|
|
133
|
+
renderValueRightPlaceholderNode = _this$props4.renderValueRightPlaceholderNode,
|
|
133
134
|
lhsAlignContent = _this$props4.lhsAlignContent;
|
|
134
135
|
var _customProps$ListItem = customProps.ListItemProps,
|
|
135
136
|
ListItemProps = _customProps$ListItem === void 0 ? {} : _customProps$ListItem,
|
|
@@ -144,7 +145,9 @@ var ListItemWithAvatar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
144
145
|
_customClass$customAv = customClass.customAvatar,
|
|
145
146
|
customAvatar = _customClass$customAv === void 0 ? '' : _customClass$customAv,
|
|
146
147
|
_customClass$customAv2 = customClass.customAvatarTeam,
|
|
147
|
-
customAvatarTeam = _customClass$customAv2 === void 0 ? '' : _customClass$customAv2
|
|
148
|
+
customAvatarTeam = _customClass$customAv2 === void 0 ? '' : _customClass$customAv2,
|
|
149
|
+
_customClass$customVa = customClass.customValueRightPlaceholder,
|
|
150
|
+
customValueRightPlaceholder = _customClass$customVa === void 0 ? '' : _customClass$customVa;
|
|
148
151
|
|
|
149
152
|
var listA11y = _objectSpread({
|
|
150
153
|
ariaHidden: true,
|
|
@@ -200,16 +203,20 @@ var ListItemWithAvatar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
200
203
|
customClass: customAvatar
|
|
201
204
|
}, AvatarProps)))) : null, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
202
205
|
flexible: true,
|
|
203
|
-
|
|
204
|
-
}, /*#__PURE__*/_react["default"].createElement(_Layout.
|
|
205
|
-
|
|
206
|
+
className: _ListItemModule["default"].leftBox
|
|
207
|
+
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
208
|
+
className: _ListItemModule["default"].titleBox
|
|
206
209
|
}, value ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
210
|
+
shrink: true,
|
|
211
|
+
adjust: true,
|
|
207
212
|
"data-title": isDisabled ? null : title,
|
|
208
213
|
className: needMultiLineText ? _ListItemModule["default"].multiLineValue : _ListItemModule["default"].value
|
|
209
|
-
}, value) : null,
|
|
214
|
+
}, value) : null, typeof renderValueRightPlaceholderNode === 'function' ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
215
|
+
className: customValueRightPlaceholder
|
|
216
|
+
}, renderValueRightPlaceholderNode()) : null), secondaryValue ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
210
217
|
"data-title": isDisabled ? null : secondaryValue,
|
|
211
218
|
className: "".concat(_ListItemModule["default"].secondaryField, " ").concat(needMultiLineText ? _ListItemModule["default"].multiLine : _ListItemModule["default"].secondaryValue)
|
|
212
|
-
}, secondaryValue) : null)
|
|
219
|
+
}, secondaryValue) : null), needTick && active ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
213
220
|
className: _ListItemModule["default"].tickIcon,
|
|
214
221
|
"aria-hidden": ariaHidden,
|
|
215
222
|
dataId: "".concat(dataIdString, "_tickIcon"),
|
|
@@ -118,6 +118,7 @@ var ListItemWithCheckBox = /*#__PURE__*/function (_React$Component) {
|
|
|
118
118
|
customProps = _this$props4.customProps,
|
|
119
119
|
needMultiLineText = _this$props4.needMultiLineText,
|
|
120
120
|
secondaryValue = _this$props4.secondaryValue,
|
|
121
|
+
renderValueRightPlaceholderNode = _this$props4.renderValueRightPlaceholderNode,
|
|
121
122
|
lhsAlignContent = _this$props4.lhsAlignContent,
|
|
122
123
|
lhsJustifyContent = _this$props4.lhsJustifyContent;
|
|
123
124
|
|
|
@@ -134,7 +135,9 @@ var ListItemWithCheckBox = /*#__PURE__*/function (_React$Component) {
|
|
|
134
135
|
_customClass$customCh = customClass.customCheckBox,
|
|
135
136
|
customCheckBox = _customClass$customCh === void 0 ? '' : _customClass$customCh,
|
|
136
137
|
_customClass$customLa = customClass.customLabel,
|
|
137
|
-
customLabel = _customClass$customLa === void 0 ? '' : _customClass$customLa
|
|
138
|
+
customLabel = _customClass$customLa === void 0 ? '' : _customClass$customLa,
|
|
139
|
+
_customClass$customVa = customClass.customValueRightPlaceholder,
|
|
140
|
+
customValueRightPlaceholder = _customClass$customVa === void 0 ? '' : _customClass$customVa;
|
|
138
141
|
return /*#__PURE__*/_react["default"].createElement(_ListContainer["default"], _extends({
|
|
139
142
|
a11y: listA11y,
|
|
140
143
|
size: size,
|
|
@@ -169,16 +172,20 @@ var ListItemWithCheckBox = /*#__PURE__*/function (_React$Component) {
|
|
|
169
172
|
}
|
|
170
173
|
}))), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
171
174
|
flexible: true,
|
|
172
|
-
|
|
173
|
-
}, /*#__PURE__*/_react["default"].createElement(_Layout.
|
|
174
|
-
|
|
175
|
+
className: _ListItemModule["default"].leftBox
|
|
176
|
+
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
177
|
+
className: _ListItemModule["default"].titleBox
|
|
175
178
|
}, value ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
179
|
+
shrink: true,
|
|
180
|
+
adjust: true,
|
|
176
181
|
"data-title": isDisabled ? null : title,
|
|
177
182
|
className: needMultiLineText ? _ListItemModule["default"].multiLineValue : _ListItemModule["default"].value
|
|
178
|
-
}, value) : null,
|
|
183
|
+
}, value) : null, typeof renderValueRightPlaceholderNode === 'function' ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
184
|
+
className: customValueRightPlaceholder
|
|
185
|
+
}, renderValueRightPlaceholderNode()) : null), secondaryValue ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
179
186
|
"data-title": isDisabled ? null : secondaryValue,
|
|
180
187
|
className: "".concat(_ListItemModule["default"].secondaryField, " ").concat(needMultiLineText ? _ListItemModule["default"].multiLine : _ListItemModule["default"].secondaryValue)
|
|
181
|
-
}, secondaryValue) : null))
|
|
188
|
+
}, secondaryValue) : null));
|
|
182
189
|
}
|
|
183
190
|
}]);
|
|
184
191
|
|
|
@@ -123,9 +123,11 @@ var ListItemWithIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
123
123
|
disableTitle = _this$props4.disableTitle,
|
|
124
124
|
a11y = _this$props4.a11y,
|
|
125
125
|
customClass = _this$props4.customClass,
|
|
126
|
+
customValueRightPlaceholderClass = _this$props4.customValueRightPlaceholderClass,
|
|
126
127
|
customProps = _this$props4.customProps,
|
|
127
128
|
needMultiLineText = _this$props4.needMultiLineText,
|
|
128
129
|
secondaryValue = _this$props4.secondaryValue,
|
|
130
|
+
renderValueRightPlaceholderNode = _this$props4.renderValueRightPlaceholderNode,
|
|
129
131
|
lhsAlignContent = _this$props4.lhsAlignContent,
|
|
130
132
|
lhsJustifyContent = _this$props4.lhsJustifyContent;
|
|
131
133
|
var _customProps$ListItem = customProps.ListItemProps,
|
|
@@ -178,17 +180,21 @@ var ListItemWithIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
178
180
|
className: iconClass
|
|
179
181
|
}) : null, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
180
182
|
flexible: true,
|
|
181
|
-
|
|
182
|
-
}, /*#__PURE__*/_react["default"].createElement(_Layout.
|
|
183
|
-
|
|
183
|
+
className: _ListItemModule["default"].leftBox
|
|
184
|
+
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
185
|
+
className: _ListItemModule["default"].titleBox
|
|
184
186
|
}, value ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
187
|
+
shrink: true,
|
|
188
|
+
adjust: true,
|
|
185
189
|
className: needMultiLineText ? _ListItemModule["default"].multiLineValue : _ListItemModule["default"].value,
|
|
186
190
|
"data-title": isDisabled ? null : title,
|
|
187
191
|
dataId: "".concat(dataIdString, "_Text")
|
|
188
|
-
}, value) : null,
|
|
192
|
+
}, value) : null, typeof renderValueRightPlaceholderNode === 'function' ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
193
|
+
className: customValueRightPlaceholderClass
|
|
194
|
+
}, renderValueRightPlaceholderNode()) : null), secondaryValue ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
189
195
|
"data-title": isDisabled ? null : secondaryValue,
|
|
190
196
|
className: "".concat(_ListItemModule["default"].secondaryField, " ").concat(needMultiLineText ? _ListItemModule["default"].multiLine : _ListItemModule["default"].secondaryValue)
|
|
191
|
-
}, secondaryValue) : null)
|
|
197
|
+
}, secondaryValue) : null), needTick && active ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
192
198
|
className: _ListItemModule["default"].tickIcon,
|
|
193
199
|
"aria-hidden": ariaHidden,
|
|
194
200
|
dataId: "".concat(dataIdString, "_tickIcon"),
|
|
@@ -119,6 +119,7 @@ var ListItemWithRadio = /*#__PURE__*/function (_React$Component) {
|
|
|
119
119
|
customProps = _this$props4.customProps,
|
|
120
120
|
needMultiLineText = _this$props4.needMultiLineText,
|
|
121
121
|
secondaryValue = _this$props4.secondaryValue,
|
|
122
|
+
renderValueRightPlaceholderNode = _this$props4.renderValueRightPlaceholderNode,
|
|
122
123
|
lhsAlignContent = _this$props4.lhsAlignContent,
|
|
123
124
|
lhsJustifyContent = _this$props4.lhsJustifyContent;
|
|
124
125
|
var _customProps$ListItem = customProps.ListItemProps,
|
|
@@ -135,7 +136,9 @@ var ListItemWithRadio = /*#__PURE__*/function (_React$Component) {
|
|
|
135
136
|
_customClass$customRa = customClass.customRadio,
|
|
136
137
|
customRadio = _customClass$customRa === void 0 ? '' : _customClass$customRa,
|
|
137
138
|
_customClass$customRa2 = customClass.customRadioWrap,
|
|
138
|
-
customRadioWrap = _customClass$customRa2 === void 0 ? '' : _customClass$customRa2
|
|
139
|
+
customRadioWrap = _customClass$customRa2 === void 0 ? '' : _customClass$customRa2,
|
|
140
|
+
_customClass$customVa = customClass.customValueRightPlaceholder,
|
|
141
|
+
customValueRightPlaceholder = _customClass$customVa === void 0 ? '' : _customClass$customVa;
|
|
139
142
|
return /*#__PURE__*/_react["default"].createElement(_ListContainer["default"], _extends({
|
|
140
143
|
a11y: listA11y,
|
|
141
144
|
size: size,
|
|
@@ -172,16 +175,20 @@ var ListItemWithRadio = /*#__PURE__*/function (_React$Component) {
|
|
|
172
175
|
}
|
|
173
176
|
}))), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
174
177
|
flexible: true,
|
|
175
|
-
|
|
176
|
-
}, /*#__PURE__*/_react["default"].createElement(_Layout.
|
|
177
|
-
|
|
178
|
+
className: _ListItemModule["default"].leftBox
|
|
179
|
+
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
180
|
+
className: _ListItemModule["default"].titleBox
|
|
178
181
|
}, value ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
182
|
+
shrink: true,
|
|
183
|
+
adjust: true,
|
|
179
184
|
"data-title": disableTitle ? null : title,
|
|
180
185
|
className: needMultiLineText ? _ListItemModule["default"].multiLineValue : _ListItemModule["default"].value
|
|
181
|
-
}, value) : null,
|
|
186
|
+
}, value) : null, typeof renderValueRightPlaceholderNode === 'function' ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
187
|
+
className: customValueRightPlaceholder
|
|
188
|
+
}, renderValueRightPlaceholderNode()) : null), secondaryValue ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
182
189
|
"data-title": isDisabled ? null : secondaryValue,
|
|
183
190
|
className: "".concat(_ListItemModule["default"].secondaryField, " ").concat(needMultiLineText ? _ListItemModule["default"].multiLine : _ListItemModule["default"].secondaryValue)
|
|
184
|
-
}, secondaryValue) : null))
|
|
191
|
+
}, secondaryValue) : null));
|
|
185
192
|
}
|
|
186
193
|
}]);
|
|
187
194
|
|
|
@@ -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
|
});
|
|
@@ -50,4 +50,27 @@ describe('ListItemWithCheckBox', function () {
|
|
|
50
50
|
|
|
51
51
|
expect(asFragment()).toMatchSnapshot();
|
|
52
52
|
});
|
|
53
|
+
test('ListItemWithCheckBox with renderValueRightPlaceholderNode', function () {
|
|
54
|
+
var _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ListItemWithCheckBox["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('ListItemWithCheckBox with renderValueRightPlaceholderNode & it\'s custom class', function () {
|
|
64
|
+
var _render7 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ListItemWithCheckBox["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
|
});
|
|
@@ -50,4 +50,25 @@ describe('ListItemWithIcon', function () {
|
|
|
50
50
|
|
|
51
51
|
expect(asFragment()).toMatchSnapshot();
|
|
52
52
|
});
|
|
53
|
+
test('ListItemWithIcon with renderValueRightPlaceholderNode', function () {
|
|
54
|
+
var _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ListItemWithIcon["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('ListItemWithIcon with renderValueRightPlaceholderNode & it\'s custom class', function () {
|
|
64
|
+
var _render7 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ListItemWithIcon["default"], {
|
|
65
|
+
renderValueRightPlaceholderNode: function renderValueRightPlaceholderNode() {
|
|
66
|
+
return /*#__PURE__*/_react["default"].createElement("div", null, "Custom Placeholder");
|
|
67
|
+
},
|
|
68
|
+
customValueRightPlaceholderClass: "customValueRightPlaceholderClass"
|
|
69
|
+
})),
|
|
70
|
+
asFragment = _render7.asFragment;
|
|
71
|
+
|
|
72
|
+
expect(asFragment()).toMatchSnapshot();
|
|
73
|
+
});
|
|
53
74
|
});
|
|
@@ -50,4 +50,27 @@ describe('ListItemWithRadio', function () {
|
|
|
50
50
|
|
|
51
51
|
expect(asFragment()).toMatchSnapshot();
|
|
52
52
|
});
|
|
53
|
+
test('ListItemWithRadio with renderValueRightPlaceholderNode', function () {
|
|
54
|
+
var _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ListItemWithRadio["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('ListItemWithRadio with renderValueRightPlaceholderNode & it\'s custom class', function () {
|
|
64
|
+
var _render7 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ListItemWithRadio["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
|
});
|