toggle-components-library 1.28.7-beta.1 → 1.30.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toggle-components-library",
3
- "version": "1.28.7-beta.1",
3
+ "version": "1.30.0",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -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,156 @@
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"
9
+ :class="{'toggle-input-is-invalid': isInvalid, 'toggle-contact-search-input-container-active': showDropdown}">
10
+ <div class="toggle-contact-search-icon-input-container">
11
+ <div :class="{'toggle-contact-search-icon-arrow-container': true, 'toggle-contact-search-icon-arrow-container-disabled': disabled}"
12
+ @click="showDropdown = !disabled && !loading ? !showDropdown : false">
13
+ <div class="toggle-contact-search-icon"
14
+ :class="{
15
+ 'toggle-contact-search-icon-email': inputType == 'email',
16
+ 'toggle-contact-search-icon-mobile': inputType == 'mobile'
17
+ }"
18
+ ></div>
19
+ <div class="toggle-contact-search-arrow" :class="{'toggle-contact-search-arrow-active': showDropdown}"></div>
20
+ </div>
21
+
22
+ <div class="toggle-contact-search-divider"></div>
23
+
24
+ <input :class="{'toggle-contact-search-input': true, 'toggle-contact-search-disabled': disabled}" v-model="inputVal" :disabled="disabled || loading" type="text" :placeholder="placeholder" @keyup.enter="onEnter">
25
+
26
+ <div v-if="loading" class="toggle-contact-search-loading-container">
27
+ <div class="toggle-inline-loader"></div>
28
+ </div>
29
+ <div v-else :class="{'toggle-contact-search-magnifying-glass-icon': true, 'toggle-contact-search-magnifying-glass-icon-disabled': disabled}" @click="onSearch"></div>
30
+ </div>
31
+
32
+ <Transition name="drop-down">
33
+ <div v-if="showDropdown" class="toggle-contact-search-dropdown-container">
34
+ <div v-for="type, i in types" @click="inputType = type; showDropdown = false; loading = false" :key="i">
35
+ <div class="toggle-contact-search-dropdown-item">
36
+ <div class="toggle-contact-search-icon-dropdown" :class="iconForType(type)"></div>
37
+ <label class="toggle-contact-search-dropdown-item-label" :class="{'toggle-contact-search-dropwdown-item-highlighted': type == inputType}">
38
+ {{textForType(type)}}
39
+ </label>
40
+ </div>
41
+ </div>
42
+ </div>
43
+ </Transition>
44
+
45
+ </div>
46
+ </div>
47
+ </template>
48
+
49
+ <script>
50
+
51
+ import { mixins } from '../mixins/mixins';
52
+
53
+ export default {
54
+ mixins: [mixins],
55
+ props: {
56
+ value: {
57
+ type: [Number,String]
58
+ },
59
+ types: {
60
+ type: Array,
61
+ default: function () {
62
+ return ['email', 'mobile'];
63
+ }
64
+ },
65
+ isInvalid: {
66
+ type: Boolean,
67
+ default: false
68
+ },
69
+ errorMessage: {
70
+ type: String,
71
+ default: 'No contact found with these details'
72
+ },
73
+ loading: {
74
+ type: Boolean,
75
+ default: false
76
+ },
77
+ disabled: {
78
+ type: Boolean,
79
+ default: false
80
+ }
81
+ },
82
+ data() {
83
+ return {
84
+ inputType: 'email',
85
+ showDropdown: false
86
+ }
87
+ },
88
+ watch: {
89
+ showDropdown: function (val) {
90
+ if (val) {
91
+ this.isInvalid = false;
92
+ }
93
+ }
94
+ },
95
+ created() {
96
+ window.addEventListener('click', this.windowClick, true);
97
+ },
98
+ beforeDestroy() {
99
+ window.removeEventListener('click', this.windowClick, true);
100
+ },
101
+ computed: {
102
+ inputVal: {
103
+ get: function () {
104
+ return this.value;
105
+ },
106
+
107
+ set: function (value) {
108
+ this.$emit('input', value);
109
+ }
110
+ },
111
+ placeholder: function () {
112
+ return this.inputType == 'email' ? 'Enter contact email address' : 'Enter contact mobile number';
113
+ }
114
+ },
115
+ methods: {
116
+ textForType(type) {
117
+ switch (type) {
118
+ case 'email':
119
+ return 'Search for a contact by email address';
120
+ case 'mobile':
121
+ return 'Search for a contact by mobile';
122
+ default:
123
+ return 'Search for a contact by ' + this.inputType;
124
+ }
125
+ },
126
+ iconForType(type) {
127
+ switch (type) {
128
+ case 'email':
129
+ return 'toggle-contact-search-icon-email'
130
+ case 'mobile':
131
+ return 'toggle-contact-search-icon-mobile'
132
+ default:
133
+ return 'toggle-contact-search-icon-email'
134
+ }
135
+ },
136
+ onEnter(e) {
137
+ this.$emit('enterPressed', {
138
+ type: this.inputType,
139
+ value: e.target.value
140
+ });
141
+ },
142
+ onSearch() {
143
+ this.$emit('clickSearch', {
144
+ type: this.inputType,
145
+ value: this.inputVal
146
+ });
147
+ },
148
+ windowClick(e) {
149
+ if (!e.target.matches('.toggle-contact-search-container *')) {
150
+ this.showDropdown = false;
151
+ }
152
+ }
153
+ }
154
+ }
155
+
156
+ </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";
@@ -143,7 +144,8 @@ const Components = {
143
144
  ToggleThreeDotsButton,
144
145
  ToggleBoosterButton,
145
146
  ToggleBoosterBasicButton,
146
- ToggleBoosterModal
147
+ ToggleBoosterModal,
148
+ ToggleContactSearch
147
149
  }
