@whitesev/pops 2.2.8 → 2.3.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.
Files changed (146) hide show
  1. package/dist/index.amd.js +2817 -3012
  2. package/dist/index.amd.js.map +1 -1
  3. package/dist/index.cjs.js +2817 -3012
  4. package/dist/index.cjs.js.map +1 -1
  5. package/dist/index.esm.js +2817 -3012
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/index.iife.js +2817 -3012
  8. package/dist/index.iife.js.map +1 -1
  9. package/dist/index.system.js +2817 -3012
  10. package/dist/index.system.js.map +1 -1
  11. package/dist/index.umd.js +2817 -3012
  12. package/dist/index.umd.js.map +1 -1
  13. package/dist/types/src/Pops.d.ts +497 -192
  14. package/dist/types/src/PopsIcon.d.ts +2 -2
  15. package/dist/types/src/components/panel/index.d.ts +1 -1
  16. package/dist/types/src/components/rightClickMenu/index.d.ts +487 -182
  17. package/dist/types/src/components/tooltip/index.d.ts +2 -2
  18. package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +256 -259
  19. package/dist/types/src/types/animation.d.ts +19 -19
  20. package/dist/types/src/types/button.d.ts +187 -196
  21. package/dist/types/src/types/components.d.ts +213 -229
  22. package/dist/types/src/types/event.d.ts +63 -63
  23. package/dist/types/src/types/global.d.ts +20 -20
  24. package/dist/types/src/types/icon.d.ts +32 -32
  25. package/dist/types/src/types/inst.d.ts +24 -24
  26. package/dist/types/src/types/main.d.ts +114 -122
  27. package/dist/types/src/types/mask.d.ts +49 -49
  28. package/dist/types/src/types/position.d.ts +60 -60
  29. package/package.json +13 -8
  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,147 +0,0 @@
