toggle-components-library 1.28.5-beta.1 → 1.28.6

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.
@@ -1,3 +0,0 @@
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>
@@ -1,3 +0,0 @@
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>
@@ -1,3 +0,0 @@
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>
@@ -1,6 +0,0 @@
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>
@@ -1,150 +0,0 @@
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' ? this.emailIconSrc : this.mobileIconSrc;
92
- },
93
- emailIconSrc() {
94
- const emailIcon = new Image();
95
- emailIcon.src = require('../../assets/icons/email-icon.svg');
96
- return emailIcon.src;
97
- },
98
- mobileIconSrc() {
99
- const mobileIcon = new Image();
100
- mobileIcon.src = require('../../assets/icons/mobile-icon.svg');
101
- return mobileIcon.src;
102
- },
103
- arrowIconSrc() {
104
- const arrowIcon = new Image();
105
- arrowIcon.src = require('../../assets/icons/arrow-icon.svg');
106
- return arrowIcon.src;
107
- },
108
- searchIconSrc() {
109
- const searchIcon = new Image();
110
- searchIcon.src = require('../../assets/icons/magnifying-glass-icon.svg');
111
- return searchIcon.src;
112
- }
113
- },
114
- methods: {
115
- textForType(type) {
116
- switch (type) {
117
- case 'email':
118
- return 'Search for a contact by email address';
119
- case 'mobile':
120
- return 'Search for a contact by mobile';
121
- default:
122
- return 'Search for a contact by ' + this.inputType;
123
- }
124
- },
125
- iconForType(type) {
126
- switch (type) {
127
- case 'email':
128
- return this.emailIconSrc;
129
- case 'mobile':
130
- return this.mobileIconSrc;
131
- default:
132
- return this.emailIconSrc;
133
- }
134
- },
135
- onEnter(e) {
136
- this.$emit('enterPressed', {
137
- type: this.inputType,
138
- value: e.target.value
139
- });
140
- },
141
- onSearch() {
142
- this.$emit('clickSearch', {
143
- type: this.inputType,
144
- value: this.inputVal
145
- });
146
- }
147
- }
148
- }
149
-
150
- </script>