12
12
v-on:click =" handleClick"
13
13
v-on:click.right =" handleRight"
14
14
>
15
+ <!-- color selector-->
16
+ <ColorPicker
17
+ class =" colorPicker"
18
+ default-format =" hex"
19
+ id =" color-picker-1"
20
+ :visible-formats =" ['hex']"
21
+ :color =" {
22
+ h: 1,
23
+ s: 1,
24
+ l: 0.5,
25
+ a: 1
26
+ }"
27
+ @color-change =" updateColor"
28
+ >
29
+ <template #hue-range-input-label >
30
+ <span class =" sr-only" >Hue</span >
31
+ </template >
32
+
33
+ <template #alpha-range-input-label >
34
+ <span class =" sr-only" >Alpha</span >
35
+ </template >
36
+
37
+ <template #copy-button >
38
+ <span class =" sr-only" >Copy color</span >
39
+
40
+ <svg
41
+ aria-hidden =" true"
42
+ xmlns =" http://www.w3.org/2000/svg"
43
+ width =" 15"
44
+ height =" 15"
45
+ viewBox =" 0 0 15 15"
46
+ >
47
+ <path
48
+ d =" M5 0v2H1v13h12v-3h-1v2H2V5h10v3h1V2H9V0zm1 1h2v2h3v1H3V3h3z"
49
+ fill =" currentColor"
50
+ />
51
+
52
+ <path
53
+ d =" M10 7v2h5v2h-5v2l-3-3zM3 6h5v1H3zm0 2h3v1H3zm0 2h3v1H3zm0 2h5v1H3z"
54
+ fill =" currentColor"
55
+ />
56
+ </svg >
57
+ </template >
58
+
59
+ <template #format-switch-button >
60
+ <span class =" sr-only" >Switch format</span >
61
+
62
+ <svg
63
+ aria-hidden =" true"
64
+ xmlns =" http://www.w3.org/2000/svg"
65
+ width =" 16"
66
+ height =" 15"
67
+ viewBox =" 0 0 16 15"
68
+ >
69
+ <path
70
+ d =" M8 15l5-5-1-1-4 2-4-2-1 1zm4-9l1-1-5-5-5 5 1 1 4-2z"
71
+ fill =" currentColor"
72
+ />
73
+ </svg >
74
+ </template >
75
+ </ColorPicker >
76
+
77
+
15
78
<!-- This is the actual component box -->
16
79
<!-- https://www.npmjs.com/package/vue-draggable-resizable -->
17
80
<vue-draggable-resizable
33
96
:onDragStart =" recordInitialPosition"
34
97
:onResizeStart =" recordInitialSize"
35
98
>
99
+
36
100
<div class =" component-title" >
37
101
<p >{{ componentData.componentName }}</p >
38
102
</div >
48
112
name =" edit_note"
49
113
class =" compNoteLogoEmpty"
50
114
@click =" handleAddNotes" />
115
+
116
+ <!-- start of right click function-->
51
117
<q-menu context-menu >
52
118
<q-list color =" black" class =" menu" >
53
119
<q-item clickable v-ripple v-close-popup id =" layer-item" >
86
152
<q-icon color =" primary" name =" upload" />
87
153
</q-item-section >
88
154
</q-item >
155
+ <q-item clickable v-ripple v-close-popup @click =" handleAddChild" >
156
+ <q-item-section >Edit Color</q-item-section >
157
+ <q-item-section avatar >
158
+ <q-icon color =" primary" name =" edit" />
159
+ </q-item-section >
160
+ </q-item >
89
161
</q-list >
90
162
</q-menu >
91
163
92
164
</vue-draggable-resizable >
93
- <div >
165
+ <div >
94
166
<q-dialog v-model =" modalOpen" >
95
167
<div class =" addChild" >
96
168
<p >Add/Remove Children</p >
@@ -163,6 +235,7 @@ import { mapState, mapActions } from "vuex";
163
235
import VueDraggableResizable from " vue-draggable-resizable/src/components/vue-draggable-resizable.vue" ;
164
236
import VueMultiselect from " vue-multiselect" ;
165
237
import " vue-draggable-resizable/src/components/vue-draggable-resizable.css" ;
238
+ import { ColorPicker } from ' vue-accessible-color-picker'
166
239
167
240
const { fs , ipcRenderer } = window ;
168
241
@@ -173,6 +246,7 @@ export default {
173
246
components: {
174
247
VueDraggableResizable,
175
248
VueMultiselect,
249
+ ColorPicker,
176
250
},
177
251
data () {
178
252
return {
@@ -340,6 +414,11 @@ export default {
340
414
this .initialPosition .x = this .activeComponentData .x ;
341
415
this .initialPosition .y = this .activeComponentData .y ;
342
416
},
417
+ // color change function
418
+ updateColor (data ) {
419
+ console .log (data)
420
+ },
421
+
343
422
// records component's initial size/position in case of resize
344
423
recordInitialSize: function (e ) {
345
424
this .initialSize .h = this .activeComponentData .h ;
@@ -484,6 +563,7 @@ export default {
484
563
},
485
564
},
486
565
};
566
+
487
567
< / script>
488
568
489
569
< style scoped lang= " scss" >
@@ -718,4 +798,22 @@ li:hover{
718
798
margin- bottom: 10px ;
719
799
}
720
800
801
+ .sr - only {
802
+ position: absolute;
803
+ overflow: hidden;
804
+ clip: rect (0 0 0 0 );
805
+ width: 1px ;
806
+ height: 1px ;
807
+ margin: - 1px ;
808
+ padding: 0 ;
809
+ border: 0 ;
810
+ white- space: nowrap;
811
+ }
812
+
813
+
814
+ .colorPicker {
815
+ color: black;
816
+ background: rgba (177 , 171 , 171 , 0.562 );
817
+ }
818
+
721
819
< / style>
0 commit comments