Skip to content

Commit 281c866

Browse files
Ji KimJi Kim
authored andcommitted
Merge branch 'typescript' of https://github.com/oslabs-beta/OverVue into typescript
2 parents 11ba7fc + 331e30d commit 281c866

32 files changed

+785
-951
lines changed

package-lock.json

Lines changed: 218 additions & 354 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"vue": "^3.2.31",
5757
"vue-accessible-color-picker": "^4.0.3",
5858
"vue-draggable-resizable": "^2.3.0",
59+
"vue-loader": "^17.0.0",
5960
"vue-multiselect": "^3.0.0-alpha.2",
6061
"vue-prism-editor": "^2.0.0-alpha.2",
6162
"vue-router": "4.0.13",

src/components/Canvas.vue

Lines changed: 45 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Functionality includes: resizing/dragging component boxes, display grid image, active component
55
-->
66

7-
<!-- beneath line 419, we deleted :hint="hint" -->
7+
<!-- beneath line 419, we deleted :hint="hint" -->
88

99
<template>
1010
<!-- the background Canvas grid -->
@@ -330,15 +330,15 @@
330330
color="transparent"
331331
text-color="primary"
332332
label="&ndash;"
333-
@click="(e) => handleLayer(e)"
333+
@click="(e : Event) => handleLayer(e)"
334334
/>
335335
<p id="counter">{{ componentData.z }}</p>
336336
<q-btn
337337
class="minorAction"
338338
color="transparent"
339339
text-color="primary"
340340
label="+"
341-
@click="(e) => handleLayer(e)"
341+
@click="(e : Event) => handleLayer(e)"
342342
/>
343343
</q-item>
344344
<q-item clickable v-ripple v-close-popup @click="handleAddChild">
@@ -515,8 +515,8 @@ import { ColorPicker } from "vue-accessible-color-picker";
515515
import { useStore } from "../store/main.js";
516516
import { ref, computed, onMounted, watch } from "vue";
517517
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;
520520
521521
const cloneDeep = require("lodash.clonedeep");
522522
@@ -660,52 +660,62 @@ const updated = computed(() => {
660660
}
661661
} else {
662662
// 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+
}
671673
}
672-
});
674+
);
673675
}
674676
});
675677
676678
//methods
677-
const setActiveComponent: typeof store.setActiveComponent = (payload) => store.setActiveComponent(payload);
679+
const setActiveComponent: typeof store.setActiveComponent = (payload) =>
680+
store.setActiveComponent(payload);
678681
// const updateComponentChildrenMultiselectValue: typeof store.updateComponentChildrenMultiselectValue = (payload) =>
679682
// 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);
684688
// 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);
687692
// 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);
689695
const addActiveComponentNote: typeof store.addActiveComponentNote = (payload) =>
690696
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);
693700
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);
698708
699709
const useExportComponentBound = () => {
700710
useExportComponent();
701711
};
702712
703-
const isElementPlus = (htmlList: {text: string}[]) => {
713+
const isElementPlus = (htmlList: { text: string }[]) => {
704714
return htmlList.find(({ text }) => text[0] === "e");
705715
};
706716
707717
//color change function
708-
const updateColors = (data: {cssColor: string}) => {
718+
const updateColors = (data: { cssColor: string }) => {
709719
let payload = {
710720
color: data.cssColor,
711721
activeComponent: activeComponent.value,
@@ -746,7 +756,6 @@ const refresh = () => {
746756
updateComponentLayer(payload);
747757
};
748758
749-
750759
// drag and drop function
751760
const finishedDrag = (x: number, y: number) => {
752761
let payload = {
@@ -763,7 +772,7 @@ const finishedDrag = (x: number, y: number) => {
763772
refresh();
764773
};
765774
766-
const onActivated = (componentData: {componentName: string}) => {
775+
const onActivated = (componentData: { componentName: string }) => {
767776
if (!componentData) {
768777
return;
769778
}
@@ -827,7 +836,9 @@ const submitNote = (e: Event) => {
827836
};
828837
829838
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+
);
831842
};
832843
833844
// used when user selects to add child from dropdown
@@ -1435,7 +1446,7 @@ li:hover {
14351446
linear-gradient(90deg, rgba(255, 255, 255, 0.8) 1px, transparent 1px),
14361447
linear-gradient(rgba(255, 255, 255, 0.3) 1px, transparent 1px),
14371448
linear-gradient(90deg, rgba(255, 255, 255, 0.3) 1px, transparent 1px);
1438-
-pie-background: linear-gradient(
1449+
-pie-background: linear-gradient(
14391450
rgba(255, 255, 255, 0.8) 1px,
14401451
transparent 1px
14411452
) -2px -2px / 100px,

src/components/EssentialLink.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
</q-item>
1414
</template>
1515

16-
<script>
17-
export default { name: "EssentialLink" };
18-
</script>
19-
2016
<script setup lang="ts">
2117
const props = defineProps({
2218
title: {

0 commit comments

Comments
 (0)