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
+ :aria-label ="
33
+ !!element.checked
34
+ ? element.title + ' als nicht erledigt markieren.'
35
+ : element.title + ' als erledigt markieren.'
36
+ "
37
+ :checked =" !!element.checked"
36
38
:disabled =" disabled"
37
- @change =" () => onSelectChange(element.serviceID)"
39
+ style =" margin-left : 8px "
40
+ @check =" () => onSelectChange(element.serviceID)"
38
41
/>
39
42
<span
43
+ tabindex =" 0"
40
44
class =" label-text"
41
- @click.prevent =" openDialog(element)"
42
- style =" cursor : pointer "
45
+ :class =" {
46
+ muted: element.checked !== null,
47
+ }"
48
+ @click =" (evt) => openDialog(element, evt)"
49
+ @keydown ="
50
+ (evt) => (evt.keyCode == 32 ? openDialog(element, evt) : null)
51
+ "
43
52
>
44
53
<b >{{ element.title }}</b >
54
+ <span
55
+ class =" required-label"
56
+ v-if =" element.required"
57
+ >
58
+ - verpflichtend
59
+ </span >
45
60
</span >
46
61
<span
47
62
v-if =" isDraggable"
@@ -82,6 +97,8 @@ import { MucIcon } from "@muenchen/muc-patternlab-vue";
82
97
import { Sortable } from " sortablejs-vue3" ;
83
98
import { computed , onBeforeUnmount , onMounted , ref } from " vue" ;
84
99
100
+ import P13nCheckbox from " @/components/P13nCheckbox.vue" ;
101
+
85
102
const props = withDefaults (
86
103
defineProps <{
87
104
checklistItems: ChecklistItem [];
@@ -120,7 +137,8 @@ function onSelectChange(serviceID: string) {
120
137
emit (" checked" , serviceID );
121
138
}
122
139
123
- function openDialog(item : ChecklistItem ) {
140
+ function openDialog(item : ChecklistItem , evt : Event ) {
141
+ evt .preventDefault ();
124
142
dialogItem .value = item ;
125
143
dialogVisible .value = true ;
126
144
emit (" label-click" , item );
@@ -182,24 +200,24 @@ function handleArrowKeyDown(event: KeyboardEvent) {
182
200
background-color : #d0e7ff ;
183
201
}
184
202
185
- .container {
186
- max-width : 600px ;
187
- margin : 1rem auto ;
188
- padding-left : 0 ;
189
- }
190
-
191
203
.list {
192
204
list-style : none ;
193
205
padding : 0 ;
194
206
margin : 0 ;
195
- border-top : 1px solid #ddd ;
207
+ border-top : 1px solid var (--color-neutrals-beau-blue-light , #e5eef5 );
208
+ border-bottom : 1px solid var (--color-neutrals-beau-blue-light , #e5eef5 );
209
+ }
210
+
211
+ .container {
212
+ padding-left : 0 ;
213
+ padding-right : 0 ;
214
+ padding-bottom : 56px ;
196
215
}
197
216
198
217
.list-item {
199
218
display : flex ;
200
219
align-items : center ;
201
- padding : 0.5rem 1rem ;
202
- border-bottom : 1px solid #ddd ;
220
+ border-bottom : 1px solid var (--color-neutrals-beau-blue-light , #e5eef5 );
203
221
user-select : none ;
204
222
cursor : grab ;
205
223
color : var (--color-brand-main-blue );
@@ -211,75 +229,32 @@ function handleArrowKeyDown(event: KeyboardEvent) {
211
229
212
230
/* text grayed out when selected */
213
231
.muted {
214
- color : #7a8d9f ;
232
+ color : #7a8d9f !important ;
215
233
}
216
234
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 ;
235
+ .label-text {
229
236
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 ;
237
+ color : var (--color-brand-main-blue );
238
+ /* Body/Body 1 Bold */
239
+ font-family : " Open Sans" , sans-serif ;
240
+ font-size : 18px ;
241
+ font-style : normal ;
242
+ font-weight : 700 ;
243
+ line-height : 150% ; /* 27px */
244
+
245
+ padding : 16px 8px ;
246
+ flex-grow : 1 ;
272
247
user-select : none ;
273
- transition : color 0.2s ease ;
274
248
}
275
249
276
- .radio-look :checked: hover::before {
277
- opacity : 0.8 ;
250
+ .label-text : hover {
251
+ text-decoration : underline ;
278
252
}
279
253
280
- .label-text {
281
- flex-grow : 1 ;
282
- user-select : none ;
254
+ @media (max-width : 576px ) {
255
+ .label-text {
256
+ padding : 12px 8px ;
257
+ }
283
258
}
284
259
285
260
.drag-handle {
@@ -320,4 +295,14 @@ function handleArrowKeyDown(event: KeyboardEvent) {
320
295
overflow-y : auto ;
321
296
box-shadow : 0 2px 10px rgba (0 , 0 , 0 , 0.2 );
322
297
}
298
+
299
+ .required-label {
300
+ color : var (--neutrals-grey , #3a5368 );
301
+ /* Body/Body 2 */
302
+ font-family : " Open Sans" , sans-serif ;
303
+ font-size : 16px ;
304
+ font-style : normal ;
305
+ font-weight : 400 ;
306
+ line-height : 150% ;
307
+ }
323
308
</style >
0 commit comments