@whitesev/pops 4.2.3 → 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 (41) hide show
  1. package/dist/index.amd.js +56 -1
  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 +56 -1
  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 +56 -1
  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 +56 -1
  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 +56 -1
  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 +56 -1
  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/package.json +14 -14
  29. package/src/PopsCSS.ts +13 -0
  30. package/src/components/alert/index.ts +4 -0
  31. package/src/components/confirm/index.ts +4 -0
  32. package/src/components/drawer/index.ts +4 -0
  33. package/src/components/folder/index.ts +4 -0
  34. package/src/components/iframe/index.ts +4 -0
  35. package/src/components/loading/index.ts +1 -0
  36. package/src/components/panel/index.ts +4 -0
  37. package/src/components/prompt/index.ts +4 -0
  38. package/src/components/rightClickMenu/index.ts +4 -0
  39. package/src/components/searchSuggestion/index.ts +4 -0
  40. package/src/components/tooltip/index.ts +4 -0
  41. package/src/css/skeleton.css +43 -0
@@ -36,6 +36,7 @@ declare class Pops {
36
36
  panelCSS: string;
37
37
  rightClickMenu: string;
38
38
  panelComponents_Select: string;
39
+ skeletonCSS: string;
39
40
  };
40
41
  /** icon图标的svg代码 */
