@1024pix/pix-ui 48.6.2 → 48.7.1
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.
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<label for={{@for}} class={{this.className}} ...attributes>
|
|
2
|
+
{{yield}}
|
|
3
|
+
|
|
2
4
|
{{#if @requiredLabel}}
|
|
3
5
|
<abbr title={{@requiredLabel}} class="mandatory-mark">*</abbr>
|
|
4
6
|
{{/if}}
|
|
5
7
|
|
|
6
|
-
{{yield}}
|
|
7
|
-
|
|
8
8
|
{{#if @subLabel}}
|
|
9
9
|
<span class="pix-label__sub-label">{{@subLabel}}</span>
|
|
10
10
|
{{/if}}
|
|
@@ -37,10 +37,6 @@ export default class PixSelect extends Component {
|
|
|
37
37
|
element.style.setProperty('--pix-select-width', `${selectWidth}rem`);
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
this.elementHelper.waitForElement(`container-${this.selectId}`).then((element) => {
|
|
42
|
-
this.rootElement = element;
|
|
43
|
-
});
|
|
44
40
|
}
|
|
45
41
|
|
|
46
42
|
get displayDefaultOption() {
|
|
@@ -152,15 +148,16 @@ export default class PixSelect extends Component {
|
|
|
152
148
|
}
|
|
153
149
|
|
|
154
150
|
@action
|
|
155
|
-
focus() {
|
|
156
|
-
if (
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
151
|
+
focus(event) {
|
|
152
|
+
if (!event.target) return;
|
|
153
|
+
if (!this.isExpanded) return;
|
|
154
|
+
|
|
155
|
+
if (this.args.value) {
|
|
156
|
+
event.target.querySelector("[aria-selected='true']")?.focus();
|
|
157
|
+
} else if (this.args.isSearchable) {
|
|
158
|
+
event.target.querySelector(`#${this.searchId}`)?.focus();
|
|
159
|
+
} else if (this.displayDefaultOption) {
|
|
160
|
+
event.target.querySelector("[aria-selected='true']")?.focus();
|
|
164
161
|
}
|
|
165
162
|
}
|
|
166
163
|
}
|