@zap-wunschlachen/wl-shared-components 1.0.0
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/.github/workflows/playwright.yml +215 -0
- package/.github/workflows/static.yml +62 -0
- package/.prettierrc +5 -0
- package/.storybook/main.ts +18 -0
- package/.storybook/preview.ts +37 -0
- package/.storybook/storyWrapper.vue +18 -0
- package/.storybook/withVuetifyTheme.decorator.ts +21 -0
- package/App.vue +95 -0
- package/README.md +56 -0
- package/heroicons.ts +75 -0
- package/index.html +19 -0
- package/package.json +66 -0
- package/playwright.config.ts +35 -0
- package/public/audio/dummy_pink_noise.wav +0 -0
- package/public/background.svg +60 -0
- package/public/javascript.svg +1 -0
- package/public/style.css +187 -0
- package/public/technologies.svg +22 -0
- package/src/assets/css/base.css +235 -0
- package/src/assets/css/variables.css +96 -0
- package/src/assets/fonts/Outfit-Black.ttf +0 -0
- package/src/assets/fonts/Outfit-Bold.ttf +0 -0
- package/src/assets/fonts/Outfit-ExtraBold.ttf +0 -0
- package/src/assets/fonts/Outfit-ExtraLight.ttf +0 -0
- package/src/assets/fonts/Outfit-Light.ttf +0 -0
- package/src/assets/fonts/Outfit-Medium.ttf +0 -0
- package/src/assets/fonts/Outfit-Regular.ttf +0 -0
- package/src/assets/fonts/Outfit-SemiBold.ttf +0 -0
- package/src/assets/fonts/Outfit-Thin.ttf +0 -0
- package/src/components/Accordion/Accordion.css +59 -0
- package/src/components/Accordion/AccordionGroup.vue +51 -0
- package/src/components/Accordion/AccordionItem.vue +66 -0
- package/src/components/Appointment/Card/Actions.css +30 -0
- package/src/components/Appointment/Card/Actions.vue +66 -0
- package/src/components/Appointment/Card/Card.css +49 -0
- package/src/components/Appointment/Card/Card.vue +55 -0
- package/src/components/Appointment/Card/Details.css +51 -0
- package/src/components/Appointment/Card/Details.vue +44 -0
- package/src/components/Audio/Audio.vue +188 -0
- package/src/components/Audio/Waveform.vue +118 -0
- package/src/components/Button/Button.vue +119 -0
- package/src/components/CheckBox/CheckBox.css +185 -0
- package/src/components/CheckBox/Checkbox.vue +130 -0
- package/src/components/DateInput/DateInput.css +3 -0
- package/src/components/DateInput/DateInput.vue +263 -0
- package/src/components/Dialog/Dialog.css +6 -0
- package/src/components/Dialog/Dialog.vue +29 -0
- package/src/components/EditField/EditField.css +20 -0
- package/src/components/EditField/EditField.vue +202 -0
- package/src/components/IconBullet/IconBullet.vue +86 -0
- package/src/components/IconBullet/IconBulletList.vue +41 -0
- package/src/components/Icons/Audio/CloudFailed.vue +21 -0
- package/src/components/Icons/Audio/CloudSaved.vue +22 -0
- package/src/components/Icons/Audio/Delete.vue +16 -0
- package/src/components/Icons/Audio/Pause.vue +19 -0
- package/src/components/Icons/Audio/Play.vue +16 -0
- package/src/components/Icons/CalendarNotification.vue +126 -0
- package/src/components/Icons/Chair.vue +32 -0
- package/src/components/Icons/ChairNotification.vue +35 -0
- package/src/components/Icons/Circle.vue +66 -0
- package/src/components/Icons/FavIcon.vue +22 -0
- package/src/components/Icons/FilledCircle.vue +11 -0
- package/src/components/Icons/Group3.vue +46 -0
- package/src/components/Icons/RingNotification.vue +54 -0
- package/src/components/Icons/SolidArrowRight.vue +14 -0
- package/src/components/Icons/calendar.vue +17 -0
- package/src/components/Icons/checkbox.vue +19 -0
- package/src/components/Icons/outlineChecked.vue +27 -0
- package/src/components/Icons/play.vue +6 -0
- package/src/components/Input/Input.css +187 -0
- package/src/components/Input/Input.vue +247 -0
- package/src/components/Laboratory/AppointmentCard/AppointmentCard.css +7 -0
- package/src/components/Laboratory/AppointmentCard/AppointmentCard.vue +116 -0
- package/src/components/Laboratory/ChatBoxImage/ChatBoxImage.vue +81 -0
- package/src/components/Laboratory/ChatMessage/ChatMessage.vue +113 -0
- package/src/components/Laboratory/ChatMessage/ChatMessageBadge.css +4 -0
- package/src/components/Laboratory/ChatMessage/ChatMessageBadge.vue +99 -0
- package/src/components/Laboratory/ChatNotification/ChatNotification.vue +130 -0
- package/src/components/Laboratory/DocumentCard/DocumentCard.css +3 -0
- package/src/components/Laboratory/DocumentCard/DocumentCard.vue +50 -0
- package/src/components/Laboratory/DocumentCard/DocumentCardItem.vue +53 -0
- package/src/components/Laboratory/InfoCard/InfoCard.vue +162 -0
- package/src/components/Laboratory/MainColumnsBar/MainColumnsBar.vue +102 -0
- package/src/components/Laboratory/ProgressCircle/ProgressCircle.vue +152 -0
- package/src/components/Laboratory/ProgressLinear/ProgressLinear.css +33 -0
- package/src/components/Laboratory/ProgressLinear/ProgressLinear.vue +75 -0
- package/src/components/Laboratory/SelectionColumnBar/SelectionColumnBar.vue +92 -0
- package/src/components/Laboratory/StatusNotification/StatusNotification.vue +49 -0
- package/src/components/Laboratory/TagLabel/TagLabel.vue +126 -0
- package/src/components/Laboratory/TagLabelGroup/TagLabelGroup.vue +97 -0
- package/src/components/Laboratory/TicketCard/TicketCard.css +3 -0
- package/src/components/Laboratory/TicketCard/TicketCard.vue +143 -0
- package/src/components/Laboratory/TimeLine/TimeLineEvent.css +18 -0
- package/src/components/Laboratory/TimeLine/TimeLineEvent.vue +119 -0
- package/src/components/Laboratory/TimeLine/Timeline.css +4 -0
- package/src/components/Laboratory/TimeLine/Timeline.vue +30 -0
- package/src/components/Modal/Modal.css +6 -0
- package/src/components/Modal/Modal.vue +23 -0
- package/src/components/NotificationBubble/NotificationBubble.css +4 -0
- package/src/components/NotificationBubble/NotificationBubble.vue +90 -0
- package/src/components/OtpInput/OtpInput.css +39 -0
- package/src/components/OtpInput/OtpInput.vue +144 -0
- package/src/components/PhoneInput/PhoneInput.css +32 -0
- package/src/components/PhoneInput/PhoneInput.vue +114 -0
- package/src/components/Select/Select.css +150 -0
- package/src/components/Select/Select.vue +304 -0
- package/src/components/TextArea/TextArea.css +3 -0
- package/src/components/TextArea/TextArea.vue +126 -0
- package/src/components/TickBox/TickBox.css +49 -0
- package/src/components/TickBox/TickBox.vue +126 -0
- package/src/components/index.ts +20 -0
- package/src/constants/buttonEnums.ts +0 -0
- package/src/constants/iconEnums.ts +4 -0
- package/src/i18n/i18n.ts +16 -0
- package/src/i18n/locales/de.json +19 -0
- package/src/i18n/locales/en.json +19 -0
- package/src/index.ts +31 -0
- package/src/main.ts +11 -0
- package/src/plugins/vuetify.ts +131 -0
- package/src/shims-vue.d.ts +10 -0
- package/src/stories/Accordion.stories.ts +650 -0
- package/src/stories/Audio.stories.ts +29 -0
- package/src/stories/Button.stories.ts +263 -0
- package/src/stories/CheckBox.stories.ts +348 -0
- package/src/stories/DateInput.stories.ts +54 -0
- package/src/stories/Dialog.stories.ts +147 -0
- package/src/stories/EditField.stories.ts +79 -0
- package/src/stories/IconBullet/IconBullet.stories.ts +201 -0
- package/src/stories/IconBullet/IconBulletList.stories.ts +275 -0
- package/src/stories/Input.stories.ts +351 -0
- package/src/stories/Laboratory/Cards/AppointmentCard/AppointmentCard.stories.ts +260 -0
- package/src/stories/Laboratory/Cards/DocumentCard/DocumentCard.stories.ts +176 -0
- package/src/stories/Laboratory/Cards/DocumentCard/DocumentCardItem.stories.ts +119 -0
- package/src/stories/Laboratory/Cards/InfoCard/InfoCard.stories.ts +320 -0
- package/src/stories/Laboratory/Cards/TicketCard/TicketCard.stories.ts +335 -0
- package/src/stories/Laboratory/Chat/ChatBoxImage.stories.ts +82 -0
- package/src/stories/Laboratory/Chat/ChatMessage.stories.ts +198 -0
- package/src/stories/Laboratory/Chat/ChatMessageBadge.stories.ts +204 -0
- package/src/stories/Laboratory/Chat/ChatNotification.stories.ts +144 -0
- package/src/stories/Laboratory/Chat/ProgressLinear.stories.ts +186 -0
- package/src/stories/Laboratory/Chat/StatusNotification.stories.ts +111 -0
- package/src/stories/Laboratory/MainColumnsBar.stories.ts +48 -0
- package/src/stories/Laboratory/ProgressCircle.stories.ts +261 -0
- package/src/stories/Laboratory/SelectionColumnBar.stories.ts +234 -0
- package/src/stories/Laboratory/TagLabel.stories.ts +418 -0
- package/src/stories/Laboratory/TagLabelGroup.stories.ts +234 -0
- package/src/stories/Laboratory/Timeline.stories.ts +403 -0
- package/src/stories/NotificationBubble.stories.ts +194 -0
- package/src/stories/OtpInput.stories.ts +101 -0
- package/src/stories/PhoneInput.stories.ts +53 -0
- package/src/stories/Select.stories.ts +419 -0
- package/src/stories/TextArea.stories.ts +112 -0
- package/src/stories/TickBox.stories.ts +294 -0
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +1 -0
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +1 -0
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +1 -0
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +1 -0
- package/src/stories/assets/youtube.svg +1 -0
- package/src/stories/v-icon.stories.ts +91 -0
- package/src/types/index.ts +21 -0
- package/src/vite-env.d.ts +1 -0
- package/tests/e2e/README.md +221 -0
- package/tests/e2e/accessibility.spec.ts +639 -0
- package/tests/e2e/accordion.spec.ts +42 -0
- package/tests/e2e/additional-components.spec.ts +438 -0
- package/tests/e2e/all-components.spec.ts +135 -0
- package/tests/e2e/button-fixed.spec.ts +59 -0
- package/tests/e2e/button.spec.ts +76 -0
- package/tests/e2e/checkbox.spec.ts +50 -0
- package/tests/e2e/date-input.spec.ts +46 -0
- package/tests/e2e/debug.spec.ts +52 -0
- package/tests/e2e/dialog.spec.ts +58 -0
- package/tests/e2e/input.spec.ts +55 -0
- package/tests/e2e/laboratory-components.spec.ts +321 -0
- package/tests/e2e/otp-input.spec.ts +50 -0
- package/tests/e2e/select.spec.ts +52 -0
- package/tests/e2e/storybook-utils.ts +59 -0
- package/tests/e2e/test-basic.spec.ts +34 -0
- package/tests/e2e/visual-regression.spec.ts +351 -0
- package/tests/unit/components/Accordion/AccordionGroup.spec.ts +343 -0
- package/tests/unit/components/Accordion/AccordionItem.spec.ts +384 -0
- package/tests/unit/components/Audio/Audio.spec.ts +404 -0
- package/tests/unit/components/Audio/Waveform.spec.ts +484 -0
- package/tests/unit/components/Core/Button.spec.ts +337 -0
- package/tests/unit/components/Core/Checkbox.spec.ts +545 -0
- package/tests/unit/components/Core/DateInput.spec.ts +691 -0
- package/tests/unit/components/Core/Dialog.spec.ts +486 -0
- package/tests/unit/components/Core/EditField.spec.ts +783 -0
- package/tests/unit/components/Core/Input.spec.ts +513 -0
- package/tests/unit/components/Core/Modal.spec.ts +519 -0
- package/tests/unit/components/Core/NotificationBubble.spec.ts +607 -0
- package/tests/unit/components/Core/OtpInput.spec.ts +709 -0
- package/tests/unit/components/Core/PhoneInput.spec.ts +620 -0
- package/tests/unit/components/Core/Select.spec.ts +713 -0
- package/tests/unit/components/Core/TextArea.spec.ts +566 -0
- package/tests/unit/components/Core/TickBox.spec.ts +780 -0
- package/tests/unit/components/IconBullet/IconBullet.spec.ts +357 -0
- package/tests/unit/components/IconBullet/IconBulletList.spec.ts +372 -0
- package/tests/unit/components/Icons/Audio/CloudFailed.spec.ts +109 -0
- package/tests/unit/components/Icons/Audio/CloudSaved.spec.ts +150 -0
- package/tests/unit/components/Icons/Audio/Delete.spec.ts +159 -0
- package/tests/unit/components/Icons/Audio/Pause.spec.ts +209 -0
- package/tests/unit/components/Icons/Audio/Play.spec.ts +218 -0
- package/tests/unit/components/Icons/CalendarNotification.spec.ts +187 -0
- package/tests/unit/components/Icons/Chair.spec.ts +235 -0
- package/tests/unit/components/Icons/ChairNotification.spec.ts +312 -0
- package/tests/unit/components/Icons/Circle.spec.ts +256 -0
- package/tests/unit/components/Icons/FavIcon.spec.ts +252 -0
- package/tests/unit/components/Icons/FilledCircle.spec.ts +275 -0
- package/tests/unit/components/Icons/Group3.spec.ts +356 -0
- package/tests/unit/components/Icons/RingNotification.spec.ts +394 -0
- package/tests/unit/components/Icons/calendar.spec.ts +287 -0
- package/tests/unit/components/Icons/checkbox.spec.ts +316 -0
- package/tests/unit/components/Icons/outlineChecked.spec.ts +435 -0
- package/tests/unit/components/Icons/play.spec.ts +309 -0
- package/tests/unit/components/Laboratory/AppointmentCard.spec.ts +168 -0
- package/tests/unit/components/Laboratory/ChatBoxImage.spec.ts +180 -0
- package/tests/unit/components/Laboratory/ChatMessage.spec.ts +264 -0
- package/tests/unit/components/Laboratory/ChatMessageBadge.spec.ts +283 -0
- package/tests/unit/components/Laboratory/ChatNotification.spec.ts +257 -0
- package/tests/unit/components/Laboratory/DocumentCard.spec.ts +229 -0
- package/tests/unit/components/Laboratory/DocumentCardItem.spec.ts +237 -0
- package/tests/unit/components/Laboratory/InfoCard.spec.ts +309 -0
- package/tests/unit/components/Laboratory/MainColumnsBar.spec.ts +252 -0
- package/tests/unit/components/Laboratory/ProgressCircle.spec.ts +291 -0
- package/tests/unit/components/Laboratory/ProgressLinear.spec.ts +276 -0
- package/tests/unit/components/Laboratory/SelectionColumnBar.spec.ts +289 -0
- package/tests/unit/components/Laboratory/StatusNotification.spec.ts +297 -0
- package/tests/unit/components/Laboratory/TagLabel.spec.ts +354 -0
- package/tests/unit/components/Laboratory/TagLabelGroup.spec.ts +378 -0
- package/tests/unit/components/Laboratory/TicketCard.spec.ts +352 -0
- package/tests/unit/components/Laboratory/TimeLineEvent.spec.ts +382 -0
- package/tests/unit/components/Laboratory/Timeline.spec.ts +420 -0
- package/tests/unit/constants/iconEnums.spec.ts +40 -0
- package/tests/unit/i18n/i18n.spec.ts +89 -0
- package/tests/unit/plugins/vuetify.spec.ts +221 -0
- package/tests/unit/setup.ts +190 -0
- package/tests/unit/src/components/index.spec.ts +193 -0
- package/tests/unit/src/index.spec.ts +183 -0
- package/tests/unit/src/main.spec.ts +152 -0
- package/tsconfig.json +26 -0
- package/vite.config.ts +29 -0
- package/vitest.config.ts +84 -0
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-combobox
|
|
3
|
+
ref="inputRef"
|
|
4
|
+
class="wl-select"
|
|
5
|
+
:class="{
|
|
6
|
+
'border-on-hover': borderOnHover
|
|
7
|
+
}"
|
|
8
|
+
rounded="lg"
|
|
9
|
+
:density="density"
|
|
10
|
+
:variant="props.variant"
|
|
11
|
+
:label="label"
|
|
12
|
+
:chips="chips"
|
|
13
|
+
:append-icon="appendIcon"
|
|
14
|
+
:append-inner-icon="appendInnerIcon"
|
|
15
|
+
:prepend-icon="prependIcon"
|
|
16
|
+
:prepend-inner-icon="prependInnerIcon"
|
|
17
|
+
:menu-icon="menuIcon"
|
|
18
|
+
:clear-icon="clearIcon"
|
|
19
|
+
:closable-chips="closableChips"
|
|
20
|
+
:multiple="multiple"
|
|
21
|
+
:hide-details="true"
|
|
22
|
+
:clearable="clearable"
|
|
23
|
+
:items="items"
|
|
24
|
+
:disabled="disabled"
|
|
25
|
+
:error="error"
|
|
26
|
+
:item-title="'title'"
|
|
27
|
+
:item-value="'value'"
|
|
28
|
+
:return-object="returnObject"
|
|
29
|
+
v-model="internalValue"
|
|
30
|
+
@click:append="onClickAppend"
|
|
31
|
+
@click:append-inner="onClickAppendInner"
|
|
32
|
+
@click:clear="onClickClear"
|
|
33
|
+
@click:prepend="onClickPrepend"
|
|
34
|
+
@click:prepend-inner="onClickPrependInner"
|
|
35
|
+
@update:search="onUpdateSearch"
|
|
36
|
+
data-testid="root"
|
|
37
|
+
>
|
|
38
|
+
<template v-slot:menu>
|
|
39
|
+
<slot name="menu"></slot>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<template v-if="$slots['prepend']" #prepend>
|
|
43
|
+
<slot name="prepend"></slot>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<template v-if="$slots['prepend-inner']" #prepend-inner>
|
|
47
|
+
<slot name="prepend-inner"></slot>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<template v-if="$slots['append']" #append>
|
|
51
|
+
<slot name="append"></slot>
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<template v-if="$slots['append-inner']" #append-inner>
|
|
55
|
+
<slot name="append-inner"></slot>
|
|
56
|
+
</template>
|
|
57
|
+
</v-combobox>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<script setup>
|
|
61
|
+
import './Select.css';
|
|
62
|
+
import { ref, watch, nextTick } from 'vue';
|
|
63
|
+
import { defineProps, defineEmits } from 'vue';
|
|
64
|
+
|
|
65
|
+
// Define component props with default values and descriptions
|
|
66
|
+
const props = defineProps({
|
|
67
|
+
/**
|
|
68
|
+
* Disables the select input when true, making it non-interactive.
|
|
69
|
+
* Default is false.
|
|
70
|
+
*/
|
|
71
|
+
disabled: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: false,
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Changes the select input state, when true, put it into error state.
|
|
78
|
+
* Default is false.
|
|
79
|
+
*/
|
|
80
|
+
error: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: false,
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Allows clearing the selected value when true.
|
|
87
|
+
* Default is true.
|
|
88
|
+
*/
|
|
89
|
+
clearable: {
|
|
90
|
+
type: Boolean,
|
|
91
|
+
default: false,
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The label displayed above the select input.
|
|
96
|
+
* Default is 'Label'.
|
|
97
|
+
*/
|
|
98
|
+
label: {
|
|
99
|
+
type: String,
|
|
100
|
+
default: 'Label',
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Enables the display of selected items as chips when true.
|
|
105
|
+
* Default is false.
|
|
106
|
+
*/
|
|
107
|
+
chips: {
|
|
108
|
+
type: Boolean,
|
|
109
|
+
default: false,
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Icon to append to the select field.
|
|
114
|
+
*/
|
|
115
|
+
appendIcon: {
|
|
116
|
+
type: String,
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Inner icon to append inside the select field.
|
|
121
|
+
*/
|
|
122
|
+
appendInnerIcon: {
|
|
123
|
+
type: String,
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Icon to prepend to the select field.
|
|
128
|
+
*/
|
|
129
|
+
prependIcon: {
|
|
130
|
+
type: String,
|
|
131
|
+
},
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Inner icon to prepend inside the select field.
|
|
135
|
+
*/
|
|
136
|
+
prependInnerIcon: {
|
|
137
|
+
type: String,
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* The icon for the menu toggle.
|
|
142
|
+
* Default is an empty string (no icon).
|
|
143
|
+
*/
|
|
144
|
+
menuIcon: {
|
|
145
|
+
type: String,
|
|
146
|
+
default: '',
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* The icon to use for the clear button.
|
|
151
|
+
* Default is 'x-mark'.
|
|
152
|
+
*/
|
|
153
|
+
clearIcon: {
|
|
154
|
+
type: String,
|
|
155
|
+
default: 'x-mark',
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Enables closing chips when true.
|
|
160
|
+
* Default is false.
|
|
161
|
+
*/
|
|
162
|
+
closableChips: {
|
|
163
|
+
type: Boolean,
|
|
164
|
+
default: false,
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Allows multiple selections when true.
|
|
169
|
+
* Default is false.
|
|
170
|
+
*/
|
|
171
|
+
multiple: {
|
|
172
|
+
type: Boolean,
|
|
173
|
+
default: false,
|
|
174
|
+
},
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* The items available for selection.
|
|
178
|
+
* Default is an empty array.
|
|
179
|
+
*/
|
|
180
|
+
items: {
|
|
181
|
+
type: Array,
|
|
182
|
+
default: () => [],
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* The selected value (can be a string, array, or object).
|
|
187
|
+
*/
|
|
188
|
+
modelValue: {
|
|
189
|
+
type: [String, Array, Object],
|
|
190
|
+
default: undefined,
|
|
191
|
+
},
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* The density of the select input.
|
|
195
|
+
* Controls spacing and size. Default is 'compact'.
|
|
196
|
+
*/
|
|
197
|
+
density: {
|
|
198
|
+
type: String,
|
|
199
|
+
default: 'compact',
|
|
200
|
+
},
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* When true, the selected item is returned as an object.
|
|
204
|
+
* Default is true.
|
|
205
|
+
*/
|
|
206
|
+
returnObject: {
|
|
207
|
+
type: Boolean,
|
|
208
|
+
default: true,
|
|
209
|
+
},
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* The property name of the item to display as the title.
|
|
213
|
+
*/
|
|
214
|
+
itemTitle: {
|
|
215
|
+
type: String,
|
|
216
|
+
default: undefined,
|
|
217
|
+
},
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* The property name of the item to use as the value.
|
|
221
|
+
*/
|
|
222
|
+
itemValue: {
|
|
223
|
+
type: String,
|
|
224
|
+
default: undefined,
|
|
225
|
+
},
|
|
226
|
+
|
|
227
|
+
variant: {
|
|
228
|
+
type: String,
|
|
229
|
+
default: 'outlined',
|
|
230
|
+
},
|
|
231
|
+
|
|
232
|
+
borderOnHover: {
|
|
233
|
+
type: Boolean,
|
|
234
|
+
default: false
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
// Define events that can be emitted by the component
|
|
239
|
+
const emits = defineEmits([
|
|
240
|
+
'update:modelValue', // Emit when the model value is updated
|
|
241
|
+
'click:append', // Emit when the append icon is clicked
|
|
242
|
+
'click:appendInner', // Emit when the append inner icon is clicked
|
|
243
|
+
'click:clear', // Emit when the clear button is clicked
|
|
244
|
+
'click:prepend', // Emit when the prepend icon is clicked
|
|
245
|
+
'click:prependInner', // Emit when the prepend inner icon is clicked
|
|
246
|
+
'update:search', // Emit search updates for filtering items
|
|
247
|
+
]);
|
|
248
|
+
|
|
249
|
+
// Define a reactive reference for internal value based on the modelValue prop
|
|
250
|
+
const internalValue = ref(props.modelValue);
|
|
251
|
+
|
|
252
|
+
// Watch for changes in modelValue prop and update internalValue accordingly
|
|
253
|
+
watch(
|
|
254
|
+
() => props.modelValue,
|
|
255
|
+
(newValue) => {
|
|
256
|
+
internalValue.value = newValue;
|
|
257
|
+
},
|
|
258
|
+
);
|
|
259
|
+
|
|
260
|
+
// Watch for changes in internalValue and emit updated modelValue to parent
|
|
261
|
+
watch(internalValue, (newValue) => {
|
|
262
|
+
emits('update:modelValue', newValue);
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
// Emit click events for various icon and button interactions
|
|
266
|
+
const onClickAppend = (event) => emits('click:append', event);
|
|
267
|
+
const onClickAppendInner = (event) => emits('click:appendInner', event);
|
|
268
|
+
const onClickClear = (event) => emits('click:clear', event);
|
|
269
|
+
const onClickPrepend = (event) => emits('click:prepend', event);
|
|
270
|
+
const onClickPrependInner = (event) => emits('click:prependInner', event);
|
|
271
|
+
|
|
272
|
+
// Emit search updates for filtering or searching items
|
|
273
|
+
const onUpdateSearch = (searchValue) => emits('update:search', searchValue);
|
|
274
|
+
|
|
275
|
+
const inputRef = ref(null)
|
|
276
|
+
|
|
277
|
+
const getNativeInput = () => {
|
|
278
|
+
return inputRef.value?.$el?.querySelector('input');
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
const blur = () => {
|
|
282
|
+
nextTick(() => {
|
|
283
|
+
getNativeInput()?.blur();
|
|
284
|
+
});
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
const select = () => {
|
|
288
|
+
nextTick(() => {
|
|
289
|
+
getNativeInput()?.select();
|
|
290
|
+
});
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
const focus = () => {
|
|
294
|
+
nextTick(() => {
|
|
295
|
+
getNativeInput()?.focus();
|
|
296
|
+
});
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
defineExpose({
|
|
300
|
+
blur,
|
|
301
|
+
select,
|
|
302
|
+
focus
|
|
303
|
+
});
|
|
304
|
+
</script>
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-textarea
|
|
3
|
+
class="text-area"
|
|
4
|
+
v-model="internalValue"
|
|
5
|
+
clearable
|
|
6
|
+
:clear-icon="clearIcon"
|
|
7
|
+
:label="label"
|
|
8
|
+
:prepend-icon="prependIcon"
|
|
9
|
+
:prepend-inner-icon="prependInnerIcon"
|
|
10
|
+
:append-icon="appendIcon"
|
|
11
|
+
:append-inner-icon="appendInnerIcon"
|
|
12
|
+
base-color="var(--Soft-Concrete-1)"
|
|
13
|
+
bg-color="white"
|
|
14
|
+
variant="outlined"
|
|
15
|
+
color="var(--Dental-Light-Blue-1)"
|
|
16
|
+
rounded="lg"
|
|
17
|
+
@click:append="emit('click:append', $event)"
|
|
18
|
+
@click:appendInner="emit('click:appendInner', $event)"
|
|
19
|
+
@click:clear="emit('click:clear', $event)"
|
|
20
|
+
@click:control="emit('click:control', $event)"
|
|
21
|
+
@click:prepend="emit('click:prepend', $event)"
|
|
22
|
+
@click:prependInner="emit('click:prependInner', $event)"
|
|
23
|
+
data-testid="root"
|
|
24
|
+
>
|
|
25
|
+
<!-- You can include slots if needed -->
|
|
26
|
+
</v-textarea>
|
|
27
|
+
</template>
|
|
28
|
+
<script setup>
|
|
29
|
+
import './TextArea.css';
|
|
30
|
+
import { computed } from 'vue';
|
|
31
|
+
|
|
32
|
+
// Define props for the TextArea component
|
|
33
|
+
const props = defineProps({
|
|
34
|
+
/**
|
|
35
|
+
* The value bound to the textarea, supporting both String and Number types.
|
|
36
|
+
* Default is an empty string.
|
|
37
|
+
*/
|
|
38
|
+
modelValue: {
|
|
39
|
+
type: [String, Number],
|
|
40
|
+
default: '',
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Icon for clearing the textarea content.
|
|
45
|
+
* Default is 'text-area'.
|
|
46
|
+
*/
|
|
47
|
+
clearIcon: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: 'text-area',
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Label for the textarea field.
|
|
54
|
+
* Default is 'Label'.
|
|
55
|
+
*/
|
|
56
|
+
label: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: 'Label',
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Icon displayed before the textarea.
|
|
63
|
+
* Default is null, meaning no icon is displayed by default.
|
|
64
|
+
*/
|
|
65
|
+
prependIcon: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: null,
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Inner icon displayed before the textarea, inside the input field.
|
|
72
|
+
* Default is null.
|
|
73
|
+
*/
|
|
74
|
+
prependInnerIcon: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: null,
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Icon displayed after the textarea.
|
|
81
|
+
* Default is null.
|
|
82
|
+
*/
|
|
83
|
+
appendIcon: {
|
|
84
|
+
type: String,
|
|
85
|
+
default: null,
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Inner icon displayed after the textarea, inside the input field.
|
|
90
|
+
* Default is null.
|
|
91
|
+
*/
|
|
92
|
+
appendInnerIcon: {
|
|
93
|
+
type: String,
|
|
94
|
+
default: null,
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
// Add more props as needed to customize the textarea
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
// Define emits for event handling
|
|
101
|
+
const emit = defineEmits([
|
|
102
|
+
'update:modelValue', // Emitted when the model value is updated
|
|
103
|
+
'click:append', // Emitted when the append icon is clicked
|
|
104
|
+
'click:appendInner', // Emitted when the append inner icon is clicked
|
|
105
|
+
'click:clear', // Emitted when the clear button is clicked
|
|
106
|
+
'click:control', // Emitted when the main textarea control is clicked
|
|
107
|
+
'click:prepend', // Emitted when the prepend icon is clicked
|
|
108
|
+
'click:prependInner', // Emitted when the prepend inner icon is clicked
|
|
109
|
+
]);
|
|
110
|
+
|
|
111
|
+
// Computed property to create two-way binding for v-model
|
|
112
|
+
const internalValue = computed({
|
|
113
|
+
get() {
|
|
114
|
+
return props.modelValue; // Getter returns the current modelValue prop
|
|
115
|
+
},
|
|
116
|
+
set(val) {
|
|
117
|
+
emit('update:modelValue', val); // Setter emits the updated value to parent component
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
</script>
|
|
121
|
+
|
|
122
|
+
<style>
|
|
123
|
+
.text-area .v-icon {
|
|
124
|
+
color: var(--Dental-Blue-0);
|
|
125
|
+
}
|
|
126
|
+
</style>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/* Default state */
|
|
2
|
+
.tick-box.default-state .v-icon {
|
|
3
|
+
color: var(--Dental-Blue-0) !important;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
/* Success state */
|
|
7
|
+
.tick-box.success-state .v-icon {
|
|
8
|
+
color: var(--Success-Green-0) !important;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/* Error state */
|
|
12
|
+
.tick-box.error-state .svg {
|
|
13
|
+
color: var(--Error-Red-0) !important;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* Common styles for the checkbox label */
|
|
17
|
+
.tick-box .v-label {
|
|
18
|
+
opacity: 1 !important;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.tick-box svg path {
|
|
22
|
+
stroke: var(--Dental-Blue-0);
|
|
23
|
+
fill: white;
|
|
24
|
+
stroke-width: 3px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.tick-box.success-state svg rect {
|
|
28
|
+
stroke: var(--Success-Green-0);
|
|
29
|
+
fill: white;
|
|
30
|
+
stroke-width: 1px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.tick-box.success-state svg path {
|
|
34
|
+
stroke: var(--Success-Green-0);
|
|
35
|
+
fill: white;
|
|
36
|
+
stroke-width: 3px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.tick-box.error-state svg path {
|
|
40
|
+
stroke: var(--Error-Red-0);
|
|
41
|
+
fill: white;
|
|
42
|
+
stroke-width: 3px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.tick-box.error-state svg rect {
|
|
46
|
+
stroke: var(--Error-Red-0);
|
|
47
|
+
fill: white;
|
|
48
|
+
stroke-width: 1px;
|
|
49
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-checkbox
|
|
3
|
+
class="tick-box"
|
|
4
|
+
:class="checkboxClass"
|
|
5
|
+
true-icon="heroicons:outline-checked"
|
|
6
|
+
false-icon="heroicons:outline"
|
|
7
|
+
:disabled="disabled"
|
|
8
|
+
:value="value"
|
|
9
|
+
:density="density"
|
|
10
|
+
v-model="internalValue"
|
|
11
|
+
:color="hoverColor"
|
|
12
|
+
:base-color="hoverColor"
|
|
13
|
+
data-testid="root"
|
|
14
|
+
>
|
|
15
|
+
<!-- Custom label slot with dynamic style -->
|
|
16
|
+
<template #label>
|
|
17
|
+
<span :style="labelStyles">{{ label }}</span>
|
|
18
|
+
</template>
|
|
19
|
+
</v-checkbox>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script setup>
|
|
23
|
+
import { computed } from 'vue';
|
|
24
|
+
import './TickBox.css';
|
|
25
|
+
|
|
26
|
+
// Define props for the TickBox component
|
|
27
|
+
const props = defineProps({
|
|
28
|
+
/**
|
|
29
|
+
* The label text displayed next to the tick box.
|
|
30
|
+
* This prop is required.
|
|
31
|
+
*/
|
|
32
|
+
label: {
|
|
33
|
+
type: String,
|
|
34
|
+
required: true,
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Indicates if the tick box is in a success state.
|
|
39
|
+
* When true, the success styling will be applied.
|
|
40
|
+
*/
|
|
41
|
+
success: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false,
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Indicates if the tick box is in an error state.
|
|
48
|
+
* When true, the error styling will be applied.
|
|
49
|
+
*/
|
|
50
|
+
error: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: false,
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Disables the tick box when true, making it non-interactive.
|
|
57
|
+
*/
|
|
58
|
+
disabled: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: false,
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The value that the tick box represents when checked.
|
|
65
|
+
* Can be a string, number, or boolean. Default is `true`.
|
|
66
|
+
*/
|
|
67
|
+
value: {
|
|
68
|
+
type: [String, Number, Boolean],
|
|
69
|
+
default: true,
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The current value bound to the tick box for v-model.
|
|
74
|
+
* Can be an array for multiple selection or boolean for single selection.
|
|
75
|
+
* This prop is required.
|
|
76
|
+
*/
|
|
77
|
+
modelValue: {
|
|
78
|
+
type: [Array, Boolean],
|
|
79
|
+
required: true,
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Controls the density of the tick box, such as padding and size.
|
|
84
|
+
* Default is 'comfortable'.
|
|
85
|
+
*/
|
|
86
|
+
density: {
|
|
87
|
+
type: String,
|
|
88
|
+
required: false,
|
|
89
|
+
default: 'comfortable',
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// Emit event for v-model binding
|
|
94
|
+
const emit = defineEmits(['update:modelValue']);
|
|
95
|
+
|
|
96
|
+
// Computed property for v-model binding (two-way binding)
|
|
97
|
+
const internalValue = computed({
|
|
98
|
+
get() {
|
|
99
|
+
return props.modelValue; // Get the current modelValue from the parent
|
|
100
|
+
},
|
|
101
|
+
set(newValue) {
|
|
102
|
+
emit('update:modelValue', newValue); // Emit the updated value to the parent
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
// Computed property for dynamic class based on error or success state
|
|
107
|
+
const checkboxClass = computed(() => {
|
|
108
|
+
if (props.error) return 'error-state'; // Return error class if in error state
|
|
109
|
+
if (props.success) return 'success-state'; // Return success class if in success state
|
|
110
|
+
return 'default-state'; // Default class when no error or success
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
// Computed property for dynamic label styles based on state
|
|
114
|
+
const labelStyles = computed(() => {
|
|
115
|
+
if (props.error) return { color: 'var(--Error-Red-0)' }; // Error styling for label
|
|
116
|
+
if (props.success) return { color: 'var(--Success-Green-1)' }; // Success styling for label
|
|
117
|
+
return { color: 'var(--Dental-Blue-0)' }; // Default label styling
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
// Computed property for dynamic color based on error or success state
|
|
121
|
+
const hoverColor = computed(() => {
|
|
122
|
+
if (props.error) return 'var(--Error-Red-0)';
|
|
123
|
+
if (props.success) return 'var(--Success-Green-1)';
|
|
124
|
+
return 'var(--Dental-Blue-0)';
|
|
125
|
+
});
|
|
126
|
+
</script>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Components index file
|
|
2
|
+
|
|
3
|
+
export { default as AccordionItem } from './Accordion/AccordionItem.vue';
|
|
4
|
+
export { default as AccordionGroup } from './Accordion/AccordionGroup.vue';
|
|
5
|
+
export { default as Audio } from './Audio/Audio.vue';
|
|
6
|
+
export { default as Button } from './Button/Button.vue';
|
|
7
|
+
export { default as Checkbox } from './CheckBox/Checkbox.vue';
|
|
8
|
+
export { default as DateInput } from './DateInput/DateInput.vue';
|
|
9
|
+
export { default as Dialog } from './Dialog/Dialog.vue';
|
|
10
|
+
export { default as IconBulletList } from './IconBullet/IconBulletList.vue';
|
|
11
|
+
export { default as IconBullet } from './IconBullet/IconBullet.vue';
|
|
12
|
+
export { default as Input } from './Input/Input.vue';
|
|
13
|
+
export { default as NotificationBubble } from './NotificationBubble/NotificationBubble.vue';
|
|
14
|
+
export { default as Select } from './Select/Select.vue';
|
|
15
|
+
export { default as TickBox } from './TickBox/TickBox.vue';
|
|
16
|
+
export { default as TextArea } from './TextArea/TextArea.vue';
|
|
17
|
+
export { default as OtpInput } from './OtpInput/OtpInput.vue';
|
|
18
|
+
export { default as PhoneInput } from './PhoneInput/PhoneInput.vue';
|
|
19
|
+
export { default as EditField } from './EditField/EditField.vue';
|
|
20
|
+
export { default as Modal } from './Modal/Modal.vue';
|
|
File without changes
|
package/src/i18n/i18n.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createI18n } from 'vue-i18n';
|
|
2
|
+
import enMessages from './locales/en.json';
|
|
3
|
+
import deMessages from './locales/de.json';
|
|
4
|
+
|
|
5
|
+
const libraryMessages = {
|
|
6
|
+
en: enMessages,
|
|
7
|
+
de: deMessages,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const createInternalI18n = () => {
|
|
11
|
+
return createI18n({
|
|
12
|
+
locale: 'de',
|
|
13
|
+
fallbackLocale: 'de',
|
|
14
|
+
messages: libraryMessages,
|
|
15
|
+
});
|
|
16
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"wl": {
|
|
3
|
+
"date_input": {
|
|
4
|
+
"placeholder": "TT.MM.JJJJ",
|
|
5
|
+
"invalid_date": "Bitte ein gültiges Datum eingeben",
|
|
6
|
+
"min_date_error": "Das Datum darf nicht vor {date} liegen",
|
|
7
|
+
"max_date_error": "Das Datum darf nicht nach {date} liegen"
|
|
8
|
+
},
|
|
9
|
+
"input": {
|
|
10
|
+
"placeholder": "Geben Sie Ihren Text ein"
|
|
11
|
+
},
|
|
12
|
+
"otp_input": {
|
|
13
|
+
"enter_sms_code": "Bitte den per SMS gesendeten Code eingeben",
|
|
14
|
+
"code_was_sent": "Code an Nummer {phoneNumber} gesendet",
|
|
15
|
+
"confirm": "Bestätigen",
|
|
16
|
+
"resend": "Code erneut senden"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"wl": {
|
|
3
|
+
"date_input": {
|
|
4
|
+
"placeholder": "DD.MM.YYYY",
|
|
5
|
+
"invalid_date": "Please enter a valid date",
|
|
6
|
+
"min_date_error": "The date must not be before {date}",
|
|
7
|
+
"max_date_error": "The date must not be after {date}"
|
|
8
|
+
},
|
|
9
|
+
"input": {
|
|
10
|
+
"placeholder": "Enter your text"
|
|
11
|
+
},
|
|
12
|
+
"otp_input": {
|
|
13
|
+
"enter_sms_code": "Please enter the code sent via SMS",
|
|
14
|
+
"code_was_sent": "Code sent to number {phoneNumber}",
|
|
15
|
+
"confirm": "Confirm",
|
|
16
|
+
"resend": "Resend code"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|