41
42
  iconSVG: {
@@ -940,6 +941,24 @@ declare class Pops {
940
941
  time: number;
941
942
  callback: (...args: any[]) => IPromise<void>;
942
943
  }[]>;
944
+ getOrInsert: (key: string, defaultValue: {
945
+ type: import("./types/main").PopsType;
946
+ time: number;
947
+ callback: (...args: any[]) => IPromise<void>;
948
+ }[]) => {
949
+ type: import("./types/main").PopsType;
950
+ time: number;
951
+ callback: (...args: any[]) => IPromise<void>;
952
+ }[];
953
+ getOrInsertComputed: (key: string, callback: (key: string) => {
954
+ type: import("./types/main").PopsType;
955
+ time: number;
956
+ callback: (...args: any[]) => IPromise<void>;
957
+ }[]) => {
958
+ type: import("./types/main").PopsType;
959
+ time: number;
960
+ callback: (...args: any[]) => IPromise<void>;
961
+ }[];
943
962
  [Symbol.iterator]: () => MapIterator<[string, {
944
963
  type: import("./types/main").PopsType;
945
964
  time: number;
@@ -33,4 +33,16 @@ export declare const PopsCSS: {
33
33
  rightClickMenu: string;
34
34
  /** pops.panel的select组件 */
35
35
  panelComponents_Select: string;
36
+ /**
37
+ * pops.skeleton
38
+ *
39
+ * 需要设置元素className为`pops-skeleton-item`
40
+ *
41
+ * 支持以下属性
42
+ *
43
+ * + `data-animated`: 加载中的动画
44
+ * + `data-circle`: 圆形
45
+ * + `data-img`: 头像图片,需要在它内部添加图片的svg `PopsIcon.getIcon("picture")`
46
+ */
47
+ skeletonCSS: string;
36
48
  };
@@ -255,6 +255,24 @@ export declare const PopsTooltip: {
255
255
  time: number;
256
256
  callback: (...args: any[]) => IPromise<void>;
257
257
  }[]>;
258
+ getOrInsert: (key: string, defaultValue: {
259
+ type: PopsType;
260
+ time: number;
261
+ callback: (...args: any[]) => IPromise<void>;
262
+ }[]) => {
263
+ type: PopsType;
264
+ time: number;
265
+ callback: (...args: any[]) => IPromise<void>;
266
+ }[];
267
+ getOrInsertComputed: (key: string, callback: (key: string) => {
268
+ type: PopsType;
269
+ time: number;
270
+ callback: (...args: any[]) => IPromise<void>;
271
+ }[]) => {
272
+ type: PopsType;
273
+ time: number;
274
+ callback: (...args: any[]) => IPromise<void>;
275
+ }[];
258
276
  [Symbol.iterator]: () => MapIterator<[string, {
259
277
  type: PopsType;
260
278
  time: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whitesev/pops",
3
- "version": "4.2.3",
3
+ "version": "4.2.4",
4
4
  "description": "弹窗库,包含了alert、confirm、prompt、drawer、folder、loading、iframe、panel、tooltip、searchSuggestion、rightClickMenu组件",
5
5
  "keywords": [
6
6
  "ScriptCat",
@@ -44,27 +44,27 @@
44
44
  "any-touch": "^2.2.0"
45
45
  },
46
46
  "devDependencies": {
47
- "@eslint/js": "^9.39.2",
48
- "@rollup/plugin-commonjs": "^29.0.0",
47
+ "@eslint/js": "^10.0.1",
48
+ "@rollup/plugin-commonjs": "^29.0.2",
49
49
  "@rollup/plugin-json": "^6.1.0",
50
50
  "@rollup/plugin-node-resolve": "^16.0.3",
51
- "@rollup/plugin-terser": "^0.4.4",
51
+ "@rollup/plugin-terser": "^1.0.0",
52
52
  "@rollup/plugin-typescript": "12.3.0",
53
53
  "browserslist": "^4.28.1",
54
- "caniuse-lite": "^1.0.30001770",
55
- "eslint": "^9.39.2",
54
+ "caniuse-lite": "^1.0.30001781",
55
+ "eslint": "^10.1.0",
56
56
  "eslint-config-prettier": "^10.1.8",
57
- "eslint-plugin-compat": "^6.0.2",
58
- "eslint-plugin-prettier": "^5.5.4",
57
+ "eslint-plugin-compat": "^7.0.1",
58
+ "eslint-plugin-prettier": "^5.5.5",
59
59
  "globals": "^16.5.0",
60
- "oxfmt": "^0.37.0",
61
- "oxlint": "1.52.0",
62
- "rollup": "^4.54.0",
60
+ "oxfmt": "^0.42.0",
61
+ "oxlint": "1.57.0",
62
+ "rollup": "^4.60.0",
63
63
  "rollup-plugin-clear": "^2.0.7",
64
- "rollup-plugin-import-css": "^4.1.2",
64
+ "rollup-plugin-import-css": "^4.2.0",
65
65
  "tslib": "^2.8.1",
66
- "typescript": "^5.9.3",
67
- "typescript-eslint": "^8.50.1"
66
+ "typescript": "^6.0.2",
67
+ "typescript-eslint": "^8.57.2"
68
68
  },
69
69
  "scripts": {
70
70
  "lint": "oxlint .",
package/src/PopsCSS.ts CHANGED
@@ -15,6 +15,7 @@ import folderCSS from "./components/folder/index.css";
15
15
  import panelCSS from "./components/panel/index.css";
16
16
  import rightClickMenuCSS from "./components/rightClickMenu/index.css";
17
17
  import panelComponents_Select_CSS from "./components/panel/css/components-select.css";
18
+ import skeletonCSS from "./css/skeleton.css";
18
19
 
19
20
  export const PopsCSS = {
20
21
  /** 主CSS */
@@ -51,4 +52,16 @@ export const PopsCSS = {
51
52
  rightClickMenu: rightClickMenuCSS,
52
53
  /** pops.panel的select组件 */
53
54
  panelComponents_Select: panelComponents_Select_CSS,
55
+ /**
56
+ * pops.skeleton
57
+ *
58
+ * 需要设置元素className为`pops-skeleton-item`
59
+ *
60
+ * 支持以下属性
61
+ *
62
+ * + `data-animated`: 加载中的动画
63
+ * + `data-circle`: 圆形
64
+ * + `data-img`: 头像图片,需要在它内部添加图片的svg `PopsIcon.getIcon("picture")`
65
+ */
66
+ skeletonCSS: skeletonCSS,
54
67
  };
@@ -49,6 +49,10 @@ export const PopsAlert = {
49
49
  name: "common",
50
50
  css: PopsCSS.common,
51
51
  },
52
+ {
53
+ name: "skeleton",
54
+ css: PopsCSS.skeletonCSS,
55
+ },
52
56
  {
53
57
  name: "alertCSS",
54
58
  css: PopsCSS.alertCSS,
@@ -49,6 +49,10 @@ export const PopsConfirm = {
49
49
  name: "common",
50
50
  css: PopsCSS.common,
51
51
  },
52
+ {
53
+ name: "skeleton",
54
+ css: PopsCSS.skeletonCSS,
55
+ },
52
56
  {
53
57
  name: "confirmCSS",
54
58
  css: PopsCSS.confirmCSS,
@@ -49,6 +49,10 @@ export const PopsDrawer = {
49
49
  name: "common",
50
50
  css: PopsCSS.common,
51
51
  },
52
+ {
53
+ name: "skeleton",
54
+ css: PopsCSS.skeletonCSS,
55
+ },
52
56
  {
53
57
  name: "drawerCSS",
54
58
  css: PopsCSS.drawerCSS,
@@ -52,6 +52,10 @@ export const PopsFolder = {
52
52
  name: "common",
53
53
  css: PopsCSS.common,
54
54
  },
55
+ {
56
+ name: "skeleton",
57
+ css: PopsCSS.skeletonCSS,
58
+ },
55
59
  {
56
60
  name: "folderCSS",
57
61
  css: PopsCSS.folderCSS,
@@ -54,6 +54,10 @@ export const PopsIframe = {
54
54
  name: "common",
55
55
  css: PopsCSS.common,
56
56
  },
57
+ {
58
+ name: "skeleton",
59
+ css: PopsCSS.skeletonCSS,
60
+ },
57
61
  {
58
62
  name: "iframeCSS",
59
63
  css: PopsCSS.iframeCSS,
@@ -37,6 +37,7 @@ export const PopsLoading = {
37
37
  <style data-model-name="index">${PopsCSS.index}</style>
38
38
  <style data-model-name="anim">${PopsCSS.anim}</style>
39
39
  <style data-model-name="common">${PopsCSS.common}</style>
40
+ <style data-model-name="skeleton">${PopsCSS.skeletonCSS}</style>
40
41
  `
41
42
  : ""
42
43
  }
@@ -50,6 +50,10 @@ export const PopsPanel = {
50
50
  name: "common",
51
51
  css: PopsCSS.common,
52
52
  },
53
+ {
54
+ name: "skeleton",
55
+ css: PopsCSS.skeletonCSS,
56
+ },
53
57
  {
54
58
  name: "panelCSS",
55
59
  css: PopsCSS.panelCSS,
@@ -49,6 +49,10 @@ export const PopsPrompt = {
49
49
  name: "common",
50
50
  css: PopsCSS.common,
51
51
  },
52
+ {
53
+ name: "skeleton",
54
+ css: PopsCSS.skeletonCSS,
55
+ },
52
56
  {
53
57
  name: "promptCSS",
54
58
  css: PopsCSS.promptCSS,
@@ -45,6 +45,10 @@ export const PopsRightClickMenu = {
45
45
  name: "common",
46
46
  css: PopsCSS.common,
47
47
  },
48
+ {
49
+ name: "skeleton",
50
+ css: PopsCSS.skeletonCSS,
51
+ },
48
52
  {
49
53
  name: "rightClickMenu",
50
54
  css: PopsCSS.rightClickMenu,
@@ -41,6 +41,10 @@ export const PopsSearchSuggestion = {
41
41
  name: "common",
42
42
  css: PopsCSS.common,
43
43
  },
44
+ {
45
+ name: "skeleton",
46
+ css: PopsCSS.skeletonCSS,
47
+ },
44
48
  ]);
45
49
 
46
50
  // 添加自定义style
@@ -591,6 +591,10 @@ export const PopsTooltip = {
591
591
  name: "common",
592
592
  css: PopsCSS.common,
593
593
  },
594
+ {
595
+ name: "skeleton",
596
+ css: PopsCSS.skeletonCSS,
597
+ },
594
598
  {
595
599
  name: "tooltipCSS",
596
600
  css: PopsCSS.tooltipCSS,
@@ -0,0 +1,43 @@
1
+ .pops-skeleton-item {
2
+ --el-skeleton-color: #f0f2f5;
3
+ --el-skeleton-to-color: #e6e8eb;
4
+ width: 100%;
5
+ height: 18px;
6
+ border-radius: 4px;
7
+ background: var(--el-skeleton-color);
8
+ display: inline-block;
9
+ }
10
+ .pops-skeleton-item[data-circle] {
11
+ border-radius: 50%;
12
+ }
13
+ .pops-skeleton-item[data-img] {
14
+ width: unset;
15
+ display: flex;
16
+ align-items: center;
17
+ justify-content: center;
18
+ border-radius: 0px;
19
+ }
20
+ .pops-skeleton-item[data-img] svg {
21
+ color: #dcdfe6;
22
+ fill: currentcolor;
23
+ width: 22%;
24
+ height: 22%;
25
+ }
26
+ .pops-skeleton-item[data-animated] {
27
+ background: linear-gradient(
28
+ 90deg,
29
+ var(--el-skeleton-color) 25%,
30
+ var(--el-skeleton-to-color) 37%,
31
+ var(--el-skeleton-color) 63%
32
+ );
33
+ background-size: 400% 100%;
34
+ animation: pops-el-skeleton-loading 1.4s ease infinite;
35
+ }
36
+ @keyframes pops-el-skeleton-loading {
37
+ 0% {
38
+ background-position: 100% 50%;
39
+ }
40
+ 100% {
41
+ background-position: 0 50%;
42
+ }
43
+ }