@yongdall/web 0.4.1 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.mts +130 -31
- package/index.mjs +16 -16
- package/index.mjs.map +1 -1
- package/package.json +1 -1
package/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as dot_request1 from "dot-request";
|
|
2
2
|
import DotRequest, { default as DotRequest$1 } from "dot-request";
|
|
3
3
|
import { ArrayStore, BindObjectStore, ObjectStore, Schema, Schema as Schema$1, Store, Store as Store$1, StoreLayout, StoreLayout as StoreLayout$1, renderStore } from "@neeloong/form";
|
|
4
|
-
import { Hook, Indicator, Plugin, Search } from "@yongdall/common";
|
|
5
4
|
import { Field, MaybePromise, Permission, Permissions } from "@yongdall/types";
|
|
5
|
+
import { Hook, Indicator, Plugin, Search } from "@yongdall/common";
|
|
6
6
|
import { Signal as Signal$1 } from "signal-polyfill";
|
|
7
|
-
export * from "@yongdall/common";
|
|
8
7
|
export * from "@yongdall/types";
|
|
8
|
+
export * from "@yongdall/common";
|
|
9
9
|
|
|
10
10
|
//#region \0rolldown/runtime.js
|
|
11
11
|
//#endregion
|
|
@@ -97,6 +97,12 @@ declare function createComputed<T>(get: () => T, set?: (newValue: T) => void): S
|
|
|
97
97
|
* @returns {T}
|
|
98
98
|
*/
|
|
99
99
|
declare function createDeeply<T extends Record<string, any>>(state: State<T>, struct: Record<string, any>): T;
|
|
100
|
+
/**
|
|
101
|
+
*
|
|
102
|
+
* @param {number} interval
|
|
103
|
+
* @param {AbortSignal} [signal]
|
|
104
|
+
*/
|
|
105
|
+
declare function createTick(interval: number, signal?: AbortSignal): State<number>;
|
|
100
106
|
type State<T> = {
|
|
101
107
|
get: () => T;
|
|
102
108
|
set: (newValue: T) => void;
|
|
@@ -597,7 +603,7 @@ declare namespace Print {
|
|
|
597
603
|
/**
|
|
598
604
|
* - 文本对齐
|
|
599
605
|
*/
|
|
600
|
-
textAlign?: "left" | "
|
|
606
|
+
textAlign?: "left" | "center" | "right" | "justify" | "start" | "end" | undefined;
|
|
601
607
|
/**
|
|
602
608
|
* - 垂直对齐
|
|
603
609
|
*/
|
|
@@ -711,7 +717,7 @@ type PageConfiguration = {
|
|
|
711
717
|
title?: string | undefined;
|
|
712
718
|
titlePattern?: string | undefined;
|
|
713
719
|
config?: Record<string, any> | undefined;
|
|
714
|
-
fields?:
|
|
720
|
+
fields?: Field.Show[] | undefined;
|
|
715
721
|
sides?: {
|
|
716
722
|
widget: string;
|
|
717
723
|
options: string;
|
|
@@ -733,16 +739,6 @@ type PageConfiguration = {
|
|
|
733
739
|
operator: string;
|
|
734
740
|
}[] | undefined;
|
|
735
741
|
};
|
|
736
|
-
declare namespace PageConfiguration {
|
|
737
|
-
type Field = {
|
|
738
|
-
field?: string | undefined;
|
|
739
|
-
label?: string | undefined;
|
|
740
|
-
width?: number | undefined;
|
|
741
|
-
pattern?: string | undefined;
|
|
742
|
-
align?: "" | "left" | "right" | "center" | undefined;
|
|
743
|
-
enableLink?: boolean | undefined;
|
|
744
|
-
};
|
|
745
|
-
}
|
|
746
742
|
//#endregion
|
|
747
743
|
//#region packages/web/route/route.d.mts
|
|
748
744
|
type PageIdent = PageIdent.Model | PageIdent.Organization | PageIdent.User | PageIdent.Workspace | PageIdent.Page | PageIdent.Configuration;
|
|
@@ -1276,7 +1272,119 @@ declare namespace Command {
|
|
|
1276
1272
|
* @returns {DataSource}
|
|
1277
1273
|
*/
|
|
1278
1274
|
declare function buildDataSource(source?: any[] | Field.Source | null, model?: string | null, store?: Store$1 | null): DataSource;
|
|
1279
|
-
type DataSource =
|
|
1275
|
+
type DataSource = {
|
|
1276
|
+
/**
|
|
1277
|
+
* id字段(或模式)
|
|
1278
|
+
*/
|
|
1279
|
+
id?: string | null | undefined;
|
|
1280
|
+
/**
|
|
1281
|
+
* 标签字段(或模式)
|
|
1282
|
+
*/
|
|
1283
|
+
label?: string | null | undefined;
|
|
1284
|
+
/**
|
|
1285
|
+
* 值字段(或模式)
|
|
1286
|
+
*/
|
|
1287
|
+
value?: string | null | undefined;
|
|
1288
|
+
/**
|
|
1289
|
+
* 父节点字段(或模式)
|
|
1290
|
+
*/
|
|
1291
|
+
parent?: string | null | undefined;
|
|
1292
|
+
/**
|
|
1293
|
+
* 子列表
|
|
1294
|
+
*/
|
|
1295
|
+
children?: string | null | undefined;
|
|
1296
|
+
/**
|
|
1297
|
+
* 序列字段
|
|
1298
|
+
*/
|
|
1299
|
+
sequence?: string | null | undefined;
|
|
1300
|
+
/**
|
|
1301
|
+
* 禁用字段
|
|
1302
|
+
*/
|
|
1303
|
+
disabled?: string | null | undefined;
|
|
1304
|
+
/**
|
|
1305
|
+
* 显示字段
|
|
1306
|
+
*/
|
|
1307
|
+
fields?: Field.Show[] | null | undefined;
|
|
1308
|
+
/**
|
|
1309
|
+
* 快速过滤字段
|
|
1310
|
+
*/
|
|
1311
|
+
queryFilters?: {
|
|
1312
|
+
field: string;
|
|
1313
|
+
label?: string;
|
|
1314
|
+
operator: string;
|
|
1315
|
+
}[] | null | undefined;
|
|
1316
|
+
/**
|
|
1317
|
+
* 字段配置信息
|
|
1318
|
+
*/
|
|
1319
|
+
configurator: any;
|
|
1320
|
+
labels: {
|
|
1321
|
+
[x: string]: string;
|
|
1322
|
+
};
|
|
1323
|
+
options: DataSource.Option[];
|
|
1324
|
+
levelTree: (DataSource.Option & {
|
|
1325
|
+
level: number;
|
|
1326
|
+
})[];
|
|
1327
|
+
map: Record<string, any>;
|
|
1328
|
+
model?: string | null | undefined;
|
|
1329
|
+
service?: {
|
|
1330
|
+
then<TResult1 = ModelConfiguration | null, TResult2 = never>(onfulfilled?: ((value: ModelConfiguration | null) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
|
|
1331
|
+
catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<ModelConfiguration | TResult2 | null>;
|
|
1332
|
+
finally(onfinally?: (() => void) | null | undefined): Promise<ModelConfiguration | null>;
|
|
1333
|
+
query({
|
|
1334
|
+
values,
|
|
1335
|
+
where,
|
|
1336
|
+
orWhere,
|
|
1337
|
+
sort,
|
|
1338
|
+
limit,
|
|
1339
|
+
page,
|
|
1340
|
+
offset,
|
|
1341
|
+
select,
|
|
1342
|
+
total,
|
|
1343
|
+
primary
|
|
1344
|
+
}?: Search.Param): Promise<{
|
|
1345
|
+
documents: any[];
|
|
1346
|
+
total: number;
|
|
1347
|
+
}>;
|
|
1348
|
+
getOptions(): Record<string, any>[];
|
|
1349
|
+
/**
|
|
1350
|
+
* @overload
|
|
1351
|
+
* @param {boolean} [options]
|
|
1352
|
+
* @returns {Promise<Record<string, any>[]>}
|
|
1353
|
+
*/
|
|
1354
|
+
options(options?: boolean | undefined): Promise<Record<string, any>[]>;
|
|
1355
|
+
/**
|
|
1356
|
+
* @overload
|
|
1357
|
+
* @param {Search.Param} options
|
|
1358
|
+
* @returns {Promise<{options: Record<string, any>[]; total: number}>}
|
|
1359
|
+
*/
|
|
1360
|
+
options(options: Search.Param): Promise<{
|
|
1361
|
+
options: Record<string, any>[];
|
|
1362
|
+
total: number;
|
|
1363
|
+
}>;
|
|
1364
|
+
option(id: string | number): Promise<any>;
|
|
1365
|
+
create(data: Record<string, any>): Promise<any>;
|
|
1366
|
+
document(id: string | number): {
|
|
1367
|
+
then<TResult1 = Record<string, any>, TResult2 = never>(onfulfilled?: ((value: Record<string, any>) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
|
|
1368
|
+
catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<Record<string, any> | TResult2>;
|
|
1369
|
+
finally(onfinally?: (() => void) | null | undefined): Promise<Record<string, any>>;
|
|
1370
|
+
get: () => Promise<Record<string, any>>;
|
|
1371
|
+
update(data: Record<string, any>): Promise<any>;
|
|
1372
|
+
delete(): Promise<void>;
|
|
1373
|
+
field(field: string): {
|
|
1374
|
+
then<TResult1 = any, TResult2 = never>(onfulfilled?: ((value: any) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
|
|
1375
|
+
catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<any>;
|
|
1376
|
+
finally(onfinally?: (() => void) | null | undefined): Promise<any>;
|
|
1377
|
+
get: () => Promise<any>;
|
|
1378
|
+
};
|
|
1379
|
+
};
|
|
1380
|
+
loadModel: (force?: boolean) => Promise<ModelConfiguration | null>;
|
|
1381
|
+
loadScript: (force?: boolean) => Promise<ModelScriptConfiguration | null>;
|
|
1382
|
+
getModel: () => ModelConfiguration | null;
|
|
1383
|
+
getScript: () => ModelScriptConfiguration | null;
|
|
1384
|
+
} | null | undefined;
|
|
1385
|
+
where: (Search.Match | Search.Children)[];
|
|
1386
|
+
orWhere: (Search.Match | Search.Children | Search.Or)[];
|
|
1387
|
+
};
|
|
1280
1388
|
declare namespace DataSource {
|
|
1281
1389
|
type Option = {
|
|
1282
1390
|
id: string | number;
|
|
@@ -1287,17 +1395,6 @@ declare namespace DataSource {
|
|
|
1287
1395
|
disabled?: boolean | undefined;
|
|
1288
1396
|
children: DataSource.Option[];
|
|
1289
1397
|
};
|
|
1290
|
-
type Extends = {
|
|
1291
|
-
labels: {
|
|
1292
|
-
[x: string]: string;
|
|
1293
|
-
};
|
|
1294
|
-
options: DataSource.Option[];
|
|
1295
|
-
levelTree: (DataSource.Option & {
|
|
1296
|
-
level: number;
|
|
1297
|
-
})[];
|
|
1298
|
-
map: Record<string, any>;
|
|
1299
|
-
model?: string | null | undefined;
|
|
1300
|
-
};
|
|
1301
1398
|
}
|
|
1302
1399
|
//#endregion
|
|
1303
1400
|
//#region packages/web/typesDefine.d.mts
|
|
@@ -1305,6 +1402,8 @@ interface CurrentPage {
|
|
|
1305
1402
|
title: string;
|
|
1306
1403
|
icon: string;
|
|
1307
1404
|
print: Print;
|
|
1405
|
+
unsaved: boolean;
|
|
1406
|
+
loading: boolean;
|
|
1308
1407
|
}
|
|
1309
1408
|
interface VerifyError {
|
|
1310
1409
|
focus(): void;
|
|
@@ -1347,7 +1446,7 @@ interface ConfiguratorContext extends FieldContext {
|
|
|
1347
1446
|
root: HTMLElement;
|
|
1348
1447
|
}
|
|
1349
1448
|
interface FieldComponent<T extends Record<string, any> = Record<string, any>> {
|
|
1350
|
-
(ctx: FieldContext, options?: T):
|
|
1449
|
+
(ctx: FieldContext, options?: T): Element;
|
|
1351
1450
|
}
|
|
1352
1451
|
interface ConfiguratorComponent<T extends Record<string, any> = Record<string, any>> {
|
|
1353
1452
|
(ctx: ConfiguratorContext, options?: T): void;
|
|
@@ -1876,9 +1975,9 @@ declare function showFilterDialog(modelDefine: ModelScriptConfiguration, value?:
|
|
|
1876
1975
|
* @param {FieldStyle} style
|
|
1877
1976
|
* @param {any} [renderer]
|
|
1878
1977
|
* @param {StoreLayout.Options?} [options]
|
|
1879
|
-
* @returns {
|
|
1978
|
+
* @returns {Element?}
|
|
1880
1979
|
*/
|
|
1881
|
-
declare function createStoreField(store: Store$1<any, Field | null, any>, style: FieldStyle, renderer?: any, options?: StoreLayout$1.Options | null):
|
|
1980
|
+
declare function createStoreField(store: Store$1<any, Field | null, any>, style: FieldStyle, renderer?: any, options?: StoreLayout$1.Options | null): Element | null;
|
|
1882
1981
|
//#endregion
|
|
1883
1982
|
//#region packages/web/utils/toUrl.d.mts
|
|
1884
1983
|
/**
|
|
@@ -1920,7 +2019,7 @@ declare namespace code128_d_exports {
|
|
|
1920
2019
|
*
|
|
1921
2020
|
* @param {string} text
|
|
1922
2021
|
*/
|
|
1923
|
-
declare function encode$1(text: string):
|
|
2022
|
+
declare function encode$1(text: string): (0 | 1)[];
|
|
1924
2023
|
//#endregion
|
|
1925
2024
|
//#region packages/web/script/index.d.mts
|
|
1926
2025
|
/**
|
|
@@ -2444,4 +2543,4 @@ declare function updateHooks(hooks: Record<string, Hook.Define<Hooks>>): void;
|
|
|
2444
2543
|
/** @type {Hook<Hooks>} */
|
|
2445
2544
|
declare const allHooks: Hook<Hooks>;
|
|
2446
2545
|
//#endregion
|
|
2447
|
-
export { ArrayStore, Authenticator, BindObjectStore, code128_d_exports as Code128, Command, ConfiguratorComponent, ConfiguratorContext, type ContinuationDefine, CurrentPage, type DataSource, 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, Page, type PageConfiguration, type PageContext, type PageError, PageFooter, type PageHandle, PageHeader, PageIdent, type PageManager, type PageRenderer, PageSection, PageSectionParam, PageSider, Pagination, type Print, ResponseError, type Schema, Signal$1 as Signal, State, Store, type StoreLayout, SubmodelsLayoutEvent, Theme, User, UserHook, VerifyContext, VerifyError, type WorkspaceDefine, addManager, allHooks, application, buildDataSource, buildPlugin, createComputed, createDeeply, createFilters, createIcon, createQuickFilters, createShowField, createState, createStore, createStoreField, effect, enumerationsService, execScript, filterPermission, formLayoutsService, getAllFilterFns, getAuthorizations, getField, getFieldFilter, getFieldFilterOperators, getFilterFns, getPages, getPermissionFields, getPrimaryFields, hasField, hasFieldFilter, importStyle, importWidget, 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, showFilterDialog, start, testPermission, testPermissionConstraints, testPermissions, toFileLink, toFileURL, toId, toSchema, toUrl, updateHooks, waitAbortSignal, watch };
|
|
2546
|
+
export { ArrayStore, Authenticator, BindObjectStore, code128_d_exports as Code128, Command, ConfiguratorComponent, ConfiguratorContext, type ContinuationDefine, CurrentPage, type DataSource, 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, Page, type PageConfiguration, type PageContext, type PageError, PageFooter, type PageHandle, PageHeader, PageIdent, type PageManager, type PageRenderer, PageSection, PageSectionParam, PageSider, Pagination, type Print, ResponseError, type Schema, Signal$1 as Signal, State, Store, type StoreLayout, SubmodelsLayoutEvent, Theme, User, UserHook, VerifyContext, VerifyError, type WorkspaceDefine, addManager, allHooks, application, buildDataSource, buildPlugin, createComputed, createDeeply, createFilters, createIcon, createQuickFilters, createShowField, createState, createStore, createStoreField, createTick, effect, enumerationsService, execScript, filterPermission, formLayoutsService, getAllFilterFns, getAuthorizations, getField, getFieldFilter, getFieldFilterOperators, getFilterFns, getPages, getPermissionFields, getPrimaryFields, hasField, hasFieldFilter, importStyle, importWidget, 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, showFilterDialog, start, testPermission, testPermissionConstraints, testPermissions, toFileLink, toFileURL, toId, toSchema, toUrl, updateHooks, waitAbortSignal, watch };
|