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