@yongdall/web 0.6.1 → 0.6.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 +309 -52
- package/index.mjs +53 -51
- package/index.mjs.map +1 -1
- package/package.json +11 -5
- package/plugin.d.mts +1 -1
- package/yongdall.assets.json +18 -1
package/index.d.mts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import * as
|
|
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
4
|
import { Hook, Indicator, Plugin, Search } from "@yongdall/common";
|
|
5
5
|
import { Field, FormLayout, MaybePromise, PageForm, Permission, Permissions } from "@yongdall/types";
|
|
6
6
|
import { Signal as Signal$1 } from "signal-polyfill";
|
|
7
|
+
import { Cell, Workbook, Worksheet } from "exceljs";
|
|
7
8
|
export * from "@yongdall/common";
|
|
8
9
|
export * from "@yongdall/types";
|
|
9
10
|
|
|
10
11
|
//#region \0rolldown/runtime.js
|
|
11
12
|
//#endregion
|
|
12
|
-
//#region packages/web/signal.d.mts
|
|
13
|
+
//#region packages/web/data/signal.d.mts
|
|
13
14
|
/**
|
|
14
15
|
* @template T
|
|
15
16
|
*/
|
|
@@ -170,15 +171,15 @@ declare namespace Print {
|
|
|
170
171
|
/**
|
|
171
172
|
* - 文本对齐
|
|
172
173
|
*/
|
|
173
|
-
textAlign?: "left" | "center" | "right" | "
|
|
174
|
+
textAlign?: "left" | "center" | "right" | "end" | "start" | "justify" | undefined;
|
|
174
175
|
/**
|
|
175
176
|
* - 垂直对齐
|
|
176
177
|
*/
|
|
177
|
-
verticalAlign?: number | "sub" | "
|
|
178
|
+
verticalAlign?: number | "sub" | "bottom" | "middle" | "top" | "baseline" | "super" | "text-top" | "text-bottom" | undefined;
|
|
178
179
|
/**
|
|
179
180
|
* - 内边距属性对象
|
|
180
181
|
*/
|
|
181
|
-
padding?: Record<"left" | "right" | "
|
|
182
|
+
padding?: Record<"left" | "right" | "bottom" | "top", string | number> | undefined;
|
|
182
183
|
border?: Print.Border | undefined;
|
|
183
184
|
};
|
|
184
185
|
type Context = string | Print.Newline | Print.Image | Print.Barcode | Print.Counter;
|
|
@@ -757,6 +758,34 @@ declare function createProgressModal<T, R>(list: T[], exec: (item: T, signal: Ab
|
|
|
757
758
|
title?: string | undefined;
|
|
758
759
|
}): Promise<PromiseSettledResult<R>[]>;
|
|
759
760
|
//#endregion
|
|
761
|
+
//#region packages/web/data/GlobalState.d.mts
|
|
762
|
+
interface GlobalState {
|
|
763
|
+
[key: string | symbol]: any;
|
|
764
|
+
}
|
|
765
|
+
declare const GlobalState: Partial<GlobalState>;
|
|
766
|
+
//#endregion
|
|
767
|
+
//#region packages/web/data/EnvState.d.mts
|
|
768
|
+
interface EnvState {
|
|
769
|
+
user: string;
|
|
770
|
+
visitor: string;
|
|
771
|
+
organization: string;
|
|
772
|
+
application: string;
|
|
773
|
+
[key: string | symbol]: any;
|
|
774
|
+
}
|
|
775
|
+
declare const EnvState: Partial<EnvState>;
|
|
776
|
+
/**
|
|
777
|
+
* 设置环境变量(唯一合法的写入方式)
|
|
778
|
+
* @param key 环境变量的键名
|
|
779
|
+
* @param state 响应式 State 对象
|
|
780
|
+
*/
|
|
781
|
+
declare function setEnvState<K extends string | symbol>(key: K, state: State<EnvState[K]>): void;
|
|
782
|
+
//#endregion
|
|
783
|
+
//#region packages/web/data/DataBus.d.mts
|
|
784
|
+
interface DataBus {
|
|
785
|
+
[key: string | symbol]: any;
|
|
786
|
+
}
|
|
787
|
+
declare const DataBus: Partial<DataBus>;
|
|
788
|
+
//#endregion
|
|
760
789
|
//#region packages/web/services/page.d.mts
|
|
761
790
|
type PageConfiguration = {
|
|
762
791
|
id?: string | undefined;
|
|
@@ -791,6 +820,7 @@ type PageConfiguration = {
|
|
|
791
820
|
field: string;
|
|
792
821
|
label?: string;
|
|
793
822
|
operator: string;
|
|
823
|
+
state?: string;
|
|
794
824
|
}[] | undefined;
|
|
795
825
|
};
|
|
796
826
|
//#endregion
|
|
@@ -1503,7 +1533,7 @@ type DataSource = {
|
|
|
1503
1533
|
total: number;
|
|
1504
1534
|
}>;
|
|
1505
1535
|
option(id: string | number): Promise<any>;
|
|
1506
|
-
create(data: Record<string, any
|
|
1536
|
+
create(data: Record<string, any>, signal?: dot_request1.default.Signal): Promise<any>;
|
|
1507
1537
|
document(id: string | number): {
|
|
1508
1538
|
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>;
|
|
1509
1539
|
catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<Record<string, any> | TResult2>;
|
|
@@ -1541,26 +1571,12 @@ declare namespace DataSource {
|
|
|
1541
1571
|
}
|
|
1542
1572
|
//#endregion
|
|
1543
1573
|
//#region packages/web/request.d.mts
|
|
1544
|
-
/**
|
|
1545
|
-
* @callback ErrorAlerter
|
|
1546
|
-
* @param {*} error
|
|
1547
|
-
* @returns {PromiseLike<void> | void}
|
|
1548
|
-
*/
|
|
1549
|
-
/**
|
|
1550
|
-
* @param {*} error
|
|
1551
|
-
* @returns {PromiseLike<void> | void}
|
|
1552
|
-
*/
|
|
1553
|
-
declare function ErrorAlerter(error: any): PromiseLike<void> | void;
|
|
1554
|
-
type ErrorAlerter = (error: any) => PromiseLike<void> | void;
|
|
1555
1574
|
declare class ARequest extends DotRequest$1 {
|
|
1556
|
-
|
|
1557
|
-
*
|
|
1558
|
-
* @param {string} method
|
|
1559
|
-
* @param {string} [path]
|
|
1560
|
-
* @returns
|
|
1561
|
-
*/
|
|
1575
|
+
build(): ARequest;
|
|
1562
1576
|
method(method: string, path?: string): this;
|
|
1563
1577
|
}
|
|
1578
|
+
type ErrorAlerter = (error: any) => PromiseLike<void> | void;
|
|
1579
|
+
declare function ErrorAlerter(error: any): PromiseLike<void> | void;
|
|
1564
1580
|
declare const request: ARequest;
|
|
1565
1581
|
//#endregion
|
|
1566
1582
|
//#region packages/web/typesDefine.d.mts
|
|
@@ -1732,7 +1748,25 @@ type IconDefine = string | [path: string, viewBox?: string] | ((ctx: {
|
|
|
1732
1748
|
interface URIConverter {
|
|
1733
1749
|
(uri: string): MaybePromise<string | null>;
|
|
1734
1750
|
}
|
|
1751
|
+
interface NavButton {
|
|
1752
|
+
disabled?(ctx: NavButton.Context): boolean;
|
|
1753
|
+
hidden?(ctx: NavButton.Context): boolean;
|
|
1754
|
+
title?(ctx: NavButton.Context): string;
|
|
1755
|
+
label?(ctx: NavButton.Context): string;
|
|
1756
|
+
createIcon?(ctx: NavButton.Context): Element;
|
|
1757
|
+
createPanel?(ctx: NavButton.Context): HTMLElement;
|
|
1758
|
+
href?(ctx: NavButton.Context): string | null;
|
|
1759
|
+
click?(ctx: NavButton.Context): boolean | null | void;
|
|
1760
|
+
}
|
|
1761
|
+
declare namespace NavButton {
|
|
1762
|
+
interface Context {
|
|
1763
|
+
readonly shown: boolean;
|
|
1764
|
+
readonly signal: AbortSignal;
|
|
1765
|
+
}
|
|
1766
|
+
}
|
|
1735
1767
|
interface Hooks {
|
|
1768
|
+
navButton: NavButton | string | (() => MaybePromise<NavButton | NavButton[] | null>);
|
|
1769
|
+
navButtons: NavButton | string | (() => MaybePromise<NavButton | NavButton[] | null>);
|
|
1736
1770
|
uriConverters: Record<string, URIConverter>;
|
|
1737
1771
|
/** 自动加载的样式文件 */
|
|
1738
1772
|
styles: string;
|
|
@@ -1765,6 +1799,9 @@ interface Authenticator {
|
|
|
1765
1799
|
elements: Element | Element[];
|
|
1766
1800
|
/** 添加到根节点上的类名 */
|
|
1767
1801
|
rootClassName: string;
|
|
1802
|
+
required?: boolean;
|
|
1803
|
+
header?(): MaybePromise<Record<string, string>>;
|
|
1804
|
+
runHeader?(headers: Headers): MaybePromise<void>;
|
|
1768
1805
|
login(signal: AbortSignal): PromiseLike<void> | void;
|
|
1769
1806
|
}
|
|
1770
1807
|
declare namespace Component {
|
|
@@ -1890,9 +1927,10 @@ declare function modelService(model: string): {
|
|
|
1890
1927
|
/**
|
|
1891
1928
|
*
|
|
1892
1929
|
* @param {Record<string, any>} data
|
|
1930
|
+
* @param {DotRequest.Signal} [signal]
|
|
1893
1931
|
* @returns
|
|
1894
1932
|
*/
|
|
1895
|
-
create(data: Record<string, any
|
|
1933
|
+
create(data: Record<string, any>, signal?: DotRequest$1.Signal): Promise<any>;
|
|
1896
1934
|
/**
|
|
1897
1935
|
*
|
|
1898
1936
|
* @param {string | number} id
|
|
@@ -2404,9 +2442,9 @@ type WorkspaceDefine = ContinuationDefine & {
|
|
|
2404
2442
|
*/
|
|
2405
2443
|
/**
|
|
2406
2444
|
*
|
|
2407
|
-
* @param {{get(): Search.AndList, set(v: Search.AndList): void}} andList
|
|
2445
|
+
* @param {{get(): Search.AndList, set(v: Search.AndList): void; update(v: Search.AndList | null): void}} andList
|
|
2408
2446
|
* @param {HTMLElement} root
|
|
2409
|
-
* @param {{field: string; label?: string; operator: string}[]} filters
|
|
2447
|
+
* @param {{field: string; label?: string; operator: string; state?: string; sign?: boolean}[]} filters
|
|
2410
2448
|
* @param {object} options
|
|
2411
2449
|
* @param {Record<string, FieldScriptConfiguration>} options.fields
|
|
2412
2450
|
* @param {boolean} [options.inline]
|
|
@@ -2416,10 +2454,13 @@ type WorkspaceDefine = ContinuationDefine & {
|
|
|
2416
2454
|
declare function createQuickFilters(andList: {
|
|
2417
2455
|
get(): Search.AndList;
|
|
2418
2456
|
set(v: Search.AndList): void;
|
|
2457
|
+
update(v: Search.AndList | null): void;
|
|
2419
2458
|
}, root: HTMLElement, filters: {
|
|
2420
2459
|
field: string;
|
|
2421
2460
|
label?: string;
|
|
2422
2461
|
operator: string;
|
|
2462
|
+
state?: string;
|
|
2463
|
+
sign?: boolean;
|
|
2423
2464
|
}[], {
|
|
2424
2465
|
fields,
|
|
2425
2466
|
showLabel,
|
|
@@ -2514,12 +2555,6 @@ type FilterFns = {
|
|
|
2514
2555
|
};
|
|
2515
2556
|
//#endregion
|
|
2516
2557
|
//#region packages/web/form/toSchema.d.mts
|
|
2517
|
-
/**
|
|
2518
|
-
*
|
|
2519
|
-
* @param {Record<string, FieldScriptConfiguration>} fields
|
|
2520
|
-
* @param {FieldComponents} components
|
|
2521
|
-
* @param {Permission[]?} [permissions]
|
|
2522
|
-
*/
|
|
2523
2558
|
declare function toSchema(fields: Record<string, FieldScriptConfiguration>, components: FieldComponents, permissions?: Permission[] | null): Schema$1;
|
|
2524
2559
|
//#endregion
|
|
2525
2560
|
//#region packages/web/form/renderForm.d.mts
|
|
@@ -2659,14 +2694,33 @@ declare function waitAbortSignal(signal: AbortSignal | null | undefined, useReje
|
|
|
2659
2694
|
* @returns {Promise<void | never>}
|
|
2660
2695
|
*/
|
|
2661
2696
|
declare function waitAbortSignal(signal?: AbortSignal | null | undefined, useReject?: boolean | null | undefined): Promise<void | never>;
|
|
2697
|
+
//#endregion
|
|
2698
|
+
//#region packages/web/utils/image2data.d.mts
|
|
2699
|
+
declare function image2data(image: HTMLOrSVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | OffscreenCanvas | VideoFrame | ImageData): Promise<ImageData | null>;
|
|
2662
2700
|
declare namespace code128_d_exports {
|
|
2663
|
-
export { encode$
|
|
2701
|
+
export { encode$2 as encode };
|
|
2664
2702
|
}
|
|
2665
2703
|
/**
|
|
2666
2704
|
*
|
|
2667
2705
|
* @param {string} text
|
|
2668
2706
|
*/
|
|
2669
|
-
declare function encode$
|
|
2707
|
+
declare function encode$2(text: string): (0 | 1)[];
|
|
2708
|
+
declare namespace Qrcode_d_exports {
|
|
2709
|
+
export { decode$1 as decode, encode$1 as encode, scan };
|
|
2710
|
+
}
|
|
2711
|
+
declare function encode$1(text: string, level?: 'L' | 'M' | 'Q' | 'H'): Promise<number[]>;
|
|
2712
|
+
declare function decode$1(image: ImageData): Promise<{
|
|
2713
|
+
text: string;
|
|
2714
|
+
} | null>;
|
|
2715
|
+
declare function scan(signal?: AbortSignal): Promise<string | undefined>;
|
|
2716
|
+
declare namespace Media_d_exports {
|
|
2717
|
+
export { createVideoDialog, createVideoStream, stop };
|
|
2718
|
+
}
|
|
2719
|
+
declare function stop(stream: MediaStream): void;
|
|
2720
|
+
declare function createVideoStream(signal?: AbortSignal): Promise<MediaStream>;
|
|
2721
|
+
declare function createVideoDialog(signal?: AbortSignal): {
|
|
2722
|
+
[Symbol.asyncIterator](): AsyncGenerator<ImageData, void, unknown>;
|
|
2723
|
+
};
|
|
2670
2724
|
//#endregion
|
|
2671
2725
|
//#region packages/web/script/index.d.mts
|
|
2672
2726
|
/**
|
|
@@ -2710,7 +2764,7 @@ declare const _default: {
|
|
|
2710
2764
|
then<TResult1 = Permission$1[], TResult2 = never>(onfulfilled?: ((value: Permission$1[]) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
|
|
2711
2765
|
catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<Permission$1[] | TResult2>;
|
|
2712
2766
|
finally(onfinally?: (() => void) | null | undefined): Promise<Permission$1[]>;
|
|
2713
|
-
load: typeof load;
|
|
2767
|
+
load: typeof load$1;
|
|
2714
2768
|
get: typeof get;
|
|
2715
2769
|
};
|
|
2716
2770
|
type Permission$1 = ({
|
|
@@ -2724,7 +2778,7 @@ type Permission$1 = ({
|
|
|
2724
2778
|
*
|
|
2725
2779
|
* @param {boolean} [force]
|
|
2726
2780
|
*/
|
|
2727
|
-
declare function load(force?: boolean): Promise<Permission$1[]>;
|
|
2781
|
+
declare function load$1(force?: boolean): Promise<Permission$1[]>;
|
|
2728
2782
|
declare function get(): Permission$1[];
|
|
2729
2783
|
//#endregion
|
|
2730
2784
|
//#region packages/web/services/application.d.mts
|
|
@@ -2743,8 +2797,8 @@ declare const Application: {
|
|
|
2743
2797
|
loadMenus(force?: boolean): Promise<Menu.Define[]>;
|
|
2744
2798
|
readonly userMenus: Menu.Define[];
|
|
2745
2799
|
loadUserMenus(force?: boolean): Promise<Menu.Define[]>;
|
|
2746
|
-
loadPage(page: string): Promise<(() => Promise<
|
|
2747
|
-
loadContinuation(page: string): Promise<(() => Promise<
|
|
2800
|
+
loadPage(page: string): Promise<(() => Promise<any>) | null>;
|
|
2801
|
+
loadContinuation(page: string): Promise<(() => Promise<any>) | null>;
|
|
2748
2802
|
};
|
|
2749
2803
|
//#endregion
|
|
2750
2804
|
//#region packages/web/import.d.mts
|
|
@@ -2845,10 +2899,10 @@ declare function toId(document: Record<string, any>, model: ModelConfiguration |
|
|
|
2845
2899
|
//#region packages/web/icons/index.d.mts
|
|
2846
2900
|
/**
|
|
2847
2901
|
*
|
|
2848
|
-
* @param {string | string[]} key
|
|
2902
|
+
* @param {string | string[] | State<string | string[]>} key
|
|
2849
2903
|
* @param {AbortSignal | boolean} [signal]
|
|
2850
2904
|
*/
|
|
2851
|
-
declare function createIcon(key: string | string[]
|
|
2905
|
+
declare function createIcon(key: string | string[] | State<string | string[]>, signal?: AbortSignal | boolean): SVGSVGElement;
|
|
2852
2906
|
//#endregion
|
|
2853
2907
|
//#region packages/web/file.d.mts
|
|
2854
2908
|
/**
|
|
@@ -2974,9 +3028,9 @@ declare function testPermissions(authorization: string, permissions: Permission[
|
|
|
2974
3028
|
*/
|
|
2975
3029
|
declare function getPermissionFields(authorization: string, permissions: Permission[], model: ModelConfiguration | ModelScriptConfiguration): Set<string>;
|
|
2976
3030
|
declare namespace zip_d_exports {
|
|
2977
|
-
export { MIME, create, parse$1 as parse };
|
|
3031
|
+
export { MIME$1 as MIME, create, parse$1 as parse };
|
|
2978
3032
|
}
|
|
2979
|
-
declare const MIME: {
|
|
3033
|
+
declare const MIME$1: {
|
|
2980
3034
|
[key: string]: readonly string[];
|
|
2981
3035
|
};
|
|
2982
3036
|
/**
|
|
@@ -2986,6 +3040,214 @@ declare const MIME: {
|
|
|
2986
3040
|
*/
|
|
2987
3041
|
declare function parse$1(file: Blob | ArrayBuffer | ArrayBufferView<ArrayBuffer>): Promise<Record<string, Blob | null>>;
|
|
2988
3042
|
declare function create(files: Record<string, string | Blob | ArrayBuffer | ArrayBufferView<ArrayBuffer> | null>, name?: string): Promise<File>;
|
|
3043
|
+
declare namespace Sheet_d_exports {
|
|
3044
|
+
export { Alignment, Border, BorderStyle, Borders, CellDefine, Fill, FillPattern, FillPatterns, Font, MIME, RichTextDefine, RowColDefine, SheetDefine, array2sheet, colLetterToIndex, errors, fill, findActiveSheet, getCellValue, load, read, readCell, setCellValue, sheet2array, table2sheet, toBlob, toError, toSheetDefine };
|
|
3045
|
+
}
|
|
3046
|
+
/**
|
|
3047
|
+
* 富文本元素描述
|
|
3048
|
+
*/
|
|
3049
|
+
interface RichTextDefine {
|
|
3050
|
+
/** 文本内容 */
|
|
3051
|
+
text: string;
|
|
3052
|
+
/** XLSX 内的富文本格式,暂不考虑渲染 */
|
|
3053
|
+
font?: Partial<Font>;
|
|
3054
|
+
}
|
|
3055
|
+
/**
|
|
3056
|
+
* 单元格对象描述
|
|
3057
|
+
*/
|
|
3058
|
+
interface CellDefine {
|
|
3059
|
+
/** 单元格内的公式,不包含最前面的等号 */
|
|
3060
|
+
formula?: string;
|
|
3061
|
+
/** 单元格内的值,除非有错误,如果有公式,则为计算后的公式 */
|
|
3062
|
+
value: null | number | string | boolean | Date | {
|
|
3063
|
+
richText: RichTextDefine[];
|
|
3064
|
+
} | Error;
|
|
3065
|
+
/** 数字格式化字符串 */
|
|
3066
|
+
numFmt?: string;
|
|
3067
|
+
/** XLSX 单元格超链接,暂不考虑渲染 */
|
|
3068
|
+
hyperlink?: string;
|
|
3069
|
+
/** XLSX 单元格样式提示信息,暂不考虑渲染 */
|
|
3070
|
+
tooltip?: string;
|
|
3071
|
+
/** XLSX 单元格字体样式,暂不考虑渲染 */
|
|
3072
|
+
font?: Partial<Font>;
|
|
3073
|
+
/** XLSX 单元格对齐方式,暂不考虑渲染 */
|
|
3074
|
+
alignment?: Partial<Alignment>;
|
|
3075
|
+
/** XLSX 单元格边框样式,暂不考虑渲染 */
|
|
3076
|
+
border?: Partial<Borders>;
|
|
3077
|
+
/** XLSX 单元格填充样式,暂不考虑渲染 */
|
|
3078
|
+
fill?: Fill;
|
|
3079
|
+
/** 是否只读 */
|
|
3080
|
+
readonly?: boolean;
|
|
3081
|
+
}
|
|
3082
|
+
type BorderStyle = 'none' | 'double' | 'thin' | 'dotted' | 'hair' | 'medium' | 'thick' | 'dashed' | 'dashDot' | 'dashDotDot' | 'slantDashDot' | 'mediumDashed' | 'mediumDashDotDot' | 'mediumDashDot';
|
|
3083
|
+
interface Border {
|
|
3084
|
+
style: BorderStyle;
|
|
3085
|
+
color: string;
|
|
3086
|
+
}
|
|
3087
|
+
interface Borders {
|
|
3088
|
+
top?: Partial<Border>;
|
|
3089
|
+
left?: Partial<Border>;
|
|
3090
|
+
bottom?: Partial<Border>;
|
|
3091
|
+
right?: Partial<Border>;
|
|
3092
|
+
}
|
|
3093
|
+
type FillPatterns = 'none' | 'solid' | 'darkVertical' | 'darkHorizontal' | 'darkGrid' | 'darkTrellis' | 'darkDown' | 'darkUp' | 'lightVertical' | 'lightHorizontal' | 'lightGrid' | 'lightTrellis' | 'lightDown' | 'lightUp' | 'darkGray' | 'mediumGray' | 'lightGray' | 'gray125' | 'gray0625';
|
|
3094
|
+
interface FillPattern {
|
|
3095
|
+
type: 'pattern';
|
|
3096
|
+
pattern: FillPatterns;
|
|
3097
|
+
fgColor?: string;
|
|
3098
|
+
bgColor?: string;
|
|
3099
|
+
}
|
|
3100
|
+
type Fill = FillPattern;
|
|
3101
|
+
/**
|
|
3102
|
+
* 定义单元格文本对齐方式的配置对象。
|
|
3103
|
+
*/
|
|
3104
|
+
interface Alignment {
|
|
3105
|
+
/** 水平对齐方式 */
|
|
3106
|
+
horizontal: 'left' | 'center' | 'right' | 'fill' | 'justify' | 'centerContinuous' | 'distributed';
|
|
3107
|
+
/** 垂直对齐方式 */
|
|
3108
|
+
vertical: 'top' | 'middle' | 'bottom' | 'distributed' | 'justify';
|
|
3109
|
+
/** 是否自动换行 */
|
|
3110
|
+
wrapText: boolean;
|
|
3111
|
+
/** 是否缩小字体以适应单元格宽度 */
|
|
3112
|
+
shrinkToFit: boolean;
|
|
3113
|
+
/** 文本缩进级别(以字符为单位) */
|
|
3114
|
+
indent: number;
|
|
3115
|
+
/** 阅读顺序(从右到左或从左到右) */
|
|
3116
|
+
readingOrder: 'rtl' | 'ltr';
|
|
3117
|
+
/** 文本旋转角度(数字,单位为度)或 'vertical' 表示垂直堆叠 */
|
|
3118
|
+
textRotation: number | 'vertical';
|
|
3119
|
+
}
|
|
3120
|
+
interface Font {
|
|
3121
|
+
/** 字体名称 */
|
|
3122
|
+
name: string;
|
|
3123
|
+
/** 字体大小(通常以磅为单位) */
|
|
3124
|
+
size: number;
|
|
3125
|
+
/** 字体族编号(如 1 表示 Roman,2 表示 Swiss 等) */
|
|
3126
|
+
family: number;
|
|
3127
|
+
/** 字体方案类型 */
|
|
3128
|
+
scheme: 'minor' | 'major' | 'none';
|
|
3129
|
+
/** 字符集编码(如 0 表示 ANSI,134 表示 GB2312 等) */
|
|
3130
|
+
charset: number;
|
|
3131
|
+
/** 字体颜色,仅包含 Color 接口的部分属性 */
|
|
3132
|
+
color: string;
|
|
3133
|
+
/** 是否为粗体 */
|
|
3134
|
+
bold: boolean;
|
|
3135
|
+
/** 是否为斜体 */
|
|
3136
|
+
italic: boolean;
|
|
3137
|
+
/** 下划线样式 */
|
|
3138
|
+
underline: boolean | 'none' | 'single' | 'double' | 'singleAccounting' | 'doubleAccounting';
|
|
3139
|
+
/** 垂直对齐方式,可为上标或下标 */
|
|
3140
|
+
vertAlign: 'superscript' | 'subscript';
|
|
3141
|
+
/** 是否添加删除线 */
|
|
3142
|
+
strike: boolean;
|
|
3143
|
+
/** 是否使用轮廓字体 */
|
|
3144
|
+
outline: boolean;
|
|
3145
|
+
}
|
|
3146
|
+
/**
|
|
3147
|
+
* 行/列对象描述
|
|
3148
|
+
*/
|
|
3149
|
+
interface RowColDefine {
|
|
3150
|
+
hidden: boolean;
|
|
3151
|
+
size: number;
|
|
3152
|
+
/** 数字格式化字符串 */
|
|
3153
|
+
numFmt?: string;
|
|
3154
|
+
/** XLSX 单元格超链接,暂不考虑渲染 */
|
|
3155
|
+
hyperlink?: string;
|
|
3156
|
+
/** XLSX 单元格样式提示信息,暂不考虑渲染 */
|
|
3157
|
+
tooltip?: string;
|
|
3158
|
+
/** XLSX 单元格字体样式,暂不考虑渲染 */
|
|
3159
|
+
font?: Partial<Font>;
|
|
3160
|
+
/** XLSX 单元格对齐方式,暂不考虑渲染 */
|
|
3161
|
+
alignment?: Partial<Alignment>;
|
|
3162
|
+
/** XLSX 单元格边框样式,暂不考虑渲染 */
|
|
3163
|
+
border?: Partial<Borders>;
|
|
3164
|
+
/** XLSX 单元格填充样式,暂不考虑渲染 */
|
|
3165
|
+
fill?: Fill;
|
|
3166
|
+
}
|
|
3167
|
+
/**
|
|
3168
|
+
* 工作表对象描述
|
|
3169
|
+
*/
|
|
3170
|
+
interface SheetDefine {
|
|
3171
|
+
rows: RowColDefine[];
|
|
3172
|
+
cols: RowColDefine[];
|
|
3173
|
+
cells: CellDefine[][];
|
|
3174
|
+
frozen: string;
|
|
3175
|
+
merges: string[];
|
|
3176
|
+
}
|
|
3177
|
+
declare const errors: {
|
|
3178
|
+
nil: Error;
|
|
3179
|
+
div0: Error;
|
|
3180
|
+
value: Error;
|
|
3181
|
+
ref: Error;
|
|
3182
|
+
name: Error;
|
|
3183
|
+
num: Error;
|
|
3184
|
+
na: Error;
|
|
3185
|
+
error: Error;
|
|
3186
|
+
};
|
|
3187
|
+
declare function toError(text: string): Error;
|
|
3188
|
+
declare const MIME: {
|
|
3189
|
+
[key: string]: readonly string[];
|
|
3190
|
+
};
|
|
3191
|
+
declare function load(xlsx: Blob): Promise<Workbook>;
|
|
3192
|
+
declare function getCellValue(cell?: Cell): any;
|
|
3193
|
+
declare function setCellValue(cell?: Cell, value?: any): void;
|
|
3194
|
+
declare function findActiveSheet(workbook?: Workbook | null): Worksheet | null;
|
|
3195
|
+
/**
|
|
3196
|
+
* 将数组数据转换为工作表内容
|
|
3197
|
+
*/
|
|
3198
|
+
declare function array2sheet(sheet: Worksheet, data: any[], columns: {
|
|
3199
|
+
name: string;
|
|
3200
|
+
label?: string | null;
|
|
3201
|
+
}[], options?: {
|
|
3202
|
+
rowOffset?: number;
|
|
3203
|
+
colOffset?: number;
|
|
3204
|
+
}): Promise<void>;
|
|
3205
|
+
/**
|
|
3206
|
+
* 将二维表格数据写入工作表
|
|
3207
|
+
*/
|
|
3208
|
+
declare function table2sheet(sheet: Worksheet, table: any[][], {
|
|
3209
|
+
rowOffset,
|
|
3210
|
+
colOffset
|
|
3211
|
+
}?: {
|
|
3212
|
+
rowOffset?: number;
|
|
3213
|
+
colOffset?: number;
|
|
3214
|
+
}): Promise<void>;
|
|
3215
|
+
/**
|
|
3216
|
+
* 将工作表内容转换为二维数组
|
|
3217
|
+
*/
|
|
3218
|
+
declare function sheet2array(sheet?: Worksheet | null): Promise<any[][] | null>;
|
|
3219
|
+
/**
|
|
3220
|
+
* 读取工作簿中指定单元格的值
|
|
3221
|
+
*/
|
|
3222
|
+
declare function readCell(workbook: Workbook, sheet: string, cell: string): any;
|
|
3223
|
+
/**
|
|
3224
|
+
* 生成器:按字段读取工作簿中的单元格
|
|
3225
|
+
*/
|
|
3226
|
+
declare function read(workbook: Workbook, fields: {
|
|
3227
|
+
cell?: string;
|
|
3228
|
+
sheet: string;
|
|
3229
|
+
[key: string]: any;
|
|
3230
|
+
}[]): Iterable<[any, any]>;
|
|
3231
|
+
/**
|
|
3232
|
+
* 批量填充工作簿中的单元格
|
|
3233
|
+
*/
|
|
3234
|
+
declare function fill(workbook: Workbook, values: {
|
|
3235
|
+
sheet: string;
|
|
3236
|
+
cell: string;
|
|
3237
|
+
value: any;
|
|
3238
|
+
}[]): void;
|
|
3239
|
+
/**
|
|
3240
|
+
* 将工作簿转换为 Blob 文件
|
|
3241
|
+
*/
|
|
3242
|
+
declare function toBlob(workbook: Workbook, name?: string): Promise<File>;
|
|
3243
|
+
/**
|
|
3244
|
+
* 将列字母转换为索引
|
|
3245
|
+
*/
|
|
3246
|
+
declare function colLetterToIndex(colLetter: string): number;
|
|
3247
|
+
/**
|
|
3248
|
+
* 将 exceljs 工作表转换为自定义的 SheetDefine 对象
|
|
3249
|
+
*/
|
|
3250
|
+
declare function toSheetDefine(sheet: Worksheet): SheetDefine;
|
|
2989
3251
|
declare namespace Ident_d_exports {
|
|
2990
3252
|
export { decode, encode, parse, stringify, stringifyPaths };
|
|
2991
3253
|
}
|
|
@@ -3051,7 +3313,7 @@ declare function buildPlugin(pluginId: string): {
|
|
|
3051
3313
|
method(method: string, path?: string): /*elided*/any;
|
|
3052
3314
|
get version(): string;
|
|
3053
3315
|
buildResult(response: Promise<Response>): Result;
|
|
3054
|
-
clone<T extends
|
|
3316
|
+
clone<T extends dot_request1.default>(target: T): T;
|
|
3055
3317
|
clone(): /*elided*/any;
|
|
3056
3318
|
get(path?: string | undefined): /*elided*/any;
|
|
3057
3319
|
get(template: TemplateStringsArray, ...substitutions: any[]): /*elided*/any;
|
|
@@ -3111,7 +3373,7 @@ declare function buildPlugin(pluginId: string): {
|
|
|
3111
3373
|
errorHandler(eh: ErrorHandler | null): /*elided*/any;
|
|
3112
3374
|
parseJSON(fn: ((value: string) => any) | null): /*elided*/any;
|
|
3113
3375
|
create(): Request;
|
|
3114
|
-
fetch(fetch: Fetch): /*elided*/any;
|
|
3376
|
+
fetch(fetch: dot_request1.default.Fetch): /*elided*/any;
|
|
3115
3377
|
fetch(): Result;
|
|
3116
3378
|
ok(error?: ErrorHandler | null | undefined): Result;
|
|
3117
3379
|
text(): Promise<string>;
|
|
@@ -3168,13 +3430,8 @@ declare let List: Components["List"];
|
|
|
3168
3430
|
declare let Pagination$1: Components["Pagination"];
|
|
3169
3431
|
//#endregion
|
|
3170
3432
|
//#region packages/web/allHooks.d.mts
|
|
3171
|
-
/** @typedef {Object.<'main' | 'details' | 'setting' | 'input' | 'edit', string | PageRenderer>} ContinuationDefine */
|
|
3172
|
-
/**
|
|
3173
|
-
*
|
|
3174
|
-
* @param {Record<string, Hook.Define<Hooks>>} hooks
|
|
3175
|
-
*/
|
|
3176
|
-
declare function updateHooks(hooks: Record<string, Hook.Define<Hooks>>): void;
|
|
3177
|
-
/** @type {Hook<Hooks>} */
|
|
3178
3433
|
declare const allHooks: Hook<Hooks>;
|
|
3434
|
+
declare function updateHooks(hooks: Record<string, Hook.Define<Hooks>>): void;
|
|
3435
|
+
declare function loadNavButtons(): AsyncIterableIterator<NavButton>;
|
|
3179
3436
|
//#endregion
|
|
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 };
|
|
3437
|
+
export { Application, ArrayStore, Authenticator, BindObjectStore, code128_d_exports as Code128, Command, Component, Components, ConfiguratorComponent, ConfiguratorContext, type ContinuationDefine, CurrentPage, DataBus, type DataSource, DotRequest, EnvState, ErrorAlerter, FieldComponent, FieldComponentEvent, FieldComponents, FieldContext, FieldDefine, FieldFilter, FieldFilterComponent, FieldFilterContext, FieldFilterFns, FieldFilterOptions, FieldFilterStyle, type FieldScript, type FieldScriptConfiguration, FieldShowHandle, FieldStyle, FilterFns, FormFieldHook, FromRenderer, GeneralContext, GlobalPage, GlobalState, Guide, type HomeContext, Hooks, IconDefine, Ident_d_exports as Ident, List, type Match, Media_d_exports as Media, Menu, Modal, ModalFooter, ModalHeader, type ModelConfiguration, ModelIndicator, type ModelScript, type ModelScriptConfiguration, NavButton, ObjectStore, Page, type PageConfiguration, type PageContext, type PageError, PageFooter, PageFrame, type PageHandle, PageHeader, PageIdent, type PageManager, type PageRenderer, PageSection, PageSectionParam, PageSider, Pagination$1 as Pagination, type Print, Qrcode_d_exports as Qrcode, ResponseError, type Schema, Sheet_d_exports as Sheet, Signal$1 as Signal, State, Store, type StoreLayout, SubmodelsLayoutEvent, Theme, URIConverter, User, UserHook, VerifyContext, VerifyError, type WorkspaceDefine, zip_d_exports as ZIP, addManager, allHooks, boot, buildDataSource, buildPlugin, createComputed, createDeeply, createDocumentInModal, createFilters, createFrame, createIcon, createModal, createModelDefault, createNeverAbortedSignal, createProgressModal, createQuickFilters, createSafeComputed, createShowField, createState, createStore, createStoreField, createTick, effect, enumerationsService, execScript, filterPermission, flatPermission, formLayoutsService, getAllFilterFns, getAuthorizations, getField, getFieldFilter, getFieldFilterOperators, getFilterFns, getPages, getPermissionFields, getPrimaryFields, hasField, hasFieldFilter, image2data, importScript, importStyle, importWidget, isMac, isPluginId, loadNavButtons, modelService, pathRoots, _default as permissionsService, plugins, _default$1 as renderForm, renderStore, _default$2 as renderStoreForm, request, require$1 as require, root$1 as root, selectFile, setEnvState, setIcon, showDocumentInModal, _default$3 as showFilterDialog, showSortDialog, start, testPermission, testPermissionConstraints, testPermissions, toFileLink, toFileURL, toId, toPermissionFilter, toSchema, toUrl, updateHooks, waitAbortSignal, watch };
|