148
150
 
149
151
  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
 
@@ -417,7 +418,7 @@
417
418
  .toggle-input-radio-label, .toggle-input-checkbox-label{
418
419
  opacity: 0.5;
419
420
  }
420
- .toggle-input-label, .toggle-input{
421
+ .toggle-input-label, .toggle-input, .toggle-contact-search-container{
421
422
  opacity: 0.5;
422
423
  }
423
424
  .toggle-input-select-container{
@@ -936,4 +937,261 @@ $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: 500px;
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-family: $toggle-font-family;
981
+ font-weight: 700;
982
+ font-size: 16px;
983
+ background-color: #FFFFFF;
984
+ }
985
+
986
+ .toggle-contact-search-input::placeholder {
987
+ color: #C5CED8;
988
+ opacity: 1;
989
+ }
990
+ .toggle-contact-search-input:-ms-input-placeholder {
991
+ color: #C5CED8;
992
+ opacity: 1;
993
+ }
994
+ .toggle-contact-search-input::-ms-input-placeholder {
995
+ color: #C5CED8;
996
+ opacity: 1;
997
+ }
998
+ .toggle-contact-search-input::-webkit-input-placeholder {
999
+ color: #C5CED8;
1000
+ opacity: 1;
1001
+ }
1002
+ .toggle-contact-search-input:-moz-placeholder {
1003
+ color: #C5CED8;
1004
+ opacity: 1;
1005
+ }
1006
+ .toggle-contact-search-input::-ms-placeholder {
1007
+ color: #C5CED8;
1008
+ opacity: 1;
1009
+ }
1010
+
1011
+ .toggle-contact-search-icon {
1012
+ max-width: 20px;
1013
+ max-height: 20px;
1014
+ margin: 10px 16px 0 0;
1015
+ transition: transform .2s ease-in-out;
1016
+ width: 25px;
1017
+ height: 25px;
1018
+ background-repeat: no-repeat;
1019
+ background-size: contain;
1020
+ }
1021
+
1022
+ .toggle-contact-search-icon-email {
1023
+ background-image: url('../assets/icons/email-icon.svg');
1024
+ }
1025
+
1026
+ .toggle-contact-search-icon-mobile {
1027
+ background-image: url('../assets/icons/mobile-icon.svg');
1028
+ }
1029
+
1030
+ .toggle-contact-search-icon-arrow-container:hover {
1031
+ .toggle-contact-search-icon {
1032
+ transform: scale(1.1);
1033
+ }
1034
+ }
1035
+
1036
+ .toggle-contact-search-icon-arrow-container {
1037
+ display: flex;
1038
+ width: 100px;
1039
+ min-width: 60px;
1040
+ flex-direction: row;
1041
+ justify-content: center;
1042
+ cursor: pointer;
1043
+ }
1044
+
1045
+ .toggle-contact-search-icon-arrow-container-disabled {
1046
+ cursor: default !important;
1047
+ opacity: 0.5;
1048
+ }
1049
+
1050
+ .toggle-contact-search-magnifying-glass-icon {
1051
+ cursor: pointer;
1052
+ margin: 10px 15px 0 3px;
1053
+ width: 25px;
1054
+ height: 25px;
1055
+ background-image: url('../assets/icons/magnifying-glass-icon.svg');
1056
+ background-repeat: no-repeat;
1057
+ background-size: contain;
1058
+ transition: transform .2s ease-in-out;
1059
+ }
1060
+
1061
+ .toggle-contact-search-magnifying-glass-icon:hover {
1062
+ transform: scale(1.1);
1063
+ }
1064
+
1065
+ .toggle-contact-search-magnifying-glass-icon-disabled {
1066
+ cursor: default;
1067
+ opacity: 0.5;
1068
+ }
1069
+
1070
+ .toggle-contact-search-arrow {
1071
+ margin: 17px 0px 0px;
1072
+ width: 10px;
1073
+ height: 10px;
1074
+ background-image: url('../assets/icons/arrow-icon.svg');
1075
+ background-repeat: no-repeat;
1076
+ background-size: contain;
1077
+ }
1078
+
1079
+ .toggle-contact-search-arrow-active {
1080
+ transition: all .2s ease;
1081
+ transform: rotate(-3.1416rad) translateY(5px);
1082
+ }
1083
+
1084
+ .toggle-contact-search-divider {
1085
+ height: 28px;
1086
+ margin: 7px 0 0 0;
1087
+ border-right: 2px solid #D9D9D9;
1088
+ }
1089
+
1090
+ .toggle-contact-search-dropdown-item {
1091
+ margin: 5px 5px 5px 10px;
1092
+ border-radius: 8px;
1093
+ cursor: pointer;
1094
+ font-size: 16px;
1095
+ display: flex;
1096
+ flex-direction: row;
1097
+ justify-content: left;
1098
+ align-items: center;
1099
+ padding: 5px;
1100
+ }
1101
+
1102
+ .toggle-contact-search-dropdown-item-label {
1103
+ cursor: pointer;
1104
+ font-weight: 700;
1105
+ color: #3A4A62;
1106
+ }
1107
+
1108
+ .toggle-contact-search-dropwdown-item-highlighted {
1109
+ color: #547DEE;
1110
+ }
1111
+
1112
+ .toggle-contact-search-dropdown-item:hover {
1113
+ background-color: #F5F5F5;
1114
+ color: #3A4A62;
1115
+
1116
+ .toggle-contact-search-icon-dropdown {
1117
+ transform: scale(1.1);
1118
+ }
1119
+
1120
+ .toggle-contact-search-dropdown-item-label {
1121
+ color: #3A4A62;
1122
+ }
1123
+ }
1124
+
1125
+ .toggle-contact-search-icon-dropdown {
1126
+ width: 25px;
1127
+ height: 25px;
1128
+ background-repeat: no-repeat;
1129
+ background-size: contain;
1130
+ max-width: 20px;
1131
+ max-height: 20px;
1132
+ margin: 2px 14px 0 0;
1133
+ transition: transform .2s ease-in-out;
1134
+ }
1135
+
1136
+ .toggle-contact-search-error {
1137
+ height: 16.8px;
1138
+ text-align: right;
1139
+ color: #FF6F6F;
1140
+ font-size: 12px;
1141
+ margin: 0 0 10px 0;
1142
+ }
1143
+
1144
+ .toggle-contact-search-input-disabled {
1145
+ color: #D3D9DF !important;
1146
+ }
1147
+
1148
+ .toggle-contact-search-input-disabled::placeholder,
1149
+ .toggle-contact-search-input-disabled:-ms-input-placeholder,
1150
+ .toggle-contact-search-input-disabled::-ms-input-placeholder {
1151
+ color: #D3D9DF !important;
1152
+ opacity: 1;
1153
+ }
1154
+
1155
+ .toggle-contact-search-loading-container {
1156
+ display: flex;
1157
+ align-items: center;
1158
+ margin: 0 0 3px 0;
1159
+ }
1160
+
1161
+ //
1162
+ // Contact Search Transition Styles
1163
+ //
1164
+
1165
+ .drop-down-enter-active {
1166
+ -moz-transition-duration: 0.4s;
1167
+ -webkit-transition-duration: 0.4s;
1168
+ -o-transition-duration: 0.4s;
1169
+ transition-duration: 0.4s;
1170
+ -moz-transition-timing-function: ease-in;
1171
+ -webkit-transition-timing-function: ease-in;
1172
+ -o-transition-timing-function: ease-in;
1173
+ transition-timing-function: ease-in;
1174
+ }
1175
+
1176
+ .drop-down-leave-active {
1177
+ -moz-transition-duration: 0.4s;
1178
+ -webkit-transition-duration: 0.4s;
1179
+ -o-transition-duration: 0.4s;
1180
+ transition-duration: 0.4s;
1181
+ -moz-transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
1182
+ -webkit-transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
1183
+ -o-transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
1184
+ transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
1185
+ }
1186
+
1187
+ .drop-down-enter-to,
1188
+ .drop-down-leave {
1189
+ max-height: 100px;
1190
+ overflow: hidden;
1191
+ }
1192
+
1193
+ .drop-down-enter,
1194
+ .drop-down-leave-to {
1195
+ overflow: hidden;
1196
+ max-height: 0;
939
1197
  }
@@ -43,6 +43,22 @@
43
43
  height: 2rem;
44
44
  }
45
45
 
46
+ .toggle-inline-loader-container {
47
+ position: relative;
48
+ display: inline-block;
49
+ }
50
+
51
+ .toggle-inline-loader {
52
+ box-sizing: content-box;
53
+ border-radius: 50%;
54
+ border: .25rem solid $toggle-button-disabled;
55
+ border-top-color: $toggle-white;
56
+ animation: spin 1s infinite linear;
57
+ width: 16px;
58
+ height: 16px;
59
+ margin: 8px 12px 0 0;
60
+ }
61
+
46
62
  /*
47
63
  * ToggleProgressLoader
48
64
  */
package/src/.DS_Store DELETED
Binary file