mirror of
https://github.com/directus/directus.git
synced 2026-01-30 06:18:09 -05:00
Datetime interface improvements (#11783)
* Datetime interface improvements * tweak click event
This commit is contained in:
@@ -3,7 +3,11 @@
|
||||
<template #activator="{ toggle, active }">
|
||||
<v-input :active="active" clickable readonly :model-value="displayValue" :disabled="disabled" @click="toggle">
|
||||
<template v-if="!disabled" #append>
|
||||
<v-icon :name="value ? 'close' : 'today'" :class="{ active }" @click.stop="unsetValue" />
|
||||
<v-icon
|
||||
:name="value ? 'clear' : 'today'"
|
||||
:class="{ active, 'clear-icon': value, 'today-icon': !value }"
|
||||
v-on="{ click: value ? unsetValue : null }"
|
||||
/>
|
||||
</template>
|
||||
</v-input>
|
||||
</template>
|
||||
@@ -93,7 +97,9 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
function unsetValue() {
|
||||
function unsetValue(e: any) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
emit('input', null);
|
||||
}
|
||||
|
||||
@@ -103,7 +109,19 @@ export default defineComponent({
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.v-icon.active {
|
||||
--v-icon-color: var(--primary);
|
||||
.v-icon {
|
||||
&.today-icon {
|
||||
&:hover,
|
||||
&.active {
|
||||
--v-icon-color: var(--primary);
|
||||
}
|
||||
}
|
||||
|
||||
&.clear-icon {
|
||||
&:hover,
|
||||
&.active {
|
||||
--v-icon-color: var(--danger);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user