@whitesev/pops 2.6.0 → 3.0.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 (184) hide show
  1. package/dist/index.amd.js +1233 -1092
  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 +1233 -1092
  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 +1233 -1092
  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 +1233 -1092
  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 +1233 -1092
  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 +1233 -1092
  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/eslint.config.d.mts +2 -0
  26. package/dist/types/src/Pops.d.ts +98 -103
  27. package/dist/types/src/PopsInst.d.ts +2 -2
  28. package/dist/types/src/components/alert/defaultConfig.d.ts +2 -0
  29. package/dist/types/src/components/alert/index.d.ts +2 -2
  30. package/dist/types/src/components/alert/types/index.d.ts +4 -4
  31. package/dist/types/src/components/confirm/defaultConfig.d.ts +2 -0
  32. package/dist/types/src/components/confirm/index.d.ts +2 -2
  33. package/dist/types/src/components/confirm/types/index.d.ts +2 -2
  34. package/dist/types/src/components/drawer/defaultConfig.d.ts +2 -0
  35. package/dist/types/src/components/drawer/index.d.ts +2 -2
  36. package/dist/types/src/components/drawer/types/index.d.ts +2 -2
  37. package/dist/types/src/components/folder/defaultConfig.d.ts +2 -0
  38. package/dist/types/src/components/folder/index.d.ts +2 -2
  39. package/dist/types/src/components/folder/types/index.d.ts +31 -7
  40. package/dist/types/src/components/iframe/defaultConfig.d.ts +2 -0
  41. package/dist/types/src/components/iframe/index.d.ts +2 -5
  42. package/dist/types/src/components/iframe/types/index.d.ts +13 -42
  43. package/dist/types/src/components/loading/defaultConfig.d.ts +2 -0
  44. package/dist/types/src/components/loading/index.d.ts +2 -2
  45. package/dist/types/src/components/loading/types/index.d.ts +4 -4
  46. package/dist/types/src/components/panel/defaultConfig.d.ts +2 -0
  47. package/dist/types/src/components/panel/handlerComponents.d.ts +47 -43
  48. package/dist/types/src/components/panel/index.d.ts +3 -3
  49. package/dist/types/src/components/panel/types/components-button.d.ts +7 -6
  50. package/dist/types/src/components/panel/types/components-common.d.ts +7 -7
  51. package/dist/types/src/components/panel/types/components-container.d.ts +24 -0
  52. package/dist/types/src/components/panel/types/components-deepMenu.d.ts +13 -13
  53. package/dist/types/src/components/panel/types/components-input.d.ts +6 -6
  54. package/dist/types/src/components/panel/types/components-own.d.ts +2 -2
  55. package/dist/types/src/components/panel/types/components-select.d.ts +9 -9
  56. package/dist/types/src/components/panel/types/components-selectMultiple.d.ts +8 -8
  57. package/dist/types/src/components/panel/types/components-slider.d.ts +7 -7
  58. package/dist/types/src/components/panel/types/components-switch.d.ts +6 -6
  59. package/dist/types/src/components/panel/types/components-textarea.d.ts +6 -6
  60. package/dist/types/src/components/panel/types/index.d.ts +36 -28
  61. package/dist/types/src/components/prompt/defaultConfig.d.ts +2 -0
  62. package/dist/types/src/components/prompt/index.d.ts +2 -2
  63. package/dist/types/src/components/prompt/types/index.d.ts +4 -3
  64. package/dist/types/src/components/rightClickMenu/defaultConfig.d.ts +2 -0
  65. package/dist/types/src/components/rightClickMenu/index.d.ts +29 -27
  66. package/dist/types/src/components/rightClickMenu/types/index.d.ts +32 -11
  67. package/dist/types/src/components/searchSuggestion/defaultConfig.d.ts +2 -0
  68. package/dist/types/src/components/searchSuggestion/index.d.ts +21 -6
  69. package/dist/types/src/components/searchSuggestion/types/index.d.ts +15 -13
  70. package/dist/types/src/components/tooltip/defaultConfig.d.ts +2 -0
  71. package/dist/types/src/components/tooltip/index.d.ts +6 -21
  72. package/dist/types/src/components/tooltip/types/index.d.ts +8 -6
  73. package/dist/types/src/config/GlobalConfig.d.ts +3 -3
  74. package/dist/types/src/handler/PopsElementHandler.d.ts +6 -6
  75. package/dist/types/src/handler/PopsHandler.d.ts +18 -18
  76. package/dist/types/src/types/button.d.ts +4 -97
  77. package/dist/types/src/types/components.d.ts +8 -8
  78. package/dist/types/src/types/event.d.ts +0 -30
  79. package/dist/types/src/types/global.d.ts +2 -0
  80. package/dist/types/src/types/inst.d.ts +5 -5
  81. package/dist/types/src/types/main.d.ts +35 -80
  82. package/dist/types/src/types/mask.d.ts +18 -15
  83. package/dist/types/src/utils/PopsInstanceUtils.d.ts +15 -15
  84. package/dist/types/src/utils/PopsUtils.d.ts +4 -0
  85. package/package.json +10 -10
  86. package/src/Pops.ts +44 -44
  87. package/src/PopsAnimation.ts +1 -1
  88. package/src/PopsInst.ts +2 -2
  89. package/src/components/alert/{config.ts → defaultConfig.ts} +7 -7
  90. package/src/components/alert/index.ts +16 -18
  91. package/src/components/alert/types/index.ts +4 -4
  92. package/src/components/confirm/{config.ts → defaultConfig.ts} +11 -11
  93. package/src/components/confirm/index.ts +11 -13
  94. package/src/components/confirm/types/index.ts +3 -3
  95. package/src/components/drawer/{config.ts → defaultConfig.ts} +10 -10
  96. package/src/components/drawer/index.ts +18 -17
  97. package/src/components/drawer/types/index.ts +3 -3
  98. package/src/components/folder/{config.ts → defaultConfig.ts} +22 -18
  99. package/src/components/folder/index.ts +61 -60
  100. package/src/components/folder/types/index.ts +31 -18
  101. package/src/components/iframe/{config.ts → defaultConfig.ts} +2 -2
  102. package/src/components/iframe/index.ts +24 -29
  103. package/src/components/iframe/types/index.ts +13 -56
  104. package/src/components/loading/{config.ts → defaultConfig.ts} +3 -3
  105. package/src/components/loading/index.ts +13 -11
  106. package/src/components/loading/types/index.ts +5 -5
  107. package/src/components/panel/{config.ts → defaultConfig.ts} +115 -37
  108. package/src/components/panel/handlerComponents.ts +446 -428
  109. package/src/components/panel/index.css +11 -3
  110. package/src/components/panel/index.ts +15 -28
  111. package/src/components/panel/types/components-button.ts +7 -6
  112. package/src/components/panel/types/components-common.ts +7 -7
  113. package/src/components/panel/types/components-container.ts +25 -0
  114. package/src/components/panel/types/components-deepMenu.ts +13 -13
  115. package/src/components/panel/types/components-input.ts +6 -6
  116. package/src/components/panel/types/components-own.ts +2 -2
  117. package/src/components/panel/types/components-select.ts +11 -11
  118. package/src/components/panel/types/components-selectMultiple.ts +8 -9
  119. package/src/components/panel/types/components-slider.ts +7 -7
  120. package/src/components/panel/types/components-switch.ts +6 -6
  121. package/src/components/panel/types/components-textarea.ts +6 -6
  122. package/src/components/panel/types/index.ts +45 -38
  123. package/src/components/prompt/{config.ts → defaultConfig.ts} +10 -10
  124. package/src/components/prompt/index.ts +13 -15
  125. package/src/components/prompt/types/index.ts +4 -3
  126. package/src/components/rightClickMenu/{config.ts → defaultConfig.ts} +20 -19
  127. package/src/components/rightClickMenu/index.ts +125 -108
  128. package/src/components/rightClickMenu/types/index.ts +36 -14
  129. package/src/components/searchSuggestion/{config.ts → defaultConfig.ts} +18 -11
  130. package/src/components/searchSuggestion/index.ts +116 -96
  131. package/src/components/searchSuggestion/types/index.ts +17 -15
  132. package/src/components/tooltip/{config.ts → defaultConfig.ts} +5 -6
  133. package/src/components/tooltip/index.ts +21 -21
  134. package/src/components/tooltip/types/index.ts +9 -7
  135. package/src/config/GlobalConfig.ts +2 -2
  136. package/src/css/common.css +6 -0
  137. package/src/handler/PopsElementHandler.ts +29 -30
  138. package/src/handler/PopsHandler.ts +43 -43
  139. package/src/svg/cpu.svg +7 -7
  140. package/src/svg/delete.svg +4 -4
  141. package/src/svg/documentCopy.svg +4 -4
  142. package/src/svg/edit.svg +7 -7
  143. package/src/svg/eleme.svg +4 -4
  144. package/src/svg/elemePlus.svg +4 -4
  145. package/src/svg/headset.svg +4 -4
  146. package/src/svg/hide.svg +7 -7
  147. package/src/svg/keyboard.svg +7 -7
  148. package/src/svg/loading.svg +4 -4
  149. package/src/svg/max.svg +4 -4
  150. package/src/svg/min.svg +2 -4
  151. package/src/svg/mise.svg +4 -4
  152. package/src/svg/monitor.svg +4 -4
  153. package/src/svg/next.svg +4 -4
  154. package/src/svg/picture.svg +7 -7
  155. package/src/svg/prev.svg +4 -4
  156. package/src/svg/search.svg +4 -4
  157. package/src/svg/share.svg +4 -4
  158. package/src/svg/upload.svg +4 -4
  159. package/src/svg/videoPause.svg +4 -4
  160. package/src/svg/videoPlay.svg +4 -4
  161. package/src/svg/view.svg +4 -4
  162. package/src/types/button.d.ts +4 -97
  163. package/src/types/components.d.ts +8 -8
  164. package/src/types/event.d.ts +0 -30
  165. package/src/types/global.d.ts +2 -0
  166. package/src/types/inst.d.ts +5 -5
  167. package/src/types/main.d.ts +35 -80
  168. package/src/types/mask.d.ts +18 -15
  169. package/src/utils/PopsDOMUtils.ts +34 -34
  170. package/src/utils/PopsInstanceUtils.ts +129 -139
  171. package/src/utils/PopsUtils.ts +60 -45
  172. package/dist/types/src/components/alert/config.d.ts +0 -2
  173. package/dist/types/src/components/confirm/config.d.ts +0 -2
  174. package/dist/types/src/components/drawer/config.d.ts +0 -2
  175. package/dist/types/src/components/folder/config.d.ts +0 -2
  176. package/dist/types/src/components/iframe/config.d.ts +0 -2
  177. package/dist/types/src/components/loading/config.d.ts +0 -2
  178. package/dist/types/src/components/panel/config.d.ts +0 -2
  179. package/dist/types/src/components/panel/types/components-forms.d.ts +0 -23
  180. package/dist/types/src/components/prompt/config.d.ts +0 -2
  181. package/dist/types/src/components/rightClickMenu/config.d.ts +0 -2
  182. package/dist/types/src/components/searchSuggestion/config.d.ts +0 -2
  183. package/dist/types/src/components/tooltip/config.d.ts +0 -2
  184. package/src/components/panel/types/components-forms.ts +0 -24
