@byteluck-fe/model-driven-engine 2.7.0-beta.4 → 2.8.0-alpha.1a

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.
@@ -1,4 +1,4 @@
1
- import { ControlRuntimeInstance, ControlsInstance, ControlsKeys, DataBind, DeepPartial, LayoutControls, ObjectDataBind, RuntimeControl, RuntimeListControl, Schema } from '@byteluck-fe/model-driven-core';
1
+ import { ControlExport, ControlRuntimeInstance, ControlsInstance, ControlsKeys, DataBind, DeepPartial, LayoutControls, ObjectDataBind, RuntimeControl, RuntimeListControl, Schema } from '@byteluck-fe/model-driven-core';
2
2
  import { Callback, Watcher } from '@byteluck-fe/model-driven-shared';
3
3
  import { Plugin } from './Plugin';
4
4
  import { Runtime, RuntimeProps } from './Runtime';
@@ -60,8 +60,8 @@ declare class Engine extends Watcher<EventKeys> {
60
60
  private debugLog;
61
61
  use(plugin: Plugin): this;
62
62
  registerControl(...arg: Parameters<Runtime['register']>): this;
63
- static register(...arg: Parameters<(typeof Runtime)['register']>): typeof import("@byteluck-fe/model-driven-core").RegisterControls;
64
- static judgeControlIsRegistered(control: Parameters<(typeof Runtime)['register']>[0]): boolean;
63
+ static register(control: ControlExport): typeof import("@byteluck-fe/model-driven-core").RegisterControls;
64
+ static judgeControlIsRegistered(control: Parameters<typeof Runtime['register']>[0]): boolean;
65
65
  mount(): void;
66
66
  destroy(): void;
67
67
  private _handlerProxyState;
@@ -70,7 +70,7 @@ declare class Engine extends Watcher<EventKeys> {
70
70
  private _handlerArrayUpdate;
71
71
  private _handlerObjectUpdate;
72
72
  private applyPlugins;
73
- listControlCreateRow<RowType extends ControlsKeys>(instance: RuntimeListControl, rowType: RowType): NonNullable<InstanceType<import("@byteluck-fe/model-driven-core").ControlsConstructor<RowType, "Runtime">>> | undefined;
73
+ listControlCreateRow<RowType extends ControlsKeys>(instance: RuntimeListControl, rowType: RowType): RuntimeControl | NonNullable<InstanceType<import("@byteluck-fe/model-driven-core").ControlsConstructor<RowType, "Runtime">>> | undefined;
74
74
  listControlAddRow(instance: RuntimeListControl, rowType?: ControlsKeys): void;
75
75
  emit(eventKey: EventKeys, payload: EventPayload): Promise<unknown[]>;
76
76
  on(key: EventKeys, callback: Callback): void;
@@ -79,6 +79,7 @@ declare class Engine extends Watcher<EventKeys> {
79
79
  createControlInstance: <T extends never>(type: T, initSchema?: DeepPartial<Schema<T, InstanceType<import("@byteluck-fe/model-driven-core").Controls[T]["Property"]>>> | undefined) => InstanceType<import("@byteluck-fe/model-driven-core").ControlsConstructor<T, "Runtime">> | undefined;
80
80
  schemaEvent(eventKey: 'schema-change', payload: SchemaEventPayload): void;
81
81
  updateInstanceProps(instance: SchemaEventPayload['instance'] | string, props: string, value: unknown, rowIndex?: number): void;
82
+ getRule(controlType: string, props: any): any[];
82
83
  getAllRules(controlId?: string): {
83
84
  rules: import("async-validator").Rules | undefined;
84
85
  antdRules: import("async-validator").Rules | undefined;
@@ -105,7 +106,7 @@ declare class Engine extends Watcher<EventKeys> {
105
106
  * @param rowIndex 行下标 - 如果是明细子表中的控件需要提供
106
107
  * */
107
108
  getField(dataCode: string, fieldCode?: string, rowIndex?: number): unknown;
108
- getData(dataCode: string): ObjectDataBind | ObjectDataBind[] | undefined;
109
+ getData(dataCode: string): any;
109
110
  /**
110
111
  * 通过dataCode和fieldCode来设置控件的值
111
112
  * @param dataCode 模型编码 - 如果是主表的话就是主表的模型编码,明细子表的话就是子表的模型编码
@@ -164,6 +165,10 @@ declare class Engine extends Watcher<EventKeys> {
164
165
  * 判断控件的类型,返回当前控件的正确类型
165
166
  * */
166
167
  assertInstance<T extends ControlsKeys>(instance: ControlRuntimeInstance<ControlsKeys> | RuntimeControl, types: T | T[]): instance is ControlRuntimeInstance<T>;
168
+ /**
169
+ * 判断控件或控件类型是一个自定义控件
170
+ * */
171
+ assertInstanceIsCustomControl(instance: ControlRuntimeInstance<ControlsKeys> | RuntimeControl): boolean;
167
172
  /**
168
173
  * 获取控件在明细子表中的行下标,
169
174
  * 如果控件在表头内,则返回-1
@@ -10,6 +10,7 @@ export declare class Runtime extends RegisterControls<'Runtime'> {
10
10
  private _instance;
11
11
  private _flatInstances;
12
12
  private _instanceMap;
13
+ private _controlParentIdMap;
13
14
  constructor(props: RuntimeProps);
14
15
  getFlatInstances(): ControlRuntimeInstance<ControlsKeys>[];
15
16
  get schema(): any;
@@ -20,7 +20,8 @@ export declare class ES6ModulePlugin implements Plugin {
20
20
  private config;
21
21
  private engine;
22
22
  private env;
23
- constructor(config: ActionConfig, env: any);
23
+ private eventJs;
24
+ constructor(config: ActionConfig, env: any, eventJs?: any);
24
25
  apply(engine: Engine): void;
25
26
  }
26
27
  export declare function parseModule(action: ActionConfig, engine: Engine, env: any): Module | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byteluck-fe/model-driven-engine",
3
- "version": "2.7.0-beta.4",
3
+ "version": "2.8.0-alpha.1a",
4
4
  "description": "> TODO: description",
5
5
  "author": "郝晨光 <2293885211@qq.com>",
6
6
  "homepage": "",
@@ -26,13 +26,13 @@
26
26
  "postpublish": "node ../../scripts/postpublish.js"
27
27
  },
28
28
  "dependencies": {
29
- "@byteluck-fe/model-driven-core": "2.7.0-beta.4",
30
- "@byteluck-fe/model-driven-shared": "2.7.0-beta.4",
29
+ "@byteluck-fe/model-driven-core": "2.8.0-alpha.1a",
30
+ "@byteluck-fe/model-driven-shared": "2.7.0-alpha.36",
31
31
  "@types/mathjs": "^9.4.2",
32
32
  "mathjs": "^11.3.3"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/node": "~18.0.6"
36
36
  },
37
- "gitHead": "1bf9f693724f41f144a37e4f81f2c06dfe2069de"
37
+ "gitHead": "94f33265fbf14e4859f865af60018c9ec820550d"
38
38
  }