@zohodesk/components 1.3.1 → 1.3.3
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 +18 -31
- package/es/Button/__tests__/Button.spec.js +134 -1
- package/es/DateTime/__tests__/YearView.spec.js +1 -2
- package/es/MultiSelect/__tests__/AdvancedMultiSelect.spec.js +8 -1
- package/es/Popup/Popup.js +16 -10
- package/es/Provider/IdProvider.js +1 -1
- package/es/Select/__tests__/Select.spec.js +1130 -4
- package/es/Select/__tests__/__snapshots__/Select.spec.js.snap +9621 -1
- package/es/Stencils/Stencils.js +5 -12
- package/es/Stencils/Stencils.module.css +11 -7
- package/es/Stencils/__tests__/Stencils.spec.js +9 -1
- package/es/Stencils/__tests__/__snapshots__/Stencils.spec.js.snap +27 -11
- package/es/Stencils/props/defaultProps.js +2 -1
- package/es/Stencils/props/propTypes.js +3 -2
- package/es/Tab/Tab.js +2 -1
- package/es/Tab/TabWrapper.js +2 -1
- package/es/Tab/Tabs.js +10 -10
- package/es/Tab/__tests__/TabLayout.spec.js +34 -0
- package/es/Tab/__tests__/__snapshots__/TabLayout.spec.js.snap +341 -0
- package/es/Tab/props/propTypes.js +2 -2
- package/es/Tab/utils/tabConfigs.js +18 -0
- package/es/Tag/__tests__/Tag.spec.js +8 -1
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +40 -3
- package/es/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +4 -1
- package/es/utils/Common.js +1 -1
- package/lib/Button/__tests__/Button.spec.js +140 -0
- package/lib/DateTime/__tests__/YearView.spec.js +1 -2
- package/lib/MultiSelect/__tests__/AdvancedMultiSelect.spec.js +8 -0
- package/lib/Popup/Popup.js +16 -11
- package/lib/Provider/IdProvider.js +1 -0
- package/lib/Select/__tests__/Select.spec.js +1364 -3
- package/lib/Select/__tests__/__snapshots__/Select.spec.js.snap +9621 -1
- package/lib/Stencils/Stencils.js +5 -12
- package/lib/Stencils/Stencils.module.css +11 -7
- package/lib/Stencils/__tests__/Stencils.spec.js +11 -3
- package/lib/Stencils/__tests__/__snapshots__/Stencils.spec.js.snap +27 -11
- package/lib/Stencils/props/defaultProps.js +2 -1
- package/lib/Stencils/props/propTypes.js +3 -2
- package/lib/Tab/Tab.js +3 -1
- package/lib/Tab/TabWrapper.js +3 -1
- package/lib/Tab/Tabs.js +11 -10
- package/lib/Tab/__tests__/TabLayout.spec.js +41 -0
- package/lib/Tab/__tests__/__snapshots__/TabLayout.spec.js.snap +341 -0
- package/lib/Tab/props/propTypes.js +2 -2
- package/lib/Tab/utils/tabConfigs.js +27 -0
- package/lib/Tag/__tests__/Tag.spec.js +10 -2
- package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +80 -26
- package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +4 -1
- package/lib/utils/Common.js +1 -1
- package/package.json +3 -3
- package/react-cli.config.js +2 -2
- package/result.json +1 -1
- package/es/DateTime/__tests__/__snapshots__/YearView.spec.js.snap +0 -61
- package/lib/DateTime/__tests__/__snapshots__/YearView.spec.js.snap +0 -61
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`TabWrapper rendering the align prop of - horizontal 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<div
|
|
6
|
+
class="flex cover rowdir"
|
|
7
|
+
data-id="containerComponent"
|
|
8
|
+
data-selector-id="tabWrapper"
|
|
9
|
+
data-test-id="containerComponent"
|
|
10
|
+
>
|
|
11
|
+
<div
|
|
12
|
+
class="shrinkOff"
|
|
13
|
+
data-id="boxComponent"
|
|
14
|
+
data-selector-id="tabs"
|
|
15
|
+
data-test-id="boxComponent"
|
|
16
|
+
>
|
|
17
|
+
<div
|
|
18
|
+
class="tab alpha alpha_border alpha_padding flex cover coldir"
|
|
19
|
+
data-id="containerComponent"
|
|
20
|
+
data-selector-id="container"
|
|
21
|
+
data-test-id="containerComponent"
|
|
22
|
+
>
|
|
23
|
+
<div
|
|
24
|
+
class="grow basis shrinkOff"
|
|
25
|
+
data-id="boxComponent"
|
|
26
|
+
data-selector-id="box"
|
|
27
|
+
data-test-id="boxComponent"
|
|
28
|
+
>
|
|
29
|
+
<div
|
|
30
|
+
class="flex cover coldir"
|
|
31
|
+
data-id="containerComponent"
|
|
32
|
+
data-selector-id="container"
|
|
33
|
+
data-test-id="containerComponent"
|
|
34
|
+
>
|
|
35
|
+
<div
|
|
36
|
+
class="menu shrinkOff"
|
|
37
|
+
data-id="boxComponent"
|
|
38
|
+
data-selector-id="tabs_moreIcon"
|
|
39
|
+
data-test-id="boxComponent"
|
|
40
|
+
>
|
|
41
|
+
<button
|
|
42
|
+
aria-label="MoreTabs"
|
|
43
|
+
class="buttonReset flex cover coldir both"
|
|
44
|
+
data-id="moreTabs"
|
|
45
|
+
data-selector-id="container"
|
|
46
|
+
data-test-id="moreTabs"
|
|
47
|
+
role="link"
|
|
48
|
+
>
|
|
49
|
+
<i
|
|
50
|
+
aria-hidden="true"
|
|
51
|
+
class="zd_font_icons basic icon-menu rtl "
|
|
52
|
+
data-id="fontIcon"
|
|
53
|
+
data-selector-id="fontIcon"
|
|
54
|
+
data-test-id="fontIcon"
|
|
55
|
+
style="--zd-iconfont-size: var(--zd_font_size7);"
|
|
56
|
+
/>
|
|
57
|
+
</button>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
<div
|
|
64
|
+
class="grow basis shrinkOff"
|
|
65
|
+
data-id="boxComponent"
|
|
66
|
+
data-selector-id="tabContentWrapper"
|
|
67
|
+
data-test-id="boxComponent"
|
|
68
|
+
>
|
|
69
|
+
<div
|
|
70
|
+
aria-labelledby="page1"
|
|
71
|
+
class="container flex cover coldir"
|
|
72
|
+
data-id="tabContent_TabContent"
|
|
73
|
+
data-scroll="true"
|
|
74
|
+
data-selector-id="tabContent"
|
|
75
|
+
data-test-id="tabContent_TabContent"
|
|
76
|
+
role="tabpanel"
|
|
77
|
+
tabindex="-1"
|
|
78
|
+
>
|
|
79
|
+
<div>
|
|
80
|
+
Page 1 Content
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</DocumentFragment>
|
|
86
|
+
`;
|
|
87
|
+
|
|
88
|
+
exports[`TabWrapper rendering the align prop of - horizontal-reverse 1`] = `
|
|
89
|
+
<DocumentFragment>
|
|
90
|
+
<div
|
|
91
|
+
class="flex cover rowReverse"
|
|
92
|
+
data-id="containerComponent"
|
|
93
|
+
data-selector-id="tabWrapper"
|
|
94
|
+
data-test-id="containerComponent"
|
|
95
|
+
>
|
|
96
|
+
<div
|
|
97
|
+
class="shrinkOff"
|
|
98
|
+
data-id="boxComponent"
|
|
99
|
+
data-selector-id="tabs"
|
|
100
|
+
data-test-id="boxComponent"
|
|
101
|
+
>
|
|
102
|
+
<div
|
|
103
|
+
class="tab alpha alpha_border alpha_padding flex cover coldir"
|
|
104
|
+
data-id="containerComponent"
|
|
105
|
+
data-selector-id="container"
|
|
106
|
+
data-test-id="containerComponent"
|
|
107
|
+
>
|
|
108
|
+
<div
|
|
109
|
+
class="grow basis shrinkOff"
|
|
110
|
+
data-id="boxComponent"
|
|
111
|
+
data-selector-id="box"
|
|
112
|
+
data-test-id="boxComponent"
|
|
113
|
+
>
|
|
114
|
+
<div
|
|
115
|
+
class="flex cover coldir"
|
|
116
|
+
data-id="containerComponent"
|
|
117
|
+
data-selector-id="container"
|
|
118
|
+
data-test-id="containerComponent"
|
|
119
|
+
>
|
|
120
|
+
<div
|
|
121
|
+
class="menu shrinkOff"
|
|
122
|
+
data-id="boxComponent"
|
|
123
|
+
data-selector-id="tabs_moreIcon"
|
|
124
|
+
data-test-id="boxComponent"
|
|
125
|
+
>
|
|
126
|
+
<button
|
|
127
|
+
aria-label="MoreTabs"
|
|
128
|
+
class="buttonReset flex cover coldir both"
|
|
129
|
+
data-id="moreTabs"
|
|
130
|
+
data-selector-id="container"
|
|
131
|
+
data-test-id="moreTabs"
|
|
132
|
+
role="link"
|
|
133
|
+
>
|
|
134
|
+
<i
|
|
135
|
+
aria-hidden="true"
|
|
136
|
+
class="zd_font_icons basic icon-menu rtl "
|
|
137
|
+
data-id="fontIcon"
|
|
138
|
+
data-selector-id="fontIcon"
|
|
139
|
+
data-test-id="fontIcon"
|
|
140
|
+
style="--zd-iconfont-size: var(--zd_font_size7);"
|
|
141
|
+
/>
|
|
142
|
+
</button>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
<div
|
|
149
|
+
class="grow basis shrinkOff"
|
|
150
|
+
data-id="boxComponent"
|
|
151
|
+
data-selector-id="tabContentWrapper"
|
|
152
|
+
data-test-id="boxComponent"
|
|
153
|
+
>
|
|
154
|
+
<div
|
|
155
|
+
aria-labelledby="page1"
|
|
156
|
+
class="container flex cover coldir"
|
|
157
|
+
data-id="tabContent_TabContent"
|
|
158
|
+
data-scroll="true"
|
|
159
|
+
data-selector-id="tabContent"
|
|
160
|
+
data-test-id="tabContent_TabContent"
|
|
161
|
+
role="tabpanel"
|
|
162
|
+
tabindex="-1"
|
|
163
|
+
>
|
|
164
|
+
<div>
|
|
165
|
+
Page 1 Content
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
</DocumentFragment>
|
|
171
|
+
`;
|
|
172
|
+
|
|
173
|
+
exports[`TabWrapper rendering the align prop of - vertical 1`] = `
|
|
174
|
+
<DocumentFragment>
|
|
175
|
+
<div
|
|
176
|
+
class="flex cover coldir"
|
|
177
|
+
data-id="containerComponent"
|
|
178
|
+
data-selector-id="tabWrapper"
|
|
179
|
+
data-test-id="containerComponent"
|
|
180
|
+
>
|
|
181
|
+
<div
|
|
182
|
+
class="shrinkOff"
|
|
183
|
+
data-id="boxComponent"
|
|
184
|
+
data-selector-id="tabs"
|
|
185
|
+
data-test-id="boxComponent"
|
|
186
|
+
>
|
|
187
|
+
<div
|
|
188
|
+
class="tab alpha alpha_border alpha_padding flex cover rowdir"
|
|
189
|
+
data-id="containerComponent"
|
|
190
|
+
data-selector-id="container"
|
|
191
|
+
data-test-id="containerComponent"
|
|
192
|
+
>
|
|
193
|
+
<div
|
|
194
|
+
class="grow basis shrinkOff"
|
|
195
|
+
data-id="boxComponent"
|
|
196
|
+
data-selector-id="box"
|
|
197
|
+
data-test-id="boxComponent"
|
|
198
|
+
>
|
|
199
|
+
<div
|
|
200
|
+
class="flex cover rowdir"
|
|
201
|
+
data-id="containerComponent"
|
|
202
|
+
data-selector-id="container"
|
|
203
|
+
data-test-id="containerComponent"
|
|
204
|
+
>
|
|
205
|
+
<div
|
|
206
|
+
class="menu shrinkOff"
|
|
207
|
+
data-id="boxComponent"
|
|
208
|
+
data-selector-id="tabs_moreIcon"
|
|
209
|
+
data-test-id="boxComponent"
|
|
210
|
+
>
|
|
211
|
+
<button
|
|
212
|
+
aria-label="MoreTabs"
|
|
213
|
+
class="buttonReset flex cover coldir both"
|
|
214
|
+
data-id="moreTabs"
|
|
215
|
+
data-selector-id="container"
|
|
216
|
+
data-test-id="moreTabs"
|
|
217
|
+
role="link"
|
|
218
|
+
>
|
|
219
|
+
<i
|
|
220
|
+
aria-hidden="true"
|
|
221
|
+
class="zd_font_icons basic icon-menu rtl "
|
|
222
|
+
data-id="fontIcon"
|
|
223
|
+
data-selector-id="fontIcon"
|
|
224
|
+
data-test-id="fontIcon"
|
|
225
|
+
style="--zd-iconfont-size: var(--zd_font_size7);"
|
|
226
|
+
/>
|
|
227
|
+
</button>
|
|
228
|
+
</div>
|
|
229
|
+
</div>
|
|
230
|
+
</div>
|
|
231
|
+
</div>
|
|
232
|
+
</div>
|
|
233
|
+
<div
|
|
234
|
+
class="grow basis shrinkOff"
|
|
235
|
+
data-id="boxComponent"
|
|
236
|
+
data-selector-id="tabContentWrapper"
|
|
237
|
+
data-test-id="boxComponent"
|
|
238
|
+
>
|
|
239
|
+
<div
|
|
240
|
+
aria-labelledby="page1"
|
|
241
|
+
class="container flex cover coldir"
|
|
242
|
+
data-id="tabContent_TabContent"
|
|
243
|
+
data-scroll="true"
|
|
244
|
+
data-selector-id="tabContent"
|
|
245
|
+
data-test-id="tabContent_TabContent"
|
|
246
|
+
role="tabpanel"
|
|
247
|
+
tabindex="-1"
|
|
248
|
+
>
|
|
249
|
+
<div>
|
|
250
|
+
Page 1 Content
|
|
251
|
+
</div>
|
|
252
|
+
</div>
|
|
253
|
+
</div>
|
|
254
|
+
</div>
|
|
255
|
+
</DocumentFragment>
|
|
256
|
+
`;
|
|
257
|
+
|
|
258
|
+
exports[`TabWrapper rendering the align prop of - vertical-reverse 1`] = `
|
|
259
|
+
<DocumentFragment>
|
|
260
|
+
<div
|
|
261
|
+
class="flex cover colReverse"
|
|
262
|
+
data-id="containerComponent"
|
|
263
|
+
data-selector-id="tabWrapper"
|
|
264
|
+
data-test-id="containerComponent"
|
|
265
|
+
>
|
|
266
|
+
<div
|
|
267
|
+
class="shrinkOff"
|
|
268
|
+
data-id="boxComponent"
|
|
269
|
+
data-selector-id="tabs"
|
|
270
|
+
data-test-id="boxComponent"
|
|
271
|
+
>
|
|
272
|
+
<div
|
|
273
|
+
class="tab alpha alpha_border alpha_padding flex cover rowdir"
|
|
274
|
+
data-id="containerComponent"
|
|
275
|
+
data-selector-id="container"
|
|
276
|
+
data-test-id="containerComponent"
|
|
277
|
+
>
|
|
278
|
+
<div
|
|
279
|
+
class="grow basis shrinkOff"
|
|
280
|
+
data-id="boxComponent"
|
|
281
|
+
data-selector-id="box"
|
|
282
|
+
data-test-id="boxComponent"
|
|
283
|
+
>
|
|
284
|
+
<div
|
|
285
|
+
class="flex cover rowdir"
|
|
286
|
+
data-id="containerComponent"
|
|
287
|
+
data-selector-id="container"
|
|
288
|
+
data-test-id="containerComponent"
|
|
289
|
+
>
|
|
290
|
+
<div
|
|
291
|
+
class="menu shrinkOff"
|
|
292
|
+
data-id="boxComponent"
|
|
293
|
+
data-selector-id="tabs_moreIcon"
|
|
294
|
+
data-test-id="boxComponent"
|
|
295
|
+
>
|
|
296
|
+
<button
|
|
297
|
+
aria-label="MoreTabs"
|
|
298
|
+
class="buttonReset flex cover coldir both"
|
|
299
|
+
data-id="moreTabs"
|
|
300
|
+
data-selector-id="container"
|
|
301
|
+
data-test-id="moreTabs"
|
|
302
|
+
role="link"
|
|
303
|
+
>
|
|
304
|
+
<i
|
|
305
|
+
aria-hidden="true"
|
|
306
|
+
class="zd_font_icons basic icon-menu rtl "
|
|
307
|
+
data-id="fontIcon"
|
|
308
|
+
data-selector-id="fontIcon"
|
|
309
|
+
data-test-id="fontIcon"
|
|
310
|
+
style="--zd-iconfont-size: var(--zd_font_size7);"
|
|
311
|
+
/>
|
|
312
|
+
</button>
|
|
313
|
+
</div>
|
|
314
|
+
</div>
|
|
315
|
+
</div>
|
|
316
|
+
</div>
|
|
317
|
+
</div>
|
|
318
|
+
<div
|
|
319
|
+
class="grow basis shrinkOff"
|
|
320
|
+
data-id="boxComponent"
|
|
321
|
+
data-selector-id="tabContentWrapper"
|
|
322
|
+
data-test-id="boxComponent"
|
|
323
|
+
>
|
|
324
|
+
<div
|
|
325
|
+
aria-labelledby="page1"
|
|
326
|
+
class="container flex cover coldir"
|
|
327
|
+
data-id="tabContent_TabContent"
|
|
328
|
+
data-scroll="true"
|
|
329
|
+
data-selector-id="tabContent"
|
|
330
|
+
data-test-id="tabContent_TabContent"
|
|
331
|
+
role="tabpanel"
|
|
332
|
+
tabindex="-1"
|
|
333
|
+
>
|
|
334
|
+
<div>
|
|
335
|
+
Page 1 Content
|
|
336
|
+
</div>
|
|
337
|
+
</div>
|
|
338
|
+
</div>
|
|
339
|
+
</div>
|
|
340
|
+
</DocumentFragment>
|
|
341
|
+
`;
|
|
@@ -11,7 +11,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
11
11
|
|
|
12
12
|
var Tab_propTypes = {
|
|
13
13
|
activeClass: _propTypes["default"].string,
|
|
14
|
-
align: _propTypes["default"].
|
|
14
|
+
align: _propTypes["default"].oneOf(['vertical', 'horizontal']),
|
|
15
15
|
children: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].string]),
|
|
16
16
|
className: _propTypes["default"].string,
|
|
17
17
|
dataId: _propTypes["default"].string,
|
|
@@ -115,7 +115,7 @@ var Tabs_propTypes = {
|
|
|
115
115
|
};
|
|
116
116
|
exports.Tabs_propTypes = Tabs_propTypes;
|
|
117
117
|
var TabWrapper_propTypes = {
|
|
118
|
-
align: _propTypes["default"].oneOf(['vertical', 'horizontal']),
|
|
118
|
+
align: _propTypes["default"].oneOf(['vertical', 'horizontal', 'vertical-reverse', 'horizontal-reverse']),
|
|
119
119
|
children: _propTypes["default"].node,
|
|
120
120
|
dataId: _propTypes["default"].string,
|
|
121
121
|
defaultTab: _propTypes["default"].string,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TAB_POPUP_POSITION_MAPPING = exports.TAB_DIRECTION_MAPPING = exports.TAB_ALIGN_MAPPING = void 0;
|
|
7
|
+
var TAB_ALIGN_MAPPING = {
|
|
8
|
+
vertical: 'column',
|
|
9
|
+
horizontal: 'row',
|
|
10
|
+
'vertical-reverse': 'column-reverse',
|
|
11
|
+
'horizontal-reverse': 'row-reverse'
|
|
12
|
+
};
|
|
13
|
+
exports.TAB_ALIGN_MAPPING = TAB_ALIGN_MAPPING;
|
|
14
|
+
var TAB_DIRECTION_MAPPING = {
|
|
15
|
+
vertical: 'column',
|
|
16
|
+
horizontal: 'row',
|
|
17
|
+
'vertical-reverse': 'column',
|
|
18
|
+
'horizontal-reverse': 'row'
|
|
19
|
+
};
|
|
20
|
+
exports.TAB_DIRECTION_MAPPING = TAB_DIRECTION_MAPPING;
|
|
21
|
+
var TAB_POPUP_POSITION_MAPPING = {
|
|
22
|
+
vertical: 'bottomLeft',
|
|
23
|
+
horizontal: 'rightTop',
|
|
24
|
+
'vertical-reverse': 'topLeft',
|
|
25
|
+
'horizontal-reverse': 'leftTop'
|
|
26
|
+
};
|
|
27
|
+
exports.TAB_POPUP_POSITION_MAPPING = TAB_POPUP_POSITION_MAPPING;
|
|
@@ -2,12 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
var _react = _interopRequireDefault(require("react"));
|
|
4
4
|
|
|
5
|
-
var _Tag = _interopRequireDefault(require("../Tag"));
|
|
6
|
-
|
|
7
5
|
var _react2 = require("@testing-library/react");
|
|
8
6
|
|
|
7
|
+
var _IdProvider = require("../../Provider/IdProvider");
|
|
8
|
+
|
|
9
|
+
var _Tag = _interopRequireDefault(require("../Tag"));
|
|
10
|
+
|
|
9
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
10
12
|
|
|
13
|
+
beforeEach(function () {
|
|
14
|
+
(0, _IdProvider.setGlobalId)(0);
|
|
15
|
+
});
|
|
16
|
+
afterEach(function () {
|
|
17
|
+
(0, _react2.cleanup)();
|
|
18
|
+
});
|
|
11
19
|
describe('Tag component', function () {
|
|
12
20
|
var size = ['small', 'medium'];
|
|
13
21
|
var palette = ['default', 'danger', 'secondary', 'pureDotted', 'primaryDotted', 'dark', 'pureDarkDotted', 'darkPrimaryDotted', 'defaultLink'];
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
@@ -29,6 +27,20 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
29
27
|
|
|
30
28
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
31
29
|
|
|
30
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
31
|
+
|
|
32
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
33
|
+
|
|
34
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
35
|
+
|
|
36
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
37
|
+
|
|
38
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
39
|
+
|
|
40
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
41
|
+
|
|
42
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
43
|
+
|
|
32
44
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
33
45
|
|
|
34
46
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
@@ -63,35 +75,75 @@ var VelocityAnimationGroup = /*#__PURE__*/function (_React$Component) {
|
|
|
63
75
|
var _super = _createSuper(VelocityAnimationGroup);
|
|
64
76
|
|
|
65
77
|
function VelocityAnimationGroup(props) {
|
|
78
|
+
var _this;
|
|
79
|
+
|
|
66
80
|
_classCallCheck(this, VelocityAnimationGroup);
|
|
67
81
|
|
|
68
|
-
|
|
82
|
+
_this = _super.call(this, props);
|
|
83
|
+
_this.handleEnterComplete = _this.handleEnterComplete.bind(_assertThisInitialized(_this));
|
|
84
|
+
_this.handleExitComplete = _this.handleExitComplete.bind(_assertThisInitialized(_this));
|
|
85
|
+
return _this;
|
|
69
86
|
}
|
|
70
87
|
|
|
71
88
|
_createClass(VelocityAnimationGroup, [{
|
|
89
|
+
key: "handleEnterComplete",
|
|
90
|
+
value: function handleEnterComplete(elements) {
|
|
91
|
+
var _this$props = this.props,
|
|
92
|
+
onEnterComplete = _this$props.onEnterComplete,
|
|
93
|
+
postEnterStyles = _this$props.postEnterStyles;
|
|
94
|
+
|
|
95
|
+
if (typeof onEnterComplete === 'function') {
|
|
96
|
+
onEnterComplete(elements);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (postEnterStyles && _typeof(postEnterStyles) === 'object') {
|
|
100
|
+
elements.forEach(function (rootElement) {
|
|
101
|
+
Object.entries(postEnterStyles).forEach(function (_ref) {
|
|
102
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
103
|
+
cssProperty = _ref2[0],
|
|
104
|
+
cssValue = _ref2[1];
|
|
105
|
+
|
|
106
|
+
rootElement.style[cssProperty] = cssValue;
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}, {
|
|
112
|
+
key: "handleExitComplete",
|
|
113
|
+
value: function handleExitComplete(elements) {
|
|
114
|
+
var onExitComplete = this.props.onExitComplete;
|
|
115
|
+
|
|
116
|
+
if (typeof onExitComplete === 'function') {
|
|
117
|
+
onExitComplete(elements);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}, {
|
|
72
121
|
key: "render",
|
|
73
122
|
value: function render() {
|
|
74
|
-
var _this$
|
|
75
|
-
children = _this$
|
|
76
|
-
enterName = _this$
|
|
77
|
-
exitName = _this$
|
|
78
|
-
enterDuration = _this$
|
|
79
|
-
exitDuration = _this$
|
|
80
|
-
isActive = _this$
|
|
81
|
-
component = _this$
|
|
82
|
-
runOnMount = _this$
|
|
83
|
-
enterShowStyle = _this$
|
|
84
|
-
enterHideStyle = _this$
|
|
85
|
-
exitDelay = _this$
|
|
86
|
-
isFlex = _this$
|
|
87
|
-
enterDelay = _this$
|
|
88
|
-
isCustomized = _this$
|
|
89
|
-
name = _this$
|
|
90
|
-
needUIPack = _this$
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
123
|
+
var _this$props2 = this.props,
|
|
124
|
+
children = _this$props2.children,
|
|
125
|
+
enterName = _this$props2.enterName,
|
|
126
|
+
exitName = _this$props2.exitName,
|
|
127
|
+
enterDuration = _this$props2.enterDuration,
|
|
128
|
+
exitDuration = _this$props2.exitDuration,
|
|
129
|
+
isActive = _this$props2.isActive,
|
|
130
|
+
component = _this$props2.component,
|
|
131
|
+
runOnMount = _this$props2.runOnMount,
|
|
132
|
+
enterShowStyle = _this$props2.enterShowStyle,
|
|
133
|
+
enterHideStyle = _this$props2.enterHideStyle,
|
|
134
|
+
exitDelay = _this$props2.exitDelay,
|
|
135
|
+
isFlex = _this$props2.isFlex,
|
|
136
|
+
enterDelay = _this$props2.enterDelay,
|
|
137
|
+
isCustomized = _this$props2.isCustomized,
|
|
138
|
+
name = _this$props2.name,
|
|
139
|
+
needUIPack = _this$props2.needUIPack,
|
|
140
|
+
onEnterComplete = _this$props2.onEnterComplete,
|
|
141
|
+
onExitComplete = _this$props2.onExitComplete,
|
|
142
|
+
postEnterStyles = _this$props2.postEnterStyles;
|
|
143
|
+
|
|
144
|
+
var _ref3 = this.context || {},
|
|
145
|
+
direction = _ref3.direction,
|
|
146
|
+
isReducedMotion = _ref3.isReducedMotion;
|
|
95
147
|
|
|
96
148
|
var childProps = clearProps(this.props);
|
|
97
149
|
var enterAnimationObj = {
|
|
@@ -128,13 +180,15 @@ var VelocityAnimationGroup = /*#__PURE__*/function (_React$Component) {
|
|
|
128
180
|
animation: isCustomized ? enterAnimationObj[name] : needUIPack ? "transition.".concat(enterName, "In") : enterName,
|
|
129
181
|
duration: !isReducedMotion ? enterDuration : 0,
|
|
130
182
|
delay: enterDelay ? enterDelay : 0,
|
|
131
|
-
display: isFlex ? 'flex' : ''
|
|
183
|
+
display: isFlex ? 'flex' : '',
|
|
184
|
+
complete: onEnterComplete || postEnterStyles ? this.handleEnterComplete : undefined
|
|
132
185
|
};
|
|
133
186
|
var exitAnimation = {
|
|
134
187
|
animation: isCustomized ? exitAnimationObj[name] : needUIPack ? "transition.".concat(exitName ? exitName : enterName, "Out") : exitName ? exitName : enterName,
|
|
135
188
|
duration: !isReducedMotion ? exitDuration : 0,
|
|
136
189
|
delay: exitDelay ? exitDelay : 0,
|
|
137
|
-
display: 'none'
|
|
190
|
+
display: 'none',
|
|
191
|
+
complete: onExitComplete ? this.handleExitComplete : undefined
|
|
138
192
|
};
|
|
139
193
|
return /*#__PURE__*/_react["default"].createElement(_velocityReact.VelocityTransitionGroup, _extends({
|
|
140
194
|
enter: enterAnimation,
|
|
@@ -25,6 +25,9 @@ var propTypes = {
|
|
|
25
25
|
isFlex: _propTypes["default"].bool,
|
|
26
26
|
name: _propTypes["default"].oneOf(['fade', 'slideDown', 'flyDown', 'slideRight', 'shrink', 'expand', 'slideLeft']),
|
|
27
27
|
needUIPack: _propTypes["default"].bool,
|
|
28
|
-
runOnMount: _propTypes["default"].bool
|
|
28
|
+
runOnMount: _propTypes["default"].bool,
|
|
29
|
+
onEnterComplete: _propTypes["default"].func,
|
|
30
|
+
onExitComplete: _propTypes["default"].func,
|
|
31
|
+
postEnterStyles: _propTypes["default"].object
|
|
29
32
|
};
|
|
30
33
|
exports.propTypes = propTypes;
|
package/lib/utils/Common.js
CHANGED
|
@@ -61,7 +61,7 @@ exports.parseDecimal = parseDecimal;
|
|
|
61
61
|
|
|
62
62
|
var getTotalDimension = function getTotalDimension(elem, align) {
|
|
63
63
|
var style = window.getComputedStyle(elem);
|
|
64
|
-
return align === 'vertical' ? elem.offsetWidth + parseDecimal(style.marginLeft) + parseDecimal(style.marginRight) : elem.offsetHeight + parseDecimal(style.marginTop) + parseDecimal(style.marginBottom);
|
|
64
|
+
return align === 'vertical-reverse' || align === 'vertical' ? elem.offsetWidth + parseDecimal(style.marginLeft) + parseDecimal(style.marginRight) : elem.offsetHeight + parseDecimal(style.marginTop) + parseDecimal(style.marginBottom);
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
exports.getTotalDimension = getTotalDimension;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"main": "es/index.js",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"private": false,
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@zohodesk/a11y": "2.3.4",
|
|
72
72
|
"@zohodesk/docstool": "1.0.0-alpha-2",
|
|
73
73
|
"@zohodesk/hooks": "2.0.5",
|
|
74
|
-
"@zohodesk/icons": "1.0.
|
|
74
|
+
"@zohodesk/icons": "1.0.78",
|
|
75
75
|
"@zohodesk/svg": "1.1.22",
|
|
76
76
|
"@zohodesk/utils": "1.3.14",
|
|
77
77
|
"@zohodesk/variables": "1.0.0",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"selectn": "1.1.2"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
|
-
"@zohodesk/icons": "1.0.
|
|
89
|
+
"@zohodesk/icons": "1.0.78",
|
|
90
90
|
"@zohodesk/variables": "1.0.0",
|
|
91
91
|
"@zohodesk/svg": "1.1.22",
|
|
92
92
|
"@zohodesk/virtualizer": "1.0.3",
|
package/react-cli.config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
exports.config= {
|
|
1
|
+
exports.config = {
|
|
2
2
|
"preprocess": {
|
|
3
3
|
"runner": "./preprocess/index.js"
|
|
4
4
|
},
|
|
@@ -14,7 +14,7 @@ exports.config= {
|
|
|
14
14
|
"**/es/**",
|
|
15
15
|
"!**/node_modules/**"
|
|
16
16
|
],
|
|
17
|
-
"hasRTL":[
|
|
17
|
+
"hasRTL": [
|
|
18
18
|
"**/src/**",
|
|
19
19
|
"!**/node_modules/**"
|
|
20
20
|
]
|