@whitesev/pops 2.2.3 → 2.2.5

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 (42) hide show
  1. package/dist/index.amd.js +143 -49
  2. package/dist/index.amd.js.map +1 -1
  3. package/dist/index.cjs.js +143 -49
  4. package/dist/index.cjs.js.map +1 -1
  5. package/dist/index.esm.js +143 -49
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/index.iife.js +143 -49
  8. package/dist/index.iife.js.map +1 -1
  9. package/dist/index.system.js +143 -49
  10. package/dist/index.system.js.map +1 -1
  11. package/dist/index.umd.js +143 -49
  12. package/dist/index.umd.js.map +1 -1
  13. package/dist/types/src/Pops.d.ts +10 -10
  14. package/dist/types/src/PopsIcon.d.ts +2 -2
  15. package/dist/types/src/components/panel/types/components-selectMultiple.d.ts +1 -1
  16. package/dist/types/src/components/rightClickMenu/index.d.ts +2 -2
  17. package/dist/types/src/components/tooltip/index.d.ts +2 -2
  18. package/dist/types/src/config/CommonCSSClassName.d.ts +17 -0
  19. package/dist/types/src/{GlobalConfig.d.ts → config/GlobalConfig.d.ts} +4 -4
  20. package/dist/types/src/utils/PopsDOMUtils.d.ts +3 -3
  21. package/package.json +1 -1
  22. package/src/Pops.ts +2 -2
  23. package/src/components/alert/index.ts +1 -1
  24. package/src/components/confirm/index.ts +1 -1
  25. package/src/components/drawer/index.ts +1 -1
  26. package/src/components/folder/index.ts +1 -1
  27. package/src/components/iframe/index.ts +1 -1
  28. package/src/components/loading/index.ts +1 -1
  29. package/src/components/panel/config.ts +17 -1
  30. package/src/components/panel/handlerComponents.ts +200 -40
  31. package/src/components/panel/index.css +79 -23
  32. package/src/components/panel/index.ts +1 -1
  33. package/src/components/panel/types/components-selectMultiple.ts +1 -1
  34. package/src/components/prompt/index.ts +1 -1
  35. package/src/components/rightClickMenu/index.ts +1 -1
  36. package/src/components/searchSuggestion/index.ts +7 -3
  37. package/src/components/tooltip/index.ts +1 -1
  38. package/src/config/CommonCSSClassName.ts +17 -0
  39. package/src/{GlobalConfig.ts → config/GlobalConfig.ts} +1 -1
  40. package/src/css/common.css +14 -0
  41. package/src/css/index.css +7 -8
  42. package/src/utils/PopsDOMUtils.ts +22 -9
