cloud-web-corejs 1.1.0-dev.68 → 1.1.0-dev.69
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
|
@@ -156,7 +156,7 @@ export default {
|
|
|
156
156
|
},
|
|
157
157
|
suffixIcon: {
|
|
158
158
|
type: String,
|
|
159
|
-
default: "",
|
|
159
|
+
default: "el-icon-tickets",
|
|
160
160
|
},
|
|
161
161
|
popperClass: {
|
|
162
162
|
type: String,
|
|
@@ -168,6 +168,7 @@ export default {
|
|
|
168
168
|
displayValue: null,
|
|
169
169
|
storedLabel: null,
|
|
170
170
|
isSelecting: false,
|
|
171
|
+
focused: false,
|
|
171
172
|
lastQueryKeyword: null,
|
|
172
173
|
querySeq: 0,
|
|
173
174
|
lookupSeq: 0,
|
|
@@ -247,6 +248,12 @@ export default {
|
|
|
247
248
|
const done = (rows) => {
|
|
248
249
|
if (settled || seq !== this.querySeq) return;
|
|
249
250
|
settled = true;
|
|
251
|
+
if (!this.focused) {
|
|
252
|
+
this.lastQueryKeyword = null;
|
|
253
|
+
this._lastSuggestions = null;
|
|
254
|
+
cb([]);
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
250
257
|
const list = Array.isArray(rows) ? rows : [];
|
|
251
258
|
this._lastSuggestions = list;
|
|
252
259
|
cb(list);
|
|
@@ -342,16 +349,31 @@ export default {
|
|
|
342
349
|
this.$emit("input-change", text);
|
|
343
350
|
},
|
|
344
351
|
handleFocus(event) {
|
|
352
|
+
this.focused = true;
|
|
353
|
+
const input = this.$refs.input;
|
|
354
|
+
if (input) input.suggestionDisabled = false;
|
|
345
355
|
this.$emit("focus", event);
|
|
346
356
|
},
|
|
347
357
|
handleBlur(event) {
|
|
358
|
+
this.focused = false;
|
|
359
|
+
this.$emit("blur", event);
|
|
348
360
|
setTimeout(() => {
|
|
349
361
|
if (this.isSelecting) return;
|
|
362
|
+
this.lastQueryKeyword = null;
|
|
363
|
+
this._lastSuggestions = null;
|
|
364
|
+
this.closeSuggestions();
|
|
350
365
|
if (this.displayValue !== this.storedLabel) {
|
|
351
366
|
this.displayValue = this.storedLabel;
|
|
352
367
|
}
|
|
353
368
|
}, 150);
|
|
354
|
-
|
|
369
|
+
},
|
|
370
|
+
closeSuggestions() {
|
|
371
|
+
const input = this.$refs.input;
|
|
372
|
+
if (!input) return;
|
|
373
|
+
input.activated = false;
|
|
374
|
+
input.suggestionDisabled = true;
|
|
375
|
+
input.highlightedIndex = -1;
|
|
376
|
+
if (Array.isArray(input.suggestions)) input.suggestions = [];
|
|
355
377
|
},
|
|
356
378
|
renderHighlight(item) {
|
|
357
379
|
const row = item || {};
|
|
@@ -379,6 +401,31 @@ export default {
|
|
|
379
401
|
</style>
|
|
380
402
|
|
|
381
403
|
<style lang="scss">
|
|
404
|
+
.base-autocomplete.el-autocomplete .el-input .el-input__suffix {
|
|
405
|
+
top: 0;
|
|
406
|
+
height: 100%;
|
|
407
|
+
display: flex;
|
|
408
|
+
align-items: center;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.base-autocomplete.el-autocomplete .el-input .el-input__suffix-inner {
|
|
412
|
+
display: inline-flex;
|
|
413
|
+
align-items: center;
|
|
414
|
+
height: 100%;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
.base-autocomplete.el-autocomplete .el-input .el-input__icon {
|
|
418
|
+
float: none !important;
|
|
419
|
+
line-height: 1 !important;
|
|
420
|
+
display: inline-flex;
|
|
421
|
+
align-items: center;
|
|
422
|
+
justify-content: center;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.base-autocomplete.el-autocomplete .el-input__suffix-inner:has(.el-input__clear) > .el-input__icon:not(.el-input__clear) {
|
|
426
|
+
display: none;
|
|
427
|
+
}
|
|
428
|
+
|
|
382
429
|
.base-autocomplete-popper {
|
|
383
430
|
.el-autocomplete-suggestion__list li {
|
|
384
431
|
font-size: 13px;
|