@whitesev/pops 1.0.0 → 1.1.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 +243 -0
- package/dist/index.amd.js +5656 -171
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +5656 -171
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +5656 -171
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +5656 -171
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +5656 -171
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +5656 -171
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/Pops.d.ts +148 -60
- package/dist/types/src/components/alert/index.d.ts +1 -1
- package/dist/types/src/components/alert/indexType.d.ts +16 -0
- package/dist/types/src/components/confirm/index.d.ts +1 -1
- package/dist/types/src/components/confirm/indexType.d.ts +6 -0
- package/dist/types/src/components/drawer/index.d.ts +2 -0
- package/dist/types/src/components/drawer/indexType.d.ts +43 -0
- package/dist/types/src/components/folder/folderIcon.d.ts +27 -0
- package/dist/types/src/components/folder/index.d.ts +2 -0
- package/dist/types/src/components/folder/indexType.d.ts +68 -0
- package/dist/types/src/components/iframe/index.d.ts +2 -0
- package/dist/types/src/components/iframe/indexType.d.ts +120 -0
- package/dist/types/src/components/loading/index.d.ts +2 -0
- package/dist/types/src/components/loading/indexType.d.ts +23 -0
- package/dist/types/src/components/panel/buttonType.d.ts +60 -0
- package/dist/types/src/components/panel/commonType.d.ts +46 -0
- package/dist/types/src/components/panel/deepMenuType.d.ts +56 -0
- package/dist/types/src/components/panel/formsType.d.ts +31 -0
- package/dist/types/src/components/panel/index.d.ts +2 -0
- package/dist/types/src/components/panel/indexType.d.ts +86 -0
- package/dist/types/src/components/panel/inputType.d.ts +61 -0
- package/dist/types/src/components/panel/ownType.d.ts +27 -0
- package/dist/types/src/components/panel/selectType.d.ts +71 -0
- package/dist/types/src/components/panel/sliderType.d.ts +58 -0
- package/dist/types/src/components/panel/switchType.d.ts +42 -0
- package/dist/types/src/components/panel/textareaType.d.ts +50 -0
- package/dist/types/src/components/prompt/index.d.ts +2 -0
- package/dist/types/src/components/prompt/indexType.d.ts +37 -0
- package/dist/types/src/components/rightClickMenu/index.d.ts +2 -0
- package/dist/types/src/components/rightClickMenu/indexType.d.ts +77 -0
- package/dist/types/src/components/searchSuggestion/index.d.ts +4 -0
- package/dist/types/src/components/searchSuggestion/indexType.d.ts +238 -0
- package/dist/types/src/components/tooltip/index.d.ts +2 -0
- package/dist/types/src/components/tooltip/indexType.d.ts +91 -0
- package/dist/types/src/handler/PopsHandler.d.ts +51 -39
- package/{src → dist/types/src}/types/PopsDOMUtilsEventType.d.ts +31 -33
- package/{src → dist/types/src}/types/animation.d.ts +1 -1
- package/{src → dist/types/src}/types/button.d.ts +21 -11
- package/{src → dist/types/src}/types/components.d.ts +9 -9
- package/{src → dist/types/src}/types/event.d.ts +6 -4
- package/{src → dist/types/src}/types/icon.d.ts +3 -1
- package/{src → dist/types/src}/types/layer.d.ts +2 -2
- package/{src → dist/types/src}/types/main.d.ts +22 -21
- package/{src → dist/types/src}/types/mask.d.ts +1 -1
- package/{src → dist/types/src}/types/position.d.ts +3 -3
- package/dist/types/src/utils/PopsDOMUtils.d.ts +334 -1
- package/dist/types/src/utils/{PopsUIUtils.d.ts → PopsInstanceUtils.d.ts} +13 -12
- package/dist/types/src/utils/PopsUtils.d.ts +2 -2
- package/package.json +2 -3
- package/dist/types/src/utils/PopsDOMUtilsEvent.d.ts +0 -332
- /package/{src → dist/types/src}/types/global.d.ts +0 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { PopsPanelCommonDetails } from "./commonType";
|
|
2
|
+
import type { PopsButtonStyleType } from "../../types/button";
|
|
3
|
+
import type { PopsIcon } from "../../types/icon";
|
|
4
|
+
/**
|
|
5
|
+
* pops.panel的 button
|
|
6
|
+
*/
|
|
7
|
+
export interface PopsPanelButtonDetails extends PopsPanelCommonDetails {
|
|
8
|
+
/**
|
|
9
|
+
* (可选)className属性
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* (可选)自定义元素属性
|
|
14
|
+
*/
|
|
15
|
+
attributes?: any;
|
|
16
|
+
/**
|
|
17
|
+
* (可选)自定义属性
|
|
18
|
+
*/
|
|
19
|
+
props?: HTMLElement;
|
|
20
|
+
/**
|
|
21
|
+
* 显示在左边的文字
|
|
22
|
+
*/
|
|
23
|
+
text: string;
|
|
24
|
+
/**
|
|
25
|
+
* (可选)左边的文字下面的描述
|
|
26
|
+
*/
|
|
27
|
+
description?: string;
|
|
28
|
+
/**
|
|
29
|
+
* 类型
|
|
30
|
+
*/
|
|
31
|
+
type: "button";
|
|
32
|
+
/**
|
|
33
|
+
* (可选)是否禁用
|
|
34
|
+
*/
|
|
35
|
+
disable?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* 按钮的类型
|
|
38
|
+
*/
|
|
39
|
+
buttonType: PopsButtonStyleType;
|
|
40
|
+
/**
|
|
41
|
+
* 按钮的文字
|
|
42
|
+
*/
|
|
43
|
+
buttonText: string | (() => string);
|
|
44
|
+
/**
|
|
45
|
+
* 按钮的图标,已配置的svg请看pops.config.iconSVG,或者自定义的图标svg代码
|
|
46
|
+
*/
|
|
47
|
+
buttonIcon?: PopsIcon;
|
|
48
|
+
/**
|
|
49
|
+
* 按钮的图标在右边
|
|
50
|
+
*/
|
|
51
|
+
buttonIsRightIcon?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* 按钮的图标旋转
|
|
54
|
+
*/
|
|
55
|
+
buttonIconIsLoading?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* 点击button触发的事件
|
|
58
|
+
*/
|
|
59
|
+
callback: (event: MouseEvent | PointerEvent) => void;
|
|
60
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { PopsPanelFormsTotalDetails } from "./indexType";
|
|
2
|
+
/**
|
|
3
|
+
* 右侧容器的配置
|
|
4
|
+
*/
|
|
5
|
+
export interface PopsPanelRightAsideContainerOptions {
|
|
6
|
+
/** 把获取的项<li>元素添加到这个<ul>元素内 */
|
|
7
|
+
ulElement: HTMLUListElement;
|
|
8
|
+
/** */
|
|
9
|
+
sectionContainerULElement?: HTMLUListElement;
|
|
10
|
+
/** */
|
|
11
|
+
formContainerListElement?: HTMLLIElement;
|
|
12
|
+
/** */
|
|
13
|
+
formHeaderDivElement?: HTMLElement | HTMLDivElement;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 通用配置
|
|
17
|
+
*/
|
|
18
|
+
export interface PopsPanelCommonDetails {
|
|
19
|
+
/**
|
|
20
|
+
* 在添加到<ul>元素后触发该回调
|
|
21
|
+
* @param formConfig 配置
|
|
22
|
+
* @param container 右侧容器的元素
|
|
23
|
+
* @example
|
|
24
|
+
* // 例如在type为own时
|
|
25
|
+
* afterAddToUListCallBack(formConfig, container) {
|
|
26
|
+
* DOMUtils.on(
|
|
27
|
+
container.formHeaderDivElement.querySelector(
|
|
28
|
+
"a"
|
|
29
|
+
),
|
|
30
|
+
"click",
|
|
31
|
+
void 0,
|
|
32
|
+
() => {
|
|
33
|
+
PopsPanel.deleteValue("xxxx");
|
|
34
|
+
container.ulElement.querySelector(
|
|
35
|
+
"textarea"
|
|
36
|
+
).value = xxxxx.defaultValue;
|
|
37
|
+
Qmsg.success("已重置");
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
* }
|
|
41
|
+
*
|
|
42
|
+
* // 例如在type为forms时
|
|
43
|
+
* container内只有container.ulElement这个属性
|
|
44
|
+
*/
|
|
45
|
+
afterAddToUListCallBack?: (formConfig: PopsPanelFormsTotalDetails, container: PopsPanelRightAsideContainerOptions) => void;
|
|
46
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { PopsPanelFormsTotalDetails } from "./indexType";
|
|
2
|
+
import type { PopsPanelFormsDetails } from "./formsType";
|
|
3
|
+
import type { PopsPanelCommonDetails } from "./commonType";
|
|
4
|
+
/**
|
|
5
|
+
* pops.panel的 深层菜单
|
|
6
|
+
*/
|
|
7
|
+
export interface PopsPanelDeepMenuDetails extends PopsPanelCommonDetails {
|
|
8
|
+
/**
|
|
9
|
+
* 类型
|
|
10
|
+
*/
|
|
11
|
+
type: "deepMenu";
|
|
12
|
+
/**
|
|
13
|
+
* (可选)className属性
|
|
14
|
+
*/
|
|
15
|
+
className?: string;
|
|
16
|
+
/**
|
|
17
|
+
* (可选)自定义元素属性
|
|
18
|
+
*/
|
|
19
|
+
attributes?: any;
|
|
20
|
+
/**
|
|
21
|
+
* (可选)自定义属性
|
|
22
|
+
*/
|
|
23
|
+
props?: HTMLElement;
|
|
24
|
+
/**
|
|
25
|
+
* 显示在左边的文字
|
|
26
|
+
*/
|
|
27
|
+
text: string;
|
|
28
|
+
/**
|
|
29
|
+
* (可选)左边的文字下面的描述
|
|
30
|
+
*/
|
|
31
|
+
description?: string;
|
|
32
|
+
/**
|
|
33
|
+
* (可选)右侧的文字
|
|
34
|
+
*/
|
|
35
|
+
rightText?: string;
|
|
36
|
+
/**
|
|
37
|
+
* (可选)右侧的箭头图标,默认启用
|
|
38
|
+
*/
|
|
39
|
+
arrowRightIcon?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* 点击整行触发的事件,可为异步函数
|
|
42
|
+
* @param event click事件
|
|
43
|
+
* @returns
|
|
44
|
+
* + true 表示阻止进入深层菜单
|
|
45
|
+
* + false (默认)表示允许进入深层菜单
|
|
46
|
+
*/
|
|
47
|
+
clickCallBack?: (event: MouseEvent | PointerEvent, formConfig: PopsPanelDeepMenuDetails) => boolean | void;
|
|
48
|
+
/**
|
|
49
|
+
* 菜单配置
|
|
50
|
+
*/
|
|
51
|
+
forms?: (PopsPanelFormsDetails | PopsPanelFormsTotalDetails)[];
|
|
52
|
+
/**
|
|
53
|
+
* (可选)头部的标题文字,没有的话默认是text
|
|
54
|
+
*/
|
|
55
|
+
headerTitle?: string;
|
|
56
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { PopsPanelCommonDetails } from "./commonType";
|
|
2
|
+
import type { PopsPanelFormsTotalDetails } from "./indexType";
|
|
3
|
+
/**
|
|
4
|
+
* pops.panel的 forms
|
|
5
|
+
*/
|
|
6
|
+
export interface PopsPanelFormsDetails extends PopsPanelCommonDetails {
|
|
7
|
+
/**
|
|
8
|
+
* (可选)className属性
|
|
9
|
+
*/
|
|
10
|
+
className?: string;
|
|
11
|
+
/**
|
|
12
|
+
* (可选)自定义元素属性
|
|
13
|
+
*/
|
|
14
|
+
attributes?: any;
|
|
15
|
+
/**
|
|
16
|
+
* (可选)自定义属性
|
|
17
|
+
*/
|
|
18
|
+
props?: HTMLElement;
|
|
19
|
+
/**
|
|
20
|
+
* 显示在左边的文字
|
|
21
|
+
*/
|
|
22
|
+
text: string;
|
|
23
|
+
/**
|
|
24
|
+
* 类型
|
|
25
|
+
*/
|
|
26
|
+
type: "forms";
|
|
27
|
+
/**
|
|
28
|
+
* 子配置
|
|
29
|
+
*/
|
|
30
|
+
forms: PopsPanelFormsTotalDetails[];
|
|
31
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { PopsTitleConfig, PopsDragConfig, PopsCommonConfig } from "../../types/components";
|
|
2
|
+
import type { PopsPanelFormsDetails } from "./formsType";
|
|
3
|
+
import type { PopsPanelSwitchDetails } from "./switchType";
|
|
4
|
+
import type { PopsPanelSliderDetails } from "./sliderType";
|
|
5
|
+
import type { PopsPanelInputDetails } from "./inputType";
|
|
6
|
+
import type { PopsPanelTextAreaDetails } from "./textareaType";
|
|
7
|
+
import type { PopsPanelSelectDetails } from "./selectType";
|
|
8
|
+
import type { PopsPanelButtonDetails } from "./buttonType";
|
|
9
|
+
import type { PopsPanelDeepMenuDetails } from "./deepMenuType";
|
|
10
|
+
import type { PopsPanelOwnDetails } from "./ownType";
|
|
11
|
+
import type { PopsHeaderCloseButtonDetails } from "../../types/button";
|
|
12
|
+
/** panel的各种类型的配置项 */
|
|
13
|
+
export type PopsPanelFormsTotalDetails = PopsPanelSwitchDetails | PopsPanelSliderDetails | PopsPanelInputDetails | PopsPanelTextAreaDetails | PopsPanelSelectDetails<any> | PopsPanelButtonDetails | PopsPanelDeepMenuDetails | PopsPanelOwnDetails;
|
|
14
|
+
/**
|
|
15
|
+
* pops.panel的content配置信息
|
|
16
|
+
*/
|
|
17
|
+
export interface PopsPanelContentConfig {
|
|
18
|
+
/**
|
|
19
|
+
* 元素属性id
|
|
20
|
+
*/
|
|
21
|
+
id: string;
|
|
22
|
+
/**
|
|
23
|
+
* 左侧的标题
|
|
24
|
+
*/
|
|
25
|
+
title: string;
|
|
26
|
+
/**
|
|
27
|
+
* (可选)中间顶部的标题
|
|
28
|
+
*/
|
|
29
|
+
headerTitle?: string;
|
|
30
|
+
/**
|
|
31
|
+
* (可选)内容高度是否自动适应(与headerTitle的高度有关)
|
|
32
|
+
*/
|
|
33
|
+
autoAdaptionContentHeight?: string;
|
|
34
|
+
/**
|
|
35
|
+
* (可选)是否是默认的,指打开弹窗的先显示出来的内容
|
|
36
|
+
*/
|
|
37
|
+
isDefault?: boolean | (() => boolean);
|
|
38
|
+
/**
|
|
39
|
+
* (可选)是否自动滚动到默认的项
|
|
40
|
+
*/
|
|
41
|
+
scrollToDefaultView?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* (可选)自定义元素属性
|
|
44
|
+
*/
|
|
45
|
+
attributes?: any;
|
|
46
|
+
/**
|
|
47
|
+
* (可选)自定义属性
|
|
48
|
+
*/
|
|
49
|
+
props?: HTMLElement;
|
|
50
|
+
/**
|
|
51
|
+
* 子配置
|
|
52
|
+
*/
|
|
53
|
+
forms: (PopsPanelFormsDetails | PopsPanelFormsTotalDetails)[];
|
|
54
|
+
/**
|
|
55
|
+
* 左侧容器的点击回调
|
|
56
|
+
*/
|
|
57
|
+
callback?: (event: MouseEvent | PointerEvent, rightHeaderElement: HTMLUListElement, rightContainerElement: HTMLUListElement) => void;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* pops.panel
|
|
61
|
+
*/
|
|
62
|
+
export interface PopsPanelDetails extends PopsTitleConfig, PopsDragConfig, PopsCommonConfig {
|
|
63
|
+
/**
|
|
64
|
+
* 内容配置
|
|
65
|
+
*/
|
|
66
|
+
content: PopsPanelContentConfig[];
|
|
67
|
+
/**
|
|
68
|
+
* 按钮配置
|
|
69
|
+
*/
|
|
70
|
+
btn?: {
|
|
71
|
+
/**
|
|
72
|
+
* 右上角的关闭按钮
|
|
73
|
+
*/
|
|
74
|
+
close?: PopsHeaderCloseButtonDetails;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* 移动端适配的的className,默认为pops-panel-is-mobile
|
|
78
|
+
*/
|
|
79
|
+
mobileClassName?: string;
|
|
80
|
+
/**
|
|
81
|
+
* 是否强制是移动端,默认false
|
|
82
|
+
* + true 强制为移动端
|
|
83
|
+
* + false 自动根据UA判断是否是移动端
|
|
84
|
+
*/
|
|
85
|
+
isMobile?: boolean;
|
|
86
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { PopsPanelCommonDetails } from "./commonType";
|
|
2
|
+
/**
|
|
3
|
+
* pops.panel的 input
|
|
4
|
+
*/
|
|
5
|
+
export interface PopsPanelInputDetails extends PopsPanelCommonDetails {
|
|
6
|
+
/**
|
|
7
|
+
* (可选)className属性
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* (可选)自定义元素属性
|
|
12
|
+
*/
|
|
13
|
+
attributes?: any;
|
|
14
|
+
/**
|
|
15
|
+
* (可选)自定义属性
|
|
16
|
+
*/
|
|
17
|
+
props?: HTMLElement;
|
|
18
|
+
/**
|
|
19
|
+
* 显示在左边的文字
|
|
20
|
+
*/
|
|
21
|
+
text: string;
|
|
22
|
+
/**
|
|
23
|
+
* (可选)左边的文字下面的描述
|
|
24
|
+
*/
|
|
25
|
+
description?: string;
|
|
26
|
+
/**
|
|
27
|
+
* 类型
|
|
28
|
+
*/
|
|
29
|
+
type: "input";
|
|
30
|
+
/**
|
|
31
|
+
* (可选)是否禁用
|
|
32
|
+
*/
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* 获取该项的值的回调函数
|
|
36
|
+
*/
|
|
37
|
+
getValue(): string;
|
|
38
|
+
/**
|
|
39
|
+
* 输入框的值改变触发的回调函数
|
|
40
|
+
* @param event 输入事件
|
|
41
|
+
* @param value 输入框的值
|
|
42
|
+
* @param valueAsNumber 当isNumber为true时,有该值,它可能是NaN
|
|
43
|
+
*/
|
|
44
|
+
callback(event: InputEvent, value: string, valueAsNumber?: number): void;
|
|
45
|
+
/**
|
|
46
|
+
* (可选)输入框内的提示
|
|
47
|
+
*/
|
|
48
|
+
placeholder?: string;
|
|
49
|
+
/**
|
|
50
|
+
* (可选)是否是密码框
|
|
51
|
+
*/
|
|
52
|
+
isPassword?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* (可选)是否是数字框
|
|
55
|
+
*/
|
|
56
|
+
isNumber?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* (可选)自己调用的处理回调函数
|
|
59
|
+
*/
|
|
60
|
+
handlerCallBack?(liElement: HTMLLIElement, inputElement: HTMLInputElement): void;
|
|
61
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { PopsPanelCommonDetails } from "./commonType";
|
|
2
|
+
/**
|
|
3
|
+
* pops.panel的 own
|
|
4
|
+
* 自定义的
|
|
5
|
+
*/
|
|
6
|
+
export interface PopsPanelOwnDetails extends PopsPanelCommonDetails {
|
|
7
|
+
/**
|
|
8
|
+
* (可选)className属性
|
|
9
|
+
*/
|
|
10
|
+
className?: string;
|
|
11
|
+
/**
|
|
12
|
+
* (可选)自定义元素属性
|
|
13
|
+
*/
|
|
14
|
+
attributes?: any;
|
|
15
|
+
/**
|
|
16
|
+
* (可选)自定义属性
|
|
17
|
+
*/
|
|
18
|
+
props?: HTMLElement;
|
|
19
|
+
/**
|
|
20
|
+
* 类型
|
|
21
|
+
*/
|
|
22
|
+
type: "own";
|
|
23
|
+
/**
|
|
24
|
+
* 获取自定义<li>标签元素
|
|
25
|
+
*/
|
|
26
|
+
getLiElementCallBack: (liElement: HTMLLIElement) => HTMLLIElement;
|
|
27
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { PopsPanelCommonDetails } from "./commonType";
|
|
2
|
+
/**
|
|
3
|
+
* pops.panel的 select
|
|
4
|
+
*/
|
|
5
|
+
export interface PopsPanelSelectDetails<T = any> extends PopsPanelCommonDetails {
|
|
6
|
+
/**
|
|
7
|
+
* (可选)className属性
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* (可选)自定义元素属性
|
|
12
|
+
*/
|
|
13
|
+
attributes?: any;
|
|
14
|
+
/**
|
|
15
|
+
* (可选)自定义属性
|
|
16
|
+
*/
|
|
17
|
+
props?: HTMLElement;
|
|
18
|
+
/**
|
|
19
|
+
* 显示在左边的文字
|
|
20
|
+
*/
|
|
21
|
+
text: string;
|
|
22
|
+
/**
|
|
23
|
+
* (可选)左边的文字下面的描述
|
|
24
|
+
*/
|
|
25
|
+
description?: string;
|
|
26
|
+
/**
|
|
27
|
+
* 类型
|
|
28
|
+
*/
|
|
29
|
+
type: "select";
|
|
30
|
+
/**
|
|
31
|
+
* (可选)是否禁用
|
|
32
|
+
*/
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* 获取该项的值的回调函数
|
|
36
|
+
*/
|
|
37
|
+
getValue(): T;
|
|
38
|
+
/**
|
|
39
|
+
* 选择器的值改变触发的回调函数
|
|
40
|
+
* @param event 事件
|
|
41
|
+
* @param isSelectedValue 当前选中的值,也就是元素属性上的__value__
|
|
42
|
+
* @param isSelectedText 当前选中的文本
|
|
43
|
+
*/
|
|
44
|
+
callback?(event: PointerEvent | TouchEvent, isSelectedValue: T, isSelectedText: string): void;
|
|
45
|
+
/**
|
|
46
|
+
* 点击select元素触发该回调
|
|
47
|
+
* @param event 点击事件
|
|
48
|
+
* @param selectElement 当前的select元素
|
|
49
|
+
*/
|
|
50
|
+
clickCallBack?(event: PointerEvent | MouseEvent, selectElement: HTMLSelectElement): void;
|
|
51
|
+
/**
|
|
52
|
+
* 选择器内的数据组
|
|
53
|
+
*/
|
|
54
|
+
data: {
|
|
55
|
+
/**
|
|
56
|
+
* 真正的值
|
|
57
|
+
*/
|
|
58
|
+
value: T;
|
|
59
|
+
/**
|
|
60
|
+
* 显示的文字
|
|
61
|
+
*/
|
|
62
|
+
text: string;
|
|
63
|
+
/**
|
|
64
|
+
* (可选)是否禁用项
|
|
65
|
+
* 触发条件:
|
|
66
|
+
* + 点击select元素
|
|
67
|
+
* + select元素触发change事件
|
|
68
|
+
*/
|
|
69
|
+
disable?(value: T): boolean;
|
|
70
|
+
}[];
|
|
71
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { PopsPanelCommonDetails } from "./commonType";
|
|
2
|
+
/**
|
|
3
|
+
* pops.panel的 slider
|
|
4
|
+
*/
|
|
5
|
+
export interface PopsPanelSliderDetails extends PopsPanelCommonDetails {
|
|
6
|
+
/**
|
|
7
|
+
* (可选)className属性
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* (可选)自定义元素属性
|
|
12
|
+
*/
|
|
13
|
+
attributes?: any;
|
|
14
|
+
/**
|
|
15
|
+
* (可选)自定义属性
|
|
16
|
+
*/
|
|
17
|
+
props?: HTMLElement;
|
|
18
|
+
/**
|
|
19
|
+
* 显示在左边的文字
|
|
20
|
+
*/
|
|
21
|
+
text: string;
|
|
22
|
+
/**
|
|
23
|
+
* (可选)左边的文字下面的描述
|
|
24
|
+
*/
|
|
25
|
+
description?: string;
|
|
26
|
+
/**
|
|
27
|
+
* 类型
|
|
28
|
+
*/
|
|
29
|
+
type: "slider";
|
|
30
|
+
/**
|
|
31
|
+
* (可选)是否禁用
|
|
32
|
+
*/
|
|
33
|
+
disabled?: false;
|
|
34
|
+
/**
|
|
35
|
+
* 获取该项的值的回调函数
|
|
36
|
+
*/
|
|
37
|
+
getValue(): number;
|
|
38
|
+
/**
|
|
39
|
+
* 滑块的值改变触发的回调函数
|
|
40
|
+
*/
|
|
41
|
+
callback(event: InputEvent, value: number): void;
|
|
42
|
+
/**
|
|
43
|
+
* 获取tooltip的提示内容,可自定义,默认为slider的值
|
|
44
|
+
*/
|
|
45
|
+
getToolTipContent?: (value: number) => string;
|
|
46
|
+
/**
|
|
47
|
+
* 滑块的最小值
|
|
48
|
+
*/
|
|
49
|
+
min: number;
|
|
50
|
+
/**
|
|
51
|
+
* 滑块的最大值
|
|
52
|
+
*/
|
|
53
|
+
max: number;
|
|
54
|
+
/**
|
|
55
|
+
* (可选)每次滑动的间隔值
|
|
56
|
+
*/
|
|
57
|
+
step?: number;
|
|
58
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { PopsPanelCommonDetails } from "./commonType";
|
|
2
|
+
/**
|
|
3
|
+
* pops.panel的 switch
|
|
4
|
+
*/
|
|
5
|
+
export interface PopsPanelSwitchDetails extends PopsPanelCommonDetails {
|
|
6
|
+
/**
|
|
7
|
+
* (可选)className属性
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* (可选)自定义元素属性
|
|
12
|
+
*/
|
|
13
|
+
attributes?: any;
|
|
14
|
+
/**
|
|
15
|
+
* (可选)自定义属性
|
|
16
|
+
*/
|
|
17
|
+
props?: HTMLElement;
|
|
18
|
+
/**
|
|
19
|
+
* 显示在左边的文字
|
|
20
|
+
*/
|
|
21
|
+
text: string;
|
|
22
|
+
/**
|
|
23
|
+
* (可选)左边的文字下面的描述
|
|
24
|
+
*/
|
|
25
|
+
description?: string;
|
|
26
|
+
/**
|
|
27
|
+
* 类型
|
|
28
|
+
*/
|
|
29
|
+
type: "switch";
|
|
30
|
+
/**
|
|
31
|
+
* (可选)是否禁用
|
|
32
|
+
*/
|
|
33
|
+
disabled?: false;
|
|
34
|
+
/**
|
|
35
|
+
* 获取该项的值的回调函数
|
|
36
|
+
*/
|
|
37
|
+
getValue(): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* switch开启/关闭触发的回调函数
|
|
40
|
+
*/
|
|
41
|
+
callback(event: MouseEvent | PointerEvent, value: boolean): void;
|
|
42
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { PopsPanelCommonDetails } from "./commonType";
|
|
2
|
+
/**
|
|
3
|
+
* pops.panel的 textarea
|
|
4
|
+
*/
|
|
5
|
+
export interface PopsPanelTextAreaDetails extends PopsPanelCommonDetails {
|
|
6
|
+
/**
|
|
7
|
+
* (可选)className属性
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* (可选)自定义元素属性
|
|
12
|
+
*/
|
|
13
|
+
attributes?: any;
|
|
14
|
+
/**
|
|
15
|
+
* (可选)自定义属性
|
|
16
|
+
*/
|
|
17
|
+
props?: HTMLElement;
|
|
18
|
+
/**
|
|
19
|
+
* 显示在左边的文字
|
|
20
|
+
*/
|
|
21
|
+
text: string;
|
|
22
|
+
/**
|
|
23
|
+
* (可选)左边的文字下面的描述
|
|
24
|
+
*/
|
|
25
|
+
description?: string;
|
|
26
|
+
/**
|
|
27
|
+
* 类型
|
|
28
|
+
*/
|
|
29
|
+
type: "textarea";
|
|
30
|
+
/**
|
|
31
|
+
* (可选)是否禁用
|
|
32
|
+
*/
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* 获取该项的值的回调函数
|
|
36
|
+
*/
|
|
37
|
+
getValue(): string;
|
|
38
|
+
/**
|
|
39
|
+
* textarea输入框的值改变触发的回调函数
|
|
40
|
+
* @param event 事件
|
|
41
|
+
* @param value 当前的textarea内的值
|
|
42
|
+
*/
|
|
43
|
+
callback(event: InputEvent & {
|
|
44
|
+
target: HTMLTextAreaElement;
|
|
45
|
+
}, value: string): void;
|
|
46
|
+
/**
|
|
47
|
+
* 输入框内的提示
|
|
48
|
+
*/
|
|
49
|
+
placeholder: string;
|
|
50
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { PopsTitleConfig, PopsDragConfig, PopsCommonConfig, PopsMoreButtonConfig } from "../../types/components";
|
|
2
|
+
/**
|
|
3
|
+
* pops.prompt
|
|
4
|
+
*/
|
|
5
|
+
export interface PopsPromptDetails extends PopsTitleConfig, PopsDragConfig, PopsMoreButtonConfig<{
|
|
6
|
+
text: string;
|
|
7
|
+
}>, PopsCommonConfig {
|
|
8
|
+
/**
|
|
9
|
+
* 内容配置
|
|
10
|
+
*/
|
|
11
|
+
content: {
|
|
12
|
+
/**
|
|
13
|
+
* 内容文字
|
|
14
|
+
*/
|
|
15
|
+
text: string;
|
|
16
|
+
/**
|
|
17
|
+
* 是否是密码
|
|
18
|
+
*/
|
|
19
|
+
password?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* 是否支持多行输入
|
|
22
|
+
*/
|
|
23
|
+
row?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* 是否自动获取焦点
|
|
26
|
+
*/
|
|
27
|
+
focus?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* 输入框内的提示文字
|
|
30
|
+
*/
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
/**
|
|
33
|
+
* (可选)文字的自定义CSS
|
|
34
|
+
*/
|
|
35
|
+
style?: string;
|
|
36
|
+
};
|
|
37
|
+
}
|