toggle-components-library 1.36.8-beta.1 → 1.36.8-beta.2
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/toggle-components-library.common.js +217 -95
- 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 +217 -95
- package/dist/toggle-components-library.umd.js.map +1 -1
- package/dist/toggle-components-library.umd.min.js +11 -11
- package/dist/toggle-components-library.umd.min.js.map +1 -1
- package/package-lock.json +1 -1
- package/package.json +1 -1
- package/src/components/forms/ToggleInputCurrency.vue +10 -3
- package/src/components/forms/ToggleInputNumber.vue +8 -2
- package/src/components/forms/ToggleInputPercentage.vue +7 -1
- package/src/components/forms/ToggleInputText.vue +5 -7
- package/src/components/statusbar/ToggleStatusBar.vue +74 -0
- package/src/index.js +3 -0
- package/src/sass/includes/_as_inputs.scss +5 -0
- package/src/sass/includes/_as_statusbar.scss +183 -0
- package/src/sass/includes/_as_table.scss +0 -4
- package/src/sass/main.scss +1 -0
package/package-lock.json
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
<div class="toggle-input-container" :class="{'toggle-input-is-invalid':isInvalid }" v-on:click="focusClosestInput">
|
|
6
|
+
<div class="toggle-input-container" :class="{'toggle-input-is-invalid':isInvalid, 'toggle-input-is-disabled':disabled }" v-on:click="focusClosestInput">
|
|
7
|
+
|
|
7
8
|
<label
|
|
8
9
|
v-if="label"
|
|
9
10
|
:for="name ? name : 'InputText' "
|
|
@@ -16,6 +17,7 @@
|
|
|
16
17
|
:placeholder="placeholder ? placeholder : '' "
|
|
17
18
|
:autocomplete="autocomplete ? 'on' : 'off' "
|
|
18
19
|
:required="required"
|
|
20
|
+
:disabled="disabled"
|
|
19
21
|
v-model="inputVal"
|
|
20
22
|
@blur="isInputActive = false"
|
|
21
23
|
@focus="isInputActive = true"
|
|
@@ -91,8 +93,13 @@ export default {
|
|
|
91
93
|
currencyDenomination: {
|
|
92
94
|
type: Number,
|
|
93
95
|
default: 100
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
+
},
|
|
97
|
+
disabled: {
|
|
98
|
+
type: Boolean,
|
|
99
|
+
required: false,
|
|
100
|
+
default: false
|
|
101
|
+
|
|
102
|
+
},
|
|
96
103
|
},
|
|
97
104
|
|
|
98
105
|
created : function(){
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
<div class="toggle-input-container" :class="{'toggle-input-is-invalid':isInvalid }" v-on:click="focusClosestInput">
|
|
6
|
+
<div class="toggle-input-container" :class="{'toggle-input-is-invalid':isInvalid, 'toggle-input-is-disabled':disabled }" v-on:click="focusClosestInput">
|
|
7
7
|
<label
|
|
8
8
|
v-if="label"
|
|
9
9
|
:for="name ? name : 'ToggleInputNumber' "
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
@blur="isInputActive = false"
|
|
21
21
|
@focus="isInputActive = true"
|
|
22
22
|
:pattern="pattern"
|
|
23
|
+
:disabled="disabled"
|
|
23
24
|
/>
|
|
24
25
|
<label
|
|
25
26
|
class="toggle-input-label-error"
|
|
@@ -90,7 +91,12 @@ export default {
|
|
|
90
91
|
pattern: {
|
|
91
92
|
type:String,
|
|
92
93
|
default:"\\d*"
|
|
93
|
-
}
|
|
94
|
+
},
|
|
95
|
+
disabled: {
|
|
96
|
+
type: Boolean,
|
|
97
|
+
required: false,
|
|
98
|
+
default: false
|
|
99
|
+
},
|
|
94
100
|
},
|
|
95
101
|
|
|
96
102
|
created : function(){
|
|
@@ -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
|
|
|
5
5
|
<label
|
|
6
6
|
v-if="label"
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
:placeholder="placeholder ? placeholder : '' "
|
|
15
15
|
:autocomplete="autocomplete ? 'on' : 'off' "
|
|
16
16
|
:required="required"
|
|
17
|
+
:disabled="disabled"
|
|
17
18
|
v-model="inputVal"
|
|
18
19
|
@blur="isInputActive = false"
|
|
19
20
|
@focus="isInputActive = true"
|
|
@@ -77,6 +78,11 @@ export default {
|
|
|
77
78
|
allowFloat: {
|
|
78
79
|
type: Boolean,
|
|
79
80
|
default: false
|
|
81
|
+
},
|
|
82
|
+
disabled: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
required: false,
|
|
85
|
+
default: false
|
|
80
86
|
}
|
|
81
87
|
},
|
|
82
88
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
|
|
3
3
|
<div class="toggle-input-container" :class="{'toggle-input-is-invalid':isInvalid, 'toggle-input-is-disabled':disabled}" v-on:click="focusClosestInput">
|
|
4
|
-
<label
|
|
4
|
+
<label
|
|
5
5
|
v-if="label"
|
|
6
|
-
:for="name ? name : 'InputText' "
|
|
6
|
+
:for="name ? name : 'InputText' "
|
|
7
7
|
class="toggle-input-label"
|
|
8
|
-
> {{ label }}
|
|
8
|
+
> {{ label }}
|
|
9
9
|
</label>
|
|
10
10
|
<span class="toggle-input-counter" v-if="maxLength">{{messageLength(inputVal, maxLength)}}</span>
|
|
11
11
|
<input
|
|
12
12
|
:type="type"
|
|
13
|
-
:name="name ? name : 'ToggleInputText' "
|
|
13
|
+
:name="name ? name : 'ToggleInputText' "
|
|
14
14
|
:class="[ 'toggle-input', size]"
|
|
15
15
|
:placeholder="placeholder ? placeholder : '' "
|
|
16
16
|
:autocomplete="autocomplete ? 'on' : 'off' "
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
:readonly="readonly"
|
|
22
22
|
/>
|
|
23
23
|
<label
|
|
24
|
-
class="toggle-input-label-error"
|
|
24
|
+
class="toggle-input-label-error"
|
|
25
25
|
v-if="isInvalid"
|
|
26
26
|
:for="name ? name : 'ToggleInputText' "
|
|
27
27
|
>
|
|
@@ -103,8 +103,6 @@ export default {
|
|
|
103
103
|
}
|
|
104
104
|
},
|
|
105
105
|
|
|
106
|
-
created : function(){
|
|
107
|
-
},
|
|
108
106
|
computed: {
|
|
109
107
|
inputVal: {
|
|
110
108
|
get: function (){
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="['toggle-status-bar-container', statusColours, statusSize]">
|
|
3
|
+
<span class="toggle-status-bar-dot blinking toggle-status-bar-label" v-if="showDot">●</span>
|
|
4
|
+
<label class="toggle-status-bar-label">
|
|
5
|
+
{{ statusName }}
|
|
6
|
+
</label>
|
|
7
|
+
|
|
8
|
+
<div class="toggle-status-bar-tooltip-container" v-if="showToolTip && toolTipText.length">
|
|
9
|
+
<div class="toggle-status-bar-tooltip">
|
|
10
|
+
?
|
|
11
|
+
<span class="toggle-status-bar-tooltip-text">{{ toolTipText }}</span>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
export default {
|
|
19
|
+
name: 'StatusBar',
|
|
20
|
+
props: {
|
|
21
|
+
status: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: true,
|
|
24
|
+
validator: function (value) {
|
|
25
|
+
return ['draft', 'processing', 'complete', 'inactive', 'active', 'submitted', 'failed'].indexOf(value) !== -1;
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
size: {
|
|
29
|
+
type: String,
|
|
30
|
+
required: false,
|
|
31
|
+
default: 'regular',
|
|
32
|
+
validator: function (value) {
|
|
33
|
+
return ['small', 'regular'].indexOf(value) !== -1;
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
toolTipOptions: {
|
|
37
|
+
type: Object,
|
|
38
|
+
required: false
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
computed: {
|
|
42
|
+
// Capitalise the first letter of the status
|
|
43
|
+
statusName() {
|
|
44
|
+
return this.status.charAt(0).toUpperCase() + this.status.slice(1);
|
|
45
|
+
},
|
|
46
|
+
// Add the status to the class name
|
|
47
|
+
statusColours() {
|
|
48
|
+
return 'toggle-status-bar-' + this.status;
|
|
49
|
+
},
|
|
50
|
+
// Add the size to the class name
|
|
51
|
+
statusSize() {
|
|
52
|
+
return 'toggle-status-bar-' + this.size;
|
|
53
|
+
},
|
|
54
|
+
// Show the dot if the status is active or processing
|
|
55
|
+
showDot() {
|
|
56
|
+
return this.status === 'active' || this.status === 'processing' || this.status === 'submitted';
|
|
57
|
+
},
|
|
58
|
+
showToolTip() {
|
|
59
|
+
return this.size == 'regular';
|
|
60
|
+
},
|
|
61
|
+
toolTipText() {
|
|
62
|
+
if (!this.toolTipOptions) {
|
|
63
|
+
return '';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (this.toolTipOptions[this.status]) {
|
|
67
|
+
return this.toolTipOptions[this.status];
|
|
68
|
+
} else {
|
|
69
|
+
return '';
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
</script>
|
package/src/index.js
CHANGED
|
@@ -82,6 +82,8 @@ import ToggleMetricFunnelChart from "./components/metrics/ToggleMetricFunnelChar
|
|
|
82
82
|
import ToggleThreeDots from "./components/threedots/ToggleThreeDots.vue";
|
|
83
83
|
import ToggleThreeDotsButton from "./components/threedots/ToggleThreeDotsButton.vue";
|
|
84
84
|
|
|
85
|
+
import ToggleStatusBar from "./components/statusbar/ToggleStatusBar.vue";
|
|
86
|
+
|
|
85
87
|
import ToggleCarousel from "./components/carousel/ToggleCarousel.vue";
|
|
86
88
|
import ToggleCarouselSlide from "./components/carousel/ToggleCarouselSlide.vue";
|
|
87
89
|
|
|
@@ -159,6 +161,7 @@ const Components = {
|
|
|
159
161
|
ToggleBoosterBasicButton,
|
|
160
162
|
ToggleBoosterModal,
|
|
161
163
|
ToggleContactSearch,
|
|
164
|
+
ToggleStatusBar,
|
|
162
165
|
ToggleCarousel,
|
|
163
166
|
ToggleCarouselSlide,
|
|
164
167
|
ToggleEmailCard,
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
.toggle-status-bar-container {
|
|
2
|
+
font-family: $toggle-font-family;
|
|
3
|
+
font-size: 16px !important;
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
align-items: center;
|
|
7
|
+
height: 50px;
|
|
8
|
+
width: 100%;
|
|
9
|
+
min-width: 94px;
|
|
10
|
+
border-radius: 7px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.toggle-status-bar-small {
|
|
14
|
+
font-size: 0.7rem !important;
|
|
15
|
+
height: 28px;
|
|
16
|
+
.toggle-status-bar-dot {
|
|
17
|
+
font-size: 14px;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Tooltip
|
|
22
|
+
.toggle-status-bar-tooltip-container{
|
|
23
|
+
position: absolute;
|
|
24
|
+
display: flex;
|
|
25
|
+
justify-content: right;
|
|
26
|
+
width: 100%;
|
|
27
|
+
right: 32px;
|
|
28
|
+
cursor: default;
|
|
29
|
+
|
|
30
|
+
.toggle-status-bar-tooltip {
|
|
31
|
+
position: relative;
|
|
32
|
+
display: inline-block;
|
|
33
|
+
width: 20px;
|
|
34
|
+
text-align: center;
|
|
35
|
+
border: 1px solid hotpink;
|
|
36
|
+
border-radius: 50px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Tooltip text
|
|
40
|
+
.toggle-status-bar-tooltip .toggle-status-bar-tooltip-text {
|
|
41
|
+
visibility: hidden;
|
|
42
|
+
width: 200px;
|
|
43
|
+
background-color: rgba(0, 0, 0, .8);
|
|
44
|
+
color: #fff;
|
|
45
|
+
text-align: center;
|
|
46
|
+
padding: 10px;
|
|
47
|
+
border-radius: 6px;
|
|
48
|
+
position: absolute;
|
|
49
|
+
z-index: 1;
|
|
50
|
+
top: -5px;
|
|
51
|
+
right: 105%;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.toggle-status-bar-tooltip:hover .toggle-status-bar-tooltip-text {
|
|
55
|
+
visibility: visible;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
// Draft colours
|
|
61
|
+
.toggle-status-bar-draft {
|
|
62
|
+
background-color: #FFB88D;
|
|
63
|
+
|
|
64
|
+
.toggle-status-bar-label {
|
|
65
|
+
color: #A34308;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.toggle-status-bar-tooltip {
|
|
69
|
+
color: #A34308;
|
|
70
|
+
border: 1px solid #A34308;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Processing colours
|
|
75
|
+
.toggle-status-bar-processing {
|
|
76
|
+
background-color: #D7E9F2;
|
|
77
|
+
|
|
78
|
+
.toggle-status-bar-label {
|
|
79
|
+
color: #269BE3;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.toggle-status-bar-tooltip {
|
|
83
|
+
color: #269BE3;
|
|
84
|
+
border: 1px solid #269BE3;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Complete colours
|
|
89
|
+
.toggle-status-bar-complete {
|
|
90
|
+
background-color: #B3E49F;
|
|
91
|
+
|
|
92
|
+
.toggle-status-bar-label {
|
|
93
|
+
color: #3BB40B;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.toggle-status-bar-tooltip {
|
|
97
|
+
color: #3BB40B;
|
|
98
|
+
border: 1px solid #3BB40B;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Inactive colours
|
|
103
|
+
.toggle-status-bar-inactive {
|
|
104
|
+
background-color: #D7E9F2;
|
|
105
|
+
|
|
106
|
+
.toggle-status-bar-label {
|
|
107
|
+
color: #269BE3;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.toggle-status-bar-tooltip {
|
|
111
|
+
color: #269BE3;
|
|
112
|
+
border: 1px solid #269BE3;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Active colours
|
|
117
|
+
.toggle-status-bar-active {
|
|
118
|
+
background-color: #D7E9F2;
|
|
119
|
+
border: 1px solid #FF4848;
|
|
120
|
+
|
|
121
|
+
.toggle-status-bar-label {
|
|
122
|
+
color: #FF4848;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.toggle-status-bar-tooltip {
|
|
126
|
+
color: #FF4848;
|
|
127
|
+
border: 1px solid #FF4848;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Submitted colours
|
|
132
|
+
.toggle-status-bar-submitted {
|
|
133
|
+
background-color: #D7E9F2;
|
|
134
|
+
|
|
135
|
+
.toggle-status-bar-label {
|
|
136
|
+
color: #269BE3;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.toggle-status-bar-tooltip {
|
|
140
|
+
color: #269BE3;
|
|
141
|
+
border: 1px solid #269BE3;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// Failed colours
|
|
147
|
+
.toggle-status-bar-failed {
|
|
148
|
+
background-color: #F2E3E3;
|
|
149
|
+
border: 1px solid #ED7B7C;
|
|
150
|
+
|
|
151
|
+
.toggle-status-bar-label {
|
|
152
|
+
color: #ED7B7C;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.toggle-status-bar-tooltip {
|
|
156
|
+
color: #ED7B7C;
|
|
157
|
+
border: 1px solid #ED7B7C;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.toggle-status-bar-dot {
|
|
162
|
+
font-size: 20px;
|
|
163
|
+
margin: 0 3px 2px 0;
|
|
164
|
+
float: none !important;
|
|
165
|
+
padding: 0 !important;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// Dot blinking animation
|
|
169
|
+
.blinking {
|
|
170
|
+
animation: 2s blink ease infinite;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
@keyframes blink {
|
|
174
|
+
|
|
175
|
+
from,
|
|
176
|
+
to {
|
|
177
|
+
opacity: 0;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
50% {
|
|
181
|
+
opacity: 1;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
@@ -65,7 +65,6 @@ table.toggle-table {
|
|
|
65
65
|
|
|
66
66
|
select {
|
|
67
67
|
border: none;
|
|
68
|
-
background-color: #FFF;
|
|
69
68
|
font-size: 11.5px;
|
|
70
69
|
font-weight: bold;
|
|
71
70
|
color: #575757;
|
|
@@ -74,9 +73,6 @@ table.toggle-table {
|
|
|
74
73
|
-moz-appearance: none;
|
|
75
74
|
text-indent: 1px;
|
|
76
75
|
text-overflow: '';
|
|
77
|
-
|
|
78
|
-
background: url(/img/icons/arrow-down-blue-tiny.svg) center right no-repeat;
|
|
79
|
-
background-size: 15px;
|
|
80
76
|
padding : 0.5rem 0rem 0.5rem 1rem;
|
|
81
77
|
}
|
|
82
78
|
}
|
package/src/sass/main.scss
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
@import "./includes/_as_metrics.scss";
|
|
22
22
|
@import "./includes/_as_threedots.scss";
|
|
23
23
|
@import "./includes/_as_boosters.scss";
|
|
24
|
+
@import "./includes/_as_statusbar.scss";
|
|
24
25
|
@import "./includes/_as_cards.scss";
|
|
25
26
|
@import "./includes/_as_carousels.scss";
|
|
26
27
|
@import "./includes/_as_tooltips.scss";
|