bkui-vue 3.0.7 → 3.0.8
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/dist/index.cjs.js +22 -22
- package/dist/index.esm.js +108 -100
- package/dist/index.umd.js +2 -2
- package/lib/index.js +1 -1
- package/lib/select/index.js +18 -9
- package/package.json +1 -1
package/lib/index.js
CHANGED
package/lib/select/index.js
CHANGED
|
@@ -4419,6 +4419,11 @@ function select_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.l
|
|
|
4419
4419
|
var isInput = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
|
|
4420
4420
|
return filterable.value && inputSearch.value && isPopoverShow.value || allowCreate.value;
|
|
4421
4421
|
});
|
|
4422
|
+
var resetOptionVisible = function resetOptionVisible() {
|
|
4423
|
+
options.value.forEach(function (option) {
|
|
4424
|
+
option.visible = true;
|
|
4425
|
+
});
|
|
4426
|
+
};
|
|
4422
4427
|
__WEBPACK_EXTERNAL_MODULE_vue_watch__(isPopoverShow, function (isShow) {
|
|
4423
4428
|
emit('toggle', isPopoverShow.value);
|
|
4424
4429
|
if (!isShow) {
|
|
@@ -4429,6 +4434,10 @@ function select_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.l
|
|
|
4429
4434
|
} else {
|
|
4430
4435
|
// 打开时刷新一次 slot options 元信息(用于虚拟模式回显/空态判断)
|
|
4431
4436
|
refreshSlotOptionMetaMap();
|
|
4437
|
+
// 搜索已空时复位 slot option 可见性,避免上次下拉过滤态残留
|
|
4438
|
+
if (!searchValue.value) {
|
|
4439
|
+
resetOptionVisible();
|
|
4440
|
+
}
|
|
4432
4441
|
document.addEventListener('keydown', handleDocumentKeydown);
|
|
4433
4442
|
setTimeout(function () {
|
|
4434
4443
|
focusInput();
|
|
@@ -4524,17 +4533,17 @@ function select_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.l
|
|
|
4524
4533
|
// 处理options模式时默认搜索方法
|
|
4525
4534
|
var handleDefaultOptionSearch = function handleDefaultOptionSearch(searchValue) {
|
|
4526
4535
|
if (!filterable.value) return;
|
|
4527
|
-
//
|
|
4528
|
-
|
|
4536
|
+
// 关键字为空必须复位可见性。slot 模式下关闭下拉会先把 isPopoverShow 置 false
|
|
4537
|
+
// 再清空 searchValue;若此处直接 return,option.visible 会停在上次过滤态。
|
|
4529
4538
|
if (!searchValue) {
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
});
|
|
4533
|
-
} else {
|
|
4534
|
-
options.value.forEach(function (option) {
|
|
4535
|
-
option.visible = defaultSearchMethod(searchValue, String(option.optionName), select_objectSpread(select_objectSpread({}, option.$props), option.$attrs));
|
|
4536
|
-
});
|
|
4539
|
+
resetOptionVisible();
|
|
4540
|
+
return;
|
|
4537
4541
|
}
|
|
4542
|
+
// Popover 关闭时:下拉搜索无需处理;但 inputSearch/allowCreate 仍需要更新可见性
|
|
4543
|
+
if (!isPopoverShow.value && !(inputSearch.value || allowCreate.value)) return;
|
|
4544
|
+
options.value.forEach(function (option) {
|
|
4545
|
+
option.visible = defaultSearchMethod(searchValue, String(option.optionName), select_objectSpread(select_objectSpread({}, option.$props), option.$attrs));
|
|
4546
|
+
});
|
|
4538
4547
|
};
|
|
4539
4548
|
var _useRemoteSearch = useRemoteSearch(isRemoteSearch.value ? remoteMethod.value : handleDefaultOptionSearch, initActiveOptionValue),
|
|
4540
4549
|
searchValue = _useRemoteSearch.searchValue,
|