@byteluck-fe/model-driven-engine 6.2.0-1-beta.24 → 6.2.0-1-beta-tree-data.2

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,30 +1,30 @@
1
- import { RuntimeControl, RuntimeFormControl, ControlRuntimeInstance } from '@byteluck-fe/model-driven-core';
2
- import { InstanceMap } from './Runtime';
3
- export type ArrayApi = 'splice' | 'push' | 'shift' | 'pop' | 'unshift' | 'reverse';
4
- /**
5
- * @param state 当前正在操作的state数据
6
- * @param key 当前操作的state的key 这个key是从store.state开始的
7
- * @param type 如果state是数组,并且直接操作api的话,会携带type参数,代表当前操作的数组的某个api
8
- * @param args 如果state是数组,并且直接操作api的话,会携带args参数,代表当前操作的api的参数
9
- */
10
- type Callback = (state: object, key: string, type?: ArrayApi | unknown, args?: unknown[], result?: unknown) => void;
11
- type BeforeSetCallback = (state: object, key: string, newValue: unknown, oldValue: unknown) => never | unknown;
12
- export declare const engineProxyFlag: unique symbol;
13
- export declare const engineTargetKey: unique symbol;
14
- export declare const engineArrayBeforeSetCallbackFlag: unique symbol;
15
- export declare const engineProxyThisKey: unique symbol;
16
- /**
17
- * 代理state数据
18
- * @param state 数据对象
19
- * @param callback 触发set时候的回调函数
20
- * @param beforeSetCallback
21
- * @param prevKey 递归对象的key
22
- * */
23
- export declare function proxyState<T extends object>(state: T, callback: Callback, beforeSetCallback: BeforeSetCallback, prevKey?: string): T;
24
- /**
25
- * 在flatInstance中通过key查找出对应的instance
26
- * @param flatInstance 拍平的instance数组
27
- * @param key 操作的数据在state的key - 可以是深层次的 subtable.0.input等
28
- * */
29
- export declare function findItem(flatInstance: RuntimeControl[], key: string, instanceMap: InstanceMap): undefined | RuntimeFormControl | ControlRuntimeInstance<'subtable'>;
30
- export {};
1
+ import { RuntimeControl, RuntimeFormControl, ControlRuntimeInstance } from '@byteluck-fe/model-driven-core';
2
+ import { InstanceMap } from './Runtime';
3
+ export type ArrayApi = 'splice' | 'push' | 'shift' | 'pop' | 'unshift' | 'reverse';
4
+ /**
5
+ * @param state 当前正在操作的state数据
6
+ * @param key 当前操作的state的key 这个key是从store.state开始的
7
+ * @param type 如果state是数组,并且直接操作api的话,会携带type参数,代表当前操作的数组的某个api
8
+ * @param args 如果state是数组,并且直接操作api的话,会携带args参数,代表当前操作的api的参数
9
+ */
10
+ type Callback = (state: object, key: string, type?: ArrayApi | unknown, args?: unknown[], result?: unknown) => void;
11
+ type BeforeSetCallback = (state: object, key: string, newValue: unknown, oldValue: unknown) => never | unknown;
12
+ export declare const engineProxyFlag: unique symbol;
13
+ export declare const engineTargetKey: unique symbol;
14
+ export declare const engineArrayBeforeSetCallbackFlag: unique symbol;
15
+ export declare const engineProxyThisKey: unique symbol;
16
+ /**
17
+ * 代理state数据
18
+ * @param state 数据对象
19
+ * @param callback 触发set时候的回调函数
20
+ * @param beforeSetCallback
21
+ * @param prevKey 递归对象的key
22
+ * */
23
+ export declare function proxyState<T extends object>(state: T, callback: Callback, beforeSetCallback: BeforeSetCallback, prevKey?: string): T;
24
+ /**
25
+ * 在flatInstance中通过key查找出对应的instance
26
+ * @param flatInstance 拍平的instance数组
27
+ * @param key 操作的数据在state的key - 可以是深层次的 subtable.0.input等
28
+ * */
29
+ export declare function findItem(flatInstance: RuntimeControl[], key: string, instanceMap: InstanceMap): undefined | RuntimeFormControl | ControlRuntimeInstance<'subtable'>;
30
+ export {};
@@ -1,3 +1,3 @@
1
- export * from './common';
2
- export * from './plugins';
3
- export * from './utils';
1
+ export * from './common';
2
+ export * from './plugins';
3
+ export * from './utils';
@@ -1,121 +1,121 @@
1
- import { Engine, Plugin } from '../common';
2
- import { Language } from '@byteluck-fe/model-driven-core';
3
- declare enum DisplayType {
4
- /**
5
- * 完全等于
6
- */
7
- EQ = "EQ",
8
- /**
9
- * 包含
10
- * */
11
- IN = "IN"
12
- }
13
- interface DisplayItem {
14
- id: string;
15
- show_edit: boolean;
16
- explain: Language;
17
- control_id: string;
18
- control_in_subtable: boolean;
19
- type: DisplayType;
20
- option_ids: string[];
21
- is_remember: boolean;
22
- show_controls: string[];
23
- hide_controls: string[];
24
- }
25
- interface BehaviorItem {
26
- /**
27
- * 0: 不控制,走控件 1: 隐藏 2:只读 6:可编辑
28
- * */
29
- ctrlBehavior: 0 | 1 | 2 | 6;
30
- ctrlId: string;
31
- }
32
- interface CalcPluginProps {
33
- displayBoList: DisplayItem[];
34
- behavior: BehaviorItem[];
35
- }
36
- export declare class CalcPlugin implements Plugin {
37
- private engine;
38
- private options;
39
- /**
40
- * 所有的计算公式控件
41
- * */
42
- private calcControls;
43
- /**
44
- * key=控件id value=控件修改后需要触发重新计算的计算公式控件组成的数组
45
- * 存储为一个Map,用于在控件change的时候,重新计算依赖的calc
46
- * */
47
- private dependenciesTriggerMap;
48
- /**
49
- * 隐藏以后需要被计算的控件
50
- * */
51
- private hideNotRememberControlIds;
52
- private dontHasPermissionControlIds;
53
- private cacheComputedResult;
54
- constructor(options: CalcPluginProps);
55
- /**
56
- * @description 获取显隐控制的需要被记住值的控件id
57
- * */
58
- private getNeedHideRememberControlIds;
59
- /**
60
- * @description 获取权限控制的隐藏的字段,不需要参与计算
61
- * */
62
- private getDontHasPermissionControlIds;
63
- /**
64
- * @description 判断控件是否需要被计算
65
- * @param control 控件
66
- * */
67
- private controlNeedComputedValue;
68
- /**
69
- * @description 获取控件是否被隐藏
70
- * @param control 控件
71
- * */
72
- private getControlIsHide;
73
- apply(engine: Engine): void;
74
- /**
75
- * @description 重置依赖,获取所有的计算公式控件,并根据计算公式获取控件依赖关系
76
- * */
77
- private resetDependencies;
78
- /**
79
- * @description 执行所有计算公式控件的计算
80
- * */
81
- private allCalcControlComputed;
82
- /**
83
- * @description 获取所有的计算公式控件
84
- * */
85
- private getAllCalcControl;
86
- /**
87
- * @description 获取计算公式控件依赖,组成 依赖=>[计算公式] 的Map结构
88
- * */
89
- private getCalcDependencies;
90
- private setDependenciesTriggerMapItem;
91
- private getCalcControlsFromSubtableRows;
92
- /**
93
- * @description 监听控件的显隐事件,把显隐会影响的控件触发一遍计算
94
- * */
95
- private watchSchemaHideChange;
96
- /**
97
- * @description 监听明细子表的change事件,把明细表会影响的控件触发一遍计算
98
- * */
99
- private watchSubtableChange;
100
- /**
101
- * @description 监听控件的change事件,当控件change的时候,取到控件会影响的计算公式,然后执行对应的计算
102
- * */
103
- private watchControlChange;
104
- /**
105
- * @description 控件在明细子表内
106
- * */
107
- private controlInSubtable;
108
- /**
109
- * @description 执行计算公式的计算
110
- * */
111
- private computedCalcValue;
112
- /**
113
- * @description 获取数字值,因为计算公式可以依赖计算公式和金额,所以需要从value中取到对应的值
114
- * */
115
- private getNumberValue;
116
- /**
117
- * 计算明细子表最大值最小值平均值总和
118
- * */
119
- private getAggregateTypeValue;
120
- }
121
- export {};
1
+ import { Engine, Plugin } from '../common';
2
+ import { Language } from '@byteluck-fe/model-driven-core';
3
+ declare enum DisplayType {
4
+ /**
5
+ * 完全等于
6
+ */
7
+ EQ = "EQ",
8
+ /**
9
+ * 包含
10
+ * */
11
+ IN = "IN"
12
+ }
13
+ interface DisplayItem {
14
+ id: string;
15
+ show_edit: boolean;
16
+ explain: Language;
17
+ control_id: string;
18
+ control_in_subtable: boolean;
19
+ type: DisplayType;
20
+ option_ids: string[];
21
+ is_remember: boolean;
22
+ show_controls: string[];
23
+ hide_controls: string[];
24
+ }
25
+ interface BehaviorItem {
26
+ /**
27
+ * 0: 不控制,走控件 1: 隐藏 2:只读 6:可编辑
28
+ * */
29
+ ctrlBehavior: 0 | 1 | 2 | 6;
30
+ ctrlId: string;
31
+ }
32
+ interface CalcPluginProps {
33
+ displayBoList: DisplayItem[];
34
+ behavior: BehaviorItem[];
35
+ }
36
+ export declare class CalcPlugin implements Plugin {
37
+ private engine;
38
+ private options;
39
+ /**
40
+ * 所有的计算公式控件
41
+ * */
42
+ private calcControls;
43
+ /**
44
+ * key=控件id value=控件修改后需要触发重新计算的计算公式控件组成的数组
45
+ * 存储为一个Map,用于在控件change的时候,重新计算依赖的calc
46
+ * */
47
+ private dependenciesTriggerMap;
48
+ /**
49
+ * 隐藏以后需要被计算的控件
50
+ * */
51
+ private hideNotRememberControlIds;
52
+ private dontHasPermissionControlIds;
53
+ private cacheComputedResult;
54
+ constructor(options: CalcPluginProps);
55
+ /**
56
+ * @description 获取显隐控制的需要被记住值的控件id
57
+ * */
58
+ private getNeedHideRememberControlIds;
59
+ /**
60
+ * @description 获取权限控制的隐藏的字段,不需要参与计算
61
+ * */
62
+ private getDontHasPermissionControlIds;
63
+ /**
64
+ * @description 判断控件是否需要被计算
65
+ * @param control 控件
66
+ * */
67
+ private controlNeedComputedValue;
68
+ /**
69
+ * @description 获取控件是否被隐藏
70
+ * @param control 控件
71
+ * */
72
+ private getControlIsHide;
73
+ apply(engine: Engine): void;
74
+ /**
75
+ * @description 重置依赖,获取所有的计算公式控件,并根据计算公式获取控件依赖关系
76
+ * */
77
+ private resetDependencies;
78
+ /**
79
+ * @description 执行所有计算公式控件的计算
80
+ * */
81
+ private allCalcControlComputed;
82
+ /**
83
+ * @description 获取所有的计算公式控件
84
+ * */
85
+ private getAllCalcControl;
86
+ /**
87
+ * @description 获取计算公式控件依赖,组成 依赖=>[计算公式] 的Map结构
88
+ * */
89
+ private getCalcDependencies;
90
+ private setDependenciesTriggerMapItem;
91
+ private getCalcControlsFromSubtableRows;
92
+ /**
93
+ * @description 监听控件的显隐事件,把显隐会影响的控件触发一遍计算
94
+ * */
95
+ private watchSchemaHideChange;
96
+ /**
97
+ * @description 监听明细子表的change事件,把明细表会影响的控件触发一遍计算
98
+ * */
99
+ private watchSubtableChange;
100
+ /**
101
+ * @description 监听控件的change事件,当控件change的时候,取到控件会影响的计算公式,然后执行对应的计算
102
+ * */
103
+ private watchControlChange;
104
+ /**
105
+ * @description 控件在明细子表内
106
+ * */
107
+ private controlInSubtable;
108
+ /**
109
+ * @description 执行计算公式的计算
110
+ * */
111
+ private computedCalcValue;
112
+ /**
113
+ * @description 获取数字值,因为计算公式可以依赖计算公式和金额,所以需要从value中取到对应的值
114
+ * */
115
+ private getNumberValue;
116
+ /**
117
+ * 计算明细子表最大值最小值平均值总和
118
+ * */
119
+ private getAggregateTypeValue;
120
+ }
121
+ export {};
@@ -1,17 +1,17 @@
1
- import { Engine } from '../common/Engine';
2
- import { Plugin } from '../common/Plugin';
3
- import { CustomEventItem } from '@byteluck-fe/model-driven-shared';
4
- export type ControlsEvent = {
5
- [controlId: string]: {
6
- [eventName: string]: string[];
7
- };
8
- };
9
- export declare class ControlsEventPlugin implements Plugin {
10
- private config;
11
- private engine;
12
- private customEvents;
13
- constructor(config: ControlsEvent, customEvents: CustomEventItem[]);
14
- apply(engine: Engine): void;
15
- private engineAddEventListener;
16
- private callControlEvent;
17
- }
1
+ import { Engine } from '../common/Engine';
2
+ import { Plugin } from '../common/Plugin';
3
+ import { CustomEventItem } from '@byteluck-fe/model-driven-shared';
4
+ export type ControlsEvent = {
5
+ [controlId: string]: {
6
+ [eventName: string]: string[];
7
+ };
8
+ };
9
+ export declare class ControlsEventPlugin implements Plugin {
10
+ private config;
11
+ private engine;
12
+ private customEvents;
13
+ constructor(config: ControlsEvent, customEvents: CustomEventItem[]);
14
+ apply(engine: Engine): void;
15
+ private engineAddEventListener;
16
+ private callControlEvent;
17
+ }
@@ -1,27 +1,27 @@
1
- import { Engine, Plugin } from '../common';
2
- export type VariableMap = {
3
- [key: string]: any;
4
- };
5
- export type ActionConfig = {
6
- module: {
7
- compiled: string;
8
- source: string;
9
- type: 'FUNCTION';
10
- };
11
- };
12
- export type FuncMap = {
13
- [key: string]: Function;
14
- };
15
- export type Module = {
16
- funcMap: FuncMap;
17
- variables: VariableMap;
18
- };
19
- export declare class ES6ModulePlugin implements Plugin {
20
- private config;
21
- private engine;
22
- private env;
23
- private eventJs;
24
- constructor(config: ActionConfig, env: any, eventJs?: any);
25
- apply(engine: Engine): void;
26
- }
27
- export declare function parseModule(action: ActionConfig, engine: Engine, env: any): Module | undefined;
1
+ import { Engine, Plugin } from '../common';
2
+ export type VariableMap = {
3
+ [key: string]: any;
4
+ };
5
+ export type ActionConfig = {
6
+ module: {
7
+ compiled: string;
8
+ source: string;
9
+ type: 'FUNCTION';
10
+ };
11
+ };
12
+ export type FuncMap = {
13
+ [key: string]: Function;
14
+ };
15
+ export type Module = {
16
+ funcMap: FuncMap;
17
+ variables: VariableMap;
18
+ };
19
+ export declare class ES6ModulePlugin implements Plugin {
20
+ private config;
21
+ private engine;
22
+ private env;
23
+ private eventJs;
24
+ constructor(config: ActionConfig, env: any, eventJs?: any);
25
+ apply(engine: Engine): void;
26
+ }
27
+ export declare function parseModule(action: ActionConfig, engine: Engine, env: any): Module | undefined;
@@ -1,15 +1,15 @@
1
- import { Engine, Plugin } from '../common';
2
- export type LifecycleEvent = {
3
- did_init: string[];
4
- did_mount: string[];
5
- did_submit: string[];
6
- will_submit: string[];
7
- do_submit: string[];
8
- };
9
- export declare class LifecycleEventPlugin implements Plugin {
10
- private config;
11
- private engine;
12
- constructor(config: LifecycleEvent);
13
- apply(engine: Engine): void;
14
- private callLifecycleEvent;
15
- }
1
+ import { Engine, Plugin } from '../common';
2
+ export type LifecycleEvent = {
3
+ did_init: string[];
4
+ did_mount: string[];
5
+ did_submit: string[];
6
+ will_submit: string[];
7
+ do_submit: string[];
8
+ };
9
+ export declare class LifecycleEventPlugin implements Plugin {
10
+ private config;
11
+ private engine;
12
+ constructor(config: LifecycleEvent);
13
+ apply(engine: Engine): void;
14
+ private callLifecycleEvent;
15
+ }
@@ -1,13 +1,13 @@
1
- import { Engine, Plugin } from '../common';
2
- export type StyleConfig = {
3
- compiled: string;
4
- source: string;
5
- type: 'CSS';
6
- };
7
- export declare class StylePlugin implements Plugin {
8
- private config;
9
- private engine;
10
- private isPc;
11
- constructor(config: StyleConfig, isPC?: boolean);
12
- apply(engine: Engine): void;
13
- }
1
+ import { Engine, Plugin } from '../common';
2
+ export type StyleConfig = {
3
+ compiled: string;
4
+ source: string;
5
+ type: 'CSS';
6
+ };
7
+ export declare class StylePlugin implements Plugin {
8
+ private config;
9
+ private engine;
10
+ private isPc;
11
+ constructor(config: StyleConfig, isPC?: boolean);
12
+ apply(engine: Engine): void;
13
+ }
@@ -1,5 +1,5 @@
1
- export * from './ES6ModulePlugin';
2
- export * from './LifecycleEventPlugin';
3
- export * from './ControlsEventPlugin';
4
- export * from './CalcPlugin';
5
- export * from './StylePlugin';
1
+ export * from './ES6ModulePlugin';
2
+ export * from './LifecycleEventPlugin';
3
+ export * from './ControlsEventPlugin';
4
+ export * from './CalcPlugin';
5
+ export * from './StylePlugin';
@@ -1 +1 @@
1
- export * from './runtimeUtils';
1
+ export * from './runtimeUtils';
@@ -1,5 +1,5 @@
1
- import { ControlRuntimeInstance, ControlsKeys, RuntimeControl, RuntimeFormControl, RuntimeLayoutControl, RuntimeListControl, RuntimeSearchControl } from '@byteluck-fe/model-driven-core';
2
- export declare function hasChildrenControl(instance: RuntimeControl): instance is RuntimeLayoutControl | RuntimeListControl | RuntimeSearchControl;
3
- export declare function loopFormControl(control: RuntimeControl[], callback: (item: RuntimeFormControl | ControlRuntimeInstance<'subtable'>, children?: RuntimeFormControl[]) => any): void;
4
- export declare function loopDataViewControl(control: ControlRuntimeInstance<ControlsKeys>[], callback: (item: ControlRuntimeInstance<'data-view' | 'simple-search'>) => any): void;
5
- export declare function buildUUID(prefix?: string): string;
1
+ import { ControlRuntimeInstance, ControlsKeys, RuntimeControl, RuntimeFormControl, RuntimeLayoutControl, RuntimeListControl, RuntimeSearchControl } from '@byteluck-fe/model-driven-core';
2
+ export declare function hasChildrenControl(instance: RuntimeControl): instance is RuntimeLayoutControl | RuntimeListControl | RuntimeSearchControl;
3
+ export declare function loopFormControl(control: RuntimeControl[], callback: (item: RuntimeFormControl | ControlRuntimeInstance<'subtable'>, children?: RuntimeFormControl[]) => any): void;
4
+ export declare function loopDataViewControl(control: ControlRuntimeInstance<ControlsKeys>[], callback: (item: ControlRuntimeInstance<'data-view' | 'simple-search'>) => any): void;
5
+ export declare function buildUUID(prefix?: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byteluck-fe/model-driven-engine",
3
- "version": "6.2.0-1-beta.24",
3
+ "version": "6.2.0-1-beta-tree-data.2",
4
4
  "description": "> TODO: description",
5
5
  "author": "郝晨光 <2293885211@qq.com>",
6
6
  "homepage": "",
@@ -26,7 +26,7 @@
26
26
  "postpublish": "node ../../scripts/postpublish.js"
27
27
  },
28
28
  "dependencies": {
29
- "@byteluck-fe/model-driven-core": "6.2.0-1-beta.24",
29
+ "@byteluck-fe/model-driven-core": "6.2.0-1-beta-tree-data.2",
30
30
  "@byteluck-fe/model-driven-shared": "6.2.0-1-beta.24",
31
31
  "@types/mathjs": "^9.4.2",
32
32
  "mathjs": "^11.3.3",
@@ -37,5 +37,5 @@
37
37
  "@types/node": "~18.0.6",
38
38
  "@types/postcss-prefix-selector": "^1.16.3"
39
39
  },
40
- "gitHead": "3f9497ee491998a45f70103d0322218d1b7088ca"
40
+ "gitHead": "81f3e54c566513ac710a99d4192795026bfc7e65"
41
41
  }