@whitesev/pops 3.2.1 → 3.3.0
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 +249 -249
- package/dist/index.amd.js +736 -948
- package/dist/index.amd.js.map +1 -1
- package/dist/index.amd.min.js +1 -1
- package/dist/index.amd.min.js.map +1 -1
- package/dist/index.cjs.js +736 -948
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.esm.js +736 -948
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.iife.js +736 -948
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/index.iife.min.js.map +1 -1
- package/dist/index.system.js +736 -948
- package/dist/index.system.js.map +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/dist/index.umd.js +736 -948
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/types/src/PopsCore.d.ts +15 -7
- package/dist/types/src/components/folder/types/index.d.ts +43 -13
- package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +313 -313
- package/dist/types/src/types/animation.d.ts +19 -19
- package/dist/types/src/types/button.d.ts +94 -94
- package/dist/types/src/types/components.d.ts +211 -211
- package/dist/types/src/types/event.d.ts +43 -43
- package/dist/types/src/types/global.d.ts +31 -31
- package/dist/types/src/types/icon.d.ts +32 -32
- package/dist/types/src/types/inst.d.ts +28 -28
- package/dist/types/src/types/main.d.ts +66 -66
- package/dist/types/src/types/mask.d.ts +52 -52
- package/dist/types/src/types/position.d.ts +60 -60
- package/package.json +28 -27
- package/src/Pops.ts +206 -206
- package/src/PopsAnimation.ts +32 -32
- package/src/PopsCSS.ts +54 -54
- package/src/PopsCore.ts +53 -37
- package/src/PopsIcon.ts +95 -95
- package/src/PopsInst.ts +21 -21
- package/src/components/alert/defaultConfig.ts +62 -62
- package/src/components/alert/index.ts +163 -163
- package/src/components/alert/types/index.ts +23 -23
- package/src/components/confirm/defaultConfig.ts +90 -90
- package/src/components/confirm/index.ts +165 -165
- package/src/components/confirm/types/index.ts +13 -17
- package/src/components/drawer/defaultConfig.ts +89 -89
- package/src/components/drawer/index.css +37 -37
- package/src/components/drawer/index.ts +245 -245
- package/src/components/drawer/types/index.ts +62 -61
- package/src/components/folder/defaultConfig.ts +151 -151
- package/src/components/folder/folderIcon.ts +28 -28
- package/src/components/folder/index.css +303 -303
- package/src/components/folder/index.ts +953 -932
- package/src/components/folder/types/index.ts +143 -110
- package/src/components/iframe/defaultConfig.ts +60 -60
- package/src/components/iframe/index.css +76 -76
- package/src/components/iframe/index.ts +331 -331
- package/src/components/iframe/types/index.ts +96 -96
- package/src/components/loading/defaultConfig.ts +29 -29
- package/src/components/loading/index.css +66 -66
- package/src/components/loading/index.ts +101 -101
- package/src/components/loading/types/index.ts +36 -34
- package/src/components/panel/css/components-select.css +84 -84
- package/src/components/panel/defaultConfig.ts +868 -868
- package/src/components/panel/handlerComponents.ts +3993 -3993
- package/src/components/panel/index.css +1403 -1403
- package/src/components/panel/index.ts +221 -221
- package/src/components/panel/types/components-button.ts +56 -56
- package/src/components/panel/types/components-common.ts +73 -73
- package/src/components/panel/types/components-container.ts +25 -25
- package/src/components/panel/types/components-deepMenu.ts +64 -64
- package/src/components/panel/types/components-input.ts +90 -90
- package/src/components/panel/types/components-own.ts +16 -16
- package/src/components/panel/types/components-select.ts +169 -169
- package/src/components/panel/types/components-selectMultiple.ts +105 -104
- package/src/components/panel/types/components-slider.ts +55 -55
- package/src/components/panel/types/components-switch.ts +33 -33
- package/src/components/panel/types/components-textarea.ts +45 -45
- package/src/components/panel/types/index.ts +244 -244
- package/src/components/prompt/defaultConfig.ts +94 -94
- package/src/components/prompt/index.css +34 -34
- package/src/components/prompt/index.ts +187 -215
- package/src/components/prompt/types/index.ts +57 -56
- package/src/components/rightClickMenu/defaultConfig.ts +103 -103
- package/src/components/rightClickMenu/index.css +115 -115
- package/src/components/rightClickMenu/index.ts +662 -662
- package/src/components/rightClickMenu/types/index.ts +145 -143
- package/src/components/searchSuggestion/defaultConfig.ts +63 -63
- package/src/components/searchSuggestion/index.ts +813 -813
- package/src/components/searchSuggestion/types/index.ts +244 -242
- package/src/components/tooltip/defaultConfig.ts +33 -33
- package/src/components/tooltip/index.css +199 -199
- package/src/components/tooltip/index.ts +617 -617
- package/src/components/tooltip/types/index.ts +123 -121
- package/src/config/CommonCSSClassName.ts +17 -17
- package/src/config/GlobalConfig.ts +63 -63
- package/src/css/animation.css +987 -987
- package/src/css/button.css +551 -551
- package/src/css/common.css +54 -54
- package/src/css/index.css +253 -253
- package/src/css/ninePalaceGridPosition.css +50 -50
- package/src/css/scrollbar.css +22 -22
- package/src/handler/PopsElementHandler.ts +303 -303
- package/src/handler/PopsHandler.ts +611 -611
- package/src/types/PopsDOMUtilsEventType.d.ts +313 -313
- package/src/types/animation.d.ts +19 -19
- package/src/types/button.d.ts +94 -94
- package/src/types/components.d.ts +211 -211
- package/src/types/event.d.ts +43 -43
- package/src/types/global.d.ts +31 -31
- package/src/types/icon.d.ts +32 -32
- package/src/types/inst.d.ts +28 -28
- package/src/types/main.d.ts +66 -66
- package/src/types/mask.d.ts +52 -52
- package/src/types/position.d.ts +60 -60
- package/src/utils/PopsDOMUtils.ts +2483 -2483
- package/src/utils/PopsDOMUtilsEventsConfig.ts +4 -4
- package/src/utils/PopsInstanceUtils.ts +714 -714
- package/src/utils/PopsMathUtils.ts +71 -71
- package/src/utils/PopsSafeUtils.ts +22 -22
- package/src/utils/PopsUtils.ts +391 -421
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
import type { PopsPanelContainerConfig } from "./components-container";
|
|
2
|
-
import type { PopsPanelViewConfig } from ".";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* 右侧容器的配置
|
|
6
|
-
*/
|
|
7
|
-
export interface PopsPanelRightAsideContainerConfig {
|
|
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 PopsPanelGeneralConfig<T extends PopsPanelViewConfig | PopsPanelContainerConfig> {
|
|
23
|
-
/**
|
|
24
|
-
* (可选)元素的className,值为空的话就不设置
|
|
25
|
-
* @default ""
|
|
26
|
-
*/
|
|
27
|
-
className?: string | string[] | (() => string | string[]);
|
|
28
|
-
/**
|
|
29
|
-
* (可选)自定义元素属性
|
|
30
|
-
* @default {}
|
|
31
|
-
*/
|
|
32
|
-
attributes?: {
|
|
33
|
-
[key: string]: any;
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* (可选)自定义属性
|
|
37
|
-
* @default {}
|
|
38
|
-
*/
|
|
39
|
-
props?:
|
|
40
|
-
| {
|
|
41
|
-
[K in keyof HTMLElement]?: HTMLElement[K];
|
|
42
|
-
}
|
|
43
|
-
| {
|
|
44
|
-
[key: string]: any;
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* 在添加到<ul>元素后触发该回调
|
|
48
|
-
* @param viewConfig 配置
|
|
49
|
-
* @param container 右侧容器的元素
|
|
50
|
-
* @example
|
|
51
|
-
* // 例如在type为own时
|
|
52
|
-
* afterAddToUListCallBack(viewConfig, container) {
|
|
53
|
-
* DOMUtils.on(
|
|
54
|
-
container.formHeaderDivElement.querySelector(
|
|
55
|
-
"a"
|
|
56
|
-
),
|
|
57
|
-
"click",
|
|
58
|
-
void 0,
|
|
59
|
-
() => {
|
|
60
|
-
PopsPanel.deleteValue("xxxx");
|
|
61
|
-
container.ulElement.querySelector(
|
|
62
|
-
"textarea"
|
|
63
|
-
).value = xxxxx.defaultValue;
|
|
64
|
-
Qmsg.success("已重置");
|
|
65
|
-
}
|
|
66
|
-
);
|
|
67
|
-
* }
|
|
68
|
-
*
|
|
69
|
-
* // 例如在type为forms时
|
|
70
|
-
* container内只有container.ulElement这个属性
|
|
71
|
-
*/
|
|
72
|
-
afterAddToUListCallBack?: (viewConfig: T, container: PopsPanelRightAsideContainerConfig) => void;
|
|
73
|
-
}
|
|
1
|
+
import type { PopsPanelContainerConfig } from "./components-container";
|
|
2
|
+
import type { PopsPanelViewConfig } from ".";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 右侧容器的配置
|
|
6
|
+
*/
|
|
7
|
+
export interface PopsPanelRightAsideContainerConfig {
|
|
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 PopsPanelGeneralConfig<T extends PopsPanelViewConfig | PopsPanelContainerConfig> {
|
|
23
|
+
/**
|
|
24
|
+
* (可选)元素的className,值为空的话就不设置
|
|
25
|
+
* @default ""
|
|
26
|
+
*/
|
|
27
|
+
className?: string | string[] | (() => string | string[]);
|
|
28
|
+
/**
|
|
29
|
+
* (可选)自定义元素属性
|
|
30
|
+
* @default {}
|
|
31
|
+
*/
|
|
32
|
+
attributes?: {
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* (可选)自定义属性
|
|
37
|
+
* @default {}
|
|
38
|
+
*/
|
|
39
|
+
props?:
|
|
40
|
+
| {
|
|
41
|
+
[K in keyof HTMLElement]?: HTMLElement[K];
|
|
42
|
+
}
|
|
43
|
+
| {
|
|
44
|
+
[key: string]: any;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* 在添加到<ul>元素后触发该回调
|
|
48
|
+
* @param viewConfig 配置
|
|
49
|
+
* @param container 右侧容器的元素
|
|
50
|
+
* @example
|
|
51
|
+
* // 例如在type为own时
|
|
52
|
+
* afterAddToUListCallBack(viewConfig, container) {
|
|
53
|
+
* DOMUtils.on(
|
|
54
|
+
container.formHeaderDivElement.querySelector(
|
|
55
|
+
"a"
|
|
56
|
+
),
|
|
57
|
+
"click",
|
|
58
|
+
void 0,
|
|
59
|
+
() => {
|
|
60
|
+
PopsPanel.deleteValue("xxxx");
|
|
61
|
+
container.ulElement.querySelector(
|
|
62
|
+
"textarea"
|
|
63
|
+
).value = xxxxx.defaultValue;
|
|
64
|
+
Qmsg.success("已重置");
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
* }
|
|
68
|
+
*
|
|
69
|
+
* // 例如在type为forms时
|
|
70
|
+
* container内只有container.ulElement这个属性
|
|
71
|
+
*/
|
|
72
|
+
afterAddToUListCallBack?: (viewConfig: T, container: PopsPanelRightAsideContainerConfig) => void;
|
|
73
|
+
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
2
|
-
import type { PopsPanelViewConfig } from ".";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* pops.panel的 container
|
|
6
|
-
*/
|
|
7
|
-
export interface PopsPanelContainerConfig extends PopsPanelGeneralConfig<PopsPanelContainerConfig> {
|
|
8
|
-
/**
|
|
9
|
-
* 组件类型
|
|
10
|
-
*/
|
|
11
|
-
type: "container";
|
|
12
|
-
/**
|
|
13
|
-
* 显示在左边的文字
|
|
14
|
-
*/
|
|
15
|
-
text: string;
|
|
16
|
-
/**
|
|
17
|
-
* 是否进行折叠
|
|
18
|
-
* @default false
|
|
19
|
-
*/
|
|
20
|
-
isFold?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* 子配置
|
|
23
|
-
*/
|
|
24
|
-
views: PopsPanelViewConfig[];
|
|
25
|
-
}
|
|
1
|
+
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
2
|
+
import type { PopsPanelViewConfig } from ".";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* pops.panel的 container
|
|
6
|
+
*/
|
|
7
|
+
export interface PopsPanelContainerConfig extends PopsPanelGeneralConfig<PopsPanelContainerConfig> {
|
|
8
|
+
/**
|
|
9
|
+
* 组件类型
|
|
10
|
+
*/
|
|
11
|
+
type: "container";
|
|
12
|
+
/**
|
|
13
|
+
* 显示在左边的文字
|
|
14
|
+
*/
|
|
15
|
+
text: string;
|
|
16
|
+
/**
|
|
17
|
+
* 是否进行折叠
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
isFold?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* 子配置
|
|
23
|
+
*/
|
|
24
|
+
views: PopsPanelViewConfig[];
|
|
25
|
+
}
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import type { PopsPanelViewConfig } from ".";
|
|
2
|
-
import type { PopsPanelContainerConfig } from "./components-container";
|
|
3
|
-
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
4
|
-
/**
|
|
5
|
-
* pops.panel的 深层视图的配置
|
|
6
|
-
*/
|
|
7
|
-
export interface PopsPanelDeepViewConfig extends PopsPanelGeneralConfig<PopsPanelDeepViewConfig> {
|
|
8
|
-
/**
|
|
9
|
-
* 组件类型
|
|
10
|
-
*/
|
|
11
|
-
type: "deepMenu";
|
|
12
|
-
/**
|
|
13
|
-
* 显示在左边的文字
|
|
14
|
-
*/
|
|
15
|
-
text: string;
|
|
16
|
-
/**
|
|
17
|
-
* (可选)左边的文字下面的描述
|
|
18
|
-
*/
|
|
19
|
-
description?: string;
|
|
20
|
-
/**
|
|
21
|
-
* (可选)右侧的文字
|
|
22
|
-
*/
|
|
23
|
-
rightText?: string;
|
|
24
|
-
/**
|
|
25
|
-
* (可选)右侧的箭头图标,默认启用
|
|
26
|
-
*/
|
|
27
|
-
arrowRightIcon?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* 点击整行触发的事件,可为异步函数
|
|
30
|
-
* @param event click事件
|
|
31
|
-
* @returns
|
|
32
|
-
* + true 表示阻止进入深层菜单
|
|
33
|
-
* + false (默认)表示允许进入深层菜单
|
|
34
|
-
*/
|
|
35
|
-
clickCallBack?: (
|
|
36
|
-
event: MouseEvent | PointerEvent,
|
|
37
|
-
viewConfig: PopsPanelDeepViewConfig
|
|
38
|
-
) => boolean | void | Promise<boolean | void>;
|
|
39
|
-
/**
|
|
40
|
-
* 进入深层菜单后触发的回调
|
|
41
|
-
* @param viewConfig
|
|
42
|
-
*/
|
|
43
|
-
afterEnterDeepMenuCallBack?: (
|
|
44
|
-
viewConfig: PopsPanelDeepViewConfig,
|
|
45
|
-
container: {
|
|
46
|
-
/** 右侧的总容器 */
|
|
47
|
-
$sectionContainer: HTMLElement;
|
|
48
|
-
/** 右侧的总容器的标题头容器 */
|
|
49
|
-
$sectionContainerHeaderContainer: HTMLUListElement;
|
|
50
|
-
/** 右侧的总容器的标题头 */
|
|
51
|
-
$sectionContainerHeader: HTMLLIElement;
|
|
52
|
-
/** 右侧的内容容器 */
|
|
53
|
-
$sectionBodyContainer: HTMLUListElement;
|
|
54
|
-
}
|
|
55
|
-
) => void;
|
|
56
|
-
/**
|
|
57
|
-
* 菜单配置
|
|
58
|
-
*/
|
|
59
|
-
views?: (PopsPanelContainerConfig | PopsPanelViewConfig)[];
|
|
60
|
-
/**
|
|
61
|
-
* (可选)头部的标题文字,没有的话默认是text
|
|
62
|
-
*/
|
|
63
|
-
headerTitle?: string;
|
|
64
|
-
}
|
|
1
|
+
import type { PopsPanelViewConfig } from ".";
|
|
2
|
+
import type { PopsPanelContainerConfig } from "./components-container";
|
|
3
|
+
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
4
|
+
/**
|
|
5
|
+
* pops.panel的 深层视图的配置
|
|
6
|
+
*/
|
|
7
|
+
export interface PopsPanelDeepViewConfig extends PopsPanelGeneralConfig<PopsPanelDeepViewConfig> {
|
|
8
|
+
/**
|
|
9
|
+
* 组件类型
|
|
10
|
+
*/
|
|
11
|
+
type: "deepMenu";
|
|
12
|
+
/**
|
|
13
|
+
* 显示在左边的文字
|
|
14
|
+
*/
|
|
15
|
+
text: string;
|
|
16
|
+
/**
|
|
17
|
+
* (可选)左边的文字下面的描述
|
|
18
|
+
*/
|
|
19
|
+
description?: string;
|
|
20
|
+
/**
|
|
21
|
+
* (可选)右侧的文字
|
|
22
|
+
*/
|
|
23
|
+
rightText?: string;
|
|
24
|
+
/**
|
|
25
|
+
* (可选)右侧的箭头图标,默认启用
|
|
26
|
+
*/
|
|
27
|
+
arrowRightIcon?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* 点击整行触发的事件,可为异步函数
|
|
30
|
+
* @param event click事件
|
|
31
|
+
* @returns
|
|
32
|
+
* + true 表示阻止进入深层菜单
|
|
33
|
+
* + false (默认)表示允许进入深层菜单
|
|
34
|
+
*/
|
|
35
|
+
clickCallBack?: (
|
|
36
|
+
event: MouseEvent | PointerEvent,
|
|
37
|
+
viewConfig: PopsPanelDeepViewConfig
|
|
38
|
+
) => boolean | void | Promise<boolean | void>;
|
|
39
|
+
/**
|
|
40
|
+
* 进入深层菜单后触发的回调
|
|
41
|
+
* @param viewConfig
|
|
42
|
+
*/
|
|
43
|
+
afterEnterDeepMenuCallBack?: (
|
|
44
|
+
viewConfig: PopsPanelDeepViewConfig,
|
|
45
|
+
container: {
|
|
46
|
+
/** 右侧的总容器 */
|
|
47
|
+
$sectionContainer: HTMLElement;
|
|
48
|
+
/** 右侧的总容器的标题头容器 */
|
|
49
|
+
$sectionContainerHeaderContainer: HTMLUListElement;
|
|
50
|
+
/** 右侧的总容器的标题头 */
|
|
51
|
+
$sectionContainerHeader: HTMLLIElement;
|
|
52
|
+
/** 右侧的内容容器 */
|
|
53
|
+
$sectionBodyContainer: HTMLUListElement;
|
|
54
|
+
}
|
|
55
|
+
) => void;
|
|
56
|
+
/**
|
|
57
|
+
* 菜单配置
|
|
58
|
+
*/
|
|
59
|
+
views?: (PopsPanelContainerConfig | PopsPanelViewConfig)[];
|
|
60
|
+
/**
|
|
61
|
+
* (可选)头部的标题文字,没有的话默认是text
|
|
62
|
+
*/
|
|
63
|
+
headerTitle?: string;
|
|
64
|
+
}
|
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* pops.panel的input的字符串type类型
|
|
5
|
-
*/
|
|
6
|
-
export type PopsPanelInputStringType = "text" | "color" | "search" | "email" | "tel" | "url";
|
|
7
|
-
/**
|
|
8
|
-
* pops.panel的input的日期type类型
|
|
9
|
-
*/
|
|
10
|
-
export type PopsPanelInputDateType = "date" | "datetime-local" | "time" | "month" | "week";
|
|
11
|
-
/**
|
|
12
|
-
* pops.panel的input的数字ype类型
|
|
13
|
-
*/
|
|
14
|
-
export type PopsPanelInputNumberType = "number";
|
|
15
|
-
/**
|
|
16
|
-
* pops.panel的input的密码type类型
|
|
17
|
-
*/
|
|
18
|
-
export type PopsPanelInputPasswordType = "password";
|
|
19
|
-
/**
|
|
20
|
-
* pops.panel的input的文件type类型
|
|
21
|
-
*/
|
|
22
|
-
export type PopsPanelInputFileType = "file";
|
|
23
|
-
/**
|
|
24
|
-
* pops.panel的input的type类型
|
|
25
|
-
*/
|
|
26
|
-
export type PopsPanelInputType =
|
|
27
|
-
| PopsPanelInputStringType
|
|
28
|
-
| PopsPanelInputDateType
|
|
29
|
-
| PopsPanelInputNumberType
|
|
30
|
-
| PopsPanelInputPasswordType
|
|
31
|
-
| PopsPanelInputFileType;
|
|
32
|
-
/**
|
|
33
|
-
* pops.panel的 input
|
|
34
|
-
*/
|
|
35
|
-
export interface PopsPanelInputConfig extends PopsPanelGeneralConfig<PopsPanelInputConfig> {
|
|
36
|
-
/**
|
|
37
|
-
* 组件类型
|
|
38
|
-
*/
|
|
39
|
-
type: "input";
|
|
40
|
-
/**
|
|
41
|
-
* (可选)输入框类型
|
|
42
|
-
* @default "text"
|
|
43
|
-
*/
|
|
44
|
-
inputType?: PopsPanelInputType;
|
|
45
|
-
/**
|
|
46
|
-
* 显示在左边的文字
|
|
47
|
-
*/
|
|
48
|
-
text: string;
|
|
49
|
-
/**
|
|
50
|
-
* (可选)左边的文字下面的描述
|
|
51
|
-
* @default ""
|
|
52
|
-
*/
|
|
53
|
-
description?: string;
|
|
54
|
-
/**
|
|
55
|
-
* (可选)是否禁用
|
|
56
|
-
* @default false
|
|
57
|
-
*/
|
|
58
|
-
disabled?: boolean | (() => boolean);
|
|
59
|
-
/**
|
|
60
|
-
* 获取该项的值的回调函数
|
|
61
|
-
*
|
|
62
|
-
* 组件初始化后会调用一次,用于初始话默认值
|
|
63
|
-
*/
|
|
64
|
-
getValue(): string | number | Date;
|
|
65
|
-
/**
|
|
66
|
-
* 输入框的值改变触发的回调函数
|
|
67
|
-
* @param event 输入事件
|
|
68
|
-
* @param value 输入框的值
|
|
69
|
-
* @param valueAsNumber 如果inputType为number或日期类型,存在该值,类型为number(可能为isNaN),否则为undefined
|
|
70
|
-
* @param valueAsDate 如果inputType为日期类型,存在该值,类型为Date(可能为null),否则为undefined
|
|
71
|
-
*/
|
|
72
|
-
callback(
|
|
73
|
-
event: InputEvent,
|
|
74
|
-
value: string,
|
|
75
|
-
valueAsNumber?: number,
|
|
76
|
-
valueAsDate?: Date | null
|
|
77
|
-
): void | {
|
|
78
|
-
valid: boolean;
|
|
79
|
-
message?: string;
|
|
80
|
-
};
|
|
81
|
-
/**
|
|
82
|
-
* (可选)输入框内的提示
|
|
83
|
-
* @default ""
|
|
84
|
-
*/
|
|
85
|
-
placeholder?: string;
|
|
86
|
-
/**
|
|
87
|
-
* (可选)初始化后调用的回调函数
|
|
88
|
-
*/
|
|
89
|
-
handlerCallBack?($li: HTMLLIElement, $input: HTMLInputElement): void;
|
|
90
|
-
}
|
|
1
|
+
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* pops.panel的input的字符串type类型
|
|
5
|
+
*/
|
|
6
|
+
export type PopsPanelInputStringType = "text" | "color" | "search" | "email" | "tel" | "url";
|
|
7
|
+
/**
|
|
8
|
+
* pops.panel的input的日期type类型
|
|
9
|
+
*/
|
|
10
|
+
export type PopsPanelInputDateType = "date" | "datetime-local" | "time" | "month" | "week";
|
|
11
|
+
/**
|
|
12
|
+
* pops.panel的input的数字ype类型
|
|
13
|
+
*/
|
|
14
|
+
export type PopsPanelInputNumberType = "number";
|
|
15
|
+
/**
|
|
16
|
+
* pops.panel的input的密码type类型
|
|
17
|
+
*/
|
|
18
|
+
export type PopsPanelInputPasswordType = "password";
|
|
19
|
+
/**
|
|
20
|
+
* pops.panel的input的文件type类型
|
|
21
|
+
*/
|
|
22
|
+
export type PopsPanelInputFileType = "file";
|
|
23
|
+
/**
|
|
24
|
+
* pops.panel的input的type类型
|
|
25
|
+
*/
|
|
26
|
+
export type PopsPanelInputType =
|
|
27
|
+
| PopsPanelInputStringType
|
|
28
|
+
| PopsPanelInputDateType
|
|
29
|
+
| PopsPanelInputNumberType
|
|
30
|
+
| PopsPanelInputPasswordType
|
|
31
|
+
| PopsPanelInputFileType;
|
|
32
|
+
/**
|
|
33
|
+
* pops.panel的 input
|
|
34
|
+
*/
|
|
35
|
+
export interface PopsPanelInputConfig extends PopsPanelGeneralConfig<PopsPanelInputConfig> {
|
|
36
|
+
/**
|
|
37
|
+
* 组件类型
|
|
38
|
+
*/
|
|
39
|
+
type: "input";
|
|
40
|
+
/**
|
|
41
|
+
* (可选)输入框类型
|
|
42
|
+
* @default "text"
|
|
43
|
+
*/
|
|
44
|
+
inputType?: PopsPanelInputType;
|
|
45
|
+
/**
|
|
46
|
+
* 显示在左边的文字
|
|
47
|
+
*/
|
|
48
|
+
text: string;
|
|
49
|
+
/**
|
|
50
|
+
* (可选)左边的文字下面的描述
|
|
51
|
+
* @default ""
|
|
52
|
+
*/
|
|
53
|
+
description?: string;
|
|
54
|
+
/**
|
|
55
|
+
* (可选)是否禁用
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
disabled?: boolean | (() => boolean);
|
|
59
|
+
/**
|
|
60
|
+
* 获取该项的值的回调函数
|
|
61
|
+
*
|
|
62
|
+
* 组件初始化后会调用一次,用于初始话默认值
|
|
63
|
+
*/
|
|
64
|
+
getValue(): string | number | Date;
|
|
65
|
+
/**
|
|
66
|
+
* 输入框的值改变触发的回调函数
|
|
67
|
+
* @param event 输入事件
|
|
68
|
+
* @param value 输入框的值
|
|
69
|
+
* @param valueAsNumber 如果inputType为number或日期类型,存在该值,类型为number(可能为isNaN),否则为undefined
|
|
70
|
+
* @param valueAsDate 如果inputType为日期类型,存在该值,类型为Date(可能为null),否则为undefined
|
|
71
|
+
*/
|
|
72
|
+
callback(
|
|
73
|
+
event: InputEvent,
|
|
74
|
+
value: string,
|
|
75
|
+
valueAsNumber?: number,
|
|
76
|
+
valueAsDate?: Date | null
|
|
77
|
+
): void | {
|
|
78
|
+
valid: boolean;
|
|
79
|
+
message?: string;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* (可选)输入框内的提示
|
|
83
|
+
* @default ""
|
|
84
|
+
*/
|
|
85
|
+
placeholder?: string;
|
|
86
|
+
/**
|
|
87
|
+
* (可选)初始化后调用的回调函数
|
|
88
|
+
*/
|
|
89
|
+
handlerCallBack?($li: HTMLLIElement, $input: HTMLInputElement): void;
|
|
90
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* pops.panel的 own
|
|
5
|
-
* 自定义的
|
|
6
|
-
*/
|
|
7
|
-
export interface PopsPanelOwnConfig extends PopsPanelGeneralConfig<PopsPanelOwnConfig> {
|
|
8
|
-
/**
|
|
9
|
-
* 组件类型
|
|
10
|
-
*/
|
|
11
|
-
type: "own";
|
|
12
|
-
/**
|
|
13
|
-
* 生成<li>标签元素
|
|
14
|
-
*/
|
|
15
|
-
createLIElement($li: HTMLLIElement): HTMLLIElement;
|
|
16
|
-
}
|
|
1
|
+
import type { PopsPanelGeneralConfig } from "./components-common";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* pops.panel的 own
|
|
5
|
+
* 自定义的
|
|
6
|
+
*/
|
|
7
|
+
export interface PopsPanelOwnConfig extends PopsPanelGeneralConfig<PopsPanelOwnConfig> {
|
|
8
|
+
/**
|
|
9
|
+
* 组件类型
|
|
10
|
+
*/
|
|
11
|
+
type: "own";
|
|
12
|
+
/**
|
|
13
|
+
* 生成<li>标签元素
|
|
14
|
+
*/
|
|
15
|
+
createLIElement($li: HTMLLIElement): HTMLLIElement;
|
|
16
|
+
}
|