@zap-wunschlachen/wl-shared-components 1.0.13 → 1.0.14
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 +7 -5
- package/package.json +1 -1
- package/src/components/Loader/Loader.css +51 -0
- package/src/components/Loader/Loader.vue +65 -0
- package/src/utils/index.ts +61 -2
package/App.vue
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="app">
|
|
3
3
|
<div class="element-container">
|
|
4
|
-
|
|
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
9
|
<Card duplicate-treatment-datetime disabled :appointment="value4" :dentist-image-src="value4.dentist.imageSrc" @confirm="onConfirmed" @cancel="onCancelled" @reschedule="onRescheduled" />
|
|
10
|
-
</div
|
|
11
|
-
|
|
10
|
+
</div>-->
|
|
11
|
+
<Loader :size="128" />
|
|
12
|
+
</div>
|
|
12
13
|
</div>
|
|
13
14
|
</template>
|
|
14
15
|
|
|
15
16
|
<script setup lang="ts">
|
|
16
|
-
import
|
|
17
|
+
import Loader from '@/components/Loader/Loader.vue';
|
|
18
|
+
/*import {ref} from 'vue';
|
|
17
19
|
import type { AppointmentData } from '@/types';
|
|
18
20
|
import Card from '@/components/Appointment/Card/Card.vue';
|
|
19
21
|
|
|
@@ -122,7 +124,7 @@ const value4 = ref<AppointmentData>({
|
|
|
122
124
|
type: 1,
|
|
123
125
|
address: "Musterstraße 1, 12345 Musterstadt",
|
|
124
126
|
district: "Musterstadt-Mitte"
|
|
125
|
-
})
|
|
127
|
+
});*/
|
|
126
128
|
</script>
|
|
127
129
|
|
|
128
130
|
<style scoped>
|
package/package.json
CHANGED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/* Loader container */
|
|
2
|
+
.loader-container {
|
|
3
|
+
position: absolute;
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
align-items: center;
|
|
7
|
+
z-index: 10;
|
|
8
|
+
height: 100%;
|
|
9
|
+
width: 100%;
|
|
10
|
+
top: 0;
|
|
11
|
+
left: 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/* Loader content wrapper */
|
|
15
|
+
.loader-content {
|
|
16
|
+
text-align: center;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* Loader spinner SVG */
|
|
20
|
+
.loader-svg {
|
|
21
|
+
color: #e5e7eb; /* text-gray-200 */
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* Dark mode support */
|
|
25
|
+
@media (prefers-color-scheme: dark) {
|
|
26
|
+
.loader-svg {
|
|
27
|
+
color: #e5e7eb; /* dark:text-gray-200 */
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* Rotating arc animation - only applied to the spinning element */
|
|
32
|
+
.loader-spinner-arc {
|
|
33
|
+
animation: spin 1s linear infinite;
|
|
34
|
+
transform-origin: center;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* Spin animation */
|
|
38
|
+
@keyframes spin {
|
|
39
|
+
from {
|
|
40
|
+
transform: rotate(0deg);
|
|
41
|
+
}
|
|
42
|
+
to {
|
|
43
|
+
transform: rotate(360deg);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* Ensure focus-visible styles for accessibility */
|
|
48
|
+
div:focus-visible {
|
|
49
|
+
outline: 2px solid;
|
|
50
|
+
outline-offset: 2px;
|
|
51
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- Loader container -->
|
|
3
|
+
<div class="loader-container" role="alert"
|
|
4
|
+
aria-live="assertive" aria-busy="true">
|
|
5
|
+
<!-- Spinner and loading text -->
|
|
6
|
+
<div class="loader-content">
|
|
7
|
+
<div role="status">
|
|
8
|
+
<svg
|
|
9
|
+
aria-hidden="true"
|
|
10
|
+
class="loader-svg"
|
|
11
|
+
:style="sizeStyle"
|
|
12
|
+
viewBox="0 0 100 101"
|
|
13
|
+
fill="none"
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
>
|
|
16
|
+
<!-- Spinner background circle -->
|
|
17
|
+
<path
|
|
18
|
+
d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
|
|
19
|
+
fill="currentColor"
|
|
20
|
+
/>
|
|
21
|
+
<!-- Letter W (static, centered inside circle) -->
|
|
22
|
+
<g transform="translate(31, 38) scale(0.95)">
|
|
23
|
+
<path
|
|
24
|
+
d="M27.9014 17.5679L24.7789 5.30116C24.3567 3.65231 23.6837 2.42165 22.7557 1.61316C21.8237 0.80069 20.6249 0.398438 19.1553 0.398438C17.6857 0.398438 16.5148 0.812639 15.5549 1.63308C14.5951 2.4575 13.8902 3.71206 13.4401 5.39276L10.3177 17.5759L6.60181 1.07152H0.078125L4.30777 19.1172C4.57859 20.2562 5.02864 21.1922 5.65791 21.929C6.28718 22.6658 7.03194 23.2114 7.88424 23.5699C8.74053 23.9283 9.58885 24.1115 10.4252 24.1115C11.7435 24.1115 12.9064 23.6973 13.9101 22.8729C14.9137 22.0485 15.6266 20.8098 16.0488 19.161L19.1155 6.81061L22.214 19.161C22.6322 20.8098 23.3372 22.0485 24.3289 22.8729C25.3166 23.6973 26.4875 24.1115 27.8376 24.1115C28.678 24.1115 29.5183 23.9283 30.3587 23.5699C31.199 23.2114 31.9319 22.6658 32.5611 21.929C33.1904 21.1922 33.6404 20.2562 33.9113 19.1172L37.9179 1.07152H31.4818L27.8974 17.5679H27.9014Z"
|
|
25
|
+
:fill="siteColors['font_color_code']"
|
|
26
|
+
/>
|
|
27
|
+
</g>
|
|
28
|
+
<!-- Spinner accent arc (static, centered below W) -->
|
|
29
|
+
<g transform="translate(25, 56) scale(1)">
|
|
30
|
+
<path
|
|
31
|
+
d="M24.996 17.9172C14.9397 17.9172 5.51656 12.5246 0.406738 3.8463L6.41665 0.305664C10.2799 6.86519 17.401 10.9395 24.996 10.9395C32.591 10.9395 39.7121 6.86519 43.5754 0.305664L49.5853 3.8463C44.4715 12.5246 35.0524 17.9172 24.996 17.9172Z"
|
|
32
|
+
:fill="siteColors['font_color_code']"
|
|
33
|
+
/>
|
|
34
|
+
</g>
|
|
35
|
+
<!-- Spinner rotating arc (animated) -->
|
|
36
|
+
<g class="loader-spinner-arc">
|
|
37
|
+
<path
|
|
38
|
+
d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
|
|
39
|
+
:fill="siteColors['font_color_code']"
|
|
40
|
+
/>
|
|
41
|
+
</g>
|
|
42
|
+
</svg>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script setup lang="ts">
|
|
49
|
+
import { computed } from "vue";
|
|
50
|
+
import { siteColors } from "@/utils/index";
|
|
51
|
+
import "./Loader.css";
|
|
52
|
+
|
|
53
|
+
const props = defineProps({
|
|
54
|
+
size: {
|
|
55
|
+
type: Number,
|
|
56
|
+
required: false,
|
|
57
|
+
default: 96,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const sizeStyle = computed(() => ({
|
|
62
|
+
width: `${props.size}px`,
|
|
63
|
+
height: `${props.size}px`,
|
|
64
|
+
}));
|
|
65
|
+
</script>
|
package/src/utils/index.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { ref } from "vue";
|
|
2
|
+
|
|
3
|
+
const appointmentTypes = [
|
|
2
4
|
{
|
|
3
5
|
id: 0,
|
|
4
6
|
icon: 'simple',
|
|
@@ -39,4 +41,61 @@ export const appointmentTypes = [
|
|
|
39
41
|
description: 'Hier steht Text zu der Termin option die ungefähr so lang ist.',
|
|
40
42
|
additionalClass: ""
|
|
41
43
|
},
|
|
42
|
-
];
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
const getDomainName = () => {
|
|
47
|
+
const host = window.location.hostname;
|
|
48
|
+
const m = host.match(/([^.]+)\.app/);
|
|
49
|
+
return m?.[1] ?? null;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const generateDynamicDomain = () => {
|
|
53
|
+
const protocol = window.location.protocol; // e.g., "http:"
|
|
54
|
+
const host = window.location.host; // e.g., "localhost:3000"
|
|
55
|
+
return `${protocol}//${host}`; // Combine protocol and host
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const domain: any = ref(null);
|
|
59
|
+
const currentDomain = generateDynamicDomain().toLowerCase();
|
|
60
|
+
|
|
61
|
+
if (currentDomain.includes("white-cocoon")) {
|
|
62
|
+
domain.value = "domain-cocoon";
|
|
63
|
+
} else {
|
|
64
|
+
domain.value = "domain-dental";
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
let siteColors: any = {
|
|
68
|
+
"border-color": "border-[var(--dental-blue-0)]",
|
|
69
|
+
font_color: "!text-[var(--dental-blue-0)]",
|
|
70
|
+
btn_bg: "bg-[var(--dental-blue-0)]",
|
|
71
|
+
"border-b": "border-b-[var(--dental-blue-0)]",
|
|
72
|
+
font_color_code: "#172774",
|
|
73
|
+
"slot-bg": "bg-[var(--dental-light-blue-0)]",
|
|
74
|
+
bg_0: "bg-[var(--dental-light-blue-3)]",
|
|
75
|
+
button_rounded: "lg",
|
|
76
|
+
"divider-color": "divide-[var(--dental-blue-0)]",
|
|
77
|
+
domain: domain.value,
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
if (domain.value === "domain-cocoon") {
|
|
81
|
+
siteColors = {
|
|
82
|
+
font_color: "!text-[var(--night-nude-0)]",
|
|
83
|
+
font_color_code: "#A1978F",
|
|
84
|
+
"border-b": "border-b-[var(--night-nude-0)]",
|
|
85
|
+
bg_0: "bg-[var(--light-nude-3)]",
|
|
86
|
+
font_family: "font-['arial']",
|
|
87
|
+
btn_bg: "bg-[var(--dark-nude-0)]",
|
|
88
|
+
"border-color": "border-[var(--night-nude-0)]",
|
|
89
|
+
"slot-bg": "bg-[#DCE7F7]",
|
|
90
|
+
"slot-text": "text-[#4E5257]",
|
|
91
|
+
"divider-color": "divide-[var(--night-nude-0)]",
|
|
92
|
+
button_rounded: "0",
|
|
93
|
+
domain: domain.value,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export {
|
|
98
|
+
siteColors,
|
|
99
|
+
getDomainName,
|
|
100
|
+
appointmentTypes
|
|
101
|
+
};
|