Skip to content

Commit f272500

Browse files
committed
committing layers in edit component drop down
1 parent 4eac7e6 commit f272500

File tree

8 files changed

+285
-402
lines changed

8 files changed

+285
-402
lines changed

package-lock.json

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

src/components/HomeSideDropDownItems/ComponentList.vue

Lines changed: 0 additions & 159 deletions
This file was deleted.

src/components/dashboard_items/HTMLQueue.vue

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ Description:
55
-->
66

77
<template>
8-
<section class="home-queue">
8+
<section class="html-queue">
99
<i v-if='this.activeLayer.id !== ""' class="fas fa fa-chevron-up fa-md" @click="setParentLayer"></i>
10-
<span class='list-title' v-if='this.activeLayer.id !== ""'> Viewing Elements in '{{ this.activeComponent }} {{ depth }}' </span>
11-
<span class='list-title' v-else-if='this.activeComponent !==""'> Viewing Elements in '{{ this.activeComponent }}' </span>
12-
<span class='list-title' v-else> Elements in Queue </span>
10+
<span class='list-title' v-if='this.activeLayer.id !== ""'> Viewing Elements in '{{ depth }}' </span>
11+
<span class='list-title' v-else-if='this.activeComponent !==""'> </span>
1312
<hr>
1413
<div
1514
group="people"
@@ -117,7 +116,7 @@ export default {
117116
</script>
118117

119118
<style lang="stylus" scoped>
120-
.home-queue {
119+
.html-queue {
121120
padding-bottom: 40px;
122121
}
123122

src/components/home_sidebar_items/CreateComponent.vue

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@ Description:
33
Handles create component menu on left-side
44
Functionality includes: creating a component, preventing users from entering invalid component file names
55
-->
6-
76
<template>
87
<div class="home-sidebar drawer-menu">
98
<br />
109
<form
1110
v-on:submit.prevent="createComponent"
12-
v-on:click="resetActiveComponent"
1311
>
1412
<q-input
1513
standout="bg-secondary text-white"
1614
bottom-slots
15+
v-on:keyup.delete.stop
1716
v-model="componentNameInputValue"
1817
label="Component Name"
1918
dense
@@ -103,16 +102,11 @@ export default {
103102
}
104103
105104
this.registerComponent(component)
106-
},
107-
108-
// clears active component during component creation
109-
resetActiveComponent () {
110-
if (this.activeComponent !== '') {
111-
this.setActiveComponent('')
112-
}
105+
this.setActiveComponent(component.componentName)
113106
}
114107
}
115108
}
109+
116110
</script>
117111

118112
<style type="stylus" scoped>

src/components/home_sidebar_items/ComponentList.vue renamed to src/components/home_sidebar_items/EditDeleteComponents.vue

Lines changed: 61 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,39 @@ Description:
4646
<p class="editName" v-else>Select a component</p>
4747
<q-btn id="deleteButton" @click="deleteSelectedComp(activeComponentData)" label = 'Delete currently selected'/>
4848
<div v-if="this.activeComponentData">
49-
<p>Toggle to edit state</p>
50-
<toggle-button v-model="showState"/>
49+
<br/>
50+
<section>Layer:
51+
<q-btn
52+
class="btn"
53+
color="transparent"
54+
text-color="primary"
55+
label="-"
56+
@click="e => handleLayer(e)"
57+
/>
58+
<p id="counter" style="color: white">{{ activeComponentObj.z }}</p>
59+
<q-btn
60+
class="btn"
61+
color="transparent"
62+
text-color="primary"
63+
label="+"
64+
@click="e => handleLayer(e)"
65+
/>
66+
</section>
67+
68+
<p> Toggle to edit: </p>
69+
<section class="toggleText"> HTML elements
70+
<toggle-button v-model="showHTML"/> </section>
71+
<HTMLQueue v-if="showHTML"/>
72+
<br/>
73+
<section class="toggleText"> State
74+
<toggle-button v-model="showState"/> </section>
75+
<hr v-if="showState">
5176
<a
5277
v-for="s in this.activeComponentData.state"
5378
:key="s"
5479
>
5580
<q-list v-if="showState" class="list-item" dense bordered separator>
56-
<q-item clickable v-ripple class="list-item">
81+
<q-item clickable v-ripple class="list-item">
5782
<q-item-section>
5883
<div class="component-container">
5984
<div class="component-info">
@@ -66,8 +91,9 @@ Description:
6691
</q-list>
6792
</a>
6893
<br/>
69-
<p>Toggle to edit actions</p>
70-
<toggle-button v-model="showActions" />
94+
<section class="toggleText"> Actions
95+
<toggle-button v-model="showActions" /> </section>
96+
<hr v-if="showActions">
7197
<a
7298
v-for="action in this.activeComponentData.actions"
7399
:key="action"
@@ -86,8 +112,10 @@ Description:
86112
</q-list>
87113
</a>
88114
<br/>
89-
<p>Toggle to edit props</p>
90-
<toggle-button v-model="showProps"/>
115+
<section class="toggleText">
116+
Props
117+
<toggle-button v-model="showProps"/> </section>
118+
<hr v-if="showProps">
91119
<a
92120
v-for="prop in this.activeComponentData.props"
93121
:key="prop"
@@ -116,6 +144,7 @@ Description:
116144
import { mapState, mapActions } from 'vuex'
117145
import Multiselect from 'vue-multiselect'
118146
import { ToggleButton } from 'vue-js-toggle-button'
147+
import HTMLQueue from '../dashboard_items/HTMLQueue.vue'
119148
120149
export default {
121150
data () {
@@ -124,10 +153,11 @@ export default {
124153
newName: '',
125154
showState: false,
126155
showActions: false,
127-
showProps: false
156+
showProps: false,
157+
showHTML: false
128158
}
129159
},
130-
components: { Multiselect, ToggleButton },
160+
components: { Multiselect, ToggleButton, HTMLQueue },
131161
computed: {
132162
...mapState([
133163
'routes',
@@ -159,7 +189,8 @@ export default {
159189
'editComponentName',
160190
'deleteActionFromComponent',
161191
'deletePropsFromComponent',
162-
'deleteStateFromComponent'
192+
'deleteStateFromComponent',
193+
'updateComponentLayer'
163194
]),
164195
165196
deleteState (state) {
@@ -192,6 +223,16 @@ export default {
192223
this.deleteActiveComponent(componentData.componentName)
193224
}
194225
},
226+
227+
handleLayer (e) {
228+
e.preventDefault()
229+
const payload = {
230+
z: this.activeComponentObj.z
231+
}
232+
if (e.target.innerText === '+') payload.z++
233+
if (e.target.innerText === '-' && payload.z > 0) payload.z--
234+
this.updateComponentLayer(payload)
235+
},
195236
// Select active component from multi-select input
196237
handleSelect (componentName) {
197238
this.setActiveComponent(componentName)
@@ -245,9 +286,15 @@ export default {
245286
display: flex;
246287
justify-content: space-between;
247288
}
289+
248290
p {
249291
color: white;
250292
}
293+
294+
.toggleText {
295+
color: white;
296+
}
297+
251298
.editName {
252299
color: white;
253300
}
@@ -256,4 +303,8 @@ p {
256303
background-color: #289ead;
257304
color: white;
258305
}
306+
307+
hr {
308+
border: 1px solid grey
309+
}
259310
</style>

0 commit comments

Comments
 (0)