@das-fed/upf-utils 6.4.0-dev.238 → 6.4.0-dev.239
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/api-services/es5.d.ts +2 -0
- package/api-services/es5.js +823 -820
- package/api-services/i18n/es5.d.ts +63 -0
- package/api-services/index.js +642 -644
- package/api-services/index.js.gz +0 -0
- package/api-services/modules/app-manage/es5.d.ts +2 -0
- package/api-services/modules/app-manage/es5.js +25 -19
- package/api-services/modules/app-manage/index.js +17 -15
- package/api-services/modules/app-manage/index.js.gz +0 -0
- package/api-services/modules/authentication/es5.d.ts +2 -0
- package/api-services/modules/authentication/es5.js +1100 -1082
- package/api-services/modules/authentication/index.js +911 -891
- package/api-services/modules/authentication/index.js.gz +0 -0
- package/api-services/modules/bems/es5.d.ts +6 -0
- package/api-services/modules/bems/es5.js +96 -90
- package/api-services/modules/bems/index.js +75 -73
- package/api-services/modules/bems/index.js.gz +0 -0
- package/api-services/modules/contract/es5.d.ts +2 -0
- package/api-services/modules/contract/es5.js +1343 -1325
- package/api-services/modules/contract/index.js +1140 -1120
- package/api-services/modules/contract/index.js.gz +0 -0
- package/api-services/modules/duty-manage/es5.d.ts +7 -0
- package/api-services/modules/duty-manage/es5.js +1338 -1344
- package/api-services/modules/duty-manage/index.js +1122 -1138
- package/api-services/modules/duty-manage/index.js.gz +0 -0
- package/api-services/modules/enterpriseright/es5.d.ts +2 -0
- package/api-services/modules/enterpriseright/es5.js +1086 -1071
- package/api-services/modules/enterpriseright/index.js +892 -876
- package/api-services/modules/enterpriseright/index.js.gz +0 -0
- package/api-services/modules/es5.d.ts +21 -0
- package/api-services/modules/es5.js +1351 -1357
- package/api-services/modules/file/es5.d.ts +37 -0
- package/api-services/modules/file/es5.js +131 -125
- package/api-services/modules/file/index.js +108 -106
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/es5.d.ts +2 -0
- package/api-services/modules/gateway-edge/es5.js +1343 -1325
- package/api-services/modules/gateway-edge/index.js +1140 -1120
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/index.js +1060 -1076
- package/api-services/modules/index.js.gz +0 -0
- package/api-services/modules/iot/es5.d.ts +16 -0
- package/api-services/modules/iot/es5.js +33 -27
- package/api-services/modules/iot/index.js +23 -21
- package/api-services/modules/iot/index.js.gz +0 -0
- package/api-services/modules/justauth/es5.d.ts +3 -0
- package/api-services/modules/justauth/es5.js +25 -19
- package/api-services/modules/justauth/index.js +17 -15
- package/api-services/modules/justauth/index.js.gz +0 -0
- package/api-services/modules/knowledge/es5.d.ts +2 -0
- package/api-services/modules/knowledge/es5.js +1337 -1321
- package/api-services/modules/knowledge/index.js +1124 -1108
- package/api-services/modules/knowledge/index.js.gz +0 -0
- package/api-services/modules/link/es5.d.ts +2 -0
- package/api-services/modules/link/es5.js +1343 -1325
- package/api-services/modules/link/index.js +1140 -1120
- package/api-services/modules/link/index.js.gz +0 -0
- package/api-services/modules/permission/es5.d.ts +2 -0
- package/api-services/modules/permission/es5.js +1100 -1106
- package/api-services/modules/permission/index.js +897 -913
- package/api-services/modules/permission/index.js.gz +0 -0
- package/api-services/modules/platformManage/es5.d.ts +14 -0
- package/api-services/modules/platformManage/es5.js +104 -98
- package/api-services/modules/platformManage/index.js +83 -81
- package/api-services/modules/platformManage/index.js.gz +0 -0
- package/api-services/modules/portal/es5.d.ts +2 -0
- package/api-services/modules/portal/es5.js +1343 -1349
- package/api-services/modules/portal/index.js +1126 -1142
- package/api-services/modules/portal/index.js.gz +0 -0
- package/api-services/modules/space-manage/es5.d.ts +2 -0
- package/api-services/modules/space-manage/es5.js +1343 -1349
- package/api-services/modules/space-manage/index.js +1126 -1142
- package/api-services/modules/space-manage/index.js.gz +0 -0
- package/api-services/modules/super-admin/es5.d.ts +8 -0
- package/api-services/modules/super-admin/es5.js +1081 -1084
- package/api-services/modules/super-admin/index.js +880 -892
- package/api-services/modules/super-admin/index.js.gz +0 -0
- package/api-services/modules/supplier/es5.d.ts +6 -0
- package/api-services/modules/supplier/es5.js +1081 -1084
- package/api-services/modules/supplier/index.js +880 -892
- package/api-services/modules/supplier/index.js.gz +0 -0
- package/api-services/modules/supplychain-manage/es5.d.ts +2 -0
- package/api-services/modules/supplychain-manage/es5.js +1343 -1325
- package/api-services/modules/supplychain-manage/index.js +1140 -1120
- package/api-services/modules/supplychain-manage/index.js.gz +0 -0
- package/api-services/modules/systemConfiguration/es5.d.ts +2 -0
- package/api-services/modules/systemConfiguration/es5.js +1100 -1106
- package/api-services/modules/systemConfiguration/index.js +897 -913
- package/api-services/modules/systemConfiguration/index.js.gz +0 -0
- package/api-services/modules/tool/es5.d.ts +2 -0
- package/api-services/modules/tool/es5.js +845 -836
- package/api-services/modules/tool/index.js +660 -654
- package/api-services/modules/tool/index.js.gz +0 -0
- package/api-services/src/create-service/es5.d.ts +1 -0
- package/api-services/src/create-service/es5.js +1326 -1332
- package/api-services/src/create-service/index.js +1110 -1126
- package/api-services/src/create-service/index.js.gz +0 -0
- package/atob/es5.d.ts +2 -0
- package/common-info/es5.d.ts +48 -0
- package/common-info/es5.js +1269 -1331
- package/common-info/getIframeUrl/es5.d.ts +9 -0
- package/common-info/getInfoFromUrl/es5.d.ts +8 -0
- package/common-info/getPermissionMethod/es5.d.ts +77 -0
- package/common-info/getPermissionMethod/es5.js +1371 -1355
- package/common-info/getPermissionMethod/index.d.ts +27 -9
- package/common-info/getPermissionMethod/index.js +1141 -1125
- package/common-info/getPermissionMethod/index.js.gz +0 -0
- package/common-info/index.d.ts +1 -29
- package/common-info/index.js +1046 -1096
- package/common-info/index.js.gz +0 -0
- package/common-info/set-personal-info/es5.d.ts +5 -0
- package/common-info/type.d.ts +2 -2
- package/common-tools/arr-tools/es5.d.ts +15 -0
- package/common-tools/calc-text-width/es5.d.ts +1 -0
- package/common-tools/date-format/es5.d.ts +7 -0
- package/common-tools/es5.d.ts +15 -0
- package/common-tools/es5.js +9 -0
- package/common-tools/extract-file-name/es5.d.ts +1 -0
- package/common-tools/get-file-extension/es5.d.ts +6 -0
- package/common-tools/get-url-params/es5.d.ts +46 -0
- package/common-tools/handle-data/es5.d.ts +34 -0
- package/common-tools/handle-data/es5.js +44 -6
- package/common-tools/handle-data/index.d.ts +16 -1
- package/common-tools/handle-data/index.js +1 -1
- package/common-tools/handle-data/index.js.gz +0 -0
- package/common-tools/index.d.ts +1 -0
- package/common-tools/index.js +1 -0
- package/common-tools/nest-tree-format/es5.d.ts +30 -0
- package/common-tools/obj-tools/es5.d.ts +7 -0
- package/common-tools/platform-tools/es5.d.ts +19 -0
- package/common-tools/queue-promise/es5.d.ts +6 -0
- package/common-tools/setHtmlMinWH/es5.d.ts +5 -0
- package/common-tools/timezone-format/es5.d.ts +28 -0
- package/common-tools/timezone-format/es5.js +140 -0
- package/common-tools/timezone-format/index.d.ts +28 -0
- package/common-tools/timezone-format/index.js +81 -0
- package/common-tools/timezone-format/index.js.gz +0 -0
- package/common-tools/update-browser-title/es5.d.ts +1 -0
- package/common-tools/update-fav-icon/es5.d.ts +11 -0
- package/config/es5.d.ts +2 -0
- package/create-api-service/access-token-auto-refresh/es5.d.ts +20 -0
- package/create-api-service/access-token-auto-refresh/es5.js +27 -26
- package/create-api-service/access-token-auto-refresh/index.js +27 -26
- package/create-api-service/access-token-auto-refresh/index.js.gz +0 -0
- package/create-api-service/check-token/es5.d.ts +12 -0
- package/create-api-service/es5.d.ts +8 -0
- package/create-api-service/es5.js +24 -18
- package/create-api-service/i18n/es5.d.ts +39 -0
- package/create-api-service/index.js +17 -15
- package/create-api-service/index.js.gz +0 -0
- package/create-api-service/proxy-sso/es5.d.ts +3 -0
- package/create-api-service/sso/es5.d.ts +21 -0
- package/create-api-service/token-refresh-shared/es5.d.ts +30 -0
- package/curring-http/es5.d.ts +12 -0
- package/dimple-canvas/es5.d.ts +3 -0
- package/directive/auth/es5.d.ts +8 -0
- package/directive/clickOutside/es5.d.ts +6 -0
- package/directive/es5.d.ts +3 -0
- package/directive/hoverInside/es5.d.ts +6 -0
- package/directive/utils/es5.d.ts +7 -0
- package/dom-check-in/es5.d.ts +6 -0
- package/dom-watcher/es5.d.ts +25 -0
- package/esm-map.json +32 -7
- package/hooks/popup-manager/use-zindex/es5.d.ts +3 -0
- package/i18n-bridge/es5.d.ts +10 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/load-js/es5.d.ts +3 -0
- package/nextTiken/es5.d.ts +12 -0
- package/oss/es5.d.ts +2 -0
- package/package.json +4 -3
- package/pinyin-first-character/es5.d.ts +2 -0
- package/process-engine-info/es5.d.ts +13 -0
- package/pure-image-src/es5.d.ts +2 -0
- package/size-watcher/es5.d.ts +6 -0
- package/style/es5.d.ts +2 -0
- package/theme/es5.d.ts +92 -0
- package/theme/es5.js +1365 -0
- package/theme/index.d.ts +92 -0
- package/theme/index.js +871 -0
- package/theme/index.js.gz +0 -0
- package/token-tools/es5.d.ts +21 -0
- package/use-low-code/es5.d.ts +1 -0
- package/vue/es5.d.ts +1 -0
- package/vue/hooks/use-model-value/es5.d.ts +9 -0
- package/webSocket-service/es5.d.ts +41 -0
- package/with-install/es5.d.ts +11 -0
- package/hooks/use-get-auth/es5.js +0 -67
- package/hooks/use-get-auth/index.d.ts +0 -4
- package/hooks/use-get-auth/index.js +0 -19
package/common-info/index.js.gz
CHANGED
|
Binary file
|
package/common-info/type.d.ts
CHANGED
|
@@ -116,8 +116,8 @@ export interface HomeInfo {
|
|
|
116
116
|
export interface PersonalConfigInfo {
|
|
117
117
|
/** 侧边栏菜单风格(1:弹出式;2:内嵌式 )*/
|
|
118
118
|
style: 1 | 2
|
|
119
|
-
/** 皮肤风格 (default
|
|
120
|
-
skinStyle: 'default' | '
|
|
119
|
+
/** 皮肤风格 (default:经典蓝;cjb:纯净白;ssl:深邃蓝;dkh:大咖红)*/
|
|
120
|
+
skinStyle: 'default' | 'cjb' | 'ssl' | 'dkh'
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
export interface ProjectInfo {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 判断两个数组是否内容相等
|
|
3
|
+
* @param a 数组一
|
|
4
|
+
* @param b 数组二
|
|
5
|
+
* @param isSort 是否排序完成之后再比较,也就是顺序无关,默认为true
|
|
6
|
+
* @returns 是否相等
|
|
7
|
+
*/
|
|
8
|
+
export declare const arrEqual: (a: any[], b: any[], isSort?: boolean) => boolean;
|
|
9
|
+
/**
|
|
10
|
+
* 根据数组对象的某个字段去重
|
|
11
|
+
* @param arr 需要处理的数组
|
|
12
|
+
* @param val 要根据哪个字段来去重
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
export declare const arrUnique: (arr: any[], val: string) => any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const calcTextWidth: (text: string, fontSize: number) => any;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from '@das-fed/upf-utils/common-tools/date-format';
|
|
2
|
+
export * from '@das-fed/upf-utils/common-tools/get-url-params';
|
|
3
|
+
export * from '@das-fed/upf-utils/common-tools/nest-tree-format';
|
|
4
|
+
export * from '@das-fed/upf-utils/common-tools/obj-tools';
|
|
5
|
+
export * from '@das-fed/upf-utils/common-tools/arr-tools';
|
|
6
|
+
export * from '@das-fed/upf-utils/common-tools/handle-data';
|
|
7
|
+
export * from '@das-fed/upf-utils/common-tools/setHtmlMinWH';
|
|
8
|
+
export * from '@das-fed/upf-utils/common-tools/queue-promise';
|
|
9
|
+
export * from '@das-fed/upf-utils/common-tools/platform-tools';
|
|
10
|
+
export * from '@das-fed/upf-utils/common-tools/update-fav-icon';
|
|
11
|
+
export * from '@das-fed/upf-utils/common-tools/update-browser-title';
|
|
12
|
+
export * from '@das-fed/upf-utils/common-tools/extract-file-name';
|
|
13
|
+
export * from '@das-fed/upf-utils/common-tools/get-file-extension';
|
|
14
|
+
export * from '@das-fed/upf-utils/common-tools/calc-text-width';
|
|
15
|
+
export * from '@das-fed/upf-utils/common-tools/timezone-format';
|
package/common-tools/es5.js
CHANGED
|
@@ -14,6 +14,7 @@ var updateBrowserTitle = require('@das-fed/upf-utils/common-tools/update-browser
|
|
|
14
14
|
var extractFileName = require('@das-fed/upf-utils/common-tools/extract-file-name/es5');
|
|
15
15
|
var getFileExtension = require('@das-fed/upf-utils/common-tools/get-file-extension/es5');
|
|
16
16
|
var calcTextWidth = require('@das-fed/upf-utils/common-tools/calc-text-width/es5');
|
|
17
|
+
var timezoneFormat = require('@das-fed/upf-utils/common-tools/timezone-format/es5');
|
|
17
18
|
Object.keys(dateFormat).forEach(function (k) {
|
|
18
19
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
19
20
|
enumerable: true,
|
|
@@ -126,3 +127,11 @@ Object.keys(calcTextWidth).forEach(function (k) {
|
|
|
126
127
|
}
|
|
127
128
|
});
|
|
128
129
|
});
|
|
130
|
+
Object.keys(timezoneFormat).forEach(function (k) {
|
|
131
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
132
|
+
enumerable: true,
|
|
133
|
+
get: function get() {
|
|
134
|
+
return timezoneFormat[k];
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const extractFilename: (fileUrl: string) => unknown;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取url中的参数
|
|
3
|
+
* @param url url地址
|
|
4
|
+
* @param queryName 参数名称,不传则返回参数集合
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
export declare const getUrlParams: (allUrl?: string, queryName?: string) => any;
|
|
8
|
+
/**
|
|
9
|
+
* 拼接完整的url
|
|
10
|
+
* @param url pathname
|
|
11
|
+
* @param queryObj 参数集合
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
export declare const getFullPath: (url: string, queryObj?: any) => string;
|
|
15
|
+
/**
|
|
16
|
+
* 删除url中指定的参数,并返回最终的url
|
|
17
|
+
* @param queryNames 数组,需要删除的参数名集合
|
|
18
|
+
* @param url 指定url
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
export declare const funcUrlDel: (queryNames: string[], url?: string) => string;
|
|
22
|
+
/**
|
|
23
|
+
* 将url中的query参数转换成对象
|
|
24
|
+
* @param url url链接,域名可带可不带
|
|
25
|
+
* @returns params url链接参数转化的Object
|
|
26
|
+
*/
|
|
27
|
+
export declare const urlParamsToObject: (url: string) => any;
|
|
28
|
+
/**
|
|
29
|
+
* 将对象转换成url中的query参数
|
|
30
|
+
* @param params 参数对象
|
|
31
|
+
* @returns url形式的参数
|
|
32
|
+
*/
|
|
33
|
+
export declare const objectToUrlparams: (params: any) => string;
|
|
34
|
+
/**
|
|
35
|
+
* 给url拼接params参数
|
|
36
|
+
* @param url 路径
|
|
37
|
+
* @param pathParams 参数,数组格式
|
|
38
|
+
* @returns
|
|
39
|
+
*/
|
|
40
|
+
export declare const addPathParamsToUrl: (url: string, pathParams: string[]) => any;
|
|
41
|
+
/**
|
|
42
|
+
* 从URL中获取origin
|
|
43
|
+
* @param url url
|
|
44
|
+
* @returns origin
|
|
45
|
+
*/
|
|
46
|
+
export declare function getOriginFromUrl(url: string): any;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type I18nResourceMap = Record<string, any>;
|
|
2
|
+
export interface HandleI18nDataResult {
|
|
3
|
+
frontEnd: Record<string, I18nResourceMap> | null;
|
|
4
|
+
dasUiEnd: I18nResourceMap | null;
|
|
5
|
+
backMsg: Record<string, I18nResourceMap> | null;
|
|
6
|
+
}
|
|
7
|
+
export interface HandleI18nDataOptions {
|
|
8
|
+
currentLang?: string;
|
|
9
|
+
baseUrl?: string;
|
|
10
|
+
appName?: string | string[];
|
|
11
|
+
isPullFrontEnd?: boolean;
|
|
12
|
+
isPullBack?: boolean;
|
|
13
|
+
isDasUI?: boolean;
|
|
14
|
+
fallbackBaseUrl?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 判断是否为空值
|
|
18
|
+
* @param value 需要判断的值
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
export declare const isEmpty: (value: any) => boolean;
|
|
22
|
+
export declare const isCurrentLangInSysLang: (lang: string) => any;
|
|
23
|
+
/**
|
|
24
|
+
* 处理多语言在打包时的数据
|
|
25
|
+
* @param opt
|
|
26
|
+
* @param opt.currentLang - 当前语言,默认 'zh-CN'
|
|
27
|
+
* @param opt.baseUrl - 资源基础路径,默认 '/'
|
|
28
|
+
* @param opt.appName - 应用名称,支持 string 或 string[],默认 'jc'
|
|
29
|
+
* @param opt.isPullFrontEnd - 是否加载前端资源,默认 true
|
|
30
|
+
* @param opt.isPullBack - 是否加载后端资源,默认 false
|
|
31
|
+
* @param opt.isDasUI - 是否加载 DasUI 资源,默认 false
|
|
32
|
+
* @param opt.fallbackBaseUrl - 回退资源路径,默认 ''
|
|
33
|
+
*/
|
|
34
|
+
export declare const handleI18nData: (opt?: HandleI18nDataOptions) => Promise<HandleI18nDataResult>;
|
|
@@ -17,11 +17,49 @@ var M = function M(f) {
|
|
|
17
17
|
return (((n = config.getConfig()) == null ? undefined : n.systemLangList) || ["zh-CN", "en-US", "zh-MO"]).includes(f);
|
|
18
18
|
},
|
|
19
19
|
A = /*#__PURE__*/function () {
|
|
20
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(
|
|
21
|
-
var
|
|
20
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
|
|
21
|
+
var f,
|
|
22
|
+
x,
|
|
23
|
+
_x$currentLang,
|
|
24
|
+
n,
|
|
25
|
+
_x$baseUrl,
|
|
26
|
+
c,
|
|
27
|
+
_x$appName,
|
|
28
|
+
h,
|
|
29
|
+
_x$isPullFrontEnd,
|
|
30
|
+
L,
|
|
31
|
+
_x$isPullBack,
|
|
32
|
+
N,
|
|
33
|
+
_x$isDasUI,
|
|
34
|
+
O,
|
|
35
|
+
_x$fallbackBaseUrl,
|
|
36
|
+
a,
|
|
37
|
+
l,
|
|
38
|
+
y,
|
|
39
|
+
j,
|
|
40
|
+
r,
|
|
41
|
+
_iterator,
|
|
42
|
+
_step,
|
|
43
|
+
s,
|
|
44
|
+
$,
|
|
45
|
+
w,
|
|
46
|
+
u,
|
|
47
|
+
_r,
|
|
48
|
+
_iterator2,
|
|
49
|
+
_step2,
|
|
50
|
+
_s,
|
|
51
|
+
_$,
|
|
52
|
+
_w,
|
|
53
|
+
_u,
|
|
54
|
+
_r2,
|
|
55
|
+
_s2,
|
|
56
|
+
_args4 = arguments,
|
|
57
|
+
_t3,
|
|
58
|
+
_t4;
|
|
22
59
|
return _regenerator().w(function (_context4) {
|
|
23
60
|
while (1) switch (_context4.p = _context4.n) {
|
|
24
61
|
case 0:
|
|
62
|
+
f = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
|
25
63
|
x = f || {};
|
|
26
64
|
_x$currentLang = x.currentLang, n = _x$currentLang === void 0 ? "zh-CN" : _x$currentLang, _x$baseUrl = x.baseUrl, c = _x$baseUrl === void 0 ? "/" : _x$baseUrl, _x$appName = x.appName, h = _x$appName === void 0 ? "jc" : _x$appName, _x$isPullFrontEnd = x.isPullFrontEnd, L = _x$isPullFrontEnd === void 0 ? true : _x$isPullFrontEnd, _x$isPullBack = x.isPullBack, N = _x$isPullBack === void 0 ? false : _x$isPullBack, _x$isDasUI = x.isDasUI, O = _x$isDasUI === void 0 ? false : _x$isDasUI, _x$fallbackBaseUrl = x.fallbackBaseUrl, a = _x$fallbackBaseUrl === void 0 ? "" : _x$fallbackBaseUrl;
|
|
27
65
|
(typeof n != "string" || !n) && (n = "zh-CN");
|
|
@@ -110,7 +148,7 @@ var M = function M(f) {
|
|
|
110
148
|
}
|
|
111
149
|
}, _callee, null, [[0, 8]]);
|
|
112
150
|
}));
|
|
113
|
-
return function u(
|
|
151
|
+
return function u(_x3) {
|
|
114
152
|
return _ref3.apply(this, arguments);
|
|
115
153
|
};
|
|
116
154
|
}();
|
|
@@ -171,7 +209,7 @@ var M = function M(f) {
|
|
|
171
209
|
}
|
|
172
210
|
}, _callee2);
|
|
173
211
|
}));
|
|
174
|
-
return function U(
|
|
212
|
+
return function U(_x4) {
|
|
175
213
|
return _ref4.apply(this, arguments);
|
|
176
214
|
};
|
|
177
215
|
}();
|
|
@@ -203,7 +241,7 @@ var M = function M(f) {
|
|
|
203
241
|
}
|
|
204
242
|
}, _callee3);
|
|
205
243
|
}));
|
|
206
|
-
return function j(
|
|
244
|
+
return function j(_x, _x2) {
|
|
207
245
|
return _ref2.apply(this, arguments);
|
|
208
246
|
};
|
|
209
247
|
}();
|
|
@@ -298,7 +336,7 @@ var M = function M(f) {
|
|
|
298
336
|
}
|
|
299
337
|
}, _callee4, null, [[10, 15, 16, 17], [1, 6, 7, 8]]);
|
|
300
338
|
}));
|
|
301
|
-
return function A(
|
|
339
|
+
return function A() {
|
|
302
340
|
return _ref.apply(this, arguments);
|
|
303
341
|
};
|
|
304
342
|
}();
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
export type I18nResourceMap = Record<string, any>;
|
|
2
|
+
export interface HandleI18nDataResult {
|
|
3
|
+
frontEnd: Record<string, I18nResourceMap> | null;
|
|
4
|
+
dasUiEnd: I18nResourceMap | null;
|
|
5
|
+
backMsg: Record<string, I18nResourceMap> | null;
|
|
6
|
+
}
|
|
7
|
+
export interface HandleI18nDataOptions {
|
|
8
|
+
currentLang?: string;
|
|
9
|
+
baseUrl?: string;
|
|
10
|
+
appName?: string | string[];
|
|
11
|
+
isPullFrontEnd?: boolean;
|
|
12
|
+
isPullBack?: boolean;
|
|
13
|
+
isDasUI?: boolean;
|
|
14
|
+
fallbackBaseUrl?: string;
|
|
15
|
+
}
|
|
1
16
|
/**
|
|
2
17
|
* 判断是否为空值
|
|
3
18
|
* @param value 需要判断的值
|
|
@@ -16,4 +31,4 @@ export declare const isCurrentLangInSysLang: (lang: string) => any;
|
|
|
16
31
|
* @param opt.isDasUI - 是否加载 DasUI 资源,默认 false
|
|
17
32
|
* @param opt.fallbackBaseUrl - 回退资源路径,默认 ''
|
|
18
33
|
*/
|
|
19
|
-
export declare const handleI18nData: (opt
|
|
34
|
+
export declare const handleI18nData: (opt?: HandleI18nDataOptions) => Promise<HandleI18nDataResult>;
|
|
@@ -2,7 +2,7 @@ import { getConfig as _ } from "@das-fed/upf-utils/config";
|
|
|
2
2
|
const M = (f) => f === null || typeof f > "u" || f === "", z = (f) => {
|
|
3
3
|
var n;
|
|
4
4
|
return (((n = _()) == null ? void 0 : n.systemLangList) || ["zh-CN", "en-US", "zh-MO"]).includes(f);
|
|
5
|
-
}, A = async (f) => {
|
|
5
|
+
}, A = async (f = {}) => {
|
|
6
6
|
const x = f || {};
|
|
7
7
|
let {
|
|
8
8
|
currentLang: n = "zh-CN",
|
|
Binary file
|
package/common-tools/index.d.ts
CHANGED
|
@@ -12,3 +12,4 @@ export * from '@das-fed/upf-utils/common-tools/update-browser-title';
|
|
|
12
12
|
export * from '@das-fed/upf-utils/common-tools/extract-file-name';
|
|
13
13
|
export * from '@das-fed/upf-utils/common-tools/get-file-extension';
|
|
14
14
|
export * from '@das-fed/upf-utils/common-tools/calc-text-width';
|
|
15
|
+
export * from '@das-fed/upf-utils/common-tools/timezone-format';
|
package/common-tools/index.js
CHANGED
|
@@ -12,3 +12,4 @@ export * from "@das-fed/upf-utils/common-tools/update-browser-title";
|
|
|
12
12
|
export * from "@das-fed/upf-utils/common-tools/extract-file-name";
|
|
13
13
|
export * from "@das-fed/upf-utils/common-tools/get-file-extension";
|
|
14
14
|
export * from "@das-fed/upf-utils/common-tools/calc-text-width";
|
|
15
|
+
export * from "@das-fed/upf-utils/common-tools/timezone-format";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 过滤掉叶子节点,返回嵌套数组
|
|
3
|
+
* @param arr 要过滤的树
|
|
4
|
+
* @param children 子节点指定字段名,默认‘children’
|
|
5
|
+
* @returns 返回过滤掉叶子节点的嵌套数组
|
|
6
|
+
*/
|
|
7
|
+
export declare const findNonEmptyChildrenItems: (arr: any[], children?: string) => any[];
|
|
8
|
+
/**
|
|
9
|
+
* 树形数组转扁平数组
|
|
10
|
+
* @param list 要拍平的树
|
|
11
|
+
* @param child 子节点指定字段名,默认‘children’
|
|
12
|
+
* @param deleteChild 是否删除children字段,默认为true
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
export declare const flatTree: (list: any[], child?: string, deleteChild?: boolean) => any[];
|
|
16
|
+
/**
|
|
17
|
+
* 根据条件过滤节点
|
|
18
|
+
* @param tree 要过滤的树
|
|
19
|
+
* @param predicate 过滤条件,符合条件的节点保留
|
|
20
|
+
* @param children 子节点指定字段名,默认‘children’
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
export declare const filterTreeArray: (tree: any[], predicate: (node: any) => boolean, children?: string) => any;
|
|
24
|
+
/**
|
|
25
|
+
* 树结构查找节点,深度优先
|
|
26
|
+
* @param tree 要过滤的树
|
|
27
|
+
* @param func 过滤条件,符合条件的节点保留(参数为函数,返回值为布尔值)
|
|
28
|
+
* @returns 查找到的节点
|
|
29
|
+
*/
|
|
30
|
+
export declare const treeFind: (tree: any[], func: (node: any) => boolean, children?: string) => any;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 判断一个 URL 路径是否是相对路径或者同域名
|
|
3
|
+
* @param url
|
|
4
|
+
* @returns
|
|
5
|
+
*/
|
|
6
|
+
export declare const isRelativeOrSameDomain: (url: string) => boolean;
|
|
7
|
+
/**
|
|
8
|
+
* 自动拼接上showLayout=false参数
|
|
9
|
+
* @param url
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
export declare const setShowLayout: (url: string) => string;
|
|
13
|
+
export declare const setShowWatermark: (url: string) => string;
|
|
14
|
+
/**
|
|
15
|
+
* url携带token
|
|
16
|
+
* @param url
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
export declare const withToken: (url: string) => string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
2
|
+
|
|
3
|
+
type TimeValue = string | number | Date | Dayjs | null | undefined;
|
|
4
|
+
export interface TimeZoneDisplayOptions {
|
|
5
|
+
value?: TimeValue;
|
|
6
|
+
locale?: string;
|
|
7
|
+
format?: string;
|
|
8
|
+
timeZone?: string;
|
|
9
|
+
supportedLocales?: string[];
|
|
10
|
+
showDaylightSavingLabel?: boolean;
|
|
11
|
+
showDaylightSavingMarker?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface TimeZoneDisplayResult {
|
|
14
|
+
formattedValue: string;
|
|
15
|
+
locale: string;
|
|
16
|
+
timeZone: string;
|
|
17
|
+
timeZoneName: string;
|
|
18
|
+
timeZoneLabel: string;
|
|
19
|
+
offsetLabel: string;
|
|
20
|
+
offsetMinutes: number;
|
|
21
|
+
isDaylightSavingTime: boolean;
|
|
22
|
+
daylightSavingLabel: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const getClientTimeZone: () => any;
|
|
25
|
+
export declare const normalizeLocaleCode: (locale?: string, supportedLocales?: string[]) => any;
|
|
26
|
+
export declare const isDaylightSavingTime: (timeZone?: string, value?: TimeValue) => boolean;
|
|
27
|
+
export declare const getTimeZoneDisplayInfo: (options?: TimeZoneDisplayOptions) => TimeZoneDisplayResult;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
4
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
6
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
7
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
8
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
9
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
10
|
+
var l = require('dayjs');
|
|
11
|
+
var T = require('dayjs/plugin/utc');
|
|
12
|
+
var w = require('dayjs/plugin/timezone');
|
|
13
|
+
l.extend(T);
|
|
14
|
+
l.extend(w);
|
|
15
|
+
var f = "zh-CN",
|
|
16
|
+
y = "YYYY.MM.DD HH:mm:ss",
|
|
17
|
+
D = "UTC",
|
|
18
|
+
m = {
|
|
19
|
+
zh: "夏令时",
|
|
20
|
+
"default": "DST"
|
|
21
|
+
},
|
|
22
|
+
u = function u() {
|
|
23
|
+
return l.tz.guess() || D;
|
|
24
|
+
},
|
|
25
|
+
v = function v() {
|
|
26
|
+
var t;
|
|
27
|
+
return (typeof window === "undefined" ? "undefined" : _typeof(window)) < "u" && (t = window.navigator) != null && t.language ? window.navigator.language : f;
|
|
28
|
+
},
|
|
29
|
+
S = function S(t) {
|
|
30
|
+
var e = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
31
|
+
var n = t || v() || f,
|
|
32
|
+
r = n.toLowerCase();
|
|
33
|
+
if (!e.length) return r === "en" ? "en-US" : r === "zh" || r === "zh-cn" ? f : n;
|
|
34
|
+
var a = e.find(function (i) {
|
|
35
|
+
return i.toLowerCase() === r;
|
|
36
|
+
});
|
|
37
|
+
if (a) return a;
|
|
38
|
+
var c = r.split("-")[0],
|
|
39
|
+
s = e.find(function (i) {
|
|
40
|
+
return i.toLowerCase().split("-")[0] === c;
|
|
41
|
+
});
|
|
42
|
+
return s || (c === "en" ? e.find(function (i) {
|
|
43
|
+
return i.toLowerCase().startsWith("en-");
|
|
44
|
+
}) || n : c === "zh" ? e.find(function (i) {
|
|
45
|
+
return i.toLowerCase().startsWith("zh-");
|
|
46
|
+
}) || f : n);
|
|
47
|
+
},
|
|
48
|
+
g = function g(t) {
|
|
49
|
+
if (l.isDayjs(t)) return t;
|
|
50
|
+
if (t == null || t === "") return l();
|
|
51
|
+
var e = l(t);
|
|
52
|
+
return e.isValid() ? e : l();
|
|
53
|
+
},
|
|
54
|
+
h = function h(t) {
|
|
55
|
+
if (!t) return u();
|
|
56
|
+
try {
|
|
57
|
+
return new Intl.DateTimeFormat(void 0, {
|
|
58
|
+
timeZone: t
|
|
59
|
+
}), t;
|
|
60
|
+
} catch (_unused) {
|
|
61
|
+
return u();
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
L = function L(t) {
|
|
65
|
+
return "UTC".concat(t);
|
|
66
|
+
},
|
|
67
|
+
z = function z(t, e) {
|
|
68
|
+
var o = t.match(/([+-]\d{1,2})(?::?(\d{2}))?/) || [];
|
|
69
|
+
if (!o[1]) return e;
|
|
70
|
+
var n = o[1].startsWith("-") ? "-" : "+",
|
|
71
|
+
r = o[1].replace(/[+-]/, "").padStart(2, "0"),
|
|
72
|
+
a = o[2] || "00";
|
|
73
|
+
return "UTC".concat(n).concat(r, ":").concat(a);
|
|
74
|
+
},
|
|
75
|
+
C = function C(t, e, o) {
|
|
76
|
+
var r, a;
|
|
77
|
+
var n = L(o.format("Z"));
|
|
78
|
+
try {
|
|
79
|
+
var c = Intl.DateTimeFormat.supportedLocalesOf([e])[0] || e,
|
|
80
|
+
s = (a = (r = new Intl.DateTimeFormat(c, {
|
|
81
|
+
timeZone: t,
|
|
82
|
+
timeZoneName: "long"
|
|
83
|
+
}).formatToParts(o.toDate()).find(function (i) {
|
|
84
|
+
return i.type === "timeZoneName";
|
|
85
|
+
})) == null ? void 0 : r.value) == null ? void 0 : a.trim();
|
|
86
|
+
return s ? /^(gmt|utc)/i.test(s) ? z(s, n) : s : n;
|
|
87
|
+
} catch (_unused2) {
|
|
88
|
+
return n;
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
Z = function Z(t, e) {
|
|
92
|
+
var o = e.year();
|
|
93
|
+
return Array.from(new Set(Array.from({
|
|
94
|
+
length: 12
|
|
95
|
+
}, function (n, r) {
|
|
96
|
+
var a = "".concat(r + 1).padStart(2, "0");
|
|
97
|
+
return l.tz("".concat(o, "-").concat(a, "-15 12:00:00"), t).utcOffset();
|
|
98
|
+
})));
|
|
99
|
+
},
|
|
100
|
+
b = function b(t, e) {
|
|
101
|
+
var o = h(t),
|
|
102
|
+
n = g(e).tz(o),
|
|
103
|
+
r = Z(o, n);
|
|
104
|
+
return r.length <= 1 ? false : n.utcOffset() > Math.min.apply(Math, _toConsumableArray(r));
|
|
105
|
+
},
|
|
106
|
+
A = function A(t) {
|
|
107
|
+
var e = t.toLowerCase().split("-")[0];
|
|
108
|
+
return m[e] || m["default"];
|
|
109
|
+
},
|
|
110
|
+
O = function O(t) {
|
|
111
|
+
var _t$showDaylightSaving;
|
|
112
|
+
return typeof t.showDaylightSavingLabel == "boolean" ? t.showDaylightSavingLabel : (_t$showDaylightSaving = t.showDaylightSavingMarker) !== null && _t$showDaylightSaving !== void 0 ? _t$showDaylightSaving : true;
|
|
113
|
+
},
|
|
114
|
+
U = function U() {
|
|
115
|
+
var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
116
|
+
var e = S(t.locale, t.supportedLocales),
|
|
117
|
+
o = h(t.timeZone),
|
|
118
|
+
n = g(t.value).tz(o),
|
|
119
|
+
r = C(o, e, n),
|
|
120
|
+
a = L(n.format("Z")),
|
|
121
|
+
c = b(o, n),
|
|
122
|
+
s = c ? A(e) : "",
|
|
123
|
+
i = O(t),
|
|
124
|
+
d = c && i ? "".concat(r, " - ").concat(s) : r;
|
|
125
|
+
return {
|
|
126
|
+
formattedValue: n.format(t.format || y),
|
|
127
|
+
locale: e,
|
|
128
|
+
timeZone: o,
|
|
129
|
+
timeZoneName: r,
|
|
130
|
+
timeZoneLabel: d,
|
|
131
|
+
offsetLabel: a,
|
|
132
|
+
offsetMinutes: n.utcOffset(),
|
|
133
|
+
isDaylightSavingTime: c,
|
|
134
|
+
daylightSavingLabel: s
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
exports.getClientTimeZone = u;
|
|
138
|
+
exports.getTimeZoneDisplayInfo = U;
|
|
139
|
+
exports.isDaylightSavingTime = b;
|
|
140
|
+
exports.normalizeLocaleCode = S;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
2
|
+
|
|
3
|
+
type TimeValue = string | number | Date | Dayjs | null | undefined;
|
|
4
|
+
export interface TimeZoneDisplayOptions {
|
|
5
|
+
value?: TimeValue;
|
|
6
|
+
locale?: string;
|
|
7
|
+
format?: string;
|
|
8
|
+
timeZone?: string;
|
|
9
|
+
supportedLocales?: string[];
|
|
10
|
+
showDaylightSavingLabel?: boolean;
|
|
11
|
+
showDaylightSavingMarker?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface TimeZoneDisplayResult {
|
|
14
|
+
formattedValue: string;
|
|
15
|
+
locale: string;
|
|
16
|
+
timeZone: string;
|
|
17
|
+
timeZoneName: string;
|
|
18
|
+
timeZoneLabel: string;
|
|
19
|
+
offsetLabel: string;
|
|
20
|
+
offsetMinutes: number;
|
|
21
|
+
isDaylightSavingTime: boolean;
|
|
22
|
+
daylightSavingLabel: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const getClientTimeZone: () => any;
|
|
25
|
+
export declare const normalizeLocaleCode: (locale?: string, supportedLocales?: string[]) => any;
|
|
26
|
+
export declare const isDaylightSavingTime: (timeZone?: string, value?: TimeValue) => boolean;
|
|
27
|
+
export declare const getTimeZoneDisplayInfo: (options?: TimeZoneDisplayOptions) => TimeZoneDisplayResult;
|
|
28
|
+
export {};
|