toggle-components-library 1.10.1

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.
Files changed (149) hide show
  1. package/README.md +24 -0
  2. package/babel.config.js +5 -0
  3. package/dist/demo.html +10 -0
  4. package/dist/img/add_circle.7c6b29c6.svg +29 -0
  5. package/dist/img/arrow-left-blue-hover.5b0a1e54.svg +32 -0
  6. package/dist/img/arrow-left-blue.1e5404dd.svg +32 -0
  7. package/dist/img/arrow-right-blue-hover.b800a882.svg +32 -0
  8. package/dist/img/arrow-right-blue.fbc83729.svg +32 -0
  9. package/dist/img/arrow_down.787e1a8b.svg +28 -0
  10. package/dist/img/calendar.16f176cd.svg +37 -0
  11. package/dist/img/card.e1735960.svg +9 -0
  12. package/dist/img/checkbox_blank.907b325c.svg +6 -0
  13. package/dist/img/checkbox_checked.3e2d399f.svg +9 -0
  14. package/dist/img/checkbox_hover.e99ab40c.svg +3 -0
  15. package/dist/img/checkbox_inactive.b94b6c81.svg +9 -0
  16. package/dist/img/circle_blank.ab1622db.svg +24 -0
  17. package/dist/img/clipboard.e483ded3.svg +12 -0
  18. package/dist/img/delete-grey.cf15dcd1.svg +29 -0
  19. package/dist/img/delete.ee71bb54.svg +29 -0
  20. package/dist/img/drag_drop.0c778868.svg +14 -0
  21. package/dist/img/draggable.7493006c.svg +1 -0
  22. package/dist/img/edit_circle.4f3826d3.svg +34 -0
  23. package/dist/img/edit_circle_grey.0c96938c.svg +34 -0
  24. package/dist/img/email.078e944d.svg +7 -0
  25. package/dist/img/file.f4fb9e5d.svg +9 -0
  26. package/dist/img/graph.7f2e3985.svg +16 -0
  27. package/dist/img/grey_cross.2ac5fda1.svg +15 -0
  28. package/dist/img/info.4b233da4.svg +29 -0
  29. package/dist/img/megaphone.73161a8a.svg +19 -0
  30. package/dist/img/orders.51f8963f.svg +29 -0
  31. package/dist/img/search.db8f673f.svg +25 -0
  32. package/dist/img/tick-grey.b6d7b16c.svg +12 -0
  33. package/dist/img/tick.97f35963.svg +12 -0
  34. package/dist/img/tick_circle.417fd97d.svg +28 -0
  35. package/dist/img/tick_circle_grey.92b7e747.svg +32 -0
  36. package/dist/img/upload.9b0f1f1c.svg +30 -0
  37. package/dist/toggle-components-library.common.js +17714 -0
  38. package/dist/toggle-components-library.common.js.map +1 -0
  39. package/dist/toggle-components-library.css +1 -0
  40. package/dist/toggle-components-library.umd.js +17724 -0
  41. package/dist/toggle-components-library.umd.js.map +1 -0
  42. package/dist/toggle-components-library.umd.min.js +9 -0
  43. package/dist/toggle-components-library.umd.min.js.map +1 -0
  44. package/package-lock.json +20271 -0
  45. package/package.json +78 -0
  46. package/public/favicon.ico +0 -0
  47. package/public/index.html +17 -0
  48. package/src/assets/ProximaNova-Regular.otf +0 -0
  49. package/src/assets/icons/add_circle.svg +29 -0
  50. package/src/assets/icons/arrow-left-blue-hover.svg +32 -0
  51. package/src/assets/icons/arrow-left-blue.svg +32 -0
  52. package/src/assets/icons/arrow-right-blue-hover.svg +32 -0
  53. package/src/assets/icons/arrow-right-blue.svg +32 -0
  54. package/src/assets/icons/arrow_down.svg +28 -0
  55. package/src/assets/icons/calendar.svg +37 -0
  56. package/src/assets/icons/card.svg +9 -0
  57. package/src/assets/icons/checkbox_blank.svg +6 -0
  58. package/src/assets/icons/checkbox_checked.svg +9 -0
  59. package/src/assets/icons/checkbox_hover.svg +3 -0
  60. package/src/assets/icons/checkbox_inactive.svg +9 -0
  61. package/src/assets/icons/circle_blank.svg +24 -0
  62. package/src/assets/icons/clipboard.svg +12 -0
  63. package/src/assets/icons/delete-grey.svg +29 -0
  64. package/src/assets/icons/delete.svg +29 -0
  65. package/src/assets/icons/drag.svg +15 -0
  66. package/src/assets/icons/drag_drop.svg +14 -0
  67. package/src/assets/icons/draggable.svg +1 -0
  68. package/src/assets/icons/draggable.textClipping +0 -0
  69. package/src/assets/icons/edit_circle.svg +34 -0
  70. package/src/assets/icons/edit_circle_grey.svg +34 -0
  71. package/src/assets/icons/email.svg +7 -0
  72. package/src/assets/icons/file.svg +9 -0
  73. package/src/assets/icons/graph.svg +16 -0
  74. package/src/assets/icons/grey_cross.svg +15 -0
  75. package/src/assets/icons/info.svg +29 -0
  76. package/src/assets/icons/megaphone.svg +19 -0
  77. package/src/assets/icons/orders.svg +29 -0
  78. package/src/assets/icons/search.svg +25 -0
  79. package/src/assets/icons/tick-grey.svg +12 -0
  80. package/src/assets/icons/tick.svg +12 -0
  81. package/src/assets/icons/tick_circle.svg +28 -0
  82. package/src/assets/icons/tick_circle_grey.svg +32 -0
  83. package/src/assets/icons/upload.svg +30 -0
  84. package/src/assets/img/airship.svg +42 -0
  85. package/src/assets/img/toggle.svg +1 -0
  86. package/src/assets/logo.png +0 -0
  87. package/src/components/badges/ToggleBadge.vue +23 -0
  88. package/src/components/breadcrumb/ToggleBreadCrumb.vue +43 -0
  89. package/src/components/buttons/ToggleButton.vue +88 -0
  90. package/src/components/buttons/ToggleFeatureButton.vue +68 -0
  91. package/src/components/elements/ToggleLineBreak.vue +9 -0
  92. package/src/components/forms/ToggleColourPicker.vue +192 -0
  93. package/src/components/forms/ToggleDatePicker.vue +168 -0
  94. package/src/components/forms/ToggleDateRangePicker.vue +208 -0
  95. package/src/components/forms/ToggleInputCheckbox.vue +74 -0
  96. package/src/components/forms/ToggleInputCheckboxContainer.vue +65 -0
  97. package/src/components/forms/ToggleInputCheckboxInline.vue +74 -0
  98. package/src/components/forms/ToggleInputCrudField.vue +95 -0
  99. package/src/components/forms/ToggleInputCurrency.vue +198 -0
  100. package/src/components/forms/ToggleInputFile.vue +101 -0
  101. package/src/components/forms/ToggleInputGrid.vue +409 -0
  102. package/src/components/forms/ToggleInputGroup.vue +48 -0
  103. package/src/components/forms/ToggleInputImage.vue +168 -0
  104. package/src/components/forms/ToggleInputNumber.vue +164 -0
  105. package/src/components/forms/ToggleInputPercentage.vue +142 -0
  106. package/src/components/forms/ToggleInputRadioButtonGroup.vue +81 -0
  107. package/src/components/forms/ToggleInputRadioButtons.vue +136 -0
  108. package/src/components/forms/ToggleInputSearch.vue +235 -0
  109. package/src/components/forms/ToggleInputSelect.vue +109 -0
  110. package/src/components/forms/ToggleInputText.vue +130 -0
  111. package/src/components/forms/ToggleInputTextArea.vue +123 -0
  112. package/src/components/forms/ToggleInputWebsite.vue +163 -0
  113. package/src/components/forms/ToggleInternationalPhoneInputSelect.vue +166 -0
  114. package/src/components/loaders/ToggleFillLoader.vue +34 -0
  115. package/src/components/mixins/mixins.js +48 -0
  116. package/src/components/modals/ToggleModal.vue +83 -0
  117. package/src/components/navs/sidenav/ToggleSideNav.vue +45 -0
  118. package/src/components/navs/sidenav/ToggleSideNavItem.vue +32 -0
  119. package/src/components/navs/sidenav/ToggleSideSubNav.vue +24 -0
  120. package/src/components/notifications/ToggleNotifications.vue +93 -0
  121. package/src/components/tables/TogglePagination.vue +114 -0
  122. package/src/components/tables/ToggleTable.vue +178 -0
  123. package/src/components/tables/ToggleTableColumn.vue +3 -0
  124. package/src/components/tables/ToggleTableRow.vue +5 -0
  125. package/src/components/text/ToggleHeaderTextLarge.vue +3 -0
  126. package/src/components/text/ToggleHelperTextSmall.vue +3 -0
  127. package/src/components/text/ToggleInfoText.vue +3 -0
  128. package/src/components/text/ToggleTextClipboardCopy.vue +51 -0
  129. package/src/index.js +105 -0
  130. package/src/sass/includes/_as_animations.scss +8 -0
  131. package/src/sass/includes/_as_badges.scss +27 -0
  132. package/src/sass/includes/_as_breadcrumb.scss +39 -0
  133. package/src/sass/includes/_as_buttons.scss +235 -0
  134. package/src/sass/includes/_as_elements.scss +3 -0
  135. package/src/sass/includes/_as_fonts.scss +12 -0
  136. package/src/sass/includes/_as_globals.scss +1 -0
  137. package/src/sass/includes/_as_gridbuilder.scss +136 -0
  138. package/src/sass/includes/_as_inputs.scss +900 -0
  139. package/src/sass/includes/_as_loader.scss +37 -0
  140. package/src/sass/includes/_as_loaders.scss +41 -0
  141. package/src/sass/includes/_as_modals.scss +83 -0
  142. package/src/sass/includes/_as_navs.scss +120 -0
  143. package/src/sass/includes/_as_notifications.scss +30 -0
  144. package/src/sass/includes/_as_sizes.scss +4 -0
  145. package/src/sass/includes/_as_table.scss +276 -0
  146. package/src/sass/includes/_as_text.scss +73 -0
  147. package/src/sass/includes/_as_variables.scss +49 -0
  148. package/src/sass/main.scss +20 -0
  149. package/vue.config.js +8 -0
