@pisell/core 1.0.0 → 1.0.2
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/es/app/app.d.ts +83 -0
- package/es/app/app.js +151 -0
- package/es/app/const.d.ts +4 -0
- package/es/app/const.js +6 -0
- package/es/app/index.d.ts +14 -0
- package/es/app/index.js +52 -0
- package/es/applicationManager/application.d.ts +50 -0
- package/es/applicationManager/application.js +223 -0
- package/es/applicationManager/index.d.ts +13 -0
- package/es/applicationManager/index.js +190 -0
- package/es/config.d.ts +3 -3
- package/es/config.js +5 -5
- package/es/cookie/index.d.ts +13 -0
- package/es/cookie/index.js +47 -0
- package/es/css/global.less +73 -0
- package/es/css/index.less +31 -0
- package/es/css/variables.css +84 -0
- package/es/data/index.d.ts +8 -0
- package/es/data/index.js +16 -0
- package/es/{locales → history}/config.d.ts +5 -5
- package/es/history/config.js +43 -0
- package/es/history/index.d.ts +20 -0
- package/es/history/index.js +41 -0
- package/es/history/type.d.ts +2 -0
- package/es/hooks/index.d.ts +12 -0
- package/es/hooks/index.js +13 -0
- package/es/hooks/useDelayedValue/index.d.ts +2 -0
- package/es/hooks/useDelayedValue/index.js +26 -0
- package/es/hooks/useDispatch/index.d.ts +2 -0
- package/es/hooks/useDispatch/index.js +2 -0
- package/es/hooks/useLowCode/index.d.ts +13 -0
- package/es/hooks/useLowCode/index.js +74 -0
- package/es/hooks/useStore/index.d.ts +6 -0
- package/es/hooks/useStore/index.js +11 -0
- package/es/index.d.ts +1 -2
- package/es/index.js +9 -2
- package/es/indexDB/index.d.ts +178 -0
- package/es/indexDB/index.js +542 -0
- package/es/locales/en.d.ts +2 -1
- package/es/locales/en.js +5 -1
- package/es/locales/index.d.ts +37 -53
- package/es/locales/index.js +213 -70
- package/es/locales/original.d.ts +3 -0
- package/es/locales/original.js +7 -0
- package/es/locales/type.d.ts +15 -5
- package/es/locales/zh-CN.d.ts +2 -1
- package/es/locales/zh-CN.js +5 -1
- package/es/locales/zh-HK.d.ts +2 -1
- package/es/locales/zh-HK.js +5 -1
- package/es/logger/feishu.d.ts +11 -0
- package/es/logger/feishu.js +50 -0
- package/es/logger/index.d.ts +122 -0
- package/es/logger/index.js +539 -0
- package/es/menuManager/hooks.d.ts +17 -0
- package/es/menuManager/hooks.js +136 -0
- package/es/menuManager/index.d.ts +28 -0
- package/es/menuManager/index.js +142 -0
- package/es/models/global.d.ts +32 -0
- package/es/models/global.js +66 -0
- package/es/models/index.d.ts +45 -0
- package/es/models/index.js +65 -0
- package/es/models/type.d.ts +2 -0
- package/es/models/type.js +1 -0
- package/es/plugin/index.d.ts +0 -0
- package/es/plugin/index.js +0 -0
- package/es/pubsub/example.d.ts +5 -0
- package/es/pubsub/example.js +92 -0
- package/es/pubsub/index.d.ts +63 -0
- package/es/pubsub/index.js +144 -0
- package/es/request/cache.d.ts +46 -0
- package/es/request/cache.js +311 -0
- package/es/request/cancelToken.d.ts +38 -0
- package/es/request/cancelToken.js +59 -0
- package/es/request/config.d.ts +3 -0
- package/es/request/config.js +58 -0
- package/es/request/constants.d.ts +2 -0
- package/es/request/constants.js +6 -0
- package/es/request/index.d.ts +24 -0
- package/es/request/index.js +176 -0
- package/es/request/pisell2Request.d.ts +6 -0
- package/es/request/pisell2Request.js +62 -0
- package/es/request/type.d.ts +41 -0
- package/es/request/type.js +1 -0
- package/es/request/utils.d.ts +46 -0
- package/es/request/utils.js +147 -0
- package/es/routes/config.d.ts +7 -0
- package/es/routes/config.js +17 -0
- package/es/routes/index.d.ts +28 -0
- package/es/routes/index.js +148 -0
- package/es/socket/components/SocketMonitorPage.d.ts +6 -0
- package/es/socket/components/SocketMonitorPage.js +485 -0
- package/es/socket/components/index.d.ts +2 -0
- package/es/socket/components/index.js +2 -0
- package/es/socket/constants.d.ts +33 -0
- package/es/socket/constants.js +39 -0
- package/es/socket/events.d.ts +31 -0
- package/es/socket/events.js +19 -0
- package/es/socket/heartbeat.d.ts +66 -0
- package/es/socket/heartbeat.js +184 -0
- package/es/socket/index.d.ts +61 -0
- package/es/socket/index.js +246 -0
- package/es/socket/monitor.d.ts +169 -0
- package/es/socket/monitor.js +447 -0
- package/es/socket/reconnect.d.ts +61 -0
- package/es/socket/reconnect.js +199 -0
- package/es/socket/socket.d.ts +129 -0
- package/es/socket/socket.js +595 -0
- package/es/socket/types.d.ts +85 -0
- package/es/socket/types.js +35 -0
- package/es/storage/index.d.ts +17 -0
- package/es/storage/index.js +56 -0
- package/es/tasks/index.d.ts +77 -0
- package/es/tasks/index.js +743 -0
- package/es/tasks/type.d.ts +62 -0
- package/es/tasks/type.js +1 -0
- package/es/tasks/useTasks.d.ts +5 -0
- package/es/tasks/useTasks.js +25 -0
- package/es/type.d.ts +1 -1
- package/es/variables/VariablesProvider.d.ts +7 -0
- package/es/variables/VariablesProvider.js +12 -0
- package/es/variables/config.d.ts +3 -0
- package/es/variables/config.js +16 -0
- package/es/variables/index.d.ts +6 -0
- package/es/variables/index.js +5 -0
- package/es/variables/type.d.ts +2 -0
- package/es/variables/type.js +1 -0
- package/es/website/index.d.ts +6 -0
- package/es/website/index.js +65 -0
- package/lib/app/app.d.ts +83 -0
- package/lib/app/app.js +125 -0
- package/lib/app/const.d.ts +4 -0
- package/lib/app/const.js +33 -0
- package/lib/app/index.d.ts +14 -0
- package/lib/app/index.js +76 -0
- package/lib/applicationManager/application.d.ts +50 -0
- package/lib/applicationManager/application.js +110 -0
- package/lib/applicationManager/index.d.ts +13 -0
- package/lib/applicationManager/index.js +76 -0
- package/lib/config.d.ts +3 -3
- package/lib/cookie/index.d.ts +13 -0
- package/lib/cookie/index.js +64 -0
- package/lib/css/global.less +73 -0
- package/lib/css/index.less +31 -0
- package/lib/css/variables.css +84 -0
- package/lib/data/index.d.ts +8 -0
- package/lib/data/index.js +35 -0
- package/lib/{locales → history}/config.d.ts +5 -5
- package/lib/history/config.js +41 -0
- package/lib/history/index.d.ts +20 -0
- package/lib/history/index.js +58 -0
- package/lib/history/type.d.ts +2 -0
- package/lib/history/type.js +17 -0
- package/lib/hooks/index.d.ts +12 -0
- package/lib/{date → hooks}/index.js +14 -20
- package/lib/hooks/useDelayedValue/index.d.ts +2 -0
- package/lib/hooks/useDelayedValue/index.js +36 -0
- package/lib/hooks/useDispatch/index.d.ts +2 -0
- package/lib/hooks/useDispatch/index.js +26 -0
- package/lib/hooks/useLowCode/index.d.ts +13 -0
- package/lib/hooks/useLowCode/index.js +75 -0
- package/lib/hooks/useStore/index.d.ts +6 -0
- package/lib/hooks/useStore/index.js +33 -0
- package/lib/index.d.ts +1 -2
- package/lib/index.js +3 -22
- package/lib/indexDB/index.d.ts +178 -0
- package/lib/indexDB/index.js +277 -0
- package/lib/locales/en.d.ts +2 -1
- package/lib/locales/en.js +5 -1
- package/lib/locales/index.d.ts +37 -53
- package/lib/locales/index.js +130 -41
- package/lib/locales/original.d.ts +3 -0
- package/lib/locales/original.js +31 -0
- package/lib/locales/type.d.ts +15 -5
- package/lib/locales/zh-CN.d.ts +2 -1
- package/lib/locales/zh-CN.js +5 -1
- package/lib/locales/zh-HK.d.ts +2 -1
- package/lib/locales/zh-HK.js +5 -1
- package/lib/logger/feishu.d.ts +11 -0
- package/lib/logger/feishu.js +52 -0
- package/lib/logger/index.d.ts +122 -0
- package/lib/logger/index.js +288 -0
- package/lib/menuManager/hooks.d.ts +17 -0
- package/lib/menuManager/hooks.js +135 -0
- package/lib/menuManager/index.d.ts +28 -0
- package/lib/menuManager/index.js +110 -0
- package/lib/models/global.d.ts +32 -0
- package/lib/models/global.js +62 -0
- package/lib/models/index.d.ts +45 -0
- package/lib/models/index.js +69 -0
- package/lib/models/type.d.ts +2 -0
- package/lib/models/type.js +17 -0
- package/lib/plugin/index.d.ts +0 -0
- package/lib/plugin/index.js +0 -0
- package/lib/pubsub/example.d.ts +5 -0
- package/lib/pubsub/example.js +61 -0
- package/lib/pubsub/index.d.ts +63 -0
- package/lib/pubsub/index.js +129 -0
- package/lib/request/cache.d.ts +46 -0
- package/lib/request/cache.js +159 -0
- package/lib/request/cancelToken.d.ts +38 -0
- package/lib/request/cancelToken.js +59 -0
- package/lib/request/config.d.ts +3 -0
- package/lib/request/config.js +64 -0
- package/lib/request/constants.d.ts +2 -0
- package/lib/request/constants.js +34 -0
- package/lib/request/index.d.ts +24 -0
- package/lib/request/index.js +147 -0
- package/lib/request/pisell2Request.d.ts +6 -0
- package/lib/request/pisell2Request.js +75 -0
- package/lib/request/type.d.ts +41 -0
- package/lib/request/type.js +17 -0
- package/lib/request/utils.d.ts +46 -0
- package/lib/request/utils.js +113 -0
- package/lib/routes/config.d.ts +7 -0
- package/lib/routes/config.js +50 -0
- package/lib/routes/index.d.ts +28 -0
- package/lib/routes/index.js +118 -0
- package/lib/socket/components/SocketMonitorPage.d.ts +6 -0
- package/lib/socket/components/SocketMonitorPage.js +346 -0
- package/lib/socket/components/index.d.ts +2 -0
- package/lib/socket/components/index.js +39 -0
- package/lib/socket/constants.d.ts +33 -0
- package/lib/socket/constants.js +62 -0
- package/lib/socket/events.d.ts +31 -0
- package/lib/socket/events.js +44 -0
- package/lib/socket/heartbeat.d.ts +66 -0
- package/lib/socket/heartbeat.js +152 -0
- package/lib/socket/index.d.ts +61 -0
- package/lib/socket/index.js +200 -0
- package/lib/socket/monitor.d.ts +169 -0
- package/lib/socket/monitor.js +346 -0
- package/lib/socket/reconnect.d.ts +61 -0
- package/lib/socket/reconnect.js +153 -0
- package/lib/socket/socket.d.ts +129 -0
- package/lib/socket/socket.js +410 -0
- package/lib/socket/types.d.ts +85 -0
- package/lib/socket/types.js +36 -0
- package/lib/storage/index.d.ts +17 -0
- package/lib/storage/index.js +63 -0
- package/lib/tasks/index.d.ts +77 -0
- package/lib/tasks/index.js +438 -0
- package/lib/tasks/type.d.ts +62 -0
- package/lib/{date → tasks}/type.js +1 -1
- package/lib/tasks/useTasks.d.ts +5 -0
- package/lib/tasks/useTasks.js +37 -0
- package/lib/type.d.ts +1 -1
- package/lib/variables/VariablesProvider.d.ts +7 -0
- package/lib/{locales/config.js → variables/VariablesProvider.js} +17 -29
- package/lib/variables/config.d.ts +3 -0
- package/lib/{date → variables}/config.js +2 -7
- package/lib/variables/index.d.ts +6 -0
- package/lib/variables/index.js +29 -0
- package/lib/variables/type.d.ts +2 -0
- package/lib/variables/type.js +17 -0
- package/lib/website/index.d.ts +6 -0
- package/lib/website/index.js +75 -0
- package/package.json +22 -5
- package/es/date/config.d.ts +0 -3
- package/es/date/config.js +0 -21
- package/es/date/index.d.ts +0 -7
- package/es/date/index.js +0 -22
- package/es/date/type.d.ts +0 -7
- package/es/locales/config.js +0 -57
- package/lib/date/config.d.ts +0 -3
- package/lib/date/index.d.ts +0 -7
- package/lib/date/type.d.ts +0 -7
- /package/es/{date → history}/type.js +0 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/applicationManager/application.tsx
|
|
20
|
+
var application_exports = {};
|
|
21
|
+
__export(application_exports, {
|
|
22
|
+
Application: () => Application
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(application_exports);
|
|
25
|
+
var Application = class {
|
|
26
|
+
constructor(options, app) {
|
|
27
|
+
// 应用内的interface
|
|
28
|
+
this.interfaces = /* @__PURE__ */ new Map();
|
|
29
|
+
// 应用内的组件
|
|
30
|
+
this.components = /* @__PURE__ */ new Map();
|
|
31
|
+
// 应用内的函数, 比如跳转登录页面的方法
|
|
32
|
+
this.functions = /* @__PURE__ */ new Map();
|
|
33
|
+
this.options = options;
|
|
34
|
+
this.name = options.app_name;
|
|
35
|
+
this.app = app;
|
|
36
|
+
this.initInterfaces(options.interfaces);
|
|
37
|
+
this.initFunctions(options.functions);
|
|
38
|
+
}
|
|
39
|
+
async afterAdd(application) {
|
|
40
|
+
if (application.options.locales) {
|
|
41
|
+
this.app.locales.loadLibraryByUrl(application.options.locales);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
async beforeLoad() {
|
|
45
|
+
}
|
|
46
|
+
async load() {
|
|
47
|
+
this.interfaces.forEach((item, key) => {
|
|
48
|
+
this.app.router.add(item.router, item);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
initInterfaces(interfaces) {
|
|
52
|
+
interfaces.forEach(async (interfaceItem) => {
|
|
53
|
+
let _interface = await this.loadInterface(interfaceItem);
|
|
54
|
+
if (interfaceItem.category === "page") {
|
|
55
|
+
this.setInterface(interfaceItem.page_code, _interface);
|
|
56
|
+
}
|
|
57
|
+
if (interfaceItem.category === "component") {
|
|
58
|
+
this.setComponent(interfaceItem.page_code, _interface);
|
|
59
|
+
}
|
|
60
|
+
if (interfaceItem.category === "function") {
|
|
61
|
+
this.setFunction(interfaceItem.page_code, _interface);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
initFunctions(functions) {
|
|
66
|
+
(functions || []).forEach(async (functionItem) => {
|
|
67
|
+
this.setFunction(functionItem.function_code, functionItem);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
async loadInterface(interfaceItem) {
|
|
71
|
+
if (interfaceItem.Component) {
|
|
72
|
+
return interfaceItem;
|
|
73
|
+
}
|
|
74
|
+
if (interfaceItem.page_type === "low_code") {
|
|
75
|
+
}
|
|
76
|
+
if (interfaceItem.page_type === "code") {
|
|
77
|
+
}
|
|
78
|
+
return interfaceItem;
|
|
79
|
+
}
|
|
80
|
+
setInterface(code, interfaceItem) {
|
|
81
|
+
this.interfaces.set(code, interfaceItem);
|
|
82
|
+
}
|
|
83
|
+
setComponent(code, component) {
|
|
84
|
+
this.components.set(code, component);
|
|
85
|
+
}
|
|
86
|
+
setFunction(code, functionItem) {
|
|
87
|
+
this.functions.set(code, functionItem);
|
|
88
|
+
}
|
|
89
|
+
getInterface(code) {
|
|
90
|
+
return this.interfaces.get(code);
|
|
91
|
+
}
|
|
92
|
+
getComponent(code) {
|
|
93
|
+
return this.components.get(code);
|
|
94
|
+
}
|
|
95
|
+
getFunction(code) {
|
|
96
|
+
return this.functions.get(code);
|
|
97
|
+
}
|
|
98
|
+
runFunction(code, params, ...args) {
|
|
99
|
+
var _a;
|
|
100
|
+
const _params = {
|
|
101
|
+
app: this.app,
|
|
102
|
+
...params
|
|
103
|
+
};
|
|
104
|
+
return (_a = this.getFunction(code)) == null ? void 0 : _a.code(_params, ...args);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
108
|
+
0 && (module.exports = {
|
|
109
|
+
Application
|
|
110
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import APP from "../app";
|
|
2
|
+
import { Application, ApplicationData } from "./application";
|
|
3
|
+
export declare class ApplicationManager {
|
|
4
|
+
applicationList: Application[];
|
|
5
|
+
protected app: APP;
|
|
6
|
+
applications: Map<string, Application>;
|
|
7
|
+
constructor(applicationList: Application[], app: APP);
|
|
8
|
+
init(applicationList: Application[] | ApplicationData[]): Promise<unknown>;
|
|
9
|
+
add(application: Application): Promise<void>;
|
|
10
|
+
get(appName: Application["name"]): Application | undefined;
|
|
11
|
+
remove(appName: Application["name"]): void;
|
|
12
|
+
load(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/applicationManager/index.tsx
|
|
20
|
+
var applicationManager_exports = {};
|
|
21
|
+
__export(applicationManager_exports, {
|
|
22
|
+
ApplicationManager: () => ApplicationManager
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(applicationManager_exports);
|
|
25
|
+
var import_application = require("./application");
|
|
26
|
+
var ApplicationManager = class {
|
|
27
|
+
constructor(applicationList = [], app) {
|
|
28
|
+
this.applicationList = applicationList;
|
|
29
|
+
this.app = app;
|
|
30
|
+
this.applications = /* @__PURE__ */ new Map();
|
|
31
|
+
this.app = app;
|
|
32
|
+
if (applicationList == null ? void 0 : applicationList.length) {
|
|
33
|
+
this.init(applicationList);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
async init(applicationList) {
|
|
37
|
+
return new Promise(async (res, req) => {
|
|
38
|
+
applicationList.forEach(
|
|
39
|
+
async (application) => {
|
|
40
|
+
if (typeof application === "object") {
|
|
41
|
+
application = new import_application.Application(
|
|
42
|
+
application,
|
|
43
|
+
this.app
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
await this.add(application);
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
await this.load();
|
|
50
|
+
res(true);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
async add(application) {
|
|
54
|
+
this.applications.set(application.name, application);
|
|
55
|
+
await application.afterAdd(application);
|
|
56
|
+
}
|
|
57
|
+
get(appName) {
|
|
58
|
+
let application = this.applications.get(appName);
|
|
59
|
+
return application;
|
|
60
|
+
}
|
|
61
|
+
remove(appName) {
|
|
62
|
+
this.applications.delete(appName);
|
|
63
|
+
}
|
|
64
|
+
async load() {
|
|
65
|
+
for (const plugin of this.applications.values()) {
|
|
66
|
+
await plugin.beforeLoad();
|
|
67
|
+
}
|
|
68
|
+
for (const plugin of this.applications.values()) {
|
|
69
|
+
await plugin.load();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
74
|
+
0 && (module.exports = {
|
|
75
|
+
ApplicationManager
|
|
76
|
+
});
|
package/lib/config.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const setConfig: (newConfig: Partial<
|
|
3
|
-
export declare const getConfig: () =>
|
|
1
|
+
import { CoreConfig } from './type';
|
|
2
|
+
export declare const setConfig: (newConfig: Partial<CoreConfig>) => void;
|
|
3
|
+
export declare const getConfig: () => CoreConfig;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare function setCookie(name: string, value: string, domain?: string): void;
|
|
2
|
+
declare function getCookie(name: string): string | null;
|
|
3
|
+
declare function deleteCookie(name: string, domain?: string): void;
|
|
4
|
+
declare function checkCookie(name: string): boolean;
|
|
5
|
+
declare function updateCookie(name: string, value: string, domain?: string): void;
|
|
6
|
+
declare const _default: {
|
|
7
|
+
setCookie: typeof setCookie;
|
|
8
|
+
getCookie: typeof getCookie;
|
|
9
|
+
deleteCookie: typeof deleteCookie;
|
|
10
|
+
checkCookie: typeof checkCookie;
|
|
11
|
+
updateCookie: typeof updateCookie;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/cookie/index.ts
|
|
20
|
+
var cookie_exports = {};
|
|
21
|
+
__export(cookie_exports, {
|
|
22
|
+
default: () => cookie_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(cookie_exports);
|
|
25
|
+
function setCookie(name, value, domain) {
|
|
26
|
+
let expires = "";
|
|
27
|
+
let cookieDomain = "";
|
|
28
|
+
if (domain) {
|
|
29
|
+
cookieDomain = "; domain=" + domain;
|
|
30
|
+
}
|
|
31
|
+
document.cookie = name + "=" + (value || "") + expires + cookieDomain + "; path=/";
|
|
32
|
+
}
|
|
33
|
+
function getCookie(name) {
|
|
34
|
+
const nameEQ = name + "=";
|
|
35
|
+
const ca = document.cookie.split(";");
|
|
36
|
+
for (let i = 0; i < ca.length; i++) {
|
|
37
|
+
let c = ca[i];
|
|
38
|
+
while (c.charAt(0) === " ")
|
|
39
|
+
c = c.substring(1, c.length);
|
|
40
|
+
if (c.indexOf(nameEQ) === 0)
|
|
41
|
+
return c.substring(nameEQ.length, c.length);
|
|
42
|
+
}
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
function deleteCookie(name, domain) {
|
|
46
|
+
let cookieDomain = "";
|
|
47
|
+
if (domain) {
|
|
48
|
+
cookieDomain = "; domain=" + domain;
|
|
49
|
+
}
|
|
50
|
+
document.cookie = name + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC" + cookieDomain + "; path=/;";
|
|
51
|
+
}
|
|
52
|
+
function checkCookie(name) {
|
|
53
|
+
return getCookie(name) !== null;
|
|
54
|
+
}
|
|
55
|
+
function updateCookie(name, value, domain) {
|
|
56
|
+
setCookie(name, value, domain);
|
|
57
|
+
}
|
|
58
|
+
var cookie_default = {
|
|
59
|
+
setCookie,
|
|
60
|
+
getCookie,
|
|
61
|
+
deleteCookie,
|
|
62
|
+
checkCookie,
|
|
63
|
+
updateCookie
|
|
64
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
.disabled-select {
|
|
2
|
+
-webkit-user-select: none;
|
|
3
|
+
/* Safari */
|
|
4
|
+
-moz-user-select: none;
|
|
5
|
+
/* Firefox */
|
|
6
|
+
-ms-user-select: none;
|
|
7
|
+
/* IE10+/Edge */
|
|
8
|
+
user-select: none;
|
|
9
|
+
/* Standard syntax */
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
ion-segment-button {
|
|
13
|
+
font-weight: 600;
|
|
14
|
+
--color-checked: var(--ion-color-primary);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.tab-bar {
|
|
18
|
+
//height: 78px;
|
|
19
|
+
--background: #fff;
|
|
20
|
+
padding: 10px 0;
|
|
21
|
+
|
|
22
|
+
.tab-bar-icon {
|
|
23
|
+
margin-bottom: 6px;
|
|
24
|
+
//font-size: 24px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.tab-bar-name {
|
|
28
|
+
font-size: 12px;
|
|
29
|
+
font-style: normal;
|
|
30
|
+
font-weight: 600;
|
|
31
|
+
line-height: 18px;
|
|
32
|
+
/* 150% */
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
ul {
|
|
37
|
+
padding: 0;
|
|
38
|
+
margin: 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
li {
|
|
42
|
+
list-style: none;
|
|
43
|
+
padding: 0;
|
|
44
|
+
margin: 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
/*默认滚动条样式*/
|
|
49
|
+
::-webkit-scrollbar {
|
|
50
|
+
width: 8px;
|
|
51
|
+
height: 8px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
::-webkit-scrollbar-track {
|
|
55
|
+
background: #f1f1f1;
|
|
56
|
+
border-radius: 4px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
::-webkit-scrollbar-thumb {
|
|
60
|
+
background: #c1c1c1;
|
|
61
|
+
border-radius: 4px;
|
|
62
|
+
|
|
63
|
+
&:hover {
|
|
64
|
+
background: #a8a8a8;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
html.plt-mobile ion-app {
|
|
69
|
+
-webkit-user-select: auto;
|
|
70
|
+
-moz-user-select: auto;
|
|
71
|
+
-ms-user-select: auto;
|
|
72
|
+
user-select: auto;
|
|
73
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* Core CSS required for Ionic components to work properly */
|
|
2
|
+
@import "@ionic/react/css/core.css";
|
|
3
|
+
|
|
4
|
+
/* Basic CSS for apps built with Ionic */
|
|
5
|
+
@import "@ionic/react/css/normalize.css";
|
|
6
|
+
@import "@ionic/react/css/structure.css";
|
|
7
|
+
@import "@ionic/react/css/typography.css";
|
|
8
|
+
|
|
9
|
+
/* Optional CSS utils that can be commented out */
|
|
10
|
+
@import "@ionic/react/css/padding.css";
|
|
11
|
+
@import "@ionic/react/css/float-elements.css";
|
|
12
|
+
@import "@ionic/react/css/text-alignment.css";
|
|
13
|
+
@import "@ionic/react/css/text-transformation.css";
|
|
14
|
+
@import "@ionic/react/css/flex-utils.css";
|
|
15
|
+
@import "@ionic/react/css/display.css";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Ionic Dark Mode
|
|
19
|
+
* -----------------------------------------------------
|
|
20
|
+
* For more info, please see:
|
|
21
|
+
* https://ionicframework.com/docs/theming/dark-mode
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/* @import '@ionic/react/css/palettes/dark.always.css'; */
|
|
25
|
+
/* @import '@ionic/react/css/palettes/dark.class.css'; */
|
|
26
|
+
// @import "@ionic/react/css/palettes/dark.system.css";
|
|
27
|
+
|
|
28
|
+
/* Theme variables */
|
|
29
|
+
@import "./variables.css";
|
|
30
|
+
|
|
31
|
+
@import "./global.less";
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/* For information on how to create your own theme, please see:
|
|
2
|
+
http://ionicframework.com/docs/theming/ */
|
|
3
|
+
|
|
4
|
+
:root {
|
|
5
|
+
--ion-platform: ios;
|
|
6
|
+
--ion-color-primary: #5D3F9F;
|
|
7
|
+
--ion-color-primary-rgb: 93,63,159;
|
|
8
|
+
--ion-color-primary-contrast: #ffffff;
|
|
9
|
+
--ion-color-primary-contrast-rgb: 255,255,255;
|
|
10
|
+
--ion-color-primary-shade: #52378c;
|
|
11
|
+
--ion-color-primary-tint: #6d52a9;
|
|
12
|
+
|
|
13
|
+
--ion-color-secondary: #7f56da;
|
|
14
|
+
--ion-color-secondary-rgb: 127,86,218;
|
|
15
|
+
--ion-color-secondary-contrast: #ffffff;
|
|
16
|
+
--ion-color-secondary-contrast-rgb: 255,255,255;
|
|
17
|
+
--ion-color-secondary-shade: #704cc0;
|
|
18
|
+
--ion-color-secondary-tint: #8c67de;
|
|
19
|
+
|
|
20
|
+
--ion-color-tertiary: #eee5ff;
|
|
21
|
+
--ion-color-tertiary-rgb: 238,229,255;
|
|
22
|
+
--ion-color-tertiary-contrast: #000000;
|
|
23
|
+
--ion-color-tertiary-contrast-rgb: 0,0,0;
|
|
24
|
+
--ion-color-tertiary-shade: #d1cae0;
|
|
25
|
+
--ion-color-tertiary-tint: #f0e8ff;
|
|
26
|
+
|
|
27
|
+
/** success **/
|
|
28
|
+
--ion-color-success: #2dd36f;
|
|
29
|
+
--ion-color-success-rgb: 45, 211, 111;
|
|
30
|
+
--ion-color-success-contrast: #ffffff;
|
|
31
|
+
--ion-color-success-contrast-rgb: 255, 255, 255;
|
|
32
|
+
--ion-color-success-shade: #28ba62;
|
|
33
|
+
--ion-color-success-tint: #42d77d;
|
|
34
|
+
|
|
35
|
+
/** warning **/
|
|
36
|
+
--ion-color-warning: #ffc409;
|
|
37
|
+
--ion-color-warning-rgb: 255, 196, 9;
|
|
38
|
+
--ion-color-warning-contrast: #000000;
|
|
39
|
+
--ion-color-warning-contrast-rgb: 0, 0, 0;
|
|
40
|
+
--ion-color-warning-shade: #e0ac08;
|
|
41
|
+
--ion-color-warning-tint: #ffca22;
|
|
42
|
+
|
|
43
|
+
/** danger **/
|
|
44
|
+
--ion-color-danger: #eb445a;
|
|
45
|
+
--ion-color-danger-rgb: 235, 68, 90;
|
|
46
|
+
--ion-color-danger-contrast: #ffffff;
|
|
47
|
+
--ion-color-danger-contrast-rgb: 255, 255, 255;
|
|
48
|
+
--ion-color-danger-shade: #cf3c4f;
|
|
49
|
+
--ion-color-danger-tint: #ed576b;
|
|
50
|
+
|
|
51
|
+
/** dark **/
|
|
52
|
+
--ion-color-dark: #222428;
|
|
53
|
+
--ion-color-dark-rgb: 34, 36, 40;
|
|
54
|
+
--ion-color-dark-contrast: #ffffff;
|
|
55
|
+
--ion-color-dark-contrast-rgb: 255, 255, 255;
|
|
56
|
+
--ion-color-dark-shade: #1e2023;
|
|
57
|
+
--ion-color-dark-tint: #383a3e;
|
|
58
|
+
|
|
59
|
+
/** medium **/
|
|
60
|
+
--ion-color-medium: #92949c;
|
|
61
|
+
--ion-color-medium-rgb: 146, 148, 156;
|
|
62
|
+
--ion-color-medium-contrast: #ffffff;
|
|
63
|
+
--ion-color-medium-contrast-rgb: 255, 255, 255;
|
|
64
|
+
--ion-color-medium-shade: #808289;
|
|
65
|
+
--ion-color-medium-tint: #9d9fa6;
|
|
66
|
+
|
|
67
|
+
/** light **/
|
|
68
|
+
--ion-color-light: #f4f5f8;
|
|
69
|
+
--ion-color-light-rgb: 244, 245, 248;
|
|
70
|
+
--ion-color-light-contrast: #000000;
|
|
71
|
+
--ion-color-light-contrast-rgb: 0, 0, 0;
|
|
72
|
+
--ion-color-light-shade: #d7d8da;
|
|
73
|
+
--ion-color-light-tint: #f5f6f9;
|
|
74
|
+
|
|
75
|
+
--ion-toolbar-background: #ffffff;
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
--theme-color: var(--ion-color-primary);
|
|
79
|
+
|
|
80
|
+
--ion-text-color: var(--ion-color-dark);
|
|
81
|
+
|
|
82
|
+
--theme-a-color: #7F56DA;
|
|
83
|
+
|
|
84
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/data/index.ts
|
|
20
|
+
var data_exports = {};
|
|
21
|
+
__export(data_exports, {
|
|
22
|
+
Data: () => Data
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(data_exports);
|
|
25
|
+
var Data = class {
|
|
26
|
+
constructor(app) {
|
|
27
|
+
this.app = app;
|
|
28
|
+
this.storage = app.storage;
|
|
29
|
+
this.store = app.models;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
+
0 && (module.exports = {
|
|
34
|
+
Data
|
|
35
|
+
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HistoryConfig } from './type';
|
|
2
2
|
/**
|
|
3
3
|
* @title: 默认配置
|
|
4
4
|
* @description:
|
|
5
5
|
* @return {*}
|
|
6
6
|
* @Author: zhiwei.Wang
|
|
7
7
|
*/
|
|
8
|
-
export declare const defaultConfig:
|
|
8
|
+
export declare const defaultConfig: HistoryConfig;
|
|
9
9
|
/**
|
|
10
10
|
* @title: 设置配置
|
|
11
11
|
* @description:
|
|
@@ -13,12 +13,12 @@ export declare const defaultConfig: LocaleConfig;
|
|
|
13
13
|
* @return {*}
|
|
14
14
|
* @Author: zhiwei.Wang
|
|
15
15
|
*/
|
|
16
|
-
export declare const setConfig: (newConfig: Partial<
|
|
16
|
+
export declare const setConfig: (newConfig: Partial<HistoryConfig>) => HistoryConfig;
|
|
17
17
|
/**
|
|
18
18
|
* @title: 获取配置
|
|
19
19
|
* @description:
|
|
20
|
-
* @param {*}
|
|
20
|
+
* @param {*} HistoryConfig
|
|
21
21
|
* @return {*}
|
|
22
22
|
* @Author: zhiwei.Wang
|
|
23
23
|
*/
|
|
24
|
-
export declare const getConfig: () =>
|
|
24
|
+
export declare const getConfig: () => HistoryConfig;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/history/config.ts
|
|
20
|
+
var config_exports = {};
|
|
21
|
+
__export(config_exports, {
|
|
22
|
+
defaultConfig: () => defaultConfig,
|
|
23
|
+
getConfig: () => getConfig,
|
|
24
|
+
setConfig: () => setConfig
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(config_exports);
|
|
27
|
+
var defaultConfig = {};
|
|
28
|
+
var config = {
|
|
29
|
+
...defaultConfig
|
|
30
|
+
};
|
|
31
|
+
var setConfig = (newConfig) => {
|
|
32
|
+
config = { ...config, ...newConfig };
|
|
33
|
+
return config;
|
|
34
|
+
};
|
|
35
|
+
var getConfig = () => config;
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {
|
|
38
|
+
defaultConfig,
|
|
39
|
+
getConfig,
|
|
40
|
+
setConfig
|
|
41
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { History as HistoryType } from "history";
|
|
2
|
+
import { useHistory, useLocation, useParams } from "react-router-dom";
|
|
3
|
+
import App from "../app";
|
|
4
|
+
export interface HistoryOptions {
|
|
5
|
+
basename?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class History {
|
|
8
|
+
instance: HistoryType<unknown>;
|
|
9
|
+
useHistory: typeof useHistory;
|
|
10
|
+
useLocation: typeof useLocation;
|
|
11
|
+
useParams: typeof useParams;
|
|
12
|
+
app: App;
|
|
13
|
+
constructor(app: App, options?: HistoryOptions);
|
|
14
|
+
push: HistoryType["push"];
|
|
15
|
+
replace: HistoryType["replace"];
|
|
16
|
+
reload: () => void;
|
|
17
|
+
reloadTo: (path: string) => void;
|
|
18
|
+
externalPage: (path: string) => void;
|
|
19
|
+
goLogin: () => any;
|
|
20
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/history/index.ts
|
|
20
|
+
var history_exports = {};
|
|
21
|
+
__export(history_exports, {
|
|
22
|
+
History: () => History
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(history_exports);
|
|
25
|
+
var import_history = require("history");
|
|
26
|
+
var import_react_router_dom = require("react-router-dom");
|
|
27
|
+
var History = class {
|
|
28
|
+
constructor(app, options) {
|
|
29
|
+
this.useHistory = import_react_router_dom.useHistory;
|
|
30
|
+
this.useLocation = import_react_router_dom.useLocation;
|
|
31
|
+
this.useParams = import_react_router_dom.useParams;
|
|
32
|
+
this.push = (path, state) => {
|
|
33
|
+
this.instance.push(path, state);
|
|
34
|
+
};
|
|
35
|
+
this.replace = (path, state) => {
|
|
36
|
+
this.instance.replace(path, state);
|
|
37
|
+
};
|
|
38
|
+
this.reload = () => {
|
|
39
|
+
window.location.reload();
|
|
40
|
+
};
|
|
41
|
+
this.reloadTo = (path) => {
|
|
42
|
+
window.location.href = path;
|
|
43
|
+
};
|
|
44
|
+
this.externalPage = (path) => {
|
|
45
|
+
window.open(path);
|
|
46
|
+
};
|
|
47
|
+
this.goLogin = () => {
|
|
48
|
+
var _a, _b;
|
|
49
|
+
return (_b = (_a = this.app.applicationManager.get("login")) == null ? void 0 : _a.runFunction) == null ? void 0 : _b.call(_a, "goLogin");
|
|
50
|
+
};
|
|
51
|
+
this.app = app;
|
|
52
|
+
this.instance = (0, import_history.createBrowserHistory)({ basename: (options == null ? void 0 : options.basename) || "/" });
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
56
|
+
0 && (module.exports = {
|
|
57
|
+
History
|
|
58
|
+
});
|