Skip to content

Commit 5a0134b

Browse files
authored
Merge branch 'master' into master
2 parents c9d515e + 865020a commit 5a0134b

4 files changed

Lines changed: 59 additions & 113 deletions

File tree

Template/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<iv-increment-button :initialValue="2" :increment="1" :minimum="min" :maximum="max"> </iv-increment-button>
1010
<iv-toggle-advance id="toggle2" :initialModeIndex=0 @toggleswitched="sChange" position="centre"></iv-toggle-advance>
1111
<iv-toggle-advance id="toggle3" :togglesDisabled=disableList :initialModeIndex=1 position="centre"></iv-toggle-advance>
12-
12+
<iv-tickbox></iv-tickbox>
1313

1414
</iv-DraggableDiv>
1515
<iv-visualisation :title="projectName">

src/components/Button/SymbolButton.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="iv-circle-button iv-drop-shadow-medium" :class="['iv-' + size]">
2+
<div class="iv-circle-button iv-drop-shadow-medium" @click="buttonClick" :class="['iv-' + size]">
33
<img :src="symbolIcon" :alt="symbol"/>
44
</div>
55
</template>
@@ -19,6 +19,11 @@ export default {
1919
default:""
2020
}
2121
},
22+
methods:{
23+
buttonClick(){
24+
this.$emit("click", true);
25+
},
26+
},
2227
computed:{
2328
symbolIcon(){
2429
return Symbols[this.symbol]

src/components/IncrementButton/IncrementButton.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ export default {
106106
eventBus.$on("reset-data", data => {
107107
console.log(data);
108108
this.current = this.initialValue;
109-
this.minusDisabled=false;
110-
this.plusDisabled=false;
109+
this.disable();
111110
this.$emit("change", this.current);
112111
});
113112
},

src/components/Tickbox/Tickbox.vue

Lines changed: 51 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,120 +1,62 @@
11
<template>
2-
<div>
3-
<label class="checkbox-container">
4-
<input type="checkbox" @click="changeStatus" :disabled="disable">
5-
<span class="checkmark"></span>
6-
</label>
7-
</div>
2+
<div class="checkboxContainer" @click="changeStatus">
3+
<div v-if="checkboxValue" class="checkboxBlueContent">
4+
<div class="checkmark">
5+
</div>
6+
</div>
7+
</div>
88
</template>
9+
910
<script>
11+
import {eventBus} from "@/buses/eventBus"
1012
export default {
11-
name:"iv-tickbox",
12-
props:{
13-
initialState: {
14-
type: Boolean,
15-
default: true
16-
},
17-
disable: {
18-
type: Boolean,
19-
default: false
20-
}
21-
},
22-
data() {
23-
return {
24-
checkboxStatus: this.initialState,
25-
isDisabled: this.disable
26-
}
27-
},
28-
methods:{
29-
changeStatus(){
30-
this.checkboxStatus = !this.checkboxStatus;
31-
if(!this.checkboxStatus == true){
32-
this.$emit("checked", this.checkboxStatus)
33-
}else{
34-
this.$emit("unchecked", this.checkboxStatus)
35-
}
36-
}
37-
},
13+
name: "iv-tickbox",
14+
props: {
15+
value: {
16+
type: Boolean,
17+
required: true,
18+
default: false
19+
}
20+
},
21+
data(){
22+
return{
23+
checkboxValue: this.value
24+
}
25+
},
26+
methods: {
27+
changeStatus() {
28+
this.checkboxValue = !this.checkboxValue
29+
this.$emit("check", this.checkboxValue);
30+
}
31+
},
32+
mounted(){
33+
eventBus.$on("reset-data", data => {
34+
console.log(data);
35+
this.checkboxValue = this.value;
36+
this.$emit("check", this.checkboxValue);
37+
});
38+
}
3839
}
3940
</script>
40-
<style>
41-
.checkbox-container {
42-
display: block;
43-
position: relative;
44-
padding-left: 35px;
45-
margin-bottom: 12px;
46-
cursor: pointer;
47-
font-size: 22px;
48-
-webkit-user-select: none;
49-
-moz-user-select: none;
50-
-ms-user-select: none;
51-
user-select: none;
52-
}
53-
54-
.checkbox-container input {
55-
position: absolute;
56-
opacity: 0;
41+
<style lang="scss">
42+
.checkboxContainer{
5743
cursor: pointer;
58-
height: 0;
59-
width: 0;
60-
}
61-
62-
.checkmark {
63-
position: absolute;
64-
top: 0;
65-
left: 0;
66-
height: 25px;
67-
width: 25px;
68-
background-color: #eee;
69-
outline: 1px solid #000305;
70-
}
71-
72-
73-
.checkbox-container:hover input ~ .checkmark {
74-
background-color: #ccc;
75-
outline: 1px solid #000305;
76-
}
77-
78-
.checkbox-container input:checked ~ .checkmark {
79-
background-color: #2196F3;
80-
outline: 1px solid #000305;
81-
}
82-
83-
84-
.checkmark:after {
85-
content: "";
86-
position: absolute;
87-
display: none;
88-
}
89-
90-
.checkbox-container input:checked ~ .checkmark:after {
91-
display: block;
92-
}
93-
94-
.checkbox-container .checkmark:after {
95-
left: 9px;
96-
top: 5px;
97-
width: 5px;
98-
height: 10px;
44+
background-color: lightgrey;
45+
width: 20px;
46+
height: 20px;
47+
border: 1px solid black;
48+
}
49+
.checkboxBlueContent{
50+
background-color: blue;
51+
width: 21px;
52+
height: 21px;
53+
}
54+
.checkmark{
55+
height: 12px;
56+
width: 8px;
9957
border: solid white;
10058
border-width: 0 3px 3px 0;
101-
-webkit-transform: rotate(45deg);
102-
-ms-transform: rotate(45deg);
103-
transform: rotate(45deg);
104-
}
105-
.checkbox-container input:disabled ~ .checkmark{
106-
background-color: rgb(211, 209, 209);
107-
outline: 1px solid #b4b4b4;
108-
}
109-
.checkbox-container input:disabled ~ .checkmark:after {
110-
left: 9px;
111-
top: 5px;
112-
width: 5px;
113-
height: 10px;
114-
border: solid #7e7e7e;
115-
border-width: 0 3px 3px 0;
116-
-webkit-transform: rotate(45deg);
117-
-ms-transform: rotate(45deg);
118-
transform: rotate(45deg);
59+
transform: rotate(45deg) translate(3px,-4px);
11960
}
12061
</style>
62+

0 commit comments

Comments
 (0)