4
4
Functionality includes: resizing/dragging component boxes, display grid image, active component
5
5
-->
6
6
7
- <!-- beneath line 419, we deleted :hint="hint" -->
7
+ <!-- beneath line 419, we deleted :hint="hint" -->
8
8
9
9
<template >
10
10
<!-- the background Canvas grid -->
330
330
color =" transparent"
331
331
text-color =" primary"
332
332
label =" &ndash ; "
333
- @click =" (e) => handleLayer(e)"
333
+ @click =" (e : Event ) => handleLayer(e)"
334
334
/>
335
335
<p id =" counter" >{{ componentData.z }}</p >
336
336
<q-btn
337
337
class =" minorAction"
338
338
color =" transparent"
339
339
text-color =" primary"
340
340
label =" +"
341
- @click =" (e) => handleLayer(e)"
341
+ @click =" (e : Event ) => handleLayer(e)"
342
342
/>
343
343
</q-item >
344
344
<q-item clickable v-ripple v-close-popup @click =" handleAddChild" >
@@ -515,8 +515,8 @@ import { ColorPicker } from "vue-accessible-color-picker";
515
515
import { useStore } from " ../store/main.js" ;
516
516
import { ref , computed , onMounted , watch } from " vue" ;
517
517
import * as fs from " fs" ;
518
- import { ResizePayload , Component } from " ../../types"
519
- const { ipcRenderer } = window . require ( " electron " ) ;
518
+ import { ResizePayload , Component } from " ../../types" ;
519
+ const { ipcRenderer } = window ;
520
520
521
521
const cloneDeep = require (" lodash.clonedeep" );
522
522
@@ -660,52 +660,62 @@ const updated = computed(() => {
660
660
}
661
661
} else {
662
662
// if a component is set to active, highlight it
663
- (boxes .value as typeof VueDraggableResizable ).forEach ((element : typeof VueDraggableResizable ) => {
664
- if (
665
- activeComponent .value === element .$attrs .id &&
666
- element .enabled === false
667
- ) {
668
- element .enabled = true ;
669
- element .emit (" activated" );
670
- element .emit (" update:active" , true );
663
+ (boxes .value as typeof VueDraggableResizable ).forEach (
664
+ (element : typeof VueDraggableResizable ) => {
665
+ if (
666
+ activeComponent .value === element .$attrs .id &&
667
+ element .enabled === false
668
+ ) {
669
+ element .enabled = true ;
670
+ element .emit (" activated" );
671
+ element .emit (" update:active" , true );
672
+ }
671
673
}
672
- } );
674
+ );
673
675
}
674
676
});
675
677
676
678
// methods
677
- const setActiveComponent: typeof store .setActiveComponent = (payload ) => store .setActiveComponent (payload );
679
+ const setActiveComponent: typeof store .setActiveComponent = (payload ) =>
680
+ store .setActiveComponent (payload );
678
681
// const updateComponentChildrenMultiselectValue: typeof store.updateComponentChildrenMultiselectValue = (payload) =>
679
682
// store.updateComponentChildrenMultiselectValue(payload);
680
- const updateActiveComponentChildrenValue: typeof store .updateActiveComponentChildrenValue = (payload ) =>
681
- store .updateActiveComponentChildrenValue (payload );
682
- const updateComponentPosition: typeof store .updateComponentPosition = (payload ) =>
683
- store .updateComponentPosition (payload );
683
+ const updateActiveComponentChildrenValue: typeof store .updateActiveComponentChildrenValue =
684
+ (payload ) => store .updateActiveComponentChildrenValue (payload );
685
+ const updateComponentPosition: typeof store .updateComponentPosition = (
686
+ payload
687
+ ) => store .updateComponentPosition (payload );
684
688
// const updateStartingPosition: typeof store.updateStartingPosition = (payload) =>
685
- // (payload);
686
- const updateComponentLayer: typeof store .updateComponentLayer = (payload ) => store .updateComponentLayer (payload );
689
+ // (payload);
690
+ const updateComponentLayer: typeof store .updateComponentLayer = (payload ) =>
691
+ store .updateComponentLayer (payload );
687
692
// const updateStartingSize: typeof store.updateStartingSize = (payload) => store.updateStartingSize(payload);
688
- const updateComponentSize: typeof store .updateComponentSize = (payload ) => store .updateComponentSize (payload );
693
+ const updateComponentSize: typeof store .updateComponentSize = (payload ) =>
694
+ store .updateComponentSize (payload );
689
695
const addActiveComponentNote: typeof store .addActiveComponentNote = (payload ) =>
690
696
store .addActiveComponentNote (payload );
691
- const deleteActiveComponentNote: typeof store .deleteActiveComponentNote = (payload ) =>
692
- store .deleteActiveComponentNote (payload );
697
+ const deleteActiveComponentNote: typeof store .deleteActiveComponentNote = (
698
+ payload
699
+ ) => store .deleteActiveComponentNote (payload );
693
700
const openNoteModal: typeof store .openNoteModal = () => store .openNoteModal ();
694
- const openColorModal: typeof store .openColorModal = () => store .openColorModal ();
695
- const updateColor: typeof store .updateColor = (payload ) => store .updateColor (payload );
696
- const updateComponentGridPosition: typeof store .updateComponentGridPosition = (payload ) =>
697
- store .updateComponentGridPosition (payload );
701
+ const openColorModal: typeof store .openColorModal = () =>
702
+ store .openColorModal ();
703
+ const updateColor: typeof store .updateColor = (payload ) =>
704
+ store .updateColor (payload );
705
+ const updateComponentGridPosition: typeof store .updateComponentGridPosition = (
706
+ payload
707
+ ) => store .updateComponentGridPosition (payload );
698
708
699
709
const useExportComponentBound = () => {
700
710
useExportComponent ();
701
711
};
702
712
703
- const isElementPlus = (htmlList : {text: string }[]) => {
713
+ const isElementPlus = (htmlList : { text: string }[]) => {
704
714
return htmlList .find (({ text }) => text [0 ] === " e" );
705
715
};
706
716
707
717
// color change function
708
- const updateColors = (data : {cssColor: string }) => {
718
+ const updateColors = (data : { cssColor: string }) => {
709
719
let payload = {
710
720
color: data .cssColor ,
711
721
activeComponent: activeComponent .value ,
@@ -746,7 +756,6 @@ const refresh = () => {
746
756
updateComponentLayer (payload );
747
757
};
748
758
749
-
750
759
// drag and drop function
751
760
const finishedDrag = (x : number , y : number ) => {
752
761
let payload = {
@@ -763,7 +772,7 @@ const finishedDrag = (x: number, y: number) => {
763
772
refresh ();
764
773
};
765
774
766
- const onActivated = (componentData : {componentName: string }) => {
775
+ const onActivated = (componentData : { componentName: string }) => {
767
776
if (! componentData ) {
768
777
return ;
769
778
}
@@ -827,7 +836,9 @@ const submitNote = (e: Event) => {
827
836
};
828
837
829
838
const deleteNote = (e : Event ) => {
830
- deleteActiveComponentNote ((((e .target ) as HTMLElement ).previousElementSibling as HTMLElement ).innerText );
839
+ deleteActiveComponentNote (
840
+ ((e .target as HTMLElement ).previousElementSibling as HTMLElement ).innerText
841
+ );
831
842
};
832
843
833
844
// used when user selects to add child from dropdown
@@ -1435,7 +1446,7 @@ li:hover {
1435
1446
linear-gradient (90deg , rgba (255 , 255 , 255 , 0.8 ) 1px , transparent 1px ),
1436
1447
linear-gradient (rgba (255 , 255 , 255 , 0.3 ) 1px , transparent 1px ),
1437
1448
linear-gradient (90deg , rgba (255 , 255 , 255 , 0.3 ) 1px , transparent 1px );
1438
- -pie-background : linear-gradient (
1449
+ -pie-background : linear-gradient (
1439
1450
rgba (255 , 255 , 255 , 0.8 ) 1px ,
1440
1451
transparent 1px
1441
1452
) -2px -2px / 100px ,
0 commit comments