toggle-components-library 1.37.0-beta.1 → 1.37.0-beta.20

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toggle-components-library",
3
- "version": "1.37.0-beta.1",
3
+ "version": "1.37.0-beta.20",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -0,0 +1,9 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="6.922" height="12.381" viewBox="0 0 6.922 12.381">
2
+ <defs>
3
+ <linearGradient id="linear-gradient" x1="0.343" y1="-0.06" x2="0.923" y2="2.008" gradientUnits="objectBoundingBox">
4
+ <stop offset="0" stop-color="#3180FF"/>
5
+ <stop offset="1" stop-color="#38ABFF"/>
6
+ </linearGradient>
7
+ </defs>
8
+ <path id="bolt-solid" d="M37.679,1.07a.944.944,0,0,0-.191-.931.469.469,0,0,0-.719.044L32.156,5.6a.961.961,0,0,0-.16.854.616.616,0,0,0,.541.5h2.009L33.16,11.294a.944.944,0,0,0,.191.931.469.469,0,0,0,.719-.044l4.613-5.417a.961.961,0,0,0,.16-.854.612.612,0,0,0-.541-.5H36.293Z" transform="translate(-31.959 0.009)" fill="url(#linear-gradient)"/>
9
+ </svg>
@@ -1,26 +1,19 @@
1
1
  <template>
2
2
  <div class="toggle-breadcrumb" v-if="breadcrumb_computed">
3
3
  <div v-for="(crumb, index) in breadcrumb_computed" :key="index">
4
- <template v-if="index === breadcrumb_computed.length - 1 && editable">
5
- <input
6
- class="toggle-breadcrumb-editable-input"
7
- v-model="crumb.name"
8
- maxlength="50"
9
- @input="autoResizeInput($event.target); updateContent($event);"
10
- />
11
- </template>
12
- <template v-else>
13
- <router-link :to="{ name: crumb.link}" class="back-product" v-if="crumb.link && !isNuxt">{{ crumb.name }}</router-link>
14
- <NuxtLink :to="{ name: crumb.link}" class="back-product" v-if="crumb.link && isNuxt">{{ crumb.name }}</NuxtLink>
15
- <i class="toggle-breadcrumb-arrow-right" v-if="crumb.link"></i>
16
- <h1 class="toggle-breadcrumb-h1" v-if="!crumb.link">{{ crumb.name }}</h1>
17
- </template>
4
+ <router-link :to="{ name: crumb.link}" class="back-product" v-if="crumb.link && !isNuxt">{{ crumb.name }}</router-link>
5
+ <NuxtLink :to="{ name: crumb.link}" class="back-product" v-if="crumb.link && isNuxt">{{ crumb.name }}</NuxtLink>
6
+ <i class="toggle-breadcrumb-arrow-right" v-if="crumb.link"></i>
7
+ <h1 class="toggle-breadcrumb-h1" v-if="!crumb.link">{{ crumb.name }}</h1>
18
8
  </div>
19
9
  </div>
20
10
  </template>
21
11
 
22
12
  <script>
