halo-fe 1.0.20 → 1.0.22
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/main.js +983 -878
- package/dist/style.css +1 -1
- package/esm/coms/index.d.ts +1 -1
- package/esm/drivers/@types/IOpen.d.ts +1 -1
- package/esm/drivers/cdns/Cdn.d.ts +1 -1
- package/esm/drivers/https/Http.d.ts +15 -9
- package/esm/drivers/https/implements/DefaultHttp.d.ts +6 -0
- package/esm/drivers/https/implements/HaloHttp.d.ts +4 -12
- package/esm/drivers/https/implements/MkHttp.d.ts +2 -7
- package/esm/drivers/i18ns/I18n.d.ts +9 -5
- package/esm/drivers/i18ns/I18nFactory.d.ts +0 -4
- package/esm/drivers/i18ns/II18n.d.ts +14 -2
- package/esm/drivers/i18ns/implements/DefaultI18n.d.ts +1 -1
- package/esm/drivers/signers/Signer.d.ts +3 -0
- package/esm/factorying/index.d.ts +1 -5
- package/esm/helpers/StringHelper.d.ts +26 -18
- package/esm/main.d.ts +1 -1
- package/esm/svcs/@types/index.d.ts +1 -2
- package/esm/svcs/implement/ConfigSvc.d.ts +8 -4
- package/esm/svcs/index.d.ts +25 -30
- package/esm/utilities/MathUtility.d.ts +35 -0
- package/esm/utilities/RandomUtility.d.ts +40 -0
- package/esm/utilities/index.d.ts +2 -1
- package/package.json +1 -1
package/dist/style.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
html{-webkit-user-select:initial;user-select:initial;font-size:14px;font-family:Consolas}a{text-decoration:none}p{margin:0;line-height:20px}input{outline:none;margin:0;font-family:inherit}ul,ol{margin:0;padding:0;outline:none}li{list-style-type:none}img{display:block}pre{margin:0;font-family:inherit}html.blue .ha-rich-text .ql-toolbar.ql-snow{border:1px solid #434e61;box-shadow:0 1px 4px #29374d;background-image:linear-gradient(to bottom,#354052,#354052)}html.blue .ha-rich-text .ql-container.ql-snow{border-color:#434e61;background:#354052}html.blue .ha-rich-text .ql-stroke{stroke:#ffffffb8}html.blue .ha-rich-text .ql-fill{fill:#ffffffb8}html.blue .ha-rich-text .ql-picker .ql-picker-label,html.blue .ha-rich-text .ql-date{color:#ffffffb8}html.light .ha-rich-text .ql-toolbar.ql-snow{border:1px solid #dcdfe6;box-shadow:0 1px 4px #ccc9;background-image:linear-gradient(to bottom,#fff,#f2f2f2)}html.light .ha-rich-text .ql-container.ql-snow{border-color:#dcdfe6}.ha-fill{width:100%}.ha-scroller{position:relative;height:100%}.ha-scroller:hover .scroller-thumb{display:block}.ha-scroller.hover .scroller-thumb{display:block;opacity:.5}.ha-scroller .scroller-container{height:100%;overflow:auto;width:100%;scrollbar-width:none}.ha-scroller .scroller-track{position:absolute;top:0;right:0;width:8px;height:100%}.ha-scroller .scroller-thumb{display:none;position:absolute;cursor:pointer;height:30px;width:100%;-webkit-user-select:none;user-select:none;background:#a3a6ad;opacity:.3;border-radius:5px}.ha-scroller .scroller-thumb:hover{opacity:.5}.ha-code{width:100%;height:100%}.ha-code.border{width:calc(100% - 2px);height:calc(100% - 2px);border-radius:4px}.ha-code.border .monaco-editor,.ha-code.border .overflow-guard{border-radius:4px}.ha-code.border:has(.monaco-editor.focused){border:1px solid #007fd4}.ha-compare{width:100%;height:100%}.ha-rich-text{
|
1
|
+
html{-webkit-user-select:initial;user-select:initial;font-size:14px;font-family:Consolas}a{text-decoration:none}p{margin:0;line-height:20px}input{outline:none;margin:0;font-family:inherit}ul,ol{margin:0;padding:0;outline:none}li{list-style-type:none}img{display:block}pre{margin:0;font-family:inherit}html.blue .ha-rich-text .ql-toolbar.ql-snow{border:1px solid #434e61;box-shadow:0 1px 4px #29374d;background-image:linear-gradient(to bottom,#354052,#354052)}html.blue .ha-rich-text .ql-container.ql-snow{border-color:#434e61;background:#354052}html.blue .ha-rich-text .ql-stroke{stroke:#ffffffb8}html.blue .ha-rich-text .ql-fill{fill:#ffffffb8}html.blue .ha-rich-text .ql-picker .ql-picker-label,html.blue .ha-rich-text .ql-date{color:#ffffffb8}html.light .ha-rich-text .ql-toolbar.ql-snow{border:1px solid #dcdfe6;box-shadow:0 1px 4px #ccc9;background-image:linear-gradient(to bottom,#fff,#f2f2f2)}html.light .ha-rich-text .ql-container.ql-snow{border-color:#dcdfe6}.ha-rich-text ol,.ha-rich-text ul{padding-left:1.5em}.ha-rich-text ol{counter-reset:my-counter}.ha-rich-text ol li{list-style-type:none;counter-increment:my-counter}.ha-rich-text ol li:before{content:counter(my-counter) "."}.ha-fill{width:100%}.ha-scroller{position:relative;height:100%}.ha-scroller:hover .scroller-thumb{display:block}.ha-scroller.hover .scroller-thumb{display:block;opacity:.5}.ha-scroller .scroller-container{height:100%;overflow:auto;width:100%;scrollbar-width:none}.ha-scroller .scroller-track{position:absolute;top:0;right:0;width:8px;height:100%}.ha-scroller .scroller-thumb{display:none;position:absolute;cursor:pointer;height:30px;width:100%;-webkit-user-select:none;user-select:none;background:#a3a6ad;opacity:.3;border-radius:5px}.ha-scroller .scroller-thumb:hover{opacity:.5}.ha-code{width:100%;height:100%}.ha-code.border{width:calc(100% - 2px);height:calc(100% - 2px);border-radius:4px}.ha-code.border .monaco-editor,.ha-code.border .overflow-guard{border-radius:4px}.ha-code.border:has(.monaco-editor.focused){border:1px solid #007fd4}.ha-compare{width:100%;height:100%}.ha-rich-text{width:100%}.ha-rich-text .ql-date{font-family:"Font Awesome 6 Free"}.ha-rich-text .ql-date:before{content:""}.ha-rich-text .ql-toolbar{line-height:20px}.ha-rich-text .ql-toolbar.ql-snow{padding:3px;position:sticky;top:0;z-index:10;border-top-left-radius:4px;border-top-right-radius:4px}.ha-rich-text .ql-body{border-bottom-left-radius:4px;border-bottom-right-radius:4px}.ha-rich-text .ql-container{height:auto}.ha-rich-text .ql-container.ql-snow{font-family:inherit;border:0}.ha-rich-text .ql-editor{padding:8px 8px 620px;word-break:break-word;overflow:initial}.ha-rich-text .ql-formats .ql-picker+.ql-picker{display:block!important}.ha-rich-text .ql-formats .ql-picker:has(+.ql-picker){display:none}.ha-rich-text:has(.ql-editor:focus) .ql-snow.ql-toolbar{border-color:#007fd4;border-bottom-color:#4c4d4f}.ha-rich-text:has(.ql-editor:focus) .ql-snow+.ql-body{border-color:#007fd4}.ha-condition{display:flex}.ha-col{display:flex;gap:5px}.ha-container{padding:10px;width:calc(100% - 20px);height:calc(100% - 20px)}.ha-container .ha-operation:nth-child(1){margin-top:0;margin-bottom:10px;padding:8px 10px;line-height:32px}.ha-row{display:flex;gap:5px}.ha-row.between{justify-content:space-between}.ha-progress{position:absolute;width:0;z-index:1}.ha-socket-progress{width:100%;display:flex;line-height:24px;gap:5px}.ha-socket-progress .progress-tips{display:flex;gap:5px}.ha-socket-progress .progress-tip{font-size:12px;padding:0 8px;border-radius:4px}.ha-socket-progress .progress-tip.info{color:#409eff;background:#18222c;border:1px solid #1d3043}.ha-socket-progress .progress-tip.success{color:#67c23a;background:#1c2518;border:1px solid #25371c}.ha-socket-progress .progress-tip.error{color:#f56c6c;background:#2b1d1d;border:1px solid #412626}.ha-socket-progress .progress-chart{display:flex;flex:1;align-items:center;gap:5px}.ha-socket-progress .progress-bar{height:6px;background:#363637;width:100%;border-radius:4px}.ha-socket-progress .progress-percentage{height:100%;background:#67c23a;transition:width .5s;border-radius:4px}.ha-socket-progress .progress-text{color:#cfd3dc}.ha-socket-progress.error .progress-percentage{background:#f56c6c}.ha-socket-progress.error .progress-text{color:#f56c6c}
|
package/esm/coms/index.d.ts
CHANGED
@@ -2,11 +2,11 @@ import HaEmpty from "./Empty.vue";
|
|
2
2
|
import HaFill from "./Fill.vue";
|
3
3
|
import HaScroller from "./Scroller.vue";
|
4
4
|
import HaTimer from "./Timer.vue";
|
5
|
+
export * from "./@types";
|
5
6
|
export * from "./conditions";
|
6
7
|
export * from "./controls";
|
7
8
|
export * from "./layouts";
|
8
9
|
export * from "./progresses";
|
9
10
|
export * from "./tables";
|
10
11
|
export * from "./tabs";
|
11
|
-
export * from "./@types";
|
12
12
|
export { HaEmpty, HaFill, HaScroller, HaTimer };
|
@@ -11,7 +11,7 @@ declare abstract class Cdn implements ICdn {
|
|
11
11
|
task: ITask;
|
12
12
|
open(conn: string): Promise<void>;
|
13
13
|
abstract getCrypto(): Promise<any>;
|
14
|
-
|
14
|
+
getECharts(basePath?: string): Promise<any>;
|
15
15
|
abstract getElementPlus(): Promise<any>;
|
16
16
|
abstract getFortAwesome(): Promise<any>;
|
17
17
|
getMonaco(baseUrl?: string): Promise<any>;
|
@@ -6,19 +6,25 @@ import HttpResponse from "./entities/HttpResponse";
|
|
6
6
|
*/
|
7
7
|
declare abstract class Http implements IHttp {
|
8
8
|
type: string;
|
9
|
+
/**
|
10
|
+
* 默认请求器
|
11
|
+
*/
|
12
|
+
http: IHttp;
|
9
13
|
open(conn: string): Promise<void>;
|
10
|
-
onRequest: (request: HttpRequest) => Promise<void>;
|
11
|
-
|
12
|
-
get(
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
get onRequest(): (request: HttpRequest) => Promise<void>;
|
15
|
+
set onRequest(value: (request: HttpRequest) => Promise<void>);
|
16
|
+
get onResponse(): (response: HttpResponse) => Promise<void>;
|
17
|
+
set onResponse(value: (response: HttpResponse) => Promise<void>);
|
18
|
+
get: (path: string, params?: any) => Promise<any>;
|
19
|
+
sendGet: (path: string, params?: any) => Promise<HttpResponse>;
|
20
|
+
post: (path: string, body: any) => Promise<any>;
|
21
|
+
sendPost: (path: string, body?: any) => Promise<HttpResponse>;
|
22
|
+
patch: (path: string) => Promise<any>;
|
23
|
+
sendPatch: (path: string, pairs?: any) => Promise<HttpResponse>;
|
18
24
|
abstract send(request: HttpRequest): Promise<HttpResponse>;
|
19
25
|
/**
|
20
26
|
* 获取请求消息
|
21
27
|
*/
|
22
|
-
getRequest(method: string, contentType: string, path: string, body?: any)
|
28
|
+
getRequest: (method: string, contentType: string, path: string, body?: any) => HttpRequest;
|
23
29
|
}
|
24
30
|
export default Http;
|
@@ -8,6 +8,12 @@ import HttpResponse from "../entities/HttpResponse";
|
|
8
8
|
declare class DefaultHttp extends Http {
|
9
9
|
type: string;
|
10
10
|
baseUrl: string;
|
11
|
+
_onRequest: any;
|
12
|
+
_onResponse: any;
|
13
|
+
get onRequest(): (request: HttpRequest) => Promise<void>;
|
14
|
+
set onRequest(value: (request: HttpRequest) => Promise<void>);
|
15
|
+
get onResponse(): (response: HttpResponse) => Promise<void>;
|
16
|
+
set onResponse(value: (response: HttpResponse) => Promise<void>);
|
11
17
|
send(request: HttpRequest): Promise<HttpResponse>;
|
12
18
|
/**
|
13
19
|
* 使用Fetch发送请求,谷歌插件场景专用
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import Http from "../Http";
|
2
2
|
import HttpRequest from "../entities/HttpRequest";
|
3
3
|
import HttpResponse from "../entities/HttpResponse";
|
4
|
-
import IHttp from "../IHttp";
|
5
4
|
import { ISso, SsoUser } from "../../ssos";
|
6
5
|
import { ISigner } from "../../signers";
|
7
6
|
/**
|
@@ -29,10 +28,6 @@ declare class HaloHttp extends Http {
|
|
29
28
|
* 当前终端
|
30
29
|
*/
|
31
30
|
platform: string;
|
32
|
-
/**
|
33
|
-
* 默认请求器
|
34
|
-
*/
|
35
|
-
http: IHttp;
|
36
31
|
/**
|
37
32
|
* 单点登录配置
|
38
33
|
*/
|
@@ -41,21 +36,18 @@ declare class HaloHttp extends Http {
|
|
41
36
|
* 单点登录配置
|
42
37
|
*/
|
43
38
|
signer: ISigner;
|
44
|
-
|
45
|
-
* 开启
|
46
|
-
*/
|
47
|
-
open(conn: string): Promise<void>;
|
39
|
+
open: (conn: string) => Promise<void>;
|
48
40
|
/**
|
49
41
|
* 发送请求
|
50
42
|
*/
|
51
|
-
send(request: HttpRequest)
|
43
|
+
send: (request: HttpRequest) => Promise<HttpResponse>;
|
52
44
|
/**
|
53
45
|
* 请求预处理
|
54
46
|
*/
|
55
|
-
beforeRequest(request: HttpRequest)
|
47
|
+
beforeRequest: (request: HttpRequest) => Promise<void>;
|
56
48
|
/**
|
57
49
|
* 处理网络错误和响应错误场景
|
58
50
|
*/
|
59
|
-
handleError(error: any)
|
51
|
+
handleError: (error: any) => Promise<never>;
|
60
52
|
}
|
61
53
|
export default HaloHttp;
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import Http from "../Http";
|
2
2
|
import HttpRequest from "../entities/HttpRequest";
|
3
3
|
import HttpResponse from "../entities/HttpResponse";
|
4
|
-
import IHttp from "../IHttp";
|
5
4
|
import { IHasher } from "../../hashers";
|
6
5
|
/**
|
7
6
|
* MK请求器
|
@@ -20,10 +19,6 @@ declare class MkHttp extends Http {
|
|
20
19
|
* AppSecret
|
21
20
|
*/
|
22
21
|
appSecret: string;
|
23
|
-
/**
|
24
|
-
* 默认请求器
|
25
|
-
*/
|
26
|
-
requester: IHttp;
|
27
22
|
/**
|
28
23
|
* Hash计算器
|
29
24
|
*/
|
@@ -31,10 +26,10 @@ declare class MkHttp extends Http {
|
|
31
26
|
/**
|
32
27
|
* 危险操作,会暴露敏感信息
|
33
28
|
*/
|
34
|
-
open(conn: string)
|
29
|
+
open: (conn: string) => Promise<void>;
|
35
30
|
/**
|
36
31
|
* 危险操作,会暴露敏感信息
|
37
32
|
*/
|
38
|
-
send(request: HttpRequest)
|
33
|
+
send: (request: HttpRequest) => Promise<HttpResponse>;
|
39
34
|
}
|
40
35
|
export default MkHttp;
|
@@ -1,10 +1,17 @@
|
|
1
1
|
import II18n from "./II18n";
|
2
|
+
/**
|
3
|
+
* 多语言翻译基类
|
4
|
+
*/
|
2
5
|
declare abstract class I18n implements II18n {
|
3
6
|
type: string;
|
4
7
|
lang: string;
|
5
8
|
messages: {
|
6
9
|
[key: string]: any;
|
7
10
|
};
|
11
|
+
/**
|
12
|
+
* 已加载的语言集合
|
13
|
+
*/
|
14
|
+
loaded: string[];
|
8
15
|
open(conn?: string): Promise<void>;
|
9
16
|
t: (key: string, params?: any) => string;
|
10
17
|
abstract translate(key: string, params: any): string;
|
@@ -29,10 +36,7 @@ declare abstract class I18n implements II18n {
|
|
29
36
|
addMessages: (messages: {
|
30
37
|
[key: string]: string;
|
31
38
|
}) => void;
|
32
|
-
abstract
|
33
|
-
|
34
|
-
* 切换语言,自动加载菜单
|
35
|
-
*/
|
36
|
-
switchI18n: (lang: string) => Promise<void>;
|
39
|
+
abstract load(lang: string): Promise<void>;
|
40
|
+
switch: (lang: string) => Promise<void>;
|
37
41
|
}
|
38
42
|
export default I18n;
|
@@ -58,6 +58,14 @@ interface II18n extends IDriver, IOpen {
|
|
58
58
|
* 系统标题
|
59
59
|
*/
|
60
60
|
t_title(): string;
|
61
|
+
/**
|
62
|
+
* 设置多语言标题
|
63
|
+
*/
|
64
|
+
setI18nTitle(key: string): void;
|
65
|
+
/**
|
66
|
+
* 设置标题
|
67
|
+
*/
|
68
|
+
setTitle(title: string, env: string): void;
|
61
69
|
/**
|
62
70
|
* 添加自定义多语言包
|
63
71
|
*/
|
@@ -65,8 +73,12 @@ interface II18n extends IDriver, IOpen {
|
|
65
73
|
[key: string]: string;
|
66
74
|
}): void;
|
67
75
|
/**
|
68
|
-
*
|
76
|
+
* 加载指定语言包,需http请求器先加载完毕
|
77
|
+
*/
|
78
|
+
load(lang: string): Promise<void>;
|
79
|
+
/**
|
80
|
+
* 切换语言,自动加载菜单
|
69
81
|
*/
|
70
|
-
|
82
|
+
switch(lang: string): Promise<void>;
|
71
83
|
}
|
72
84
|
export default II18n;
|
@@ -8,6 +8,6 @@ declare class DefaultI18n extends I18n {
|
|
8
8
|
open(conn?: string): Promise<void>;
|
9
9
|
translate: (key: string, params?: any) => string;
|
10
10
|
t_exists: (key: string) => boolean;
|
11
|
-
|
11
|
+
load: (lang: string) => Promise<void>;
|
12
12
|
}
|
13
13
|
export default DefaultI18n;
|
@@ -33,12 +33,8 @@ declare let messenger: IMessenger;
|
|
33
33
|
* 初始化默认驱动实例
|
34
34
|
*/
|
35
35
|
declare let initDriver: (options: CreateFeOptions) => Promise<void>;
|
36
|
-
/**
|
37
|
-
* 设置好请求器后,才可以设置多语言
|
38
|
-
*/
|
39
|
-
declare let initI18n: () => Promise<void>;
|
40
36
|
/**
|
41
37
|
* 提取可导出的翻译方法,当i18n实例变化后,导出的方案会跟着变化?
|
42
38
|
*/
|
43
39
|
declare let t: typeof i18n.t, t_exists: typeof i18n.t_exists, t_sys: typeof i18n.t_sys, t_enum: typeof i18n.t_enum, t_field: typeof i18n.t_field, t_field_choose_placeholder: typeof i18n.t_field_choose_placeholder, t_field_placeholder: typeof i18n.t_field_placeholder, t_table: typeof i18n.t_table, t_module: typeof i18n.t_module, t_menu: typeof i18n.t_menu;
|
44
|
-
export { base64, cdn, http, i18n, md5, template, messenger, initDriver,
|
40
|
+
export { base64, cdn, http, i18n, md5, template, messenger, initDriver, Factories, t, t_exists, t_sys, t_enum, t_field, t_field_choose_placeholder, t_field_placeholder, t_table, t_module, t_menu };
|
@@ -10,6 +10,10 @@ declare class StringHelper {
|
|
10
10
|
* 填充字符串到指定长度,使用pad填充
|
11
11
|
*/
|
12
12
|
static padLeft: (value: string, length: number, pad: string) => any;
|
13
|
+
/**
|
14
|
+
* 填充字符串到指定长度,使用pad填充
|
15
|
+
*/
|
16
|
+
static padStart: (input: string, length: number, pad: string) => string;
|
13
17
|
/**
|
14
18
|
* 去掉头部字符串
|
15
19
|
*/
|
@@ -27,9 +31,17 @@ declare class StringHelper {
|
|
27
31
|
*/
|
28
32
|
static getDashName: (value: string) => string;
|
29
33
|
/**
|
30
|
-
*
|
34
|
+
* 判断字符串是否为空或空串
|
31
35
|
*/
|
32
|
-
static
|
36
|
+
static isNullOrEmpty: (value: string) => boolean;
|
37
|
+
/**
|
38
|
+
* 判断字符串是否为空或空串
|
39
|
+
*/
|
40
|
+
static isEmpty: (value: string) => value is "";
|
41
|
+
/**
|
42
|
+
* 判断是否符合密码要求
|
43
|
+
*/
|
44
|
+
static isPassword: (value: string) => boolean;
|
33
45
|
/**
|
34
46
|
* 判断是否是数字类型,这样支持0
|
35
47
|
*/
|
@@ -51,29 +63,25 @@ declare class StringHelper {
|
|
51
63
|
*/
|
52
64
|
static isHtml: (value: string) => boolean;
|
53
65
|
/**
|
54
|
-
*
|
66
|
+
* 是否以字符串开头
|
55
67
|
*/
|
56
|
-
static
|
68
|
+
static startWith: (value: string, startWith: string) => boolean;
|
57
69
|
/**
|
58
|
-
*
|
70
|
+
* 忽略大小写包含判断,支持从数组中搜索关键词
|
59
71
|
*/
|
60
|
-
static
|
72
|
+
static containsIgnoreCase: (keywords: string, value: string | string[]) => boolean;
|
61
73
|
/**
|
62
|
-
*
|
74
|
+
* 忽略大小写比较
|
63
75
|
*/
|
64
|
-
static
|
76
|
+
static equalsIgnoreCase(value: any, valueCompare: string): boolean;
|
65
77
|
/**
|
66
|
-
*
|
78
|
+
* 获取内容类型
|
67
79
|
*/
|
68
|
-
static
|
80
|
+
static getContentType: (value: string) => "json" | "html" | "text";
|
69
81
|
/**
|
70
82
|
* 获取数据值或者空
|
71
83
|
*/
|
72
84
|
static getNumberOrNull: (value: any) => number;
|
73
|
-
/**
|
74
|
-
* 格式化成留指定位数的小数
|
75
|
-
*/
|
76
|
-
static format: (value: string, digits: number) => any;
|
77
85
|
/**
|
78
86
|
* 获取两个字符串之间的字符串
|
79
87
|
*/
|
@@ -83,12 +91,12 @@ declare class StringHelper {
|
|
83
91
|
*/
|
84
92
|
static getArray(name: string | string[]): string[];
|
85
93
|
/**
|
86
|
-
*
|
94
|
+
* 按占位符格式化成字符串
|
87
95
|
*/
|
88
|
-
static
|
96
|
+
static format: (value: string, placeholder: any) => string;
|
89
97
|
/**
|
90
|
-
*
|
98
|
+
* 格式化成留指定位数的小数
|
91
99
|
*/
|
92
|
-
static
|
100
|
+
static formatDigits: (value: string, digits: number) => string;
|
93
101
|
}
|
94
102
|
export default StringHelper;
|
package/esm/main.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import { CreateFeOptions } from "./@types";
|
2
2
|
import "./styles/index.scss";
|
3
|
+
export * from "./@types";
|
3
4
|
export * from "./coms";
|
4
5
|
export * from "./drivers";
|
5
6
|
export * from "./factorying";
|
@@ -7,7 +8,6 @@ export * from "./helpers";
|
|
7
8
|
export * from "./plugins";
|
8
9
|
export * from "./repos";
|
9
10
|
export * from "./svcs";
|
10
|
-
export * from "./@types";
|
11
11
|
export * from "./utilities";
|
12
12
|
/**
|
13
13
|
* 初始化前端基础框架
|
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
export { type IDictionary };
|
1
|
+
export {};
|
@@ -1,10 +1,11 @@
|
|
1
|
-
import { IDictionary } from "../@types";
|
2
1
|
import { SysConfig, UserConfig } from "../entities";
|
3
2
|
import Svc from "../Svc";
|
3
|
+
import type SettingSvc from "./SettingSvc";
|
4
4
|
/**
|
5
5
|
* 不一定跟用户相关,此时如果使用配置仓储,使用的是配置文件的配置,非接口配置
|
6
6
|
*/
|
7
|
-
declare class ConfigSvc extends Svc
|
7
|
+
declare class ConfigSvc extends Svc {
|
8
|
+
[key: string]: any;
|
8
9
|
type: string;
|
9
10
|
/**
|
10
11
|
* 用户系统配置
|
@@ -27,11 +28,14 @@ declare class ConfigSvc extends Svc implements IDictionary {
|
|
27
28
|
*/
|
28
29
|
completions: {};
|
29
30
|
};
|
30
|
-
|
31
|
+
/**
|
32
|
+
* 初始化绑定基础配置信息
|
33
|
+
*/
|
34
|
+
open: (svc: SettingSvc) => void;
|
31
35
|
/**
|
32
36
|
* 初始化配置值(不一定跟登录用户相关,这也是单独分离的好处)
|
33
37
|
*/
|
34
|
-
bind(configs: UserConfig[])
|
38
|
+
bind: (configs: UserConfig[]) => Promise<void>;
|
35
39
|
/**
|
36
40
|
* 尝试添加架构
|
37
41
|
*/
|
package/esm/svcs/index.d.ts
CHANGED
@@ -4,31 +4,6 @@ import LogSvc from "./implement/LogSvc";
|
|
4
4
|
import SocketSvc from "./implement/SocketSvc";
|
5
5
|
import UserSvc from "./implement/UserSvc";
|
6
6
|
import SvcFactory from "./SvcFactory";
|
7
|
-
import { CreateFeOptions } from "../@types";
|
8
|
-
/**
|
9
|
-
* 驱动服务实例
|
10
|
-
*/
|
11
|
-
declare let configSvc: ConfigSvc;
|
12
|
-
/**
|
13
|
-
* 包装配置服务,保证驱动服务具有响应式,并且不需.value后缀
|
14
|
-
*/
|
15
|
-
declare let driverSvc: {
|
16
|
-
type: string;
|
17
|
-
loaded: {
|
18
|
-
apps: boolean;
|
19
|
-
envs: boolean;
|
20
|
-
};
|
21
|
-
loading: {
|
22
|
-
apps: boolean;
|
23
|
-
envs: boolean;
|
24
|
-
};
|
25
|
-
apps: any[];
|
26
|
-
envs: any[];
|
27
|
-
loadApps: (reload?: boolean) => Promise<void>;
|
28
|
-
loadEnvs: (reload?: boolean) => Promise<void>;
|
29
|
-
};
|
30
|
-
declare let envSvc: EnvSvc;
|
31
|
-
declare let logSvc: LogSvc;
|
32
7
|
declare let settingSvc: {
|
33
8
|
loaded: boolean;
|
34
9
|
particles: boolean;
|
@@ -56,11 +31,31 @@ declare let settingSvc: {
|
|
56
31
|
init: () => Promise<void>;
|
57
32
|
load: () => Promise<any>;
|
58
33
|
};
|
59
|
-
declare let socketSvc: SocketSvc;
|
60
|
-
declare let userSvc: UserSvc;
|
61
34
|
/**
|
62
|
-
*
|
35
|
+
* 驱动服务实例
|
63
36
|
*/
|
64
|
-
declare let
|
37
|
+
declare let configSvc: ConfigSvc;
|
38
|
+
/**
|
39
|
+
* 包装配置服务,保证驱动服务具有响应式,并且不需.value后缀
|
40
|
+
*/
|
41
|
+
declare let driverSvc: {
|
42
|
+
type: string;
|
43
|
+
loaded: {
|
44
|
+
apps: boolean;
|
45
|
+
envs: boolean;
|
46
|
+
};
|
47
|
+
loading: {
|
48
|
+
apps: boolean;
|
49
|
+
envs: boolean;
|
50
|
+
};
|
51
|
+
apps: any[];
|
52
|
+
envs: any[];
|
53
|
+
loadApps: (reload?: boolean) => Promise<void>;
|
54
|
+
loadEnvs: (reload?: boolean) => Promise<void>;
|
55
|
+
};
|
56
|
+
declare let envSvc: EnvSvc;
|
57
|
+
declare let logSvc: LogSvc;
|
58
|
+
declare let socketSvc: SocketSvc;
|
59
|
+
declare let userSvc: UserSvc;
|
65
60
|
export * from "./implement";
|
66
|
-
export {
|
61
|
+
export { configSvc, driverSvc, envSvc, logSvc, settingSvc, socketSvc, userSvc, SvcFactory };
|
@@ -0,0 +1,35 @@
|
|
1
|
+
/**
|
2
|
+
* 数字工具类
|
3
|
+
* 带状态,如随机数记录了已经使用过的随机数
|
4
|
+
*/
|
5
|
+
declare class MathUtility {
|
6
|
+
/**
|
7
|
+
* 随机数总长度
|
8
|
+
*/
|
9
|
+
length: number;
|
10
|
+
/**
|
11
|
+
* 所有使用过的随机数历史
|
12
|
+
*/
|
13
|
+
history: number[];
|
14
|
+
/**
|
15
|
+
* 是否有上一个数
|
16
|
+
*/
|
17
|
+
hasPrev: boolean;
|
18
|
+
/**
|
19
|
+
* 是否有下一个数
|
20
|
+
*/
|
21
|
+
hasNext: boolean;
|
22
|
+
/**
|
23
|
+
* 上一个使用的索引
|
24
|
+
*/
|
25
|
+
lastIndex: number;
|
26
|
+
/**
|
27
|
+
* 获取上一个随机数
|
28
|
+
*/
|
29
|
+
prev: () => number;
|
30
|
+
/**
|
31
|
+
* 获取下一个随机数
|
32
|
+
*/
|
33
|
+
next: () => number;
|
34
|
+
}
|
35
|
+
export default MathUtility;
|
@@ -0,0 +1,40 @@
|
|
1
|
+
/**
|
2
|
+
* 随机数工具类
|
3
|
+
* 带状态,如随机数记录了已经使用过的随机数
|
4
|
+
*/
|
5
|
+
declare class RandomUtility {
|
6
|
+
/**
|
7
|
+
* 随机数总长度
|
8
|
+
*/
|
9
|
+
length: number;
|
10
|
+
/**
|
11
|
+
* 当前显示元素之前的数组
|
12
|
+
*/
|
13
|
+
history: number[];
|
14
|
+
/**
|
15
|
+
* 即将要显示的数组(未空表示用户还没看过,可随机生成)
|
16
|
+
*/
|
17
|
+
future: number[];
|
18
|
+
/**
|
19
|
+
* 当前元素指针,索引值,用于指示当前显示的数在所有数组中的位置
|
20
|
+
*/
|
21
|
+
current: number;
|
22
|
+
/**
|
23
|
+
* 是否有上一个数
|
24
|
+
*/
|
25
|
+
get hasPrev(): boolean;
|
26
|
+
/**
|
27
|
+
* 是否有下一个数
|
28
|
+
*/
|
29
|
+
get hasNext(): boolean;
|
30
|
+
/**
|
31
|
+
* 获取轨迹中的上一个数的索引,箭头函数可能会导致数据更新,但是UI不更新
|
32
|
+
*/
|
33
|
+
prev(): number;
|
34
|
+
/**
|
35
|
+
* 获取下一个数
|
36
|
+
* 优先从轨迹获取,轨迹没有则取随机数
|
37
|
+
*/
|
38
|
+
next(): number;
|
39
|
+
}
|
40
|
+
export default RandomUtility;
|
package/esm/utilities/index.d.ts
CHANGED
@@ -2,6 +2,7 @@ import EventUtility from "./EventUtility";
|
|
2
2
|
import KeyboardUtility from "./KeyboardUtility";
|
3
3
|
import ListDelta from "./ListDelta";
|
4
4
|
import MouseUtility from "./MouseUtility";
|
5
|
+
import RandomUtility from "./RandomUtility";
|
5
6
|
import SaveUtility from "./SaveUtility";
|
6
7
|
export * from "./@types";
|
7
|
-
export { EventUtility, KeyboardUtility, ListDelta, MouseUtility, SaveUtility };
|
8
|
+
export { EventUtility, KeyboardUtility, ListDelta, MouseUtility, RandomUtility, SaveUtility };
|