@whitesev/pops 4.2.2 → 4.2.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 (44) hide show
  1. package/dist/index.amd.js +69 -6
  2. package/dist/index.amd.js.map +1 -1
  3. package/dist/index.amd.min.js +1 -1
  4. package/dist/index.amd.min.js.map +1 -1
  5. package/dist/index.cjs.js +69 -6
  6. package/dist/index.cjs.js.map +1 -1
  7. package/dist/index.cjs.min.js +1 -1
  8. package/dist/index.cjs.min.js.map +1 -1
  9. package/dist/index.esm.js +69 -6
  10. package/dist/index.esm.js.map +1 -1
  11. package/dist/index.esm.min.js +1 -1
  12. package/dist/index.esm.min.js.map +1 -1
  13. package/dist/index.iife.js +69 -6
  14. package/dist/index.iife.js.map +1 -1
  15. package/dist/index.iife.min.js +1 -1
  16. package/dist/index.iife.min.js.map +1 -1
  17. package/dist/index.system.js +69 -6
  18. package/dist/index.system.js.map +1 -1
  19. package/dist/index.system.min.js +1 -1
  20. package/dist/index.system.min.js.map +1 -1
  21. package/dist/index.umd.js +69 -6
  22. package/dist/index.umd.js.map +1 -1
  23. package/dist/index.umd.min.js +1 -1
  24. package/dist/index.umd.min.js.map +1 -1
  25. package/dist/types/src/Pops.d.ts +19 -0
  26. package/dist/types/src/PopsCSS.d.ts +12 -0
  27. package/dist/types/src/components/tooltip/index.d.ts +18 -0
  28. package/dist/types/src/utils/PopsUtils.d.ts +2 -2
  29. package/package.json +14 -14
  30. package/src/PopsCSS.ts +13 -0
  31. package/src/components/alert/index.ts +4 -0
  32. package/src/components/confirm/index.ts +4 -0
  33. package/src/components/drawer/index.ts +4 -0
  34. package/src/components/folder/index.ts +4 -0
  35. package/src/components/iframe/index.ts +4 -0
  36. package/src/components/loading/index.ts +1 -0
  37. package/src/components/panel/index.ts +4 -0
  38. package/src/components/prompt/index.ts +4 -0
  39. package/src/components/rightClickMenu/index.ts +4 -0
  40. package/src/components/searchSuggestion/index.ts +4 -0
  41. package/src/components/tooltip/index.ts +4 -0
  42. package/src/css/skeleton.css +43 -0
  43. package/src/utils/PopsInstanceUtils.ts +3 -4
  44. package/src/utils/PopsUtils.ts +13 -4
