adata-ui 0.1.39 → 0.1.42

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-lock.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adata-ui",
3
- "version": "0.1.33",
3
+ "version": "0.1.40",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adata-ui",
3
- "version": "0.1.39",
3
+ "version": "0.1.42",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
package/src/App.vue CHANGED
@@ -1,37 +1,11 @@
1
1
  <template>
2
- <div id="app">
3
- <!-- <text-field label="Пример" v-model="value" @input="inputHandle" @enterPressed="inputHandle" />-->
4
- <search-text-field label="Пример2" v-model="value" @input="inputHandle" @enterPressed="inputHandle" :options="options" :optionFields="['id', 'name']" />
5
- </div>
2
+ <div id="app"></div>
6
3
  </template>
7
4
 
8
5
  <script>
9
-
10
- // import TextField from "./components/TextField/TextField";
11
- import SearchTextField from "./components/SearchTextField/SearchTextField";
12
-
13
6
  export default {
14
- name: 'App',
15
- components: {
16
- // TextField,
17
- SearchTextField
18
- },
19
- data() {
20
- return {
21
- value: "",
22
- options: [{
23
- id: 1,
24
- name: "reg"
25
- }
26
- ]
27
- }
28
- },
29
- methods: {
30
- inputHandle(val) {
31
- console.log(val);
32
- }
33
- }
34
- }
7
+ name: "App",
8
+ };
35
9
  </script>
36
10
 
37
11
  <style>
@@ -2,7 +2,7 @@
2
2
  <header class="a-header" :class="[{'bordered': isBordered}, {'fixed': isFixed}]">
3
3
  <div class="container">
4
4
  <div class="a-header__left">
5
- <a class="logo" :href="toAdtdev('https://adata.kz')">
5
+ <a class="logo" :href="main[mode]">
6
6
  <svg class="adata-logo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 166 48">
7
7
  <path d="M62.926 38.22v-28h10.316c10.342 0 15.511 4.55 15.508 13.652 0 4.36-1.41 7.843-4.232 10.448-2.822 2.605-6.58 3.907-11.276 3.904l-10.316-.004zm6.56-22.868v17.752h3.248c2.839 0 5.069-.82 6.69-2.46 1.622-1.64 2.43-3.873 2.424-6.7 0-2.667-.8-4.767-2.403-6.3-1.602-1.533-3.853-2.297-6.752-2.292h-3.206zM118.5 38.22h-7.131l-2.079-6.228H98.958l-2.079 6.228h-7.093l10.598-28h7.775l10.341 28zm-10.723-11.072l-3.127-9.416a11.94 11.94 0 01-.486-2.516h-.162c-.07.83-.24 1.649-.508 2.44l-3.168 9.492h7.451zm31.833-11.796h-8.316V38.22h-6.557V15.352h-8.274v-5.136h23.147v5.136zM166 38.22h-7.143l-2.079-6.228h-10.349l-2.05 6.228h-7.106l10.598-28h7.776l10.353 28zm-10.719-11.072l-3.127-9.416a11.94 11.94 0 01-.486-2.516h-.163c-.069.83-.239 1.649-.507 2.44l-3.168 9.492h7.451zM24.553 15.252h-.163c-.069.83-.24 1.649-.507 2.44L20.715 27.2h7.45l-3.126-9.412a12.02 12.02 0 01-.486-2.536z"></path>
8
8
  <path d="M44.905 0H4.99a5.091 5.091 0 00-3.528 1.406A4.71 4.71 0 000 4.8v38.4a4.71 4.71 0 001.461 3.394A5.091 5.091 0 004.99 48h39.916a5.091 5.091 0 003.528-1.406 4.71 4.71 0 001.462-3.394V4.8a4.71 4.71 0 00-1.462-3.394A5.091 5.091 0 0044.905 0zM31.737 38.26l-2.079-6.232H19.305l-2.05 6.232h-7.097l10.598-28h7.776l10.353 28h-7.148z"></path>
@@ -13,7 +13,7 @@
13
13
  :key="index"
14
14
  class="menu__wrapper menu__items"
15
15
  :class="{active: item.key === activeTabKey}"
16
- :href="toAdtdev(item.url)"
16
+ :href="item[mode]"
17
17
  >
18
18
  {{ item.name }}
19
19
  </a>
@@ -23,7 +23,7 @@
23
23
  <slot name="chooseCountry"></slot>
