@yongdall/web 0.5.3 → 0.5.5
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/index.d.mts +129 -71
- package/index.mjs +14 -14
- package/index.mjs.map +1 -1
- package/package.json +3 -1
- package/require.d.mts +7 -0
- package/require.mjs +2 -0
- package/require.mjs.map +1 -0
- package/yongdall.assets.json +44 -0
- package/assets.yongdall.mjs +0 -4
package/index.d.mts
CHANGED
|
@@ -12,101 +12,102 @@ export * from "@yongdall/types";
|
|
|
12
12
|
//#region packages/web/signal.d.mts
|
|
13
13
|
/**
|
|
14
14
|
* @template T
|
|
15
|
-
* @typedef {object} State
|
|
16
|
-
* @property {() => T} get
|
|
17
|
-
* @property {(newValue: T) => void} set
|
|
18
15
|
*/
|
|
16
|
+
interface State<T> {
|
|
17
|
+
get(): T;
|
|
18
|
+
set(newValue: T): void;
|
|
19
|
+
}
|
|
19
20
|
/**
|
|
20
21
|
* 相应式执行
|
|
21
|
-
* @param
|
|
22
|
-
* @param
|
|
23
|
-
* @returns {void}
|
|
22
|
+
* @param fn 执行函数
|
|
23
|
+
* @param signal 可选的中断信号
|
|
24
24
|
*/
|
|
25
25
|
declare function effect(fn: () => void, signal?: AbortSignal): void;
|
|
26
26
|
/**
|
|
27
27
|
* 创建可赋值计算值
|
|
28
28
|
* @template T
|
|
29
|
-
* @
|
|
30
|
-
* @param
|
|
31
|
-
* @param
|
|
32
|
-
* @param
|
|
33
|
-
* @param
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
signal?: AbortSignal | undefined;
|
|
40
|
-
} | undefined): void;
|
|
29
|
+
* @param getter 取值方法或取值方法数组
|
|
30
|
+
* @param callback 回调函数,接收当前值和旧值
|
|
31
|
+
* @param options 配置选项
|
|
32
|
+
* @param options.immediate 是否立即执行一次
|
|
33
|
+
* @param options.signal 中断信号
|
|
34
|
+
*/
|
|
35
|
+
declare function watch<T>(getter: (() => T)[], callback: (value: T[], oldValue: T[] | undefined, onCleanup: ((() => AbortSignal) & ((cleanupFn: () => void) => void))) => void, options?: {
|
|
36
|
+
immediate?: boolean;
|
|
37
|
+
signal?: AbortSignal;
|
|
38
|
+
}): void;
|
|
41
39
|
/**
|
|
42
40
|
* 创建可赋值计算值
|
|
43
41
|
* @template T
|
|
44
|
-
* @
|
|
45
|
-
* @param
|
|
46
|
-
* @param
|
|
47
|
-
* @param
|
|
48
|
-
* @param
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
signal?: AbortSignal | undefined;
|
|
55
|
-
} | undefined): void;
|
|
42
|
+
* @param getter 取值方法或取值方法数组
|
|
43
|
+
* @param callback 回调函数,接收当前值和旧值
|
|
44
|
+
* @param options 配置选项
|
|
45
|
+
* @param options.immediate 是否立即执行一次
|
|
46
|
+
* @param options.signal 中断信号
|
|
47
|
+
*/
|
|
48
|
+
declare function watch<T>(getter: (() => any)[], callback: (value: any[], oldValue: any[] | undefined, onCleanup: ((() => AbortSignal) & ((cleanupFn: () => void) => void))) => void, options?: {
|
|
49
|
+
immediate?: boolean;
|
|
50
|
+
signal?: AbortSignal;
|
|
51
|
+
}): void;
|
|
56
52
|
/**
|
|
57
53
|
* 创建可赋值计算值
|
|
58
54
|
* @template T
|
|
59
|
-
* @
|
|
60
|
-
* @param
|
|
61
|
-
* @param
|
|
62
|
-
* @param
|
|
63
|
-
* @param
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
signal?: AbortSignal | undefined;
|
|
70
|
-
} | undefined): void;
|
|
55
|
+
* @param getter 取值方法或取值方法数组
|
|
56
|
+
* @param callback 回调函数,接收当前值和旧值
|
|
57
|
+
* @param options 配置选项
|
|
58
|
+
* @param options.immediate 是否立即执行一次
|
|
59
|
+
* @param options.signal 中断信号
|
|
60
|
+
*/
|
|
61
|
+
declare function watch<T>(getter: () => T, callback: (value: T, oldValue: T | undefined, onCleanup: ((() => AbortSignal) & ((cleanupFn: () => void) => void))) => void, options?: {
|
|
62
|
+
immediate?: boolean;
|
|
63
|
+
signal?: AbortSignal;
|
|
64
|
+
}): void;
|
|
71
65
|
/**
|
|
66
|
+
* 创建响应式状态
|
|
72
67
|
* @template T
|
|
73
|
-
* @
|
|
74
|
-
* @
|
|
75
|
-
* @returns {State<T>}
|
|
68
|
+
* @param initValue 初始值
|
|
69
|
+
* @returns 一个响应式状态对象
|
|
76
70
|
*/
|
|
77
71
|
declare function createState<T>(initValue: T): State<T>;
|
|
78
72
|
/**
|
|
73
|
+
* 创建响应式状态
|
|
79
74
|
* @template T
|
|
80
|
-
* @
|
|
81
|
-
* @
|
|
82
|
-
* @returns {State<T | undefined>}
|
|
75
|
+
* @param initValue 初始值
|
|
76
|
+
* @returns 一个响应式状态对象
|
|
83
77
|
*/
|
|
84
|
-
declare function createState<T>(initValue?: T
|
|
78
|
+
declare function createState<T>(initValue?: T): State<T | undefined>;
|
|
85
79
|
/**
|
|
86
|
-
*
|
|
80
|
+
* 创建计算状态
|
|
87
81
|
* @template T
|
|
88
|
-
* @param
|
|
89
|
-
* @param
|
|
90
|
-
* @returns
|
|
82
|
+
* @param get 获取函数
|
|
83
|
+
* @param set 设置函数(可选)
|
|
84
|
+
* @returns 一个响应式状态对象
|
|
91
85
|
*/
|
|
92
86
|
declare function createComputed<T>(get: () => T, set?: (newValue: T) => void): State<T>;
|
|
93
87
|
/**
|
|
94
|
-
*
|
|
95
|
-
* @
|
|
96
|
-
* @param
|
|
97
|
-
* @
|
|
88
|
+
* 创建安全计算状态,防止递归更新
|
|
89
|
+
* @template T
|
|
90
|
+
* @param initialValue 初始值
|
|
91
|
+
* @param get 获取函数
|
|
92
|
+
* @param set 设置函数(可选)
|
|
93
|
+
* @returns 一个响应式状态对象
|
|
94
|
+
*/
|
|
95
|
+
declare function createSafeComputed<T>(initialValue: T, get: () => T, set?: (newValue: T) => void): State<T>;
|
|
96
|
+
/**
|
|
97
|
+
* 创建深层响应式状态
|
|
98
|
+
* @template T
|
|
99
|
+
* @param state 父状态
|
|
100
|
+
* @param struct 结构定义
|
|
101
|
+
* @returns 具有深层响应式属性的对象
|
|
98
102
|
*/
|
|
99
103
|
declare function createDeeply<T extends Record<string, any>>(state: State<T>, struct: Record<string, any>): T;
|
|
100
104
|
/**
|
|
101
|
-
*
|
|
102
|
-
* @param
|
|
103
|
-
* @param
|
|
105
|
+
* 创建响应式计时器
|
|
106
|
+
* @param interval 间隔时间(毫秒)
|
|
107
|
+
* @param signal 可选的中断信号
|
|
108
|
+
* @returns 表示计时次数的响应式状态
|
|
104
109
|
*/
|
|
105
110
|
declare function createTick(interval: number, signal?: AbortSignal): State<number>;
|
|
106
|
-
type State<T> = {
|
|
107
|
-
get: () => T;
|
|
108
|
-
set: (newValue: T) => void;
|
|
109
|
-
};
|
|
110
111
|
//#endregion
|
|
111
112
|
//#region packages/web/route/home.d.mts
|
|
112
113
|
declare class HomeContext {
|
|
@@ -937,7 +938,9 @@ declare class PageHandle extends GeneralContext {
|
|
|
937
938
|
open: (url: string, replace?: boolean) => void;
|
|
938
939
|
setRootPath: (p: string, replace?: boolean) => void;
|
|
939
940
|
});
|
|
940
|
-
|
|
941
|
+
/** @param {string | (() => string)} title */
|
|
942
|
+
set title(title: string | (() => string));
|
|
943
|
+
/** @returns {string} */
|
|
941
944
|
get title(): string;
|
|
942
945
|
/**
|
|
943
946
|
*
|
|
@@ -955,12 +958,20 @@ declare class PageHandle extends GeneralContext {
|
|
|
955
958
|
get href(): string;
|
|
956
959
|
get current(): boolean;
|
|
957
960
|
get shown(): boolean;
|
|
958
|
-
|
|
961
|
+
/** @param {string | (() => string)} icon */
|
|
962
|
+
set icon(icon: string | (() => string));
|
|
963
|
+
/** @returns {string} */
|
|
959
964
|
get icon(): string;
|
|
960
965
|
set print(print: Print);
|
|
961
966
|
get print(): Print;
|
|
962
|
-
|
|
967
|
+
/** @param {boolean | (() => boolean)} unsaved */
|
|
968
|
+
set unsaved(unsaved: boolean | (() => boolean));
|
|
969
|
+
/** @returns {boolean} */
|
|
963
970
|
get unsaved(): boolean;
|
|
971
|
+
/** @param {boolean | (() => boolean)} guarded */
|
|
972
|
+
set guarded(guarded: boolean | (() => boolean));
|
|
973
|
+
/** @returns {boolean} */
|
|
974
|
+
get guarded(): boolean;
|
|
964
975
|
set loading(loading: boolean);
|
|
965
976
|
get loading(): boolean;
|
|
966
977
|
/**
|
|
@@ -1604,8 +1615,12 @@ interface CurrentPage {
|
|
|
1604
1615
|
icon: string;
|
|
1605
1616
|
print: Print;
|
|
1606
1617
|
unsaved: boolean;
|
|
1618
|
+
guarded: boolean;
|
|
1607
1619
|
loading: boolean;
|
|
1608
1620
|
}
|
|
1621
|
+
interface GlobalPage {
|
|
1622
|
+
guarded: boolean;
|
|
1623
|
+
}
|
|
1609
1624
|
interface VerifyError {
|
|
1610
1625
|
focus(): void;
|
|
1611
1626
|
stop: boolean;
|
|
@@ -1776,6 +1791,7 @@ interface Hooks {
|
|
|
1776
1791
|
/** 用户构造 */
|
|
1777
1792
|
user: UserHook;
|
|
1778
1793
|
commands: Record<string, Command>;
|
|
1794
|
+
/** @deprecated */
|
|
1779
1795
|
configurationPages: Record<string, PageRenderer | string>;
|
|
1780
1796
|
/** 图标库 */
|
|
1781
1797
|
icons: Record<string, IconDefine>;
|
|
@@ -2247,14 +2263,24 @@ declare class PageContext extends GeneralContext {
|
|
|
2247
2263
|
get href(): string;
|
|
2248
2264
|
get current(): boolean;
|
|
2249
2265
|
get shown(): boolean;
|
|
2250
|
-
|
|
2266
|
+
/** @param {string | (() => string)} title */
|
|
2267
|
+
set title(title: string | (() => string));
|
|
2268
|
+
/** @returns {string} */
|
|
2251
2269
|
get title(): string;
|
|
2252
|
-
|
|
2270
|
+
/** @param {string | (() => string)} icon */
|
|
2271
|
+
set icon(icon: string | (() => string));
|
|
2272
|
+
/** @returns {string} */
|
|
2253
2273
|
get icon(): string;
|
|
2254
2274
|
set print(print: Print);
|
|
2255
2275
|
get print(): Print;
|
|
2256
|
-
|
|
2276
|
+
/** @param {boolean | (() => boolean)} unsaved */
|
|
2277
|
+
set unsaved(unsaved: boolean | (() => boolean));
|
|
2278
|
+
/** @returns {boolean} */
|
|
2257
2279
|
get unsaved(): boolean;
|
|
2280
|
+
/** @param {boolean | (() => boolean)} guarded */
|
|
2281
|
+
set guarded(guarded: boolean | (() => boolean));
|
|
2282
|
+
/** @returns {boolean} */
|
|
2283
|
+
get guarded(): boolean;
|
|
2258
2284
|
set loading(loading: boolean);
|
|
2259
2285
|
get loading(): boolean;
|
|
2260
2286
|
get container(): HTMLElement;
|
|
@@ -2766,6 +2792,25 @@ declare function loadMenu(type: string, group?: string | undefined, force?: bool
|
|
|
2766
2792
|
*/
|
|
2767
2793
|
declare function loadMenu(type: string, group?: string | boolean | undefined, force?: boolean | undefined): Promise<Menu.Define[]>;
|
|
2768
2794
|
//#endregion
|
|
2795
|
+
//#region packages/web/services/application.d.mts
|
|
2796
|
+
declare namespace Application {
|
|
2797
|
+
const logo: string;
|
|
2798
|
+
const title: string;
|
|
2799
|
+
const company: string;
|
|
2800
|
+
const help: string;
|
|
2801
|
+
function refresh(): void;
|
|
2802
|
+
const menus: any;
|
|
2803
|
+
/** @param {boolean?} [force] */
|
|
2804
|
+
function loadMenus(force?: boolean | null): Promise<any>;
|
|
2805
|
+
const userMenus: any;
|
|
2806
|
+
/** @param {boolean?} [force] */
|
|
2807
|
+
function loadUserMenus(force?: boolean | null): Promise<any>;
|
|
2808
|
+
/** @param {string} page */
|
|
2809
|
+
function loadPage(page: string): Promise<(() => Promise<any>) | null>;
|
|
2810
|
+
/** @param {string} page */
|
|
2811
|
+
function loadContinuation(page: string): Promise<(() => Promise<any>) | null>;
|
|
2812
|
+
}
|
|
2813
|
+
//#endregion
|
|
2769
2814
|
//#region packages/web/import.d.mts
|
|
2770
2815
|
/**
|
|
2771
2816
|
* @template T
|
|
@@ -2982,6 +3027,19 @@ declare function testPermissions(authorization: string, permissions: Permission[
|
|
|
2982
3027
|
* @returns {Set<string>}
|
|
2983
3028
|
*/
|
|
2984
3029
|
declare function getPermissionFields(authorization: string, permissions: Permission[], model: ModelConfiguration | ModelScriptConfiguration): Set<string>;
|
|
3030
|
+
declare namespace zip_d_exports {
|
|
3031
|
+
export { MIME, create, parse$1 as parse };
|
|
3032
|
+
}
|
|
3033
|
+
declare const MIME: {
|
|
3034
|
+
[key: string]: readonly string[];
|
|
3035
|
+
};
|
|
3036
|
+
/**
|
|
3037
|
+
* 解析 ZIP 文件并返回包含文件名和对应 Blob 内容的记录对象
|
|
3038
|
+
* @param file - ZIP 文件的 Blob、ArrayBuffer 或 ArrayBufferView 对象
|
|
3039
|
+
* @returns Promise 对象,解析成功后返回 Record<string, Blob | null>
|
|
3040
|
+
*/
|
|
3041
|
+
declare function parse$1(file: Blob | ArrayBuffer | ArrayBufferView<ArrayBuffer>): Promise<Record<string, Blob | null>>;
|
|
3042
|
+
declare function create(files: Record<string, string | Blob | ArrayBuffer | ArrayBufferView<ArrayBuffer> | null>, name?: string): Promise<File>;
|
|
2985
3043
|
declare namespace Ident_d_exports {
|
|
2986
3044
|
export { decode, encode, parse, stringify, stringifyPaths };
|
|
2987
3045
|
}
|
|
@@ -3221,4 +3279,4 @@ declare function updateHooks(hooks: Record<string, Hook.Define<Hooks>>): void;
|
|
|
3221
3279
|
/** @type {Hook<Hooks>} */
|
|
3222
3280
|
declare const allHooks: Hook<Hooks>;
|
|
3223
3281
|
//#endregion
|
|
3224
|
-
export { ArrayStore, Authenticator, BindObjectStore, code128_d_exports as Code128, Command, ConfiguratorComponent, ConfiguratorContext, type ContinuationDefine, CurrentPage, type DataSource, DotRequest, ErrorAlerter, FieldComponent, FieldComponentEvent, FieldComponents, FieldContext, FieldDefine, FieldFilter, FieldFilterComponent, FieldFilterContext, FieldFilterFns, FieldFilterOptions, FieldFilterStyle, type FieldScript, type FieldScriptConfiguration, FieldShowHandle, FieldStyle, FilterFns, FormFieldHook, FromRenderer, GeneralContext, Guide, type HomeContext, Hooks, IconDefine, Ident_d_exports as Ident, List, type Match, Menu, Modal, ModalFooter, ModalHeader, type ModelConfiguration, ModelIndicator, type ModelScript, type ModelScriptConfiguration, ObjectStore, Page, type PageConfiguration, type PageContext, type PageError, PageFooter, PageFrame, type PageHandle, PageHeader, PageIdent, type PageManager, type PageRenderer, PageSection, PageSectionParam, PageSider, Pagination, type Print, ResponseError, type Schema, Signal$1 as Signal, State, Store, type StoreLayout, SubmodelsLayoutEvent, Theme, User, UserHook, VerifyContext, VerifyError, type WorkspaceDefine, addManager, allHooks, application, buildDataSource, buildPlugin, createComputed, createDeeply, createDialog, createDocumentInModal, createFilters, createFrame, createIcon, createModal, createModelDefault, createProgressModal, createQuickFilters, createShowField, createState, createStore, createStoreField, createTick, effect, enumerationsService, execScript, filterPermission, flatPermission, formLayoutsService, getAllFilterFns, getAuthorizations, getField, getFieldFilter, getFieldFilterOperators, getFilterFns, getPages, getPermissionFields, getPrimaryFields, hasField, hasFieldFilter, importStyle, importWidget, isMac, isPluginId, loadMenu, modelService, neverAbortedSignal, pathRoots, _default as permissionsService, plugins, _default$1 as renderForm, renderStore, _default$2 as renderStoreForm, request, root$1 as root, selectFile, setIcon, showDocumentInModal, _default$3 as showFilterDialog, showSortDialog, start, testPermission, testPermissionConstraints, testPermissions, toFileLink, toFileURL, toId, toPermissionFilter, toSchema, toUrl, updateHooks, waitAbortSignal, watch };
|
|
3282
|
+
export { Application, ArrayStore, Authenticator, BindObjectStore, code128_d_exports as Code128, Command, ConfiguratorComponent, ConfiguratorContext, type ContinuationDefine, CurrentPage, type DataSource, DotRequest, ErrorAlerter, FieldComponent, FieldComponentEvent, FieldComponents, FieldContext, FieldDefine, FieldFilter, FieldFilterComponent, FieldFilterContext, FieldFilterFns, FieldFilterOptions, FieldFilterStyle, type FieldScript, type FieldScriptConfiguration, FieldShowHandle, FieldStyle, FilterFns, FormFieldHook, FromRenderer, GeneralContext, GlobalPage, Guide, type HomeContext, Hooks, IconDefine, Ident_d_exports as Ident, List, type Match, Menu, Modal, ModalFooter, ModalHeader, type ModelConfiguration, ModelIndicator, type ModelScript, type ModelScriptConfiguration, ObjectStore, Page, type PageConfiguration, type PageContext, type PageError, PageFooter, PageFrame, type PageHandle, PageHeader, PageIdent, type PageManager, type PageRenderer, PageSection, PageSectionParam, PageSider, Pagination, type Print, ResponseError, type Schema, Signal$1 as Signal, State, Store, type StoreLayout, SubmodelsLayoutEvent, Theme, User, UserHook, VerifyContext, VerifyError, type WorkspaceDefine, zip_d_exports as ZIP, addManager, allHooks, application, buildDataSource, buildPlugin, createComputed, createDeeply, createDialog, createDocumentInModal, createFilters, createFrame, createIcon, createModal, createModelDefault, createProgressModal, createQuickFilters, createSafeComputed, createShowField, createState, createStore, createStoreField, createTick, effect, enumerationsService, execScript, filterPermission, flatPermission, formLayoutsService, getAllFilterFns, getAuthorizations, getField, getFieldFilter, getFieldFilterOperators, getFilterFns, getPages, getPermissionFields, getPrimaryFields, hasField, hasFieldFilter, importStyle, importWidget, isMac, isPluginId, loadMenu, modelService, neverAbortedSignal, pathRoots, _default as permissionsService, plugins, _default$1 as renderForm, renderStore, _default$2 as renderStoreForm, request, root$1 as root, selectFile, setIcon, showDocumentInModal, _default$3 as showFilterDialog, showSortDialog, start, testPermission, testPermissionConstraints, testPermissions, toFileLink, toFileURL, toId, toPermissionFilter, toSchema, toUrl, updateHooks, waitAbortSignal, watch };
|