Skip to content

Commit

Permalink
fix: cleanup deprecated core functionality (#3219)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Several deprecated core functionality has been removed.
- dom.js `getDocumentWritingMode()` removed
- dom.js `getLocalName()` removed
- eventing.js `formElementHandlerAspect()` removed
- eventing.js `HandlerRepository`, `HandlerAspectParams` and
`HandlerAspect` removed
- mixins.js `SbbFocusableDisabledActionMixin` removed
- observers.js completely removed (containing
`NodeIntersectionObserver`, `AgnosticIntersectionObserver`,
`NodeMutationObserver`, `AgnosticMutationObserver`, `NodeResizeObserver`
and `AgnosticResizeObserver`)
  • Loading branch information
jeripeierSBB authored Nov 20, 2024
1 parent 5a02676 commit 4b129c4
Show file tree
Hide file tree
Showing 11 changed files with 0 additions and 205 deletions.
2 changes: 0 additions & 2 deletions src/elements/core/dom.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
export * from './dom/breakpoint.js';
export * from './dom/find-referenced-element.js';
export * from './dom/get-document-writing-mode.js';
export * from './dom/host-context.js';
export * from './dom/input-element.js';
export * from './dom/set-or-remove-attribute.js';
export * from './dom/platform.js';
export * from './dom/scroll.js';
export * from './dom/ssr.js';
7 changes: 0 additions & 7 deletions src/elements/core/dom/get-document-writing-mode.ts

This file was deleted.

29 changes: 0 additions & 29 deletions src/elements/core/dom/ssr.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/elements/core/eventing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ export * from './eventing/event-emitter.js';
export * from './eventing/event-target.js';
export * from './eventing/form-element-handlers.js';
export * from './eventing/forward-event.js';
export * from './eventing/handler-repository.js';
export * from './eventing/is-event-prevented.js';
export * from './eventing/throttle.js';
11 changes: 0 additions & 11 deletions src/elements/core/eventing/form-element-handlers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import type { HandlerAspect } from './handler-repository.js';

/**
* Prevents scrolling from pressing Space
* @param event The origin event.
Expand All @@ -9,12 +7,3 @@ export function preventScrollOnSpacebarPress(event: KeyboardEvent): void {
event.preventDefault();
}
}

/**
* Handler to prevent scrolling on space bar click.
*
* @deprecated TODO: remove once radio button became form element
*/
export const formElementHandlerAspect: HandlerAspect = ({ host, signal }) => {
host.addEventListener('keydown', preventScrollOnSpacebarPress, { signal });
};
45 changes: 0 additions & 45 deletions src/elements/core/eventing/handler-repository.ts

This file was deleted.

30 changes: 0 additions & 30 deletions src/elements/core/mixins/disabled-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,33 +97,3 @@ export const SbbDisabledTabIndexActionMixin = <
> &
T;
};

/**
* Extends `SbbDisabledMixin` with the `aria-disabled` attribute.
* For a11y purposes, keeps the element focusable even when disabled.
* @deprecated Will be removed with next major version
*/
// eslint-disable-next-line @typescript-eslint/naming-convention
export const SbbFocusableDisabledActionMixin = <T extends AbstractConstructor<LitElement>>(
superClass: T,
): AbstractConstructor<SbbDisabledMixinType> & T => {
abstract class SbbFocusableDisabledAction
extends SbbDisabledMixin(superClass)
implements SbbDisabledMixinType
{
protected override willUpdate(changedProperties: PropertyValues<this>): void {
super.willUpdate(changedProperties);

if (!changedProperties.has('disabled')) {
return;
}

if (this.disabled) {
this.setAttribute('aria-disabled', 'true');
} else {
this.removeAttribute('aria-disabled');
}
}
}
return SbbFocusableDisabledAction as AbstractConstructor<SbbDisabledMixinType> & T;
};
3 changes: 0 additions & 3 deletions src/elements/core/observers.ts

This file was deleted.

31 changes: 0 additions & 31 deletions src/elements/core/observers/intersection-observer.ts

This file was deleted.

23 changes: 0 additions & 23 deletions src/elements/core/observers/mutation-observer.ts

This file was deleted.

23 changes: 0 additions & 23 deletions src/elements/core/observers/resize-observer.ts

This file was deleted.

0 comments on commit 4b129c4

Please sign in to comment.