toggle-components-library 1.25.18 → 1.25.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/img/delete-trash.3a307964.svg +12 -0
- package/dist/toggle-components-library.common.js +197 -9
- package/dist/toggle-components-library.common.js.map +1 -1
- package/dist/toggle-components-library.css +1 -1
- package/dist/toggle-components-library.umd.js +197 -9
- package/dist/toggle-components-library.umd.js.map +1 -1
- package/dist/toggle-components-library.umd.min.js +6 -6
- package/dist/toggle-components-library.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/assets/icons/delete-trash.svg +12 -0
- package/src/components/forms/ToggleInputSelect.vue +7 -1
- package/src/components/threedots/ToggleThreeDots.vue +51 -0
- package/src/components/threedots/ToggleThreeDotsButton.vue +56 -0
- package/src/index.js +9 -1
- package/src/sass/includes/_as_table.scss +5 -0
- package/src/sass/includes/_as_threedots.scss +133 -0
- package/src/sass/main.scss +1 -0
package/package.json
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="92.67" height="75.812" viewBox="0 0 92.67 75.812">
|
|
2
|
+
<g id="Group_218" data-name="Group 218" transform="translate(-804.783 -4099.451)">
|
|
3
|
+
<g id="Group_182" data-name="Group 182" transform="translate(804.783 4110.5)">
|
|
4
|
+
<path id="Union_2" data-name="Union 2" d="M4.528,13.346a4.528,4.528,0,1,1,0-9.056h5.979A4.529,4.529,0,0,1,15.029,0H28.346a4.528,4.528,0,0,1,4.522,4.29h5.979a4.528,4.528,0,1,1,0,9.056Z" transform="translate(0.642 0)" fill="#3e4a5b"/>
|
|
5
|
+
<path id="Subtraction_1" data-name="Subtraction 1" d="M35.318,44.4H9.638c-2.749,0-4.519-2.437-4.845-4.844L0,4.85A4.853,4.853,0,0,1,4.848,0H40.112A4.852,4.852,0,0,1,44.957,4.85L40.166,39.555C39.792,42.406,37.8,44.4,35.318,44.4ZM22.331,26.917l0,0,4.716,4.716a3.335,3.335,0,0,0,4.715-4.719L27.046,22.2l4.719-4.716a3.335,3.335,0,1,0-4.715-4.719l-4.719,4.719-4.72-4.719a3.337,3.337,0,1,0-4.719,4.719L17.611,22.2l-4.719,4.719a3.337,3.337,0,1,0,4.719,4.719l4.716-4.716Z" transform="translate(0 20.364)" fill="#354B64"/>
|
|
6
|
+
</g>
|
|
7
|
+
<g id="Group_216" data-name="Group 216" transform="translate(850.432 4110.5)">
|
|
8
|
+
<path id="Union_2-2" data-name="Union 2" d="M4.528,13.346a4.528,4.528,0,1,1,0-9.056h5.979A4.529,4.529,0,0,1,15.029,0H28.346a4.528,4.528,0,0,1,4.522,4.29h5.979a4.528,4.528,0,1,1,0,9.056Z" transform="translate(5.541 -11.049) rotate(17)" fill="#f58686"/>
|
|
9
|
+
<path id="Subtraction_1-2" data-name="Subtraction 1" d="M35.318,44.4H9.638c-2.749,0-4.519-2.437-4.845-4.844L0,4.85A4.853,4.853,0,0,1,4.848,0H40.112A4.852,4.852,0,0,1,44.957,4.85L40.166,39.555C39.792,42.406,37.8,44.4,35.318,44.4ZM22.331,26.917l0,0,4.716,4.716a3.335,3.335,0,0,0,4.715-4.719L27.046,22.2l4.719-4.716a3.335,3.335,0,1,0-4.715-4.719l-4.719,4.719-4.72-4.719a3.337,3.337,0,1,0-4.719,4.719L17.611,22.2l-4.719,4.719a3.337,3.337,0,1,0,4.719,4.719l4.716-4.716Z" transform="translate(0 20.364)" fill="#f58686"/>
|
|
10
|
+
</g>
|
|
11
|
+
</g>
|
|
12
|
+
</svg>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
|
|
3
|
-
<div class="toggle-input-container" :class="{'toggle-input-is-invalid':isInvalid }" v-on:click="focusClosestInput">
|
|
3
|
+
<div class="toggle-input-container" :class="{'toggle-input-is-invalid':isInvalid, 'toggle-input-is-disabled':disabled}" v-on:click="focusClosestInput">
|
|
4
4
|
<label
|
|
5
5
|
v-if="label"
|
|
6
6
|
:for="name ? name : 'ToggleInputSelect' "
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
v-model="inputVal"
|
|
16
16
|
:autocomplete="autocomplete ? 'on' : 'off' "
|
|
17
17
|
:required="required"
|
|
18
|
+
:disabled="disabled"
|
|
18
19
|
:style="`${fontFamily ? 'font-family: ' + fontFamily : ''}`"
|
|
19
20
|
>
|
|
20
21
|
<option value="">Select an option</option>
|
|
@@ -77,6 +78,11 @@ export default {
|
|
|
77
78
|
fontFamily: {
|
|
78
79
|
type: String,
|
|
79
80
|
required: false
|
|
81
|
+
},
|
|
82
|
+
disabled: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
required: false,
|
|
85
|
+
default: false
|
|
80
86
|
}
|
|
81
87
|
},
|
|
82
88
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="toggle-three-dots-container">
|
|
3
|
+
<button class="toggle-three-dots" :class="{active:active}" @click="toggleActive">
|
|
4
|
+
<div class="toggle-three-dots-circle"></div>
|
|
5
|
+
<div class="toggle-three-dots-circle"></div>
|
|
6
|
+
<div class="toggle-three-dots-circle"></div>
|
|
7
|
+
</button>
|
|
8
|
+
<ul class="toggle-three-dots-list">
|
|
9
|
+
<div class="toggle-three-dots-list-tab"></div>
|
|
10
|
+
<slot></slot>
|
|
11
|
+
</ul>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
export default {
|
|
17
|
+
name: 'ThreeDots',
|
|
18
|
+
data: function() {
|
|
19
|
+
return {
|
|
20
|
+
active: false
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
created : function(){
|
|
24
|
+
window.addEventListener('click', this.windowClick, true);
|
|
25
|
+
this.$toggle_event.$on('threedots_active', this.removeActive);
|
|
26
|
+
},
|
|
27
|
+
beforeDestroy(){
|
|
28
|
+
window.removeEventListener('click', this.windowClick, true);
|
|
29
|
+
this.$toggle_event.$off('threedots_active', this.removeActive);
|
|
30
|
+
},
|
|
31
|
+
methods: {
|
|
32
|
+
removeActive(){
|
|
33
|
+
this.active = false;
|
|
34
|
+
},
|
|
35
|
+
toggleActive() {
|
|
36
|
+
if(this.active){
|
|
37
|
+
this.$toggle_event.$emit('threedots_active', true);
|
|
38
|
+
}
|
|
39
|
+
else{
|
|
40
|
+
this.$toggle_event.$emit('threedots_active', true);
|
|
41
|
+
this.active = true;
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
windowClick(e) {
|
|
45
|
+
if (!e.target.matches('.toggle-three-dots-container, .toggle-three-dots-container *')) {
|
|
46
|
+
this.active = false;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
}
|
|
51
|
+
</script>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<li class="toggle-three-dots-list-item" :class="{'toggle-three-dots-list-item--delete' : buttonDelete}">
|
|
3
|
+
<hr v-if="buttonDelete">
|
|
4
|
+
<button
|
|
5
|
+
:type="type"
|
|
6
|
+
:disabled="disabled"
|
|
7
|
+
@click="click">
|
|
8
|
+
<slot>{{ buttonText }}</slot>
|
|
9
|
+
</button>
|
|
10
|
+
</li>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
export default {
|
|
15
|
+
name: 'ThreeDotsButton',
|
|
16
|
+
props: {
|
|
17
|
+
/**
|
|
18
|
+
* The test to display in side the button
|
|
19
|
+
*/
|
|
20
|
+
buttonText: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: "button"
|
|
23
|
+
},
|
|
24
|
+
/**
|
|
25
|
+
* The HTML button type i.e. `submit` or `button`
|
|
26
|
+
*/
|
|
27
|
+
type: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: "button"
|
|
30
|
+
},
|
|
31
|
+
/**
|
|
32
|
+
* Should the button be disabled?
|
|
33
|
+
*/
|
|
34
|
+
disabled: {
|
|
35
|
+
default: false
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* Is this button a 'Delete' button?
|
|
39
|
+
*/
|
|
40
|
+
buttonDelete:{
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
methods: {
|
|
46
|
+
click(){
|
|
47
|
+
/**
|
|
48
|
+
* Emitted when the button is clicked.
|
|
49
|
+
* @event click
|
|
50
|
+
* @type {Event}
|
|
51
|
+
*/
|
|
52
|
+
this.$emit('click');
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
</script>
|
package/src/index.js
CHANGED
|
@@ -68,6 +68,11 @@ import ToggleMetricBarChart from "./components/metrics/ToggleMetricBarChart.vue"
|
|
|
68
68
|
import ToggleMetricPieChart from "./components/metrics/ToggleMetricPieChart.vue";
|
|
69
69
|
import ToggleMetricFunnelChart from "./components/metrics/ToggleMetricFunnelChart.vue";
|
|
70
70
|
|
|
71
|
+
|
|
72
|
+
import ToggleThreeDots from "./components/threedots/ToggleThreeDots.vue";
|
|
73
|
+
import ToggleThreeDotsButton from "./components/threedots/ToggleThreeDotsButton.vue";
|
|
74
|
+
|
|
75
|
+
|
|
71
76
|
import './sass/main.scss';
|
|
72
77
|
|
|
73
78
|
const Components = {
|
|
@@ -124,7 +129,10 @@ const Components = {
|
|
|
124
129
|
ToggleMetricSparkLine,
|
|
125
130
|
ToggleMetricBarChart,
|
|
126
131
|
ToggleMetricPieChart,
|
|
127
|
-
ToggleMetricFunnelChart
|
|
132
|
+
ToggleMetricFunnelChart,
|
|
133
|
+
ToggleThreeDots,
|
|
134
|
+
ToggleThreeDotsButton
|
|
135
|
+
|
|
128
136
|
}
|
|
129
137
|
|
|
130
138
|
Object.keys(Components).forEach(name => {
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
// Toggle Three Dots
|
|
2
|
+
.toggle-three-dots-container{
|
|
3
|
+
position: relative;
|
|
4
|
+
display: inline-block;
|
|
5
|
+
cursor: default;
|
|
6
|
+
z-index: 9; // To sit behind Modal window
|
|
7
|
+
top: 2px;
|
|
8
|
+
font-size: 0;
|
|
9
|
+
.toggle-three-dots-list{
|
|
10
|
+
position: absolute;
|
|
11
|
+
top: 0;
|
|
12
|
+
right: 100%;
|
|
13
|
+
background-color: #FFF;
|
|
14
|
+
min-width: max-content;
|
|
15
|
+
padding: 13px;
|
|
16
|
+
text-align: left;
|
|
17
|
+
border-radius: 15px 0 15px 15px;
|
|
18
|
+
margin-right: 15px;
|
|
19
|
+
display: none;
|
|
20
|
+
box-shadow: 0px 0px 20px rgba(171, 183, 197, 0.2);
|
|
21
|
+
.toggle-three-dots-list-tab{
|
|
22
|
+
position: absolute;
|
|
23
|
+
top: 0;
|
|
24
|
+
right: -20px;
|
|
25
|
+
height: 60px;
|
|
26
|
+
width: 40px;
|
|
27
|
+
&:before, &:after{
|
|
28
|
+
content: '';
|
|
29
|
+
height: 25px;
|
|
30
|
+
width: 12px;
|
|
31
|
+
position: absolute;
|
|
32
|
+
top: 0;
|
|
33
|
+
right: 12px;
|
|
34
|
+
background-color: #FFF;
|
|
35
|
+
border-radius: 0 15px 15px 0;
|
|
36
|
+
}
|
|
37
|
+
&:after{
|
|
38
|
+
box-shadow: 0px 0px 20px rgba(171, 183, 197, 0.2);
|
|
39
|
+
z-index: -1;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
.toggle-three-dots-list-item{
|
|
43
|
+
min-width: 200px;
|
|
44
|
+
button{
|
|
45
|
+
padding: 8px;
|
|
46
|
+
width: 100%;
|
|
47
|
+
border-radius: 3px;
|
|
48
|
+
background-color: transparent;
|
|
49
|
+
color: #354B64;
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
text-align: left;
|
|
52
|
+
font: normal normal 900 14px/18px Lato;
|
|
53
|
+
display: block;
|
|
54
|
+
box-sizing: border-box;
|
|
55
|
+
border: none;
|
|
56
|
+
&:hover{
|
|
57
|
+
background-color: #F2F5F6;
|
|
58
|
+
}
|
|
59
|
+
&:disabled, &[disabled]{
|
|
60
|
+
background-color: #FFF;
|
|
61
|
+
color: #afb3b7;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
&--delete{
|
|
65
|
+
button{
|
|
66
|
+
color: #354B64;
|
|
67
|
+
padding: 6px 8px 10px 8px;
|
|
68
|
+
&:before{
|
|
69
|
+
content: "";
|
|
70
|
+
height: 18px;
|
|
71
|
+
width: 11px;
|
|
72
|
+
background-image: url("../assets/icons/delete-trash.svg");
|
|
73
|
+
background-position: center left;
|
|
74
|
+
background-size: cover;
|
|
75
|
+
position: relative;
|
|
76
|
+
display: inline-block;
|
|
77
|
+
margin-right: 9px;
|
|
78
|
+
top: 2px;
|
|
79
|
+
}
|
|
80
|
+
&:hover{
|
|
81
|
+
color: #F58686;
|
|
82
|
+
&:before{
|
|
83
|
+
background-position: center right;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
hr{
|
|
89
|
+
border: none;
|
|
90
|
+
background-color: #F2F5F6;
|
|
91
|
+
height: 1px;
|
|
92
|
+
margin: 10px;
|
|
93
|
+
}
|
|
94
|
+
&:nth-of-type(2){
|
|
95
|
+
hr{
|
|
96
|
+
display: none;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
.toggle-three-dots{
|
|
102
|
+
padding: 0.5rem 1rem;
|
|
103
|
+
cursor: pointer;
|
|
104
|
+
display: inline-block;
|
|
105
|
+
border: none;
|
|
106
|
+
background-color: transparent;
|
|
107
|
+
outline: none;
|
|
108
|
+
.toggle-three-dots-circle{
|
|
109
|
+
height: 5px;
|
|
110
|
+
width: 5px;
|
|
111
|
+
background-color: #A8BFD3;
|
|
112
|
+
border-radius: 50%;
|
|
113
|
+
margin-bottom: 3px;
|
|
114
|
+
transition: background-color 0.4s ease;
|
|
115
|
+
&:last-child{
|
|
116
|
+
margin-bottom: 0;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
&:hover{
|
|
120
|
+
.toggle-three-dots-circle{
|
|
121
|
+
background-color: #687B8D;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
&.active +.toggle-three-dots-list{
|
|
125
|
+
display: block;
|
|
126
|
+
.toggle-three-dots{
|
|
127
|
+
.toggle-three-dots-circle{
|
|
128
|
+
background-color: #687B8D;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
} // .toggle-three-dots-container
|
package/src/sass/main.scss
CHANGED