18
18
role =" listitem"
19
19
aria-roledescription =" sortierbares Listenelement"
20
20
:class =" {
21
- muted: element.checked !== null,
22
21
'keyboard-dragging': draggedIndex === index,
23
22
}"
24
23
:aria-grabbed =" draggedIndex === index ? 'true' : 'false'"
28
27
:key =" element.serviceID"
29
28
@keydown =" handleEnterKeyDown"
30
29
>
31
- <input
32
- type =" checkbox"
30
+ <p13n-checkbox
33
31
:id =" 'cb-' + element.serviceID"
34
- class =" radio-look"
35
- :checked =" element.checked !== null"
32
+ :checked =" !!element.checked"
36
33
:disabled =" disabled"
37
- @change =" () => onSelectChange(element.serviceID)"
34
+ @check =" () => onSelectChange(element.serviceID)"
38
35
/>
39
36
<span
37
+ tabindex =" 0"
40
38
class =" label-text"
41
- @click.prevent =" openDialog(element)"
42
- style =" cursor : pointer "
39
+ :class =" {
40
+ muted: element.checked !== null,
41
+ }"
42
+ @click =" (evt) => openDialog(element, evt)"
43
+ @keydown =" (evt) => evt.keyCode == 32 ? openDialog(element, evt) : null"
43
44
>
44
45
<b >{{ element.title }}</b >
46
+ <span
47
+ class =" required-label"
48
+ v-if =" element.required"
49
+ >
50
+ - verpflichtend
51
+ </span >
45
52
</span >
46
53
<span
47
54
v-if =" isDraggable"
@@ -81,6 +88,7 @@ import type ChecklistItem from "@/api/persservice/ChecklistItem.ts";
81
88
import { MucIcon } from " @muenchen/muc-patternlab-vue" ;
82
89
import { Sortable } from " sortablejs-vue3" ;
83
90
import { computed , onBeforeUnmount , onMounted , ref } from " vue" ;
91
+ import P13nCheckbox from " @/components/P13nCheckbox.vue" ;
84
92
85
93
const props = withDefaults (
86
94
defineProps <{
@@ -120,7 +128,8 @@ function onSelectChange(serviceID: string) {
120
128
emit (" checked" , serviceID );
121
129
}
122
130
123
- function openDialog(item : ChecklistItem ) {
131
+ function openDialog(item : ChecklistItem , evt : Event ) {
132
+ evt .preventDefault ();
124
133
dialogItem .value = item ;
125
134
dialogVisible .value = true ;
126
135
emit (" label-click" , item );
@@ -198,7 +207,6 @@ function handleArrowKeyDown(event: KeyboardEvent) {
198
207
.list-item {
199
208
display : flex ;
200
209
align-items : center ;
201
- padding : 0.5rem 1rem ;
202
210
border-bottom : 1px solid #ddd ;
203
211
user-select : none ;
204
212
cursor : grab ;
@@ -211,75 +219,32 @@ function handleArrowKeyDown(event: KeyboardEvent) {
211
219
212
220
/* text grayed out when selected */
213
221
.muted {
214
- color : #7a8d9f ;
222
+ color : #7a8d9f !important ;
215
223
}
216
224
217
- .radio-look {
218
- appearance : none ;
219
- -webkit-appearance : none ;
220
- flex : 0 0 16px ;
221
- width : 16px ;
222
- height : 16px ;
223
- border : 2px solid var (--color-neutrals-grey );
224
- border-radius : 50% ;
225
- background : white ;
226
- box-sizing : border-box ;
227
- margin-right : 0.8rem ;
228
- position : relative ;
225
+ .label-text {
229
226
cursor : pointer ;
230
- outline-offset : 2px ;
231
- transition :
232
- border-color 0.2s ease ,
233
- background-color 0.2s ease ;
234
- }
235
-
236
- .radio-look :hover {
237
- border-color : var (--color-brand-main-blue );
238
- background-color : #cce4ff ;
239
- }
240
-
241
- .radio-look :hover ::before {
242
- content : " " ;
243
- position : absolute ;
244
- top : 50% ;
245
- left : 50% ;
246
- width : 10px ;
247
- height : 10px ;
248
- background-color : var (--color-brand-main-blue );
249
- border-radius : 50% ;
250
- transform : translate (-50% , -50% );
251
- opacity : 0.3 ;
252
- pointer-events : none ;
253
- transition : opacity 0.2s ease ;
254
- }
255
-
256
- .radio-look :checked {
257
- border-color : var (--color-brand-main-blue );
258
- background-color : var (--color-brand-main-blue );
259
- }
260
-
261
- .radio-look :checked ::before {
262
- content : " ✓" ;
263
- position : absolute ;
264
- top : 50% ;
265
- left : 50% ;
266
- color : white ;
267
- font-weight : bold ;
268
- font-size : 14px ;
269
- line-height : 1 ;
270
- transform : translate (-50% , -45% );
271
- pointer-events : none ;
227
+ color : var (--color-brand-main-blue );
228
+ /* Body/Body 1 Bold */
229
+ font-family : " Open Sans" , sans-serif ;
230
+ font-size : 18px ;
231
+ font-style : normal ;
232
+ font-weight : 700 ;
233
+ line-height : 150% ; /* 27px */
234
+
235
+ padding : 16px 8px ;
236
+ flex-grow : 1 ;
272
237
user-select : none ;
273
- transition : color 0.2s ease ;
274
238
}
275
239
276
- .radio-look :checked: hover::before {
277
- opacity : 0.8 ;
240
+ .label-text : hover {
241
+ text-decoration : underline ;
278
242
}
279
243
280
- .label-text {
281
- flex-grow : 1 ;
282
- user-select : none ;
244
+ @media (max-width : 450px ) {
245
+ .label-text {
246
+ padding : 12px 8px ;
247
+ }
283
248
}
284
249
285
250
.drag-handle {
@@ -320,4 +285,14 @@ function handleArrowKeyDown(event: KeyboardEvent) {
320
285
overflow-y : auto ;
321
286
box-shadow : 0 2px 10px rgba (0 , 0 , 0 , 0.2 );
322
287
}
288
+
289
+ .required-label {
290
+ color : var (--neutrals-grey , #3A5368 );
291
+ /* Body/Body 2 */
292
+ font-family : " Open Sans" , sans-serif ;
293
+ font-size : 16px ;
294
+ font-style : normal ;
295
+ font-weight : 400 ;
296
+ line-height : 150% ;
297
+ }
323
298
</style >
0 commit comments