@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
@@ -722,6 +722,8 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
722
722
  flex-shrink: 0;
723
723
  flex-wrap: nowrap;
724
724
  height: 100%;
725
+ height: -webkit-fill-available;
726
+ height: -moz-available;
725
727
  text-align: center;
726
728
  color: var(--pops-panel-components-input-suffix-color);
727
729
  background: var(--pops-panel-components-input-suffix-bg-color);
@@ -750,11 +752,13 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
750
752
  .pops-panel-input:active span.pops-panel-input__suffix:has(svg[data-type="circleClose"]) {
751
753
  display: inline-flex;
752
754
  }
753
- /* 当清空图标显示时,则隐藏输入框的padding-right */
755
+ /* 当清空图标显示时或查看图标存在时,则隐藏输入框的padding-right */
754
756
  .pops-panel-input:hover:has(span.pops-panel-input__suffix svg[data-type="circleClose"]) input,
755
757
  .pops-panel-input:focus:has(span.pops-panel-input__suffix svg[data-type="circleClose"]) input,
756
758
  .pops-panel-input:focus-within:has(span.pops-panel-input__suffix svg[data-type="circleClose"]) input,
757
- .pops-panel-input:active:has(span.pops-panel-input__suffix svg[data-type="circleClose"]) input {
759
+ .pops-panel-input:active:has(span.pops-panel-input__suffix svg[data-type="circleClose"]) input,
760
+ .pops-panel-input:has(span.pops-panel-input__suffix svg[data-type="view"]) input,
761
+ .pops-panel-input:has(span.pops-panel-input__suffix svg[data-type="hide"]) input {
758
762
  padding-right: 0;
759
763
  }
760
764
  .pops-panel-input .pops-panel-icon {
@@ -1001,10 +1005,14 @@ section.pops-panel-container .pops-panel-slider input[type="range"]::-moz-range-
1001
1005
  .pops-panel-select-multiple .el-select__caret {
1002
1006
  color: var(--el-select-input-color);
1003
1007
  font-size: var(--el-select-input-font-size);
1004
- transition: var(--el-transition-duration);
1008
+ transition: transform var(--el-transition-duration);
1005
1009
  transform: rotate(0);
1006
1010
  cursor: pointer;
1007
1011
  }
1012
+ /* 把箭头旋转 */
1013
+ .pops-panel-select-multiple[data-show-option] .el-select__caret {
1014
+ transform: rotate(180deg);
1015
+ }
1008
1016
  .pops-panel-select-multiple .el-tag {
1009
1017
  --el-tag-font-size: 12px;
1010
1018
  --el-tag-border-radius: 4px;
@@ -3,35 +3,22 @@ import { PopsHandler } from "../../handler/PopsHandler";
3
3
  import { popsDOMUtils } from "../../utils/PopsDOMUtils";
4
4
  import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
5
5
  import { popsUtils } from "../../utils/PopsUtils";
6
- import type { PopsPanelDetails, PopsPanelEventType } from "./types";
7
- import { PopsPanelConfig } from "./config";
6
+ import type { PopsPanelConfig, PopsPanelEventType } from "./types";
7
+ import { PopsPanelDefaultConfig } from "./defaultConfig";
8
8
  import { PanelHandlerComponents } from "./handlerComponents";
9
9
  import { GlobalConfig } from "../../config/GlobalConfig";
10
10
  import { PopsCSS } from "../../PopsCSS";
11
11
  import type { PopsType } from "../../types/main";
12
12
 
13
13
  export const PopsPanel = {
14
- init(details: PopsPanelDetails) {
14
+ init(__config__: PopsPanelConfig) {
15
15
  const guid = popsUtils.getRandomGUID();
16
16
  // 设置当前类型
17
17
  const popsType: PopsType = "panel";
18
18
 
19
- let config: Required<PopsPanelDetails> = PopsPanelConfig();
19
+ let config: Required<PopsPanelConfig> = PopsPanelDefaultConfig();
20
20
  config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
21
- config = popsUtils.assign(config, details);
22
- if (details) {
23
- if (Array.isArray(details.content)) {
24
- // 存在内容配置
25
- config.content = details.content;
26
- }
27
- if (Array.isArray(details.bottomContentConfig)) {
28
- // 存在底部配置
29
- config.bottomContentConfig = details.bottomContentConfig;
30
- } else {
31
- // 不存在底部配置 清空默认的
32
- config.bottomContentConfig = [];
33
- }
34
- }
21
+ config = popsUtils.assign(config, __config__);
35
22
  config = PopsHandler.handleOnly(popsType, config);
36
23
 
37
24
  const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
@@ -109,7 +96,7 @@ export const PopsPanel = {
109
96
  * 弹窗的主元素,包括动画层
110
97
  */
111
98
  const $anim = PopsElementHandler.parseElement<HTMLDivElement>(animHTML);
112
- /* 结构元素 */
99
+ // 结构元素
113
100
  const {
114
101
  $pops,
115
102
  $headerBtnClose,
@@ -135,7 +122,7 @@ export const PopsPanel = {
135
122
  */
136
123
  const $elList: HTMLElement[] = [$anim];
137
124
 
138
- /* 遮罩层元素 */
125
+ // 遮罩层元素
139
126
  if (config.mask.enable) {
140
127
  const handleMask = PopsHandler.handleMask({
141
128
  type: popsType,
@@ -148,7 +135,7 @@ export const PopsPanel = {
148
135
  $elList.push($mask);
149
136
  }
150
137
 
151
- /* 处理返回的配置 */
138
+ // 处理返回的配置
152
139
  const evtConfig = PopsHandler.handleEventConfig(
153
140
  config,
154
141
  guid,
@@ -159,16 +146,16 @@ export const PopsPanel = {
159
146
  $pops,
160
147
  $mask
161
148
  );
162
- /* 为顶部右边的关闭按钮添加点击事件 */
149
+ // 为顶部右边的关闭按钮添加点击事件
163
150
  PopsHandler.handleClickEvent("close", $headerBtnClose, evtConfig, config.btn?.close?.callback);
164
151
 
165
- /* 创建到页面中 */
152
+ // 创建到页面中
166
153
  popsDOMUtils.append($shadowRoot, $elList);
167
154
  if (typeof config.beforeAppendToPageCallBack === "function") {
168
155
  config.beforeAppendToPageCallBack($shadowRoot, $shadowContainer);
169
156
  }
170
157
  popsDOMUtils.appendBody($shadowContainer);
171
- /* 追加遮罩层元素 */
158
+ // 追加遮罩层元素
172
159
  if ($mask != null) {
173
160
  $anim.after($mask);
174
161
  }
@@ -193,13 +180,13 @@ export const PopsPanel = {
193
180
 
194
181
  PopsHandler.handlePush(popsType, {
195
182
  guid: guid,
196
- animElement: $anim,
197
- popsElement: $pops,
198
- maskElement: $mask!,
183
+ $anim: $anim,
184
+ $pops: $pops,
185
+ $mask: $mask!,
199
186
  $shadowContainer: $shadowContainer,
200
187
  $shadowRoot: $shadowRoot,
201
188
  });
202
- /* 拖拽 */
189
+ // 拖拽
203
190
  if (config.drag) {
204
191
  PopsInstanceUtils.drag($pops, {
205
192
  dragElement: $title,
@@ -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,10 +1,10 @@
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
6
  */
7
- export interface PopsPanelRightAsideContainerOptions {
7
+ export interface PopsPanelRightAsideContainerConfig {
8
8
  /** 当前的<li>元素 */
9
9
  target: HTMLLIElement | undefined;
10
10
  /** 当前的<li>元素的父<ul>元素 */
@@ -19,7 +19,7 @@ export interface PopsPanelRightAsideContainerOptions {
19
19
  /**
20
20
  * 通用配置
21
21
  */
22
- export interface PopsPanelCommonDetails<T extends PopsPanelFormsTotalDetails | PopsPanelFormsDetails> {
22
+ export interface PopsPanelGeneralConfig<T extends PopsPanelViewConfig | PopsPanelContainerConfig> {
23
23
  /**
24
24
  * (可选)元素的className,值为空的话就不设置
25
25
  * @default ""
@@ -45,11 +45,11 @@ export interface PopsPanelCommonDetails<T extends PopsPanelFormsTotalDetails | P
45
45
  };
46
46
  /**
47
47
  * 在添加到<ul>元素后触发该回调
48
- * @param formConfig 配置
48
+ * @param viewConfig 配置
49
49
  * @param container 右侧容器的元素
50
50
  * @example
51
51
  * // 例如在type为own时
52
- * afterAddToUListCallBack(formConfig, container) {
52
+ * afterAddToUListCallBack(viewConfig, container) {
53
53
  * DOMUtils.on(
54
54
  container.formHeaderDivElement.querySelector(
55
55
  "a"
@@ -69,5 +69,5 @@ export interface PopsPanelCommonDetails<T extends PopsPanelFormsTotalDetails | P
69
69
  * // 例如在type为forms时
70
70
  * container内只有container.ulElement这个属性
71
71
  */
72
- afterAddToUListCallBack?: (formConfig: T, container: PopsPanelRightAsideContainerOptions) => void;
72
+ afterAddToUListCallBack?: (viewConfig: T, container: PopsPanelRightAsideContainerConfig) => void;
73
73
  }
@@ -0,0 +1,25 @@
1
+ import type { PopsPanelGeneralConfig } from "./components-common";
2
+ import type { PopsPanelViewConfig } from ".";
3
+
4
+ /**
5
+ * pops.panel的 container
6
+ */
7
+ export interface PopsPanelContainerConfig extends PopsPanelGeneralConfig<PopsPanelContainerConfig> {
8
+ /**
9
+ * 类型
10
+ */
11
+ type: "container";
12
+ /**
13
+ * 显示在左边的文字
14
+ */
15
+ text: string;
16
+ /**
17
+ * 是否进行折叠
18
+ * @default false
19
+ */
20
+ isFold?: boolean;
21
+ /**
22
+ * 子配置
23
+ */
24
+ views: PopsPanelViewConfig[];
25
+ }
@@ -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
  */
@@ -34,29 +34,29 @@ export interface PopsPanelDeepMenuDetails extends PopsPanelCommonDetails<PopsPan
34
34
  */
35
35
  clickCallBack?: (
36
36
  event: MouseEvent | PointerEvent,
37
- formConfig: PopsPanelDeepMenuDetails
37
+ viewConfig: PopsPanelDeepViewConfig
38
38
  ) => boolean | void | Promise<boolean | void>;
39
39
  /**
40
40
  * 进入深层菜单后触发的回调
41
- * @param formConfig
41
+ * @param viewConfig
42
42
  */
43
43
  afterEnterDeepMenuCallBack?: (
44
- formConfig: PopsPanelDeepMenuDetails,
44
+ viewConfig: PopsPanelDeepViewConfig,
45
45
  container: {
46
46
  /** 右侧的总容器 */
47
- sectionContainer: HTMLElement;
47
+ $sectionContainer: HTMLElement;
48
48
  /** 右侧的总容器的标题头容器 */
49
- sectionContainerHeaderContainer: HTMLUListElement;
49
+ $sectionContainerHeaderContainer: HTMLUListElement;
50
50
  /** 右侧的总容器的标题头 */
51
- sectionContainerHeader: HTMLLIElement;
51
+ $sectionContainerHeader: HTMLLIElement;
52
52
  /** 右侧的内容容器 */
53
- sectionBodyContainer: HTMLUListElement;
53
+ $sectionBodyContainer: HTMLUListElement;
54
54
  }
55
55
  ) => void;
56
56
  /**
57
57
  * 菜单配置
58
58
  */
59
- forms?: (PopsPanelFormsDetails | PopsPanelFormsTotalDetails)[];
59
+ views?: (PopsPanelContainerConfig | PopsPanelViewConfig)[];
60
60
  /**
61
61
  * (可选)头部的标题文字,没有的话默认是text
62
62
  */
@@ -1,9 +1,13 @@
1
- import type { PopsPanelCommonDetails } from "./components-common";
1
+ import type { PopsPanelGeneralConfig } from "./components-common";
2
2
 
3
3
  /**
4
4
  * pops.panel的 input
5
5
  */
6
- export interface PopsPanelInputDetails extends PopsPanelCommonDetails<PopsPanelInputDetails> {
6
+ export interface PopsPanelInputConfig extends PopsPanelGeneralConfig<PopsPanelInputConfig> {
7
+ /**
8
+ * 类型
9
+ */
10
+ type: "input";
7
11
  /**
8
12
  * 显示在左边的文字
9
13
  */
@@ -13,10 +17,6 @@ export interface PopsPanelInputDetails extends PopsPanelCommonDetails<PopsPanelI
13
17
  * @default ""
14
18
  */
15
19
  description?: string;
16
- /**
17
- * 类型
18
- */
19
- type: "input";
20
20
  /**
21
21
  * (可选)是否禁用
22
22
  * @default false
@@ -1,10 +1,10 @@
1
- import type { PopsPanelCommonDetails } from "./components-common";
1
+ import type { PopsPanelGeneralConfig } from "./components-common";
2
2
 
3
3
  /**
4
4
  * pops.panel的 own
5
5
  * 自定义的
6
6
  */
7
- export interface PopsPanelOwnDetails extends PopsPanelCommonDetails<PopsPanelOwnDetails> {
7
+ export interface PopsPanelOwnConfig extends PopsPanelGeneralConfig<PopsPanelOwnConfig> {
8
8
  /**
9
9
  * 类型
10
10
  */
@@ -1,11 +1,15 @@
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
  /**
6
6
  * pops.panel的 select
7
7
  */
8
- export interface PopsPanelSelectDetails<T = any> extends PopsPanelCommonDetails<PopsPanelSelectDetails> {
8
+ export interface PopsPanelSelectConfig<T = any> extends PopsPanelGeneralConfig<PopsPanelSelectConfig> {
9
+ /**
10
+ * 类型
11
+ */
12
+ type: "select";
9
13
  /**
10
14
  * 显示在左边的文字
11
15
  */
@@ -15,10 +19,6 @@ export interface PopsPanelSelectDetails<T = any> extends PopsPanelCommonDetails<
15
19
  * @default ""
16
20
  */
17
21
  description?: string;
18
- /**
19
- * 类型
20
- */
21
- type: "select";
22
22
  /**
23
23
  * (可选)是否禁用
24
24
  * @default false
@@ -63,8 +63,8 @@ export interface PopsPanelSelectDetails<T = any> extends PopsPanelCommonDetails<
63
63
  /**
64
64
  * 子配置,跟随切换改变
65
65
  */
66
- forms?:
67
- | (PopsPanelFormsDetails | PopsPanelFormsTotalDetails)[]
68
- | (() => (PopsPanelFormsDetails | PopsPanelFormsTotalDetails)[]);
66
+ views?:
67
+ | (PopsPanelContainerConfig | PopsPanelViewConfig)[]
68
+ | (() => (PopsPanelContainerConfig | PopsPanelViewConfig)[]);
69
69
  }[];
70
70
  }
@@ -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
 
4
4
  export interface PopsPanelSelectMultipleDataOption<T> {
5
5
  /**
@@ -35,8 +35,11 @@ export interface PopsPanelSelectMultipleDataOption<T> {
35
35
  /**
36
36
  * pops.panel的 select
37
37
  */
38
- export interface PopsPanelSelectMultipleDetails<T = any>
39
- extends PopsPanelCommonDetails<PopsPanelSelectMultipleDetails> {
38
+ export interface PopsPanelSelectMultipleConfig<T = any> extends PopsPanelGeneralConfig<PopsPanelSelectMultipleConfig> {
39
+ /**
40
+ * 类型
41
+ */
42
+ type: "select-multiple";
40
43
  /**
41
44
  * 显示在左边的文字
42
45
  */
@@ -45,10 +48,6 @@ export interface PopsPanelSelectMultipleDetails<T = any>
45
48
  * (可选)左边的文字下面的描述
46
49
  */
47
50
  description?: string;
48
- /**
49
- * 类型
50
- */
51
- type: "select-multiple";
52
51
  /**
53
52
  * (可选)是否禁用
54
53
  */
@@ -64,7 +63,7 @@ export interface PopsPanelSelectMultipleDetails<T = any>
64
63
  /**
65
64
  * 弹出的下拉列表弹窗的配置
66
65
  */
67
- selectConfirmDialogDetails?: Partial<PopsAlertDetails>;
66
+ selectConfirmDialogConfig?: Partial<PopsAlertConfig>;
68
67
  /**
69
68
  * 选择器的值改变触发的回调函数
70
69
  * @param event 事件
@@ -1,9 +1,14 @@
1
- import type { PopsPanelCommonDetails } from "./components-common";
1
+ import type { PopsPanelGeneralConfig } from "./components-common";
2
2
 
3
3
  /**
4
4
  * pops.panel的 slider
5
5
  */
6
- export interface PopsPanelSliderDetails extends PopsPanelCommonDetails<PopsPanelSliderDetails> {
6
+ export interface PopsPanelSliderConfig extends PopsPanelGeneralConfig<PopsPanelSliderConfig> {
7
+ /**
8
+ * 类型
9
+ * @default "slider"
10
+ */
11
+ type: "slider";
7
12
  /**
8
13
  * 显示在左边的文字
9
14
  */
@@ -13,11 +18,6 @@ export interface PopsPanelSliderDetails extends PopsPanelCommonDetails<PopsPanel
13
18
  * @default ""
14
19
  */
15
20
  description?: string;
16
- /**
17
- * 类型
18
- * @default "slider"
19
- */
20
- type: "slider";
21
21
  /**
22
22
  * (可选)是否禁用
23
23
  * @default false
@@ -1,9 +1,13 @@
1
- import type { PopsPanelCommonDetails } from "./components-common";
1
+ import type { PopsPanelGeneralConfig } from "./components-common";
2
2
 
3
3
  /**
4
4
  * pops.panel的 switch
5
5
  */
6
- export interface PopsPanelSwitchDetails extends PopsPanelCommonDetails<PopsPanelSwitchDetails> {
6
+ export interface PopsPanelSwitchConfig extends PopsPanelGeneralConfig<PopsPanelSwitchConfig> {
7
+ /**
8
+ * 类型
9
+ */
10
+ type: "switch";
7
11
  /**
8
12
  * 显示在左边的文字
9
13
  */
@@ -13,10 +17,6 @@ export interface PopsPanelSwitchDetails extends PopsPanelCommonDetails<PopsPanel
13
17
  * @default ""
14
18
  */
15
19
  description?: string;
16
- /**
17
- * 类型
18
- */
19
- type: "switch";
20
20
  /**
21
21
  * (可选)是否禁用
22
22
  * @default false
@@ -1,9 +1,13 @@
1
- import type { PopsPanelCommonDetails } from "./components-common";
1
+ import type { PopsPanelGeneralConfig } from "./components-common";
2
2
 
3
3
  /**
4
4
  * pops.panel的 textarea
5
5
  */
6
- export interface PopsPanelTextAreaDetails extends PopsPanelCommonDetails<PopsPanelTextAreaDetails> {
6
+ export interface PopsPanelTextAreaConfig extends PopsPanelGeneralConfig<PopsPanelTextAreaConfig> {
7
+ /**
8
+ * 类型
9
+ */
10
+ type: "textarea";
7
11
  /**
8
12
  * 显示在左边的文字
9
13
  */
@@ -13,10 +17,6 @@ export interface PopsPanelTextAreaDetails extends PopsPanelCommonDetails<PopsPan
13
17
  * @default ""
14
18
  */
15
19
  description?: string;
16
- /**
17
- * 类型
18
- */
19
- type: "textarea";
20
20
  /**
21
21
  * (可选)是否禁用
22
22
  * @default false
@@ -1,29 +1,34 @@
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
-
15
- /** panel的各种类型的配置项 */
16
- export type PopsPanelFormsTotalDetails =
17
- | PopsPanelSwitchDetails
18
- | PopsPanelSliderDetails
19
- | PopsPanelInputDetails
20
- | PopsPanelTextAreaDetails
21
- | PopsPanelSelectDetails<any>
22
- | PopsPanelSelectMultipleDetails<any>
23
- | PopsPanelButtonDetails
24
- | PopsPanelDeepMenuDetails
25
- | 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";
26
14
 
15
+ /**
16
+ * panel的各种类型的配置项(不包括type="container"类型的)
17
+ */
18
+ export type PopsPanelViewConfig =
19
+ | PopsPanelSwitchConfig
20
+ | PopsPanelSliderConfig
21
+ | PopsPanelInputConfig
22
+ | PopsPanelTextAreaConfig
23
+ | PopsPanelSelectConfig<any>
24
+ | PopsPanelSelectMultipleConfig<any>
25
+ | PopsPanelButtonConfig
26
+ | PopsPanelDeepViewConfig
27
+ | PopsPanelOwnConfig;
28
+ /**
29
+ * panel的views配置项
30
+ */
31
+ export type PopsPanelMainViewConfig = PopsPanelViewConfig | PopsPanelContainerConfig;
27
32
  /**
28
33
  * panel的内部事件
29
34
  */
@@ -33,9 +38,9 @@ export type PopsPanelEventType = {
33
38
  */
34
39
  "pops:renderRightContainer": {
35
40
  /**
36
- * 菜单配置
41
+ * 视图配置
37
42
  */
38
- formConfig: PopsPanelContentConfig[] | PopsPanelDeepMenuDetails;
43
+ viewConfig: PopsPanelContentConfig[] | PopsPanelDeepViewConfig;
39
44
  };
40
45
  };
41
46
 
@@ -51,7 +56,7 @@ export interface PopsPanelContentConfig {
51
56
  * (可选)元素的className,值为空的话就不设置
52
57
  * @default ""
53
58
  */
54
- className?: PopsPanelCommonDetails<any>["className"];
59
+ className?: PopsPanelGeneralConfig<any>["className"];
55
60
  /**
56
61
  * 显示的文本,可以是html格式
57
62
  */
@@ -84,16 +89,18 @@ export interface PopsPanelContentConfig {
84
89
  scrollToDefaultView?: boolean;
85
90
  /**
86
91
  * (可选)自定义元素属性.setAttribute、.getAttribute
92
+ * @default {}
87
93
  */
88
- attributes?: PopsPanelCommonDetails<any>["attributes"];
94
+ attributes?: PopsPanelGeneralConfig<any>["attributes"];
89
95
  /**
90
96
  * (可选)自定义元素内部的属性值
97
+ * @default {}
91
98
  */
92
- props?: PopsPanelCommonDetails<any>["props"];
99
+ props?: PopsPanelGeneralConfig<any>["props"];
93
100
  /**
94
- * 子配置
101
+ * 视图配置
95
102
  */
96
- forms: (PopsPanelFormsDetails | PopsPanelFormsTotalDetails)[];
103
+ views: PopsPanelMainViewConfig[];
97
104
  /**
98
105
  * 左侧容器的点击回调(点击后第一个触发该回调)
99
106
  * @returns
@@ -138,7 +145,7 @@ export interface PopsPanelBottomContentConfig {
138
145
  * (可选)元素的className,值为空的话就不设置
139
146
  * @default ""
140
147
  */
141
- className?: PopsPanelCommonDetails<any>["className"];
148
+ className?: PopsPanelGeneralConfig<any>["className"];
142
149
  /**
143
150
  * (可选)配置所在位置
144
151
  *
@@ -158,12 +165,12 @@ export interface PopsPanelBottomContentConfig {
158
165
  * (可选)自定义元素属性.setAttribute、.getAttribute
159
166
  * @default {}
160
167
  */
161
- attributes?: PopsPanelCommonDetails<any>["attributes"];
168
+ attributes?: PopsPanelGeneralConfig<any>["attributes"];
162
169
  /**
163
170
  * (可选)自定义元素内部的属性值
164
171
  * @default {}
165
172
  */
166
- props?: PopsPanelCommonDetails<any>["props"];
173
+ props?: PopsPanelGeneralConfig<any>["props"];
167
174
  /**
168
175
  * 该项的点击回调
169
176
  */
@@ -196,7 +203,7 @@ export interface PopsPanelBottomContentConfig {
196
203
  /**
197
204
  * pops.panel
198
205
  */
199
- export interface PopsPanelDetails extends PopsTitleConfig, PopsDragConfig, PopsCommonConfig {
206
+ export interface PopsPanelConfig extends PopsTitleConfig, PopsDragConfig, PopsGeneralConfig {
200
207
  /**
201
208
  * 内容配置
202
209
  */
@@ -212,14 +219,14 @@ export interface PopsPanelDetails extends PopsTitleConfig, PopsDragConfig, PopsC
212
219
  /**
213
220
  * 关闭按钮
214
221
  */
215
- close?: PopsHeaderCloseButtonDetails;
222
+ close?: PopsHeaderCloseButtonConfig;
216
223
  };
217
224
  /**
218
225
  * 移动端适配的的className
219
226
  *
220
227
  * @default "pops-panel-is-mobile"
221
228
  */
222
- mobileClassName?: PopsPanelCommonDetails<any>["className"];
229
+ mobileClassName?: PopsPanelGeneralConfig<any>["className"];
223
230
  /**
224
231
  * 是否强制是移动端,默认false
225
232
  * + true 强制为移动端