@zohodesk/components 1.0.0-temp-220.6 → 1.0.0-temp-223
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 +8 -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 +52 -6
- 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 +5 -2
- package/es/MultiSelect/__tests__/__snapshots__/MultiSelectHeader.spec.js.snap +34 -13
- package/es/MultiSelect/props/propTypes.js +3 -0
- package/es/Popup/Popup.js +37 -116
- package/es/Provider/Config.js +1 -2
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +21 -2
- package/es/VelocityAnimation/VelocityAnimationGroup/props/defaultProps.js +2 -1
- package/es/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +2 -1
- package/es/common/common.module.css +10 -0
- package/es/utils/dropDownUtils.js +33 -8
- package/lib/ListItem/ListContainer.js +3 -2
- package/lib/ListItem/ListItem.module.css +52 -6
- 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 +5 -2
- package/lib/MultiSelect/__tests__/__snapshots__/MultiSelectHeader.spec.js.snap +34 -13
- package/lib/MultiSelect/props/propTypes.js +4 -1
- package/lib/Popup/Popup.js +90 -181
- package/lib/Provider/Config.js +1 -2
- package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +49 -9
- package/lib/VelocityAnimation/VelocityAnimationGroup/props/defaultProps.js +2 -1
- package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +2 -1
- package/lib/common/common.module.css +10 -0
- package/lib/utils/dropDownUtils.js +41 -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
|
|
|
@@ -46,6 +46,7 @@ export default class Suggestions extends React.PureComponent {
|
|
|
46
46
|
const {
|
|
47
47
|
id,
|
|
48
48
|
value,
|
|
49
|
+
secondaryValue,
|
|
49
50
|
photoURL,
|
|
50
51
|
icon,
|
|
51
52
|
optionType,
|
|
@@ -92,7 +93,8 @@ export default class Suggestions extends React.PureComponent {
|
|
|
92
93
|
size: listItemSize,
|
|
93
94
|
avatarPalette: avatarPalette,
|
|
94
95
|
palette: palette,
|
|
95
|
-
a11y: list_a11y
|
|
96
|
+
a11y: list_a11y,
|
|
97
|
+
secondaryValue: secondaryValue
|
|
96
98
|
});
|
|
97
99
|
} else if (optionType === 'icon') {
|
|
98
100
|
return /*#__PURE__*/React.createElement(ListItemWithIcon, { ...commonProps,
|
|
@@ -112,7 +114,8 @@ export default class Suggestions extends React.PureComponent {
|
|
|
112
114
|
iconSize: iconSize,
|
|
113
115
|
size: listItemSize,
|
|
114
116
|
palette: palette,
|
|
115
|
-
a11y: list_a11y
|
|
117
|
+
a11y: list_a11y,
|
|
118
|
+
secondaryValue: secondaryValue
|
|
116
119
|
});
|
|
117
120
|
}
|
|
118
121
|
|
|
@@ -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 = {
|
|
@@ -281,6 +283,7 @@ export const AdvancedMultiSelect_propTypes = { ...MultiSelect_propTypes,
|
|
|
281
283
|
//For grouping multiSelect
|
|
282
284
|
optionType: PropTypes.oneOf(['default', 'avatar', 'icon']),
|
|
283
285
|
needEffect: PropTypes.bool,
|
|
286
|
+
secondaryField: PropTypes.string,
|
|
284
287
|
animationStyle: PropTypes.string,
|
|
285
288
|
defaultDropBoxPosition: PropTypes.oneOf(['bottom', 'top', 'left', 'right']),
|
|
286
289
|
dropBoxSize: PropTypes.oneOf(['small', 'medium', 'large']),
|
package/es/Popup/Popup.js
CHANGED
|
@@ -12,7 +12,6 @@ import { addIntersectionObserver, removeIntersectionObserver } from "./intersect
|
|
|
12
12
|
import { positionMapping } from "../DropBox/DropBoxPositionMapping.js";
|
|
13
13
|
import isMobilePopover from "../DropBox/utils/isMobilePopover.js";
|
|
14
14
|
import selectn from 'selectn';
|
|
15
|
-
import { getLibraryConfig } from "../Provider/Config.js";
|
|
16
15
|
let lastOpenedGroup = [];
|
|
17
16
|
let popups = {};
|
|
18
17
|
|
|
@@ -39,51 +38,6 @@ const defaultState = {
|
|
|
39
38
|
//{height: ‘’, width: ‘’,}
|
|
40
39
|
isAbsolutePositioningNeeded: true
|
|
41
40
|
};
|
|
42
|
-
const SCROLL_BLOCK_EVENTS = Object.freeze([{
|
|
43
|
-
name: 'wheel',
|
|
44
|
-
handlerName: 'handleBlockScroll',
|
|
45
|
-
options: {
|
|
46
|
-
capture: true,
|
|
47
|
-
passive: false
|
|
48
|
-
}
|
|
49
|
-
}, {
|
|
50
|
-
name: 'touchmove',
|
|
51
|
-
handlerName: 'handleBlockScroll',
|
|
52
|
-
options: {
|
|
53
|
-
capture: true,
|
|
54
|
-
passive: false
|
|
55
|
-
}
|
|
56
|
-
}, {
|
|
57
|
-
name: 'scroll',
|
|
58
|
-
handlerName: 'handlePositionChange',
|
|
59
|
-
options: {
|
|
60
|
-
capture: true,
|
|
61
|
-
passive: false
|
|
62
|
-
}
|
|
63
|
-
}, {
|
|
64
|
-
name: 'keydown',
|
|
65
|
-
handlerName: 'preventKeyboardScroll',
|
|
66
|
-
options: {
|
|
67
|
-
capture: true,
|
|
68
|
-
passive: false
|
|
69
|
-
}
|
|
70
|
-
}]);
|
|
71
|
-
const IFRAME_SCROLL_BLOCK_EVENTS = Object.freeze(SCROLL_BLOCK_EVENTS.filter(event => event.name !== 'keydown'));
|
|
72
|
-
const CLICK_EVENTS = Object.freeze([{
|
|
73
|
-
name: 'click',
|
|
74
|
-
handlerName: 'documentClickHandler',
|
|
75
|
-
options: {
|
|
76
|
-
capture: false,
|
|
77
|
-
passive: false
|
|
78
|
-
}
|
|
79
|
-
}, {
|
|
80
|
-
name: 'click',
|
|
81
|
-
handlerName: 'documentClickHandler1',
|
|
82
|
-
options: {
|
|
83
|
-
capture: true,
|
|
84
|
-
passive: false
|
|
85
|
-
}
|
|
86
|
-
}]);
|
|
87
41
|
/* eslint-disable react/no-deprecated */
|
|
88
42
|
|
|
89
43
|
/* eslint-disable react/prop-types */
|
|
@@ -145,7 +99,6 @@ const Popup = function (Component) {
|
|
|
145
99
|
this.handleBlockScroll = this.handleBlockScroll.bind(this);
|
|
146
100
|
this.handlePositionChange = this.handlePositionChange.bind(this);
|
|
147
101
|
this.preventKeyboardScroll = this.preventKeyboardScroll.bind(this);
|
|
148
|
-
this.updateListeners = this.updateListeners.bind(this);
|
|
149
102
|
this.addScrollBlockListeners = this.addScrollBlockListeners.bind(this);
|
|
150
103
|
this.removeScrollBlockListeners = this.removeScrollBlockListeners.bind(this);
|
|
151
104
|
this.handleAddingScrollBlock = this.handleAddingScrollBlock.bind(this);
|
|
@@ -158,11 +111,8 @@ const Popup = function (Component) {
|
|
|
158
111
|
this.setContainerDynamicPositioning = this.setContainerDynamicPositioning.bind(this);
|
|
159
112
|
this.updatePopupState = this.updatePopupState.bind(this);
|
|
160
113
|
this.handleScrollAndBlockEvents = this.handleScrollAndBlockEvents.bind(this);
|
|
161
|
-
this.handleIframeClickEvents = this.handleIframeClickEvents.bind(this);
|
|
162
114
|
this.handleDropElementStyleUpdate = this.handleDropElementStyleUpdate.bind(this);
|
|
163
|
-
this.getParentContainerElement = this.getParentContainerElement.bind(this);
|
|
164
115
|
this.positionRef = /*#__PURE__*/React.createRef();
|
|
165
|
-
this.parentContainerElement = this.getParentContainerElement();
|
|
166
116
|
this.popupObserver = new ResizeObserver(this.handlePopupResize); //dropBoxSize
|
|
167
117
|
|
|
168
118
|
this.size = null;
|
|
@@ -183,10 +133,11 @@ const Popup = function (Component) {
|
|
|
183
133
|
popups[group] = groupPopups;
|
|
184
134
|
|
|
185
135
|
if (Object.keys(popups).length === 1 && groupPopups.length === 1) {
|
|
186
|
-
|
|
136
|
+
document.addEventListener('click', this.documentClickHandler, false);
|
|
187
137
|
document.addEventListener('keyup', this.documentKeyupHandler, false); // document.addEventListener('scroll', this.handleScroll, true);
|
|
188
138
|
|
|
189
139
|
window.addEventListener('resize', this.handleResize);
|
|
140
|
+
document.addEventListener('click', this.documentClickHandler1, true);
|
|
190
141
|
document.addEventListener('mousedown', this.handleDocumentMouseDown, true);
|
|
191
142
|
document.addEventListener('focus', this.handleDocumentFocus, true);
|
|
192
143
|
}
|
|
@@ -205,22 +156,8 @@ const Popup = function (Component) {
|
|
|
205
156
|
}
|
|
206
157
|
}
|
|
207
158
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
if (getParentContainer && typeof getParentContainer === 'function') {
|
|
212
|
-
const parent = getParentContainer();
|
|
213
|
-
|
|
214
|
-
if (parent) {
|
|
215
|
-
return parent;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
return document;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
handleScrollAndBlockEvents(shouldAdd) {
|
|
223
|
-
if (shouldAdd) {
|
|
159
|
+
handleScrollAndBlockEvents(isPopupReady, isMobile) {
|
|
160
|
+
if (isPopupReady && !isMobile) {
|
|
224
161
|
this.handleAddingScrollBlock();
|
|
225
162
|
this.handleAddingScrollToUpdatePosition();
|
|
226
163
|
} else {
|
|
@@ -229,16 +166,6 @@ const Popup = function (Component) {
|
|
|
229
166
|
}
|
|
230
167
|
}
|
|
231
168
|
|
|
232
|
-
handleIframeClickEvents(shouldAdd) {
|
|
233
|
-
this.parentContainerElement.querySelectorAll('iframe').forEach(frame => {
|
|
234
|
-
const frameDocument = frame.contentDocument;
|
|
235
|
-
|
|
236
|
-
if (frameDocument) {
|
|
237
|
-
this.updateListeners(shouldAdd, CLICK_EVENTS, frameDocument);
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
|
|
242
169
|
componentDidUpdate(prevProps, prevState) {
|
|
243
170
|
const {
|
|
244
171
|
isPopupReady,
|
|
@@ -265,8 +192,7 @@ const Popup = function (Component) {
|
|
|
265
192
|
}
|
|
266
193
|
|
|
267
194
|
if (oldStateOpen !== isPopupReady && !isMobile || oldIsMobileState !== isMobile) {
|
|
268
|
-
this.handleScrollAndBlockEvents(isPopupReady
|
|
269
|
-
this.handleIframeClickEvents(isPopupReady && !isMobile);
|
|
195
|
+
this.handleScrollAndBlockEvents(isPopupReady, isMobile);
|
|
270
196
|
}
|
|
271
197
|
}
|
|
272
198
|
|
|
@@ -284,7 +210,6 @@ const Popup = function (Component) {
|
|
|
284
210
|
}, popups);
|
|
285
211
|
this.handleRemovingScrollBlock();
|
|
286
212
|
this.handleRemovingScrollToUpdatePosition();
|
|
287
|
-
this.handleIframeClickEvents(false);
|
|
288
213
|
let noPopups = true;
|
|
289
214
|
|
|
290
215
|
for (const i in popups) {
|
|
@@ -299,10 +224,11 @@ const Popup = function (Component) {
|
|
|
299
224
|
}
|
|
300
225
|
|
|
301
226
|
if (noPopups) {
|
|
302
|
-
|
|
227
|
+
document.removeEventListener('click', this.documentClickHandler);
|
|
303
228
|
document.removeEventListener('keyup', this.documentKeyupHandler); // document.removeEventListener('scroll', this.handleScroll);
|
|
304
229
|
|
|
305
230
|
window.removeEventListener('resize', this.handleResize);
|
|
231
|
+
document.removeEventListener('click', this.documentClickHandler1, true);
|
|
306
232
|
document.removeEventListener('mousedown', this.handleDocumentMouseDown, true);
|
|
307
233
|
document.removeEventListener('focus', this.handleDocumentFocus, true);
|
|
308
234
|
}
|
|
@@ -420,46 +346,41 @@ const Popup = function (Component) {
|
|
|
420
346
|
}
|
|
421
347
|
}
|
|
422
348
|
|
|
423
|
-
updateListeners() {
|
|
424
|
-
let add = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
425
|
-
let eventList = arguments.length > 1 ? arguments[1] : undefined;
|
|
426
|
-
let element = arguments.length > 2 ? arguments[2] : undefined;
|
|
427
|
-
const method = add ? 'addEventListener' : 'removeEventListener';
|
|
428
|
-
eventList.forEach(_ref2 => {
|
|
429
|
-
let {
|
|
430
|
-
name,
|
|
431
|
-
handlerName,
|
|
432
|
-
options
|
|
433
|
-
} = _ref2;
|
|
434
|
-
const handler = this[handlerName];
|
|
435
|
-
|
|
436
|
-
if (handler) {
|
|
437
|
-
element[method](name, handler, options);
|
|
438
|
-
}
|
|
439
|
-
});
|
|
440
|
-
}
|
|
441
|
-
|
|
442
349
|
addScrollBlockListeners() {
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
350
|
+
document.addEventListener('wheel', this.handleBlockScroll, {
|
|
351
|
+
capture: true,
|
|
352
|
+
passive: false
|
|
353
|
+
});
|
|
354
|
+
document.addEventListener('touchmove', this.handleBlockScroll, {
|
|
355
|
+
capture: true,
|
|
356
|
+
passive: false
|
|
357
|
+
});
|
|
358
|
+
document.addEventListener('scroll', this.handlePositionChange, {
|
|
359
|
+
capture: true,
|
|
360
|
+
passive: false
|
|
361
|
+
});
|
|
362
|
+
document.addEventListener('keydown', this.preventKeyboardScroll, {
|
|
363
|
+
capture: true,
|
|
364
|
+
passive: false
|
|
452
365
|
});
|
|
453
366
|
}
|
|
454
367
|
|
|
455
368
|
removeScrollBlockListeners() {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
369
|
+
document.removeEventListener('wheel', this.handleBlockScroll, {
|
|
370
|
+
capture: true,
|
|
371
|
+
passive: false
|
|
372
|
+
});
|
|
373
|
+
document.removeEventListener('touchmove', this.handleBlockScroll, {
|
|
374
|
+
capture: true,
|
|
375
|
+
passive: false
|
|
376
|
+
});
|
|
377
|
+
document.removeEventListener('scroll', this.handlePositionChange, {
|
|
378
|
+
capture: true,
|
|
379
|
+
passive: false
|
|
380
|
+
});
|
|
381
|
+
document.removeEventListener('keydown', this.preventKeyboardScroll, {
|
|
382
|
+
capture: true,
|
|
383
|
+
passive: false
|
|
463
384
|
});
|
|
464
385
|
}
|
|
465
386
|
|
package/es/Provider/Config.js
CHANGED
|
@@ -16,6 +16,20 @@ 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
|
+
}
|
|
21
|
+
|
|
22
|
+
handleOnEnterComplete(onEnterComplete, elements) {
|
|
23
|
+
if (typeof onEnterComplete === 'function') {
|
|
24
|
+
onEnterComplete(elements);
|
|
25
|
+
} else if (onEnterComplete && typeof onEnterComplete === 'object') {
|
|
26
|
+
elements.forEach(rootElement => {
|
|
27
|
+
Object.entries(onEnterComplete).forEach(_ref => {
|
|
28
|
+
let [cssProperty, cssValue] = _ref;
|
|
29
|
+
if (cssProperty.includes) rootElement.style[cssProperty] = cssValue;
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
}
|
|
19
33
|
}
|
|
20
34
|
|
|
21
35
|
render() {
|
|
@@ -35,7 +49,8 @@ export default class VelocityAnimationGroup extends React.Component {
|
|
|
35
49
|
enterDelay,
|
|
36
50
|
isCustomized,
|
|
37
51
|
name,
|
|
38
|
-
needUIPack
|
|
52
|
+
needUIPack,
|
|
53
|
+
onEnterComplete
|
|
39
54
|
} = this.props;
|
|
40
55
|
let {
|
|
41
56
|
direction,
|
|
@@ -76,7 +91,10 @@ export default class VelocityAnimationGroup extends React.Component {
|
|
|
76
91
|
animation: isCustomized ? enterAnimationObj[name] : needUIPack ? `transition.${enterName}In` : enterName,
|
|
77
92
|
duration: !isReducedMotion ? enterDuration : 0,
|
|
78
93
|
delay: enterDelay ? enterDelay : 0,
|
|
79
|
-
display: isFlex ? 'flex' : ''
|
|
94
|
+
display: isFlex ? 'flex' : '',
|
|
95
|
+
complete: elements => {
|
|
96
|
+
this.handleOnEnterComplete(onEnterComplete, elements);
|
|
97
|
+
}
|
|
80
98
|
};
|
|
81
99
|
let exitAnimation = {
|
|
82
100
|
animation: isCustomized ? exitAnimationObj[name] : needUIPack ? `transition.${exitName ? exitName : enterName}Out` : exitName ? exitName : enterName,
|
|
@@ -91,6 +109,7 @@ export default class VelocityAnimationGroup extends React.Component {
|
|
|
91
109
|
runOnMount: runOnMount,
|
|
92
110
|
enterHideStyle: enterHideStyle,
|
|
93
111
|
enterShowStyle: enterShowStyle,
|
|
112
|
+
onEnterComplete: onEnterComplete,
|
|
94
113
|
...childProps
|
|
95
114
|
}, isActive ? children : null);
|
|
96
115
|
}
|
|
@@ -15,5 +15,6 @@ 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.oneOfType([PropTypes.object, PropTypes.func])
|
|
19
20
|
};
|
|
@@ -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,36 @@ 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
|
+
};
|
|
47
|
+
|
|
48
|
+
const isObjectContainsSearchString = function () {
|
|
49
|
+
let searchFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
50
|
+
let searchStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
51
|
+
let obj = arguments.length > 2 ? arguments[2] : undefined;
|
|
52
|
+
const matchedFields = searchFields.filter(element => {
|
|
53
|
+
return getSearchString(obj[element]).indexOf(searchStr) !== -1;
|
|
54
|
+
});
|
|
55
|
+
return matchedFields.length !== 0;
|
|
56
|
+
};
|
|
57
|
+
|
|
43
58
|
const getAllowValueFallback = props => props.allowValueFallback !== false;
|
|
44
59
|
|
|
45
|
-
export const makeGetMultiSelectFilterSuggestions = () => createSelector([getOptions, getSelectedOptionsSel, getSearchStr, getNeedSearch, getIsStartWithSearch, getKeepSelectedOptions], (options, selectedOptions, searchStr, needSearch, isStartsWithSearch, keepSelectedOptions) => {
|
|
60
|
+
export const makeGetMultiSelectFilterSuggestions = () => createSelector([getOptions, getSelectedOptionsSel, getSearchStr, getNeedSearch, getIsStartWithSearch, getKeepSelectedOptions, getSearchFields], (options, selectedOptions, searchStr, needSearch, isStartsWithSearch, keepSelectedOptions, searchFields) => {
|
|
46
61
|
const suggestions = [];
|
|
47
62
|
const suggestionIds = [];
|
|
48
63
|
options.forEach(option => {
|
|
64
|
+
const searchString = getSearchString(searchStr);
|
|
49
65
|
const {
|
|
50
|
-
id,
|
|
51
66
|
value = ''
|
|
52
67
|
} = option;
|
|
53
68
|
const valueString = getSearchString(value);
|
|
54
|
-
const
|
|
55
|
-
const isMatch = needSearch ? isStartsWithSearch ? valueString.startsWith(searchString) : valueString.indexOf(searchString) !== -1 : true;
|
|
69
|
+
const isMatch = needSearch ? isStartsWithSearch ? valueString.startsWith(searchString) : isObjectContainsSearchString(searchFields, searchString, option) : true;
|
|
56
70
|
|
|
57
|
-
if (selectedOptions.indexOf(id) === -1 && isMatch || keepSelectedOptions) {
|
|
71
|
+
if (selectedOptions.indexOf(option.id) === -1 && isMatch || keepSelectedOptions) {
|
|
58
72
|
suggestions.push(option);
|
|
59
|
-
suggestionIds.push(id);
|
|
73
|
+
suggestionIds.push(option.id);
|
|
60
74
|
}
|
|
61
75
|
});
|
|
62
76
|
return {
|
|
@@ -107,7 +121,7 @@ export const extractOptionId = id => {
|
|
|
107
121
|
}
|
|
108
122
|
};
|
|
109
123
|
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) => {
|
|
124
|
+
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
125
|
const revampOptions = [];
|
|
112
126
|
const remvampOptionIds = [];
|
|
113
127
|
const normalizedAllOptions = {};
|
|
@@ -119,6 +133,7 @@ export const makeFormatOptions = () => createSelector([getOptions, getValueField
|
|
|
119
133
|
valueField: impValueField,
|
|
120
134
|
textField: impTextField,
|
|
121
135
|
imageField: impImageField,
|
|
136
|
+
secondaryField: impSecondaryField,
|
|
122
137
|
optionType: impOptionType,
|
|
123
138
|
iconName: impIconName,
|
|
124
139
|
iconSize: impIconSize,
|
|
@@ -126,15 +141,25 @@ export const makeFormatOptions = () => createSelector([getOptions, getValueField
|
|
|
126
141
|
} = option;
|
|
127
142
|
let id = typeof option === 'object' ? option[impValueField || valueField] : option;
|
|
128
143
|
const value = typeof option === 'object' ? option[impTextField || textField] : allowValueFallback ? option : '';
|
|
144
|
+
const secondaryValue = typeof option === 'object' ? option[impSecondaryField || secondaryField] : '';
|
|
129
145
|
const photoURL = typeof option === 'object' ? option[impImageField || imageField] : ''; // grouping options (group select/MultiSelect)
|
|
130
146
|
|
|
131
147
|
id = !getIsEmptyValue(id) ? optionIdGrouping(id, prefixText) : '';
|
|
148
|
+
const additionalSearchFieldData = searchFields.reduce((value, item) => {
|
|
149
|
+
if (typeof option === 'object' && option.hasOwnProperty(item)) {
|
|
150
|
+
value[item] = option[item];
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
return value;
|
|
154
|
+
}, {});
|
|
132
155
|
|
|
133
156
|
if (remvampOptionIds.indexOf(id) === -1 && !getIsEmptyValue(id) && !getIsEmptyValue(value)) {
|
|
134
157
|
remvampOptionIds.push(id);
|
|
135
|
-
const optionDetails = {
|
|
158
|
+
const optionDetails = { // ...option,
|
|
159
|
+
...additionalSearchFieldData,
|
|
136
160
|
id,
|
|
137
161
|
value,
|
|
162
|
+
secondaryValue,
|
|
138
163
|
optionType: impOptionType || optionType
|
|
139
164
|
};
|
|
140
165
|
|
|
@@ -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,
|