@whitesev/pops 2.3.8 → 2.4.1

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.umd.js CHANGED
@@ -2530,6 +2530,36 @@
2530
2530
  transformTop: transform_top,
2531
2531
  };
2532
2532
  }
2533
+ /**
2534
+ * 监input、textarea的输入框值改变的事件
2535
+ */
2536
+ onInput($el, callback, option) {
2537
+ let isComposite = false;
2538
+ let __callback = async (event) => {
2539
+ if (isComposite)
2540
+ return;
2541
+ await callback(event);
2542
+ };
2543
+ let __composition_start_callback = () => {
2544
+ isComposite = true;
2545
+ };
2546
+ let __composition_end_callback = () => {
2547
+ isComposite = false;
2548
+ this.trigger($el, "input", {
2549
+ isComposite,
2550
+ });
2551
+ };
2552
+ this.on($el, "input", __callback, option);
2553
+ this.on($el, "compositionstart", __composition_start_callback, option);
2554
+ this.on($el, "compositionend", __composition_end_callback, option);
2555
+ return {
2556
+ off: () => {
2557
+ this.off($el, "input", __callback, option);
2558
+ this.off($el, "compositionstart", __composition_start_callback, option);
2559
+ this.off($el, "compositionend", __composition_end_callback, option);
2560
+ },
2561
+ };
2562
+ }
2533
2563
  }
2534
2564
  const popsDOMUtils = new PopsDOMUtils();
2535
2565
 
@@ -10895,7 +10925,22 @@
10895
10925
  for (let index = 0; index < 10; index++) {
10896
10926
  data.push({
10897
10927
  value: `测试${index}`,
10898
- text: `测试${index}-html`,
10928
+ enableDeleteButton: true,
10929
+ deleteButtonClickCallback(event, $dataItem, dataItem, config) {
10930
+ console.log("删除当前项", [event, $dataItem, dataItem, config]);
10931
+ return true;
10932
+ },
10933
+ itemView(dateItem, $parent) {
10934
+ return `测试${index}-html`;
10935
+ },
10936
+ clickCallback(event, $dataItem, dataItem, config) {
10937
+ console.log("item项的点击回调", [event, $dataItem, data, config]);
10938
+ // config.inputTarget!.value = dataItem.value;
10939
+ return index % 2 === 0 ? true : false;
10940
+ },
10941
+ selectCallback(event, $dataItem, dataItem, config) {
10942
+ console.log("item项的选中回调", [event, $dataItem, data, config]);
10943
+ },
10899
10944
  });
10900
10945
  }
10901
10946
  return {
@@ -10905,14 +10950,6 @@
10905
10950
  inputTarget: null,
10906
10951
  selfDocument: document,
10907
10952
  data: data,
10908
- deleteIcon: {
10909
- enable: true,
10910
- callback(event, liElement, dataItem) {
10911
- console.log("删除当前项", [event, liElement, dataItem]);
10912
- data.splice(data.indexOf(dataItem), 1);
10913
- liElement.remove();
10914
- },
10915
- },
10916
10953
  useShadowRoot: true,
10917
10954
  className: "",
10918
10955
  isAbsolute: true,
@@ -10930,20 +10967,10 @@
10930
10967
  toSearhNotResultHTML: '<li data-none="true">暂无其它数据</li>',
10931
10968
  toHideWithNotResult: false,
10932
10969
  followPosition: "target",
10933
- getItemHTML(item) {
10934
- return item.text ?? item;
10935
- },
10936
- async getData(value, data) {
10970
+ async inputTargetChangeRefreshShowDataCallback(value, data) {
10937
10971
  console.log("当前输入框的值是:", value);
10938
10972
  return data.filter((it) => it.value.includes(value));
10939
10973
  },
10940
- itemClickCallBack(event, liElement, data) {
10941
- console.log("item项的点击回调", [event, liElement, data]);
10942
- this.inputTarget.value = data.value;
10943
- },
10944
- selectCallBack(event, liElement, data) {
10945
- console.log("item项的选中回调", [event, liElement, data]);
10946
- },
10947
10974
  style: "",
10948
10975
  };
10949
10976
  };
@@ -11003,33 +11030,49 @@
11003
11030
  /** 动态更新CSS */
11004
11031
  $dynamicCSS: null,
11005
11032
  },
11033
+ $evt: {
11034
+ offInputChangeEvtHandler: [],
11035
+ },
11006
11036
  $data: {
11007
11037
  /** 是否结果为空 */
11008
11038
  isEmpty: true,
11009
11039
  },
