@nocobase/flow-engine 2.1.0-alpha.45 → 2.1.0-alpha.46
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/lib/components/settings/wrappers/contextual/DefaultSettingsIcon.js +76 -31
- package/lib/components/subModel/LazyDropdown.js +17 -9
- package/lib/components/subModel/utils.d.ts +1 -0
- package/lib/components/subModel/utils.js +6 -2
- package/lib/executor/FlowExecutor.js +0 -3
- package/lib/flowContext.d.ts +6 -1
- package/lib/flowContext.js +35 -6
- package/lib/flowEngine.d.ts +4 -3
- package/lib/flowEngine.js +69 -37
- package/lib/models/flowModel.js +45 -13
- package/lib/runjs-context/contexts/FormJSFieldItemRunJSContext.js +4 -3
- package/lib/runjs-context/contexts/JSBlockRunJSContext.js +4 -15
- package/lib/runjs-context/contexts/JSColumnRunJSContext.js +5 -2
- package/lib/runjs-context/contexts/JSEditableFieldRunJSContext.js +5 -8
- package/lib/runjs-context/contexts/JSFieldRunJSContext.js +4 -3
- package/lib/runjs-context/contexts/JSItemRunJSContext.js +4 -3
- package/lib/runjs-context/contexts/base.js +464 -29
- package/lib/runjs-context/contexts/elementDoc.d.ts +11 -0
- package/lib/runjs-context/contexts/elementDoc.js +152 -0
- package/lib/utils/loadedPageCache.d.ts +24 -0
- package/lib/utils/loadedPageCache.js +139 -0
- package/package.json +4 -4
- package/src/__tests__/flowContext.test.ts +23 -0
- package/src/__tests__/flowEngine.moveModel.test.ts +81 -1
- package/src/__tests__/runjsContext.test.ts +18 -0
- package/src/__tests__/runjsContextImplementations.test.ts +9 -2
- package/src/__tests__/runjsLocales.test.ts +6 -5
- package/src/__tests__/viewScopedFlowEngine.test.ts +133 -0
- package/src/components/settings/wrappers/contextual/DefaultSettingsIcon.tsx +79 -37
- package/src/components/settings/wrappers/contextual/__tests__/DefaultSettingsIcon.test.tsx +150 -3
- package/src/components/subModel/LazyDropdown.tsx +16 -7
- package/src/components/subModel/__tests__/AddSubModelButton.test.tsx +51 -0
- package/src/components/subModel/utils.ts +6 -1
- package/src/executor/FlowExecutor.ts +0 -3
- package/src/executor/__tests__/flowExecutor.test.ts +2 -4
- package/src/flowContext.ts +40 -6
- package/src/flowEngine.ts +71 -35
- package/src/models/__tests__/flowModel.test.ts +13 -28
- package/src/models/flowModel.tsx +62 -29
- package/src/runjs-context/contexts/FormJSFieldItemRunJSContext.ts +4 -3
- package/src/runjs-context/contexts/JSBlockRunJSContext.ts +4 -15
- package/src/runjs-context/contexts/JSColumnRunJSContext.ts +4 -2
- package/src/runjs-context/contexts/JSEditableFieldRunJSContext.ts +5 -9
- package/src/runjs-context/contexts/JSFieldRunJSContext.ts +4 -3
- package/src/runjs-context/contexts/JSItemRunJSContext.ts +4 -3
- package/src/runjs-context/contexts/base.ts +467 -31
- package/src/runjs-context/contexts/elementDoc.ts +130 -0
- package/src/utils/loadedPageCache.ts +147 -0
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { FlowRunJSContext } from '../../flowContext';
|
|
11
|
+
import { createElementPropertyDoc, createZhCNElementPropertyDoc } from './elementDoc';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* RunJS context for JSEditableFieldModel (form editable custom field).
|
|
@@ -19,11 +20,9 @@ export class JSEditableFieldRunJSContext extends FlowRunJSContext {}
|
|
|
19
20
|
JSEditableFieldRunJSContext.define({
|
|
20
21
|
label: 'JSEditableField RunJS context',
|
|
21
22
|
properties: {
|
|
22
|
-
element:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
detail: 'ElementProxy',
|
|
26
|
-
},
|
|
23
|
+
element: createElementPropertyDoc(
|
|
24
|
+
'ElementProxy instance providing a safe DOM container for field rendering. In editable mode this container is typically a <span> element.',
|
|
25
|
+
),
|
|
27
26
|
value: {
|
|
28
27
|
description:
|
|
29
28
|
'Current field value (read-only snapshot). In editable scenarios, prefer ctx.getValue()/ctx.setValue(v) for two-way binding.',
|
|
@@ -69,10 +68,7 @@ JSEditableFieldRunJSContext.define(
|
|
|
69
68
|
{
|
|
70
69
|
label: 'JS 可编辑字段 RunJS 上下文',
|
|
71
70
|
properties: {
|
|
72
|
-
element:
|
|
73
|
-
description: 'ElementProxy,字段渲染的安全容器(通常为 <span> 容器)。',
|
|
74
|
-
detail: 'ElementProxy',
|
|
75
|
-
},
|
|
71
|
+
element: createZhCNElementPropertyDoc('ElementProxy,字段渲染的安全容器(通常为 <span> 容器)。'),
|
|
76
72
|
value: {
|
|
77
73
|
description: '字段当前值(只读快照)。可编辑场景建议使用 ctx.getValue()/ctx.setValue(v) 做双向绑定。',
|
|
78
74
|
detail: 'any',
|
|
@@ -8,14 +8,15 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { FlowRunJSContext } from '../../flowContext';
|
|
11
|
+
import { createElementPropertyDoc, createZhCNElementPropertyDoc } from './elementDoc';
|
|
11
12
|
|
|
12
13
|
export class JSFieldRunJSContext extends FlowRunJSContext {}
|
|
13
14
|
|
|
14
15
|
JSFieldRunJSContext.define({
|
|
15
16
|
label: 'JSField RunJS context',
|
|
16
17
|
properties: {
|
|
17
|
-
element: `ElementProxy instance providing a safe DOM container for field rendering.
|
|
18
|
-
Supports innerHTML, append, and other DOM manipulation methods
|
|
18
|
+
element: createElementPropertyDoc(`ElementProxy instance providing a safe DOM container for field rendering.
|
|
19
|
+
Supports innerHTML, append, and other DOM manipulation methods.`),
|
|
19
20
|
value: `Current value of the field (read-only).
|
|
20
21
|
Contains the data value stored in this field.`,
|
|
21
22
|
record: `Current record data object (read-only).
|
|
@@ -34,7 +35,7 @@ JSFieldRunJSContext.define(
|
|
|
34
35
|
{
|
|
35
36
|
label: 'JS 字段 RunJS 上下文',
|
|
36
37
|
properties: {
|
|
37
|
-
element: 'ElementProxy,字段渲染容器,支持 innerHTML/append 等 DOM 操作',
|
|
38
|
+
element: createZhCNElementPropertyDoc('ElementProxy,字段渲染容器,支持 innerHTML/append 等 DOM 操作'),
|
|
38
39
|
value: '字段当前值(只读)',
|
|
39
40
|
record: '当前记录对象(只读,包含父记录全部字段值)',
|
|
40
41
|
collection: '集合定义元数据(只读,描述字段所属集合的 Schema)',
|
|
@@ -8,14 +8,15 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { FlowRunJSContext } from '../../flowContext';
|
|
11
|
+
import { createElementPropertyDoc, createZhCNElementPropertyDoc } from './elementDoc';
|
|
11
12
|
|
|
12
13
|
export class JSItemRunJSContext extends FlowRunJSContext {}
|
|
13
14
|
|
|
14
15
|
JSItemRunJSContext.define({
|
|
15
16
|
label: 'JSItem RunJS context',
|
|
16
17
|
properties: {
|
|
17
|
-
element: `ElementProxy instance providing a safe DOM container for form item rendering.
|
|
18
|
-
Supports innerHTML, append, and other DOM manipulation methods
|
|
18
|
+
element: createElementPropertyDoc(`ElementProxy instance providing a safe DOM container for form item rendering.
|
|
19
|
+
Supports innerHTML, append, and other DOM manipulation methods.`),
|
|
19
20
|
resource: `Current resource instance (read-only).
|
|
20
21
|
Provides access to the data resource associated with the current form context.`,
|
|
21
22
|
record: `Current record data object (read-only).
|
|
@@ -36,7 +37,7 @@ JSItemRunJSContext.define(
|
|
|
36
37
|
{
|
|
37
38
|
label: 'JS 表单项 RunJS 上下文',
|
|
38
39
|
properties: {
|
|
39
|
-
element: 'ElementProxy,表单项渲染容器,支持 innerHTML/append 等 DOM 操作',
|
|
40
|
+
element: createZhCNElementPropertyDoc('ElementProxy,表单项渲染容器,支持 innerHTML/append 等 DOM 操作'),
|
|
40
41
|
resource: '当前资源(只读)',
|
|
41
42
|
record: '当前记录(只读)',
|
|
42
43
|
formValues: {
|