@zohodesk/components 1.0.0-temp-220.7 → 1.0.0-temp-223.1
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/config/variables/variableMapping.json +6 -0
- package/.cli/propValidation_report.html +1 -1
- package/README.md +12 -0
- 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/ListContainer.js +3 -2
- package/es/ListItem/ListItem.module.css +54 -7
- package/es/ListItem/ListItemWithAvatar.js +17 -6
- package/es/ListItem/ListItemWithCheckBox.js +18 -6
- package/es/ListItem/ListItemWithIcon.js +20 -7
- package/es/ListItem/ListItemWithRadio.js +19 -6
- package/es/ListItem/__tests__/ListContainer.spec.js +8 -0
- package/es/ListItem/__tests__/ListItemWithAvatar.spec.js +35 -0
- package/es/ListItem/__tests__/ListItemWithCheckBox.spec.js +35 -0
- package/es/ListItem/__tests__/ListItemWithIcon.spec.js +35 -0
- package/es/ListItem/__tests__/ListItemWithRadio.spec.js +35 -0
- package/es/ListItem/__tests__/__snapshots__/ListContainer.spec.js.snap +13 -0
- package/es/ListItem/__tests__/__snapshots__/ListItemWithAvatar.spec.js.snap +200 -2
- package/es/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +451 -30
- package/es/ListItem/__tests__/__snapshots__/ListItemWithIcon.spec.js.snap +202 -4
- package/es/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +447 -30
- package/es/ListItem/props/defaultProps.js +13 -5
- package/es/ListItem/props/propTypes.js +13 -1
- package/es/MultiSelect/AdvancedMultiSelect.js +10 -4
- package/es/MultiSelect/MultiSelect.js +8 -4
- package/es/MultiSelect/MultiSelect.module.css +9 -1
- package/es/MultiSelect/MultiSelectWithAvatar.js +6 -2
- package/es/MultiSelect/Suggestions.js +8 -3
- package/es/MultiSelect/__tests__/__snapshots__/MultiSelectHeader.spec.js.snap +34 -13
- package/es/MultiSelect/props/defaultProps.js +2 -1
- package/es/MultiSelect/props/propTypes.js +4 -0
- package/es/Popup/Popup.js +22 -56
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +35 -3
- package/es/VelocityAnimation/VelocityAnimationGroup/props/defaultProps.js +4 -1
- package/es/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +4 -1
- package/es/common/common.module.css +10 -0
- package/es/utils/dropDownUtils.js +41 -8
- package/lib/ListItem/ListContainer.js +3 -2
- package/lib/ListItem/ListItem.module.css +54 -7
- package/lib/ListItem/ListItemWithAvatar.js +16 -5
- package/lib/ListItem/ListItemWithCheckBox.js +17 -5
- package/lib/ListItem/ListItemWithIcon.js +19 -6
- package/lib/ListItem/ListItemWithRadio.js +18 -5
- package/lib/ListItem/__tests__/ListContainer.spec.js +8 -0
- package/lib/ListItem/__tests__/ListItemWithAvatar.spec.js +35 -0
- package/lib/ListItem/__tests__/ListItemWithCheckBox.spec.js +35 -0
- package/lib/ListItem/__tests__/ListItemWithIcon.spec.js +35 -0
- package/lib/ListItem/__tests__/ListItemWithRadio.spec.js +35 -0
- package/lib/ListItem/__tests__/__snapshots__/ListContainer.spec.js.snap +13 -0
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithAvatar.spec.js.snap +200 -2
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +451 -30
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithIcon.spec.js.snap +202 -4
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +447 -30
- package/lib/ListItem/props/defaultProps.js +13 -5
- package/lib/ListItem/props/propTypes.js +12 -2
- package/lib/MultiSelect/AdvancedMultiSelect.js +76 -69
- package/lib/MultiSelect/MultiSelect.js +8 -4
- package/lib/MultiSelect/MultiSelect.module.css +9 -1
- package/lib/MultiSelect/MultiSelectWithAvatar.js +6 -2
- package/lib/MultiSelect/Suggestions.js +9 -4
- package/lib/MultiSelect/__tests__/__snapshots__/MultiSelectHeader.spec.js.snap +34 -13
- package/lib/MultiSelect/props/defaultProps.js +2 -1
- package/lib/MultiSelect/props/propTypes.js +5 -1
- package/lib/Popup/Popup.js +60 -96
- package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +63 -9
- package/lib/VelocityAnimation/VelocityAnimationGroup/props/defaultProps.js +4 -1
- package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +4 -1
- package/lib/common/common.module.css +10 -0
- package/lib/utils/dropDownUtils.js +49 -11
- package/package.json +3 -3
- package/result.json +0 -1
|
@@ -200,7 +200,15 @@
|
|
|
200
200
|
cursor: pointer;
|
|
201
201
|
margin-top: var(--zd_size5) ;
|
|
202
202
|
background-color: var(--zdt_multiselect_delete_bg);
|
|
203
|
-
border: 0
|
|
203
|
+
border: 0
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
[dir=ltr] .more {
|
|
207
|
+
margin-right:var(--zd_size3)
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
[dir=rtl] .more {
|
|
211
|
+
margin-left:var(--zd_size3)
|
|
204
212
|
}
|
|
205
213
|
|
|
206
214
|
.rightPlaceholder{
|
|
@@ -42,7 +42,9 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
42
42
|
textField,
|
|
43
43
|
imageField,
|
|
44
44
|
disabledOptions,
|
|
45
|
-
allowValueFallback
|
|
45
|
+
allowValueFallback,
|
|
46
|
+
searchFields,
|
|
47
|
+
secondaryField
|
|
46
48
|
} = props;
|
|
47
49
|
return this.formatOptions({
|
|
48
50
|
options,
|
|
@@ -51,7 +53,9 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
51
53
|
imageField,
|
|
52
54
|
optionType: 'avatar',
|
|
53
55
|
disabledOptions,
|
|
54
|
-
allowValueFallback
|
|
56
|
+
allowValueFallback,
|
|
57
|
+
searchFields,
|
|
58
|
+
secondaryField
|
|
55
59
|
});
|
|
56
60
|
}
|
|
57
61
|
|
|
@@ -27,7 +27,8 @@ export default class Suggestions extends React.PureComponent {
|
|
|
27
27
|
avatarPalette,
|
|
28
28
|
palette,
|
|
29
29
|
htmlId,
|
|
30
|
-
a11y
|
|
30
|
+
a11y,
|
|
31
|
+
needMultiLineText
|
|
31
32
|
} = this.props;
|
|
32
33
|
const {
|
|
33
34
|
ariaParentRole,
|
|
@@ -46,6 +47,7 @@ export default class Suggestions extends React.PureComponent {
|
|
|
46
47
|
const {
|
|
47
48
|
id,
|
|
48
49
|
value,
|
|
50
|
+
secondaryValue,
|
|
49
51
|
photoURL,
|
|
50
52
|
icon,
|
|
51
53
|
optionType,
|
|
@@ -63,6 +65,7 @@ export default class Suggestions extends React.PureComponent {
|
|
|
63
65
|
});
|
|
64
66
|
const commonProps = {
|
|
65
67
|
isDisabled,
|
|
68
|
+
needMultiLineText,
|
|
66
69
|
...listItemCustomProps
|
|
67
70
|
};
|
|
68
71
|
|
|
@@ -92,7 +95,8 @@ export default class Suggestions extends React.PureComponent {
|
|
|
92
95
|
size: listItemSize,
|
|
93
96
|
avatarPalette: avatarPalette,
|
|
94
97
|
palette: palette,
|
|
95
|
-
a11y: list_a11y
|
|
98
|
+
a11y: list_a11y,
|
|
99
|
+
secondaryValue: secondaryValue
|
|
96
100
|
});
|
|
97
101
|
} else if (optionType === 'icon') {
|
|
98
102
|
return /*#__PURE__*/React.createElement(ListItemWithIcon, { ...commonProps,
|
|
@@ -112,7 +116,8 @@ export default class Suggestions extends React.PureComponent {
|
|
|
112
116
|
iconSize: iconSize,
|
|
113
117
|
size: listItemSize,
|
|
114
118
|
palette: palette,
|
|
115
|
-
a11y: list_a11y
|
|
119
|
+
a11y: list_a11y,
|
|
120
|
+
secondaryValue: secondaryValue
|
|
116
121
|
});
|
|
117
122
|
}
|
|
118
123
|
|
|
@@ -13,27 +13,48 @@ exports[`MultiSelectHeader rendering the basic value 1`] = `
|
|
|
13
13
|
>
|
|
14
14
|
<div
|
|
15
15
|
aria-hidden="true"
|
|
16
|
-
class="iconBox shrinkOff"
|
|
16
|
+
class="iconBox lhsBox lhsJustifyContent_center shrinkOff selfStart"
|
|
17
17
|
data-id="MultiSelectHeader_selectAll_Icon"
|
|
18
18
|
data-selector-id="box"
|
|
19
19
|
data-test-id="MultiSelectHeader_selectAll_Icon"
|
|
20
20
|
>
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
data-id="
|
|
25
|
-
data-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
<div
|
|
22
|
+
class="lhsBox_medium shrinkOff selfStart"
|
|
23
|
+
data-id="boxComponent"
|
|
24
|
+
data-selector-id="box"
|
|
25
|
+
data-test-id="boxComponent"
|
|
26
|
+
>
|
|
27
|
+
<i
|
|
28
|
+
aria-hidden="true"
|
|
29
|
+
class="zd_font_icons basic icon-androidd "
|
|
30
|
+
data-id="fontIcon"
|
|
31
|
+
data-selector-id="fontIcon"
|
|
32
|
+
data-test-id="fontIcon"
|
|
33
|
+
style="--zd-iconfont-size: var(--zd_font_size15);"
|
|
34
|
+
/>
|
|
35
|
+
</div>
|
|
29
36
|
</div>
|
|
30
37
|
<div
|
|
31
|
-
class="
|
|
32
|
-
data-id="
|
|
38
|
+
class="grow basis shrinkOn"
|
|
39
|
+
data-id="boxComponent"
|
|
33
40
|
data-selector-id="box"
|
|
34
|
-
data-test-id="
|
|
41
|
+
data-test-id="boxComponent"
|
|
35
42
|
>
|
|
36
|
-
|
|
43
|
+
<div
|
|
44
|
+
class="flex cover coldir"
|
|
45
|
+
data-id="containerComponent"
|
|
46
|
+
data-selector-id="container"
|
|
47
|
+
data-test-id="containerComponent"
|
|
48
|
+
>
|
|
49
|
+
<div
|
|
50
|
+
class="value shrinkOff"
|
|
51
|
+
data-id="MultiSelectHeader_selectAll_Text"
|
|
52
|
+
data-selector-id="box"
|
|
53
|
+
data-test-id="MultiSelectHeader_selectAll_Text"
|
|
54
|
+
>
|
|
55
|
+
List
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
37
58
|
</div>
|
|
38
59
|
</li>
|
|
39
60
|
</DocumentFragment>
|
|
@@ -46,6 +46,7 @@ export const MultiSelect_propTypes = {
|
|
|
46
46
|
a11y: PropTypes.shape({
|
|
47
47
|
clearLabel: PropTypes.string
|
|
48
48
|
}),
|
|
49
|
+
searchFields: PropTypes.arrayOf(PropTypes.string),
|
|
49
50
|
isAnimate: PropTypes.bool,
|
|
50
51
|
isBoxPaddingNeed: PropTypes.bool,
|
|
51
52
|
isDisabled: PropTypes.bool,
|
|
@@ -132,6 +133,7 @@ export const MultiSelectWithAvatar_propTypes = {
|
|
|
132
133
|
SuggestionsProps: PropTypes.object,
|
|
133
134
|
DropBoxProps: PropTypes.object
|
|
134
135
|
}),
|
|
136
|
+
secondaryField: PropTypes.string,
|
|
135
137
|
...MultiSelect_propTypes
|
|
136
138
|
};
|
|
137
139
|
export const SelectedOptions_propTypes = {
|
|
@@ -171,6 +173,7 @@ export const Suggestions_propTypes = {
|
|
|
171
173
|
palette: PropTypes.string,
|
|
172
174
|
selectedOptions: PropTypes.array,
|
|
173
175
|
htmlId: PropTypes.string,
|
|
176
|
+
needMultiLineText: PropTypes.bool,
|
|
174
177
|
suggestions: PropTypes.arrayOf(PropTypes.shape({
|
|
175
178
|
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
176
179
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
@@ -281,6 +284,7 @@ export const AdvancedMultiSelect_propTypes = { ...MultiSelect_propTypes,
|
|
|
281
284
|
//For grouping multiSelect
|
|
282
285
|
optionType: PropTypes.oneOf(['default', 'avatar', 'icon']),
|
|
283
286
|
needEffect: PropTypes.bool,
|
|
287
|
+
secondaryField: PropTypes.string,
|
|
284
288
|
animationStyle: PropTypes.string,
|
|
285
289
|
defaultDropBoxPosition: PropTypes.oneOf(['bottom', 'top', 'left', 'right']),
|
|
286
290
|
dropBoxSize: PropTypes.oneOf(['small', 'medium', 'large']),
|
package/es/Popup/Popup.js
CHANGED
|
@@ -74,9 +74,8 @@ const Popup = function (Component) {
|
|
|
74
74
|
isMobile: false
|
|
75
75
|
};
|
|
76
76
|
this.togglePopup = this.togglePopup.bind(this);
|
|
77
|
-
this.closePopups = this.closePopups.bind(this);
|
|
78
|
-
this.handleDocumentInteraction = this.handleDocumentInteraction.bind(this);
|
|
79
77
|
this.documentClickHandler = this.documentClickHandler.bind(this);
|
|
78
|
+
this.documentClickHandler1 = this.documentClickHandler1.bind(this);
|
|
80
79
|
this.removeClose = this.removeClose.bind(this);
|
|
81
80
|
this.documentKeyupHandler = this.documentKeyupHandler.bind(this);
|
|
82
81
|
this.openPopupOnly = this.openPopupOnly.bind(this);
|
|
@@ -134,11 +133,11 @@ const Popup = function (Component) {
|
|
|
134
133
|
popups[group] = groupPopups;
|
|
135
134
|
|
|
136
135
|
if (Object.keys(popups).length === 1 && groupPopups.length === 1) {
|
|
137
|
-
document.addEventListener('click', this.handleDocumentInteraction, true);
|
|
138
136
|
document.addEventListener('click', this.documentClickHandler, false);
|
|
139
137
|
document.addEventListener('keyup', this.documentKeyupHandler, false); // document.addEventListener('scroll', this.handleScroll, true);
|
|
140
138
|
|
|
141
139
|
window.addEventListener('resize', this.handleResize);
|
|
140
|
+
document.addEventListener('click', this.documentClickHandler1, true);
|
|
142
141
|
document.addEventListener('mousedown', this.handleDocumentMouseDown, true);
|
|
143
142
|
document.addEventListener('focus', this.handleDocumentFocus, true);
|
|
144
143
|
}
|
|
@@ -225,11 +224,11 @@ const Popup = function (Component) {
|
|
|
225
224
|
}
|
|
226
225
|
|
|
227
226
|
if (noPopups) {
|
|
228
|
-
document.removeEventListener('click', this.
|
|
229
|
-
document.removeEventListener('click', this.documentClickHandler, false);
|
|
227
|
+
document.removeEventListener('click', this.documentClickHandler);
|
|
230
228
|
document.removeEventListener('keyup', this.documentKeyupHandler); // document.removeEventListener('scroll', this.handleScroll);
|
|
231
229
|
|
|
232
230
|
window.removeEventListener('resize', this.handleResize);
|
|
231
|
+
document.removeEventListener('click', this.documentClickHandler1, true);
|
|
233
232
|
document.removeEventListener('mousedown', this.handleDocumentMouseDown, true);
|
|
234
233
|
document.removeEventListener('focus', this.handleDocumentFocus, true);
|
|
235
234
|
}
|
|
@@ -618,62 +617,29 @@ const Popup = function (Component) {
|
|
|
618
617
|
return needPrevent;
|
|
619
618
|
}
|
|
620
619
|
|
|
621
|
-
|
|
622
|
-
let checkTarget = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
623
|
-
|
|
624
|
-
try {
|
|
625
|
-
Object.keys(popups).forEach(groupName => {
|
|
626
|
-
const openGroupPopups = (popups[groupName] || []).filter(popup => popup.state.isPopupOpen);
|
|
627
|
-
openGroupPopups.forEach(popup => {
|
|
628
|
-
const {
|
|
629
|
-
dropElement,
|
|
630
|
-
placeHolderElement
|
|
631
|
-
} = popup;
|
|
632
|
-
const {
|
|
633
|
-
target
|
|
634
|
-
} = e || {};
|
|
635
|
-
const canClosePopup = !popup.props.checkBeforeClose || popup.props.checkBeforeClose && popup.props.checkBeforeClose() && !isTextSelected();
|
|
636
|
-
const isOutsideClick = checkTarget && placeHolderElement && dropElement && placeHolderElement !== target && !placeHolderElement.contains(target) && dropElement !== target && !dropElement.contains(target);
|
|
637
|
-
|
|
638
|
-
if (canClosePopup && (!checkTarget || isOutsideClick)) {
|
|
639
|
-
popup.setState({
|
|
640
|
-
isPopupOpen: false,
|
|
641
|
-
isPopupReady: false
|
|
642
|
-
});
|
|
643
|
-
}
|
|
644
|
-
});
|
|
645
|
-
});
|
|
646
|
-
|
|
647
|
-
if (!checkTarget) {
|
|
648
|
-
lastOpenedGroup = [];
|
|
649
|
-
}
|
|
650
|
-
} catch (error) {// eslint-disable-next-line no-console
|
|
651
|
-
//console.error('popup component not unmounted properly', error);
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
documentClickHandler(e) {
|
|
656
|
-
// Handles document click events to close all popups.
|
|
657
|
-
// This function closes all popups without checking if the click occurred outside the popup.
|
|
658
|
-
this.closePopups(e, false);
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
handleDocumentInteraction(e) {
|
|
662
|
-
// Handles interactions with the document to determine whether to close the popup.
|
|
663
|
-
// This function is specifically designed to close the popup when clicking outside of it.
|
|
664
|
-
// Check if the click event should prevent popup closure.
|
|
620
|
+
documentClickHandler1(e) {
|
|
665
621
|
const needPrevent = this.handleGetNeedPrevent(e);
|
|
666
622
|
|
|
667
623
|
if (needPrevent) {
|
|
668
|
-
// If the click event should prevent popup closure:
|
|
669
|
-
// - Stop the event propagation.
|
|
670
|
-
// - Close the last opened group of popups.
|
|
671
624
|
this.removeClose(e);
|
|
672
625
|
this.handleCloseLastOpenedGroup();
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
documentClickHandler() {
|
|
630
|
+
try {
|
|
631
|
+
Object.keys(popups).forEach(groupName => {
|
|
632
|
+
const groupPopups = popups[groupName] || [];
|
|
633
|
+
groupPopups.forEach(popup => {
|
|
634
|
+
popup.state.isPopupOpen && (!popup.props.checkBeforeClose || popup.props.checkBeforeClose && popup.props.checkBeforeClose()) && !isTextSelected() && popup.setState({
|
|
635
|
+
isPopupOpen: false,
|
|
636
|
+
isPopupReady: false
|
|
637
|
+
});
|
|
638
|
+
});
|
|
639
|
+
});
|
|
640
|
+
lastOpenedGroup = [];
|
|
641
|
+
} catch (e) {// eslint-disable-next-line no-console
|
|
642
|
+
//console.error('popup component not unmounted properly', e);
|
|
677
643
|
}
|
|
678
644
|
}
|
|
679
645
|
|
|
@@ -16,6 +16,29 @@ function clearProps(props) {
|
|
|
16
16
|
export default class VelocityAnimationGroup extends React.Component {
|
|
17
17
|
constructor(props) {
|
|
18
18
|
super(props);
|
|
19
|
+
this.handleOnEnterComplete = this.handleOnEnterComplete.bind(this);
|
|
20
|
+
this.handleOnExitComplete = this.handleOnExitComplete.bind(this);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
handleOnEnterComplete(elements, onEnterComplete, postEnterStyles) {
|
|
24
|
+
if (typeof onEnterComplete === 'function') {
|
|
25
|
+
onEnterComplete(elements);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (postEnterStyles && typeof postEnterStyles === 'object') {
|
|
29
|
+
elements.forEach(rootElement => {
|
|
30
|
+
Object.entries(postEnterStyles).forEach(_ref => {
|
|
31
|
+
let [cssProperty, cssValue] = _ref;
|
|
32
|
+
rootElement.style[cssProperty] = cssValue;
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
handleOnExitComplete(elements, onExitComplete) {
|
|
39
|
+
if (typeof onExitComplete === 'function') {
|
|
40
|
+
onExitComplete(elements);
|
|
41
|
+
}
|
|
19
42
|
}
|
|
20
43
|
|
|
21
44
|
render() {
|
|
@@ -35,7 +58,10 @@ export default class VelocityAnimationGroup extends React.Component {
|
|
|
35
58
|
enterDelay,
|
|
36
59
|
isCustomized,
|
|
37
60
|
name,
|
|
38
|
-
needUIPack
|
|
61
|
+
needUIPack,
|
|
62
|
+
onEnterComplete,
|
|
63
|
+
onExitComplete,
|
|
64
|
+
postEnterStyles
|
|
39
65
|
} = this.props;
|
|
40
66
|
let {
|
|
41
67
|
direction,
|
|
@@ -76,13 +102,19 @@ export default class VelocityAnimationGroup extends React.Component {
|
|
|
76
102
|
animation: isCustomized ? enterAnimationObj[name] : needUIPack ? `transition.${enterName}In` : enterName,
|
|
77
103
|
duration: !isReducedMotion ? enterDuration : 0,
|
|
78
104
|
delay: enterDelay ? enterDelay : 0,
|
|
79
|
-
display: isFlex ? 'flex' : ''
|
|
105
|
+
display: isFlex ? 'flex' : '',
|
|
106
|
+
complete: elements => {
|
|
107
|
+
this.handleOnEnterComplete(elements, onEnterComplete, postEnterStyles);
|
|
108
|
+
}
|
|
80
109
|
};
|
|
81
110
|
let exitAnimation = {
|
|
82
111
|
animation: isCustomized ? exitAnimationObj[name] : needUIPack ? `transition.${exitName ? exitName : enterName}Out` : exitName ? exitName : enterName,
|
|
83
112
|
duration: !isReducedMotion ? exitDuration : 0,
|
|
84
113
|
delay: exitDelay ? exitDelay : 0,
|
|
85
|
-
display: 'none'
|
|
114
|
+
display: 'none',
|
|
115
|
+
complete: elements => {
|
|
116
|
+
this.handleOnExitComplete(elements, onExitComplete);
|
|
117
|
+
}
|
|
86
118
|
};
|
|
87
119
|
return /*#__PURE__*/React.createElement(VelocityTransitionGroup, {
|
|
88
120
|
enter: enterAnimation,
|
|
@@ -15,5 +15,8 @@ export const propTypes = {
|
|
|
15
15
|
isFlex: PropTypes.bool,
|
|
16
16
|
name: PropTypes.oneOf(['fade', 'slideDown', 'flyDown', 'slideRight', 'shrink', 'expand', 'slideLeft']),
|
|
17
17
|
needUIPack: PropTypes.bool,
|
|
18
|
-
runOnMount: PropTypes.bool
|
|
18
|
+
runOnMount: PropTypes.bool,
|
|
19
|
+
onEnterComplete: PropTypes.func,
|
|
20
|
+
onExitComplete: PropTypes.func,
|
|
21
|
+
postEnterStyles: PropTypes.object
|
|
19
22
|
};
|
|
@@ -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,6 +499,10 @@
|
|
|
493
499
|
display: -webkit-box;
|
|
494
500
|
overflow: hidden;
|
|
495
501
|
}
|
|
502
|
+
.lineClamp {
|
|
503
|
+
composes: wbreak clamp;
|
|
504
|
+
-webkit-line-clamp: var(--line-clamp,2);
|
|
505
|
+
}
|
|
496
506
|
|
|
497
507
|
.offSelection {
|
|
498
508
|
-webkit-user-select: none;
|
|
@@ -12,6 +12,7 @@ const getSelectedOptionsSel = props => props.selectedOptions || dummyArray;
|
|
|
12
12
|
const getSearchStr = props => props.searchStr || '';
|
|
13
13
|
|
|
14
14
|
export const getValueField = props => props.valueField || '';
|
|
15
|
+
export const getSecondaryField = props => props.secondaryField || '';
|
|
15
16
|
export const getTextField = props => props.textField || '';
|
|
16
17
|
export const getImageField = props => props.imageField || '';
|
|
17
18
|
export const getIconName = props => props.iconName || '';
|
|
@@ -40,23 +41,44 @@ const getDisabledOptions = props => props.disabledOptions || dummyArray;
|
|
|
40
41
|
|
|
41
42
|
const getListItemProps = props => props.listItemProps || '';
|
|
42
43
|
|
|
44
|
+
const getSearchFields = props => {
|
|
45
|
+
return props.searchFields || ['value'];
|
|
46
|
+
}; // const isObjectContainsSearchString = (searchFields = [], searchStr = '', obj) => {
|
|
47
|
+
// const matchedFields = searchFields.filter(element => {
|
|
48
|
+
// return getSearchString(obj[element]).indexOf(searchStr) !== -1
|
|
49
|
+
// });
|
|
50
|
+
// return matchedFields.length !== 0;
|
|
51
|
+
// }
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
const isObjectContainsSearchString = function () {
|
|
55
|
+
let searchFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
56
|
+
let searchStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
57
|
+
let obj = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
58
|
+
return searchFields.some(field => {
|
|
59
|
+
const val = obj[field];
|
|
60
|
+
if (val === null || val === undefined) return false;
|
|
61
|
+
const str = getSearchString(val);
|
|
62
|
+
return str && str.indexOf(searchStr) !== -1;
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
|
|
43
66
|
const getAllowValueFallback = props => props.allowValueFallback !== false;
|
|
44
67
|
|
|
45
|
-
export const makeGetMultiSelectFilterSuggestions = () => createSelector([getOptions, getSelectedOptionsSel, getSearchStr, getNeedSearch, getIsStartWithSearch, getKeepSelectedOptions], (options, selectedOptions, searchStr, needSearch, isStartsWithSearch, keepSelectedOptions) => {
|
|
68
|
+
export const makeGetMultiSelectFilterSuggestions = () => createSelector([getOptions, getSelectedOptionsSel, getSearchStr, getNeedSearch, getIsStartWithSearch, getKeepSelectedOptions, getSearchFields], (options, selectedOptions, searchStr, needSearch, isStartsWithSearch, keepSelectedOptions, searchFields) => {
|
|
46
69
|
const suggestions = [];
|
|
47
70
|
const suggestionIds = [];
|
|
48
71
|
options.forEach(option => {
|
|
72
|
+
const searchString = getSearchString(searchStr);
|
|
49
73
|
const {
|
|
50
|
-
id,
|
|
51
74
|
value = ''
|
|
52
75
|
} = option;
|
|
53
76
|
const valueString = getSearchString(value);
|
|
54
|
-
const
|
|
55
|
-
const isMatch = needSearch ? isStartsWithSearch ? valueString.startsWith(searchString) : valueString.indexOf(searchString) !== -1 : true;
|
|
77
|
+
const isMatch = needSearch ? isStartsWithSearch ? valueString.startsWith(searchString) : isObjectContainsSearchString(searchFields, searchString, option) : true;
|
|
56
78
|
|
|
57
|
-
if (selectedOptions.indexOf(id) === -1 && isMatch || keepSelectedOptions) {
|
|
79
|
+
if (selectedOptions.indexOf(option.id) === -1 && isMatch || keepSelectedOptions) {
|
|
58
80
|
suggestions.push(option);
|
|
59
|
-
suggestionIds.push(id);
|
|
81
|
+
suggestionIds.push(option.id);
|
|
60
82
|
}
|
|
61
83
|
});
|
|
62
84
|
return {
|
|
@@ -107,7 +129,7 @@ export const extractOptionId = id => {
|
|
|
107
129
|
}
|
|
108
130
|
};
|
|
109
131
|
export const extractOptionIdFromJson = (id, localData) => localData[id] || {};
|
|
110
|
-
export const makeFormatOptions = () => createSelector([getOptions, getValueField, getTextField, getImageField, getPrefixText, getIconName, getIconSize, getOptionType, getDisabledOptions, getListItemProps, getAllowValueFallback], (options, valueField, textField, imageField, prefixText, iconName, iconSize, optionType, disabledOptions, listItemProps, allowValueFallback) => {
|
|
132
|
+
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) => {
|
|
111
133
|
const revampOptions = [];
|
|
112
134
|
const remvampOptionIds = [];
|
|
113
135
|
const normalizedAllOptions = {};
|
|
@@ -119,6 +141,7 @@ export const makeFormatOptions = () => createSelector([getOptions, getValueField
|
|
|
119
141
|
valueField: impValueField,
|
|
120
142
|
textField: impTextField,
|
|
121
143
|
imageField: impImageField,
|
|
144
|
+
secondaryField: impSecondaryField,
|
|
122
145
|
optionType: impOptionType,
|
|
123
146
|
iconName: impIconName,
|
|
124
147
|
iconSize: impIconSize,
|
|
@@ -126,15 +149,25 @@ export const makeFormatOptions = () => createSelector([getOptions, getValueField
|
|
|
126
149
|
} = option;
|
|
127
150
|
let id = typeof option === 'object' ? option[impValueField || valueField] : option;
|
|
128
151
|
const value = typeof option === 'object' ? option[impTextField || textField] : allowValueFallback ? option : '';
|
|
152
|
+
const secondaryValue = typeof option === 'object' ? option[impSecondaryField || secondaryField] : '';
|
|
129
153
|
const photoURL = typeof option === 'object' ? option[impImageField || imageField] : ''; // grouping options (group select/MultiSelect)
|
|
130
154
|
|
|
131
155
|
id = !getIsEmptyValue(id) ? optionIdGrouping(id, prefixText) : '';
|
|
156
|
+
const additionalSearchFieldData = searchFields.reduce((value, item) => {
|
|
157
|
+
if (typeof option === 'object' && option.hasOwnProperty(item)) {
|
|
158
|
+
value[item] = option[item];
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return value;
|
|
162
|
+
}, {});
|
|
132
163
|
|
|
133
164
|
if (remvampOptionIds.indexOf(id) === -1 && !getIsEmptyValue(id) && !getIsEmptyValue(value)) {
|
|
134
165
|
remvampOptionIds.push(id);
|
|
135
|
-
const optionDetails = {
|
|
166
|
+
const optionDetails = { // ...option,
|
|
167
|
+
...additionalSearchFieldData,
|
|
136
168
|
id,
|
|
137
169
|
value,
|
|
170
|
+
secondaryValue,
|
|
138
171
|
optionType: impOptionType || optionType
|
|
139
172
|
};
|
|
140
173
|
|
|
@@ -58,7 +58,8 @@ var ListContainer = function ListContainer(props) {
|
|
|
58
58
|
onClick = props.onClick,
|
|
59
59
|
onMouseEnter = props.onMouseEnter,
|
|
60
60
|
onMouseOver = props.onMouseOver,
|
|
61
|
-
eleRef = props.eleRef
|
|
61
|
+
eleRef = props.eleRef,
|
|
62
|
+
align = props.align;
|
|
62
63
|
var responsiveFunc = (0, _react.useCallback)(function (_ref) {
|
|
63
64
|
var mediaQueryOR = _ref.mediaQueryOR,
|
|
64
65
|
isTouchDevice = _ref.isTouchDevice;
|
|
@@ -102,7 +103,7 @@ var ListContainer = function ListContainer(props) {
|
|
|
102
103
|
"aria-selected": ariaSelected,
|
|
103
104
|
"aria-label": ariaLabel,
|
|
104
105
|
isCover: false,
|
|
105
|
-
align:
|
|
106
|
+
align: align,
|
|
106
107
|
alignBox: "row",
|
|
107
108
|
className: "".concat(_ListItemModule["default"].list, " ").concat(_ListItemModule["default"][size], " ").concat(mobileToTab && isTouchDevice ? _ListItemModule["default"].responsiveHeight : '', " ").concat(_ListItemModule["default"][palette], " ").concat(active ? _ListItemModule["default"]["active".concat(palette)] : highlight && !isDisabled ? _ListItemModule["default"]["".concat(palette, "Hover")] : '', " ").concat(autoHover && !isDisabled ? _ListItemModule["default"]["".concat(palette, "Effect")] : '', " ").concat(needTick ? _ListItemModule["default"]["".concat(size, "withTick")] : '', " ").concat(isDisabled ? (0, _CssProvider["default"])('isDisable') : '', " ").concat(needBorder ? active ? _ListItemModule["default"].activewithBorder : _ListItemModule["default"].withBorder : '', " ").concat(customClass),
|
|
108
109
|
dataId: dataId,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
.varClass {
|
|
2
2
|
/* listitem default variables */
|
|
3
|
+
--listitem_font_size: var(--zd_font_size13);
|
|
3
4
|
--listitem_text_color: var(--zdt_listitem_default_text);
|
|
4
5
|
--listitem_padding: var(--zd_size9) var(--zd_size20);
|
|
5
6
|
--listitem_border_width: 0;
|
|
@@ -24,7 +25,7 @@
|
|
|
24
25
|
position: relative;
|
|
25
26
|
list-style: none;
|
|
26
27
|
color: var(--listitem_text_color);
|
|
27
|
-
font-size: var(--
|
|
28
|
+
font-size: var(--listitem_font_size);
|
|
28
29
|
height: var(--listitem_height);
|
|
29
30
|
min-height: var(--listitem_min_height);
|
|
30
31
|
text-decoration: none;
|
|
@@ -57,7 +58,7 @@
|
|
|
57
58
|
--listitem_min_height: var(--zd_size35);
|
|
58
59
|
}
|
|
59
60
|
.large {
|
|
60
|
-
--
|
|
61
|
+
--listitem_min_height: var(--zd_size48);
|
|
61
62
|
}
|
|
62
63
|
[dir=ltr] .large {
|
|
63
64
|
--listitem_padding: var(--zd_size10) var(--zd_size3) var(--zd_size10) var(--zd_size25);
|
|
@@ -66,15 +67,14 @@
|
|
|
66
67
|
--listitem_padding: var(--zd_size10) var(--zd_size25) var(--zd_size10) var(--zd_size3);
|
|
67
68
|
}
|
|
68
69
|
.value,
|
|
69
|
-
.children {
|
|
70
|
+
.children,.secondaryValue {
|
|
70
71
|
composes: dotted from '../common/common.module.css';
|
|
71
72
|
}
|
|
72
73
|
.value, .multiLineValue {
|
|
73
74
|
line-height: 1.5385;
|
|
74
75
|
}
|
|
75
|
-
.multiLineValue{
|
|
76
|
-
|
|
77
|
-
composes: clamp from '../common/common.module.css'
|
|
76
|
+
.multiLineValue,.multiLine{
|
|
77
|
+
composes: lineClamp from '../common/common.module.css';
|
|
78
78
|
}
|
|
79
79
|
.iconBox {
|
|
80
80
|
width: var(--zd_size20) ;
|
|
@@ -94,6 +94,42 @@
|
|
|
94
94
|
margin: var(--listitem_avatar_margin);
|
|
95
95
|
}
|
|
96
96
|
|
|
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';
|
|
104
|
+
}
|
|
105
|
+
.lhsJustifyContent_center {
|
|
106
|
+
composes: alignHorizontal from '../common/common.module.css';
|
|
107
|
+
}
|
|
108
|
+
.lhsJustifyContent_end {
|
|
109
|
+
composes: justifyFend from '../common/common.module.css';
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.lhsBox {
|
|
113
|
+
composes: dflex from '../common/common.module.css';
|
|
114
|
+
align-self: stretch;
|
|
115
|
+
}
|
|
116
|
+
.lhsBox_small,
|
|
117
|
+
.lhsBox_medium,
|
|
118
|
+
.lhsBox_large{
|
|
119
|
+
composes: varClass;
|
|
120
|
+
--listitem_doubleline_content_height: calc(var(--listitem_font_size) * 2 );
|
|
121
|
+
height: 100% ;
|
|
122
|
+
composes: dflex alignVertical from '../common/common.module.css';
|
|
123
|
+
}
|
|
124
|
+
.lhsBox_small {
|
|
125
|
+
max-height: calc(var(--listitem_doubleline_content_height) + var(--zd_size7)); /* 7px = listitem min-height - (top + bottom padding) - doubleLine content height */
|
|
126
|
+
}
|
|
127
|
+
.lhsBox_medium {
|
|
128
|
+
max-height: calc(var(--listitem_doubleline_content_height) + var(--zd_size8)); /* 8px = listitem min-height - (top + bottom padding) - doubleLine content height */
|
|
129
|
+
}
|
|
130
|
+
.lhsBox_large {
|
|
131
|
+
max-height: calc(var(--listitem_doubleline_content_height) + var(--zd_size15)); /* 15px = listitem min-height - (top + bottom padding) - doubleLine content height */
|
|
132
|
+
}
|
|
97
133
|
.defaultHover, .primaryHover, .secondaryHover, .darkHover {
|
|
98
134
|
background-color: var(--listitem_highlight_bg_color);
|
|
99
135
|
}
|
|
@@ -155,12 +191,23 @@
|
|
|
155
191
|
.activedark {
|
|
156
192
|
--listitem_active_bg_color: var(--zdt_listitem_dark_active_bg);
|
|
157
193
|
}
|
|
194
|
+
.secondaryField{
|
|
195
|
+
color:var(--zdt_listitem_secondaryfield_text);
|
|
196
|
+
font-size: var(--zd_font_size12) ;
|
|
197
|
+
line-height: 1.25;
|
|
198
|
+
}
|
|
158
199
|
|
|
159
200
|
.tickIcon,
|
|
160
201
|
.defaultTick,
|
|
161
202
|
.darkTick {
|
|
162
203
|
position: absolute;
|
|
163
204
|
color: var(--listitem_tickicon_color);
|
|
205
|
+
top:50% ;
|
|
206
|
+
font-size: 0 ;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.tickIcon, .defaultTick, .darkTick {
|
|
210
|
+
transform: translateY(-50%);
|
|
164
211
|
}
|
|
165
212
|
|
|
166
213
|
[dir=ltr] .tickIcon, [dir=ltr] .defaultTick, [dir=ltr] .darkTick {
|
|
@@ -199,7 +246,7 @@
|
|
|
199
246
|
}
|
|
200
247
|
.responsiveHeight {
|
|
201
248
|
--listitem_min_height: var(--zd_size45);
|
|
202
|
-
|
|
249
|
+
--listitem_font_size: var(--zd_font_size15);
|
|
203
250
|
padding-top: var(--zd_size10) ;
|
|
204
251
|
padding-bottom: var(--zd_size10) ;
|
|
205
252
|
}
|