diff --git a/ci/lit-migration.mts b/ci/lit-migration.mts
index 6ebfccf13d..f270608cfa 100644
--- a/ci/lit-migration.mts
+++ b/ci/lit-migration.mts
@@ -1064,7 +1064,7 @@ declare global {
if (ts.isVariableStatement(node) && node.getText().match(/(element: E2EElement|page: E2EPage)/)) {
mutator.insertAt(node, '/** NOTE: These are too hard to migrate and are prone to errors :/ \n'
+ ' * consider that the E2EPage is now the \'document\' (you should just delete it) \n'
- + ' * and that the E2EElement equivalent is directly the SbbComponent (e.g. SbbTimeInput) */ \n');
+ + ' * and that the E2EElement equivalent is directly the SbbComponent (e.g. SbbTimeInputElement) */ \n');
}
if (ts.isCallExpression(node) && (node.expression.getText() === 'it' || node.expression.getText() === 'beforeEach')) {
diff --git a/src/components/accordion/accordion.e2e.ts b/src/components/accordion/accordion.e2e.ts
index 9d994954a5..c27e27880e 100644
--- a/src/components/accordion/accordion.e2e.ts
+++ b/src/components/accordion/accordion.e2e.ts
@@ -2,13 +2,13 @@ import { assert, expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
import { waitForCondition, waitForLitRender, EventSpy } from '../core/testing';
-import { SbbExpansionPanel } from '../expansion-panel';
-import type { SbbExpansionPanelHeader } from '../expansion-panel';
+import { SbbExpansionPanelElement } from '../expansion-panel';
+import type { SbbExpansionPanelHeaderElement } from '../expansion-panel';
-import { SbbAccordion } from './accordion';
+import { SbbAccordionElement } from './accordion';
describe('sbb-accordion', () => {
- let element: SbbAccordion;
+ let element: SbbAccordionElement;
beforeEach(async () => {
element = await fixture(html`
@@ -30,7 +30,7 @@ describe('sbb-accordion', () => {
});
it('renders', async () => {
- assert.instanceOf(element, SbbAccordion);
+ assert.instanceOf(element, SbbAccordionElement);
});
it('should set accordion context on expansion panel', async () => {
@@ -44,7 +44,7 @@ describe('sbb-accordion', () => {
});
it('should set accordion context on expansion panel when removing and adding expansion-panels', async () => {
- let panels: SbbExpansionPanel[];
+ let panels: SbbExpansionPanelElement[];
element.querySelector('sbb-expansion-panel').remove();
await waitForLitRender(element);
@@ -101,13 +101,13 @@ describe('sbb-accordion', () => {
});
it('should close others when expanding and multi = false', async () => {
- const willOpenEventSpy = new EventSpy(SbbExpansionPanel.events.willOpen);
- const panelOne: SbbExpansionPanel = element.querySelector('#panel-1');
- const headerOne: SbbExpansionPanelHeader = element.querySelector('#header-1');
- const panelTwo: SbbExpansionPanel = element.querySelector('#panel-2');
- const headerTwo: SbbExpansionPanelHeader = element.querySelector('#header-2');
- const panelThree: SbbExpansionPanel = element.querySelector('#panel-3');
- const headerThree: SbbExpansionPanelHeader = element.querySelector('#header-3');
+ const willOpenEventSpy = new EventSpy(SbbExpansionPanelElement.events.willOpen);
+ const panelOne: SbbExpansionPanelElement = element.querySelector('#panel-1');
+ const headerOne: SbbExpansionPanelHeaderElement = element.querySelector('#header-1');
+ const panelTwo: SbbExpansionPanelElement = element.querySelector('#panel-2');
+ const headerTwo: SbbExpansionPanelHeaderElement = element.querySelector('#header-2');
+ const panelThree: SbbExpansionPanelElement = element.querySelector('#panel-3');
+ const headerThree: SbbExpansionPanelHeaderElement = element.querySelector('#header-3');
for (const panel of [panelOne, panelTwo, panelThree]) {
expect(panel.expanded).to.be.equal(false);
@@ -138,13 +138,13 @@ describe('sbb-accordion', () => {
it('should not change others when expanding and multi = false', async () => {
element.multi = true;
await waitForLitRender(element);
- const willOpenEventSpy = new EventSpy(SbbExpansionPanel.events.willOpen);
- const panelOne: SbbExpansionPanel = element.querySelector('#panel-1');
- const headerOne: SbbExpansionPanelHeader = element.querySelector('#header-1');
- const panelTwo: SbbExpansionPanel = element.querySelector('#panel-2');
- const headerTwo: SbbExpansionPanelHeader = element.querySelector('#header-2');
- const panelThree: SbbExpansionPanel = element.querySelector('#panel-3');
- const headerThree: SbbExpansionPanelHeader = element.querySelector('#header-3');
+ const willOpenEventSpy = new EventSpy(SbbExpansionPanelElement.events.willOpen);
+ const panelOne: SbbExpansionPanelElement = element.querySelector('#panel-1');
+ const headerOne: SbbExpansionPanelHeaderElement = element.querySelector('#header-1');
+ const panelTwo: SbbExpansionPanelElement = element.querySelector('#panel-2');
+ const headerTwo: SbbExpansionPanelHeaderElement = element.querySelector('#header-2');
+ const panelThree: SbbExpansionPanelElement = element.querySelector('#panel-3');
+ const headerThree: SbbExpansionPanelHeaderElement = element.querySelector('#header-3');
for (const panel of [panelOne, panelTwo, panelThree]) {
expect(panel.expanded).to.be.equal(false);
@@ -175,17 +175,17 @@ describe('sbb-accordion', () => {
it('should close all panels except the first when multi changes from true to false', async () => {
element.multi = true;
await waitForLitRender(element);
- const panelOne: SbbExpansionPanel = element.querySelector('#panel-1');
- const panelTwo: SbbExpansionPanel = element.querySelector('#panel-2');
- const headerTwo: SbbExpansionPanelHeader = element.querySelector('#header-2');
- const panelThree: SbbExpansionPanel = element.querySelector('#panel-3');
- const headerThree: SbbExpansionPanelHeader = element.querySelector('#header-3');
+ const panelOne: SbbExpansionPanelElement = element.querySelector('#panel-1');
+ const panelTwo: SbbExpansionPanelElement = element.querySelector('#panel-2');
+ const headerTwo: SbbExpansionPanelHeaderElement = element.querySelector('#header-2');
+ const panelThree: SbbExpansionPanelElement = element.querySelector('#panel-3');
+ const headerThree: SbbExpansionPanelHeaderElement = element.querySelector('#header-3');
for (const panel of [panelOne, panelTwo, panelThree]) {
expect(panel.expanded).to.be.equal(false);
}
- const willOpenEventSpy = new EventSpy(SbbExpansionPanel.events.willOpen);
+ const willOpenEventSpy = new EventSpy(SbbExpansionPanelElement.events.willOpen);
headerTwo.click();
await waitForCondition(() => willOpenEventSpy.events.length === 1);
diff --git a/src/components/accordion/accordion.stories.ts b/src/components/accordion/accordion.stories.ts
index 2243fa89c3..e29387df26 100644
--- a/src/components/accordion/accordion.stories.ts
+++ b/src/components/accordion/accordion.stories.ts
@@ -7,7 +7,7 @@ import { repeat } from 'lit/directives/repeat.js';
import { styleMap } from 'lit/directives/style-map.js';
import { sbbSpread } from '../core/dom';
-import { SbbExpansionPanel } from '../expansion-panel';
+import { SbbExpansionPanelElement } from '../expansion-panel';
import readme from './readme.md?raw';
import './accordion';
@@ -244,10 +244,10 @@ const meta: Meta = {
},
actions: {
handles: [
- SbbExpansionPanel.events.willOpen,
- SbbExpansionPanel.events.didOpen,
- SbbExpansionPanel.events.willClose,
- SbbExpansionPanel.events.didClose,
+ SbbExpansionPanelElement.events.willOpen,
+ SbbExpansionPanelElement.events.didOpen,
+ SbbExpansionPanelElement.events.willClose,
+ SbbExpansionPanelElement.events.didClose,
],
},
docs: {
diff --git a/src/components/accordion/accordion.ts b/src/components/accordion/accordion.ts
index f2a82b9b0f..800f6e743e 100644
--- a/src/components/accordion/accordion.ts
+++ b/src/components/accordion/accordion.ts
@@ -3,7 +3,7 @@ import { customElement, property } from 'lit/decorators.js';
import { toggleDatasetEntry } from '../core/dom';
import { ConnectedAbortController } from '../core/eventing';
-import { SbbExpansionPanel } from '../expansion-panel';
+import { SbbExpansionPanelElement } from '../expansion-panel';
import type { TitleLevel } from '../title';
import style from './accordion.scss?lit&inline';
@@ -14,7 +14,7 @@ import style from './accordion.scss?lit&inline';
* @slot - Use the unnamed slot to add `sbb-expansion-panel` elements.
*/
@customElement('sbb-accordion')
-export class SbbAccordion extends LitElement {
+export class SbbAccordionElement extends LitElement {
public static override styles: CSSResultGroup = style;
/** The heading level for the sbb-expansion-panel-headers within the component. */
@@ -71,7 +71,7 @@ export class SbbAccordion extends LitElement {
this._expansionPanels.forEach((panel) => (panel.titleLevel = this.titleLevel));
}
- private get _expansionPanels(): SbbExpansionPanel[] {
+ private get _expansionPanels(): SbbExpansionPanelElement[] {
return Array.from(this.querySelectorAll?.('sbb-expansion-panel') ?? []);
}
@@ -81,7 +81,7 @@ export class SbbAccordion extends LitElement {
return;
}
- expansionPanels.forEach((panel: SbbExpansionPanel) => {
+ expansionPanels.forEach((panel: SbbExpansionPanelElement) => {
panel.titleLevel = this.titleLevel;
panel.disableAnimation = this.disableAnimation;
toggleDatasetEntry(panel, 'accordionFirst', false);
@@ -95,7 +95,7 @@ export class SbbAccordion extends LitElement {
super.connectedCallback();
const signal = this._abort.signal;
this.addEventListener(
- SbbExpansionPanel.events.willOpen,
+ SbbExpansionPanelElement.events.willOpen,
(e: CustomEvent) => this._closePanels(e),
{ signal },
);
@@ -113,6 +113,6 @@ export class SbbAccordion extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-accordion': SbbAccordion;
+ 'sbb-accordion': SbbAccordionElement;
}
}
diff --git a/src/components/action-group/action-group.e2e.ts b/src/components/action-group/action-group.e2e.ts
index 41dfb28815..d036d23605 100644
--- a/src/components/action-group/action-group.e2e.ts
+++ b/src/components/action-group/action-group.e2e.ts
@@ -1,14 +1,14 @@
import { assert, expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbButton } from '../button';
+import { SbbButtonElement } from '../button';
import { waitForLitRender } from '../core/testing';
-import { SbbLink } from '../link';
+import { SbbLinkElement } from '../link';
-import { SbbActionGroup } from './action-group';
+import { SbbActionGroupElement } from './action-group';
describe('sbb-action-group', () => {
- let element: SbbActionGroup;
+ let element: SbbActionGroupElement;
beforeEach(async () => {
element = await fixture(html`
@@ -26,14 +26,14 @@ describe('sbb-action-group', () => {
});
it('renders', async () => {
- assert.instanceOf(element, SbbActionGroup);
+ assert.instanceOf(element, SbbActionGroupElement);
});
describe('property sync', () => {
it('should sync default size with sbb-button', async () => {
const links = Array.from(
document.querySelectorAll('sbb-action-group sbb-button'),
- ) as SbbButton[];
+ ) as SbbButtonElement[];
expect(links.every((l) => l.size === 'l')).to.be.ok;
});
@@ -42,20 +42,24 @@ describe('sbb-action-group', () => {
await waitForLitRender(element);
const links = Array.from(
document.querySelectorAll('sbb-action-group sbb-button'),
- ) as SbbButton[];
+ ) as SbbButtonElement[];
expect(links.every((l) => l.size === 'm')).to.be.ok;
});
it('should update attributes with link-size="s"', async () => {
element.setAttribute('link-size', 's');
await waitForLitRender(element);
- const links = Array.from(document.querySelectorAll('sbb-action-group sbb-link')) as SbbLink[];
+ const links = Array.from(
+ document.querySelectorAll('sbb-action-group sbb-link'),
+ ) as SbbLinkElement[];
expect(links.every((l) => l.size === 's')).to.be.ok;
});
it('should apply variant block to sbb-link', async () => {
await waitForLitRender(element);
- const links = Array.from(document.querySelectorAll('sbb-action-group sbb-link')) as SbbLink[];
+ const links = Array.from(
+ document.querySelectorAll('sbb-action-group sbb-link'),
+ ) as SbbLinkElement[];
expect(links.every((l) => l.variant === 'block')).to.be.ok;
});
});
diff --git a/src/components/action-group/action-group.spec.ts b/src/components/action-group/action-group.spec.ts
index 9c7033bd3f..29cc9b06dc 100644
--- a/src/components/action-group/action-group.spec.ts
+++ b/src/components/action-group/action-group.spec.ts
@@ -1,9 +1,9 @@
import { expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbButton } from '../button';
+import { SbbButtonElement } from '../button';
-import { SbbActionGroup } from './action-group';
+import { SbbActionGroupElement } from './action-group';
import '.';
describe('sbb-action-group', () => {
@@ -43,8 +43,8 @@ describe('sbb-action-group', () => {
describe('property sync', () => {
const assertButtons = (
- root: SbbActionGroup,
- assertion: (link: SbbButton) => boolean,
+ root: SbbActionGroupElement,
+ assertion: (link: SbbButtonElement) => boolean,
): boolean => Array.from(root.querySelectorAll('sbb-button')).every(assertion);
it('should sync default button-size property with sbb-button', async () => {
@@ -58,7 +58,7 @@ describe('sbb-action-group', () => {
Link
- `)) as SbbActionGroup;
+ `)) as SbbActionGroupElement;
expect(assertButtons(root, (b) => b.size === 'l')).to.be.ok;
});
@@ -73,7 +73,7 @@ describe('sbb-action-group', () => {
Link
- `)) as SbbActionGroup;
+ `)) as SbbActionGroupElement;
expect(assertButtons(root, (b) => b.size === 'm')).to.be.ok;
});
@@ -88,7 +88,7 @@ describe('sbb-action-group', () => {
Link
- `)) as SbbActionGroup;
+ `)) as SbbActionGroupElement;
expect(Array.from(root.querySelectorAll('sbb-link')).every((l) => l.variant === 'block')).to
.be.ok;
});
@@ -104,7 +104,7 @@ describe('sbb-action-group', () => {
Link
- `)) as SbbActionGroup;
+ `)) as SbbActionGroupElement;
expect(Array.from(root.querySelectorAll('sbb-link')).every((l) => l.size === 's')).to.be.ok;
});
});
diff --git a/src/components/action-group/action-group.ts b/src/components/action-group/action-group.ts
index 1639362e46..a0f6a25f4c 100644
--- a/src/components/action-group/action-group.ts
+++ b/src/components/action-group/action-group.ts
@@ -13,7 +13,7 @@ import style from './action-group.scss?lit&inline';
* @slot - Use the unnamed slot to add `sbb-link` or `sbb-button` elements to the `sbb-action-group`.
*/
@customElement('sbb-action-group')
-export class SbbActionGroup extends LitElement {
+export class SbbActionGroupElement extends LitElement {
public static override styles: CSSResultGroup = style;
/**
@@ -80,6 +80,6 @@ export class SbbActionGroup extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-action-group': SbbActionGroup;
+ 'sbb-action-group': SbbActionGroupElement;
}
}
diff --git a/src/components/alert/alert-group/alert-group.e2e.ts b/src/components/alert/alert-group/alert-group.e2e.ts
index 66055b9d26..68502f5cde 100644
--- a/src/components/alert/alert-group/alert-group.e2e.ts
+++ b/src/components/alert/alert-group/alert-group.e2e.ts
@@ -1,16 +1,16 @@
import { expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbButton } from '../../button';
+import { SbbButtonElement } from '../../button';
import { waitForCondition, EventSpy, waitForLitRender } from '../../core/testing';
-import { SbbAlertGroup } from './alert-group';
+import { SbbAlertGroupElement } from './alert-group';
import '.';
import '../alert';
describe('sbb-alert-group', () => {
- let element: SbbAlertGroup;
+ let element: SbbAlertGroupElement;
it('should handle events ond states on interacting with alerts', async () => {
const alertGroupId = 'alertgroup';
@@ -28,8 +28,8 @@ describe('sbb-alert-group', () => {
Second
`);
- const didDismissAlertSpy = new EventSpy(SbbAlertGroup.events.didDismissAlert);
- const emptySpy = new EventSpy(SbbAlertGroup.events.empty);
+ const didDismissAlertSpy = new EventSpy(SbbAlertGroupElement.events.didDismissAlert);
+ const emptySpy = new EventSpy(SbbAlertGroupElement.events.empty);
// When rendering initially
await waitForLitRender(element);
@@ -43,7 +43,7 @@ describe('sbb-alert-group', () => {
// When clicking on close button of the first alert
const closeButton = element
.querySelector('sbb-alert')
- .shadowRoot.querySelector('.sbb-alert__close-button-wrapper sbb-button') as SbbButton;
+ .shadowRoot.querySelector('.sbb-alert__close-button-wrapper sbb-button') as SbbButtonElement;
closeButton.focus();
closeButton.click();
@@ -66,7 +66,7 @@ describe('sbb-alert-group', () => {
(
element
.querySelector('sbb-alert')
- .shadowRoot.querySelector('.sbb-alert__close-button-wrapper sbb-button') as SbbButton
+ .shadowRoot.querySelector('.sbb-alert__close-button-wrapper sbb-button') as SbbButtonElement
).click();
await waitForLitRender(element);
@@ -95,7 +95,7 @@ describe('sbb-alert-group', () => {
element = await fixture(
html``,
);
- const emptySpy = new EventSpy(SbbAlertGroup.events.empty);
+ const emptySpy = new EventSpy(SbbAlertGroupElement.events.empty);
// Then no title should be rendered and no empty event fired
expect(element.shadowRoot.querySelector('.sbb-alert-group__title')).to.be.null;
diff --git a/src/components/alert/alert-group/alert-group.stories.ts b/src/components/alert/alert-group/alert-group.stories.ts
index e5136aa9d3..b8a5bdbbfc 100644
--- a/src/components/alert/alert-group/alert-group.stories.ts
+++ b/src/components/alert/alert-group/alert-group.stories.ts
@@ -6,7 +6,7 @@ import { styleMap } from 'lit/directives/style-map.js';
import { sbbSpread } from '../../core/dom';
-import { SbbAlertGroup } from './alert-group';
+import { SbbAlertGroupElement } from './alert-group';
import readme from './readme.md?raw';
import '../alert';
@@ -81,7 +81,7 @@ const meta: Meta = {
],
parameters: {
actions: {
- handles: [SbbAlertGroup.events.didDismissAlert, SbbAlertGroup.events.empty],
+ handles: [SbbAlertGroupElement.events.didDismissAlert, SbbAlertGroupElement.events.empty],
},
backgrounds: {
disable: true,
diff --git a/src/components/alert/alert-group/alert-group.ts b/src/components/alert/alert-group/alert-group.ts
index 7eb16a3872..0f0c964101 100644
--- a/src/components/alert/alert-group/alert-group.ts
+++ b/src/components/alert/alert-group/alert-group.ts
@@ -5,7 +5,7 @@ import { html, unsafeStatic } from 'lit/static-html.js';
import { setAttribute } from '../../core/dom';
import { EventEmitter, ConnectedAbortController } from '../../core/eventing';
import type { TitleLevel } from '../../title';
-import { SbbAlert } from '../alert';
+import { SbbAlertElement } from '../alert';
import style from './alert-group.scss?lit&inline';
@@ -14,11 +14,11 @@ import style from './alert-group.scss?lit&inline';
*
* @slot - Use the unnamed slot to add `sbb-alert` elements to the `sbb-alert-group`.
* @slot accessibility-title - title for this `sbb-alert-group` which is only visible for screen reader users.
- * @event {CustomEvent} didDismissAlert - Emits when an alert was removed from DOM.
+ * @event {CustomEvent} didDismissAlert - Emits when an alert was removed from DOM.
* @event {CustomEvent} empty - Emits when `sbb-alert-group` becomes empty.
*/
@customElement('sbb-alert-group')
-export class SbbAlertGroup extends LitElement {
+export class SbbAlertGroupElement extends LitElement {
public static override styles: CSSResultGroup = style;
public static readonly events = {
didDismissAlert: 'didDismissAlert',
@@ -45,18 +45,18 @@ export class SbbAlertGroup extends LitElement {
@state() private _hasAlerts: boolean;
/** Emits when an alert was removed from DOM. */
- private _didDismissAlert: EventEmitter = new EventEmitter(
+ private _didDismissAlert: EventEmitter = new EventEmitter(
this,
- SbbAlertGroup.events.didDismissAlert,
+ SbbAlertGroupElement.events.didDismissAlert,
);
/** Emits when `sbb-alert-group` becomes empty. */
- private _empty: EventEmitter = new EventEmitter(this, SbbAlertGroup.events.empty);
+ private _empty: EventEmitter = new EventEmitter(this, SbbAlertGroupElement.events.empty);
private _abort = new ConnectedAbortController(this);
private _removeAlert(event: Event): void {
- const target = event.target as SbbAlert;
+ const target = event.target as SbbAlertElement;
const hasFocusInsideAlertGroup = document.activeElement === target;
target.parentNode.removeChild(target);
@@ -78,7 +78,7 @@ export class SbbAlertGroup extends LitElement {
public override connectedCallback(): void {
super.connectedCallback();
const signal = this._abort.signal;
- this.addEventListener(SbbAlert.events.dismissalRequested, (e) => this._removeAlert(e), {
+ this.addEventListener(SbbAlertElement.events.dismissalRequested, (e) => this._removeAlert(e), {
signal,
});
}
@@ -114,6 +114,6 @@ export class SbbAlertGroup extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-alert-group': SbbAlertGroup;
+ 'sbb-alert-group': SbbAlertGroupElement;
}
}
diff --git a/src/components/alert/alert-group/readme.md b/src/components/alert/alert-group/readme.md
index e41b6b627b..f8c2373af0 100644
--- a/src/components/alert/alert-group/readme.md
+++ b/src/components/alert/alert-group/readme.md
@@ -51,10 +51,10 @@ and therefore interrupts screen reader flow, to immediately read out the alert c
## Events
-| Name | Type | Description | Inherited From |
-| ----------------- | ----------------------- | ------------------------------------------- | -------------- |
-| `didDismissAlert` | `CustomEvent` | Emits when an alert was removed from DOM. | |
-| `empty` | `CustomEvent` | Emits when `sbb-alert-group` becomes empty. | |
+| Name | Type | Description | Inherited From |
+| ----------------- | ------------------------------ | ------------------------------------------- | -------------- |
+| `didDismissAlert` | `CustomEvent` | Emits when an alert was removed from DOM. | |
+| `empty` | `CustomEvent` | Emits when `sbb-alert-group` becomes empty. | |
## Slots
diff --git a/src/components/alert/alert/alert.e2e.ts b/src/components/alert/alert/alert.e2e.ts
index dc67c38a78..533606ebbf 100644
--- a/src/components/alert/alert/alert.e2e.ts
+++ b/src/components/alert/alert/alert.e2e.ts
@@ -3,19 +3,19 @@ import { html } from 'lit/static-html.js';
import { waitForCondition, EventSpy } from '../../core/testing';
-import { SbbAlert } from './alert';
+import { SbbAlertElement } from './alert';
describe('sbb-alert', () => {
- let alert: SbbAlert;
+ let alert: SbbAlertElement;
it('renders', async () => {
alert = await fixture(html``);
- assert.instanceOf(alert, SbbAlert);
+ assert.instanceOf(alert, SbbAlertElement);
});
it('should fire animation events', async () => {
- const willPresentSpy = new EventSpy(SbbAlert.events.willPresent);
- const didPresentSpy = new EventSpy(SbbAlert.events.didPresent);
+ const willPresentSpy = new EventSpy(SbbAlertElement.events.willPresent);
+ const didPresentSpy = new EventSpy(SbbAlertElement.events.didPresent);
await fixture(html`Interruption`);
diff --git a/src/components/alert/alert/alert.spec.ts b/src/components/alert/alert/alert.spec.ts
index a98a841cb7..7f26f854f8 100644
--- a/src/components/alert/alert/alert.spec.ts
+++ b/src/components/alert/alert/alert.spec.ts
@@ -1,11 +1,11 @@
import { expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import type { SbbAlert } from './alert';
+import type { SbbAlertElement } from './alert';
import './alert';
describe('sbb-alert', () => {
- let element: SbbAlert;
+ let element: SbbAlertElement;
it('should render default properties', async () => {
element = await fixture(
diff --git a/src/components/alert/alert/alert.stories.ts b/src/components/alert/alert/alert.stories.ts
index 17204dbc09..adc0c7da6d 100644
--- a/src/components/alert/alert/alert.stories.ts
+++ b/src/components/alert/alert/alert.stories.ts
@@ -6,7 +6,7 @@ import { styleMap } from 'lit/directives/style-map.js';
import { sbbSpread } from '../../core/dom';
-import { SbbAlert } from './alert';
+import { SbbAlertElement } from './alert';
import readme from './readme.md?raw';
const Default = ({ 'content-slot-text': contentSlotText, ...args }: Args): TemplateResult => html`
@@ -217,9 +217,9 @@ const meta: Meta = {
parameters: {
actions: {
handles: [
- SbbAlert.events.willPresent,
- SbbAlert.events.didPresent,
- SbbAlert.events.dismissalRequested,
+ SbbAlertElement.events.willPresent,
+ SbbAlertElement.events.didPresent,
+ SbbAlertElement.events.dismissalRequested,
],
},
backgrounds: {
diff --git a/src/components/alert/alert/alert.ts b/src/components/alert/alert/alert.ts
index cab1b118b1..6034c4cae0 100644
--- a/src/components/alert/alert/alert.ts
+++ b/src/components/alert/alert/alert.ts
@@ -31,7 +31,7 @@ import '../../title';
* @event {CustomEvent} dismissalRequested - Emits when dismissal of an alert was requested.
*/
@customElement('sbb-alert')
-export class SbbAlert extends LitElement implements LinkProperties {
+export class SbbAlertElement extends LitElement implements LinkProperties {
public static override styles: CSSResultGroup = style;
public static readonly events = {
willPresent: 'willPresent',
@@ -80,15 +80,21 @@ export class SbbAlert extends LitElement implements LinkProperties {
@property({ attribute: 'accessibility-label' }) public accessibilityLabel: string | undefined;
/** Emits when the fade in animation starts. */
- private _willPresent: EventEmitter = new EventEmitter(this, SbbAlert.events.willPresent);
+ private _willPresent: EventEmitter = new EventEmitter(
+ this,
+ SbbAlertElement.events.willPresent,
+ );
/** Emits when the fade in animation ends and the button is displayed. */
- private _didPresent: EventEmitter = new EventEmitter(this, SbbAlert.events.didPresent);
+ private _didPresent: EventEmitter = new EventEmitter(
+ this,
+ SbbAlertElement.events.didPresent,
+ );
/** Emits when dismissal of an alert was requested. */
private _dismissalRequested: EventEmitter = new EventEmitter(
this,
- SbbAlert.events.dismissalRequested,
+ SbbAlertElement.events.dismissalRequested,
);
@state() private _currentLanguage = documentLanguage();
@@ -255,6 +261,6 @@ export class SbbAlert extends LitElement implements LinkProperties {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-alert': SbbAlert;
+ 'sbb-alert': SbbAlertElement;
}
}
diff --git a/src/components/autocomplete/autocomplete.e2e.ts b/src/components/autocomplete/autocomplete.e2e.ts
index 81434ef31b..4e17bfb84d 100644
--- a/src/components/autocomplete/autocomplete.e2e.ts
+++ b/src/components/autocomplete/autocomplete.e2e.ts
@@ -3,13 +3,13 @@ import { sendKeys, sendMouse } from '@web/test-runner-commands';
import { html } from 'lit/static-html.js';
import { waitForCondition, waitForLitRender, EventSpy } from '../core/testing';
-import { SbbFormField } from '../form-field';
-import { SbbOption } from '../option';
+import { SbbFormFieldElement } from '../form-field';
+import { SbbOptionElement } from '../option';
-import { SbbAutocomplete } from './autocomplete';
+import { SbbAutocompleteElement } from './autocomplete';
describe('sbb-autocomplete', () => {
- let element: SbbAutocomplete, formField: SbbFormField, input: HTMLInputElement;
+ let element: SbbAutocompleteElement, formField: SbbFormFieldElement, input: HTMLInputElement;
beforeEach(async () => {
formField = await fixture(html`
@@ -28,8 +28,8 @@ describe('sbb-autocomplete', () => {
});
it('renders and sets the correct attributes', () => {
- assert.instanceOf(formField, SbbFormField);
- assert.instanceOf(element, SbbAutocomplete);
+ assert.instanceOf(formField, SbbFormFieldElement);
+ assert.instanceOf(element, SbbAutocompleteElement);
expect(element).not.to.have.attribute('autocomplete-origin-borderless');
@@ -43,10 +43,10 @@ describe('sbb-autocomplete', () => {
});
it('opens and closes with mouse and keyboard', async () => {
- const willOpenEventSpy = new EventSpy(SbbAutocomplete.events.willOpen);
- const didOpenEventSpy = new EventSpy(SbbAutocomplete.events.didOpen);
- const willCloseEventSpy = new EventSpy(SbbAutocomplete.events.willClose);
- const didCloseEventSpy = new EventSpy(SbbAutocomplete.events.didClose);
+ const willOpenEventSpy = new EventSpy(SbbAutocompleteElement.events.willOpen);
+ const didOpenEventSpy = new EventSpy(SbbAutocompleteElement.events.didOpen);
+ const willCloseEventSpy = new EventSpy(SbbAutocompleteElement.events.willClose);
+ const didCloseEventSpy = new EventSpy(SbbAutocompleteElement.events.didClose);
input.click();
await waitForCondition(() => willOpenEventSpy.events.length === 1);
@@ -95,9 +95,9 @@ describe('sbb-autocomplete', () => {
});
it('select by mouse', async () => {
- const willOpenEventSpy = new EventSpy(SbbAutocomplete.events.willOpen);
- const didOpenEventSpy = new EventSpy(SbbAutocomplete.events.didOpen);
- const optionSelectedEventSpy = new EventSpy(SbbOption.events.optionSelected);
+ const willOpenEventSpy = new EventSpy(SbbAutocompleteElement.events.willOpen);
+ const didOpenEventSpy = new EventSpy(SbbAutocompleteElement.events.didOpen);
+ const optionSelectedEventSpy = new EventSpy(SbbOptionElement.events.optionSelected);
input.focus();
await waitForCondition(() => willOpenEventSpy.events.length === 1);
@@ -115,9 +115,9 @@ describe('sbb-autocomplete', () => {
});
it('opens and select with keyboard', async () => {
- const didOpenEventSpy = new EventSpy(SbbAutocomplete.events.didOpen);
- const didCloseEventSpy = new EventSpy(SbbAutocomplete.events.didClose);
- const optionSelectedEventSpy = new EventSpy(SbbOption.events.optionSelected);
+ const didOpenEventSpy = new EventSpy(SbbAutocompleteElement.events.didOpen);
+ const didCloseEventSpy = new EventSpy(SbbAutocompleteElement.events.didClose);
+ const optionSelectedEventSpy = new EventSpy(SbbOptionElement.events.optionSelected);
const optOne = element.querySelector('#option-1');
const optTwo = element.querySelector('#option-2');
input.focus();
diff --git a/src/components/autocomplete/autocomplete.stories.ts b/src/components/autocomplete/autocomplete.stories.ts
index db00834537..a4650646db 100644
--- a/src/components/autocomplete/autocomplete.stories.ts
+++ b/src/components/autocomplete/autocomplete.stories.ts
@@ -15,10 +15,10 @@ import { styleMap } from 'lit/directives/style-map.js';
import { waitForComponentsReady } from '../../storybook/testing/wait-for-components-ready';
import { waitForStablePosition } from '../../storybook/testing/wait-for-stable-position';
-import type { SbbFormError } from '../form-error';
-import { SbbOption } from '../option';
+import type { SbbFormErrorElement } from '../form-error';
+import { SbbOptionElement } from '../option';
-import { SbbAutocomplete } from './autocomplete';
+import { SbbAutocompleteElement } from './autocomplete';
import readme from './readme.md?raw';
import '../form-field';
@@ -343,7 +343,7 @@ const MixedTemplate = (args): TemplateResult => html`
`;
const RequiredTemplate = (args): TemplateResult => {
- const sbbFormError: SbbFormError = document.createElement('sbb-form-error');
+ const sbbFormError: SbbFormErrorElement = document.createElement('sbb-form-error');
sbbFormError.setAttribute('slot', 'error');
sbbFormError.textContent = 'This is a required field.';
@@ -527,12 +527,12 @@ const meta: Meta = {
chromatic: { disableSnapshot: false },
actions: {
handles: [
- SbbAutocomplete.events.willOpen,
- SbbAutocomplete.events.didOpen,
- SbbAutocomplete.events.didClose,
- SbbAutocomplete.events.willClose,
+ SbbAutocompleteElement.events.willOpen,
+ SbbAutocompleteElement.events.didOpen,
+ SbbAutocompleteElement.events.didClose,
+ SbbAutocompleteElement.events.willClose,
'change',
- SbbOption.events.optionSelected,
+ SbbOptionElement.events.optionSelected,
],
},
backgrounds: {
diff --git a/src/components/autocomplete/autocomplete.ts b/src/components/autocomplete/autocomplete.ts
index 48217087f8..9c4153f948 100644
--- a/src/components/autocomplete/autocomplete.ts
+++ b/src/components/autocomplete/autocomplete.ts
@@ -21,7 +21,7 @@ import {
setAriaComboBoxAttributes,
setOverlayPosition,
} from '../core/overlay';
-import type { SbbOption } from '../option';
+import type { SbbOptionElement } from '../option';
import style from './autocomplete.scss?lit&inline';
@@ -37,7 +37,7 @@ let nextId = 0;
* @event {CustomEvent} didClose - Emits whenever the `sbb-autocomplete` is closed.
*/
@customElement('sbb-autocomplete')
-export class SbbAutocomplete extends LitElement {
+export class SbbAutocompleteElement extends LitElement {
public static override styles: CSSResultGroup = style;
public static readonly events = {
willOpen: 'willOpen',
@@ -74,16 +74,19 @@ export class SbbAutocomplete extends LitElement {
@state() private _state: SbbOverlayState = 'closed';
/** Emits whenever the `sbb-autocomplete` starts the opening transition. */
- private _willOpen: EventEmitter = new EventEmitter(this, SbbAutocomplete.events.willOpen);
+ private _willOpen: EventEmitter = new EventEmitter(this, SbbAutocompleteElement.events.willOpen);
/** Emits whenever the `sbb-autocomplete` is opened. */
- private _didOpen: EventEmitter = new EventEmitter(this, SbbAutocomplete.events.didOpen);
+ private _didOpen: EventEmitter = new EventEmitter(this, SbbAutocompleteElement.events.didOpen);
/** Emits whenever the `sbb-autocomplete` begins the closing transition. */
- private _willClose: EventEmitter = new EventEmitter(this, SbbAutocomplete.events.willClose);
+ private _willClose: EventEmitter = new EventEmitter(
+ this,
+ SbbAutocompleteElement.events.willClose,
+ );
/** Emits whenever the `sbb-autocomplete` is closed. */
- private _didClose: EventEmitter = new EventEmitter(this, SbbAutocomplete.events.didClose);
+ private _didClose: EventEmitter = new EventEmitter(this, SbbAutocompleteElement.events.didClose);
private _overlay: HTMLElement;
private _optionContainer: HTMLElement;
@@ -122,7 +125,7 @@ export class SbbAutocomplete extends LitElement {
return this.triggerElement && isValidAttribute(this.triggerElement, 'readonly');
}
- private get _options(): SbbOption[] {
+ private get _options(): SbbOptionElement[] {
return Array.from(this.querySelectorAll?.('sbb-option') ?? []);
}
@@ -175,7 +178,7 @@ export class SbbAutocomplete extends LitElement {
/** When an option is selected, update the input value and close the autocomplete. */
private _onOptionSelected(event: CustomEvent): void {
- const target = event.target as SbbOption;
+ const target = event.target as SbbOptionElement;
if (!target.selected) {
return;
}
@@ -553,6 +556,6 @@ export class SbbAutocomplete extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-autocomplete': SbbAutocomplete;
+ 'sbb-autocomplete': SbbAutocompleteElement;
}
}
diff --git a/src/components/breadcrumb/breadcrumb-group/breadcrumb-group.e2e.ts b/src/components/breadcrumb/breadcrumb-group/breadcrumb-group.e2e.ts
index 88789c6d6f..fcccc59947 100644
--- a/src/components/breadcrumb/breadcrumb-group/breadcrumb-group.e2e.ts
+++ b/src/components/breadcrumb/breadcrumb-group/breadcrumb-group.e2e.ts
@@ -3,14 +3,14 @@ import { sendKeys, setViewport } from '@web/test-runner-commands';
import { html } from 'lit/static-html.js';
import { waitForCondition, EventSpy, waitForLitRender } from '../../core/testing';
-import type { SbbBreadcrumb } from '../breadcrumb';
+import type { SbbBreadcrumbElement } from '../breadcrumb';
import '../breadcrumb';
-import { SbbBreadcrumbGroup } from './breadcrumb-group';
+import { SbbBreadcrumbGroupElement } from './breadcrumb-group';
describe('sbb-breadcrumb-group', () => {
describe('without ellipsis', () => {
- let element: SbbBreadcrumbGroup;
+ let element: SbbBreadcrumbGroupElement;
beforeEach(async () => {
element = await fixture(html`
@@ -24,13 +24,13 @@ describe('sbb-breadcrumb-group', () => {
});
it('renders', async () => {
- assert.instanceOf(element, SbbBreadcrumbGroup);
+ assert.instanceOf(element, SbbBreadcrumbGroupElement);
});
it('keyboard navigation', async () => {
- const first: SbbBreadcrumb = document.querySelector('#breadcrumb-0');
- const second: SbbBreadcrumb = document.querySelector('#breadcrumb-1');
- const third: SbbBreadcrumb = document.querySelector('#breadcrumb-2');
+ const first: SbbBreadcrumbElement = document.querySelector('#breadcrumb-0');
+ const second: SbbBreadcrumbElement = document.querySelector('#breadcrumb-1');
+ const third: SbbBreadcrumbElement = document.querySelector('#breadcrumb-2');
first.focus();
await sendKeys({ down: 'ArrowRight' });
@@ -41,7 +41,7 @@ describe('sbb-breadcrumb-group', () => {
});
describe('with ellipsis', () => {
- let breadcrumbGroup: SbbBreadcrumbGroup;
+ let breadcrumbGroup: SbbBreadcrumbGroupElement;
let ellipsisListItemElement: HTMLLIElement;
let ellipsisButton: HTMLButtonElement;
@@ -93,8 +93,8 @@ describe('sbb-breadcrumb-group', () => {
it('keyboard navigation with ellipsis', async () => {
expect(ellipsisListItemElement).not.to.be.null;
expect(ellipsisButton).not.to.be.null;
- const first: SbbBreadcrumb = document.querySelector('#breadcrumb-0');
- const last: SbbBreadcrumb = document.querySelector('#breadcrumb-6');
+ const first: SbbBreadcrumbElement = document.querySelector('#breadcrumb-0');
+ const last: SbbBreadcrumbElement = document.querySelector('#breadcrumb-6');
first.focus();
expect(document.activeElement.id).to.be.equal(first.id);
diff --git a/src/components/breadcrumb/breadcrumb-group/breadcrumb-group.ts b/src/components/breadcrumb/breadcrumb-group/breadcrumb-group.ts
index 6bd325a32d..affb522399 100644
--- a/src/components/breadcrumb/breadcrumb-group/breadcrumb-group.ts
+++ b/src/components/breadcrumb/breadcrumb-group/breadcrumb-group.ts
@@ -12,7 +12,7 @@ import {
} from '../../core/eventing';
import { i18nBreadcrumbEllipsisButtonLabel } from '../../core/i18n';
import { AgnosticResizeObserver } from '../../core/observers';
-import type { SbbBreadcrumb } from '../breadcrumb';
+import type { SbbBreadcrumbElement } from '../breadcrumb';
import style from './breadcrumb-group.scss?lit&inline';
@@ -24,11 +24,11 @@ import '../../icon';
* @slot - Use the unnamed slot to add `sbb-breadcrumb` elements.
*/
@customElement('sbb-breadcrumb-group')
-export class SbbBreadcrumbGroup extends SlotChildObserver(LitElement) {
+export class SbbBreadcrumbGroupElement extends SlotChildObserver(LitElement) {
public static override styles: CSSResultGroup = style;
/** Local instance of slotted sbb-breadcrumb elements */
- @state() private _breadcrumbs: SbbBreadcrumb[] = [];
+ @state() private _breadcrumbs: SbbBreadcrumbElement[] = [];
@state() private _state?: 'collapsed' | 'manually-expanded';
@@ -96,7 +96,7 @@ export class SbbBreadcrumbGroup extends SlotChildObserver(LitElement) {
this._evaluateCollapsedState();
const breadcrumbs = Array.from(this.children ?? []).filter(
- (e): e is SbbBreadcrumb => e.tagName === 'SBB-BREADCRUMB',
+ (e): e is SbbBreadcrumbElement => e.tagName === 'SBB-BREADCRUMB',
);
// If the slotted sbb-breadcrumb instances have not changed,
// we can skip syncing and updating the breadcrumb reference list.
@@ -131,15 +131,18 @@ export class SbbBreadcrumbGroup extends SlotChildObserver(LitElement) {
* Sets the focus on the correct element when the ellipsis breadcrumb is displayed and the user is navigating with keyboard's arrows.
*/
private _focusNextCollapsed(evt: KeyboardEvent): void {
- const arrayCollapsed: SbbBreadcrumb[] = [
+ const arrayCollapsed: SbbBreadcrumbElement[] = [
this._breadcrumbs[0],
- this.shadowRoot.querySelector('#sbb-breadcrumb-ellipsis') as SbbBreadcrumb,
+ this.shadowRoot.querySelector('#sbb-breadcrumb-ellipsis') as SbbBreadcrumbElement,
this._breadcrumbs[this._breadcrumbs.length - 1],
];
this._focusNext(evt, arrayCollapsed);
}
- private _focusNext(evt: KeyboardEvent, breadcrumbs: SbbBreadcrumb[] = this._breadcrumbs): void {
+ private _focusNext(
+ evt: KeyboardEvent,
+ breadcrumbs: SbbBreadcrumbElement[] = this._breadcrumbs,
+ ): void {
const current: number = breadcrumbs.findIndex(
(e) => e === document.activeElement || e === this.shadowRoot.activeElement,
);
@@ -206,7 +209,7 @@ export class SbbBreadcrumbGroup extends SlotChildObserver(LitElement) {
private _renderExpanded(): TemplateResult[] {
const slotName = (index: number): string => `breadcrumb-${index}`;
- return this._breadcrumbs.map((element: SbbBreadcrumb, index: number) => {
+ return this._breadcrumbs.map((element: SbbBreadcrumbElement, index: number) => {
element.setAttribute('slot', slotName(index));
return html`
@@ -242,6 +245,6 @@ export class SbbBreadcrumbGroup extends SlotChildObserver(LitElement) {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-breadcrumb-group': SbbBreadcrumbGroup;
+ 'sbb-breadcrumb-group': SbbBreadcrumbGroupElement;
}
}
diff --git a/src/components/breadcrumb/breadcrumb/breadcrumb.e2e.ts b/src/components/breadcrumb/breadcrumb/breadcrumb.e2e.ts
index 968f252ce6..58f34ad42f 100644
--- a/src/components/breadcrumb/breadcrumb/breadcrumb.e2e.ts
+++ b/src/components/breadcrumb/breadcrumb/breadcrumb.e2e.ts
@@ -3,17 +3,17 @@ import { html } from 'lit/static-html.js';
import { waitForCondition, EventSpy, waitForLitRender } from '../../core/testing';
-import { SbbBreadcrumb } from './breadcrumb';
+import { SbbBreadcrumbElement } from './breadcrumb';
describe('sbb-breadcrumb', () => {
- let element: SbbBreadcrumb;
+ let element: SbbBreadcrumbElement;
beforeEach(async () => {
element = await fixture(html`Test`);
});
it('renders', async () => {
- assert.instanceOf(element, SbbBreadcrumb);
+ assert.instanceOf(element, SbbBreadcrumbElement);
});
it('dispatches event on click', async () => {
diff --git a/src/components/breadcrumb/breadcrumb/breadcrumb.ts b/src/components/breadcrumb/breadcrumb/breadcrumb.ts
index 1237777427..caee9d7bd2 100644
--- a/src/components/breadcrumb/breadcrumb/breadcrumb.ts
+++ b/src/components/breadcrumb/breadcrumb/breadcrumb.ts
@@ -29,7 +29,7 @@ import '../../icon';
* @slot icon - Use this to display an icon as breadcrumb.
*/
@customElement('sbb-breadcrumb')
-export class SbbBreadcrumb extends SlotChildObserver(LitElement) {
+export class SbbBreadcrumbElement extends SlotChildObserver(LitElement) {
public static override styles: CSSResultGroup = style;
/** The href value you want to link to. */
@@ -119,6 +119,6 @@ export class SbbBreadcrumb extends SlotChildObserver(LitElement) {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-breadcrumb': SbbBreadcrumb;
+ 'sbb-breadcrumb': SbbBreadcrumbElement;
}
}
diff --git a/src/components/button/button.e2e.ts b/src/components/button/button.e2e.ts
index 5111ad3567..f1c3646c7f 100644
--- a/src/components/button/button.e2e.ts
+++ b/src/components/button/button.e2e.ts
@@ -4,17 +4,17 @@ import { html } from 'lit/static-html.js';
import { EventSpy, waitForCondition, waitForLitRender } from '../core/testing';
-import { SbbButton } from './button';
+import { SbbButtonElement } from './button';
describe('sbb-button', () => {
- let element: SbbButton;
+ let element: SbbButtonElement;
beforeEach(async () => {
element = await fixture(html`I am a button`);
});
it('renders', async () => {
- assert.instanceOf(element, SbbButton);
+ assert.instanceOf(element, SbbButtonElement);
});
describe('events', () => {
diff --git a/src/components/button/button.ts b/src/components/button/button.ts
index 9f90f18b92..169475d3b2 100644
--- a/src/components/button/button.ts
+++ b/src/components/button/button.ts
@@ -41,7 +41,7 @@ export type SbbButtonSize = 'l' | 'm';
* @slot icon - Slot used to display the icon, if one is set
*/
@customElement('sbb-button')
-export class SbbButton extends LitElement implements LinkButtonProperties, IsStaticProperty {
+export class SbbButtonElement extends LitElement implements LinkButtonProperties, IsStaticProperty {
public static override styles: CSSResultGroup = style;
/** Variant of the button, like primary, secondary etc. */
@@ -176,6 +176,6 @@ export class SbbButton extends LitElement implements LinkButtonProperties, IsSta
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-button': SbbButton;
+ 'sbb-button': SbbButtonElement;
}
}
diff --git a/src/components/calendar/calendar.e2e.ts b/src/components/calendar/calendar.e2e.ts
index 04c95be11a..01e43b9bf5 100644
--- a/src/components/calendar/calendar.e2e.ts
+++ b/src/components/calendar/calendar.e2e.ts
@@ -6,11 +6,11 @@ import { waitForCondition, waitForLitRender, EventSpy } from '../core/testing';
import '../button';
import '../icon';
-import { SbbCalendar } from './calendar';
+import { SbbCalendarElement } from './calendar';
describe('sbb-calendar', () => {
const selected = new Date(2023, 0, 15).getTime() / 1000;
- let element: SbbCalendar;
+ let element: SbbCalendarElement;
beforeEach(async () => {
element = await fixture(
@@ -19,7 +19,7 @@ describe('sbb-calendar', () => {
});
it('renders', async () => {
- assert.instanceOf(element, SbbCalendar);
+ assert.instanceOf(element, SbbCalendarElement);
});
it('highlights current day', async () => {
@@ -92,7 +92,7 @@ describe('sbb-calendar', () => {
});
it('selects a different date', async () => {
- const selectedSpy = new EventSpy(SbbCalendar.events.dateSelected);
+ const selectedSpy = new EventSpy(SbbCalendarElement.events.dateSelected);
const selectedDate = element.shadowRoot.querySelector('button[data-day="15 1 2023"]');
expect(selectedDate).to.have.class('sbb-calendar__selected');
@@ -110,7 +110,7 @@ describe('sbb-calendar', () => {
});
it("clicks on disabled day and doesn't change selection", async () => {
- const selectedSpy = new EventSpy(SbbCalendar.events.dateSelected);
+ const selectedSpy = new EventSpy(SbbCalendarElement.events.dateSelected);
element.max = 1674946800;
await waitForLitRender(element);
diff --git a/src/components/calendar/calendar.stories.ts b/src/components/calendar/calendar.stories.ts
index b95acbfeee..35b153a335 100644
--- a/src/components/calendar/calendar.stories.ts
+++ b/src/components/calendar/calendar.stories.ts
@@ -7,7 +7,7 @@ import { styleMap } from 'lit/directives/style-map.js';
import { sbbSpread } from '../core/dom';
-import { SbbCalendar } from './calendar';
+import { SbbCalendarElement } from './calendar';
import readme from './readme.md?raw';
const getCalendarAttr = (min, max): Record => {
@@ -186,7 +186,7 @@ const meta: Meta = {
decorators: [withActions as Decorator],
parameters: {
actions: {
- handles: [SbbCalendar.events.dateSelected],
+ handles: [SbbCalendarElement.events.dateSelected],
},
backgrounds: {
disable: true,
diff --git a/src/components/calendar/calendar.ts b/src/components/calendar/calendar.ts
index c7377c0f71..47563b8bb3 100644
--- a/src/components/calendar/calendar.ts
+++ b/src/components/calendar/calendar.ts
@@ -84,7 +84,7 @@ export type CalendarView = 'day' | 'month' | 'year';
* @event {CustomEvent} dateSelected - Event emitted on date selection.
*/
@customElement('sbb-calendar')
-export class SbbCalendar extends LitElement {
+export class SbbCalendarElement extends LitElement {
public static override styles: CSSResultGroup = style;
public static readonly events = {
dateSelected: 'dateSelected',
@@ -108,7 +108,7 @@ export class SbbCalendar extends LitElement {
/** Event emitted on date selection. */
private _dateSelected: EventEmitter = new EventEmitter(
this,
- SbbCalendar.events.dateSelected,
+ SbbCalendarElement.events.dateSelected,
);
/** The currently active date. */
@@ -1232,6 +1232,6 @@ export class SbbCalendar extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-calendar': SbbCalendar;
+ 'sbb-calendar': SbbCalendarElement;
}
}
diff --git a/src/components/card/card-action/card-action.e2e.ts b/src/components/card/card-action/card-action.e2e.ts
index 57a66adb93..fbd665c340 100644
--- a/src/components/card/card-action/card-action.e2e.ts
+++ b/src/components/card/card-action/card-action.e2e.ts
@@ -3,15 +3,15 @@ import { sendKeys } from '@web/test-runner-commands';
import { html } from 'lit/static-html.js';
import { EventSpy, waitForCondition, waitForLitRender } from '../../core/testing';
-import type { SbbCard } from '../card';
+import type { SbbCardElement } from '../card';
-import type { SbbCardAction } from './card-action';
+import type { SbbCardActionElement } from './card-action';
import '../card';
import './card-action';
describe('sbb-card-action', () => {
- let element: SbbCard;
+ let element: SbbCardElement;
it('should render an sbb-card-action as a link opening in a new window', async () => {
element = await fixture(
@@ -167,7 +167,7 @@ describe('sbb-card-action', () => {
});
describe('events', () => {
- let action: SbbCardAction;
+ let action: SbbCardActionElement;
beforeEach(async () => {
element = await fixture(
diff --git a/src/components/card/card-action/card-action.stories.ts b/src/components/card/card-action/card-action.stories.ts
index e5c13860aa..94d0d72e8b 100644
--- a/src/components/card/card-action/card-action.stories.ts
+++ b/src/components/card/card-action/card-action.stories.ts
@@ -11,7 +11,7 @@ const Template = (): TemplateResult => html`
`;
-export const SbbCardAction: StoryObj = {
+export const SbbCardActionElement: StoryObj = {
render: Template,
};
diff --git a/src/components/card/card-action/card-action.ts b/src/components/card/card-action/card-action.ts
index 58d63f3977..5d611ad607 100644
--- a/src/components/card/card-action/card-action.ts
+++ b/src/components/card/card-action/card-action.ts
@@ -21,7 +21,7 @@ import {
targetsNewWindow,
} from '../../core/interfaces';
import { AgnosticMutationObserver } from '../../core/observers';
-import type { SbbCard } from '../card';
+import type { SbbCardElement } from '../card';
import style from './card-action.scss?lit&inline';
@@ -32,7 +32,7 @@ import style from './card-action.scss?lit&inline';
* This is relevant for SEO and screen readers.
*/
@customElement('sbb-card-action')
-export class SbbCardAction extends LitElement implements LinkButtonProperties {
+export class SbbCardActionElement extends LitElement implements LinkButtonProperties {
public static override styles: CSSResultGroup = style;
/** Whether the card is active. */
@@ -79,7 +79,7 @@ export class SbbCardAction extends LitElement implements LinkButtonProperties {
}
private _abortController = new AbortController();
- private _card: SbbCard | null = null;
+ private _card: SbbCardElement | null = null;
private _cardMutationObserver = new AgnosticMutationObserver(() =>
this._checkForSlottedActions(),
);
@@ -170,6 +170,6 @@ export class SbbCardAction extends LitElement implements LinkButtonProperties {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-card-action': SbbCardAction;
+ 'sbb-card-action': SbbCardActionElement;
}
}
diff --git a/src/components/card/card-badge/card-badge.e2e.ts b/src/components/card/card-badge/card-badge.e2e.ts
index 3da10de94b..f2e2686141 100644
--- a/src/components/card/card-badge/card-badge.e2e.ts
+++ b/src/components/card/card-badge/card-badge.e2e.ts
@@ -1,13 +1,13 @@
import { assert, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbCardBadge } from './card-badge';
+import { SbbCardBadgeElement } from './card-badge';
describe('sbb-card-badge', () => {
- let element: SbbCardBadge;
+ let element: SbbCardBadgeElement;
it('renders', async () => {
element = await fixture(html``);
- assert.instanceOf(element, SbbCardBadge);
+ assert.instanceOf(element, SbbCardBadgeElement);
});
});
diff --git a/src/components/card/card-badge/card-badge.ts b/src/components/card/card-badge/card-badge.ts
index 7f857df744..41ee15368b 100644
--- a/src/components/card/card-badge/card-badge.ts
+++ b/src/components/card/card-badge/card-badge.ts
@@ -12,7 +12,7 @@ import style from './card-badge.scss?lit&inline';
* Content parts should be wrapped in `` tags to achieve correct spacings.
*/
@customElement('sbb-card-badge')
-export class SbbCardBadge extends LitElement {
+export class SbbCardBadgeElement extends LitElement {
public static override styles: CSSResultGroup = style;
/** Color of the card badge. */
@@ -55,6 +55,6 @@ export class SbbCardBadge extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-card-badge': SbbCardBadge;
+ 'sbb-card-badge': SbbCardBadgeElement;
}
}
diff --git a/src/components/card/card/card.e2e.ts b/src/components/card/card/card.e2e.ts
index b57008574a..26f6f4ea2b 100644
--- a/src/components/card/card/card.e2e.ts
+++ b/src/components/card/card/card.e2e.ts
@@ -1,15 +1,15 @@
import { assert, expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbCard } from './card';
+import { SbbCardElement } from './card';
import '../card-badge';
describe('sbb-card', () => {
- let element: SbbCard;
+ let element: SbbCardElement;
it('renders', async () => {
element = await fixture(html``);
- assert.instanceOf(element, SbbCard);
+ assert.instanceOf(element, SbbCardElement);
});
it('should render with sbb-card-badge', async () => {
diff --git a/src/components/card/card/card.ts b/src/components/card/card/card.ts
index 57dacddd84..62e69d0cbf 100644
--- a/src/components/card/card/card.ts
+++ b/src/components/card/card/card.ts
@@ -11,7 +11,7 @@ import style from './card.scss?lit&inline';
* @slot action - Use this slot to render a `sbb-card-action` component.
*/
@customElement('sbb-card')
-export class SbbCard extends LitElement {
+export class SbbCardElement extends LitElement {
public static override styles: CSSResultGroup = style;
/** Size variant, either xs, s, m, l, xl, xxl or xxxl. */
@@ -53,6 +53,6 @@ export class SbbCard extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-card': SbbCard;
+ 'sbb-card': SbbCardElement;
}
}
diff --git a/src/components/checkbox/checkbox-group/checkbox-group.e2e.ts b/src/components/checkbox/checkbox-group/checkbox-group.e2e.ts
index b23122f951..2d81621544 100644
--- a/src/components/checkbox/checkbox-group/checkbox-group.e2e.ts
+++ b/src/components/checkbox/checkbox-group/checkbox-group.e2e.ts
@@ -3,13 +3,15 @@ import { sendKeys } from '@web/test-runner-commands';
import { html } from 'lit/static-html.js';
import { waitForLitRender } from '../../core/testing';
-import { SbbCheckbox } from '../checkbox';
+import { SbbCheckboxElement } from '../checkbox';
-import { SbbCheckboxGroup } from './checkbox-group';
+import { SbbCheckboxGroupElement } from './checkbox-group';
describe('sbb-checkbox-group', () => {
- let element: SbbCheckboxGroup;
- let checkboxOne: SbbCheckbox, checkboxTwo: SbbCheckbox, checkboxThree: SbbCheckbox;
+ let element: SbbCheckboxGroupElement;
+ let checkboxOne: SbbCheckboxElement,
+ checkboxTwo: SbbCheckboxElement,
+ checkboxThree: SbbCheckboxElement;
beforeEach(async () => {
element = await fixture(html`
@@ -25,10 +27,10 @@ describe('sbb-checkbox-group', () => {
});
it('renders', async () => {
- assert.instanceOf(element, SbbCheckboxGroup);
- assert.instanceOf(checkboxOne, SbbCheckbox);
- assert.instanceOf(checkboxTwo, SbbCheckbox);
- assert.instanceOf(checkboxThree, SbbCheckbox);
+ assert.instanceOf(element, SbbCheckboxGroupElement);
+ assert.instanceOf(checkboxOne, SbbCheckboxElement);
+ assert.instanceOf(checkboxTwo, SbbCheckboxElement);
+ assert.instanceOf(checkboxThree, SbbCheckboxElement);
});
it('disabled status is inherited', async () => {
@@ -48,8 +50,10 @@ describe('sbb-checkbox-group', () => {
});
it('disabled status prevents changes', async () => {
- const checkboxes: SbbCheckbox[] = [checkboxOne, checkboxTwo, checkboxThree];
- checkboxes.forEach((check: SbbCheckbox) => expect(check).not.to.have.attribute('checked'));
+ const checkboxes: SbbCheckboxElement[] = [checkboxOne, checkboxTwo, checkboxThree];
+ checkboxes.forEach((check: SbbCheckboxElement) =>
+ expect(check).not.to.have.attribute('checked'),
+ );
element.setAttribute('disabled', 'true');
await waitForLitRender(element);
@@ -58,7 +62,9 @@ describe('sbb-checkbox-group', () => {
check.click();
}
await waitForLitRender(element);
- checkboxes.forEach((check: SbbCheckbox) => expect(check).not.to.have.attribute('checked'));
+ checkboxes.forEach((check: SbbCheckboxElement) =>
+ expect(check).not.to.have.attribute('checked'),
+ );
element.removeAttribute('disabled');
await waitForLitRender(element);
diff --git a/src/components/checkbox/checkbox-group/checkbox-group.ts b/src/components/checkbox/checkbox-group/checkbox-group.ts
index 591d57f1ec..979504b17b 100644
--- a/src/components/checkbox/checkbox-group/checkbox-group.ts
+++ b/src/components/checkbox/checkbox-group/checkbox-group.ts
@@ -10,7 +10,7 @@ import {
ConnectedAbortController,
} from '../../core/eventing';
import { SbbHorizontalFrom, SbbOrientation } from '../../core/interfaces';
-import type { SbbCheckbox, SbbCheckboxSize } from '../checkbox';
+import type { SbbCheckboxElement, SbbCheckboxSize } from '../checkbox';
import style from './checkbox-group.scss?lit&inline';
@@ -21,7 +21,7 @@ import style from './checkbox-group.scss?lit&inline';
* @slot error - Slot used to render a `sbb-form-error` inside the `sbb-checkbox-group`.
*/
@customElement('sbb-checkbox-group')
-export class SbbCheckboxGroup extends LitElement {
+export class SbbCheckboxGroupElement extends LitElement {
public static override styles: CSSResultGroup = style;
/** Whether the checkbox group is disabled. */
@@ -102,8 +102,9 @@ export class SbbCheckboxGroup extends LitElement {
}
private _handleKeyDown(evt: KeyboardEvent): void {
- const enabledCheckboxes: SbbCheckbox[] = this._checkboxes.filter(
- (checkbox: SbbCheckbox) => !checkbox.disabled && interactivityChecker.isVisible(checkbox),
+ const enabledCheckboxes: SbbCheckboxElement[] = this._checkboxes.filter(
+ (checkbox: SbbCheckboxElement) =>
+ !checkbox.disabled && interactivityChecker.isVisible(checkbox),
);
if (
@@ -117,7 +118,9 @@ export class SbbCheckboxGroup extends LitElement {
}
if (isArrowKeyPressed(evt)) {
- const current: number = enabledCheckboxes.findIndex((e: SbbCheckbox) => e === evt.target);
+ const current: number = enabledCheckboxes.findIndex(
+ (e: SbbCheckboxElement) => e === evt.target,
+ );
const nextIndex: number = getNextElementIndex(evt, current, enabledCheckboxes.length);
enabledCheckboxes[nextIndex]?.focus();
}
@@ -137,9 +140,9 @@ export class SbbCheckboxGroup extends LitElement {
}
}
- private get _checkboxes(): SbbCheckbox[] {
+ private get _checkboxes(): SbbCheckboxElement[] {
return Array.from(this.querySelectorAll?.('sbb-checkbox') ?? []).filter(
- (el: SbbCheckbox) => el.closest('sbb-checkbox-group') === this,
+ (el: SbbCheckboxElement) => el.closest('sbb-checkbox-group') === this,
);
}
@@ -160,6 +163,6 @@ export class SbbCheckboxGroup extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-checkbox-group': SbbCheckboxGroup;
+ 'sbb-checkbox-group': SbbCheckboxGroupElement;
}
}
diff --git a/src/components/checkbox/checkbox/checkbox.e2e.ts b/src/components/checkbox/checkbox/checkbox.e2e.ts
index b1504b0258..3a5fd0ca36 100644
--- a/src/components/checkbox/checkbox/checkbox.e2e.ts
+++ b/src/components/checkbox/checkbox/checkbox.e2e.ts
@@ -4,10 +4,10 @@ import { html } from 'lit/static-html.js';
import { EventSpy, waitForCondition, waitForLitRender } from '../../core/testing';
-import { SbbCheckbox } from './checkbox';
+import { SbbCheckboxElement } from './checkbox';
describe('sbb-checkbox', () => {
- let element: SbbCheckbox;
+ let element: SbbCheckboxElement;
beforeEach(async () => {
await fixture(html``);
@@ -15,7 +15,7 @@ describe('sbb-checkbox', () => {
});
it('should render', async () => {
- assert.instanceOf(element, SbbCheckbox);
+ assert.instanceOf(element, SbbCheckboxElement);
});
it('should not render accessibility label containing expanded state', async () => {
diff --git a/src/components/checkbox/checkbox/checkbox.ts b/src/components/checkbox/checkbox/checkbox.ts
index e0334ebfd8..f93e7f72a4 100644
--- a/src/components/checkbox/checkbox/checkbox.ts
+++ b/src/components/checkbox/checkbox/checkbox.ts
@@ -50,7 +50,7 @@ const checkboxObserverConfig: MutationObserverInit = {
* @event {CustomEvent} didChange - Deprecated. used for React. Will probably be removed once React 19 is available.
*/
@customElement('sbb-checkbox')
-export class SbbCheckbox extends LitElement {
+export class SbbCheckboxElement extends LitElement {
public static override styles: CSSResultGroup = style;
public static readonly events = {
didChange: 'didChange',
@@ -115,7 +115,7 @@ export class SbbCheckbox extends LitElement {
/**
* @deprecated only used for React. Will probably be removed once React 19 is available.
*/
- private _didChange: EventEmitter = new EventEmitter(this, SbbCheckbox.events.didChange, {
+ private _didChange: EventEmitter = new EventEmitter(this, SbbCheckboxElement.events.didChange, {
bubbles: true,
cancelable: true,
});
@@ -127,7 +127,7 @@ export class SbbCheckbox extends LitElement {
*/
private _stateChange: EventEmitter = new EventEmitter(
this,
- SbbCheckbox.events.stateChange,
+ SbbCheckboxElement.events.stateChange,
{ bubbles: true },
);
@@ -137,7 +137,7 @@ export class SbbCheckbox extends LitElement {
*/
private _checkboxLoaded: EventEmitter = new EventEmitter(
this,
- SbbCheckbox.events.checkboxLoaded,
+ SbbCheckboxElement.events.checkboxLoaded,
{ bubbles: true },
);
@@ -336,6 +336,6 @@ export class SbbCheckbox extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-checkbox': SbbCheckbox;
+ 'sbb-checkbox': SbbCheckboxElement;
}
}
diff --git a/src/components/chip/chip.e2e.ts b/src/components/chip/chip.e2e.ts
index 8afb7727f5..1ae4fc84db 100644
--- a/src/components/chip/chip.e2e.ts
+++ b/src/components/chip/chip.e2e.ts
@@ -1,11 +1,11 @@
import { assert, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbChip } from './chip';
+import { SbbChipElement } from './chip';
describe('sbb-chip', () => {
it('renders', async () => {
- const element: SbbChip = await fixture(html`Label`);
- assert.instanceOf(element, SbbChip);
+ const element: SbbChipElement = await fixture(html`Label`);
+ assert.instanceOf(element, SbbChipElement);
});
});
diff --git a/src/components/chip/chip.ts b/src/components/chip/chip.ts
index 4c16b0c665..e3f755d5d4 100644
--- a/src/components/chip/chip.ts
+++ b/src/components/chip/chip.ts
@@ -9,7 +9,7 @@ import style from './chip.scss?lit&inline';
* @slot - Use the unnamed slot to add content to the `sbb-chip`.
*/
@customElement('sbb-chip')
-export class SbbChip extends LitElement {
+export class SbbChipElement extends LitElement {
public static override styles: CSSResultGroup = style;
/** Size of the chip. */
@@ -34,6 +34,6 @@ export class SbbChip extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-chip': SbbChip;
+ 'sbb-chip': SbbChipElement;
}
}
diff --git a/src/components/clock/clock.spec.ts b/src/components/clock/clock.spec.ts
index 56d8dd3482..629bff5723 100644
--- a/src/components/clock/clock.spec.ts
+++ b/src/components/clock/clock.spec.ts
@@ -1,14 +1,14 @@
import { assert, expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbClock } from './clock';
+import { SbbClockElement } from './clock';
describe('sbb-clock', () => {
- let element: SbbClock;
+ let element: SbbClockElement;
it('renders', async () => {
element = await fixture(html``);
- assert.instanceOf(element, SbbClock);
+ assert.instanceOf(element, SbbClockElement);
expect(element).dom.to.be.equal(``);
@@ -26,7 +26,7 @@ describe('sbb-clock', () => {
it('renders with a fixed time', async () => {
element = await fixture(html``);
- assert.instanceOf(element, SbbClock);
+ assert.instanceOf(element, SbbClockElement);
expect(element).to.have.attribute('data-initialized');
diff --git a/src/components/clock/clock.ts b/src/components/clock/clock.ts
index 4835e0b713..97490d4a04 100644
--- a/src/components/clock/clock.ts
+++ b/src/components/clock/clock.ts
@@ -49,7 +49,7 @@ const ADD_EVENT_LISTENER_OPTIONS: AddEventListenerOptions = {
* It displays an analog clock with the classic SBB face.
*/
@customElement('sbb-clock')
-export class SbbClock extends LitElement {
+export class SbbClockElement extends LitElement {
public static override styles: CSSResultGroup = style;
/** If it's false, the clock's hands are hidden; it's set to true when calculations are ready. */
@@ -318,6 +318,6 @@ export class SbbClock extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-clock': SbbClock;
+ 'sbb-clock': SbbClockElement;
}
}
diff --git a/src/components/core/dom/input-element.ts b/src/components/core/dom/input-element.ts
index b94760ae29..c4939dd9e6 100644
--- a/src/components/core/dom/input-element.ts
+++ b/src/components/core/dom/input-element.ts
@@ -12,7 +12,7 @@ export function findShadowInput(element: HTMLElement): HTMLInputElement | null {
* 1. Input field in `sbb-form-field` (if trigger is undefiend)
* 2. Input referenced by id (trigger is string)
* 3. Input referenced directly (trigger is HTMLElement)
- * @param element The starting SbbDatepicker element.
+ * @param element The starting SbbDatepickerElement element.
* @param trigger The id or the reference of the input.
*/
export function findInput(
diff --git a/src/components/datepicker/datepicker-next-day/datepicker-next-day.e2e.ts b/src/components/datepicker/datepicker-next-day/datepicker-next-day.e2e.ts
index f70f1a7f88..c3dc4a37af 100644
--- a/src/components/datepicker/datepicker-next-day/datepicker-next-day.e2e.ts
+++ b/src/components/datepicker/datepicker-next-day/datepicker-next-day.e2e.ts
@@ -2,20 +2,20 @@ import { assert, expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
import { EventSpy, waitForCondition, waitForLitRender } from '../../core/testing';
-import { SbbFormField } from '../../form-field';
-import type { SbbDatepicker } from '../datepicker';
+import { SbbFormFieldElement } from '../../form-field';
+import type { SbbDatepickerElement } from '../datepicker';
-import { SbbDatepickerNextDay } from './datepicker-next-day';
+import { SbbDatepickerNextDayElement } from './datepicker-next-day';
import '../datepicker';
describe('sbb-datepicker-next-day', () => {
describe('standalone', () => {
it('renders', async () => {
- const element: SbbDatepickerNextDay = await fixture(
+ const element: SbbDatepickerNextDayElement = await fixture(
html``,
);
- assert.instanceOf(element, SbbDatepickerNextDay);
+ assert.instanceOf(element, SbbDatepickerNextDayElement);
});
});
@@ -29,14 +29,14 @@ describe('sbb-datepicker-next-day', () => {
`);
- const element: SbbDatepickerNextDay = page.querySelector('sbb-datepicker-next-day');
+ const element: SbbDatepickerNextDayElement = page.querySelector('sbb-datepicker-next-day');
await waitForLitRender(element);
const input: HTMLInputElement = page.querySelector('input');
const changeSpy = new EventSpy('change', input);
const blurSpy = new EventSpy('blur', input);
- assert.instanceOf(element, SbbDatepickerNextDay);
+ assert.instanceOf(element, SbbDatepickerNextDayElement);
expect(input.value).to.be.equal('Sa, 31.12.2022');
await element.click();
@@ -57,7 +57,7 @@ describe('sbb-datepicker-next-day', () => {
`);
await waitForLitRender(doc);
- const nextButton: SbbDatepickerNextDay = doc.querySelector('sbb-datepicker-next-day');
+ const nextButton: SbbDatepickerNextDayElement = doc.querySelector('sbb-datepicker-next-day');
const inputUpdated: EventSpy = new EventSpy(
'inputUpdated',
document.querySelector('#parent'),
@@ -67,7 +67,7 @@ describe('sbb-datepicker-next-day', () => {
expect(inputUpdated.count).to.be.equal(0);
expect(nextButton.dataset.disabled).to.be.equal('');
- const picker: SbbDatepicker = document.createElement('sbb-datepicker');
+ const picker: SbbDatepickerElement = document.createElement('sbb-datepicker');
picker.setAttribute('input', 'datepicker-input');
picker.setAttribute('id', 'datepicker');
picker.setAttribute('value', '01-01-2023');
@@ -89,7 +89,7 @@ describe('sbb-datepicker-next-day', () => {
`);
await waitForLitRender(doc);
- const nextButton: SbbDatepickerNextDay = doc.querySelector('sbb-datepicker-next-day');
+ const nextButton: SbbDatepickerNextDayElement = doc.querySelector('sbb-datepicker-next-day');
const inputUpdated: EventSpy = new EventSpy(
'inputUpdated',
document.querySelector('#parent'),
@@ -99,7 +99,7 @@ describe('sbb-datepicker-next-day', () => {
expect(inputUpdated.count).to.be.equal(0);
expect(nextButton.dataset.disabled).to.be.equal('');
- const picker: SbbDatepicker = document.createElement('sbb-datepicker');
+ const picker: SbbDatepickerElement = document.createElement('sbb-datepicker');
picker.setAttribute('input', 'datepicker-input');
picker.setAttribute('id', 'datepicker');
picker.setAttribute('value', '01-01-2023');
@@ -113,10 +113,10 @@ describe('sbb-datepicker-next-day', () => {
});
describe('in form field', () => {
- let element: SbbDatepickerNextDay, input: HTMLInputElement;
+ let element: SbbDatepickerNextDayElement, input: HTMLInputElement;
beforeEach(async () => {
- const form: SbbFormField = await fixture(html`
+ const form: SbbFormFieldElement = await fixture(html`
@@ -129,7 +129,7 @@ describe('sbb-datepicker-next-day', () => {
});
it('renders', async () => {
- assert.instanceOf(element, SbbDatepickerNextDay);
+ assert.instanceOf(element, SbbDatepickerNextDayElement);
});
it('click', async () => {
@@ -144,7 +144,7 @@ describe('sbb-datepicker-next-day', () => {
});
it('disabled due max value equals to value', async () => {
- const form: SbbFormField = await fixture(html`
+ const form: SbbFormFieldElement = await fixture(html`
diff --git a/src/components/datepicker/datepicker-next-day/datepicker-next-day.spec.ts b/src/components/datepicker/datepicker-next-day/datepicker-next-day.spec.ts
index d61efb006f..4d4266281a 100644
--- a/src/components/datepicker/datepicker-next-day/datepicker-next-day.spec.ts
+++ b/src/components/datepicker/datepicker-next-day/datepicker-next-day.spec.ts
@@ -1,16 +1,16 @@
import { expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbFormField } from '../../form-field';
+import { SbbFormFieldElement } from '../../form-field';
-import type { SbbDatepickerNextDay } from './datepicker-next-day';
+import type { SbbDatepickerNextDayElement } from './datepicker-next-day';
import '../datepicker';
import './datepicker-next-day';
describe('sbb-datepicker-next-day', () => {
it('renders', async () => {
- const page: SbbDatepickerNextDay = await fixture(
+ const page: SbbDatepickerNextDayElement = await fixture(
html``,
);
@@ -34,7 +34,7 @@ describe('sbb-datepicker-next-day', () => {
`);
- const element: SbbDatepickerNextDay = page.querySelector('sbb-datepicker-next-day');
+ const element: SbbDatepickerNextDayElement = page.querySelector('sbb-datepicker-next-day');
expect(element).dom.to.be.equal(`
{
});
it('renders with datepicker and input disabled', async () => {
- const page: SbbFormField = await fixture(html`
+ const page: SbbFormFieldElement = await fixture(html`
@@ -62,12 +62,12 @@ describe('sbb-datepicker-next-day', () => {
`);
- const element: SbbDatepickerNextDay = page.querySelector('sbb-datepicker-next-day');
+ const element: SbbDatepickerNextDayElement = page.querySelector('sbb-datepicker-next-day');
expect(element).to.have.attribute('data-disabled');
});
it('renders with datepicker and input readonly', async () => {
- const page: SbbFormField = await fixture(html`
+ const page: SbbFormFieldElement = await fixture(html`
@@ -75,7 +75,7 @@ describe('sbb-datepicker-next-day', () => {
`);
- const element: SbbDatepickerNextDay = page.querySelector('sbb-datepicker-next-day');
+ const element: SbbDatepickerNextDayElement = page.querySelector('sbb-datepicker-next-day');
expect(element).to.have.attribute('data-disabled');
});
});
diff --git a/src/components/datepicker/datepicker-next-day/datepicker-next-day.ts b/src/components/datepicker/datepicker-next-day/datepicker-next-day.ts
index 6e871ea169..e199052ac5 100644
--- a/src/components/datepicker/datepicker-next-day/datepicker-next-day.ts
+++ b/src/components/datepicker/datepicker-next-day/datepicker-next-day.ts
@@ -17,7 +17,7 @@ import {
datepickerControlRegisteredEventFactory,
findNextAvailableDate,
getDatePicker,
- type SbbDatepicker,
+ type SbbDatepickerElement,
} from '../datepicker';
import style from './datepicker-next-day.scss?lit&inline';
@@ -28,7 +28,7 @@ import '../../icon';
* Combined with a `sbb-datepicker`, it can be used to move the date ahead.
*/
@customElement('sbb-datepicker-next-day')
-export class SbbDatepickerNextDay extends LitElement implements ButtonProperties {
+export class SbbDatepickerNextDayElement extends LitElement implements ButtonProperties {
public static override styles: CSSResultGroup = style;
/** The name attribute to use for the button. */
@@ -38,7 +38,7 @@ export class SbbDatepickerNextDay extends LitElement implements ButtonProperties
@property({ reflect: true, type: Boolean }) public negative = false;
/** Datepicker reference. */
- @property({ attribute: 'date-picker' }) public datePicker?: string | SbbDatepicker;
+ @property({ attribute: 'date-picker' }) public datePicker?: string | SbbDatepickerElement;
/** Whether the component is disabled due date equals to max date. */
@state() private _disabled = false;
@@ -60,7 +60,7 @@ export class SbbDatepickerNextDay extends LitElement implements ButtonProperties
}),
);
- private _datePickerElement: SbbDatepicker;
+ private _datePickerElement: SbbDatepickerElement;
private _dateAdapter: DateAdapter = defaultDateAdapter;
@@ -105,7 +105,7 @@ export class SbbDatepickerNextDay extends LitElement implements ButtonProperties
if (formField) {
this.negative = isValidAttribute(formField, 'negative');
- // We can't use getInputElement of SbbFormField as async awaiting is not supported in connectedCallback.
+ // We can't use getInputElement of SbbFormFieldElement as async awaiting is not supported in connectedCallback.
// We here only have to look for input.
const inputElement = formField.querySelector('input');
@@ -122,7 +122,7 @@ export class SbbDatepickerNextDay extends LitElement implements ButtonProperties
this._datePickerController?.abort();
}
- private _init(picker?: string | SbbDatepicker): void {
+ private _init(picker?: string | SbbDatepickerElement): void {
this._datePickerController?.abort();
this._datePickerController = new AbortController();
this._datePickerElement = getDatePicker(this, picker);
@@ -132,7 +132,7 @@ export class SbbDatepickerNextDay extends LitElement implements ButtonProperties
// assuming that the two components share the same parent element.
this.parentElement?.addEventListener(
'inputUpdated',
- (e: Event) => this._init(e.target as SbbDatepicker),
+ (e: Event) => this._init(e.target as SbbDatepickerElement),
{ once: true, signal: this._datePickerController.signal },
);
return;
@@ -142,7 +142,7 @@ export class SbbDatepickerNextDay extends LitElement implements ButtonProperties
this._datePickerElement.addEventListener(
'change',
(event: Event) => {
- this._setDisabledState(event.target as SbbDatepicker);
+ this._setDisabledState(event.target as SbbDatepickerElement);
this._setAriaLabel();
},
{ signal: this._datePickerController.signal },
@@ -150,7 +150,7 @@ export class SbbDatepickerNextDay extends LitElement implements ButtonProperties
this._datePickerElement.addEventListener(
'datePickerUpdated',
(event: Event) => {
- this._setDisabledState(event.target as SbbDatepicker);
+ this._setDisabledState(event.target as SbbDatepickerElement);
this._setAriaLabel();
},
{ signal: this._datePickerController.signal },
@@ -171,7 +171,7 @@ export class SbbDatepickerNextDay extends LitElement implements ButtonProperties
this._datePickerElement.dispatchEvent(datepickerControlRegisteredEventFactory());
}
- private _setDisabledState(datepicker: SbbDatepicker): void {
+ private _setDisabledState(datepicker: SbbDatepickerElement): void {
const pickerValueAsDate: Date = datepicker?.getValueAsDate();
if (!pickerValueAsDate) {
@@ -242,6 +242,6 @@ export class SbbDatepickerNextDay extends LitElement implements ButtonProperties
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-datepicker-next-day': SbbDatepickerNextDay;
+ 'sbb-datepicker-next-day': SbbDatepickerNextDayElement;
}
}
diff --git a/src/components/datepicker/datepicker-next-day/readme.md b/src/components/datepicker/datepicker-next-day/readme.md
index 67ce60bcb7..926cb0c051 100644
--- a/src/components/datepicker/datepicker-next-day/readme.md
+++ b/src/components/datepicker/datepicker-next-day/readme.md
@@ -35,8 +35,8 @@ both standalone or within the `sbb-form-field`, they must have the same parent e
## Properties
-| Name | Attribute | Privacy | Type | Default | Description |
-| ------------ | ------------- | ------- | -------------------------------------- | ------- | ----------------------------------------- |
-| `name` | `name` | public | `string \| undefined` | | The name attribute to use for the button. |
-| `negative` | `negative` | public | `boolean` | `false` | Negative coloring variant flag. |
-| `datePicker` | `date-picker` | public | `string \| SbbDatepicker \| undefined` | | Datepicker reference. |
+| Name | Attribute | Privacy | Type | Default | Description |
+| ------------ | ------------- | ------- | --------------------------------------------- | ------- | ----------------------------------------- |
+| `name` | `name` | public | `string \| undefined` | | The name attribute to use for the button. |
+| `negative` | `negative` | public | `boolean` | `false` | Negative coloring variant flag. |
+| `datePicker` | `date-picker` | public | `string \| SbbDatepickerElement \| undefined` | | Datepicker reference. |
diff --git a/src/components/datepicker/datepicker-previous-day/datepicker-previous-day.e2e.ts b/src/components/datepicker/datepicker-previous-day/datepicker-previous-day.e2e.ts
index 5306cdb269..acfae92ee8 100644
--- a/src/components/datepicker/datepicker-previous-day/datepicker-previous-day.e2e.ts
+++ b/src/components/datepicker/datepicker-previous-day/datepicker-previous-day.e2e.ts
@@ -2,20 +2,20 @@ import { assert, expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
import { EventSpy, waitForCondition, waitForLitRender } from '../../core/testing';
-import { SbbFormField } from '../../form-field';
-import type { SbbDatepicker } from '../datepicker';
+import { SbbFormFieldElement } from '../../form-field';
+import type { SbbDatepickerElement } from '../datepicker';
-import { SbbDatepickerPreviousDay } from './datepicker-previous-day';
+import { SbbDatepickerPreviousDayElement } from './datepicker-previous-day';
import '../datepicker';
describe('sbb-datepicker-previous-day', () => {
describe('standalone', () => {
it('renders', async () => {
- const element: SbbDatepickerPreviousDay = await fixture(
+ const element: SbbDatepickerPreviousDayElement = await fixture(
html``,
);
- assert.instanceOf(element, SbbDatepickerPreviousDay);
+ assert.instanceOf(element, SbbDatepickerPreviousDayElement);
});
});
@@ -26,12 +26,12 @@ describe('sbb-datepicker-previous-day', () => {
`);
- const element: SbbDatepickerPreviousDay = document.querySelector(
+ const element: SbbDatepickerPreviousDayElement = document.querySelector(
'sbb-datepicker-previous-day',
);
const input: HTMLInputElement = document.querySelector('input');
await waitForLitRender(element);
- assert.instanceOf(element, SbbDatepickerPreviousDay);
+ assert.instanceOf(element, SbbDatepickerPreviousDayElement);
expect(input.value).to.be.equal('Su, 01.01.2023');
const changeSpy = new EventSpy('change', input);
@@ -53,7 +53,9 @@ describe('sbb-datepicker-previous-day', () => {
`);
await waitForLitRender(doc);
- const prevButton: SbbDatepickerPreviousDay = doc.querySelector('sbb-datepicker-previous-day');
+ const prevButton: SbbDatepickerPreviousDayElement = doc.querySelector(
+ 'sbb-datepicker-previous-day',
+ );
const inputUpdated: EventSpy = new EventSpy(
'inputUpdated',
document.querySelector('#parent'),
@@ -63,7 +65,7 @@ describe('sbb-datepicker-previous-day', () => {
expect(inputUpdated.count).to.be.equal(0);
expect(prevButton.dataset.disabled).to.be.equal('');
- const picker: SbbDatepicker = document.createElement('sbb-datepicker');
+ const picker: SbbDatepickerElement = document.createElement('sbb-datepicker');
picker.setAttribute('input', 'datepicker-input');
picker.setAttribute('id', 'datepicker');
picker.setAttribute('value', '01-01-2023');
@@ -85,7 +87,9 @@ describe('sbb-datepicker-previous-day', () => {
`);
await waitForLitRender(doc);
- const prevButton: SbbDatepickerPreviousDay = doc.querySelector('sbb-datepicker-previous-day');
+ const prevButton: SbbDatepickerPreviousDayElement = doc.querySelector(
+ 'sbb-datepicker-previous-day',
+ );
const inputUpdated: EventSpy = new EventSpy(
'inputUpdated',
document.querySelector('#parent'),
@@ -95,7 +99,7 @@ describe('sbb-datepicker-previous-day', () => {
expect(inputUpdated.count).to.be.equal(0);
expect(prevButton.dataset.disabled).to.be.equal('');
- const picker: SbbDatepicker = document.createElement('sbb-datepicker');
+ const picker: SbbDatepickerElement = document.createElement('sbb-datepicker');
picker.setAttribute('input', 'datepicker-input');
picker.setAttribute('id', 'datepicker');
picker.setAttribute('value', '01-01-2023');
@@ -109,10 +113,10 @@ describe('sbb-datepicker-previous-day', () => {
});
describe('in form field', () => {
- let element: SbbDatepickerPreviousDay, input: HTMLInputElement;
+ let element: SbbDatepickerPreviousDayElement, input: HTMLInputElement;
beforeEach(async () => {
- const form: SbbFormField = await fixture(html`
+ const form: SbbFormFieldElement = await fixture(html`
@@ -125,7 +129,7 @@ describe('sbb-datepicker-previous-day', () => {
});
it('renders', async () => {
- assert.instanceOf(element, SbbDatepickerPreviousDay);
+ assert.instanceOf(element, SbbDatepickerPreviousDayElement);
});
it('click', async () => {
@@ -140,7 +144,7 @@ describe('sbb-datepicker-previous-day', () => {
});
it('disabled due min equals to value', async () => {
- const form: SbbFormField = await fixture(html`
+ const form: SbbFormFieldElement = await fixture(html`
diff --git a/src/components/datepicker/datepicker-previous-day/datepicker-previous-day.spec.ts b/src/components/datepicker/datepicker-previous-day/datepicker-previous-day.spec.ts
index 875941b042..40a2622e14 100644
--- a/src/components/datepicker/datepicker-previous-day/datepicker-previous-day.spec.ts
+++ b/src/components/datepicker/datepicker-previous-day/datepicker-previous-day.spec.ts
@@ -1,16 +1,16 @@
import { expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbFormField } from '../../form-field';
+import { SbbFormFieldElement } from '../../form-field';
-import type { SbbDatepickerPreviousDay } from './datepicker-previous-day';
+import type { SbbDatepickerPreviousDayElement } from './datepicker-previous-day';
import '../datepicker';
import './datepicker-previous-day';
describe('sbb-datepicker-previous-day', () => {
it('renders', async () => {
- const page: SbbDatepickerPreviousDay = await fixture(
+ const page: SbbDatepickerPreviousDayElement = await fixture(
html``,
);
@@ -34,7 +34,9 @@ describe('sbb-datepicker-previous-day', () => {
`);
- const element: SbbDatepickerPreviousDay = page.querySelector('sbb-datepicker-previous-day');
+ const element: SbbDatepickerPreviousDayElement = page.querySelector(
+ 'sbb-datepicker-previous-day',
+ );
expect(element).dom.to.be.equal(`
{
});
it('renders with datepicker and input disabled', async () => {
- const page: SbbFormField = await fixture(html`
+ const page: SbbFormFieldElement = await fixture(html`
@@ -62,12 +64,14 @@ describe('sbb-datepicker-previous-day', () => {
`);
- const element: SbbDatepickerPreviousDay = page.querySelector('sbb-datepicker-previous-day');
+ const element: SbbDatepickerPreviousDayElement = page.querySelector(
+ 'sbb-datepicker-previous-day',
+ );
expect(element).to.have.attribute('data-disabled');
});
it('renders with datepicker and input readonly', async () => {
- const page: SbbFormField = await fixture(html`
+ const page: SbbFormFieldElement = await fixture(html`
@@ -75,7 +79,9 @@ describe('sbb-datepicker-previous-day', () => {
`);
- const element: SbbDatepickerPreviousDay = page.querySelector('sbb-datepicker-previous-day');
+ const element: SbbDatepickerPreviousDayElement = page.querySelector(
+ 'sbb-datepicker-previous-day',
+ );
expect(element).to.have.attribute('data-disabled');
});
});
diff --git a/src/components/datepicker/datepicker-previous-day/datepicker-previous-day.ts b/src/components/datepicker/datepicker-previous-day/datepicker-previous-day.ts
index da8bb14128..55eed23072 100644
--- a/src/components/datepicker/datepicker-previous-day/datepicker-previous-day.ts
+++ b/src/components/datepicker/datepicker-previous-day/datepicker-previous-day.ts
@@ -17,7 +17,7 @@ import {
datepickerControlRegisteredEventFactory,
findPreviousAvailableDate,
getDatePicker,
- type SbbDatepicker,
+ type SbbDatepickerElement,
} from '../datepicker';
import style from './datepicker-previous-day.scss?lit&inline';
@@ -28,7 +28,7 @@ import '../../icon';
* Combined with a `sbb-datepicker`, it can be used to move the date back.
*/
@customElement('sbb-datepicker-previous-day')
-export class SbbDatepickerPreviousDay extends LitElement implements ButtonProperties {
+export class SbbDatepickerPreviousDayElement extends LitElement implements ButtonProperties {
public static override styles: CSSResultGroup = style;
/** The name attribute to use for the button. */
@@ -38,7 +38,7 @@ export class SbbDatepickerPreviousDay extends LitElement implements ButtonProper
@property({ reflect: true, type: Boolean }) public negative = false;
/** Datepicker reference. */
- @property({ attribute: 'date-picker' }) public datePicker?: string | SbbDatepicker;
+ @property({ attribute: 'date-picker' }) public datePicker?: string | SbbDatepickerElement;
/** Whether the component is disabled due date equals to min date. */
@state() private _disabled = false;
@@ -60,7 +60,7 @@ export class SbbDatepickerPreviousDay extends LitElement implements ButtonProper
}),
);
- private _datePickerElement: SbbDatepicker;
+ private _datePickerElement: SbbDatepickerElement;
private _dateAdapter: DateAdapter = defaultDateAdapter;
@@ -105,7 +105,7 @@ export class SbbDatepickerPreviousDay extends LitElement implements ButtonProper
if (formField) {
this.negative = isValidAttribute(formField, 'negative');
- // We can't use getInputElement of SbbFormField as async awaiting is not supported in connectedCallback.
+ // We can't use getInputElement of SbbFormFieldElement as async awaiting is not supported in connectedCallback.
// We here only have to look for input.
const inputElement = formField.querySelector('input');
@@ -122,7 +122,7 @@ export class SbbDatepickerPreviousDay extends LitElement implements ButtonProper
this._datePickerController?.abort();
}
- private _init(picker?: string | SbbDatepicker): void {
+ private _init(picker?: string | SbbDatepickerElement): void {
this._datePickerController?.abort();
this._datePickerController = new AbortController();
this._datePickerElement = getDatePicker(this, picker);
@@ -132,7 +132,7 @@ export class SbbDatepickerPreviousDay extends LitElement implements ButtonProper
// assuming that the two components share the same parent element.
this.parentElement?.addEventListener(
'inputUpdated',
- (e: Event) => this._init(e.target as SbbDatepicker),
+ (e: Event) => this._init(e.target as SbbDatepickerElement),
{ once: true, signal: this._datePickerController.signal },
);
return;
@@ -142,7 +142,7 @@ export class SbbDatepickerPreviousDay extends LitElement implements ButtonProper
this._datePickerElement.addEventListener(
'change',
(event: Event) => {
- this._setDisabledState(event.target as SbbDatepicker);
+ this._setDisabledState(event.target as SbbDatepickerElement);
this._setAriaLabel();
},
{ signal: this._datePickerController.signal },
@@ -150,7 +150,7 @@ export class SbbDatepickerPreviousDay extends LitElement implements ButtonProper
this._datePickerElement.addEventListener(
'datePickerUpdated',
(event: Event) => {
- this._setDisabledState(event.target as SbbDatepicker);
+ this._setDisabledState(event.target as SbbDatepickerElement);
this._setAriaLabel();
},
{ signal: this._datePickerController.signal },
@@ -171,7 +171,7 @@ export class SbbDatepickerPreviousDay extends LitElement implements ButtonProper
this._datePickerElement.dispatchEvent(datepickerControlRegisteredEventFactory());
}
- private _setDisabledState(datepicker: SbbDatepicker): void {
+ private _setDisabledState(datepicker: SbbDatepickerElement): void {
const pickerValueAsDate: Date = datepicker?.getValueAsDate();
if (!pickerValueAsDate) {
@@ -244,6 +244,6 @@ export class SbbDatepickerPreviousDay extends LitElement implements ButtonProper
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-datepicker-previous-day': SbbDatepickerPreviousDay;
+ 'sbb-datepicker-previous-day': SbbDatepickerPreviousDayElement;
}
}
diff --git a/src/components/datepicker/datepicker-previous-day/readme.md b/src/components/datepicker/datepicker-previous-day/readme.md
index b25c416c66..792f1aa90f 100644
--- a/src/components/datepicker/datepicker-previous-day/readme.md
+++ b/src/components/datepicker/datepicker-previous-day/readme.md
@@ -35,8 +35,8 @@ both standalone or within the `sbb-form-field`, they must have the same parent e
## Properties
-| Name | Attribute | Privacy | Type | Default | Description |
-| ------------ | ------------- | ------- | -------------------------------------- | ------- | ----------------------------------------- |
-| `name` | `name` | public | `string \| undefined` | | The name attribute to use for the button. |
-| `negative` | `negative` | public | `boolean` | `false` | Negative coloring variant flag. |
-| `datePicker` | `date-picker` | public | `string \| SbbDatepicker \| undefined` | | Datepicker reference. |
+| Name | Attribute | Privacy | Type | Default | Description |
+| ------------ | ------------- | ------- | --------------------------------------------- | ------- | ----------------------------------------- |
+| `name` | `name` | public | `string \| undefined` | | The name attribute to use for the button. |
+| `negative` | `negative` | public | `boolean` | `false` | Negative coloring variant flag. |
+| `datePicker` | `date-picker` | public | `string \| SbbDatepickerElement \| undefined` | | Datepicker reference. |
diff --git a/src/components/datepicker/datepicker-toggle/datepicker-toggle.e2e.ts b/src/components/datepicker/datepicker-toggle/datepicker-toggle.e2e.ts
index 2d2477e60e..07a957e2da 100644
--- a/src/components/datepicker/datepicker-toggle/datepicker-toggle.e2e.ts
+++ b/src/components/datepicker/datepicker-toggle/datepicker-toggle.e2e.ts
@@ -1,24 +1,24 @@
import { assert, expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbCalendar } from '../../calendar';
+import { SbbCalendarElement } from '../../calendar';
import { EventSpy, waitForCondition, waitForLitRender } from '../../core/testing';
-import { SbbFormField } from '../../form-field';
-import { SbbTooltipTrigger, SbbTooltip } from '../../tooltip';
-import type { SbbDatepicker } from '../datepicker';
+import { SbbFormFieldElement } from '../../form-field';
+import { SbbTooltipTriggerElement, SbbTooltipElement } from '../../tooltip';
+import type { SbbDatepickerElement } from '../datepicker';
-import { SbbDatepickerToggle } from './datepicker-toggle';
+import { SbbDatepickerToggleElement } from './datepicker-toggle';
import '../datepicker';
describe('sbb-datepicker-toggle', () => {
it('renders standalone', async () => {
- const element: SbbDatepickerToggle = await fixture(
+ const element: SbbDatepickerToggleElement = await fixture(
html``,
);
- assert.instanceOf(element, SbbDatepickerToggle);
+ assert.instanceOf(element, SbbDatepickerToggleElement);
- const tooltipTrigger: SbbTooltipTrigger =
+ const tooltipTrigger: SbbTooltipTriggerElement =
element.shadowRoot.querySelector('sbb-tooltip-trigger');
expect(tooltipTrigger).to.have.attribute('disabled');
});
@@ -29,13 +29,13 @@ describe('sbb-datepicker-toggle', () => {
`);
- const element: SbbDatepickerToggle = document.querySelector('sbb-datepicker-toggle');
- assert.instanceOf(element, SbbDatepickerToggle);
+ const element: SbbDatepickerToggleElement = document.querySelector('sbb-datepicker-toggle');
+ assert.instanceOf(element, SbbDatepickerToggleElement);
- const didOpenEventSpy = new EventSpy(SbbTooltip.events.didOpen, element);
- const tooltipTrigger: SbbTooltipTrigger =
+ const didOpenEventSpy = new EventSpy(SbbTooltipElement.events.didOpen, element);
+ const tooltipTrigger: SbbTooltipTriggerElement =
element.shadowRoot.querySelector('sbb-tooltip-trigger');
- const tooltip: SbbTooltip = element.shadowRoot.querySelector('sbb-tooltip');
+ const tooltip: SbbTooltipElement = element.shadowRoot.querySelector('sbb-tooltip');
await waitForLitRender(element);
expect(tooltipTrigger).not.to.have.attribute('disabled');
@@ -53,17 +53,17 @@ describe('sbb-datepicker-toggle', () => {
`);
- const element: SbbDatepickerToggle = document.querySelector('sbb-datepicker-toggle');
- const didOpenEventSpy = new EventSpy(SbbTooltip.events.didOpen, element);
- const tooltipTrigger: SbbTooltipTrigger =
+ const element: SbbDatepickerToggleElement = document.querySelector('sbb-datepicker-toggle');
+ const didOpenEventSpy = new EventSpy(SbbTooltipElement.events.didOpen, element);
+ const tooltipTrigger: SbbTooltipTriggerElement =
element.shadowRoot.querySelector('sbb-tooltip-trigger');
- const tooltip: SbbTooltip = element.shadowRoot.querySelector('sbb-tooltip');
+ const tooltip: SbbTooltipElement = element.shadowRoot.querySelector('sbb-tooltip');
await waitForLitRender(element);
- assert.instanceOf(element, SbbDatepickerToggle);
+ assert.instanceOf(element, SbbDatepickerToggleElement);
expect(tooltipTrigger).not.to.have.attribute('disabled');
expect(tooltip).to.have.attribute('data-state', 'closed');
- (document.querySelector('sbb-datepicker-toggle') as SbbDatepickerToggle).open();
+ (document.querySelector('sbb-datepicker-toggle') as SbbDatepickerToggleElement).open();
await waitForCondition(() => didOpenEventSpy.events.length === 1);
@@ -79,18 +79,19 @@ describe('sbb-datepicker-toggle', () => {
`);
await waitForLitRender(doc);
- const toggle: SbbDatepickerToggle = document.querySelector('sbb-datepicker-toggle');
+ const toggle: SbbDatepickerToggleElement = document.querySelector('sbb-datepicker-toggle');
const inputUpdated: EventSpy = new EventSpy(
'inputUpdated',
document.querySelector('#parent'),
);
- const trigger: SbbTooltipTrigger = toggle.shadowRoot.querySelector('sbb-tooltip-trigger');
+ const trigger: SbbTooltipTriggerElement =
+ toggle.shadowRoot.querySelector('sbb-tooltip-trigger');
// there's no datepicker, so no event and the tooltipTrigger is disabled due _datePickerElement not set
expect(toggle).not.to.be.null;
expect(inputUpdated.count).to.be.equal(0);
expect(trigger.getAttribute('disabled')).to.be.equal('');
- const picker: SbbDatepicker = document.createElement('sbb-datepicker');
+ const picker: SbbDatepickerElement = document.createElement('sbb-datepicker');
picker.setAttribute('input', 'datepicker-input');
picker.setAttribute('id', 'datepicker');
picker.setAttribute('value', '01-01-2023');
@@ -112,18 +113,19 @@ describe('sbb-datepicker-toggle', () => {
`);
await waitForLitRender(doc);
- const toggle: SbbDatepickerToggle = document.querySelector('sbb-datepicker-toggle');
+ const toggle: SbbDatepickerToggleElement = document.querySelector('sbb-datepicker-toggle');
const inputUpdated: EventSpy = new EventSpy(
'inputUpdated',
document.querySelector('#parent'),
);
- const trigger: SbbTooltipTrigger = toggle.shadowRoot.querySelector('sbb-tooltip-trigger');
+ const trigger: SbbTooltipTriggerElement =
+ toggle.shadowRoot.querySelector('sbb-tooltip-trigger');
// there's no datepicker, so no event and the tooltipTrigger is disabled due _datePickerElement not set
expect(toggle).not.to.be.null;
expect(inputUpdated.count).to.be.equal(0);
expect(trigger.getAttribute('disabled')).to.be.equal('');
- const picker: SbbDatepicker = document.createElement('sbb-datepicker');
+ const picker: SbbDatepickerElement = document.createElement('sbb-datepicker');
picker.setAttribute('input', 'datepicker-input');
picker.setAttribute('id', 'datepicker');
picker.setAttribute('value', '01-01-2023');
@@ -136,29 +138,29 @@ describe('sbb-datepicker-toggle', () => {
});
it('renders in form field, open calendar and change date', async () => {
- const form: SbbFormField = await fixture(html`
+ const form: SbbFormFieldElement = await fixture(html`
`);
- const element: SbbDatepickerToggle = form.querySelector('sbb-datepicker-toggle');
+ const element: SbbDatepickerToggleElement = form.querySelector('sbb-datepicker-toggle');
const input: HTMLInputElement = form.querySelector('input');
- const tooltip: SbbTooltip = element.shadowRoot.querySelector('sbb-tooltip');
+ const tooltip: SbbTooltipElement = element.shadowRoot.querySelector('sbb-tooltip');
expect(tooltip).to.have.attribute('data-state', 'closed');
- const didOpenEventSpy = new EventSpy(SbbTooltip.events.didOpen, element);
+ const didOpenEventSpy = new EventSpy(SbbTooltipElement.events.didOpen, element);
const changeSpy = new EventSpy('change', input);
const blurSpy = new EventSpy('blur', input);
- assert.instanceOf(element, SbbDatepickerToggle);
+ assert.instanceOf(element, SbbDatepickerToggleElement);
- const tooltipTrigger: SbbTooltipTrigger =
+ const tooltipTrigger: SbbTooltipTriggerElement =
element.shadowRoot.querySelector('sbb-tooltip-trigger');
tooltipTrigger.click();
await waitForCondition(() => didOpenEventSpy.events.length === 1);
expect(tooltip).to.have.attribute('data-state', 'opened');
- const calendar: SbbCalendar = element.shadowRoot.querySelector('sbb-calendar');
+ const calendar: SbbCalendarElement = element.shadowRoot.querySelector('sbb-calendar');
calendar.dispatchEvent(
new CustomEvent('dateSelected', {
detail: new Date('2022-01-01'),
diff --git a/src/components/datepicker/datepicker-toggle/datepicker-toggle.spec.ts b/src/components/datepicker/datepicker-toggle/datepicker-toggle.spec.ts
index bdb68fe646..5f9db60593 100644
--- a/src/components/datepicker/datepicker-toggle/datepicker-toggle.spec.ts
+++ b/src/components/datepicker/datepicker-toggle/datepicker-toggle.spec.ts
@@ -1,9 +1,9 @@
import { expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbFormField } from '../../form-field';
+import { SbbFormFieldElement } from '../../form-field';
-import type { SbbDatepickerToggle } from './datepicker-toggle';
+import type { SbbDatepickerToggleElement } from './datepicker-toggle';
import '../datepicker';
import './datepicker-toggle';
@@ -40,14 +40,14 @@ describe('sbb-datepicker-toggle', () => {
describe('renders in form-field', () => {
it('renders in form-field', async () => {
- const page: SbbFormField = await fixture(html`
+ const page: SbbFormFieldElement = await fixture(html`
`);
- const element: SbbDatepickerToggle = page.querySelector('sbb-datepicker-toggle');
+ const element: SbbDatepickerToggleElement = page.querySelector('sbb-datepicker-toggle');
expect(element).dom.to.be.equal(
``,
);
@@ -77,14 +77,14 @@ describe('sbb-datepicker-toggle', () => {
});
it('renders in disabled form-field', async () => {
- const page: SbbFormField = await fixture(html`
+ const page: SbbFormFieldElement = await fixture(html`
`);
- const element: SbbDatepickerToggle = page.querySelector('sbb-datepicker-toggle');
+ const element: SbbDatepickerToggleElement = page.querySelector('sbb-datepicker-toggle');
expect(element).dom.to.be.equal(
``,
);
@@ -122,7 +122,7 @@ describe('sbb-datepicker-toggle', () => {
`);
- const element: SbbDatepickerToggle = page.querySelector('sbb-datepicker-toggle');
+ const element: SbbDatepickerToggleElement = page.querySelector('sbb-datepicker-toggle');
expect(element).dom.to.be.equal(
``,
);
diff --git a/src/components/datepicker/datepicker-toggle/datepicker-toggle.stories.ts b/src/components/datepicker/datepicker-toggle/datepicker-toggle.stories.ts
index 1a467e178f..c9c0d80c98 100644
--- a/src/components/datepicker/datepicker-toggle/datepicker-toggle.stories.ts
+++ b/src/components/datepicker/datepicker-toggle/datepicker-toggle.stories.ts
@@ -16,7 +16,7 @@ import { styleMap } from 'lit/directives/style-map.js';
import { waitForComponentsReady } from '../../../storybook/testing/wait-for-components-ready';
import { waitForStablePosition } from '../../../storybook/testing/wait-for-stable-position';
import { sbbSpread } from '../../core/dom';
-import { SbbTooltipTrigger } from '../../tooltip';
+import { SbbTooltipTriggerElement } from '../../tooltip';
import '../../form-field';
import '../datepicker';
@@ -55,7 +55,7 @@ const defaultArgs: Args = {
// Story interaction executed after the story renders
const playStory = async ({ canvasElement }): Promise => {
const canvas = within(canvasElement);
- const queryTrigger = (): SbbTooltipTrigger =>
+ const queryTrigger = (): SbbTooltipTriggerElement =>
canvas.getByTestId('toggle').shadowRoot!.querySelector('sbb-tooltip-trigger')!;
await waitForComponentsReady(queryTrigger);
diff --git a/src/components/datepicker/datepicker-toggle/datepicker-toggle.ts b/src/components/datepicker/datepicker-toggle/datepicker-toggle.ts
index 34dfbdbd44..4f425e810f 100644
--- a/src/components/datepicker/datepicker-toggle/datepicker-toggle.ts
+++ b/src/components/datepicker/datepicker-toggle/datepicker-toggle.ts
@@ -2,7 +2,7 @@ import { CSSResultGroup, html, LitElement, nothing, PropertyValues, TemplateResu
import { customElement, property, state } from 'lit/decorators.js';
import { ref } from 'lit/directives/ref.js';
-import type { SbbCalendar } from '../../calendar';
+import type { SbbCalendarElement } from '../../calendar';
import { sbbInputModalityDetector } from '../../core/a11y';
import { isValidAttribute, setAttribute } from '../../core/dom';
import {
@@ -11,12 +11,12 @@ import {
languageChangeHandlerAspect,
} from '../../core/eventing';
import { i18nShowCalendar } from '../../core/i18n';
-import type { SbbTooltip, SbbTooltipTrigger } from '../../tooltip';
+import type { SbbTooltipElement, SbbTooltipTriggerElement } from '../../tooltip';
import {
datepickerControlRegisteredEventFactory,
getDatePicker,
InputUpdateEvent,
- type SbbDatepicker,
+ type SbbDatepickerElement,
} from '../datepicker';
import '../../calendar';
import '../../tooltip';
@@ -27,11 +27,11 @@ import style from './datepicker-toggle.scss?lit&inline';
* Combined with a `sbb-datepicker`, it can be used to select a date from a `sbb-calendar`.
*/
@customElement('sbb-datepicker-toggle')
-export class SbbDatepickerToggle extends LitElement {
+export class SbbDatepickerToggleElement extends LitElement {
public static override styles: CSSResultGroup = style;
/** Datepicker reference. */
- @property({ attribute: 'date-picker' }) public datePicker?: string | SbbDatepicker;
+ @property({ attribute: 'date-picker' }) public datePicker?: string | SbbDatepickerElement;
/** Whether the animation is disabled. */
@property({ attribute: 'disable-animation', type: Boolean }) public disableAnimation = false;
@@ -47,13 +47,13 @@ export class SbbDatepickerToggle extends LitElement {
@state() private _currentLanguage = documentLanguage();
- private _datePickerElement: SbbDatepicker;
+ private _datePickerElement: SbbDatepickerElement;
- private _calendarElement: SbbCalendar;
+ private _calendarElement: SbbCalendarElement;
- private _triggerElement: SbbTooltipTrigger;
+ private _triggerElement: SbbTooltipTriggerElement;
- private _tooltipElement: SbbTooltip;
+ private _tooltipElement: SbbTooltipElement;
private _datePickerController: AbortController;
@@ -97,7 +97,7 @@ export class SbbDatepickerToggle extends LitElement {
this._handlerRepository.disconnect();
}
- private _init(datePicker?: string | SbbDatepicker): void {
+ private _init(datePicker?: string | SbbDatepickerElement): void {
this._datePickerController?.abort();
this._datePickerController = new AbortController();
this._datePickerElement = getDatePicker(this, datePicker);
@@ -106,7 +106,7 @@ export class SbbDatepickerToggle extends LitElement {
// assuming that the two components share the same parent element.
this.parentElement.addEventListener(
'inputUpdated',
- (e: Event) => this._init(e.target as SbbDatepicker),
+ (e: Event) => this._init(e.target as SbbDatepickerElement),
{ once: true, signal: this._datePickerController.signal },
);
return;
@@ -115,7 +115,7 @@ export class SbbDatepickerToggle extends LitElement {
this._datePickerElement?.addEventListener(
'inputUpdated',
(event: CustomEvent) => {
- this._datePickerElement = event.target as SbbDatepicker;
+ this._datePickerElement = event.target as SbbDatepickerElement;
this._disabled = event.detail.disabled || event.detail.readonly;
this._min = event.detail.min;
this._max = event.detail.max;
@@ -132,13 +132,13 @@ export class SbbDatepickerToggle extends LitElement {
this._datePickerElement?.addEventListener(
'datePickerUpdated',
(event: Event) =>
- this._configureCalendar(this._calendarElement, event.target as SbbDatepicker),
+ this._configureCalendar(this._calendarElement, event.target as SbbDatepickerElement),
{ signal: this._datePickerController.signal },
);
this._datePickerElement.dispatchEvent(datepickerControlRegisteredEventFactory());
}
- private _configureCalendar(calendar: SbbCalendar, datepicker: SbbDatepicker): void {
+ private _configureCalendar(calendar: SbbCalendarElement, datepicker: SbbDatepickerElement): void {
if (!calendar || !datepicker) {
return;
}
@@ -147,11 +147,11 @@ export class SbbDatepickerToggle extends LitElement {
}
private _datePickerChanged(event: Event): void {
- this._datePickerElement = event.target as SbbDatepicker;
+ this._datePickerElement = event.target as SbbDatepickerElement;
this._calendarElement.selectedDate = this._datePickerElement.getValueAsDate();
}
- private _assignCalendar(calendar: SbbCalendar): void {
+ private _assignCalendar(calendar: SbbCalendarElement): void {
if (this._calendarElement && this._calendarElement === calendar) {
return;
}
@@ -198,7 +198,7 @@ export class SbbDatepickerToggle extends LitElement {
?disabled=${!this._datePickerElement || this._disabled}
?negative=${this.negative}
data-icon-small
- ${ref((el: SbbTooltipTrigger) => (this._triggerElement = el))}
+ ${ref((el: SbbTooltipTriggerElement) => (this._triggerElement = el))}
>
this._calendarElement.resetPosition()}
@@ -209,7 +209,7 @@ export class SbbDatepickerToggle extends LitElement {
.trigger=${this._triggerElement}
?disable-animation=${this.disableAnimation}
hide-close-button
- ${ref((el: SbbTooltip) => (this._tooltipElement = el))}
+ ${ref((el: SbbTooltipElement) => (this._tooltipElement = el))}
>
this._assignCalendar(calendar))}
+ ${ref((calendar: SbbCalendarElement) => this._assignCalendar(calendar))}
>
`;
@@ -232,6 +232,6 @@ export class SbbDatepickerToggle extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-datepicker-toggle': SbbDatepickerToggle;
+ 'sbb-datepicker-toggle': SbbDatepickerToggleElement;
}
}
diff --git a/src/components/datepicker/datepicker-toggle/readme.md b/src/components/datepicker/datepicker-toggle/readme.md
index 9de5be57ac..b3093ecb9e 100644
--- a/src/components/datepicker/datepicker-toggle/readme.md
+++ b/src/components/datepicker/datepicker-toggle/readme.md
@@ -36,11 +36,11 @@ both standalone or within the `sbb-form-field`, they must have the same parent e
## Properties
-| Name | Attribute | Privacy | Type | Default | Description |
-| ------------------ | ------------------- | ------- | -------------------------------------- | ------- | ---------------------------------- |
-| `datePicker` | `date-picker` | public | `string \| SbbDatepicker \| undefined` | | Datepicker reference. |
-| `disableAnimation` | `disable-animation` | public | `boolean` | `false` | Whether the animation is disabled. |
-| `negative` | `negative` | public | `boolean` | `false` | Negative coloring variant flag. |
+| Name | Attribute | Privacy | Type | Default | Description |
+| ------------------ | ------------------- | ------- | --------------------------------------------- | ------- | ---------------------------------- |
+| `datePicker` | `date-picker` | public | `string \| SbbDatepickerElement \| undefined` | | Datepicker reference. |
+| `disableAnimation` | `disable-animation` | public | `boolean` | `false` | Whether the animation is disabled. |
+| `negative` | `negative` | public | `boolean` | `false` | Negative coloring variant flag. |
## Methods
diff --git a/src/components/datepicker/datepicker/datepicker.e2e.ts b/src/components/datepicker/datepicker/datepicker.e2e.ts
index 3be004a5e5..8048aa63ce 100644
--- a/src/components/datepicker/datepicker/datepicker.e2e.ts
+++ b/src/components/datepicker/datepicker/datepicker.e2e.ts
@@ -6,14 +6,14 @@ import { html } from 'lit/static-html.js';
import { i18nDateChangedTo } from '../../core/i18n';
import { EventSpy, waitForCondition, waitForLitRender } from '../../core/testing';
-import { SbbDatepicker } from './datepicker';
+import { SbbDatepickerElement } from './datepicker';
import '../../form-field';
describe('sbb-datepicker', () => {
it('renders', async () => {
const element = await fixture(html``);
- assert.instanceOf(element, SbbDatepicker);
+ assert.instanceOf(element, SbbDatepickerElement);
});
it('renders and formats date', async () => {
@@ -50,7 +50,7 @@ describe('sbb-datepicker', () => {
});
const commonBehaviorTest: (template: TemplateResult) => void = (template: TemplateResult) => {
- let element: SbbDatepicker, input: HTMLInputElement, button: HTMLButtonElement;
+ let element: SbbDatepickerElement, input: HTMLInputElement, button: HTMLButtonElement;
beforeEach(async () => {
await fixture(template);
@@ -324,7 +324,7 @@ describe('sbb-datepicker', () => {
it('renders', async () => {
const page = await fixture(template);
- assert.instanceOf(page.querySelector('sbb-datepicker'), SbbDatepicker);
+ assert.instanceOf(page.querySelector('sbb-datepicker'), SbbDatepickerElement);
expect(document.querySelector('input')).dom.to.be.equal(
'',
);
@@ -344,7 +344,7 @@ describe('sbb-datepicker', () => {
it('renders', async () => {
const page = await fixture(template);
- assert.instanceOf(page.querySelector('sbb-datepicker'), SbbDatepicker);
+ assert.instanceOf(page.querySelector('sbb-datepicker'), SbbDatepickerElement);
expect(document.querySelector('input')).dom.to.be.equal(
'',
);
diff --git a/src/components/datepicker/datepicker/datepicker.spec.ts b/src/components/datepicker/datepicker/datepicker.spec.ts
index 4603960eea..20580be984 100644
--- a/src/components/datepicker/datepicker/datepicker.spec.ts
+++ b/src/components/datepicker/datepicker/datepicker.spec.ts
@@ -3,10 +3,10 @@ import { html } from 'lit/static-html.js';
import { NativeDateAdapter } from '../../core/datetime';
import { findInput } from '../../core/dom';
-import { SbbFormField } from '../../form-field';
+import { SbbFormFieldElement } from '../../form-field';
import {
- SbbDatepicker,
+ SbbDatepickerElement,
getDatePicker,
getAvailableDate,
findPreviousAvailableDate,
@@ -25,14 +25,14 @@ describe('sbb-datepicker', () => {
describe('getDatePicker', () => {
it('returns the datepicker if no trigger', async () => {
- const page: SbbFormField = await fixture(html`
+ const page: SbbFormFieldElement = await fixture(html`
`);
- const picker: SbbDatepicker = page.querySelector('sbb-datepicker');
+ const picker: SbbDatepickerElement = page.querySelector('sbb-datepicker');
const elementNext = page.querySelector('sbb-datepicker-next-day');
expect(getDatePicker(elementNext)).to.equal(picker);
});
@@ -45,7 +45,7 @@ describe('getDatePicker', () => {
`);
- const picker: SbbDatepicker = page.querySelector('#picker');
+ const picker: SbbDatepickerElement = page.querySelector('#picker');
const elementPrevious = page.querySelector('sbb-datepicker-previous-day');
expect(getDatePicker(elementPrevious, 'picker')).to.equal(picker);
});
@@ -53,13 +53,13 @@ describe('getDatePicker', () => {
describe('getInput', () => {
it('returns the input if no trigger', async () => {
- const page: SbbFormField = await fixture(html`
+ const page: SbbFormFieldElement = await fixture(html`
`);
- const element: SbbDatepicker = page.querySelector('sbb-datepicker');
+ const element: SbbDatepickerElement = page.querySelector('sbb-datepicker');
const input: HTMLInputElement = page.querySelector('input');
expect(findInput(element)).to.equal(input);
});
@@ -72,7 +72,7 @@ describe('getInput', () => {
`);
- const picker: SbbDatepicker = page.querySelector('sbb-datepicker');
+ const picker: SbbDatepickerElement = page.querySelector('sbb-datepicker');
const input: HTMLInputElement = page.querySelector('input');
expect(findInput(picker, 'input')).to.equal(input);
});
diff --git a/src/components/datepicker/datepicker/datepicker.stories.ts b/src/components/datepicker/datepicker/datepicker.stories.ts
index f5187b3930..1cdd7817a5 100644
--- a/src/components/datepicker/datepicker/datepicker.stories.ts
+++ b/src/components/datepicker/datepicker/datepicker.stories.ts
@@ -11,7 +11,7 @@ import { waitForComponentsReady } from '../../../storybook/testing/wait-for-comp
import { waitForStablePosition } from '../../../storybook/testing/wait-for-stable-position';
import { sbbSpread } from '../../core/dom';
-import { SbbDatepicker } from './datepicker';
+import { SbbDatepickerElement } from './datepicker';
import readme from './readme.md?raw';
import '../datepicker-next-day';
@@ -511,7 +511,7 @@ const meta: Meta = {
parameters: {
chromatic: { disableSnapshot: false },
actions: {
- handles: ['input', 'change', SbbDatepicker.events.validationChange],
+ handles: ['input', 'change', SbbDatepickerElement.events.validationChange],
},
backgrounds: {
disable: true,
diff --git a/src/components/datepicker/datepicker/datepicker.ts b/src/components/datepicker/datepicker/datepicker.ts
index 4244323d03..71f04500c1 100644
--- a/src/components/datepicker/datepicker/datepicker.ts
+++ b/src/components/datepicker/datepicker/datepicker.ts
@@ -19,9 +19,9 @@ import {
import { i18nDateChangedTo, i18nDatePickerPlaceholder } from '../../core/i18n';
import { ValidationChangeEvent, SbbDateLike } from '../../core/interfaces';
import { AgnosticMutationObserver } from '../../core/observers';
-import type { SbbDatepickerNextDay } from '../datepicker-next-day';
-import type { SbbDatepickerPreviousDay } from '../datepicker-previous-day';
-import type { SbbDatepickerToggle } from '../datepicker-toggle';
+import type { SbbDatepickerNextDayElement } from '../datepicker-next-day';
+import type { SbbDatepickerPreviousDayElement } from '../datepicker-previous-day';
+import type { SbbDatepickerToggleElement } from '../datepicker-toggle';
import style from './datepicker.scss?lit&inline';
@@ -36,28 +36,31 @@ export interface InputUpdateEvent {
}
/**
- * Given a SbbDatepickerPreviousDay, a SbbDatepickerNextDay or a SbbDatepickerToggle component,
- * it returns the related SbbDatepicker reference, if exists.
- * @param element The element potentially connected to the SbbDatepicker.
+ * Given a SbbDatepickerPreviousDayElement, a SbbDatepickerNextDayElement or a SbbDatepickerToggleElement component,
+ * it returns the related SbbDatepickerElement reference, if exists.
+ * @param element The element potentially connected to the SbbDatepickerElement.
* @param trigger The id or the reference of the SbbDatePicker.
*/
export function getDatePicker(
- element: SbbDatepickerPreviousDay | SbbDatepickerNextDay | SbbDatepickerToggle,
+ element:
+ | SbbDatepickerPreviousDayElement
+ | SbbDatepickerNextDayElement
+ | SbbDatepickerToggleElement,
trigger?: string | HTMLElement,
-): SbbDatepicker {
+): SbbDatepickerElement {
if (!trigger) {
const parent = element.closest?.('sbb-form-field');
return parent?.querySelector('sbb-datepicker');
}
- return findReferencedElement(trigger);
+ return findReferencedElement(trigger);
}
/**
- * Returns the first available date before or after a given one, considering the SbbDatepicker `dateFilter` property.
+ * Returns the first available date before or after a given one, considering the SbbDatepickerElement `dateFilter` property.
* @param date The starting date for calculations.
* @param delta The number of days to add/subtract from the starting one.
- * @param dateFilter The dateFilter function from the SbbDatepicker.
+ * @param dateFilter The dateFilter function from the SbbDatepickerElement.
* @param dateAdapter The adapter class.
*/
export function getAvailableDate(
@@ -79,9 +82,9 @@ export function getAvailableDate(
/**
* Calculates the first available date before the given one,
- * considering the SbbDatepicker `dateFilter` property and `min` parameter (e.g. from the self-named input's attribute).
+ * considering the SbbDatepickerElement `dateFilter` property and `min` parameter (e.g. from the self-named input's attribute).
* @param date The starting date for calculations.
- * @param dateFilter The dateFilter function from the SbbDatepicker.
+ * @param dateFilter The dateFilter function from the SbbDatepickerElement.
* @param dateAdapter The adapter class.
* @param min The minimum value to consider in calculations.
*/
@@ -105,9 +108,9 @@ export function findPreviousAvailableDate(
/**
* Calculates the first available date after the given one,
- * considering the SbbDatepicker `dateFilter` property and `max` parameter (e.g. from the self-named input's attribute).
+ * considering the SbbDatepickerElement `dateFilter` property and `max` parameter (e.g. from the self-named input's attribute).
* @param date The starting date for calculations.
- * @param dateFilter The dateFilter function from the SbbDatepicker.
+ * @param dateFilter The dateFilter function from the SbbDatepickerElement.
* @param dateAdapter The adapter class.
* @param max The maximum value to consider in calculations.
*/
@@ -130,10 +133,10 @@ export function findNextAvailableDate(
}
/**
- * Checks if the provided date is a valid one, considering the SbbDatepicker `dateFilter` property
+ * Checks if the provided date is a valid one, considering the SbbDatepickerElement `dateFilter` property
* and `min` and `max` parameters (e.g. from the self-named input's attributes).
* @param date The starting date for calculations.
- * @param dateFilter The dateFilter function from the SbbDatepicker.
+ * @param dateFilter The dateFilter function from the SbbDatepickerElement.
* @param min The minimum value to consider in calculations.
* @param max The maximum value to consider in calculations.
*/
@@ -174,7 +177,7 @@ export const datepickerControlRegisteredEventFactory = (): CustomEvent =>
* @event {CustomEvent} validationChange - Emits whenever the internal validation state changes.
*/
@customElement('sbb-datepicker')
-export class SbbDatepicker extends LitElement {
+export class SbbDatepickerElement extends LitElement {
public static override styles: CSSResultGroup = style;
public static readonly events = {
didChange: 'didChange',
@@ -203,27 +206,27 @@ export class SbbDatepicker extends LitElement {
/**
* @deprecated only used for React. Will probably be removed once React 19 is available.
*/
- private _didChange: EventEmitter = new EventEmitter(this, SbbDatepicker.events.didChange, {
+ private _didChange: EventEmitter = new EventEmitter(this, SbbDatepickerElement.events.didChange, {
bubbles: true,
cancelable: true,
});
/** Notifies that the connected input has changes. */
- private _change: EventEmitter = new EventEmitter(this, SbbDatepicker.events.change, {
+ private _change: EventEmitter = new EventEmitter(this, SbbDatepickerElement.events.change, {
bubbles: true,
});
/** Notifies that the attributes of the input connected to the datepicker have changes. */
private _inputUpdated: EventEmitter = new EventEmitter(
this,
- SbbDatepicker.events.inputUpdated,
+ SbbDatepickerElement.events.inputUpdated,
{ bubbles: true, cancelable: true },
);
/** Notifies that the attributes of the datepicker have changes. */
private _datePickerUpdated: EventEmitter = new EventEmitter(
this,
- SbbDatepicker.events.datePickerUpdated,
+ SbbDatepickerElement.events.datePickerUpdated,
{
bubbles: true,
cancelable: true,
@@ -233,7 +236,7 @@ export class SbbDatepicker extends LitElement {
/** Emits whenever the internal validation state changes. */
private _validationChange: EventEmitter = new EventEmitter(
this,
- SbbDatepicker.events.validationChange,
+ SbbDatepickerElement.events.validationChange,
);
@state() private get _inputElement(): HTMLInputElement | null {
@@ -494,6 +497,6 @@ export class SbbDatepicker extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-datepicker': SbbDatepicker;
+ 'sbb-datepicker': SbbDatepickerElement;
}
}
diff --git a/src/components/datepicker/datepicker/readme.md b/src/components/datepicker/datepicker/readme.md
index e2f7f4afe3..00ed6b4c06 100644
--- a/src/components/datepicker/datepicker/readme.md
+++ b/src/components/datepicker/datepicker/readme.md
@@ -64,7 +64,7 @@ In particular, `dateParser` is the function that the component uses internally t
while the `format` function is the one that the component uses internally to display a given `Date` object as a string.
```ts
-// datePicker is a SbbDatepicker element
+// datePicker is a SbbDatepickerElement element
datePicker.dateParser = (value: string) => {
// You should implement some kind of input validation
if (!value || !isValid(value)) {
diff --git a/src/components/dialog/dialog.e2e.ts b/src/components/dialog/dialog.e2e.ts
index 991af56537..926231ec71 100644
--- a/src/components/dialog/dialog.e2e.ts
+++ b/src/components/dialog/dialog.e2e.ts
@@ -5,14 +5,14 @@ import { html } from 'lit/static-html.js';
import { i18nDialog } from '../core/i18n';
import { EventSpy, waitForCondition, waitForLitRender } from '../core/testing';
-import { SbbDialog } from './dialog';
+import { SbbDialogElement } from './dialog';
import '../button';
import '../icon';
import '../title';
-async function openDialog(element: SbbDialog): Promise {
- const willOpen = new EventSpy(SbbDialog.events.willOpen);
- const didOpen = new EventSpy(SbbDialog.events.didOpen);
+async function openDialog(element: SbbDialogElement): Promise {
+ const willOpen = new EventSpy(SbbDialogElement.events.willOpen);
+ const didOpen = new EventSpy(SbbDialogElement.events.didOpen);
element.open();
await waitForLitRender(element);
@@ -29,7 +29,7 @@ async function openDialog(element: SbbDialog): Promise {
}
describe('sbb-dialog', () => {
- let element: SbbDialog, ariaLiveRef: HTMLElement;
+ let element: SbbDialogElement, ariaLiveRef: HTMLElement;
beforeEach(async () => {
await setViewport({ width: 900, height: 600 });
@@ -43,7 +43,7 @@ describe('sbb-dialog', () => {
});
it('renders', () => {
- assert.instanceOf(element, SbbDialog);
+ assert.instanceOf(element, SbbDialogElement);
});
it('opens the dialog', async () => {
@@ -51,8 +51,8 @@ describe('sbb-dialog', () => {
});
it('closes the dialog', async () => {
- const willClose = new EventSpy(SbbDialog.events.willClose);
- const didClose = new EventSpy(SbbDialog.events.didClose);
+ const willClose = new EventSpy(SbbDialogElement.events.willClose);
+ const didClose = new EventSpy(SbbDialogElement.events.didClose);
await openDialog(element);
@@ -74,8 +74,8 @@ describe('sbb-dialog', () => {
});
it('closes the dialog on backdrop click', async () => {
- const willClose = new EventSpy(SbbDialog.events.willClose);
- const didClose = new EventSpy(SbbDialog.events.didClose);
+ const willClose = new EventSpy(SbbDialogElement.events.willClose);
+ const didClose = new EventSpy(SbbDialogElement.events.didClose);
await openDialog(element);
@@ -96,8 +96,8 @@ describe('sbb-dialog', () => {
});
it('does not close the dialog on backdrop click', async () => {
- const willClose = new EventSpy(SbbDialog.events.willClose);
- const didClose = new EventSpy(SbbDialog.events.didClose);
+ const willClose = new EventSpy(SbbDialogElement.events.willClose);
+ const didClose = new EventSpy(SbbDialogElement.events.didClose);
element.backdropAction = 'none';
await waitForLitRender(element);
@@ -119,8 +119,8 @@ describe('sbb-dialog', () => {
});
it('does not close the dialog on backdrop click if pointerdown is on dialog', async () => {
- const willClose = new EventSpy(SbbDialog.events.willClose);
- const didClose = new EventSpy(SbbDialog.events.didClose);
+ const willClose = new EventSpy(SbbDialogElement.events.willClose);
+ const didClose = new EventSpy(SbbDialogElement.events.didClose);
await openDialog(element);
@@ -141,8 +141,8 @@ describe('sbb-dialog', () => {
});
it('does not close the dialog on backdrop click if pointerup is on dialog', async () => {
- const willClose = new EventSpy(SbbDialog.events.willClose);
- const didClose = new EventSpy(SbbDialog.events.didClose);
+ const willClose = new EventSpy(SbbDialogElement.events.willClose);
+ const didClose = new EventSpy(SbbDialogElement.events.didClose);
await openDialog(element);
@@ -164,8 +164,8 @@ describe('sbb-dialog', () => {
it('closes the dialog on close button click', async () => {
const closeButton = element.shadowRoot.querySelector('[sbb-dialog-close]') as HTMLElement;
- const willClose = new EventSpy(SbbDialog.events.willClose);
- const didClose = new EventSpy(SbbDialog.events.didClose);
+ const willClose = new EventSpy(SbbDialogElement.events.willClose);
+ const didClose = new EventSpy(SbbDialogElement.events.didClose);
await openDialog(element);
@@ -184,8 +184,8 @@ describe('sbb-dialog', () => {
});
it('closes the dialog on Esc key press', async () => {
- const willClose = new EventSpy(SbbDialog.events.willClose);
- const didClose = new EventSpy(SbbDialog.events.didClose);
+ const willClose = new EventSpy(SbbDialogElement.events.willClose);
+ const didClose = new EventSpy(SbbDialogElement.events.didClose);
await openDialog(element);
@@ -240,14 +240,14 @@ describe('sbb-dialog', () => {
`);
- const willOpen = new EventSpy(SbbDialog.events.willOpen);
- const didOpen = new EventSpy(SbbDialog.events.didOpen);
- const willClose = new EventSpy(SbbDialog.events.willClose);
- const didClose = new EventSpy(SbbDialog.events.didClose);
+ const willOpen = new EventSpy(SbbDialogElement.events.willOpen);
+ const didOpen = new EventSpy(SbbDialogElement.events.didOpen);
+ const willClose = new EventSpy(SbbDialogElement.events.willClose);
+ const didClose = new EventSpy(SbbDialogElement.events.didClose);
await openDialog(element);
- const stackedDialog = document.querySelector('#stacked-dialog') as SbbDialog;
+ const stackedDialog = document.querySelector('#stacked-dialog') as SbbDialogElement;
stackedDialog.open();
await waitForLitRender(element);
@@ -309,11 +309,11 @@ describe('sbb-dialog', () => {
`);
- const willOpen = new EventSpy(SbbDialog.events.willOpen);
- const didOpen = new EventSpy(SbbDialog.events.didOpen);
- const willClose = new EventSpy(SbbDialog.events.willClose);
- const didClose = new EventSpy(SbbDialog.events.didClose);
- const innerElement = element.querySelector('sbb-dialog') as SbbDialog;
+ const willOpen = new EventSpy(SbbDialogElement.events.willOpen);
+ const didOpen = new EventSpy(SbbDialogElement.events.didOpen);
+ const willClose = new EventSpy(SbbDialogElement.events.willClose);
+ const didClose = new EventSpy(SbbDialogElement.events.didClose);
+ const innerElement = element.querySelector('sbb-dialog') as SbbDialogElement;
await openDialog(element);
diff --git a/src/components/dialog/dialog.stories.ts b/src/components/dialog/dialog.stories.ts
index e07adf7e93..611a502638 100644
--- a/src/components/dialog/dialog.stories.ts
+++ b/src/components/dialog/dialog.stories.ts
@@ -11,7 +11,7 @@ import { waitForStablePosition } from '../../storybook/testing/wait-for-stable-p
import { sbbSpread } from '../core/dom';
import sampleImages from '../core/images';
-import { SbbDialog } from './dialog';
+import { SbbDialogElement } from './dialog';
import readme from './readme.md?raw';
import '../button';
@@ -125,7 +125,7 @@ const basicArgs: Args = {
};
const openDialog = (_event, id): void => {
- const dialog = document.getElementById(id) as SbbDialog;
+ const dialog = document.getElementById(id) as SbbDialogElement;
dialog.open();
};
@@ -390,11 +390,11 @@ const meta: Meta = {
chromatic: { disableSnapshot: false },
actions: {
handles: [
- SbbDialog.events.willOpen,
- SbbDialog.events.didOpen,
- SbbDialog.events.willClose,
- SbbDialog.events.didClose,
- SbbDialog.events.backClick,
+ SbbDialogElement.events.willOpen,
+ SbbDialogElement.events.didOpen,
+ SbbDialogElement.events.willClose,
+ SbbDialogElement.events.didClose,
+ SbbDialogElement.events.backClick,
],
},
backgrounds: {
diff --git a/src/components/dialog/dialog.ts b/src/components/dialog/dialog.ts
index 72d9fcb970..5082013606 100644
--- a/src/components/dialog/dialog.ts
+++ b/src/components/dialog/dialog.ts
@@ -28,7 +28,7 @@ import style from './dialog.scss?lit&inline';
import '../button';
// A global collection of existing dialogs
-const dialogRefs: SbbDialog[] = [];
+const dialogRefs: SbbDialogElement[] = [];
let nextId = 0;
/**
@@ -44,7 +44,7 @@ let nextId = 0;
* @event {CustomEvent} requestBackAction - Emits whenever the back button is clicked.
*/
@customElement('sbb-dialog')
-export class SbbDialog extends LitElement {
+export class SbbDialogElement extends LitElement {
public static override styles: CSSResultGroup = style;
public static readonly events = {
willOpen: 'willOpen',
@@ -129,19 +129,22 @@ export class SbbDialog extends LitElement {
private _ariaLiveRefToggle = false;
/** Emits whenever the `sbb-dialog` starts the opening transition. */
- private _willOpen: EventEmitter = new EventEmitter(this, SbbDialog.events.willOpen);
+ private _willOpen: EventEmitter = new EventEmitter(this, SbbDialogElement.events.willOpen);
/** Emits whenever the `sbb-dialog` is opened. */
- private _didOpen: EventEmitter = new EventEmitter(this, SbbDialog.events.didOpen);
+ private _didOpen: EventEmitter = new EventEmitter(this, SbbDialogElement.events.didOpen);
/** Emits whenever the `sbb-dialog` begins the closing transition. */
- private _willClose: EventEmitter = new EventEmitter(this, SbbDialog.events.willClose);
+ private _willClose: EventEmitter = new EventEmitter(this, SbbDialogElement.events.willClose);
/** Emits whenever the `sbb-dialog` is closed. */
- private _didClose: EventEmitter = new EventEmitter(this, SbbDialog.events.didClose);
+ private _didClose: EventEmitter = new EventEmitter(this, SbbDialogElement.events.didClose);
/** Emits whenever the back button is clicked. */
- private _backClick: EventEmitter = new EventEmitter(this, SbbDialog.events.backClick);
+ private _backClick: EventEmitter = new EventEmitter(
+ this,
+ SbbDialogElement.events.backClick,
+ );
private _dialog: HTMLDivElement;
private _dialogWrapperElement: HTMLElement;
@@ -187,7 +190,7 @@ export class SbbDialog extends LitElement {
this._willOpen.emit();
this._state = 'opening';
// Add this dialog to the global collection
- dialogRefs.push(this as SbbDialog);
+ dialogRefs.push(this as SbbDialogElement);
this._setOverflowAttribute();
// Disable scrolling for content below the dialog
this._scrollHandler.disableScroll();
@@ -257,7 +260,7 @@ export class SbbDialog extends LitElement {
}
private _removeInstanceFromGlobalCollection(): void {
- dialogRefs.splice(dialogRefs.indexOf(this as SbbDialog), 1);
+ dialogRefs.splice(dialogRefs.indexOf(this as SbbDialogElement), 1);
}
private _attachWindowEvents(): void {
@@ -483,6 +486,6 @@ export class SbbDialog extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-dialog': SbbDialog;
+ 'sbb-dialog': SbbDialogElement;
}
}
diff --git a/src/components/divider/divider.e2e.ts b/src/components/divider/divider.e2e.ts
index df991ccaa4..0e7d474684 100644
--- a/src/components/divider/divider.e2e.ts
+++ b/src/components/divider/divider.e2e.ts
@@ -1,11 +1,11 @@
import { assert, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbDivider } from './divider';
+import { SbbDividerElement } from './divider';
describe('sbb-divider', () => {
it('renders', async () => {
- const element: SbbDivider = await fixture(html``);
- assert.instanceOf(element, SbbDivider);
+ const element: SbbDividerElement = await fixture(html``);
+ assert.instanceOf(element, SbbDividerElement);
});
});
diff --git a/src/components/divider/divider.ts b/src/components/divider/divider.ts
index 4f94425259..970117ada1 100644
--- a/src/components/divider/divider.ts
+++ b/src/components/divider/divider.ts
@@ -10,7 +10,7 @@ import style from './divider.scss?lit&inline';
* It displays a divider between sections.
*/
@customElement('sbb-divider')
-export class SbbDivider extends LitElement {
+export class SbbDividerElement extends LitElement {
public static override styles: CSSResultGroup = style;
/** Negative coloring variant flag */
@@ -30,6 +30,6 @@ export class SbbDivider extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-divider': SbbDivider;
+ 'sbb-divider': SbbDividerElement;
}
}
diff --git a/src/components/expansion-panel/expansion-panel-content/expansion-panel-content.e2e.ts b/src/components/expansion-panel/expansion-panel-content/expansion-panel-content.e2e.ts
index f96fedaa59..cdc477578f 100644
--- a/src/components/expansion-panel/expansion-panel-content/expansion-panel-content.e2e.ts
+++ b/src/components/expansion-panel/expansion-panel-content/expansion-panel-content.e2e.ts
@@ -1,15 +1,15 @@
import { assert, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbExpansionPanelContent } from './expansion-panel-content';
+import { SbbExpansionPanelContentElement } from './expansion-panel-content';
describe('sbb-expansion-panel-content', () => {
- let element: SbbExpansionPanelContent;
+ let element: SbbExpansionPanelContentElement;
it('renders', async () => {
element = await fixture(
html`Content`,
);
- assert.instanceOf(element, SbbExpansionPanelContent);
+ assert.instanceOf(element, SbbExpansionPanelContentElement);
});
});
diff --git a/src/components/expansion-panel/expansion-panel-content/expansion-panel-content.ts b/src/components/expansion-panel/expansion-panel-content/expansion-panel-content.ts
index 9f348d6b95..c9670acbfb 100644
--- a/src/components/expansion-panel/expansion-panel-content/expansion-panel-content.ts
+++ b/src/components/expansion-panel/expansion-panel-content/expansion-panel-content.ts
@@ -11,7 +11,7 @@ import style from './expansion-panel-content.scss?lit&inline';
* @slot - Use the unnamed slot to add content to the `sbb-expansion-panel`.
*/
@customElement('sbb-expansion-panel-content')
-export class SbbExpansionPanelContent extends LitElement {
+export class SbbExpansionPanelContentElement extends LitElement {
public static override styles: CSSResultGroup = style;
protected override render(): TemplateResult {
@@ -29,6 +29,6 @@ export class SbbExpansionPanelContent extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-expansion-panel-content': SbbExpansionPanelContent;
+ 'sbb-expansion-panel-content': SbbExpansionPanelContentElement;
}
}
diff --git a/src/components/expansion-panel/expansion-panel-header/expansion-panel-header.e2e.ts b/src/components/expansion-panel/expansion-panel-header/expansion-panel-header.e2e.ts
index 4a93d63c5a..d075598b00 100644
--- a/src/components/expansion-panel/expansion-panel-header/expansion-panel-header.e2e.ts
+++ b/src/components/expansion-panel/expansion-panel-header/expansion-panel-header.e2e.ts
@@ -3,21 +3,21 @@ import { html } from 'lit/static-html.js';
import { EventSpy } from '../../core/testing';
-import { SbbExpansionPanelHeader } from './expansion-panel-header';
+import { SbbExpansionPanelHeaderElement } from './expansion-panel-header';
describe('sbb-expansion-panel-header', () => {
- let element: SbbExpansionPanelHeader;
+ let element: SbbExpansionPanelHeaderElement;
beforeEach(async () => {
element = await fixture(html`Header`);
});
it('renders', async () => {
- assert.instanceOf(element, SbbExpansionPanelHeader);
+ assert.instanceOf(element, SbbExpansionPanelHeaderElement);
});
it('should emit event on click', async () => {
- const spy = new EventSpy(SbbExpansionPanelHeader.events.toggleExpanded);
+ const spy = new EventSpy(SbbExpansionPanelHeaderElement.events.toggleExpanded);
element.click();
expect(spy.count).to.be.greaterThan(0);
});
@@ -26,7 +26,7 @@ describe('sbb-expansion-panel-header', () => {
element = await fixture(
html`Header`,
);
- const spy = new EventSpy(SbbExpansionPanelHeader.events.toggleExpanded);
+ const spy = new EventSpy(SbbExpansionPanelHeaderElement.events.toggleExpanded);
element.click();
expect(spy.count).not.to.be.greaterThan(0);
});
diff --git a/src/components/expansion-panel/expansion-panel-header/expansion-panel-header.ts b/src/components/expansion-panel/expansion-panel-header/expansion-panel-header.ts
index dcd9fd7a07..1eb7615af3 100644
--- a/src/components/expansion-panel/expansion-panel-header/expansion-panel-header.ts
+++ b/src/components/expansion-panel/expansion-panel-header/expansion-panel-header.ts
@@ -11,7 +11,7 @@ import {
ConnectedAbortController,
} from '../../core/eventing';
import { resolveButtonRenderVariables } from '../../core/interfaces';
-import type { SbbExpansionPanel } from '../expansion-panel';
+import type { SbbExpansionPanelElement } from '../expansion-panel';
import style from './expansion-panel-header.scss?lit&inline';
import '../../icon';
@@ -24,7 +24,7 @@ import '../../icon';
* @event {CustomEvent} toggleExpanded - Notifies that the `sbb-expansion-panel` has to expand.
*/
@customElement('sbb-expansion-panel-header')
-export class SbbExpansionPanelHeader extends LitElement {
+export class SbbExpansionPanelHeaderElement extends LitElement {
public static override styles: CSSResultGroup = style;
public static readonly events = {
toggleExpanded: 'toggleExpanded',
@@ -46,7 +46,7 @@ export class SbbExpansionPanelHeader extends LitElement {
/** Notifies that the `sbb-expansion-panel` has to expand. */
private _toggleExpanded: EventEmitter = new EventEmitter(
this,
- SbbExpansionPanelHeader.events.toggleExpanded,
+ SbbExpansionPanelHeaderElement.events.toggleExpanded,
{
bubbles: true,
},
@@ -80,7 +80,7 @@ export class SbbExpansionPanelHeader extends LitElement {
}
private _onMouseMovement(toggleDataAttribute: boolean): void {
- const parent: SbbExpansionPanel = this.closest('sbb-expansion-panel');
+ const parent: SbbExpansionPanelElement = this.closest('sbb-expansion-panel');
// The `sbb.hover-mq` logic has been removed from scss, but it must be replicated to have the correct behavior on mobile.
if (!toggleDataAttribute || (parent && window.matchMedia('(any-hover: hover)').matches)) {
toggleDatasetEntry(parent, 'toggleHover', toggleDataAttribute);
@@ -123,6 +123,6 @@ export class SbbExpansionPanelHeader extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-expansion-panel-header': SbbExpansionPanelHeader;
+ 'sbb-expansion-panel-header': SbbExpansionPanelHeaderElement;
}
}
diff --git a/src/components/expansion-panel/expansion-panel/expansion-panel.e2e.ts b/src/components/expansion-panel/expansion-panel/expansion-panel.e2e.ts
index e6deb06d5f..06bcff2535 100644
--- a/src/components/expansion-panel/expansion-panel/expansion-panel.e2e.ts
+++ b/src/components/expansion-panel/expansion-panel/expansion-panel.e2e.ts
@@ -2,14 +2,14 @@ import { assert, expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
import { waitForCondition, waitForLitRender, EventSpy } from '../../core/testing';
-import type { SbbExpansionPanelContent } from '../expansion-panel-content';
+import type { SbbExpansionPanelContentElement } from '../expansion-panel-content';
import '../expansion-panel-content';
-import { SbbExpansionPanelHeader } from '../expansion-panel-header';
+import { SbbExpansionPanelHeaderElement } from '../expansion-panel-header';
-import { SbbExpansionPanel } from './expansion-panel';
+import { SbbExpansionPanelElement } from './expansion-panel';
describe('sbb-expansion-panel', () => {
- let element: SbbExpansionPanel;
+ let element: SbbExpansionPanelElement;
beforeEach(async () => {
element = await fixture(html`
@@ -21,7 +21,7 @@ describe('sbb-expansion-panel', () => {
});
it('renders', async () => {
- assert.instanceOf(element, SbbExpansionPanel);
+ assert.instanceOf(element, SbbExpansionPanelElement);
});
it('has slotted elements with the correct properties', async () => {
@@ -51,17 +51,23 @@ describe('sbb-expansion-panel', () => {
});
it('click the header expands the panel, click again collapses it', async () => {
- const header: SbbExpansionPanelHeader = element.querySelector('sbb-expansion-panel-header');
- const content: SbbExpansionPanelContent = element.querySelector('sbb-expansion-panel-content');
+ const header: SbbExpansionPanelHeaderElement = element.querySelector(
+ 'sbb-expansion-panel-header',
+ );
+ const content: SbbExpansionPanelContentElement = element.querySelector(
+ 'sbb-expansion-panel-content',
+ );
expect(element.expanded).to.be.equal(false);
expect(header.getAttribute('aria-expanded')).to.be.equal('false');
expect(content.getAttribute('aria-hidden')).to.be.equal('true');
- const toggleExpandedEventSpy = new EventSpy(SbbExpansionPanelHeader.events.toggleExpanded);
- const willOpenEventSpy = new EventSpy(SbbExpansionPanel.events.willOpen);
- const willCloseEventSpy = new EventSpy(SbbExpansionPanel.events.willClose);
- const didOpenEventSpy = new EventSpy(SbbExpansionPanel.events.didOpen);
- const didCloseEventSpy = new EventSpy(SbbExpansionPanel.events.didClose);
+ const toggleExpandedEventSpy = new EventSpy(
+ SbbExpansionPanelHeaderElement.events.toggleExpanded,
+ );
+ const willOpenEventSpy = new EventSpy(SbbExpansionPanelElement.events.willOpen);
+ const willCloseEventSpy = new EventSpy(SbbExpansionPanelElement.events.willClose);
+ const didOpenEventSpy = new EventSpy(SbbExpansionPanelElement.events.didOpen);
+ const didCloseEventSpy = new EventSpy(SbbExpansionPanelElement.events.didClose);
header.click();
await waitForCondition(() => toggleExpandedEventSpy.events.length === 1);
@@ -89,7 +95,9 @@ describe('sbb-expansion-panel', () => {
});
it('disabled property is proxied to header', async () => {
- const header: SbbExpansionPanelHeader = element.querySelector('sbb-expansion-panel-header');
+ const header: SbbExpansionPanelHeaderElement = element.querySelector(
+ 'sbb-expansion-panel-header',
+ );
expect(header.disabled).to.be.undefined;
expect(header).not.to.have.attribute('aria-disabled');
diff --git a/src/components/expansion-panel/expansion-panel/expansion-panel.stories.ts b/src/components/expansion-panel/expansion-panel/expansion-panel.stories.ts
index 883685f867..0e59f02a5a 100644
--- a/src/components/expansion-panel/expansion-panel/expansion-panel.stories.ts
+++ b/src/components/expansion-panel/expansion-panel/expansion-panel.stories.ts
@@ -12,9 +12,9 @@ import { html, TemplateResult } from 'lit';
import { styleMap } from 'lit/directives/style-map.js';
import { sbbSpread } from '../../core/dom';
-import { SbbExpansionPanelHeader } from '../expansion-panel-header';
+import { SbbExpansionPanelHeaderElement } from '../expansion-panel-header';
-import { SbbExpansionPanel } from './expansion-panel';
+import { SbbExpansionPanelElement } from './expansion-panel';
import readme from './readme.md?raw';
import '../expansion-panel-content';
@@ -220,11 +220,11 @@ const meta: Meta = {
parameters: {
actions: {
handles: [
- SbbExpansionPanel.events.willOpen,
- SbbExpansionPanel.events.didOpen,
- SbbExpansionPanel.events.willClose,
- SbbExpansionPanel.events.didClose,
- SbbExpansionPanelHeader.events.toggleExpanded,
+ SbbExpansionPanelElement.events.willOpen,
+ SbbExpansionPanelElement.events.didOpen,
+ SbbExpansionPanelElement.events.willClose,
+ SbbExpansionPanelElement.events.didClose,
+ SbbExpansionPanelHeaderElement.events.toggleExpanded,
],
},
backgrounds: {
diff --git a/src/components/expansion-panel/expansion-panel/expansion-panel.ts b/src/components/expansion-panel/expansion-panel/expansion-panel.ts
index 96590bea10..614ac96ba0 100644
--- a/src/components/expansion-panel/expansion-panel/expansion-panel.ts
+++ b/src/components/expansion-panel/expansion-panel/expansion-panel.ts
@@ -6,8 +6,8 @@ import { toggleDatasetEntry } from '../../core/dom';
import { EventEmitter, ConnectedAbortController } from '../../core/eventing';
import { SbbOverlayState } from '../../core/overlay';
import type { TitleLevel } from '../../title';
-import type { SbbExpansionPanelContent } from '../expansion-panel-content';
-import type { SbbExpansionPanelHeader } from '../expansion-panel-header';
+import type { SbbExpansionPanelContentElement } from '../expansion-panel-content';
+import type { SbbExpansionPanelHeaderElement } from '../expansion-panel-header';
import style from './expansion-panel.scss?lit&inline';
@@ -23,7 +23,7 @@ let nextId = 0;
* @event {CustomEvent} didClose - Emits whenever the `sbb-expansion-panel` is closed.
*/
@customElement('sbb-expansion-panel')
-export class SbbExpansionPanel extends LitElement {
+export class SbbExpansionPanelElement extends LitElement {
public static override styles: CSSResultGroup = style;
public static readonly events = {
willOpen: 'willOpen',
@@ -68,19 +68,28 @@ export class SbbExpansionPanel extends LitElement {
public disableAnimation = false;
/** Emits whenever the `sbb-expansion-panel` starts the opening transition. */
- private _willOpen: EventEmitter = new EventEmitter(this, SbbExpansionPanel.events.willOpen);
+ private _willOpen: EventEmitter = new EventEmitter(
+ this,
+ SbbExpansionPanelElement.events.willOpen,
+ );
/** Emits whenever the `sbb-expansion-panel` is opened. */
- private _didOpen: EventEmitter = new EventEmitter(this, SbbExpansionPanel.events.didOpen);
+ private _didOpen: EventEmitter = new EventEmitter(
+ this,
+ SbbExpansionPanelElement.events.didOpen,
+ );
/** Emits whenever the `sbb-expansion-panel` begins the closing transition. */
private _willClose: EventEmitter = new EventEmitter(
this,
- SbbExpansionPanel.events.willClose,
+ SbbExpansionPanelElement.events.willClose,
);
/** Emits whenever the `sbb-expansion-panel` is closed. */
- private _didClose: EventEmitter = new EventEmitter(this, SbbExpansionPanel.events.didClose);
+ private _didClose: EventEmitter = new EventEmitter(
+ this,
+ SbbExpansionPanelElement.events.didClose,
+ );
private _abort = new ConnectedAbortController(this);
private _state: SbbOverlayState = 'closed';
@@ -118,8 +127,8 @@ export class SbbExpansionPanel extends LitElement {
private _transitionEventController: AbortController;
private _progressiveId = `-${++nextId}`;
- private _headerRef: SbbExpansionPanelHeader;
- private _contentRef: SbbExpansionPanelContent;
+ private _headerRef: SbbExpansionPanelHeaderElement;
+ private _contentRef: SbbExpansionPanelContentElement;
private _contentWrapperRef: HTMLElement;
public override connectedCallback(): void {
@@ -155,7 +164,7 @@ export class SbbExpansionPanel extends LitElement {
}
this._headerRef = elements.find(
- (e): e is SbbExpansionPanelHeader => e.tagName === 'SBB-EXPANSION-PANEL-HEADER',
+ (e): e is SbbExpansionPanelHeaderElement => e.tagName === 'SBB-EXPANSION-PANEL-HEADER',
);
if (!this._headerRef) {
@@ -180,7 +189,9 @@ export class SbbExpansionPanel extends LitElement {
this._contentRef = (event.target as HTMLSlotElement)
.assignedElements()
- .find((e): e is SbbExpansionPanelContent => e.tagName === 'SBB-EXPANSION-PANEL-CONTENT');
+ .find(
+ (e): e is SbbExpansionPanelContentElement => e.tagName === 'SBB-EXPANSION-PANEL-CONTENT',
+ );
this._contentWrapperRef = this.shadowRoot.querySelector(
'.sbb-expansion-panel__content-wrapper',
@@ -263,6 +274,6 @@ export class SbbExpansionPanel extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-expansion-panel': SbbExpansionPanel;
+ 'sbb-expansion-panel': SbbExpansionPanelElement;
}
}
diff --git a/src/components/file-selector/file-selector.e2e.ts b/src/components/file-selector/file-selector.e2e.ts
index 7c583c0cac..6807946d66 100644
--- a/src/components/file-selector/file-selector.e2e.ts
+++ b/src/components/file-selector/file-selector.e2e.ts
@@ -1,13 +1,13 @@
import { assert, expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbButton } from '../button';
+import { SbbButtonElement } from '../button';
import { EventSpy, waitForLitRender } from '../core/testing';
-import { SbbFileSelector } from './file-selector';
+import { SbbFileSelectorElement } from './file-selector';
function addFilesToComponentInput(
- elem: SbbFileSelector,
+ elem: SbbFileSelectorElement,
numberOfFiles: number,
filesContent: string | string[] = 'Hello world',
): void {
@@ -27,18 +27,18 @@ function addFilesToComponentInput(
}
describe('sbb-file-selector', () => {
- let element: SbbFileSelector;
+ let element: SbbFileSelectorElement;
beforeEach(async () => {
element = await fixture(html``);
});
it('renders', () => {
- assert.instanceOf(element, SbbFileSelector);
+ assert.instanceOf(element, SbbFileSelectorElement);
});
it('loads a file, then deletes it', async () => {
- const fileChangedSpy = new EventSpy(SbbFileSelector.events.fileChangedEvent);
+ const fileChangedSpy = new EventSpy(SbbFileSelectorElement.events.fileChangedEvent);
addFilesToComponentInput(element, 1);
await waitForLitRender(element);
@@ -60,7 +60,7 @@ describe('sbb-file-selector', () => {
`);
- const button: SbbButton = element.shadowRoot.querySelector(
+ const button: SbbButtonElement = element.shadowRoot.querySelector(
'sbb-button[icon-name="trash-small"]',
);
expect(button).not.to.be.null;
@@ -73,7 +73,7 @@ describe('sbb-file-selector', () => {
});
it('loads more than one file in multiple mode', async () => {
- const fileChangedSpy = new EventSpy(SbbFileSelector.events.fileChangedEvent);
+ const fileChangedSpy = new EventSpy(SbbFileSelectorElement.events.fileChangedEvent);
element.multiple = true;
await waitForLitRender(element);
addFilesToComponentInput(element, 2);
@@ -94,7 +94,7 @@ describe('sbb-file-selector', () => {
});
it('loads files in multiple persistent mode', async () => {
- const fileChangedSpy = new EventSpy(SbbFileSelector.events.fileChangedEvent);
+ const fileChangedSpy = new EventSpy(SbbFileSelectorElement.events.fileChangedEvent);
element.multiple = true;
element.multipleMode = 'persistent';
await waitForLitRender(element);
diff --git a/src/components/file-selector/file-selector.stories.ts b/src/components/file-selector/file-selector.stories.ts
index 1e146f027a..8169a8e5bd 100644
--- a/src/components/file-selector/file-selector.stories.ts
+++ b/src/components/file-selector/file-selector.stories.ts
@@ -4,9 +4,9 @@ import type { Meta, StoryObj, ArgTypes, Args, Decorator } from '@storybook/web-c
import { html, TemplateResult } from 'lit';
import { sbbSpread } from '../core/dom';
-import type { SbbFormError } from '../form-error';
+import type { SbbFormErrorElement } from '../form-error';
-import { SbbFileSelector } from './file-selector';
+import { SbbFileSelectorElement } from './file-selector';
import readme from './readme.md?raw';
import '../form-error';
@@ -85,7 +85,7 @@ const Template = (args): TemplateResult =>
html``;
const TemplateWithError = (args): TemplateResult => {
- const sbbFormError: SbbFormError = document.createElement('sbb-form-error');
+ const sbbFormError: SbbFormErrorElement = document.createElement('sbb-form-error');
sbbFormError.setAttribute('slot', 'error');
sbbFormError.textContent = 'There has been an error.';
@@ -178,7 +178,7 @@ const meta: Meta = {
decorators: [(story) => html` ${story()}
`, withActions as Decorator],
parameters: {
actions: {
- handles: [SbbFileSelector.events.fileChangedEvent],
+ handles: [SbbFileSelectorElement.events.fileChangedEvent],
},
backgrounds: {
disable: true,
diff --git a/src/components/file-selector/file-selector.ts b/src/components/file-selector/file-selector.ts
index 1e2b0b64b1..869042faa6 100644
--- a/src/components/file-selector/file-selector.ts
+++ b/src/components/file-selector/file-selector.ts
@@ -33,7 +33,7 @@ export type DOMEvent = globalThis.Event;
* @event {CustomEvent} fileChanged - An event which is emitted each time the file list changes.
*/
@customElement('sbb-file-selector')
-export class SbbFileSelector extends LitElement {
+export class SbbFileSelectorElement extends LitElement {
public static override styles: CSSResultGroup = style;
public static readonly events = {
fileChangedEvent: 'fileChanged',
@@ -73,7 +73,7 @@ export class SbbFileSelector extends LitElement {
/** An event which is emitted each time the file list changes. */
private _fileChangedEvent: EventEmitter = new EventEmitter(
this,
- SbbFileSelector.events.fileChangedEvent,
+ SbbFileSelectorElement.events.fileChangedEvent,
);
/**
@@ -344,6 +344,6 @@ export class SbbFileSelector extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-file-selector': SbbFileSelector;
+ 'sbb-file-selector': SbbFileSelectorElement;
}
}
diff --git a/src/components/footer/footer.e2e.ts b/src/components/footer/footer.e2e.ts
index bf4cd7164a..951bbe7cab 100644
--- a/src/components/footer/footer.e2e.ts
+++ b/src/components/footer/footer.e2e.ts
@@ -1,13 +1,13 @@
import { assert, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbFooter } from './footer';
+import { SbbFooterElement } from './footer';
describe('sbb-footer', () => {
- let element: SbbFooter;
+ let element: SbbFooterElement;
it('renders', async () => {
element = await fixture(html``);
- assert.instanceOf(element, SbbFooter);
+ assert.instanceOf(element, SbbFooterElement);
});
});
diff --git a/src/components/footer/footer.spec.ts b/src/components/footer/footer.spec.ts
index 8cf0e3c127..ae3bb7b853 100644
--- a/src/components/footer/footer.spec.ts
+++ b/src/components/footer/footer.spec.ts
@@ -1,13 +1,13 @@
import { expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import type { SbbFooter } from './footer';
+import type { SbbFooterElement } from './footer';
import './footer';
describe('sbb-footer', () => {
it('renders', async () => {
- const element: SbbFooter = await fixture(
+ const element: SbbFooterElement = await fixture(
html``,
);
diff --git a/src/components/footer/footer.ts b/src/components/footer/footer.ts
index 08bbf44f0c..aaf061dcb8 100644
--- a/src/components/footer/footer.ts
+++ b/src/components/footer/footer.ts
@@ -12,7 +12,7 @@ import style from './footer.scss?lit&inline';
* @slot - Use the unnamed slot to add elements like `sbb-link`, `sbb-link-list`, `sbb-divider` and so on.
*/
@customElement('sbb-footer')
-export class SbbFooter extends LitElement {
+export class SbbFooterElement extends LitElement {
public static override styles: CSSResultGroup = style;
/**
@@ -60,6 +60,6 @@ export class SbbFooter extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-footer': SbbFooter;
+ 'sbb-footer': SbbFooterElement;
}
}
diff --git a/src/components/form-error/form-error.e2e.ts b/src/components/form-error/form-error.e2e.ts
index 8e0370dc31..e450962faa 100644
--- a/src/components/form-error/form-error.e2e.ts
+++ b/src/components/form-error/form-error.e2e.ts
@@ -1,15 +1,15 @@
import { assert, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbFormError } from './form-error';
+import { SbbFormErrorElement } from './form-error';
describe('sbb-form-error', () => {
- let element: SbbFormError;
+ let element: SbbFormErrorElement;
it('renders', async () => {
await fixture(html``);
element = document.querySelector('sbb-form-error');
- assert.instanceOf(element, SbbFormError);
+ assert.instanceOf(element, SbbFormErrorElement);
});
});
diff --git a/src/components/form-error/form-error.ts b/src/components/form-error/form-error.ts
index 785afa6b19..e96fae6b19 100644
--- a/src/components/form-error/form-error.ts
+++ b/src/components/form-error/form-error.ts
@@ -15,7 +15,7 @@ let nextId = 0;
* @slot icon - Use this slot to override the default error icon.
*/
@customElement('sbb-form-error')
-export class SbbFormError extends LitElement {
+export class SbbFormErrorElement extends LitElement {
public static override styles: CSSResultGroup = style;
/** Negative coloring variant flag. */
@@ -60,6 +60,6 @@ export class SbbFormError extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-form-error': SbbFormError;
+ 'sbb-form-error': SbbFormErrorElement;
}
}
diff --git a/src/components/form-field/form-field-clear/form-field-clear.e2e.ts b/src/components/form-field/form-field-clear/form-field-clear.e2e.ts
index 8c2e35a77e..871cf79234 100644
--- a/src/components/form-field/form-field-clear/form-field-clear.e2e.ts
+++ b/src/components/form-field/form-field-clear/form-field-clear.e2e.ts
@@ -2,13 +2,13 @@ import { assert, expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
import { waitForLitRender } from '../../core/testing';
-import { SbbFormField } from '../form-field';
+import { SbbFormFieldElement } from '../form-field';
-import { SbbFormFieldClear } from './form-field-clear';
+import { SbbFormFieldClearElement } from './form-field-clear';
describe('sbb-form-field-clear', () => {
- let element: SbbFormFieldClear;
- let formField: SbbFormField;
+ let element: SbbFormFieldClearElement;
+ let formField: SbbFormFieldElement;
let input: HTMLInputElement;
beforeEach(async () => {
@@ -23,8 +23,8 @@ describe('sbb-form-field-clear', () => {
});
it('renders', async () => {
- assert.instanceOf(element, SbbFormFieldClear);
- assert.instanceOf(formField, SbbFormField);
+ assert.instanceOf(element, SbbFormFieldClearElement);
+ assert.instanceOf(formField, SbbFormFieldElement);
});
it('clears the value and sets the focus on the input', async () => {
diff --git a/src/components/form-field/form-field-clear/form-field-clear.ts b/src/components/form-field/form-field-clear/form-field-clear.ts
index 8f8a4f24a9..70e4356a52 100644
--- a/src/components/form-field/form-field-clear/form-field-clear.ts
+++ b/src/components/form-field/form-field-clear/form-field-clear.ts
@@ -11,7 +11,7 @@ import {
} from '../../core/eventing';
import { i18nClearInput } from '../../core/i18n';
import { ButtonProperties, resolveButtonRenderVariables } from '../../core/interfaces';
-import type { SbbFormField } from '../form-field';
+import type { SbbFormFieldElement } from '../form-field';
import style from './form-field-clear.scss?lit&inline';
import '../../icon';
@@ -20,7 +20,7 @@ import '../../icon';
* Combined with `sbb-form-field`, it displays a button which clears the input value.
*/
@customElement('sbb-form-field-clear')
-export class SbbFormFieldClear extends LitElement {
+export class SbbFormFieldClearElement extends LitElement {
public static override styles: CSSResultGroup = style;
/** Negative coloring variant flag. */
@@ -33,7 +33,7 @@ export class SbbFormFieldClear extends LitElement {
actionElementHandlerAspect,
languageChangeHandlerAspect((l) => (this._currentLanguage = l)),
);
- private _formField: SbbFormField;
+ private _formField: SbbFormFieldElement;
private _abort = new ConnectedAbortController(this);
public override connectedCallback(): void {
@@ -42,8 +42,8 @@ export class SbbFormFieldClear extends LitElement {
this.addEventListener('click', () => this._handleClick(), { signal });
this._handlerRepository.connect();
this._formField =
- (hostContext('sbb-form-field', this) as SbbFormField) ??
- (hostContext('[data-form-field]', this) as SbbFormField);
+ (hostContext('sbb-form-field', this) as SbbFormFieldElement) ??
+ (hostContext('[data-form-field]', this) as SbbFormFieldElement);
if (this._formField) {
this.negative = isValidAttribute(this._formField, 'negative');
@@ -84,6 +84,6 @@ export class SbbFormFieldClear extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-form-field-clear': SbbFormFieldClear;
+ 'sbb-form-field-clear': SbbFormFieldClearElement;
}
}
diff --git a/src/components/form-field/form-field/form-field.e2e.ts b/src/components/form-field/form-field/form-field.e2e.ts
index 78d8ab0912..e34196449d 100644
--- a/src/components/form-field/form-field/form-field.e2e.ts
+++ b/src/components/form-field/form-field/form-field.e2e.ts
@@ -3,14 +3,14 @@ import { sendKeys } from '@web/test-runner-commands';
import { html } from 'lit/static-html.js';
import { waitForCondition, waitForLitRender } from '../../core/testing';
-import { SbbOption } from '../../option';
-import { SbbSelect } from '../../select';
+import { SbbOptionElement } from '../../option';
+import { SbbSelectElement } from '../../select';
-import { SbbFormField } from './form-field';
+import { SbbFormFieldElement } from './form-field';
describe('sbb-form-field', () => {
describe('with input', () => {
- let element: SbbFormField;
+ let element: SbbFormFieldElement;
let input: HTMLInputElement;
beforeEach(async () => {
@@ -19,7 +19,7 @@ describe('sbb-form-field', () => {
});
it('renders', async () => {
- assert.instanceOf(element, SbbFormField);
+ assert.instanceOf(element, SbbFormFieldElement);
});
it('should remove the label element if no label is configured', async () => {
@@ -136,8 +136,8 @@ describe('sbb-form-field', () => {
});
describe('with sbb-select', () => {
- let element: SbbFormField;
- let select: SbbSelect;
+ let element: SbbFormFieldElement;
+ let select: SbbSelectElement;
beforeEach(async () => {
element = await fixture(html`
@@ -151,8 +151,8 @@ describe('sbb-form-field', () => {
it('renders', async () => {
const option = select.querySelector('sbb-option');
- assert.instanceOf(select, SbbSelect);
- assert.instanceOf(option, SbbOption);
+ assert.instanceOf(select, SbbSelectElement);
+ assert.instanceOf(option, SbbOptionElement);
});
it('should react to focus state', async () => {
@@ -227,7 +227,7 @@ describe('sbb-form-field', () => {
});
it('should never be empty if input type is date', async () => {
- const element: SbbFormField = await fixture(
+ const element: SbbFormFieldElement = await fixture(
html``,
);
@@ -235,7 +235,7 @@ describe('sbb-form-field', () => {
});
it('should read sbb-select empty state', async () => {
- const element: SbbFormField = await fixture(html`
+ const element: SbbFormFieldElement = await fixture(html`
@@ -261,7 +261,7 @@ describe('sbb-form-field', () => {
});
it('should update floating label after clearing', async () => {
- const element: SbbFormField = await fixture(
+ const element: SbbFormFieldElement = await fixture(
html`
Displayed Value
@@ -297,7 +297,7 @@ describe('sbb-form-field', () => {
});
it('should reset floating label when calling reset of sbb-form-field', async () => {
- const element: SbbFormField = await fixture(html`
+ const element: SbbFormFieldElement = await fixture(html`
diff --git a/src/components/form-field/form-field/form-field.stories.ts b/src/components/form-field/form-field/form-field.stories.ts
index 9f65a4740e..bfc6202d17 100644
--- a/src/components/form-field/form-field/form-field.stories.ts
+++ b/src/components/form-field/form-field/form-field.stories.ts
@@ -5,7 +5,7 @@ import { html, TemplateResult } from 'lit';
import { styleMap } from 'lit/directives/style-map.js';
import { sbbSpread } from '../../core/dom';
-import type { SbbFormError } from '../../form-error';
+import type { SbbFormErrorElement } from '../../form-error';
import readme from './readme.md?raw';
import './form-field';
@@ -117,7 +117,7 @@ const TemplateInputWithSlottedLabel = ({
`;
const TemplateInputWithErrorSpace = (args: Args): TemplateResult => {
- const sbbFormError: SbbFormError = document.createElement('sbb-form-error');
+ const sbbFormError: SbbFormErrorElement = document.createElement('sbb-form-error');
sbbFormError.setAttribute('slot', 'error');
sbbFormError.textContent = args.errorText;
@@ -214,7 +214,7 @@ const TemplateSelect = (args: Args): TemplateResult => html`
`;
const TemplateSelectWithErrorSpace = (args: Args): TemplateResult => {
- const sbbFormError: SbbFormError = document.createElement('sbb-form-error');
+ const sbbFormError: SbbFormErrorElement = document.createElement('sbb-form-error');
sbbFormError.setAttribute('slot', 'error');
sbbFormError.textContent = args.errorText;
diff --git a/src/components/form-field/form-field/form-field.ts b/src/components/form-field/form-field/form-field.ts
index 86946f5d9c..77b0e3fdd6 100644
--- a/src/components/form-field/form-field/form-field.ts
+++ b/src/components/form-field/form-field/form-field.ts
@@ -13,7 +13,7 @@ import {
} from '../../core/eventing';
import { i18nOptional } from '../../core/i18n';
import { AgnosticMutationObserver } from '../../core/observers';
-import type { SbbSelect } from '../../select';
+import type { SbbSelectElement } from '../../select';
import style from './form-field.scss?lit&inline';
import '../../icon';
@@ -33,7 +33,7 @@ const supportedPopupTagNames = ['SBB-AUTOCOMPLETE', 'SBB-SELECT'];
* @slot error - Use this slot to render an error.
*/
@customElement('sbb-form-field')
-export class SbbFormField extends LitElement {
+export class SbbFormFieldElement extends LitElement {
public static override styles: CSSResultGroup = style;
private readonly _supportedNativeInputElements = ['INPUT', 'SELECT'];
@@ -327,7 +327,7 @@ export class SbbFormField extends LitElement {
signal: this._inputAbortController.signal,
});
- inputFocusElement = (this._input as SbbSelect).inputElement;
+ inputFocusElement = (this._input as SbbSelectElement).inputElement;
}
inputFocusElement.addEventListener(
@@ -379,7 +379,7 @@ export class SbbFormField extends LitElement {
} else if (this._input instanceof HTMLSelectElement) {
return this._input.selectedOptions?.item(0)?.label?.trim() === '';
} else if (this._input.tagName === 'SBB-SELECT') {
- return (this._input as SbbSelect).getDisplayValue()?.trim() === '';
+ return (this._input as SbbSelectElement).getDisplayValue()?.trim() === '';
} else {
return this._isInputValueEmpty();
}
@@ -530,6 +530,6 @@ export class SbbFormField extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-form-field': SbbFormField;
+ 'sbb-form-field': SbbFormFieldElement;
}
}
diff --git a/src/components/header/header-action/header-action.e2e.ts b/src/components/header/header-action/header-action.e2e.ts
index ae92d6cb7c..60e14805a3 100644
--- a/src/components/header/header-action/header-action.e2e.ts
+++ b/src/components/header/header-action/header-action.e2e.ts
@@ -4,17 +4,17 @@ import { html } from 'lit/static-html.js';
import { EventSpy, waitForCondition, waitForLitRender } from '../../core/testing';
-import { SbbHeaderAction } from './header-action';
+import { SbbHeaderActionElement } from './header-action';
describe('sbb-header-action', () => {
- let element: SbbHeaderAction;
+ let element: SbbHeaderActionElement;
beforeEach(async () => {
element = await fixture(html`Action`);
});
it('renders', async () => {
- assert.instanceOf(element, SbbHeaderAction);
+ assert.instanceOf(element, SbbHeaderActionElement);
});
describe('events', () => {
diff --git a/src/components/header/header-action/header-action.ts b/src/components/header/header-action/header-action.ts
index 831ee3576a..19404b8991 100644
--- a/src/components/header/header-action/header-action.ts
+++ b/src/components/header/header-action/header-action.ts
@@ -32,7 +32,7 @@ import '../../icon';
* @slot - Use the unnamed slot to add content to the `sbb-header-action`.
*/
@customElement('sbb-header-action')
-export class SbbHeaderAction extends LitElement implements LinkButtonProperties {
+export class SbbHeaderActionElement extends LitElement implements LinkButtonProperties {
public static override styles: CSSResultGroup = style;
/**
@@ -143,6 +143,6 @@ export class SbbHeaderAction extends LitElement implements LinkButtonProperties
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-header-action': SbbHeaderAction;
+ 'sbb-header-action': SbbHeaderActionElement;
}
}
diff --git a/src/components/header/header/header.e2e.ts b/src/components/header/header/header.e2e.ts
index 49bc028a17..a66c4499f7 100644
--- a/src/components/header/header/header.e2e.ts
+++ b/src/components/header/header/header.e2e.ts
@@ -3,13 +3,13 @@ import { setViewport } from '@web/test-runner-commands';
import { html } from 'lit/static-html.js';
import { EventSpy, waitForLitRender, mockScrollTo, waitForCondition } from '../../core/testing';
-import { SbbMenu } from '../../menu';
+import { SbbMenuElement } from '../../menu';
-import { SbbHeader } from './header';
+import { SbbHeaderElement } from './header';
import '../header-action';
describe('sbb-header', () => {
- let element: SbbHeader;
+ let element: SbbHeaderElement;
beforeEach(async () => {
await setViewport({ width: 1200, height: 600 });
@@ -17,7 +17,7 @@ describe('sbb-header', () => {
it('renders', async () => {
element = await fixture(html``);
- assert.instanceOf(element, SbbHeader);
+ assert.instanceOf(element, SbbHeaderElement);
});
it('should be fixed on scroll', async () => {
@@ -92,8 +92,8 @@ describe('sbb-header', () => {
expect(element).to.have.attribute('data-visible');
// Open menu
- const willOpenEventSpy = new EventSpy(SbbMenu.events.willOpen);
- const didOpenEventSpy = new EventSpy(SbbMenu.events.didOpen);
+ const willOpenEventSpy = new EventSpy(SbbMenuElement.events.willOpen);
+ const didOpenEventSpy = new EventSpy(SbbMenuElement.events.didOpen);
const menuTrigger = document.querySelector('sbb-header-action');
menuTrigger.click();
await waitForLitRender(element);
diff --git a/src/components/header/header/header.ts b/src/components/header/header/header.ts
index 47a0dd4ac5..5aee425da9 100644
--- a/src/components/header/header/header.ts
+++ b/src/components/header/header/header.ts
@@ -15,7 +15,7 @@ const IS_MENU_OPENED_QUERY = "[aria-controls][aria-expanded='true']";
* @slot logo - Slot used to render the logo on the right side (sbb-logo as default).
*/
@customElement('sbb-header')
-export class SbbHeader extends LitElement {
+export class SbbHeaderElement extends LitElement {
public static override styles: CSSResultGroup = style;
/**
@@ -189,6 +189,6 @@ export class SbbHeader extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-header': SbbHeader;
+ 'sbb-header': SbbHeaderElement;
}
}
diff --git a/src/components/icon/icon.e2e.ts b/src/components/icon/icon.e2e.ts
index 9b8e26d947..ea874ef3a3 100644
--- a/src/components/icon/icon.e2e.ts
+++ b/src/components/icon/icon.e2e.ts
@@ -1,14 +1,14 @@
import { assert, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbIcon } from './icon';
+import { SbbIconElement } from './icon';
describe('sbb-icon', () => {
- let element: SbbIcon;
+ let element: SbbIconElement;
it('renders', async () => {
element = await fixture(html``);
- assert.instanceOf(element, SbbIcon);
+ assert.instanceOf(element, SbbIconElement);
});
});
diff --git a/src/components/icon/icon.spec.ts b/src/components/icon/icon.spec.ts
index 8db6912ac4..4e9624a6d6 100644
--- a/src/components/icon/icon.spec.ts
+++ b/src/components/icon/icon.spec.ts
@@ -4,7 +4,7 @@ import { html } from 'lit/static-html.js';
import { SbbIconConfig, readConfig } from '../core/config';
import { waitForLitRender } from '../core/testing';
-import type { SbbIcon } from './icon';
+import type { SbbIconElement } from './icon';
import './icon';
@@ -20,7 +20,7 @@ describe('sbb-icon', () => {
});
it('renders aria-hidden and no aria-label', async () => {
- const root: SbbIcon = await fixture(html``);
+ const root: SbbIconElement = await fixture(html``);
expect(root).dom.to.be.equal(`
@@ -58,7 +58,7 @@ describe('sbb-icon', () => {
});
it('renders default label after changing source', async () => {
- const icon: SbbIcon = await fixture(
+ const icon: SbbIconElement = await fixture(
html``,
);
diff --git a/src/components/icon/icon.ts b/src/components/icon/icon.ts
index 964ff888f5..f791abf755 100644
--- a/src/components/icon/icon.ts
+++ b/src/components/icon/icon.ts
@@ -7,7 +7,7 @@ import { SbbIconBase } from './icon-base';
* It displays an icon loaded from a registered namespace.
*/
@customElement('sbb-icon')
-export class SbbIcon extends SbbIconBase {
+export class SbbIconElement extends SbbIconBase {
/**
* The provided name consisting of the namespace and the name of the icon.
* If the namespace is missing, the default namespace "sbb" will be used.
@@ -51,6 +51,6 @@ export class SbbIcon extends SbbIconBase {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-icon': SbbIcon;
+ 'sbb-icon': SbbIconElement;
}
}
diff --git a/src/components/image/image.e2e.ts b/src/components/image/image.e2e.ts
index 0767e5171f..47051a226e 100644
--- a/src/components/image/image.e2e.ts
+++ b/src/components/image/image.e2e.ts
@@ -4,17 +4,17 @@ import { html } from 'lit/static-html.js';
import images from '../core/images';
import { waitForCondition, waitForLitRender } from '../core/testing';
-import { SbbImage } from './image';
+import { SbbImageElement } from './image';
describe('sbb-image', () => {
- let element: SbbImage;
+ let element: SbbImageElement;
it('renders', async function () {
this.timeout(8000);
const url = images[0];
element = await fixture(html``);
- assert.instanceOf(element, SbbImage);
+ assert.instanceOf(element, SbbImageElement);
await waitForLitRender(element);
// Wait until the image is successfully be loaded
diff --git a/src/components/image/image.ts b/src/components/image/image.ts
index 805b4e070b..007592ceba 100644
--- a/src/components/image/image.ts
+++ b/src/components/image/image.ts
@@ -59,7 +59,7 @@ const breakpointMap: Record = {
* It displays an image.
*/
@customElement('sbb-image')
-export class SbbImage extends LitElement {
+export class SbbImageElement extends LitElement {
public static override styles: CSSResultGroup = style;
private _captionElement?: HTMLElement;
@@ -549,6 +549,6 @@ export class SbbImage extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-image': SbbImage;
+ 'sbb-image': SbbImageElement;
}
}
diff --git a/src/components/journey-header/journey-header.e2e.ts b/src/components/journey-header/journey-header.e2e.ts
index 4982f12993..55c1515e94 100644
--- a/src/components/journey-header/journey-header.e2e.ts
+++ b/src/components/journey-header/journey-header.e2e.ts
@@ -1,16 +1,16 @@
import { assert, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbJourneyHeader } from './journey-header';
+import { SbbJourneyHeaderElement } from './journey-header';
describe('sbb-journey-header', () => {
- let element: SbbJourneyHeader;
+ let element: SbbJourneyHeaderElement;
beforeEach(async () => {
element = await fixture(html``);
});
it('renders', async () => {
- assert.instanceOf(element, SbbJourneyHeader);
+ assert.instanceOf(element, SbbJourneyHeaderElement);
});
});
diff --git a/src/components/journey-header/journey-header.ts b/src/components/journey-header/journey-header.ts
index 1684569a75..3b118a8ba5 100644
--- a/src/components/journey-header/journey-header.ts
+++ b/src/components/journey-header/journey-header.ts
@@ -17,7 +17,7 @@ export type JourneyHeaderSize = 'm' | 'l';
* Combined with the `sbb-journey-summary`, it displays the journey's detail.
*/
@customElement('sbb-journey-header')
-export class SbbJourneyHeader extends LitElement {
+export class SbbJourneyHeaderElement extends LitElement {
public static override styles: CSSResultGroup = style;
/** Origin location for the journey header. */
@@ -92,6 +92,6 @@ export class SbbJourneyHeader extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-journey-header': SbbJourneyHeader;
+ 'sbb-journey-header': SbbJourneyHeaderElement;
}
}
diff --git a/src/components/journey-summary/journey-summary.e2e.ts b/src/components/journey-summary/journey-summary.e2e.ts
index ad0a90bf34..6b6fac62c5 100644
--- a/src/components/journey-summary/journey-summary.e2e.ts
+++ b/src/components/journey-summary/journey-summary.e2e.ts
@@ -1,11 +1,11 @@
import { assert, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbJourneySummary } from './journey-summary';
+import { SbbJourneySummaryElement } from './journey-summary';
describe('sbb-journey-summary', () => {
it('renders', async () => {
const element = await fixture(html``);
- assert.instanceOf(element, SbbJourneySummary);
+ assert.instanceOf(element, SbbJourneySummaryElement);
});
});
diff --git a/src/components/journey-summary/journey-summary.spec.ts b/src/components/journey-summary/journey-summary.spec.ts
index 7cf272d02a..b7fdf73d86 100644
--- a/src/components/journey-summary/journey-summary.spec.ts
+++ b/src/components/journey-summary/journey-summary.spec.ts
@@ -3,7 +3,10 @@ import { html } from 'lit/static-html.js';
import { waitForLitRender } from '../core/testing';
-import type { SbbJourneySummary, InterfaceSbbJourneySummaryAttributes } from './journey-summary';
+import type {
+ SbbJourneySummaryElement,
+ InterfaceSbbJourneySummaryAttributes,
+} from './journey-summary';
import './journey-summary';
@@ -37,7 +40,7 @@ describe('sbb-journey-summary', () => {
it('renders', async () => {
const root = (await fixture(
html` `,
- )) as SbbJourneySummary;
+ )) as SbbJourneySummaryElement;
root.trip = data;
await waitForLitRender(root);
@@ -81,7 +84,7 @@ describe('sbb-journey-summary', () => {
it('renders without vias', async () => {
const root = (await fixture(
html` `,
- )) as SbbJourneySummary;
+ )) as SbbJourneySummaryElement;
root.trip = dataWithoutVia;
await waitForLitRender(root);
@@ -115,7 +118,7 @@ describe('sbb-journey-summary', () => {
it('renders with second journey', async () => {
const root = (await fixture(
html` `,
- )) as SbbJourneySummary;
+ )) as SbbJourneySummaryElement;
root.trip = dataWithoutVia;
root.tripBack = data;
root.roundTrip = true;
diff --git a/src/components/journey-summary/journey-summary.ts b/src/components/journey-summary/journey-summary.ts
index 553f7d3eab..319c38705e 100644
--- a/src/components/journey-summary/journey-summary.ts
+++ b/src/components/journey-summary/journey-summary.ts
@@ -35,7 +35,7 @@ export interface InterfaceSbbJourneySummaryAttributes {
* @slot content - Use this slot to add `sbb-button`s or other interactive elements.
*/
@customElement('sbb-journey-summary')
-export class SbbJourneySummary extends LitElement {
+export class SbbJourneySummaryElement extends LitElement {
public static override styles: CSSResultGroup = style;
/** The trip prop */
@@ -178,6 +178,6 @@ export class SbbJourneySummary extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-journey-summary': SbbJourneySummary;
+ 'sbb-journey-summary': SbbJourneySummaryElement;
}
}
diff --git a/src/components/link-list/link-list.e2e.ts b/src/components/link-list/link-list.e2e.ts
index faa2b78a10..3ec89e6e8d 100644
--- a/src/components/link-list/link-list.e2e.ts
+++ b/src/components/link-list/link-list.e2e.ts
@@ -3,11 +3,11 @@ import { html } from 'lit/static-html.js';
import { waitForLitRender } from '../core/testing';
-import { SbbLinkList } from './link-list';
+import { SbbLinkListElement } from './link-list';
import '../link';
describe('sbb-link-list', () => {
- let element: SbbLinkList;
+ let element: SbbLinkListElement;
beforeEach(async () => {
element = await fixture(html`
@@ -38,7 +38,7 @@ describe('sbb-link-list', () => {
});
it('renders', async () => {
- assert.instanceOf(element, SbbLinkList);
+ assert.instanceOf(element, SbbLinkListElement);
});
describe('property sync', () => {
diff --git a/src/components/link-list/link-list.spec.ts b/src/components/link-list/link-list.spec.ts
index 0390ef40d3..6a47aaab5a 100644
--- a/src/components/link-list/link-list.spec.ts
+++ b/src/components/link-list/link-list.spec.ts
@@ -1,15 +1,15 @@
import { expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import type { SbbLink } from '../link';
+import type { SbbLinkElement } from '../link';
-import type { SbbLinkList } from './link-list';
+import type { SbbLinkListElement } from './link-list';
import '../link';
import './link-list';
describe('sbb-link-list', () => {
- let element: SbbLinkList;
+ let element: SbbLinkListElement;
const sbbLinkSnippet = html`
{
});
describe('property sync', () => {
- const assertLinks = (root: Element, assertion: (link: SbbLink) => boolean): boolean =>
+ const assertLinks = (root: Element, assertion: (link: SbbLinkElement) => boolean): boolean =>
Array.from(root.querySelectorAll('sbb-link')).every(assertion);
it('should render all sbb-link instances with defaults (variant="block", size="s", no negative)', async () => {
diff --git a/src/components/link-list/link-list.ts b/src/components/link-list/link-list.ts
index c217177e28..941e4fbede 100644
--- a/src/components/link-list/link-list.ts
+++ b/src/components/link-list/link-list.ts
@@ -9,7 +9,7 @@ import {
namedSlotChangeHandlerAspect,
} from '../core/eventing';
import { SbbHorizontalFrom, SbbOrientation } from '../core/interfaces';
-import type { SbbLink, SbbLinkSize } from '../link';
+import type { SbbLinkElement, SbbLinkSize } from '../link';
import type { TitleLevel } from '../title';
import style from './link-list.scss?lit&inline';
@@ -23,7 +23,7 @@ import '../title';
* @slot title - Use this slot to provide a title.
*/
@customElement('sbb-link-list')
-export class SbbLinkList extends SlotChildObserver(LitElement) {
+export class SbbLinkListElement extends SlotChildObserver(LitElement) {
public static override styles: CSSResultGroup = style;
/** The title text we want to show before the list. */
@@ -52,7 +52,7 @@ export class SbbLinkList extends SlotChildObserver(LitElement) {
@property({ reflect: true }) public orientation: SbbOrientation = 'vertical';
/** Sbb-Link elements */
- @state() private _links: SbbLink[] = [];
+ @state() private _links: SbbLinkElement[] = [];
/** State of listed named slots, by indicating whether any element for a named slot is defined. */
@state() private _namedSlots = createNamedSlotState('title');
@@ -72,7 +72,9 @@ export class SbbLinkList extends SlotChildObserver(LitElement) {
/** Create an array with only the sbb-link children. */
protected override checkChildren(): void {
- const links = Array.from(this.children).filter((e): e is SbbLink => e.tagName === 'SBB-LINK');
+ const links = Array.from(this.children).filter(
+ (e): e is SbbLinkElement => e.tagName === 'SBB-LINK',
+ );
// If the slotted sbb-link instances have not changed, we can skip syncing and updating
// the link reference list.
if (
@@ -145,6 +147,6 @@ export class SbbLinkList extends SlotChildObserver(LitElement) {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-link-list': SbbLinkList;
+ 'sbb-link-list': SbbLinkListElement;
}
}
diff --git a/src/components/link/link.e2e.ts b/src/components/link/link.e2e.ts
index 6cbc0496aa..0ff84f0e50 100644
--- a/src/components/link/link.e2e.ts
+++ b/src/components/link/link.e2e.ts
@@ -4,17 +4,17 @@ import { html } from 'lit/static-html.js';
import { EventSpy, waitForCondition, waitForLitRender } from '../core/testing';
-import { SbbLink } from './link';
+import { SbbLinkElement } from './link';
describe('sbb-link', () => {
- let element: SbbLink;
+ let element: SbbLinkElement;
beforeEach(async () => {
element = await fixture(html`Link as Button`);
});
it('renders', async () => {
- assert.instanceOf(element, SbbLink);
+ assert.instanceOf(element, SbbLinkElement);
});
describe('events', () => {
diff --git a/src/components/link/link.ts b/src/components/link/link.ts
index c9ebf0a3d3..265783bf19 100644
--- a/src/components/link/link.ts
+++ b/src/components/link/link.ts
@@ -37,7 +37,7 @@ export type SbbLinkSize = 'xs' | 's' | 'm';
* @slot icon - Slot used to display the icon, if one is set.
*/
@customElement('sbb-link')
-export class SbbLink extends LitElement implements LinkButtonProperties, IsStaticProperty {
+export class SbbLinkElement extends LitElement implements LinkButtonProperties, IsStaticProperty {
public static override styles: CSSResultGroup = style;
/** Variant of the link (block or inline). */
@@ -161,6 +161,6 @@ export class SbbLink extends LitElement implements LinkButtonProperties, IsStati
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-link': SbbLink;
+ 'sbb-link': SbbLinkElement;
}
}
diff --git a/src/components/loading-indicator/loading-indicator.e2e.ts b/src/components/loading-indicator/loading-indicator.e2e.ts
index e9fb3a3d16..fa27cb38b1 100644
--- a/src/components/loading-indicator/loading-indicator.e2e.ts
+++ b/src/components/loading-indicator/loading-indicator.e2e.ts
@@ -1,13 +1,13 @@
import { assert, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbLoadingIndicator } from './loading-indicator';
+import { SbbLoadingIndicatorElement } from './loading-indicator';
describe('sbb-loading-indicator', () => {
- let element: SbbLoadingIndicator;
+ let element: SbbLoadingIndicatorElement;
it('renders', async () => {
element = await fixture(html``);
- assert.instanceOf(element, SbbLoadingIndicator);
+ assert.instanceOf(element, SbbLoadingIndicatorElement);
});
});
diff --git a/src/components/loading-indicator/loading-indicator.stories.ts b/src/components/loading-indicator/loading-indicator.stories.ts
index 0ae108b802..62c013d790 100644
--- a/src/components/loading-indicator/loading-indicator.stories.ts
+++ b/src/components/loading-indicator/loading-indicator.stories.ts
@@ -7,7 +7,7 @@ import { styleMap } from 'lit/directives/style-map.js';
import { sbbSpread } from '../core/dom';
-import type { SbbLoadingIndicator } from './loading-indicator';
+import type { SbbLoadingIndicatorElement } from './loading-indicator';
import readme from './readme.md?raw';
import '../button';
import './loading-indicator';
@@ -27,7 +27,7 @@ const negativeBlockStyle: Args = {
};
const createLoadingIndicator = (args): void => {
- const loader: SbbLoadingIndicator = document.createElement('sbb-loading-indicator');
+ const loader: SbbLoadingIndicatorElement = document.createElement('sbb-loading-indicator');
loader.setAttribute('aria-label', 'Loading, please wait');
loader.size = args['size'];
loader.variant = args['variant'];
diff --git a/src/components/loading-indicator/loading-indicator.ts b/src/components/loading-indicator/loading-indicator.ts
index 10436c0697..143487cd74 100644
--- a/src/components/loading-indicator/loading-indicator.ts
+++ b/src/components/loading-indicator/loading-indicator.ts
@@ -9,7 +9,7 @@ import style from './loading-indicator.scss?lit&inline';
* It displays a loading indicator.
*/
@customElement('sbb-loading-indicator')
-export class SbbLoadingIndicator extends LitElement {
+export class SbbLoadingIndicatorElement extends LitElement {
public static override styles: CSSResultGroup = style;
/** Variant of the loading indicator; `circle` is meant to be used inline, while `window` as overlay. */
@@ -52,6 +52,6 @@ export class SbbLoadingIndicator extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-loading-indicator': SbbLoadingIndicator;
+ 'sbb-loading-indicator': SbbLoadingIndicatorElement;
}
}
diff --git a/src/components/logo/logo.ts b/src/components/logo/logo.ts
index 53c512c36e..49a4f7b20e 100644
--- a/src/components/logo/logo.ts
+++ b/src/components/logo/logo.ts
@@ -9,7 +9,7 @@ import style from './logo.scss?lit&inline';
* It displays the SBB logo.
*/
@customElement('sbb-logo')
-export class SbbLogo extends LitElement {
+export class SbbLogoElement extends LitElement {
public static override styles: CSSResultGroup = style;
/** Variants of the logo. */
@@ -47,6 +47,6 @@ export class SbbLogo extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-logo': SbbLogo;
+ 'sbb-logo': SbbLogoElement;
}
}
diff --git a/src/components/map-container/map-container.e2e.ts b/src/components/map-container/map-container.e2e.ts
index bab4f0602a..826d3c559a 100644
--- a/src/components/map-container/map-container.e2e.ts
+++ b/src/components/map-container/map-container.e2e.ts
@@ -4,11 +4,11 @@ import { html } from 'lit/static-html.js';
import { waitForCondition } from '../core/testing';
-import { SbbMapContainer } from './map-container';
+import { SbbMapContainerElement } from './map-container';
import '.';
describe('sbb-map-container', () => {
- let element: SbbMapContainer;
+ let element: SbbMapContainerElement;
it('should react to scrolling', async () => {
await setViewport({ width: 320, height: 600 });
@@ -30,7 +30,7 @@ describe('sbb-map-container', () => {
`,
);
element = document.querySelector('sbb-map-container');
- assert.instanceOf(element, SbbMapContainer);
+ assert.instanceOf(element, SbbMapContainerElement);
function getInert(): boolean {
return element.shadowRoot.querySelector('sbb-button').hasAttribute('inert');
diff --git a/src/components/map-container/map-container.spec.ts b/src/components/map-container/map-container.spec.ts
index a6cf44f664..6b84d34a73 100644
--- a/src/components/map-container/map-container.spec.ts
+++ b/src/components/map-container/map-container.spec.ts
@@ -1,11 +1,11 @@
import { expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbMapContainer } from './map-container';
+import { SbbMapContainerElement } from './map-container';
import '.';
describe('sbb-map-container', () => {
- let element: SbbMapContainer;
+ let element: SbbMapContainerElement;
it('renders the container with button', async () => {
element = await fixture(html``);
diff --git a/src/components/map-container/map-container.ts b/src/components/map-container/map-container.ts
index d66a9b1cde..f11f703dab 100644
--- a/src/components/map-container/map-container.ts
+++ b/src/components/map-container/map-container.ts
@@ -17,7 +17,7 @@ import '../button';
* @slot map - Used for slotting the map.
*/
@customElement('sbb-map-container')
-export class SbbMapContainer extends LitElement {
+export class SbbMapContainerElement extends LitElement {
public static override styles: CSSResultGroup = style;
/** Flag to show/hide the scroll up button inside the sidebar on mobile. */
@@ -125,6 +125,6 @@ export class SbbMapContainer extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-map-container': SbbMapContainer;
+ 'sbb-map-container': SbbMapContainerElement;
}
}
diff --git a/src/components/menu/menu-action/menu-action.e2e.ts b/src/components/menu/menu-action/menu-action.e2e.ts
index 76d87ed35f..da1c0d04e1 100644
--- a/src/components/menu/menu-action/menu-action.e2e.ts
+++ b/src/components/menu/menu-action/menu-action.e2e.ts
@@ -4,10 +4,10 @@ import { html } from 'lit/static-html.js';
import { EventSpy, waitForCondition, waitForLitRender } from '../../core/testing';
-import { SbbMenuAction } from './menu-action';
+import { SbbMenuActionElement } from './menu-action';
describe('sbb-menu-action', () => {
- let element: SbbMenuAction;
+ let element: SbbMenuActionElement;
beforeEach(async () => {
element = await fixture(html`Menu Action`);
@@ -80,7 +80,7 @@ describe('sbb-menu-action', () => {
it('renders as a button and triggers click event', async () => {
element = await fixture(html``);
- assert.instanceOf(element, SbbMenuAction);
+ assert.instanceOf(element, SbbMenuActionElement);
const clickedSpy = new EventSpy('click');
element.click();
diff --git a/src/components/menu/menu-action/menu-action.ts b/src/components/menu/menu-action/menu-action.ts
index c21f1cf931..4c523a5369 100644
--- a/src/components/menu/menu-action/menu-action.ts
+++ b/src/components/menu/menu-action/menu-action.ts
@@ -30,7 +30,7 @@ import '../../icon';
* @slot icon - Use this slot to provide an icon. If `icon-name` is set, a `sbb-icon` will be used.
*/
@customElement('sbb-menu-action')
-export class SbbMenuAction extends LitElement implements LinkButtonProperties {
+export class SbbMenuActionElement extends LitElement implements LinkButtonProperties {
public static override styles: CSSResultGroup = style;
/**
@@ -131,6 +131,6 @@ export class SbbMenuAction extends LitElement implements LinkButtonProperties {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-menu-action': SbbMenuAction;
+ 'sbb-menu-action': SbbMenuActionElement;
}
}
diff --git a/src/components/menu/menu/menu.e2e.ts b/src/components/menu/menu/menu.e2e.ts
index 8d3ea9b820..4c28a3be2f 100644
--- a/src/components/menu/menu/menu.e2e.ts
+++ b/src/components/menu/menu/menu.e2e.ts
@@ -4,14 +4,14 @@ import { html } from 'lit/static-html.js';
import { EventSpy, waitForCondition, waitForLitRender } from '../../core/testing';
-import { SbbMenu } from './menu';
+import { SbbMenuElement } from './menu';
import '../../button';
import '../menu-action';
import '../../link';
import '../../divider';
describe('sbb-menu', () => {
- let element: SbbMenu, trigger: HTMLElement;
+ let element: SbbMenuElement, trigger: HTMLElement;
beforeEach(async () => {
await fixture(html`
@@ -34,12 +34,12 @@ describe('sbb-menu', () => {
});
it('renders', () => {
- assert.instanceOf(element, SbbMenu);
+ assert.instanceOf(element, SbbMenuElement);
});
it('opens on trigger click', async () => {
- const willOpenEventSpy = new EventSpy(SbbMenu.events.willOpen);
- const didOpenEventSpy = new EventSpy(SbbMenu.events.didOpen);
+ const willOpenEventSpy = new EventSpy(SbbMenuElement.events.willOpen);
+ const didOpenEventSpy = new EventSpy(SbbMenuElement.events.didOpen);
trigger.click();
await waitForLitRender(element);
@@ -55,10 +55,10 @@ describe('sbb-menu', () => {
});
it('closes on Esc keypress', async () => {
- const willOpenEventSpy = new EventSpy(SbbMenu.events.willOpen);
- const didOpenEventSpy = new EventSpy(SbbMenu.events.didOpen);
- const willCloseEventSpy = new EventSpy(SbbMenu.events.willClose);
- const didCloseEventSpy = new EventSpy(SbbMenu.events.didClose);
+ const willOpenEventSpy = new EventSpy(SbbMenuElement.events.willOpen);
+ const didOpenEventSpy = new EventSpy(SbbMenuElement.events.didOpen);
+ const willCloseEventSpy = new EventSpy(SbbMenuElement.events.willClose);
+ const didCloseEventSpy = new EventSpy(SbbMenuElement.events.didClose);
trigger.click();
await waitForLitRender(element);
@@ -91,10 +91,10 @@ describe('sbb-menu', () => {
});
it('closes on menu action click', async () => {
- const willOpenEventSpy = new EventSpy(SbbMenu.events.willOpen);
- const didOpenEventSpy = new EventSpy(SbbMenu.events.didOpen);
- const willCloseEventSpy = new EventSpy(SbbMenu.events.willClose);
- const didCloseEventSpy = new EventSpy(SbbMenu.events.didClose);
+ const willOpenEventSpy = new EventSpy(SbbMenuElement.events.willOpen);
+ const didOpenEventSpy = new EventSpy(SbbMenuElement.events.didOpen);
+ const willCloseEventSpy = new EventSpy(SbbMenuElement.events.willClose);
+ const didCloseEventSpy = new EventSpy(SbbMenuElement.events.didClose);
const menuAction = document.querySelector('sbb-menu > sbb-menu-action') as HTMLElement;
trigger.click();
@@ -125,10 +125,10 @@ describe('sbb-menu', () => {
});
it('closes on interactive element click', async () => {
- const willOpenEventSpy = new EventSpy(SbbMenu.events.willOpen);
- const didOpenEventSpy = new EventSpy(SbbMenu.events.didOpen);
- const willCloseEventSpy = new EventSpy(SbbMenu.events.willClose);
- const didCloseEventSpy = new EventSpy(SbbMenu.events.didClose);
+ const willOpenEventSpy = new EventSpy(SbbMenuElement.events.willOpen);
+ const didOpenEventSpy = new EventSpy(SbbMenuElement.events.didOpen);
+ const willCloseEventSpy = new EventSpy(SbbMenuElement.events.willClose);
+ const didCloseEventSpy = new EventSpy(SbbMenuElement.events.didClose);
const menuLink = document.querySelector('sbb-menu > sbb-link') as HTMLElement;
trigger.click();
@@ -160,8 +160,8 @@ describe('sbb-menu', () => {
});
it('is correctly positioned on desktop', async () => {
- const willOpenEventSpy = new EventSpy(SbbMenu.events.willOpen);
- const didOpenEventSpy = new EventSpy(SbbMenu.events.didOpen);
+ const willOpenEventSpy = new EventSpy(SbbMenuElement.events.willOpen);
+ const didOpenEventSpy = new EventSpy(SbbMenuElement.events.didOpen);
await setViewport({ width: 1200, height: 800 });
const menu: HTMLElement = element.shadowRoot.querySelector('.sbb-menu');
@@ -194,8 +194,8 @@ describe('sbb-menu', () => {
});
it('is correctly positioned on mobile', async () => {
- const willOpenEventSpy = new EventSpy(SbbMenu.events.willOpen);
- const didOpenEventSpy = new EventSpy(SbbMenu.events.didOpen);
+ const willOpenEventSpy = new EventSpy(SbbMenuElement.events.willOpen);
+ const didOpenEventSpy = new EventSpy(SbbMenuElement.events.didOpen);
await setViewport({ width: 800, height: 600 });
const menu: HTMLElement = element.shadowRoot.querySelector('.sbb-menu');
@@ -221,8 +221,8 @@ describe('sbb-menu', () => {
});
it('sets the focus to the first focusable element when the menu is opened by keyboard', async () => {
- const willOpenEventSpy = new EventSpy(SbbMenu.events.willOpen);
- const didOpenEventSpy = new EventSpy(SbbMenu.events.didOpen);
+ const willOpenEventSpy = new EventSpy(SbbMenuElement.events.willOpen);
+ const didOpenEventSpy = new EventSpy(SbbMenuElement.events.didOpen);
await sendKeys({ down: 'Tab' });
await waitForLitRender(element);
diff --git a/src/components/menu/menu/menu.stories.ts b/src/components/menu/menu/menu.stories.ts
index 6c5f994359..4f71a9f81a 100644
--- a/src/components/menu/menu/menu.stories.ts
+++ b/src/components/menu/menu/menu.stories.ts
@@ -9,7 +9,7 @@ import { styleMap } from 'lit/directives/style-map.js';
import { waitForComponentsReady } from '../../../storybook/testing/wait-for-components-ready';
import { waitForStablePosition } from '../../../storybook/testing/wait-for-stable-position';
-import { SbbMenu } from './menu';
+import { SbbMenuElement } from './menu';
import readme from './readme.md?raw';
import '../../button';
@@ -267,10 +267,10 @@ const meta: Meta = {
chromatic: { disableSnapshot: false },
actions: {
handles: [
- SbbMenu.events.willOpen,
- SbbMenu.events.didOpen,
- SbbMenu.events.didClose,
- SbbMenu.events.willClose,
+ SbbMenuElement.events.willOpen,
+ SbbMenuElement.events.didOpen,
+ SbbMenuElement.events.didClose,
+ SbbMenuElement.events.willClose,
],
},
backgrounds: {
diff --git a/src/components/menu/menu/menu.ts b/src/components/menu/menu/menu.ts
index 6c3e60018f..c42c6e7d15 100644
--- a/src/components/menu/menu/menu.ts
+++ b/src/components/menu/menu/menu.ts
@@ -29,7 +29,7 @@ import {
SbbOverlayState,
setAriaOverlayTriggerAttributes,
} from '../../core/overlay';
-import type { SbbMenuAction } from '../menu-action';
+import type { SbbMenuActionElement } from '../menu-action';
import style from './menu.scss?lit&inline';
@@ -48,7 +48,7 @@ let nextId = 0;
* @event {CustomEvent} didClose - Emits whenever the `sbb-menu` is closed.
*/
@customElement('sbb-menu')
-export class SbbMenu extends SlotChildObserver(LitElement) {
+export class SbbMenuElement extends SlotChildObserver(LitElement) {
public static override styles: CSSResultGroup = style;
public static readonly events = {
willOpen: 'willOpen',
@@ -90,28 +90,28 @@ export class SbbMenu extends SlotChildObserver(LitElement) {
@state() private _state: SbbOverlayState = 'closed';
/** Sbb-Link elements */
- @state() private _actions: SbbMenuAction[];
+ @state() private _actions: SbbMenuActionElement[];
/** Emits whenever the `sbb-menu` starts the opening transition. */
- private _willOpen: EventEmitter = new EventEmitter(this, SbbMenu.events.willOpen, {
+ private _willOpen: EventEmitter = new EventEmitter(this, SbbMenuElement.events.willOpen, {
bubbles: true,
composed: true,
});
/** Emits whenever the `sbb-menu` is opened. */
- private _didOpen: EventEmitter = new EventEmitter(this, SbbMenu.events.didOpen, {
+ private _didOpen: EventEmitter = new EventEmitter(this, SbbMenuElement.events.didOpen, {
bubbles: true,
composed: true,
});
/** Emits whenever the `sbb-menu` begins the closing transition. */
- private _willClose: EventEmitter = new EventEmitter(this, SbbMenu.events.willClose, {
+ private _willClose: EventEmitter = new EventEmitter(this, SbbMenuElement.events.willClose, {
bubbles: true,
composed: true,
});
/** Emits whenever the `sbb-menu` is closed. */
- private _didClose: EventEmitter = new EventEmitter(this, SbbMenu.events.didClose, {
+ private _didClose: EventEmitter = new EventEmitter(this, SbbMenuElement.events.didClose, {
bubbles: true,
composed: true,
});
@@ -374,7 +374,7 @@ export class SbbMenu extends SlotChildObserver(LitElement) {
}
if (actions.every((e) => e.tagName === 'SBB-MENU-ACTION')) {
- this._actions = actions as SbbMenuAction[];
+ this._actions = actions as SbbMenuActionElement[];
} else {
this._actions?.forEach((a) => a.removeAttribute('slot'));
this._actions = undefined;
@@ -424,6 +424,6 @@ export class SbbMenu extends SlotChildObserver(LitElement) {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-menu': SbbMenu;
+ 'sbb-menu': SbbMenuElement;
}
}
diff --git a/src/components/message/message.e2e.ts b/src/components/message/message.e2e.ts
index cfce5c7957..29194b0dc7 100644
--- a/src/components/message/message.e2e.ts
+++ b/src/components/message/message.e2e.ts
@@ -1,13 +1,13 @@
import { assert, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbMessage } from './message';
+import { SbbMessageElement } from './message';
describe('sbb-message', () => {
- let element: SbbMessage;
+ let element: SbbMessageElement;
it('renders', async () => {
element = await fixture(html``);
- assert.instanceOf(element, SbbMessage);
+ assert.instanceOf(element, SbbMessageElement);
});
});
diff --git a/src/components/message/message.ts b/src/components/message/message.ts
index 5b0de389f8..94748b5afd 100644
--- a/src/components/message/message.ts
+++ b/src/components/message/message.ts
@@ -16,7 +16,7 @@ import style from './message.scss?lit&inline';
* @slot action - Use this slot to provide a sbb-button.
*/
@customElement('sbb-message')
-export class SbbMessage extends LitElement {
+export class SbbMessageElement extends LitElement {
public static override styles: CSSResultGroup = style;
/** Content of title. */
@@ -43,6 +43,6 @@ export class SbbMessage extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-message': SbbMessage;
+ 'sbb-message': SbbMessageElement;
}
}
diff --git a/src/components/navigation/navigation-action/navigation-action.e2e.ts b/src/components/navigation/navigation-action/navigation-action.e2e.ts
index a2df855e65..a67264eb28 100644
--- a/src/components/navigation/navigation-action/navigation-action.e2e.ts
+++ b/src/components/navigation/navigation-action/navigation-action.e2e.ts
@@ -4,11 +4,11 @@ import { html } from 'lit/static-html.js';
import { waitForCondition, waitForLitRender, EventSpy } from '../../core/testing';
-import { SbbNavigationAction } from './navigation-action';
+import { SbbNavigationActionElement } from './navigation-action';
import '.';
describe('sbb-navigation-action', () => {
- let element: SbbNavigationAction;
+ let element: SbbNavigationActionElement;
beforeEach(async () => {
element = await fixture(
@@ -67,7 +67,7 @@ describe('sbb-navigation-action', () => {
it('renders as a button and triggers click event', async () => {
element = await fixture(html`Label`);
- assert.instanceOf(element, SbbNavigationAction);
+ assert.instanceOf(element, SbbNavigationActionElement);
const clickedSpy = new EventSpy('click');
element.click();
diff --git a/src/components/navigation/navigation-action/navigation-action.ts b/src/components/navigation/navigation-action/navigation-action.ts
index 55a007e8c3..9e0882b56c 100644
--- a/src/components/navigation/navigation-action/navigation-action.ts
+++ b/src/components/navigation/navigation-action/navigation-action.ts
@@ -19,7 +19,7 @@ import {
resolveRenderVariables,
targetsNewWindow,
} from '../../core/interfaces';
-import type { SbbNavigationMarker } from '../navigation-marker';
+import type { SbbNavigationMarkerElement } from '../navigation-marker';
import style from './navigation-action.scss?lit&inline';
@@ -29,7 +29,7 @@ import style from './navigation-action.scss?lit&inline';
* @slot - Use the unnamed slot to add content to the `sbb-navigation-action`.
*/
@customElement('sbb-navigation-action')
-export class SbbNavigationAction extends LitElement {
+export class SbbNavigationActionElement extends LitElement {
public static override styles: CSSResultGroup = style;
/**
@@ -90,7 +90,7 @@ export class SbbNavigationAction extends LitElement {
@state() private _currentLanguage = documentLanguage();
- private _navigationMarker: SbbNavigationMarker;
+ private _navigationMarker: SbbNavigationMarkerElement;
private _abort = new ConnectedAbortController(this);
private _handlerRepository = new HandlerRepository(
@@ -114,7 +114,10 @@ export class SbbNavigationAction extends LitElement {
this._handlerRepository.connect();
// Check if the current element is nested inside a navigation marker.
- this._navigationMarker = hostContext('sbb-navigation-marker', this) as SbbNavigationMarker;
+ this._navigationMarker = hostContext(
+ 'sbb-navigation-marker',
+ this,
+ ) as SbbNavigationMarkerElement;
}
public override disconnectedCallback(): void {
@@ -161,6 +164,6 @@ export class SbbNavigationAction extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-navigation-action': SbbNavigationAction;
+ 'sbb-navigation-action': SbbNavigationActionElement;
}
}
diff --git a/src/components/navigation/navigation-list/navigation-list.e2e.ts b/src/components/navigation/navigation-list/navigation-list.e2e.ts
index 258464a80b..d840d8ddd6 100644
--- a/src/components/navigation/navigation-list/navigation-list.e2e.ts
+++ b/src/components/navigation/navigation-list/navigation-list.e2e.ts
@@ -1,11 +1,11 @@
import { assert, expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbNavigationList } from './navigation-list';
+import { SbbNavigationListElement } from './navigation-list';
import '../navigation-action';
describe('sbb-navigation-list', () => {
- let element: SbbNavigationList;
+ let element: SbbNavigationListElement;
beforeEach(async () => {
element = await fixture(html`
@@ -16,7 +16,7 @@ describe('sbb-navigation-list', () => {
});
it('renders', () => {
- assert.instanceOf(element, SbbNavigationList);
+ assert.instanceOf(element, SbbNavigationListElement);
});
it('automatic list generation', () => {
diff --git a/src/components/navigation/navigation-list/navigation-list.ts b/src/components/navigation/navigation-list/navigation-list.ts
index 60a8f1053b..89d4a9e7bb 100644
--- a/src/components/navigation/navigation-list/navigation-list.ts
+++ b/src/components/navigation/navigation-list/navigation-list.ts
@@ -8,7 +8,7 @@ import {
HandlerRepository,
namedSlotChangeHandlerAspect,
} from '../../core/eventing';
-import type { SbbNavigationAction } from '../navigation-action';
+import type { SbbNavigationActionElement } from '../navigation-action';
import style from './navigation-list.scss?lit&inline';
@@ -19,7 +19,7 @@ import style from './navigation-list.scss?lit&inline';
* @slot label - Use this to provide a label element.
*/
@customElement('sbb-navigation-list')
-export class SbbNavigationList extends SlotChildObserver(LitElement) {
+export class SbbNavigationListElement extends SlotChildObserver(LitElement) {
public static override styles: CSSResultGroup = style;
/*
@@ -30,7 +30,7 @@ export class SbbNavigationList extends SlotChildObserver(LitElement) {
/*
* Navigation action elements.
*/
- @state() private _actions: SbbNavigationAction[] = [];
+ @state() private _actions: SbbNavigationActionElement[] = [];
/**
* State of listed named slots, by indicating whether any element for a named slot is defined.
@@ -47,7 +47,7 @@ export class SbbNavigationList extends SlotChildObserver(LitElement) {
*/
protected override checkChildren(): void {
this._actions = Array.from(this.children ?? []).filter(
- (e): e is SbbNavigationAction => e.tagName === 'SBB-NAVIGATION-ACTION',
+ (e): e is SbbNavigationActionElement => e.tagName === 'SBB-NAVIGATION-ACTION',
);
}
@@ -96,6 +96,6 @@ export class SbbNavigationList extends SlotChildObserver(LitElement) {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-navigation-list': SbbNavigationList;
+ 'sbb-navigation-list': SbbNavigationListElement;
}
}
diff --git a/src/components/navigation/navigation-marker/navigation-marker.e2e.ts b/src/components/navigation/navigation-marker/navigation-marker.e2e.ts
index 2d8ae0d1fe..160ddd78ba 100644
--- a/src/components/navigation/navigation-marker/navigation-marker.e2e.ts
+++ b/src/components/navigation/navigation-marker/navigation-marker.e2e.ts
@@ -4,11 +4,11 @@ import { html } from 'lit/static-html.js';
import '../navigation-action';
import { waitForLitRender } from '../../core/testing';
-import { SbbNavigationMarker } from './navigation-marker';
+import { SbbNavigationMarkerElement } from './navigation-marker';
import '.';
describe('sbb-navigation-marker', () => {
- let element: SbbNavigationMarker;
+ let element: SbbNavigationMarkerElement;
beforeEach(async () => {
element = await fixture(
@@ -22,7 +22,7 @@ describe('sbb-navigation-marker', () => {
});
it('renders', async () => {
- assert.instanceOf(element, SbbNavigationMarker);
+ assert.instanceOf(element, SbbNavigationMarkerElement);
});
it('selects action on click', async () => {
diff --git a/src/components/navigation/navigation-marker/navigation-marker.ts b/src/components/navigation/navigation-marker/navigation-marker.ts
index 491ab6fc3d..5a56ab6047 100644
--- a/src/components/navigation/navigation-marker/navigation-marker.ts
+++ b/src/components/navigation/navigation-marker/navigation-marker.ts
@@ -4,7 +4,7 @@ import { customElement, property, state } from 'lit/decorators.js';
import { SlotChildObserver } from '../../core/common-behaviors';
import { setAttribute } from '../../core/dom';
import { AgnosticResizeObserver } from '../../core/observers';
-import type { SbbNavigationAction } from '../navigation-action';
+import type { SbbNavigationActionElement } from '../navigation-action';
import style from './navigation-marker.scss?lit&inline';
@@ -14,7 +14,7 @@ import style from './navigation-marker.scss?lit&inline';
* @slot - Use the unnamed slot to add `sbb-navigation-action` elements into the `sbb-navigation-marker`.
*/
@customElement('sbb-navigation-marker')
-export class SbbNavigationMarker extends SlotChildObserver(LitElement) {
+export class SbbNavigationMarkerElement extends SlotChildObserver(LitElement) {
public static override styles: CSSResultGroup = style;
/**
@@ -30,9 +30,9 @@ export class SbbNavigationMarker extends SlotChildObserver(LitElement) {
/**
* Navigation action elements.
*/
- @state() private _actions: SbbNavigationAction[] = [];
+ @state() private _actions: SbbNavigationActionElement[] = [];
- private _currentActiveAction: SbbNavigationAction;
+ private _currentActiveAction: SbbNavigationActionElement;
private _navigationMarkerResizeObserver = new AgnosticResizeObserver(() =>
this._setMarkerPosition(),
);
@@ -63,7 +63,7 @@ export class SbbNavigationMarker extends SlotChildObserver(LitElement) {
this._navigationMarkerResizeObserver.disconnect();
}
- public select(action: SbbNavigationAction): void {
+ public select(action: SbbNavigationActionElement): void {
this.reset();
action.active = true;
this._currentActiveAction = action;
@@ -79,18 +79,18 @@ export class SbbNavigationMarker extends SlotChildObserver(LitElement) {
this._hasActiveAction = false;
}
- private get _navigationActions(): SbbNavigationAction[] {
+ private get _navigationActions(): SbbNavigationActionElement[] {
return Array.from(this.querySelectorAll?.('sbb-navigation-action') ?? []);
}
- private get _activeNavigationAction(): SbbNavigationAction {
+ private get _activeNavigationAction(): SbbNavigationActionElement {
return this._navigationActions.find((action) => action.active);
}
// Create an array with only the sbb-navigation-action children.
protected override checkChildren(): void {
this._actions = Array.from(this.children).filter(
- (e): e is SbbNavigationAction => e.tagName === 'SBB-NAVIGATION-ACTION',
+ (e): e is SbbNavigationActionElement => e.tagName === 'SBB-NAVIGATION-ACTION',
);
}
@@ -127,6 +127,6 @@ export class SbbNavigationMarker extends SlotChildObserver(LitElement) {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-navigation-marker': SbbNavigationMarker;
+ 'sbb-navigation-marker': SbbNavigationMarkerElement;
}
}
diff --git a/src/components/navigation/navigation-marker/readme.md b/src/components/navigation/navigation-marker/readme.md
index e0f55c1595..44654512ec 100644
--- a/src/components/navigation/navigation-marker/readme.md
+++ b/src/components/navigation/navigation-marker/readme.md
@@ -32,10 +32,10 @@ Possible values are `l` (default) and `s`.
## Methods
-| Name | Privacy | Description | Parameters | Return | Inherited From |
-| -------- | ------- | ----------- | ----------------------------- | ------ | -------------- |
-| `select` | public | | `action: SbbNavigationAction` | `void` | |
-| `reset` | public | | | `void` | |
+| Name | Privacy | Description | Parameters | Return | Inherited From |
+| -------- | ------- | ----------- | ------------------------------------ | ------ | -------------- |
+| `select` | public | | `action: SbbNavigationActionElement` | `void` | |
+| `reset` | public | | | `void` | |
## Slots
diff --git a/src/components/navigation/navigation-section/navigation-section.e2e.ts b/src/components/navigation/navigation-section/navigation-section.e2e.ts
index d98263d4aa..52c982b0ad 100644
--- a/src/components/navigation/navigation-section/navigation-section.e2e.ts
+++ b/src/components/navigation/navigation-section/navigation-section.e2e.ts
@@ -3,13 +3,13 @@ import { html } from 'lit/static-html.js';
import { waitForCondition, waitForLitRender } from '../../core/testing';
-import { SbbNavigationSection } from './navigation-section';
+import { SbbNavigationSectionElement } from './navigation-section';
import '../navigation';
import '../navigation-list';
import '../navigation-action';
describe('sbb-navigation-section', () => {
- let element: SbbNavigationSection;
+ let element: SbbNavigationSectionElement;
beforeEach(async () => {
await fixture(html`
@@ -28,7 +28,7 @@ describe('sbb-navigation-section', () => {
});
it('renders', async () => {
- assert.instanceOf(element, SbbNavigationSection);
+ assert.instanceOf(element, SbbNavigationSectionElement);
});
it('opens the section', async () => {
diff --git a/src/components/navigation/navigation-section/navigation-section.stories.ts b/src/components/navigation/navigation-section/navigation-section.stories.ts
index a0d73dcde3..dd4f988fda 100644
--- a/src/components/navigation/navigation-section/navigation-section.stories.ts
+++ b/src/components/navigation/navigation-section/navigation-section.stories.ts
@@ -7,7 +7,7 @@ import { html, TemplateResult } from 'lit';
import { waitForComponentsReady } from '../../../storybook/testing/wait-for-components-ready';
import { sbbSpread } from '../../core/dom';
-import type { SbbNavigationMarker, SbbNavigation } from '../index';
+import type { SbbNavigationMarkerElement, SbbNavigationElement } from '../index';
import readme from './readme.md?raw';
import '../../button';
@@ -100,7 +100,9 @@ const DefaultTemplate = (args: Args): TemplateResult => html`
?disable-animation=${args['disable-animation']}
@didClose=${(event: CustomEvent) =>
(
- (event.currentTarget as SbbNavigation).querySelector('#nav-marker') as SbbNavigationMarker
+ (event.currentTarget as SbbNavigationElement).querySelector(
+ '#nav-marker',
+ ) as SbbNavigationMarkerElement
).reset()}
>
${navigationActionsL()}
diff --git a/src/components/navigation/navigation-section/navigation-section.ts b/src/components/navigation/navigation-section/navigation-section.ts
index ad663ab5b4..3b69e328e3 100644
--- a/src/components/navigation/navigation-section/navigation-section.ts
+++ b/src/components/navigation/navigation-section/navigation-section.ts
@@ -29,8 +29,8 @@ import {
SbbOverlayState,
setAriaOverlayTriggerAttributes,
} from '../../core/overlay';
-import type { SbbNavigation } from '../navigation';
-import type { SbbNavigationMarker } from '../navigation-marker';
+import type { SbbNavigationElement } from '../navigation';
+import type { SbbNavigationMarkerElement } from '../navigation-marker';
import style from './navigation-section.scss?lit&inline';
import '../../divider';
@@ -44,7 +44,7 @@ let nextId = 0;
* @slot - Use the unnamed slot to add content into the `sbb-navigation-section`.
*/
@customElement('sbb-navigation-section')
-export class SbbNavigationSection extends UpdateScheduler(LitElement) {
+export class SbbNavigationSectionElement extends UpdateScheduler(LitElement) {
public static override styles: CSSResultGroup = style;
/*
@@ -99,7 +99,7 @@ export class SbbNavigationSection extends UpdateScheduler(LitElement) {
@state() private _renderBackButton = this._isZeroToLargeBreakpoint();
- private _firstLevelNavigation: SbbNavigation;
+ private _firstLevelNavigation: SbbNavigationElement;
private _navigationSection: HTMLElement;
private _navigationSectionContainerElement: HTMLElement;
private _triggerElement: HTMLElement;
@@ -268,7 +268,7 @@ export class SbbNavigationSection extends UpdateScheduler(LitElement) {
private _resetMarker(): void {
if (this._isZeroToLargeBreakpoint()) {
- (this._triggerElement?.parentElement as SbbNavigationMarker)?.reset();
+ (this._triggerElement?.parentElement as SbbNavigationMarkerElement)?.reset();
}
}
@@ -413,6 +413,6 @@ export class SbbNavigationSection extends UpdateScheduler(LitElement) {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-navigation-section': SbbNavigationSection;
+ 'sbb-navigation-section': SbbNavigationSectionElement;
}
}
diff --git a/src/components/navigation/navigation/navigation.e2e.ts b/src/components/navigation/navigation/navigation.e2e.ts
index 23bcffdae6..1a282c0aee 100644
--- a/src/components/navigation/navigation/navigation.e2e.ts
+++ b/src/components/navigation/navigation/navigation.e2e.ts
@@ -3,17 +3,17 @@ import { sendKeys } from '@web/test-runner-commands';
import { html } from 'lit/static-html.js';
import '../navigation-marker';
-import { SbbButton } from '../../button';
+import { SbbButtonElement } from '../../button';
import { waitForCondition, waitForLitRender, EventSpy } from '../../core/testing';
-import type { SbbNavigationAction } from '../navigation-action';
+import type { SbbNavigationActionElement } from '../navigation-action';
import '../navigation-action';
-import type { SbbNavigationSection } from '../navigation-section';
+import type { SbbNavigationSectionElement } from '../navigation-section';
import '../navigation-section';
-import { SbbNavigation } from './navigation';
+import { SbbNavigationElement } from './navigation';
describe('sbb-navigation', () => {
- let element: SbbNavigation;
+ let element: SbbNavigationElement;
beforeEach(async () => {
element = await fixture(html`
@@ -38,11 +38,11 @@ describe('sbb-navigation', () => {
});
it('renders', () => {
- assert.instanceOf(element, SbbNavigation);
+ assert.instanceOf(element, SbbNavigationElement);
});
it('opens the navigation', async () => {
- const didOpenEventSpy = new EventSpy(SbbNavigation.events.didOpen);
+ const didOpenEventSpy = new EventSpy(SbbNavigationElement.events.didOpen);
element.open();
await waitForLitRender(element);
@@ -55,8 +55,8 @@ describe('sbb-navigation', () => {
});
it('closes the navigation', async () => {
- const didOpenEventSpy = new EventSpy(SbbNavigation.events.didOpen);
- const didCloseEventSpy = new EventSpy(SbbNavigation.events.didClose);
+ const didOpenEventSpy = new EventSpy(SbbNavigationElement.events.didOpen);
+ const didCloseEventSpy = new EventSpy(SbbNavigationElement.events.didClose);
element.open();
await waitForLitRender(element);
@@ -78,9 +78,10 @@ describe('sbb-navigation', () => {
});
it('closes the navigation on close button click', async () => {
- const didOpenEventSpy = new EventSpy(SbbNavigation.events.didOpen);
- const didCloseEventSpy = new EventSpy(SbbNavigation.events.didClose);
- const closeButton: SbbButton = element.shadowRoot.querySelector('.sbb-navigation__close');
+ const didOpenEventSpy = new EventSpy(SbbNavigationElement.events.didOpen);
+ const didCloseEventSpy = new EventSpy(SbbNavigationElement.events.didClose);
+ const closeButton: SbbButtonElement =
+ element.shadowRoot.querySelector('.sbb-navigation__close');
element.open();
await waitForLitRender(element);
@@ -102,8 +103,8 @@ describe('sbb-navigation', () => {
});
it('closes the navigation on Esc key press', async () => {
- const didOpenEventSpy = new EventSpy(SbbNavigation.events.didOpen);
- const didCloseEventSpy = new EventSpy(SbbNavigation.events.didClose);
+ const didOpenEventSpy = new EventSpy(SbbNavigationElement.events.didOpen);
+ const didCloseEventSpy = new EventSpy(SbbNavigationElement.events.didClose);
element.open();
await waitForLitRender(element);
@@ -128,13 +129,13 @@ describe('sbb-navigation', () => {
});
it('closes navigation with sbb-navigation-close', async () => {
- const didOpenEventSpy = new EventSpy(SbbNavigation.events.didOpen);
- const didCloseEventSpy = new EventSpy(SbbNavigation.events.didClose);
- const section: SbbNavigationSection = element.querySelector('#first-section');
- const action: SbbNavigationAction = element.querySelector(
+ const didOpenEventSpy = new EventSpy(SbbNavigationElement.events.didOpen);
+ const didCloseEventSpy = new EventSpy(SbbNavigationElement.events.didClose);
+ const section: SbbNavigationSectionElement = element.querySelector('#first-section');
+ const action: SbbNavigationActionElement = element.querySelector(
'sbb-navigation-marker > sbb-navigation-action#action-1',
);
- const closeEl: SbbNavigationAction = element.querySelector(
+ const closeEl: SbbNavigationActionElement = element.querySelector(
'sbb-navigation-marker > sbb-navigation-action[sbb-navigation-close]',
);
@@ -163,9 +164,9 @@ describe('sbb-navigation', () => {
});
it('opens navigation and opens section', async () => {
- const didOpenEventSpy = new EventSpy(SbbNavigation.events.didOpen);
- const section: SbbNavigationSection = element.querySelector('#first-section');
- const action: SbbNavigationAction = document.querySelector(
+ const didOpenEventSpy = new EventSpy(SbbNavigationElement.events.didOpen);
+ const section: SbbNavigationSectionElement = element.querySelector('#first-section');
+ const action: SbbNavigationActionElement = document.querySelector(
'sbb-navigation > sbb-navigation-marker > sbb-navigation-action#action-1',
);
@@ -188,13 +189,13 @@ describe('sbb-navigation', () => {
});
it('opens navigation and toggles sections', async () => {
- const didOpenEventSpy = new EventSpy(SbbNavigation.events.didOpen);
- const firstSection: SbbNavigationSection = document.querySelector('#first-section');
- const secondSection: SbbNavigationSection = document.querySelector('#second-section');
- const firstAction: SbbNavigationAction = document.querySelector(
+ const didOpenEventSpy = new EventSpy(SbbNavigationElement.events.didOpen);
+ const firstSection: SbbNavigationSectionElement = document.querySelector('#first-section');
+ const secondSection: SbbNavigationSectionElement = document.querySelector('#second-section');
+ const firstAction: SbbNavigationActionElement = document.querySelector(
'sbb-navigation-marker > sbb-navigation-action#action-1',
);
- const secondAction: SbbNavigationAction = document.querySelector(
+ const secondAction: SbbNavigationActionElement = document.querySelector(
'sbb-navigation-marker > sbb-navigation-action#action-2',
);
@@ -223,13 +224,14 @@ describe('sbb-navigation', () => {
});
it('closes the navigation and the section on close button click', async () => {
- const didOpenEventSpy = new EventSpy(SbbNavigation.events.didOpen);
- const didCloseEventSpy = new EventSpy(SbbNavigation.events.didClose);
- const section: SbbNavigationSection = element.querySelector('#first-section');
- const action: SbbNavigationAction = document.querySelector(
+ const didOpenEventSpy = new EventSpy(SbbNavigationElement.events.didOpen);
+ const didCloseEventSpy = new EventSpy(SbbNavigationElement.events.didClose);
+ const section: SbbNavigationSectionElement = element.querySelector('#first-section');
+ const action: SbbNavigationActionElement = document.querySelector(
'sbb-navigation > sbb-navigation-marker > sbb-navigation-action#action-1',
);
- const closeButton: SbbButton = element.shadowRoot.querySelector('.sbb-navigation__close');
+ const closeButton: SbbButtonElement =
+ element.shadowRoot.querySelector('.sbb-navigation__close');
element.open();
await waitForLitRender(element);
@@ -259,10 +261,10 @@ describe('sbb-navigation', () => {
});
it('closes the navigation and the section on Esc key press', async () => {
- const didOpenEventSpy = new EventSpy(SbbNavigation.events.didOpen);
- const didCloseEventSpy = new EventSpy(SbbNavigation.events.didClose);
- const section: SbbNavigationSection = element.querySelector('#first-section');
- const action: SbbNavigationAction = document.querySelector(
+ const didOpenEventSpy = new EventSpy(SbbNavigationElement.events.didOpen);
+ const didCloseEventSpy = new EventSpy(SbbNavigationElement.events.didClose);
+ const section: SbbNavigationSectionElement = element.querySelector('#first-section');
+ const action: SbbNavigationActionElement = document.querySelector(
'sbb-navigation > sbb-navigation-marker > sbb-navigation-action#action-1',
);
@@ -294,12 +296,12 @@ describe('sbb-navigation', () => {
});
it('closes section with sbb-navigation-section-close', async () => {
- const didOpenEventSpy = new EventSpy(SbbNavigation.events.didOpen);
- const section: SbbNavigationSection = document.querySelector('#first-section');
- const action: SbbNavigationAction = document.querySelector(
+ const didOpenEventSpy = new EventSpy(SbbNavigationElement.events.didOpen);
+ const section: SbbNavigationSectionElement = document.querySelector('#first-section');
+ const action: SbbNavigationActionElement = document.querySelector(
'sbb-navigation > sbb-navigation-marker > sbb-navigation-action#action-1',
);
- const closeEl: SbbNavigationAction = document.querySelector(
+ const closeEl: SbbNavigationActionElement = document.querySelector(
'sbb-navigation > sbb-navigation-section > sbb-navigation-action[sbb-navigation-section-close]',
);
diff --git a/src/components/navigation/navigation/navigation.stories.ts b/src/components/navigation/navigation/navigation.stories.ts
index f3edaf9bbb..6911a9121f 100644
--- a/src/components/navigation/navigation/navigation.stories.ts
+++ b/src/components/navigation/navigation/navigation.stories.ts
@@ -8,9 +8,9 @@ import { html, TemplateResult } from 'lit';
import { waitForComponentsReady } from '../../../storybook/testing/wait-for-components-ready';
import { sbbSpread } from '../../core/dom';
-import type { SbbNavigationMarker } from '../navigation-marker';
+import type { SbbNavigationMarkerElement } from '../navigation-marker';
-import { SbbNavigation } from './navigation';
+import { SbbNavigationElement } from './navigation';
import readme from './readme.md?raw';
import '../navigation-section';
import '../navigation-marker';
@@ -137,7 +137,9 @@ const actionLabels = (num: number): TemplateResult[] => {
const onNavigationClose = (event: CustomEvent): void => {
(
- (event.currentTarget as SbbNavigation).querySelector('#nav-marker') as SbbNavigationMarker
+ (event.currentTarget as SbbNavigationElement).querySelector(
+ '#nav-marker',
+ ) as SbbNavigationMarkerElement
).reset();
};
@@ -248,10 +250,10 @@ const meta: Meta = {
chromatic: { disableSnapshot: false },
actions: {
handles: [
- SbbNavigation.events.willOpen,
- SbbNavigation.events.didOpen,
- SbbNavigation.events.didClose,
- SbbNavigation.events.willClose,
+ SbbNavigationElement.events.willOpen,
+ SbbNavigationElement.events.didOpen,
+ SbbNavigationElement.events.didClose,
+ SbbNavigationElement.events.willClose,
],
},
backgrounds: {
diff --git a/src/components/navigation/navigation/navigation.ts b/src/components/navigation/navigation/navigation.ts
index 00d642e73e..1eb912b2e4 100644
--- a/src/components/navigation/navigation/navigation.ts
+++ b/src/components/navigation/navigation/navigation.ts
@@ -49,7 +49,7 @@ let nextId = 0;
* @event {CustomEvent} didClose - Emits whenever the `sbb-navigation` is closed.
*/
@customElement('sbb-navigation')
-export class SbbNavigation extends UpdateScheduler(LitElement) {
+export class SbbNavigationElement extends UpdateScheduler(LitElement) {
public static override styles: CSSResultGroup = style;
public static readonly events = {
willOpen: 'willOpen',
@@ -99,16 +99,28 @@ export class SbbNavigation extends UpdateScheduler(LitElement) {
@state() private _currentLanguage = documentLanguage();
/** Emits whenever the `sbb-navigation` begins the opening transition. */
- private _willOpen: EventEmitter = new EventEmitter(this, SbbNavigation.events.willOpen);
+ private _willOpen: EventEmitter = new EventEmitter(
+ this,
+ SbbNavigationElement.events.willOpen,
+ );
/** Emits whenever the `sbb-navigation` is opened. */
- private _didOpen: EventEmitter = new EventEmitter(this, SbbNavigation.events.didOpen);
+ private _didOpen: EventEmitter = new EventEmitter(
+ this,
+ SbbNavigationElement.events.didOpen,
+ );
/** Emits whenever the `sbb-navigation` begins the closing transition. */
- private _willClose: EventEmitter = new EventEmitter(this, SbbNavigation.events.willClose);
+ private _willClose: EventEmitter = new EventEmitter(
+ this,
+ SbbNavigationElement.events.willClose,
+ );
/** Emits whenever the `sbb-navigation` is closed. */
- private _didClose: EventEmitter = new EventEmitter(this, SbbNavigation.events.didClose);
+ private _didClose: EventEmitter = new EventEmitter(
+ this,
+ SbbNavigationElement.events.didClose,
+ );
private _navigation: HTMLDivElement;
private _navigationContentElement: HTMLElement;
@@ -373,6 +385,6 @@ export class SbbNavigation extends UpdateScheduler(LitElement) {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-navigation': SbbNavigation;
+ 'sbb-navigation': SbbNavigationElement;
}
}
diff --git a/src/components/notification/notification.e2e.ts b/src/components/notification/notification.e2e.ts
index ca2de53ed0..c3ff15cccd 100644
--- a/src/components/notification/notification.e2e.ts
+++ b/src/components/notification/notification.e2e.ts
@@ -1,15 +1,15 @@
import { assert, expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbButton } from '../button';
+import { SbbButtonElement } from '../button';
import { waitForCondition, EventSpy, waitForLitRender } from '../core/testing';
-import { SbbNotification } from './notification';
+import { SbbNotificationElement } from './notification';
import '../link';
describe('sbb-notification', () => {
- let element: SbbNotification;
+ let element: SbbNotificationElement;
beforeEach(async () => {
element = await fixture(html`
@@ -21,12 +21,12 @@ describe('sbb-notification', () => {
});
it('renders', async () => {
- assert.instanceOf(element, SbbNotification);
+ assert.instanceOf(element, SbbNotificationElement);
});
it('closes the notification and removes it from the DOM', async () => {
- const willCloseEventSpy = new EventSpy(SbbNotification.events.willClose);
- const didCloseEventSpy = new EventSpy(SbbNotification.events.didClose);
+ const willCloseEventSpy = new EventSpy(SbbNotificationElement.events.willClose);
+ const didCloseEventSpy = new EventSpy(SbbNotificationElement.events.didClose);
expect(element).not.to.be.null;
expect(element).to.have.attribute('data-state', 'opened');
@@ -49,9 +49,11 @@ describe('sbb-notification', () => {
});
it('closes the notification and removes it from the DOM on close button click', async () => {
- const willCloseEventSpy = new EventSpy(SbbNotification.events.willClose);
- const didCloseEventSpy = new EventSpy(SbbNotification.events.didClose);
- const closeButton = element.shadowRoot.querySelector('.sbb-notification__close') as SbbButton;
+ const willCloseEventSpy = new EventSpy(SbbNotificationElement.events.willClose);
+ const didCloseEventSpy = new EventSpy(SbbNotificationElement.events.didClose);
+ const closeButton = element.shadowRoot.querySelector(
+ '.sbb-notification__close',
+ ) as SbbButtonElement;
expect(element).not.to.be.null;
expect(element).to.have.attribute('data-state', 'opened');
diff --git a/src/components/notification/notification.stories.ts b/src/components/notification/notification.stories.ts
index 4e92724d0c..a3f9235efc 100644
--- a/src/components/notification/notification.stories.ts
+++ b/src/components/notification/notification.stories.ts
@@ -5,10 +5,10 @@ import isChromatic from 'chromatic/isChromatic';
import { html, TemplateResult } from 'lit';
import { ref } from 'lit/directives/ref.js';
-import type { SbbButton } from '../button';
+import type { SbbButtonElement } from '../button';
import { sbbSpread } from '../core/dom';
-import { SbbNotification } from './notification';
+import { SbbNotificationElement } from './notification';
import readme from './readme.md?raw';
import '../button';
import '../link';
@@ -64,7 +64,7 @@ const appendNotification = (event: Event, args: Args): void => {
newNotification.disableAnimation = args['disable-animation'];
newNotification.innerHTML =
'Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.';
- (event.target as SbbButton).parentElement
+ (event.target as SbbButtonElement).parentElement
.querySelector('.notification-container')
?.append(newNotification);
};
@@ -97,9 +97,10 @@ const DefaultTemplate = (args: Args): TemplateResult => html`
style="margin-block-end: var(--sbb-spacing-fixed-4x);"
${ref(
(notification?: Element) =>
- (notification as SbbNotification)?.addEventListener(
- SbbNotification.events.didOpen,
- () => ((notification as SbbNotification).disableAnimation = args['disable-animation']),
+ (notification as SbbNotificationElement)?.addEventListener(
+ SbbNotificationElement.events.didOpen,
+ () =>
+ ((notification as SbbNotificationElement).disableAnimation = args['disable-animation']),
{ once: true },
),
)}
@@ -118,9 +119,10 @@ const SlottedTitleTemplate = (args: Args): TemplateResult => html`
style="margin-block-end: var(--sbb-spacing-fixed-4x);"
${ref(
(notification?: Element) =>
- (notification as SbbNotification)?.addEventListener(
- SbbNotification.events.didOpen,
- () => ((notification as SbbNotification).disableAnimation = args['disable-animation']),
+ (notification as SbbNotificationElement)?.addEventListener(
+ SbbNotificationElement.events.didOpen,
+ () =>
+ ((notification as SbbNotificationElement).disableAnimation = args['disable-animation']),
{ once: true },
),
)}
@@ -201,10 +203,10 @@ const meta: Meta = {
parameters: {
actions: {
handles: [
- SbbNotification.events.didOpen,
- SbbNotification.events.didClose,
- SbbNotification.events.willOpen,
- SbbNotification.events.willClose,
+ SbbNotificationElement.events.didOpen,
+ SbbNotificationElement.events.didClose,
+ SbbNotificationElement.events.willOpen,
+ SbbNotificationElement.events.willClose,
],
},
backgrounds: {
diff --git a/src/components/notification/notification.ts b/src/components/notification/notification.ts
index b6c73f35d1..d37f25e2e6 100644
--- a/src/components/notification/notification.ts
+++ b/src/components/notification/notification.ts
@@ -40,7 +40,7 @@ const notificationTypes = new Map([
* @event {CustomEvent} didClose - Emits whenever the `sbb-notification` is closed.
*/
@customElement('sbb-notification')
-export class SbbNotification extends LitElement {
+export class SbbNotificationElement extends LitElement {
public static override styles: CSSResultGroup = style;
public static readonly events = {
willOpen: 'willOpen',
@@ -95,16 +95,28 @@ export class SbbNotification extends LitElement {
);
/** Emits whenever the `sbb-notification` starts the opening transition. */
- private _willOpen: EventEmitter = new EventEmitter(this, SbbNotification.events.willOpen);
+ private _willOpen: EventEmitter = new EventEmitter(
+ this,
+ SbbNotificationElement.events.willOpen,
+ );
/** Emits whenever the `sbb-notification` is opened. */
- private _didOpen: EventEmitter = new EventEmitter(this, SbbNotification.events.didOpen);
+ private _didOpen: EventEmitter = new EventEmitter(
+ this,
+ SbbNotificationElement.events.didOpen,
+ );
/** Emits whenever the `sbb-notification` begins the closing transition. */
- private _willClose: EventEmitter = new EventEmitter(this, SbbNotification.events.willClose);
+ private _willClose: EventEmitter = new EventEmitter(
+ this,
+ SbbNotificationElement.events.willClose,
+ );
/** Emits whenever the `sbb-notification` is closed. */
- private _didClose: EventEmitter = new EventEmitter(this, SbbNotification.events.didClose);
+ private _didClose: EventEmitter = new EventEmitter(
+ this,
+ SbbNotificationElement.events.didClose,
+ );
public close(): void {
if (this._state === 'opened') {
@@ -245,6 +257,6 @@ export class SbbNotification extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-notification': SbbNotification;
+ 'sbb-notification': SbbNotificationElement;
}
}
diff --git a/src/components/option/optgroup/optgroup.e2e.ts b/src/components/option/optgroup/optgroup.e2e.ts
index 7ebebf2bdc..aaf178c8f2 100644
--- a/src/components/option/optgroup/optgroup.e2e.ts
+++ b/src/components/option/optgroup/optgroup.e2e.ts
@@ -2,13 +2,13 @@ import { assert, expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
import { waitForLitRender } from '../../core/testing';
-import type { SbbOption } from '../option';
+import type { SbbOptionElement } from '../option';
import '../option';
-import { SbbOptGroup } from './optgroup';
+import { SbbOptGroupElement } from './optgroup';
describe('sbb-optgroup', () => {
- let element: SbbOptGroup;
+ let element: SbbOptGroupElement;
beforeEach(async () => {
element = await fixture(html`
@@ -21,7 +21,7 @@ describe('sbb-optgroup', () => {
});
it('renders', async () => {
- assert.instanceOf(element, SbbOptGroup);
+ assert.instanceOf(element, SbbOptGroupElement);
});
it('disabled status is inherited', async () => {
@@ -44,9 +44,15 @@ describe('sbb-optgroup', () => {
});
it('disabled status prevents changes', async () => {
- const optionOne: SbbOption = document.querySelector('sbb-optgroup > sbb-option#option-1');
- const optionTwo: SbbOption = document.querySelector('sbb-optgroup > sbb-option#option-2');
- const optionThree: SbbOption = document.querySelector('sbb-optgroup > sbb-option#option-3');
+ const optionOne: SbbOptionElement = document.querySelector(
+ 'sbb-optgroup > sbb-option#option-1',
+ );
+ const optionTwo: SbbOptionElement = document.querySelector(
+ 'sbb-optgroup > sbb-option#option-2',
+ );
+ const optionThree: SbbOptionElement = document.querySelector(
+ 'sbb-optgroup > sbb-option#option-3',
+ );
const options = [optionOne, optionTwo, optionThree];
options.forEach((opt) => expect(opt).not.to.have.attribute('selected'));
diff --git a/src/components/option/optgroup/optgroup.ts b/src/components/option/optgroup/optgroup.ts
index 75cfb82c93..9c92669f00 100644
--- a/src/components/option/optgroup/optgroup.ts
+++ b/src/components/option/optgroup/optgroup.ts
@@ -3,7 +3,7 @@ import { customElement, property, state } from 'lit/decorators.js';
import { isSafari, isValidAttribute, toggleDatasetEntry, setAttribute } from '../../core/dom';
import { AgnosticMutationObserver } from '../../core/observers';
-import type { SbbOption, SbbOptionVariant } from '../option';
+import type { SbbOptionElement, SbbOptionVariant } from '../option';
import style from './optgroup.scss?lit&inline';
import '../../divider';
@@ -14,7 +14,7 @@ import '../../divider';
* @slot - Use the unnamed slot to add `sbb-option` elements to the `sbb-optgroup`.
*/
@customElement('sbb-optgroup')
-export class SbbOptGroup extends LitElement {
+export class SbbOptGroupElement extends LitElement {
public static override styles: CSSResultGroup = style;
/** Option group label. */
@@ -40,8 +40,8 @@ export class SbbOptGroup extends LitElement {
return this._variant === 'select' && this.closest('sbb-select')?.hasAttribute('multiple');
}
- private get _options(): SbbOption[] {
- return Array.from(this.querySelectorAll?.('sbb-option') ?? []) as SbbOption[];
+ private get _options(): SbbOptionElement[] {
+ return Array.from(this.querySelectorAll?.('sbb-option') ?? []) as SbbOptionElement[];
}
public override connectedCallback(): void {
@@ -124,6 +124,6 @@ export class SbbOptGroup extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-optgroup': SbbOptGroup;
+ 'sbb-optgroup': SbbOptGroupElement;
}
}
diff --git a/src/components/option/option/option.e2e.ts b/src/components/option/option/option.e2e.ts
index 5844bb67cd..2066f1b2f6 100644
--- a/src/components/option/option/option.e2e.ts
+++ b/src/components/option/option/option.e2e.ts
@@ -4,14 +4,14 @@ import { html } from 'lit/static-html.js';
import '../../autocomplete';
import { waitForLitRender, EventSpy } from '../../core/testing';
-import type { SbbFormField } from '../../form-field';
+import type { SbbFormFieldElement } from '../../form-field';
import '../../form-field';
-import { SbbOption } from './option';
+import { SbbOptionElement } from './option';
describe('sbb-option', () => {
describe('autocomplete', () => {
- let element: SbbFormField;
+ let element: SbbFormFieldElement;
beforeEach(async () => {
element = await fixture(html`
@@ -28,11 +28,11 @@ describe('sbb-option', () => {
it('renders', async () => {
const option = element.querySelector('sbb-option');
- assert.instanceOf(option, SbbOption);
+ assert.instanceOf(option, SbbOptionElement);
});
it('set selected and emits on click', async () => {
- const selectionChangeSpy = new EventSpy(SbbOption.events.selectionChange);
+ const selectionChangeSpy = new EventSpy(SbbOptionElement.events.selectionChange);
const optionOne = element.querySelector('sbb-option');
optionOne.dispatchEvent(new CustomEvent('click'));
diff --git a/src/components/option/option/option.stories.ts b/src/components/option/option/option.stories.ts
index f131a41e1a..ff2893c2d5 100644
--- a/src/components/option/option/option.stories.ts
+++ b/src/components/option/option/option.stories.ts
@@ -6,7 +6,7 @@ import { styleMap, StyleInfo } from 'lit/directives/style-map.js';
import { sbbSpread } from '../../core/dom';
-import { SbbOption } from './option';
+import { SbbOptionElement } from './option';
import readme from './readme.md?raw';
import '../../form-field';
import '../../select';
@@ -190,7 +190,7 @@ const meta: Meta = {
],
parameters: {
actions: {
- handles: [SbbOption.events.selectionChange, SbbOption.events.optionSelected],
+ handles: [SbbOptionElement.events.selectionChange, SbbOptionElement.events.optionSelected],
},
backgrounds: {
disable: true,
diff --git a/src/components/option/option/option.ts b/src/components/option/option/option.ts
index bba1660f14..e366b9a794 100644
--- a/src/components/option/option/option.ts
+++ b/src/components/option/option/option.ts
@@ -41,7 +41,7 @@ export type SbbOptionVariant = 'autocomplete' | 'select';
* @event {CustomEvent} optionSelected - Emits when an option was selected by user.
*/
@customElement('sbb-option')
-export class SbbOption extends LitElement {
+export class SbbOptionElement extends LitElement {
public static override styles: CSSResultGroup = style;
public static readonly events = {
selectionChange: 'optionSelectionChange',
@@ -68,10 +68,16 @@ export class SbbOption extends LitElement {
@property({ reflect: true, type: Boolean }) public disabled?: boolean;
/** Emits when the option selection status changes. */
- private _selectionChange: EventEmitter = new EventEmitter(this, SbbOption.events.selectionChange);
+ private _selectionChange: EventEmitter = new EventEmitter(
+ this,
+ SbbOptionElement.events.selectionChange,
+ );
/** Emits when an option was selected by user. */
- private _optionSelected: EventEmitter = new EventEmitter(this, SbbOption.events.optionSelected);
+ private _optionSelected: EventEmitter = new EventEmitter(
+ this,
+ SbbOptionElement.events.optionSelected,
+ );
/** Wheter to apply the negative styling */
@state() private _negative = false;
@@ -320,6 +326,6 @@ export class SbbOption extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-option': SbbOption;
+ 'sbb-option': SbbOptionElement;
}
}
diff --git a/src/components/pearl-chain-time/pearl-chain-time.spec.ts b/src/components/pearl-chain-time/pearl-chain-time.spec.ts
index 5af7892103..01f20e99d9 100644
--- a/src/components/pearl-chain-time/pearl-chain-time.spec.ts
+++ b/src/components/pearl-chain-time/pearl-chain-time.spec.ts
@@ -4,7 +4,7 @@ import { html } from 'lit/static-html.js';
import { waitForLitRender } from '../core/testing';
import { PtRideLeg } from '../core/timetable';
-import type { SbbPearlChainTime } from './pearl-chain-time';
+import type { SbbPearlChainTimeElement } from './pearl-chain-time';
import './pearl-chain-time';
@@ -12,7 +12,7 @@ const now = new Date('2022-08-16T15:00:00Z').valueOf();
describe('sbb-pearl-chain-time', () => {
it('should render component with time', async () => {
- const element = await fixture(html`
+ const element = await fixture(html`
{
});
it('should render component with departure walk', async () => {
- const element = await fixture(html`
+ const element = await fixture(html`
{
});
it('should render component with arrival walk', async () => {
- const element = await fixture(html`
+ const element = await fixture(html`
{
});
it('should render component with departure and arrival walk', async () => {
- const element = await fixture(html`
+ const element = await fixture(html`
{
it('renders component with charcoal standard line and bullet', async () => {
- const element = await fixture(html`
+ const element = await fixture(html`
`);
@@ -41,7 +41,7 @@ describe('sbb-pearl-chain-vertical-item', () => {
});
it('renders component with red line and bullet', async () => {
- const element = await fixture(html`
+ const element = await fixture(html`
`);
@@ -73,7 +73,7 @@ describe('sbb-pearl-chain-vertical-item', () => {
});
it('renders component with left slot', async () => {
- const element = await fixture(html`
+ const element = await fixture(html`
content
@@ -105,7 +105,7 @@ describe('sbb-pearl-chain-vertical-item', () => {
});
it('renders component with right slot', async () => {
- const element = await fixture(html`
+ const element = await fixture(html`
right content
@@ -137,7 +137,7 @@ describe('sbb-pearl-chain-vertical-item', () => {
});
it('renders component with both slots', async () => {
- const element = await fixture(html`
+ const element = await fixture(html`
right content
left content
@@ -171,7 +171,7 @@ describe('sbb-pearl-chain-vertical-item', () => {
});
it('renders a position', async () => {
- const element = await fixture(html`
+ const element = await fixture(html`
right content
left content
@@ -207,7 +207,7 @@ describe('sbb-pearl-chain-vertical-item', () => {
});
it('renders a crossed-bullet', async () => {
- const element = await fixture(html`
+ const element = await fixture(html`
right content
left content
diff --git a/src/components/pearl-chain-vertical-item/pearl-chain-vertical-item.ts b/src/components/pearl-chain-vertical-item/pearl-chain-vertical-item.ts
index 635621294c..3f79517bc6 100644
--- a/src/components/pearl-chain-vertical-item/pearl-chain-vertical-item.ts
+++ b/src/components/pearl-chain-vertical-item/pearl-chain-vertical-item.ts
@@ -28,7 +28,7 @@ export interface PearlChainVerticalItemAttributes {
* @slot right - Content of the right side of the item
*/
@customElement('sbb-pearl-chain-vertical-item')
-export class SbbPearlChainVerticalItem extends LitElement {
+export class SbbPearlChainVerticalItemElement extends LitElement {
public static override styles: CSSResultGroup = style;
/** The pearlChainVerticalItemAttributes Prop for styling the bullets and line.*/
@@ -82,6 +82,6 @@ export class SbbPearlChainVerticalItem extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-pearl-chain-vertical-item': SbbPearlChainVerticalItem;
+ 'sbb-pearl-chain-vertical-item': SbbPearlChainVerticalItemElement;
}
}
diff --git a/src/components/pearl-chain-vertical/pearl-chain-vertical.e2e.ts b/src/components/pearl-chain-vertical/pearl-chain-vertical.e2e.ts
index e8e333102d..7ec75d7c1b 100644
--- a/src/components/pearl-chain-vertical/pearl-chain-vertical.e2e.ts
+++ b/src/components/pearl-chain-vertical/pearl-chain-vertical.e2e.ts
@@ -1,13 +1,13 @@
import { assert, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbPearlChainVertical } from './pearl-chain-vertical';
+import { SbbPearlChainVerticalElement } from './pearl-chain-vertical';
describe('sbb-pearl-chain', () => {
- let element: SbbPearlChainVertical;
+ let element: SbbPearlChainVerticalElement;
it('renders', async () => {
element = await fixture(html``);
- assert.instanceOf(element, SbbPearlChainVertical);
+ assert.instanceOf(element, SbbPearlChainVerticalElement);
});
});
diff --git a/src/components/pearl-chain-vertical/pearl-chain-vertical.spec.ts b/src/components/pearl-chain-vertical/pearl-chain-vertical.spec.ts
index 1a79acc3e2..299984900f 100644
--- a/src/components/pearl-chain-vertical/pearl-chain-vertical.spec.ts
+++ b/src/components/pearl-chain-vertical/pearl-chain-vertical.spec.ts
@@ -3,13 +3,13 @@ import { html } from 'lit/static-html.js';
import { waitForLitRender } from '../core/testing';
-import type { SbbPearlChainVertical } from './pearl-chain-vertical';
+import type { SbbPearlChainVerticalElement } from './pearl-chain-vertical';
import './pearl-chain-vertical';
describe('sbb-pearl-chain-vertical', () => {
it('renders', async () => {
- const element = await fixture(
+ const element = await fixture(
html``,
);
await waitForLitRender(element);
diff --git a/src/components/pearl-chain-vertical/pearl-chain-vertical.ts b/src/components/pearl-chain-vertical/pearl-chain-vertical.ts
index 42f3e303b7..59c49d5315 100644
--- a/src/components/pearl-chain-vertical/pearl-chain-vertical.ts
+++ b/src/components/pearl-chain-vertical/pearl-chain-vertical.ts
@@ -9,7 +9,7 @@ import style from './pearl-chain-vertical.scss?lit&inline';
* @slot - The unnamed slot is used for the `sbb-pearl-chain-vertical-item` component.
*/
@customElement('sbb-pearl-chain-vertical')
-export class SbbPearlChainVertical extends LitElement {
+export class SbbPearlChainVerticalElement extends LitElement {
public static override styles: CSSResultGroup = style;
protected override render(): TemplateResult {
@@ -24,6 +24,6 @@ export class SbbPearlChainVertical extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-pearl-chain-vertical': SbbPearlChainVertical;
+ 'sbb-pearl-chain-vertical': SbbPearlChainVerticalElement;
}
}
diff --git a/src/components/pearl-chain/pearl-chain.e2e.ts b/src/components/pearl-chain/pearl-chain.e2e.ts
index d79f3ea785..ba5b92196b 100644
--- a/src/components/pearl-chain/pearl-chain.e2e.ts
+++ b/src/components/pearl-chain/pearl-chain.e2e.ts
@@ -1,13 +1,13 @@
import { assert, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbPearlChain } from './pearl-chain';
+import { SbbPearlChainElement } from './pearl-chain';
describe('sbb-pearl-chain', () => {
- let element: SbbPearlChain;
+ let element: SbbPearlChainElement;
it('renders', async () => {
element = await fixture(html``);
- assert.instanceOf(element, SbbPearlChain);
+ assert.instanceOf(element, SbbPearlChainElement);
});
});
diff --git a/src/components/pearl-chain/pearl-chain.spec.ts b/src/components/pearl-chain/pearl-chain.spec.ts
index 01874f28da..6d31ed8d0f 100644
--- a/src/components/pearl-chain/pearl-chain.spec.ts
+++ b/src/components/pearl-chain/pearl-chain.spec.ts
@@ -4,14 +4,16 @@ import { html } from 'lit/static-html.js';
import { waitForLitRender } from '../core/testing';
import { PtRideLeg } from '../core/timetable';
-import type { SbbPearlChain } from './pearl-chain';
+import type { SbbPearlChainElement } from './pearl-chain';
import './pearl-chain';
describe('sbb-pearl-chain', () => {
describe('sbb-pearl-chain with one leg', () => {
it('renders component with config', async () => {
- const element = await fixture(html``);
+ const element = await fixture(
+ html``,
+ );
element.legs = [
{
__typename: 'PTRideLeg',
@@ -33,7 +35,9 @@ describe('sbb-pearl-chain', () => {
describe('sbb-pearl-chain with two legs', () => {
it('renders component with config', async () => {
- const element = await fixture(html``);
+ const element = await fixture(
+ html``,
+ );
element.legs = [
{
__typename: 'PTRideLeg',
@@ -73,7 +77,9 @@ describe('sbb-pearl-chain', () => {
describe('sbb-pearl-chain with skipped stops', () => {
it('renders component with departure skipped', async () => {
- const element = await fixture(html``);
+ const element = await fixture(
+ html``,
+ );
element.legs = [
{
__typename: 'PTRideLeg',
@@ -119,7 +125,9 @@ describe('sbb-pearl-chain', () => {
});
it('renders component with arrival skipped', async () => {
- const element = await fixture(html``);
+ const element = await fixture(
+ html``,
+ );
element.legs = [
{
__typename: 'PTRideLeg',
diff --git a/src/components/pearl-chain/pearl-chain.ts b/src/components/pearl-chain/pearl-chain.ts
index 89afb2c9bb..1915afb224 100644
--- a/src/components/pearl-chain/pearl-chain.ts
+++ b/src/components/pearl-chain/pearl-chain.ts
@@ -14,7 +14,7 @@ type Status = 'progress' | 'future' | 'past';
* It visually displays journey information.
*/
@customElement('sbb-pearl-chain')
-export class SbbPearlChain extends LitElement {
+export class SbbPearlChainElement extends LitElement {
public static override styles: CSSResultGroup = style;
/**
@@ -230,6 +230,6 @@ export class SbbPearlChain extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-pearl-chain': SbbPearlChain;
+ 'sbb-pearl-chain': SbbPearlChainElement;
}
}
diff --git a/src/components/radio-button/radio-button-group/radio-button-group.e2e.ts b/src/components/radio-button/radio-button-group/radio-button-group.e2e.ts
index 2812987c2e..8b8ff81a06 100644
--- a/src/components/radio-button/radio-button-group/radio-button-group.e2e.ts
+++ b/src/components/radio-button/radio-button-group/radio-button-group.e2e.ts
@@ -3,13 +3,13 @@ import { sendKeys } from '@web/test-runner-commands';
import { html } from 'lit/static-html.js';
import { waitForCondition, waitForLitRender, EventSpy } from '../../core/testing';
-import type { SbbRadioButton } from '../radio-button';
+import type { SbbRadioButtonElement } from '../radio-button';
import '../radio-button';
-import { SbbRadioButtonGroup } from './radio-button-group';
+import { SbbRadioButtonGroupElement } from './radio-button-group';
describe('sbb-radio-button-group', () => {
- let element: SbbRadioButtonGroup;
+ let element: SbbRadioButtonGroupElement;
beforeEach(async () => {
element = await fixture(html`
@@ -25,13 +25,13 @@ describe('sbb-radio-button-group', () => {
});
it('renders', () => {
- assert.instanceOf(element, SbbRadioButtonGroup);
+ assert.instanceOf(element, SbbRadioButtonGroupElement);
});
describe('events', () => {
it('selects radio on click', async () => {
- const firstRadio = element.querySelector('#sbb-radio-1') as SbbRadioButton;
- const radio = element.querySelector('#sbb-radio-2') as SbbRadioButton;
+ const firstRadio = element.querySelector('#sbb-radio-1') as SbbRadioButtonElement;
+ const radio = element.querySelector('#sbb-radio-2') as SbbRadioButtonElement;
expect(firstRadio).to.have.attribute('checked');
@@ -43,8 +43,8 @@ describe('sbb-radio-button-group', () => {
});
it('dispatches event on radio change', async () => {
- const firstRadio = element.querySelector('#sbb-radio-1') as SbbRadioButton;
- const checkedRadio = element.querySelector('#sbb-radio-2') as SbbRadioButton;
+ const firstRadio = element.querySelector('#sbb-radio-1') as SbbRadioButtonElement;
+ const checkedRadio = element.querySelector('#sbb-radio-2') as SbbRadioButtonElement;
const changeSpy = new EventSpy('change');
const inputSpy = new EventSpy('input');
@@ -60,8 +60,8 @@ describe('sbb-radio-button-group', () => {
});
it('does not select disabled radio on click', async () => {
- const firstRadio = element.querySelector('#sbb-radio-1') as SbbRadioButton;
- const disabledRadio = element.querySelector('#sbb-radio-3') as SbbRadioButton;
+ const firstRadio = element.querySelector('#sbb-radio-1') as SbbRadioButtonElement;
+ const disabledRadio = element.querySelector('#sbb-radio-3') as SbbRadioButtonElement;
disabledRadio.click();
await waitForLitRender(element);
@@ -71,9 +71,9 @@ describe('sbb-radio-button-group', () => {
});
it('preserves radio button disabled state after being disabled from group', async () => {
- const firstRadio = element.querySelector('#sbb-radio-1') as SbbRadioButton;
- const secondRadio = element.querySelector('#sbb-radio-2') as SbbRadioButton;
- const disabledRadio = element.querySelector('#sbb-radio-3') as SbbRadioButton;
+ const firstRadio = element.querySelector('#sbb-radio-1') as SbbRadioButtonElement;
+ const secondRadio = element.querySelector('#sbb-radio-2') as SbbRadioButtonElement;
+ const disabledRadio = element.querySelector('#sbb-radio-3') as SbbRadioButtonElement;
element.disabled = true;
await waitForLitRender(element);
@@ -97,7 +97,7 @@ describe('sbb-radio-button-group', () => {
});
it('selects radio on left arrow key pressed', async () => {
- const firstRadio = element.querySelector('#sbb-radio-1') as SbbRadioButton;
+ const firstRadio = element.querySelector('#sbb-radio-1') as SbbRadioButtonElement;
firstRadio.focus();
await waitForLitRender(element);
@@ -115,7 +115,7 @@ describe('sbb-radio-button-group', () => {
});
it('selects radio on right arrow key pressed', async () => {
- const firstRadio = element.querySelector('#sbb-radio-1') as SbbRadioButton;
+ const firstRadio = element.querySelector('#sbb-radio-1') as SbbRadioButtonElement;
firstRadio.focus();
await sendKeys({ down: 'ArrowRight' });
@@ -132,8 +132,8 @@ describe('sbb-radio-button-group', () => {
});
it('wraps around on arrow key navigation', async () => {
- const firstRadio = element.querySelector('#sbb-radio-1') as SbbRadioButton;
- const secondRadio = element.querySelector('#sbb-radio-2') as SbbRadioButton;
+ const firstRadio = element.querySelector('#sbb-radio-1') as SbbRadioButtonElement;
+ const secondRadio = element.querySelector('#sbb-radio-2') as SbbRadioButtonElement;
secondRadio.click();
await waitForLitRender(element);
diff --git a/src/components/radio-button/radio-button-group/radio-button-group.stories.ts b/src/components/radio-button/radio-button-group/radio-button-group.stories.ts
index 305af08d52..72a0d5ce1e 100644
--- a/src/components/radio-button/radio-button-group/radio-button-group.stories.ts
+++ b/src/components/radio-button/radio-button-group/radio-button-group.stories.ts
@@ -4,7 +4,7 @@ import type { Meta, StoryObj, ArgTypes, Args, Decorator } from '@storybook/web-c
import { html, TemplateResult } from 'lit';
import { sbbSpread } from '../../core/dom';
-import type { SbbFormError } from '../../form-error';
+import type { SbbFormErrorElement } from '../../form-error';
import readme from './readme.md?raw';
import './radio-button-group';
@@ -96,7 +96,7 @@ const DefaultTemplate = (args: Args): TemplateResult => html`
`;
const ErrorMessageTemplate = (args: Args): TemplateResult => {
- const sbbFormError: SbbFormError = document.createElement('sbb-form-error');
+ const sbbFormError: SbbFormErrorElement = document.createElement('sbb-form-error');
sbbFormError.setAttribute('slot', 'error');
sbbFormError.textContent = 'This is a required field.';
diff --git a/src/components/radio-button/radio-button-group/radio-button-group.ts b/src/components/radio-button/radio-button-group/radio-button-group.ts
index dbc9e6ea10..40687c708f 100644
--- a/src/components/radio-button/radio-button-group/radio-button-group.ts
+++ b/src/components/radio-button/radio-button-group/radio-button-group.ts
@@ -12,14 +12,17 @@ import {
} from '../../core/eventing';
import { SbbHorizontalFrom, SbbOrientation } from '../../core/interfaces';
import type {
- SbbRadioButton,
+ SbbRadioButtonElement,
SbbRadioButtonSize,
SbbRadioButtonStateChange,
} from '../radio-button';
import style from './radio-button-group.scss?lit&inline';
-export type SbbRadioButtonGroupEventDetail = { value: any | null; radioButton: SbbRadioButton };
+export type SbbRadioButtonGroupEventDetail = {
+ value: any | null;
+ radioButton: SbbRadioButtonElement;
+};
/**
* It can be used as a container for one or more `sbb-radio-button`.
@@ -31,7 +34,7 @@ export type SbbRadioButtonGroupEventDetail = { value: any | null; radioButton: S
* @event {CustomEvent} input - Emits whenever the `sbb-radio-group` value changes.
*/
@customElement('sbb-radio-button-group')
-export class SbbRadioButtonGroup extends LitElement {
+export class SbbRadioButtonGroupElement extends LitElement {
public static override styles: CSSResultGroup = style;
public static readonly events = {
didChange: 'didChange',
@@ -157,7 +160,7 @@ export class SbbRadioButtonGroup extends LitElement {
*/
private _didChange: EventEmitter = new EventEmitter(
this,
- SbbRadioButtonGroup.events.didChange,
+ SbbRadioButtonGroupElement.events.didChange,
);
/**
@@ -165,7 +168,7 @@ export class SbbRadioButtonGroup extends LitElement {
*/
private _change: EventEmitter = new EventEmitter(
this,
- SbbRadioButtonGroup.events.change,
+ SbbRadioButtonGroupElement.events.change,
);
/**
@@ -173,7 +176,7 @@ export class SbbRadioButtonGroup extends LitElement {
*/
private _input: EventEmitter = new EventEmitter(
this,
- SbbRadioButtonGroup.events.input,
+ SbbRadioButtonGroupElement.events.input,
);
private _handlerRepository = new HandlerRepository(
@@ -221,7 +224,7 @@ export class SbbRadioButtonGroup extends LitElement {
return;
}
- const radioButton = event.target as SbbRadioButton;
+ const radioButton = event.target as SbbRadioButtonElement;
if (event.detail.checked) {
this.value = radioButton.value;
@@ -234,7 +237,7 @@ export class SbbRadioButtonGroup extends LitElement {
}
}
- private _emitChange(radioButton: SbbRadioButton, value?: string): void {
+ private _emitChange(radioButton: SbbRadioButtonElement, value?: string): void {
this._change.emit({ value, radioButton });
this._input.emit({ value, radioButton });
this._didChange.emit({ value, radioButton });
@@ -263,13 +266,13 @@ export class SbbRadioButtonGroup extends LitElement {
this._setFocusableRadio();
}
- private get _radioButtons(): SbbRadioButton[] {
+ private get _radioButtons(): SbbRadioButtonElement[] {
return (
- Array.from(this.querySelectorAll?.('sbb-radio-button') ?? []) as SbbRadioButton[]
+ Array.from(this.querySelectorAll?.('sbb-radio-button') ?? []) as SbbRadioButtonElement[]
).filter((el) => el.closest?.('sbb-radio-button-group') === this);
}
- private get _enabledRadios(): SbbRadioButton[] | undefined {
+ private get _enabledRadios(): SbbRadioButtonElement[] | undefined {
if (!this.disabled) {
return this._radioButtons.filter((r) => !r.disabled && interactivityChecker.isVisible(r));
}
@@ -284,12 +287,12 @@ export class SbbRadioButtonGroup extends LitElement {
}
}
- private _getRadioTabIndex(radio: SbbRadioButton): number {
+ private _getRadioTabIndex(radio: SbbRadioButtonElement): number {
return (radio.checked || this._hasSelectionPanel) && !radio.disabled && !this.disabled ? 0 : -1;
}
private _handleKeyDown(evt: KeyboardEvent): void {
- const enabledRadios: SbbRadioButton[] = this._enabledRadios;
+ const enabledRadios: SbbRadioButtonElement[] = this._enabledRadios;
if (
!enabledRadios ||
@@ -310,10 +313,12 @@ export class SbbRadioButtonGroup extends LitElement {
let nextIndex: number;
if (this._hasSelectionPanel) {
- current = enabledRadios.findIndex((e: SbbRadioButton) => e === evt.target);
+ current = enabledRadios.findIndex((e: SbbRadioButtonElement) => e === evt.target);
nextIndex = getNextElementIndex(evt, current, enabledRadios.length);
} else {
- const checked: number = enabledRadios.findIndex((radio: SbbRadioButton) => radio.checked);
+ const checked: number = enabledRadios.findIndex(
+ (radio: SbbRadioButtonElement) => radio.checked,
+ );
nextIndex = getNextElementIndex(evt, checked, enabledRadios.length);
enabledRadios[nextIndex].select();
}
@@ -341,6 +346,6 @@ export class SbbRadioButtonGroup extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-radio-button-group': SbbRadioButtonGroup;
+ 'sbb-radio-button-group': SbbRadioButtonGroupElement;
}
}
diff --git a/src/components/radio-button/radio-button/radio-button.e2e.ts b/src/components/radio-button/radio-button/radio-button.e2e.ts
index 7d041e359f..6e338f6101 100644
--- a/src/components/radio-button/radio-button/radio-button.e2e.ts
+++ b/src/components/radio-button/radio-button/radio-button.e2e.ts
@@ -3,17 +3,17 @@ import { html } from 'lit/static-html.js';
import { waitForCondition, waitForLitRender, EventSpy } from '../../core/testing';
-import { SbbRadioButton } from './radio-button';
+import { SbbRadioButtonElement } from './radio-button';
describe('sbb-radio-button', () => {
- let element: SbbRadioButton;
+ let element: SbbRadioButtonElement;
beforeEach(async () => {
element = await fixture(html`Value label`);
});
it('renders', async () => {
- assert.instanceOf(element, SbbRadioButton);
+ assert.instanceOf(element, SbbRadioButtonElement);
});
it('should not render accessibility label about containing state', async () => {
@@ -22,7 +22,7 @@ describe('sbb-radio-button', () => {
});
it('selects radio on click', async () => {
- const stateChange = new EventSpy(SbbRadioButton.events.stateChange);
+ const stateChange = new EventSpy(SbbRadioButtonElement.events.stateChange);
element.click();
await waitForLitRender(element);
@@ -33,7 +33,7 @@ describe('sbb-radio-button', () => {
});
it('does not deselect radio if already checked', async () => {
- const stateChange = new EventSpy(SbbRadioButton.events.stateChange);
+ const stateChange = new EventSpy(SbbRadioButtonElement.events.stateChange);
element.click();
await waitForLitRender(element);
@@ -49,7 +49,7 @@ describe('sbb-radio-button', () => {
});
it('allows empty selection', async () => {
- const stateChange = new EventSpy(SbbRadioButton.events.stateChange);
+ const stateChange = new EventSpy(SbbRadioButtonElement.events.stateChange);
element.allowEmptySelection = true;
element.click();
diff --git a/src/components/radio-button/radio-button/radio-button.ts b/src/components/radio-button/radio-button/radio-button.ts
index 07fd089ad3..ef7641d59b 100644
--- a/src/components/radio-button/radio-button/radio-button.ts
+++ b/src/components/radio-button/radio-button/radio-button.ts
@@ -19,7 +19,7 @@ import {
SbbStateChange,
} from '../../core/interfaces';
import { AgnosticMutationObserver } from '../../core/observers';
-import type { SbbRadioButtonGroup } from '../radio-button-group';
+import type { SbbRadioButtonGroupElement } from '../radio-button-group';
import style from './radio-button.scss?lit&inline';
@@ -43,7 +43,7 @@ const radioButtonObserverConfig: MutationObserverInit = {
* @slot suffix - Slot used to render additional content after the label (only visible within a `sbb-selection-panel`).
*/
@customElement('sbb-radio-button')
-export class SbbRadioButton extends LitElement {
+export class SbbRadioButtonElement extends LitElement {
public static override styles: CSSResultGroup = style;
public static readonly events = {
stateChange: 'stateChange',
@@ -121,7 +121,7 @@ export class SbbRadioButton extends LitElement {
*/
private _stateChange: EventEmitter = new EventEmitter(
this,
- SbbRadioButton.events.stateChange,
+ SbbRadioButtonElement.events.stateChange,
{ bubbles: true },
);
@@ -131,7 +131,7 @@ export class SbbRadioButton extends LitElement {
*/
private _radioButtonLoaded: EventEmitter = new EventEmitter(
this,
- SbbRadioButton.events.radioButtonLoaded,
+ SbbRadioButtonElement.events.radioButtonLoaded,
{ bubbles: true },
);
@@ -213,7 +213,7 @@ export class SbbRadioButton extends LitElement {
// Set up the initial disabled/required values and start observe attributes changes.
private _setupInitialStateAndAttributeObserver(): void {
- const parentGroup = this.closest('sbb-radio-button-group') as SbbRadioButtonGroup;
+ const parentGroup = this.closest('sbb-radio-button-group') as SbbRadioButtonGroupElement;
if (parentGroup) {
this._requiredFromGroup = parentGroup.required;
this._disabledFromGroup = parentGroup.disabled;
@@ -289,6 +289,6 @@ export class SbbRadioButton extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-radio-button': SbbRadioButton;
+ 'sbb-radio-button': SbbRadioButtonElement;
}
}
diff --git a/src/components/select/select.e2e.ts b/src/components/select/select.e2e.ts
index a1da786cad..2ef49f8988 100644
--- a/src/components/select/select.e2e.ts
+++ b/src/components/select/select.e2e.ts
@@ -3,16 +3,16 @@ import { sendKeys } from '@web/test-runner-commands';
import { html } from 'lit/static-html.js';
import { waitForCondition, waitForLitRender, EventSpy } from '../core/testing';
-import { SbbOption } from '../option';
+import { SbbOptionElement } from '../option';
-import { SbbSelect } from './select';
+import { SbbSelectElement } from './select';
describe('sbb-select', () => {
- let element: SbbSelect,
+ let element: SbbSelectElement,
focusableElement: HTMLElement,
- firstOption: SbbOption,
- secondOption: SbbOption,
- thirdOption: SbbOption,
+ firstOption: SbbOptionElement,
+ secondOption: SbbOptionElement,
+ thirdOption: SbbOptionElement,
displayValue: HTMLElement,
comboBoxElement: HTMLElement;
@@ -38,15 +38,15 @@ describe('sbb-select', () => {
});
it('renders', async () => {
- assert.instanceOf(element, SbbSelect);
- assert.instanceOf(firstOption, SbbOption);
+ assert.instanceOf(element, SbbSelectElement);
+ assert.instanceOf(firstOption, SbbOptionElement);
});
it('opens and closes the dialog', async () => {
- const willOpen = new EventSpy(SbbSelect.events.willOpen);
- const didOpen = new EventSpy(SbbSelect.events.didOpen);
- const willClose = new EventSpy(SbbSelect.events.willClose);
- const didClose = new EventSpy(SbbSelect.events.didClose);
+ const willOpen = new EventSpy(SbbSelectElement.events.willOpen);
+ const didOpen = new EventSpy(SbbSelectElement.events.didOpen);
+ const willClose = new EventSpy(SbbSelectElement.events.willClose);
+ const didClose = new EventSpy(SbbSelectElement.events.didClose);
element.dispatchEvent(new CustomEvent('click'));
await waitForLitRender(element);
await waitForCondition(() => willOpen.events.length === 1);
@@ -158,8 +158,8 @@ describe('sbb-select', () => {
expect(displayValue).to.have.trimmed.text('First');
expect(element.value).to.be.equal('1');
- const willOpen = new EventSpy(SbbSelect.events.willOpen);
- const didOpen = new EventSpy(SbbSelect.events.didOpen);
+ const willOpen = new EventSpy(SbbSelectElement.events.willOpen);
+ const didOpen = new EventSpy(SbbSelectElement.events.didOpen);
element.click();
await waitForCondition(() => willOpen.events.length === 1);
@@ -176,10 +176,10 @@ describe('sbb-select', () => {
expect(secondOption).not.to.have.attribute('active');
expect(secondOption).not.to.have.attribute('selected');
- const selectionChange = new EventSpy(SbbOption.events.selectionChange);
- const optionSelected = new EventSpy(SbbOption.events.optionSelected);
- const willClose = new EventSpy(SbbSelect.events.willClose);
- const didClose = new EventSpy(SbbSelect.events.didClose);
+ const selectionChange = new EventSpy(SbbOptionElement.events.selectionChange);
+ const optionSelected = new EventSpy(SbbOptionElement.events.optionSelected);
+ const willClose = new EventSpy(SbbSelectElement.events.willClose);
+ const didClose = new EventSpy(SbbSelectElement.events.didClose);
secondOption.click();
await waitForLitRender(element);
@@ -202,8 +202,8 @@ describe('sbb-select', () => {
element.setAttribute('multiple', '');
await waitForLitRender(element);
- const willOpen = new EventSpy(SbbSelect.events.willOpen);
- const didOpen = new EventSpy(SbbSelect.events.didOpen);
+ const willOpen = new EventSpy(SbbSelectElement.events.willOpen);
+ const didOpen = new EventSpy(SbbSelectElement.events.didOpen);
element.dispatchEvent(new CustomEvent('click'));
await waitForCondition(() => willOpen.events.length === 1);
@@ -216,7 +216,7 @@ describe('sbb-select', () => {
expect(secondOption).not.to.have.attribute('active');
expect(secondOption).not.to.have.attribute('selected');
- const selectionChange = new EventSpy(SbbOption.events.selectionChange);
+ const selectionChange = new EventSpy(SbbOptionElement.events.selectionChange);
firstOption.dispatchEvent(new CustomEvent('click'));
await waitForLitRender(element);
expect(selectionChange.count).to.be.equal(1);
@@ -241,8 +241,8 @@ describe('sbb-select', () => {
});
it('handles keypress on host', async () => {
- const didOpen = new EventSpy(SbbSelect.events.didOpen);
- const didClose = new EventSpy(SbbSelect.events.didClose);
+ const didOpen = new EventSpy(SbbSelectElement.events.didOpen);
+ const didClose = new EventSpy(SbbSelectElement.events.didClose);
focusableElement.focus();
await sendKeys({ press: 'Enter' });
@@ -284,7 +284,7 @@ describe('sbb-select', () => {
});
it('handles keyboard selection', async () => {
- const didOpen = new EventSpy(SbbSelect.events.didOpen);
+ const didOpen = new EventSpy(SbbSelectElement.events.didOpen);
focusableElement.focus();
await sendKeys({ press: ' ' });
await waitForCondition(() => didOpen.events.length === 1);
@@ -325,8 +325,8 @@ describe('sbb-select', () => {
element.setAttribute('multiple', '');
await waitForLitRender(element);
- const didOpen = new EventSpy(SbbSelect.events.didOpen);
- const didClose = new EventSpy(SbbSelect.events.didClose);
+ const didOpen = new EventSpy(SbbSelectElement.events.didOpen);
+ const didClose = new EventSpy(SbbSelectElement.events.didClose);
focusableElement.focus();
await sendKeys({ press: 'ArrowUp' });
await waitForCondition(() => didOpen.events.length === 1);
diff --git a/src/components/select/select.stories.ts b/src/components/select/select.stories.ts
index cdf8d183d4..117560f2bb 100644
--- a/src/components/select/select.stories.ts
+++ b/src/components/select/select.stories.ts
@@ -16,11 +16,11 @@ import { styleMap, StyleInfo } from 'lit/directives/style-map.js';
import { waitForComponentsReady } from '../../storybook/testing/wait-for-components-ready';
import { waitForStablePosition } from '../../storybook/testing/wait-for-stable-position';
import { sbbSpread } from '../core/dom';
-import type { SbbFormError } from '../form-error';
-import { SbbOption } from '../option';
+import type { SbbFormErrorElement } from '../form-error';
+import { SbbOptionElement } from '../option';
import readme from './readme.md?raw';
-import { SbbSelect } from './select';
+import { SbbSelectElement } from './select';
import '../form-error';
import '../form-field';
@@ -375,7 +375,7 @@ const FormFieldTemplateWithError = ({
if (args.multiple && args.value) {
args.value = [args.value];
}
- const sbbFormError: SbbFormError = document.createElement('sbb-form-error');
+ const sbbFormError: SbbFormErrorElement = document.createElement('sbb-form-error');
sbbFormError.textContent = 'Error';
return html`
@@ -639,12 +639,12 @@ const meta: Meta = {
chromatic: { disableSnapshot: false },
actions: {
handles: [
- SbbSelect.events.change,
- SbbSelect.events.didClose,
- SbbSelect.events.didOpen,
- SbbSelect.events.willClose,
- SbbSelect.events.willOpen,
- SbbOption.events.optionSelected,
+ SbbSelectElement.events.change,
+ SbbSelectElement.events.didClose,
+ SbbSelectElement.events.didOpen,
+ SbbSelectElement.events.willClose,
+ SbbSelectElement.events.willOpen,
+ SbbOptionElement.events.optionSelected,
],
},
backgrounds: {
diff --git a/src/components/select/select.ts b/src/components/select/select.ts
index d33b659385..649a91ad23 100644
--- a/src/components/select/select.ts
+++ b/src/components/select/select.ts
@@ -19,7 +19,7 @@ import {
overlayGapFixCorners,
SbbOverlayState,
} from '../core/overlay';
-import type { SbbOption, SbbOptGroup } from '../option';
+import type { SbbOptionElement, SbbOptGroupElement } from '../option';
import style from './select.scss?lit&inline';
@@ -43,7 +43,7 @@ export interface SelectChange {
* @event {CustomEvent} didClose - Emits whenever the `sbb-select` is closed.
*/
@customElement('sbb-select')
-export class SbbSelect extends UpdateScheduler(LitElement) {
+export class SbbSelectElement extends UpdateScheduler(LitElement) {
public static override styles: CSSResultGroup = style;
public static readonly events = {
didChange: 'didChange',
@@ -90,34 +90,37 @@ export class SbbSelect extends UpdateScheduler(LitElement) {
/**
* @deprecated only used for React. Will probably be removed once React 19 is available.
*/
- private _didChange: EventEmitter = new EventEmitter(this, SbbSelect.events.didChange);
+ private _didChange: EventEmitter = new EventEmitter(this, SbbSelectElement.events.didChange);
/** Notifies that the component's value has changed. */
- private _change: EventEmitter = new EventEmitter(this, SbbSelect.events.change);
+ private _change: EventEmitter = new EventEmitter(this, SbbSelectElement.events.change);
/** Notifies that an option value has been selected. */
- private _input: EventEmitter = new EventEmitter(this, SbbSelect.events.input);
+ private _input: EventEmitter = new EventEmitter(this, SbbSelectElement.events.input);
/** @internal */
private _stateChange: EventEmitter = new EventEmitter(
this,
- SbbSelect.events.stateChange,
+ SbbSelectElement.events.stateChange,
{
composed: false,
},
);
/** Emits whenever the `sbb-select` starts the opening transition. */
- private _willOpen: EventEmitter = new EventEmitter(this, SbbSelect.events.willOpen);
+ private _willOpen: EventEmitter = new EventEmitter(this, SbbSelectElement.events.willOpen);
/** Emits whenever the `sbb-select` is opened. */
- private _didOpen: EventEmitter = new EventEmitter(this, SbbSelect.events.didOpen);
+ private _didOpen: EventEmitter = new EventEmitter(this, SbbSelectElement.events.didOpen);
/** Emits whenever the `sbb-select` begins the closing transition. */
- private _willClose: EventEmitter = new EventEmitter(this, SbbSelect.events.willClose);
+ private _willClose: EventEmitter = new EventEmitter(
+ this,
+ SbbSelectElement.events.willClose,
+ );
/** Emits whenever the `sbb-select` is closed. */
- private _didClose: EventEmitter = new EventEmitter(this, SbbSelect.events.didClose);
+ private _didClose: EventEmitter = new EventEmitter(this, SbbSelectElement.events.didClose);
private _overlay: HTMLElement;
private _optionContainer: HTMLElement;
@@ -146,14 +149,14 @@ export class SbbSelect extends UpdateScheduler(LitElement) {
return this._triggerElement;
}
- /** Gets all the SbbOption projected in the select. */
- private get _options(): SbbOption[] {
+ /** Gets all the SbbOptionElement projected in the select. */
+ private get _options(): SbbOptionElement[] {
return Array.from(this.querySelectorAll?.('sbb-option') ?? []);
}
- private get _filteredOptions(): SbbOption[] {
+ private get _filteredOptions(): SbbOptionElement[] {
return this._options.filter(
- (opt: SbbOption) => !opt.disabled && !isValidAttribute(opt, 'data-group-disabled'),
+ (opt: SbbOptionElement) => !opt.disabled && !isValidAttribute(opt, 'data-group-disabled'),
);
}
@@ -186,7 +189,7 @@ export class SbbSelect extends UpdateScheduler(LitElement) {
/** Listens to option changes. */
private _onOptionChanged(event: Event): void {
- const target = event.target as SbbOption;
+ const target = event.target as SbbOptionElement;
if (target.selected) {
this._onOptionSelected(target);
} else {
@@ -303,7 +306,8 @@ export class SbbSelect extends UpdateScheduler(LitElement) {
this.querySelectorAll?.('sbb-divider').forEach((element) => (element.negative = this.negative));
this.querySelectorAll?.('sbb-option, sbb-optgroup').forEach(
- (element: SbbOption | SbbOptGroup) => toggleDatasetEntry(element, 'negative', this.negative),
+ (element: SbbOptionElement | SbbOptGroupElement) =>
+ toggleDatasetEntry(element, 'negative', this.negative),
);
}
@@ -374,7 +378,7 @@ export class SbbSelect extends UpdateScheduler(LitElement) {
}
/** When an option is selected, updates the displayValue; it also closes the select if not `multiple`. */
- private _onOptionSelected(optionSelectionChange: SbbOption): void {
+ private _onOptionSelected(optionSelectionChange: SbbOptionElement): void {
if (!this.multiple) {
this._filteredOptions
.filter((option) => option.id !== optionSelectionChange.id)
@@ -394,7 +398,7 @@ export class SbbSelect extends UpdateScheduler(LitElement) {
}
/** When an option is unselected in `multiple`, removes it from value and updates displayValue. */
- private _onOptionDeselected(optionSelectionChange: SbbOption): void {
+ private _onOptionDeselected(optionSelectionChange: SbbOptionElement): void {
if (this.multiple) {
this.value = (this.value as string[]).filter(
(el: string) => el !== optionSelectionChange.value,
@@ -520,13 +524,13 @@ export class SbbSelect extends UpdateScheduler(LitElement) {
// Reorder the _filteredOption array to have the last selected element at the bottom.
const indexForSlice: number = this._activeItemIndex + 1;
- const filteredOptionsSorted: SbbOption[] = [
+ const filteredOptionsSorted: SbbOptionElement[] = [
...this._filteredOptions.slice(indexForSlice),
...this._filteredOptions.slice(0, indexForSlice),
];
- const match: SbbOption = filteredOptionsSorted.find(
- (option: SbbOption) =>
+ const match: SbbOptionElement = filteredOptionsSorted.find(
+ (option: SbbOptionElement) =>
option.textContent.toLowerCase().indexOf(this._searchString.toLowerCase()) === 0,
);
if (match) {
@@ -538,8 +542,8 @@ export class SbbSelect extends UpdateScheduler(LitElement) {
) {
// If no exact match has been found but the string to search is made by the same repeated letter,
// go to the first element, if exists, that matches the letter.
- const firstMatch: SbbOption = filteredOptionsSorted.find(
- (option: SbbOption) =>
+ const firstMatch: SbbOptionElement = filteredOptionsSorted.find(
+ (option: SbbOptionElement) =>
option.textContent.toLowerCase().indexOf(this._searchString[0].toLowerCase()) === 0,
);
if (firstMatch) {
@@ -553,7 +557,7 @@ export class SbbSelect extends UpdateScheduler(LitElement) {
}
private async _selectByKeyboard(): Promise {
- const activeOption: SbbOption = this._filteredOptions[this._activeItemIndex];
+ const activeOption: SbbOptionElement = this._filteredOptions[this._activeItemIndex];
if (this.multiple) {
await activeOption.setSelectedViaUserInteraction(!activeOption.selected);
@@ -579,8 +583,8 @@ export class SbbSelect extends UpdateScheduler(LitElement) {
}
private _setActiveElement(
- nextActiveOption: SbbOption,
- lastActiveOption: SbbOption = null,
+ nextActiveOption: SbbOptionElement,
+ lastActiveOption: SbbOptionElement = null,
setActiveDescendant = true,
): void {
nextActiveOption.active = true;
@@ -597,8 +601,8 @@ export class SbbSelect extends UpdateScheduler(LitElement) {
}
private async _setSelectedElement(
- nextActiveOption: SbbOption,
- lastActiveOption: SbbOption,
+ nextActiveOption: SbbOptionElement,
+ lastActiveOption: SbbOptionElement,
): Promise {
await nextActiveOption.setSelectedViaUserInteraction(true);
@@ -732,6 +736,6 @@ export class SbbSelect extends UpdateScheduler(LitElement) {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-select': SbbSelect;
+ 'sbb-select': SbbSelectElement;
}
}
diff --git a/src/components/selection-panel/selection-panel.e2e.ts b/src/components/selection-panel/selection-panel.e2e.ts
index b108f02ebc..e55b5f51cb 100644
--- a/src/components/selection-panel/selection-panel.e2e.ts
+++ b/src/components/selection-panel/selection-panel.e2e.ts
@@ -3,15 +3,15 @@ import { sendKeys } from '@web/test-runner-commands';
import { TemplateResult } from 'lit';
import { html, unsafeStatic } from 'lit/static-html.js';
-import { SbbCheckbox, SbbCheckboxGroup } from '../checkbox';
+import { SbbCheckboxElement, SbbCheckboxGroupElement } from '../checkbox';
import { EventSpy, waitForCondition, waitForLitRender } from '../core/testing';
-import { SbbRadioButton, SbbRadioButtonGroup } from '../radio-button';
+import { SbbRadioButtonElement, SbbRadioButtonGroupElement } from '../radio-button';
-import { SbbSelectionPanel } from './selection-panel';
+import { SbbSelectionPanelElement } from './selection-panel';
import '../link';
describe('sbb-selection-panel', () => {
- let elements: SbbSelectionPanel[];
+ let elements: SbbSelectionPanelElement[];
const getPageContent = (inputType: string): TemplateResult => {
const tagGroupElement = unsafeStatic(`sbb-${inputType}-group`);
@@ -110,14 +110,14 @@ describe('sbb-selection-panel', () => {
};
describe('with radio buttons', () => {
- let wrapper: SbbRadioButtonGroup;
- let firstPanel: SbbSelectionPanel;
- let firstInput: SbbRadioButton;
+ let wrapper: SbbRadioButtonGroupElement;
+ let firstPanel: SbbSelectionPanelElement;
+ let firstInput: SbbRadioButtonElement;
let firstContent: HTMLDivElement;
- let secondPanel: SbbSelectionPanel;
- let secondInput: SbbRadioButton;
+ let secondPanel: SbbSelectionPanelElement;
+ let secondInput: SbbRadioButtonElement;
let secondContent: HTMLDivElement;
- let disabledInput: SbbRadioButton;
+ let disabledInput: SbbRadioButtonElement;
beforeEach(async () => {
await fixture(getPageContent('radio-button'));
@@ -135,17 +135,17 @@ describe('sbb-selection-panel', () => {
});
it('renders', () => {
- elements.forEach((e) => assert.instanceOf(e, SbbSelectionPanel));
+ elements.forEach((e) => assert.instanceOf(e, SbbSelectionPanelElement));
});
it('selects input on click and shows related content', async () => {
- assert.instanceOf(firstPanel, SbbSelectionPanel);
- assert.instanceOf(firstInput, SbbRadioButton);
+ assert.instanceOf(firstPanel, SbbSelectionPanelElement);
+ assert.instanceOf(firstInput, SbbRadioButtonElement);
expect(firstInput).not.to.have.attribute('checked');
expect(firstContent).not.to.have.attribute('data-expanded');
- assert.instanceOf(secondPanel, SbbSelectionPanel);
- assert.instanceOf(secondInput, SbbRadioButton);
+ assert.instanceOf(secondPanel, SbbSelectionPanelElement);
+ assert.instanceOf(secondInput, SbbRadioButtonElement);
expect(secondInput).not.to.have.attribute('checked');
expect(secondContent).not.to.have.attribute('data-expanded');
@@ -197,7 +197,7 @@ describe('sbb-selection-panel', () => {
});
it('focuses input on left arrow key pressed and selects it on space key pressed', async () => {
- const fourthInput: SbbRadioButton = document.querySelector('#sbb-input-4');
+ const fourthInput: SbbRadioButtonElement = document.querySelector('#sbb-input-4');
firstInput.click();
firstInput.focus();
@@ -232,7 +232,7 @@ describe('sbb-selection-panel', () => {
});
describe('with nested radio buttons', () => {
- let nestedElement: SbbRadioButtonGroup;
+ let nestedElement: SbbRadioButtonGroupElement;
beforeEach(async () => {
nestedElement = await fixture(html`
@@ -257,13 +257,13 @@ describe('sbb-selection-panel', () => {
});
it('should display expanded label correctly', async () => {
- const mainRadioButton1: SbbRadioButton = document.querySelector(
+ const mainRadioButton1: SbbRadioButtonElement = document.querySelector(
"sbb-radio-button[value='main1']",
);
const mainRadioButton1Label = mainRadioButton1.shadowRoot.querySelector(
'.sbb-radio-button__expanded-label',
);
- const mainRadioButton2: SbbRadioButton = document.querySelector(
+ const mainRadioButton2: SbbRadioButtonElement = document.querySelector(
"sbb-radio-button[value='main2']",
);
const mainRadioButton2Label = mainRadioButton2.shadowRoot.querySelector(
@@ -291,7 +291,7 @@ describe('sbb-selection-panel', () => {
nestedElement.setAttribute('disabled', '');
await waitForLitRender(nestedElement);
- const radioButtons: SbbRadioButton[] = Array.from(
+ const radioButtons: SbbRadioButtonElement[] = Array.from(
document.querySelectorAll('sbb-radio-button'),
);
@@ -305,9 +305,13 @@ describe('sbb-selection-panel', () => {
});
it('should not with interfere content on selection', async () => {
- const main1: SbbRadioButton = document.querySelector('sbb-radio-button[value="main1"]');
- const main2: SbbRadioButton = document.querySelector('sbb-radio-button[value="main2"]');
- const sub1: SbbRadioButton = document.querySelector('sbb-radio-button[value="sub1"]');
+ const main1: SbbRadioButtonElement = document.querySelector(
+ 'sbb-radio-button[value="main1"]',
+ );
+ const main2: SbbRadioButtonElement = document.querySelector(
+ 'sbb-radio-button[value="main2"]',
+ );
+ const sub1: SbbRadioButtonElement = document.querySelector('sbb-radio-button[value="sub1"]');
expect(main1).to.have.attribute('checked');
expect(main2).not.to.have.attribute('checked');
@@ -369,14 +373,14 @@ describe('sbb-selection-panel', () => {
});
describe('with checkboxes', () => {
- let wrapper: SbbCheckboxGroup;
- let firstPanel: SbbSelectionPanel;
- let firstInput: SbbCheckbox;
+ let wrapper: SbbCheckboxGroupElement;
+ let firstPanel: SbbSelectionPanelElement;
+ let firstInput: SbbCheckboxElement;
let firstContent: HTMLDivElement;
- let secondPanel: SbbSelectionPanel;
- let secondInput: SbbCheckbox;
+ let secondPanel: SbbSelectionPanelElement;
+ let secondInput: SbbCheckboxElement;
let secondContent: HTMLDivElement;
- let disabledInput: SbbCheckbox;
+ let disabledInput: SbbCheckboxElement;
beforeEach(async () => {
await fixture(getPageContent('checkbox'));
@@ -394,17 +398,17 @@ describe('sbb-selection-panel', () => {
});
it('renders', () => {
- elements.forEach((e) => assert.instanceOf(e, SbbSelectionPanel));
+ elements.forEach((e) => assert.instanceOf(e, SbbSelectionPanelElement));
});
it('selects input on click and shows related content', async () => {
- assert.instanceOf(firstPanel, SbbSelectionPanel);
- assert.instanceOf(firstInput, SbbCheckbox);
+ assert.instanceOf(firstPanel, SbbSelectionPanelElement);
+ assert.instanceOf(firstInput, SbbCheckboxElement);
expect(firstInput).to.have.attribute('checked');
expect(firstContent).to.have.attribute('data-expanded', '');
- assert.instanceOf(secondPanel, SbbSelectionPanel);
- assert.instanceOf(secondInput, SbbCheckbox);
+ assert.instanceOf(secondPanel, SbbSelectionPanelElement);
+ assert.instanceOf(secondInput, SbbCheckboxElement);
expect(secondInput).not.to.have.attribute('checked');
expect(secondContent).not.to.have.attribute('data-expanded');
@@ -461,7 +465,7 @@ describe('sbb-selection-panel', () => {
});
it('focuses input on left arrow key pressed and selects it on space key pressed', async () => {
- const fourthInput: SbbRadioButton = document.querySelector('#sbb-input-4');
+ const fourthInput: SbbRadioButtonElement = document.querySelector('#sbb-input-4');
firstInput.click();
firstInput.focus();
@@ -500,7 +504,7 @@ describe('sbb-selection-panel', () => {
});
describe('with nested checkboxes', () => {
- let nestedElement: SbbCheckboxGroup;
+ let nestedElement: SbbCheckboxGroupElement;
beforeEach(async () => {
nestedElement = await fixture(html`
@@ -525,11 +529,15 @@ describe('sbb-selection-panel', () => {
});
it('should display expanded label correctly', async () => {
- const mainCheckbox1: SbbCheckbox = document.querySelector("sbb-checkbox[value='main1']");
+ const mainCheckbox1: SbbCheckboxElement = document.querySelector(
+ "sbb-checkbox[value='main1']",
+ );
const mainCheckbox1Label = mainCheckbox1.shadowRoot.querySelector(
'.sbb-checkbox__expanded-label',
);
- const mainCheckbox2: SbbCheckbox = document.querySelector("sbb-checkbox[value='main2']");
+ const mainCheckbox2: SbbCheckboxElement = document.querySelector(
+ "sbb-checkbox[value='main2']",
+ );
const mainCheckbox2Label = mainCheckbox2.shadowRoot.querySelector(
'.sbb-checkbox__expanded-label',
);
@@ -558,7 +566,9 @@ describe('sbb-selection-panel', () => {
nestedElement.setAttribute('disabled', '');
await waitForLitRender(nestedElement);
- const checkboxes: SbbCheckbox[] = Array.from(document.querySelectorAll('sbb-checkbox'));
+ const checkboxes: SbbCheckboxElement[] = Array.from(
+ document.querySelectorAll('sbb-checkbox'),
+ );
expect(checkboxes.length).to.be.equal(6);
expect(checkboxes[0]).to.have.attribute('data-group-disabled');
diff --git a/src/components/selection-panel/selection-panel.stories.ts b/src/components/selection-panel/selection-panel.stories.ts
index eb40a205f7..fb0e370572 100644
--- a/src/components/selection-panel/selection-panel.stories.ts
+++ b/src/components/selection-panel/selection-panel.stories.ts
@@ -6,10 +6,10 @@ import { html, TemplateResult } from 'lit';
import { styleMap, StyleInfo } from 'lit/directives/style-map.js';
import { sbbSpread } from '../core/dom';
-import type { SbbFormError } from '../form-error';
+import type { SbbFormErrorElement } from '../form-error';
import readme from './readme.md?raw';
-import { SbbSelectionPanel } from './selection-panel';
+import { SbbSelectionPanelElement } from './selection-panel';
import '../card';
import '../checkbox';
import '../divider';
@@ -359,7 +359,7 @@ const WithCheckboxesErrorMessageTemplate = ({
disabledInput,
...args
}: Args): TemplateResult => {
- const sbbFormError: SbbFormError = document.createElement('sbb-form-error');
+ const sbbFormError: SbbFormErrorElement = document.createElement('sbb-form-error');
sbbFormError.setAttribute('slot', 'error');
sbbFormError.textContent = 'This is a required field.';
@@ -406,7 +406,7 @@ const WithRadiosErrorMessageTemplate = ({
disabledInput,
...args
}: Args): TemplateResult => {
- const sbbFormError: SbbFormError = document.createElement('sbb-form-error');
+ const sbbFormError: SbbFormErrorElement = document.createElement('sbb-form-error');
sbbFormError.setAttribute('slot', 'error');
sbbFormError.textContent = 'This is a required field.';
@@ -692,10 +692,10 @@ const meta: Meta = {
chromatic: { delay: 3000 },
actions: {
handles: [
- SbbSelectionPanel.events.didOpen,
- SbbSelectionPanel.events.didClose,
- SbbSelectionPanel.events.willOpen,
- SbbSelectionPanel.events.willClose,
+ SbbSelectionPanelElement.events.didOpen,
+ SbbSelectionPanelElement.events.didClose,
+ SbbSelectionPanelElement.events.willOpen,
+ SbbSelectionPanelElement.events.willClose,
],
},
backgrounds: {
diff --git a/src/components/selection-panel/selection-panel.ts b/src/components/selection-panel/selection-panel.ts
index b21ff89e8b..7151bda350 100644
--- a/src/components/selection-panel/selection-panel.ts
+++ b/src/components/selection-panel/selection-panel.ts
@@ -2,7 +2,7 @@ import { CSSResultGroup, html, LitElement, nothing, TemplateResult } from 'lit';
import { customElement, property, state } from 'lit/decorators.js';
import { ref } from 'lit/directives/ref.js';
-import type { SbbCheckbox, SbbCheckboxStateChange } from '../checkbox';
+import type { SbbCheckboxElement, SbbCheckboxStateChange } from '../checkbox';
import { setAttribute } from '../core/dom';
import {
createNamedSlotState,
@@ -11,7 +11,7 @@ import {
EventEmitter,
ConnectedAbortController,
} from '../core/eventing';
-import type { SbbRadioButton, SbbRadioButtonStateChange } from '../radio-button';
+import type { SbbRadioButtonElement, SbbRadioButtonStateChange } from '../radio-button';
import style from './selection-panel.scss?lit&inline';
import '../divider';
@@ -28,7 +28,7 @@ import '../divider';
* @event {CustomEvent<{ closeTarget: HTMLElement }>} didClose - Emits whenever the content section is closed.
*/
@customElement('sbb-selection-panel')
-export class SbbSelectionPanel extends LitElement {
+export class SbbSelectionPanelElement extends LitElement {
public static override styles: CSSResultGroup = style;
public static readonly events: Record = {
willOpen: 'willOpen',
@@ -65,7 +65,7 @@ export class SbbSelectionPanel extends LitElement {
/** Emits whenever the content section starts the opening transition. */
private _willOpen: EventEmitter = new EventEmitter(
this,
- SbbSelectionPanel.events.willOpen,
+ SbbSelectionPanelElement.events.willOpen,
{
bubbles: true,
composed: true,
@@ -73,22 +73,26 @@ export class SbbSelectionPanel extends LitElement {
);
/** Emits whenever the content section is opened. */
- private _didOpen: EventEmitter = new EventEmitter(this, SbbSelectionPanel.events.didOpen, {
- bubbles: true,
- composed: true,
- });
+ private _didOpen: EventEmitter = new EventEmitter(
+ this,
+ SbbSelectionPanelElement.events.didOpen,
+ {
+ bubbles: true,
+ composed: true,
+ },
+ );
/** Emits whenever the content section begins the closing transition. */
private _willClose: EventEmitter<{ closeTarget: HTMLElement }> = new EventEmitter(
this,
- SbbSelectionPanel.events.willClose,
+ SbbSelectionPanelElement.events.willClose,
{ bubbles: true, composed: true },
);
/** Emits whenever the content section is closed. */
private _didClose: EventEmitter<{ closeTarget: HTMLElement }> = new EventEmitter(
this,
- SbbSelectionPanel.events.didClose,
+ SbbSelectionPanelElement.events.didClose,
{ bubbles: true, composed: true },
);
@@ -101,8 +105,10 @@ export class SbbSelectionPanel extends LitElement {
private _didLoad = false;
private _abort = new ConnectedAbortController(this);
- private get _input(): SbbCheckbox | SbbRadioButton {
- return this.querySelector('sbb-checkbox, sbb-radio-button') as SbbCheckbox | SbbRadioButton;
+ private get _input(): SbbCheckboxElement | SbbRadioButtonElement {
+ return this.querySelector('sbb-checkbox, sbb-radio-button') as
+ | SbbCheckboxElement
+ | SbbRadioButtonElement;
}
private _onInputChange(
@@ -230,6 +236,6 @@ export class SbbSelectionPanel extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-selection-panel': SbbSelectionPanel;
+ 'sbb-selection-panel': SbbSelectionPanelElement;
}
}
diff --git a/src/components/signet/signet.ts b/src/components/signet/signet.ts
index e62ca4eca8..1729eeca01 100644
--- a/src/components/signet/signet.ts
+++ b/src/components/signet/signet.ts
@@ -9,7 +9,7 @@ import style from './signet.scss?lit&inline';
* It displays the SBB signet.
*/
@customElement('sbb-signet')
-export class SbbSignet extends LitElement {
+export class SbbSignetElement extends LitElement {
public static override styles: CSSResultGroup = style;
/** Visual protective room around signet. */
@@ -39,6 +39,6 @@ export class SbbSignet extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-signet': SbbSignet;
+ 'sbb-signet': SbbSignetElement;
}
}
diff --git a/src/components/skiplink-list/skiplink-list.e2e.ts b/src/components/skiplink-list/skiplink-list.e2e.ts
index c9ac402585..dfde7d3922 100644
--- a/src/components/skiplink-list/skiplink-list.e2e.ts
+++ b/src/components/skiplink-list/skiplink-list.e2e.ts
@@ -2,14 +2,14 @@ import { assert, expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
import { waitForLitRender } from '../core/testing';
-import type { SbbLink } from '../link';
+import type { SbbLinkElement } from '../link';
-import { SbbSkiplinkList } from './skiplink-list';
+import { SbbSkiplinkListElement } from './skiplink-list';
import '../link';
describe('sbb-skiplink-list', () => {
- let element: SbbSkiplinkList;
+ let element: SbbSkiplinkListElement;
beforeEach(async () => {
element = await fixture(html`
@@ -23,7 +23,7 @@ describe('sbb-skiplink-list', () => {
});
it('renders', async () => {
- assert.instanceOf(element, SbbSkiplinkList);
+ assert.instanceOf(element, SbbSkiplinkListElement);
});
it('should be visible on focus', async () => {
@@ -33,12 +33,12 @@ describe('sbb-skiplink-list', () => {
expect(listItemLinks[0]).to.have.style('height', '0px');
expect(listItemLinks[0]).to.have.style('overflow', 'hidden');
- const firstLink: SbbLink = element.querySelector('#sbb-skiplink-list-link-0');
+ const firstLink: SbbLinkElement = element.querySelector('#sbb-skiplink-list-link-0');
firstLink.focus();
expect(listItemLinks[0]).not.to.have.style('height', '0px');
expect(listItemLinks[0]).to.have.style('overflow', 'visible');
- const secondLink: SbbLink = element.querySelector('#sbb-skiplink-list-link-1');
+ const secondLink: SbbLinkElement = element.querySelector('#sbb-skiplink-list-link-1');
secondLink.focus();
expect(listItemLinks[0]).to.have.style('height', '0px');
expect(listItemLinks[0]).to.have.style('overflow', 'hidden');
diff --git a/src/components/skiplink-list/skiplink-list.ts b/src/components/skiplink-list/skiplink-list.ts
index 47736c6009..152751706c 100644
--- a/src/components/skiplink-list/skiplink-list.ts
+++ b/src/components/skiplink-list/skiplink-list.ts
@@ -9,7 +9,7 @@ import {
HandlerRepository,
namedSlotChangeHandlerAspect,
} from '../core/eventing';
-import type { SbbLink } from '../link';
+import type { SbbLinkElement } from '../link';
import type { TitleLevel } from '../title';
import style from './skiplink-list.scss?lit&inline';
@@ -22,7 +22,7 @@ import '../title';
* @slot - Use the unnamed slot to add `sbb-link` elements to the `sbb-skiplink-list`.
*/
@customElement('sbb-skiplink-list')
-export class SbbSkiplinkList extends SlotChildObserver(LitElement) {
+export class SbbSkiplinkListElement extends SlotChildObserver(LitElement) {
public static override styles: CSSResultGroup = style;
/** The title text we want to place before the list. */
@@ -32,13 +32,13 @@ export class SbbSkiplinkList extends SlotChildObserver(LitElement) {
@property({ attribute: 'title-level' }) public titleLevel?: TitleLevel = '2';
/** sbb-link elements */
- @state() private _links: SbbLink[] = [];
+ @state() private _links: SbbLinkElement[] = [];
/** State of listed named slots, by indicating whether any element for a named slot is defined. */
@state() private _namedSlots = createNamedSlotState('title');
private _syncLinks(): void {
- this.querySelectorAll?.('sbb-link').forEach((link: SbbLink) => {
+ this.querySelectorAll?.('sbb-link').forEach((link: SbbLinkElement) => {
link.size = 'm';
link.negative = true;
});
@@ -51,7 +51,9 @@ export class SbbSkiplinkList extends SlotChildObserver(LitElement) {
/** Create an array with only the sbb-link children. */
protected override checkChildren(): void {
- const links = Array.from(this.children).filter((e): e is SbbLink => e.tagName === 'SBB-LINK');
+ const links = Array.from(this.children).filter(
+ (e): e is SbbLinkElement => e.tagName === 'SBB-LINK',
+ );
// Update links list
if (
this._links &&
@@ -118,6 +120,6 @@ export class SbbSkiplinkList extends SlotChildObserver(LitElement) {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-skiplink-list': SbbSkiplinkList;
+ 'sbb-skiplink-list': SbbSkiplinkListElement;
}
}
diff --git a/src/components/slider/slider.e2e.ts b/src/components/slider/slider.e2e.ts
index 049312d470..ef3d52c232 100644
--- a/src/components/slider/slider.e2e.ts
+++ b/src/components/slider/slider.e2e.ts
@@ -4,9 +4,13 @@ import { html } from 'lit/static-html.js';
import { EventSpy, waitForLitRender } from '../core/testing';
-import { SbbSlider } from './slider';
+import { SbbSliderElement } from './slider';
-const keyboardPressTimes = async (slider: SbbSlider, key: string, times = 1): Promise => {
+const keyboardPressTimes = async (
+ slider: SbbSliderElement,
+ key: string,
+ times = 1,
+): Promise => {
slider.focus();
for (let i = 0; i < times; i++) {
await sendKeys({ press: key });
@@ -15,7 +19,7 @@ const keyboardPressTimes = async (slider: SbbSlider, key: string, times = 1): Pr
};
describe('sbb-slider', () => {
- let element: SbbSlider;
+ let element: SbbSliderElement;
beforeEach(async () => {
element = await fixture(html`
@@ -30,7 +34,7 @@ describe('sbb-slider', () => {
});
it('renders', async () => {
- assert.instanceOf(element, SbbSlider);
+ assert.instanceOf(element, SbbSliderElement);
});
it('should decrease value by two on left arrow keypress', async () => {
diff --git a/src/components/slider/slider.ts b/src/components/slider/slider.ts
index ec299a2489..2321924539 100644
--- a/src/components/slider/slider.ts
+++ b/src/components/slider/slider.ts
@@ -18,7 +18,7 @@ import '../icon';
* @event {CustomEvent} didChange - Deprecated. used for React. Will probably be removed once React 19 is available.
*/
@customElement('sbb-slider')
-export class SbbSlider extends LitElement {
+export class SbbSliderElement extends LitElement {
public static override styles: CSSResultGroup = style;
public static readonly events = {
didChange: 'didChange',
@@ -66,7 +66,7 @@ export class SbbSlider extends LitElement {
/**
* @deprecated only used for React. Will probably be removed once React 19 is available.
*/
- private _didChange: EventEmitter = new EventEmitter(this, SbbSlider.events.didChange, {
+ private _didChange: EventEmitter = new EventEmitter(this, SbbSliderElement.events.didChange, {
bubbles: true,
cancelable: true,
});
@@ -224,6 +224,6 @@ export class SbbSlider extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-slider': SbbSlider;
+ 'sbb-slider': SbbSliderElement;
}
}
diff --git a/src/components/tabs/tab-group/tab-group.e2e.ts b/src/components/tabs/tab-group/tab-group.e2e.ts
index ba3ccfd393..a00d8b74c2 100644
--- a/src/components/tabs/tab-group/tab-group.e2e.ts
+++ b/src/components/tabs/tab-group/tab-group.e2e.ts
@@ -3,12 +3,12 @@ import { sendKeys } from '@web/test-runner-commands';
import { html } from 'lit/static-html.js';
import { EventSpy, waitForCondition } from '../../core/testing';
-import { SbbTabTitle } from '../tab-title';
+import { SbbTabTitleElement } from '../tab-title';
-import { SbbTabGroup } from './tab-group';
+import { SbbTabGroupElement } from './tab-group';
describe('sbb-tab-group', () => {
- let element: SbbTabGroup;
+ let element: SbbTabGroupElement;
beforeEach(async () => {
element = await fixture(
@@ -25,7 +25,7 @@ describe('sbb-tab-group', () => {
});
it('renders', () => {
- assert.instanceOf(element, SbbTabGroup);
+ assert.instanceOf(element, SbbTabGroupElement);
});
it('renders tab content', async () => {
@@ -48,15 +48,19 @@ describe('sbb-tab-group', () => {
describe('events', () => {
it('selects tab on click', async () => {
- const tab = document.querySelector('sbb-tab-group > sbb-tab-title#sbb-tab-1') as SbbTabTitle;
+ const tab = document.querySelector(
+ 'sbb-tab-group > sbb-tab-title#sbb-tab-1',
+ ) as SbbTabTitleElement;
tab.click();
expect(tab).to.have.attribute('active');
});
it('dispatches event on tab change', async () => {
- const tab = document.querySelector('sbb-tab-group > sbb-tab-title#sbb-tab-1') as SbbTabTitle;
- const changeSpy = new EventSpy(SbbTabGroup.events.didChange);
+ const tab = document.querySelector(
+ 'sbb-tab-group > sbb-tab-title#sbb-tab-1',
+ ) as SbbTabTitleElement;
+ const changeSpy = new EventSpy(SbbTabGroupElement.events.didChange);
tab.click();
await waitForCondition(() => changeSpy.events.length === 1);
diff --git a/src/components/tabs/tab-group/tab-group.spec.ts b/src/components/tabs/tab-group/tab-group.spec.ts
index 92720000a4..64542c8718 100644
--- a/src/components/tabs/tab-group/tab-group.spec.ts
+++ b/src/components/tabs/tab-group/tab-group.spec.ts
@@ -3,12 +3,12 @@ import { html } from 'lit/static-html.js';
import { waitForLitRender } from '../../core/testing';
-import { SbbTabGroup } from './tab-group';
+import { SbbTabGroupElement } from './tab-group';
import '.';
import '../tab-title';
describe('sbb-tab-group', () => {
- let element: SbbTabGroup;
+ let element: SbbTabGroupElement;
beforeEach(async () => {
element = await fixture(html`
diff --git a/src/components/tabs/tab-group/tab-group.stories.ts b/src/components/tabs/tab-group/tab-group.stories.ts
index 628be14519..8b13925d69 100644
--- a/src/components/tabs/tab-group/tab-group.stories.ts
+++ b/src/components/tabs/tab-group/tab-group.stories.ts
@@ -8,7 +8,7 @@ import { styleMap } from 'lit/directives/style-map.js';
import { sbbSpread } from '../../core/dom';
import readme from './readme.md?raw';
-import { SbbTabGroup } from './tab-group';
+import { SbbTabGroupElement } from './tab-group';
import '../tab-title';
const wrapperStyle = (context: StoryContext): Record => ({
@@ -221,7 +221,7 @@ const meta: Meta = {
],
parameters: {
actions: {
- handles: [SbbTabGroup.events.didChange],
+ handles: [SbbTabGroupElement.events.didChange],
},
backgrounds: {
disable: true,
diff --git a/src/components/tabs/tab-group/tab-group.ts b/src/components/tabs/tab-group/tab-group.ts
index 87a667af80..eefc6e862e 100644
--- a/src/components/tabs/tab-group/tab-group.ts
+++ b/src/components/tabs/tab-group/tab-group.ts
@@ -6,7 +6,7 @@ import { isArrowKeyPressed, getNextElementIndex, interactivityChecker } from '..
import { isValidAttribute, hostContext, toggleDatasetEntry, setAttribute } from '../../core/dom';
import { throttle, EventEmitter, ConnectedAbortController } from '../../core/eventing';
import { AgnosticMutationObserver, AgnosticResizeObserver } from '../../core/observers';
-import type { SbbTabTitle } from '../tab-title';
+import type { SbbTabTitleElement } from '../tab-title';
import style from './tab-group.scss?lit&inline';
@@ -47,7 +47,7 @@ let nextId = 0;
* @event {CustomEvent} didChange - Emits an event on selected tab change
*/
@customElement('sbb-tab-group')
-export class SbbTabGroup extends LitElement {
+export class SbbTabGroupElement extends LitElement {
public static override styles: CSSResultGroup = style;
public static readonly events = {
didChange: 'didChange',
@@ -99,7 +99,7 @@ export class SbbTabGroup extends LitElement {
*/
private _selectedTabChanged: EventEmitter = new EventEmitter(
this,
- SbbTabGroup.events.didChange,
+ SbbTabGroupElement.events.didChange,
);
/**
@@ -229,7 +229,7 @@ export class SbbTabGroup extends LitElement {
for (const entry of entries) {
const tabTitles = (
entry.target.firstElementChild as HTMLSlotElement
- ).assignedElements() as SbbTabTitle[];
+ ).assignedElements() as SbbTabTitleElement[];
for (const tab of tabTitles) {
toggleDatasetEntry(
@@ -382,6 +382,6 @@ export class SbbTabGroup extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-tab-group': SbbTabGroup;
+ 'sbb-tab-group': SbbTabGroupElement;
}
}
diff --git a/src/components/tabs/tab-title/tab-title.e2e.ts b/src/components/tabs/tab-title/tab-title.e2e.ts
index 3faca0f3c5..7c31104ddc 100644
--- a/src/components/tabs/tab-title/tab-title.e2e.ts
+++ b/src/components/tabs/tab-title/tab-title.e2e.ts
@@ -1,13 +1,13 @@
import { assert, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbTabTitle } from './tab-title';
+import { SbbTabTitleElement } from './tab-title';
describe('sbb-tab-title', () => {
- let element: SbbTabTitle;
+ let element: SbbTabTitleElement;
it('renders', async () => {
element = await fixture(html``);
- assert.instanceOf(element, SbbTabTitle);
+ assert.instanceOf(element, SbbTabTitleElement);
});
});
diff --git a/src/components/tabs/tab-title/tab-title.ts b/src/components/tabs/tab-title/tab-title.ts
index 9e88c75cd8..3d9abac0fe 100644
--- a/src/components/tabs/tab-title/tab-title.ts
+++ b/src/components/tabs/tab-title/tab-title.ts
@@ -20,7 +20,7 @@ import '../../icon';
* @slot amount - Provide a number to show an amount to the right of the title.
*/
@customElement('sbb-tab-title')
-export class SbbTabTitle extends LitElement {
+export class SbbTabTitleElement extends LitElement {
public static override styles: CSSResultGroup = style;
/**
@@ -99,6 +99,6 @@ export class SbbTabTitle extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-tab-title': SbbTabTitle;
+ 'sbb-tab-title': SbbTabTitleElement;
}
}
diff --git a/src/components/tag/tag-group/tag-group.e2e.ts b/src/components/tag/tag-group/tag-group.e2e.ts
index b35ede98c1..54bf460bcb 100644
--- a/src/components/tag/tag-group/tag-group.e2e.ts
+++ b/src/components/tag/tag-group/tag-group.e2e.ts
@@ -2,13 +2,13 @@ import { assert, expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
import { waitForCondition, waitForLitRender, EventSpy } from '../../core/testing';
-import type { SbbTag } from '../tag';
+import type { SbbTagElement } from '../tag';
import '../tag';
-import { SbbTagGroup } from './tag-group';
+import { SbbTagGroupElement } from './tag-group';
describe('sbb-tag-group', () => {
- let element: SbbTagGroup;
+ let element: SbbTagGroupElement;
describe('multiple mode', () => {
describe('no initialized checked tag', () => {
@@ -23,7 +23,7 @@ describe('sbb-tag-group', () => {
});
it('renders', async () => {
- assert.instanceOf(element, SbbTagGroup);
+ assert.instanceOf(element, SbbTagGroupElement);
});
it('should have no default activated tag', async () => {
@@ -99,7 +99,7 @@ describe('sbb-tag-group', () => {
it('should emit events and update value by unchecking manually', async () => {
const changeSpy = new EventSpy('change');
const inputSpy = new EventSpy('input');
- const tag2 = document.querySelector('sbb-tag#sbb-tag-2') as SbbTag;
+ const tag2 = document.querySelector('sbb-tag#sbb-tag-2') as SbbTagElement;
expect(tag2).to.have.attribute('checked');
expect(tag2.checked).to.be.equal(true);
@@ -119,7 +119,7 @@ describe('sbb-tag-group', () => {
it('should not emit events by setting checked programmatically [prop]', async () => {
const changeSpy = new EventSpy('change');
const inputSpy = new EventSpy('input');
- const tag2 = document.querySelector('sbb-tag#sbb-tag-2') as SbbTag;
+ const tag2 = document.querySelector('sbb-tag#sbb-tag-2') as SbbTagElement;
tag2.checked = false;
await waitForLitRender(element);
@@ -133,7 +133,7 @@ describe('sbb-tag-group', () => {
it('should not emit events by setting checked programmatically [attribute]', async () => {
const changeSpy = new EventSpy('change');
const inputSpy = new EventSpy('input');
- const tag2 = document.querySelector('sbb-tag#sbb-tag-2') as SbbTag;
+ const tag2 = document.querySelector('sbb-tag#sbb-tag-2') as SbbTagElement;
tag2.removeAttribute('checked');
await waitForLitRender(element);
@@ -214,7 +214,7 @@ describe('sbb-tag-group', () => {
it('should update group value if single value changes [prop]', async () => {
expect(element.value).to.be.eql(['tag1', 'tag2', 'tag3']);
- const tag1 = element.querySelector('sbb-tag#sbb-tag-1') as SbbTag;
+ const tag1 = element.querySelector('sbb-tag#sbb-tag-1') as SbbTagElement;
tag1.value = 'new value';
await waitForLitRender(element);
@@ -247,7 +247,7 @@ describe('sbb-tag-group', () => {
});
it('renders', async () => {
- assert.instanceOf(element, SbbTagGroup);
+ assert.instanceOf(element, SbbTagGroupElement);
});
it('should have no default activated tag', async () => {
@@ -323,7 +323,7 @@ describe('sbb-tag-group', () => {
it('should avoid unchecking manually', async () => {
const changeSpy = new EventSpy('change');
const inputSpy = new EventSpy('input');
- const tag2 = document.querySelector('sbb-tag#sbb-tag-2') as SbbTag;
+ const tag2 = document.querySelector('sbb-tag#sbb-tag-2') as SbbTagElement;
expect(tag2).to.have.attribute('checked');
expect(tag2.checked).to.be.equal(true);
@@ -341,7 +341,7 @@ describe('sbb-tag-group', () => {
it('should not emit events by setting checked programmatically to false [prop]', async () => {
const changeSpy = new EventSpy('change');
const inputSpy = new EventSpy('input');
- const tag2 = document.querySelector('sbb-tag#sbb-tag-2') as SbbTag;
+ const tag2 = document.querySelector('sbb-tag#sbb-tag-2') as SbbTagElement;
tag2.checked = false;
await waitForLitRender(element);
@@ -356,7 +356,7 @@ describe('sbb-tag-group', () => {
it('should not emit events by setting checked programmatically to false [attribute]', async () => {
const changeSpy = new EventSpy('change');
const inputSpy = new EventSpy('input');
- const tag2 = document.querySelector('sbb-tag#sbb-tag-2') as SbbTag;
+ const tag2 = document.querySelector('sbb-tag#sbb-tag-2') as SbbTagElement;
tag2.removeAttribute('checked');
await waitForLitRender(element);
@@ -371,8 +371,8 @@ describe('sbb-tag-group', () => {
it('should select another tag manually and uncheck others', async () => {
const changeSpy = new EventSpy('change');
const inputSpy = new EventSpy('input');
- const tag2 = document.querySelector('sbb-tag#sbb-tag-2') as SbbTag;
- const tag3 = document.querySelector('sbb-tag#sbb-tag-3') as SbbTag;
+ const tag2 = document.querySelector('sbb-tag#sbb-tag-2') as SbbTagElement;
+ const tag3 = document.querySelector('sbb-tag#sbb-tag-3') as SbbTagElement;
tag3.click();
await waitForLitRender(element);
@@ -396,8 +396,8 @@ describe('sbb-tag-group', () => {
it('should select another tag (before) manually and uncheck others', async () => {
const changeSpy = new EventSpy('change');
const inputSpy = new EventSpy('input');
- const tag1 = document.querySelector('sbb-tag#sbb-tag-1') as SbbTag;
- const tag2 = document.querySelector('sbb-tag#sbb-tag-2') as SbbTag;
+ const tag1 = document.querySelector('sbb-tag#sbb-tag-1') as SbbTagElement;
+ const tag2 = document.querySelector('sbb-tag#sbb-tag-2') as SbbTagElement;
tag1.click();
await waitForLitRender(element);
@@ -421,8 +421,8 @@ describe('sbb-tag-group', () => {
it('should select another tag programmatically and uncheck others', async () => {
const changeSpy = new EventSpy('change');
const inputSpy = new EventSpy('input');
- const tag2 = document.querySelector('sbb-tag#sbb-tag-2') as SbbTag;
- const tag3 = document.querySelector('sbb-tag#sbb-tag-3') as SbbTag;
+ const tag2 = document.querySelector('sbb-tag#sbb-tag-2') as SbbTagElement;
+ const tag3 = document.querySelector('sbb-tag#sbb-tag-3') as SbbTagElement;
tag3.checked = true;
await waitForLitRender(element);
@@ -510,7 +510,7 @@ describe('sbb-tag-group', () => {
it('should update group value if single value changes [prop]', async () => {
expect(element.value).to.be.equal('tag1');
- const tag1 = element.querySelector('sbb-tag#sbb-tag-1') as SbbTag;
+ const tag1 = element.querySelector('sbb-tag#sbb-tag-1') as SbbTagElement;
tag1.value = 'new value';
await waitForLitRender(element);
@@ -519,7 +519,7 @@ describe('sbb-tag-group', () => {
it('should update group value if single value changes [attribute]', async () => {
expect(element.value).to.be.equal('tag1');
- const tag1 = element.querySelector('sbb-tag#sbb-tag-1') as SbbTag;
+ const tag1 = element.querySelector('sbb-tag#sbb-tag-1') as SbbTagElement;
tag1.setAttribute('value', 'new value');
await waitForLitRender(element);
diff --git a/src/components/tag/tag-group/tag-group.ts b/src/components/tag/tag-group/tag-group.ts
index e5273c40c4..b22b3fa97d 100644
--- a/src/components/tag/tag-group/tag-group.ts
+++ b/src/components/tag/tag-group/tag-group.ts
@@ -4,7 +4,7 @@ import { customElement, property, state } from 'lit/decorators.js';
import { SlotChildObserver } from '../../core/common-behaviors';
import { setAttribute } from '../../core/dom';
import { ConnectedAbortController } from '../../core/eventing';
-import type { SbbTag, SbbTagStateChange } from '../tag';
+import type { SbbTagElement, SbbTagStateChange } from '../tag';
import style from './tag-group.scss?lit&inline';
@@ -14,7 +14,7 @@ import style from './tag-group.scss?lit&inline';
* @slot - Use the unnamed slot to add one or more 'sbb-tag' elements to the `sbb-tag-group`.
*/
@customElement('sbb-tag-group')
-export class SbbTagGroup extends SlotChildObserver(LitElement) {
+export class SbbTagGroupElement extends SlotChildObserver(LitElement) {
public static override styles: CSSResultGroup = style;
/**
@@ -77,7 +77,7 @@ export class SbbTagGroup extends SlotChildObserver(LitElement) {
return;
}
- const isChecked: (tag: SbbTag) => boolean = this.multiple
+ const isChecked: (tag: SbbTagElement) => boolean = this.multiple
? (t) => value.includes(t.value)
: (t) => t.value === value;
@@ -97,7 +97,7 @@ export class SbbTagGroup extends SlotChildObserver(LitElement) {
}
private _handleStateChange(event: CustomEvent): void {
- const target = event.target as SbbTag;
+ const target = event.target as SbbTagElement;
event.stopPropagation();
if (this.multiple || (event.detail.type === 'checked' && !event.detail.checked)) {
@@ -136,8 +136,8 @@ export class SbbTagGroup extends SlotChildObserver(LitElement) {
}
}
- private get _tags(): SbbTag[] {
- return Array.from(this.querySelectorAll?.('sbb-tag') ?? []) as SbbTag[];
+ private get _tags(): SbbTagElement[] {
+ return Array.from(this.querySelectorAll?.('sbb-tag') ?? []) as SbbTagElement[];
}
protected override checkChildren(): void {
@@ -174,6 +174,6 @@ export class SbbTagGroup extends SlotChildObserver(LitElement) {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-tag-group': SbbTagGroup;
+ 'sbb-tag-group': SbbTagGroupElement;
}
}
diff --git a/src/components/tag/tag/tag.e2e.ts b/src/components/tag/tag/tag.e2e.ts
index a3bcdec125..c43aa5d9fc 100644
--- a/src/components/tag/tag/tag.e2e.ts
+++ b/src/components/tag/tag/tag.e2e.ts
@@ -4,17 +4,17 @@ import { html } from 'lit/static-html.js';
import { waitForLitRender, EventSpy } from '../../core/testing';
-import { SbbTag } from './tag';
+import { SbbTagElement } from './tag';
describe('sbb-tag', () => {
- let element: SbbTag;
+ let element: SbbTagElement;
beforeEach(async () => {
element = await fixture(html`Tag`);
});
it('renders', async () => {
- assert.instanceOf(element, SbbTag);
+ assert.instanceOf(element, SbbTagElement);
});
it('should be checked after click', async () => {
diff --git a/src/components/tag/tag/tag.ts b/src/components/tag/tag/tag.ts
index a4bc2015cd..dd16805e98 100644
--- a/src/components/tag/tag/tag.ts
+++ b/src/components/tag/tag/tag.ts
@@ -17,7 +17,7 @@ import {
SbbStateChange,
SbbValueStateChange,
} from '../../core/interfaces';
-import type { SbbTagGroup } from '../tag-group';
+import type { SbbTagGroupElement } from '../tag-group';
import style from './tag.scss?lit&inline';
@@ -39,7 +39,7 @@ export type SbbTagStateChange = Extract<
* @event {CustomEvent} change - Change event emitter
*/
@customElement('sbb-tag')
-export class SbbTag extends LitElement implements ButtonProperties {
+export class SbbTagElement extends LitElement implements ButtonProperties {
public static override styles: CSSResultGroup = style;
public static readonly events = {
stateChange: 'stateChange',
@@ -94,25 +94,27 @@ export class SbbTag extends LitElement implements ButtonProperties {
*/
private _stateChange: EventEmitter = new EventEmitter(
this,
- SbbTag.events.stateChange,
+ SbbTagElement.events.stateChange,
{
bubbles: true,
},
);
/** Input event emitter */
- private _input: EventEmitter = new EventEmitter(this, SbbTag.events.input, {
+ private _input: EventEmitter = new EventEmitter(this, SbbTagElement.events.input, {
bubbles: true,
composed: true,
});
/** @deprecated only used for React. Will probably be removed once React 19 is available. */
- private _didChange: EventEmitter = new EventEmitter(this, SbbTag.events.didChange, {
+ private _didChange: EventEmitter = new EventEmitter(this, SbbTagElement.events.didChange, {
bubbles: true,
});
/** Change event emitter */
- private _change: EventEmitter = new EventEmitter(this, SbbTag.events.change, { bubbles: true });
+ private _change: EventEmitter = new EventEmitter(this, SbbTagElement.events.change, {
+ bubbles: true,
+ });
private _abort = new ConnectedAbortController(this);
private _handlerRepository = new HandlerRepository(
@@ -148,7 +150,7 @@ export class SbbTag extends LitElement implements ButtonProperties {
return;
}
- const tagGroup = this.closest('sbb-tag-group') as SbbTagGroup;
+ const tagGroup = this.closest('sbb-tag-group') as SbbTagGroupElement;
// Prevent deactivating on exclusive / radio mode
if (tagGroup && !tagGroup.multiple && this.checked) {
@@ -192,6 +194,6 @@ export class SbbTag extends LitElement implements ButtonProperties {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-tag': SbbTag;
+ 'sbb-tag': SbbTagElement;
}
}
diff --git a/src/components/teaser-hero/teaser-hero.e2e.ts b/src/components/teaser-hero/teaser-hero.e2e.ts
index b0b9be1a84..3a62327f42 100644
--- a/src/components/teaser-hero/teaser-hero.e2e.ts
+++ b/src/components/teaser-hero/teaser-hero.e2e.ts
@@ -4,19 +4,19 @@ import { html } from 'lit/static-html.js';
import images from '../core/images';
import { waitForLitRender } from '../core/testing';
-import { SbbTeaserHero } from './teaser-hero';
+import { SbbTeaserHeroElement } from './teaser-hero';
import '.';
import '../link';
import '../image';
describe('sbb-teaser-hero', () => {
- let element: SbbTeaserHero;
+ let element: SbbTeaserHeroElement;
it('renders', async () => {
element = await fixture(
html``,
);
- assert.instanceOf(element, SbbTeaserHero);
+ assert.instanceOf(element, SbbTeaserHeroElement);
});
it('should receive focus', async () => {
diff --git a/src/components/teaser-hero/teaser-hero.ts b/src/components/teaser-hero/teaser-hero.ts
index 84e7d2249e..278be33e7d 100644
--- a/src/components/teaser-hero/teaser-hero.ts
+++ b/src/components/teaser-hero/teaser-hero.ts
@@ -30,7 +30,7 @@ import '../image';
* @slot image - The background image that can be a `sbb-image`
*/
@customElement('sbb-teaser-hero')
-export class SbbTeaserHero extends LitElement implements LinkProperties {
+export class SbbTeaserHeroElement extends LitElement implements LinkProperties {
public static override styles: CSSResultGroup = style;
/** The href value you want to link to. */
@@ -125,6 +125,6 @@ export class SbbTeaserHero extends LitElement implements LinkProperties {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-teaser-hero': SbbTeaserHero;
+ 'sbb-teaser-hero': SbbTeaserHeroElement;
}
}
diff --git a/src/components/teaser/teaser.e2e.ts b/src/components/teaser/teaser.e2e.ts
index 9a2f872a05..9e9c376e4f 100644
--- a/src/components/teaser/teaser.e2e.ts
+++ b/src/components/teaser/teaser.e2e.ts
@@ -3,11 +3,11 @@ import { html } from 'lit/static-html.js';
import { waitForLitRender } from '../core/testing';
-import { SbbTeaser } from './teaser';
+import { SbbTeaserElement } from './teaser';
import '.';
describe('sbb-teaser', () => {
- let element: SbbTeaser;
+ let element: SbbTeaserElement;
it('should receive focus', async () => {
element = await fixture(html`Hero content`);
diff --git a/src/components/teaser/teaser.ts b/src/components/teaser/teaser.ts
index f5420745a1..5c32d6a858 100644
--- a/src/components/teaser/teaser.ts
+++ b/src/components/teaser/teaser.ts
@@ -30,7 +30,7 @@ import style from './teaser.scss?lit&inline';
* @slot description - Slot used to render the description
*/
@customElement('sbb-teaser')
-export class SbbTeaser extends LitElement implements LinkProperties {
+export class SbbTeaserElement extends LitElement implements LinkProperties {
public static override styles: CSSResultGroup = style;
/**
@@ -113,6 +113,6 @@ export class SbbTeaser extends LitElement implements LinkProperties {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-teaser': SbbTeaser;
+ 'sbb-teaser': SbbTeaserElement;
}
}
diff --git a/src/components/time-input/time-input.e2e.ts b/src/components/time-input/time-input.e2e.ts
index 58912ac5e5..7425092179 100644
--- a/src/components/time-input/time-input.e2e.ts
+++ b/src/components/time-input/time-input.e2e.ts
@@ -6,10 +6,10 @@ import { i18nTimeInputChange } from '../core/i18n';
import { ValidationChangeEvent } from '../core/interfaces';
import { EventSpy, waitForLitRender } from '../core/testing';
-import { SbbTimeInput } from './time-input';
+import { SbbTimeInputElement } from './time-input';
describe('sbb-time-input', () => {
- let element: SbbTimeInput, input: HTMLInputElement;
+ let element: SbbTimeInputElement, input: HTMLInputElement;
beforeEach(async () => {
await fixture(html`
@@ -22,7 +22,7 @@ describe('sbb-time-input', () => {
});
it('renders', async () => {
- assert.instanceOf(element, SbbTimeInput);
+ assert.instanceOf(element, SbbTimeInputElement);
});
it('should configure native input', async () => {
@@ -48,7 +48,7 @@ describe('sbb-time-input', () => {
it('should emit validation change event', async () => {
const validationChangeSpy = new EventSpy>(
- SbbTimeInput.events.validationChange,
+ SbbTimeInputElement.events.validationChange,
element,
);
@@ -91,7 +91,7 @@ describe('sbb-time-input', () => {
await waitForLitRender(element);
const validationChangeSpy = new EventSpy>(
- SbbTimeInput.events.validationChange,
+ SbbTimeInputElement.events.validationChange,
element,
);
diff --git a/src/components/time-input/time-input.stories.ts b/src/components/time-input/time-input.stories.ts
index 70d8e87f20..236e1ef02d 100644
--- a/src/components/time-input/time-input.stories.ts
+++ b/src/components/time-input/time-input.stories.ts
@@ -6,10 +6,10 @@ import { html, nothing, TemplateResult } from 'lit';
import { styleMap } from 'lit/directives/style-map.js';
import { sbbSpread } from '../core/dom';
-import type { SbbFormError } from '../form-error';
+import type { SbbFormErrorElement } from '../form-error';
import readme from './readme.md?raw';
-import { SbbTimeInput } from './time-input';
+import { SbbTimeInputElement } from './time-input';
import '../button';
import '../form-field';
import '../form-error';
@@ -22,10 +22,10 @@ const wrapperStyle = (context: StoryContext): Record => ({
const updateFormError = (event: CustomEvent): void => {
const valid = event.detail.valid;
- const target = event.target as SbbTimeInput;
+ const target = event.target as SbbTimeInputElement;
const formField = target.closest('sbb-form-field')!;
- const formError: SbbFormError = document.createElement('sbb-form-error');
+ const formError: SbbFormErrorElement = document.createElement('sbb-form-error');
formError.innerText = 'Time value is invalid';
if (!valid) {
@@ -36,7 +36,7 @@ const updateFormError = (event: CustomEvent): void => {
};
const changeEventHandler = async (event: CustomEvent): Promise => {
- const target = event.target as SbbTimeInput;
+ const target = event.target as SbbTimeInputElement;
const exampleParent = target.closest('div#example-parent')!;
const div = document.createElement('div');
div.innerText = `value is: ${
@@ -367,7 +367,7 @@ const meta: Meta = {
],
parameters: {
actions: {
- handles: ['change', 'input', SbbTimeInput.events.validationChange],
+ handles: ['change', 'input', SbbTimeInputElement.events.validationChange],
},
backgrounds: {
disable: true,
diff --git a/src/components/time-input/time-input.ts b/src/components/time-input/time-input.ts
index da750e99f9..537395f998 100644
--- a/src/components/time-input/time-input.ts
+++ b/src/components/time-input/time-input.ts
@@ -31,7 +31,7 @@ interface Time {
* @event {CustomEvent} validationChange - Emits whenever the internal validation state changes.
*/
@customElement('sbb-time-input')
-export class SbbTimeInput extends LitElement {
+export class SbbTimeInputElement extends LitElement {
public static override styles: CSSResultGroup = style;
public static readonly events = {
didChange: 'didChange',
@@ -54,7 +54,7 @@ export class SbbTimeInput extends LitElement {
/**
* @deprecated only used for React. Will probably be removed once React 19 is available.
*/
- private _didChange: EventEmitter = new EventEmitter(this, SbbTimeInput.events.didChange, {
+ private _didChange: EventEmitter = new EventEmitter(this, SbbTimeInputElement.events.didChange, {
bubbles: true,
cancelable: true,
});
@@ -62,7 +62,7 @@ export class SbbTimeInput extends LitElement {
/** Emits whenever the internal validation state changes. */
private _validationChange: EventEmitter = new EventEmitter(
this,
- SbbTimeInput.events.validationChange,
+ SbbTimeInputElement.events.validationChange,
{
bubbles: true,
composed: false,
@@ -298,6 +298,6 @@ export class SbbTimeInput extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-time-input': SbbTimeInput;
+ 'sbb-time-input': SbbTimeInputElement;
}
}
diff --git a/src/components/timetable-barrier-free/timetable-barrier-free.e2e.ts b/src/components/timetable-barrier-free/timetable-barrier-free.e2e.ts
index abf28b0979..fbabfd5544 100644
--- a/src/components/timetable-barrier-free/timetable-barrier-free.e2e.ts
+++ b/src/components/timetable-barrier-free/timetable-barrier-free.e2e.ts
@@ -1,19 +1,19 @@
import { assert, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbTimetableBarrierFree } from './timetable-barrier-free';
+import { SbbTimetableBarrierFreeElement } from './timetable-barrier-free';
import sampleData from './timetable-barrier-free.sample-data';
const config = JSON.stringify(sampleData[0]);
describe('sbb-timetable-barrier-free', () => {
- let element: SbbTimetableBarrierFree;
+ let element: SbbTimetableBarrierFreeElement;
it('renders', async () => {
element = await fixture(
html``,
);
- assert.instanceOf(element, SbbTimetableBarrierFree);
+ assert.instanceOf(element, SbbTimetableBarrierFreeElement);
});
});
diff --git a/src/components/timetable-barrier-free/timetable-barrier-free.ts b/src/components/timetable-barrier-free/timetable-barrier-free.ts
index 78e525a1d2..f2540c4f14 100644
--- a/src/components/timetable-barrier-free/timetable-barrier-free.ts
+++ b/src/components/timetable-barrier-free/timetable-barrier-free.ts
@@ -11,7 +11,7 @@ import style from './timetable-barrier-free.scss?lit&inline';
* Used in `sbb-timetable-row`, it displays information about barriers for screen-readers.
*/
@customElement('sbb-timetable-barrier-free')
-export class SbbTimetableBarrierFree extends LitElement {
+export class SbbTimetableBarrierFreeElement extends LitElement {
public static override styles: CSSResultGroup = style;
/**
@@ -60,6 +60,6 @@ export class SbbTimetableBarrierFree extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-timetable-barrier-free': SbbTimetableBarrierFree;
+ 'sbb-timetable-barrier-free': SbbTimetableBarrierFreeElement;
}
}
diff --git a/src/components/timetable-duration/timetable-duration.e2e.ts b/src/components/timetable-duration/timetable-duration.e2e.ts
index e0e7dd124b..8cddb82df6 100644
--- a/src/components/timetable-duration/timetable-duration.e2e.ts
+++ b/src/components/timetable-duration/timetable-duration.e2e.ts
@@ -1,18 +1,18 @@
import { assert, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbTimetableDuration } from './timetable-duration';
+import { SbbTimetableDurationElement } from './timetable-duration';
import sampleData from './timetable-duration.sample-data';
const config = JSON.stringify(sampleData[0]);
describe('sbb-timetable-duration', () => {
- let element: SbbTimetableDuration;
+ let element: SbbTimetableDurationElement;
it('renders', async () => {
element = await fixture(
html``,
);
- assert.instanceOf(element, SbbTimetableDuration);
+ assert.instanceOf(element, SbbTimetableDurationElement);
});
});
diff --git a/src/components/timetable-duration/timetable-duration.ts b/src/components/timetable-duration/timetable-duration.ts
index ce0595bf43..308d91741e 100644
--- a/src/components/timetable-duration/timetable-duration.ts
+++ b/src/components/timetable-duration/timetable-duration.ts
@@ -10,7 +10,7 @@ import style from './timetable-duration.scss?lit&inline';
* Used in `sbb-timetable-row`, it displays information about the trip duration.
*/
@customElement('sbb-timetable-duration')
-export class SbbTimetableDuration extends LitElement {
+export class SbbTimetableDurationElement extends LitElement {
public static override styles: CSSResultGroup = style;
/**
@@ -80,6 +80,6 @@ export class SbbTimetableDuration extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-timetable-duration': SbbTimetableDuration;
+ 'sbb-timetable-duration': SbbTimetableDurationElement;
}
}
diff --git a/src/components/timetable-occupancy-icon/timetable-occupancy-icon.e2e.ts b/src/components/timetable-occupancy-icon/timetable-occupancy-icon.e2e.ts
index 9a9c5f39aa..be1ff8f284 100644
--- a/src/components/timetable-occupancy-icon/timetable-occupancy-icon.e2e.ts
+++ b/src/components/timetable-occupancy-icon/timetable-occupancy-icon.e2e.ts
@@ -4,7 +4,7 @@ import { SinonStub, stub } from 'sinon';
import { i18nOccupancy } from '../core/i18n';
-import { SbbTimetableOccupancyIcon } from './timetable-occupancy-icon';
+import { SbbTimetableOccupancyIconElement } from './timetable-occupancy-icon';
describe('sbb-timetable-occupancy-icon', () => {
let matchMediaStub: SinonStub<[query: string], MediaQueryList>;
@@ -38,10 +38,10 @@ describe('sbb-timetable-occupancy-icon', () => {
matches: false,
media: '(prefer-color-scheme: dark)',
});
- const element: SbbTimetableOccupancyIcon = await fixture(
+ const element: SbbTimetableOccupancyIconElement = await fixture(
html` `,
);
- assert.instanceOf(element, SbbTimetableOccupancyIcon);
+ assert.instanceOf(element, SbbTimetableOccupancyIconElement);
expect(element.getAttribute('aria-label')).to.equal(i18nOccupancy.low.en);
await expect(element).shadowDom.to.equalSnapshot();
});
@@ -57,10 +57,10 @@ describe('sbb-timetable-occupancy-icon', () => {
matches: false,
media: '(prefer-color-scheme: dark)',
});
- const element: SbbTimetableOccupancyIcon = await fixture(
+ const element: SbbTimetableOccupancyIconElement = await fixture(
html` `,
);
- assert.instanceOf(element, SbbTimetableOccupancyIcon);
+ assert.instanceOf(element, SbbTimetableOccupancyIconElement);
expect(element.getAttribute('aria-label')).to.equal(i18nOccupancy.medium.en);
await expect(element).shadowDom.to.equalSnapshot();
});
@@ -76,10 +76,10 @@ describe('sbb-timetable-occupancy-icon', () => {
matches: true,
media: '(prefer-color-scheme: dark)',
});
- const element: SbbTimetableOccupancyIcon = await fixture(
+ const element: SbbTimetableOccupancyIconElement = await fixture(
html` `,
);
- assert.instanceOf(element, SbbTimetableOccupancyIcon);
+ assert.instanceOf(element, SbbTimetableOccupancyIconElement);
expect(element.getAttribute('aria-label')).to.equal(i18nOccupancy.medium.en);
await expect(element).shadowDom.to.equalSnapshot();
});
diff --git a/src/components/timetable-occupancy-icon/timetable-occupancy-icon.ts b/src/components/timetable-occupancy-icon/timetable-occupancy-icon.ts
index 85816364e1..d6e6b3b211 100644
--- a/src/components/timetable-occupancy-icon/timetable-occupancy-icon.ts
+++ b/src/components/timetable-occupancy-icon/timetable-occupancy-icon.ts
@@ -17,7 +17,7 @@ import style from './timetable-occupancy-icon.scss?lit&inline';
* It displays a wagon's occupancy icon.
*/
@customElement('sbb-timetable-occupancy-icon')
-export class SbbTimetableOccupancyIcon extends SbbIconBase {
+export class SbbTimetableOccupancyIconElement extends SbbIconBase {
public static override styles: CSSResultGroup = [SbbIconBase.styles, style];
/** Wagon occupancy. */
@@ -104,6 +104,6 @@ export class SbbTimetableOccupancyIcon extends SbbIconBase {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-timetable-occupancy-icon': SbbTimetableOccupancyIcon;
+ 'sbb-timetable-occupancy-icon': SbbTimetableOccupancyIconElement;
}
}
diff --git a/src/components/timetable-occupancy/timetable-occupancy.e2e.ts b/src/components/timetable-occupancy/timetable-occupancy.e2e.ts
index b43663ca4b..3adbc26822 100644
--- a/src/components/timetable-occupancy/timetable-occupancy.e2e.ts
+++ b/src/components/timetable-occupancy/timetable-occupancy.e2e.ts
@@ -1,10 +1,10 @@
import { assert, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbTimetableOccupancy } from './timetable-occupancy';
+import { SbbTimetableOccupancyElement } from './timetable-occupancy';
describe('sbb-timetable-occupancy', () => {
- let element: SbbTimetableOccupancy;
+ let element: SbbTimetableOccupancyElement;
beforeEach(async () => {
element = await fixture(html`
@@ -13,6 +13,6 @@ describe('sbb-timetable-occupancy', () => {
});
it('renders', async () => {
- assert.instanceOf(element, SbbTimetableOccupancy);
+ assert.instanceOf(element, SbbTimetableOccupancyElement);
});
});
diff --git a/src/components/timetable-occupancy/timetable-occupancy.spec.ts b/src/components/timetable-occupancy/timetable-occupancy.spec.ts
index b09b7774cc..d35ed352b4 100644
--- a/src/components/timetable-occupancy/timetable-occupancy.spec.ts
+++ b/src/components/timetable-occupancy/timetable-occupancy.spec.ts
@@ -5,7 +5,7 @@ import { html } from 'lit/static-html.js';
import { sbbSpread } from '../core/dom';
-import type { SbbTimetableOccupancy } from './timetable-occupancy';
+import type { SbbTimetableOccupancyElement } from './timetable-occupancy';
import './timetable-occupancy';
describe('sbb-timetable-occupancy', () => {
@@ -14,7 +14,7 @@ describe('sbb-timetable-occupancy', () => {
};
it('renders - DOM', async () => {
- const element: SbbTimetableOccupancy = await fixture(
+ const element: SbbTimetableOccupancyElement = await fixture(
renderComponent({
'first-class-occupancy': 'high',
'second-class-occupancy': 'high',
@@ -24,7 +24,7 @@ describe('sbb-timetable-occupancy', () => {
});
it('renders - ShadowDOM', async () => {
- const element: SbbTimetableOccupancy = await fixture(
+ const element: SbbTimetableOccupancyElement = await fixture(
renderComponent({
'first-class-occupancy': 'high',
'second-class-occupancy': 'high',
@@ -34,7 +34,7 @@ describe('sbb-timetable-occupancy', () => {
});
it('renders negative - DOM', async () => {
- const element: SbbTimetableOccupancy = await fixture(
+ const element: SbbTimetableOccupancyElement = await fixture(
renderComponent({
'first-class-occupancy': 'low',
'second-class-occupancy': 'medium',
@@ -45,7 +45,7 @@ describe('sbb-timetable-occupancy', () => {
});
it('renders negative - ShadowDOM', async () => {
- const element: SbbTimetableOccupancy = await fixture(
+ const element: SbbTimetableOccupancyElement = await fixture(
renderComponent({
'first-class-occupancy': 'low',
'second-class-occupancy': 'medium',
@@ -56,28 +56,28 @@ describe('sbb-timetable-occupancy', () => {
});
it('renders only first class wagon - DOM', async () => {
- const element: SbbTimetableOccupancy = await fixture(
+ const element: SbbTimetableOccupancyElement = await fixture(
renderComponent({ 'first-class-occupancy': 'low' }),
);
expect(element).dom.to.be.equalSnapshot();
});
it('renders only first class wagon - ShadowDOM', async () => {
- const element: SbbTimetableOccupancy = await fixture(
+ const element: SbbTimetableOccupancyElement = await fixture(
renderComponent({ 'first-class-occupancy': 'low' }),
);
expect(element).shadowDom.to.be.equalSnapshot();
});
it('renders only second class wagon - DOM', async () => {
- const element: SbbTimetableOccupancy = await fixture(
+ const element: SbbTimetableOccupancyElement = await fixture(
renderComponent({ 'second-class-occupancy': 'none' }),
);
expect(element).dom.to.be.equalSnapshot();
});
it('renders only second class wagon - ShadowDOM', async () => {
- const element: SbbTimetableOccupancy = await fixture(
+ const element: SbbTimetableOccupancyElement = await fixture(
renderComponent({ 'second-class-occupancy': 'none' }),
);
expect(element).shadowDom.to.be.equalSnapshot();
diff --git a/src/components/timetable-occupancy/timetable-occupancy.ts b/src/components/timetable-occupancy/timetable-occupancy.ts
index 4a8fa60386..dedee4ab24 100644
--- a/src/components/timetable-occupancy/timetable-occupancy.ts
+++ b/src/components/timetable-occupancy/timetable-occupancy.ts
@@ -12,7 +12,7 @@ import style from './timetable-occupancy.scss?lit&inline';
* Used in `sbb-timetable-row`, it displays information about wagon occupancy.
*/
@customElement('sbb-timetable-occupancy')
-export class SbbTimetableOccupancy extends LitElement {
+export class SbbTimetableOccupancyElement extends LitElement {
public static override styles: CSSResultGroup = style;
/** Occupancy for first class wagons. */
@@ -80,6 +80,6 @@ export class SbbTimetableOccupancy extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-timetable-occupancy': SbbTimetableOccupancy;
+ 'sbb-timetable-occupancy': SbbTimetableOccupancyElement;
}
}
diff --git a/src/components/timetable-park-and-rail/timetable-park-and-rail.e2e.ts b/src/components/timetable-park-and-rail/timetable-park-and-rail.e2e.ts
index c8c0d7d924..df0673f19f 100644
--- a/src/components/timetable-park-and-rail/timetable-park-and-rail.e2e.ts
+++ b/src/components/timetable-park-and-rail/timetable-park-and-rail.e2e.ts
@@ -1,18 +1,18 @@
import { assert, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbTimetableParkAndRail } from './timetable-park-and-rail';
+import { SbbTimetableParkAndRailElement } from './timetable-park-and-rail';
import sampleData from './timetable-park-and-rail.sample-data';
const config = JSON.stringify(sampleData[0]);
describe('sbb-timetable-park-and-rail', () => {
- let element: SbbTimetableParkAndRail;
+ let element: SbbTimetableParkAndRailElement;
it('renders', async () => {
element = await fixture(
html``,
);
- assert.instanceOf(element, SbbTimetableParkAndRail);
+ assert.instanceOf(element, SbbTimetableParkAndRailElement);
});
});
diff --git a/src/components/timetable-park-and-rail/timetable-park-and-rail.ts b/src/components/timetable-park-and-rail/timetable-park-and-rail.ts
index 05ad01f0b7..e2a47a0fda 100644
--- a/src/components/timetable-park-and-rail/timetable-park-and-rail.ts
+++ b/src/components/timetable-park-and-rail/timetable-park-and-rail.ts
@@ -15,7 +15,7 @@ import style from './timetable-park-and-rail.scss?lit&inline';
* Used in `sbb-timetable-row`, it displays information about parking.
*/
@customElement('sbb-timetable-park-and-rail')
-export class SbbTimetableParkAndRail extends LitElement {
+export class SbbTimetableParkAndRailElement extends LitElement {
public static override styles: CSSResultGroup = style;
/** Set the desired appearance of the component. */
@@ -84,6 +84,6 @@ export class SbbTimetableParkAndRail extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-timetable-park-and-rail': SbbTimetableParkAndRail;
+ 'sbb-timetable-park-and-rail': SbbTimetableParkAndRailElement;
}
}
diff --git a/src/components/timetable-row-column-headers/timetable-row-column-headers.e2e.ts b/src/components/timetable-row-column-headers/timetable-row-column-headers.e2e.ts
index 130a3972ff..ab50868aeb 100644
--- a/src/components/timetable-row-column-headers/timetable-row-column-headers.e2e.ts
+++ b/src/components/timetable-row-column-headers/timetable-row-column-headers.e2e.ts
@@ -1,13 +1,13 @@
import { assert, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbTimetableRowColumnHeaders } from './timetable-row-column-headers';
+import { SbbTimetableRowColumnHeadersElement } from './timetable-row-column-headers';
import sampleData from './timetable-row-column-headers.sample-data';
const config = JSON.stringify(sampleData);
describe('sbb-timetable-row-column-headers', () => {
- let element: SbbTimetableRowColumnHeaders;
+ let element: SbbTimetableRowColumnHeadersElement;
it('renders', async () => {
element = await fixture(
@@ -15,6 +15,6 @@ describe('sbb-timetable-row-column-headers', () => {
config="${config}"
>`,
);
- assert.instanceOf(element, SbbTimetableRowColumnHeaders);
+ assert.instanceOf(element, SbbTimetableRowColumnHeadersElement);
});
});
diff --git a/src/components/timetable-row-column-headers/timetable-row-column-headers.stories.ts b/src/components/timetable-row-column-headers/timetable-row-column-headers.stories.ts
index 540c814c78..b419c4ec35 100644
--- a/src/components/timetable-row-column-headers/timetable-row-column-headers.stories.ts
+++ b/src/components/timetable-row-column-headers/timetable-row-column-headers.stories.ts
@@ -21,7 +21,7 @@ const defaultArgTypes = {
config,
};
-export const SbbTimetableRowColumnHeaders: StoryObj = {
+export const SbbTimetableRowColumnHeadersElement: StoryObj = {
render: Template,
argTypes: defaultArgTypes,
args: {
diff --git a/src/components/timetable-row-column-headers/timetable-row-column-headers.ts b/src/components/timetable-row-column-headers/timetable-row-column-headers.ts
index 81d4bfc1fd..9e5e0df1b5 100644
--- a/src/components/timetable-row-column-headers/timetable-row-column-headers.ts
+++ b/src/components/timetable-row-column-headers/timetable-row-column-headers.ts
@@ -7,7 +7,7 @@ import style from './timetable-row-column-headers.scss?lit&inline';
* Used in `sbb-timetable-row`, it displays row headers information for screen-readers.
*/
@customElement('sbb-timetable-row-column-headers')
-export class SbbTimetableRowColumnHeaders extends LitElement {
+export class SbbTimetableRowColumnHeadersElement extends LitElement {
public static override styles: CSSResultGroup = style;
/**
@@ -34,6 +34,6 @@ export class SbbTimetableRowColumnHeaders extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-timetable-row-column-headers': SbbTimetableRowColumnHeaders;
+ 'sbb-timetable-row-column-headers': SbbTimetableRowColumnHeadersElement;
}
}
diff --git a/src/components/timetable-row-day-change/timetable-row-day-change.e2e.ts b/src/components/timetable-row-day-change/timetable-row-day-change.e2e.ts
index 5063451b10..bfb243107b 100644
--- a/src/components/timetable-row-day-change/timetable-row-day-change.e2e.ts
+++ b/src/components/timetable-row-day-change/timetable-row-day-change.e2e.ts
@@ -1,18 +1,18 @@
import { assert, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbTimetableRowDayChange } from './timetable-row-day-change';
+import { SbbTimetableRowDayChangeElement } from './timetable-row-day-change';
import sampleData from './timetable-row-day-change.sample-data';
const config = JSON.stringify(sampleData[1]);
describe('sbb-timetable-row-day-change', () => {
- let element: SbbTimetableRowDayChange;
+ let element: SbbTimetableRowDayChangeElement;
it('renders', async () => {
element = await fixture(
html``,
);
- assert.instanceOf(element, SbbTimetableRowDayChange);
+ assert.instanceOf(element, SbbTimetableRowDayChangeElement);
});
});
diff --git a/src/components/timetable-row-day-change/timetable-row-day-change.ts b/src/components/timetable-row-day-change/timetable-row-day-change.ts
index a5fdbd6114..97b9bce6b9 100644
--- a/src/components/timetable-row-day-change/timetable-row-day-change.ts
+++ b/src/components/timetable-row-day-change/timetable-row-day-change.ts
@@ -10,7 +10,7 @@ import style from './timetable-row-day-change.scss?lit&inline';
* Used in `sbb-timetable-row`, it displays information about day change for screen-readers.
*/
@customElement('sbb-timetable-row-day-change')
-export class SbbTimetableRowDayChange extends LitElement {
+export class SbbTimetableRowDayChangeElement extends LitElement {
public static override styles: CSSResultGroup = style;
/**
@@ -77,6 +77,6 @@ export class SbbTimetableRowDayChange extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-timetable-row-day-change': SbbTimetableRowDayChange;
+ 'sbb-timetable-row-day-change': SbbTimetableRowDayChangeElement;
}
}
diff --git a/src/components/timetable-row-header/timetable-row-header.e2e.ts b/src/components/timetable-row-header/timetable-row-header.e2e.ts
index 22d110c9ed..11150854c2 100644
--- a/src/components/timetable-row-header/timetable-row-header.e2e.ts
+++ b/src/components/timetable-row-header/timetable-row-header.e2e.ts
@@ -1,19 +1,19 @@
import { assert, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbTimetableRowHeader } from './timetable-row-header';
+import { SbbTimetableRowHeaderElement } from './timetable-row-header';
import sampleData from './timetable-row-header.sample-data';
const config = JSON.stringify(sampleData[0]);
describe('sbb-timetable-row-header', () => {
- let element: SbbTimetableRowHeader;
+ let element: SbbTimetableRowHeaderElement;
it('renders', async () => {
element = await fixture(
html``,
);
- assert.instanceOf(element, SbbTimetableRowHeader);
+ assert.instanceOf(element, SbbTimetableRowHeaderElement);
});
});
diff --git a/src/components/timetable-row-header/timetable-row-header.stories.ts b/src/components/timetable-row-header/timetable-row-header.stories.ts
index 28d26ada4a..74c48a187d 100644
--- a/src/components/timetable-row-header/timetable-row-header.stories.ts
+++ b/src/components/timetable-row-header/timetable-row-header.stories.ts
@@ -19,7 +19,7 @@ const defaultArgTypes = {
config,
};
-export const SbbTimetableRowHeader: StoryObj = {
+export const SbbTimetableRowHeaderElement: StoryObj = {
render: Template,
argTypes: defaultArgTypes,
args: {
diff --git a/src/components/timetable-row-header/timetable-row-header.ts b/src/components/timetable-row-header/timetable-row-header.ts
index f07401f4cf..efd081bf22 100644
--- a/src/components/timetable-row-header/timetable-row-header.ts
+++ b/src/components/timetable-row-header/timetable-row-header.ts
@@ -7,7 +7,7 @@ import style from './timetable-row-header.scss?lit&inline';
* Used in `sbb-timetable-row`, it displays information for screen-readers.
*/
@customElement('sbb-timetable-row-header')
-export class SbbTimetableRowHeader extends LitElement {
+export class SbbTimetableRowHeaderElement extends LitElement {
public static override styles: CSSResultGroup = style;
@property() public config!: string;
@@ -29,6 +29,6 @@ export class SbbTimetableRowHeader extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-timetable-row-header': SbbTimetableRowHeader;
+ 'sbb-timetable-row-header': SbbTimetableRowHeaderElement;
}
}
diff --git a/src/components/timetable-row/timetable-row.e2e.ts b/src/components/timetable-row/timetable-row.e2e.ts
index da39538e96..23023eb494 100644
--- a/src/components/timetable-row/timetable-row.e2e.ts
+++ b/src/components/timetable-row/timetable-row.e2e.ts
@@ -3,17 +3,17 @@ import { html } from 'lit/static-html.js';
import { EventSpy, waitForCondition } from '../core/testing';
-import { SbbTimetableRow } from './timetable-row';
+import { SbbTimetableRowElement } from './timetable-row';
describe('sbb-timetable-row', () => {
- let element: SbbTimetableRow;
+ let element: SbbTimetableRowElement;
beforeEach(async () => {
element = await fixture(html``);
});
it('renders', () => {
- assert.instanceOf(element, SbbTimetableRow);
+ assert.instanceOf(element, SbbTimetableRowElement);
});
describe('events', () => {
diff --git a/src/components/timetable-row/timetable-row.spec.ts b/src/components/timetable-row/timetable-row.spec.ts
index 80a014fc9a..806e7384cc 100644
--- a/src/components/timetable-row/timetable-row.spec.ts
+++ b/src/components/timetable-row/timetable-row.spec.ts
@@ -5,7 +5,7 @@ import { waitForLitRender } from '../core/testing';
import { ITripItem, Notice, PtSituation } from '../core/timetable';
import {
- SbbTimetableRow,
+ SbbTimetableRowElement,
filterNotices,
getCus,
getHimIcon,
@@ -25,7 +25,7 @@ import '../timetable-occupancy';
const now = new Date('2022-08-16T15:00:00Z').valueOf();
describe('sbb-timetable-row', () => {
- let element: SbbTimetableRow;
+ let element: SbbTimetableRowElement;
describe('sbb-timetable-row with defaultTrip', () => {
it('renders component with config', async () => {
diff --git a/src/components/timetable-row/timetable-row.ts b/src/components/timetable-row/timetable-row.ts
index cb47ade013..17c22af2e7 100644
--- a/src/components/timetable-row/timetable-row.ts
+++ b/src/components/timetable-row/timetable-row.ts
@@ -277,7 +277,7 @@ export const handleNotices = (notices: Notice[]): Notice[] => {
* It displays information about the trip, acting as a container for all the `sbb-timetable-*` components.
* */
@customElement('sbb-timetable-row')
-export class SbbTimetableRow extends LitElement {
+export class SbbTimetableRowElement extends LitElement {
public static override styles: CSSResultGroup = style;
/** The trip Prop. */
@@ -695,6 +695,6 @@ export class SbbTimetableRow extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-timetable-row': SbbTimetableRow;
+ 'sbb-timetable-row': SbbTimetableRowElement;
}
}
diff --git a/src/components/timetable-transportation-number/timetable-transportation-number.e2e.ts b/src/components/timetable-transportation-number/timetable-transportation-number.e2e.ts
index 4ea7393e2b..229267ae23 100644
--- a/src/components/timetable-transportation-number/timetable-transportation-number.e2e.ts
+++ b/src/components/timetable-transportation-number/timetable-transportation-number.e2e.ts
@@ -1,13 +1,13 @@
import { assert, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbTimetableTransportationNumber } from './timetable-transportation-number';
+import { SbbTimetableTransportationNumberElement } from './timetable-transportation-number';
import sampleData from './timetable-transportation-number.sample-data';
const config = JSON.stringify(sampleData.bus);
describe('sbb-timetable-transportation-number', () => {
- let element: SbbTimetableTransportationNumber;
+ let element: SbbTimetableTransportationNumberElement;
it('renders', async () => {
element = await fixture(
@@ -15,6 +15,6 @@ describe('sbb-timetable-transportation-number', () => {
config="${config}"
>`,
);
- assert.instanceOf(element, SbbTimetableTransportationNumber);
+ assert.instanceOf(element, SbbTimetableTransportationNumberElement);
});
});
diff --git a/src/components/timetable-transportation-number/timetable-transportation-number.ts b/src/components/timetable-transportation-number/timetable-transportation-number.ts
index 94f10b719e..f77b73f06f 100644
--- a/src/components/timetable-transportation-number/timetable-transportation-number.ts
+++ b/src/components/timetable-transportation-number/timetable-transportation-number.ts
@@ -10,7 +10,7 @@ import style from './timetable-transportation-number.scss?lit&inline';
* Used in `sbb-timetable-row`, it displays information about the transport.
*/
@customElement('sbb-timetable-transportation-number')
-export class SbbTimetableTransportationNumber extends LitElement {
+export class SbbTimetableTransportationNumberElement extends LitElement {
public static override styles: CSSResultGroup = style;
/**
@@ -72,6 +72,6 @@ export class SbbTimetableTransportationNumber extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-timetable-transportation-number': SbbTimetableTransportationNumber;
+ 'sbb-timetable-transportation-number': SbbTimetableTransportationNumberElement;
}
}
diff --git a/src/components/timetable-transportation-time/timetable-transportation-time.e2e.ts b/src/components/timetable-transportation-time/timetable-transportation-time.e2e.ts
index e42a0dfcd1..9e04bf68d0 100644
--- a/src/components/timetable-transportation-time/timetable-transportation-time.e2e.ts
+++ b/src/components/timetable-transportation-time/timetable-transportation-time.e2e.ts
@@ -1,13 +1,13 @@
import { assert, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbTimetableTransportationTime } from './timetable-transportation-time';
+import { SbbTimetableTransportationTimeElement } from './timetable-transportation-time';
import sampleData from './timetable-transportation-time.sample-data';
const config = JSON.stringify(sampleData[0]);
describe('sbb-timetable-transportation-time', () => {
- let element: SbbTimetableTransportationTime;
+ let element: SbbTimetableTransportationTimeElement;
it('renders', async () => {
element = await fixture(
@@ -15,6 +15,6 @@ describe('sbb-timetable-transportation-time', () => {
config="${config}"
>`,
);
- assert.instanceOf(element, SbbTimetableTransportationTime);
+ assert.instanceOf(element, SbbTimetableTransportationTimeElement);
});
});
diff --git a/src/components/timetable-transportation-time/timetable-transportation-time.ts b/src/components/timetable-transportation-time/timetable-transportation-time.ts
index 33bfa2a4ef..e80b6fa898 100644
--- a/src/components/timetable-transportation-time/timetable-transportation-time.ts
+++ b/src/components/timetable-transportation-time/timetable-transportation-time.ts
@@ -11,7 +11,7 @@ import style from './timetable-transportation-time.scss?lit&inline';
* Used in `sbb-timetable-row`, it displays departure/arrival time.
*/
@customElement('sbb-timetable-transportation-time')
-export class SbbTimetableTransportationTime extends LitElement {
+export class SbbTimetableTransportationTimeElement extends LitElement {
public static override styles: CSSResultGroup = style;
/**
@@ -69,6 +69,6 @@ export class SbbTimetableTransportationTime extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-timetable-transportation-time': SbbTimetableTransportationTime;
+ 'sbb-timetable-transportation-time': SbbTimetableTransportationTimeElement;
}
}
diff --git a/src/components/timetable-travel-hints/timetable-travel-hints.e2e.ts b/src/components/timetable-travel-hints/timetable-travel-hints.e2e.ts
index 00c68752e8..efd48e3213 100644
--- a/src/components/timetable-travel-hints/timetable-travel-hints.e2e.ts
+++ b/src/components/timetable-travel-hints/timetable-travel-hints.e2e.ts
@@ -1,18 +1,18 @@
import { assert, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbTimetableTravelHints } from './timetable-travel-hints';
+import { SbbTimetableTravelHintsElement } from './timetable-travel-hints';
import sampleData from './timetable-travel-hints.sample-data';
const config = JSON.stringify(sampleData[0]);
describe('sbb-timetable-travel-hints', () => {
- let element: SbbTimetableTravelHints;
+ let element: SbbTimetableTravelHintsElement;
it('renders', async () => {
element = await fixture(
html``,
);
- assert.instanceOf(element, SbbTimetableTravelHints);
+ assert.instanceOf(element, SbbTimetableTravelHintsElement);
});
});
diff --git a/src/components/timetable-travel-hints/timetable-travel-hints.ts b/src/components/timetable-travel-hints/timetable-travel-hints.ts
index 9657f0762b..f065cec8f8 100644
--- a/src/components/timetable-travel-hints/timetable-travel-hints.ts
+++ b/src/components/timetable-travel-hints/timetable-travel-hints.ts
@@ -12,7 +12,7 @@ import style from './timetable-travel-hints.scss?lit&inline';
* Used in `sbb-timetable-row`, it displays hints icon.
*/
@customElement('sbb-timetable-travel-hints')
-export class SbbTimetableTravelHints extends LitElement {
+export class SbbTimetableTravelHintsElement extends LitElement {
public static override styles: CSSResultGroup = style;
/** Set the desired appearance of the component. */
@@ -79,6 +79,6 @@ export class SbbTimetableTravelHints extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-timetable-travel-hints': SbbTimetableTravelHints;
+ 'sbb-timetable-travel-hints': SbbTimetableTravelHintsElement;
}
}
diff --git a/src/components/title/title.e2e.ts b/src/components/title/title.e2e.ts
index 59420c813b..c8ed8eb5cc 100644
--- a/src/components/title/title.e2e.ts
+++ b/src/components/title/title.e2e.ts
@@ -1,14 +1,14 @@
import { assert, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbTitle } from './title';
+import { SbbTitleElement } from './title';
describe('sbb-title', () => {
- let element: SbbTitle;
+ let element: SbbTitleElement;
it('renders', async () => {
await fixture(html``);
element = document.querySelector('sbb-title');
- assert.instanceOf(element, SbbTitle);
+ assert.instanceOf(element, SbbTitleElement);
});
});
diff --git a/src/components/title/title.ts b/src/components/title/title.ts
index 6047f30fda..b8d1b733d2 100644
--- a/src/components/title/title.ts
+++ b/src/components/title/title.ts
@@ -14,7 +14,7 @@ export type TitleLevel = '1' | '2' | '3' | '4' | '5' | '6';
* @slot - Use the unnamed slot to display the title.
*/
@customElement('sbb-title')
-export class SbbTitle extends LitElement {
+export class SbbTitleElement extends LitElement {
public static override styles: CSSResultGroup = style;
/** Title level */
@@ -53,6 +53,6 @@ export class SbbTitle extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-title': SbbTitle;
+ 'sbb-title': SbbTitleElement;
}
}
diff --git a/src/components/toast/toast.e2e.ts b/src/components/toast/toast.e2e.ts
index 853c17ea89..f2ec1b3027 100644
--- a/src/components/toast/toast.e2e.ts
+++ b/src/components/toast/toast.e2e.ts
@@ -3,29 +3,29 @@ import { html } from 'lit/static-html.js';
import { EventSpy, waitForCondition, waitForLitRender } from '../core/testing';
-import { SbbToast } from './toast';
+import { SbbToastElement } from './toast';
import '../link';
describe('sbb-toast', () => {
- let element: SbbToast;
+ let element: SbbToastElement;
beforeEach(async () => {
element = await fixture(html` `);
});
it('renders and sets the correct attributes', async () => {
- assert.instanceOf(element, SbbToast);
+ assert.instanceOf(element, SbbToastElement);
expect(element).not.to.have.attribute('data-has-action');
expect(element).not.to.have.attribute('data-has-icon');
expect(element).to.have.attribute('data-state', 'closed');
});
it('opens and closes after timeout', async () => {
- const willOpenEventSpy = new EventSpy(SbbToast.events.willOpen);
- const didOpenEventSpy = new EventSpy(SbbToast.events.didOpen);
- const willCloseEventSpy = new EventSpy(SbbToast.events.willClose);
- const didCloseEventSpy = new EventSpy(SbbToast.events.didClose);
+ const willOpenEventSpy = new EventSpy(SbbToastElement.events.willOpen);
+ const didOpenEventSpy = new EventSpy(SbbToastElement.events.didOpen);
+ const willCloseEventSpy = new EventSpy(SbbToastElement.events.willClose);
+ const didCloseEventSpy = new EventSpy(SbbToastElement.events.didClose);
element.setAttribute('timeout', '50');
await waitForLitRender(element);
@@ -56,9 +56,9 @@ describe('sbb-toast', () => {
});
it('closes by dismiss button click', async () => {
- const didOpenEventSpy = new EventSpy(SbbToast.events.didOpen);
- const willCloseEventSpy = new EventSpy(SbbToast.events.willClose);
- const didCloseEventSpy = new EventSpy(SbbToast.events.didClose);
+ const didOpenEventSpy = new EventSpy(SbbToastElement.events.didOpen);
+ const willCloseEventSpy = new EventSpy(SbbToastElement.events.willClose);
+ const didCloseEventSpy = new EventSpy(SbbToastElement.events.didClose);
element.setAttribute('dismissible', '');
await waitForLitRender(element);
@@ -90,9 +90,9 @@ describe('sbb-toast', () => {
`);
const actionBtn = element.querySelector('sbb-button') as HTMLElement;
- const didOpenEventSpy = new EventSpy(SbbToast.events.didOpen);
- const willCloseEventSpy = new EventSpy(SbbToast.events.willClose);
- const didCloseEventSpy = new EventSpy(SbbToast.events.didClose);
+ const didOpenEventSpy = new EventSpy(SbbToastElement.events.didOpen);
+ const willCloseEventSpy = new EventSpy(SbbToastElement.events.willClose);
+ const didCloseEventSpy = new EventSpy(SbbToastElement.events.didClose);
element.open();
await waitForLitRender(element);
@@ -144,8 +144,8 @@ describe('sbb-toast', () => {
`);
- const toast1: SbbToast = document.querySelector('#toast1');
- const toast2: SbbToast = document.querySelector('#toast2');
+ const toast1: SbbToastElement = document.querySelector('#toast1');
+ const toast2: SbbToastElement = document.querySelector('#toast2');
// Open the first toast
toast1.open();
diff --git a/src/components/toast/toast.spec.ts b/src/components/toast/toast.spec.ts
index bfb4630c11..7a894cd78b 100644
--- a/src/components/toast/toast.spec.ts
+++ b/src/components/toast/toast.spec.ts
@@ -3,13 +3,13 @@ import { html } from 'lit/static-html.js';
import { isFirefox } from '../core/dom';
-import type { SbbToast } from './toast';
+import type { SbbToastElement } from './toast';
import './toast';
describe('sbb-toast', () => {
it('renders', async () => {
- const root: SbbToast = await fixture(html`
+ const root: SbbToastElement = await fixture(html`
'Lorem ipsum dolor'
`);
diff --git a/src/components/toast/toast.stories.ts b/src/components/toast/toast.stories.ts
index 154b69bd6d..9cf3634f3f 100644
--- a/src/components/toast/toast.stories.ts
+++ b/src/components/toast/toast.stories.ts
@@ -9,7 +9,7 @@ import { waitForComponentsReady } from '../../storybook/testing/wait-for-compone
import { sbbSpread } from '../core/dom';
import readme from './readme.md?raw';
-import { SbbToast } from './toast';
+import { SbbToastElement } from './toast';
import '../link';
// Story interaction executed after the story renders
@@ -20,7 +20,7 @@ const playStory = async ({ canvasElement }): Promise => {
canvas.getByTestId('sbb-toast').shadowRoot!.querySelector('.sbb-toast'),
);
- const toast = canvas.getByTestId('sbb-toast') as SbbToast;
+ const toast = canvas.getByTestId('sbb-toast') as SbbToastElement;
toast.open();
await new Promise((resolve) => setTimeout(resolve, 2000));
};
@@ -165,10 +165,10 @@ const meta: Meta = {
chromatic: { disableSnapshot: false },
actions: {
handles: [
- SbbToast.events.willOpen,
- SbbToast.events.didOpen,
- SbbToast.events.willClose,
- SbbToast.events.didClose,
+ SbbToastElement.events.willOpen,
+ SbbToastElement.events.didOpen,
+ SbbToastElement.events.willClose,
+ SbbToastElement.events.didClose,
],
},
backgrounds: {
diff --git a/src/components/toast/toast.ts b/src/components/toast/toast.ts
index 60fd5416f7..2cb4691c4c 100644
--- a/src/components/toast/toast.ts
+++ b/src/components/toast/toast.ts
@@ -1,7 +1,7 @@
import { CSSResultGroup, html, LitElement, nothing, TemplateResult } from 'lit';
import { customElement, property, state } from 'lit/decorators.js';
-import type { SbbButton } from '../button';
+import type { SbbButtonElement } from '../button';
import { isFirefox, isValidAttribute, setAttribute } from '../core/dom';
import {
createNamedSlotState,
@@ -15,7 +15,7 @@ import {
} from '../core/eventing';
import { i18nCloseAlert } from '../core/i18n';
import { SbbOverlayState } from '../core/overlay';
-import type { SbbLink } from '../link';
+import type { SbbLinkElement } from '../link';
import style from './toast.scss?lit&inline';
@@ -27,7 +27,7 @@ type SbbToastPositionHorizontal = 'left' | 'start' | 'center' | 'right' | 'end';
export type SbbToastPosition = `${SbbToastPositionVertical}-${SbbToastPositionHorizontal}`;
// A global collection of existing toasts
-const toastRefs = new Set();
+const toastRefs = new Set();
/**
* It displays a toast notification.
@@ -41,7 +41,7 @@ const toastRefs = new Set();
* @event {CustomEvent} didClose - Emits whenever the `sbb-toast` is closed.
*/
@customElement('sbb-toast')
-export class SbbToast extends LitElement {
+export class SbbToastElement extends LitElement {
public static override styles: CSSResultGroup = style;
public static readonly events = {
willOpen: 'willOpen',
@@ -87,25 +87,29 @@ export class SbbToast extends LitElement {
@state() private _currentLanguage = documentLanguage();
/** Emits whenever the `sbb-toast` starts the opening transition. */
- private _willOpen: EventEmitter = new EventEmitter(this, SbbToast.events.willOpen, {
+ private _willOpen: EventEmitter = new EventEmitter(this, SbbToastElement.events.willOpen, {
bubbles: true,
composed: true,
});
/** Emits whenever the `sbb-toast` is opened. */
- private _didOpen: EventEmitter = new EventEmitter(this, SbbToast.events.didOpen, {
+ private _didOpen: EventEmitter = new EventEmitter(this, SbbToastElement.events.didOpen, {
bubbles: true,
composed: true,
});
/** Emits whenever the `sbb-toast` begins the closing transition. */
- private _willClose: EventEmitter = new EventEmitter(this, SbbToast.events.willClose, {
- bubbles: true,
- composed: true,
- });
+ private _willClose: EventEmitter = new EventEmitter(
+ this,
+ SbbToastElement.events.willClose,
+ {
+ bubbles: true,
+ composed: true,
+ },
+ );
/** Emits whenever the `sbb-toast` is closed. */
- private _didClose: EventEmitter = new EventEmitter(this, SbbToast.events.didClose, {
+ private _didClose: EventEmitter = new EventEmitter(this, SbbToastElement.events.didClose, {
bubbles: true,
composed: true,
});
@@ -213,7 +217,7 @@ export class SbbToast extends LitElement {
// Force the visual state on slotted buttons
slotNodes
.filter((el) => el.nodeName === 'SBB-BUTTON')
- .forEach((btn: SbbButton) => {
+ .forEach((btn: SbbButtonElement) => {
btn.variant = 'transparent';
btn.negative = true;
btn.size = 'm';
@@ -222,7 +226,7 @@ export class SbbToast extends LitElement {
// Force the visual state on slotted links
slotNodes
.filter((el) => el.nodeName === 'SBB-LINK')
- .forEach((link: SbbLink) => {
+ .forEach((link: SbbLinkElement) => {
link.variant = 'inline';
link.negative = true;
});
@@ -309,6 +313,6 @@ export class SbbToast extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-toast': SbbToast;
+ 'sbb-toast': SbbToastElement;
}
}
diff --git a/src/components/toggle-check/toggle-check.e2e.ts b/src/components/toggle-check/toggle-check.e2e.ts
index 0e5e44e5c8..b835ed4e27 100644
--- a/src/components/toggle-check/toggle-check.e2e.ts
+++ b/src/components/toggle-check/toggle-check.e2e.ts
@@ -4,17 +4,17 @@ import { html } from 'lit/static-html.js';
import { EventSpy, waitForCondition, waitForLitRender } from '../core/testing';
-import { SbbToggleCheck } from './toggle-check';
+import { SbbToggleCheckElement } from './toggle-check';
describe('sbb-toggle-check', () => {
- let element: SbbToggleCheck;
+ let element: SbbToggleCheckElement;
beforeEach(async () => {
element = await fixture(html``);
});
it('renders', async () => {
- assert.instanceOf(element, SbbToggleCheck);
+ assert.instanceOf(element, SbbToggleCheckElement);
});
describe('events', () => {
diff --git a/src/components/toggle-check/toggle-check.ts b/src/components/toggle-check/toggle-check.ts
index 3afece3bb2..447ba4cb2f 100644
--- a/src/components/toggle-check/toggle-check.ts
+++ b/src/components/toggle-check/toggle-check.ts
@@ -22,7 +22,7 @@ import '../icon';
* @event {CustomEvent} didChange - Deprecated. used for React. Will probably be removed once React 19 is available.
*/
@customElement('sbb-toggle-check')
-export class SbbToggleCheck extends LitElement {
+export class SbbToggleCheckElement extends LitElement {
public static override styles: CSSResultGroup = style;
public static readonly events = {
didChange: 'didChange',
@@ -56,10 +56,14 @@ export class SbbToggleCheck extends LitElement {
/**
* @deprecated only used for React. Will probably be removed once React 19 is available.
*/
- private _didChange: EventEmitter = new EventEmitter(this, SbbToggleCheck.events.didChange, {
- bubbles: true,
- cancelable: true,
- });
+ private _didChange: EventEmitter = new EventEmitter(
+ this,
+ SbbToggleCheckElement.events.didChange,
+ {
+ bubbles: true,
+ cancelable: true,
+ },
+ );
@state() private _hasLabelText = false;
@@ -163,6 +167,6 @@ export class SbbToggleCheck extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-toggle-check': SbbToggleCheck;
+ 'sbb-toggle-check': SbbToggleCheckElement;
}
}
diff --git a/src/components/toggle/toggle-option/toggle-option.e2e.ts b/src/components/toggle/toggle-option/toggle-option.e2e.ts
index 7e81be1b22..eb58506bf3 100644
--- a/src/components/toggle/toggle-option/toggle-option.e2e.ts
+++ b/src/components/toggle/toggle-option/toggle-option.e2e.ts
@@ -3,17 +3,17 @@ import { html } from 'lit/static-html.js';
import { EventSpy, waitForCondition, waitForLitRender } from '../../core/testing';
-import { SbbToggleOption } from './toggle-option';
+import { SbbToggleOptionElement } from './toggle-option';
describe('sbb-toggle-option', () => {
- let element: SbbToggleOption;
+ let element: SbbToggleOptionElement;
beforeEach(async () => {
element = await fixture(html`Value label`);
});
it('renders', async () => {
- assert.instanceOf(element, SbbToggleOption);
+ assert.instanceOf(element, SbbToggleOptionElement);
});
it('selects the sbb-toggle-option on click', async () => {
diff --git a/src/components/toggle/toggle-option/toggle-option.ts b/src/components/toggle/toggle-option/toggle-option.ts
index 9c015583bd..3e4a361bab 100644
--- a/src/components/toggle/toggle-option/toggle-option.ts
+++ b/src/components/toggle/toggle-option/toggle-option.ts
@@ -10,7 +10,7 @@ import {
namedSlotChangeHandlerAspect,
} from '../../core/eventing';
import '../../icon';
-import type { SbbToggle, SbbToggleStateChange } from '../toggle';
+import type { SbbToggleElement, SbbToggleStateChange } from '../toggle';
import style from './toggle-option.scss?lit&inline';
@@ -21,7 +21,7 @@ import style from './toggle-option.scss?lit&inline';
* @slot icon - Slot used to render the `sbb-icon`.
*/
@customElement('sbb-toggle-option')
-export class SbbToggleOption extends LitElement {
+export class SbbToggleOptionElement extends LitElement {
public static override styles: CSSResultGroup = style;
public static readonly events = {
stateChange: 'stateChange',
@@ -85,7 +85,7 @@ export class SbbToggleOption extends LitElement {
*/
@state() private _namedSlots = createNamedSlotState('icon');
- private _toggle?: SbbToggle;
+ private _toggle?: SbbToggleElement;
private _handlerRepository = new HandlerRepository(
this,
@@ -99,7 +99,7 @@ export class SbbToggleOption extends LitElement {
*/
private _stateChange: EventEmitter = new EventEmitter(
this,
- SbbToggleOption.events.stateChange,
+ SbbToggleOptionElement.events.stateChange,
{ bubbles: true },
);
@@ -205,6 +205,6 @@ export class SbbToggleOption extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-toggle-option': SbbToggleOption;
+ 'sbb-toggle-option': SbbToggleOptionElement;
}
}
diff --git a/src/components/toggle/toggle/toggle.e2e.ts b/src/components/toggle/toggle/toggle.e2e.ts
index cd4c5247fb..5c032872b5 100644
--- a/src/components/toggle/toggle/toggle.e2e.ts
+++ b/src/components/toggle/toggle/toggle.e2e.ts
@@ -3,13 +3,13 @@ import { sendKeys } from '@web/test-runner-commands';
import { html } from 'lit/static-html.js';
import { EventSpy, waitForCondition, waitForLitRender } from '../../core/testing';
-import type { SbbToggleOption } from '../toggle-option';
+import type { SbbToggleOptionElement } from '../toggle-option';
import '../toggle-option';
-import { SbbToggle } from './toggle';
+import { SbbToggleElement } from './toggle';
describe('sbb-toggle', () => {
- let element: SbbToggle;
+ let element: SbbToggleElement;
beforeEach(async () => {
element = await fixture(html`
@@ -21,7 +21,7 @@ describe('sbb-toggle', () => {
});
it('renders', () => {
- assert.instanceOf(element, SbbToggle);
+ assert.instanceOf(element, SbbToggleElement);
});
describe('events', () => {
@@ -31,7 +31,7 @@ describe('sbb-toggle', () => {
);
const secondOption = document.querySelector(
'sbb-toggle > sbb-toggle-option#sbb-toggle-option-2',
- ) as SbbToggleOption;
+ ) as SbbToggleOptionElement;
expect(firstOption).to.have.attribute('checked');
@@ -63,10 +63,10 @@ describe('sbb-toggle', () => {
it('dispatches event on option change', async () => {
const firstOption = document.querySelector(
'sbb-toggle > sbb-toggle-option#sbb-toggle-option-1',
- ) as SbbToggleOption;
+ ) as SbbToggleOptionElement;
const secondOption = document.querySelector(
'sbb-toggle > sbb-toggle-option#sbb-toggle-option-2',
- ) as SbbToggleOption;
+ ) as SbbToggleOptionElement;
const changeSpy = new EventSpy('change');
const inputSpy = new EventSpy('input');
@@ -84,10 +84,10 @@ describe('sbb-toggle', () => {
it('prevents selection with disabled state', async () => {
const firstOption = document.querySelector(
'sbb-toggle > sbb-toggle-option#sbb-toggle-option-1',
- ) as SbbToggleOption;
+ ) as SbbToggleOptionElement;
const secondOption = document.querySelector(
'sbb-toggle > sbb-toggle-option#sbb-toggle-option-2',
- ) as SbbToggleOption;
+ ) as SbbToggleOptionElement;
element.disabled = true;
await waitForLitRender(element);
@@ -111,10 +111,10 @@ describe('sbb-toggle', () => {
const inputSpy = new EventSpy('input');
const firstOption = document.querySelector(
'sbb-toggle > sbb-toggle-option#sbb-toggle-option-1',
- ) as SbbToggleOption;
+ ) as SbbToggleOptionElement;
const secondOption = document.querySelector(
'sbb-toggle > sbb-toggle-option#sbb-toggle-option-2',
- ) as SbbToggleOption;
+ ) as SbbToggleOptionElement;
firstOption.focus();
await sendKeys({ down: 'ArrowLeft' });
@@ -137,10 +137,10 @@ describe('sbb-toggle', () => {
const inputSpy = new EventSpy('input');
const firstOption = document.querySelector(
'sbb-toggle > sbb-toggle-option#sbb-toggle-option-1',
- ) as SbbToggleOption;
+ ) as SbbToggleOptionElement;
const secondOption = document.querySelector(
'sbb-toggle > sbb-toggle-option#sbb-toggle-option-2',
- ) as SbbToggleOption;
+ ) as SbbToggleOptionElement;
firstOption.focus();
await waitForLitRender(firstOption);
diff --git a/src/components/toggle/toggle/toggle.spec.ts b/src/components/toggle/toggle/toggle.spec.ts
index 5350362c49..4dda976760 100644
--- a/src/components/toggle/toggle/toggle.spec.ts
+++ b/src/components/toggle/toggle/toggle.spec.ts
@@ -2,14 +2,14 @@ import { expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
import { waitForLitRender } from '../../core/testing';
-import type { SbbToggleOption } from '../toggle-option';
+import type { SbbToggleOptionElement } from '../toggle-option';
-import type { SbbToggle } from './toggle';
+import type { SbbToggleElement } from './toggle';
import './toggle';
import '../toggle-option';
describe('sbb-toggle', () => {
- let option: SbbToggleOption, page: SbbToggle;
+ let option: SbbToggleOptionElement, page: SbbToggleElement;
const simpleToggleTemplate = html`
Value one
diff --git a/src/components/toggle/toggle/toggle.ts b/src/components/toggle/toggle/toggle.ts
index fda05f7955..787f0ea7a6 100644
--- a/src/components/toggle/toggle/toggle.ts
+++ b/src/components/toggle/toggle/toggle.ts
@@ -7,7 +7,7 @@ import { toggleDatasetEntry, setAttribute, isBrowser } from '../../core/dom';
import { EventEmitter, ConnectedAbortController } from '../../core/eventing';
import { SbbCheckedStateChange, SbbStateChange, SbbValueStateChange } from '../../core/interfaces';
import { AgnosticResizeObserver } from '../../core/observers';
-import type { SbbToggleOption } from '../toggle-option';
+import type { SbbToggleOptionElement } from '../toggle-option';
import style from './toggle.scss?lit&inline';
@@ -24,7 +24,7 @@ export type SbbToggleStateChange = Extract<
* @event {CustomEvent} change - Emits whenever the toggle value changes.
*/
@customElement('sbb-toggle')
-export class SbbToggle extends LitElement {
+export class SbbToggleElement extends LitElement {
public static override styles: CSSResultGroup = style;
public static readonly events = {
didChange: 'didChange',
@@ -97,19 +97,21 @@ export class SbbToggle extends LitElement {
* @deprecated only used for React. Will probably be removed once React 19 is available.
* Emits whenever the toggle value changes.
*/
- private _didChange: EventEmitter = new EventEmitter(this, SbbToggle.events.didChange, {
+ private _didChange: EventEmitter = new EventEmitter(this, SbbToggleElement.events.didChange, {
bubbles: true,
composed: true,
});
/** Emits whenever the toggle value changes. */
- private _change: EventEmitter = new EventEmitter(this, SbbToggle.events.change, {
+ private _change: EventEmitter = new EventEmitter(this, SbbToggleElement.events.change, {
bubbles: true,
composed: true,
});
- private get _options(): SbbToggleOption[] {
- return Array.from(this.querySelectorAll?.('sbb-toggle-option') ?? []) as SbbToggleOption[];
+ private get _options(): SbbToggleOptionElement[] {
+ return Array.from(
+ this.querySelectorAll?.('sbb-toggle-option') ?? [],
+ ) as SbbToggleOptionElement[];
}
private _handleInput(): void {
@@ -118,7 +120,7 @@ export class SbbToggle extends LitElement {
private _abort = new ConnectedAbortController(this);
private _handleStateChange(event: CustomEvent): void {
- const target: SbbToggleOption = event.target as SbbToggleOption;
+ const target: SbbToggleOptionElement = event.target as SbbToggleOptionElement;
event.stopPropagation();
if (event.detail.type === 'value') {
this.value = event.detail.value;
@@ -220,7 +222,7 @@ export class SbbToggle extends LitElement {
if (isArrowKeyPressed(evt)) {
const checked: number = enabledToggleOptions.findIndex(
- (toggleOption: SbbToggleOption) => toggleOption.checked,
+ (toggleOption: SbbToggleOptionElement) => toggleOption.checked,
);
const nextIndex: number = getNextElementIndex(evt, checked, enabledToggleOptions.length);
if (!enabledToggleOptions[nextIndex].checked) {
@@ -247,6 +249,6 @@ export class SbbToggle extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-toggle': SbbToggle;
+ 'sbb-toggle': SbbToggleElement;
}
}
diff --git a/src/components/tooltip/tooltip-trigger/tooltip-trigger.e2e.ts b/src/components/tooltip/tooltip-trigger/tooltip-trigger.e2e.ts
index 83a6759bcb..02e6b245b0 100644
--- a/src/components/tooltip/tooltip-trigger/tooltip-trigger.e2e.ts
+++ b/src/components/tooltip/tooltip-trigger/tooltip-trigger.e2e.ts
@@ -3,12 +3,12 @@ import { sendKeys } from '@web/test-runner-commands';
import { html } from 'lit/static-html.js';
import { waitForCondition, EventSpy, waitForLitRender } from '../../core/testing';
-import { SbbTooltip } from '../tooltip';
+import { SbbTooltipElement } from '../tooltip';
-import { SbbTooltipTrigger } from './tooltip-trigger';
+import { SbbTooltipTriggerElement } from './tooltip-trigger';
describe('sbb-tooltip-trigger', () => {
- let element: SbbTooltipTrigger, tooltip: SbbTooltip;
+ let element: SbbTooltipTriggerElement, tooltip: SbbTooltipElement;
beforeEach(async () => {
await fixture(html`
@@ -23,12 +23,12 @@ describe('sbb-tooltip-trigger', () => {
});
it('renders', () => {
- assert.instanceOf(element, SbbTooltipTrigger);
+ assert.instanceOf(element, SbbTooltipTriggerElement);
});
it('shows tooltip on tooltip-trigger click', async () => {
- const willOpenEventSpy = new EventSpy(SbbTooltip.events.willOpen);
- const didOpenEventSpy = new EventSpy(SbbTooltip.events.didOpen);
+ const willOpenEventSpy = new EventSpy(SbbTooltipElement.events.willOpen);
+ const didOpenEventSpy = new EventSpy(SbbTooltipElement.events.didOpen);
element.click();
@@ -41,7 +41,7 @@ describe('sbb-tooltip-trigger', () => {
});
it("doesn't show tooltip on disabled tooltip-trigger click", async () => {
- const willOpenEventSpy = new EventSpy(SbbTooltip.events.willOpen);
+ const willOpenEventSpy = new EventSpy(SbbTooltipElement.events.willOpen);
element.disabled = true;
await waitForLitRender(element);
diff --git a/src/components/tooltip/tooltip-trigger/tooltip-trigger.ts b/src/components/tooltip/tooltip-trigger/tooltip-trigger.ts
index ee1e1cfdff..2b0d21dba3 100644
--- a/src/components/tooltip/tooltip-trigger/tooltip-trigger.ts
+++ b/src/components/tooltip/tooltip-trigger/tooltip-trigger.ts
@@ -14,7 +14,7 @@ import '../../icon';
* @slot - Use the unnamed slot to add content to the `sbb-tooltip-trigger`.
*/
@customElement('sbb-tooltip-trigger')
-export class SbbTooltipTrigger extends LitElement {
+export class SbbTooltipTriggerElement extends LitElement {
public static override styles: CSSResultGroup = style;
/** The name attribute to use for the button. */
@@ -67,6 +67,6 @@ export class SbbTooltipTrigger extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-tooltip-trigger': SbbTooltipTrigger;
+ 'sbb-tooltip-trigger': SbbTooltipTriggerElement;
}
}
diff --git a/src/components/tooltip/tooltip/tooltip.e2e.ts b/src/components/tooltip/tooltip/tooltip.e2e.ts
index 14fa2785e4..3f63f1998f 100644
--- a/src/components/tooltip/tooltip/tooltip.e2e.ts
+++ b/src/components/tooltip/tooltip/tooltip.e2e.ts
@@ -2,14 +2,14 @@ import { assert, expect, fixture, fixtureCleanup } from '@open-wc/testing';
import { sendKeys, sendMouse, setViewport } from '@web/test-runner-commands';
import { html } from 'lit/static-html.js';
-import { SbbButton } from '../../button';
+import { SbbButtonElement } from '../../button';
import { waitForCondition, waitForLitRender, EventSpy } from '../../core/testing';
import '../../link';
-import { SbbTooltip } from './tooltip';
+import { SbbTooltipElement } from './tooltip';
describe('sbb-tooltip', () => {
- let element: SbbTooltip, trigger: SbbButton;
+ let element: SbbTooltipElement, trigger: SbbButtonElement;
beforeEach(async () => {
await fixture(html`
@@ -25,12 +25,12 @@ describe('sbb-tooltip', () => {
});
it('renders', () => {
- assert.instanceOf(element, SbbTooltip);
+ assert.instanceOf(element, SbbTooltipElement);
});
it('shows the tooltip', async () => {
- const willOpenEventSpy = new EventSpy(SbbTooltip.events.willOpen);
- const didOpenEventSpy = new EventSpy(SbbTooltip.events.didOpen);
+ const willOpenEventSpy = new EventSpy(SbbTooltipElement.events.willOpen);
+ const didOpenEventSpy = new EventSpy(SbbTooltipElement.events.didOpen);
element.open();
@@ -44,8 +44,8 @@ describe('sbb-tooltip', () => {
});
it('shows on trigger click', async () => {
- const willOpenEventSpy = new EventSpy(SbbTooltip.events.willOpen);
- const didOpenEventSpy = new EventSpy(SbbTooltip.events.didOpen);
+ const willOpenEventSpy = new EventSpy(SbbTooltipElement.events.willOpen);
+ const didOpenEventSpy = new EventSpy(SbbTooltipElement.events.didOpen);
trigger.click();
@@ -59,10 +59,10 @@ describe('sbb-tooltip', () => {
});
it('closes the tooltip', async () => {
- const willOpenEventSpy = new EventSpy(SbbTooltip.events.willOpen);
- const didOpenEventSpy = new EventSpy(SbbTooltip.events.didOpen);
- const willCloseEventSpy = new EventSpy(SbbTooltip.events.willClose);
- const didCloseEventSpy = new EventSpy(SbbTooltip.events.didClose);
+ const willOpenEventSpy = new EventSpy(SbbTooltipElement.events.willOpen);
+ const didOpenEventSpy = new EventSpy(SbbTooltipElement.events.didOpen);
+ const willCloseEventSpy = new EventSpy(SbbTooltipElement.events.willClose);
+ const didCloseEventSpy = new EventSpy(SbbTooltipElement.events.didClose);
element.open();
@@ -84,10 +84,10 @@ describe('sbb-tooltip', () => {
});
it('closes the tooltip on close button click', async () => {
- const willOpenEventSpy = new EventSpy(SbbTooltip.events.willOpen);
- const didOpenEventSpy = new EventSpy(SbbTooltip.events.didOpen);
- const willCloseEventSpy = new EventSpy(SbbTooltip.events.willClose);
- const didCloseEventSpy = new EventSpy(SbbTooltip.events.didClose);
+ const willOpenEventSpy = new EventSpy(SbbTooltipElement.events.willOpen);
+ const didOpenEventSpy = new EventSpy(SbbTooltipElement.events.didOpen);
+ const willCloseEventSpy = new EventSpy(SbbTooltipElement.events.willClose);
+ const didCloseEventSpy = new EventSpy(SbbTooltipElement.events.didClose);
const closeButton = element.shadowRoot.querySelector('[sbb-tooltip-close]') as HTMLElement;
element.open();
@@ -113,10 +113,10 @@ describe('sbb-tooltip', () => {
});
it('closes on interactive element click', async () => {
- const willOpenEventSpy = new EventSpy(SbbTooltip.events.willOpen);
- const didOpenEventSpy = new EventSpy(SbbTooltip.events.didOpen);
- const willCloseEventSpy = new EventSpy(SbbTooltip.events.willClose);
- const didCloseEventSpy = new EventSpy(SbbTooltip.events.didClose);
+ const willOpenEventSpy = new EventSpy(SbbTooltipElement.events.willOpen);
+ const didOpenEventSpy = new EventSpy(SbbTooltipElement.events.didOpen);
+ const willCloseEventSpy = new EventSpy(SbbTooltipElement.events.willClose);
+ const didCloseEventSpy = new EventSpy(SbbTooltipElement.events.didClose);
const tooltipLink = document.querySelector('sbb-tooltip > sbb-link') as HTMLElement;
trigger.click();
@@ -144,8 +144,8 @@ describe('sbb-tooltip', () => {
});
it('is correctly positioned on screen', async () => {
- const willOpenEventSpy = new EventSpy(SbbTooltip.events.willOpen);
- const didOpenEventSpy = new EventSpy(SbbTooltip.events.didOpen);
+ const willOpenEventSpy = new EventSpy(SbbTooltipElement.events.willOpen);
+ const didOpenEventSpy = new EventSpy(SbbTooltipElement.events.didOpen);
await setViewport({ width: 1200, height: 800 });
@@ -176,8 +176,8 @@ describe('sbb-tooltip', () => {
});
it('should set correct focus attribute on trigger after backdrop click', async () => {
- const didOpenEventSpy = new EventSpy(SbbTooltip.events.didOpen);
- const didCloseEventSpy = new EventSpy(SbbTooltip.events.didClose);
+ const didOpenEventSpy = new EventSpy(SbbTooltipElement.events.didOpen);
+ const didCloseEventSpy = new EventSpy(SbbTooltipElement.events.didClose);
element.open();
@@ -197,8 +197,8 @@ describe('sbb-tooltip', () => {
const interactiveBackgroundElement = document.querySelector(
'#interactive-background-element',
) as HTMLElement;
- const didOpenEventSpy = new EventSpy(SbbTooltip.events.didOpen);
- const didCloseEventSpy = new EventSpy(SbbTooltip.events.didClose);
+ const didOpenEventSpy = new EventSpy(SbbTooltipElement.events.didOpen);
+ const didCloseEventSpy = new EventSpy(SbbTooltipElement.events.didClose);
element.open();
@@ -218,8 +218,8 @@ describe('sbb-tooltip', () => {
});
it('closes on interactive element click by keyboard', async () => {
- const didOpenEventSpy = new EventSpy(SbbTooltip.events.didOpen);
- const didCloseEventSpy = new EventSpy(SbbTooltip.events.didClose);
+ const didOpenEventSpy = new EventSpy(SbbTooltipElement.events.didOpen);
+ const didCloseEventSpy = new EventSpy(SbbTooltipElement.events.didClose);
const tooltipLink = document.querySelector('sbb-tooltip > sbb-link') as HTMLElement;
trigger.click();
@@ -240,8 +240,8 @@ describe('sbb-tooltip', () => {
});
it('sets the focus to the first focusable element when the tooltip is opened by keyboard', async () => {
- const willOpenEventSpy = new EventSpy(SbbTooltip.events.willOpen);
- const didOpenEventSpy = new EventSpy(SbbTooltip.events.didOpen);
+ const willOpenEventSpy = new EventSpy(SbbTooltipElement.events.willOpen);
+ const didOpenEventSpy = new EventSpy(SbbTooltipElement.events.didOpen);
await sendKeys({ down: 'Tab' });
await sendKeys({ down: 'Enter' });
@@ -261,8 +261,8 @@ describe('sbb-tooltip', () => {
});
it('closes the tooltip on close button click by keyboard', async () => {
- const didOpenEventSpy = new EventSpy(SbbTooltip.events.didOpen);
- const didCloseEventSpy = new EventSpy(SbbTooltip.events.didClose);
+ const didOpenEventSpy = new EventSpy(SbbTooltipElement.events.didOpen);
+ const didCloseEventSpy = new EventSpy(SbbTooltipElement.events.didClose);
const closeButton = document
.querySelector('sbb-tooltip')
.shadowRoot.querySelector('[sbb-tooltip-close]') as HTMLElement;
@@ -284,10 +284,10 @@ describe('sbb-tooltip', () => {
});
it('closes on Esc keypress', async () => {
- const willOpenEventSpy = new EventSpy(SbbTooltip.events.willOpen);
- const didOpenEventSpy = new EventSpy(SbbTooltip.events.didOpen);
- const willCloseEventSpy = new EventSpy(SbbTooltip.events.willClose);
- const didCloseEventSpy = new EventSpy(SbbTooltip.events.didClose);
+ const willOpenEventSpy = new EventSpy(SbbTooltipElement.events.willOpen);
+ const didOpenEventSpy = new EventSpy(SbbTooltipElement.events.didOpen);
+ const willCloseEventSpy = new EventSpy(SbbTooltipElement.events.willClose);
+ const didCloseEventSpy = new EventSpy(SbbTooltipElement.events.didClose);
trigger.click();
@@ -331,12 +331,12 @@ describe('sbb-tooltip', () => {
trigger = document.querySelector('#tooltip-trigger');
const secondTrigger = document.querySelector('#another-tooltip-trigger');
element = document.querySelector('#tooltip');
- const secondElement: SbbTooltip = document.querySelector('#another-tooltip');
+ const secondElement: SbbTooltipElement = document.querySelector('#another-tooltip');
- const willOpenEventSpy = new EventSpy(SbbTooltip.events.didOpen);
- const didOpenEventSpy = new EventSpy(SbbTooltip.events.didOpen);
- const willCloseEventSpy = new EventSpy(SbbTooltip.events.didClose);
- const didCloseEventSpy = new EventSpy(SbbTooltip.events.didClose, element);
+ const willOpenEventSpy = new EventSpy(SbbTooltipElement.events.didOpen);
+ const didOpenEventSpy = new EventSpy(SbbTooltipElement.events.didOpen);
+ const willCloseEventSpy = new EventSpy(SbbTooltipElement.events.didClose);
+ const didCloseEventSpy = new EventSpy(SbbTooltipElement.events.didClose, element);
expect(secondTrigger).not.to.be.null;
expect(secondElement).not.to.be.null;
diff --git a/src/components/tooltip/tooltip/tooltip.stories.ts b/src/components/tooltip/tooltip/tooltip.stories.ts
index f4ff0c50ca..65dfb37f7b 100644
--- a/src/components/tooltip/tooltip/tooltip.stories.ts
+++ b/src/components/tooltip/tooltip/tooltip.stories.ts
@@ -11,7 +11,7 @@ import { waitForStablePosition } from '../../../storybook/testing/wait-for-stabl
import { sbbSpread } from '../../core/dom';
import readme from './readme.md?raw';
-import { SbbTooltip } from './tooltip';
+import { SbbTooltipElement } from './tooltip';
import '../../link';
import '../tooltip-trigger';
@@ -221,10 +221,10 @@ const meta: Meta = {
chromatic: { disableSnapshot: false },
actions: {
handles: [
- SbbTooltip.events.willOpen,
- SbbTooltip.events.didOpen,
- SbbTooltip.events.didClose,
- SbbTooltip.events.willClose,
+ SbbTooltipElement.events.willOpen,
+ SbbTooltipElement.events.didOpen,
+ SbbTooltipElement.events.didClose,
+ SbbTooltipElement.events.willClose,
],
},
backgrounds: {
diff --git a/src/components/tooltip/tooltip/tooltip.ts b/src/components/tooltip/tooltip/tooltip.ts
index ccca68532f..77f272feaa 100644
--- a/src/components/tooltip/tooltip/tooltip.ts
+++ b/src/components/tooltip/tooltip/tooltip.ts
@@ -35,7 +35,7 @@ const HORIZONTAL_OFFSET = 32;
let nextId = 0;
-const tooltipsRef = new Set();
+const tooltipsRef = new Set();
/**
* It displays contextual information within a tooltip.
@@ -47,7 +47,7 @@ const tooltipsRef = new Set();
* @event {CustomEvent<{ closeTarget: HTMLElement }>} didClose - Emits whenever the `sbb-tooltip` is closed.
*/
@customElement('sbb-tooltip')
-export class SbbTooltip extends LitElement {
+export class SbbTooltipElement extends LitElement {
public static override styles: CSSResultGroup = style;
public static readonly events = {
willOpen: 'willOpen',
@@ -117,21 +117,21 @@ export class SbbTooltip extends LitElement {
@state() private _currentLanguage = documentLanguage();
/** Emits whenever the `sbb-tooltip` starts the opening transition. */
- private _willOpen: EventEmitter = new EventEmitter(this, SbbTooltip.events.willOpen);
+ private _willOpen: EventEmitter = new EventEmitter(this, SbbTooltipElement.events.willOpen);
/** Emits whenever the `sbb-tooltip` is opened. */
- private _didOpen: EventEmitter = new EventEmitter(this, SbbTooltip.events.didOpen);
+ private _didOpen: EventEmitter = new EventEmitter(this, SbbTooltipElement.events.didOpen);
/** Emits whenever the `sbb-tooltip` begins the closing transition. */
private _willClose: EventEmitter<{ closeTarget: HTMLElement }> = new EventEmitter(
this,
- SbbTooltip.events.willClose,
+ SbbTooltipElement.events.willClose,
);
/** Emits whenever the `sbb-tooltip` is closed. */
private _didClose: EventEmitter<{ closeTarget: HTMLElement }> = new EventEmitter(
this,
- SbbTooltip.events.didClose,
+ SbbTooltipElement.events.didClose,
);
private _overlay: HTMLDivElement;
@@ -221,7 +221,7 @@ export class SbbTooltip extends LitElement {
// Validate trigger element and attach event listeners
this._configure(this.trigger);
this._state = 'closed';
- tooltipsRef.add(this as SbbTooltip);
+ tooltipsRef.add(this as SbbTooltipElement);
}
protected override willUpdate(changedProperties: PropertyValues): void {
@@ -243,7 +243,7 @@ export class SbbTooltip extends LitElement {
this._tooltipController?.abort();
this._windowEventsController?.abort();
this._focusTrap.disconnect();
- tooltipsRef.delete(this as SbbTooltip);
+ tooltipsRef.delete(this as SbbTooltipElement);
}
// Check if the trigger is valid and attach click event listeners.
@@ -493,6 +493,6 @@ export class SbbTooltip extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-tooltip': SbbTooltip;
+ 'sbb-tooltip': SbbTooltipElement;
}
}
diff --git a/src/components/train/train-blocked-passage/train-blocked-passage.e2e.ts b/src/components/train/train-blocked-passage/train-blocked-passage.e2e.ts
index 530e77c0d6..189645b618 100644
--- a/src/components/train/train-blocked-passage/train-blocked-passage.e2e.ts
+++ b/src/components/train/train-blocked-passage/train-blocked-passage.e2e.ts
@@ -1,13 +1,13 @@
import { assert, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbTrainBlockedPassage } from './train-blocked-passage';
+import { SbbTrainBlockedPassageElement } from './train-blocked-passage';
describe('sbb-train-blocked-passage', () => {
- let element: SbbTrainBlockedPassage;
+ let element: SbbTrainBlockedPassageElement;
it('renders', async () => {
element = await fixture(html``);
- assert.instanceOf(element, SbbTrainBlockedPassage);
+ assert.instanceOf(element, SbbTrainBlockedPassageElement);
});
});
diff --git a/src/components/train/train-blocked-passage/train-blocked-passage.ts b/src/components/train/train-blocked-passage/train-blocked-passage.ts
index 79722bf3b9..ac7c80eba1 100644
--- a/src/components/train/train-blocked-passage/train-blocked-passage.ts
+++ b/src/components/train/train-blocked-passage/train-blocked-passage.ts
@@ -7,7 +7,7 @@ import style from './train-blocked-passage.scss?lit&inline';
* It visually displays a blocked passage between train wagons.
*/
@customElement('sbb-train-blocked-passage')
-export class SbbTrainBlockedPassage extends LitElement {
+export class SbbTrainBlockedPassageElement extends LitElement {
public static override styles: CSSResultGroup = style;
protected override render(): TemplateResult {
@@ -24,6 +24,6 @@ export class SbbTrainBlockedPassage extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-train-blocked-passage': SbbTrainBlockedPassage;
+ 'sbb-train-blocked-passage': SbbTrainBlockedPassageElement;
}
}
diff --git a/src/components/train/train-formation/train-formation.e2e.ts b/src/components/train/train-formation/train-formation.e2e.ts
index 6cad312e74..fb0605026d 100644
--- a/src/components/train/train-formation/train-formation.e2e.ts
+++ b/src/components/train/train-formation/train-formation.e2e.ts
@@ -4,7 +4,7 @@ import { html } from 'lit/static-html.js';
import { waitForLitRender } from '../../core/testing';
-import { SbbTrainFormation } from './train-formation';
+import { SbbTrainFormationElement } from './train-formation';
import '../../icon';
import '../train';
import '../train-wagon';
@@ -41,11 +41,11 @@ async function createAndExtractAggregatedSectors(
}
describe('sbb-train-formation', () => {
- let element: SbbTrainFormation;
+ let element: SbbTrainFormationElement;
it('should render', async () => {
element = await fixture(html``);
- assert.instanceOf(element, SbbTrainFormation);
+ assert.instanceOf(element, SbbTrainFormationElement);
});
describe('sectors building', () => {
diff --git a/src/components/train/train-formation/train-formation.ts b/src/components/train/train-formation/train-formation.ts
index 87fe5c05b6..8981859c83 100644
--- a/src/components/train/train-formation/train-formation.ts
+++ b/src/components/train/train-formation/train-formation.ts
@@ -11,9 +11,9 @@ import {
} from '../../core/eventing';
import { i18nSector, i18nSectorShort, i18nTrains } from '../../core/i18n';
import { AgnosticResizeObserver } from '../../core/observers';
-import type { SbbTrain } from '../train';
-import type { SbbTrainBlockedPassage } from '../train-blocked-passage';
-import type { SbbTrainWagon } from '../train-wagon';
+import type { SbbTrainElement } from '../train';
+import type { SbbTrainBlockedPassageElement } from '../train-blocked-passage';
+import type { SbbTrainWagonElement } from '../train-wagon';
import style from './train-formation.scss?lit&inline';
@@ -29,7 +29,7 @@ interface AggregatedSector {
* @slot - Use the unnamed slot to add 'sbb-train' elements to the `sbb-train-formation`.
*/
@customElement('sbb-train-formation')
-export class SbbTrainFormation extends SlotChildObserver(LitElement) {
+export class SbbTrainFormationElement extends SlotChildObserver(LitElement) {
public static override styles: CSSResultGroup = style;
/** Option to hide all wagon labels. */
@@ -38,7 +38,7 @@ export class SbbTrainFormation extends SlotChildObserver(LitElement) {
@state() private _sectors: AggregatedSector[] = [];
- @state() private _trains: SbbTrain[];
+ @state() private _trains: SbbTrainElement[];
@state() private _currentLanguage = documentLanguage();
@@ -81,11 +81,14 @@ export class SbbTrainFormation extends SlotChildObserver(LitElement) {
this._sectors = Array.from(
this.querySelectorAll?.('sbb-train-wagon,sbb-train-blocked-passage') ?? [],
).reduce(
- (aggregatedSectors: AggregatedSector[], item: SbbTrainWagon | SbbTrainBlockedPassage) => {
+ (
+ aggregatedSectors: AggregatedSector[],
+ item: SbbTrainWagonElement | SbbTrainBlockedPassageElement,
+ ) => {
const currentAggregatedSector = aggregatedSectors[aggregatedSectors.length - 1];
if (item.tagName === 'SBB-TRAIN-WAGON') {
- const sectorAttribute = (item as SbbTrainWagon).sector;
+ const sectorAttribute = (item as SbbTrainWagonElement).sector;
if (!currentAggregatedSector.label && sectorAttribute) {
currentAggregatedSector.label = sectorAttribute;
@@ -113,7 +116,7 @@ export class SbbTrainFormation extends SlotChildObserver(LitElement) {
protected override checkChildren(): void {
this._readSectors();
this._trains = Array.from(this.children ?? []).filter(
- (e): e is SbbTrain => e.tagName === 'SBB-TRAIN',
+ (e): e is SbbTrainElement => e.tagName === 'SBB-TRAIN',
);
}
@@ -188,6 +191,6 @@ export class SbbTrainFormation extends SlotChildObserver(LitElement) {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-train-formation': SbbTrainFormation;
+ 'sbb-train-formation': SbbTrainFormationElement;
}
}
diff --git a/src/components/train/train-wagon/train-wagon.e2e.ts b/src/components/train/train-wagon/train-wagon.e2e.ts
index 87b99f5b6b..fef08af8bd 100644
--- a/src/components/train/train-wagon/train-wagon.e2e.ts
+++ b/src/components/train/train-wagon/train-wagon.e2e.ts
@@ -3,19 +3,19 @@ import { html } from 'lit/static-html.js';
import { EventSpy, waitForCondition, waitForLitRender } from '../../core/testing';
-import { SbbTrainWagon } from './train-wagon';
+import { SbbTrainWagonElement } from './train-wagon';
describe('sbb-train-wagon', () => {
- let element: SbbTrainWagon;
+ let element: SbbTrainWagonElement;
it('renders', async () => {
element = await fixture(html``);
- assert.instanceOf(element, SbbTrainWagon);
+ assert.instanceOf(element, SbbTrainWagonElement);
});
it('should emit sectorChange', async () => {
element = await fixture(html``);
- const sectorChangeSpy = new EventSpy(SbbTrainWagon.events.sectorChange);
+ const sectorChangeSpy = new EventSpy(SbbTrainWagonElement.events.sectorChange);
element.sector = 'B';
await waitForCondition(() => sectorChangeSpy.events.length === 1);
diff --git a/src/components/train/train-wagon/train-wagon.spec.ts b/src/components/train/train-wagon/train-wagon.spec.ts
index 1abfa6df00..cee3f69b34 100644
--- a/src/components/train/train-wagon/train-wagon.spec.ts
+++ b/src/components/train/train-wagon/train-wagon.spec.ts
@@ -3,7 +3,7 @@ import { html } from 'lit/static-html.js';
import { waitForLitRender } from '../../core/testing';
-import { SbbTrainWagon } from './train-wagon';
+import { SbbTrainWagonElement } from './train-wagon';
import '.';
import '../../icon';
import '../../timetable-occupancy-icon';
@@ -11,7 +11,7 @@ import '../../timetable-occupancy-icon';
async function extractAriaLabels(
properties: Partial<
Pick<
- SbbTrainWagon,
+ SbbTrainWagonElement,
| 'type'
| 'occupancy'
| 'sector'
diff --git a/src/components/train/train-wagon/train-wagon.ts b/src/components/train/train-wagon/train-wagon.ts
index da0e3d2f7d..31cb6994a8 100644
--- a/src/components/train/train-wagon/train-wagon.ts
+++ b/src/components/train/train-wagon/train-wagon.ts
@@ -21,7 +21,7 @@ import {
i18nWagonLabelNumber,
} from '../../core/i18n';
import { SbbOccupancy } from '../../core/interfaces';
-import type { SbbIcon } from '../../icon';
+import type { SbbIconElement } from '../../icon';
import '../../timetable-occupancy-icon';
import style from './train-wagon.scss?lit&inline';
@@ -32,7 +32,7 @@ import style from './train-wagon.scss?lit&inline';
* @slot - Use the unnamed slot to add one or more `sbb-icon` for meta-information of the `sbb-train-wagon`.
*/
@customElement('sbb-train-wagon')
-export class SbbTrainWagon extends SlotChildObserver(LitElement) {
+export class SbbTrainWagonElement extends SlotChildObserver(LitElement) {
public static override styles: CSSResultGroup = style;
public static readonly events = {
sectorChange: 'sectorChange',
@@ -70,7 +70,7 @@ export class SbbTrainWagon extends SlotChildObserver(LitElement) {
public additionalAccessibilityText?: string;
/** Slotted Sbb-icons. */
- @state() private _icons: SbbIcon[];
+ @state() private _icons: SbbIconElement[];
@state() private _currentLanguage = documentLanguage();
@@ -93,10 +93,14 @@ export class SbbTrainWagon extends SlotChildObserver(LitElement) {
* @internal
* Emits whenever the sector value changes.
*/
- private _sectorChange: EventEmitter = new EventEmitter(this, SbbTrainWagon.events.sectorChange, {
- bubbles: true,
- cancelable: true,
- });
+ private _sectorChange: EventEmitter = new EventEmitter(
+ this,
+ SbbTrainWagonElement.events.sectorChange,
+ {
+ bubbles: true,
+ cancelable: true,
+ },
+ );
private _sectorChanged(): void {
this._sectorChange.emit();
@@ -107,7 +111,7 @@ export class SbbTrainWagon extends SlotChildObserver(LitElement) {
*/
protected override checkChildren(): void {
this._icons = Array.from(this.children ?? []).filter(
- (e): e is SbbIcon => e.tagName === 'SBB-ICON',
+ (e): e is SbbIconElement => e.tagName === 'SBB-ICON',
);
}
@@ -252,6 +256,6 @@ export class SbbTrainWagon extends SlotChildObserver(LitElement) {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-train-wagon': SbbTrainWagon;
+ 'sbb-train-wagon': SbbTrainWagonElement;
}
}
diff --git a/src/components/train/train/train.e2e.ts b/src/components/train/train/train.e2e.ts
index 4f37aea3c4..73a68dc21b 100644
--- a/src/components/train/train/train.e2e.ts
+++ b/src/components/train/train/train.e2e.ts
@@ -3,15 +3,15 @@ import { html } from 'lit/static-html.js';
import { EventSpy, waitForLitRender } from '../../core/testing';
-import { SbbTrain } from './train';
+import { SbbTrainElement } from './train';
import '../../icon';
describe('sbb-train', () => {
- let element: SbbTrain;
+ let element: SbbTrainElement;
it('should render', async () => {
element = await fixture(html``);
- assert.instanceOf(element, SbbTrain);
+ assert.instanceOf(element, SbbTrainElement);
});
it('should emit trainSlotChange', async () => {
@@ -22,7 +22,7 @@ describe('sbb-train', () => {
`);
- const trainSlotChangeSpy = new EventSpy(SbbTrain.events.trainSlotChange);
+ const trainSlotChangeSpy = new EventSpy(SbbTrainElement.events.trainSlotChange);
element.querySelector('sbb-train-wagon').remove();
await waitForLitRender(element);
diff --git a/src/components/train/train/train.ts b/src/components/train/train/train.ts
index cc505c25f1..a60fe256f1 100644
--- a/src/components/train/train/train.ts
+++ b/src/components/train/train/train.ts
@@ -11,8 +11,8 @@ import {
} from '../../core/eventing';
import { i18nTrain, i18nWagonsLabel } from '../../core/i18n';
import type { TitleLevel } from '../../title';
-import type { SbbTrainBlockedPassage } from '../train-blocked-passage';
-import type { SbbTrainWagon } from '../train-wagon';
+import type { SbbTrainBlockedPassageElement } from '../train-blocked-passage';
+import type { SbbTrainWagonElement } from '../train-wagon';
import style from './train.scss?lit&inline';
@@ -24,7 +24,7 @@ import '../../icon';
* @slot - Use the unnamed slot to add 'sbb-train-wagon' elements to the `sbb-train`.
*/
@customElement('sbb-train')
-export class SbbTrain extends SlotChildObserver(LitElement) {
+export class SbbTrainElement extends SlotChildObserver(LitElement) {
public static override styles: CSSResultGroup = style;
public static readonly events = {
trainSlotChange: 'trainSlotChange',
@@ -45,7 +45,7 @@ export class SbbTrain extends SlotChildObserver(LitElement) {
/** Controls the direction indicator to show the arrow left or right. Default is left. */
@property({ reflect: true }) public direction: 'left' | 'right' = 'left';
- @state() private _wagons: (SbbTrainBlockedPassage | SbbTrainWagon)[] = [];
+ @state() private _wagons: (SbbTrainBlockedPassageElement | SbbTrainWagonElement)[] = [];
@state() private _currentLanguage = documentLanguage();
@@ -53,10 +53,14 @@ export class SbbTrain extends SlotChildObserver(LitElement) {
* @internal
* Emits whenever the train slot changes.
*/
- private _trainSlotChange: EventEmitter = new EventEmitter(this, SbbTrain.events.trainSlotChange, {
- bubbles: true,
- cancelable: true,
- });
+ private _trainSlotChange: EventEmitter = new EventEmitter(
+ this,
+ SbbTrainElement.events.trainSlotChange,
+ {
+ bubbles: true,
+ cancelable: true,
+ },
+ );
private _handlerRepository = new HandlerRepository(
this,
@@ -92,7 +96,7 @@ export class SbbTrain extends SlotChildObserver(LitElement) {
protected override checkChildren(): void {
const wagons = Array.from(this.children ?? []).filter(
- (e): e is SbbTrainBlockedPassage | SbbTrainWagon =>
+ (e): e is SbbTrainBlockedPassageElement | SbbTrainWagonElement =>
e.tagName === 'SBB-TRAIN-WAGON' || e.tagName === 'SBB-TRAIN-BLOCKED-PASSAGE',
);
// If the slotted sbb-train-wagon and sbb-train-blocked-passage instances have not changed, we can skip syncing and updating
@@ -162,6 +166,6 @@ export class SbbTrain extends SlotChildObserver(LitElement) {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-train': SbbTrain;
+ 'sbb-train': SbbTrainElement;
}
}
diff --git a/src/components/visual-checkbox/visual-checkbox.e2e.ts b/src/components/visual-checkbox/visual-checkbox.e2e.ts
index 4db487ed69..19ab0661b8 100644
--- a/src/components/visual-checkbox/visual-checkbox.e2e.ts
+++ b/src/components/visual-checkbox/visual-checkbox.e2e.ts
@@ -1,13 +1,13 @@
import { assert, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
-import { SbbVisualCheckbox } from './visual-checkbox';
+import { SbbVisualCheckboxElement } from './visual-checkbox';
describe('sbb-visual-checkbox', (): void => {
it('renders', async (): Promise => {
- const element: SbbVisualCheckbox = await fixture(
+ const element: SbbVisualCheckboxElement = await fixture(
html``,
);
- assert.instanceOf(element, SbbVisualCheckbox);
+ assert.instanceOf(element, SbbVisualCheckboxElement);
});
});
diff --git a/src/components/visual-checkbox/visual-checkbox.ts b/src/components/visual-checkbox/visual-checkbox.ts
index 216e81385a..3c2b984220 100644
--- a/src/components/visual-checkbox/visual-checkbox.ts
+++ b/src/components/visual-checkbox/visual-checkbox.ts
@@ -7,7 +7,7 @@ import style from './visual-checkbox.scss?lit&inline';
* It visually displays a non-interactive checkbox.
*/
@customElement('sbb-visual-checkbox')
-export class SbbVisualCheckbox extends LitElement {
+export class SbbVisualCheckboxElement extends LitElement {
public static override styles: CSSResultGroup = style;
/** Checked state. */
@@ -51,6 +51,6 @@ export class SbbVisualCheckbox extends LitElement {
declare global {
interface HTMLElementTagNameMap {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'sbb-visual-checkbox': SbbVisualCheckbox;
+ 'sbb-visual-checkbox': SbbVisualCheckboxElement;
}
}
diff --git a/src/react/vite.config.ts b/src/react/vite.config.ts
index 28b30b11f5..3d28a71ffc 100644
--- a/src/react/vite.config.ts
+++ b/src/react/vite.config.ts
@@ -86,15 +86,13 @@ function generateReactWrappers(): PluginOption {
const reactTemplate = `/* autogenerated */
import { createComponent, type EventName } from '@lit/react';
-import { ${declaration.name} as ${declaration.name}Element } from '@sbb-esta/lyne-components/${
- module.path
- }';
+import { ${declaration.name} } from '@sbb-esta/lyne-components/${module.path}';
import react from 'react';
// eslint-disable-next-line @typescript-eslint/naming-convention
-export const ${declaration.name} = createComponent({
+export const ${declaration.name.replace(/Element$/, '')} = createComponent({
tagName: '${declaration.tagName}',
- elementClass: ${declaration.name}Element,
+ elementClass: ${declaration.name},
react,${
declaration.events
? `
diff --git a/src/storybook/pages/home/home--logged-in.stories.ts b/src/storybook/pages/home/home--logged-in.stories.ts
index 6da1336f3b..2925933a43 100644
--- a/src/storybook/pages/home/home--logged-in.stories.ts
+++ b/src/storybook/pages/home/home--logged-in.stories.ts
@@ -4,7 +4,7 @@ import isChromatic from 'chromatic';
import { html, TemplateResult } from 'lit';
import { styleMap } from 'lit/directives/style-map.js';
-import type { SbbDialog } from '../../../components/dialog';
+import type { SbbDialogElement } from '../../../components/dialog';
import { futureLeg, pastLeg } from '../../../components/pearl-chain/pearl-chain.sample-data';
import {
@@ -184,7 +184,7 @@ const Template = (args: Args): TemplateResult => html`
(document.getElementById('my-dialog') as SbbDialog).open()}
+ @click=${() => (document.getElementById('my-dialog') as SbbDialogElement).open()}
>
All purchased tickets
@@ -200,7 +200,8 @@ const Template = (args: Args): TemplateResult => html`
(document.getElementById('my-stacked-dialog') as SbbDialog).open()}
+ @click=${() =>
+ (document.getElementById('my-stacked-dialog') as SbbDialogElement).open()}
>
Open stacked dialog
diff --git a/src/storybook/pages/home/home.common.ts b/src/storybook/pages/home/home.common.ts
index 585621f78d..ac574fe0fc 100644
--- a/src/storybook/pages/home/home.common.ts
+++ b/src/storybook/pages/home/home.common.ts
@@ -4,7 +4,10 @@ import { html, TemplateResult } from 'lit';
import { ref } from 'lit/directives/ref.js';
import { sbbSpread } from '../../../components/core/dom';
-import type { SbbNavigation, SbbNavigationMarker } from '../../../components/navigation';
+import type {
+ SbbNavigationElement,
+ SbbNavigationMarkerElement,
+} from '../../../components/navigation';
import '../../../components/button';
import '../../../components/card';
import '../../../components/clock';
@@ -36,9 +39,9 @@ export const timetableInput = (): TemplateResult => html`
`;
-const onNavigationClose = (dialog: SbbNavigation): void => {
+const onNavigationClose = (dialog: SbbNavigationElement): void => {
dialog?.addEventListener('did-close', () => {
- (document.getElementById('nav-marker') as SbbNavigationMarker).reset();
+ (document.getElementById('nav-marker') as SbbNavigationMarkerElement).reset();
document.getElementById('nav-1').setAttribute('active', '');
});
};
@@ -46,7 +49,7 @@ const onNavigationClose = (dialog: SbbNavigation): void => {
export const navigation = (): TemplateResult => html`
onNavigationClose(dialog))}
+ ${ref((dialog: SbbNavigationElement) => onNavigationClose(dialog))}
>
diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts
index 83ef97040b..09a94a9ef8 100644
--- a/src/vite-env.d.ts
+++ b/src/vite-env.d.ts
@@ -5,387 +5,3 @@ declare module '*?lit&inline' {
const src: import('lit').CSSResultGroup;
export default src;
}
-
-declare namespace JSX {
- type Element = jsxDom.JSX.Element;
- type SbbAccordion = import('./components/sbb-accordion/sbb-accordion').SbbAccordion;
- type SbbActionGroup = import('./components/sbb-action-group/sbb-action-group').SbbActionGroup;
- type SbbAlert = import('./components/sbb-alert/sbb-alert').SbbAlert;
- type SbbAlertGroup = import('./components/sbb-alert-group/sbb-alert-group').SbbAlertGroup;
- type SbbAutocomplete = import('./components/sbb-autocomplete/sbb-autocomplete').SbbAutocomplete;
- type SbbBreadcrumb = import('./components/sbb-breadcrumb/sbb-breadcrumb').SbbBreadcrumb;
- type SbbBreadcrumbGroup =
- import('./components/sbb-breadcrumb-group/sbb-breadcrumb-group').SbbBreadcrumbGroup;
- type SbbButton = import('./components/sbb-button/sbb-button').SbbButton;
- type SbbCalendar = import('./components/sbb-calendar/sbb-calendar').SbbCalendar;
- type SbbCard = import('./components/sbb-card/sbb-card').SbbCard;
- type SbbCardAction = import('./components/sbb-card-action/sbb-card-action').SbbCardAction;
- type SbbCardBadge = import('./components/sbb-card-badge/sbb-card-badge').SbbCardBadge;
- type SbbCheckbox = import('./components/sbb-checkbox/sbb-checkbox').SbbCheckbox;
- type SbbCheckboxGroup =
- import('./components/sbb-checkbox-group/sbb-checkbox-group').SbbCheckboxGroup;
- type SbbChip = import('./components/sbb-chip/sbb-chip').SbbChip;
- type SbbClock = import('./components/sbb-clock/sbb-clock').SbbClock;
- type SbbDatepicker = import('./components/sbb-datepicker/sbb-datepicker').SbbDatepicker;
- type SbbDatepickerNextDay =
- import('./components/sbb-datepicker-next-day/sbb-datepicker-next-day').SbbDatepickerNextDay;
- type SbbDatepickerPreviousDay =
- import('./components/sbb-datepicker-previous-day/sbb-datepicker-previous-day').SbbDatepickerPreviousDay;
- type SbbDatepickerToggle =
- import('./components/sbb-datepicker-toggle/sbb-datepicker-toggle').SbbDatepickerToggle;
- type SbbDialog = import('./components/sbb-dialog/sbb-dialog').SbbDialog;
- type SbbDivider = import('./components/sbb-divider/sbb-divider').SbbDivider;
- type SbbExpansionPanel =
- import('./components/sbb-expansion-panel/sbb-expansion-panel').SbbExpansionPanel;
- type SbbExpansionPanelContent =
- import('./components/sbb-expansion-panel-content/sbb-expansion-panel-content').SbbExpansionPanelContent;
- type SbbExpansionPanelHeader =
- import('./components/sbb-expansion-panel-header/sbb-expansion-panel-header').SbbExpansionPanelHeader;
- type SbbFileSelector = import('./components/sbb-file-selector/sbb-file-selector').SbbFileSelector;
- type SbbFooter = import('./components/sbb-footer/sbb-footer').SbbFooter;
- type SbbFormError = import('./components/sbb-form-error/sbb-form-error').SbbFormError;
- type SbbFormField = import('./components/sbb-form-field/sbb-form-field').SbbFormField;
- type SbbFormFieldClear =
- import('./components/sbb-form-field-clear/sbb-form-field-clear').SbbFormFieldClear;
- type SbbHeader = import('./components/sbb-header/sbb-header').SbbHeader;
- type SbbHeaderAction = import('./components/sbb-header-action/sbb-header-action').SbbHeaderAction;
- type SbbIcon = import('./components/sbb-icon/sbb-icon').SbbIcon;
- type SbbImage = import('./components/sbb-image/sbb-image').SbbImage;
- type SbbJourneyHeader =
- import('./components/sbb-journey-header/sbb-journey-header').SbbJourneyHeader;
- type SbbJourneySummary =
- import('./components/sbb-journey-summary/sbb-journey-summary').SbbJourneySummary;
- type SbbLink = import('./components/sbb-link/sbb-link').SbbLink;
- type SbbLinkList = import('./components/sbb-link-list/sbb-link-list').SbbLinkList;
- type SbbLoadingIndicator =
- import('./components/sbb-loading-indicator/sbb-loading-indicator').SbbLoadingIndicator;
- type SbbLogo = import('./components/sbb-logo/sbb-logo').SbbLogo;
- type SbbMapContainer = import('./components/sbb-map-container/sbb-map-container').SbbMapContainer;
- type SbbMenu = import('./components/sbb-menu/sbb-menu').SbbMenu;
- type SbbMenuAction = import('./components/sbb-menu-action/sbb-menu-action').SbbMenuAction;
- type SbbMessage = import('./components/sbb-message/sbb-message').SbbMessage;
- type SbbNavigation = import('./components/sbb-navigation/sbb-navigation').SbbNavigation;
- type SbbNavigationAction =
- import('./components/sbb-navigation-action/sbb-navigation-action').SbbNavigationAction;
- type SbbNavigationList =
- import('./components/sbb-navigation-list/sbb-navigation-list').SbbNavigationList;
- type SbbNavigationMarker =
- import('./components/sbb-navigation-marker/sbb-navigation-marker').SbbNavigationMarker;
- type SbbNavigationSection =
- import('./components/sbb-navigation-section/sbb-navigation-section').SbbNavigationSection;
- type SbbNotification = import('./components/sbb-notification/sbb-notification').SbbNotification;
- type SbbOptgroup = import('./components/sbb-optgroup/sbb-optgroup').SbbOptgroup;
- type SbbOption = import('./components/sbb-option/sbb-option').SbbOption;
- type SbbPearlChain = import('./components/sbb-pearl-chain/sbb-pearl-chain').SbbPearlChain;
- type SbbPearlChainTime =
- import('./components/sbb-pearl-chain-time/sbb-pearl-chain-time').SbbPearlChainTime;
- type SbbPearlChainVertical =
- import('./components/sbb-pearl-chain-vertical/sbb-pearl-chain-vertical').SbbPearlChainVertical;
- type SbbPearlChainVerticalItem =
- import('./components/sbb-pearl-chain-vertical-item/sbb-pearl-chain-vertical-item').SbbPearlChainVerticalItem;
- type SbbRadioButton = import('./components/sbb-radio-button/sbb-radio-button').SbbRadioButton;
- type SbbRadioButtonGroup =
- import('./components/sbb-radio-button-group/sbb-radio-button-group').SbbRadioButtonGroup;
- type SbbSelect = import('./components/sbb-select/sbb-select').SbbSelect;
- type SbbSelectionPanel =
- import('./components/sbb-selection-panel/sbb-selection-panel').SbbSelectionPanel;
- type SbbSignet = import('./components/sbb-signet/sbb-signet').SbbSignet;
- type SbbSkiplinkList = import('./components/sbb-skiplink-list/sbb-skiplink-list').SbbSkiplinkList;
- type SbbSlider = import('./components/sbb-slider/sbb-slider').SbbSlider;
- type SbbTabGroup = import('./components/sbb-tab-group/sbb-tab-group').SbbTabGroup;
- type SbbTabTitle = import('./components/sbb-tab-title/sbb-tab-title').SbbTabTitle;
- type SbbTag = import('./components/sbb-tag/sbb-tag').SbbTag;
- type SbbTagGroup = import('./components/sbb-tag-group/sbb-tag-group').SbbTagGroup;
- type SbbTeaser = import('./components/sbb-teaser/sbb-teaser').SbbTeaser;
- type SbbTeaserHero = import('./components/sbb-teaser-hero/sbb-teaser-hero').SbbTeaserHero;
- type SbbTimeInput = import('./components/sbb-time-input/sbb-time-input').SbbTimeInput;
- type SbbTimetableBarrierFree =
- import('./components/sbb-timetable-barrier-free/sbb-timetable-barrier-free').SbbTimetableBarrierFree;
- type SbbTimetableDuration =
- import('./components/sbb-timetable-duration/sbb-timetable-duration').SbbTimetableDuration;
- type SbbTimetableOccupancy =
- import('./components/sbb-timetable-occupancy/sbb-timetable-occupancy').SbbTimetableOccupancy;
- type SbbTimetableParkAndRail =
- import('./components/sbb-timetable-park-and-rail/sbb-timetable-park-and-rail').SbbTimetableParkAndRail;
- type SbbTimetableRow = import('./components/sbb-timetable-row/sbb-timetable-row').SbbTimetableRow;
- type SbbTimetableRowColumnHeaders =
- import('./components/sbb-timetable-row-column-headers/sbb-timetable-row-column-headers').SbbTimetableRowColumnHeaders;
- type SbbTimetableRowDayChange =
- import('./components/sbb-timetable-row-day-change/sbb-timetable-row-day-change').SbbTimetableRowDayChange;
- type SbbTimetableRowHeader =
- import('./components/sbb-timetable-row-header/sbb-timetable-row-header').SbbTimetableRowHeader;
- type SbbTimetableTransportationNumber =
- import('./components/sbb-timetable-transportation-number/sbb-timetable-transportation-number').SbbTimetableTransportationNumber;
- type SbbTimetableTransportationTime =
- import('./components/sbb-timetable-transportation-time/sbb-timetable-transportation-time').SbbTimetableTransportationTime;
- type SbbTimetableTravelHints =
- import('./components/sbb-timetable-travel-hints/sbb-timetable-travel-hints').SbbTimetableTravelHints;
- type SbbTitle = import('./components/sbb-title/sbb-title').SbbTitle;
- type SbbToast = import('./components/sbb-toast/sbb-toast').SbbToast;
- type SbbToggle = import('./components/sbb-toggle/sbb-toggle').SbbToggle;
- type SbbToggleCheck = import('./components/sbb-toggle-check/sbb-toggle-check').SbbToggleCheck;
- type SbbToggleOption = import('./components/sbb-toggle-option/sbb-toggle-option').SbbToggleOption;
- type SbbTooltip = import('./components/sbb-tooltip/sbb-tooltip').SbbTooltip;
- type SbbTooltipTrigger =
- import('./components/sbb-tooltip-trigger/sbb-tooltip-trigger').SbbTooltipTrigger;
- type SbbTrain = import('./components/sbb-train/sbb-train').SbbTrain;
- type SbbTrainBlockedPassage =
- import('./components/sbb-train-blocked-passage/sbb-train-blocked-passage').SbbTrainBlockedPassage;
- type SbbTrainFormation =
- import('./components/sbb-train-formation/sbb-train-formation').SbbTrainFormation;
- type SbbTrainWagon = import('./components/sbb-train-wagon/sbb-train-wagon').SbbTrainWagon;
- type SbbVisualCheckbox =
- import('./components/sbb-visual-checkbox/sbb-visual-checkbox').SbbVisualCheckbox;
-
- interface IntrinsicElements {
- 'sbb-accordion': jsxDom.DetailedHTMLProps, SbbAccordion>;
- 'sbb-action-group': jsxDom.DetailedHTMLProps<
- jsxDom.HTMLAttributes,
- SbbActionGroup
- >;
- 'sbb-alert': jsxDom.DetailedHTMLProps, SbbAlert>;
- 'sbb-alert-group': jsxDom.DetailedHTMLProps<
- jsxDom.HTMLAttributes,
- SbbAlertGroup
- >;
- 'sbb-autocomplete': jsxDom.DetailedHTMLProps<
- jsxDom.HTMLAttributes,
- SbbAutocomplete
- >;
- 'sbb-breadcrumb': jsxDom.DetailedHTMLProps, SbbBreadcrumb>;
- 'sbb-breadcrumb-group': jsxDom.DetailedHTMLProps<
- jsxDom.HTMLAttributes,
- SbbBreadcrumbGroup
- >;
- 'sbb-button': jsxDom.DetailedHTMLProps, SbbButton>;
- 'sbb-calendar': jsxDom.DetailedHTMLProps, SbbCalendar>;
- 'sbb-card': jsxDom.DetailedHTMLProps, SbbCard>;
- 'sbb-card-action': jsxDom.DetailedHTMLProps<
- jsxDom.HTMLAttributes,
- SbbCardAction
- >;
- 'sbb-card-badge': jsxDom.DetailedHTMLProps, SbbCardBadge>;
- 'sbb-checkbox': jsxDom.DetailedHTMLProps, SbbCheckbox>;
- 'sbb-checkbox-group': jsxDom.DetailedHTMLProps<
- jsxDom.HTMLAttributes,
- SbbCheckboxGroup
- >;
- 'sbb-chip': jsxDom.DetailedHTMLProps, SbbChip>;
- 'sbb-clock': jsxDom.DetailedHTMLProps, SbbClock>;
- 'sbb-datepicker': jsxDom.DetailedHTMLProps, SbbDatepicker>;
- 'sbb-datepicker-next-day': jsxDom.DetailedHTMLProps<
- jsxDom.HTMLAttributes,
- SbbDatepickerNextDay
- >;
- 'sbb-datepicker-previous-day': jsxDom.DetailedHTMLProps<
- jsxDom.HTMLAttributes,
- SbbDatepickerPreviousDay
- >;
- 'sbb-datepicker-toggle': jsxDom.DetailedHTMLProps<
- jsxDom.HTMLAttributes,
- SbbDatepickerToggle
- >;
- 'sbb-dialog': jsxDom.DetailedHTMLProps, SbbDialog>;
- 'sbb-divider': jsxDom.DetailedHTMLProps, SbbDivider>;
- 'sbb-expansion-panel': jsxDom.DetailedHTMLProps<
- jsxDom.HTMLAttributes,
- SbbExpansionPanel
- >;
- 'sbb-expansion-panel-content': jsxDom.DetailedHTMLProps<
- jsxDom.HTMLAttributes,
- SbbExpansionPanelContent
- >;
- 'sbb-expansion-panel-header': jsxDom.DetailedHTMLProps<
- jsxDom.HTMLAttributes,
- SbbExpansionPanelHeader
- >;
- 'sbb-file-selector': jsxDom.DetailedHTMLProps<
- jsxDom.HTMLAttributes,
- SbbFileSelector
- >;
- 'sbb-footer': jsxDom.DetailedHTMLProps, SbbFooter>;
- 'sbb-form-error': jsxDom.DetailedHTMLProps, SbbFormError>;
- 'sbb-form-field': jsxDom.DetailedHTMLProps, SbbFormField>;
- 'sbb-form-field-clear': jsxDom.DetailedHTMLProps<
- jsxDom.HTMLAttributes,
- SbbFormFieldClear
- >;
- 'sbb-header': jsxDom.DetailedHTMLProps, SbbHeader>;
- 'sbb-header-action': jsxDom.DetailedHTMLProps<
- jsxDom.HTMLAttributes,
- SbbHeaderAction
- >;
- 'sbb-icon': jsxDom.DetailedHTMLProps, SbbIcon>;
- 'sbb-image': jsxDom.DetailedHTMLProps, SbbImage>;
- 'sbb-journey-header': jsxDom.DetailedHTMLProps<
- jsxDom.HTMLAttributes,
- SbbJourneyHeader
- >;
- 'sbb-journey-summary': jsxDom.DetailedHTMLProps<
- jsxDom.HTMLAttributes,
- SbbJourneySummary
- >;
- 'sbb-link': jsxDom.DetailedHTMLProps, SbbLink>;
- 'sbb-link-list': jsxDom.DetailedHTMLProps, SbbLinkList>;
- 'sbb-loading-indicator': jsxDom.DetailedHTMLProps<
- jsxDom.HTMLAttributes,
- SbbLoadingIndicator
- >;
- 'sbb-logo': jsxDom.DetailedHTMLProps, SbbLogo>;
- 'sbb-map-container': jsxDom.DetailedHTMLProps<
- jsxDom.HTMLAttributes,
- SbbMapContainer
- >;
- 'sbb-menu': jsxDom.DetailedHTMLProps, SbbMenu>;
- 'sbb-menu-action': jsxDom.DetailedHTMLProps<
- jsxDom.HTMLAttributes,
- SbbMenuAction
- >;
- 'sbb-message': jsxDom.DetailedHTMLProps, SbbMessage>;
- 'sbb-navigation': jsxDom.DetailedHTMLProps, SbbNavigation>;
- 'sbb-navigation-action': jsxDom.DetailedHTMLProps<
- jsxDom.HTMLAttributes,
- SbbNavigationAction
- >;
- 'sbb-navigation-list': jsxDom.DetailedHTMLProps<
- jsxDom.HTMLAttributes,
- SbbNavigationList
- >;
- 'sbb-navigation-marker': jsxDom.DetailedHTMLProps<
- jsxDom.HTMLAttributes,
- SbbNavigationMarker
- >;
- 'sbb-navigation-section': jsxDom.DetailedHTMLProps<
- jsxDom.HTMLAttributes,
- SbbNavigationSection
- >;
- 'sbb-notification': jsxDom.DetailedHTMLProps<
- jsxDom.HTMLAttributes,
- SbbNotification
- >;
- 'sbb-optgroup': jsxDom.DetailedHTMLProps, SbbOptgroup>;
- 'sbb-option': jsxDom.DetailedHTMLProps