Skip to content

Commit 1eb480d

Browse files
committed
merge conflicts
1 parent f223c30 commit 1eb480d

File tree

2 files changed

+36
-35
lines changed

2 files changed

+36
-35
lines changed

src/components/composables/useCreateComponent.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ export function useCreateComponent(importObj) {
4646
color: "#ffffff85",
4747
htmlAttributes: {
4848
class: "",
49-
id: "",
50-
binding: "",
49+
id: ""
5150
}
5251
};
5352

@@ -60,7 +59,6 @@ export function useCreateComponent(importObj) {
6059
} else {
6160
component.componentName = this.componentNameInputValue.replace(/[^a-z0-9-_.]/gi, "");
6261
}
63-
6462
if (!this.componentMap[component.componentName]) {
6563
this.registerComponent(component);
6664
this.setActiveComponent(component.componentName);

src/components/right-sidebar/HTMLQueue.vue

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -33,27 +33,6 @@ Description:
3333
</div>
3434
</div>
3535

36-
<!--START OF CHANGES-->
37-
<!-- &nbsp; &nbsp; Viewing Elements in {{ this.activeComponent }} '{{ depth }}'
38-
<hr>
39-
</span>
40-
<span class='list-title' v-else-if='!this.activeComponent'></span>
41-
<div group="people" class="list-group">
42-
<p v-if='!this.componentMap[this.activeComponent]?.htmlList.length'>No HTML elements in component</p>
43-
44-
<div id="tooltipCon" :class="activeHTML === element[2] ? 'list-group-item-selected' : 'list-group-item'"
45-
v-for="(element) in renderList" :key="element[1] + Date.now()">
46-
47-
<button class="attributeButton" @click="setActiveElement(element)">
48-
<div class="tooltip"> Edit {{ element[0] }} attributes </div>
49-
</button>
50-
<i v-if='activeComponent === "" || exceptions.includes(element[0])'></i>
51-
<i v-else class="fas fa fa-angle-double-down fa-md" @click="setLayer({ text: element[0], id: element[2] })"></i>
52-
{{ element[0] }}
53-
<i class="fas fa fa-trash fa-md" @click.self="deleteElement([element[1], element[2]])"></i>
54-
</div>
55-
</div> -->
56-
5736
<!-- attribute pop-up -->
5837
<q-dialog v-model="attributeModal">
5938
<!-- @update:model-value="setActiveElement" -->
@@ -63,7 +42,12 @@ Description:
6342
<div class="AttributeContainer" v-for="element in this.componentMap[this.activeComponent].htmlList"
6443
:key="element.id + Date.now()">
6544
<p v-if="element.id === this.activeHTML">Your class is - {{ element.class }}</p>
45+
<p v-if="element.id === this.activeHTML"> You've binded to - {{ element.binding }}</p>
6646
</div>
47+
<!-- <div class="AttributeContainer" v-for="element in this.componentMap[this.activeComponent].htmlList"
48+
:key="element.id + Date.now()">
49+
50+
</div> -->
6751

6852
<div class="formBox">
6953
<q-form autofocus v-on:submit.prevent="submitClass">
@@ -72,8 +56,17 @@ Description:
7256
@keyup.enter="submitClass"></q-input>
7357
<q-btn id="comp-btn" class="sidebar-btn" color="secondary" label="Submit Attribute"
7458
:disable="classText.length > 0 ? false : true" @click="submitClass(classText, this.activeHTML)" />
75-
<q-btn label="Close" @click="this.openAttributeModal" />
7659
</q-form>
60+
<q-form autofocus v-on:submit.prevent="addBinding">
61+
<p class="title">Add Binding:</p>
62+
63+
<q-input label="Add two way binding here" filled dark autofocus true hide-bottom-space v-model="bindingText"
64+
@keyup.enter="addBinding"></q-input>
65+
<q-btn id="comp-btn" class="sidebar-btn" color="secondary" label="Add Binding"
66+
:disable="bindingText.length > 0 ? false : true" @click="addBinding(bindingText, this.activeHTML)">
67+
</q-btn>
68+
</q-form>
69+
<q-btn label="Close" @click="this.openAttributeModal" />
7770
</div>
7871
</div>
7972
</q-dialog>
@@ -102,6 +95,7 @@ export default {
10295
exceptions: ['input', 'img', 'link'],
10396
attributeModal: false,
10497
classText: '',
98+
bindingText: '',
10599
}
106100
},
107101
computed: {
@@ -136,13 +130,19 @@ export default {
136130
137131
},
138132
methods: {
139-
...mapActions(['setActiveHTML', 'setActiveLayer', 'upOneLayer', 'setSelectedIdDrag', 'setIdDrag', 'setSelectedIdDrop', 'setIdDrop', 'dragDropSortHtmlElements', 'dragDropSortSelectedHtmlElements', 'openAttributeModal', 'addActiveComponentClass']),
133+
...mapActions(['setActiveHTML', 'setActiveLayer', 'upOneLayer', 'setSelectedIdDrag', 'setIdDrag', 'setSelectedIdDrop', 'setIdDrop', 'dragDropSortHtmlElements', 'dragDropSortSelectedHtmlElements', 'openAttributeModal', 'addActiveComponentClass', 'addBindingText']),
140134
deleteElement(id) {
141135
if (this.activeComponent === '') this.$store.dispatch(deleteSelectedElement, id[0])
142136
this.setActiveHTML(element);
143137
this.openAttributeModal(element);
144138
145139
},
140+
setActiveElement(element) {
141+
if (this.activeComponent !== '') {
142+
this.setActiveHTML(element);
143+
this.openAttributeModal(element);
144+
}
145+
},
146146
setLayer(element) {
147147
this.setActiveLayer(element)
148148
element.id = this.activeHTML
@@ -182,22 +182,25 @@ export default {
182182
if (element === '') {
183183
return;
184184
}
185+
185186
let payload = {
186187
class: element,
187188
id: idNum
188189
}
189190
this.addActiveComponentClass(payload);
190191
this.classText = '';
191192
},
192-
// addBinding(element, idNum) {
193-
// if (element === '') {
194-
// return;
195-
// }
196-
// let payload = {
197-
// binding: element,
198-
// id: idNum
199-
// }
200-
// },
193+
addBinding(input, idNum) {
194+
if (input === '') {
195+
return;
196+
}
197+
const payload = {
198+
binding: input,
199+
id: idNum
200+
}
201+
this.addBindingText(payload);
202+
this.bindingText = '';
203+
},
201204
},
202205
watch: {
203206
attributeModalOpen() {

0 commit comments

Comments
 (0)