@whitesev/pops 2.4.6 → 2.4.7
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 +578 -571
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +578 -571
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +578 -571
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +578 -571
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +578 -571
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +578 -571
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +252 -252
- package/dist/types/src/types/animation.d.ts +19 -19
- package/dist/types/src/types/button.d.ts +187 -187
- package/dist/types/src/types/components.d.ts +210 -210
- package/dist/types/src/types/event.d.ts +63 -63
- package/dist/types/src/types/global.d.ts +25 -25
- package/dist/types/src/types/icon.d.ts +32 -32
- package/dist/types/src/types/inst.d.ts +24 -24
- package/dist/types/src/types/main.d.ts +111 -111
- package/dist/types/src/types/mask.d.ts +49 -49
- package/dist/types/src/types/position.d.ts +60 -60
- package/index.ts +3 -0
- package/package.json +4 -2
- package/src/Pops.ts +206 -0
- package/src/PopsAnimation.ts +32 -0
- package/src/PopsCSS.ts +51 -0
- package/src/PopsCore.ts +64 -0
- package/src/PopsIcon.ts +95 -0
- package/src/PopsInst.ts +21 -0
- package/src/components/alert/config.ts +62 -0
- package/src/components/alert/index.css +0 -0
- package/src/components/alert/index.ts +163 -0
- package/src/components/alert/types/index.ts +23 -0
- package/src/components/confirm/config.ts +90 -0
- package/src/components/confirm/index.css +0 -0
- package/src/components/confirm/index.ts +166 -0
- package/src/components/confirm/types/index.ts +17 -0
- package/src/components/drawer/config.ts +89 -0
- package/src/components/drawer/index.css +37 -0
- package/src/components/drawer/index.ts +237 -0
- package/src/components/drawer/types/index.ts +61 -0
- package/src/components/folder/config.ts +147 -0
- package/src/components/folder/folderIcon.ts +28 -0
- package/src/components/folder/index.css +303 -0
- package/src/components/folder/index.ts +929 -0
- package/src/components/folder/types/index.ts +97 -0
- package/src/components/iframe/config.ts +60 -0
- package/src/components/iframe/index.css +76 -0
- package/src/components/iframe/index.ts +334 -0
- package/src/components/iframe/types/index.ts +139 -0
- package/src/components/loading/config.ts +29 -0
- package/src/components/loading/index.css +66 -0
- package/src/components/loading/index.ts +99 -0
- package/src/components/loading/types/index.ts +34 -0
- package/src/components/panel/config.ts +519 -0
- package/src/components/panel/handlerComponents.ts +2900 -0
- package/src/components/panel/index.css +1222 -0
- package/src/components/panel/index.ts +207 -0
- package/src/components/panel/types/components-button.ts +68 -0
- package/src/components/panel/types/components-common.ts +50 -0
- package/src/components/panel/types/components-deepMenu.ts +84 -0
- package/src/components/panel/types/components-forms.ts +44 -0
- package/src/components/panel/types/components-input.ts +78 -0
- package/src/components/panel/types/components-own.ts +30 -0
- package/src/components/panel/types/components-select.ts +93 -0
- package/src/components/panel/types/components-selectMultiple.ts +130 -0
- package/src/components/panel/types/components-slider.ts +77 -0
- package/src/components/panel/types/components-switch.ts +56 -0
- package/src/components/panel/types/components-textarea.ts +68 -0
- package/src/components/panel/types/index.ts +177 -0
- package/src/components/prompt/config.ts +94 -0
- package/src/components/prompt/index.css +34 -0
- package/src/components/prompt/index.ts +216 -0
- package/src/components/prompt/types/index.ts +55 -0
- package/src/components/rightClickMenu/config.ts +98 -0
- package/src/components/rightClickMenu/index.css +112 -0
- package/src/components/rightClickMenu/index.ts +602 -0
- package/src/components/rightClickMenu/types/index.ts +97 -0
- package/src/components/searchSuggestion/config.ts +56 -0
- package/src/components/searchSuggestion/index.ts +856 -0
- package/src/components/searchSuggestion/types/index.ts +239 -0
- package/src/components/tooltip/config.ts +34 -0
- package/src/components/tooltip/index.css +199 -0
- package/src/components/tooltip/index.ts +604 -0
- package/src/components/tooltip/types/index.ts +117 -0
- package/src/config/CommonCSSClassName.ts +17 -0
- package/src/config/GlobalConfig.ts +63 -0
- package/src/css/animation.css +987 -0
- package/src/css/button.css +551 -0
- package/src/css/common.css +48 -0
- package/src/css/index.css +253 -0
- package/src/css/ninePalaceGridPosition.css +50 -0
- package/src/css/scrollbar.css +22 -0
- package/src/handler/PopsElementHandler.ts +304 -0
- package/src/handler/PopsHandler.ts +589 -0
- package/src/svg/arrowLeft.svg +4 -0
- package/src/svg/arrowRight.svg +4 -0
- package/src/svg/chromeFilled.svg +11 -0
- package/src/svg/circleClose.svg +8 -0
- package/src/svg/close.svg +5 -0
- package/src/svg/cpu.svg +8 -0
- package/src/svg/delete.svg +5 -0
- package/src/svg/documentCopy.svg +5 -0
- package/src/svg/edit.svg +8 -0
- package/src/svg/eleme.svg +5 -0
- package/src/svg/elemePlus.svg +5 -0
- package/src/svg/headset.svg +5 -0
- package/src/svg/hide.svg +8 -0
- package/src/svg/keyboard.svg +8 -0
- package/src/svg/loading.svg +5 -0
- package/src/svg/max.svg +5 -0
- package/src/svg/min.svg +5 -0
- package/src/svg/mise.svg +5 -0
- package/src/svg/monitor.svg +5 -0
- package/src/svg/next.svg +5 -0
- package/src/svg/picture.svg +8 -0
- package/src/svg/prev.svg +5 -0
- package/src/svg/search.svg +5 -0
- package/src/svg/share.svg +5 -0
- package/src/svg/upload.svg +5 -0
- package/src/svg/videoPause.svg +5 -0
- package/src/svg/videoPlay.svg +5 -0
- package/src/svg/view.svg +5 -0
- package/src/types/PopsDOMUtilsEventType.d.ts +252 -0
- package/src/types/animation.d.ts +19 -0
- package/src/types/button.d.ts +187 -0
- package/src/types/components.d.ts +210 -0
- package/src/types/event.d.ts +63 -0
- package/src/types/global.d.ts +25 -0
- package/src/types/icon.d.ts +32 -0
- package/src/types/inst.d.ts +24 -0
- package/src/types/main.d.ts +111 -0
- package/src/types/mask.d.ts +49 -0
- package/src/types/position.d.ts +60 -0
- package/src/utils/PopsDOMUtils.ts +2408 -0
- package/src/utils/PopsDOMUtilsEventsConfig.ts +4 -0
- package/src/utils/PopsInstanceUtils.ts +688 -0
- package/src/utils/PopsMathUtils.ts +71 -0
- package/src/utils/PopsSafeUtils.ts +22 -0
- package/src/utils/PopsUtils.ts +406 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 通用的CSS类名
|
|
3
|
+
*/
|
|
4
|
+
export const PopsCommonCSSClassName = {
|
|
5
|
+
flexCenter: "pops-flex-items-center",
|
|
6
|
+
flexYCenter: "pops-flex-y-center",
|
|
7
|
+
flexXCenter: "pops-flex-x-center",
|
|
8
|
+
hide: "pops-hide",
|
|
9
|
+
hideImportant: "pops-hide-important",
|
|
10
|
+
noBorder: "pops-no-border",
|
|
11
|
+
noBorderImportant: "pops-no-border-important",
|
|
12
|
+
userSelectNone: "pops-user-select-none",
|
|
13
|
+
lineHeightCenter: "pops-line-height-center",
|
|
14
|
+
widthFill: "pops-width-fill",
|
|
15
|
+
textIsDisabled: "pops-text-is-disabled",
|
|
16
|
+
textIsDisabledImportant: "pops-text-is-disabled-important",
|
|
17
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { PopsCommonConfig, PopsDragConfig } from "../types/components";
|
|
2
|
+
|
|
3
|
+
type EnterReturnType<T> = null | T | (() => T);
|
|
4
|
+
|
|
5
|
+
type GlobalConfigOption = {
|
|
6
|
+
style?: EnterReturnType<string>;
|
|
7
|
+
zIndex?: EnterReturnType<number> | EnterReturnType<string>;
|
|
8
|
+
} & Partial<PopsCommonConfig> &
|
|
9
|
+
Partial<PopsDragConfig>;
|
|
10
|
+
|
|
11
|
+
type ResultGlobalConfigOption<T> = T extends null | undefined ? never : T extends (...args: any) => infer R ? R : T;
|
|
12
|
+
|
|
13
|
+
export const GlobalConfig = {
|
|
14
|
+
config: {} as GlobalConfigOption,
|
|
15
|
+
/**
|
|
16
|
+
* 为所有弹窗设置全局属性
|
|
17
|
+
*/
|
|
18
|
+
setGlobalConfig(config: GlobalConfigOption) {
|
|
19
|
+
Reflect.ownKeys(config).forEach((keyName) => {
|
|
20
|
+
Reflect.set(GlobalConfig.config, keyName, Reflect.get(config, keyName));
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
/**
|
|
24
|
+
* 获取全局配置
|
|
25
|
+
*/
|
|
26
|
+
getGlobalConfig() {
|
|
27
|
+
const result: {
|
|
28
|
+
[P in keyof GlobalConfigOption]: ResultGlobalConfigOption<GlobalConfigOption[P]>;
|
|
29
|
+
} = {};
|
|
30
|
+
Object.keys(GlobalConfig.config).forEach((keyName) => {
|
|
31
|
+
const configValue = Reflect.get(GlobalConfig.config, keyName);
|
|
32
|
+
if (keyName === "style") {
|
|
33
|
+
// 设置style属性
|
|
34
|
+
const style = configValue == null ? "" : typeof configValue === "function" ? configValue() : configValue;
|
|
35
|
+
|
|
36
|
+
if (typeof style === "string") {
|
|
37
|
+
result.style = style;
|
|
38
|
+
}
|
|
39
|
+
} else if (keyName === "zIndex") {
|
|
40
|
+
// 设置zIndex属性
|
|
41
|
+
let zIndex = configValue == null ? "" : typeof configValue === "function" ? configValue() : configValue;
|
|
42
|
+
if (typeof zIndex === "string") {
|
|
43
|
+
const newIndex = (zIndex = Number(zIndex));
|
|
44
|
+
if (!isNaN(newIndex)) {
|
|
45
|
+
result.zIndex = newIndex;
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
if (!isNaN(zIndex)) {
|
|
49
|
+
result.zIndex = zIndex;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
} else if (keyName === "mask") {
|
|
53
|
+
const mask = GlobalConfig.config.mask == null ? {} : GlobalConfig.config.mask;
|
|
54
|
+
if (typeof mask === "object" && mask != null) {
|
|
55
|
+
result.mask = mask;
|
|
56
|
+
}
|
|
57
|
+
} else {
|
|
58
|
+
Reflect.set(result, keyName, configValue);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
return result;
|
|
62
|
+
},
|
|
63
|
+
};
|