Skip to content
Snippets Groups Projects
Select Git revision
  • 281cc1b5bb5a2d46c6abe555ef42a4129e05e7e9
  • main default protected
  • renovate/lock-file-maintenance
  • demo protected
  • person-select-custom
  • dbp-translation-component
  • icon-set-mapping
  • port-i18next-parser
  • remove-sentry
  • favorites-and-recent-files
  • revert-6c632dc6
  • lit2
  • advertisement
  • wc-part
  • automagic
  • publish
  • wip-cleanup
  • demo-file-handling
18 results

dbp-notification-demo-activity.js

Blame
  • dbp-notification-demo-activity.js 1.98 KiB
    import {css, html} from 'lit';
    import {ScopedElementsMixin} from '@open-wc/scoped-elements';
    import {NotificationDemo} from '@dbp-toolkit/notification/src/dbp-notification-demo';
    import * as commonUtils from '@dbp-toolkit/common/utils';
    import * as commonStyles from '@dbp-toolkit/common/styles';
    import {unsafeHTML} from 'lit/directives/unsafe-html.js';
    import readme from '@dbp-toolkit/notification/README.md';
    import * as demoStyles from './styles';
    import {AdapterLitElement} from '@dbp-toolkit/common';
    
    class DbpNotificationDemoActivity extends ScopedElementsMixin(AdapterLitElement) {
        constructor() {
            super();
            this.lang = 'en';
            this.entryPointUrl = '';
        }
    
        static get scopedElements() {
            return {
                'dbp-notification-demo': NotificationDemo,
            };
        }
    
        static get properties() {
            return {
                ...super.properties,
                lang: {type: String},
                entryPointUrl: {type: String, attribute: 'entry-point-url'},
            };
        }
    
        connectedCallback() {
            super.connectedCallback();
    
            this.updateComplete.then(() => {});
        }
    
        static get styles() {
            // language=css
            return [
                commonStyles.getThemeCSS(),
                commonStyles.getGeneralCSS(),
                demoStyles.getDemoCSS(),
                css`
                    h1.title {
                        margin-bottom: 1em;
                    }
                    div.container {
                        margin-bottom: 1.5em;
                    }
    
                    #demo {
                        display: block;
                        padding-top: 50px;
                    }
                `,
            ];
        }
    
        render() {
            return html`
                ${unsafeHTML(readme)}
                <dbp-notification-demo
                    id="demo"
                    lang="${this.lang}"
                    entry-point-url="${this.entryPointUrl}"></dbp-notification-demo>
            `;
        }
    }