@nocobase/flow-engine 2.1.0-beta.9 → 2.2.0-alpha.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/lib/FlowContextProvider.d.ts +5 -1
- package/lib/FlowContextProvider.js +9 -2
- package/lib/components/FieldModelRenderer.js +2 -2
- package/lib/components/FlowModelRenderer.d.ts +3 -1
- package/lib/components/FlowModelRenderer.js +12 -6
- package/lib/components/FormItem.d.ts +6 -0
- package/lib/components/FormItem.js +11 -3
- package/lib/components/MobilePopup.js +6 -5
- package/lib/components/dnd/gridDragPlanner.d.ts +59 -2
- package/lib/components/dnd/gridDragPlanner.js +607 -19
- package/lib/components/dnd/index.d.ts +31 -2
- package/lib/components/dnd/index.js +244 -23
- package/lib/components/settings/wrappers/component/SelectWithTitle.d.ts +2 -1
- package/lib/components/settings/wrappers/component/SelectWithTitle.js +14 -12
- package/lib/components/settings/wrappers/contextual/DefaultSettingsIcon.d.ts +3 -0
- package/lib/components/settings/wrappers/contextual/DefaultSettingsIcon.js +152 -42
- package/lib/components/settings/wrappers/contextual/FlowsFloatContextMenu.d.ts +23 -43
- package/lib/components/settings/wrappers/contextual/FlowsFloatContextMenu.js +352 -295
- package/lib/components/settings/wrappers/contextual/useFloatToolbarPortal.d.ts +36 -0
- package/lib/components/settings/wrappers/contextual/useFloatToolbarPortal.js +274 -0
- package/lib/components/settings/wrappers/contextual/useFloatToolbarVisibility.d.ts +30 -0
- package/lib/components/settings/wrappers/contextual/useFloatToolbarVisibility.js +315 -0
- package/lib/components/subModel/AddSubModelButton.js +12 -1
- package/lib/components/subModel/LazyDropdown.js +301 -52
- package/lib/components/subModel/index.d.ts +1 -0
- package/lib/components/subModel/index.js +19 -0
- package/lib/components/subModel/utils.d.ts +2 -1
- package/lib/components/subModel/utils.js +15 -5
- package/lib/components/variables/VariableHybridInput.d.ts +27 -0
- package/lib/components/variables/VariableHybridInput.js +499 -0
- package/lib/components/variables/index.d.ts +2 -0
- package/lib/components/variables/index.js +3 -0
- package/lib/data-source/index.d.ts +84 -0
- package/lib/data-source/index.js +269 -7
- package/lib/executor/FlowExecutor.js +6 -3
- package/lib/flow-registry/DetachedFlowRegistry.d.ts +21 -0
- package/lib/flow-registry/DetachedFlowRegistry.js +80 -0
- package/lib/flow-registry/index.d.ts +1 -0
- package/lib/flow-registry/index.js +3 -1
- package/lib/flowContext.d.ts +9 -1
- package/lib/flowContext.js +77 -6
- package/lib/flowEngine.d.ts +136 -4
- package/lib/flowEngine.js +429 -51
- package/lib/flowI18n.js +2 -1
- package/lib/flowSettings.d.ts +14 -6
- package/lib/flowSettings.js +34 -6
- package/lib/index.d.ts +2 -0
- package/lib/index.js +7 -0
- package/lib/lazy-helper.d.ts +14 -0
- package/lib/lazy-helper.js +71 -0
- package/lib/locale/en-US.json +1 -0
- package/lib/locale/index.d.ts +2 -0
- package/lib/locale/zh-CN.json +1 -0
- package/lib/models/DisplayItemModel.d.ts +1 -1
- package/lib/models/EditableItemModel.d.ts +1 -1
- package/lib/models/FilterableItemModel.d.ts +1 -1
- package/lib/models/flowModel.d.ts +13 -10
- package/lib/models/flowModel.js +126 -34
- package/lib/provider.js +38 -23
- package/lib/reactive/observer.js +46 -16
- 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/runjs-context/setup.js +1 -0
- package/lib/runjs-context/snippets/index.js +13 -2
- package/lib/runjs-context/snippets/scene/detail/set-field-style.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/detail/set-field-style.snippet.js +50 -0
- package/lib/runjs-context/snippets/scene/table/set-cell-style.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/table/set-cell-style.snippet.js +54 -0
- package/lib/types.d.ts +50 -2
- package/lib/types.js +1 -0
- package/lib/utils/createCollectionContextMeta.js +6 -2
- package/lib/utils/index.d.ts +3 -2
- package/lib/utils/index.js +7 -0
- package/lib/utils/loadedPageCache.d.ts +24 -0
- package/lib/utils/loadedPageCache.js +139 -0
- package/lib/utils/parsePathnameToViewParams.d.ts +5 -1
- package/lib/utils/parsePathnameToViewParams.js +28 -4
- package/lib/utils/randomId.d.ts +39 -0
- package/lib/utils/randomId.js +45 -0
- package/lib/utils/runjsTemplateCompat.js +1 -1
- package/lib/utils/runjsValue.js +41 -11
- package/lib/utils/schema-utils.d.ts +7 -1
- package/lib/utils/schema-utils.js +19 -0
- package/lib/views/FlowView.d.ts +7 -1
- package/lib/views/FlowView.js +11 -1
- package/lib/views/PageComponent.js +8 -6
- package/lib/views/ViewNavigation.d.ts +12 -2
- package/lib/views/ViewNavigation.js +28 -9
- package/lib/views/createViewMeta.js +114 -50
- package/lib/views/inheritLayoutContext.d.ts +10 -0
- package/lib/views/inheritLayoutContext.js +50 -0
- package/lib/views/runViewBeforeClose.d.ts +10 -0
- package/lib/views/runViewBeforeClose.js +45 -0
- package/lib/views/useDialog.d.ts +2 -1
- package/lib/views/useDialog.js +12 -3
- package/lib/views/useDrawer.d.ts +2 -1
- package/lib/views/useDrawer.js +12 -3
- package/lib/views/usePage.d.ts +5 -11
- package/lib/views/usePage.js +304 -144
- package/package.json +5 -4
- package/src/FlowContextProvider.tsx +9 -1
- package/src/__tests__/createViewMeta.popup.test.ts +115 -1
- package/src/__tests__/flow-engine.test.ts +166 -0
- package/src/__tests__/flowContext.test.ts +105 -1
- package/src/__tests__/flowEngine.modelLoaders.test.ts +245 -0
- package/src/__tests__/flowEngine.moveModel.test.ts +81 -1
- package/src/__tests__/flowEngine.removeModel.test.ts +47 -3
- package/src/__tests__/flowSettings.test.ts +94 -15
- package/src/__tests__/objectVariable.test.ts +24 -0
- package/src/__tests__/provider.test.tsx +24 -2
- package/src/__tests__/renderHiddenInConfig.test.tsx +6 -6
- package/src/__tests__/runjsContext.test.ts +21 -0
- package/src/__tests__/runjsContextImplementations.test.ts +9 -2
- package/src/__tests__/runjsContextRuntime.test.ts +2 -0
- package/src/__tests__/runjsLocales.test.ts +6 -5
- package/src/__tests__/runjsSnippets.test.ts +21 -0
- package/src/__tests__/viewScopedFlowEngine.test.ts +136 -3
- package/src/components/FieldModelRenderer.tsx +2 -1
- package/src/components/FlowModelRenderer.tsx +18 -6
- package/src/components/FormItem.tsx +7 -1
- package/src/components/MobilePopup.tsx +4 -2
- package/src/components/__tests__/FlowModelRenderer.test.tsx +65 -2
- package/src/components/__tests__/FormItem.test.tsx +25 -0
- package/src/components/__tests__/dnd.test.ts +44 -0
- package/src/components/__tests__/flow-model-render-error-fallback.test.tsx +20 -10
- package/src/components/__tests__/gridDragPlanner.test.ts +472 -5
- package/src/components/dnd/__tests__/DndProvider.test.tsx +98 -0
- package/src/components/dnd/gridDragPlanner.ts +750 -17
- package/src/components/dnd/index.tsx +305 -28
- package/src/components/settings/wrappers/component/SelectWithTitle.tsx +21 -9
- package/src/components/settings/wrappers/contextual/DefaultSettingsIcon.tsx +178 -48
- package/src/components/settings/wrappers/contextual/FlowsFloatContextMenu.tsx +487 -440
- package/src/components/settings/wrappers/contextual/__tests__/DefaultSettingsIcon.test.tsx +344 -8
- package/src/components/settings/wrappers/contextual/__tests__/FlowsFloatContextMenu.test.tsx +778 -0
- package/src/components/settings/wrappers/contextual/useFloatToolbarPortal.ts +360 -0
- package/src/components/settings/wrappers/contextual/useFloatToolbarVisibility.ts +361 -0
- package/src/components/subModel/AddSubModelButton.tsx +16 -2
- package/src/components/subModel/LazyDropdown.tsx +341 -56
- package/src/components/subModel/__tests__/AddSubModelButton.test.tsx +524 -38
- package/src/components/subModel/__tests__/utils.test.ts +24 -0
- package/src/components/subModel/index.ts +1 -0
- package/src/components/subModel/utils.ts +13 -2
- package/src/components/variables/VariableHybridInput.tsx +531 -0
- package/src/components/variables/index.ts +2 -0
- package/src/data-source/__tests__/collection.test.ts +41 -2
- package/src/data-source/__tests__/index.test.ts +69 -2
- package/src/data-source/index.ts +332 -8
- package/src/executor/FlowExecutor.ts +6 -3
- package/src/executor/__tests__/flowExecutor.test.ts +57 -0
- package/src/flow-registry/DetachedFlowRegistry.ts +46 -0
- package/src/flow-registry/__tests__/detachedFlowRegistry.test.ts +47 -0
- package/src/flow-registry/index.ts +1 -0
- package/src/flowContext.ts +85 -6
- package/src/flowEngine.ts +484 -45
- package/src/flowI18n.ts +2 -1
- package/src/flowSettings.ts +40 -6
- package/src/index.ts +2 -0
- package/src/lazy-helper.tsx +57 -0
- package/src/locale/en-US.json +1 -0
- package/src/locale/zh-CN.json +1 -0
- package/src/models/DisplayItemModel.tsx +1 -1
- package/src/models/EditableItemModel.tsx +1 -1
- package/src/models/FilterableItemModel.tsx +1 -1
- package/src/models/__tests__/flowEngine.resolveUse.test.ts +0 -15
- package/src/models/__tests__/flowModel.test.ts +65 -37
- package/src/models/flowModel.tsx +184 -65
- package/src/provider.tsx +41 -25
- package/src/reactive/__tests__/observer.test.tsx +82 -0
- package/src/reactive/observer.tsx +87 -25
- 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/runjs-context/setup.ts +1 -0
- package/src/runjs-context/snippets/index.ts +12 -1
- package/src/runjs-context/snippets/scene/detail/set-field-style.snippet.ts +30 -0
- package/src/runjs-context/snippets/scene/table/set-cell-style.snippet.ts +34 -0
- package/src/types.ts +62 -0
- package/src/utils/__tests__/createCollectionContextMeta.test.ts +48 -0
- package/src/utils/__tests__/parsePathnameToViewParams.test.ts +21 -0
- package/src/utils/__tests__/runjsValue.test.ts +11 -0
- package/src/utils/__tests__/utils.test.ts +62 -0
- package/src/utils/createCollectionContextMeta.ts +6 -2
- package/src/utils/index.ts +5 -1
- package/src/utils/loadedPageCache.ts +147 -0
- package/src/utils/parsePathnameToViewParams.ts +45 -5
- package/src/utils/randomId.ts +48 -0
- package/src/utils/runjsTemplateCompat.ts +1 -1
- package/src/utils/runjsValue.ts +50 -11
- package/src/utils/schema-utils.ts +30 -1
- package/src/views/FlowView.tsx +22 -2
- package/src/views/PageComponent.tsx +7 -4
- package/src/views/ViewNavigation.ts +46 -9
- package/src/views/__tests__/FlowView.usePage.test.tsx +243 -3
- package/src/views/__tests__/ViewNavigation.test.ts +52 -0
- package/src/views/__tests__/inheritLayoutContext.test.ts +53 -0
- package/src/views/__tests__/runViewBeforeClose.test.ts +30 -0
- package/src/views/__tests__/useDialog.closeDestroy.test.tsx +12 -12
- package/src/views/createViewMeta.ts +106 -34
- package/src/views/inheritLayoutContext.ts +26 -0
- package/src/views/runViewBeforeClose.ts +19 -0
- package/src/views/useDialog.tsx +13 -3
- package/src/views/useDrawer.tsx +13 -3
- package/src/views/usePage.tsx +367 -180
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import { observer as originalObserver, IObserverOptions, ReactFC } from '@formily/reactive-react';
|
|
11
11
|
import React, { useMemo, useEffect, useRef } from 'react';
|
|
12
12
|
import { useFlowContext } from '../FlowContextProvider';
|
|
13
|
-
import {
|
|
13
|
+
import { reaction } from '@formily/reactive';
|
|
14
14
|
import { FlowEngineContext } from '..';
|
|
15
15
|
|
|
16
16
|
type ObserverComponentProps<P, Options extends IObserverOptions> = Options extends {
|
|
@@ -30,12 +30,67 @@ export const observer = <P, Options extends IObserverOptions = IObserverOptions>
|
|
|
30
30
|
const ctxRef = useRef(ctx);
|
|
31
31
|
ctxRef.current = ctx;
|
|
32
32
|
|
|
33
|
-
//
|
|
33
|
+
// 保存延迟更新的监听器,避免重复创建监听。
|
|
34
34
|
const pendingDisposerRef = useRef<(() => void) | null>(null);
|
|
35
|
+
// 保存延迟创建监听器的定时器,避免组件卸载后仍继续调度。
|
|
36
|
+
const pendingTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
35
37
|
|
|
36
|
-
|
|
38
|
+
/**
|
|
39
|
+
* 清理挂起的可见性监听器。
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* clearPendingDisposer();
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
const clearPendingDisposer = () => {
|
|
47
|
+
if (pendingDisposerRef.current) {
|
|
48
|
+
pendingDisposerRef.current();
|
|
49
|
+
pendingDisposerRef.current = null;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* 清理挂起的定时器。
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* clearPendingTimer();
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
const clearPendingTimer = () => {
|
|
62
|
+
if (pendingTimerRef.current) {
|
|
63
|
+
clearTimeout(pendingTimerRef.current);
|
|
64
|
+
pendingTimerRef.current = null;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* 判断当前页面与标签页是否允许立即更新。
|
|
70
|
+
*
|
|
71
|
+
* @returns 当前上下文是否处于可更新状态。
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* if (isContextActive()) {
|
|
75
|
+
* updater();
|
|
76
|
+
* }
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
const isContextActive = () => {
|
|
80
|
+
const pageActive = getPageActive(ctxRef.current);
|
|
81
|
+
const tabActive = ctxRef.current?.tabActive?.value;
|
|
82
|
+
|
|
83
|
+
return pageActive !== false && tabActive !== false;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
// 组件卸载时统一清理所有挂起任务,避免异步回调在卸载后继续运行。
|
|
37
87
|
useEffect(() => {
|
|
38
88
|
return () => {
|
|
89
|
+
if (pendingTimerRef.current) {
|
|
90
|
+
clearTimeout(pendingTimerRef.current);
|
|
91
|
+
pendingTimerRef.current = null;
|
|
92
|
+
}
|
|
93
|
+
|
|
39
94
|
if (pendingDisposerRef.current) {
|
|
40
95
|
pendingDisposerRef.current();
|
|
41
96
|
pendingDisposerRef.current = null;
|
|
@@ -47,38 +102,45 @@ export const observer = <P, Options extends IObserverOptions = IObserverOptions>
|
|
|
47
102
|
() =>
|
|
48
103
|
originalObserver(Component, {
|
|
49
104
|
scheduler(updater) {
|
|
50
|
-
|
|
51
|
-
|
|
105
|
+
if (!isContextActive()) {
|
|
106
|
+
if (pendingTimerRef.current || pendingDisposerRef.current) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// 通过异步任务打断同步调度,避免连续触发时形成递归更新。
|
|
111
|
+
pendingTimerRef.current = setTimeout(() => {
|
|
112
|
+
pendingTimerRef.current = null;
|
|
52
113
|
|
|
53
|
-
if (pageActive === false || tabActive === false) {
|
|
54
|
-
// Avoid stack overflow
|
|
55
|
-
setTimeout(() => {
|
|
56
|
-
// If there is already a pending updater, do nothing
|
|
57
114
|
if (pendingDisposerRef.current) {
|
|
58
115
|
return;
|
|
59
116
|
}
|
|
60
117
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
118
|
+
if (isContextActive()) {
|
|
119
|
+
updater();
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// 只监听组合后的“是否可更新”状态,条件恢复后执行一次并立即销毁。
|
|
124
|
+
pendingDisposerRef.current = reaction(
|
|
125
|
+
() => isContextActive(),
|
|
126
|
+
(active) => {
|
|
127
|
+
if (!active) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
clearPendingDisposer();
|
|
67
132
|
updater();
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: 'FlowObserverPendingUpdate',
|
|
136
|
+
},
|
|
137
|
+
);
|
|
73
138
|
});
|
|
74
139
|
return;
|
|
75
140
|
}
|
|
76
141
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
pendingDisposerRef.current();
|
|
80
|
-
pendingDisposerRef.current = null;
|
|
81
|
-
}
|
|
142
|
+
clearPendingTimer();
|
|
143
|
+
clearPendingDisposer();
|
|
82
144
|
|
|
83
145
|
updater();
|
|
84
146
|
},
|
|
@@ -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 FormJSFieldItemRunJSContext extends FlowRunJSContext {}
|
|
13
14
|
|
|
14
15
|
FormJSFieldItemRunJSContext.define({
|
|
15
16
|
label: 'FormJSFieldItem RunJS context',
|
|
16
17
|
properties: {
|
|
17
|
-
element: `ElementProxy instance providing a safe DOM container for form field rendering.
|
|
18
|
-
Supports innerHTML, append, and other DOM manipulation methods
|
|
18
|
+
element: createElementPropertyDoc(`ElementProxy instance providing a safe DOM container for form field rendering.
|
|
19
|
+
Supports innerHTML, append, and other DOM manipulation methods.`),
|
|
19
20
|
value: `Current field value (read-only in display mode; in controlled scenarios, use setProps to modify).`,
|
|
20
21
|
record: `Current record data object (read-only).
|
|
21
22
|
Contains all field values of the parent record.`,
|
|
@@ -38,7 +39,7 @@ FormJSFieldItemRunJSContext.define(
|
|
|
38
39
|
{
|
|
39
40
|
label: '表单 JS 字段项 RunJS 上下文',
|
|
40
41
|
properties: {
|
|
41
|
-
element: 'ElementProxy,表单字段容器',
|
|
42
|
+
element: createZhCNElementPropertyDoc('ElementProxy,表单字段容器'),
|
|
42
43
|
value: '字段值(展示模式为只读;受控场景用 setProps 修改)',
|
|
43
44
|
record: '当前记录(只读)',
|
|
44
45
|
formValues: {
|
|
@@ -8,21 +8,16 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { FlowRunJSContext } from '../../flowContext';
|
|
11
|
+
import { createElementPropertyDoc, createZhCNElementPropertyDoc } from './elementDoc';
|
|
11
12
|
|
|
12
13
|
export class JSBlockRunJSContext extends FlowRunJSContext {}
|
|
13
14
|
|
|
14
15
|
JSBlockRunJSContext.define({
|
|
15
16
|
label: 'RunJS context',
|
|
16
17
|
properties: {
|
|
17
|
-
element:
|
|
18
|
-
description: `ElementProxy instance providing a safe DOM container.
|
|
18
|
+
element: createElementPropertyDoc(`ElementProxy instance providing a safe DOM container.
|
|
19
19
|
Supports innerHTML, append, and other DOM manipulation methods.
|
|
20
|
-
Use this to render content in the JS block
|
|
21
|
-
detail: 'ElementProxy',
|
|
22
|
-
properties: {
|
|
23
|
-
innerHTML: 'Set or read the HTML content of the container element.',
|
|
24
|
-
},
|
|
25
|
-
},
|
|
20
|
+
Use this to render content in the JS block.`),
|
|
26
21
|
record: `Current record data object (read-only).
|
|
27
22
|
Available when the JS block is within a data block or detail view context.`,
|
|
28
23
|
value: 'Current value of the field or component, if available in the current context.',
|
|
@@ -44,13 +39,7 @@ JSBlockRunJSContext.define(
|
|
|
44
39
|
{
|
|
45
40
|
label: 'RunJS 上下文',
|
|
46
41
|
properties: {
|
|
47
|
-
element:
|
|
48
|
-
description: 'ElementProxy,安全的 DOM 容器,支持 innerHTML/append 等',
|
|
49
|
-
detail: 'ElementProxy',
|
|
50
|
-
properties: {
|
|
51
|
-
innerHTML: '读取或设置容器的 HTML 内容',
|
|
52
|
-
},
|
|
53
|
-
},
|
|
42
|
+
element: createZhCNElementPropertyDoc('ElementProxy,安全的 DOM 容器,支持 innerHTML/append 等'),
|
|
54
43
|
record: '当前记录(只读,用于数据区块/详情等场景)',
|
|
55
44
|
value: '当前值(若存在)',
|
|
56
45
|
React: 'React 库',
|
|
@@ -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 JSColumnModel (table custom column).
|
|
@@ -18,8 +19,9 @@ export class JSColumnRunJSContext extends FlowRunJSContext {}
|
|
|
18
19
|
JSColumnRunJSContext.define({
|
|
19
20
|
label: 'JSColumn RunJS context',
|
|
20
21
|
properties: {
|
|
21
|
-
element:
|
|
22
|
+
element: createElementPropertyDoc(
|
|
22
23
|
'ElementProxy instance providing a safe DOM container for the current table cell. Supports innerHTML/append and basic DOM APIs.',
|
|
24
|
+
),
|
|
23
25
|
record: 'Current row record object (read-only).',
|
|
24
26
|
recordIndex: 'Index of the current row in the page (0-based).',
|
|
25
27
|
collection: 'Collection definition metadata (read-only).',
|
|
@@ -40,7 +42,7 @@ JSColumnRunJSContext.define(
|
|
|
40
42
|
{
|
|
41
43
|
label: 'JS 列 RunJS 上下文',
|
|
42
44
|
properties: {
|
|
43
|
-
element: 'ElementProxy,表格单元格的安全 DOM 容器,支持 innerHTML/append 等',
|
|
45
|
+
element: createZhCNElementPropertyDoc('ElementProxy,表格单元格的安全 DOM 容器,支持 innerHTML/append 等'),
|
|
44
46
|
record: '当前行记录对象(只读)',
|
|
45
47
|
recordIndex: '当前行索引(从 0 开始)',
|
|
46
48
|
collection: '集合定义元数据(只读)',
|
|
@@ -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: {
|