@zohodesk/components 1.0.0-temp-199.14 → 1.0.0-temp-222
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/assets/Appearance/dark/mode/Component_DarkMode.module.css +1 -0
- package/assets/Appearance/light/mode/Component_LightMode.module.css +1 -0
- package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +1 -0
- package/es/ListItem/ListItem.js +3 -5
- package/es/ListItem/ListItem.module.css +46 -23
- package/es/ListItem/ListItemWithAvatar.js +16 -13
- package/es/ListItem/ListItemWithCheckBox.js +16 -12
- package/es/ListItem/ListItemWithIcon.js +17 -14
- package/es/ListItem/ListItemWithRadio.js +16 -12
- package/es/ListItem/props/defaultProps.js +8 -6
- package/es/ListItem/props/propTypes.js +11 -5
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +2 -7
- package/es/MultiSelect/AdvancedMultiSelect.js +7 -3
- package/es/MultiSelect/MultiSelect.js +7 -8
- package/es/MultiSelect/MultiSelectWithAvatar.js +3 -1
- package/es/MultiSelect/Suggestions.js +34 -11
- package/es/MultiSelect/props/defaultProps.js +1 -4
- package/es/MultiSelect/props/propTypes.js +8 -11
- package/es/Select/GroupSelect.js +1 -5
- package/es/Select/SelectWithAvatar.js +2 -7
- package/es/Select/SelectWithIcon.js +2 -4
- package/es/Select/props/defaultProps.js +1 -2
- package/es/Select/props/propTypes.js +3 -8
- package/es/common/common.module.css +6 -1
- package/es/utils/dropDownUtils.js +19 -10
- package/lib/ListItem/ListItem.js +3 -5
- package/lib/ListItem/ListItem.module.css +46 -23
- package/lib/ListItem/ListItemWithAvatar.js +15 -12
- package/lib/ListItem/ListItemWithCheckBox.js +15 -11
- package/lib/ListItem/ListItemWithIcon.js +16 -13
- package/lib/ListItem/ListItemWithRadio.js +15 -11
- package/lib/ListItem/props/defaultProps.js +8 -6
- package/lib/ListItem/props/propTypes.js +11 -6
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +3 -8
- package/lib/MultiSelect/AdvancedMultiSelect.js +72 -67
- package/lib/MultiSelect/MultiSelect.js +8 -7
- package/lib/MultiSelect/MultiSelectWithAvatar.js +3 -1
- package/lib/MultiSelect/Suggestions.js +36 -11
- package/lib/MultiSelect/props/defaultProps.js +1 -4
- package/lib/MultiSelect/props/propTypes.js +8 -10
- package/lib/Select/GroupSelect.js +2 -4
- package/lib/Select/SelectWithAvatar.js +3 -8
- package/lib/Select/SelectWithIcon.js +3 -5
- package/lib/Select/props/defaultProps.js +1 -2
- package/lib/Select/props/propTypes.js +3 -8
- package/lib/common/common.module.css +6 -1
- package/lib/utils/dropDownUtils.js +21 -10
- package/package.json +4 -4
- package/result.json +1 -1
|
@@ -272,7 +272,8 @@ export class MultiSelectComponent extends React.Component {
|
|
|
272
272
|
const {
|
|
273
273
|
selectedOptions,
|
|
274
274
|
needLocalSearch,
|
|
275
|
-
keepSelectedOptions
|
|
275
|
+
keepSelectedOptions,
|
|
276
|
+
searchFields
|
|
276
277
|
} = this.props;
|
|
277
278
|
const {
|
|
278
279
|
suggestions,
|
|
@@ -282,7 +283,8 @@ export class MultiSelectComponent extends React.Component {
|
|
|
282
283
|
selectedOptions,
|
|
283
284
|
searchStr: getSearchString(searchStr),
|
|
284
285
|
needSearch: needLocalSearch,
|
|
285
|
-
keepSelectedOptions
|
|
286
|
+
keepSelectedOptions,
|
|
287
|
+
searchFields
|
|
286
288
|
});
|
|
287
289
|
this.suggestionsOrder = suggestionIds;
|
|
288
290
|
return suggestions;
|
|
@@ -1018,11 +1020,8 @@ export class MultiSelectComponent extends React.Component {
|
|
|
1018
1020
|
isLoading,
|
|
1019
1021
|
selectAllText,
|
|
1020
1022
|
needSelectAll,
|
|
1021
|
-
|
|
1023
|
+
secondaryField
|
|
1022
1024
|
} = this.props;
|
|
1023
|
-
const {
|
|
1024
|
-
SuggestionsProps = {}
|
|
1025
|
-
} = customProps;
|
|
1026
1025
|
const {
|
|
1027
1026
|
selectedOptions,
|
|
1028
1027
|
searchStr,
|
|
@@ -1110,10 +1109,10 @@ export class MultiSelectComponent extends React.Component {
|
|
|
1110
1109
|
dataId: `${dataId}_Options`,
|
|
1111
1110
|
palette: palette,
|
|
1112
1111
|
selectedOptions: selectedOptionIds,
|
|
1112
|
+
secondaryField: secondaryField,
|
|
1113
1113
|
a11y: {
|
|
1114
1114
|
role: 'option'
|
|
1115
|
-
}
|
|
1116
|
-
...SuggestionsProps
|
|
1115
|
+
}
|
|
1117
1116
|
}) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
1118
1117
|
isLoading: isFetchingOptions,
|
|
1119
1118
|
options: options,
|
|
@@ -89,7 +89,8 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
89
89
|
needEffect,
|
|
90
90
|
isLoading,
|
|
91
91
|
keepSelectedOptions,
|
|
92
|
-
customProps
|
|
92
|
+
customProps,
|
|
93
|
+
secondaryField
|
|
93
94
|
} = this.props;
|
|
94
95
|
let {
|
|
95
96
|
SuggestionsProps = {}
|
|
@@ -177,6 +178,7 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
177
178
|
dataId: `${dataId}_Options`,
|
|
178
179
|
palette: palette,
|
|
179
180
|
selectedOptions: selectedOptionIds,
|
|
181
|
+
secondaryField: secondaryField,
|
|
180
182
|
a11y: {
|
|
181
183
|
role: 'option'
|
|
182
184
|
},
|
|
@@ -8,6 +8,7 @@ import ListItem from "../ListItem/ListItem";
|
|
|
8
8
|
import ListItemWithAvatar from "../ListItem/ListItemWithAvatar";
|
|
9
9
|
import ListItemWithIcon from "../ListItem/ListItemWithIcon";
|
|
10
10
|
import { Container, Box } from "../Layout";
|
|
11
|
+
import ListContainer from "../ListItem/ListContainer";
|
|
11
12
|
export default class Suggestions extends React.PureComponent {
|
|
12
13
|
render() {
|
|
13
14
|
const {
|
|
@@ -28,23 +29,18 @@ export default class Suggestions extends React.PureComponent {
|
|
|
28
29
|
palette,
|
|
29
30
|
htmlId,
|
|
30
31
|
a11y,
|
|
31
|
-
|
|
32
|
-
needMultiLineText
|
|
32
|
+
secondaryField
|
|
33
33
|
} = this.props;
|
|
34
34
|
const {
|
|
35
35
|
ariaParentRole,
|
|
36
36
|
ariaMultiselectable
|
|
37
37
|
} = a11y;
|
|
38
|
-
const {
|
|
39
|
-
containerClass = ''
|
|
40
|
-
} = customClass;
|
|
41
38
|
return /*#__PURE__*/React.createElement(Container, {
|
|
42
39
|
isCover: false,
|
|
43
40
|
role: ariaParentRole,
|
|
44
41
|
id: htmlId,
|
|
45
42
|
tabindex: "0",
|
|
46
|
-
"aria-multiselectable": ariaMultiselectable
|
|
47
|
-
className: containerClass
|
|
43
|
+
"aria-multiselectable": ariaMultiselectable
|
|
48
44
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
49
45
|
dataId: `${dataId}`,
|
|
50
46
|
className: className ? className : ''
|
|
@@ -69,7 +65,6 @@ export default class Suggestions extends React.PureComponent {
|
|
|
69
65
|
});
|
|
70
66
|
const commonProps = {
|
|
71
67
|
isDisabled,
|
|
72
|
-
needMultiLineText,
|
|
73
68
|
...listItemCustomProps
|
|
74
69
|
};
|
|
75
70
|
|
|
@@ -78,7 +73,33 @@ export default class Suggestions extends React.PureComponent {
|
|
|
78
73
|
ListItemProps: { ...listItemProps
|
|
79
74
|
}
|
|
80
75
|
};
|
|
81
|
-
}
|
|
76
|
+
} // if(secondaryField) {
|
|
77
|
+
// return (
|
|
78
|
+
// <ListContainer
|
|
79
|
+
// active={isActive}
|
|
80
|
+
// iconSize={iconSize}
|
|
81
|
+
// size={listItemSize}
|
|
82
|
+
// palette={palette}
|
|
83
|
+
// a11y={list_a11y}
|
|
84
|
+
// highlight={isHighlight}
|
|
85
|
+
// isDisabled={isDisabled}
|
|
86
|
+
// autoHover
|
|
87
|
+
// needTick={needTick}
|
|
88
|
+
// needBorder={needBorder}
|
|
89
|
+
// onClick={onClick}
|
|
90
|
+
// onMouseEnter={onMouseEnter}
|
|
91
|
+
// eleRef={getRef}
|
|
92
|
+
// key={`${id}avatarListItem`}
|
|
93
|
+
// >
|
|
94
|
+
// <Box flexible>
|
|
95
|
+
// <div>{value}</div>
|
|
96
|
+
// <div>{suggestion[secondaryField]}</div>
|
|
97
|
+
// </Box>
|
|
98
|
+
// </ListContainer>
|
|
99
|
+
// )
|
|
100
|
+
// }
|
|
101
|
+
// else
|
|
102
|
+
|
|
82
103
|
|
|
83
104
|
if (optionType === 'avatar') {
|
|
84
105
|
return /*#__PURE__*/React.createElement(ListItemWithAvatar, { ...commonProps,
|
|
@@ -99,7 +120,8 @@ export default class Suggestions extends React.PureComponent {
|
|
|
99
120
|
size: listItemSize,
|
|
100
121
|
avatarPalette: avatarPalette,
|
|
101
122
|
palette: palette,
|
|
102
|
-
a11y: list_a11y
|
|
123
|
+
a11y: list_a11y,
|
|
124
|
+
secondaryValue: suggestion[secondaryField] || undefined
|
|
103
125
|
});
|
|
104
126
|
} else if (optionType === 'icon') {
|
|
105
127
|
return /*#__PURE__*/React.createElement(ListItemWithIcon, { ...commonProps,
|
|
@@ -119,7 +141,8 @@ export default class Suggestions extends React.PureComponent {
|
|
|
119
141
|
iconSize: iconSize,
|
|
120
142
|
size: listItemSize,
|
|
121
143
|
palette: palette,
|
|
122
|
-
a11y: list_a11y
|
|
144
|
+
a11y: list_a11y,
|
|
145
|
+
secondaryValue: suggestion[secondaryField] || undefined
|
|
123
146
|
});
|
|
124
147
|
}
|
|
125
148
|
|
|
@@ -38,7 +38,6 @@ export const AdvancedGroupMultiSelect_defaultProps = {
|
|
|
38
38
|
palette: 'default',
|
|
39
39
|
isLoading: false,
|
|
40
40
|
dataSelectorId: 'advancedGroupMultiSelect',
|
|
41
|
-
customProps: {},
|
|
42
41
|
allowValueFallback: true
|
|
43
42
|
};
|
|
44
43
|
export const AdvancedMultiSelect_defaultProps = {
|
|
@@ -167,7 +166,5 @@ export const SelectedOptions_defaultProps = {
|
|
|
167
166
|
dataId: 'selectedOptions'
|
|
168
167
|
};
|
|
169
168
|
export const Suggestions_defaultProps = {
|
|
170
|
-
a11y: {}
|
|
171
|
-
customClass: {},
|
|
172
|
-
needMultiLineText: false
|
|
169
|
+
a11y: {}
|
|
173
170
|
};
|
|
@@ -46,6 +46,8 @@ export const MultiSelect_propTypes = {
|
|
|
46
46
|
a11y: PropTypes.shape({
|
|
47
47
|
clearLabel: PropTypes.string
|
|
48
48
|
}),
|
|
49
|
+
secondaryField: PropTypes.string,
|
|
50
|
+
searchFields: PropTypes.arrayOf(PropTypes.string),
|
|
49
51
|
isAnimate: PropTypes.bool,
|
|
50
52
|
isBoxPaddingNeed: PropTypes.bool,
|
|
51
53
|
isDisabled: PropTypes.bool,
|
|
@@ -110,8 +112,7 @@ export const MultiSelect_propTypes = {
|
|
|
110
112
|
setAriaId: PropTypes.string,
|
|
111
113
|
ariaErrorId: PropTypes.string,
|
|
112
114
|
customProps: PropTypes.shape({
|
|
113
|
-
TextBoxIconProps: PropTypes.object
|
|
114
|
-
SuggestionsProps: PropTypes.object
|
|
115
|
+
TextBoxIconProps: PropTypes.object
|
|
115
116
|
}),
|
|
116
117
|
isFocus: PropTypes.bool,
|
|
117
118
|
allowValueFallback: PropTypes.bool
|
|
@@ -172,6 +173,7 @@ export const Suggestions_propTypes = {
|
|
|
172
173
|
palette: PropTypes.string,
|
|
173
174
|
selectedOptions: PropTypes.array,
|
|
174
175
|
htmlId: PropTypes.string,
|
|
176
|
+
secondaryField: PropTypes.string,
|
|
175
177
|
suggestions: PropTypes.arrayOf(PropTypes.shape({
|
|
176
178
|
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
177
179
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
@@ -179,11 +181,7 @@ export const Suggestions_propTypes = {
|
|
|
179
181
|
logo: PropTypes.string,
|
|
180
182
|
optionType: PropTypes.string,
|
|
181
183
|
listItemProps: PropTypes.object
|
|
182
|
-
}))
|
|
183
|
-
customClass: PropTypes.shape({
|
|
184
|
-
containerClass: PropTypes.string
|
|
185
|
-
}),
|
|
186
|
-
needMultiLineText: PropTypes.bool
|
|
184
|
+
}))
|
|
187
185
|
};
|
|
188
186
|
export const AdvancedGroupMultiSelect_propTypes = {
|
|
189
187
|
animationStyle: PropTypes.string,
|
|
@@ -255,10 +253,7 @@ export const AdvancedGroupMultiSelect_propTypes = {
|
|
|
255
253
|
children: PropTypes.node,
|
|
256
254
|
dataSelectorId: PropTypes.string,
|
|
257
255
|
isFocus: PropTypes.bool,
|
|
258
|
-
allowValueFallback: PropTypes.bool
|
|
259
|
-
customProps: PropTypes.shape({
|
|
260
|
-
SuggestionsProps: PropTypes.object
|
|
261
|
-
})
|
|
256
|
+
allowValueFallback: PropTypes.bool
|
|
262
257
|
};
|
|
263
258
|
export const AdvancedMultiSelect_propTypes = { ...MultiSelect_propTypes,
|
|
264
259
|
selectedOptionDetails: PropTypes.string,
|
|
@@ -289,6 +284,8 @@ export const AdvancedMultiSelect_propTypes = { ...MultiSelect_propTypes,
|
|
|
289
284
|
//For grouping multiSelect
|
|
290
285
|
optionType: PropTypes.oneOf(['default', 'avatar', 'icon']),
|
|
291
286
|
needEffect: PropTypes.bool,
|
|
287
|
+
secondaryField: PropTypes.string,
|
|
288
|
+
searchFields: PropTypes.arrayOf(PropTypes.string),
|
|
292
289
|
animationStyle: PropTypes.string,
|
|
293
290
|
defaultDropBoxPosition: PropTypes.oneOf(['bottom', 'top', 'left', 'right']),
|
|
294
291
|
dropBoxSize: PropTypes.oneOf(['small', 'medium', 'large']),
|
package/es/Select/GroupSelect.js
CHANGED
|
@@ -593,9 +593,6 @@ export class GroupSelectComponent extends PureComponent {
|
|
|
593
593
|
dataSelectorId,
|
|
594
594
|
customProps
|
|
595
595
|
} = this.props;
|
|
596
|
-
const {
|
|
597
|
-
SuggestionsProps = {}
|
|
598
|
-
} = customProps;
|
|
599
596
|
i18nKeys = Object.assign({}, i18nKeys, {
|
|
600
597
|
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
601
598
|
searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage
|
|
@@ -794,8 +791,7 @@ export class GroupSelectComponent extends PureComponent {
|
|
|
794
791
|
ariaParentRole: 'listbox',
|
|
795
792
|
role: 'option'
|
|
796
793
|
},
|
|
797
|
-
dataId: `${dataId}_Options
|
|
798
|
-
...SuggestionsProps
|
|
794
|
+
dataId: `${dataId}_Options`
|
|
799
795
|
}));
|
|
800
796
|
}) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
801
797
|
options: revampedGroups,
|
|
@@ -165,12 +165,8 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
165
165
|
needEffect,
|
|
166
166
|
isLoading,
|
|
167
167
|
dataSelectorId,
|
|
168
|
-
getTargetRef
|
|
169
|
-
customProps
|
|
168
|
+
getTargetRef
|
|
170
169
|
} = this.props;
|
|
171
|
-
const {
|
|
172
|
-
SuggestionsProps = {}
|
|
173
|
-
} = customProps;
|
|
174
170
|
i18nKeys = Object.assign({}, i18nKeys, {
|
|
175
171
|
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
176
172
|
searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage
|
|
@@ -327,8 +323,7 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
327
323
|
a11y: {
|
|
328
324
|
ariaParentRole: 'listbox',
|
|
329
325
|
role: 'option'
|
|
330
|
-
}
|
|
331
|
-
...SuggestionsProps
|
|
326
|
+
}
|
|
332
327
|
}) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
333
328
|
isLoading: isFetchingOptions,
|
|
334
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,
|
|
@@ -98,8 +98,7 @@ export const SelectWithAvatar_defaultProps = {
|
|
|
98
98
|
isRestrictScroll: false,
|
|
99
99
|
i18nKeys: {},
|
|
100
100
|
needEffect: true,
|
|
101
|
-
isLoading: false
|
|
102
|
-
customProps: {}
|
|
101
|
+
isLoading: false
|
|
103
102
|
};
|
|
104
103
|
export const SelectWithIcon_defaultProps = {
|
|
105
104
|
isReadOnly: false,
|
|
@@ -178,8 +178,7 @@ export const GroupSelect_propTypes = {
|
|
|
178
178
|
isDefaultSelectValue: PropTypes.bool,
|
|
179
179
|
customProps: PropTypes.shape({
|
|
180
180
|
TextBoxProps: PropTypes.object,
|
|
181
|
-
TextBoxIconProps: PropTypes.object
|
|
182
|
-
SuggestionsProps: PropTypes.object
|
|
181
|
+
TextBoxIconProps: PropTypes.object
|
|
183
182
|
}),
|
|
184
183
|
allowValueFallback: PropTypes.bool
|
|
185
184
|
};
|
|
@@ -242,10 +241,7 @@ export const SelectWithAvatar_propTypes = { ...Select_propTypes,
|
|
|
242
241
|
htmlId: PropTypes.string,
|
|
243
242
|
needEffect: PropTypes.bool,
|
|
244
243
|
isLoading: PropTypes.bool,
|
|
245
|
-
dataSelectorId: PropTypes.string
|
|
246
|
-
customProps: PropTypes.shape({
|
|
247
|
-
SuggestionsProps: PropTypes.object
|
|
248
|
-
})
|
|
244
|
+
dataSelectorId: PropTypes.string
|
|
249
245
|
};
|
|
250
246
|
export const SelectWithIcon_propTypes = {
|
|
251
247
|
animationStyle: PropTypes.oneOf(['default', 'bounce']),
|
|
@@ -307,7 +303,6 @@ export const SelectWithIcon_propTypes = {
|
|
|
307
303
|
customProps: PropTypes.shape({
|
|
308
304
|
TextBoxProps: PropTypes.object,
|
|
309
305
|
DropdownSearchTextBoxProps: PropTypes.object,
|
|
310
|
-
TextBoxIconProps: PropTypes.object
|
|
311
|
-
ListItemProps: PropTypes.object
|
|
306
|
+
TextBoxIconProps: PropTypes.object
|
|
312
307
|
})
|
|
313
308
|
};
|
|
@@ -260,6 +260,12 @@
|
|
|
260
260
|
justify-content: space-between;
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
+
.justifyFStart {
|
|
264
|
+
-webkit-box-pack: flex-start;
|
|
265
|
+
-ms-flex-pack: flex-start;
|
|
266
|
+
justify-content: flex-start;
|
|
267
|
+
}
|
|
268
|
+
|
|
263
269
|
.justifyFend {
|
|
264
270
|
-webkit-box-pack: flex-end;
|
|
265
271
|
-ms-flex-pack: flex-end;
|
|
@@ -493,7 +499,6 @@
|
|
|
493
499
|
display: -webkit-box;
|
|
494
500
|
overflow: hidden;
|
|
495
501
|
}
|
|
496
|
-
|
|
497
502
|
.lineClamp {
|
|
498
503
|
composes: wbreak clamp;
|
|
499
504
|
-webkit-line-clamp: var(--line-clamp,3);
|
|
@@ -40,23 +40,32 @@ const getDisabledOptions = props => props.disabledOptions || dummyArray;
|
|
|
40
40
|
|
|
41
41
|
const getListItemProps = props => props.listItemProps || '';
|
|
42
42
|
|
|
43
|
+
const getSearchFields = props => {
|
|
44
|
+
return props.searchFields || ['value'];
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const isExistInSearch = function () {
|
|
48
|
+
let searchFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
49
|
+
let searchStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
50
|
+
let option = arguments.length > 2 ? arguments[2] : undefined;
|
|
51
|
+
const matchedFields = searchFields.filter(element => {
|
|
52
|
+
return getSearchString(option[element]).indexOf(searchStr) !== -1;
|
|
53
|
+
});
|
|
54
|
+
return matchedFields.length !== 0;
|
|
55
|
+
};
|
|
56
|
+
|
|
43
57
|
const getAllowValueFallback = props => props.allowValueFallback !== false;
|
|
44
58
|
|
|
45
|
-
export const makeGetMultiSelectFilterSuggestions = () => createSelector([getOptions, getSelectedOptionsSel, getSearchStr, getNeedSearch, getIsStartWithSearch, getKeepSelectedOptions], (options, selectedOptions, searchStr, needSearch, isStartsWithSearch, keepSelectedOptions) => {
|
|
59
|
+
export const makeGetMultiSelectFilterSuggestions = () => createSelector([getOptions, getSelectedOptionsSel, getSearchStr, getNeedSearch, getIsStartWithSearch, getKeepSelectedOptions, getSearchFields], (options, selectedOptions, searchStr, needSearch, isStartsWithSearch, keepSelectedOptions, searchFields) => {
|
|
46
60
|
const suggestions = [];
|
|
47
61
|
const suggestionIds = [];
|
|
48
62
|
options.forEach(option => {
|
|
49
|
-
const {
|
|
50
|
-
id,
|
|
51
|
-
value = ''
|
|
52
|
-
} = option;
|
|
53
|
-
const valueString = getSearchString(value);
|
|
54
63
|
const searchString = getSearchString(searchStr);
|
|
55
|
-
const isMatch = needSearch ? isStartsWithSearch ? valueString.startsWith(searchString) :
|
|
64
|
+
const isMatch = needSearch ? isStartsWithSearch ? valueString.startsWith(searchString) : isExistInSearch(searchFields, searchString, option) : true;
|
|
56
65
|
|
|
57
|
-
if (selectedOptions.indexOf(id) === -1 && isMatch || keepSelectedOptions) {
|
|
66
|
+
if (selectedOptions.indexOf(option.id) === -1 && isMatch || keepSelectedOptions) {
|
|
58
67
|
suggestions.push(option);
|
|
59
|
-
suggestionIds.push(id);
|
|
68
|
+
suggestionIds.push(option.id);
|
|
60
69
|
}
|
|
61
70
|
});
|
|
62
71
|
return {
|
|
@@ -132,7 +141,7 @@ export const makeFormatOptions = () => createSelector([getOptions, getValueField
|
|
|
132
141
|
|
|
133
142
|
if (remvampOptionIds.indexOf(id) === -1 && !getIsEmptyValue(id) && !getIsEmptyValue(value)) {
|
|
134
143
|
remvampOptionIds.push(id);
|
|
135
|
-
const optionDetails = {
|
|
144
|
+
const optionDetails = { ...option,
|
|
136
145
|
id,
|
|
137
146
|
value,
|
|
138
147
|
optionType: impOptionType || optionType
|
package/lib/ListItem/ListItem.js
CHANGED
|
@@ -122,8 +122,7 @@ var ListItem = /*#__PURE__*/function (_React$Component) {
|
|
|
122
122
|
a11y = _this$props4.a11y,
|
|
123
123
|
customClass = _this$props4.customClass,
|
|
124
124
|
customProps = _this$props4.customProps,
|
|
125
|
-
needMultiLineText = _this$props4.needMultiLineText
|
|
126
|
-
lhsBoxAlign = _this$props4.lhsBoxAlign;
|
|
125
|
+
needMultiLineText = _this$props4.needMultiLineText;
|
|
127
126
|
var _customProps$ListItem = customProps.ListItemProps,
|
|
128
127
|
ListItemProps = _customProps$ListItem === void 0 ? {} : _customProps$ListItem,
|
|
129
128
|
_customProps$Containe = customProps.ContainerProps,
|
|
@@ -151,8 +150,7 @@ var ListItem = /*#__PURE__*/function (_React$Component) {
|
|
|
151
150
|
autoHover: autoHover,
|
|
152
151
|
needTick: needTick,
|
|
153
152
|
needBorder: needBorder,
|
|
154
|
-
customClass:
|
|
155
|
-
align: lhsBoxAlign,
|
|
153
|
+
customClass: customListItem,
|
|
156
154
|
dataId: dataIdString,
|
|
157
155
|
dataSelectorId: "".concat(dataSelectorId),
|
|
158
156
|
isLink: isLink,
|
|
@@ -173,7 +171,7 @@ var ListItem = /*#__PURE__*/function (_React$Component) {
|
|
|
173
171
|
adjust: true,
|
|
174
172
|
className: _ListItemModule["default"].children
|
|
175
173
|
}, children) : null, needTick && active ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
176
|
-
className: "".concat(_ListItemModule["default"].tickIcon, " ").concat(tickIconPalette, " ").concat(
|
|
174
|
+
className: "".concat(_ListItemModule["default"].tickIcon, " ").concat(tickIconPalette, " ").concat(customTickIcon),
|
|
177
175
|
"aria-hidden": ariaHidden,
|
|
178
176
|
dataId: "".concat(dataIdString, "_tickIcon"),
|
|
179
177
|
dataSelectorId: "".concat(dataSelectorId, "_tickIcon")
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
--listitem_min_height: var(--zd_size35);
|
|
58
58
|
}
|
|
59
59
|
.large {
|
|
60
|
-
--
|
|
60
|
+
--listitem_min_height: var(--zd_size48);
|
|
61
61
|
}
|
|
62
62
|
[dir=ltr] .large {
|
|
63
63
|
--listitem_padding: var(--zd_size10) var(--zd_size3) var(--zd_size10) var(--zd_size25);
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
line-height: 1.5385;
|
|
74
74
|
}
|
|
75
75
|
.multiLineValue{
|
|
76
|
-
|
|
76
|
+
composes: lineClamp from '../common/common.module.css';
|
|
77
77
|
}
|
|
78
78
|
.iconBox {
|
|
79
79
|
width: var(--zd_size20) ;
|
|
@@ -85,10 +85,6 @@
|
|
|
85
85
|
[dir=rtl] .iconBox {
|
|
86
86
|
margin-left: var(--zd_size10) ;
|
|
87
87
|
}
|
|
88
|
-
.iconBoxTopAlign {
|
|
89
|
-
align-self: start;
|
|
90
|
-
composes: dflex alignVertical from '../common/common.module.css';
|
|
91
|
-
}
|
|
92
88
|
.iconBox,
|
|
93
89
|
.leftAvatar {
|
|
94
90
|
font-size: 0 ;
|
|
@@ -96,17 +92,36 @@
|
|
|
96
92
|
.leftAvatar {
|
|
97
93
|
margin: var(--listitem_avatar_margin);
|
|
98
94
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
95
|
+
|
|
96
|
+
.lhsAvatarBox,
|
|
97
|
+
.lhsJustifyContent_start,
|
|
98
|
+
.lhsJustifyContent_center,
|
|
99
|
+
.lhsJustifyContent_end {
|
|
100
|
+
composes: dflex alignVertical from '../common/common.module.css';
|
|
101
|
+
}
|
|
102
|
+
.lhsJustifyContent_start {
|
|
103
|
+
composes: justifyFStart from '../common/common.module.css';
|
|
102
104
|
}
|
|
103
|
-
.
|
|
104
|
-
|
|
105
|
-
height: var(--zd_font_size21);
|
|
105
|
+
.lhsJustifyContent_center {
|
|
106
|
+
composes: alignHorizontal from '../common/common.module.css';
|
|
106
107
|
}
|
|
107
|
-
.
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
.lhsJustifyContent_end {
|
|
109
|
+
composes: justifyFend from '../common/common.module.css';
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.lhsBox_small,
|
|
113
|
+
.lhsBox_medium,
|
|
114
|
+
.lhsBox_large{
|
|
115
|
+
height: 1em ;
|
|
116
|
+
}
|
|
117
|
+
.lhsBox_small {
|
|
118
|
+
font-size: var(--zd_font_size20) ;
|
|
119
|
+
}
|
|
120
|
+
.lhsBox_medium {
|
|
121
|
+
font-size: var(--zd_font_size21) ;
|
|
122
|
+
}
|
|
123
|
+
.lhsBox_large {
|
|
124
|
+
font-size: var(--zd_font_size28) ;
|
|
110
125
|
}
|
|
111
126
|
|
|
112
127
|
.defaultHover, .primaryHover, .secondaryHover, .darkHover {
|
|
@@ -171,17 +186,33 @@
|
|
|
171
186
|
--listitem_active_bg_color: var(--zdt_listitem_dark_active_bg);
|
|
172
187
|
}
|
|
173
188
|
|
|
189
|
+
.secondaryField{
|
|
190
|
+
color:var(--zdt_listitem_secondaryfield_text);
|
|
191
|
+
font-size: var(--zd_font_size12) ;
|
|
192
|
+
line-height: 1.25;
|
|
193
|
+
/* margin-top:1px */
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
|
|
174
197
|
.tickIcon,
|
|
175
198
|
.defaultTick,
|
|
176
199
|
.darkTick {
|
|
177
200
|
position: absolute;
|
|
178
201
|
color: var(--listitem_tickicon_color);
|
|
202
|
+
top:50% ;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
.tickIcon, .defaultTick, .darkTick {
|
|
207
|
+
transform: translateY(-50%);
|
|
179
208
|
}
|
|
180
209
|
|
|
210
|
+
|
|
181
211
|
[dir=ltr] .tickIcon, [dir=ltr] .defaultTick, [dir=ltr] .darkTick {
|
|
182
212
|
right: var(--zd_size20) ;
|
|
183
213
|
}
|
|
184
214
|
|
|
215
|
+
|
|
185
216
|
[dir=rtl] .tickIcon, [dir=rtl] .defaultTick, [dir=rtl] .darkTick {
|
|
186
217
|
left: var(--zd_size20) ;
|
|
187
218
|
}
|
|
@@ -212,17 +243,9 @@
|
|
|
212
243
|
[dir=rtl] .largewithTick {
|
|
213
244
|
--listitem_padding: var(--zd_size10) var(--zd_size25) var(--zd_size10) var(--zd_size39);
|
|
214
245
|
}
|
|
215
|
-
.largeSizeContainer{
|
|
216
|
-
--listitem_height: auto;
|
|
217
|
-
--listitem_min_height: var(--zd_size48);
|
|
218
|
-
}
|
|
219
246
|
.responsiveHeight {
|
|
220
247
|
--listitem_min_height: var(--zd_size45);
|
|
221
248
|
font-size: var(--zd_font_size15) ;
|
|
222
249
|
padding-top: var(--zd_size10) ;
|
|
223
250
|
padding-bottom: var(--zd_size10) ;
|
|
224
251
|
}
|
|
225
|
-
.tickIconCenter {
|
|
226
|
-
top: 50% ;
|
|
227
|
-
transform: translateY(-50%);
|
|
228
|
-
}
|
|
@@ -129,7 +129,8 @@ var ListItemWithAvatar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
129
129
|
customClass = _this$props4.customClass,
|
|
130
130
|
customProps = _this$props4.customProps,
|
|
131
131
|
needMultiLineText = _this$props4.needMultiLineText,
|
|
132
|
-
|
|
132
|
+
secondaryValue = _this$props4.secondaryValue,
|
|
133
|
+
lhsAlignContent = _this$props4.lhsAlignContent;
|
|
133
134
|
var _customProps$ListItem = customProps.ListItemProps,
|
|
134
135
|
ListItemProps = _customProps$ListItem === void 0 ? {} : _customProps$ListItem,
|
|
135
136
|
_customProps$Containe = customProps.ContainerProps,
|
|
@@ -153,11 +154,6 @@ var ListItemWithAvatar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
153
154
|
var ariaHidden = listA11y.ariaHidden;
|
|
154
155
|
var isDarkPalette = palette === 'dark';
|
|
155
156
|
var dataIdString = value ? value : dataId;
|
|
156
|
-
var sizeClassMap = {
|
|
157
|
-
small: _ListItemModule["default"].smallIconBox,
|
|
158
|
-
medium: _ListItemModule["default"].mediumIconBox,
|
|
159
|
-
large: _ListItemModule["default"].largeIconBox
|
|
160
|
-
};
|
|
161
157
|
return /*#__PURE__*/_react["default"].createElement(_ListContainer["default"], _extends({
|
|
162
158
|
a11y: listA11y,
|
|
163
159
|
size: size,
|
|
@@ -168,7 +164,7 @@ var ListItemWithAvatar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
168
164
|
autoHover: autoHover,
|
|
169
165
|
needTick: needTick,
|
|
170
166
|
needBorder: needBorder,
|
|
171
|
-
customClass:
|
|
167
|
+
customClass: customListItem,
|
|
172
168
|
dataId: "".concat(dataIdString, "_ListItemWithAvatar"),
|
|
173
169
|
dataSelectorId: "".concat(dataSelectorId),
|
|
174
170
|
onClick: this.handleClick,
|
|
@@ -178,7 +174,8 @@ var ListItemWithAvatar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
178
174
|
title: null,
|
|
179
175
|
customProps: ListItemProps
|
|
180
176
|
}, ContainerProps), name || imgSrc ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
181
|
-
|
|
177
|
+
align: lhsAlignContent,
|
|
178
|
+
className: "".concat(_ListItemModule["default"].leftAvatar, " ").concat(lhsAlignContent !== 'center' ? "".concat(_ListItemModule["default"].lhsAvatarBox, " ").concat(_ListItemModule["default"]["lhsBox_".concat(size)]) : '')
|
|
182
179
|
}, isTeam ? /*#__PURE__*/_react["default"].createElement(_AvatarTeam["default"], _extends({
|
|
183
180
|
name: name,
|
|
184
181
|
size: "small",
|
|
@@ -199,13 +196,19 @@ var ListItemWithAvatar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
199
196
|
needTitle: needAvatarTitle,
|
|
200
197
|
palette: isDarkPalette ? 'info' : avatarPalette,
|
|
201
198
|
customClass: customAvatar
|
|
202
|
-
}, AvatarProps))) : null, value ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
199
|
+
}, AvatarProps))) : null, value || secondaryValue ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
203
200
|
flexible: true,
|
|
204
|
-
shrink: true
|
|
201
|
+
shrink: true
|
|
202
|
+
}, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
203
|
+
alignBox: "column"
|
|
204
|
+
}, value ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
205
205
|
"data-title": isDisabled ? null : title,
|
|
206
206
|
className: needMultiLineText ? _ListItemModule["default"].multiLineValue : _ListItemModule["default"].value
|
|
207
|
-
}, value) : null,
|
|
208
|
-
|
|
207
|
+
}, value) : null, secondaryValue ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
208
|
+
"data-title": isDisabled ? null : secondaryValue,
|
|
209
|
+
className: "".concat(_ListItemModule["default"].secondaryField, " ").concat(needMultiLineText ? _ListItemModule["default"].multiLineValue : _ListItemModule["default"].value)
|
|
210
|
+
}, secondaryValue) : null)) : null, needTick && active ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
211
|
+
className: _ListItemModule["default"].tickIcon,
|
|
209
212
|
"aria-hidden": ariaHidden,
|
|
210
213
|
dataId: "".concat(dataIdString, "_tickIcon"),
|
|
211
214
|
dataSelectorId: "".concat(dataSelectorId, "_tickIcon")
|