toggle-components-library 1.36.1-beta.5 → 1.36.1-beta.6

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.
Files changed (32) hide show
  1. package/dist/img/contacts-greyblue.ef6f8a9a.svg +1 -0
  2. package/dist/img/contacts-white.95d07c7a.svg +1 -0
  3. package/dist/toggle-components-library.common.js +235 -233
  4. package/dist/toggle-components-library.common.js.map +1 -1
  5. package/dist/toggle-components-library.css +1 -1
  6. package/dist/toggle-components-library.umd.js +235 -233
  7. package/dist/toggle-components-library.umd.js.map +1 -1
  8. package/dist/toggle-components-library.umd.min.js +1 -1
  9. package/dist/toggle-components-library.umd.min.js.map +1 -1
  10. package/package.json +1 -1
  11. package/src/components/buttons/ToggleMetricsButton.vue +3 -22
  12. package/src/components/carousel/ToggleCarousel.vue +14 -20
  13. package/src/components/carousel/ToggleCarouselSlide.vue +1 -1
  14. package/src/components/forms/ToggleDatePicker.vue +7 -3
  15. package/src/components/forms/ToggleInputCurrency.vue +8 -3
  16. package/src/components/metrics/ToggleMetricSingleMetric.vue +7 -12
  17. package/src/components/metrics/ToggleMetricSparkLine.vue +2 -2
  18. package/src/components/statusbar/ToggleStatusBar.vue +73 -0
  19. package/src/index.js +4 -3
  20. package/src/sass/includes/_as_buttons.scss +4 -47
  21. package/src/sass/includes/_as_cards.scss +0 -33
  22. package/src/sass/includes/_as_carousels.scss +0 -12
  23. package/src/sass/includes/_as_inputs.scss +5 -0
  24. package/src/sass/includes/_as_metrics.scss +0 -5
  25. package/src/sass/includes/_as_navs.scss +2 -18
  26. package/src/sass/includes/_as_statusbar.scss +179 -0
  27. package/src/sass/main.scss +1 -0
  28. package/dist/img/airship-feedback-hover.a207c947.svg +0 -10
  29. package/dist/img/airship-feedback.1f7c858c.svg +0 -10
  30. package/src/assets/icons/airship-feedback-hover.svg +0 -10
  31. package/src/assets/icons/airship-feedback.svg +0 -10
  32. package/src/components/cards/ToggleCommentCard.vue +0 -56
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toggle-components-library",
3
- "version": "1.36.1-beta.5",
3
+ "version": "1.36.1-beta.6",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -1,6 +1,6 @@
1
1
  <template>
2
- <button :class="['toggle-metrics-button', buttonStyle, 'toggle-metrics-button-' + size, {'toggle-metrics-button-disabled': disabled }]" :style="styles" @click="click" :disabled="disabled">
3
- <div :class="icon" :style="styles ? 'background-color:' + styles.color : ''"></div>
2
+ <button :class="['toggle-metrics-button', buttonStyle]" @click="click">
3
+ <div :class="icon"></div>
4
4
  <slot>{{buttonText}}</slot>
5
5
  </button>
6
6
  </template>
@@ -19,27 +19,8 @@
19
19
  },
20
20
  icon: {
21
21
  type: String,
22
- required: false,
23
- validator: function(value) {
24
- return ["heatmap-icon", "email-icon", "contacts-icon"].indexOf(value) !== -1;
25
- }
22
+ required: true,
26
23
  },
27
- size: {
28
- type: String,
29
- default: "medium",
30
- required: false,
31
- validator: function(value) {
32
- return ["small", "medium", "large"].indexOf(value) !== -1;
33
- }
34
- },
35
- styles: {
36
- type: Object,
37
- required: false,
38
- },
39
- disabled: {
40
- type: Boolean,
41
- default: false
42
- }
43
24
  },
44
25
  methods: {
45
26
  click() {
@@ -1,34 +1,28 @@
1
1
  <template>
2
- <div class="toggle-carousel-wrapper">
3
- <swiper
4
- ref="swiper"
5
- class="swiper toggle-carousel"
6
- :class="[
7
- carouselStyle == 'voucher' && slidesLength > 1 ? 'toggle-carousel--voucher' : '',
8
- carouselStyle == 'voucher' && isEnd && slidesLength > 1 ? 'toggle-carousel--voucher-end' : ''
9
- ]"
10
- :options="carouselOptions"
11
- @slideChangeTransitionStart="onSlideTransition"
12
- >
13
- <slot></slot>
14
- </swiper>
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>
15
13
  <div v-if="carouselPrev && slidesLength > 1"
16
14
  class="toggle-carousel-button toggle-carousel-button--prev"
17
- :class="['toggle-carousel-button--' + carouselNavPosition,
18
- {'toggle-carousel-button--disabled': prevDisabled},
19
- {'toggle-carousel-button--comments-left-arrow': carouselStyle == 'comments'}]"
15
+ :class="['toggle-carousel-button--' + carouselNavPosition, {'toggle-carousel-button--disabled': prevDisabled}]"
20
16
  @click="slidePrev"
