Skip to content
Snippets Groups Projects
Select Git revision
  • ci-update
  • main default
  • keycloak-deprecate
  • remove-jwt-easy
  • v0.1.15
  • v0.1.14
  • v0.1.13
  • v0.1.12
  • v0.1.11
  • v0.1.10
  • v0.1.9
  • v0.1.8
  • v0.1.7
  • v0.1.6
  • v0.1.5
  • v0.1.4
  • v0.1.3
  • v0.1.2
  • v0.1.1
  • v0.1.0
20 results

BearerUserTest.php

Blame
  • inline-notification.js 1.88 KiB
    import {css, html} from 'lit-element';
    import DBPLitElement from '../dbp-lit-element';
    import * as commonStyles from '../styles';
    
    /**
     * Inline Notification
     * 
     * Summary can be a string or empty
     * 
     * Body can be a string, html or empty
     * 
     * Type can be primary/info/success/warning/danger (default: info)
     *  
     */
    export class InlineNotification extends DBPLitElement {
        constructor() {
            super();
            this.type = '';
            this.summary = '';
            this.body = '';
        }
    
        static get properties() {
            return {
                type: { type: String },
                summary: { type: String },
                body: { type: String },
            };
        }
    
        connectedCallback() {
            super.connectedCallback();
        }
    
        static get styles() {
            // language=css
            return css`
                ${commonStyles.getThemeCSS()}
                ${commonStyles.getGeneralCSS()}
                ${commonStyles.getNotificationCSS()}
    
                .notification:not(:last-child) {
                    margin-bottom: 1.5rem;
                }
    
                .notification h3 {
                    font-weight: bold;
                    margin-bottom: 3px;
                }
    
                .notification h3 {
                    margin: 0 0 3px 0;
                    font: inherit;
                    font-weight: bold; 
                }
            `;
        }
    
        createBodyHtml() {
            return document.createRange().createContextualFragment(`${ this.body }`);
        }
    
        render() {
            const bodyHtml = this.createBodyHtml();
    
            return html`
                <div class="columns">
                    <div class="column">
                        <div id="inline-notification" class="notification is-${ this.type !== '' ? this.type : 'info' }">
                            ${ this.summary !== '' ? html`<h3>${ this.summary }</h3>` : `` }
                            ${ bodyHtml }
                        </div>
                    </div>
                </div>
            `;
        }
    }