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/lib/index.js CHANGED
@@ -3,5 +3,5 @@ export * from './hooks';
3
3
  export { default } from './preset';
4
4
  export * from './config-provider';
5
5
  export * from './directives';
6
- export const version = "3.0.7";
6
+ export const version = "3.0.8";
7
7
  window.__bkui_vue_version__ = version;
@@ -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
- // Popover 关闭时:下拉搜索无需处理;但 inputSearch/allowCreate 仍需要更新可见性
4528
- if (!isPopoverShow.value && !(inputSearch.value || allowCreate.value)) return;
4536
+ // 关键字为空必须复位可见性。slot 模式下关闭下拉会先把 isPopoverShow 置 false
4537
+ // 再清空 searchValue;若此处直接 return,option.visible 会停在上次过滤态。
4529
4538
  if (!searchValue) {
4530
- options.value.forEach(function (option) {
4531
- option.visible = true;
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkui-vue",
3
- "version": "3.0.7",
3
+ "version": "3.0.8",
4
4
  "workspaces": [
5
5
  "packages/**",
6
6
  "scripts/cli",