@whitesev/pops 2.4.4 → 2.4.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/README.md +117 -111
- package/dist/index.amd.js +687 -733
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +687 -733
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +687 -733
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +687 -733
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +687 -733
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +687 -733
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/Pops.d.ts +9 -10
- package/dist/types/src/components/panel/types/components-common.d.ts +26 -26
- package/dist/types/src/components/panel/types/index.d.ts +2 -2
- package/dist/types/src/components/rightClickMenu/index.d.ts +3 -4
- package/dist/types/src/components/searchSuggestion/index.d.ts +2 -2
- package/dist/types/src/components/searchSuggestion/types/index.d.ts +2 -2
- package/dist/types/src/handler/PopsHandler.d.ts +3 -3
- package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +141 -145
- package/dist/types/src/types/animation.d.ts +15 -15
- package/dist/types/src/types/button.d.ts +141 -141
- package/dist/types/src/types/components.d.ts +175 -178
- package/dist/types/src/types/event.d.ts +44 -44
- package/dist/types/src/types/global.d.ts +18 -13
- package/dist/types/src/types/icon.d.ts +28 -28
- package/dist/types/src/types/inst.d.ts +14 -14
- package/dist/types/src/types/main.d.ts +46 -49
- package/dist/types/src/types/mask.d.ts +36 -36
- package/dist/types/src/types/position.d.ts +46 -46
- package/dist/types/src/utils/PopsDOMUtils.d.ts +1 -1
- package/dist/types/src/utils/PopsInstanceUtils.d.ts +1 -1
- package/dist/types/src/utils/PopsUtils.d.ts +16 -16
- package/package.json +17 -8
package/dist/types/src/Pops.d.ts
CHANGED
|
@@ -98,9 +98,9 @@ declare class Pops {
|
|
|
98
98
|
formatByteToSize<T extends boolean>(byteSize: number | string, addType?: T | undefined): T extends true ? string : number;
|
|
99
99
|
AnyTouch: () => typeof import("any-touch").default;
|
|
100
100
|
isPhone(userAgent?: string): boolean;
|
|
101
|
-
setTimeout(callback:
|
|
101
|
+
setTimeout(callback: (...args: any[]) => any, timeout?: number): number;
|
|
102
102
|
clearTimeout(timeId: number | undefined): void;
|
|
103
|
-
setInterval(callback:
|
|
103
|
+
setInterval(callback: (...args: any[]) => any, timeout?: number): number;
|
|
104
104
|
clearInterval(timeId: number | undefined): void;
|
|
105
105
|
};
|
|
106
106
|
/** pops使用的DOM工具类 */
|
|
@@ -164,7 +164,7 @@ declare class Pops {
|
|
|
164
164
|
off<T extends Event>(element: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsElementEventType, eventType: string | string[], selector?: string | string[] | undefined | null, callback?: ((this: HTMLElement, event: T, selectorTarget: HTMLElement) => void) | undefined, option?: EventListenerOptions | boolean, filter?: (value: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsEventListenerOptionsAttribute, index: number, array: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsEventListenerOptionsAttribute[]) => boolean): void;
|
|
165
165
|
offAll(element: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsElementEventType, eventType?: string): void;
|
|
166
166
|
offAll(element: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsElementEventType, eventType?: import("./types/PopsDOMUtilsEventType").PopsDOMUtils_EventType | import("./types/PopsDOMUtilsEventType").PopsDOMUtils_EventType[]): void;
|
|
167
|
-
ready<T extends
|
|
167
|
+
ready<T extends (...args: any[]) => any>(callback: T): void;
|
|
168
168
|
trigger(element: HTMLElement | string | NodeList | any[] | Window | Document, eventType: string | string[], details?: object, useDispatchToTriggerEvent?: boolean): void;
|
|
169
169
|
trigger(element: HTMLElement | string | NodeList | any[] | Window | Document, eventType: import("./types/PopsDOMUtilsEventType").PopsDOMUtils_EventType | import("./types/PopsDOMUtilsEventType").PopsDOMUtils_EventType[], details?: object, useDispatchToTriggerEvent?: boolean): void;
|
|
170
170
|
click(element: HTMLElement | string | Window, handler?: (event: import("./types/PopsDOMUtilsEventType").PopsDOMUtils_Event["click"]) => void, details?: any, useDispatchToTriggerEvent?: boolean): void;
|
|
@@ -210,7 +210,7 @@ declare class Pops {
|
|
|
210
210
|
endCallBack?: (moveElement: HTMLElement, left: number, top: number) => void;
|
|
211
211
|
preventEvent?: (event: TouchEvent | PointerEvent) => boolean;
|
|
212
212
|
}): void;
|
|
213
|
-
sortElementListByProperty<T
|
|
213
|
+
sortElementListByProperty<T, R>(getBeforeValueFun: (value: T) => R, getAfterValueFun: (value: T) => R, sortByDesc?: boolean): (after_obj: T, before_obj: T) => 1 | 0 | -1;
|
|
214
214
|
};
|
|
215
215
|
/** pops处理float类型使用的工具类 */
|
|
216
216
|
MathFloatUtils: {
|
|
@@ -1651,6 +1651,7 @@ declare class Pops {
|
|
|
1651
1651
|
<K extends keyof WindowEventMap>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1652
1652
|
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
1653
1653
|
} & typeof removeEventListener;
|
|
1654
|
+
trustedTypes: any;
|
|
1654
1655
|
dispatchEvent: ((event: Event) => boolean) & typeof dispatchEvent;
|
|
1655
1656
|
cancelAnimationFrame: ((handle: number) => void) & typeof cancelAnimationFrame;
|
|
1656
1657
|
requestAnimationFrame: ((callback: FrameRequestCallback) => number) & typeof requestAnimationFrame;
|
|
@@ -6904,7 +6905,6 @@ declare class Pops {
|
|
|
6904
6905
|
DisposableStack: DisposableStackConstructor;
|
|
6905
6906
|
AsyncDisposableStack: AsyncDisposableStackConstructor;
|
|
6906
6907
|
Float16Array: Float16ArrayConstructor;
|
|
6907
|
-
unsafeWindow: /*elided*/ any;
|
|
6908
6908
|
undefined: undefined;
|
|
6909
6909
|
};
|
|
6910
6910
|
eval: typeof eval;
|
|
@@ -11000,7 +11000,6 @@ declare class Pops {
|
|
|
11000
11000
|
DisposableStack: DisposableStackConstructor;
|
|
11001
11001
|
AsyncDisposableStack: AsyncDisposableStackConstructor;
|
|
11002
11002
|
Float16Array: Float16ArrayConstructor;
|
|
11003
|
-
unsafeWindow: /*elided*/ any;
|
|
11004
11003
|
undefined: undefined;
|
|
11005
11004
|
};
|
|
11006
11005
|
readonly speechSynthesis: {
|
|
@@ -11707,6 +11706,7 @@ declare class Pops {
|
|
|
11707
11706
|
<K extends keyof WindowEventMap>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
11708
11707
|
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
11709
11708
|
} & typeof removeEventListener;
|
|
11709
|
+
trustedTypes: any;
|
|
11710
11710
|
dispatchEvent: ((event: Event) => boolean) & typeof dispatchEvent;
|
|
11711
11711
|
cancelAnimationFrame: ((handle: number) => void) & typeof cancelAnimationFrame;
|
|
11712
11712
|
requestAnimationFrame: ((callback: FrameRequestCallback) => number) & typeof requestAnimationFrame;
|
|
@@ -16960,7 +16960,6 @@ declare class Pops {
|
|
|
16960
16960
|
DisposableStack: DisposableStackConstructor;
|
|
16961
16961
|
AsyncDisposableStack: AsyncDisposableStackConstructor;
|
|
16962
16962
|
Float16Array: Float16ArrayConstructor;
|
|
16963
|
-
unsafeWindow: /*elided*/ any;
|
|
16964
16963
|
undefined: undefined;
|
|
16965
16964
|
};
|
|
16966
16965
|
eval: typeof eval;
|
|
@@ -21056,7 +21055,6 @@ declare class Pops {
|
|
|
21056
21055
|
DisposableStack: DisposableStackConstructor;
|
|
21057
21056
|
AsyncDisposableStack: AsyncDisposableStackConstructor;
|
|
21058
21057
|
Float16Array: Float16ArrayConstructor;
|
|
21059
|
-
unsafeWindow: /*elided*/ any;
|
|
21060
21058
|
undefined: undefined;
|
|
21061
21059
|
};
|
|
21062
21060
|
alert: (message?: any) => void;
|
|
@@ -21103,6 +21101,7 @@ declare class Pops {
|
|
|
21103
21101
|
<K extends keyof WindowEventMap>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
21104
21102
|
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
21105
21103
|
};
|
|
21104
|
+
trustedTypes: any;
|
|
21106
21105
|
dispatchEvent: (event: Event) => boolean;
|
|
21107
21106
|
cancelAnimationFrame: (handle: number) => void;
|
|
21108
21107
|
requestAnimationFrame: (callback: FrameRequestCallback) => number;
|
|
@@ -21417,7 +21416,7 @@ declare class Pops {
|
|
|
21417
21416
|
$dynamicCSS: HTMLStyleElement;
|
|
21418
21417
|
};
|
|
21419
21418
|
$evt: {
|
|
21420
|
-
offInputChangeEvtHandler:
|
|
21419
|
+
offInputChangeEvtHandler: ((...args: any[]) => any)[];
|
|
21421
21420
|
};
|
|
21422
21421
|
$data: {
|
|
21423
21422
|
isEmpty: boolean;
|
|
@@ -21445,7 +21444,7 @@ declare class Pops {
|
|
|
21445
21444
|
createItemDeleteIcon(size?: number, fill?: string): HTMLElement;
|
|
21446
21445
|
setPromptsInSearch(): void;
|
|
21447
21446
|
removePromptsInSearch(): void;
|
|
21448
|
-
changeHintULElementPosition(target?: HTMLElement, checkPositonAgain?:
|
|
21447
|
+
changeHintULElementPosition(target?: HTMLElement, checkPositonAgain?: boolean): void;
|
|
21449
21448
|
changeHintULElementWidth(target?: HTMLElement): void;
|
|
21450
21449
|
updateDynamicCSS(): void;
|
|
21451
21450
|
updateStyleSheet(): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PopsPanelFormsDetails } from "./components-forms";
|
|
2
|
-
import { PopsPanelFormsTotalDetails } from ".";
|
|
2
|
+
import type { PopsPanelFormsTotalDetails } from ".";
|
|
3
3
|
/**
|
|
4
4
|
* 右侧容器的配置
|
|
5
5
|
*/
|
|
@@ -20,30 +20,30 @@ export interface PopsPanelRightAsideContainerOptions {
|
|
|
20
20
|
*/
|
|
21
21
|
export interface PopsPanelCommonDetails<T extends PopsPanelFormsTotalDetails | PopsPanelFormsDetails> {
|
|
22
22
|
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
23
|
+
* 在添加到<ul>元素后触发该回调
|
|
24
|
+
* @param formConfig 配置
|
|
25
|
+
* @param container 右侧容器的元素
|
|
26
|
+
* @example
|
|
27
|
+
* // 例如在type为own时
|
|
28
|
+
* afterAddToUListCallBack(formConfig, container) {
|
|
29
|
+
* DOMUtils.on(
|
|
30
|
+
container.formHeaderDivElement.querySelector(
|
|
31
|
+
"a"
|
|
32
|
+
),
|
|
33
|
+
"click",
|
|
34
|
+
void 0,
|
|
35
|
+
() => {
|
|
36
|
+
PopsPanel.deleteValue("xxxx");
|
|
37
|
+
container.ulElement.querySelector(
|
|
38
|
+
"textarea"
|
|
39
|
+
).value = xxxxx.defaultValue;
|
|
40
|
+
Qmsg.success("已重置");
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
* }
|
|
44
|
+
*
|
|
45
|
+
* // 例如在type为forms时
|
|
46
|
+
* container内只有container.ulElement这个属性
|
|
47
|
+
*/
|
|
48
48
|
afterAddToUListCallBack?: (formConfig: T, container: PopsPanelRightAsideContainerOptions) => void;
|
|
49
49
|
}
|
|
@@ -9,7 +9,7 @@ import type { PopsPanelButtonDetails } from "./components-button";
|
|
|
9
9
|
import type { PopsPanelDeepMenuDetails } from "./components-deepMenu";
|
|
10
10
|
import type { PopsPanelOwnDetails } from "./components-own";
|
|
11
11
|
import type { PopsHeaderCloseButtonDetails } from "../../../types/button";
|
|
12
|
-
import { PopsPanelSelectMultipleDetails } from "./components-selectMultiple";
|
|
12
|
+
import type { PopsPanelSelectMultipleDetails } from "./components-selectMultiple";
|
|
13
13
|
/** panel的各种类型的配置项 */
|
|
14
14
|
export type PopsPanelFormsTotalDetails = PopsPanelSwitchDetails | PopsPanelSliderDetails | PopsPanelInputDetails | PopsPanelTextAreaDetails | PopsPanelSelectDetails<any> | PopsPanelSelectMultipleDetails<any> | PopsPanelButtonDetails | PopsPanelDeepMenuDetails | PopsPanelOwnDetails;
|
|
15
15
|
/**
|
|
@@ -149,5 +149,5 @@ export interface PopsPanelDetails extends PopsTitleConfig, PopsDragConfig, PopsC
|
|
|
149
149
|
* 如果浏览器不支持`document.startViewTransition`函数,那么即使使用`useDeepMenuSwtichAnimation`为true,那么不会使用动画
|
|
150
150
|
* @default true
|
|
151
151
|
*/
|
|
152
|
-
useDeepMenuSwtichAnimation
|
|
152
|
+
useDeepMenuSwtichAnimation?: true;
|
|
153
153
|
}
|
|
@@ -1225,6 +1225,7 @@ export declare const PopsRightClickMenu: {
|
|
|
1225
1225
|
<K extends keyof WindowEventMap>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1226
1226
|
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
1227
1227
|
} & typeof removeEventListener;
|
|
1228
|
+
trustedTypes: any;
|
|
1228
1229
|
dispatchEvent: ((event: Event) => boolean) & typeof dispatchEvent;
|
|
1229
1230
|
cancelAnimationFrame: ((handle: number) => void) & typeof cancelAnimationFrame;
|
|
1230
1231
|
requestAnimationFrame: ((callback: FrameRequestCallback) => number) & typeof requestAnimationFrame;
|
|
@@ -6478,7 +6479,6 @@ export declare const PopsRightClickMenu: {
|
|
|
6478
6479
|
DisposableStack: DisposableStackConstructor;
|
|
6479
6480
|
AsyncDisposableStack: AsyncDisposableStackConstructor;
|
|
6480
6481
|
Float16Array: Float16ArrayConstructor;
|
|
6481
|
-
unsafeWindow: /*elided*/ any;
|
|
6482
6482
|
undefined: undefined;
|
|
6483
6483
|
};
|
|
6484
6484
|
eval: typeof eval;
|
|
@@ -10574,7 +10574,6 @@ export declare const PopsRightClickMenu: {
|
|
|
10574
10574
|
DisposableStack: DisposableStackConstructor;
|
|
10575
10575
|
AsyncDisposableStack: AsyncDisposableStackConstructor;
|
|
10576
10576
|
Float16Array: Float16ArrayConstructor;
|
|
10577
|
-
unsafeWindow: /*elided*/ any;
|
|
10578
10577
|
undefined: undefined;
|
|
10579
10578
|
};
|
|
10580
10579
|
readonly speechSynthesis: {
|
|
@@ -11281,6 +11280,7 @@ export declare const PopsRightClickMenu: {
|
|
|
11281
11280
|
<K extends keyof WindowEventMap>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
11282
11281
|
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
11283
11282
|
} & typeof removeEventListener;
|
|
11283
|
+
trustedTypes: any;
|
|
11284
11284
|
dispatchEvent: ((event: Event) => boolean) & typeof dispatchEvent;
|
|
11285
11285
|
cancelAnimationFrame: ((handle: number) => void) & typeof cancelAnimationFrame;
|
|
11286
11286
|
requestAnimationFrame: ((callback: FrameRequestCallback) => number) & typeof requestAnimationFrame;
|
|
@@ -16534,7 +16534,6 @@ export declare const PopsRightClickMenu: {
|
|
|
16534
16534
|
DisposableStack: DisposableStackConstructor;
|
|
16535
16535
|
AsyncDisposableStack: AsyncDisposableStackConstructor;
|
|
16536
16536
|
Float16Array: Float16ArrayConstructor;
|
|
16537
|
-
unsafeWindow: /*elided*/ any;
|
|
16538
16537
|
undefined: undefined;
|
|
16539
16538
|
};
|
|
16540
16539
|
eval: typeof eval;
|
|
@@ -20630,7 +20629,6 @@ export declare const PopsRightClickMenu: {
|
|
|
20630
20629
|
DisposableStack: DisposableStackConstructor;
|
|
20631
20630
|
AsyncDisposableStack: AsyncDisposableStackConstructor;
|
|
20632
20631
|
Float16Array: Float16ArrayConstructor;
|
|
20633
|
-
unsafeWindow: /*elided*/ any;
|
|
20634
20632
|
undefined: undefined;
|
|
20635
20633
|
};
|
|
20636
20634
|
alert: (message?: any) => void;
|
|
@@ -20677,6 +20675,7 @@ export declare const PopsRightClickMenu: {
|
|
|
20677
20675
|
<K extends keyof WindowEventMap>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
20678
20676
|
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
20679
20677
|
};
|
|
20678
|
+
trustedTypes: any;
|
|
20680
20679
|
dispatchEvent: (event: Event) => boolean;
|
|
20681
20680
|
cancelAnimationFrame: (handle: number) => void;
|
|
20682
20681
|
requestAnimationFrame: (callback: FrameRequestCallback) => number;
|
|
@@ -14,7 +14,7 @@ export declare const PopsSearchSuggestion: {
|
|
|
14
14
|
$dynamicCSS: HTMLStyleElement;
|
|
15
15
|
};
|
|
16
16
|
$evt: {
|
|
17
|
-
offInputChangeEvtHandler:
|
|
17
|
+
offInputChangeEvtHandler: ((...args: any[]) => any)[];
|
|
18
18
|
};
|
|
19
19
|
$data: {
|
|
20
20
|
/** 是否结果为空 */
|
|
@@ -126,7 +126,7 @@ export declare const PopsSearchSuggestion: {
|
|
|
126
126
|
* @param target 目标元素
|
|
127
127
|
* @param checkPositonAgain 是否在更新位置信息后检测更新位置信息,默认true
|
|
128
128
|
*/
|
|
129
|
-
changeHintULElementPosition(target?: HTMLElement, checkPositonAgain?:
|
|
129
|
+
changeHintULElementPosition(target?: HTMLElement, checkPositonAgain?: boolean): void;
|
|
130
130
|
/**
|
|
131
131
|
* 更新搜索建议框的width
|
|
132
132
|
* 因为目标元素可能是动态隐藏的
|
|
@@ -31,7 +31,7 @@ export type PopsSearchSuggestionData<T = any> = {
|
|
|
31
31
|
/**
|
|
32
32
|
* 当前配置
|
|
33
33
|
*/
|
|
34
|
-
config: PopsSearchSuggestionDetails<T>) => void |
|
|
34
|
+
config: PopsSearchSuggestionDetails<T>) => void | boolean | Promise<void | boolean>;
|
|
35
35
|
/**
|
|
36
36
|
* 获取每一项的html,在显示的时候会调用该函数
|
|
37
37
|
*
|
|
@@ -72,7 +72,7 @@ export type PopsSearchSuggestionData<T = any> = {
|
|
|
72
72
|
/**
|
|
73
73
|
* 当前配置
|
|
74
74
|
*/
|
|
75
|
-
config: PopsSearchSuggestionDetails<T>) => void |
|
|
75
|
+
config: PopsSearchSuggestionDetails<T>) => void | boolean | Promise<void | boolean>;
|
|
76
76
|
/**
|
|
77
77
|
* 键盘的上下键选择的回调
|
|
78
78
|
*/
|
|
@@ -7,8 +7,8 @@ import type { PopsLoadingDetails } from "../components/loading/types";
|
|
|
7
7
|
import type { PopsPanelDetails } from "../components/panel/types";
|
|
8
8
|
import type { PopsPromptDetails } from "../components/prompt/types/index";
|
|
9
9
|
import type { PopsCommonConfig } from "../types/components";
|
|
10
|
-
import { PopsEventDetails, PopsHandlerEventDetails } from "../types/event";
|
|
11
|
-
import { PopsInstCommonConfig } from "../types/inst";
|
|
10
|
+
import type { PopsEventDetails, PopsHandlerEventDetails } from "../types/event";
|
|
11
|
+
import type { PopsInstCommonConfig } from "../types/inst";
|
|
12
12
|
import type { PopsInstStoreType, PopsType, PopsSupportAnimDetailsType, PopsSupportOnlyDetails } from "../types/main";
|
|
13
13
|
export declare const PopsHandler: {
|
|
14
14
|
/**
|
|
@@ -181,7 +181,7 @@ export declare const PopsHandler: {
|
|
|
181
181
|
/**
|
|
182
182
|
* 处理返回的配置,针对popsHandler.handleEventDetails
|
|
183
183
|
*/
|
|
184
|
-
handleResultDetails<T
|
|
184
|
+
handleResultDetails<T>(details: T): Omit<T, "type" | "function">;
|
|
185
185
|
/**
|
|
186
186
|
* 处理点击事件
|
|
187
187
|
* @param type 当前按钮类型
|