@das-fed/upf-utils 6.4.0-dev.263 → 6.4.0-dev.265
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 +1762 -1811
- package/api-services/index.js +1418 -1464
- package/api-services/index.js.gz +0 -0
- package/api-services/modules/app-manage/es5.js +1291 -1316
- package/api-services/modules/app-manage/index.js +1076 -1086
- package/api-services/modules/app-manage/index.js.gz +0 -0
- package/api-services/modules/authentication/es5.js +943 -977
- package/api-services/modules/authentication/index.js +749 -773
- package/api-services/modules/authentication/index.js.gz +0 -0
- package/api-services/modules/bems/es5.js +1097 -1134
- package/api-services/modules/bems/index.js +877 -905
- package/api-services/modules/bems/index.js.gz +0 -0
- package/api-services/modules/contract/es5.js +1279 -1328
- package/api-services/modules/contract/index.js +1060 -1106
- package/api-services/modules/contract/index.js.gz +0 -0
- package/api-services/modules/duty-manage/es5.js +1295 -1320
- package/api-services/modules/duty-manage/index.js +1080 -1090
- package/api-services/modules/duty-manage/index.js.gz +0 -0
- package/api-services/modules/enterpriseright/es5.js +1051 -1088
- package/api-services/modules/enterpriseright/index.js +830 -858
- package/api-services/modules/enterpriseright/index.js.gz +0 -0
- package/api-services/modules/es5.js +1152 -1189
- package/api-services/modules/file/es5.js +1413 -1450
- package/api-services/modules/file/index.js +1148 -1176
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/es5.js +1286 -1311
- package/api-services/modules/gateway-edge/index.js +1077 -1087
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/index.js +873 -901
- package/api-services/modules/index.js.gz +0 -0
- package/api-services/modules/iot/es5.js +1294 -1319
- package/api-services/modules/iot/index.js +1071 -1081
- package/api-services/modules/iot/index.js.gz +0 -0
- package/api-services/modules/justauth/es5.js +1052 -1089
- package/api-services/modules/justauth/index.js +831 -859
- package/api-services/modules/justauth/index.js.gz +0 -0
- package/api-services/modules/knowledge/es5.js +1270 -1316
- package/api-services/modules/knowledge/index.js +1056 -1098
- package/api-services/modules/knowledge/index.js.gz +0 -0
- package/api-services/modules/link/es5.js +943 -977
- package/api-services/modules/link/index.js +749 -773
- package/api-services/modules/link/index.js.gz +0 -0
- package/api-services/modules/permission/es5.js +1047 -1084
- package/api-services/modules/permission/index.js +836 -864
- package/api-services/modules/permission/index.js.gz +0 -0
- package/api-services/modules/platformManage/es5.js +1279 -1304
- package/api-services/modules/platformManage/index.js +1058 -1068
- package/api-services/modules/platformManage/index.js.gz +0 -0
- package/api-services/modules/portal/es5.js +1279 -1328
- package/api-services/modules/portal/index.js +1060 -1106
- package/api-services/modules/portal/index.js.gz +0 -0
- package/api-services/modules/space-manage/es5.js +943 -977
- package/api-services/modules/space-manage/index.js +749 -773
- package/api-services/modules/space-manage/index.js.gz +0 -0
- package/api-services/modules/super-admin/es5.js +1284 -1333
- package/api-services/modules/super-admin/index.js +1061 -1107
- package/api-services/modules/super-admin/index.js.gz +0 -0
- package/api-services/modules/supplier/es5.js +1282 -1331
- package/api-services/modules/supplier/index.js +1060 -1106
- package/api-services/modules/supplier/index.js.gz +0 -0
- package/api-services/modules/supplychain-manage/es5.js +1279 -1328
- package/api-services/modules/supplychain-manage/index.js +1060 -1106
- package/api-services/modules/supplychain-manage/index.js.gz +0 -0
- package/api-services/modules/systemConfiguration/es5.js +1047 -1084
- package/api-services/modules/systemConfiguration/index.js +836 -864
- package/api-services/modules/systemConfiguration/index.js.gz +0 -0
- package/api-services/modules/tool/es5.js +1273 -1319
- package/api-services/modules/tool/index.js +1054 -1096
- package/api-services/modules/tool/index.js.gz +0 -0
- package/api-services/src/create-service/es5.js +1284 -1309
- package/api-services/src/create-service/index.js +1076 -1086
- package/api-services/src/create-service/index.js.gz +0 -0
- package/common-info/es5.js +1096 -1133
- package/common-info/getPermissionMethod/es5.js +1489 -1535
- package/common-info/getPermissionMethod/index.js +1236 -1278
- package/common-info/getPermissionMethod/index.js.gz +0 -0
- package/common-info/index.js +864 -892
- package/common-info/index.js.gz +0 -0
- package/common-tools/es5.d.ts +1 -0
- package/common-tools/es5.js +9 -0
- package/common-tools/index.d.ts +1 -0
- package/common-tools/index.js +1 -0
- package/common-tools/timezone-format/es5.d.ts +5 -112
- package/common-tools/timezone-format/es5.js +451 -651
- 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 +5 -112
- package/common-tools/timezone-format/index.js +318 -440
- package/common-tools/timezone-format/index.js.gz +0 -0
- package/create-api-service/es5.js +1052 -1080
- package/create-api-service/index.js +886 -900
- package/create-api-service/index.js.gz +0 -0
- package/esm-map.json +7 -26
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +3 -3
- package/theme/es5.d.ts +8 -22
- package/theme/es5.js +354 -367
- package/theme/index.d.ts +8 -22
- package/theme/index.js +255 -276
- package/theme/index.js.gz +0 -0
package/common-info/index.js.gz
CHANGED
|
Binary file
|
package/common-tools/es5.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/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
|
+
});
|
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";
|
|
@@ -1,80 +1,9 @@
|
|
|
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';
|
|
2
4
|
|
|
3
|
-
export
|
|
4
|
-
|
|
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>;
|
|
5
|
+
export * from './get-iana-data';
|
|
6
|
+
export { dayjsTimezoneIanaPlugin, loadMomentIanaData, loadMomentIanaFromApi };
|
|
78
7
|
export type TimeValue = string | number | Date | Dayjs | null | undefined;
|
|
79
8
|
export type TimeZoneFlag = number | string | null | undefined;
|
|
80
9
|
export type TimeZoneDateLibrary = 'dayjs' | 'moment';
|
|
@@ -165,23 +94,9 @@ export interface FormatLocalDateTimeOptions {
|
|
|
165
94
|
/** 未传 timeZone 时是否读取 sessionStorage/客户端时区。默认 false,兼容旧 toLocalDate。 */
|
|
166
95
|
useClientTimeZone?: boolean;
|
|
167
96
|
}
|
|
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
|
-
}
|
|
176
97
|
export interface ApplyIanaTimeZoneOptions {
|
|
177
98
|
/** 指定默认时区,后续 dayjs.tz(value) 可直接使用。 */
|
|
178
99
|
defaultTimeZone?: string;
|
|
179
|
-
/** 运行期快照来源:接口数据为 iana,随包数据或本地兜底为 fallback。 */
|
|
180
|
-
runtimeSource?: IanaTimeZoneDataSource;
|
|
181
|
-
/** 是否把 packed 数据写到 window 快照,供 iframe 子应用复用。默认 true。 */
|
|
182
|
-
writeRuntimeSnapshot?: boolean;
|
|
183
|
-
/** 是否派发 IANA 运行期快照变更事件,默认 true。 */
|
|
184
|
-
dispatchRuntimeSnapshotEvent?: boolean;
|
|
185
100
|
}
|
|
186
101
|
export interface LoadIanaTimeZoneOptions extends PreloadDayjsIanaOptions, ApplyIanaTimeZoneOptions {
|
|
187
102
|
}
|
|
@@ -189,11 +104,6 @@ export interface ApplyIanaTimeZoneResult {
|
|
|
189
104
|
data: PackedIanaData;
|
|
190
105
|
knownTimeZones: string[];
|
|
191
106
|
}
|
|
192
|
-
export type IanaTimeZoneDataSource = 'iana' | 'fallback';
|
|
193
|
-
export interface RuntimeIanaTimeZoneDataSnapshot extends PackedIanaData {
|
|
194
|
-
source: IanaTimeZoneDataSource;
|
|
195
|
-
timestamp: number;
|
|
196
|
-
}
|
|
197
107
|
export interface LoadMomentIanaTimeZoneOptions extends LoadIanaFromApiOptions {
|
|
198
108
|
url?: string;
|
|
199
109
|
}
|
|
@@ -216,21 +126,9 @@ export interface SetClientTimeZoneOptions {
|
|
|
216
126
|
source?: string;
|
|
217
127
|
}
|
|
218
128
|
export type ClientTimeZoneChangeHandler = (timeZone: string, detail: ClientTimeZoneChangeDetail) => void;
|
|
219
|
-
export interface ClientTimeZoneRef {
|
|
220
|
-
/** 框架无关的当前时区快照;Vue/Angular/原生应用都可直接读取。 */
|
|
221
|
-
value: string;
|
|
222
|
-
}
|
|
223
129
|
export declare const TIMEZONE_CHANGE_EVENT = "timezonechange";
|
|
224
130
|
export declare const UPF_TIMEZONE_MESSAGE_TYPE = "__UPF_TIMEZONE_CHANGE__";
|
|
225
|
-
export declare const
|
|
226
|
-
export declare const IANA_TIMEZONE_DATA_CHANGE_EVENT = "ianatimezonedatachange";
|
|
227
|
-
export declare const setRuntimeIanaTimeZoneDataSnapshot: (data: PackedIanaData, options?: {
|
|
228
|
-
source?: IanaTimeZoneDataSource;
|
|
229
|
-
dispatchEvent?: boolean;
|
|
230
|
-
}) => RuntimeIanaTimeZoneDataSnapshot | null;
|
|
231
|
-
export declare const getRuntimeIanaTimeZoneDataSnapshot: () => RuntimeIanaTimeZoneDataSnapshot | null;
|
|
232
|
-
export declare const readInjectedParentIanaTimeZoneDataSnapshot: () => RuntimeIanaTimeZoneDataSnapshot | null;
|
|
233
|
-
export declare const clientTimeZone: ClientTimeZoneRef;
|
|
131
|
+
export declare const clientTimeZone: any;
|
|
234
132
|
export declare const isKnownTimeZone: (timeZone?: string | null) => any;
|
|
235
133
|
export declare const rebuildKnownTimeZoneIds: (data: Pick<PackedIanaData, "zones" | "links">) => any;
|
|
236
134
|
export declare const getKnownTimeZoneIds: () => any;
|
|
@@ -239,7 +137,6 @@ export declare const loadDayjsIanaTimeZoneData: (options?: LoadIanaTimeZoneOptio
|
|
|
239
137
|
export declare const applyMomentIanaTimeZoneData: (moment: MomentWithTimezone, data: PackedIanaTzData) => PackedIanaTzData;
|
|
240
138
|
export declare const loadMomentIanaTimeZoneData: (moment: MomentWithTimezone, options?: LoadMomentIanaTimeZoneOptions) => unknown;
|
|
241
139
|
export declare const setDefaultTimeZone: (timeZone?: string | null) => boolean;
|
|
242
|
-
export declare const ensureInjectedIanaTimeZoneData: () => Promise<ApplyIanaTimeZoneResult | null>;
|
|
243
140
|
export declare const setClientTimeZone: (timeZone?: string | null, options?: SetClientTimeZoneOptions) => any;
|
|
244
141
|
export declare const syncClientTimeZone: (source?: string) => any;
|
|
245
142
|
export declare const onClientTimeZoneChange: (handler: ClientTimeZoneChangeHandler) => () => any;
|
|
@@ -251,9 +148,6 @@ export declare const getZoneUtcOffset: (value: TimeValue, timeZone?: string | nu
|
|
|
251
148
|
export declare const formatInTimeZone: (value?: TimeValue, timeZone?: string | null, format?: string) => any;
|
|
252
149
|
export declare const formatLocalDateTime: (value?: TimeValue, options?: FormatLocalDateTimeOptions | string) => string;
|
|
253
150
|
export declare const toLocalDate: (value?: TimeValue, format?: string, options?: Omit<FormatLocalDateTimeOptions, "format">) => string;
|
|
254
|
-
export declare const getBrowserTimeZone: () => any;
|
|
255
|
-
export declare function formatLocalDateTimeIntl(value?: TimeValue, timeZone?: string | null, format?: string, locale?: string): string;
|
|
256
|
-
export declare function formatLocalDateTimeIntl(value?: TimeValue, options?: FormatLocalDateTimeIntlOptions): string;
|
|
257
151
|
export declare const formatTimeZoneOffsetLabel: (value?: TimeValue, timeZone?: string | null) => string;
|
|
258
152
|
export declare const resolveUtcOffsetFallback: (option: Pick<TimeZoneOption, "timeZoneId" | "baseUtcOffsetText" | "currentUtcOffsetText">, referenceDate?: Date) => string;
|
|
259
153
|
export declare const timeZoneHasDST: (timeZone?: string | null, value?: TimeValue) => boolean;
|
|
@@ -262,4 +156,3 @@ export declare const isDaylightSavingTime: (timeZone?: string | null, value?: Ti
|
|
|
262
156
|
export declare const buildTimeZoneDisplayOptions: (options: TimeZoneOption[], referenceDate?: Date) => TimeZoneDisplayOption[];
|
|
263
157
|
export declare const formatClientLocalDateTimeLine: (value: TimeValue, timeZone?: string | null, options?: FormatClientLocalDateTimeLineOptions) => any;
|
|
264
158
|
export declare const getTimeZoneDisplayInfo: (options?: TimeZoneDisplayOptions) => TimeZoneDisplayResult;
|
|
265
|
-
export {};
|