diff --git a/packages/elements/src/datetime-picker/__demo__/index.html b/packages/elements/src/datetime-picker/__demo__/index.html index 29cb1611d3..0789ef0f28 100644 --- a/packages/elements/src/datetime-picker/__demo__/index.html +++ b/packages/elements/src/datetime-picker/__demo__/index.html @@ -93,6 +93,8 @@ Weekends Only Readonly Disabled + Warning + Error

Input Trigger Disabled @@ -121,6 +123,7 @@ duplex: dateTimePicker.duplex, timepicker: dateTimePicker.timepicker, amPm: dateTimePicker.amPm, + warning: dateTimePicker.warning, error: dateTimePicker.error, showSeconds: dateTimePicker.showSeconds, lang: dateTimePicker.lang, @@ -292,6 +295,12 @@ document.getElementById('disabled').addEventListener('checked-changed', ({ detail: { value } }) => { dateTimePicker.disabled = value || undefined; }); + document.getElementById('warning').addEventListener('checked-changed', ({ detail: { value } }) => { + dateTimePicker.warning = value || undefined; + }); + document.getElementById('error').addEventListener('checked-changed', ({ detail: { value } }) => { + dateTimePicker.error = value || undefined; + }); document.getElementById('readonly').addEventListener('checked-changed', ({ detail: { value } }) => { dateTimePicker.readonly = value || undefined; }); diff --git a/packages/halo-theme/src/custom-elements/ef-datetime-picker.less b/packages/halo-theme/src/custom-elements/ef-datetime-picker.less index 12c198d88b..b50b7ce5ec 100644 --- a/packages/halo-theme/src/custom-elements/ef-datetime-picker.less +++ b/packages/halo-theme/src/custom-elements/ef-datetime-picker.less @@ -28,6 +28,32 @@ } } + &[warning]:not([focused]) { + border-color: @control-warning-color; + } + + &[error]:not([focused]) { + border-color: @control-error-color; + } + + &[warning]:hover:not([readonly]):not([focused]) { + border-color: @control-hover-warning-color; + } + + &[warning][disabled], + &[warning][readonly]:not([focused]) { + border-color: fade(@control-hover-warning-color, 50%); + } + + &[error]:hover:not([readonly]):not([focused]) { + border-color: @control-hover-error-color; + } + + &[error][disabled], + &[error][readonly]:not([focused]) { + border-color: fade(@control-hover-error-color, 50%); + } + &[disabled] { [part=icon] { color: @input-disabled-text-color @@ -36,7 +62,7 @@ &[focused], &[focused][error][warning], - &:not([disabled]):hover { + &:not([disabled]):not([error]):not([warning]):hover { [part=icon] { color: @scheme-color-secondary;