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
Merge requests
!11
Add new component for inline notifications
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add new component for inline notifications
inline-notification
into
master
Overview
5
Commits
6
Pipelines
6
Changes
3
Merged
Tögl, Christina
requested to merge
inline-notification
into
master
4 years ago
Overview
5
Commits
6
Pipelines
6
Changes
3
Expand
0
0
Merge request reports
Compare
master
version 5
ffc9387d
4 years ago
version 4
94b8a6aa
4 years ago
version 3
9335af1a
4 years ago
version 2
4aa86761
4 years ago
version 1
508924d3
4 years ago
master (base)
and
latest version
latest version
6ded1472
6 commits,
4 years ago
version 5
ffc9387d
5 commits,
4 years ago
version 4
94b8a6aa
4 commits,
4 years ago
version 3
9335af1a
3 commits,
4 years ago
version 2
4aa86761
2 commits,
4 years ago
version 1
508924d3
1 commit,
4 years ago
3 files
+
92
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
packages/common/src/inline-notification.js
0 → 100644
+
77
−
0
Options
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>
`
;
}
}
\ No newline at end of file
Loading