@whitesev/pops 2.2.2 → 2.2.4

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 (45) hide show
  1. package/dist/index.amd.js +67 -23
  2. package/dist/index.amd.js.map +1 -1
  3. package/dist/index.cjs.js +67 -23
  4. package/dist/index.cjs.js.map +1 -1
  5. package/dist/index.esm.js +67 -23
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/index.iife.js +67 -23
  8. package/dist/index.iife.js.map +1 -1
  9. package/dist/index.system.js +67 -23
  10. package/dist/index.system.js.map +1 -1
  11. package/dist/index.umd.js +67 -23
  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-input.d.ts +9 -1
  16. package/dist/types/src/components/panel/types/components-select.d.ts +6 -1
  17. package/dist/types/src/components/panel/types/components-switch.d.ts +6 -1
  18. package/dist/types/src/components/panel/types/components-textarea.d.ts +8 -2
  19. package/dist/types/src/components/rightClickMenu/index.d.ts +2 -2
  20. package/dist/types/src/components/tooltip/index.d.ts +2 -2
  21. package/dist/types/src/config/CommonCSSClassName.d.ts +17 -0
  22. package/dist/types/src/{GlobalConfig.d.ts → config/GlobalConfig.d.ts} +4 -4
  23. package/dist/types/src/utils/PopsDOMUtils.d.ts +3 -3
  24. package/package.json +1 -1
  25. package/src/Pops.ts +2 -2
  26. package/src/components/alert/index.ts +1 -1
  27. package/src/components/confirm/index.ts +1 -1
  28. package/src/components/drawer/index.ts +1 -1
  29. package/src/components/folder/index.ts +1 -1
  30. package/src/components/iframe/index.ts +1 -1
  31. package/src/components/loading/index.ts +1 -1
  32. package/src/components/panel/handlerComponents.ts +74 -16
  33. package/src/components/panel/index.ts +1 -1
  34. package/src/components/panel/types/components-input.ts +9 -1
  35. package/src/components/panel/types/components-select.ts +6 -1
  36. package/src/components/panel/types/components-switch.ts +6 -1
  37. package/src/components/panel/types/components-textarea.ts +8 -2
  38. package/src/components/prompt/index.ts +1 -1
  39. package/src/components/rightClickMenu/index.ts +1 -1
  40. package/src/components/searchSuggestion/index.ts +7 -3
  41. package/src/components/tooltip/index.ts +1 -1
  42. package/src/config/CommonCSSClassName.ts +17 -0
  43. package/src/{GlobalConfig.ts → config/GlobalConfig.ts} +1 -1
  44. package/src/css/common.css +14 -0
  45. 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;
