toggle-components-library 1.32.0-beta.2 → 1.32.0-beta.4
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 +485 -140
- 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 +485 -140
- package/dist/toggle-components-library.umd.js.map +1 -1
- package/dist/toggle-components-library.umd.min.js +7 -7
- 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/badges/ToggleBadge.vue +5 -1
- package/src/components/badges/ToggleCalculateBadge.vue +12 -3
- package/src/components/carousel/ToggleCarousel.vue +26 -11
- package/src/components/metrics/ToggleMetricSingleMetric.vue +4 -9
- package/src/index.js +12 -1
- package/src/sass/includes/_as_badges.scss +84 -0
- package/src/sass/includes/_as_carousels.scss +45 -4
package/package-lock.json
CHANGED
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<span :class="[ 'toggle-badge', badgeStyle]"><slot></slot></span>
|
|
2
|
+
<span :class="[ 'toggle-badge', badgeStyle, badgeType ]"><slot></slot></span>
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script>
|
|
@@ -14,6 +14,10 @@ export default {
|
|
|
14
14
|
badgeStyle:{
|
|
15
15
|
type:String,
|
|
16
16
|
default:'neutral'
|
|
17
|
+
},
|
|
18
|
+
badgeType: {
|
|
19
|
+
type:String,
|
|
20
|
+
default:''
|
|
17
21
|
}
|
|
18
22
|
},
|
|
19
23
|
computed: {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
<
|
|
4
|
-
<
|
|
2
|
+
<div>
|
|
3
|
+
<h3 class="toggle-metric metric-label">{{label}}</h3>
|
|
4
|
+
<div class="toggle-calculate-badge">
|
|
5
|
+
<div class="clock-icon"></div>
|
|
6
|
+
<slot></slot>
|
|
7
|
+
</div>
|
|
5
8
|
</div>
|
|
6
9
|
</template>
|
|
7
10
|
|
|
@@ -9,5 +12,11 @@
|
|
|
9
12
|
|
|
10
13
|
export default {
|
|
11
14
|
name: 'ToggleCalculateBadge',
|
|
15
|
+
props: {
|
|
16
|
+
label: {
|
|
17
|
+
type:String,
|
|
18
|
+
default: ''
|
|
19
|
+
}
|
|
20
|
+
}
|
|
12
21
|
}
|
|
13
22
|
</script>
|
|
@@ -7,15 +7,17 @@
|
|
|
7
7
|
@slideChangeTransitionStart="onSlideTransition"
|
|
8
8
|
>
|
|
9
9
|
<slot></slot>
|
|
10
|
-
<div v-if="
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
<div v-if="carouselPrev && slidesLength > 1"
|
|
11
|
+
class="toggle-carousel-button toggle-carousel-button--prev"
|
|
12
|
+
:class="['toggle-carousel-button--' + carouselNavPosition, {'toggle-carousel-button--disabled': prevDisabled}]"
|
|
13
|
+
@click="$refs.swiper.swiperInstance.slidePrev()"
|
|
14
|
+
slot="button-prev"
|
|
14
15
|
></div>
|
|
15
|
-
<div v-if="
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
<div v-if="carouselNext && slidesLength > 1"
|
|
17
|
+
class="toggle-carousel-button toggle-carousel-button--next"
|
|
18
|
+
:class="['toggle-carousel-button--' + carouselNavPosition, {'toggle-carousel-button--disabled': nextDisabled}]"
|
|
19
|
+
@click="$refs.swiper.swiperInstance.slideNext()"
|
|
20
|
+
slot="button-next"
|
|
19
21
|
></div>
|
|
20
22
|
</swiper>
|
|
21
23
|
</template>
|
|
@@ -32,6 +34,7 @@ export default {
|
|
|
32
34
|
return {
|
|
33
35
|
prevDisabled: false,
|
|
34
36
|
nextDisabled: false,
|
|
37
|
+
slidesLength: 0
|
|
35
38
|
};
|
|
36
39
|
},
|
|
37
40
|
props: {
|
|
@@ -39,7 +42,18 @@ export default {
|
|
|
39
42
|
type: String,
|
|
40
43
|
default: 'default'
|
|
41
44
|
},
|
|
42
|
-
|
|
45
|
+
carouselNavPosition: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: 'middle',
|
|
48
|
+
validator(value) {
|
|
49
|
+
return ['top', 'middle', 'bottom'].includes(value)
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
carouselPrev: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: true
|
|
55
|
+
},
|
|
56
|
+
carouselNext: {
|
|
43
57
|
type: Boolean,
|
|
44
58
|
default: true
|
|
45
59
|
},
|
|
@@ -65,11 +79,12 @@ export default {
|
|
|
65
79
|
swiper: directive
|
|
66
80
|
},
|
|
67
81
|
mounted() {
|
|
68
|
-
|
|
82
|
+
this.slidesLength = this.$refs.swiper.swiperInstance.slides.length;
|
|
83
|
+
this.onSlideTransition();
|
|
69
84
|
},
|
|
70
85
|
methods: {
|
|
71
86
|
onSlideTransition(){
|
|
72
|
-
// if loop is enabled, don't disable buttons
|
|
87
|
+
// if loop is enabled, don't disable buttons, unless specified in prop
|
|
73
88
|
const isLoop = this.$refs.swiper.swiperInstance.params.loop;
|
|
74
89
|
if(isLoop) return;
|
|
75
90
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
|
|
4
|
-
<
|
|
5
|
-
<div class="single-metric-icon" v-else-if="pendingBadge && label.length == 0"></div>
|
|
3
|
+
<h3 class="toggle-metric metric-label">{{label}}</h3>
|
|
4
|
+
<div class="single-metric-icon" v-if="metricPending && label.length == 0"></div>
|
|
6
5
|
<h1 class="toggle-metric metric-value" v-else>{{metricValue}}</h1>
|
|
7
6
|
</div>
|
|
8
7
|
</template>
|
|
@@ -10,14 +9,10 @@
|
|
|
10
9
|
<script>
|
|
11
10
|
|
|
12
11
|
import { mixins } from '../mixins/mixins';
|
|
13
|
-
import ToggleCalculateBadge from '../badges/ToggleCalculateBadge.vue';
|
|
14
12
|
|
|
15
13
|
|
|
16
14
|
export default {
|
|
17
15
|
mixins:[mixins],
|
|
18
|
-
components: {
|
|
19
|
-
ToggleCalculateBadge,
|
|
20
|
-
},
|
|
21
16
|
props: {
|
|
22
17
|
/**
|
|
23
18
|
* Component's name
|
|
@@ -26,7 +21,7 @@ export default {
|
|
|
26
21
|
type: String,
|
|
27
22
|
default: "ToggleMetricSingleMetric"
|
|
28
23
|
},
|
|
29
|
-
|
|
24
|
+
/**
|
|
30
25
|
* Type of the value, this will affect on the format shown
|
|
31
26
|
*/
|
|
32
27
|
type : {
|
|
@@ -73,7 +68,7 @@ export default {
|
|
|
73
68
|
/**
|
|
74
69
|
* Displays badge or clock if metrics are still pending
|
|
75
70
|
*/
|
|
76
|
-
|
|
71
|
+
metricPending: {
|
|
77
72
|
type: Boolean,
|
|
78
73
|
default: false
|
|
79
74
|
}
|
package/src/index.js
CHANGED
|
@@ -32,6 +32,7 @@ import ToggleInputSearch from "./components/forms/ToggleInputSearch.vue";
|
|
|
32
32
|
import ToggleInputRadioButtonGroup from "./components/forms/ToggleInputRadioButtonGroup.vue";
|
|
33
33
|
import ToggleButton from "./components/buttons/ToggleButton.vue";
|
|
34
34
|
import ToggleLoginButton from "./components/buttons/ToggleLoginButton.vue";
|
|
35
|
+
import ToggleMetricsButton from "./components/buttons/ToggleMetricsButton.vue";
|
|
35
36
|
|
|
36
37
|
import ToggleFillLoader from "./components/loaders/ToggleFillLoader.vue";
|
|
37
38
|
import ToggleProgressLoader from "./components/loaders/ToggleProgressLoader.vue";
|
|
@@ -41,6 +42,8 @@ import ToggleTable from './components/tables/ToggleTable.vue';
|
|
|
41
42
|
import ToggleTableRow from './components/tables/ToggleTableRow.vue';
|
|
42
43
|
import ToggleTableColumn from './components/tables/ToggleTableColumn.vue';
|
|
43
44
|
import ToggleBadge from './components/badges/ToggleBadge.vue';
|
|
45
|
+
import ToggleCalculateBadge from './components/badges/ToggleCalculateBadge.vue';
|
|
46
|
+
import TogglePodiumBadge from './components/badges/TogglePodiumBadge.vue';
|
|
44
47
|
|
|
45
48
|
import ToggleBreadCrumb from './components/breadcrumb/ToggleBreadCrumb.vue';
|
|
46
49
|
import ToggleSideNavItem from './components/navs/sidenav/ToggleSideNavItem.vue';
|
|
@@ -83,6 +86,9 @@ import ToggleThreeDotsButton from "./components/threedots/ToggleThreeDotsButton.
|
|
|
83
86
|
import ToggleCarousel from "./components/carousel/ToggleCarousel.vue";
|
|
84
87
|
import ToggleCarouselSlide from "./components/carousel/ToggleCarouselSlide.vue";
|
|
85
88
|
|
|
89
|
+
import ToggleEmailCard from "./components/cards/ToggleEmailCard.vue";
|
|
90
|
+
import ToggleRewardsCard from "./components/cards/ToggleRewardsCard.vue";
|
|
91
|
+
|
|
86
92
|
|
|
87
93
|
import './sass/main.scss';
|
|
88
94
|
|
|
@@ -91,6 +97,8 @@ const Components = {
|
|
|
91
97
|
ToggleTable,
|
|
92
98
|
ToggleTableRow,
|
|
93
99
|
ToggleBadge,
|
|
100
|
+
ToggleCalculateBadge,
|
|
101
|
+
TogglePodiumBadge,
|
|
94
102
|
ToggleTableColumn,
|
|
95
103
|
ToggleInputText,
|
|
96
104
|
ToggleInputEditableText,
|
|
@@ -110,6 +118,7 @@ const Components = {
|
|
|
110
118
|
ToggleInputImage,
|
|
111
119
|
ToggleButton,
|
|
112
120
|
ToggleLoginButton,
|
|
121
|
+
ToggleMetricsButton,
|
|
113
122
|
ToggleInputGroup,
|
|
114
123
|
ToggleHeaderTextLarge,
|
|
115
124
|
ToggleInputNumber,
|
|
@@ -150,7 +159,9 @@ const Components = {
|
|
|
150
159
|
ToggleBoosterModal,
|
|
151
160
|
ToggleContactSearch,
|
|
152
161
|
ToggleCarousel,
|
|
153
|
-
ToggleCarouselSlide
|
|
162
|
+
ToggleCarouselSlide,
|
|
163
|
+
ToggleEmailCard,
|
|
164
|
+
ToggleRewardsCard
|
|
154
165
|
}
|
|
155
166
|
|
|
156
167
|
Object.keys(Components).forEach(name => {
|
|
@@ -32,6 +32,89 @@
|
|
|
32
32
|
&.empty {
|
|
33
33
|
background-color: $toggle-placeholder-grey;
|
|
34
34
|
}
|
|
35
|
+
|
|
36
|
+
&.rounded {
|
|
37
|
+
border-radius: 50px;
|
|
38
|
+
padding: 5px 11px;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.toggle-podium-badge {
|
|
43
|
+
@include toggle-global-font-config;
|
|
44
|
+
display: inline-flex;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
align-items: center;
|
|
47
|
+
width: fit-content;
|
|
48
|
+
border-radius: 20px;
|
|
49
|
+
color: white;
|
|
50
|
+
font-size: $toggle-font-size-regular;
|
|
51
|
+
font-weight: 900;
|
|
52
|
+
padding: 5px 18px 5px 10px;
|
|
53
|
+
|
|
54
|
+
&.first {
|
|
55
|
+
background-color: #efd028;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&.second{
|
|
59
|
+
background-color: #adb4c9;
|
|
60
|
+
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&.third {
|
|
64
|
+
background-color: #d99a0c;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.podium-number {
|
|
70
|
+
display: flex;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
align-items: center;
|
|
73
|
+
opacity: 1;
|
|
74
|
+
width: 26px;
|
|
75
|
+
height: 26px;
|
|
76
|
+
border-radius: 50%;
|
|
77
|
+
text-align: center;
|
|
78
|
+
margin-right: 20px;
|
|
79
|
+
margin-left: -4px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.first .podium-number{
|
|
83
|
+
background: transparent linear-gradient(132deg, #FFD700 0%, #F0E4A2 100%) 0% 0% no-repeat padding-box;
|
|
84
|
+
color: #CBAF15;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.second .podium-number{
|
|
88
|
+
background: transparent linear-gradient(132deg, #C6C9D5 0%, #DEE2EF 100%) 0% 0% no-repeat padding-box;
|
|
89
|
+
color: #8C92A3;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.third .podium-number{
|
|
93
|
+
background: transparent linear-gradient(132deg, #E8B33C 0%, #F8CE6E 100%) 0% 0% no-repeat padding-box;
|
|
94
|
+
color: #C18A0E;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.toggle-calculate-badge{
|
|
98
|
+
display: inline-flex;
|
|
99
|
+
justify-content: space-between;
|
|
100
|
+
align-items: center;
|
|
101
|
+
width: fit-content;
|
|
102
|
+
background-color: #E4EBED;
|
|
103
|
+
color: #6D90B4;
|
|
104
|
+
border-radius: 50px;
|
|
105
|
+
padding: 10px 20px 10px 15px;
|
|
106
|
+
font-family: $toggle-font-family;
|
|
107
|
+
font-size: 0.8rem;
|
|
108
|
+
font-weight:lighter;
|
|
109
|
+
|
|
110
|
+
.clock-icon {
|
|
111
|
+
background-image: url('../assets/icons/clock-solid.svg');
|
|
112
|
+
background-repeat:no-repeat;
|
|
113
|
+
background-size:contain;
|
|
114
|
+
height: 22px;
|
|
115
|
+
width: 22px;
|
|
116
|
+
margin-right: 15px;
|
|
117
|
+
}
|
|
35
118
|
}
|
|
36
119
|
|
|
37
120
|
.toggle-podium-badge {
|
|
@@ -101,6 +184,7 @@
|
|
|
101
184
|
font-family: $toggle-font-family;
|
|
102
185
|
font-size: 0.8rem;
|
|
103
186
|
font-weight:lighter;
|
|
187
|
+
margin-top: 11px;
|
|
104
188
|
|
|
105
189
|
.clock-icon {
|
|
106
190
|
background-image: url('../assets/icons/clock-solid.svg');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
.toggle-carousel{
|
|
2
2
|
cursor: grab;
|
|
3
|
+
font-size: 0;
|
|
3
4
|
&:active {
|
|
4
5
|
cursor: grabbing;
|
|
5
6
|
}
|
|
@@ -30,19 +31,41 @@
|
|
|
30
31
|
background-color: #2680EB;
|
|
31
32
|
border-radius: 100%;
|
|
32
33
|
position: absolute;
|
|
33
|
-
top: 50%;
|
|
34
|
-
transform: translate(0,-50%);
|
|
35
34
|
cursor: pointer;
|
|
36
35
|
z-index: 50;
|
|
36
|
+
@media only screen and (max-width:768px){
|
|
37
|
+
width: 24px;
|
|
38
|
+
height: 24px;
|
|
39
|
+
}
|
|
37
40
|
&:hover{
|
|
38
41
|
background-color: #3487ec;
|
|
39
42
|
}
|
|
43
|
+
&--top{
|
|
44
|
+
top: 20px;
|
|
45
|
+
@media only screen and (max-width:768px){
|
|
46
|
+
top: 12px;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
&--middle{
|
|
50
|
+
top: 50%;
|
|
51
|
+
transform: translate(0,-50%);
|
|
52
|
+
}
|
|
53
|
+
&--bottom{
|
|
54
|
+
bottom: 20px;
|
|
55
|
+
@media only screen and (max-width:768px){
|
|
56
|
+
bottom: 12px;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
40
59
|
&:before, &:after{
|
|
41
60
|
content: '';
|
|
42
61
|
width: 4px;
|
|
43
62
|
height: 15px;
|
|
44
63
|
background-color: #FFF;
|
|
45
64
|
position: relative;
|
|
65
|
+
@media only screen and (max-width:768px){
|
|
66
|
+
width: 2px;
|
|
67
|
+
height: 8px;
|
|
68
|
+
}
|
|
46
69
|
}
|
|
47
70
|
&:before{
|
|
48
71
|
border-radius: 0 0 5px 5px;
|
|
@@ -52,28 +75,46 @@
|
|
|
52
75
|
}
|
|
53
76
|
&--prev{
|
|
54
77
|
left: 20px;
|
|
78
|
+
@media only screen and (max-width:768px){
|
|
79
|
+
left: 12px;
|
|
80
|
+
}
|
|
55
81
|
&:before{
|
|
56
|
-
top: 6px;
|
|
57
82
|
transform: rotate(-45deg);
|
|
58
83
|
top: 4px;
|
|
84
|
+
@media only screen and (max-width:768px){
|
|
85
|
+
top: 2px;
|
|
86
|
+
}
|
|
59
87
|
}
|
|
60
88
|
&:after{
|
|
61
89
|
transform: rotate(45deg);
|
|
62
90
|
top: -4px;
|
|
63
91
|
left: -4px;
|
|
92
|
+
@media only screen and (max-width:768px){
|
|
93
|
+
top: -2px;
|
|
94
|
+
left: -2px;
|
|
95
|
+
}
|
|
64
96
|
}
|
|
65
97
|
}
|
|
66
98
|
&--next{
|
|
67
99
|
right: 20px;
|
|
100
|
+
@media only screen and (max-width:768px){
|
|
101
|
+
right: 12px;
|
|
102
|
+
}
|
|
68
103
|
&:before{
|
|
69
|
-
top: 6px;
|
|
70
104
|
transform: rotate(45deg);
|
|
71
105
|
top: 4px;
|
|
72
106
|
left: 4px;
|
|
107
|
+
@media only screen and (max-width:768px){
|
|
108
|
+
top: 2px;
|
|
109
|
+
left: 2px;
|
|
110
|
+
}
|
|
73
111
|
}
|
|
74
112
|
&:after{
|
|
75
113
|
transform: rotate(-45deg);
|
|
76
114
|
top: -4px;
|
|
115
|
+
@media only screen and (max-width:768px){
|
|
116
|
+
top: -2px;
|
|
117
|
+
}
|
|
77
118
|
}
|
|
78
119
|
}
|
|
79
120
|
&--disabled{
|