mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-06 12:17:13 +08:00
refactor(time-picker): invalid time input el style
This commit is contained in:
parent
29f896140f
commit
daf8941d27
@ -1,9 +1,15 @@
|
||||
<template>
|
||||
<div class="n-time-picker">
|
||||
<div
|
||||
class="n-time-picker"
|
||||
:class="{
|
||||
'n-time-picker--invalid': isValueInvalid,
|
||||
[`n-${synthesizedTheme}-theme`]: synthesizedTheme
|
||||
}"
|
||||
>
|
||||
<n-input
|
||||
ref="activator"
|
||||
v-model="displayTimeString"
|
||||
class="n-date-picker-panel__time-input n-time-picker-input"
|
||||
class="n-time-picker-input"
|
||||
:force-focus="active"
|
||||
placeholder="Select time"
|
||||
lazy-focus
|
||||
@ -282,17 +288,12 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
computedTime (time) {
|
||||
this.refreshTimeString(time)
|
||||
computedTime (value) {
|
||||
this.refreshTimeString(value)
|
||||
this.$nextTick().then(this.scrollTimer)
|
||||
},
|
||||
value (value, oldValue) {
|
||||
this.$emit('change', value, oldValue)
|
||||
this.$nextTick().then(() => {
|
||||
if (!this.isValueInvalid) {
|
||||
this.memorizedValue = this.value
|
||||
}
|
||||
})
|
||||
},
|
||||
active (value) {
|
||||
if (this.isValueInvalid) {
|
||||
|
@ -9,6 +9,27 @@
|
||||
width: 180px;
|
||||
}
|
||||
}
|
||||
@include b(time-picker) {
|
||||
@include m(invalid) {
|
||||
& > {
|
||||
@include b(input) {
|
||||
@include e(input) {
|
||||
text-decoration: line-through;
|
||||
text-decoration-color: $--time-picker-text-decoration-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@include m(transition-disabled) {
|
||||
& > {
|
||||
@include b(input) {
|
||||
input {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@include b(time-picker-selector) {
|
||||
@include once {
|
||||
outline: none;
|
||||
|
@ -5,6 +5,7 @@
|
||||
'active': $--n-primary-color,
|
||||
'invalid': $--error-6
|
||||
) !global;
|
||||
$--time-picker-text-decoration-color: $--n-secondary-text-color !global;
|
||||
$--time-picker-item-background-color: (
|
||||
'hover': change-color($--n-primary-color, $alpha: .2),
|
||||
'invalid': change-color($--error-6, $alpha: .2)
|
||||
|
@ -5,6 +5,7 @@
|
||||
'active': $--n-primary-color,
|
||||
'invalid': $--error-6
|
||||
) !global;
|
||||
$--time-picker-text-decoration-color: $--n-secondary-text-color !global;
|
||||
$--time-picker-item-background-color: (
|
||||
'hover': change-color($--n-primary-color, $alpha: .15),
|
||||
'invalid': change-color($--error-6, $alpha: .15)
|
||||
|
Loading…
Reference in New Issue
Block a user