@@ -5,10 +5,12 @@ import type { PopsPanelCommonDetails } from "./components-common";
5
5
  export interface PopsPanelInputDetails extends PopsPanelCommonDetails<PopsPanelInputDetails> {
6
6
  /**
7
7
  * (可选)className属性
8
+ * @default ""
8
9
  */
9
10
  className?: string;
10
11
  /**
11
12
  * (可选)自定义元素属性
13
+ * @default {}
12
14
  */
13
15
  attributes?: {
14
16
  [key: string]: any;
@@ -17,6 +19,7 @@ export interface PopsPanelInputDetails extends PopsPanelCommonDetails<PopsPanelI
17
19
  }[];
18
20
  /**
19
21
  * (可选)自定义属性
22
+ * @default {}
20
23
  */
21
24
  props?: {
22
25
  [K in keyof HTMLElement]?: HTMLElement[K];
@@ -27,6 +30,7 @@ export interface PopsPanelInputDetails extends PopsPanelCommonDetails<PopsPanelI
27
30
  text: string;
28
31
  /**
29
32
  * (可选)左边的文字下面的描述
33
+ * @default ""
30
34
  */
31
35
  description?: string;
32
36
  /**
@@ -35,8 +39,9 @@ export interface PopsPanelInputDetails extends PopsPanelCommonDetails<PopsPanelI
35
39
  type: "input";
36
40
  /**
37
41
  * (可选)是否禁用
42
+ * @default false
38
43
  */
39
- disabled?: boolean;
44
+ disabled?: boolean | (() => boolean);
40
45
  /**
41
46
  * 获取该项的值的回调函数
42
47
  */
@@ -50,14 +55,17 @@ export interface PopsPanelInputDetails extends PopsPanelCommonDetails<PopsPanelI
50
55
  callback(event: InputEvent, value: string, valueAsNumber?: number): void;
51
56
  /**
52
57
  * (可选)输入框内的提示
58
+ * @default ""
53
59
  */
54
60
  placeholder?: string;
55
61
  /**
56
62
  * (可选)是否是密码框
63
+ * @default false
57
64
  */
58
65
  isPassword?: boolean;
59
66
  /**
60
67
  * (可选)是否是数字框
68
+ * @default false
61
69
  */
62
70
  isNumber?: boolean;
63
71
  /**
@@ -7,10 +7,12 @@ import type { PopsPanelFormsTotalDetails } from ".";
7
7
  export interface PopsPanelSelectDetails<T = any> extends PopsPanelCommonDetails<PopsPanelSelectDetails> {
8
8
  /**
9
9
  * (可选)className属性
10
+ * @default ""
10
11
  */
11
12
  className?: string;
12
13
  /**
13
14
  * (可选)自定义元素属性
15
+ * @default {}
14
16
  */
15
17
  attributes?: {
16
18
  [key: string]: any;
@@ -19,6 +21,7 @@ export interface PopsPanelSelectDetails<T = any> extends PopsPanelCommonDetails<
19
21
  }[];
20
22
  /**
21
23
  * (可选)自定义属性
24
+ * @default {}
22
25
  */
23
26
  props?: {
24
27
  [K in keyof HTMLElement]?: HTMLElement[K];
@@ -29,6 +32,7 @@ export interface PopsPanelSelectDetails<T = any> extends PopsPanelCommonDetails<
29
32
  text: string;
30
33
  /**
31
34
  * (可选)左边的文字下面的描述
35
+ * @default ""
32
36
  */
33
37
  description?: string;
34
38
  /**
@@ -37,8 +41,9 @@ export interface PopsPanelSelectDetails<T = any> extends PopsPanelCommonDetails<
37
41
  type: "select";
38
42
  /**
39
43
  * (可选)是否禁用
44
+ * @default false
40
45
  */
41
- disabled?: boolean;
46
+ disabled?: boolean | (() => boolean);
42
47
  /**
43
48
  * 获取该项的值的回调函数
44
49
  */
@@ -5,10 +5,12 @@ import type { PopsPanelCommonDetails } from "./components-common";
5
5
  export interface PopsPanelSwitchDetails extends PopsPanelCommonDetails<PopsPanelSwitchDetails> {
6
6
  /**
7
7
  * (可选)className属性
8
+ * @default ""
8
9
  */
9
10
  className?: string;
10
11
  /**
11
12
  * (可选)自定义元素属性
13
+ * @default {}
12
14
  */
13
15
  attributes?: {
14
16
  [key: string]: any;
@@ -17,6 +19,7 @@ export interface PopsPanelSwitchDetails extends PopsPanelCommonDetails<PopsPanel
17
19
  }[];
18
20
  /**
19
21
  * (可选)自定义属性
22
+ * @default {}
20
23
  */
21
24
  props?: {
22
25
  [K in keyof HTMLElement]?: HTMLElement[K];
@@ -27,6 +30,7 @@ export interface PopsPanelSwitchDetails extends PopsPanelCommonDetails<PopsPanel
27
30
  text: string;
28
31
  /**
29
32
  * (可选)左边的文字下面的描述
33
+ * @default ""
30
34
  */
31
35
  description?: string;
32
36
  /**
@@ -35,8 +39,9 @@ export interface PopsPanelSwitchDetails extends PopsPanelCommonDetails<PopsPanel
35
39
  type: "switch";
36
40
  /**
37
41
  * (可选)是否禁用
42
+ * @default false
38
43
  */
39
- disabled?: false;
44
+ disabled?: boolean | (() => boolean);
40
45
  /**
41
46
  * 获取该项的值的回调函数
42
47
  */
@@ -5,10 +5,12 @@ import type { PopsPanelCommonDetails } from "./components-common";
5
5
  export interface PopsPanelTextAreaDetails extends PopsPanelCommonDetails<PopsPanelTextAreaDetails> {
6
6
  /**
7
7
  * (可选)className属性
8
+ * @default ""
8
9
  */
9
10
  className?: string;
10
11
  /**
11
12
  * (可选)自定义元素属性
13
+ * @default {}
12
14
  */
13
15
  attributes?: {
14
16
  [key: string]: any;
@@ -17,6 +19,7 @@ export interface PopsPanelTextAreaDetails extends PopsPanelCommonDetails<PopsPan
17
19
  }[];
18
20
  /**
19
21
  * (可选)自定义属性
22
+ * @default {}
20
23
  */
21
24
  props?: {
22
25
  [K in keyof HTMLElement]?: HTMLElement[K];
@@ -27,6 +30,7 @@ export interface PopsPanelTextAreaDetails extends PopsPanelCommonDetails<PopsPan
27
30
  text: string;
28
31
  /**
29
32
  * (可选)左边的文字下面的描述
33
+ * @default ""
30
34
  */
31
35
  description?: string;
32
36
  /**
@@ -35,8 +39,9 @@ export interface PopsPanelTextAreaDetails extends PopsPanelCommonDetails<PopsPan
35
39
  type: "textarea";
36
40
  /**
37
41
  * (可选)是否禁用
42
+ * @default false
38
43
  */
39
- disabled?: boolean;
44
+ disabled?: boolean | (() => boolean);
40
45
  /**
41
46
  * 获取该项的值的回调函数
42
47
  */
@@ -51,6 +56,7 @@ export interface PopsPanelTextAreaDetails extends PopsPanelCommonDetails<PopsPan
51
56
  }, value: string): void;
52
57
  /**
53
58
  * 输入框内的提示
59
+ * @default ""
54
60
  */
55
- placeholder: string;
61
+ placeholder?: string;
56
62
  }
@@ -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.2",
3
+ "version": "2.2.4",
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.13",
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";
@@ -27,6 +27,7 @@ import type { PopsPanelSelectDetails } from "./types/components-select";
27
27
  import type { PopsPanelSliderDetails } from "./types/components-slider";
28
28
  import type { PopsPanelSwitchDetails } from "./types/components-switch";
29
29
  import type { PopsPanelTextAreaDetails } from "./types/components-textarea";
30
+ import { PopsCommonCSSClassName } from "../../config/CommonCSSClassName";
30
31
 
31
32
  /**
32
33
  * 处理组件(把组件配置转为组件元素)
@@ -321,17 +322,27 @@ export const PanelHandlerComponents = () => {
321
322
  ".pops-panel-switch__input"
322
323
  )!,
323
324
  core: $li.querySelector<HTMLSpanElement>(".pops-panel-switch__core")!,
325
+ itemLeftTextContainer: $li.querySelector<HTMLDivElement>(
326
+ ".pops-panel-item-left-text"
327
+ ),
324
328
  },
325
329
  init() {
326
330
  this.setStatus(this.$data.value);
327
- if (formConfig.disabled) {
331
+ let disabled =
332
+ typeof formConfig.disabled === "function"
333
+ ? formConfig.disabled()
334
+ : formConfig.disabled;
335
+ if (disabled) {
328
336
  this.disable();
329
337
  }
330
338
  this.setClickEvent();
331
339
  },
340
+ /**
341
+ * 设置点击事件
342
+ */
332
343
  setClickEvent() {
333
344
  let that = this;
334
- popsDOMUtils.on(this.$ele.core, "click", void 0, function (event) {
345
+ popsDOMUtils.on(this.$ele.core, "click", function (event) {
335
346
  if (
336
347
  that.$ele.input.disabled ||
337
348
  that.$ele.switch.hasAttribute("data-disabled")
@@ -384,13 +395,21 @@ export const PanelHandlerComponents = () => {
384
395
  disable() {
385
396
  this.$ele.input.disabled = true;
386
397
  this.$ele.switch.setAttribute("data-disabled", "true");
398
+ popsDOMUtils.addClassName(
399
+ this.$ele.itemLeftTextContainer,
400
+ PopsCommonCSSClassName.textIsDisabled
401
+ );
387
402
  },
388
403
  /**
389
- * 启用复选框
404
+ * 取消禁用复选框
390
405
  */
391
406
  notDisable() {
392
407
  this.$ele.input.disabled = false;
393
408
  this.$ele.switch.removeAttribute("data-disabled");
409
+ popsDOMUtils.removeClassName(
410
+ this.$ele.itemLeftTextContainer,
411
+ PopsCommonCSSClassName.textIsDisabled
412
+ );
394
413
  },
395
414
  };
396
415
 
@@ -1109,9 +1128,11 @@ export const PanelHandlerComponents = () => {
1109
1128
  $li,
1110
1129
  /*html*/ `
1111
1130
  <div class="pops-panel-item-left-text">
1112
- <p class="pops-panel-item-left-main-text">${formConfig.text}</p>${leftDescriptionText}</div>
1113
- <div class="pops-panel-input pops-user-select-none">
1114
- <input type="${inputType}" placeholder="${formConfig.placeholder}">
1131
+ <p class="pops-panel-item-left-main-text">${
1132
+ formConfig.text
1133
+ }</p>${leftDescriptionText}</div>
1134
+ <div class="pops-panel-input">
1135
+ <input type="${inputType}" placeholder="${formConfig.placeholder ?? ""}">
1115
1136
  </div>
1116
1137
  `
1117
1138
  );
@@ -1144,7 +1165,12 @@ export const PanelHandlerComponents = () => {
1144
1165
  }
1145
1166
 
1146
1167
  this.setInputChangeEvent();
1147
- if (formConfig.disabled) {
1168
+ // 是否禁用复选框
1169
+ let disabled =
1170
+ typeof formConfig.disabled === "function"
1171
+ ? formConfig.disabled()
1172
+ : formConfig.disabled;
1173
+ if (disabled) {
1148
1174
  this.disable();
1149
1175
  }
1150
1176
  if (typeof formConfig.handlerCallBack === "function") {
@@ -1176,6 +1202,10 @@ export const PanelHandlerComponents = () => {
1176
1202
  this.$ele.inputSpanIcon.querySelector<HTMLElement>(
1177
1203
  ".pops-panel-icon"
1178
1204
  )!;
1205
+ popsDOMUtils.addClassName(
1206
+ this.$ele.panelInput,
1207
+ PopsCommonCSSClassName.userSelectNone
1208
+ );
1179
1209
  },
1180
1210
  /**
1181
1211
  * 禁用
@@ -1348,7 +1378,11 @@ export const PanelHandlerComponents = () => {
1348
1378
  init() {
1349
1379
  this.setValue(this.$data.value);
1350
1380
  this.setChangeEvent();
1351
- if (formConfig.disabled) {
1381
+ let disabled =
1382
+ typeof formConfig.disabled === "function"
1383
+ ? formConfig.disabled()
1384
+ : formConfig.disabled;
1385
+ if (disabled) {
1352
1386
  this.disable();
1353
1387
  }
1354
1388
  },
@@ -1424,7 +1458,7 @@ export const PanelHandlerComponents = () => {
1424
1458
  /*html*/ `
1425
1459
  <div class="pops-panel-item-left-text">
1426
1460
  <p class="pops-panel-item-left-main-text">${formConfig.text}</p>${leftDescriptionText}</div>
1427
- <div class="pops-panel-select pops-user-select-none">
1461
+ <div class="pops-panel-select">
1428
1462
  <select></select>
1429
1463
  </div>
1430
1464
  `
@@ -1447,10 +1481,18 @@ export const PanelHandlerComponents = () => {
1447
1481
  defaultValue: formConfig.getValue(),
1448
1482
  },
1449
1483
  init() {
1484
+ popsDOMUtils.addClassName(
1485
+ this.$ele.panelSelect,
1486
+ PopsCommonCSSClassName.userSelectNone
1487
+ );
1450
1488
  this.initOption();
1451
1489
  this.setChangeEvent();
1452
1490
  this.setClickEvent();
1453
- if (formConfig.disabled) {
1491
+ let disabled =
1492
+ typeof formConfig.disabled === "function"
1493
+ ? formConfig.disabled()
1494
+ : formConfig.disabled;
1495
+ if (disabled) {
1454
1496
  this.disable();
1455
1497
  }
1456
1498
  },
@@ -2653,12 +2695,19 @@ export const PanelHandlerComponents = () => {
2653
2695
  formContainerListElement.setAttribute("data-fold-enable", "");
2654
2696
  }
2655
2697
  });
2656
- formHeaderDivElement.classList.add(
2698
+ popsDOMUtils.addClassName(
2699
+ formHeaderDivElement,
2657
2700
  "pops-panel-forms-fold-container"
2658
2701
  );
2659
- formHeaderDivElement.classList.add("pops-user-select-none");
2702
+ popsDOMUtils.addClassName(
2703
+ formHeaderDivElement,
2704
+ PopsCommonCSSClassName.userSelectNone
2705
+ );
2660
2706
  formContainerListElement.setAttribute("data-fold-enable", "");
2661
- formContainerListElement.classList.add("pops-panel-forms-fold");
2707
+ popsDOMUtils.addClassName(
2708
+ formHeaderDivElement,
2709
+ "pops-panel-forms-fold"
2710
+ );
2662
2711
  formContainerListElement.appendChild(formHeaderDivElement);
2663
2712
  } else {
2664
2713
  /* 加进容器内 */
@@ -2919,10 +2968,19 @@ export const PanelHandlerComponents = () => {
2919
2968
  formContainerListElement.setAttribute("data-fold-enable", "");
2920
2969
  }
2921
2970
  });
2922
- formHeaderDivElement.classList.add("pops-panel-forms-fold-container");
2923
- formHeaderDivElement.classList.add("pops-user-select-none");
2971
+ popsDOMUtils.addClassName(
2972
+ formHeaderDivElement,
2973
+ "pops-panel-forms-fold-container"
2974
+ );
2975
+ popsDOMUtils.addClassName(
2976
+ formHeaderDivElement,
2977
+ PopsCommonCSSClassName.userSelectNone
2978
+ );
2924
2979
  formContainerListElement.setAttribute("data-fold-enable", "");
2925
- formContainerListElement.classList.add("pops-panel-forms-fold");
2980
+ popsDOMUtils.addClassName(
2981
+ formHeaderDivElement,
2982
+ "pops-panel-forms-fold"
2983
+ );
2926
2984
  formContainerListElement.appendChild(formHeaderDivElement);
2927
2985
  } else {
2928
2986
  /* 加进容器内 */
@@ -6,7 +6,7 @@ import { popsUtils } from "../../utils/PopsUtils";
6
6
  import type { PopsPanelDetails, PopsPanelEventType } from "./types";
7
7
  import { PopsPanelConfig } from "./config";
8
8
  import { PanelHandlerComponents } from "./handlerComponents";
9
- import { GlobalConfig } from "../../GlobalConfig";
9
+ import { GlobalConfig } from "../../config/GlobalConfig";
10
10
  import { PopsCSS } from "../../PopsCSS";
11
11
  import type { PopsType } from "../../types/main";
12
12