@lion/ui 0.7.6 → 0.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -2
- package/components/button/test-suites/LionButton.suite.js +3 -1
- package/components/combobox/src/LionCombobox.js +33 -9
- package/components/combobox/test/lion-combobox.test.js +134 -7
- package/components/dialog/test/lion-dialog.test.js +59 -1
- package/components/input-datepicker/test/lion-input-datepicker.test.js +3 -3
- package/components/input-file/src/FileHandle.js +1 -1
- package/components/input-file/src/LionInputFile.js +1 -3
- package/components/input-file/test/lion-input-file.test.js +11 -14
- package/components/overlays/src/OverlayController.js +13 -7
- package/components/overlays/src/OverlayMixin.js +5 -1
- package/components/overlays/test/OverlayController.test.js +46 -0
- package/components/select-rich/src/LionSelectRich.js +12 -0
- package/components/select-rich/test/lion-select-rich.test.js +26 -0
- package/custom-elements.json +60 -55
- package/dist-types/components/button/test-suites/LionButton.suite.d.ts.map +1 -1
- package/dist-types/components/combobox/src/LionCombobox.d.ts +9 -0
- package/dist-types/components/combobox/src/LionCombobox.d.ts.map +1 -1
- package/dist-types/components/input-file/src/LionInputFile.d.ts.map +1 -1
- package/dist-types/components/overlays/src/OverlayController.d.ts.map +1 -1
- package/dist-types/components/overlays/src/OverlayMixin.d.ts.map +1 -1
- package/dist-types/components/select-rich/src/LionSelectRich.d.ts.map +1 -1
- package/dist-types/tsconfig.tsbuildinfo +1 -1
- package/docs/components/button/use-cases.md +2 -2
- package/docs/components/calendar/use-cases.md +4 -4
- package/docs/components/checkbox-group/api-table.md +49 -55
- package/docs/components/checkbox-group/overview.md +5 -5
- package/docs/components/checkbox-group/use-cases.md +33 -33
- package/docs/components/collapsible/overview.md +1 -1
- package/docs/components/collapsible/use-cases.md +3 -3
- package/docs/components/combobox/api-table.md +84 -89
- package/docs/components/combobox/extensions.md +20 -20
- package/docs/components/combobox/overview.md +1 -1
- package/docs/components/combobox/use-cases.md +6 -6
- package/docs/components/dialog/api-table.md +3 -3
- package/docs/components/dialog/overview.md +2 -2
- package/docs/components/dialog/src/external-dialog.js +32 -0
- package/docs/components/dialog/src/slots-dialog-content.js +1 -1
- package/docs/components/dialog/src/styled-dialog-content.js +1 -1
- package/docs/components/dialog/use-cases.md +49 -3
- package/docs/components/drawer/use-cases.md +3 -3
- package/docs/components/fieldset/api-table.md +45 -51
- package/docs/components/fieldset/overview.md +7 -7
- package/docs/components/fieldset/use-cases.md +15 -15
- package/docs/components/form/overview.md +7 -7
- package/docs/components/form/use-cases.md +4 -4
- package/docs/components/icon/use-cases.md +1 -1
- package/docs/components/input/overview.md +1 -1
- package/docs/components/input/use-cases.md +3 -3
- package/docs/components/input-amount/overview.md +3 -3
- package/docs/components/input-amount/use-cases.md +8 -8
- package/docs/components/input-date/overview.md +3 -3
- package/docs/components/input-date/use-cases.md +8 -8
- package/docs/components/input-datepicker/api-table.md +1 -1
- package/docs/components/input-datepicker/overview.md +5 -5
- package/docs/components/input-datepicker/use-cases.md +5 -5
- package/docs/components/input-email/overview.md +2 -2
- package/docs/components/input-email/use-cases.md +3 -3
- package/docs/components/input-file/overview.md +1 -1
- package/docs/components/input-iban/overview.md +2 -2
- package/docs/components/input-iban/use-cases.md +8 -8
- package/docs/components/input-range/overview.md +2 -2
- package/docs/components/input-stepper/api-table.md +65 -69
- package/docs/components/input-stepper/overview.md +1 -1
- package/docs/components/input-tel/overview.md +1 -1
- package/docs/components/input-tel/use-cases.md +9 -9
- package/docs/components/input-tel-dropdown/api-table.md +70 -73
- package/docs/components/input-tel-dropdown/extensions.md +1 -1
- package/docs/components/input-tel-dropdown/overview.md +1 -1
- package/docs/components/input-tel-dropdown/use-cases.md +5 -5
- package/docs/components/listbox/api-table.md +64 -70
- package/docs/components/listbox/overview.md +5 -5
- package/docs/components/listbox/use-cases.md +61 -61
- package/docs/components/pagination/use-cases.md +5 -5
- package/docs/components/radio-group/api-table.md +49 -55
- package/docs/components/radio-group/overview.md +6 -6
- package/docs/components/radio-group/use-cases.md +18 -18
- package/docs/components/select/use-cases.md +2 -2
- package/docs/components/select-rich/api-table.md +79 -85
- package/docs/components/select-rich/overview.md +3 -3
- package/docs/components/select-rich/use-cases.md +33 -33
- package/docs/components/steps/overview.md +4 -4
- package/docs/components/steps/use-cases.md +7 -7
- package/docs/components/tabs/examples.md +1 -1
- package/docs/components/tabs/use-cases.md +1 -1
- package/docs/components/textarea/use-cases.md +3 -3
- package/docs/components/tooltip/api-table.md +3 -3
- package/docs/components/tooltip/use-cases.md +6 -6
- package/docs/fundamentals/index.md +4 -4
- package/docs/fundamentals/node-tools/providence-analytics/LocalConfiguration.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/QueryResult.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/analyzer.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/dashboard.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/overview.md +3 -3
- package/docs/fundamentals/node-tools/publish-docs/overview.md +3 -3
- package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +2 -2
- package/docs/fundamentals/rationales/accessibility.md +1 -1
- package/docs/fundamentals/systems/core/SlotMixin.md +1 -1
- package/docs/fundamentals/systems/core/overview.md +1 -1
- package/docs/fundamentals/systems/form/formatting-and-parsing.md +8 -8
- package/docs/fundamentals/systems/form/model-value.md +1 -1
- package/docs/fundamentals/systems/form/overview.md +28 -28
- package/docs/fundamentals/systems/form/use-cases.md +19 -19
- package/docs/fundamentals/systems/form/validate.md +50 -50
- package/docs/fundamentals/systems/localize/api-table.md +10 -17
- package/docs/fundamentals/systems/localize/overview.md +4 -4
- package/docs/fundamentals/systems/localize/use-cases.md +4 -4
- package/docs/fundamentals/systems/overlays/_configuration-positioning.md +4 -4
- package/docs/fundamentals/systems/overlays/api-table.md +34 -90
- package/docs/fundamentals/systems/overlays/assets/umbrella-form.js +9 -9
- package/docs/fundamentals/systems/overlays/configuration.md +30 -30
- package/docs/fundamentals/systems/overlays/overview.md +6 -6
- package/docs/fundamentals/systems/overlays/use-cases.md +30 -30
- package/docs/fundamentals/tools/ajax/use-cases.md +20 -20
- package/docs/fundamentals/tools/helpers/action-logger.md +3 -3
- package/docs/fundamentals/tools/helpers/overview.md +1 -1
- package/docs/fundamentals/tools/singleton-manager/example-complex/demo-app.js +2 -2
- package/docs/fundamentals/tools/singleton-manager/example-fail/demo-app.js +2 -2
- package/docs/fundamentals/tools/singleton-manager/example-success/demo-app.js +2 -2
- package/docs/fundamentals/tools/singleton-manager/overview.md +4 -4
- package/docs/guides/how-to/create-a-custom-field.md +7 -7
- package/docs/guides/how-to/create-a-form.md +4 -4
- package/docs/guides/how-to/extend-a-native-input.md +2 -2
- package/docs/guides/index.md +8 -8
- package/docs/guides/principles/index.md +5 -5
- package/docs/guides/principles/scoped-elements.md +1 -1
- package/docs/guides/principles/styling.md +1 -1
- package/package.json +1 -1
|
@@ -20,11 +20,11 @@ easily from an extended Lion component, just by:
|
|
|
20
20
|
```js preview-story
|
|
21
21
|
export const MaterialDesign = () => html`
|
|
22
22
|
<md-combobox name="combo" label="Default">
|
|
23
|
-
<md-option .choiceValue
|
|
24
|
-
<md-option .choiceValue
|
|
25
|
-
<md-option .choiceValue
|
|
26
|
-
<md-option .choiceValue
|
|
27
|
-
<md-option .choiceValue
|
|
23
|
+
<md-option .choiceValue="${'Apple'}">Apple</md-option>
|
|
24
|
+
<md-option .choiceValue="${'Artichoke'}">Artichoke</md-option>
|
|
25
|
+
<md-option .choiceValue="${'Asparagus'}">Asparagus</md-option>
|
|
26
|
+
<md-option .choiceValue="${'Banana'}">Banana</md-option>
|
|
27
|
+
<md-option .choiceValue="${'Beets'}">Beets</md-option>
|
|
28
28
|
</md-combobox>
|
|
29
29
|
`;
|
|
30
30
|
```
|
|
@@ -34,11 +34,11 @@ export const MaterialDesign = () => html`
|
|
|
34
34
|
```js preview-story
|
|
35
35
|
export const Github = () => html`
|
|
36
36
|
<gh-combobox name="combo" label="Switch branches/tags">
|
|
37
|
-
<gh-option href="https://www.github.com" .choiceValue
|
|
38
|
-
<gh-option .choiceValue
|
|
39
|
-
<gh-option .choiceValue
|
|
40
|
-
<gh-option .choiceValue
|
|
41
|
-
<gh-option .choiceValue
|
|
37
|
+
<gh-option href="https://www.github.com" .choiceValue="${'master'}" default>master</gh-option>
|
|
38
|
+
<gh-option .choiceValue="${'develop'}">develop</gh-option>
|
|
39
|
+
<gh-option .choiceValue="${'release'}">release</gh-option>
|
|
40
|
+
<gh-option .choiceValue="${'feat/abc'}">feat/abc</gh-option>
|
|
41
|
+
<gh-option .choiceValue="${'feat/xyz123'}">feat/xyz123</gh-option>
|
|
42
42
|
</gh-combobox>
|
|
43
43
|
`;
|
|
44
44
|
```
|
|
@@ -62,7 +62,7 @@ export const Whatsapp = () => {
|
|
|
62
62
|
is-user-text
|
|
63
63
|
is-user-text-read
|
|
64
64
|
image="${obamaImgUrl}"
|
|
65
|
-
.choiceValue
|
|
65
|
+
.choiceValue="${'Barack Obama'}"
|
|
66
66
|
></wa-option>
|
|
67
67
|
<wa-option
|
|
68
68
|
title="Donald Trump"
|
|
@@ -70,28 +70,28 @@ export const Whatsapp = () => {
|
|
|
70
70
|
time="14:59"
|
|
71
71
|
is-user-text
|
|
72
72
|
image="${trumpImgUrl}"
|
|
73
|
-
.choiceValue
|
|
73
|
+
.choiceValue="${'Donald Trump'}"
|
|
74
74
|
></wa-option>
|
|
75
75
|
<wa-option
|
|
76
76
|
title="Joe Biden"
|
|
77
77
|
text="Hehe😅. You too, man, you too..."
|
|
78
78
|
time="yesterday"
|
|
79
79
|
image="${bidenImgUrl}"
|
|
80
|
-
.choiceValue
|
|
80
|
+
.choiceValue="${'Joe Biden'}"
|
|
81
81
|
></wa-option>
|
|
82
82
|
<wa-option
|
|
83
83
|
title="George W. Bush"
|
|
84
84
|
time="friday"
|
|
85
85
|
text="You bet I will. Let's catch up soon!"
|
|
86
86
|
image="${bushImgUrl}"
|
|
87
|
-
.choiceValue
|
|
87
|
+
.choiceValue="${'George W. Bush'}"
|
|
88
88
|
></wa-option>
|
|
89
89
|
<wa-option
|
|
90
90
|
title="Bill Clinton"
|
|
91
91
|
time="thursday"
|
|
92
92
|
text="Dude...😂 😂 😂"
|
|
93
93
|
image="${clintonImgUrl}"
|
|
94
|
-
.choiceValue
|
|
94
|
+
.choiceValue="${'Bill Clinton'}"
|
|
95
95
|
></wa-option>
|
|
96
96
|
</wa-combobox>
|
|
97
97
|
`;
|
|
@@ -114,35 +114,35 @@ export const GoogleSearch = () => {
|
|
|
114
114
|
href="https://www.google.com/search?query=apple"
|
|
115
115
|
target="_blank"
|
|
116
116
|
rel="noopener noreferrer"
|
|
117
|
-
.choiceValue
|
|
117
|
+
.choiceValue="${'Apple'}"
|
|
118
118
|
>Apple</google-option
|
|
119
119
|
>
|
|
120
120
|
<google-option
|
|
121
121
|
href="https://www.google.com/search?query=Artichoke"
|
|
122
122
|
target="_blank"
|
|
123
123
|
rel="noopener noreferrer"
|
|
124
|
-
.choiceValue
|
|
124
|
+
.choiceValue="${'Artichoke'}"
|
|
125
125
|
>Artichoke</google-option
|
|
126
126
|
>
|
|
127
127
|
<google-option
|
|
128
128
|
href="https://www.google.com/search?query=Asparagus"
|
|
129
129
|
target="_blank"
|
|
130
130
|
rel="noopener noreferrer"
|
|
131
|
-
.choiceValue
|
|
131
|
+
.choiceValue="${'Asparagus'}"
|
|
132
132
|
>Asparagus</google-option
|
|
133
133
|
>
|
|
134
134
|
<google-option
|
|
135
135
|
href="https://www.google.com/search?query=Banana"
|
|
136
136
|
target="_blank"
|
|
137
137
|
rel="noopener noreferrer"
|
|
138
|
-
.choiceValue
|
|
138
|
+
.choiceValue="${'Banana'}"
|
|
139
139
|
>Banana</google-option
|
|
140
140
|
>
|
|
141
141
|
<google-option
|
|
142
142
|
href="https://www.google.com/search?query=Beets"
|
|
143
143
|
target="_blank"
|
|
144
144
|
rel="noopener noreferrer"
|
|
145
|
-
.choiceValue
|
|
145
|
+
.choiceValue="${'Beets'}"
|
|
146
146
|
>Beets</google-option
|
|
147
147
|
>
|
|
148
148
|
</google-combobox>
|
|
@@ -34,7 +34,7 @@ export const main = () => html`
|
|
|
34
34
|
`;
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
[...show more](https://github.com/ing-bank/lion/blob/
|
|
37
|
+
[...show more](https://github.com/ing-bank/lion/blob/a59d362cc1228fc855b426440f4bed3bd21d594b/docs/components/combobox/extensions.md)
|
|
38
38
|
|
|
39
39
|
## Features
|
|
40
40
|
|
|
@@ -34,7 +34,7 @@ When `requireOptionMatch` is set to false the textbox is leading, with the listb
|
|
|
34
34
|
|
|
35
35
|
```js preview-story
|
|
36
36
|
export const optionMatch = () => html`
|
|
37
|
-
<lion-combobox name="search" label="Search" .requireOptionMatch
|
|
37
|
+
<lion-combobox name="search" label="Search" .requireOptionMatch="${false}">
|
|
38
38
|
${lazyRender(
|
|
39
39
|
listboxData.map(entry => html` <lion-option .choiceValue="${entry}">${entry}</lion-option> `),
|
|
40
40
|
)}
|
|
@@ -243,7 +243,7 @@ export const multipleChoice = () => html`
|
|
|
243
243
|
${lazyRender(
|
|
244
244
|
listboxData.map(
|
|
245
245
|
(entry, i) => html`
|
|
246
|
-
<lion-option .choiceValue="${entry}" ?checked
|
|
246
|
+
<lion-option .choiceValue="${entry}" ?checked="${i === 0}">${entry}</lion-option>
|
|
247
247
|
`,
|
|
248
248
|
),
|
|
249
249
|
)}
|
|
@@ -258,7 +258,7 @@ Alternatively, the multi-choice flag can be combined with .requireMultipleMatch=
|
|
|
258
258
|
|
|
259
259
|
```js preview-story
|
|
260
260
|
export const multipleCustomizableChoice = () => html`
|
|
261
|
-
<lion-combobox name="combo" label="Multiple" .requireOptionMatch
|
|
261
|
+
<lion-combobox name="combo" label="Multiple" .requireOptionMatch="${false}" multiple-choice>
|
|
262
262
|
<demo-selection-display
|
|
263
263
|
slot="selection-display"
|
|
264
264
|
style="display: contents;"
|
|
@@ -266,7 +266,7 @@ export const multipleCustomizableChoice = () => html`
|
|
|
266
266
|
${lazyRender(
|
|
267
267
|
listboxData.map(
|
|
268
268
|
(entry, i) => html`
|
|
269
|
-
<lion-option .choiceValue="${entry}" ?checked
|
|
269
|
+
<lion-option .choiceValue="${entry}" ?checked="${i === 0}">${entry}</lion-option>
|
|
270
270
|
`,
|
|
271
271
|
),
|
|
272
272
|
)}
|
|
@@ -282,7 +282,7 @@ By default the a check is made which makes sure the value matches an option. Thi
|
|
|
282
282
|
|
|
283
283
|
```js preview-story
|
|
284
284
|
export const validation = () => html`
|
|
285
|
-
<lion-combobox name="combo" label="Validation" .validators
|
|
285
|
+
<lion-combobox name="combo" label="Validation" .validators="${[new Required()]}">
|
|
286
286
|
${lazyRender(
|
|
287
287
|
listboxData.map(entry => html` <lion-option .choiceValue="${entry}">${entry}</lion-option> `),
|
|
288
288
|
)}
|
|
@@ -458,4 +458,4 @@ export const complexObjectChoiceValue = () =>
|
|
|
458
458
|
## Listbox compatibility
|
|
459
459
|
|
|
460
460
|
All configurations that can be applied to `lion-listbox`, can be applied to `lion-combobox` as well.
|
|
461
|
-
See the [listbox documentation](https://github.com/ing-bank/lion/blob/
|
|
461
|
+
See the [listbox documentation](https://github.com/ing-bank/lion/blob/a59d362cc1228fc855b426440f4bed3bd21d594b/docs/components/listbox/overview.md) for more information.
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
|
|
33
33
|
### Events
|
|
34
34
|
|
|
35
|
-
| Name | Type
|
|
36
|
-
| ---------------- |
|
|
37
|
-
| `opened-changed` | `
|
|
35
|
+
| Name | Type | Description | Inherited From |
|
|
36
|
+
| ---------------- | ------------- | ----------- | -------------- |
|
|
37
|
+
| `opened-changed` | `CustomEvent` | | OverlayMixin |
|
|
38
38
|
|
|
39
39
|
### Attributes
|
|
40
40
|
|
|
@@ -21,7 +21,7 @@ export const main = () => html`
|
|
|
21
21
|
Hello! You can close this dialog here:
|
|
22
22
|
<button
|
|
23
23
|
class="demo-dialog-content__close-button"
|
|
24
|
-
@click
|
|
24
|
+
@click="${e => e.target.dispatchEvent(new Event('close-overlay', { bubbles: true }))}"
|
|
25
25
|
>
|
|
26
26
|
⨯
|
|
27
27
|
</button>
|
|
@@ -54,6 +54,6 @@ import '@lion/ui/define/lion-dialog.js';
|
|
|
54
54
|
## Changing the configuration
|
|
55
55
|
|
|
56
56
|
You can use the `.config` property on the dialog to change the configuration.
|
|
57
|
-
The documentation of the full config object can be found in the `overlays` folder or here in [Overlay System - Configuration](https://github.com/ing-bank/lion/blob/
|
|
57
|
+
The documentation of the full config object can be found in the `overlays` folder or here in [Overlay System - Configuration](https://github.com/ing-bank/lion/blob/a59d362cc1228fc855b426440f4bed3bd21d594b/docs/fundamentals/systems/overlays/configuration.md).
|
|
58
58
|
|
|
59
59
|
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,0 +1,32 @@
|
|
|
1
|
+
import { LitElement, html } from 'lit';
|
|
2
|
+
|
|
3
|
+
class DialogTriggerDemo extends LitElement {
|
|
4
|
+
static get properties() {
|
|
5
|
+
return {
|
|
6
|
+
_isOpen: { state: true },
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
toggleDialog(open) {
|
|
11
|
+
// eslint-disable-next-line no-return-assign
|
|
12
|
+
return () => (this._isOpen = open);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
handleDialog(e) {
|
|
16
|
+
this._isOpen = e.detail.opened;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
render() {
|
|
20
|
+
return html`
|
|
21
|
+
<button @click=${this.toggleDialog(true)}>Open dialog</button>
|
|
22
|
+
<lion-dialog ?opened=${this._isOpen} @opened-changed=${this.handleDialog}>
|
|
23
|
+
<div slot="content" class="dialog demo-box">
|
|
24
|
+
Hello! You can close this notification here:
|
|
25
|
+
<button class="close-button" @click=${this.toggleDialog(false)}>⨯</button>
|
|
26
|
+
</div>
|
|
27
|
+
</lion-dialog>
|
|
28
|
+
`;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
customElements.define('dialog-trigger-demo', DialogTriggerDemo);
|
|
@@ -24,7 +24,7 @@ class SlotsDialogContent extends LitElement {
|
|
|
24
24
|
<div class="actions">
|
|
25
25
|
<slot name="actions"></slot>
|
|
26
26
|
</div>
|
|
27
|
-
<button class="close-button" @click
|
|
27
|
+
<button class="close-button" @click="${this._closeOverlay}">⨯</button>
|
|
28
28
|
`;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -30,7 +30,7 @@ class StyledDialogContent extends LitElement {
|
|
|
30
30
|
<div>
|
|
31
31
|
<p>Look how nice this <span class="nice">dialog</span> looks!</p>
|
|
32
32
|
</div>
|
|
33
|
-
<button class="close-button" @click
|
|
33
|
+
<button class="close-button" @click="${this._closeOverlay}">⨯</button>
|
|
34
34
|
`;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -10,18 +10,64 @@ import '@lion/ui/define/lion-dialog.js';
|
|
|
10
10
|
import { demoStyle } from './src/demoStyle.js';
|
|
11
11
|
import './src/styled-dialog-content.js';
|
|
12
12
|
import './src/slots-dialog-content.js';
|
|
13
|
+
import './src/external-dialog.js';
|
|
13
14
|
```
|
|
14
15
|
|
|
15
16
|
```html
|
|
16
17
|
<lion-dialog>
|
|
17
18
|
<div slot="content">
|
|
18
19
|
This is a dialog
|
|
19
|
-
<button @click
|
|
20
|
+
<button @click="${e => e.target.dispatchEvent(new Event('close-overlay', { bubbles: true }))}">x</button>
|
|
20
21
|
<div>
|
|
21
22
|
<button slot="invoker">Click me</button>
|
|
22
23
|
</lion-dialog>
|
|
23
24
|
```
|
|
24
25
|
|
|
26
|
+
## External trigger
|
|
27
|
+
|
|
28
|
+
```js preview-story
|
|
29
|
+
export const externalTrigger = () => {
|
|
30
|
+
const externalTriggerDialog = () => {
|
|
31
|
+
class DialogTriggerDemo extends LitElement {
|
|
32
|
+
static get properties() {
|
|
33
|
+
return {
|
|
34
|
+
_isOpen: { state: true },
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
toggleDialog(open) {
|
|
39
|
+
return () => (this._isOpen = open);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
handleDialog(e) {
|
|
43
|
+
this._isOpen = e.detail.opened;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
render() {
|
|
47
|
+
return html`
|
|
48
|
+
<button @click=${this.toggleDialog(true)}>Open dialog</button>
|
|
49
|
+
<lion-dialog ?opened=${this._isOpen} @opened-changed=${this.handleDialog}>
|
|
50
|
+
<div slot="content" class="dialog demo-box">
|
|
51
|
+
Hello! You can close this notification here:
|
|
52
|
+
<button class="close-button" @click=${this.toggleDialog(false)}>⨯</button>
|
|
53
|
+
</div>
|
|
54
|
+
</lion-dialog>
|
|
55
|
+
`;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
return html`
|
|
61
|
+
<style>
|
|
62
|
+
${demoStyle}
|
|
63
|
+
</style>
|
|
64
|
+
<div class="demo-box_placements">
|
|
65
|
+
<dialog-trigger-demo></dialog-trigger-demo>
|
|
66
|
+
</div>
|
|
67
|
+
`;
|
|
68
|
+
};
|
|
69
|
+
```
|
|
70
|
+
|
|
25
71
|
## Placement overrides
|
|
26
72
|
|
|
27
73
|
```js preview-story
|
|
@@ -35,7 +81,7 @@ export const placementOverrides = () => {
|
|
|
35
81
|
Hello! You can close this notification here:
|
|
36
82
|
<button
|
|
37
83
|
class="close-button"
|
|
38
|
-
@click
|
|
84
|
+
@click="${e => e.target.dispatchEvent(new Event('close-overlay', { bubbles: true }))}"
|
|
39
85
|
>
|
|
40
86
|
⨯
|
|
41
87
|
</button>
|
|
@@ -88,7 +134,7 @@ export const otherOverrides = () => {
|
|
|
88
134
|
Hello! You can close this dialog here:
|
|
89
135
|
<button
|
|
90
136
|
class="demo-dialog-content__close-button"
|
|
91
|
-
@click
|
|
137
|
+
@click="${e => e.target.dispatchEvent(new Event('close-overlay', { bubbles: true }))}"
|
|
92
138
|
>
|
|
93
139
|
⨯
|
|
94
140
|
</button>
|
|
@@ -125,9 +125,9 @@ export const methods = ({ shadowRoot }) => html`
|
|
|
125
125
|
${demoStyle}
|
|
126
126
|
</style>
|
|
127
127
|
<section style="margin-top:16px">
|
|
128
|
-
<button @click
|
|
129
|
-
<button @click
|
|
130
|
-
<button @click
|
|
128
|
+
<button @click="${() => shadowRoot.querySelector('#drawer').toggle()}">Toggle content</button>
|
|
129
|
+
<button @click="${() => shadowRoot.querySelector('#drawer').show()}">Show content</button>
|
|
130
|
+
<button @click="${() => shadowRoot.querySelector('#drawer').hide()}">Hide content</button>
|
|
131
131
|
</section>
|
|
132
132
|
|
|
133
133
|
<div class="demo-container">
|