@whitesev/pops 2.1.4 → 2.1.6
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 +172 -112
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +172 -112
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +172 -112
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +172 -112
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +172 -112
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +172 -112
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/GlobalConfig.d.ts +7 -2
- package/dist/types/src/Pops.d.ts +52 -34
- 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} +16 -13
- package/dist/types/src/components/panel/index.d.ts +1 -1
- 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} +12 -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/button.d.ts +5 -39
- package/dist/types/src/types/event.d.ts +1 -1
- package/dist/types/src/types/main.d.ts +18 -18
- package/dist/types/src/types/mask.d.ts +7 -7
- 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 +3 -2
- package/src/GlobalConfig.ts +6 -5
- package/src/Pops.ts +30 -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.css +0 -47
- package/src/components/alert/index.ts +3 -3
- package/src/components/alert/{indexType.ts → types/index.ts} +2 -2
- package/src/components/confirm/config.ts +1 -1
- package/src/components/confirm/index.css +0 -47
- package/src/components/confirm/index.ts +5 -5
- package/src/components/confirm/{indexType.ts → types/index.ts} +1 -1
- package/src/components/drawer/config.ts +1 -1
- package/src/components/drawer/index.css +0 -17
- package/src/components/drawer/index.ts +3 -4
- package/src/components/drawer/{indexType.ts → types/index.ts} +1 -1
- package/src/components/folder/config.ts +24 -10
- package/src/components/folder/index.css +67 -62
- package/src/components/folder/index.ts +5 -5
- package/src/components/folder/{indexType.ts → types/index.ts} +1 -1
- package/src/components/iframe/config.ts +1 -1
- package/src/components/iframe/index.css +3 -33
- package/src/components/iframe/index.ts +9 -9
- package/src/components/iframe/{indexType.ts → types/index.ts} +2 -2
- package/src/components/loading/config.ts +1 -1
- package/src/components/loading/index.css +17 -12
- package/src/components/loading/index.ts +6 -6
- 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} +29 -15
- package/src/components/panel/index.css +136 -63
- package/src/components/panel/index.ts +6 -6
- 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} +12 -12
- package/src/components/prompt/config.ts +1 -1
- package/src/components/prompt/index.css +23 -51
- package/src/components/prompt/index.ts +7 -7
- package/src/components/prompt/{indexType.ts → types/index.ts} +1 -1
- package/src/components/rightClickMenu/config.ts +1 -1
- package/src/components/rightClickMenu/index.css +14 -3
- 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 +21 -6
- package/src/components/searchSuggestion/{indexType.ts → types/index.ts} +1 -1
- package/src/components/tooltip/config.ts +1 -1
- package/src/components/tooltip/index.css +39 -19
- package/src/components/tooltip/index.ts +1 -1
- package/src/components/tooltip/{indexType.ts → types/index.ts} +1 -1
- package/src/css/button.css +354 -98
- package/src/css/index.css +88 -16
- package/src/handler/PopsElementHandler.ts +5 -5
- package/src/handler/PopsHandler.ts +26 -26
- package/src/types/button.d.ts +5 -39
- package/src/types/event.d.ts +1 -1
- package/src/types/main.d.ts +18 -18
- package/src/types/mask.d.ts +7 -7
- 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 +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { PopsSearchSuggestionDetails } from "./
|
|
1
|
+
import type { PopsSearchSuggestionDetails } from "./types/index";
|
|
2
2
|
export declare const PopsSearchSuggestion: {
|
|
3
3
|
init(details: PopsSearchSuggestionDetails): {
|
|
4
4
|
/**
|
|
5
5
|
* 当前的环境,可以是document,可以是shadowroot,默认是document
|
|
6
6
|
*/
|
|
7
|
-
selfDocument:
|
|
7
|
+
selfDocument: ShadowRoot | Document | (ShadowRoot | Document)[];
|
|
8
8
|
$el: {
|
|
9
9
|
/** 根元素 */
|
|
10
10
|
root: HTMLElement;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { PopsToolTipDetails } from "./
|
|
1
|
+
import type { PopsToolTipDetails } from "./types/index";
|
|
2
2
|
export declare const PopsTooltipConfig: () => DeepRequired<PopsToolTipDetails>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PopsToolTipDetails } from "./
|
|
1
|
+
import type { PopsToolTipDetails } from "./types/index";
|
|
2
2
|
type ToolTipEventTypeName = "MouseEvent" | "TouchEvent";
|
|
3
3
|
export declare class ToolTip {
|
|
4
4
|
$el: {
|
|
@@ -185,7 +185,7 @@ export declare const PopsTooltip: {
|
|
|
185
185
|
target: HTMLElement;
|
|
186
186
|
content: string | (() => string);
|
|
187
187
|
isDiffContent: boolean;
|
|
188
|
-
position: import("./
|
|
188
|
+
position: import("./types/index").PopsTooltipPosition;
|
|
189
189
|
className: string;
|
|
190
190
|
isFixed: boolean;
|
|
191
191
|
alwaysShow: boolean;
|
|
@@ -1,11 +1,11 @@
|
|
|
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 { PopsCommonConfig } from "../types/components";
|
|
10
10
|
import { PopsEventDetails, PopsHandlerEventDetails } from "../types/event";
|
|
11
11
|
import { PopsLayerCommonConfig } from "../types/layer";
|
|
@@ -16,7 +16,8 @@ export type PopsButtonStyleType =
|
|
|
16
16
|
| "success"
|
|
17
17
|
| "info"
|
|
18
18
|
| "warning"
|
|
19
|
-
| "danger"
|
|
19
|
+
| "danger"
|
|
20
|
+
| "violet";
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
23
|
* 按钮大小
|
|
@@ -118,48 +119,13 @@ export interface PopsButtonDetails<T = {}> {
|
|
|
118
119
|
/**
|
|
119
120
|
* 按钮配置(匹配任意类型)
|
|
120
121
|
*/
|
|
121
|
-
export
|
|
122
|
-
/**
|
|
123
|
-
* 是否启用按钮
|
|
124
|
-
*/
|
|
125
|
-
enable: boolean;
|
|
126
|
-
/**
|
|
127
|
-
* 图标按钮,如果名字为内置的,则使用内置的,否则为自定义的svg
|
|
128
|
-
*/
|
|
129
|
-
icon: PopsIconType;
|
|
130
|
-
/**
|
|
131
|
-
* 图标按钮是否放在右边
|
|
132
|
-
*/
|
|
133
|
-
rightIcon: boolean;
|
|
134
|
-
/**
|
|
135
|
-
* 图标按钮是否是旋转360°
|
|
136
|
-
* @default false
|
|
137
|
-
*/
|
|
138
|
-
iconIsLoading: boolean;
|
|
139
|
-
/**
|
|
140
|
-
* 按钮尺寸大小
|
|
141
|
-
* @default ""
|
|
142
|
-
*/
|
|
143
|
-
size: PopsButtonSize;
|
|
122
|
+
export type PopsButtonDetailsAnyType<T = {}> = PopsButtonDetails<T> & {
|
|
144
123
|
/**
|
|
145
124
|
* 按钮样式类型
|
|
125
|
+
* @default "default"
|
|
146
126
|
*/
|
|
147
127
|
type: string;
|
|
148
|
-
|
|
149
|
-
* 按钮文字
|
|
150
|
-
* @default ""
|
|
151
|
-
*/
|
|
152
|
-
text: string;
|
|
153
|
-
/**
|
|
154
|
-
* 按钮点击的回调
|
|
155
|
-
*
|
|
156
|
-
* 如果传入该值,那么将不会自动关闭弹窗
|
|
157
|
-
*/
|
|
158
|
-
callback(
|
|
159
|
-
eventDetails: PopsHandlerEventDetails & T,
|
|
160
|
-
event: PointerEvent | MouseEvent
|
|
161
|
-
): void;
|
|
162
|
-
}
|
|
128
|
+
};
|
|
163
129
|
|
|
164
130
|
/** prompt的点击回调 */
|
|
165
131
|
export interface PopsPromptButtonDetails extends PopsButtonDetails {
|
|
@@ -1,21 +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 { PopsPanelButtonDetails } from "../components/panel/
|
|
8
|
-
import type { PopsPanelDeepMenuDetails } from "../components/panel/
|
|
9
|
-
import type { PopsPanelDetails } from "../components/panel/
|
|
10
|
-
import type { PopsPanelInputDetails } from "../components/panel/
|
|
11
|
-
import type { PopsPanelOwnDetails } from "../components/panel/
|
|
12
|
-
import type { PopsPanelSelectDetails } from "../components/panel/
|
|
13
|
-
import type { PopsPanelSliderDetails } from "../components/panel/
|
|
14
|
-
import type { PopsPanelSwitchDetails } from "../components/panel/
|
|
15
|
-
import type { PopsPanelTextAreaDetails } from "../components/panel/
|
|
16
|
-
import type { PopsPromptDetails } from "../components/prompt/
|
|
17
|
-
import { PopsRightClickMenuDetails } from "../components/rightClickMenu/
|
|
18
|
-
import { PopsToolTipDetails } from "../components/tooltip/
|
|
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";
|
|
19
19
|
|
|
20
20
|
export interface PopsUtilsOwnObject<V extends any> {
|
|
21
21
|
[key: string]: V | PopsUtilsOwnObject<V>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { PopsAlertDetails } from "../components/alert/
|
|
2
|
-
import type { PopsDrawerDetails } from "../components/drawer/
|
|
3
|
-
import type { PopsFolderDetails } from "../components/folder/
|
|
4
|
-
import type { PopsIframeDetails } from "../components/iframe/
|
|
5
|
-
import type { PopsLoadingDetails } from "../components/loading/
|
|
6
|
-
import type { PopsPanelDetails } from "../components/panel/
|
|
7
|
-
import type { PopsPromptDetails } from "../components/prompt/
|
|
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
8
|
|
|
9
9
|
/**
|
|
10
10
|
* 遮罩层配置
|
|
@@ -1,11 +1,11 @@
|
|
|
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
|
export declare const PopsInstanceUtils: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@whitesev/pops",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.6",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "弹窗库",
|
|
7
7
|
"main": "dist/index.cjs.js",
|
|
@@ -42,7 +42,8 @@
|
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@rollup/plugin-commonjs": "^28.0.6",
|
|
44
44
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
45
|
-
"@rollup/plugin-typescript": "
|
|
45
|
+
"@rollup/plugin-typescript": "12.1.4",
|
|
46
|
+
"rollup": "^4.44.2",
|
|
46
47
|
"rollup-plugin-clear": "^2.0.7",
|
|
47
48
|
"rollup-plugin-import-css": "^4.0.1",
|
|
48
49
|
"tslib": "^2.8.1",
|
package/src/GlobalConfig.ts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import type { PopsCommonConfig } from "./types/components";
|
|
1
|
+
import type { PopsCommonConfig, PopsDragConfig } from "./types/components";
|
|
2
2
|
|
|
3
3
|
type EnterReturnType<T> = null | T | (() => T);
|
|
4
4
|
|
|
5
5
|
type GlobalConfigOption = {
|
|
6
6
|
style?: EnterReturnType<string>;
|
|
7
7
|
zIndex?: EnterReturnType<number> | EnterReturnType<string>;
|
|
8
|
-
} & Partial<PopsCommonConfig
|
|
8
|
+
} & Partial<PopsCommonConfig> &
|
|
9
|
+
Partial<PopsDragConfig>;
|
|
9
10
|
|
|
10
11
|
type ResultGlobalConfigOption<T> = T extends null | undefined
|
|
11
12
|
? never
|
|
12
13
|
: T extends (...args: any) => infer R
|
|
13
14
|
? R
|
|
14
15
|
: T;
|
|
16
|
+
|
|
15
17
|
export const GlobalConfig = {
|
|
16
18
|
config: {} as GlobalConfigOption,
|
|
17
19
|
/**
|
|
@@ -39,8 +41,7 @@ export const GlobalConfig = {
|
|
|
39
41
|
configValue == null
|
|
40
42
|
? ""
|
|
41
43
|
: typeof configValue === "function"
|
|
42
|
-
?
|
|
43
|
-
configValue()
|
|
44
|
+
? configValue()
|
|
44
45
|
: configValue;
|
|
45
46
|
|
|
46
47
|
if (typeof style === "string") {
|
|
@@ -55,7 +56,7 @@ export const GlobalConfig = {
|
|
|
55
56
|
? configValue()
|
|
56
57
|
: configValue;
|
|
57
58
|
if (typeof zIndex === "string") {
|
|
58
|
-
let newIndex = (zIndex =
|
|
59
|
+
let newIndex = (zIndex = Number(zIndex));
|
|
59
60
|
if (!isNaN(newIndex)) {
|
|
60
61
|
result.zIndex = newIndex;
|
|
61
62
|
}
|
package/src/Pops.ts
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
import { popsDOMUtils } from "./utils/PopsDOMUtils";
|
|
2
2
|
import { PopsInstanceUtils } from "./utils/PopsInstanceUtils";
|
|
3
3
|
import { popsUtils } from "./utils/PopsUtils";
|
|
4
|
-
import { PopsCore } from "./
|
|
4
|
+
import { PopsCore } from "./PopsCore";
|
|
5
5
|
import { PopsAlert } from "./components/alert";
|
|
6
|
-
import type { PopsAlertDetails } from "./components/alert/
|
|
6
|
+
import type { PopsAlertDetails } from "./components/alert/types";
|
|
7
7
|
import { PopsConfirm } from "./components/confirm";
|
|
8
|
-
import type { PopsConfirmDetails } from "./components/confirm/
|
|
9
|
-
import type { PopsPromptDetails } from "./components/prompt/
|
|
8
|
+
import type { PopsConfirmDetails } from "./components/confirm/types";
|
|
9
|
+
import type { PopsPromptDetails } from "./components/prompt/types/index";
|
|
10
10
|
import { PopsPrompt } from "./components/prompt";
|
|
11
|
-
import type { PopsLoadingDetails } from "./components/loading/
|
|
11
|
+
import type { PopsLoadingDetails } from "./components/loading/types";
|
|
12
12
|
import { PopsLoading } from "./components/loading";
|
|
13
|
-
import type { PopsIframeDetails } from "./components/iframe/
|
|
13
|
+
import type { PopsIframeDetails } from "./components/iframe/types";
|
|
14
14
|
import { PopsIframe } from "./components/iframe";
|
|
15
|
-
import type { PopsToolTipDetails } from "./components/tooltip/
|
|
15
|
+
import type { PopsToolTipDetails } from "./components/tooltip/types/index";
|
|
16
16
|
import { PopsDrawer } from "./components/drawer";
|
|
17
|
-
import type { PopsDrawerDetails } from "./components/drawer/
|
|
18
|
-
import type { PopsFolderDetails } from "./components/folder/
|
|
17
|
+
import type { PopsDrawerDetails } from "./components/drawer/types";
|
|
18
|
+
import type { PopsFolderDetails } from "./components/folder/types";
|
|
19
19
|
import { PopsFolder } from "./components/folder";
|
|
20
|
-
import type { PopsPanelDetails } from "./components/panel/
|
|
20
|
+
import type { PopsPanelDetails } from "./components/panel/types";
|
|
21
21
|
import { PopsPanel } from "./components/panel";
|
|
22
22
|
import { PopsRightClickMenu } from "./components/rightClickMenu";
|
|
23
|
-
import type { PopsRightClickMenuDetails } from "./components/rightClickMenu/
|
|
24
|
-
import type { PopsSearchSuggestionDetails } from "./components/searchSuggestion/
|
|
23
|
+
import type { PopsRightClickMenuDetails } from "./components/rightClickMenu/types";
|
|
24
|
+
import type { PopsSearchSuggestionDetails } from "./components/searchSuggestion/types/index";
|
|
25
25
|
import { PopsSearchSuggestion } from "./components/searchSuggestion";
|
|
26
26
|
import { PopsMathFloatUtils } from "./utils/PopsMathUtils";
|
|
27
|
-
import {
|
|
27
|
+
import { PanelHandlerComponents } from "./components/panel/handlerComponents";
|
|
28
28
|
import { GlobalConfig } from "./GlobalConfig";
|
|
29
29
|
import { PopsTooltip } from "./components/tooltip";
|
|
30
30
|
import { PopsCSS } from "./PopsCSS";
|
|
31
31
|
import { PopsIcon } from "./PopsIcon";
|
|
32
|
-
import {
|
|
32
|
+
import { PopsLayerData } from "./PopsLayer";
|
|
33
33
|
import { PopsAnimation } from "./PopsAnimation";
|
|
34
34
|
|
|
35
35
|
class Pops {
|
|
36
36
|
/** 配置 */
|
|
37
37
|
config = {
|
|
38
38
|
/** 版本号 */
|
|
39
|
-
version: "2025.
|
|
39
|
+
version: "2025.7.7",
|
|
40
40
|
cssText: PopsCSS,
|
|
41
41
|
/** icon图标的svg代码 */
|
|
42
42
|
iconSVG: PopsIcon.$data,
|
|
43
43
|
/** 当前已配置的动画@keyframes名字映射(初始化时生成) */
|
|
44
44
|
animation: PopsAnimation.$data,
|
|
45
45
|
/** 存储已创建的元素 */
|
|
46
|
-
layer:
|
|
46
|
+
layer: PopsLayerData,
|
|
47
47
|
/** 禁止滚动 */
|
|
48
48
|
forbiddenScroll: {
|
|
49
49
|
event(event: Event) {
|
|
@@ -59,7 +59,7 @@ class Pops {
|
|
|
59
59
|
/** pops处理float类型使用的工具类 */
|
|
60
60
|
MathFloatUtils: PopsMathFloatUtils,
|
|
61
61
|
/** pops.panel中用于处理各个类型的工具 */
|
|
62
|
-
|
|
62
|
+
PanelHandlerComponents: PanelHandlerComponents,
|
|
63
63
|
};
|
|
64
64
|
init() {}
|
|
65
65
|
/**
|
|
@@ -183,7 +183,20 @@ class Pops {
|
|
|
183
183
|
|
|
184
184
|
/**
|
|
185
185
|
* 搜索建议
|
|
186
|
+
*
|
|
187
|
+
* 注意:调用后需要主动调用.init()和.setAllEvent()进行初始化
|
|
186
188
|
* @param details 配置
|
|
189
|
+
* @example
|
|
190
|
+
* let $input = document.querySelector("#input");
|
|
191
|
+
* let searchSuggestion = pops.searchSuggestion({
|
|
192
|
+
* target: $input,
|
|
193
|
+
* inputTarget: $input,
|
|
194
|
+
* getItemHTML: function (item) {
|
|
195
|
+
* return item.value;
|
|
196
|
+
* }
|
|
197
|
+
* });
|
|
198
|
+
* searchSuggestion.init();
|
|
199
|
+
* searchSuggestion.setAllEvent();
|
|
187
200
|
*/
|
|
188
201
|
searchSuggestion = <T = any>(details: PopsSearchSuggestionDetails<T>) => {
|
|
189
202
|
let popsSearchSuggestion = PopsSearchSuggestion.init(details);
|
|
@@ -1,24 +1,20 @@
|
|
|
1
|
+
interface PopsCoreOption {
|
|
2
|
+
document: Document;
|
|
3
|
+
window: Window;
|
|
4
|
+
globalThis: typeof globalThis;
|
|
5
|
+
self: typeof globalThis;
|
|
6
|
+
}
|
|
7
|
+
|
|
1
8
|
const PopsCoreDefaultEnv: PopsCoreOption = {
|
|
2
9
|
document: document,
|
|
3
10
|
window: window,
|
|
4
11
|
globalThis: globalThis,
|
|
5
12
|
self: self,
|
|
6
13
|
};
|
|
7
|
-
const PopsCoreEnv: PopsCoreOption = {
|
|
8
|
-
document: document,
|
|
9
|
-
window: window,
|
|
10
|
-
globalThis: globalThis,
|
|
11
|
-
self: self,
|
|
12
|
-
};
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
document: Document;
|
|
16
|
-
window: Window;
|
|
17
|
-
globalThis: typeof globalThis;
|
|
18
|
-
self: typeof globalThis;
|
|
19
|
-
}
|
|
15
|
+
const PopsCoreEnv: PopsCoreOption = Object.assign({}, PopsCoreDefaultEnv);
|
|
20
16
|
|
|
21
|
-
|
|
17
|
+
const PopsCore = {
|
|
22
18
|
init(option?: PopsCoreOption) {
|
|
23
19
|
if (!option) {
|
|
24
20
|
option = Object.assign({}, PopsCoreDefaultEnv);
|
|
@@ -38,8 +34,11 @@ export const PopsCore = {
|
|
|
38
34
|
return PopsCoreEnv.self;
|
|
39
35
|
},
|
|
40
36
|
};
|
|
41
|
-
|
|
37
|
+
|
|
38
|
+
const OriginPrototype = {
|
|
42
39
|
Object: {
|
|
43
40
|
defineProperty: Object.defineProperty,
|
|
44
41
|
},
|
|
45
42
|
};
|
|
43
|
+
|
|
44
|
+
export { PopsCoreOption, PopsCore, OriginPrototype };
|
package/src/PopsIcon.ts
CHANGED
|
@@ -28,39 +28,41 @@ import SVG_keyboard from "./svg/keyboard.svg";
|
|
|
28
28
|
import SVG_arrowRight from "./svg/arrowRight.svg";
|
|
29
29
|
import SVG_arrowLeft from "./svg/arrowLeft.svg";
|
|
30
30
|
|
|
31
|
+
const PopsIconData: {
|
|
32
|
+
[key in PopsIconType]: string;
|
|
33
|
+
} = {
|
|
34
|
+
min: SVG_min,
|
|
35
|
+
mise: SVG_mise,
|
|
36
|
+
max: SVG_max,
|
|
37
|
+
close: SVG_close,
|
|
38
|
+
edit: SVG_edit,
|
|
39
|
+
share: SVG_share,
|
|
40
|
+
delete: SVG_delete,
|
|
41
|
+
search: SVG_search,
|
|
42
|
+
upload: SVG_upload,
|
|
43
|
+
loading: SVG_loading,
|
|
44
|
+
next: SVG_next,
|
|
45
|
+
prev: SVG_prev,
|
|
46
|
+
eleme: SVG_eleme,
|
|
47
|
+
elemePlus: SVG_elemePlus,
|
|
48
|
+
chromeFilled: SVG_chromeFilled,
|
|
49
|
+
cpu: SVG_cpu,
|
|
50
|
+
videoPlay: SVG_videoPlay,
|
|
51
|
+
videoPause: SVG_videoPause,
|
|
52
|
+
headset: SVG_headset,
|
|
53
|
+
monitor: SVG_monitor,
|
|
54
|
+
documentCopy: SVG_documentCopy,
|
|
55
|
+
picture: SVG_picture,
|
|
56
|
+
circleClose: SVG_circleClose,
|
|
57
|
+
view: SVG_view,
|
|
58
|
+
hide: SVG_hide,
|
|
59
|
+
keyboard: SVG_keyboard,
|
|
60
|
+
arrowRight: SVG_arrowRight,
|
|
61
|
+
arrowLeft: SVG_arrowLeft,
|
|
62
|
+
};
|
|
63
|
+
|
|
31
64
|
export const PopsIcon = {
|
|
32
|
-
$data:
|
|
33
|
-
min: SVG_min,
|
|
34
|
-
mise: SVG_mise,
|
|
35
|
-
max: SVG_max,
|
|
36
|
-
close: SVG_close,
|
|
37
|
-
edit: SVG_edit,
|
|
38
|
-
share: SVG_share,
|
|
39
|
-
delete: SVG_delete,
|
|
40
|
-
search: SVG_search,
|
|
41
|
-
upload: SVG_upload,
|
|
42
|
-
loading: SVG_loading,
|
|
43
|
-
next: SVG_next,
|
|
44
|
-
prev: SVG_prev,
|
|
45
|
-
eleme: SVG_eleme,
|
|
46
|
-
elemePlus: SVG_elemePlus,
|
|
47
|
-
chromeFilled: SVG_chromeFilled,
|
|
48
|
-
cpu: SVG_cpu,
|
|
49
|
-
videoPlay: SVG_videoPlay,
|
|
50
|
-
videoPause: SVG_videoPause,
|
|
51
|
-
headset: SVG_headset,
|
|
52
|
-
monitor: SVG_monitor,
|
|
53
|
-
documentCopy: SVG_documentCopy,
|
|
54
|
-
picture: SVG_picture,
|
|
55
|
-
circleClose: SVG_circleClose,
|
|
56
|
-
view: SVG_view,
|
|
57
|
-
hide: SVG_hide,
|
|
58
|
-
keyboard: SVG_keyboard,
|
|
59
|
-
arrowRight: SVG_arrowRight,
|
|
60
|
-
arrowLeft: SVG_arrowLeft,
|
|
61
|
-
} as {
|
|
62
|
-
[key in PopsIconType]: string;
|
|
63
|
-
},
|
|
65
|
+
$data: PopsIconData,
|
|
64
66
|
/**
|
|
65
67
|
* 判断是否存在某个icon
|
|
66
68
|
* @param iconName 图标名
|
package/src/PopsLayer.ts
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import type { PopsLayerCommonConfig } from "./types/layer";
|
|
2
2
|
import type { PopsLayerMode } from "./types/main";
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const PopsLayerData: {
|
|
5
|
+
[key in PopsLayerMode]: PopsLayerCommonConfig[];
|
|
6
|
+
} = {
|
|
5
7
|
alert: [],
|
|
6
8
|
confirm: [],
|
|
7
|
-
prompt: [],
|
|
8
|
-
loading: [],
|
|
9
|
-
iframe: [],
|
|
10
|
-
tooltip: [],
|
|
11
9
|
drawer: [],
|
|
12
10
|
folder: [],
|
|
11
|
+
iframe: [],
|
|
12
|
+
loading: [],
|
|
13
13
|
panel: [],
|
|
14
|
+
prompt: [],
|
|
14
15
|
rightClickMenu: [],
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
// 没有 searchSuggestion
|
|
17
|
+
tooltip: [],
|
|
17
18
|
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
.pops[type-value] .pops-alert-title {
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
justify-content: space-between;
|
|
5
|
-
}
|
|
6
|
-
.pops[type-value="alert"] .pops-alert-title {
|
|
7
|
-
width: 100%;
|
|
8
|
-
height: var(--container-title-height);
|
|
9
|
-
border-bottom: 1px solid rgb(229, 229, 229, var(--pops-bd-opacity));
|
|
10
|
-
}
|
|
11
|
-
.pops[type-value="alert"] .pops-alert-title p[pops] {
|
|
12
|
-
width: 100%;
|
|
13
|
-
overflow: hidden;
|
|
14
|
-
color: rgb(51, 51, 51);
|
|
15
|
-
text-indent: 15px;
|
|
16
|
-
text-overflow: ellipsis;
|
|
17
|
-
white-space: nowrap;
|
|
18
|
-
font-weight: 500;
|
|
19
|
-
line-height: normal;
|
|
20
|
-
}
|
|
21
|
-
.pops[type-value="alert"] .pops-alert-content {
|
|
22
|
-
width: 100%;
|
|
23
|
-
/*height: calc(
|
|
24
|
-
100% - var(--container-title-height) - var(--container-bottom-btn-height)
|
|
25
|
-
);*/
|
|
26
|
-
flex: 1;
|
|
27
|
-
overflow: auto;
|
|
28
|
-
word-break: break-word;
|
|
29
|
-
}
|
|
30
|
-
.pops[type-value="alert"] .pops-alert-content p[pops] {
|
|
31
|
-
padding: 5px 10px;
|
|
32
|
-
color: rgb(51, 51, 51);
|
|
33
|
-
text-indent: 15px;
|
|
34
|
-
}
|
|
35
|
-
.pops[type-value="alert"] .pops-alert-btn {
|
|
36
|
-
/*position: absolute;
|
|
37
|
-
bottom: 0;*/
|
|
38
|
-
display: flex;
|
|
39
|
-
padding: 10px 10px 10px 10px;
|
|
40
|
-
width: 100%;
|
|
41
|
-
height: var(--container-bottom-btn-height);
|
|
42
|
-
max-height: var(--container-bottom-btn-height);
|
|
43
|
-
line-height: normal;
|
|
44
|
-
border-top: 1px solid rgb(229, 229, 229, var(--pops-bd-opacity));
|
|
45
|
-
text-align: right;
|
|
46
|
-
align-items: center;
|
|
47
|
-
}
|
|
@@ -6,7 +6,7 @@ import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
|
|
|
6
6
|
import { popsUtils } from "../../utils/PopsUtils";
|
|
7
7
|
import { PopsAlertConfig } from "./config";
|
|
8
8
|
import type { PopsMode } from "../../types/main";
|
|
9
|
-
import type { PopsAlertDetails } from "./
|
|
9
|
+
import type { PopsAlertDetails } from "./types";
|
|
10
10
|
import { PopsCSS } from "../../PopsCSS";
|
|
11
11
|
|
|
12
12
|
export const PopsAlert = {
|
|
@@ -48,14 +48,14 @@ export const PopsAlert = {
|
|
|
48
48
|
PopsType,
|
|
49
49
|
config,
|
|
50
50
|
/*html*/ `
|
|
51
|
-
<div class="pops-
|
|
51
|
+
<div class="pops-title pops-${PopsType}-title" style="text-align: ${
|
|
52
52
|
config.title.position
|
|
53
53
|
};${headerStyle}">${
|
|
54
54
|
config.title.html
|
|
55
55
|
? config.title.text
|
|
56
56
|
: `<p pops style="${headerPStyle}">${config.title.text}</p>`
|
|
57
57
|
}${headerBtnHTML}</div>
|
|
58
|
-
<div class="pops-
|
|
58
|
+
<div class="pops-content pops-${PopsType}-content" style="${contentStyle}">${
|
|
59
59
|
config.content.html
|
|
60
60
|
? config.content.text
|
|
61
61
|
: `<p pops style="${contentPStyle}">${config.content.text}</p>`
|
|
@@ -4,11 +4,11 @@ import type {
|
|
|
4
4
|
PopsDragConfig,
|
|
5
5
|
PopsCommonConfig,
|
|
6
6
|
PopsButtonConfig,
|
|
7
|
-
} from "
|
|
7
|
+
} from "../../../types/components";
|
|
8
8
|
import type {
|
|
9
9
|
PopsButtonDetails,
|
|
10
10
|
PopsButtonDetailsAnyType,
|
|
11
|
-
} from "
|
|
11
|
+
} from "../../../types/button";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* pops.alert
|