toggle-components-library 1.31.0 → 1.32.0-beta.1
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 +4982 -90
- 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 +4982 -90
- 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/ToggleCalculateBadge.vue +13 -0
- package/src/components/badges/TogglePodiumBadge.vue +32 -0
- package/src/components/buttons/ToggleMetricsButton.vue +36 -0
- package/src/components/cards/ToggleRewardsCard.vue +80 -0
- package/src/components/carousel/ToggleCarousel.vue +94 -0
- package/src/components/carousel/ToggleCarouselSlide.vue +26 -0
- package/src/components/forms/ToggleInputCrudField.vue +6 -1
- package/src/components/metrics/ToggleMetricFunnelChart.vue +27 -8
- package/src/components/metrics/ToggleMetricSingleMetric.vue +15 -2
- package/src/index.js +6 -1
- package/src/sass/includes/_as_badges.scss +78 -0
- package/src/sass/includes/_as_buttons.scss +99 -1
- package/src/sass/includes/_as_cards.scss +103 -0
- package/src/sass/includes/_as_carousels.scss +83 -0
- package/src/sass/includes/_as_inputs.scss +7 -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.32.0-beta.1",
|
|
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.32.0-beta.1",
|
|
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>
|
|
@@ -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,80 @@
|
|
|
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 voucher 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">{{ redepmtionRate }}%</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
|
+
},
|
|
51
|
+
computed: {
|
|
52
|
+
redepmtionRate(){
|
|
53
|
+
let rate = (Number(this.redeemed)*100)/Number(this.claimed);
|
|
54
|
+
return rate;
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
cardColor() {
|
|
58
|
+
// adjust colour palette below to change the Reward Cards colors
|
|
59
|
+
const colorPalette = [
|
|
60
|
+
[ '#eac6c7', '#b16f6f' ], // Pinks
|
|
61
|
+
[ '#9AB7D3', '#6b8093' ], // Blues
|
|
62
|
+
[ '#BDD0C4', '#849189' ], // Greens
|
|
63
|
+
[ '#eccb92', '#ce9847' ], // Yellows
|
|
64
|
+
[ '#DFCCF1', '#9c8ea8' ], // Purple
|
|
65
|
+
];
|
|
66
|
+
// pick random number to return random index of colourPalette
|
|
67
|
+
const paletteIndex = Math.floor(
|
|
68
|
+
(this.cardIndex / this.totalCards) * colorPalette.length
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
return colorPalette[paletteIndex];
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
</script>
|
|
76
|
+
|
|
77
|
+
<style scoped>
|
|
78
|
+
|
|
79
|
+
</style>
|
|
80
|
+
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<swiper
|
|
3
|
+
ref="swiper"
|
|
4
|
+
class="swiper toggle-carousel"
|
|
5
|
+
:class="carouselStyle == 'voucher' ? 'toggle-carousel--voucher' : ''"
|
|
6
|
+
:options="carouselOptions"
|
|
7
|
+
@slideChangeTransitionStart="onSlideTransition"
|
|
8
|
+
>
|
|
9
|
+
<slot></slot>
|
|
10
|
+
<div v-if="carouselNavigation" class="toggle-carousel-button toggle-carousel-button--prev"
|
|
11
|
+
:class="{'toggle-carousel-button--disabled': prevDisabled}"
|
|
12
|
+
@click="$refs.swiper.swiperInstance.slidePrev()"
|
|
13
|
+
slot="button-prev"
|
|
14
|
+
></div>
|
|
15
|
+
<div v-if="carouselNavigation" class="toggle-carousel-button toggle-carousel-button--next"
|
|
16
|
+
:class="{'toggle-carousel-button--disabled': nextDisabled}"
|
|
17
|
+
@click="$refs.swiper.swiperInstance.slideNext()"
|
|
18
|
+
slot="button-next"
|
|
19
|
+
></div>
|
|
20
|
+
</swiper>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script>
|
|
24
|
+
|
|
25
|
+
import { Swiper, directive } from 'vue-awesome-swiper'
|
|
26
|
+
import 'swiper/swiper.css'
|
|
27
|
+
import 'swiper/modules/navigation.css'
|
|
28
|
+
|
|
29
|
+
export default {
|
|
30
|
+
name: 'ToggleCarousel',
|
|
31
|
+
data: function() {
|
|
32
|
+
return {
|
|
33
|
+
prevDisabled: false,
|
|
34
|
+
nextDisabled: false,
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
props: {
|
|
38
|
+
carouselStyle:{
|
|
39
|
+
type: String,
|
|
40
|
+
default: 'default'
|
|
41
|
+
},
|
|
42
|
+
carouselNavigation: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: true
|
|
45
|
+
},
|
|
46
|
+
carouselOptions: {
|
|
47
|
+
type: Object,
|
|
48
|
+
required: false,
|
|
49
|
+
default: () => {
|
|
50
|
+
return {
|
|
51
|
+
slidesPerView: 'auto',
|
|
52
|
+
spaceBetween: 50,
|
|
53
|
+
navigation: {
|
|
54
|
+
nextButton: ".toggle-carousel-button--next",
|
|
55
|
+
prevButton: ".toggle-carousel-button--prev"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
components: {
|
|
62
|
+
Swiper
|
|
63
|
+
},
|
|
64
|
+
directives: {
|
|
65
|
+
swiper: directive
|
|
66
|
+
},
|
|
67
|
+
mounted() {
|
|
68
|
+
this.onSlideTransition();
|
|
69
|
+
},
|
|
70
|
+
methods: {
|
|
71
|
+
onSlideTransition(){
|
|
72
|
+
// if loop is enabled, don't disable buttons
|
|
73
|
+
const isLoop = this.$refs.swiper.swiperInstance.params.loop;
|
|
74
|
+
if(isLoop) return;
|
|
75
|
+
|
|
76
|
+
const isBeginning = this.$refs.swiper.swiperInstance.isBeginning;
|
|
77
|
+
const isEnd = this.$refs.swiper.swiperInstance.isEnd;
|
|
78
|
+
|
|
79
|
+
if(isBeginning){
|
|
80
|
+
this.prevDisabled = true;
|
|
81
|
+
this.nextDisabled = false;
|
|
82
|
+
}
|
|
83
|
+
else if(isEnd){
|
|
84
|
+
this.prevDisabled = false;
|
|
85
|
+
this.nextDisabled = true;
|
|
86
|
+
}
|
|
87
|
+
else{
|
|
88
|
+
this.prevDisabled = false;
|
|
89
|
+
this.nextDisabled = false;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
</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>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
> {{ label }}
|
|
14
14
|
</button>
|
|
15
15
|
<label
|
|
16
|
-
class="toggle-input-crud-container-description"
|
|
16
|
+
:class="['toggle-input-crud-container-description', {'hide-overflow':hideDescriptionOverflow}]"
|
|
17
17
|
> {{ description ? description : ' ' }}
|
|
18
18
|
</label>
|
|
19
19
|
|
|
@@ -65,7 +65,12 @@ export default {
|
|
|
65
65
|
empty:{
|
|
66
66
|
type: Boolean,
|
|
67
67
|
default: false
|
|
68
|
+
},
|
|
69
|
+
hideDescriptionOverflow:{
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: false
|
|
68
72
|
}
|
|
73
|
+
|
|
69
74
|
},
|
|
70
75
|
|
|
71
76
|
created : function(){
|
|
@@ -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
|
}
|
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<h3 class="toggle-metric metric-label">{{label}}</h3>
|
|
4
|
-
<
|
|
4
|
+
<ToggleCalculateBadge v-if="pendingBadge && label.length" class="single-metric-badge"> 14 days until spend is calculated</ToggleCalculateBadge>
|
|
5
|
+
<div class="single-metric-icon" v-else-if="pendingBadge && label.length == 0"></div>
|
|
6
|
+
<h1 class="toggle-metric metric-value" v-else>{{metricValue}}</h1>
|
|
5
7
|
</div>
|
|
6
8
|
</template>
|
|
7
9
|
|
|
8
10
|
<script>
|
|
9
11
|
|
|
10
|
-
import { mixins } from '../mixins/mixins'
|
|
12
|
+
import { mixins } from '../mixins/mixins';
|
|
13
|
+
import ToggleCalculateBadge from '../badges/ToggleCalculateBadge.vue';
|
|
11
14
|
|
|
12
15
|
|
|
13
16
|
export default {
|
|
14
17
|
mixins:[mixins],
|
|
18
|
+
components: {
|
|
19
|
+
ToggleCalculateBadge,
|
|
20
|
+
},
|
|
15
21
|
props: {
|
|
16
22
|
/**
|
|
17
23
|
* Component's name
|
|
@@ -63,6 +69,13 @@ export default {
|
|
|
63
69
|
currencyDenomination: {
|
|
64
70
|
type: Number,
|
|
65
71
|
default: 1
|
|
72
|
+
},
|
|
73
|
+
/**
|
|
74
|
+
* Displays badge or clock if metrics are still pending
|
|
75
|
+
*/
|
|
76
|
+
pendingBadge: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: false
|
|
66
79
|
}
|
|
67
80
|
},
|
|
68
81
|
computed: {
|
package/src/index.js
CHANGED
|
@@ -80,6 +80,9 @@ import ToggleMetricFunnelChart from "./components/metrics/ToggleMetricFunnelChar
|
|
|
80
80
|
import ToggleThreeDots from "./components/threedots/ToggleThreeDots.vue";
|
|
81
81
|
import ToggleThreeDotsButton from "./components/threedots/ToggleThreeDotsButton.vue";
|
|
82
82
|
|
|
83
|
+
import ToggleCarousel from "./components/carousel/ToggleCarousel.vue";
|
|
84
|
+
import ToggleCarouselSlide from "./components/carousel/ToggleCarouselSlide.vue";
|
|
85
|
+
|
|
83
86
|
|
|
84
87
|
import './sass/main.scss';
|
|
85
88
|
|
|
@@ -145,7 +148,9 @@ const Components = {
|
|
|
145
148
|
ToggleBoosterButton,
|
|
146
149
|
ToggleBoosterBasicButton,
|
|
147
150
|
ToggleBoosterModal,
|
|
148
|
-
ToggleContactSearch
|
|
151
|
+
ToggleContactSearch,
|
|
152
|
+
ToggleCarousel,
|
|
153
|
+
ToggleCarouselSlide
|
|
149
154
|
}
|
|
150
155
|
|
|
151
156
|
Object.keys(Components).forEach(name => {
|