@lion/ui 0.7.6 → 0.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -2
- package/components/button/test-suites/LionButton.suite.js +3 -1
- package/components/calendar/src/LionCalendar.js +9 -5
- package/components/calendar/test/lion-calendar.test.js +33 -6
- package/components/combobox/src/LionCombobox.js +33 -9
- package/components/combobox/test/lion-combobox.test.js +134 -7
- package/components/dialog/test/lion-dialog.test.js +59 -1
- package/components/input-datepicker/src/LionInputDatepicker.js +1 -21
- package/components/input-datepicker/test/lion-input-datepicker.test.js +30 -3
- package/components/input-file/src/FileHandle.js +1 -1
- package/components/input-file/src/LionInputFile.js +1 -3
- package/components/input-file/test/lion-input-file.test.js +11 -14
- package/components/overlays/src/OverlayController.js +13 -7
- package/components/overlays/src/OverlayMixin.js +5 -1
- package/components/overlays/test/OverlayController.test.js +46 -0
- package/components/select-rich/src/LionSelectRich.js +12 -0
- package/components/select-rich/test/lion-select-rich.test.js +26 -0
- package/custom-elements.json +60 -73
- package/dist-types/components/button/test-suites/LionButton.suite.d.ts.map +1 -1
- package/dist-types/components/calendar/src/LionCalendar.d.ts +1 -0
- package/dist-types/components/calendar/src/LionCalendar.d.ts.map +1 -1
- package/dist-types/components/combobox/src/LionCombobox.d.ts +9 -0
- package/dist-types/components/combobox/src/LionCombobox.d.ts.map +1 -1
- package/dist-types/components/input-datepicker/src/LionInputDatepicker.d.ts +0 -5
- package/dist-types/components/input-datepicker/src/LionInputDatepicker.d.ts.map +1 -1
- package/dist-types/components/input-file/src/LionInputFile.d.ts.map +1 -1
- package/dist-types/components/overlays/src/OverlayController.d.ts.map +1 -1
- package/dist-types/components/overlays/src/OverlayMixin.d.ts.map +1 -1
- package/dist-types/components/select-rich/src/LionSelectRich.d.ts.map +1 -1
- package/dist-types/tsconfig.tsbuildinfo +1 -1
- package/docs/components/button/use-cases.md +2 -2
- package/docs/components/calendar/use-cases.md +4 -4
- package/docs/components/checkbox-group/api-table.md +49 -55
- package/docs/components/checkbox-group/overview.md +5 -5
- package/docs/components/checkbox-group/use-cases.md +33 -33
- package/docs/components/collapsible/overview.md +1 -1
- package/docs/components/collapsible/use-cases.md +3 -3
- package/docs/components/combobox/api-table.md +84 -89
- package/docs/components/combobox/extensions.md +20 -20
- package/docs/components/combobox/overview.md +1 -1
- package/docs/components/combobox/use-cases.md +6 -6
- package/docs/components/dialog/api-table.md +3 -3
- package/docs/components/dialog/overview.md +2 -2
- package/docs/components/dialog/src/external-dialog.js +32 -0
- package/docs/components/dialog/src/slots-dialog-content.js +1 -1
- package/docs/components/dialog/src/styled-dialog-content.js +1 -1
- package/docs/components/dialog/use-cases.md +49 -3
- package/docs/components/drawer/use-cases.md +3 -3
- package/docs/components/fieldset/api-table.md +45 -51
- package/docs/components/fieldset/overview.md +7 -7
- package/docs/components/fieldset/use-cases.md +15 -15
- package/docs/components/form/overview.md +7 -7
- package/docs/components/form/use-cases.md +4 -4
- package/docs/components/icon/use-cases.md +1 -1
- package/docs/components/input/overview.md +1 -1
- package/docs/components/input/use-cases.md +3 -3
- package/docs/components/input-amount/overview.md +3 -3
- package/docs/components/input-amount/use-cases.md +8 -8
- package/docs/components/input-date/overview.md +3 -3
- package/docs/components/input-date/use-cases.md +8 -8
- package/docs/components/input-datepicker/api-table.md +1 -3
- package/docs/components/input-datepicker/overview.md +5 -5
- package/docs/components/input-datepicker/use-cases.md +5 -5
- package/docs/components/input-email/overview.md +2 -2
- package/docs/components/input-email/use-cases.md +3 -3
- package/docs/components/input-file/overview.md +1 -1
- package/docs/components/input-iban/overview.md +2 -2
- package/docs/components/input-iban/use-cases.md +8 -8
- package/docs/components/input-range/overview.md +2 -2
- package/docs/components/input-stepper/api-table.md +65 -69
- package/docs/components/input-stepper/overview.md +1 -1
- package/docs/components/input-tel/overview.md +1 -1
- package/docs/components/input-tel/use-cases.md +9 -9
- package/docs/components/input-tel-dropdown/api-table.md +70 -73
- package/docs/components/input-tel-dropdown/extensions.md +1 -1
- package/docs/components/input-tel-dropdown/overview.md +1 -1
- package/docs/components/input-tel-dropdown/use-cases.md +5 -5
- package/docs/components/listbox/api-table.md +64 -70
- package/docs/components/listbox/overview.md +5 -5
- package/docs/components/listbox/use-cases.md +61 -61
- package/docs/components/pagination/use-cases.md +5 -5
- package/docs/components/radio-group/api-table.md +49 -55
- package/docs/components/radio-group/overview.md +6 -6
- package/docs/components/radio-group/use-cases.md +18 -18
- package/docs/components/select/use-cases.md +2 -2
- package/docs/components/select-rich/api-table.md +79 -85
- package/docs/components/select-rich/overview.md +3 -3
- package/docs/components/select-rich/use-cases.md +33 -33
- package/docs/components/steps/overview.md +4 -4
- package/docs/components/steps/use-cases.md +7 -7
- package/docs/components/tabs/examples.md +1 -1
- package/docs/components/tabs/use-cases.md +1 -1
- package/docs/components/textarea/use-cases.md +3 -3
- package/docs/components/tooltip/api-table.md +3 -3
- package/docs/components/tooltip/use-cases.md +6 -6
- package/docs/fundamentals/index.md +4 -4
- package/docs/fundamentals/node-tools/providence-analytics/LocalConfiguration.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/QueryResult.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/analyzer.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/dashboard.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/overview.md +3 -3
- package/docs/fundamentals/node-tools/publish-docs/overview.md +3 -3
- package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +2 -2
- package/docs/fundamentals/rationales/accessibility.md +1 -1
- package/docs/fundamentals/systems/core/SlotMixin.md +1 -1
- package/docs/fundamentals/systems/core/overview.md +1 -1
- package/docs/fundamentals/systems/form/formatting-and-parsing.md +8 -8
- package/docs/fundamentals/systems/form/model-value.md +1 -1
- package/docs/fundamentals/systems/form/overview.md +28 -28
- package/docs/fundamentals/systems/form/use-cases.md +19 -19
- package/docs/fundamentals/systems/form/validate.md +50 -50
- package/docs/fundamentals/systems/localize/api-table.md +10 -17
- package/docs/fundamentals/systems/localize/overview.md +4 -4
- package/docs/fundamentals/systems/localize/use-cases.md +4 -4
- package/docs/fundamentals/systems/overlays/_configuration-positioning.md +4 -4
- package/docs/fundamentals/systems/overlays/api-table.md +34 -90
- package/docs/fundamentals/systems/overlays/assets/umbrella-form.js +9 -9
- package/docs/fundamentals/systems/overlays/configuration.md +30 -30
- package/docs/fundamentals/systems/overlays/overview.md +6 -6
- package/docs/fundamentals/systems/overlays/use-cases.md +30 -30
- package/docs/fundamentals/tools/ajax/use-cases.md +20 -20
- package/docs/fundamentals/tools/helpers/action-logger.md +3 -3
- package/docs/fundamentals/tools/helpers/overview.md +1 -1
- package/docs/fundamentals/tools/singleton-manager/example-complex/demo-app.js +2 -2
- package/docs/fundamentals/tools/singleton-manager/example-fail/demo-app.js +2 -2
- package/docs/fundamentals/tools/singleton-manager/example-success/demo-app.js +2 -2
- package/docs/fundamentals/tools/singleton-manager/overview.md +4 -4
- package/docs/guides/how-to/create-a-custom-field.md +7 -7
- package/docs/guides/how-to/create-a-form.md +4 -4
- package/docs/guides/how-to/extend-a-native-input.md +2 -2
- package/docs/guides/index.md +8 -8
- package/docs/guides/principles/index.md +5 -5
- package/docs/guides/principles/scoped-elements.md +1 -1
- package/docs/guides/principles/styling.md +1 -1
- package/package.json +1 -1
|
@@ -4,57 +4,51 @@
|
|
|
4
4
|
|
|
5
5
|
### Fields
|
|
6
6
|
|
|
7
|
-
| Name | Privacy | Type | Default
|
|
8
|
-
| ------------------------------------ | --------- | ------------------------------------------------------------------------- |
|
|
9
|
-
| `_isFormOrFieldset` | protected | `boolean` | `true`
|
|
10
|
-
| `_repropagationRole` | public | `'child'\|'choice-group'\|'fieldset'` | `'fieldset'`
|
|
11
|
-
| `_inputNode` | protected | |
|
|
12
|
-
| `modelValue` | public | |
|
|
13
|
-
| `serializedValue` | public | |
|
|
14
|
-
| `formattedValue` | public | |
|
|
15
|
-
| `prefilled` | public | `boolean` |
|
|
16
|
-
| `_initialModelValue` | protected | |
|
|
17
|
-
| `value` | public | `string` | `''`
|
|
18
|
-
| `disabled` | public | `boolean` | `false`
|
|
19
|
-
| `submitted` | public | `boolean` | `false`
|
|
20
|
-
| `dirty` | public | `boolean` | `false`
|
|
21
|
-
| `touched` | public | `boolean` | `false`
|
|
22
|
-
| `focused` | public | `boolean` | `false`
|
|
23
|
-
| `defaultValidators` | public | `Validator[]` | `[new FormElementsHaveNoError()]`
|
|
24
|
-
| `__descriptionElementsInParentChain` | protected | | `new Set()`
|
|
25
|
-
| `__pendingValues` | protected | `{modelValue?:{[key:string]: any}, serializedValue?:{[key:string]: any}}` | `{ modelValue: {}, serializedValue: {} }`
|
|
26
|
-
| `formElements` | public | `FormControlsCollection` | `new FormControlsCollection()`
|
|
27
|
-
| `initComplete` | public | `Promise<any>` | `new Promise((resolve, reject) => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
| `
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
| `
|
|
36
|
-
| `
|
|
37
|
-
| `
|
|
38
|
-
| `
|
|
39
|
-
| `
|
|
40
|
-
| `
|
|
41
|
-
| `
|
|
42
|
-
| `
|
|
43
|
-
| `
|
|
44
|
-
| `
|
|
45
|
-
| `
|
|
46
|
-
| `
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
49
|
-
| `
|
|
50
|
-
| `
|
|
51
|
-
| `
|
|
52
|
-
| `showsFeedbackFor` | public | `ValidationType[]` | `[]` | Based on outcome of feedbackCondition, this array decides what ValidationTypes should be
shown in validationFeedback, based on meta data like interaction states.

For styling purposes, it reflects it \`\[shows-feedback-for="error warning"]\` | ValidateMixin |
|
|
53
|
-
| `validationStates` | public | `ValidationStates` | `{}` | The outcome of a validation 'round'. Keyed by ValidationType and Validator name | ValidateMixin |
|
|
54
|
-
| `isPending` | public | `boolean` | `false` | Flag indicating whether async validation is pending.
Creates attribute \[is-pending] as a styling hook | ValidateMixin |
|
|
55
|
-
| `validators` | public | `Validator[]` | `[]` | Used by Application Developers to add Validators to a FormControl. | ValidateMixin |
|
|
56
|
-
| `_visibleMessagesAmount` | protected | `number` | `1` | The amount of feedback messages that will visible in LionValidationFeedback | ValidateMixin |
|
|
57
|
-
| `_requestedToBeDisabled` | protected | `boolean` | `false` | | DisabledMixin |
|
|
7
|
+
| Name | Privacy | Type | Default | Description | Inherited From |
|
|
8
|
+
| ------------------------------------ | --------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
|
|
9
|
+
| `_isFormOrFieldset` | protected | `boolean` | `true` | Flag that determines how ".formElements" should behave.
For a regular fieldset (see LionFieldset) we expect ".formElements"
to be accessible as an object.
In case of a radio-group, a checkbox-group or a select/listbox,
it should act like an array (see ChoiceGroupMixin).
Usually, when false, we deal with a choice-group (radio-group, checkbox-group,
(multi)select) | FormRegistrarMixin |
|
|
10
|
+
| `_repropagationRole` | public | `'child'\|'choice-group'\|'fieldset'` | `'fieldset'` | Based on the role, details of handling model-value-changed repropagation differ. | FormControlMixin |
|
|
11
|
+
| `_inputNode` | protected | | | The host element with role group (or radio-group or form) containing necessary aria attributes | FormControlMixin |
|
|
12
|
+
| `modelValue` | public | | | Object keyed by formElements names, containing formElements' modelValues | FormControlMixin |
|
|
13
|
+
| `serializedValue` | public | | | Object keyed by formElements names, containing formElements' serializedValues | FormGroupMixin |
|
|
14
|
+
| `formattedValue` | public | | | Object keyed by formElements names, containing formElements' formattedValues | FormGroupMixin |
|
|
15
|
+
| `prefilled` | public | `boolean` | | True when all of the children are prefilled (see InteractionStateMixin for more details.) | FormGroupMixin |
|
|
16
|
+
| `_initialModelValue` | protected | | | Gathers initial model values of all children. Used when resetGroup() is called. | FormGroupMixin |
|
|
17
|
+
| `value` | public | `string` | `''` | | FormGroupMixin |
|
|
18
|
+
| `disabled` | public | `boolean` | `false` | Disables all formElements in group | DisabledMixin |
|
|
19
|
+
| `submitted` | public | `boolean` | `false` | True when parent form is submitted | FormGroupMixin |
|
|
20
|
+
| `dirty` | public | `boolean` | `false` | True when any of the children is dirty (see InteractionStateMixin for more details.) | FormGroupMixin |
|
|
21
|
+
| `touched` | public | `boolean` | `false` | True when the group as a whole is blurred (see InteractionStateMixin for more details.) | FormGroupMixin |
|
|
22
|
+
| `focused` | public | `boolean` | `false` | True when any of the children is focused. | FormGroupMixin |
|
|
23
|
+
| `defaultValidators` | public | `Validator[]` | `[new FormElementsHaveNoError()]` | Used by Subclassers to add default Validators to a particular FormControl.
A date input for instance, always needs the isDate validator. | ValidateMixin |
|
|
24
|
+
| `__descriptionElementsInParentChain` | protected | | `new Set()` | | FormGroupMixin |
|
|
25
|
+
| `__pendingValues` | protected | `{modelValue?:{[key:string]: any}, serializedValue?:{[key:string]: any}}` | `{ modelValue: {}, serializedValue: {} }` | | FormGroupMixin |
|
|
26
|
+
| `formElements` | public | `FormControlsCollection` | `new FormControlsCollection()` | Closely mimics the natively supported HTMLFormControlsCollection. It can be accessed
both like an array and an object (based on control/element names). | FormRegistrarMixin |
|
|
27
|
+
| `initComplete` | public | `Promise<any>` | `new Promise((resolve, reject) => { this.__resolveInitComplete = resolve; this.__rejectInitComplete = reject; })` | initComplete resolves after all pending initialization logic
(for instance \`\<form-group .serializedValue=${{ child1: 'a', child2: 'b' }}>\`)
is executed | FormRegistrarMixin |
|
|
28
|
+
| `registrationComplete` | public | `Promise<any> & {done?:boolean}` | `new Promise((resolve, reject) => { this.__resolveRegistrationComplete = resolve; this.__rejectRegistrationComplete = reject; })` | registrationComplete waits for all children formElements to have registered | FormRegistrarMixin |
|
|
29
|
+
| `done` | public | `boolean` | `false` | | FormRegistrarMixin |
|
|
30
|
+
| `label` | public | `string` | `''` | The label text for the input node.
When no value is defined, textContent of \[slot=label] will be used | FormControlMixin |
|
|
31
|
+
| `helpText` | public | `string` | `''` | The helpt text for the input node.
When no value is defined, textContent of \[slot=help-text] will be used | FormControlMixin |
|
|
32
|
+
| `fieldName` | public | `string` | | Will be used in validation messages to refer to the current field | FormControlMixin |
|
|
33
|
+
| `_labelNode` | protected | | | Element where label will be rendered to | FormControlMixin |
|
|
34
|
+
| `_helpTextNode` | protected | | | Element where help text will be rendered to | FormControlMixin |
|
|
35
|
+
| `_feedbackNode` | protected | | | Element where validation feedback will be rendered to | FormControlMixin |
|
|
36
|
+
| `readOnly` | public | `boolean` | `false` | A Boolean attribute which, if present, indicates that the user should not be able to edit
the value of the input. The difference between disabled and readonly is that read-only
controls can still function, whereas disabled controls generally do not function as
controls until they are enabled.
(From: https\://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-readonly) | FormControlMixin |
|
|
37
|
+
| `labelSrOnly` | public | `boolean` | `false` | The label will only be visible for srceen readers when true | FormControlMixin |
|
|
38
|
+
| `_inputId` | protected | `string` | | Unique id that can be used in all light dom | FormControlMixin |
|
|
39
|
+
| `_ariaLabelledNodes` | public | `HTMLElement[]` | `[]` | Contains all elements that should end up in aria-labelledby of \`.\_inputNode\` | FormControlMixin |
|
|
40
|
+
| `_ariaDescribedNodes` | public | `HTMLElement[]` | `[]` | Contains all elements that should end up in aria-describedby of \`.\_inputNode\` | FormControlMixin |
|
|
41
|
+
| `_isRepropagationEndpoint` | public | `boolean` | `false` | By default, a field with \_repropagationRole 'choice-group' will act as an
'endpoint'. This means it will be considered as an individual field: for
a select, individual options will not be part of the formPath. They
will.
Similarly, components that (a11y wise) need to be fieldsets, but 'interaction wise'
(from Application Developer perspective) need to be more like fields
(think of an amount-input with a currency select box next to it), can set this
to true to hide private internals in the formPath. | FormControlMixin |
|
|
42
|
+
| `operationMode` | public | `OperationMode` | | Types of input interaction of the FormControl (for instance 'enter'\|'select'\|'upload') | ValidateMixin |
|
|
43
|
+
| `_allValidators` | protected | `Validator[]` | | Combination of validators provided by Application Developer and the default validators | ValidateMixin |
|
|
44
|
+
| `_feedbackConditionMeta` | protected | | | Allows Subclassers to add meta info for feedbackCondition | ValidateMixin |
|
|
45
|
+
| `hasFeedbackFor` | public | `ValidationType[]` | `[]` | As soon as validation happens (after modelValue/validators/validator param change), this
array is updated with the active ValidationTypes ('error'\|'warning'\|'success'\|'info' etc.).
Notice the difference with \`.showsFeedbackFor\`, which filters \`.hasFeedbackFor\` based on
\`.feedbackCondition()\`.

For styling purposes, will be reflected to \[has-feedback-for="error warning"]. This can
be useful for subtle visual feedback on keyup, like a red/green border around an input. | ValidateMixin |
|
|
46
|
+
| `showsFeedbackFor` | public | `ValidationType[]` | `[]` | Based on outcome of feedbackCondition, this array decides what ValidationTypes should be
shown in validationFeedback, based on meta data like interaction states.

For styling purposes, it reflects it \`\[shows-feedback-for="error warning"]\` | ValidateMixin |
|
|
47
|
+
| `validationStates` | public | `ValidationStates` | `{}` | The outcome of a validation 'round'. Keyed by ValidationType and Validator name | ValidateMixin |
|
|
48
|
+
| `isPending` | public | `boolean` | `false` | Flag indicating whether async validation is pending.
Creates attribute \[is-pending] as a styling hook | ValidateMixin |
|
|
49
|
+
| `validators` | public | `Validator[]` | `[]` | Used by Application Developers to add Validators to a FormControl. | ValidateMixin |
|
|
50
|
+
| `_visibleMessagesAmount` | protected | `number` | `1` | The amount of feedback messages that will visible in LionValidationFeedback | ValidateMixin |
|
|
51
|
+
| `_requestedToBeDisabled` | protected | `boolean` | `false` | | DisabledMixin |
|
|
58
52
|
|
|
59
53
|
### Methods
|
|
60
54
|
|
|
@@ -12,17 +12,17 @@ A web component that can be used to group multiple input fields or other fieldse
|
|
|
12
12
|
```js preview-story
|
|
13
13
|
export const main = () => html`
|
|
14
14
|
<lion-fieldset name="nameGroup" label="Name">
|
|
15
|
-
<lion-input name="firstName" label="First Name" .modelValue
|
|
16
|
-
<lion-input name="lastName" label="Last Name" .modelValue
|
|
15
|
+
<lion-input name="firstName" label="First Name" .modelValue="${'Foo'}"></lion-input>
|
|
16
|
+
<lion-input name="lastName" label="Last Name" .modelValue="${'Bar'}"></lion-input>
|
|
17
17
|
</lion-fieldset>
|
|
18
18
|
`;
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
We have three specific fieldset implementations:
|
|
22
22
|
|
|
23
|
-
- [form](https://github.com/ing-bank/lion/blob/
|
|
24
|
-
- [checkbox-group](https://github.com/ing-bank/lion/blob/
|
|
25
|
-
- [radio-group](https://github.com/ing-bank/lion/blob/
|
|
23
|
+
- [form](https://github.com/ing-bank/lion/blob/b25478e4cc0cb51c4fda1eccadf5e630b679f53c/docs/components/form/overview.md)
|
|
24
|
+
- [checkbox-group](https://github.com/ing-bank/lion/blob/b25478e4cc0cb51c4fda1eccadf5e630b679f53c/docs/components/checkbox-group/overview.md)
|
|
25
|
+
- [radio-group](https://github.com/ing-bank/lion/blob/b25478e4cc0cb51c4fda1eccadf5e630b679f53c/docs/components/radio-group/overview.md)
|
|
26
26
|
|
|
27
27
|
A native fieldset element should always have a legend-element for a11y purposes.
|
|
28
28
|
However, our fieldset element is not native and should not have a legend-element.
|
|
@@ -31,8 +31,8 @@ Our fieldset instead has a label attribute or you can add a label with a div- or
|
|
|
31
31
|
## Features
|
|
32
32
|
|
|
33
33
|
- Easy retrieval of form data based on field names
|
|
34
|
-
- Advanced user interaction scenarios via [interaction states](https://github.com/ing-bank/lion/blob/
|
|
35
|
-
- Can have [validate](https://github.com/ing-bank/lion/blob/
|
|
34
|
+
- Advanced user interaction scenarios via [interaction states](https://github.com/ing-bank/lion/blob/b25478e4cc0cb51c4fda1eccadf5e630b679f53c/docs/fundamentals/systems/form/interaction-states.md)
|
|
35
|
+
- Can have [validate](https://github.com/ing-bank/lion/blob/b25478e4cc0cb51c4fda1eccadf5e630b679f53c/docs/fundamentals/systems/form/validate.md) on fieldset level and shows the validation feedback below the fieldset
|
|
36
36
|
- Can disable input fields on fieldset level
|
|
37
37
|
- Accessible out of the box
|
|
38
38
|
|
|
@@ -16,9 +16,9 @@ The fieldset's modelValue is an `Object` containing properties where the key is
|
|
|
16
16
|
```js preview-story
|
|
17
17
|
export const data = () => html`
|
|
18
18
|
<lion-fieldset name="nameGroup" label="Name">
|
|
19
|
-
<lion-input name="firstName" label="First Name" .modelValue
|
|
20
|
-
<lion-input name="lastName" label="Last Name" .modelValue
|
|
21
|
-
<button @click
|
|
19
|
+
<lion-input name="firstName" label="First Name" .modelValue="${'Foo'}"></lion-input>
|
|
20
|
+
<lion-input name="lastName" label="Last Name" .modelValue="${'Bar'}"></lion-input>
|
|
21
|
+
<button @click="${ev => console.log(ev.target.parentElement.modelValue)}">
|
|
22
22
|
Log to Action Logger
|
|
23
23
|
</button>
|
|
24
24
|
</lion-fieldset>
|
|
@@ -38,14 +38,14 @@ export const disabled = () => {
|
|
|
38
38
|
}
|
|
39
39
|
return html`
|
|
40
40
|
<lion-fieldset name="nameGroup" label="Name" id="fieldset" disabled>
|
|
41
|
-
<lion-input name="FirstName" label="First Name" .modelValue
|
|
42
|
-
<lion-input name="LastName" label="Last Name" .modelValue
|
|
41
|
+
<lion-input name="FirstName" label="First Name" .modelValue="${'Foo'}"></lion-input>
|
|
42
|
+
<lion-input name="LastName" label="Last Name" .modelValue="${'Bar'}"></lion-input>
|
|
43
43
|
<lion-fieldset name="nameGroup2" label="Name">
|
|
44
|
-
<lion-input name="FirstName2" label="First Name" .modelValue
|
|
45
|
-
<lion-input name="LastName2" label="Last Name" .modelValue
|
|
44
|
+
<lion-input name="FirstName2" label="First Name" .modelValue="${'Foo'}" disabled></lion-input>
|
|
45
|
+
<lion-input name="LastName2" label="Last Name" .modelValue="${'Bar'}"></lion-input>
|
|
46
46
|
</lion-fieldset>
|
|
47
47
|
</lion-fieldset>
|
|
48
|
-
<button @click
|
|
48
|
+
<button @click="${toggleDisabled}">Toggle disabled</button>
|
|
49
49
|
`;
|
|
50
50
|
};
|
|
51
51
|
```
|
|
@@ -59,18 +59,18 @@ export const nestingFieldsets = () => html`
|
|
|
59
59
|
<lion-fieldset>
|
|
60
60
|
<div slot="label">Personal data</div>
|
|
61
61
|
<lion-fieldset name="nameGroup" label="Name">
|
|
62
|
-
<lion-input name="FirstName" label="First Name" .modelValue
|
|
63
|
-
<lion-input name="LastName" label="Last Name" .modelValue
|
|
62
|
+
<lion-input name="FirstName" label="First Name" .modelValue="${'Foo'}"></lion-input>
|
|
63
|
+
<lion-input name="LastName" label="Last Name" .modelValue="${'Bar'}"></lion-input>
|
|
64
64
|
</lion-fieldset>
|
|
65
65
|
<lion-fieldset name="location" label="Location">
|
|
66
|
-
<lion-input name="country" label="Country" .modelValue
|
|
66
|
+
<lion-input name="country" label="Country" .modelValue="${'Netherlands'}"></lion-input>
|
|
67
67
|
</lion-fieldset>
|
|
68
|
-
<lion-input name="age" label="Age" .modelValue
|
|
69
|
-
<button @click
|
|
68
|
+
<lion-input name="age" label="Age" .modelValue="${21}"></lion-input>
|
|
69
|
+
<button @click="${ev => console.log(ev.target.parentElement.modelValue)}">
|
|
70
70
|
Log everything to Action Logger
|
|
71
71
|
</button>
|
|
72
72
|
<br />
|
|
73
|
-
<button @click
|
|
73
|
+
<button @click="${ev => console.log(ev.target.parentElement.formElements.nameGroup.modelValue)}">
|
|
74
74
|
Log only Name fieldset to Action Logger
|
|
75
75
|
</button>
|
|
76
76
|
</lion-fieldset>
|
|
@@ -168,7 +168,7 @@ export const validatingMultipleFieldsets = () => {
|
|
|
168
168
|
}
|
|
169
169
|
};
|
|
170
170
|
return html`
|
|
171
|
-
<lion-fieldset name="outer" .validators
|
|
171
|
+
<lion-fieldset name="outer" .validators="${[new IsCatsDogs()]}">
|
|
172
172
|
<lion-fieldset name="inner1">
|
|
173
173
|
<label slot="label">Fieldset no. 1</label>
|
|
174
174
|
<lion-input label="Write 'cats' here" name="input1"> </lion-input>
|
|
@@ -8,7 +8,7 @@ import '@lion/ui/define/lion-form.js';
|
|
|
8
8
|
```
|
|
9
9
|
|
|
10
10
|
A web component that enhances the functionality of the native `form` component.
|
|
11
|
-
It is designed to interact with (instances of) the [form controls](https://github.com/ing-bank/lion/blob/
|
|
11
|
+
It is designed to interact with (instances of) the [form controls](https://github.com/ing-bank/lion/blob/b25478e4cc0cb51c4fda1eccadf5e630b679f53c/docs/fundamentals/systems/form/overview.md).
|
|
12
12
|
|
|
13
13
|
```js preview-story
|
|
14
14
|
export const main = () => {
|
|
@@ -21,10 +21,10 @@ export const main = () => {
|
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
return html`
|
|
24
|
-
<lion-form @submit
|
|
25
|
-
<form @submit
|
|
26
|
-
<lion-input name="firstName" label="First Name" .modelValue
|
|
27
|
-
<lion-input name="lastName" label="Last Name" .modelValue
|
|
24
|
+
<lion-form @submit="${submitHandler}">
|
|
25
|
+
<form @submit="${ev => ev.preventDefault()}">
|
|
26
|
+
<lion-input name="firstName" label="First Name" .modelValue="${'Foo'}"></lion-input>
|
|
27
|
+
<lion-input name="lastName" label="Last Name" .modelValue="${'Bar'}"></lion-input>
|
|
28
28
|
<button>Submit</button>
|
|
29
29
|
</form>
|
|
30
30
|
</lion-form>
|
|
@@ -37,11 +37,11 @@ export const main = () => {
|
|
|
37
37
|
- Data synchronization with models
|
|
38
38
|
- Easy retrieval of form data based on field names
|
|
39
39
|
- Advanced validation possibilities
|
|
40
|
-
- Advanced user interaction scenarios via [interaction states](https://github.com/ing-bank/lion/blob/
|
|
40
|
+
- Advanced user interaction scenarios via [interaction states](https://github.com/ing-bank/lion/blob/b25478e4cc0cb51c4fda1eccadf5e630b679f53c/docs/fundamentals/systems/form/interaction-states.md)
|
|
41
41
|
- Registration mechanism for form controls
|
|
42
42
|
- Accessible out of the box
|
|
43
43
|
|
|
44
|
-
For more information about fields that are designed for our `form`, please read [form system](https://github.com/ing-bank/lion/blob/
|
|
44
|
+
For more information about fields that are designed for our `form`, please read [form system](https://github.com/ing-bank/lion/blob/b25478e4cc0cb51c4fda1eccadf5e630b679f53c/docs/fundamentals/systems/form/overview.md).
|
|
45
45
|
|
|
46
46
|
## Installation
|
|
47
47
|
|
|
@@ -39,8 +39,8 @@ export const formSubmit = () => {
|
|
|
39
39
|
ev.target.previousElementSibling.submit();
|
|
40
40
|
};
|
|
41
41
|
return html`
|
|
42
|
-
<lion-form @submit
|
|
43
|
-
<form @submit
|
|
42
|
+
<lion-form @submit="${submitHandler}">
|
|
43
|
+
<form @submit="${ev => ev.preventDefault()}">
|
|
44
44
|
<lion-input
|
|
45
45
|
name="firstName"
|
|
46
46
|
label="First Name"
|
|
@@ -55,14 +55,14 @@ export const formSubmit = () => {
|
|
|
55
55
|
<button>Submit</button>
|
|
56
56
|
<button
|
|
57
57
|
type="button"
|
|
58
|
-
@click
|
|
58
|
+
@click="${ev => ev.currentTarget.parentElement.parentElement.parentElement.resetGroup()}"
|
|
59
59
|
>
|
|
60
60
|
Reset
|
|
61
61
|
</button>
|
|
62
62
|
</div>
|
|
63
63
|
</form>
|
|
64
64
|
</lion-form>
|
|
65
|
-
<button @click
|
|
65
|
+
<button @click="${submitViaJS}">Explicit submit via JavaScript</button>
|
|
66
66
|
`;
|
|
67
67
|
};
|
|
68
68
|
```
|
|
@@ -26,7 +26,7 @@ icons.addIconResolver('lion', (iconset, name) => {
|
|
|
26
26
|
## Icon sets
|
|
27
27
|
|
|
28
28
|
Icons are displayed using icon sets. These are collections of icons, lazily loaded on demand for performance.
|
|
29
|
-
See the [system documentation](https://github.com/ing-bank/lion/blob/
|
|
29
|
+
See the [system documentation](https://github.com/ing-bank/lion/blob/b25478e4cc0cb51c4fda1eccadf5e630b679f53c/docs/fundamentals/systems/icon/overview.md) to learn more about icon sets.
|
|
30
30
|
|
|
31
31
|
```js preview-story
|
|
32
32
|
export const iconSets = () => html`
|
|
@@ -23,7 +23,7 @@ export const main = () => html`<lion-input label="First Name"></lion-input>`;
|
|
|
23
23
|
- **before**: does not have an active use case yet, but the option is in place.
|
|
24
24
|
- **after**: can be used to show a currency or percentage.
|
|
25
25
|
- Delegates attributes like `type`, `disabled`, `placeholder` and `readonly` to the native input.
|
|
26
|
-
- Can make use of [validation](https://github.com/ing-bank/lion/blob/
|
|
26
|
+
- Can make use of [validation](https://github.com/ing-bank/lion/blob/b25478e4cc0cb51c4fda1eccadf5e630b679f53c/docs/fundamentals/systems/form/validate.md).
|
|
27
27
|
|
|
28
28
|
## Installation
|
|
29
29
|
|
|
@@ -49,7 +49,7 @@ export const helpText = () => html`
|
|
|
49
49
|
|
|
50
50
|
```js preview-story
|
|
51
51
|
export const prefilled = () => html`
|
|
52
|
-
<lion-input .modelValue
|
|
52
|
+
<lion-input .modelValue="${'Prefilled value'}" label="Prefilled"></lion-input>
|
|
53
53
|
`;
|
|
54
54
|
```
|
|
55
55
|
|
|
@@ -61,7 +61,7 @@ This field **will still be included** in the parent fieldset or form's `serializ
|
|
|
61
61
|
|
|
62
62
|
```js preview-story
|
|
63
63
|
export const readOnly = () => html`
|
|
64
|
-
<lion-input readonly .modelValue
|
|
64
|
+
<lion-input readonly .modelValue="${'This is read only'}" label="Read only"></lion-input>
|
|
65
65
|
`;
|
|
66
66
|
```
|
|
67
67
|
|
|
@@ -73,6 +73,6 @@ This field **will not be included** in the parent fieldset or form's `serialized
|
|
|
73
73
|
|
|
74
74
|
```js preview-story
|
|
75
75
|
export const disabled = () => html`
|
|
76
|
-
<lion-input disabled .modelValue
|
|
76
|
+
<lion-input disabled .modelValue="${'This is disabled'}" label="Disabled"></lion-input>
|
|
77
77
|
`;
|
|
78
78
|
```
|
|
@@ -24,13 +24,13 @@ export const main = () => {
|
|
|
24
24
|
|
|
25
25
|
## Features
|
|
26
26
|
|
|
27
|
-
- Based on our [input](https://github.com/ing-bank/lion/blob/
|
|
28
|
-
- Makes use of [formatNumber](https://github.com/ing-bank/lion/blob/
|
|
27
|
+
- Based on our [input](https://github.com/ing-bank/lion/blob/b25478e4cc0cb51c4fda1eccadf5e630b679f53c/docs/components/input/overview.md)
|
|
28
|
+
- Makes use of [formatNumber](https://github.com/ing-bank/lion/blob/b25478e4cc0cb51c4fda1eccadf5e630b679f53c/docs/fundamentals/systems/localize/numbers.md) for formatting and parsing.
|
|
29
29
|
- Option to show currency as a suffix
|
|
30
30
|
- Option to override locale to change the formatting and parsing
|
|
31
31
|
- Option to provide additional format options overrides
|
|
32
32
|
- Default label in different languages
|
|
33
|
-
- Can make use of number specific [validators](https://github.com/ing-bank/lion/blob/
|
|
33
|
+
- Can make use of number specific [validators](https://github.com/ing-bank/lion/blob/b25478e4cc0cb51c4fda1eccadf5e630b679f53c/docs/fundamentals/systems/form/validate.md) with corresponding error messages in different languages
|
|
34
34
|
- IsNumber (default)
|
|
35
35
|
- MinNumber
|
|
36
36
|
- MaxNumber
|
|
@@ -16,7 +16,7 @@ It will accept negative numbers with a minus symbol.
|
|
|
16
16
|
|
|
17
17
|
```js preview-story
|
|
18
18
|
export const negativeNumber = () => html`
|
|
19
|
-
<lion-input-amount label="Amount" .modelValue
|
|
19
|
+
<lion-input-amount label="Amount" .modelValue="${-123456.78}"></lion-input-amount>
|
|
20
20
|
`;
|
|
21
21
|
```
|
|
22
22
|
|
|
@@ -26,7 +26,7 @@ You can optionally set a currency label with the `currency` attribute, which is
|
|
|
26
26
|
|
|
27
27
|
```js preview-story
|
|
28
28
|
export const currencySuffix = () => html`
|
|
29
|
-
<lion-input-amount label="Price" currency="USD" .modelValue
|
|
29
|
+
<lion-input-amount label="Price" currency="USD" .modelValue="${123456.78}"></lion-input-amount>
|
|
30
30
|
`;
|
|
31
31
|
```
|
|
32
32
|
|
|
@@ -43,7 +43,7 @@ export const forceLocale = () => {
|
|
|
43
43
|
label="Price"
|
|
44
44
|
currency="JOD"
|
|
45
45
|
.locale="nl-NL"
|
|
46
|
-
.modelValue
|
|
46
|
+
.modelValue="${123456.78}"
|
|
47
47
|
></lion-input-amount>
|
|
48
48
|
`;
|
|
49
49
|
};
|
|
@@ -66,7 +66,7 @@ Separator characters include:
|
|
|
66
66
|
import { preprocessAmount } from '@lion/ui/input-amount.js';
|
|
67
67
|
|
|
68
68
|
export const forceDigits = () => html`
|
|
69
|
-
<lion-input-amount label="Amount" .preprocessor
|
|
69
|
+
<lion-input-amount label="Amount" .preprocessor="${preprocessAmount}"></lion-input-amount>
|
|
70
70
|
`;
|
|
71
71
|
```
|
|
72
72
|
|
|
@@ -81,7 +81,7 @@ export const faultyPrefilled = () => html`
|
|
|
81
81
|
<lion-input-amount
|
|
82
82
|
label="Amount"
|
|
83
83
|
help-text="Faulty prefilled input will cause error feedback"
|
|
84
|
-
.modelValue
|
|
84
|
+
.modelValue="${'foo'}"
|
|
85
85
|
></lion-input-amount>
|
|
86
86
|
`;
|
|
87
87
|
```
|
|
@@ -96,11 +96,11 @@ export const noDecimals = () => html`
|
|
|
96
96
|
<lion-input-amount
|
|
97
97
|
label="Amount"
|
|
98
98
|
help-text="Prefilled and formatted"
|
|
99
|
-
.formatOptions
|
|
99
|
+
.formatOptions="${({
|
|
100
100
|
minimumFractionDigits: 0,
|
|
101
101
|
maximumFractionDigits: 0,
|
|
102
|
-
}}
|
|
103
|
-
.modelValue
|
|
102
|
+
})}"
|
|
103
|
+
.modelValue="${20}"
|
|
104
104
|
>
|
|
105
105
|
</lion-input-amount>
|
|
106
106
|
`;
|
|
@@ -16,11 +16,11 @@ import '@lion/ui/define/lion-input-date.js';
|
|
|
16
16
|
|
|
17
17
|
## Features
|
|
18
18
|
|
|
19
|
-
- Based on our [input](https://github.com/ing-bank/lion/blob/
|
|
20
|
-
- Makes use of [formatDate](https://github.com/ing-bank/lion/blob/
|
|
19
|
+
- Based on our [input](https://github.com/ing-bank/lion/blob/b25478e4cc0cb51c4fda1eccadf5e630b679f53c/docs/components/input/overview.md)
|
|
20
|
+
- Makes use of [formatDate](https://github.com/ing-bank/lion/blob/b25478e4cc0cb51c4fda1eccadf5e630b679f53c/docs/fundamentals/systems/localize/dates.md) for formatting and parsing.
|
|
21
21
|
- Option to override locale to change the formatting and parsing
|
|
22
22
|
- Default label in different languages
|
|
23
|
-
- Can make use of date specific [validators](https://github.com/ing-bank/lion/blob/
|
|
23
|
+
- Can make use of date specific [validators](https://github.com/ing-bank/lion/blob/b25478e4cc0cb51c4fda1eccadf5e630b679f53c/docs/fundamentals/systems/form/validate.md) with corresponding error messages in different languages
|
|
24
24
|
- IsDate (default)
|
|
25
25
|
- MinDate
|
|
26
26
|
- MaxDate
|