@scania/tegel 1.27.0 → 1.28.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/dist/cjs/index-ca8040ad.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/tds-dropdown_2.cjs.entry.js +8 -8
- package/dist/cjs/tds-footer-group.cjs.entry.js +27 -5
- package/dist/cjs/tds-footer-item.cjs.entry.js +2 -2
- package/dist/cjs/tds-footer.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-brand-symbol.cjs.entry.js +6 -2
- package/dist/cjs/tds-header-dropdown.cjs.entry.js +26 -3
- package/dist/cjs/tds-header-hamburger.cjs.entry.js +7 -1
- package/dist/cjs/tds-header-launcher-button.cjs.entry.js +2 -1
- package/dist/cjs/tds-header-launcher.cjs.entry.js +23 -2
- package/dist/cjs/tds-icon.cjs.entry.js +3 -2
- package/dist/cjs/tds-inline-tabs.cjs.entry.js +1 -1
- package/dist/cjs/tds-modal.cjs.entry.js +75 -3
- package/dist/cjs/tds-navigation-tabs.cjs.entry.js +1 -1
- package/dist/cjs/tds-popover-canvas.cjs.entry.js +3 -2
- package/dist/cjs/tds-popover-core.cjs.entry.js +55 -11
- package/dist/cjs/tds-popover-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/tds-popover-menu.cjs.entry.js +1 -1
- package/dist/cjs/tds-radio-button.cjs.entry.js +3 -1
- package/dist/cjs/tds-spinner.cjs.entry.js +1 -1
- package/dist/cjs/tds-step.cjs.entry.js +2 -1
- package/dist/cjs/tds-stepper.cjs.entry.js +2 -1
- package/dist/cjs/tds-text-field.cjs.entry.js +31 -16
- package/dist/cjs/tds-textarea.cjs.entry.js +27 -9
- package/dist/cjs/tds-toast.cjs.entry.js +10 -3
- package/dist/cjs/tds-toggle.cjs.entry.js +2 -2
- package/dist/cjs/tds-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/tegel.cjs.js +1 -1
- package/dist/collection/components/dropdown/dropdown.js +8 -8
- package/dist/collection/components/footer/footer-group/footer-group.css +23 -21
- package/dist/collection/components/footer/footer-group/footer-group.js +55 -5
- package/dist/collection/components/footer/footer-item/footer-item.css +17 -17
- package/dist/collection/components/footer/footer-item/footer-item.js +2 -2
- package/dist/collection/components/footer/footer.css +1 -1
- package/dist/collection/components/header/header-brand-symbol/header-brand-symbol.css +1 -1
- package/dist/collection/components/header/header-brand-symbol/header-brand-symbol.js +6 -2
- package/dist/collection/components/header/header-dropdown/header-dropdown.js +49 -3
- package/dist/collection/components/header/header-hamburger/header-hamburger.js +30 -1
- package/dist/collection/components/header/header-launcher/header-launcher.js +50 -2
- package/dist/collection/components/header/header-launcher-button/header-launcher-button.js +19 -1
- package/dist/collection/components/icon/icon.js +21 -2
- package/dist/collection/components/modal/modal.css +48 -43
- package/dist/collection/components/modal/modal.js +103 -3
- package/dist/collection/components/popover-canvas/popover-canvas.js +21 -2
- package/dist/collection/components/popover-core/popover-core.js +63 -10
- package/dist/collection/components/popover-core/tds-popover-core.css +123 -66
- package/dist/collection/components/popover-menu/popover-menu-item/popover-menu-item.js +2 -2
- package/dist/collection/components/popover-menu/popover-menu.js +1 -1
- package/dist/collection/components/radio-button/radio-button.js +37 -1
- package/dist/collection/components/spinner/spinner.css +62 -39
- package/dist/collection/components/stepper/step/step.js +19 -1
- package/dist/collection/components/stepper/stepper.js +20 -1
- package/dist/collection/components/tabs/inline-tabs/inline-tabs.css +0 -1
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.css +2 -3
- package/dist/collection/components/text-field/text-field.css +21 -9
- package/dist/collection/components/text-field/text-field.js +48 -15
- package/dist/collection/components/textarea/textarea.css +11 -6
- package/dist/collection/components/textarea/textarea.js +61 -8
- package/dist/collection/components/toast/toast.js +45 -3
- package/dist/collection/components/toggle/toggle.js +2 -2
- package/dist/collection/components/tooltip/tooltip.js +2 -2
- package/dist/components/{p-2d93a742.js → p-1c606f82.js} +1 -1
- package/dist/components/p-252f3d4d.js +2098 -0
- package/dist/components/p-3dcfe1f4.js +115 -0
- package/dist/components/{p-53e4cdcf.js → p-789bb453.js} +5 -3
- package/dist/components/{p-4487c541.js → p-92fb75a7.js} +4 -2
- package/dist/components/{p-663b8e51.js → p-c0b84c59.js} +9 -9
- package/dist/components/{p-83db8b35.js → p-f8a36676.js} +5 -3
- package/dist/components/tds-accordion-item.js +1 -1
- package/dist/components/tds-banner.js +1 -1
- package/dist/components/tds-datetime.js +1 -1
- package/dist/components/tds-dropdown-option.js +1 -1
- package/dist/components/tds-dropdown.js +1 -1
- package/dist/components/tds-folder-tabs.js +1 -1
- package/dist/components/tds-footer-group.js +32 -8
- package/dist/components/tds-footer-item.js +3 -3
- package/dist/components/tds-footer.js +1 -1
- package/dist/components/tds-header-brand-symbol.js +6 -2
- package/dist/components/tds-header-cell.js +1 -1
- package/dist/components/tds-header-dropdown.js +31 -7
- package/dist/components/tds-header-hamburger.js +11 -3
- package/dist/components/tds-header-launcher-button.js +1 -1
- package/dist/components/tds-header-launcher.js +29 -7
- package/dist/components/tds-icon.js +1 -1
- package/dist/components/tds-inline-tabs.js +2 -2
- package/dist/components/tds-message.js +1 -1
- package/dist/components/tds-modal.js +79 -5
- package/dist/components/tds-navigation-tabs.js +2 -2
- package/dist/components/tds-popover-canvas.js +1 -1
- package/dist/components/tds-popover-core.js +1 -1
- package/dist/components/tds-popover-menu-item.js +2 -2
- package/dist/components/tds-popover-menu.js +2 -2
- package/dist/components/tds-radio-button.js +6 -2
- package/dist/components/tds-side-menu-close-button.js +1 -1
- package/dist/components/tds-side-menu-dropdown.js +1 -1
- package/dist/components/tds-slider.js +1 -1
- package/dist/components/tds-spinner.js +1 -1
- package/dist/components/tds-step.js +4 -2
- package/dist/components/tds-stepper.js +4 -2
- package/dist/components/tds-table-body-input-wrapper.js +1 -1
- package/dist/components/tds-table-footer.js +3 -3
- package/dist/components/tds-table-header-input-wrapper.js +1 -1
- package/dist/components/tds-table-toolbar.js +1 -1
- package/dist/components/tds-text-field.js +33 -17
- package/dist/components/tds-textarea.js +43 -11
- package/dist/components/tds-toast.js +13 -4
- package/dist/components/tds-toggle.js +2 -2
- package/dist/components/tds-tooltip.js +1 -113
- package/dist/esm/index-51d04e39.js +4 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/tds-dropdown_2.entry.js +8 -8
- package/dist/esm/tds-footer-group.entry.js +27 -5
- package/dist/esm/tds-footer-item.entry.js +3 -3
- package/dist/esm/tds-footer.entry.js +1 -1
- package/dist/esm/tds-header-brand-symbol.entry.js +6 -2
- package/dist/esm/tds-header-dropdown.entry.js +26 -3
- package/dist/esm/tds-header-hamburger.entry.js +7 -1
- package/dist/esm/tds-header-launcher-button.entry.js +2 -1
- package/dist/esm/tds-header-launcher.entry.js +23 -2
- package/dist/esm/tds-icon.entry.js +3 -2
- package/dist/esm/tds-inline-tabs.entry.js +1 -1
- package/dist/esm/tds-modal.entry.js +75 -3
- package/dist/esm/tds-navigation-tabs.entry.js +1 -1
- package/dist/esm/tds-popover-canvas.entry.js +3 -2
- package/dist/esm/tds-popover-core.entry.js +55 -11
- package/dist/esm/tds-popover-menu-item.entry.js +2 -2
- package/dist/esm/tds-popover-menu.entry.js +1 -1
- package/dist/esm/tds-radio-button.entry.js +3 -1
- package/dist/esm/tds-spinner.entry.js +1 -1
- package/dist/esm/tds-step.entry.js +2 -1
- package/dist/esm/tds-stepper.entry.js +2 -1
- package/dist/esm/tds-text-field.entry.js +31 -16
- package/dist/esm/tds-textarea.entry.js +27 -9
- package/dist/esm/tds-toast.entry.js +10 -3
- package/dist/esm/tds-toggle.entry.js +2 -2
- package/dist/esm/tds-tooltip.entry.js +2 -2
- package/dist/esm/tegel.js +1 -1
- package/dist/tegel/p-033d991e.entry.js +1 -0
- package/dist/tegel/p-24db6b5b.entry.js +1 -0
- package/dist/tegel/p-27a4a7d0.entry.js +1 -0
- package/dist/tegel/p-28cf7204.entry.js +1 -0
- package/dist/tegel/p-302fea99.entry.js +1 -0
- package/dist/tegel/p-31bc440c.entry.js +1 -0
- package/dist/tegel/p-3e9ca19a.entry.js +1 -0
- package/dist/tegel/p-44ac6a20.entry.js +1 -0
- package/dist/tegel/{p-769d0503.entry.js → p-46205cfb.entry.js} +1 -1
- package/dist/tegel/p-54a20280.entry.js +1 -0
- package/dist/tegel/p-5a3ff0d3.entry.js +1 -0
- package/dist/tegel/p-660176d6.entry.js +1 -0
- package/dist/tegel/{p-eaa279dd.entry.js → p-81111221.entry.js} +1 -1
- package/dist/tegel/{p-668b7662.entry.js → p-8d7bf652.entry.js} +1 -1
- package/dist/tegel/p-b58f68f0.entry.js +1 -0
- package/dist/tegel/{p-5ba254ee.entry.js → p-c10be10e.entry.js} +1 -1
- package/dist/tegel/p-c71acb02.entry.js +1 -0
- package/dist/tegel/p-ceab8f75.entry.js +1 -0
- package/dist/tegel/p-e1abd593.entry.js +1 -0
- package/dist/tegel/p-e3c3bdac.entry.js +1 -0
- package/dist/tegel/p-e46744bc.entry.js +1 -0
- package/dist/tegel/p-ea9e7345.entry.js +1 -0
- package/dist/tegel/{p-97f10223.entry.js → p-eec22b6b.entry.js} +1 -1
- package/dist/tegel/p-f034fc0c.entry.js +1 -0
- package/dist/tegel/p-fa342278.entry.js +1 -0
- package/dist/tegel/{p-b9f81e53.entry.js → p-fc6196c4.entry.js} +1 -1
- package/dist/tegel/tegel.css +4 -4
- package/dist/tegel/tegel.esm.js +1 -1
- package/dist/types/components/footer/footer-group/footer-group.d.ts +7 -0
- package/dist/types/components/header/header-brand-symbol/header-brand-symbol.d.ts +1 -1
- package/dist/types/components/header/header-dropdown/header-dropdown.d.ts +4 -0
- package/dist/types/components/header/header-hamburger/header-hamburger.d.ts +3 -0
- package/dist/types/components/header/header-launcher/header-launcher.d.ts +4 -0
- package/dist/types/components/header/header-launcher-button/header-launcher-button.d.ts +2 -0
- package/dist/types/components/icon/icon.d.ts +2 -0
- package/dist/types/components/modal/modal.d.ts +6 -0
- package/dist/types/components/popover-canvas/popover-canvas.d.ts +2 -0
- package/dist/types/components/popover-core/popover-core.d.ts +4 -0
- package/dist/types/components/radio-button/radio-button.d.ts +4 -0
- package/dist/types/components/stepper/step/step.d.ts +1 -0
- package/dist/types/components/stepper/stepper.d.ts +2 -0
- package/dist/types/components/text-field/text-field.d.ts +6 -4
- package/dist/types/components/textarea/textarea.d.ts +10 -4
- package/dist/types/components/toast/toast.d.ts +5 -0
- package/dist/types/components.d.ts +130 -0
- package/package.json +1 -1
- package/dist/components/p-90dbeab3.js +0 -2052
- package/dist/tegel/p-035e58e6.entry.js +0 -1
- package/dist/tegel/p-22c592eb.entry.js +0 -1
- package/dist/tegel/p-288a09ef.entry.js +0 -1
- package/dist/tegel/p-4f5f152a.entry.js +0 -1
- package/dist/tegel/p-542d7b3e.entry.js +0 -1
- package/dist/tegel/p-5a7110b8.entry.js +0 -1
- package/dist/tegel/p-5db5c8f4.entry.js +0 -1
- package/dist/tegel/p-654785d2.entry.js +0 -1
- package/dist/tegel/p-66f394a2.entry.js +0 -1
- package/dist/tegel/p-727f873f.entry.js +0 -1
- package/dist/tegel/p-746e2927.entry.js +0 -1
- package/dist/tegel/p-754a4921.entry.js +0 -1
- package/dist/tegel/p-aef6b130.entry.js +0 -1
- package/dist/tegel/p-b114ec3d.entry.js +0 -1
- package/dist/tegel/p-b39ffad4.entry.js +0 -1
- package/dist/tegel/p-b686f1ad.entry.js +0 -1
- package/dist/tegel/p-c56be8d1.entry.js +0 -1
- package/dist/tegel/p-dfbbaefd.entry.js +0 -1
- package/dist/tegel/p-ea3e071f.entry.js +0 -1
- package/dist/tegel/p-ee7f07ae.entry.js +0 -1
|
@@ -13,6 +13,7 @@ const TdsHeaderLauncher = class {
|
|
|
13
13
|
this.open = false;
|
|
14
14
|
this.buttonEl = undefined;
|
|
15
15
|
this.hasListTypeMenu = false;
|
|
16
|
+
this.tdsAriaLabel = undefined;
|
|
16
17
|
}
|
|
17
18
|
onAnyClick(event) {
|
|
18
19
|
// Source: https://lamplightdev.com/blog/2021/04/10/how-to-detect-clicks-outside-of-a-web-component/
|
|
@@ -21,12 +22,32 @@ const TdsHeaderLauncher = class {
|
|
|
21
22
|
this.open = false;
|
|
22
23
|
}
|
|
23
24
|
}
|
|
25
|
+
handleKeyDown(event) {
|
|
26
|
+
if (event.key === 'Escape' && this.open) {
|
|
27
|
+
this.open = false;
|
|
28
|
+
this.buttonEl.shadowRoot.querySelector('button').focus();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
24
31
|
componentDidLoad() {
|
|
25
32
|
const hasListTypeMenu = !!this.host.querySelector('tds-header-launcher-list');
|
|
26
33
|
this.hasListTypeMenu = hasListTypeMenu;
|
|
27
34
|
}
|
|
28
35
|
toggleLauncher() {
|
|
29
36
|
this.open = !this.open;
|
|
37
|
+
if (this.open) {
|
|
38
|
+
requestAnimationFrame(() => {
|
|
39
|
+
const selectors = "a, [tabindex='0']";
|
|
40
|
+
const firstFocusableElement = this.host.shadowRoot.querySelector(selectors) || this.host.querySelector(selectors);
|
|
41
|
+
if (firstFocusableElement instanceof HTMLElement) {
|
|
42
|
+
firstFocusableElement.focus();
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
connectedCallback() {
|
|
48
|
+
if (!this.tdsAriaLabel) {
|
|
49
|
+
console.warn('Tegel Header Launcher component: missing tdsAriaLabel prop');
|
|
50
|
+
}
|
|
30
51
|
}
|
|
31
52
|
render() {
|
|
32
53
|
this.ariaAttributes = Object.assign(Object.assign({}, this.ariaAttributes), inheritAriaAttributes(this.host, ['role']));
|
|
@@ -35,11 +56,11 @@ const TdsHeaderLauncher = class {
|
|
|
35
56
|
}, 'ref': (el) => {
|
|
36
57
|
this.buttonEl = el;
|
|
37
58
|
} });
|
|
38
|
-
return (h(Host, { key: '
|
|
59
|
+
return (h(Host, { key: '3a0100f1429a1e09a5745c6b74835bddb6ba5157' }, h("div", { key: '50220e92372ac5496a4b589441e4920375169e79', class: {
|
|
39
60
|
'wrapper': true,
|
|
40
61
|
'state-open': this.open,
|
|
41
62
|
'state-list-type-menu': this.hasListTypeMenu,
|
|
42
|
-
} }, h("tds-header-launcher-button", Object.assign({ key: '
|
|
63
|
+
} }, h("tds-header-launcher-button", Object.assign({ key: 'd58c3ba5f08809487eeca1e6ce8a31879f0c52d9' }, buttonAttributes, { "tds-aria-label": this.tdsAriaLabel })), this.buttonEl && (h("tds-popover-canvas", { key: '4806b02e07aef32a640eedc1f0f76285950ec384', id: `tds-launcher-${this.uuid}`, class: "menu", referenceEl: this.buttonEl, placement: "bottom-start", show: this.open, offsetDistance: 0, modifiers: [
|
|
43
64
|
{
|
|
44
65
|
name: 'flip',
|
|
45
66
|
options: {
|
|
@@ -11,12 +11,13 @@ const Icon = class {
|
|
|
11
11
|
registerInstance(this, hostRef);
|
|
12
12
|
this.setIcons = () => this.arrayOfIcons.map((element) => {
|
|
13
13
|
if (element.name === this.name) {
|
|
14
|
-
return (h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", "aria-labelledby": this.svgTitle ? `title-${this.name}` : undefined, "aria-describedby": this.svgDescription ? `desc-${this.name}` : undefined, role: "img", style: { fontSize: this.size }, height: this.size, width: this.size }, this.svgTitle && h("title", { id: `title-${this.name}` }, this.svgTitle), this.svgDescription && h("desc", { id: `desc-${this.name}` }, this.svgDescription), h("path", { fill: "currentColor", d: element.definition })));
|
|
14
|
+
return (h("svg", { "aria-hidden": this.tdsAriaHidden, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", "aria-labelledby": this.svgTitle ? `title-${this.name}` : undefined, "aria-describedby": this.svgDescription ? `desc-${this.name}` : undefined, role: "img", style: { fontSize: this.size }, height: this.size, width: this.size }, this.svgTitle && h("title", { id: `title-${this.name}` }, this.svgTitle), this.svgDescription && h("desc", { id: `desc-${this.name}` }, this.svgDescription), h("path", { fill: "currentColor", d: element.definition })));
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
this.name = 'truck';
|
|
18
18
|
this.size = '16px';
|
|
19
19
|
this.svgTitle = undefined;
|
|
20
|
+
this.tdsAriaHidden = false;
|
|
20
21
|
this.svgDescription = undefined;
|
|
21
22
|
this.icons_object = iconsCollection;
|
|
22
23
|
this.arrayOfIcons = [];
|
|
@@ -34,7 +35,7 @@ const Icon = class {
|
|
|
34
35
|
this.arrayOfIcons = [...this.arrayOfIcons];
|
|
35
36
|
}
|
|
36
37
|
render() {
|
|
37
|
-
return h(Host, { key: '
|
|
38
|
+
return h(Host, { key: 'd19a1de2f0267b93717324d424b9c89e19bbcb21' }, this.setIcons());
|
|
38
39
|
}
|
|
39
40
|
};
|
|
40
41
|
Icon.style = TdsIconStyle0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-51d04e39.js';
|
|
2
2
|
|
|
3
|
-
const inlineTabsCss = ":host{box-sizing:border-box;display:flex;background-color:var(--tds-inline-tabs-background);position:relative}:host *{box-sizing:border-box}:host::after{content:\" \";display:block;border-bottom:1px solid var(--tds-inline-tabs-horizontal-divider-background);
|
|
3
|
+
const inlineTabsCss = ":host{box-sizing:border-box;display:flex;background-color:var(--tds-inline-tabs-background);position:relative}:host *{box-sizing:border-box}:host::after{content:\" \";display:block;border-bottom:1px solid var(--tds-inline-tabs-horizontal-divider-background);left:0;right:0;bottom:0;position:absolute}:host .wrapper{display:flex;flex-wrap:nowrap;white-space:nowrap;width:100%;overflow-x:scroll;scrollbar-width:none;gap:16px}:host .wrapper::-webkit-scrollbar{display:none}:host .scroll-right-button{right:0;z-index:1}:host .scroll-left-button{left:0;z-index:1}:host .scroll-right-button,:host .scroll-left-button{color:var(--tds-folder-tabs-scroll-btn-color);cursor:pointer;border:0;width:0;background-color:var(--tds-inline-tabs-scroll-btn-background);display:none;justify-content:center;align-items:center;opacity:0;pointer-events:none;position:sticky}:host .scroll-right-button.show,:host .scroll-left-button.show{min-width:48px;display:block;opacity:1;pointer-events:all}:host .scroll-right-button:hover,:host .scroll-left-button:hover{background-color:var(--tds-folder-tabs-scroll-btn-background-hover)}:host .scroll-right-button:active,:host .scroll-left-button:active{background-color:var(--tds-folder-tabs-scroll-btn-background-active)}:host .scroll-right-button:focus,:host .scroll-left-button:focus{outline:2px solid var(--tds-blue-400);outline-offset:-2px}:host .scroll-right-button svg,:host .scroll-left-button svg{fill:var(--tds-folder-tabs-scroll-btn-color)}";
|
|
4
4
|
const TdsInlineTabsStyle0 = inlineTabsCss;
|
|
5
5
|
|
|
6
6
|
const TdsInlineTabs = class {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-51d04e39.js';
|
|
2
2
|
import { h as hasSlot } from './hasSlot-d52114d0.js';
|
|
3
|
+
import { g as generateUniqueId } from './generateUniqueId-7934d315.js';
|
|
3
4
|
|
|
4
|
-
const modalCss = ".tds-modal{box-sizing:border-box;background-color:var(--
|
|
5
|
+
const modalCss = ".tds-modal{box-sizing:border-box;background-color:var(--background-elevation-layer-02);margin:auto;position:relative;border-radius:var(--radius-narrow);max-height:85vh;overflow-y:auto;pointer-events:auto}.tds-modal *{box-sizing:border-box}.tds-modal::-webkit-scrollbar{width:6px;background-color:transparent}.tds-modal::-webkit-scrollbar-track{background-color:transparent}.tds-modal::-webkit-scrollbar-thumb{background-color:var(--foreground-elements-transparparent-discrete);border-radius:3px}.tds-modal__actions-sticky{overflow:hidden;display:flex;flex-direction:column}.tds-modal__actions-sticky .body{font-family:var(--body-01-font-family);font-size:var(--body-01-font-size);line-height:var(--body-01-line-height);font-weight:var(--body-01-font-weight);letter-spacing:var(--body-01-letter-spacing);text-transform:var(--body-01-text-transform);max-height:calc(85vh - 36px);overflow-y:auto}.tds-modal__actions-sticky slot[name=actions]{bottom:-1px;left:0;right:0;background-color:var(--background-elevation-layer-02);padding:24px 16px 16px;display:flex;gap:16px}.tds-modal__actions-static slot[name=actions]{background-color:var(--background-elevation-layer-02);display:flex;gap:16px;padding:24px 16px 16px}@media (min-width: 320px){.tds-modal-xs{width:100%}.tds-modal-sm{width:100%}.tds-modal-md{width:100%}.tds-modal-lg{width:100%}}@media (min-width: 672px){.tds-modal-xs{width:50%}.tds-modal-sm{width:62.5%}.tds-modal-md{width:75%}.tds-modal-lg{width:100%}}@media (min-width: 1056px){.tds-modal-xs{width:31.25%}.tds-modal-sm{width:43.75%}.tds-modal-md{width:62.5%}.tds-modal-lg{width:75%}}@media (min-width: 1312px){.tds-modal-xs{width:31.25%}.tds-modal-sm{width:37.5%}.tds-modal-md{width:62.5%}.tds-modal-lg{width:75%}}@media (min-width: 1584px){.tds-modal-xs{width:25%}.tds-modal-sm{width:37.5%}.tds-modal-md{width:50%}.tds-modal-lg{width:75%}}@media (max-width: 320px){.tds-modal-md,.tds-modal-lg,.tds-modal-sm{height:100%}.tds-modal-md slot[name=actions]::slotted(*),.tds-modal-lg slot[name=actions]::slotted(*),.tds-modal-sm slot[name=actions]::slotted(*){display:flex}}.header{display:flex;padding:16px;position:sticky;top:0;background-color:var(--background-elevation-layer-02);z-index:1}.header,slot[name=header]::slotted(*){font-family:var(--headline-05-font-family);font-size:var(--headline-05-font-size);line-height:var(--headline-05-line-height);font-weight:var(--headline-05-font-weight);letter-spacing:var(--headline-05-letter-spacing);text-transform:var(--headline-05-text-transform);color:var(--foreground-text-strong);margin:0;flex:1}.body{font-family:var(--body-01-font-family);font-size:var(--body-01-font-size);line-height:var(--body-01-line-height);font-weight:var(--body-01-font-weight);letter-spacing:var(--body-01-letter-spacing);text-transform:var(--body-01-text-transform);color:var(--foreground-text-strong);overflow-y:visible;padding:0 16px 16px}.body::-webkit-scrollbar{width:6px;background-color:transparent}.body::-webkit-scrollbar-track{background-color:transparent}.body::-webkit-scrollbar-thumb{background-color:var(--foreground-elements-transparparent-discrete);border-radius:3px}.tds-modal-backdrop{box-sizing:border-box;position:fixed;top:0;right:0;bottom:0;left:0;background-color:var(--background-elevation-scrim);pointer-events:auto}.tds-modal-backdrop *{box-sizing:border-box}button.tds-modal-close{margin:0 0 auto auto;background-color:transparent;border:0;padding:0;appearance:unset}.tds-modal-close{display:inline-block;height:auto;color:var(--foreground-text-strong);cursor:pointer}.tds-modal-close:focus{outline:2px solid var(--tds-blue-400);outline-offset:-2px}@media (min-width: 320px){.tds-modal-close{margin-left:16px}}@media (min-width: 1056px){.tds-modal-close{margin-left:48px}}.tds-modal-close-btn{display:inline-block;height:auto;background-repeat:no-repeat;cursor:pointer}@media (min-width: 320px){.tds-modal-close-btn{margin-left:16px}}@media (min-width: 1056px){.tds-modal-close-btn{margin-left:48px}}.tds-modal-close-btn svg{fill:var(--foreground-text-strong)}.tds-modal-overflow{overflow:hidden}:host{box-sizing:border-box;position:fixed;top:0;right:0;bottom:0;left:0;padding:0 16px;z-index:700;pointer-events:none}:host *{box-sizing:border-box}:host .tds-modal-close{border:none;background-color:transparent}:host .tds-modal-close-btn{border:none;background-color:transparent}@media (max-width: 320px){:host{padding:0}}:host.show{display:flex}:host.hide{display:none}:host(.show){display:flex}:host(.hide){display:none}";
|
|
5
6
|
const TdsModalStyle0 = modalCss;
|
|
6
7
|
|
|
7
8
|
const TdsModal = class {
|
|
@@ -10,6 +11,7 @@ const TdsModal = class {
|
|
|
10
11
|
this.tdsClose = createEvent(this, "tdsClose", 7);
|
|
11
12
|
this.handleClose = (event) => {
|
|
12
13
|
const closeEvent = this.tdsClose.emit(event);
|
|
14
|
+
this.returnFocusOnClose();
|
|
13
15
|
if (!closeEvent.defaultPrevented) {
|
|
14
16
|
this.isShown = false;
|
|
15
17
|
}
|
|
@@ -58,15 +60,26 @@ const TdsModal = class {
|
|
|
58
60
|
this.referenceEl = undefined;
|
|
59
61
|
this.show = undefined;
|
|
60
62
|
this.closable = true;
|
|
63
|
+
this.tdsAlertDialog = 'dialog';
|
|
61
64
|
this.isShown = false;
|
|
65
|
+
this.activeElementIndex = 0;
|
|
62
66
|
}
|
|
63
67
|
/** Shows the Modal. */
|
|
64
68
|
async showModal() {
|
|
65
69
|
this.isShown = true;
|
|
70
|
+
// Set focus on first element when opened
|
|
71
|
+
requestAnimationFrame(() => {
|
|
72
|
+
const focusableElements = this.getFocusableElements();
|
|
73
|
+
if (focusableElements.length > 0) {
|
|
74
|
+
focusableElements[0].focus();
|
|
75
|
+
this.activeElementIndex = 0;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
66
78
|
}
|
|
67
79
|
/** Closes the Modal. */
|
|
68
80
|
async closeModal() {
|
|
69
81
|
this.isShown = false;
|
|
82
|
+
this.returnFocusOnClose();
|
|
70
83
|
}
|
|
71
84
|
connectedCallback() {
|
|
72
85
|
if (this.closable === undefined) {
|
|
@@ -104,6 +117,63 @@ const TdsModal = class {
|
|
|
104
117
|
dismissButton.removeEventListener('click', this.handleClose);
|
|
105
118
|
});
|
|
106
119
|
}
|
|
120
|
+
returnFocusOnClose() {
|
|
121
|
+
var _a;
|
|
122
|
+
let referenceEl = (_a = this.referenceEl) !== null && _a !== void 0 ? _a : document.querySelector(this.selector);
|
|
123
|
+
const potentialReferenceElements = ['BUTTON', 'A', 'INPUT'];
|
|
124
|
+
// If referenced element is a custom element eg: tds-button we find the interactive element inside
|
|
125
|
+
if (potentialReferenceElements.indexOf(referenceEl.tagName) < 0) {
|
|
126
|
+
referenceEl = referenceEl.querySelectorAll(potentialReferenceElements.join(','))[0];
|
|
127
|
+
}
|
|
128
|
+
referenceEl.focus();
|
|
129
|
+
}
|
|
130
|
+
getFocusableElements() {
|
|
131
|
+
const focusableSelectors = [
|
|
132
|
+
'a[href]',
|
|
133
|
+
'button:not([disabled])',
|
|
134
|
+
'textarea:not([disabled])',
|
|
135
|
+
'input:not([disabled])',
|
|
136
|
+
'select:not([disabled])',
|
|
137
|
+
'[tabindex]:not([tabindex="-1"])',
|
|
138
|
+
].join(',');
|
|
139
|
+
const focusableInShadowRoot = Array.from(this.host.shadowRoot.querySelectorAll(focusableSelectors));
|
|
140
|
+
const focusableInSlots = Array.from(this.host.querySelectorAll(focusableSelectors));
|
|
141
|
+
/** Focusable elements */
|
|
142
|
+
return [...focusableInShadowRoot, ...focusableInSlots];
|
|
143
|
+
}
|
|
144
|
+
handleFocusTrap(event) {
|
|
145
|
+
if (event.key === 'Escape' && this.isShown && !this.prevent) {
|
|
146
|
+
this.handleClose(event);
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
// Only trap focus if the modal is open
|
|
150
|
+
if (!this.isShown)
|
|
151
|
+
return;
|
|
152
|
+
// We care only about the Tab key
|
|
153
|
+
if (event.key !== 'Tab')
|
|
154
|
+
return;
|
|
155
|
+
const focusableElements = this.getFocusableElements();
|
|
156
|
+
// If there are no focusable elements
|
|
157
|
+
if (focusableElements.length === 0)
|
|
158
|
+
return;
|
|
159
|
+
event.preventDefault();
|
|
160
|
+
// Going backwards (Shift + Tab) on the first element => move to last
|
|
161
|
+
if (event.shiftKey) {
|
|
162
|
+
this.activeElementIndex -= 1;
|
|
163
|
+
if (this.activeElementIndex === -1) {
|
|
164
|
+
this.activeElementIndex = focusableElements.length - 1;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
// // Going forwards (Tab) on the last element => move to first
|
|
168
|
+
if (!event.shiftKey) {
|
|
169
|
+
this.activeElementIndex += 1;
|
|
170
|
+
if (this.activeElementIndex === focusableElements.length) {
|
|
171
|
+
this.activeElementIndex = 0;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
const nextElement = focusableElements[this.activeElementIndex];
|
|
175
|
+
nextElement.focus();
|
|
176
|
+
}
|
|
107
177
|
/** Adds an event listener to the dismiss buttons that closes the Modal. */
|
|
108
178
|
setDismissButtons() {
|
|
109
179
|
this.host.querySelectorAll('[data-dismiss-modal]').forEach((dismissButton) => {
|
|
@@ -113,10 +183,12 @@ const TdsModal = class {
|
|
|
113
183
|
render() {
|
|
114
184
|
const usesHeaderSlot = hasSlot('header', this.host);
|
|
115
185
|
const usesActionsSlot = hasSlot('actions', this.host);
|
|
116
|
-
|
|
186
|
+
const headerId = this.header ? `tds-modal-header-${generateUniqueId()}` : undefined;
|
|
187
|
+
const bodyId = `tds-modal-body-${generateUniqueId()}`;
|
|
188
|
+
return (h(Host, { key: '398809ea45126dd70b95422f2f7a08a481a22d53', role: this.tdsAlertDialog, "aria-modal": "true", "aria-describedby": bodyId, "aria-labelledby": headerId, class: {
|
|
117
189
|
show: this.isShown,
|
|
118
190
|
hide: !this.isShown,
|
|
119
|
-
}, onClick: (event) => this.handleOverlayClick(event) }, h("div", { key: '
|
|
191
|
+
}, onClick: (event) => this.handleOverlayClick(event) }, h("div", { key: '96e964cc4f3c6d9613fb53e340e0aa5dcd8b6d81', class: "tds-modal-backdrop" }), h("div", { key: 'af7ddc896ef35b6116ae70524d10c4b7b952e20a', class: `tds-modal tds-modal__actions-${this.actionsPosition} tds-modal-${this.size}` }, h("div", { key: '9dfcf95fcc8925cd5c97f10f29edc6cef183a0ca', id: headerId, class: "header" }, this.header && h("div", { key: '42533c25b07e696a0c61504556150018f8d3583a', class: "header-text" }, this.header), usesHeaderSlot && h("slot", { key: 'd9855a20e1763ad17d6c8b80df85796d8f6027a8', name: "header" }), this.closable && (h("button", { key: '3e99b76da7bcf39eaecbe2906e0674fd20ebe9a6', class: "tds-modal-close", "aria-label": "close", onClick: (event) => this.handleClose(event) }, h("tds-icon", { key: 'f6463437fb98ae280afe358d50a2f960914014ea', name: "cross", size: "20px" })))), h("div", { key: 'ba8ca2e65f5eac8103e6f3c431e3ae9aab2b5f72', id: bodyId, class: "body" }, h("slot", { key: '9e08cbdd00e1a60826588b15cb6ed23fc4b5b0d7', name: "body" })), usesActionsSlot && h("slot", { key: 'aeb50dfcbf6c12e80a8904d149bb15892c691d88', name: "actions" }))));
|
|
120
192
|
}
|
|
121
193
|
get host() { return getElement(this); }
|
|
122
194
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-51d04e39.js';
|
|
2
2
|
|
|
3
|
-
const navigationTabsCss = ":host{box-sizing:border-box;display:flex;background-color:var(--tds-
|
|
3
|
+
const navigationTabsCss = ":host{box-sizing:border-box;display:flex;background-color:var(--tds-navigation-tabs-background);position:relative}:host *{box-sizing:border-box}:host::after{content:\" \";display:block;border-bottom:1px solid var(--tds-navigation-tabs-horizontal-divider-background);left:0;right:0;bottom:0;position:absolute}:host .wrapper{display:flex;flex-wrap:nowrap;white-space:nowrap;width:100%;overflow-x:scroll;scrollbar-width:none;gap:16px}:host .wrapper::-webkit-scrollbar{display:none}:host .scroll-right-button{right:0;z-index:1}:host .scroll-left-button{left:0;z-index:1}:host .scroll-right-button,:host .scroll-left-button{color:var(--tds-folder-tabs-scroll-btn-color);cursor:pointer;border:0;width:0;background-color:var(--tds-inline-tabs-scroll-btn-background);display:none;justify-content:center;align-items:center;opacity:0;pointer-events:none;position:sticky}:host .scroll-right-button.show,:host .scroll-left-button.show{min-width:48px;display:block;opacity:1;pointer-events:all}:host .scroll-right-button:hover,:host .scroll-left-button:hover{background-color:var(--tds-folder-tabs-scroll-btn-background-hover)}:host .scroll-right-button:active,:host .scroll-left-button:active{background-color:var(--tds-folder-tabs-scroll-btn-background-active)}:host .scroll-right-button:focus,:host .scroll-left-button:focus{outline:2px solid var(--tds-blue-400);outline-offset:-2px}:host .scroll-right-button svg,:host .scroll-left-button svg{fill:var(--tds-folder-tabs-scroll-btn-color)}";
|
|
4
4
|
const TdsNavigationTabsStyle0 = navigationTabsCss;
|
|
5
5
|
|
|
6
6
|
const TdsNavigationTabs = class {
|
|
@@ -17,6 +17,7 @@ const TdsPopoverCanvas = class {
|
|
|
17
17
|
this.animation = 'none';
|
|
18
18
|
this.offsetDistance = 8;
|
|
19
19
|
this.modifiers = [];
|
|
20
|
+
this.tdsAlertDialog = 'dialog';
|
|
20
21
|
this.childRef = undefined;
|
|
21
22
|
}
|
|
22
23
|
/** Property for closing popover programmatically */
|
|
@@ -29,12 +30,12 @@ const TdsPopoverCanvas = class {
|
|
|
29
30
|
}
|
|
30
31
|
render() {
|
|
31
32
|
var _a;
|
|
32
|
-
return (h(Host, { key: '
|
|
33
|
+
return (h(Host, { key: '65f267d001dc720000b13f6b46010781ccd3119c' }, h("tds-popover-core", Object.assign({ key: '5a3df2dbc918a330f895fbfb4bbf1a5a6ebe2c21', role: this.tdsAlertDialog }, this.inheritedAttributes, { class: {
|
|
33
34
|
'tds-popover-canvas': true,
|
|
34
35
|
[(_a = this.inheritedAttributes.class) !== null && _a !== void 0 ? _a : '']: true,
|
|
35
36
|
}, selector: this.selector, referenceEl: this.referenceEl, show: this.show, placement: this.placement, offsetSkidding: this.offsetSkidding, offsetDistance: this.offsetDistance, modifiers: this.modifiers, trigger: 'click', ref: (el) => {
|
|
36
37
|
this.childRef = el;
|
|
37
|
-
}, defaultShow: this.defaultShow, animation: this.animation }), h("div", { key: '
|
|
38
|
+
}, defaultShow: this.defaultShow, animation: this.animation }), h("div", { key: '3c24d23c70824186c971ce3cfe79d2d14ac472a1' }, h("slot", { key: 'ca58b5e939aabdbe80ca92d747c191f08ad34b4d' })))));
|
|
38
39
|
}
|
|
39
40
|
get host() { return getElement(this); }
|
|
40
41
|
};
|