@whitesev/pops 1.5.2 → 1.5.4

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.
Files changed (38) hide show
  1. package/dist/index.amd.js +178 -83
  2. package/dist/index.amd.js.map +1 -1
  3. package/dist/index.cjs.js +178 -83
  4. package/dist/index.cjs.js.map +1 -1
  5. package/dist/index.esm.js +178 -83
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/index.iife.js +178 -83
  8. package/dist/index.iife.js.map +1 -1
  9. package/dist/index.system.js +178 -83
  10. package/dist/index.system.js.map +1 -1
  11. package/dist/index.umd.js +178 -83
  12. package/dist/index.umd.js.map +1 -1
  13. package/dist/types/src/components/rightClickMenu/indexType.d.ts +1 -1
  14. package/dist/types/src/components/searchSuggestion/indexType.d.ts +1 -1
  15. package/dist/types/src/components/tooltip/indexType.d.ts +1 -1
  16. package/dist/types/src/handler/PopsElementHandler.d.ts +2 -1
  17. package/dist/types/src/handler/PopsHandler.d.ts +5 -0
  18. package/dist/types/src/types/components.d.ts +1 -1
  19. package/package.json +3 -2
  20. package/src/Pops.ts +1 -1
  21. package/src/components/alert/index.ts +6 -3
  22. package/src/components/confirm/index.ts +6 -3
  23. package/src/components/drawer/index.ts +6 -3
  24. package/src/components/folder/index.ts +79 -40
  25. package/src/components/iframe/index.ts +12 -8
  26. package/src/components/loading/index.ts +8 -3
  27. package/src/components/panel/index.ts +8 -3
  28. package/src/components/prompt/index.ts +7 -4
  29. package/src/components/rightClickMenu/index.ts +15 -3
  30. package/src/components/rightClickMenu/indexType.ts +1 -1
  31. package/src/components/searchSuggestion/index.ts +1 -1
  32. package/src/components/searchSuggestion/indexType.ts +1 -1
  33. package/src/components/tooltip/index.ts +3 -1
  34. package/src/components/tooltip/indexType.ts +1 -1
  35. package/src/handler/PopsElementHandler.ts +24 -18
  36. package/src/handler/PopsHandler.ts +27 -4
  37. package/src/types/components.d.ts +1 -1
  38. package/src/utils/PopsUtils.ts +8 -4
