@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,76 @@
|
|
|
1
|
+
declare const DateUtils: {
|
|
2
|
+
/**
|
|
3
|
+
* 格式化
|
|
4
|
+
* @param date
|
|
5
|
+
* @param template
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
format(date: Date, template: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* 解析
|
|
11
|
+
* @param str
|
|
12
|
+
* @param template
|
|
13
|
+
*/
|
|
14
|
+
parser(str: string, template: string): Date;
|
|
15
|
+
/**
|
|
16
|
+
* 是否为闫年
|
|
17
|
+
* @return {Boolse} true|false
|
|
18
|
+
*/
|
|
19
|
+
isLeapYear(y: number): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* 返回星期数
|
|
22
|
+
* @return {String}
|
|
23
|
+
*/
|
|
24
|
+
getWhatDay(year: number, month: number, day: number): string;
|
|
25
|
+
/**
|
|
26
|
+
* 返回星期数
|
|
27
|
+
* @return {Number}
|
|
28
|
+
*/
|
|
29
|
+
getMonthPreDay(year: number, month: number): number;
|
|
30
|
+
/**
|
|
31
|
+
* 返回月份天数
|
|
32
|
+
* @return {Number}
|
|
33
|
+
*/
|
|
34
|
+
getMonthDays(year: string, month: string): number;
|
|
35
|
+
/**
|
|
36
|
+
* 补齐数字位数
|
|
37
|
+
* @return {string}
|
|
38
|
+
*/
|
|
39
|
+
getNumTwoBit(n: number): string;
|
|
40
|
+
/**
|
|
41
|
+
* 日期对象转成字符串
|
|
42
|
+
* @return {string}
|
|
43
|
+
*/
|
|
44
|
+
date2Str: (date: Date, split?: string) => string;
|
|
45
|
+
/**
|
|
46
|
+
* 返回日期格式字符串
|
|
47
|
+
* @param {Number} 0返回今天的日期、1返回明天的日期,2返回后天得日期,依次类推
|
|
48
|
+
* @return {string} '2014-12-31'
|
|
49
|
+
*/
|
|
50
|
+
getDay(i: number): string;
|
|
51
|
+
/**
|
|
52
|
+
* 时间比较
|
|
53
|
+
* @return
|
|
54
|
+
*/
|
|
55
|
+
compareDate(date1: string | Date, date2: string | Date): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* 时间是否相等
|
|
58
|
+
* @return
|
|
59
|
+
*/
|
|
60
|
+
isEqual(date1: string | Date | null, date2: string | Date | null): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* 判断日期是否在范围内
|
|
63
|
+
* @param date
|
|
64
|
+
* @param startDate
|
|
65
|
+
* @param span 允许负数
|
|
66
|
+
*/
|
|
67
|
+
inScope4Day(date: Date, startDate: Date, span: number): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* 判断日期是否在范围内
|
|
70
|
+
* @param date
|
|
71
|
+
* @param startDate
|
|
72
|
+
* @param span
|
|
73
|
+
*/
|
|
74
|
+
inScope4Month(date: Date, startDate: Date, span: number): boolean;
|
|
75
|
+
};
|
|
76
|
+
export default DateUtils;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { FoxComponentPublicInstance } from './types';
|
|
2
|
+
export declare const BroadcastKey: unique symbol;
|
|
3
|
+
/**
|
|
4
|
+
* 匹配条件
|
|
5
|
+
*/
|
|
6
|
+
export interface Matched {
|
|
7
|
+
name?: string | RegExp | {
|
|
8
|
+
(name: string): boolean;
|
|
9
|
+
};
|
|
10
|
+
maxLevel?: number;
|
|
11
|
+
level?: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 结果类型
|
|
15
|
+
*/
|
|
16
|
+
export declare type Result = Promise<any> | any;
|
|
17
|
+
/**
|
|
18
|
+
* 结果集合
|
|
19
|
+
*/
|
|
20
|
+
export declare type Results = Result[];
|
|
21
|
+
/**
|
|
22
|
+
* broadcast callback
|
|
23
|
+
*/
|
|
24
|
+
export interface BroadcastCallback {
|
|
25
|
+
(...args: any[]): Result;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* 广播类
|
|
29
|
+
*/
|
|
30
|
+
export declare class Broadcast {
|
|
31
|
+
/**
|
|
32
|
+
* parent
|
|
33
|
+
*/
|
|
34
|
+
private parent;
|
|
35
|
+
/**
|
|
36
|
+
* children
|
|
37
|
+
*/
|
|
38
|
+
private children;
|
|
39
|
+
/**
|
|
40
|
+
* 回调函数注册表
|
|
41
|
+
*/
|
|
42
|
+
private callbacks;
|
|
43
|
+
/**
|
|
44
|
+
* vue proxy
|
|
45
|
+
*/
|
|
46
|
+
private proxy;
|
|
47
|
+
/**
|
|
48
|
+
* 名称
|
|
49
|
+
*/
|
|
50
|
+
private name?;
|
|
51
|
+
/**
|
|
52
|
+
* 构造函数
|
|
53
|
+
* @param parent
|
|
54
|
+
* @param proxy
|
|
55
|
+
* @param name
|
|
56
|
+
*/
|
|
57
|
+
constructor(parent: Broadcast | null, proxy: FoxComponentPublicInstance, name?: string);
|
|
58
|
+
/**
|
|
59
|
+
* 加入孩子节点
|
|
60
|
+
* @param child
|
|
61
|
+
*/
|
|
62
|
+
private addChild;
|
|
63
|
+
/**
|
|
64
|
+
* 移除孩子节点
|
|
65
|
+
* @param child
|
|
66
|
+
*/
|
|
67
|
+
private removeChild;
|
|
68
|
+
/**
|
|
69
|
+
* 销毁
|
|
70
|
+
*/
|
|
71
|
+
destroy(): void;
|
|
72
|
+
/**
|
|
73
|
+
* 发生消息
|
|
74
|
+
* @param matched
|
|
75
|
+
* @param action
|
|
76
|
+
* @param args
|
|
77
|
+
*/
|
|
78
|
+
emit(matched: Matched, action: string, ...args: any[]): Results;
|
|
79
|
+
/**
|
|
80
|
+
* 发生消息(只发给孩子节点)
|
|
81
|
+
* @param matched
|
|
82
|
+
* @param action
|
|
83
|
+
* @param args
|
|
84
|
+
*/
|
|
85
|
+
emitToChildren(matched: Matched, action: string, ...args: any[]): Results;
|
|
86
|
+
/**
|
|
87
|
+
* 注册回调函数
|
|
88
|
+
* @param action
|
|
89
|
+
* @param callback
|
|
90
|
+
* @returns
|
|
91
|
+
*/
|
|
92
|
+
on(action: string, callback: BroadcastCallback): void;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* 创建broadcast
|
|
96
|
+
*
|
|
97
|
+
* @param proxy
|
|
98
|
+
* @param parent
|
|
99
|
+
* @param name
|
|
100
|
+
* @param callbacks
|
|
101
|
+
* @returns
|
|
102
|
+
*/
|
|
103
|
+
export declare function createBroadcast(proxy: FoxComponentPublicInstance, parent: Broadcast | null, name?: string, callbacks?: Record<string, BroadcastCallback>): Broadcast;
|
|
104
|
+
/**
|
|
105
|
+
* anyNode
|
|
106
|
+
* @param name
|
|
107
|
+
* @param callbacks
|
|
108
|
+
* @returns
|
|
109
|
+
*/
|
|
110
|
+
export declare function defineBroadcast(name?: string, callbacks?: Record<string, BroadcastCallback>, proxy?: FoxComponentPublicInstance): Broadcast | null;
|
|
111
|
+
/**
|
|
112
|
+
* 使用broadcast
|
|
113
|
+
* @param proxy
|
|
114
|
+
* @returns
|
|
115
|
+
*/
|
|
116
|
+
export declare function useBroadcast(proxy?: FoxComponentPublicInstance | null): Broadcast | null;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { ComponentInternalInstance } from 'vue';
|
|
2
|
+
import { Broadcast, BroadcastCallback } from './broadcast';
|
|
3
|
+
import { ValidateSchema, Descriptor } from './validator';
|
|
4
|
+
import { EventListener } from './events';
|
|
5
|
+
/**
|
|
6
|
+
* domain key
|
|
7
|
+
*/
|
|
8
|
+
export declare const DomainKey: unique symbol;
|
|
9
|
+
/**
|
|
10
|
+
* data items key
|
|
11
|
+
*/
|
|
12
|
+
export declare const DataItemsKey: unique symbol;
|
|
13
|
+
/**
|
|
14
|
+
* Domain
|
|
15
|
+
*/
|
|
16
|
+
export declare class Domain {
|
|
17
|
+
/**
|
|
18
|
+
* 父亲domain
|
|
19
|
+
*/
|
|
20
|
+
private _parent;
|
|
21
|
+
get parent(): Domain | null;
|
|
22
|
+
set parent(val: Domain | null);
|
|
23
|
+
/**
|
|
24
|
+
* 名称
|
|
25
|
+
*/
|
|
26
|
+
private _name;
|
|
27
|
+
get name(): string | null;
|
|
28
|
+
/**
|
|
29
|
+
* 广播器
|
|
30
|
+
*/
|
|
31
|
+
private _broadcast;
|
|
32
|
+
get broadcast(): Broadcast | null;
|
|
33
|
+
set broadcast(val: Broadcast | null);
|
|
34
|
+
/**
|
|
35
|
+
* 校验器
|
|
36
|
+
*/
|
|
37
|
+
private _validateSchema;
|
|
38
|
+
get validateSchema(): ValidateSchema | null;
|
|
39
|
+
set validateSchema(val: ValidateSchema | null);
|
|
40
|
+
/**
|
|
41
|
+
* 属性集合
|
|
42
|
+
*/
|
|
43
|
+
private _props;
|
|
44
|
+
/**
|
|
45
|
+
* 构造函数
|
|
46
|
+
* @param name
|
|
47
|
+
*/
|
|
48
|
+
constructor(name?: string | null);
|
|
49
|
+
/**
|
|
50
|
+
* 销毁
|
|
51
|
+
*/
|
|
52
|
+
destroy(): void;
|
|
53
|
+
/**
|
|
54
|
+
* 合并属性
|
|
55
|
+
* @param props
|
|
56
|
+
*/
|
|
57
|
+
merge(props: Record<string | number, any>, ignores?: any[]): void;
|
|
58
|
+
/**
|
|
59
|
+
* 判断是否有属性
|
|
60
|
+
*/
|
|
61
|
+
has(key: string | number): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* 删除属性
|
|
64
|
+
* @param key
|
|
65
|
+
*/
|
|
66
|
+
delete(key: string | number): void;
|
|
67
|
+
/**
|
|
68
|
+
* 设置属性
|
|
69
|
+
* @param key
|
|
70
|
+
* @param value
|
|
71
|
+
*/
|
|
72
|
+
set(key: string | number, value: any): void;
|
|
73
|
+
/**
|
|
74
|
+
* 获取属性
|
|
75
|
+
*
|
|
76
|
+
* @param key
|
|
77
|
+
* @param defaultValue
|
|
78
|
+
*/
|
|
79
|
+
get(key: string | number, defaultValue?: any): any;
|
|
80
|
+
/**
|
|
81
|
+
* 获取属性
|
|
82
|
+
*
|
|
83
|
+
* @param key
|
|
84
|
+
* @param defaultValue
|
|
85
|
+
*/
|
|
86
|
+
getForParent(key: string | number, defaultValue?: any): any;
|
|
87
|
+
/**
|
|
88
|
+
* 获取self属性
|
|
89
|
+
* @param key
|
|
90
|
+
* @returns
|
|
91
|
+
*/
|
|
92
|
+
getForSelf(key: string | number): any;
|
|
93
|
+
/**
|
|
94
|
+
* 从继承关系中获取属性集合
|
|
95
|
+
* @param key
|
|
96
|
+
*/
|
|
97
|
+
getAll(key: string | number): any[];
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* 获取root domain
|
|
101
|
+
* @returns
|
|
102
|
+
*/
|
|
103
|
+
export declare function getRootDomain(): Domain;
|
|
104
|
+
/**
|
|
105
|
+
* 获取当前domain
|
|
106
|
+
* @returns
|
|
107
|
+
*/
|
|
108
|
+
export declare function useDomain(instance?: ComponentInternalInstance | null): Domain | null;
|
|
109
|
+
/**
|
|
110
|
+
* 安装domain
|
|
111
|
+
* @param name 名称
|
|
112
|
+
* @param props 属性
|
|
113
|
+
* @param ignores 忽略的属性
|
|
114
|
+
* @param exposes 暴露的方法
|
|
115
|
+
* @returns
|
|
116
|
+
*/
|
|
117
|
+
export declare function defineDomain(name: string | null, props: Record<string, any>, ignores?: any[], exposes?: Record<string, BroadcastCallback>): Domain;
|
|
118
|
+
/**
|
|
119
|
+
* domain item
|
|
120
|
+
*/
|
|
121
|
+
export interface DomainItem {
|
|
122
|
+
broadcast: Broadcast;
|
|
123
|
+
validateSchema: ValidateSchema;
|
|
124
|
+
emitEvent: {
|
|
125
|
+
(type: string, ...args: any[]): void;
|
|
126
|
+
};
|
|
127
|
+
onEvent: {
|
|
128
|
+
(type: string, listener: EventListener): void;
|
|
129
|
+
};
|
|
130
|
+
offEvent: {
|
|
131
|
+
(type: string, listener: EventListener): void;
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* 定义domain item
|
|
136
|
+
* @returns
|
|
137
|
+
*/
|
|
138
|
+
export declare function defineItem(descriptor: Descriptor, name?: string, exposes?: Record<string, BroadcastCallback>): DomainItem;
|
|
139
|
+
/**
|
|
140
|
+
* 定义domain data item
|
|
141
|
+
* @returns
|
|
142
|
+
*/
|
|
143
|
+
export declare function defineDataItem(domain: Domain, name: string, descriptor: Descriptor, parentBroadcast: Broadcast, parentValidateSchema: ValidateSchema): {
|
|
144
|
+
broadcast: Broadcast;
|
|
145
|
+
validateSchema: ValidateSchema;
|
|
146
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ComponentPublicInstance } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* event emitter key
|
|
4
|
+
*/
|
|
5
|
+
export declare const EventEmitterKey: unique symbol;
|
|
6
|
+
/**
|
|
7
|
+
* event listener
|
|
8
|
+
*/
|
|
9
|
+
export interface EventListener {
|
|
10
|
+
(...args: any[]): void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* event emitter
|
|
14
|
+
*/
|
|
15
|
+
export declare class EventEmitter {
|
|
16
|
+
/**
|
|
17
|
+
* 监听器
|
|
18
|
+
*/
|
|
19
|
+
private register;
|
|
20
|
+
/**
|
|
21
|
+
* componenet instance
|
|
22
|
+
*/
|
|
23
|
+
private proxy;
|
|
24
|
+
/**
|
|
25
|
+
* 构造函数
|
|
26
|
+
* @param proxy
|
|
27
|
+
*/
|
|
28
|
+
constructor(proxy: ComponentPublicInstance);
|
|
29
|
+
/**
|
|
30
|
+
* 销毁
|
|
31
|
+
*/
|
|
32
|
+
destroy(): void;
|
|
33
|
+
/**
|
|
34
|
+
* 注销监听事件
|
|
35
|
+
* @param type
|
|
36
|
+
* @param listener
|
|
37
|
+
*/
|
|
38
|
+
off(type: string, listener: EventListener): void;
|
|
39
|
+
/**
|
|
40
|
+
* 注册监听事件
|
|
41
|
+
* @param type
|
|
42
|
+
* @param listener
|
|
43
|
+
*/
|
|
44
|
+
on(type: string, listener: EventListener): void;
|
|
45
|
+
/**
|
|
46
|
+
* 触发事件
|
|
47
|
+
* @param type
|
|
48
|
+
* @param args
|
|
49
|
+
*/
|
|
50
|
+
emit(type: string, ...args: any[]): void;
|
|
51
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { Domain } from './domain';
|
|
3
|
+
/**
|
|
4
|
+
* 获取group scope的值
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
export declare function injectGroupScope(): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* 设置group scope的值
|
|
10
|
+
* @param flag
|
|
11
|
+
*/
|
|
12
|
+
export declare function provideGroupScope(flag?: boolean): void;
|
|
13
|
+
/**
|
|
14
|
+
* Layout信息接口
|
|
15
|
+
*/
|
|
16
|
+
export interface GroupLayout {
|
|
17
|
+
type: string;
|
|
18
|
+
width: number;
|
|
19
|
+
column: number;
|
|
20
|
+
gutter: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 创建group state
|
|
24
|
+
*
|
|
25
|
+
* @param domain
|
|
26
|
+
*/
|
|
27
|
+
export declare function createGroupState(domain: Domain, props?: Partial<GroupLayout>): {
|
|
28
|
+
layout: Ref<GroupLayout>;
|
|
29
|
+
passport: number;
|
|
30
|
+
order: {
|
|
31
|
+
index: number;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* 更新group layout
|
|
36
|
+
* @param domain
|
|
37
|
+
* @param width
|
|
38
|
+
* @param column
|
|
39
|
+
* @param gutter
|
|
40
|
+
* @param immediate
|
|
41
|
+
*/
|
|
42
|
+
export declare function updateGroupLayout(domain: Domain, width: number | string, column?: number | string, gutter?: number | string, immediate?: boolean, minItemWidth?: number): void;
|
|
43
|
+
/**
|
|
44
|
+
* 获取 group layout
|
|
45
|
+
* @param domain
|
|
46
|
+
*/
|
|
47
|
+
export declare function getGroupLayout(domain: Domain, inGroupItem?: boolean): Ref<GroupLayout>;
|
|
48
|
+
/**
|
|
49
|
+
* 获取 group layout
|
|
50
|
+
* @param domain
|
|
51
|
+
*/
|
|
52
|
+
export declare function getGroupOrder(domain: Domain, inGroupItem?: boolean): {
|
|
53
|
+
index: number;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* 获取item width
|
|
57
|
+
* @param column
|
|
58
|
+
* @param n
|
|
59
|
+
* @returns
|
|
60
|
+
*/
|
|
61
|
+
export declare function getItemPercentageWidth(column: number, n?: number | string): number;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Ref, UnwrapRef } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* 优先策略
|
|
4
|
+
*/
|
|
5
|
+
export declare enum PriorityPolicy {
|
|
6
|
+
Parent = 0,
|
|
7
|
+
Near = 1
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 是否接受value过滤器
|
|
11
|
+
*/
|
|
12
|
+
export interface AcceptFilter {
|
|
13
|
+
(value: any): boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 属性
|
|
17
|
+
* @param source
|
|
18
|
+
* @param name
|
|
19
|
+
* @param policy
|
|
20
|
+
* @param filter
|
|
21
|
+
*/
|
|
22
|
+
export declare function property(source: Ref, name: string, policy?: PriorityPolicy, filter?: AcceptFilter): Ref;
|
|
23
|
+
/**
|
|
24
|
+
* 只读属性
|
|
25
|
+
* @param source
|
|
26
|
+
*/
|
|
27
|
+
export declare function readonlyProperty(source: Ref): Ref;
|
|
28
|
+
/**
|
|
29
|
+
* 禁用属性
|
|
30
|
+
* @param source
|
|
31
|
+
*/
|
|
32
|
+
export declare function disabledProperty(source: Ref): Ref;
|
|
33
|
+
/**
|
|
34
|
+
* value 格式话
|
|
35
|
+
*/
|
|
36
|
+
export interface ValueFormat<T, K> {
|
|
37
|
+
(value: T): K;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* to model value
|
|
41
|
+
* @param props
|
|
42
|
+
* @param format
|
|
43
|
+
* @returns
|
|
44
|
+
*/
|
|
45
|
+
export declare function toValue(props: UnwrapRef<Record<string, any>>, name?: string, format?: ValueFormat<any, any>): Ref;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { Domain } from './domain';
|
|
2
|
+
import { UnwrapNestedRefs } from 'vue';
|
|
3
|
+
/**
|
|
4
|
+
* 安全区域
|
|
5
|
+
*/
|
|
6
|
+
export interface SafeAreaInset {
|
|
7
|
+
left: number | string;
|
|
8
|
+
top: number | string;
|
|
9
|
+
right: number | string;
|
|
10
|
+
bottom: number | string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* padding
|
|
14
|
+
*/
|
|
15
|
+
export interface Padding {
|
|
16
|
+
left: number | null;
|
|
17
|
+
top: number | null;
|
|
18
|
+
right: number | null;
|
|
19
|
+
bottom: number | null;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* page layout
|
|
23
|
+
*/
|
|
24
|
+
export interface PageLayout {
|
|
25
|
+
width: number | string;
|
|
26
|
+
height?: number | string;
|
|
27
|
+
headerHeight: number | string;
|
|
28
|
+
footerHeight: number | string;
|
|
29
|
+
headerPadding?: Padding;
|
|
30
|
+
footerPadding?: Padding;
|
|
31
|
+
contentPadding?: Padding;
|
|
32
|
+
}
|
|
33
|
+
export interface PageState {
|
|
34
|
+
width: number;
|
|
35
|
+
height: number;
|
|
36
|
+
headerHeight: number;
|
|
37
|
+
headerPadding: Padding;
|
|
38
|
+
footerHeight: number;
|
|
39
|
+
footerPadding: Padding;
|
|
40
|
+
contentHeight: number | string | null;
|
|
41
|
+
contentPadding: Padding;
|
|
42
|
+
safeAreaTop: number;
|
|
43
|
+
safeAreaBottom: number;
|
|
44
|
+
safeAreaLeft: number;
|
|
45
|
+
safeAreaRight: number;
|
|
46
|
+
headerMounted?: boolean;
|
|
47
|
+
footerMounted?: boolean;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* 转换为number rect
|
|
51
|
+
*/
|
|
52
|
+
export declare function toPadding(rect: any): Padding;
|
|
53
|
+
/**
|
|
54
|
+
* 更新 page state
|
|
55
|
+
* @param state
|
|
56
|
+
* @param pageLayout
|
|
57
|
+
* @param overrideProps
|
|
58
|
+
*/
|
|
59
|
+
export declare function updatePageState(state: PageState, pageLayout: any, overrideProps?: Record<string, unknown>, root?: boolean, rootWidth?: number, rootHeight?: number, headerBarHeight?: number, footerBarHeight?: number): void;
|
|
60
|
+
/**
|
|
61
|
+
* 创建page state
|
|
62
|
+
*
|
|
63
|
+
* @param domain
|
|
64
|
+
* @param overrideProps
|
|
65
|
+
*/
|
|
66
|
+
export declare function definePageState(domain: Domain, overrideProps?: Record<string, unknown>): UnwrapNestedRefs<PageState> | null;
|
|
67
|
+
/**
|
|
68
|
+
* 获取page state
|
|
69
|
+
* @param domain
|
|
70
|
+
* @returns
|
|
71
|
+
*/
|
|
72
|
+
export declare function usePageState(domain: Domain): PageState | null;
|
|
73
|
+
/**
|
|
74
|
+
* 获取page header区域高度(headerHeight + SafeAreaTop )
|
|
75
|
+
* @param domain
|
|
76
|
+
* @param state
|
|
77
|
+
* @returns
|
|
78
|
+
*/
|
|
79
|
+
export declare function getPageHeaderAreaHeight(domain: Domain, state?: PageState): number;
|
|
80
|
+
/**
|
|
81
|
+
* 获取page footer区域高度(footerHeight + SafeAreaBottom )
|
|
82
|
+
* @param domain
|
|
83
|
+
* @param state
|
|
84
|
+
* @returns
|
|
85
|
+
*/
|
|
86
|
+
export declare function getPageFooterAreaHeight(domain: Domain, state?: PageState): number;
|
|
87
|
+
/**
|
|
88
|
+
* 获取page content区域高度(pageHeight - headerHeight - footerHeight - padding )
|
|
89
|
+
* @param domain
|
|
90
|
+
* @param state
|
|
91
|
+
* @returns
|
|
92
|
+
*/
|
|
93
|
+
export declare function getPageContentAreaHeight(domain: Domain, state?: PageState): number;
|
|
94
|
+
/**
|
|
95
|
+
* 获取page content区域宽度(pageWidth - padding )
|
|
96
|
+
* @param domain
|
|
97
|
+
* @param state
|
|
98
|
+
* @returns
|
|
99
|
+
*/
|
|
100
|
+
export declare function getPageContentAreaWidth(domain: Domain, state?: PageState): number;
|
|
101
|
+
/**
|
|
102
|
+
* 是否为内嵌页面
|
|
103
|
+
* 内嵌页面为内嵌在容器内,如dialog,不需要设置content的高度
|
|
104
|
+
* @param domain
|
|
105
|
+
* @param proxy
|
|
106
|
+
* @returns
|
|
107
|
+
*/
|
|
108
|
+
export declare function isInnerPage(domain: Domain, proxy: any): boolean;
|
|
109
|
+
/**
|
|
110
|
+
* 是否子页面
|
|
111
|
+
* @param domain
|
|
112
|
+
*/
|
|
113
|
+
export declare function isSubPage(domain: Domain): boolean;
|