@whitesev/pops 2.0.9 → 2.0.11

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.
Files changed (57) hide show
  1. package/dist/index.amd.js +1904 -1733
  2. package/dist/index.amd.js.map +1 -1
  3. package/dist/index.cjs.js +1904 -1733
  4. package/dist/index.cjs.js.map +1 -1
  5. package/dist/index.esm.js +1904 -1733
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/index.iife.js +1904 -1733
  8. package/dist/index.iife.js.map +1 -1
  9. package/dist/index.system.js +1904 -1733
  10. package/dist/index.system.js.map +1 -1
  11. package/dist/index.umd.js +1904 -1733
  12. package/dist/index.umd.js.map +1 -1
  13. package/dist/types/src/Pops.d.ts +50 -30
  14. package/dist/types/src/PopsAnimation.d.ts +14 -0
  15. package/dist/types/src/PopsCSS.d.ts +34 -0
  16. package/dist/types/src/PopsIcon.d.ts +25 -0
  17. package/dist/types/src/PopsLayer.d.ts +3 -0
  18. package/dist/types/src/components/panel/buttonType.d.ts +2 -2
  19. package/dist/types/src/components/panel/selectMultipleType.d.ts +12 -15
  20. package/dist/types/src/components/rightClickMenu/index.d.ts +1 -2
  21. package/dist/types/src/components/rightClickMenu/indexType.d.ts +2 -2
  22. package/dist/types/src/types/button.d.ts +3 -3
  23. package/dist/types/src/types/icon.d.ts +1 -1
  24. package/dist/types/src/utils/PopsDOMUtils.d.ts +12 -0
  25. package/dist/types/src/utils/PopsInstanceUtils.d.ts +0 -6
  26. package/dist/types/src/utils/PopsUtils.d.ts +5 -6
  27. package/package.json +3 -2
  28. package/src/Pops.ts +12 -152
  29. package/src/PopsAnimation.ts +32 -0
  30. package/src/PopsCSS.ts +51 -0
  31. package/src/PopsIcon.ts +93 -0
  32. package/src/PopsLayer.ts +17 -0
  33. package/src/components/alert/index.ts +8 -8
  34. package/src/components/confirm/index.ts +8 -8
  35. package/src/components/drawer/index.ts +8 -8
  36. package/src/components/folder/index.ts +15 -15
  37. package/src/components/iframe/index.ts +9 -12
  38. package/src/components/loading/index.ts +5 -5
  39. package/src/components/panel/PanelHandleContentDetails.ts +338 -220
  40. package/src/components/panel/buttonType.ts +2 -2
  41. package/src/components/panel/config.ts +41 -11
  42. package/src/components/panel/index.css +33 -0
  43. package/src/components/panel/index.ts +9 -9
  44. package/src/components/panel/selectMultipleType.ts +18 -15
  45. package/src/components/prompt/index.ts +8 -8
  46. package/src/components/rightClickMenu/config.ts +7 -7
  47. package/src/components/rightClickMenu/index.ts +9 -10
  48. package/src/components/rightClickMenu/indexType.ts +2 -2
  49. package/src/components/searchSuggestion/index.ts +5 -5
  50. package/src/components/tooltip/index.ts +5 -5
  51. package/src/handler/PopsElementHandler.ts +17 -17
  52. package/src/handler/PopsHandler.ts +22 -19
  53. package/src/types/button.d.ts +3 -3
  54. package/src/types/icon.d.ts +1 -1
  55. package/src/utils/PopsDOMUtils.ts +34 -1
  56. package/src/utils/PopsInstanceUtils.ts +13 -31
  57. package/src/utils/PopsUtils.ts +7 -16
@@ -1,7 +1,5 @@
1
- import { PopsLayerMode } from "./types/main";
2
1
  import type { PopsAlertDetails } from "./components/alert/indexType";
3
2
  import type { PopsConfirmDetails } from "./components/confirm/indexType";
4
- import type { PopsLayerCommonConfig } from "./types/layer";
5
3
  import type { PopsPromptDetails } from "./components/prompt/indexType";
6
4
  import type { PopsLoadingDetails } from "./components/loading/indexType";
7
5
  import type { PopsIframeDetails } from "./components/iframe/indexType";
@@ -10,7 +8,6 @@ import type { PopsDrawerDetails } from "./components/drawer/indexType";
10
8
  import type { PopsFolderDetails } from "./components/folder/indexType";