13
+
14
+
23
15
  export default {
16
+
24
17
  mixins: [],
25
18
  props: {
26
19
  isNuxt: {
@@ -30,31 +23,21 @@ export default {
30
23
  breadcrumb: {
31
24
  type: Array,
32
25
  required: false
33
- },
34
- editable: {
35
- type: Boolean,
36
- default: false
37
26
  }
38
27
  },
39
28
 
40
29
  data: function () {
30
+
31
+
41
32
  return {};
42
33
  },
43
34
 
44
35
  computed: {
36
+
45
37
  breadcrumb_computed() {
46
- return this.isNuxt ? this.breadcrumb : this.$route.meta.breadcrumb
38
+ return this.isNuxt ? this.breadcrumb : this.$route.meta.breadcrumb
47
39
  },
48
- },
49
-
50
- methods: {
51
- autoResizeInput(input) {
52
- input.style.width = input.value.length * 11 + "px";
53
- },
54
- updateContent(event) {
55
- const newContent = event.target.value;
56
- this.$emit('update:lastCrumb', newContent);
57
- }
58
40
  }
41
+
59
42
  }
60
43
  </script>
@@ -1,10 +1,10 @@
1
1
  <template>
2
2
  <div>
3
- <h3 :class="['toggle-metric metric-label', {'metric-label-atmosphere': atmosphere}]">{{label}}</h3>
3
+ <h3 :class="['toggle-metric metric-label', {'metric-label-atmosphere': atmosphere || toggle}]">{{label}}</h3>
4
4
  <div class="single-metric-icon" v-if="metricPending && label.length == 0"></div>
5
- <h1 :class="['toggle-metric metric-value', { 'metric-value-atmosphere': atmosphere }, { 'metric-value-small': small}]" v-else>{{metricValue}}
5
+ <h1 :class="['toggle-metric metric-value', { 'metric-value-atmosphere': atmosphere || toggle }, { 'metric-value-small': small}]" v-else>{{metricValue}}
6
6
  <span v-if="score && value.maxScore" class="toggle-metric-score-rating">/{{value.maxScore}}</span>
7
- <span v-if="atmosphere && live == true" class="toggle-metric-live-icon"></span>
7
+ <span v-if="(atmosphere || toggle) && live == true" :class="['toggle-metric-live-icon', {'toggle-metric-live-icon-toggle': toggle}]"></span>
8
8
  </h1>
9
9
  </div>
10
10
  </template>
@@ -82,7 +82,7 @@ export default {
82
82
  type: String,
83
83
  default: "default",
84
84
  validator: function (value) {
85
- return ['default', 'atmosphere'].indexOf(value) !== -1
85
+ return ['default', 'atmosphere', 'toggle'].indexOf(value) !== -1
86
86
  }
87
87
  },
88
88
  metricSize: {
@@ -128,6 +128,9 @@ export default {
128
128
  atmosphere() {
129
129
  return this.metricStyle === 'atmosphere';
130
130
  },
131
+ toggle() {
132
+ return this.metricStyle === 'toggle';
133
+ },
131
134
  small() {
132
135
  return this.metricSize === 'small';
133
136
  }
package/src/index.js CHANGED
@@ -8,7 +8,6 @@ import ToggleInputSelect from "./components/forms/ToggleInputSelect.vue";
8
8
  import ToggleInputPercentage from "./components/forms/ToggleInputPercentage.vue";
9
9
  import ToggleInputCurrency from "./components/forms/ToggleInputCurrency.vue";
10
10
  import ToggleInputRadioButtons from "./components/forms/ToggleInputRadioButtons.vue";
11
- import ToggleInputRadioButtonMini from "./components/forms/ToggleInputRadioButtonMini.vue";
12
11
  import ToggleInputTextArea from "./components/forms/ToggleInputTextArea.vue";
13
12
  import ToggleInputCheckboxContainer from "./components/forms/ToggleInputCheckboxContainer.vue";
14
13
  import ToggleInternationalPhoneInputSelect from "./components/forms/ToggleInternationalPhoneInputSelect.vue";
@@ -113,7 +112,6 @@ const Components = {
113
112
  ToggleInputPercentage,
114
113
  ToggleInputCurrency,
115
114
  ToggleInputRadioButtons,
116
- ToggleInputRadioButtonMini,
117
115
  ToggleInputTextArea,
118
116
  ToggleInputCheckboxContainer,
119
117
  ToggleInputCheckbox,
@@ -10,37 +10,6 @@
10
10
 
11
11
  }
12
12
 
13
- .toggle-breadcrumb-editable-input {
14
- font-size: $toggle-font-size-extra-large;
15
- font-family: "DIN-2014","Lato",sans-serif;
16
- color: $toggle-black;
17
- background-color: transparent;
18
- display: inline-flex;
19
- align-items: center;
20
- min-width: 10rem !important;
21
- max-width: 31rem !important;
22
- height: 2rem;
23
- width: 15rem;
24
- padding-right: 0.5rem;
25
- border: none;
26
- border-radius: 4px;
27
- white-space: nowrap;
28
- overflow: hidden;
29
- line-height: 1;
30
- border: 1px solid transparent;
31
- margin: -1px 0 0 0;
32
- }
33
- .toggle-breadcrumb-editable-input:hover {
34
- border: 1px solid #ccc;
35
- background-color: $toggle-off-white;
36
- }
37
-
38
- .toggle-breadcrumb-editable-input:focus {
39
- border: 1px solid #ccc;
40
- outline: none;
41
- }
42
-
43
-
44
13
  a {
45
14
 
46
15
  font-size: $toggle-font-size-extra-large;
@@ -1218,83 +1218,4 @@ $iconWidth:20px;
1218
1218
  .drop-down-leave-to {
1219
1219
  overflow: hidden;
1220
1220
  max-height: 0;
1221
- }
1222
-
1223
- // Radio button mini
1224
-
1225
- .toggle-input-radio-button-mini-switch {
1226
- position: relative;
1227
- display: inline-block;
1228
- width: 52px;
1229
- height: 28px;
1230
- }
1231
-
1232
- .toggle-input-radio-button-mini-switch input {
1233
- opacity: 0;
1234
- width: 0;
1235
- height: 0;
1236
- }
1237
-
1238
- .toggle-input-radio-button-mini-slider {
1239
- position: absolute;
1240
- cursor: pointer;
1241
- top: 0;
1242
- left: 0;
1243
- right: 0;
1244
- bottom: 0;
1245
- background-color: #ccc;
1246
- -webkit-transition: .4s;
1247
- transition: .4s;
1248
- display: flex;
1249
- align-items: center;
1250
- border-radius: 34px;
1251
- }
1252
-
1253
- .toggle-input-radio-button-mini-slider:before {
1254
- position: absolute;
1255
- content: "";
1256
- height: 22px;
1257
- width: 22px;
1258
- left: 4px;
1259
- bottom: 3px;
1260
- background-color: white;
1261
- -webkit-transition: .4s;
1262
- transition: .4s;
1263
- border-radius: 50%;
1264
- }
1265
-
1266
- input:checked + .toggle-input-radio-button-mini-slider {
1267
- background-color: #2196F3;
1268
- }
1269
-
1270
- input:focus + .toggle-input-radio-button-mini-slider {
1271
- box-shadow: 0 0 1px #2196F3;
1272
- }
1273
-
1274
- input:checked + .toggle-input-radio-button-mini-slider:before {
1275
- -webkit-transform: translateX(22px);
1276
- -ms-transform: translateX(22px);
1277
- transform: translateX(22px);
1278
- }
1279
-
1280
- .toggle-input-radio-button-mini-text-on {
1281
- font-family: $toggle-font-family;
1282
- font-size: 12px;
1283
- color: #ffffff;
1284
- margin-left: 7px;
1285
- }
1286
- .toggle-input-radio-button-mini-text-off {
1287
- font-family: $toggle-font-family;
1288
- font-size: 12px;
1289
- color: #3A4A62;
1290
- margin-left: 6px;
1291
- }
1292
- .toggle-input-radio-button-mini-switch-disabled {
1293
- cursor: default !important;
1294
- opacity: 0.5;
1295
- }
1296
-
1297
- .toggle-input-radio-button-mini-slider-disabled {
1298
- cursor: default !important;
1299
- opacity: 0.5;
1300
1221
  }
@@ -164,4 +164,8 @@
164
164
  height: 19px;
165
165
  width: 19px;
166
166
  margin: 17px 0 0 5px;
167
+ }
168
+
169
+ .toggle-metric-live-icon-toggle {
170
+ background-image: url('../assets/icons/bolt-solid-toggle.svg') !important;
167
171
  }
@@ -1,38 +0,0 @@
1
- <template>
2
- <div>
3
- <label :class="['toggle-input-radio-button-mini-switch', {'toggle-input-radio-button-mini-switch-disabled': disabled}]">
4
- <input type="checkbox" :value="value" v-model="value" :disabled="disabled">
5
- <span :class="['toggle-input-radio-button-mini-slider', {'toggle-input-radio-button-mini-slider-disabled': disabled}]">
6
- <span class="toggle-input-radio-button-mini-text-on">On</span>
7
- <span class="toggle-input-radio-button-mini-text-off">Off</span>
8
- </span>
9
- </label>
10
- </div>
11
- </template>
12
-
13
- <script>
14
- export default {
15
- name: 'ToggleInputRadioButtonMini',
16
- props: {
17
- disabled: {
18
- type: Boolean,
19
- default: false
20
- }
21
- },
22
- computed: {
23
- value: {
24
- get() {
25
- return this.$attrs.value
26
- },
27
- set(value) {
28
- this.$emit('input', value)
29
- }
30
- }
31
- },
32
- watch: {
33
- value: function (val) {
34
- this.$emit('input', val)
35
- }
36
- }
37
- }
38
- </script>