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