|
6 | 6 | :placeholder="inputPlaceholder" |
7 | 7 | :title="inputTitle" |
8 | 8 | v-model="inputValue" |
9 | | - :class="{ disabled: !emit && (willBeRemoved || (!isInstalled && !willBeInstalled && !isRequired) || isUpload || !isGranted(scopes.INSTALL)), error: constraintError }" |
| 9 | + :class="{ |
| 10 | + disabled: !emit && (willBeRemoved || (!isInstalled && !willBeInstalled && !isRequired) || isUpload || !isGranted(scopes.INSTALL)), |
| 11 | + incompatible: isIncompatible, |
| 12 | + error: constraintError, |
| 13 | + }" |
10 | 14 | :disabled="!constraintEditable || willBeRemoved || (!emit && !isInstalled && !willBeInstalled && !isRequired) || isUpload || !isGranted(scopes.INSTALL)" |
11 | 15 | @keypress.enter.prevent="saveConstraint" |
12 | 16 | @keypress.esc.prevent="resetConstraint" |
13 | 17 | @blur="saveConstraint" |
14 | 18 | /> |
15 | 19 | <button |
16 | | - :class="{ 'widget-button widget-button--gear': true, rotate: constraintValidating }" |
| 20 | + :class="{ 'widget-button widget-button--gear': true, rotate: constraintValidating, incompatible: isIncompatible }" |
17 | 21 | :title="buttonTitle" |
18 | 22 | @click="editConstraint" |
19 | 23 | :disabled="!emit && (willBeRemoved || (!isInstalled && !willBeInstalled && !isRequired) || isUpload || !isGranted(scopes.INSTALL))" |
@@ -67,6 +71,8 @@ export default { |
67 | 71 | ? vm.$t('ui.package.latestConstraint') |
68 | 72 | : '', |
69 | 73 |
|
| 74 | + isIncompatible: (vm) => !vm.isCompatible && !vm.constraint, |
| 75 | +
|
70 | 76 | inputValue: { |
71 | 77 | get: (vm) => (vm.isUpload ? vm.$t('ui.package.private') : vm.constraint), |
72 | 78 | set(value) { |
@@ -221,6 +227,11 @@ export default { |
221 | 227 | border-color: var(--border); |
222 | 228 | } |
223 | 229 |
|
| 230 | + &.incompatible { |
| 231 | + background: var(--btn-alert); |
| 232 | + border-color: var(--btn-alert); |
| 233 | + } |
| 234 | +
|
224 | 235 | &.error { |
225 | 236 | animation: input-error 0.15s linear 3; |
226 | 237 | } |
@@ -253,6 +264,10 @@ export default { |
253 | 264 | margin: -10px 0 0 -10px; |
254 | 265 | } |
255 | 266 |
|
| 267 | + &.incompatible { |
| 268 | + background: var(--btn-alert); |
| 269 | + } |
| 270 | +
|
256 | 271 | &.rotate:before { |
257 | 272 | animation: release-validating 2s linear infinite; |
258 | 273 | } |
|
0 commit comments