21
17
  slot="button-prev"
22
18
  ></div>
23
19
  <div v-if="carouselNext && slidesLength > 1"
24
20
  class="toggle-carousel-button toggle-carousel-button--next"
25
- :class="['toggle-carousel-button--' + carouselNavPosition,
26
- {'toggle-carousel-button--disabled': nextDisabled},
27
- {'toggle-carousel-button--comments-right-arrow': carouselStyle == 'comments'}]"
21
+ :class="['toggle-carousel-button--' + carouselNavPosition, {'toggle-carousel-button--disabled': nextDisabled}]"
28
22
  @click="$refs.swiper.swiperInstance.slideNext()"
29
23
  slot="button-next"
30
24
  ></div>
31
- </div>
25
+ </swiper>
32
26
  </template>
33
27
 
34
28
  <script>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <swiper-slide class="toggle-carousel-slide">
2
+ <swiper-slide class="toggle-carousel-slide" :style="'width:' + slideWidth + '; height:' + slideHeight">
3
3
  <slot></slot>
4
4
  </swiper-slide>
5
5
  </template>
@@ -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,7 @@
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
  <label
8
8
  v-if="label"
9
9
  :for="name ? name : 'InputText' "
@@ -16,6 +16,7 @@
16
16
  :placeholder="placeholder ? placeholder : '' "
17
17
  :autocomplete="autocomplete ? 'on' : 'off' "
18
18
  :required="required"
19
+ :disabled="disabled"
19
20
  v-model="inputVal"
20
21
  @blur="isInputActive = false"
21
22
  @focus="isInputActive = true"
@@ -91,8 +92,12 @@ export default {
91
92
  currencyDenomination: {
92
93
  type: Number,
93
94
  default: 100
94
- }
95
-
95
+ },
96
+ disabled: {
97
+ type: Boolean,
98
+ required: false,
99
+ default: false
100
+ },
96
101
  },
97
102
 
