@whitesev/pops 2.1.2 → 2.1.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.
Files changed (35) hide show
  1. package/dist/index.amd.js +183 -165
  2. package/dist/index.amd.js.map +1 -1
  3. package/dist/index.cjs.js +183 -165
  4. package/dist/index.cjs.js.map +1 -1
  5. package/dist/index.esm.js +183 -165
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/index.iife.js +183 -165
  8. package/dist/index.iife.js.map +1 -1
  9. package/dist/index.system.js +183 -165
  10. package/dist/index.system.js.map +1 -1
  11. package/dist/index.umd.js +183 -165
  12. package/dist/index.umd.js.map +1 -1
  13. package/dist/types/src/Pops.d.ts +24 -7
  14. package/dist/types/src/components/panel/PanelHandleContentDetails.d.ts +23 -15
  15. package/dist/types/src/components/panel/index.d.ts +16 -2
  16. package/dist/types/src/components/panel/indexType.d.ts +14 -0
  17. package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +1 -1
  18. package/dist/types/src/types/button.d.ts +3 -2
  19. package/dist/types/src/types/event.d.ts +3 -2
  20. package/dist/types/src/types/global.d.ts +4 -4
  21. package/dist/types/src/types/main.d.ts +8 -0
  22. package/dist/types/src/types/mask.d.ts +8 -0
  23. package/package.json +9 -10
  24. package/src/Pops.ts +1 -1
  25. package/src/components/folder/index.css +1 -1
  26. package/src/components/panel/PanelHandleContentDetails.ts +270 -244
  27. package/src/components/panel/index.ts +20 -2
  28. package/src/components/panel/indexType.ts +16 -0
  29. package/src/types/PopsDOMUtilsEventType.d.ts +1 -1
  30. package/src/types/button.d.ts +3 -2
  31. package/src/types/event.d.ts +3 -2
  32. package/src/types/global.d.ts +4 -4
  33. package/src/types/main.d.ts +8 -0
  34. package/src/types/mask.d.ts +8 -0
  35. package/src/utils/PopsUtils.ts +1 -4
