@zohodesk/components 1.0.0-temp-255 → 1.0.0-temp-256
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/README.md +20 -3
- package/assets/Appearance/dark/mode/Component_DarkMode.module.css +4 -4
- package/assets/Appearance/dark/themes/blue/blue_componentsCTA_DarkModifyCategory.module.css +14 -0
- package/assets/Appearance/dark/themes/green/green_componentsCTA_DarkModifyCategory.module.css +14 -0
- package/assets/Appearance/dark/themes/orange/orange_componentsCTA_DarkModifyCategory.module.css +14 -0
- package/assets/Appearance/dark/themes/red/red_componentsCTA_DarkModifyCategory.module.css +14 -0
- package/assets/Appearance/dark/themes/yellow/yellow_componentsCTA_DarkModifyCategory.module.css +14 -0
- package/assets/Appearance/light/mode/Component_LightMode.module.css +6 -6
- package/assets/Appearance/light/themes/blue/blue_componentsCTA_LightModifyCategory.module.css +14 -0
- package/assets/Appearance/light/themes/green/green_componentsCTA_LightModifyCategory.module.css +14 -0
- package/assets/Appearance/light/themes/orange/orange_componentsCTA_LightModifyCategory.module.css +14 -0
- package/assets/Appearance/light/themes/red/red_componentsCTA_LightModifyCategory.module.css +14 -0
- package/assets/Appearance/light/themes/yellow/yellow_componentsCTA_LightModifyCategory.module.css +14 -0
- package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +3 -3
- package/assets/Appearance/pureDark/themes/blue/blue_componentsCTA_PureDarkModifyCategory.module.css +14 -0
- package/assets/Appearance/pureDark/themes/green/green_componentsCTA_PureDarkModifyCategory.module.css +14 -0
- package/assets/Appearance/pureDark/themes/orange/orange_componentsCTA_PureDarkModifyCategory.module.css +14 -0
- package/assets/Appearance/pureDark/themes/red/red_componentsCTA_PureDarkModifyCategory.module.css +14 -0
- package/assets/Appearance/pureDark/themes/yellow/yellow_componentsCTA_PureDarkModifyCategory.module.css +14 -0
- package/cbt.config.js +12 -3
- package/es/AppContainer/AppContainer.js +2 -0
- package/es/DateTime/DateWidget.js +32 -6
- package/es/Provider/LibraryContext.js +5 -1
- package/es/Select/Select.js +3 -1
- package/es/Tab/Tab.js +62 -11
- package/es/Tab/Tab.module.css +25 -0
- package/es/Tab/Tabs.js +37 -6
- package/es/Tab/Tabs.module.css +48 -3
- package/es/Tab/__tests__/Tab.spec.js +112 -0
- package/es/Tab/__tests__/__snapshots__/Tab.spec.js.snap +316 -0
- package/es/Tab/props/defaultProps.js +3 -2
- package/es/Tab/props/propTypes.js +12 -3
- package/es/Tab/utils/tabConfigs.js +5 -0
- package/es/utils/datetime/common.js +10 -3
- package/lib/AppContainer/AppContainer.js +4 -0
- package/lib/DateTime/DateWidget.js +33 -6
- package/lib/Provider/LibraryContext.js +5 -1
- package/lib/Select/Select.js +3 -1
- package/lib/Tab/Tab.js +62 -9
- package/lib/Tab/Tab.module.css +25 -0
- package/lib/Tab/Tabs.js +34 -3
- package/lib/Tab/Tabs.module.css +48 -3
- package/lib/Tab/__tests__/Tab.spec.js +115 -0
- package/lib/Tab/__tests__/__snapshots__/Tab.spec.js.snap +316 -0
- package/lib/Tab/props/defaultProps.js +3 -2
- package/lib/Tab/props/propTypes.js +14 -3
- package/lib/Tab/utils/tabConfigs.js +7 -1
- package/lib/utils/datetime/common.js +10 -2
- package/package.json +11 -10
|
@@ -1,5 +1,152 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
+
exports[`Tab renderBefore / renderAfter slots renderAfter renders a node to the right of the label 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<div
|
|
6
|
+
aria-controls="t7"
|
|
7
|
+
aria-label="Home"
|
|
8
|
+
aria-selected="false"
|
|
9
|
+
class="tab horizontal basisAuto shrinkOff"
|
|
10
|
+
data-id="tabMenu_Tab"
|
|
11
|
+
data-key="t7"
|
|
12
|
+
data-selector-id="tab"
|
|
13
|
+
data-test-id="tabMenu_Tab"
|
|
14
|
+
role="link"
|
|
15
|
+
tabindex="0"
|
|
16
|
+
>
|
|
17
|
+
<div
|
|
18
|
+
class="textContainer flex cover rowdir both"
|
|
19
|
+
data-id="containerComponent"
|
|
20
|
+
data-selector-id="container"
|
|
21
|
+
data-test-id="containerComponent"
|
|
22
|
+
>
|
|
23
|
+
<div
|
|
24
|
+
class="tabText grow basisAuto shrinkOff"
|
|
25
|
+
data-id="boxComponent"
|
|
26
|
+
data-selector-id="box"
|
|
27
|
+
data-test-id="boxComponent"
|
|
28
|
+
>
|
|
29
|
+
Home
|
|
30
|
+
</div>
|
|
31
|
+
<span>
|
|
32
|
+
3
|
|
33
|
+
</span>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</DocumentFragment>
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
exports[`Tab renderBefore / renderAfter slots renderBefore and renderAfter both render around the label 1`] = `
|
|
40
|
+
<DocumentFragment>
|
|
41
|
+
<div
|
|
42
|
+
aria-controls="t8"
|
|
43
|
+
aria-label="Home"
|
|
44
|
+
aria-selected="false"
|
|
45
|
+
class="tab horizontal basisAuto shrinkOff"
|
|
46
|
+
data-id="tabMenu_Tab"
|
|
47
|
+
data-key="t8"
|
|
48
|
+
data-selector-id="tab"
|
|
49
|
+
data-test-id="tabMenu_Tab"
|
|
50
|
+
role="link"
|
|
51
|
+
tabindex="0"
|
|
52
|
+
>
|
|
53
|
+
<div
|
|
54
|
+
class="textContainer flex cover rowdir both"
|
|
55
|
+
data-id="containerComponent"
|
|
56
|
+
data-selector-id="container"
|
|
57
|
+
data-test-id="containerComponent"
|
|
58
|
+
>
|
|
59
|
+
<span>
|
|
60
|
+
◀
|
|
61
|
+
</span>
|
|
62
|
+
<div
|
|
63
|
+
class="tabText grow basisAuto shrinkOff"
|
|
64
|
+
data-id="boxComponent"
|
|
65
|
+
data-selector-id="box"
|
|
66
|
+
data-test-id="boxComponent"
|
|
67
|
+
>
|
|
68
|
+
Home
|
|
69
|
+
</div>
|
|
70
|
+
<span>
|
|
71
|
+
▶
|
|
72
|
+
</span>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</DocumentFragment>
|
|
76
|
+
`;
|
|
77
|
+
|
|
78
|
+
exports[`Tab renderBefore / renderAfter slots renderBefore as function renders custom node 1`] = `
|
|
79
|
+
<DocumentFragment>
|
|
80
|
+
<div
|
|
81
|
+
aria-controls="t9"
|
|
82
|
+
aria-label="Home"
|
|
83
|
+
aria-selected="false"
|
|
84
|
+
class="tab horizontal basisAuto shrinkOff"
|
|
85
|
+
data-id="tabMenu_Tab"
|
|
86
|
+
data-key="t9"
|
|
87
|
+
data-selector-id="tab"
|
|
88
|
+
data-test-id="tabMenu_Tab"
|
|
89
|
+
role="link"
|
|
90
|
+
tabindex="0"
|
|
91
|
+
>
|
|
92
|
+
<div
|
|
93
|
+
class="textContainer flex cover rowdir both"
|
|
94
|
+
data-id="containerComponent"
|
|
95
|
+
data-selector-id="container"
|
|
96
|
+
data-test-id="containerComponent"
|
|
97
|
+
>
|
|
98
|
+
<span>
|
|
99
|
+
◀
|
|
100
|
+
</span>
|
|
101
|
+
<div
|
|
102
|
+
class="tabText grow basisAuto shrinkOff"
|
|
103
|
+
data-id="boxComponent"
|
|
104
|
+
data-selector-id="box"
|
|
105
|
+
data-test-id="boxComponent"
|
|
106
|
+
>
|
|
107
|
+
Home
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</DocumentFragment>
|
|
112
|
+
`;
|
|
113
|
+
|
|
114
|
+
exports[`Tab renderBefore / renderAfter slots renderBefore renders a node to the left of the label 1`] = `
|
|
115
|
+
<DocumentFragment>
|
|
116
|
+
<div
|
|
117
|
+
aria-controls="t6"
|
|
118
|
+
aria-label="Home"
|
|
119
|
+
aria-selected="false"
|
|
120
|
+
class="tab horizontal basisAuto shrinkOff"
|
|
121
|
+
data-id="tabMenu_Tab"
|
|
122
|
+
data-key="t6"
|
|
123
|
+
data-selector-id="tab"
|
|
124
|
+
data-test-id="tabMenu_Tab"
|
|
125
|
+
role="link"
|
|
126
|
+
tabindex="0"
|
|
127
|
+
>
|
|
128
|
+
<div
|
|
129
|
+
class="textContainer flex cover rowdir both"
|
|
130
|
+
data-id="containerComponent"
|
|
131
|
+
data-selector-id="container"
|
|
132
|
+
data-test-id="containerComponent"
|
|
133
|
+
>
|
|
134
|
+
<span>
|
|
135
|
+
◀
|
|
136
|
+
</span>
|
|
137
|
+
<div
|
|
138
|
+
class="tabText grow basisAuto shrinkOff"
|
|
139
|
+
data-id="boxComponent"
|
|
140
|
+
data-selector-id="box"
|
|
141
|
+
data-test-id="boxComponent"
|
|
142
|
+
>
|
|
143
|
+
Home
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
</DocumentFragment>
|
|
148
|
+
`;
|
|
149
|
+
|
|
3
150
|
exports[`Tab rendering the defult props 1`] = `
|
|
4
151
|
<DocumentFragment>
|
|
5
152
|
<div
|
|
@@ -20,3 +167,172 @@ exports[`Tab rendering the defult props 1`] = `
|
|
|
20
167
|
</div>
|
|
21
168
|
</DocumentFragment>
|
|
22
169
|
`;
|
|
170
|
+
|
|
171
|
+
exports[`Tab variant-based label rendering renderIcon as function receives no args and renders custom node 1`] = `
|
|
172
|
+
<DocumentFragment>
|
|
173
|
+
<div
|
|
174
|
+
aria-controls="t5"
|
|
175
|
+
aria-label="Home"
|
|
176
|
+
aria-selected="false"
|
|
177
|
+
class="tab horizontal basisAuto shrinkOff"
|
|
178
|
+
data-id="tabMenu_Tab"
|
|
179
|
+
data-key="t5"
|
|
180
|
+
data-selector-id="tab"
|
|
181
|
+
data-test-id="tabMenu_Tab"
|
|
182
|
+
role="link"
|
|
183
|
+
tabindex="0"
|
|
184
|
+
>
|
|
185
|
+
<div
|
|
186
|
+
class="textContainer flex cover rowdir both"
|
|
187
|
+
data-id="containerComponent"
|
|
188
|
+
data-selector-id="container"
|
|
189
|
+
data-test-id="containerComponent"
|
|
190
|
+
>
|
|
191
|
+
<span>
|
|
192
|
+
★
|
|
193
|
+
</span>
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
</DocumentFragment>
|
|
197
|
+
`;
|
|
198
|
+
|
|
199
|
+
exports[`Tab variant-based label rendering renderIcon overrides iconName 1`] = `
|
|
200
|
+
<DocumentFragment>
|
|
201
|
+
<div
|
|
202
|
+
aria-controls="t4"
|
|
203
|
+
aria-label="Home"
|
|
204
|
+
aria-selected="false"
|
|
205
|
+
class="tab horizontal basisAuto shrinkOff"
|
|
206
|
+
data-id="tabMenu_Tab"
|
|
207
|
+
data-key="t4"
|
|
208
|
+
data-selector-id="tab"
|
|
209
|
+
data-test-id="tabMenu_Tab"
|
|
210
|
+
role="link"
|
|
211
|
+
tabindex="0"
|
|
212
|
+
>
|
|
213
|
+
<div
|
|
214
|
+
class="textContainer flex cover rowdir both"
|
|
215
|
+
data-id="containerComponent"
|
|
216
|
+
data-selector-id="container"
|
|
217
|
+
data-test-id="containerComponent"
|
|
218
|
+
>
|
|
219
|
+
<span>
|
|
220
|
+
★
|
|
221
|
+
</span>
|
|
222
|
+
<div
|
|
223
|
+
class="tabText grow basisAuto shrinkOff"
|
|
224
|
+
data-id="boxComponent"
|
|
225
|
+
data-selector-id="box"
|
|
226
|
+
data-test-id="boxComponent"
|
|
227
|
+
>
|
|
228
|
+
Home
|
|
229
|
+
</div>
|
|
230
|
+
</div>
|
|
231
|
+
</div>
|
|
232
|
+
</DocumentFragment>
|
|
233
|
+
`;
|
|
234
|
+
|
|
235
|
+
exports[`Tab variant-based label rendering variant="icon" renders icon and suppresses text label 1`] = `
|
|
236
|
+
<DocumentFragment>
|
|
237
|
+
<div
|
|
238
|
+
aria-controls="t2"
|
|
239
|
+
aria-label="Home"
|
|
240
|
+
aria-selected="false"
|
|
241
|
+
class="tab horizontal basisAuto shrinkOff"
|
|
242
|
+
data-id="tabMenu_Tab"
|
|
243
|
+
data-key="t2"
|
|
244
|
+
data-selector-id="tab"
|
|
245
|
+
data-test-id="tabMenu_Tab"
|
|
246
|
+
role="link"
|
|
247
|
+
tabindex="0"
|
|
248
|
+
>
|
|
249
|
+
<div
|
|
250
|
+
class="textContainer flex cover rowdir both"
|
|
251
|
+
data-id="containerComponent"
|
|
252
|
+
data-selector-id="container"
|
|
253
|
+
data-test-id="containerComponent"
|
|
254
|
+
>
|
|
255
|
+
<i
|
|
256
|
+
aria-hidden="true"
|
|
257
|
+
class="zd_font_icons basic icon-menu rtl "
|
|
258
|
+
data-id="fontIcon"
|
|
259
|
+
data-selector-id="fontIcon"
|
|
260
|
+
data-test-id="fontIcon"
|
|
261
|
+
/>
|
|
262
|
+
</div>
|
|
263
|
+
</div>
|
|
264
|
+
</DocumentFragment>
|
|
265
|
+
`;
|
|
266
|
+
|
|
267
|
+
exports[`Tab variant-based label rendering variant="iconWithText" renders icon followed by text 1`] = `
|
|
268
|
+
<DocumentFragment>
|
|
269
|
+
<div
|
|
270
|
+
aria-controls="t3"
|
|
271
|
+
aria-label="Home"
|
|
272
|
+
aria-selected="false"
|
|
273
|
+
class="tab horizontal basisAuto shrinkOff"
|
|
274
|
+
data-id="tabMenu_Tab"
|
|
275
|
+
data-key="t3"
|
|
276
|
+
data-selector-id="tab"
|
|
277
|
+
data-test-id="tabMenu_Tab"
|
|
278
|
+
role="link"
|
|
279
|
+
tabindex="0"
|
|
280
|
+
>
|
|
281
|
+
<div
|
|
282
|
+
class="textContainer flex cover rowdir both"
|
|
283
|
+
data-id="containerComponent"
|
|
284
|
+
data-selector-id="container"
|
|
285
|
+
data-test-id="containerComponent"
|
|
286
|
+
>
|
|
287
|
+
<i
|
|
288
|
+
aria-hidden="true"
|
|
289
|
+
class="zd_font_icons basic icon-menu rtl "
|
|
290
|
+
data-id="fontIcon"
|
|
291
|
+
data-selector-id="fontIcon"
|
|
292
|
+
data-test-id="fontIcon"
|
|
293
|
+
/>
|
|
294
|
+
<div
|
|
295
|
+
class="tabText grow basisAuto shrinkOff"
|
|
296
|
+
data-id="boxComponent"
|
|
297
|
+
data-selector-id="box"
|
|
298
|
+
data-test-id="boxComponent"
|
|
299
|
+
>
|
|
300
|
+
Home
|
|
301
|
+
</div>
|
|
302
|
+
</div>
|
|
303
|
+
</div>
|
|
304
|
+
</DocumentFragment>
|
|
305
|
+
`;
|
|
306
|
+
|
|
307
|
+
exports[`Tab variant-based label rendering variant="text" renders text only 1`] = `
|
|
308
|
+
<DocumentFragment>
|
|
309
|
+
<div
|
|
310
|
+
aria-controls="t1"
|
|
311
|
+
aria-label="Home"
|
|
312
|
+
aria-selected="false"
|
|
313
|
+
class="tab horizontal basisAuto shrinkOff"
|
|
314
|
+
data-id="tabMenu_Tab"
|
|
315
|
+
data-key="t1"
|
|
316
|
+
data-selector-id="tab"
|
|
317
|
+
data-test-id="tabMenu_Tab"
|
|
318
|
+
role="link"
|
|
319
|
+
tabindex="0"
|
|
320
|
+
>
|
|
321
|
+
<div
|
|
322
|
+
class="textContainer flex cover rowdir both"
|
|
323
|
+
data-id="containerComponent"
|
|
324
|
+
data-selector-id="container"
|
|
325
|
+
data-test-id="containerComponent"
|
|
326
|
+
>
|
|
327
|
+
<div
|
|
328
|
+
class="tabText grow basisAuto shrinkOff"
|
|
329
|
+
data-id="boxComponent"
|
|
330
|
+
data-selector-id="box"
|
|
331
|
+
data-test-id="boxComponent"
|
|
332
|
+
>
|
|
333
|
+
Home
|
|
334
|
+
</div>
|
|
335
|
+
</div>
|
|
336
|
+
</div>
|
|
337
|
+
</DocumentFragment>
|
|
338
|
+
`;
|
|
@@ -3,7 +3,8 @@ export const Tab_defaultProps = {
|
|
|
3
3
|
contentAlign: 'both',
|
|
4
4
|
contentAlignBox: 'row',
|
|
5
5
|
customProps: {},
|
|
6
|
-
dataSelectorId: 'tab'
|
|
6
|
+
dataSelectorId: 'tab',
|
|
7
|
+
variant: 'text'
|
|
7
8
|
};
|
|
8
9
|
export const TabContent_defaultProps = {
|
|
9
10
|
dataId: 'tabContent',
|
|
@@ -36,7 +37,7 @@ export const Tabs_defaultProps = {
|
|
|
36
37
|
searchBoxSize: 'small',
|
|
37
38
|
searchErrorText: 'No results',
|
|
38
39
|
placeHolderText: 'Search',
|
|
39
|
-
isAbsolutePositioningNeeded:
|
|
40
|
+
isAbsolutePositioningNeeded: false,
|
|
40
41
|
isRestrictScroll: false,
|
|
41
42
|
moreContainerClass: ''
|
|
42
43
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
+
import { VARIANT } from "../utils/tabConfigs";
|
|
3
|
+
const renderSlotType = PropTypes.oneOfType([PropTypes.node, PropTypes.func]);
|
|
2
4
|
export const Tab_propTypes = {
|
|
3
5
|
activeClass: PropTypes.string,
|
|
4
6
|
align: PropTypes.oneOf(['vertical', 'horizontal']),
|
|
@@ -26,7 +28,14 @@ export const Tab_propTypes = {
|
|
|
26
28
|
contentAlignBox: PropTypes.oneOf(['row', 'column', 'row-reverse', 'column-reverse']),
|
|
27
29
|
customProps: PropTypes.object,
|
|
28
30
|
isVirtual: PropTypes.bool,
|
|
29
|
-
dataSelectorId: PropTypes.string
|
|
31
|
+
dataSelectorId: PropTypes.string,
|
|
32
|
+
variant: PropTypes.oneOf(Object.values(VARIANT)),
|
|
33
|
+
iconPlacement: PropTypes.string,
|
|
34
|
+
iconName: PropTypes.string,
|
|
35
|
+
iconSize: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
36
|
+
renderIcon: renderSlotType,
|
|
37
|
+
renderBefore: renderSlotType,
|
|
38
|
+
renderAfter: renderSlotType
|
|
30
39
|
};
|
|
31
40
|
export const TabContent_propTypes = {
|
|
32
41
|
children: PropTypes.node,
|
|
@@ -82,7 +91,7 @@ export const Tabs_propTypes = {
|
|
|
82
91
|
showTitleInMoreOptions: PropTypes.bool,
|
|
83
92
|
style: PropTypes.object,
|
|
84
93
|
togglePopup: PropTypes.func,
|
|
85
|
-
type: PropTypes.oneOf(['alpha', 'beta', 'delta']),
|
|
94
|
+
type: PropTypes.oneOf(['alpha', 'beta', 'delta', 'default']),
|
|
86
95
|
getTargetRef: PropTypes.func,
|
|
87
96
|
containerClass: PropTypes.string,
|
|
88
97
|
customProps: PropTypes.shape({
|
|
@@ -114,6 +123,6 @@ export const TabWrapper_propTypes = {
|
|
|
114
123
|
needPadding: PropTypes.bool,
|
|
115
124
|
needTabBorder: PropTypes.bool,
|
|
116
125
|
onSelect: PropTypes.func,
|
|
117
|
-
type: PropTypes.oneOf(['alpha', 'beta', 'delta']),
|
|
126
|
+
type: PropTypes.oneOf(['alpha', 'beta', 'delta', 'default']),
|
|
118
127
|
dataSelectorId: PropTypes.string
|
|
119
128
|
};
|
|
@@ -14,7 +14,10 @@ export function getTimeOffset() {
|
|
|
14
14
|
const matchingOffset = Object.keys(offsetMap).find(offset => GMT.getTimezoneOffset() === Number(offset));
|
|
15
15
|
return matchingOffset ? offsetMap[matchingOffset].toString().split(' ') : ['', ''];
|
|
16
16
|
}
|
|
17
|
-
export function formatDate(dateMill, mask
|
|
17
|
+
export function formatDate(dateMill, mask, {
|
|
18
|
+
i18nShortMonths,
|
|
19
|
+
i18nMonths
|
|
20
|
+
} = {}) {
|
|
18
21
|
let date = new Date(dateMill);
|
|
19
22
|
let O = getTimeOffset()[0];
|
|
20
23
|
let Z = getTimeOffset()[1];
|
|
@@ -26,6 +29,10 @@ export function formatDate(dateMill, mask) {
|
|
|
26
29
|
let M = date.getMinutes();
|
|
27
30
|
let s = date.getSeconds();
|
|
28
31
|
let L = date.getMilliseconds();
|
|
32
|
+
const defaultShortMonths = dateFormat.monthNames.slice(0, 12);
|
|
33
|
+
const defaultMonths = dateFormat.monthNames.slice(12);
|
|
34
|
+
const resolvedShortMonths = Array.isArray(i18nShortMonths) ? i18nShortMonths : defaultShortMonths;
|
|
35
|
+
const resolvedMonths = Array.isArray(i18nMonths) ? i18nMonths : defaultMonths;
|
|
29
36
|
let flags = {
|
|
30
37
|
d: d,
|
|
31
38
|
O: O,
|
|
@@ -38,8 +45,8 @@ export function formatDate(dateMill, mask) {
|
|
|
38
45
|
DDDD: dateFormat.dayNames[D + 7],
|
|
39
46
|
M: m + 1,
|
|
40
47
|
MM: pad(m + 1, 2),
|
|
41
|
-
MMM:
|
|
42
|
-
MMMM:
|
|
48
|
+
MMM: resolvedShortMonths[m],
|
|
49
|
+
MMMM: resolvedMonths[m],
|
|
43
50
|
yy: String(y).slice(2),
|
|
44
51
|
YY: String(y).slice(2),
|
|
45
52
|
yyyy: y,
|
|
@@ -23,6 +23,10 @@ require("@zohodesk/variables/assets/colorVariables.module.css");
|
|
|
23
23
|
|
|
24
24
|
require("@zohodesk/variables/assets/dotVariables.module.css");
|
|
25
25
|
|
|
26
|
+
require("@zohodesk/variables/assets/sizeVariables.module.css");
|
|
27
|
+
|
|
28
|
+
require("@zohodesk/variables/assets/fontsizeVariables.module.css");
|
|
29
|
+
|
|
26
30
|
require("@zohodesk/variables/es/fontFamilyVariables.module.css");
|
|
27
31
|
|
|
28
32
|
require("@zohodesk/variables/es/fontWeightVariables.module.css");
|
|
@@ -102,6 +102,7 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
102
102
|
_this.handleDateIconClick = _this.handleDateIconClick.bind(_assertThisInitialized(_this));
|
|
103
103
|
_this.handleSelectionRangeDetails = _this.handleSelectionRangeDetails.bind(_assertThisInitialized(_this));
|
|
104
104
|
_this.handleBlurSelectionRange = _this.handleBlurSelectionRange.bind(_assertThisInitialized(_this));
|
|
105
|
+
_this.getI18nMonthLabels = _this.getI18nMonthLabels.bind(_assertThisInitialized(_this));
|
|
105
106
|
_this.state = {
|
|
106
107
|
selected: '',
|
|
107
108
|
displayText: '',
|
|
@@ -313,6 +314,15 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
313
314
|
|
|
314
315
|
!isOpenOnly && togglePopup(e, "".concat(defaultPosition, "Right"));
|
|
315
316
|
}
|
|
317
|
+
}, {
|
|
318
|
+
key: "getI18nMonthLabels",
|
|
319
|
+
value: function getI18nMonthLabels() {
|
|
320
|
+
var i18nKeys = this.props.i18nKeys;
|
|
321
|
+
return {
|
|
322
|
+
i18nShortMonths: i18nKeys.monthNamesShort || _constants.i18nShortMonths,
|
|
323
|
+
i18nMonths: i18nKeys.monthNames || _constants.i18nMonths
|
|
324
|
+
};
|
|
325
|
+
}
|
|
316
326
|
}, {
|
|
317
327
|
key: "handleSelectionRangeDetails",
|
|
318
328
|
value: function handleSelectionRangeDetails(props) {
|
|
@@ -328,7 +338,12 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
328
338
|
hour = _this$state2.hour,
|
|
329
339
|
minute = _this$state2.minute,
|
|
330
340
|
noon = _this$state2.noon;
|
|
331
|
-
var selected = value === _constants.INVALID_DATE ? '' : value;
|
|
341
|
+
var selected = value === _constants.INVALID_DATE ? '' : value;
|
|
342
|
+
|
|
343
|
+
var _this$getI18nMonthLab = this.getI18nMonthLabels(),
|
|
344
|
+
localizedShortMonths = _this$getI18nMonthLab.i18nShortMonths,
|
|
345
|
+
localizedMonths = _this$getI18nMonthLab.i18nMonths; //New UI Changes
|
|
346
|
+
|
|
332
347
|
|
|
333
348
|
var dateFormatDetails = (0, _dateFormat.getDateFormatDetails)(dateFormat, {
|
|
334
349
|
isHideCurrentYear: false,
|
|
@@ -337,8 +352,8 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
337
352
|
isDateTime: isDateTime
|
|
338
353
|
});
|
|
339
354
|
var dateFormatSelection = (0, _dateFormat.getDateFormatSelection)(dateFormatDetails, isDateTime, {
|
|
340
|
-
i18nShortMonths:
|
|
341
|
-
i18nMonths:
|
|
355
|
+
i18nShortMonths: localizedShortMonths,
|
|
356
|
+
i18nMonths: localizedMonths,
|
|
342
357
|
selectedValue: selected,
|
|
343
358
|
day: day,
|
|
344
359
|
month: month,
|
|
@@ -365,6 +380,11 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
365
380
|
value = props.value,
|
|
366
381
|
is24Hour = props.is24Hour,
|
|
367
382
|
isHideCurrentYear = props.isHideCurrentYear;
|
|
383
|
+
|
|
384
|
+
var _this$getI18nMonthLab2 = this.getI18nMonthLabels(),
|
|
385
|
+
localizedShortMonths = _this$getI18nMonthLab2.i18nShortMonths,
|
|
386
|
+
localizedMonths = _this$getI18nMonthLab2.i18nMonths;
|
|
387
|
+
|
|
368
388
|
var dateFormatDetails = (0, _dateFormat.getDateFormatDetails)(dateFormat, {
|
|
369
389
|
isHideCurrentYear: isHideCurrentYear,
|
|
370
390
|
value: value,
|
|
@@ -383,7 +403,10 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
383
403
|
format = "".concat(newDateFormat, " ").concat(is24Hour ? 'HH:mm' : 'hh:mm A');
|
|
384
404
|
}
|
|
385
405
|
|
|
386
|
-
displayText = (0, _common.formatDate)(convertedValue, format
|
|
406
|
+
displayText = (0, _common.formatDate)(convertedValue, format, {
|
|
407
|
+
i18nShortMonths: localizedShortMonths,
|
|
408
|
+
i18nMonths: localizedMonths
|
|
409
|
+
});
|
|
387
410
|
}
|
|
388
411
|
|
|
389
412
|
return {
|
|
@@ -849,6 +872,10 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
849
872
|
isPopupOpen = _this$props9.isPopupOpen;
|
|
850
873
|
|
|
851
874
|
if (isDateEdited || isFocused || isPopupReady || isPopupOpen) {
|
|
875
|
+
var _this$getI18nMonthLab3 = this.getI18nMonthLabels(),
|
|
876
|
+
localizedShortMonths = _this$getI18nMonthLab3.i18nShortMonths,
|
|
877
|
+
localizedMonths = _this$getI18nMonthLab3.i18nMonths;
|
|
878
|
+
|
|
852
879
|
var _getDateDetails2 = (0, _dateFormat.getDateDetails)(selected, {
|
|
853
880
|
day: day,
|
|
854
881
|
month: month,
|
|
@@ -880,8 +907,8 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
880
907
|
minute: selectedMinute,
|
|
881
908
|
noon: selectedNoon
|
|
882
909
|
}, dateFormatDetails, isDateTime, {
|
|
883
|
-
i18nShortMonths:
|
|
884
|
-
i18nMonths:
|
|
910
|
+
i18nShortMonths: localizedShortMonths,
|
|
911
|
+
i18nMonths: localizedMonths,
|
|
885
912
|
is24Hour: is24Hour
|
|
886
913
|
});
|
|
887
914
|
return dateTimeString;
|
|
@@ -48,7 +48,8 @@ var LibraryContextProvider = function LibraryContextProvider(_ref) {
|
|
|
48
48
|
shouldStrikeThroughDisabledButton = _ref.shouldStrikeThroughDisabledButton,
|
|
49
49
|
labelRequiredType = _ref.labelRequiredType,
|
|
50
50
|
shouldHighlightRequiredLabel = _ref.shouldHighlightRequiredLabel,
|
|
51
|
-
children = _ref.children
|
|
51
|
+
children = _ref.children,
|
|
52
|
+
buttonComponentVersion = _ref.buttonComponentVersion;
|
|
52
53
|
|
|
53
54
|
var _useState = (0, _react.useState)({
|
|
54
55
|
isReducedMotion: isReducedMotion,
|
|
@@ -57,6 +58,7 @@ var LibraryContextProvider = function LibraryContextProvider(_ref) {
|
|
|
57
58
|
hasTagColorInheritedToText: hasTagColorInheritedToText,
|
|
58
59
|
shouldIndicateSwitchState: shouldIndicateSwitchState,
|
|
59
60
|
shouldStrikeThroughDisabledButton: shouldStrikeThroughDisabledButton,
|
|
61
|
+
buttonComponentVersion: buttonComponentVersion,
|
|
60
62
|
labelRequiredType: labelRequiredType,
|
|
61
63
|
shouldHighlightRequiredLabel: shouldHighlightRequiredLabel
|
|
62
64
|
}),
|
|
@@ -85,6 +87,7 @@ LibraryContextProvider.propTypes = {
|
|
|
85
87
|
direction: _propTypes["default"].string,
|
|
86
88
|
shouldIndicateSwitchState: _propTypes["default"].bool,
|
|
87
89
|
shouldStrikeThroughDisabledButton: _propTypes["default"].bool,
|
|
90
|
+
buttonComponentVersion: _propTypes["default"].oneOf(['default', 'v1']),
|
|
88
91
|
labelRequiredType: _propTypes["default"].oneOf(['asterisk', 'text']),
|
|
89
92
|
shouldHighlightRequiredLabel: _propTypes["default"].bool
|
|
90
93
|
};
|
|
@@ -95,6 +98,7 @@ LibraryContextProvider.defaultProps = {
|
|
|
95
98
|
hasTagColorInheritedToText: true,
|
|
96
99
|
shouldIndicateSwitchState: false,
|
|
97
100
|
shouldStrikeThroughDisabledButton: false,
|
|
101
|
+
buttonComponentVersion: 'v1',
|
|
98
102
|
labelRequiredType: 'asterisk',
|
|
99
103
|
shouldHighlightRequiredLabel: true
|
|
100
104
|
};
|
package/lib/Select/Select.js
CHANGED
|
@@ -1136,7 +1136,9 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
1136
1136
|
}), isFetchingOptions && /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
1137
1137
|
isCover: false,
|
|
1138
1138
|
align: "both"
|
|
1139
|
-
}, /*#__PURE__*/_react["default"].createElement(_Loader["default"], null))), getFooter ? /*#__PURE__*/_react["default"].createElement(_Card.CardFooter, null, getFooter(
|
|
1139
|
+
}, /*#__PURE__*/_react["default"].createElement(_Loader["default"], null))), getFooter ? /*#__PURE__*/_react["default"].createElement(_Card.CardFooter, null, getFooter({
|
|
1140
|
+
closePopup: _this7.handlePopupClose
|
|
1141
|
+
})) : null)) : /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
1140
1142
|
flexible: true
|
|
1141
1143
|
}, getChildren())));
|
|
1142
1144
|
}) : null);
|
package/lib/Tab/Tab.js
CHANGED
|
@@ -21,6 +21,10 @@ var _tabConfigs = require("./utils/tabConfigs");
|
|
|
21
21
|
|
|
22
22
|
var _TabModule = _interopRequireDefault(require("./Tab.module.css"));
|
|
23
23
|
|
|
24
|
+
var _utils = require("@zohodesk/utils");
|
|
25
|
+
|
|
26
|
+
var _icons = require("@zohodesk/icons");
|
|
27
|
+
|
|
24
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
29
|
|
|
26
30
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -41,6 +45,10 @@ var tabTypes = {
|
|
|
41
45
|
delta: {
|
|
42
46
|
active: 'deltaActive',
|
|
43
47
|
tab: 'tabDelta'
|
|
48
|
+
},
|
|
49
|
+
"default": {
|
|
50
|
+
active: 'defaultActive',
|
|
51
|
+
tab: 'tabDefault'
|
|
44
52
|
}
|
|
45
53
|
};
|
|
46
54
|
|
|
@@ -71,7 +79,14 @@ function Tab(_ref) {
|
|
|
71
79
|
isVirtual = _ref.isVirtual,
|
|
72
80
|
contentAlign = _ref.contentAlign,
|
|
73
81
|
contentAlignBox = _ref.contentAlignBox,
|
|
74
|
-
customProps = _ref.customProps
|
|
82
|
+
customProps = _ref.customProps,
|
|
83
|
+
variant = _ref.variant,
|
|
84
|
+
iconPlacement = _ref.iconPlacement,
|
|
85
|
+
iconName = _ref.iconName,
|
|
86
|
+
iconSize = _ref.iconSize,
|
|
87
|
+
renderIcon = _ref.renderIcon,
|
|
88
|
+
renderBefore = _ref.renderBefore,
|
|
89
|
+
renderAfter = _ref.renderAfter;
|
|
75
90
|
var clickListener = (0, _react.useCallback)(function (event) {
|
|
76
91
|
if (isLink && event && (event.metaKey || event.altKey || event.ctrlKey || event.shiftKey)) {
|
|
77
92
|
event && event.stopPropagation();
|
|
@@ -93,8 +108,50 @@ function Tab(_ref) {
|
|
|
93
108
|
}, [id, isVirtual]);
|
|
94
109
|
var activeWithAppearance = (0, _Common.cs)([_TabModule["default"][styleContent.active], needBorder && !isAnimate && _TabModule["default"]["".concat(styleContent.active, "_border")]]);
|
|
95
110
|
var activeClasses = (0, _Common.cs)([needAppearance && activeWithAppearance, activeClass]);
|
|
96
|
-
var inActiveClasses = needAppearance && (0, _Common.cs)([_TabModule["default"][styleContent.tab], tabTypes[type] && _TabModule["default"]["".concat(
|
|
97
|
-
var tabClass = (0, _Common.cs)([_TabModule["default"].tab, _tabConfigs.TAB_DIRECTION_MAPPING[align] === 'column' ? _TabModule["default"].vertical : _TabModule["default"].horizontal, isDisabled && _TabModule["default"].disabled, needBorder && !isAnimate && needAppearance && _TabModule["default"].border, isActive ? activeClasses : inActiveClasses, className]);
|
|
111
|
+
var inActiveClasses = needAppearance && (0, _Common.cs)([_TabModule["default"][styleContent.tab], tabTypes[type] && _TabModule["default"]["".concat(type, "Hover")]]);
|
|
112
|
+
var tabClass = (0, _Common.cs)([_TabModule["default"].tab, _tabConfigs.TAB_DIRECTION_MAPPING[align] === 'column' ? _TabModule["default"].vertical : _TabModule["default"].horizontal, isDisabled && _TabModule["default"].disabled, needBorder && !isAnimate && needAppearance && _TabModule["default"].border, isActive ? activeClasses : inActiveClasses, variant === _tabConfigs.VARIANT.ICON && _TabModule["default"].tabVariantIcon, variant === _tabConfigs.VARIANT.ICON_WITH_TEXT && _TabModule["default"].tabVariantIconWithText, className]);
|
|
113
|
+
|
|
114
|
+
var _renderIconNode = function _renderIconNode() {
|
|
115
|
+
if ((0, _utils.isRenderable)(renderIcon)) {
|
|
116
|
+
return (0, _utils.renderNode)(renderIcon);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (!iconName) {
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return /*#__PURE__*/_react["default"].createElement(_icons.Icon, {
|
|
124
|
+
name: iconName,
|
|
125
|
+
size: iconSize
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
var _renderBeforeNode = function _renderBeforeNode() {
|
|
130
|
+
if (!(0, _utils.isRenderable)(renderBefore)) {
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return (0, _utils.renderNode)(renderBefore);
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
var _renderAfterNode = function _renderAfterNode() {
|
|
138
|
+
if (!(0, _utils.isRenderable)(renderAfter)) {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return (0, _utils.renderNode)(renderAfter);
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
var _renderLabel = function _renderLabel() {
|
|
146
|
+
var showIcon = variant !== _tabConfigs.VARIANT.TEXT && ((0, _utils.isRenderable)(renderIcon) || iconName);
|
|
147
|
+
var showText = variant !== _tabConfigs.VARIANT.ICON && text !== undefined && text !== null;
|
|
148
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, showIcon ? _renderIconNode() : null, showText ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
149
|
+
flexible: true,
|
|
150
|
+
adjust: true,
|
|
151
|
+
className: _TabModule["default"].tabText
|
|
152
|
+
}, text) : null);
|
|
153
|
+
};
|
|
154
|
+
|
|
98
155
|
return /*#__PURE__*/_react["default"].createElement(_Layout.Box, _extends({
|
|
99
156
|
tourId: tourId,
|
|
100
157
|
tagName: isLink ? 'a' : 'div',
|
|
@@ -118,13 +175,9 @@ function Tab(_ref) {
|
|
|
118
175
|
alignBox: contentAlignBox,
|
|
119
176
|
align: contentAlign,
|
|
120
177
|
className: _TabModule["default"].textContainer
|
|
121
|
-
},
|
|
122
|
-
flexible: true,
|
|
123
|
-
adjust: true,
|
|
124
|
-
className: _TabModule["default"].tabText
|
|
125
|
-
}, text), children ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
178
|
+
}, _renderBeforeNode(), _renderLabel(), children ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
126
179
|
shrink: true
|
|
127
|
-
}, children) : null));
|
|
180
|
+
}, children) : null, _renderAfterNode()));
|
|
128
181
|
}
|
|
129
182
|
|
|
130
183
|
Tab.defaultProps = _defaultProps.Tab_defaultProps;
|