
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@dreamworld/dw-dialog
Advanced tools
- A dialog element with Material Design styling. [More detail](https://github.com/material-components/material-components-web/tree/master/packages/mdc-dialog) - Provides 3 types of dialog. - modal - fit - popover
npm install --save @dreamworld/dw-dialog
dw-dialog
import '@dreamworld/dw-dialog/dw-dialog.js';
dw-fit-dialog
import { DwFitDialog } from '@dreamworld/dw-dialog/dw-fit-dialog.js';
dw-popover-dialog
import { DwPopoverDialog } from '@dreamworld/dw-dialog/dw-popover-dialog.js';
dw-composite-dialog
import { DwCompositeDialog } from '@dreamworld/dw-dialog/dw-composite-dialog.js';
There is 2 ways to use dialog.
dw-fit-dialog
, dw-popover-dialog
& dw-composite-dialog
can be used by extention only.
_headerTemplate
, _contentTemplate
and _footerTemplate
to provide dialog's header, content and footer import { DwDialog } from '@dreamworld/dw-dialog/dw-dialog.js';
class SampleDialog extends DwDialog{
static get styles() {
return [
Style,
css`
.mdc-dialog__title{
// Customize header's style from here
}
.mdc-dialog__content{
// Customize content's style from here
}
.mdc-dialog__actions{
// Customize footer's style from here
}
`
]
}
get _headerTemplate() { return html`Title 1` }
get _contentTemplate() { return html`<h2>Content</h2>` }
get _footerTemplate() { return html`<button dismiss>Cancel</button>` }
}
_headerTemplate
, _contentTemplate
and _footerTemplate
to provide dialog's header, content and footer import { DwFitDialog } from '@dreamworld/dw-dialog/dw-dialog.js';
class MyFitDialog extends DwFitDialog{
static get styles() {
return [
Style,
css`
header {
// Customize header's style from here
}
.mdc-dialog__content{
// Customize content's style from here
}
footer {
// Customize footer's style from here
}
`
]
}
get _headerTemplate() { return html`Title 1` }
get _contentTemplate() { return html`<h2>Content</h2>` }
get _footerTemplate() { return html`<button dismiss>Cancel</button>` }
}
window.customElements.define('my-fit-dialog', MyFitDialog);
_headerTemplate
, _contentTemplate
and _footerTemplate
to provide dialog's header, content and footer import { DwPopoverDialog } from '@dreamworld/dw-dialog/dw-popover-dialog.js';
class MyPopoverDialog extends DwPopoverDialog{
constructor(){
super();
this.triggerElement; //This is mandatory property.
}
static get styles() {
return [
css`
header {
// Customize header's style from here
}
.mdc-dialog__content{
// Customize content's style from here
}
footer {
// Customize footer's style from here
}
`
]
}
get _headerTemplate() { return html`Title 1` }
get _contentTemplate() { return html`<h2>Content</h2>` }
get _footerTemplate() { return html`<button dismiss>Cancel</button>` }
}
window.customElements.define('my-popover-dialog', MyPopoverDialog);
_headerTemplate
, _contentTemplate
and _footerTemplate
to provide dialog's header, content and footer import { DwCompositeDialog } from '@dreamworld/dw-dialog/dw-composite-dialog.js';
class MyCompositeDialog extends DwCompositeDialog{
static get styles() {
return [
css`
header {
// Customize header's style from here
}
.mdc-dialog__content{
// Customize content's style from here
}
footer {
// Customize footer's style from here
}
`
]
}
get _headerTemplate() { return html`Title 1` }
get _contentTemplate() { return html`<h2>Content</h2>` }
get _footerTemplate() { return html`<button dismiss>Cancel</button>` }
}
window.customElements.define('my-popover-dialog', MyPopoverDialog);
<dw-dialog>
<span slot="header">View dialog</span>
<div>Dialog's content</div>
<div slot="footer">
<button dismiss>Close</button>
</div>
</dw-dialog>
<dw-dialog>
<span slot="header">Title</span>
<div>Dialog content</div>
<div slot="footer">
<button dismiss>Close</button>
</div>
</dw-dialog>
<dw-dialog noCancelOnEscKey noCancelOnOutsideClick>
<span slot="header">Title</span>
<div>Dialog content</div>
<div slot="footer">
<button dismiss>Close</button>
</div>
</dw-dialog>
<dw-dialog withoutBackdrop>
<span slot="header">Title</span>
<div>Dialog content</div>
<div slot="footer">
<button dismiss>Close</button>
<button confirm>Save</button>
</div>
</dw-dialog>
<dw-dialog opened>
<span slot="header">Title</span>
<div>Dialog content</div>
<div slot="footer">
<button dismiss>Close</button>
</div>
</dw-dialog>
dw-dialog
center
(Default) and bottom
fit-height
- Sets the height of dialog to viewport height (fit to viewport). It is applicable only if placement
is set to bottom
.open()
and close()
method.triggerElement
- It's used to anchor popover dialog.showTrigger
- When it's set to true
, shows trigger element when dialog is opened. By default it's falsy.popoverOffset
- Offset of the popoever dialog. It's used only when showTrigger
is set to true
otherwise sets position of dialog based on trigger element's position.popoverAnimation
- Animation of popover
dialog. Possible values: scale
or dropdown
. Default is dropdown
.popoverPlacement
- Placement of poppover
dialog in respect of triggerElement
. Possible values: bottom-start
, bottom-end
, left
, right
etc.. See referrence: https://atomiks.github.io/tippyjs/v6/all-props/#placementhasOverlay
- When true
shows overlay around dialog. Default is false
.appendTo
- When it's provided, append dialog to provided element. Default is parent
of triggerElement
.boundaryPadding
: It's virtual padding of boundary(viewport
). When contet of dialog increases, it will adjust it's position according to available space in viewport. Default is 8
;doNotCloseOnOutsideClick
: When it's true, dialog will not be closed on outside click.excludeOutsideClickFor
: {String} It is list of CSS class selectors seperated by space. e.g "search-input dialog"
. When doNotCloseOnOutsideClick
given, this is not cosidered.dw-fit-dialog
true
to open the dialog. You can use open
and close
method as well to open/close dialog.dw-composite-dialog
type
: It is mandatory & constant property.dismiss
and confirm
attribute indicates that interacting with it should close the dialog with the specified attribute. This action is then reflected via event.detail.action in the dw-dialog-closed
event.
dismiss
and confirm
mainly used with the footer action buttons to automatically close dialog on buttons click.
<dw-dialog opened>
<div>Are you sure?</div>
<div slot="footer">
<button dismiss>No</button>
<button confirm>Yes</button>
</div>
</dw-dialog>
dw-dialog
dw-fit-dialog
dw-popover-dialog
dw-dialog
Name | Description |
---|---|
--dw-dialog-header-background | Background color of the header |
--dw-dialog-footer-background | Background color of the footer |
--dw-dialog-divider-color | Color of header bottom border color |
--dw-dialog-border-radius | Radius of dialog |
--dw-dialog-max-height | Max height of dialog |
--dw-dialog-header-padding | padding of header area |
--dw-dialog-content-padding | padding of content area. Default value: It's dependent on whether dialog has header/footer or not. |
--dw-dialog-footer-padding | Padding of footer area |
dw-fit-dialog
Name | Description |
---|---|
--dw-fit-dialog-header-height | Height of header. Default is 56px |
--dw-fit-dialog-footer-height | Height of footer. Default is 56px |
--dw-fit-dialog-header-background | Background color of Header |
--dw-fit-dialog-content-background | Background color of Content |
--dw-fit-dialog-footer-background | Background color of Footer |
--dw-fit-dialog-max-width | Maximum width of dialog. Default is 768px |
--dw-fit-dialog-overlay-color | Overlay color of dialog. Default is rgba(0,0,0,0.4) |
Name | Description |
---|---|
--dw-popover-min-width | Minimum width of popover. Default is 280px. |
--dw-popover-width | Width of popover. Default is 280px. |
--dw-popover-overlay-background | Background styleing of popover overlay. Default is rgba(0, 0, 0, 0.3) |
--dw-popover-animation-time | Animation time for popup dialog. Default is 0.3s |
FAQs
- A dialog element with Material Design styling. [More detail](https://github.com/material-components/material-components-web/tree/master/packages/mdc-dialog) - Provides 3 types of dialog. - modal - fit - popover
The npm package @dreamworld/dw-dialog receives a total of 32 weekly downloads. As such, @dreamworld/dw-dialog popularity was classified as not popular.
We found that @dreamworld/dw-dialog demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.