1
- import type { PopsCommonConfig } from "../../../types/components";
2
-
3
- /**
4
- * 搜索建议悬浮窗
5
- * pops.searchSuggestion
6
- */
7
- export interface PopsSearchSuggestionDetails<T = any>
8
- extends Pick<PopsCommonConfig, "useShadowRoot" | "zIndex" | "style"> {
9
- /**
10
- * 当前的环境,可以是document,可以是shadowroot,默认是document
11
- * @default document
12
- */
13
- selfDocument?: Document | ShadowRoot | (Document | ShadowRoot)[];
14
- /**
15
- * 目标元素,一般是跟随它的位置变化,监听它的focus/click
16
- */
17
- target: HTMLElement;
18
- /**
19
- * 目标input元素,监听它的focus/click/input事件
20
- */
21
- inputTarget?: HTMLInputElement | HTMLTextAreaElement;
22
- /**
23
- * 数据
24
- */
25
- data: T[] | (() => T[]);
26
- /**
27
- * 右边的删除按钮图标
28
- */
29
- deleteIcon?: {
30
- /**
31
- * 是否启用
32
- * @default true
33
- */
34
- enable?: boolean;
35
- /**
36
- * 点击回调
37
- */
38
- callback?: (
39
- event: MouseEvent | PointerEvent,
40
- liElement: HTMLLIElement,
41
- data: T
42
- ) => void;
43
- };
44
- /**
45
- * 自定义的className
46
- */
47
- className?: string;
48
- /**
49
- * position是否使用absolut,否则是relative
50
- * @default true
51
- */
52
- isAbsolute?: boolean;
53
- /**
54
- * 是否启用动画
55
- * @default true
56
- */
57
- isAnimation?: boolean;
58
- /**
59
- * 建议框的宽度
60
- * @default "250px"
61
- */
62
- width?: string;
63
- /**
64
- * 是否和config.target的宽度同步
65
- * @default true
66
- */
67
- followTargetWidth?: true;
68
- /**
69
- * 建议框的最大高度
70
- * @default "300px"
71
- */
72
- maxHeight?: string;
73
- /**
74
- * 建议框距离元素的距离
75
- * @default 0
76
- */
77
- topDistance?: number;
78
- /**
79
- * 建议框显示的位置,默认是auto(自动判断位置)
80
- * @default "auto"
81
- */
82
- position?: "top" | "bottom" | "auto";
83
- /**
84
- * 当位置在上面时(包括auto自动判断在上面时),是否对搜索项进行反转
85
- * @default true
86
- */
87
- positionTopToReverse?: boolean;
88
- /**
89
- * 搜索中的提示
90
- *
91
- * 前提:inputTarget是input/textarea
92
- *
93
- * 触发change事件,且没有搜索到数据,则显示此提示
94
- */
95
- searchingTip?: string;
96
- /**
97
- * 没有搜索结果的提示的html
98
- *
99
- * 前提:inputTarget是input/textarea
100
- *
101
- * 触发change事件,且没有搜索到数据,则显示此结果项
102
- */
103
- toSearhNotResultHTML?: string;
104
- /**
105
- * 没有搜索结果是否隐藏提示框
106
- * @default false
107
- */
108
- toHideWithNotResult?: boolean;
109
- /**
110
- * 跟随目标的位置
111
- * @default "target"
112
- */
113
- followPosition?: "target" | "input" | "inputCursor";
114
- /**
115
- * 获取每一项的html,在显示的时候会调用该函数
116
- *
117
- * 它的父元素是一个<li>标签
118
- */
119
- getItemHTML: (item: T) => string;
120
- /**
121
- * 当config.target触发input时自动调用该函数来获取数据
122
- * @param inputValue 当前输入框的值
123
- */
124
- getData?: (inputValue: string) => Promise<T[]> | T[];
125
- /**
126
- * 每一项的点击回调
127
- * @param event 触发的事件
128
- * @param liElement 每一项的元素
129
- * @param data config.data的数据
130
- */
131
- itemClickCallBack?: (
132
- event: MouseEvent | PointerEvent,
133
- liElement: HTMLLIElement,
134
- data: T
135
- ) => void;
136
- /**
137
- * 键盘的上下键选择的回调
138
- * @param event 触发的事件
139
- * @param liElement 每一项的元素
140
- * @param data config.data的数据
141
- */
142
- selectCallBack?: (
143
- event: MouseEvent,
144
- liElement: HTMLLIElement,
145
- data: T
146
- ) => void;
147
- }
@@ -1,34 +0,0 @@
1
- import type { PopsToolTipDetails } from "./types/index";
2
-
3
- export const PopsTooltipConfig = (): DeepRequired<PopsToolTipDetails> => {
4
- // @ts-ignore
5
- return {
6
- useShadowRoot: true,
7
- target: null as any,
8
- content: "默认文字",
9
- isDiffContent: false,
10
- position: "top",
11
- className: "",
12
- isFixed: false,
13
- alwaysShow: false,
14
- triggerShowEventName: "mouseenter touchstart",
15
- triggerCloseEventName: "mouseleave touchend",
16
- zIndex: 10000,
17
- only: false,
18
- eventOption: {
19
- passive: false,
20
- capture: true,
21
- once: false,
22
- },
23
- showBeforeCallBack() {},
24
- showAfterCallBack() {},
25
- closeBeforeCallBack() {},
26
- closeAfterCallBack() {},
27
- delayCloseTime: 100,
28
- showArrow: true,
29
- arrowDistance: 12.5,
30
- otherDistance: 0,
31
- style: "",
32
- beforeAppendToPageCallBack() {},
33
- } as Required<PopsToolTipDetails>;
34
- };
@@ -1,196 +0,0 @@
1
- .pops-tip {
2
- --pops-bg-opacity: 1;
3
- --tooltip-color: #4e4e4e;
4
- --tooltip-bg-color: rgb(255, 255, 255, var(--pops-bg-opacity));
5
- --tooltip-bd-radius: 2px;
6
- --tooltip-box-shadow-left-color: rgba(0, 0, 0, 0.24);
7
- --tooltip-box-shadow-right-color: rgba(0, 0, 0, 0.12);
8
- --tooltip-font-size: 14px;
9
- --tooltip-padding-top: 13px;
10
- --tooltip-padding-right: 13px;
11
- --tooltip-padding-bottom: 13px;
12
- --tooltip-padding-left: 13px;
13
-
14
- --tooltip-arrow-box-shadow-left-color: rgba(0, 0, 0, 0.24);
15
- --tooltip-arrow-box-shadow-right-color: rgba(0, 0, 0, 0.12);
16
- --tooltip-arrow--after-color: rgb(78, 78, 78);
17
- --tooltip-arrow--after-bg-color: rgb(255, 255, 255, var(--pops-bg-opacity));
18
- --tooltip-arrow--after-width: 12px;
19
- --tooltip-arrow--after-height: 12px;
20
- }
21
- .pops-tip {
22
- padding: var(--tooltip-padding-top) var(--tooltip-padding-right)
23
- var(--tooltip-padding-bottom) var(--tooltip-padding-left);
24
- max-width: 400px;
25
- max-height: 300px;
26
- border-radius: var(--tooltip-bd-radius);
27
- background-color: var(--tooltip-bg-color);
28
- box-shadow: 0 1.5px 4px var(--tooltip-box-shadow-left-color),
29
- 0 1.5px 6px var(--tooltip-box-shadow-right-color);
30
- color: var(--tooltip-color);
31
- font-size: var(--tooltip-font-size);
32
- }
33
- .pops-tip[data-position="absolute"] {
34
- position: absolute;
35
- }
36
- .pops-tip[data-position="fixed"] {
37
- position: fixed;
38
- }
39
-
40
- .pops-tip .pops-tip-arrow {
41
- position: absolute;
42
- top: 100%;
43
- left: 50%;
44
- overflow: hidden;
45
- width: 100%;
46
- height: 12.5px;
47
- transform: translateX(-50%);
48
- }
49
-
50
- .pops-tip .pops-tip-arrow::after {
51
- position: absolute;
52
- top: 0;
53
- left: 50%;
54
- width: var(--tooltip-arrow--after-width);
55
- height: var(--tooltip-arrow--after-height);
56
- background: var(--tooltip-arrow--after-bg-color);
57
- color: var(--tooltip-arrow--after-color);
58
- box-shadow: 0 1px 7px var(--tooltip-arrow-box-shadow-left-color),
59
- 0 1px 7px var(--tooltip-arrow-box-shadow-right-color);
60
- content: "";
61
- transform: translateX(-50%) translateY(-50%) rotate(45deg);
62
- }
63
-
64
- .pops-tip .pops-tip-arrow[data-position="bottom"] {
65
- position: absolute;
66
- top: 100%;
67
- left: 50%;
68
- overflow: hidden;
69
- width: 100%;
70
- height: 12.5px;
71
- transform: translateX(-50%);
72
- }
73
-
74
- .pops-tip .pops-tip-arrow[data-position="bottom"]:after {
75
- position: absolute;
76
- top: 0;
77
- left: 50%;
78
- width: var(--tooltip-arrow--after-width);
79
- height: var(--tooltip-arrow--after-height);
80
- background: var(--tooltip-arrow--after-bg-color);
81
- box-shadow: 0 1px 7px var(--tooltip-arrow-box-shadow-left-color),
82
- 0 1px 7px var(--tooltip-arrow-box-shadow-right-color);
83
- content: "";
84
- transform: translateX(-50%) translateY(-50%) rotate(45deg);
85
- }
86
-
87
- .pops-tip .pops-tip-arrow[data-position="left"] {
88
- top: 50%;
89
- left: -12.5px;
90
- width: 12.5px;
91
- height: 50px;
92
- transform: translateY(-50%);
93
- }
94
-
95
- .pops-tip .pops-tip-arrow[data-position="left"]:after {
96
- position: absolute;
97
- top: 50%;
98
- left: 100%;
99
- content: "";
100
- }
101
-
102
- .pops-tip .pops-tip-arrow[data-position="right"] {
103
- top: 50%;
104
- right: -12.5px;
105
- left: auto;
106
- width: 12.5px;
107
- height: 50px;
108
- transform: translateY(-50%);
109
- }
110
-
111
- .pops-tip .pops-tip-arrow[data-position="right"]:after {
112
- position: absolute;
113
- top: 50%;
114
- left: 0;
115
- content: "";
116
- }
117
-
118
- .pops-tip .pops-tip-arrow[data-position="top"] {
119
- top: -12.5px;
120
- left: 50%;
121
- transform: translateX(-50%);
122
- }
123
-
124
- .pops-tip .pops-tip-arrow[data-position="top"]:after {
125
- position: absolute;
126
- top: 100%;
127
- left: 50%;
128
- content: "";
129
- }
130
-
131
- .pops-tip[data-motion] {
132
- -webkit-animation-duration: 0.25s;
133
- animation-duration: 0.25s;
134
- -webkit-animation-fill-mode: forwards;
135
- animation-fill-mode: forwards;
136
- }
137
- .pops-tip[data-motion="fadeOutRight"] {
138
- -webkit-animation-name: pops-motion-fadeOutRight;
139
- animation-name: pops-motion-fadeOutRight;
140
- }
141
- .pops-tip[data-motion="fadeInTop"] {
142
- -webkit-animation-name: pops-motion-fadeInTop;
143
- animation-name: pops-motion-fadeInTop;
144
- animation-timing-function: cubic-bezier(0.49, 0.49, 0.13, 1.3);
145
- }
146
- .pops-tip[data-motion="fadeOutTop"] {
147
- -webkit-animation-name: pops-motion-fadeOutTop;
148
- animation-name: pops-motion-fadeOutTop;
149
- animation-timing-function: cubic-bezier(0.32, 0.37, 0.06, 0.87);
150
- }
151
- .pops-tip[data-motion="fadeInBottom"] {
152
- -webkit-animation-name: pops-motion-fadeInBottom;
153
- animation-name: pops-motion-fadeInBottom;
154
- }
155
- .pops-tip[data-motion="fadeOutBottom"] {
156
- -webkit-animation-name: pops-motion-fadeOutBottom;
157
- animation-name: pops-motion-fadeOutBottom;
158
- }
159
- .pops-tip[data-motion="fadeInLeft"] {
160
- -webkit-animation-name: pops-motion-fadeInLeft;
161
- animation-name: pops-motion-fadeInLeft;
162
- }
163
- .pops-tip[data-motion="fadeOutLeft"] {
164
- -webkit-animation-name: pops-motion-fadeOutLeft;
165
- animation-name: pops-motion-fadeOutLeft;
166
- }
167
- .pops-tip[data-motion="fadeInRight"] {
168
- -webkit-animation-name: pops-motion-fadeInRight;
169
- animation-name: pops-motion-fadeInRight;
170
- }
171
-
172
- /* github的样式 */
173
- .pops-tip.github-tooltip {
174
- --tooltip-bg-opacity: 1;
175
- --tooltip-color: #ffffff;
176
- --tooltip-bg-color: rgb(36, 41, 47, var(--tooltip-bg-opacity));
177
- --tooltip-bd-radius: 6px;
178
- --tooltip-padding-top: 6px;
179
- --tooltip-padding-right: 8px;
180
- --tooltip-padding-bottom: 6px;
181
- --tooltip-padding-left: 8px;
182
-
183
- --tooltip-arrow--after-color: rgb(255, 255, 255);
184
- --tooltip-arrow--after-bg-color: rgb(36, 41, 47, var(--tooltip-bg-opacity));
185
- --tooltip-arrow--after-width: 8px;
186
- --tooltip-arrow--after-height: 8px;
187
- }
188
-
189
- @media (prefers-color-scheme: dark) {
190
- .pops-tip {
191
- --tooltip-color: #ffffff;
192
- --tooltip-bg-color: #fafafa;
193
- --tooltip-arrow--after-color: #fafafa;
194
- --tooltip-arrow--after-bg-color: rgb(250, 250, 250, var(--pops-bg-opacity));
195
- }
196
- }