@zohodesk/components 1.3.2 → 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 +8 -0
- 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/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/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/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/utils/Common.js +1 -1
- package/package.json +1 -1
- 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
package/lib/Stencils/Stencils.js
CHANGED
|
@@ -55,11 +55,11 @@ var Stencils = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
55
55
|
shape = _this$props.shape,
|
|
56
56
|
size = _this$props.size,
|
|
57
57
|
palette = _this$props.palette,
|
|
58
|
-
customClass = _this$props.customClass
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
customClass = _this$props.customClass,
|
|
59
|
+
isAnimated = _this$props.isAnimated;
|
|
60
|
+
size = shape === 'rect' ? _StencilsModule["default"][size] : _StencilsModule["default"]["size_".concat(size)];
|
|
61
61
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
62
|
-
className: "".concat(_StencilsModule["default"].container, " ").concat(shape, " ").concat(size, " ").concat(_StencilsModule["default"][palette], " ").concat(customClass)
|
|
62
|
+
className: "".concat(_StencilsModule["default"].container, " ").concat(isAnimated ? _StencilsModule["default"].animate : '', " ").concat(_StencilsModule["default"][shape], " ").concat(size, " ").concat(_StencilsModule["default"][palette], " ").concat(customClass)
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
}]);
|
|
@@ -69,11 +69,4 @@ var Stencils = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
69
69
|
|
|
70
70
|
exports["default"] = Stencils;
|
|
71
71
|
Stencils.propTypes = _propTypes.propTypes;
|
|
72
|
-
Stencils.defaultProps = _defaultProps.defaultProps;
|
|
73
|
-
// Stencils.docs = {
|
|
74
|
-
// componentGroup: 'Atom',
|
|
75
|
-
// folderName: 'Style Guide',
|
|
76
|
-
// description: ' ',
|
|
77
|
-
// external: true
|
|
78
|
-
// };
|
|
79
|
-
// }
|
|
72
|
+
Stencils.defaultProps = _defaultProps.defaultProps;
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
.stencil {
|
|
14
14
|
background-size: 800px 1px;
|
|
15
15
|
}
|
|
16
|
-
[dir=ltr] .
|
|
16
|
+
[dir=ltr] .animate{
|
|
17
17
|
animation-name: placeHolderShimmer-ltr ;
|
|
18
18
|
animation-fill-mode: forwards;
|
|
19
19
|
animation-iteration-count: infinite;
|
|
20
20
|
animation-duration: var(--zd_transition10);
|
|
21
21
|
animation-timing-function: linear;
|
|
22
22
|
}
|
|
23
|
-
[dir=rtl] .
|
|
23
|
+
[dir=rtl] .animate{
|
|
24
24
|
animation-name: placeHolderShimmer-rtl ;
|
|
25
25
|
animation-fill-mode: forwards;
|
|
26
26
|
animation-iteration-count: infinite;
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
.
|
|
49
|
+
.rect {
|
|
50
50
|
composes: stencil;
|
|
51
51
|
--stencil_height: var(--zd_size9);
|
|
52
52
|
--stencil_border_radius: 5px;
|
|
@@ -81,16 +81,20 @@
|
|
|
81
81
|
composes: stencil;
|
|
82
82
|
--stencil_border_radius: 50%;
|
|
83
83
|
}
|
|
84
|
-
.
|
|
84
|
+
.square {
|
|
85
|
+
composes: stencil;
|
|
86
|
+
--stencil_border_radius: 4px;
|
|
87
|
+
}
|
|
88
|
+
.size_large {
|
|
85
89
|
--stencil_width: var(--zd_size42);
|
|
86
90
|
--stencil_height: var(--zd_size42);
|
|
87
91
|
}
|
|
88
|
-
.
|
|
89
|
-
.
|
|
92
|
+
.size_medium,
|
|
93
|
+
.size_default {
|
|
90
94
|
--stencil_width: var(--zd_size30);
|
|
91
95
|
--stencil_height: var(--zd_size30);
|
|
92
96
|
}
|
|
93
|
-
.
|
|
97
|
+
.size_small {
|
|
94
98
|
--stencil_width: var(--zd_size20);
|
|
95
99
|
--stencil_height: var(--zd_size20);
|
|
96
100
|
}
|
|
@@ -24,7 +24,7 @@ describe('Stencils', function () {
|
|
|
24
24
|
|
|
25
25
|
expect(asFragment()).toMatchSnapshot();
|
|
26
26
|
});
|
|
27
|
-
var shape = ['rect', 'circle'];
|
|
27
|
+
var shape = ['rect', 'circle', 'square'];
|
|
28
28
|
test.each(shape)('rendering the shape of- %s', function (shape) {
|
|
29
29
|
var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Stencils["default"], {
|
|
30
30
|
shape: shape
|
|
@@ -42,12 +42,20 @@ describe('Stencils', function () {
|
|
|
42
42
|
|
|
43
43
|
expect(asFragment()).toMatchSnapshot();
|
|
44
44
|
});
|
|
45
|
-
test('rendering
|
|
45
|
+
test('rendering without animation', function () {
|
|
46
46
|
var _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Stencils["default"], {
|
|
47
|
-
|
|
47
|
+
isAnimated: false
|
|
48
48
|
})),
|
|
49
49
|
asFragment = _render5.asFragment;
|
|
50
50
|
|
|
51
51
|
expect(asFragment()).toMatchSnapshot();
|
|
52
52
|
});
|
|
53
|
+
test('rendering the customClass', function () {
|
|
54
|
+
var _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Stencils["default"], {
|
|
55
|
+
customClass: "StencilsCustomClass"
|
|
56
|
+
})),
|
|
57
|
+
asFragment = _render6.asFragment;
|
|
58
|
+
|
|
59
|
+
expect(asFragment()).toMatchSnapshot();
|
|
60
|
+
});
|
|
53
61
|
});
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports[`Stencils rendering the customClass 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<div
|
|
6
|
-
class="container
|
|
6
|
+
class="container animate rect medium primary StencilsCustomClass"
|
|
7
7
|
/>
|
|
8
8
|
</DocumentFragment>
|
|
9
9
|
`;
|
|
@@ -11,7 +11,7 @@ exports[`Stencils rendering the customClass 1`] = `
|
|
|
11
11
|
exports[`Stencils rendering the defult props 1`] = `
|
|
12
12
|
<DocumentFragment>
|
|
13
13
|
<div
|
|
14
|
-
class="container
|
|
14
|
+
class="container animate rect medium primary "
|
|
15
15
|
/>
|
|
16
16
|
</DocumentFragment>
|
|
17
17
|
`;
|
|
@@ -19,7 +19,7 @@ exports[`Stencils rendering the defult props 1`] = `
|
|
|
19
19
|
exports[`Stencils rendering the palette of- dark 1`] = `
|
|
20
20
|
<DocumentFragment>
|
|
21
21
|
<div
|
|
22
|
-
class="container
|
|
22
|
+
class="container animate rect medium dark "
|
|
23
23
|
/>
|
|
24
24
|
</DocumentFragment>
|
|
25
25
|
`;
|
|
@@ -27,7 +27,7 @@ exports[`Stencils rendering the palette of- dark 1`] = `
|
|
|
27
27
|
exports[`Stencils rendering the palette of- primary 1`] = `
|
|
28
28
|
<DocumentFragment>
|
|
29
29
|
<div
|
|
30
|
-
class="container
|
|
30
|
+
class="container animate rect medium primary "
|
|
31
31
|
/>
|
|
32
32
|
</DocumentFragment>
|
|
33
33
|
`;
|
|
@@ -35,7 +35,7 @@ exports[`Stencils rendering the palette of- primary 1`] = `
|
|
|
35
35
|
exports[`Stencils rendering the palette of- secondary 1`] = `
|
|
36
36
|
<DocumentFragment>
|
|
37
37
|
<div
|
|
38
|
-
class="container
|
|
38
|
+
class="container animate rect medium secondary "
|
|
39
39
|
/>
|
|
40
40
|
</DocumentFragment>
|
|
41
41
|
`;
|
|
@@ -43,7 +43,7 @@ exports[`Stencils rendering the palette of- secondary 1`] = `
|
|
|
43
43
|
exports[`Stencils rendering the shape of- circle 1`] = `
|
|
44
44
|
<DocumentFragment>
|
|
45
45
|
<div
|
|
46
|
-
class="container circle
|
|
46
|
+
class="container animate circle size_medium primary "
|
|
47
47
|
/>
|
|
48
48
|
</DocumentFragment>
|
|
49
49
|
`;
|
|
@@ -51,7 +51,15 @@ exports[`Stencils rendering the shape of- circle 1`] = `
|
|
|
51
51
|
exports[`Stencils rendering the shape of- rect 1`] = `
|
|
52
52
|
<DocumentFragment>
|
|
53
53
|
<div
|
|
54
|
-
class="container
|
|
54
|
+
class="container animate rect medium primary "
|
|
55
|
+
/>
|
|
56
|
+
</DocumentFragment>
|
|
57
|
+
`;
|
|
58
|
+
|
|
59
|
+
exports[`Stencils rendering the shape of- square 1`] = `
|
|
60
|
+
<DocumentFragment>
|
|
61
|
+
<div
|
|
62
|
+
class="container animate square size_medium primary "
|
|
55
63
|
/>
|
|
56
64
|
</DocumentFragment>
|
|
57
65
|
`;
|
|
@@ -59,7 +67,7 @@ exports[`Stencils rendering the shape of- rect 1`] = `
|
|
|
59
67
|
exports[`Stencils rendering the size of- default 1`] = `
|
|
60
68
|
<DocumentFragment>
|
|
61
69
|
<div
|
|
62
|
-
class="container
|
|
70
|
+
class="container animate rect default primary "
|
|
63
71
|
/>
|
|
64
72
|
</DocumentFragment>
|
|
65
73
|
`;
|
|
@@ -67,7 +75,7 @@ exports[`Stencils rendering the size of- default 1`] = `
|
|
|
67
75
|
exports[`Stencils rendering the size of- large 1`] = `
|
|
68
76
|
<DocumentFragment>
|
|
69
77
|
<div
|
|
70
|
-
class="container
|
|
78
|
+
class="container animate rect large primary "
|
|
71
79
|
/>
|
|
72
80
|
</DocumentFragment>
|
|
73
81
|
`;
|
|
@@ -75,7 +83,7 @@ exports[`Stencils rendering the size of- large 1`] = `
|
|
|
75
83
|
exports[`Stencils rendering the size of- medium 1`] = `
|
|
76
84
|
<DocumentFragment>
|
|
77
85
|
<div
|
|
78
|
-
class="container
|
|
86
|
+
class="container animate rect medium primary "
|
|
79
87
|
/>
|
|
80
88
|
</DocumentFragment>
|
|
81
89
|
`;
|
|
@@ -83,7 +91,15 @@ exports[`Stencils rendering the size of- medium 1`] = `
|
|
|
83
91
|
exports[`Stencils rendering the size of- small 1`] = `
|
|
84
92
|
<DocumentFragment>
|
|
85
93
|
<div
|
|
86
|
-
class="container
|
|
94
|
+
class="container animate rect small primary "
|
|
95
|
+
/>
|
|
96
|
+
</DocumentFragment>
|
|
97
|
+
`;
|
|
98
|
+
|
|
99
|
+
exports[`Stencils rendering without animation 1`] = `
|
|
100
|
+
<DocumentFragment>
|
|
101
|
+
<div
|
|
102
|
+
class="container rect medium primary "
|
|
87
103
|
/>
|
|
88
104
|
</DocumentFragment>
|
|
89
105
|
`;
|
|
@@ -11,8 +11,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
11
11
|
|
|
12
12
|
var propTypes = {
|
|
13
13
|
palette: _propTypes["default"].oneOf(['primary', 'secondary', 'dark']),
|
|
14
|
-
shape: _propTypes["default"].oneOf(['rect', 'circle']),
|
|
14
|
+
shape: _propTypes["default"].oneOf(['rect', 'circle', 'square']),
|
|
15
15
|
size: _propTypes["default"].oneOf(['small', 'medium', 'large', 'default']),
|
|
16
|
-
customClass: _propTypes["default"].string
|
|
16
|
+
customClass: _propTypes["default"].string,
|
|
17
|
+
isAnimated: _propTypes["default"].bool
|
|
17
18
|
};
|
|
18
19
|
exports.propTypes = propTypes;
|
package/lib/Tab/Tab.js
CHANGED
|
@@ -17,6 +17,8 @@ var _Layout = require("../Layout");
|
|
|
17
17
|
|
|
18
18
|
var _Common = require("../utils/Common");
|
|
19
19
|
|
|
20
|
+
var _tabConfigs = require("./utils/tabConfigs");
|
|
21
|
+
|
|
20
22
|
var _TabModule = _interopRequireDefault(require("./Tab.module.css"));
|
|
21
23
|
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -90,7 +92,7 @@ function Tab(_ref) {
|
|
|
90
92
|
var activeWithAppearance = (0, _Common.cs)([_TabModule["default"][styleContent.active], needBorder && !isAnimate && _TabModule["default"]["".concat(styleContent.active, "_border")]]);
|
|
91
93
|
var activeClasses = (0, _Common.cs)([needAppearance && activeWithAppearance, activeClass]);
|
|
92
94
|
var inActiveClasses = needAppearance && (0, _Common.cs)([_TabModule["default"][styleContent.tab], tabTypes[type] && _TabModule["default"]["".concat("".concat(type, "Hover"))]]);
|
|
93
|
-
var tabClass = (0, _Common.cs)([_TabModule["default"].tab, align === '
|
|
95
|
+
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]);
|
|
94
96
|
return /*#__PURE__*/_react["default"].createElement(_Layout.Box, _extends({
|
|
95
97
|
tourId: tourId,
|
|
96
98
|
tagName: isLink ? 'a' : 'div',
|
package/lib/Tab/TabWrapper.js
CHANGED
|
@@ -15,6 +15,8 @@ var _propTypes = require("./props/propTypes");
|
|
|
15
15
|
|
|
16
16
|
var _Layout = require("../Layout");
|
|
17
17
|
|
|
18
|
+
var _tabConfigs = require("./utils/tabConfigs");
|
|
19
|
+
|
|
18
20
|
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); }
|
|
19
21
|
|
|
20
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -61,7 +63,7 @@ function TabWrapper(_ref) {
|
|
|
61
63
|
onSelect && onSelect(id);
|
|
62
64
|
}, [hookToDisableInternalState, onSelect]);
|
|
63
65
|
return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
64
|
-
alignBox: align
|
|
66
|
+
alignBox: _tabConfigs.TAB_ALIGN_MAPPING[align],
|
|
65
67
|
dataId: dataId,
|
|
66
68
|
dataSelectorId: dataSelectorId
|
|
67
69
|
}, _react["default"].Children.map(children, function (child) {
|
package/lib/Tab/Tabs.js
CHANGED
|
@@ -37,6 +37,8 @@ var _ResponsiveDropBox = _interopRequireDefault(require("../ResponsiveDropBox/Re
|
|
|
37
37
|
|
|
38
38
|
var _CustomResponsive = require("../Responsive/CustomResponsive");
|
|
39
39
|
|
|
40
|
+
var _tabConfigs = require("./utils/tabConfigs");
|
|
41
|
+
|
|
40
42
|
var _semanticButtonModule = _interopRequireDefault(require("../semantic/Button/semanticButton.module.css"));
|
|
41
43
|
|
|
42
44
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -176,14 +178,14 @@ var Tabs = /*#__PURE__*/function (_React$Component) {
|
|
|
176
178
|
if (totalDimension && this[selectedTab]) {
|
|
177
179
|
var align = this.props.align;
|
|
178
180
|
var newDim = "".concat((0, _Common.remConvert)(totalDimension), "rem");
|
|
179
|
-
align === '
|
|
181
|
+
_tabConfigs.TAB_DIRECTION_MAPPING[align] === 'column' ? this[selectedTab].style.maxWidth = newDim : this[selectedTab].style.maxHeight = newDim;
|
|
180
182
|
}
|
|
181
183
|
}
|
|
182
184
|
}, {
|
|
183
185
|
key: "getHighlightDim",
|
|
184
186
|
value: function getHighlightDim() {
|
|
185
187
|
var align = this.props.align;
|
|
186
|
-
return align === '
|
|
188
|
+
return _tabConfigs.TAB_DIRECTION_MAPPING[align] === 'column' ? this.highlight.offsetLeft : this.highlight.offsetTop;
|
|
187
189
|
}
|
|
188
190
|
}, {
|
|
189
191
|
key: "componentDidUpdate",
|
|
@@ -260,12 +262,12 @@ var Tabs = /*#__PURE__*/function (_React$Component) {
|
|
|
260
262
|
if (tabActive) {
|
|
261
263
|
var position, dimension;
|
|
262
264
|
|
|
263
|
-
if (align === '
|
|
265
|
+
if (_tabConfigs.TAB_DIRECTION_MAPPING[align] === 'column') {
|
|
264
266
|
position = tabActive.offsetLeft;
|
|
265
267
|
dimension = tabActive.offsetWidth;
|
|
266
268
|
node.style.transform = "translateX(".concat((0, _Common.remConvert)(position - highlightInitialDimension), "rem)");
|
|
267
269
|
node.style.width = "".concat((0, _Common.remConvert)(dimension), "rem");
|
|
268
|
-
} else if (align === '
|
|
270
|
+
} else if (_tabConfigs.TAB_DIRECTION_MAPPING[align] === 'row') {
|
|
269
271
|
position = tabActive.offsetTop;
|
|
270
272
|
dimension = tabActive.offsetHeight;
|
|
271
273
|
node.style.transform = "translateY(".concat((0, _Common.remConvert)(position - highlightInitialDimension), "rem)");
|
|
@@ -471,8 +473,7 @@ var Tabs = /*#__PURE__*/function (_React$Component) {
|
|
|
471
473
|
align = _this$props8.align,
|
|
472
474
|
removeClose = _this$props8.removeClose;
|
|
473
475
|
removeClose && removeClose(e);
|
|
474
|
-
|
|
475
|
-
boxPosition = boxPosition ? boxPosition : popupPosition;
|
|
476
|
+
boxPosition = boxPosition ? boxPosition : _tabConfigs.TAB_POPUP_POSITION_MAPPING[align];
|
|
476
477
|
togglePopup(e, boxPosition);
|
|
477
478
|
}
|
|
478
479
|
}, {
|
|
@@ -592,7 +593,7 @@ var Tabs = /*#__PURE__*/function (_React$Component) {
|
|
|
592
593
|
MoreButtonProps = _customProps$MoreButt === void 0 ? {} : _customProps$MoreButt,
|
|
593
594
|
_customProps$TextBoxI = customProps.TextBoxIconProps,
|
|
594
595
|
TextBoxIconProps = _customProps$TextBoxI === void 0 ? {} : _customProps$TextBoxI;
|
|
595
|
-
var popupClass = align === '
|
|
596
|
+
var popupClass = _tabConfigs.TAB_DIRECTION_MAPPING[align] === 'column' ? _TabsModule["default"][position] ? _TabsModule["default"][position] : '' : '';
|
|
596
597
|
var moreTabsListItems = this.handleFilterSuggestions({
|
|
597
598
|
moreTabs: moreTabs
|
|
598
599
|
});
|
|
@@ -753,17 +754,17 @@ var Tabs = /*#__PURE__*/function (_React$Component) {
|
|
|
753
754
|
className: containerClass,
|
|
754
755
|
dataSelectorId: dataSelectorId
|
|
755
756
|
}, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
756
|
-
alignBox: align === '
|
|
757
|
+
alignBox: _tabConfigs.TAB_DIRECTION_MAPPING[align] === 'column' ? 'row' : 'column',
|
|
757
758
|
className: tabsClass,
|
|
758
759
|
style: style
|
|
759
760
|
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
760
761
|
eleRef: this.getTabsRef,
|
|
761
762
|
flexible: true
|
|
762
763
|
}, renderVirtualTabs && /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
763
|
-
alignBox: align === '
|
|
764
|
+
alignBox: _tabConfigs.TAB_DIRECTION_MAPPING[align] === 'column' ? 'row' : 'column',
|
|
764
765
|
className: _TabsModule["default"].hidden
|
|
765
766
|
}, this.renderTabs(children, [], true)), /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
766
|
-
alignBox: align === '
|
|
767
|
+
alignBox: _tabConfigs.TAB_DIRECTION_MAPPING[align] === 'column' ? 'row' : 'column'
|
|
767
768
|
}, this.renderTabs(mainTabs, moreTabs, false))), otherTabs.length ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, null, otherTabs) : null, isAnimate && needTabBorder && needAppearance && /*#__PURE__*/_react["default"].createElement("div", {
|
|
768
769
|
className: hlClass,
|
|
769
770
|
ref: this.getHighlightRef,
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _react = _interopRequireDefault(require("react"));
|
|
4
|
+
|
|
5
|
+
var _react2 = require("@testing-library/react");
|
|
6
|
+
|
|
7
|
+
var _index = require("../index");
|
|
8
|
+
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
10
|
+
|
|
11
|
+
describe('TabWrapper', function () {
|
|
12
|
+
var alignments = ['vertical', 'horizontal', 'vertical-reverse', 'horizontal-reverse'];
|
|
13
|
+
test.each(alignments)('rendering the align prop of - %s', function (alignments) {
|
|
14
|
+
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_index.TabWrapper, {
|
|
15
|
+
type: "alpha",
|
|
16
|
+
align: alignments,
|
|
17
|
+
defaultTab: "page1"
|
|
18
|
+
}, /*#__PURE__*/_react["default"].createElement(_index.Tabs, null, /*#__PURE__*/_react["default"].createElement(_index.Tab, {
|
|
19
|
+
id: "page1",
|
|
20
|
+
text: "Page 1"
|
|
21
|
+
}), /*#__PURE__*/_react["default"].createElement(_index.Tab, {
|
|
22
|
+
id: "page2",
|
|
23
|
+
text: "Page 2"
|
|
24
|
+
}), /*#__PURE__*/_react["default"].createElement(_index.Tab, {
|
|
25
|
+
id: "page3",
|
|
26
|
+
text: "Page 3"
|
|
27
|
+
})), /*#__PURE__*/_react["default"].createElement(_index.TabContentWrapper, null, /*#__PURE__*/_react["default"].createElement(_index.TabContent, {
|
|
28
|
+
id: "page1",
|
|
29
|
+
text: "Page 1"
|
|
30
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, "Page 1 Content")), /*#__PURE__*/_react["default"].createElement(_index.TabContent, {
|
|
31
|
+
id: "page2",
|
|
32
|
+
text: "Page 2"
|
|
33
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, "Page 2 Content")), /*#__PURE__*/_react["default"].createElement(_index.TabContent, {
|
|
34
|
+
id: "page3",
|
|
35
|
+
text: "Page 3"
|
|
36
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, "Page 3 Content"))))),
|
|
37
|
+
asFragment = _render.asFragment;
|
|
38
|
+
|
|
39
|
+
expect(asFragment()).toMatchSnapshot();
|
|
40
|
+
});
|
|
41
|
+
});
|