@scania/tegel 0.0.1-beta.2 → 0.0.1-beta.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/dist/components/dropdown-option.js +1 -0
- package/dist/components/dropdown.js +1 -0
- package/dist/components/icon.js +1 -0
- package/dist/components/sdds-accordion-item.js +1 -0
- package/dist/components/sdds-accordion.js +1 -0
- package/dist/components/sdds-badges.js +1 -0
- package/dist/components/sdds-button.js +1 -0
- package/dist/components/sdds-datetime.js +1 -0
- package/dist/components/sdds-dropdown-filter.js +1 -0
- package/dist/components/sdds-header-cell.js +1 -0
- package/dist/components/sdds-inline-tabs-fullbleed.js +1 -0
- package/dist/components/sdds-inline-tabs.js +1 -0
- package/dist/components/sdds-modal.js +1 -0
- package/dist/components/sdds-navigation-tabs.js +1 -0
- package/dist/components/sdds-popover-canvas.js +1 -0
- package/dist/components/sdds-popover-menu.js +1 -0
- package/dist/components/sdds-slider.js +1 -0
- package/dist/components/sdds-spinner.js +1 -0
- package/dist/components/sdds-table-body-row-expandable.js +1 -0
- package/dist/components/sdds-table-body.js +1 -0
- package/dist/components/sdds-table-footer.js +1 -0
- package/dist/components/sdds-table-header.js +1 -0
- package/dist/components/sdds-table-toolbar.js +1 -0
- package/dist/components/sdds-table.js +1 -0
- package/dist/components/sdds-textarea.js +1 -0
- package/dist/components/sdds-textfield.js +1 -0
- package/dist/components/sdds-tooltip.js +1 -0
- package/dist/components/table-body-cell.js +1 -0
- package/dist/components/table-body-row.js +1 -0
- package/package.json +2 -2
- package/dist/cjs/index-e1c79686.js +0 -1912
- package/dist/cjs/index.cjs.js +0 -2
- package/dist/cjs/loader.cjs.js +0 -21
- package/dist/cjs/popper-11d5f714.js +0 -1801
- package/dist/cjs/sdds-accordion-item.cjs.entry.js +0 -34
- package/dist/cjs/sdds-accordion.cjs.entry.js +0 -21
- package/dist/cjs/sdds-badges.cjs.entry.js +0 -55
- package/dist/cjs/sdds-body-cell_2.cjs.entry.js +0 -173
- package/dist/cjs/sdds-button.cjs.entry.js +0 -36
- package/dist/cjs/sdds-datetime.cjs.entry.js +0 -66
- package/dist/cjs/sdds-dropdown-filter.cjs.entry.js +0 -92
- package/dist/cjs/sdds-dropdown_2.cjs.entry.js +0 -335
- package/dist/cjs/sdds-header-cell.cjs.entry.js +0 -141
- package/dist/cjs/sdds-icon.cjs.entry.js +0 -42
- package/dist/cjs/sdds-inline-tabs-fullbleed.cjs.entry.js +0 -96
- package/dist/cjs/sdds-inline-tabs.cjs.entry.js +0 -211
- package/dist/cjs/sdds-modal.cjs.entry.js +0 -49
- package/dist/cjs/sdds-navigation-tabs.cjs.entry.js +0 -95
- package/dist/cjs/sdds-popover-canvas.cjs.entry.js +0 -76
- package/dist/cjs/sdds-popover-menu.cjs.entry.js +0 -75
- package/dist/cjs/sdds-slider.cjs.entry.js +0 -336
- package/dist/cjs/sdds-spinner.cjs.entry.js +0 -21
- package/dist/cjs/sdds-table-body-row-expandable.cjs.entry.js +0 -81
- package/dist/cjs/sdds-table-body.cjs.entry.js +0 -289
- package/dist/cjs/sdds-table-footer.cjs.entry.js +0 -165
- package/dist/cjs/sdds-table-header.cjs.entry.js +0 -100
- package/dist/cjs/sdds-table-toolbar.cjs.entry.js +0 -66
- package/dist/cjs/sdds-table.cjs.entry.js +0 -69
- package/dist/cjs/sdds-textarea.cjs.entry.js +0 -61
- package/dist/cjs/sdds-textfield.cjs.entry.js +0 -82
- package/dist/cjs/sdds-tooltip.cjs.entry.js +0 -95
- package/dist/cjs/tegel.cjs.js +0 -19
- package/dist/collection/collection-manifest.json +0 -40
- package/dist/collection/components/accordion/accordion-item/accordion-item.css +0 -134
- package/dist/collection/components/accordion/accordion-item/accordion-item.js +0 -146
- package/dist/collection/components/accordion/accordion.css +0 -77
- package/dist/collection/components/accordion/accordion.js +0 -62
- package/dist/collection/components/accordion/accordion.stories.js +0 -91
- package/dist/collection/components/badge/badge.stories.js +0 -101
- package/dist/collection/components/badge/badges.css +0 -42
- package/dist/collection/components/badge/badges.js +0 -150
- package/dist/collection/components/banner/banner.stories.js +0 -93
- package/dist/collection/components/block/block.stories.js +0 -46
- package/dist/collection/components/breadcrumb/breadcrumb.stories.js +0 -26
- package/dist/collection/components/button/button-component.js +0 -154
- package/dist/collection/components/button/button-native.stories.js +0 -183
- package/dist/collection/components/button/button-webcomponent.stories.js +0 -182
- package/dist/collection/components/button/button.css +0 -658
- package/dist/collection/components/card/card.stories.js +0 -181
- package/dist/collection/components/checkbox/checkbox.stories.js +0 -54
- package/dist/collection/components/chips/chips.stories.js +0 -124
- package/dist/collection/components/data-table/native-table.stories.js +0 -182
- package/dist/collection/components/data-table/table/table.css +0 -15
- package/dist/collection/components/data-table/table/table.js +0 -253
- package/dist/collection/components/data-table/table-body/table-body.css +0 -22
- package/dist/collection/components/data-table/table-body/table-body.js +0 -425
- package/dist/collection/components/data-table/table-body-cell/table-body-cell.css +0 -40
- package/dist/collection/components/data-table/table-body-cell/table-body-cell.js +0 -169
- package/dist/collection/components/data-table/table-body-row/table-body-row.css +0 -196
- package/dist/collection/components/data-table/table-body-row/table-body-row.js +0 -164
- package/dist/collection/components/data-table/table-body-row-expandable/table-body-row-expandable.css +0 -79
- package/dist/collection/components/data-table/table-body-row-expandable/table-body-row-expandable.js +0 -155
- package/dist/collection/components/data-table/table-component-basic.stories.js +0 -163
- package/dist/collection/components/data-table/table-component-batch-actions.stories.js +0 -129
- package/dist/collection/components/data-table/table-component-bodydata.stories.js +0 -58
- package/dist/collection/components/data-table/table-component-custom-width.stories.js +0 -198
- package/dist/collection/components/data-table/table-component-event-listeners.stories.js +0 -153
- package/dist/collection/components/data-table/table-component-expandable-rows.stories.js +0 -137
- package/dist/collection/components/data-table/table-component-filtering.stories.js +0 -139
- package/dist/collection/components/data-table/table-component-multiselect.stories.js +0 -160
- package/dist/collection/components/data-table/table-component-pagination.stories.js +0 -129
- package/dist/collection/components/data-table/table-component-sorting.stories.js +0 -107
- package/dist/collection/components/data-table/table-footer/table-footer.css +0 -93
- package/dist/collection/components/data-table/table-footer/table-footer.js +0 -355
- package/dist/collection/components/data-table/table-header/table-header.css +0 -204
- package/dist/collection/components/data-table/table-header/table-header.js +0 -153
- package/dist/collection/components/data-table/table-header-cell/table-header-cell.css +0 -126
- package/dist/collection/components/data-table/table-header-cell/table-header-cell.js +0 -320
- package/dist/collection/components/data-table/table-toolbar/table-toolbar.css +0 -92
- package/dist/collection/components/data-table/table-toolbar/table-toolbar.js +0 -142
- package/dist/collection/components/datetime/datetime.css +0 -375
- package/dist/collection/components/datetime/datetime.js +0 -251
- package/dist/collection/components/datetime/datetime.stories.js +0 -149
- package/dist/collection/components/divider/divider.stories.js +0 -116
- package/dist/collection/components/dropdown/dropdown-filter/dropdown-filter.js +0 -339
- package/dist/collection/components/dropdown/dropdown-filter/dropdown-filter.stories.js +0 -130
- package/dist/collection/components/dropdown/dropdown-native.stories.js +0 -90
- package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +0 -185
- package/dist/collection/components/dropdown/dropdown-wc-default.stories.js +0 -151
- package/dist/collection/components/dropdown/dropdown-wc-multiselect.stories.js +0 -146
- package/dist/collection/components/dropdown/dropdown.css +0 -891
- package/dist/collection/components/dropdown/dropdown.js +0 -554
- package/dist/collection/components/footer/footer.stories.js +0 -100
- package/dist/collection/components/header/header-all.stories.js +0 -217
- package/dist/collection/components/header/header-default.stories.js +0 -47
- package/dist/collection/components/header/header-inline.stories.js +0 -113
- package/dist/collection/components/header/header-search.stories.js +0 -263
- package/dist/collection/components/header/header-toolbar.stories.js +0 -204
- package/dist/collection/components/icon/icon-font.stories.js +0 -57
- package/dist/collection/components/icon/icon-web-component.stories.js +0 -51
- package/dist/collection/components/icon/icon.css +0 -16
- package/dist/collection/components/icon/icon.js +0 -89
- package/dist/collection/components/icon/iconsArray.js +0 -2
- package/dist/collection/components/link/link.stories.js +0 -45
- package/dist/collection/components/message/message.stories.js +0 -117
- package/dist/collection/components/modal/modal-native.stories.js +0 -121
- package/dist/collection/components/modal/modal-webcomponent.stories.js +0 -78
- package/dist/collection/components/modal/modal.css +0 -324
- package/dist/collection/components/modal/modal.js +0 -146
- package/dist/collection/components/popover-canvas/popover-canvas.css +0 -20
- package/dist/collection/components/popover-canvas/popover-canvas.js +0 -190
- package/dist/collection/components/popover-canvas/popover-canvas.stories.js +0 -87
- package/dist/collection/components/popover-menu/popover-menu-icons.stories.js +0 -132
- package/dist/collection/components/popover-menu/popover-menu.css +0 -19
- package/dist/collection/components/popover-menu/popover-menu.js +0 -189
- package/dist/collection/components/popover-menu/popover-menu.stories.js +0 -109
- package/dist/collection/components/radio-button/radio-button.stories.js +0 -68
- package/dist/collection/components/side-menu/side-menu.stories.js +0 -182
- package/dist/collection/components/slider/slider.css +0 -260
- package/dist/collection/components/slider/slider.js +0 -682
- package/dist/collection/components/slider/slider.stories.js +0 -251
- package/dist/collection/components/spinner/spinner.css +0 -79
- package/dist/collection/components/spinner/spinner.js +0 -61
- package/dist/collection/components/spinner/spinner.stories.js +0 -59
- package/dist/collection/components/stepper/stepper.stories.js +0 -139
- package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.css +0 -159
- package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.js +0 -302
- package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.stories.js +0 -65
- package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.css +0 -172
- package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.js +0 -126
- package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.stories.js +0 -43
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.css +0 -153
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.js +0 -103
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.stories.js +0 -32
- package/dist/collection/components/textarea/textarea.css +0 -283
- package/dist/collection/components/textarea/textarea.js +0 -336
- package/dist/collection/components/textarea/textarea.stories.js +0 -149
- package/dist/collection/components/textfield/textfield.css +0 -494
- package/dist/collection/components/textfield/textfield.js +0 -359
- package/dist/collection/components/textfield/textfield.stories.js +0 -222
- package/dist/collection/components/toast/toast.stories.js +0 -119
- package/dist/collection/components/toggle/toggle.stories.js +0 -62
- package/dist/collection/components/tooltip/tooltip.css +0 -46
- package/dist/collection/components/tooltip/tooltip.js +0 -200
- package/dist/collection/components/tooltip/tooltip.stories.js +0 -113
- package/dist/collection/components/utility/colour/background-color.stories.js +0 -96
- package/dist/collection/components/utility/colour/text-color.stories.js +0 -94
- package/dist/collection/foundations-stories/colour/colour-brand.stories.js +0 -38
- package/dist/collection/foundations-stories/colour/colour-scales.stories.js +0 -71
- package/dist/collection/foundations-stories/colour/colour-semantic.stories.js +0 -40
- package/dist/collection/foundations-stories/grid/grid.stories.js +0 -386
- package/dist/collection/foundations-stories/spacing/spacing-element.stories.js +0 -100
- package/dist/collection/foundations-stories/spacing/spacing-layout.stories.js +0 -94
- package/dist/collection/foundations-stories/typography/typography-body.stories.js +0 -16
- package/dist/collection/foundations-stories/typography/typography-detail.stories.js +0 -17
- package/dist/collection/foundations-stories/typography/typography-headline.stories.js +0 -39
- package/dist/collection/foundations-stories/typography/typography-paragraph.stories.js +0 -12
- package/dist/collection/index.js +0 -1
- package/dist/collection/stories/assets/code-brackets.svg +0 -1
- package/dist/collection/stories/assets/colors.svg +0 -1
- package/dist/collection/stories/assets/comments.svg +0 -1
- package/dist/collection/stories/assets/direction.svg +0 -1
- package/dist/collection/stories/assets/flow.svg +0 -1
- package/dist/collection/stories/assets/plugin.svg +0 -1
- package/dist/collection/stories/assets/repo.svg +0 -1
- package/dist/collection/stories/assets/stackalt.svg +0 -1
- package/dist/collection/utils/utils.js +0 -12
- package/dist/esm/index-b67b15a6.js +0 -1884
- package/dist/esm/index.js +0 -1
- package/dist/esm/loader.js +0 -17
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/popper-f860750c.js +0 -1799
- package/dist/esm/sdds-accordion-item.entry.js +0 -30
- package/dist/esm/sdds-accordion.entry.js +0 -17
- package/dist/esm/sdds-badges.entry.js +0 -51
- package/dist/esm/sdds-body-cell_2.entry.js +0 -168
- package/dist/esm/sdds-button.entry.js +0 -32
- package/dist/esm/sdds-datetime.entry.js +0 -62
- package/dist/esm/sdds-dropdown-filter.entry.js +0 -88
- package/dist/esm/sdds-dropdown_2.entry.js +0 -330
- package/dist/esm/sdds-header-cell.entry.js +0 -137
- package/dist/esm/sdds-icon.entry.js +0 -38
- package/dist/esm/sdds-inline-tabs-fullbleed.entry.js +0 -92
- package/dist/esm/sdds-inline-tabs.entry.js +0 -207
- package/dist/esm/sdds-modal.entry.js +0 -45
- package/dist/esm/sdds-navigation-tabs.entry.js +0 -91
- package/dist/esm/sdds-popover-canvas.entry.js +0 -72
- package/dist/esm/sdds-popover-menu.entry.js +0 -71
- package/dist/esm/sdds-slider.entry.js +0 -332
- package/dist/esm/sdds-spinner.entry.js +0 -17
- package/dist/esm/sdds-table-body-row-expandable.entry.js +0 -77
- package/dist/esm/sdds-table-body.entry.js +0 -285
- package/dist/esm/sdds-table-footer.entry.js +0 -161
- package/dist/esm/sdds-table-header.entry.js +0 -96
- package/dist/esm/sdds-table-toolbar.entry.js +0 -62
- package/dist/esm/sdds-table.entry.js +0 -65
- package/dist/esm/sdds-textarea.entry.js +0 -57
- package/dist/esm/sdds-textfield.entry.js +0 -78
- package/dist/esm/sdds-tooltip.entry.js +0 -91
- package/dist/esm/tegel.js +0 -17
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/tegel/index.esm.js +0 -0
- package/dist/tegel/p-040efb32.entry.js +0 -1
- package/dist/tegel/p-12ca5cfa.entry.js +0 -1
- package/dist/tegel/p-157e1618.js +0 -2
- package/dist/tegel/p-1fe61cf6.entry.js +0 -1
- package/dist/tegel/p-2f376504.entry.js +0 -1
- package/dist/tegel/p-44ced895.entry.js +0 -1
- package/dist/tegel/p-4880f03d.entry.js +0 -1
- package/dist/tegel/p-4aba73a3.entry.js +0 -1
- package/dist/tegel/p-4b58a02c.entry.js +0 -1
- package/dist/tegel/p-4cb85347.entry.js +0 -1
- package/dist/tegel/p-52031b5a.entry.js +0 -1
- package/dist/tegel/p-677baf7f.entry.js +0 -1
- package/dist/tegel/p-71797eaf.entry.js +0 -1
- package/dist/tegel/p-7373284c.entry.js +0 -1
- package/dist/tegel/p-7451779b.entry.js +0 -1
- package/dist/tegel/p-77aeea3b.entry.js +0 -1
- package/dist/tegel/p-8582d6a7.entry.js +0 -1
- package/dist/tegel/p-96021bd0.entry.js +0 -1
- package/dist/tegel/p-9d8caf51.entry.js +0 -1
- package/dist/tegel/p-a5919930.entry.js +0 -1
- package/dist/tegel/p-b01cface.entry.js +0 -1
- package/dist/tegel/p-bf896643.entry.js +0 -1
- package/dist/tegel/p-c311725c.entry.js +0 -1
- package/dist/tegel/p-cf72dfd9.entry.js +0 -1
- package/dist/tegel/p-d91caec6.entry.js +0 -1
- package/dist/tegel/p-e10eec33.entry.js +0 -1
- package/dist/tegel/p-ec26fc38.js +0 -1
- package/dist/tegel/p-f2262a69.entry.js +0 -1
- package/dist/tegel/p-f2f7aa45.entry.js +0 -1
- package/dist/tegel/tegel.css +0 -101
- package/dist/tegel/tegel.esm.js +0 -1
- package/loader/cdn.js +0 -3
- package/loader/index.cjs.js +0 -3
- package/loader/index.d.ts +0 -12
- package/loader/index.es2017.js +0 -3
- package/loader/index.js +0 -4
- package/loader/package.json +0 -11
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { Host, h } from '@stencil/core';
|
|
2
|
-
export class InlineTabsFullbleed {
|
|
3
|
-
constructor() {
|
|
4
|
-
this.navWrapperElement = null; // reference to container with nav buttons
|
|
5
|
-
this.componentWidth = 0; // visible width of this component
|
|
6
|
-
this.buttonsWidth = 0; // total width of all nav items combined
|
|
7
|
-
this.scrollWidth = 0; // total amount that is possible to scroll in the nav wrapper
|
|
8
|
-
this.buttonWidth = 0; // current calculated width of the largest nav button
|
|
9
|
-
this.modeVariant = 'primary';
|
|
10
|
-
this.tabs = [];
|
|
11
|
-
this.showLeftScroll = false;
|
|
12
|
-
this.showRightScroll = false;
|
|
13
|
-
}
|
|
14
|
-
componentDidRender() {
|
|
15
|
-
this._calculateButtonWidth();
|
|
16
|
-
}
|
|
17
|
-
componentDidLoad() {
|
|
18
|
-
const resizeObserver = new ResizeObserver((entries) => {
|
|
19
|
-
for (const entry of entries) {
|
|
20
|
-
const componentWidth = entry.contentRect.width;
|
|
21
|
-
let buttonsWidth = 0;
|
|
22
|
-
const navButtons = Array.from(this.host.children);
|
|
23
|
-
navButtons.forEach((navButton) => {
|
|
24
|
-
const style = window.getComputedStyle(navButton);
|
|
25
|
-
buttonsWidth +=
|
|
26
|
-
navButton.clientWidth + parseFloat(style.marginLeft) + parseFloat(style.marginRight);
|
|
27
|
-
navButton.classList.add('sdds-inline-tabs-fullbleed--tab');
|
|
28
|
-
});
|
|
29
|
-
this.componentWidth = componentWidth;
|
|
30
|
-
this.buttonsWidth = buttonsWidth;
|
|
31
|
-
this.scrollWidth = buttonsWidth - componentWidth;
|
|
32
|
-
if (this.buttonsWidth > this.componentWidth) {
|
|
33
|
-
this._evaluateScrollButtons();
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
this.showLeftScroll = false;
|
|
37
|
-
this.showRightScroll = false;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
resizeObserver.observe(this.navWrapperElement);
|
|
42
|
-
this._calculateButtonWidth();
|
|
43
|
-
}
|
|
44
|
-
_calculateButtonWidth() {
|
|
45
|
-
let best = 0;
|
|
46
|
-
const navButtons = Array.from(this.host.children);
|
|
47
|
-
navButtons.forEach((navButton) => {
|
|
48
|
-
const style = window.getComputedStyle(navButton);
|
|
49
|
-
const width = navButton.clientWidth + parseFloat(style.marginLeft) + parseFloat(style.marginRight);
|
|
50
|
-
if (width > best) {
|
|
51
|
-
best = width;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
this.buttonWidth = best;
|
|
55
|
-
}
|
|
56
|
-
_scrollRight() {
|
|
57
|
-
const scroll = this.navWrapperElement.scrollLeft;
|
|
58
|
-
this.navWrapperElement.scrollLeft = scroll + this.buttonWidth;
|
|
59
|
-
this._evaluateScrollButtons();
|
|
60
|
-
}
|
|
61
|
-
_scrollLeft() {
|
|
62
|
-
const scroll = this.navWrapperElement.scrollLeft;
|
|
63
|
-
this.navWrapperElement.scrollLeft = scroll - this.buttonWidth;
|
|
64
|
-
this._evaluateScrollButtons();
|
|
65
|
-
}
|
|
66
|
-
_evaluateScrollButtons() {
|
|
67
|
-
const scroll = this.navWrapperElement.scrollLeft;
|
|
68
|
-
if (scroll >= this.scrollWidth) {
|
|
69
|
-
this.showRightScroll = false;
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
this.showRightScroll = true;
|
|
73
|
-
}
|
|
74
|
-
if (scroll <= 0) {
|
|
75
|
-
this.showLeftScroll = false;
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
this.showLeftScroll = true;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
render() {
|
|
82
|
-
return (h(Host, null, h("div", { class: `sdds-inline-tabs-fullbleed sdds-inline-tabs-fullbleed-${this.modeVariant}` }, h("div", { class: "sdds-inline-tabs-fullbleed-wrapper", ref: (el) => (this.navWrapperElement = el) }, h("slot", null)), h("div", { class: "sdds-inline-tabs-fullbleed-navigation" }, h("button", { class: `sdds-inline-tabs-fullbleed--forward ${this.showRightScroll ? 'sdds-inline-tabs-fullbleed--back__show' : ''}`, onClick: () => this._scrollRight() }, h("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M6.1147 17.3291C5.87062 17.0851 5.87062 16.6893 6.1147 16.4453L12.2948 10.2652C12.4412 10.1187 12.4412 9.8813 12.2948 9.73485L6.1147 3.55476C5.87062 3.31068 5.87062 2.91496 6.1147 2.67088C6.35878 2.4268 6.75451 2.4268 6.99858 2.67088L13.1787 8.85097C13.8133 9.48557 13.8133 10.5145 13.1787 11.1491L6.99858 17.3291C6.75451 17.5732 6.35878 17.5732 6.1147 17.3291Z", fill: "#0D0F13" }))), h("button", { class: `sdds-inline-tabs-fullbleed--back ${this.showLeftScroll ? 'sdds-inline-tabs-fullbleed--back__show' : ''}`, onClick: () => this._scrollLeft() }, h("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M13.8853 2.67085C14.1294 2.91493 14.1294 3.31066 13.8853 3.55473L7.70522 9.73482C7.55878 9.88127 7.55878 10.1187 7.70522 10.2652L13.8853 16.4452C14.1294 16.6893 14.1294 17.085 13.8853 17.3291C13.6412 17.5732 13.2455 17.5732 13.0014 17.3291L6.82134 11.149C6.18674 10.5144 6.18674 9.48554 6.82134 8.85094L13.0014 2.67085C13.2455 2.42677 13.6412 2.42677 13.8853 2.67085Z", fill: "#0D0F13" })))))));
|
|
83
|
-
}
|
|
84
|
-
static get is() { return "sdds-inline-tabs-fullbleed"; }
|
|
85
|
-
static get encapsulation() { return "shadow"; }
|
|
86
|
-
static get originalStyleUrls() {
|
|
87
|
-
return {
|
|
88
|
-
"$": ["inline-tabs-fullbleed.scss"]
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
static get styleUrls() {
|
|
92
|
-
return {
|
|
93
|
-
"$": ["inline-tabs-fullbleed.css"]
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
static get properties() {
|
|
97
|
-
return {
|
|
98
|
-
"modeVariant": {
|
|
99
|
-
"type": "string",
|
|
100
|
-
"mutable": false,
|
|
101
|
-
"complexType": {
|
|
102
|
-
"original": "'primary' | 'secondary'",
|
|
103
|
-
"resolved": "\"primary\" | \"secondary\"",
|
|
104
|
-
"references": {}
|
|
105
|
-
},
|
|
106
|
-
"required": false,
|
|
107
|
-
"optional": false,
|
|
108
|
-
"docs": {
|
|
109
|
-
"tags": [],
|
|
110
|
-
"text": "Variant of the tabs, primary= on white, secondary= on grey50"
|
|
111
|
-
},
|
|
112
|
-
"attribute": "mode-variant",
|
|
113
|
-
"reflect": false,
|
|
114
|
-
"defaultValue": "'primary'"
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
static get states() {
|
|
119
|
-
return {
|
|
120
|
-
"tabs": {},
|
|
121
|
-
"showLeftScroll": {},
|
|
122
|
-
"showRightScroll": {}
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
static get elementRef() { return "host"; }
|
|
126
|
-
}
|
package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.stories.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { formatHtmlPreview } from '../../../utils/utils';
|
|
2
|
-
import readme from './readme.md';
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Components/Tabs',
|
|
5
|
-
parameters: {
|
|
6
|
-
notes: readme,
|
|
7
|
-
design: [
|
|
8
|
-
{
|
|
9
|
-
name: 'Figma',
|
|
10
|
-
type: 'figma',
|
|
11
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=10544%3A32834&t=Ne6myqwca5m00de7-1',
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
name: 'Link',
|
|
15
|
-
type: 'link',
|
|
16
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=10544%3A32834&t=Ne6myqwca5m00de7-1',
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
},
|
|
20
|
-
argTypes: {
|
|
21
|
-
modeVariant: {
|
|
22
|
-
name: "Variant",
|
|
23
|
-
control: {
|
|
24
|
-
type: 'radio'
|
|
25
|
-
},
|
|
26
|
-
options: ['Primary', 'Secondary'],
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
args: {
|
|
30
|
-
modeVariant: 'Primary'
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
const Template = ({ modeVariant }) => formatHtmlPreview(`
|
|
34
|
-
<sdds-inline-tabs-fullbleed id="inline-tabs-fullbleed-example" mode-variant="${modeVariant.toLowerCase()}">
|
|
35
|
-
<a href="#">Tab name</a>
|
|
36
|
-
<a href="#" class="sdds-inline-tabs-fullbleed--tab__active">Active tab</a>
|
|
37
|
-
<a href="#">Tab name</a>
|
|
38
|
-
<a href="#">Tab name</a>
|
|
39
|
-
<a href="#" class="sdds-inline-tabs-fullbleed--tab__disabled">Disabled tab</a>
|
|
40
|
-
</sdds-inline-tabs-fullbleed>
|
|
41
|
-
`);
|
|
42
|
-
export const InlineTabsFullbleed = Template.bind({});
|
|
43
|
-
InlineTabsFullbleed.args = {};
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
.sdds-navigation-tabs {
|
|
2
|
-
box-sizing: border-box;
|
|
3
|
-
background-color: var(--sdds-navigation-tabs-bg);
|
|
4
|
-
position: relative;
|
|
5
|
-
display: flex;
|
|
6
|
-
/* tab */
|
|
7
|
-
/* tab states */
|
|
8
|
-
}
|
|
9
|
-
.sdds-navigation-tabs * {
|
|
10
|
-
box-sizing: border-box;
|
|
11
|
-
}
|
|
12
|
-
.sdds-navigation-tabs::after {
|
|
13
|
-
content: " ";
|
|
14
|
-
display: block;
|
|
15
|
-
border-bottom: 1px solid var(--sdds-navigation-tabs-horizontal-divider-bg);
|
|
16
|
-
left: 0;
|
|
17
|
-
right: 0;
|
|
18
|
-
bottom: 0;
|
|
19
|
-
position: absolute;
|
|
20
|
-
}
|
|
21
|
-
.sdds-navigation-tabs-wrapper {
|
|
22
|
-
display: flex;
|
|
23
|
-
flex-wrap: nowrap;
|
|
24
|
-
width: 100%;
|
|
25
|
-
overflow-x: scroll;
|
|
26
|
-
scrollbar-width: none;
|
|
27
|
-
}
|
|
28
|
-
.sdds-navigation-tabs-wrapper::-webkit-scrollbar {
|
|
29
|
-
display: none;
|
|
30
|
-
}
|
|
31
|
-
.sdds-navigation-tabs-forward {
|
|
32
|
-
cursor: pointer;
|
|
33
|
-
width: 48px;
|
|
34
|
-
height: 100%;
|
|
35
|
-
border: 0;
|
|
36
|
-
position: absolute;
|
|
37
|
-
right: 0;
|
|
38
|
-
top: 0;
|
|
39
|
-
background-color: var(--sdds-navigation-tabs-scroll-btn-bg);
|
|
40
|
-
display: flex;
|
|
41
|
-
justify-content: center;
|
|
42
|
-
align-items: center;
|
|
43
|
-
opacity: 0;
|
|
44
|
-
pointer-events: none;
|
|
45
|
-
}
|
|
46
|
-
.sdds-navigation-tabs-forward__show {
|
|
47
|
-
opacity: 1;
|
|
48
|
-
pointer-events: all;
|
|
49
|
-
}
|
|
50
|
-
.sdds-navigation-tabs-forward:hover {
|
|
51
|
-
background-color: var(--sdds-navigation-tabs-scroll-btn-hover-bg);
|
|
52
|
-
text-decoration: none;
|
|
53
|
-
}
|
|
54
|
-
.sdds-navigation-tabs-forward:active {
|
|
55
|
-
background-color: var(--sdds-navigation-tabs-scroll-btn-active-bg);
|
|
56
|
-
}
|
|
57
|
-
.sdds-navigation-tabs-forward:focus {
|
|
58
|
-
outline: 2px solid var(--sdds-blue-400);
|
|
59
|
-
outline-offset: -2px;
|
|
60
|
-
}
|
|
61
|
-
.sdds-navigation-tabs-back {
|
|
62
|
-
cursor: pointer;
|
|
63
|
-
width: 48px;
|
|
64
|
-
height: 100%;
|
|
65
|
-
border: 0;
|
|
66
|
-
position: absolute;
|
|
67
|
-
left: 0;
|
|
68
|
-
top: 0;
|
|
69
|
-
background-color: var(--sdds-navigation-tabs-scroll-btn-bg);
|
|
70
|
-
display: flex;
|
|
71
|
-
justify-content: center;
|
|
72
|
-
align-items: center;
|
|
73
|
-
opacity: 0;
|
|
74
|
-
pointer-events: none;
|
|
75
|
-
}
|
|
76
|
-
.sdds-navigation-tabs-back__show {
|
|
77
|
-
opacity: 1;
|
|
78
|
-
pointer-events: all;
|
|
79
|
-
}
|
|
80
|
-
.sdds-navigation-tabs-back:hover {
|
|
81
|
-
background-color: var(--sdds-navigation-tabs-scroll-btn-hover-bg);
|
|
82
|
-
}
|
|
83
|
-
.sdds-navigation-tabs-back:active {
|
|
84
|
-
background-color: var(--sdds-navigation-tabs-scroll-btn-active-bg);
|
|
85
|
-
}
|
|
86
|
-
.sdds-navigation-tabs-back:focus {
|
|
87
|
-
outline: 2px solid var(--sdds-blue-400);
|
|
88
|
-
outline-offset: -2px;
|
|
89
|
-
}
|
|
90
|
-
::slotted(.sdds-navigation-tabs-tab) {
|
|
91
|
-
font: var(--sdds-headline-07);
|
|
92
|
-
letter-spacing: var(--sdds-headline-07-ls);
|
|
93
|
-
color: rgba(0, 21, 51, 0.6);
|
|
94
|
-
padding: 26px 0;
|
|
95
|
-
margin-right: 32px;
|
|
96
|
-
text-decoration: none;
|
|
97
|
-
display: block;
|
|
98
|
-
position: relative;
|
|
99
|
-
transition: color 0.15s ease-in-out;
|
|
100
|
-
white-space: nowrap;
|
|
101
|
-
background-color: transparent;
|
|
102
|
-
border: 0;
|
|
103
|
-
}
|
|
104
|
-
::slotted(.sdds-navigation-tabs-tab)::after {
|
|
105
|
-
content: " ";
|
|
106
|
-
position: absolute;
|
|
107
|
-
bottom: 0;
|
|
108
|
-
right: 0;
|
|
109
|
-
left: 0;
|
|
110
|
-
margin-left: auto;
|
|
111
|
-
width: 0;
|
|
112
|
-
margin-right: auto;
|
|
113
|
-
height: 2px;
|
|
114
|
-
background-color: var(--sdds-navigation-tabs-tab-hover-indicator-bg);
|
|
115
|
-
transition: width 0.15s ease-in-out;
|
|
116
|
-
z-index: 10;
|
|
117
|
-
}
|
|
118
|
-
::slotted(.sdds-navigation-tabs-tab:first-child) {
|
|
119
|
-
margin-left: 32px;
|
|
120
|
-
}
|
|
121
|
-
::slotted(.sdds-navigation-tabs-tab:last-child) {
|
|
122
|
-
margin-right: 32px;
|
|
123
|
-
}
|
|
124
|
-
::slotted(.sdds-navigation-tabs-tab:hover) {
|
|
125
|
-
color: var(--sdds-navigation-tabs-tab-hover-color);
|
|
126
|
-
}
|
|
127
|
-
::slotted(.sdds-navigation-tabs-tab:hover)::after {
|
|
128
|
-
width: 100%;
|
|
129
|
-
}
|
|
130
|
-
::slotted(.sdds-navigation-tabs-tab:focus) {
|
|
131
|
-
outline: 2px solid var(--sdds-blue-400);
|
|
132
|
-
outline-offset: -2px;
|
|
133
|
-
color: var(--sdds-navigation-tabs-tab-focus-color);
|
|
134
|
-
}
|
|
135
|
-
::slotted(.sdds-navigation-tabs-tab:focus)::after {
|
|
136
|
-
width: 0;
|
|
137
|
-
}
|
|
138
|
-
::slotted(.sdds-navigation-tabs-tab-active) {
|
|
139
|
-
color: var(--sdds-navigation-tabs-tab-active-color);
|
|
140
|
-
}
|
|
141
|
-
::slotted(.sdds-navigation-tabs-tab-active)::after {
|
|
142
|
-
width: 100%;
|
|
143
|
-
--sdds-navigation-tabs-tab-active-indicator-bg: var(--sdds-blue-400);
|
|
144
|
-
background-color: var(--sdds-navigation-tabs-tab-active-indicator-bg);
|
|
145
|
-
}
|
|
146
|
-
::slotted(.sdds-navigation-tabs-tab-active:focus)::after {
|
|
147
|
-
width: 100%;
|
|
148
|
-
}
|
|
149
|
-
::slotted(.sdds-navigation-tabs-tab-disabled) {
|
|
150
|
-
color: var(--sdds-navigation-tabs-tab-active-color);
|
|
151
|
-
opacity: 0.16;
|
|
152
|
-
pointer-events: none;
|
|
153
|
-
}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { Host, h } from '@stencil/core';
|
|
2
|
-
export class NavigationTabs {
|
|
3
|
-
constructor() {
|
|
4
|
-
this.navWrapperElement = null; // reference to container with nav buttons
|
|
5
|
-
this.componentWidth = 0; // visible width of this component
|
|
6
|
-
this.buttonsWidth = 0; // total width of all nav items combined
|
|
7
|
-
this.scrollWidth = 0; // total amount that is possible to scroll in the nav wrapper
|
|
8
|
-
this.buttonWidth = 0; // current calculated width of the largest nav button
|
|
9
|
-
this.tabs = [];
|
|
10
|
-
this.showLeftScroll = false;
|
|
11
|
-
this.showRightScroll = false;
|
|
12
|
-
}
|
|
13
|
-
componentDidRender() {
|
|
14
|
-
this._calculateButtonWidth();
|
|
15
|
-
}
|
|
16
|
-
componentDidLoad() {
|
|
17
|
-
const resizeObserver = new ResizeObserver((entries) => {
|
|
18
|
-
for (const entry of entries) {
|
|
19
|
-
const componentWidth = entry.contentRect.width;
|
|
20
|
-
let buttonsWidth = 0;
|
|
21
|
-
const navButtons = Array.from(this.host.children);
|
|
22
|
-
navButtons.forEach((navButton) => {
|
|
23
|
-
const style = window.getComputedStyle(navButton);
|
|
24
|
-
buttonsWidth +=
|
|
25
|
-
navButton.clientWidth + parseFloat(style.marginLeft) + parseFloat(style.marginRight);
|
|
26
|
-
navButton.classList.add('sdds-navigation-tabs-tab');
|
|
27
|
-
});
|
|
28
|
-
this.componentWidth = componentWidth;
|
|
29
|
-
this.buttonsWidth = buttonsWidth;
|
|
30
|
-
this.scrollWidth = buttonsWidth - componentWidth;
|
|
31
|
-
if (this.buttonsWidth > this.componentWidth) {
|
|
32
|
-
this._evaluateScrollButtons();
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
this.showLeftScroll = false;
|
|
36
|
-
this.showRightScroll = false;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
resizeObserver.observe(this.navWrapperElement);
|
|
41
|
-
this._calculateButtonWidth();
|
|
42
|
-
}
|
|
43
|
-
_calculateButtonWidth() {
|
|
44
|
-
let best = 0;
|
|
45
|
-
const navButtons = Array.from(this.host.children);
|
|
46
|
-
navButtons.forEach((navButton) => {
|
|
47
|
-
const style = window.getComputedStyle(navButton);
|
|
48
|
-
const width = navButton.clientWidth + parseFloat(style.marginLeft) + parseFloat(style.marginRight);
|
|
49
|
-
if (width > best) {
|
|
50
|
-
best = width;
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
this.buttonWidth = best;
|
|
54
|
-
}
|
|
55
|
-
_scrollRight() {
|
|
56
|
-
const scroll = this.navWrapperElement.scrollLeft;
|
|
57
|
-
this.navWrapperElement.scrollLeft = scroll + this.buttonWidth;
|
|
58
|
-
this._evaluateScrollButtons();
|
|
59
|
-
}
|
|
60
|
-
_scrollLeft() {
|
|
61
|
-
const scroll = this.navWrapperElement.scrollLeft;
|
|
62
|
-
this.navWrapperElement.scrollLeft = scroll - this.buttonWidth;
|
|
63
|
-
this._evaluateScrollButtons();
|
|
64
|
-
}
|
|
65
|
-
_evaluateScrollButtons() {
|
|
66
|
-
const scroll = this.navWrapperElement.scrollLeft;
|
|
67
|
-
if (scroll >= this.scrollWidth) {
|
|
68
|
-
this.showRightScroll = false;
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
this.showRightScroll = true;
|
|
72
|
-
}
|
|
73
|
-
if (scroll <= 0) {
|
|
74
|
-
this.showLeftScroll = false;
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
this.showLeftScroll = true;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
render() {
|
|
81
|
-
return (h(Host, null, h("div", { class: "sdds-navigation-tabs" }, h("div", { class: "sdds-navigation-tabs-wrapper", ref: (el) => (this.navWrapperElement = el) }, h("slot", null)), h("div", { class: "sdds-navigation-tabs-navigation" }, h("button", { class: `sdds-navigation-tabs-forward ${this.showRightScroll ? 'sdds-navigation-tabs-forward-show' : ''}`, onClick: () => this._scrollRight() }, h("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M6.1147 17.3291C5.87062 17.0851 5.87062 16.6893 6.1147 16.4453L12.2948 10.2652C12.4412 10.1187 12.4412 9.8813 12.2948 9.73485L6.1147 3.55476C5.87062 3.31068 5.87062 2.91496 6.1147 2.67088C6.35878 2.4268 6.75451 2.4268 6.99858 2.67088L13.1787 8.85097C13.8133 9.48557 13.8133 10.5145 13.1787 11.1491L6.99858 17.3291C6.75451 17.5732 6.35878 17.5732 6.1147 17.3291Z", fill: "#0D0F13" }))), h("button", { class: `sdds-navigation-tabs-back ${this.showLeftScroll ? 'sdds-navigation-tabs-back-show' : ''}`, onClick: () => this._scrollLeft() }, h("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M13.8853 2.67085C14.1294 2.91493 14.1294 3.31066 13.8853 3.55473L7.70522 9.73482C7.55878 9.88127 7.55878 10.1187 7.70522 10.2652L13.8853 16.4452C14.1294 16.6893 14.1294 17.085 13.8853 17.3291C13.6412 17.5732 13.2455 17.5732 13.0014 17.3291L6.82134 11.149C6.18674 10.5144 6.18674 9.48554 6.82134 8.85094L13.0014 2.67085C13.2455 2.42677 13.6412 2.42677 13.8853 2.67085Z", fill: "#0D0F13" })))))));
|
|
82
|
-
}
|
|
83
|
-
static get is() { return "sdds-navigation-tabs"; }
|
|
84
|
-
static get encapsulation() { return "shadow"; }
|
|
85
|
-
static get originalStyleUrls() {
|
|
86
|
-
return {
|
|
87
|
-
"$": ["navigation-tabs.scss"]
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
static get styleUrls() {
|
|
91
|
-
return {
|
|
92
|
-
"$": ["navigation-tabs.css"]
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
static get states() {
|
|
96
|
-
return {
|
|
97
|
-
"tabs": {},
|
|
98
|
-
"showLeftScroll": {},
|
|
99
|
-
"showRightScroll": {}
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
static get elementRef() { return "host"; }
|
|
103
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { formatHtmlPreview } from '../../../utils/utils';
|
|
2
|
-
import readme from './readme.md';
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Components/Tabs',
|
|
5
|
-
parameters: {
|
|
6
|
-
notes: readme,
|
|
7
|
-
design: [
|
|
8
|
-
{
|
|
9
|
-
name: 'Figma',
|
|
10
|
-
type: 'figma',
|
|
11
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=10544%3A31546&t=Ne6myqwca5m00de7-1',
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
name: 'Link',
|
|
15
|
-
type: 'link',
|
|
16
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=10544%3A31546&t=Ne6myqwca5m00de7-1',
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
// Why role="link" on a disabled link: https://www.scottohara.me/blog/2021/05/28/disabled-links.html
|
|
22
|
-
const Template = () => formatHtmlPreview(`
|
|
23
|
-
<sdds-navigation-tabs>
|
|
24
|
-
<a href="#" class="sdds-navigation-tabs-tab-active">Active tab</a>
|
|
25
|
-
<a href="#">Tab name</a>
|
|
26
|
-
<a href="#">Tab name</a>
|
|
27
|
-
<a href="#">Tab name</a>
|
|
28
|
-
<a role="link" aria-disabled="true" class="sdds-navigation-tabs-tab-disabled">Disabled tab</a>
|
|
29
|
-
</sdds-navigation-tabs>
|
|
30
|
-
`);
|
|
31
|
-
export const NavigationTabs = Template.bind({});
|
|
32
|
-
NavigationTabs.args = {};
|