@yongdall/web 0.2.0 → 0.3.1

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{configuration 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}=e;async function l(){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 u(){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 d(){return o?r(o):null}c?n(c).finally(()=>i(l,u,d)):i(l,u,d)}a();
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}=e;async function l(){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 u(){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 d(){return o?r(o):null}c?n(c).finally(()=>i(l,u,d)):i(l,u,d)}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 { start } from '@yongdall/web';\nimport { importWidget, importStyle } from '@yongdall/web';\nimport { findPluginIdRegex } from '@yongdall/web';\nimport { configuration } 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 } = configuration;\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\tif (skin) {\n\t\timportStyle(skin).finally(() => start(_loadAuthenticator, _loadTheme, _loadRoute));\n\n\t} else {\n\t\tstart(_loadAuthenticator, _loadTheme, _loadRoute);\n\t}\n\n}\ninit();\n"],"mappings":"mHAYA,eAAe,GAAO,CAGrB,GAAM,CAAE,QAAO,QAAO,gBAAe,QAAS,EAG9C,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,KAGlB,EACH,EAAY,EAAK,CAAC,YAAc,EAAM,EAAoB,EAAY,EAAW,CAAC,CAGlF,EAAM,EAAoB,EAAY,EAAW,CAInD,GAAM"}
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 } = application;\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\tif (skin) {\n\t\timportStyle(skin).finally(() => start(_loadAuthenticator, _loadTheme, _loadRoute));\n\t} else {\n\t\tstart(_loadAuthenticator, _loadTheme, _loadRoute);\n\t}\n\n}\ninit();\n"],"mappings":"iHAWA,eAAe,GAAO,CAGrB,GAAM,CAAE,QAAO,QAAO,gBAAe,QAAS,EAG9C,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,KAGlB,EACH,EAAY,EAAK,CAAC,YAAc,EAAM,EAAoB,EAAY,EAAW,CAAC,CAElF,EAAM,EAAoB,EAAY,EAAW,CAInD,GAAM"}
package/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as dot_request1 from "dot-request";
2
2
  import DotRequest, { default as DotRequest$1 } from "dot-request";
3
3
  import { ArrayStore, ObjectStore, Schema, Schema as Schema$1, Store, Store as Store$1, StoreLayout, StoreLayout as StoreLayout$1, renderStore } from "@neeloong/form";
4
- import { BootConfiguration, Hook, Indicator, Plugin, Search } from "@yongdall/common";
4
+ import { Hook, Indicator, Plugin, Search } from "@yongdall/common";
5
5
  import { Field, MaybePromise, Permission, Permissions } from "@yongdall/types";
6
6
  import { Signal as Signal$1 } from "signal-polyfill";
7
7
  export * from "@yongdall/common";
@@ -37,6 +37,21 @@ declare function watch<T>(getter: (() => T)[], callback: (value: T[]) => void, o
37
37
  immediate?: boolean | undefined;
38
38
  signal?: AbortSignal | undefined;
39
39
  } | undefined): void;
40
+ /**
41
+ * 创建可赋值计算值
42
+ * @template T
43
+ * @overload
44
+ * @param {(() => any)[]} getter 取值方法
45
+ * @param {(value: any[]) => void} callback 取值方法
46
+ * @param {object} [options]
47
+ * @param {boolean} [options.immediate] 是否立即执行一次
48
+ * @param {AbortSignal} [options.signal]
49
+ * @returns {void}
50
+ */
51
+ declare function watch<T>(getter: (() => any)[], callback: (value: any[]) => void, options?: {
52
+ immediate?: boolean | undefined;
53
+ signal?: AbortSignal | undefined;
54
+ } | undefined): void;
40
55
  /**
41
56
  * 创建可赋值计算值
42
57
  * @template T
@@ -393,7 +408,7 @@ declare namespace Menu {
393
408
  */
394
409
  collapsed?: boolean | undefined;
395
410
  };
