@fluentui/web-components 3.0.0-beta.52 → 3.0.0-beta.54
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 +20 -2
- package/dist/dts/index-rollup.d.ts +1 -0
- package/dist/dts/index.d.ts +1 -0
- package/dist/dts/tablist/define.d.ts +1 -0
- package/dist/dts/tablist/index.d.ts +5 -0
- package/dist/dts/tablist/tablist.bench.d.ts +3 -0
- package/dist/dts/tablist/tablist.d.ts +191 -0
- package/dist/dts/tablist/tablist.definition.d.ts +7 -0
- package/dist/dts/tablist/tablist.options.d.ts +44 -0
- package/dist/dts/tablist/tablist.styles.d.ts +4 -0
- package/dist/dts/tablist/tablist.template.d.ts +5 -0
- package/dist/dts/theme/set-theme.d.ts +12 -2
- package/dist/dts/utils/focusable-element.d.ts +3 -0
- package/dist/esm/index-rollup.js +1 -0
- package/dist/esm/index-rollup.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/tablist/define.js +4 -0
- package/dist/esm/tablist/define.js.map +1 -0
- package/dist/esm/tablist/index.js +6 -0
- package/dist/esm/tablist/index.js.map +1 -0
- package/dist/esm/tablist/tablist.bench.js +21 -0
- package/dist/esm/tablist/tablist.bench.js.map +1 -0
- package/dist/esm/tablist/tablist.definition.js +15 -0
- package/dist/esm/tablist/tablist.definition.js.map +1 -0
- package/dist/esm/tablist/tablist.js +407 -0
- package/dist/esm/tablist/tablist.js.map +1 -0
- package/dist/esm/tablist/tablist.options.js +24 -0
- package/dist/esm/tablist/tablist.options.js.map +1 -0
- package/dist/esm/tablist/tablist.styles.js +194 -0
- package/dist/esm/tablist/tablist.styles.js.map +1 -0
- package/dist/esm/tablist/tablist.template.js +10 -0
- package/dist/esm/tablist/tablist.template.js.map +1 -0
- package/dist/esm/theme/set-theme.js +23 -10
- package/dist/esm/theme/set-theme.js.map +1 -1
- package/dist/esm/utils/focusable-element.js +10 -0
- package/dist/esm/utils/focusable-element.js.map +1 -0
- package/dist/web-components.d.ts +269 -2
- package/dist/web-components.js +928 -520
- package/dist/web-components.min.js +290 -287
- package/package.json +2 -1
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { attr, FASTElement, observable } from '@microsoft/fast-element';
|
|
3
|
+
import { wrapInBounds } from '@microsoft/fast-web-utilities';
|
|
4
|
+
import { keyArrowDown, keyArrowLeft, keyArrowRight, keyArrowUp, keyEnd, keyHome, uniqueId, } from '@microsoft/fast-web-utilities';
|
|
5
|
+
import { getDirection } from '../utils/index.js';
|
|
6
|
+
import { toggleState } from '../utils/element-internals.js';
|
|
7
|
+
import { isFocusableElement } from '../utils/focusable-element.js';
|
|
8
|
+
import { TablistAppearance, TablistOrientation } from './tablist.options.js';
|
|
9
|
+
/**
|
|
10
|
+
* A Tablist element that wraps a collection of tab elements
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export class BaseTablist extends FASTElement {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
/**
|
|
17
|
+
* The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
18
|
+
*
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
this.elementInternals = this.attachInternals();
|
|
22
|
+
/**
|
|
23
|
+
* Used for disabling all click and keyboard events for the tabs, child tab elements.
|
|
24
|
+
* @public
|
|
25
|
+
* @remarks
|
|
26
|
+
* HTML Attribute: disabled.
|
|
27
|
+
*/
|
|
28
|
+
this.disabled = false;
|
|
29
|
+
/**
|
|
30
|
+
* The orientation
|
|
31
|
+
* @public
|
|
32
|
+
* @remarks
|
|
33
|
+
* HTML Attribute: orientation
|
|
34
|
+
*/
|
|
35
|
+
this.orientation = TablistOrientation.horizontal;
|
|
36
|
+
this.prevActiveTabIndex = 0;
|
|
37
|
+
this.activeTabIndex = 0;
|
|
38
|
+
this.change = () => {
|
|
39
|
+
this.$emit('change', this.activetab);
|
|
40
|
+
};
|
|
41
|
+
this.handleTabClick = (event) => {
|
|
42
|
+
const selectedTab = event.currentTarget;
|
|
43
|
+
if (selectedTab.nodeType === Node.ELEMENT_NODE && isFocusableElement(selectedTab)) {
|
|
44
|
+
this.prevActiveTabIndex = this.activeTabIndex;
|
|
45
|
+
this.activeTabIndex = this.tabs.indexOf(selectedTab);
|
|
46
|
+
this.setComponent();
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
this.handleTabKeyDown = (event) => {
|
|
50
|
+
const dir = getDirection(this);
|
|
51
|
+
switch (event.key) {
|
|
52
|
+
case keyArrowLeft:
|
|
53
|
+
if (!this.isHorizontal()) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
event.preventDefault();
|
|
57
|
+
this.adjust(dir === 'ltr' ? -1 : 1);
|
|
58
|
+
break;
|
|
59
|
+
case keyArrowRight:
|
|
60
|
+
if (!this.isHorizontal()) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
event.preventDefault();
|
|
64
|
+
this.adjust(dir === 'ltr' ? 1 : -1);
|
|
65
|
+
break;
|
|
66
|
+
case keyArrowUp:
|
|
67
|
+
if (this.isHorizontal()) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
event.preventDefault();
|
|
71
|
+
this.adjust(-1);
|
|
72
|
+
break;
|
|
73
|
+
case keyArrowDown:
|
|
74
|
+
if (this.isHorizontal()) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
event.preventDefault();
|
|
78
|
+
this.adjust(1);
|
|
79
|
+
break;
|
|
80
|
+
case keyHome:
|
|
81
|
+
event.preventDefault();
|
|
82
|
+
this.adjust(-this.activeTabIndex);
|
|
83
|
+
break;
|
|
84
|
+
case keyEnd:
|
|
85
|
+
event.preventDefault();
|
|
86
|
+
this.adjust(this.tabs.filter(t => isFocusableElement(t)).length - this.activeTabIndex - 1);
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Handles disabled changes
|
|
93
|
+
* @param prev - previous value
|
|
94
|
+
* @param next - next value
|
|
95
|
+
*
|
|
96
|
+
* @internal
|
|
97
|
+
*/
|
|
98
|
+
disabledChanged(prev, next) {
|
|
99
|
+
toggleState(this.elementInternals, 'disabled', next);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* @internal
|
|
103
|
+
*/
|
|
104
|
+
orientationChanged(prev, next) {
|
|
105
|
+
this.elementInternals.ariaOrientation = next !== null && next !== void 0 ? next : TablistOrientation.horizontal;
|
|
106
|
+
if (prev) {
|
|
107
|
+
toggleState(this.elementInternals, `${prev}`, false);
|
|
108
|
+
}
|
|
109
|
+
if (next) {
|
|
110
|
+
toggleState(this.elementInternals, `${next}`, true);
|
|
111
|
+
}
|
|
112
|
+
if (this.$fastController.isConnected) {
|
|
113
|
+
this.setTabs();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* @internal
|
|
118
|
+
*/
|
|
119
|
+
activeidChanged(oldValue, newValue) {
|
|
120
|
+
if (this.$fastController.isConnected && this.tabs.length > 0) {
|
|
121
|
+
this.prevActiveTabIndex = this.tabs.findIndex((item) => item.id === oldValue);
|
|
122
|
+
this.setTabs();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* @internal
|
|
127
|
+
*/
|
|
128
|
+
tabsChanged() {
|
|
129
|
+
if (this.$fastController.isConnected && this.tabs.length > 0) {
|
|
130
|
+
this.tabIds = this.getTabIds();
|
|
131
|
+
this.setTabs();
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
getActiveIndex() {
|
|
135
|
+
const id = this.activeid;
|
|
136
|
+
if (id !== undefined) {
|
|
137
|
+
return this.tabIds.indexOf(this.activeid) === -1 ? 0 : this.tabIds.indexOf(this.activeid);
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
return 0;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Function that is invoked whenever the selected tab or the tab collection changes.
|
|
145
|
+
*
|
|
146
|
+
* @public
|
|
147
|
+
*/
|
|
148
|
+
setTabs() {
|
|
149
|
+
this.activeTabIndex = this.getActiveIndex();
|
|
150
|
+
this.tabs.forEach((tab, index) => {
|
|
151
|
+
if (tab.slot === 'tab') {
|
|
152
|
+
const isActiveTab = this.activeTabIndex === index && isFocusableElement(tab);
|
|
153
|
+
const tabId = this.tabIds[index];
|
|
154
|
+
tab.setAttribute('id', tabId);
|
|
155
|
+
tab.setAttribute('aria-selected', isActiveTab ? 'true' : 'false');
|
|
156
|
+
tab.addEventListener('click', this.handleTabClick);
|
|
157
|
+
tab.addEventListener('keydown', this.handleTabKeyDown);
|
|
158
|
+
tab.setAttribute('tabindex', isActiveTab && !this.disabled ? '0' : '-1');
|
|
159
|
+
if (isActiveTab) {
|
|
160
|
+
this.activetab = tab;
|
|
161
|
+
this.activeid = tabId;
|
|
162
|
+
}
|
|
163
|
+
this.change();
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
getTabIds() {
|
|
168
|
+
return this.tabs.map((tab) => {
|
|
169
|
+
var _a;
|
|
170
|
+
return (_a = tab.getAttribute('id')) !== null && _a !== void 0 ? _a : `tab-${uniqueId()}`;
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
setComponent() {
|
|
174
|
+
if (this.activeTabIndex !== this.prevActiveTabIndex) {
|
|
175
|
+
this.activeid = this.tabIds[this.activeTabIndex];
|
|
176
|
+
this.focusTab();
|
|
177
|
+
this.change();
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
isHorizontal() {
|
|
181
|
+
return this.orientation === TablistOrientation.horizontal;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* The adjust method for FASTTabs
|
|
185
|
+
* @public
|
|
186
|
+
* @remarks
|
|
187
|
+
* This method allows the active index to be adjusted by numerical increments
|
|
188
|
+
*/
|
|
189
|
+
adjust(adjustment) {
|
|
190
|
+
const focusableTabs = this.tabs.filter(t => isFocusableElement(t));
|
|
191
|
+
const currentActiveTabIndex = focusableTabs.indexOf(this.activetab);
|
|
192
|
+
const nextTabIndex = wrapInBounds(0, focusableTabs.length - 1, currentActiveTabIndex + adjustment);
|
|
193
|
+
// the index of the next focusable tab within the context of all available tabs
|
|
194
|
+
const nextIndex = this.tabs.indexOf(focusableTabs[nextTabIndex]);
|
|
195
|
+
if (nextIndex > -1) {
|
|
196
|
+
this.activateTabByIndex(this.tabs, nextIndex);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
activateTabByIndex(group, index) {
|
|
200
|
+
const tab = group[index];
|
|
201
|
+
this.activetab = tab;
|
|
202
|
+
this.prevActiveTabIndex = this.activeTabIndex;
|
|
203
|
+
this.activeTabIndex = index;
|
|
204
|
+
tab.focus();
|
|
205
|
+
this.setComponent();
|
|
206
|
+
}
|
|
207
|
+
focusTab() {
|
|
208
|
+
this.tabs[this.activeTabIndex].focus();
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* @internal
|
|
212
|
+
*/
|
|
213
|
+
connectedCallback() {
|
|
214
|
+
super.connectedCallback();
|
|
215
|
+
this.tabIds = this.getTabIds();
|
|
216
|
+
this.activeTabIndex = this.getActiveIndex();
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
__decorate([
|
|
220
|
+
attr({ mode: 'boolean' })
|
|
221
|
+
], BaseTablist.prototype, "disabled", void 0);
|
|
222
|
+
__decorate([
|
|
223
|
+
attr
|
|
224
|
+
], BaseTablist.prototype, "orientation", void 0);
|
|
225
|
+
__decorate([
|
|
226
|
+
attr
|
|
227
|
+
], BaseTablist.prototype, "activeid", void 0);
|
|
228
|
+
__decorate([
|
|
229
|
+
observable
|
|
230
|
+
], BaseTablist.prototype, "tabs", void 0);
|
|
231
|
+
/**
|
|
232
|
+
* A BaseTablist component with extra logic for handling the styled active tab indicator.
|
|
233
|
+
* @public
|
|
234
|
+
*/
|
|
235
|
+
export class Tablist extends BaseTablist {
|
|
236
|
+
constructor() {
|
|
237
|
+
super(...arguments);
|
|
238
|
+
/**
|
|
239
|
+
* activeTabData
|
|
240
|
+
* The positional coordinates and size dimensions of the active tab. Used for calculating the offset and scale of the tab active indicator.
|
|
241
|
+
*/
|
|
242
|
+
this.activeTabData = { x: 0, y: 0, height: 0, width: 0 };
|
|
243
|
+
/**
|
|
244
|
+
* previousActiveTabData
|
|
245
|
+
* The positional coordinates and size dimensions of the active tab. Used for calculating the offset and scale of the tab active indicator.
|
|
246
|
+
*/
|
|
247
|
+
this.previousActiveTabData = { x: 0, y: 0, height: 0, width: 0 };
|
|
248
|
+
/**
|
|
249
|
+
* activeTabOffset
|
|
250
|
+
* Used to position the active indicator for animations of the active indicator on active tab changes.
|
|
251
|
+
*/
|
|
252
|
+
this.activeTabOffset = 0;
|
|
253
|
+
/**
|
|
254
|
+
* activeTabScale
|
|
255
|
+
* Used to scale the tab active indicator up or down as animations of the active indicator occur.
|
|
256
|
+
*/
|
|
257
|
+
this.activeTabScale = 1;
|
|
258
|
+
/**
|
|
259
|
+
* appearance
|
|
260
|
+
* There are two modes of appearance: transparent and subtle.
|
|
261
|
+
*/
|
|
262
|
+
this.appearance = TablistAppearance.transparent;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* @internal
|
|
266
|
+
*/
|
|
267
|
+
appearanceChanged(prev, next) {
|
|
268
|
+
if (prev) {
|
|
269
|
+
toggleState(this.elementInternals, `${prev}`, false);
|
|
270
|
+
}
|
|
271
|
+
if (next) {
|
|
272
|
+
toggleState(this.elementInternals, `${next}`, true);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* @internal
|
|
277
|
+
*/
|
|
278
|
+
sizeChanged(prev, next) {
|
|
279
|
+
if (prev) {
|
|
280
|
+
toggleState(this.elementInternals, `${prev}`, false);
|
|
281
|
+
}
|
|
282
|
+
if (next) {
|
|
283
|
+
toggleState(this.elementInternals, `${next}`, true);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* calculateAnimationProperties
|
|
288
|
+
*
|
|
289
|
+
* Recalculates the active tab offset and scale.
|
|
290
|
+
* These values will be applied to css variables that control the tab active indicator position animations
|
|
291
|
+
*/
|
|
292
|
+
calculateAnimationProperties(tab) {
|
|
293
|
+
this.activeTabOffset = this.getTabPosition(tab);
|
|
294
|
+
this.activeTabScale = this.getTabScale(tab);
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* getSelectedTabPosition - gets the x or y coordinates of the tab
|
|
298
|
+
*/
|
|
299
|
+
getTabPosition(tab) {
|
|
300
|
+
if (this.orientation === TablistOrientation.horizontal) {
|
|
301
|
+
return this.previousActiveTabData.x - (tab.getBoundingClientRect().x - this.getBoundingClientRect().x);
|
|
302
|
+
}
|
|
303
|
+
else
|
|
304
|
+
return this.previousActiveTabData.y - (tab.getBoundingClientRect().y - this.getBoundingClientRect().y);
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* getSelectedTabScale - gets the scale of the tab
|
|
308
|
+
*/
|
|
309
|
+
getTabScale(tab) {
|
|
310
|
+
if (this.orientation === TablistOrientation.horizontal) {
|
|
311
|
+
return this.previousActiveTabData.width / tab.getBoundingClientRect().width;
|
|
312
|
+
}
|
|
313
|
+
else
|
|
314
|
+
return this.previousActiveTabData.height / tab.getBoundingClientRect().height;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Calculates and applies updated values to CSS variables.
|
|
318
|
+
*
|
|
319
|
+
* @param tab - the tab element to apply the updated values to
|
|
320
|
+
* @internal
|
|
321
|
+
*/
|
|
322
|
+
applyUpdatedCSSValues(tab) {
|
|
323
|
+
this.calculateAnimationProperties(tab);
|
|
324
|
+
this.setAnimationVars();
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Runs through all the operations required for setting the tab active indicator to its starting location, ending
|
|
328
|
+
* location, and applying the animated css class to the tab.
|
|
329
|
+
*
|
|
330
|
+
* @param tab - the tab element to apply the updated values to
|
|
331
|
+
* @internal
|
|
332
|
+
*/
|
|
333
|
+
animationLoop(tab) {
|
|
334
|
+
// remove the animated class so nothing animates yet
|
|
335
|
+
tab.setAttribute('data-animate', 'false');
|
|
336
|
+
// animation start - this applyUpdatedCSSValues sets the active indicator to the location of the previously selected tab
|
|
337
|
+
this.applyUpdatedCSSValues(tab);
|
|
338
|
+
// changing the previously active tab allows the applyUpdatedCSSValues method to calculate the correct end to the animation.
|
|
339
|
+
this.previousActiveTabData = this.activeTabData;
|
|
340
|
+
// calculate and apply updated css values for animation.
|
|
341
|
+
this.applyUpdatedCSSValues(tab);
|
|
342
|
+
// add the css class and active indicator will animate from the previous tab location to its tab location
|
|
343
|
+
tab.setAttribute('data-animate', 'true');
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Sets the data from the active tab onto the class. used for making all the animation calculations for the active
|
|
347
|
+
* tab indicator.
|
|
348
|
+
*
|
|
349
|
+
* @internal
|
|
350
|
+
*/
|
|
351
|
+
setTabData() {
|
|
352
|
+
var _a, _b, _c, _d;
|
|
353
|
+
if (this.tabs && this.tabs.length > 0) {
|
|
354
|
+
const tabs = this.tabs;
|
|
355
|
+
const activeTab = this.activetab || tabs[0];
|
|
356
|
+
const activeRect = activeTab === null || activeTab === void 0 ? void 0 : activeTab.getBoundingClientRect();
|
|
357
|
+
const parentRect = this.getBoundingClientRect();
|
|
358
|
+
this.activeTabData = {
|
|
359
|
+
x: activeRect.x - parentRect.x,
|
|
360
|
+
y: activeRect.y - parentRect.y,
|
|
361
|
+
height: activeRect.height,
|
|
362
|
+
width: activeRect.width,
|
|
363
|
+
};
|
|
364
|
+
if (((_a = this.previousActiveTabData) === null || _a === void 0 ? void 0 : _a.x) !== ((_b = this.activeTabData) === null || _b === void 0 ? void 0 : _b.x) &&
|
|
365
|
+
((_c = this.previousActiveTabData) === null || _c === void 0 ? void 0 : _c.y) !== ((_d = this.activeTabData) === null || _d === void 0 ? void 0 : _d.y)) {
|
|
366
|
+
this.previousActiveTabData = this.activeTabData;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Sets the css variables for the active tab indicator.
|
|
372
|
+
* @internal
|
|
373
|
+
*/
|
|
374
|
+
setAnimationVars() {
|
|
375
|
+
this.style.setProperty('--tabIndicatorOffset', `${this.activeTabOffset}px`);
|
|
376
|
+
this.style.setProperty('--tabIndicatorScale', `${this.activeTabScale}`);
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Initiates the active tab indicator animation loop when activeid changes.
|
|
380
|
+
* @param oldValue - the previous tabId
|
|
381
|
+
* @param newValue - the new tabId
|
|
382
|
+
*/
|
|
383
|
+
activeidChanged(oldValue, newValue) {
|
|
384
|
+
super.activeidChanged(oldValue, newValue);
|
|
385
|
+
this.setTabData();
|
|
386
|
+
if (this.activetab) {
|
|
387
|
+
this.animationLoop(this.activetab);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Initiates the active tab indicator animation loop when tabs change.
|
|
392
|
+
*/
|
|
393
|
+
tabsChanged() {
|
|
394
|
+
super.tabsChanged();
|
|
395
|
+
this.setTabData();
|
|
396
|
+
if (this.activetab) {
|
|
397
|
+
this.animationLoop(this.activetab);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
__decorate([
|
|
402
|
+
attr
|
|
403
|
+
], Tablist.prototype, "appearance", void 0);
|
|
404
|
+
__decorate([
|
|
405
|
+
attr
|
|
406
|
+
], Tablist.prototype, "size", void 0);
|
|
407
|
+
//# sourceMappingURL=tablist.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tablist.js","sourceRoot":"","sources":["../../../src/tablist/tablist.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,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC1C,IAAI,CAAC,UAAU,EAAE,CAAC;QAElB,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,SAAgB,CAAC,CAAC;SAC3C;IACH,CAAC;IAED;;OAEG;IACI,WAAW;QAChB,KAAK,CAAC,WAAW,EAAE,CAAC;QACpB,IAAI,CAAC,UAAU,EAAE,CAAC;QAElB,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,SAAgB,CAAC,CAAC;SAC3C;IACH,CAAC;CACF;AA7JQ;IADN,IAAI;2CACiE;AAoB/D;IADN,IAAI;qCACqB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Orientation } from '@microsoft/fast-web-utilities';
|
|
2
|
+
/**
|
|
3
|
+
* The appearance of the component
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export const TablistAppearance = {
|
|
7
|
+
subtle: 'subtle',
|
|
8
|
+
transparent: 'transparent',
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The size of the component
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export const TablistSize = {
|
|
15
|
+
small: 'small',
|
|
16
|
+
medium: 'medium',
|
|
17
|
+
large: 'large',
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* The orientation of the component
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
export const TablistOrientation = Orientation;
|
|
24
|
+
//# sourceMappingURL=tablist.options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tablist.options.js","sourceRoot":"","sources":["../../../src/tablist/tablist.options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAG5D;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,aAAa;CAClB,CAAC;AAQX;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;CACN,CAAC;AAQX;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,WAAW,CAAC"}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { css } from '@microsoft/fast-element';
|
|
2
|
+
import { display } from '../utils/index.js';
|
|
3
|
+
import { borderRadiusCircular, colorCompoundBrandForeground1Hover, colorNeutralForeground1, colorNeutralForeground1Hover, colorNeutralForeground2, colorNeutralForegroundDisabled, colorSubtleBackgroundHover, colorSubtleBackgroundPressed, curveDecelerateMax, durationSlow, fontSizeBase300, fontSizeBase400, lineHeightBase300, lineHeightBase400, spacingHorizontalMNudge, spacingHorizontalSNudge, spacingVerticalL, spacingVerticalMNudge, spacingVerticalS, spacingVerticalSNudge, spacingVerticalXXS, strokeWidthThicker, } from '../theme/design-tokens.js';
|
|
4
|
+
import { disabledState, largeState, smallState, subtleState, verticalState } from '../styles/states/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export const styles = css `
|
|
9
|
+
${display('flex')}
|
|
10
|
+
|
|
11
|
+
:host {
|
|
12
|
+
--tabPaddingInline: inherit;
|
|
13
|
+
--tabPaddingBlock: inherit;
|
|
14
|
+
--tabIndicatorInsetInline: 0;
|
|
15
|
+
--tabIndicatorInsetBlock: 0;
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
color: ${colorNeutralForeground2};
|
|
18
|
+
flex-direction: row;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:host(${verticalState}) {
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:host ::slotted([role='tab']) {
|
|
26
|
+
align-items: flex-start;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* indicator animation */
|
|
30
|
+
:host ::slotted([slot='tab'][data-animate='true'])::after {
|
|
31
|
+
transition-property: transform;
|
|
32
|
+
transition-duration: ${durationSlow};
|
|
33
|
+
transition-timing-function: ${curveDecelerateMax};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
:host ::slotted([slot='tab'])::after {
|
|
37
|
+
height: ${strokeWidthThicker};
|
|
38
|
+
margin-block-start: auto;
|
|
39
|
+
transform-origin: left;
|
|
40
|
+
transform: translateX(var(--tabIndicatorOffset)) scaleX(var(--tabIndicatorScale));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:host(${verticalState}) ::slotted([slot='tab'])::after {
|
|
44
|
+
width: ${strokeWidthThicker};
|
|
45
|
+
height: unset;
|
|
46
|
+
margin-block-start: unset;
|
|
47
|
+
transform-origin: top;
|
|
48
|
+
transform: translateY(var(--tabIndicatorOffset)) scaleY(var(--tabIndicatorScale));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* ::before adds a secondary indicator placeholder that appears right after click on the active tab */
|
|
52
|
+
:host ::slotted([slot='tab'])::before {
|
|
53
|
+
height: ${strokeWidthThicker};
|
|
54
|
+
border-radius: ${borderRadiusCircular};
|
|
55
|
+
content: '';
|
|
56
|
+
inset-inline: var(--tabIndicatorInsetInline);
|
|
57
|
+
inset-block: var(--tabIndicatorInsetBlock);
|
|
58
|
+
position: absolute;
|
|
59
|
+
margin-top: auto;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:host ::slotted([slot='tab'])::before {
|
|
63
|
+
inset-inline: var(--tabIndicatorInsetInline);
|
|
64
|
+
inset-block: var(--tabIndicatorInsetBlock);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:host ::slotted([slot='tab'][aria-selected='true'])::before {
|
|
68
|
+
background-color: ${colorNeutralForegroundDisabled};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
:host ::slotted([slot='tab'][aria-selected='false']:hover)::after {
|
|
72
|
+
height: ${strokeWidthThicker};
|
|
73
|
+
margin-block-start: auto;
|
|
74
|
+
transform-origin: left;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
:host(${verticalState}) ::slotted([slot='tab'])::before,
|
|
78
|
+
:host(${verticalState}) ::slotted([slot='tab'][aria-selected='false']:hover)::after {
|
|
79
|
+
height: unset;
|
|
80
|
+
width: ${strokeWidthThicker};
|
|
81
|
+
margin-inline-end: auto;
|
|
82
|
+
transform-origin: top;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
:host(:where(${smallState}, ${largeState})) ::slotted([slot='tab']) {
|
|
86
|
+
padding-inline: var(--tabPaddingInline);
|
|
87
|
+
padding-block: var(--tabPaddingBlock);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
:host(${smallState}) ::slotted([slot='tab']) {
|
|
91
|
+
--tabPaddingBlock: ${spacingVerticalSNudge};
|
|
92
|
+
--tabPaddingInline: ${spacingHorizontalSNudge};
|
|
93
|
+
font-size: ${fontSizeBase300};
|
|
94
|
+
line-height: ${lineHeightBase300};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:host(${largeState}) ::slotted([slot='tab']) {
|
|
98
|
+
--tabPaddingBlock: ${spacingVerticalL};
|
|
99
|
+
--tabPaddingInline: ${spacingHorizontalMNudge};
|
|
100
|
+
font-size: ${fontSizeBase400};
|
|
101
|
+
line-height: ${lineHeightBase400};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* horizontal spacing for indicator */
|
|
105
|
+
:host ::slotted([slot='tab'])::after,
|
|
106
|
+
:host ::slotted([slot='tab'])::before,
|
|
107
|
+
:host ::slotted([slot='tab']:hover)::after {
|
|
108
|
+
inset-inline: var(--tabIndicatorInsetInline);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
:host ::slotted([slot='tab']) {
|
|
112
|
+
--tabIndicatorInsetInline: ${spacingHorizontalMNudge};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
:host(${smallState}) ::slotted([slot='tab']) {
|
|
116
|
+
--tabIndicatorInsetInline: ${spacingHorizontalSNudge};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
:host(${largeState}) ::slotted([slot='tab']) {
|
|
120
|
+
--tabIndicatorInsetInline: ${spacingHorizontalMNudge};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
:host(${verticalState}) ::slotted([slot='tab']) {
|
|
124
|
+
padding-block: var(--tabPaddingBlock);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
:host(${verticalState}) ::slotted([slot='tab']) {
|
|
128
|
+
--tabPaddingBlock: ${spacingVerticalS};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
:host(${verticalState}${smallState}) ::slotted([slot='tab']) {
|
|
132
|
+
--tabPaddingBlock: ${spacingVerticalXXS};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
:host(${verticalState}${largeState}) ::slotted([slot='tab']) {
|
|
136
|
+
--tabPaddingBlock: ${spacingVerticalS};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
:host(${verticalState}) ::slotted([slot='tab'])::after,
|
|
140
|
+
:host(${verticalState}) ::slotted([slot='tab'])::before,
|
|
141
|
+
:host(${verticalState}) ::slotted([slot='tab']:hover)::after {
|
|
142
|
+
inset-inline: 0;
|
|
143
|
+
inset-block: var(--tabIndicatorInsetBlock);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
:host(${verticalState}) {
|
|
147
|
+
--tabIndicatorInsetBlock: ${spacingVerticalS};
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
:host(${verticalState}${smallState}) {
|
|
151
|
+
--tabIndicatorInsetBlock: ${spacingVerticalSNudge};
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
:host(${verticalState}${largeState}) {
|
|
155
|
+
--tabIndicatorInsetBlock: ${spacingVerticalMNudge};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* disabled styles */
|
|
159
|
+
:host(${disabledState}) {
|
|
160
|
+
cursor: not-allowed;
|
|
161
|
+
color: ${colorNeutralForegroundDisabled};
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
:host(${disabledState}) ::slotted([slot='tab']) {
|
|
165
|
+
pointer-events: none;
|
|
166
|
+
cursor: not-allowed;
|
|
167
|
+
color: ${colorNeutralForegroundDisabled};
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
:host(${disabledState}) ::slotted([slot='tab']:after) {
|
|
171
|
+
background-color: ${colorNeutralForegroundDisabled};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
:host(${disabledState}) ::slotted([slot='tab'][aria-selected='true'])::after {
|
|
175
|
+
background-color: ${colorNeutralForegroundDisabled};
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
:host(${disabledState}) ::slotted([slot='tab']:hover):before {
|
|
179
|
+
content: unset;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
:host(${subtleState}) ::slotted([slot='tab']:hover) {
|
|
183
|
+
background-color: ${colorSubtleBackgroundHover};
|
|
184
|
+
color: ${colorNeutralForeground1Hover};
|
|
185
|
+
fill: ${colorCompoundBrandForeground1Hover};
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
:host(${subtleState}) ::slotted([slot='tab']:active) {
|
|
189
|
+
background-color: ${colorSubtleBackgroundPressed};
|
|
190
|
+
fill: ${colorSubtleBackgroundPressed};
|
|
191
|
+
color: ${colorNeutralForeground1};
|
|
192
|
+
}
|
|
193
|
+
`;
|
|
194
|
+
//# sourceMappingURL=tablist.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tablist.styles.js","sourceRoot":"","sources":["../../../src/tablist/tablist.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EACL,oBA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