@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,38 +1,18 @@
1
- import type { PopsTitleConfig, PopsDragConfig, PopsCommonConfig } from "../../../types/components";
1
+ import type { PopsTitleConfig, PopsDragConfig, PopsGeneralConfig } from "../../../types/components";
2
2
  import type { PopsEventConfig } from "../../../types/event";
3
3
  /**
4
- * pops.iframe的按钮的点击回调参数event
4
+ * pops.iframe的按钮点击事件回调的配置参数
5
5
  */
6
- export interface PopsBtnIframeCallBackEvent {
7
- /**
8
- * 动画元素(包裹着弹窗元素)
9
- */
10
- animElement: HTMLElement;
11
- /**
12
- * 弹窗元素
13
- */
14
- popsElement: HTMLElement;
15
- /**
16
- * 遮罩层元素,如果未设置,那么不存在
17
- */
18
- maskElement?: HTMLElement;
6
+ export type PopsIframeClickEventConfig = PopsEventConfig & {
19
7
  /**
20
8
  * iframe元素
21
9
  */
22
- iframePopsElement: HTMLIFrameElement;
23
- /**
24
- * 使用的方法名
25
- */
26
- function: "iframe";
27
- /**
28
- * 唯一id
29
- */
30
- guid: string;
31
- }
10
+ $iframe: HTMLIFrameElement;
11
+ };
32
12
  /**
33
13
  * pops.iframe
34
14
  */
35
- export interface PopsIframeDetails extends PopsTitleConfig, PopsDragConfig, PopsCommonConfig {
15
+ export interface PopsIframeConfig extends PopsTitleConfig, PopsDragConfig, PopsGeneralConfig {
36
16
  /**
37
17
  * 加载配置
38
18
  */
@@ -61,9 +41,7 @@ export interface PopsIframeDetails extends PopsTitleConfig, PopsDragConfig, Pops
61
41
  /**
62
42
  * 点击的回调函数
63
43
  */
64
- callback: (eventConfig: PopsEventConfig & {
65
- iframeElement: HTMLIFrameElement;
66
- }, event: MouseEvent | PointerEvent) => void;
44
+ callback: (eventConfig: PopsIframeClickEventConfig, event: MouseEvent | PointerEvent) => void;
67
45
  };
68
46
  /**
69
47
  * 最大化
@@ -72,9 +50,7 @@ export interface PopsIframeDetails extends PopsTitleConfig, PopsDragConfig, Pops
72
50
  /**
73
51
  * 点击的回调函数
74
52
  */
75
- callback: (eventConfig: PopsEventConfig & {
76
- iframeElement: HTMLIFrameElement;
77
- }, event: MouseEvent | PointerEvent) => void;
53
+ callback: (eventConfig: PopsIframeClickEventConfig, event: MouseEvent | PointerEvent) => void;
78
54
  };
79
55
  /**
80
56
  * 窗口化
@@ -83,9 +59,7 @@ export interface PopsIframeDetails extends PopsTitleConfig, PopsDragConfig, Pops
83
59
  /**
84
60
  * 点击的回调函数
85
61
  */
86
- callback: (eventConfig: PopsEventConfig & {
87
- iframeElement: HTMLIFrameElement;
88
- }, event: MouseEvent | PointerEvent) => void;
62
+ callback: (eventConfig: PopsIframeClickEventConfig, event: MouseEvent | PointerEvent) => void;
89
63
  };
90
64
  /**
91
65
  * 关闭
@@ -94,9 +68,7 @@ export interface PopsIframeDetails extends PopsTitleConfig, PopsDragConfig, Pops
94
68
  /**
95
69
  * 点击的回调函数
96
70
  */
97
- callback: (eventConfig: PopsEventConfig & {
98
- iframeElement: HTMLIFrameElement;
99
- }, event: MouseEvent | PointerEvent) => void;
71
+ callback: (eventConfig: PopsIframeClickEventConfig, event: MouseEvent | PointerEvent) => void;
100
72
  };
101
73
  };
