2020-11-25 13:43:39 +00:00
|
|
|
import * as plugins from './dees-element.plugins';
|
|
|
|
|
2020-11-25 14:44:57 +00:00
|
|
|
export {
|
|
|
|
property,
|
|
|
|
html,
|
|
|
|
customElement,
|
|
|
|
TemplateResult,
|
|
|
|
internalProperty,
|
2020-11-30 14:26:07 +00:00
|
|
|
css,
|
|
|
|
unsafeCSS
|
2020-11-25 14:44:57 +00:00
|
|
|
} from 'lit-element';
|
2020-11-25 13:43:39 +00:00
|
|
|
|
|
|
|
export class DeesElement extends plugins.litElement.LitElement {
|
2020-11-25 14:56:18 +00:00
|
|
|
@plugins.litElement.property({type: Boolean})
|
2020-11-25 13:43:39 +00:00
|
|
|
public goBright: boolean = false;
|
|
|
|
public domtoolsPromise = plugins.domtools.elementBasic.setup(this);
|
|
|
|
|
2020-12-07 03:30:59 +00:00
|
|
|
private themeSubscription: plugins.smartrx.rxjs.Subscription;
|
|
|
|
|
2020-11-25 13:43:39 +00:00
|
|
|
public connectedCallback() {
|
|
|
|
super.connectedCallback();
|
2020-12-07 03:30:59 +00:00
|
|
|
this.domtoolsPromise.then(async (domtools) => {
|
|
|
|
this.themeSubscription = domtools.themeManager.themeObservable.subscribe(goBrightArg => {
|
|
|
|
this.goBright = goBrightArg;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
this.dispatchEvent(new CustomEvent('deesElementConnected'));
|
2020-11-25 13:43:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public disconnectedCallback() {
|
|
|
|
super.disconnectedCallback();
|
2020-12-07 03:30:59 +00:00
|
|
|
this.themeSubscription.unsubscribe();
|
|
|
|
this.dispatchEvent(new CustomEvent('deesElementDisconnected'));
|
2020-11-25 13:43:39 +00:00
|
|
|
}
|
|
|
|
}
|