halo-fe 1.0.17 → 1.0.18
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/main.js +1855 -1777
- package/esm/coms/Code.vue.d.ts +41 -0
- package/esm/coms/Col.vue.d.ts +11 -0
- package/esm/coms/Compare.vue.d.ts +40 -0
- package/esm/coms/Container.vue.d.ts +23 -0
- package/esm/coms/RichText.vue.d.ts +24 -0
- package/esm/coms/Row.vue.d.ts +21 -0
- package/esm/coms/types/CodeEmit.d.ts +23 -0
- package/esm/coms/types/CodeProps.d.ts +18 -0
- package/esm/coms/types/RichTextOptions.d.ts +14 -0
- package/esm/coms/types/RichTextProps.d.ts +12 -0
- package/esm/coms/types/RowProps.d.ts +14 -0
- package/esm/drivers/IDriver.d.ts +10 -0
- package/esm/drivers/cdns/Cdn.d.ts +2 -2
- package/esm/drivers/cdns/implements/BootCdn.d.ts +12 -0
- package/esm/drivers/cdns/implements/JsdelivrCdn.d.ts +15 -0
- package/esm/drivers/cdns/implements/StaticFileCdn.d.ts +21 -0
- package/esm/drivers/cdns/implements/UnpkgCdn.d.ts +12 -0
- package/esm/drivers/factories/DriverFactory.d.ts +64 -0
- package/esm/drivers/factories/Factory.d.ts +18 -0
- package/esm/drivers/factories/IFactory.d.ts +18 -0
- package/esm/drivers/factories/index.d.ts +42 -0
- package/esm/drivers/providers/implements/StorageHelper.d.ts +34 -0
- package/esm/factorying/Factories.d.ts +5 -0
- package/esm/factorying/Factory.d.ts +1 -0
- package/esm/helpers/ArrayHelper.d.ts +4 -0
- package/esm/helpers/ScriptHelper.d.ts +19 -0
- package/esm/helpers/array-helper.d.ts +97 -0
- package/esm/helpers/component-helper.d.ts +18 -0
- package/esm/helpers/cookie-helper.d.ts +6 -0
- package/esm/helpers/dictionary-helper.d.ts +18 -0
- package/esm/helpers/dom-helper.d.ts +86 -0
- package/esm/helpers/event-helper.d.ts +30 -0
- package/esm/helpers/file-helper.d.ts +22 -0
- package/esm/helpers/html-helper.d.ts +10 -0
- package/esm/helpers/i18n-helper.d.ts +14 -0
- package/esm/helpers/image-helper.d.ts +10 -0
- package/esm/helpers/json-helper.d.ts +39 -0
- package/esm/helpers/math-helper.d.ts +46 -0
- package/esm/helpers/micro-helper.d.ts +10 -0
- package/esm/helpers/mount-helper.d.ts +14 -0
- package/esm/helpers/object-helper.d.ts +38 -0
- package/esm/helpers/script-helper.d.ts +31 -0
- package/esm/helpers/scroll-helper.d.ts +14 -0
- package/esm/helpers/sign-helper.d.ts +14 -0
- package/esm/helpers/storage-helper.d.ts +34 -0
- package/esm/helpers/string-helper.d.ts +94 -0
- package/esm/helpers/task-helper.d.ts +26 -0
- package/esm/helpers/time-helper.d.ts +66 -0
- package/esm/helpers/tree-helper.d.ts +54 -0
- package/esm/helpers/type-helper.d.ts +26 -0
- package/esm/helpers/url-helper.d.ts +96 -0
- package/esm/plugins/HtmlTransform.d.ts +6 -0
- package/esm/plugins/types/IMessager.d.ts +34 -0
- package/esm/plugins/types/index.d.ts +7 -0
- package/esm/services/ConfigService.d.ts +66 -0
- package/esm/services/DriverService.d.ts +36 -0
- package/esm/services/EnvService.d.ts +14 -0
- package/esm/services/LogService.d.ts +19 -0
- package/esm/services/SettingService.d.ts +42 -0
- package/esm/services/SocketService.d.ts +23 -0
- package/esm/services/UserService.d.ts +47 -0
- package/esm/services/index.d.ts +15 -0
- package/esm/services/types/IMessage.d.ts +14 -0
- package/esm/services/types/IMessager.d.ts +34 -0
- package/esm/services/types/index.d.ts +2 -0
- package/esm/servs/ConfigServ.d.ts +66 -0
- package/esm/servs/DriverServ.d.ts +36 -0
- package/esm/servs/EnvServ.d.ts +14 -0
- package/esm/servs/IServ.d.ts +6 -0
- package/esm/servs/LogServ.d.ts +19 -0
- package/esm/servs/Serv.d.ts +4 -0
- package/esm/servs/ServFactory.d.ts +11 -0
- package/esm/servs/SettingServ.d.ts +42 -0
- package/esm/servs/SocketServ.d.ts +38 -0
- package/esm/servs/UserServ.d.ts +47 -0
- package/esm/servs/implement/ConfigServ.d.ts +66 -0
- package/esm/servs/implement/DriverServ.d.ts +36 -0
- package/esm/servs/implement/EnvServ.d.ts +14 -0
- package/esm/servs/implement/LogServ.d.ts +19 -0
- package/esm/servs/implement/SettingServ.d.ts +42 -0
- package/esm/servs/implement/SocketServ.d.ts +38 -0
- package/esm/servs/implement/UserServ.d.ts +47 -0
- package/esm/servs/index.d.ts +15 -0
- package/esm/stores/config.d.ts +63 -0
- package/esm/stores/driver.d.ts +37 -0
- package/esm/stores/env.d.ts +12 -0
- package/esm/stores/index.d.ts +8 -0
- package/esm/stores/log.d.ts +20 -0
- package/esm/stores/setting.d.ts +43 -0
- package/esm/stores/socket.d.ts +27 -0
- package/esm/stores/user.d.ts +40 -0
- package/esm/svcs/SvcFactory.d.ts +4 -3
- package/esm/svcs/entities/AppConfig.d.ts +30 -0
- package/esm/svcs/entities/SysConfig.d.ts +8 -0
- package/esm/svcs/entities/UserConfig.d.ts +7 -0
- package/esm/svcs/entities/index.d.ts +4 -0
- package/esm/svcs/implement/ConfigSvc.d.ts +17 -28
- package/esm/svcs/implement/DriverSvc.d.ts +3 -1
- package/esm/svcs/implement/I18nSvc.d.ts +1 -1
- package/esm/svcs/index.d.ts +2 -1
- package/esm/svcs/types/Dictionary.d.ts +4 -0
- package/esm/svcs/types/index.d.ts +2 -0
- package/esm/types/CreateFeOptions.d.ts +1 -1
- package/esm/types/CreateOptions.d.ts +18 -0
- package/package.json +1 -1
- package/esm/drivers/builders/types/ProviderTable.d.ts +0 -6
- package/esm/drivers/builders/types/index.d.ts +0 -2
@@ -0,0 +1,97 @@
|
|
1
|
+
/**
|
2
|
+
* 数组帮助类
|
3
|
+
*/
|
4
|
+
declare class ArrayHelper {
|
5
|
+
/**
|
6
|
+
* 获取指定数组分成每片指定长度后的集合
|
7
|
+
*/
|
8
|
+
static getChunks: (arr: any[], chunkSize: number) => any[];
|
9
|
+
/**
|
10
|
+
* 取两个集合的交集
|
11
|
+
*/
|
12
|
+
static intersect: (arr1: any[], arr2: any[]) => any[];
|
13
|
+
/**
|
14
|
+
* 排除指定元素(差集)
|
15
|
+
*/
|
16
|
+
static except: (from: any[], target: any[] | any, equals?: (a: any, b: any) => boolean) => any[];
|
17
|
+
/**
|
18
|
+
* 是否包含
|
19
|
+
*/
|
20
|
+
static contains: (arr: any[], element: any) => boolean;
|
21
|
+
/**
|
22
|
+
* 判断指定集合中的指定属性的值,是否包含关键词
|
23
|
+
*/
|
24
|
+
static filterContains: (arr: any[], props: string[], keywords: string) => any[];
|
25
|
+
/**
|
26
|
+
* 判断2个数组是否每个元素都相同
|
27
|
+
*/
|
28
|
+
static same: (arr1: any[], arr2: any[]) => boolean;
|
29
|
+
/**
|
30
|
+
* 求最大值,数据类型的比较函数要自己转换为数值类型
|
31
|
+
*/
|
32
|
+
static max: (arr: any[], func: Function) => any;
|
33
|
+
/**
|
34
|
+
* 求最小值,数据类型的比较函数要自己转换为数值类型
|
35
|
+
*/
|
36
|
+
static min: (arr: any[], func: Function) => any;
|
37
|
+
/**
|
38
|
+
* 求和
|
39
|
+
*/
|
40
|
+
static sum: (arr: any[], func: Function, digits?: number) => number;
|
41
|
+
/**
|
42
|
+
* 求平均值
|
43
|
+
*/
|
44
|
+
static avg: (arr: any[], func: Function, digits?: number) => number;
|
45
|
+
/**
|
46
|
+
* 对数组元素根据指定函数进行去重,并返回去重后的值的新数组 n=>n.value
|
47
|
+
*/
|
48
|
+
static distinct: (arr: any[], selector: Function) => any[];
|
49
|
+
/**
|
50
|
+
* 不存在某元素时才添加某元素
|
51
|
+
*/
|
52
|
+
static pushIfNotExist: (arr: any[], element: any) => void;
|
53
|
+
/**
|
54
|
+
* 连接值构建成新数组,重复项也会自动构建,不存在的值,会自动创建为一个新项
|
55
|
+
*/
|
56
|
+
static fromValues: (arrValues: any[], arr: any[], propertyValue: string, propertyText: string) => any[];
|
57
|
+
/**
|
58
|
+
* 删除指定元素,并返回删除后的字符串
|
59
|
+
*/
|
60
|
+
static removeIndex: (str: string, index: number, split: string) => string;
|
61
|
+
/**
|
62
|
+
* 分割指定字符串为数组,字符串为空,返回空数组
|
63
|
+
* @param input
|
64
|
+
* @param split
|
65
|
+
* @param element 转换后添加的默认元素
|
66
|
+
*/
|
67
|
+
static split: (input: string, split: string, element?: any) => any[];
|
68
|
+
/**
|
69
|
+
* 合并多个数组中的每一项到新的二维数组中,没值的元素被有值的元素代替
|
70
|
+
*/
|
71
|
+
static combine: (...args: any[]) => any[];
|
72
|
+
/**
|
73
|
+
* 在指定元素前插入新元素,返回插入元素的索引
|
74
|
+
*/
|
75
|
+
static insert: (array: object[], selectedRow: object, row: object) => number;
|
76
|
+
/**
|
77
|
+
* 在指定元素后插入新元素,返回插入元素的索引
|
78
|
+
*/
|
79
|
+
static append: (array: object[], selectedRow: object, row: object) => number;
|
80
|
+
/**
|
81
|
+
* 删除执行数组中的指定对象或者集合
|
82
|
+
*/
|
83
|
+
static remove: (array: any[], elements: any[] | any) => void;
|
84
|
+
/**
|
85
|
+
* 按照指定函数对数组排序
|
86
|
+
*/
|
87
|
+
static orderBy: (array: any[], funcs: any, asc?: boolean) => any[];
|
88
|
+
/**
|
89
|
+
* 分组
|
90
|
+
*/
|
91
|
+
static groupByArray: (array: any[], keyFunc: (item: any) => any) => any[];
|
92
|
+
/**
|
93
|
+
* 分组,封装成字典而不是集合,大数据场景速度提升百倍
|
94
|
+
*/
|
95
|
+
static groupBy: (array: any[], keyFunc: (item: any) => any, valueHandler?: (item: any) => any) => object;
|
96
|
+
}
|
97
|
+
export default ArrayHelper;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
/**
|
2
|
+
* 组件帮助类
|
3
|
+
*/
|
4
|
+
declare class ComponentHelper {
|
5
|
+
/**
|
6
|
+
* 根据动态加载的组件对象,得到组件集合
|
7
|
+
*/
|
8
|
+
static getComponents(components: object, replace: string, prefix?: string): object;
|
9
|
+
/**
|
10
|
+
* 获取部分自定义组件名称
|
11
|
+
*/
|
12
|
+
static getName: (url: string, prefix: string) => string;
|
13
|
+
/**
|
14
|
+
* 检测异步控件是否加载完毕
|
15
|
+
*/
|
16
|
+
static detectLoaded(ref: any, cb: Function): void;
|
17
|
+
}
|
18
|
+
export default ComponentHelper;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
/**
|
2
|
+
* 字典帮助类
|
3
|
+
*/
|
4
|
+
declare class DictionaryHelper {
|
5
|
+
/**
|
6
|
+
* 从指定字典中提取忽略大小写的key的值
|
7
|
+
*/
|
8
|
+
static getValueIgnoreCase(key: string, value: object): string;
|
9
|
+
/**
|
10
|
+
* 对字典进行排序,并得到新字典
|
11
|
+
*/
|
12
|
+
static sort(obj: object): any;
|
13
|
+
/**
|
14
|
+
* 连接字典
|
15
|
+
*/
|
16
|
+
static join(obj: object, valueHandler?: (value: string) => string, delimiter?: string, join?: string): string;
|
17
|
+
}
|
18
|
+
export default DictionaryHelper;
|
@@ -0,0 +1,86 @@
|
|
1
|
+
/**
|
2
|
+
* Dom帮助类
|
3
|
+
*/
|
4
|
+
declare class DomHelper {
|
5
|
+
/**
|
6
|
+
* 根据字符串Ascii码得到固定颜色字典
|
7
|
+
*/
|
8
|
+
static getColors(values: string[]): object;
|
9
|
+
/**
|
10
|
+
* 获取样式名
|
11
|
+
*/
|
12
|
+
static getClass(...args: any[]): string;
|
13
|
+
/**
|
14
|
+
* 添加类
|
15
|
+
*/
|
16
|
+
static addClass: (dom: Element, cls: string, choice?: any) => void;
|
17
|
+
/**
|
18
|
+
* 删除类
|
19
|
+
*/
|
20
|
+
static removeClass: (selector: string | Element, className: string, except?: Element) => void;
|
21
|
+
/**
|
22
|
+
* 根据计算后的样式进行DOM过滤
|
23
|
+
*/
|
24
|
+
static filterStyle(doms: any[], fun: (style: CSSStyleDeclaration) => boolean): any[];
|
25
|
+
/**
|
26
|
+
* 添加样式
|
27
|
+
*/
|
28
|
+
static addStyle(dom: HTMLElement, prop: string, value: string): void;
|
29
|
+
/**
|
30
|
+
* 查找指定父节点
|
31
|
+
*/
|
32
|
+
static parentUntil(dom: any, cls: string): any;
|
33
|
+
/**
|
34
|
+
* 查找第一个绝对定位的元素或backdrop元素,否则使用html元素
|
35
|
+
*/
|
36
|
+
static parentAbsolute(dom: any): any;
|
37
|
+
/**
|
38
|
+
* 查找孩子节点
|
39
|
+
*/
|
40
|
+
static find(dom: Element, cls: string): Element;
|
41
|
+
/**
|
42
|
+
* 获取dom宽度或高度
|
43
|
+
*/
|
44
|
+
private static getWidthOrHeight;
|
45
|
+
/**
|
46
|
+
* 统计所有控件宽度,含外边距
|
47
|
+
*/
|
48
|
+
static getWidth(value: Element | Element[]): number;
|
49
|
+
/**
|
50
|
+
* 获取元素可用宽度(移除内填充)
|
51
|
+
*/
|
52
|
+
static getAvailableWidth(value: Element | Element[]): number;
|
53
|
+
/**
|
54
|
+
* 统计所有非固定定位控件高度,含内填充和外边距
|
55
|
+
*/
|
56
|
+
static getHeight(value: Element | Element[]): number;
|
57
|
+
/**
|
58
|
+
* 获取元素可用高度(移除内填充)
|
59
|
+
*/
|
60
|
+
static getAvailableHeight(value: Element | Element[]): number;
|
61
|
+
/**
|
62
|
+
* 获取指定元素在视口内的位置
|
63
|
+
*/
|
64
|
+
static getViewportStyle(target: Element, title: string, subMenu: string, viewport: Element, position: string): any;
|
65
|
+
/**
|
66
|
+
* 获取指定选择器最大的索引
|
67
|
+
*/
|
68
|
+
static getMaxIndex(selector: string): number;
|
69
|
+
/**
|
70
|
+
* 判断当前鼠标位置是否在指定范围之内
|
71
|
+
*/
|
72
|
+
static inRange(event: MouseEvent, x: number, y: number, width: number, height: number): boolean;
|
73
|
+
/**
|
74
|
+
* 创建指定标签的dom,并设置内容
|
75
|
+
*/
|
76
|
+
static create(name: string, cls?: string, html?: string): HTMLElement;
|
77
|
+
/**
|
78
|
+
* 不存在时创建dom,并自动追加到文档
|
79
|
+
*/
|
80
|
+
static createIfAbsent(name: string, cls: string, html?: string): HTMLElement;
|
81
|
+
/**
|
82
|
+
* 获取文本宽度
|
83
|
+
*/
|
84
|
+
static getTextWidth(value: string): number;
|
85
|
+
}
|
86
|
+
export default DomHelper;
|
@@ -0,0 +1,30 @@
|
|
1
|
+
/**
|
2
|
+
* 事件帮助类
|
3
|
+
*/
|
4
|
+
declare class EventHelper {
|
5
|
+
/**
|
6
|
+
* 批量绑定事件,执行指定处理函数
|
7
|
+
*/
|
8
|
+
static bind: (events: any[], dom: any, func: Function) => void;
|
9
|
+
/**
|
10
|
+
* 批量绑定事件,执行指定处理函数
|
11
|
+
*/
|
12
|
+
static unbind: (events: any[], dom: any, func: Function) => void;
|
13
|
+
/**
|
14
|
+
* 绑定点击处理函数
|
15
|
+
*/
|
16
|
+
static click: (dom: any, func: Function) => void;
|
17
|
+
/**
|
18
|
+
* 解除点击监听
|
19
|
+
*/
|
20
|
+
static unclick: (dom: any, func: Function) => void;
|
21
|
+
/**
|
22
|
+
* 绑定滚动处理函数
|
23
|
+
*/
|
24
|
+
static scroll: (dom: any, func: Function) => void;
|
25
|
+
/**
|
26
|
+
* 移除滚动处理函数,防止内存泄漏
|
27
|
+
*/
|
28
|
+
static unscroll: (dom: any, func: Function) => void;
|
29
|
+
}
|
30
|
+
export default EventHelper;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
/**
|
2
|
+
* 文件帮助类
|
3
|
+
*/
|
4
|
+
declare class FileHelper {
|
5
|
+
/**
|
6
|
+
* 保存文件
|
7
|
+
*/
|
8
|
+
static save: (base64: string, fileName: string) => void;
|
9
|
+
/**
|
10
|
+
* 获取文件扩展名
|
11
|
+
*/
|
12
|
+
static getExtension: (name: string) => string;
|
13
|
+
/**
|
14
|
+
* 判断当前文件名是否是excel文件
|
15
|
+
*/
|
16
|
+
static isExcel: (name: string) => boolean;
|
17
|
+
/**
|
18
|
+
* 判断当前文件是否是图片文件
|
19
|
+
*/
|
20
|
+
static isImage: (url: string) => boolean;
|
21
|
+
}
|
22
|
+
export default FileHelper;
|
@@ -0,0 +1,39 @@
|
|
1
|
+
declare type Prop = {
|
2
|
+
key: string;
|
3
|
+
type: string;
|
4
|
+
remark: string;
|
5
|
+
};
|
6
|
+
/**
|
7
|
+
* JSON帮助类
|
8
|
+
*/
|
9
|
+
declare class JsonHelper {
|
10
|
+
/**
|
11
|
+
* 把字符串格式化为Json字符串
|
12
|
+
*/
|
13
|
+
static stringify(value: any): string;
|
14
|
+
/**
|
15
|
+
* 对非字符串进行序列化
|
16
|
+
*/
|
17
|
+
static stringifyWithString(value: any): string;
|
18
|
+
/**
|
19
|
+
* 把字符串格式化为Json字符串
|
20
|
+
*/
|
21
|
+
static stringifyString(value: string): string;
|
22
|
+
/**
|
23
|
+
* 反序列化成json对象
|
24
|
+
*/
|
25
|
+
static parse(value: string): any;
|
26
|
+
/**
|
27
|
+
* 根据props中的.自动分割得到属性值
|
28
|
+
*/
|
29
|
+
static getValue(value: string, props: string): string;
|
30
|
+
/**
|
31
|
+
* 把json字符串合并到目标对象上
|
32
|
+
*/
|
33
|
+
static mergeTo(target: any, from: string): void;
|
34
|
+
/**
|
35
|
+
* 从树集合构建出Json对象
|
36
|
+
*/
|
37
|
+
static buildObject(tree: any[], childProp: string, fun: (node: any) => Prop): string;
|
38
|
+
}
|
39
|
+
export default JsonHelper;
|
@@ -0,0 +1,46 @@
|
|
1
|
+
/**
|
2
|
+
* 数学帮助类
|
3
|
+
*/
|
4
|
+
declare class MathHelper {
|
5
|
+
/**
|
6
|
+
* 过滤某一页数据
|
7
|
+
*/
|
8
|
+
static filterPage: (rows: any[], page: number, size: number) => any[];
|
9
|
+
/**
|
10
|
+
* 总页数
|
11
|
+
*/
|
12
|
+
static pageCount: (count: number, size: number) => number;
|
13
|
+
/**
|
14
|
+
* 四舍五入
|
15
|
+
*/
|
16
|
+
static round: (value: number, digits: number) => string;
|
17
|
+
/**
|
18
|
+
* 天花板函数
|
19
|
+
*/
|
20
|
+
static ceil: (value: number) => number;
|
21
|
+
/**
|
22
|
+
* 获取百分比
|
23
|
+
*/
|
24
|
+
static getPercentage: (current: number, total: number) => number;
|
25
|
+
/**
|
26
|
+
* 获取百分比,保留2位小数
|
27
|
+
*/
|
28
|
+
static getPercentageText: (current: number, total: number) => string;
|
29
|
+
/**
|
30
|
+
* 获取进度文本
|
31
|
+
*/
|
32
|
+
static getProgressText: (current: number, total: number) => string;
|
33
|
+
/**
|
34
|
+
* 获取大小
|
35
|
+
*/
|
36
|
+
static size: (bytes: number) => string;
|
37
|
+
/**
|
38
|
+
* 生成指定范围内的随机数
|
39
|
+
*/
|
40
|
+
static random(start: number, end: number): number;
|
41
|
+
/**
|
42
|
+
* 获取最大值
|
43
|
+
*/
|
44
|
+
static max(...values: number[]): number;
|
45
|
+
}
|
46
|
+
export default MathHelper;
|
@@ -0,0 +1,38 @@
|
|
1
|
+
/**
|
2
|
+
* 对象帮助类
|
3
|
+
*/
|
4
|
+
declare class ObjectHelper {
|
5
|
+
/**
|
6
|
+
* 净化对象,返回不带默认属性的对象
|
7
|
+
*/
|
8
|
+
static pure(input: object): {};
|
9
|
+
/**
|
10
|
+
* 过滤key,并输出新对象
|
11
|
+
*/
|
12
|
+
static filter(input: object, filter: (n: any) => boolean, valueHandler: (n: any) => {}): any[];
|
13
|
+
/**
|
14
|
+
* 把数组转换成对象
|
15
|
+
*/
|
16
|
+
static toObject(array: any[], keySelector: (n: any) => string, valueSelector: (n: any) => string): {};
|
17
|
+
/**
|
18
|
+
* 手动复制,并对字段执行指定自定义处理
|
19
|
+
*/
|
20
|
+
static copy: (obj: any, handler?: {}) => any[] | any;
|
21
|
+
/**
|
22
|
+
* 对对象进行深度克隆,同时可以移除Proxy对象
|
23
|
+
*/
|
24
|
+
static clone: (obj: any, handler?: (n: any) => void) => any;
|
25
|
+
/**
|
26
|
+
* 合并来源对象到目标对象上
|
27
|
+
*/
|
28
|
+
static mergeTo: (target: any, from: any) => any;
|
29
|
+
/**
|
30
|
+
* 给对象添加属性集合,并赋值
|
31
|
+
*/
|
32
|
+
static addProperties: (obj: object, keys: string[], value: string) => void;
|
33
|
+
/**
|
34
|
+
* 获取对象不区分大小写的key
|
35
|
+
*/
|
36
|
+
static getKey(value: object, key: string): string;
|
37
|
+
}
|
38
|
+
export default ObjectHelper;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
/**
|
2
|
+
* 脚本帮助类
|
3
|
+
*/
|
4
|
+
declare class ScriptHelper {
|
5
|
+
/**
|
6
|
+
* 异步加载脚本/样式内容,把内容处理为行内html
|
7
|
+
* 这种方式,依赖的内部资源,会从当前站点加载
|
8
|
+
*/
|
9
|
+
static loadContentAsync: (src: string | string[]) => Promise<void[]>;
|
10
|
+
/**
|
11
|
+
* 异步加载单个路径下的多个文件
|
12
|
+
*/
|
13
|
+
static loadPathAsync: (path: string, files: string[]) => Promise<void>;
|
14
|
+
/**
|
15
|
+
* 通过注入DOM标签异步加载脚本或样式表
|
16
|
+
*/
|
17
|
+
static loadAsync: (src: string | string[]) => Promise<void>;
|
18
|
+
/**
|
19
|
+
* 注意:箭头函数没有参数
|
20
|
+
*/
|
21
|
+
static loadAll: (...args: any[]) => Promise<any[]>;
|
22
|
+
/**
|
23
|
+
* 根据路径获取标签(无src)
|
24
|
+
*/
|
25
|
+
static getInnerTagByUrl: (url: string) => HTMLStyleElement | HTMLScriptElement;
|
26
|
+
/**
|
27
|
+
* 根据路径获取待加载的元素,同时包含Url
|
28
|
+
*/
|
29
|
+
static getOuterTagByUrl: (url: string) => HTMLLinkElement | HTMLScriptElement;
|
30
|
+
}
|
31
|
+
export default ScriptHelper;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
/**
|
2
|
+
* 滚动帮助类
|
3
|
+
*/
|
4
|
+
declare class ScrollHelper {
|
5
|
+
/**
|
6
|
+
* 判断指定元素滚动条位置,是否到了页面底部
|
7
|
+
*/
|
8
|
+
static isBottom: (selector: any) => boolean;
|
9
|
+
/**
|
10
|
+
* 滚动指定元素的滚动条到页面底部
|
11
|
+
*/
|
12
|
+
static scrollToBottom: (selector: any) => void;
|
13
|
+
}
|
14
|
+
export default ScrollHelper;
|
@@ -0,0 +1,34 @@
|
|
1
|
+
/**
|
2
|
+
* 存储帮助类
|
3
|
+
*/
|
4
|
+
declare class StorageHelper {
|
5
|
+
/**
|
6
|
+
* 获取本地存储
|
7
|
+
*/
|
8
|
+
static get: (key: string, value?: any) => any;
|
9
|
+
/**
|
10
|
+
* 设置本地存储
|
11
|
+
*/
|
12
|
+
static set: (key: string, value: string) => void;
|
13
|
+
/**
|
14
|
+
* 获取本地存储
|
15
|
+
*/
|
16
|
+
static getObject: (key: string) => any;
|
17
|
+
/**
|
18
|
+
* 设置本地存储
|
19
|
+
*/
|
20
|
+
static setObject: (key: string, value: any) => void;
|
21
|
+
/**
|
22
|
+
* 移除存储数据
|
23
|
+
*/
|
24
|
+
static remove: (key: string) => void;
|
25
|
+
/**
|
26
|
+
* 以5M为基准,获取剩余可用容量(KB)
|
27
|
+
*/
|
28
|
+
static getLeftStorage: () => number;
|
29
|
+
/**
|
30
|
+
* 判断指定值是否能够存储到storage中
|
31
|
+
*/
|
32
|
+
static canStorage: (value: object) => boolean;
|
33
|
+
}
|
34
|
+
export default StorageHelper;
|
@@ -0,0 +1,94 @@
|
|
1
|
+
/**
|
2
|
+
* 字符串帮助类
|
3
|
+
*/
|
4
|
+
declare class StringHelper {
|
5
|
+
/**
|
6
|
+
* 生成唯一字符串
|
7
|
+
*/
|
8
|
+
static getUniqueId: () => string;
|
9
|
+
/**
|
10
|
+
* 填充字符串到指定长度,使用pad填充
|
11
|
+
*/
|
12
|
+
static padLeft: (value: string, length: number, pad: string) => any;
|
13
|
+
/**
|
14
|
+
* 去掉头部字符串
|
15
|
+
*/
|
16
|
+
static trimStart: (value: string, trim: string) => string;
|
17
|
+
/**
|
18
|
+
* 去掉尾部字符串
|
19
|
+
*/
|
20
|
+
static trimEnd: (value: string, trim: string) => string;
|
21
|
+
/**
|
22
|
+
* 去掉头尾字符串
|
23
|
+
*/
|
24
|
+
static trim: (value: string, start: string, end: string) => string;
|
25
|
+
/**
|
26
|
+
* 获取中划线命名法
|
27
|
+
*/
|
28
|
+
static getDashName: (value: string) => string;
|
29
|
+
/**
|
30
|
+
* 忽略大小写包含判断,支持从数组中搜索关键词
|
31
|
+
*/
|
32
|
+
static containsIgnoreCase: (keywords: string, value: string | string[]) => boolean;
|
33
|
+
/**
|
34
|
+
* 从html中提取纯文本
|
35
|
+
*/
|
36
|
+
static getTextFromHtml: (html: string) => string;
|
37
|
+
/**
|
38
|
+
* 判断是否是数字类型,这样支持0
|
39
|
+
*/
|
40
|
+
static isNumber: (value: any) => boolean;
|
41
|
+
/**
|
42
|
+
* 验证是否是邮箱格式
|
43
|
+
*/
|
44
|
+
static isEmail: (email: string) => boolean;
|
45
|
+
/**
|
46
|
+
* 判断是否是json
|
47
|
+
*/
|
48
|
+
static isJson: (value: string) => boolean;
|
49
|
+
/**
|
50
|
+
* 判断是否是isJsonp
|
51
|
+
*/
|
52
|
+
static isJsonp: (value: string) => boolean;
|
53
|
+
/**
|
54
|
+
* 判断是否是html
|
55
|
+
*/
|
56
|
+
static isHtml: (value: string) => boolean;
|
57
|
+
/**
|
58
|
+
* 获取内容类型
|
59
|
+
*/
|
60
|
+
static getContentType: (value: string) => "json" | "html" | "text";
|
61
|
+
/**
|
62
|
+
* 判断字符串是否为空或空串
|
63
|
+
*/
|
64
|
+
static isNullOrEmpty: (value: string) => boolean;
|
65
|
+
/**
|
66
|
+
* 判断字符串是否为空或空串
|
67
|
+
*/
|
68
|
+
static isEmpty: (value: string) => value is "";
|
69
|
+
/**
|
70
|
+
* 判断是否符合密码要求
|
71
|
+
*/
|
72
|
+
static isPassword: (value: string) => boolean;
|
73
|
+
/**
|
74
|
+
* 获取数据值或者空
|
75
|
+
*/
|
76
|
+
static getNumberOrNull: (value: any) => number;
|
77
|
+
/**
|
78
|
+
* 格式化成留指定位数的小数
|
79
|
+
*/
|
80
|
+
static format: (value: string, digits: number) => any;
|
81
|
+
/**
|
82
|
+
* 获取两个字符串之间的字符串
|
83
|
+
*/
|
84
|
+
static getBetween: (value: string, start: string, end: string) => string;
|
85
|
+
/**
|
86
|
+
* 根据字符串或数组,自动返回数组
|
87
|
+
*/
|
88
|
+
static getArray(name: string | string[]): string[];
|
89
|
+
/**
|
90
|
+
* 忽略大小写比较
|
91
|
+
*/
|
92
|
+
static equalsIgnoreCase(value: any, valueCompare: string): boolean;
|
93
|
+
}
|
94
|
+
export default StringHelper;
|