@das-fed/upf-utils 6.4.0-dev.260 → 6.4.0-dev.261
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.js +833 -807
- package/api-services/index.js +642 -622
- package/api-services/index.js.gz +0 -0
- package/api-services/modules/app-manage/es5.js +999 -973
- package/api-services/modules/app-manage/index.js +787 -768
- package/api-services/modules/app-manage/index.js.gz +0 -0
- package/api-services/modules/authentication/es5.js +769 -741
- package/api-services/modules/authentication/index.js +600 -577
- package/api-services/modules/authentication/index.js.gz +0 -0
- package/api-services/modules/bems/es5.js +1237 -1197
- package/api-services/modules/bems/index.js +1015 -974
- package/api-services/modules/bems/index.js.gz +0 -0
- package/api-services/modules/contract/es5.js +763 -735
- package/api-services/modules/contract/index.js +604 -581
- package/api-services/modules/contract/index.js.gz +0 -0
- package/api-services/modules/duty-manage/es5.js +756 -728
- package/api-services/modules/duty-manage/index.js +605 -582
- package/api-services/modules/duty-manage/index.js.gz +0 -0
- package/api-services/modules/enterpriseright/es5.js +763 -735
- package/api-services/modules/enterpriseright/index.js +604 -581
- package/api-services/modules/enterpriseright/index.js.gz +0 -0
- package/api-services/modules/es5.js +1419 -1378
- package/api-services/modules/file/es5.js +1460 -1443
- package/api-services/modules/file/index.js +1174 -1168
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/es5.js +1297 -1281
- package/api-services/modules/gateway-edge/index.js +1068 -1063
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/index.js +1133 -1091
- package/api-services/modules/index.js.gz +0 -0
- package/api-services/modules/iot/es5.js +988 -960
- package/api-services/modules/iot/index.js +795 -772
- package/api-services/modules/iot/index.js.gz +0 -0
- package/api-services/modules/justauth/es5.js +1312 -1275
- package/api-services/modules/justauth/index.js +1081 -1044
- package/api-services/modules/justauth/index.js.gz +0 -0
- package/api-services/modules/knowledge/es5.js +1272 -1232
- package/api-services/modules/knowledge/index.js +1060 -1019
- package/api-services/modules/knowledge/index.js.gz +0 -0
- package/api-services/modules/link/es5.js +1276 -1236
- package/api-services/modules/link/index.js +1059 -1018
- package/api-services/modules/link/index.js.gz +0 -0
- package/api-services/modules/permission/es5.js +989 -963
- package/api-services/modules/permission/index.js +782 -763
- package/api-services/modules/permission/index.js.gz +0 -0
- package/api-services/modules/platformManage/es5.js +989 -963
- package/api-services/modules/platformManage/index.js +771 -752
- package/api-services/modules/platformManage/index.js.gz +0 -0
- package/api-services/modules/portal/es5.js +1298 -1279
- package/api-services/modules/portal/index.js +1070 -1061
- package/api-services/modules/portal/index.js.gz +0 -0
- package/api-services/modules/space-manage/es5.js +749 -721
- package/api-services/modules/space-manage/index.js +588 -565
- package/api-services/modules/space-manage/index.js.gz +0 -0
- package/api-services/modules/super-admin/es5.js +1281 -1241
- package/api-services/modules/super-admin/index.js +1061 -1020
- package/api-services/modules/super-admin/index.js.gz +0 -0
- package/api-services/modules/supplier/es5.js +754 -726
- package/api-services/modules/supplier/index.js +600 -577
- package/api-services/modules/supplier/index.js.gz +0 -0
- package/api-services/modules/supplychain-manage/es5.js +1297 -1281
- package/api-services/modules/supplychain-manage/index.js +1068 -1063
- package/api-services/modules/supplychain-manage/index.js.gz +0 -0
- package/api-services/modules/systemConfiguration/es5.js +989 -963
- package/api-services/modules/systemConfiguration/index.js +782 -763
- package/api-services/modules/systemConfiguration/index.js.gz +0 -0
- package/api-services/modules/tool/es5.js +1297 -1281
- package/api-services/modules/tool/index.js +1068 -1063
- package/api-services/modules/tool/index.js.gz +0 -0
- package/api-services/src/create-service/es5.js +761 -733
- package/api-services/src/create-service/index.js +603 -580
- package/api-services/src/create-service/index.js.gz +0 -0
- package/common-info/es5.js +1139 -1108
- package/common-info/getPermissionMethod/es5.js +1533 -1517
- package/common-info/getPermissionMethod/index.js +1262 -1257
- package/common-info/getPermissionMethod/index.js.gz +0 -0
- package/common-info/index.js +899 -872
- package/common-info/index.js.gz +0 -0
- package/common-tools/es5.d.ts +0 -1
- package/common-tools/es5.js +0 -9
- package/common-tools/index.d.ts +0 -1
- package/common-tools/index.js +0 -1
- package/common-tools/timezone-format/es5.d.ts +110 -5
- package/common-tools/timezone-format/es5.js +662 -473
- package/common-tools/timezone-format/get-iana-data/iana-api-fetch.d.ts +0 -3
- package/common-tools/timezone-format/get-iana-data/moment-iana-loader.d.ts +4 -3
- package/common-tools/timezone-format/index.d.ts +110 -5
- package/common-tools/timezone-format/index.js +446 -328
- package/common-tools/timezone-format/index.js.gz +0 -0
- package/create-api-service/es5.js +1309 -1272
- package/create-api-service/index.js +1080 -1043
- package/create-api-service/index.js.gz +0 -0
- package/esm-map.json +26 -7
- package/index.d.ts +0 -1
- package/index.js +0 -1
- package/package.json +3 -3
- package/theme/es5.d.ts +22 -8
- package/theme/es5.js +367 -354
- package/theme/index.d.ts +22 -8
- package/theme/index.js +276 -255
- package/theme/index.js.gz +0 -0
package/common-info/index.js.gz
CHANGED
|
Binary file
|
package/common-tools/es5.d.ts
CHANGED
|
@@ -12,4 +12,3 @@ 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/es5.js
CHANGED
|
@@ -14,7 +14,6 @@ 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');
|
|
18
17
|
Object.keys(dateFormat).forEach(function (k) {
|
|
19
18
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
20
19
|
enumerable: true,
|
|
@@ -127,11 +126,3 @@ Object.keys(calcTextWidth).forEach(function (k) {
|
|
|
127
126
|
}
|
|
128
127
|
});
|
|
129
128
|
});
|
|
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
|
-
});
|
package/common-tools/index.d.ts
CHANGED
|
@@ -12,4 +12,3 @@ 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,4 +12,3 @@ 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";
|
|
@@ -1,9 +1,80 @@
|
|
|
1
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
2
|
|
|
5
|
-
export
|
|
6
|
-
|
|
3
|
+
export interface TimeZoneRule {
|
|
4
|
+
u: number[];
|
|
5
|
+
o: number[];
|
|
6
|
+
}
|
|
7
|
+
export interface IanaDb {
|
|
8
|
+
[zone: string]: TimeZoneRule;
|
|
9
|
+
}
|
|
10
|
+
export type DayjsTimezoneIanaOption = undefined;
|
|
11
|
+
export interface PackedIanaData {
|
|
12
|
+
version?: string;
|
|
13
|
+
zones: string[];
|
|
14
|
+
links?: string[];
|
|
15
|
+
}
|
|
16
|
+
export type ParsePackedIanaResponse = (json: unknown) => PackedIanaData;
|
|
17
|
+
export type IanaFetchJson = (url: string, init?: RequestInit) => Promise<unknown>;
|
|
18
|
+
export interface PreloadDayjsIanaOptions {
|
|
19
|
+
/** 默认请求内置 IANA packed 数据接口;可传自定义地址覆盖。 */
|
|
20
|
+
url?: string;
|
|
21
|
+
/** 设置 Authorization;传空字符串表示不附加鉴权头。 */
|
|
22
|
+
authorization?: string;
|
|
23
|
+
/** 额外请求头;与 authorization 合并,同名时以 authorization 为准。 */
|
|
24
|
+
headers?: Record<string, string>;
|
|
25
|
+
/** 默认使用全局 fetch;Node 等环境可传入实现。 */
|
|
26
|
+
fetchJson?: IanaFetchJson;
|
|
27
|
+
/** 接口外层包裹时在此解析为 packed IANA 数据。 */
|
|
28
|
+
parseResponse?: ParsePackedIanaResponse;
|
|
29
|
+
}
|
|
30
|
+
export type DayjsTimezoneIanaPlugin = ((option?: DayjsTimezoneIanaOption, dayjsClass?: unknown, dayjsFactory?: unknown) => void) & {
|
|
31
|
+
preloadFromApi: (options?: PreloadDayjsIanaOptions) => Promise<PackedIanaData>;
|
|
32
|
+
preloadFromData: (packedData: PackedIanaData) => PackedIanaData;
|
|
33
|
+
getCachedPackedData: () => PackedIanaData | null;
|
|
34
|
+
clearIanaCache: () => void;
|
|
35
|
+
};
|
|
36
|
+
export interface PackedIanaTzData {
|
|
37
|
+
version?: string;
|
|
38
|
+
zones: string[];
|
|
39
|
+
links?: string[];
|
|
40
|
+
}
|
|
41
|
+
export type MomentTimezoneApi = {
|
|
42
|
+
load: (data: PackedIanaTzData) => void;
|
|
43
|
+
};
|
|
44
|
+
export interface MomentWithTimezone {
|
|
45
|
+
tz: MomentTimezoneApi | (((...args: any[]) => unknown) & MomentTimezoneApi);
|
|
46
|
+
}
|
|
47
|
+
export type ParseIanaResponse = (json: unknown) => PackedIanaTzData;
|
|
48
|
+
export type IanaMomentFetchJson = (url: string, init?: RequestInit) => Promise<unknown>;
|
|
49
|
+
export interface LoadIanaFromApiOptions {
|
|
50
|
+
/** 设置请求头 Authorization。 */
|
|
51
|
+
authorization?: string;
|
|
52
|
+
/** 额外请求头;与 authorization 合并,同名时以 authorization 为准。 */
|
|
53
|
+
headers?: Record<string, string>;
|
|
54
|
+
/** 自定义请求,默认使用全局 fetch。 */
|
|
55
|
+
fetchJson?: IanaMomentFetchJson;
|
|
56
|
+
/** 当接口外层有包裹时,在此取出 packed IANA 数据。 */
|
|
57
|
+
parseResponse?: ParseIanaResponse;
|
|
58
|
+
}
|
|
59
|
+
export declare const dayjsTimezoneIanaPlugin: DayjsTimezoneIanaPlugin;
|
|
60
|
+
export declare const assertPackedIanaData: (json: unknown) => PackedIanaData;
|
|
61
|
+
export declare const preloadDayjsIanaFromData: (packedData: PackedIanaData) => PackedIanaData;
|
|
62
|
+
export declare const getCachedDayjsPackedIanaData: () => PackedIanaData | null;
|
|
63
|
+
export declare const preloadDayjsIanaFromApi: (options?: PreloadDayjsIanaOptions) => Promise<PackedIanaData>;
|
|
64
|
+
export declare const clearDayjsIanaCache: () => void;
|
|
65
|
+
export declare const createIanaDbFromPackedData: (packedData: PackedIanaData) => IanaDb;
|
|
66
|
+
export declare const TIME_ZONE_PACKED_DATA_URL: string;
|
|
67
|
+
export declare const getAccessTokenFromLocalStorage: () => string | null;
|
|
68
|
+
export declare const getDefaultIanaAuthorization: () => string | undefined;
|
|
69
|
+
export declare const buildIanaFetchInit: (options?: {
|
|
70
|
+
authorization?: string;
|
|
71
|
+
headers?: Record<string, string>;
|
|
72
|
+
}) => RequestInit | undefined;
|
|
73
|
+
export declare const assertPackedIanaTzData: (json: unknown) => PackedIanaTzData;
|
|
74
|
+
export declare const loadMomentIanaData: (moment: MomentWithTimezone, data: PackedIanaTzData) => void;
|
|
75
|
+
export declare const loadIanaData: (moment: MomentWithTimezone, data: PackedIanaTzData) => void;
|
|
76
|
+
export declare const loadMomentIanaFromApi: (moment: MomentWithTimezone, urlOrOptions?: string | LoadIanaFromApiOptions, maybeOptions?: LoadIanaFromApiOptions) => Promise<PackedIanaTzData>;
|
|
77
|
+
export declare const loadIanaFromApi: (moment: MomentWithTimezone, urlOrOptions?: string | LoadIanaFromApiOptions, maybeOptions?: LoadIanaFromApiOptions) => Promise<PackedIanaTzData>;
|
|
7
78
|
export type TimeValue = string | number | Date | Dayjs | null | undefined;
|
|
8
79
|
export type TimeZoneFlag = number | string | null | undefined;
|
|
9
80
|
export type TimeZoneDateLibrary = 'dayjs' | 'moment';
|
|
@@ -94,9 +165,21 @@ export interface FormatLocalDateTimeOptions {
|
|
|
94
165
|
/** 未传 timeZone 时是否读取 sessionStorage/客户端时区。默认 false,兼容旧 toLocalDate。 */
|
|
95
166
|
useClientTimeZone?: boolean;
|
|
96
167
|
}
|
|
168
|
+
export interface FormatLocalDateTimeIntlOptions {
|
|
169
|
+
/** 目标 IANA 时区;为空时读取浏览器当前时区。 */
|
|
170
|
+
timeZone?: string | null;
|
|
171
|
+
/** 输出格式,默认 YYYY-MM-DD HH:mm:ss。 */
|
|
172
|
+
format?: string;
|
|
173
|
+
/** Intl locale,默认 zh-CN,保证中后台测试文案稳定。 */
|
|
174
|
+
locale?: string;
|
|
175
|
+
}
|
|
97
176
|
export interface ApplyIanaTimeZoneOptions {
|
|
98
177
|
/** 指定默认时区,后续 dayjs.tz(value) 可直接使用。 */
|
|
99
178
|
defaultTimeZone?: string;
|
|
179
|
+
/** 运行期快照来源:接口数据为 iana,随包数据或本地兜底为 fallback。 */
|
|
180
|
+
runtimeSource?: IanaTimeZoneDataSource;
|
|
181
|
+
/** 是否把 packed 数据写到 window 快照,供 iframe 子应用复用。默认 true。 */
|
|
182
|
+
writeRuntimeSnapshot?: boolean;
|
|
100
183
|
}
|
|
101
184
|
export interface LoadIanaTimeZoneOptions extends PreloadDayjsIanaOptions, ApplyIanaTimeZoneOptions {
|
|
102
185
|
}
|
|
@@ -104,6 +187,11 @@ export interface ApplyIanaTimeZoneResult {
|
|
|
104
187
|
data: PackedIanaData;
|
|
105
188
|
knownTimeZones: string[];
|
|
106
189
|
}
|
|
190
|
+
export type IanaTimeZoneDataSource = 'iana' | 'fallback';
|
|
191
|
+
export interface RuntimeIanaTimeZoneDataSnapshot extends PackedIanaData {
|
|
192
|
+
source: IanaTimeZoneDataSource;
|
|
193
|
+
timestamp: number;
|
|
194
|
+
}
|
|
107
195
|
export interface LoadMomentIanaTimeZoneOptions extends LoadIanaFromApiOptions {
|
|
108
196
|
url?: string;
|
|
109
197
|
}
|
|
@@ -126,9 +214,21 @@ export interface SetClientTimeZoneOptions {
|
|
|
126
214
|
source?: string;
|
|
127
215
|
}
|
|
128
216
|
export type ClientTimeZoneChangeHandler = (timeZone: string, detail: ClientTimeZoneChangeDetail) => void;
|
|
217
|
+
export interface ClientTimeZoneRef {
|
|
218
|
+
/** 框架无关的当前时区快照;Vue/Angular/原生应用都可直接读取。 */
|
|
219
|
+
value: string;
|
|
220
|
+
}
|
|
129
221
|
export declare const TIMEZONE_CHANGE_EVENT = "timezonechange";
|
|
130
222
|
export declare const UPF_TIMEZONE_MESSAGE_TYPE = "__UPF_TIMEZONE_CHANGE__";
|
|
131
|
-
export declare const
|
|
223
|
+
export declare const UPF_IANA_TIMEZONE_DATA_KEY = "__UPF_IANA_TIMEZONE_DATA__";
|
|
224
|
+
export declare const IANA_TIMEZONE_DATA_CHANGE_EVENT = "ianatimezonedatachange";
|
|
225
|
+
export declare const setRuntimeIanaTimeZoneDataSnapshot: (data: PackedIanaData, options?: {
|
|
226
|
+
source?: IanaTimeZoneDataSource;
|
|
227
|
+
dispatchEvent?: boolean;
|
|
228
|
+
}) => RuntimeIanaTimeZoneDataSnapshot | null;
|
|
229
|
+
export declare const getRuntimeIanaTimeZoneDataSnapshot: () => RuntimeIanaTimeZoneDataSnapshot | null;
|
|
230
|
+
export declare const readInjectedParentIanaTimeZoneDataSnapshot: () => RuntimeIanaTimeZoneDataSnapshot | null;
|
|
231
|
+
export declare const clientTimeZone: ClientTimeZoneRef;
|
|
132
232
|
export declare const isKnownTimeZone: (timeZone?: string | null) => any;
|
|
133
233
|
export declare const rebuildKnownTimeZoneIds: (data: Pick<PackedIanaData, "zones" | "links">) => any;
|
|
134
234
|
export declare const getKnownTimeZoneIds: () => any;
|
|
@@ -137,6 +237,7 @@ export declare const loadDayjsIanaTimeZoneData: (options?: LoadIanaTimeZoneOptio
|
|
|
137
237
|
export declare const applyMomentIanaTimeZoneData: (moment: MomentWithTimezone, data: PackedIanaTzData) => PackedIanaTzData;
|
|
138
238
|
export declare const loadMomentIanaTimeZoneData: (moment: MomentWithTimezone, options?: LoadMomentIanaTimeZoneOptions) => unknown;
|
|
139
239
|
export declare const setDefaultTimeZone: (timeZone?: string | null) => boolean;
|
|
240
|
+
export declare const ensureInjectedIanaTimeZoneData: () => Promise<ApplyIanaTimeZoneResult | null>;
|
|
140
241
|
export declare const setClientTimeZone: (timeZone?: string | null, options?: SetClientTimeZoneOptions) => any;
|
|
141
242
|
export declare const syncClientTimeZone: (source?: string) => any;
|
|
142
243
|
export declare const onClientTimeZoneChange: (handler: ClientTimeZoneChangeHandler) => () => any;
|
|
@@ -148,6 +249,9 @@ export declare const getZoneUtcOffset: (value: TimeValue, timeZone?: string | nu
|
|
|
148
249
|
export declare const formatInTimeZone: (value?: TimeValue, timeZone?: string | null, format?: string) => any;
|
|
149
250
|
export declare const formatLocalDateTime: (value?: TimeValue, options?: FormatLocalDateTimeOptions | string) => string;
|
|
150
251
|
export declare const toLocalDate: (value?: TimeValue, format?: string, options?: Omit<FormatLocalDateTimeOptions, "format">) => string;
|
|
252
|
+
export declare const getBrowserTimeZone: () => any;
|
|
253
|
+
export declare function formatLocalDateTimeIntl(value?: TimeValue, timeZone?: string | null, format?: string, locale?: string): string;
|
|
254
|
+
export declare function formatLocalDateTimeIntl(value?: TimeValue, options?: FormatLocalDateTimeIntlOptions): string;
|
|
151
255
|
export declare const formatTimeZoneOffsetLabel: (value?: TimeValue, timeZone?: string | null) => string;
|
|
152
256
|
export declare const resolveUtcOffsetFallback: (option: Pick<TimeZoneOption, "timeZoneId" | "baseUtcOffsetText" | "currentUtcOffsetText">, referenceDate?: Date) => string;
|
|
153
257
|
export declare const timeZoneHasDST: (timeZone?: string | null, value?: TimeValue) => boolean;
|
|
@@ -156,3 +260,4 @@ export declare const isDaylightSavingTime: (timeZone?: string | null, value?: Ti
|
|
|
156
260
|
export declare const buildTimeZoneDisplayOptions: (options: TimeZoneOption[], referenceDate?: Date) => TimeZoneDisplayOption[];
|
|
157
261
|
export declare const formatClientLocalDateTimeLine: (value: TimeValue, timeZone?: string | null, options?: FormatClientLocalDateTimeLineOptions) => any;
|
|
158
262
|
export declare const getTimeZoneDisplayInfo: (options?: TimeZoneDisplayOptions) => TimeZoneDisplayResult;
|
|
263
|
+
export {};
|