5
5
<div
6
6
class =" AttributeContainer"
7
7
v-for =" element in componentMap[activeComponent].htmlList"
8
- :key =" element.id + Date.now()"
8
+ :key =" element.id as number + Date.now()"
9
9
>
10
10
<p v-if =" element.id === activeHTML" class =" title" >
11
11
Your class
31
31
id =" comp-btn"
32
32
class =" fa-solid fa-right-to-bracket"
33
33
:disable =" classText.length > 0 ? false : true"
34
- @click.self =" submitClass(classText, activeHTML)"
34
+ @click.self =" submitClass(classText, activeHTML as number )"
35
35
>
36
36
</i >
37
37
</q-input >
45
45
true
46
46
hide-bottom-space
47
47
v-model =" bindingText"
48
- @keydown.enter =" addBinding(bindingText, activeHTML)"
48
+ @keydown.enter =" addBinding(bindingText, activeHTML as number )"
49
49
>
50
50
<i
51
51
id =" compt-btn"
52
52
class =" fa-solid fa-right-to-bracket"
53
53
label =" Add Binding"
54
54
:disable =" bindingText.length > 0 ? false : true"
55
- @click.self =" addBinding(bindingText, activeHTML)"
55
+ @click.self =" addBinding(bindingText, activeHTML as number )"
56
56
>
57
57
</i >
58
58
</q-input >
59
59
</q-form >
60
60
<div
61
61
class =" AttributeContainer"
62
62
v-for =" element in componentMap[activeComponent].htmlList"
63
- :key =" element.id + Date.now()"
63
+ :key =" element.id as number + Date.now()"
64
64
>
65
65
<div
66
66
v-if =" exceptions.includes(element.text) && element.id === activeHTML"
81
81
color =" secondary"
82
82
label =" Submit Note"
83
83
:disable =" noteText.length > 0 ? false : true"
84
- @click.self =" submitNote(noteText, activeHTML)"
84
+ @click.self =" submitNote(noteText, activeHTML as number )"
85
85
>
86
86
</i >
87
87
</q-input >
98
98
:label-value =" 'Height:' + heightText"
99
99
inner-track-color =" primary"
100
100
color =" secondary"
101
- @change =" submitHeight(heightText, activeHTML)"
102
- @update:model-value =" submitHeight(heightText, activeHTML)"
101
+ @change =" submitHeight(heightText, activeHTML as number )"
102
+ @update:model-value =" submitHeight(heightText, activeHTML as number )"
103
103
style =" float : left ; margin-left : 5% "
104
104
/>
105
105
</q-form >
114
114
:label-value =" 'Elevation:' + topText"
115
115
inner-track-color =" primary"
116
116
color =" secondary"
117
- @change =" submitTop(topText, activeHTML)"
118
- @update:model-value =" submitTop(topText, activeHTML)"
117
+ @change =" submitTop(topText, activeHTML as number )"
118
+ @update:model-value =" submitTop(topText, activeHTML as number )"
119
119
style =" float : left ; margin-left : 35% "
120
120
/>
121
121
</q-form >
129
129
:label-value =" 'Width:' + widthText"
130
130
inner-track-color =" primary"
131
131
color =" secondary"
132
- @change =" submitWidth(widthText, activeHTML)"
133
- @update:model-value =" submitWidth(widthText, activeHTML)"
132
+ @change =" submitWidth(widthText, activeHTML as number )"
133
+ @update:model-value =" submitWidth(widthText, activeHTML as number )"
134
134
style =" margin-top : 20% "
135
135
/>
136
136
</q-form >
144
144
:label-value =" 'Position:' + leftText"
145
145
inner-track-color =" primary"
146
146
color =" secondary"
147
- @change =" submitLeft(leftText, activeHTML)"
148
- @update:model-value =" submitLeft(leftText, activeHTML)"
147
+ @change =" submitLeft(leftText, activeHTML as number )"
148
+ @update:model-value =" submitLeft(leftText, activeHTML as number )"
149
149
style =" margin-top : 20% "
150
150
/>
151
151
</q-form >
164
164
class =" fa-solid fa-right-to-bracket"
165
165
color =" secondary"
166
166
label =" Submit Height"
167
- @click.self =" submitHeight(heightText, activeHTML)"
167
+ @click.self =" submitHeight(heightText, activeHTML as number )"
168
168
>
169
169
</i >
170
170
</q-input >
184
184
class =" fa-solid fa-right-to-bracket"
185
185
color =" secondary"
186
186
label =" Submit Width"
187
- @click.self =" submitWidth(widthText, activeHTML)"
187
+ @click.self =" submitWidth(widthText, activeHTML as number )"
188
188
>
189
189
</i >
190
190
</q-input >
204
204
class =" fa-solid fa-right-to-bracket"
205
205
color =" secondary"
206
206
label =" Submit Height"
207
- @click.self =" submitTop(topText, activeHTML)"
207
+ @click.self =" submitTop(topText, activeHTML as number )"
208
208
>
209
209
</i >
210
210
</q-input >
224
224
class =" fa-solid fa-right-to-bracket"
225
225
color =" secondary"
226
226
label =" Submit Position"
227
- @click =" submitLeft(leftText, activeHTML)"
227
+ @click =" submitLeft(leftText, activeHTML as number )"
228
228
>
229
229
</i >
230
230
</q-input >
244
244
color =" transparent"
245
245
text-color =" primary"
246
246
label =" -"
247
- @click =" (e) => handleLayer(e)"
247
+ @click =" (e: Event ) => handleLayer(e)"
248
248
/>
249
249
<!-- nested for loop to iterate to display current z-index for selected htmlElement -->
250
250
<template v-for =" element in routes [activeRoute ]" >
263
263
color =" transparent"
264
264
text-color =" primary"
265
265
label =" +"
266
- @click =" (e) => handleLayer(e)"
266
+ @click =" (e: Event ) => handleLayer(e)"
267
267
/>
268
268
</q-item >
269
269
</div >
270
270
</div >
271
271
<q-btn
272
272
label =" Close HTML Element"
273
273
class =" closeBtn"
274
- @click =" closeMenu({ text: 'reset', id: 'reset' } )"
274
+ @click =" closeMenu()"
275
275
/>
276
276
</div >
277
277
</template >
278
278
279
279
<script setup lang="ts">
280
280
// new script for Composition API
281
+ import { Event } from " electron" ;
281
282
import { computed , ref , watch , onMounted } from " vue" ;
282
283
import { useStore } from " ../../../store/main.js" ;
283
284
@@ -311,13 +312,13 @@ const exceptions = ref([
311
312
" e-alert" ,
312
313
" e-dropdown" ,
313
314
]);
314
- const attributeModal = ref (" false" );
315
- const classText = ref (" " );
316
- const heightText = ref (" " );
317
- const widthText = ref (" " );
318
- const topText = ref (" " );
319
- const leftText = ref (" " );
320
- const z = ref (" 0" );
315
+ const attributeModal = ref (false );
316
+ const classText = ref ();
317
+ const heightText = ref ();
318
+ const widthText = ref ();
319
+ const topText = ref ();
320
+ const leftText = ref ();
321
+ // const z = ref("0");
321
322
const noteText = ref (" " );
322
323
const bindingText = ref (" " );
323
324
// const note = ref('');
@@ -333,10 +334,10 @@ onMounted(() => {
333
334
if (
334
335
activeHTML .value === routes .value [activeRoute .value ][i ].htmlList [j ].id
335
336
) {
336
- heightText .value = routes .value [activeRoute .value ][i ].htmlList [j ].h ;
337
- widthText .value = routes .value [activeRoute .value ][i ].htmlList [j ].w ;
338
- topText .value = routes .value [activeRoute .value ][i ].htmlList [j ].x ;
339
- leftText .value = routes .value [activeRoute .value ][i ].htmlList [j ].y ;
337
+ heightText .value = routes .value [activeRoute .value ][i ].htmlList [j ].h as number ;
338
+ widthText .value = routes .value [activeRoute .value ][i ].htmlList [j ].w as number ;
339
+ topText .value = routes .value [activeRoute .value ][i ].htmlList [j ].x as number ;
340
+ leftText .value = routes .value [activeRoute .value ][i ].htmlList [j ].y as number ;
340
341
}
341
342
}
342
343
}
@@ -352,9 +353,9 @@ const activeLayer = computed(() => store.activeLayer);
352
353
const attributeModalOpen = computed (() => store .attributeModalOpen );
353
354
const activeRoute = computed (() => store .activeRoute );
354
355
const routes = computed (() => store .routes );
355
- const activeComponentData = computed (() => store .activeComponentData );
356
- const activeComponentObj = computed (() => store .activeComponentObj );
357
- const componentData = computed (() => store .componentData );
356
+ // const activeComponentData = computed(() => store.activeComponentData);
357
+ // const activeComponentObj = computed(() => store.activeComponentObj);
358
+ // const componentData = computed(() => store.componentData);
358
359
359
360
// actions
360
361
@@ -446,17 +447,17 @@ const submitLeft = (element: string, idNum: number) => {
446
447
addActiveComponentLeft (payload );
447
448
};
448
449
449
- const closeMenu = (element : { text : string , id : string } ) => {
450
+ const closeMenu = () => {
450
451
if (activeComponent .value !== " " ) {
451
452
clearActiveHTML ();
452
- openAttributeModal (element );
453
+ openAttributeModal ();
453
454
}
454
455
};
455
456
456
457
// function that adds/subtracts z-index on html Elements
457
- const handleLayer = (e ) => {
458
+ const handleLayer = (e : Event ) => {
458
459
e .preventDefault ();
459
- let HTMLZ;
460
+ let HTMLZ: number = 0 ;
460
461
for (let i = 0 ; i < routes .value [activeRoute .value ].length ; i ++ ) {
461
462
for (
462
463
let j = 0 ;
@@ -466,7 +467,7 @@ const handleLayer = (e) => {
466
467
if (
467
468
activeHTML .value === routes .value [activeRoute .value ][i ].htmlList [j ].id
468
469
) {
469
- HTMLZ = routes .value [activeRoute .value ][i ].htmlList [j ].z ;
470
+ HTMLZ = routes .value [activeRoute .value ][i ].htmlList [j ].z as number ;
470
471
}
471
472
}
472
473
}
@@ -476,10 +477,10 @@ const handleLayer = (e) => {
476
477
routeArray: routes .value [activeRoute .value ],
477
478
z: HTMLZ ,
478
479
};
479
- if (e .target .innerText === " +" ) {
480
+ if (( e .target as HTMLElement ) .innerText === " +" ) {
480
481
payload .z ++ ;
481
482
}
482
- if (e .target .innerText === " -" && payload .z > 0 ) {
483
+ if (( e .target as HTMLElement ) .innerText === " -" && payload .z > 0 ) {
483
484
payload .z -- ;
484
485
}
485
486
updateHTMLLayer (payload );
@@ -489,7 +490,7 @@ const activeRouteArray = () => {
489
490
return routes .value [activeRoute .value ];
490
491
};
491
492
492
- const addBinding = (input , idNum ) => {
493
+ const addBinding = (input : string , idNum : number ) => {
493
494
if (input === " " ) {
494
495
return ;
495
496
}
0 commit comments