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
151923cd
Unverified
Commit
151923cd
authored
4 years ago
by
Bekerle, Patrizio
Browse files
Options
Downloads
Patches
Plain Diff
Add and use method sendSetPropertyEvent (dbp/apps/signature#32)
parent
ffdb4f67
No related branches found
No related tags found
No related merge requests found
Pipeline
#15874
passed
4 years ago
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/language-select/src/language-select.js
+4
-8
4 additions, 8 deletions
packages/language-select/src/language-select.js
packages/provider/src/adapter-lit-element.js
+10
-0
10 additions, 0 deletions
packages/provider/src/adapter-lit-element.js
with
14 additions
and
8 deletions
packages/language-select/src/language-select.js
+
4
−
8
View file @
151923cd
import
{
html
,
css
,
LitElement
}
from
'
lit-element
'
;
import
{
html
,
css
}
from
'
lit-element
'
;
import
{
i18n
}
from
'
./i18n.js
'
;
import
{
i18n
}
from
'
./i18n.js
'
;
import
*
as
commonStyles
from
'
@dbp-toolkit/common/styles
'
;
import
*
as
commonStyles
from
'
@dbp-toolkit/common/styles
'
;
import
{
AdapterLitElement
}
from
"
@dbp-toolkit/provider/src/adapter-lit-element
"
;
/**
/**
* Emits a dbp-language-changed event where event.detail.lang is the new selected language
* Emits a dbp-language-changed event where event.detail.lang is the new selected language
*/
*/
export
class
LanguageSelect
extends
LitElement
{
export
class
LanguageSelect
extends
Adapter
LitElement
{
constructor
()
{
constructor
()
{
super
();
super
();
...
@@ -61,12 +62,7 @@ export class LanguageSelect extends LitElement {
...
@@ -61,12 +62,7 @@ export class LanguageSelect extends LitElement {
this
.
dispatchEvent
(
event
);
this
.
dispatchEvent
(
event
);
// tell a dbp-provider to update the "lang" property
// tell a dbp-provider to update the "lang" property
event
=
new
CustomEvent
(
"
set-property
"
,
{
this
.
sendSetPropertyEvent
(
'
lang
'
,
value
);
bubbles
:
true
,
composed
:
true
,
detail
:
{
'
name
'
:
'
lang
'
,
'
value
'
:
value
}
});
this
.
dispatchEvent
(
event
);
// Unlike other cases we use the next language for the translations so that
// Unlike other cases we use the next language for the translations so that
// users not knowing the current language can understand it.
// users not knowing the current language can understand it.
...
...
This diff is collapsed.
Click to expand it.
packages/provider/src/adapter-lit-element.js
+
10
−
0
View file @
151923cd
...
@@ -129,6 +129,16 @@ export class AdapterLitElement extends LitElement {
...
@@ -129,6 +129,16 @@ export class AdapterLitElement extends LitElement {
// console.trace();
// console.trace();
}
}
sendSetPropertyEvent
(
name
,
value
)
{
const
event
=
new
CustomEvent
(
"
set-property
"
,
{
bubbles
:
true
,
composed
:
true
,
detail
:
{
'
name
'
:
name
,
'
value
'
:
value
}
});
return
this
.
dispatchEvent
(
event
);
}
// update(changedProperties) {
// update(changedProperties) {
// changedProperties.forEach((oldValue, propName) => {
// changedProperties.forEach((oldValue, propName) => {
// switch(propName) {
// switch(propName) {
...
...
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