@@ -212,16 +212,18 @@ declare class Pops {
212
212
  sectionContainerHeaderULElement: HTMLUListElement;
213
213
  sectionContainerULElement: HTMLUListElement;
214
214
  $el: {
215
- $content: HTMLDivElement;
216
- $contentAside: HTMLDivElement;
217
- $contentSectionContainer: HTMLDivElement;
215
+ $pops: HTMLElement;
216
+ $content: HTMLElement;
217
+ $contentAside: HTMLElement;
218
+ $contentSectionContainer: HTMLElement;
218
219
  };
219
220
  init(details: {
220
221
  config: Required<PopsPanelDetails>;
221
222
  $el: {
222
- $content: HTMLDivElement;
223
- $contentAside: HTMLDivElement;
224
- $contentSectionContainer: HTMLDivElement;
223
+ $pops: HTMLElement;
224
+ $content: HTMLElement;
225
+ $contentAside: HTMLElement;
226
+ $contentSectionContainer: HTMLElement;
225
227
  };
226
228
  }): void;
227
229
  clearContainer(): void;
@@ -243,6 +245,7 @@ declare class Pops {
243
245
  createSectionContainerItem_own(formConfig: import("./components/panel/ownType").PopsPanelOwnDetails): HTMLLIElement;
244
246
  createSectionContainerItem(formConfig: import("./components/panel/indexType").PopsPanelFormsTotalDetails): HTMLLIElement | undefined;
245
247
  createSectionContainerItem_forms(formConfig: import("./components/panel/indexType").PopsPanelContentConfig | import("./components/panel/formsType").PopsPanelFormsDetails): void;
248
+ triggerRenderRightContainer($container: HTMLElement): void;
246
249
  uListContainerAddItem(formConfig: import("./components/panel/indexType").PopsPanelFormsTotalDetails, containerOptions: Omit<import("./components/panel/commonType").PopsPanelRightAsideContainerOptions, "target">): void;
247
250
  setAsideItemClickEvent(asideLiElement: HTMLElement, asideConfig: import("./components/panel/indexType").PopsPanelContentConfig): void;
248
251
  };
@@ -381,7 +384,21 @@ declare class Pops {
381
384
  * 配置面板
382
385
  * @param details 配置
383
386
  */
384
- panel: (details: PopsPanelDetails) => Omit<import("./types/event").PopsEventDetails, "function" | "type">;
387
+ panel: (details: PopsPanelDetails) => {
388
+ addEventListener: <K extends keyof import("./components/panel/indexType").PopsPanelEventType>(event: K, listener: (evt: CustomEvent<import("./components/panel/indexType").PopsPanelEventType[K]>) => void, options?: boolean | EventListenerOptions) => void;
389
+ removeEventListener: <K extends keyof import("./components/panel/indexType").PopsPanelEventType>(event: K, listener: (evt: CustomEvent<import("./components/panel/indexType").PopsPanelEventType[K]>) => void, options?: boolean | EventListenerOptions) => void;
390
+ close: () => Promise<void>;
391
+ hide: () => Promise<void>;
392
+ show: () => Promise<void>;
393
+ guid: string;
394
+ $shadowContainer: HTMLDivElement;
395
+ $shadowRoot: ShadowRoot | HTMLElement;
396
+ element: HTMLDivElement;
397
+ animElement: HTMLDivElement;
398
+ popsElement: HTMLDivElement;
399
+ maskElement?: HTMLDivElement | undefined;
400
+ mode: import("./types/main").PopsMode;
401
+ };
385
402
  /**
386
403
  * 右键菜单
387
404
  * @param details 配置
@@ -27,12 +27,14 @@ export declare const PanelHandleContentDetails: () => {
27
27
  * 元素
28
28
  */
29
29
  $el: {
30
+ /** pops主元素 */
31
+ $pops: HTMLElement;
30
32
  /** 内容 */
31
- $content: HTMLDivElement;
33
+ $content: HTMLElement;
32
34
  /** 左侧容器 */
33
- $contentAside: HTMLDivElement;
35
+ $contentAside: HTMLElement;
34
36
  /** 右侧容器 */
35
- $contentSectionContainer: HTMLDivElement;
37
+ $contentSectionContainer: HTMLElement;
36
38
  };
37
39
  /**
38
40
  * 初始化
@@ -41,9 +43,10 @@ export declare const PanelHandleContentDetails: () => {
41
43
  init(details: {
42
44
  config: Required<PopsPanelDetails>;
43
45
  $el: {
44
- $content: HTMLDivElement;
45
- $contentAside: HTMLDivElement;
46
- $contentSectionContainer: HTMLDivElement;
46
+ $pops: HTMLElement;
47
+ $content: HTMLElement;
48
+ $contentAside: HTMLElement;
49
+ $contentSectionContainer: HTMLElement;
47
50
  };
48
51
  }): void;
49
52
  /**
@@ -83,61 +86,62 @@ export declare const PanelHandleContentDetails: () => {
83
86
  */
84
87
  createAsideItem(asideConfig: PopsPanelContentConfig): HTMLLIElement;
85
88
  /**
86
- * 创建中间容器的元素<li>
87
89
  * type ==> switch
90
+ * 创建中间容器的元素<li>
88
91
  * @param formConfig
89
92
  */
90
93
  createSectionContainerItem_switch(formConfig: PopsPanelSwitchDetails): HTMLLIElement;
91
94
  /**
92
- * 获取中间容器的元素<li>
93
95
  * type ==> slider
96
+ * 获取中间容器的元素<li>
94
97
  * @param formConfig
95
98
  */
96
99
  createSectionContainerItem_slider(formConfig: PopsPanelSliderDetails): HTMLLIElement;
97
100
  /**
98
- * 获取中间容器的元素<li>
99
101
  * type ==> slider
102
+ * 获取中间容器的元素<li>
100
103
  * @param formConfig
101
104
  */
102
105
  createSectionContainerItem_slider_new(formConfig: PopsPanelSliderDetails): HTMLLIElement;
103
106
  /**
104
- * 获取中间容器的元素<li>
105
107
  * type ==> input
108
+ * 获取中间容器的元素<li>
106
109
  * @param formConfig
107
110
  */
108
111
  createSectionContainerItem_input(formConfig: PopsPanelInputDetails): HTMLLIElement;
109
112
  /**
110
- * 获取中间容器的元素<li>
111
113
  * type ==> textarea
114
+ * 获取中间容器的元素<li>
112
115
  * @param formConfig
113
116
  */
114
117
  createSectionContainerItem_textarea(formConfig: PopsPanelTextAreaDetails): HTMLLIElement;
115
118
  /**
116
- * 获取中间容器的元素<li>
117
119
  * type ==> select
120
+ * 获取中间容器的元素<li>
118
121
  * @param formConfig
119
122
  */
120
123
  createSectionContainerItem_select(formConfig: PopsPanelSelectDetails<any>): HTMLLIElement;
121
124
  /**
122
- * 获取中间容器的元素<li>
123
125
  * type ==> select-multiple
126
+ * 获取中间容器的元素<li>
124
127
  * @param formConfig
125
128
  */
126
129
  createSectionContainerItem_select_multiple_new(formConfig: PopsPanelSelectMultipleDetails<any>): HTMLLIElement;
127
130
  /**
128
- * 获取中间容器的元素<li>
129
131
  * type ==> button
132
+ * 获取中间容器的元素<li>
130
133
  * @param formConfig
131
134
  */
132
135
  createSectionContainerItem_button(formConfig: PopsPanelButtonDetails): HTMLLIElement;
133
136
  /**
137
+ * type ==> deepMenu
134
138
  * 获取深层容器的元素<li>
135
139
  * @param formConfig
136
140
  */
137
141
  createSectionContainerItem_deepMenu(formConfig: PopsPanelDeepMenuDetails): HTMLLIElement;
138
142
  /**
139
- * 获取中间容器的元素<li>
140
143
  * type ===> own
144
+ * 获取中间容器的元素<li>
141
145
  * @param formConfig
142
146
  */
143
147
  createSectionContainerItem_own(formConfig: PopsPanelOwnDetails): HTMLLIElement;
@@ -152,6 +156,10 @@ export declare const PanelHandleContentDetails: () => {
152
156
  * @param formConfig
153
157
  */
154
158
  createSectionContainerItem_forms(formConfig: PopsPanelContentConfig | PopsPanelFormsDetails): void;
159
+ /**
160
+ * 触发触发渲染右侧容器的事件
161
+ */
162
+ triggerRenderRightContainer($container: HTMLElement): void;
155
163
  /**
156
164
  *
157
165
  * @param formConfig
@@ -1,4 +1,18 @@
1
- import type { PopsPanelDetails } from "./indexType";
1
+ import type { PopsPanelDetails, PopsPanelEventType } from "./indexType";
2
2
  export declare const PopsPanel: {
3
- init(details: PopsPanelDetails): Omit<import("../../types/event").PopsEventDetails, "function" | "type">;
3
+ init(details: PopsPanelDetails): {
4
+ addEventListener: <K extends keyof PopsPanelEventType>(event: K, listener: (evt: CustomEvent<PopsPanelEventType[K]>) => void, options?: boolean | EventListenerOptions) => void;
5
+ removeEventListener: <K extends keyof PopsPanelEventType>(event: K, listener: (evt: CustomEvent<PopsPanelEventType[K]>) => void, options?: boolean | EventListenerOptions) => void;
6
+ close: () => Promise<void>;
7
+ hide: () => Promise<void>;
8
+ show: () => Promise<void>;
9
+ guid: string;
10
+ $shadowContainer: HTMLDivElement;
11
+ $shadowRoot: ShadowRoot | HTMLElement;
12
+ element: HTMLDivElement;
13
+ animElement: HTMLDivElement;
14
+ popsElement: HTMLDivElement;
15
+ maskElement?: HTMLDivElement | undefined;
16
+ mode: import("../../types/main").PopsMode;
17
+ };
4
18
  };
@@ -12,6 +12,20 @@ import type { PopsHeaderCloseButtonDetails } from "../../types/button";
12
12
  import { PopsPanelSelectMultipleDetails } from "./selectMultipleType";
13
13
  /** panel的各种类型的配置项 */
14
14
  export type PopsPanelFormsTotalDetails = PopsPanelSwitchDetails | PopsPanelSliderDetails | PopsPanelInputDetails | PopsPanelTextAreaDetails | PopsPanelSelectDetails<any> | PopsPanelSelectMultipleDetails<any> | PopsPanelButtonDetails | PopsPanelDeepMenuDetails | PopsPanelOwnDetails;
15
+ /**
16
+ * panel的内部事件
17
+ */
18
+ export type PopsPanelEventType = {
19
+ /**
20
+ * 该事件在右侧容器内的元素改变时触发
21
+ */
22
+ "pops:renderRightContainer": {
23
+ /**
24
+ * 菜单配置
25
+ */
26
+ formConfig: PopsPanelContentConfig[] | PopsPanelDeepMenuDetails;
27
+ };
28
+ };
15
29
  /**
16
30
  * pops.panel的content配置信息
17
31
  */
@@ -213,7 +213,7 @@ export declare interface PopsDOMUtilsEventListenerOptionsAttribute {
213
213
  /**
214
214
  * 属性配置
215
215
  */
216
- option: DOMUtilsEventListenerOption;
216
+ option: PopsDOMUtilsEventListenerOption;
217
217
  /**
218
218
  * 用户添加的事件
219
219
  */
@@ -1,5 +1,6 @@
1
1
  import { PopsEventDetails, PopsHandlerEventDetails } from "./event";
2
2
  import type { PopsIconType } from "./icon";
3
+ import type { PopsMode } from "./main";
3
4
 
4
5
  /**
5
6
  * 按钮类型
@@ -105,7 +106,7 @@ export interface PopsButtonDetails<T = {}> {
105
106
  text: string;
106
107
  /**
107
108
  * 按钮点击的回调
108
- *
109
+ *
109
110
  * 如果传入该值,那么将不会自动关闭弹窗
110
111
  */
111
112
  callback(
@@ -151,7 +152,7 @@ export interface PopsButtonDetailsAnyType<T = {}> {
151
152
  text: string;
152
153
  /**
153
154
  * 按钮点击的回调
154
- *
155
+ *
155
156
  * 如果传入该值,那么将不会自动关闭弹窗
156
157
  */
157
158
  callback(
@@ -1,4 +1,5 @@
1
1
  import type { PopsIframeDetails } from "../components/iframe/indexType";
2
+ import type { PopsMode } from "./main";
2
3
 
3
4
  /**
4
5
  * 事件配置
@@ -46,8 +47,8 @@ export interface PopsEventDetails {
46
47
  /** 遮罩层 */
47
48
  maskElement?: HTMLDivElement;
48
49
  /** 当前弹窗类型 */
49
- mode: mode;
50
- guid: guid;
50
+ mode: PopsMode;
51
+ guid: string;
51
52
  close: () => Promise<void>;
52
53
  hide: () => Promise<void>;
53
54
  show: () => Promise<void>;
@@ -1,15 +1,15 @@
1
- declare var unsafeWindow: Window & typeof globalThis;
2
-
3
1
  declare module "*.css" {
4
2
  const content: string;
5
3
  export default content;
6
4
  }
7
-
8
5
  declare module "*.svg" {
9
6
  const content: string;
10
7
  export default content;
11
8
  }
12
- type DeepRequired<T> = T extends Function
9
+
10
+ declare var unsafeWindow: Window & typeof globalThis;
11
+
12
+ declare type DeepRequired<T> = T extends Function
13
13
  ? T
14
14
  : T extends object
15
15
  ? T extends Node
@@ -4,7 +4,15 @@ import type { PopsDrawerDetails } from "../components/drawer/indexType";
4
4
  import type { PopsFolderDetails } from "../components/folder/indexType";
5
5
  import type { PopsIframeDetails } from "../components/iframe/indexType";
6
6
  import type { PopsLoadingDetails } from "../components/loading/indexType";
7
+ import type { PopsPanelButtonDetails } from "../components/panel/buttonType";
8
+ import type { PopsPanelDeepMenuDetails } from "../components/panel/deepMenuType";
7
9
  import type { PopsPanelDetails } from "../components/panel/indexType";
10
+ import type { PopsPanelInputDetails } from "../components/panel/inputType";
11
+ import type { PopsPanelOwnDetails } from "../components/panel/ownType";
12
+ import type { PopsPanelSelectDetails } from "../components/panel/selectType";
13
+ import type { PopsPanelSliderDetails } from "../components/panel/sliderType";
14
+ import type { PopsPanelSwitchDetails } from "../components/panel/switchType";
15
+ import type { PopsPanelTextAreaDetails } from "../components/panel/textareaType";
8
16
  import type { PopsPromptDetails } from "../components/prompt/indexType";
9
17
  import { PopsRightClickMenuDetails } from "../components/rightClickMenu/indexType";
10
18
  import { PopsToolTipDetails } from "../components/tooltip/indexType";
@@ -1,3 +1,11 @@
1
+ import type { PopsAlertDetails } from "../components/alert/indexType";
2
+ import type { PopsDrawerDetails } from "../components/drawer/indexType";
3
+ import type { PopsFolderDetails } from "../components/folder/indexType";
4
+ import type { PopsIframeDetails } from "../components/iframe/indexType";
5
+ import type { PopsLoadingDetails } from "../components/loading/indexType";
6
+ import type { PopsPanelDetails } from "../components/panel/indexType";
7
+ import type { PopsPromptDetails } from "../components/prompt/indexType";
8
+
1
9
  /**
2
10
  * 遮罩层配置
3
11
  */
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
+ "$schema": "https://json.schemastore.org/package.json",
2
3
  "name": "@whitesev/pops",
3
- "version": "2.1.2",
4
+ "version": "2.1.4",
5
+ "type": "module",
4
6
  "description": "弹窗库",
5
- "$schema": "https://json.schemastore.org/package.json",
6
7
  "main": "dist/index.cjs.js",
7
8
  "module": "dist/index.esm.js",
8
9
  "types": "dist/types/index.d.ts",
@@ -35,18 +36,16 @@
35
36
  "author": "WhiteSev",
36
37
  "license": "MIT",
37
38
  "dependencies": {
38
- "@rollup/plugin-commonjs": "^25.0.8",
39
- "@rollup/plugin-node-resolve": "^15.3.1",
40
- "@rollup/plugin-typescript": "^11.1.6",
41
39
  "any-touch": "^2.2.0",
42
- "rollup-plugin-clear": "^2.0.7",
43
- "tslib": "^2.8.1",
44
40
  "worker-timers": "^8.0.21"
45
41
  },
46
42
  "devDependencies": {
47
- "rollup-plugin-import-css": "^3.5.8",
48
- "rollup-plugin-livereload": "^2.0.5",
49
- "rollup-plugin-serve": "^1.1.1",
43
+ "@rollup/plugin-commonjs": "^28.0.6",
44
+ "@rollup/plugin-node-resolve": "^16.0.1",
45
+ "@rollup/plugin-typescript": "^12.1.2",
46
+ "rollup-plugin-clear": "^2.0.7",
47
+ "rollup-plugin-import-css": "^4.0.1",
48
+ "tslib": "^2.8.1",
50
49
  "typescript": "^5.8.3"
51
50
  },
52
51
  "scripts": {
package/src/Pops.ts CHANGED
@@ -36,7 +36,7 @@ class Pops {
36
36
  /** 配置 */
37
37
  config = {
38
38
  /** 版本号 */
39
- version: "2025.6.12",
39
+ version: "2025.6.25",
40
40
  cssText: PopsCSS,
41
41
  /** icon图标的svg代码 */
42
42
  iconSVG: PopsIcon.$data,
@@ -225,7 +225,7 @@ table.pops-folder-list-table__body {
225
225
  vertical-align: middle;
226
226
  }
227
227
  .pops-folder-list .pops-folder-file-list-breadcrumb-primary {
228
- flex: 0;
228
+ flex: 1;
229
229
  display: -webkit-box;
230
230
  display: -webkit-flex;
231
231
  display: -ms-flexbox;