@lion/ui 0.0.9 → 0.0.10
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/components/core/src/SlotMixin.js +2 -1
- package/components/dialog/test/lion-dialog.test.js +3 -7
- package/components/form-integrations/test/form-group-methods.test.js +6 -4
- package/components/form-integrations/test/form-integrations.test.js +10 -5
- package/components/form-integrations/test/helpers/umbrella-form.js +10 -0
- package/components/form-integrations/test/model-value-consistency.test.js +29 -20
- package/components/input-datepicker/src/LionInputDatepicker.js +64 -100
- package/components/input-datepicker/src/localizeNamespaceLoader.js +188 -0
- package/components/input-datepicker/test/lion-input-datepicker.test.js +15 -20
- package/components/input-datepicker/test-helpers/DatepickerInputObject.js +3 -3
- package/components/input-tel/src/parsers.js +1 -1
- package/components/listbox/test-suites/ListboxMixin.suite.js +3 -3
- package/components/localize/test/number/formatNumber.test.js +2 -6
- package/components/overlays/src/OverlayController.js +236 -289
- package/components/overlays/src/OverlayMixin.js +17 -18
- package/components/overlays/src/OverlaysManager.js +28 -53
- package/components/overlays/src/overlayDocumentStyle.js +24 -0
- package/components/overlays/src/overlayShadowDomStyle.js +138 -0
- package/components/overlays/src/singleton.js +3 -1
- package/components/overlays/test/ArrowMixin.test.js +0 -1
- package/components/overlays/test/OverlayController.test.js +306 -273
- package/components/overlays/test/OverlaysManager.test.js +23 -32
- package/components/overlays/test/global-positioning.test.js +4 -15
- package/components/overlays/test/local-positioning.test.js +65 -38
- package/components/overlays/test-suites/OverlayMixin.suite.js +18 -26
- package/components/overlays/types/OverlayConfig.ts +32 -11
- package/components/overlays/types/OverlayMixinTypes.ts +2 -2
- package/components/select-rich/src/LionSelectInvoker.js +2 -3
- package/components/select-rich/src/LionSelectRich.js +22 -20
- package/components/select-rich/test/lion-select-rich.test.js +5 -7
- package/custom-elements.json +251 -362
- package/dist-types/components/core/src/SlotMixin.d.ts.map +1 -1
- package/dist-types/components/form-integrations/test/helpers/umbrella-form.d.ts +4 -0
- package/dist-types/components/form-integrations/test/helpers/umbrella-form.d.ts.map +1 -1
- package/dist-types/components/form-integrations/test/model-value-consistency.test.d.ts.map +1 -1
- package/dist-types/components/input-datepicker/src/LionInputDatepicker.d.ts +3 -3
- package/dist-types/components/input-datepicker/src/LionInputDatepicker.d.ts.map +1 -1
- package/dist-types/components/input-datepicker/src/localizeNamespaceLoader.d.ts +4 -0
- package/dist-types/components/input-datepicker/src/localizeNamespaceLoader.d.ts.map +1 -0
- package/dist-types/components/overlays/src/OverlayController.d.ts +46 -101
- 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/overlays/src/OverlaysManager.d.ts +0 -7
- package/dist-types/components/overlays/src/OverlaysManager.d.ts.map +1 -1
- package/dist-types/components/overlays/src/overlayDocumentStyle.d.ts +2 -0
- package/dist-types/components/overlays/src/overlayDocumentStyle.d.ts.map +1 -0
- package/dist-types/components/overlays/src/overlayShadowDomStyle.d.ts +2 -0
- package/dist-types/components/overlays/src/overlayShadowDomStyle.d.ts.map +1 -0
- package/dist-types/components/overlays/src/singleton.d.ts +2 -1
- package/dist-types/components/overlays/src/singleton.d.ts.map +1 -1
- package/dist-types/components/overlays/test-suites/OverlayMixin.suite.d.ts.map +1 -1
- package/dist-types/components/overlays/types/OverlayConfig.d.ts +14 -10
- package/dist-types/components/overlays/types/OverlayConfig.d.ts.map +1 -1
- package/dist-types/components/overlays/types/OverlayMixinTypes.d.ts +2 -2
- package/dist-types/components/overlays/types/OverlayMixinTypes.d.ts.map +1 -1
- package/dist-types/components/select-rich/src/LionSelectInvoker.d.ts +3 -27
- package/dist-types/components/select-rich/src/LionSelectInvoker.d.ts.map +1 -1
- package/dist-types/components/select-rich/src/LionSelectRich.d.ts.map +1 -1
- package/dist-types/components/select-rich/test/lion-select-rich.test.d.ts.map +1 -1
- package/dist-types/exports/input-datepicker.d.ts +0 -1
- package/dist-types/exports/overlays.d.ts +0 -1
- package/dist-types/exports/types/overlays.d.ts +1 -0
- package/dist-types/exports/types/overlays.d.ts.map +1 -1
- package/dist-types/tsconfig.tsbuildinfo +1 -1
- package/docs/components/checkbox-group/overview.md +2 -2
- package/docs/components/collapsible/overview.md +1 -1
- package/docs/components/combobox/overview.md +1 -1
- package/docs/components/combobox/use-cases.md +1 -1
- package/docs/components/dialog/overview.md +5 -9
- package/docs/components/dialog/use-cases.md +43 -87
- package/docs/components/fieldset/overview.md +5 -5
- package/docs/components/form/overview.md +3 -3
- package/docs/components/icon/use-cases.md +1 -1
- package/docs/components/input/overview.md +1 -1
- package/docs/components/input-amount/overview.md +3 -3
- package/docs/components/input-date/overview.md +3 -3
- package/docs/components/input-datepicker/overview.md +5 -5
- package/docs/components/input-email/overview.md +2 -2
- package/docs/components/input-iban/overview.md +2 -2
- package/docs/components/input-range/overview.md +2 -2
- 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 +6 -6
- package/docs/components/input-tel-dropdown/overview.md +1 -1
- package/docs/components/radio-group/overview.md +3 -3
- package/docs/components/select-rich/use-cases.md +1 -1
- package/docs/components/tabs/examples.md +1 -1
- 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/systems/core/overview.md +1 -1
- package/docs/fundamentals/systems/form/formatting-and-parsing.md +4 -4
- 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 +4 -0
- package/docs/fundamentals/systems/form/validate.md +1 -1
- package/docs/fundamentals/systems/localize/overview.md +4 -4
- package/docs/fundamentals/systems/overlays/assets/{applyDemoOverlayStyles.js → applyDemoOverlayStyles.mjs} +2 -1
- package/docs/fundamentals/systems/overlays/assets/demo-el-using-overlaymixin.mjs +119 -0
- package/docs/fundamentals/systems/overlays/assets/{demo-overlay-backdrop.js → demo-overlay-backdrop.mjs} +3 -4
- package/docs/fundamentals/systems/overlays/assets/demo-overlay-positioning.mjs +537 -0
- package/docs/fundamentals/systems/overlays/assets/umbrella-form.js +9 -2
- package/docs/fundamentals/systems/overlays/configuration.md +56 -54
- package/docs/fundamentals/systems/overlays/overview.md +5 -5
- package/docs/fundamentals/systems/overlays/use-cases.md +83 -77
- package/docs/fundamentals/tools/helpers/overview.md +1 -1
- package/docs/fundamentals/tools/singleton-manager/overview.md +4 -4
- package/docs/guides/how-to/create-a-custom-field.md +6 -6
- package/docs/guides/how-to/extend-a-native-input.md +3 -3
- package/docs/guides/index.md +8 -8
- package/docs/guides/principles/index.md +5 -5
- package/docs/guides/principles/styling.md +1 -1
- package/exports/input-datepicker.js +0 -1
- package/exports/overlays.js +0 -1
- package/exports/types/overlays.ts +1 -0
- package/package.json +2 -1
- package/components/input-datepicker/src/LionCalendarOverlayFrame.js +0 -125
- package/components/overlays/src/globalOverlaysStyle.js +0 -139
- package/dist-types/components/input-datepicker/src/LionCalendarOverlayFrame.d.ts +0 -10
- package/dist-types/components/input-datepicker/src/LionCalendarOverlayFrame.d.ts.map +0 -1
- package/dist-types/components/overlays/src/globalOverlaysStyle.d.ts +0 -2
- package/dist-types/components/overlays/src/globalOverlaysStyle.d.ts.map +0 -1
- package/dist-types/exports/define/lion-calendar-overlay-frame.d.ts +0 -2
- package/dist-types/exports/define/lion-calendar-overlay-frame.d.ts.map +0 -1
- package/docs/fundamentals/systems/overlays/assets/demo-overlay-system.js +0 -42
- package/docs/fundamentals/systems/overlays/form-integration.md +0 -65
- package/docs/fundamentals/systems/overlays/scope.md +0 -176
- package/exports/define/lion-calendar-overlay-frame.js +0 -3
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
```js script
|
|
4
4
|
import { html } from '@mdjs/mdjs-preview';
|
|
5
|
-
import './assets/demo-
|
|
6
|
-
import './assets/applyDemoOverlayStyles.
|
|
5
|
+
import './assets/demo-el-using-overlaymixin.mjs';
|
|
6
|
+
import './assets/applyDemoOverlayStyles.mjs';
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
The `OverlayController` has many configuration options.
|
|
@@ -14,7 +14,7 @@ The `OverlayMixin` exposes these options via `.config`.
|
|
|
14
14
|
|
|
15
15
|
Either `'local'` or `'global'`.
|
|
16
16
|
This determines the DOM position of the `contentNode`, either next to the invokerNode,
|
|
17
|
-
or in the `
|
|
17
|
+
or in the `overlays` container at the bottom of the `<body>`.
|
|
18
18
|
|
|
19
19
|
### Local
|
|
20
20
|
|
|
@@ -28,7 +28,7 @@ export const placementLocal = () => {
|
|
|
28
28
|
border: 1px solid black;
|
|
29
29
|
}
|
|
30
30
|
</style>
|
|
31
|
-
<demo-
|
|
31
|
+
<demo-el-using-overlaymixin .config=${placementModeLocalConfig}>
|
|
32
32
|
<button slot="invoker">Click me to open the local overlay!</button>
|
|
33
33
|
<div slot="content" class="demo-overlay">
|
|
34
34
|
Hello! You can close this notification here:
|
|
@@ -39,7 +39,7 @@ export const placementLocal = () => {
|
|
|
39
39
|
⨯
|
|
40
40
|
</button>
|
|
41
41
|
</div>
|
|
42
|
-
</demo-
|
|
42
|
+
</demo-el-using-overlaymixin>
|
|
43
43
|
`;
|
|
44
44
|
};
|
|
45
45
|
```
|
|
@@ -50,7 +50,7 @@ export const placementLocal = () => {
|
|
|
50
50
|
export const placementGlobal = () => {
|
|
51
51
|
const placementModeGlobalConfig = { placementMode: 'global' };
|
|
52
52
|
return html`
|
|
53
|
-
<demo-
|
|
53
|
+
<demo-el-using-overlaymixin .config=${placementModeGlobalConfig}>
|
|
54
54
|
<button slot="invoker">Click me to open the global overlay!</button>
|
|
55
55
|
<div slot="content" class="demo-overlay">
|
|
56
56
|
Hello! You can close this notification here:
|
|
@@ -61,14 +61,14 @@ export const placementGlobal = () => {
|
|
|
61
61
|
⨯
|
|
62
62
|
</button>
|
|
63
63
|
</div>
|
|
64
|
-
</demo-
|
|
64
|
+
</demo-el-using-overlaymixin>
|
|
65
65
|
`;
|
|
66
66
|
};
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
## isTooltip (placementMode: 'local')
|
|
70
70
|
|
|
71
|
-
As specified in the [overlay rationale](https://github.com/ing-bank/lion/blob/
|
|
71
|
+
As specified in the [overlay rationale](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/fundamentals/systems/overlays/rationale.md) there are only two official types of overlays: dialogs and tooltips. And their main differences are:
|
|
72
72
|
|
|
73
73
|
- Dialogs have a modal option, tooltips don’t
|
|
74
74
|
- Dialogs have interactive content, tooltips don’t
|
|
@@ -91,12 +91,12 @@ export const isTooltip = () => {
|
|
|
91
91
|
const tooltipConfig = { placementMode: 'local', isTooltip: true, handlesAccessibility: true };
|
|
92
92
|
|
|
93
93
|
return html`
|
|
94
|
-
<demo-
|
|
94
|
+
<demo-el-using-overlaymixin id="tooltip" .config=${tooltipConfig}>
|
|
95
95
|
<button slot="invoker" @mouseenter=${showTooltip} @mouseleave=${hideTooltip}>
|
|
96
96
|
Hover me to open the tooltip!
|
|
97
97
|
</button>
|
|
98
98
|
<div slot="content" class="demo-overlay">Hello!</div>
|
|
99
|
-
</demo-
|
|
99
|
+
</demo-el-using-overlaymixin>
|
|
100
100
|
`;
|
|
101
101
|
};
|
|
102
102
|
```
|
|
@@ -114,7 +114,7 @@ You use the feature on any type of overlay.
|
|
|
114
114
|
export const trapsKeyboardFocus = () => {
|
|
115
115
|
const trapsKeyboardFocusConfig = { trapsKeyboardFocus: true };
|
|
116
116
|
return html`
|
|
117
|
-
<demo-
|
|
117
|
+
<demo-el-using-overlaymixin .config=${trapsKeyboardFocusConfig}>
|
|
118
118
|
<button slot="invoker">Click me to open the overlay!</button>
|
|
119
119
|
<div slot="content" class="demo-overlay">
|
|
120
120
|
<div><a href="#">A focusable anchor</a></div>
|
|
@@ -127,7 +127,7 @@ export const trapsKeyboardFocus = () => {
|
|
|
127
127
|
⨯
|
|
128
128
|
</button>
|
|
129
129
|
</div>
|
|
130
|
-
</demo-
|
|
130
|
+
</demo-el-using-overlaymixin>
|
|
131
131
|
`;
|
|
132
132
|
};
|
|
133
133
|
```
|
|
@@ -140,7 +140,7 @@ Boolean property. Will allow closing the overlay on ESC key when enabled.
|
|
|
140
140
|
export const hidesOnEsc = () => {
|
|
141
141
|
const hidesOnEscConfig = { hidesOnEsc: true };
|
|
142
142
|
return html`
|
|
143
|
-
<demo-
|
|
143
|
+
<demo-el-using-overlaymixin .config=${hidesOnEscConfig}>
|
|
144
144
|
<button slot="invoker">Click me to open the overlay!</button>
|
|
145
145
|
<div slot="content" class="demo-overlay">
|
|
146
146
|
Hello! You can close this notification here:
|
|
@@ -151,7 +151,7 @@ export const hidesOnEsc = () => {
|
|
|
151
151
|
⨯
|
|
152
152
|
</button>
|
|
153
153
|
</div>
|
|
154
|
-
</demo-
|
|
154
|
+
</demo-el-using-overlaymixin>
|
|
155
155
|
`;
|
|
156
156
|
};
|
|
157
157
|
```
|
|
@@ -164,7 +164,7 @@ Boolean property. When enabled allows closing the overlay on ESC key, even when
|
|
|
164
164
|
export const hidesOnOutsideEsc = () => {
|
|
165
165
|
const hidesOnEscConfig = { hidesOnOutsideEsc: true };
|
|
166
166
|
return html`
|
|
167
|
-
<demo-
|
|
167
|
+
<demo-el-using-overlaymixin .config=${hidesOnEscConfig}>
|
|
168
168
|
<button slot="invoker">Click me to open the overlay!</button>
|
|
169
169
|
<div slot="content" class="demo-overlay">
|
|
170
170
|
Hello! You can close this notification here:
|
|
@@ -175,7 +175,7 @@ export const hidesOnOutsideEsc = () => {
|
|
|
175
175
|
⨯
|
|
176
176
|
</button>
|
|
177
177
|
</div>
|
|
178
|
-
</demo-
|
|
178
|
+
</demo-el-using-overlaymixin>
|
|
179
179
|
`;
|
|
180
180
|
};
|
|
181
181
|
```
|
|
@@ -188,7 +188,7 @@ Boolean property. Will allow closing the overlay by clicking outside the `conten
|
|
|
188
188
|
export const hidesOnOutsideClick = () => {
|
|
189
189
|
const hidesOnOutsideClickConfig = { hidesOnOutsideClick: true };
|
|
190
190
|
return html`
|
|
191
|
-
<demo-
|
|
191
|
+
<demo-el-using-overlaymixin .config=${hidesOnOutsideClickConfig}>
|
|
192
192
|
<button slot="invoker">Click me to open the overlay!</button>
|
|
193
193
|
<div slot="content" class="demo-overlay">
|
|
194
194
|
<label for="myInput">Clicking this label should not trigger close</label>
|
|
@@ -200,7 +200,7 @@ export const hidesOnOutsideClick = () => {
|
|
|
200
200
|
⨯
|
|
201
201
|
</button>
|
|
202
202
|
</div>
|
|
203
|
-
</demo-
|
|
203
|
+
</demo-el-using-overlaymixin>
|
|
204
204
|
`;
|
|
205
205
|
};
|
|
206
206
|
```
|
|
@@ -213,9 +213,12 @@ In the example, we focus the body instead of the `invokerNode`.
|
|
|
213
213
|
|
|
214
214
|
```js preview-story
|
|
215
215
|
export const elementToFocusAfterHide = () => {
|
|
216
|
-
const
|
|
216
|
+
const btn = document.createElement('button');
|
|
217
|
+
btn.innerText = 'I should get focus';
|
|
218
|
+
|
|
219
|
+
const elementToFocusAfterHideConfig = { elementToFocusAfterHide: btn };
|
|
217
220
|
return html`
|
|
218
|
-
<demo-
|
|
221
|
+
<demo-el-using-overlaymixin .config=${elementToFocusAfterHideConfig}>
|
|
219
222
|
<button slot="invoker">Click me to open the overlay!</button>
|
|
220
223
|
<div slot="content" class="demo-overlay">
|
|
221
224
|
Hello! You can close this notification here:
|
|
@@ -226,7 +229,8 @@ export const elementToFocusAfterHide = () => {
|
|
|
226
229
|
⨯
|
|
227
230
|
</button>
|
|
228
231
|
</div>
|
|
229
|
-
</demo-
|
|
232
|
+
</demo-el-using-overlaymixin>
|
|
233
|
+
${btn}
|
|
230
234
|
`;
|
|
231
235
|
};
|
|
232
236
|
```
|
|
@@ -239,18 +243,18 @@ Boolean property. When true, will add a backdrop when the overlay is opened.
|
|
|
239
243
|
> If this is not what you intend, you can make the overlays not nested, where opening one, closes the other.
|
|
240
244
|
> Fortunately, we also have a configuration option that simulates that behavior in the next section `isBlocking`.
|
|
241
245
|
|
|
242
|
-
The backdrop styling can be configured by targeting the `.
|
|
246
|
+
The backdrop styling can be configured by targeting the `.overlays .overlays__backdrop` css selector.
|
|
243
247
|
|
|
244
248
|
The backdrop animation can be configured by targeting the
|
|
245
|
-
`.
|
|
246
|
-
`.
|
|
249
|
+
`.overlays .overlays__backdrop--animation-in` and
|
|
250
|
+
`.overlays .overlays__backdrop--animation-out` css selector.
|
|
247
251
|
This currently only supports CSS Animations, because it relies on the `animationend` event to add/remove classes.
|
|
248
252
|
|
|
249
253
|
```js preview-story
|
|
250
254
|
export const hasBackdrop = () => {
|
|
251
255
|
const hasBackdropConfig = { hasBackdrop: true };
|
|
252
256
|
return html`
|
|
253
|
-
<demo-
|
|
257
|
+
<demo-el-using-overlaymixin .config=${hasBackdropConfig}>
|
|
254
258
|
<button slot="invoker">Click me to open the overlay!</button>
|
|
255
259
|
<div slot="content" class="demo-overlay">
|
|
256
260
|
Hello! You can close this notification here:
|
|
@@ -261,7 +265,7 @@ export const hasBackdrop = () => {
|
|
|
261
265
|
⨯
|
|
262
266
|
</button>
|
|
263
267
|
</div>
|
|
264
|
-
</demo-
|
|
268
|
+
</demo-el-using-overlaymixin>
|
|
265
269
|
`;
|
|
266
270
|
};
|
|
267
271
|
```
|
|
@@ -274,24 +278,22 @@ Boolean property. When true, will block other overlays.
|
|
|
274
278
|
export const isBlocking = () => {
|
|
275
279
|
const isBlockingConfig = { hasBackdrop: true, isBlocking: true };
|
|
276
280
|
return html`
|
|
277
|
-
<demo-
|
|
278
|
-
<button slot="invoker">
|
|
279
|
-
<div slot="content" class="demo-overlay">
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
</div>
|
|
294
|
-
Hello! You can close this notification here:
|
|
281
|
+
<demo-el-using-overlaymixin>
|
|
282
|
+
<button slot="invoker">Overlay A: open first</button>
|
|
283
|
+
<div slot="content" class="demo-overlay" style="width:200px;">
|
|
284
|
+
This overlay gets closed when overlay B gets opened
|
|
285
|
+
<button
|
|
286
|
+
class="close-button"
|
|
287
|
+
@click=${e => e.target.dispatchEvent(new Event('close-overlay', { bubbles: true }))}
|
|
288
|
+
>
|
|
289
|
+
⨯
|
|
290
|
+
</button>
|
|
291
|
+
</div>
|
|
292
|
+
</demo-el-using-overlaymixin>
|
|
293
|
+
<demo-el-using-overlaymixin .config=${isBlockingConfig}>
|
|
294
|
+
<button slot="invoker">Overlay B: open second</button>
|
|
295
|
+
<div slot="content" class="demo-overlay demo-overlay--blocking">
|
|
296
|
+
Overlay A is hidden... now close me and see overlay A again.
|
|
295
297
|
<button
|
|
296
298
|
class="close-button"
|
|
297
299
|
@click=${e => e.target.dispatchEvent(new Event('close-overlay', { bubbles: true }))}
|
|
@@ -299,7 +301,7 @@ export const isBlocking = () => {
|
|
|
299
301
|
⨯
|
|
300
302
|
</button>
|
|
301
303
|
</div>
|
|
302
|
-
</demo-
|
|
304
|
+
</demo-el-using-overlaymixin>
|
|
303
305
|
`;
|
|
304
306
|
};
|
|
305
307
|
```
|
|
@@ -315,7 +317,7 @@ Boolean property. When true, prevents scrolling content that is outside of the `
|
|
|
315
317
|
export const preventsScroll = () => {
|
|
316
318
|
const preventsScrollConfig = { preventsScroll: true };
|
|
317
319
|
return html`
|
|
318
|
-
<demo-
|
|
320
|
+
<demo-el-using-overlaymixin .config=${preventsScrollConfig}>
|
|
319
321
|
<button slot="invoker">Click me to open the overlay!</button>
|
|
320
322
|
<div slot="content" class="demo-overlay">
|
|
321
323
|
Hello! You can close this notification here:
|
|
@@ -326,7 +328,7 @@ export const preventsScroll = () => {
|
|
|
326
328
|
⨯
|
|
327
329
|
</button>
|
|
328
330
|
</div>
|
|
329
|
-
</demo-
|
|
331
|
+
</demo-el-using-overlaymixin>
|
|
330
332
|
`;
|
|
331
333
|
};
|
|
332
334
|
```
|
|
@@ -351,11 +353,11 @@ Options:
|
|
|
351
353
|
export const viewportConfig = () => {
|
|
352
354
|
const viewportConfig = {
|
|
353
355
|
placementMode: 'global',
|
|
354
|
-
viewportConfig: { placement: '
|
|
356
|
+
viewportConfig: { placement: 'bottom-left' },
|
|
355
357
|
};
|
|
356
358
|
return html`
|
|
357
|
-
<demo-
|
|
358
|
-
<button slot="invoker">Click me to open the overlay in the
|
|
359
|
+
<demo-el-using-overlaymixin .config=${viewportConfig}>
|
|
360
|
+
<button slot="invoker">Click me to open the overlay in the bottom left corner!</button>
|
|
359
361
|
<div slot="content" class="demo-overlay">
|
|
360
362
|
Hello! You can close this notification here:
|
|
361
363
|
<button
|
|
@@ -365,7 +367,7 @@ export const viewportConfig = () => {
|
|
|
365
367
|
⨯
|
|
366
368
|
</button>
|
|
367
369
|
</div>
|
|
368
|
-
</demo-
|
|
370
|
+
</demo-el-using-overlaymixin>
|
|
369
371
|
`;
|
|
370
372
|
};
|
|
371
373
|
```
|
|
@@ -383,7 +385,7 @@ Features:
|
|
|
383
385
|
|
|
384
386
|
> Popper strictly is scoped on positioning. **It does not change the dimensions of the content node nor the invoker node**.
|
|
385
387
|
> This also means that if you use the arrow feature, you are in charge of styling it properly, use the data-popper-placement attribute for this.
|
|
386
|
-
> An example implementation can be found in [lion-tooltip](https://github.com/ing-bank/lion/blob/
|
|
388
|
+
> An example implementation can be found in [lion-tooltip](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/components/tooltip/overview.md), where an arrow is set by default.
|
|
387
389
|
|
|
388
390
|
To override the default options we set for local mode, you add a `popperConfig` object to the config passed to the OverlayController.
|
|
389
391
|
Here's a succinct overview of some often used popper properties:
|
|
@@ -434,7 +436,7 @@ export const popperConfig = () => {
|
|
|
434
436
|
border: 1px solid black;
|
|
435
437
|
}
|
|
436
438
|
</style>
|
|
437
|
-
<demo-
|
|
439
|
+
<demo-el-using-overlaymixin .config=${popperConfig}>
|
|
438
440
|
<button slot="invoker">Click me to open the overlay!</button>
|
|
439
441
|
<div slot="content" class="demo-overlay">
|
|
440
442
|
Hello! You can close this notification here:
|
|
@@ -445,7 +447,7 @@ export const popperConfig = () => {
|
|
|
445
447
|
⨯
|
|
446
448
|
</button>
|
|
447
449
|
</div>
|
|
448
|
-
</demo-
|
|
450
|
+
</demo-el-using-overlaymixin>
|
|
449
451
|
`;
|
|
450
452
|
};
|
|
451
453
|
```
|
|
@@ -6,7 +6,7 @@ Manages their position on the screen relative to other elements, including other
|
|
|
6
6
|
|
|
7
7
|
Its purpose is to make it easy to use our Overlay System declaratively. It can be easily extended where needed, to override event listeners and more.
|
|
8
8
|
|
|
9
|
-
See [lion-dialog](../../../components/dialog/overview.md) and [lion-tooltip](https://github.com/ing-bank/lion/blob/
|
|
9
|
+
See [lion-dialog](../../../components/dialog/overview.md) and [lion-tooltip](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/components/tooltip/overview.md) for example Web Component implementations using the Overlay System.
|
|
10
10
|
|
|
11
11
|
## Features
|
|
12
12
|
|
|
@@ -18,9 +18,9 @@ See [lion-dialog](../../../components/dialog/overview.md) and [lion-tooltip](htt
|
|
|
18
18
|
- lion-overlay web component:
|
|
19
19
|
- Show content when clicking the invoker
|
|
20
20
|
- Have a `.config` object to set or update the OverlayController's configuration
|
|
21
|
-
- [**OverlaysManager**](https://github.com/ing-bank/lion/blob/
|
|
22
|
-
- [**OverlayController**](https://github.com/ing-bank/lion/blob/
|
|
23
|
-
- [**OverlayMixin**](https://github.com/ing-bank/lion/blob/
|
|
21
|
+
- [**OverlaysManager**](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/fundamentals/systems/overlays/use-cases.md#overlaysmanager), a global repository keeping track of all different types of overlays
|
|
22
|
+
- [**OverlayController**](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/fundamentals/systems/overlays/use-cases.md#overlaycontroller), a single controller class for handling overlays
|
|
23
|
+
- [**OverlayMixin**](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/fundamentals/systems/overlays/use-cases.md#overlaymixin), a mixin that can be used to create webcomponents that use the OverlayController under the hood
|
|
24
24
|
|
|
25
25
|
Usually you will use `lion-dialog` (or `lion-tooltip` if this makes more sense).
|
|
26
26
|
|
|
@@ -110,7 +110,7 @@ class MyOverlayComponent extends OverlayMixin(LitElement) {
|
|
|
110
110
|
|
|
111
111
|
## Rationales
|
|
112
112
|
|
|
113
|
-
Please check the [system rationals](https://github.com/ing-bank/lion/blob/
|
|
113
|
+
Please check the [system rationals](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/fundamentals/systems/overlays/rationale.md) folder, where we go more in-depth.
|
|
114
114
|
|
|
115
115
|
### Aria roles
|
|
116
116
|
|