Skip to content
This repository was archived by the owner on Aug 7, 2020. It is now read-only.

Commit 8e7189d

Browse files
authored
fix(oui-select-picker): fix main classname on component (#280)
1 parent 9a1f9a0 commit 8e7189d

File tree

2 files changed

+50
-51
lines changed

2 files changed

+50
-51
lines changed

packages/oui-select-picker/src/select-picker.controller.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export default class SelectPickerController {
1919
// So we use $timeout to force the $apply
2020
this.$timeout(() => {
2121
this.$element
22+
.addClass("oui-select-picker")
2223
.removeAttr("id")
2324
.removeAttr("name");
2425

Lines changed: 49 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,50 @@
1-
<div class="oui-select-picker">
2-
<input type="radio" class="oui-select-picker__input"
3-
name="{{:: $ctrl.name }}"
4-
ng-attr-aria-labelledby="{{:: $ctrl.id }}-label"
5-
ng-attr-aria-describedby="{{:: $ctrl.description && $ctrl.id + '-description' || undefined }}"
6-
ng-attr-id="{{:: $ctrl.selectedValue ? $ctrl.id : undefined }}"
7-
ng-change="$ctrl.onRadioModelChange({ modelValue: $ctrl.model })"
8-
ng-disabled="$ctrl.disabled"
9-
ng-model="$ctrl.model"
10-
ng-required="$ctrl.required"
11-
ng-value="$ctrl.selectedValue">
12-
<label class="oui-select-picker__label-container" for="{{:: $ctrl.id }}">
13-
<span class="oui-select-picker__picture-container"
14-
ng-if="$ctrl.picture">
15-
<img class="oui-select-picker__picture" alt="" aria-hidden="true"
16-
ng-if="$ctrl.isImgPath"
17-
ng-src="{{ :: $ctrl.picture }}">
18-
<span class="oui-select-picker__picture" aria-hidden="true"
19-
ng-class=":: $ctrl.picture"
20-
ng-if="!$ctrl.isImgPath"></span>
1+
<input type="radio" class="oui-select-picker__input"
2+
name="{{:: $ctrl.name }}"
3+
ng-attr-aria-labelledby="{{:: $ctrl.id }}-label"
4+
ng-attr-aria-describedby="{{:: $ctrl.description && $ctrl.id + '-description' || undefined }}"
5+
ng-attr-id="{{:: $ctrl.selectedValue ? $ctrl.id : undefined }}"
6+
ng-change="$ctrl.onRadioModelChange({ modelValue: $ctrl.model })"
7+
ng-disabled="$ctrl.disabled"
8+
ng-model="$ctrl.model"
9+
ng-required="$ctrl.required"
10+
ng-value="$ctrl.selectedValue">
11+
<label class="oui-select-picker__label-container" for="{{:: $ctrl.id }}">
12+
<span class="oui-select-picker__picture-container"
13+
ng-if="$ctrl.picture">
14+
<img class="oui-select-picker__picture" alt="" aria-hidden="true"
15+
ng-if="$ctrl.isImgPath"
16+
ng-src="{{ :: $ctrl.picture }}">
17+
<span class="oui-select-picker__picture" aria-hidden="true"
18+
ng-class=":: $ctrl.picture"
19+
ng-if="!$ctrl.isImgPath"></span>
20+
</span>
21+
<span class="oui-select-picker__label">
22+
<span id="{{:: $ctrl.id }}-label"
23+
ng-bind="$ctrl.label">
2124
</span>
22-
<span class="oui-select-picker__label">
23-
<span id="{{:: $ctrl.id }}-label"
24-
ng-bind="$ctrl.label">
25-
</span>
26-
</span>
27-
<span class="oui-select-picker__description"
28-
id="{{:: $ctrl.id }}-description"
29-
ng-bind=":: $ctrl.description"
30-
ng-if="$ctrl.description"></span>
31-
<span class="oui-select-picker__value-container oui-select-picker__section"
32-
ng-if="$ctrl.values.length">
33-
<span class="oui-select-picker__value"
34-
ng-bind=":: $ctrl.getFirstValueMatch($ctrl.match)"
35-
ng-if="$ctrl.values.length === 1"></span>
36-
<oui-select name="{{:: $ctrl.name }}"
37-
disabled="$ctrl.disabled"
38-
items="$ctrl.values"
39-
match="{{ $ctrl.match }}"
40-
model="$ctrl.selectedValue"
41-
on-change="$ctrl.onSelectModelChange({ modelValue: $ctrl.selectedValue })"
42-
placeholder="{{:: $ctrl.placeholder || ' - ' }}"
43-
data-align="end"
44-
ng-if="$ctrl.values.length > 1">
45-
<span ng-bind=":: $ctrl.$scope.$parent.getItemValue($item, $ctrl.match)"></span>
46-
</oui-select>
47-
</span>
48-
<span class="oui-select-picker__transclude-container"
49-
ng-if="$ctrl.transcludeSection"
50-
ng-transclude="sectionSlot"></span>
51-
</label>
52-
</div>
25+
</span>
26+
<span class="oui-select-picker__description"
27+
id="{{:: $ctrl.id }}-description"
28+
ng-bind=":: $ctrl.description"
29+
ng-if="$ctrl.description"></span>
30+
<span class="oui-select-picker__value-container oui-select-picker__section"
31+
ng-if="$ctrl.values.length">
32+
<span class="oui-select-picker__value"
33+
ng-bind=":: $ctrl.getFirstValueMatch($ctrl.match)"
34+
ng-if="$ctrl.values.length === 1"></span>
35+
<oui-select name="{{:: $ctrl.name }}"
36+
disabled="$ctrl.disabled"
37+
items="$ctrl.values"
38+
match="{{ $ctrl.match }}"
39+
model="$ctrl.selectedValue"
40+
on-change="$ctrl.onSelectModelChange({ modelValue: $ctrl.selectedValue })"
41+
placeholder="{{:: $ctrl.placeholder || ' - ' }}"
42+
data-align="end"
43+
ng-if="$ctrl.values.length > 1">
44+
<span ng-bind=":: $ctrl.$scope.$parent.getItemValue($item, $ctrl.match)"></span>
45+
</oui-select>
46+
</span>
47+
<span class="oui-select-picker__transclude-container"
48+
ng-if="$ctrl.transcludeSection"
49+
ng-transclude="sectionSlot"></span>
50+
</label>

0 commit comments

Comments
 (0)