@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
|
@@ -62,10 +62,10 @@ export const withinForm = () => html`
|
|
|
62
62
|
<input id="firstNameId" name="firstName" />
|
|
63
63
|
<label for="lastNameId">Last name</label>
|
|
64
64
|
<input id="lastNameId" name="lastName" />
|
|
65
|
-
<lion-button-submit @click
|
|
65
|
+
<lion-button-submit @click="${ev => console.log('click submit handler', ev.target)}"
|
|
66
66
|
>Submit</lion-button-submit
|
|
67
67
|
>
|
|
68
|
-
<lion-button-reset @click
|
|
68
|
+
<lion-button-reset @click="${ev => console.log('click reset handler', ev.target)}"
|
|
69
69
|
>Reset</lion-button-reset
|
|
70
70
|
>
|
|
71
71
|
</form>
|
|
@@ -21,7 +21,7 @@ export const selectedDate = () => html`
|
|
|
21
21
|
max-width: 500px;
|
|
22
22
|
}
|
|
23
23
|
</style>
|
|
24
|
-
<lion-calendar class="demo-calendar" .selectedDate
|
|
24
|
+
<lion-calendar class="demo-calendar" .selectedDate="${new Date(1988, 2, 5)}"></lion-calendar>
|
|
25
25
|
`;
|
|
26
26
|
```
|
|
27
27
|
|
|
@@ -160,7 +160,7 @@ export const disabledDates = () => html`
|
|
|
160
160
|
</style>
|
|
161
161
|
<lion-calendar
|
|
162
162
|
class="demo-calendar"
|
|
163
|
-
.disableDates
|
|
163
|
+
.disableDates="${day => day.getDay() === 6 || day.getDay() === 0}"
|
|
164
164
|
></lion-calendar>
|
|
165
165
|
`;
|
|
166
166
|
```
|
|
@@ -183,7 +183,7 @@ export const combinedDisabledDates = () => {
|
|
|
183
183
|
</style>
|
|
184
184
|
<lion-calendar
|
|
185
185
|
class="demo-calendar"
|
|
186
|
-
.disableDates
|
|
186
|
+
.disableDates="${day => day.getDay() === 6 || day.getDay() === 0}"
|
|
187
187
|
.minDate="${new Date()}"
|
|
188
188
|
.maxDate="${maxDate}"
|
|
189
189
|
></lion-calendar>
|
|
@@ -215,7 +215,7 @@ export const findingEnabledDates = () => {
|
|
|
215
215
|
</style>
|
|
216
216
|
<lion-calendar
|
|
217
217
|
class="demo-calendar js-calendar"
|
|
218
|
-
.disableDates
|
|
218
|
+
.disableDates="${day => day.getDay() === 6 || day.getDay() === 0}"
|
|
219
219
|
></lion-calendar>
|
|
220
220
|
<button @click="${ev => getCalendar(ev).focusDate(getCalendar(ev).findNextEnabledDate())}">
|
|
221
221
|
focus findNextEnabledDate
|
|
@@ -189,61 +189,55 @@
|
|
|
189
189
|
|
|
190
190
|
### Fields
|
|
191
191
|
|
|
192
|
-
| Name | Privacy | Type | Default
|
|
193
|
-
| ------------------------------------ | --------- | ------------------------------------------------------------------------- |
|
|
194
|
-
| `multipleChoice` | public | `boolean` | `true`
|
|
195
|
-
| `modelValue` | public | |
|
|
196
|
-
| `serializedValue` | public | |
|
|
197
|
-
| `formattedValue` | public | |
|
|
198
|
-
| `operationMode` | public | `OperationMode` |
|
|
199
|
-
| `_repropagationRole` | public | `'child'\|'choice-group'\|'fieldset'` | `'choice-group'`
|
|
200
|
-
| `formElements` | public | `FormControlsCollection` | `new FormControlsCollection()`
|
|
201
|
-
| `_isFormOrFieldset` | protected | `boolean` | `false`
|
|
202
|
-
| `initComplete` | public | `Promise<any>` | `new Promise((resolve, reject) => {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
| `
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
| `
|
|
211
|
-
| `
|
|
212
|
-
| `
|
|
213
|
-
| `
|
|
214
|
-
| `
|
|
215
|
-
| `
|
|
216
|
-
| `
|
|
217
|
-
| `
|
|
218
|
-
| `
|
|
219
|
-
| `
|
|
220
|
-
| `
|
|
221
|
-
| `
|
|
222
|
-
| `
|
|
223
|
-
| `
|
|
224
|
-
| `
|
|
225
|
-
| `
|
|
226
|
-
| `
|
|
227
|
-
| `
|
|
228
|
-
| `
|
|
229
|
-
| `
|
|
230
|
-
| `
|
|
231
|
-
| `
|
|
232
|
-
| `
|
|
233
|
-
| `
|
|
234
|
-
| `
|
|
235
|
-
| `
|
|
236
|
-
| `
|
|
237
|
-
| `
|
|
238
|
-
| `
|
|
239
|
-
| `
|
|
240
|
-
| `
|
|
241
|
-
| `labelSrOnly` | public | `boolean` | `false` | The label will only be visible for srceen readers when true | FormControlMixin |
|
|
242
|
-
| `_inputId` | protected | `string` | | Unique id that can be used in all light dom | FormControlMixin |
|
|
243
|
-
| `_ariaLabelledNodes` | public | `HTMLElement[]` | `[]` | Contains all elements that should end up in aria-labelledby of \`.\_inputNode\` | FormControlMixin |
|
|
244
|
-
| `_ariaDescribedNodes` | public | `HTMLElement[]` | `[]` | Contains all elements that should end up in aria-describedby of \`.\_inputNode\` | FormControlMixin |
|
|
245
|
-
| `_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 |
|
|
246
|
-
| `_requestedToBeDisabled` | protected | `boolean` | `false` | | DisabledMixin |
|
|
192
|
+
| Name | Privacy | Type | Default | Description | Inherited From |
|
|
193
|
+
| ------------------------------------ | --------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- |
|
|
194
|
+
| `multipleChoice` | public | `boolean` | `true` | When false (default), modelValue and serializedValue will reflect the
currently selected choice (usually a string). When true, modelValue will and
serializedValue will be an array of strings. | ChoiceGroupMixin |
|
|
195
|
+
| `modelValue` | public | | | Object keyed by formElements names, containing formElements' modelValues | FormControlMixin |
|
|
196
|
+
| `serializedValue` | public | | | Object keyed by formElements names, containing formElements' serializedValues | FormGroupMixin |
|
|
197
|
+
| `formattedValue` | public | | | Object keyed by formElements names, containing formElements' formattedValues | FormGroupMixin |
|
|
198
|
+
| `operationMode` | public | `OperationMode` | | Types of input interaction of the FormControl (for instance 'enter'\|'select'\|'upload') | ValidateMixin |
|
|
199
|
+
| `_repropagationRole` | public | `'child'\|'choice-group'\|'fieldset'` | `'choice-group'` | Based on the role, details of handling model-value-changed repropagation differ. | FormControlMixin |
|
|
200
|
+
| `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 |
|
|
201
|
+
| `_isFormOrFieldset` | protected | `boolean` | `false` | 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 |
|
|
202
|
+
| `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 |
|
|
203
|
+
| `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 |
|
|
204
|
+
| `done` | public | `boolean` | `false` | | FormRegistrarMixin |
|
|
205
|
+
| `_allValidators` | protected | `Validator[]` | | Combination of validators provided by Application Developer and the default validators | ValidateMixin |
|
|
206
|
+
| `_feedbackConditionMeta` | protected | | | Allows Subclassers to add meta info for feedbackCondition | ValidateMixin |
|
|
207
|
+
| `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 |
|
|
208
|
+
| `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 |
|
|
209
|
+
| `validationStates` | public | `ValidationStates` | `{}` | The outcome of a validation 'round'. Keyed by ValidationType and Validator name | ValidateMixin |
|
|
210
|
+
| `isPending` | public | `boolean` | `false` | Flag indicating whether async validation is pending.
Creates attribute \[is-pending] as a styling hook | ValidateMixin |
|
|
211
|
+
| `validators` | public | `Validator[]` | `[]` | Used by Application Developers to add Validators to a FormControl. | ValidateMixin |
|
|
212
|
+
| `defaultValidators` | public | `Validator[]` | `[]` | Used by Subclassers to add default Validators to a particular FormControl.
A date input for instance, always needs the isDate validator. | ValidateMixin |
|
|
213
|
+
| `_visibleMessagesAmount` | protected | `number` | `1` | The amount of feedback messages that will visible in LionValidationFeedback | ValidateMixin |
|
|
214
|
+
| `touched` | public | `boolean` | `false` | True when user has focused and left(blurred) the field. | FormGroupMixin |
|
|
215
|
+
| `dirty` | public | `boolean` | `false` | True when user has changed the value of the field. | FormGroupMixin |
|
|
216
|
+
| `prefilled` | public | `boolean` | `false` | True when user has left non-empty field or input is prefilled.
The name must be seen from the point of view of the input field:
once the user enters the input field, the value is non-empty. | FormGroupMixin |
|
|
217
|
+
| `filled` | public | `boolean` | `false` | True when the modelValue is non-empty (see \_isEmpty in FormControlMixin) | InteractionStateMixin |
|
|
218
|
+
| `_leaveEvent` | protected | `string` | `'blur'` | The event that triggers the touched state | InteractionStateMixin |
|
|
219
|
+
| `_valueChangedEvent` | protected | `string` | `'model-value-changed'` | The event that triggers the dirty state | InteractionStateMixin |
|
|
220
|
+
| `submitted` | public | `boolean` | `false` | True when parent form is submitted | FormGroupMixin |
|
|
221
|
+
| `_inputNode` | protected | | | The host element with role group (or radio-group or form) containing necessary aria attributes | FormControlMixin |
|
|
222
|
+
| `_initialModelValue` | protected | | | Gathers initial model values of all children. Used when resetGroup() is called. | FormGroupMixin |
|
|
223
|
+
| `value` | public | `string` | `''` | | FormGroupMixin |
|
|
224
|
+
| `disabled` | public | `boolean` | `false` | Disables all formElements in group | DisabledMixin |
|
|
225
|
+
| `focused` | public | `boolean` | `false` | True when any of the children is focused. | FormGroupMixin |
|
|
226
|
+
| `__descriptionElementsInParentChain` | protected | | `new Set()` | | FormGroupMixin |
|
|
227
|
+
| `__pendingValues` | protected | `{modelValue?:{[key:string]: any}, serializedValue?:{[key:string]: any}}` | `{ modelValue: {}, serializedValue: {} }` | | FormGroupMixin |
|
|
228
|
+
| `label` | public | `string` | `''` | The label text for the input node.
When no value is defined, textContent of \[slot=label] will be used | FormControlMixin |
|
|
229
|
+
| `helpText` | public | `string` | `''` | The helpt text for the input node.
When no value is defined, textContent of \[slot=help-text] will be used | FormControlMixin |
|
|
230
|
+
| `fieldName` | public | `string` | | Will be used in validation messages to refer to the current field | FormControlMixin |
|
|
231
|
+
| `_labelNode` | protected | | | Element where label will be rendered to | FormControlMixin |
|
|
232
|
+
| `_helpTextNode` | protected | | | Element where help text will be rendered to | FormControlMixin |
|
|
233
|
+
| `_feedbackNode` | protected | | | Element where validation feedback will be rendered to | FormControlMixin |
|
|
234
|
+
| `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 |
|
|
235
|
+
| `labelSrOnly` | public | `boolean` | `false` | The label will only be visible for srceen readers when true | FormControlMixin |
|
|
236
|
+
| `_inputId` | protected | `string` | | Unique id that can be used in all light dom | FormControlMixin |
|
|
237
|
+
| `_ariaLabelledNodes` | public | `HTMLElement[]` | `[]` | Contains all elements that should end up in aria-labelledby of \`.\_inputNode\` | FormControlMixin |
|
|
238
|
+
| `_ariaDescribedNodes` | public | `HTMLElement[]` | `[]` | Contains all elements that should end up in aria-describedby of \`.\_inputNode\` | FormControlMixin |
|
|
239
|
+
| `_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 |
|
|
240
|
+
| `_requestedToBeDisabled` | protected | `boolean` | `false` | | DisabledMixin |
|
|
247
241
|
|
|
248
242
|
### Methods
|
|
249
243
|
|
|
@@ -13,17 +13,17 @@ import '@lion/ui/define/lion-checkbox.js';
|
|
|
13
13
|
|
|
14
14
|
```html preview-story
|
|
15
15
|
<lion-checkbox-group name="scientists[]" label="Favorite scientists">
|
|
16
|
-
<lion-checkbox label="Archimedes" .choiceValue
|
|
17
|
-
<lion-checkbox label="Francis Bacon" .choiceValue
|
|
18
|
-
<lion-checkbox label="Marie Curie" .choiceValue
|
|
16
|
+
<lion-checkbox label="Archimedes" .choiceValue="${'Archimedes'}"></lion-checkbox>
|
|
17
|
+
<lion-checkbox label="Francis Bacon" .choiceValue="${'Francis Bacon'}"></lion-checkbox>
|
|
18
|
+
<lion-checkbox label="Marie Curie" .choiceValue="${'Marie Curie'}"></lion-checkbox>
|
|
19
19
|
</lion-checkbox-group>
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
> Make sure that the checkbox-group also has a name attribute, this is necessary for our [form](https://github.com/ing-bank/lion/blob/
|
|
22
|
+
> Make sure that the checkbox-group also has a name attribute, this is necessary for our [form](https://github.com/ing-bank/lion/blob/b25478e4cc0cb51c4fda1eccadf5e630b679f53c/docs/components/form/overview.md)'s serialization result.
|
|
23
23
|
|
|
24
24
|
## Features
|
|
25
25
|
|
|
26
|
-
Since it extends from our [fieldset](https://github.com/ing-bank/lion/blob/
|
|
26
|
+
Since it extends from our [fieldset](https://github.com/ing-bank/lion/blob/b25478e4cc0cb51c4fda1eccadf5e630b679f53c/docs/components/fieldset/overview.md),
|
|
27
27
|
it has all the features a fieldset has.
|
|
28
28
|
|
|
29
29
|
## Installation
|
|
@@ -35,9 +35,9 @@ Our recommendation would be to set the `name` attribute only on the `lion-checkb
|
|
|
35
35
|
name="scientists[]"
|
|
36
36
|
label="Favorite scientists"
|
|
37
37
|
>
|
|
38
|
-
<lion-checkbox label="Archimedes" .choiceValue
|
|
39
|
-
<lion-checkbox label="Francis Bacon" .choiceValue
|
|
40
|
-
<lion-checkbox label="Marie Curie" .choiceValue
|
|
38
|
+
<lion-checkbox label="Archimedes" .choiceValue="${'Archimedes'}"></lion-checkbox>
|
|
39
|
+
<lion-checkbox label="Francis Bacon" .choiceValue="${'Francis Bacon'}"></lion-checkbox>
|
|
40
|
+
<lion-checkbox label="Marie Curie" .choiceValue="${'Marie Curie'}"></lion-checkbox>
|
|
41
41
|
</lion-checkbox-group>
|
|
42
42
|
```
|
|
43
43
|
|
|
@@ -47,9 +47,9 @@ You can pre-select options by targeting the `modelValue` object of the option an
|
|
|
47
47
|
|
|
48
48
|
```html preview-story
|
|
49
49
|
<lion-checkbox-group name="scientists" label="Favorite scientists">
|
|
50
|
-
<lion-checkbox label="Archimedes" .choiceValue
|
|
51
|
-
<lion-checkbox label="Francis Bacon" .choiceValue
|
|
52
|
-
<lion-checkbox label="Marie Curie" .choiceValue
|
|
50
|
+
<lion-checkbox label="Archimedes" .choiceValue="${'Archimedes'}"></lion-checkbox>
|
|
51
|
+
<lion-checkbox label="Francis Bacon" .choiceValue="${'Francis Bacon'}" checked></lion-checkbox>
|
|
52
|
+
<lion-checkbox label="Marie Curie" .choiceValue="${'Marie Curie'}"></lion-checkbox>
|
|
53
53
|
</lion-checkbox-group>
|
|
54
54
|
```
|
|
55
55
|
|
|
@@ -59,9 +59,9 @@ You can disable the entire group by setting the `disabled` attribute on the `<li
|
|
|
59
59
|
|
|
60
60
|
```html preview-story
|
|
61
61
|
<lion-checkbox-group name="scientists[]" label="Favorite scientists" disabled>
|
|
62
|
-
<lion-checkbox label="Archimedes" .choiceValue
|
|
63
|
-
<lion-checkbox label="Francis Bacon" .choiceValue
|
|
64
|
-
<lion-checkbox label="Marie Curie" .choiceValue
|
|
62
|
+
<lion-checkbox label="Archimedes" .choiceValue="${'Archimedes'}"></lion-checkbox>
|
|
63
|
+
<lion-checkbox label="Francis Bacon" .choiceValue="${'Francis Bacon'}"></lion-checkbox>
|
|
64
|
+
<lion-checkbox label="Marie Curie" .choiceValue="${'Marie Curie'}"></lion-checkbox>
|
|
65
65
|
</lion-checkbox-group>
|
|
66
66
|
```
|
|
67
67
|
|
|
@@ -71,17 +71,17 @@ You can use `slot="label"` instead of the `label` attribute for defining more co
|
|
|
71
71
|
|
|
72
72
|
```html preview-story
|
|
73
73
|
<lion-checkbox-group name="scientists[]" label="Favorite scientists">
|
|
74
|
-
<lion-checkbox .choiceValue
|
|
74
|
+
<lion-checkbox .choiceValue="${'Archimedes'}">
|
|
75
75
|
<label slot="label"
|
|
76
76
|
><a href="https://wikipedia.org/wiki/Archimedes" target="_blank">Archimedes</a></label
|
|
77
77
|
>
|
|
78
78
|
</lion-checkbox>
|
|
79
|
-
<lion-checkbox .choiceValue
|
|
79
|
+
<lion-checkbox .choiceValue="${'Francis Bacon'}">
|
|
80
80
|
<label slot="label"
|
|
81
81
|
><a href="https://wikipedia.org/wiki/Francis_Bacon" target="_blank">Francis Bacon</a></label
|
|
82
82
|
>
|
|
83
83
|
</lion-checkbox>
|
|
84
|
-
<lion-checkbox .choiceValue
|
|
84
|
+
<lion-checkbox .choiceValue="${'Marie Curie'}">
|
|
85
85
|
<label slot="label"
|
|
86
86
|
><a href="https://wikipedia.org/wiki/Marie_Curie" target="_blank">Marie Curie</a></label
|
|
87
87
|
>
|
|
@@ -97,17 +97,17 @@ You can add help text on each checkbox with `help-text` attribute on the `<lion-
|
|
|
97
97
|
<lion-checkbox-group name="scientists[]" label="Favorite scientists">
|
|
98
98
|
<lion-checkbox
|
|
99
99
|
label="Archimedes"
|
|
100
|
-
.choiceValue
|
|
100
|
+
.choiceValue="${'Archimedes'}"
|
|
101
101
|
help-text="Archimedes of Syracuse was a Greek mathematician, physicist, engineer, inventor, and astronomer"
|
|
102
102
|
></lion-checkbox>
|
|
103
103
|
<lion-checkbox
|
|
104
104
|
label="Francis Bacon"
|
|
105
|
-
.choiceValue
|
|
105
|
+
.choiceValue="${'Francis Bacon'}"
|
|
106
106
|
help-text="Francis Bacon, 1st Viscount St Alban also known as Lord Verulam, was an English philosopher and statesman who served as Attorney General and as Lord Chancellor of England"
|
|
107
107
|
></lion-checkbox>
|
|
108
108
|
<lion-checkbox
|
|
109
109
|
label="Marie Curie"
|
|
110
|
-
.choiceValue
|
|
110
|
+
.choiceValue="${'Marie Curie'}"
|
|
111
111
|
help-text="Marie Skłodowska Curie born Maria Salomea Skłodowska, was a Polish and naturalized-French physicist and chemist who conducted pioneering research on radioactivity"
|
|
112
112
|
></lion-checkbox>
|
|
113
113
|
</lion-checkbox-group>
|
|
@@ -129,9 +129,9 @@ export const event = ({ shadowRoot }) => html`
|
|
|
129
129
|
4,
|
|
130
130
|
))}
|
|
131
131
|
>
|
|
132
|
-
<lion-checkbox label="Archimedes" .choiceValue
|
|
133
|
-
<lion-checkbox label="Francis Bacon" .choiceValue
|
|
134
|
-
<lion-checkbox label="Marie Curie" .choiceValue
|
|
132
|
+
<lion-checkbox label="Archimedes" .choiceValue="${'Archimedes'}"></lion-checkbox>
|
|
133
|
+
<lion-checkbox label="Francis Bacon" .choiceValue="${'Francis Bacon'}"></lion-checkbox>
|
|
134
|
+
<lion-checkbox label="Marie Curie" .choiceValue="${'Marie Curie'}"></lion-checkbox>
|
|
135
135
|
</lion-checkbox-group>
|
|
136
136
|
<br />
|
|
137
137
|
<span>Selected scientists: <strong id="selectedDinosaur">N/A</strong></span>
|
|
@@ -147,22 +147,22 @@ A `checkbox-indeterminate`'s value is neither true nor false, but is instead ind
|
|
|
147
147
|
<lion-checkbox-indeterminate label="Old Greek scientists">
|
|
148
148
|
<lion-checkbox
|
|
149
149
|
label="Archimedes"
|
|
150
|
-
.choiceValue
|
|
150
|
+
.choiceValue="${'Archimedes'}"
|
|
151
151
|
></lion-checkbox>
|
|
152
|
-
<lion-checkbox label="Plato" .choiceValue
|
|
152
|
+
<lion-checkbox label="Plato" .choiceValue="${'Plato'}"></lion-checkbox>
|
|
153
153
|
<lion-checkbox
|
|
154
154
|
label="Pythagoras"
|
|
155
|
-
.choiceValue
|
|
155
|
+
.choiceValue="${'Pythagoras'}"
|
|
156
156
|
></lion-checkbox>
|
|
157
157
|
</lion-checkbox-indeterminate>
|
|
158
158
|
<lion-checkbox-indeterminate label="17th Century scientists">
|
|
159
159
|
<lion-checkbox
|
|
160
160
|
label="Isaac Newton"
|
|
161
|
-
.choiceValue
|
|
161
|
+
.choiceValue="${'Isaac Newton'}"
|
|
162
162
|
></lion-checkbox>
|
|
163
163
|
<lion-checkbox
|
|
164
164
|
label="Galileo Galilei"
|
|
165
|
-
.choiceValue
|
|
165
|
+
.choiceValue="${'Galileo Galilei'}"
|
|
166
166
|
></lion-checkbox>
|
|
167
167
|
</lion-checkbox-indeterminate>
|
|
168
168
|
</lion-checkbox-group>
|
|
@@ -175,21 +175,21 @@ The `checkbox-indeterminate` can have another `checkbox-indeterminate` as a chil
|
|
|
175
175
|
<lion-checkbox-indeterminate label="Scientists">
|
|
176
176
|
<lion-checkbox
|
|
177
177
|
label="Isaac Newton"
|
|
178
|
-
.choiceValue
|
|
178
|
+
.choiceValue="${'Isaac Newton'}"
|
|
179
179
|
></lion-checkbox>
|
|
180
180
|
<lion-checkbox
|
|
181
181
|
label="Galileo Galilei"
|
|
182
|
-
.choiceValue
|
|
182
|
+
.choiceValue="${'Galileo Galilei'}"
|
|
183
183
|
></lion-checkbox>
|
|
184
184
|
<lion-checkbox-indeterminate label="Old Greek scientists">
|
|
185
185
|
<lion-checkbox
|
|
186
186
|
label="Archimedes"
|
|
187
|
-
.choiceValue
|
|
187
|
+
.choiceValue="${'Archimedes'}"
|
|
188
188
|
></lion-checkbox>
|
|
189
|
-
<lion-checkbox label="Plato" .choiceValue
|
|
189
|
+
<lion-checkbox label="Plato" .choiceValue="${'Plato'}"></lion-checkbox>
|
|
190
190
|
<lion-checkbox
|
|
191
191
|
label="Pythagoras"
|
|
192
|
-
.choiceValue
|
|
192
|
+
.choiceValue="${'Pythagoras'}"
|
|
193
193
|
></lion-checkbox>
|
|
194
194
|
</lion-checkbox-indeterminate>
|
|
195
195
|
</lion-checkbox-indeterminate>
|
|
@@ -203,21 +203,21 @@ You can also use `mixed-state` attribute so your indeterminate checkbox toggles
|
|
|
203
203
|
<lion-checkbox-indeterminate mixed-state label="Scientists">
|
|
204
204
|
<lion-checkbox
|
|
205
205
|
label="Isaac Newton"
|
|
206
|
-
.choiceValue
|
|
206
|
+
.choiceValue="${'Isaac Newton'}"
|
|
207
207
|
></lion-checkbox>
|
|
208
208
|
<lion-checkbox
|
|
209
209
|
label="Galileo Galilei"
|
|
210
|
-
.choiceValue
|
|
210
|
+
.choiceValue="${'Galileo Galilei'}"
|
|
211
211
|
></lion-checkbox>
|
|
212
212
|
<lion-checkbox-indeterminate mixed-state label="Old Greek scientists">
|
|
213
213
|
<lion-checkbox
|
|
214
214
|
label="Archimedes"
|
|
215
|
-
.choiceValue
|
|
215
|
+
.choiceValue="${'Archimedes'}"
|
|
216
216
|
></lion-checkbox>
|
|
217
|
-
<lion-checkbox label="Plato" .choiceValue
|
|
217
|
+
<lion-checkbox label="Plato" .choiceValue="${'Plato'}"></lion-checkbox>
|
|
218
218
|
<lion-checkbox
|
|
219
219
|
label="Pythagoras"
|
|
220
|
-
.choiceValue
|
|
220
|
+
.choiceValue="${'Pythagoras'}"
|
|
221
221
|
></lion-checkbox>
|
|
222
222
|
</lion-checkbox-indeterminate>
|
|
223
223
|
</lion-checkbox-indeterminate>
|
|
@@ -22,7 +22,7 @@ export const main = () => html`
|
|
|
22
22
|
## Features
|
|
23
23
|
|
|
24
24
|
- Use `opened` attribute or `toggle()` method to render default open.
|
|
25
|
-
- `invoker` slot can be custom template e.g. our [button](https://github.com/ing-bank/lion/blob/
|
|
25
|
+
- `invoker` slot can be custom template e.g. our [button](https://github.com/ing-bank/lion/blob/b25478e4cc0cb51c4fda1eccadf5e630b679f53c/docs/components/button/overview.md) or native `button` with custom styling.
|
|
26
26
|
- Observe the state with the help of `@opened-changed` event.
|
|
27
27
|
- `show()` and `hide()` are helper methods to hide or show the content from outside.
|
|
28
28
|
|
|
@@ -39,13 +39,13 @@ export const methods = ({ shadowRoot }) => html`
|
|
|
39
39
|
</div>
|
|
40
40
|
</lion-collapsible>
|
|
41
41
|
<section style="margin-top:16px">
|
|
42
|
-
<button @click
|
|
42
|
+
<button @click="${() => shadowRoot.querySelector('#car-collapsible').toggle()}">
|
|
43
43
|
Toggle content
|
|
44
44
|
</button>
|
|
45
|
-
<button @click
|
|
45
|
+
<button @click="${() => shadowRoot.querySelector('#car-collapsible').show()}">
|
|
46
46
|
Show content
|
|
47
47
|
</button>
|
|
48
|
-
<button @click
|
|
48
|
+
<button @click="${() => shadowRoot.querySelector('#car-collapsible').hide()}">
|
|
49
49
|
Hide content
|
|
50
50
|
</button>
|
|
51
51
|
</section>
|