@zohodesk/components 1.0.0-temp-199.11 → 1.0.0-temp-220
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cli/propValidation_report.html +1 -1
- package/README.md +19 -0
- package/assets/Appearance/dark/mode/Component_DarkMode.module.css +8 -0
- package/assets/Appearance/light/mode/Component_LightMode.module.css +8 -0
- package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +8 -0
- package/es/Button/__tests__/__snapshots__/Button.spec.js.snap +2 -2
- package/es/Button/css/Button.module.css +57 -10
- package/es/Button/css/cssJSLogic.js +1 -1
- package/es/Button/props/propTypes.js +1 -1
- package/es/ListItem/ListContainer.js +2 -3
- package/es/ListItem/ListItem.js +2 -3
- package/es/ListItem/ListItem.module.css +2 -11
- package/es/ListItem/ListItemWithAvatar.js +3 -3
- package/es/ListItem/ListItemWithIcon.js +2 -3
- package/es/ListItem/props/defaultProps.js +1 -2
- package/es/ListItem/props/propTypes.js +1 -2
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +14 -11
- package/es/MultiSelect/AdvancedMultiSelect.js +12 -6
- package/es/MultiSelect/MultiSelect.js +12 -11
- package/es/MultiSelect/MultiSelectWithAvatar.js +4 -2
- package/es/MultiSelect/Suggestions.js +2 -9
- package/es/MultiSelect/__tests__/AdvancedMultiSelect.spec.js +28 -0
- package/es/MultiSelect/__tests__/__snapshots__/AdvancedMultiSelect.spec.js.snap +390 -0
- package/es/MultiSelect/props/defaultProps.js +8 -9
- package/es/MultiSelect/props/propTypes.js +5 -11
- package/es/Popup/Popup.js +19 -22
- package/es/RippleEffect/RippleEffect.module.css +16 -0
- package/es/RippleEffect/props/propTypes.js +1 -1
- package/es/Select/GroupSelect.js +5 -7
- package/es/Select/Select.js +3 -1
- package/es/Select/SelectWithAvatar.js +6 -9
- package/es/Select/SelectWithIcon.js +2 -4
- package/es/Select/props/defaultProps.js +5 -4
- package/es/Select/props/propTypes.js +7 -8
- package/es/Tag/Tag.js +1 -1
- package/es/Textarea/Textarea.js +1 -1
- package/es/Textarea/Textarea.module.css +8 -8
- package/es/Textarea/__tests__/Textarea.spec.js +18 -0
- package/es/Textarea/__tests__/__snapshots__/Textarea.spec.js.snap +67 -43
- package/es/common/common.module.css +0 -5
- package/es/utils/dropDownUtils.js +10 -6
- package/lib/Button/__tests__/__snapshots__/Button.spec.js.snap +2 -2
- package/lib/Button/css/Button.module.css +57 -10
- package/lib/Button/css/cssJSLogic.js +1 -1
- package/lib/Button/props/propTypes.js +1 -1
- package/lib/ListItem/ListContainer.js +2 -3
- package/lib/ListItem/ListItem.js +2 -3
- package/lib/ListItem/ListItem.module.css +2 -11
- package/lib/ListItem/ListItemWithAvatar.js +3 -3
- package/lib/ListItem/ListItemWithIcon.js +2 -3
- package/lib/ListItem/props/defaultProps.js +1 -2
- package/lib/ListItem/props/propTypes.js +1 -2
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +14 -12
- package/lib/MultiSelect/AdvancedMultiSelect.js +12 -6
- package/lib/MultiSelect/MultiSelect.js +11 -9
- package/lib/MultiSelect/MultiSelectWithAvatar.js +4 -2
- package/lib/MultiSelect/Suggestions.js +3 -8
- package/lib/MultiSelect/__tests__/AdvancedMultiSelect.spec.js +28 -0
- package/lib/MultiSelect/__tests__/__snapshots__/AdvancedMultiSelect.spec.js.snap +390 -0
- package/lib/MultiSelect/props/defaultProps.js +8 -9
- package/lib/MultiSelect/props/propTypes.js +5 -11
- package/lib/Popup/Popup.js +20 -24
- package/lib/RippleEffect/RippleEffect.module.css +16 -0
- package/lib/RippleEffect/props/propTypes.js +1 -1
- package/lib/Select/GroupSelect.js +6 -6
- package/lib/Select/Select.js +3 -1
- package/lib/Select/SelectWithAvatar.js +7 -10
- package/lib/Select/SelectWithIcon.js +3 -5
- package/lib/Select/props/defaultProps.js +5 -4
- package/lib/Select/props/propTypes.js +7 -8
- package/lib/Tag/Tag.js +1 -1
- package/lib/Textarea/Textarea.js +1 -1
- package/lib/Textarea/Textarea.module.css +8 -8
- package/lib/Textarea/__tests__/Textarea.spec.js +20 -2
- package/lib/Textarea/__tests__/__snapshots__/Textarea.spec.js.snap +67 -43
- package/lib/common/common.module.css +0 -5
- package/lib/utils/dropDownUtils.js +12 -6
- package/package.json +5 -5
- package/result.json +1 -1
|
@@ -27,24 +27,18 @@ export default class Suggestions extends React.PureComponent {
|
|
|
27
27
|
avatarPalette,
|
|
28
28
|
palette,
|
|
29
29
|
htmlId,
|
|
30
|
-
a11y
|
|
31
|
-
customClass,
|
|
32
|
-
needMultiLineText
|
|
30
|
+
a11y
|
|
33
31
|
} = this.props;
|
|
34
32
|
const {
|
|
35
33
|
ariaParentRole,
|
|
36
34
|
ariaMultiselectable
|
|
37
35
|
} = a11y;
|
|
38
|
-
const {
|
|
39
|
-
containerClass
|
|
40
|
-
} = customClass;
|
|
41
36
|
return /*#__PURE__*/React.createElement(Container, {
|
|
42
37
|
isCover: false,
|
|
43
38
|
role: ariaParentRole,
|
|
44
39
|
id: htmlId,
|
|
45
40
|
tabindex: "0",
|
|
46
|
-
"aria-multiselectable": ariaMultiselectable
|
|
47
|
-
className: containerClass
|
|
41
|
+
"aria-multiselectable": ariaMultiselectable
|
|
48
42
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
49
43
|
dataId: `${dataId}`,
|
|
50
44
|
className: className ? className : ''
|
|
@@ -69,7 +63,6 @@ export default class Suggestions extends React.PureComponent {
|
|
|
69
63
|
});
|
|
70
64
|
const commonProps = {
|
|
71
65
|
isDisabled,
|
|
72
|
-
needMultiLineText: needMultiLineText,
|
|
73
66
|
...listItemCustomProps
|
|
74
67
|
};
|
|
75
68
|
|
|
@@ -9,4 +9,32 @@ describe('AdvancedMultiSelect', () => {
|
|
|
9
9
|
} = render( /*#__PURE__*/React.createElement(AdvancedMultiSelect, null));
|
|
10
10
|
expect(asFragment()).toMatchSnapshot();
|
|
11
11
|
});
|
|
12
|
+
const options = [{
|
|
13
|
+
id: 1,
|
|
14
|
+
text: 'Apple'
|
|
15
|
+
}, {
|
|
16
|
+
id: 2,
|
|
17
|
+
text: 'Orange'
|
|
18
|
+
}, 'string test'];
|
|
19
|
+
test('rendering the options array with objects and string', () => {
|
|
20
|
+
const {
|
|
21
|
+
asFragment
|
|
22
|
+
} = render( /*#__PURE__*/React.createElement(AdvancedMultiSelect, {
|
|
23
|
+
isPopupOpen: true,
|
|
24
|
+
isPopupReady: true,
|
|
25
|
+
options: options
|
|
26
|
+
}));
|
|
27
|
+
expect(asFragment()).toMatchSnapshot();
|
|
28
|
+
});
|
|
29
|
+
test('rendering the options array with only objects using allowValueFallback', () => {
|
|
30
|
+
const {
|
|
31
|
+
asFragment
|
|
32
|
+
} = render( /*#__PURE__*/React.createElement(AdvancedMultiSelect, {
|
|
33
|
+
isPopupOpen: true,
|
|
34
|
+
isPopupReady: true,
|
|
35
|
+
options: options,
|
|
36
|
+
allowValueFallback: false
|
|
37
|
+
}));
|
|
38
|
+
expect(asFragment()).toMatchSnapshot();
|
|
39
|
+
});
|
|
12
40
|
});
|
|
@@ -72,3 +72,393 @@ exports[`AdvancedMultiSelect rendering the defult props 1`] = `
|
|
|
72
72
|
</div>
|
|
73
73
|
</DocumentFragment>
|
|
74
74
|
`;
|
|
75
|
+
|
|
76
|
+
exports[`AdvancedMultiSelect rendering the options array with objects and string 1`] = `
|
|
77
|
+
<DocumentFragment>
|
|
78
|
+
<div
|
|
79
|
+
class="wrapper effect "
|
|
80
|
+
data-id="multiSelectComp"
|
|
81
|
+
data-selector-id="advancedMultiSelect"
|
|
82
|
+
data-test-id="multiSelectComp"
|
|
83
|
+
>
|
|
84
|
+
<div
|
|
85
|
+
class="container medium hasBorder borderColor_default flex cover rowdir wrap vCenter"
|
|
86
|
+
data-id="containerComponent"
|
|
87
|
+
data-selector-id="container"
|
|
88
|
+
data-test-id="containerComponent"
|
|
89
|
+
>
|
|
90
|
+
<div
|
|
91
|
+
class="wrapper grow basisAuto shrinkOn"
|
|
92
|
+
data-id="multiSelectComp_textBox"
|
|
93
|
+
data-selector-id="box"
|
|
94
|
+
data-test-id="multiSelectComp_textBox"
|
|
95
|
+
>
|
|
96
|
+
<span
|
|
97
|
+
class=" custmSpan custmSpanMedium
|
|
98
|
+
"
|
|
99
|
+
/>
|
|
100
|
+
<div
|
|
101
|
+
class="container effect custmInputWrapper flex rowdir"
|
|
102
|
+
data-id="containerComponent"
|
|
103
|
+
data-selector-id="textBoxIcon"
|
|
104
|
+
data-test-id="containerComponent"
|
|
105
|
+
>
|
|
106
|
+
<div
|
|
107
|
+
class="grow basis shrinkOff"
|
|
108
|
+
data-id="boxComponent"
|
|
109
|
+
data-selector-id="box"
|
|
110
|
+
data-test-id="boxComponent"
|
|
111
|
+
>
|
|
112
|
+
<input
|
|
113
|
+
aria-controls="1"
|
|
114
|
+
aria-describedby="2"
|
|
115
|
+
aria-expanded="true"
|
|
116
|
+
aria-haspopup="true"
|
|
117
|
+
aria-owns="1"
|
|
118
|
+
autocomplete="off"
|
|
119
|
+
class=" container medium default effect borderColor_default "
|
|
120
|
+
data-id="textBoxIcon"
|
|
121
|
+
data-selector-id="textBoxIcon"
|
|
122
|
+
data-test-id="textBoxIcon"
|
|
123
|
+
maxlength="250"
|
|
124
|
+
role="combobox"
|
|
125
|
+
type="text"
|
|
126
|
+
value=""
|
|
127
|
+
/>
|
|
128
|
+
</div>
|
|
129
|
+
<div
|
|
130
|
+
class="iconContainer shrinkOff"
|
|
131
|
+
data-id="boxComponent"
|
|
132
|
+
data-selector-id="box"
|
|
133
|
+
data-test-id="boxComponent"
|
|
134
|
+
>
|
|
135
|
+
<div
|
|
136
|
+
class="flex cover rowdir"
|
|
137
|
+
data-id="containerComponent"
|
|
138
|
+
data-selector-id="container"
|
|
139
|
+
data-test-id="containerComponent"
|
|
140
|
+
/>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
<div
|
|
146
|
+
aria-multiselectable="true"
|
|
147
|
+
class="main container bottomMid default"
|
|
148
|
+
data-a11y-focus-main-area="true"
|
|
149
|
+
data-arrow-position="mid"
|
|
150
|
+
data-box-direction="bottom"
|
|
151
|
+
data-id="multiSelectComp_dropbox"
|
|
152
|
+
data-position="bottomMid"
|
|
153
|
+
data-selector-id="dropBox"
|
|
154
|
+
data-test-id="multiSelectComp_dropbox"
|
|
155
|
+
dot-ui-element="dropbox"
|
|
156
|
+
id="1"
|
|
157
|
+
role="listbox"
|
|
158
|
+
style="z-index: 4;"
|
|
159
|
+
>
|
|
160
|
+
<div
|
|
161
|
+
class="subContainer shadow boxPadding radius bounce defaultPalette"
|
|
162
|
+
data-id="multiSelectComp_dropbox_subcontainer"
|
|
163
|
+
data-selector-id="dropBox_subcontainer"
|
|
164
|
+
data-test-id="multiSelectComp_dropbox_subcontainer"
|
|
165
|
+
tabindex="-1"
|
|
166
|
+
>
|
|
167
|
+
<div
|
|
168
|
+
class="flex rowdir"
|
|
169
|
+
data-id="containerComponent"
|
|
170
|
+
data-selector-id="container"
|
|
171
|
+
data-test-id="containerComponent"
|
|
172
|
+
>
|
|
173
|
+
<div
|
|
174
|
+
class="grow basis shrinkOff"
|
|
175
|
+
data-id="boxComponent"
|
|
176
|
+
data-selector-id="box"
|
|
177
|
+
data-test-id="boxComponent"
|
|
178
|
+
>
|
|
179
|
+
<div
|
|
180
|
+
class="box flex cover coldir"
|
|
181
|
+
data-id="containerComponent"
|
|
182
|
+
data-selector-id="container"
|
|
183
|
+
data-test-id="containerComponent"
|
|
184
|
+
>
|
|
185
|
+
<div
|
|
186
|
+
class="small grow basis shrinkOn scrolly"
|
|
187
|
+
data-id="CardContent"
|
|
188
|
+
data-selector-id="cardContent"
|
|
189
|
+
data-test-id="CardContent"
|
|
190
|
+
>
|
|
191
|
+
<div
|
|
192
|
+
class="flex coldir"
|
|
193
|
+
data-id="containerComponent"
|
|
194
|
+
data-selector-id="container"
|
|
195
|
+
data-test-id="containerComponent"
|
|
196
|
+
tabindex="0"
|
|
197
|
+
>
|
|
198
|
+
<div
|
|
199
|
+
class="shrinkOff"
|
|
200
|
+
data-id="multiSelectComp_Options"
|
|
201
|
+
data-selector-id="box"
|
|
202
|
+
data-test-id="multiSelectComp_Options"
|
|
203
|
+
>
|
|
204
|
+
<li
|
|
205
|
+
aria-label="Apple"
|
|
206
|
+
aria-selected="false"
|
|
207
|
+
class="list medium default defaultHover mediumwithTick withBorder flex rowdir vCenter"
|
|
208
|
+
data-a11y-inset-focus="true"
|
|
209
|
+
data-a11y-list-active="true"
|
|
210
|
+
data-id="Apple"
|
|
211
|
+
data-selector-id="listItem"
|
|
212
|
+
data-test-id="Apple"
|
|
213
|
+
data-title="Apple"
|
|
214
|
+
role="option"
|
|
215
|
+
tabindex="0"
|
|
216
|
+
>
|
|
217
|
+
<div
|
|
218
|
+
class="value basisAuto shrinkOn"
|
|
219
|
+
data-id="boxComponent"
|
|
220
|
+
data-selector-id="box"
|
|
221
|
+
data-test-id="boxComponent"
|
|
222
|
+
>
|
|
223
|
+
Apple
|
|
224
|
+
</div>
|
|
225
|
+
</li>
|
|
226
|
+
<li
|
|
227
|
+
aria-label="Orange"
|
|
228
|
+
aria-selected="false"
|
|
229
|
+
class="list medium default mediumwithTick withBorder flex rowdir vCenter"
|
|
230
|
+
data-a11y-inset-focus="true"
|
|
231
|
+
data-a11y-list-active="false"
|
|
232
|
+
data-id="Orange"
|
|
233
|
+
data-selector-id="listItem"
|
|
234
|
+
data-test-id="Orange"
|
|
235
|
+
data-title="Orange"
|
|
236
|
+
role="option"
|
|
237
|
+
tabindex="0"
|
|
238
|
+
>
|
|
239
|
+
<div
|
|
240
|
+
class="value basisAuto shrinkOn"
|
|
241
|
+
data-id="boxComponent"
|
|
242
|
+
data-selector-id="box"
|
|
243
|
+
data-test-id="boxComponent"
|
|
244
|
+
>
|
|
245
|
+
Orange
|
|
246
|
+
</div>
|
|
247
|
+
</li>
|
|
248
|
+
<li
|
|
249
|
+
aria-label="string test"
|
|
250
|
+
aria-selected="false"
|
|
251
|
+
class="list medium default mediumwithTick withBorder flex rowdir vCenter"
|
|
252
|
+
data-a11y-inset-focus="true"
|
|
253
|
+
data-a11y-list-active="false"
|
|
254
|
+
data-id="string test"
|
|
255
|
+
data-selector-id="listItem"
|
|
256
|
+
data-test-id="string test"
|
|
257
|
+
data-title="string test"
|
|
258
|
+
role="option"
|
|
259
|
+
tabindex="0"
|
|
260
|
+
>
|
|
261
|
+
<div
|
|
262
|
+
class="value basisAuto shrinkOn"
|
|
263
|
+
data-id="boxComponent"
|
|
264
|
+
data-selector-id="box"
|
|
265
|
+
data-test-id="boxComponent"
|
|
266
|
+
>
|
|
267
|
+
string test
|
|
268
|
+
</div>
|
|
269
|
+
</li>
|
|
270
|
+
</div>
|
|
271
|
+
</div>
|
|
272
|
+
</div>
|
|
273
|
+
</div>
|
|
274
|
+
</div>
|
|
275
|
+
</div>
|
|
276
|
+
</div>
|
|
277
|
+
</div>
|
|
278
|
+
</div>
|
|
279
|
+
</DocumentFragment>
|
|
280
|
+
`;
|
|
281
|
+
|
|
282
|
+
exports[`AdvancedMultiSelect rendering the options array with only objects using allowValueFallback 1`] = `
|
|
283
|
+
<DocumentFragment>
|
|
284
|
+
<div
|
|
285
|
+
class="wrapper effect "
|
|
286
|
+
data-id="multiSelectComp"
|
|
287
|
+
data-selector-id="advancedMultiSelect"
|
|
288
|
+
data-test-id="multiSelectComp"
|
|
289
|
+
>
|
|
290
|
+
<div
|
|
291
|
+
class="container medium hasBorder borderColor_default flex cover rowdir wrap vCenter"
|
|
292
|
+
data-id="containerComponent"
|
|
293
|
+
data-selector-id="container"
|
|
294
|
+
data-test-id="containerComponent"
|
|
295
|
+
>
|
|
296
|
+
<div
|
|
297
|
+
class="wrapper grow basisAuto shrinkOn"
|
|
298
|
+
data-id="multiSelectComp_textBox"
|
|
299
|
+
data-selector-id="box"
|
|
300
|
+
data-test-id="multiSelectComp_textBox"
|
|
301
|
+
>
|
|
302
|
+
<span
|
|
303
|
+
class=" custmSpan custmSpanMedium
|
|
304
|
+
"
|
|
305
|
+
/>
|
|
306
|
+
<div
|
|
307
|
+
class="container effect custmInputWrapper flex rowdir"
|
|
308
|
+
data-id="containerComponent"
|
|
309
|
+
data-selector-id="textBoxIcon"
|
|
310
|
+
data-test-id="containerComponent"
|
|
311
|
+
>
|
|
312
|
+
<div
|
|
313
|
+
class="grow basis shrinkOff"
|
|
314
|
+
data-id="boxComponent"
|
|
315
|
+
data-selector-id="box"
|
|
316
|
+
data-test-id="boxComponent"
|
|
317
|
+
>
|
|
318
|
+
<input
|
|
319
|
+
aria-controls="1"
|
|
320
|
+
aria-describedby="2"
|
|
321
|
+
aria-expanded="true"
|
|
322
|
+
aria-haspopup="true"
|
|
323
|
+
aria-owns="1"
|
|
324
|
+
autocomplete="off"
|
|
325
|
+
class=" container medium default effect borderColor_default "
|
|
326
|
+
data-id="textBoxIcon"
|
|
327
|
+
data-selector-id="textBoxIcon"
|
|
328
|
+
data-test-id="textBoxIcon"
|
|
329
|
+
maxlength="250"
|
|
330
|
+
role="combobox"
|
|
331
|
+
type="text"
|
|
332
|
+
value=""
|
|
333
|
+
/>
|
|
334
|
+
</div>
|
|
335
|
+
<div
|
|
336
|
+
class="iconContainer shrinkOff"
|
|
337
|
+
data-id="boxComponent"
|
|
338
|
+
data-selector-id="box"
|
|
339
|
+
data-test-id="boxComponent"
|
|
340
|
+
>
|
|
341
|
+
<div
|
|
342
|
+
class="flex cover rowdir"
|
|
343
|
+
data-id="containerComponent"
|
|
344
|
+
data-selector-id="container"
|
|
345
|
+
data-test-id="containerComponent"
|
|
346
|
+
/>
|
|
347
|
+
</div>
|
|
348
|
+
</div>
|
|
349
|
+
</div>
|
|
350
|
+
</div>
|
|
351
|
+
<div
|
|
352
|
+
aria-multiselectable="true"
|
|
353
|
+
class="main container bottomMid default"
|
|
354
|
+
data-a11y-focus-main-area="true"
|
|
355
|
+
data-arrow-position="mid"
|
|
356
|
+
data-box-direction="bottom"
|
|
357
|
+
data-id="multiSelectComp_dropbox"
|
|
358
|
+
data-position="bottomMid"
|
|
359
|
+
data-selector-id="dropBox"
|
|
360
|
+
data-test-id="multiSelectComp_dropbox"
|
|
361
|
+
dot-ui-element="dropbox"
|
|
362
|
+
id="1"
|
|
363
|
+
role="listbox"
|
|
364
|
+
style="z-index: 4;"
|
|
365
|
+
>
|
|
366
|
+
<div
|
|
367
|
+
class="subContainer shadow boxPadding radius bounce defaultPalette"
|
|
368
|
+
data-id="multiSelectComp_dropbox_subcontainer"
|
|
369
|
+
data-selector-id="dropBox_subcontainer"
|
|
370
|
+
data-test-id="multiSelectComp_dropbox_subcontainer"
|
|
371
|
+
tabindex="-1"
|
|
372
|
+
>
|
|
373
|
+
<div
|
|
374
|
+
class="flex rowdir"
|
|
375
|
+
data-id="containerComponent"
|
|
376
|
+
data-selector-id="container"
|
|
377
|
+
data-test-id="containerComponent"
|
|
378
|
+
>
|
|
379
|
+
<div
|
|
380
|
+
class="grow basis shrinkOff"
|
|
381
|
+
data-id="boxComponent"
|
|
382
|
+
data-selector-id="box"
|
|
383
|
+
data-test-id="boxComponent"
|
|
384
|
+
>
|
|
385
|
+
<div
|
|
386
|
+
class="box flex cover coldir"
|
|
387
|
+
data-id="containerComponent"
|
|
388
|
+
data-selector-id="container"
|
|
389
|
+
data-test-id="containerComponent"
|
|
390
|
+
>
|
|
391
|
+
<div
|
|
392
|
+
class="small grow basis shrinkOn scrolly"
|
|
393
|
+
data-id="CardContent"
|
|
394
|
+
data-selector-id="cardContent"
|
|
395
|
+
data-test-id="CardContent"
|
|
396
|
+
>
|
|
397
|
+
<div
|
|
398
|
+
class="flex coldir"
|
|
399
|
+
data-id="containerComponent"
|
|
400
|
+
data-selector-id="container"
|
|
401
|
+
data-test-id="containerComponent"
|
|
402
|
+
tabindex="0"
|
|
403
|
+
>
|
|
404
|
+
<div
|
|
405
|
+
class="shrinkOff"
|
|
406
|
+
data-id="multiSelectComp_Options"
|
|
407
|
+
data-selector-id="box"
|
|
408
|
+
data-test-id="multiSelectComp_Options"
|
|
409
|
+
>
|
|
410
|
+
<li
|
|
411
|
+
aria-label="Apple"
|
|
412
|
+
aria-selected="false"
|
|
413
|
+
class="list medium default defaultHover mediumwithTick withBorder flex rowdir vCenter"
|
|
414
|
+
data-a11y-inset-focus="true"
|
|
415
|
+
data-a11y-list-active="true"
|
|
416
|
+
data-id="Apple"
|
|
417
|
+
data-selector-id="listItem"
|
|
418
|
+
data-test-id="Apple"
|
|
419
|
+
data-title="Apple"
|
|
420
|
+
role="option"
|
|
421
|
+
tabindex="0"
|
|
422
|
+
>
|
|
423
|
+
<div
|
|
424
|
+
class="value basisAuto shrinkOn"
|
|
425
|
+
data-id="boxComponent"
|
|
426
|
+
data-selector-id="box"
|
|
427
|
+
data-test-id="boxComponent"
|
|
428
|
+
>
|
|
429
|
+
Apple
|
|
430
|
+
</div>
|
|
431
|
+
</li>
|
|
432
|
+
<li
|
|
433
|
+
aria-label="Orange"
|
|
434
|
+
aria-selected="false"
|
|
435
|
+
class="list medium default mediumwithTick withBorder flex rowdir vCenter"
|
|
436
|
+
data-a11y-inset-focus="true"
|
|
437
|
+
data-a11y-list-active="false"
|
|
438
|
+
data-id="Orange"
|
|
439
|
+
data-selector-id="listItem"
|
|
440
|
+
data-test-id="Orange"
|
|
441
|
+
data-title="Orange"
|
|
442
|
+
role="option"
|
|
443
|
+
tabindex="0"
|
|
444
|
+
>
|
|
445
|
+
<div
|
|
446
|
+
class="value basisAuto shrinkOn"
|
|
447
|
+
data-id="boxComponent"
|
|
448
|
+
data-selector-id="box"
|
|
449
|
+
data-test-id="boxComponent"
|
|
450
|
+
>
|
|
451
|
+
Orange
|
|
452
|
+
</div>
|
|
453
|
+
</li>
|
|
454
|
+
</div>
|
|
455
|
+
</div>
|
|
456
|
+
</div>
|
|
457
|
+
</div>
|
|
458
|
+
</div>
|
|
459
|
+
</div>
|
|
460
|
+
</div>
|
|
461
|
+
</div>
|
|
462
|
+
</div>
|
|
463
|
+
</DocumentFragment>
|
|
464
|
+
`;
|
|
@@ -38,7 +38,7 @@ export const AdvancedGroupMultiSelect_defaultProps = {
|
|
|
38
38
|
palette: 'default',
|
|
39
39
|
isLoading: false,
|
|
40
40
|
dataSelectorId: 'advancedGroupMultiSelect',
|
|
41
|
-
|
|
41
|
+
allowValueFallback: true
|
|
42
42
|
};
|
|
43
43
|
export const AdvancedMultiSelect_defaultProps = {
|
|
44
44
|
animationStyle: 'bounce',
|
|
@@ -72,7 +72,8 @@ export const AdvancedMultiSelect_defaultProps = {
|
|
|
72
72
|
dataSelectorId: 'advancedMultiSelect',
|
|
73
73
|
customClass: {},
|
|
74
74
|
isAbsolutePositioningNeeded: true,
|
|
75
|
-
isRestrictScroll: false
|
|
75
|
+
isRestrictScroll: false,
|
|
76
|
+
allowValueFallback: true
|
|
76
77
|
};
|
|
77
78
|
export const EmptyState_defaultProps = {
|
|
78
79
|
dataId: 'empty',
|
|
@@ -119,7 +120,8 @@ export const MultiSelect_defaultProps = {
|
|
|
119
120
|
selectedOptionsCount: 0,
|
|
120
121
|
cardHeaderName: '',
|
|
121
122
|
needResponsive: true,
|
|
122
|
-
customProps: {}
|
|
123
|
+
customProps: {},
|
|
124
|
+
allowValueFallback: true
|
|
123
125
|
};
|
|
124
126
|
export const MultiSelectHeader_defaultProps = {
|
|
125
127
|
dataId: 'MultiSelectHeader'
|
|
@@ -155,17 +157,14 @@ export const MultiSelectWithAvatar_defaultProps = {
|
|
|
155
157
|
isLoading: false,
|
|
156
158
|
dataSelectorId: 'multiSelectWithAvatar',
|
|
157
159
|
keepSelectedOptions: false,
|
|
160
|
+
customProps: {},
|
|
158
161
|
needResponsive: true,
|
|
159
|
-
|
|
162
|
+
allowValueFallback: true
|
|
160
163
|
};
|
|
161
164
|
export const SelectedOptions_defaultProps = {
|
|
162
165
|
size: 'medium',
|
|
163
166
|
dataId: 'selectedOptions'
|
|
164
167
|
};
|
|
165
168
|
export const Suggestions_defaultProps = {
|
|
166
|
-
a11y: {}
|
|
167
|
-
customClass: {
|
|
168
|
-
containerClass: ''
|
|
169
|
-
},
|
|
170
|
-
needMultiLineText: false
|
|
169
|
+
a11y: {}
|
|
171
170
|
};
|
|
@@ -110,10 +110,10 @@ export const MultiSelect_propTypes = {
|
|
|
110
110
|
setAriaId: PropTypes.string,
|
|
111
111
|
ariaErrorId: PropTypes.string,
|
|
112
112
|
customProps: PropTypes.shape({
|
|
113
|
-
TextBoxIconProps: PropTypes.object
|
|
114
|
-
suggestionsProps: PropTypes.object
|
|
113
|
+
TextBoxIconProps: PropTypes.object
|
|
115
114
|
}),
|
|
116
|
-
isFocus: PropTypes.bool
|
|
115
|
+
isFocus: PropTypes.bool,
|
|
116
|
+
allowValueFallback: PropTypes.bool
|
|
117
117
|
};
|
|
118
118
|
export const MultiSelectHeader_propTypes = {
|
|
119
119
|
dataId: PropTypes.string,
|
|
@@ -178,11 +178,7 @@ export const Suggestions_propTypes = {
|
|
|
178
178
|
logo: PropTypes.string,
|
|
179
179
|
optionType: PropTypes.string,
|
|
180
180
|
listItemProps: PropTypes.object
|
|
181
|
-
}))
|
|
182
|
-
customClass: PropTypes.shape({
|
|
183
|
-
containerClass: PropTypes.string
|
|
184
|
-
}),
|
|
185
|
-
needMultiLineText: PropTypes.bool
|
|
181
|
+
}))
|
|
186
182
|
};
|
|
187
183
|
export const AdvancedGroupMultiSelect_propTypes = {
|
|
188
184
|
animationStyle: PropTypes.string,
|
|
@@ -254,9 +250,7 @@ export const AdvancedGroupMultiSelect_propTypes = {
|
|
|
254
250
|
children: PropTypes.node,
|
|
255
251
|
dataSelectorId: PropTypes.string,
|
|
256
252
|
isFocus: PropTypes.bool,
|
|
257
|
-
|
|
258
|
-
suggestionsProps: PropTypes.object
|
|
259
|
-
})
|
|
253
|
+
allowValueFallback: PropTypes.bool
|
|
260
254
|
};
|
|
261
255
|
export const AdvancedMultiSelect_propTypes = { ...MultiSelect_propTypes,
|
|
262
256
|
selectedOptionDetails: PropTypes.string,
|
package/es/Popup/Popup.js
CHANGED
|
@@ -74,8 +74,7 @@ const Popup = function (Component) {
|
|
|
74
74
|
isMobile: false
|
|
75
75
|
};
|
|
76
76
|
this.togglePopup = this.togglePopup.bind(this);
|
|
77
|
-
this.
|
|
78
|
-
this.documentClickHandler1 = this.documentClickHandler1.bind(this);
|
|
77
|
+
this.handleDocumentInteraction = this.handleDocumentInteraction.bind(this);
|
|
79
78
|
this.removeClose = this.removeClose.bind(this);
|
|
80
79
|
this.documentKeyupHandler = this.documentKeyupHandler.bind(this);
|
|
81
80
|
this.openPopupOnly = this.openPopupOnly.bind(this);
|
|
@@ -133,11 +132,10 @@ const Popup = function (Component) {
|
|
|
133
132
|
popups[group] = groupPopups;
|
|
134
133
|
|
|
135
134
|
if (Object.keys(popups).length === 1 && groupPopups.length === 1) {
|
|
136
|
-
document.addEventListener('click', this.
|
|
135
|
+
document.addEventListener('click', this.handleDocumentInteraction, true);
|
|
137
136
|
document.addEventListener('keyup', this.documentKeyupHandler, false); // document.addEventListener('scroll', this.handleScroll, true);
|
|
138
137
|
|
|
139
138
|
window.addEventListener('resize', this.handleResize);
|
|
140
|
-
document.addEventListener('click', this.documentClickHandler1, true);
|
|
141
139
|
document.addEventListener('mousedown', this.handleDocumentMouseDown, true);
|
|
142
140
|
document.addEventListener('focus', this.handleDocumentFocus, true);
|
|
143
141
|
}
|
|
@@ -224,11 +222,10 @@ const Popup = function (Component) {
|
|
|
224
222
|
}
|
|
225
223
|
|
|
226
224
|
if (noPopups) {
|
|
227
|
-
document.removeEventListener('click', this.
|
|
225
|
+
document.removeEventListener('click', this.handleDocumentInteraction, true);
|
|
228
226
|
document.removeEventListener('keyup', this.documentKeyupHandler); // document.removeEventListener('scroll', this.handleScroll);
|
|
229
227
|
|
|
230
228
|
window.removeEventListener('resize', this.handleResize);
|
|
231
|
-
document.removeEventListener('click', this.documentClickHandler1, true);
|
|
232
229
|
document.removeEventListener('mousedown', this.handleDocumentMouseDown, true);
|
|
233
230
|
document.removeEventListener('focus', this.handleDocumentFocus, true);
|
|
234
231
|
}
|
|
@@ -617,29 +614,29 @@ const Popup = function (Component) {
|
|
|
617
614
|
return needPrevent;
|
|
618
615
|
}
|
|
619
616
|
|
|
620
|
-
|
|
617
|
+
handleDocumentInteraction(e) {
|
|
621
618
|
const needPrevent = this.handleGetNeedPrevent(e);
|
|
622
619
|
|
|
623
620
|
if (needPrevent) {
|
|
624
621
|
this.removeClose(e);
|
|
625
622
|
this.handleCloseLastOpenedGroup();
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
623
|
+
} else {
|
|
624
|
+
try {
|
|
625
|
+
Object.keys(popups).forEach(groupName => {
|
|
626
|
+
const groupPopups = popups[groupName] || [];
|
|
627
|
+
groupPopups.forEach(popup => {
|
|
628
|
+
if (popup.placeHolderElement && popup.dropElement && popup.placeHolderElement !== e.target && !popup.placeHolderElement.contains(e.target) && popup.dropElement !== e.target && !popup.dropElement.contains(e.target)) {
|
|
629
|
+
popup.state.isPopupOpen && (!popup.props.checkBeforeClose || popup.props.checkBeforeClose && popup.props.checkBeforeClose()) && !isTextSelected() && popup.setState({
|
|
630
|
+
isPopupOpen: false,
|
|
631
|
+
isPopupReady: false
|
|
632
|
+
});
|
|
633
|
+
}
|
|
637
634
|
});
|
|
638
635
|
});
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
636
|
+
lastOpenedGroup = [];
|
|
637
|
+
} catch (error) {// eslint-disable-next-line no-console
|
|
638
|
+
//console.error('popup component not unmounted properly', error);
|
|
639
|
+
}
|
|
643
640
|
}
|
|
644
641
|
}
|
|
645
642
|
|
|
@@ -90,3 +90,19 @@
|
|
|
90
90
|
.notAllowed {
|
|
91
91
|
cursor: not-allowed;
|
|
92
92
|
}
|
|
93
|
+
.secondary.defaultHover, .hoverEffect:hover.secondary.borderHover
|
|
94
|
+
/* .hoverEffect:focus.secondary.borderHover */
|
|
95
|
+
{
|
|
96
|
+
border-color: var(--zdt_rippleeffect_secondary_border);
|
|
97
|
+
}
|
|
98
|
+
.hoverEffect:hover.secondary.bgHover
|
|
99
|
+
/* .hoverEffect:focus.secondary.bgHover */
|
|
100
|
+
{
|
|
101
|
+
background-color: var(--zdt_rippleeffect_secondary_bg);
|
|
102
|
+
}
|
|
103
|
+
.secondary.active {
|
|
104
|
+
background-color: var(--zdt_rippleeffect_secondary_active_bg);
|
|
105
|
+
}
|
|
106
|
+
.secondary.active.border {
|
|
107
|
+
border-color: var(--zdt_rippleeffect_secondary_active_border);
|
|
108
|
+
}
|
|
@@ -6,7 +6,7 @@ export const propTypes = {
|
|
|
6
6
|
isDisabled: PropTypes.bool,
|
|
7
7
|
isNeedEffect: PropTypes.bool,
|
|
8
8
|
needBorder: PropTypes.bool,
|
|
9
|
-
palette: PropTypes.oneOf(['default', 'primary', 'primaryLight', 'primaryFilled', 'primaryDark', 'green', 'danger']),
|
|
9
|
+
palette: PropTypes.oneOf(['default', 'secondary', 'primary', 'primaryLight', 'primaryFilled', 'primaryDark', 'green', 'danger']),
|
|
10
10
|
cssClassPropOfChild: PropTypes.string,
|
|
11
11
|
isCopyTextEnabled: PropTypes.bool
|
|
12
12
|
};
|