@enso-ui/select 2.1.6 → 2.1.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/EnsoSelect.vue
CHANGED
package/src/bulma/VueSelect.vue
CHANGED
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
v-if="hasSelection">
|
|
34
34
|
<div class="control">
|
|
35
35
|
<template v-if="multiple">
|
|
36
|
-
<tag v-
|
|
36
|
+
<tag v-bind="selectionBindings(value)"
|
|
37
|
+
v-for="value in selection"
|
|
37
38
|
:key="value[trackBy]"
|
|
38
|
-
v-bind="selectionBindings(value)"
|
|
39
39
|
v-on="selectionEvents(value)"/>
|
|
40
40
|
</template>
|
|
41
41
|
<template v-else>
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
<div class="dropdown-item search">
|
|
65
65
|
<div class="control has-icons-right">
|
|
66
66
|
<input class="input"
|
|
67
|
+
v-bind="filterBindings"
|
|
67
68
|
type="text"
|
|
68
69
|
:placeholder="i18n(labels.search)"
|
|
69
|
-
v-bind="filterBindings"
|
|
70
70
|
v-on="filterEvents"
|
|
71
71
|
v-focus>
|
|
72
72
|
<search-mode class="is-right icon is-small search-mode"
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
</div>
|
|
78
78
|
</template>
|
|
79
79
|
<template v-slot:items>
|
|
80
|
-
<dropdown-item
|
|
81
|
-
|
|
80
|
+
<dropdown-item v-bind="taggableBindings"
|
|
81
|
+
key="add-tag"
|
|
82
82
|
v-on="taggableEvents"
|
|
83
83
|
v-if="canAddTag">
|
|
84
84
|
{{ query }}
|
|
@@ -238,13 +238,17 @@ export default {
|
|
|
238
238
|
this.update(this.multiple ? [] : null);
|
|
239
239
|
this.$emit('clear');
|
|
240
240
|
},
|
|
241
|
-
deselect(
|
|
242
|
-
const
|
|
243
|
-
|
|
241
|
+
deselect(deselect) {
|
|
242
|
+
const value = JSON.parse(JSON.stringify(this.value));
|
|
243
|
+
|
|
244
|
+
const index = value
|
|
245
|
+
.findIndex(val => this.objects
|
|
246
|
+
? val[this.trackBy] === deselect[this.trackBy]
|
|
247
|
+
: val === deselect[this.trackBy]);
|
|
244
248
|
|
|
245
|
-
|
|
246
|
-
this.update(
|
|
247
|
-
this.$emit('deselect',
|
|
249
|
+
value.splice(index, 1);
|
|
250
|
+
this.update(value);
|
|
251
|
+
this.$emit('deselect', deselect);
|
|
248
252
|
},
|
|
249
253
|
displayLabel(option) {
|
|
250
254
|
if (!option) {
|
|
@@ -291,8 +295,8 @@ export default {
|
|
|
291
295
|
const index = this.value
|
|
292
296
|
.findIndex((val) => this.valueMatchesOption(val, option));
|
|
293
297
|
|
|
294
|
-
this.updateMultipleSelection(index, option);
|
|
295
|
-
this.update(
|
|
298
|
+
const value = this.updateMultipleSelection(index, option);
|
|
299
|
+
this.update(value);
|
|
296
300
|
},
|
|
297
301
|
handleSingleSelection(option) {
|
|
298
302
|
this.reset();
|
|
@@ -420,14 +424,17 @@ export default {
|
|
|
420
424
|
: null;
|
|
421
425
|
},
|
|
422
426
|
updateMultipleSelection(index, option) {
|
|
427
|
+
const value = JSON.parse(JSON.stringify(this.value));
|
|
428
|
+
|
|
423
429
|
if (index >= 0) {
|
|
424
|
-
|
|
430
|
+
value.splice(index, 1);
|
|
425
431
|
this.$emit('deselect', this.objects ? option : option[this.trackBy]);
|
|
426
|
-
|
|
432
|
+
} else {
|
|
433
|
+
value.push(this.optionValue(option));
|
|
434
|
+
this.$emit('select', this.objects ? option : option[this.trackBy]);
|
|
427
435
|
}
|
|
428
436
|
|
|
429
|
-
|
|
430
|
-
this.$emit('select', this.objects ? option : option[this.trackBy]);
|
|
437
|
+
return value;
|
|
431
438
|
},
|
|
432
439
|
},
|
|
433
440
|
|