@yongdall/web 0.5.6 → 0.6.0

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/boot.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import{application as e,findPluginIdRegex as t,importStyle as n,importWidget as r,start as i}from"@yongdall/web";async function a(){let{theme:a,route:o,authenticator:s,skin:c,type:l}=e;c&&await n(c).catch(()=>null);async function u(){if(!s||typeof s!=`string`)return{};let e=await r(s);if(typeof e==`function`&&(e=await e()),!e)return{};let n=t.exec(s)?.groups?.pluginId;return!n||!e.styleFiles?.length?{...e,styleFiles:[]}:{...e,styleFiles:[...e.styleFiles||[]].map(e=>[e,n])}}if(l===`authenticator`||!a||typeof a!=`string`){i(u);return}async function d(){if(!a||typeof a!=`string`)return{};let e=await r(a);if(typeof e==`function`&&(e=await e()),!e)return{};let n=t.exec(a)?.groups?.pluginId;return!n||!e.styleFiles?.length?{...e,styleFiles:[]}:{...e,styleFiles:[...e.styleFiles||[]].map(e=>[e,n])}}async function f(){return o?r(o):null}i(u,d,f)}a();
1
+ import{boot as e,findPluginIdRegex as t,importStyle as n,importWidget as r,start as i}from"@yongdall/web";async function a(){let{theme:a,route:o,authenticator:s,skin:c,type:l}=e;c&&await n(c).catch(()=>null);async function u(){if(!s||typeof s!=`string`)return{};let e=await r(s);if(typeof e==`function`&&(e=await e()),!e)return{};let n=t.exec(s)?.groups?.pluginId;return!n||!e.styleFiles?.length?{...e,styleFiles:[]}:{...e,styleFiles:[...e.styleFiles||[]].map(e=>[e,n])}}async function d(){if(!a||typeof a!=`string`)return{};let e=await r(a);if(typeof e==`function`&&(e=await e()),!e)return{};let n=t.exec(a)?.groups?.pluginId;return!n||!e.styleFiles?.length?{...e,styleFiles:[]}:{...e,styleFiles:[...e.styleFiles||[]].map(e=>[e,n])}}async function f(){return o?r(o):null}i(u,d,f)}a();
2
2
  //# sourceMappingURL=boot.mjs.map
