fix(input-number): border style

This commit is contained in:
07akioni 2020-11-16 14:15:02 +08:00
parent 01f201a749
commit a46a2ed7c4
3 changed files with 13 additions and 7 deletions

View File

@ -279,8 +279,9 @@ export default c([
}, },
({ props }) => ['warning', 'error'].map(status => { ({ props }) => ['warning', 'error'].map(status => {
const local = props.$local const local = props.$local
const boxShadow = local[createKey('boxShadow', status)] const border = local[createKey('border', status)]
const borderHover = local[createKey('borderHover', status)] const borderHover = local[createKey('borderHover', status)]
const borderFocus = local[createKey('borderFocus', status)]
const boxShadowFocus = local[createKey('boxShadowFocus', status)] const boxShadowFocus = local[createKey('boxShadowFocus', status)]
const colorFocus = local[createKey('colorFocus', status)] const colorFocus = local[createKey('colorFocus', status)]
const caretColor = local[createKey('caretColor', status)] const caretColor = local[createKey('caretColor', status)]
@ -290,7 +291,7 @@ export default c([
status, status,
cTB('input-number', [ cTB('input-number', [
cE('border-mask', { cE('border-mask', {
boxShadow: boxShadow border
}), }),
cE('input', { cE('input', {
caretColor: caretColor caretColor: caretColor
@ -305,6 +306,7 @@ export default c([
}, [ }, [
c('& ~', [ c('& ~', [
cE('border-mask', { cE('border-mask', {
border: borderFocus,
boxShadow: boxShadowFocus boxShadow: boxShadowFocus
}) })
]) ])

View File

@ -64,16 +64,18 @@ export default create({
boxShadowFocus: `0 0 8px 0 ${changeColor(primaryColor, { alpha: 0.3 })}`, boxShadowFocus: `0 0 8px 0 ${changeColor(primaryColor, { alpha: 0.3 })}`,
placeholdeColor, placeholdeColor,
// warning // warning
borderWarning: `inset 0 0 0 1px ${warningColor}`, borderWarning: `1px solid ${warningColor}`,
borderHoverWarning: `inset 0 0 0 1px ${warningColorHover}`, borderHoverWarning: `1px solid ${warningColorHover}`,
borderFocusWarning: `1px solid ${warningColorHover}`,
boxShadowFocusWarning: `0 0 8px 0 ${changeColor(warningColor, { alpha: 0.2 })}`, boxShadowFocusWarning: `0 0 8px 0 ${changeColor(warningColor, { alpha: 0.2 })}`,
colorFocusWarning: changeColor(warningColor, { alpha: 0.1 }), colorFocusWarning: changeColor(warningColor, { alpha: 0.1 }),
caretColorWarning: warningColorHover, caretColorWarning: warningColorHover,
buttonTextColorHoverWarning: warningColorHover, buttonTextColorHoverWarning: warningColorHover,
buttonTextColorPressedWarning: warningColorPressed, buttonTextColorPressedWarning: warningColorPressed,
// error // error
borderError: `inset 0 0 0 1px ${errorColor}`, borderError: `1px solid ${errorColor}`,
borderHoverError: `inset 0 0 0 1px ${errorColorHover}`, borderHoverError: `1px solid ${errorColorHover}`,
borderFocusError: `1px solid ${errorColorHover}`,
boxShadowFocusError: `0 0 8px 0 ${changeColor(errorColor, { alpha: 0.2 })}`, boxShadowFocusError: `0 0 8px 0 ${changeColor(errorColor, { alpha: 0.2 })}`,
colorFocusError: changeColor(errorColor, { alpha: 0.1 }), colorFocusError: changeColor(errorColor, { alpha: 0.1 }),
caretColorError: errorColorHover, caretColorError: errorColorHover,

View File

@ -64,8 +64,9 @@ export default create({
boxShadowFocus: `0 0 0 2px ${changeColor(primaryColor, { alpha: 0.2 })}`, boxShadowFocus: `0 0 0 2px ${changeColor(primaryColor, { alpha: 0.2 })}`,
placeholderColor, placeholderColor,
// warning // warning
boxShadowWarning: `inset 0 0 0 1px ${warningColor}`, borderWarning: `1px solid ${warningColor}`,
borderHoverWarning: `1px solid ${warningColorHover}`, borderHoverWarning: `1px solid ${warningColorHover}`,
borderFocusWarning: `1px solid ${warningColorHover}`,
boxShadowFocusWarning: `0 0 0 2px ${changeColor(warningColor, { alpha: 0.2 })}`, boxShadowFocusWarning: `0 0 0 2px ${changeColor(warningColor, { alpha: 0.2 })}`,
colorFocusWarning: colorFocus, colorFocusWarning: colorFocus,
caretColorWarning: warningColorHover, caretColorWarning: warningColorHover,
@ -74,6 +75,7 @@ export default create({
// error // error
borderError: `1px solid ${errorColor}`, borderError: `1px solid ${errorColor}`,
borderHoverError: `1px solid ${errorColorHover}`, borderHoverError: `1px solid ${errorColorHover}`,
borderFocusError: `1px solid ${errorColorHover}`,
boxShadowFocusError: `0 0 0 2px ${changeColor(errorColor, { alpha: 0.2 })}`, boxShadowFocusError: `0 0 0 2px ${changeColor(errorColor, { alpha: 0.2 })}`,
colorFocusError: colorFocus, colorFocusError: colorFocus,
caretColorError: errorColorHover, caretColorError: errorColorHover,