@das-fed/upf-utils 6.4.0-hot.12 → 6.4.0-hot.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-services/es5.d.ts +2 -0
- package/api-services/es5.js +1619 -1580
- package/api-services/i18n/es5.d.ts +63 -0
- package/api-services/index.js +1305 -1284
- 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 +957 -909
- package/api-services/modules/app-manage/index.js +746 -711
- 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 +1650 -1587
- package/api-services/modules/authentication/index.js +1410 -1353
- 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 +1253 -1202
- package/api-services/modules/bems/index.js +1034 -995
- 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 +1250 -1199
- package/api-services/modules/contract/index.js +1035 -996
- 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 +963 -912
- package/api-services/modules/duty-manage/index.js +755 -716
- 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 +1250 -1199
- package/api-services/modules/enterpriseright/index.js +1035 -996
- 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 +1113 -1062
- package/api-services/modules/file/es5.d.ts +37 -0
- package/api-services/modules/file/es5.js +1005 -954
- package/api-services/modules/file/index.js +786 -747
- 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 +1650 -1587
- package/api-services/modules/gateway-edge/index.js +1410 -1353
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/index.js +856 -817
- 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 +1389 -1350
- package/api-services/modules/iot/index.js +1153 -1132
- 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 +1327 -1285
- package/api-services/modules/justauth/index.js +1111 -1086
- 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 +1326 -1284
- package/api-services/modules/knowledge/index.js +1111 -1086
- 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 +1650 -1587
- package/api-services/modules/link/index.js +1410 -1353
- 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 +1250 -1199
- package/api-services/modules/permission/index.js +1035 -996
- 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 +966 -915
- package/api-services/modules/platformManage/index.js +755 -716
- 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 +1650 -1587
- package/api-services/modules/portal/index.js +1410 -1353
- 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 +968 -917
- package/api-services/modules/space-manage/index.js +763 -724
- 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 +1260 -1209
- package/api-services/modules/super-admin/index.js +1038 -999
- 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 +1249 -1198
- package/api-services/modules/supplier/index.js +1032 -993
- 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 +1398 -1359
- package/api-services/modules/supplychain-manage/index.js +1171 -1150
- 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 +1250 -1199
- package/api-services/modules/systemConfiguration/index.js +1035 -996
- 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 +1398 -1359
- package/api-services/modules/tool/index.js +1171 -1150
- 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 +1396 -1357
- package/api-services/src/create-service/index.js +1170 -1149
- package/api-services/src/create-service/index.js.gz +0 -0
- package/atob/es5.d.ts +2 -0
- package/common-info/es5.d.ts +73 -0
- package/common-info/es5.js +2155 -2063
- 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 +1239 -1150
- package/common-info/getPermissionMethod/index.d.ts +57 -6
- package/common-info/getPermissionMethod/index.js +992 -928
- package/common-info/getPermissionMethod/index.js.gz +0 -0
- package/common-info/index.d.ts +5 -8
- package/common-info/index.js +1818 -1751
- 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 +132 -0
- package/common-tools/timezone-format/es5.js +822 -0
- package/common-tools/timezone-format/get-iana-data/dayjs-timezone-iana-plugin.d.ts +72 -0
- package/common-tools/timezone-format/get-iana-data/iana-api-fetch.d.ts +21 -0
- package/common-tools/timezone-format/get-iana-data/moment-iana-loader.d.ts +29 -0
- package/common-tools/timezone-format/index.d.ts +132 -0
- package/common-tools/timezone-format/index.js +439 -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 +1397 -1358
- package/create-api-service/i18n/es5.d.ts +39 -0
- package/create-api-service/index.js +1171 -1150
- 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/auth/es5.js +50 -42
- package/directive/auth/index.d.ts +1 -1
- package/directive/auth/index.js +42 -34
- package/directive/auth/index.js.gz +0 -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 +66 -3
- package/hooks/popup-manager/use-zindex/es5.d.ts +3 -0
- package/hooks/use-get-auth/apis.d.ts +4 -0
- package/hooks/use-get-auth/es5.d.ts +8 -0
- package/hooks/use-get-auth/es5.js +325 -57
- package/hooks/use-get-auth/index.d.ts +8 -4
- package/hooks/use-get-auth/index.js +71 -16
- package/hooks/use-get-auth/index.js.gz +0 -0
- package/i18n-bridge/es5.d.ts +10 -0
- package/index.d.ts +2 -0
- package/index.js +2 -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 +111 -0
- package/theme/es5.js +1676 -0
- package/theme/index.d.ts +111 -0
- package/theme/index.js +1118 -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/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,132 @@
|
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
2
|
+
import { default as dayjsTimezoneIanaPlugin, PackedIanaData, PreloadDayjsIanaOptions } from './get-iana-data/dayjs-timezone-iana-plugin';
|
|
3
|
+
import { loadIanaData as loadMomentIanaData, loadIanaFromApi as loadMomentIanaFromApi, LoadIanaFromApiOptions, MomentWithTimezone, PackedIanaTzData } from './get-iana-data/moment-iana-loader';
|
|
4
|
+
|
|
5
|
+
export * from './get-iana-data';
|
|
6
|
+
export { dayjsTimezoneIanaPlugin, loadMomentIanaData, loadMomentIanaFromApi };
|
|
7
|
+
export type TimeValue = string | number | Date | Dayjs | null | undefined;
|
|
8
|
+
export type TimeZoneFlag = number | string | null | undefined;
|
|
9
|
+
export type TimeZoneDateLibrary = 'dayjs' | 'moment';
|
|
10
|
+
export type TimeZoneInputMode = 'instant' | 'local';
|
|
11
|
+
interface MomentFormatValue {
|
|
12
|
+
tz?: (timeZone: string) => MomentFormatValue;
|
|
13
|
+
format: (format?: string) => string;
|
|
14
|
+
isValid?: () => boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface MomentTimezoneFormatInstance extends MomentWithTimezone {
|
|
17
|
+
(value?: unknown): MomentFormatValue;
|
|
18
|
+
tz: MomentWithTimezone['tz'] & {
|
|
19
|
+
(value?: unknown, timeZone?: string): MomentFormatValue;
|
|
20
|
+
guess?: () => string;
|
|
21
|
+
setDefault?: (zone: string) => void;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface TimeZoneOption {
|
|
25
|
+
/** IANA 时区标识,如 Asia/Shanghai。 */
|
|
26
|
+
timeZoneId: string;
|
|
27
|
+
/** 后端下发的本地化展示名。 */
|
|
28
|
+
tzShowName?: string;
|
|
29
|
+
/** 关联城市名,保留给后续业务自定义展示。 */
|
|
30
|
+
cities?: string[];
|
|
31
|
+
/** 1 表示存在夏令时规则,0 表示固定偏移。 */
|
|
32
|
+
dynamicOffsetFlag?: TimeZoneFlag;
|
|
33
|
+
/** 1 表示当前处于夏令时,0 表示当前非夏令时。 */
|
|
34
|
+
currentDstFlag?: TimeZoneFlag;
|
|
35
|
+
/** 标准 UTC 偏移量文本,如 +08:00。 */
|
|
36
|
+
baseUtcOffsetText?: string;
|
|
37
|
+
/** 当前实际 UTC 偏移量文本,包含夏令时偏移。 */
|
|
38
|
+
currentUtcOffsetText?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface TimeZoneDisplayOption {
|
|
41
|
+
/** IANA 时区标识,作为下拉 value。 */
|
|
42
|
+
value: string;
|
|
43
|
+
/** 下拉展示文本。 */
|
|
44
|
+
label: string;
|
|
45
|
+
/** 主展示区使用的时区名称。 */
|
|
46
|
+
zoneName: string;
|
|
47
|
+
/** 是否存在夏令时规则。 */
|
|
48
|
+
hasDST: boolean;
|
|
49
|
+
/** 当前是否处于夏令时。 */
|
|
50
|
+
isDST: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface TimeZoneDisplayOptions {
|
|
53
|
+
value?: TimeValue;
|
|
54
|
+
locale?: string;
|
|
55
|
+
format?: string;
|
|
56
|
+
timeZone?: string;
|
|
57
|
+
supportedLocales?: string[];
|
|
58
|
+
showDaylightSavingLabel?: boolean;
|
|
59
|
+
showDaylightSavingMarker?: boolean;
|
|
60
|
+
}
|
|
61
|
+
export interface TimeZoneDisplayResult {
|
|
62
|
+
formattedValue: string;
|
|
63
|
+
locale: string;
|
|
64
|
+
timeZone: string;
|
|
65
|
+
timeZoneName: string;
|
|
66
|
+
timeZoneLabel: string;
|
|
67
|
+
offsetLabel: string;
|
|
68
|
+
offsetMinutes: number;
|
|
69
|
+
isDaylightSavingTime: boolean;
|
|
70
|
+
daylightSavingLabel: string;
|
|
71
|
+
}
|
|
72
|
+
export interface FormatClientLocalDateTimeLineOptions {
|
|
73
|
+
showZoneLabel?: boolean;
|
|
74
|
+
zoneLabel?: string;
|
|
75
|
+
/** 是否存在夏令时规则;未传时回退本地规则判断。 */
|
|
76
|
+
hasDST?: boolean;
|
|
77
|
+
/** 当前是否处于夏令时;未传时回退本地规则判断。 */
|
|
78
|
+
isDST?: boolean;
|
|
79
|
+
standardTimeLabel?: string;
|
|
80
|
+
daylightSavingLabel?: string;
|
|
81
|
+
format?: string;
|
|
82
|
+
}
|
|
83
|
+
export interface FormatLocalDateTimeOptions {
|
|
84
|
+
/** 输出格式,默认 YYYY-MM-DD HH:mm:ss。 */
|
|
85
|
+
format?: string;
|
|
86
|
+
/** 目标 IANA 时区;为空时保持时间库本机格式化行为。 */
|
|
87
|
+
timeZone?: string | null;
|
|
88
|
+
/** 使用的时间库,默认 dayjs;c3 可传 moment。 */
|
|
89
|
+
dateLibrary?: TimeZoneDateLibrary;
|
|
90
|
+
/** moment 模式必须传当前应用同一个 moment-timezone 实例。 */
|
|
91
|
+
moment?: MomentTimezoneFormatInstance;
|
|
92
|
+
/** instant 表示转换真实时间点,local 表示把输入文本按目标时区本地时间解析。 */
|
|
93
|
+
inputMode?: TimeZoneInputMode;
|
|
94
|
+
/** 未传 timeZone 时是否读取 sessionStorage/客户端时区。默认 false,兼容旧 toLocalDate。 */
|
|
95
|
+
useClientTimeZone?: boolean;
|
|
96
|
+
}
|
|
97
|
+
export interface ApplyIanaTimeZoneOptions {
|
|
98
|
+
/** 指定默认时区,后续 dayjs.tz(value) 可直接使用。 */
|
|
99
|
+
defaultTimeZone?: string;
|
|
100
|
+
}
|
|
101
|
+
export interface LoadIanaTimeZoneOptions extends PreloadDayjsIanaOptions, ApplyIanaTimeZoneOptions {
|
|
102
|
+
}
|
|
103
|
+
export interface ApplyIanaTimeZoneResult {
|
|
104
|
+
data: PackedIanaData;
|
|
105
|
+
knownTimeZones: string[];
|
|
106
|
+
}
|
|
107
|
+
export interface LoadMomentIanaTimeZoneOptions extends LoadIanaFromApiOptions {
|
|
108
|
+
url?: string;
|
|
109
|
+
}
|
|
110
|
+
export declare const isKnownTimeZone: (timeZone?: string | null) => any;
|
|
111
|
+
export declare const rebuildKnownTimeZoneIds: (data: Pick<PackedIanaData, "zones" | "links">) => any;
|
|
112
|
+
export declare const getKnownTimeZoneIds: () => any;
|
|
113
|
+
export declare const applyDayjsIanaTimeZoneData: (data: PackedIanaData, options?: ApplyIanaTimeZoneOptions) => Promise<ApplyIanaTimeZoneResult>;
|
|
114
|
+
export declare const loadDayjsIanaTimeZoneData: (options?: LoadIanaTimeZoneOptions) => Promise<ApplyIanaTimeZoneResult>;
|
|
115
|
+
export declare const applyMomentIanaTimeZoneData: (moment: MomentWithTimezone, data: PackedIanaTzData) => PackedIanaTzData;
|
|
116
|
+
export declare const loadMomentIanaTimeZoneData: (moment: MomentWithTimezone, options?: LoadMomentIanaTimeZoneOptions) => unknown;
|
|
117
|
+
export declare const getClientTimeZone: () => any;
|
|
118
|
+
export declare const resolveTimeZone: (timeZone?: string | null) => any;
|
|
119
|
+
export declare const setDefaultTimeZone: (timeZone?: string | null) => boolean;
|
|
120
|
+
export declare const normalizeLocaleCode: (locale?: string, supportedLocales?: string[]) => any;
|
|
121
|
+
export declare const getZoneUtcOffset: (value: TimeValue, timeZone?: string | null) => any;
|
|
122
|
+
export declare const formatInTimeZone: (value?: TimeValue, timeZone?: string | null, format?: string) => any;
|
|
123
|
+
export declare const formatLocalDateTime: (value?: TimeValue, options?: FormatLocalDateTimeOptions | string) => string;
|
|
124
|
+
export declare const toLocalDate: (value?: TimeValue, format?: string, options?: Omit<FormatLocalDateTimeOptions, "format">) => string;
|
|
125
|
+
export declare const formatTimeZoneOffsetLabel: (value?: TimeValue, timeZone?: string | null) => string;
|
|
126
|
+
export declare const resolveUtcOffsetFallback: (option: Pick<TimeZoneOption, "timeZoneId" | "baseUtcOffsetText" | "currentUtcOffsetText">, referenceDate?: Date) => string;
|
|
127
|
+
export declare const timeZoneHasDST: (timeZone?: string | null, value?: TimeValue) => boolean;
|
|
128
|
+
export declare const timeZoneIsDST: (timeZone?: string | null, value?: TimeValue) => boolean;
|
|
129
|
+
export declare const isDaylightSavingTime: (timeZone?: string | null, value?: TimeValue) => boolean;
|
|
130
|
+
export declare const buildTimeZoneDisplayOptions: (options: TimeZoneOption[], referenceDate?: Date) => TimeZoneDisplayOption[];
|
|
131
|
+
export declare const formatClientLocalDateTimeLine: (value: TimeValue, timeZone?: string | null, options?: FormatClientLocalDateTimeLineOptions) => any;
|
|
132
|
+
export declare const getTimeZoneDisplayInfo: (options?: TimeZoneDisplayOptions) => TimeZoneDisplayResult;
|