|
10 | 10 |
|
11 | 11 | <div v-else> |
12 | 12 | <h2>{{ $tr('drivesFound') }}</h2> |
13 | | - <div |
14 | | - :name="'drive-'+index" |
15 | | - @click="$emit('change', drive.id)" |
16 | | - class="drive-list-item drive-list-item-enabled" |
17 | | - v-for="(drive, index) in enabledDrives" |
18 | | - > |
19 | | - <ui-radio |
20 | | - :id="'drive-'+index" |
21 | | - :trueValue="drive.id" |
22 | | - v-model="selectedDrive" |
23 | | - > |
24 | | - <div class="drive-name">{{ drive.name }}</div> |
25 | | - <div v-if="enabledMsg" class="drive-list-item-detail"> |
26 | | - {{ enabledMsg(drive) }} |
27 | | - </div> |
28 | | - </ui-radio> |
29 | | - </div> |
30 | | - |
31 | | - <div class="drive-list-item drive-list-item-disabled" v-for="(drive, index) in disabledDrives"> |
32 | | - <ui-radio |
33 | | - :id="'disabled-drive-'+index" |
34 | | - :trueValue="drive.id" |
35 | | - disabled |
36 | | - v-model="selectedDrive" |
37 | | - > |
38 | | - <div>{{ drive.name }}</div> |
39 | | - <div class="drive-list-item-detail"> |
40 | | - {{ disabledMsg }} |
41 | | - </div> |
42 | | - </ui-radio> |
43 | | - </div> |
44 | | - |
| 13 | + <k-radio |
| 14 | + v-for="drive in enabledDrives" |
| 15 | + :key="drive.id" |
| 16 | + :label="genEnabledDriveLabel(drive)" |
| 17 | + :radiovalue="drive.id" |
| 18 | + v-model="selectedDrive" |
| 19 | + @change="$emit('change', drive.id)" |
| 20 | + /> |
| 21 | + <k-radio |
| 22 | + v-for="drive in disabledDrives" |
| 23 | + :key="drive.id" |
| 24 | + :label="genDisabledDriveLabel(drive)" |
| 25 | + :radiovalue="drive.id" |
| 26 | + :disabled="true" |
| 27 | + v-model="selectedDrive" |
| 28 | + /> |
45 | 29 | </div> |
46 | 30 | </div> |
47 | 31 |
|
|
50 | 34 |
|
51 | 35 | <script> |
52 | 36 |
|
53 | | - import UiRadio from 'keen-ui/src/UiRadio'; |
| 37 | + import kRadio from 'kolibri.coreVue.components.kRadio'; |
| 38 | +
|
54 | 39 | export default { |
55 | | - components: { UiRadio }, |
| 40 | + components: { kRadio }, |
56 | 41 | props: { |
57 | 42 | value: { |
58 | 43 | type: String, |
|
83 | 68 | return this.drives.filter(drive => !this.enabledDrivePred(drive)); |
84 | 69 | }, |
85 | 70 | }, |
| 71 | + methods: { |
| 72 | + genEnabledDriveLabel(drive) { |
| 73 | + let driveLabel = drive.name; |
| 74 | + if (this.enabledMsg) { |
| 75 | + driveLabel += ` (${this.enabledMsg(drive)})`; |
| 76 | + } |
| 77 | + return driveLabel; |
| 78 | + }, |
| 79 | + genDisabledDriveLabel(drive) { |
| 80 | + return `${drive.name} (${this.disabledMsg})`; |
| 81 | + }, |
| 82 | + }, |
86 | 83 | name: 'wizardDriveList', |
87 | 84 | $trs: { |
88 | 85 | drivesFound: 'Drives found:', |
|
104 | 101 | h2 |
105 | 102 | font-size: 1em |
106 | 103 |
|
107 | | - .drive-list |
108 | | - &:not(first-child) |
109 | | - border-top: none |
110 | | -
|
111 | | - .drive-list-item |
112 | | - padding: 1em 0.6em |
113 | | - font-size: 0.9em |
114 | | - border: 1px $core-bg-canvas solid |
115 | | - &-detail |
116 | | - color: $core-text-annotation |
117 | | - font-size: 0.7em |
118 | | - &-disabled |
119 | | - color: $core-text-disabled |
120 | | - &-enabled |
121 | | - cursor: pointer |
122 | | - &:hover |
123 | | - background-color: $core-bg-canvas |
124 | | -
|
125 | | - .drive-name |
126 | | - font-size: 0.9em |
127 | | - & > label |
128 | | - cursor: pointer |
129 | | -
|
130 | 104 | </style> |
0 commit comments