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