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

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.
@@ -30,6 +30,7 @@ interface SchemaEventPayload {
30
30
  instance: RuntimeControl;
31
31
  value: unknown;
32
32
  props: string;
33
+ rowIndex?: number;
33
34
  }
34
35
  type EngineProps<T extends keyof LayoutControls = keyof LayoutControls> = {
35
36
  schema: RuntimeProps['schema'];
@@ -43,6 +44,7 @@ type EngineProps<T extends keyof LayoutControls = keyof LayoutControls> = {
43
44
  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
45
  declare class Engine extends Watcher<EventKeys> {
45
46
  private store;
47
+ rawStore: Record<string, any>;
46
48
  parent?: Engine;
47
49
  runtime: Runtime;
48
50
  isMounted: boolean;
@@ -169,5 +171,6 @@ declare class Engine extends Watcher<EventKeys> {
169
171
  getInstanceInSubtableHeader<T extends ControlsKeys>(instance: ControlRuntimeInstance<T> | RuntimeControl): ControlRuntimeInstance<T> | undefined;
170
172
  setControlConfig(...args: Parameters<Runtime['registerControlConfig']>): Runtime;
171
173
  getControlConfig(control: ControlsKeys): Readonly<Record<string, unknown>> | undefined;
174
+ inList(controlId: string): boolean;
172
175
  }
173
176
  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.1",
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": "d191a1f30c7874dd1a3307ad5da87e7a6434abf5"
37
37
  }