package/dist/index.umd.js CHANGED
@@ -1528,17 +1528,21 @@
1528
1528
  else {
1529
1529
  for (const targetKeyName in target) {
1530
1530
  if (targetKeyName in source) {
1531
+ // @ts-ignore
1531
1532
  let targetValue = target[targetKeyName];
1533
+ // @ts-ignore
1532
1534
  let sourceValue = source[targetKeyName];
1533
1535
  if (typeof sourceValue === "object" &&
1534
1536
  sourceValue != null &&
1535
1537
  !UtilsContext.isDOM(sourceValue) &&
1536
1538
  Object.keys(sourceValue).length) {
1537
1539
  /* 源端的值是object类型,且不是元素节点 */
1540
+ // @ts-ignore
1538
1541
  target[targetKeyName] = UtilsContext.assign(targetValue, sourceValue, isAdd);
1539
1542
  continue;
1540
1543
  }
1541
1544
  /* 直接赋值 */
1545
+ // @ts-ignore
1542
1546
  target[targetKeyName] = sourceValue;
1543
1547
  }
1544
1548
  }
@@ -3556,6 +3560,9 @@
3556
3560
  */
3557
3561
  getMaskHTML(guid, zIndex = 101, style = "") {
3558
3562
  zIndex = zIndex - 100;
3563
+ if (style.startsWith(";")) {
3564
+ style = style.replace(";", "");
3565
+ }
3559
3566
  return `<div class="pops-mask" data-guid="${guid}" style="z-index:${zIndex};${style}"></div>`;
3560
3567
  },
3561
3568
  /**
@@ -3565,15 +3572,16 @@
3565
3572
  * @param config
3566
3573
  * @param html
3567
3574
  * @param bottomBtnHTML
3575
+ * @param zIndex
3568
3576
  */
3569
- getAnimHTML(guid, type, config, html = "", bottomBtnHTML = "") {
3577
+ getAnimHTML(guid, type, config, html = "", bottomBtnHTML = "", zIndex) {
3570
3578
  let __config = config;
3571
3579
  let popsAnimStyle = "";
3572
3580
  let popsStyle = "";
3573
3581
  let popsPosition = __config.position || "";
3574
3582
  if (config.zIndex != null) {
3575
- popsAnimStyle += `z-index: ${config.zIndex};`;
3576
- popsStyle += `z-index: ${config.zIndex};`;
3583
+ popsAnimStyle += `z-index: ${zIndex};`;
3584
+ popsStyle += `z-index: ${zIndex};`;
3577
3585
  }
3578
3586
  if (__config.width != null) {
3579
3587
  popsStyle += `width: ${__config.width};`;
@@ -3582,24 +3590,25 @@
3582
3590
  popsStyle += `height: ${__config.height};`;
3583
3591
  }
3584
3592
  let hasBottomBtn = bottomBtnHTML.trim() === "" ? false : true;
3585
- return `<div
3586
- class="pops-anim"
3587
- anim="${__config.animation || ""}"
3588
- style="${popsAnimStyle};"
3589
- data-guid="${guid}">
3593
+ return /*html*/ `
3594
+ <div
3595
+ class="pops-anim"
3596
+ anim="${__config.animation || ""}"
3597
+ style="${popsAnimStyle};"
3598
+ data-guid="${guid}">
3590
3599
  ${config.style != null
3591
3600
  ? `<style tyle="text/css">${config.style}</style>`
3592
3601
  : ""}
3593
- <div
3594
- class="pops ${config.class || ""}"
3595
- data-bottom-btn="${hasBottomBtn}"
3596
- type-value="${type}"
3597
- style="${popsStyle}"
3598
- position="${popsPosition}"
3599
- data-guid="${guid}">
3600
- ${html}
3601
- </div>
3602
- </div>`;
3602
+ <div
3603
+ class="pops ${config.class || ""}"
3604
+ data-bottom-btn="${hasBottomBtn}"
3605
+ type-value="${type}"
3606
+ style="${popsStyle}"
3607
+ position="${popsPosition}"
3608
+ data-guid="${guid}">
3609
+ ${html}
3610
+ </div>
3611
+ </div>`;
3603
3612
  },
3604
3613
  /**
3605
3614
  * 获取顶部按钮层HTML
@@ -4209,6 +4218,18 @@
4209
4218
  capture: true,
4210
4219
  });
4211
4220
  },
4221
+ /**
4222
+ * 把配置的z-index配置转为数字
4223
+ * @param zIndex
4224
+ */
4225
+ handleZIndex(zIndex) {
4226
+ if (typeof zIndex === "function") {
4227
+ return zIndex();
4228
+ }
4229
+ else {
4230
+ return zIndex;
4231
+ }
4232
+ },
4212
4233
  /**
4213
4234
  * 处理config.only
4214
4235
  * @param type 当前弹窗类型
@@ -4234,8 +4255,19 @@
4234
4255
  }
4235
4256
  }
4236
4257
  else {
4237
- const { zIndex: maxZIndex } = PopsInstanceUtils.getPopsMaxZIndex(config.zIndex + 100);
4238
- config.zIndex = maxZIndex;
4258
+ // 对配置进行处理
4259
+ // 选择配置的z-index和已有的pops实例的最大z-index值
4260
+ if (typeof config.zIndex === "function") {
4261
+ let originZIndexFn = config.zIndex;
4262
+ config.zIndex = () => {
4263
+ const { zIndex: maxZIndex } = PopsInstanceUtils.getPopsMaxZIndex(PopsHandler.handleZIndex(originZIndexFn) + 100);
4264
+ return maxZIndex;
4265
+ };
4266
+ }
4267
+ else {
4268
+ const { zIndex: maxZIndex } = PopsInstanceUtils.getPopsMaxZIndex(PopsHandler.handleZIndex(config.zIndex) + 100);
4269
+ config.zIndex = maxZIndex;
4270
+ }
4239
4271
  }
4240
4272
  return config;
4241
4273
  },
@@ -4323,12 +4355,15 @@
4323
4355
  // 设置当前类型
4324
4356
  const PopsType = "alert";
4325
4357
  config = PopsHandler.handleOnly(PopsType, config);
4326
- let maskHTML = PopsElementHandler.getMaskHTML(guid, config.zIndex);
4358
+ // 先把z-index提取出来
4359
+ let zIndex = PopsHandler.handleZIndex(config.zIndex);
4360
+ let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
4327
4361
  let headerBtnHTML = PopsElementHandler.getHeaderBtnHTML(PopsType, config);
4328
4362
  let bottomBtnHTML = PopsElementHandler.getBottomBtnHTML(PopsType, config);
4329
4363
  let { headerStyle, headerPStyle } = PopsElementHandler.getHeaderStyle(PopsType, config);
4330
4364
  let { contentStyle, contentPStyle } = PopsElementHandler.getContentStyle(PopsType, config);
4331
- let animHTML = PopsElementHandler.getAnimHTML(guid, PopsType, config, `
4365
+ let animHTML = PopsElementHandler.getAnimHTML(guid, PopsType, config,
4366
+ /*html*/ `
4332
4367
  <div
4333
4368
  class="pops-alert-title"
4334
4369
  style="text-align: ${config.title.position};
@@ -4343,7 +4378,7 @@
4343
4378
  ? config.content.text
4344
4379
  : `<p pops style="${contentPStyle}">${config.content.text}</p>`}
4345
4380
  </div>
4346
- ${bottomBtnHTML}`, bottomBtnHTML);
4381
+ ${bottomBtnHTML}`, bottomBtnHTML, zIndex);
4347
4382
  /**
4348
4383
  * 弹窗的主元素,包括动画层
4349
4384
  */
@@ -4505,12 +4540,15 @@
4505
4540
  // 设置当前类型
4506
4541
  const PopsType = "confirm";
4507
4542
  config = PopsHandler.handleOnly(PopsType, config);
4508
- let maskHTML = PopsElementHandler.getMaskHTML(guid, config.zIndex);
4543
+ // 先把z-index提取出来
4544
+ let zIndex = PopsHandler.handleZIndex(config.zIndex);
4545
+ let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
4509
4546
  let headerBtnHTML = PopsElementHandler.getHeaderBtnHTML(PopsType, config);
4510
4547
  let bottomBtnHTML = PopsElementHandler.getBottomBtnHTML(PopsType, config);
4511
4548
  let { headerStyle, headerPStyle } = PopsElementHandler.getHeaderStyle(PopsType, config);
4512
4549
  let { contentStyle, contentPStyle } = PopsElementHandler.getContentStyle(PopsType, config);
4513
- let animHTML = PopsElementHandler.getAnimHTML(guid, PopsType, config, `
4550
+ let animHTML = PopsElementHandler.getAnimHTML(guid, PopsType, config,
4551
+ /*html*/ `
4514
4552
  <div class="pops-confirm-title" style="text-align: ${config.title.position};${headerStyle}">
4515
4553
  ${config.title.html
4516
4554
  ? config.title.text
@@ -4524,7 +4562,7 @@
4524
4562
 
4525
4563
  </div>
4526
4564
  ${bottomBtnHTML}
4527
- `, bottomBtnHTML);
4565
+ `, bottomBtnHTML, zIndex);
4528
4566
  /**
4529
4567
  * 弹窗的主元素,包括动画层
4530
4568
  */
@@ -4693,12 +4731,15 @@
4693
4731
  let guid = popsUtils.getRandomGUID();
4694
4732
  const PopsType = "prompt";
4695
4733
  config = PopsHandler.handleOnly(PopsType, config);
4696
- let maskHTML = PopsElementHandler.getMaskHTML(guid, config.zIndex);
4734
+ // 先把z-index提取出来
4735
+ let zIndex = PopsHandler.handleZIndex(config.zIndex);
4736
+ let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
4697
4737
  let headerBtnHTML = PopsElementHandler.getHeaderBtnHTML(PopsType, config);
4698
4738
  let bottomBtnHTML = PopsElementHandler.getBottomBtnHTML(PopsType, config);
4699
4739
  let { headerStyle, headerPStyle } = PopsElementHandler.getHeaderStyle(PopsType, config);
4700
4740
  let { contentPStyle } = PopsElementHandler.getContentStyle(PopsType, config);
4701
- let animHTML = PopsElementHandler.getAnimHTML(guid, PopsType, config, `
4741
+ let animHTML = PopsElementHandler.getAnimHTML(guid, PopsType, config,
4742
+ /*html*/ `
4702
4743
  <div class="pops-prompt-title" style="text-align: ${config.title.position};${headerStyle}">
4703
4744
  ${config.title.html
4704
4745
  ? config.title.text
@@ -4716,8 +4757,8 @@
4716
4757
  (config.content.password ? "password" : "text") +
4717
4758
  '">'}
4718
4759
  </div>
4719
- ${bottomBtnHTML}
4720
- `, bottomBtnHTML);
4760
+ ${bottomBtnHTML}
4761
+ `, bottomBtnHTML, zIndex);
4721
4762
  /**
4722
4763
  * 弹窗的主元素,包括动画层
4723
4764
  */
@@ -4814,9 +4855,12 @@
4814
4855
  let guid = popsUtils.getRandomGUID();
4815
4856
  const PopsType = "loading";
4816
4857
  config = PopsHandler.handleOnly(PopsType, config);
4817
- let maskHTML = PopsElementHandler.getMaskHTML(guid, config.zIndex);
4858
+ // 先把z-index提取出来
4859
+ let zIndex = PopsHandler.handleZIndex(config.zIndex);
4860
+ let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
4818
4861
  let { contentPStyle } = PopsElementHandler.getContentStyle("loading", config);
4819
- let animHTML = PopsElementHandler.getAnimHTML(guid, PopsType, config, `
4862
+ let animHTML = PopsElementHandler.getAnimHTML(guid, PopsType, config,
4863
+ /*html*/ `
4820
4864
  <div class="pops-loading-content">
4821
4865
  ${config.addIndexCSS
4822
4866
  ? `
@@ -4831,7 +4875,7 @@
4831
4875
  ${config.style != null ? `<style>${config.style}</style>` : ""}
4832
4876
  <p pops style="${contentPStyle}">${config.content.text}</p>
4833
4877
  </div>
4834
- `, "");
4878
+ `, "", zIndex);
4835
4879
  /**
4836
4880
  * 弹窗的主元素,包括动画层
4837
4881
  */
@@ -4947,12 +4991,15 @@
4947
4991
  let maskExtraStyle = config.animation != null && config.animation != ""
4948
4992
  ? "position:absolute;"
4949
4993
  : "";
4950
- let maskHTML = PopsElementHandler.getMaskHTML(guid, config.zIndex, maskExtraStyle);
4994
+ // 先把z-index提取出来
4995
+ let zIndex = PopsHandler.handleZIndex(config.zIndex);
4996
+ let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex, maskExtraStyle);
4951
4997
  let headerBtnHTML = PopsElementHandler.getHeaderBtnHTML(PopsType, config);