package/boot.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"boot.mjs","names":[],"sources":["../../packages/web/boot.mjs"],"sourcesContent":["/** @import { Authenticator, Theme } from './typesDefine.mjs' */\nimport { application, start } from '@yongdall/web';\nimport { importWidget, importStyle } from '@yongdall/web';\nimport { findPluginIdRegex } from '@yongdall/web';\n\n/** @typedef {[file: string, plugin: string]} uiStyle */\n\n\n\n\n\nasync function init() {\n\n\n\tconst { theme, route, authenticator, skin, type } = application;\n\tif (skin) { await importStyle(skin).catch(() => null); }\n\n\t/** @returns {Promise<Partial<Omit<Authenticator, 'styleFiles'> & Record<'styleFiles', uiStyle[]>>>} */\n\tasync function _loadAuthenticator() {\n\t\tif (!authenticator || typeof authenticator !== 'string') { return {}; }\n\t\t/** @type {Partial<Authenticator> | (() => Partial<Authenticator> | PromiseLike<Partial<Authenticator>>) | undefined} */\n\t\tlet authenticatorWidget = await importWidget(authenticator);\n\t\tif (typeof authenticatorWidget === 'function') { authenticatorWidget = await authenticatorWidget(); }\n\t\tif (!authenticatorWidget) { return {}; }\n\t\tconst pluginId = findPluginIdRegex.exec(authenticator)?.groups?.pluginId;\n\t\tif (!pluginId || !authenticatorWidget.styleFiles?.length) { return { ...authenticatorWidget, styleFiles: [] }; }\n\t\treturn { ...authenticatorWidget, styleFiles: [...authenticatorWidget.styleFiles || []].map(s => [s, pluginId]) };\n\t}\n\tif (type === 'authenticator' || !theme || typeof theme !== 'string') {\n\t\tstart(_loadAuthenticator);\n\t\treturn;\n\t}\n\t/** @returns {Promise<Partial<Omit<Theme, 'styleFiles'> & Record<'styleFiles', uiStyle[]>>>} */\n\tasync function _loadTheme() {\n\t\tif (!theme || typeof theme !== 'string') { return {}; }\n\t\t/** @type {Partial<Theme> | (() => Partial<Theme> | PromiseLike<Partial<Theme>>) | undefined} */\n\t\tlet uis = await importWidget(theme);\n\t\tif (typeof uis === 'function') { uis = await uis(); }\n\t\tif (!uis) { return {}; }\n\t\tconst pluginId = findPluginIdRegex.exec(theme)?.groups?.pluginId;\n\t\tif (!pluginId || !uis.styleFiles?.length) { return { ...uis, styleFiles: [] }; }\n\t\treturn { ...uis, styleFiles: [...uis.styleFiles || []].map(s => [s, pluginId]) };\n\t}\n\n\tasync function _loadRoute() {\n\t\tif (!route) { return null; }\n\t\treturn importWidget(route);\n\t}\n\tstart(_loadAuthenticator, _loadTheme, _loadRoute);\n\n}\ninit();\n"],"mappings":"iHAWA,eAAe,GAAO,CAGrB,GAAM,CAAE,QAAO,QAAO,gBAAe,OAAM,QAAS,EAChD,GAAQ,MAAM,EAAY,EAAK,CAAC,UAAY,KAAK,CAGrD,eAAe,GAAqB,CACnC,GAAI,CAAC,GAAiB,OAAO,GAAkB,SAAY,MAAO,EAAE,CAEpE,IAAI,EAAsB,MAAM,EAAa,EAAc,CAE3D,GADI,OAAO,GAAwB,aAAc,EAAsB,MAAM,GAAqB,EAC9F,CAAC,EAAuB,MAAO,EAAE,CACrC,IAAM,EAAW,EAAkB,KAAK,EAAc,EAAE,QAAQ,SAEhE,MADI,CAAC,GAAY,CAAC,EAAoB,YAAY,OAAiB,CAAE,GAAG,EAAqB,WAAY,EAAE,CAAE,CACtG,CAAE,GAAG,EAAqB,WAAY,CAAC,GAAG,EAAoB,YAAc,EAAE,CAAC,CAAC,IAAI,GAAK,CAAC,EAAG,EAAS,CAAC,CAAE,CAEjH,GAAI,IAAS,iBAAmB,CAAC,GAAS,OAAO,GAAU,SAAU,CACpE,EAAM,EAAmB,CACzB,OAGD,eAAe,GAAa,CAC3B,GAAI,CAAC,GAAS,OAAO,GAAU,SAAY,MAAO,EAAE,CAEpD,IAAI,EAAM,MAAM,EAAa,EAAM,CAEnC,GADI,OAAO,GAAQ,aAAc,EAAM,MAAM,GAAK,EAC9C,CAAC,EAAO,MAAO,EAAE,CACrB,IAAM,EAAW,EAAkB,KAAK,EAAM,EAAE,QAAQ,SAExD,MADI,CAAC,GAAY,CAAC,EAAI,YAAY,OAAiB,CAAE,GAAG,EAAK,WAAY,EAAE,CAAE,CACtE,CAAE,GAAG,EAAK,WAAY,CAAC,GAAG,EAAI,YAAc,EAAE,CAAC,CAAC,IAAI,GAAK,CAAC,EAAG,EAAS,CAAC,CAAE,CAGjF,eAAe,GAAa,CAE3B,OADK,EACE,EAAa,EAAM,CADL,KAGtB,EAAM,EAAoB,EAAY,EAAW,CAGlD,GAAM"}
1
+ {"version":3,"file":"boot.mjs","names":[],"sources":["../../packages/web/boot.mjs"],"sourcesContent":["/** @import { Authenticator, Theme } from './typesDefine.mjs' */\nimport { boot, start } from '@yongdall/web';\nimport { importWidget, importStyle } from '@yongdall/web';\nimport { findPluginIdRegex } from '@yongdall/web';\n\n/** @typedef {[file: string, plugin: string]} uiStyle */\n\n\n\n\n\nasync function init() {\n\n\n\tconst { theme, route, authenticator, skin, type } = boot;\n\tif (skin) { await importStyle(skin).catch(() => null); }\n\n\t/** @returns {Promise<Partial<Omit<Authenticator, 'styleFiles'> & Record<'styleFiles', uiStyle[]>>>} */\n\tasync function _loadAuthenticator() {\n\t\tif (!authenticator || typeof authenticator !== 'string') { return {}; }\n\t\t/** @type {Partial<Authenticator> | (() => Partial<Authenticator> | PromiseLike<Partial<Authenticator>>) | undefined} */\n\t\tlet authenticatorWidget = await importWidget(authenticator);\n\t\tif (typeof authenticatorWidget === 'function') { authenticatorWidget = await authenticatorWidget(); }\n\t\tif (!authenticatorWidget) { return {}; }\n\t\tconst pluginId = findPluginIdRegex.exec(authenticator)?.groups?.pluginId;\n\t\tif (!pluginId || !authenticatorWidget.styleFiles?.length) { return { ...authenticatorWidget, styleFiles: [] }; }\n\t\treturn { ...authenticatorWidget, styleFiles: [...authenticatorWidget.styleFiles || []].map(s => [s, pluginId]) };\n\t}\n\t/** @returns {Promise<Partial<Omit<Theme, 'styleFiles'> & Record<'styleFiles', uiStyle[]>>>} */\n\tasync function _loadTheme() {\n\t\tif (!theme || typeof theme !== 'string') { return {}; }\n\t\t/** @type {Partial<Theme> | (() => Partial<Theme> | PromiseLike<Partial<Theme>>) | undefined} */\n\t\tlet uis = await importWidget(theme);\n\t\tif (typeof uis === 'function') { uis = await uis(); }\n\t\tif (!uis) { return {}; }\n\t\tconst pluginId = findPluginIdRegex.exec(theme)?.groups?.pluginId;\n\t\tif (!pluginId || !uis.styleFiles?.length) { return { ...uis, styleFiles: [] }; }\n\t\treturn { ...uis, styleFiles: [...uis.styleFiles || []].map(s => [s, pluginId]) };\n\t}\n\n\tasync function _loadRoute() {\n\t\tif (!route) { return null; }\n\t\treturn importWidget(route);\n\t}\n\tstart(_loadAuthenticator, _loadTheme, _loadRoute);\n\n}\ninit();\n"],"mappings":"0GAWA,eAAe,GAAO,CAGrB,GAAM,CAAE,QAAO,QAAO,gBAAe,OAAM,QAAS,EAChD,GAAQ,MAAM,EAAY,EAAK,CAAC,UAAY,KAAK,CAGrD,eAAe,GAAqB,CACnC,GAAI,CAAC,GAAiB,OAAO,GAAkB,SAAY,MAAO,EAAE,CAEpE,IAAI,EAAsB,MAAM,EAAa,EAAc,CAE3D,GADI,OAAO,GAAwB,aAAc,EAAsB,MAAM,GAAqB,EAC9F,CAAC,EAAuB,MAAO,EAAE,CACrC,IAAM,EAAW,EAAkB,KAAK,EAAc,EAAE,QAAQ,SAEhE,MADI,CAAC,GAAY,CAAC,EAAoB,YAAY,OAAiB,CAAE,GAAG,EAAqB,WAAY,EAAE,CAAE,CACtG,CAAE,GAAG,EAAqB,WAAY,CAAC,GAAG,EAAoB,YAAc,EAAE,CAAC,CAAC,IAAI,GAAK,CAAC,EAAG,EAAS,CAAC,CAAE,CAGjH,eAAe,GAAa,CAC3B,GAAI,CAAC,GAAS,OAAO,GAAU,SAAY,MAAO,EAAE,CAEpD,IAAI,EAAM,MAAM,EAAa,EAAM,CAEnC,GADI,OAAO,GAAQ,aAAc,EAAM,MAAM,GAAK,EAC9C,CAAC,EAAO,MAAO,EAAE,CACrB,IAAM,EAAW,EAAkB,KAAK,EAAM,EAAE,QAAQ,SAExD,MADI,CAAC,GAAY,CAAC,EAAI,YAAY,OAAiB,CAAE,GAAG,EAAK,WAAY,EAAE,CAAE,CACtE,CAAE,GAAG,EAAK,WAAY,CAAC,GAAG,EAAI,YAAc,EAAE,CAAC,CAAC,IAAI,GAAK,CAAC,EAAG,EAAS,CAAC,CAAE,CAGjF,eAAe,GAAa,CAE3B,OADK,EACE,EAAa,EAAM,CADL,KAGtB,EAAM,EAAoB,EAAY,EAAW,CAGlD,GAAM"}
package/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import * as dot_request1 from "dot-request";
1
+ import * as dot_request0 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
4
  import { Hook, Indicator, Plugin, Search } from "@yongdall/common";
