@zap-wunschlachen/wl-shared-components 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/App.vue CHANGED
@@ -1,12 +1,12 @@
1
1
  <template>
2
2
  <div class="app">
3
3
  <div class="element-container">
4
- <div style="width: 100%; display: flex; flex-direction: column; gap: 20px;">
4
+ <div style="height:100%; width: 100%; display: flex; flex-direction: column; gap: 20px;">
5
5
  <Card :appointment="value0" :dentist-image-src="value0.dentist.imageSrc" @confirm="onConfirmed" @cancel="onCancelled" @reschedule="onRescheduled" />
6
6
  <Card disabled :appointment="value1" :dentist-image-src="value1.dentist.imageSrc" @confirm="onConfirmed" @cancel="onCancelled" @reschedule="onRescheduled" />
7
7
  <Card :appointment="value2" :dentist-image-src="value2.dentist.imageSrc" @confirm="onConfirmed" @cancel="onCancelled" @reschedule="onRescheduled" />
8
8
  <Card :appointment="value3" :dentist-image-src="value3.dentist.imageSrc" @confirm="onConfirmed" @cancel="onCancelled" @reschedule="onRescheduled" />
9
- <Card disabled :appointment="value4" :dentist-image-src="value4.dentist.imageSrc" @confirm="onConfirmed" @cancel="onCancelled" @reschedule="onRescheduled" />
9
+ <Card duplicate-treatment-datetime disabled :appointment="value4" :dentist-image-src="value4.dentist.imageSrc" @confirm="onConfirmed" @cancel="onCancelled" @reschedule="onRescheduled" />
10
10
  </div>
11
11
  </div>
12
12
  </div>
