Skip to content

Commit 506ef14

Browse files
Shanon LeeShanon Lee
authored andcommitted
Removing vue3 draggable resizable packge and code temporarily
1 parent e58e389 commit 506ef14

File tree

6 files changed

+87
-50
lines changed

6 files changed

+87
-50
lines changed

package-lock.json

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

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
"node-gyp": "^8.4.1",
3131
"quasar": "^2.0.0",
3232
"quasar-dotenv": "^1.0.5",
33-
"vue-draggable-resizable": "^2.3.0",
3433
"vue-multiselect": "^3.0.0-alpha.1",
3534
"vue-prism-editor": "^2.0.0-alpha.2",
3635
"vued3tree": "^5.1.0",

quasar.conf.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ module.exports = configure(function (ctx) {
2626
// --> boot files are part of "main.js"
2727
// https://quasar.dev/quasar-cli/boot-files
2828
boot: [
29+
// "globals"
2930
],
3031

3132
// https://quasar.dev/quasar-cli/quasar-conf-js#Property%3A-css

src-electron/electron-main.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ ipcMain.handle('openProject', async (event, arg) => {
5656
return result;
5757
})
5858

59-
6059
// ************** Slack OAuth functions **********************
6160
// Sends request to Slack for User's information,
6261
// then sends user information back to renderer process

src-electron/electron-preload.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
const {ipcRenderer, shell, contextBridge} = require('electron');
2121
const path = require('path');
2222
const fs = require('fs-extra');
23-
2423
// ipcRenderer contextBridge
2524
// on: used in SlackLoginWindow
2625
//
@@ -46,4 +45,3 @@ const fs = require('fs-extra');
4645
contextBridge.exposeInMainWorld("path", {
4746
join: (...paths) => path.join(...paths)
4847
})
49-

src/components/ComponentDisplay.vue

Lines changed: 74 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,40 @@ Description:
1313
>
1414
<!-- This is the actual component box -->
1515
<!-- https://www.npmjs.com/package/vue-draggable-resizable -->
16-
<VueDraggableResizable
17-
class-name="component-box"
16+
17+
<!-- // ***************** Without draggable resizable, this works *********** -->
18+
<!-- <div
19+
class="component-box"
20+
v-for="componentData in activeRouteArray"
21+
ref="boxes"
22+
:key="componentData.componentName"
23+
:id="componentData.componentName"
24+
:x="componentData.x"
25+
:y="componentData.y"
26+
:z="componentData.z"
27+
:w="componentData.w"
28+
:h="componentData.h"
29+
:parent="true"
30+
:preventDeactivation="true"
31+
@activated="onActivated(componentData)"
32+
@click="onActivated(componentData)"
33+
@deactivated="onDeactivated(componentData)"
34+
@dragstop="finishedDrag"
35+
@resizestop="finishedResize"
36+
:onDragStart="recordInitialPosition"
37+
:onResizeStart="recordInitialSize"
38+
>
39+
{{ componentData.componentName }}
40+
{{ componentData.w }}
41+
{{ componentData.x }}
42+
{{ componentData.y }}
43+
{{ componentData.z }}
44+
{{ componentData.h }}
45+
</div> -->
46+
47+
<!-- ************************** Old vue draggable resizable *************** -->
48+
<!-- <vue-draggable-resizable
49+
class="component-box"
1850
v-for="componentData in activeRouteArray"
1951
ref="boxes"
2052
:key="componentData.componentName"
@@ -69,9 +101,15 @@ Description:
69101
</q-item>
70102
</q-list>
71103
</q-menu>
72-
</VueDraggableResizable>
104+
</vue-draggable-resizable> -->
105+
73106

74107

108+
<!-- ************************ Vue3 draggable resizable ******************* -->
109+
110+
111+
112+
<!-- ********************* This part works, don't touch it *************** -->
75113
<div>
76114
<q-dialog v-model="modalOpen">
77115
<q-select
@@ -92,16 +130,20 @@ Description:
92130
</template>
93131

94132
<script>
133+
import { defineComponent } from "vue"
95134
import { mapState, mapActions } from "vuex";
96-
import VueDraggableResizable from "vue-draggable-resizable";
97-
const cloneDeep = require('lodash.clonedeep')
135+
// import Vue3DraggableResizable from 'vue3-draggable-resizable';
136+
137+
// import { DraggableContainer } from 'vue3-draggable-resizable'
138+
// import VueDraggableResizable from "vue-draggable-resizable";
98139
// import "vue-draggable-resizable/dist/VueDraggableResizable.css";
99-
// import Vue3DraggableResizable from "vue3-draggable-resizable";
100-
// import "vue3-draggable-resizable/dist/Vue3DraggableResizable.css";
140+
const cloneDeep = require('lodash.clonedeep')
141+
142+
101143
export default {
102144
name: "ComponentDisplay",
103145
components: {
104-
VueDraggableResizable
146+
// Vue3DraggableResizable
105147
},
106148
data() {
107149
// console.log("Current Component Map is: ", this.componentMap);
@@ -156,7 +198,6 @@ export default {
156198
]),
157199
// used in VueDraggableResizeable component
158200
activeRouteArray() {
159-
// console.log(this.routes[this.activeRoute]);
160201
return this.routes[this.activeRoute];
161202
},
162203
// used to delete active component
@@ -214,25 +255,33 @@ export default {
214255
}
215256
},
216257
updated() {
258+
// console.log(this.$refs.boxes);
217259
// if there are no active components, all boxes are unhighlighted
218260
if (this.activeComponent === "") {
219261
if (this.$refs.boxes) {
220262
this.$refs.boxes.forEach(element => {
221263
element.enabled = false;
222-
element.$emit("deactivated");
223-
element.$emit("update:active", false);
264+
265+
// element.$emit("deactivated");
266+
// element.$emit("update:active", false);
267+
this.$emit("deactivated");
268+
this.$emit("update:active", false);
224269
});
225270
}
226271
} else {
227272
// if a component is set to active, highlight it
228273
this.$refs.boxes.forEach(element => {
229274
if (
230-
this.activeComponent === element.$attrs.id &&
275+
// this.activeComponent === element.$attrs.id &&
276+
// element.enabled === false
277+
this.activeComponent === element.id &&
231278
element.enabled === false
232279
) {
233280
element.enabled = true;
234-
element.$emit("activated");
235-
element.$emit("update:active", true);
281+
// element.$emit("activated");
282+
// element.$emit("update:active", true);
283+
this.$emit("activated");
284+
this.$emit("update:active", true);
236285
}
237286
});
238287
}
@@ -329,14 +378,19 @@ export default {
329378
*/
330379
// unhighlights all inactive components
331380
onActivated(componentData) {
381+
console.log('This is ACTIVATED')
332382
// console.log('onActivated - comp display, componentData', componentData)
333383
if (this.$refs.boxes) {
334384
this.$refs.boxes.forEach(element => {
335-
if (element.$attrs.id !== componentData.componentName) {
385+
if (element.id !== componentData.componentName) {
386+
console.log('Emit')
336387
element.enabled = false;
337-
element.$emit("deactivated");
338-
// this.setActiveComponent(componentData.componentName)
339-
element.$emit("update:active", false);
388+
// element.$emit("deactivated");
389+
390+
// element.$emit("update:active", false);
391+
this.$emit("deactivated");
392+
393+
this.$emit("update:active", false);
340394
}
341395
});
342396
}
@@ -347,6 +401,7 @@ export default {
347401
},
348402
// deactivated is emitted before activated
349403
onDeactivated() {
404+
console.log('This is DEACTIVATED')
350405
if (this.activeComponent !== "") {
351406
this.activeComponentData.isActive = false;
352407
}
@@ -395,7 +450,7 @@ export default {
395450
}
396451
}
397452
}
398-
};
453+
}
399454
</script>
400455

401456
<style scoped>

0 commit comments

Comments
 (0)