toggle-components-library 1.25.9 → 1.25.11
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/{airship-circle-user-icon-hover.7eecff69.svg → airship-user-icon-hover.7eecff69.svg} +0 -0
- package/dist/img/{airship-circle-user-icon.b39571b4.svg → airship-user-icon.b39571b4.svg} +0 -0
- package/dist/toggle-components-library.common.js +151 -354
- 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 +151 -354
- 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 +3 -3
- package/src/.DS_Store +0 -0
- package/src/assets/icons/airship-user-icon-hover.svg +2 -2
- package/src/assets/icons/airship-user-icon.svg +2 -2
- package/src/components/forms/ToggleInputImage.vue +6 -10
- package/src/components/forms/ToggleInputText.vue +6 -6
- package/src/components/metrics/ToggleMetricBarChart.vue +6 -7
- package/src/components/metrics/ToggleMetricFunnelChart.vue +3 -12
- package/src/components/metrics/ToggleMetricPieChart.vue +8 -15
- package/src/components/metrics/ToggleMetricSingleMetric.vue +4 -2
- package/src/components/metrics/ToggleMetricSparkLine.vue +7 -9
- package/src/components/mixins/mixins.js +23 -58
- package/src/components/navs/multitiersidenav/ToggleMultiTierSideNav.vue +3 -39
- package/src/components/text/ToggleTextClipboardCopy.vue +1 -10
- package/src/index.js +0 -2
- package/src/sass/includes/_as_buttons.scss +0 -55
- package/src/sass/includes/_as_inputs.scss +9 -9
- package/src/sass/includes/_as_metrics.scss +17 -28
- package/src/sass/includes/_as_navs.scss +6 -111
- package/src/sass/includes/_as_text.scss +1 -1
- package/dist/img/airship-audiences-hover.7197407c.svg +0 -9
- package/dist/img/airship-audiences.e7477e19.svg +0 -9
- package/dist/img/airship-user-icon.1c0e190a.svg +0 -3
- package/dist/img/airship-x-hover.e1c3bb98.svg +0 -3
- package/dist/img/airship-x.dec93e61.svg +0 -3
- package/src/assets/icons/airship-audiences-hover.svg +0 -9
- package/src/assets/icons/airship-audiences.svg +0 -9
- package/src/assets/icons/airship-circle-user-icon-hover.svg +0 -3
- package/src/assets/icons/airship-circle-user-icon.svg +0 -3
- package/src/assets/icons/airship-x-hover.svg +0 -3
- package/src/assets/icons/airship-x.svg +0 -3
- package/src/components/buttons/ToggleLoginButton.vue +0 -67
- package/src/components/json/char_list.json +0 -2233
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "toggle-components-library",
|
|
3
|
-
"version": "1.25.
|
|
3
|
+
"version": "1.25.11",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"serve": "vue-cli-service serve",
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
"public/*",
|
|
23
23
|
"*.json",
|
|
24
24
|
"*.js"
|
|
25
|
-
],
|
|
25
|
+
],
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"apexcharts": "^3.35.5",
|
|
28
|
-
"core-js": "^3.
|
|
28
|
+
"core-js": "^3.6.4",
|
|
29
29
|
"countries-list": "^2.6.1",
|
|
30
30
|
"date-fns": "^1.30.1",
|
|
31
31
|
"storybook-vue-router": "^1.0.7",
|
package/src/.DS_Store
CHANGED
|
Binary file
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="
|
|
2
|
-
<path id="
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="94" height="94.001" viewBox="0 0 94 94.001">
|
|
2
|
+
<path id="Exclusion_3" data-name="Exclusion 3" d="M-11986-16029a46.689,46.689,0,0,1-18.294-3.693,46.864,46.864,0,0,1-14.941-10.071,46.871,46.871,0,0,1-10.073-14.94A46.7,46.7,0,0,1-12033-16076a46.7,46.7,0,0,1,3.693-18.294,46.869,46.869,0,0,1,10.073-14.941,46.869,46.869,0,0,1,14.941-10.073A46.7,46.7,0,0,1-11986-16123a46.7,46.7,0,0,1,18.294,3.693,46.872,46.872,0,0,1,14.939,10.073,46.864,46.864,0,0,1,10.071,14.941A46.689,46.689,0,0,1-11939-16076a46.689,46.689,0,0,1-3.693,18.294,46.871,46.871,0,0,1-10.071,14.94,46.856,46.856,0,0,1-14.939,10.071A46.689,46.689,0,0,1-11986-16029Zm-4.034-45.308a12.917,12.917,0,0,0-9.831,4.836,16.519,16.519,0,0,0-3.95,10.54,2.967,2.967,0,0,0,.64,1.918,2.452,2.452,0,0,0,1.905.842h.089c.04,0,.081,0,.121,0l30.117-1.59h.007a2.756,2.756,0,0,0,2.749-2.756,13.7,13.7,0,0,0-4.037-9.747,13.69,13.69,0,0,0-9.745-4.039Zm4.03-25.366a10.193,10.193,0,0,0-10.181,10.181,10.191,10.191,0,0,0,10.181,10.177,10.111,10.111,0,0,0,7.2-2.981,10.1,10.1,0,0,0,2.981-7.2,10.111,10.111,0,0,0-2.981-7.2A10.111,10.111,0,0,0-11986-16099.674Z" transform="translate(12033.001 16123.001)" fill="#477ef6"/>
|
|
3
3
|
</svg>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="
|
|
2
|
-
<path id="
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="94" height="94.001" viewBox="0 0 94 94.001">
|
|
2
|
+
<path id="Exclusion_1" data-name="Exclusion 1" d="M-11986-16029a46.689,46.689,0,0,1-18.294-3.693,46.864,46.864,0,0,1-14.941-10.071,46.871,46.871,0,0,1-10.073-14.94A46.7,46.7,0,0,1-12033-16076a46.7,46.7,0,0,1,3.693-18.294,46.869,46.869,0,0,1,10.073-14.941,46.869,46.869,0,0,1,14.941-10.073A46.7,46.7,0,0,1-11986-16123a46.7,46.7,0,0,1,18.294,3.693,46.872,46.872,0,0,1,14.939,10.073,46.864,46.864,0,0,1,10.071,14.941A46.689,46.689,0,0,1-11939-16076a46.689,46.689,0,0,1-3.693,18.294,46.871,46.871,0,0,1-10.071,14.94,46.856,46.856,0,0,1-14.939,10.071A46.689,46.689,0,0,1-11986-16029Zm-4.034-45.308a12.917,12.917,0,0,0-9.831,4.836,16.519,16.519,0,0,0-3.95,10.54,2.967,2.967,0,0,0,.64,1.918,2.452,2.452,0,0,0,1.905.842h.089c.04,0,.081,0,.121,0l30.117-1.59h.007a2.756,2.756,0,0,0,2.749-2.756,13.7,13.7,0,0,0-4.037-9.747,13.69,13.69,0,0,0-9.745-4.039Zm4.03-25.366a10.193,10.193,0,0,0-10.181,10.181,10.191,10.191,0,0,0,10.181,10.177,10.111,10.111,0,0,0,7.2-2.981,10.1,10.1,0,0,0,2.981-7.2,10.111,10.111,0,0,0-2.981-7.2A10.111,10.111,0,0,0-11986-16099.674Z" transform="translate(12033.001 16123.001)" fill="#354b64"/>
|
|
3
3
|
</svg>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
tag="ul"
|
|
16
16
|
v-model="inputVal"
|
|
17
17
|
v-bind="dragOptions"
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
>
|
|
20
20
|
<transition-group type="transition" >
|
|
21
21
|
<li
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
:style="{marginRight:thumbnailWidth / 8 + 'px'}"
|
|
26
26
|
|
|
27
27
|
>
|
|
28
|
-
<div class="toggle-item-img toggle-dark-grey toggle-center"
|
|
28
|
+
<div class="toggle-item-img toggle-dark-grey toggle-center"
|
|
29
29
|
:style="{ background: `rgb(243, 237, 237) url(${image.url}) no-repeat center top`,
|
|
30
30
|
height: previewRatio == 'letterbox' ? thumbnailWidth / 2 + 'px': thumbnailWidth+'px',
|
|
31
31
|
width: thumbnailWidth+'px'}"
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
:id="'dropzone'+_uid"
|
|
50
50
|
:options="dropzoneOptions"
|
|
51
51
|
@vdropzone-file-added="fileAdded"
|
|
52
|
-
|
|
52
|
+
|
|
53
53
|
/>
|
|
54
54
|
</div>
|
|
55
55
|
</div>
|
|
@@ -142,11 +142,6 @@ export default {
|
|
|
142
142
|
animation: 200,
|
|
143
143
|
group: "images",
|
|
144
144
|
};
|
|
145
|
-
},
|
|
146
|
-
moveIconClass() {
|
|
147
|
-
return {
|
|
148
|
-
'toggle-move-icon' : this.images.length > 1
|
|
149
|
-
}
|
|
150
145
|
},
|
|
151
146
|
inputVal: {
|
|
152
147
|
get: function (){
|
|
@@ -160,8 +155,8 @@ export default {
|
|
|
160
155
|
},
|
|
161
156
|
methods: {
|
|
162
157
|
|
|
163
|
-
|
|
164
|
-
|
|
158
|
+
|
|
159
|
+
|
|
165
160
|
}
|
|
166
161
|
}
|
|
167
162
|
|
|
@@ -169,4 +164,5 @@ export default {
|
|
|
169
164
|
</script>
|
|
170
165
|
<style lang="scss">
|
|
171
166
|
|
|
167
|
+
|
|
172
168
|
</style>
|
|
@@ -122,22 +122,22 @@ export default {
|
|
|
122
122
|
* Concat message for count characters
|
|
123
123
|
* @return string
|
|
124
124
|
*/
|
|
125
|
-
messageLength(
|
|
125
|
+
messageLength(count, maxLenght)
|
|
126
126
|
{
|
|
127
|
-
let message =
|
|
127
|
+
let message = count;
|
|
128
128
|
let mcount = 0;
|
|
129
129
|
|
|
130
130
|
// If the emoji flag is set, make sure the character count takes account of the decoded emoji characters (this will include £ signs)
|
|
131
|
-
if (this.includeEmojiEntitiesInCharCount &&
|
|
131
|
+
if (this.includeEmojiEntitiesInCharCount && count) {
|
|
132
132
|
|
|
133
|
-
message = this.convertEmojis(
|
|
134
|
-
mcount = message ? message.length : 0;
|
|
133
|
+
let message = this.convertEmojis(count)
|
|
134
|
+
mcount = message ? this.convertEmojis(message).length : 0;
|
|
135
135
|
|
|
136
136
|
} else {
|
|
137
137
|
mcount = message ? message.length : 0;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
return mcount+' / '+
|
|
140
|
+
return mcount+' / '+maxLenght;
|
|
141
141
|
},
|
|
142
142
|
|
|
143
143
|
onFocus() {
|
|
@@ -69,9 +69,8 @@ export default {
|
|
|
69
69
|
plotOptions: {
|
|
70
70
|
bar: {
|
|
71
71
|
borderRadius: 5,
|
|
72
|
-
columnWidth: '
|
|
73
|
-
|
|
74
|
-
},
|
|
72
|
+
columnWidth: '60%',
|
|
73
|
+
}
|
|
75
74
|
|
|
76
75
|
},
|
|
77
76
|
chart: {
|
|
@@ -113,17 +112,17 @@ export default {
|
|
|
113
112
|
|
|
114
113
|
colors: this.colors ? this.colors : this.getDefaultColors(),
|
|
115
114
|
legend: {
|
|
116
|
-
horizontalAlign: '
|
|
115
|
+
horizontalAlign: 'left',
|
|
116
|
+
offsetX: -12,
|
|
117
117
|
showForSingleSeries: true,
|
|
118
|
-
fontSize: '16px',
|
|
119
118
|
markers: {
|
|
120
119
|
width: 50,
|
|
121
|
-
height: 12,
|
|
122
120
|
radius: 5,
|
|
121
|
+
offsetY: 3
|
|
123
122
|
},
|
|
124
123
|
|
|
125
124
|
itemMargin: {
|
|
126
|
-
horizontal:
|
|
125
|
+
horizontal: 5,
|
|
127
126
|
vertical: 0
|
|
128
127
|
},
|
|
129
128
|
|
|
@@ -12,34 +12,25 @@
|
|
|
12
12
|
<div class="funnel-spark-line funnel-grid-3">
|
|
13
13
|
<slot name="sparkLine3"></slot>
|
|
14
14
|
</div>
|
|
15
|
-
<div class="funnel-spark-line funnel-grid-4">
|
|
16
|
-
<slot name="sparkLine4"></slot>
|
|
17
|
-
</div>
|
|
18
15
|
|
|
19
|
-
<div class="funnel-single-metric funnel-grid-
|
|
16
|
+
<div class="funnel-single-metric funnel-grid-4">
|
|
20
17
|
<div class="funnel-single-metric-container">
|
|
21
18
|
<slot name="funnel1" class="funnel-single-metric"></slot>
|
|
22
19
|
</div>
|
|
23
20
|
</div>
|
|
24
21
|
|
|
25
|
-
<div class="funnel-single-metric funnel-grid-
|
|
22
|
+
<div class="funnel-single-metric funnel-grid-5">
|
|
26
23
|
<div class="funnel-single-metric-container">
|
|
27
24
|
<slot name="funnel2" class="funnel-single-metric"></slot>
|
|
28
25
|
</div>
|
|
29
26
|
</div>
|
|
30
27
|
|
|
31
|
-
<div class="funnel-single-metric funnel-grid-
|
|
28
|
+
<div class="funnel-single-metric funnel-grid-6">
|
|
32
29
|
<div class="funnel-single-metric-container">
|
|
33
30
|
<slot name="funnel3" class="funnel-single-metric"></slot>
|
|
34
31
|
</div>
|
|
35
32
|
</div>
|
|
36
33
|
|
|
37
|
-
<div class="funnel-single-metric funnel-grid-8">
|
|
38
|
-
<div class="funnel-single-metric-container">
|
|
39
|
-
<slot name="funnel4" class="funnel-single-metric"></slot>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
|
|
43
34
|
</div>
|
|
44
35
|
</template>
|
|
45
36
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<h3 class="toggle-metric metric-label">{{label}}</h3>
|
|
4
|
-
<apexchart type="pie"
|
|
4
|
+
<apexchart type="pie" :options="chartOptions" :series="values"></apexchart>
|
|
5
5
|
</div>
|
|
6
6
|
|
|
7
7
|
</template>
|
|
@@ -27,13 +27,6 @@ export default {
|
|
|
27
27
|
type: Array,
|
|
28
28
|
required: true
|
|
29
29
|
},
|
|
30
|
-
/*
|
|
31
|
-
* Component's height
|
|
32
|
-
*/
|
|
33
|
-
height: {
|
|
34
|
-
type: String,
|
|
35
|
-
default: ""
|
|
36
|
-
},
|
|
37
30
|
/**
|
|
38
31
|
* Component's main label
|
|
39
32
|
*/
|
|
@@ -59,14 +52,14 @@ export default {
|
|
|
59
52
|
labels: this.labels,
|
|
60
53
|
plotOptions: {
|
|
61
54
|
pie: {
|
|
62
|
-
|
|
63
|
-
customScale: 0.7,
|
|
55
|
+
customScale: 1,
|
|
64
56
|
dataLabels: {
|
|
65
|
-
offset:
|
|
66
|
-
}
|
|
57
|
+
offset: -50
|
|
58
|
+
}
|
|
59
|
+
|
|
67
60
|
}
|
|
68
61
|
},
|
|
69
|
-
|
|
62
|
+
colors: this.colors ? this.colors : this.getDefaultColors(),
|
|
70
63
|
dataLabels: {
|
|
71
64
|
enabledOnSeries: true,
|
|
72
65
|
formatter: function (val, {seriesIndex, w}) {
|
|
@@ -74,8 +67,8 @@ export default {
|
|
|
74
67
|
},
|
|
75
68
|
style: {
|
|
76
69
|
colors: [this.getColor('black')],
|
|
77
|
-
fontSize: '
|
|
78
|
-
fontWeight:
|
|
70
|
+
fontSize: '1rem',
|
|
71
|
+
fontWeight: 300
|
|
79
72
|
},
|
|
80
73
|
background: {
|
|
81
74
|
enabled: false,
|
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
*/
|
|
49
49
|
currencyCode:{
|
|
50
50
|
type:String,
|
|
51
|
+
required:false,
|
|
51
52
|
default:'GBP'
|
|
52
53
|
},
|
|
53
54
|
/**
|
|
@@ -55,6 +56,7 @@ export default {
|
|
|
55
56
|
*/
|
|
56
57
|
currencyLocale:{
|
|
57
58
|
type:String,
|
|
59
|
+
required:false,
|
|
58
60
|
default:'en-GB'
|
|
59
61
|
},
|
|
60
62
|
/**
|
|
@@ -62,7 +64,7 @@ export default {
|
|
|
62
64
|
*/
|
|
63
65
|
currencyDenomination: {
|
|
64
66
|
type: Number,
|
|
65
|
-
default:
|
|
67
|
+
default: 100
|
|
66
68
|
}
|
|
67
69
|
},
|
|
68
70
|
computed: {
|
|
@@ -71,7 +73,7 @@ export default {
|
|
|
71
73
|
* @return String
|
|
72
74
|
*/
|
|
73
75
|
metricValue() {
|
|
74
|
-
if (this.value
|
|
76
|
+
if (this.value == 0) {
|
|
75
77
|
return "-";
|
|
76
78
|
}
|
|
77
79
|
|
|
@@ -83,6 +83,7 @@ export default {
|
|
|
83
83
|
*/
|
|
84
84
|
currencyCode:{
|
|
85
85
|
type:String,
|
|
86
|
+
required:false,
|
|
86
87
|
default:'GBP'
|
|
87
88
|
},
|
|
88
89
|
/**
|
|
@@ -90,6 +91,7 @@ export default {
|
|
|
90
91
|
*/
|
|
91
92
|
currencyLocale:{
|
|
92
93
|
type:String,
|
|
94
|
+
required:false,
|
|
93
95
|
default:'en-GB'
|
|
94
96
|
},
|
|
95
97
|
/**
|
|
@@ -97,14 +99,14 @@ export default {
|
|
|
97
99
|
*/
|
|
98
100
|
currencyDenomination: {
|
|
99
101
|
type: Number,
|
|
100
|
-
default:
|
|
102
|
+
default: 100
|
|
101
103
|
},
|
|
102
104
|
/**
|
|
103
105
|
* Percentage base used to calculate the trend impact
|
|
104
106
|
*/
|
|
105
|
-
|
|
107
|
+
trend_impact_percentage :{
|
|
106
108
|
type: Number,
|
|
107
|
-
default:
|
|
109
|
+
default: 5
|
|
108
110
|
},
|
|
109
111
|
/**
|
|
110
112
|
* This prop will inverse the trend impact
|
|
@@ -134,9 +136,6 @@ export default {
|
|
|
134
136
|
},
|
|
135
137
|
stroke: {
|
|
136
138
|
width: 5,
|
|
137
|
-
curve: 'smooth',
|
|
138
|
-
lineCap: 'butt',
|
|
139
|
-
|
|
140
139
|
},
|
|
141
140
|
grid: {
|
|
142
141
|
padding: {
|
|
@@ -193,10 +192,9 @@ export default {
|
|
|
193
192
|
if (this.sparkLineVal[0].data.length > 0) {
|
|
194
193
|
// if the value is an object, map to array
|
|
195
194
|
|
|
196
|
-
const trendImpactVals = this.sparkLineVal[0].data[0].y
|
|
197
|
-
|
|
198
|
-
let result = this.calcTrendImpact(trendImpactVals, this.trend_impact_base);
|
|
195
|
+
const trendImpactVals = this.sparkLineVal[0].data[0].y ? this.sparkLineVal[0].data.map(data => data.y) : this.sparkLineVal[0].data;
|
|
199
196
|
|
|
197
|
+
let result = this.calcTrendImpact(trendImpactVals, this.trend_impact_percentage);
|
|
200
198
|
if (this.inverse_trend_impact === true && result != false)
|
|
201
199
|
return result *-1;
|
|
202
200
|
else
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import styleInfo from '../../../src/sass/includes/_as_variables.scss';
|
|
2
|
-
import jsonCharCodesData from '../json/char_list.json';
|
|
3
2
|
|
|
4
3
|
export const mixins = {
|
|
5
4
|
data(){
|
|
6
|
-
return {
|
|
7
|
-
jsonCharCodes: jsonCharCodesData
|
|
8
|
-
}
|
|
5
|
+
return {}
|
|
9
6
|
},
|
|
10
7
|
methods:{
|
|
11
8
|
|
|
@@ -62,20 +59,6 @@ export const mixins = {
|
|
|
62
59
|
|
|
63
60
|
//converts a character into an HTML entity
|
|
64
61
|
const char2Html = (char) => {
|
|
65
|
-
// Check for special characters first
|
|
66
|
-
let codepointVals = Object.values(this.jsonCharCodes).map(value => value.codepoints[0]);
|
|
67
|
-
|
|
68
|
-
let codesArray = Object.entries(this.jsonCharCodes)
|
|
69
|
-
|
|
70
|
-
if (codepointVals.includes(char.codePointAt())) {
|
|
71
|
-
|
|
72
|
-
let namedChar = codesArray.filter(nestedArr => {
|
|
73
|
-
return nestedArr[1].codepoints[0] == char.codePointAt()
|
|
74
|
-
})
|
|
75
|
-
// If it's a special character return now
|
|
76
|
-
return `${namedChar[0][0]}`
|
|
77
|
-
}
|
|
78
|
-
|
|
79
62
|
let item = `${char}`;
|
|
80
63
|
|
|
81
64
|
//spread operator can detect emoji surrogate pairs
|
|
@@ -125,7 +108,7 @@ export const charts = {
|
|
|
125
108
|
return {
|
|
126
109
|
|
|
127
110
|
defcolors: [
|
|
128
|
-
|
|
111
|
+
'#FF9494','#FFCA8A','#FCFF9D','#B2FFA2','#81F4FF','#85B4FF','#A898FF'
|
|
129
112
|
]
|
|
130
113
|
}
|
|
131
114
|
},
|
|
@@ -139,59 +122,41 @@ export const charts = {
|
|
|
139
122
|
*
|
|
140
123
|
* @return { {Integer} 1, 0,-1 }
|
|
141
124
|
*/
|
|
142
|
-
calcTrendImpact(values,
|
|
125
|
+
calcTrendImpact(values, percentageBase){
|
|
143
126
|
|
|
144
127
|
// If all values in the values array are 0 return 0;
|
|
145
128
|
if (values.every((val) => val === 0)){
|
|
146
|
-
return
|
|
129
|
+
return 0;
|
|
147
130
|
}
|
|
148
131
|
|
|
149
|
-
let
|
|
132
|
+
let sum = 0
|
|
133
|
+
values.forEach(val => {
|
|
134
|
+
sum = sum + val;
|
|
135
|
+
});
|
|
150
136
|
|
|
151
|
-
|
|
152
|
-
return 1;
|
|
153
|
-
} else if (regressionCalc < -trend_impact_base) {
|
|
154
|
-
return -1;
|
|
155
|
-
} else {
|
|
156
|
-
return 0;
|
|
157
|
-
}
|
|
158
|
-
},
|
|
137
|
+
let average = sum/values.length;
|
|
159
138
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
*
|
|
163
|
-
* @param {Array} [nums] [the array of values to be calculated]
|
|
164
|
-
* @return {Integer}
|
|
165
|
-
*/
|
|
166
|
-
calculateLinearRegression(nums) {
|
|
167
|
-
let summed_nums = 0;
|
|
168
|
-
nums.forEach(val => {
|
|
169
|
-
summed_nums = summed_nums + val;
|
|
170
|
-
});
|
|
139
|
+
// the acceptable difference before it's trending positive or negatively
|
|
140
|
+
let difference = average/100 * percentageBase;
|
|
171
141
|
|
|
172
|
-
|
|
173
|
-
let
|
|
174
|
-
|
|
142
|
+
// lower 'keeping steady value'
|
|
143
|
+
let lower_base = average-difference;
|
|
144
|
+
// higher 'keeping steady value'
|
|
145
|
+
let upper_base = average+difference;
|
|
175
146
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
147
|
+
let last_value = values[values.length - 1];
|
|
148
|
+
|
|
149
|
+
if(last_value >= upper_base)
|
|
150
|
+
return 1;
|
|
151
|
+
if(last_value <= lower_base)
|
|
152
|
+
return -1;
|
|
153
|
+
return 0;
|
|
182
154
|
|
|
183
|
-
let numerator = ( (nums.length) * multiplied_data) - (summed_nums * summed_index);
|
|
184
|
-
let denominator = ( (nums.length) * squared_index) - summed_index**2;
|
|
185
|
-
|
|
186
|
-
if (denominator != 0)
|
|
187
|
-
return numerator/denominator;
|
|
188
|
-
else
|
|
189
|
-
return 0;
|
|
190
155
|
},
|
|
191
156
|
|
|
192
157
|
//return an array of default colors
|
|
193
158
|
getDefaultColors() {
|
|
194
|
-
return this.$data.defcolors;
|
|
159
|
+
return this.$data.defcolors.sort(() => Math.random() - 0.5);
|
|
195
160
|
},
|
|
196
161
|
|
|
197
162
|
//return a specific color
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<img :src="logo.src" :alt="logo.alt" class="toggle-multi-tier-sidenav-logo">
|
|
4
4
|
<ul class="toggle-multi-tier-sidenav-ul">
|
|
5
5
|
<!-- @slot For ToggleSideNavItems -->
|
|
6
|
-
<slot
|
|
6
|
+
<slot></slot>
|
|
7
7
|
</ul>
|
|
8
8
|
|
|
9
9
|
<div class="toggle-multi-tier-sidenav-divider"></div>
|
|
@@ -14,22 +14,10 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
<div class="toggle-multi-tier-sidenav-select-container">
|
|
17
|
-
<ToggleInputSelect type="text" placeholder="placeholder text" label="Location" :options="
|
|
17
|
+
<ToggleInputSelect type="text" placeholder="placeholder text" label="Location" :options="unitOptions" v-model="unitOptionVal" />
|
|
18
18
|
</div>
|
|
19
19
|
|
|
20
|
-
<div
|
|
21
|
-
<div class="toggle-multi-tier-sidenav-user-menu">
|
|
22
|
-
<ToggleHeaderTextLarge class="toggle-multi-tier-sidenav-user-name">
|
|
23
|
-
{{ user }}
|
|
24
|
-
</ToggleHeaderTextLarge>
|
|
25
|
-
<div class="toggle-multi-tier-sidenav-user-menu-divider"></div>
|
|
26
|
-
<ul class="toggle-multi-tier-sidenav-user-menu-ul">
|
|
27
|
-
<slot name="user-menu"></slot>
|
|
28
|
-
</ul>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
<div @click="userMenuOpen = !userMenuOpen" :class="userMenuOpen ? 'toggle-multi-tier-sidenav-user-icon-menu-open' : 'toggle-multi-tier-sidenav-user-icon'">
|
|
32
|
-
</div>
|
|
20
|
+
<div class="toggle-multi-tier-sidenav-user-icon"></div>
|
|
33
21
|
</nav>
|
|
34
22
|
</template>
|
|
35
23
|
|
|
@@ -40,11 +28,6 @@ import ToggleInputSelect from '../../forms/ToggleInputSelect.vue';
|
|
|
40
28
|
|
|
41
29
|
export default {
|
|
42
30
|
name: 'ToggleMultiTierSideNav',
|
|
43
|
-
data() {
|
|
44
|
-
return {
|
|
45
|
-
userMenuOpen: false,
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
31
|
props: {
|
|
49
32
|
value: {},
|
|
50
33
|
/**
|
|
@@ -61,13 +44,6 @@ export default {
|
|
|
61
44
|
type: String,
|
|
62
45
|
default: 'Airship'
|
|
63
46
|
},
|
|
64
|
-
/**
|
|
65
|
-
* Name of the user, displayed in the user menu
|
|
66
|
-
*/
|
|
67
|
-
user: {
|
|
68
|
-
type: String,
|
|
69
|
-
default: 'User'
|
|
70
|
-
},
|
|
71
47
|
unitOptions: {
|
|
72
48
|
type: Array,
|
|
73
49
|
required: true
|
|
@@ -82,19 +58,7 @@ export default {
|
|
|
82
58
|
set: function (value) {
|
|
83
59
|
this.$emit('input', value);
|
|
84
60
|
}
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
unitOptionsSorted() {
|
|
88
|
-
// Create a new array and populate it with the elements from the original unitOptions array
|
|
89
|
-
const sortedUnitOptions = [...this.unitOptions];
|
|
90
|
-
|
|
91
|
-
// Sort the new array in ascending alphabetical order according to the label property of each element
|
|
92
|
-
sortedUnitOptions.sort((a, b) => a.label.localeCompare(b.label));
|
|
93
|
-
|
|
94
|
-
// Return the new sorted array
|
|
95
|
-
return sortedUnitOptions;
|
|
96
61
|
}
|
|
97
|
-
|
|
98
62
|
},
|
|
99
63
|
components: {
|
|
100
64
|
ToggleHeaderTextLarge,
|
|
@@ -45,16 +45,7 @@ export default {
|
|
|
45
45
|
window.getSelection().removeAllRanges();
|
|
46
46
|
window.getSelection().addRange(range);
|
|
47
47
|
document.execCommand("copy");
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
click(){
|
|
51
|
-
/**
|
|
52
|
-
* Emitted when the button is clicked.
|
|
53
|
-
* @event click
|
|
54
|
-
* @type {Event}
|
|
55
|
-
*/
|
|
56
|
-
this.$emit('click');
|
|
57
|
-
}
|
|
48
|
+
}
|
|
58
49
|
}
|
|
59
50
|
};
|
|
60
51
|
</script>
|
package/src/index.js
CHANGED
|
@@ -25,7 +25,6 @@ import ToggleModal from "./components/modals/ToggleModal.vue";
|
|
|
25
25
|
import ToggleInputSearch from "./components/forms/ToggleInputSearch.vue";
|
|
26
26
|
import ToggleInputRadioButtonGroup from "./components/forms/ToggleInputRadioButtonGroup.vue";
|
|
27
27
|
import ToggleButton from "./components/buttons/ToggleButton.vue";
|
|
28
|
-
import ToggleLoginButton from "./components/buttons/ToggleLoginButton.vue";
|
|
29
28
|
import ToggleFillLoader from "./components/loaders/ToggleFillLoader.vue";
|
|
30
29
|
|
|
31
30
|
|
|
@@ -91,7 +90,6 @@ const Components = {
|
|
|
91
90
|
ToggleFillLoader,
|
|
92
91
|
ToggleInputImage,
|
|
93
92
|
ToggleButton,
|
|
94
|
-
ToggleLoginButton,
|
|
95
93
|
ToggleInputGroup,
|
|
96
94
|
ToggleHeaderTextLarge,
|
|
97
95
|
ToggleInputNumber,
|
|
@@ -237,58 +237,3 @@
|
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
}
|
|
240
|
-
|
|
241
|
-
//
|
|
242
|
-
// Toggle and Airship Login Buttons
|
|
243
|
-
//
|
|
244
|
-
|
|
245
|
-
.toggle-login-button {
|
|
246
|
-
background-color: #3180FF;
|
|
247
|
-
border: 0;
|
|
248
|
-
border-radius: 23px;
|
|
249
|
-
width: 120px;
|
|
250
|
-
height: 46px;
|
|
251
|
-
color: #ffffff;
|
|
252
|
-
cursor: pointer;
|
|
253
|
-
font: normal normal 600 15px/18px Lato;
|
|
254
|
-
position: relative;
|
|
255
|
-
transition: box-shadow .3s, transform .3s, background-color .3s, -webkit-transform .3s;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
.toggle-login-button--airship {
|
|
259
|
-
background-color: #FF7175 !important;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
.toggle-login-button:hover {
|
|
263
|
-
background-color: #1571dd;
|
|
264
|
-
box-shadow: 0 10px 30px -10px #2cc1ff;
|
|
265
|
-
-webkit-transform: translate(0, -3px);
|
|
266
|
-
-ms-transform: translate(0, -3px);
|
|
267
|
-
transform: translate(0, -3px);
|
|
268
|
-
color: #fff;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
.toggle-login-button--airship:hover {
|
|
272
|
-
background-color: #ff463f !important;
|
|
273
|
-
box-shadow: 0 10px 30px -10px rgb(254 108 102 / 50%) !important;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
.toggle-login-button-loader {
|
|
277
|
-
border-radius: 50%;
|
|
278
|
-
border: .25rem solid #fff;
|
|
279
|
-
border-top-color: #3180FF;
|
|
280
|
-
animation: spin 1s infinite linear;
|
|
281
|
-
margin: 0 auto;
|
|
282
|
-
width: 0.5rem;
|
|
283
|
-
height: 0.5rem;
|
|
284
|
-
position: absolute;
|
|
285
|
-
left: 50%;
|
|
286
|
-
margin-left: -0.5rem;
|
|
287
|
-
top: 50%;
|
|
288
|
-
margin-top: -0.5rem;
|
|
289
|
-
box-sizing: content-box;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
.toggle-login-button-loader--airship {
|
|
293
|
-
border-top-color: #FF7175;
|
|
294
|
-
}
|