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

Integrate AdapterLitElement (dbp/apps/library#77)

parent 9ae9ccc5
No related branches found
No related tags found
No related merge requests found
Pipeline #15629 passed
...@@ -8,13 +8,14 @@ import bttn2 from 'datatables.net-buttons'; ...@@ -8,13 +8,14 @@ import bttn2 from 'datatables.net-buttons';
import bttnHtml5 from 'datatables.net-buttons/js/buttons.html5.js'; import bttnHtml5 from 'datatables.net-buttons/js/buttons.html5.js';
import bttnPrint from 'datatables.net-buttons/js/buttons.print.js'; import bttnPrint from 'datatables.net-buttons/js/buttons.print.js';
import {i18n} from './i18n'; import {i18n} from './i18n';
import {css, html, LitElement, unsafeCSS} from 'lit-element'; import {css, html, unsafeCSS} from 'lit-element';
import de from '../assets/datatables/i18n/German'; import de from '../assets/datatables/i18n/German';
import en from '../assets/datatables/i18n/English'; import en from '../assets/datatables/i18n/English';
import {getIconSVGURL} from '@dbp-toolkit/common'; import {getIconSVGURL} from '@dbp-toolkit/common';
import * as commonUtils from '@dbp-toolkit/common/utils'; import * as commonUtils from '@dbp-toolkit/common/utils';
import * as commonStyles from '@dbp-toolkit/common/styles'; import * as commonStyles from '@dbp-toolkit/common/styles';
import {name as pkgName} from './../package.json'; import {name as pkgName} from './../package.json';
import {AdapterLitElement} from "@dbp-toolkit/provider/src/adapter-lit-element";
dt(window, $); dt(window, $);
resp(window, $); resp(window, $);
...@@ -24,7 +25,7 @@ bttn2(window, $); ...@@ -24,7 +25,7 @@ bttn2(window, $);
bttnHtml5(window, $, jszip); bttnHtml5(window, $, jszip);
bttnPrint(window, $); bttnPrint(window, $);
export class DataTableView extends LitElement { export class DataTableView extends AdapterLitElement {
constructor() { constructor() {
super(); super();
this.lang = 'de'; this.lang = 'de';
...@@ -48,7 +49,7 @@ export class DataTableView extends LitElement { ...@@ -48,7 +49,7 @@ export class DataTableView extends LitElement {
} }
static get properties() { static get properties() {
return { return this.getProperties({
lang: { type: String }, lang: { type: String },
table: { type: Object, attribute: false }, table: { type: Object, attribute: false },
paging: { type: Boolean }, paging: { type: Boolean },
...@@ -61,7 +62,7 @@ export class DataTableView extends LitElement { ...@@ -61,7 +62,7 @@ export class DataTableView extends LitElement {
exportName: { type: String, attribute: 'export-name' }, exportName: { type: String, attribute: 'export-name' },
columnSearching: { type: Boolean, attribute: 'column-searching'}, columnSearching: { type: Boolean, attribute: 'column-searching'},
defaultOrder: { type: Array, attribute: 'default-order'} defaultOrder: { type: Array, attribute: 'default-order'}
}; });
} }
set_columns(cols) { set_columns(cols) {
......
...@@ -4,7 +4,7 @@ import select2 from 'select2'; ...@@ -4,7 +4,7 @@ import select2 from 'select2';
import select2LangDe from './i18n/de/select2'; import select2LangDe from './i18n/de/select2';
import select2LangEn from './i18n/en/select2'; import select2LangEn from './i18n/en/select2';
import JSONLD from '@dbp-toolkit/common/jsonld'; import JSONLD from '@dbp-toolkit/common/jsonld';
import {css, html, LitElement} from 'lit-element'; import {css, html} from 'lit-element';
import {ScopedElementsMixin} from '@open-wc/scoped-elements'; import {ScopedElementsMixin} from '@open-wc/scoped-elements';
import {i18n} from './i18n.js'; import {i18n} from './i18n.js';
import {Icon} from '@dbp-toolkit/common'; import {Icon} from '@dbp-toolkit/common';
...@@ -12,6 +12,7 @@ import * as commonUtils from '@dbp-toolkit/common/utils'; ...@@ -12,6 +12,7 @@ import * as commonUtils from '@dbp-toolkit/common/utils';
import * as commonStyles from '@dbp-toolkit/common/styles'; import * as commonStyles from '@dbp-toolkit/common/styles';
import select2CSSPath from 'select2/dist/css/select2.min.css'; import select2CSSPath from 'select2/dist/css/select2.min.css';
import * as errorUtils from "@dbp-toolkit/common/error"; import * as errorUtils from "@dbp-toolkit/common/error";
import {AdapterLitElement} from "@dbp-toolkit/provider/src/adapter-lit-element";
const personContext = { const personContext = {
...@@ -22,7 +23,7 @@ const personContext = { ...@@ -22,7 +23,7 @@ const personContext = {
select2(window, $); select2(window, $);
export class PersonSelect extends ScopedElementsMixin(LitElement) { export class PersonSelect extends ScopedElementsMixin(AdapterLitElement) {
constructor() { constructor() {
super(); super();
...@@ -54,7 +55,7 @@ export class PersonSelect extends ScopedElementsMixin(LitElement) { ...@@ -54,7 +55,7 @@ export class PersonSelect extends ScopedElementsMixin(LitElement) {
} }
static get properties() { static get properties() {
return { return this.getProperties({
lang: { type: String }, lang: { type: String },
active: { type: Boolean, attribute: false }, active: { type: Boolean, attribute: false },
entryPointUrl: { type: String, attribute: 'entry-point-url' }, entryPointUrl: { type: String, attribute: 'entry-point-url' },
...@@ -63,7 +64,7 @@ export class PersonSelect extends ScopedElementsMixin(LitElement) { ...@@ -63,7 +64,7 @@ export class PersonSelect extends ScopedElementsMixin(LitElement) {
showReloadButton: { type: Boolean, attribute: 'show-reload-button' }, showReloadButton: { type: Boolean, attribute: 'show-reload-button' },
reloadButtonTitle: { type: String, attribute: 'reload-button-title' }, reloadButtonTitle: { type: String, attribute: 'reload-button-title' },
showBirthDate: { type: Boolean, attribute: 'show-birth-date' }, showBirthDate: { type: Boolean, attribute: 'show-birth-date' },
}; });
} }
clear() { clear() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment