toggle-components-library 1.37.1 → 1.38.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/edit-icon.9a5af324.svg +1 -0
- package/dist/toggle-components-library.common.js +154 -12
- 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 +154 -12
- package/dist/toggle-components-library.umd.js.map +1 -1
- package/dist/toggle-components-library.umd.min.js +110 -110
- package/dist/toggle-components-library.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/assets/icons/edit-icon.svg +1 -0
- package/src/components/breadcrumb/ToggleBreadCrumb.vue +22 -18
- package/src/components/forms/ToggleInputRadioButtonMini.vue +56 -0
- package/src/index.js +2 -0
- package/src/sass/includes/_as_breadcrumb.scss +27 -1
- package/src/sass/includes/_as_inputs.scss +67 -0
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
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,20 +1,24 @@
|
|
|
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
|
-
|
|
4
|
+
<template v-if="index === breadcrumb_computed.length - 1 && editable">
|
|
5
|
+
<div class="toggle-breadcrumb-last-element-container">
|
|
6
|
+
<h1 class="toggle-breadcrumb-h1 toggle-breadcrumb-last-element">{{ crumb.name }}</h1>
|
|
7
|
+
<div v-if="editable" class="toggle-breadcrumb-edit-icon" @click="editClicked"></div>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
<template v-else>
|
|
11
|
+
<router-link :to="{ name: crumb.link}" class="back-product" v-if="crumb.link && !isNuxt">{{ crumb.name }}</router-link>
|
|
12
|
+
<NuxtLink :to="{ name: crumb.link}" class="back-product" v-if="crumb.link && isNuxt">{{ crumb.name }}</NuxtLink>
|
|
13
|
+
<i class="toggle-breadcrumb-arrow-right" v-if="crumb.link"></i>
|
|
14
|
+
<h1 class="toggle-breadcrumb-h1" v-if="!crumb.link">{{ crumb.name }}</h1>
|
|
15
|
+
</template>
|
|
8
16
|
</div>
|
|
9
17
|
</div>
|
|
10
18
|
</template>
|
|
11
19
|
|
|
12
20
|
<script>
|
|
13
|
-
|
|
14
|
-
|
|
15
21
|
export default {
|
|
16
|
-
|
|
17
|
-
mixins: [],
|
|
18
22
|
props: {
|
|
19
23
|
isNuxt: {
|
|
20
24
|
type: Boolean,
|
|
@@ -23,21 +27,21 @@ export default {
|
|
|
23
27
|
breadcrumb: {
|
|
24
28
|
type: Array,
|
|
25
29
|
required: false
|
|
30
|
+
},
|
|
31
|
+
editable: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: false
|
|
26
34
|
}
|
|
27
35
|
},
|
|
28
|
-
|
|
29
|
-
data: function () {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return {};
|
|
33
|
-
},
|
|
34
|
-
|
|
35
36
|
computed: {
|
|
36
|
-
|
|
37
37
|
breadcrumb_computed() {
|
|
38
38
|
return this.isNuxt ? this.breadcrumb : this.$route.meta.breadcrumb
|
|
39
|
-
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
methods: {
|
|
42
|
+
editClicked() {
|
|
43
|
+
this.$emit('edit-clicked')
|
|
44
|
+
}
|
|
40
45
|
}
|
|
41
|
-
|
|
42
46
|
}
|
|
43
47
|
</script>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="toggle-input-radio-button-mini-switch-wrapper">
|
|
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
|
+
:style="value == false ? ('background-color: ' + inactiveStyles.backgroundColor) : ('background-color: ' + activeStyles.backgroundColor)">
|
|
7
|
+
<span class="toggle-input-radio-button-mini-text-on" :style="'color: ' + activeStyles.color">On</span>
|
|
8
|
+
<span class="toggle-input-radio-button-mini-text-off" :style="'color: ' + inactiveStyles.color">Off</span>
|
|
9
|
+
</span>
|
|
10
|
+
</label>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
export default {
|
|
16
|
+
name: 'ToggleInputRadioButtonMini',
|
|
17
|
+
props: {
|
|
18
|
+
disabled: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false
|
|
21
|
+
},
|
|
22
|
+
// Allows for the passing of background colour and text colour for active and inactive states
|
|
23
|
+
styles : {
|
|
24
|
+
type: Object,
|
|
25
|
+
default: () => ({})
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
computed: {
|
|
29
|
+
value: {
|
|
30
|
+
get() {
|
|
31
|
+
return this.$attrs.value
|
|
32
|
+
},
|
|
33
|
+
set(value) {
|
|
34
|
+
this.$emit('input', value)
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
activeStyles () {
|
|
38
|
+
return {
|
|
39
|
+
backgroundColor: this.styles.active?.backgroundColor ? this.styles.active.backgroundColor : '#2196F3',
|
|
40
|
+
color: this.styles.active?.color ? this.styles.active.color : '#ffffff'
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
inactiveStyles () {
|
|
44
|
+
return {
|
|
45
|
+
backgroundColor: this.styles.inactive?.backgroundColor ? this.styles.inactive.backgroundColor : '#ccc',
|
|
46
|
+
color: this.styles.inactive?.color ? this.styles.inactive.color : '#3A4A62'
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
watch: {
|
|
51
|
+
value: function (val) {
|
|
52
|
+
this.$emit('input', val)
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
</script>
|
package/src/index.js
CHANGED
|
@@ -8,6 +8,7 @@ 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";
|
|
11
12
|
import ToggleInputTextArea from "./components/forms/ToggleInputTextArea.vue";
|
|
12
13
|
import ToggleInputCheckboxContainer from "./components/forms/ToggleInputCheckboxContainer.vue";
|
|
13
14
|
import ToggleInternationalPhoneInputSelect from "./components/forms/ToggleInternationalPhoneInputSelect.vue";
|
|
@@ -112,6 +113,7 @@ const Components = {
|
|
|
112
113
|
ToggleInputPercentage,
|
|
113
114
|
ToggleInputCurrency,
|
|
114
115
|
ToggleInputRadioButtons,
|
|
116
|
+
ToggleInputRadioButtonMini,
|
|
115
117
|
ToggleInputTextArea,
|
|
116
118
|
ToggleInputCheckboxContainer,
|
|
117
119
|
ToggleInputCheckbox,
|
|
@@ -36,4 +36,30 @@
|
|
|
36
36
|
transform: rotate(-45deg);
|
|
37
37
|
-webkit-transform: rotate(-45deg);
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
.toggle-breadcrumb-last-element-container {
|
|
40
|
+
display: flex;
|
|
41
|
+
|
|
42
|
+
.toggle-breadcrumb-last-element {
|
|
43
|
+
margin: 0;
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
white-space: nowrap;
|
|
46
|
+
text-overflow: ellipsis;
|
|
47
|
+
}
|
|
48
|
+
.toggle-breadcrumb-edit-icon {
|
|
49
|
+
margin: 4px 0 0 0;
|
|
50
|
+
background-image: url('../assets/icons/edit-icon.svg');
|
|
51
|
+
background-repeat:no-repeat;
|
|
52
|
+
background-size:contain;
|
|
53
|
+
height: 22px;
|
|
54
|
+
width: 22px;
|
|
55
|
+
min-width: 22px;
|
|
56
|
+
margin-left: 15px;
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
transition: 0.2s;
|
|
59
|
+
}
|
|
60
|
+
.toggle-breadcrumb-edit-icon:hover {
|
|
61
|
+
filter: invert(0.5) sepia(1) saturate(3) hue-rotate(180deg);
|
|
62
|
+
transform: scale(1.07) rotate(-6deg);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -1218,4 +1218,71 @@ $iconWidth:20px;
|
|
|
1218
1218
|
.drop-down-leave-to {
|
|
1219
1219
|
overflow: hidden;
|
|
1220
1220
|
max-height: 0;
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
// Radio button mini
|
|
1224
|
+
.toggle-input-radio-button-mini-switch-wrapper{
|
|
1225
|
+
display: flex;
|
|
1226
|
+
align-items: center;
|
|
1227
|
+
|
|
1228
|
+
.toggle-input-radio-button-mini-switch {
|
|
1229
|
+
position: relative;
|
|
1230
|
+
display: inline-block;
|
|
1231
|
+
width: 52px;
|
|
1232
|
+
height: 28px;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
.toggle-input-radio-button-mini-switch input {
|
|
1236
|
+
opacity: 0;
|
|
1237
|
+
width: 0;
|
|
1238
|
+
height: 0;
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
.toggle-input-radio-button-mini-slider {
|
|
1242
|
+
position: absolute;
|
|
1243
|
+
cursor: pointer;
|
|
1244
|
+
top: 0;
|
|
1245
|
+
left: 0;
|
|
1246
|
+
right: 0;
|
|
1247
|
+
bottom: 0;
|
|
1248
|
+
-webkit-transition: .4s;
|
|
1249
|
+
transition: .4s;
|
|
1250
|
+
display: flex;
|
|
1251
|
+
align-items: center;
|
|
1252
|
+
border-radius: 34px;
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
.toggle-input-radio-button-mini-slider:before {
|
|
1256
|
+
position: absolute;
|
|
1257
|
+
content: "";
|
|
1258
|
+
height: 22px;
|
|
1259
|
+
width: 22px;
|
|
1260
|
+
left: 4px;
|
|
1261
|
+
bottom: 3px;
|
|
1262
|
+
background-color: white;
|
|
1263
|
+
-webkit-transition: .4s;
|
|
1264
|
+
transition: .4s;
|
|
1265
|
+
border-radius: 50%;
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
input:checked + .toggle-input-radio-button-mini-slider:before {
|
|
1269
|
+
-webkit-transform: translateX(22px);
|
|
1270
|
+
-ms-transform: translateX(22px);
|
|
1271
|
+
transform: translateX(22px);
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
.toggle-input-radio-button-mini-text-on {
|
|
1275
|
+
font-family: $toggle-font-family;
|
|
1276
|
+
font-size: 12px;
|
|
1277
|
+
margin-left: 7px;
|
|
1278
|
+
}
|
|
1279
|
+
.toggle-input-radio-button-mini-text-off {
|
|
1280
|
+
font-family: $toggle-font-family;
|
|
1281
|
+
font-size: 12px;
|
|
1282
|
+
margin-left: 6px;
|
|
1283
|
+
}
|
|
1284
|
+
.toggle-input-radio-button-mini-switch-disabled {
|
|
1285
|
+
cursor: default !important;
|
|
1286
|
+
opacity: 0.5;
|
|
1287
|
+
}
|
|
1221
1288
|
}
|