@@ -1,8 +1,12 @@
1
- import type { PopsPanelCommonDetails } from "./components-common";
1
+ import type { PopsPanelGeneralConfig } from "./components-common";
2
2
  /**
3
3
  * pops.panel的 switch
4
4
  */
5
- export interface PopsPanelSwitchDetails extends PopsPanelCommonDetails<PopsPanelSwitchDetails> {
5
+ export interface PopsPanelSwitchConfig extends PopsPanelGeneralConfig<PopsPanelSwitchConfig> {
6
+ /**
7
+ * 类型
8
+ */
9
+ type: "switch";
6
10
  /**
7
11
  * 显示在左边的文字
8
12
  */
@@ -12,10 +16,6 @@ export interface PopsPanelSwitchDetails extends PopsPanelCommonDetails<PopsPanel
12
16
  * @default ""
13
17
  */
14
18
  description?: string;
15
- /**
16
- * 类型
17
- */
18
- type: "switch";
19
19
  /**
20
20
  * (可选)是否禁用
21
21
  * @default false
@@ -1,8 +1,12 @@
1
- import type { PopsPanelCommonDetails } from "./components-common";
1
+ import type { PopsPanelGeneralConfig } from "./components-common";
2
2
  /**
3
3
  * pops.panel的 textarea
4
4
  */
5
- export interface PopsPanelTextAreaDetails extends PopsPanelCommonDetails<PopsPanelTextAreaDetails> {
5
+ export interface PopsPanelTextAreaConfig extends PopsPanelGeneralConfig<PopsPanelTextAreaConfig> {
6
+ /**
7
+ * 类型
8
+ */
9
+ type: "textarea";
6
10
  /**
7
11
  * 显示在左边的文字
8
12
  */
@@ -12,10 +16,6 @@ export interface PopsPanelTextAreaDetails extends PopsPanelCommonDetails<PopsPan
12
16
  * @default ""
13
17
  */
14
18
  description?: string;
15
- /**
16
- * 类型
17
- */
18
- type: "textarea";
19
19
  /**
20
20
  * (可选)是否禁用
21
21
  * @default false
@@ -1,18 +1,24 @@
1
- import type { PopsTitleConfig, PopsDragConfig, PopsCommonConfig } from "../../../types/components";
2
- import type { PopsPanelFormsDetails } from "./components-forms";
3
- import type { PopsPanelSwitchDetails } from "./components-switch";
4
- import type { PopsPanelSliderDetails } from "./components-slider";
5
- import type { PopsPanelInputDetails } from "./components-input";
6
- import type { PopsPanelTextAreaDetails } from "./components-textarea";
7
- import type { PopsPanelSelectDetails } from "./components-select";
8
- import type { PopsPanelButtonDetails } from "./components-button";
9
- import type { PopsPanelDeepMenuDetails } from "./components-deepMenu";
10
- import type { PopsPanelOwnDetails } from "./components-own";
11
- import type { PopsHeaderCloseButtonDetails } from "../../../types/button";
12
- import type { PopsPanelSelectMultipleDetails } from "./components-selectMultiple";
13
- import type { PopsPanelCommonDetails } from "./components-common";
14
- /** panel的各种类型的配置项 */
15
- export type PopsPanelFormsTotalDetails = PopsPanelSwitchDetails | PopsPanelSliderDetails | PopsPanelInputDetails | PopsPanelTextAreaDetails | PopsPanelSelectDetails<any> | PopsPanelSelectMultipleDetails<any> | PopsPanelButtonDetails | PopsPanelDeepMenuDetails | PopsPanelOwnDetails;
1
+ import type { PopsTitleConfig, PopsDragConfig, PopsGeneralConfig } from "../../../types/components";
2
+ import type { PopsPanelContainerConfig } from "./components-container";
3
+ import type { PopsPanelSwitchConfig } from "./components-switch";
4
+ import type { PopsPanelSliderConfig } from "./components-slider";
5
+ import type { PopsPanelInputConfig } from "./components-input";
6
+ import type { PopsPanelTextAreaConfig } from "./components-textarea";
7
+ import type { PopsPanelSelectConfig } from "./components-select";
8
+ import type { PopsPanelButtonConfig } from "./components-button";
9
+ import type { PopsPanelDeepViewConfig } from "./components-deepMenu";
10
+ import type { PopsPanelOwnConfig } from "./components-own";
11
+ import type { PopsHeaderCloseButtonConfig } from "../../../types/button";
12
+ import type { PopsPanelSelectMultipleConfig } from "./components-selectMultiple";
13
+ import type { PopsPanelGeneralConfig } from "./components-common";
14
+ /**
15
+ * panel的各种类型的配置项(不包括type="container"类型的)
16
+ */
17
+ export type PopsPanelViewConfig = PopsPanelSwitchConfig | PopsPanelSliderConfig | PopsPanelInputConfig | PopsPanelTextAreaConfig | PopsPanelSelectConfig<any> | PopsPanelSelectMultipleConfig<any> | PopsPanelButtonConfig | PopsPanelDeepViewConfig | PopsPanelOwnConfig;
18
+ /**
19
+ * panel的views配置项
20
+ */
21
+ export type PopsPanelMainViewConfig = PopsPanelViewConfig | PopsPanelContainerConfig;
16
22
  /**
17
23
  * panel的内部事件
18
24
  */
@@ -22,9 +28,9 @@ export type PopsPanelEventType = {
22
28
  */
23
29
  "pops:renderRightContainer": {
24
30
  /**
25
- * 菜单配置
31
+ * 视图配置
26
32
  */
27
- formConfig: PopsPanelContentConfig[] | PopsPanelDeepMenuDetails;
33
+ viewConfig: PopsPanelContentConfig[] | PopsPanelDeepViewConfig;
28
34
  };
29
35
  };
30
36
  /**
@@ -39,7 +45,7 @@ export interface PopsPanelContentConfig {
39
45
  * (可选)元素的className,值为空的话就不设置
40
46
  * @default ""
41
47
  */
42
- className?: PopsPanelCommonDetails<any>["className"];
48
+ className?: PopsPanelGeneralConfig<any>["className"];
43
49
  /**
44
50
  * 显示的文本,可以是html格式
45
51
  */
@@ -72,16 +78,18 @@ export interface PopsPanelContentConfig {
72
78
  scrollToDefaultView?: boolean;
73
79
  /**
74
80
  * (可选)自定义元素属性.setAttribute、.getAttribute
81
+ * @default {}
75
82
  */
76
- attributes?: PopsPanelCommonDetails<any>["attributes"];
83
+ attributes?: PopsPanelGeneralConfig<any>["attributes"];
77
84
  /**
78
85
  * (可选)自定义元素内部的属性值
86
+ * @default {}
79
87
  */
80
- props?: PopsPanelCommonDetails<any>["props"];
88
+ props?: PopsPanelGeneralConfig<any>["props"];
81
89
  /**
82
- * 子配置
90
+ * 视图配置
83
91
  */
84
- forms: (PopsPanelFormsDetails | PopsPanelFormsTotalDetails)[];
92
+ views: PopsPanelMainViewConfig[];
85
93
  /**
86
94
  * 左侧容器的点击回调(点击后第一个触发该回调)
87
95
  * @returns
@@ -116,7 +124,7 @@ export interface PopsPanelBottomContentConfig {
116
124
  * (可选)元素的className,值为空的话就不设置
117
125
  * @default ""
118
126
  */
119
- className?: PopsPanelCommonDetails<any>["className"];
127
+ className?: PopsPanelGeneralConfig<any>["className"];
120
128
  /**
121
129
  * (可选)配置所在位置
122
130
  *
@@ -136,12 +144,12 @@ export interface PopsPanelBottomContentConfig {
136
144
  * (可选)自定义元素属性.setAttribute、.getAttribute
137
145
  * @default {}
138
146
  */
139
- attributes?: PopsPanelCommonDetails<any>["attributes"];
147
+ attributes?: PopsPanelGeneralConfig<any>["attributes"];
140
148
  /**
141
149
  * (可选)自定义元素内部的属性值
142
150
  * @default {}
143
151
  */
144
- props?: PopsPanelCommonDetails<any>["props"];
152
+ props?: PopsPanelGeneralConfig<any>["props"];
145
153
  /**
146
154
  * 该项的点击回调
147
155
  */
@@ -171,7 +179,7 @@ export interface PopsPanelBottomContentConfig {
171
179
  /**
172
180
  * pops.panel
173
181
  */
174
- export interface PopsPanelDetails extends PopsTitleConfig, PopsDragConfig, PopsCommonConfig {
182
+ export interface PopsPanelConfig extends PopsTitleConfig, PopsDragConfig, PopsGeneralConfig {
175
183
  /**
176
184
  * 内容配置
177
185
  */
@@ -187,14 +195,14 @@ export interface PopsPanelDetails extends PopsTitleConfig, PopsDragConfig, PopsC
187
195
  /**
188
196
  * 关闭按钮
189
197
  */
190
- close?: PopsHeaderCloseButtonDetails;
198
+ close?: PopsHeaderCloseButtonConfig;
191
199
  };
192
200
  /**
193
201
  * 移动端适配的的className
194
202
  *
195
203
  * @default "pops-panel-is-mobile"
196
204
  */
197
- mobileClassName?: PopsPanelCommonDetails<any>["className"];
205
+ mobileClassName?: PopsPanelGeneralConfig<any>["className"];
198
206
  /**
199
207
  * 是否强制是移动端,默认false
200
208
  * + true 强制为移动端
@@ -0,0 +1,2 @@
1
+ import type { PopsPromptConfig } from "./types/index";
2
+ export declare const PopsPromptDefaultConfig: () => DeepRequired<PopsPromptConfig>;
@@ -1,4 +1,4 @@
1
- import type { PopsPromptDetails } from "./types/index";
1
+ import type { PopsPromptConfig } from "./types/index";
2
2
  export declare const PopsPrompt: {
3
- init(details: PopsPromptDetails): Omit<import("../../types/event").PopsEventConfig, "function" | "type">;
3
+ init(__config__: PopsPromptConfig): Omit<import("../../types/event").PopsEventConfig, "function" | "type">;
4
4
  };
@@ -1,10 +1,10 @@
1
- import type { PopsTitleConfig, PopsDragConfig, PopsCommonConfig, PopsMoreButtonConfig } from "../../../types/components";
1
+ import type { PopsTitleConfig, PopsDragConfig, PopsGeneralConfig, PopsMoreButtonConfig } from "../../../types/components";
2
2
  /**
3
3
  * pops.prompt
4
4
  */
5
- export interface PopsPromptDetails extends PopsTitleConfig, PopsDragConfig, PopsMoreButtonConfig<{
5
+ export interface PopsPromptConfig extends PopsTitleConfig, PopsDragConfig, PopsMoreButtonConfig<{
6
6
  text: string;
7
- }>, PopsCommonConfig {
7
+ }>, PopsGeneralConfig {
8
8
  /**
9
9
  * 内容配置
10
10
  */
@@ -39,6 +39,7 @@ export interface PopsPromptDetails extends PopsTitleConfig, PopsDragConfig, Pops
39
39
  placeholder?: string;
40
40
  /**
41
41
  * (可选)文字的自定义CSS
42
+ * @default ""
42
43
  */
43
44
  style?: string;
44
45
  };
@@ -0,0 +1,2 @@
1
+ import type { PopsRightClickMenuConfig } from "./types";
2
+ export declare const PopsRightClickMenuDefaultConfig: () => DeepRequired<PopsRightClickMenuConfig>;
@@ -1,11 +1,11 @@
1
- import type { PopsRightClickMenuDataDetails, PopsRightClickMenuDetails } from "./types";
1
+ import type { PopsRightClickMenuConfig, PopsRightClickMenuDataConfig } from "./types";
2
2
  export declare const PopsRightClickMenu: {
3
- init(details: PopsRightClickMenuDetails): {
3
+ init(__config__: PopsRightClickMenuConfig): {
4
4
  guid: string;
5
- config: DeepRequired<PopsRightClickMenuDetails>;
5
+ config: DeepRequired<PopsRightClickMenuConfig>;
6
6
  addWindowCheckClickListener: () => void;
7
7
  removeWindowCheckClickListener: () => void;
8
- addContextMenuEvent: (target: PopsRightClickMenuDetails["target"], selector?: string) => void;
8
+ addContextMenuEvent: (target: PopsRightClickMenuConfig["$target"], selector?: string) => void;
9
9
  removeContextMenuEvent: (target: HTMLElement | typeof globalThis | Window, selector?: string) => void;
10
10
  /**
11
11
  * 移除初始化时的添加的监听事件
@@ -18,10 +18,12 @@ export declare const PopsRightClickMenu: {
18
18
  * 操作弹出菜单的对象
19
19
  */
20
20
  PopsContextMenu: {
21
- /**
22
- * 根元素
23
- */
24
- rootElement: HTMLElement;
21
+ $data: {
22
+ menuDataKey: string;
23
+ };
24
+ $el: {
25
+ $root: HTMLElement;
26
+ };
25
27
  /**
26
28
  * 全局点击检测
27
29
  * @param event
@@ -45,13 +47,13 @@ export declare const PopsRightClickMenu: {
45
47
  * @param event
46
48
  * @param selectorTarget
47
49
  */
48
- contextMenuEvent(event: PointerEvent, selectorTarget: NonNullable<PopsRightClickMenuDetails["target"]>): void;
50
+ contextMenuEvent(event: PointerEvent, selectorTarget: NonNullable<PopsRightClickMenuConfig["$target"]>): void;
49
51
  /**
50
52
  * 添加contextmenu事件
51
53
  * @param target 目标
52
54
  * @param selector 子元素选择器
53
55
  */
54
- addContextMenuEvent(target: PopsRightClickMenuDetails["target"], selector?: string): void;
56
+ addContextMenuEvent(target: PopsRightClickMenuConfig["$target"], selector?: string): void;
55
57
  /**
56
58
  * 移除contextmenu事件
57
59
  * @param target 目标
@@ -65,9 +67,9 @@ export declare const PopsRightClickMenu: {
65
67
  animationCloseMenu($menu: HTMLElement): void;
66
68
  /**
67
69
  * 关闭所有菜单
68
- * @param rootElement
70
+ * @param $root
69
71
  */
70
- closeAllMenu(rootElement: HTMLElement): void;
72
+ closeAllMenu($root: HTMLElement): void;
71
73
  /**
72
74
  * 获取菜单容器
73
75
  * @param isChildren 是否是rightClickMenu的某一项的子菜单
@@ -79,11 +81,11 @@ export declare const PopsRightClickMenu: {
79
81
  getMenuZIndex(): number;
80
82
  /**
81
83
  * 获取left、top偏移
82
- * @param menuElement 当前生成的菜单元素
84
+ * @param $menu 当前生成的菜单元素
83
85
  * @param mousePosition 鼠标位置信息
84
86
  * @param isMainMenu 是否是主菜单
85
87
  */
86
- getOffset(menuElement: HTMLElement, mousePosition: {
88
+ getOffset($menu: HTMLElement, mousePosition: {
87
89
  x: number;
88
90
  y: number;
89
91
  }, parentInfo?: {
@@ -98,23 +100,23 @@ export declare const PopsRightClickMenu: {
98
100
  /**
99
101
  * 显示菜单
100
102
  * @param menuEvent 触发的事件
101
- * @param _config_
102
- * @param menuListenerRootNode 右键菜单监听的元素
103
+ * @param dataConfig
104
+ * @param $listenerRootNode 右键菜单监听的元素
103
105
  */
104
- showMenu(menuEvent: PointerEvent, _config_: PopsRightClickMenuDataDetails[], menuListenerRootNode: NonNullable<PopsRightClickMenuDetails["target"]>): HTMLDivElement;
106
+ showMenu(menuEvent: PointerEvent, dataConfig: PopsRightClickMenuDataConfig[], $listenerRootNode: NonNullable<PopsRightClickMenuConfig["$target"]>): HTMLDivElement;
105
107
  /**
106
108
  * 显示子菜单
107
109
  * @param menuEvent 事件
108
110
  * @param posInfo 位置信息
109
- * @param _config_
110
- * @param rootElement 根菜单元素
111
- * @param targetLiElement 父li项元素
112
- * @param menuListenerRootNode 右键菜单监听的元素
111
+ * @param dataConfig
112
+ * @param $root 根菜单元素
113
+ * @param $targetLi 父li项元素
114
+ * @param $listenerRootNode 右键菜单监听的元素
113
115
  */
114
116
  showClildMenu(menuEvent: PointerEvent, posInfo: {
115
117
  clientX: number;
116
118
  clientY: number;
117
- }, _config_: PopsRightClickMenuDataDetails[], rootElement: HTMLDivElement, targetLiElement: HTMLLIElement, menuListenerRootNode: NonNullable<PopsRightClickMenuDetails["target"]>): HTMLDivElement;
119
+ }, dataConfig: PopsRightClickMenuDataConfig[], $root: HTMLDivElement, $targetLi: HTMLLIElement, $listenerRootNode: NonNullable<PopsRightClickMenuConfig["$target"]>): HTMLDivElement;
118
120
  /**
119
121
  * 处理菜单显示的css样式(添加到页面后)
120
122
  * @param $menu 菜单元素
@@ -131,12 +133,12 @@ export declare const PopsRightClickMenu: {
131
133
  /**
132
134
  * 获取菜单项的元素
133
135
  * @param menuEvent 事件
134
- * @param rootElement 根元素
135
- * @param menuElement 菜单元素
136
- * @param _config_ 配置
137
- * @param menuListenerRootNode 右键菜单监听的元素
136
+ * @param $root 根元素
137
+ * @param $menu 菜单元素
138
+ * @param dataConfig 配置
139
+ * @param $listenerRootNode 右键菜单监听的元素
138
140
  */
139
- addMenuLiELement(menuEvent: PointerEvent, rootElement: HTMLDivElement, menuElement: HTMLDivElement, _config_: PopsRightClickMenuDataDetails[], menuListenerRootNode: NonNullable<PopsRightClickMenuDetails["target"]>): void;
141
+ addMenuLiELement(menuEvent: PointerEvent, $root: HTMLDivElement, $menu: HTMLDivElement, dataConfig: PopsRightClickMenuDataConfig[], $listenerRootNode: NonNullable<PopsRightClickMenuConfig["$target"]>): void;
140
142
  };
141
143
  };
142
144
  };
@@ -1,10 +1,31 @@
1
- import type { PopsCommonConfig } from "../../../types/components";
1
+ import type { PopsGeneralConfig } from "../../../types/components";
2
2
  import type { PopsIconType } from "../../../types/icon";
3
- import type { PopsPanelCommonDetails } from "../../panel/types/components-common";
3
+ import type { PopsPanelGeneralConfig } from "../../panel/types/components-common";
4
+ /**
5
+ * 存储在pops.rightClickMenu的右键菜单根元素上的属性
6
+ */
7
+ export type PopsRightClickMenuRootStoreNodeValue = {
8
+ child: HTMLElement[];
9
+ };
10
+ /**
11
+ * 存储在pops.rightClickMenu的右键菜单子菜单的根元素上的属性
12
+ */
13
+ export type PopsRightClickMenuChildRootStoreNodeValue = {
14
+ parent: HTMLElement;
15
+ root: HTMLElement;
16
+ };
17
+ /**
18
+ * 存储在pops.rightClickMenu的右键菜单每一项元素上的属性
19
+ */
20
+ export type PopsRightClickMenuItemStoreNodeValue = {
21
+ child?: HTMLElement;
22
+ parent?: HTMLElement;
23
+ root?: HTMLElement;
24
+ };
4
25
  /**
5
26
  * pops.rightClickMenu的右键菜单配置
6
27
  */
7
- export interface PopsRightClickMenuDataDetails {
28
+ export interface PopsRightClickMenuDataConfig {
8
29
  /**
9
30
  * svg图标,留空则是没图标
10
31
  * @default ""
@@ -23,28 +44,28 @@ export interface PopsRightClickMenuDataDetails {
23
44
  * 点击的回调函数
24
45
  * @param clickEvent 点击菜单的click事件
25
46
  * @param contextMenuEvent 触发的contextmenu事件
26
- * @param liElement <li>元素
27
- * @param menuListenerRootNode 右键菜单监听的元素
47
+ * @param $li <li>元素
48
+ * @param $listenerRootNode 右键菜单监听的元素
28
49
  * @returns
29
50
  * + true(默认) 关闭菜单
30
51
  * + false 不关闭菜单
31
52
  *
32
53
  */
33
- callback?: (clickEvent: PointerEvent, contextMenuEvent: PointerEvent, liElement: HTMLLIElement, menuListenerRootNode: NonNullable<PopsRightClickMenuDetails["target"]>) => boolean | void | Promise<boolean | void>;
54
+ callback?: (clickEvent: PointerEvent, contextMenuEvent: PointerEvent, $li: HTMLLIElement, $listenerRootNode: NonNullable<PopsRightClickMenuConfig["$target"]>) => IPromise<boolean | void>;
34
55
  /**
35
56
  * 子项配置
36
57
  */
37
- item?: PopsRightClickMenuDataDetails[] | null;
58
+ item?: PopsRightClickMenuDataConfig[] | null;
38
59
  }
39
60
  /**
40
61
  * pops.rightClickMenu
41
62
  */
42
- export interface PopsRightClickMenuDetails extends Pick<PopsCommonConfig, "useShadowRoot" | "beforeAppendToPageCallBack" | "zIndex" | "style" | "only"> {
63
+ export interface PopsRightClickMenuConfig extends Pick<PopsGeneralConfig, "useShadowRoot" | "beforeAppendToPageCallBack" | "zIndex" | "style" | "only"> {
43
64
  /**
44
65
  * 目标元素
45
66
  * @default document.documentElement
46
67
  */
47
- target?: HTMLElement | Window | EventTarget | Node;
68
+ $target?: HTMLElement | Window | EventTarget | Node;
48
69
  /**
49
70
  * 目标的子元素选择器,默认为空
50
71
  * @default null
@@ -58,7 +79,7 @@ export interface PopsRightClickMenuDetails extends Pick<PopsCommonConfig, "useSh
58
79
  /**
59
80
  * 右键菜单数据
60
81
  */
61
- data: PopsRightClickMenuDataDetails[];
82
+ data: PopsRightClickMenuDataConfig[];
62
83
  /**
63
84
  * 子菜单的左右偏移距离
64
85
  * @default 0
@@ -73,7 +94,7 @@ export interface PopsRightClickMenuDetails extends Pick<PopsCommonConfig, "useSh
73
94
  * (可选)元素的className,值为空的话就不设置
74
95
  * @default ""
75
96
  */
76
- className?: PopsPanelCommonDetails<any>["className"];
97
+ className?: PopsPanelGeneralConfig<any>["className"];
77
98
  /**
78
99
  * 是否启用动画,默认false
79
100
  *
@@ -0,0 +1,2 @@
1
+ import type { PopsSearchSuggestionConfig } from "./types/index";
2
+ export declare const PopsSearchSuggestionDefaultConfig: () => DeepRequired<PopsSearchSuggestionConfig<any>>;
@@ -1,6 +1,6 @@
1
- import type { PopsSearchSuggestionData, PopsSearchSuggestionDetails } from "./types/index";
1
+ import type { PopsSearchSuggestionData, PopsSearchSuggestionConfig } from "./types/index";
2
2
  export declare const PopsSearchSuggestion: {
3
- init<T>(details: PopsSearchSuggestionDetails<T>): {
3
+ init<T>(__config__: PopsSearchSuggestionConfig<T>): {
4
4
  /**
5
5
  * 当前的环境,可以是document,可以是shadowroot,默认是document
6
6
  */
@@ -8,8 +8,16 @@ export declare const PopsSearchSuggestion: {
8
8
  $el: {
9
9
  /** 根元素 */
10
10
  root: HTMLElement;
11
+ /**
12
+ * 包裹ul的容器元素
13
+ */
14
+ $dropdownWrapper: HTMLElement;
11
15
  /** ul元素 */
12
- $hintULContainer: HTMLUListElement;
16
+ $dropdownContainer: HTMLUListElement;
17
+ /**
18
+ * 箭头元素
19
+ */
20
+ $arrow: HTMLDivElement;
13
21
  /** 动态更新CSS */
14
22
  $dynamicCSS: HTMLStyleElement;
15
23
  };
@@ -19,12 +27,19 @@ export declare const PopsSearchSuggestion: {
19
27
  $data: {
20
28
  /** 是否结果为空 */
21
29
  isEmpty: boolean;
30
+ /**
31
+ * 存储在元素上的操作的键名
32
+ */
33
+ storeNodeHandlerKey: string;
22
34
  };
23
35
  /**
24
36
  * 初始化
25
- * @param parentElement 父元素
37
+ * @param $parent 父元素
38
+ * @example
39
+ * .init();
40
+ * .setAllEvent();
26
41
  */
27
- init(parentElement?: HTMLElement): void;
42
+ init($parent?: HTMLElement): void;
28
43
  /**
29
44
  * 初始化元素变量
30
45
  */
@@ -101,7 +116,7 @@ export declare const PopsSearchSuggestion: {
101
116
  */
102
117
  removeHideEvent(option?: AddEventListenerOptions): void;
103
118
  /**
104
- * 设置所有监听
119
+ * 设置所有监听,包括(input值改变、全局点击判断显示/隐藏建议框)
105
120
  */
106
121
  setAllEvent(option?: AddEventListenerOptions): void;
107
122
  /**
@@ -1,6 +1,6 @@
1
- import type { PopsCommonConfig } from "../../../types/components";
2
- import type { PopsPanelCommonDetails } from "../../panel/types/components-common";
3
- export type PopsSearchSuggestionData<T = any> = {
1
+ import type { PopsGeneralConfig } from "../../../types/components";
2
+ import type { PopsPanelGeneralConfig } from "../../panel/types/components-common";
3
+ export type PopsSearchSuggestionData<T> = {
4
4
  /**
5
5
  * 值
6
6
  */
@@ -32,7 +32,7 @@ export type PopsSearchSuggestionData<T = any> = {
32
32
  /**
33
33
  * 当前配置
34
34
  */
35
- config: PopsSearchSuggestionDetails<T>) => void | boolean | Promise<void | boolean>;
35
+ config: PopsSearchSuggestionConfig<T>) => void | boolean | Promise<void | boolean>;
36
36
  /**
37
37
  * 获取每一项的html,在显示的时候会调用该函数
38
38
  *
@@ -50,7 +50,7 @@ export type PopsSearchSuggestionData<T = any> = {
50
50
  /**
51
51
  * 当前配置
52
52
  */
53
- config: PopsSearchSuggestionDetails<T>) => HTMLElement | string;
53
+ config: PopsSearchSuggestionConfig<T>) => HTMLElement | string;
54
54
  /**
55
55
  * 每一项的点击回调
56
56
  * @returns
@@ -73,7 +73,7 @@ export type PopsSearchSuggestionData<T = any> = {
73
73
  /**
74
74
  * 当前配置
75
75
  */
76
- config: PopsSearchSuggestionDetails<T>) => void | boolean | Promise<void | boolean>;
76
+ config: PopsSearchSuggestionConfig<T>) => IPromise<void | boolean>;
77
77
  /**
78
78
  * 键盘的上下键选择的回调
79
79
  */
@@ -93,29 +93,31 @@ export type PopsSearchSuggestionData<T = any> = {
93
93
  /**
94
94
  * 当前配置
95
95
  */
96
- config: PopsSearchSuggestionDetails<T>) => void;
96
+ config: PopsSearchSuggestionConfig<T>) => void;
97
97
  };
98
98
  /**
99
99
  * 搜索建议悬浮窗
100
100
  * pops.searchSuggestion
101
101
  */
102
- export interface PopsSearchSuggestionDetails<T = any> extends Pick<PopsCommonConfig, "useShadowRoot" | "zIndex" | "style"> {
102
+ export interface PopsSearchSuggestionConfig<T = any> extends Pick<PopsGeneralConfig, "useShadowRoot" | "zIndex" | "style"> {
103
103
  /**
104
104
  * 当前的环境,可以是document,可以是shadowroot,默认是document
105
+ *
106
+ * 用于检测监听全局点击事件
105
107
  * @default document
106
108
  */
107
- selfDocument?: Document | ShadowRoot | (Document | ShadowRoot)[];
109
+ $selfDocument?: Document | ShadowRoot | (Document | ShadowRoot)[];
108
110
  /**
109
111
  * 目标元素,一般是跟随它的位置变化,监听它的focus/click
110
112
  */
111
- target: HTMLElement;
113
+ $target: HTMLElement;
112
114
  /**
113
115
  * 目标input元素,监听它的focus/click/input事件
114
116
  *
115
117
  * 如果未填,那么自动使用target的值
116
118
  * @default config.target
117
119
  */
118
- inputTarget?: HTMLInputElement | HTMLTextAreaElement;
120
+ $inputTarget?: HTMLInputElement | HTMLTextAreaElement;
119
121
  /**
120
122
  * 数据
121
123
  */
@@ -124,7 +126,7 @@ export interface PopsSearchSuggestionDetails<T = any> extends Pick<PopsCommonCon
124
126
  * (可选)元素的className,值为空的话就不设置
125
127
  * @default ""
126
128
  */
127
- className?: PopsPanelCommonDetails<any>["className"];
129
+ className?: PopsPanelGeneralConfig<any>["className"];
128
130
  /**
129
131
  * 建议框的position位置
130
132
  *
@@ -229,5 +231,5 @@ export interface PopsSearchSuggestionDetails<T = any> extends Pick<PopsCommonCon
229
231
  /**
230
232
  * 当前配置
231
233
  */
232
- config: PopsSearchSuggestionDetails<T>) => Promise<PopsSearchSuggestionData<T>[]> | PopsSearchSuggestionData<T>[];
234
+ config: PopsSearchSuggestionConfig<T>) => Promise<PopsSearchSuggestionData<T>[]> | PopsSearchSuggestionData<T>[];
233
235
  }
@@ -0,0 +1,2 @@
1
+ import type { PopsToolTipConfig } from "./types/index";
2
+ export declare const PopsTooltipDefaultConfig: () => DeepRequired<PopsToolTipConfig>;
@@ -1,4 +1,4 @@
1
- import type { PopsToolTipDetails } from "./types/index";
1
+ import type { PopsToolTipConfig } from "./types/index";
2
2
  type ToolTipEventTypeName = "MouseEvent" | "TouchEvent";
3
3
  export declare class ToolTip {
4
4
  $el: {
@@ -9,12 +9,12 @@ export declare class ToolTip {
9
9
  $arrow: HTMLElement;
10
10
  };
11
11
  $data: {
12
- config: Required<PopsToolTipDetails>;
12
+ config: Required<PopsToolTipConfig>;
13
13
  guid: string;
14
14
  timeId_close_TouchEvent: number[];
15
15
  timeId_close_MouseEvent: number[];
16
16
  };
17
- constructor(config: Required<PopsToolTipDetails>, guid: string, ShadowInfo: {
17
+ constructor(config: Required<PopsToolTipConfig>, guid: string, ShadowInfo: {
18
18
  $shadowContainer: HTMLDivElement;
19
19
  $shadowRoot: ShadowRoot | HTMLElement;
20
20
  });
@@ -171,7 +171,7 @@ export declare class ToolTip {
171
171
  */
172
172
  offToolTipMouseLeaveEvent(): void;
173
173
  }
174
- export type PopsTooltipResult<T extends PopsToolTipDetails> = {
174
+ export type PopsTooltipResult<T extends PopsToolTipConfig> = {
175
175
  guid: string;
176
176
  config: T;
177
177
  $shadowContainer: HTMLDivElement;
@@ -179,10 +179,10 @@ export type PopsTooltipResult<T extends PopsToolTipDetails> = {
179
179
  toolTip: typeof ToolTip.prototype;
180
180
  };
181
181
  export declare const PopsTooltip: {
182
- init(details: PopsToolTipDetails): {
182
+ init(__config__: PopsToolTipConfig): {
183
183
  guid: string;
184
184
  config: {
185
- target: HTMLElement;
185
+ $target: HTMLElement;
186
186
  content: string | (() => string);
187
187
  isDiffContent: boolean;
188
188
  position: import("./types/index").PopsTooltipPosition;
@@ -195,21 +195,6 @@ export declare const PopsTooltip: {
195
195
  eventOption: {
196
196
  once: boolean;
197
197
  passive: boolean;
198
- signal: {
199
- readonly aborted: boolean;
200
- onabort: ((this: AbortSignal, ev: Event) => any) | null;
201
- readonly reason: any;
202
- throwIfAborted: () => void;
203
- addEventListener: {
204
- <K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
205
- (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
206
- };
207
- removeEventListener: {
208
- <K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
209
- (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
210
- };
211
- dispatchEvent: (event: Event) => boolean;
212
- };
213
198
  capture: boolean;
214
199
  };
215
200
  showBeforeCallBack: ($toolTip: HTMLElement) => false | void;