@yongdall/web 0.6.3 → 0.6.4

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 CHANGED
@@ -1,12 +1,13 @@
1
1
  import * as dot_request1 from "dot-request";
2
2
  import DotRequest, { default as DotRequest$1 } from "dot-request";
3
3
  import { ArrayStore, BindObjectStore, ObjectStore, Schema, Schema as Schema$1, Store, Store as Store$1, StoreLayout, StoreLayout as StoreLayout$1, renderStore } from "@neeloong/form";
4
- import { Hook, Indicator, Plugin, Search } from "@yongdall/common";
5
4
  import { Field, FormLayout, MaybePromise, PageForm, Permission, Permissions } from "@yongdall/types";
5
+ import { Hook, Indicator, Plugin, Search } from "@yongdall/common";
6
+ import * as _yongdall_web0 from "@yongdall/web";
6
7
  import { Signal as Signal$1 } from "signal-polyfill";
7
8
  import { Cell, Workbook, Worksheet } from "exceljs";
8
- export * from "@yongdall/common";
9
9
  export * from "@yongdall/types";
10
+ export * from "@yongdall/common";
10
11
 
11
12
  //#region \0rolldown/runtime.js
12
13
  //#endregion
@@ -171,15 +172,15 @@ declare namespace Print {
171
172
  /**
172
173
  * - 文本对齐
173
174
  */
174
- textAlign?: "left" | "center" | "right" | "end" | "start" | "justify" | undefined;
175
+ textAlign?: "left" | "center" | "right" | "justify" | "start" | "end" | undefined;
175
176
  /**
176
177
  * - 垂直对齐
177
178
  */
178
- verticalAlign?: number | "sub" | "bottom" | "middle" | "top" | "baseline" | "super" | "text-top" | "text-bottom" | undefined;
179
+ verticalAlign?: number | "sub" | "baseline" | "super" | "top" | "text-top" | "middle" | "bottom" | "text-bottom" | undefined;
179
180
  /**
180
181
  * - 内边距属性对象
181
182
  */
182
- padding?: Record<"left" | "right" | "bottom" | "top", string | number> | undefined;
183
+ padding?: Record<"left" | "right" | "top" | "bottom", string | number> | undefined;
183
184
  border?: Print.Border | undefined;
184
185
  };
185
186
  type Context = string | Print.Newline | Print.Image | Print.Barcode | Print.Counter;
@@ -786,43 +787,40 @@ interface DataBus {
786
787
  }
787
788
  declare const DataBus: Partial<DataBus>;
788
789
  //#endregion
789
- //#region packages/web/services/page.d.mts
790
- type PageConfiguration = {
791
- id?: string | undefined;
792
- model?: string | undefined;
793
- user?: string | undefined;
794
- organization?: string | undefined;
795
- workspace?: string | undefined;
796
- page?: string | undefined;
797
- url?: string | undefined;
798
- hiddenFilter?: string | undefined;
799
- widget?: string | null | undefined;
800
- title?: string | undefined;
801
- titlePattern?: string | undefined;
802
- config?: Record<string, any> | undefined;
803
- fields?: Field.Show[] | undefined;
804
- sides?: {
805
- widget: string;
806
- options: string;
807
- }[] | undefined;
808
- menuButtons?: Menu.Button[] | undefined;
809
- menus?: (Menu | null)[] | undefined;
810
- forms?: Record<string, PageForm | null> | undefined;
811
- where?: Search.AndList | undefined;
812
- orWhere?: Search.OrList | undefined;
813
- sort?: [field: string, desc?: boolean | undefined][] | undefined;
814
- limit?: number | undefined;
815
- defaultQuery?: string | undefined;
816
- /**
817
- * // TODO: 是否分页
818
- */
819
- filters?: {
820
- field: string;
821
- label?: string;
822
- operator: string;
823
- state?: string;
824
- }[] | undefined;
825
- };
790
+ //#region packages/web/data/stateSnapshot.d.mts
791
+ declare function stateSnapshot<T extends object>(data: T): [snapshot: Readonly<T>, clear: () => void];
792
+ //#endregion
793
+ //#region packages/web/data/bindStatePlaceholder.d.mts
794
+ /**
795
+ * 绑定占位符并生成一个惰性读取器(Reader)
796
+ * @param placeholder 占位符字符串 (如 ':count', '@mode', '*:id')
797
+ * @param snapshot 包含全局和环境快照的上下文对象
798
+ * @returns 返回一个用于获取值的函数,如果占位符不合法或快照缺失则返回 null
799
+ */
800
+ declare function bindStatePlaceholder(placeholder: string, snapshot?: {
801
+ global?: Record<string, any>;
802
+ env?: Record<string, any>;
803
+ }): (() => any) | null;
804
+ declare namespace GlobalEvent_d_exports {
805
+ export { Listener$1 as Listener, dispatch$1 as dispatch, listen$1 as listen };
806
+ }
807
+ interface Listener$1 {
808
+ (this: any[], data: any, path: any[]): void;
809
+ }
810
+ declare function listen$1(path: any | any[], listener: Listener$1, options?: {
811
+ signal?: AbortSignal;
812
+ }): () => void;
813
+ declare function dispatch$1(path: any | any[], data: any): void;
814
+ declare namespace SharedEvent_d_exports {
815
+ export { Listener, dispatch, listen };
816
+ }
817
+ interface Listener {
818
+ (this: string[], data: any, path: string[]): void;
819
+ }
820
+ declare function listen(path: string | string[], listener: Listener, options?: {
821
+ signal?: AbortSignal;
822
+ }): () => void;
823
+ declare function dispatch(path: string | string[], data: any): void;
826
824
  //#endregion
827
825
  //#region packages/web/route/route.d.mts
828
826
  /**
@@ -830,7 +828,7 @@ type PageConfiguration = {
830
828
  * @param {...string | null | undefined} paths
831
829
  * @returns {string}
832
830
  */
