@byteluck-fe/model-driven-engine 2.2.0 → 2.2.1-test

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.
@@ -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;
@@ -169,5 +170,6 @@ 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;
173
+ inList(controlId: string): boolean;
172
174
  }
173
175
  export { Engine, EventPayload, SchemaEventPayload, EngineProps };
@@ -1,10 +1,10 @@
1
1
  import { RuleItem } from 'async-validator';
2
- import { ControlRuntimeInstance, Schema, ControlsKeys, RegisterControls, BeforeCreateInstance } from '@byteluck-fe/model-driven-core';
3
- type SchemaBaseType = Schema<ControlsKeys>;
2
+ import { ControlRuntimeInstance, ControlsKeys, RegisterControls, BeforeCreateInstance } from '@byteluck-fe/model-driven-core';
4
3
  export interface RuntimeProps {
5
- schema: SchemaBaseType | SchemaBaseType[];
4
+ schema: any;
6
5
  beforeCreateInstance?: BeforeCreateInstance;
7
6
  }
7
+ export type InstanceMap = Record<string, ControlRuntimeInstance<ControlsKeys>[]>;
8
8
  export declare class Runtime extends RegisterControls<'Runtime'> {
9
9
  private _schema;
10
10
  private _instance;
@@ -12,11 +12,10 @@ export declare class Runtime extends RegisterControls<'Runtime'> {
12
12
  private _instanceMap;
13
13
  constructor(props: RuntimeProps);
14
14
  getFlatInstances(): ControlRuntimeInstance<ControlsKeys>[];
15
- get schema(): SchemaBaseType | SchemaBaseType[];
15
+ get schema(): any;
16
16
  get instance(): ControlRuntimeInstance<ControlsKeys>[];
17
17
  get flatInstances(): ControlRuntimeInstance<ControlsKeys>[];
18
- get instanceMap(): Record<string, ControlRuntimeInstance<ControlsKeys>[]>;
18
+ get instanceMap(): InstanceMap;
19
19
  get rules(): Record<string, RuleItem>;
20
20
  get antdRules(): Record<string, RuleItem>;
21
21
  }
22
- export {};
@@ -1,4 +1,5 @@
1
1
  import { RuntimeControl, RuntimeFormControl, ControlRuntimeInstance } from '@byteluck-fe/model-driven-core';
2
+ import { InstanceMap } from './Runtime';
2
3
  export type ArrayApi = 'splice' | 'push' | 'shift' | 'pop' | 'unshift' | 'reverse';
3
4
  /**
4
5
  * @param state 当前正在操作的state数据
@@ -25,5 +26,5 @@ export declare function proxyState<T extends object>(state: T, callback: Callbac
25
26
  * @param flatInstance 拍平的instance数组
26
27
  * @param key 操作的数据在state的key - 可以是深层次的 subtable.0.input等
27
28
  * */
28
- export declare function findItem(flatInstance: RuntimeControl[], key: string): undefined | RuntimeFormControl | ControlRuntimeInstance<'subtable'>;
29
+ export declare function findItem(flatInstance: RuntimeControl[], key: string, instanceMap: InstanceMap): undefined | RuntimeFormControl | ControlRuntimeInstance<'subtable'>;
29
30
  export {};
@@ -1,4 +1,4 @@
1
1
  import { ControlRuntimeInstance, ControlsKeys, RuntimeControl, RuntimeFormControl, RuntimeLayoutControl, RuntimeListControl, RuntimeSearchControl } from '@byteluck-fe/model-driven-core';
2
2
  export declare function hasChildrenControl(instance: RuntimeControl): instance is RuntimeLayoutControl | RuntimeListControl | RuntimeSearchControl;
3
- export declare function loopFormControl(control: ControlRuntimeInstance<ControlsKeys>[], callback: (item: RuntimeFormControl | ControlRuntimeInstance<'subtable'>, children?: RuntimeFormControl[]) => any): void;
3
+ export declare function loopFormControl(control: RuntimeControl[], callback: (item: RuntimeFormControl | ControlRuntimeInstance<'subtable'>, children?: RuntimeFormControl[]) => any): void;
4
4
  export declare function loopDataViewControl(control: ControlRuntimeInstance<ControlsKeys>[], callback: (item: ControlRuntimeInstance<'data-view' | 'simple-search'>) => any): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byteluck-fe/model-driven-engine",
3
- "version": "2.2.0",
3
+ "version": "2.2.1-test",
4
4
  "description": "> TODO: description",
5
5
  "author": "郝晨光 <2293885211@qq.com>",
6
6
  "homepage": "",
@@ -33,5 +33,5 @@
33
33
  "devDependencies": {
34
34
  "@types/node": "~18.0.3"
35
35
  },
36
- "gitHead": "b74d4bd8e7b49ee0781de63b9919196562290f86"
36
+ "gitHead": "166bdd269fb815df0ce042e3252dc44914f830c9"
37
37
  }