102
74
  /**
@@ -106,8 +78,9 @@ export interface PopsIframeDetails extends PopsTitleConfig, PopsDragConfig, Pops
106
78
  url?: string;
107
79
  /**
108
80
  * 右上角按钮顺序:最小化、最大化、窗口化、关闭
81
+ * @default "min|max|mise|close"
109
82
  */
110
- topRightButton: "min|max|mise|close";
83
+ topRightButton: string;
111
84
  /**
112
85
  * 是否启用沙箱,默认false
113
86
  * @default false
@@ -116,7 +89,5 @@ export interface PopsIframeDetails extends PopsTitleConfig, PopsDragConfig, Pops
116
89
  /**
117
90
  * 加载完毕的回调
118
91
  */
119
- loadEndCallBack?: (details: PopsEventConfig & {
120
- iframeElement: HTMLIFrameElement;
121
- }) => void;
92
+ loadEndCallBack?: (eventConfig: PopsIframeClickEventConfig) => void;
122
93
  }
@@ -0,0 +1,2 @@
1
+ import type { PopsLoadingConfig } from "./types";
2
+ export declare const PopsLoadingDefaultConfig: () => DeepRequired<PopsLoadingConfig>;
@@ -1,4 +1,4 @@
1
- import type { PopsLoadingDetails } from "./types";
1
+ import type { PopsLoadingConfig } from "./types";
2
2
  export declare const PopsLoading: {
3
- init(details: PopsLoadingDetails): Omit<Omit<import("../../types/event").PopsEventConfig, "$shadowContainer" | "$shadowRoot">, "function" | "type">;
3
+ init(__config__: PopsLoadingConfig): Omit<Omit<import("../../types/event").PopsEventConfig, "$shadowContainer" | "$shadowRoot">, "function" | "type">;
4
4
  };
@@ -1,13 +1,13 @@
1
- import type { PopsCommonConfig, PopsContentConfig } from "../../../types/components";
1
+ import type { PopsGeneralConfig, PopsContentConfig } from "../../../types/components";
2
2
  /**
3
3
  * pops.loading
4
4
  */
