toggle-components-library 1.28.4 → 1.28.5-beta.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/arrow-icon.6b7bdc31.svg +3 -0
- package/dist/img/email-icon.3c44b236.svg +3 -0
- package/dist/img/magnifying-glass-icon.9a2b42a1.svg +3 -0
- package/dist/img/mobile-icon.9e16ffcd.svg +6 -0
- package/dist/toggle-components-library.common.js +1156 -374
- 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 +1156 -374
- package/dist/toggle-components-library.umd.js.map +1 -1
- package/dist/toggle-components-library.umd.min.js +7 -7
- package/dist/toggle-components-library.umd.min.js.map +1 -1
- package/package-lock.json +46073 -0
- package/package.json +1 -1
- package/src/assets/icons/arrow-icon.svg +3 -0
- package/src/assets/icons/email-icon.svg +3 -0
- package/src/assets/icons/magnifying-glass-icon.svg +3 -0
- package/src/assets/icons/mobile-icon.svg +6 -0
- package/src/components/forms/ToggleContactSearch.vue +136 -0
- package/src/index.js +3 -1
- package/src/sass/includes/_as_inputs.scss +189 -1
- package/src/.DS_Store +0 -0
package/package.json
CHANGED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="11" viewBox="0 0 18 11">
|
|
2
|
+
<path id="Polygon_8" data-name="Polygon 8" d="M7.452,1.892a2,2,0,0,1,3.1,0l4.78,5.842A2,2,0,0,1,13.78,11H4.22A2,2,0,0,1,2.673,7.734Z" transform="translate(18 11) rotate(180)" fill="#3a4a62"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="31.001" height="31.001" viewBox="0 0 31.001 31.001">
|
|
2
|
+
<path id="at-solid" d="M15.5,3.875a11.625,11.625,0,0,0,0,23.251A1.938,1.938,0,1,1,15.5,31,15.5,15.5,0,1,1,31,15.5v1.938A5.812,5.812,0,0,1,20.756,21.2a7.753,7.753,0,1,1-.733-11.989,1.938,1.938,0,0,1,3.227,1.447v6.781a1.938,1.938,0,0,0,3.875,0V15.5A11.628,11.628,0,0,0,15.5,3.875ZM19.376,15.5A3.875,3.875,0,1,0,15.5,19.376,3.875,3.875,0,0,0,19.376,15.5Z" fill="#3a4a62"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24.674" height="24.678" viewBox="0 0 24.674 24.678">
|
|
2
|
+
<path id="magnifying-glass-solid" d="M20.048,10.024a10,10,0,0,1-1.928,5.913l6.1,6.106a1.544,1.544,0,0,1-2.183,2.183l-6.1-6.106a10.026,10.026,0,1,1,4.111-8.1Zm-10.024,6.94a6.94,6.94,0,1,0-6.94-6.94A6.94,6.94,0,0,0,10.024,16.964Z" fill="#3a4a62"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="31.001" height="32.921" viewBox="0 0 23.131 32.921">
|
|
2
|
+
<g id="Rectangle_1084" data-name="Rectangle 1084" transform="matrix(0.995, -0.105, 0.105, 0.995, 0, 2.091)" fill="none" stroke="#3a4a62" stroke-width="4">
|
|
3
|
+
<rect width="20" height="31" rx="5" stroke="none"/>
|
|
4
|
+
<rect x="2" y="2" width="16" height="27" rx="3" fill="none"/>
|
|
5
|
+
</g>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="toggle-contact-search-container">
|
|
3
|
+
|
|
4
|
+
<div class="toggle-contact-search-error" >
|
|
5
|
+
{{isInvalid ? errorMessage : ''}}
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<div class="toggle-contact-search-input-container" :class="{'toggle-input-is-invalid': isInvalid, 'toggle-contact-search-input-container-active': showDropdown}">
|
|
9
|
+
<div class="toggle-contact-search-icon-input-container">
|
|
10
|
+
<div class="toggle-contact-search-icon-arrow-container" @click="showDropdown = !showDropdown">
|
|
11
|
+
<img class="toggle-contact-search-icon" :src="iconSrc" :alt="inputType" />
|
|
12
|
+
<img class="toggle-contact-search-arrow" :class="{'toggle-contact-search-arrow-active': showDropdown}" :src="arrowIconSrc" alt="Down arrow" />
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<div class="toggle-contact-search-divider"></div>
|
|
16
|
+
|
|
17
|
+
<input class="toggle-contact-search-input" v-model="inputVal" type="text" :placeholder="placeholder" @keyup.enter="onEnter">
|
|
18
|
+
|
|
19
|
+
<img class="toggle-contact-search-magnifying-glass-icon" :src="searchIconSrc" alt="Search" @click="onSearch" />
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<Transition name="drop-down">
|
|
23
|
+
<div v-if="showDropdown" class="toggle-contact-search-dropdown-container">
|
|
24
|
+
<div v-for="type, i in types" @click="inputType = type; showDropdown = false" :key="i">
|
|
25
|
+
<div class="toggle-contact-search-dropdown-item">
|
|
26
|
+
<img class="toggle-contact-search-icon-dropdown" :src="iconForType(type)" :alt="type" />
|
|
27
|
+
<label class="toggle-contact-search-dropdown-item-label" :class="{'toggle-contact-search-dropwdown-item-highlighted': type == inputType}">
|
|
28
|
+
{{textForType(type)}}
|
|
29
|
+
</label>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</Transition>
|
|
34
|
+
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script>
|
|
40
|
+
|
|
41
|
+
import { mixins } from '../mixins/mixins'
|
|
42
|
+
|
|
43
|
+
export default {
|
|
44
|
+
mixins: [mixins],
|
|
45
|
+
props: {
|
|
46
|
+
value: {
|
|
47
|
+
type: [Number,String]
|
|
48
|
+
},
|
|
49
|
+
types: {
|
|
50
|
+
type: Array,
|
|
51
|
+
default: function () {
|
|
52
|
+
return ['email', 'mobile'];
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
isInvalid: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: false
|
|
58
|
+
},
|
|
59
|
+
errorMessage: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: 'No contact found with these details'
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
data() {
|
|
65
|
+
return {
|
|
66
|
+
inputType: 'email',
|
|
67
|
+
showDropdown: false,
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
watch: {
|
|
71
|
+
showDropdown: function (val) {
|
|
72
|
+
if (val) {
|
|
73
|
+
this.isInvalid = false;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
computed: {
|
|
78
|
+
inputVal: {
|
|
79
|
+
get: function () {
|
|
80
|
+
return this.value;
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
set: function (value) {
|
|
84
|
+
this.$emit('input', value);
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
placeholder: function () {
|
|
88
|
+
return this.inputType == 'email' ? 'Enter contact email address' : 'Enter contact mobile number';
|
|
89
|
+
},
|
|
90
|
+
iconSrc() {
|
|
91
|
+
return this.inputType == 'email' ? require('../../assets/icons/email-icon.svg') : require('../../assets/icons/mobile-icon.svg');
|
|
92
|
+
},
|
|
93
|
+
arrowIconSrc() {
|
|
94
|
+
return require('../../assets/icons/arrow-icon.svg');
|
|
95
|
+
},
|
|
96
|
+
searchIconSrc() {
|
|
97
|
+
return require('../../assets/icons/magnifying-glass-icon.svg');
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
methods: {
|
|
101
|
+
textForType(type) {
|
|
102
|
+
switch (type) {
|
|
103
|
+
case 'email':
|
|
104
|
+
return 'Search for a contact by email address';
|
|
105
|
+
case 'mobile':
|
|
106
|
+
return 'Search for a contact by mobile';
|
|
107
|
+
default:
|
|
108
|
+
return 'Search for a contact by ' + this.inputType;
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
iconForType(type) {
|
|
112
|
+
switch (type) {
|
|
113
|
+
case 'email':
|
|
114
|
+
return require('../../assets/icons/email-icon.svg');
|
|
115
|
+
case 'mobile':
|
|
116
|
+
return require('../../assets/icons/mobile-icon.svg');
|
|
117
|
+
default:
|
|
118
|
+
return require('../../assets/icons/email-icon.svg');
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
onEnter(e) {
|
|
122
|
+
this.$emit('enterPressed', {
|
|
123
|
+
type: this.inputType,
|
|
124
|
+
value: e.target.value
|
|
125
|
+
});
|
|
126
|
+
},
|
|
127
|
+
onSearch() {
|
|
128
|
+
this.$emit('clickSearch', {
|
|
129
|
+
type: this.inputType,
|
|
130
|
+
value: this.inputVal
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
</script>
|
package/src/index.js
CHANGED
|
@@ -22,6 +22,7 @@ import ToggleInputGroup from "./components/forms/ToggleInputGroup.vue";
|
|
|
22
22
|
import ToggleInputNumber from "./components/forms/ToggleInputNumber.vue";
|
|
23
23
|
import ToggleColourPicker from "./components/forms/ToggleColourPicker.vue";
|
|
24
24
|
import ToggleModal from "./components/modals/ToggleModal.vue";
|
|
25
|
+
import ToggleContactSearch from "./components/forms/ToggleContactSearch.vue";
|
|
25
26
|
|
|
26
27
|
import ToggleBoosterButton from "./components/boosters/ToggleBoosterButton.vue";
|
|
27
28
|
import ToggleBoosterBasicButton from "./components/boosters/ToggleBoosterBasicButton.vue";
|
|
@@ -140,7 +141,8 @@ const Components = {
|
|
|
140
141
|
ToggleThreeDotsButton,
|
|
141
142
|
ToggleBoosterButton,
|
|
142
143
|
ToggleBoosterBasicButton,
|
|
143
|
-
ToggleBoosterModal
|
|
144
|
+
ToggleBoosterModal,
|
|
145
|
+
ToggleContactSearch
|
|
144
146
|
}
|
|
145
147
|
|
|
146
148
|
Object.keys(Components).forEach(name => {
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
.toggle-input-radio-label,
|
|
7
7
|
.toggle-input-checkbox-label,
|
|
8
8
|
.toggle-input-search-options,
|
|
9
|
-
.toggle-input-select
|
|
9
|
+
.toggle-input-select,
|
|
10
|
+
.toggle-contact-search-container{
|
|
10
11
|
@include toggle-global-font-config;
|
|
11
12
|
}
|
|
12
13
|
|
|
@@ -936,4 +937,191 @@ $iconWidth:20px;
|
|
|
936
937
|
top: 50%;
|
|
937
938
|
transform: translate(0, -50%);
|
|
938
939
|
}
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
//
|
|
943
|
+
// Contact Search Styles
|
|
944
|
+
//
|
|
945
|
+
|
|
946
|
+
.toggle-contact-search-input-container {
|
|
947
|
+
width: 100%;
|
|
948
|
+
height: 40px;
|
|
949
|
+
background-color: $toggle-white;
|
|
950
|
+
border-radius: 8px;
|
|
951
|
+
min-width: 550px;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
.toggle-contact-search-input-container-active {
|
|
955
|
+
border-radius: 8px 8px 0 0;
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
.toggle-contact-search-icon-input-container {
|
|
959
|
+
display: flex;
|
|
960
|
+
flex-direction: row;
|
|
961
|
+
width: 100%;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
.toggle-contact-search-dropdown-container {
|
|
965
|
+
min-width: 550px;
|
|
966
|
+
background-color: $toggle-white;
|
|
967
|
+
border-radius: 0 0 8px 8px;
|
|
968
|
+
overflow: hidden;
|
|
969
|
+
position: absolute;
|
|
970
|
+
z-index: 1;
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
.toggle-contact-search-input {
|
|
974
|
+
width: 100%;
|
|
975
|
+
border: 0;
|
|
976
|
+
border-radius: 0px;
|
|
977
|
+
height: 30px;
|
|
978
|
+
margin: 4px 5px 0px 14px;
|
|
979
|
+
color: #3A4A62;
|
|
980
|
+
font-weight: 700;
|
|
981
|
+
font-size: 16px;
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
.toggle-contact-search-input::placeholder,
|
|
985
|
+
.toggle-contact-search-input:-ms-input-placeholder,
|
|
986
|
+
.toggle-contact-search-input::-ms-input-placeholder {
|
|
987
|
+
color: #C5CED8;
|
|
988
|
+
opacity: 1;
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
.toggle-contact-search-icon {
|
|
992
|
+
max-width: 20px;
|
|
993
|
+
max-height: 20px;
|
|
994
|
+
margin: 10px 0 0 21px;
|
|
995
|
+
transition: transform .2s ease-in-out;
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
.toggle-contact-search-icon-arrow-container:hover {
|
|
999
|
+
.toggle-contact-search-icon {
|
|
1000
|
+
transform: scale(1.1);
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
.toggle-contact-search-icon-arrow-container {
|
|
1005
|
+
display: flex;
|
|
1006
|
+
width: 100px;
|
|
1007
|
+
min-width: 60px;
|
|
1008
|
+
flex-direction: row;
|
|
1009
|
+
justify-content: center;
|
|
1010
|
+
cursor: pointer;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
.toggle-contact-search-magnifying-glass-icon {
|
|
1014
|
+
cursor: pointer;
|
|
1015
|
+
margin: 0 15px 0 0;
|
|
1016
|
+
max-width: 20px;
|
|
1017
|
+
transition: transform .2s ease-in-out;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
.toggle-contact-search-magnifying-glass-icon:hover {
|
|
1021
|
+
transform: scale(1.1);
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
.toggle-contact-search-arrow {
|
|
1025
|
+
max-width: 10px;
|
|
1026
|
+
margin: 6px 21px 0 15px;
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
.toggle-contact-search-arrow-active {
|
|
1030
|
+
transition: rotate .2s ease-in-out;
|
|
1031
|
+
rotate: -3.1416rad;
|
|
1032
|
+
transform-origin: center center;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
.toggle-contact-search-divider {
|
|
1036
|
+
height: 28px;
|
|
1037
|
+
margin: 7px 0 0 0;
|
|
1038
|
+
border-right: 2px solid #D9D9D9;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
.toggle-contact-search-dropdown-item {
|
|
1042
|
+
margin: 5px 5px 5px 10px;
|
|
1043
|
+
border-radius: 8px;
|
|
1044
|
+
cursor: pointer;
|
|
1045
|
+
font-size: 16px;
|
|
1046
|
+
display: flex;
|
|
1047
|
+
flex-direction: row;
|
|
1048
|
+
justify-content: left;
|
|
1049
|
+
align-items: center;
|
|
1050
|
+
padding: 5px;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
.toggle-contact-search-dropdown-item-label {
|
|
1054
|
+
cursor: pointer;
|
|
1055
|
+
font-weight: 700;
|
|
1056
|
+
color: #3A4A62;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
.toggle-contact-search-dropwdown-item-highlighted {
|
|
1060
|
+
color: #547DEE;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
.toggle-contact-search-dropdown-item:hover {
|
|
1064
|
+
background-color: #F5F5F5;
|
|
1065
|
+
color: #3A4A62;
|
|
1066
|
+
|
|
1067
|
+
.toggle-contact-search-icon-dropdown {
|
|
1068
|
+
transform: scale(1.1);
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
.toggle-contact-search-dropdown-item-label {
|
|
1072
|
+
color: #3A4A62;
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
.toggle-contact-search-icon-dropdown {
|
|
1077
|
+
max-width: 20px;
|
|
1078
|
+
max-height: 20px;
|
|
1079
|
+
margin: 2px 14px 0 0;
|
|
1080
|
+
transition: transform .2s ease-in-out;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
.toggle-contact-search-error {
|
|
1084
|
+
height: 16.8px;
|
|
1085
|
+
text-align: right;
|
|
1086
|
+
color: #FF6F6F;
|
|
1087
|
+
font-size: 12px;
|
|
1088
|
+
margin: 0 0 10px 0;
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
//
|
|
1092
|
+
// Contact Search Transition Styles
|
|
1093
|
+
//
|
|
1094
|
+
|
|
1095
|
+
.drop-down-enter-active {
|
|
1096
|
+
-moz-transition-duration: 0.4s;
|
|
1097
|
+
-webkit-transition-duration: 0.4s;
|
|
1098
|
+
-o-transition-duration: 0.4s;
|
|
1099
|
+
transition-duration: 0.4s;
|
|
1100
|
+
-moz-transition-timing-function: ease-in;
|
|
1101
|
+
-webkit-transition-timing-function: ease-in;
|
|
1102
|
+
-o-transition-timing-function: ease-in;
|
|
1103
|
+
transition-timing-function: ease-in;
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
.drop-down-leave-active {
|
|
1107
|
+
-moz-transition-duration: 0.4s;
|
|
1108
|
+
-webkit-transition-duration: 0.4s;
|
|
1109
|
+
-o-transition-duration: 0.4s;
|
|
1110
|
+
transition-duration: 0.4s;
|
|
1111
|
+
-moz-transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
|
|
1112
|
+
-webkit-transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
|
|
1113
|
+
-o-transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
|
|
1114
|
+
transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
.drop-down-enter-to,
|
|
1118
|
+
.drop-down-leave {
|
|
1119
|
+
max-height: 100px;
|
|
1120
|
+
overflow: hidden;
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
.drop-down-enter,
|
|
1124
|
+
.drop-down-leave-to {
|
|
1125
|
+
overflow: hidden;
|
|
1126
|
+
max-height: 0;
|
|
939
1127
|
}
|
package/src/.DS_Store
DELETED
|
Binary file
|