11010
- /** 初始化元素变量 */
11011
- initEl() {
11012
- this.$el.root = SearchSuggestion.createSearchSelectElement();
11013
- this.$el.$dynamicCSS = this.$el.root.querySelector("style[data-dynamic]");
11014
- this.$el.$hintULContainer = SearchSuggestion.$el.root.querySelector("ul");
11015
- },
11016
11040
  /**
11017
11041
  * 初始化
11042
+ * @param parentElement 父元素
11018
11043
  */
11019
11044
  init(parentElement = document.body || document.documentElement) {
11020
- this.initEl();
11021
- SearchSuggestion.update(this.getData());
11045
+ SearchSuggestion.initEl();
11046
+ SearchSuggestion.update(SearchSuggestion.getData());
11022
11047
  SearchSuggestion.updateStyleSheet();
11023
11048
  SearchSuggestion.hide();
11024
11049
  $shadowRoot.appendChild(SearchSuggestion.$el.root);
11025
11050
  parentElement.appendChild($shadowContainer);
11026
11051
  },
11052
+ /**
11053
+ * 初始化元素变量
11054
+ */
11055
+ initEl() {
11056
+ SearchSuggestion.$el.root = SearchSuggestion.createSearchSelectElement();
11057
+ Reflect.set(SearchSuggestion.$el.root, "data-SearchSuggestion", SearchSuggestion);
11058
+ SearchSuggestion.$el.$dynamicCSS =
11059
+ SearchSuggestion.$el.root.querySelector("style[data-dynamic]");
11060
+ SearchSuggestion.$el.$hintULContainer =
11061
+ SearchSuggestion.$el.root.querySelector("ul");
11062
+ },
11027
11063
  /**
11028
11064
  * 获取数据
11029
11065
  */
11030
11066
  getData() {
11031
11067
  return typeof config.data === "function" ? config.data() : config.data;
11032
11068
  },
11069
+ /**
11070
+ * 更新数据
11071
+ * @param data 数据
11072
+ */
11073
+ setData(data) {
11074
+ config.data = data;
11075
+ },
11033
11076
  /**
11034
11077
  * 获取显示出搜索建议框的html
11035
11078
  */
@@ -11112,7 +11155,7 @@
11112
11155
  }
11113
11156
  </style>
11114
11157
  <style type="text/css" data-dynamic="true">
11115
- ${this.getDynamicCSS()}
11158
+ ${SearchSuggestion.getDynamicCSS()}
11116
11159
  </style>
11117
11160
  <style>
11118
11161
  .el-zoom-in-top-animation{
@@ -11154,7 +11197,9 @@
11154
11197
  }
11155
11198
  return $el;
11156
11199
  },
11157
- /** 动态获取CSS */
11200
+ /**
11201
+ * 动态获取CSS
11202
+ */
11158
11203
  getDynamicCSS() {
11159
11204
  return /*css*/ `
11160
11205
  .pops-${popsType}-search-suggestion{
@@ -11219,53 +11264,82 @@
11219
11264
  }
11220
11265
  `;
11221
11266
  },
11267
+ /**
11268
+ * 获取data-value值
11269
+ * @param data 数据项
11270
+ */
11271
+ getItemDataValue(data) {
11272
+ return data;
11273
+ },
11222
11274
  /**
11223
11275
  * 获取显示出搜索建议框的每一项的html
11224
- * @param data 当前项的值
11225
- * @param index 当前项的下标
11276
+ * @param dataItem 当前项的值
11277
+ * @param dateItemIndex 当前项的下标
11226
11278
  */
11227
- createSearchItemLiElement(data, index) {
11279
+ createSearchItemLiElement(dataItem, dateItemIndex) {
11280
+ const dataValue = SearchSuggestion.getItemDataValue(dataItem);
11228
11281
  let $li = popsDOMUtils.createElement("li", {
11229
11282
  className: `pops-${popsType}-search-suggestion-hint-item`,
11230
- "data-index": index,
11231
- "data-value": SearchSuggestion.getItemDataValue(data),
11232
- innerHTML: `${config.getItemHTML(data)}${config.deleteIcon.enable ? SearchSuggestion.getDeleteIconHTML() : ""}`,
11283
+ "data-index": dateItemIndex,
11284
+ "data-value": dataValue,
11233
11285
  });
11286
+ Reflect.set($li, "data-index", dateItemIndex);
11287
+ Reflect.set($li, "data-value", dataValue);
11288
+ // 项内容
11289
+ let $itemInner = dataItem.itemView(dataItem, $li, config);
11290
+ if (typeof $itemInner === "string") {
11291
+ PopsSafeUtils.setSafeHTML($li, $itemInner);
11292
+ }
11293
+ else {
11294
+ popsDOMUtils.append($li, $itemInner);
11295
+ }
11296
+ // 删除按钮
11297
+ const enableDeleteButton = dataItem.enableDeleteButton;
11298
+ if (typeof enableDeleteButton === "boolean" && enableDeleteButton) {
11299
+ let $deleteIcon = SearchSuggestion.createItemDeleteIcon();
11300
+ popsDOMUtils.append($li, $deleteIcon);
11301
+ }
11234
11302
  popsDOMUtils.addClassName($li, PopsCommonCSSClassName.flexCenter);
11235
11303
  popsDOMUtils.addClassName($li, PopsCommonCSSClassName.flexYCenter);
11236
11304
  return $li;
11237
11305
  },
11238
- /**
11239
- * 获取data-value值
11240
- * @param data
11241
- */
11242
- getItemDataValue(data) {
11243
- return data;
11244
- },
11245
11306
  /**
11246
11307
  * 设置搜索建议框每一项的点击事件
11247
- * @param $searchItem
11308
+ * @param $searchItem 当前项的元素
11248
11309
  */
11249
11310
  setSearchItemClickEvent($searchItem) {
11250
- popsDOMUtils.on($searchItem, "click", (event) => {
11311
+ popsDOMUtils.on($searchItem, "click", async (event) => {
11251
11312
  popsDOMUtils.preventEvent(event);
11252
11313
  let $click = event.target;
11253
- let dataValue = Reflect.get($searchItem, "data-value");
11314
+ const data = SearchSuggestion.getData();
11315
+ const dataItem = Reflect.get($searchItem, "data-value");
11254
11316
  let isDelete = Boolean($click.closest(`.pops-${popsType}-delete-icon`));
11255
11317
  if (isDelete) {
11256
11318
  // 删除
11257
- if (typeof config.deleteIcon.callback === "function") {
11258
- config.deleteIcon.callback(event, $searchItem, dataValue);
11319
+ if (typeof dataItem.deleteButtonClickCallback === "function") {
11320
+ let result = await dataItem.deleteButtonClickCallback(event, $searchItem, dataItem, config);
11321
+ if (typeof result === "boolean" && result) {
11322
+ data.splice(data.indexOf(dataItem), 1);
11323
+ $searchItem.remove();
11324
+ }
11259
11325
  }
11260
- if (!this.$el.$hintULContainer.children.length) {
11326
+ if (!SearchSuggestion.$el.$hintULContainer.children.length) {
11261
11327
  /* 全删完了 */
11262
- this.clear();
11328
+ SearchSuggestion.clear();
11263
11329
  }
11264
11330
  SearchSuggestion.updateStyleSheet();
11265
11331
  }
11266
11332
  else {
11267
11333
  // 点击选择项
11268
- config.itemClickCallBack(event, $searchItem, dataValue);
11334
+ if (typeof dataItem.clickCallback === "function") {
11335
+ let result = await dataItem.clickCallback(event, $searchItem, dataItem, config);
11336
+ if (typeof result === "boolean" && result) {
11337
+ if (config.inputTarget instanceof HTMLInputElement ||
11338
+ config.inputTarget instanceof HTMLTextAreaElement) {
11339
+ config.inputTarget.value = String(dataItem.value);
11340
+ }
11341
+ }
11342
+ }
11269
11343
  }
11270
11344
  }, {
11271
11345
  capture: true,
@@ -11304,11 +11378,13 @@
11304
11378
  /* 禁用输入框自动提示 */
11305
11379
  config.inputTarget.setAttribute("autocomplete", "off");
11306
11380
  /* 内容改变事件 */
11307
- popsDOMUtils.on(config.inputTarget, "input", void 0, async (event) => {
11308
- let getListResult = await config.getData(config.inputTarget.value, this.getData());
11309
- SearchSuggestion.update(getListResult);
11381
+ const listenerHandler = popsDOMUtils.onInput(config.inputTarget, async (event) => {
11382
+ const data = SearchSuggestion.getData();
11383
+ let queryDataResult = await config.inputTargetChangeRefreshShowDataCallback(config.inputTarget.value, data, config);
11384
+ SearchSuggestion.update(queryDataResult);
11310
11385
  SearchSuggestion.updateStyleSheet();
11311
11386
  }, option);
11387
+ SearchSuggestion.$evt.offInputChangeEvtHandler.push(listenerHandler.off);
11312
11388
  },
11313
11389
  /**
11314
11390
  * 移除输入框内容改变的监听
@@ -11316,7 +11392,12 @@
11316
11392
  removeInputChangeEvent(option = {
11317
11393
  capture: true,
11318
11394
  }) {
11319
- popsDOMUtils.off(config.inputTarget, "input", void 0, void 0, option);
11395
+ for (let index = 0; index < SearchSuggestion.$evt.offInputChangeEvtHandler.length; index++) {
11396
+ const handler = SearchSuggestion.$evt.offInputChangeEvtHandler[index];
11397
+ handler();
11398
+ SearchSuggestion.$evt.offInputChangeEvtHandler.splice(index, 1);
11399
+ index--;
11400
+ }
11320
11401
  },
11321
11402
  /**
11322
11403
  * 显示搜索建议框的事件
@@ -11442,23 +11523,24 @@
11442
11523
  /**
11443
11524
  * 获取删除按钮的html
11444
11525
  */
11445
- getDeleteIconHTML(size = 16, fill = "#bababa") {
11446
- return /*html*/ `
11447
- <svg class="pops-${popsType}-delete-icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" fill="${fill}">
11448
- <path d="M512 883.2A371.2 371.2 0 1 0 140.8 512 371.2 371.2 0 0 0 512 883.2z m0 64a435.2 435.2 0 1 1 435.2-435.2 435.2 435.2 0 0 1-435.2 435.2z"></path>
11449
- <path d="M557.056 512l122.368 122.368a31.744 31.744 0 1 1-45.056 45.056L512 557.056l-122.368 122.368a31.744 31.744 0 1 1-45.056-45.056L466.944 512 344.576 389.632a31.744 31.744 0 1 1 45.056-45.056L512 466.944l122.368-122.368a31.744 31.744 0 1 1 45.056 45.056z"></path>
11450
- </svg>
11451
- `;
11526
+ createItemDeleteIcon(size = 16, fill = "#bababa") {
11527
+ let $svg = popsDOMUtils.parseTextToDOM(/*html*/ `
11528
+ <svg class="pops-${popsType}-delete-icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" fill="${fill}">
11529
+ <path d="M512 883.2A371.2 371.2 0 1 0 140.8 512 371.2 371.2 0 0 0 512 883.2z m0 64a435.2 435.2 0 1 1 435.2-435.2 435.2 435.2 0 0 1-435.2 435.2z"></path>
11530
+ <path d="M557.056 512l122.368 122.368a31.744 31.744 0 1 1-45.056 45.056L512 557.056l-122.368 122.368a31.744 31.744 0 1 1-45.056-45.056L466.944 512 344.576 389.632a31.744 31.744 0 1 1 45.056-45.056L512 466.944l122.368-122.368a31.744 31.744 0 1 1 45.056 45.056z"></path>
11531
+ </svg>
11532
+ `);
11533
+ return $svg;
11452
11534
  },
11453
11535
  /**
11454
11536
  * 设置当前正在搜索中的提示
11455
11537
  */
11456
11538
  setPromptsInSearch() {
11457
- let isSearchingElement = popsDOMUtils.createElement("li", {
11539
+ let $isSearching = popsDOMUtils.createElement("li", {
11458
11540
  className: `pops-${popsType}-search-suggestion-hint-searching-item`,
11459
11541
  innerHTML: config.searchingTip,
11460
11542
  });
11461
- SearchSuggestion.$el.$hintULContainer.appendChild(isSearchingElement);
11543
+ SearchSuggestion.addItem($isSearching);
11462
11544
  },
11463
11545
  /**
11464
11546
  * 移除正在搜索中的提示
@@ -11468,17 +11550,13 @@
11468
11550
  .querySelector(`li.pops-${popsType}-search-suggestion-hint-searching-item`)
11469
11551
  ?.remove();
11470
11552
  },
11471
- /**
11472
- * 清空所有的搜索结果
11473
- */
11474
- clearAllSearchItemLi() {
11475
- PopsSafeUtils.setSafeHTML(SearchSuggestion.$el.$hintULContainer, "");
11476
- },
11477
11553
  /**
11478
11554
  * 更新搜索建议框的位置(top、left)
11479
11555
  * 因为目标元素可能是动态隐藏的
11556
+ * @param target 目标元素
11557
+ * @param checkPositonAgain 是否在更新位置信息后检测更新位置信息,默认true
11480
11558
  */
11481
- changeHintULElementPosition(target = config.target ?? config.inputTarget) {
11559
+ changeHintULElementPosition(target = config.target ?? config.inputTarget, checkPositonAgain = true) {
11482
11560
  let targetRect = null;
11483
11561
  if (config.followPosition === "inputCursor") {
11484
11562
  targetRect = popsDOMUtils.getTextBoundingRect(config.inputTarget, config.inputTarget.selectionStart || 0, config.inputTarget.selectionEnd || 0, false);
@@ -11542,10 +11620,19 @@
11542
11620
  left = left + documentWidth - hintUIWidth;
11543
11621
  }
11544
11622
  SearchSuggestion.$el.root.style.left = left + "px";
11623
+ // 如果更新前在下面的话且高度超出了屏幕
11624
+ // 这时候会有滚动条,会造成位置偏移
11625
+ // 更新后的位置却在上面,这时候的位置信息不对齐
11626
+ // 需重新更新位置
11627
+ // 此情况一般是config.position === "auto"
11628
+ if (checkPositonAgain) {
11629
+ SearchSuggestion.changeHintULElementPosition(target, !checkPositonAgain);
11630
+ }
11545
11631
  },
11546
11632
  /**
11547
11633
  * 更新搜索建议框的width
11548
11634
  * 因为目标元素可能是动态隐藏的
11635
+ * @param target 目标元素
11549
11636
  */
11550
11637
  changeHintULElementWidth(target = config.target ?? config.inputTarget) {
11551
11638
  let targetRect = target.getBoundingClientRect();
@@ -11560,11 +11647,15 @@
11560
11647
  * 动态更新CSS
11561
11648
  */
11562
11649
  updateDynamicCSS() {
11563
- let cssText = this.getDynamicCSS();
11564
- PopsSafeUtils.setSafeHTML(this.$el.$dynamicCSS, cssText);
11650
+ let cssText = SearchSuggestion.getDynamicCSS();
11651
+ PopsSafeUtils.setSafeHTML(SearchSuggestion.$el.$dynamicCSS, cssText);
11565
11652
  },
11566
11653
  /**
11567
11654
  * 数据项的数量改变时调用
11655
+ *
11656
+ * - 更新css
11657
+ * - 更新建议框的宽度
11658
+ * - 更新建议框的位置
11568
11659
  */
11569
11660
  updateStyleSheet() {
11570
11661
  // 更新z-index
@@ -11574,29 +11665,38 @@
11574
11665
  // 更新位置
11575
11666
  SearchSuggestion.changeHintULElementPosition();
11576
11667
  },
11668
+ /**
11669
+ * 添加搜索结果元素
11670
+ * @param $item 项元素
11671
+ */
11672
+ addItem($item) {
11673
+ SearchSuggestion.$el.$hintULContainer.appendChild($item);
11674
+ },
11577
11675
  /**
11578
11676
  * 更新页面显示的搜索结果
11579
- * @param data
11677
+ * @param updateData
11580
11678
  */
11581
- update(data = []) {
11582
- if (!Array.isArray(data)) {
11679
+ update(updateData = []) {
11680
+ if (!Array.isArray(updateData)) {
11583
11681
  throw new TypeError("传入的数据不是数组");
11584
11682
  }
11585
- config.data = data;
11683
+ const data = updateData;
11586
11684
  /* 清空已有的搜索结果 */
11587
- if (config.data.length) {
11685
+ if (data.length) {
11588
11686
  SearchSuggestion.$data.isEmpty = false;
11589
11687
  if (config.toHideWithNotResult) {
11590
11688
  SearchSuggestion.show();
11591
11689
  }
11592
- SearchSuggestion.clearAllSearchItemLi();
11690
+ SearchSuggestion.clear(true);
11593
11691
  /* 添加进ul中 */
11594
- config.data.forEach((item, index) => {
11595
- let itemElement = SearchSuggestion.createSearchItemLiElement(item, index);
11596
- SearchSuggestion.setSearchItemClickEvent(itemElement);
11597
- SearchSuggestion.setSearchItemSelectEvent(itemElement);
11598
- SearchSuggestion.$el.$hintULContainer.appendChild(itemElement);
11692
+ let fragment = document.createDocumentFragment();
11693
+ data.forEach((item, index) => {
11694
+ let $item = SearchSuggestion.createSearchItemLiElement(item, index);
11695
+ SearchSuggestion.setSearchItemClickEvent($item);
11696
+ SearchSuggestion.setSearchItemSelectEvent($item);
11697
+ fragment.appendChild($item);
11599
11698
  });
11699
+ SearchSuggestion.addItem(fragment);
11600
11700
  }
11601
11701
  else {
11602
11702
  /* 清空 */
@@ -11605,13 +11705,24 @@
11605
11705
  },
11606
11706
  /**
11607
11707
  * 清空当前的搜索结果并显示无结果
11708
+ * @param [onlyClearView=false] 是否仅清空元素,默认false
11608
11709
  */
11609
- clear() {
11610
- this.$data.isEmpty = true;
11611
- this.clearAllSearchItemLi();
11612
- this.$el.$hintULContainer.appendChild(popsDOMUtils.parseTextToDOM(config.toSearhNotResultHTML));
11710
+ clear(onlyClearView = false) {
11711
+ PopsSafeUtils.setSafeHTML(SearchSuggestion.$el.$hintULContainer, "");
11712
+ if (onlyClearView) {
11713
+ return;
11714
+ }
11715
+ SearchSuggestion.$data.isEmpty = true;
11716
+ let $noResult;
11717
+ if (typeof config.toSearhNotResultHTML === "string") {
11718
+ $noResult = popsDOMUtils.parseTextToDOM(config.toSearhNotResultHTML);
11719
+ }
11720
+ else {
11721
+ $noResult = config.toSearhNotResultHTML();
11722
+ }
11723
+ SearchSuggestion.addItem($noResult);
11613
11724
  if (config.toHideWithNotResult) {
11614
- this.hide();
11725
+ SearchSuggestion.hide();
11615
11726
  }
11616
11727
  },
11617
11728
  /**
@@ -11622,25 +11733,25 @@
11622
11733
  if (config.useFoldAnimation) {
11623
11734
  if (!useAnimationToHide) {
11624
11735
  // 去掉动画
11625
- popsDOMUtils.removeClassName(this.$el.root, "el-zoom-in-top-animation");
11736
+ popsDOMUtils.removeClassName(SearchSuggestion.$el.root, "el-zoom-in-top-animation");
11626
11737
  }
11627
- popsDOMUtils.addClassName(this.$el.root, "el-zoom-in-top-animation");
11628
- popsDOMUtils.addClassName(this.$el.root, "el-zoom-in-top-animation-hide");
11629
- popsDOMUtils.removeClassName(this.$el.root, "el-zoom-in-top-animation-show");
11738
+ popsDOMUtils.addClassName(SearchSuggestion.$el.root, "el-zoom-in-top-animation");
11739
+ popsDOMUtils.addClassName(SearchSuggestion.$el.root, "el-zoom-in-top-animation-hide");
11740
+ popsDOMUtils.removeClassName(SearchSuggestion.$el.root, "el-zoom-in-top-animation-show");
11630
11741
  }
11631
11742
  else {
11632
- this.$el.root.style.display = "none";
11743
+ SearchSuggestion.$el.root.style.display = "none";
11633
11744
  }
11634
11745
  },
11635
11746
  /**
11636
11747
  * 显示搜索建议框
11637
11748
  */
11638
11749
  show() {
11639
- this.$el.root.style.display = "";
11750
+ SearchSuggestion.$el.root.style.display = "";
11640
11751
  if (config.useFoldAnimation) {
11641
- popsDOMUtils.addClassName(this.$el.root, "el-zoom-in-top-animation");
11642
- popsDOMUtils.removeClassName(this.$el.root, "el-zoom-in-top-animation-hide");
11643
- popsDOMUtils.addClassName(this.$el.root, "el-zoom-in-top-animation-show");
11752
+ popsDOMUtils.addClassName(SearchSuggestion.$el.root, "el-zoom-in-top-animation");
11753
+ popsDOMUtils.removeClassName(SearchSuggestion.$el.root, "el-zoom-in-top-animation-hide");
11754
+ popsDOMUtils.addClassName(SearchSuggestion.$el.root, "el-zoom-in-top-animation-show");
11644
11755
  }
11645
11756
  },
11646
11757
  };
@@ -11652,7 +11763,7 @@
11652
11763
  /** 配置 */
11653
11764
  config = {
11654
11765
  /** 版本号 */
11655
- version: "2025.9.2",
11766
+ version: "2025.9.4",
11656
11767
  cssText: PopsCSS,
11657
11768
  /** icon图标的svg代码 */
11658
11769
  iconSVG: PopsIcon.$data,