naive-ui 2.30.1 → 2.30.2
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/es/select/src/Select.js +6 -5
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/select/src/Select.js +6 -5
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
package/es/select/src/Select.js
CHANGED
|
@@ -107,6 +107,7 @@ export default defineComponent({
|
|
|
107
107
|
return (_a = props.placeholder) !== null && _a !== void 0 ? _a : localeRef.value.placeholder;
|
|
108
108
|
});
|
|
109
109
|
const compitableOptionsRef = useCompitable(props, ['items', 'options']);
|
|
110
|
+
const emptyArray = [];
|
|
110
111
|
const createdOptionsRef = ref([]);
|
|
111
112
|
const beingCreatedOptionsRef = ref([]);
|
|
112
113
|
const memoValOptMapRef = ref(new Map());
|
|
@@ -294,7 +295,7 @@ export default defineComponent({
|
|
|
294
295
|
}
|
|
295
296
|
function handleMenuAfterLeave() {
|
|
296
297
|
patternRef.value = '';
|
|
297
|
-
beingCreatedOptionsRef.value =
|
|
298
|
+
beingCreatedOptionsRef.value = emptyArray;
|
|
298
299
|
}
|
|
299
300
|
const activeWithoutMenuOpenRef = ref(false);
|
|
300
301
|
function onTriggerInputFocus() {
|
|
@@ -395,7 +396,7 @@ export default defineComponent({
|
|
|
395
396
|
const beingCreatedOption = beingCreatedOptions[0] || null;
|
|
396
397
|
if (beingCreatedOption) {
|
|
397
398
|
createdOptionsRef.value.push(beingCreatedOption);
|
|
398
|
-
beingCreatedOptionsRef.value =
|
|
399
|
+
beingCreatedOptionsRef.value = emptyArray;
|
|
399
400
|
}
|
|
400
401
|
}
|
|
401
402
|
if (remote) {
|
|
@@ -431,7 +432,7 @@ export default defineComponent({
|
|
|
431
432
|
];
|
|
432
433
|
}
|
|
433
434
|
else {
|
|
434
|
-
createdOptionsRef.value =
|
|
435
|
+
createdOptionsRef.value = emptyArray;
|
|
435
436
|
}
|
|
436
437
|
}
|
|
437
438
|
focusSelection();
|
|
@@ -453,7 +454,7 @@ export default defineComponent({
|
|
|
453
454
|
doSearch(value);
|
|
454
455
|
if (tag && !remote) {
|
|
455
456
|
if (!value) {
|
|
456
|
-
beingCreatedOptionsRef.value =
|
|
457
|
+
beingCreatedOptionsRef.value = emptyArray;
|
|
457
458
|
return;
|
|
458
459
|
}
|
|
459
460
|
const { onCreate } = props;
|
|
@@ -463,7 +464,7 @@ export default defineComponent({
|
|
|
463
464
|
const { valueField } = props;
|
|
464
465
|
if (compitableOptionsRef.value.some((option) => option[valueField] === optionBeingCreated[valueField]) ||
|
|
465
466
|
createdOptionsRef.value.some((option) => option[valueField] === optionBeingCreated[valueField])) {
|
|
466
|
-
beingCreatedOptionsRef.value =
|
|
467
|
+
beingCreatedOptionsRef.value = emptyArray;
|
|
467
468
|
}
|
|
468
469
|
else {
|
|
469
470
|
beingCreatedOptionsRef.value = [optionBeingCreated];
|
package/es/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "2.30.
|
|
1
|
+
declare const _default: "2.30.2";
|
|
2
2
|
export default _default;
|
package/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '2.30.
|
|
1
|
+
export default '2.30.2';
|
package/lib/select/src/Select.js
CHANGED
|
@@ -112,6 +112,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
112
112
|
return (_a = props.placeholder) !== null && _a !== void 0 ? _a : localeRef.value.placeholder;
|
|
113
113
|
});
|
|
114
114
|
const compitableOptionsRef = (0, vooks_1.useCompitable)(props, ['items', 'options']);
|
|
115
|
+
const emptyArray = [];
|
|
115
116
|
const createdOptionsRef = (0, vue_1.ref)([]);
|
|
116
117
|
const beingCreatedOptionsRef = (0, vue_1.ref)([]);
|
|
117
118
|
const memoValOptMapRef = (0, vue_1.ref)(new Map());
|
|
@@ -299,7 +300,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
299
300
|
}
|
|
300
301
|
function handleMenuAfterLeave() {
|
|
301
302
|
patternRef.value = '';
|
|
302
|
-
beingCreatedOptionsRef.value =
|
|
303
|
+
beingCreatedOptionsRef.value = emptyArray;
|
|
303
304
|
}
|
|
304
305
|
const activeWithoutMenuOpenRef = (0, vue_1.ref)(false);
|
|
305
306
|
function onTriggerInputFocus() {
|
|
@@ -400,7 +401,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
400
401
|
const beingCreatedOption = beingCreatedOptions[0] || null;
|
|
401
402
|
if (beingCreatedOption) {
|
|
402
403
|
createdOptionsRef.value.push(beingCreatedOption);
|
|
403
|
-
beingCreatedOptionsRef.value =
|
|
404
|
+
beingCreatedOptionsRef.value = emptyArray;
|
|
404
405
|
}
|
|
405
406
|
}
|
|
406
407
|
if (remote) {
|
|
@@ -436,7 +437,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
436
437
|
];
|
|
437
438
|
}
|
|
438
439
|
else {
|
|
439
|
-
createdOptionsRef.value =
|
|
440
|
+
createdOptionsRef.value = emptyArray;
|
|
440
441
|
}
|
|
441
442
|
}
|
|
442
443
|
focusSelection();
|
|
@@ -458,7 +459,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
458
459
|
doSearch(value);
|
|
459
460
|
if (tag && !remote) {
|
|
460
461
|
if (!value) {
|
|
461
|
-
beingCreatedOptionsRef.value =
|
|
462
|
+
beingCreatedOptionsRef.value = emptyArray;
|
|
462
463
|
return;
|
|
463
464
|
}
|
|
464
465
|
const { onCreate } = props;
|
|
@@ -468,7 +469,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
468
469
|
const { valueField } = props;
|
|
469
470
|
if (compitableOptionsRef.value.some((option) => option[valueField] === optionBeingCreated[valueField]) ||
|
|
470
471
|
createdOptionsRef.value.some((option) => option[valueField] === optionBeingCreated[valueField])) {
|
|
471
|
-
beingCreatedOptionsRef.value =
|
|
472
|
+
beingCreatedOptionsRef.value = emptyArray;
|
|
472
473
|
}
|
|
473
474
|
else {
|
|
474
475
|
beingCreatedOptionsRef.value = [optionBeingCreated];
|
package/lib/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "2.30.
|
|
1
|
+
declare const _default: "2.30.2";
|
|
2
2
|
export default _default;
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
package/web-types.json
CHANGED