0.16.1 • Published 2 months ago

@lion/dialog v0.16.1

Weekly downloads
247
License
MIT
Repository
github
Last release
2 months ago

Interaction >> Dialog >> Overview ||10

A web component that wraps a modal dialog controller. Its purpose is to make it easy to use our Overlay System declaratively.

import { html } from '@lion/core';
import '@lion/dialog/define';

import { demoStyle } from './src/demoStyle.js';
export const main = () => html`
  <style>
    ${demoStyle}
  </style>
  <lion-dialog>
    <button slot="invoker">Click me to open dialog</button>
    <div slot="content" class="dialog">
      Hello! You can close this dialog here:
      <button
        class="close-button"
        @click=${e => e.target.dispatchEvent(new Event('close-overlay', { bubbles: true }))}
      >
        ⨯
      </button>
    </div>
  </lion-dialog>
`;

Features

  • Show content when clicking the invoker
  • Respond to close event in the slot="content" element, to close the content
  • Have a .config object to set or update the OverlayController's configuration

Installation

npm i --save @lion/dialog
import { LionDialog } from '@lion/dialog';
// or
import '@lion/dialog/define';
  • Your slot="content" node will be moved to the global overlay container during initialization. After, your content node is no longer a child of lion-dialog. If you still need to access it from the lion-dialog you can do so by using the ._overlayContentNode property.
  • To close the overlay from within the content node, you need to dispatch a close-overlay event that bubbles. It has to be able to reach the content node.
  • If you need to traverse shadow boundaries, you will have to add composed: true as well, although this is discouraged as a practice.

Changing the configuration

You can use the config property on the dialog to change the configuration. The documentation of the full config object can be found in the lion/overlay package or here in Overlay System - Configuration.

The config property uses a setter to merge the passed configuration with the current, so you only overwrite what you pass when updating config.

0.12.6

2 months ago

0.12.5

6 months ago

0.12.4

1 year ago

0.16.1

2 years ago

0.12.1

2 years ago

0.12.2

2 years ago

0.12.3

2 years ago

0.16.0

2 years ago

0.15.0

2 years ago

0.14.0

2 years ago

0.13.7

2 years ago

0.13.6

2 years ago

0.13.5

3 years ago

0.13.4

3 years ago

0.13.3

3 years ago

0.13.2

3 years ago

0.13.1

3 years ago

0.13.0

3 years ago

0.12.0

3 years ago

0.11.4

3 years ago

0.11.3

3 years ago

0.11.2

3 years ago

0.11.1

3 years ago

0.11.0

3 years ago

0.10.2

3 years ago

0.10.1

3 years ago

0.10.0

3 years ago

0.9.18

3 years ago

0.9.17

3 years ago

0.9.16

3 years ago

0.9.15

3 years ago

0.9.14

3 years ago

0.9.13

3 years ago

0.9.12

3 years ago

0.9.11

3 years ago

0.9.10

3 years ago

0.9.9

3 years ago

0.9.8

3 years ago

0.9.7

3 years ago

0.9.6

3 years ago

0.9.5

4 years ago

0.9.4

4 years ago

0.9.3

4 years ago

0.9.2

4 years ago

0.9.1

4 years ago

0.9.0

4 years ago

0.8.1

4 years ago

0.8.0

4 years ago

0.7.14

4 years ago

0.7.13

4 years ago

0.7.12

4 years ago

0.7.11

4 years ago

0.7.10

4 years ago

0.7.9

4 years ago

0.7.8

4 years ago

0.7.7

4 years ago

0.7.6

4 years ago

0.7.5

4 years ago

0.7.4

4 years ago

0.7.3

4 years ago

0.7.2

4 years ago

0.7.1

4 years ago

0.7.0

4 years ago

0.6.3

4 years ago

0.6.2

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago

0.4.18

4 years ago

0.4.17

4 years ago

0.4.16

4 years ago

0.4.15

4 years ago

0.4.14

4 years ago

0.4.13

4 years ago

0.4.12

4 years ago

0.4.11

4 years ago

0.4.10

4 years ago

0.4.9

4 years ago

0.4.8

4 years ago

0.4.7

4 years ago

0.4.6

4 years ago

0.4.5

4 years ago

0.4.4

4 years ago

0.4.3

4 years ago

0.4.2

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago