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
02f7a9bf
Commit
02f7a9bf
authored
5 years ago
by
Bekerle, Patrizio
Committed by
Reiter, Christoph
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Implement demo web-component
parent
55cb4425
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/common/demo.js
+1
-13
1 addition, 13 deletions
packages/common/demo.js
packages/common/vpu-common-demo.js
+101
-0
101 additions, 0 deletions
packages/common/vpu-common-demo.js
with
102 additions
and
13 deletions
packages/common/demo.js
+
1
−
13
View file @
02f7a9bf
import
'
./vpu-mini-spinner.js
'
;
import
'
./vpu-spinner.js
'
;
import
'
./vpu-icon.js
'
;
import
'
./vpu-button.js
'
;
import
{
init
,
captureMessage
,
captureException
}
from
'
./errorreport
'
;
// error reporting
init
({
debug
:
false
,
release
:
'
vpu-common@0.1
'
});
captureMessage
(
"
test error message
"
);
captureException
(
new
Error
(
'
another error
'
));
setTimeout
(()
=>
{
throw
new
Error
(
"
an error
"
);
});
import
'
./vpu-common-demo.js
'
;
This diff is collapsed.
Click to expand it.
packages/common/vpu-common-demo.js
0 → 100644
+
101
−
0
View file @
02f7a9bf
import
{
i18n
}
from
'
./i18n.js
'
;
import
{
css
,
html
}
from
'
lit-element
'
;
import
*
as
commonUtils
from
'
./utils.js
'
;
import
'
./vpu-mini-spinner.js
'
;
import
'
./vpu-spinner.js
'
;
import
'
./vpu-icon.js
'
;
import
'
./vpu-button.js
'
;
import
VPULitElement
from
'
./vpu-lit-element.js
'
;
import
bulmaCSSPath
from
"
bulma/css/bulma.min.css
"
;
class
VpuCommonDemo
extends
VPULitElement
{
constructor
()
{
super
();
this
.
lang
=
'
de
'
;
this
.
noAuth
=
false
;
}
static
get
properties
()
{
return
{
lang
:
{
type
:
String
},
noAuth
:
{
type
:
Boolean
,
attribute
:
'
no-auth
'
},
};
}
connectedCallback
()
{
super
.
connectedCallback
();
i18n
.
changeLanguage
(
this
.
lang
);
this
.
updateComplete
.
then
(()
=>
{
});
}
static
get
styles
()
{
// language=css
return
css
`
h1.title {margin-bottom: 1em;}
div.container {margin-bottom: 1.5em;}
`
;
}
getAuthComponentHtml
()
{
return
this
.
noAuth
?
html
``
:
html
`
<div class="container">
<vpu-auth lang="
${
this
.
lang
}
" client-id="
${
commonUtils
.
setting
(
'
keyCloakClientId
'
)}
" load-person></vpu-auth>
</div>
`
;
}
buttonClickHandler
()
{
setTimeout
(()
=>
{
this
.
_
(
"
vpu-button
"
).
stop
();
},
1000
);
}
render
()
{
commonUtils
.
initAssetBaseURL
(
'
vpu-person-select-src
'
);
const
bulmaCSS
=
commonUtils
.
getAssetURL
(
bulmaCSSPath
);
return
html
`
<link rel="stylesheet" href="
${
bulmaCSS
}
">
<section class="section">
<div class="container">
<h1 class="title">Common-Demo</h1>
</div>
${
this
.
getAuthComponentHtml
()}
<div class="container">
<label class="label">Mini Spinner</label>
<div class="control">
<vpu-mini-spinner></vpu-mini-spinner>
<vpu-mini-spinner style="font-size: 2em"></vpu-mini-spinner>
<vpu-mini-spinner style="font-size: 3em"></vpu-mini-spinner>
</div>
</div>
<div class="container">
<label class="label">Spinner</label>
<div class="control">
<vpu-spinner></vpu-spinner>
</div>
</div>
<div class="container">
<label class="label">Icons</label>
<div class="control">
<vpu-icon name="access-point-network-off"></vpu-icon>
<vpu-icon color="green"></vpu-icon>
<vpu-icon color="red"></vpu-icon>
<vpu-icon color="blue"></vpu-icon>
<vpu-icon color="orange" name="menu-down"></vpu-icon>
</div>
</div>
<div class="container">
<label class="label">Button</label>
<div class="control">
<vpu-button value="Load" @click="
${
this
.
buttonClickHandler
}
"></vpu-button>
</div>
</div>
</section>
`
;
}
}
commonUtils
.
defineCustomElement
(
'
vpu-common-demo
'
,
VpuCommonDemo
);
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