Skip to content

Commit

Permalink
Merge branch 'v3.6.0-dev' of github.com:ec-europa/europa-component-li…
Browse files Browse the repository at this point in the history
…brary into v3.6.0-dev
  • Loading branch information
planctus committed Nov 28, 2022
2 parents 272b6fd + 709c5d8 commit 32306ae
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 72 deletions.
20 changes: 6 additions & 14 deletions src/implementations/twig/components/rating-field/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,25 @@ npm install --save @ecl/twig-component-rating-field

### Parameters:

- **"items"** (array) (default: [])
- "id" (string) (default: '')
- "name" (string) (default: '')
- "value" (string) (default: '')
- "disabled" (boolean) (default: false)
- "checked" (boolean) (default: false)
- "required" (boolean) (default: false)
- "helper_id" (string) (default: '')
- "helper_text" (block) (default: '')
- "label" (block) (default: '')
- **"id"** (string) (default: 'rating'): unique id for the rating field
- **"items"** (array) (default: []): array of radio_button
- **"name"** (string) (default: '')
- **"helper_id"** (string) (default: '')
- **"invalid"** (boolean) (default: false)
- **"invalid_icon"** (object) default({})
- **"star_filled_icon"** (object) default({})
- **"star_outline_icon"** (object) default({})
- **"required"** (boolean) (default: false)
- **"extra_classes"** (optional) (string) (default: '') Extra classes (space separated)
- **"extra_attributes"** (optional) (array) (default: []) Extra attributes
- **"extra_classes"** (optional) (string) (default: '')
- **"extra_attributes"** (optional) (array) (default: [])
- "name" (string) Attribute name, eg. 'data-test'
- "value" (string) Attribute value, eg: 'data-test-1'
- "value" (optional) (string) Attribute value, eg: 'data-test-1'

### Blocks:

- "label"
- "helper_text"
- "invalid_text"
- "label"
- "optional_text"
- "required_text"

Expand All @@ -44,6 +35,7 @@ npm install --save @ecl/twig-component-rating-field
<!-- prettier-ignore -->
```twig
{% include '@ecl/rating-field/rating-field.html.twig' with {
id: 'rating-id',
label: 'Please rate',
helper_id: 'rating-default-helper',
helper_text: 'Helper text for the group',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`Rating field Default renders correctly 1`] = `
<jest>
<fieldset
aria-describedby="helper-id-1"
aria-describedby="helper-id"
class="ecl-form-group"
>
<legend
Expand All @@ -18,7 +18,7 @@ exports[`Rating field Default renders correctly 1`] = `
</legend>
<div
class="ecl-help-block"
id="helper-id-1"
id="helper-id"
>
This is the group's helper text.
</div>
Expand All @@ -27,15 +27,15 @@ exports[`Rating field Default renders correctly 1`] = `
>
<input
class="ecl-rating-field__input"
id="rating-5"
name="rating"
id="rating-field-5"
name="rating-group"
required=""
type="radio"
value="5"
/>
<label
class="ecl-rating-field__label"
for="rating-5"
for="rating-field-5"
>
<span
class="ecl-u-sr-only"
Expand Down Expand Up @@ -63,15 +63,15 @@ exports[`Rating field Default renders correctly 1`] = `
</label>
<input
class="ecl-rating-field__input"
id="rating-4"
name="rating"
id="rating-field-4"
name="rating-group"
required=""
type="radio"
value="4"
/>
<label
class="ecl-rating-field__label"
for="rating-4"
for="rating-field-4"
>
<span
class="ecl-u-sr-only"
Expand Down Expand Up @@ -99,15 +99,15 @@ exports[`Rating field Default renders correctly 1`] = `
</label>
<input
class="ecl-rating-field__input"
id="rating-3"
name="rating"
id="rating-field-3"
name="rating-group"
required=""
type="radio"
value="3"
/>
<label
class="ecl-rating-field__label"
for="rating-3"
for="rating-field-3"
>
<span
class="ecl-u-sr-only"
Expand Down Expand Up @@ -135,15 +135,15 @@ exports[`Rating field Default renders correctly 1`] = `
</label>
<input
class="ecl-rating-field__input"
id="rating-2"
name="rating"
id="rating-field-2"
name="rating-group"
required=""
type="radio"
value="2"
/>
<label
class="ecl-rating-field__label"
for="rating-2"
for="rating-field-2"
>
<span
class="ecl-u-sr-only"
Expand Down Expand Up @@ -171,15 +171,15 @@ exports[`Rating field Default renders correctly 1`] = `
</label>
<input
class="ecl-rating-field__input"
id="rating-1"
name="rating"
id="rating-field-1"
name="rating-group"
required=""
type="radio"
value="1"
/>
<label
class="ecl-rating-field__label"
for="rating-1"
for="rating-field-1"
>
<span
class="ecl-u-sr-only"
Expand Down Expand Up @@ -213,7 +213,7 @@ exports[`Rating field Default renders correctly 1`] = `
exports[`Rating field Default renders correctly with extra attributes 1`] = `
<jest>
<fieldset
aria-describedby="helper-id-1"
aria-describedby="helper-id"
class="ecl-form-group"
data-test="data-test-value"
data-test-1="data-test-value-1"
Expand All @@ -230,7 +230,7 @@ exports[`Rating field Default renders correctly with extra attributes 1`] = `
</legend>
<div
class="ecl-help-block"
id="helper-id-1"
id="helper-id"
>
This is the group's helper text.
</div>
Expand All @@ -239,15 +239,15 @@ exports[`Rating field Default renders correctly with extra attributes 1`] = `
>
<input
class="ecl-rating-field__input"
id="rating-5"
name="rating"
id="rating-field-5"
name="rating-group"
required=""
type="radio"
value="5"
/>
<label
class="ecl-rating-field__label"
for="rating-5"
for="rating-field-5"
>
<span
class="ecl-u-sr-only"
Expand Down Expand Up @@ -275,15 +275,15 @@ exports[`Rating field Default renders correctly with extra attributes 1`] = `
</label>
<input
class="ecl-rating-field__input"
id="rating-4"
name="rating"
id="rating-field-4"
name="rating-group"
required=""
type="radio"
value="4"
/>
<label
class="ecl-rating-field__label"
for="rating-4"
for="rating-field-4"
>
<span
class="ecl-u-sr-only"
Expand Down Expand Up @@ -311,15 +311,15 @@ exports[`Rating field Default renders correctly with extra attributes 1`] = `
</label>
<input
class="ecl-rating-field__input"
id="rating-3"
name="rating"
id="rating-field-3"
name="rating-group"
required=""
type="radio"
value="3"
/>
<label
class="ecl-rating-field__label"
for="rating-3"
for="rating-field-3"
>
<span
class="ecl-u-sr-only"
Expand Down Expand Up @@ -347,15 +347,15 @@ exports[`Rating field Default renders correctly with extra attributes 1`] = `
</label>
<input
class="ecl-rating-field__input"
id="rating-2"
name="rating"
id="rating-field-2"
name="rating-group"
required=""
type="radio"
value="2"
/>
<label
class="ecl-rating-field__label"
for="rating-2"
for="rating-field-2"
>
<span
class="ecl-u-sr-only"
Expand Down Expand Up @@ -383,15 +383,15 @@ exports[`Rating field Default renders correctly with extra attributes 1`] = `
</label>
<input
class="ecl-rating-field__input"
id="rating-1"
name="rating"
id="rating-field-1"
name="rating-group"
required=""
type="radio"
value="1"
/>
<label
class="ecl-rating-field__label"
for="rating-1"
for="rating-field-1"
>
<span
class="ecl-u-sr-only"
Expand Down Expand Up @@ -425,7 +425,7 @@ exports[`Rating field Default renders correctly with extra attributes 1`] = `
exports[`Rating field Default renders correctly with extra class names 1`] = `
<jest>
<fieldset
aria-describedby="helper-id-1"
aria-describedby="helper-id"
class="ecl-form-group custom-class custom-class--test"
>
<legend
Expand All @@ -440,7 +440,7 @@ exports[`Rating field Default renders correctly with extra class names 1`] = `
</legend>
<div
class="ecl-help-block"
id="helper-id-1"
id="helper-id"
>
This is the group's helper text.
</div>
Expand All @@ -449,15 +449,15 @@ exports[`Rating field Default renders correctly with extra class names 1`] = `
>
<input
class="ecl-rating-field__input"
id="rating-5"
name="rating"
id="rating-field-5"
name="rating-group"
required=""
type="radio"
value="5"
/>
<label
class="ecl-rating-field__label"
for="rating-5"
for="rating-field-5"
>
<span
class="ecl-u-sr-only"
Expand Down Expand Up @@ -485,15 +485,15 @@ exports[`Rating field Default renders correctly with extra class names 1`] = `
</label>
<input
class="ecl-rating-field__input"
id="rating-4"
name="rating"
id="rating-field-4"
name="rating-group"
required=""
type="radio"
value="4"
/>
<label
class="ecl-rating-field__label"
for="rating-4"
for="rating-field-4"
>
<span
class="ecl-u-sr-only"
Expand Down Expand Up @@ -521,15 +521,15 @@ exports[`Rating field Default renders correctly with extra class names 1`] = `
</label>
<input
class="ecl-rating-field__input"
id="rating-3"
name="rating"
id="rating-field-3"
name="rating-group"
required=""
type="radio"
value="3"
/>
<label
class="ecl-rating-field__label"
for="rating-3"
for="rating-field-3"
>
<span
class="ecl-u-sr-only"
Expand Down Expand Up @@ -557,15 +557,15 @@ exports[`Rating field Default renders correctly with extra class names 1`] = `
</label>
<input
class="ecl-rating-field__input"
id="rating-2"
name="rating"
id="rating-field-2"
name="rating-group"
required=""
type="radio"
value="2"
/>
<label
class="ecl-rating-field__label"
for="rating-2"
for="rating-field-2"
>
<span
class="ecl-u-sr-only"
Expand Down Expand Up @@ -593,15 +593,15 @@ exports[`Rating field Default renders correctly with extra class names 1`] = `
</label>
<input
class="ecl-rating-field__input"
id="rating-1"
name="rating"
id="rating-field-1"
name="rating-group"
required=""
type="radio"
value="1"
/>
<label
class="ecl-rating-field__label"
for="rating-1"
for="rating-field-1"
>
<span
class="ecl-u-sr-only"
Expand Down
Loading

0 comments on commit 32306ae

Please sign in to comment.