@@ -0,0 +1,235 @@
1
+ <template>
2
+
3
+ <div class="toggle-input-container" :class="{'toggle-input-is-invalid':isInvalid, 'toggle-input-is-disabled':disabled }" v-on:click="focusClosestInput" ref="toggle-input-search">
4
+ <label
5
+ v-if="label"
6
+ :for="name ? name : 'InputText' "
7
+ class="toggle-input-label"
8
+ > {{ label }}
9
+ </label>
10
+ <span class="toggle-input-counter" v-if="maxLength">{{messageLength(inputVal, maxLength)}}</span>
11
+ <input
12
+ :type="type"
13
+ :name="name ? name : 'ToggleInputText' "
14
+ :class="[ 'toggle-input']"
15
+ :placeholder="placeholder ? placeholder : '' "
16
+ :autocomplete="'off' "
17
+ :required="required"
18
+ v-model="searchModel"
19
+ :maxlength="maxLength"
20
+ :disabled="disabled"
21
+ />
22
+ <div class="toggle-input-search-options-container">
23
+ <ul class="toggle-input-search-options" v-if="showOptions">
24
+ <li v-if="showAddButton" @click="addOption(searchModel)">
25
+ <ToggleButton buttonStyle="neutral" :buttonText="'Add ' + '<strong>\'' +searchModel + '\'</strong>'" />
26
+ </li>
27
+ <li v-for="option in filteredOptions" :key="option.value" @click="selectOption(option)">
28
+ {{option.label}}
29
+ </li>
30
+ </ul>
31
+ </div>
32
+
33
+ <label
34
+ class="toggle-input-label-error"
35
+ v-if="isInvalid"
36
+ :for="name ? name : 'ToggleInputText' "
37
+ >
38
+ {{ errorMessage }}
39
+ </label>
40
+ </div>
41
+ </template>
42
+
43
+ <script>
44
+
45
+ import { mixins } from '../mixins/mixins'
46
+ import ToggleButton from '../buttons/ToggleButton.vue';
47
+
48
+ export default {
49
+ mixins:[mixins],
50
+ props: {
51
+ value: {
52
+ type: [
53
+ Object,
54
+ null
55
+ ]
56
+ },
57
+ allowAddValue:{
58
+ type: Boolean,
59
+ required:false,
60
+ default:false
61
+ },
62
+ options:{
63
+ type: Array
64
+ },
65
+ type: {
66
+ type: String,
67
+ required: true,
68
+ validator: function (value) {
69
+ return ['text', 'email', 'number'].indexOf(value) !== -1
70
+ }
71
+ },
72
+ name: {
73
+ type: String,
74
+ default: "ToggleInputText"
75
+ },
76
+ label: {
77
+ type: String,
78
+ required: false
79
+ },
80
+ placeholder: {
81
+ type: String,
82
+ required: false
83
+ },
84
+ autocomplete: {
85
+ type: Boolean,
86
+ default: true
87
+ },
88
+ required: {
89
+ type: Boolean,
90
+ default: false
91
+ },
92
+ isInvalid: {
93
+ type: Boolean,
94
+ default: false
95
+ },
96
+ errorMessage: {
97
+ type: String,
98
+ required: false
99
+ },
100
+ maxLength:{
101
+ type: Number,
102
+ required:false
103
+ },
104
+ disabled: {
105
+ type: Boolean,
106
+ default: false
107
+ }
108
+ },
109
+
110
+ created : function(){
111
+ window.addEventListener('click', this.windowClick, true);
112
+ },
113
+ beforeDestroy(){
114
+ window.removeEventListener('click', this.windowClick, true);
115
+ },
116
+
117
+ components: {
118
+ ToggleButton
119
+ },
120
+ data : function(){
121
+ return {
122
+ savedSearchModel:'',
123
+ inputFocussed:false
124
+ };
125
+ },
126
+ computed: {
127
+
128
+ searchModel:
129
+ {
130
+ get: function (){
131
+ if(this.inputFocussed && !this.disabled)
132
+ return this.savedSearchModel;
133
+ else
134
+ return this.value !== null ? this.value.label : '';
135
+ },
136
+ set: function (value){
137
+ return this.savedSearchModel = value;
138
+ }
139
+ },
140
+
141
+ // should the add option show?
142
+ showAddButton()
143
+ {
144
+ return (!this.filteredOptions.length || !this.exactMatch) && this.allowAddValue && this.searchModel
145
+ },
146
+
147
+ // should options dropdown show?
148
+ showOptions()
149
+ {
150
+ return !this.disabled && this.inputFocussed &&
151
+ (
152
+ (
153
+ this.searchModel &&
154
+ (
155
+ this.value == null || this.searchModel != this.value.label)
156
+ ) ||
157
+ !this.searchModel
158
+ );
159
+ },
160
+
161
+ /*
162
+ * does the search query exactly match an option?
163
+ * returns bool
164
+ */
165
+ exactMatch()
166
+ {
167
+ return this.options.filter(option => option.label.toLowerCase() == this.searchModel.toLowerCase()).length != 0;
168
+ },
169
+
170
+ /*
171
+ * Returns options that contain the search query
172
+ * returns array
173
+ */
174
+ filteredOptions()
175
+ {
176
+ return this.options.filter(option => option.label.toLowerCase().includes(this.searchModel.toLowerCase()));
177
+ },
178
+
179
+ // the input model
180
+ inputVal: {
181
+ get: function (){
182
+ return this.value;
183
+ },
184
+ set: function (value){
185
+ this.$emit('input', value);
186
+ }
187
+ }
188
+ },
189
+ methods: {
190
+
191
+ // select an option from the options list
192
+ selectOption(option)
193
+ {
194
+ this.searchModel = option.label;
195
+ this.inputVal = option;
196
+ },
197
+
198
+ // add option to options list
199
+ addOption(option)
200
+ {
201
+ this.searchModel = option;
202
+ this.inputVal = {value:'', label:option};
203
+ },
204
+
205
+ /*
206
+ * Concat message for count characters
207
+ * @return string
208
+ */
209
+ messageLength(count, maxLenght)
210
+ {
211
+ let mcount = count ? count.length : 0;
212
+ return mcount+' / '+maxLenght;
213
+ },
214
+
215
+ windowClick(e)
216
+ {
217
+
218
+ var element = this.$refs["toggle-input-search"];
219
+
220
+ if (e.target !== element && !element.contains(e.target)) {
221
+ this.inputFocussed = false;
222
+ }else{
223
+ this.inputFocussed = true;
224
+ }
225
+
226
+ }
227
+
228
+
229
+
230
+
231
+ }
232
+ }
233
+
234
+
235
+ </script>
@@ -0,0 +1,109 @@
1
+ <template>
2
+
3
+ <div class="toggle-input-container" :class="{'toggle-input-is-invalid':isInvalid }" v-on:click="focusClosestInput">
4
+ <label
5
+ v-if="label"
6
+ :for="name ? name : 'ToggleInputSelect' "
7
+ class="toggle-input-label"
8
+ > {{ label }}
9
+ </label>
10
+
11
+ <div class="toggle-input-select-container">
12
+ <select
13
+ :name="name ? name : 'ToggleInputSelect' "
14
+ :class="[ 'toggle-input-select', size]"
15
+ v-model="inputVal"
16
+ :autocomplete="autocomplete ? 'on' : 'off' "
17
+ :required="required"
18
+ >
19
+ <option value="">Select an option</option>
20
+ <option :value="option.value" v-for="(option, key) in options" v-bind:key="key">{{option.label}}</option>
21
+ </select>
22
+ </div>
23
+
24
+ <label
25
+ class="toggle-input-label-error"
26
+ v-if="isInvalid"
27
+ :for="name ? name : 'ToggleInputText' "
28
+ >
29
+ {{ errorMessage }}
30
+ </label>
31
+ </div>
32
+ </template>
33
+
34
+ <script>
35
+
36
+ import { mixins } from '../mixins/mixins'
37
+
38
+ export default {
39
+ mixins:[mixins],
40
+ props: {
41
+ value: {},
42
+ name: {
43
+ type: String,
44
+ default: "ToggleInputText"
45
+ },
46
+ options: {
47
+ type: Array,
48
+ required: true
49
+ },
50
+ label: {
51
+ type: String,
52
+ required: false
53
+ },
54
+ autocomplete: {
55
+ type: Boolean,
56
+ default: true
57
+ },
58
+ size: {
59
+ type: String,
60
+ validator: function (value) {
61
+ return ['extra-small', 'small', 'medium', 'large', 'full'].indexOf(value) !== -1
62
+ }
63
+ },
64
+ required: {
65
+ type: Boolean,
66
+ default: false
67
+ },
68
+ isInvalid: {
69
+ type: Boolean,
70
+ default: false
71
+ },
72
+ errorMessage: {
73
+ type: String,
74
+ required: false
75
+ }
76
+ },
77
+
78
+ created : function(){
79
+ },
80
+ computed: {
81
+ inputVal: {
82
+ get: function (){
83
+ return this.value;
84
+ },
85
+
86
+ set: function (value){
87
+ this.$emit('input', value);
88
+ }
89
+ }
90
+ },
91
+ methods: {
92
+ onFocus() {
93
+ this.$emit('onFocus');
94
+ },
95
+
96
+ onBlur(){
97
+ this.$emit('onBlur');
98
+ },
99
+ },
100
+ watch: {
101
+ options(options) {
102
+ if (options.filter( option => option.value == this.inputVal).length == 0)
103
+ this.inputVal = "";
104
+ }
105
+ }
106
+ }
107
+
108
+
109
+ </script>
@@ -0,0 +1,130 @@
1
+ <template>
2
+
3
+ <div class="toggle-input-container" :class="{'toggle-input-is-invalid':isInvalid, 'toggle-input-is-disabled':disabled}" v-on:click="focusClosestInput">
4
+ <label
5
+ v-if="label"
6
+ :for="name ? name : 'InputText' "
7
+ class="toggle-input-label"
8
+ > {{ label }}
9
+ </label>
10
+ <span class="toggle-input-counter" v-if="maxLength">{{messageLength(inputVal, maxLength)}}</span>
11
+ <input
12
+ :type="type"
13
+ :name="name ? name : 'ToggleInputText' "
14
+ :class="[ 'toggle-input', size]"
15
+ :placeholder="placeholder ? placeholder : '' "
16
+ :autocomplete="autocomplete ? 'on' : 'off' "
17
+ :required="required"
18
+ v-model="inputVal"
19
+ :maxlength="maxLength"
20
+ :disabled="disabled"
21
+ />
22
+ <label
23
+ class="toggle-input-label-error"
24
+ v-if="isInvalid"
25
+ :for="name ? name : 'ToggleInputText' "
26
+ >
27
+ {{ errorMessage }}
28
+ </label>
29
+ </div>
30
+ </template>
31
+
32
+ <script>
33
+
34
+ import { mixins } from '../mixins/mixins'
35
+
36
+ export default {
37
+ mixins:[mixins],
38
+ props: {
39
+ value: {
40
+ type: [Number,String]
41
+ },
42
+ type: {
43
+ type: String,
44
+ required: true,
45
+ validator: function (value) {
46
+ return ['text', 'email', 'number', 'password'].indexOf(value) !== -1
47
+ }
48
+ },
49
+ name: {
50
+ type: String,
51
+ default: "ToggleInputText"
52
+ },
53
+ label: {
54
+ type: String,
55
+ required: false
56
+ },
57
+ placeholder: {
58
+ type: String,
59
+ required: false
60
+ },
61
+ autocomplete: {
62
+ type: Boolean,
63
+ default: true
64
+ },
65
+ size: {
66
+ type: String,
67
+ validator: function (value) {
68
+ return ['extra-small', 'small', 'medium', 'large', 'full'].indexOf(value) !== -1
69
+ }
70
+ },
71
+ required: {
72
+ type: Boolean,
73
+ default: false
74
+ },
75
+ isInvalid: {
76
+ type: Boolean,
77
+ default: false
78
+ },
79
+ errorMessage: {
80
+ type: String,
81
+ required: false
82
+ },
83
+ maxLength:{
84
+ type: Number,
85
+ required:false
86
+ },
87
+ disabled: {
88
+ type: Boolean,
89
+ required: false,
90
+ default: false
91
+ }
92
+ },
93
+
94
+ created : function(){
95
+ },
96
+ computed: {
97
+ inputVal: {
98
+ get: function (){
99
+ return this.value;
100
+ },
101
+
102
+ set: function (value){
103
+ this.$emit('input', value);
104
+ }
105
+ }
106
+ },
107
+ methods: {
108
+
109
+ /*
110
+ * Concat message for count characters
111
+ * @return string
112
+ */
113
+ messageLength(count, maxLenght)
114
+ {
115
+ let mcount = count ? count.length : 0;
116
+ return mcount+' / '+maxLenght;
117
+ },
118
+
119
+ onFocus() {
120
+ this.$emit('onFocus');
121
+ },
122
+
123
+ onBlur(){
124
+ this.$emit('onBlur');
125
+ },
126
+ }
127
+ }
128
+
129
+
130
+ </script>
@@ -0,0 +1,123 @@
1
+ <template>
2
+
3
+ <div class="toggle-input-container" :class="{'toggle-input-is-invalid':isInvalid }" v-on:click="focusClosestInput">
4
+ <label
5
+ v-if="label"
6
+ :for="name ? name : 'InputText' "
7
+ class="toggle-input-label"
8
+ > {{ label }}
9
+ </label>
10
+ <span class="toggle-input-counter" v-if="maxLength">{{messageLength(inputVal, maxLength)}}</span>
11
+ <textarea
12
+ :name="name ? name : 'ToggleInputText' "
13
+ :class="['toggle-input', height ? 'height-'+height : '', size]"
14
+ :placeholder="placeholder ? placeholder : '' "
15
+ :autocomplete="autocomplete ? 'on' : 'off' "
16
+ :required="required"
17
+ v-model="inputVal"
18
+ :maxlength="maxLength"
19
+ />
20
+ <label
21
+ class="toggle-input-label-error"
22
+ v-if="isInvalid"
23
+ :for="name ? name : 'ToggleInputText' "
24
+ >
25
+ {{ errorMessage }}
26
+ </label>
27
+ </div>
28
+ </template>
29
+
30
+ <script>
31
+
32
+ import { mixins } from '../mixins/mixins'
33
+
34
+ export default {
35
+ mixins:[mixins],
36
+ props: {
37
+ value: {
38
+ type: [Number,String]
39
+ },
40
+ name: {
41
+ type: String,
42
+ default: "ToggleInputText"
43
+ },
44
+ label: {
45
+ type: String,
46
+ required: false
47
+ },
48
+ placeholder: {
49
+ type: String,
50
+ required: false
51
+ },
52
+ autocomplete: {
53
+ type: Boolean,
54
+ default: true
55
+ },
56
+ size: {
57
+ type: String,
58
+ validator: function (value) {
59
+ return ['extra-small', 'small', 'medium', 'large', 'full'].indexOf(value) !== -1
60
+ }
61
+ },
62
+ height: {
63
+ type: String,
64
+ validator: function (value) {
65
+ return ['medium', 'large', 'extra-large'].indexOf(value) !== -1
66
+ },
67
+ required: false
68
+ },
69
+ required: {
70
+ type: Boolean,
71
+ default: false
72
+ },
73
+ isInvalid: {
74
+ type: Boolean,
75
+ default: false
76
+ },
77
+ errorMessage: {
78
+ type: String,
79
+ required: false
80
+ },
81
+ maxLength:{
82
+ type: Number,
83
+ required:false
84
+ }
85
+ },
86
+
87
+ created : function(){
88
+ },
89
+ computed: {
90
+ inputVal: {
91
+ get: function (){
92
+ return this.value;
93
+ },
94
+
95
+ set: function (value){
96
+ this.$emit('input', value);
97
+ }
98
+ }
99
+ },
100
+ methods: {
101
+
102
+ /*
103
+ * Concat message for count characters
104
+ * @return string
105
+ */
106
+ messageLength(count, maxLenght)
107
+ {
108
+ let mcount = count ? count.length : 0;
109
+ return mcount+' / '+maxLenght;
110
+ },
111
+
112
+ onFocus() {
113
+ this.$emit('onFocus');
114
+ },
115
+
116
+ onBlur(){
117
+ this.$emit('onBlur');
118
+ },
119
+ }
120
+ }
121
+
122
+
123
+ </script>