@@ -35,10 +35,10 @@ declare class Pops {
35
35
  /** icon图标的svg代码 */
36
36
  iconSVG: {
37
37
  loading: string;
38
+ close: string;
38
39
  min: string;
39
- max: string;
40
40
  mise: string;
41
- close: string;
41
+ max: string;
42
42
  edit: string;
43
43
  share: string;
44
44
  delete: string;
@@ -71,12 +71,12 @@ declare class Pops {
71
71
  instData: {
72
72
  iframe: import("./types/inst").PopsInstCommonConfig[];
73
73
  loading: import("./types/inst").PopsInstCommonConfig[];
74
- folder: import("./types/inst").PopsInstCommonConfig[];
75
74
  alert: import("./types/inst").PopsInstCommonConfig[];
76
75
  confirm: import("./types/inst").PopsInstCommonConfig[];
77
76
  prompt: import("./types/inst").PopsInstCommonConfig[];
78
77
  tooltip: import("./types/inst").PopsInstCommonConfig[];
79
78
  drawer: import("./types/inst").PopsInstCommonConfig[];
79
+ folder: import("./types/inst").PopsInstCommonConfig[];
80
80
  panel: import("./types/inst").PopsInstCommonConfig[];
81
81
  rightClickMenu: import("./types/inst").PopsInstCommonConfig[];
82
82
  };
@@ -112,9 +112,9 @@ declare class Pops {
112
112
  height(element: HTMLElement | string | Window | Document | typeof globalThis, isShow?: boolean, parent?: HTMLElement | ShadowRoot): number;
113
113
  outerWidth(element: HTMLElement | string | Window | Document, isShow?: boolean, parent?: HTMLElement | ShadowRoot): number;
114
114
  outerHeight(element: HTMLElement | string | Window, isShow?: boolean, parent?: HTMLElement | ShadowRoot): number;
115
- addClassName(element: HTMLElement, className: string): void;
116
- removeClassName(element: HTMLElement, className: string): void;
117
- containsClassName(element: HTMLElement, className: string): boolean;
115
+ addClassName(element: Element | undefined | null, className: string): void;
116
+ removeClassName(element: Element | undefined | null, className: string): void;
117
+ containsClassName(element: HTMLElement | undefined | null, className: string): boolean;
118
118
  css(element: HTMLElement | string, property: keyof CSSStyleDeclaration): string;
119
119
  css(element: HTMLElement | string, property: string): string;
120
120
  css(element: HTMLElement | string, property: keyof CSSStyleDeclaration & string, value: string | number): string;
@@ -372,14 +372,14 @@ declare class Pops {
372
372
  showArrow: boolean;
373
373
  arrowDistance: number;
374
374
  otherDistance: number;
375
+ style: string | null;
375
376
  useShadowRoot: boolean;
376
377
  only: boolean;
377
378
  zIndex: number | (() => number);
378
- style: string | null;
379
379
  beforeAppendToPageCallBack: ($shadowRoot: ShadowRoot | HTMLElement, $shadowContainer: HTMLDivElement) => void;
380
380
  };
381
381
  $shadowContainer: HTMLDivElement;
382
- $shadowRoot: HTMLDivElement | ShadowRoot;
382
+ $shadowRoot: ShadowRoot | HTMLDivElement;
383
383
  toolTip: import("./components/tooltip").ToolTip;
384
384
  };
385
385
  /**
@@ -418,7 +418,7 @@ declare class Pops {
418
418
  rightClickMenu: (details: PopsRightClickMenuDetails) => {
419
419
  guid: string;
420
420
  config: {
421
- target: HTMLElement | Node | {
421
+ target: Node | HTMLElement | {
422
422
  addEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean) => void;
423
423
  dispatchEvent: (event: Event) => boolean;
424
424
  removeEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean) => void;
@@ -21064,10 +21064,10 @@ declare class Pops {
21064
21064
  className: string;
21065
21065
  isAnimation: boolean;
21066
21066
  preventDefault: boolean;
21067
+ style: string | null;
21067
21068
  useShadowRoot: boolean;
21068
21069
  only: boolean;
21069
21070
  zIndex: number | (() => number);
21070
- style: string | null;
21071
21071
  beforeAppendToPageCallBack: ($shadowRoot: ShadowRoot | HTMLElement, $shadowContainer: HTMLDivElement) => void;
21072
21072
  };
21073
21073
  removeWindowCheckClickListener: () => void;
@@ -1,10 +1,10 @@
1
1
  export declare const PopsIcon: {
2
2
  $data: {
3
3
  loading: string;
4
+ close: string;
4
5
  min: string;
5
- max: string;
6
6
  mise: string;
7
- close: string;
7
+ max: string;
8
8
  edit: string;
9
9
  share: string;
10
10
  delete: string;
@@ -65,7 +65,7 @@ export interface PopsPanelSelectMultipleDetails<T = any> extends PopsPanelCommon
65
65
  /**
66
66
  * (可选)是否禁用
67
67
  */
68
- disabled?: boolean | ((value: T) => boolean);
68
+ disabled?: boolean | (() => boolean);
69
69
  /**
70
70
  * 提示文字
71
71
  */
@@ -3,7 +3,7 @@ export declare const PopsRightClickMenu: {
3
3
  init(details: PopsRightClickMenuDetails): {
4
4
  guid: string;
5
5
  config: {
6
- target: HTMLElement | Node | {
6
+ target: Node | HTMLElement | {
7
7
  addEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean) => void;
8
8
  dispatchEvent: (event: Event) => boolean;
9
9
  removeEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean) => void;
@@ -20649,10 +20649,10 @@ export declare const PopsRightClickMenu: {
20649
20649
  className: string;
20650
20650
  isAnimation: boolean;
20651
20651
  preventDefault: boolean;
20652
+ style: string | null;
20652
20653
  useShadowRoot: boolean;
20653
20654
  only: boolean;
20654
20655
  zIndex: number | (() => number);
20655
- style: string | null;
20656
20656
  beforeAppendToPageCallBack: ($shadowRoot: ShadowRoot | HTMLElement, $shadowContainer: HTMLDivElement) => void;
20657
20657
  };
20658
20658
  removeWindowCheckClickListener: () => void;
@@ -219,14 +219,14 @@ export declare const PopsTooltip: {
219
219
  showArrow: boolean;
220
220
  arrowDistance: number;
221
221
  otherDistance: number;
222
+ style: string | null;
222
223
  useShadowRoot: boolean;
223
224
  only: boolean;
224
225
  zIndex: number | (() => number);
225
- style: string | null;
226
226
  beforeAppendToPageCallBack: ($shadowRoot: ShadowRoot | HTMLElement, $shadowContainer: HTMLDivElement) => void;
227
227
  };
228
228
  $shadowContainer: HTMLDivElement;
229
- $shadowRoot: HTMLDivElement | ShadowRoot;
229
+ $shadowRoot: ShadowRoot | HTMLDivElement;
230
230
  toolTip: ToolTip;
231
231
  };
232
232
  };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * 通用的CSS类名
3
+ */
4
+ export declare const PopsCommonCSSClassName: {
5
+ flexCenter: string;
6
+ flexYCenter: string;
7
+ flexXCenter: string;
8
+ hide: string;
9
+ hideImportant: string;
10
+ noBorder: string;
11
+ noBorderImportant: string;
12
+ userSelectNone: string;
13
+ lineHeightCenter: string;
14
+ widthFill: string;
15
+ textIsDisabled: string;
16
+ textIsDisabledImportant: string;
17
+ };
@@ -1,4 +1,4 @@
1
- import type { PopsCommonConfig, PopsDragConfig } from "./types/components";
1
+ import type { PopsCommonConfig, PopsDragConfig } from "../types/components";
2
2
  type EnterReturnType<T> = null | T | (() => T);
3
3
  type GlobalConfigOption = {
4
4
  style?: EnterReturnType<string>;
@@ -21,9 +21,9 @@ export declare const GlobalConfig: {
21
21
  only?: boolean | undefined;
22
22
  width?: string | undefined;
23
23
  height?: string | undefined;
24
- position?: import("./types/position").PopsPosition | undefined;
25
- animation?: import("./types/animation").PopsAnimation | undefined;
26
- mask?: import("./types/mask").PopsMaskDetails | undefined;
24
+ position?: import("../types/position").PopsPosition | undefined;
25
+ animation?: import("../types/animation").PopsAnimation | undefined;
26
+ mask?: import("../types/mask").PopsMaskDetails | undefined;
27
27
  forbiddenScroll?: boolean | undefined;
28
28
  beforeAppendToPageCallBack?: void;
29
29
  drag?: boolean | undefined;
@@ -502,19 +502,19 @@ declare class PopsDOMUtils extends PopsDOMUtilsEvent {
502
502
  * @param element 目标元素
503
503
  * @param className className属性
504
504
  */
505
- addClassName(element: HTMLElement, className: string): void;
505
+ addClassName(element: Element | undefined | null, className: string): void;
506
506
  /**
507
507
  * 删除className
508
508
  * @param element 目标元素
509
509
  * @param className className属性
510
510
  */
511
- removeClassName(element: HTMLElement, className: string): void;
511
+ removeClassName(element: Element | undefined | null, className: string): void;
512
512
  /**
513
513
  * 判断元素是否包含某个className
514
514
  * @param element 目标元素
515
515
  * @param className className属性
516
516
  */
517
- containsClassName(element: HTMLElement, className: string): boolean;
517
+ containsClassName(element: HTMLElement | undefined | null, className: string): boolean;
518
518
  /**
519
519
  * 获取元素的样式属性值
520
520
  * @param element 目标元素
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whitesev/pops",
3
- "version": "2.2.3",
3
+ "version": "2.2.5",
4
4
  "type": "module",
5
5
  "description": "弹窗库",
6
6
  "main": "dist/index.cjs.js",
package/src/Pops.ts CHANGED
@@ -25,7 +25,7 @@ import type { PopsSearchSuggestionDetails } from "./components/searchSuggestion/
25
25
  import { PopsSearchSuggestion } from "./components/searchSuggestion";
26
26
  import { PopsMathFloatUtils } from "./utils/PopsMathUtils";
27
27
  import { PanelHandlerComponents } from "./components/panel/handlerComponents";
28
- import { GlobalConfig } from "./GlobalConfig";
28
+ import { GlobalConfig } from "./config/GlobalConfig";
29
29
  import { PopsTooltip } from "./components/tooltip";
30
30
  import { PopsCSS } from "./PopsCSS";
31
31
  import { PopsIcon } from "./PopsIcon";
@@ -36,7 +36,7 @@ class Pops {
36
36
  /** 配置 */
37
37
  config = {
38
38
  /** 版本号 */
39
- version: "2025.7.15",
39
+ version: "2025.7.16",
40
40
  cssText: PopsCSS,
41
41
  /** icon图标的svg代码 */
42
42
  iconSVG: PopsIcon.$data,
@@ -1,4 +1,4 @@
1
- import { GlobalConfig } from "../../GlobalConfig";
1
+ import { GlobalConfig } from "../../config/GlobalConfig";
2
2
  import { PopsElementHandler } from "../../handler/PopsElementHandler";
3
3
  import { PopsHandler } from "../../handler/PopsHandler";
4
4
  import { popsDOMUtils } from "../../utils/PopsDOMUtils";
@@ -1,4 +1,4 @@
1
- import { GlobalConfig } from "../../GlobalConfig";
1
+ import { GlobalConfig } from "../../config/GlobalConfig";
2
2
  import { PopsElementHandler } from "../../handler/PopsElementHandler";
3
3
  import { PopsHandler } from "../../handler/PopsHandler";
4
4
  import { PopsCSS } from "../../PopsCSS";
@@ -1,4 +1,4 @@
1
- import { GlobalConfig } from "../../GlobalConfig";
1
+ import { GlobalConfig } from "../../config/GlobalConfig";
2
2
  import { PopsElementHandler } from "../../handler/PopsElementHandler";
3
3
  import { PopsHandler } from "../../handler/PopsHandler";
4
4
  import { PopsCSS } from "../../PopsCSS";
@@ -1,4 +1,4 @@
1
- import { GlobalConfig } from "../../GlobalConfig";
1
+ import { GlobalConfig } from "../../config/GlobalConfig";
2
2
  import { PopsElementHandler } from "../../handler/PopsElementHandler";
3
3
  import { PopsHandler } from "../../handler/PopsHandler";
4
4
  import { PopsCSS } from "../../PopsCSS";
@@ -1,5 +1,5 @@
1
1
  import { PopsCore } from "../../PopsCore";
2
- import { GlobalConfig } from "../../GlobalConfig";
2
+ import { GlobalConfig } from "../../config/GlobalConfig";
3
3
  import { PopsElementHandler } from "../../handler/PopsElementHandler";
4
4
  import { PopsHandler } from "../../handler/PopsHandler";
5
5
  import { PopsCSS } from "../../PopsCSS";
@@ -1,4 +1,4 @@
1
- import { GlobalConfig } from "../../GlobalConfig";
1
+ import { GlobalConfig } from "../../config/GlobalConfig";
2
2
  import { PopsElementHandler } from "../../handler/PopsElementHandler";
3
3
  import { PopsHandler } from "../../handler/PopsHandler";
4
4
  import { PopsCSS } from "../../PopsCSS";
@@ -34,7 +34,6 @@ export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
34
34
  type: "switch",
35
35
  // @ts-ignore
36
36
  props: {},
37
- disabled: false,
38
37
  attributes: [],
39
38
  getValue() {
40
39
  return true;
@@ -59,6 +58,21 @@ export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
59
58
  min: 1,
60
59
  max: 100,
61
60
  },
61
+ {
62
+ className: "panel-button",
63
+ text: "button",
64
+ type: "button",
65
+ // @ts-ignore
66
+ props: {},
67
+ attributes: [],
68
+ buttonIcon: "view",
69
+ buttonIconIsLoading: true,
70
+ buttonType: "default",
71
+ buttonText: "default按钮",
72
+ callback(event) {
73
+ console.log("点击按钮", event);
74
+ },
75
+ },
62
76
  {
63
77
  className: "panel-button",
64
78
  text: "button",
@@ -173,6 +187,7 @@ export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
173
187
  className: "panel-select",
174
188
  text: "select",
175
189
  type: "select",
190
+ disabled: true,
176
191
  // @ts-ignore
177
192
  props: {},
178
193
  attributes: [],
@@ -215,6 +230,7 @@ export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
215
230
  className: "panel-select-multiple",
216
231
  type: "select-multiple",
217
232
  text: "select-multiple",
233
+ disabled: true,
218
234
  // @ts-ignore
219
235
  props: {},
220
236