24
24
  <Profile
25
25
  v-bind:profileDropDown="profileDropDown"
26
- :isDev="isDev"
26
+ :mode="mode"
27
27
  :isAuthenticated="isAuthenticated"
28
28
  :requestCount="requestCount"
29
29
  :daysRemaining="daysRemaining"
@@ -75,7 +75,7 @@
75
75
 
76
76
  <script>
77
77
  import Profile from "./Profile";
78
- import { profileDropDown } from "@/configs/profileDropDown"
78
+ import { profileDropDown } from "../../configs/profileDropDown"
79
79
  import MobileToggle from "../transitions/VerticalMobileToggle";
80
80
 
81
81
  export default {
@@ -133,6 +133,11 @@ export default {
133
133
  data() {
134
134
  return {
135
135
  profileDropDown,
136
+ main: {
137
+ dev: 'https://adtdev.kz',
138
+ prod: 'https://adata.kz',
139
+ staging: 'https://adada.kz'
140
+ },
136
141
  subheaderItems: [
137
142
  {
138
143
  id: 1,
@@ -241,9 +241,12 @@ export default {
241
241
  clickOutside: vClickOutside.directive,
242
242
  },
243
243
  props: {
244
- isDev: {
245
- type: Boolean,
246
- default: false
244
+ mode: {
245
+ type: String,
246
+ required: true,
247
+ validator: function (value) {
248
+ return ['prod', 'dev', 'staging'].indexOf(value) !== -1
249
+ }
247
250
  },
248
251
  profileDropDown: {
249
252
  type: Array,
@@ -316,28 +319,25 @@ export default {
316
319
  },
317
320
  async showModal(url, name) {
318
321
  if (name.includes('Текущий')) {
319
- if(window.location.href.includes(this.toAdtdev(url))) {
322
+ if(window.location.href.includes(url)) {
320
323
  this.$emit("setIsReplenishModal", true);
321
324
  this.setShowModal(true);
322
325
  } else {
323
- await window.open(this.toAdtdev(url) + "&modal=show", "_self")
326
+ await window.open(url + "&modal=show", "_self")
324
327
  }
325
328
  }
326
329
  },
327
330
  handleClick(url, name) {
328
331
  if (!name.includes('Текущий')) {
329
- window.open(this.toAdtdev(url), "_self");
330
- this.active = false;
331
- if (this.chosenElem) this.chosenElem.opened = false;
332
+ window.open(url, "_self");
333
+ // this.active = false;
334
+ // if (this.chosenElem) this.chosenElem.opened = false;
332
335
  }
333
336
  },
334
337
  rotateItem(index) {
335
338
  this.chosenElem = this.listDropDown[index];
336
339
  this.$set(this.listDropDown[index], 'opened', !this.listDropDown[index].opened)
337
340
  },
338
- toAdtdev(url) {
339
- return this.isDev ? url.replace("adata", "adtdev") : url;
340
- }
341
341
  }
342
342
  };
343
343
  </script>
@@ -1,52 +1,86 @@
1
1
  <template>
2
- <div class="adt-text-block"
3
- v-click-outside="onOutsideClick"
4
- @keydown.down.up.prevent="onUpOrDownClicked"
2
+ <div
3
+ class="adt-text-block"
4
+ v-click-outside="onOutsideClick"
5
+ @keydown.down.up.prevent="onUpOrDownClicked"
5
6
  >
6
7
  <div :class="['adt-text-block__field', { error: !!errorText }]">
7
8
  <input
8
- ref="input"
9
- :type="type"
10
- v-mask="mask"
11
- v-model="value"
12
- :placeholder="placeholder"
13
- required
14
- @keyup.enter="pressedEnter"
15
- @input="inputHandler"
16
- @focus="showAutocomplete = true"
17
- @click="$emit('showVTour')"
18
- class="adt-text-block__input"
19
- :class="{ error: !!errorText }"
9
+ ref="input"
10
+ :type="type"
11
+ :value="value"
12
+ :placeholder="placeholder"
13
+ required
14
+ @keyup.enter="enterPressed"
15
+ @input="$emit('input', $event.target.value)"
16
+ @focus="showAutocomplete = true"
17
+ @click="$emit('showVTour')"
18
+ class="adt-text-block__input"
19
+ :class="{ error: !!errorText }"
20
20
  />
21
21
  <label class="adt-text-block__label">
22
22
  {{ label }}
23
23
  </label>
24
- <div class="adt-text-block__icon" v-if="clearable && value" @click="$emit('input', '')">
25
- <svg width="12" height="12" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="clearIcon">
26
- <path d="M2 2l12 12m0-12L2 14" stroke="#2C3E50" stroke-linecap="round" stroke-linejoin="round"></path>
24
+ <div
25
+ class="adt-text-block__icon"
26
+ v-if="clearable && value"
27
+ @click="$emit('input', '')"
28
+ >
29
+ <svg
30
+ width="12"
31
+ height="12"
32
+ fill="none"
33
+ xmlns="http://www.w3.org/2000/svg"
34
+ viewBox="0 0 16 16"
35
+ id="clearIcon"
36
+ >
37
+ <path
38
+ d="M2 2l12 12m0-12L2 14"
39
+ stroke="#2C3E50"
40
+ stroke-linecap="round"
41
+ stroke-linejoin="round"
42
+ ></path>
27
43
  </svg>
28
44
  </div>
29
45
  </div>
30
46
  <div class="adt-text-block__error" v-if="!!errorText">
31
- <svg width="14" height="14" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" id="icon__attention">
32
- <path d="M8.5 4C8.5 3.72386 8.27614 3.5 8 3.5C7.72386 3.5 7.5 3.72386 7.5 4H8.5ZM7.5 9C7.5 9.27614 7.72386 9.5 8 9.5C8.27614 9.5 8.5 9.27614 8.5 9H7.5ZM7.5 4V9H8.5V4H7.5Z" fill="#FF2E43"/>
33
- <path d="M8.5 11C8.5 10.7239 8.27614 10.5 8 10.5C7.72386 10.5 7.5 10.7239 7.5 11H8.5ZM7.5 11.5C7.5 11.7761 7.72386 12 8 12C8.27614 12 8.5 11.7761 8.5 11.5H7.5ZM7.5 11V11.5H8.5V11H7.5Z" fill="#FF2E43"/>
34
- <circle cx="8" cy="8" r="7" stroke="#FF2E43"/>
47
+ <svg
48
+ width="14"
49
+ height="14"
50
+ viewBox="0 0 16 16"
51
+ fill="none"
52
+ xmlns="http://www.w3.org/2000/svg"
53
+ id="icon__attention"
54
+ >
55
+ <path
56
+ d="M8.5 4C8.5 3.72386 8.27614 3.5 8 3.5C7.72386 3.5 7.5 3.72386 7.5 4H8.5ZM7.5 9C7.5 9.27614 7.72386 9.5 8 9.5C8.27614 9.5 8.5 9.27614 8.5 9H7.5ZM7.5 4V9H8.5V4H7.5Z"
57
+ fill="#FF2E43"
58
+ />
59
+ <path
60
+ d="M8.5 11C8.5 10.7239 8.27614 10.5 8 10.5C7.72386 10.5 7.5 10.7239 7.5 11H8.5ZM7.5 11.5C7.5 11.7761 7.72386 12 8 12C8.27614 12 8.5 11.7761 8.5 11.5H7.5ZM7.5 11V11.5H8.5V11H7.5Z"
61
+ fill="#FF2E43"
62
+ />
63
+ <circle cx="8" cy="8" r="7" stroke="#FF2E43" />
35
64
  </svg>
36
65
  {{ errorText }}
37
66
  </div>
38
- <div class="adt-text-block__options search-options" v-show="options && options.length > 0 && showAutocomplete">
67
+ <div
68
+ class="adt-text-block__options search-options"
69
+ v-show="options && options.length > 0 && showAutocomplete"
70
+ >
39
71
  <PerfectScrollbar>
40
72
  <div class="search-options__wrapper">
41
73
  <div
42
- class="search-options__item"
43
- v-for="(option, index) in options"
44
- :key="index"
45
- @click="onAutocompleteOptionClick(option)"
46
- ref="searchOptions"
74
+ class="search-options__item"
75
+ v-for="(option, index) in options"
76
+ :key="index"
77
+ @click="onAutocompleteOptionClick(option)"
78
+ ref="searchOptions"
47
79
  >
48
80
  {{ !!optionFields.length ? textByOption(option) : option }}
49
- <div class="hiddenOne" v-if="option.type && isTypeRequired"> ${{ option.type }}$</div>
81
+ <div class="hiddenOne" v-if="option.type && isTypeRequired">
82
+ ${{ option.type }}$
83
+ </div>
50
84
  </div>
51
85
  </div>
52
86
  </PerfectScrollbar>
@@ -55,8 +89,8 @@
55
89
  </template>
56
90
 
57
91
  <script>
58
- import '../../assets/style.scss';
59
- import { VueMaskDirective } from "v-mask";
92
+ import "../../assets/style.scss";
93
+
60
94
  import { PerfectScrollbar } from "vue2-perfect-scrollbar";
61
95
  import vClickOutside from "v-click-outside";
62
96
 
@@ -64,20 +98,24 @@ export default {
64
98
  name: "SearchTextField",
65
99
  directives: {
66
100
  clickOutside: vClickOutside.directive,
67
- mask: VueMaskDirective
68
101
  },
69
102
  props: {
70
103
  errorText: {
71
104
  type: String,
72
- default: ""
105
+ default: "",
73
106
  },
74
107
  placeholder: {
75
108
  type: String,
76
- default: ""
109
+ default: "",
77
110
  },
78
111
  mask: {
79
112
  type: String,
80
- default: ""
113
+ default: "",
114
+ },
115
+ value: {
116
+ type: String,
117
+ required: true,
118
+ default: "",
81
119
  },
82
120
  label: {
83
121
  type: String,
@@ -89,15 +127,15 @@ export default {
89
127
  },
90
128
  clearable: {
91
129
  type: Boolean,
92
- default: false
130
+ default: false,
93
131
  },
94
132
  isWithIcon: {
95
133
  type: Boolean,
96
- default: false
134
+ default: false,
97
135
  },
98
136
  isTypeRequired: {
99
137
  type: Boolean,
100
- default: false
138
+ default: false,
101
139
  },
102
140
  options: {
103
141
  type: Array,
@@ -105,34 +143,33 @@ export default {
105
143
  },
106
144
  optionFields: {
107
145
  type: Array,
108
- default: null
146
+ default: null,
109
147
  },
110
148
  isMobile: {
111
149
  type: Boolean,
112
- default: false
150
+ default: false,
113
151
  },
114
152
  },
115
153
  components: {
116
- PerfectScrollbar
154
+ PerfectScrollbar,
117
155
  },
118
156
  data() {
119
157
  return {
120
158
  showAutocomplete: false,
121
159
  showPlaceholder: false,
122
- value: ""
123
- }
160
+ };
124
161
  },
125
162
  computed: {
126
163
  inputPlaceholder() {
127
- return this.showPlaceholder ? this.placeholder : ""
128
- }
164
+ return this.showPlaceholder ? this.placeholder : "";
165
+ },
129
166
  },
130
167
  methods: {
131
- pressedEnter() {
132
- this.$emit('enter', this.showAutocomplete, this.value);
168
+ enterPressed() {
169
+ this.$emit("enterPressed", this.showAutocomplete);
133
170
  },
134
171
  onOutsideClick() {
135
- if (!this.isMobile) this.showAutocomplete = false
172
+ if (!this.isMobile) this.showAutocomplete = false;
136
173
  },
137
174
  onUpOrDownClicked(e) {
138
175
  const autoCompleteOptions = this.$refs.searchOptions;
@@ -140,44 +177,48 @@ export default {
140
177
  if (length > 0) {
141
178
  switch (e.which) {
142
179
  case 40:
143
- this.moveOption(autoCompleteOptions, 'nextElementSibling');
180
+ this.moveOption(autoCompleteOptions, "nextElementSibling");
144
181
  break;
145
182
  case 38:
146
- this.moveOption(autoCompleteOptions, 'previousElementSibling');
183
+ this.moveOption(autoCompleteOptions, "previousElementSibling");
147
184
  break;
148
185
  }
149
186
  }
150
187
  },
151
188
  moveOption(autoCompleteOptions, elementType) {
152
- const selectedOption = autoCompleteOptions.find((option) => option.hasAttribute('id'));
189
+ const selectedOption = autoCompleteOptions.find((option) =>
190
+ option.hasAttribute("id")
191
+ );
153
192
  if (selectedOption) {
154
193
  const siblingElement = selectedOption[elementType];
155
- this.$emit('castOption', siblingElement?.innerText || "");
156
- if (siblingElement?.classList.contains('search-options__item')) {
194
+ this.$emit("castOption", siblingElement?.innerText || "");
195
+ if (siblingElement?.classList.contains("search-options__item")) {
157
196
  selectedOption.removeAttribute("id");
158
- siblingElement.setAttribute("id", 'searchVariant');
197
+ siblingElement.setAttribute("id", "searchVariant");
159
198
  return;
160
199
  }
161
200
  selectedOption.removeAttribute("id");
162
201
  return;
163
202
  }
164
203
  let innerText = "";
165
- if (elementType === 'nextElementSibling')
204
+ if (elementType === "nextElementSibling")
166
205
  innerText = this.getAutocompleteOptionText(autoCompleteOptions?.[0]);
167
- if (elementType === 'previousElementSibling')
168
- innerText = this.getAutocompleteOptionText(autoCompleteOptions?.[autoCompleteOptions.length - 1]);
169
- this.$emit('castOption', innerText);
206
+ if (elementType === "previousElementSibling")
207
+ innerText = this.getAutocompleteOptionText(
208
+ autoCompleteOptions?.[autoCompleteOptions.length - 1]
209
+ );
210
+ this.$emit("castOption", innerText);
170
211
  },
171
212
  getAutocompleteOptionText(autocompleteOption) {
172
- autocompleteOption.setAttribute("id", 'searchVariant');
213
+ autocompleteOption.setAttribute("id", "searchVariant");
173
214
  return autocompleteOption.innerText;
174
215
  },
175
- inputHandler() {
176
- this.$emit('input', this.value);
216
+ inputHandler(e) {
217
+ this.$emit("input", e.target.value);
177
218
  this.showAutocomplete = true;
178
219
  },
179
220
  onAutocompleteOptionClick(option) {
180
- this.$emit('click', option);
221
+ this.$emit("click", option);
181
222
  this.showAutocomplete = false;
182
223
  },
183
224
  textByOption(obj) {
@@ -186,8 +227,7 @@ export default {
186
227
  acc += obj[curr];
187
228
  return acc;
188
229
  }, "");
189
- }
190
- }
191
- }
230
+ },
231
+ },
232
+ };
192
233
  </script>
193
-
@@ -2,51 +2,74 @@
2
2
  <div class="adt-text-block">
3
3
  <div :class="['adt-text-block__field', { error: !!errorText }]">
4
4
  <input
5
- ref="input"
6
- v-mask="mask"
7
- :type="type"
8
- v-model="value"
9
- :placeholder="placeholder"
10
- required
11
- @keyup.enter="pressedEnter"
12
- class="adt-text-block__input"
13
- :class="{ error: !!errorText }"
14
- @input="() => {$emit('input', value)}"
5
+ ref="input"
6
+ :type="type"
7
+ :value="value"
8
+ :placeholder="placeholder"
9
+ required
10
+ @input="$emit('input', $event.target.value)"
11
+ @keyup.enter="enterPressed"
12
+ class="adt-text-block__input"
13
+ :class="{ error: !!errorText }"
15
14
  />
16
15
  <label class="adt-text-block__label">
17
16
  {{ label }}
18
17
  <span v-if="required" class="adt-text-block__required">*</span>
19
18
  </label>
20
- <div class="adt-text-block__icon desktop" v-if="clearable && value && value.length > 0"
21
- @click="$emit('input', '')">
22
- <svg width="12" height="12" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="clearIcon">
23
- <path d="M2 2l12 12m0-12L2 14" stroke="#2C3E50" stroke-linecap="round" stroke-linejoin="round"></path>
19
+ <div
20
+ class="adt-text-block__icon desktop"
21
+ v-if="clearable && value && value.length > 0"
22
+ @click="$emit('input', '')"
23
+ >
24
+ <svg
25
+ width="12"
26
+ height="12"
27
+ fill="none"
28
+ xmlns="http://www.w3.org/2000/svg"
29
+ viewBox="0 0 16 16"
30
+ id="clearIcon"
31
+ >
32
+ <path
33
+ d="M2 2l12 12m0-12L2 14"
34
+ stroke="#2C3E50"
35
+ stroke-linecap="round"
36
+ stroke-linejoin="round"
37
+ ></path>
24
38
  </svg>
25
39
  </div>
26
40
  </div>
27
41
  <div class="adt-text-block__error" v-if="!!errorText">
28
- <svg width="14" height="14" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" id="icon__attention">
29
- <path d="M8.5 4C8.5 3.72386 8.27614 3.5 8 3.5C7.72386 3.5 7.5 3.72386 7.5 4H8.5ZM7.5 9C7.5 9.27614 7.72386 9.5 8 9.5C8.27614 9.5 8.5 9.27614 8.5 9H7.5ZM7.5 4V9H8.5V4H7.5Z" fill="#FF2E43"/>
30
- <path d="M8.5 11C8.5 10.7239 8.27614 10.5 8 10.5C7.72386 10.5 7.5 10.7239 7.5 11H8.5ZM7.5 11.5C7.5 11.7761 7.72386 12 8 12C8.27614 12 8.5 11.7761 8.5 11.5H7.5ZM7.5 11V11.5H8.5V11H7.5Z" fill="#FF2E43"/>
31
- <circle cx="8" cy="8" r="7" stroke="#FF2E43"/>
42
+ <svg
43
+ width="14"
44
+ height="14"
45
+ viewBox="0 0 16 16"
46
+ fill="none"
47
+ xmlns="http://www.w3.org/2000/svg"
48
+ id="icon__attention"
49
+ >
50
+ <path
51
+ d="M8.5 4C8.5 3.72386 8.27614 3.5 8 3.5C7.72386 3.5 7.5 3.72386 7.5 4H8.5ZM7.5 9C7.5 9.27614 7.72386 9.5 8 9.5C8.27614 9.5 8.5 9.27614 8.5 9H7.5ZM7.5 4V9H8.5V4H7.5Z"
52
+ fill="#FF2E43"
53
+ />
54
+ <path
55
+ d="M8.5 11C8.5 10.7239 8.27614 10.5 8 10.5C7.72386 10.5 7.5 10.7239 7.5 11H8.5ZM7.5 11.5C7.5 11.7761 7.72386 12 8 12C8.27614 12 8.5 11.7761 8.5 11.5H7.5ZM7.5 11V11.5H8.5V11H7.5Z"
56
+ fill="#FF2E43"
57
+ />
58
+ <circle cx="8" cy="8" r="7" stroke="#FF2E43" />
32
59
  </svg>
33
60
  {{ errorText }}
34
61
  </div>
35
62
  </div>
36
63
  </template>
37
64
  <script>
38
- import '../../assets/style.scss';
39
- import { VueMaskDirective } from "v-mask";
65
+ import "../../assets/style.scss";
40
66
 
41
67
  export default {
42
68
  name: "TextField",
43
- directives: {
44
- mask: VueMaskDirective
45
- },
46
69
  props: {
47
70
  errorText: {
48
71
  type: String,
49
- default: ""
72
+ default: "",
50
73
  },
51
74
  label: {
52
75
  type: String,
@@ -56,38 +79,42 @@ export default {
56
79
  type: String,
57
80
  default: "text",
58
81
  },
59
- mask: {
82
+ value: {
60
83
  type: String,
61
- default: ""
84
+ required: true,
85
+ default: "",
62
86
  },
63
87
  placeholder: {
64
88
  type: String,
65
- default: ""
89
+ default: "",
66
90
  },
67
91
  clearable: {
68
92
  type: Boolean,
69
- default: false
93
+ default: false,
70
94
  },
71
95
  required: {
72
96
  type: Boolean,
73
- default: false
74
- }
97
+ default: false,
98
+ },
75
99
  },
76
100
  data() {
77
101
  return {
78
102
  showPlaceholder: false,
79
- value: ""
80
- }
103
+ };
81
104
  },
82
105
  computed: {
83
106
  inputPlaceholder() {
84
- return this.showPlaceholder ? this.placeholder : ""
85
- }
107
+ return this.showPlaceholder ? this.placeholder : "";
108
+ },
86
109
  },
87
110
  methods: {
88
- pressedEnter() {
89
- this.$emit('enterPressed', this.value);
90
- }
91
- }
92
- }
111
+ enterPressed() {
112
+ this.$emit("enterPressed", this.showAutocomplete);
113
+ },
114
+ inputHandler(e) {
115
+ this.$emit("input", e.target.value);
116
+ this.showAutocomplete = true;
117
+ },
118
+ },
119
+ };
93
120
  </script>