@@ -226,7 +226,7 @@ declare namespace Print {
226
226
  /**
227
227
  * 页面方向
228
228
  */
229
- orientation?: "portrait" | "landscape" | "auto" | undefined;
229
+ orientation?: "auto" | "portrait" | "landscape" | undefined;
230
230
  /**
231
231
  * 页边距
232
232
  */
@@ -312,32 +312,6 @@ declare const root$1: HTMLDivElement;
312
312
  */
313
313
  declare function setIcon(icon: string | null): void;
314
314
  //#endregion
315
- //#region packages/web/dom/createDialog.d.mts
316
- /**
317
- * @template T
318
- * @overload
319
- * @param {(dialog: HTMLDialogElement, signal: AbortSignal) => PromiseLike<T> | T} exec
320
- * @param {object} [options]
321
- * @param {AbortSignal} [options.signal]
322
- * @param {HTMLElement} [options.parent]
323
- * @returns {Promise<T>}
324
- */
325
- declare function createDialog<T>(exec: (dialog: HTMLDialogElement, signal: AbortSignal) => PromiseLike<T> | T, options?: {
326
- signal?: AbortSignal | undefined;
327
- parent?: HTMLElement | undefined;
328
- } | undefined): Promise<T>;
329
- /**
330
- * @overload
331
- * @param {object} [options]
332
- * @param {AbortSignal} [options.signal]
333
- * @param {HTMLElement} [options.parent]
334
- * @returns {HTMLDialogElement}
335
- */
336
- declare function createDialog(options?: {
337
- signal?: AbortSignal | undefined;
338
- parent?: HTMLElement | undefined;
339
- } | undefined): HTMLDialogElement;
340
- //#endregion
341
315
  //#region packages/web/Menu.d.mts
342
316
  /**
343
317
  * 菜单显示
@@ -408,11 +382,11 @@ type Menu = {
408
382
  /**
409
383
  * 点击事件
410
384
  */
411
- click?: (() => void) | undefined;
385
+ click?: (() => boolean | void) | undefined;
412
386
  /**
413
387
  * 点击事件
414
388
  */
415
- disabled?: boolean | (() => boolean) | undefined;
389
+ disabled?: boolean | undefined;
416
390
  /**
417
391
  * 三方扩展
418
392
  */
@@ -509,7 +483,7 @@ declare namespace Menu {
509
483
  *
510
484
  * 三方扩展
511
485
  */
512
- disabled?: boolean | (() => boolean) | undefined;
486
+ disabled?: boolean | undefined;
513
487
  /**
514
488
  * 自动登录
515
489
  */
@@ -595,7 +569,7 @@ declare namespace Menu {
595
569
  /**
596
570
  * 点击事件
597
571
  */
598
- disabled?: boolean | (() => boolean) | undefined;
572
+ disabled?: boolean | undefined;
599
573
  /**
600
574
  * 三方扩展:自动登录
601
575
  */
@@ -613,7 +587,40 @@ declare namespace Menu {
613
587
  */
614
588
  collapsed?: boolean | undefined;
615
589
  };
616
- type Renderer = (menu: Menu, signal: AbortSignal, isButton?: boolean) => HTMLElement | null;
590
+ type Renderer = (menu: Menu, options: Menu.Renderer.Options) => HTMLElement | null;
591
+ namespace Renderer {
592
+ type Command = {
593
+ page?: string | null | undefined;
594
+ path?: string | null | undefined;
595
+ uri?: string | null | undefined;
596
+ disabled?: boolean | null | undefined;
597
+ click?: (() => boolean | void) | null | undefined;
598
+ };
599
+ type Options = {
600
+ signal: AbortSignal;
601
+ button: boolean;
602
+ disabled: (menu: Menu) => boolean;
603
+ click: (menu: Menu) => boolean | void;
604
+ uri: (menu: Menu) => string | null;
605
+ commands: Record<string, Menu.Renderer.Command>;
606
+ };
607
+ }
608
+ type RendererOptions = {
609
+ signal: AbortSignal;
610
+ create: (menu: Menu, options?: Partial<Menu.Renderer.Options>) => HTMLElement | null;
611
+ disabled: (menu: Menu) => boolean;
612
+ click: (menu: Menu) => boolean | void;
613
+ uri: (menu: Menu) => string | null;
614
+ commands: Record<string, Menu.Renderer.Command>;
615
+ };
616
+ type Options = {
617
+ signal: AbortSignal;
618
+ create: (menu: Menu, options: Menu.Renderer.Options) => HTMLElement | null;
619
+ disabled: (menu: Menu) => boolean;
620
+ click: (menu: Menu) => boolean | void;
621
+ uri: (menu: Menu) => string | null;
622
+ commands: Record<string, Menu.Renderer.Command>;
623
+ };
617
624
  }
618
625
  //#endregion
619
626
  //#region packages/web/dom/ModalHeader.d.mts
@@ -630,10 +637,10 @@ declare class ModalHeader extends GeneralContext {
630
637
  /**
631
638
  *
632
639
  * @param {*} menus
633
- * @param {Menu.Renderer} [create]
640
+ * @param {{[k in keyof Menu.Options]?: Menu.Options[k] | null}?} [options]
634
641
  * @returns
635
642
  */
636
- setMenu(menus: any, create?: Menu.Renderer): void;
643
+ setMenu(menus: any, options?: { [k in keyof Menu.Options]?: Menu.Options[k] | null } | null): void;
637
644
  #private;
638
645
  }
639
646
  //#endregion
@@ -759,6 +766,7 @@ type PageConfiguration = {
759
766
  workspace?: string | undefined;
760
767
  page?: string | undefined;
761
768
  url?: string | undefined;
769
+ hiddenFilter?: string | undefined;
762
770
  widget?: string | null | undefined;
763
771
  title?: string | undefined;
764
772
  titlePattern?: string | undefined;
@@ -1055,20 +1063,6 @@ declare class PageHeader extends GeneralContext {
1055
1063
  * @returns
1056
1064
  */
1057
1065
  constructor(root: HTMLElement, signal?: AbortSignal);
1058
- /**
1059
- * @template T
1060
- * @overload
1061
- * @param {(dialog: HTMLDialogElement, signal: AbortSignal) => PromiseLike<T> | T} exec
1062
- * @param {AbortSignal} [signal]
1063
- * @returns {Promise<T>}
1064
- */
1065
- createDialog<T>(exec: (dialog: HTMLDialogElement, signal: AbortSignal) => PromiseLike<T> | T, signal?: AbortSignal | undefined): Promise<T>;
1066
- /**
1067
- * @overload
1068
- * @param {AbortSignal} [signal]
1069
- * @returns {HTMLDialogElement}
1070
- */
1071
- createDialog(signal?: AbortSignal | undefined): HTMLDialogElement;
1072
1066
  /**
1073
1067
  * @template T
1074
1068
  * @overload
@@ -1108,10 +1102,10 @@ declare class PageHeader extends GeneralContext {
1108
1102
  /**
1109
1103
  *
1110
1104
  * @param {*} menus
1111
- * @param {Menu.Renderer} [create]
1105
+ * @param {{[k in keyof Menu.Options]?: Menu.Options[k] | null}?} [options]
1112
1106
  * @returns
1113
1107
  */
1114
- setMenu(menus: any, create?: Menu.Renderer): void;
1108
+ setMenu(menus: any, options?: { [k in keyof Menu.Options]?: Menu.Options[k] | null } | null): void;
1115
1109
  set unprintable(unprintable: boolean);
1116
1110
  get unprintable(): boolean;
1117
1111
  #private;
@@ -1126,20 +1120,6 @@ declare class PageFooter extends GeneralContext {
1126
1120
  * @returns
1127
1121
  */
1128
1122
  constructor(root: HTMLElement, signal?: AbortSignal);
1129
- /**
1130
- * @template T
1131
- * @overload
1132
- * @param {(dialog: HTMLDialogElement, signal: AbortSignal) => PromiseLike<T> | T} exec
1133
- * @param {AbortSignal} [signal]
1134
- * @returns {Promise<T>}
1135
- */
1136
- createDialog<T>(exec: (dialog: HTMLDialogElement, signal: AbortSignal) => PromiseLike<T> | T, signal?: AbortSignal | undefined): Promise<T>;
1137
- /**
1138
- * @overload
1139
- * @param {AbortSignal} [signal]
1140
- * @returns {HTMLDialogElement}
1141
- */
1142
- createDialog(signal?: AbortSignal | undefined): HTMLDialogElement;
1143
1123
  /**
1144
1124
  * @template T
1145
1125
  * @overload
@@ -1192,20 +1172,6 @@ declare class PageSection extends GeneralContext {
1192
1172
  * @returns
1193
1173
  */
1194
1174
  constructor(parent: ParentNode, next: Node | null, inserted: boolean, signal: AbortSignal);
1195
- /**
1196
- * @template T
1197
- * @overload
1198
- * @param {(dialog: HTMLDialogElement, signal: AbortSignal) => PromiseLike<T> | T} exec
1199
- * @param {AbortSignal} [signal]
1200
- * @returns {Promise<T>}
1201
- */
1202
- createDialog<T>(exec: (dialog: HTMLDialogElement, signal: AbortSignal) => PromiseLike<T> | T, signal?: AbortSignal | undefined): Promise<T>;
1203
- /**
1204
- * @overload
1205
- * @param {AbortSignal} [signal]
1206
- * @returns {HTMLDialogElement}
1207
- */
1208
- createDialog(signal?: AbortSignal | undefined): HTMLDialogElement;
1209
1175
  /**
1210
1176
  * @template T
1211
1177
  * @overload
@@ -1255,20 +1221,6 @@ declare class Page {
1255
1221
  * @param {boolean} show
1256
1222
  */
1257
1223
  constructor(show: boolean);
1258
- /**
1259
- * @template T
1260
- * @overload
1261
- * @param {(dialog: HTMLDialogElement, signal: AbortSignal) => PromiseLike<T> | T} exec
1262
- * @param {AbortSignal} [signal]
1263
- * @returns {Promise<T>}
1264
- */
1265
- createDialog<T>(exec: (dialog: HTMLDialogElement, signal: AbortSignal) => PromiseLike<T> | T, signal?: AbortSignal | undefined): Promise<T>;
1266
- /**
1267
- * @overload
1268
- * @param {AbortSignal} [signal]
1269
- * @returns {HTMLDialogElement}
1270
- */
1271
- createDialog(signal?: AbortSignal | undefined): HTMLDialogElement;
1272
1224
  /**
1273
1225
  * @template T
1274
1226
  * @overload
@@ -1370,12 +1322,14 @@ type User = {
1370
1322
  plugins?: Record<string, Record<string, any>> | undefined;
1371
1323
  };
1372
1324
  declare namespace User {
1373
- const visitor: boolean;
1325
+ const isVisitor: boolean;
1326
+ const visitor: User | null;
1374
1327
  const multi: boolean;
1375
1328
  const single: boolean;
1376
1329
  const session: User | null;
1377
1330
  const target: User | null;
1378
1331
  const current: User | null;
1332
+ const operator: User | null;
1379
1333
  /** @param {string} permission */
1380
1334
  function hasPermission(permission: string): boolean;
1381
1335
  /** @param {string} permission @param {string} [organization] */
@@ -1775,7 +1729,11 @@ interface UserHook {
1775
1729
  type IconDefine = string | [path: string, viewBox?: string] | ((ctx: {
1776
1730
  root: SVGSVGElement;
1777
1731
  }, signal?: AbortSignal) => MaybePromise<void>);
1732
+ interface URIConverter {
1733
+ (uri: string): MaybePromise<string | null>;
1734
+ }
1778
1735
  interface Hooks {
1736
+ uriConverters: Record<string, URIConverter>;
1779
1737
  /** 自动加载的样式文件 */
1780
1738
  styles: string;
1781
1739
  /** 添加到 <body> 中的元素 */
@@ -1791,8 +1749,6 @@ interface Hooks {
1791
1749
  /** 用户构造 */
1792
1750
  user: UserHook;
1793
1751
  commands: Record<string, Command>;
1794
- /** @deprecated */
1795
- configurationPages: Record<string, PageRenderer | string>;
1796
1752
  /** 图标库 */
1797
1753
  icons: Record<string, IconDefine>;
1798
1754
  enumerations: Record<string, Record<string, any> | Record<string, any>[] | (() => Record<string, any>[])>;
@@ -1809,7 +1765,35 @@ interface Authenticator {
1809
1765
  elements: Element | Element[];
1810
1766
  /** 添加到根节点上的类名 */
1811
1767
  rootClassName: string;
1812
- login(signal: AbortSignal, onlyAuthenticator: boolean): PromiseLike<void> | void;
1768
+ login(signal: AbortSignal): PromiseLike<void> | void;
1769
+ }
1770
+ declare namespace Component {
1771
+ interface Pagination {
1772
+ readonly root: HTMLElement;
1773
+ size: number;
1774
+ page: number;
1775
+ total: number;
1776
+ listen(listen: (p: Pagination) => void): () => void;
1777
+ destroy(): void;
1778
+ }
1779
+ interface List {
1780
+ readonly root: HTMLElement;
1781
+ createUrl: ((id: string) => string) | null;
1782
+ setData(list: any[]): void;
1783
+ destroy(): void;
1784
+ }
1785
+ }
1786
+ interface Components {
1787
+ List: new (createUrl: (id: string) => string, model: ModelScriptConfiguration) => Component.List;
1788
+ list: new (createUrl: (id: string) => string, model: ModelScriptConfiguration) => Component.List;
1789
+ Pagination: new () => Component.Pagination;
1790
+ pagination: new () => Component.Pagination;
1791
+ createMenuButtons: (menus: (Menu | null)[], options: Menu.RendererOptions) => Element | null;
1792
+ menuButtons: (menus: (Menu | null)[], options: Menu.RendererOptions) => Element | null;
1793
+ createMenuButton: (menus: (Menu | null)[], button: any, options: Menu.RendererOptions) => Element | null;
1794
+ menuButton: (menus: (Menu | null)[], button: any, options: Menu.RendererOptions) => Element | null;
1795
+ createMenuItem: Menu.Renderer;
1796
+ menuItem: Menu.Renderer;
1813
1797
  }
1814
1798
  interface Theme {
1815
1799
  title(page: CurrentPage): string;
@@ -1832,7 +1816,7 @@ interface Theme {
1832
1816
  createPage(show: boolean): Page;
1833
1817
  createFrame(ctx: PageFrame.Context): PageFrame;
1834
1818
  renderError(ctx: PageContext, error: unknown): void;
1835
- components: Record<string, any>;
1819
+ components: Partial<Components>;
1836
1820
  setup(signal: AbortSignal): void;
1837
1821
  }
1838
1822
  interface ModelIndicator {
@@ -1984,6 +1968,7 @@ type ModelConfiguration = {
1984
1968
  pages?: Record<string, string | object | null> | null | undefined;
1985
1969
  };
1986
1970
  type FieldScriptConfiguration = Omit<Field, "scripts" | "type"> & {
1971
+ component?: FieldComponent;
1987
1972
  script?: Omit<FieldScript, "subFields">;
1988
1973
  type: string | Record<string, FieldScriptConfiguration>;
1989
1974
  };
@@ -2173,20 +2158,6 @@ declare class PageSider extends GeneralContext {
2173
2158
  * @returns
2174
2159
  */
2175
2160
  constructor(parent: ParentNode, next: Node | null, inserted: boolean, signal: AbortSignal);
2176
- /**
2177
- * @template T
2178
- * @overload
2179
- * @param {(dialog: HTMLDialogElement, signal: AbortSignal) => PromiseLike<T> | T} exec
2180
- * @param {AbortSignal} [signal]
2181
- * @returns {Promise<T>}
2182
- */
2183
- createDialog<T>(exec: (dialog: HTMLDialogElement, signal: AbortSignal) => PromiseLike<T> | T, signal?: AbortSignal | undefined): Promise<T>;
2184
- /**
2185
- * @overload
2186
- * @param {AbortSignal} [signal]
2187
- * @returns {HTMLDialogElement}
2188
- */
2189
- createDialog(signal?: AbortSignal | undefined): HTMLDialogElement;
2190
2161
  /**
2191
2162
  * @template T
2192
2163
  * @overload
@@ -2229,10 +2200,10 @@ declare class PageSider extends GeneralContext {
2229
2200
  *
2230
2201
  * @param {(Menu | null)[]} menus
2231
2202
  * @param {Menu?} button
2232
- * @param {Menu.Renderer} [create]
2203
+ * @param {{[k in keyof Menu.Options]?: Menu.Options[k] | null}?} [options]
2233
2204
  * @returns
2234
2205
  */
2235
- setMenu(menus: (Menu | null)[], button: Menu | null, create?: Menu.Renderer): void;
2206
+ setMenu(menus: (Menu | null)[], button: Menu | null, options?: { [k in keyof Menu.Options]?: Menu.Options[k] | null } | null): void;
2236
2207
  get inserted(): boolean;
2237
2208
  insert(): void;
2238
2209
  remove(): void;
@@ -2288,20 +2259,6 @@ declare class PageContext extends GeneralContext {
2288
2259
  get panel(): boolean;
2289
2260
  set mode(mode: "scroll" | "flex");
2290
2261
  get mode(): "scroll" | "flex";
2291
- /**
2292
- * @template T
2293
- * @overload
2294
- * @param {(dialog: HTMLDialogElement, signal: AbortSignal) => PromiseLike<T> | T} exec
2295
- * @param {AbortSignal} [signal]
2296
- * @returns {Promise<T>}
2297
- */
2298
- createDialog<T>(exec: (dialog: HTMLDialogElement, signal: AbortSignal) => PromiseLike<T> | T, signal?: AbortSignal | undefined): Promise<T>;
2299
- /**
2300
- * @overload
2301
- * @param {AbortSignal} [signal]
2302
- * @returns {HTMLDialogElement}
2303
- */
2304
- createDialog(signal?: AbortSignal | undefined): HTMLDialogElement;
2305
2262
  /**
2306
2263
  * @template T
2307
2264
  * @overload
@@ -2666,6 +2623,9 @@ declare function showSortDialog(modal: Modal, modelDefine: ModelScriptConfigurat
2666
2623
  */
2667
2624
  declare function createStoreField(store: Store$1<any, Field | null, any>, style: FieldStyle, renderer?: any, options?: StoreLayout$1.Options | null): Element | null;
2668
2625
  //#endregion
2626
+ //#region packages/web/utils/createNeverAbortedSignal.d.mts
2627
+ declare function createNeverAbortedSignal(): AbortSignal;
2628
+ //#endregion
2669
2629
  //#region packages/web/utils/toUrl.d.mts
2670
2630
  /**
2671
2631
  *
@@ -2767,49 +2727,25 @@ type Permission$1 = ({
2767
2727
  declare function load(force?: boolean): Promise<Permission$1[]>;
2768
2728
  declare function get(): Permission$1[];
2769
2729
  //#endregion
2770
- //#region packages/web/services/menu.d.mts
2771
- /**
2772
- * @overload
2773
- * @param {string} type
2774
- * @param {boolean} [force]
2775
- * @returns {Promise<Menu.Define[]>}
2776
- */
2777
- declare function loadMenu(type: string, force?: boolean | undefined): Promise<Menu.Define[]>;
2778
- /**
2779
- * @overload
2780
- * @param {string} type
2781
- * @param {string} [group]
2782
- * @param {boolean} [force]
2783
- * @returns {Promise<Menu.Define[]>}
2784
- */
2785
- declare function loadMenu(type: string, group?: string | undefined, force?: boolean | undefined): Promise<Menu.Define[]>;
2786
- /**
2787
- * @overload
2788
- * @param {string} type
2789
- * @param {string | boolean} [group]
2790
- * @param {boolean} [force]
2791
- * @returns {Promise<Menu.Define[]>}
2792
- */
2793
- declare function loadMenu(type: string, group?: string | boolean | undefined, force?: boolean | undefined): Promise<Menu.Define[]>;
2794
- //#endregion
2795
2730
  //#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
- }
2731
+ declare const Application: {
2732
+ readonly id: string;
2733
+ readonly root: string;
2734
+ readonly path: string;
2735
+ readonly authRoot: string;
2736
+ readonly authPath: string;
2737
+ readonly logo: string;
2738
+ readonly title: string;
2739
+ readonly company: string;
2740
+ readonly help: string;
2741
+ refresh(): void;
2742
+ readonly menus: Menu.Define[];
2743
+ loadMenus(force?: boolean): Promise<Menu.Define[]>;
2744
+ readonly userMenus: Menu.Define[];
2745
+ loadUserMenus(force?: boolean): Promise<Menu.Define[]>;
2746
+ loadPage(page: string): Promise<(() => Promise<unknown>) | null>;
2747
+ loadContinuation(page: string): Promise<(() => Promise<unknown>) | null>;
2748
+ };
2813
2749
  //#endregion
2814
2750
  //#region packages/web/import.d.mts
2815
2751
  /**
@@ -2843,6 +2779,13 @@ declare function importStyle(url: string, plugin?: string, pluginOnly?: boolean)
2843
2779
  * @returns {Promise<void>}
2844
2780
  */
2845
2781
  declare function importScript(src: string): Promise<void>;
2782
+ /**
2783
+ *
2784
+ * @param {string} src
2785
+ * @param {string | string[]} [name]
2786
+ * @param {string} [type]
2787
+ */
2788
+ declare function require$1(src: string, name?: string | string[], type?: string): Promise<any>;
2846
2789
  //#endregion
2847
2790
  //#region packages/web/paths.d.mts
2848
2791
  declare namespace pathRoots {
@@ -2942,9 +2885,6 @@ declare function toFileLink(uri?: string): {
2942
2885
  href: string;
2943
2886
  } | null;
2944
2887
  //#endregion
2945
- //#region packages/web/constants.d.mts
2946
- declare const neverAbortedSignal: AbortSignal;
2947
- //#endregion
2948
2888
  //#region packages/web/permission.d.mts
2949
2889
  /** @import { FieldScriptConfiguration, ModelConfiguration, ModelScriptConfiguration } from './types.mjs' */
2950
2890
  /**
@@ -3111,7 +3051,7 @@ declare function buildPlugin(pluginId: string): {
3111
3051
  method(method: string, path?: string): /*elided*/any;
3112
3052
  get version(): string;
3113
3053
  buildResult(response: Promise<Response>): Result;
3114
- clone<T extends dot_request1.default>(target: T): T;
3054
+ clone<T extends dot_request0.default>(target: T): T;
3115
3055
  clone(): /*elided*/any;
3116
3056
  get(path?: string | undefined): /*elided*/any;
3117
3057
  get(template: TemplateStringsArray, ...substitutions: any[]): /*elided*/any;
@@ -3200,11 +3140,11 @@ declare function buildPlugin(pluginId: string): {
3200
3140
  /**
3201
3141
  *
3202
3142
  * @param {typeof loadAuthenticator} _loadAuthenticator
3203
- * @param {() => MaybePromise<Partial<WorkbenchTheme>>} [_loadTheme]
3143
+ * @param {() => MaybePromise<Partial<WorkbenchTheme>>} _loadTheme
3204
3144
  * @param {() => MaybePromise<PageIdent.Router?>} [_loadRoute]
3205
3145
  * @returns
3206
3146
  */
3207
- declare function start(_loadAuthenticator: typeof loadAuthenticator, _loadTheme?: () => MaybePromise<Partial<WorkbenchTheme>>, _loadRoute?: () => MaybePromise<PageIdent.Router | null>): Promise<void>;
3147
+ declare function start(_loadAuthenticator: typeof loadAuthenticator, _loadTheme: () => MaybePromise<Partial<WorkbenchTheme>>, _loadRoute?: () => MaybePromise<PageIdent.Router | null>): Promise<void>;
3208
3148
  type uiStyle = [file: string, plugin: string];
3209
3149
  type WorkbenchTheme = Omit<Theme, "styleFiles"> & Record<"styleFiles", uiStyle[]>;
3210
3150
  /** @type {() => MaybePromise<Partial<Omit<Authenticator, "styleFiles"> & Record<"styleFiles", uiStyle[]>>>} */
@@ -3213,67 +3153,19 @@ declare let loadAuthenticator: () => MaybePromise<Partial<Omit<Authenticator, "s
3213
3153
  //#region packages/web/configuration.d.mts
3214
3154
  /** @type {Record<string, Plugin>} */
3215
3155
  declare const plugins: Record<string, Plugin>;
3216
- declare namespace application {
3217
- export const id: string | undefined;
3218
- export const path: string;
3219
- export const root: string;
3220
- export const theme: string | undefined;
3221
- export const route: string | undefined;
3222
- export const authenticator: string | undefined;
3223
- export const type: string | undefined;
3224
- export const skin: string | undefined;
3225
- export const menus: any[];
3226
- export const userMenus: any[];
3227
- export const logo: string | undefined;
3228
- export const title: string | undefined;
3229
- export const company: string | undefined;
3230
- export const help: string | undefined;
3231
- export const refreshing: boolean;
3232
- export { refresh };
3233
- }
3234
- declare function refresh(): Promise<void>;
3235
- //#endregion
3236
- //#region packages/web/form/List.d.mts
3237
- declare class List$1 {
3238
- /**
3239
- *
3240
- * @param {(id: string) => string} createUrl
3241
- * @param {ModelScriptConfiguration} model
3242
- */
3243
- constructor(createUrl: (id: string) => string, model: ModelScriptConfiguration);
3244
- get root(): HTMLTableElement;
3245
- set createUrl(fn: ((id: string) => string) | null);
3246
- get createUrl(): ((id: string) => string) | null;
3247
- /**
3248
- *
3249
- * @param {readonly any[]} list
3250
- */
3251
- setData(list: readonly any[]): void;
3252
- destroy(): void;
3253
- #private;
3156
+ declare namespace boot {
3157
+ const theme: string | undefined;
3158
+ const route: string | undefined;
3159
+ const authenticator: string | undefined;
3160
+ const type: string | undefined;
3161
+ const skin: string | undefined;
3254
3162
  }
3255
3163
  //#endregion
3256
3164
  //#region packages/web/components.d.mts
3257
- declare let List: typeof List$1;
3258
- declare let Pagination: {
3259
- new (): {
3260
- "__#private@#pagination": HTMLDivElement;
3261
- get root(): HTMLDivElement;
3262
- get size(): number;
3263
- set size(v: number);
3264
- get page(): number;
3265
- set page(v: number);
3266
- get total(): number;
3267
- set total(v: number);
3268
- /**
3269
- *
3270
- * @param {(p: Pagination) => void} listen
3271
- * @returns {() => void}
3272
- */
3273
- listen(listen: (p: /*elided*/any) => void): () => void;
3274
- destroy(): void;
3275
- };
3276
- };
3165
+ /** @type {Components['List']} */
3166
+ declare let List: Components["List"];
3167
+ /** @type {Components['Pagination']} */
3168
+ declare let Pagination$1: Components["Pagination"];
3277
3169
  //#endregion
3278
3170
  //#region packages/web/allHooks.d.mts
3279
3171
  /** @typedef {Object.<'main' | 'details' | 'setting' | 'input' | 'edit', string | PageRenderer>} ContinuationDefine */
@@ -3285,4 +3177,4 @@ declare function updateHooks(hooks: Record<string, Hook.Define<Hooks>>): void;
3285
3177
  /** @type {Hook<Hooks>} */
3286
3178
  declare const allHooks: Hook<Hooks>;
3287
3179
  //#endregion
3288
- 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, importScript, 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 };
3180
+ export { Application, ArrayStore, Authenticator, BindObjectStore, code128_d_exports as Code128, Command, Component, Components, 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$1 as Pagination, type Print, ResponseError, type Schema, 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, importScript, importStyle, importWidget, isMac, isPluginId, 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, setIcon, showDocumentInModal, _default$3 as showFilterDialog, showSortDialog, start, testPermission, testPermissionConstraints, testPermissions, toFileLink, toFileURL, toId, toPermissionFilter, toSchema, toUrl, updateHooks, waitAbortSignal, watch };