@saooti/octopus-sdk 39.0.45 → 39.0.46
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
|
@@ -20,10 +20,12 @@
|
|
|
20
20
|
:disabled="isDisabled"
|
|
21
21
|
:loading="isLoading"
|
|
22
22
|
:placeholder="placeholder"
|
|
23
|
+
:clearSearchOnBlur="()=>{return true}"
|
|
23
24
|
:filter="fakeSearch"
|
|
24
25
|
:selectable="() => !maxOptionsSelected"
|
|
25
26
|
@open="onSearch"
|
|
26
27
|
@search="onSearch"
|
|
28
|
+
@close="onClose"
|
|
27
29
|
@option:selected="onOptionSelected"
|
|
28
30
|
@option:deselected="onOptionDeselect"
|
|
29
31
|
>
|
|
@@ -90,7 +92,7 @@ export default {
|
|
|
90
92
|
allowEmpty: { default: true, type: Boolean },
|
|
91
93
|
},
|
|
92
94
|
|
|
93
|
-
emits: ["onSearch", "selected"],
|
|
95
|
+
emits: ["onSearch", "selected", "onClose"],
|
|
94
96
|
|
|
95
97
|
data() {
|
|
96
98
|
return {
|
|
@@ -99,6 +101,7 @@ export default {
|
|
|
99
101
|
remainingElements: 0 as number,
|
|
100
102
|
isLoading: false as boolean,
|
|
101
103
|
nbOptionsSelected: 0 as number,
|
|
104
|
+
searchInput: "" as string
|
|
102
105
|
};
|
|
103
106
|
},
|
|
104
107
|
computed: {
|
|
@@ -135,13 +138,19 @@ export default {
|
|
|
135
138
|
fakeSearch(): Array<unknown> {
|
|
136
139
|
return this.options;
|
|
137
140
|
},
|
|
138
|
-
onSearch(search
|
|
141
|
+
onSearch(search?: string): void {
|
|
139
142
|
if (search && search.length < this.minSearchLength) {
|
|
140
143
|
return;
|
|
144
|
+
}else if(search){
|
|
145
|
+
this.searchInput = search;
|
|
141
146
|
}
|
|
142
147
|
this.isLoading = true;
|
|
143
148
|
this.$emit("onSearch", search);
|
|
144
149
|
},
|
|
150
|
+
onClose(){
|
|
151
|
+
this.$emit("onClose", this.searchInput);
|
|
152
|
+
this.searchInput = "";
|
|
153
|
+
},
|
|
145
154
|
afterSearch(optionsFetched: Array<unknown>, count: number): void {
|
|
146
155
|
this.options = optionsFetched;
|
|
147
156
|
this.remainingElements = Math.max(0, count - this.maxElement);
|
|
@@ -156,7 +165,7 @@ export default {
|
|
|
156
165
|
}
|
|
157
166
|
if (
|
|
158
167
|
!this.allowEmpty &&
|
|
159
|
-
|
|
168
|
+
0 === (this.optionSelected as Array<unknown>).length
|
|
160
169
|
) {
|
|
161
170
|
(this.optionSelected as Array<unknown>).push(event);
|
|
162
171
|
return;
|