98
103
  created : function(){
@@ -2,9 +2,7 @@
2
2
  <div>
3
3
  <h3 class="toggle-metric metric-label">{{label}}</h3>
4
4
  <div class="single-metric-icon" v-if="metricPending && label.length == 0"></div>
5
- <h1 class="toggle-metric metric-value" v-else>{{metricValue}}
6
- <span v-if="score && value.maxScore" class="toggle-metric-score-rating">/{{value.maxScore}}</span>
7
- </h1>
5
+ <h1 class="toggle-metric metric-value" v-else>{{metricValue}}</h1>
8
6
  </div>
9
7
  </template>
10
8
 
@@ -23,20 +21,20 @@ export default {
23
21
  type: String,
24
22
  default: "ToggleMetricSingleMetric"
25
23
  },
26
- /**
24
+ /**
27
25
  * Type of the value, this will affect on the format shown
28
26
  */
29
27
  type : {
30
28
  type: String,
31
29
  validator: function (value) {
32
- return ['text', 'number', 'percentage', 'currency', 'score'].indexOf(value) !== -1
30
+ return ['text', 'number', 'percentage', 'currency'].indexOf(value) !== -1
33
31
  }
34
32
  },
35
33
  /**
36
34
  * Component's value
37
35
  */
38
36
  value: {
39
- type: [String, Number, Object],
37
+ type: [String, Number],
40
38
  required: true
41
39
  },
42
40
  /**
@@ -89,17 +87,14 @@ export default {
89
87
  case 'currency':
90
88
  return (this.value/this.currencyDenomination).toLocaleString(this.currencyLocale, {style: 'currency', currency: this.currencyCode});
91
89
  case'percentage':
92
- return `${this.value} %`;
93
- case 'score':
94
- return this.value.score;
90
+ return `${this.value} %`
95
91
  default:
96
92
  return this.value.toLocaleString();
97
93
 
98
94
  }
99
- },
100
- score() {
101
- return this.type === 'score';
102
95
  }
96
+
97
+
103
98
  }
104
99
  }
105
100
 
@@ -54,14 +54,14 @@ export default {
54
54
  type : {
55
55
  type: String,
56
56
  validator: function (value) {
57
- return ['text', 'number', 'percentage', 'currency', 'score'].indexOf(value) !== -1
57
+ return ['text', 'number', 'percentage', 'currency'].indexOf(value) !== -1
58
58
  }
59
59
  },
60
60
  /**
61
61
  * single metric component value
62
62
  */
63
63
  singleMetricVal: {
64
- type: [String, Number, Object],
64
+ type: [String, Number],
65
65
  required: true
66
66
  },
67
67
  /**
@@ -0,0 +1,73 @@
1
+ <template>
2
+ <div :class="['toggle-status-bar-container', statusColours, statusSize]">
3
+ <label class="toggle-status-bar-label">
4
+ <span class="toggle-status-bar-dot blinking" v-if="showDot">&#9679;</span>
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
+ validator: function (value) {
32
+ return ['small'].indexOf(value) !== -1;
33
+ }
34
+ },
35
+ toolTipOptions: {
36
+ type: Object,
37
+ required: false
38
+ }
39
+ },
40
+ computed: {
41
+ // Capitalise the first letter of the status
42
+ statusName() {
43
+ return this.status.charAt(0).toUpperCase() + this.status.slice(1);
44
+ },
45
+ // Add the status to the class name
46
+ statusColours() {
47
+ return 'toggle-status-bar-' + this.status;
48
+ },
49
+ // Add the size to the class name
50
+ statusSize() {
51
+ return 'toggle-status-bar-' + this.size;
52
+ },
53
+ // Show the dot if the status is active or processing
54
+ showDot() {
55
+ return this.status === 'active' || this.status === 'processing' || this.status === 'submitted';
56
+ },
57
+ showToolTip() {
58
+ return this.size !== 'small';
59
+ },
60
+ toolTipText() {
61
+ if (!this.toolTipOptions) {
62
+ return '';
63
+ }
64
+
65
+ if (this.toolTipOptions[this.status]) {
66
+ return this.toolTipOptions[this.status];
67
+ } else {
68
+ return '';
69
+ }
70
+ }
71
+ }
72
+ }
73
+ </script>
package/src/index.js CHANGED
@@ -83,12 +83,13 @@ 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
 
89
91
  import ToggleEmailCard from "./components/cards/ToggleEmailCard.vue";
90
92
  import ToggleRewardsCard from "./components/cards/ToggleRewardsCard.vue";
91
- import ToggleCommentCard from "./components/cards/ToggleCommentCard.vue";
92
93
 
93
94
 
94
95
  import './sass/main.scss';
@@ -159,11 +160,11 @@ const Components = {
159
160
  ToggleBoosterBasicButton,
160
161
  ToggleBoosterModal,
161
162
  ToggleContactSearch,
163
+ ToggleStatusBar,
162
164
  ToggleCarousel,
163
165
  ToggleCarouselSlide,
164
166
  ToggleEmailCard,
165
- ToggleRewardsCard,
166
- ToggleCommentCard
167
+ ToggleRewardsCard
167
168
  }
168
169
 
169
170
  Object.keys(Components).forEach(name => {
@@ -395,7 +395,7 @@
395
395
  }
396
396
 
397
397
  &:hover .contacts-icon {
398
- background-color: white;
398
+ background-image: url("../assets/icons/contacts-white.svg");
399
399
  }
400
400
  }
401
401
  //icons
@@ -418,11 +418,9 @@
418
418
  }
419
419
 
420
420
  .contacts-icon {
421
- --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='.9em' viewBox='0 0 448 512'%3E%3C!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --%3E%3Cstyle%3Esvg%7Bfill:%23fff%7D%3C/style%3E%3Cpath 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'/%3E%3C/svg%3E");
422
- background-color: #6d90b4;
423
- -webkit-mask: var(--svg);
424
- mask: var(--svg);
425
- mask-repeat: no-repeat;
421
+ background-image: url("../assets/icons/contacts-greyblue.svg");
422
+ background-repeat:no-repeat;
423
+ background-size:contain;
426
424
  margin-right: 6px;
427
425
  width: 14px;
428
426
  height: 14px;
@@ -430,47 +428,6 @@
430
428
  }
431
429
  }
432
430
 
433
- .toggle-metrics-button-small {
434
- padding: 0px 13px;
435
- font-size: 12px;
436
- &.mini-contacts {
437
- font-size: 0.65rem;
438
- padding: 5px 12px;
439
- }
440
- .heatmap-icon {
441
- width: 21px;
442
- height: 21px;
443
- }
444
- .email-icon {
445
- width: 25px;
446
- height: 25px;
447
- }
448
- .contacts-icon {
449
- --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='.8em' viewBox='0 0 448 512'%3E%3C!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --%3E%3Cstyle%3Esvg%7Bfill:%23fff%7D%3C/style%3E%3Cpath 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'/%3E%3C/svg%3E");
450
- -webkit-mask: var(--svg);
451
- mask: var(--svg);
452
- mask-repeat: no-repeat;
453
- }
454
- }
455
-
456
- .toggle-metrics-button-large {
457
- padding: 23px 27px;
458
- font-size: 17px;
459
- &.mini-contacts {
460
- font-size: .92rem;
461
- padding: 10px 25px;
462
- }
463
- }
464
-
465
- .toggle-metrics-button-disabled {
466
- opacity: 0.3;
467
- cursor: default;
468
-
469
- .heatmap-icon, .email-icon, .contacts-icon {
470
- transform: none !important;
471
- }
472
- }
473
-
474
431
  .toggle-button-booster-badge {
475
432
  display: flex;
476
433
  align-items: center;
@@ -164,36 +164,3 @@
164
164
 
165
165
  }
166
166
 
167
- .toggle-comment-card {
168
- display: flex;
169
- flex-direction: row;
170
- width: 100%;
171
- height: 250px;
172
- border-radius: 18px;
173
- font-size: $toggle-font-size-regular;
174
- font-family: $toggle-font-family;
175
- }
176
-
177
- .toggle-comment-card-info {
178
- display: flex;
179
- flex-direction: column;
180
- justify-content: space-between;
181
- padding: 30px 30px 20px 30px;
182
- color: white;
183
- border-radius: 30px;
184
- width: 100%;
185
-
186
- .toggle-comment-card-text {
187
- text-align: justify;
188
- line-height: 1.5rem;
189
- text-overflow: ellipsis;
190
- -webkit-line-clamp: 6;
191
- -webkit-box-orient: vertical;
192
- overflow: hidden;
193
- display: -webkit-box;
194
-
195
- p {
196
- margin: 0
197
- }
198
- }
199
- }
@@ -28,10 +28,6 @@
28
28
  max-width: 100%;
29
29
  }
30
30
  }
31
- }
32
- .toggle-carousel-wrapper {
33
- position: relative;
34
-
35
31
  .toggle-carousel-button{
36
32
  width: 50px;
37
33
  height: 50px;
@@ -106,14 +102,6 @@
106
102
  }
107
103
  }
108
104
  }
109
- &--comments-left-arrow{
110
- left: -24px;
111
- opacity: 0.8;
112
- }
113
- &--comments-right-arrow{
114
- right: -24px !important;
115
- opacity: 0.8;
116
- }
117
105
  &--next{
118
106
  right: 20px;
119
107
  @media only screen and (max-width:768px){
@@ -227,6 +227,11 @@
227
227
  }
228
228
  }
229
229
 
230
+ .calendar-icon-disabled {
231
+ cursor: default;
232
+ opacity: 0.5;
233
+ }
234
+
230
235
  .calendar-icon-disabled {
231
236
  cursor: default;
232
237
  opacity: 0.5;
@@ -134,9 +134,4 @@
134
134
 
135
135
  .increase-padding-bottom {
136
136
  padding-bottom: 3rem !important;
137
- }
138
-
139
- .toggle-metric-score-rating {
140
- font-size: 27px;
141
- margin-left: -8px;
142
137
  }
@@ -4,7 +4,7 @@
4
4
 
5
5
  .toggle-sidenav-container {
6
6
  font-size: $toggle-font-size-regular;
7
- width: 20%;
7
+ width: 25%;
8
8
  float: left;
9
9
  max-width: 280px;
10
10
  min-height: 100vh;
@@ -134,7 +134,7 @@
134
134
 
135
135
  line-height: 1rem;
136
136
  font-size: $toggle-font-size-regular;
137
- width: 20%;
137
+ width: 25%;
138
138
  float: left;
139
139
  max-width: 280px;
140
140
  min-height: 100vh;
@@ -342,11 +342,6 @@
342
342
  &.airship-hat-icon span::before {
343
343
  background-image: url("../assets/icons/airship-hat-hover.svg");
344
344
  }
345
-
346
- &.airship-feedback-icon a::before,
347
- &.airship-feedback-icon span::before {
348
- background-image: url("../assets/icons/airship-feedback-hover.svg");
349
- }
350
345
  }
351
346
  }
352
347
 
@@ -511,17 +506,6 @@
511
506
  animation: tilt-shake 0.4s;
512
507
  background-image: url("../assets/icons/airship-audiences-hover.svg");
513
508
  }
514
- // add feedbacl
515
- &.airship-feedback-icon a::before,
516
- &.airship-feedback-icon span::before {
517
- background-image: url("../assets/icons/airship-feedback.svg");
518
- }
519
-
520
- &.airship-feedback-icon a:hover::before,
521
- &.airship-feedback-icon span:hover::before {
522
- animation: tilt-shake 0.4s;
523
- background-image: url("../assets/icons/airship-feedback-hover.svg");
524
- }
525
509
 
526
510
  }
527
511
  }