@whitesev/pops 2.1.3 → 2.1.5
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.
- package/dist/index.amd.js +253 -227
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +253 -227
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +253 -227
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +253 -227
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +253 -227
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +253 -227
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/GlobalConfig.d.ts +7 -2
- package/dist/types/src/Pops.d.ts +61 -39
- package/dist/types/src/{Core.d.ts → PopsCore.d.ts} +4 -3
- package/dist/types/src/PopsIcon.d.ts +30 -2
- package/dist/types/src/PopsLayer.d.ts +3 -1
- package/dist/types/src/components/alert/config.d.ts +1 -1
- package/dist/types/src/components/alert/index.d.ts +1 -1
- package/dist/types/src/components/alert/{indexType.d.ts → types/index.d.ts} +2 -2
- package/dist/types/src/components/confirm/config.d.ts +1 -1
- package/dist/types/src/components/confirm/index.d.ts +1 -1
- package/dist/types/src/components/confirm/{indexType.d.ts → types/index.d.ts} +1 -1
- package/dist/types/src/components/drawer/config.d.ts +1 -1
- package/dist/types/src/components/drawer/index.d.ts +1 -1
- package/dist/types/src/components/drawer/{indexType.d.ts → types/index.d.ts} +1 -1
- package/dist/types/src/components/folder/config.d.ts +1 -1
- package/dist/types/src/components/folder/index.d.ts +1 -1
- package/dist/types/src/components/folder/{indexType.d.ts → types/index.d.ts} +1 -1
- package/dist/types/src/components/iframe/config.d.ts +1 -1
- package/dist/types/src/components/iframe/index.d.ts +1 -1
- package/dist/types/src/components/iframe/{indexType.d.ts → types/index.d.ts} +2 -2
- package/dist/types/src/components/loading/config.d.ts +1 -1
- package/dist/types/src/components/loading/index.d.ts +1 -1
- package/dist/types/src/components/loading/{indexType.d.ts → types/index.d.ts} +1 -1
- package/dist/types/src/components/panel/config.d.ts +1 -1
- package/dist/types/src/components/panel/{PanelHandleContentDetails.d.ts → handlerComponents.d.ts} +39 -28
- package/dist/types/src/components/panel/index.d.ts +16 -2
- package/dist/types/src/components/panel/{buttonType.d.ts → types/components-button.d.ts} +3 -3
- package/dist/types/src/components/panel/{commonType.d.ts → types/components-common.d.ts} +2 -2
- package/dist/types/src/components/panel/{deepMenuType.d.ts → types/components-deepMenu.d.ts} +3 -3
- package/dist/types/src/components/panel/{formsType.d.ts → types/components-forms.d.ts} +2 -2
- package/dist/types/src/components/panel/{inputType.d.ts → types/components-input.d.ts} +1 -1
- package/dist/types/src/components/panel/{ownType.d.ts → types/components-own.d.ts} +1 -1
- package/dist/types/src/components/panel/{selectType.d.ts → types/components-select.d.ts} +3 -3
- package/dist/types/src/components/panel/{selectMultipleType.d.ts → types/components-selectMultiple.d.ts} +2 -2
- package/dist/types/src/components/panel/{sliderType.d.ts → types/components-slider.d.ts} +1 -1
- package/dist/types/src/components/panel/{switchType.d.ts → types/components-switch.d.ts} +1 -1
- package/dist/types/src/components/panel/{textareaType.d.ts → types/components-textarea.d.ts} +1 -1
- package/dist/types/src/components/panel/{indexType.d.ts → types/index.d.ts} +26 -12
- package/dist/types/src/components/prompt/config.d.ts +1 -1
- package/dist/types/src/components/prompt/index.d.ts +1 -1
- package/dist/types/src/components/prompt/{indexType.d.ts → types/index.d.ts} +1 -1
- package/dist/types/src/components/rightClickMenu/config.d.ts +1 -1
- package/dist/types/src/components/rightClickMenu/index.d.ts +2 -2
- package/dist/types/src/components/rightClickMenu/{indexType.d.ts → types/index.d.ts} +2 -2
- package/dist/types/src/components/searchSuggestion/config.d.ts +1 -1
- package/dist/types/src/components/searchSuggestion/index.d.ts +2 -2
- package/dist/types/src/components/searchSuggestion/{indexType.d.ts → types/index.d.ts} +1 -1
- package/dist/types/src/components/tooltip/config.d.ts +1 -1
- package/dist/types/src/components/tooltip/index.d.ts +2 -2
- package/dist/types/src/components/tooltip/{indexType.d.ts → types/index.d.ts} +1 -1
- package/dist/types/src/handler/PopsHandler.d.ts +8 -8
- package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +1 -1
- package/dist/types/src/types/button.d.ts +3 -2
- package/dist/types/src/types/event.d.ts +4 -3
- package/dist/types/src/types/global.d.ts +4 -4
- package/dist/types/src/types/main.d.ts +18 -10
- package/dist/types/src/types/mask.d.ts +8 -0
- package/dist/types/src/{Config.d.ts → utils/PopsDOMUtilsEventsConfig.d.ts} +3 -0
- package/dist/types/src/utils/PopsInstanceUtils.d.ts +8 -8
- package/package.json +9 -10
- package/src/GlobalConfig.ts +6 -5
- package/src/Pops.ts +17 -17
- package/src/{Core.ts → PopsCore.ts} +13 -14
- package/src/PopsIcon.ts +34 -32
- package/src/PopsLayer.ts +8 -7
- package/src/components/alert/config.ts +1 -1
- package/src/components/alert/index.ts +1 -1
- package/src/components/alert/{indexType.ts → types/index.ts} +2 -2
- package/src/components/confirm/config.ts +1 -1
- package/src/components/confirm/index.ts +1 -1
- package/src/components/confirm/{indexType.ts → types/index.ts} +1 -1
- package/src/components/drawer/config.ts +1 -1
- package/src/components/drawer/index.ts +1 -1
- package/src/components/drawer/{indexType.ts → types/index.ts} +1 -1
- package/src/components/folder/config.ts +1 -1
- package/src/components/folder/index.ts +1 -1
- package/src/components/folder/{indexType.ts → types/index.ts} +1 -1
- package/src/components/iframe/config.ts +1 -1
- package/src/components/iframe/index.ts +4 -4
- package/src/components/iframe/{indexType.ts → types/index.ts} +2 -2
- package/src/components/loading/config.ts +1 -1
- package/src/components/loading/index.ts +1 -1
- package/src/components/loading/{indexType.ts → types/index.ts} +1 -1
- package/src/components/panel/config.ts +1 -1
- package/src/components/panel/{PanelHandleContentDetails.ts → handlerComponents.ts} +287 -258
- package/src/components/panel/index.ts +23 -5
- package/src/components/panel/{buttonType.ts → types/components-button.ts} +5 -4
- package/src/components/panel/{commonType.ts → types/components-common.ts} +2 -2
- package/src/components/panel/{deepMenuType.ts → types/components-deepMenu.ts} +3 -3
- package/src/components/panel/{formsType.ts → types/components-forms.ts} +2 -2
- package/src/components/panel/{inputType.ts → types/components-input.ts} +1 -1
- package/src/components/panel/{ownType.ts → types/components-own.ts} +1 -1
- package/src/components/panel/{selectType.ts → types/components-select.ts} +3 -3
- package/src/components/panel/{selectMultipleType.ts → types/components-selectMultiple.ts} +2 -2
- package/src/components/panel/{sliderType.ts → types/components-slider.ts} +1 -1
- package/src/components/panel/{switchType.ts → types/components-switch.ts} +1 -1
- package/src/components/panel/{textareaType.ts → types/components-textarea.ts} +1 -1
- package/src/components/panel/{indexType.ts → types/index.ts} +28 -12
- package/src/components/prompt/config.ts +1 -1
- package/src/components/prompt/index.ts +1 -1
- package/src/components/prompt/{indexType.ts → types/index.ts} +1 -1
- package/src/components/rightClickMenu/config.ts +1 -1
- package/src/components/rightClickMenu/index.ts +2 -2
- package/src/components/rightClickMenu/{indexType.ts → types/index.ts} +2 -2
- package/src/components/searchSuggestion/config.ts +1 -1
- package/src/components/searchSuggestion/index.ts +1 -1
- package/src/components/searchSuggestion/{indexType.ts → types/index.ts} +1 -1
- package/src/components/tooltip/config.ts +1 -1
- package/src/components/tooltip/index.ts +1 -1
- package/src/components/tooltip/{indexType.ts → types/index.ts} +1 -1
- package/src/handler/PopsElementHandler.ts +3 -3
- package/src/handler/PopsHandler.ts +26 -26
- package/src/types/PopsDOMUtilsEventType.d.ts +1 -1
- package/src/types/button.d.ts +3 -2
- package/src/types/event.d.ts +4 -3
- package/src/types/global.d.ts +4 -4
- package/src/types/main.d.ts +18 -10
- package/src/types/mask.d.ts +8 -0
- package/src/utils/PopsDOMUtils.ts +2 -2
- package/src/{Config.ts → utils/PopsDOMUtilsEventsConfig.ts} +3 -0
- package/src/utils/PopsInstanceUtils.ts +12 -12
- package/src/utils/PopsUtils.ts +2 -5
|
@@ -3,9 +3,9 @@ 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 } from "./
|
|
6
|
+
import type { PopsPanelDetails, PopsPanelEventType } from "./types";
|
|
7
7
|
import { PopsPanelConfig } from "./config";
|
|
8
|
-
import {
|
|
8
|
+
import { PanelHandlerComponents } from "./handlerComponents";
|
|
9
9
|
import { GlobalConfig } from "../../GlobalConfig";
|
|
10
10
|
import { PopsCSS } from "../../PopsCSS";
|
|
11
11
|
|
|
@@ -135,13 +135,14 @@ export const PopsPanel = {
|
|
|
135
135
|
if ($mask != null) {
|
|
136
136
|
$anim.after($mask);
|
|
137
137
|
}
|
|
138
|
-
let
|
|
138
|
+
let panelHandlerComponents = PanelHandlerComponents();
|
|
139
139
|
/**
|
|
140
140
|
* 处理内部配置
|
|
141
141
|
*/
|
|
142
|
-
|
|
142
|
+
panelHandlerComponents.init({
|
|
143
143
|
config: config,
|
|
144
144
|
$el: {
|
|
145
|
+
$pops: $pops,
|
|
145
146
|
$content: $content,
|
|
146
147
|
$contentAside: $contentAside,
|
|
147
148
|
$contentSectionContainer: $contentSectionContainer,
|
|
@@ -167,6 +168,23 @@ export const PopsPanel = {
|
|
|
167
168
|
});
|
|
168
169
|
}
|
|
169
170
|
let result = PopsHandler.handleResultDetails(eventDetails);
|
|
170
|
-
|
|
171
|
+
|
|
172
|
+
return {
|
|
173
|
+
...result,
|
|
174
|
+
addEventListener: <K extends keyof PopsPanelEventType>(
|
|
175
|
+
event: K,
|
|
176
|
+
listener: (evt: CustomEvent<PopsPanelEventType[K]>) => void,
|
|
177
|
+
options?: boolean | EventListenerOptions
|
|
178
|
+
) => {
|
|
179
|
+
$pops.addEventListener(event, listener as any, options);
|
|
180
|
+
},
|
|
181
|
+
removeEventListener: <K extends keyof PopsPanelEventType>(
|
|
182
|
+
event: K,
|
|
183
|
+
listener: (evt: CustomEvent<PopsPanelEventType[K]>) => void,
|
|
184
|
+
options?: boolean | EventListenerOptions
|
|
185
|
+
) => {
|
|
186
|
+
$pops.removeEventListener(event, listener as any, options);
|
|
187
|
+
},
|
|
188
|
+
};
|
|
171
189
|
},
|
|
172
190
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { PopsPanelCommonDetails } from "./
|
|
2
|
-
import type { PopsButtonStyleType } from "
|
|
3
|
-
import type { PopsIconType } from "
|
|
1
|
+
import type { PopsPanelCommonDetails } from "./components-common";
|
|
2
|
+
import type { PopsButtonStyleType } from "../../../types/button";
|
|
3
|
+
import type { PopsIconType } from "../../../types/icon";
|
|
4
4
|
/**
|
|
5
5
|
* pops.panel的 button
|
|
6
6
|
*/
|
|
7
|
-
export interface PopsPanelButtonDetails
|
|
7
|
+
export interface PopsPanelButtonDetails
|
|
8
|
+
extends PopsPanelCommonDetails<PopsPanelButtonDetails> {
|
|
8
9
|
/**
|
|
9
10
|
* (可选)className属性
|
|
10
11
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { PopsPanelFormsTotalDetails } from "
|
|
2
|
-
import type { PopsPanelFormsDetails } from "./
|
|
3
|
-
import type { PopsPanelCommonDetails } from "./
|
|
1
|
+
import type { PopsPanelFormsTotalDetails } from ".";
|
|
2
|
+
import type { PopsPanelFormsDetails } from "./components-forms";
|
|
3
|
+
import type { PopsPanelCommonDetails } from "./components-common";
|
|
4
4
|
/**
|
|
5
5
|
* pops.panel的 深层菜单
|
|
6
6
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PopsPanelCommonDetails } from "./
|
|
2
|
-
import type { PopsPanelFormsTotalDetails } from "
|
|
1
|
+
import type { PopsPanelCommonDetails } from "./components-common";
|
|
2
|
+
import type { PopsPanelFormsTotalDetails } from ".";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* pops.panel的 forms
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { PopsPanelCommonDetails } from "./
|
|
2
|
-
import type { PopsPanelFormsDetails } from "./
|
|
3
|
-
import type { PopsPanelFormsTotalDetails } from "
|
|
1
|
+
import type { PopsPanelCommonDetails } from "./components-common";
|
|
2
|
+
import type { PopsPanelFormsDetails } from "./components-forms";
|
|
3
|
+
import type { PopsPanelFormsTotalDetails } from ".";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* pops.panel的 select
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PopsAlertDetails } from "
|
|
2
|
-
import type { PopsPanelCommonDetails } from "./
|
|
1
|
+
import type { PopsAlertDetails } from "../../alert/types";
|
|
2
|
+
import type { PopsPanelCommonDetails } from "./components-common";
|
|
3
3
|
|
|
4
4
|
export interface PopsPanelSelectMultipleDataOption<T> {
|
|
5
5
|
/**
|
|
@@ -2,18 +2,18 @@ import type {
|
|
|
2
2
|
PopsTitleConfig,
|
|
3
3
|
PopsDragConfig,
|
|
4
4
|
PopsCommonConfig,
|
|
5
|
-
} from "
|
|
6
|
-
import type { PopsPanelFormsDetails } from "./
|
|
7
|
-
import type { PopsPanelSwitchDetails } from "./
|
|
8
|
-
import type { PopsPanelSliderDetails } from "./
|
|
9
|
-
import type { PopsPanelInputDetails } from "./
|
|
10
|
-
import type { PopsPanelTextAreaDetails } from "./
|
|
11
|
-
import type { PopsPanelSelectDetails } from "./
|
|
12
|
-
import type { PopsPanelButtonDetails } from "./
|
|
13
|
-
import type { PopsPanelDeepMenuDetails } from "./
|
|
14
|
-
import type { PopsPanelOwnDetails } from "./
|
|
15
|
-
import type { PopsHeaderCloseButtonDetails } from "
|
|
16
|
-
import { PopsPanelSelectMultipleDetails } from "./
|
|
5
|
+
} from "../../../types/components";
|
|
6
|
+
import type { PopsPanelFormsDetails } from "./components-forms";
|
|
7
|
+
import type { PopsPanelSwitchDetails } from "./components-switch";
|
|
8
|
+
import type { PopsPanelSliderDetails } from "./components-slider";
|
|
9
|
+
import type { PopsPanelInputDetails } from "./components-input";
|
|
10
|
+
import type { PopsPanelTextAreaDetails } from "./components-textarea";
|
|
11
|
+
import type { PopsPanelSelectDetails } from "./components-select";
|
|
12
|
+
import type { PopsPanelButtonDetails } from "./components-button";
|
|
13
|
+
import type { PopsPanelDeepMenuDetails } from "./components-deepMenu";
|
|
14
|
+
import type { PopsPanelOwnDetails } from "./components-own";
|
|
15
|
+
import type { PopsHeaderCloseButtonDetails } from "../../../types/button";
|
|
16
|
+
import { PopsPanelSelectMultipleDetails } from "./components-selectMultiple";
|
|
17
17
|
|
|
18
18
|
/** panel的各种类型的配置项 */
|
|
19
19
|
export type PopsPanelFormsTotalDetails =
|
|
@@ -26,6 +26,22 @@ export type PopsPanelFormsTotalDetails =
|
|
|
26
26
|
| PopsPanelButtonDetails
|
|
27
27
|
| PopsPanelDeepMenuDetails
|
|
28
28
|
| PopsPanelOwnDetails;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* panel的内部事件
|
|
32
|
+
*/
|
|
33
|
+
export type PopsPanelEventType = {
|
|
34
|
+
/**
|
|
35
|
+
* 该事件在右侧容器内的元素改变时触发
|
|
36
|
+
*/
|
|
37
|
+
"pops:renderRightContainer": {
|
|
38
|
+
/**
|
|
39
|
+
* 菜单配置
|
|
40
|
+
*/
|
|
41
|
+
formConfig: PopsPanelContentConfig[] | PopsPanelDeepMenuDetails;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
|
|
29
45
|
/**
|
|
30
46
|
* pops.panel的content配置信息
|
|
31
47
|
*/
|
|
@@ -6,7 +6,7 @@ import { popsDOMUtils } from "../../utils/PopsDOMUtils";
|
|
|
6
6
|
import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
|
|
7
7
|
import { popsUtils } from "../../utils/PopsUtils";
|
|
8
8
|
import { PopsPromptConfig } from "./config";
|
|
9
|
-
import type { PopsPromptDetails } from "./
|
|
9
|
+
import type { PopsPromptDetails } from "./types/index";
|
|
10
10
|
|
|
11
11
|
export const PopsPrompt = {
|
|
12
12
|
init(details: PopsPromptDetails) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OriginPrototype } from "../../
|
|
1
|
+
import { OriginPrototype } from "../../PopsCore";
|
|
2
2
|
import { GlobalConfig } from "../../GlobalConfig";
|
|
3
3
|
import { PopsHandler } from "../../handler/PopsHandler";
|
|
4
4
|
import { popsDOMUtils } from "../../utils/PopsDOMUtils";
|
|
@@ -8,7 +8,7 @@ import { rightClickMenuConfig as PopsRightClickMenuConfig } from "./config";
|
|
|
8
8
|
import type {
|
|
9
9
|
PopsRightClickMenuDataDetails,
|
|
10
10
|
PopsRightClickMenuDetails,
|
|
11
|
-
} from "./
|
|
11
|
+
} from "./types";
|
|
12
12
|
import { PopsCSS } from "../../PopsCSS";
|
|
13
13
|
import { PopsIcon } from "../../PopsIcon";
|
|
14
14
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PopsCommonConfig } from "
|
|
2
|
-
import type { PopsIconType } from "
|
|
1
|
+
import type { PopsCommonConfig } from "../../../types/components";
|
|
2
|
+
import type { PopsIconType } from "../../../types/icon";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* pops.rightClickMenu的右键菜单配置
|
|
@@ -4,7 +4,7 @@ import { popsUtils } from "../../utils/PopsUtils";
|
|
|
4
4
|
import { searchSuggestionConfig as PopsSearchSuggestionConfig } from "./config";
|
|
5
5
|
import { GlobalConfig } from "../../GlobalConfig";
|
|
6
6
|
import { PopsSafeUtils } from "../../utils/PopsSafeUtils";
|
|
7
|
-
import type { PopsSearchSuggestionDetails } from "./
|
|
7
|
+
import type { PopsSearchSuggestionDetails } from "./types/index";
|
|
8
8
|
import { PopsCSS } from "../../PopsCSS";
|
|
9
9
|
|
|
10
10
|
export const PopsSearchSuggestion = {
|
|
@@ -5,7 +5,7 @@ import { popsDOMUtils } from "../../utils/PopsDOMUtils";
|
|
|
5
5
|
import { PopsSafeUtils } from "../../utils/PopsSafeUtils";
|
|
6
6
|
import { popsUtils } from "../../utils/PopsUtils";
|
|
7
7
|
import { PopsTooltipConfig } from "./config";
|
|
8
|
-
import type { PopsToolTipDetails } from "./
|
|
8
|
+
import type { PopsToolTipDetails } from "./types/index";
|
|
9
9
|
|
|
10
10
|
type ToolTipEventTypeName = "MouseEvent" | "TouchEvent";
|
|
11
11
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { PopsAlertDetails } from "../components/alert/
|
|
2
|
-
import type { PopsConfirmDetails } from "../components/confirm/
|
|
3
|
-
import type { PopsIframeDetails } from "../components/iframe/
|
|
1
|
+
import type { PopsAlertDetails } from "../components/alert/types";
|
|
2
|
+
import type { PopsConfirmDetails } from "../components/confirm/types";
|
|
3
|
+
import type { PopsIframeDetails } from "../components/iframe/types";
|
|
4
4
|
import type { PopsIconType } from "../types/icon";
|
|
5
5
|
import type {
|
|
6
6
|
PopsSupportAnim,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { PopsAlertDetails } from "../components/alert/
|
|
2
|
-
import type { PopsConfirmDetails } from "../components/confirm/
|
|
3
|
-
import type { PopsDrawerDetails } from "../components/drawer/
|
|
4
|
-
import type { PopsFolderDetails } from "../components/folder/
|
|
5
|
-
import type { PopsIframeDetails } from "../components/iframe/
|
|
6
|
-
import type { PopsLoadingDetails } from "../components/loading/
|
|
7
|
-
import type { PopsPanelDetails } from "../components/panel/
|
|
8
|
-
import type { PopsPromptDetails } from "../components/prompt/
|
|
9
|
-
import { PopsCore } from "../
|
|
1
|
+
import type { PopsAlertDetails } from "../components/alert/types";
|
|
2
|
+
import type { PopsConfirmDetails } from "../components/confirm/types";
|
|
3
|
+
import type { PopsDrawerDetails } from "../components/drawer/types";
|
|
4
|
+
import type { PopsFolderDetails } from "../components/folder/types";
|
|
5
|
+
import type { PopsIframeDetails } from "../components/iframe/types";
|
|
6
|
+
import type { PopsLoadingDetails } from "../components/loading/types";
|
|
7
|
+
import type { PopsPanelDetails } from "../components/panel/types";
|
|
8
|
+
import type { PopsPromptDetails } from "../components/prompt/types/index";
|
|
9
|
+
import { PopsCore } from "../PopsCore";
|
|
10
10
|
import { PopsAnimation } from "../PopsAnimation";
|
|
11
|
-
import {
|
|
11
|
+
import { PopsLayerData } from "../PopsLayer";
|
|
12
12
|
import type { PopsCommonConfig } from "../types/components";
|
|
13
13
|
import { PopsEventDetails, PopsHandlerEventDetails } from "../types/event";
|
|
14
14
|
import { PopsLayerCommonConfig } from "../types/layer";
|
|
@@ -114,7 +114,7 @@ export const PopsHandler = {
|
|
|
114
114
|
function clickEvent(event: MouseEvent | PointerEvent) {
|
|
115
115
|
popsDOMUtils.preventEvent(event);
|
|
116
116
|
// 获取该类型实例存储列表
|
|
117
|
-
let targetLayer =
|
|
117
|
+
let targetLayer = PopsLayerData[details.type];
|
|
118
118
|
function originalRun() {
|
|
119
119
|
if (details.config.mask!.clickEvent!.toClose) {
|
|
120
120
|
/* 关闭 */
|
|
@@ -403,7 +403,7 @@ export const PopsHandler = {
|
|
|
403
403
|
close() {
|
|
404
404
|
return PopsInstanceUtils.close(
|
|
405
405
|
mode,
|
|
406
|
-
|
|
406
|
+
PopsLayerData[mode],
|
|
407
407
|
guid,
|
|
408
408
|
config,
|
|
409
409
|
animElement
|
|
@@ -412,7 +412,7 @@ export const PopsHandler = {
|
|
|
412
412
|
hide() {
|
|
413
413
|
return PopsInstanceUtils.hide(
|
|
414
414
|
mode,
|
|
415
|
-
|
|
415
|
+
PopsLayerData[mode],
|
|
416
416
|
guid,
|
|
417
417
|
config,
|
|
418
418
|
animElement,
|
|
@@ -422,7 +422,7 @@ export const PopsHandler = {
|
|
|
422
422
|
show() {
|
|
423
423
|
return PopsInstanceUtils.show(
|
|
424
424
|
mode,
|
|
425
|
-
|
|
425
|
+
PopsLayerData[mode],
|
|
426
426
|
guid,
|
|
427
427
|
config,
|
|
428
428
|
animElement,
|
|
@@ -466,7 +466,7 @@ export const PopsHandler = {
|
|
|
466
466
|
close() {
|
|
467
467
|
return PopsInstanceUtils.close(
|
|
468
468
|
mode,
|
|
469
|
-
|
|
469
|
+
PopsLayerData[mode],
|
|
470
470
|
guid,
|
|
471
471
|
config,
|
|
472
472
|
animElement
|
|
@@ -475,7 +475,7 @@ export const PopsHandler = {
|
|
|
475
475
|
hide() {
|
|
476
476
|
return PopsInstanceUtils.hide(
|
|
477
477
|
mode,
|
|
478
|
-
|
|
478
|
+
PopsLayerData[mode],
|
|
479
479
|
guid,
|
|
480
480
|
config,
|
|
481
481
|
animElement,
|
|
@@ -485,7 +485,7 @@ export const PopsHandler = {
|
|
|
485
485
|
show() {
|
|
486
486
|
return PopsInstanceUtils.show(
|
|
487
487
|
mode,
|
|
488
|
-
|
|
488
|
+
PopsLayerData[mode],
|
|
489
489
|
guid,
|
|
490
490
|
config,
|
|
491
491
|
animElement,
|
|
@@ -639,20 +639,20 @@ export const PopsHandler = {
|
|
|
639
639
|
type === "tooltip" ||
|
|
640
640
|
type === "rightClickMenu"
|
|
641
641
|
) {
|
|
642
|
-
let layer =
|
|
642
|
+
let layer = PopsLayerData[type as keyof typeof PopsLayerData];
|
|
643
643
|
if (layer) {
|
|
644
644
|
PopsInstanceUtils.removeInstance([layer], "", true);
|
|
645
645
|
}
|
|
646
646
|
} else {
|
|
647
647
|
PopsInstanceUtils.removeInstance(
|
|
648
648
|
[
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
649
|
+
PopsLayerData.alert,
|
|
650
|
+
PopsLayerData.confirm,
|
|
651
|
+
PopsLayerData.prompt,
|
|
652
|
+
PopsLayerData.iframe,
|
|
653
|
+
PopsLayerData.drawer,
|
|
654
|
+
PopsLayerData.folder,
|
|
655
|
+
PopsLayerData.panel,
|
|
656
656
|
],
|
|
657
657
|
"",
|
|
658
658
|
true
|
|
@@ -677,6 +677,6 @@ export const PopsHandler = {
|
|
|
677
677
|
* @param value
|
|
678
678
|
*/
|
|
679
679
|
handlePush(type: PopsLayerMode, value: PopsLayerCommonConfig) {
|
|
680
|
-
|
|
680
|
+
PopsLayerData[type].push(value);
|
|
681
681
|
},
|
|
682
682
|
};
|
package/src/types/button.d.ts
CHANGED
|
@@ -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(
|
package/src/types/event.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { PopsIframeDetails } from "../components/iframe/
|
|
1
|
+
import type { PopsIframeDetails } from "../components/iframe/types";
|
|
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:
|
|
50
|
-
guid:
|
|
50
|
+
mode: PopsMode;
|
|
51
|
+
guid: string;
|
|
51
52
|
close: () => Promise<void>;
|
|
52
53
|
hide: () => Promise<void>;
|
|
53
54
|
show: () => Promise<void>;
|
package/src/types/global.d.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
package/src/types/main.d.ts
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
import type { PopsAlertDetails } from "../components/alert/
|
|
2
|
-
import type { PopsConfirmDetails } from "../components/confirm/
|
|
3
|
-
import type { PopsDrawerDetails } from "../components/drawer/
|
|
4
|
-
import type { PopsFolderDetails } from "../components/folder/
|
|
5
|
-
import type { PopsIframeDetails } from "../components/iframe/
|
|
6
|
-
import type { PopsLoadingDetails } from "../components/loading/
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import type { PopsAlertDetails } from "../components/alert/types";
|
|
2
|
+
import type { PopsConfirmDetails } from "../components/confirm/types";
|
|
3
|
+
import type { PopsDrawerDetails } from "../components/drawer/types";
|
|
4
|
+
import type { PopsFolderDetails } from "../components/folder/types";
|
|
5
|
+
import type { PopsIframeDetails } from "../components/iframe/types";
|
|
6
|
+
import type { PopsLoadingDetails } from "../components/loading/types";
|
|
7
|
+
import type { PopsPanelButtonDetails } from "../components/panel/types/components-button";
|
|
8
|
+
import type { PopsPanelDeepMenuDetails } from "../components/panel/types/components-deepMenu";
|
|
9
|
+
import type { PopsPanelDetails } from "../components/panel/types";
|
|
10
|
+
import type { PopsPanelInputDetails } from "../components/panel/types/components-input";
|
|
11
|
+
import type { PopsPanelOwnDetails } from "../components/panel/types/components-own";
|
|
12
|
+
import type { PopsPanelSelectDetails } from "../components/panel/types/components-select";
|
|
13
|
+
import type { PopsPanelSliderDetails } from "../components/panel/types/components-slider";
|
|
14
|
+
import type { PopsPanelSwitchDetails } from "../components/panel/types/components-switch";
|
|
15
|
+
import type { PopsPanelTextAreaDetails } from "../components/panel/types/components-textarea";
|
|
16
|
+
import type { PopsPromptDetails } from "../components/prompt/types/index";
|
|
17
|
+
import { PopsRightClickMenuDetails } from "../components/rightClickMenu/types";
|
|
18
|
+
import { PopsToolTipDetails } from "../components/tooltip/types/index";
|
|
11
19
|
|
|
12
20
|
export interface PopsUtilsOwnObject<V extends any> {
|
|
13
21
|
[key: string]: V | PopsUtilsOwnObject<V>;
|
package/src/types/mask.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import type { PopsAlertDetails } from "../components/alert/types";
|
|
2
|
+
import type { PopsDrawerDetails } from "../components/drawer/types";
|
|
3
|
+
import type { PopsFolderDetails } from "../components/folder/types";
|
|
4
|
+
import type { PopsIframeDetails } from "../components/iframe/types";
|
|
5
|
+
import type { PopsLoadingDetails } from "../components/loading/types";
|
|
6
|
+
import type { PopsPanelDetails } from "../components/panel/types";
|
|
7
|
+
import type { PopsPromptDetails } from "../components/prompt/types/index";
|
|
8
|
+
|
|
1
9
|
/**
|
|
2
10
|
* 遮罩层配置
|
|
3
11
|
*/
|
|
@@ -7,8 +7,8 @@ import type {
|
|
|
7
7
|
PopsDOMUtils_Event,
|
|
8
8
|
PopsDOMUtilsElementEventType,
|
|
9
9
|
} from "../types/PopsDOMUtilsEventType";
|
|
10
|
-
import { SymbolEvents } from "
|
|
11
|
-
import { OriginPrototype, PopsCore } from "../
|
|
10
|
+
import { SymbolEvents } from "./PopsDOMUtilsEventsConfig";
|
|
11
|
+
import { OriginPrototype, PopsCore } from "../PopsCore";
|
|
12
12
|
import { popsUtils } from "./PopsUtils";
|
|
13
13
|
import { PopsSafeUtils } from "./PopsSafeUtils";
|
|
14
14
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type { PopsAlertDetails } from "../components/alert/
|
|
2
|
-
import type { PopsConfirmDetails } from "../components/confirm/
|
|
3
|
-
import type { PopsDrawerDetails } from "../components/drawer/
|
|
4
|
-
import type { PopsFolderDetails } from "../components/folder/
|
|
5
|
-
import type { PopsIframeDetails } from "../components/iframe/
|
|
6
|
-
import type { PopsLoadingDetails } from "../components/loading/
|
|
7
|
-
import type { PopsPanelDetails } from "../components/panel/
|
|
8
|
-
import type { PopsPromptDetails } from "../components/prompt/
|
|
1
|
+
import type { PopsAlertDetails } from "../components/alert/types";
|
|
2
|
+
import type { PopsConfirmDetails } from "../components/confirm/types";
|
|
3
|
+
import type { PopsDrawerDetails } from "../components/drawer/types";
|
|
4
|
+
import type { PopsFolderDetails } from "../components/folder/types";
|
|
5
|
+
import type { PopsIframeDetails } from "../components/iframe/types";
|
|
6
|
+
import type { PopsLoadingDetails } from "../components/loading/types";
|
|
7
|
+
import type { PopsPanelDetails } from "../components/panel/types";
|
|
8
|
+
import type { PopsPromptDetails } from "../components/prompt/types/index";
|
|
9
9
|
import type { PopsLayerCommonConfig } from "../types/layer";
|
|
10
10
|
import type { PopsLayerMode } from "../types/main";
|
|
11
11
|
import { popsDOMUtils } from "./PopsDOMUtils";
|
|
12
12
|
import { popsUtils } from "./PopsUtils";
|
|
13
|
-
import { PopsCore } from "../
|
|
14
|
-
import {
|
|
13
|
+
import { PopsCore } from "../PopsCore";
|
|
14
|
+
import { PopsLayerData } from "../PopsLayer";
|
|
15
15
|
import { PopsAnimation } from "../PopsAnimation";
|
|
16
16
|
|
|
17
17
|
export const PopsInstanceUtils = {
|
|
@@ -121,8 +121,8 @@ export const PopsInstanceUtils = {
|
|
|
121
121
|
function isVisibleNode($css: CSSStyleDeclaration): boolean {
|
|
122
122
|
return $css.position !== "static" && $css.display !== "none";
|
|
123
123
|
}
|
|
124
|
-
Object.keys(
|
|
125
|
-
let layerList =
|
|
124
|
+
Object.keys(PopsLayerData).forEach((layerName) => {
|
|
125
|
+
let layerList = PopsLayerData[layerName as PopsLayerMode];
|
|
126
126
|
for (let index = 0; index < layerList.length; index++) {
|
|
127
127
|
const layer = layerList[index];
|
|
128
128
|
let nodeStyle = window.getComputedStyle(layer.animElement);
|