5
- export interface PopsLoadingDetails extends Omit<PopsCommonConfig, "width" | "height" | "position" | "beforeAppendToPageCallBack"> {
5
+ export interface PopsLoadingConfig extends Omit<PopsGeneralConfig, "width" | "height" | "position" | "beforeAppendToPageCallBack"> {
6
6
  /**
7
7
  * 父元素,默认为document.body
8
- * @default document.body
8
+ * @default document.body || document.documentElement
9
9
  */
10
- parent?: HTMLElement;
10
+ $parent?: HTMLElement;
11
11
  /**
12
12
  * 内容配置
13
13
  */
@@ -0,0 +1,2 @@
1
+ import type { PopsPanelConfig } from "./types";
2
+ export declare const PopsPanelDefaultConfig: () => DeepRequired<PopsPanelConfig>;
@@ -1,15 +1,15 @@
1
- import type { PopsPanelButtonDetails } from "./types/components-button";
2
- import type { PopsPanelCommonDetails, PopsPanelRightAsideContainerOptions } from "./types/components-common";
3
- import type { PopsPanelDeepMenuDetails } from "./types/components-deepMenu";
4
- import type { PopsPanelFormsDetails } from "./types/components-forms";
5
- import type { PopsPanelBottomContentConfig, PopsPanelContentConfig, PopsPanelDetails, PopsPanelFormsTotalDetails } from "./types";
6
- import type { PopsPanelInputDetails } from "./types/components-input";
7
- import type { PopsPanelOwnDetails } from "./types/components-own";
8
- import type { PopsPanelSelectMultipleDetails } from "./types/components-selectMultiple";
9
- import type { PopsPanelSelectDetails } from "./types/components-select";
10
- import type { PopsPanelSliderDetails } from "./types/components-slider";
11
- import type { PopsPanelSwitchDetails } from "./types/components-switch";
12
- import type { PopsPanelTextAreaDetails } from "./types/components-textarea";
1
+ import type { PopsPanelButtonConfig } from "./types/components-button";
2
+ import type { PopsPanelGeneralConfig, PopsPanelRightAsideContainerConfig } from "./types/components-common";
3
+ import type { PopsPanelDeepViewConfig } from "./types/components-deepMenu";
4
+ import type { PopsPanelContainerConfig } from "./types/components-container";
5
+ import type { PopsPanelBottomContentConfig, PopsPanelContentConfig, PopsPanelConfig, PopsPanelViewConfig } from "./types";
6
+ import type { PopsPanelInputConfig } from "./types/components-input";
7
+ import type { PopsPanelOwnConfig } from "./types/components-own";
8
+ import type { PopsPanelSelectMultipleConfig } from "./types/components-selectMultiple";
9
+ import type { PopsPanelSelectConfig } from "./types/components-select";
10
+ import type { PopsPanelSliderConfig } from "./types/components-slider";
11
+ import type { PopsPanelSwitchConfig } from "./types/components-switch";
12
+ import type { PopsPanelTextAreaConfig } from "./types/components-textarea";
13
13
  /**
14
14
  * 处理组件(把组件配置转为组件元素)
15
15
  */
@@ -49,13 +49,16 @@ export declare const PanelHandlerComponents: () => {
49
49
  $panelBottomLeftContainer: HTMLElement;
50
50
  $panelBottomRightContainer: HTMLElement;
51
51
  };
52
- $config: Required<PopsPanelDetails>;
52
+ $data: {
53
+ nodeStoreConfigKey: string;
54
+ };
55
+ $config: Required<PopsPanelConfig>;
53
56
  /**
54
57
  * 初始化
55
- * @param details
58
+ * @param data
56
59
  */
57
- init(details: {
58
- config: Required<PopsPanelDetails>;
60
+ init(data: {
61
+ config: Required<PopsPanelConfig>;
59
62
  $el: {
60
63
  $pops: HTMLElement;
61
64
  $content: HTMLElement;
@@ -102,7 +105,7 @@ export declare const PanelHandlerComponents: () => {
102
105
  * @param $el 元素
103
106
  * @param className
104
107
  */
105
- setElementClassName($el: HTMLElement, className?: PopsPanelCommonDetails<any>["className"]): void;
108
+ setElementClassName($el: HTMLElement, className?: PopsPanelGeneralConfig<any>["className"]): void;
106
109
  /**
107
110
  * 创建底部项元素<li>
108
111
  * @param bottomItemConfig 配置
@@ -122,84 +125,85 @@ export declare const PanelHandlerComponents: () => {
122
125
  /**
123
126
  * type ==> switch
124
127
  * 创建中间容器的元素<li>
125
- * @param formConfig
128
+ * @param viewConfig
126
129
  */
127
- createSectionContainerItem_switch(formConfig: PopsPanelSwitchDetails): HTMLLIElement;
130
+ createSectionContainerItem_switch(viewConfig: PopsPanelSwitchConfig): HTMLLIElement;
128
131
  /**
129
132
  * type ==> slider
130
133
  * 获取中间容器的元素<li>
131
- * @param formConfig
134
+ * @param viewConfig
132
135
  */
133
- createSectionContainerItem_slider(formConfig: PopsPanelSliderDetails): HTMLLIElement;
136
+ createSectionContainerItem_slider(viewConfig: PopsPanelSliderConfig): HTMLLIElement;
134
137
  /**
135
138
  * type ==> slider
136
139
  * 获取中间容器的元素<li>
137
- * @param formConfig
140
+ * @param viewConfig
138
141
  */
139
- createSectionContainerItem_slider_new(formConfig: PopsPanelSliderDetails): HTMLLIElement;
142
+ createSectionContainerItem_slider_new(viewConfig: PopsPanelSliderConfig): HTMLLIElement;
140
143
  /**
141
144
  * type ==> input
142
145
  * 获取中间容器的元素<li>
143
- * @param formConfig
146
+ * @param viewConfig
144
147
  */
145
- createSectionContainerItem_input(formConfig: PopsPanelInputDetails): HTMLLIElement;
148
+ createSectionContainerItem_input(viewConfig: PopsPanelInputConfig): HTMLLIElement;
146
149
  /**
147
150
  * type ==> textarea
148
151
  * 获取中间容器的元素<li>
149
- * @param formConfig
152
+ * @param viewConfig
150
153
  */
151
- createSectionContainerItem_textarea(formConfig: PopsPanelTextAreaDetails): HTMLLIElement;
154
+ createSectionContainerItem_textarea(viewConfig: PopsPanelTextAreaConfig): HTMLLIElement;
152
155
  /**
153
156
  * type ==> select
154
157
  * 获取中间容器的元素<li>
155
- * @param formConfig
158
+ * @param viewConfig
156
159
  */
157
- createSectionContainerItem_select(formConfig: PopsPanelSelectDetails<any>): HTMLLIElement;
160
+ createSectionContainerItem_select(viewConfig: PopsPanelSelectConfig<any>): HTMLLIElement;
158
161
  /**
159
162
  * type ==> select-multiple
160
163
  * 获取中间容器的元素<li>
161
- * @param formConfig
164
+ * @param viewConfig
162
165
  */
163
- createSectionContainerItem_select_multiple_new(formConfig: PopsPanelSelectMultipleDetails<any>): HTMLLIElement;
166
+ createSectionContainerItem_select_multiple(viewConfig: PopsPanelSelectMultipleConfig<any>): HTMLLIElement;
164
167
  /**
165
168
  * type ==> button
166
169
  * 获取中间容器的元素<li>
167
- * @param formConfig
170
+ * @param viewConfig
168
171
  */
169
- createSectionContainerItem_button(formConfig: PopsPanelButtonDetails): HTMLLIElement;
172
+ createSectionContainerItem_button(viewConfig: PopsPanelButtonConfig): HTMLLIElement;
170
173
  /**
171
174
  * type ==> deepMenu
172
175
  * 获取深层容器的元素<li>
173
- * @param formConfig
176
+ * @param viewConfig
174
177
  */
175
- createSectionContainerItem_deepMenu(formConfig: PopsPanelDeepMenuDetails): HTMLLIElement;
178
+ createSectionContainerItem_deepMenu(viewConfig: PopsPanelDeepViewConfig): HTMLLIElement;
176
179
  /**
177
180
  * type ===> own
178
181
  * 获取中间容器的元素<li>
179
- * @param formConfig
182
+ * @param viewConfig
180
183
  */
181
- createSectionContainerItem_own(formConfig: PopsPanelOwnDetails): HTMLLIElement;
184
+ createSectionContainerItem_own(viewConfig: PopsPanelOwnConfig): HTMLLIElement;
182
185
  /**
183
186
  * 获取中间容器的元素<li>
184
- * @param formConfig
187
+ * @param viewConfig 视图配置
185
188
  */
186
- createSectionContainerItem(formConfig: PopsPanelFormsTotalDetails): HTMLLIElement | undefined;
189
+ createSectionContainerItem(viewConfig: PopsPanelViewConfig): HTMLLIElement | undefined;
187
190
  /**
188
191
  * 生成配置项forms
189
192
  * 生成配置每一项的元素
190
- * @param formConfig
193
+ * @param viewConfig
191
194
  */
192
- createSectionContainerItem_forms(formConfig: PopsPanelContentConfig | PopsPanelFormsDetails): void;
195
+ createSectionContainerItem_forms(viewConfig: PopsPanelContentConfig | PopsPanelContainerConfig): void;
193
196
  /**
194
197
  * 主动触发触发渲染右侧容器的事件
198
+ * @param $container 容器
195
199
  */
196
200
  triggerRenderRightContainer($container: HTMLElement): void;
197
201
  /**
198
202
  *
199
- * @param formConfig
203
+ * @param viewConfig
200
204
  * @param containerOptions
201
205
  */
202
- uListContainerAddItem(formConfig: PopsPanelFormsTotalDetails, containerOptions: Omit<PopsPanelRightAsideContainerOptions, "target">): void;
206
+ uListContainerAddItem(viewConfig: PopsPanelViewConfig, containerOptions: Omit<PopsPanelRightAsideContainerConfig, "target">): void;
203
207
  /**
204
208
  * 为左侧容器元素添加点击事件
205
209
  * @param $asideItem 左侧的容器<li>元素
@@ -1,13 +1,12 @@
1
- import type { PopsPanelDetails, PopsPanelEventType } from "./types";
1
+ import type { PopsPanelConfig, PopsPanelEventType } from "./types";
2
2
  import type { PopsType } from "../../types/main";
3
3
  export declare const PopsPanel: {
4
- init(details: PopsPanelDetails): {
4
+ init(__config__: PopsPanelConfig): {
5
5
  addEventListener: <K extends keyof PopsPanelEventType>(event: K, listener: (evt: CustomEvent<PopsPanelEventType[K]>) => void, options?: boolean | EventListenerOptions) => void;
6
6
  removeEventListener: <K extends keyof PopsPanelEventType>(event: K, listener: (evt: CustomEvent<PopsPanelEventType[K]>) => void, options?: boolean | EventListenerOptions) => void;
7
7
  close: () => Promise<void>;
8
8
  hide: () => Promise<void>;
9
9
  show: () => Promise<void>;
10
- guid: string;
11
10
  $shadowContainer: HTMLDivElement;
12
11
  $shadowRoot: ShadowRoot | HTMLElement;
13
12
  $el: HTMLDivElement;
@@ -15,5 +14,6 @@ export declare const PopsPanel: {
15
14
  $pops: HTMLDivElement;
16
15
  $mask?: HTMLDivElement | undefined;
17
16
  mode: PopsType;
17
+ guid: string;
18
18
  };
19
19
  };
@@ -1,10 +1,14 @@
1
- import type { PopsPanelCommonDetails } from "./components-common";
1
+ import type { PopsPanelGeneralConfig } from "./components-common";
2
2
  import type { PopsButtonStyleType } from "../../../types/button";
3
3
  import type { PopsIconType } from "../../../types/icon";
4
4
  /**
5
5
  * pops.panel的 button
6
6
  */
7
- export interface PopsPanelButtonDetails extends PopsPanelCommonDetails<PopsPanelButtonDetails> {
7
+ export interface PopsPanelButtonConfig extends PopsPanelGeneralConfig<PopsPanelButtonConfig> {
8
+ /**
9
+ * 类型
10
+ */
11
+ type: "button";
8
12
  /**
9
13
  * 显示在左边的文字
10
14
  */
@@ -13,12 +17,9 @@ export interface PopsPanelButtonDetails extends PopsPanelCommonDetails<PopsPanel
13
17
  * (可选)左边的文字下面的描述
14
18
  */
15
19
  description?: string;
16
- /**
17
- * 类型
18
- */
19
- type: "button";
20
20
  /**
21
21
  * (可选)是否禁用
22
+ * @default false
22
23
  */
23
24
  disable?: boolean;
24
25
  /**
@@ -1,9 +1,9 @@
1
- import type { PopsPanelFormsDetails } from "./components-forms";
2
- import type { PopsPanelFormsTotalDetails } from ".";
1
+ import type { PopsPanelContainerConfig } from "./components-container";
2
+ import type { PopsPanelViewConfig } from ".";
3
3
  /**
4
4
  * 右侧容器的配置
5
5
  */
6
- export interface PopsPanelRightAsideContainerOptions {
6
+ export interface PopsPanelRightAsideContainerConfig {
7
7
  /** 当前的<li>元素 */
8
8
  target: HTMLLIElement | undefined;
9
9
  /** 当前的<li>元素的父<ul>元素 */
@@ -18,7 +18,7 @@ export interface PopsPanelRightAsideContainerOptions {
18
18
  /**
19
19
  * 通用配置
20
20
  */
21
- export interface PopsPanelCommonDetails<T extends PopsPanelFormsTotalDetails | PopsPanelFormsDetails> {
21
+ export interface PopsPanelGeneralConfig<T extends PopsPanelViewConfig | PopsPanelContainerConfig> {
22
22
  /**
23
23
  * (可选)元素的className,值为空的话就不设置
24
24
  * @default ""
@@ -42,11 +42,11 @@ export interface PopsPanelCommonDetails<T extends PopsPanelFormsTotalDetails | P
42
42
  };
43
43
  /**
44
44
  * 在添加到<ul>元素后触发该回调
45
- * @param formConfig 配置
45
+ * @param viewConfig 配置
46
46
  * @param container 右侧容器的元素
47
47
  * @example
48
48
  * // 例如在type为own时
49
- * afterAddToUListCallBack(formConfig, container) {
49
+ * afterAddToUListCallBack(viewConfig, container) {
50
50
  * DOMUtils.on(
51
51
  container.formHeaderDivElement.querySelector(
52
52
  "a"
@@ -66,5 +66,5 @@ export interface PopsPanelCommonDetails<T extends PopsPanelFormsTotalDetails | P
66
66
  * // 例如在type为forms时
67
67
  * container内只有container.ulElement这个属性
68
68
  */
69
- afterAddToUListCallBack?: (formConfig: T, container: PopsPanelRightAsideContainerOptions) => void;
69
+ afterAddToUListCallBack?: (viewConfig: T, container: PopsPanelRightAsideContainerConfig) => void;
70
70
  }
@@ -0,0 +1,24 @@
1
+ import type { PopsPanelGeneralConfig } from "./components-common";
2
+ import type { PopsPanelViewConfig } from ".";
3
+ /**
4
+ * pops.panel的 container
5
+ */
6
+ export interface PopsPanelContainerConfig extends PopsPanelGeneralConfig<PopsPanelContainerConfig> {
7
+ /**
8
+ * 类型
9
+ */
10
+ type: "container";
11
+ /**
12
+ * 显示在左边的文字
13
+ */
14
+ text: string;
15
+ /**
16
+ * 是否进行折叠
17
+ * @default false
18
+ */
19
+ isFold?: boolean;
20
+ /**
21
+ * 子配置
22
+ */
23
+ views: PopsPanelViewConfig[];
24
+ }
@@ -1,10 +1,10 @@
1
- import type { PopsPanelFormsTotalDetails } from ".";
2
- import type { PopsPanelFormsDetails } from "./components-forms";
3
- import type { PopsPanelCommonDetails } from "./components-common";
1
+ import type { PopsPanelViewConfig } from ".";
2
+ import type { PopsPanelContainerConfig } from "./components-container";
3
+ import type { PopsPanelGeneralConfig } from "./components-common";
4
4
  /**
5
- * pops.panel的 深层菜单
5
+ * pops.panel的 深层视图的配置
6
6
  */
7
- export interface PopsPanelDeepMenuDetails extends PopsPanelCommonDetails<PopsPanelDeepMenuDetails> {
7
+ export interface PopsPanelDeepViewConfig extends PopsPanelGeneralConfig<PopsPanelDeepViewConfig> {
8
8
  /**
9
9
  * 类型
10
10
  */
@@ -32,25 +32,25 @@ export interface PopsPanelDeepMenuDetails extends PopsPanelCommonDetails<PopsPan
32
32
  * + true 表示阻止进入深层菜单
33
33
  * + false (默认)表示允许进入深层菜单
34
34
  */
35
- clickCallBack?: (event: MouseEvent | PointerEvent, formConfig: PopsPanelDeepMenuDetails) => boolean | void | Promise<boolean | void>;
35
+ clickCallBack?: (event: MouseEvent | PointerEvent, viewConfig: PopsPanelDeepViewConfig) => boolean | void | Promise<boolean | void>;
36
36
  /**
37
37
  * 进入深层菜单后触发的回调
38
- * @param formConfig
38
+ * @param viewConfig
39
39
  */
40
- afterEnterDeepMenuCallBack?: (formConfig: PopsPanelDeepMenuDetails, container: {
40
+ afterEnterDeepMenuCallBack?: (viewConfig: PopsPanelDeepViewConfig, container: {
41
41
  /** 右侧的总容器 */
42
- sectionContainer: HTMLElement;
42
+ $sectionContainer: HTMLElement;
43
43
  /** 右侧的总容器的标题头容器 */
44
- sectionContainerHeaderContainer: HTMLUListElement;
44
+ $sectionContainerHeaderContainer: HTMLUListElement;
45
45
  /** 右侧的总容器的标题头 */
46
- sectionContainerHeader: HTMLLIElement;
46
+ $sectionContainerHeader: HTMLLIElement;
47
47
  /** 右侧的内容容器 */
48
- sectionBodyContainer: HTMLUListElement;
48
+ $sectionBodyContainer: HTMLUListElement;
49
49
  }) => void;
50
50
  /**
51
51
  * 菜单配置
52
52
  */
53
- forms?: (PopsPanelFormsDetails | PopsPanelFormsTotalDetails)[];
53
+ views?: (PopsPanelContainerConfig | PopsPanelViewConfig)[];
54
54
  /**
55
55
  * (可选)头部的标题文字,没有的话默认是text
56
56
  */
@@ -1,8 +1,12 @@
1
- import type { PopsPanelCommonDetails } from "./components-common";
1
+ import type { PopsPanelGeneralConfig } from "./components-common";
2
2
  /**
3
3
  * pops.panel的 input
4
4
  */
5
- export interface PopsPanelInputDetails extends PopsPanelCommonDetails<PopsPanelInputDetails> {
5
+ export interface PopsPanelInputConfig extends PopsPanelGeneralConfig<PopsPanelInputConfig> {
6
+ /**
7
+ * 类型
8
+ */
9
+ type: "input";
6
10
  /**
7
11
  * 显示在左边的文字
8
12
  */
@@ -12,10 +16,6 @@ export interface PopsPanelInputDetails extends PopsPanelCommonDetails<PopsPanelI
12
16
  * @default ""
13
17
  */
14
18
  description?: string;
15
- /**
16
- * 类型
17
- */
18
- type: "input";
19
19
  /**
20
20
  * (可选)是否禁用
21
21
  * @default false
@@ -1,9 +1,9 @@
1
- import type { PopsPanelCommonDetails } from "./components-common";
1
+ import type { PopsPanelGeneralConfig } from "./components-common";
2
2
  /**
3
3
  * pops.panel的 own
4
4
  * 自定义的
5
5
  */
6
- export interface PopsPanelOwnDetails extends PopsPanelCommonDetails<PopsPanelOwnDetails> {
6
+ export interface PopsPanelOwnConfig extends PopsPanelGeneralConfig<PopsPanelOwnConfig> {
7
7
  /**
8
8
  * 类型
9
9
  */
@@ -1,10 +1,14 @@
1
- import type { PopsPanelCommonDetails } from "./components-common";
2
- import type { PopsPanelFormsDetails } from "./components-forms";
3
- import type { PopsPanelFormsTotalDetails } from ".";
1
+ import type { PopsPanelGeneralConfig } from "./components-common";
2
+ import type { PopsPanelContainerConfig } from "./components-container";
3
+ import type { PopsPanelViewConfig } from ".";
4
4
  /**
5
5
  * pops.panel的 select
6
6
  */
7
- export interface PopsPanelSelectDetails<T = any> extends PopsPanelCommonDetails<PopsPanelSelectDetails> {
7
+ export interface PopsPanelSelectConfig<T = any> extends PopsPanelGeneralConfig<PopsPanelSelectConfig> {
8
+ /**
9
+ * 类型
10
+ */
11
+ type: "select";
8
12
  /**
9
13
  * 显示在左边的文字
10
14
  */
@@ -14,10 +18,6 @@ export interface PopsPanelSelectDetails<T = any> extends PopsPanelCommonDetails<
14
18
  * @default ""
15
19
  */
16
20
  description?: string;
17
- /**
18
- * 类型
19
- */
20
- type: "select";
21
21
  /**
22
22
  * (可选)是否禁用
23
23
  * @default false
@@ -62,6 +62,6 @@ export interface PopsPanelSelectDetails<T = any> extends PopsPanelCommonDetails<
62
62
  /**
63
63
  * 子配置,跟随切换改变
64
64
  */
65
- forms?: (PopsPanelFormsDetails | PopsPanelFormsTotalDetails)[] | (() => (PopsPanelFormsDetails | PopsPanelFormsTotalDetails)[]);
65
+ views?: (PopsPanelContainerConfig | PopsPanelViewConfig)[] | (() => (PopsPanelContainerConfig | PopsPanelViewConfig)[]);
66
66
  }[];
67
67
  }
@@ -1,5 +1,5 @@
1
- import type { PopsAlertDetails } from "../../alert/types";
2
- import type { PopsPanelCommonDetails } from "./components-common";
1
+ import type { PopsAlertConfig } from "../../alert/types";
2
+ import type { PopsPanelGeneralConfig } from "./components-common";
3
3
  export interface PopsPanelSelectMultipleDataOption<T> {
4
4
  /**
5
5
  * 真正的值
@@ -31,7 +31,11 @@ export interface PopsPanelSelectMultipleDataOption<T> {
31
31
  /**
32
32
  * pops.panel的 select
33
33
  */
34
- export interface PopsPanelSelectMultipleDetails<T = any> extends PopsPanelCommonDetails<PopsPanelSelectMultipleDetails> {
34
+ export interface PopsPanelSelectMultipleConfig<T = any> extends PopsPanelGeneralConfig<PopsPanelSelectMultipleConfig> {
35
+ /**
36
+ * 类型
37
+ */
38
+ type: "select-multiple";
35
39
  /**
36
40
  * 显示在左边的文字
37
41
  */
@@ -40,10 +44,6 @@ export interface PopsPanelSelectMultipleDetails<T = any> extends PopsPanelCommon
40
44
  * (可选)左边的文字下面的描述
41
45
  */
42
46
  description?: string;
43
- /**
44
- * 类型
45
- */
46
- type: "select-multiple";
47
47
  /**
48
48
  * (可选)是否禁用
49
49
  */
@@ -59,7 +59,7 @@ export interface PopsPanelSelectMultipleDetails<T = any> extends PopsPanelCommon
59
59
  /**
60
60
  * 弹出的下拉列表弹窗的配置
61
61
  */
62
- selectConfirmDialogDetails?: Partial<PopsAlertDetails>;
62
+ selectConfirmDialogConfig?: Partial<PopsAlertConfig>;
63
63
  /**
64
64
  * 选择器的值改变触发的回调函数
65
65
  * @param event 事件
@@ -1,8 +1,13 @@
1
- import type { PopsPanelCommonDetails } from "./components-common";
1
+ import type { PopsPanelGeneralConfig } from "./components-common";
2
2
  /**
3
3
  * pops.panel的 slider
4
4
  */
5
- export interface PopsPanelSliderDetails extends PopsPanelCommonDetails<PopsPanelSliderDetails> {
5
+ export interface PopsPanelSliderConfig extends PopsPanelGeneralConfig<PopsPanelSliderConfig> {
6
+ /**
7
+ * 类型
8
+ * @default "slider"
9
+ */
10
+ type: "slider";
6
11
  /**
7
12
  * 显示在左边的文字
8
13
  */
@@ -12,11 +17,6 @@ export interface PopsPanelSliderDetails extends PopsPanelCommonDetails<PopsPanel
12
17
  * @default ""
13
18
  */
14
19
  description?: string;
15
- /**
16
- * 类型
17
- * @default "slider"
18
- */
19
- type: "slider";
20
20
  /**
21
21
  * (可选)是否禁用
22
22
  * @default false