11
9
  import type { PopsPanelDetails } from "./components/panel/indexType";
12
10
  import type { PopsRightClickMenuDetails } from "./components/rightClickMenu/indexType";
13
- import type { PopsIcon } from "./types/icon";
14
11
  import type { PopsSearchSuggestionDetails } from "./components/searchSuggestion/indexType";
15
12
  declare class Pops {
16
13
  /** 配置 */
@@ -18,49 +15,71 @@ declare class Pops {
18
15
  /** 版本号 */
19
16
  version: string;
20
17
  cssText: {
21
- /** 主CSS */
22
18
  index: string;
23
- /** 九宫格位置CSS */
24
19
  ninePalaceGridPosition: string;
25
- /** 滚动条CSS */
26
20
  scrollbar: string;
27
- /** 按钮CSS */
28
21
  button: string;
29
- /** 通用的CSS */
30
22
  common: string;
31
- /** 动画 */
32
23
  anim: string;
33
- /** pops.alert */
34
24
  alertCSS: string;
35
- /** pops.cponfirm */
36
25
  confirmCSS: string;
37
- /** pops.prompt */
38
26
  promptCSS: string;
39
- /** pops.loading */
40
27
  loadingCSS: string;
41
- /** pops.iframe */
42
28
  iframeCSS: string;
43
- /** pops.tooltip */
44
29
  tooltipCSS: string;
45
- /** pops.drawer */
46
30
  drawerCSS: string;
47
- /** pops.folder */
48
31
  folderCSS: string;
49
- /** pops.folder */
50
32
  panelCSS: string;
51
- /** pops.rightClickMenu */
52
33
  rightClickMenu: string;
53
34
  };
54
35
  /** icon图标的svg代码 */
55
- iconSVG: { [key in PopsIcon]: string; };
36
+ iconSVG: {
37
+ loading: string;
38
+ min: string;
39
+ max: string;
40
+ mise: string;
41
+ close: string;
42
+ edit: string;
43
+ share: string;
44
+ delete: string;
45
+ search: string;
46
+ upload: string;
47
+ next: string;
48
+ prev: string;
49
+ eleme: string;
50
+ elemePlus: string;
51
+ chromeFilled: string;
52
+ cpu: string;
53
+ videoPlay: string;
54
+ videoPause: string;
55
+ headset: string;
56
+ monitor: string;
57
+ documentCopy: string;
58
+ picture: string;
59
+ circleClose: string;
60
+ view: string;
61
+ hide: string;
62
+ keyboard: string;
63
+ arrowRight: string;
64
+ arrowLeft: string;
65
+ };
56
66
  /** 当前已配置的动画@keyframes名字映射(初始化时生成) */
57
67
  animation: {
58
68
  [key: string]: CSSKeyframesRule;
59
69
  };
60
- /** 是否初始化 */
61
- isInit: boolean;
62
70
  /** 存储已创建的元素 */
63
- layer: { [key in PopsLayerMode]: PopsLayerCommonConfig[]; };
71
+ layer: {
72
+ iframe: import("./types/layer").PopsLayerCommonConfig[];
73
+ loading: import("./types/layer").PopsLayerCommonConfig[];
74
+ folder: import("./types/layer").PopsLayerCommonConfig[];
75
+ alert: import("./types/layer").PopsLayerCommonConfig[];
76
+ confirm: import("./types/layer").PopsLayerCommonConfig[];
77
+ prompt: import("./types/layer").PopsLayerCommonConfig[];
78
+ drawer: import("./types/layer").PopsLayerCommonConfig[];
79
+ panel: import("./types/layer").PopsLayerCommonConfig[];
80
+ tooltip: import("./types/layer").PopsLayerCommonConfig[];
81
+ rightClickMenu: import("./types/layer").PopsLayerCommonConfig[];
82
+ };
64
83
  /** 禁止滚动 */
65
84
  forbiddenScroll: {
66
85
  event(event: Event): boolean;
@@ -72,13 +91,13 @@ declare class Pops {
72
91
  delete(target: any, propName: any): void;
73
92
  assign<T1, T2 extends object, T3 extends boolean>(target: T1, source: T2, isAdd?: T3 | undefined): T3 extends true ? T1 & T2 : T1;
74
93
  getRandomGUID(): string;
75
- parseTextToDOM<R extends HTMLElement>(elementString: string): R;
76
94
  contains(target: any): boolean;
77
95
  contains(context: any, target?: any): boolean;
78
96
  formatTime(text?: string | number | Date, formatType?: string): string;
79
97
  formatTime(text?: string | number | Date, formatType?: "yyyy-MM-dd HH:mm:ss" | "yyyy/MM/dd HH:mm:ss" | "yyyy_MM_dd_HH_mm_ss" | "yyyy\u5E74MM\u6708dd\u65E5 HH\u65F6mm\u5206ss\u79D2" | "yyyy\u5E74MM\u6708dd\u65E5 hh:mm:ss" | "yyyy\u5E74MM\u6708dd\u65E5 HH:mm:ss" | "yyyy-MM-dd" | "yyyyMMdd" | "HH:mm:ss"): string;
80
98
  formatByteToSize<T extends boolean>(byteSize: number | string, addType?: T | undefined): T extends true ? string : number;
81
99
  AnyTouch: () => typeof import("any-touch").default;
100
+ isPhone(userAgent?: string): boolean;
82
101
  setTimeout(callback: Function, timeout?: number): number;
83
102
  clearTimeout(timeId: number | undefined): void;
84
103
  setInterval(callback: Function, timeout?: number): number;
@@ -105,6 +124,7 @@ declare class Pops {
105
124
  createElement<K extends keyof HTMLElementTagNameMap>(tagName: K, property?: ({ [P in keyof HTMLElementTagNameMap[K]]?: HTMLElementTagNameMap[K][P] extends string | boolean | number ? HTMLElementTagNameMap[K][P] : never; } & {
106
125
  [key: string]: any;
107
126
  }) | string, attributes?: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsCreateElementAttributesMap): HTMLElementTagNameMap[K];
127
+ parseTextToDOM<R extends HTMLElement>(elementString: string): R;
108
128
  getTextBoundingRect(input: HTMLInputElement | HTMLTextAreaElement, selectionStart: number | string, selectionEnd: number | string, debug: boolean): DOMRect;
109
129
  cssHide(ele: Element | null, isImportant?: boolean): void;
110
130
  cssShow(ele: Element | null): void;
@@ -120,6 +140,7 @@ declare class Pops {
120
140
  getStyleValue(element: HTMLElement | CSSStyleDeclaration, styleName: string): number;
121
141
  before(element: HTMLElement | Element | string, content: HTMLElement | string): void;
122
142
  after(element: HTMLElement | Element | string, content: HTMLElement | string): void;
143
+ getKeyFrames(sheet: CSSStyleSheet): {};
123
144
  on(element: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsElementEventType, eventType: string | string[], callback: (event: Event) => void, option?: boolean | AddEventListenerOptions): void;
124
145
  on<T extends import("./types/PopsDOMUtilsEventType").PopsDOMUtils_EventType>(element: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsElementEventType, eventType: T | T[], callback: (event: import("./types/PopsDOMUtilsEventType").PopsDOMUtils_Event[T]) => void, option?: boolean | AddEventListenerOptions): void;
125
146
  on<T extends Event>(element: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsElementEventType, eventType: string, callback: (event: T) => void, option?: boolean | AddEventListenerOptions): void;
@@ -158,11 +179,10 @@ declare class Pops {
158
179
  isOverMaxZIndex: boolean;
159
180
  };
160
181
  getMaxZIndex(deviation?: number): number;
161
- getKeyFrames(sheet: CSSStyleSheet): {};
162
- removeInstance(moreLayerConfigList: PopsLayerCommonConfig[][], guid: string, isAll?: boolean): PopsLayerCommonConfig[][];
163
- hide(popsType: PopsLayerMode, layerConfigList: PopsLayerCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement, maskElement: HTMLElement): Promise<void>;
164
- show(popsType: PopsLayerMode, layerConfigList: PopsLayerCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement, maskElement?: HTMLElement): Promise<void>;
165
- close(popsType: string, layerConfigList: PopsLayerCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement): Promise<void>;
182
+ removeInstance(moreLayerConfigList: import("./types/layer").PopsLayerCommonConfig[][], guid: string, isAll?: boolean): import("./types/layer").PopsLayerCommonConfig[][];
183
+ hide(popsType: import("./types/main").PopsLayerMode, layerConfigList: import("./types/layer").PopsLayerCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement, maskElement: HTMLElement): Promise<void>;
184
+ show(popsType: import("./types/main").PopsLayerMode, layerConfigList: import("./types/layer").PopsLayerCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement, maskElement?: HTMLElement): Promise<void>;
185
+ close(popsType: string, layerConfigList: import("./types/layer").PopsLayerCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement): Promise<void>;
166
186
  drag(moveElement: HTMLElement, options: {
167
187
  dragElement: HTMLElement;
168
188
  limit: boolean;
@@ -21000,7 +21020,7 @@ declare class Pops {
21000
21020
  };
21001
21021
  targetSelector: string | null;
21002
21022
  data: {
21003
- icon: PopsIcon | string;
21023
+ icon: import("./types/icon").PopsIconType | string;
21004
21024
  iconIsLoading: boolean;
21005
21025
  text: string | (() => string);
21006
21026
  callback: (clickEvent: PointerEvent, contextMenuEvent: PointerEvent, liElement: HTMLLIElement) => boolean | void | Promise<boolean | void>;
@@ -0,0 +1,14 @@
1
+ export declare const PopsAnimation: {
2
+ $data: {
3
+ [key: string]: CSSKeyframesRule;
4
+ };
5
+ $flag: {
6
+ /** 是否初始化 */
7
+ isInit: boolean;
8
+ };
9
+ init(): void;
10
+ /**
11
+ * 判断是否存在某个动画名
12
+ */
13
+ hasAnim(name: string): boolean;
14
+ };
@@ -0,0 +1,34 @@
1
+ export declare const PopsCSS: {
2
+ /** 主CSS */
3
+ index: string;
4
+ /** 九宫格位置CSS */
5
+ ninePalaceGridPosition: string;
6
+ /** 滚动条CSS */
7
+ scrollbar: string;
8
+ /** 按钮CSS */
9
+ button: string;
10
+ /** 通用的CSS */
11
+ common: string;
12
+ /** 动画 */
13
+ anim: string;
14
+ /** pops.alert */
15
+ alertCSS: string;
16
+ /** pops.cponfirm */
17
+ confirmCSS: string;
18
+ /** pops.prompt */
19
+ promptCSS: string;
20
+ /** pops.loading */
21
+ loadingCSS: string;
22
+ /** pops.iframe */
23
+ iframeCSS: string;
24
+ /** pops.tooltip */
25
+ tooltipCSS: string;
26
+ /** pops.drawer */
27
+ drawerCSS: string;
28
+ /** pops.folder */
29
+ folderCSS: string;
30
+ /** pops.folder */
31
+ panelCSS: string;
32
+ /** pops.rightClickMenu */
33
+ rightClickMenu: string;
34
+ };
@@ -0,0 +1,25 @@
1
+ import type { PopsIconType } from "./types/icon";
2
+ export declare const PopsIcon: {
3
+ $data: { [key in PopsIconType]: string; };
4
+ /**
5
+ * 判断是否存在某个icon
6
+ * @param iconName 图标名
7
+ */
8
+ hasIcon(iconName: string): boolean;
9
+ /**
10
+ * 获取icon
11
+ * @param iconName 图标名
12
+ */
13
+ getIcon(iconName: string): string | null;
14
+ /**
15
+ * 删除图标
16
+ * @param iconName 图标名
17
+ */
18
+ deleteIcon(iconName: string): boolean;
19
+ /**
20
+ * 设置图标
21
+ * @param iconName 图标名
22
+ * @param iconHTML 图标html
23
+ */
24
+ setIcon(iconName: string, iconHTML: string): void;
25
+ };
@@ -0,0 +1,3 @@
1
+ import type { PopsLayerCommonConfig } from "./types/layer";
2
+ import type { PopsLayerMode } from "./types/main";
3
+ export declare const PopsLayer: { [key in PopsLayerMode]: PopsLayerCommonConfig[]; };
@@ -1,6 +1,6 @@
1
1
  import type { PopsPanelCommonDetails } from "./commonType";
2
2
  import type { PopsButtonStyleType } from "../../types/button";
3
- import type { PopsIcon } from "../../types/icon";
3
+ import type { PopsIconType } from "../../types/icon";
4
4
  /**
5
5
  * pops.panel的 button
6
6
  */
@@ -48,7 +48,7 @@ export interface PopsPanelButtonDetails extends PopsPanelCommonDetails<PopsPanel
48
48
  /**
49
49
  * 按钮的图标,已配置的svg请看pops.config.iconSVG,或者自定义的图标svg代码
50
50
  */
51
- buttonIcon?: PopsIcon;
51
+ buttonIcon?: PopsIconType;
52
52
  /**
53
53
  * 按钮的图标在右边
54
54
  */
@@ -8,9 +8,14 @@ export interface PopsPanelSelectMultipleDataOption<T> {
8
8
  /**
9
9
  * 显示的文字
10
10
  */
11
- text: string;
11
+ text: string | ((
12
+ /** 当前的值 */
13
+ value: T,
14
+ /** 所有选中的配置信息 */
15
+ allSelectedInfo: PopsPanelSelectMultipleDataOption<T>[]) => string);
12
16
  /**
13
17
  * 显示的文字是否是html
18
+ * @default false
14
19
  */
15
20
  isHTML?: boolean;
16
21
  /**
@@ -18,8 +23,10 @@ export interface PopsPanelSelectMultipleDataOption<T> {
18
23
  * 触发条件:
19
24
  * + 点击select元素
20
25
  * + select元素触发change事件
26
+ * @param value 当前的值
27
+ * @param allSelectedInfo 所有选中的配置信息
21
28
  */
22
- disable?(value: T): boolean;
29
+ disable?(value: T, allSelectedInfo: PopsPanelSelectMultipleDataOption<T>[]): boolean;
23
30
  }
24
31
  /**
25
32
  * pops.panel的 select
@@ -77,12 +84,7 @@ export interface PopsPanelSelectMultipleDetails<T = any> extends PopsPanelCommon
77
84
  */
78
85
  callback?(
79
86
  /** 当前已选中的信息 */
80
- isSelectedInfo: {
81
- /** 值 */
82
- value: T;
83
- /** 显示的文字 */
84
- text: string;
85
- }[]): void;
87
+ isSelectedInfo: PopsPanelSelectMultipleDataOption<any>[]): void;
86
88
  /**
87
89
  * 点击某个项的元素触发该回调
88
90
  * @param event 点击事件
@@ -91,12 +93,7 @@ export interface PopsPanelSelectMultipleDetails<T = any> extends PopsPanelCommon
91
93
  */
92
94
  clickCallBack?(event: PointerEvent | MouseEvent,
93
95
  /** 当前已选中的信息 */
94
- isSelectedInfo: {
95
- /** 值 */
96
- value: T;
97
- /** 显示的文字 */
98
- text: string;
99
- }[]): void | boolean;
96
+ isSelectedInfo: PopsPanelSelectMultipleDataOption<any>[]): void | boolean;
100
97
  /**
101
98
  * 点击标签tag的关闭图标触发该回调
102
99
  * 如果返回boolean类型且为false,则阻止默认的事件
@@ -109,7 +106,7 @@ export interface PopsPanelSelectMultipleDetails<T = any> extends PopsPanelCommon
109
106
  /** 值 */
110
107
  value: T;
111
108
  /** 显示的文字 */
112
- text: string;
109
+ text: PopsPanelSelectMultipleDataOption<T>["text"];
113
110
  }) => void | boolean;
114
111
  /**
115
112
  * 选择器内的数据组
@@ -1,4 +1,3 @@
1
- import type { PopsIcon } from "../../types/icon";
2
1
  import type { PopsRightClickMenuDetails } from "./indexType";
3
2
  export declare const PopsRightClickMenu: {
4
3
  init(details: PopsRightClickMenuDetails): {
@@ -20639,7 +20638,7 @@ export declare const PopsRightClickMenu: {
20639
20638
  };
20640
20639
  targetSelector: string | null;
20641
20640
  data: {
20642
- icon: PopsIcon | string;
20641
+ icon: import("../../types/icon").PopsIconType | string;
20643
20642
  iconIsLoading: boolean;
20644
20643
  text: string | (() => string);
20645
20644
  callback: (clickEvent: PointerEvent, contextMenuEvent: PointerEvent, liElement: HTMLLIElement) => boolean | void | Promise<boolean | void>;
@@ -1,5 +1,5 @@
1
1
  import type { PopsCommonConfig } from "../../types/components";
2
- import type { PopsIcon } from "../../types/icon";
2
+ import type { PopsIconType } from "../../types/icon";
3
3
  /**
4
4
  * pops.rightClickMenu的右键菜单配置
5
5
  */
@@ -7,7 +7,7 @@ export interface PopsRightClickMenuDataDetails {
7
7
  /**
8
8
  * svg图标
9
9
  */
10
- icon: PopsIcon | string;
10
+ icon: PopsIconType | string;
11
11
  /**
12
12
  * 图标是否旋转
13
13
  */
@@ -1,5 +1,5 @@
1
1
  import { PopsEventDetails, PopsHandlerEventDetails } from "./event";
2
- import type { PopsIcon } from "./icon";
2
+ import type { PopsIconType } from "./icon";
3
3
 
4
4
  /**
5
5
  * 按钮类型
@@ -79,7 +79,7 @@ export interface PopsButtonDetails<T = {}> {
79
79
  /**
80
80
  * 图标按钮,如果名字为内置的,则使用内置的,否则为自定义的svg
81
81
  */
82
- icon: PopsIcon;
82
+ icon: PopsIconType;
83
83
  /**
84
84
  * 图标按钮是否放在右边
85
85
  */
@@ -125,7 +125,7 @@ export interface PopsButtonDetailsAnyType<T = {}> {
125
125
  /**
126
126
  * 图标按钮,如果名字为内置的,则使用内置的,否则为自定义的svg
127
127
  */
128
- icon: PopsIcon;
128
+ icon: PopsIconType;
129
129
  /**
130
130
  * 图标按钮是否放在右边
131
131
  */
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * 按钮svg图标
3
3
  */
4
- export type PopsIcon =
4
+ export type PopsIconType =
5
5
  | "min"
6
6
  | "mise"
7
7
  | "max"
@@ -520,6 +520,12 @@ declare class PopsDOMUtils extends PopsDOMUtilsEvent {
520
520
  }) | string,
521
521
  /** 自定义属性 */
522
522
  attributes?: PopsDOMUtilsCreateElementAttributesMap): HTMLElementTagNameMap[K];
523
+ /**
524
+ * 字符串转HTMLElement
525
+ * @param elementString
526
+ * @returns
527
+ */
528
+ parseTextToDOM<R extends HTMLElement>(elementString: string): R;
523
529
  /**
524
530
  * 获取文字的位置信息
525
531
  * @param input 输入框
@@ -635,6 +641,12 @@ declare class PopsDOMUtils extends PopsDOMUtilsEvent {
635
641
  * DOMUtils.after("a.xx","'<b class="xx"></b>")
636
642
  * */
637
643
  after(element: HTMLElement | Element | string, content: HTMLElement | string): void;
644
+ /**
645
+ * 获取CSS Rule
646
+ * @param sheet
647
+ * @returns
648
+ */
649
+ getKeyFrames(sheet: CSSStyleSheet): {};
638
650
  }
639
651
  declare const popsDOMUtils: PopsDOMUtils;
640
652
  export { popsDOMUtils };
@@ -42,12 +42,6 @@ export declare const PopsInstanceUtils: {
42
42
  * > 1001
43
43
  **/
44
44
  getMaxZIndex(deviation?: number): number;
45
- /**
46
- * 获取CSS Rule
47
- * @param sheet
48
- * @returns
49
- */
50
- getKeyFrames(sheet: CSSStyleSheet): {};
51
45
  /**
52
46
  * 删除配置中对应的对象
53
47
  * @param moreLayerConfigList 配置实例列表
@@ -42,12 +42,6 @@ declare class PopsUtils {
42
42
  * 生成uuid
43
43
  */
44
44
  getRandomGUID(): string;
45
- /**
46
- * 字符串转HTMLElement
47
- * @param elementString
48
- * @returns
49
- */
50
- parseTextToDOM<R extends HTMLElement>(elementString: string): R;
51
45
  /**
52
46
  * 判断元素/页面中是否包含该元素
53
47
  * @param target 需要判断的元素
@@ -119,6 +113,11 @@ declare class PopsUtils {
119
113
  **/
120
114
  formatByteToSize<T extends boolean>(byteSize: number | string, addType?: T): T extends true ? string : number;
121
115
  AnyTouch: () => typeof AnyTouch;
116
+ /**
117
+ * 通过navigator.userAgent判断是否是手机访问
118
+ * @param userAgent
119
+ */
120
+ isPhone(userAgent?: string): boolean;
122
121
  /**
123
122
  * 自动使用 Worker 执行 setTimeout
124
123
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whitesev/pops",
3
- "version": "2.0.9",
3
+ "version": "2.0.11",
4
4
  "description": "弹窗库",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -51,6 +51,7 @@
51
51
  "scripts": {
52
52
  "dev": "rollup --config --watch",
53
53
  "build": "rollup --config",
54
- "build:all": "rollup --config"
54
+ "build:all": "rollup --config",
55
+ "build:all-new": "rollup --config"
55
56
  }
56
57
  }