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
2be27f17
Commit
2be27f17
authored
4 years ago
by
Reiter, Christoph
Browse files
Options
Downloads
Patches
Plain Diff
Add a demo for the loading button
parent
e61655b5
No related branches found
No related tags found
No related merge requests found
Pipeline
#14880
passed
4 years ago
Stage: test
Stage: publish
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
packages/common/assets/index.html
+1
-0
1 addition, 0 deletions
packages/common/assets/index.html
packages/common/dbp-common-demo.js
+13
-1
13 additions, 1 deletion
packages/common/dbp-common-demo.js
packages/common/src/button.js
+2
-1
2 additions, 1 deletion
packages/common/src/button.js
with
16 additions
and
2 deletions
packages/common/assets/index.html
+
1
−
0
View file @
2be27f17
...
...
@@ -2,6 +2,7 @@
<html>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<script
type=
"module"
src=
"demo.js"
></script>
<style>
body
{
...
...
This diff is collapsed.
Click to expand it.
packages/common/dbp-common-demo.js
+
13
−
1
View file @
2be27f17
...
...
@@ -3,7 +3,7 @@ import {css, html, LitElement} from 'lit-element';
import
{
ScopedElementsMixin
}
from
'
@open-wc/scoped-elements
'
;
import
*
as
commonUtils
from
'
./utils.js
'
;
import
*
as
commonStyles
from
'
./styles.js
'
;
import
{
getIconCSS
,
Icon
,
MiniSpinner
,
Button
,
Spinner
,
InlineNotification
}
from
'
./index.js
'
;
import
{
getIconCSS
,
Icon
,
MiniSpinner
,
Button
,
LoadingButton
,
Spinner
,
InlineNotification
}
from
'
./index.js
'
;
export
class
DbpCommonDemo
extends
ScopedElementsMixin
(
LitElement
)
{
constructor
()
{
...
...
@@ -18,6 +18,7 @@ export class DbpCommonDemo extends ScopedElementsMixin(LitElement) {
'
dbp-mini-spinner
'
:
MiniSpinner
,
'
dbp-spinner
'
:
Spinner
,
'
dbp-button
'
:
Button
,
'
dbp-loading-button
'
:
LoadingButton
,
'
dbp-auth
'
:
customElements
.
get
(
'
dbp-auth
'
),
'
dbp-inline-notification
'
:
InlineNotification
,
};
...
...
@@ -93,6 +94,14 @@ export class DbpCommonDemo extends ScopedElementsMixin(LitElement) {
},
1000
);
}
loadingButtonClickHandler
(
e
)
{
let
button
=
e
.
target
;
button
.
start
();
setTimeout
(()
=>
{
button
.
stop
();
},
1000
);
}
render
()
{
return
html
`
<style>
...
...
@@ -137,6 +146,9 @@ export class DbpCommonDemo extends ScopedElementsMixin(LitElement) {
<h2>Button</h2>
<div class="control">
<dbp-button value="Load" @click="
${
this
.
buttonClickHandler
}
" type="is-primary"></dbp-button>
<dbp-loading-button @click="
${
this
.
loadingButtonClickHandler
}
" type="is-primary">Loading Button</dbp-loading-button>
<dbp-loading-button @click="
${
this
.
loadingButtonClickHandler
}
" type="is-primary" disabled>Loading Button Disabled</dbp-loading-button>
</div>
</div>
<div class="content">
...
...
This diff is collapsed.
Click to expand it.
packages/common/src/button.js
+
2
−
1
View file @
2be27f17
...
...
@@ -88,7 +88,8 @@ export class LoadingButton extends ScopedElementsMixin(LitElement) {
this
.
type
=
""
;
this
.
loading
=
false
;
this
.
disabled
=
false
;
// https://bugs.chromium.org/p/chromium/issues/detail?id=1061240#c12
this
.
addEventListener
(
'
click
'
,
(
e
)
=>
{
if
(
this
.
disabled
)
{
e
.
stopImmediatePropagation
();
...
...
This diff is collapsed.
Click to expand it.
Reiter, Christoph
@987FCF504483CBC8
mentioned in issue
#39 (closed)
·
4 years ago
mentioned in issue
#39 (closed)
mentioned in issue #39
Toggle commit list
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