@whitesev/pops 2.3.8 → 2.4.0

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