@enso-ui/select 3.0.13 → 3.0.17
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enso-ui/select",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.17",
|
|
4
4
|
"description": "Select",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@enso-ui/search-mode": "^3.0",
|
|
30
30
|
"@fortawesome/fontawesome-free": "^5.2.0",
|
|
31
31
|
"@fortawesome/fontawesome-svg-core": "^1.2.2",
|
|
32
|
-
"@fortawesome/free-solid-svg-icons": "^5.2
|
|
32
|
+
"@fortawesome/free-solid-svg-icons": "^5.11.2",
|
|
33
33
|
"@fortawesome/vue-fontawesome": "3.0.0-5",
|
|
34
34
|
"bulma": "^0.9.0",
|
|
35
35
|
"lodash": "^4.17.10",
|
package/src/bulma/EnsoSelect.vue
CHANGED
package/src/bulma/VueSelect.vue
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="vue-select"
|
|
3
|
-
|
|
2
|
+
<div class="vue-select"
|
|
3
|
+
:class="$attrs.class">
|
|
4
|
+
<core-select v-bind="$attrs"
|
|
4
5
|
ref="select">
|
|
5
6
|
<template #default="{
|
|
6
|
-
allowsSelection, canAddTag, clearControl, clearEvents,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
allowsSelection, canAddTag, clearControl, clearEvents,
|
|
8
|
+
dropdownDisabled, disableClear, disabled, displayLabel,
|
|
9
|
+
filterBindings, filterEvents, hasOptions, hasSelection,
|
|
10
|
+
highlight, i18n, isSelected, itemEvents, modeSelector,
|
|
11
|
+
modeBindings, modeEvents, multiple, needsSearch, noResults,
|
|
12
|
+
reload, loading, options, query, reset, selection,
|
|
13
|
+
selectionBindings, selectionEvents, taggable,
|
|
14
|
+
taggableBindings, taggableEvents, trackBy,
|
|
12
15
|
}">
|
|
13
16
|
<dropdown :disabled="dropdownDisabled"
|
|
14
17
|
:manual="multiple || canAddTag || !allowsSelection"
|
|
@@ -127,7 +130,7 @@
|
|
|
127
130
|
import { FontAwesomeIcon as Fa } from '@fortawesome/vue-fontawesome';
|
|
128
131
|
import { library } from '@fortawesome/fontawesome-svg-core';
|
|
129
132
|
import { faCheck }
|
|
130
|
-
|
|
133
|
+
from '@fortawesome/free-solid-svg-icons';
|
|
131
134
|
import { focus, clickOutside } from '@enso-ui/directives';
|
|
132
135
|
import { Dropdown, DropdownItem } from '@enso-ui/dropdown/bulma';
|
|
133
136
|
import DropdownIndicator from '@enso-ui/dropdown-indicator';
|
|
@@ -152,6 +155,8 @@ export default {
|
|
|
152
155
|
SearchMode,
|
|
153
156
|
},
|
|
154
157
|
|
|
158
|
+
inheritAttrs: false,
|
|
159
|
+
|
|
155
160
|
props: {
|
|
156
161
|
hasError: {
|
|
157
162
|
type: Boolean,
|
|
@@ -197,7 +202,6 @@ export default {
|
|
|
197
202
|
};
|
|
198
203
|
</script>
|
|
199
204
|
|
|
200
|
-
|
|
201
205
|
<style lang="scss">
|
|
202
206
|
@import 'bulma/sass/utilities/derived-variables';
|
|
203
207
|
|
|
@@ -3,9 +3,10 @@ import { debounce } from 'lodash';
|
|
|
3
3
|
import Modes from '@enso-ui/search-mode/src/modes';
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
|
-
|
|
7
6
|
name: 'CoreSelect',
|
|
8
7
|
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
|
|
9
10
|
props: {
|
|
10
11
|
customParams: {
|
|
11
12
|
type: Object,
|
|
@@ -110,8 +111,6 @@ export default {
|
|
|
110
111
|
'selection', 'update', 'update:modelValue',
|
|
111
112
|
],
|
|
112
113
|
|
|
113
|
-
inheritAttrs: false,
|
|
114
|
-
|
|
115
114
|
data: v => ({
|
|
116
115
|
allowsSelection: true,
|
|
117
116
|
internalValue: null,
|
|
@@ -166,7 +165,7 @@ export default {
|
|
|
166
165
|
? this.optionList.filter(option => this.modelValue
|
|
167
166
|
.some(val => this.valueMatchesOption(val, option)))
|
|
168
167
|
: this.optionList
|
|
169
|
-
|
|
168
|
+
.find(option => this.valueMatchesOption(this.modelValue, option)) || null;
|
|
170
169
|
},
|
|
171
170
|
serverSide() {
|
|
172
171
|
return this.source !== null;
|
|
@@ -231,7 +230,7 @@ export default {
|
|
|
231
230
|
},
|
|
232
231
|
|
|
233
232
|
created() {
|
|
234
|
-
if(!this.http && this.source !== null) {
|
|
233
|
+
if (!this.http && this.source !== null) {
|
|
235
234
|
throw Error('Using the serverside mode requires providing a http client');
|
|
236
235
|
}
|
|
237
236
|
|
|
@@ -263,7 +262,9 @@ export default {
|
|
|
263
262
|
const value = JSON.parse(JSON.stringify(this.modelValue));
|
|
264
263
|
|
|
265
264
|
const index = value
|
|
266
|
-
.findIndex(val =>
|
|
265
|
+
.findIndex(val => this.objects
|
|
266
|
+
? val[this.trackBy] === deselect[this.trackBy]
|
|
267
|
+
: val === deselect[this.trackBy]);
|
|
267
268
|
|
|
268
269
|
value.splice(index, 1);
|
|
269
270
|
this.update(value);
|