@@ -14,31 +14,31 @@ const props = defineProps<{
1414 readOnly? : boolean
1515}>()
1616
17- const emit = defineEmits ( {
18- ' update:link' : ( value : string ) => true ,
19- ' update:head-enabled' : ( value : boolean ) => true ,
20- ' update:body-enabled' : ( value : boolean ) => true ,
21- ' update:head-wrap' : ( value : boolean ) => true ,
22- ' update:body-wrap' : ( value : boolean ) => true ,
23- ' update:pos-x' : ( value : number ) => true ,
24- ' update:pos-y' : ( value : number ) => true ,
25- ' update:anchor-x' : ( value : number ) => true ,
26- ' update:anchor-y' : ( value : number ) => true ,
27- ' update:width' : ( value : string ) => true ,
28- ' update:color' : ( value : number ) => true ,
29- ' update:color-inherit' : ( value : boolean ) => true ,
30- ' update:collapsible' : ( value : boolean ) => true ,
31- ' update:collapsed' : ( value : boolean ) => true ,
32- ' update:movable' : ( value : boolean ) => true ,
33- ' update:resizable' : ( value : boolean ) => true ,
34- ' update:read-only' : ( value : boolean ) => true ,
35- ' update:container-enabled' : ( value : boolean ) => true ,
36- ' update:container-horizontal' : ( value : boolean ) => true ,
37- ' update:container-spatial' : ( value : boolean ) => true ,
38- ' update:container-wrap-children' : ( value : boolean ) => true ,
39- ' update:container-stretch-children' : ( value : boolean ) => true ,
40- ' update:container-force-color-inheritance' : ( value : boolean ) => true ,
41- })
17+ const emit = defineEmits < {
18+ ' update:link' : [ value : string ]
19+ ' update:head-enabled' : [ value : boolean ]
20+ ' update:body-enabled' : [ value : boolean ]
21+ ' update:head-wrap' : [ value : boolean ]
22+ ' update:body-wrap' : [ value : boolean ]
23+ ' update:pos-x' : [ value : number ]
24+ ' update:pos-y' : [ value : number ]
25+ ' update:anchor-x' : [ value : number ]
26+ ' update:anchor-y' : [ value : number ]
27+ ' update:width' : [ value : string ]
28+ ' update:color' : [ value : number ]
29+ ' update:color-inherit' : [ value : boolean ]
30+ ' update:collapsible' : [ value : boolean ]
31+ ' update:collapsed' : [ value : boolean ]
32+ ' update:movable' : [ value : boolean ]
33+ ' update:resizable' : [ value : boolean ]
34+ ' update:read-only' : [ value : boolean ]
35+ ' update:container-enabled' : [ value : boolean ]
36+ ' update:container-horizontal' : [ value : boolean ]
37+ ' update:container-spatial' : [ value : boolean ]
38+ ' update:container-wrap-children' : [ value : boolean ]
39+ ' update:container-stretch-children' : [ value : boolean ]
40+ ' update:container-force-color-inheritance' : [ value : boolean ]
41+ }>( )
4242
4343const link = computed (() => props .noteModel ?.link ?.value ?? ' ' )
4444const headEnabled = computed (() => props .noteModel ?.head ?.enabled ?.value ?? true )
@@ -93,7 +93,7 @@ function handleColorSelect(colorIndex: number) {
9393 placeholder="https://..."
9494 class="h-8 text-xs"
9595 :disabled =" readOnly "
96- @update :model-value =" emit (' update:link' , $event )"
96+ @update :model-value =" emit (' update:link' , $event as string )"
9797 />
9898 <Button
9999 variant="outline"
@@ -113,15 +113,15 @@ function handleColorSelect(colorIndex: number) {
113113 <Switch
114114 :model-value =" headEnabled "
115115 :disabled =" readOnly "
116- @update :model-value =" emit (' update:head-enabled' , $event )"
116+ @update :model-value =" emit (' update:head-enabled' , $event as boolean )"
117117 />
118118 <Label >Head</Label >
119119 </div >
120120 <div class =" flex items-center gap-2" >
121121 <Switch
122122 :model-value =" bodyEnabled "
123123 :disabled =" readOnly "
124- @update :model-value =" emit (' update:body-enabled' , $event )"
124+ @update :model-value =" emit (' update:body-enabled' , $event as boolean )"
125125 />
126126 <Label >Body</Label >
127127 </div >
@@ -133,15 +133,15 @@ function handleColorSelect(colorIndex: number) {
133133 <Switch
134134 :model-value =" headWrap "
135135 :disabled =" readOnly "
136- @update :model-value =" emit (' update:head-wrap' , Boolean ( $event ) )"
136+ @update :model-value =" emit (' update:head-wrap' , $event as boolean )"
137137 />
138138 <Label >Head wrap</Label >
139139 </div >
140140 <div class =" flex items-center gap-2" >
141141 <Switch
142142 :model-value =" bodyWrap "
143143 :disabled =" readOnly "
144- @update :model-value =" emit (' update:body-wrap' , Boolean ( $event ) )"
144+ @update :model-value =" emit (' update:body-wrap' , $event as boolean )"
145145 />
146146 <Label >Body wrap</Label >
147147 </div >
@@ -157,7 +157,7 @@ function handleColorSelect(colorIndex: number) {
157157 :model-value =" posX "
158158 class="h-8 text-xs"
159159 :disabled =" readOnly "
160- @update :model-value =" emit (' update:pos-x' , parseFloat ( String ( $event ) ) || 0 )"
160+ @update :model-value =" emit (' update:pos-x' , Number ( $event ) || 0 )"
161161 />
162162 </div >
163163 <div class =" flex-1" >
@@ -166,7 +166,7 @@ function handleColorSelect(colorIndex: number) {
166166 :model-value =" posY "
167167 class="h-8 text-xs"
168168 :disabled =" readOnly "
169- @update :model-value =" emit (' update:pos-y' , parseFloat ( String ( $event ) ) || 0 )"
169+ @update :model-value =" emit (' update:pos-y' , Number ( $event ) || 0 )"
170170 />
171171 </div >
172172 </div >
@@ -181,7 +181,7 @@ function handleColorSelect(colorIndex: number) {
181181 :value =" anchorX"
182182 class =" h-8 w-full rounded-md border border-input bg-background px-2 text-xs"
183183 :disabled =" readOnly"
184- @change =" emit('update:anchor-x', parseFloat (($event.target as HTMLSelectElement).value))"
184+ @change =" emit('update:anchor-x', Number (($event.target as HTMLSelectElement).value))"
185185 >
186186 <option value =" 0" >Left</option >
187187 <option value =" 0.5" >Center</option >
@@ -193,7 +193,7 @@ function handleColorSelect(colorIndex: number) {
193193 :value =" anchorY"
194194 class =" h-8 w-full rounded-md border border-input bg-background px-2 text-xs"
195195 :disabled =" readOnly"
196- @change =" emit('update:anchor-y', parseFloat (($event.target as HTMLSelectElement).value))"
196+ @change =" emit('update:anchor-y', Number (($event.target as HTMLSelectElement).value))"
197197 >
198198 <option value =" 0" >Top</option >
199199 <option value =" 0.5" >Center</option >
@@ -210,7 +210,7 @@ function handleColorSelect(colorIndex: number) {
210210 :value =" width"
211211 class =" h-8 w-full rounded-md border border-input bg-background px-2 text-xs"
212212 :disabled =" readOnly"
213- @change =" emit('update:width', ($event.target as HTMLSelectElement).value)"
213+ @change =" emit('update:width', ($event.target as HTMLSelectElement).value as string )"
214214 >
215215 <option value =" Auto" >Auto</option >
216216 <option value =" Minimum" >Minimum</option >
@@ -225,7 +225,7 @@ function handleColorSelect(colorIndex: number) {
225225 <Switch
226226 :model-value =" colorInherit "
227227 :disabled =" readOnly "
228- @update :model-value =" emit (' update:color-inherit' , $event )"
228+ @update :model-value =" emit (' update:color-inherit' , $event as boolean )"
229229 />
230230 <Label class="text-[10px]">Inherit</Label >
231231 </div >
@@ -253,15 +253,15 @@ function handleColorSelect(colorIndex: number) {
253253 <Switch
254254 :model-value =" collapsible "
255255 :disabled =" readOnly "
256- @update :model-value =" emit (' update:collapsible' , $event )"
256+ @update :model-value =" emit (' update:collapsible' , $event as boolean )"
257257 />
258258 <Label >Collapsible</Label >
259259 </div >
260260 <div class =" flex items-center gap-2 pl-6" >
261261 <Switch
262262 :model-value =" collapsed "
263263 :disabled =" readOnly || ! collapsible "
264- @update :model-value =" emit (' update:collapsed' , $event )"
264+ @update :model-value =" emit (' update:collapsed' , $event as boolean )"
265265 />
266266 <Label >Collapsed</Label >
267267 </div >
@@ -273,47 +273,47 @@ function handleColorSelect(colorIndex: number) {
273273 <Switch
274274 :model-value =" containerEnabled "
275275 :disabled =" readOnly "
276- @update :model-value =" emit (' update:container-enabled' , $event )"
276+ @update :model-value =" emit (' update:container-enabled' , $event as boolean )"
277277 />
278278 <Label >Container</Label >
279279 </div >
280280 <div class =" flex items-center gap-2 pl-6" >
281281 <Switch
282282 :model-value =" containerSpatial "
283283 :disabled =" readOnly || ! containerEnabled "
284- @update :model-value =" emit (' update:container-spatial' , $event )"
284+ @update :model-value =" emit (' update:container-spatial' , $event as boolean )"
285285 />
286286 <Label >Spatial</Label >
287287 </div >
288288 <div class =" flex items-center gap-2 pl-6" >
289289 <Switch
290290 :model-value =" containerHorizontal "
291291 :disabled =" readOnly || ! containerEnabled "
292- @update :model-value =" emit (' update:container-horizontal' , $event )"
292+ @update :model-value =" emit (' update:container-horizontal' , $event as boolean )"
293293 />
294294 <Label >Horizontal layout</Label >
295295 </div >
296296 <div class =" flex items-center gap-2 pl-6" >
297297 <Switch
298298 :model-value =" containerWrapChildren "
299299 :disabled =" readOnly || ! containerEnabled "
300- @update :model-value =" emit (' update:container-wrap-children' , $event )"
300+ @update :model-value =" emit (' update:container-wrap-children' , $event as boolean )"
301301 />
302302 <Label >Wrap children</Label >
303303 </div >
304304 <div class =" flex items-center gap-2 pl-6" >
305305 <Switch
306306 :model-value =" containerStretchChildren "
307307 :disabled =" readOnly || ! containerEnabled "
308- @update :model-value =" emit (' update:container-stretch-children' , $event )"
308+ @update :model-value =" emit (' update:container-stretch-children' , $event as boolean )"
309309 />
310310 <Label >Stretch children</Label >
311311 </div >
312312 <div class =" flex items-center gap-2 pl-6" >
313313 <Switch
314314 :model-value =" containerForceColorInheritance "
315315 :disabled =" readOnly || ! containerEnabled "
316- @update :model-value =" emit (' update:container-force-color-inheritance' , $event )"
316+ @update :model-value =" emit (' update:container-force-color-inheritance' , $event as boolean )"
317317 />
318318 <Label >Force color inheritance</Label >
319319 </div >
@@ -325,15 +325,15 @@ function handleColorSelect(colorIndex: number) {
325325 <Switch
326326 :model-value =" movable "
327327 :disabled =" readOnly "
328- @update :model-value =" emit (' update:movable' , $event )"
328+ @update :model-value =" emit (' update:movable' , $event as boolean )"
329329 />
330330 <Label >Movable</Label >
331331 </div >
332332 <div class =" flex items-center gap-2" >
333333 <Switch
334334 :model-value =" resizable "
335335 :disabled =" readOnly "
336- @update :model-value =" emit (' update:resizable' , $event )"
336+ @update :model-value =" emit (' update:resizable' , $event as boolean )"
337337 />
338338 <Label >Resizable</Label >
339339 </div >
@@ -344,7 +344,7 @@ function handleColorSelect(colorIndex: number) {
344344 <Switch
345345 :model-value =" readOnly "
346346 :disabled =" readOnly "
347- @update :model-value =" emit (' update:read-only' , $event )"
347+ @update :model-value =" emit (' update:read-only' , $event as boolean )"
348348 />
349349 <Label >Read-only</Label >
350350 </div >
0 commit comments