Skip to content
Snippets Groups Projects
Unverified Commit 3359d8fe authored by Bekerle, Patrizio's avatar Bekerle, Patrizio :fire:
Browse files

Integrate AdapterLitElement (dbp/apps/library#77)

parent db948ce9
No related branches found
No related tags found
No related merge requests found
Pipeline #15640 passed
...@@ -3,13 +3,13 @@ import {html, css} from 'lit-element'; ...@@ -3,13 +3,13 @@ import {html, css} from 'lit-element';
import {unsafeHTML} from 'lit-html/directives/unsafe-html.js'; import {unsafeHTML} from 'lit-html/directives/unsafe-html.js';
import {ScopedElementsMixin} from '@open-wc/scoped-elements'; import {ScopedElementsMixin} from '@open-wc/scoped-elements';
import * as commonStyles from '@dbp-toolkit/common/styles'; import * as commonStyles from '@dbp-toolkit/common/styles';
import {LitElement} from "lit-element";
import {Icon, EventBus} from '@dbp-toolkit/common'; import {Icon, EventBus} from '@dbp-toolkit/common';
import {AdapterLitElement} from "@dbp-toolkit/provider/src/adapter-lit-element";
const i18n = createI18nInstance(); const i18n = createI18nInstance();
export class AuthMenuButton extends ScopedElementsMixin(LitElement) { export class AuthMenuButton extends ScopedElementsMixin(AdapterLitElement) {
constructor() { constructor() {
super(); super();
...@@ -28,11 +28,11 @@ export class AuthMenuButton extends ScopedElementsMixin(LitElement) { ...@@ -28,11 +28,11 @@ export class AuthMenuButton extends ScopedElementsMixin(LitElement) {
} }
static get properties() { static get properties() {
return { return this.getProperties({
lang: { type: String }, lang: { type: String },
showImage: { type: Boolean, attribute: 'show-image' }, showImage: { type: Boolean, attribute: 'show-image' },
_loginData: { type: Object, attribute: false }, _loginData: { type: Object, attribute: false },
}; });
} }
onWindowResize() { onWindowResize() {
......
import {html, LitElement, css} from 'lit-element'; import {html, css} from 'lit-element';
import * as commonStyles from '@dbp-toolkit/common/styles'; import * as commonStyles from '@dbp-toolkit/common/styles';
import {createI18nInstance} from './i18n.js'; import {createI18nInstance} from './i18n.js';
import {AdapterLitElement} from "@dbp-toolkit/provider/src/adapter-lit-element";
const i18n = createI18nInstance(); const i18n = createI18nInstance();
export class TUGrazLogo extends LitElement { export class TUGrazLogo extends AdapterLitElement {
constructor() { constructor() {
super(); super();
...@@ -13,9 +14,9 @@ export class TUGrazLogo extends LitElement { ...@@ -13,9 +14,9 @@ export class TUGrazLogo extends LitElement {
} }
static get properties() { static get properties() {
return { return this.getProperties({
lang: { type: String } lang: { type: String }
}; });
} }
update(changedProperties) { update(changedProperties) {
......
...@@ -3,8 +3,8 @@ import JSONLD from '@dbp-toolkit/common/jsonld'; ...@@ -3,8 +3,8 @@ import JSONLD from '@dbp-toolkit/common/jsonld';
import * as commonUtils from '@dbp-toolkit/common/utils'; import * as commonUtils from '@dbp-toolkit/common/utils';
import {EventBus} from '@dbp-toolkit/common'; import {EventBus} from '@dbp-toolkit/common';
import {KeycloakWrapper} from './keycloak.js'; import {KeycloakWrapper} from './keycloak.js';
import {LitElement} from "lit-element";
import {LoginStatus} from './util.js'; import {LoginStatus} from './util.js';
import {AdapterLitElement} from "@dbp-toolkit/provider/src/adapter-lit-element";
/** /**
...@@ -20,7 +20,7 @@ import {LoginStatus} from './util.js'; ...@@ -20,7 +20,7 @@ import {LoginStatus} from './util.js';
* window.DBPPerson: Person json object of the user (optional, enable by setting the `load-person` attribute, * window.DBPPerson: Person json object of the user (optional, enable by setting the `load-person` attribute,
* which will dispatch a `dbp-auth-person-init` event when loaded) * which will dispatch a `dbp-auth-person-init` event when loaded)
*/ */
export class AuthKeycloak extends LitElement { export class AuthKeycloak extends AdapterLitElement {
constructor() { constructor() {
super(); super();
this.lang = 'de'; this.lang = 'de';
...@@ -158,7 +158,7 @@ export class AuthKeycloak extends LitElement { ...@@ -158,7 +158,7 @@ export class AuthKeycloak extends LitElement {
} }
static get properties() { static get properties() {
return { return this.getProperties({
lang: { type: String }, lang: { type: String },
forceLogin: { type: Boolean, attribute: 'force-login' }, forceLogin: { type: Boolean, attribute: 'force-login' },
tryLogin: { type: Boolean, attribute: 'try-login' }, tryLogin: { type: Boolean, attribute: 'try-login' },
...@@ -176,7 +176,7 @@ export class AuthKeycloak extends LitElement { ...@@ -176,7 +176,7 @@ export class AuthKeycloak extends LitElement {
silentCheckSsoRedirectUri: { type: String, attribute: 'silent-check-sso-redirect-uri' }, silentCheckSsoRedirectUri: { type: String, attribute: 'silent-check-sso-redirect-uri' },
scope: { type: String }, scope: { type: String },
idpHint: { type: String, attribute: 'idp-hint' }, idpHint: { type: String, attribute: 'idp-hint' },
}; });
} }
connectedCallback() { connectedCallback() {
......
import {LitElement} from "lit-element"; import {AdapterLitElement} from "@dbp-toolkit/provider/src/adapter-lit-element";
export default class DBPLitElement extends LitElement { export default class DBPLitElement extends AdapterLitElement {
_(selector) { _(selector) {
return this.shadowRoot === null ? this.querySelector(selector) : this.shadowRoot.querySelector(selector); return this.shadowRoot === null ? this.querySelector(selector) : this.shadowRoot.querySelector(selector);
} }
......
...@@ -17,9 +17,9 @@ export class Notification extends DBPLitElement { ...@@ -17,9 +17,9 @@ export class Notification extends DBPLitElement {
* See: https://lit-element.polymer-project.org/guide/properties#initialize * See: https://lit-element.polymer-project.org/guide/properties#initialize
*/ */
static get properties() { static get properties() {
return { return this.getProperties({
lang: { type: String }, lang: { type: String },
}; });
} }
connectedCallback() { connectedCallback() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment