@1024pix/pix-ui 45.5.1 → 45.5.2
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/addon/components/pix-checkbox.hbs +13 -11
- package/addon/components/pix-label.hbs +12 -6
- package/addon/components/pix-label.js +2 -2
- package/addon/components/pix-radio-button.hbs +13 -10
- package/app/stories/pix-checkbox.stories.js +2 -0
- package/app/stories/pix-radio-button.stories.js +1 -0
- package/package.json +1 -1
|
@@ -2,22 +2,24 @@
|
|
|
2
2
|
<PixLabel
|
|
3
3
|
@for={{this.id}}
|
|
4
4
|
@requiredLabel={{@requiredLabel}}
|
|
5
|
+
@subLabel={{@subLabel}}
|
|
5
6
|
@size={{@size}}
|
|
6
7
|
@inlineLabel={{true}}
|
|
7
8
|
@screenReaderOnly={{@screenReaderOnly}}
|
|
8
9
|
@isDisabled={{this.isDisabled}}
|
|
9
10
|
@wrappedElement={{true}}
|
|
10
11
|
>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
<:inputElement>
|
|
13
|
+
<input
|
|
14
|
+
type="checkbox"
|
|
15
|
+
id={{this.id}}
|
|
16
|
+
class={{this.inputClasses}}
|
|
17
|
+
checked={{@checked}}
|
|
18
|
+
aria-disabled={{this.isDisabled}}
|
|
19
|
+
{{on "click" this.avoidCheckedStateChangeIfIsDisabled}}
|
|
20
|
+
...attributes
|
|
21
|
+
/>
|
|
22
|
+
</:inputElement>
|
|
23
|
+
<:default>{{yield to="label"}}</:default>
|
|
22
24
|
</PixLabel>
|
|
23
25
|
</div>
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
<label for={{@for}} class={{this.className}} ...attributes>
|
|
2
|
-
{{#if
|
|
3
|
-
|
|
2
|
+
{{#if (has-block "inputElement")}}
|
|
3
|
+
{{yield to="inputElement"}}
|
|
4
4
|
{{/if}}
|
|
5
5
|
|
|
6
|
-
{{
|
|
6
|
+
<span class={{if @screenReaderOnly "screen-reader-only"}}>
|
|
7
|
+
{{#if @requiredLabel}}
|
|
8
|
+
<abbr title={{@requiredLabel}} class="mandatory-mark">*</abbr>
|
|
9
|
+
{{/if}}
|
|
7
10
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
{{yield}}
|
|
12
|
+
|
|
13
|
+
{{#if @subLabel}}
|
|
14
|
+
<span class="pix-label__sub-label">{{@subLabel}}</span>
|
|
15
|
+
{{/if}}
|
|
16
|
+
</span>
|
|
11
17
|
</label>
|
|
@@ -4,9 +4,9 @@ export default class PixLabel extends Component {
|
|
|
4
4
|
get className() {
|
|
5
5
|
const classes = ['pix-label'];
|
|
6
6
|
|
|
7
|
-
if (this.args.screenReaderOnly) classes.push('screen-reader-only');
|
|
8
7
|
if (this.args.wrappedElement) classes.push('pix-label--wrapped-element');
|
|
9
|
-
if (this.args.inlineLabel
|
|
8
|
+
if (this.args.inlineLabel && !this.args.screenReaderOnly)
|
|
9
|
+
classes.push('pix-label--inline-label');
|
|
10
10
|
if (this.args.isDisabled) classes.push('pix-label--disabled');
|
|
11
11
|
|
|
12
12
|
const size = ['small', 'large'].includes(this.args.size) ? this.args.size : 'default';
|
|
@@ -2,21 +2,24 @@
|
|
|
2
2
|
<PixLabel
|
|
3
3
|
@for={{this.id}}
|
|
4
4
|
@requiredLabel={{@requiredLabel}}
|
|
5
|
+
@subLabel={{@subLabel}}
|
|
5
6
|
@size={{@size}}
|
|
6
7
|
@screenReaderOnly={{@screenReaderOnly}}
|
|
7
8
|
@isDisabled={{this.isDisabled}}
|
|
8
9
|
@inlineLabel={{true}}
|
|
9
10
|
@wrappedElement={{true}}
|
|
10
11
|
>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
<:inputElement>
|
|
13
|
+
<input
|
|
14
|
+
type="radio"
|
|
15
|
+
id={{this.id}}
|
|
16
|
+
class="pix-radio-button__input"
|
|
17
|
+
value={{@value}}
|
|
18
|
+
aria-disabled={{this.isDisabled}}
|
|
19
|
+
{{on "click" this.avoidCheckedStateChangeIfIsDisabled}}
|
|
20
|
+
...attributes
|
|
21
|
+
/>
|
|
22
|
+
</:inputElement>
|
|
23
|
+
<:default>{{yield to="label"}}</:default>
|
|
21
24
|
</PixLabel>
|
|
22
25
|
</div>
|
|
@@ -97,6 +97,8 @@ const Template = (args) => {
|
|
|
97
97
|
@isDisabled={{this.isDisabled}}
|
|
98
98
|
disabled={{this.disabled}}
|
|
99
99
|
@size={{this.size}}
|
|
100
|
+
@subLabel={{this.subLabel}}
|
|
101
|
+
@requiredLabel={{this.requiredLabel}}
|
|
100
102
|
@inlineLabel={{this.inlineLabel}}
|
|
101
103
|
@screenReaderOnly={{this.screenReaderOnly}}
|
|
102
104
|
>
|