mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
refactor(packages): clean up UI component types and data flow (#479)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import type { PropertyValues } from '@lit/reactive-element';
|
||||
import { MuteButtonCore, MuteButtonDataAttributes } from '@videojs/core';
|
||||
import { MuteButtonCore, MuteButtonDataAttrs } from '@videojs/core';
|
||||
import {
|
||||
applyElementProps,
|
||||
applyStateDataAttrs,
|
||||
@@ -40,7 +40,7 @@ export class MuteButtonElement extends MediaElement {
|
||||
|
||||
applyElementProps(this, buttonProps, this.#disconnect.signal);
|
||||
|
||||
if (!this.#state.value) {
|
||||
if (__DEV__ && !this.#state.value) {
|
||||
logMissingFeature(MuteButtonElement.tagName, 'volume');
|
||||
}
|
||||
}
|
||||
@@ -59,13 +59,12 @@ export class MuteButtonElement extends MediaElement {
|
||||
protected override update(changed: PropertyValues): void {
|
||||
super.update(changed);
|
||||
|
||||
const state = this.#state.value;
|
||||
const media = this.#state.value;
|
||||
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
if (!media) return;
|
||||
|
||||
const state = this.#core.getState(media);
|
||||
applyElementProps(this, this.#core.getAttrs(state));
|
||||
applyStateDataAttrs(this, this.#core.getState(state), MuteButtonDataAttributes);
|
||||
applyStateDataAttrs(this, state, MuteButtonDataAttrs);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user