@whitesev/pops 1.8.2 → 1.8.4

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.
@@ -49,6 +49,20 @@ export interface PopsPanelDeepMenuDetails extends PopsPanelCommonDetails<PopsPan
49
49
  * + false (默认)表示允许进入深层菜单
50
50
  */
51
51
  clickCallBack?: (event: MouseEvent | PointerEvent, formConfig: PopsPanelDeepMenuDetails) => boolean | void | Promise<boolean | void>;
52
+ /**
53
+ * 进入深层菜单后触发的回调
54
+ * @param formConfig
55
+ */
56
+ afterEnterDeepMenuCallBack?: (formConfig: PopsPanelDeepMenuDetails, container: {
57
+ /** 右侧的总容器 */
58
+ sectionContainer: HTMLElement;
59
+ /** 右侧的总容器的标题头容器 */
60
+ sectionContainerHeaderContainer: HTMLUListElement;
61
+ /** 右侧的总容器的标题头 */
62
+ sectionContainerHeader: HTMLDivElement;
63
+ /** 右侧的内容容器 */
64
+ sectionBodyContainer: HTMLUListElement;
65
+ }) => void;
52
66
  /**
53
67
  * 菜单配置
54
68
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whitesev/pops",
3
- "version": "1.8.2",
3
+ "version": "1.8.4",
4
4
  "description": "弹窗库",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
package/src/Pops.ts CHANGED
@@ -83,7 +83,7 @@ class Pops {
83
83
  /** 配置 */
84
84
  config = {
85
85
  /** 版本号 */
86
- version: "2024.11.1",
86
+ version: "2024.11.2",
87
87
  cssText: {
88
88
  /** 主CSS */
89
89
  index: indexCSS,
@@ -2422,7 +2422,7 @@ export const PanelHandleContentDetails = () => {
2422
2422
  "section.pops-panel-container"
2423
2423
  ) as HTMLElement | null;
2424
2424
  if (currentSection) {
2425
- popsDOMUtils.cssHide(currentSection,true);
2425
+ popsDOMUtils.cssHide(currentSection, true);
2426
2426
  }
2427
2427
  // 子菜单的容器
2428
2428
  let $deepMenuContainer = popsDOMUtils.createElement("section", {
@@ -2431,7 +2431,7 @@ export const PanelHandleContentDetails = () => {
2431
2431
  let $deepMenuHeaderUL = popsDOMUtils.createElement("ul", {
2432
2432
  className: "pops-panel-deepMenu-container-header-ul",
2433
2433
  });
2434
- let $deepMenuChildMenuUL = popsDOMUtils.createElement("ul");
2434
+ let $deepMenuBodyUL = popsDOMUtils.createElement("ul");
2435
2435
  // 标题文字
2436
2436
  let headerTitleText = formConfig.headerTitle ?? formConfig.text;
2437
2437
  let $header = popsDOMUtils.createElement("div", {
@@ -2464,15 +2464,24 @@ export const PanelHandleContentDetails = () => {
2464
2464
  );
2465
2465
  $deepMenuHeaderUL.appendChild($header);
2466
2466
  $deepMenuContainer.appendChild($deepMenuHeaderUL);
2467
- $deepMenuContainer.appendChild($deepMenuChildMenuUL);
2467
+ $deepMenuContainer.appendChild($deepMenuBodyUL);
2468
2468
 
2469
2469
  if (formConfig.forms && Array.isArray(formConfig.forms)) {
2470
2470
  for (let index = 0; index < formConfig.forms.length; index++) {
2471
2471
  let formItemConfig = formConfig.forms[index];
2472
- this.initFormItem($deepMenuChildMenuUL, formItemConfig);
2472
+ this.initFormItem($deepMenuBodyUL, formItemConfig);
2473
2473
  }
2474
2474
  }
2475
2475
  that.$el.$content?.appendChild($deepMenuContainer);
2476
+
2477
+ if (typeof formConfig.afterEnterDeepMenuCallBack === "function") {
2478
+ formConfig.afterEnterDeepMenuCallBack(formConfig, {
2479
+ sectionContainer: $deepMenuContainer,
2480
+ sectionContainerHeaderContainer: $deepMenuHeaderUL,
2481
+ sectionContainerHeader: $header,
2482
+ sectionBodyContainer: $deepMenuBodyUL,
2483
+ });
2484
+ }
2476
2485
  },
2477
2486
  /** 设置项的点击事件 */
2478
2487
  setLiClickEvent() {
@@ -53,6 +53,23 @@ export interface PopsPanelDeepMenuDetails
53
53
  event: MouseEvent | PointerEvent,
54
54
  formConfig: PopsPanelDeepMenuDetails
55
55
  ) => boolean | void | Promise<boolean | void>;
56
+ /**
57
+ * 进入深层菜单后触发的回调
58
+ * @param formConfig
59
+ */
60
+ afterEnterDeepMenuCallBack?: (
61
+ formConfig: PopsPanelDeepMenuDetails,
62
+ container: {
63
+ /** 右侧的总容器 */
64
+ sectionContainer: HTMLElement;
65
+ /** 右侧的总容器的标题头容器 */
66
+ sectionContainerHeaderContainer: HTMLUListElement;
67
+ /** 右侧的总容器的标题头 */
68
+ sectionContainerHeader: HTMLDivElement;
69
+ /** 右侧的内容容器 */
70
+ sectionBodyContainer: HTMLUListElement;
71
+ }
72
+ ) => void;
56
73
  /**
57
74
  * 菜单配置
58
75
  */
@@ -78,6 +78,7 @@ aside.pops-panel-aside {
78
78
  box-sizing: border-box;
79
79
  flex-shrink: 0;
80
80
  max-width: 200px;
81
+ min-width: 100px;
81
82
  height: 100%;
82
83
  background: var(--aside-bg-color);
83
84
  border-right: 1px solid var(--aside-bg-color);
@@ -271,6 +272,7 @@ section.pops-panel-container
271
272
  }
272
273
  .pops[type-value="panel"] .pops-panel-content aside.pops-panel-aside {
273
274
  max-width: 20%;
275
+ min-width: auto;
274
276
  }
275
277
  .pops[type-value="panel"]
276
278
  section.pops-panel-container