|
@@ -5,28 +5,29 @@ Sélecteur de dates
|
|
|
-->
|
|
-->
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
|
- <VueDatePicker
|
|
|
|
|
- :model-value="modelValue"
|
|
|
|
|
- :locale="locale"
|
|
|
|
|
- :format="dateFormatPattern"
|
|
|
|
|
- :format-locale="fnsLocale"
|
|
|
|
|
- :range="range"
|
|
|
|
|
- :multi-calendars="range"
|
|
|
|
|
- :enable-time-picker="withTimePicker"
|
|
|
|
|
- :auto-apply="autoApply"
|
|
|
|
|
- :auto-position="true"
|
|
|
|
|
- :start-date="today"
|
|
|
|
|
- close-on-scroll
|
|
|
|
|
- text-input
|
|
|
|
|
- :readonly="readonly"
|
|
|
|
|
- position="left"
|
|
|
|
|
- :teleport="true"
|
|
|
|
|
- :select-text="$t('select')"
|
|
|
|
|
- :cancel-text="$t('cancel')"
|
|
|
|
|
- input-class-name="date-picker-input"
|
|
|
|
|
- @update:model-value="emit('update:modelValue', $event)"
|
|
|
|
|
- />
|
|
|
|
|
- </template>
|
|
|
|
|
|
|
+ <VueDatePicker
|
|
|
|
|
+ :model-value="modelValue"
|
|
|
|
|
+ :locale="locale"
|
|
|
|
|
+ :format="dateFormatPattern"
|
|
|
|
|
+ :format-locale="fnsLocale"
|
|
|
|
|
+ :range="range"
|
|
|
|
|
+ :multi-calendars="range"
|
|
|
|
|
+ :enable-time-picker="withTimePicker"
|
|
|
|
|
+ :auto-apply="autoApply"
|
|
|
|
|
+ :auto-position="true"
|
|
|
|
|
+ :start-date="today"
|
|
|
|
|
+ close-on-scroll
|
|
|
|
|
+ text-input
|
|
|
|
|
+ :readonly="readonly"
|
|
|
|
|
+ position="left"
|
|
|
|
|
+ :teleport="true"
|
|
|
|
|
+ :dark="isDark"
|
|
|
|
|
+ :select-text="$t('select')"
|
|
|
|
|
+ :cancel-text="$t('cancel')"
|
|
|
|
|
+ input-class-name="date-picker-input"
|
|
|
|
|
+ @update:model-value="emit('update:modelValue', $event)"
|
|
|
|
|
+ />
|
|
|
|
|
+</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import { useI18n } from 'vue-i18n'
|
|
import { useI18n } from 'vue-i18n'
|
|
@@ -34,6 +35,7 @@ import type { PropType } from 'vue'
|
|
|
import type { Locale } from 'date-fns'
|
|
import type { Locale } from 'date-fns'
|
|
|
import type { supportedLocales } from '~/services/utils/dateUtils'
|
|
import type { supportedLocales } from '~/services/utils/dateUtils'
|
|
|
import DateUtils from '~/services/utils/dateUtils'
|
|
import DateUtils from '~/services/utils/dateUtils'
|
|
|
|
|
+import { useTheme } from 'vuetify'
|
|
|
|
|
|
|
|
const emit = defineEmits(['update:modelValue'])
|
|
const emit = defineEmits(['update:modelValue'])
|
|
|
|
|
|
|
@@ -65,6 +67,10 @@ const i18n = useI18n()
|
|
|
|
|
|
|
|
const locale: Ref<string> = i18n.locale
|
|
const locale: Ref<string> = i18n.locale
|
|
|
|
|
|
|
|
|
|
+const theme = useTheme()
|
|
|
|
|
+
|
|
|
|
|
+const isDark = computed(() => theme.global.current.value.dark)
|
|
|
|
|
+
|
|
|
const fnsLocale: ComputedRef<Locale> = computed(() =>
|
|
const fnsLocale: ComputedRef<Locale> = computed(() =>
|
|
|
DateUtils.getFnsLocale(locale.value as supportedLocales),
|
|
DateUtils.getFnsLocale(locale.value as supportedLocales),
|
|
|
)
|
|
)
|
|
@@ -89,4 +95,40 @@ const today = new Date()
|
|
|
:deep(.dp__action_button) {
|
|
:deep(.dp__action_button) {
|
|
|
height: 32px;
|
|
height: 32px;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+:deep(.date-picker-input) {
|
|
|
|
|
+ background-color: rgb(var(--v-theme-surface)) !important;
|
|
|
|
|
+ color: rgb(var(--v-theme-on-surface)) !important;
|
|
|
|
|
+ border: 1px solid rgb(var(--v-theme-neutral)) !important;
|
|
|
|
|
+ border-radius: 4px !important;
|
|
|
|
|
+
|
|
|
|
|
+ &:hover {
|
|
|
|
|
+ border-color: rgb(var(--v-theme-on-surface)) !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ &:focus {
|
|
|
|
|
+ border: 2px solid rgb(var(--v-theme-primary)) !important;
|
|
|
|
|
+ outline: none !important;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+:deep(.dp__menu) {
|
|
|
|
|
+ background-color: rgb(var(--v-theme-surface)) !important;
|
|
|
|
|
+ color: rgb(var(--v-theme-on-surface)) !important;
|
|
|
|
|
+ border: 1px solid rgb(var(--v-theme-neutral)) !important;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+:deep(.dp__calendar_header) {
|
|
|
|
|
+ background-color: rgb(var(--v-theme-surface)) !important;
|
|
|
|
|
+ color: rgb(var(--v-theme-on-surface)) !important;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+:deep(.dp__cell_inner) {
|
|
|
|
|
+ color: rgb(var(--v-theme-on-surface)) !important;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+:deep(.dp__action_cancel) {
|
|
|
|
|
+ background-color: rgb(var(--v-theme-neutral)) !important;
|
|
|
|
|
+ color: rgb(var(--v-theme-on-neutral)) !important;
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|