@byteluck-fe/model-driven-engine 4.37.0-lx2 → 6.1.0-1-beta.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.
- package/dist/esm/common/DataManager.js +1 -0
- package/dist/esm/common/Engine.js +71 -137
- package/dist/esm/common/Runtime.js +7 -3
- package/dist/esm/common/Store.js +13 -10
- package/dist/esm/common/checkerValue.js +1 -1
- package/dist/esm/common/proxyState.js +34 -27
- package/dist/esm/plugins/ControlsEventPlugin.js +11 -1
- package/dist/esm/plugins/StylePlugin.js +16 -7
- package/dist/esm/utils/runtimeUtils.js +2 -1
- package/dist/index.umd.js +39 -7
- package/dist/types/common/Engine.d.ts +8 -16
- package/dist/types/common/proxyState.d.ts +3 -6
- package/dist/types/plugins/ControlsEventPlugin.d.ts +3 -1
- package/dist/types/plugins/StylePlugin.d.ts +2 -1
- package/package.json +9 -6
|
@@ -40,8 +40,12 @@ type EngineProps<T extends keyof LayoutControls = keyof LayoutControls> = {
|
|
|
40
40
|
autoMount?: boolean;
|
|
41
41
|
debug?: boolean;
|
|
42
42
|
externalParams?: Record<string, unknown>;
|
|
43
|
+
messagesI18n: any;
|
|
44
|
+
children: {
|
|
45
|
+
[key: string]: Engine;
|
|
46
|
+
};
|
|
43
47
|
};
|
|
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-before-insert' | 'list-search' | 'list-mounted' | 'list-actions' | 'engine-mounted' | 'engine-submit' | 'engine-submit-params' | 'engine-submitted' | string;
|
|
48
|
+
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-before-insert' | 'list-search' | 'list-mounted' | 'list-actions' | 'engine-mounted' | 'engine-submit' | 'engine-submit-params' | 'engine-submitted' | 'engine-initialized' | 'engine-after-initialized' | string;
|
|
45
49
|
declare class Engine extends Watcher<EventKeys> {
|
|
46
50
|
private store;
|
|
47
51
|
rawStore: Record<string, any>;
|
|
@@ -50,6 +54,9 @@ declare class Engine extends Watcher<EventKeys> {
|
|
|
50
54
|
isMounted: boolean;
|
|
51
55
|
id: string;
|
|
52
56
|
readonly externalParams?: Record<string, any>;
|
|
57
|
+
children: {
|
|
58
|
+
[key: string]: Engine;
|
|
59
|
+
};
|
|
53
60
|
private __plugins;
|
|
54
61
|
private __pluginsApplied;
|
|
55
62
|
private readonly $options;
|
|
@@ -107,8 +114,6 @@ declare class Engine extends Watcher<EventKeys> {
|
|
|
107
114
|
* @param states
|
|
108
115
|
*/
|
|
109
116
|
setStates(states: StatesType | StateType, rowIndex?: number, options?: any): void;
|
|
110
|
-
getTitleField(key: string): unknown;
|
|
111
|
-
getSystemField(key: string): any;
|
|
112
117
|
/**
|
|
113
118
|
* 通过dataCode和fieldCode来获取控件的值
|
|
114
119
|
* @param dataCode 模型编码 - 如果是主表的话就是主表的模型编码,明细子表的话就是子表的模型编码
|
|
@@ -164,19 +169,6 @@ declare class Engine extends Watcher<EventKeys> {
|
|
|
164
169
|
*/
|
|
165
170
|
getInstances(controlId?: string, header?: boolean): ControlRuntimeInstance<ControlsKeys>[];
|
|
166
171
|
setInstance(instance: SchemaEventPayload['instance'] | string, props: string, value: unknown, rowIndex?: number): void;
|
|
167
|
-
/**
|
|
168
|
-
* 前端二开新增方法,支持给多选控件动态赋值选项和默认值
|
|
169
|
-
* ctx.setInstance('zQX4ViR3c0', 'options', [{ label:'初级:N<2年', value: '初级' },{ label:'高级:N>2年', value: '高级' }]);
|
|
170
|
-
* ctx.setState('zQX4ViR3c0',['初级'])
|
|
171
|
-
* 将以上两个方法封装成一个新的方法setInstanceAndState
|
|
172
|
-
* ctx.setInstanceAndState('uexLafJeGH', 'options', [{ label:'初级:N<2年', value: '初级' ,checked: true},{ label:'初级:N>2年', value: '高级' }]);
|
|
173
|
-
* 可同时设置选项和默认值
|
|
174
|
-
* @param instance
|
|
175
|
-
* @param props
|
|
176
|
-
* @param value
|
|
177
|
-
* @param rowIndex
|
|
178
|
-
*/
|
|
179
|
-
setInstanceAndState(instance: SchemaEventPayload['instance'] | string, props: string, value: unknown, rowIndex?: number): void;
|
|
180
172
|
getControlIdMapping(): import("./Store").controlIdMappingType;
|
|
181
173
|
getDataBindMapping(): dataBindMappingType;
|
|
182
174
|
getDataBindMapping(dataCode: string): DataBindMappingTypeItem | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RuntimeFormControl, ControlRuntimeInstance } from '@byteluck-fe/model-driven-core';
|
|
2
|
-
import {
|
|
1
|
+
import { RuntimeControl, RuntimeFormControl, ControlRuntimeInstance } from '@byteluck-fe/model-driven-core';
|
|
2
|
+
import { InstanceMap } from './Runtime';
|
|
3
3
|
export type ArrayApi = 'splice' | 'push' | 'shift' | 'pop' | 'unshift' | 'reverse';
|
|
4
4
|
/**
|
|
5
5
|
* @param state 当前正在操作的state数据
|
|
@@ -26,8 +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(key: string,
|
|
30
|
-
instance: undefined | RuntimeFormControl | ControlRuntimeInstance<'subtable'>;
|
|
31
|
-
rowIndex: undefined | number;
|
|
32
|
-
};
|
|
29
|
+
export declare function findItem(flatInstance: RuntimeControl[], key: string, instanceMap: InstanceMap): undefined | RuntimeFormControl | ControlRuntimeInstance<'subtable'>;
|
|
33
30
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Engine } from '../common/Engine';
|
|
2
2
|
import { Plugin } from '../common/Plugin';
|
|
3
|
+
import { CustomEventItem } from '@byteluck-fe/model-driven-shared';
|
|
3
4
|
export type ControlsEvent = {
|
|
4
5
|
[controlId: string]: {
|
|
5
6
|
[eventName: string]: string[];
|
|
@@ -8,7 +9,8 @@ export type ControlsEvent = {
|
|
|
8
9
|
export declare class ControlsEventPlugin implements Plugin {
|
|
9
10
|
private config;
|
|
10
11
|
private engine;
|
|
11
|
-
|
|
12
|
+
private customEvents;
|
|
13
|
+
constructor(config: ControlsEvent, customEvents: CustomEventItem[]);
|
|
12
14
|
apply(engine: Engine): void;
|
|
13
15
|
private engineAddEventListener;
|
|
14
16
|
private callControlEvent;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byteluck-fe/model-driven-engine",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.1.0-1-beta.1",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "郝晨光 <2293885211@qq.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -26,13 +26,16 @@
|
|
|
26
26
|
"postpublish": "node ../../scripts/postpublish.js"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@byteluck-fe/model-driven-core": "
|
|
30
|
-
"@byteluck-fe/model-driven-shared": "
|
|
29
|
+
"@byteluck-fe/model-driven-core": "6.1.0-1-beta.1",
|
|
30
|
+
"@byteluck-fe/model-driven-shared": "6.1.0-1-beta.1",
|
|
31
31
|
"@types/mathjs": "^9.4.2",
|
|
32
|
-
"mathjs": "^11.3.3"
|
|
32
|
+
"mathjs": "^11.3.3",
|
|
33
|
+
"postcss": "^8.5.6",
|
|
34
|
+
"postcss-prefix-selector": "^2.1.1"
|
|
33
35
|
},
|
|
34
36
|
"devDependencies": {
|
|
35
|
-
"@types/node": "~18.0.6"
|
|
37
|
+
"@types/node": "~18.0.6",
|
|
38
|
+
"@types/postcss-prefix-selector": "^1.16.3"
|
|
36
39
|
},
|
|
37
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "f568b10a1d990a9b004146c172053abae6a7263b"
|
|
38
41
|
}
|