@lion/choice-input
Advanced tools
Comparing version 0.8.1 to 0.8.2
@@ -6,2 +6,13 @@ # Change Log | ||
## [0.8.2](https://github.com/ing-bank/lion/compare/@lion/choice-input@0.8.1...@lion/choice-input@0.8.2) (2020-04-29) | ||
### Bug Fixes | ||
* add display:none for hidden ([#692](https://github.com/ing-bank/lion/issues/692)) ([9731771](https://github.com/ing-bank/lion/commit/9731771c23a5ed8661558e62cb5e34b62cc2b8b7)) | ||
## [0.8.1](https://github.com/ing-bank/lion/compare/@lion/choice-input@0.8.0...@lion/choice-input@0.8.1) (2020-04-02) | ||
@@ -8,0 +19,0 @@ |
{ | ||
"name": "@lion/choice-input", | ||
"version": "0.8.1", | ||
"version": "0.8.2", | ||
"description": "Base for all choise inputs like checkbox/radio", | ||
@@ -37,6 +37,6 @@ "author": "ing-bank", | ||
"dependencies": { | ||
"@lion/core": "0.5.1", | ||
"@lion/field": "0.12.1" | ||
"@lion/core": "0.5.2", | ||
"@lion/field": "0.12.2" | ||
}, | ||
"gitHead": "b58aa65377d5e7a0cd4d87917980291c832e7120" | ||
"gitHead": "2476211c21e3f785a909c71e8f94ff307fc6a4fc" | ||
} |
# ChoiceInputMixin | ||
> ## 🛠 Status: Pilot Phase | ||
> Lion Web Components are still in an early alpha stage; they should not be considered production ready yet. | ||
> | ||
> The goal of our pilot phase is to gather feedback from a private group of users. | ||
> Therefore, during this phase, we kindly ask you to: | ||
> - not publicly promote or link us yet: (no tweets, blog posts or other forms of communication about Lion Web Components) | ||
> - not publicly promote or link products derived from/based on Lion Web Components | ||
> | ||
> As soon as Pilot Phase ends we will let you know (feel free to subscribe to this issue https://github.com/ing-bank/lion/issues/1) | ||
`lion-choice-input` mixin is a fundamental building block of form controls which return a checked-state. It is used in: | ||
@@ -14,0 +4,0 @@ |
@@ -97,2 +97,6 @@ /* eslint-disable class-methods-use-this */ | ||
:host([hidden]) { | ||
display: none; | ||
} | ||
.choice-field__graphic-container { | ||
@@ -99,0 +103,0 @@ display: none; |
import { html, LitElement } from '@lion/core'; | ||
import { formFixture as fixture } from '@lion/field/test-helpers.js'; | ||
import { FormGroupMixin } from '@lion/fieldset'; | ||
@@ -7,3 +8,2 @@ import '@lion/fieldset/lion-fieldset.js'; | ||
import { expect, nextFrame } from '@open-wc/testing'; | ||
import { formFixture as fixture } from '@lion/field/test-helpers.js'; | ||
import { ChoiceGroupMixin } from '../src/ChoiceGroupMixin.js'; | ||
@@ -10,0 +10,0 @@ import { ChoiceInputMixin } from '../src/ChoiceInputMixin.js'; |
@@ -19,6 +19,9 @@ import { html } from '@lion/core'; | ||
it('is hidden when attribute hidden is true', async () => { | ||
const el = await fixture(html`<choice-input hidden></choice-input>`); | ||
expect(el).not.to.be.displayed; | ||
}); | ||
it('has choiceValue', async () => { | ||
const el = await fixture(html` | ||
<choice-input .choiceValue=${'foo'}></choice-input> | ||
`); | ||
const el = await fixture(html`<choice-input .choiceValue=${'foo'}></choice-input>`); | ||
@@ -35,5 +38,3 @@ expect(el.choiceValue).to.equal('foo'); | ||
const el = await fixture(html` | ||
<choice-input .choiceValue=${date}></choice-input> | ||
`); | ||
const el = await fixture(html`<choice-input .choiceValue=${date}></choice-input>`); | ||
@@ -132,5 +133,3 @@ expect(el.choiceValue).to.equal(date); | ||
it('synchronizes modelValue to checked state and vice versa', async () => { | ||
const el = await fixture(html` | ||
<choice-input .choiceValue=${'foo'}></choice-input> | ||
`); | ||
const el = await fixture(html`<choice-input .choiceValue=${'foo'}></choice-input>`); | ||
expect(el.checked).to.be.false; | ||
@@ -152,5 +151,3 @@ expect(el.modelValue).to.deep.equal({ | ||
which can be quite common for these type of connected data */ | ||
const el = await fixture(html` | ||
<choice-input .choiceValue=${'foo'}></choice-input> | ||
`); | ||
const el = await fixture(html`<choice-input .choiceValue=${'foo'}></choice-input>`); | ||
expect(el.checked).to.be.false; | ||
@@ -224,5 +221,3 @@ | ||
it('creates a modelValue object like { checked: true, value: foo } on init', async () => { | ||
const el = await fixture(html` | ||
<choice-input .choiceValue=${'foo'}></choice-input> | ||
`); | ||
const el = await fixture(html`<choice-input .choiceValue=${'foo'}></choice-input>`); | ||
expect(el.modelValue).deep.equal({ value: 'foo', checked: false }); | ||
@@ -249,5 +244,3 @@ | ||
it('is considered prefilled when checked and not considered prefilled when unchecked', async () => { | ||
const el = await fixture(html` | ||
<choice-input .checked=${true}></choice-input> | ||
`); | ||
const el = await fixture(html`<choice-input .checked=${true}></choice-input>`); | ||
expect(el.prefilled).equal(true, 'checked element not considered prefilled'); | ||
@@ -254,0 +247,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59363
865
15
+ Added@lion/core@0.5.2(transitive)
+ Added@lion/field@0.12.2(transitive)
+ Added@lion/localize@0.9.2(transitive)
+ Added@lion/validate@0.9.2(transitive)
- Removed@lion/core@0.5.1(transitive)
- Removed@lion/field@0.12.1(transitive)
- Removed@lion/localize@0.9.1(transitive)
- Removed@lion/validate@0.9.1(transitive)
Updated@lion/core@0.5.2
Updated@lion/field@0.12.2