@1024pix/pix-ui 55.33.1 → 55.34.0
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-input-base.js +13 -0
- package/addon/components/pix-input.hbs +2 -2
- package/addon/components/pix-select.hbs +3 -3
- package/addon/components/pix-select.js +17 -4
- package/addon/styles/_pix-input.scss +8 -0
- package/addon/styles/_pix-label.scss +2 -1
- package/addon/styles/_pix-select.scss +8 -0
- package/package.json +1 -1
|
@@ -29,6 +29,19 @@ export default class PixInputBase extends Component {
|
|
|
29
29
|
return this.args.validationStatus === 'error' ? this.prefix + '-error' : null;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
get rootClassNames() {
|
|
33
|
+
const classNames = ['pix-input'];
|
|
34
|
+
if (this.args.inlineLabel) {
|
|
35
|
+
classNames.push('pix-input--inline');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (this.args.isFullWidth) {
|
|
39
|
+
classNames.push('pix-input--full-width');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return classNames.join(' ');
|
|
43
|
+
}
|
|
44
|
+
|
|
32
45
|
get hasError() {
|
|
33
46
|
return this.args.validationStatus === 'error';
|
|
34
47
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<div class=
|
|
1
|
+
<div class={{this.rootClassNames}}>
|
|
2
2
|
{{#if (has-block "label")}}
|
|
3
3
|
<PixLabel
|
|
4
4
|
@for={{this.id}}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
{{yield to="label"}}
|
|
12
12
|
</PixLabel>
|
|
13
13
|
{{/if}}
|
|
14
|
-
<div>
|
|
14
|
+
<div class="pix-input__field-container">
|
|
15
15
|
<div class="pix-input__container">
|
|
16
16
|
<input
|
|
17
17
|
id={{this.id}}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div
|
|
2
|
-
class=
|
|
2
|
+
class={{this.rootClassNames}}
|
|
3
3
|
id="container-{{this.selectId}}"
|
|
4
4
|
{{on-click-outside this.hideDropdown}}
|
|
5
5
|
{{on-arrow-down-up-action this.listId this.showDropdown this.isExpanded}}
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
</PixLabel>
|
|
21
21
|
{{/if}}
|
|
22
22
|
|
|
23
|
-
<div>
|
|
23
|
+
<div class="pix-select__button-container">
|
|
24
24
|
<PopperJS @placement={{or @placement "bottom-start"}} as |reference popover|>
|
|
25
25
|
<button
|
|
26
26
|
{{reference}}
|
|
27
27
|
type="button"
|
|
28
28
|
id={{this.selectId}}
|
|
29
|
-
class={{this.
|
|
29
|
+
class={{this.buttonClassName}}
|
|
30
30
|
{{on "click" this.toggleDropdown}}
|
|
31
31
|
aria-expanded={{this.isAriaExpanded}}
|
|
32
32
|
aria-controls={{this.listId}}
|
|
@@ -34,13 +34,26 @@ export default class PixSelect extends Component {
|
|
|
34
34
|
return !this.searchValue && !this.args.hideDefaultOption;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
get
|
|
38
|
-
const
|
|
37
|
+
get buttonClassName() {
|
|
38
|
+
const buttonClasses = ['pix-select-button'];
|
|
39
39
|
if (this.args.className) {
|
|
40
|
-
|
|
40
|
+
buttonClasses.push(this.args.className);
|
|
41
41
|
}
|
|
42
42
|
if (this.args.errorMessage) {
|
|
43
|
-
|
|
43
|
+
buttonClasses.push('pix-select-button--error');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return buttonClasses.join(' ');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
get rootClassNames() {
|
|
50
|
+
const classes = ['pix-select'];
|
|
51
|
+
if (this.args.inlineLabel) {
|
|
52
|
+
classes.push('pix-select--inline');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (this.args.isFullWidth) {
|
|
56
|
+
classes.push('pix-select--full-width');
|
|
44
57
|
}
|
|
45
58
|
|
|
46
59
|
return classes.join(' ');
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
align-items: center;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
&--full-width {
|
|
20
|
+
width: 100%;
|
|
21
|
+
}
|
|
22
|
+
|
|
19
23
|
&__dropdown {
|
|
20
24
|
@extend %pix-shadow-xs;
|
|
21
25
|
|
|
@@ -78,6 +82,10 @@
|
|
|
78
82
|
&__error-message {
|
|
79
83
|
@extend %pix-input-error-message;
|
|
80
84
|
}
|
|
85
|
+
|
|
86
|
+
&__button-container {
|
|
87
|
+
flex-grow: 1;
|
|
88
|
+
}
|
|
81
89
|
}
|
|
82
90
|
|
|
83
91
|
.pix-select-button {
|