toggle-components-library 1.36.1-beta.8 → 1.36.1-beta.9
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/package.json +1 -1
- package/src/components/forms/ToggleDatePicker.vue +7 -3
- package/src/components/forms/ToggleInputCurrency.vue +10 -3
- package/src/components/forms/ToggleInputPercentage.vue +7 -1
- package/src/components/forms/ToggleInputText.vue +4 -4
- package/src/components/statusbar/ToggleStatusBar.vue +74 -0
- package/src/components/tables/ToggleTable.vue +6 -6
- package/src/index.js +3 -0
- package/src/sass/includes/_as_inputs.scss +5 -0
- package/src/sass/includes/_as_statusbar.scss +179 -0
- package/src/sass/main.scss +1 -0
package/package.json
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
<label class="toggle-input-label">{{label}}</label>
|
|
7
7
|
|
|
8
8
|
<div class="toggle-date-input-container">
|
|
9
|
-
<div class="toggle-date-input-calendar-icon">
|
|
10
|
-
<input type="text" class="toggle-input" :name="name" ref="date-input" :id="'toggle-date-input'+_uid" :value="date" v-on:keypress="$event.preventDefault()"
|
|
9
|
+
<div :class="['toggle-date-input-calendar-icon', {'calendar-icon-disabled' :disabled}]">
|
|
10
|
+
<input type="text" class="toggle-input" :name="name" :disabled="disabled" ref="date-input" :id="'toggle-date-input'+_uid" :value="date" v-on:keypress="$event.preventDefault()" />
|
|
11
11
|
</div>
|
|
12
12
|
<button type="button" class="toggle-clear" v-on:click="clearDate" v-if="displayValue"></button>
|
|
13
13
|
</div>
|
|
@@ -101,7 +101,11 @@ export default {
|
|
|
101
101
|
maxLength:{
|
|
102
102
|
type: Number,
|
|
103
103
|
required:false
|
|
104
|
-
}
|
|
104
|
+
},
|
|
105
|
+
disabled: {
|
|
106
|
+
type: Boolean,
|
|
107
|
+
default: false
|
|
108
|
+
},
|
|
105
109
|
},
|
|
106
110
|
|
|
107
111
|
created : function(){
|
|
@@ -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(){
|
|
@@ -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
|
|
|
@@ -105,10 +105,10 @@ export default {
|
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
107
|
|
|
108
|
-
created : function()
|
|
109
|
-
{
|
|
110
|
-
|
|
111
|
-
},
|
|
108
|
+
// created : function()
|
|
109
|
+
// {
|
|
110
|
+
// this.$nextTick(() => this.$refs['input_ele'].focus());
|
|
111
|
+
// },
|
|
112
112
|
computed: {
|
|
113
113
|
inputVal: {
|
|
114
114
|
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>
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
@input="searchChange()"
|
|
37
37
|
/>
|
|
38
38
|
<ToggleDateRangePicker
|
|
39
|
-
v-if="field.type === '
|
|
40
|
-
name="
|
|
39
|
+
v-if="field.type === 'date_range' && (searchModels[field.key].start || searchModels[field.key].end || editingInput === field.key)"
|
|
40
|
+
name="date_range"
|
|
41
41
|
v-model="searchModels[field.key]"
|
|
42
42
|
@input="searchChange()"
|
|
43
43
|
/>
|
|
@@ -149,7 +149,7 @@ export default {
|
|
|
149
149
|
if(this.fields){
|
|
150
150
|
|
|
151
151
|
for (let i = 0; i < this.fields.length; i++) {
|
|
152
|
-
let value = this.fields[i].type == '
|
|
152
|
+
let value = this.fields[i].type == 'date_range' ? this.setInitialDate(i) : (this.fields[i].value ?? '');
|
|
153
153
|
|
|
154
154
|
let field_name = this.fields[i].key;
|
|
155
155
|
this.$set( this.searchModels, field_name, value )
|
|
@@ -197,7 +197,7 @@ export default {
|
|
|
197
197
|
|
|
198
198
|
tableSearchActive(field)
|
|
199
199
|
{
|
|
200
|
-
if(field.type === '
|
|
200
|
+
if(field.type === 'date_range'){
|
|
201
201
|
return (this.searchModels[field.key].start || this.searchModels[field.key].end || this.editingInput === field.key);
|
|
202
202
|
}
|
|
203
203
|
return (this.searchModels[field.key] || this.editingInput === field.key);
|
|
@@ -217,13 +217,13 @@ export default {
|
|
|
217
217
|
closeSearch(field){
|
|
218
218
|
|
|
219
219
|
this.editingInput = false;
|
|
220
|
-
this.searchModels[field.key] = field.type === '
|
|
220
|
+
this.searchModels[field.key] = field.type === 'date_range' ? { start: false, end: false} : '' ;
|
|
221
221
|
|
|
222
222
|
// check if any search is active; if not, close/shrink header
|
|
223
223
|
let is_active = false;
|
|
224
224
|
for(const key in this.searchModels){
|
|
225
225
|
|
|
226
|
-
if(this.getSearchModelTypeFromKey(key) === '
|
|
226
|
+
if(this.getSearchModelTypeFromKey(key) === 'date_range'){
|
|
227
227
|
if (this.searchModels[key].start || this.searchModels[key].end){
|
|
228
228
|
is_active = true;
|
|
229
229
|
break;
|
package/src/index.js
CHANGED
|
@@ -83,6 +83,8 @@ import ToggleMetricFunnelChart from "./components/metrics/ToggleMetricFunnelChar
|
|
|
83
83
|
import ToggleThreeDots from "./components/threedots/ToggleThreeDots.vue";
|
|
84
84
|
import ToggleThreeDotsButton from "./components/threedots/ToggleThreeDotsButton.vue";
|
|
85
85
|
|
|
86
|
+
import ToggleStatusBar from "./components/statusbar/ToggleStatusBar.vue";
|
|
87
|
+
|
|
86
88
|
import ToggleCarousel from "./components/carousel/ToggleCarousel.vue";
|
|
87
89
|
import ToggleCarouselSlide from "./components/carousel/ToggleCarouselSlide.vue";
|
|
88
90
|
|
|
@@ -158,6 +160,7 @@ const Components = {
|
|
|
158
160
|
ToggleBoosterBasicButton,
|
|
159
161
|
ToggleBoosterModal,
|
|
160
162
|
ToggleContactSearch,
|
|
163
|
+
ToggleStatusBar,
|
|
161
164
|
ToggleCarousel,
|
|
162
165
|
ToggleCarouselSlide,
|
|
163
166
|
ToggleEmailCard,
|
|
@@ -0,0 +1,179 @@
|
|
|
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
|
+
height: 35px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Tooltip
|
|
18
|
+
.toggle-status-bar-tooltip-container{
|
|
19
|
+
position: absolute;
|
|
20
|
+
display: flex;
|
|
21
|
+
justify-content: right;
|
|
22
|
+
width: 100%;
|
|
23
|
+
right: 32px;
|
|
24
|
+
cursor: default;
|
|
25
|
+
|
|
26
|
+
.toggle-status-bar-tooltip {
|
|
27
|
+
position: relative;
|
|
28
|
+
display: inline-block;
|
|
29
|
+
width: 20px;
|
|
30
|
+
text-align: center;
|
|
31
|
+
border: 1px solid hotpink;
|
|
32
|
+
border-radius: 50px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Tooltip text
|
|
36
|
+
.toggle-status-bar-tooltip .toggle-status-bar-tooltip-text {
|
|
37
|
+
visibility: hidden;
|
|
38
|
+
width: 200px;
|
|
39
|
+
background-color: rgba(0, 0, 0, .8);
|
|
40
|
+
color: #fff;
|
|
41
|
+
text-align: center;
|
|
42
|
+
padding: 10px;
|
|
43
|
+
border-radius: 6px;
|
|
44
|
+
position: absolute;
|
|
45
|
+
z-index: 1;
|
|
46
|
+
top: -5px;
|
|
47
|
+
right: 105%;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.toggle-status-bar-tooltip:hover .toggle-status-bar-tooltip-text {
|
|
51
|
+
visibility: visible;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
// Draft colours
|
|
57
|
+
.toggle-status-bar-draft {
|
|
58
|
+
background-color: #FFB88D;
|
|
59
|
+
|
|
60
|
+
.toggle-status-bar-label {
|
|
61
|
+
color: #A34308;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.toggle-status-bar-tooltip {
|
|
65
|
+
color: #A34308;
|
|
66
|
+
border: 1px solid #A34308;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Processing colours
|
|
71
|
+
.toggle-status-bar-processing {
|
|
72
|
+
background-color: #D7E9F2;
|
|
73
|
+
|
|
74
|
+
.toggle-status-bar-label {
|
|
75
|
+
color: #269BE3;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.toggle-status-bar-tooltip {
|
|
79
|
+
color: #269BE3;
|
|
80
|
+
border: 1px solid #269BE3;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Complete colours
|
|
85
|
+
.toggle-status-bar-complete {
|
|
86
|
+
background-color: #B3E49F;
|
|
87
|
+
|
|
88
|
+
.toggle-status-bar-label {
|
|
89
|
+
color: #3BB40B;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.toggle-status-bar-tooltip {
|
|
93
|
+
color: #3BB40B;
|
|
94
|
+
border: 1px solid #3BB40B;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Inactive colours
|
|
99
|
+
.toggle-status-bar-inactive {
|
|
100
|
+
background-color: #D7E9F2;
|
|
101
|
+
|
|
102
|
+
.toggle-status-bar-label {
|
|
103
|
+
color: #269BE3;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.toggle-status-bar-tooltip {
|
|
107
|
+
color: #269BE3;
|
|
108
|
+
border: 1px solid #269BE3;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Active colours
|
|
113
|
+
.toggle-status-bar-active {
|
|
114
|
+
background-color: #D7E9F2;
|
|
115
|
+
border: 1px solid #FF4848;
|
|
116
|
+
|
|
117
|
+
.toggle-status-bar-label {
|
|
118
|
+
color: #FF4848;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.toggle-status-bar-tooltip {
|
|
122
|
+
color: #FF4848;
|
|
123
|
+
border: 1px solid #FF4848;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Submitted colours
|
|
128
|
+
.toggle-status-bar-submitted {
|
|
129
|
+
background-color: #D7E9F2;
|
|
130
|
+
|
|
131
|
+
.toggle-status-bar-label {
|
|
132
|
+
color: #269BE3;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.toggle-status-bar-tooltip {
|
|
136
|
+
color: #269BE3;
|
|
137
|
+
border: 1px solid #269BE3;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Failed colours
|
|
143
|
+
.toggle-status-bar-failed {
|
|
144
|
+
background-color: #F2E3E3;
|
|
145
|
+
border: 1px solid #ED7B7C;
|
|
146
|
+
|
|
147
|
+
.toggle-status-bar-label {
|
|
148
|
+
color: #ED7B7C;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.toggle-status-bar-tooltip {
|
|
152
|
+
color: #ED7B7C;
|
|
153
|
+
border: 1px solid #ED7B7C;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.toggle-status-bar-dot {
|
|
158
|
+
font-size: 20px;
|
|
159
|
+
margin: 0 3px 2px 0;
|
|
160
|
+
float: none !important;
|
|
161
|
+
padding: 0 !important;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// Dot blinking animation
|
|
165
|
+
.blinking {
|
|
166
|
+
animation: 2s blink ease infinite;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
@keyframes blink {
|
|
170
|
+
|
|
171
|
+
from,
|
|
172
|
+
to {
|
|
173
|
+
opacity: 0;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
50% {
|
|
177
|
+
opacity: 1;
|
|
178
|
+
}
|
|
179
|
+
}
|
package/src/sass/main.scss
CHANGED