@nocobase/flow-engine 2.1.0-beta.8 → 2.1.0
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
package/lib/models/flowModel.js
CHANGED
|
@@ -56,25 +56,80 @@ var import_reactive = require("@formily/reactive");
|
|
|
56
56
|
var import_lodash = __toESM(require("lodash"));
|
|
57
57
|
var import_react = __toESM(require("react"));
|
|
58
58
|
var import_secure = require("uid/secure");
|
|
59
|
-
var import_StepRequiredSettingsDialog = require("../components/settings/wrappers/contextual/StepRequiredSettingsDialog");
|
|
60
|
-
var import_StepSettingsDialog = require("../components/settings/wrappers/contextual/StepSettingsDialog");
|
|
61
59
|
var import_emitter = require("../emitter");
|
|
62
60
|
var import_InstanceFlowRegistry = require("../flow-registry/InstanceFlowRegistry");
|
|
63
61
|
var import_flowContext = require("../flowContext");
|
|
64
62
|
var import_utils = require("../utils");
|
|
65
|
-
var
|
|
63
|
+
var import_antd = require("antd");
|
|
64
|
+
var import__ = require("..");
|
|
66
65
|
var import_ModelActionRegistry = require("../action-registry/ModelActionRegistry");
|
|
67
66
|
var import_utils2 = require("../components/subModel/utils");
|
|
68
67
|
var import_ModelEventRegistry = require("../event-registry/ModelEventRegistry");
|
|
69
68
|
var import_GlobalFlowRegistry = require("../flow-registry/GlobalFlowRegistry");
|
|
70
69
|
var import_forkFlowModel = require("./forkFlowModel");
|
|
71
|
-
var import__ = require("..");
|
|
72
70
|
var _flowContext;
|
|
73
71
|
const classActionRegistries = /* @__PURE__ */ new WeakMap();
|
|
74
72
|
const classEventRegistries = /* @__PURE__ */ new WeakMap();
|
|
75
73
|
const modelMetas = /* @__PURE__ */ new WeakMap();
|
|
74
|
+
function getStableSortIndex(item, fallbackIndex) {
|
|
75
|
+
return typeof (item == null ? void 0 : item.sortIndex) === "number" && Number.isFinite(item.sortIndex) ? item.sortIndex : fallbackIndex + 1;
|
|
76
|
+
}
|
|
77
|
+
__name(getStableSortIndex, "getStableSortIndex");
|
|
78
|
+
function sortByStableSortIndex(items) {
|
|
79
|
+
return items.map((item, index) => ({
|
|
80
|
+
item,
|
|
81
|
+
index,
|
|
82
|
+
sortIndex: getStableSortIndex(item, index)
|
|
83
|
+
})).sort((a, b) => a.sortIndex - b.sortIndex || a.index - b.index).map(({ item }) => item);
|
|
84
|
+
}
|
|
85
|
+
__name(sortByStableSortIndex, "sortByStableSortIndex");
|
|
76
86
|
const modelGlobalRegistries = /* @__PURE__ */ new WeakMap();
|
|
77
87
|
const classMenuExtensions = /* @__PURE__ */ new WeakMap();
|
|
88
|
+
const sortExtraMenuItems = /* @__PURE__ */ __name((items) => {
|
|
89
|
+
return [...items].sort((a, b) => (a.sort ?? 0) - (b.sort ?? 0));
|
|
90
|
+
}, "sortExtraMenuItems");
|
|
91
|
+
const isFlowModelExtraMenuItem = /* @__PURE__ */ __name((item) => {
|
|
92
|
+
return item !== null;
|
|
93
|
+
}, "isFlowModelExtraMenuItem");
|
|
94
|
+
const normalizeExtraMenuItem = /* @__PURE__ */ __name((item, {
|
|
95
|
+
group,
|
|
96
|
+
sort,
|
|
97
|
+
prefix,
|
|
98
|
+
path
|
|
99
|
+
}) => {
|
|
100
|
+
if (!item) {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
const normalizedGroup = item.group || group;
|
|
104
|
+
const normalizedSort = typeof item.sort === "number" ? item.sort : sort;
|
|
105
|
+
const normalizedChildren = sortExtraMenuItems(
|
|
106
|
+
(item.children || []).map(
|
|
107
|
+
(child, index) => normalizeExtraMenuItem(child, {
|
|
108
|
+
group: normalizedGroup,
|
|
109
|
+
sort: normalizedSort,
|
|
110
|
+
prefix,
|
|
111
|
+
path: `${path}-${index}`
|
|
112
|
+
})
|
|
113
|
+
).filter(isFlowModelExtraMenuItem)
|
|
114
|
+
);
|
|
115
|
+
return {
|
|
116
|
+
...item,
|
|
117
|
+
key: item.key ?? `${prefix}-${normalizedGroup}-${path}`,
|
|
118
|
+
group: normalizedGroup,
|
|
119
|
+
sort: normalizedSort,
|
|
120
|
+
children: normalizedChildren.length ? normalizedChildren : void 0
|
|
121
|
+
};
|
|
122
|
+
}, "normalizeExtraMenuItem");
|
|
123
|
+
async function loadOpenStepSettingsDialog() {
|
|
124
|
+
const mod = await import("../components/settings/wrappers/contextual/StepSettingsDialog");
|
|
125
|
+
return mod.openStepSettingsDialog;
|
|
126
|
+
}
|
|
127
|
+
__name(loadOpenStepSettingsDialog, "loadOpenStepSettingsDialog");
|
|
128
|
+
async function loadOpenRequiredParamsStepFormDialog() {
|
|
129
|
+
const mod = await import("../components/settings/wrappers/contextual/StepRequiredSettingsDialog");
|
|
130
|
+
return mod.openRequiredParamsStepFormDialog;
|
|
131
|
+
}
|
|
132
|
+
__name(loadOpenRequiredParamsStepFormDialog, "loadOpenRequiredParamsStepFormDialog");
|
|
78
133
|
var ModelRenderMode = /* @__PURE__ */ ((ModelRenderMode2) => {
|
|
79
134
|
ModelRenderMode2["ReactElement"] = "reactElement";
|
|
80
135
|
ModelRenderMode2["RenderFunction"] = "renderFunction";
|
|
@@ -161,7 +216,7 @@ const _FlowModel = class _FlowModel {
|
|
|
161
216
|
};
|
|
162
217
|
this.stepParams = options.stepParams || {};
|
|
163
218
|
this.subModels = {};
|
|
164
|
-
this.sortIndex = options.sortIndex
|
|
219
|
+
this.sortIndex = getStableSortIndex({ sortIndex: options.sortIndex }, -1);
|
|
165
220
|
this._options = options;
|
|
166
221
|
this._title = "";
|
|
167
222
|
this._extraTitle = "";
|
|
@@ -183,10 +238,13 @@ const _FlowModel = class _FlowModel {
|
|
|
183
238
|
if (changed.type === "set" && import_lodash.default.isEqual(changed.value, changed.oldValue)) {
|
|
184
239
|
return;
|
|
185
240
|
}
|
|
241
|
+
const hasLastAutoRun = !!this._lastAutoRunParams;
|
|
186
242
|
if (this.flowEngine) {
|
|
187
243
|
this.invalidateFlowCache("beforeRender");
|
|
188
244
|
}
|
|
189
|
-
|
|
245
|
+
if (hasLastAutoRun) {
|
|
246
|
+
this._rerunLastAutoRun();
|
|
247
|
+
}
|
|
190
248
|
this.forks.forEach((fork) => {
|
|
191
249
|
fork.rerender();
|
|
192
250
|
});
|
|
@@ -370,7 +428,7 @@ const _FlowModel = class _FlowModel {
|
|
|
370
428
|
}
|
|
371
429
|
Object.entries(mergedSubModels || {}).forEach(([key, value]) => {
|
|
372
430
|
if (Array.isArray(value)) {
|
|
373
|
-
value
|
|
431
|
+
sortByStableSortIndex(value).forEach((item) => {
|
|
374
432
|
this.addSubModel(key, item);
|
|
375
433
|
});
|
|
376
434
|
} else {
|
|
@@ -576,31 +634,49 @@ const _FlowModel = class _FlowModel {
|
|
|
576
634
|
} else {
|
|
577
635
|
this.props = { ...this.props, ...props };
|
|
578
636
|
}
|
|
637
|
+
this._options.props = { ...this.props };
|
|
579
638
|
}
|
|
580
639
|
getProps() {
|
|
581
640
|
return this.props;
|
|
582
641
|
}
|
|
583
642
|
setStepParams(flowKeyOrAllParams, stepKeyOrStepsParams, params) {
|
|
643
|
+
var _a;
|
|
644
|
+
let hasChanged = false;
|
|
584
645
|
if (typeof flowKeyOrAllParams === "string") {
|
|
585
646
|
const flowKey = flowKeyOrAllParams;
|
|
586
647
|
if (typeof stepKeyOrStepsParams === "string" && params !== void 0) {
|
|
587
|
-
|
|
588
|
-
|
|
648
|
+
const currentStepParams = ((_a = this.stepParams[flowKey]) == null ? void 0 : _a[stepKeyOrStepsParams]) || {};
|
|
649
|
+
const nextStepParams = { ...currentStepParams, ...params };
|
|
650
|
+
if (!import_lodash.default.isEqual(currentStepParams, nextStepParams)) {
|
|
651
|
+
if (!this.stepParams[flowKey]) {
|
|
652
|
+
this.stepParams[flowKey] = {};
|
|
653
|
+
}
|
|
654
|
+
this.stepParams[flowKey][stepKeyOrStepsParams] = nextStepParams;
|
|
655
|
+
hasChanged = true;
|
|
589
656
|
}
|
|
590
|
-
this.stepParams[flowKey][stepKeyOrStepsParams] = {
|
|
591
|
-
...this.stepParams[flowKey][stepKeyOrStepsParams],
|
|
592
|
-
...params
|
|
593
|
-
};
|
|
594
657
|
} else if (typeof stepKeyOrStepsParams === "object" && stepKeyOrStepsParams !== null) {
|
|
595
|
-
|
|
658
|
+
const currentFlowParams = this.stepParams[flowKey] || {};
|
|
659
|
+
const nextFlowParams = { ...currentFlowParams, ...stepKeyOrStepsParams };
|
|
660
|
+
if (!import_lodash.default.isEqual(currentFlowParams, nextFlowParams)) {
|
|
661
|
+
this.stepParams[flowKey] = nextFlowParams;
|
|
662
|
+
hasChanged = true;
|
|
663
|
+
}
|
|
596
664
|
}
|
|
597
665
|
} else if (typeof flowKeyOrAllParams === "object" && flowKeyOrAllParams !== null) {
|
|
598
666
|
for (const fk in flowKeyOrAllParams) {
|
|
599
667
|
if (Object.prototype.hasOwnProperty.call(flowKeyOrAllParams, fk)) {
|
|
600
|
-
|
|
668
|
+
const currentFlowParams = this.stepParams[fk] || {};
|
|
669
|
+
const nextFlowParams = { ...currentFlowParams, ...flowKeyOrAllParams[fk] };
|
|
670
|
+
if (!import_lodash.default.isEqual(currentFlowParams, nextFlowParams)) {
|
|
671
|
+
this.stepParams[fk] = nextFlowParams;
|
|
672
|
+
hasChanged = true;
|
|
673
|
+
}
|
|
601
674
|
}
|
|
602
675
|
}
|
|
603
676
|
}
|
|
677
|
+
if (!hasChanged) {
|
|
678
|
+
return;
|
|
679
|
+
}
|
|
604
680
|
this.emitter.emit("onStepParamsChanged");
|
|
605
681
|
}
|
|
606
682
|
getStepParams(flowKey, stepKey) {
|
|
@@ -621,7 +697,7 @@ const _FlowModel = class _FlowModel {
|
|
|
621
697
|
}
|
|
622
698
|
const isFork = this.isFork === true;
|
|
623
699
|
const target = this;
|
|
624
|
-
|
|
700
|
+
currentFlowEngine.logger.debug(
|
|
625
701
|
`[FlowModel] applyFlow: uid=${this.uid}, flowKey=${flowKey}, isFork=${isFork}, cleanRun=${this.cleanRun}, targetIsFork=${(target == null ? void 0 : target.isFork) === true}`
|
|
626
702
|
);
|
|
627
703
|
return currentFlowEngine.executor.runFlow(target, flowKey, inputArgs, runId);
|
|
@@ -634,7 +710,7 @@ const _FlowModel = class _FlowModel {
|
|
|
634
710
|
}
|
|
635
711
|
const isFork = this.isFork === true;
|
|
636
712
|
const target = this;
|
|
637
|
-
|
|
713
|
+
currentFlowEngine.logger.debug(
|
|
638
714
|
`[FlowModel] dispatchEvent: uid=${this.uid}, event=${eventName}, isFork=${isFork}, cleanRun=${this.cleanRun}, targetIsFork=${(target == null ? void 0 : target.isFork) === true}`
|
|
639
715
|
);
|
|
640
716
|
return await currentFlowEngine.executor.dispatchEvent(target, eventName, inputArgs, options);
|
|
@@ -674,6 +750,11 @@ const _FlowModel = class _FlowModel {
|
|
|
674
750
|
}, "isMatch");
|
|
675
751
|
return Array.from(allFlows.values()).filter(isMatch);
|
|
676
752
|
}
|
|
753
|
+
resetAutoRunState() {
|
|
754
|
+
var _a, _b;
|
|
755
|
+
(_b = (_a = this._rerunLastAutoRun) == null ? void 0 : _a.cancel) == null ? void 0 : _b.call(_a);
|
|
756
|
+
this._lastAutoRunParams = null;
|
|
757
|
+
}
|
|
677
758
|
/**
|
|
678
759
|
* 通用事件分发钩子:开始
|
|
679
760
|
* 子类可覆盖;beforeRender 事件可通过抛出 FlowExitException 提前终止。
|
|
@@ -763,6 +844,7 @@ const _FlowModel = class _FlowModel {
|
|
|
763
844
|
}));
|
|
764
845
|
return () => {
|
|
765
846
|
var _a3, _b3;
|
|
847
|
+
renderTarget.resetAutoRunState();
|
|
766
848
|
if (typeof renderTarget.onUnmount === "function") {
|
|
767
849
|
renderTarget.onUnmount();
|
|
768
850
|
}
|
|
@@ -880,7 +962,10 @@ const _FlowModel = class _FlowModel {
|
|
|
880
962
|
if (!Array.isArray(subModels[subKey])) {
|
|
881
963
|
subModels[subKey] = import_reactive.observable.shallow([]);
|
|
882
964
|
}
|
|
883
|
-
const maxSortIndex = Math.max(
|
|
965
|
+
const maxSortIndex = Math.max(
|
|
966
|
+
...subModels[subKey].map((item, index) => getStableSortIndex(item, index)),
|
|
967
|
+
0
|
|
968
|
+
);
|
|
884
969
|
model.sortIndex = maxSortIndex + 1;
|
|
885
970
|
subModels[subKey].push(model);
|
|
886
971
|
actualParent.emitter.emit("onSubModelAdded", model);
|
|
@@ -928,7 +1013,7 @@ const _FlowModel = class _FlowModel {
|
|
|
928
1013
|
return [];
|
|
929
1014
|
}
|
|
930
1015
|
const results = [];
|
|
931
|
-
import_lodash.default.castArray(model)
|
|
1016
|
+
sortByStableSortIndex(import_lodash.default.castArray(model)).forEach((item, index) => {
|
|
932
1017
|
const result = callback(item, index);
|
|
933
1018
|
if (result) {
|
|
934
1019
|
results.push(item);
|
|
@@ -942,7 +1027,7 @@ const _FlowModel = class _FlowModel {
|
|
|
942
1027
|
return [];
|
|
943
1028
|
}
|
|
944
1029
|
const results = [];
|
|
945
|
-
import_lodash.default.castArray(model)
|
|
1030
|
+
sortByStableSortIndex(import_lodash.default.castArray(model)).forEach((item, index) => {
|
|
946
1031
|
const result = callback(item, index);
|
|
947
1032
|
results.push(result);
|
|
948
1033
|
});
|
|
@@ -1003,7 +1088,7 @@ const _FlowModel = class _FlowModel {
|
|
|
1003
1088
|
}
|
|
1004
1089
|
clearForks() {
|
|
1005
1090
|
var _a;
|
|
1006
|
-
|
|
1091
|
+
this.flowEngine.logger.debug(`FlowModel ${this.uid} clearing all forks.`);
|
|
1007
1092
|
if ((_a = this.forks) == null ? void 0 : _a.size) {
|
|
1008
1093
|
this.forks.forEach((fork) => fork.dispose());
|
|
1009
1094
|
this.forks.clear();
|
|
@@ -1058,7 +1143,7 @@ const _FlowModel = class _FlowModel {
|
|
|
1058
1143
|
* @param {string} stepKey 步骤的唯一标识符
|
|
1059
1144
|
* @returns {void}
|
|
1060
1145
|
*/
|
|
1061
|
-
openStepSettingsDialog(flowKey, stepKey) {
|
|
1146
|
+
async openStepSettingsDialog(flowKey, stepKey) {
|
|
1062
1147
|
var _a;
|
|
1063
1148
|
const flow = this.getFlow(flowKey);
|
|
1064
1149
|
const step = (_a = flow == null ? void 0 : flow.steps) == null ? void 0 : _a[stepKey];
|
|
@@ -1069,7 +1154,8 @@ const _FlowModel = class _FlowModel {
|
|
|
1069
1154
|
const ctx = new import_flowContext.FlowRuntimeContext(this, flowKey, "settings");
|
|
1070
1155
|
(0, import_utils.setupRuntimeContextSteps)(ctx, flow.steps, this, flowKey);
|
|
1071
1156
|
ctx.defineProperty("currentStep", { value: step });
|
|
1072
|
-
|
|
1157
|
+
const openStepSettingsDialog = await loadOpenStepSettingsDialog();
|
|
1158
|
+
return openStepSettingsDialog({
|
|
1073
1159
|
model: this,
|
|
1074
1160
|
flowKey,
|
|
1075
1161
|
stepKey,
|
|
@@ -1084,7 +1170,8 @@ const _FlowModel = class _FlowModel {
|
|
|
1084
1170
|
* @returns {Promise<any>} 返回表单提交的值
|
|
1085
1171
|
*/
|
|
1086
1172
|
async configureRequiredSteps(dialogWidth, dialogTitle) {
|
|
1087
|
-
|
|
1173
|
+
const openRequiredParamsStepFormDialog = await loadOpenRequiredParamsStepFormDialog();
|
|
1174
|
+
return openRequiredParamsStepFormDialog({
|
|
1088
1175
|
model: this,
|
|
1089
1176
|
dialogWidth,
|
|
1090
1177
|
dialogTitle
|
|
@@ -1109,6 +1196,7 @@ const _FlowModel = class _FlowModel {
|
|
|
1109
1196
|
const data = {
|
|
1110
1197
|
uid: this.uid,
|
|
1111
1198
|
...import_lodash.default.omit(this._options, ["flowEngine"]),
|
|
1199
|
+
props: { ...this.props },
|
|
1112
1200
|
stepParams: this.stepParams,
|
|
1113
1201
|
sortIndex: this.sortIndex,
|
|
1114
1202
|
flowRegistry: {}
|
|
@@ -1221,22 +1309,26 @@ const _FlowModel = class _FlowModel {
|
|
|
1221
1309
|
seen.add(Cls);
|
|
1222
1310
|
const reg = classMenuExtensions.get(Cls);
|
|
1223
1311
|
if (reg) {
|
|
1312
|
+
let entryIndex = 0;
|
|
1224
1313
|
for (const entry of reg) {
|
|
1225
1314
|
if (entry.matcher && !entry.matcher(model)) continue;
|
|
1226
1315
|
const items = typeof entry.items === "function" ? await entry.items(model, t) : await Promise.resolve(entry.items || []);
|
|
1227
1316
|
const group = entry.group || "common-actions";
|
|
1228
1317
|
const sort = entry.sort ?? 0;
|
|
1229
1318
|
const prefix = entry.keyPrefix || Cls.name || "extra";
|
|
1230
|
-
(
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1319
|
+
sortExtraMenuItems(
|
|
1320
|
+
(items || []).map(
|
|
1321
|
+
(it, idx) => normalizeExtraMenuItem(it, {
|
|
1322
|
+
group,
|
|
1323
|
+
sort,
|
|
1324
|
+
prefix,
|
|
1325
|
+
path: `${entryIndex}-${idx}`
|
|
1326
|
+
})
|
|
1327
|
+
).filter(isFlowModelExtraMenuItem)
|
|
1328
|
+
).forEach((it) => {
|
|
1329
|
+
collected.push(it);
|
|
1239
1330
|
});
|
|
1331
|
+
entryIndex += 1;
|
|
1240
1332
|
}
|
|
1241
1333
|
}
|
|
1242
1334
|
const ParentClass = Object.getPrototypeOf(Cls);
|
|
@@ -1303,7 +1395,7 @@ const _ErrorFlowModel = class _ErrorFlowModel extends FlowModel {
|
|
|
1303
1395
|
this.errorMessage = msg;
|
|
1304
1396
|
}
|
|
1305
1397
|
render() {
|
|
1306
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
1398
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Typography.Text, { type: "danger" }, this.errorMessage);
|
|
1307
1399
|
}
|
|
1308
1400
|
};
|
|
1309
1401
|
__name(_ErrorFlowModel, "ErrorFlowModel");
|
package/lib/provider.js
CHANGED
|
@@ -67,31 +67,46 @@ const FlowEngineGlobalsContextProvider = /* @__PURE__ */ __name(({ children }) =
|
|
|
67
67
|
const engine = useFlowEngine();
|
|
68
68
|
const config = (0, import_react.useContext)(import_antd.ConfigProvider.ConfigContext);
|
|
69
69
|
const { token } = import_antd.theme.useToken();
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
70
|
+
const isDarkTheme = import_react.default.useMemo(() => {
|
|
71
|
+
var _a2;
|
|
72
|
+
const algorithm = (_a2 = config == null ? void 0 : config.theme) == null ? void 0 : _a2.algorithm;
|
|
73
|
+
if (Array.isArray(algorithm)) {
|
|
74
|
+
return algorithm.includes(import_antd.theme.darkAlgorithm);
|
|
75
|
+
}
|
|
76
|
+
return algorithm === import_antd.theme.darkAlgorithm;
|
|
77
|
+
}, [config]);
|
|
78
|
+
engine.context.defineProperty("viewer", {
|
|
79
|
+
cache: false,
|
|
80
|
+
get: /* @__PURE__ */ __name((ctx) => new import_FlowView.FlowViewer(ctx, { drawer, embed, popover, dialog }), "get")
|
|
81
|
+
});
|
|
82
|
+
for (const item of Object.entries({
|
|
83
|
+
antdConfig: config,
|
|
84
|
+
modal,
|
|
85
|
+
message,
|
|
86
|
+
notification
|
|
87
|
+
})) {
|
|
88
|
+
const [key, value] = item;
|
|
89
|
+
if (value) {
|
|
90
|
+
engine.context.defineProperty(key, { value });
|
|
87
91
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
}
|
|
93
|
+
engine.context.defineProperty("themeToken", {
|
|
94
|
+
get: /* @__PURE__ */ __name(() => token, "get"),
|
|
95
|
+
observable: true,
|
|
96
|
+
cache: true
|
|
97
|
+
});
|
|
98
|
+
engine.context.defineProperty("isDarkTheme", {
|
|
99
|
+
get: /* @__PURE__ */ __name(() => isDarkTheme, "get"),
|
|
100
|
+
observable: true,
|
|
101
|
+
cache: true,
|
|
102
|
+
info: {
|
|
103
|
+
description: "Whether current theme algorithm is dark mode.",
|
|
104
|
+
detail: "boolean"
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
(0, import_react.useEffect)(() => {
|
|
93
108
|
engine.reactView.refresh();
|
|
94
|
-
}, [engine, drawer, modal, message, notification, config, popover, token, dialog, embed]);
|
|
109
|
+
}, [engine, drawer, modal, message, notification, config, popover, token, dialog, embed, isDarkTheme]);
|
|
95
110
|
return /* @__PURE__ */ import_react.default.createElement(import_antd.ConfigProvider, { ...config, locale: (_a = engine.context.locales) == null ? void 0 : _a.antd, popupMatchSelectWidth: false }, children, contextHolder, popoverContextHolder, pageContextHolder, dialogContextHolder);
|
|
96
111
|
}, "FlowEngineGlobalsContextProvider");
|
|
97
112
|
const useFlowEngine = /* @__PURE__ */ __name(({ throwError = true } = {}) => {
|
package/lib/reactive/observer.js
CHANGED
|
@@ -51,8 +51,31 @@ const observer = /* @__PURE__ */ __name((Component, options) => {
|
|
|
51
51
|
const ctxRef = (0, import_react.useRef)(ctx);
|
|
52
52
|
ctxRef.current = ctx;
|
|
53
53
|
const pendingDisposerRef = (0, import_react.useRef)(null);
|
|
54
|
+
const pendingTimerRef = (0, import_react.useRef)(null);
|
|
55
|
+
const clearPendingDisposer = /* @__PURE__ */ __name(() => {
|
|
56
|
+
if (pendingDisposerRef.current) {
|
|
57
|
+
pendingDisposerRef.current();
|
|
58
|
+
pendingDisposerRef.current = null;
|
|
59
|
+
}
|
|
60
|
+
}, "clearPendingDisposer");
|
|
61
|
+
const clearPendingTimer = /* @__PURE__ */ __name(() => {
|
|
62
|
+
if (pendingTimerRef.current) {
|
|
63
|
+
clearTimeout(pendingTimerRef.current);
|
|
64
|
+
pendingTimerRef.current = null;
|
|
65
|
+
}
|
|
66
|
+
}, "clearPendingTimer");
|
|
67
|
+
const isContextActive = /* @__PURE__ */ __name(() => {
|
|
68
|
+
var _a, _b;
|
|
69
|
+
const pageActive = getPageActive(ctxRef.current);
|
|
70
|
+
const tabActive = (_b = (_a = ctxRef.current) == null ? void 0 : _a.tabActive) == null ? void 0 : _b.value;
|
|
71
|
+
return pageActive !== false && tabActive !== false;
|
|
72
|
+
}, "isContextActive");
|
|
54
73
|
(0, import_react.useEffect)(() => {
|
|
55
74
|
return () => {
|
|
75
|
+
if (pendingTimerRef.current) {
|
|
76
|
+
clearTimeout(pendingTimerRef.current);
|
|
77
|
+
pendingTimerRef.current = null;
|
|
78
|
+
}
|
|
56
79
|
if (pendingDisposerRef.current) {
|
|
57
80
|
pendingDisposerRef.current();
|
|
58
81
|
pendingDisposerRef.current = null;
|
|
@@ -62,30 +85,37 @@ const observer = /* @__PURE__ */ __name((Component, options) => {
|
|
|
62
85
|
const ObservedComponent = (0, import_react.useMemo)(
|
|
63
86
|
() => (0, import_reactive_react.observer)(Component, {
|
|
64
87
|
scheduler(updater) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
setTimeout(() => {
|
|
88
|
+
if (!isContextActive()) {
|
|
89
|
+
if (pendingTimerRef.current || pendingDisposerRef.current) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
pendingTimerRef.current = setTimeout(() => {
|
|
93
|
+
pendingTimerRef.current = null;
|
|
70
94
|
if (pendingDisposerRef.current) {
|
|
71
95
|
return;
|
|
72
96
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
97
|
+
if (isContextActive()) {
|
|
98
|
+
updater();
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
pendingDisposerRef.current = (0, import_reactive.reaction)(
|
|
102
|
+
() => isContextActive(),
|
|
103
|
+
(active) => {
|
|
104
|
+
if (!active) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
clearPendingDisposer();
|
|
76
108
|
updater();
|
|
77
|
-
|
|
78
|
-
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: "FlowObserverPendingUpdate"
|
|
79
112
|
}
|
|
80
|
-
|
|
81
|
-
pendingDisposerRef.current = disposer;
|
|
113
|
+
);
|
|
82
114
|
});
|
|
83
115
|
return;
|
|
84
116
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
pendingDisposerRef.current = null;
|
|
88
|
-
}
|
|
117
|
+
clearPendingTimer();
|
|
118
|
+
clearPendingDisposer();
|
|
89
119
|
updater();
|
|
90
120
|
},
|
|
91
121
|
...options
|
|
@@ -31,6 +31,7 @@ __export(FormJSFieldItemRunJSContext_exports, {
|
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(FormJSFieldItemRunJSContext_exports);
|
|
33
33
|
var import_flowContext = require("../../flowContext");
|
|
34
|
+
var import_elementDoc = require("./elementDoc");
|
|
34
35
|
const _FormJSFieldItemRunJSContext = class _FormJSFieldItemRunJSContext extends import_flowContext.FlowRunJSContext {
|
|
35
36
|
};
|
|
36
37
|
__name(_FormJSFieldItemRunJSContext, "FormJSFieldItemRunJSContext");
|
|
@@ -38,8 +39,8 @@ let FormJSFieldItemRunJSContext = _FormJSFieldItemRunJSContext;
|
|
|
38
39
|
FormJSFieldItemRunJSContext.define({
|
|
39
40
|
label: "FormJSFieldItem RunJS context",
|
|
40
41
|
properties: {
|
|
41
|
-
element: `ElementProxy instance providing a safe DOM container for form field rendering.
|
|
42
|
-
Supports innerHTML, append, and other DOM manipulation methods
|
|
42
|
+
element: (0, import_elementDoc.createElementPropertyDoc)(`ElementProxy instance providing a safe DOM container for form field rendering.
|
|
43
|
+
Supports innerHTML, append, and other DOM manipulation methods.`),
|
|
43
44
|
value: `Current field value (read-only in display mode; in controlled scenarios, use setProps to modify).`,
|
|
44
45
|
record: `Current record data object (read-only).
|
|
45
46
|
Contains all field values of the parent record.`,
|
|
@@ -61,7 +62,7 @@ FormJSFieldItemRunJSContext.define(
|
|
|
61
62
|
{
|
|
62
63
|
label: "\u8868\u5355 JS \u5B57\u6BB5\u9879 RunJS \u4E0A\u4E0B\u6587",
|
|
63
64
|
properties: {
|
|
64
|
-
element: "ElementProxy\uFF0C\u8868\u5355\u5B57\u6BB5\u5BB9\u5668",
|
|
65
|
+
element: (0, import_elementDoc.createZhCNElementPropertyDoc)("ElementProxy\uFF0C\u8868\u5355\u5B57\u6BB5\u5BB9\u5668"),
|
|
65
66
|
value: "\u5B57\u6BB5\u503C\uFF08\u5C55\u793A\u6A21\u5F0F\u4E3A\u53EA\u8BFB\uFF1B\u53D7\u63A7\u573A\u666F\u7528 setProps \u4FEE\u6539\uFF09",
|
|
66
67
|
record: "\u5F53\u524D\u8BB0\u5F55\uFF08\u53EA\u8BFB\uFF09",
|
|
67
68
|
formValues: {
|
|
@@ -31,6 +31,7 @@ __export(JSBlockRunJSContext_exports, {
|
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(JSBlockRunJSContext_exports);
|
|
33
33
|
var import_flowContext = require("../../flowContext");
|
|
34
|
+
var import_elementDoc = require("./elementDoc");
|
|
34
35
|
const _JSBlockRunJSContext = class _JSBlockRunJSContext extends import_flowContext.FlowRunJSContext {
|
|
35
36
|
};
|
|
36
37
|
__name(_JSBlockRunJSContext, "JSBlockRunJSContext");
|
|
@@ -38,15 +39,9 @@ let JSBlockRunJSContext = _JSBlockRunJSContext;
|
|
|
38
39
|
JSBlockRunJSContext.define({
|
|
39
40
|
label: "RunJS context",
|
|
40
41
|
properties: {
|
|
41
|
-
element:
|
|
42
|
-
description: `ElementProxy instance providing a safe DOM container.
|
|
42
|
+
element: (0, import_elementDoc.createElementPropertyDoc)(`ElementProxy instance providing a safe DOM container.
|
|
43
43
|
Supports innerHTML, append, and other DOM manipulation methods.
|
|
44
|
-
Use this to render content in the JS block
|
|
45
|
-
detail: "ElementProxy",
|
|
46
|
-
properties: {
|
|
47
|
-
innerHTML: "Set or read the HTML content of the container element."
|
|
48
|
-
}
|
|
49
|
-
},
|
|
44
|
+
Use this to render content in the JS block.`),
|
|
50
45
|
record: `Current record data object (read-only).
|
|
51
46
|
Available when the JS block is within a data block or detail view context.`,
|
|
52
47
|
value: "Current value of the field or component, if available in the current context.",
|
|
@@ -65,13 +60,7 @@ JSBlockRunJSContext.define(
|
|
|
65
60
|
{
|
|
66
61
|
label: "RunJS \u4E0A\u4E0B\u6587",
|
|
67
62
|
properties: {
|
|
68
|
-
element:
|
|
69
|
-
description: "ElementProxy\uFF0C\u5B89\u5168\u7684 DOM \u5BB9\u5668\uFF0C\u652F\u6301 innerHTML/append \u7B49",
|
|
70
|
-
detail: "ElementProxy",
|
|
71
|
-
properties: {
|
|
72
|
-
innerHTML: "\u8BFB\u53D6\u6216\u8BBE\u7F6E\u5BB9\u5668\u7684 HTML \u5185\u5BB9"
|
|
73
|
-
}
|
|
74
|
-
},
|
|
63
|
+
element: (0, import_elementDoc.createZhCNElementPropertyDoc)("ElementProxy\uFF0C\u5B89\u5168\u7684 DOM \u5BB9\u5668\uFF0C\u652F\u6301 innerHTML/append \u7B49"),
|
|
75
64
|
record: "\u5F53\u524D\u8BB0\u5F55\uFF08\u53EA\u8BFB\uFF0C\u7528\u4E8E\u6570\u636E\u533A\u5757/\u8BE6\u60C5\u7B49\u573A\u666F\uFF09",
|
|
76
65
|
value: "\u5F53\u524D\u503C\uFF08\u82E5\u5B58\u5728\uFF09",
|
|
77
66
|
React: "React \u5E93",
|
|
@@ -31,6 +31,7 @@ __export(JSColumnRunJSContext_exports, {
|
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(JSColumnRunJSContext_exports);
|
|
33
33
|
var import_flowContext = require("../../flowContext");
|
|
34
|
+
var import_elementDoc = require("./elementDoc");
|
|
34
35
|
const _JSColumnRunJSContext = class _JSColumnRunJSContext extends import_flowContext.FlowRunJSContext {
|
|
35
36
|
};
|
|
36
37
|
__name(_JSColumnRunJSContext, "JSColumnRunJSContext");
|
|
@@ -38,7 +39,9 @@ let JSColumnRunJSContext = _JSColumnRunJSContext;
|
|
|
38
39
|
JSColumnRunJSContext.define({
|
|
39
40
|
label: "JSColumn RunJS context",
|
|
40
41
|
properties: {
|
|
41
|
-
element:
|
|
42
|
+
element: (0, import_elementDoc.createElementPropertyDoc)(
|
|
43
|
+
"ElementProxy instance providing a safe DOM container for the current table cell. Supports innerHTML/append and basic DOM APIs."
|
|
44
|
+
),
|
|
42
45
|
record: "Current row record object (read-only).",
|
|
43
46
|
recordIndex: "Index of the current row in the page (0-based).",
|
|
44
47
|
collection: "Collection definition metadata (read-only).",
|
|
@@ -56,7 +59,7 @@ JSColumnRunJSContext.define(
|
|
|
56
59
|
{
|
|
57
60
|
label: "JS \u5217 RunJS \u4E0A\u4E0B\u6587",
|
|
58
61
|
properties: {
|
|
59
|
-
element: "ElementProxy\uFF0C\u8868\u683C\u5355\u5143\u683C\u7684\u5B89\u5168 DOM \u5BB9\u5668\uFF0C\u652F\u6301 innerHTML/append \u7B49",
|
|
62
|
+
element: (0, import_elementDoc.createZhCNElementPropertyDoc)("ElementProxy\uFF0C\u8868\u683C\u5355\u5143\u683C\u7684\u5B89\u5168 DOM \u5BB9\u5668\uFF0C\u652F\u6301 innerHTML/append \u7B49"),
|
|
60
63
|
record: "\u5F53\u524D\u884C\u8BB0\u5F55\u5BF9\u8C61\uFF08\u53EA\u8BFB\uFF09",
|
|
61
64
|
recordIndex: "\u5F53\u524D\u884C\u7D22\u5F15\uFF08\u4ECE 0 \u5F00\u59CB\uFF09",
|
|
62
65
|
collection: "\u96C6\u5408\u5B9A\u4E49\u5143\u6570\u636E\uFF08\u53EA\u8BFB\uFF09",
|
|
@@ -31,6 +31,7 @@ __export(JSEditableFieldRunJSContext_exports, {
|
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(JSEditableFieldRunJSContext_exports);
|
|
33
33
|
var import_flowContext = require("../../flowContext");
|
|
34
|
+
var import_elementDoc = require("./elementDoc");
|
|
34
35
|
const _JSEditableFieldRunJSContext = class _JSEditableFieldRunJSContext extends import_flowContext.FlowRunJSContext {
|
|
35
36
|
};
|
|
36
37
|
__name(_JSEditableFieldRunJSContext, "JSEditableFieldRunJSContext");
|
|
@@ -38,10 +39,9 @@ let JSEditableFieldRunJSContext = _JSEditableFieldRunJSContext;
|
|
|
38
39
|
JSEditableFieldRunJSContext.define({
|
|
39
40
|
label: "JSEditableField RunJS context",
|
|
40
41
|
properties: {
|
|
41
|
-
element:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
},
|
|
42
|
+
element: (0, import_elementDoc.createElementPropertyDoc)(
|
|
43
|
+
"ElementProxy instance providing a safe DOM container for field rendering. In editable mode this container is typically a <span> element."
|
|
44
|
+
),
|
|
45
45
|
value: {
|
|
46
46
|
description: "Current field value (read-only snapshot). In editable scenarios, prefer ctx.getValue()/ctx.setValue(v) for two-way binding.",
|
|
47
47
|
detail: "any",
|
|
@@ -84,10 +84,7 @@ JSEditableFieldRunJSContext.define(
|
|
|
84
84
|
{
|
|
85
85
|
label: "JS \u53EF\u7F16\u8F91\u5B57\u6BB5 RunJS \u4E0A\u4E0B\u6587",
|
|
86
86
|
properties: {
|
|
87
|
-
element:
|
|
88
|
-
description: "ElementProxy\uFF0C\u5B57\u6BB5\u6E32\u67D3\u7684\u5B89\u5168\u5BB9\u5668\uFF08\u901A\u5E38\u4E3A <span> \u5BB9\u5668\uFF09\u3002",
|
|
89
|
-
detail: "ElementProxy"
|
|
90
|
-
},
|
|
87
|
+
element: (0, import_elementDoc.createZhCNElementPropertyDoc)("ElementProxy\uFF0C\u5B57\u6BB5\u6E32\u67D3\u7684\u5B89\u5168\u5BB9\u5668\uFF08\u901A\u5E38\u4E3A <span> \u5BB9\u5668\uFF09\u3002"),
|
|
91
88
|
value: {
|
|
92
89
|
description: "\u5B57\u6BB5\u5F53\u524D\u503C\uFF08\u53EA\u8BFB\u5FEB\u7167\uFF09\u3002\u53EF\u7F16\u8F91\u573A\u666F\u5EFA\u8BAE\u4F7F\u7528 ctx.getValue()/ctx.setValue(v) \u505A\u53CC\u5411\u7ED1\u5B9A\u3002",
|
|
93
90
|
detail: "any",
|
|
@@ -31,6 +31,7 @@ __export(JSFieldRunJSContext_exports, {
|
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(JSFieldRunJSContext_exports);
|
|
33
33
|
var import_flowContext = require("../../flowContext");
|
|
34
|
+
var import_elementDoc = require("./elementDoc");
|
|
34
35
|
const _JSFieldRunJSContext = class _JSFieldRunJSContext extends import_flowContext.FlowRunJSContext {
|
|
35
36
|
};
|
|
36
37
|
__name(_JSFieldRunJSContext, "JSFieldRunJSContext");
|
|
@@ -38,8 +39,8 @@ let JSFieldRunJSContext = _JSFieldRunJSContext;
|
|
|
38
39
|
JSFieldRunJSContext.define({
|
|
39
40
|
label: "JSField RunJS context",
|
|
40
41
|
properties: {
|
|
41
|
-
element: `ElementProxy instance providing a safe DOM container for field rendering.
|
|
42
|
-
Supports innerHTML, append, and other DOM manipulation methods
|
|
42
|
+
element: (0, import_elementDoc.createElementPropertyDoc)(`ElementProxy instance providing a safe DOM container for field rendering.
|
|
43
|
+
Supports innerHTML, append, and other DOM manipulation methods.`),
|
|
43
44
|
value: `Current value of the field (read-only).
|
|
44
45
|
Contains the data value stored in this field.`,
|
|
45
46
|
record: `Current record data object (read-only).
|
|
@@ -57,7 +58,7 @@ JSFieldRunJSContext.define(
|
|
|
57
58
|
{
|
|
58
59
|
label: "JS \u5B57\u6BB5 RunJS \u4E0A\u4E0B\u6587",
|
|
59
60
|
properties: {
|
|
60
|
-
element: "ElementProxy\uFF0C\u5B57\u6BB5\u6E32\u67D3\u5BB9\u5668\uFF0C\u652F\u6301 innerHTML/append \u7B49 DOM \u64CD\u4F5C",
|
|
61
|
+
element: (0, import_elementDoc.createZhCNElementPropertyDoc)("ElementProxy\uFF0C\u5B57\u6BB5\u6E32\u67D3\u5BB9\u5668\uFF0C\u652F\u6301 innerHTML/append \u7B49 DOM \u64CD\u4F5C"),
|
|
61
62
|
value: "\u5B57\u6BB5\u5F53\u524D\u503C\uFF08\u53EA\u8BFB\uFF09",
|
|
62
63
|
record: "\u5F53\u524D\u8BB0\u5F55\u5BF9\u8C61\uFF08\u53EA\u8BFB\uFF0C\u5305\u542B\u7236\u8BB0\u5F55\u5168\u90E8\u5B57\u6BB5\u503C\uFF09",
|
|
63
64
|
collection: "\u96C6\u5408\u5B9A\u4E49\u5143\u6570\u636E\uFF08\u53EA\u8BFB\uFF0C\u63CF\u8FF0\u5B57\u6BB5\u6240\u5C5E\u96C6\u5408\u7684 Schema\uFF09"
|