@@ -36,7 +36,7 @@ const value0 = ref<AppointmentData>({
36
36
  end: "2025-09-23T16:30:00Z",
37
37
  status: "upcoming", // Change to 'past' or 'cancelled' to test other states
38
38
  is_confirmed: true,
39
- template_name: ["Routine Checkup", "Cleaning"],
39
+ template_name: ["Cleaning"],
40
40
  description: "ABCD-1234",
41
41
  dentist: {
42
42
  name: "Dr. Erika Mustermann",
@@ -55,7 +55,7 @@ const value1 = ref<AppointmentData>({
55
55
  end: "2025-09-23T16:30:00Z",
56
56
  status: "upcoming", // Change to 'past' or 'cancelled' to test other states
57
57
  is_confirmed: false,
58
- template_name: ["Routine Checkup", "Cleaning"],
58
+ template_name: ["Cleaning"],
59
59
  description: "ABCD-1234",
60
60
  dentist: {
61
61
  name: "Dr. Erika Mustermann",
@@ -74,7 +74,7 @@ const value2 = ref<AppointmentData>({
74
74
  end: "2025-09-23T16:30:00Z",
75
75
  status: "cancelled", // Change to 'past' or 'cancelled' to test other states
76
76
  is_confirmed: false,
77
- template_name: ["Routine Checkup", "Cleaning"],
77
+ template_name: ["Cleaning"],
78
78
  description: "ABCD-1234",
79
79
  dentist: {
80
80
  name: "Dr. Erika Mustermann",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zap-wunschlachen/wl-shared-components",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -31,7 +31,7 @@ import Button from '../../Button/Button.vue';
31
31
 
32
32
  const { appointment, disabled } = defineProps<{
33
33
  appointment: AppointmentData,
34
- disabled?: Boolean,
34
+ disabled?: boolean,
35
35
  }>();
36
36
 
37
37
  console.log('Actions component - appointment:', appointment);
@@ -4,6 +4,7 @@
4
4
  border-top-left-radius: 0.5rem;
5
5
  border-top-right-radius: 0.5rem;
6
6
  overflow: hidden;
7
+ text-decoration: none;
7
8
  }
8
9
 
9
10
  .card-opacity {
@@ -38,6 +39,9 @@
38
39
  .card-body {
39
40
  background-color: white;
40
41
  padding: 1rem;
42
+ gap: 1rem;
43
+ display: flex;
44
+ flex-direction: column;
41
45
  }
42
46
 
43
47
  .card-footer {
@@ -46,4 +50,12 @@
46
50
  border-bottom-left-radius: 0.5rem;
47
51
  border-bottom-right-radius: 0.5rem;
48
52
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
53
+ }
54
+
55
+ .appointment-detail {
56
+ margin: 0;
57
+ font-weight: 600;
58
+ font-size: 1.125rem; /* text-lg */
59
+ line-height: 1.75rem; /* leading-7 */
60
+ text-align: left;
49
61
  }
@@ -7,21 +7,21 @@
7
7
  :class="['card-header', appointment.status === 'cancelled' ? 'header-bg-cancelled' : 'header-bg-normal']">
8
8
  <div class="header-item">
9
9
  <Icon name="heroicons:user-circle" size="20" class="header-icon" />
10
- <p> {{ appointment?.patientName || 'Unbekannter Patient' }} </p>
10
+ <p> {{ appointment?.patientName || t('wl.appointment_card.unknown_patient') }} </p>
11
11
  </div>
12
12
  <div class="header-item">
13
13
  <Icon name="heroicons:map-pin" size="20" class="header-icon" />
14
- <p> {{ format(appointment ? new Date(appointment.start) : new Date(), 'EEE, d MMM yyyy', { locale: de }) }} </p>
14
+ <p> {{ treatmentDate }} </p>
15
15
  </div>
16
16
  <div class="header-item">
17
17
  <Icon name="heroicons:clock" size="20" class="header-icon" />
18
- <p> {{ format(appointment ? new Date(appointment.start) : new Date(), 'HH:mm') }} </p>
18
+ <p> {{ treatmentTime }} </p>
19
19
  </div>
20
20
  </div>
21
21
 
22
22
  <div class="card-body">
23
- <h2>{{ Array.isArray(appointment?.template_name) ? appointment?.template_name.join(', ') :
24
- appointment?.template_name }}</h2>
23
+ <h3 class="appointment-detail">{{ Array.isArray(appointment?.template_name) ? appointment?.template_name.join(', ') : appointment?.template_name }}</h3>
24
+ <h3 class="appointment-detail" v-if="duplicateTreatmentDatetime">{{ treatmentDate }} | {{ treatmentTime }} {{ t('wl.appointment_card.uhr') }}</h3>
25
25
  <Details :appointment="appointment" :dentist-image-src="dentistImageSrc" />
26
26
  <hr />
27
27
  </div>
@@ -38,20 +38,35 @@
38
38
  <script setup lang="ts">
39
39
  import { format } from 'date-fns'
40
40
  import { de } from 'date-fns/locale'
41
- import type { AppointmentData } from '@/types';
41
+ import type { AppointmentData } from '@/types'
42
42
  import Details from './Details.vue'
43
43
  import Actions from './Actions.vue'
44
+ import { computed } from 'vue'
45
+ import { useI18n } from 'vue-i18n';
46
+
47
+ const { t } = useI18n();
44
48
 
45
49
  const props = defineProps<{
46
50
  appointment: AppointmentData,
47
- appointmentLink?: String,
48
- dentistImageSrc?: String,
49
- disabled?: Boolean,
51
+ appointmentLink?: string,
52
+ dentistImageSrc?: string,
53
+ disabled?: boolean,
54
+ duplicateTreatmentDatetime?: boolean
50
55
  }>();
51
56
 
57
+ const treatmentDate = computed(() => {
58
+ return format(props.appointment ? new Date(props.appointment.start) : new Date(), 'EEE, d MMM yyyy', { locale: de })
59
+ })
60
+
61
+ const treatmentTime = computed(() => {
62
+ return format(props.appointment ? new Date(props.appointment.start) : new Date(), 'HH:mm')
63
+ })
64
+
52
65
  console.log('Rendering Card for appointment:', props.appointment);
53
66
  console.log('Disabled state:', props.disabled);
54
67
  console.log('Appointment Link:', props.appointmentLink);
68
+ console.log('Dentist Image Src:', props.dentistImageSrc);
69
+ console.log('Duplicate Treatment Datetime:', props.duplicateTreatmentDatetime);
55
70
 
56
71
  // Emit events upward when confirmed or cancelled
57
72
  const emit = defineEmits(['confirm', 'cancel', 'reschedule'])
@@ -37,7 +37,7 @@
37
37
  import type { AppointmentData } from '@/types';
38
38
  defineProps<{
39
39
  appointment: AppointmentData,
40
- dentistImageSrc?: String
40
+ dentistImageSrc?: string
41
41
  }>()
42
42
  </script>
43
43
 
@@ -14,6 +14,15 @@
14
14
  "code_was_sent": "Code an Nummer {phoneNumber} gesendet",
15
15
  "confirm": "Bestätigen",
16
16
  "resend": "Code erneut senden"
17
+ },
18
+ "appointment_card": {
19
+ "uhr": "Uhr",
20
+ "unknown_patient": "Unbekannter Patient",
21
+ "confirm": "Termin bestätigen",
22
+ "cancel": "Termin stornieren",
23
+ "reschedule": "Termin verschieben",
24
+ "reschedule_after_cancellation": "Diesen Termin nochmal buchen",
25
+ "cancelled": "Termin storniert"
17
26
  }
18
27
  }
19
28
  }
@@ -14,6 +14,15 @@
14
14
  "code_was_sent": "Code sent to number {phoneNumber}",
15
15
  "confirm": "Confirm",
16
16
  "resend": "Resend code"
17
+ },
18
+ "appointment_card": {
19
+ "uhr": "o'clock",
20
+ "unknown_patient": "Unknown patient",
21
+ "confirm": "Confirm appointment",
22
+ "cancel": "Cancel appointment",
23
+ "reschedule": "Reschedule appointment",
24
+ "reschedule_after_cancellation": "Book this appointment again",
25
+ "cancelled": "Appointment cancelled"
17
26
  }
18
27
  }
19
28
  }