@lion/ui 0.7.2 → 0.7.3
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/button/test-suites/LionButtonReset.suite.js +7 -9
- package/components/calendar/test/lion-calendar.test.js +26 -30
- package/components/checkbox-group/test-suites/CheckboxIndeterminate.suite.js +3 -0
- package/components/combobox/test/lion-combobox.test.js +32 -32
- package/components/core/src/SlotMixin.js +7 -1
- package/components/form/test/lion-form.test.js +4 -4
- package/components/form-core/test-suites/ValidateMixin.suite.js +1 -0
- package/components/form-core/test-suites/form-group/FormGroupMixin.suite.js +18 -18
- package/components/form-integrations/test/dialog-integrations.test.js +6 -4
- package/components/helpers/src/SbActionLogger.js +11 -2
- package/components/icon/test/lion-icon.test.js +12 -14
- package/components/input-amount/test/lion-input-amount.test.js +10 -14
- package/components/input-datepicker/test/lion-input-datepicker.test.js +4 -4
- package/components/input-file/test/lion-input-file.test.js +3 -3
- package/components/input-tel-dropdown/test/LionInputTelDropdown.test.js +23 -23
- package/components/listbox/test-suites/ListboxMixin.suite.js +10 -3
- package/components/localize/src/date/utils/normalizeIntlDate.js +13 -2
- package/components/progress-indicator/test/lion-progress-indicator.test.js +42 -46
- package/components/select-rich/test/lion-select-rich.test.js +6 -8
- package/components/steps/test/lion-step.test.js +5 -7
- package/components/switch/test/lion-switch.test.js +5 -7
- package/custom-elements.json +517 -5134
- package/dist-types/components/button/test-suites/LionButtonReset.suite.d.ts.map +1 -1
- package/dist-types/components/checkbox-group/test-suites/CheckboxIndeterminate.suite.d.ts.map +1 -1
- package/dist-types/components/core/src/SlotMixin.d.ts.map +1 -1
- package/dist-types/components/form-core/test-suites/ValidateMixin.suite.d.ts.map +1 -1
- package/dist-types/components/helpers/src/SbActionLogger.d.ts.map +1 -1
- package/dist-types/components/input-tel-dropdown/test/LionInputTelDropdown.test.d.ts.map +1 -1
- package/dist-types/components/listbox/test-suites/ListboxMixin.suite.d.ts.map +1 -1
- package/dist-types/components/localize/src/date/utils/normalizeIntlDate.d.ts.map +1 -1
- package/dist-types/tsconfig.tsbuildinfo +1 -1
- package/docs/components/button/use-cases.md +11 -10
- package/docs/components/checkbox-group/overview.md +2 -2
- package/docs/components/collapsible/assets/applyDemoCollapsibleStyles.js +6 -2
- package/docs/components/collapsible/overview.md +1 -1
- package/docs/components/combobox/overview.md +4 -3
- package/docs/components/combobox/src/gh-combobox/gh-button.js +3 -1
- package/docs/components/combobox/src/gh-combobox/gh-combobox.js +9 -2
- package/docs/components/combobox/src/google-combobox/google-combobox.js +6 -8
- package/docs/components/combobox/src/md-combobox/MdFieldMixin.js +7 -3
- package/docs/components/combobox/src/md-combobox/style/md-ripple.js +1 -0
- package/docs/components/combobox/src/wa-combobox/wa-combobox.js +15 -3
- package/docs/components/combobox/use-cases.md +19 -17
- 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/icon/use-cases.md +1 -1
- package/docs/components/input/overview.md +1 -1
- package/docs/components/input/use-cases.md +3 -2
- 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/input-tel-dropdown/src/intl-input-tel-dropdown.js +15 -5
- package/docs/components/listbox/use-cases.md +1 -1
- package/docs/components/progress-indicator/examples.md +11 -11
- 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 +1 -1
- package/docs/components/tabs/examples.md +1 -1
- package/docs/components/tabs/src/lea-tab-panel.js +3 -1
- package/docs/components/tabs/src/lea-tab.js +7 -2
- 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/assets/_mermaid.svg.js +32 -8
- package/docs/fundamentals/node-tools/providence-analytics/dashboard.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/overview.md +3 -3
- package/docs/fundamentals/node-tools/publish-docs/overview.md +3 -3
- package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +2 -2
- package/docs/fundamentals/rationales/accessibility.md +1 -1
- package/docs/fundamentals/systems/core/SlotMixin.md +1 -1
- package/docs/fundamentals/systems/core/overview.md +1 -1
- package/docs/fundamentals/systems/form/formatting-and-parsing.md +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 +3 -3
- package/docs/fundamentals/systems/localize/overview.md +4 -4
- package/docs/fundamentals/systems/overlays/_configuration-positioning.md +0 -9
- package/docs/fundamentals/systems/overlays/_edge-cases.md +74 -80
- 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 +5 -8
- package/docs/fundamentals/tools/helpers/action-logger.md +3 -6
- package/docs/fundamentals/tools/helpers/overview.md +1 -1
- package/docs/fundamentals/tools/singleton-manager/example-complex/demo-app.js +3 -1
- package/docs/fundamentals/tools/singleton-manager/example-fail/demo-app.js +3 -1
- package/docs/fundamentals/tools/singleton-manager/example-success/demo-app.js +3 -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/index.md +8 -8
- package/docs/guides/principles/index.md +5 -5
- package/docs/guides/principles/styling.md +1 -1
- package/package.json +2 -2
|
@@ -33,21 +33,20 @@ See [css-tricks: popping-hidden-overflow](https://css-tricks.com/popping-hidden-
|
|
|
33
33
|
#### Overflow: the problem
|
|
34
34
|
|
|
35
35
|
```js preview-story
|
|
36
|
-
export const edgeCaseOverflowProblem = () =>
|
|
37
|
-
|
|
38
|
-
<div
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
>
|
|
42
|
-
<
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
</demo-overlay-el>
|
|
47
|
-
</div>
|
|
36
|
+
export const edgeCaseOverflowProblem = () => html`
|
|
37
|
+
<div style="padding: 54px 24px 36px;">
|
|
38
|
+
<div
|
|
39
|
+
style="overflow: hidden; border: 1px black dashed; padding-top: 44px; padding-bottom: 16px;"
|
|
40
|
+
>
|
|
41
|
+
<div style="display: flex; justify-content: space-evenly; position: relative;">
|
|
42
|
+
<demo-overlay-el opened use-absolute>
|
|
43
|
+
<button slot="invoker" aria-label="local, non modal"></button>
|
|
44
|
+
<div slot="content">absolute (for demo)</div>
|
|
45
|
+
</demo-overlay-el>
|
|
48
46
|
</div>
|
|
49
47
|
</div>
|
|
50
|
-
|
|
48
|
+
</div>
|
|
49
|
+
`;
|
|
51
50
|
```
|
|
52
51
|
|
|
53
52
|
#### Overflow: the solution
|
|
@@ -60,50 +59,46 @@ Two solutions are thinkable:
|
|
|
60
59
|
Our overlay system makes sure that there's always a fixed layer that pops out of the hidden parent.
|
|
61
60
|
|
|
62
61
|
```js preview-story
|
|
63
|
-
export const edgeCaseOverflowSolution = () =>
|
|
64
|
-
|
|
65
|
-
<div
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
>
|
|
69
|
-
<
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
</
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
<
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
</
|
|
98
|
-
|
|
99
|
-
<demo-overlay-el opened .config="${{ placementMode: 'global' }}">
|
|
100
|
-
<button slot="invoker" aria-label="global"></button>
|
|
101
|
-
<div slot="content">works</div>
|
|
102
|
-
</demo-overlay-el>
|
|
103
|
-
</div>
|
|
62
|
+
export const edgeCaseOverflowSolution = () => html`
|
|
63
|
+
<div style="padding: 54px 24px 36px;">
|
|
64
|
+
<div
|
|
65
|
+
style="overflow: hidden; border: 1px black dashed; padding-top: 36px; padding-bottom: 16px;"
|
|
66
|
+
>
|
|
67
|
+
<div style="display: flex; justify-content: space-evenly; position: relative;">
|
|
68
|
+
<demo-overlay-el opened .config="${{ placementMode: 'local', trapsKeyboardFocus: false }}">
|
|
69
|
+
<button slot="invoker" aria-label="local, non modal"></button>
|
|
70
|
+
<div slot="content">no matter</div>
|
|
71
|
+
</demo-overlay-el>
|
|
72
|
+
|
|
73
|
+
<demo-overlay-el opened .config="${{ placementMode: 'local', trapsKeyboardFocus: true }}">
|
|
74
|
+
<button slot="invoker" aria-label="local, modal"></button>
|
|
75
|
+
<div slot="content">what configuration</div>
|
|
76
|
+
</demo-overlay-el>
|
|
77
|
+
|
|
78
|
+
<demo-overlay-el
|
|
79
|
+
opened
|
|
80
|
+
.config="${{ placementMode: 'local', popperConfig: { strategy: 'absolute' } }}"
|
|
81
|
+
>
|
|
82
|
+
<button slot="invoker" aria-label="local, absolute"></button>
|
|
83
|
+
<div slot="content">...it</div>
|
|
84
|
+
</demo-overlay-el>
|
|
85
|
+
|
|
86
|
+
<demo-overlay-el
|
|
87
|
+
opened
|
|
88
|
+
.config="${{ placementMode: 'local', popperConfig: { strategy: 'fixed' } }}"
|
|
89
|
+
>
|
|
90
|
+
<button slot="invoker" aria-label="local, fixed"></button>
|
|
91
|
+
<div slot="content">just</div>
|
|
92
|
+
</demo-overlay-el>
|
|
93
|
+
|
|
94
|
+
<demo-overlay-el opened .config="${{ placementMode: 'global' }}">
|
|
95
|
+
<button slot="invoker" aria-label="global"></button>
|
|
96
|
+
<div slot="content">works</div>
|
|
97
|
+
</demo-overlay-el>
|
|
104
98
|
</div>
|
|
105
99
|
</div>
|
|
106
|
-
|
|
100
|
+
</div>
|
|
101
|
+
`;
|
|
107
102
|
```
|
|
108
103
|
|
|
109
104
|
### Stacking context
|
|
@@ -114,32 +109,31 @@ The example below shows the difference between a modal and non-modal overlay pla
|
|
|
114
109
|
#### Stacking context: the problem
|
|
115
110
|
|
|
116
111
|
```js preview-story
|
|
117
|
-
export const edgeCaseStackProblem = () =>
|
|
118
|
-
|
|
119
|
-
<div
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
</div>
|
|
112
|
+
export const edgeCaseStackProblem = () => html`
|
|
113
|
+
<div style="width: 300px; height: 300px; position: relative;">
|
|
114
|
+
<div
|
|
115
|
+
id="stacking-context-a"
|
|
116
|
+
style="position: absolute; z-index: 2; top: 0; width: 100px; height: 200px;"
|
|
117
|
+
>
|
|
118
|
+
I am on top and I don't care about your 9999
|
|
119
|
+
</div>
|
|
126
120
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
</div>
|
|
121
|
+
<div
|
|
122
|
+
id="stacking-context-b"
|
|
123
|
+
style="position: absolute; z-index: 1; top: 0; width: 200px; height: 200px;"
|
|
124
|
+
>
|
|
125
|
+
<demo-overlay-el no-dialog-el style="overflow:hidden; position: relative;">
|
|
126
|
+
<button slot="invoker">invoke</button>
|
|
127
|
+
<div slot="content">
|
|
128
|
+
The overlay can never be in front, since the parent stacking context has a lower priority
|
|
129
|
+
than its sibling.
|
|
130
|
+
<div id="stacking-context-b-inner" style="position: absolute; z-index: 9999;">
|
|
131
|
+
So, even if we add a new stacking context in our overlay with z-index 9999, it will
|
|
132
|
+
never be painted on top.
|
|
140
133
|
</div>
|
|
141
|
-
</
|
|
142
|
-
</
|
|
134
|
+
</div>
|
|
135
|
+
</demo-overlay-el>
|
|
143
136
|
</div>
|
|
144
|
-
|
|
137
|
+
</div>
|
|
138
|
+
`;
|
|
145
139
|
```
|
|
@@ -69,7 +69,7 @@ export const placementGlobal = () => {
|
|
|
69
69
|
|
|
70
70
|
## isTooltip (placementMode: 'local')
|
|
71
71
|
|
|
72
|
-
As specified in the [overlay rationale](https://github.com/ing-bank/lion/blob/
|
|
72
|
+
As specified in the [overlay rationale](https://github.com/ing-bank/lion/blob/3829e2dce5fce180672f666257d10513da30e1d5/docs/fundamentals/systems/overlays/rationale.md) there are only two official types of overlays: dialogs and tooltips. And their main differences are:
|
|
73
73
|
|
|
74
74
|
- Dialogs have a modal option, tooltips don’t
|
|
75
75
|
- Dialogs have interactive content, tooltips don’t
|
|
@@ -374,7 +374,7 @@ Features:
|
|
|
374
374
|
|
|
375
375
|
> Popper strictly is scoped on positioning. **It does not change the dimensions of the content node nor the invoker node**.
|
|
376
376
|
> 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.
|
|
377
|
-
> An example implementation can be found in [lion-tooltip](https://github.com/ing-bank/lion/blob/
|
|
377
|
+
> An example implementation can be found in [lion-tooltip](https://github.com/ing-bank/lion/blob/3829e2dce5fce180672f666257d10513da30e1d5/docs/components/tooltip/overview.md), where an arrow is set by default.
|
|
378
378
|
|
|
379
379
|
To override the default options we set for local mode, you add a `popperConfig` object to the config passed to the OverlayController.
|
|
380
380
|
Here's a succinct overview of some often used popper properties:
|
|
@@ -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/3829e2dce5fce180672f666257d10513da30e1d5/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/3829e2dce5fce180672f666257d10513da30e1d5/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/3829e2dce5fce180672f666257d10513da30e1d5/docs/fundamentals/systems/overlays/use-cases.md#overlaycontroller), a single controller class for handling overlays
|
|
23
|
+
- [**OverlayMixin**](https://github.com/ing-bank/lion/blob/3829e2dce5fce180672f666257d10513da30e1d5/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,4 +110,4 @@ 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/3829e2dce5fce180672f666257d10513da30e1d5/docs/fundamentals/systems/overlays/rationale.md) folder, where we go more in-depth.
|
|
@@ -21,7 +21,7 @@ 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/3829e2dce5fce180672f666257d10513da30e1d5/docs/fundamentals/systems/overlays/rationale.md).
|
|
25
25
|
|
|
26
26
|
```js preview-story
|
|
27
27
|
export const main = () => html`
|
|
@@ -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/3829e2dce5fce180672f666257d10513da30e1d5/docs/fundamentals/systems/overlays/configuration.md).
|
|
71
71
|
|
|
72
72
|
- withModalDialogConfig
|
|
73
73
|
- withDropdownConfig
|
|
@@ -131,15 +131,12 @@ render() {
|
|
|
131
131
|
|
|
132
132
|
or declaratively in your template with the `.config` property
|
|
133
133
|
|
|
134
|
-
```
|
|
135
|
-
<demo-el-using-overlaymixin .config
|
|
134
|
+
```jsx
|
|
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:
|
|
139
|
-
<button
|
|
140
|
-
@click=${e => e.target.dispatchEvent(new Event('close-overlay', { bubbles: true }))}
|
|
141
|
-
>
|
|
142
|
-
⨯
|
|
139
|
+
<button @click="${e => e.target.dispatchEvent(new Event('close-overlay', { bubbles: true }))}">
|
|
143
140
|
</button>
|
|
144
141
|
</div>
|
|
145
142
|
</demo-el-using-overlaymixin>
|
|
@@ -40,13 +40,10 @@ const uid = Math.random().toString(36).substr(2, 10);
|
|
|
40
40
|
|
|
41
41
|
This connects the logger element to the trigger.
|
|
42
42
|
|
|
43
|
-
```
|
|
43
|
+
```jsx
|
|
44
44
|
<div>To log: <code>Hello, World!</code></div>
|
|
45
|
-
<button
|
|
46
|
-
|
|
47
|
-
e.target.parentElement.querySelector('#logger-${uid}').log('Hello, World!')
|
|
48
|
-
}}
|
|
49
|
-
>Click this button</button>
|
|
45
|
+
<button @click="${e => { e.target.parentElement.querySelector('#logger-${uid}').log('Hello, World!') }}">Click this button
|
|
46
|
+
</button>
|
|
50
47
|
<sb-action-logger id="logger-${uid}"></sb-action-logger>
|
|
51
48
|
```
|
|
52
49
|
|
|
@@ -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/3829e2dce5fce180672f666257d10513da30e1d5/docs/fundamentals/tools/helpers/action-logger.md) | Storybook action logger |
|
|
13
13
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
@@ -37,7 +37,9 @@ class DemoApp extends LitElement {
|
|
|
37
37
|
font-size: 1rem;
|
|
38
38
|
cursor: pointer;
|
|
39
39
|
text-align: center;
|
|
40
|
-
transition:
|
|
40
|
+
transition:
|
|
41
|
+
background 250ms ease-in-out,
|
|
42
|
+
transform 150ms ease;
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
button:hover,
|
|
@@ -35,7 +35,9 @@ class DemoApp extends LitElement {
|
|
|
35
35
|
font-size: 1rem;
|
|
36
36
|
cursor: pointer;
|
|
37
37
|
text-align: center;
|
|
38
|
-
transition:
|
|
38
|
+
transition:
|
|
39
|
+
background 250ms ease-in-out,
|
|
40
|
+
transform 150ms ease;
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
button:hover,
|
|
@@ -37,7 +37,9 @@ class DemoApp extends LitElement {
|
|
|
37
37
|
font-size: 1rem;
|
|
38
38
|
cursor: pointer;
|
|
39
39
|
text-align: center;
|
|
40
|
-
transition:
|
|
40
|
+
transition:
|
|
41
|
+
background 250ms ease-in-out,
|
|
42
|
+
transform 150ms ease;
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
button:hover,
|
|
@@ -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/3829e2dce5fce180672f666257d10513da30e1d5/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/3829e2dce5fce180672f666257d10513da30e1d5/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/3829e2dce5fce180672f666257d10513da30e1d5/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/3829e2dce5fce180672f666257d10513da30e1d5/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
|
---
|
|
@@ -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/3829e2dce5fce180672f666257d10513da30e1d5/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/3829e2dce5fce180672f666257d10513da30e1d5/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/3829e2dce5fce180672f666257d10513da30e1d5/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/3829e2dce5fce180672f666257d10513da30e1d5/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/3829e2dce5fce180672f666257d10513da30e1d5/docs/fundamentals/systems/form/formatting-and-parsing.md)
|
|
151
151
|
|
|
152
152
|
Implement with the following code:
|
|
153
153
|
|
|
@@ -63,7 +63,7 @@ class MyForm extends LitElement {
|
|
|
63
63
|
}
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
> Today, rendering to light dom is the only way to [stay accessible](https://github.com/ing-bank/lion/blob/
|
|
66
|
+
> Today, rendering to light dom is the only way to [stay accessible](https://github.com/ing-bank/lion/blob/3829e2dce5fce180672f666257d10513da30e1d5/docs/fundamentals/rationales/accessibility.md#shadow-roots-and-accessibility).
|
|
67
67
|
|
|
68
68
|
The registration mechanism relies on light dom by design: as soon as you do start to use shadow roots, you will notice that your form components won't register themselves anymore to their parents.
|
|
69
69
|
|
|
@@ -73,7 +73,7 @@ Extending form components is not recommended for Application Developers: it shou
|
|
|
73
73
|
This team will add the styling and default configuration needed to make it fit the particular Design System.
|
|
74
74
|
|
|
75
75
|
With the toolbox provided by the team that creates your Design System, you should be able to build all your forms. Only if you have a really good reason, look into
|
|
76
|
-
[exceptional cases](https://github.com/ing-bank/lion/blob/
|
|
76
|
+
[exceptional cases](https://github.com/ing-bank/lion/blob/3829e2dce5fce180672f666257d10513da30e1d5/docs/guides/how-to/#exceptional-cases) below.
|
|
77
77
|
|
|
78
78
|
### Exceptional cases
|
|
79
79
|
|
|
@@ -81,8 +81,8 @@ If the form component you need is still missing, you have two options:
|
|
|
81
81
|
|
|
82
82
|
- is it a generic primitive that should be part of Lion? Request it in [Lion discussions](https://github.com/ing-bank/lion/discussions)
|
|
83
83
|
- is it a non generic component that is unique to your app?
|
|
84
|
-
- follow [create a custom field](https://github.com/ing-bank/lion/blob/
|
|
85
|
-
- follow [extend a native input](https://github.com/ing-bank/lion/blob/
|
|
84
|
+
- follow [create a custom field](https://github.com/ing-bank/lion/blob/3829e2dce5fce180672f666257d10513da30e1d5/docs/guides/how-to/create-a-custom-field.md)
|
|
85
|
+
- follow [extend a native input](https://github.com/ing-bank/lion/blob/3829e2dce5fce180672f666257d10513da30e1d5/docs/guides/how-to/extend-a-native-input.md)
|
|
86
86
|
|
|
87
87
|
It's also possible to extend other components, like LionListbox or LionCombobox. You need to be aware that you're building on top of protected apis.
|
|
88
88
|
Changing/overriding functionality is only recommended if the source code in `form-core` is fully understood.
|
|
@@ -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/3829e2dce5fce180672f666257d10513da30e1d5/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/3829e2dce5fce180672f666257d10513da30e1d5/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/3829e2dce5fce180672f666257d10513da30e1d5/docs/guides/principles/definitions-and-terms.md)
|
|
16
|
+
- [Styling](https://github.com/ing-bank/lion/blob/3829e2dce5fce180672f666257d10513da30e1d5/docs/guides/principles/styling.md)
|
|
17
|
+
- [Scoped Elements](https://github.com/ing-bank/lion/blob/3829e2dce5fce180672f666257d10513da30e1d5/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/3829e2dce5fce180672f666257d10513da30e1d5/docs/guides/principles/subclasser-apis.md)
|
|
26
|
+
- [Extend documentation](https://github.com/ing-bank/lion/blob/3829e2dce5fce180672f666257d10513da30e1d5/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/3829e2dce5fce180672f666257d10513da30e1d5/docs/guides/how-to/get-started.md)
|
|
33
|
+
- [Create a custom field](https://github.com/ing-bank/lion/blob/3829e2dce5fce180672f666257d10513da30e1d5/docs/guides/how-to/create-a-custom-field.md)
|
|
34
|
+
- [Extend a native input](https://github.com/ing-bank/lion/blob/3829e2dce5fce180672f666257d10513da30e1d5/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/3829e2dce5fce180672f666257d10513da30e1d5/docs/guides/principles/definitions-and-terms.md)
|
|
16
|
+
- [Styling](https://github.com/ing-bank/lion/blob/3829e2dce5fce180672f666257d10513da30e1d5/docs/guides/principles/styling.md)
|
|
17
|
+
- [Scoped Elements](https://github.com/ing-bank/lion/blob/3829e2dce5fce180672f666257d10513da30e1d5/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/3829e2dce5fce180672f666257d10513da30e1d5/docs/guides/principles/subclasser-apis.md)
|
|
26
|
+
- [Extend documentation](https://github.com/ing-bank/lion/blob/3829e2dce5fce180672f666257d10513da30e1d5/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/3829e2dce5fce180672f666257d10513da30e1d5/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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lion/ui",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"description": "A package of extendable web components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ing-bank",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"debug:firefox": "cd ../../ && npm run debug:firefox",
|
|
47
47
|
"debug:webkit": "cd ../../ && npm run debug:webkit",
|
|
48
48
|
"generate-lion-exports": "node ./scripts/generate-lion-exports.js",
|
|
49
|
-
"publish-docs": "node ../../packages-node/publish-docs/src/cli.js --github-url https://github.com/ing-bank/lion/ --git-root-dir ../../",
|
|
50
49
|
"prepublishOnly": "npm run types && npm run create-npm-publish-docs && npm run publish-docs && npm run custom-elements-manifest && npm run generate-lion-exports",
|
|
50
|
+
"publish-docs": "node ../../packages-node/publish-docs/src/cli.js --github-url https://github.com/ing-bank/lion/ --git-root-dir ../../",
|
|
51
51
|
"test": "cd ../../ && npm run test:browser",
|
|
52
52
|
"types": "wireit",
|
|
53
53
|
"types-check-only": "tsc --project tsconfig-check-only.json",
|