@whitesev/pops 2.2.8 → 2.2.9

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 (146) hide show
  1. package/dist/index.amd.js +2815 -3010
  2. package/dist/index.amd.js.map +1 -1
  3. package/dist/index.cjs.js +2815 -3010
  4. package/dist/index.cjs.js.map +1 -1
  5. package/dist/index.esm.js +2815 -3010
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/index.iife.js +2815 -3010
  8. package/dist/index.iife.js.map +1 -1
  9. package/dist/index.system.js +2815 -3010
  10. package/dist/index.system.js.map +1 -1
  11. package/dist/index.umd.js +2815 -3010
  12. package/dist/index.umd.js.map +1 -1
  13. package/dist/types/src/Pops.d.ts +11 -11
  14. package/dist/types/src/PopsIcon.d.ts +2 -2
  15. package/dist/types/src/components/rightClickMenu/index.d.ts +2 -2
  16. package/dist/types/src/components/tooltip/index.d.ts +2 -2
  17. package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +256 -259
  18. package/dist/types/src/types/animation.d.ts +19 -19
  19. package/dist/types/src/types/button.d.ts +187 -196
  20. package/dist/types/src/types/components.d.ts +213 -229
  21. package/dist/types/src/types/event.d.ts +63 -63
  22. package/dist/types/src/types/global.d.ts +20 -20
  23. package/dist/types/src/types/icon.d.ts +32 -32
  24. package/dist/types/src/types/inst.d.ts +24 -24
  25. package/dist/types/src/types/main.d.ts +114 -122
  26. package/dist/types/src/types/mask.d.ts +49 -49
  27. package/dist/types/src/types/position.d.ts +60 -60
  28. package/package.json +61 -56
  29. package/LICENSE +0 -674
  30. package/src/Pops.ts +0 -209
  31. package/src/PopsAnimation.ts +0 -32
  32. package/src/PopsCSS.ts +0 -51
  33. package/src/PopsCore.ts +0 -44
  34. package/src/PopsIcon.ts +0 -95
  35. package/src/PopsInst.ts +0 -21
  36. package/src/components/alert/config.ts +0 -62
  37. package/src/components/alert/index.css +0 -0
  38. package/src/components/alert/index.ts +0 -181
  39. package/src/components/alert/types/index.ts +0 -30
  40. package/src/components/confirm/config.ts +0 -90
  41. package/src/components/confirm/index.css +0 -0
  42. package/src/components/confirm/index.ts +0 -192
  43. package/src/components/confirm/types/index.ts +0 -17
  44. package/src/components/drawer/config.ts +0 -89
  45. package/src/components/drawer/index.css +0 -35
  46. package/src/components/drawer/index.ts +0 -260
  47. package/src/components/drawer/types/index.ts +0 -61
  48. package/src/components/folder/config.ts +0 -147
  49. package/src/components/folder/folderIcon.ts +0 -28
  50. package/src/components/folder/index.css +0 -314
  51. package/src/components/folder/index.ts +0 -1050
  52. package/src/components/folder/types/index.ts +0 -101
  53. package/src/components/iframe/config.ts +0 -60
  54. package/src/components/iframe/index.css +0 -75
  55. package/src/components/iframe/index.ts +0 -351
  56. package/src/components/iframe/types/index.ts +0 -146
  57. package/src/components/loading/config.ts +0 -29
  58. package/src/components/loading/index.css +0 -66
  59. package/src/components/loading/index.ts +0 -114
  60. package/src/components/loading/types/index.ts +0 -40
  61. package/src/components/panel/config.ts +0 -550
  62. package/src/components/panel/handlerComponents.ts +0 -3277
  63. package/src/components/panel/index.css +0 -1292
  64. package/src/components/panel/index.ts +0 -213
  65. package/src/components/panel/types/components-button.ts +0 -69
  66. package/src/components/panel/types/components-common.ts +0 -55
  67. package/src/components/panel/types/components-deepMenu.ts +0 -85
  68. package/src/components/panel/types/components-forms.ts +0 -45
  69. package/src/components/panel/types/components-input.ts +0 -82
  70. package/src/components/panel/types/components-own.ts +0 -31
  71. package/src/components/panel/types/components-select.ts +0 -101
  72. package/src/components/panel/types/components-selectMultiple.ts +0 -133
  73. package/src/components/panel/types/components-slider.ts +0 -78
  74. package/src/components/panel/types/components-switch.ts +0 -57
  75. package/src/components/panel/types/components-textarea.ts +0 -69
  76. package/src/components/panel/types/index.ts +0 -177
  77. package/src/components/prompt/config.ts +0 -94
  78. package/src/components/prompt/index.css +0 -34
  79. package/src/components/prompt/index.ts +0 -222
  80. package/src/components/prompt/types/index.ts +0 -55
  81. package/src/components/rightClickMenu/config.ts +0 -130
  82. package/src/components/rightClickMenu/index.css +0 -88
  83. package/src/components/rightClickMenu/index.ts +0 -689
  84. package/src/components/rightClickMenu/types/index.ts +0 -91
  85. package/src/components/searchSuggestion/config.ts +0 -59
  86. package/src/components/searchSuggestion/index.ts +0 -708
  87. package/src/components/searchSuggestion/types/index.ts +0 -147
  88. package/src/components/tooltip/config.ts +0 -34
  89. package/src/components/tooltip/index.css +0 -196
  90. package/src/components/tooltip/index.ts +0 -655
  91. package/src/components/tooltip/types/index.ts +0 -125
  92. package/src/config/CommonCSSClassName.ts +0 -17
  93. package/src/config/GlobalConfig.ts +0 -80
  94. package/src/css/animation.css +0 -2245
  95. package/src/css/button.css +0 -542
  96. package/src/css/common.css +0 -52
  97. package/src/css/index.css +0 -254
  98. package/src/css/ninePalaceGridPosition.css +0 -50
  99. package/src/css/scrollbar.css +0 -22
  100. package/src/handler/PopsElementHandler.ts +0 -325
  101. package/src/handler/PopsHandler.ts +0 -719
  102. package/src/svg/arrowLeft.svg +0 -4
  103. package/src/svg/arrowRight.svg +0 -4
  104. package/src/svg/chromeFilled.svg +0 -14
  105. package/src/svg/circleClose.svg +0 -8
  106. package/src/svg/close.svg +0 -5
  107. package/src/svg/cpu.svg +0 -8
  108. package/src/svg/delete.svg +0 -5
  109. package/src/svg/documentCopy.svg +0 -5
  110. package/src/svg/edit.svg +0 -8
  111. package/src/svg/eleme.svg +0 -5
  112. package/src/svg/elemePlus.svg +0 -5
  113. package/src/svg/headset.svg +0 -5
  114. package/src/svg/hide.svg +0 -8
  115. package/src/svg/keyboard.svg +0 -8
  116. package/src/svg/loading.svg +0 -5
  117. package/src/svg/max.svg +0 -5
  118. package/src/svg/min.svg +0 -5
  119. package/src/svg/mise.svg +0 -5
  120. package/src/svg/monitor.svg +0 -5
  121. package/src/svg/next.svg +0 -5
  122. package/src/svg/picture.svg +0 -8
  123. package/src/svg/prev.svg +0 -5
  124. package/src/svg/search.svg +0 -5
  125. package/src/svg/share.svg +0 -5
  126. package/src/svg/upload.svg +0 -5
  127. package/src/svg/videoPause.svg +0 -5
  128. package/src/svg/videoPlay.svg +0 -5
  129. package/src/svg/view.svg +0 -5
  130. package/src/types/PopsDOMUtilsEventType.d.ts +0 -259
  131. package/src/types/animation.d.ts +0 -19
  132. package/src/types/button.d.ts +0 -196
  133. package/src/types/components.d.ts +0 -229
  134. package/src/types/event.d.ts +0 -63
  135. package/src/types/global.d.ts +0 -20
  136. package/src/types/icon.d.ts +0 -32
  137. package/src/types/inst.d.ts +0 -24
  138. package/src/types/main.d.ts +0 -122
  139. package/src/types/mask.d.ts +0 -49
  140. package/src/types/position.d.ts +0 -60
  141. package/src/utils/PopsDOMUtils.ts +0 -2649
  142. package/src/utils/PopsDOMUtilsEventsConfig.ts +0 -6
  143. package/src/utils/PopsInstanceUtils.ts +0 -801
  144. package/src/utils/PopsMathUtils.ts +0 -77
  145. package/src/utils/PopsSafeUtils.ts +0 -24
  146. package/src/utils/PopsUtils.ts +0 -430