4952
4998
  let iframeLoadingHTML = '<div class="pops-loading"></div>';
4953
4999
  let titleText = config.title.text.trim() !== "" ? config.title.text : config.url;
4954
5000
  let { headerStyle, headerPStyle } = PopsElementHandler.getHeaderStyle(PopsType, config);
4955
- let animHTML = PopsElementHandler.getAnimHTML(guid, PopsType, config, `
5001
+ let animHTML = PopsElementHandler.getAnimHTML(guid, PopsType, config,
5002
+ /*html*/ `
4956
5003
  <div
4957
5004
  class="pops-iframe-title"
4958
5005
  style="text-align: ${config.title.position};${headerStyle}"
@@ -4973,7 +5020,7 @@
4973
5020
  </iframe>
4974
5021
  </div>
4975
5022
  ${config.loading.enable ? iframeLoadingHTML : ""}
4976
- `, "");
5023
+ `, "", zIndex);
4977
5024
  /**
4978
5025
  * 弹窗的主元素,包括动画层
4979
5026
  */
@@ -5205,7 +5252,7 @@
5205
5252
  popsDOMUtils.addClassName(_toolTipElement_, config.className);
5206
5253
  }
5207
5254
  _toolTipElement_.setAttribute("data-guid", guid);
5208
- _toolTipElement_.style.zIndex = config.zIndex.toString();
5255
+ _toolTipElement_.style.zIndex = PopsHandler.handleZIndex(config.zIndex).toString();
5209
5256
  _toolTipElement_.innerHTML = `<div style="text-align: center;">${getContent()}</div>`;
