@spectrum-web-components/tabs 0.9.0-devmode.0 → 0.9.0
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/package.json +5 -5
- package/sp-tab-panel.js +1 -2
- package/sp-tab-panel.js.map +1 -1
- package/sp-tab.js +1 -2
- package/sp-tab.js.map +1 -1
- package/sp-tabs.js +1 -2
- package/sp-tabs.js.map +1 -1
- package/src/Tab.js +5 -96
- package/src/Tab.js.map +1 -1
- package/src/TabPanel.js +2 -56
- package/src/TabPanel.js.map +1 -1
- package/src/Tabs.js +4 -287
- package/src/Tabs.js.map +1 -1
- package/src/index.js +1 -3
- package/src/index.js.map +1 -1
- package/src/spectrum-tab.css.js +2 -4
- package/src/spectrum-tab.css.js.map +1 -1
- package/src/spectrum-tabs.css.js +2 -4
- package/src/spectrum-tabs.css.js.map +1 -1
- package/src/tab-panel.css.js +2 -4
- package/src/tab-panel.css.js.map +1 -1
- package/src/tab.css.js +2 -4
- package/src/tab.css.js.map +1 -1
- package/src/tabs.css.js +2 -4
- package/src/tabs.css.js.map +1 -1
- package/stories/tabs-horizontal-sizes.stories.js +7 -76
- package/stories/tabs-horizontal-sizes.stories.js.map +1 -1
- package/stories/tabs-vertical-right-sizes.stories.js +7 -73
- package/stories/tabs-vertical-right-sizes.stories.js.map +1 -1
- package/stories/tabs-vertical-sizes.stories.js +7 -73
- package/stories/tabs-vertical-sizes.stories.js.map +1 -1
- package/stories/tabs.stories.js +75 -196
- package/stories/tabs.stories.js.map +1 -1
- package/test/benchmark/basic-test.js +1 -5
- package/test/benchmark/basic-test.js.map +1 -1
- package/test/tab.test.js +4 -26
- package/test/tab.test.js.map +1 -1
- package/test/tabs-horizontal-sizes.test-vrt.js +1 -3
- package/test/tabs-horizontal-sizes.test-vrt.js.map +1 -1
- package/test/tabs-vertical-right-sizes.test-vrt.js +1 -3
- package/test/tabs-vertical-right-sizes.test-vrt.js.map +1 -1
- package/test/tabs-vertical-sizes.test-vrt.js +1 -3
- package/test/tabs-vertical-sizes.test-vrt.js.map +1 -1
- package/test/tabs.test-vrt.js +1 -3
- package/test/tabs.test-vrt.js.map +1 -1
- package/test/tabs.test.js +17 -396
- package/test/tabs.test.js.map +1 -1
package/stories/tabs.stories.js
CHANGED
|
@@ -1,48 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "@spectrum-web-components/icons-workflow/icons/sp-icon-checkmark.js";
|
|
3
|
-
import "@spectrum-web-components/icons-workflow/icons/sp-icon-close.js";
|
|
4
|
-
import "@spectrum-web-components/icons-workflow/icons/sp-icon-chevron-down.js";
|
|
5
|
-
import "@spectrum-web-components/icons-workflow/icons/sp-icon-help.js";
|
|
6
|
-
import "@spectrum-web-components/tabs/sp-tabs.js";
|
|
7
|
-
import "@spectrum-web-components/tabs/sp-tab.js";
|
|
8
|
-
import "@spectrum-web-components/tabs/sp-tab-panel.js";
|
|
9
|
-
import { html } from "@spectrum-web-components/base";
|
|
10
|
-
export default {
|
|
11
|
-
component: "sp-tabs",
|
|
12
|
-
title: "Tabs",
|
|
13
|
-
argTypes: {
|
|
14
|
-
direction: {
|
|
15
|
-
name: "direction",
|
|
16
|
-
type: { name: "string", required: false },
|
|
17
|
-
description: "The direction of the Tabs element",
|
|
18
|
-
table: {
|
|
19
|
-
type: {
|
|
20
|
-
summary: '"vertical" | "vertical-right" | "horizontal"'
|
|
21
|
-
},
|
|
22
|
-
defaultValue: { summary: "horizontal" }
|
|
23
|
-
},
|
|
24
|
-
control: {
|
|
25
|
-
type: "text"
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
verticalTab: { control: "boolean" },
|
|
29
|
-
auto: { control: "boolean" }
|
|
30
|
-
},
|
|
31
|
-
args: {
|
|
32
|
-
direction: "horizontal",
|
|
33
|
-
type: false,
|
|
34
|
-
verticalTab: false,
|
|
35
|
-
auto: false
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
const panels = () => html`
|
|
1
|
+
import"@spectrum-web-components/icon/sp-icon.js";import"@spectrum-web-components/icons-workflow/icons/sp-icon-checkmark.js";import"@spectrum-web-components/icons-workflow/icons/sp-icon-close.js";import"@spectrum-web-components/icons-workflow/icons/sp-icon-chevron-down.js";import"@spectrum-web-components/icons-workflow/icons/sp-icon-help.js";import"@spectrum-web-components/tabs/sp-tabs.js";import"@spectrum-web-components/tabs/sp-tab.js";import"@spectrum-web-components/tabs/sp-tab-panel.js";import{html as t}from"@spectrum-web-components/base";export default{component:"sp-tabs",title:"Tabs",argTypes:{direction:{name:"direction",type:{name:"string",required:!1},description:"The direction of the Tabs element",table:{type:{summary:'"vertical" | "vertical-right" | "horizontal"'},defaultValue:{summary:"horizontal"}},control:{type:"text"}},verticalTab:{control:"boolean"},auto:{control:"boolean"}},args:{direction:"horizontal",type:!1,verticalTab:!1,auto:!1}};const s=()=>t`
|
|
39
2
|
<sp-tab-panel value="1">Content for "Really Long Name"</sp-tab-panel>
|
|
40
3
|
<sp-tab-panel value="2">Content for tab 2</sp-tab-panel>
|
|
41
4
|
<sp-tab-panel value="3">Content for tab 3</sp-tab-panel>
|
|
42
5
|
<sp-tab-panel value="4">Content for tab 4</sp-tab-panel>
|
|
43
|
-
`;
|
|
44
|
-
export const Default = (args) => {
|
|
45
|
-
return html`
|
|
6
|
+
`;export const Default=a=>t`
|
|
46
7
|
<style>
|
|
47
8
|
sp-tabs {
|
|
48
9
|
display: grid;
|
|
@@ -77,117 +38,93 @@ export const Default = (args) => {
|
|
|
77
38
|
</style>
|
|
78
39
|
<sp-tabs
|
|
79
40
|
selected="1"
|
|
80
|
-
?auto=${
|
|
41
|
+
?auto=${a.auto}
|
|
81
42
|
label="Demo Tabs"
|
|
82
|
-
direction=${
|
|
43
|
+
direction=${a.direction}
|
|
83
44
|
>
|
|
84
45
|
<sp-tab value="2">Tab 2</sp-tab>
|
|
85
46
|
<sp-tab value="3">Tab 3</sp-tab>
|
|
86
47
|
<sp-tab value="4">Tab 4</sp-tab>
|
|
87
48
|
<sp-tab value="1" selected>Really Long Name</sp-tab>
|
|
88
|
-
${
|
|
49
|
+
${s()}
|
|
89
50
|
</sp-tabs>
|
|
90
|
-
|
|
91
|
-
};
|
|
92
|
-
export const Autofocus = (args) => {
|
|
93
|
-
return html`
|
|
51
|
+
`,Autofocus=a=>t`
|
|
94
52
|
<sp-tabs
|
|
95
53
|
selected="1"
|
|
96
54
|
autofocus
|
|
97
|
-
?auto=${
|
|
55
|
+
?auto=${a.auto}
|
|
98
56
|
label="Demo Tabs"
|
|
99
|
-
direction=${
|
|
57
|
+
direction=${a.direction}
|
|
100
58
|
>
|
|
101
59
|
<sp-tab label="Tab 1" value="1"></sp-tab>
|
|
102
60
|
<sp-tab label="Tab 2" value="2"></sp-tab>
|
|
103
61
|
<sp-tab label="Tab 3" value="3"></sp-tab>
|
|
104
62
|
<sp-tab label="Tab 4" value="4"></sp-tab>
|
|
105
|
-
${
|
|
63
|
+
${s()}
|
|
106
64
|
</sp-tabs>
|
|
107
|
-
|
|
108
|
-
};
|
|
109
|
-
export const disabledTabs = (args) => {
|
|
110
|
-
return html`
|
|
65
|
+
`,disabledTabs=a=>t`
|
|
111
66
|
<sp-tabs
|
|
112
67
|
selected="1"
|
|
113
68
|
disabled
|
|
114
|
-
?auto=${
|
|
69
|
+
?auto=${a.auto}
|
|
115
70
|
label="Disabled Tabs"
|
|
116
|
-
direction=${
|
|
71
|
+
direction=${a.direction}
|
|
117
72
|
>
|
|
118
73
|
<sp-tab label="Tab 1" value="1"></sp-tab>
|
|
119
74
|
<sp-tab label="Tab 2" value="2"></sp-tab>
|
|
120
75
|
<sp-tab label="Tab 3" value="3"></sp-tab>
|
|
121
76
|
<sp-tab label="Tab 4" value="4"></sp-tab>
|
|
122
|
-
${
|
|
77
|
+
${s()}
|
|
123
78
|
</sp-tabs>
|
|
124
|
-
|
|
125
|
-
};
|
|
126
|
-
export const disabledTab = (args) => {
|
|
127
|
-
return html`
|
|
79
|
+
`,disabledTab=a=>t`
|
|
128
80
|
<sp-tabs
|
|
129
81
|
selected="1"
|
|
130
|
-
?auto=${
|
|
82
|
+
?auto=${a.auto}
|
|
131
83
|
label="Disabled Tab"
|
|
132
|
-
direction=${
|
|
84
|
+
direction=${a.direction}
|
|
133
85
|
>
|
|
134
86
|
<sp-tab label="Tab 1" value="1"></sp-tab>
|
|
135
87
|
<sp-tab label="Tab 2" value="2" disabled></sp-tab>
|
|
136
88
|
<sp-tab label="Tab 3" value="3" disabled></sp-tab>
|
|
137
89
|
<sp-tab label="Tab 4" value="4"></sp-tab>
|
|
138
|
-
${
|
|
90
|
+
${s()}
|
|
139
91
|
</sp-tabs>
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
export const emphasized = (args) => {
|
|
143
|
-
return html`
|
|
144
|
-
<sp-tabs selected="1" emphasized ?auto=${args.auto} label="Demo Tabs">
|
|
92
|
+
`,emphasized=a=>t`
|
|
93
|
+
<sp-tabs selected="1" emphasized ?auto=${a.auto} label="Demo Tabs">
|
|
145
94
|
<sp-tab label="Tab 1" value="1"></sp-tab>
|
|
146
95
|
<sp-tab label="Tab 2" value="2"></sp-tab>
|
|
147
96
|
<sp-tab label="Tab 3" value="3"></sp-tab>
|
|
148
97
|
<sp-tab label="Tab 4" value="4"></sp-tab>
|
|
149
|
-
${
|
|
98
|
+
${s()}
|
|
150
99
|
</sp-tabs>
|
|
151
|
-
|
|
152
|
-
};
|
|
153
|
-
export const emphasizedQuiet = (args) => {
|
|
154
|
-
return html`
|
|
100
|
+
`,emphasizedQuiet=a=>t`
|
|
155
101
|
<sp-tabs
|
|
156
102
|
selected="1"
|
|
157
103
|
emphasized
|
|
158
104
|
quiet
|
|
159
|
-
?auto=${
|
|
105
|
+
?auto=${a.auto}
|
|
160
106
|
label="Demo Tabs"
|
|
161
107
|
>
|
|
162
108
|
<sp-tab label="Tab 1" value="1"></sp-tab>
|
|
163
109
|
<sp-tab label="Tab 2" value="2"></sp-tab>
|
|
164
110
|
<sp-tab label="Tab 3" value="3"></sp-tab>
|
|
165
111
|
<sp-tab label="Tab 4" value="4"></sp-tab>
|
|
166
|
-
${
|
|
112
|
+
${s()}
|
|
167
113
|
</sp-tabs>
|
|
168
|
-
|
|
169
|
-
};
|
|
170
|
-
export const Vertical = (args) => {
|
|
171
|
-
return html`
|
|
114
|
+
`,Vertical=a=>t`
|
|
172
115
|
<sp-tabs
|
|
173
116
|
selected="1"
|
|
174
|
-
direction=${
|
|
175
|
-
?auto=${
|
|
117
|
+
direction=${a.direction}
|
|
118
|
+
?auto=${a.auto}
|
|
176
119
|
label="Demo Tabs"
|
|
177
120
|
>
|
|
178
121
|
<sp-tab label="Tab 1" value="1"></sp-tab>
|
|
179
122
|
<sp-tab label="Tab 2" value="2"></sp-tab>
|
|
180
123
|
<sp-tab label="Tab 3" value="3"></sp-tab>
|
|
181
124
|
<sp-tab label="Tab 4" value="4"></sp-tab>
|
|
182
|
-
${
|
|
125
|
+
${s()}
|
|
183
126
|
</sp-tabs>
|
|
184
|
-
`;
|
|
185
|
-
};
|
|
186
|
-
Vertical.args = {
|
|
187
|
-
direction: "vertical"
|
|
188
|
-
};
|
|
189
|
-
export const VerticalSized = (args) => {
|
|
190
|
-
return html`
|
|
127
|
+
`;Vertical.args={direction:"vertical"};export const VerticalSized=a=>t`
|
|
191
128
|
<style>
|
|
192
129
|
sp-tabs {
|
|
193
130
|
height: 75vh;
|
|
@@ -196,23 +133,17 @@ export const VerticalSized = (args) => {
|
|
|
196
133
|
</style>
|
|
197
134
|
<sp-tabs
|
|
198
135
|
selected="1"
|
|
199
|
-
direction=${
|
|
200
|
-
?auto=${
|
|
136
|
+
direction=${a.direction}
|
|
137
|
+
?auto=${a.auto}
|
|
201
138
|
label="Demo Tabs"
|
|
202
139
|
>
|
|
203
140
|
<sp-tab label="Tab 1" value="1"></sp-tab>
|
|
204
141
|
<sp-tab label="Tab 2" value="2"></sp-tab>
|
|
205
142
|
<sp-tab label="Tab 3" value="3"></sp-tab>
|
|
206
143
|
<sp-tab label="Tab 4" value="4"></sp-tab>
|
|
207
|
-
${
|
|
144
|
+
${s()}
|
|
208
145
|
</sp-tabs>
|
|
209
|
-
`;
|
|
210
|
-
};
|
|
211
|
-
VerticalSized.args = {
|
|
212
|
-
direction: "vertical"
|
|
213
|
-
};
|
|
214
|
-
export const VerticalRight = (args) => {
|
|
215
|
-
return html`
|
|
146
|
+
`;VerticalSized.args={direction:"vertical"};export const VerticalRight=a=>t`
|
|
216
147
|
<style>
|
|
217
148
|
sp-tabs {
|
|
218
149
|
height: 75vh;
|
|
@@ -221,100 +152,73 @@ export const VerticalRight = (args) => {
|
|
|
221
152
|
</style>
|
|
222
153
|
<sp-tabs
|
|
223
154
|
selected="1"
|
|
224
|
-
direction=${
|
|
225
|
-
?auto=${
|
|
155
|
+
direction=${a.direction}
|
|
156
|
+
?auto=${a.auto}
|
|
226
157
|
label="Demo Tabs"
|
|
227
158
|
>
|
|
228
159
|
<sp-tab label="Tab 1" value="1"></sp-tab>
|
|
229
160
|
<sp-tab label="Tab 2" value="2"></sp-tab>
|
|
230
161
|
<sp-tab label="Tab 3" value="3"></sp-tab>
|
|
231
162
|
<sp-tab label="Tab 4" value="4"></sp-tab>
|
|
232
|
-
${
|
|
163
|
+
${s()}
|
|
233
164
|
</sp-tabs>
|
|
234
|
-
`;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
direction: "vertical-right"
|
|
238
|
-
};
|
|
239
|
-
export const Icons = ({
|
|
240
|
-
direction,
|
|
241
|
-
verticalTab,
|
|
242
|
-
auto
|
|
243
|
-
}) => {
|
|
244
|
-
return html`
|
|
245
|
-
<sp-tabs selected="1" direction=${direction} ?auto=${auto}>
|
|
246
|
-
<sp-tab label="Tab 1" value="1" ?vertical=${verticalTab}>
|
|
165
|
+
`;VerticalRight.args={direction:"vertical-right"};export const Icons=({direction:a,verticalTab:e,auto:l})=>t`
|
|
166
|
+
<sp-tabs selected="1" direction=${a} ?auto=${l}>
|
|
167
|
+
<sp-tab label="Tab 1" value="1" ?vertical=${e}>
|
|
247
168
|
<sp-icon-checkmark slot="icon"></sp-icon-checkmark>
|
|
248
169
|
</sp-tab>
|
|
249
|
-
<sp-tab label="Tab 2" value="2" ?vertical=${
|
|
170
|
+
<sp-tab label="Tab 2" value="2" ?vertical=${e}>
|
|
250
171
|
<sp-icon-close slot="icon"></sp-icon-close>
|
|
251
172
|
</sp-tab>
|
|
252
|
-
<sp-tab label="Tab 3" value="3" ?vertical=${
|
|
173
|
+
<sp-tab label="Tab 3" value="3" ?vertical=${e}>
|
|
253
174
|
<sp-icon-chevron-down slot="icon"></sp-icon-chevron-down>
|
|
254
175
|
</sp-tab>
|
|
255
|
-
<sp-tab label="Tab 4" value="4" ?vertical=${
|
|
176
|
+
<sp-tab label="Tab 4" value="4" ?vertical=${e}>
|
|
256
177
|
<sp-icon-help slot="icon"></sp-icon-help>
|
|
257
178
|
</sp-tab>
|
|
258
|
-
${
|
|
179
|
+
${s()}
|
|
259
180
|
</sp-tabs>
|
|
260
|
-
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
direction,
|
|
264
|
-
verticalTab,
|
|
265
|
-
auto
|
|
266
|
-
}) => {
|
|
267
|
-
return html`
|
|
268
|
-
<sp-tabs selected="1" direction=${direction} ?auto=${auto}>
|
|
269
|
-
<sp-tab value="1" ?vertical=${verticalTab}>
|
|
181
|
+
`,IconsWithSlottedLabel=({direction:a,verticalTab:e,auto:l})=>t`
|
|
182
|
+
<sp-tabs selected="1" direction=${a} ?auto=${l}>
|
|
183
|
+
<sp-tab value="1" ?vertical=${e}>
|
|
270
184
|
Tab 1
|
|
271
185
|
<sp-icon-checkmark slot="icon"></sp-icon-checkmark>
|
|
272
186
|
</sp-tab>
|
|
273
|
-
<sp-tab value="2" ?vertical=${
|
|
187
|
+
<sp-tab value="2" ?vertical=${e}>
|
|
274
188
|
Tab 2
|
|
275
189
|
<sp-icon-close slot="icon"></sp-icon-close>
|
|
276
190
|
</sp-tab>
|
|
277
|
-
<sp-tab value="3" ?vertical=${
|
|
191
|
+
<sp-tab value="3" ?vertical=${e}>
|
|
278
192
|
Tab 3
|
|
279
193
|
<sp-icon-chevron-down slot="icon"></sp-icon-chevron-down>
|
|
280
194
|
</sp-tab>
|
|
281
|
-
<sp-tab value="4" ?vertical=${
|
|
195
|
+
<sp-tab value="4" ?vertical=${e}>
|
|
282
196
|
Tab 4
|
|
283
197
|
<sp-icon-help slot="icon"></sp-icon-help>
|
|
284
198
|
</sp-tab>
|
|
285
|
-
${
|
|
199
|
+
${s()}
|
|
286
200
|
</sp-tabs>
|
|
287
|
-
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
direction,
|
|
291
|
-
verticalTab,
|
|
292
|
-
auto
|
|
293
|
-
}) => {
|
|
294
|
-
return html`
|
|
295
|
-
<sp-tabs selected="1" direction=${direction} ?auto=${auto}>
|
|
296
|
-
<sp-tab aria-label="Tab 1" value="1" ?vertical=${verticalTab}>
|
|
201
|
+
`,IconsOnly=({direction:a,verticalTab:e,auto:l})=>t`
|
|
202
|
+
<sp-tabs selected="1" direction=${a} ?auto=${l}>
|
|
203
|
+
<sp-tab aria-label="Tab 1" value="1" ?vertical=${e}>
|
|
297
204
|
<sp-icon-checkmark slot="icon"></sp-icon-checkmark>
|
|
298
205
|
</sp-tab>
|
|
299
|
-
<sp-tab aria-label="Tab 2" value="2" ?vertical=${
|
|
206
|
+
<sp-tab aria-label="Tab 2" value="2" ?vertical=${e}>
|
|
300
207
|
<sp-icon-close slot="icon"></sp-icon-close>
|
|
301
208
|
</sp-tab>
|
|
302
|
-
<sp-tab aria-label="Tab 3" value="3" ?vertical=${
|
|
209
|
+
<sp-tab aria-label="Tab 3" value="3" ?vertical=${e}>
|
|
303
210
|
<sp-icon-chevron-down slot="icon"></sp-icon-chevron-down>
|
|
304
211
|
</sp-tab>
|
|
305
|
-
<sp-tab aria-label="Tab 4" value="4" ?vertical=${
|
|
212
|
+
<sp-tab aria-label="Tab 4" value="4" ?vertical=${e}>
|
|
306
213
|
<sp-icon-help slot="icon"></sp-icon-help>
|
|
307
214
|
</sp-tab>
|
|
308
|
-
${
|
|
215
|
+
${s()}
|
|
309
216
|
</sp-tabs>
|
|
310
|
-
|
|
311
|
-
};
|
|
312
|
-
export const iconsIi = (args) => {
|
|
313
|
-
return html`
|
|
217
|
+
`,iconsIi=a=>t`
|
|
314
218
|
<sp-tabs
|
|
315
219
|
selected="1"
|
|
316
|
-
direction=${
|
|
317
|
-
?auto=${
|
|
220
|
+
direction=${a.direction}
|
|
221
|
+
?auto=${a.auto}
|
|
318
222
|
label="Demo Tabs"
|
|
319
223
|
>
|
|
320
224
|
<sp-tab label="Tab 1" value="1" vertical>
|
|
@@ -329,20 +233,13 @@ export const iconsIi = (args) => {
|
|
|
329
233
|
<sp-tab label="Tab 4" value="4" vertical>
|
|
330
234
|
<sp-icon-help slot="icon"></sp-icon-help>
|
|
331
235
|
</sp-tab>
|
|
332
|
-
${
|
|
236
|
+
${s()}
|
|
333
237
|
</sp-tabs>
|
|
334
|
-
`;
|
|
335
|
-
};
|
|
336
|
-
iconsIi.args = {
|
|
337
|
-
direction: "vertical"
|
|
338
|
-
};
|
|
339
|
-
iconsIi.storyName = "Icons II";
|
|
340
|
-
export const iconsIii = (args) => {
|
|
341
|
-
return html`
|
|
238
|
+
`;iconsIi.args={direction:"vertical"},iconsIi.storyName="Icons II";export const iconsIii=a=>t`
|
|
342
239
|
<sp-tabs
|
|
343
240
|
selected="1"
|
|
344
|
-
direction=${
|
|
345
|
-
?auto=${
|
|
241
|
+
direction=${a.direction}
|
|
242
|
+
?auto=${a.auto}
|
|
346
243
|
label="Demo Tabs"
|
|
347
244
|
>
|
|
348
245
|
<sp-tab label="Tab 1" value="1">
|
|
@@ -357,55 +254,37 @@ export const iconsIii = (args) => {
|
|
|
357
254
|
<sp-tab label="Tab 4" value="4">
|
|
358
255
|
<sp-icon-help slot="icon"></sp-icon-help>
|
|
359
256
|
</sp-tab>
|
|
360
|
-
${
|
|
257
|
+
${s()}
|
|
361
258
|
</sp-tabs>
|
|
362
|
-
`;
|
|
363
|
-
}
|
|
364
|
-
iconsIii.args = {
|
|
365
|
-
direction: "vertical"
|
|
366
|
-
};
|
|
367
|
-
iconsIii.storyName = "Icons III";
|
|
368
|
-
export const Quiet = ({ direction, auto }) => {
|
|
369
|
-
return html`
|
|
370
|
-
<sp-tabs selected="1" quiet direction=${direction} ?auto=${auto}>
|
|
259
|
+
`;iconsIii.args={direction:"vertical"},iconsIii.storyName="Icons III";export const Quiet=({direction:a,auto:e})=>t`
|
|
260
|
+
<sp-tabs selected="1" quiet direction=${a} ?auto=${e}>
|
|
371
261
|
<sp-tab label="Tab 1" value="1"></sp-tab>
|
|
372
262
|
<sp-tab label="Tab 2" value="2"></sp-tab>
|
|
373
263
|
<sp-tab label="Tab 3" value="3"></sp-tab>
|
|
374
264
|
<sp-tab label="Tab 4" value="4"></sp-tab>
|
|
375
|
-
${
|
|
265
|
+
${s()}
|
|
376
266
|
</sp-tabs>
|
|
377
|
-
|
|
378
|
-
}
|
|
379
|
-
export const Compact = ({ direction, auto }) => {
|
|
380
|
-
return html`
|
|
381
|
-
<sp-tabs selected="1" compact direction=${direction} ?auto=${auto}>
|
|
267
|
+
`,Compact=({direction:a,auto:e})=>t`
|
|
268
|
+
<sp-tabs selected="1" compact direction=${a} ?auto=${e}>
|
|
382
269
|
<sp-tab label="Tab 1" value="1"></sp-tab>
|
|
383
270
|
<sp-tab label="Tab 2" value="2"></sp-tab>
|
|
384
271
|
<sp-tab label="Tab 3" value="3"></sp-tab>
|
|
385
272
|
<sp-tab label="Tab 4" value="4"></sp-tab>
|
|
386
|
-
${
|
|
273
|
+
${s()}
|
|
387
274
|
</sp-tabs>
|
|
388
|
-
|
|
389
|
-
};
|
|
390
|
-
export const quietCompact = ({
|
|
391
|
-
direction,
|
|
392
|
-
auto
|
|
393
|
-
}) => {
|
|
394
|
-
return html`
|
|
275
|
+
`,quietCompact=({direction:a,auto:e})=>t`
|
|
395
276
|
<sp-tabs
|
|
396
277
|
selected="1"
|
|
397
278
|
quiet
|
|
398
279
|
compact
|
|
399
|
-
direction=${
|
|
400
|
-
?auto=${
|
|
280
|
+
direction=${a}
|
|
281
|
+
?auto=${e}
|
|
401
282
|
>
|
|
402
283
|
<sp-tab label="Tab 1" value="1"></sp-tab>
|
|
403
284
|
<sp-tab label="Tab 2" value="2"></sp-tab>
|
|
404
285
|
<sp-tab label="Tab 3" value="3"></sp-tab>
|
|
405
286
|
<sp-tab label="Tab 4" value="4"></sp-tab>
|
|
406
|
-
${
|
|
287
|
+
${s()}
|
|
407
288
|
</sp-tabs>
|
|
408
|
-
`;
|
|
409
|
-
};
|
|
410
|
-
quietCompact.storyName = "Quiet Compact";
|
|
289
|
+
`;quietCompact.storyName="Quiet Compact";
|
|
411
290
|
//# sourceMappingURL=tabs.stories.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["tabs.stories.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport '@spectrum-web-components/icon/sp-icon.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-checkmark.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-close.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-chevron-down.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-help.js';\nimport '@spectrum-web-components/tabs/sp-tabs.js';\nimport '@spectrum-web-components/tabs/sp-tab.js';\nimport '@spectrum-web-components/tabs/sp-tab-panel.js';\nimport { html, TemplateResult } from '@spectrum-web-components/base';\n\nexport default {\n component: 'sp-tabs',\n title: 'Tabs',\n argTypes: {\n direction: {\n name: 'direction',\n type: { name: 'string', required: false },\n description: 'The direction of the Tabs element',\n table: {\n type: {\n summary: '\"vertical\" | \"vertical-right\" | \"horizontal\"',\n },\n defaultValue: { summary: 'horizontal' },\n },\n control: {\n type: 'text',\n },\n },\n verticalTab: { control: 'boolean' },\n auto: { control: 'boolean' },\n },\n args: {\n direction: 'horizontal',\n type: false,\n verticalTab: false,\n auto: false,\n },\n};\n\ninterface Properties {\n direction?: 'vertical' | 'vertical-right' | 'horizontal';\n verticalTabs?: boolean;\n verticalTab?: boolean;\n auto?: boolean;\n}\n\nconst panels = (): TemplateResult => html`\n <sp-tab-panel value=\"1\">Content for \"Really Long Name\"</sp-tab-panel>\n <sp-tab-panel value=\"2\">Content for tab 2</sp-tab-panel>\n <sp-tab-panel value=\"3\">Content for tab 3</sp-tab-panel>\n <sp-tab-panel value=\"4\">Content for tab 4</sp-tab-panel>\n`;\n\nexport const Default = (args: Properties): TemplateResult => {\n return html`\n <style>\n sp-tabs {\n display: grid;\n grid-template-columns: 100%;\n }\n sp-tab-panel {\n grid-area: 2/1/2/1;\n transition: opacity\n var(--spectrum-global-animation-duration-300)\n ease-in-out,\n transform var(--spectrum-global-animation-duration-300)\n ease-in-out;\n }\n sp-tab-panel:not([selected]) {\n display: unset;\n opacity: 0;\n height: 0;\n pointer-events: none;\n transform: translateY(\n var(\n --spectrum-dropdown-flyout-menu-offset-y,\n var(--spectrum-global-dimension-size-75)\n )\n );\n transition: opacity\n var(--spectrum-global-animation-duration-300)\n ease-in-out,\n transform var(--spectrum-global-animation-duration-300)\n ease-in-out,\n height 0s ease var(--spectrum-global-animation-duration-300);\n }\n </style>\n <sp-tabs\n selected=\"1\"\n ?auto=${args.auto}\n label=\"Demo Tabs\"\n direction=${args.direction}\n >\n <sp-tab value=\"2\">Tab 2</sp-tab>\n <sp-tab value=\"3\">Tab 3</sp-tab>\n <sp-tab value=\"4\">Tab 4</sp-tab>\n <sp-tab value=\"1\" selected>Really Long Name</sp-tab>\n ${panels()}\n </sp-tabs>\n `;\n};\n\nexport const Autofocus = (args: Properties): TemplateResult => {\n return html`\n <sp-tabs\n selected=\"1\"\n autofocus\n ?auto=${args.auto}\n label=\"Demo Tabs\"\n direction=${args.direction}\n >\n <sp-tab label=\"Tab 1\" value=\"1\"></sp-tab>\n <sp-tab label=\"Tab 2\" value=\"2\"></sp-tab>\n <sp-tab label=\"Tab 3\" value=\"3\"></sp-tab>\n <sp-tab label=\"Tab 4\" value=\"4\"></sp-tab>\n ${panels()}\n </sp-tabs>\n `;\n};\n\nexport const disabledTabs = (args: Properties): TemplateResult => {\n return html`\n <sp-tabs\n selected=\"1\"\n disabled\n ?auto=${args.auto}\n label=\"Disabled Tabs\"\n direction=${args.direction}\n >\n <sp-tab label=\"Tab 1\" value=\"1\"></sp-tab>\n <sp-tab label=\"Tab 2\" value=\"2\"></sp-tab>\n <sp-tab label=\"Tab 3\" value=\"3\"></sp-tab>\n <sp-tab label=\"Tab 4\" value=\"4\"></sp-tab>\n ${panels()}\n </sp-tabs>\n `;\n};\n\nexport const disabledTab = (args: Properties): TemplateResult => {\n return html`\n <sp-tabs\n selected=\"1\"\n ?auto=${args.auto}\n label=\"Disabled Tab\"\n direction=${args.direction}\n >\n <sp-tab label=\"Tab 1\" value=\"1\"></sp-tab>\n <sp-tab label=\"Tab 2\" value=\"2\" disabled></sp-tab>\n <sp-tab label=\"Tab 3\" value=\"3\" disabled></sp-tab>\n <sp-tab label=\"Tab 4\" value=\"4\"></sp-tab>\n ${panels()}\n </sp-tabs>\n `;\n};\n\nexport const emphasized = (args: Properties): TemplateResult => {\n return html`\n <sp-tabs selected=\"1\" emphasized ?auto=${args.auto} label=\"Demo Tabs\">\n <sp-tab label=\"Tab 1\" value=\"1\"></sp-tab>\n <sp-tab label=\"Tab 2\" value=\"2\"></sp-tab>\n <sp-tab label=\"Tab 3\" value=\"3\"></sp-tab>\n <sp-tab label=\"Tab 4\" value=\"4\"></sp-tab>\n ${panels()}\n </sp-tabs>\n `;\n};\n\nexport const emphasizedQuiet = (args: Properties): TemplateResult => {\n return html`\n <sp-tabs\n selected=\"1\"\n emphasized\n quiet\n ?auto=${args.auto}\n label=\"Demo Tabs\"\n >\n <sp-tab label=\"Tab 1\" value=\"1\"></sp-tab>\n <sp-tab label=\"Tab 2\" value=\"2\"></sp-tab>\n <sp-tab label=\"Tab 3\" value=\"3\"></sp-tab>\n <sp-tab label=\"Tab 4\" value=\"4\"></sp-tab>\n ${panels()}\n </sp-tabs>\n `;\n};\n\nexport const Vertical = (args: Properties): TemplateResult => {\n return html`\n <sp-tabs\n selected=\"1\"\n direction=${args.direction}\n ?auto=${args.auto}\n label=\"Demo Tabs\"\n >\n <sp-tab label=\"Tab 1\" value=\"1\"></sp-tab>\n <sp-tab label=\"Tab 2\" value=\"2\"></sp-tab>\n <sp-tab label=\"Tab 3\" value=\"3\"></sp-tab>\n <sp-tab label=\"Tab 4\" value=\"4\"></sp-tab>\n ${panels()}\n </sp-tabs>\n `;\n};\nVertical.args = {\n direction: 'vertical',\n};\n\nexport const VerticalSized = (args: Properties): TemplateResult => {\n return html`\n <style>\n sp-tabs {\n height: 75vh;\n --swc-tabs-list-justify-content: center;\n }\n </style>\n <sp-tabs\n selected=\"1\"\n direction=${args.direction}\n ?auto=${args.auto}\n label=\"Demo Tabs\"\n >\n <sp-tab label=\"Tab 1\" value=\"1\"></sp-tab>\n <sp-tab label=\"Tab 2\" value=\"2\"></sp-tab>\n <sp-tab label=\"Tab 3\" value=\"3\"></sp-tab>\n <sp-tab label=\"Tab 4\" value=\"4\"></sp-tab>\n ${panels()}\n </sp-tabs>\n `;\n};\nVerticalSized.args = {\n direction: 'vertical',\n};\n\nexport const VerticalRight = (args: Properties): TemplateResult => {\n return html`\n <style>\n sp-tabs {\n height: 75vh;\n --swc-tabs-list-justify-content: center;\n }\n </style>\n <sp-tabs\n selected=\"1\"\n direction=${args.direction}\n ?auto=${args.auto}\n label=\"Demo Tabs\"\n >\n <sp-tab label=\"Tab 1\" value=\"1\"></sp-tab>\n <sp-tab label=\"Tab 2\" value=\"2\"></sp-tab>\n <sp-tab label=\"Tab 3\" value=\"3\"></sp-tab>\n <sp-tab label=\"Tab 4\" value=\"4\"></sp-tab>\n ${panels()}\n </sp-tabs>\n `;\n};\nVerticalRight.args = {\n direction: 'vertical-right',\n};\n\nexport const Icons = ({\n direction,\n verticalTab,\n auto,\n}: Properties): TemplateResult => {\n return html`\n <sp-tabs selected=\"1\" direction=${direction} ?auto=${auto}>\n <sp-tab label=\"Tab 1\" value=\"1\" ?vertical=${verticalTab}>\n <sp-icon-checkmark slot=\"icon\"></sp-icon-checkmark>\n </sp-tab>\n <sp-tab label=\"Tab 2\" value=\"2\" ?vertical=${verticalTab}>\n <sp-icon-close slot=\"icon\"></sp-icon-close>\n </sp-tab>\n <sp-tab label=\"Tab 3\" value=\"3\" ?vertical=${verticalTab}>\n <sp-icon-chevron-down slot=\"icon\"></sp-icon-chevron-down>\n </sp-tab>\n <sp-tab label=\"Tab 4\" value=\"4\" ?vertical=${verticalTab}>\n <sp-icon-help slot=\"icon\"></sp-icon-help>\n </sp-tab>\n ${panels()}\n </sp-tabs>\n `;\n};\n\nexport const IconsWithSlottedLabel = ({\n direction,\n verticalTab,\n auto,\n}: Properties): TemplateResult => {\n return html`\n <sp-tabs selected=\"1\" direction=${direction} ?auto=${auto}>\n <sp-tab value=\"1\" ?vertical=${verticalTab}>\n Tab 1\n <sp-icon-checkmark slot=\"icon\"></sp-icon-checkmark>\n </sp-tab>\n <sp-tab value=\"2\" ?vertical=${verticalTab}>\n Tab 2\n <sp-icon-close slot=\"icon\"></sp-icon-close>\n </sp-tab>\n <sp-tab value=\"3\" ?vertical=${verticalTab}>\n Tab 3\n <sp-icon-chevron-down slot=\"icon\"></sp-icon-chevron-down>\n </sp-tab>\n <sp-tab value=\"4\" ?vertical=${verticalTab}>\n Tab 4\n <sp-icon-help slot=\"icon\"></sp-icon-help>\n </sp-tab>\n ${panels()}\n </sp-tabs>\n `;\n};\n\nexport const IconsOnly = ({\n direction,\n verticalTab,\n auto,\n}: Properties): TemplateResult => {\n return html`\n <sp-tabs selected=\"1\" direction=${direction} ?auto=${auto}>\n <sp-tab aria-label=\"Tab 1\" value=\"1\" ?vertical=${verticalTab}>\n <sp-icon-checkmark slot=\"icon\"></sp-icon-checkmark>\n </sp-tab>\n <sp-tab aria-label=\"Tab 2\" value=\"2\" ?vertical=${verticalTab}>\n <sp-icon-close slot=\"icon\"></sp-icon-close>\n </sp-tab>\n <sp-tab aria-label=\"Tab 3\" value=\"3\" ?vertical=${verticalTab}>\n <sp-icon-chevron-down slot=\"icon\"></sp-icon-chevron-down>\n </sp-tab>\n <sp-tab aria-label=\"Tab 4\" value=\"4\" ?vertical=${verticalTab}>\n <sp-icon-help slot=\"icon\"></sp-icon-help>\n </sp-tab>\n ${panels()}\n </sp-tabs>\n `;\n};\n\nexport const iconsIi = (args: Properties): TemplateResult => {\n return html`\n <sp-tabs\n selected=\"1\"\n direction=${args.direction}\n ?auto=${args.auto}\n label=\"Demo Tabs\"\n >\n <sp-tab label=\"Tab 1\" value=\"1\" vertical>\n <sp-icon-checkmark slot=\"icon\"></sp-icon-checkmark>\n </sp-tab>\n <sp-tab label=\"Tab 2\" value=\"2\" vertical>\n <sp-icon-close slot=\"icon\"></sp-icon-close>\n </sp-tab>\n <sp-tab label=\"Tab 3\" value=\"3\" vertical>\n <sp-icon-chevron-down slot=\"icon\"></sp-icon-chevron-down>\n </sp-tab>\n <sp-tab label=\"Tab 4\" value=\"4\" vertical>\n <sp-icon-help slot=\"icon\"></sp-icon-help>\n </sp-tab>\n ${panels()}\n </sp-tabs>\n `;\n};\niconsIi.args = {\n direction: 'vertical',\n};\niconsIi.storyName = 'Icons II';\n\nexport const iconsIii = (args: Properties): TemplateResult => {\n return html`\n <sp-tabs\n selected=\"1\"\n direction=${args.direction}\n ?auto=${args.auto}\n label=\"Demo Tabs\"\n >\n <sp-tab label=\"Tab 1\" value=\"1\">\n <sp-icon-checkmark slot=\"icon\"></sp-icon-checkmark>\n </sp-tab>\n <sp-tab label=\"Tab 2\" value=\"2\">\n <sp-icon-close slot=\"icon\"></sp-icon-close>\n </sp-tab>\n <sp-tab label=\"Tab 3\" value=\"3\">\n <sp-icon-chevron-down slot=\"icon\"></sp-icon-chevron-down>\n </sp-tab>\n <sp-tab label=\"Tab 4\" value=\"4\">\n <sp-icon-help slot=\"icon\"></sp-icon-help>\n </sp-tab>\n ${panels()}\n </sp-tabs>\n `;\n};\niconsIii.args = {\n direction: 'vertical',\n};\niconsIii.storyName = 'Icons III';\n\nexport const Quiet = ({ direction, auto }: Properties): TemplateResult => {\n return html`\n <sp-tabs selected=\"1\" quiet direction=${direction} ?auto=${auto}>\n <sp-tab label=\"Tab 1\" value=\"1\"></sp-tab>\n <sp-tab label=\"Tab 2\" value=\"2\"></sp-tab>\n <sp-tab label=\"Tab 3\" value=\"3\"></sp-tab>\n <sp-tab label=\"Tab 4\" value=\"4\"></sp-tab>\n ${panels()}\n </sp-tabs>\n `;\n};\n\nexport const Compact = ({ direction, auto }: Properties): TemplateResult => {\n return html`\n <sp-tabs selected=\"1\" compact direction=${direction} ?auto=${auto}>\n <sp-tab label=\"Tab 1\" value=\"1\"></sp-tab>\n <sp-tab label=\"Tab 2\" value=\"2\"></sp-tab>\n <sp-tab label=\"Tab 3\" value=\"3\"></sp-tab>\n <sp-tab label=\"Tab 4\" value=\"4\"></sp-tab>\n ${panels()}\n </sp-tabs>\n `;\n};\n\nexport const quietCompact = ({\n direction,\n auto,\n}: Properties): TemplateResult => {\n return html`\n <sp-tabs\n selected=\"1\"\n quiet\n compact\n direction=${direction}\n ?auto=${auto}\n >\n <sp-tab label=\"Tab 1\" value=\"1\"></sp-tab>\n <sp-tab label=\"Tab 2\" value=\"2\"></sp-tab>\n <sp-tab label=\"Tab 3\" value=\"3\"></sp-tab>\n <sp-tab label=\"Tab 4\" value=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UAAY",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "@spectrum-web-components/tabs/sp-tab.js";
|
|
3
|
-
import { html } from "lit";
|
|
4
|
-
import { measureFixtureCreation } from "../../../../test/benchmark/helpers.js";
|
|
5
|
-
measureFixtureCreation(html`
|
|
1
|
+
import"@spectrum-web-components/tabs/sp-tabs.js";import"@spectrum-web-components/tabs/sp-tab.js";import{html as a}from"lit";import{measureFixtureCreation as t}from"../../../../test/benchmark/helpers.js";t(a`
|
|
6
2
|
<sp-tabs selected="first">
|
|
7
3
|
<sp-tab label="Tab 1" value="first" tabindex="1"></sp-tab>
|
|
8
4
|
<sp-tab label="Tab 2" value="second" tabindex="2"></sp-tab>
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["basic-test.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport '@spectrum-web-components/tabs/sp-tabs.js';\nimport '@spectrum-web-components/tabs/sp-tab.js';\nimport { html } from 'lit';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\n\nmeasureFixtureCreation(html`\n <sp-tabs selected=\"first\">\n <sp-tab label=\"Tab 1\" value=\"first\" tabindex=\"1\"></sp-tab>\n <sp-tab label=\"Tab 2\" value=\"second\" tabindex=\"2\"></sp-tab>\n <sp-tab label=\"Tab 3\" value=\"third\" tabindex=\"3\"></sp-tab>\n </sp-tabs>\n`);\n"],
|
|
5
|
-
"mappings": "AAYA
|
|
5
|
+
"mappings": "AAYA,iDACA,gDACA,2BACA,+EAEA,EAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAMtB",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/test/tab.test.js
CHANGED
|
@@ -1,36 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "@spectrum-web-components/tabs/sp-tab.js";
|
|
3
|
-
import { elementUpdated, expect, fixture } from "@open-wc/testing";
|
|
4
|
-
import { html } from "lit/static-html.js";
|
|
5
|
-
import { testForLitDevWarnings } from "../../../test/testing-helpers.js";
|
|
6
|
-
describe("Tab", () => {
|
|
7
|
-
testForLitDevWarnings(async () => await fixture(html`
|
|
1
|
+
import"@spectrum-web-components/tabs/sp-tabs.js";import"@spectrum-web-components/tabs/sp-tab.js";import{elementUpdated as e,expect as s,fixture as b}from"@open-wc/testing";import{html as l}from"lit/static-html.js";import{testForLitDevWarnings as i}from"../../../test/testing-helpers.js";describe("Tab",()=>{i(async()=>await b(l`
|
|
8
2
|
<sp-tabs>
|
|
9
3
|
<sp-tab label="Tab 1" value="first"></sp-tab>
|
|
10
4
|
</sp-tabs>
|
|
11
|
-
`))
|
|
12
|
-
it("loads default tab accessibly", async () => {
|
|
13
|
-
const el = await fixture(html`
|
|
5
|
+
`)),it("loads default tab accessibly",async()=>{const a=await b(l`
|
|
14
6
|
<sp-tabs>
|
|
15
7
|
<sp-tab label="Tab 1" value="first"></sp-tab>
|
|
16
8
|
</sp-tabs>
|
|
17
|
-
`);
|
|
18
|
-
await elementUpdated(el);
|
|
19
|
-
await expect(el).to.be.accessible();
|
|
20
|
-
});
|
|
21
|
-
it("Updates label", async () => {
|
|
22
|
-
const el = await fixture(html`
|
|
9
|
+
`);await e(a),await s(a).to.be.accessible()}),it("Updates label",async()=>{const a=await b(l`
|
|
23
10
|
<sp-tabs>
|
|
24
11
|
<sp-tab label="Tab 1" value="first"></sp-tab>
|
|
25
12
|
</sp-tabs>
|
|
26
|
-
`);
|
|
27
|
-
await elementUpdated(el);
|
|
28
|
-
const firstTab = el.querySelector("sp-tab");
|
|
29
|
-
const label = firstTab.shadowRoot ? firstTab.shadowRoot.querySelector("#item-label") : firstTab.querySelector("#itemLabel");
|
|
30
|
-
expect(label.textContent).to.include("Tab 1");
|
|
31
|
-
firstTab.label = "Other Tab";
|
|
32
|
-
await elementUpdated(firstTab);
|
|
33
|
-
expect(label.textContent).to.include("Other Tab");
|
|
34
|
-
});
|
|
35
|
-
});
|
|
13
|
+
`);await e(a);const t=a.querySelector("sp-tab"),o=t.shadowRoot?t.shadowRoot.querySelector("#item-label"):t.querySelector("#itemLabel");s(o.textContent).to.include("Tab 1"),t.label="Other Tab",await e(t),s(o.textContent).to.include("Other Tab")})});
|
|
36
14
|
//# sourceMappingURL=tab.test.js.map
|
package/test/tab.test.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["tab.test.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport '@spectrum-web-components/tabs/sp-tabs.js';\nimport '@spectrum-web-components/tabs/sp-tab.js';\nimport { Tab, Tabs } from '@spectrum-web-components/tabs';\nimport { elementUpdated, expect, fixture } from '@open-wc/testing';\nimport { html } from 'lit/static-html.js';\nimport { testForLitDevWarnings } from '../../../test/testing-helpers.js';\n\ndescribe('Tab', () => {\n testForLitDevWarnings(\n async () =>\n await fixture<Tabs>(\n html`\n <sp-tabs>\n <sp-tab label=\"Tab 1\" value=\"first\"></sp-tab>\n </sp-tabs>\n `\n )\n );\n it('loads default tab accessibly', async () => {\n const el = await fixture<Tabs>(\n html`\n <sp-tabs>\n <sp-tab label=\"Tab 1\" value=\"first\"></sp-tab>\n </sp-tabs>\n `\n );\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n it('Updates label', async () => {\n const el = await fixture<Tabs>(\n html`\n <sp-tabs>\n <sp-tab label=\"Tab 1\" value=\"first\"></sp-tab>\n </sp-tabs>\n `\n );\n\n await elementUpdated(el);\n const firstTab = el.querySelector('sp-tab') as Tab;\n const label = firstTab.shadowRoot\n ? (firstTab.shadowRoot.querySelector(\n '#item-label'\n ) as HTMLLabelElement)\n : (firstTab.querySelector('#itemLabel') as HTMLLabelElement);\n expect(label.textContent).to.include('Tab 1');\n\n firstTab.label = 'Other Tab';\n\n await elementUpdated(firstTab);\n expect(label.textContent).to.include('Other Tab');\n });\n});\n"],
|
|
5
|
-
"mappings": "AAWA
|
|
5
|
+
"mappings": "AAWA,iDACA,gDAEA,2EACA,0CACA,yEAEA,SAAS,MAAO,IAAM,CAClB,EACI,SACI,KAAM,GACF;AAAA;AAAA;AAAA;AAAA,iBAKJ,CACR,EACA,GAAG,+BAAgC,SAAY,CAC3C,KAAM,GAAK,KAAM,GACb;AAAA;AAAA;AAAA;AAAA,aAKJ,EAEA,KAAM,GAAe,CAAE,EAEvB,KAAM,GAAO,CAAE,EAAE,GAAG,GAAG,WAAW,CACtC,CAAC,EACD,GAAG,gBAAiB,SAAY,CAC5B,KAAM,GAAK,KAAM,GACb;AAAA;AAAA;AAAA;AAAA,aAKJ,EAEA,KAAM,GAAe,CAAE,EACvB,KAAM,GAAW,EAAG,cAAc,QAAQ,EACpC,EAAQ,EAAS,WAChB,EAAS,WAAW,cACjB,aACJ,EACC,EAAS,cAAc,YAAY,EAC1C,EAAO,EAAM,WAAW,EAAE,GAAG,QAAQ,OAAO,EAE5C,EAAS,MAAQ,YAEjB,KAAM,GAAe,CAAQ,EAC7B,EAAO,EAAM,WAAW,EAAE,GAAG,QAAQ,WAAW,CACpD,CAAC,CACL,CAAC",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { regressVisuals } from "../../../test/visual/test.js";
|
|
3
|
-
regressVisuals("TabsHorizontalSizesStories", stories);
|
|
1
|
+
import*as s from"../stories/tabs-horizontal-sizes.stories.js";import{regressVisuals as r}from"../../../test/visual/test.js";r("TabsHorizontalSizesStories",s);
|
|
4
2
|
//# sourceMappingURL=tabs-horizontal-sizes.test-vrt.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["tabs-horizontal-sizes.test-vrt.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport * as stories from '../stories/tabs-horizontal-sizes.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('TabsHorizontalSizesStories', stories);\n"],
|
|
5
|
-
"mappings": "AAYA
|
|
5
|
+
"mappings": "AAYA,8DACA,8DAEA,EAAe,6BAA8B,CAAO",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { regressVisuals } from "../../../test/visual/test.js";
|
|
3
|
-
regressVisuals("TabsVerticalRightSizesStories", stories);
|
|
1
|
+
import*as s from"../stories/tabs-vertical-right-sizes.stories.js";import{regressVisuals as r}from"../../../test/visual/test.js";r("TabsVerticalRightSizesStories",s);
|
|
4
2
|
//# sourceMappingURL=tabs-vertical-right-sizes.test-vrt.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["tabs-vertical-right-sizes.test-vrt.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport * as stories from '../stories/tabs-vertical-right-sizes.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('TabsVerticalRightSizesStories', stories);\n"],
|
|
5
|
-
"mappings": "AAYA
|
|
5
|
+
"mappings": "AAYA,kEACA,8DAEA,EAAe,gCAAiC,CAAO",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|