From 813bab4e9d857205f3b8ac148943501a45218469 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Tue, 16 Apr 2024 10:47:16 -0300 Subject: [PATCH] manage QCalendar customization classes from wrapper --- src/components/ui/QCalendarMonthWrapper.vue | 103 ++++++++++++++++-- src/css/app.scss | 11 -- src/pages/Worker/Card/WorkerCalendarItem.vue | 56 +--------- .../Worker/Card/WorkerTimeControlCalendar.vue | 17 --- 4 files changed, 96 insertions(+), 91 deletions(-) diff --git a/src/components/ui/QCalendarMonthWrapper.vue b/src/components/ui/QCalendarMonthWrapper.vue index d0a02eed0..6dfbf0f84 100644 --- a/src/components/ui/QCalendarMonthWrapper.vue +++ b/src/components/ui/QCalendarMonthWrapper.vue @@ -12,12 +12,23 @@ const $props = defineProps({ type: Boolean, default: false, }, + viewCustomization: { + type: String, + default: '', + }, }); const $q = useQuasar(); +// El objetivo de asignar las clases de personalización desde el wrapper es no tener conflictos entre vistas que usen el mismo componente +const viewCustomizationClasses = { + workerCalendar: 'worker-calendar-customizations', +}; + const containerClasses = computed(() => { const classes = ['main-container-background']; + if (viewCustomizationClasses[$props.viewCustomization]) + classes.push(viewCustomizationClasses[$props.viewCustomization]); if ($props.bordered) classes.push('--bordered'); if ($props.transparentBackground) classes.push('transparent-background'); else classes.push($q.dark.isActive ? '--dark' : '--light'); @@ -33,6 +44,8 @@ const containerClasses = computed(() => { diff --git a/src/pages/Worker/Card/WorkerTimeControlCalendar.vue b/src/pages/Worker/Card/WorkerTimeControlCalendar.vue index 2e848b7d5..20d02ca78 100644 --- a/src/pages/Worker/Card/WorkerTimeControlCalendar.vue +++ b/src/pages/Worker/Card/WorkerTimeControlCalendar.vue @@ -152,16 +152,6 @@ const paintWorkWeeks = async () => {