@zap-wunschlachen/wl-shared-components 1.0.66 → 1.0.68
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 +12 -2
- package/package.json +1 -1
- package/scripts/check-translations.ts +36 -36
- package/src/components/Select/Select.vue +8 -0
- package/src/pages/SelectPage.vue +1006 -0
- package/src/utils/index.ts +210 -0
package/App.vue
CHANGED
|
@@ -19,12 +19,21 @@
|
|
|
19
19
|
>
|
|
20
20
|
Accordion
|
|
21
21
|
</button>
|
|
22
|
+
<button
|
|
23
|
+
class="nav-btn"
|
|
24
|
+
:class="{ active: currentPage === 'select' }"
|
|
25
|
+
type="button"
|
|
26
|
+
@click="currentPage = 'select'"
|
|
27
|
+
>
|
|
28
|
+
Select
|
|
29
|
+
</button>
|
|
22
30
|
</nav>
|
|
23
31
|
</header>
|
|
24
32
|
|
|
25
33
|
<main class="app-main">
|
|
26
34
|
<AllPage v-if="currentPage === 'all'" />
|
|
27
|
-
<AccordionGroupPage v-else />
|
|
35
|
+
<AccordionGroupPage v-else-if="currentPage === 'accordion'" />
|
|
36
|
+
<SelectPage v-else-if="currentPage === 'select'" />
|
|
28
37
|
</main>
|
|
29
38
|
</div>
|
|
30
39
|
</template>
|
|
@@ -33,8 +42,9 @@
|
|
|
33
42
|
import { ref } from 'vue';
|
|
34
43
|
import AllPage from '@/pages/AllPage.vue';
|
|
35
44
|
import AccordionGroupPage from '@/pages/AccordionGroupPage.vue';
|
|
45
|
+
import SelectPage from '@/pages/SelectPage.vue';
|
|
36
46
|
|
|
37
|
-
const currentPage = ref<'all' | 'accordion'>('all');
|
|
47
|
+
const currentPage = ref<'all' | 'accordion' | 'select'>('all');
|
|
38
48
|
</script>
|
|
39
49
|
|
|
40
50
|
<style scoped>
|
package/package.json
CHANGED
|
@@ -234,42 +234,42 @@ Examples:
|
|
|
234
234
|
.filter((key) => !translationKeys.has(key))
|
|
235
235
|
.sort();
|
|
236
236
|
|
|
237
|
-
if (missingInTranslations.length > 0) {
|
|
238
|
-
hasMissingKeys = true;
|
|
239
|
-
console.warn(
|
|
240
|
-
`\n[i18n] ⚠️ ${language}: ${missingInTranslations.length} key(s) used in code but missing in ${source}:`,
|
|
241
|
-
);
|
|
242
|
-
missingInTranslations.forEach((key) => console.warn(` - ${key}`));
|
|
243
|
-
if (diffDir) {
|
|
244
|
-
missingInTranslations.forEach((key) => {
|
|
245
|
-
const localeIndex =
|
|
246
|
-
diffIndexByLocale.get(language) ?? new Set<string>();
|
|
247
|
-
if (!diffIndexByLocale.has(language)) {
|
|
248
|
-
diffIndexByLocale.set(language, localeIndex);
|
|
249
|
-
}
|
|
250
|
-
if (localeIndex.has(key)) {
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
localeIndex.add(key);
|
|
254
|
-
|
|
255
|
-
const localeEntries =
|
|
256
|
-
diffEntriesByLocale.get(language) ??
|
|
257
|
-
([] as Array<{ language: string; key: string; value: string }>);
|
|
258
|
-
if (!diffEntriesByLocale.has(language)) {
|
|
259
|
-
diffEntriesByLocale.set(language, localeEntries);
|
|
260
|
-
}
|
|
261
|
-
localeEntries.push({
|
|
262
|
-
language,
|
|
263
|
-
key,
|
|
264
|
-
value: "",
|
|
265
|
-
});
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
} else {
|
|
269
|
-
console.log(
|
|
270
|
-
`[i18n] ✅ ${language}: All keys used in code exist in ${source}`,
|
|
271
|
-
);
|
|
272
|
-
}
|
|
237
|
+
if (missingInTranslations.length > 0) {
|
|
238
|
+
hasMissingKeys = true;
|
|
239
|
+
console.warn(
|
|
240
|
+
`\n[i18n] ⚠️ ${language}: ${missingInTranslations.length} key(s) used in code but missing in ${source}:`,
|
|
241
|
+
);
|
|
242
|
+
missingInTranslations.forEach((key) => console.warn(` - ${key}`));
|
|
243
|
+
if (diffDir) {
|
|
244
|
+
missingInTranslations.forEach((key) => {
|
|
245
|
+
const localeIndex =
|
|
246
|
+
diffIndexByLocale.get(language) ?? new Set<string>();
|
|
247
|
+
if (!diffIndexByLocale.has(language)) {
|
|
248
|
+
diffIndexByLocale.set(language, localeIndex);
|
|
249
|
+
}
|
|
250
|
+
if (localeIndex.has(key)) {
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
localeIndex.add(key);
|
|
254
|
+
|
|
255
|
+
const localeEntries =
|
|
256
|
+
diffEntriesByLocale.get(language) ??
|
|
257
|
+
([] as Array<{ language: string; key: string; value: string }>);
|
|
258
|
+
if (!diffEntriesByLocale.has(language)) {
|
|
259
|
+
diffEntriesByLocale.set(language, localeEntries);
|
|
260
|
+
}
|
|
261
|
+
localeEntries.push({
|
|
262
|
+
language,
|
|
263
|
+
key,
|
|
264
|
+
value: "",
|
|
265
|
+
});
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
} else {
|
|
269
|
+
console.log(
|
|
270
|
+
`[i18n] ✅ ${language}: All keys used in code exist in ${source}`,
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
273
|
}
|
|
274
274
|
|
|
275
275
|
// Check cross-locale consistency (pairwise, both directions)
|
|
@@ -58,6 +58,14 @@
|
|
|
58
58
|
<template v-if="$slots['append-inner']" #append-inner>
|
|
59
59
|
<slot name="append-inner"></slot>
|
|
60
60
|
</template>
|
|
61
|
+
|
|
62
|
+
<template v-if="$slots['item']" #item="slotProps">
|
|
63
|
+
<slot name="item" v-bind="slotProps"></slot>
|
|
64
|
+
</template>
|
|
65
|
+
|
|
66
|
+
<template v-if="$slots['selection']" #selection="slotProps">
|
|
67
|
+
<slot name="selection" v-bind="slotProps"></slot>
|
|
68
|
+
</template>
|
|
61
69
|
</v-combobox>
|
|
62
70
|
</template>
|
|
63
71
|
|
|
@@ -0,0 +1,1006 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="page">
|
|
3
|
+
<div class="element-container">
|
|
4
|
+
<div class="controls">
|
|
5
|
+
<h2>Testing Domain: {{ currentDomain }}</h2>
|
|
6
|
+
<div class="button-group">
|
|
7
|
+
<button
|
|
8
|
+
@click="switchToDental"
|
|
9
|
+
class="control-btn"
|
|
10
|
+
>
|
|
11
|
+
Switch to Wunschlachen (Dental)
|
|
12
|
+
</button>
|
|
13
|
+
<button
|
|
14
|
+
@click="switchToCocoon"
|
|
15
|
+
class="control-btn"
|
|
16
|
+
>
|
|
17
|
+
Switch to White Cocoon
|
|
18
|
+
</button>
|
|
19
|
+
<button
|
|
20
|
+
@click="resetDomain"
|
|
21
|
+
class="control-btn reset"
|
|
22
|
+
>
|
|
23
|
+
Reset to Auto-Detect
|
|
24
|
+
</button>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<!-- Basic Select Examples -->
|
|
29
|
+
<div class="section">
|
|
30
|
+
<h3 class="section-title">Basic Select</h3>
|
|
31
|
+
<div class="examples-grid">
|
|
32
|
+
<div class="example-item">
|
|
33
|
+
<h4>Default (Outlined)</h4>
|
|
34
|
+
<Select
|
|
35
|
+
v-model="basicValue"
|
|
36
|
+
label="Select an option"
|
|
37
|
+
:items="fruitItems"
|
|
38
|
+
/>
|
|
39
|
+
<p class="value-display">Selected: {{ basicValue?.title || 'None' }}</p>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<div class="example-item">
|
|
43
|
+
<h4>With Placeholder</h4>
|
|
44
|
+
<Select
|
|
45
|
+
v-model="placeholderValue"
|
|
46
|
+
label="Favorite Fruit"
|
|
47
|
+
placeholder="Choose a fruit..."
|
|
48
|
+
:persistent-placeholder="true"
|
|
49
|
+
:items="fruitItems"
|
|
50
|
+
/>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<div class="example-item">
|
|
54
|
+
<h4>Clearable</h4>
|
|
55
|
+
<Select
|
|
56
|
+
v-model="clearableValue"
|
|
57
|
+
label="Clearable Select"
|
|
58
|
+
:items="fruitItems"
|
|
59
|
+
:clearable="true"
|
|
60
|
+
/>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
<div class="example-item">
|
|
64
|
+
<h4>Border on Hover</h4>
|
|
65
|
+
<Select
|
|
66
|
+
v-model="borderHoverValue"
|
|
67
|
+
label="Hover to see border"
|
|
68
|
+
:items="fruitItems"
|
|
69
|
+
:border-on-hover="true"
|
|
70
|
+
variant="plain"
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<!-- States Section -->
|
|
77
|
+
<div class="section">
|
|
78
|
+
<h3 class="section-title">States</h3>
|
|
79
|
+
<div class="examples-grid">
|
|
80
|
+
<div class="example-item">
|
|
81
|
+
<h4>Normal</h4>
|
|
82
|
+
<Select
|
|
83
|
+
v-model="normalState"
|
|
84
|
+
label="Normal State"
|
|
85
|
+
:items="fruitItems"
|
|
86
|
+
/>
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
<div class="example-item">
|
|
90
|
+
<h4>Disabled</h4>
|
|
91
|
+
<Select
|
|
92
|
+
v-model="disabledValue"
|
|
93
|
+
label="Disabled Select"
|
|
94
|
+
:items="fruitItems"
|
|
95
|
+
:disabled="true"
|
|
96
|
+
/>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<div class="example-item">
|
|
100
|
+
<h4>Error</h4>
|
|
101
|
+
<Select
|
|
102
|
+
v-model="errorValue"
|
|
103
|
+
label="Error State"
|
|
104
|
+
:items="fruitItems"
|
|
105
|
+
:error="true"
|
|
106
|
+
/>
|
|
107
|
+
</div>
|
|
108
|
+
|
|
109
|
+
<div class="example-item">
|
|
110
|
+
<h4>Pre-selected Value</h4>
|
|
111
|
+
<Select
|
|
112
|
+
v-model="preselectedValue"
|
|
113
|
+
label="Pre-selected"
|
|
114
|
+
:items="fruitItems"
|
|
115
|
+
/>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
<!-- Multiple Selection -->
|
|
121
|
+
<div class="section">
|
|
122
|
+
<h3 class="section-title">Multiple Selection</h3>
|
|
123
|
+
<div class="examples-grid">
|
|
124
|
+
<div class="example-item wide">
|
|
125
|
+
<h4>Multiple Select</h4>
|
|
126
|
+
<Select
|
|
127
|
+
v-model="multipleValue"
|
|
128
|
+
label="Select multiple options"
|
|
129
|
+
:items="fruitItems"
|
|
130
|
+
:multiple="true"
|
|
131
|
+
/>
|
|
132
|
+
<p class="value-display">Selected: {{ multipleValue?.map(v => v.title).join(', ') || 'None' }}</p>
|
|
133
|
+
</div>
|
|
134
|
+
|
|
135
|
+
<div class="example-item wide">
|
|
136
|
+
<h4>Multiple with Chips</h4>
|
|
137
|
+
<Select
|
|
138
|
+
v-model="chipsValue"
|
|
139
|
+
label="Select with chips"
|
|
140
|
+
:items="fruitItems"
|
|
141
|
+
:multiple="true"
|
|
142
|
+
:chips="true"
|
|
143
|
+
/>
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<div class="example-item wide">
|
|
147
|
+
<h4>Multiple with Closable Chips</h4>
|
|
148
|
+
<Select
|
|
149
|
+
v-model="closableChipsValue"
|
|
150
|
+
label="Closable chips"
|
|
151
|
+
:items="fruitItems"
|
|
152
|
+
:multiple="true"
|
|
153
|
+
:chips="true"
|
|
154
|
+
:closable-chips="true"
|
|
155
|
+
:clearable="true"
|
|
156
|
+
/>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
|
|
161
|
+
<!-- Variants Section -->
|
|
162
|
+
<div class="section">
|
|
163
|
+
<h3 class="section-title">Variants</h3>
|
|
164
|
+
<div class="examples-grid">
|
|
165
|
+
<div class="example-item">
|
|
166
|
+
<h4>Outlined (Default)</h4>
|
|
167
|
+
<Select
|
|
168
|
+
v-model="variantOutlined"
|
|
169
|
+
label="Outlined"
|
|
170
|
+
:items="fruitItems"
|
|
171
|
+
variant="outlined"
|
|
172
|
+
/>
|
|
173
|
+
</div>
|
|
174
|
+
|
|
175
|
+
<div class="example-item">
|
|
176
|
+
<h4>Underlined</h4>
|
|
177
|
+
<Select
|
|
178
|
+
v-model="variantUnderlined"
|
|
179
|
+
label="Underlined"
|
|
180
|
+
:items="fruitItems"
|
|
181
|
+
variant="underlined"
|
|
182
|
+
/>
|
|
183
|
+
</div>
|
|
184
|
+
|
|
185
|
+
<div class="example-item">
|
|
186
|
+
<h4>Filled</h4>
|
|
187
|
+
<Select
|
|
188
|
+
v-model="variantFilled"
|
|
189
|
+
label="Filled"
|
|
190
|
+
:items="fruitItems"
|
|
191
|
+
variant="filled"
|
|
192
|
+
/>
|
|
193
|
+
</div>
|
|
194
|
+
|
|
195
|
+
<div class="example-item">
|
|
196
|
+
<h4>Solo</h4>
|
|
197
|
+
<Select
|
|
198
|
+
v-model="variantSolo"
|
|
199
|
+
label="Solo"
|
|
200
|
+
:items="fruitItems"
|
|
201
|
+
variant="solo"
|
|
202
|
+
/>
|
|
203
|
+
</div>
|
|
204
|
+
|
|
205
|
+
<div class="example-item">
|
|
206
|
+
<h4>Solo Filled</h4>
|
|
207
|
+
<Select
|
|
208
|
+
v-model="variantSoloFilled"
|
|
209
|
+
label="Solo Filled"
|
|
210
|
+
:items="fruitItems"
|
|
211
|
+
variant="solo-filled"
|
|
212
|
+
/>
|
|
213
|
+
</div>
|
|
214
|
+
|
|
215
|
+
<div class="example-item">
|
|
216
|
+
<h4>Plain</h4>
|
|
217
|
+
<Select
|
|
218
|
+
v-model="variantPlain"
|
|
219
|
+
label="Plain"
|
|
220
|
+
:items="fruitItems"
|
|
221
|
+
variant="plain"
|
|
222
|
+
/>
|
|
223
|
+
</div>
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
|
|
227
|
+
<!-- Density Section -->
|
|
228
|
+
<div class="section">
|
|
229
|
+
<h3 class="section-title">Density</h3>
|
|
230
|
+
<div class="examples-grid">
|
|
231
|
+
<div class="example-item">
|
|
232
|
+
<h4>Default (Compact)</h4>
|
|
233
|
+
<Select
|
|
234
|
+
v-model="densityDefault"
|
|
235
|
+
label="Compact"
|
|
236
|
+
:items="fruitItems"
|
|
237
|
+
density="compact"
|
|
238
|
+
/>
|
|
239
|
+
</div>
|
|
240
|
+
|
|
241
|
+
<div class="example-item">
|
|
242
|
+
<h4>Comfortable</h4>
|
|
243
|
+
<Select
|
|
244
|
+
v-model="densityComfortable"
|
|
245
|
+
label="Comfortable"
|
|
246
|
+
:items="fruitItems"
|
|
247
|
+
density="comfortable"
|
|
248
|
+
/>
|
|
249
|
+
</div>
|
|
250
|
+
|
|
251
|
+
<div class="example-item">
|
|
252
|
+
<h4>Default Density</h4>
|
|
253
|
+
<Select
|
|
254
|
+
v-model="densityDefaultSize"
|
|
255
|
+
label="Default"
|
|
256
|
+
:items="fruitItems"
|
|
257
|
+
density="default"
|
|
258
|
+
/>
|
|
259
|
+
</div>
|
|
260
|
+
</div>
|
|
261
|
+
</div>
|
|
262
|
+
|
|
263
|
+
<!-- Practical Examples -->
|
|
264
|
+
<div class="section">
|
|
265
|
+
<h3 class="section-title">Practical Examples</h3>
|
|
266
|
+
<div class="examples-grid">
|
|
267
|
+
<div class="example-item">
|
|
268
|
+
<h4>Country Selection</h4>
|
|
269
|
+
<Select
|
|
270
|
+
v-model="countryValue"
|
|
271
|
+
label="Country"
|
|
272
|
+
placeholder="Select your country"
|
|
273
|
+
:items="countryItems"
|
|
274
|
+
:clearable="true"
|
|
275
|
+
/>
|
|
276
|
+
</div>
|
|
277
|
+
|
|
278
|
+
<div class="example-item">
|
|
279
|
+
<h4>Treatment Type</h4>
|
|
280
|
+
<Select
|
|
281
|
+
v-model="treatmentValue"
|
|
282
|
+
label="Behandlungsart"
|
|
283
|
+
:items="treatmentItems"
|
|
284
|
+
/>
|
|
285
|
+
</div>
|
|
286
|
+
|
|
287
|
+
<div class="example-item wide">
|
|
288
|
+
<h4>Multi-select Tags</h4>
|
|
289
|
+
<Select
|
|
290
|
+
v-model="tagsValue"
|
|
291
|
+
label="Tags"
|
|
292
|
+
:items="tagItems"
|
|
293
|
+
:multiple="true"
|
|
294
|
+
:chips="true"
|
|
295
|
+
:closable-chips="true"
|
|
296
|
+
:clearable="true"
|
|
297
|
+
/>
|
|
298
|
+
</div>
|
|
299
|
+
</div>
|
|
300
|
+
</div>
|
|
301
|
+
|
|
302
|
+
<!-- Custom Item Slot Examples -->
|
|
303
|
+
<div class="section">
|
|
304
|
+
<h3 class="section-title">Custom Item Slot</h3>
|
|
305
|
+
<div class="examples-grid">
|
|
306
|
+
<div class="example-item">
|
|
307
|
+
<h4>Items with Icons</h4>
|
|
308
|
+
<Select
|
|
309
|
+
v-model="customItemValue"
|
|
310
|
+
label="Select a fruit"
|
|
311
|
+
:items="fruitItemsWithIcons"
|
|
312
|
+
>
|
|
313
|
+
<template #item="{ item, props: itemProps }">
|
|
314
|
+
<v-list-item v-bind="itemProps">
|
|
315
|
+
<template #prepend>
|
|
316
|
+
<span class="item-icon">{{ item.raw.icon }}</span>
|
|
317
|
+
</template>
|
|
318
|
+
<v-list-item-title>{{ item.raw.title }}</v-list-item-title>
|
|
319
|
+
</v-list-item>
|
|
320
|
+
</template>
|
|
321
|
+
</Select>
|
|
322
|
+
</div>
|
|
323
|
+
|
|
324
|
+
<div class="example-item">
|
|
325
|
+
<h4>Items with Description</h4>
|
|
326
|
+
<Select
|
|
327
|
+
v-model="customItemDescValue"
|
|
328
|
+
label="Select a treatment"
|
|
329
|
+
:items="treatmentItemsWithDesc"
|
|
330
|
+
>
|
|
331
|
+
<template #item="{ item, props: itemProps }">
|
|
332
|
+
<v-list-item v-bind="itemProps">
|
|
333
|
+
<v-list-item-title>{{ item.raw.title }}</v-list-item-title>
|
|
334
|
+
<v-list-item-subtitle>{{ item.raw.description }}</v-list-item-subtitle>
|
|
335
|
+
</v-list-item>
|
|
336
|
+
</template>
|
|
337
|
+
</Select>
|
|
338
|
+
</div>
|
|
339
|
+
|
|
340
|
+
<div class="example-item">
|
|
341
|
+
<h4>Items with Status Badge</h4>
|
|
342
|
+
<Select
|
|
343
|
+
v-model="customItemStatusValue"
|
|
344
|
+
label="Select a patient"
|
|
345
|
+
:items="patientItems"
|
|
346
|
+
>
|
|
347
|
+
<template #item="{ item, props: itemProps }">
|
|
348
|
+
<v-list-item v-bind="itemProps">
|
|
349
|
+
<template #prepend>
|
|
350
|
+
<span
|
|
351
|
+
class="status-dot"
|
|
352
|
+
:class="item.raw.status"
|
|
353
|
+
></span>
|
|
354
|
+
</template>
|
|
355
|
+
<v-list-item-title>{{ item.raw.title }}</v-list-item-title>
|
|
356
|
+
<template #append>
|
|
357
|
+
<span class="status-badge" :class="item.raw.status">
|
|
358
|
+
{{ item.raw.statusLabel }}
|
|
359
|
+
</span>
|
|
360
|
+
</template>
|
|
361
|
+
</v-list-item>
|
|
362
|
+
</template>
|
|
363
|
+
</Select>
|
|
364
|
+
</div>
|
|
365
|
+
|
|
366
|
+
<div class="example-item">
|
|
367
|
+
<h4>Items with Custom Layout</h4>
|
|
368
|
+
<Select
|
|
369
|
+
v-model="customLayoutValue"
|
|
370
|
+
label="Select a user"
|
|
371
|
+
:items="userItems"
|
|
372
|
+
>
|
|
373
|
+
<template #item="{ item, props: itemProps }">
|
|
374
|
+
<v-list-item v-bind="itemProps" class="custom-user-item">
|
|
375
|
+
<div class="user-item-content">
|
|
376
|
+
<div class="user-avatar">{{ item.raw.initials }}</div>
|
|
377
|
+
<div class="user-info">
|
|
378
|
+
<span class="user-name">{{ item.raw.title }}</span>
|
|
379
|
+
<span class="user-email">{{ item.raw.email }}</span>
|
|
380
|
+
</div>
|
|
381
|
+
</div>
|
|
382
|
+
</v-list-item>
|
|
383
|
+
</template>
|
|
384
|
+
</Select>
|
|
385
|
+
</div>
|
|
386
|
+
</div>
|
|
387
|
+
</div>
|
|
388
|
+
|
|
389
|
+
<!-- Custom Selection Slot Examples -->
|
|
390
|
+
<div class="section">
|
|
391
|
+
<h3 class="section-title">Custom Selection Slot</h3>
|
|
392
|
+
<p class="section-description">Customize how selected items appear in the input field</p>
|
|
393
|
+
<div class="examples-grid">
|
|
394
|
+
<div class="example-item">
|
|
395
|
+
<h4>Selection with Icon</h4>
|
|
396
|
+
<Select
|
|
397
|
+
v-model="selectionIconValue"
|
|
398
|
+
label="Select a fruit"
|
|
399
|
+
:items="fruitItemsWithIcons"
|
|
400
|
+
>
|
|
401
|
+
<template #selection="{ item }">
|
|
402
|
+
<span class="selection-with-icon">
|
|
403
|
+
<span class="selection-icon">{{ item.raw.icon }}</span>
|
|
404
|
+
<span>{{ item.raw.title }}</span>
|
|
405
|
+
</span>
|
|
406
|
+
</template>
|
|
407
|
+
<template #item="{ item, props: itemProps }">
|
|
408
|
+
<v-list-item v-bind="itemProps">
|
|
409
|
+
<template #prepend>
|
|
410
|
+
<span class="item-icon">{{ item.raw.icon }}</span>
|
|
411
|
+
</template>
|
|
412
|
+
<v-list-item-title>{{ item.raw.title }}</v-list-item-title>
|
|
413
|
+
</v-list-item>
|
|
414
|
+
</template>
|
|
415
|
+
</Select>
|
|
416
|
+
</div>
|
|
417
|
+
|
|
418
|
+
<div class="example-item">
|
|
419
|
+
<h4>Selection with Status</h4>
|
|
420
|
+
<Select
|
|
421
|
+
v-model="selectionStatusValue"
|
|
422
|
+
label="Select a patient"
|
|
423
|
+
:items="patientItems"
|
|
424
|
+
>
|
|
425
|
+
<template #selection="{ item }">
|
|
426
|
+
<span class="selection-with-status">
|
|
427
|
+
<span class="status-dot" :class="item.raw.status"></span>
|
|
428
|
+
<span>{{ item.raw.title }}</span>
|
|
429
|
+
</span>
|
|
430
|
+
</template>
|
|
431
|
+
<template #item="{ item, props: itemProps }">
|
|
432
|
+
<v-list-item v-bind="itemProps">
|
|
433
|
+
<template #prepend>
|
|
434
|
+
<span class="status-dot" :class="item.raw.status"></span>
|
|
435
|
+
</template>
|
|
436
|
+
<v-list-item-title>{{ item.raw.title }}</v-list-item-title>
|
|
437
|
+
<template #append>
|
|
438
|
+
<span class="status-badge" :class="item.raw.status">
|
|
439
|
+
{{ item.raw.statusLabel }}
|
|
440
|
+
</span>
|
|
441
|
+
</template>
|
|
442
|
+
</v-list-item>
|
|
443
|
+
</template>
|
|
444
|
+
</Select>
|
|
445
|
+
</div>
|
|
446
|
+
|
|
447
|
+
<div class="example-item">
|
|
448
|
+
<h4>Selection with Avatar</h4>
|
|
449
|
+
<Select
|
|
450
|
+
v-model="selectionAvatarValue"
|
|
451
|
+
label=""
|
|
452
|
+
:items="userItems"
|
|
453
|
+
:density="'comfortable'"
|
|
454
|
+
menu-icon="heroicons:chevron-down"
|
|
455
|
+
>
|
|
456
|
+
<template #selection="{ item }">
|
|
457
|
+
<span class="selection-with-avatar">
|
|
458
|
+
<span class="selection-avatar">{{ item.raw.initials }}</span>
|
|
459
|
+
<span>{{ item.raw.title }}</span>
|
|
460
|
+
</span>
|
|
461
|
+
</template>
|
|
462
|
+
<template #item="{ item, props: itemProps }">
|
|
463
|
+
<v-list-item v-bind="itemProps">
|
|
464
|
+
<div class="user-item-content">
|
|
465
|
+
<div class="user-avatar">{{ item.raw.initials }}</div>
|
|
466
|
+
<div class="user-info">
|
|
467
|
+
<span class="user-name">{{ item.raw.title }}</span>
|
|
468
|
+
<span class="user-email">{{ item.raw.email }}</span>
|
|
469
|
+
</div>
|
|
470
|
+
</div>
|
|
471
|
+
</v-list-item>
|
|
472
|
+
</template>
|
|
473
|
+
</Select>
|
|
474
|
+
</div>
|
|
475
|
+
|
|
476
|
+
<div class="example-item">
|
|
477
|
+
<h4>Selection with Country Flag</h4>
|
|
478
|
+
<Select
|
|
479
|
+
v-model="selectionFlagValue"
|
|
480
|
+
label="Select a country"
|
|
481
|
+
:items="countryItemsWithFlags"
|
|
482
|
+
>
|
|
483
|
+
<template #selection="{ item }">
|
|
484
|
+
<span class="selection-with-flag">
|
|
485
|
+
<span class="country-flag">{{ item.raw.flag }}</span>
|
|
486
|
+
<span>{{ item.raw.title }}</span>
|
|
487
|
+
</span>
|
|
488
|
+
</template>
|
|
489
|
+
<template #item="{ item, props: itemProps }">
|
|
490
|
+
<v-list-item v-bind="itemProps">
|
|
491
|
+
<template #prepend>
|
|
492
|
+
<span class="country-flag">{{ item.raw.flag }}</span>
|
|
493
|
+
</template>
|
|
494
|
+
<v-list-item-title>{{ item.raw.title }}</v-list-item-title>
|
|
495
|
+
</v-list-item>
|
|
496
|
+
</template>
|
|
497
|
+
</Select>
|
|
498
|
+
</div>
|
|
499
|
+
|
|
500
|
+
<div class="example-item wide">
|
|
501
|
+
<h4>Multiple Selection with Custom Chips</h4>
|
|
502
|
+
<Select
|
|
503
|
+
v-model="selectionMultipleValue"
|
|
504
|
+
label="Select fruits"
|
|
505
|
+
:items="fruitItemsWithIcons"
|
|
506
|
+
:multiple="true"
|
|
507
|
+
>
|
|
508
|
+
<template #selection="{ item, index }">
|
|
509
|
+
<v-chip
|
|
510
|
+
v-if="index < 3"
|
|
511
|
+
size="small"
|
|
512
|
+
class="custom-chip"
|
|
513
|
+
closable
|
|
514
|
+
@click:close="removeSelection(index)"
|
|
515
|
+
>
|
|
516
|
+
<span class="chip-icon">{{ item.raw.icon }}</span>
|
|
517
|
+
{{ item.raw.title }}
|
|
518
|
+
</v-chip>
|
|
519
|
+
<span v-if="index === 3" class="more-indicator">
|
|
520
|
+
(+{{ selectionMultipleValue.length - 3 }} more)
|
|
521
|
+
</span>
|
|
522
|
+
</template>
|
|
523
|
+
<template #item="{ item, props: itemProps }">
|
|
524
|
+
<v-list-item v-bind="itemProps">
|
|
525
|
+
<template #prepend>
|
|
526
|
+
<span class="item-icon">{{ item.raw.icon }}</span>
|
|
527
|
+
</template>
|
|
528
|
+
<v-list-item-title>{{ item.raw.title }}</v-list-item-title>
|
|
529
|
+
</v-list-item>
|
|
530
|
+
</template>
|
|
531
|
+
</Select>
|
|
532
|
+
</div>
|
|
533
|
+
|
|
534
|
+
<div class="example-item wide">
|
|
535
|
+
<h4>Multiple Selection with Color Tags</h4>
|
|
536
|
+
<Select
|
|
537
|
+
v-model="selectionColorTagsValue"
|
|
538
|
+
label="Select tags"
|
|
539
|
+
:items="colorTagItems"
|
|
540
|
+
:multiple="true"
|
|
541
|
+
>
|
|
542
|
+
<template #selection="{ item }">
|
|
543
|
+
<span
|
|
544
|
+
class="color-tag"
|
|
545
|
+
:style="{ backgroundColor: item.raw.color, color: item.raw.textColor }"
|
|
546
|
+
>
|
|
547
|
+
{{ item.raw.title }}
|
|
548
|
+
</span>
|
|
549
|
+
</template>
|
|
550
|
+
<template #item="{ item, props: itemProps }">
|
|
551
|
+
<v-list-item v-bind="itemProps">
|
|
552
|
+
<template #prepend>
|
|
553
|
+
<span
|
|
554
|
+
class="color-dot"
|
|
555
|
+
:style="{ backgroundColor: item.raw.color }"
|
|
556
|
+
></span>
|
|
557
|
+
</template>
|
|
558
|
+
<v-list-item-title>{{ item.raw.title }}</v-list-item-title>
|
|
559
|
+
</v-list-item>
|
|
560
|
+
</template>
|
|
561
|
+
</Select>
|
|
562
|
+
</div>
|
|
563
|
+
</div>
|
|
564
|
+
</div>
|
|
565
|
+
</div>
|
|
566
|
+
</div>
|
|
567
|
+
</template>
|
|
568
|
+
|
|
569
|
+
<script setup lang="ts">
|
|
570
|
+
import { computed, ref } from "vue";
|
|
571
|
+
import {
|
|
572
|
+
domain,
|
|
573
|
+
setTestingDomain,
|
|
574
|
+
clearTestingDomain,
|
|
575
|
+
} from "@/utils/index";
|
|
576
|
+
|
|
577
|
+
import Select from "@/components/Select/Select.vue";
|
|
578
|
+
import { avatarPlaceholder } from "..";
|
|
579
|
+
|
|
580
|
+
const currentDomain = computed(() => domain.value);
|
|
581
|
+
|
|
582
|
+
const switchToDental = () => {
|
|
583
|
+
setTestingDomain("domain-dental");
|
|
584
|
+
};
|
|
585
|
+
|
|
586
|
+
const switchToCocoon = () => {
|
|
587
|
+
setTestingDomain("domain-cocoon");
|
|
588
|
+
};
|
|
589
|
+
|
|
590
|
+
const resetDomain = () => {
|
|
591
|
+
clearTestingDomain();
|
|
592
|
+
};
|
|
593
|
+
|
|
594
|
+
// Sample items
|
|
595
|
+
const fruitItems = [
|
|
596
|
+
{ title: 'Apple', value: 'apple' },
|
|
597
|
+
{ title: 'Banana', value: 'banana' },
|
|
598
|
+
{ title: 'Cherry', value: 'cherry' },
|
|
599
|
+
{ title: 'Orange', value: 'orange' },
|
|
600
|
+
{ title: 'Strawberry', value: 'strawberry' },
|
|
601
|
+
];
|
|
602
|
+
|
|
603
|
+
const countryItems = [
|
|
604
|
+
{ title: 'Deutschland', value: 'de' },
|
|
605
|
+
{ title: 'Österreich', value: 'at' },
|
|
606
|
+
{ title: 'Schweiz', value: 'ch' },
|
|
607
|
+
{ title: 'Frankreich', value: 'fr' },
|
|
608
|
+
{ title: 'Italien', value: 'it' },
|
|
609
|
+
];
|
|
610
|
+
|
|
611
|
+
const treatmentItems = [
|
|
612
|
+
{ title: 'Zahnreinigung', value: 'cleaning' },
|
|
613
|
+
{ title: 'Kontrolluntersuchung', value: 'checkup' },
|
|
614
|
+
{ title: 'Implantologie', value: 'implant' },
|
|
615
|
+
{ title: 'Kieferorthopädie', value: 'ortho' },
|
|
616
|
+
{ title: 'Wurzelbehandlung', value: 'root' },
|
|
617
|
+
];
|
|
618
|
+
|
|
619
|
+
const tagItems = [
|
|
620
|
+
{ title: 'Urgent', value: 'urgent' },
|
|
621
|
+
{ title: 'Follow-up', value: 'followup' },
|
|
622
|
+
{ title: 'New Patient', value: 'new' },
|
|
623
|
+
{ title: 'VIP', value: 'vip' },
|
|
624
|
+
{ title: 'Insurance Pending', value: 'insurance' },
|
|
625
|
+
];
|
|
626
|
+
|
|
627
|
+
// Custom item slot examples
|
|
628
|
+
const fruitItemsWithIcons = [
|
|
629
|
+
{ title: 'Apple', value: 'apple', icon: '🍎' },
|
|
630
|
+
{ title: 'Banana', value: 'banana', icon: '🍌' },
|
|
631
|
+
{ title: 'Cherry', value: 'cherry', icon: '🍒' },
|
|
632
|
+
{ title: 'Orange', value: 'orange', icon: '🍊' },
|
|
633
|
+
{ title: 'Strawberry', value: 'strawberry', icon: '🍓' },
|
|
634
|
+
];
|
|
635
|
+
|
|
636
|
+
const treatmentItemsWithDesc = [
|
|
637
|
+
{ title: 'Zahnreinigung', value: 'cleaning', description: 'Professionelle Reinigung und Politur' },
|
|
638
|
+
{ title: 'Kontrolluntersuchung', value: 'checkup', description: 'Regelmäßige Kontrolle der Zahngesundheit' },
|
|
639
|
+
{ title: 'Implantologie', value: 'implant', description: 'Ersatz fehlender Zähne durch Implantate' },
|
|
640
|
+
{ title: 'Wurzelbehandlung', value: 'root', description: 'Behandlung des Zahnmarks' },
|
|
641
|
+
];
|
|
642
|
+
|
|
643
|
+
const patientItems = [
|
|
644
|
+
{ title: 'Max Mustermann', value: 'max', status: 'active', statusLabel: 'Aktiv' },
|
|
645
|
+
{ title: 'Anna Schmidt', value: 'anna', status: 'waiting', statusLabel: 'Wartend' },
|
|
646
|
+
{ title: 'Peter Weber', value: 'peter', status: 'inactive', statusLabel: 'Inaktiv' },
|
|
647
|
+
{ title: 'Lisa Müller', value: 'lisa', status: 'active', statusLabel: 'Aktiv' },
|
|
648
|
+
];
|
|
649
|
+
|
|
650
|
+
const userItems = [
|
|
651
|
+
{ title: 'Dr. Maria Schmidt', value: 'maria', initials: 'MS', email: 'maria@praxis.de' },
|
|
652
|
+
{ title: 'Dr. Thomas Bauer', value: 'thomas', initials: 'TB', email: 'thomas@praxis.de' },
|
|
653
|
+
{ title: 'Julia Fischer', value: 'julia', initials: 'JF', email: 'julia@praxis.de' },
|
|
654
|
+
];
|
|
655
|
+
|
|
656
|
+
// Custom selection slot examples
|
|
657
|
+
const countryItemsWithFlags = [
|
|
658
|
+
{ title: 'Deutschland', value: 'de', flag: '🇩🇪' },
|
|
659
|
+
{ title: 'Österreich', value: 'at', flag: '🇦🇹' },
|
|
660
|
+
{ title: 'Schweiz', value: 'ch', flag: '🇨🇭' },
|
|
661
|
+
{ title: 'Frankreich', value: 'fr', flag: '🇫🇷' },
|
|
662
|
+
{ title: 'Italien', value: 'it', flag: '🇮🇹' },
|
|
663
|
+
];
|
|
664
|
+
|
|
665
|
+
const colorTagItems = [
|
|
666
|
+
{ title: 'High Priority', value: 'high', color: '#ef4444', textColor: '#ffffff' },
|
|
667
|
+
{ title: 'Medium Priority', value: 'medium', color: '#f59e0b', textColor: '#ffffff' },
|
|
668
|
+
{ title: 'Low Priority', value: 'low', color: '#22c55e', textColor: '#ffffff' },
|
|
669
|
+
{ title: 'On Hold', value: 'hold', color: '#6b7280', textColor: '#ffffff' },
|
|
670
|
+
{ title: 'In Progress', value: 'progress', color: '#3b82f6', textColor: '#ffffff' },
|
|
671
|
+
];
|
|
672
|
+
|
|
673
|
+
// Basic examples
|
|
674
|
+
const basicValue = ref(null);
|
|
675
|
+
const placeholderValue = ref(null);
|
|
676
|
+
const clearableValue = ref(null);
|
|
677
|
+
const borderHoverValue = ref(null);
|
|
678
|
+
|
|
679
|
+
// States
|
|
680
|
+
const normalState = ref(null);
|
|
681
|
+
const disabledValue = ref({ title: 'Apple', value: 'apple' });
|
|
682
|
+
const errorValue = ref(null);
|
|
683
|
+
const preselectedValue = ref({ title: 'Cherry', value: 'cherry' });
|
|
684
|
+
|
|
685
|
+
// Multiple selection
|
|
686
|
+
const multipleValue = ref([]);
|
|
687
|
+
const chipsValue = ref([]);
|
|
688
|
+
const closableChipsValue = ref([
|
|
689
|
+
{ title: 'Apple', value: 'apple' },
|
|
690
|
+
{ title: 'Cherry', value: 'cherry' },
|
|
691
|
+
]);
|
|
692
|
+
|
|
693
|
+
// Variants
|
|
694
|
+
const variantOutlined = ref(null);
|
|
695
|
+
const variantUnderlined = ref(null);
|
|
696
|
+
const variantFilled = ref(null);
|
|
697
|
+
const variantSolo = ref(null);
|
|
698
|
+
const variantSoloFilled = ref(null);
|
|
699
|
+
const variantPlain = ref(null);
|
|
700
|
+
|
|
701
|
+
// Density
|
|
702
|
+
const densityDefault = ref(null);
|
|
703
|
+
const densityComfortable = ref(null);
|
|
704
|
+
const densityDefaultSize = ref(null);
|
|
705
|
+
|
|
706
|
+
// Practical examples
|
|
707
|
+
const countryValue = ref(null);
|
|
708
|
+
const treatmentValue = ref(null);
|
|
709
|
+
const tagsValue = ref([]);
|
|
710
|
+
|
|
711
|
+
// Custom item slot examples
|
|
712
|
+
const customItemValue = ref(null);
|
|
713
|
+
const customItemDescValue = ref(null);
|
|
714
|
+
const customItemStatusValue = ref(null);
|
|
715
|
+
const customLayoutValue = ref(null);
|
|
716
|
+
|
|
717
|
+
// Custom selection slot examples
|
|
718
|
+
const selectionIconValue = ref(null);
|
|
719
|
+
const selectionStatusValue = ref(null);
|
|
720
|
+
const selectionAvatarValue = ref(null);
|
|
721
|
+
const selectionFlagValue = ref(null);
|
|
722
|
+
const selectionMultipleValue = ref([]);
|
|
723
|
+
const selectionColorTagsValue = ref([]);
|
|
724
|
+
|
|
725
|
+
const removeSelection = (index: number) => {
|
|
726
|
+
selectionMultipleValue.value.splice(index, 1);
|
|
727
|
+
};
|
|
728
|
+
</script>
|
|
729
|
+
|
|
730
|
+
<style scoped>
|
|
731
|
+
.page {
|
|
732
|
+
display: flex;
|
|
733
|
+
flex-direction: column;
|
|
734
|
+
justify-content: flex-start;
|
|
735
|
+
align-items: center;
|
|
736
|
+
width: 100vw;
|
|
737
|
+
min-height: 100vh;
|
|
738
|
+
background-color: #f5f5f5;
|
|
739
|
+
padding: 2rem 0;
|
|
740
|
+
overflow-y: auto;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
.element-container {
|
|
744
|
+
display: flex;
|
|
745
|
+
flex-direction: column;
|
|
746
|
+
justify-content: flex-start;
|
|
747
|
+
align-items: center;
|
|
748
|
+
width: 95%;
|
|
749
|
+
max-width: 1400px;
|
|
750
|
+
gap: 2rem;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
.controls {
|
|
754
|
+
width: 100%;
|
|
755
|
+
background: white;
|
|
756
|
+
padding: 1.5rem;
|
|
757
|
+
border-radius: 8px;
|
|
758
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
759
|
+
text-align: center;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
.controls h2 {
|
|
763
|
+
margin: 0 0 1rem 0;
|
|
764
|
+
color: #333;
|
|
765
|
+
font-size: 1.5rem;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
.button-group {
|
|
769
|
+
display: flex;
|
|
770
|
+
gap: 1rem;
|
|
771
|
+
justify-content: center;
|
|
772
|
+
flex-wrap: wrap;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
.control-btn {
|
|
776
|
+
padding: 0.75rem 1.5rem;
|
|
777
|
+
font-size: 1rem;
|
|
778
|
+
border: none;
|
|
779
|
+
border-radius: 6px;
|
|
780
|
+
cursor: pointer;
|
|
781
|
+
background-color: #4caf50;
|
|
782
|
+
color: white;
|
|
783
|
+
transition: background-color 0.3s ease;
|
|
784
|
+
font-weight: 500;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
.control-btn:hover {
|
|
788
|
+
background-color: #45a049;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
.control-btn.reset {
|
|
792
|
+
background-color: #f44336;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
.control-btn.reset:hover {
|
|
796
|
+
background-color: #da190b;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
.section {
|
|
800
|
+
width: 100%;
|
|
801
|
+
background: white;
|
|
802
|
+
padding: 1.5rem;
|
|
803
|
+
border-radius: 8px;
|
|
804
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
.section-title {
|
|
808
|
+
margin: 0 0 1.5rem 0;
|
|
809
|
+
color: #333;
|
|
810
|
+
font-size: 1.25rem;
|
|
811
|
+
font-weight: 600;
|
|
812
|
+
border-bottom: 2px solid #e0e0e0;
|
|
813
|
+
padding-bottom: 0.5rem;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
.examples-grid {
|
|
817
|
+
display: grid;
|
|
818
|
+
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
|
819
|
+
gap: 1.5rem;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
.example-item {
|
|
823
|
+
display: flex;
|
|
824
|
+
flex-direction: column;
|
|
825
|
+
gap: 0.5rem;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
.example-item.wide {
|
|
829
|
+
grid-column: span 2;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
.example-item h4 {
|
|
833
|
+
margin: 0;
|
|
834
|
+
font-size: 0.875rem;
|
|
835
|
+
font-weight: 600;
|
|
836
|
+
color: #555;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
.value-display {
|
|
840
|
+
margin: 0.5rem 0 0 0;
|
|
841
|
+
font-size: 0.8125rem;
|
|
842
|
+
color: #666;
|
|
843
|
+
font-style: italic;
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
@media (max-width: 768px) {
|
|
847
|
+
.examples-grid {
|
|
848
|
+
grid-template-columns: 1fr;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
.example-item.wide {
|
|
852
|
+
grid-column: span 1;
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
/* Custom item slot styles */
|
|
857
|
+
.item-icon {
|
|
858
|
+
font-size: 1.25rem;
|
|
859
|
+
margin-right: 0.5rem;
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
.status-dot {
|
|
863
|
+
width: 10px;
|
|
864
|
+
height: 10px;
|
|
865
|
+
border-radius: 50%;
|
|
866
|
+
margin-right: 0.5rem;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
.status-dot.active {
|
|
870
|
+
background-color: #4caf50;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
.status-dot.waiting {
|
|
874
|
+
background-color: #ff9800;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
.status-dot.inactive {
|
|
878
|
+
background-color: #9e9e9e;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
.status-badge {
|
|
882
|
+
font-size: 0.75rem;
|
|
883
|
+
padding: 0.125rem 0.5rem;
|
|
884
|
+
border-radius: 999px;
|
|
885
|
+
font-weight: 500;
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
.status-badge.active {
|
|
889
|
+
background-color: #e8f5e9;
|
|
890
|
+
color: #2e7d32;
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
.status-badge.waiting {
|
|
894
|
+
background-color: #fff3e0;
|
|
895
|
+
color: #ef6c00;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
.status-badge.inactive {
|
|
899
|
+
background-color: #f5f5f5;
|
|
900
|
+
color: #757575;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
.user-item-content {
|
|
904
|
+
display: flex;
|
|
905
|
+
align-items: center;
|
|
906
|
+
gap: 0.75rem;
|
|
907
|
+
padding: 0.25rem 0;
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
.user-avatar {
|
|
911
|
+
width: 36px;
|
|
912
|
+
height: 36px;
|
|
913
|
+
border-radius: 50%;
|
|
914
|
+
background-color: #172774;
|
|
915
|
+
color: white;
|
|
916
|
+
display: flex;
|
|
917
|
+
align-items: center;
|
|
918
|
+
justify-content: center;
|
|
919
|
+
font-size: 0.875rem;
|
|
920
|
+
font-weight: 600;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
.user-info {
|
|
924
|
+
display: flex;
|
|
925
|
+
flex-direction: column;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
.user-name {
|
|
929
|
+
font-weight: 500;
|
|
930
|
+
color: #333;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
.user-email {
|
|
934
|
+
font-size: 0.75rem;
|
|
935
|
+
color: #666;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
/* Section description */
|
|
939
|
+
.section-description {
|
|
940
|
+
margin: -1rem 0 1.5rem 0;
|
|
941
|
+
font-size: 0.875rem;
|
|
942
|
+
color: #666;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
/* Custom selection slot styles */
|
|
946
|
+
.selection-with-icon,
|
|
947
|
+
.selection-with-status,
|
|
948
|
+
.selection-with-avatar,
|
|
949
|
+
.selection-with-flag {
|
|
950
|
+
display: inline-flex;
|
|
951
|
+
align-items: center;
|
|
952
|
+
gap: 0.5rem;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
.selection-icon {
|
|
956
|
+
font-size: 1.125rem;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
.selection-avatar {
|
|
960
|
+
width: 24px;
|
|
961
|
+
height: 24px;
|
|
962
|
+
border-radius: 50%;
|
|
963
|
+
background-color: #172774;
|
|
964
|
+
color: white;
|
|
965
|
+
display: inline-flex;
|
|
966
|
+
align-items: center;
|
|
967
|
+
justify-content: center;
|
|
968
|
+
font-size: 0.625rem;
|
|
969
|
+
font-weight: 600;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
.country-flag {
|
|
973
|
+
font-size: 1.25rem;
|
|
974
|
+
margin-right: 0.25rem;
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
.custom-chip {
|
|
978
|
+
margin: 2px;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
.chip-icon {
|
|
982
|
+
margin-right: 0.25rem;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
.more-indicator {
|
|
986
|
+
font-size: 0.75rem;
|
|
987
|
+
color: #666;
|
|
988
|
+
margin-left: 0.25rem;
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
.color-tag {
|
|
992
|
+
display: inline-block;
|
|
993
|
+
padding: 0.125rem 0.5rem;
|
|
994
|
+
border-radius: 4px;
|
|
995
|
+
font-size: 0.75rem;
|
|
996
|
+
font-weight: 500;
|
|
997
|
+
margin: 2px;
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
.color-dot {
|
|
1001
|
+
width: 12px;
|
|
1002
|
+
height: 12px;
|
|
1003
|
+
border-radius: 50%;
|
|
1004
|
+
margin-right: 0.5rem;
|
|
1005
|
+
}
|
|
1006
|
+
</style>
|
package/src/utils/index.ts
CHANGED
|
@@ -210,6 +210,80 @@ const getColorsForDomain = (domainValue: string) => {
|
|
|
210
210
|
appointment_card_delimiter: "var(--Night-Nude--2)",
|
|
211
211
|
/* End Appointment card colors */
|
|
212
212
|
|
|
213
|
+
/* Progress bar colors */
|
|
214
|
+
progress_bar_bg: "var(--Night-Nude--3)",
|
|
215
|
+
progress_bar_fill: "var(--Dark-Nude-0)",
|
|
216
|
+
/* End Progress bar colors */
|
|
217
|
+
|
|
218
|
+
/* Navigation colors */
|
|
219
|
+
nav_bg: "var(--Warm-Air--4)",
|
|
220
|
+
nav_item_active_bg: "var(--Dark-Nude--2)",
|
|
221
|
+
nav_item_text: "var(--Dark-Nude-2)",
|
|
222
|
+
nav_item_icon: "var(--Dark-Nude-2)",
|
|
223
|
+
/* End Navigation colors */
|
|
224
|
+
|
|
225
|
+
/* Toggle colors */
|
|
226
|
+
toggle_inactive_bg: "var(--Night-Nude--2)",
|
|
227
|
+
toggle_active_bg: "var(--Dark-Nude-2)",
|
|
228
|
+
toggle_text: "var(--Dark-Nude-2)",
|
|
229
|
+
/* End Toggle colors */
|
|
230
|
+
|
|
231
|
+
/* Loader colors */
|
|
232
|
+
loader_fill: "var(--Dark-Nude-2)",
|
|
233
|
+
loader_text: "var(--Dark-Nude-2)",
|
|
234
|
+
/* End Loader colors */
|
|
235
|
+
|
|
236
|
+
/* Focus colors */
|
|
237
|
+
focus_ring_color: "var(--Dark-Nude-2)",
|
|
238
|
+
/* End Focus colors */
|
|
239
|
+
|
|
240
|
+
/* Card/List item colors */
|
|
241
|
+
card_bg: "var(--White-0)",
|
|
242
|
+
card_hover_bg: "var(--Dark-Nude--3)",
|
|
243
|
+
card_border: "var(--Night-Nude--2)",
|
|
244
|
+
card_divider: "var(--Night-Nude--2)",
|
|
245
|
+
/* End Card/List item colors */
|
|
246
|
+
|
|
247
|
+
/* Status badge colors */
|
|
248
|
+
badge_available_border: "var(--Success-Green-0)",
|
|
249
|
+
badge_available_text: "var(--Success-Green-0)",
|
|
250
|
+
badge_available_subtext: "var(--Success-Green-1)",
|
|
251
|
+
badge_unavailable_border: "var(--Error-Red-1)",
|
|
252
|
+
badge_unavailable_text: "var(--Error-Red-0)",
|
|
253
|
+
badge_unavailable_subtext: "var(--Error-Red-1)",
|
|
254
|
+
/* End Status badge colors */
|
|
255
|
+
|
|
256
|
+
/* Page state colors */
|
|
257
|
+
state_success_title: "var(--Success-Green-0)",
|
|
258
|
+
state_error_title: "var(--Error-Red-0)",
|
|
259
|
+
state_info_icon: "var(--Dark-Nude-2)",
|
|
260
|
+
state_info_text: "var(--Dark-Nude-2)",
|
|
261
|
+
/* End Page state colors */
|
|
262
|
+
|
|
263
|
+
/* Destructive action colors */
|
|
264
|
+
action_destructive_icon: "var(--Power-Red-0)",
|
|
265
|
+
action_destructive_text: "var(--Power-Red-0)",
|
|
266
|
+
/* End Destructive action colors */
|
|
267
|
+
|
|
268
|
+
/* Background colors */
|
|
269
|
+
page_bg: "var(--Warm-Air--4)",
|
|
270
|
+
section_bg: "var(--White-0)",
|
|
271
|
+
/* End Background colors */
|
|
272
|
+
|
|
273
|
+
/* Primary text and icon colors */
|
|
274
|
+
icon_primary: "var(--Dark-Nude-2)",
|
|
275
|
+
text_primary: "var(--Dark-Nude-2)",
|
|
276
|
+
text_secondary: "var(--Dark-Nude-3)",
|
|
277
|
+
divider_primary: "var(--Night-Nude--2)",
|
|
278
|
+
border_primary: "var(--Dark-Nude-0)",
|
|
279
|
+
/* End Primary text and icon colors */
|
|
280
|
+
|
|
281
|
+
/* Slot grid colors */
|
|
282
|
+
slot_header_bg: "var(--Night-Nude--3)",
|
|
283
|
+
slot_button_bg: "var(--Warm-Air--4)",
|
|
284
|
+
slot_button_hover_bg: "var(--Night-Nude--2)",
|
|
285
|
+
/* End Slot grid colors */
|
|
286
|
+
|
|
213
287
|
/* To be checked the validity of these colors */
|
|
214
288
|
font_color: "!text-[var(--Dark-Nude-3)]",
|
|
215
289
|
font_color_title: "!text-[var(--Dark-Nude-2)]",
|
|
@@ -348,6 +422,80 @@ const getColorsForDomain = (domainValue: string) => {
|
|
|
348
422
|
appointment_card_delimiter: "var(--Soft-Concrete-1)",
|
|
349
423
|
/* End Appointment card colors */
|
|
350
424
|
|
|
425
|
+
/* Progress bar colors */
|
|
426
|
+
progress_bar_bg: "var(--Soft-Concrete-0)",
|
|
427
|
+
progress_bar_fill: "var(--Dental-Light-Blue-0)",
|
|
428
|
+
/* End Progress bar colors */
|
|
429
|
+
|
|
430
|
+
/* Navigation colors */
|
|
431
|
+
nav_bg: "var(--Dental-Light-Blue--3)",
|
|
432
|
+
nav_item_active_bg: "var(--Dental-Light-Blue-1)",
|
|
433
|
+
nav_item_text: "var(--Dental-Blue-0)",
|
|
434
|
+
nav_item_icon: "var(--Dental-Blue-0)",
|
|
435
|
+
/* End Navigation colors */
|
|
436
|
+
|
|
437
|
+
/* Toggle colors */
|
|
438
|
+
toggle_inactive_bg: "var(--Dental-Blue--5)",
|
|
439
|
+
toggle_active_bg: "var(--Dental-Blue-0)",
|
|
440
|
+
toggle_text: "var(--Dental-Blue-0)",
|
|
441
|
+
/* End Toggle colors */
|
|
442
|
+
|
|
443
|
+
/* Loader colors */
|
|
444
|
+
loader_fill: "var(--Dental-Blue-0)",
|
|
445
|
+
loader_text: "var(--Dental-Blue-0)",
|
|
446
|
+
/* End Loader colors */
|
|
447
|
+
|
|
448
|
+
/* Focus colors */
|
|
449
|
+
focus_ring_color: "var(--Dental-Blue-0)",
|
|
450
|
+
/* End Focus colors */
|
|
451
|
+
|
|
452
|
+
/* Card/List item colors */
|
|
453
|
+
card_bg: "var(--White-0)",
|
|
454
|
+
card_hover_bg: "var(--Dental-Blue--6)",
|
|
455
|
+
card_border: "var(--Soft-Concrete-1)",
|
|
456
|
+
card_divider: "var(--Dental-Blue--4)",
|
|
457
|
+
/* End Card/List item colors */
|
|
458
|
+
|
|
459
|
+
/* Status badge colors */
|
|
460
|
+
badge_available_border: "var(--Success-Green-0)",
|
|
461
|
+
badge_available_text: "var(--Success-Green-0)",
|
|
462
|
+
badge_available_subtext: "var(--Success-Green-1)",
|
|
463
|
+
badge_unavailable_border: "var(--Error-Red-1)",
|
|
464
|
+
badge_unavailable_text: "var(--Error-Red-0)",
|
|
465
|
+
badge_unavailable_subtext: "var(--Error-Red-1)",
|
|
466
|
+
/* End Status badge colors */
|
|
467
|
+
|
|
468
|
+
/* Page state colors */
|
|
469
|
+
state_success_title: "var(--Success-Green-0)",
|
|
470
|
+
state_error_title: "var(--Error-Red-0)",
|
|
471
|
+
state_info_icon: "var(--Dental-Blue-0)",
|
|
472
|
+
state_info_text: "var(--Dental-Blue-0)",
|
|
473
|
+
/* End Page state colors */
|
|
474
|
+
|
|
475
|
+
/* Destructive action colors */
|
|
476
|
+
action_destructive_icon: "var(--Power-Red-0)",
|
|
477
|
+
action_destructive_text: "var(--Power-Red-0)",
|
|
478
|
+
/* End Destructive action colors */
|
|
479
|
+
|
|
480
|
+
/* Background colors */
|
|
481
|
+
page_bg: "var(--Dental-Light-Blue--3)",
|
|
482
|
+
section_bg: "var(--White-0)",
|
|
483
|
+
/* End Background colors */
|
|
484
|
+
|
|
485
|
+
/* Primary text and icon colors */
|
|
486
|
+
icon_primary: "var(--Dental-Blue-0)",
|
|
487
|
+
text_primary: "var(--Dental-Blue-0)",
|
|
488
|
+
text_secondary: "var(--Dental-Blue--2)",
|
|
489
|
+
divider_primary: "var(--Dental-Blue--4)",
|
|
490
|
+
border_primary: "var(--Dental-Blue-0)",
|
|
491
|
+
/* End Primary text and icon colors */
|
|
492
|
+
|
|
493
|
+
/* Slot grid colors */
|
|
494
|
+
slot_header_bg: "var(--Dental-Light-Blue--2)",
|
|
495
|
+
slot_button_bg: "var(--Dental-Light-Blue--1)",
|
|
496
|
+
slot_button_hover_bg: "var(--Dental-Light-Blue-0)",
|
|
497
|
+
/* End Slot grid colors */
|
|
498
|
+
|
|
351
499
|
/* To be checked the validity of these colors */
|
|
352
500
|
"border-color": "var(--Dental-Blue-0)",
|
|
353
501
|
font_color: "!text-[var(--Dental-Blue-1)]",
|
|
@@ -442,6 +590,68 @@ if (typeof document !== 'undefined') {
|
|
|
442
590
|
root.style.setProperty('--appointment_card_title', siteColors['appointment_card_title']);
|
|
443
591
|
root.style.setProperty('--appointment_card_text', siteColors['appointment_card_text']);
|
|
444
592
|
root.style.setProperty('--appointment_card_delimiter', siteColors['appointment_card_delimiter']);
|
|
593
|
+
|
|
594
|
+
// Progress bar colors
|
|
595
|
+
root.style.setProperty('--progress-bar-bg', siteColors['progress_bar_bg']);
|
|
596
|
+
root.style.setProperty('--progress-bar-fill', siteColors['progress_bar_fill']);
|
|
597
|
+
|
|
598
|
+
// Navigation colors
|
|
599
|
+
root.style.setProperty('--nav-bg', siteColors['nav_bg']);
|
|
600
|
+
root.style.setProperty('--nav-item-active-bg', siteColors['nav_item_active_bg']);
|
|
601
|
+
root.style.setProperty('--nav-item-text', siteColors['nav_item_text']);
|
|
602
|
+
root.style.setProperty('--nav-item-icon', siteColors['nav_item_icon']);
|
|
603
|
+
|
|
604
|
+
// Toggle colors
|
|
605
|
+
root.style.setProperty('--toggle-inactive-bg', siteColors['toggle_inactive_bg']);
|
|
606
|
+
root.style.setProperty('--toggle-active-bg', siteColors['toggle_active_bg']);
|
|
607
|
+
root.style.setProperty('--toggle-text', siteColors['toggle_text']);
|
|
608
|
+
|
|
609
|
+
// Loader colors
|
|
610
|
+
root.style.setProperty('--loader-fill', siteColors['loader_fill']);
|
|
611
|
+
root.style.setProperty('--loader-text', siteColors['loader_text']);
|
|
612
|
+
|
|
613
|
+
// Focus colors
|
|
614
|
+
root.style.setProperty('--focus-ring-color', siteColors['focus_ring_color']);
|
|
615
|
+
|
|
616
|
+
// Card/List item colors
|
|
617
|
+
root.style.setProperty('--card-bg', siteColors['card_bg']);
|
|
618
|
+
root.style.setProperty('--card-hover-bg', siteColors['card_hover_bg']);
|
|
619
|
+
root.style.setProperty('--card-border', siteColors['card_border']);
|
|
620
|
+
root.style.setProperty('--card-divider', siteColors['card_divider']);
|
|
621
|
+
|
|
622
|
+
// Status badge colors
|
|
623
|
+
root.style.setProperty('--badge-available-border', siteColors['badge_available_border']);
|
|
624
|
+
root.style.setProperty('--badge-available-text', siteColors['badge_available_text']);
|
|
625
|
+
root.style.setProperty('--badge-available-subtext', siteColors['badge_available_subtext']);
|
|
626
|
+
root.style.setProperty('--badge-unavailable-border', siteColors['badge_unavailable_border']);
|
|
627
|
+
root.style.setProperty('--badge-unavailable-text', siteColors['badge_unavailable_text']);
|
|
628
|
+
root.style.setProperty('--badge-unavailable-subtext', siteColors['badge_unavailable_subtext']);
|
|
629
|
+
|
|
630
|
+
// Page state colors
|
|
631
|
+
root.style.setProperty('--state-success-title', siteColors['state_success_title']);
|
|
632
|
+
root.style.setProperty('--state-error-title', siteColors['state_error_title']);
|
|
633
|
+
root.style.setProperty('--state-info-icon', siteColors['state_info_icon']);
|
|
634
|
+
root.style.setProperty('--state-info-text', siteColors['state_info_text']);
|
|
635
|
+
|
|
636
|
+
// Destructive action colors
|
|
637
|
+
root.style.setProperty('--action-destructive-icon', siteColors['action_destructive_icon']);
|
|
638
|
+
root.style.setProperty('--action-destructive-text', siteColors['action_destructive_text']);
|
|
639
|
+
|
|
640
|
+
// Background colors
|
|
641
|
+
root.style.setProperty('--page-bg', siteColors['page_bg']);
|
|
642
|
+
root.style.setProperty('--section-bg', siteColors['section_bg']);
|
|
643
|
+
|
|
644
|
+
// Primary text and icon colors
|
|
645
|
+
root.style.setProperty('--icon-primary', siteColors['icon_primary']);
|
|
646
|
+
root.style.setProperty('--text-primary', siteColors['text_primary']);
|
|
647
|
+
root.style.setProperty('--text-secondary', siteColors['text_secondary']);
|
|
648
|
+
root.style.setProperty('--divider-primary', siteColors['divider_primary']);
|
|
649
|
+
root.style.setProperty('--border-primary', siteColors['border_primary']);
|
|
650
|
+
|
|
651
|
+
// Slot grid colors
|
|
652
|
+
root.style.setProperty('--slot-header-bg', siteColors['slot_header_bg']);
|
|
653
|
+
root.style.setProperty('--slot-button-bg', siteColors['slot_button_bg']);
|
|
654
|
+
root.style.setProperty('--slot-button-hover-bg', siteColors['slot_button_hover_bg']);
|
|
445
655
|
}
|
|
446
656
|
|
|
447
657
|
// Function to set domain for testing purposes
|