@whitesev/pops 2.2.8 → 2.2.9

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 (146) hide show
  1. package/dist/index.amd.js +2815 -3010
  2. package/dist/index.amd.js.map +1 -1
  3. package/dist/index.cjs.js +2815 -3010
  4. package/dist/index.cjs.js.map +1 -1
  5. package/dist/index.esm.js +2815 -3010
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/index.iife.js +2815 -3010
  8. package/dist/index.iife.js.map +1 -1
  9. package/dist/index.system.js +2815 -3010
  10. package/dist/index.system.js.map +1 -1
  11. package/dist/index.umd.js +2815 -3010
  12. package/dist/index.umd.js.map +1 -1
  13. package/dist/types/src/Pops.d.ts +11 -11
  14. package/dist/types/src/PopsIcon.d.ts +2 -2
  15. package/dist/types/src/components/rightClickMenu/index.d.ts +2 -2
  16. package/dist/types/src/components/tooltip/index.d.ts +2 -2
  17. package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +256 -259
  18. package/dist/types/src/types/animation.d.ts +19 -19
  19. package/dist/types/src/types/button.d.ts +187 -196
  20. package/dist/types/src/types/components.d.ts +213 -229
  21. package/dist/types/src/types/event.d.ts +63 -63
  22. package/dist/types/src/types/global.d.ts +20 -20
  23. package/dist/types/src/types/icon.d.ts +32 -32
  24. package/dist/types/src/types/inst.d.ts +24 -24
  25. package/dist/types/src/types/main.d.ts +114 -122
  26. package/dist/types/src/types/mask.d.ts +49 -49
  27. package/dist/types/src/types/position.d.ts +60 -60
  28. package/package.json +61 -56
  29. package/LICENSE +0 -674
  30. package/src/Pops.ts +0 -209
  31. package/src/PopsAnimation.ts +0 -32
  32. package/src/PopsCSS.ts +0 -51
  33. package/src/PopsCore.ts +0 -44
  34. package/src/PopsIcon.ts +0 -95
  35. package/src/PopsInst.ts +0 -21
  36. package/src/components/alert/config.ts +0 -62
  37. package/src/components/alert/index.css +0 -0
  38. package/src/components/alert/index.ts +0 -181
  39. package/src/components/alert/types/index.ts +0 -30
  40. package/src/components/confirm/config.ts +0 -90
  41. package/src/components/confirm/index.css +0 -0
  42. package/src/components/confirm/index.ts +0 -192
  43. package/src/components/confirm/types/index.ts +0 -17
  44. package/src/components/drawer/config.ts +0 -89
  45. package/src/components/drawer/index.css +0 -35
  46. package/src/components/drawer/index.ts +0 -260
  47. package/src/components/drawer/types/index.ts +0 -61
  48. package/src/components/folder/config.ts +0 -147
  49. package/src/components/folder/folderIcon.ts +0 -28
  50. package/src/components/folder/index.css +0 -314
  51. package/src/components/folder/index.ts +0 -1050
  52. package/src/components/folder/types/index.ts +0 -101
  53. package/src/components/iframe/config.ts +0 -60
  54. package/src/components/iframe/index.css +0 -75
  55. package/src/components/iframe/index.ts +0 -351
  56. package/src/components/iframe/types/index.ts +0 -146
  57. package/src/components/loading/config.ts +0 -29
  58. package/src/components/loading/index.css +0 -66
  59. package/src/components/loading/index.ts +0 -114
  60. package/src/components/loading/types/index.ts +0 -40
  61. package/src/components/panel/config.ts +0 -550
  62. package/src/components/panel/handlerComponents.ts +0 -3277
  63. package/src/components/panel/index.css +0 -1292
  64. package/src/components/panel/index.ts +0 -213
  65. package/src/components/panel/types/components-button.ts +0 -69
  66. package/src/components/panel/types/components-common.ts +0 -55
  67. package/src/components/panel/types/components-deepMenu.ts +0 -85
  68. package/src/components/panel/types/components-forms.ts +0 -45
  69. package/src/components/panel/types/components-input.ts +0 -82
  70. package/src/components/panel/types/components-own.ts +0 -31
  71. package/src/components/panel/types/components-select.ts +0 -101
  72. package/src/components/panel/types/components-selectMultiple.ts +0 -133
  73. package/src/components/panel/types/components-slider.ts +0 -78
  74. package/src/components/panel/types/components-switch.ts +0 -57
  75. package/src/components/panel/types/components-textarea.ts +0 -69
  76. package/src/components/panel/types/index.ts +0 -177
  77. package/src/components/prompt/config.ts +0 -94
  78. package/src/components/prompt/index.css +0 -34
  79. package/src/components/prompt/index.ts +0 -222
  80. package/src/components/prompt/types/index.ts +0 -55
  81. package/src/components/rightClickMenu/config.ts +0 -130
  82. package/src/components/rightClickMenu/index.css +0 -88
  83. package/src/components/rightClickMenu/index.ts +0 -689
  84. package/src/components/rightClickMenu/types/index.ts +0 -91
  85. package/src/components/searchSuggestion/config.ts +0 -59
  86. package/src/components/searchSuggestion/index.ts +0 -708
  87. package/src/components/searchSuggestion/types/index.ts +0 -147
  88. package/src/components/tooltip/config.ts +0 -34
  89. package/src/components/tooltip/index.css +0 -196
  90. package/src/components/tooltip/index.ts +0 -655
  91. package/src/components/tooltip/types/index.ts +0 -125
  92. package/src/config/CommonCSSClassName.ts +0 -17
  93. package/src/config/GlobalConfig.ts +0 -80
  94. package/src/css/animation.css +0 -2245
  95. package/src/css/button.css +0 -542
  96. package/src/css/common.css +0 -52
  97. package/src/css/index.css +0 -254
  98. package/src/css/ninePalaceGridPosition.css +0 -50
  99. package/src/css/scrollbar.css +0 -22
  100. package/src/handler/PopsElementHandler.ts +0 -325
  101. package/src/handler/PopsHandler.ts +0 -719
  102. package/src/svg/arrowLeft.svg +0 -4
  103. package/src/svg/arrowRight.svg +0 -4
  104. package/src/svg/chromeFilled.svg +0 -14
  105. package/src/svg/circleClose.svg +0 -8
  106. package/src/svg/close.svg +0 -5
  107. package/src/svg/cpu.svg +0 -8
  108. package/src/svg/delete.svg +0 -5
  109. package/src/svg/documentCopy.svg +0 -5
  110. package/src/svg/edit.svg +0 -8
  111. package/src/svg/eleme.svg +0 -5
  112. package/src/svg/elemePlus.svg +0 -5
  113. package/src/svg/headset.svg +0 -5
  114. package/src/svg/hide.svg +0 -8
  115. package/src/svg/keyboard.svg +0 -8
  116. package/src/svg/loading.svg +0 -5
  117. package/src/svg/max.svg +0 -5
  118. package/src/svg/min.svg +0 -5
  119. package/src/svg/mise.svg +0 -5
  120. package/src/svg/monitor.svg +0 -5
  121. package/src/svg/next.svg +0 -5
  122. package/src/svg/picture.svg +0 -8
  123. package/src/svg/prev.svg +0 -5
  124. package/src/svg/search.svg +0 -5
  125. package/src/svg/share.svg +0 -5
  126. package/src/svg/upload.svg +0 -5
  127. package/src/svg/videoPause.svg +0 -5
  128. package/src/svg/videoPlay.svg +0 -5
  129. package/src/svg/view.svg +0 -5
  130. package/src/types/PopsDOMUtilsEventType.d.ts +0 -259
  131. package/src/types/animation.d.ts +0 -19
  132. package/src/types/button.d.ts +0 -196
  133. package/src/types/components.d.ts +0 -229
  134. package/src/types/event.d.ts +0 -63
  135. package/src/types/global.d.ts +0 -20
  136. package/src/types/icon.d.ts +0 -32
  137. package/src/types/inst.d.ts +0 -24
  138. package/src/types/main.d.ts +0 -122
  139. package/src/types/mask.d.ts +0 -49
  140. package/src/types/position.d.ts +0 -60
  141. package/src/utils/PopsDOMUtils.ts +0 -2649
  142. package/src/utils/PopsDOMUtilsEventsConfig.ts +0 -6
  143. package/src/utils/PopsInstanceUtils.ts +0 -801
  144. package/src/utils/PopsMathUtils.ts +0 -77
  145. package/src/utils/PopsSafeUtils.ts +0 -24
  146. package/src/utils/PopsUtils.ts +0 -430
@@ -1,213 +0,0 @@
1
- import { PopsElementHandler } from "../../handler/PopsElementHandler";
2
- import { PopsHandler } from "../../handler/PopsHandler";
3
- import { popsDOMUtils } from "../../utils/PopsDOMUtils";
4
- import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
5
- import { popsUtils } from "../../utils/PopsUtils";
6
- import type { PopsPanelDetails, PopsPanelEventType } from "./types";
7
- import { PopsPanelConfig } from "./config";
8
- import { PanelHandlerComponents } from "./handlerComponents";
9
- import { GlobalConfig } from "../../config/GlobalConfig";
10
- import { PopsCSS } from "../../PopsCSS";
11
- import type { PopsType } from "../../types/main";
12
-
13
- export const PopsPanel = {
14
- init(details: PopsPanelDetails) {
15
- const guid = popsUtils.getRandomGUID();
16
- // 设置当前类型
17
- const popsType: PopsType = "panel";
18
-
19
- let config: Required<PopsPanelDetails> = PopsPanelConfig();
20
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
21
- config = popsUtils.assign(config, details);
22
- if (details && Array.isArray(details.content)) {
23
- config.content = details.content;
24
- }
25
- config = PopsHandler.handleOnly(popsType, config);
26
-
27
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
28
- PopsHandler.handleInit($shadowRoot, [
29
- {
30
- name: "index",
31
- css: PopsCSS.index,
32
- },
33
- {
34
- name: "ninePalaceGridPosition",
35
- css: PopsCSS.ninePalaceGridPosition,
36
- },
37
- {
38
- name: "scrollbar",
39
- css: PopsCSS.scrollbar,
40
- },
41
- {
42
- name: "button",
43
- css: PopsCSS.button,
44
- },
45
- {
46
- name: "anim",
47
- css: PopsCSS.anim,
48
- },
49
- {
50
- name: "common",
51
- css: PopsCSS.common,
52
- },
53
- {
54
- name: "panelCSS",
55
- css: PopsCSS.panelCSS,
56
- },
57
- ]);
58
-
59
- // 先把z-index提取出来
60
- let zIndex = PopsHandler.handleZIndex(config.zIndex);
61
- let maskHTML = PopsElementHandler.createMask(guid, zIndex);
62
-
63
- let headerBtnHTML = PopsElementHandler.createHeader(popsType, config);
64
- let { headerStyle, headerPStyle } = PopsElementHandler.createHeaderStyle(
65
- popsType,
66
- config
67
- );
68
-
69
- let animHTML = PopsElementHandler.createAnim(
70
- guid,
71
- popsType,
72
- config,
73
- /*html*/ `
74
- <div class="pops-title pops-${popsType}-title" style="text-align: ${
75
- config.title.position
76
- };${headerStyle}">${
77
- config.title.html
78
- ? config.title.text
79
- : `<p pops class="pops-${popsType}-title-text" class="pops-${popsType}-title-text" style="${headerPStyle}">${config.title.text}</p>`
80
- }${headerBtnHTML}</div>
81
- <div class="pops-content pops-${popsType}-content">
82
- <aside class="pops-${popsType}-aside">
83
- <ul class="pops-${popsType}-aside-top-container"></ul>
84
- <ul class="pops-${popsType}-aside-bottom-container"></ul>
85
- </aside>
86
- <section class="pops-${popsType}-container">
87
- <ul class="pops-${popsType}-container-header-ul"></ul>
88
- <ul class="pops-${popsType}-container-main-ul"></ul>
89
- </section>
90
- </div>`,
91
- "",
92
- zIndex
93
- );
94
- /**
95
- * 弹窗的主元素,包括动画层
96
- */
97
- let $anim = PopsElementHandler.parseElement<HTMLDivElement>(animHTML);
98
- /* 结构元素 */
99
- let {
100
- popsElement: $pops,
101
- headerCloseBtnElement: $headerCloseBtn,
102
- titleElement: $title,
103
- contentElement: $content,
104
- contentAsideElement: $contentAside,
105
- contentSectionContainerElement: $contentSectionContainer,
106
- } = PopsHandler.handleQueryElement($anim, popsType);
107
- if (config.isMobile || popsUtils.isPhone()) {
108
- popsDOMUtils.addClassName($pops, config.mobileClassName);
109
- }
110
- /**
111
- * 遮罩层元素
112
- */
113
- let $mask: HTMLDivElement | null = null;
114
- /**
115
- * 已创建的元素列表
116
- */
117
- let isCreatedElementList: HTMLElement[] = [$anim];
118
-
119
- /* 遮罩层元素 */
120
- if (config.mask.enable) {
121
- let { maskElement } = PopsHandler.handleMask({
122
- type: popsType,
123
- guid: guid,
124
- config: config,
125
- animElement: $anim,
126
- maskHTML: maskHTML,
127
- });
128
- $mask = maskElement;
129
- isCreatedElementList.push($mask);
130
- }
131
-
132
- /* 处理返回的配置 */
133
- let eventDetails = PopsHandler.handleEventDetails(
134
- guid,
135
- $shadowContainer,
136
- $shadowRoot,
137
- popsType,
138
- $anim,
139
- $pops,
140
- $mask!,
141
- config
142
- );
143
- /* 为顶部右边的关闭按钮添加点击事件 */
144
- PopsHandler.handleClickEvent(
145
- "close",
146
- $headerCloseBtn,
147
- eventDetails,
148
- config.btn.close!.callback!
149
- );
150
-
151
- /* 创建到页面中 */
152
- popsDOMUtils.append($shadowRoot, isCreatedElementList);
153
- if (typeof config.beforeAppendToPageCallBack === "function") {
154
- config.beforeAppendToPageCallBack($shadowRoot, $shadowContainer);
155
- }
156
- popsDOMUtils.appendBody($shadowContainer);
157
- /* 追加遮罩层元素 */
158
- if ($mask != null) {
159
- $anim.after($mask);
160
- }
161
- let panelHandlerComponents = PanelHandlerComponents();
162
- /**
163
- * 处理内部配置
164
- */
165
- panelHandlerComponents.init({
166
- config: config,
167
- $el: {
168
- $pops: $pops,
169
- $content: $content,
170
- $contentAside: $contentAside,
171
- $contentSectionContainer: $contentSectionContainer,
172
- },
173
- });
174
-
175
- PopsHandler.handlePush(popsType, {
176
- guid: guid,
177
- animElement: $anim,
178
- popsElement: $pops,
179
- maskElement: $mask!,
180
- $shadowContainer: $shadowContainer,
181
- $shadowRoot: $shadowRoot,
182
- });
183
- /* 拖拽 */
184
- if (config.drag) {
185
- PopsInstanceUtils.drag($pops, {
186
- dragElement: $title,
187
- limit: config.dragLimit,
188
- extraDistance: config.dragExtraDistance,
189
- moveCallBack: config.dragMoveCallBack,
190
- endCallBack: config.dragEndCallBack,
191
- });
192
- }
193
- let result = PopsHandler.handleResultDetails(eventDetails);
194
-
195
- return {
196
- ...result,
197
- addEventListener: <K extends keyof PopsPanelEventType>(
198
- event: K,
199
- listener: (evt: CustomEvent<PopsPanelEventType[K]>) => void,
200
- options?: boolean | EventListenerOptions
201
- ) => {
202
- $pops.addEventListener(event, listener as any, options);
203
- },
204
- removeEventListener: <K extends keyof PopsPanelEventType>(
205
- event: K,
206
- listener: (evt: CustomEvent<PopsPanelEventType[K]>) => void,
207
- options?: boolean | EventListenerOptions
208
- ) => {
209
- $pops.removeEventListener(event, listener as any, options);
210
- },
211
- };
212
- },
213
- };
@@ -1,69 +0,0 @@
1
- import type { PopsPanelCommonDetails } from "./components-common";
2
- import type { PopsButtonStyleType } from "../../../types/button";
3
- import type { PopsIconType } from "../../../types/icon";
4
- /**
5
- * pops.panel的 button
6
- */
7
- export interface PopsPanelButtonDetails
8
- extends PopsPanelCommonDetails<PopsPanelButtonDetails> {
9
- /**
10
- * (可选)className属性
11
- */
12
- className?: string;
13
- /**
14
- * (可选)自定义元素属性
15
- */
16
- attributes?:
17
- | {
18
- [key: string]: any;
19
- }
20
- | {
21
- [key: string]: any;
22
- }[];
23
- /**
24
- * (可选)自定义属性
25
- */
26
- props?: {
27
- [K in keyof HTMLElement]?: HTMLElement[K];
28
- };
29
- /**
30
- * 显示在左边的文字
31
- */
32
- text: string;
33
- /**
34
- * (可选)左边的文字下面的描述
35
- */
36
- description?: string;
37
- /**
38
- * 类型
39
- */
40
- type: "button";
41
- /**
42
- * (可选)是否禁用
43
- */
44
- disable?: boolean;
45
- /**
46
- * 按钮的类型
47
- */
48
- buttonType: PopsButtonStyleType;
49
- /**
50
- * 按钮的文字
51
- */
52
- buttonText: string | (() => string);
53
- /**
54
- * 按钮的图标,已配置的svg请看pops.config.iconSVG,或者自定义的图标svg代码
55
- */
56
- buttonIcon?: PopsIconType;
57
- /**
58
- * 按钮的图标在右边
59
- */
60
- buttonIsRightIcon?: boolean;
61
- /**
62
- * 按钮的图标旋转
63
- */
64
- buttonIconIsLoading?: boolean;
65
- /**
66
- * 点击button触发的事件
67
- */
68
- callback: (event: MouseEvent | PointerEvent) => void;
69
- }
@@ -1,55 +0,0 @@
1
- import type { PopsPanelFormsDetails } from "./components-forms";
2
- import { PopsPanelFormsTotalDetails } from ".";
3
-
4
- /**
5
- * 右侧容器的配置
6
- */
7
- export interface PopsPanelRightAsideContainerOptions {
8
- /** 当前的<li>元素 */
9
- target: HTMLLIElement | undefined;
10
- /** 当前的<li>元素的父<ul>元素 */
11
- ulElement: HTMLUListElement;
12
- /** 当前的<li>元素所在的统一的<ul>元素 */
13
- sectionContainerULElement?: HTMLUListElement;
14
- /** */
15
- formContainerListElement?: HTMLLIElement;
16
- /** */
17
- formHeaderDivElement?: HTMLElement | HTMLDivElement;
18
- }
19
- /**
20
- * 通用配置
21
- */
22
- export interface PopsPanelCommonDetails<
23
- T extends PopsPanelFormsTotalDetails | PopsPanelFormsDetails
24
- > {
25
- /**
26
- * 在添加到<ul>元素后触发该回调
27
- * @param formConfig 配置
28
- * @param container 右侧容器的元素
29
- * @example
30
- * // 例如在type为own时
31
- * afterAddToUListCallBack(formConfig, container) {
32
- * DOMUtils.on(
33
- container.formHeaderDivElement.querySelector(
34
- "a"
35
- ),
36
- "click",
37
- void 0,
38
- () => {
39
- PopsPanel.deleteValue("xxxx");
40
- container.ulElement.querySelector(
41
- "textarea"
42
- ).value = xxxxx.defaultValue;
43
- Qmsg.success("已重置");
44
- }
45
- );
46
- * }
47
- *
48
- * // 例如在type为forms时
49
- * container内只有container.ulElement这个属性
50
- */
51
- afterAddToUListCallBack?: (
52
- formConfig: T,
53
- container: PopsPanelRightAsideContainerOptions
54
- ) => void;
55
- }
@@ -1,85 +0,0 @@
1
- import type { PopsPanelFormsTotalDetails } from ".";
2
- import type { PopsPanelFormsDetails } from "./components-forms";
3
- import type { PopsPanelCommonDetails } from "./components-common";
4
- /**
5
- * pops.panel的 深层菜单
6
- */
7
- export interface PopsPanelDeepMenuDetails
8
- extends PopsPanelCommonDetails<PopsPanelDeepMenuDetails> {
9
- /**
10
- * 类型
11
- */
12
- type: "deepMenu";
13
- /**
14
- * (可选)className属性
15
- */
16
- className?: string;
17
- /**
18
- * (可选)自定义元素属性
19
- */
20
- attributes?:
21
- | {
22
- [key: string]: any;
23
- }
24
- | {
25
- [key: string]: any;
26
- }[];
27
- /**
28
- * (可选)自定义属性
29
- */
30
- props?: {
31
- [K in keyof HTMLElement]?: HTMLElement[K];
32
- };
33
- /**
34
- * 显示在左边的文字
35
- */
36
- text: string;
37
- /**
38
- * (可选)左边的文字下面的描述
39
- */
40
- description?: string;
41
- /**
42
- * (可选)右侧的文字
43
- */
44
- rightText?: string;
45
- /**
46
- * (可选)右侧的箭头图标,默认启用
47
- */
48
- arrowRightIcon?: boolean;
49
- /**
50
- * 点击整行触发的事件,可为异步函数
51
- * @param event click事件
52
- * @returns
53
- * + true 表示阻止进入深层菜单
54
- * + false (默认)表示允许进入深层菜单
55
- */
56
- clickCallBack?: (
57
- event: MouseEvent | PointerEvent,
58
- formConfig: PopsPanelDeepMenuDetails
59
- ) => boolean | void | Promise<boolean | void>;
60
- /**
61
- * 进入深层菜单后触发的回调
62
- * @param formConfig
63
- */
64
- afterEnterDeepMenuCallBack?: (
65
- formConfig: PopsPanelDeepMenuDetails,
66
- container: {
67
- /** 右侧的总容器 */
68
- sectionContainer: HTMLElement;
69
- /** 右侧的总容器的标题头容器 */
70
- sectionContainerHeaderContainer: HTMLUListElement;
71
- /** 右侧的总容器的标题头 */
72
- sectionContainerHeader: HTMLLIElement;
73
- /** 右侧的内容容器 */
74
- sectionBodyContainer: HTMLUListElement;
75
- }
76
- ) => void;
77
- /**
78
- * 菜单配置
79
- */
80
- forms?: (PopsPanelFormsDetails | PopsPanelFormsTotalDetails)[];
81
- /**
82
- * (可选)头部的标题文字,没有的话默认是text
83
- */
84
- headerTitle?: string;
85
- }
@@ -1,45 +0,0 @@
1
- import type { PopsPanelCommonDetails } from "./components-common";
2
- import type { PopsPanelFormsTotalDetails } from ".";
3
-
4
- /**
5
- * pops.panel的 forms
6
- */
7
- export interface PopsPanelFormsDetails
8
- extends PopsPanelCommonDetails<PopsPanelFormsDetails> {
9
- /**
10
- * (可选)className属性
11
- */
12
- className?: string;
13
- /**
14
- * (可选)自定义元素属性
15
- */
16
- attributes?:
17
- | {
18
- [key: string]: any;
19
- }
20
- | {
21
- [key: string]: any;
22
- }[];
23
- /**
24
- * (可选)自定义属性
25
- */
26
- props?: {
27
- [K in keyof HTMLElement]?: HTMLElement[K];
28
- };
29
- /**
30
- * 显示在左边的文字
31
- */
32
- text: string;
33
- /**
34
- * 是否进行折叠
35
- */
36
- isFold?: boolean;
37
- /**
38
- * 类型
39
- */
40
- type: "forms";
41
- /**
42
- * 子配置
43
- */
44
- forms: PopsPanelFormsTotalDetails[];
45
- }
@@ -1,82 +0,0 @@
1
- import type { PopsPanelCommonDetails } from "./components-common";
2
-
3
- /**
4
- * pops.panel的 input
5
- */
6
- export interface PopsPanelInputDetails
7
- extends PopsPanelCommonDetails<PopsPanelInputDetails> {
8
- /**
9
- * (可选)className属性
10
- * @default ""
11
- */
12
- className?: string;
13
- /**
14
- * (可选)自定义元素属性
15
- * @default {}
16
- */
17
- attributes?:
18
- | {
19
- [key: string]: any;
20
- }
21
- | {
22
- [key: string]: any;
23
- }[];
24
- /**
25
- * (可选)自定义属性
26
- * @default {}
27
- */
28
- props?: {
29
- [K in keyof HTMLElement]?: HTMLElement[K];
30
- };
31
- /**
32
- * 显示在左边的文字
33
- */
34
- text: string;
35
- /**
36
- * (可选)左边的文字下面的描述
37
- * @default ""
38
- */
39
- description?: string;
40
- /**
41
- * 类型
42
- */
43
- type: "input";
44
- /**
45
- * (可选)是否禁用
46
- * @default false
47
- */
48
- disabled?: boolean | (() => boolean);
49
- /**
50
- * 获取该项的值的回调函数
51
- */
52
- getValue(): string;
53
- /**
54
- * 输入框的值改变触发的回调函数
55
- * @param event 输入事件
56
- * @param value 输入框的值
57
- * @param valueAsNumber 当isNumber为true时,有该值,它可能是NaN
58
- */
59
- callback(event: InputEvent, value: string, valueAsNumber?: number): void;
60
- /**
61
- * (可选)输入框内的提示
62
- * @default ""
63
- */
64
- placeholder?: string;
65
- /**
66
- * (可选)是否是密码框
67
- * @default false
68
- */
69
- isPassword?: boolean;
70
- /**
71
- * (可选)是否是数字框
72
- * @default false
73
- */
74
- isNumber?: boolean;
75
- /**
76
- * (可选)自己调用的处理回调函数
77
- */
78
- handlerCallBack?(
79
- liElement: HTMLLIElement,
80
- inputElement: HTMLInputElement
81
- ): void;
82
- }
@@ -1,31 +0,0 @@
1
- import type { PopsPanelCommonDetails } from "./components-common";
2
-
3
- /**
4
- * pops.panel的 own
5
- * 自定义的
6
- */
7
- export interface PopsPanelOwnDetails
8
- extends PopsPanelCommonDetails<PopsPanelOwnDetails> {
9
- /**
10
- * (可选)className属性
11
- */
12
- className?: string;
13
- /**
14
- * (可选)自定义元素属性
15
- */
16
- attributes?: any;
17
- /**
18
- * (可选)自定义属性
19
- */
20
- props?: {
21
- [K in keyof HTMLElement]?: HTMLElement[K];
22
- };
23
- /**
24
- * 类型
25
- */
26
- type: "own";
27
- /**
28
- * 获取自定义<li>标签元素
29
- */
30
- getLiElementCallBack: (liElement: HTMLLIElement) => HTMLLIElement;
31
- }
@@ -1,101 +0,0 @@
1
- import type { PopsPanelCommonDetails } from "./components-common";
2
- import type { PopsPanelFormsDetails } from "./components-forms";
3
- import type { PopsPanelFormsTotalDetails } from ".";
4
-
5
- /**
6
- * pops.panel的 select
7
- */
8
- export interface PopsPanelSelectDetails<T = any>
9
- extends PopsPanelCommonDetails<PopsPanelSelectDetails> {
10
- /**
11
- * (可选)className属性
12
- * @default ""
13
- */
14
- className?: string;
15
- /**
16
- * (可选)自定义元素属性
17
- * @default {}
18
- */
19
- attributes?:
20
- | {
21
- [key: string]: any;
22
- }
23
- | {
24
- [key: string]: any;
25
- }[];
26
- /**
27
- * (可选)自定义属性
28
- * @default {}
29
- */
30
- props?: {
31
- [K in keyof HTMLElement]?: HTMLElement[K];
32
- };
33
- /**
34
- * 显示在左边的文字
35
- */
36
- text: string;
37
- /**
38
- * (可选)左边的文字下面的描述
39
- * @default ""
40
- */
41
- description?: string;
42
- /**
43
- * 类型
44
- */
45
- type: "select";
46
- /**
47
- * (可选)是否禁用
48
- * @default false
49
- */
50
- disabled?: boolean | (() => boolean);
51
- /**
52
- * 获取该项的值的回调函数
53
- */
54
- getValue(): T;
55
- /**
56
- * 选择器的值改变触发的回调函数
57
- * @param event 事件
58
- * @param isSelectedValue 当前选中的值,也就是元素属性上的__value__
59
- * @param isSelectedText 当前选中的文本
60
- */
61
- callback?(
62
- event: PointerEvent | TouchEvent,
63
- isSelectedValue: T,
64
- isSelectedText: string
65
- ): void;
66
- /**
67
- * 点击select元素触发该回调
68
- * @param event 点击事件
69
- * @param selectElement 当前的select元素
70
- */
71
- clickCallBack?(
72
- event: PointerEvent | MouseEvent,
73
- selectElement: HTMLSelectElement
74
- ): void;
75
- /**
76
- * 选择器内的数据组
77
- */
78
- data: {
79
- /**
80
- * 真正的值
81
- */
82
- value: T;
83
- /**
84
- * 显示的文字
85
- */
86
- text: string;
87
- /**
88
- * (可选)是否禁用项
89
- * 触发条件:
90
- * + 点击select元素
91
- * + select元素触发change事件
92
- */
93
- disable?(value: T): boolean;
94
- /**
95
- * 子配置,跟随切换改变
96
- */
97
- forms?:
98
- | (PopsPanelFormsDetails | PopsPanelFormsTotalDetails)[]
99
- | (() => (PopsPanelFormsDetails | PopsPanelFormsTotalDetails)[]);
100
- }[];
101
- }