@yongdall/web 0.1.4 → 0.3.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 +1 -1
- package/boot.mjs.map +1 -1
- package/index.d.mts +155 -53
- package/index.mjs +12 -12
- package/index.mjs.map +1 -1
- package/package.json +6 -6
package/boot.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
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';\
|
|
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 {
|
|
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
|
|
@@ -685,7 +700,8 @@ declare function modelService(model: string): {
|
|
|
685
700
|
limit,
|
|
686
701
|
page,
|
|
687
702
|
offset,
|
|
688
|
-
select
|
|
703
|
+
select,
|
|
704
|
+
total
|
|
689
705
|
}?: Search.Param): Promise<{
|
|
690
706
|
documents: any[];
|
|
691
707
|
total: number;
|
|
@@ -699,23 +715,13 @@ declare function modelService(model: string): {
|
|
|
699
715
|
options(options?: boolean | undefined): Promise<Record<string, any>[]>;
|
|
700
716
|
/**
|
|
701
717
|
* @overload
|
|
702
|
-
* @param {
|
|
703
|
-
* @
|
|
704
|
-
* @param {string} [options.query]
|
|
705
|
-
* @param {number} [options.page]
|
|
706
|
-
* @param {number} [options.limit]
|
|
707
|
-
* @param {number} [options.offset]
|
|
708
|
-
* @param {string[]} [options.select]
|
|
709
|
-
* @returns {Promise<Record<string, any>[]>}
|
|
718
|
+
* @param {Search.Param} options
|
|
719
|
+
* @returns {Promise<{options: Record<string, any>[]; total: number}>}
|
|
710
720
|
*/
|
|
711
|
-
options(options: {
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
limit?: number | undefined;
|
|
716
|
-
offset?: number | undefined;
|
|
717
|
-
select?: string[] | undefined;
|
|
718
|
-
}): Promise<Record<string, any>[]>;
|
|
721
|
+
options(options: Search.Param): Promise<{
|
|
722
|
+
options: Record<string, any>[];
|
|
723
|
+
total: number;
|
|
724
|
+
}>;
|
|
719
725
|
/**
|
|
720
726
|
*
|
|
721
727
|
* @param {string | number} id
|
|
@@ -741,7 +747,7 @@ declare function modelService(model: string): {
|
|
|
741
747
|
* @returns
|
|
742
748
|
*/
|
|
743
749
|
update(data: Record<string, any>): Promise<any>;
|
|
744
|
-
delete(): Promise<
|
|
750
|
+
delete(): Promise<void>; /** @param {string} field */
|
|
745
751
|
field(field: string): {
|
|
746
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>;
|
|
747
753
|
catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<any>;
|
|
@@ -1026,6 +1032,8 @@ type User = {
|
|
|
1026
1032
|
plugins?: Record<string, Record<string, any>> | undefined;
|
|
1027
1033
|
};
|
|
1028
1034
|
declare namespace User {
|
|
1035
|
+
const multi: boolean;
|
|
1036
|
+
const single: boolean;
|
|
1029
1037
|
const session: User | null;
|
|
1030
1038
|
const target: User | null;
|
|
1031
1039
|
const current: User | null;
|
|
@@ -1200,25 +1208,44 @@ interface FieldFilterComponent<T extends Record<string, any> = Record<string, an
|
|
|
1200
1208
|
interface FieldDefine {
|
|
1201
1209
|
quickFilter: string;
|
|
1202
1210
|
}
|
|
1203
|
-
|
|
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 {
|
|
1204
1231
|
type?: string;
|
|
1205
1232
|
array?: boolean;
|
|
1206
1233
|
renderer?: string;
|
|
1207
1234
|
input: FieldComponent;
|
|
1208
1235
|
filter: FieldFilterComponent;
|
|
1209
1236
|
notFilter: FieldFilterComponent;
|
|
1210
|
-
filters: Record<string, FieldFilterComponent | [FieldFilterComponent, string?]>;
|
|
1237
|
+
filters: Record<string, FieldFilterComponent | [FieldFilterComponent, string?] | FieldFilter>;
|
|
1211
1238
|
}
|
|
1212
1239
|
declare namespace FromRenderer {
|
|
1213
1240
|
interface Options {
|
|
1214
|
-
model
|
|
1215
|
-
layout
|
|
1216
|
-
editable
|
|
1217
|
-
signal
|
|
1241
|
+
model: ModelScriptConfiguration | null;
|
|
1242
|
+
layout: StoreLayout$1<any> | null;
|
|
1243
|
+
editable: boolean;
|
|
1244
|
+
signal: AbortSignal;
|
|
1218
1245
|
/** 是否启用链接 */
|
|
1219
|
-
enableLink
|
|
1246
|
+
enableLink: boolean;
|
|
1220
1247
|
/** 是否为设计模式 */
|
|
1221
|
-
design
|
|
1248
|
+
design: boolean;
|
|
1222
1249
|
}
|
|
1223
1250
|
}
|
|
1224
1251
|
interface FromRenderer {
|
|
@@ -1268,6 +1295,7 @@ interface Authenticator {
|
|
|
1268
1295
|
}
|
|
1269
1296
|
interface Theme {
|
|
1270
1297
|
home: (ctx: HomeContext) => void;
|
|
1298
|
+
updatePath: (path: string, search: string, hash: string) => void;
|
|
1271
1299
|
/** 自动加载的样式文件 */
|
|
1272
1300
|
styleFiles: string[];
|
|
1273
1301
|
/** 添加到 <body> 上的类名 */
|
|
@@ -1467,6 +1495,7 @@ type Match = {
|
|
|
1467
1495
|
};
|
|
1468
1496
|
//#endregion
|
|
1469
1497
|
//#region packages/web/form/field.d.mts
|
|
1498
|
+
declare function getAllFilterFns(): Record<string, Record<string, FilterFns>>;
|
|
1470
1499
|
/**
|
|
1471
1500
|
* @overload
|
|
1472
1501
|
* @param {FieldScriptConfiguration} field
|
|
@@ -1516,6 +1545,30 @@ declare function getFieldFilterOperators(field: FieldScriptConfiguration): Recor
|
|
|
1516
1545
|
* @returns {boolean}
|
|
1517
1546
|
*/
|
|
1518
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
|
+
};
|
|
1519
1572
|
//#endregion
|
|
1520
1573
|
//#region packages/web/form/toSchema.d.mts
|
|
1521
1574
|
/**
|
|
@@ -1531,10 +1584,10 @@ declare function toSchema(fields: Record<string, FieldScriptConfiguration>, comp
|
|
|
1531
1584
|
*
|
|
1532
1585
|
* @param {Store<any, any>} store
|
|
1533
1586
|
* @param {HTMLElement} root
|
|
1534
|
-
* @param {FromRenderer.Options & {type?: string}} [options]
|
|
1587
|
+
* @param {Partial<FromRenderer.Options> & {type?: string}} [options]
|
|
1535
1588
|
* @returns {void}
|
|
1536
1589
|
*/
|
|
1537
|
-
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> & {
|
|
1538
1591
|
type?: string;
|
|
1539
1592
|
}): void;
|
|
1540
1593
|
//#endregion
|
|
@@ -1634,9 +1687,20 @@ declare function isPluginId(n: string): boolean;
|
|
|
1634
1687
|
//#region packages/web/utils/waitAbortSignal.d.mts
|
|
1635
1688
|
/**
|
|
1636
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
|
|
1637
1699
|
* @param {AbortSignal?} [signal]
|
|
1700
|
+
* @param {boolean?} [useReject]
|
|
1701
|
+
* @returns {Promise<void | never>}
|
|
1638
1702
|
*/
|
|
1639
|
-
declare function waitAbortSignal(signal?: AbortSignal | null): Promise<void>;
|
|
1703
|
+
declare function waitAbortSignal(signal?: AbortSignal | null | undefined, useReject?: boolean | null | undefined): Promise<void | never>;
|
|
1640
1704
|
//#endregion
|
|
1641
1705
|
//#region packages/web/script/index.d.mts
|
|
1642
1706
|
/**
|
|
@@ -1774,11 +1838,19 @@ declare namespace pathRoots {
|
|
|
1774
1838
|
}
|
|
1775
1839
|
//#endregion
|
|
1776
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;
|
|
1777
1848
|
/**
|
|
1778
1849
|
*
|
|
1779
1850
|
* @param {object} options
|
|
1780
1851
|
* @param {string?} [options.type]
|
|
1781
1852
|
* @param {string?} [options.name]
|
|
1853
|
+
* @param {string?} [options.model]
|
|
1782
1854
|
* @param {string?} [options.filter]
|
|
1783
1855
|
* @param {*} [options.values]
|
|
1784
1856
|
* @param {string?} [options.id]
|
|
@@ -1789,18 +1861,20 @@ declare namespace pathRoots {
|
|
|
1789
1861
|
* @param {string?} [options.sequence]
|
|
1790
1862
|
* @param {string?} [options.disabled]
|
|
1791
1863
|
* @param {*} [options.values]
|
|
1792
|
-
* @param {((placeholder: string) =>
|
|
1864
|
+
* @param {((placeholder: string) => Search.Value | null) | false} [getPlaceholder]
|
|
1793
1865
|
* @param {(value: Search.ExecParam) => boolean?} [exec]
|
|
1794
1866
|
* @returns
|
|
1795
1867
|
*/
|
|
1796
1868
|
declare function loadOptions({
|
|
1797
1869
|
type,
|
|
1798
1870
|
name,
|
|
1871
|
+
model,
|
|
1799
1872
|
values,
|
|
1800
1873
|
...options
|
|
1801
1874
|
}: {
|
|
1802
1875
|
type?: string | null | undefined;
|
|
1803
1876
|
name?: string | null | undefined;
|
|
1877
|
+
model?: string | null | undefined;
|
|
1804
1878
|
filter?: string | null | undefined;
|
|
1805
1879
|
values?: any;
|
|
1806
1880
|
id?: string | null | undefined;
|
|
@@ -1811,24 +1885,26 @@ declare function loadOptions({
|
|
|
1811
1885
|
sequence?: string | null | undefined;
|
|
1812
1886
|
disabled?: string | null | undefined;
|
|
1813
1887
|
values?: any;
|
|
1814
|
-
}, getPlaceholder?: ((placeholder: string) =>
|
|
1888
|
+
}, getPlaceholder?: ((placeholder: string) => Search.Value | null) | false, exec?: (value: Search.ExecParam) => boolean | null): State<Option[]>;
|
|
1815
1889
|
/**
|
|
1816
1890
|
*
|
|
1817
1891
|
* @param {object} options
|
|
1818
1892
|
* @param {string?} [options.type]
|
|
1819
1893
|
* @param {string?} [options.name]
|
|
1894
|
+
* @param {string?} [options.model]
|
|
1820
1895
|
* @param {string?} [options.filter]
|
|
1821
1896
|
* @param {*} [options.values]
|
|
1822
1897
|
* @param {string} [options.configurator]
|
|
1823
1898
|
* @param {string?} [options.parent]
|
|
1824
1899
|
* @param {string?} [options.children]
|
|
1825
|
-
* @param {((placeholder: string) =>
|
|
1900
|
+
* @param {((placeholder: string) => Search.Value | null)} [getPlaceholder]
|
|
1826
1901
|
* @param {(value: Search.ExecParam) => boolean?} [exec]
|
|
1827
1902
|
* @returns
|
|
1828
1903
|
*/
|
|
1829
1904
|
declare function findConfigurator({
|
|
1830
1905
|
type,
|
|
1831
1906
|
name,
|
|
1907
|
+
model,
|
|
1832
1908
|
values,
|
|
1833
1909
|
configurator,
|
|
1834
1910
|
parent,
|
|
@@ -1837,12 +1913,13 @@ declare function findConfigurator({
|
|
|
1837
1913
|
}: {
|
|
1838
1914
|
type?: string | null | undefined;
|
|
1839
1915
|
name?: string | null | undefined;
|
|
1916
|
+
model?: string | null | undefined;
|
|
1840
1917
|
filter?: string | null | undefined;
|
|
1841
1918
|
values?: any;
|
|
1842
1919
|
configurator?: string | undefined;
|
|
1843
1920
|
parent?: string | null | undefined;
|
|
1844
1921
|
children?: string | null | undefined;
|
|
1845
|
-
}, getPlaceholder?: ((placeholder: string) =>
|
|
1922
|
+
}, getPlaceholder?: ((placeholder: string) => Search.Value | null), exec?: (value: Search.ExecParam) => boolean | null): State<any>;
|
|
1846
1923
|
type Option = {
|
|
1847
1924
|
id: string | number;
|
|
1848
1925
|
value: string | number;
|
|
@@ -1862,11 +1939,11 @@ type Option = {
|
|
|
1862
1939
|
declare function getPrimaryFields(model: ModelConfiguration | ModelScriptConfiguration): string[];
|
|
1863
1940
|
/**
|
|
1864
1941
|
*
|
|
1865
|
-
* @param {ModelConfiguration | ModelScriptConfiguration} model
|
|
1942
|
+
* @param {ModelConfiguration | ModelScriptConfiguration | string[]} model
|
|
1866
1943
|
* @param {Record<string, any>} document
|
|
1867
1944
|
* @returns
|
|
1868
1945
|
*/
|
|
1869
|
-
declare function toId(model: ModelConfiguration | ModelScriptConfiguration
|
|
1946
|
+
declare function toId(document: Record<string, any>, model: ModelConfiguration | ModelScriptConfiguration | string[]): string;
|
|
1870
1947
|
//#endregion
|
|
1871
1948
|
//#region packages/web/icons/index.d.mts
|
|
1872
1949
|
/**
|
|
@@ -1915,6 +1992,7 @@ declare function toFileLink(uri?: string): {
|
|
|
1915
1992
|
declare const neverAbortedSignal: AbortSignal;
|
|
1916
1993
|
//#endregion
|
|
1917
1994
|
//#region packages/web/permission.d.mts
|
|
1995
|
+
/** @import { FieldScriptConfiguration, ModelConfiguration, ModelScriptConfiguration } from './types.mjs' */
|
|
1918
1996
|
/**
|
|
1919
1997
|
*
|
|
1920
1998
|
* @param {string | string[] | null | void} permission
|
|
@@ -1935,27 +2013,39 @@ declare function testPermissionConstraints(constraints: Permission["constraints"
|
|
|
1935
2013
|
/**
|
|
1936
2014
|
*
|
|
1937
2015
|
* @param {Permission} permission
|
|
1938
|
-
* @param {{has(permission: string): boolean}} permissions
|
|
1939
2016
|
* @param {Record<string, any>?} [data]
|
|
1940
2017
|
* @param {boolean} [isNew]
|
|
2018
|
+
* @param {string} [fieldName]
|
|
1941
2019
|
*/
|
|
1942
2020
|
declare function testPermission({
|
|
1943
2021
|
permission,
|
|
1944
2022
|
organizationField,
|
|
1945
2023
|
constraints
|
|
1946
|
-
}: Permission,
|
|
1947
|
-
has(permission: string): boolean;
|
|
1948
|
-
}, data?: Record<string, any> | null, isNew?: boolean): boolean;
|
|
2024
|
+
}: Permission, data?: Record<string, any> | null, isNew?: boolean, fieldName?: string): boolean;
|
|
1949
2025
|
/**
|
|
1950
2026
|
*
|
|
1951
2027
|
* @param {Permission[]} permissionList
|
|
1952
|
-
* @param {{has(permission: string): boolean}} permissions
|
|
1953
2028
|
* @param {Record<string, any>?} [data]
|
|
1954
2029
|
* @param {boolean} [isNew]
|
|
1955
2030
|
*/
|
|
1956
|
-
declare function getAuthorizations(permissionList: Permission[],
|
|
1957
|
-
|
|
1958
|
-
|
|
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>;
|
|
1959
2049
|
declare namespace Ident_d_exports {
|
|
1960
2050
|
export { decode, encode, parse, stringify };
|
|
1961
2051
|
}
|
|
@@ -1983,7 +2073,6 @@ declare function parse(ident: string): PageIdent;
|
|
|
1983
2073
|
declare function stringify(a: PageIdent): string;
|
|
1984
2074
|
//#endregion
|
|
1985
2075
|
//#region packages/web/request.d.mts
|
|
1986
|
-
declare const request: ARequest;
|
|
1987
2076
|
declare class ARequest extends DotRequest$1 {
|
|
1988
2077
|
/**
|
|
1989
2078
|
*
|
|
@@ -1993,6 +2082,7 @@ declare class ARequest extends DotRequest$1 {
|
|
|
1993
2082
|
*/
|
|
1994
2083
|
method(method: string, path?: string): this;
|
|
1995
2084
|
}
|
|
2085
|
+
declare const request: ARequest;
|
|
1996
2086
|
//#endregion
|
|
1997
2087
|
//#region packages/web/ResponseError.d.mts
|
|
1998
2088
|
declare class ResponseError extends Error {
|
|
@@ -2130,12 +2220,24 @@ declare let loadTheme: () => MaybePromise<Partial<Omit<Theme, "styleFiles"> & Re
|
|
|
2130
2220
|
//#region packages/web/configuration.d.mts
|
|
2131
2221
|
/** @type {Record<string, Plugin>} */
|
|
2132
2222
|
declare const plugins: Record<string, Plugin>;
|
|
2133
|
-
declare
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
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>;
|
|
2139
2241
|
//#endregion
|
|
2140
2242
|
//#region packages/web/dom.d.mts
|
|
2141
2243
|
/**
|
|
@@ -2197,4 +2299,4 @@ declare function updateHooks(hooks: Record<string, Hook.Define<Hooks>>): void;
|
|
|
2197
2299
|
/** @type {Hook<Hooks>} */
|
|
2198
2300
|
declare const allHooks: Hook<Hooks>;
|
|
2199
2301
|
//#endregion
|
|
2200
|
-
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,
|
|
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 };
|