@@ -1,125 +0,0 @@
1
- import type { PopsCommonConfig } from "../../../types/components";
2
-
3
- /** tooltip的出现位置 */
4
- export type PopsTooltipPosition =
5
- | "top"
6
- | "right"
7
- | "bottom"
8
- | "left"
9
- | "follow";
10
-
11
- /**
12
- * pops.tooltip
13
- */
14
- export interface PopsToolTipDetails
15
- extends Pick<
16
- PopsCommonConfig,
17
- "useShadowRoot" | "only" | "zIndex" | "style" | "beforeAppendToPageCallBack"
18
- > {
19
- /**
20
- * 目标元素
21
- */
22
- target: HTMLElement;
23
- /**
24
- * 显示的文字
25
- */
26
- content: string | (() => string);
27
- /**
28
- * 是否比较获取到的content的内容是否改变
29
- *
30
- * 如果未改变,则在触发.show时不修改内容
31
- * @default false
32
- */
33
- isDiffContent?: boolean;
34
- /**
35
- * 位置
36
- * + `follow` 跟随鼠标|触摸位置移动
37
- * @default "top"
38
- */
39
- position?: PopsTooltipPosition;
40
- /**
41
- * 自定义className
42
- *
43
- * + `github-tooltip` github的样式
44
- * @default ""
45
- */
46
- className?: string;
47
- /**
48
- * 是否使用fixed定位,false则是absolute定位
49
- *
50
- * @default false
51
- */
52
- isFixed?: boolean;
53
- /**
54
- * 是否总是显示,默认为false
55
- * + true 设置的triggerShowEventName、triggerCloseEventName将无效
56
- * 返回提供show和close函数,取消on和off
57
- * + false 事件触发才显示
58
- */
59
- alwaysShow?: boolean;
60
- /**
61
- * 延迟xxms关闭tooltip
62
- * @default 100
63
- */
64
- delayCloseTime?: number;
65
- /**
66
- * 触发显示事件的名称,默认mouseenter touchstart,如果是多个事件,按空格分割
67
- * @default "mouseenter touchstart"
68
- */
69
- triggerShowEventName?: string;
70
- /**
71
- * 触发关闭事件的名称,默认mouseleave touchend,如果是多个事件,按空格分割
72
- * @default "mouseleave touchend"
73
- */
74
- triggerCloseEventName?: string;
75
- /**
76
- * 监听的事件配置
77
- */
78
- eventOption?: {
79
- [P in keyof AddEventListenerOptions]: AddEventListenerOptions[P];
80
- };
81
- /**
82
- * 触发显示前的回调
83
- * @returns
84
- * + false 可阻止显示
85
- */
86
- showBeforeCallBack?: ($toolTip: HTMLElement) => false | void;
87
- /**
88
- * 触发显示后的回调
89
- */
90
- showAfterCallBack?: ($toolTip: HTMLElement) => void;
91
- /**
92
- * 触发关闭前的回调
93
- */
94
- closeBeforeCallBack?: (
95
- /**
96
- *
97
- * @returns
98
- * + false 可阻止关闭
99
- */
100
- $toolTip: HTMLElement
101
- ) => false | void;
102
- /**
103
- * 触发关闭后的回调
104
- */
105
- closeAfterCallBack?: ($toolTip: HTMLElement) => void;
106
- /**
107
- * 是否显示箭头
108
- * @default true
109
- */
110
- showArrow?: boolean;
111
- /**
112
- * 箭头与目标的的距离(px)
113
- *
114
- * @default 12.5
115
- */
116
- arrowDistance?: number;
117
- /**
118
- * 其它的距离(px)
119
- * + 当position为left或者right,这个距离是上、下距离
120
- * + 当position为top或者bottom,这个距离是左、右距离
121
- * + 当position为follow,这个距离是上、左距离
122
- * @default 0
123
- */
124
- otherDistance?: number;
125
- }
@@ -1,17 +0,0 @@
1
- /**
2
- * 通用的CSS类名
3
- */
4
- export const PopsCommonCSSClassName = {
5
- flexCenter: "pops-flex-items-center",
6
- flexYCenter: "pops-flex-y-center",
7
- flexXCenter: "pops-flex-x-center",
8
- hide: "pops-hide",
9
- hideImportant: "pops-hide-important",
10
- noBorder: "pops-no-border",
11
- noBorderImportant: "pops-no-border-important",
12
- userSelectNone: "pops-user-select-none",
13
- lineHeightCenter: "pops-line-height-center",
14
- widthFill: "pops-width-fill",
15
- textIsDisabled: "pops-text-is-disabled",
16
- textIsDisabledImportant: "pops-text-is-disabled-important",
17
- };
@@ -1,80 +0,0 @@
1
- import type { PopsCommonConfig, PopsDragConfig } from "../types/components";
2
-
3
- type EnterReturnType<T> = null | T | (() => T);
4
-
5
- type GlobalConfigOption = {
6
- style?: EnterReturnType<string>;
7
- zIndex?: EnterReturnType<number> | EnterReturnType<string>;
8
- } & Partial<PopsCommonConfig> &
9
- Partial<PopsDragConfig>;
10
-
11
- type ResultGlobalConfigOption<T> = T extends null | undefined
12
- ? never
13
- : T extends (...args: any) => infer R
14
- ? R
15
- : T;
16
-
17
- export const GlobalConfig = {
18
- config: {} as GlobalConfigOption,
19
- /**
20
- * 为所有弹窗设置全局属性
21
- */
22
- setGlobalConfig(config: GlobalConfigOption) {
23
- Reflect.ownKeys(config).forEach((keyName) => {
24
- Reflect.set(GlobalConfig.config, keyName, Reflect.get(config, keyName));
25
- });
26
- },
27
- /**
28
- * 获取全局配置
29
- */
30
- getGlobalConfig() {
31
- let result: {
32
- [P in keyof GlobalConfigOption]: ResultGlobalConfigOption<
33
- GlobalConfigOption[P]
34
- >;
35
- } = {};
36
- Object.keys(GlobalConfig.config).forEach((keyName) => {
37
- let configValue = Reflect.get(GlobalConfig.config, keyName);
38
- if (keyName === "style") {
39
- // 设置style属性
40
- let style =
41
- configValue == null
42
- ? ""
43
- : typeof configValue === "function"
44
- ? configValue()
45
- : configValue;
46
-
47
- if (typeof style === "string") {
48
- result.style = style;
49
- }
50
- } else if (keyName === "zIndex") {
51
- // 设置zIndex属性
52
- let zIndex =
53
- configValue == null
54
- ? ""
55
- : typeof configValue === "function"
56
- ? configValue()
57
- : configValue;
58
- if (typeof zIndex === "string") {
59
- let newIndex = (zIndex = Number(zIndex));
60
- if (!isNaN(newIndex)) {
61
- result.zIndex = newIndex;
62
- }
63
- } else {
64
- if (!isNaN(zIndex)) {
65
- result.zIndex = zIndex;
66
- }
67
- }
68
- } else if (keyName === "mask") {
69
- let mask =
70
- GlobalConfig.config.mask == null ? {} : GlobalConfig.config.mask;
71
- if (typeof mask === "object" && mask != null) {
72
- result.mask = mask;
73
- }
74
- } else {
75
- Reflect.set(result, keyName, configValue);
76
- }
77
- });
78
- return result;
79
- },
80
- };