@lion/ui 0.18.0-menu-system.1 → 0.18.0-menu-system.2
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/menu/src/MoreButtonMenuMixin.js +3 -0
- package/components/overlays/src/OverlayController.js +49 -14
- package/components/overlays/test/OverlayController.test.js +122 -11
- package/components/overlays/types/ArrowMixinTypes.ts +3 -1
- package/components/overlays/types/OverlayConfig.ts +5 -1
- package/custom-elements.json +82 -40
- package/dist-types/components/dialog/src/LionDialog.d.ts +3 -1
- package/dist-types/components/dialog/src/LionDialog.d.ts.map +1 -1
- package/dist-types/components/menu/src/LionMenuOverlay.d.ts +3 -1
- package/dist-types/components/menu/src/LionMenuOverlay.d.ts.map +1 -1
- package/dist-types/components/menu/src/MoreButtonMenuMixin.d.ts.map +1 -1
- package/dist-types/components/overlays/src/OverlayController.d.ts +16 -0
- package/dist-types/components/overlays/src/OverlayController.d.ts.map +1 -1
- package/dist-types/components/overlays/types/ArrowMixinTypes.d.ts.map +1 -1
- package/dist-types/components/overlays/types/OverlayConfig.d.ts +3 -1
- package/dist-types/components/overlays/types/OverlayConfig.d.ts.map +1 -1
- package/dist-types/components/select-rich/src/LionSelectRich.d.ts +3 -1
- package/dist-types/components/select-rich/src/LionSelectRich.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 +1 -1
- package/docs/components/fieldset/overview.md +5 -5
- package/docs/components/form/overview.md +3 -3
- package/docs/components/form/use-cases.md +2 -2
- 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-file/overview.md +1 -1
- 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/listbox/use-cases.md +1 -1
- package/docs/components/radio-group/overview.md +3 -3
- package/docs/components/select/use-cases.md +1 -1
- package/docs/components/select-rich/use-cases.md +2 -2
- package/docs/components/tabs/examples.md +1 -1
- package/docs/fundamentals/index.md +4 -4
- 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 +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/validate.md +2 -2
- package/docs/fundamentals/systems/localize/overview.md +4 -4
- package/docs/fundamentals/systems/overlays/api-table.md +36 -34
- package/docs/fundamentals/systems/overlays/configuration.md +2 -2
- package/docs/fundamentals/systems/overlays/overview.md +5 -5
- package/docs/fundamentals/systems/overlays/use-cases.md +2 -2
- 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 +5 -5
- 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/how-to/index.md +1 -1
- package/docs/guides/index.md +8 -8
- package/docs/guides/principles/index.md +5 -5
- package/docs/guides/principles/styling.md +1 -1
- package/package.json +1 -1
|
@@ -33,9 +33,9 @@ Fields (think of an input, textarea, select) are the actual form controls the en
|
|
|
33
33
|
|
|
34
34
|
On top of this, they feature:
|
|
35
35
|
|
|
36
|
-
- [formatting/parsing/serializing](https://github.com/ing-bank/lion/blob/
|
|
37
|
-
- Advanced [validation](https://github.com/ing-bank/lion/blob/
|
|
38
|
-
- Creation of advanced user interaction scenarios via [interaction states](https://github.com/ing-bank/lion/blob/
|
|
36
|
+
- [formatting/parsing/serializing](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/fundamentals/systems/form/formatting-and-parsing.md) of view values.
|
|
37
|
+
- Advanced [validation](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/fundamentals/systems/form/validate.md) possibilities.
|
|
38
|
+
- Creation of advanced user interaction scenarios via [interaction states](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/fundamentals/systems/form/interaction-states.md).
|
|
39
39
|
- Provision of labels and help texts in an easy, declarative manner.
|
|
40
40
|
- Accessibility out of the box.
|
|
41
41
|
- Advanced styling possibilities: map your own Design System to the internal HTML structure.
|
|
@@ -44,33 +44,33 @@ On top of this, they feature:
|
|
|
44
44
|
|
|
45
45
|
### Platform fields (wrappers)
|
|
46
46
|
|
|
47
|
-
- [LionInput](https://github.com/ing-bank/lion/blob/
|
|
48
|
-
- [LionTextarea](https://github.com/ing-bank/lion/blob/
|
|
49
|
-
- [LionSelect](https://github.com/ing-bank/lion/blob/
|
|
47
|
+
- [LionInput](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/components/input/overview.md), a wrapper for `<input>`.
|
|
48
|
+
- [LionTextarea](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/components/textarea/overview.md), a wrapper for `<textarea>`.
|
|
49
|
+
- [LionSelect](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/components/select/overview.md), a wrapper for `<select>`.
|
|
50
50
|
|
|
51
51
|
### Custom fields (wrappers)
|
|
52
52
|
|
|
53
|
-
Whenever a native form control doesn't exist or is not sufficient, a [custom form field](https://github.com/ing-bank/lion/blob/
|
|
53
|
+
Whenever a native form control doesn't exist or is not sufficient, a [custom form field](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/guides/how-to/create-a-custom-field.md) should be created. One could think of components like:
|
|
54
54
|
|
|
55
|
-
- [LionCombobox](https://github.com/ing-bank/lion/blob/
|
|
56
|
-
- [LionDate](https://github.com/ing-bank/lion/blob/
|
|
57
|
-
- [LionDatepicker](https://github.com/ing-bank/lion/blob/
|
|
58
|
-
- [LionListbox](https://github.com/ing-bank/lion/blob/
|
|
59
|
-
- [LionInputAmount](https://github.com/ing-bank/lion/blob/
|
|
60
|
-
- [LionInputEmail](https://github.com/ing-bank/lion/blob/
|
|
61
|
-
- [LionInputIban](https://github.com/ing-bank/lion/blob/
|
|
62
|
-
- [LionInputRange](https://github.com/ing-bank/lion/blob/
|
|
63
|
-
- [LionInputStepper](https://github.com/ing-bank/lion/blob/
|
|
64
|
-
- [LionSelectRich](https://github.com/ing-bank/lion/blob/
|
|
55
|
+
- [LionCombobox](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/components/combobox/overview.md), a custom implementation of a combobox.
|
|
56
|
+
- [LionDate](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/components/input-date/overview.md), an alternative for `<input type="date">`.
|
|
57
|
+
- [LionDatepicker](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/components/input-datepicker/overview.md), an alternative for `<input type="date">` including a calendar dropdown.
|
|
58
|
+
- [LionListbox](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/components/listbox/overview.md), a custom implementation of a listbox.
|
|
59
|
+
- [LionInputAmount](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/components/input-amount/overview.md), an alternative for `<input type="number">` special for amounts.
|
|
60
|
+
- [LionInputEmail](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/components/input-email/overview.md), an alternative for `<input type="email">`.
|
|
61
|
+
- [LionInputIban](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/components/input-iban/overview.md), an ING specific for an input with IBAN numbers.
|
|
62
|
+
- [LionInputRange](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/components/input-range/overview.md), an alternative for `<input type="range">`.
|
|
63
|
+
- [LionInputStepper](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/components/input-stepper/overview.md), an alternative for `<input type="number">`.
|
|
64
|
+
- [LionSelectRich](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/components/select-rich/overview.md), an alternative for `<select>` with multiline options.
|
|
65
65
|
|
|
66
66
|
### Choice Input Fields
|
|
67
67
|
|
|
68
68
|
For form controls which return a `checked-state` you can use the `lion-choice-input` mixin. It is used in:
|
|
69
69
|
|
|
70
|
-
- [LionCheckbox](https://github.com/ing-bank/lion/blob/
|
|
70
|
+
- [LionCheckbox](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/components/checkbox-group/overview.md), a wrapper for `<input type="checkbox">`.
|
|
71
71
|
- LionOption, an alternative for `<option>`.
|
|
72
|
-
- [LionRadio](https://github.com/ing-bank/lion/blob/
|
|
73
|
-
- [LionSwitch](https://github.com/ing-bank/lion/blob/
|
|
72
|
+
- [LionRadio](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/components/radio-group/overview.md), a wrapper for `<input type="radio">`.
|
|
73
|
+
- [LionSwitch](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/components/switch/overview.md), a custom implementation of a switch.
|
|
74
74
|
|
|
75
75
|
Which contains the following features:
|
|
76
76
|
|
|
@@ -82,14 +82,14 @@ Which contains the following features:
|
|
|
82
82
|
|
|
83
83
|
Fieldsets are groups of fields. They can be considered fields on their own as well, since they partly share the normalized API via `FormControlMixin`. Fieldsets are the basis for:
|
|
84
84
|
|
|
85
|
-
- [LionFieldset](https://github.com/ing-bank/lion/blob/
|
|
86
|
-
- [LionForm](https://github.com/ing-bank/lion/blob/
|
|
87
|
-
- [LionCheckboxGroup](https://github.com/ing-bank/lion/blob/
|
|
88
|
-
- [LionRadioGroup](https://github.com/ing-bank/lion/blob/
|
|
85
|
+
- [LionFieldset](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/components/fieldset/overview.md), a wrapper around multiple input fields or other fieldsets.
|
|
86
|
+
- [LionForm](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/components/form/overview.md), enhances the functionality of the native `<form>` component.
|
|
87
|
+
- [LionCheckboxGroup](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/components/checkbox-group/overview.md), a wrapper component for multiple checkboxes.
|
|
88
|
+
- [LionRadioGroup](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/components/radio-group/overview.md), a wrapper component for multiple radio inputs.
|
|
89
89
|
|
|
90
90
|
## Other Resources
|
|
91
91
|
|
|
92
|
-
- [Model Value](https://github.com/ing-bank/lion/blob/
|
|
93
|
-
- [Formatting and parsing](https://github.com/ing-bank/lion/blob/
|
|
94
|
-
- [Interaction states](https://github.com/ing-bank/lion/blob/
|
|
95
|
-
- [Validation System](https://github.com/ing-bank/lion/blob/
|
|
92
|
+
- [Model Value](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/fundamentals/systems/form/model-value.md)
|
|
93
|
+
- [Formatting and parsing](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/fundamentals/systems/form/formatting-and-parsing.md)
|
|
94
|
+
- [Interaction states](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/fundamentals/systems/form/interaction-states.md)
|
|
95
|
+
- [Validation System](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/fundamentals/systems/form/validate.md)
|
|
@@ -70,7 +70,7 @@ Validation happens on every change of `modelValue`. A change in modelValue can b
|
|
|
70
70
|
|
|
71
71
|
## When validation feedback will be shown
|
|
72
72
|
|
|
73
|
-
Although validation happens realtime under the hood, displaying validity feedback in realtime may not always lead to the desired User Experience. Together with [interaction states](https://github.com/ing-bank/lion/blob/
|
|
73
|
+
Although validation happens realtime under the hood, displaying validity feedback in realtime may not always lead to the desired User Experience. Together with [interaction states](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/fundamentals/systems/form/interaction-states.md),
|
|
74
74
|
validity states can determine whether a validation message should be shown along the input field.
|
|
75
75
|
|
|
76
76
|
## Assessing field validation state programmatically
|
|
@@ -245,7 +245,7 @@ export const requiredValidator = () => html`
|
|
|
245
245
|
`;
|
|
246
246
|
```
|
|
247
247
|
|
|
248
|
-
The default `Required` validation message is "Please, enter a(n) {fieldName}". In which the "fieldName" can be provided separately via the `fieldName` attribute, with a fallback to the label. See [override fieldname](https://github.com/ing-bank/lion/blob/
|
|
248
|
+
The default `Required` validation message is "Please, enter a(n) {fieldName}". In which the "fieldName" can be provided separately via the `fieldName` attribute, with a fallback to the label. See [override fieldname](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/fundamentals/systems/form/#override-fieldname) for more information.
|
|
249
249
|
|
|
250
250
|
Specific required messages for a select and file-upload are created.
|
|
251
251
|
|
|
@@ -22,15 +22,15 @@ In it's simplest form it is a function that returns the translated text for a na
|
|
|
22
22
|
- Formatting of numbers, amounts
|
|
23
23
|
- Formatting of dates
|
|
24
24
|
|
|
25
|
-
Further examples and a more in depth description can be found at the [Use Cases Page](https://github.com/ing-bank/lion/blob/
|
|
25
|
+
Further examples and a more in depth description can be found at the [Use Cases Page](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/fundamentals/systems/localize/use-cases.md).
|
|
26
26
|
|
|
27
27
|
## Content
|
|
28
28
|
|
|
29
29
|
| Feature | Description |
|
|
30
30
|
| ---------------------------------------- | --------------------------------------------- |
|
|
31
|
-
| [Translate Text](https://github.com/ing-bank/lion/blob/
|
|
32
|
-
| [Format Numbers](https://github.com/ing-bank/lion/blob/
|
|
33
|
-
| [Format Dates](https://github.com/ing-bank/lion/blob/
|
|
31
|
+
| [Translate Text](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/fundamentals/systems/localize/text.md) | Load and translate text in multiple languages |
|
|
32
|
+
| [Format Numbers](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/fundamentals/systems/localize/numbers.md) | Format numbers in multiple languages |
|
|
33
|
+
| [Format Dates](https://github.com/ing-bank/lion/blob/10b57c0ba1cc3d484d549af9d4966d0bbd02f7d3/docs/fundamentals/systems/localize/dates.md) | Format dates in multiple languages |
|
|
34
34
|
|
|
35
35
|
## Installation
|
|
36
36
|
|
|
@@ -17,40 +17,40 @@ eleventyNavigation:
|
|
|
17
17
|
|
|
18
18
|
### Fields
|
|
19
19
|
|
|
20
|
-
| Name | Privacy | Type | Default
|
|
21
|
-
| --------------------------- | --------- | ------------------------------------------------- |
|
|
22
|
-
| `backdropNode` | public | `HTMLElement` |
|
|
23
|
-
| `config` | public | `OverlayConfig` | `{}`
|
|
24
|
-
| `content` | public | `HTMLDialogElement \| HTMLDivElement` |
|
|
25
|
-
| `contentNode` | public | `HTMLElement` |
|
|
26
|
-
| `contentWrapperNode` | public | `HTMLElement` |
|
|
27
|
-
| `elementToFocusAfterHide` | public | `HTMLElement` |
|
|
28
|
-
| `elevation` | public | `number` |
|
|
29
|
-
| `handlesAccessibility` | public | `boolean` |
|
|
30
|
-
| `hasActiveBackdrop` | public | |
|
|
31
|
-
| `hasBackdrop` | public | `boolean` |
|
|
32
|
-
| `hidesOnEsc` | public | `boolean` |
|
|
33
|
-
| `hidesOnOutsideClick` | public | `boolean` |
|
|
34
|
-
| `hidesOnOutsideEsc` | public | `boolean` |
|
|
35
|
-
| `inheritsReferenceWidth` | public | `'max' \| 'full' \| 'min' \| 'none' \| undefined` |
|
|
36
|
-
| `invoker` | public | `HTMLElement \| undefined` |
|
|
37
|
-
| `invokerNode` | public | `HTMLElement \| undefined` |
|
|
38
|
-
| `invokerRelation` | public | `'label' \| 'description'\| undefined` |
|
|
39
|
-
| `isAlertDialog` | public | |
|
|
40
|
-
| `isBlocking` | public | `boolean` |
|
|
41
|
-
| `isShown` | public | |
|
|
42
|
-
| `isTooltip` | public | `boolean` |
|
|
43
|
-
| `manager` | public | | `manager`
|
|
44
|
-
| `placementMode` | public | `'global' \| 'local' \| 'custom' \| undefined` |
|
|
45
|
-
| `popperConfig` | public | `PopperOptions` |
|
|
46
|
-
| `preventsScroll` | public | `boolean` |
|
|
47
|
-
| `referenceNode` | public | `HTMLElement` |
|
|
48
|
-
| `trapsKeyboardFocus` | public | `boolean` |
|
|
49
|
-
| `viewportConfig` | public | `ViewportConfig` |
|
|
50
|
-
| `visibilityTriggerFunction` | public | |
|
|
51
|
-
| `_contentId` | protected | | `` `overlay-content--${Math.random().toString(36).slice(2, 10)}` ``
|
|
52
|
-
| `_defaultConfig` | protected | `OverlayConfig` | `{ placementMode: undefined, contentNode: config.contentNode, contentWrapperNode: config.contentWrapperNode, invokerNode: config.invokerNode, backdropNode: config.backdropNode, referenceNode: undefined, elementToFocusAfterHide: config.invokerNode, inheritsReferenceWidth: 'none', hasBackdrop: false, isBlocking: false, preventsScroll: false, trapsKeyboardFocus: false, hidesOnEsc: false, hidesOnOutsideEsc: false, hidesOnOutsideClick: false, isTooltip: false, isAlertDialog: false, invokerRelation: 'description', visibilityTriggerFunction: undefined, handlesAccessibility: false, popperConfig: { placement: 'top', strategy: 'fixed', modifiers: [ { name: 'preventOverflow', enabled: true, options: { boundariesElement: 'viewport', padding: 8, // viewport-margin for shifting/sliding }, }, { name: 'flip', options: { boundariesElement: 'viewport', padding: 16, // viewport-margin for flipping }, }, { name: 'offset', enabled: true, options: { offset: [0, 8], // horizontal and vertical margin (distance between popper and referenceElement) }, }, { name: 'arrow', enabled: false, }, ], }, viewportConfig: { placement: 'center', }, zIndex: 9999,
|
|
53
|
-
| `_referenceNode` | protected | `HTMLElement \| undefined` |
|
|
20
|
+
| Name | Privacy | Type | Default | Description | Inherited From |
|
|
21
|
+
| --------------------------- | --------- | ------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
|
|
22
|
+
| `backdropNode` | public | `HTMLElement` | | The element that is placed behind the contentNode. When not provided and \`hasBackdrop\` is true,
a backdropNode will be automatically created | |
|
|
23
|
+
| `config` | public | `OverlayConfig` | `{}` | | |
|
|
24
|
+
| `content` | public | `HTMLDialogElement \| HTMLDivElement` | | The contentWrapperNode | |
|
|
25
|
+
| `contentNode` | public | `HTMLElement` | | The most important element: the overlay itself | |
|
|
26
|
+
| `contentWrapperNode` | public | `HTMLElement` | | The wrapper element of contentNode, used to supply inline positioning styles. When a Popper
arrow is needed, it acts as parent of the arrow node. Will be automatically created for global
and non projected contentNodes. Required when used in shadow dom mode or when Popper arrow is
supplied. Essential for allowing webcomponents to style their projected contentNodes | |
|
|
27
|
+
| `elementToFocusAfterHide` | public | `HTMLElement` | | The element that should be called \`.focus()\` on after dialog closes | |
|
|
28
|
+
| `elevation` | public | `number` | | | |
|
|
29
|
+
| `handlesAccessibility` | public | `boolean` | | For non \`isTooltip\`:
 \- sets aria-expanded="true/false" and aria-haspopup="true" on invokerNode
 \- sets aria-controls on invokerNode
 \- returns focus to invokerNode on hide
 \- sets focus to overlay content(?)

For \`isTooltip\`:
 \- sets role="tooltip" and aria-labelledby/aria-describedby on the content | |
|
|
30
|
+
| `hasActiveBackdrop` | public | | | | |
|
|
31
|
+
| `hasBackdrop` | public | `boolean` | | Whether it should have a backdrop (currently exclusive to globalOverlayController) | |
|
|
32
|
+
| `hidesOnEsc` | public | `boolean` | | Hides the overlay when pressing \[ esc ] | |
|
|
33
|
+
| `hidesOnOutsideClick` | public | `boolean` | | Hides the overlay when clicking next to it, exluding invoker | |
|
|
34
|
+
| `hidesOnOutsideEsc` | public | `boolean` | | Hides the overlay when pressing esc, even when contentNode has no focus | |
|
|
35
|
+
| `inheritsReferenceWidth` | public | `'max' \| 'full' \| 'min' \| 'none' \| undefined` | | Will align contentNode with referenceNode (invokerNode by default) for local overlays.
Usually needed for dropdowns. 'max' will prevent contentNode from exceeding width of
referenceNode, 'min' guarantees that contentNode will be at least as wide as referenceNode.
'full' will make sure that the invoker width always is the same. | |
|
|
36
|
+
| `invoker` | public | `HTMLElement \| undefined` | | The invokerNode | |
|
|
37
|
+
| `invokerNode` | public | `HTMLElement \| undefined` | | The interactive element (usually a button) invoking the dialog or tooltip | |
|
|
38
|
+
| `invokerRelation` | public | `'label' \| 'description'\| undefined` | | By default, the tooltip content is a 'description' for the invoker (uses aria-describedby).
Setting this property to 'label' makes the content function as a label (via aria-labelledby) | |
|
|
39
|
+
| `isAlertDialog` | public | | | The alertdialog role is to be used on modal alert dialogs that interrupt a user's workflow
to communicate an important message and require a response. | |
|
|
40
|
+
| `isBlocking` | public | `boolean` | | Hides other overlays when mutiple are opened (currently exclusive to globalOverlayController) | |
|
|
41
|
+
| `isShown` | public | | | | |
|
|
42
|
+
| `isTooltip` | public | `boolean` | | Has a totally different interaction- and accessibility pattern from all other overlays.
Will behave as role="tooltip" element instead of a role="dialog" element | |
|
|
43
|
+
| `manager` | public | | `manager` | | |
|
|
44
|
+
| `placementMode` | public | `'global' \| 'local' \| 'custom' \| undefined` | | Determines the connection point in DOM (body vs next to invoker). | |
|
|
45
|
+
| `popperConfig` | public | `PopperOptions` | | Popper configuration. Will be used when placementMode is 'local' | |
|
|
46
|
+
| `preventsScroll` | public | `boolean` | | Hides other overlays when mutiple are opened (currently exclusive to globalOverlayController) | |
|
|
47
|
+
| `referenceNode` | public | `HTMLElement` | | The element that is used to position the overlay content relative to. Usually,
this is the same element as invokerNode. Should only be provided when invokerNode should not
be positioned against. | |
|
|
48
|
+
| `trapsKeyboardFocus` | public | `boolean` | | Rotates tab, implicitly set when 'isModal' | |
|
|
49
|
+
| `viewportConfig` | public | `ViewportConfig` | | Viewport configuration. Will be used when placementMode is 'global' | |
|
|
50
|
+
| `visibilityTriggerFunction` | public | | | | |
|
|
51
|
+
| `_contentId` | protected | | `` `overlay-content--${Math.random().toString(36).slice(2, 10)}` `` | | |
|
|
52
|
+
| `_defaultConfig` | protected | `OverlayConfig` | `{ placementMode: undefined, contentNode: config.contentNode, contentWrapperNode: config.contentWrapperNode, invokerNode: config.invokerNode, backdropNode: config.backdropNode, referenceNode: undefined, elementToFocusAfterHide: config.invokerNode, inheritsReferenceWidth: 'none', hasBackdrop: false, isBlocking: false, preventsScroll: false, trapsKeyboardFocus: false, hidesOnEsc: false, hidesOnOutsideEsc: false, hidesOnOutsideClick: false, isTooltip: false, isAlertDialog: false, invokerRelation: 'description', visibilityTriggerFunction: undefined, handlesAccessibility: false, popperConfig: { placement: 'top', strategy: 'fixed', modifiers: [ { name: 'preventOverflow', enabled: true, options: { boundariesElement: 'viewport', padding: 8, // viewport-margin for shifting/sliding }, }, { name: 'flip', options: { boundariesElement: 'viewport', padding: 16, // viewport-margin for flipping }, }, { name: 'offset', enabled: true, options: { offset: [0, 8], // horizontal and vertical margin (distance between popper and referenceElement) }, }, { name: 'arrow', enabled: false, }, ], }, viewportConfig: { placement: 'center', }, zIndex: 9999, isActivated: true, focusContentOnOpen: false, // This means that content will have visually-hidden / sr-only styles. This is handy for: // - hidden menus that should be "indexable" by screen readers (like the Links list in VO: https://support.apple.com/en-gb/guide/voiceover/mchlp2719/mac) // - "more" menus that put content in a dropdown that do not fit in the current row // - menus that should generally open on tab. // @ts-ignore - hideVisually is an extension property hideVisually: false, requireConnectedNodes: true, // hides children overlays when parent is closed... syncChildrenCloseState: false, // // In next major, we remove this prop. Now we disable it for backwards compatibility and enable it in the places we need it internally // _shouldTeardownDomStructure: false, }` | | |
|
|
53
|
+
| `_referenceNode` | protected | `HTMLElement \| undefined` | | | |
|
|
54
54
|
|
|
55
55
|
### Methods
|
|
56
56
|
|
|
@@ -70,12 +70,14 @@ eleventyNavigation:
|
|
|
70
70
|
| `_handleBackdrop` | protected | Sets up backdrop on the given overlay. If there was a backdrop on another element
it is removed. Otherwise this is the first time displaying a backdrop, so a animation-in
animation is played. | `{ phase }, config: { animation?: boolean, phase: OverlayPhase }` | | |
|
|
71
71
|
| `_handleBlocking` | protected | | `{ phase }, config: { phase: OverlayPhase }` | | |
|
|
72
72
|
| `_handleFeatures` | protected | All features are handled here. | `{ phase }, config: { phase: OverlayPhase }` | | |
|
|
73
|
+
| `_handleFocusContentOnOpen` | protected | | `{ phase }, opts: {phase: OverlayPhase}` | `void` | |
|
|
73
74
|
| `_handleHidesOnEsc` | protected | | `{ phase }, config: { phase: OverlayPhase }` | | |
|
|
74
75
|
| `_handleHidesOnOutsideClick` | protected | | `{ phase }, config: { phase: OverlayPhase }` | | |
|
|
75
76
|
| `_handleHidesOnOutsideEsc` | protected | | `{ phase }, config: { phase: OverlayPhase }` | | |
|
|
76
77
|
| `_handleInheritsReferenceWidth` | protected | | | | |
|
|
77
78
|
| `_handlePosition` | protected | | `{ phase }, config: { phase: OverlayPhase }` | | |
|
|
78
79
|
| `_handlePreventsScroll` | protected | | `{ phase }, config: { phase: OverlayPhase }` | | |
|
|
80
|
+
| `_handleSyncChildrenCloseState` | protected | | `{ phase }, opts: {phase: OverlayPhase}` | `void` | |
|
|
79
81
|
| `_handleTrapsKeyboardFocus` | protected | | `{ phase }, config: { phase: OverlayPhase }` | | |
|
|
80
82
|
| `_handleVisibilityTriggers` | protected | | `{ phase }, config: { phase: OverlayPhase }` | | |
|
|
81
83
|
| `_handleZIndex` | protected | Display local overlays on top of elements with no z-index that appear later in the DOM | `{ phase }, config: { phase: OverlayPhase }` | | |
|