Skip to content
Snippets Groups Projects
Commit 325fb400 authored by Steinwender, Tamara's avatar Steinwender, Tamara
Browse files

Improve modal with size

parent 07739da5
No related branches found
No related tags found
No related merge requests found
Pipeline #208509 passed
import {html, css} from 'lit'; import {html, css
} from 'lit';
import {createInstance} from './i18n'; import {createInstance} from './i18n';
import * as commonStyles from '../styles.js'; import * as commonStyles from '../styles.js';
import {Icon} from "./icon"; import {Icon} from './icon';
import {MiniSpinner} from "./mini-spinner"; import {MiniSpinner} from './mini-spinner';
import MicroModal from './micromodal.es'; import MicroModal from './micromodal.es';
import DBPLitElement from "../dbp-lit-element"; import DBPLitElement from '../dbp-lit-element';
import {styleMap} from 'lit/directives/style-map.js';
export class Modal extends DBPLitElement { export class Modal extends DBPLitElement {
...@@ -13,18 +15,40 @@ export class Modal extends DBPLitElement { ...@@ -13,18 +15,40 @@ export class Modal extends DBPLitElement {
this._i18n = createInstance(); this._i18n = createInstance();
this.lang = this._i18n.language; this.lang = this._i18n.language;
this.modalId = 'dbp-modal-id'; this.modalId = 'dbp-modal-id';
this.title = "Modal Title"; this.title = "";
// TODO add with/height this.width = 'inherit';
this.height = 'inherit';
this.minWidth = 'inherit';
this.minHeight = 'inherit';
this.size = {
width: this.width,
height: this.height,
minWidth: this.minWidth,
minHeight: this.minHeight};
} }
static get properties() { static get properties() {
return { return {
modalId: {type: String, attribute: 'modal-id'}, modalId: {type: String, attribute: 'modal-id'},
title: {type: String}, title: {type: String},
width: {type: String},
height: {type: String},
minWidth: {type: String, attribute: 'min-width'},
minHeight: {type: String, attribute: 'min-height'},
}; };
} }
connectedCallback() {
super.connectedCallback();
this.size = {
width: this.width,
height: this.height,
minWidth: this.minWidth,
minHeight: this.minHeight};
}
static get scopedElements() { static get scopedElements() {
return { return {
'dbp-icon': Icon, 'dbp-icon': Icon,
...@@ -64,9 +88,10 @@ export class Modal extends DBPLitElement { ...@@ -64,9 +88,10 @@ export class Modal extends DBPLitElement {
} }
.modal-header{ .modal-header{
padding: 0px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center;
padding: 0 0 20px 0;
} }
.modal-content{ .modal-content{
...@@ -78,6 +103,10 @@ export class Modal extends DBPLitElement { ...@@ -78,6 +103,10 @@ export class Modal extends DBPLitElement {
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
} }
footer{
padding-top: 20px;
}
`; `;
} }
...@@ -90,7 +119,8 @@ export class Modal extends DBPLitElement { ...@@ -90,7 +119,8 @@ export class Modal extends DBPLitElement {
<div class="modal-container" <div class="modal-container"
role="dialog" role="dialog"
aria-modal="true" aria-modal="true"
aria-labelledby="show-recipient-modal-title"> aria-labelledby="show-recipient-modal-title"
style=${styleMap(this.size)}>
<header class="modal-header"> <header class="modal-header">
<h3 class="modal-title"> <h3 class="modal-title">
${this.title} ${this.title}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment