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