@whitesev/pops 3.3.5 → 4.0.1
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 +13099 -12934
- package/dist/index.amd.js.map +1 -1
- package/dist/index.amd.min.js +1 -1
- package/dist/index.amd.min.js.map +1 -1
- package/dist/index.cjs.js +752 -587
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.esm.js +752 -587
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.iife.js +13100 -12935
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/index.iife.min.js.map +1 -1
- package/dist/index.system.js +13103 -12938
- package/dist/index.system.js.map +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/dist/index.umd.js +13102 -12937
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/types/src/Pops.d.ts +131 -77
- package/dist/types/src/PopsAnimation.d.ts +33 -0
- package/dist/types/src/PopsIcon.d.ts +1 -1
- package/dist/types/src/components/alert/index.d.ts +3 -1
- package/dist/types/src/components/confirm/index.d.ts +3 -1
- package/dist/types/src/components/drawer/index.d.ts +3 -1
- package/dist/types/src/components/folder/index.d.ts +3 -1
- package/dist/types/src/components/iframe/index.d.ts +6 -1
- package/dist/types/src/components/iframe/types/index.d.ts +4 -2
- package/dist/types/src/components/loading/index.d.ts +3 -1
- package/dist/types/src/components/panel/handlerComponents.d.ts +4 -1
- package/dist/types/src/components/panel/index.d.ts +2 -16
- package/dist/types/src/components/panel/types/index.d.ts +7 -2
- package/dist/types/src/components/prompt/index.d.ts +3 -1
- package/dist/types/src/components/searchSuggestion/index.d.ts +4 -1
- package/dist/types/src/components/tooltip/index.d.ts +5 -1
- package/dist/types/src/config/GlobalConfig.d.ts +63 -23
- package/dist/types/src/event/EventEmiter.d.ts +33 -0
- package/dist/types/src/handler/PopsHandler.d.ts +16 -11
- package/dist/types/src/handler/PopsInstHandler.d.ts +67 -0
- package/dist/types/src/types/EventEmitter.d.ts +18 -0
- package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +4 -0
- package/dist/types/src/types/button.d.ts +2 -1
- package/dist/types/src/types/event.d.ts +6 -2
- package/dist/types/src/types/inst.d.ts +4 -4
- package/dist/types/src/utils/PopsDOMUtils.d.ts +0 -16
- package/dist/types/src/utils/PopsInstanceUtils.d.ts +1 -89
- package/dist/types/src/utils/PopsUtils.d.ts +57 -0
- package/package.json +3 -3
- package/src/Pops.ts +7 -2
- package/src/PopsAnimation.ts +126 -0
- package/src/components/alert/index.ts +9 -9
- package/src/components/confirm/index.ts +9 -9
- package/src/components/drawer/index.ts +12 -9
- package/src/components/folder/index.ts +9 -8
- package/src/components/iframe/index.ts +18 -12
- package/src/components/iframe/types/index.ts +10 -8
- package/src/components/loading/index.ts +12 -6
- package/src/components/panel/defaultConfig.ts +1 -0
- package/src/components/panel/handlerComponents.ts +41 -111
- package/src/components/panel/index.ts +34 -28
- package/src/components/panel/types/index.ts +7 -2
- package/src/components/prompt/index.ts +9 -8
- package/src/components/rightClickMenu/index.ts +17 -14
- package/src/components/searchSuggestion/index.ts +5 -1
- package/src/components/tooltip/index.ts +20 -10
- package/src/config/GlobalConfig.ts +21 -14
- package/src/css/index.css +2 -0
- package/src/event/EventEmiter.ts +95 -0
- package/src/handler/PopsElementHandler.ts +8 -6
- package/src/handler/PopsHandler.ts +65 -48
- package/src/handler/PopsInstHandler.ts +557 -0
- package/src/types/EventEmitter.d.ts +18 -0
- package/src/types/PopsDOMUtilsEventType.d.ts +4 -0
- package/src/types/button.d.ts +2 -1
- package/src/types/event.d.ts +6 -2
- package/src/types/inst.d.ts +4 -4
- package/src/utils/PopsDOMUtils.ts +1 -40
- package/src/utils/PopsInstanceUtils.ts +10 -639
- package/src/utils/PopsUtils.ts +194 -0
package/dist/types/src/Pops.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import type { PopsRightClickMenuConfig } from "./components/rightClickMenu/types
|
|
|
10
10
|
import type { PopsSearchSuggestionConfig } from "./components/searchSuggestion/types/index";
|
|
11
11
|
import { PopsTooltip } from "./components/tooltip";
|
|
12
12
|
import type { PopsToolTipConfig } from "./components/tooltip/types/index";
|
|
13
|
+
import { EventEmiter } from "./event/EventEmiter";
|
|
13
14
|
import { popsUtils } from "./utils/PopsUtils";
|
|
14
15
|
declare class Pops {
|
|
15
16
|
/** 配置 */
|
|
@@ -37,16 +38,16 @@ declare class Pops {
|
|
|
37
38
|
};
|
|
38
39
|
/** icon图标的svg代码 */
|
|
39
40
|
iconSVG: {
|
|
41
|
+
loading: string;
|
|
42
|
+
close: string;
|
|
40
43
|
min: string;
|
|
41
|
-
mise: string;
|
|
42
44
|
max: string;
|
|
43
|
-
|
|
45
|
+
search: string;
|
|
46
|
+
mise: string;
|
|
44
47
|
edit: string;
|
|
45
48
|
share: string;
|
|
46
49
|
delete: string;
|
|
47
|
-
search: string;
|
|
48
50
|
upload: string;
|
|
49
|
-
loading: string;
|
|
50
51
|
next: string;
|
|
51
52
|
prev: string;
|
|
52
53
|
eleme: string;
|
|
@@ -72,14 +73,14 @@ declare class Pops {
|
|
|
72
73
|
};
|
|
73
74
|
/** 存储已创建的元素 */
|
|
74
75
|
instData: {
|
|
75
|
-
|
|
76
|
+
iframe: import("./types/inst").PopsInstGeneralConfig[];
|
|
77
|
+
folder: import("./types/inst").PopsInstGeneralConfig[];
|
|
76
78
|
alert: import("./types/inst").PopsInstGeneralConfig[];
|
|
77
79
|
confirm: import("./types/inst").PopsInstGeneralConfig[];
|
|
78
80
|
prompt: import("./types/inst").PopsInstGeneralConfig[];
|
|
79
|
-
|
|
81
|
+
loading: import("./types/inst").PopsInstGeneralConfig[];
|
|
80
82
|
tooltip: import("./types/inst").PopsInstGeneralConfig[];
|
|
81
83
|
drawer: import("./types/inst").PopsInstGeneralConfig[];
|
|
82
|
-
folder: import("./types/inst").PopsInstGeneralConfig[];
|
|
83
84
|
panel: import("./types/inst").PopsInstGeneralConfig[];
|
|
84
85
|
rightClickMenu: import("./types/inst").PopsInstGeneralConfig[];
|
|
85
86
|
};
|
|
@@ -89,6 +90,7 @@ declare class Pops {
|
|
|
89
90
|
};
|
|
90
91
|
/** pops使用的工具类 */
|
|
91
92
|
Utils: {
|
|
93
|
+
sleep(timeout: number): Promise<unknown>;
|
|
92
94
|
isWin(target: any): boolean;
|
|
93
95
|
isDOM(target: any): boolean;
|
|
94
96
|
isNodeList($ele: any): $ele is any[] | NodeList;
|
|
@@ -108,6 +110,22 @@ declare class Pops {
|
|
|
108
110
|
setInterval(callback: (...args: any[]) => any, timeout?: number): number;
|
|
109
111
|
clearInterval(timeId: number | undefined): void;
|
|
110
112
|
setArray<T>(target: T, key: keyof T, newArr: any[]): void;
|
|
113
|
+
getMaxZIndexNodeInfoFromPoint($el?: IFunction<HTMLElement | HTMLElement[]>, deviation?: number): {
|
|
114
|
+
zIndex: number;
|
|
115
|
+
originZIndex: number;
|
|
116
|
+
node: HTMLElement | null;
|
|
117
|
+
positionNode: HTMLElement;
|
|
118
|
+
positionX: number;
|
|
119
|
+
positionY: number;
|
|
120
|
+
}[];
|
|
121
|
+
getMaxZIndexNodeInfoFromPoint(deviation: IFunction<number>): {
|
|
122
|
+
zIndex: number;
|
|
123
|
+
originZIndex: number;
|
|
124
|
+
node: HTMLElement | null;
|
|
125
|
+
positionNode: HTMLElement;
|
|
126
|
+
positionX: number;
|
|
127
|
+
positionY: number;
|
|
128
|
+
}[];
|
|
111
129
|
};
|
|
112
130
|
/** pops使用的DOM工具类 */
|
|
113
131
|
DOMUtils: {
|
|
@@ -179,7 +197,6 @@ declare class Pops {
|
|
|
179
197
|
onHover(element: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsTargetElementType | Element | DocumentFragment | Node, handler: (this: HTMLElement, event: import("./types/PopsDOMUtilsEventType").PopsDOMUtils_Event["hover"]) => void, option?: boolean | import("./types/PopsDOMUtilsEventType").PopsDOMUtilsEventListenerOption): import("./types/PopsDOMUtilsEventType").PopsDOMUtilsAddEventListenerResult | undefined;
|
|
180
198
|
onKeyup(target: HTMLElement | string | Window | typeof globalThis, handler: (event: import("./types/PopsDOMUtilsEventType").PopsDOMUtils_Event["keyup"]) => void, option?: boolean | AddEventListenerOptions): import("./types/PopsDOMUtilsEventType").PopsDOMUtilsAddEventListenerResult | undefined;
|
|
181
199
|
onKeydown(target: HTMLElement | Window | typeof globalThis | string, handler: (event: import("./types/PopsDOMUtilsEventType").PopsDOMUtils_Event["keydown"]) => void, option?: boolean | AddEventListenerOptions): import("./types/PopsDOMUtilsEventType").PopsDOMUtilsAddEventListenerResult | undefined;
|
|
182
|
-
onKeypress(target: HTMLElement | Window | typeof globalThis | string, handler: (event: import("./types/PopsDOMUtilsEventType").PopsDOMUtils_Event["keypress"]) => void, option?: boolean | AddEventListenerOptions): import("./types/PopsDOMUtilsEventType").PopsDOMUtilsAddEventListenerResult | undefined;
|
|
183
200
|
preventEvent(event: Event): false;
|
|
184
201
|
preventEvent<T extends boolean>(event: Event, onlyStopPropagation: T): T extends true ? void : false;
|
|
185
202
|
preventEvent($el: HTMLElement, eventNameList: string | string[], option?: {
|
|
@@ -204,30 +221,11 @@ declare class Pops {
|
|
|
204
221
|
};
|
|
205
222
|
/** pops创建的实例使用的工具类 */
|
|
206
223
|
InstanceUtils: {
|
|
207
|
-
getMaxZIndexNodeInfo(deviation?: number, target?: Element | ShadowRoot | Document, ignoreCallBack?: ($ele: Element | HTMLElement | ShadowRoot) => boolean | void): {
|
|
208
|
-
node: Element;
|
|
209
|
-
zIndex: number;
|
|
210
|
-
};
|
|
211
224
|
getPopsMaxZIndex(deviation?: number): {
|
|
212
225
|
zIndex: number;
|
|
213
|
-
animElement:
|
|
226
|
+
animElement: HTMLElement | null;
|
|
214
227
|
isOverMaxZIndex: boolean;
|
|
215
228
|
};
|
|
216
|
-
getMaxZIndex(deviation?: number): number;
|
|
217
|
-
removeInstance(totalInstConfigList: import("./types/inst").PopsInstGeneralConfig[][], guid?: string, isAll?: boolean): Promise<import("./types/inst").PopsInstGeneralConfig[][]>;
|
|
218
|
-
hide(config: PopsAlertConfig | PopsDrawerConfig | PopsPromptConfig | PopsConfirmConfig | PopsIframeConfig | PopsLoadingConfig | PopsPanelConfig | PopsFolderConfig, popsType: import("./types/main").PopsInstStoreType, instConfigList: import("./types/inst").PopsInstGeneralConfig[], guid: string, $anim: HTMLElement, $mask?: HTMLElement): Promise<void>;
|
|
219
|
-
show(config: PopsAlertConfig | PopsDrawerConfig | PopsPromptConfig | PopsConfirmConfig | PopsIframeConfig | PopsLoadingConfig | PopsPanelConfig | PopsFolderConfig, popsType: import("./types/main").PopsInstStoreType, instConfigList: import("./types/inst").PopsInstGeneralConfig[], guid: string, $anim: HTMLElement, $mask?: HTMLElement): Promise<void>;
|
|
220
|
-
close(config: PopsAlertConfig | PopsDrawerConfig | PopsPromptConfig | PopsConfirmConfig | PopsIframeConfig | PopsLoadingConfig | PopsPanelConfig | PopsFolderConfig, popsType: string, instConfigList: import("./types/inst").PopsInstGeneralConfig[], guid: string, $anim: HTMLElement): Promise<void>;
|
|
221
|
-
drag($move: HTMLElement, options: {
|
|
222
|
-
dragElement: HTMLElement;
|
|
223
|
-
limit: boolean;
|
|
224
|
-
emitClick?: boolean;
|
|
225
|
-
extraDistance: number;
|
|
226
|
-
container?: Window | typeof globalThis | HTMLElement;
|
|
227
|
-
moveCallBack?: (moveElement: HTMLElement, left: number, top: number) => void;
|
|
228
|
-
endCallBack?: (moveElement: HTMLElement, left: number, top: number) => void;
|
|
229
|
-
preventEvent?: (event: TouchEvent | PointerEvent) => boolean;
|
|
230
|
-
}): void;
|
|
231
229
|
sortElementListByProperty<T, R>(getBeforeValueFun: (value: T) => R, getAfterValueFun: (value: T) => R, sortByDesc?: boolean): (after_obj: T, before_obj: T) => 1 | 0 | -1;
|
|
232
230
|
};
|
|
233
231
|
/** pops处理float类型使用的工具类 */
|
|
@@ -258,6 +256,7 @@ declare class Pops {
|
|
|
258
256
|
nodeStoreConfigKey: string;
|
|
259
257
|
};
|
|
260
258
|
$config: Required<PopsPanelConfig>;
|
|
259
|
+
emitter: EventEmiter<import("./components/panel/types").PopsPanelEventType>;
|
|
261
260
|
init(data: {
|
|
262
261
|
config: Required<PopsPanelConfig>;
|
|
263
262
|
$el: {
|
|
@@ -271,6 +270,7 @@ declare class Pops {
|
|
|
271
270
|
$panelBottomLeftContainer: HTMLElement;
|
|
272
271
|
$panelBottomRightContainer: HTMLElement;
|
|
273
272
|
};
|
|
273
|
+
emitter: EventEmiter<import("./components/panel/types").PopsPanelEventType>;
|
|
274
274
|
}): void;
|
|
275
275
|
clearContainer(): void;
|
|
276
276
|
clearDeepMenuContainer(): void;
|
|
@@ -687,6 +687,28 @@ declare class Pops {
|
|
|
687
687
|
uListContainerAddItem(viewConfig: import("./components/panel/types").PopsPanelViewConfig, containerOptions: Omit<import("./components/panel/types/components-common").PopsPanelRightAsideContainerConfig, "target">): void;
|
|
688
688
|
onAsideItemClick($asideItem: HTMLElement, asideConfig: import("./components/panel/types").PopsPanelContentConfig): void;
|
|
689
689
|
};
|
|
690
|
+
/** pops.panel中的动画 */
|
|
691
|
+
PopsAnimation: {
|
|
692
|
+
$data: {
|
|
693
|
+
[key: string]: CSSKeyframesRule;
|
|
694
|
+
};
|
|
695
|
+
$flag: {
|
|
696
|
+
isInit: boolean;
|
|
697
|
+
};
|
|
698
|
+
init(): void;
|
|
699
|
+
hasAnim(name: string): boolean;
|
|
700
|
+
createSwitchElementWithAnimation($el: HTMLElement, $next: HTMLElement, option: {
|
|
701
|
+
useAnimation?: boolean;
|
|
702
|
+
animOptions?: KeyframeAnimationOptions;
|
|
703
|
+
enterToAddElementCallback: () => IPromise<void>;
|
|
704
|
+
exitToRemoveElementCallback?: () => IPromise<void>;
|
|
705
|
+
}): {
|
|
706
|
+
enter(): Promise<void>;
|
|
707
|
+
exit(): Promise<void>;
|
|
708
|
+
};
|
|
709
|
+
};
|
|
710
|
+
/** 事件类 */
|
|
711
|
+
EventEmiter: typeof EventEmiter;
|
|
690
712
|
};
|
|
691
713
|
init(): void;
|
|
692
714
|
/**
|
|
@@ -705,61 +727,105 @@ declare class Pops {
|
|
|
705
727
|
*/
|
|
706
728
|
GlobalConfig: {
|
|
707
729
|
config: {
|
|
708
|
-
style?: string |
|
|
709
|
-
zIndex?:
|
|
730
|
+
style?: IFunction<string> | null | undefined;
|
|
731
|
+
zIndex?: IFunction<string | number> | null | undefined;
|
|
710
732
|
} & Partial<import("./types/components").PopsGeneralConfig> & Partial<import("./types/components").PopsDragConfig>;
|
|
711
733
|
setGlobalConfig(config: {
|
|
712
|
-
style?: string |
|
|
713
|
-
zIndex?:
|
|
734
|
+
style?: IFunction<string> | null | undefined;
|
|
735
|
+
zIndex?: IFunction<string | number> | null | undefined;
|
|
714
736
|
} & Partial<import("./types/components").PopsGeneralConfig> & Partial<import("./types/components").PopsDragConfig>): void;
|
|
715
737
|
getGlobalConfig(): {
|
|
716
|
-
style?:
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
738
|
+
style?: {
|
|
739
|
+
zIndex: ((IFunction<string | number> | null) & IFunction<number>) | undefined;
|
|
740
|
+
} | Omit<(IFunction<string> & string) | null | undefined, "zIndex"> | undefined;
|
|
741
|
+
zIndex?: {
|
|
742
|
+
zIndex: ((IFunction<string | number> | null) & IFunction<number>) | undefined;
|
|
743
|
+
} | Omit<((IFunction<string | number> | null) & IFunction<number>) | undefined, "zIndex"> | undefined;
|
|
744
|
+
useShadowRoot?: {
|
|
745
|
+
zIndex: ((IFunction<string | number> | null) & IFunction<number>) | undefined;
|
|
746
|
+
} | Omit<boolean | undefined, "zIndex"> | undefined;
|
|
747
|
+
class?: {
|
|
748
|
+
zIndex: ((IFunction<string | number> | null) & IFunction<number>) | undefined;
|
|
749
|
+
} | Omit<string | undefined, "zIndex"> | undefined;
|
|
750
|
+
only?: {
|
|
751
|
+
zIndex: ((IFunction<string | number> | null) & IFunction<number>) | undefined;
|
|
752
|
+
} | Omit<boolean | undefined, "zIndex"> | undefined;
|
|
753
|
+
width?: {
|
|
754
|
+
zIndex: ((IFunction<string | number> | null) & IFunction<number>) | undefined;
|
|
755
|
+
} | Omit<string | undefined, "zIndex"> | undefined;
|
|
756
|
+
height?: {
|
|
757
|
+
zIndex: ((IFunction<string | number> | null) & IFunction<number>) | undefined;
|
|
758
|
+
} | Omit<string | undefined, "zIndex"> | undefined;
|
|
759
|
+
position?: {
|
|
760
|
+
zIndex: ((IFunction<string | number> | null) & IFunction<number>) | undefined;
|
|
761
|
+
} | Omit<import("./types/position").PopsPosition | undefined, "zIndex"> | undefined;
|
|
762
|
+
animation?: {
|
|
763
|
+
zIndex: ((IFunction<string | number> | null) & IFunction<number>) | undefined;
|
|
764
|
+
} | Omit<import("./types/animation").PopsAnimation | undefined, "zIndex"> | undefined;
|
|
765
|
+
mask?: {
|
|
766
|
+
zIndex: ((IFunction<string | number> | null) & IFunction<number>) | undefined;
|
|
767
|
+
} | Omit<import("./types/mask").PopsMaskConfig | undefined, "zIndex"> | undefined;
|
|
768
|
+
forbiddenScroll?: {
|
|
769
|
+
zIndex: ((IFunction<string | number> | null) & IFunction<number>) | undefined;
|
|
770
|
+
} | Omit<boolean | undefined, "zIndex"> | undefined;
|
|
771
|
+
lightStyle?: {
|
|
772
|
+
zIndex: ((IFunction<string | number> | null) & IFunction<number>) | undefined;
|
|
773
|
+
} | Omit<string | null | undefined, "zIndex"> | undefined;
|
|
774
|
+
darkStyle?: {
|
|
775
|
+
zIndex: ((IFunction<string | number> | null) & IFunction<number>) | undefined;
|
|
776
|
+
} | Omit<string | null | undefined, "zIndex"> | undefined;
|
|
777
|
+
stopKeyDownEventPropagation?: {
|
|
778
|
+
zIndex: ((IFunction<string | number> | null) & IFunction<number>) | undefined;
|
|
779
|
+
} | Omit<boolean | undefined, "zIndex"> | undefined;
|
|
780
|
+
beforeAppendToPageCallBack?: {
|
|
781
|
+
zIndex: ((IFunction<string | number> | null) & IFunction<number>) | undefined;
|
|
782
|
+
} | Omit<(($shadowRoot: ShadowRoot | HTMLElement, $shadowContainer: HTMLDivElement) => void) | undefined, "zIndex"> | undefined;
|
|
783
|
+
drag?: {
|
|
784
|
+
zIndex: ((IFunction<string | number> | null) & IFunction<number>) | undefined;
|
|
785
|
+
} | Omit<boolean | undefined, "zIndex"> | undefined;
|
|
786
|
+
dragLimit?: {
|
|
787
|
+
zIndex: ((IFunction<string | number> | null) & IFunction<number>) | undefined;
|
|
788
|
+
} | Omit<boolean | undefined, "zIndex"> | undefined;
|
|
789
|
+
dragExtraDistance?: {
|
|
790
|
+
zIndex: ((IFunction<string | number> | null) & IFunction<number>) | undefined;
|
|
791
|
+
} | Omit<number | undefined, "zIndex"> | undefined;
|
|
792
|
+
dragMoveCallBack?: {
|
|
793
|
+
zIndex: ((IFunction<string | number> | null) & IFunction<number>) | undefined;
|
|
794
|
+
} | Omit<((moveElement: HTMLElement, left: number, top: number) => void) | undefined, "zIndex"> | undefined;
|
|
795
|
+
dragEndCallBack?: {
|
|
796
|
+
zIndex: ((IFunction<string | number> | null) & IFunction<number>) | undefined;
|
|
797
|
+
} | Omit<((moveElement: HTMLElement, left: number, top: number) => void) | undefined, "zIndex"> | undefined;
|
|
736
798
|
};
|
|
737
799
|
};
|
|
738
800
|
/**
|
|
739
801
|
* 普通信息框
|
|
740
802
|
* @param config 配置
|
|
741
803
|
*/
|
|
742
|
-
alert: (config: PopsAlertConfig) => Omit<import("./types/event").PopsEventConfig
|
|
804
|
+
alert: (config: PopsAlertConfig) => Omit<import("./types/event").PopsEventConfig<EventEmiter<import("./types/EventEmitter").EventMap>>, "function" | "type">;
|
|
743
805
|
/**
|
|
744
806
|
* 询问框
|
|
745
807
|
* @param config 配置
|
|
746
808
|
*/
|
|
747
|
-
confirm: (config: PopsConfirmConfig) => Omit<import("./types/event").PopsEventConfig
|
|
809
|
+
confirm: (config: PopsConfirmConfig) => Omit<import("./types/event").PopsEventConfig<EventEmiter<import("./types/EventEmitter").EventMap>>, "function" | "type">;
|
|
748
810
|
/**
|
|
749
811
|
* 输入框
|
|
750
812
|
* @param config 配置
|
|
751
813
|
*/
|
|
752
|
-
prompt: (config: PopsPromptConfig) => Omit<import("./types/event").PopsEventConfig
|
|
814
|
+
prompt: (config: PopsPromptConfig) => Omit<import("./types/event").PopsEventConfig<EventEmiter<import("./types/EventEmitter").EventMap>>, "function" | "type">;
|
|
753
815
|
/**
|
|
754
816
|
* 加载层
|
|
755
817
|
* @param config 配置
|
|
756
818
|
*/
|
|
757
|
-
loading: (config: PopsLoadingConfig) => Omit<Omit<import("./types/event").PopsEventConfig
|
|
819
|
+
loading: (config: PopsLoadingConfig) => Omit<Omit<import("./types/event").PopsEventConfig<EventEmiter<import("./types/EventEmitter").EventMap>>, "$shadowContainer" | "$shadowRoot">, "function" | "type">;
|
|
758
820
|
/**
|
|
759
821
|
* iframe层
|
|
760
822
|
* @param config 配置
|
|
761
823
|
*/
|
|
762
|
-
iframe: (config: PopsIframeConfig) => Omit<import("./components/iframe/types").PopsIframeClickEventConfig
|
|
824
|
+
iframe: (config: PopsIframeConfig) => Omit<import("./components/iframe/types").PopsIframeClickEventConfig<EventEmiter<{
|
|
825
|
+
"pops:iframe-min": (eventConfig: import("./components/iframe/types").PopsIframeClickEventConfig, event: MouseEvent | PointerEvent) => void;
|
|
826
|
+
"pops:iframe-mise": (eventConfig: import("./components/iframe/types").PopsIframeClickEventConfig, event: MouseEvent | PointerEvent) => void;
|
|
827
|
+
"pops:iframe-max": (eventConfig: import("./components/iframe/types").PopsIframeClickEventConfig, event: MouseEvent | PointerEvent) => void;
|
|
828
|
+
}>>, "function" | "type">;
|
|
763
829
|
/**
|
|
764
830
|
* 提示框
|
|
765
831
|
* @param config 配置
|
|
@@ -789,47 +855,34 @@ declare class Pops {
|
|
|
789
855
|
showArrow: boolean;
|
|
790
856
|
arrowDistance: number;
|
|
791
857
|
otherDistance: number;
|
|
792
|
-
zIndex: IFunction<number>;
|
|
793
|
-
style: string | null;
|
|
794
858
|
useShadowRoot: boolean;
|
|
795
859
|
only: boolean;
|
|
860
|
+
zIndex: IFunction<number>;
|
|
861
|
+
style: string | null;
|
|
796
862
|
lightStyle: string | null;
|
|
797
863
|
darkStyle: string | null;
|
|
798
864
|
beforeAppendToPageCallBack: ($shadowRoot: ShadowRoot | HTMLElement, $shadowContainer: HTMLDivElement) => void;
|
|
799
865
|
};
|
|
800
866
|
$shadowContainer: HTMLDivElement;
|
|
801
|
-
$shadowRoot:
|
|
867
|
+
$shadowRoot: HTMLElement | ShadowRoot;
|
|
802
868
|
toolTip: import("./components/tooltip").ToolTip;
|
|
869
|
+
emitter: EventEmiter<import("./types/EventEmitter").EventMap>;
|
|
803
870
|
};
|
|
804
871
|
/**
|
|
805
872
|
* 抽屉
|
|
806
873
|
* @param config 配置
|
|
807
874
|
*/
|
|
808
|
-
drawer: (config: PopsDrawerConfig) => Omit<import("./types/event").PopsEventConfig
|
|
875
|
+
drawer: (config: PopsDrawerConfig) => Omit<import("./types/event").PopsEventConfig<EventEmiter<import("./types/EventEmitter").EventMap>>, "function" | "type">;
|
|
809
876
|
/**
|
|
810
877
|
* 文件夹
|
|
811
878
|
* @param config 配置
|
|
812
879
|
*/
|
|
813
|
-
folder: (config: PopsFolderConfig) => Omit<import("./types/event").PopsEventConfig
|
|
880
|
+
folder: (config: PopsFolderConfig) => Omit<import("./types/event").PopsEventConfig<EventEmiter<import("./types/EventEmitter").EventMap>>, "function" | "type">;
|
|
814
881
|
/**
|
|
815
882
|
* 配置面板
|
|
816
883
|
* @param config 配置
|
|
817
884
|
*/
|
|
818
|
-
panel: (config: PopsPanelConfig) =>
|
|
819
|
-
addEventListener: <K extends keyof import("./components/panel/types").PopsPanelEventType>(event: K, listener: (evt: CustomEvent<import("./components/panel/types").PopsPanelEventType[K]>) => void, options?: boolean | EventListenerOptions) => void;
|
|
820
|
-
removeEventListener: <K extends keyof import("./components/panel/types").PopsPanelEventType>(event: K, listener: (evt: CustomEvent<import("./components/panel/types").PopsPanelEventType[K]>) => void, options?: boolean | EventListenerOptions) => void;
|
|
821
|
-
close: () => Promise<void>;
|
|
822
|
-
hide: () => Promise<void>;
|
|
823
|
-
mode: import("./types/main").PopsType;
|
|
824
|
-
show: ($parent?: HTMLElement | Document | ShadowRoot) => Promise<void>;
|
|
825
|
-
$shadowContainer: HTMLDivElement;
|
|
826
|
-
$shadowRoot: ShadowRoot | HTMLElement;
|
|
827
|
-
$el: HTMLDivElement;
|
|
828
|
-
$anim: HTMLDivElement;
|
|
829
|
-
$pops: HTMLDivElement;
|
|
830
|
-
$mask?: HTMLDivElement | undefined;
|
|
831
|
-
guid: string;
|
|
832
|
-
};
|
|
885
|
+
panel: (config: PopsPanelConfig) => Omit<import("./types/event").PopsEventConfig<EventEmiter<import("./components/panel/types").PopsPanelEventType>>, "function" | "type">;
|
|
833
886
|
/**
|
|
834
887
|
* 右键菜单
|
|
835
888
|
* @param config 配置
|
|
@@ -908,6 +961,7 @@ declare class Pops {
|
|
|
908
961
|
* searchSuggestion.setAllEvent();
|
|
909
962
|
*/
|
|
910
963
|
searchSuggestion: <T = any>(config: PopsSearchSuggestionConfig<T>) => {
|
|
964
|
+
emitter: EventEmiter<import("./types/EventEmitter").EventMap>;
|
|
911
965
|
selfDocument: ShadowRoot | Document | (ShadowRoot | Document)[];
|
|
912
966
|
$el: {
|
|
913
967
|
root: HTMLElement;
|
|
@@ -11,4 +11,37 @@ export declare const PopsAnimation: {
|
|
|
11
11
|
* 判断是否存在某个动画名
|
|
12
12
|
*/
|
|
13
13
|
hasAnim(name: string): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* 带动画的进入元素
|
|
16
|
+
* @param $el 当前元素
|
|
17
|
+
* @param $next 切换的元素
|
|
18
|
+
* @param option 配置
|
|
19
|
+
*/
|
|
20
|
+
createSwitchElementWithAnimation($el: HTMLElement, $next: HTMLElement, option: {
|
|
21
|
+
/**
|
|
22
|
+
* 是否使用动画
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
useAnimation?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* 动画配置
|
|
28
|
+
*
|
|
29
|
+
* + `duration`: 默认`220`
|
|
30
|
+
* + `easing`: 默认`"ease-in-out"`
|
|
31
|
+
*/
|
|
32
|
+
animOptions?: KeyframeAnimationOptions;
|
|
33
|
+
/** 为$next内部添加元素 */
|
|
34
|
+
enterToAddElementCallback: () => IPromise<void>;
|
|
35
|
+
/** 退出时移除$next元素 */
|
|
36
|
+
exitToRemoveElementCallback?: () => IPromise<void>;
|
|
37
|
+
}): {
|
|
38
|
+
/**
|
|
39
|
+
* 进入
|
|
40
|
+
*/
|
|
41
|
+
enter(): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* 退出
|
|
44
|
+
*/
|
|
45
|
+
exit(): Promise<void>;
|
|
46
|
+
};
|
|
14
47
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { EventEmiter } from "../../event/EventEmiter";
|
|
2
|
+
import type { EventMap } from "../../types/EventEmitter";
|
|
1
3
|
import type { PopsAlertConfig } from "./types";
|
|
2
4
|
export declare const PopsAlert: {
|
|
3
|
-
init(__config__: PopsAlertConfig): Omit<import("../../types/event").PopsEventConfig
|
|
5
|
+
init(__config__: PopsAlertConfig): Omit<import("../../types/event").PopsEventConfig<EventEmiter<EventMap>>, "function" | "type">;
|
|
4
6
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { EventEmiter } from "../../event/EventEmiter";
|
|
2
|
+
import type { EventMap } from "../../types/EventEmitter";
|
|
1
3
|
import type { PopsConfirmConfig } from "./types";
|
|
2
4
|
export declare const PopsConfirm: {
|
|
3
|
-
init(__config__: PopsConfirmConfig): Omit<import("../../types/event").PopsEventConfig
|
|
5
|
+
init(__config__: PopsConfirmConfig): Omit<import("../../types/event").PopsEventConfig<EventEmiter<EventMap>>, "function" | "type">;
|
|
4
6
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { EventEmiter } from "../../event/EventEmiter";
|
|
2
|
+
import type { EventMap } from "../../types/EventEmitter";
|
|
1
3
|
import type { PopsDrawerConfig } from "./types";
|
|
2
4
|
export declare const PopsDrawer: {
|
|
3
|
-
init(__config__: PopsDrawerConfig): Omit<import("../../types/event").PopsEventConfig
|
|
5
|
+
init(__config__: PopsDrawerConfig): Omit<import("../../types/event").PopsEventConfig<EventEmiter<EventMap>>, "function" | "type">;
|
|
4
6
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { EventEmiter } from "../../event/EventEmiter";
|
|
2
|
+
import type { EventMap } from "../../types/EventEmitter";
|
|
1
3
|
import type { PopsFolderConfig } from "./types";
|
|
2
4
|
export declare const PopsFolder: {
|
|
3
|
-
init(__config__: PopsFolderConfig): Omit<import("../../types/event").PopsEventConfig
|
|
5
|
+
init(__config__: PopsFolderConfig): Omit<import("../../types/event").PopsEventConfig<EventEmiter<EventMap>>, "function" | "type">;
|
|
4
6
|
};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import { EventEmiter } from "../../event/EventEmiter";
|
|
1
2
|
import type { PopsIframeClickEventConfig, PopsIframeConfig } from "./types";
|
|
2
3
|
export declare const PopsIframe: {
|
|
3
|
-
init(__config__: PopsIframeConfig): Omit<PopsIframeClickEventConfig
|
|
4
|
+
init(__config__: PopsIframeConfig): Omit<PopsIframeClickEventConfig<EventEmiter<{
|
|
5
|
+
"pops:iframe-min": (eventConfig: PopsIframeClickEventConfig, event: MouseEvent | PointerEvent) => void;
|
|
6
|
+
"pops:iframe-mise": (eventConfig: PopsIframeClickEventConfig, event: MouseEvent | PointerEvent) => void;
|
|
7
|
+
"pops:iframe-max": (eventConfig: PopsIframeClickEventConfig, event: MouseEvent | PointerEvent) => void;
|
|
8
|
+
}>>, "function" | "type">;
|
|
4
9
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { EventEmiter } from "../../../event/EventEmiter";
|
|
2
|
+
import type { PopsDragConfig, PopsGeneralConfig, PopsTitleConfig } from "../../../types/components";
|
|
2
3
|
import type { PopsEventConfig } from "../../../types/event";
|
|
4
|
+
import type { CustomEventMap } from "../../../types/EventEmitter";
|
|
3
5
|
/**
|
|
4
6
|
* pops.iframe的按钮点击事件回调的配置参数
|
|
5
7
|
*/
|
|
6
|
-
export type PopsIframeClickEventConfig = PopsEventConfig & {
|
|
8
|
+
export type PopsIframeClickEventConfig<E extends EventEmiter<CustomEventMap> = EventEmiter<CustomEventMap>> = PopsEventConfig<E> & {
|
|
7
9
|
/**
|
|
8
10
|
* iframe元素
|
|
9
11
|
*/
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { EventEmiter } from "../../event/EventEmiter";
|
|
2
|
+
import type { EventMap } from "../../types/EventEmitter";
|
|
1
3
|
import type { PopsLoadingConfig } from "./types";
|
|
2
4
|
export declare const PopsLoading: {
|
|
3
|
-
init(__config__: PopsLoadingConfig): Omit<Omit<import("../../types/event").PopsEventConfig
|
|
5
|
+
init(__config__: PopsLoadingConfig): Omit<Omit<import("../../types/event").PopsEventConfig<EventEmiter<EventMap>>, "$shadowContainer" | "$shadowRoot">, "function" | "type">;
|
|
4
6
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { EventEmiter } from "../../event/EventEmiter";
|
|
1
2
|
import { popsUtils } from "../../utils/PopsUtils";
|
|
2
3
|
import { PopsTooltip } from "../tooltip";
|
|
3
|
-
import type { PopsPanelBottomContentConfig, PopsPanelConfig, PopsPanelContentConfig, PopsPanelViewConfig } from "./types";
|
|
4
|
+
import type { PopsPanelBottomContentConfig, PopsPanelConfig, PopsPanelContentConfig, PopsPanelEventType, PopsPanelViewConfig } from "./types";
|
|
4
5
|
import type { PopsPanelButtonConfig } from "./types/components-button";
|
|
5
6
|
import type { PopsPanelGeneralConfig, PopsPanelRightAsideContainerConfig } from "./types/components-common";
|
|
6
7
|
import type { PopsPanelContainerConfig } from "./types/components-container";
|
|
@@ -55,6 +56,7 @@ export declare const PanelHandlerComponents: () => {
|
|
|
55
56
|
nodeStoreConfigKey: string;
|
|
56
57
|
};
|
|
57
58
|
$config: Required<PopsPanelConfig>;
|
|
59
|
+
emitter: EventEmiter<PopsPanelEventType>;
|
|
58
60
|
/**
|
|
59
61
|
* 初始化
|
|
60
62
|
* @param data
|
|
@@ -72,6 +74,7 @@ export declare const PanelHandlerComponents: () => {
|
|
|
72
74
|
$panelBottomLeftContainer: HTMLElement;
|
|
73
75
|
$panelBottomRightContainer: HTMLElement;
|
|
74
76
|
};
|
|
77
|
+
emitter: EventEmiter<PopsPanelEventType>;
|
|
75
78
|
}): void;
|
|
76
79
|
/**
|
|
77
80
|
* 清空container容器的元素
|
|
@@ -1,19 +1,5 @@
|
|
|
1
|
+
import { EventEmiter } from "../../event/EventEmiter";
|
|
1
2
|
import type { PopsPanelConfig, PopsPanelEventType } from "./types";
|
|
2
|
-
import type { PopsType } from "../../types/main";
|
|
3
3
|
export declare const PopsPanel: {
|
|
4
|
-
init(__config__: PopsPanelConfig):
|
|
5
|
-
addEventListener: <K extends keyof PopsPanelEventType>(event: K, listener: (evt: CustomEvent<PopsPanelEventType[K]>) => void, options?: boolean | EventListenerOptions) => void;
|
|
6
|
-
removeEventListener: <K extends keyof PopsPanelEventType>(event: K, listener: (evt: CustomEvent<PopsPanelEventType[K]>) => void, options?: boolean | EventListenerOptions) => void;
|
|
7
|
-
mode: PopsType;
|
|
8
|
-
close: () => Promise<void>;
|
|
9
|
-
hide: () => Promise<void>;
|
|
10
|
-
show: ($parent?: HTMLElement | Document | ShadowRoot) => Promise<void>;
|
|
11
|
-
$shadowContainer: HTMLDivElement;
|
|
12
|
-
$shadowRoot: ShadowRoot | HTMLElement;
|
|
13
|
-
$el: HTMLDivElement;
|
|
14
|
-
$anim: HTMLDivElement;
|
|
15
|
-
$pops: HTMLDivElement;
|
|
16
|
-
$mask?: HTMLDivElement | undefined;
|
|
17
|
-
guid: string;
|
|
18
|
-
};
|
|
4
|
+
init(__config__: PopsPanelConfig): Omit<import("../../types/event").PopsEventConfig<EventEmiter<PopsPanelEventType>>, "function" | "type">;
|
|
19
5
|
};
|
|
@@ -26,12 +26,12 @@ export type PopsPanelEventType = {
|
|
|
26
26
|
/**
|
|
27
27
|
* 该事件在右侧容器内的元素改变时触发
|
|
28
28
|
*/
|
|
29
|
-
"pops:renderRightContainer": {
|
|
29
|
+
"pops:renderRightContainer": (data: {
|
|
30
30
|
/**
|
|
31
31
|
* 视图配置
|
|
32
32
|
*/
|
|
33
33
|
viewConfig: PopsPanelContentConfig[] | PopsPanelDeepViewConfig;
|
|
34
|
-
};
|
|
34
|
+
}) => void;
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
37
37
|
* pops.panel的content配置信息
|
|
@@ -217,4 +217,9 @@ export interface PopsPanelConfig extends PopsTitleConfig, PopsDragConfig, PopsGe
|
|
|
217
217
|
* @default true
|
|
218
218
|
*/
|
|
219
219
|
useDeepMenuSwtichAnimation?: true;
|
|
220
|
+
/**
|
|
221
|
+
* 监听按键按下Esc来退出内部菜单
|
|
222
|
+
* @default true
|
|
223
|
+
*/
|
|
224
|
+
listenEscapeKeyUpToExitDeepMenu?: boolean;
|
|
220
225
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { EventEmiter } from "../../event/EventEmiter";
|
|
2
|
+
import type { EventMap } from "../../types/EventEmitter";
|
|
1
3
|
import type { PopsPromptConfig } from "./types/index";
|
|
2
4
|
export declare const PopsPrompt: {
|
|
3
|
-
init(__config__: PopsPromptConfig): Omit<import("../../types/event").PopsEventConfig
|
|
5
|
+
init(__config__: PopsPromptConfig): Omit<import("../../types/event").PopsEventConfig<EventEmiter<EventMap>>, "function" | "type">;
|
|
4
6
|
};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import { EventEmiter } from "../../event/EventEmiter";
|
|
2
|
+
import type { EventMap } from "../../types/EventEmitter";
|
|
1
3
|
import type { PopsSearchSuggestionConfig, PopsSearchSuggestionData } from "./types/index";
|
|
2
4
|
export declare const PopsSearchSuggestion: {
|
|
3
5
|
init<T>(__config__: PopsSearchSuggestionConfig<T>): {
|
|
6
|
+
emitter: EventEmiter<EventMap>;
|
|
4
7
|
/**
|
|
5
8
|
* 当前的环境,可以是document,可以是shadowroot,默认是document
|
|
6
9
|
*/
|
|
7
|
-
selfDocument:
|
|
10
|
+
selfDocument: ShadowRoot | Document | (ShadowRoot | Document)[];
|
|
8
11
|
$el: {
|
|
9
12
|
/** 根元素 */
|
|
10
13
|
root: HTMLElement;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { EventEmiter } from "../../event/EventEmiter";
|
|
2
|
+
import type { EventMap } from "../../types/EventEmitter";
|
|
1
3
|
import type { PopsToolTipConfig } from "./types/index";
|
|
2
4
|
type ToolTipEventTypeName = "MouseEvent" | "TouchEvent";
|
|
3
5
|
export declare class ToolTip {
|
|
@@ -8,6 +10,7 @@ export declare class ToolTip {
|
|
|
8
10
|
$content: HTMLElement;
|
|
9
11
|
$arrow: HTMLElement;
|
|
10
12
|
};
|
|
13
|
+
emitter: EventEmiter<EventMap>;
|
|
11
14
|
$data: {
|
|
12
15
|
config: Required<PopsToolTipConfig>;
|
|
13
16
|
guid: string;
|
|
@@ -17,7 +20,7 @@ export declare class ToolTip {
|
|
|
17
20
|
constructor(config: Required<PopsToolTipConfig>, guid: string, ShadowInfo: {
|
|
18
21
|
$shadowContainer: HTMLDivElement;
|
|
19
22
|
$shadowRoot: ShadowRoot | HTMLElement;
|
|
20
|
-
});
|
|
23
|
+
}, emitter: EventEmiter<EventMap>);
|
|
21
24
|
init(): void;
|
|
22
25
|
/**
|
|
23
26
|
* 创建提示元素
|
|
@@ -215,6 +218,7 @@ export declare const PopsTooltip: {
|
|
|
215
218
|
$shadowContainer: HTMLDivElement;
|
|
216
219
|
$shadowRoot: HTMLElement | ShadowRoot;
|
|
217
220
|
toolTip: ToolTip;
|
|
221
|
+
emitter: EventEmiter<EventMap>;
|
|
218
222
|
};
|
|
219
223
|
};
|
|
220
224
|
export {};
|