@neeloong/form 0.17.0 → 0.18.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/index.d.mts +71 -38
- package/index.full.js +568 -312
- package/index.full.min.js +4 -4
- package/index.full.min.mjs +2 -2
- package/index.min.mjs +2 -2
- package/index.mjs +566 -309
- package/package.json +1 -1
package/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @neeloong/form v0.
|
|
2
|
+
* @neeloong/form v0.18.0
|
|
3
3
|
* (c) 2024-2025 Fierflame
|
|
4
4
|
* @license Apache-2.0
|
|
5
5
|
*/
|
|
@@ -13,7 +13,7 @@ export { Signal } from 'signal-polyfill';
|
|
|
13
13
|
* @param {Layout.Options} [options] 解析选项
|
|
14
14
|
* @returns {Layout.Child[]}
|
|
15
15
|
*/
|
|
16
|
-
declare function parse(source: string, { createCalc, createInit, createEvent, simpleTag, enableHTML, }?: Options
|
|
16
|
+
declare function parse(source: string, { createCalc, createInit, createEvent, simpleTag, enableHTML, }?: Options): Child[];
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* 增强信息
|
|
@@ -39,7 +39,7 @@ type Enhancement$1 = {
|
|
|
39
39
|
/**
|
|
40
40
|
* 解析选项
|
|
41
41
|
*/
|
|
42
|
-
type Options
|
|
42
|
+
type Options = {
|
|
43
43
|
/**
|
|
44
44
|
* 启用 `!html` 指令
|
|
45
45
|
*/
|
|
@@ -349,12 +349,13 @@ type index_d_Enum = Enum;
|
|
|
349
349
|
type index_d_EventListener = EventListener;
|
|
350
350
|
type index_d_Fragment = Fragment;
|
|
351
351
|
declare const index_d_Node: typeof Node;
|
|
352
|
+
type index_d_Options = Options;
|
|
352
353
|
type index_d_Select = Select;
|
|
353
354
|
type index_d_Template = Template;
|
|
354
355
|
type index_d_Variable<T = unknown> = Variable<T>;
|
|
355
356
|
declare const index_d_parse: typeof parse;
|
|
356
357
|
declare namespace index_d {
|
|
357
|
-
export { type index_d_Calc as Calc, type index_d_CallTemplate as CallTemplate, type index_d_Child as Child, type index_d_Content as Content, type index_d_Divergent as Divergent, type index_d_DivergentChildren as DivergentChildren, type Enhancement$1 as Enhancement, type index_d_Enum as Enum, type index_d_EventListener as EventListener, type index_d_Fragment as Fragment, index_d_Node as Node, type
|
|
358
|
+
export { type index_d_Calc as Calc, type index_d_CallTemplate as CallTemplate, type index_d_Child as Child, type index_d_Content as Content, type index_d_Divergent as Divergent, type index_d_DivergentChildren as DivergentChildren, type Enhancement$1 as Enhancement, type index_d_Enum as Enum, type index_d_EventListener as EventListener, type index_d_Fragment as Fragment, index_d_Node as Node, type index_d_Options as Options, type index_d_Select as Select, type index_d_Template as Template, type index_d_Variable as Variable, index_d_parse as parse };
|
|
358
359
|
}
|
|
359
360
|
|
|
360
361
|
type VerifyError = any;
|
|
@@ -777,6 +778,65 @@ declare namespace Enhancement {
|
|
|
777
778
|
value: any;
|
|
778
779
|
};
|
|
779
780
|
}
|
|
781
|
+
type StoreLayout = {
|
|
782
|
+
html?: string | ParentNode | null | undefined;
|
|
783
|
+
fields?: StoreLayout.Item[] | null | undefined;
|
|
784
|
+
};
|
|
785
|
+
declare namespace StoreLayout {
|
|
786
|
+
type Action = "add" | "move" | "trigger" | "remove" | "serial";
|
|
787
|
+
type Field = {
|
|
788
|
+
type?: "field" | undefined;
|
|
789
|
+
colStart?: number | undefined;
|
|
790
|
+
colSpan?: number | undefined;
|
|
791
|
+
colEnd?: number | undefined;
|
|
792
|
+
rowStart?: number | undefined;
|
|
793
|
+
rowSpan?: number | undefined;
|
|
794
|
+
rowEnd?: number | undefined;
|
|
795
|
+
cell?: "" | "block" | "inline" | "collapse" | "base" | undefined;
|
|
796
|
+
field: string;
|
|
797
|
+
html?: string | ParentNode | null | undefined;
|
|
798
|
+
inlineHtml?: string | ParentNode | null | undefined;
|
|
799
|
+
fields?: StoreLayout.Item[] | null | undefined;
|
|
800
|
+
tableFoot?: "add" | "header" | "none" | undefined;
|
|
801
|
+
columns?: (string | StoreLayout.Action[])[] | undefined;
|
|
802
|
+
};
|
|
803
|
+
type Button = {
|
|
804
|
+
type: "button";
|
|
805
|
+
colStart?: number | undefined;
|
|
806
|
+
colSpan?: number | undefined;
|
|
807
|
+
colEnd?: number | undefined;
|
|
808
|
+
rowStart?: number | undefined;
|
|
809
|
+
rowSpan?: number | undefined;
|
|
810
|
+
rowEnd?: number | undefined;
|
|
811
|
+
cell?: "" | "block" | "inline" | "collapse" | "base" | undefined;
|
|
812
|
+
required?: boolean | undefined;
|
|
813
|
+
label?: string | undefined;
|
|
814
|
+
description?: string | undefined;
|
|
815
|
+
text?: string | undefined;
|
|
816
|
+
click?: string | ((event: Event, store: Store<any, any>, options?: StoreLayout.Options | null) => void) | undefined;
|
|
817
|
+
};
|
|
818
|
+
type Html = {
|
|
819
|
+
type: "html";
|
|
820
|
+
colStart?: number | undefined;
|
|
821
|
+
colSpan?: number | undefined;
|
|
822
|
+
colEnd?: number | undefined;
|
|
823
|
+
rowStart?: number | undefined;
|
|
824
|
+
rowSpan?: number | undefined;
|
|
825
|
+
rowEnd?: number | undefined;
|
|
826
|
+
cell?: "" | "content" | "block" | "inline" | "collapse" | undefined;
|
|
827
|
+
required?: boolean | undefined;
|
|
828
|
+
label?: string | undefined;
|
|
829
|
+
description?: string | undefined;
|
|
830
|
+
html?: string | ParentNode | null | undefined;
|
|
831
|
+
};
|
|
832
|
+
type Item = StoreLayout.Field | StoreLayout.Button | StoreLayout.Html;
|
|
833
|
+
type Options = {
|
|
834
|
+
relate?: ((store: Store, el: Element | Relatedness) => () => void) | undefined;
|
|
835
|
+
editable?: boolean | undefined;
|
|
836
|
+
call?: ((name: string, event: Event, store: Store<any, any>, options?: StoreLayout.Options | null) => void) | undefined;
|
|
837
|
+
};
|
|
838
|
+
type Renderer = (store: Store<any, any>, component: any, options?: StoreLayout.Options | null) => [HTMLElement, () => void] | null;
|
|
839
|
+
}
|
|
780
840
|
|
|
781
841
|
declare const ref: unique symbol;
|
|
782
842
|
type Ref = {
|
|
@@ -1174,35 +1234,6 @@ declare class ArrayStore<T = any, M = any> extends Store<(T | null)[], M> {
|
|
|
1174
1234
|
#private;
|
|
1175
1235
|
}
|
|
1176
1236
|
|
|
1177
|
-
type GridFormItemTemplateTableAction = "add" | "move" | "trigger" | "remove" | "serial";
|
|
1178
|
-
type GridFieldLayout = {
|
|
1179
|
-
field: string;
|
|
1180
|
-
fields?: GridFieldLayout[] | null | undefined;
|
|
1181
|
-
tableFoot?: "add" | "header" | "none" | undefined;
|
|
1182
|
-
columns?: (string | GridFormItemTemplateTableAction[])[] | undefined;
|
|
1183
|
-
colStart?: number | undefined;
|
|
1184
|
-
colSpan?: number | undefined;
|
|
1185
|
-
colEnd?: number | undefined;
|
|
1186
|
-
rowStart?: number | undefined;
|
|
1187
|
-
rowSpan?: number | undefined;
|
|
1188
|
-
rowEnd?: number | undefined;
|
|
1189
|
-
};
|
|
1190
|
-
type GridLayout = {
|
|
1191
|
-
fields?: GridFieldLayout[] | null | undefined;
|
|
1192
|
-
};
|
|
1193
|
-
type Options = object;
|
|
1194
|
-
type FieldRenderer = (store: Store<any, any>, component: any, Options: Options) => [HTMLElement, () => void];
|
|
1195
|
-
|
|
1196
|
-
/**
|
|
1197
|
-
*
|
|
1198
|
-
* @param {Store} store
|
|
1199
|
-
* @param {HTMLElement} root
|
|
1200
|
-
* @param {FieldRenderer} fieldRenderer
|
|
1201
|
-
* @param {boolean} editable
|
|
1202
|
-
* @param {GridLayout?} [layout]
|
|
1203
|
-
*/
|
|
1204
|
-
declare function _default(store: Store, root: HTMLElement, fieldRenderer: FieldRenderer, editable: boolean, layout?: GridLayout | null): () => void;
|
|
1205
|
-
|
|
1206
1237
|
/**
|
|
1207
1238
|
* @param {Store} store 存储实例
|
|
1208
1239
|
* @param {Layout.Child[]} layouts 布局信息
|
|
@@ -1245,12 +1276,14 @@ declare function effect(fn: () => void): () => void;
|
|
|
1245
1276
|
|
|
1246
1277
|
/**
|
|
1247
1278
|
*
|
|
1248
|
-
* @param {(store: Store<any, any>, component: any) => [HTMLElement, () => void]?} renderField
|
|
1249
1279
|
* @param {Store} store
|
|
1280
|
+
* @param {StoreLayout.Renderer} fieldRenderer
|
|
1250
1281
|
* @param {HTMLElement} root
|
|
1251
|
-
* @param {
|
|
1252
|
-
* @param {boolean} [
|
|
1282
|
+
* @param {StoreLayout?} [layout]
|
|
1283
|
+
* @param {StoreLayout.Options & {clone?: boolean} | null} [options]
|
|
1253
1284
|
*/
|
|
1254
|
-
declare function
|
|
1285
|
+
declare function renderStore(store: Store, fieldRenderer: StoreLayout.Renderer, root: HTMLElement, layout?: StoreLayout | null, options?: (StoreLayout.Options & {
|
|
1286
|
+
clone?: boolean;
|
|
1287
|
+
}) | null): () => void;
|
|
1255
1288
|
|
|
1256
|
-
export { ArrayStore, type AsyncValidator, Component, Enhancement,
|
|
1289
|
+
export { ArrayStore, type AsyncValidator, Component, Enhancement, index_d as Layout, ObjectStore, type Ref, type Relatedness, Schema, Store, StoreLayout, type Validator, type VerifyError, effect, render, renderStore, watch };
|