@enso-ui/typeahead 3.0.6 → 3.0.10
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
package/src/bulma/Typeahead.vue
CHANGED
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
addTag, canAddTag, clearBindings, controlEvents, disabled,
|
|
6
6
|
invalidQuery, highlight, i18n, inputBindings, inputEvents,
|
|
7
7
|
itemEvents, items, label, loading, minQueryLength,
|
|
8
|
-
modeSelector, modeBindings, modeEvents,
|
|
8
|
+
modeSelector, modeBindings, modeEvents,
|
|
9
|
+
readonly, query, searchControl,
|
|
9
10
|
}">
|
|
10
11
|
<dropdown class="typeahead"
|
|
12
|
+
:class="$attrs.class"
|
|
11
13
|
:disabled="!query"
|
|
12
14
|
:disable-controls="items.length === 0"
|
|
13
15
|
manual>
|
|
@@ -22,6 +24,7 @@
|
|
|
22
24
|
]"
|
|
23
25
|
v-bind="inputBindings"
|
|
24
26
|
type="text"
|
|
27
|
+
:readonly="readonly"
|
|
25
28
|
:disabled="disabled"
|
|
26
29
|
:placeholder="i18n(placeholder)"
|
|
27
30
|
@keydown="$emit('keydown', $event)"
|
|
@@ -141,6 +144,8 @@ export default {
|
|
|
141
144
|
},
|
|
142
145
|
},
|
|
143
146
|
|
|
147
|
+
emits: ['keydown'],
|
|
148
|
+
|
|
144
149
|
methods: {
|
|
145
150
|
clear() {
|
|
146
151
|
this.$refs.typeahead.clear();
|
|
@@ -49,6 +49,10 @@ export default {
|
|
|
49
49
|
type: Object,
|
|
50
50
|
default: null,
|
|
51
51
|
},
|
|
52
|
+
readonly: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false,
|
|
55
|
+
},
|
|
52
56
|
regExp: {
|
|
53
57
|
type: RegExp,
|
|
54
58
|
default() {
|
|
@@ -217,7 +221,7 @@ export default {
|
|
|
217
221
|
invalidQuery: this.invalidQuery,
|
|
218
222
|
highlight: this.highlight,
|
|
219
223
|
i18n: this.i18n,
|
|
220
|
-
inputBindings: {
|
|
224
|
+
inputBindings: { value: this.query },
|
|
221
225
|
inputEvents: selection => ({
|
|
222
226
|
input: e => {
|
|
223
227
|
this.query = e.target.value;
|
|
@@ -257,6 +261,7 @@ export default {
|
|
|
257
261
|
change: this.fetch,
|
|
258
262
|
},
|
|
259
263
|
modeSelector: this.modeSelector,
|
|
264
|
+
readonly: this.readonly,
|
|
260
265
|
query: this.query,
|
|
261
266
|
searchControl: this.searchControl,
|
|
262
267
|
});
|