Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Toolkit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
digital blueprint
Web Component Framework
Toolkit
Commits
325fb400
Commit
325fb400
authored
2 years ago
by
Steinwender, Tamara
Browse files
Options
Downloads
Patches
Plain Diff
Improve modal with size
parent
07739da5
No related branches found
No related tags found
No related merge requests found
Pipeline
#208509
passed
2 years ago
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/common/src/modal.js
+38
-8
38 additions, 8 deletions
packages/common/src/modal.js
with
38 additions
and
8 deletions
packages/common/src/modal.js
+
38
−
8
View file @
325fb400
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
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment