@fox-js/foxui-pc 4.0.1-11 → 4.0.1-13
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/dist/index.cjs.js +3 -3
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +7779 -4637
- package/dist/index.esm.js.map +1 -0
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/style.esm.js +1 -1
- package/dist/types/index.d.ts +173 -35
- package/dist/types/src/api/index.d.ts +35 -0
- package/dist/types/src/base/component.d.ts +70 -0
- package/dist/types/src/base/index.d.ts +4 -0
- package/dist/types/src/base/plugin.d.ts +2 -0
- package/dist/types/src/components/autocompleteitem/common.d.ts +152 -0
- package/dist/types/src/components/autocompleteitem/index.vue.d.ts +3 -0
- package/dist/types/src/components/cascaderitem/common.d.ts +223 -0
- package/dist/types/src/components/cascaderitem/index.vue.d.ts +3 -0
- package/dist/types/src/components/cascaderitem/model.d.ts +70 -0
- package/dist/types/src/components/cascaderitem/types.d.ts +26 -0
- package/dist/types/src/components/checkboxitem/common.d.ts +181 -0
- package/dist/types/src/components/checkboxitem/index.vue.d.ts +3 -0
- package/dist/types/src/components/checkboxitem/model.d.ts +63 -0
- package/dist/types/src/components/checkboxitem/types.d.ts +33 -0
- package/dist/types/src/components/content/common.d.ts +16 -0
- package/dist/types/src/components/content/index.vue.d.ts +3 -0
- package/dist/types/src/components/dateitem/common.d.ts +152 -0
- package/dist/types/src/components/dateitem/index.vue.d.ts +3 -0
- package/dist/types/src/components/dialogitem/common.d.ts +27 -0
- package/dist/types/src/components/dialogitem/index.vue.d.ts +3 -0
- package/dist/types/src/components/exticon/index.vue.d.ts +3 -0
- package/dist/types/src/components/footerbar/common.d.ts +26 -0
- package/dist/types/src/components/footerbar/index.vue.d.ts +3 -0
- package/dist/types/src/components/footerbar/type.d.ts +1 -0
- package/dist/types/src/components/group/commons.d.ts +122 -0
- package/dist/types/src/components/group/group-props.d.ts +97 -0
- package/dist/types/src/components/group/index.vue.d.ts +3 -0
- package/dist/types/src/components/headerbar/common.d.ts +80 -0
- package/dist/types/src/components/headerbar/index.vue.d.ts +3 -0
- package/dist/types/src/components/headerbar/types.d.ts +5 -0
- package/dist/types/src/components/hinttext/index.d.ts +27 -0
- package/dist/types/src/components/hinttext/index.vue.d.ts +3 -0
- package/dist/types/src/components/indicator/common.d.ts +19 -0
- package/dist/types/src/components/indicator/index.vue.d.ts +3 -0
- package/dist/types/src/components/indicator/types.d.ts +1 -0
- package/dist/types/src/components/inputitem/common.d.ts +176 -0
- package/dist/types/src/components/inputitem/index.vue.d.ts +3 -0
- package/dist/types/src/components/inputnumberitem/common.d.ts +176 -0
- package/dist/types/src/components/inputnumberitem/index.vue.d.ts +3 -0
- package/dist/types/src/components/item/common.d.ts +137 -0
- package/dist/types/src/components/item/index.vue.d.ts +3 -0
- package/dist/types/src/components/mapping/common.d.ts +105 -0
- package/dist/types/src/components/mapping/index.vue.d.ts +3 -0
- package/dist/types/src/components/mapping/model.d.ts +28 -0
- package/dist/types/src/components/mapping/types.d.ts +17 -0
- package/dist/types/src/components/moneyitem/common.d.ts +300 -0
- package/dist/types/src/components/moneyitem/index.vue.d.ts +3 -0
- package/dist/types/src/components/moneyitem/util.d.ts +51 -0
- package/dist/types/src/components/page/common.d.ts +120 -0
- package/dist/types/src/components/page/index.vue.d.ts +3 -0
- package/dist/types/src/components/price/index.vue.d.ts +3 -0
- package/dist/types/src/components/price/price-props.d.ts +37 -0
- package/dist/types/src/components/radioitem/common.d.ts +173 -0
- package/dist/types/src/components/radioitem/index.vue.d.ts +3 -0
- package/dist/types/src/components/radioitem/model.d.ts +63 -0
- package/dist/types/src/components/radioitem/types.d.ts +33 -0
- package/dist/types/src/components/rateitem/common.d.ts +136 -0
- package/dist/types/src/components/rateitem/index.vue.d.ts +3 -0
- package/dist/types/src/components/rowitem/common.d.ts +38 -0
- package/dist/types/src/components/rowitem/index.vue.d.ts +3 -0
- package/dist/types/src/components/selectitem/common.d.ts +239 -0
- package/dist/types/src/components/selectitem/index.vue.d.ts +3 -0
- package/dist/types/src/components/selectitem/model.d.ts +70 -0
- package/dist/types/src/components/selectitem/types.d.ts +26 -0
- package/dist/types/src/components/slotitem/common.d.ts +21 -0
- package/dist/types/src/components/slotitem/index.vue.d.ts +3 -0
- package/dist/types/src/components/switchitem/common.d.ts +136 -0
- package/dist/types/src/components/switchitem/index.vue.d.ts +3 -0
- package/dist/types/src/components/tableitem/common.d.ts +230 -0
- package/dist/types/src/components/tableitem/index.vue.d.ts +3 -0
- package/dist/types/src/components/tableitem/model.d.ts +27 -0
- package/dist/types/src/components/tableitem/types.d.ts +19 -0
- package/dist/types/src/components/tablemappingcolumn/common.d.ts +56 -0
- package/dist/types/src/components/tablemappingcolumn/index.vue.d.ts +3 -0
- package/dist/types/src/components/timeitem/common.d.ts +152 -0
- package/dist/types/src/components/timeitem/index.vue.d.ts +3 -0
- package/dist/types/src/components/timeselectitem/common.d.ts +152 -0
- package/dist/types/src/components/timeselectitem/index.vue.d.ts +3 -0
- package/dist/types/src/foxui.vue.build.d.ts +137 -0
- package/dist/types/src/interface.d.ts +83 -0
- package/dist/types/src/main.d.ts +81 -0
- package/dist/types/src/utils/commons.d.ts +220 -0
- package/dist/types/src/utils/create/component.d.ts +18 -0
- package/dist/types/src/utils/create/index.d.ts +1 -0
- package/dist/types/src/utils/date.d.ts +76 -0
- package/dist/types/src/utils/domain/broadcast.d.ts +116 -0
- package/dist/types/src/utils/domain/domain.d.ts +146 -0
- package/dist/types/src/utils/domain/events.d.ts +51 -0
- package/dist/types/src/utils/domain/group.d.ts +61 -0
- package/dist/types/src/utils/domain/index.d.ts +5 -0
- package/dist/types/src/utils/domain/item.d.ts +45 -0
- package/dist/types/src/utils/domain/page.d.ts +113 -0
- package/dist/types/src/utils/domain/types.d.ts +5 -0
- package/dist/types/src/utils/domain/validator.d.ts +230 -0
- package/dist/types/src/utils/functions.d.ts +20 -0
- package/dist/types/src/utils/px.d.ts +13 -0
- package/dist/types/src/utils/unique-id.d.ts +16 -0
- package/dist/types/src/utils/use-expose/index.d.ts +6 -0
- package/dist/types/src/utils/use-position/index.d.ts +14 -0
- package/dist/types/src/utils/use-rect/index.d.ts +20 -0
- package/dist/types/src/utils/use-touch/index.d.ts +21 -0
- package/package.json +1 -1
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { Rule, ValidateMessages, ValidateResult, ExecuteValidator } from '@fox-js/validator';
|
|
2
|
+
import { FoxComponentPublicInstance } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* 校验条件
|
|
5
|
+
*/
|
|
6
|
+
export interface ValidateCondition {
|
|
7
|
+
exclude?: string[];
|
|
8
|
+
include?: string[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 校验器handler
|
|
12
|
+
*/
|
|
13
|
+
export interface ValidateHandler {
|
|
14
|
+
/**
|
|
15
|
+
* 错误处理
|
|
16
|
+
* @param errorMsg
|
|
17
|
+
* @param proxy
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
error?(errorMsg: string, proxy: FoxComponentPublicInstance): void;
|
|
21
|
+
/**
|
|
22
|
+
* 重置处理
|
|
23
|
+
* @param proxy
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
reset?(proxy: FoxComponentPublicInstance): void;
|
|
27
|
+
/**
|
|
28
|
+
* 成功处理
|
|
29
|
+
* @param proxy
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
success?(proxy: FoxComponentPublicInstance): void;
|
|
33
|
+
/**
|
|
34
|
+
* 规则装饰处理
|
|
35
|
+
* @param newRule
|
|
36
|
+
* @param oldRule
|
|
37
|
+
* @param proxy
|
|
38
|
+
*
|
|
39
|
+
*/
|
|
40
|
+
decorate?(newRule: Rule, oldRule: Rule, proxy: FoxComponentPublicInstance): void;
|
|
41
|
+
/**
|
|
42
|
+
* 获取value
|
|
43
|
+
* @param proxy
|
|
44
|
+
*
|
|
45
|
+
*/
|
|
46
|
+
getValue?(proxy: FoxComponentPublicInstance): any;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* 设置公共的校验处理器
|
|
50
|
+
* @param validateHandler
|
|
51
|
+
*/
|
|
52
|
+
export declare function setGlobalValidateHandler(validateHandler: ValidateHandler): void;
|
|
53
|
+
/**
|
|
54
|
+
* 设置公共校验器
|
|
55
|
+
* @param type
|
|
56
|
+
* @param validator
|
|
57
|
+
*/
|
|
58
|
+
export declare function setGlobalValidator(type: string, validator: ExecuteValidator): void;
|
|
59
|
+
/**
|
|
60
|
+
* 删除公共校验器
|
|
61
|
+
* @param type
|
|
62
|
+
*/
|
|
63
|
+
export declare function deleteGlobalValidator(type: string): void;
|
|
64
|
+
/**
|
|
65
|
+
* 设置公共校验检查事件
|
|
66
|
+
* @param events
|
|
67
|
+
*/
|
|
68
|
+
export declare function setGlobalValidateCheckEvents(events: string[]): void;
|
|
69
|
+
/**
|
|
70
|
+
* 获取公共校验检查事件
|
|
71
|
+
*/
|
|
72
|
+
export declare function getGlobalValidateCheckEvents(): string[];
|
|
73
|
+
/**
|
|
74
|
+
* 设置公共校验重置事件
|
|
75
|
+
* @param events
|
|
76
|
+
*/
|
|
77
|
+
export declare function setGlobalValidateResetEvents(events: string[]): void;
|
|
78
|
+
/**
|
|
79
|
+
* 获取公共校验重置事件
|
|
80
|
+
*/
|
|
81
|
+
export declare function getGlobalValidateResetEvents(): string[];
|
|
82
|
+
/**
|
|
83
|
+
* 设置公共校验提示信息
|
|
84
|
+
*/
|
|
85
|
+
export declare function setGlobalValidateMessages(messages: ValidateMessages): void;
|
|
86
|
+
/**
|
|
87
|
+
* value 类型
|
|
88
|
+
*/
|
|
89
|
+
export declare type ValueType = 'string' | 'number' | 'date';
|
|
90
|
+
/**
|
|
91
|
+
* 组件描述
|
|
92
|
+
*/
|
|
93
|
+
export interface Descriptor {
|
|
94
|
+
componentName: string;
|
|
95
|
+
fieldName?: string;
|
|
96
|
+
valueName?: string;
|
|
97
|
+
valueType?: ValueType;
|
|
98
|
+
validate?: boolean;
|
|
99
|
+
pureDataValidate?: boolean;
|
|
100
|
+
validateHandler?: ValidateHandler;
|
|
101
|
+
validateCheckEvents?: string[];
|
|
102
|
+
validateResetEvents?: string[];
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* validate schema key
|
|
106
|
+
*/
|
|
107
|
+
export declare const ValidateSchemaKey: unique symbol;
|
|
108
|
+
/**
|
|
109
|
+
* 校验器schema
|
|
110
|
+
*/
|
|
111
|
+
export declare class ValidateSchema {
|
|
112
|
+
/**
|
|
113
|
+
* parent
|
|
114
|
+
*/
|
|
115
|
+
private parent;
|
|
116
|
+
/**
|
|
117
|
+
* 校验器
|
|
118
|
+
*/
|
|
119
|
+
private validators;
|
|
120
|
+
/**
|
|
121
|
+
* 属性rule
|
|
122
|
+
*/
|
|
123
|
+
private attrRules;
|
|
124
|
+
/**
|
|
125
|
+
* rule
|
|
126
|
+
*/
|
|
127
|
+
private rules;
|
|
128
|
+
/**
|
|
129
|
+
* 描述
|
|
130
|
+
*/
|
|
131
|
+
private descriptor;
|
|
132
|
+
/**
|
|
133
|
+
* 实例
|
|
134
|
+
*/
|
|
135
|
+
private proxy;
|
|
136
|
+
/**
|
|
137
|
+
* effect scope
|
|
138
|
+
*/
|
|
139
|
+
private scope;
|
|
140
|
+
/**
|
|
141
|
+
* 构造函数
|
|
142
|
+
* @param parent
|
|
143
|
+
* @param descriptor
|
|
144
|
+
* @param proxy
|
|
145
|
+
*/
|
|
146
|
+
constructor(parent: ValidateSchema | null, descriptor: Descriptor, proxy: FoxComponentPublicInstance);
|
|
147
|
+
/**
|
|
148
|
+
* 初始化
|
|
149
|
+
*/
|
|
150
|
+
private init;
|
|
151
|
+
/**
|
|
152
|
+
* 销毁
|
|
153
|
+
*/
|
|
154
|
+
destroy(): void;
|
|
155
|
+
/**
|
|
156
|
+
* 执行validate handler函数
|
|
157
|
+
* @param name
|
|
158
|
+
* @param args
|
|
159
|
+
*/
|
|
160
|
+
private execHandler;
|
|
161
|
+
/**
|
|
162
|
+
* 调用装饰处理函数
|
|
163
|
+
*/
|
|
164
|
+
private decorate;
|
|
165
|
+
/**
|
|
166
|
+
* 调用成功处理函数
|
|
167
|
+
*/
|
|
168
|
+
private success;
|
|
169
|
+
/**
|
|
170
|
+
* 调用错误处理函数
|
|
171
|
+
* @returns
|
|
172
|
+
*/
|
|
173
|
+
private error;
|
|
174
|
+
/**
|
|
175
|
+
* 调用错误处理函数
|
|
176
|
+
* @returns
|
|
177
|
+
*/
|
|
178
|
+
private getValue;
|
|
179
|
+
/**
|
|
180
|
+
* 设置校验器
|
|
181
|
+
* @param type
|
|
182
|
+
* @param validator
|
|
183
|
+
* @param global
|
|
184
|
+
*
|
|
185
|
+
* @returns
|
|
186
|
+
*/
|
|
187
|
+
setValidator(type: string, validator: ExecuteValidator, global?: boolean): void;
|
|
188
|
+
/**
|
|
189
|
+
* 获取validator(只获取私有的validator)
|
|
190
|
+
* @param type
|
|
191
|
+
*/
|
|
192
|
+
getValidator(type: string): ExecuteValidator | null;
|
|
193
|
+
/**
|
|
194
|
+
* 删除校验器
|
|
195
|
+
* @param type
|
|
196
|
+
* @param global
|
|
197
|
+
*/
|
|
198
|
+
deleteValidator(type: string, global?: boolean): void;
|
|
199
|
+
/**
|
|
200
|
+
* 判断校验器是否存在
|
|
201
|
+
* @param type
|
|
202
|
+
* @param global
|
|
203
|
+
* @returns
|
|
204
|
+
*/
|
|
205
|
+
hasValidator(type: string, global?: boolean): boolean;
|
|
206
|
+
/**
|
|
207
|
+
* 设置rule
|
|
208
|
+
* @param rule
|
|
209
|
+
*/
|
|
210
|
+
setRule(rule: Rule | null): void;
|
|
211
|
+
/**
|
|
212
|
+
* 清空校验错误信息
|
|
213
|
+
* @params deep
|
|
214
|
+
* @returns
|
|
215
|
+
*/
|
|
216
|
+
clear(): void;
|
|
217
|
+
/**
|
|
218
|
+
* 执行校验
|
|
219
|
+
* @returns
|
|
220
|
+
*/
|
|
221
|
+
validate(): Promise<ValidateResult>;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* 创建校验schema
|
|
225
|
+
* @param proxy
|
|
226
|
+
* @param parent
|
|
227
|
+
* @param descriptor
|
|
228
|
+
* @returns
|
|
229
|
+
*/
|
|
230
|
+
export declare function createValidateSchema(proxy: FoxComponentPublicInstance, parent: ValidateSchema | null, descriptor: Descriptor): ValidateSchema;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 通用函数接口
|
|
3
|
+
*/
|
|
4
|
+
export interface GenericFunction {
|
|
5
|
+
(...args: any[]): any;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 防抖函数
|
|
9
|
+
* @param func 函数
|
|
10
|
+
* @param time 防止抖动毫秒数
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
export declare function debounce(func: GenericFunction, time: number): GenericFunction;
|
|
14
|
+
/**
|
|
15
|
+
* 节流函数
|
|
16
|
+
* @param func 函数
|
|
17
|
+
* @param time 延迟执行毫秒数
|
|
18
|
+
* @returns
|
|
19
|
+
*/
|
|
20
|
+
export declare function throttle(func: GenericFunction, time: number): GenericFunction;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* to px desc
|
|
3
|
+
* @param value
|
|
4
|
+
* @parma size
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
export declare const toPxDesc: (value: string | number, size?: number) => string;
|
|
8
|
+
/**
|
|
9
|
+
* 转换为px number数值
|
|
10
|
+
* @param value
|
|
11
|
+
* @param size
|
|
12
|
+
*/
|
|
13
|
+
export declare function toPx(value: number | string, size?: number): number;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* 坐标
|
|
4
|
+
*/
|
|
5
|
+
export interface Point {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 获取element 位置
|
|
11
|
+
* @param elementRef
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
export declare const usePosition: (elementRef: (Element | Window) | Ref<Element | Window | undefined>) => Point;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
获取元素的大小及其相对于视口的位置,等价于 Element.getBoundingClientRect。
|
|
3
|
+
width 宽度 number
|
|
4
|
+
height 高度 number
|
|
5
|
+
top 顶部与视图窗口左上角的距离 number
|
|
6
|
+
left 左侧与视图窗口左上角的距离 number
|
|
7
|
+
right 右侧与视图窗口左上角的距离 number
|
|
8
|
+
bottom 底部与视图窗口左上角的距离 number
|
|
9
|
+
*/
|
|
10
|
+
import { Ref } from 'vue';
|
|
11
|
+
interface Rect {
|
|
12
|
+
top: number;
|
|
13
|
+
left: number;
|
|
14
|
+
right: number;
|
|
15
|
+
bottom: number;
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
}
|
|
19
|
+
export declare const useRect: (elementRef: (Element | Window) | Ref<Element | Window | undefined>) => Rect;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
declare type Direction = '' | 'vertical' | 'horizontal';
|
|
3
|
+
export declare function useTouch(): {
|
|
4
|
+
move: EventListener;
|
|
5
|
+
start: EventListener;
|
|
6
|
+
reset: () => void;
|
|
7
|
+
startX: Ref<number>;
|
|
8
|
+
startY: Ref<number>;
|
|
9
|
+
startTime: Ref<number>;
|
|
10
|
+
duration: Ref<number>;
|
|
11
|
+
moveX: Ref<number>;
|
|
12
|
+
moveY: Ref<number>;
|
|
13
|
+
deltaX: Ref<number>;
|
|
14
|
+
deltaY: Ref<number>;
|
|
15
|
+
offsetX: Ref<number>;
|
|
16
|
+
offsetY: Ref<number>;
|
|
17
|
+
direction: Ref<Direction>;
|
|
18
|
+
isVertical: () => boolean;
|
|
19
|
+
isHorizontal: () => boolean;
|
|
20
|
+
};
|
|
21
|
+
export {};
|