@lion/ui 0.0.8 → 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/components/validate-messages/src/loadDefaultFeedbackMessages.js +2 -181
- package/components/validate-messages/src/loadDefaultFeedbackMessagesNoSideEffects.js +194 -0
- package/components/validate-messages/test/loadDefaultFeedbackMessages.test.js +1 -18
- package/components/validate-messages/test/loadDefaultFeedbackMessagesNoSideEffects.js +49 -0
- package/custom-elements.json +370 -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/components/validate-messages/src/loadDefaultFeedbackMessages.d.ts +3 -0
- package/dist-types/components/validate-messages/src/loadDefaultFeedbackMessages.d.ts.map +1 -1
- package/dist-types/components/validate-messages/src/loadDefaultFeedbackMessagesNoSideEffects.d.ts +10 -0
- package/dist-types/components/validate-messages/src/loadDefaultFeedbackMessagesNoSideEffects.d.ts.map +1 -0
- package/dist-types/components/validate-messages/test/loadDefaultFeedbackMessages.test.d.ts.map +1 -1
- package/dist-types/components/validate-messages/test/loadDefaultFeedbackMessagesNoSideEffects.d.ts +2 -0
- package/dist-types/components/validate-messages/test/loadDefaultFeedbackMessagesNoSideEffects.d.ts.map +1 -0
- 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/exports/validate-messages-no-side-effects.d.ts +2 -0
- package/dist-types/exports/validate-messages-no-side-effects.d.ts.map +1 -0
- 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/exports/validate-messages-no-side-effects.js +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
|
@@ -11,9 +11,9 @@ import {
|
|
|
11
11
|
withModalDialogConfig,
|
|
12
12
|
} from '@lion/ui/overlays.js';
|
|
13
13
|
|
|
14
|
-
import './assets/demo-
|
|
15
|
-
import './assets/demo-overlay-backdrop.
|
|
16
|
-
import './assets/applyDemoOverlayStyles.
|
|
14
|
+
import './assets/demo-el-using-overlaymixin.mjs';
|
|
15
|
+
import './assets/demo-overlay-backdrop.mjs';
|
|
16
|
+
import './assets/applyDemoOverlayStyles.mjs';
|
|
17
17
|
import { ref, createRef } from 'lit/directives/ref.js';
|
|
18
18
|
```
|
|
19
19
|
|
|
@@ -21,11 +21,11 @@ The overlay system allows to create different types of overlays like dialogs, to
|
|
|
21
21
|
It's designed to be highly flexible, while still delivering sensible defaults.
|
|
22
22
|
On top of this, the system was built having accessibility in mind.
|
|
23
23
|
|
|
24
|
-
For a detailed rationale, please consult [Rationale](https://github.com/ing-bank/lion/blob/
|
|
24
|
+
For a detailed rationale, please consult [Rationale](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/fundamentals/systems/overlays/rationale.md).
|
|
25
25
|
|
|
26
26
|
```js preview-story
|
|
27
27
|
export const main = () => html`
|
|
28
|
-
<demo-
|
|
28
|
+
<demo-el-using-overlaymixin>
|
|
29
29
|
<button slot="invoker">Click me to open the overlay!</button>
|
|
30
30
|
<div slot="content" class="demo-overlay">
|
|
31
31
|
Hello! You can close this notification here:
|
|
@@ -33,7 +33,7 @@ export const main = () => html`
|
|
|
33
33
|
⨯
|
|
34
34
|
</button>
|
|
35
35
|
</div>
|
|
36
|
-
</demo-
|
|
36
|
+
</demo-el-using-overlaymixin>
|
|
37
37
|
`;
|
|
38
38
|
```
|
|
39
39
|
|
|
@@ -67,7 +67,7 @@ Global refers to overlays where the content is positioned in a global root node
|
|
|
67
67
|
|
|
68
68
|
Overlays can be configured in many ways to suit your needs. We go in-depth into each option in the Overlay System - Configuration chapter.
|
|
69
69
|
|
|
70
|
-
We also export a few [preset configuration objects](https://github.com/ing-bank/lion/blob/
|
|
70
|
+
We also export a few [preset configuration objects](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/fundamentals/systems/overlays/configuration.md).
|
|
71
71
|
|
|
72
72
|
- withModalDialogConfig
|
|
73
73
|
- withDropdownConfig
|
|
@@ -132,7 +132,7 @@ render() {
|
|
|
132
132
|
or declaratively in your template with the `.config` property
|
|
133
133
|
|
|
134
134
|
```html
|
|
135
|
-
<demo-
|
|
135
|
+
<demo-el-using-overlaymixin .config=${{ ...withModalDialogConfig() }}>
|
|
136
136
|
<button slot="invoker">Click me to open the overlay!</button>
|
|
137
137
|
<div slot="content" class="demo-overlay">
|
|
138
138
|
Hello! You can close this notification here:
|
|
@@ -142,7 +142,7 @@ or declaratively in your template with the `.config` property
|
|
|
142
142
|
⨯
|
|
143
143
|
</button>
|
|
144
144
|
</div>
|
|
145
|
-
</demo-
|
|
145
|
+
</demo-el-using-overlaymixin>
|
|
146
146
|
```
|
|
147
147
|
|
|
148
148
|
### Backdrop
|
|
@@ -155,7 +155,7 @@ The easiest way is declarative. This can be achieved by adding a `<slot name="ba
|
|
|
155
155
|
export const backdrop = () => {
|
|
156
156
|
const responsiveModalDialogConfig = { ...withModalDialogConfig() };
|
|
157
157
|
return html`
|
|
158
|
-
<demo-
|
|
158
|
+
<demo-el-using-overlaymixin .config=${responsiveModalDialogConfig}>
|
|
159
159
|
<demo-overlay-backdrop slot="backdrop"></demo-overlay-backdrop>
|
|
160
160
|
<button slot="invoker">Click me to open the overlay!</button>
|
|
161
161
|
<div slot="content" class="demo-overlay">
|
|
@@ -166,7 +166,7 @@ export const backdrop = () => {
|
|
|
166
166
|
⨯
|
|
167
167
|
</button>
|
|
168
168
|
</div>
|
|
169
|
-
</demo-
|
|
169
|
+
</demo-el-using-overlaymixin>
|
|
170
170
|
`;
|
|
171
171
|
};
|
|
172
172
|
```
|
|
@@ -179,7 +179,7 @@ export const backdropImperative = () => {
|
|
|
179
179
|
const backdropNode = document.createElement('demo-overlay-backdrop');
|
|
180
180
|
const responsiveModalDialogConfig = { ...withModalDialogConfig(), backdropNode };
|
|
181
181
|
return html`
|
|
182
|
-
<demo-
|
|
182
|
+
<demo-el-using-overlaymixin .config=${responsiveModalDialogConfig}>
|
|
183
183
|
<button slot="invoker">Click me to open the overlay!</button>
|
|
184
184
|
<div slot="content" class="demo-overlay">
|
|
185
185
|
Hello! You can close this notification here:
|
|
@@ -189,7 +189,7 @@ export const backdropImperative = () => {
|
|
|
189
189
|
⨯
|
|
190
190
|
</button>
|
|
191
191
|
</div>
|
|
192
|
-
</demo-
|
|
192
|
+
</demo-el-using-overlaymixin>
|
|
193
193
|
`;
|
|
194
194
|
};
|
|
195
195
|
```
|
|
@@ -197,7 +197,7 @@ export const backdropImperative = () => {
|
|
|
197
197
|
#### Backdrop animation
|
|
198
198
|
|
|
199
199
|
By default our overlay system comes with a backdrop animation.
|
|
200
|
-
This will add `
|
|
200
|
+
This will add `overlays__backdrop--animation-in` and `overlays__backdrop--animation-out` classes to your backdrop node.
|
|
201
201
|
If you have `placementMode: 'local'` it will replace those `global` strings in the CSS classes with `local`.
|
|
202
202
|
|
|
203
203
|
It expects from you that you act on these classes in your CSS with an animation. For example if you have your own backdrop webcomponent (to encapsulate styles):
|
|
@@ -234,7 +234,7 @@ Under the hood, the OverlayController listens to `animationend` event, only then
|
|
|
234
234
|
export const backdropAnimation = () => {
|
|
235
235
|
const responsiveModalDialogConfig = { ...withModalDialogConfig() };
|
|
236
236
|
return html`
|
|
237
|
-
<demo-
|
|
237
|
+
<demo-el-using-overlaymixin .config=${responsiveModalDialogConfig}>
|
|
238
238
|
<button slot="invoker">Click me to open the overlay!</button>
|
|
239
239
|
<demo-overlay-backdrop slot="backdrop"></demo-overlay-backdrop>
|
|
240
240
|
<div slot="content" class="demo-overlay">
|
|
@@ -245,7 +245,7 @@ export const backdropAnimation = () => {
|
|
|
245
245
|
⨯
|
|
246
246
|
</button>
|
|
247
247
|
</div>
|
|
248
|
-
</demo-
|
|
248
|
+
</demo-el-using-overlaymixin>
|
|
249
249
|
`;
|
|
250
250
|
};
|
|
251
251
|
```
|
|
@@ -264,7 +264,7 @@ Drag the viewport under 600px and open the overlay to see the `withBottomSheetCo
|
|
|
264
264
|
export const responsiveSwitching = () => {
|
|
265
265
|
const responsiveBottomSheetConfig = { ...withBottomSheetConfig() };
|
|
266
266
|
return html`
|
|
267
|
-
<demo-
|
|
267
|
+
<demo-el-using-overlaymixin
|
|
268
268
|
.config=${responsiveBottomSheetConfig}
|
|
269
269
|
@before-opened=${e => {
|
|
270
270
|
if (window.innerWidth >= 600) {
|
|
@@ -283,7 +283,7 @@ export const responsiveSwitching = () => {
|
|
|
283
283
|
⨯
|
|
284
284
|
</button>
|
|
285
285
|
</div>
|
|
286
|
-
</demo-
|
|
286
|
+
</demo-el-using-overlaymixin>
|
|
287
287
|
`;
|
|
288
288
|
};
|
|
289
289
|
```
|
|
@@ -329,52 +329,55 @@ _defineOverlay({ invokerNode, contentNode }) {
|
|
|
329
329
|
Below is another demo where you can toggle between configurations using buttons.
|
|
330
330
|
|
|
331
331
|
```js preview-story
|
|
332
|
-
export const responsiveSwitching2 = () =>
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
332
|
+
export const responsiveSwitching2 = () => {
|
|
333
|
+
const overlayRef = createRef();
|
|
334
|
+
const selectRef = createRef();
|
|
335
|
+
|
|
336
|
+
const getConfig = selectValue => {
|
|
337
|
+
switch (selectValue) {
|
|
338
|
+
case 'modaldialog':
|
|
339
|
+
return { ...withModalDialogConfig(), hasBackdrop: true };
|
|
340
|
+
case 'bottomsheet':
|
|
341
|
+
return { ...withBottomSheetConfig() };
|
|
342
|
+
case 'dropdown':
|
|
343
|
+
return { ...withDropdownConfig(), hasBackdrop: false, inheritsReferenceWidth: true };
|
|
344
|
+
default:
|
|
345
|
+
return { ...withModalDialogConfig(), hasBackdrop: true };
|
|
337
346
|
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
<button @click=${e => e.target.dispatchEvent(new Event('close-overlay', { bubbles: true }))}>
|
|
373
|
-
⨯
|
|
374
|
-
</button>
|
|
375
|
-
</div>
|
|
376
|
-
</demo-overlay-system>
|
|
377
|
-
`;
|
|
347
|
+
};
|
|
348
|
+
const onSelectChange = e => {
|
|
349
|
+
overlayRef.value.config = getConfig(e.target.value);
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
return html`
|
|
353
|
+
<style>
|
|
354
|
+
.demo-overlay {
|
|
355
|
+
background-color: white;
|
|
356
|
+
border: 1px solid black;
|
|
357
|
+
}
|
|
358
|
+
</style>
|
|
359
|
+
Change config to:
|
|
360
|
+
|
|
361
|
+
<select ${ref(selectRef)} @change="${onSelectChange}">
|
|
362
|
+
<option value="modaldialog">Modal Dialog</option>
|
|
363
|
+
<option value="bottomsheet">Bottom Sheet</option>
|
|
364
|
+
<option value="dropdown">Dropdown</option>
|
|
365
|
+
</select>
|
|
366
|
+
|
|
367
|
+
<br />
|
|
368
|
+
<demo-el-using-overlaymixin ${ref(overlayRef)} .config=${getConfig(selectRef.value?.value)}>
|
|
369
|
+
<button slot="invoker">Click me to open the overlay!</button>
|
|
370
|
+
<div slot="content" class="demo-overlay">
|
|
371
|
+
Hello! You can close this notification here:
|
|
372
|
+
<button
|
|
373
|
+
@click=${e => e.target.dispatchEvent(new Event('close-overlay', { bubbles: true }))}
|
|
374
|
+
>
|
|
375
|
+
⨯
|
|
376
|
+
</button>
|
|
377
|
+
</div>
|
|
378
|
+
</demo-el-using-overlaymixin>
|
|
379
|
+
`;
|
|
380
|
+
};
|
|
378
381
|
```
|
|
379
382
|
|
|
380
383
|
## Opened state
|
|
@@ -398,7 +401,7 @@ export const openedState = () => {
|
|
|
398
401
|
}
|
|
399
402
|
return html`
|
|
400
403
|
appState.opened: <span ${ref(myRefs.openedState)}>${appState.opened}</span>
|
|
401
|
-
<demo-
|
|
404
|
+
<demo-el-using-overlaymixin
|
|
402
405
|
${ref(myRefs.overlay)}
|
|
403
406
|
.opened="${appState.opened}"
|
|
404
407
|
@opened-changed=${onOpenClosed}
|
|
@@ -412,7 +415,7 @@ export const openedState = () => {
|
|
|
412
415
|
⨯
|
|
413
416
|
</button>
|
|
414
417
|
</div>
|
|
415
|
-
</demo-
|
|
418
|
+
</demo-el-using-overlaymixin>
|
|
416
419
|
`;
|
|
417
420
|
};
|
|
418
421
|
```
|
|
@@ -446,7 +449,7 @@ export const interceptingOpenClose = () => {
|
|
|
446
449
|
>
|
|
447
450
|
${blockOverlay}
|
|
448
451
|
</button>
|
|
449
|
-
<demo-
|
|
452
|
+
<demo-el-using-overlaymixin
|
|
450
453
|
${ref(myRefs.overlay)}
|
|
451
454
|
@before-closed=${intercept}
|
|
452
455
|
@before-opened=${intercept}
|
|
@@ -462,7 +465,7 @@ export const interceptingOpenClose = () => {
|
|
|
462
465
|
Hello! You can close this notification here:
|
|
463
466
|
<button @click=${() => (myRefs.overlay.value.opened = false)}>⨯</button>
|
|
464
467
|
</div>
|
|
465
|
-
</demo-
|
|
468
|
+
</demo-el-using-overlaymixin>
|
|
466
469
|
`;
|
|
467
470
|
};
|
|
468
471
|
```
|
|
@@ -538,7 +541,7 @@ Below an example is shown with the `isBlocking` option, which makes use of the O
|
|
|
538
541
|
export const overlayManager = () => {
|
|
539
542
|
const hasBackdropConfig = { hasBackdrop: true };
|
|
540
543
|
return html`
|
|
541
|
-
<demo-
|
|
544
|
+
<demo-el-using-overlaymixin .config=${hasBackdropConfig}>
|
|
542
545
|
<button slot="invoker">Click me to open the overlay!</button>
|
|
543
546
|
<div slot="content" class="demo-overlay">
|
|
544
547
|
Hello! You can close this notification here:
|
|
@@ -552,8 +555,11 @@ export const overlayManager = () => {
|
|
|
552
555
|
Click me to open another overlay which is blocking
|
|
553
556
|
</button>
|
|
554
557
|
</div>
|
|
555
|
-
</demo-
|
|
556
|
-
<demo-
|
|
558
|
+
</demo-el-using-overlaymixin>
|
|
559
|
+
<demo-el-using-overlaymixin
|
|
560
|
+
id="secondOverlay"
|
|
561
|
+
.config=${{ hasBackdrop: true, isBlocking: true }}
|
|
562
|
+
>
|
|
557
563
|
<div slot="content" class="demo-overlay demo-overlay--second">
|
|
558
564
|
Hello! You can close this notification here:
|
|
559
565
|
<button
|
|
@@ -562,7 +568,7 @@ export const overlayManager = () => {
|
|
|
562
568
|
⨯
|
|
563
569
|
</button>
|
|
564
570
|
</div>
|
|
565
|
-
</demo-
|
|
571
|
+
</demo-el-using-overlaymixin>
|
|
566
572
|
`;
|
|
567
573
|
};
|
|
568
574
|
```
|
|
@@ -577,7 +583,7 @@ Here is the example below
|
|
|
577
583
|
export const localBackdrop = () => {
|
|
578
584
|
const localBackdropConfig = { placementMode: 'local' };
|
|
579
585
|
return html`
|
|
580
|
-
<demo-
|
|
586
|
+
<demo-el-using-overlaymixin .config=${localBackdropConfig}>
|
|
581
587
|
<demo-overlay-backdrop slot="backdrop"></demo-overlay-backdrop>
|
|
582
588
|
<button slot="invoker">Click me to open the overlay!</button>
|
|
583
589
|
<div slot="content" class="demo-overlay">
|
|
@@ -588,7 +594,7 @@ export const localBackdrop = () => {
|
|
|
588
594
|
⨯
|
|
589
595
|
</button>
|
|
590
596
|
</div>
|
|
591
|
-
</demo-
|
|
597
|
+
</demo-el-using-overlaymixin>
|
|
592
598
|
`;
|
|
593
599
|
};
|
|
594
600
|
```
|
|
@@ -601,10 +607,10 @@ It's also possible to compose a nested construction by moving around dom nodes.
|
|
|
601
607
|
```js preview-story
|
|
602
608
|
export const nestedOverlays = () => {
|
|
603
609
|
return html`
|
|
604
|
-
<demo-
|
|
610
|
+
<demo-el-using-overlaymixin .config="${withModalDialogConfig()}">
|
|
605
611
|
<div slot="content" id="mainContent" class="demo-overlay">
|
|
606
612
|
open nested overlay:
|
|
607
|
-
<demo-
|
|
613
|
+
<demo-el-using-overlaymixin .config="${withModalDialogConfig()}">
|
|
608
614
|
<div slot="content" id="nestedContent" class="demo-overlay">
|
|
609
615
|
Nested content
|
|
610
616
|
<button
|
|
@@ -614,7 +620,7 @@ export const nestedOverlays = () => {
|
|
|
614
620
|
</button>
|
|
615
621
|
</div>
|
|
616
622
|
<button slot="invoker" id="nestedInvoker">nested invoker button</button>
|
|
617
|
-
</demo-
|
|
623
|
+
</demo-el-using-overlaymixin>
|
|
618
624
|
<button
|
|
619
625
|
@click=${e => e.target.dispatchEvent(new Event('close-overlay', { bubbles: true }))}
|
|
620
626
|
>
|
|
@@ -622,7 +628,7 @@ export const nestedOverlays = () => {
|
|
|
622
628
|
</button>
|
|
623
629
|
</div>
|
|
624
630
|
<button slot="invoker" id="mainInvoker">invoker button</button>
|
|
625
|
-
</demo-
|
|
631
|
+
</demo-el-using-overlaymixin>
|
|
626
632
|
`;
|
|
627
633
|
};
|
|
628
634
|
```
|
|
@@ -9,7 +9,7 @@ Therefore, they may not have the same quality standards as our other packages.
|
|
|
9
9
|
|
|
10
10
|
| Package | Description |
|
|
11
11
|
| -------------------------------------- | ----------------------- |
|
|
12
|
-
| [sb-action-logger](https://github.com/ing-bank/lion/blob/
|
|
12
|
+
| [sb-action-logger](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/fundamentals/tools/helpers/action-logger.md) | Storybook action logger |
|
|
13
13
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
@@ -9,7 +9,7 @@ Primarily useful if two major version of a package with a singleton is used.
|
|
|
9
9
|
npm i --save singleton-manager
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
⚠️ You need to make SURE that only ONE version of `singleton-manager` is installed. For how see [Non Goals](https://github.com/ing-bank/lion/blob/
|
|
12
|
+
⚠️ You need to make SURE that only ONE version of `singleton-manager` is installed. For how see [Non Goals](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/fundamentals/tools/singleton-manager/#non-goals).
|
|
13
13
|
|
|
14
14
|
### Example Singleton Users
|
|
15
15
|
|
|
@@ -159,7 +159,7 @@ Steps to reproduce:
|
|
|
159
159
|
1. Page A click on block
|
|
160
160
|
2. Page B => "Blocked: false" (even when hitting the refresh button)
|
|
161
161
|
|
|
162
|
-
➡️ See [it on the example page](https://github.com/ing-bank/lion/blob/
|
|
162
|
+
➡️ See [it on the example page](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/fundamentals/tools/singleton-manager/example-fail/index.md). <br>
|
|
163
163
|
➡️ See [the code](https://github.com/ing-bank/lion/tree/master/docs/fundamentals/tools/singleton-manager/example-fail/demo-app.js).
|
|
164
164
|
|
|
165
165
|
---
|
|
@@ -202,7 +202,7 @@ See it in action
|
|
|
202
202
|
npm run start:singleton
|
|
203
203
|
```
|
|
204
204
|
|
|
205
|
-
➡️ See [it on the example page](https://github.com/ing-bank/lion/blob/
|
|
205
|
+
➡️ See [it on the example page](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/fundamentals/tools/singleton-manager/example-success/index.md). <br>
|
|
206
206
|
➡️ See [the code](https://github.com/ing-bank/lion/tree/master/docs/fundamentals/tools/singleton-manager/example-success/demo-app.js).
|
|
207
207
|
|
|
208
208
|
---
|
|
@@ -243,7 +243,7 @@ See it in action
|
|
|
243
243
|
npm run start:singleton-complex
|
|
244
244
|
```
|
|
245
245
|
|
|
246
|
-
➡️ See [it on the example page](https://github.com/ing-bank/lion/blob/
|
|
246
|
+
➡️ See [it on the example page](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/fundamentals/tools/singleton-manager/example-complex/index.md). <br>
|
|
247
247
|
➡️ See [the code](https://github.com/ing-bank/lion/tree/master/docs/fundamentals/tools/singleton-manager/example-complex/demo-app.js).
|
|
248
248
|
|
|
249
249
|
---
|
|
@@ -41,7 +41,7 @@ class DummySlider extends LitElement {
|
|
|
41
41
|
height: 24px;
|
|
42
42
|
width: 24px;
|
|
43
43
|
top: 50%;
|
|
44
|
-
transform: translateY(-50%);
|
|
44
|
+
transform: translateY(-50%) translateX(-50%);
|
|
45
45
|
transition: left 0.5s ease 0s;
|
|
46
46
|
}
|
|
47
47
|
`,
|
|
@@ -75,9 +75,9 @@ if (!customElements.get('dummy-slider')) {
|
|
|
75
75
|
}
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
Custom Fields can be created in just a few steps. All you need is an interaction element (like for instance a slider, a listbox or a combobox) and connect it to the [LionField](https://github.com/ing-bank/lion/blob/
|
|
78
|
+
Custom Fields can be created in just a few steps. All you need is an interaction element (like for instance a slider, a listbox or a combobox) and connect it to the [LionField](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/components/input/overview.md).
|
|
79
79
|
|
|
80
|
-
> In case you want to extend a native element, follow [Extend a native Input](https://github.com/ing-bank/lion/blob/
|
|
80
|
+
> In case you want to extend a native element, follow [Extend a native Input](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/guides/how-to/extend-a-native-input.md).
|
|
81
81
|
|
|
82
82
|
## A) an interaction element
|
|
83
83
|
|
|
@@ -126,7 +126,7 @@ export const createAnInteractiveElement = () => {
|
|
|
126
126
|
## B) your LionField extension
|
|
127
127
|
|
|
128
128
|
Now we want to integrate the slider in our form system to enrich the user interface, get
|
|
129
|
-
validation support and all other [benefits of LionField](https://github.com/ing-bank/lion/blob/
|
|
129
|
+
validation support and all other [benefits of LionField](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/components/input/overview.md).
|
|
130
130
|
We start by creating a component `<slider-field>` that extends from `LionField`.
|
|
131
131
|
Then we follow the steps below:
|
|
132
132
|
|
|
@@ -139,7 +139,7 @@ Then we follow the steps below:
|
|
|
139
139
|
|
|
140
140
|
The `user-input-changed` event is listened to by the FormatMixin: it should be regarded as the
|
|
141
141
|
equivalent of the `input` event of the platform, but for custom built interaction elements.
|
|
142
|
-
You now synchronized [modelValue](https://github.com/ing-bank/lion/blob/
|
|
142
|
+
You now synchronized [modelValue](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/fundamentals/systems/form/model-value.md), which can be regarded as
|
|
143
143
|
the glue to integrate all other functionality like parsing/formatting/serializing, validating,
|
|
144
144
|
tracking interaction states etc.
|
|
145
145
|
|
|
@@ -147,7 +147,7 @@ Then we follow the steps below:
|
|
|
147
147
|
> because those properties will loose their reactivity (they won't be considered anymore in the
|
|
148
148
|
> update loop of LitElement).
|
|
149
149
|
> Whenever a .modelValue/.formattedValue/.serializedValue needs to be computed, use
|
|
150
|
-
> [parser/formatter/serializer](https://github.com/ing-bank/lion/blob/
|
|
150
|
+
> [parser/formatter/serializer](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/fundamentals/systems/form/formatting-and-parsing.md)
|
|
151
151
|
|
|
152
152
|
Implement with the following code:
|
|
153
153
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# How To >> Extend a native
|
|
1
|
+
# How To >> Extend a native input ||20
|
|
2
2
|
|
|
3
3
|
```js script
|
|
4
4
|
import { html } from '@mdjs/mdjs-preview';
|
|
@@ -11,9 +11,9 @@ import '../../fundamentals/systems/form/assets/h-output.js';
|
|
|
11
11
|
loadDefaultFeedbackMessages();
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
Input fields can be created by extending [LionInput](https://github.com/ing-bank/lion/blob/
|
|
14
|
+
Input fields can be created by extending [LionInput](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/components/input/overview.md).
|
|
15
15
|
|
|
16
|
-
> In case you want to wrap a custom form element, follow [Create a custom Field](https://github.com/ing-bank/lion/blob/
|
|
16
|
+
> In case you want to wrap a custom form element, follow [Create a custom Field](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/guides/how-to/create-a-custom-field.md).
|
|
17
17
|
|
|
18
18
|
For this tutorial, we create an input that wraps native `input[type=datetime-local]`.
|
|
19
19
|
This is as simple as adding a type:
|
package/docs/guides/index.md
CHANGED
|
@@ -12,9 +12,9 @@ Developers consuming our web components inside an application (not extending the
|
|
|
12
12
|
`Application Developers` are only allowed to interact with `public` properties and methods.
|
|
13
13
|
Can be abbreviated as `AD`. Sometimes also called `Consuming Developer`.
|
|
14
14
|
|
|
15
|
-
- [Definitions and Terms](https://github.com/ing-bank/lion/blob/
|
|
16
|
-
- [Styling](https://github.com/ing-bank/lion/blob/
|
|
17
|
-
- [Scoped Elements](https://github.com/ing-bank/lion/blob/
|
|
15
|
+
- [Definitions and Terms](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/guides/principles/definitions-and-terms.md)
|
|
16
|
+
- [Styling](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/guides/principles/styling.md)
|
|
17
|
+
- [Scoped Elements](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/guides/principles/scoped-elements.md)
|
|
18
18
|
|
|
19
19
|
## Extending Developer
|
|
20
20
|
|
|
@@ -22,13 +22,13 @@ Developers extending our web components, for instance: `class MaterialInput exte
|
|
|
22
22
|
|
|
23
23
|
Especially for subclassers we have some extra documentation:
|
|
24
24
|
|
|
25
|
-
- [Subclasser APIs](https://github.com/ing-bank/lion/blob/
|
|
26
|
-
- [Extend documentation](https://github.com/ing-bank/lion/blob/
|
|
25
|
+
- [Subclasser APIs](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/guides/principles/subclasser-apis.md)
|
|
26
|
+
- [Extend documentation](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/blog/extending-documentation.md)
|
|
27
27
|
|
|
28
28
|
## How To
|
|
29
29
|
|
|
30
30
|
Next to that we have some specific "How To" documentations.
|
|
31
31
|
|
|
32
|
-
- [Get started](https://github.com/ing-bank/lion/blob/
|
|
33
|
-
- [Create a custom field](https://github.com/ing-bank/lion/blob/
|
|
34
|
-
- [Extend a native input](https://github.com/ing-bank/lion/blob/
|
|
32
|
+
- [Get started](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/guides/how-to/get-started.md)
|
|
33
|
+
- [Create a custom field](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/guides/how-to/create-a-custom-field.md)
|
|
34
|
+
- [Extend a native input](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/guides/how-to/extend-a-native-input.md)
|
|
@@ -12,9 +12,9 @@ Developers consuming our web components inside an application (not extending the
|
|
|
12
12
|
`Application Developers` are only allowed to interact with `public` properties and methods.
|
|
13
13
|
Can be abbreviated as `AD`. Sometimes also called `Consuming Developer`.
|
|
14
14
|
|
|
15
|
-
- [Definitions and Terms](https://github.com/ing-bank/lion/blob/
|
|
16
|
-
- [Styling](https://github.com/ing-bank/lion/blob/
|
|
17
|
-
- [Scoped Elements](https://github.com/ing-bank/lion/blob/
|
|
15
|
+
- [Definitions and Terms](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/guides/principles/definitions-and-terms.md)
|
|
16
|
+
- [Styling](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/guides/principles/styling.md)
|
|
17
|
+
- [Scoped Elements](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/guides/principles/scoped-elements.md)
|
|
18
18
|
|
|
19
19
|
## Extending Developer
|
|
20
20
|
|
|
@@ -22,5 +22,5 @@ Developers extending our web components, for instance: `class MaterialInput exte
|
|
|
22
22
|
|
|
23
23
|
Especially for subclassers we have some extra documentation:
|
|
24
24
|
|
|
25
|
-
- [Subclasser APIs](https://github.com/ing-bank/lion/blob/
|
|
26
|
-
- [Extend documentation](https://github.com/ing-bank/lion/blob/
|
|
25
|
+
- [Subclasser APIs](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/guides/principles/subclasser-apis.md)
|
|
26
|
+
- [Extend documentation](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/blog/extending-documentation.md)
|
|
@@ -19,7 +19,7 @@ Examples for both categories can be found below:
|
|
|
19
19
|
- Accessibility examples:
|
|
20
20
|
- Content (for instance a caption in a table) can be `visually hidden`: it will be
|
|
21
21
|
readable by screen readers, but invisible for end users.
|
|
22
|
-
- When an html table is used, we allow [subclassers](https://github.com/ing-bank/lion/blob/
|
|
22
|
+
- When an html table is used, we allow [subclassers](https://github.com/ing-bank/lion/blob/9b61aac7a106832dd1596bf30ef4ff4dcbfc894f/docs/guides/principles/subclasser-apis.md) to override the display property (`table-cell`) to `flex`. By putting the proper accessible roles (`role="cell"`) in the markup, we guarantee our markup stays accessible.
|
|
23
23
|
|
|
24
24
|
Although Lion components try to stay as unbiased as possible with regard to styling, defaults will be needed. In these cases we try to follow the platform as much as possible. If the platform doesn't provide defaults, the largest common denominator across existing UI systems is taken as a lead.
|
|
25
25
|
|
package/exports/overlays.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { OverlaysManager } from '../components/overlays/src/OverlaysManager.js';
|
|
2
2
|
|
|
3
|
-
export { globalOverlaysStyle } from '../components/overlays/src/globalOverlaysStyle.js';
|
|
4
3
|
export { OverlayController } from '../components/overlays/src/OverlayController.js';
|
|
5
4
|
export { OverlayMixin } from '../components/overlays/src/OverlayMixin.js';
|
|
6
5
|
export { ArrowMixin } from '../components/overlays/src/ArrowMixin.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { OverlayConfig } from '../../components/overlays/types/OverlayConfig.js';
|
|
2
|
+
export { ViewportConfig } from '../../components/overlays/types/OverlayConfig.js';
|
|
2
3
|
export { DefineOverlayConfig } from '../../components/overlays/types/OverlayMixinTypes.js';
|
|
3
4
|
export { OverlayHost } from '../../components/overlays/types/OverlayMixinTypes.js';
|
|
4
5
|
export { ArrowHost } from '../../components/overlays/types/ArrowMixinTypes.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { loadDefaultFeedbackMessagesNoSideEffects } from '../components/validate-messages/src/loadDefaultFeedbackMessagesNoSideEffects.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lion/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "A package of extendable web components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ing-bank",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"@bundled-es-modules/message-format": "^6.0.4",
|
|
50
50
|
"@open-wc/dedupe-mixin": "^1.3.1",
|
|
51
51
|
"@open-wc/scoped-elements": "^2.1.4",
|
|
52
|
+
"@popperjs/core": "^2.11.6",
|
|
52
53
|
"autosize": "4.0.2",
|
|
53
54
|
"awesome-phonenumber": "^4.0.0",
|
|
54
55
|
"ibantools": "^2.2.0",
|