toggle-components-library 1.37.0-beta.2 → 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/dist/img/bolt-solid-toggle.d8a39b94.svg +9 -0
- package/dist/toggle-components-library.common.js +96 -231
- 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 +96 -231
- package/dist/toggle-components-library.umd.js.map +1 -1
- package/dist/toggle-components-library.umd.min.js +1 -1
- package/dist/toggle-components-library.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/assets/icons/bolt-solid-toggle.svg +9 -0
- package/src/components/breadcrumb/ToggleBreadCrumb.vue +13 -44
- package/src/components/metrics/ToggleMetricSingleMetric.vue +7 -4
- package/src/index.js +0 -2
- package/src/sass/includes/_as_breadcrumb.scss +0 -41
- package/src/sass/includes/_as_inputs.scss +0 -79
- package/src/sass/includes/_as_metrics.scss +4 -0
- package/dist/img/edit-icon.9a5af324.svg +0 -1
- package/src/assets/icons/edit-icon.svg +0 -1
- package/src/components/forms/ToggleInputRadioButtonMini.vue +0 -38
package/package.json
CHANGED
|
@@ -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,25 +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
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
@input="updateContent($event);"
|
|
9
|
-
>{{ crumb.name }}</span>
|
|
10
|
-
</template>
|
|
11
|
-
<template v-else>
|
|
12
|
-
<router-link :to="{ name: crumb.link}" class="back-product" v-if="crumb.link && !isNuxt">{{ crumb.name }}</router-link>
|
|
13
|
-
<NuxtLink :to="{ name: crumb.link}" class="back-product" v-if="crumb.link && isNuxt">{{ crumb.name }}</NuxtLink>
|
|
14
|
-
<i class="toggle-breadcrumb-arrow-right" v-if="crumb.link"></i>
|
|
15
|
-
<h1 class="toggle-breadcrumb-h1" v-if="!crumb.link">{{ crumb.name }}</h1>
|
|
16
|
-
</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>
|
|
17
8
|
</div>
|
|
18
9
|
</div>
|
|
19
10
|
</template>
|
|
20
11
|
|
|
21
12
|
<script>
|
|
13
|
+
|
|
14
|
+
|
|
22
15
|
export default {
|
|
16
|
+
|
|
23
17
|
mixins: [],
|
|
24
18
|
props: {
|
|
25
19
|
isNuxt: {
|
|
@@ -29,46 +23,21 @@ export default {
|
|
|
29
23
|
breadcrumb: {
|
|
30
24
|
type: Array,
|
|
31
25
|
required: false
|
|
32
|
-
},
|
|
33
|
-
editable: {
|
|
34
|
-
type: Boolean,
|
|
35
|
-
default: false,
|
|
36
|
-
required: false
|
|
37
|
-
},
|
|
38
|
-
maxChars: {
|
|
39
|
-
type: Number,
|
|
40
|
-
default: 50,
|
|
41
|
-
required: false
|
|
42
26
|
}
|
|
43
27
|
},
|
|
44
28
|
|
|
45
29
|
data: function () {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
};
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
return {};
|
|
49
33
|
},
|
|
50
34
|
|
|
51
35
|
computed: {
|
|
36
|
+
|
|
52
37
|
breadcrumb_computed() {
|
|
53
|
-
return this.isNuxt ?
|
|
38
|
+
return this.isNuxt ? this.breadcrumb : this.$route.meta.breadcrumb
|
|
54
39
|
},
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
methods: {
|
|
58
|
-
|
|
59
|
-
updateContent(event) {
|
|
60
|
-
// Limit the input to 50 characters
|
|
61
|
-
if (event.target.innerText.length >= this.maxChars) {
|
|
62
|
-
event.target.innerText = this.content;
|
|
63
|
-
|
|
64
|
-
// Move the cursor to the end of the input
|
|
65
|
-
document.getSelection().modify("move", "forward", "documentboundary");
|
|
66
|
-
|
|
67
|
-
} else {
|
|
68
|
-
this.content = event.target.innerText;
|
|
69
|
-
this.$emit('update:lastCrumb', this.content);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
40
|
}
|
|
41
|
+
|
|
73
42
|
}
|
|
74
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,47 +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: 5rem !important;
|
|
21
|
-
height: 2rem;
|
|
22
|
-
padding-right: 0.5rem;
|
|
23
|
-
padding-left: 10px;
|
|
24
|
-
border: none;
|
|
25
|
-
border-radius: 4px;
|
|
26
|
-
white-space: nowrap;
|
|
27
|
-
line-height: 1;
|
|
28
|
-
border: 1px solid transparent;
|
|
29
|
-
margin: -1px 0 0 -10px;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.toggle-breadcrumb-editable-input:hover {
|
|
33
|
-
border: 1px solid #ccc;
|
|
34
|
-
background-color: $toggle-off-white;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.toggle-breadcrumb-editable-input:focus {
|
|
38
|
-
border: 1px solid #ccc;
|
|
39
|
-
background-color: $toggle-off-white;
|
|
40
|
-
outline: none;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.toggle-breadcrumb-editable-input::after {
|
|
44
|
-
content: '';
|
|
45
|
-
background-image: url('../assets/icons/edit-icon.svg');
|
|
46
|
-
background-repeat:no-repeat;
|
|
47
|
-
background-size:contain;
|
|
48
|
-
height: 22px;
|
|
49
|
-
width: 22px;
|
|
50
|
-
margin: 0 0 0 10px;
|
|
51
|
-
cursor: text;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
13
|
a {
|
|
55
14
|
|
|
56
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
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#abb7c5"><path d="M200-200h57l391-391-57-57-391 391v57Zm-80 80v-170l528-527q12-11 26.5-17t30.5-6q16 0 31 6t26 18l55 56q12 11 17.5 26t5.5 30q0 16-5.5 30.5T817-647L290-120H120Zm640-584-56-56 56 56Zm-141 85-28-29 57 57-29-28Z"/></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#abb7c5"><path d="M200-200h57l391-391-57-57-391 391v57Zm-80 80v-170l528-527q12-11 26.5-17t30.5-6q16 0 31 6t26 18l55 56q12 11 17.5 26t5.5 30q0 16-5.5 30.5T817-647L290-120H120Zm640-584-56-56 56 56Zm-141 85-28-29 57 57-29-28Z"/></svg>
|
|
@@ -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>
|