833
- declare function stringify$1(page: PageIdent, ...paths: (string | null | undefined)[]): string;
831
+ declare function stringify$2(page: PageIdent, ...paths: (string | null | undefined)[]): string;
834
832
  /**
835
833
  * @param {PageIdent} page
836
834
  * @param {...string | null | undefined} paths
@@ -840,7 +838,7 @@ declare function toHref(page: PageIdent, ...paths: (string | null | undefined)[]
840
838
  type PageIdent = PageIdent.Model | PageIdent.Organization | PageIdent.User | PageIdent.Workspace | PageIdent.Page | PageIdent.Configuration;
841
839
  declare const PageIdent: {
842
840
  readonly parse: PageIdent.Parser;
843
- readonly stringify: typeof stringify$1;
841
+ readonly stringify: typeof stringify$2;
844
842
  readonly toHref: typeof toHref;
845
843
  };
846
844
  declare namespace PageIdent {
@@ -921,6 +919,13 @@ declare namespace PageIdent {
921
919
  type Page = {
922
920
  type: "todo" | "settings" | "search" | "status" | "devtools" | "home";
923
921
  continuation?: null | undefined;
922
+ error?: null | undefined;
923
+ page?: null | undefined;
924
+ workspace?: null | undefined;
925
+ setting?: false | undefined;
926
+ edit?: false | undefined;
927
+ id?: undefined;
928
+ input?: undefined;
924
929
  };
925
930
  type Route = {
926
931
  page: PageIdent;
@@ -933,26 +938,16 @@ declare namespace PageIdent {
933
938
  }
934
939
  //#endregion
935
940
  //#region packages/web/route/PageHandle.d.mts
936
- /**
937
- * @typedef {object} RootPageExt
938
- * @property {() => { path: string; search: string; hash: string; }} get
939
- * @property {(path: string,search: string, hash: string) => void} update
940
- */
941
+ interface RootPageExt {
942
+ get(): {
943
+ path: string;
944
+ search: string;
945
+ hash: string;
946
+ };
947
+ update(path: string, search: string, hash: string): void;
948
+ }
941
949
  declare class PageHandle extends GeneralContext {
942
- /**
943
- *
944
- * @param {Object} options
945
- * @param {string} options.pageId
946
- * @param {PageConfiguration?} options.define
947
- * @param {PageIdent} options.ident
948
- * @param {string} options.root
949
- * @param {string} options.path
950
- * @param {string} options.search
951
- * @param {string} options.hash
952
- * @param {PageInfo & RootPageExt} options.pageHandler
953
- * @param {(url: string, replace?: boolean) => void} options.open
954
- * @param {(p: string, replace?: boolean) => void} options.setRootPath
955
- */
950
+ #private;
956
951
  constructor({
957
952
  pageId,
958
953
  define,
@@ -976,15 +971,6 @@ declare class PageHandle extends GeneralContext {
976
971
  open: (url: string, replace?: boolean) => void;
977
972
  setRootPath: (p: string, replace?: boolean) => void;
978
973
  });
979
- /** @param {string | (() => string)} title */
980
- set title(title: string | (() => string));
981
- /** @returns {string} */
982
- get title(): string;
983
- /**
984
- *
985
- * @param {(show: boolean) => void} fn
986
- * @param {AbortSignal} signal
987
- */
988
974
  onToggle(fn: (show: boolean) => void, signal: AbortSignal): void;
989
975
  get bootLoading(): boolean;
990
976
  get define(): PageConfiguration | null;
@@ -996,80 +982,28 @@ declare class PageHandle extends GeneralContext {
996
982
  get href(): string;
997
983
  get current(): boolean;
998
984
  get shown(): boolean;
999
- /** @param {string | (() => string)} icon */
1000
- set icon(icon: string | (() => string));
1001
- /** @returns {string} */
985
+ get title(): string;
986
+ set title(title: string | (() => string));
1002
987
  get icon(): string;
1003
- set print(print: Print);
988
+ set icon(icon: string | (() => string));
1004
989
  get print(): Print;
1005
- /** @param {boolean | (() => boolean)} unsaved */
1006
- set unsaved(unsaved: boolean | (() => boolean));
1007
- /** @returns {boolean} */
990
+ set print(print: Print);
1008
991
  get unsaved(): boolean;
1009
- /** @param {boolean | (() => boolean)} guarded */
1010
- set guarded(guarded: boolean | (() => boolean));
1011
- /** @returns {boolean} */
992
+ set unsaved(unsaved: boolean | (() => boolean));
1012
993
  get guarded(): boolean;
1013
- set loading(loading: boolean);
994
+ set guarded(guarded: boolean | (() => boolean));
1014
995
  get loading(): boolean;
1015
- /**
1016
- * @param {string} url
1017
- * @param {string | PageIdent} [page]
1018
- * @returns {string}
1019
- */
996
+ set loading(loading: boolean);
997
+ whenCurrent<T>(fn: () => T): (() => T | void);
1020
998
  toUrl(url: string, page?: string | PageIdent): string;
1021
- /**
1022
- * @overload
1023
- * @param {string} url
1024
- * @param {boolean} [replace]
1025
- * @returns {void}
1026
- */
1027
- open(url: string, replace?: boolean | undefined): void;
1028
- /**
1029
- * @overload
1030
- * @param {string} url
1031
- * @param {string | PageIdent} [page]
1032
- * @param {boolean} [replace]
1033
- * @returns {void}
1034
- */
1035
- open(url: string, page?: string | PageIdent | undefined, replace?: boolean | undefined): void;
1036
- /**
1037
- * @overload
1038
- * @param {string} url
1039
- * @param {boolean | string | PageIdent} [page]
1040
- * @param {boolean} [replace]
1041
- * @returns {void}
1042
- */
1043
- open(url: string, page?: string | boolean | PageIdent | undefined, replace?: boolean | undefined): void;
1044
- /**
1045
- *
1046
- * @param {string} p
1047
- * @param {boolean} [replace]
1048
- * @returns {void}
1049
- */
999
+ open(url: string, replace?: boolean): void;
1000
+ open(url: string, page?: string | PageIdent, replace?: boolean): void;
1001
+ open(url: string, page?: boolean | string | PageIdent, replace?: boolean): void;
1050
1002
  setPath(p: string, replace?: boolean): void;
1051
- /**
1052
- *
1053
- * @param {boolean} [replace]
1054
- * @returns {void}
1055
- */
1056
1003
  show(replace?: boolean): void;
1057
1004
  get destroyDeferred(): boolean;
1058
- /**
1059
- * @param {boolean} [defer]
1060
- * @returns {boolean}
1061
- */
1062
1005
  destroy(defer?: boolean): boolean;
1063
- #private;
1064
1006
  }
1065
- type RootPageExt = {
1066
- get: () => {
1067
- path: string;
1068
- search: string;
1069
- hash: string;
1070
- };
1071
- update: (path: string, search: string, hash: string) => void;
1072
- };
1073
1007
  //#endregion
1074
1008
  //#region packages/web/route/pageManager.d.mts
1075
1009
  /**
@@ -1384,53 +1318,35 @@ declare namespace User {
1384
1318
  }
1385
1319
  //#endregion
1386
1320
  //#region packages/web/Command.d.mts
1387
- /**
1388
- * 命令接口
1389
- */
1390
- type Command = {
1391
- disabled: (options: Command.Options, menu: Menu, command: string) => boolean;
1392
- toHref: (options: Command.Options, menu: Menu, command: string) => string;
1393
- exec: (options: Command.Options, menu: Menu, command: string) => void;
1394
- };
1321
+ declare namespace Command {
1322
+ /** 命令选项 */
1323
+ interface Options {
1324
+ type: 'documents' | 'document' | 'createDocument' | 'editDocument';
1325
+ model?: ModelScriptConfiguration;
1326
+ pageIdent?: PageIdent;
1327
+ document?: Record<string, any>;
1328
+ documents?: Array<Record<string, any>>;
1329
+ checkedDocuments?: Array<Record<string, any>>;
1330
+ store?: Store$1;
1331
+ refresh?(delay?: boolean): void;
1332
+ }
1333
+ /** 命令接口 */
1334
+ interface Widget {
1335
+ commandType: 'documents' | 'document' | 'createDocument' | 'editDocument' | Set<'documents' | 'document' | 'createDocument' | 'editDocument'> | ('documents' | 'document' | 'createDocument' | 'editDocument')[];
1336
+ exec(options: Command.Options, menu: Menu, command: string): void;
1337
+ }
1338
+ }
1339
+ /** 命令接口 */
1340
+ interface Command {
1341
+ disabled(options: Command.Options, menu: Menu, command: string): boolean;
1342
+ toHref(options: Command.Options, menu: Menu, command: string): string;
1343
+ exec(options: Command.Options, menu: Menu, command: string): void;
1344
+ }
1395
1345
  declare const Command: {
1396
- /**
1397
- *
1398
- * @param {Command.Options} options
1399
- * @param {Menu} menu
1400
- * @returns {boolean}
1401
- */
1402
1346
  disabled(options: Command.Options, menu: Menu): boolean;
1403
- /**
1404
- *
1405
- * @param {Command.Options} options
1406
- * @param {Menu} menu
1407
- * @returns {string}
1408
- */
1409
1347
  toHref(options: Command.Options, menu: Menu): string;
1410
- /**
1411
- *
1412
- * @param {Command.Options} options
1413
- * @param {Menu} menu
1414
- * @returns {void}
1415
- */
1416
1348
  exec(options: Command.Options, menu: Menu): void;
1417
1349
  };
1418
- declare namespace Command {
1419
- /**
1420
- * 命令选项
1421
- */
1422
- type Options = {
1423
- type: "documents" | "document" | "createDocument" | "editDocument";
1424
- model?: ModelScriptConfiguration | undefined;
1425
- pageIdent?: PageIdent | undefined;
1426
- document?: Record<string, any> | undefined;
1427
- documents?: Record<string, any>[] | undefined;
1428
- checkedDocuments?: Record<string, any>[] | undefined;
1429
- store?: Store$1<any, any, {
1430
- [x: string]: any;
1431
- }> | undefined;
1432
- };
1433
- }
1434
1350
  //#endregion
1435
1351
  //#region packages/web/DataSource/index.d.mts
1436
1352
  /**
@@ -1498,9 +1414,54 @@ type DataSource = {
1498
1414
  map: Record<string, any>;
1499
1415
  model?: string | null | undefined;
1500
1416
  service?: {
1501
- then<TResult1 = ModelConfiguration | null, TResult2 = never>(onfulfilled?: ((value: ModelConfiguration | null) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
1502
- catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<ModelConfiguration | TResult2 | null>;
1503
- finally(onfinally?: (() => void) | null | undefined): Promise<ModelConfiguration | null>;
1417
+ service(serviceId: string): {
1418
+ query({
1419
+ values,
1420
+ where,
1421
+ orWhere,
1422
+ sort,
1423
+ limit,
1424
+ page,
1425
+ offset,
1426
+ select,
1427
+ total,
1428
+ primary
1429
+ }?: Search.Param): Promise<{
1430
+ documents: any[];
1431
+ total: number;
1432
+ }>;
1433
+ getOptions(): Record<string, any>[];
1434
+ options: {
1435
+ (options?: boolean): Promise<Record<string, any>[]>;
1436
+ (options: Search.Param): Promise<{
1437
+ options: Record<string, any>[];
1438
+ total: number;
1439
+ }>;
1440
+ (options?: Search.Param | boolean): Promise<Record<string, any>[] | {
1441
+ options: Record<string, any>[];
1442
+ total: number;
1443
+ }>;
1444
+ };
1445
+ option(id: string | number): Promise<unknown>;
1446
+ create(data: Record<string, any>, signal?: dot_request1.default.Signal): Promise<unknown>;
1447
+ document(id: string | number): {
1448
+ then<TResult1 = Record<string, any>, TResult2 = never>(onfulfilled?: ((value: Record<string, any>) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
1449
+ catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<Record<string, any> | TResult2>;
1450
+ finally(onfinally?: (() => void) | null | undefined): Promise<Record<string, any>>;
1451
+ get: () => Promise<Record<string, any>>;
1452
+ update(data: Record<string, any>): Promise<object>;
1453
+ delete(): Promise<void>;
1454
+ field(field: string): {
1455
+ then<TResult1 = any, TResult2 = never>(onfulfilled?: ((value: any) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
1456
+ catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<any>;
1457
+ finally(onfinally?: (() => void) | null | undefined): Promise<any>;
1458
+ get: () => Promise<any>;
1459
+ };
1460
+ };
1461
+ };
1462
+ then<TResult1 = _yongdall_web0.ModelConfiguration | null, TResult2 = never>(onfulfilled?: ((value: _yongdall_web0.ModelConfiguration | null) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
1463
+ catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<_yongdall_web0.ModelConfiguration | TResult2 | null>;
1464
+ finally(onfinally?: (() => void) | null | undefined): Promise<_yongdall_web0.ModelConfiguration | null>;
1504
1465
  query({
1505
1466
  values,
1506
1467
  where,
@@ -1517,29 +1478,25 @@ type DataSource = {
1517
1478
  total: number;
1518
1479
  }>;
1519
1480
  getOptions(): Record<string, any>[];
1520
- /**
1521
- * @overload
1522
- * @param {boolean} [options]
1523
- * @returns {Promise<Record<string, any>[]>}
1524
- */
1525
- options(options?: boolean | undefined): Promise<Record<string, any>[]>;
1526
- /**
1527
- * @overload
1528
- * @param {Search.Param} options
1529
- * @returns {Promise<{options: Record<string, any>[]; total: number}>}
1530
- */
1531
- options(options: Search.Param): Promise<{
1532
- options: Record<string, any>[];
1533
- total: number;
1534
- }>;
1535
- option(id: string | number): Promise<any>;
1536
- create(data: Record<string, any>, signal?: dot_request1.default.Signal): Promise<any>;
1481
+ options: {
1482
+ (options?: boolean): Promise<Record<string, any>[]>;
1483
+ (options: Search.Param): Promise<{
1484
+ options: Record<string, any>[];
1485
+ total: number;
1486
+ }>;
1487
+ (options?: Search.Param | boolean): Promise<Record<string, any>[] | {
1488
+ options: Record<string, any>[];
1489
+ total: number;
1490
+ }>;
1491
+ };
1492
+ option(id: string | number): Promise<unknown>;
1493
+ create(data: Record<string, any>, signal?: dot_request1.default.Signal): Promise<unknown>;
1537
1494
  document(id: string | number): {
1538
1495
  then<TResult1 = Record<string, any>, TResult2 = never>(onfulfilled?: ((value: Record<string, any>) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
1539
1496
  catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<Record<string, any> | TResult2>;
1540
1497
  finally(onfinally?: (() => void) | null | undefined): Promise<Record<string, any>>;
1541
1498
  get: () => Promise<Record<string, any>>;
1542
- update(data: Record<string, any>): Promise<any>;
1499
+ update(data: Record<string, any>): Promise<object>;
1543
1500
  delete(): Promise<void>;
1544
1501
  field(field: string): {
1545
1502
  then<TResult1 = any, TResult2 = never>(onfulfilled?: ((value: any) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
@@ -1548,10 +1505,10 @@ type DataSource = {
1548
1505
  get: () => Promise<any>;
1549
1506
  };
1550
1507
  };
1551
- loadModel: (force?: boolean) => Promise<ModelConfiguration | null>;
1552
- loadScript: (force?: boolean) => Promise<ModelScriptConfiguration | null>;
1553
- getModel: () => ModelConfiguration | null;
1554
- getScript: () => ModelScriptConfiguration | null;
1508
+ loadModel: (force?: boolean) => Promise<_yongdall_web0.ModelConfiguration | null>;
1509
+ loadScript: (force?: boolean) => Promise<_yongdall_web0.ModelScriptConfiguration | null>;
1510
+ getModel: () => _yongdall_web0.ModelConfiguration | null;
1511
+ getScript: () => _yongdall_web0.ModelScriptConfiguration | null;
1555
1512
  } | null | undefined;
1556
1513
  where: (Search.Match | Search.Children)[];
1557
1514
  orWhere: (Search.Match | Search.Children | Search.Or)[];
@@ -1875,19 +1832,143 @@ declare namespace PageFrame {
1875
1832
  }
1876
1833
  //#endregion
1877
1834
  //#region packages/web/services/model.d.mts
1878
- /**
1879
- *
1880
- * @param {string} model
1881
- * @returns
1882
- */
1835
+ interface ModelConfiguration {
1836
+ id?: string;
1837
+ label?: string;
1838
+ /** 字段配置 */
1839
+ fields: Record<string, Field>;
1840
+ /** 图标字段 */
1841
+ iconField?: string | null;
1842
+ /** 图像字段 */
1843
+ imageField?: string | null;
1844
+ /** 标签字段 */
1845
+ labelField?: string | null;
1846
+ /** 标签命名规则 */
1847
+ labelPattern?: string | null;
1848
+ /** 权限配置 */
1849
+ permissions?: Permission[];
1850
+ /** 模型选项,关联前端脚本可读取 */
1851
+ options?: Record<string, unknown> | null;
1852
+ /** 关联前端脚本 */
1853
+ scripts?: (string | [string, object])[] | null;
1854
+ /** 关联默认页面 */
1855
+ pages?: Record<string, string | object | null> | null;
1856
+ }
1857
+ interface FieldScriptConfiguration extends Omit<Field, 'scripts' | 'type'> {
1858
+ component?: FieldComponent;
1859
+ script?: Omit<FieldScript, 'subFields'>;
1860
+ type: string | Record<string, FieldScriptConfiguration>;
1861
+ }
1862
+ interface ModelScriptConfiguration extends Omit<ModelConfiguration, 'scripts' | 'fields'> {
1863
+ script?: Omit<ModelScript, 'fields'>;
1864
+ fields: Record<string, FieldScriptConfiguration>;
1865
+ }
1866
+ interface ListScriptParameter {
1867
+ model: ModelScriptConfiguration;
1868
+ checkedDocuments?: Record<string, any>[];
1869
+ documents?: Record<string, any>[];
1870
+ refresh?(delay?: boolean): void;
1871
+ }
1872
+ interface DocumentScriptParameter {
1873
+ model: ModelScriptConfiguration;
1874
+ document?: Record<string, any>;
1875
+ store?: Store$1;
1876
+ refresh?(delay?: boolean): void;
1877
+ }
1878
+ type ModelCommand<T> = ((p: T) => void) | {
1879
+ exec(p: T): void;
1880
+ };
1881
+ interface ModelScript {
1882
+ /** 字段配置 */
1883
+ fields?: Record<string, FieldScript>;
1884
+ input?: ((document: any, ...fields: (string | number)[]) => void) | null;
1885
+ change?: ((document: any, ...fields: (string | number)[]) => void) | null;
1886
+ beforeCreate?: ((document: any) => void) | null;
1887
+ beforeUpdate?: ((document: any) => void) | null;
1888
+ beforeSave?: ((document: any) => void) | null;
1889
+ beforeDestroy?: ((document: any) => void) | null;
1890
+ beforeUpsert?: ((document: any) => void) | null;
1891
+ listScripts?: Record<string, ModelCommand<ListScriptParameter>>;
1892
+ documentScripts?: Record<string, ModelCommand<DocumentScriptParameter>>;
1893
+ }
1894
+ interface FieldScript {
1895
+ /** 子字段配置 */
1896
+ subFields?: Record<string, FieldScript>;
1897
+ component?: FieldComponent;
1898
+ input?: ((value: InputEvent, store: Store$1) => void | boolean | null) | null;
1899
+ change?: ((value: InputEvent, store: Store$1) => void | boolean | null) | null;
1900
+ click?: ((value: Event, store: Store$1) => void | boolean | null) | null;
1901
+ focus?: ((value: Event, store: Store$1) => void | boolean | null) | null;
1902
+ blur?: ((value: Event, store: Store$1) => void | boolean | null) | null;
1903
+ add?: ((document: any, field: string, ...fields: (string | number)[]) => void | object) | null;
1904
+ remove?: ((value: any[], document: any, field: string, ...fields: (string | number)[]) => void) | null;
1905
+ move?: ((from: number[], to: number, document: any, field: string, ...fields: (string | number)[]) => void) | null;
1906
+ readonly?: ((store: Store$1) => boolean) | null;
1907
+ hidden?: ((store: Store$1) => boolean) | null;
1908
+ required?: ((store: Store$1) => boolean) | null;
1909
+ clearable?: ((store: Store$1) => boolean) | null;
1910
+ disabled?: ((store: Store$1) => boolean) | null;
1911
+ default?: ((store: Store$1) => any) | null;
1912
+ label?: ((store: Store$1) => string) | null;
1913
+ description?: ((store: Store$1) => string) | null;
1914
+ placeholder?: ((store: Store$1) => string) | null;
1915
+ validator?: Schema$1.Validator | Schema$1.Validator[] | null;
1916
+ source?: ((store?: Store$1 | null) => Iterable<Record<string, any>>) | null;
1917
+ filter?: ((item: Record<string, any>, store?: Store$1 | null) => boolean) | null;
1918
+ }
1883
1919
  declare function modelService(model: string): {
1920
+ service(serviceId: string): {
1921
+ query({
1922
+ values,
1923
+ where,
1924
+ orWhere,
1925
+ sort,
1926
+ limit,
1927
+ page,
1928
+ offset,
1929
+ select,
1930
+ total,
1931
+ primary
1932
+ }?: Search.Param): Promise<{
1933
+ documents: any[];
1934
+ total: number;
1935
+ }>;
1936
+ getOptions(): Record<string, any>[];
1937
+ options: {
1938
+ (options?: boolean): Promise<Record<string, any>[]>;
1939
+ (options: Search.Param): Promise<{
1940
+ options: Record<string, any>[];
1941
+ total: number;
1942
+ }>;
1943
+ (options?: Search.Param | boolean): Promise<Record<string, any>[] | {
1944
+ options: Record<string, any>[];
1945
+ total: number;
1946
+ }>;
1947
+ };
1948
+ option(id: string | number): Promise<unknown>;
1949
+ create(data: Record<string, any>, signal?: DotRequest$1.Signal): Promise<unknown>;
1950
+ /**
1951
+ *
1952
+ * @param {string | number} id
1953
+ */
1954
+ document(id: string | number): {
1955
+ then<TResult1 = Record<string, any>, TResult2 = never>(onfulfilled?: ((value: Record<string, any>) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
1956
+ catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<Record<string, any> | TResult2>;
1957
+ finally(onfinally?: (() => void) | null | undefined): Promise<Record<string, any>>;
1958
+ get: () => Promise<Record<string, any>>;
1959
+ update(data: Record<string, any>): Promise<object>;
1960
+ delete(): Promise<void>;
1961
+ field(field: string): {
1962
+ then<TResult1 = any, TResult2 = never>(onfulfilled?: ((value: any) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
1963
+ catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<any>;
1964
+ finally(onfinally?: (() => void) | null | undefined): Promise<any>;
1965
+ get: () => Promise<any>;
1966
+ };
1967
+ };
1968
+ };
1884
1969
  then<TResult1 = ModelConfiguration | null, TResult2 = never>(onfulfilled?: ((value: ModelConfiguration | null) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
1885
1970
  catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<ModelConfiguration | TResult2 | null>;
1886
1971
  finally(onfinally?: (() => void) | null | undefined): Promise<ModelConfiguration | null>;
1887
- /**
1888
- * @param {Search.Param} [options]
1889
- * @returns {Promise<{documents: any[]; total: number}>}
1890
- */
1891
1972
  query({
1892
1973
  values,
1893
1974
  where,
@@ -1904,33 +1985,19 @@ declare function modelService(model: string): {
1904
1985
  total: number;
1905
1986
  }>;
1906
1987
  getOptions(): Record<string, any>[];
1907
- /**
1908
- * @overload
1909
- * @param {boolean} [options]
1910
- * @returns {Promise<Record<string, any>[]>}
1911
- */
1912
- options(options?: boolean | undefined): Promise<Record<string, any>[]>;
1913
- /**
1914
- * @overload
1915
- * @param {Search.Param} options
1916
- * @returns {Promise<{options: Record<string, any>[]; total: number}>}
1917
- */
1918
- options(options: Search.Param): Promise<{
1919
- options: Record<string, any>[];
1920
- total: number;
1921
- }>;
1922
- /**
1923
- *
1924
- * @param {string | number} id
1925
- */
1926
- option(id: string | number): Promise<any>;
1927
- /**
1928
- *
1929
- * @param {Record<string, any>} data
1930
- * @param {DotRequest.Signal} [signal]
1931
- * @returns
1932
- */
1933
- create(data: Record<string, any>, signal?: DotRequest$1.Signal): Promise<any>;
1988
+ options: {
1989
+ (options?: boolean): Promise<Record<string, any>[]>;
1990
+ (options: Search.Param): Promise<{
1991
+ options: Record<string, any>[];
1992
+ total: number;
1993
+ }>;
1994
+ (options?: Search.Param | boolean): Promise<Record<string, any>[] | {
1995
+ options: Record<string, any>[];
1996
+ total: number;
1997
+ }>;
1998
+ };
1999
+ option(id: string | number): Promise<unknown>;
2000
+ create(data: Record<string, any>, signal?: DotRequest$1.Signal): Promise<unknown>;
1934
2001
  /**
1935
2002
  *
1936
2003
  * @param {string | number} id
@@ -1940,12 +2007,8 @@ declare function modelService(model: string): {
1940
2007
  catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<Record<string, any> | TResult2>;
1941
2008
  finally(onfinally?: (() => void) | null | undefined): Promise<Record<string, any>>;
1942
2009
  get: () => Promise<Record<string, any>>;
1943
- /**
1944
- * @param {Record<string, any>} data
1945
- * @returns
1946
- */
1947
- update(data: Record<string, any>): Promise<any>;
1948
- delete(): Promise<void>; /** @param {string} field */
2010
+ update(data: Record<string, any>): Promise<object>;
2011
+ delete(): Promise<void>;
1949
2012
  field(field: string): {
1950
2013
  then<TResult1 = any, TResult2 = never>(onfulfilled?: ((value: any) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
1951
2014
  catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<any>;
@@ -1958,115 +2021,139 @@ declare function modelService(model: string): {
1958
2021
  getModel: () => ModelConfiguration | null;
1959
2022
  getScript: () => ModelScriptConfiguration | null;
1960
2023
  };
1961
- type ModelConfiguration = {
2024
+ //#endregion
2025
+ //#region packages/web/services/page.d.mts
2026
+ /**
2027
+ *
2028
+ * @param {PageParam} page
2029
+ * @returns
2030
+ */
2031
+ declare function pageService({
2032
+ model,
2033
+ organization,
2034
+ user,
2035
+ workspace,
2036
+ type
2037
+ }: PageParam): {
2038
+ then<TResult1 = PageConfiguration | null, TResult2 = never>(onfulfilled?: ((value: PageConfiguration | null) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
2039
+ catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<PageConfiguration | TResult2 | null>;
2040
+ finally(onfinally?: (() => void) | null | undefined): Promise<PageConfiguration | null>;
2041
+ loadPage: (force?: boolean) => Promise<PageConfiguration | null>;
2042
+ getPage: () => PageConfiguration | null;
2043
+ loadConfiguration(): Promise<false | Record<string, any> | undefined>;
2044
+ };
2045
+ type PageConfiguration = {
1962
2046
  id?: string | undefined;
1963
- label?: string | undefined;
1964
- /**
1965
- * 字段配置
1966
- */
1967
- fields: Record<string, Field>;
1968
- /**
1969
- * 图标字段
1970
- */
1971
- iconField?: string | null | undefined;
1972
- /**
1973
- * 图像字段
1974
- */
1975
- imageField?: string | null | undefined;
1976
- /**
1977
- * 标签字段
1978
- */
1979
- labelField?: string | null | undefined;
1980
- /**
1981
- * 标签命名规则
1982
- */
1983
- labelPattern?: string | null | undefined;
1984
- /**
1985
- * 权限配置
1986
- */
1987
- permissions?: Permission[] | undefined;
1988
- /**
1989
- * 模型选项,关联前端脚本可读取
1990
- */
1991
- options?: Record<string, unknown> | null | undefined;
1992
- /**
1993
- * 关联前端脚本
1994
- */
1995
- scripts?: (string | [string, object])[] | null | undefined;
1996
- /**
1997
- * 关联默认页面
1998
- * // TODO: 查询配置
1999
- * // TODO: 前端按钮配置
2000
- * // TODO: 是否可销毁、可创建、更新、保存、upsert
2001
- * // TODO: 列表内操作按钮
2002
- * // TODO: 编辑内按钮
2003
- * // TODO: 操作事件
2047
+ model?: string | undefined;
2048
+ user?: string | undefined;
2049
+ organization?: string | undefined;
2050
+ workspace?: string | undefined;
2051
+ page?: string | undefined;
2052
+ url?: string | undefined;
2053
+ hiddenFilter?: string | undefined;
2054
+ widget?: string | null | undefined;
2055
+ title?: string | undefined;
2056
+ titlePattern?: string | undefined;
2057
+ config?: Record<string, any> | undefined;
2058
+ fields?: Field.Show[] | undefined;
2059
+ sides?: {
2060
+ widget: string;
2061
+ options: string;
2062
+ }[] | undefined;
2063
+ menuButtons?: Menu.Button[] | undefined;
2064
+ menus?: (Menu | null)[] | undefined;
2065
+ forms?: Record<string, PageForm | null> | undefined;
2066
+ where?: Search.AndList | undefined;
2067
+ orWhere?: Search.OrList | undefined;
2068
+ sort?: [field: string, desc?: boolean | undefined][] | undefined;
2069
+ limit?: number | undefined;
2070
+ defaultQuery?: string | undefined;
2071
+ /**
2004
2072
  * // TODO: 是否分页
2005
2073
  */
2006
- pages?: Record<string, string | object | null> | null | undefined;
2007
- };
2008
- type FieldScriptConfiguration = Omit<Field, "scripts" | "type"> & {
2009
- component?: FieldComponent;
2010
- script?: Omit<FieldScript, "subFields">;
2011
- type: string | Record<string, FieldScriptConfiguration>;
2074
+ filters?: {
2075
+ field: string;
2076
+ label?: string;
2077
+ operator: string;
2078
+ state?: string;
2079
+ }[] | undefined;
2012
2080
  };
2013
- type ModelScriptConfiguration = Omit<ModelConfiguration, "scripts" | "fields"> & {
2014
- script?: Omit<ModelScript, "fields">;
2015
- fields: Record<string, FieldScriptConfiguration>;
2081
+ type PageParam = {
2082
+ model?: string | null | undefined;
2083
+ organization?: string | null | undefined;
2084
+ user?: string | null | undefined;
2085
+ workspace?: string | null | undefined;
2086
+ type: string;
2016
2087
  };
2017
- type ListScriptParameter = {
2018
- model: ModelScriptConfiguration;
2019
- checkedDocuments?: Record<string, any>[] | undefined;
2020
- documents?: Record<string, any>[] | undefined;
2088
+ //#endregion
2089
+ //#region packages/web/services/enumeration.d.mts
2090
+ /**
2091
+ *
2092
+ * @param {string} enumeration
2093
+ * @returns
2094
+ */
2095
+ declare function enumerationsService(enumeration: string): {
2096
+ then<TResult1 = Record<string, any>[], TResult2 = never>(onfulfilled?: ((value: Record<string, any>[]) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
2097
+ catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<Record<string, any>[] | TResult2>;
2098
+ finally(onfinally?: (() => void) | null | undefined): Promise<Record<string, any>[]>;
2099
+ load: (force?: boolean) => Promise<Record<string, any>[]>;
2100
+ get: () => Record<string, any>[];
2021
2101
  };
2022
- type DocumentScriptParameter = {
2023
- model: ModelScriptConfiguration;
2024
- document?: Record<string, any> | undefined;
2025
- store?: Store$1<any, any, {
2026
- [x: string]: any;
2027
- }> | undefined;
2102
+ //#endregion
2103
+ //#region packages/web/services/formLayout.d.mts
2104
+ /**
2105
+ *
2106
+ * @param {string} layout
2107
+ * @returns
2108
+ */
2109
+ declare function formLayoutsService(layout: string): {
2110
+ then<TResult1 = FormLayout | null, TResult2 = never>(onfulfilled?: ((value: FormLayout | null) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
2111
+ catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<FormLayout | TResult2 | null>;
2112
+ finally(onfinally?: (() => void) | null | undefined): Promise<FormLayout | null>;
2113
+ load: (force?: boolean) => Promise<FormLayout | null>;
2114
+ get: () => FormLayout | null;
2028
2115
  };
2029
- type ModelScript = {
2030
- /**
2031
- * 字段配置
2032
- */
2033
- fields?: Record<string, FieldScript> | undefined;
2034
- input?: ((document: any, ...fields: (string | number)[]) => void) | null | undefined;
2035
- change?: ((document: any, ...fields: (string | number)[]) => void) | null | undefined;
2036
- beforeCreate?: ((document: any) => void) | null | undefined;
2037
- beforeUpdate?: ((document: any) => void) | null | undefined;
2038
- beforeSave?: ((document: any) => void) | null | undefined;
2039
- beforeDestroy?: ((document: any) => void) | null | undefined;
2040
- beforeUpsert?: ((document: any) => void) | null | undefined;
2041
- listScripts?: Record<string, (params: ListScriptParameter) => void> | undefined;
2042
- documentScripts?: Record<string, (params: DocumentScriptParameter) => void> | undefined;
2116
+ //#endregion
2117
+ //#region packages/web/services/permissions.d.mts
2118
+ declare const _default: {
2119
+ then<TResult1 = Permission$1[], TResult2 = never>(onfulfilled?: ((value: Permission$1[]) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
2120
+ catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<Permission$1[] | TResult2>;
2121
+ finally(onfinally?: (() => void) | null | undefined): Promise<Permission$1[]>;
2122
+ load: typeof load$2;
2123
+ get: typeof get;
2043
2124
  };
2044
- type FieldScript = {
2045
- /**
2046
- * 子字段配置
2047
- */
2048
- subFields?: Record<string, FieldScript> | undefined;
2049
- component?: FieldComponent<Record<string, any>> | undefined;
2050
- input?: ((value: InputEvent, store: Store$1) => void | boolean | null) | null | undefined;
2051
- change?: ((value: InputEvent, store: Store$1) => void | boolean | null) | null | undefined;
2052
- click?: ((value: Event, store: Store$1) => void | boolean | null) | null | undefined;
2053
- focus?: ((value: Event, store: Store$1) => void | boolean | null) | null | undefined;
2054
- blur?: ((value: Event, store: Store$1) => void | boolean | null) | null | undefined;
2055
- add?: ((document: any, field: string, ...fields: (string | number)[]) => void | object) | null | undefined;
2056
- remove?: ((value: any[], document: any, field: string, ...fields: (string | number)[]) => void) | null | undefined;
2057
- move?: ((from: number[], to: number, document: any, field: string, ...fields: (string | number)[]) => void) | null | undefined;
2058
- readonly?: ((store: Store$1) => boolean) | null | undefined;
2059
- hidden?: ((store: Store$1) => boolean) | null | undefined;
2060
- required?: ((store: Store$1) => boolean) | null | undefined;
2061
- clearable?: ((store: Store$1) => boolean) | null | undefined;
2062
- disabled?: ((store: Store$1) => boolean) | null | undefined;
2063
- default?: ((store: Store$1) => any) | null | undefined;
2064
- label?: ((store: Store$1) => string) | null | undefined;
2065
- description?: ((store: Store$1) => string) | null | undefined;
2066
- placeholder?: ((store: Store$1) => string) | null | undefined;
2067
- validator?: Schema$1.Validator | Schema$1.Validator[] | null | undefined;
2068
- source?: ((store?: Store$1 | null) => Iterable<Record<string, any>>) | null | undefined;
2069
- filter?: ((item: Record<string, any>, store?: Store$1 | null) => boolean) | null | undefined;
2125
+ type Permission$1 = ({
2126
+ children: {
2127
+ value: string;
2128
+ label: string;
2129
+ }[];
2130
+ label: string;
2131
+ });
2132
+ /**
2133
+ *
2134
+ * @param {boolean} [force]
2135
+ */
2136
+ declare function load$2(force?: boolean): Promise<Permission$1[]>;
2137
+ declare function get(): Permission$1[];
2138
+ //#endregion
2139
+ //#region packages/web/services/application.d.mts
2140
+ declare const Application: {
2141
+ readonly id: string;
2142
+ readonly root: string;
2143
+ readonly path: string;
2144
+ readonly authRoot: string;
2145
+ readonly authPath: string;
2146
+ readonly logo: string;
2147
+ readonly title: string;
2148
+ readonly company: string;
2149
+ readonly help: string;
2150
+ refresh(): void;
2151
+ readonly menus: Menu.Define[];
2152
+ loadMenus(force?: boolean): Promise<Menu.Define[]>;
2153
+ readonly userMenus: Menu.Define[];
2154
+ loadUserMenus(force?: boolean): Promise<Menu.Define[]>;
2155
+ loadPage(page: string): Promise<(() => Promise<any>) | null>;
2156
+ loadContinuation(page: string): Promise<(() => Promise<any>) | null>;
2070
2157
  };
2071
2158
  //#endregion
2072
2159
  //#region packages/web/dom/Guide.d.mts
@@ -2249,18 +2336,9 @@ declare class PageSider extends GeneralContext {
2249
2336
  }
2250
2337
  //#endregion
2251
2338
  //#region packages/web/route/PageContext.d.mts
2252
- /** @import { Modal } from '../dom/index.mjs' */
2253
2339
  declare class PageContext extends GeneralContext {
2254
- /**
2255
- *
2256
- * @param {PageHandle} state
2257
- */
2340
+ #private;
2258
2341
  constructor(state: PageHandle);
2259
- /**
2260
- *
2261
- * @param {unknown} [err]
2262
- * @returns
2263
- */
2264
2342
  setError(err?: unknown): void;
2265
2343
  get bootLoading(): boolean;
2266
2344
  get define(): PageConfiguration | null;
@@ -2272,147 +2350,48 @@ declare class PageContext extends GeneralContext {
2272
2350
  get href(): string;
2273
2351
  get current(): boolean;
2274
2352
  get shown(): boolean;
2275
- /** @param {string | (() => string)} title */
2276
- set title(title: string | (() => string));
2277
- /** @returns {string} */
2278
2353
  get title(): string;
2279
- /** @param {string | (() => string)} icon */
2280
- set icon(icon: string | (() => string));
2281
- /** @returns {string} */
2354
+ set title(title: string | (() => string));
2282
2355
  get icon(): string;
2283
- set print(print: Print);
2356
+ set icon(icon: string | (() => string));
2284
2357
  get print(): Print;
2285
- /** @param {boolean | (() => boolean)} unsaved */
2286
- set unsaved(unsaved: boolean | (() => boolean));
2287
- /** @returns {boolean} */
2358
+ set print(print: Print);
2288
2359
  get unsaved(): boolean;
2289
- /** @param {boolean | (() => boolean)} guarded */
2290
- set guarded(guarded: boolean | (() => boolean));
2291
- /** @returns {boolean} */
2360
+ set unsaved(unsaved: boolean | (() => boolean));
2292
2361
  get guarded(): boolean;
2293
- set loading(loading: boolean);
2362
+ set guarded(guarded: boolean | (() => boolean));
2294
2363
  get loading(): boolean;
2364
+ set loading(loading: boolean);
2295
2365
  get container(): HTMLElement;
2296
- set panel(panel: boolean);
2297
2366
  get panel(): boolean;
2298
- set mode(mode: "scroll" | "flex");
2367
+ set panel(panel: boolean);
2299
2368
  get mode(): "scroll" | "flex";
2300
- /**
2301
- * @template T
2302
- * @overload
2303
- * @param {(modal: Modal) => PromiseLike<T> | T} exec
2304
- * @param {AbortSignal} [signal]
2305
- * @returns {Promise<T>}
2306
- */
2307
- createModal<T>(exec: (modal: Modal) => PromiseLike<T> | T, signal?: AbortSignal | undefined): Promise<T>;
2308
- /**
2309
- * @overload
2310
- * @param {AbortSignal} [signal]
2311
- * @returns {Modal}
2312
- */
2313
- createModal(signal?: AbortSignal | undefined): Modal;
2314
- /**
2315
- * @template T
2316
- * @template R
2317
- * @param {T[]} list
2318
- * @param {(item: T, signal: AbortSignal) => PromiseLike<R> | R} exec
2319
- * @param {object} [options]
2320
- * @param {AbortSignal} [options.signal]
2321
- * @param {boolean} [options.abortable]
2322
- * @param {string} [options.label]
2323
- * @param {string} [options.title]
2324
- */
2369
+ set mode(mode: "scroll" | "flex");
2370
+ whenCurrent<T>(fn: () => T): () => void | T;
2371
+ createModal<T>(exec: (modal: Modal) => PromiseLike<T> | T, signal?: AbortSignal): Promise<T>;
2372
+ createModal(signal?: AbortSignal): Modal;
2325
2373
  createProgressModal<T, R>(list: T[], exec: (item: T, signal: AbortSignal) => PromiseLike<R> | R, options?: {
2326
- signal?: AbortSignal | undefined;
2327
- abortable?: boolean | undefined;
2328
- label?: string | undefined;
2329
- title?: string | undefined;
2374
+ signal?: AbortSignal;
2375
+ abortable?: boolean;
2376
+ label?: string;
2377
+ title?: string;
2330
2378
  }): Promise<PromiseSettledResult<R>[]>;
2331
- /**
2332
- *
2333
- * @param {AbortSignal} [signal]
2334
- * @returns {PageHeader}
2335
- */
2336
2379
  createHeader(signal?: AbortSignal): PageHeader;
2337
- /**
2338
- *
2339
- * @param {AbortSignal} [signal]
2340
- * @returns {PageFooter}
2341
- */
2342
2380
  createFooter(signal?: AbortSignal): PageFooter;
2343
- /**
2344
- *
2345
- * @param {boolean} [inserted]
2346
- * @param {AbortSignal} [signal]
2347
- * @returns
2348
- */
2349
2381
  createSider(inserted?: boolean, signal?: AbortSignal): PageSider;
2350
- /**
2351
- *
2352
- * @param {'start' | 'end' | 'before' | 'after'} position
2353
- * @param {boolean} [inserted]
2354
- * @param {AbortSignal} [signal]
2355
- * @returns {PageSection}
2356
- */
2357
- createSection(position: "start" | "end" | "before" | "after", inserted?: boolean, signal?: AbortSignal): PageSection;
2358
- /**
2359
- *
2360
- * @param {{widget: string; options: string}[]} sides
2361
- * @param {PageSectionParam} param
2362
- */
2382
+ createSection(position: 'start' | 'end' | 'before' | 'after', inserted?: boolean, signal?: AbortSignal): PageSection;
2363
2383
  renderSides(sides: {
2364
2384
  widget: string;
2365
2385
  options: string;
2366
2386
  }[], param: PageSectionParam): void;
2367
- /**
2368
- * @param {string} url
2369
- * @param {string | PageIdent} [page]
2370
- * @returns {string}
2371
- */
2372
2387
  toUrl(url: string, page?: string | PageIdent): string;
2373
- /**
2374
- * @overload
2375
- * @param {string} url
2376
- * @param {boolean} [replace]
2377
- * @returns {void}
2378
- */
2379
- open(url: string, replace?: boolean | undefined): void;
2380
- /**
2381
- * @overload
2382
- * @param {string} url
2383
- * @param {string | PageIdent} [page]
2384
- * @param {boolean} [replace]
2385
- * @returns {void}
2386
- */
2387
- open(url: string, page?: string | PageIdent | undefined, replace?: boolean | undefined): void;
2388
- /**
2389
- * @overload
2390
- * @param {string} url
2391
- * @param {boolean | string | PageIdent} [page]
2392
- * @param {boolean} [replace]
2393
- * @returns {void}
2394
- */
2395
- open(url: string, page?: string | boolean | PageIdent | undefined, replace?: boolean | undefined): void;
2396
- /**
2397
- *
2398
- * @param {string} p
2399
- * @param {boolean} [replace]
2400
- * @returns {void}
2401
- */
2388
+ open(url: string, replace?: boolean): void;
2389
+ open(url: string, page?: string | PageIdent, replace?: boolean): void;
2390
+ open(url: string, page?: boolean | string | PageIdent, replace?: boolean): void;
2402
2391
  setPath(p: string, replace?: boolean): void;
2403
- /**
2404
- *
2405
- * @param {boolean} [replace]
2406
- * @returns {void}
2407
- */
2408
2392
  show(replace?: boolean): void;
2409
2393
  get destroyDeferred(): boolean;
2410
- /**
2411
- * @param {boolean} [defer]
2412
- * @returns {boolean}
2413
- */
2414
2394
  destroy(defer?: boolean): boolean;
2415
- #private;
2416
2395
  }
2417
2396
  //#endregion
2418
2397
  //#region packages/web/route/renderError.d.mts
@@ -2721,6 +2700,42 @@ declare function createVideoStream(signal?: AbortSignal): Promise<MediaStream>;
2721
2700
  declare function createVideoDialog(signal?: AbortSignal): {
2722
2701
  [Symbol.asyncIterator](): AsyncGenerator<ImageData, void, unknown>;
2723
2702
  };
2703
+ declare namespace csv_d_exports {
2704
+ export { MIME$2 as MIME, load$1 as load, parse$2 as parse, stringify$1 as stringify, toBlob$1 as toBlob, toTable, toText };
2705
+ }
2706
+ declare const MIME$2: {
2707
+ "text/csv": string[];
2708
+ };
2709
+ /**
2710
+ * 将二维数组或生成器流式序列化为 CSV 字符串
2711
+ * @param data 要序列化的数据(支持二维数组或返回数组的 Generator)
2712
+ * @param separator 分隔符,默认 ','
2713
+ */
2714
+ declare function stringify$1(data: Iterable<Iterable<string>>, separator?: string): Generator<string>;
2715
+ declare function parse$2(csvText: string, separator?: string): Generator<string[]>;
2716
+ /**
2717
+ * @param {Blob} file
2718
+ * @returns {Promise<string[][]>}
2719
+ */
2720
+ declare function load$1(file: Blob): Promise<string[][]>;
2721
+ declare function toTable(data: any[], columns: {
2722
+ name: string;
2723
+ label?: string | null;
2724
+ }[]): any[][];
2725
+ declare function toText(data: Iterable<any>[]): string;
2726
+ declare function toText(data: any[], columns?: {
2727
+ name: string;
2728
+ label?: string | null;
2729
+ }[] | null): string;
2730
+ declare function toBlob$1(data: any[], name?: string): File;
2731
+ declare function toBlob$1(data: any[], columns?: {
2732
+ name: string;
2733
+ label?: string | null;
2734
+ }[] | null, name?: string): File;
2735
+ declare function toBlob$1(data: any[], columns?: {
2736
+ name: string;
2737
+ label?: string | null;
2738
+ }[] | null, name?: string): File;
2724
2739
  //#endregion
2725
2740
  //#region packages/web/script/index.d.mts
2726
2741
  /**
@@ -2731,76 +2746,6 @@ declare function createVideoDialog(signal?: AbortSignal): {
2731
2746
  */
2732
2747
  declare function execScript(script: string | null, scope: Record<string, unknown>): unknown;
2733
2748
  //#endregion
2734
- //#region packages/web/services/enumeration.d.mts
2735
- /**
2736
- *
2737
- * @param {string} enumeration
2738
- * @returns
2739
- */
2740
- declare function enumerationsService(enumeration: string): {
2741
- then<TResult1 = Record<string, any>[], TResult2 = never>(onfulfilled?: ((value: Record<string, any>[]) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
2742
- catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<Record<string, any>[] | TResult2>;
2743
- finally(onfinally?: (() => void) | null | undefined): Promise<Record<string, any>[]>;
2744
- load: (force?: boolean) => Promise<Record<string, any>[]>;
2745
- get: () => Record<string, any>[];
2746
- };
2747
- //#endregion
2748
- //#region packages/web/services/formLayout.d.mts
2749
- /**
2750
- *
2751
- * @param {string} layout
2752
- * @returns
2753
- */
2754
- declare function formLayoutsService(layout: string): {
2755
- then<TResult1 = FormLayout | null, TResult2 = never>(onfulfilled?: ((value: FormLayout | null) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
2756
- catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<FormLayout | TResult2 | null>;
2757
- finally(onfinally?: (() => void) | null | undefined): Promise<FormLayout | null>;
2758
- load: (force?: boolean) => Promise<FormLayout | null>;
2759
- get: () => FormLayout | null;
2760
- };
2761
- //#endregion
2762
- //#region packages/web/services/permissions.d.mts
2763
- declare const _default: {
2764
- then<TResult1 = Permission$1[], TResult2 = never>(onfulfilled?: ((value: Permission$1[]) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
2765
- catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<Permission$1[] | TResult2>;
2766
- finally(onfinally?: (() => void) | null | undefined): Promise<Permission$1[]>;
2767
- load: typeof load$1;
2768
- get: typeof get;
2769
- };
2770
- type Permission$1 = ({
2771
- children: {
2772
- value: string;
2773
- label: string;
2774
- }[];
2775
- label: string;
2776
- });
2777
- /**
2778
- *
2779
- * @param {boolean} [force]
2780
- */
2781
- declare function load$1(force?: boolean): Promise<Permission$1[]>;
2782
- declare function get(): Permission$1[];
2783
- //#endregion
2784
- //#region packages/web/services/application.d.mts
2785
- declare const Application: {
2786
- readonly id: string;
2787
- readonly root: string;
2788
- readonly path: string;
2789
- readonly authRoot: string;
2790
- readonly authPath: string;
2791
- readonly logo: string;
2792
- readonly title: string;
2793
- readonly company: string;
2794
- readonly help: string;
2795
- refresh(): void;
2796
- readonly menus: Menu.Define[];
2797
- loadMenus(force?: boolean): Promise<Menu.Define[]>;
2798
- readonly userMenus: Menu.Define[];
2799
- loadUserMenus(force?: boolean): Promise<Menu.Define[]>;
2800
- loadPage(page: string): Promise<(() => Promise<any>) | null>;
2801
- loadContinuation(page: string): Promise<(() => Promise<any>) | null>;
2802
- };
2803
- //#endregion
2804
2749
  //#region packages/web/import.d.mts
2805
2750
  /**
2806
2751
  * @template T
@@ -2879,7 +2824,7 @@ declare function showDocumentInModal(modal: Modal, model: ModelScriptConfigurati
2879
2824
  href?: string | undefined;
2880
2825
  editable?: boolean | undefined;
2881
2826
  destroyable?: boolean | undefined;
2882
- }): Promise<void>;
2827
+ }): Promise<void | object>;
2883
2828
  //#endregion
2884
2829
  //#region packages/web/model/index.d.mts
2885
2830
  /**
@@ -3012,13 +2957,13 @@ declare function testPermission({
3012
2957
  declare function getAuthorizations(permissionList: Permission[], data?: Record<string, any> | null, isNew?: boolean): Set<string>;
3013
2958
  /**
3014
2959
  *
3015
- * @param {string} authorization
2960
+ * @param {string | string[]} authorization
3016
2961
  * @param {Permission[]} permissions
3017
2962
  * @param {Record<string, any>} [data]
3018
2963
  * @param {boolean} [isNew]
3019
2964
  * @param {string} [fieldName]
3020
2965
  */
3021
- declare function testPermissions(authorization: string, permissions: Permission[], data?: Record<string, any>, isNew?: boolean, fieldName?: string): boolean;
2966
+ declare function testPermissions(authorization: string | string[], permissions: Permission[], data?: Record<string, any>, isNew?: boolean, fieldName?: string): boolean;
3022
2967
  /**
3023
2968
  *
3024
2969
  * @param {string} authorization
@@ -3434,4 +3379,4 @@ declare const allHooks: Hook<Hooks>;
3434
3379
  declare function updateHooks(hooks: Record<string, Hook.Define<Hooks>>): void;
3435
3380
  declare function loadNavButtons(): AsyncIterableIterator<NavButton>;
3436
3381
  //#endregion
3437
- export { Application, ArrayStore, Authenticator, BindObjectStore, code128_d_exports as Code128, Command, Component, Components, ConfiguratorComponent, ConfiguratorContext, type ContinuationDefine, CurrentPage, DataBus, type DataSource, DotRequest, EnvState, ErrorAlerter, FieldComponent, FieldComponentEvent, FieldComponents, FieldContext, FieldDefine, FieldFilter, FieldFilterComponent, FieldFilterContext, FieldFilterFns, FieldFilterOptions, FieldFilterStyle, type FieldScript, type FieldScriptConfiguration, FieldShowHandle, FieldStyle, FilterFns, FormFieldHook, FromRenderer, GeneralContext, GlobalPage, GlobalState, Guide, type HomeContext, Hooks, IconDefine, Ident_d_exports as Ident, List, type Match, Media_d_exports as Media, Menu, Modal, ModalFooter, ModalHeader, type ModelConfiguration, ModelIndicator, type ModelScript, type ModelScriptConfiguration, NavButton, ObjectStore, Page, type PageConfiguration, type PageContext, type PageError, PageFooter, PageFrame, type PageHandle, PageHeader, PageIdent, type PageManager, type PageRenderer, PageSection, PageSectionParam, PageSider, Pagination$1 as Pagination, type Print, Qrcode_d_exports as Qrcode, ResponseError, type Schema, Sheet_d_exports as Sheet, Signal$1 as Signal, State, Store, type StoreLayout, SubmodelsLayoutEvent, Theme, URIConverter, User, UserHook, VerifyContext, VerifyError, type WorkspaceDefine, zip_d_exports as ZIP, addManager, allHooks, boot, buildDataSource, buildPlugin, createComputed, createDeeply, createDocumentInModal, createFilters, createFrame, createIcon, createModal, createModelDefault, createNeverAbortedSignal, 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, image2data, importScript, importStyle, importWidget, isMac, isPluginId, loadNavButtons, modelService, pathRoots, _default as permissionsService, plugins, _default$1 as renderForm, renderStore, _default$2 as renderStoreForm, request, require$1 as require, root$1 as root, selectFile, setEnvState, setIcon, showDocumentInModal, _default$3 as showFilterDialog, showSortDialog, start, testPermission, testPermissionConstraints, testPermissions, toFileLink, toFileURL, toId, toPermissionFilter, toSchema, toUrl, updateHooks, waitAbortSignal, watch };
3382
+ export { Application, ArrayStore, Authenticator, BindObjectStore, csv_d_exports as CSV, code128_d_exports as Code128, Command, Component, Components, ConfiguratorComponent, ConfiguratorContext, type ContinuationDefine, CurrentPage, DataBus, type DataSource, DocumentScriptParameter, DotRequest, EnvState, ErrorAlerter, FieldComponent, FieldComponentEvent, FieldComponents, FieldContext, FieldDefine, FieldFilter, FieldFilterComponent, FieldFilterContext, FieldFilterFns, FieldFilterOptions, FieldFilterStyle, type FieldScript, type FieldScriptConfiguration, FieldShowHandle, FieldStyle, FilterFns, FormFieldHook, FromRenderer, GeneralContext, GlobalEvent_d_exports as GlobalEvent, GlobalPage, GlobalState, Guide, type HomeContext, Hooks, IconDefine, Ident_d_exports as Ident, List, ListScriptParameter, type Match, Media_d_exports as Media, Menu, Modal, ModalFooter, ModalHeader, ModelCommand, type ModelConfiguration, ModelIndicator, type ModelScript, type ModelScriptConfiguration, NavButton, ObjectStore, Page, type PageConfiguration, type PageContext, type PageError, PageFooter, PageFrame, type PageHandle, PageHeader, PageIdent, type PageManager, PageParam, type PageRenderer, PageSection, PageSectionParam, PageSider, Pagination$1 as Pagination, type Print, Qrcode_d_exports as Qrcode, ResponseError, type Schema, SharedEvent_d_exports as SharedEvent, Sheet_d_exports as Sheet, Signal$1 as Signal, State, Store, type StoreLayout, SubmodelsLayoutEvent, Theme, URIConverter, User, UserHook, VerifyContext, VerifyError, type WorkspaceDefine, zip_d_exports as ZIP, addManager, allHooks, bindStatePlaceholder, boot, buildDataSource, buildPlugin, createComputed, createDeeply, createDocumentInModal, createFilters, createFrame, createIcon, createModal, createModelDefault, createNeverAbortedSignal, 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, image2data, importScript, importStyle, importWidget, isMac, isPluginId, loadNavButtons, modelService, pageService, pathRoots, _default as permissionsService, plugins, _default$1 as renderForm, renderStore, _default$2 as renderStoreForm, request, require$1 as require, root$1 as root, selectFile, setEnvState, setIcon, showDocumentInModal, _default$3 as showFilterDialog, showSortDialog, start, stateSnapshot, testPermission, testPermissionConstraints, testPermissions, toFileLink, toFileURL, toId, toPermissionFilter, toSchema, toUrl, updateHooks, waitAbortSignal, watch };