@atlaskit/tabs 13.2.2 → 13.2.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/CHANGELOG.md +6 -0
- package/dist/cjs/components/tabs.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/tabs.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/tabs.js +1 -1
- package/dist/esm/version.json +1 -1
- package/package.json +2 -2
- package/dist/cjs/performance/examples.js +0 -196
- package/dist/es2019/performance/examples.js +0 -96
- package/dist/esm/performance/examples.js +0 -171
package/CHANGELOG.md
CHANGED
|
@@ -36,7 +36,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
36
36
|
var analyticsAttributes = {
|
|
37
37
|
componentName: 'tabs',
|
|
38
38
|
packageName: "@atlaskit/tabs",
|
|
39
|
-
packageVersion: "13.2.
|
|
39
|
+
packageVersion: "13.2.3"
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
var getTabPanelWithContext = function getTabPanelWithContext(_ref) {
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/version.json
CHANGED
|
@@ -18,7 +18,7 @@ import { onMouseDownBlur } from '../internal/utils';
|
|
|
18
18
|
var analyticsAttributes = {
|
|
19
19
|
componentName: 'tabs',
|
|
20
20
|
packageName: "@atlaskit/tabs",
|
|
21
|
-
packageVersion: "13.2.
|
|
21
|
+
packageVersion: "13.2.3"
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
var getTabPanelWithContext = function getTabPanelWithContext(_ref) {
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/tabs",
|
|
3
|
-
"version": "13.2.
|
|
3
|
+
"version": "13.2.3",
|
|
4
4
|
"description": "Tabs are used to organize content by grouping similar information on the same page.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@atlaskit/analytics-next": "^8.2.0",
|
|
27
27
|
"@atlaskit/codemod-utils": "^3.4.0",
|
|
28
28
|
"@atlaskit/theme": "^12.0.0",
|
|
29
|
-
"@atlaskit/tokens": "^0.
|
|
29
|
+
"@atlaskit/tokens": "^0.3.0",
|
|
30
30
|
"@babel/runtime": "^7.0.0",
|
|
31
31
|
"@emotion/core": "^10.0.9"
|
|
32
32
|
},
|
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports.heavyPerformance = exports.performance = void 0;
|
|
11
|
-
|
|
12
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
|
-
|
|
14
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
15
|
-
|
|
16
|
-
var _react = _interopRequireDefault(require("react"));
|
|
17
|
-
|
|
18
|
-
var _react2 = require("@testing-library/react");
|
|
19
|
-
|
|
20
|
-
var _index = _interopRequireWildcard(require("../index"));
|
|
21
|
-
|
|
22
|
-
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); }
|
|
23
|
-
|
|
24
|
-
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; }
|
|
25
|
-
|
|
26
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
27
|
-
var interactionTasks = [{
|
|
28
|
-
name: 'Change tabs',
|
|
29
|
-
description: 'Change tabs',
|
|
30
|
-
run: function () {
|
|
31
|
-
var _run = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref) {
|
|
32
|
-
var container, controls, tab2;
|
|
33
|
-
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
34
|
-
while (1) {
|
|
35
|
-
switch (_context2.prev = _context2.next) {
|
|
36
|
-
case 0:
|
|
37
|
-
container = _ref.container, controls = _ref.controls;
|
|
38
|
-
tab2 = container.querySelector('div[data-testid="tab2"]');
|
|
39
|
-
|
|
40
|
-
if (!(tab2 == null)) {
|
|
41
|
-
_context2.next = 4;
|
|
42
|
-
break;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
throw new Error('Could not find tab element');
|
|
46
|
-
|
|
47
|
-
case 4:
|
|
48
|
-
_context2.next = 6;
|
|
49
|
-
return controls.time( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
50
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
51
|
-
while (1) {
|
|
52
|
-
switch (_context.prev = _context.next) {
|
|
53
|
-
case 0:
|
|
54
|
-
_react2.fireEvent.click(tab2);
|
|
55
|
-
|
|
56
|
-
case 1:
|
|
57
|
-
case "end":
|
|
58
|
-
return _context.stop();
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}, _callee);
|
|
62
|
-
})));
|
|
63
|
-
|
|
64
|
-
case 6:
|
|
65
|
-
case "end":
|
|
66
|
-
return _context2.stop();
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}, _callee2);
|
|
70
|
-
}));
|
|
71
|
-
|
|
72
|
-
function run(_x) {
|
|
73
|
-
return _run.apply(this, arguments);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return run;
|
|
77
|
-
}()
|
|
78
|
-
}];
|
|
79
|
-
|
|
80
|
-
function PerformanceComponent() {
|
|
81
|
-
return /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
82
|
-
id: "test"
|
|
83
|
-
}, /*#__PURE__*/_react.default.createElement(_index.TabList, null, /*#__PURE__*/_react.default.createElement(_index.Tab, {
|
|
84
|
-
testId: "tab1"
|
|
85
|
-
}, "Tab 1"), /*#__PURE__*/_react.default.createElement(_index.Tab, {
|
|
86
|
-
testId: "tab2"
|
|
87
|
-
}, "Tab 2"), /*#__PURE__*/_react.default.createElement(_index.Tab, null, "Tab 3"), /*#__PURE__*/_react.default.createElement(_index.Tab, null, "Tab 4")), /*#__PURE__*/_react.default.createElement(_index.TabPanel, null, "One"), /*#__PURE__*/_react.default.createElement(_index.TabPanel, null, "Two"), /*#__PURE__*/_react.default.createElement(_index.TabPanel, null, "Three"), /*#__PURE__*/_react.default.createElement(_index.TabPanel, null, "Four"));
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
var performance = function performance() {
|
|
91
|
-
return /*#__PURE__*/_react.default.createElement(PerformanceComponent, null);
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
exports.performance = performance;
|
|
95
|
-
performance.story = {
|
|
96
|
-
name: 'Performance',
|
|
97
|
-
parameters: {
|
|
98
|
-
performance: {
|
|
99
|
-
interactions: interactionTasks
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
var heavyInteractionTasks = [{
|
|
104
|
-
name: 'Change tabs twice',
|
|
105
|
-
description: 'Change tabs twice',
|
|
106
|
-
run: function () {
|
|
107
|
-
var _run2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(_ref3) {
|
|
108
|
-
var container, controls, tab1, tab2;
|
|
109
|
-
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
110
|
-
while (1) {
|
|
111
|
-
switch (_context4.prev = _context4.next) {
|
|
112
|
-
case 0:
|
|
113
|
-
container = _ref3.container, controls = _ref3.controls;
|
|
114
|
-
tab1 = container.querySelector('div[data-testid="tab1"]');
|
|
115
|
-
tab2 = container.querySelector('div[data-testid="tab2"]');
|
|
116
|
-
|
|
117
|
-
if (!(tab1 === null || tab2 === null)) {
|
|
118
|
-
_context4.next = 5;
|
|
119
|
-
break;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
throw new Error('Could not find tab element');
|
|
123
|
-
|
|
124
|
-
case 5:
|
|
125
|
-
_react2.fireEvent.click(tab2);
|
|
126
|
-
|
|
127
|
-
_context4.next = 8;
|
|
128
|
-
return controls.time( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
129
|
-
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
130
|
-
while (1) {
|
|
131
|
-
switch (_context3.prev = _context3.next) {
|
|
132
|
-
case 0:
|
|
133
|
-
_react2.fireEvent.click(tab1);
|
|
134
|
-
|
|
135
|
-
case 1:
|
|
136
|
-
case "end":
|
|
137
|
-
return _context3.stop();
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}, _callee3);
|
|
141
|
-
})));
|
|
142
|
-
|
|
143
|
-
case 8:
|
|
144
|
-
case "end":
|
|
145
|
-
return _context4.stop();
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}, _callee4);
|
|
149
|
-
}));
|
|
150
|
-
|
|
151
|
-
function run(_x2) {
|
|
152
|
-
return _run2.apply(this, arguments);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
return run;
|
|
156
|
-
}()
|
|
157
|
-
}];
|
|
158
|
-
|
|
159
|
-
function HeavyContent(_ref5) {
|
|
160
|
-
var text = _ref5.text;
|
|
161
|
-
return /*#__PURE__*/_react.default.createElement("div", null, Array(100).fill(undefined).map(function () {
|
|
162
|
-
return /*#__PURE__*/_react.default.createElement("div", null, text);
|
|
163
|
-
}));
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
function HeavyPanelPerformanceComponent() {
|
|
167
|
-
return /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
168
|
-
id: "heavy"
|
|
169
|
-
}, /*#__PURE__*/_react.default.createElement(_index.TabList, null, /*#__PURE__*/_react.default.createElement(_index.Tab, {
|
|
170
|
-
testId: "tab1"
|
|
171
|
-
}, "Tab 1"), /*#__PURE__*/_react.default.createElement(_index.Tab, {
|
|
172
|
-
testId: "tab2"
|
|
173
|
-
}, "Tab 2"), /*#__PURE__*/_react.default.createElement(_index.Tab, null, "Tab 3"), /*#__PURE__*/_react.default.createElement(_index.Tab, null, "Tab 4")), /*#__PURE__*/_react.default.createElement(_index.TabPanel, null, /*#__PURE__*/_react.default.createElement(HeavyContent, {
|
|
174
|
-
text: "One"
|
|
175
|
-
})), /*#__PURE__*/_react.default.createElement(_index.TabPanel, null, /*#__PURE__*/_react.default.createElement(HeavyContent, {
|
|
176
|
-
text: "Two"
|
|
177
|
-
})), /*#__PURE__*/_react.default.createElement(_index.TabPanel, null, /*#__PURE__*/_react.default.createElement(HeavyContent, {
|
|
178
|
-
text: "Three"
|
|
179
|
-
})), /*#__PURE__*/_react.default.createElement(_index.TabPanel, null, /*#__PURE__*/_react.default.createElement(HeavyContent, {
|
|
180
|
-
text: "Four"
|
|
181
|
-
})));
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
var heavyPerformance = function heavyPerformance() {
|
|
185
|
-
return /*#__PURE__*/_react.default.createElement(HeavyPanelPerformanceComponent, null);
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
exports.heavyPerformance = heavyPerformance;
|
|
189
|
-
heavyPerformance.story = {
|
|
190
|
-
name: 'Performance with heavy panels',
|
|
191
|
-
parameters: {
|
|
192
|
-
performance: {
|
|
193
|
-
interactions: heavyInteractionTasks
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
};
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import React from 'react'; // eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
|
-
|
|
3
|
-
import { fireEvent } from '@testing-library/react';
|
|
4
|
-
import Tabs, { Tab, TabList, TabPanel } from '../index';
|
|
5
|
-
const interactionTasks = [{
|
|
6
|
-
name: 'Change tabs',
|
|
7
|
-
description: 'Change tabs',
|
|
8
|
-
run: async ({
|
|
9
|
-
container,
|
|
10
|
-
controls
|
|
11
|
-
}) => {
|
|
12
|
-
const tab2 = container.querySelector('div[data-testid="tab2"]');
|
|
13
|
-
|
|
14
|
-
if (tab2 == null) {
|
|
15
|
-
throw new Error('Could not find tab element');
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
await controls.time(async () => {
|
|
19
|
-
fireEvent.click(tab2);
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
}];
|
|
23
|
-
|
|
24
|
-
function PerformanceComponent() {
|
|
25
|
-
return /*#__PURE__*/React.createElement(Tabs, {
|
|
26
|
-
id: "test"
|
|
27
|
-
}, /*#__PURE__*/React.createElement(TabList, null, /*#__PURE__*/React.createElement(Tab, {
|
|
28
|
-
testId: "tab1"
|
|
29
|
-
}, "Tab 1"), /*#__PURE__*/React.createElement(Tab, {
|
|
30
|
-
testId: "tab2"
|
|
31
|
-
}, "Tab 2"), /*#__PURE__*/React.createElement(Tab, null, "Tab 3"), /*#__PURE__*/React.createElement(Tab, null, "Tab 4")), /*#__PURE__*/React.createElement(TabPanel, null, "One"), /*#__PURE__*/React.createElement(TabPanel, null, "Two"), /*#__PURE__*/React.createElement(TabPanel, null, "Three"), /*#__PURE__*/React.createElement(TabPanel, null, "Four"));
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export const performance = () => /*#__PURE__*/React.createElement(PerformanceComponent, null);
|
|
35
|
-
performance.story = {
|
|
36
|
-
name: 'Performance',
|
|
37
|
-
parameters: {
|
|
38
|
-
performance: {
|
|
39
|
-
interactions: interactionTasks
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
const heavyInteractionTasks = [{
|
|
44
|
-
name: 'Change tabs twice',
|
|
45
|
-
description: 'Change tabs twice',
|
|
46
|
-
run: async ({
|
|
47
|
-
container,
|
|
48
|
-
controls
|
|
49
|
-
}) => {
|
|
50
|
-
const tab1 = container.querySelector('div[data-testid="tab1"]');
|
|
51
|
-
const tab2 = container.querySelector('div[data-testid="tab2"]');
|
|
52
|
-
|
|
53
|
-
if (tab1 === null || tab2 === null) {
|
|
54
|
-
throw new Error('Could not find tab element');
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
fireEvent.click(tab2);
|
|
58
|
-
await controls.time(async () => {
|
|
59
|
-
fireEvent.click(tab1);
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}];
|
|
63
|
-
|
|
64
|
-
function HeavyContent({
|
|
65
|
-
text
|
|
66
|
-
}) {
|
|
67
|
-
return /*#__PURE__*/React.createElement("div", null, Array(100).fill(undefined).map(() => /*#__PURE__*/React.createElement("div", null, text)));
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function HeavyPanelPerformanceComponent() {
|
|
71
|
-
return /*#__PURE__*/React.createElement(Tabs, {
|
|
72
|
-
id: "heavy"
|
|
73
|
-
}, /*#__PURE__*/React.createElement(TabList, null, /*#__PURE__*/React.createElement(Tab, {
|
|
74
|
-
testId: "tab1"
|
|
75
|
-
}, "Tab 1"), /*#__PURE__*/React.createElement(Tab, {
|
|
76
|
-
testId: "tab2"
|
|
77
|
-
}, "Tab 2"), /*#__PURE__*/React.createElement(Tab, null, "Tab 3"), /*#__PURE__*/React.createElement(Tab, null, "Tab 4")), /*#__PURE__*/React.createElement(TabPanel, null, /*#__PURE__*/React.createElement(HeavyContent, {
|
|
78
|
-
text: "One"
|
|
79
|
-
})), /*#__PURE__*/React.createElement(TabPanel, null, /*#__PURE__*/React.createElement(HeavyContent, {
|
|
80
|
-
text: "Two"
|
|
81
|
-
})), /*#__PURE__*/React.createElement(TabPanel, null, /*#__PURE__*/React.createElement(HeavyContent, {
|
|
82
|
-
text: "Three"
|
|
83
|
-
})), /*#__PURE__*/React.createElement(TabPanel, null, /*#__PURE__*/React.createElement(HeavyContent, {
|
|
84
|
-
text: "Four"
|
|
85
|
-
})));
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export const heavyPerformance = () => /*#__PURE__*/React.createElement(HeavyPanelPerformanceComponent, null);
|
|
89
|
-
heavyPerformance.story = {
|
|
90
|
-
name: 'Performance with heavy panels',
|
|
91
|
-
parameters: {
|
|
92
|
-
performance: {
|
|
93
|
-
interactions: heavyInteractionTasks
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
};
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
-
import React from 'react'; // eslint-disable-next-line import/no-extraneous-dependencies
|
|
4
|
-
|
|
5
|
-
import { fireEvent } from '@testing-library/react';
|
|
6
|
-
import Tabs, { Tab, TabList, TabPanel } from '../index';
|
|
7
|
-
var interactionTasks = [{
|
|
8
|
-
name: 'Change tabs',
|
|
9
|
-
description: 'Change tabs',
|
|
10
|
-
run: function () {
|
|
11
|
-
var _run = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref) {
|
|
12
|
-
var container, controls, tab2;
|
|
13
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
14
|
-
while (1) {
|
|
15
|
-
switch (_context2.prev = _context2.next) {
|
|
16
|
-
case 0:
|
|
17
|
-
container = _ref.container, controls = _ref.controls;
|
|
18
|
-
tab2 = container.querySelector('div[data-testid="tab2"]');
|
|
19
|
-
|
|
20
|
-
if (!(tab2 == null)) {
|
|
21
|
-
_context2.next = 4;
|
|
22
|
-
break;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
throw new Error('Could not find tab element');
|
|
26
|
-
|
|
27
|
-
case 4:
|
|
28
|
-
_context2.next = 6;
|
|
29
|
-
return controls.time( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
30
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
31
|
-
while (1) {
|
|
32
|
-
switch (_context.prev = _context.next) {
|
|
33
|
-
case 0:
|
|
34
|
-
fireEvent.click(tab2);
|
|
35
|
-
|
|
36
|
-
case 1:
|
|
37
|
-
case "end":
|
|
38
|
-
return _context.stop();
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}, _callee);
|
|
42
|
-
})));
|
|
43
|
-
|
|
44
|
-
case 6:
|
|
45
|
-
case "end":
|
|
46
|
-
return _context2.stop();
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}, _callee2);
|
|
50
|
-
}));
|
|
51
|
-
|
|
52
|
-
function run(_x) {
|
|
53
|
-
return _run.apply(this, arguments);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return run;
|
|
57
|
-
}()
|
|
58
|
-
}];
|
|
59
|
-
|
|
60
|
-
function PerformanceComponent() {
|
|
61
|
-
return /*#__PURE__*/React.createElement(Tabs, {
|
|
62
|
-
id: "test"
|
|
63
|
-
}, /*#__PURE__*/React.createElement(TabList, null, /*#__PURE__*/React.createElement(Tab, {
|
|
64
|
-
testId: "tab1"
|
|
65
|
-
}, "Tab 1"), /*#__PURE__*/React.createElement(Tab, {
|
|
66
|
-
testId: "tab2"
|
|
67
|
-
}, "Tab 2"), /*#__PURE__*/React.createElement(Tab, null, "Tab 3"), /*#__PURE__*/React.createElement(Tab, null, "Tab 4")), /*#__PURE__*/React.createElement(TabPanel, null, "One"), /*#__PURE__*/React.createElement(TabPanel, null, "Two"), /*#__PURE__*/React.createElement(TabPanel, null, "Three"), /*#__PURE__*/React.createElement(TabPanel, null, "Four"));
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export var performance = function performance() {
|
|
71
|
-
return /*#__PURE__*/React.createElement(PerformanceComponent, null);
|
|
72
|
-
};
|
|
73
|
-
performance.story = {
|
|
74
|
-
name: 'Performance',
|
|
75
|
-
parameters: {
|
|
76
|
-
performance: {
|
|
77
|
-
interactions: interactionTasks
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
var heavyInteractionTasks = [{
|
|
82
|
-
name: 'Change tabs twice',
|
|
83
|
-
description: 'Change tabs twice',
|
|
84
|
-
run: function () {
|
|
85
|
-
var _run2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref3) {
|
|
86
|
-
var container, controls, tab1, tab2;
|
|
87
|
-
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
88
|
-
while (1) {
|
|
89
|
-
switch (_context4.prev = _context4.next) {
|
|
90
|
-
case 0:
|
|
91
|
-
container = _ref3.container, controls = _ref3.controls;
|
|
92
|
-
tab1 = container.querySelector('div[data-testid="tab1"]');
|
|
93
|
-
tab2 = container.querySelector('div[data-testid="tab2"]');
|
|
94
|
-
|
|
95
|
-
if (!(tab1 === null || tab2 === null)) {
|
|
96
|
-
_context4.next = 5;
|
|
97
|
-
break;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
throw new Error('Could not find tab element');
|
|
101
|
-
|
|
102
|
-
case 5:
|
|
103
|
-
fireEvent.click(tab2);
|
|
104
|
-
_context4.next = 8;
|
|
105
|
-
return controls.time( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
106
|
-
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
107
|
-
while (1) {
|
|
108
|
-
switch (_context3.prev = _context3.next) {
|
|
109
|
-
case 0:
|
|
110
|
-
fireEvent.click(tab1);
|
|
111
|
-
|
|
112
|
-
case 1:
|
|
113
|
-
case "end":
|
|
114
|
-
return _context3.stop();
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}, _callee3);
|
|
118
|
-
})));
|
|
119
|
-
|
|
120
|
-
case 8:
|
|
121
|
-
case "end":
|
|
122
|
-
return _context4.stop();
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}, _callee4);
|
|
126
|
-
}));
|
|
127
|
-
|
|
128
|
-
function run(_x2) {
|
|
129
|
-
return _run2.apply(this, arguments);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
return run;
|
|
133
|
-
}()
|
|
134
|
-
}];
|
|
135
|
-
|
|
136
|
-
function HeavyContent(_ref5) {
|
|
137
|
-
var text = _ref5.text;
|
|
138
|
-
return /*#__PURE__*/React.createElement("div", null, Array(100).fill(undefined).map(function () {
|
|
139
|
-
return /*#__PURE__*/React.createElement("div", null, text);
|
|
140
|
-
}));
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
function HeavyPanelPerformanceComponent() {
|
|
144
|
-
return /*#__PURE__*/React.createElement(Tabs, {
|
|
145
|
-
id: "heavy"
|
|
146
|
-
}, /*#__PURE__*/React.createElement(TabList, null, /*#__PURE__*/React.createElement(Tab, {
|
|
147
|
-
testId: "tab1"
|
|
148
|
-
}, "Tab 1"), /*#__PURE__*/React.createElement(Tab, {
|
|
149
|
-
testId: "tab2"
|
|
150
|
-
}, "Tab 2"), /*#__PURE__*/React.createElement(Tab, null, "Tab 3"), /*#__PURE__*/React.createElement(Tab, null, "Tab 4")), /*#__PURE__*/React.createElement(TabPanel, null, /*#__PURE__*/React.createElement(HeavyContent, {
|
|
151
|
-
text: "One"
|
|
152
|
-
})), /*#__PURE__*/React.createElement(TabPanel, null, /*#__PURE__*/React.createElement(HeavyContent, {
|
|
153
|
-
text: "Two"
|
|
154
|
-
})), /*#__PURE__*/React.createElement(TabPanel, null, /*#__PURE__*/React.createElement(HeavyContent, {
|
|
155
|
-
text: "Three"
|
|
156
|
-
})), /*#__PURE__*/React.createElement(TabPanel, null, /*#__PURE__*/React.createElement(HeavyContent, {
|
|
157
|
-
text: "Four"
|
|
158
|
-
})));
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export var heavyPerformance = function heavyPerformance() {
|
|
162
|
-
return /*#__PURE__*/React.createElement(HeavyPanelPerformanceComponent, null);
|
|
163
|
-
};
|
|
164
|
-
heavyPerformance.story = {
|
|
165
|
-
name: 'Performance with heavy panels',
|
|
166
|
-
parameters: {
|
|
167
|
-
performance: {
|
|
168
|
-
interactions: heavyInteractionTasks
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
};
|