396
- type Renderer = (menu: Menu, signal: AbortSignal) => HTMLElement | null;
411
+ type Renderer = (menu: Menu, signal: AbortSignal, isButton?: boolean) => HTMLElement | null;
397
412
  }
398
413
  //#endregion
399
414
  //#region packages/web/route/PageSider.d.mts
@@ -700,23 +715,13 @@ declare function modelService(model: string): {
700
715
  options(options?: boolean | undefined): Promise<Record<string, any>[]>;
701
716
  /**
702
717
  * @overload
703
- * @param {object} options
704
- * @param {any[]} [options.matches]
705
- * @param {string} [options.query]
706
- * @param {number} [options.page]
707
- * @param {number} [options.limit]
708
- * @param {number} [options.offset]
709
- * @param {string[]} [options.select]
710
- * @returns {Promise<Record<string, any>[]>}
718
+ * @param {Search.Param} options
719
+ * @returns {Promise<{options: Record<string, any>[]; total: number}>}
711
720
  */
712
- options(options: {
713
- matches?: any[] | undefined;
714
- query?: string | undefined;
715
- page?: number | undefined;
716
- limit?: number | undefined;
717
- offset?: number | undefined;
718
- select?: string[] | undefined;
719
- }): Promise<Record<string, any>[]>;
721
+ options(options: Search.Param): Promise<{
722
+ options: Record<string, any>[];
723
+ total: number;
724
+ }>;
720
725
  /**
721
726
  *
722
727
  * @param {string | number} id
@@ -742,7 +747,7 @@ declare function modelService(model: string): {
742
747
  * @returns
743
748
  */
744
749
  update(data: Record<string, any>): Promise<any>;
745
- delete(): Promise<any>; /** @param {string} field */
750
+ delete(): Promise<void>; /** @param {string} field */
746
751
  field(field: string): {
747
752
  then<TResult1 = any, TResult2 = never>(onfulfilled?: ((value: any) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
748
753
  catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<any>;
@@ -1203,25 +1208,44 @@ interface FieldFilterComponent<T extends Record<string, any> = Record<string, an
1203
1208
  interface FieldDefine {
1204
1209
  quickFilter: string;
1205
1210
  }
1206
- interface FormFieldHook {
1211
+ declare namespace FieldFilter {
1212
+ type Value = (values: any[], target: any, define?: Field | null) => boolean | null;
1213
+ type Field = (values: any[], target: any, define?: Field, fieldDefine?: Field) => boolean | null;
1214
+ type Named = (name: string, value: string, define: Field) => boolean | null;
1215
+ }
1216
+ interface FieldFilterFns {
1217
+ value?: FieldFilter.Value | null;
1218
+ named?: FieldFilter.Named | null;
1219
+ field?: FieldFilter.Field | null;
1220
+ notValue?: FieldFilter.Value | null;
1221
+ notNamed?: FieldFilter.Named | null;
1222
+ notField?: FieldFilter.Field | null;
1223
+ not?: boolean | string;
1224
+ }
1225
+ interface FieldFilter extends FieldFilterFns {
1226
+ label?: string;
1227
+ filter?: FieldFilterComponent;
1228
+ notLabel?: string;
1229
+ }
1230
+ interface FormFieldHook extends FieldFilterFns {
1207
1231
  type?: string;
1208
1232
  array?: boolean;
1209
1233
  renderer?: string;
1210
1234
  input: FieldComponent;
1211
1235
  filter: FieldFilterComponent;
1212
1236
  notFilter: FieldFilterComponent;
1213
- filters: Record<string, FieldFilterComponent | [FieldFilterComponent, string?]>;
1237
+ filters: Record<string, FieldFilterComponent | [FieldFilterComponent, string?] | FieldFilter>;
1214
1238
  }
1215
1239
  declare namespace FromRenderer {
1216
1240
  interface Options {
1217
- model?: ModelScriptConfiguration | null;
1218
- layout?: StoreLayout$1<any> | null;
1219
- editable?: boolean;
1220
- signal?: AbortSignal;
1241
+ model: ModelScriptConfiguration | null;
1242
+ layout: StoreLayout$1<any> | null;
1243
+ editable: boolean;
1244
+ signal: AbortSignal;
1221
1245
  /** 是否启用链接 */
1222
- enableLink?: boolean;
1246
+ enableLink: boolean;
1223
1247
  /** 是否为设计模式 */
1224
- design?: boolean;
1248
+ design: boolean;
1225
1249
  }
1226
1250
  }
1227
1251
  interface FromRenderer {
@@ -1271,6 +1295,7 @@ interface Authenticator {
1271
1295
  }
1272
1296
  interface Theme {
1273
1297
  home: (ctx: HomeContext) => void;
1298
+ updatePath: (path: string, search: string, hash: string) => void;
1274
1299
  /** 自动加载的样式文件 */
1275
1300
  styleFiles: string[];
1276
1301
  /** 添加到 <body> 上的类名 */
@@ -1470,6 +1495,7 @@ type Match = {
1470
1495
  };
1471
1496
  //#endregion
1472
1497
  //#region packages/web/form/field.d.mts
1498
+ declare function getAllFilterFns(): Record<string, Record<string, FilterFns>>;
1473
1499
  /**
1474
1500
  * @overload
1475
1501
  * @param {FieldScriptConfiguration} field
@@ -1519,6 +1545,30 @@ declare function getFieldFilterOperators(field: FieldScriptConfiguration): Recor
1519
1545
  * @returns {boolean}
1520
1546
  */
1521
1547
  declare function hasFieldFilter(field: FieldScriptConfiguration, operator: string): boolean;
1548
+ /**
1549
+ *
1550
+ * @param {FieldScriptConfiguration | boolean} field
1551
+ * @param {string} operator
1552
+ */
1553
+ declare function getFilterFns(field: FieldScriptConfiguration | boolean, operator: string): Generator<FilterFns, void, unknown>;
1554
+ type FieldFilterOptions = {
1555
+ /**
1556
+ * - 过滤器组件
1557
+ */
1558
+ component: FieldFilterComponent;
1559
+ /**
1560
+ * - 标签文本
1561
+ */
1562
+ label?: string | undefined;
1563
+ };
1564
+ type FilterFns = {
1565
+ value: FieldFilter.Value[];
1566
+ notValue: FieldFilter.Value[];
1567
+ named: FieldFilter.Named[];
1568
+ notNamed: FieldFilter.Named[];
1569
+ field: FieldFilter.Field[];
1570
+ notField: FieldFilter.Field[];
1571
+ };
1522
1572
  //#endregion
1523
1573
  //#region packages/web/form/toSchema.d.mts
1524
1574
  /**
@@ -1534,10 +1584,10 @@ declare function toSchema(fields: Record<string, FieldScriptConfiguration>, comp
1534
1584
  *
1535
1585
  * @param {Store<any, any>} store
1536
1586
  * @param {HTMLElement} root
1537
- * @param {FromRenderer.Options & {type?: string}} [options]
1587
+ * @param {Partial<FromRenderer.Options> & {type?: string}} [options]
1538
1588
  * @returns {void}
1539
1589
  */
1540
- declare function _default$1(store: Store$1<any, any>, root: HTMLElement, options?: FromRenderer.Options & {
1590
+ declare function _default$1(store: Store$1<any, any>, root: HTMLElement, options?: Partial<FromRenderer.Options> & {
1541
1591
  type?: string;
1542
1592
  }): void;
1543
1593
  //#endregion
@@ -1637,9 +1687,20 @@ declare function isPluginId(n: string): boolean;
1637
1687
  //#region packages/web/utils/waitAbortSignal.d.mts
1638
1688
  /**
1639
1689
  *
1690
+ * @overload
1691
+ * @param {AbortSignal | null | undefined} signal
1692
+ * @param {true} useReject
1693
+ * @returns {Promise<never>}
1694
+ */
1695
+ declare function waitAbortSignal(signal: AbortSignal | null | undefined, useReject: true): Promise<never>;
1696
+ /**
1697
+ *
1698
+ * @overload
1640
1699
  * @param {AbortSignal?} [signal]
1700
+ * @param {boolean?} [useReject]
1701
+ * @returns {Promise<void | never>}
1641
1702
  */
1642
- declare function waitAbortSignal(signal?: AbortSignal | null): Promise<void>;
1703
+ declare function waitAbortSignal(signal?: AbortSignal | null | undefined, useReject?: boolean | null | undefined): Promise<void | never>;
1643
1704
  //#endregion
1644
1705
  //#region packages/web/script/index.d.mts
1645
1706
  /**
@@ -1777,11 +1838,19 @@ declare namespace pathRoots {
1777
1838
  }
1778
1839
  //#endregion
1779
1840
  //#region packages/web/loadOptions.d.mts
1841
+ /**
1842
+ *
1843
+ * @param {Record<string, Field>} fields 字段配置
1844
+ * @param {Search.ExecParam} param
1845
+ * @returns
1846
+ */
1847
+ declare function modelFilter(fields: Record<string, Field>, param: Search.ExecParam): boolean | null;
1780
1848
  /**
1781
1849
  *
1782
1850
  * @param {object} options
1783
1851
  * @param {string?} [options.type]
1784
1852
  * @param {string?} [options.name]
1853
+ * @param {string?} [options.model]
1785
1854
  * @param {string?} [options.filter]
1786
1855
  * @param {*} [options.values]
1787
1856
  * @param {string?} [options.id]
@@ -1792,18 +1861,20 @@ declare namespace pathRoots {
1792
1861
  * @param {string?} [options.sequence]
1793
1862
  * @param {string?} [options.disabled]
1794
1863
  * @param {*} [options.values]
1795
- * @param {((placeholder: string) => string | (() => string) | null) | false} [getPlaceholder]
1864
+ * @param {((placeholder: string) => Search.Value | null) | false} [getPlaceholder]
1796
1865
  * @param {(value: Search.ExecParam) => boolean?} [exec]
1797
1866
  * @returns
1798
1867
  */
1799
1868
  declare function loadOptions({
1800
1869
  type,
1801
1870
  name,
1871
+ model,
1802
1872
  values,
1803
1873
  ...options
1804
1874
  }: {
1805
1875
  type?: string | null | undefined;
1806
1876
  name?: string | null | undefined;
1877
+ model?: string | null | undefined;
1807
1878
  filter?: string | null | undefined;
1808
1879
  values?: any;
1809
1880
  id?: string | null | undefined;
@@ -1814,24 +1885,26 @@ declare function loadOptions({
1814
1885
  sequence?: string | null | undefined;
1815
1886
  disabled?: string | null | undefined;
1816
1887
  values?: any;
1817
- }, getPlaceholder?: ((placeholder: string) => string | (() => string) | null) | false, exec?: (value: Search.ExecParam) => boolean | null): State<Option[]>;
1888
+ }, getPlaceholder?: ((placeholder: string) => Search.Value | null) | false, exec?: (value: Search.ExecParam) => boolean | null): State<Option[]>;
1818
1889
  /**
1819
1890
  *
1820
1891
  * @param {object} options
1821
1892
  * @param {string?} [options.type]
1822
1893
  * @param {string?} [options.name]
1894
+ * @param {string?} [options.model]
1823
1895
  * @param {string?} [options.filter]
1824
1896
  * @param {*} [options.values]
1825
1897
  * @param {string} [options.configurator]
1826
1898
  * @param {string?} [options.parent]
1827
1899
  * @param {string?} [options.children]
1828
- * @param {((placeholder: string) => string | (() => string) | null)} [getPlaceholder]
1900
+ * @param {((placeholder: string) => Search.Value | null)} [getPlaceholder]
1829
1901
  * @param {(value: Search.ExecParam) => boolean?} [exec]
1830
1902
  * @returns
1831
1903
  */
1832
1904
  declare function findConfigurator({
1833
1905
  type,
1834
1906
  name,
1907
+ model,
1835
1908
  values,
1836
1909
  configurator,
1837
1910
  parent,
@@ -1840,12 +1913,13 @@ declare function findConfigurator({
1840
1913
  }: {
1841
1914
  type?: string | null | undefined;
1842
1915
  name?: string | null | undefined;
1916
+ model?: string | null | undefined;
1843
1917
  filter?: string | null | undefined;
1844
1918
  values?: any;
1845
1919
  configurator?: string | undefined;
1846
1920
  parent?: string | null | undefined;
1847
1921
  children?: string | null | undefined;
1848
- }, getPlaceholder?: ((placeholder: string) => string | (() => string) | null), exec?: (value: Search.ExecParam) => boolean | null): State<any>;
1922
+ }, getPlaceholder?: ((placeholder: string) => Search.Value | null), exec?: (value: Search.ExecParam) => boolean | null): State<any>;
1849
1923
  type Option = {
1850
1924
  id: string | number;
1851
1925
  value: string | number;
@@ -1865,11 +1939,11 @@ type Option = {
1865
1939
  declare function getPrimaryFields(model: ModelConfiguration | ModelScriptConfiguration): string[];
1866
1940
  /**
1867
1941
  *
1868
- * @param {ModelConfiguration | ModelScriptConfiguration} model
1942
+ * @param {ModelConfiguration | ModelScriptConfiguration | string[]} model
1869
1943
  * @param {Record<string, any>} document
1870
1944
  * @returns
1871
1945
  */
1872
- declare function toId(model: ModelConfiguration | ModelScriptConfiguration, document: Record<string, any>): string;
1946
+ declare function toId(document: Record<string, any>, model: ModelConfiguration | ModelScriptConfiguration | string[]): string;
1873
1947
  //#endregion
1874
1948
  //#region packages/web/icons/index.d.mts
1875
1949
  /**
@@ -1918,6 +1992,7 @@ declare function toFileLink(uri?: string): {
1918
1992
  declare const neverAbortedSignal: AbortSignal;
1919
1993
  //#endregion
1920
1994
  //#region packages/web/permission.d.mts
1995
+ /** @import { FieldScriptConfiguration, ModelConfiguration, ModelScriptConfiguration } from './types.mjs' */
1921
1996
  /**
1922
1997
  *
1923
1998
  * @param {string | string[] | null | void} permission
@@ -1938,27 +2013,39 @@ declare function testPermissionConstraints(constraints: Permission["constraints"
1938
2013
  /**
1939
2014
  *
1940
2015
  * @param {Permission} permission
1941
- * @param {{has(permission: string): boolean}} permissions
1942
2016
  * @param {Record<string, any>?} [data]
1943
2017
  * @param {boolean} [isNew]
2018
+ * @param {string} [fieldName]
1944
2019
  */
1945
2020
  declare function testPermission({
1946
2021
  permission,
1947
2022
  organizationField,
1948
2023
  constraints
1949
- }: Permission, permissions: {
1950
- has(permission: string): boolean;
1951
- }, data?: Record<string, any> | null, isNew?: boolean): boolean;
2024
+ }: Permission, data?: Record<string, any> | null, isNew?: boolean, fieldName?: string): boolean;
1952
2025
  /**
1953
2026
  *
1954
2027
  * @param {Permission[]} permissionList
1955
- * @param {{has(permission: string): boolean}} permissions
1956
2028
  * @param {Record<string, any>?} [data]
1957
2029
  * @param {boolean} [isNew]
1958
2030
  */
1959
- declare function getAuthorizations(permissionList: Permission[], permissions: {
1960
- has(permission: string): boolean;
1961
- }, data?: Record<string, any> | null, isNew?: boolean): Set<string>;
2031
+ declare function getAuthorizations(permissionList: Permission[], data?: Record<string, any> | null, isNew?: boolean): Set<string>;
2032
+ /**
2033
+ *
2034
+ * @param {string} authorization
2035
+ * @param {Permission[]} permissions
2036
+ * @param {Record<string, any>} [data]
2037
+ * @param {boolean} [isNew]
2038
+ * @param {string} [fieldName]
2039
+ */
2040
+ declare function testPermissions(authorization: string, permissions: Permission[], data?: Record<string, any>, isNew?: boolean, fieldName?: string): boolean;
2041
+ /**
2042
+ *
2043
+ * @param {string} authorization
2044
+ * @param {Permission[]} permissions
2045
+ * @param {ModelConfiguration | ModelScriptConfiguration} model
2046
+ * @returns {Set<string>}
2047
+ */
2048
+ declare function getPermissionFields(authorization: string, permissions: Permission[], model: ModelConfiguration | ModelScriptConfiguration): Set<string>;
1962
2049
  declare namespace Ident_d_exports {
1963
2050
  export { decode, encode, parse, stringify };
1964
2051
  }
@@ -1986,7 +2073,6 @@ declare function parse(ident: string): PageIdent;
1986
2073
  declare function stringify(a: PageIdent): string;
1987
2074
  //#endregion
1988
2075
  //#region packages/web/request.d.mts
1989
- declare const request: ARequest;
1990
2076
  declare class ARequest extends DotRequest$1 {
1991
2077
  /**
1992
2078
  *
@@ -1996,6 +2082,7 @@ declare class ARequest extends DotRequest$1 {
1996
2082
  */
1997
2083
  method(method: string, path?: string): this;
1998
2084
  }
2085
+ declare const request: ARequest;
1999
2086
  //#endregion
2000
2087
  //#region packages/web/ResponseError.d.mts
2001
2088
  declare class ResponseError extends Error {
@@ -2133,11 +2220,24 @@ declare let loadTheme: () => MaybePromise<Partial<Omit<Theme, "styleFiles"> & Re
2133
2220
  //#region packages/web/configuration.d.mts
2134
2221
  /** @type {Record<string, Plugin>} */
2135
2222
  declare const plugins: Record<string, Plugin>;
2136
- declare const userMenus: any[];
2137
- declare const webRoot: URL;
2138
- /** @import { Plugin, BootConfiguration } from '@yongdall/common' */
2139
- /** @type {BootConfiguration} */
2140
- declare const configuration: BootConfiguration;
2223
+ declare namespace application {
2224
+ export const id: string | undefined;
2225
+ export const path: string;
2226
+ export const root: string;
2227
+ export const theme: string | undefined;
2228
+ export const route: string | undefined;
2229
+ export const authenticator: string | undefined;
2230
+ export const skin: string | undefined;
2231
+ export const menus: any[];
2232
+ export const userMenus: any[];
2233
+ export const logo: string | undefined;
2234
+ export const title: string | undefined;
2235
+ export const company: string | undefined;
2236
+ export const help: string | undefined;
2237
+ export const refreshing: boolean;
2238
+ export { refresh };
2239
+ }
2240
+ declare function refresh(): Promise<void>;
2141
2241
  //#endregion
2142
2242
  //#region packages/web/dom.d.mts
2143
2243
  /**
@@ -2199,4 +2299,4 @@ declare function updateHooks(hooks: Record<string, Hook.Define<Hooks>>): void;
2199
2299
  /** @type {Hook<Hooks>} */
2200
2300
  declare const allHooks: Hook<Hooks>;
2201
2301
  //#endregion
2202
- export { ArrayStore, Authenticator, Command, ConfiguratorComponent, ConfiguratorContext, type ContinuationDefine, DotRequest, FieldComponent, FieldComponentEvent, FieldComponents, FieldContext, FieldDefine, FieldFilterComponent, FieldFilterContext, FieldFilterStyle, type FieldScript, type FieldScriptConfiguration, FieldShowHandle, FieldStyle, FormFieldHook, FromRenderer, GeneralContext, type HomeContext, Hooks, IconDefine, Ident_d_exports as Ident, List, type Match, Menu, type ModelConfiguration, ModelIndicator, type ModelScript, type ModelScriptConfiguration, ObjectStore, Option, Page, type PageContext, type PageError, PageFooter, type PageHandle, PageHeader, type PageIdent, type PageManager, type PageRenderer, PageSection, PageSectionParam, PageSider, Pagination, ResponseError, type Schema, Signal$1 as Signal, State, Store, type StoreLayout, SubmodelsLayoutEvent, Theme, User, UserHook, VerifyContext, VerifyError, type WorkspaceDefine, addManager, allHooks, buildPlugin, configuration, createComputed, createFilters, createIcon, createQuickFilters, createShowField, createState, createStore, createStoreField, effect, enumerationsService, execScript, filterPermission, findConfigurator, formLayoutsService, getAuthorizations, getField, getFieldFilter, getFieldFilterOperators, getPages, getPrimaryFields, hasField, hasFieldFilter, importStyle, importWidget, isPluginId, loadMenu, loadOptions, modelService, neverAbortedSignal, pathRoots, _default as permissionsService, plugins, _default$1 as renderForm, renderStore, _default$2 as renderStoreForm, request, root$1 as root, selectFile, setIcon, showFilterDialog, start, testPermission, testPermissionConstraints, toFileLink, toFileURL, toId, toSchema, toUrl, updateHooks, userMenus, waitAbortSignal, watch, webRoot };
2302
+ export { ArrayStore, Authenticator, Command, ConfiguratorComponent, ConfiguratorContext, type ContinuationDefine, DotRequest, FieldComponent, FieldComponentEvent, FieldComponents, FieldContext, FieldDefine, FieldFilter, FieldFilterComponent, FieldFilterContext, FieldFilterFns, FieldFilterOptions, FieldFilterStyle, type FieldScript, type FieldScriptConfiguration, FieldShowHandle, FieldStyle, FilterFns, FormFieldHook, FromRenderer, GeneralContext, type HomeContext, Hooks, IconDefine, Ident_d_exports as Ident, List, type Match, Menu, type ModelConfiguration, ModelIndicator, type ModelScript, type ModelScriptConfiguration, ObjectStore, Option, Page, type PageContext, type PageError, PageFooter, type PageHandle, PageHeader, type PageIdent, type PageManager, type PageRenderer, PageSection, PageSectionParam, PageSider, Pagination, ResponseError, type Schema, Signal$1 as Signal, State, Store, type StoreLayout, SubmodelsLayoutEvent, Theme, User, UserHook, VerifyContext, VerifyError, type WorkspaceDefine, addManager, allHooks, application, buildPlugin, createComputed, createFilters, createIcon, createQuickFilters, createShowField, createState, createStore, createStoreField, effect, enumerationsService, execScript, filterPermission, findConfigurator, formLayoutsService, getAllFilterFns, getAuthorizations, getField, getFieldFilter, getFieldFilterOperators, getFilterFns, getPages, getPermissionFields, getPrimaryFields, hasField, hasFieldFilter, importStyle, importWidget, isPluginId, loadMenu, loadOptions, modelFilter, modelService, neverAbortedSignal, pathRoots, _default as permissionsService, plugins, _default$1 as renderForm, renderStore, _default$2 as renderStoreForm, request, root$1 as root, selectFile, setIcon, showFilterDialog, start, testPermission, testPermissionConstraints, testPermissions, toFileLink, toFileURL, toId, toSchema, toUrl, updateHooks, waitAbortSignal, watch };