toggle-components-library 1.32.0 → 1.33.0
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/clock-solid.fdaf024d.svg +1 -0
- package/dist/img/contacts-greyblue.ef6f8a9a.svg +1 -0
- package/dist/img/contacts-white.95d07c7a.svg +1 -0
- package/dist/img/view_email.508021c9.svg +7 -0
- package/dist/img/view_heatmap.f9058fdb.svg +1 -0
- package/dist/toggle-components-library.common.js +5349 -106
- 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 +5349 -106
- package/dist/toggle-components-library.umd.js.map +1 -1
- package/dist/toggle-components-library.umd.min.js +27 -6
- package/dist/toggle-components-library.umd.min.js.map +1 -1
- package/package-lock.json +11 -1
- package/package.json +78 -76
- package/src/assets/icons/clock-solid.svg +1 -0
- package/src/assets/icons/contacts-greyblue.svg +1 -0
- package/src/assets/icons/contacts-white.svg +1 -0
- package/src/assets/icons/contacts.svg +1 -0
- package/src/assets/icons/view_email.svg +7 -0
- package/src/assets/icons/view_heatmap.svg +1 -0
- package/src/components/badges/ToggleBadge.vue +5 -1
- package/src/components/badges/ToggleCalculateBadge.vue +22 -0
- package/src/components/badges/TogglePodiumBadge.vue +32 -0
- package/src/components/buttons/ToggleMetricsButton.vue +36 -0
- package/src/components/cards/ToggleEmailCard.vue +48 -0
- package/src/components/cards/ToggleRewardsCard.vue +79 -0
- package/src/components/carousel/ToggleCarousel.vue +126 -0
- package/src/components/carousel/ToggleCarouselSlide.vue +26 -0
- package/src/components/metrics/ToggleMetricFunnelChart.vue +27 -8
- package/src/components/metrics/ToggleMetricSingleMetric.vue +12 -4
- package/src/index.js +17 -1
- package/src/sass/includes/_as_badges.scss +162 -0
- package/src/sass/includes/_as_buttons.scss +99 -1
- package/src/sass/includes/_as_cards.scss +166 -0
- package/src/sass/includes/_as_carousels.scss +131 -0
- package/src/sass/includes/_as_metrics.scss +20 -3
- package/src/sass/main.scss +2 -0
package/package-lock.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "toggle-components-library",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.33.0",
|
|
4
4
|
"lockfileVersion": 1,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"dependencies": {
|
|
@@ -17086,6 +17086,11 @@
|
|
|
17086
17086
|
}
|
|
17087
17087
|
}
|
|
17088
17088
|
},
|
|
17089
|
+
"swiper": {
|
|
17090
|
+
"version": "10.3.1",
|
|
17091
|
+
"resolved": "https://registry.npmjs.org/swiper/-/swiper-10.3.1.tgz",
|
|
17092
|
+
"integrity": "sha512-24Wk3YUdZHxjc9faID97GTu6xnLNia+adMt6qMTZG/HgdSUt4fS0REsGUXJOgpTED0Amh/j+gRGQxsLayJUlBQ=="
|
|
17093
|
+
},
|
|
17089
17094
|
"symbol.prototype.description": {
|
|
17090
17095
|
"version": "1.0.5",
|
|
17091
17096
|
"resolved": "https://registry.npmjs.org/symbol.prototype.description/-/symbol.prototype.description-1.0.5.tgz",
|
|
@@ -18469,6 +18474,11 @@
|
|
|
18469
18474
|
"resolved": "https://registry.npmjs.org/vue-apexcharts/-/vue-apexcharts-1.6.2.tgz",
|
|
18470
18475
|
"integrity": "sha512-9HS3scJwWgKjmkcWIf+ndNDR0WytUJD8Ju0V2ZYcjYtlTLwJAf2SKUlBZaQTkDmwje/zMgulvZRi+MXmi+WkKw=="
|
|
18471
18476
|
},
|
|
18477
|
+
"vue-awesome-swiper": {
|
|
18478
|
+
"version": "4.1.1",
|
|
18479
|
+
"resolved": "https://registry.npmjs.org/vue-awesome-swiper/-/vue-awesome-swiper-4.1.1.tgz",
|
|
18480
|
+
"integrity": "sha512-50um10t6N+lJaORkpwSi1wWuMmBI1sgFc9Znsi5oUykw2cO5DzLaBHcO2JNX21R+Ue4TGoIJDhhxjBHtkFrTEQ=="
|
|
18481
|
+
},
|
|
18472
18482
|
"vue-color": {
|
|
18473
18483
|
"version": "2.8.1",
|
|
18474
18484
|
"resolved": "https://registry.npmjs.org/vue-color/-/vue-color-2.8.1.tgz",
|
package/package.json
CHANGED
|
@@ -1,81 +1,83 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
"main": "dist/toggle-components-library.common.js",
|
|
14
|
-
"module": "dist/toggle-components-library.esm.js",
|
|
15
|
-
"unpkg": "dist/toggle-components-library.umd.min.js",
|
|
16
|
-
"browser": {
|
|
17
|
-
"./sfc": "src/toggle-components-library.vue"
|
|
18
|
-
},
|
|
19
|
-
"files": [
|
|
20
|
-
"dist/*",
|
|
21
|
-
"src/*",
|
|
22
|
-
"public/*",
|
|
23
|
-
"*.json",
|
|
24
|
-
"*.js"
|
|
25
|
-
],
|
|
26
|
-
"dependencies": {
|
|
27
|
-
"apexcharts": "^3.36.3",
|
|
28
|
-
"core-js": "^3.25.0",
|
|
29
|
-
"countries-list": "^2.6.1",
|
|
30
|
-
"date-fns": "^1.30.1",
|
|
31
|
-
"storybook-vue-router": "^1.0.7",
|
|
32
|
-
"vue": "^2.7.10",
|
|
33
|
-
"vue-airbnb-style-datepicker": "^2.7.1",
|
|
34
|
-
"vue-apexcharts": "^1.6.2",
|
|
35
|
-
"vue-color": "^2.7.1",
|
|
36
|
-
"vue-moment": "^4.1.0",
|
|
37
|
-
"vue-multiselect": "^2.0.8",
|
|
38
|
-
"vue-router": "^3.6.4",
|
|
39
|
-
"vue2-dropzone": "^3.6.0",
|
|
40
|
-
"vuedraggable": "^2.24.3",
|
|
41
|
-
"webfontloader": "^1.6.28"
|
|
42
|
-
},
|
|
43
|
-
"devDependencies": {
|
|
44
|
-
"@babel/core": "^7.18.13",
|
|
45
|
-
"@storybook/addon-actions": "^6.5.10",
|
|
46
|
-
"@storybook/addon-docs": "^6.5.10",
|
|
47
|
-
"@storybook/vue": "^6.5.10",
|
|
48
|
-
"@vue/cli-plugin-babel": "^4.5.3",
|
|
49
|
-
"@vue/cli-plugin-eslint": "^4.5.3",
|
|
50
|
-
"@vue/cli-service": "^4.5.3",
|
|
51
|
-
"babel-eslint": "^10.1.0",
|
|
52
|
-
"babel-loader": "^8.1.0",
|
|
53
|
-
"babel-preset-vue": "^2.0.2",
|
|
54
|
-
"eslint": "^6.7.2",
|
|
55
|
-
"eslint-plugin-vue": "^6.2.2",
|
|
56
|
-
"react": "^16.13.1",
|
|
57
|
-
"react-is": "^16.13.1",
|
|
58
|
-
"sass": "^1.54.5",
|
|
59
|
-
"sass-loader": "^8.0.2",
|
|
60
|
-
"vue-template-compiler": "^2.7.10"
|
|
61
|
-
},
|
|
62
|
-
"eslintConfig": {
|
|
63
|
-
"root": true,
|
|
64
|
-
"env": {
|
|
65
|
-
"node": true
|
|
2
|
+
"name": "toggle-components-library",
|
|
3
|
+
"version": "1.33.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"serve": "vue-cli-service serve",
|
|
7
|
+
"build": "vue-cli-service build --target lib --name toggle-components-library src/index.js",
|
|
8
|
+
"lint": "vue-cli-service lint",
|
|
9
|
+
"storybook": "start-storybook -p 6006",
|
|
10
|
+
"build-storybook": "build-storybook",
|
|
11
|
+
"build-publish": "vue-cli-service build --target lib --name toggle-components-library src/index.js && npm publish"
|
|
66
12
|
},
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
|
|
13
|
+
"main": "dist/toggle-components-library.common.js",
|
|
14
|
+
"module": "dist/toggle-components-library.esm.js",
|
|
15
|
+
"unpkg": "dist/toggle-components-library.umd.min.js",
|
|
16
|
+
"browser": {
|
|
17
|
+
"./sfc": "src/toggle-components-library.vue"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist/*",
|
|
21
|
+
"src/*",
|
|
22
|
+
"public/*",
|
|
23
|
+
"*.json",
|
|
24
|
+
"*.js"
|
|
70
25
|
],
|
|
71
|
-
"
|
|
72
|
-
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"apexcharts": "^3.36.3",
|
|
28
|
+
"core-js": "^3.25.0",
|
|
29
|
+
"countries-list": "^2.6.1",
|
|
30
|
+
"date-fns": "^1.30.1",
|
|
31
|
+
"storybook-vue-router": "^1.0.7",
|
|
32
|
+
"swiper": "^10.3.0",
|
|
33
|
+
"vue": "^2.7.10",
|
|
34
|
+
"vue-airbnb-style-datepicker": "^2.7.1",
|
|
35
|
+
"vue-apexcharts": "^1.6.2",
|
|
36
|
+
"vue-awesome-swiper": "^4.1.1",
|
|
37
|
+
"vue-color": "^2.7.1",
|
|
38
|
+
"vue-moment": "^4.1.0",
|
|
39
|
+
"vue-multiselect": "^2.0.8",
|
|
40
|
+
"vue-router": "^3.6.4",
|
|
41
|
+
"vue2-dropzone": "^3.6.0",
|
|
42
|
+
"vuedraggable": "^2.24.3",
|
|
43
|
+
"webfontloader": "^1.6.28"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@babel/core": "^7.18.13",
|
|
47
|
+
"@storybook/addon-actions": "^6.5.10",
|
|
48
|
+
"@storybook/addon-docs": "^6.5.10",
|
|
49
|
+
"@storybook/vue": "^6.5.10",
|
|
50
|
+
"@vue/cli-plugin-babel": "^4.5.3",
|
|
51
|
+
"@vue/cli-plugin-eslint": "^4.5.3",
|
|
52
|
+
"@vue/cli-service": "^4.5.3",
|
|
53
|
+
"babel-eslint": "^10.1.0",
|
|
54
|
+
"babel-loader": "^8.1.0",
|
|
55
|
+
"babel-preset-vue": "^2.0.2",
|
|
56
|
+
"eslint": "^6.7.2",
|
|
57
|
+
"eslint-plugin-vue": "^6.2.2",
|
|
58
|
+
"react": "^16.13.1",
|
|
59
|
+
"react-is": "^16.13.1",
|
|
60
|
+
"sass": "^1.54.5",
|
|
61
|
+
"sass-loader": "^8.0.2",
|
|
62
|
+
"vue-template-compiler": "^2.7.10"
|
|
63
|
+
},
|
|
64
|
+
"eslintConfig": {
|
|
65
|
+
"root": true,
|
|
66
|
+
"env": {
|
|
67
|
+
"node": true
|
|
68
|
+
},
|
|
69
|
+
"extends": [
|
|
70
|
+
"plugin:vue/essential",
|
|
71
|
+
"eslint:recommended"
|
|
72
|
+
],
|
|
73
|
+
"parserOptions": {
|
|
74
|
+
"parser": "babel-eslint"
|
|
75
|
+
},
|
|
76
|
+
"rules": {}
|
|
73
77
|
},
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"not dead"
|
|
80
|
-
]
|
|
78
|
+
"browserslist": [
|
|
79
|
+
"> 1%",
|
|
80
|
+
"last 2 versions",
|
|
81
|
+
"not dead"
|
|
82
|
+
]
|
|
81
83
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><style>svg{fill:#6D90B4}</style><path d="M256 0a256 256 0 1 1 0 512A256 256 0 1 1 256 0zM232 120V256c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2V120c0-13.3-10.7-24-24-24s-24 10.7-24 24z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><style>svg{fill:#6d90b4}</style><path d="M304 128a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zM96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM49.3 464H398.7c-8.9-63.3-63.3-112-129-112H178.3c-65.7 0-120.1 48.7-129 112zM0 482.3C0 383.8 79.8 304 178.3 304h91.4C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7H29.7C13.3 512 0 498.7 0 482.3z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><style>svg{fill:#fff}</style><path d="M304 128a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zM96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM49.3 464H398.7c-8.9-63.3-63.3-112-129-112H178.3c-65.7 0-120.1 48.7-129 112zM0 482.3C0 383.8 79.8 304 178.3 304h91.4C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7H29.7C13.3 512 0 498.7 0 482.3z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><style>svg{fill:#6d90b4}</style><path d="M304 128a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zM96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM49.3 464H398.7c-8.9-63.3-63.3-112-129-112H178.3c-65.7 0-120.1 48.7-129 112zM0 482.3C0 383.8 79.8 304 178.3 304h91.4C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7H29.7C13.3 512 0 498.7 0 482.3z"/></svg>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
2
|
+
|
|
3
|
+
<svg width="800px" height="800px" viewBox="0 0 28 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" fill="#000000">
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><style>svg{fill:#ffeab2}</style><path d="M159.3 5.4c7.8-7.3 19.9-7.2 27.7 .1c27.6 25.9 53.5 53.8 77.7 84c11-14.4 23.5-30.1 37-42.9c7.9-7.4 20.1-7.4 28 .1c34.6 33 63.9 76.6 84.5 118c20.3 40.8 33.8 82.5 33.8 111.9C448 404.2 348.2 512 224 512C98.4 512 0 404.1 0 276.5c0-38.4 17.8-85.3 45.4-131.7C73.3 97.7 112.7 48.6 159.3 5.4zM225.7 416c25.3 0 47.7-7 68.8-21c42.1-29.4 53.4-88.2 28.1-134.4c-4.5-9-16-9.6-22.5-2l-25.2 29.3c-6.6 7.6-18.5 7.4-24.7-.5c-16.5-21-46-58.5-62.8-79.8c-6.3-8-18.3-8.1-24.7-.1c-33.8 42.5-50.8 69.3-50.8 99.4C112 375.4 162.6 416 225.7 416z"/></svg>
|
|
@@ -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: {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
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>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
name: 'ToggleCalculateBadge',
|
|
15
|
+
props: {
|
|
16
|
+
label: {
|
|
17
|
+
type:String,
|
|
18
|
+
default: ''
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="['toggle-podium-badge', position]">
|
|
3
|
+
<div class="podium-number">{{ podiumNum }}</div>
|
|
4
|
+
<slot></slot>
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
name: 'TogglePodiumBadge',
|
|
12
|
+
props: {
|
|
13
|
+
position:{
|
|
14
|
+
type:String
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
computed: {
|
|
18
|
+
podiumNum(){
|
|
19
|
+
switch (this.position) {
|
|
20
|
+
case 'first':
|
|
21
|
+
return 1;
|
|
22
|
+
case 'second':
|
|
23
|
+
return 2;
|
|
24
|
+
case 'third':
|
|
25
|
+
return 3;
|
|
26
|
+
default:
|
|
27
|
+
return 1;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
</script>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button :class="['toggle-metrics-button', buttonStyle]" @click="click">
|
|
3
|
+
<div :class="icon"></div>
|
|
4
|
+
<slot>{{buttonText}}</slot>
|
|
5
|
+
</button>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
export default {
|
|
10
|
+
name: 'ToggleMetricButton',
|
|
11
|
+
props: {
|
|
12
|
+
buttonStyle: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: "Metrics"
|
|
15
|
+
},
|
|
16
|
+
buttonText: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: "Metrics text"
|
|
19
|
+
},
|
|
20
|
+
icon: {
|
|
21
|
+
type: String,
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
methods: {
|
|
26
|
+
click() {
|
|
27
|
+
/**
|
|
28
|
+
* Emitted when the button is clicked.
|
|
29
|
+
* @event click
|
|
30
|
+
* @type {Event}
|
|
31
|
+
*/
|
|
32
|
+
this.$emit('click');
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
</script>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="toggle-email-card">
|
|
3
|
+
<div class="toggle-email-card-body">
|
|
4
|
+
<div class="toggle-email-card-htmlContent">
|
|
5
|
+
<div v-html="htmlContent"></div>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="toggle-email-card-buttons">
|
|
8
|
+
<button class="toggle-email-card-button">
|
|
9
|
+
<slot name="button_1"></slot>
|
|
10
|
+
</button>
|
|
11
|
+
<button class="toggle-email-card-button">
|
|
12
|
+
<slot name="button_2"></slot>
|
|
13
|
+
</button>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="toggle-email-card-info">
|
|
16
|
+
<p>Email name</p>
|
|
17
|
+
<div class="toggle-email-card-slot">
|
|
18
|
+
<slot name="toggle-email-card-email-name">{{ emailName }}</slot>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="toggle-email-card-info">
|
|
22
|
+
<p>Subject line</p>
|
|
23
|
+
<div class="toggle-email-card-slot">
|
|
24
|
+
<slot name="email-subject">{{ emailSubject }}</slot>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script>
|
|
32
|
+
export default {
|
|
33
|
+
props: {
|
|
34
|
+
emailName: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: 'Email name'
|
|
37
|
+
},
|
|
38
|
+
emailSubject: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: 'Subject line'
|
|
41
|
+
},
|
|
42
|
+
htmlContent: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: null
|
|
45
|
+
},
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="toggle-rewards-card-reward-card">
|
|
3
|
+
<div class="toggle-rewards-card-reward-info" :style="{ backgroundColor: cardColor[0]}">
|
|
4
|
+
<div class="toggle-rewards-card-card-header">
|
|
5
|
+
<slot name="toggle-rewards-card-header">{{ reward }}</slot>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="toggle-rewards-card-card-body">
|
|
8
|
+
<p class="toggle-rewards-card-body-header">Overall reward performance</p>
|
|
9
|
+
<div class="toggle-rewards-card-body-stats">
|
|
10
|
+
<div class="toggle-rewards-card-metrics">
|
|
11
|
+
<p>Claimed</p>
|
|
12
|
+
<slot name="toggle-rewards-card-claimed">{{ claimed }}</slot>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="toggle-rewards-card-metrics">
|
|
15
|
+
<p>Redeemed</p>
|
|
16
|
+
<slot name="toggle-rewards-card-redeemed"> {{ redeemed }}</slot>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="toggle-rewards-card-reward-redemption" :style="{ backgroundColor: cardColor[1]}">
|
|
22
|
+
<div class="toggle-rewards-card-percentage">{{ redemptionRate }}</div>
|
|
23
|
+
<p>Redemption rate</p>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
<script>
|
|
28
|
+
export default {
|
|
29
|
+
props: {
|
|
30
|
+
cardIndex: {
|
|
31
|
+
type: Number,
|
|
32
|
+
required: true,
|
|
33
|
+
},
|
|
34
|
+
totalCards: {
|
|
35
|
+
type: Number,
|
|
36
|
+
required: true,
|
|
37
|
+
},
|
|
38
|
+
reward: {
|
|
39
|
+
type: String,
|
|
40
|
+
required: true
|
|
41
|
+
},
|
|
42
|
+
redeemed: {
|
|
43
|
+
type: Number,
|
|
44
|
+
required: true
|
|
45
|
+
},
|
|
46
|
+
claimed: {
|
|
47
|
+
type: Number,
|
|
48
|
+
required: true
|
|
49
|
+
},
|
|
50
|
+
redemptionRate: {
|
|
51
|
+
type: [String, Number],
|
|
52
|
+
required: true
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
computed: {
|
|
56
|
+
cardColor() {
|
|
57
|
+
// adjust colour palette below to change the Reward Cards colors
|
|
58
|
+
const colorPalette = [
|
|
59
|
+
[ '#eac6c7', '#b16f6f' ], // Pinks
|
|
60
|
+
[ '#9AB7D3', '#6b8093' ], // Blues
|
|
61
|
+
[ '#BDD0C4', '#849189' ], // Greens
|
|
62
|
+
[ '#eccb92', '#ce9847' ], // Yellows
|
|
63
|
+
[ '#DFCCF1', '#9c8ea8' ], // Purple
|
|
64
|
+
];
|
|
65
|
+
// pick random number to return random index of colourPalette
|
|
66
|
+
const paletteIndex = Math.floor(
|
|
67
|
+
(this.cardIndex / this.totalCards) * colorPalette.length
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
return colorPalette[paletteIndex];
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
</script>
|
|
75
|
+
|
|
76
|
+
<style scoped>
|
|
77
|
+
|
|
78
|
+
</style>
|
|
79
|
+
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<swiper
|
|
3
|
+
ref="swiper"
|
|
4
|
+
class="swiper toggle-carousel"
|
|
5
|
+
:class="[
|
|
6
|
+
carouselStyle == 'voucher' && slidesLength > 1 ? 'toggle-carousel--voucher' : '',
|
|
7
|
+
carouselStyle == 'voucher' && isEnd && slidesLength > 1 ? 'toggle-carousel--voucher-end' : ''
|
|
8
|
+
]"
|
|
9
|
+
:options="carouselOptions"
|
|
10
|
+
@slideChangeTransitionStart="onSlideTransition"
|
|
11
|
+
>
|
|
12
|
+
<slot></slot>
|
|
13
|
+
<div v-if="carouselPrev && slidesLength > 1"
|
|
14
|
+
class="toggle-carousel-button toggle-carousel-button--prev"
|
|
15
|
+
:class="['toggle-carousel-button--' + carouselNavPosition, {'toggle-carousel-button--disabled': prevDisabled}]"
|
|
16
|
+
@click="slidePrev"
|
|
17
|
+
slot="button-prev"
|
|
18
|
+
></div>
|
|
19
|
+
<div v-if="carouselNext && slidesLength > 1"
|
|
20
|
+
class="toggle-carousel-button toggle-carousel-button--next"
|
|
21
|
+
:class="['toggle-carousel-button--' + carouselNavPosition, {'toggle-carousel-button--disabled': nextDisabled}]"
|
|
22
|
+
@click="$refs.swiper.swiperInstance.slideNext()"
|
|
23
|
+
slot="button-next"
|
|
24
|
+
></div>
|
|
25
|
+
</swiper>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
|
|
30
|
+
import { Swiper, directive } from 'vue-awesome-swiper'
|
|
31
|
+
import 'swiper/swiper.css'
|
|
32
|
+
import 'swiper/modules/navigation.css'
|
|
33
|
+
|
|
34
|
+
export default {
|
|
35
|
+
name: 'ToggleCarousel',
|
|
36
|
+
data: function() {
|
|
37
|
+
return {
|
|
38
|
+
prevDisabled: false,
|
|
39
|
+
nextDisabled: false,
|
|
40
|
+
slidesLength: 0,
|
|
41
|
+
isEnd: false
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
props: {
|
|
45
|
+
carouselStyle:{
|
|
46
|
+
type: String,
|
|
47
|
+
default: 'default'
|
|
48
|
+
},
|
|
49
|
+
carouselNavPosition: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: 'middle',
|
|
52
|
+
validator(value) {
|
|
53
|
+
return ['top', 'middle', 'bottom'].includes(value)
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
carouselPrev: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: true
|
|
59
|
+
},
|
|
60
|
+
carouselNext: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: true
|
|
63
|
+
},
|
|
64
|
+
carouselOptions: {
|
|
65
|
+
type: Object,
|
|
66
|
+
required: false,
|
|
67
|
+
default: () => {
|
|
68
|
+
return {
|
|
69
|
+
slidesPerView: 'auto',
|
|
70
|
+
spaceBetween: 50,
|
|
71
|
+
navigation: {
|
|
72
|
+
nextButton: ".toggle-carousel-button--next",
|
|
73
|
+
prevButton: ".toggle-carousel-button--prev"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
components: {
|
|
80
|
+
Swiper
|
|
81
|
+
},
|
|
82
|
+
directives: {
|
|
83
|
+
swiper: directive
|
|
84
|
+
},
|
|
85
|
+
mounted(){
|
|
86
|
+
this.refreshCarousel();
|
|
87
|
+
},
|
|
88
|
+
updated() {
|
|
89
|
+
this.refreshCarousel();
|
|
90
|
+
},
|
|
91
|
+
methods: {
|
|
92
|
+
slidePrev(){
|
|
93
|
+
if(this.carouselStyle == 'voucher' && this.isEnd){
|
|
94
|
+
this.$refs.swiper.swiperInstance.slideTo(0);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
this.$refs.swiper.swiperInstance.slidePrev();
|
|
98
|
+
},
|
|
99
|
+
refreshCarousel(){
|
|
100
|
+
this.slidesLength = this.$refs.swiper.swiperInstance.slides.length;
|
|
101
|
+
this.onSlideTransition();
|
|
102
|
+
},
|
|
103
|
+
onSlideTransition(){
|
|
104
|
+
// if loop is enabled, don't disable buttons, unless specified in prop
|
|
105
|
+
const isLoop = this.$refs.swiper.swiperInstance.params.loop;
|
|
106
|
+
if(isLoop) return;
|
|
107
|
+
|
|
108
|
+
const isBeginning = this.$refs.swiper.swiperInstance.isBeginning;
|
|
109
|
+
this.isEnd = this.$refs.swiper.swiperInstance.isEnd;
|
|
110
|
+
|
|
111
|
+
if(isBeginning){
|
|
112
|
+
this.prevDisabled = true;
|
|
113
|
+
this.nextDisabled = false;
|
|
114
|
+
}
|
|
115
|
+
else if(this.isEnd){
|
|
116
|
+
this.prevDisabled = false;
|
|
117
|
+
this.nextDisabled = true;
|
|
118
|
+
}
|
|
119
|
+
else if(this.carouselStyle != 'voucher'){
|
|
120
|
+
this.prevDisabled = false;
|
|
121
|
+
this.nextDisabled = false;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
</script>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<swiper-slide class="toggle-carousel-slide" :style="'width:' + slideWidth + '; height:' + slideHeight">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
</swiper-slide>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import { SwiperSlide } from 'vue-awesome-swiper'
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
name: 'ToggleCarouselSlide',
|
|
12
|
+
components: {
|
|
13
|
+
SwiperSlide
|
|
14
|
+
},
|
|
15
|
+
props: {
|
|
16
|
+
slideWidth:{
|
|
17
|
+
type: String,
|
|
18
|
+
default: '100%'
|
|
19
|
+
},
|
|
20
|
+
slideHeight:{
|
|
21
|
+
type: String,
|
|
22
|
+
default: 'auto'
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
</script>
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
|
|
4
4
|
<div class="funnel-grid-svg"></div>
|
|
5
5
|
|
|
6
|
-
<div class="funnel-spark-line funnel-grid-1">
|
|
7
|
-
<slot name="sparkLine1"></slot>
|
|
6
|
+
<div :class="{'funnel-spark-line funnel-grid-1': true, 'increase-padding-bottom': noSparkLine}">
|
|
7
|
+
<slot :name="emailInsight ? 'metric1' : 'sparkLine1'"></slot>
|
|
8
8
|
</div>
|
|
9
|
-
<div class="funnel-spark-line funnel-grid-2">
|
|
10
|
-
<slot name="sparkLine2"></slot>
|
|
9
|
+
<div :class="{'funnel-spark-line funnel-grid-2': true, 'increase-padding-bottom': noSparkLine}">
|
|
10
|
+
<slot :name="emailInsight ? 'metric2' : 'sparkLine2'"></slot>
|
|
11
11
|
</div>
|
|
12
|
-
<div class="funnel-spark-line funnel-grid-3">
|
|
13
|
-
<slot name="sparkLine3"></slot>
|
|
12
|
+
<div :class="{'funnel-spark-line funnel-grid-3': true, 'increase-padding-bottom': noSparkLine}">
|
|
13
|
+
<slot :name="emailInsight ? 'metric3' : 'sparkLine3'"></slot>
|
|
14
14
|
</div>
|
|
15
|
-
<div class="funnel-spark-line funnel-grid-4">
|
|
16
|
-
<slot name="sparkLine4"></slot>
|
|
15
|
+
<div :class="{'funnel-spark-line funnel-grid-4': true, 'increase-padding-bottom': noSparkLine}">
|
|
16
|
+
<slot :name="emailInsight ? 'metric4' : 'sparkLine4'"></slot>
|
|
17
17
|
</div>
|
|
18
18
|
|
|
19
19
|
<div class="funnel-single-metric funnel-grid-5">
|
|
@@ -56,6 +56,25 @@ export default {
|
|
|
56
56
|
name: {
|
|
57
57
|
type: String,
|
|
58
58
|
default: "ToggleMetricFunnelChart"
|
|
59
|
+
},
|
|
60
|
+
/**
|
|
61
|
+
* If no SparkLine components are used in funnel
|
|
62
|
+
* set to true to increase distance between
|
|
63
|
+
* funnel and metrics
|
|
64
|
+
*/
|
|
65
|
+
noSparkLine: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: false
|
|
68
|
+
},
|
|
69
|
+
/**
|
|
70
|
+
* If funnel is used without SparkLine,
|
|
71
|
+
* set prop to true
|
|
72
|
+
* and name slots metric1, metric2 etc
|
|
73
|
+
* for more generic use
|
|
74
|
+
*/
|
|
75
|
+
emailInsight: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: false
|
|
59
78
|
}
|
|
60
79
|
}
|
|
61
80
|
}
|