@byteluck-fe/model-driven-core 2.7.0-alpha.13 → 2.7.0-alpha.15a
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/dist/esm/api-doc-index.js +4 -4
- package/dist/esm/common/BaseControl/designer.js +99 -243
- package/dist/esm/common/BaseControl/index.js +7 -7
- package/dist/esm/common/BaseControl/property.js +14 -42
- package/dist/esm/common/BaseControl/runtime.js +21 -41
- package/dist/esm/common/ColumnControl/designer.js +5 -19
- package/dist/esm/common/ColumnControl/index.js +6 -6
- package/dist/esm/common/ColumnControl/property.js +47 -95
- package/dist/esm/common/ColumnControl/runtime.js +5 -19
- package/dist/esm/common/ControlArray.js +21 -19
- package/dist/esm/common/FormControl/designer.js +10 -25
- package/dist/esm/common/FormControl/index.js +6 -6
- package/dist/esm/common/FormControl/property.js +95 -157
- package/dist/esm/common/FormControl/runtime.js +5 -20
- package/dist/esm/common/LayoutControl/designer.js +30 -158
- package/dist/esm/common/LayoutControl/index.js +6 -6
- package/dist/esm/common/LayoutControl/property.js +3 -3
- package/dist/esm/common/LayoutControl/runtime.js +7 -22
- package/dist/esm/common/ListControl/designer.js +29 -154
- package/dist/esm/common/ListControl/index.js +6 -6
- package/dist/esm/common/ListControl/property.js +6 -21
- package/dist/esm/common/ListControl/runtime.js +8 -23
- package/dist/esm/common/SearchViewControl/designer.js +5 -19
- package/dist/esm/common/SearchViewControl/index.js +6 -6
- package/dist/esm/common/SearchViewControl/property.js +4 -18
- package/dist/esm/common/SearchViewControl/runtime.js +5 -19
- package/dist/esm/common/Validator.js +5 -5
- package/dist/esm/common/WrapControl/designer.js +5 -19
- package/dist/esm/common/WrapControl/index.js +6 -6
- package/dist/esm/common/WrapControl/property.js +3 -3
- package/dist/esm/common/WrapControl/runtime.js +5 -19
- package/dist/esm/common/controlHooksEmitter.js +1 -1
- package/dist/esm/common/index.js +12 -12
- package/dist/esm/common/initLinkOperationRules.js +6 -6
- package/dist/esm/common/initOptionAndDataSourceRules.js +82 -82
- package/dist/esm/framework/RegisterControls.js +84 -33
- package/dist/esm/framework/index.js +332 -769
- package/dist/esm/index.js +4 -4
- package/dist/index.umd.js +1 -1
- package/dist/types/common/BaseControl/designer.d.ts +2 -5
- package/dist/types/common/BaseControl/property.d.ts +2 -0
- package/dist/types/common/BaseControl/runtime.d.ts +2 -1
- package/dist/types/common/ControlArray.d.ts +4 -3
- package/dist/types/common/ListControl/property.d.ts +1 -1
- package/dist/types/common/Validator.d.ts +1 -1
- package/dist/types/common/controlHooksEmitter.d.ts +1 -1
- package/dist/types/framework/RegisterControls.d.ts +4 -1
- package/dist/types/type.d.ts +23 -23
- package/package.json +3 -3
|
@@ -4,9 +4,11 @@ export interface BeforeCreateInstance {
|
|
|
4
4
|
(schema: any): any;
|
|
5
5
|
}
|
|
6
6
|
export declare class RegisterControls<Mode extends MODE> {
|
|
7
|
+
static readonly staticControlsRuntimeRules: Map<any, any>;
|
|
7
8
|
static readonly staticControls: ControlExport[];
|
|
8
9
|
static readonly staticRegisteredTypes: Set<string>;
|
|
9
10
|
static readonly staticRegisteredConfigs: Map<string, Record<string, unknown>>;
|
|
11
|
+
static staticGetRules(controlType: string, props: any): any[];
|
|
10
12
|
registeredControlTypes: Set<string>;
|
|
11
13
|
controlConfigMap: Map<string, Readonly<Record<string, unknown>>>;
|
|
12
14
|
protected _controls: ControlsConstructor<ControlsKeys, Mode>[];
|
|
@@ -14,7 +16,7 @@ export declare class RegisterControls<Mode extends MODE> {
|
|
|
14
16
|
constructor(type: Mode);
|
|
15
17
|
registerControlConfig(type: string, config: Record<string, unknown>): this;
|
|
16
18
|
getControlConfig(type: string): Readonly<Record<string, unknown>> | undefined;
|
|
17
|
-
static register(control: ControlExport): typeof RegisterControls;
|
|
19
|
+
static register(control: ControlExport, mode: MODE): typeof RegisterControls;
|
|
18
20
|
getControls(): ControlsConstructor<ControlsKeys, Mode>[];
|
|
19
21
|
register(control: ControlsConstructor<ControlsKeys, Mode>): this;
|
|
20
22
|
isLayoutControl(schema: Schema<any>): schema is LayoutControlSchema<any>;
|
|
@@ -27,6 +29,7 @@ export declare class RegisterControls<Mode extends MODE> {
|
|
|
27
29
|
createControl<T extends ControlsKeys>(schema: Schema<T> & {
|
|
28
30
|
type: T;
|
|
29
31
|
}, beforeCreateInstance?: BeforeCreateInstance): ControlsInstance<T, Mode>;
|
|
32
|
+
private _setParentPrototypeToSchema;
|
|
30
33
|
createControlInstance<T extends ControlsKeys>(type: T, initSchema?: DeepPartial<Schema<T>>): ControlsInstance<T, Mode> | undefined;
|
|
31
34
|
getControlFormType<T extends ControlsKeys>(type: T): ControlsConstructor<T, Mode> | undefined;
|
|
32
35
|
private _initControls;
|
package/dist/types/type.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { BaseControlProperty, LayoutControlProperty, Property, DesignerControl,
|
|
|
2
2
|
import { PAGE_STATUS } from './framework';
|
|
3
3
|
import { FieldTypes } from '@byteluck-fe/model-driven-shared';
|
|
4
4
|
import { WrapControlProperty } from './common/WrapControl';
|
|
5
|
-
export type SchemaUpgradeFunction = (schemaJSON: any, newVersion: string, oldVersion: string, payload?: any) => any;
|
|
5
|
+
export declare type SchemaUpgradeFunction = (schemaJSON: any, newVersion: string, oldVersion: string, payload?: any) => any;
|
|
6
6
|
export interface ExportedControl {
|
|
7
7
|
Property: typeof Property;
|
|
8
8
|
Designer: typeof DesignerControl;
|
|
@@ -32,26 +32,26 @@ export interface WrapControls {
|
|
|
32
32
|
}
|
|
33
33
|
export interface Controls extends BaseControls, FormControls, LayoutControls, ListControls, ColumnControls, SearchControls, WrapControls {
|
|
34
34
|
}
|
|
35
|
-
export type GetKeys<T extends string> = T extends never ? string : T;
|
|
36
|
-
export type MODE = 'Designer' | 'Runtime';
|
|
37
|
-
export type BaseControlsKeys = GetKeys<keyof BaseControls>;
|
|
38
|
-
export type FormControlsKeys = GetKeys<keyof FormControls>;
|
|
39
|
-
export type LayoutControlsKeys = GetKeys<keyof LayoutControls>;
|
|
40
|
-
export type ListControlsKeys = GetKeys<keyof ListControls>;
|
|
41
|
-
export type ColumnControlsKeys = GetKeys<keyof ColumnControls>;
|
|
42
|
-
export type SearchControlsKeys = GetKeys<keyof SearchControls>;
|
|
43
|
-
export type WrapControlsKeys = GetKeys<keyof WrapControls>;
|
|
44
|
-
export type ControlsKeys = GetKeys<keyof Controls>;
|
|
45
|
-
export type ControlExport = ExportedControl;
|
|
46
|
-
export type ControlDesigner<T extends ControlsKeys> = Controls[T]['Designer'];
|
|
47
|
-
export type ControlDesignerInstance<T extends ControlsKeys> = InstanceType<ControlDesigner<T>>;
|
|
48
|
-
export type ControlRuntime<T extends ControlsKeys> = Controls[T]['Runtime'];
|
|
49
|
-
export type ControlRuntimeInstance<T extends ControlsKeys> = InstanceType<ControlRuntime<T>>;
|
|
50
|
-
export type ControlProperty<T extends ControlsKeys> = Controls[T]['Property'];
|
|
51
|
-
export type ControlPropertyInstance<T extends ControlsKeys> = InstanceType<ControlProperty<T>>;
|
|
52
|
-
export type ControlsConstructor<T extends ControlsKeys, P extends MODE> = Controls[T][P];
|
|
53
|
-
export type ControlsInstance<T extends ControlsKeys, P extends MODE> = InstanceType<ControlsConstructor<T, P>>;
|
|
54
|
-
export type BaseControlTypes = 'layout' | 'form' | 'base' | 'list' | 'column' | 'search' | 'wrap';
|
|
35
|
+
export declare type GetKeys<T extends string> = T extends never ? string : T;
|
|
36
|
+
export declare type MODE = 'Designer' | 'Runtime';
|
|
37
|
+
export declare type BaseControlsKeys = GetKeys<keyof BaseControls>;
|
|
38
|
+
export declare type FormControlsKeys = GetKeys<keyof FormControls>;
|
|
39
|
+
export declare type LayoutControlsKeys = GetKeys<keyof LayoutControls>;
|
|
40
|
+
export declare type ListControlsKeys = GetKeys<keyof ListControls>;
|
|
41
|
+
export declare type ColumnControlsKeys = GetKeys<keyof ColumnControls>;
|
|
42
|
+
export declare type SearchControlsKeys = GetKeys<keyof SearchControls>;
|
|
43
|
+
export declare type WrapControlsKeys = GetKeys<keyof WrapControls>;
|
|
44
|
+
export declare type ControlsKeys = GetKeys<keyof Controls>;
|
|
45
|
+
export declare type ControlExport = ExportedControl;
|
|
46
|
+
export declare type ControlDesigner<T extends ControlsKeys> = Controls[T]['Designer'];
|
|
47
|
+
export declare type ControlDesignerInstance<T extends ControlsKeys> = InstanceType<ControlDesigner<T>>;
|
|
48
|
+
export declare type ControlRuntime<T extends ControlsKeys> = Controls[T]['Runtime'];
|
|
49
|
+
export declare type ControlRuntimeInstance<T extends ControlsKeys> = InstanceType<ControlRuntime<T>>;
|
|
50
|
+
export declare type ControlProperty<T extends ControlsKeys> = Controls[T]['Property'];
|
|
51
|
+
export declare type ControlPropertyInstance<T extends ControlsKeys> = InstanceType<ControlProperty<T>>;
|
|
52
|
+
export declare type ControlsConstructor<T extends ControlsKeys, P extends MODE> = Controls[T][P];
|
|
53
|
+
export declare type ControlsInstance<T extends ControlsKeys, P extends MODE> = InstanceType<ControlsConstructor<T, P>>;
|
|
54
|
+
export declare type BaseControlTypes = 'layout' | 'form' | 'base' | 'list' | 'column' | 'search' | 'wrap';
|
|
55
55
|
export interface BaseControlSchema<K extends ControlsKeys, T extends Property> {
|
|
56
56
|
id: string;
|
|
57
57
|
type: K;
|
|
@@ -85,7 +85,7 @@ export interface WrapControlSchema<K extends WrapControlsKeys, T extends WrapCon
|
|
|
85
85
|
controlType: 'wrap';
|
|
86
86
|
children: R[];
|
|
87
87
|
}
|
|
88
|
-
export type Schema<K extends ControlsKeys, T extends Property = InstanceType<Controls[K]['Property']>> = K extends FormControlsKeys ? FormControlSchema<K, T extends BaseControlProperty ? T : BaseControlProperty> : K extends LayoutControlsKeys ? LayoutControlSchema<K, T extends LayoutControlProperty ? T : LayoutControlProperty> : K extends ListControlsKeys ? ListControlSchema<K, T extends ListControlProperty<any> ? T : ListControlProperty<any>> : K extends ColumnControlsKeys ? ColumnControlSchema<K, T extends ColumnControlProperty ? T : ColumnControlProperty> : K extends SearchControlsKeys ? SearchControlSchema<K, T extends SearchControlProperty ? T : SearchControlProperty> : K extends WrapControlsKeys ? WrapControlSchema<K, T extends WrapControlProperty ? T : WrapControlProperty> : K extends BaseControlsKeys ? BaseControlSchema<K, T extends Property ? T : Property> : BaseControlSchema<K, T extends Property ? T : Property>;
|
|
89
|
-
export type DeepPartial<T> = {
|
|
88
|
+
export declare type Schema<K extends ControlsKeys, T extends Property = InstanceType<Controls[K]['Property']>> = K extends FormControlsKeys ? FormControlSchema<K, T extends BaseControlProperty ? T : BaseControlProperty> : K extends LayoutControlsKeys ? LayoutControlSchema<K, T extends LayoutControlProperty ? T : LayoutControlProperty> : K extends ListControlsKeys ? ListControlSchema<K, T extends ListControlProperty<any> ? T : ListControlProperty<any>> : K extends ColumnControlsKeys ? ColumnControlSchema<K, T extends ColumnControlProperty ? T : ColumnControlProperty> : K extends SearchControlsKeys ? SearchControlSchema<K, T extends SearchControlProperty ? T : SearchControlProperty> : K extends WrapControlsKeys ? WrapControlSchema<K, T extends WrapControlProperty ? T : WrapControlProperty> : K extends BaseControlsKeys ? BaseControlSchema<K, T extends Property ? T : Property> : BaseControlSchema<K, T extends Property ? T : Property>;
|
|
89
|
+
export declare type DeepPartial<T> = {
|
|
90
90
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
91
91
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byteluck-fe/model-driven-core",
|
|
3
|
-
"version": "2.7.0-alpha.
|
|
3
|
+
"version": "2.7.0-alpha.15a",
|
|
4
4
|
"description": "model engine core",
|
|
5
5
|
"author": "郝晨光 <2293885211@qq.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"postpublish": "node ../../scripts/postpublish.js"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@byteluck-fe/model-driven-shared": "2.7.0-alpha.
|
|
29
|
+
"@byteluck-fe/model-driven-shared": "2.7.0-alpha.15a",
|
|
30
30
|
"async-validator": "3.5.1",
|
|
31
31
|
"tslib": "^2.1.0"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "6f9495c0cc7715471d5eb38dc316ba6d470af141"
|
|
34
34
|
}
|