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
a4337e8d
Commit
a4337e8d
authored
2 years ago
by
Steinwender, Tamara
Browse files
Options
Downloads
Patches
Plain Diff
Add dbp-modal readme
parent
73cfec86
No related branches found
No related tags found
No related merge requests found
Pipeline
#210298
failed
2 years ago
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/common/README.md
+42
-1
42 additions, 1 deletion
packages/common/README.md
with
42 additions
and
1 deletion
packages/common/README.md
+
42
−
1
View file @
a4337e8d
...
...
@@ -37,7 +37,48 @@ You can use this web component to show translated html.
</dbp-translated>
```
The English or German text will be shown according to the
`lang`
attribute.
## Modal Web Component
You can use this web component to show content in a modal.
This webcomponent has two function which can be called from outside:
`open()`
- which opens the modal and
`close()`
-
which closes the modal.
```
html
<script
type=
"module"
src=
"https://unpkg.com/@dbp-toolkit/common@0.2.8/dist/components.js"
></script>
<dbp-translated
subscribe=
"lang"
>
<div
slot=
"de"
>
Dieser Text ist Deutsch und wird Englisch werden wenn man die Sprache auf Englisch stellt.
</div>
<div
slot=
"en"
>
This text is English and will be German if the language is changed to German.
</div>
</dbp-translated>
```
### Attributes
-
`lang`
(optional, default:
`de`
): set to
`de`
or
`en`
for German or English
-
example
`<dbp-modal lang="de"></dbp-modal>`
-
`modal-id`
(default:
`modal-id`
, should unique): this is the modal css selector id
-
example
`<dbp-modal modal-id="my-modal-123"></dbp-modal>`
-
`title`
(optional): sets the modal title
-
example
`<dbp-modal title="This is my modal"></dbp-modal>`
-
`width`
,
`height`
,
`min-width`
,
`min-height`
(optional): set the size of a modal
-
example
`<dbp-modal width="15px" height="100%"></dbp-modal>`
### Callable functions
-
`open()`
opens a specific modal
-
`this._('#my-modal-webcomponent-id').open();`
-
`close()`
closes a specific modal
-
`this._('#my-modal-webcomponent-id').close();`
### Events
-
`dbp-modal-closed`
a event which is triggered if the modal is closed. in the detail attribute there is the modal-id of the closed modal.
-
`<dbp-modal @dbp-modal-closed="${(event) => {
this.doSomething(event);
}}"></dbp-modal>`
## Overriding slots in nested web components
...
...
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