5210
5257
  /* 箭头元素 */
5211
5258
  let _toolTipArrowHTML_ = '<div class="pops-tip-arrow"></div>';
@@ -5522,12 +5569,15 @@
5522
5569
  let guid = popsUtils.getRandomGUID();
5523
5570
  const PopsType = "drawer";
5524
5571
  config = PopsHandler.handleOnly(PopsType, config);
5525
- let maskHTML = PopsElementHandler.getMaskHTML(guid, config.zIndex);
5572
+ // 先把z-index提取出来
5573
+ let zIndex = PopsHandler.handleZIndex(config.zIndex);
5574
+ let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
5526
5575
  let headerBtnHTML = PopsElementHandler.getHeaderBtnHTML(PopsType, config);
5527
5576
  let bottomBtnHTML = PopsElementHandler.getBottomBtnHTML(PopsType, config);
5528
5577
  let { headerStyle, headerPStyle } = PopsElementHandler.getHeaderStyle(PopsType, config);
5529
5578
  let { contentStyle, contentPStyle } = PopsElementHandler.getContentStyle(PopsType, config);
5530
- let animHTML = PopsElementHandler.getAnimHTML(guid, PopsType, config, `
5579
+ let animHTML = PopsElementHandler.getAnimHTML(guid, PopsType, config,
5580
+ /*html*/ `
5531
5581
  ${config.title.enable
5532
5582
  ? `
5533
5583
  <div class="pops-${PopsType}-title" style="${headerStyle}">
@@ -5551,7 +5601,7 @@
5551
5601
  </div>
5552
5602
 
5553
5603
  ${bottomBtnHTML}
5554
- `, bottomBtnHTML);
5604
+ `, bottomBtnHTML, zIndex);
5555
5605
  /**
5556
5606
  * 弹窗的主元素,包括动画层
5557
5607
  */
@@ -5909,7 +5959,9 @@
5909
5959
  let guid = popsUtils.getRandomGUID();
5910
5960
  const PopsType = "folder";
5911
5961
  config = PopsHandler.handleOnly(PopsType, config);
5912
- let maskHTML = PopsElementHandler.getMaskHTML(guid, config.zIndex);
5962
+ // 先把z-index提取出来
5963
+ let zIndex = PopsHandler.handleZIndex(config.zIndex);
5964
+ let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
5913
5965
  let headerBtnHTML = PopsElementHandler.getHeaderBtnHTML(PopsType, config);
5914
5966
  let bottomBtnHTML = PopsElementHandler.getBottomBtnHTML(PopsType, config);
5915
5967
  let { headerStyle, headerPStyle } = PopsElementHandler.getHeaderStyle(PopsType, config);
@@ -6020,7 +6072,7 @@
6020
6072
  </div>
6021
6073
  </div>
6022
6074
  ${bottomBtnHTML}
6023
- `, bottomBtnHTML);
6075
+ `, bottomBtnHTML, zIndex);
6024
6076
  /**
6025
6077
  * 弹窗的主元素,包括动画层
6026
6078
  */
@@ -6071,8 +6123,9 @@
6071
6123
  * @param fileName
6072
6124
  * @param latestTime
6073
6125
  * @param [fileSize="-"]
6126
+ * @param isFolder
6074
6127
  */
6075
- function createFolderRowElement(fileName, latestTime = "-", fileSize = "-") {
6128
+ function createFolderRowElement(fileName, latestTime = "-", fileSize = "-", isFolder = false) {
6076
6129
  let origin_fileName = fileName;
6077
6130
  let origin_latestTime = latestTime;
6078
6131
  let origin_fileSize = fileSize;
@@ -6082,7 +6135,7 @@
6082
6135
  let fileFormatSize = popsDOMUtils.createElement("td");
6083
6136
  let fileType = "";
6084
6137
  let fileIcon = Folder_ICON.folder;
6085
- if (arguments.length === 1) {
6138
+ if (isFolder) {
6086
6139
  /* 文件夹 */
6087
6140
  latestTime = "";
6088
6141
  fileSize = "";
@@ -6137,6 +6190,7 @@
6137
6190
  fileName: origin_fileName,
6138
6191
  latestTime: origin_latestTime,
6139
6192
  fileSize: origin_fileSize,
6193
+ isFolder: isFolder,
6140
6194
  };
6141
6195
  fileNameElement["__value__"] = __value__;
6142
6196
  fileTimeElement["__value__"] = __value__;
@@ -6155,7 +6209,7 @@
6155
6209
  /**
6156
6210
  * 创建移动端文件夹元素
6157
6211
  */
6158
- function createMobileFolderRowElement(fileName, latestTime = "-", fileSize = "-") {
6212
+ function createMobileFolderRowElement(fileName, latestTime = "-", fileSize = "-", isFolder = false) {
6159
6213
  let origin_fileName = fileName;
6160
6214
  let origin_latestTime = latestTime;
6161
6215
  let origin_fileSize = fileSize;
@@ -6163,7 +6217,7 @@
6163
6217
  let fileNameElement = popsDOMUtils.createElement("td");
6164
6218
  let fileType = "";
6165
6219
  let fileIcon = Folder_ICON.folder;
6166
- if (arguments.length === 1) {
6220
+ if (isFolder) {
6167
6221
  /* 文件夹 */
6168
6222
  latestTime = "";
6169
6223
  fileSize = "";
@@ -6207,6 +6261,7 @@
6207
6261
  fileName: origin_fileName,
6208
6262
  latestTime: origin_latestTime,
6209
6263
  fileSize: origin_fileSize,
6264
+ isFolder: isFolder,
6210
6265
  };
6211
6266
  fileNameElement["__value__"] = __value__;
6212
6267
  folderELement["__value__"] = __value__;
@@ -6380,30 +6435,24 @@
6380
6435
  }
6381
6436
  /**
6382
6437
  * 对配置进行排序
6383
- * @param _config_
6438
+ * @param folderDataConfigList
6384
6439
  * @param sortName 比较的属性,默认fileName
6385
6440
  * @param isDesc 是否降序,默认false(升序)
6386
6441
  */
6387
- function sortFolderConfig(_config_, sortName = "fileName", isDesc = false) {
6388
- _config_.sort((a, b) => {
6389
- let beforeVal = a[sortName];
6390
- let afterVal = b[sortName];
6391
- if (sortName === "fileName") {
6392
- /* 文件名,进行字符串转换 */
6393
- beforeVal = beforeVal.toString();
6394
- afterVal = afterVal.toString();
6395
- }
6396
- else if (sortName === "fileSize") {
6397
- /* 文件大小,进行Float转换 */
6398
- beforeVal = parseFloat(beforeVal);
6399
- afterVal = parseFloat(afterVal);
6400
- }
6401
- else if (sortName === "latestTime") {
6402
- /* 文件时间 */
6403
- beforeVal = new Date(beforeVal).getTime();
6404
- afterVal = new Date(afterVal).getTime();
6405
- }
6406
- if (typeof beforeVal === "string" && typeof afterVal === "string") {
6442
+ function sortFolderConfig(folderDataConfigList, sortName = "fileName", isDesc = false) {
6443
+ console.log(folderDataConfigList, sortName, isDesc);
6444
+ if (sortName === "fileName") {
6445
+ // 如果是以文件名排序,文件夹优先放前面
6446
+ let onlyFolderDataConfigList = folderDataConfigList.filter((value) => {
6447
+ return value.isFolder;
6448
+ });
6449
+ let onlyFileDataConfigList = folderDataConfigList.filter((value) => {
6450
+ return !value.isFolder;
6451
+ });
6452
+ // 文件夹排序
6453
+ onlyFolderDataConfigList.sort((leftConfig, rightConfig) => {
6454
+ let beforeVal = leftConfig[sortName].toString();
6455
+ let afterVal = rightConfig[sortName].toString();
6407
6456
  let compareVal = beforeVal.localeCompare(afterVal);
6408
6457
  if (isDesc) {
6409
6458
  /* 降序 */
@@ -6415,8 +6464,46 @@
6415
6464
  }
6416
6465
  }
6417
6466
  return compareVal;
6467
+ });
6468
+ // 文件名排序
6469
+ onlyFileDataConfigList.sort((leftConfig, rightConfig) => {
6470
+ let beforeVal = leftConfig[sortName].toString();
6471
+ let afterVal = rightConfig[sortName].toString();
6472
+ let compareVal = beforeVal.localeCompare(afterVal);
6473
+ if (isDesc) {
6474
+ /* 降序 */
6475
+ if (compareVal > 0) {
6476
+ compareVal = -1;
6477
+ }
6478
+ else if (compareVal < 0) {
6479
+ compareVal = 1;
6480
+ }
6481
+ }
6482
+ return compareVal;
6483
+ });
6484
+ if (isDesc) {
6485
+ // 降序,文件夹在下面
6486
+ return [...onlyFileDataConfigList, ...onlyFolderDataConfigList];
6418
6487
  }
6419
6488
  else {
6489
+ // 升序,文件夹在上面
6490
+ return [...onlyFolderDataConfigList, ...onlyFileDataConfigList];
6491
+ }
6492
+ }
6493
+ else {
6494
+ folderDataConfigList.sort((beforeConfig, afterConfig) => {
6495
+ let beforeVal = beforeConfig[sortName];
6496
+ let afterVal = afterConfig[sortName];
6497
+ if (sortName === "fileSize") {
6498
+ /* 文件大小,进行Float转换 */
6499
+ beforeVal = parseFloat(beforeVal.toString());
6500
+ afterVal = parseFloat(afterVal.toString());
6501
+ }
6502
+ else if (sortName === "latestTime") {
6503
+ /* 文件时间 */
6504
+ beforeVal = new Date(beforeVal).getTime();
6505
+ afterVal = new Date(afterVal).getTime();
6506
+ }
6420
6507
  if (beforeVal > afterVal) {
6421
6508
  if (isDesc) {
6422
6509
  /* 降序 */
@@ -6438,9 +6525,9 @@
6438
6525
  else {
6439
6526
  return 0;
6440
6527
  }
6441
- }
6442
- });
6443
- return _config_;
6528
+ });
6529
+ return folderDataConfigList;
6530
+ }
6444
6531
  }
6445
6532
  /**
6446
6533
  * 添加元素
@@ -6451,8 +6538,8 @@
6451
6538
  _config_.forEach((item) => {
6452
6539
  if (item["isFolder"]) {
6453
6540
  let { folderELement, fileNameElement } = pops.isPhone()
6454
- ? createMobileFolderRowElement(item["fileName"])
6455
- : createFolderRowElement(item["fileName"]);
6541
+ ? createMobileFolderRowElement(item["fileName"], "", "", true)
6542
+ : createFolderRowElement(item["fileName"], "", "", true);
6456
6543
  popsDOMUtils.on(fileNameElement, "click", (event) => {
6457
6544
  refreshFolderInfoClickEvent(event, item);
6458
6545
  });
@@ -6460,8 +6547,8 @@
6460
6547
  }
6461
6548
  else {
6462
6549
  let { folderELement, fileNameElement } = pops.isPhone()
6463
- ? createMobileFolderRowElement(item["fileName"], item["latestTime"], item["fileSize"])
6464
- : createFolderRowElement(item["fileName"], item["latestTime"], item["fileSize"]);
6550
+ ? createMobileFolderRowElement(item["fileName"], item.latestTime, item.fileSize, false)
6551
+ : createFolderRowElement(item["fileName"], item.latestTime, item.fileSize, false);
6465
6552
  setFileClickEvent(fileNameElement, item);
6466
6553
  folderListBodyElement.appendChild(folderELement);
6467
6554
  }
@@ -6498,7 +6585,6 @@
6498
6585
  * @param {PointerEvent} target
6499
6586
  * @param {HTMLElement} event
6500
6587
  * @param {string} sortName
6501
- * @returns
6502
6588
  */
6503
6589
  function arrowSortClickEvent(target, event, sortName) {
6504
6590
  if (!event["notChangeSortRule"]) {
@@ -6977,10 +7063,13 @@
6977
7063
  let guid = popsUtils.getRandomGUID();
6978
7064
  const PopsType = "panel";
6979
7065
  config = PopsHandler.handleOnly(PopsType, config);
6980
- let maskHTML = PopsElementHandler.getMaskHTML(guid, config.zIndex);
7066
+ // 先把z-index提取出来
7067
+ let zIndex = PopsHandler.handleZIndex(config.zIndex);
7068
+ let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
6981
7069
  let headerBtnHTML = PopsElementHandler.getHeaderBtnHTML(PopsType, config);
6982
7070
  let { headerStyle, headerPStyle } = PopsElementHandler.getHeaderStyle(PopsType, config);
6983
- let animHTML = PopsElementHandler.getAnimHTML(guid, PopsType, config, `
7071
+ let animHTML = PopsElementHandler.getAnimHTML(guid, PopsType, config,
7072
+ /*html*/ `
6984
7073
  <div
6985
7074
  class="pops-${PopsType}-title"
6986
7075
  style="text-align: ${config.title.position};
@@ -6998,7 +7087,7 @@
6998
7087
  <ul class="pops-panel-container-header-ul"></ul>
6999
7088
  <ul></ul>
7000
7089
  </section>
7001
- </div>`, "");
7090
+ </div>`, "", zIndex);
7002
7091
  /**
7003
7092
  * 弹窗的主元素,包括动画层
7004
7093
  */
@@ -9089,7 +9178,7 @@
9089
9178
  * @param isChildren 是否是rightClickMenu的某一项的子菜单
9090
9179
  */
9091
9180
  getMenuContainerElement(zIndex, isChildren) {
9092
- let menuElement = popsUtils.parseTextToDOM(`
9181
+ let menuElement = popsUtils.parseTextToDOM(/*html*/ `
9093
9182
  <div class="pops-${PopsType}" ${isChildren ? 'is-children="true"' : ""}>
9094
9183
  <style type="text/css" data-from="pops-${PopsType}">
9095
9184
  .pops-${PopsType} *{
@@ -9177,6 +9266,12 @@
9177
9266
  }
9178
9267
  return menuElement;
9179
9268
  },
9269
+ /**
9270
+ * 动态获取配的z-index
9271
+ */
9272
+ getMenuZIndex() {
9273
+ return PopsHandler.handleZIndex(config.zIndex);
9274
+ },
9180
9275
  /**
9181
9276
  * 获取left、top偏移
9182
9277
  * @param menuElement 菜单元素
@@ -9211,7 +9306,7 @@
9211
9306
  * @param _config_
9212
9307
  */
9213
9308
  showMenu(menuEvent, _config_) {
9214
- let menuElement = this.getMenuContainerElement(config.zIndex, false);
9309
+ let menuElement = this.getMenuContainerElement(this.getMenuZIndex(), false);
9215
9310
  menuElement["__menuData__"] = {
9216
9311
  child: [],
9217
9312
  };
@@ -9249,7 +9344,7 @@
9249
9344
  * @param targetLiElement 父li项元素
9250
9345
  */
9251
9346
  showClildMenu(menuEvent, posInfo, _config_, rootElement, targetLiElement) {
9252
- let menuElement = this.getMenuContainerElement(config.zIndex, true);
9347
+ let menuElement = this.getMenuContainerElement(this.getMenuZIndex(), true);
9253
9348
  menuElement["__menuData__"] = {
9254
9349
  parent: targetLiElement,
9255
9350
  root: rootElement,
@@ -9515,7 +9610,7 @@
9515
9610
  }
9516
9611
  ul.pops-${PopsType}-search-suggestion-hint{
9517
9612
  position: ${config.isAbsolute ? "absolute" : "fixed"};
9518
- z-index: ${config.zIndex};
9613
+ z-index: ${PopsHandler.handleZIndex(config.zIndex)};
9519
9614
  width: 0;
9520
9615
  left: 0;
9521
9616
  max-height: ${config.maxHeight};
@@ -9952,7 +10047,7 @@
9952
10047
  /** 配置 */
9953
10048
  config = {
9954
10049
  /** 版本号 */
9955
- version: "2024.8.15",
10050
+ version: "2024.9.10",
9956
10051
  cssText: {
9957
10052
  /** 主CSS */
9958
10053
  index: indexCSS,