@byteluck-fe/model-driven-engine 2.1.0-beta.4 → 2.1.0-sourcemap.10
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/common/Engine.js +44 -35
- package/dist/esm/common/Runtime.js +4 -0
- package/dist/esm/common/proxyState.js +13 -87
- package/dist/index.umd.js +8 -8
- package/dist/types/common/Engine.d.ts +2 -3
- package/dist/types/common/Runtime.d.ts +2 -1
- package/dist/types/common/proxyState.d.ts +2 -2
- package/package.json +3 -5
- package/dist/esm/common/SubTableSpeedUp.js +0 -17
- package/dist/types/common/SubTableSpeedUp.d.ts +0 -3
|
@@ -43,6 +43,7 @@ type EngineProps<T extends keyof LayoutControls = keyof LayoutControls> = {
|
|
|
43
43
|
type EventKeys = 'click' | 'click-finish' | 'wps-open' | 'wps-save' | 'wps-rename' | 'change' | 'schema-change' | 'search' | 'checked' | 'input' | 'focus' | 'blur' | 'list-change' | 'list-splice' | 'list-delete' | 'list-search' | 'list-mounted' | 'list-actions' | 'engine-mounted' | 'engine-submit' | 'engine-submit-params' | 'engine-submitted' | string;
|
|
44
44
|
declare class Engine extends Watcher<EventKeys> {
|
|
45
45
|
private store;
|
|
46
|
+
rawStore: Record<string, any>;
|
|
46
47
|
parent?: Engine;
|
|
47
48
|
runtime: Runtime;
|
|
48
49
|
isMounted: boolean;
|
|
@@ -68,7 +69,7 @@ declare class Engine extends Watcher<EventKeys> {
|
|
|
68
69
|
private _handlerArrayUpdate;
|
|
69
70
|
private _handlerObjectUpdate;
|
|
70
71
|
private applyPlugins;
|
|
71
|
-
listControlCreateRow<RowType extends ControlsKeys>(instance: RuntimeListControl, rowType: RowType):
|
|
72
|
+
listControlCreateRow<RowType extends ControlsKeys>(instance: RuntimeListControl, rowType: RowType): NonNullable<InstanceType<import("@byteluck-fe/model-driven-core").ControlsConstructor<RowType, "Runtime">>> | undefined;
|
|
72
73
|
listControlAddRow(instance: RuntimeListControl, rowType?: ControlsKeys): void;
|
|
73
74
|
emit(eventKey: EventKeys, payload: EventPayload): Promise<unknown[]>;
|
|
74
75
|
on(key: EventKeys, callback: Callback): void;
|
|
@@ -169,7 +170,5 @@ declare class Engine extends Watcher<EventKeys> {
|
|
|
169
170
|
getInstanceInSubtableHeader<T extends ControlsKeys>(instance: ControlRuntimeInstance<T> | RuntimeControl): ControlRuntimeInstance<T> | undefined;
|
|
170
171
|
setControlConfig(...args: Parameters<Runtime['registerControlConfig']>): Runtime;
|
|
171
172
|
getControlConfig(control: ControlsKeys): Readonly<Record<string, unknown>> | undefined;
|
|
172
|
-
initSubTableRowPropsFromInstanceHeaders(instance: RuntimeListControl): void;
|
|
173
|
-
initSubTableRowPropsFromProxySetNewValue(instance: RuntimeListControl, value: any[]): void;
|
|
174
173
|
}
|
|
175
174
|
export { Engine, EventPayload, SchemaEventPayload, EngineProps };
|
|
@@ -5,6 +5,7 @@ export interface RuntimeProps {
|
|
|
5
5
|
schema: SchemaBaseType | SchemaBaseType[];
|
|
6
6
|
beforeCreateInstance?: BeforeCreateInstance;
|
|
7
7
|
}
|
|
8
|
+
export type InstanceMap = Record<string, ControlRuntimeInstance<ControlsKeys>[]>;
|
|
8
9
|
export declare class Runtime extends RegisterControls<'Runtime'> {
|
|
9
10
|
private _schema;
|
|
10
11
|
private _instance;
|
|
@@ -15,7 +16,7 @@ export declare class Runtime extends RegisterControls<'Runtime'> {
|
|
|
15
16
|
get schema(): SchemaBaseType | SchemaBaseType[];
|
|
16
17
|
get instance(): ControlRuntimeInstance<ControlsKeys>[];
|
|
17
18
|
get flatInstances(): ControlRuntimeInstance<ControlsKeys>[];
|
|
18
|
-
get instanceMap():
|
|
19
|
+
get instanceMap(): InstanceMap;
|
|
19
20
|
get rules(): Record<string, RuleItem>;
|
|
20
21
|
get antdRules(): Record<string, RuleItem>;
|
|
21
22
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RuntimeControl, RuntimeFormControl, ControlRuntimeInstance } from '@byteluck-fe/model-driven-core';
|
|
2
|
-
import {
|
|
2
|
+
import { InstanceMap } from './Runtime';
|
|
3
3
|
export type ArrayApi = 'splice' | 'push' | 'shift' | 'pop' | 'unshift' | 'reverse';
|
|
4
4
|
/**
|
|
5
5
|
* @param state 当前正在操作的state数据
|
|
@@ -26,5 +26,5 @@ export declare function proxyState<T extends object>(state: T, callback: Callbac
|
|
|
26
26
|
* @param flatInstance 拍平的instance数组
|
|
27
27
|
* @param key 操作的数据在state的key - 可以是深层次的 subtable.0.input等
|
|
28
28
|
* */
|
|
29
|
-
export declare function findItem(flatInstance: RuntimeControl[], key: string,
|
|
29
|
+
export declare function findItem(flatInstance: RuntimeControl[], key: string, instanceMap: InstanceMap): undefined | RuntimeFormControl | ControlRuntimeInstance<'subtable'>;
|
|
30
30
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byteluck-fe/model-driven-engine",
|
|
3
|
-
"version": "2.1.0-
|
|
3
|
+
"version": "2.1.0-sourcemap.10",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "郝晨光 <2293885211@qq.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -22,14 +22,12 @@
|
|
|
22
22
|
"postpublish": "node ../../scripts/postpublish.js"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@byteluck-fe/model-driven-core": "2.1.0-
|
|
25
|
+
"@byteluck-fe/model-driven-core": "2.1.0-sourcemap.4",
|
|
26
26
|
"@byteluck-fe/model-driven-shared": "2.0.9",
|
|
27
|
-
"lodash.clonedeep": "^4.5.0",
|
|
28
27
|
"mathjs": "^11.3.3"
|
|
29
28
|
},
|
|
30
29
|
"devDependencies": {
|
|
31
|
-
"@types/lodash.clonedeep": "^4.5.7",
|
|
32
30
|
"@types/node": "~18.0.3"
|
|
33
31
|
},
|
|
34
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "8b896e9a670f9b9c4486e88949e893c34a60d8f4"
|
|
35
33
|
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// import { RuntimeSubTableColumnControl } from '@byteluck-fe/model-driven-core'
|
|
2
|
-
// import { RuntimeControl } from '@byteluck-fe/model-driven-core'
|
|
3
|
-
import cloneDeep from "lodash.clonedeep";
|
|
4
|
-
export function genSubTableRowInstanceFromHeaders(// headers: RuntimeSubTableColumnControl[]
|
|
5
|
-
headers) {
|
|
6
|
-
var subtableRow = headers.reduce(function(pre, cur) {
|
|
7
|
-
var children = cur.children;
|
|
8
|
-
children.forEach(function(control) {
|
|
9
|
-
pre[control.id] = copyPropsFromControlInstance(control);
|
|
10
|
-
});
|
|
11
|
-
return pre;
|
|
12
|
-
}, {});
|
|
13
|
-
return subtableRow;
|
|
14
|
-
}
|
|
15
|
-
export function copyPropsFromControlInstance(control) {
|
|
16
|
-
return cloneDeep(control.props);
|
|
17
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { RuntimeControl } from '@byteluck-fe/model-driven-core';
|
|
2
|
-
export declare function genSubTableRowInstanceFromHeaders(headers: any[]): any;
|
|
3
|
-
export declare function copyPropsFromControlInstance(control: RuntimeControl): import("@byteluck-fe/model-driven-core/dist/types/common/BaseControl/property").default;
|