@@ -3,7 +3,7 @@ System.register('pops', [], (function (exports) {
3
3
  return {
4
4
  execute: (function () {
5
5
 
6
- const version = "4.2.2";
6
+ const version = "4.2.4";
7
7
 
8
8
  const GlobalConfig = {
9
9
  config: {},
@@ -678,6 +678,10 @@ System.register('pops', [], (function (exports) {
678
678
  if (typeof deviation !== "number" || Number.isNaN(deviation)) {
679
679
  deviation = 10;
680
680
  }
681
+ // 最大值 2147483647
682
+ // const maxZIndex = Math.pow(2, 31) - 1;
683
+ // 比较值 2000000000
684
+ const maxZIndexCompare = 2 * Math.pow(10, 9);
681
685
  /** 坐标偏移 */
682
686
  const positionDistance = 10;
683
687
  const defaultCalcPostion = [];
@@ -772,9 +776,14 @@ System.register('pops', [], (function (exports) {
772
776
  left: maxRect.left,
773
777
  };
774
778
  }
779
+ const calcZIndex = zIndex + deviation;
780
+ if (calcZIndex >= maxZIndexCompare) {
781
+ // 不要超过最大值
782
+ return;
783
+ }
775
784
  return {
776
785
  /** 计算偏移量后的z-index值 */
777
- zIndex: zIndex + deviation,
786
+ zIndex: calcZIndex,
778
787
  /** 获取到的最大的z-index值 */
779
788
  originZIndex: zIndex,
780
789
  /** 拥有最大z-index的元素 */
@@ -2997,6 +3006,8 @@ System.register('pops', [], (function (exports) {
2997
3006
 
2998
3007
  var panelComponents_Select_CSS = ".pops {\n max-height: 300px;\n}\n.select-container {\n --el-font-size-base: 14px;\n --el-text-color-regular: #606266;\n --el-color-primary: #409eff;\n --el-fill-color-light: #f5f7fa;\n --el-disable-color: #a8abb2;\n}\n.select-item {\n cursor: pointer;\n font-size: var(--el-font-size-base);\n padding: 0 20px 0 20px;\n position: relative;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n color: var(--el-text-color-regular);\n min-height: 34px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: flex-start;\n box-sizing: border-box;\n}\n.select-item[aria-disabled],\n.select-item[disabled] {\n cursor: not-allowed;\n color: var(--el-disable-color);\n background: unset;\n}\n.select-item:hover {\n background-color: var(--el-fill-color-light);\n}\n.select-item.select-item-is-selected:has(.pops-panel-input input) {\n background-color: #e7e7e7;\n}\n.select-item.select-item-is-selected {\n color: var(--el-color-primary);\n font-weight: 700;\n}\n.select-item.select-item-is-selected:not(:has(.pops-panel-input))::after {\n content: \"\";\n position: absolute;\n top: 50%;\n right: 12px;\n border-top: none;\n border-right: none;\n background-repeat: no-repeat;\n background-position: center;\n background-color: var(--el-color-primary);\n mask: url(\"data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E\")\n no-repeat;\n mask-size: 100% 100%;\n -webkit-mask: url(\"data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E\")\n no-repeat;\n -webkit-mask-size: 100% 100%;\n transform: translateY(-50%);\n width: 12px;\n height: 12px;\n}\n\n.select-item .pops-panel-input {\n width: 100%;\n margin: 5px 0px;\n}\n.select-item .pops-panel-input:has(.pops-panel-input-valid-error) {\n margin-bottom: 0px;\n}\n\n.select-item .select-item-text {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n\n@media (prefers-color-scheme: dark) {\n .select-container {\n --el-text-color-regular: #f2f2f2;\n --el-disable-color: #8d9095;\n --el-fill-color-light: #262727;\n }\n}\n";
2999
3008
 
3009
+ var skeletonCSS = ".pops-skeleton-item {\n --el-skeleton-color: #f0f2f5;\n --el-skeleton-to-color: #e6e8eb;\n width: 100%;\n height: 18px;\n border-radius: 4px;\n background: var(--el-skeleton-color);\n display: inline-block;\n}\n.pops-skeleton-item[data-circle] {\n border-radius: 50%;\n}\n.pops-skeleton-item[data-img] {\n width: unset;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 0px;\n}\n.pops-skeleton-item[data-img] svg {\n color: #dcdfe6;\n fill: currentcolor;\n width: 22%;\n height: 22%;\n}\n.pops-skeleton-item[data-animated] {\n background: linear-gradient(\n 90deg,\n var(--el-skeleton-color) 25%,\n var(--el-skeleton-to-color) 37%,\n var(--el-skeleton-color) 63%\n );\n background-size: 400% 100%;\n animation: pops-el-skeleton-loading 1.4s ease infinite;\n}\n@keyframes pops-el-skeleton-loading {\n 0% {\n background-position: 100% 50%;\n }\n 100% {\n background-position: 0 50%;\n }\n}\n";
3010
+
3000
3011
  const PopsCSS = {
3001
3012
  /** 主CSS */
3002
3013
  index: indexCSS,
@@ -3032,6 +3043,18 @@ System.register('pops', [], (function (exports) {
3032
3043
  rightClickMenu: rightClickMenuCSS,
3033
3044
  /** pops.panel的select组件 */
3034
3045
  panelComponents_Select: panelComponents_Select_CSS,
3046
+ /**
3047
+ * pops.skeleton
3048
+ *
3049
+ * 需要设置元素className为`pops-skeleton-item`
3050
+ *
3051
+ * 支持以下属性
3052
+ *
3053
+ * + `data-animated`: 加载中的动画
3054
+ * + `data-circle`: 圆形
3055
+ * + `data-img`: 头像图片,需要在它内部添加图片的svg `PopsIcon.getIcon("picture")`
3056
+ */
3057
+ skeletonCSS: skeletonCSS,
3035
3058
  };
3036
3059
 
3037
3060
  const PopsAnimation = {
@@ -3184,8 +3207,8 @@ System.register('pops', [], (function (exports) {
3184
3207
  * 获取pops所有弹窗中的最大的z-index
3185
3208
  * @param deviation
3186
3209
  */
3187
- getPopsMaxZIndex(deviation = 1) {
3188
- deviation = Number.isNaN(deviation) ? 1 : deviation;
3210
+ getPopsMaxZIndex(deviation = 10) {
3211
+ deviation = Number.isNaN(deviation) ? 10 : deviation;
3189
3212
  // 最大值 2147483647
3190
3213
  // const browserMaxZIndex = Math.pow(2, 31) - 1;
3191
3214
  // 比较值 2000000000
@@ -3200,8 +3223,7 @@ System.register('pops', [], (function (exports) {
3200
3223
  const inst = instData[index];
3201
3224
  // 不对position为static和display为none的元素进行获取它们的z-index
3202
3225
  const $elList = [inst.$anim, inst.$pops, inst.$mask].filter((it) => it instanceof HTMLElement);
3203
- const nodeZIndexInfoList = popsUtils.getMaxZIndexNodeInfoFromPoint($elList);
3204
- const maxNodeZIndexInfo = nodeZIndexInfoList[0];
3226
+ const maxNodeZIndexInfo = popsUtils.getMaxZIndexNodeInfoFromPoint($elList)[0];
3205
3227
  if (maxNodeZIndexInfo) {
3206
3228
  const nodeZIndex = maxNodeZIndexInfo.zIndex;
3207
3229
  if (nodeZIndex > zIndex) {
@@ -4406,6 +4428,10 @@ System.register('pops', [], (function (exports) {
4406
4428
  name: "common",
4407
4429
  css: PopsCSS.common,
4408
4430
  },
4431
+ {
4432
+ name: "skeleton",
4433
+ css: PopsCSS.skeletonCSS,
4434
+ },
4409
4435
  {
4410
4436
  name: "alertCSS",
4411
4437
  css: PopsCSS.alertCSS,
@@ -4614,6 +4640,10 @@ System.register('pops', [], (function (exports) {
4614
4640
  name: "common",
4615
4641
  css: PopsCSS.common,
4616
4642
  },
4643
+ {
4644
+ name: "skeleton",
4645
+ css: PopsCSS.skeletonCSS,
4646
+ },
4617
4647
  {
4618
4648
  name: "confirmCSS",
4619
4649
  css: PopsCSS.confirmCSS,
@@ -4822,6 +4852,10 @@ System.register('pops', [], (function (exports) {
4822
4852
  name: "common",
4823
4853
  css: PopsCSS.common,
4824
4854
  },
4855
+ {
4856
+ name: "skeleton",
4857
+ css: PopsCSS.skeletonCSS,
4858
+ },
4825
4859
  {
4826
4860
  name: "drawerCSS",
4827
4861
  css: PopsCSS.drawerCSS,
@@ -5031,6 +5065,7 @@ System.register('pops', [], (function (exports) {
5031
5065
  <style data-model-name="index">${PopsCSS.index}</style>
5032
5066
  <style data-model-name="anim">${PopsCSS.anim}</style>
5033
5067
  <style data-model-name="common">${PopsCSS.common}</style>
5068
+ <style data-model-name="skeleton">${PopsCSS.skeletonCSS}</style>
5034
5069
  `
5035
5070
  : ""}
5036
5071
  <style data-model-name="loadingCSS">
@@ -5307,6 +5342,10 @@ System.register('pops', [], (function (exports) {
5307
5342
  name: "common",
5308
5343
  css: PopsCSS.common,
5309
5344
  },
5345
+ {
5346
+ name: "skeleton",
5347
+ css: PopsCSS.skeletonCSS,
5348
+ },
5310
5349
  {
5311
5350
  name: "folderCSS",
5312
5351
  css: PopsCSS.folderCSS,
@@ -6244,6 +6283,10 @@ System.register('pops', [], (function (exports) {
6244
6283
  name: "common",
6245
6284
  css: PopsCSS.common,
6246
6285
  },
6286
+ {
6287
+ name: "skeleton",
6288
+ css: PopsCSS.skeletonCSS,
6289
+ },
6247
6290
  {
6248
6291
  name: "iframeCSS",
6249
6292
  css: PopsCSS.iframeCSS,
@@ -7943,6 +7986,10 @@ System.register('pops', [], (function (exports) {
7943
7986
  name: "common",
7944
7987
  css: PopsCSS.common,
7945
7988
  },
7989
+ {
7990
+ name: "skeleton",
7991
+ css: PopsCSS.skeletonCSS,
7992
+ },
7946
7993
  {
7947
7994
  name: "tooltipCSS",
7948
7995
  css: PopsCSS.tooltipCSS,
@@ -11825,6 +11872,10 @@ System.register('pops', [], (function (exports) {
11825
11872
  name: "common",
11826
11873
  css: PopsCSS.common,
11827
11874
  },
11875
+ {
11876
+ name: "skeleton",
11877
+ css: PopsCSS.skeletonCSS,
11878
+ },
11828
11879
  {
11829
11880
  name: "panelCSS",
11830
11881
  css: PopsCSS.panelCSS,
@@ -12089,6 +12140,10 @@ System.register('pops', [], (function (exports) {
12089
12140
  name: "common",
12090
12141
  css: PopsCSS.common,
12091
12142
  },
12143
+ {
12144
+ name: "skeleton",
12145
+ css: PopsCSS.skeletonCSS,
12146
+ },
12092
12147
  {
12093
12148
  name: "promptCSS",
12094
12149
  css: PopsCSS.promptCSS,
@@ -12314,6 +12369,10 @@ System.register('pops', [], (function (exports) {
12314
12369
  name: "common",
12315
12370
  css: PopsCSS.common,
12316
12371
  },
12372
+ {
12373
+ name: "skeleton",
12374
+ css: PopsCSS.skeletonCSS,
12375
+ },
12317
12376
  {
12318
12377
  name: "rightClickMenu",
12319
12378
  css: PopsCSS.rightClickMenu,
@@ -12952,6 +13011,10 @@ System.register('pops', [], (function (exports) {
12952
13011
  name: "common",
12953
13012
  css: PopsCSS.common,
12954
13013
  },
13014
+ {
13015
+ name: "skeleton",
13016
+ css: PopsCSS.skeletonCSS,
13017
+ },
12955
13018
  ]);
12956
13019
  // 添加自定义style
12957
13020
  PopsElementHandler.addStyle($shadowRoot, config.style);