@nocobase/flow-engine 2.0.0-alpha.4 → 2.0.0-alpha.41
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/BlockScopedFlowEngine.d.ts +23 -0
- package/lib/BlockScopedFlowEngine.js +90 -0
- package/lib/FlowContextProvider.d.ts +2 -2
- package/lib/FlowContextProvider.js +3 -3
- package/lib/FlowDefinition.d.ts +4 -2
- package/lib/JSRunner.js +3 -0
- package/lib/ViewScopedFlowEngine.d.ts +1 -1
- package/lib/ViewScopedFlowEngine.js +12 -0
- package/lib/acl/Acl.d.ts +1 -0
- package/lib/acl/Acl.js +11 -0
- package/lib/components/FieldModelRenderer.js +14 -6
- package/lib/components/FieldSkeleton.d.ts +10 -0
- package/lib/components/FieldSkeleton.js +64 -0
- package/lib/components/FlowContextSelector.js +7 -2
- package/lib/components/FlowModelRenderer.d.ts +3 -6
- package/lib/components/FlowModelRenderer.js +16 -47
- package/lib/components/FormItem.js +5 -1
- package/lib/components/MobilePopup.d.ts +20 -0
- package/lib/components/MobilePopup.js +102 -0
- package/lib/components/MobilePopup.style.d.ts +17 -0
- package/lib/components/MobilePopup.style.js +186 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +3 -1
- package/lib/components/settings/independents/dropdown/FlowsDropdownButton.js +2 -2
- package/lib/components/settings/wrappers/contextual/DefaultSettingsIcon.js +17 -5
- package/lib/components/settings/wrappers/contextual/FlowsContextMenu.js +2 -2
- package/lib/components/settings/wrappers/contextual/FlowsFloatContextMenu.d.ts +2 -2
- package/lib/components/settings/wrappers/contextual/FlowsFloatContextMenu.js +35 -6
- package/lib/components/settings/wrappers/contextual/StepSettingsDialog.js +7 -1
- package/lib/components/variables/VariableInput.js +19 -5
- package/lib/components/variables/VariableTag.js +43 -2
- package/lib/components/variables/types.d.ts +2 -0
- package/lib/data-source/index.d.ts +15 -4
- package/lib/data-source/index.js +42 -13
- package/lib/data-source/sortCollectionsByInherits.d.ts +10 -0
- package/lib/data-source/sortCollectionsByInherits.js +71 -0
- package/lib/emitter.d.ts +6 -0
- package/lib/emitter.js +12 -0
- package/lib/executor/FlowExecutor.d.ts +4 -5
- package/lib/executor/FlowExecutor.js +168 -99
- package/lib/flow-registry/GlobalFlowRegistry.d.ts +1 -0
- package/lib/flow-registry/GlobalFlowRegistry.js +3 -0
- package/lib/flow-registry/InstanceFlowRegistry.d.ts +1 -0
- package/lib/flow-registry/InstanceFlowRegistry.js +3 -0
- package/lib/flowContext.d.ts +37 -5
- package/lib/flowContext.js +224 -87
- package/lib/flowEngine.d.ts +24 -1
- package/lib/flowEngine.js +81 -8
- package/lib/flowSettings.d.ts +2 -1
- package/lib/flowSettings.js +16 -8
- package/lib/hooks/useApplyAutoFlows.js +2 -1
- package/lib/index.d.ts +7 -1
- package/lib/index.js +32 -3
- package/lib/locale/en-US.json +4 -2
- package/lib/locale/index.d.ts +4 -0
- package/lib/locale/zh-CN.json +4 -2
- package/lib/models/CollectionFieldModel.d.ts +3 -0
- package/lib/models/CollectionFieldModel.js +52 -6
- package/lib/models/flowModel.d.ts +30 -29
- package/lib/models/flowModel.js +153 -100
- package/lib/models/forkFlowModel.d.ts +8 -4
- package/lib/models/forkFlowModel.js +38 -8
- package/lib/provider.d.ts +3 -1
- package/lib/provider.js +7 -5
- package/lib/resources/multiRecordResource.js +25 -1
- package/lib/resources/singleRecordResource.js +19 -1
- package/lib/resources/sqlResource.d.ts +1 -0
- package/lib/resources/sqlResource.js +20 -24
- package/lib/runjs-context/contexts/FormJSFieldItemRunJSContext.d.ts +1 -6
- package/lib/runjs-context/contexts/FormJSFieldItemRunJSContext.js +27 -20
- package/lib/runjs-context/contexts/JSBlockRunJSContext.d.ts +1 -6
- package/lib/runjs-context/contexts/JSBlockRunJSContext.js +46 -33
- package/lib/runjs-context/contexts/JSCollectionActionRunJSContext.d.ts +1 -2
- package/lib/runjs-context/contexts/JSCollectionActionRunJSContext.js +14 -15
- package/lib/runjs-context/contexts/{LinkageRunJSContext.d.ts → JSColumnRunJSContext.d.ts} +6 -3
- package/lib/runjs-context/contexts/JSColumnRunJSContext.js +78 -0
- package/lib/runjs-context/contexts/JSFieldRunJSContext.d.ts +1 -6
- package/lib/runjs-context/contexts/JSFieldRunJSContext.js +28 -24
- package/lib/runjs-context/contexts/JSItemRunJSContext.d.ts +1 -6
- package/lib/runjs-context/contexts/JSItemRunJSContext.js +24 -20
- package/lib/runjs-context/contexts/JSRecordActionRunJSContext.d.ts +1 -2
- package/lib/runjs-context/contexts/JSRecordActionRunJSContext.js +16 -17
- package/lib/runjs-context/contexts/base.d.ts +9 -0
- package/lib/runjs-context/contexts/base.js +205 -0
- package/lib/runjs-context/helpers.d.ts +5 -2
- package/lib/runjs-context/helpers.js +36 -27
- package/lib/runjs-context/registry.d.ts +7 -4
- package/lib/runjs-context/registry.js +10 -42
- package/lib/runjs-context/setup.d.ts +9 -0
- package/lib/runjs-context/setup.js +82 -0
- package/lib/runjs-context/snippets/global/{copy-record-json.snippet.js → api-request.snippet.js} +25 -10
- package/lib/runjs-context/snippets/global/clipboard-copy-text.snippet.js +61 -0
- package/lib/runjs-context/snippets/global/{view-navigation-push.snippet.js → import-esm.snippet.js} +26 -12
- package/lib/runjs-context/snippets/global/message-error.snippet.js +6 -0
- package/lib/runjs-context/snippets/global/message-success.snippet.js +6 -0
- package/lib/runjs-context/snippets/global/notification-open.snippet.d.ts +3 -8
- package/lib/runjs-context/snippets/global/notification-open.snippet.js +8 -1
- package/lib/runjs-context/snippets/global/open-view-dialog.snippet.js +10 -3
- package/lib/runjs-context/snippets/global/open-view-drawer.snippet.js +10 -3
- package/lib/runjs-context/snippets/global/query-selector.snippet.js +53 -0
- package/lib/runjs-context/snippets/global/require-amd.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/global/{requireAsync.snippet.js → require-amd.snippet.js} +16 -13
- package/lib/runjs-context/snippets/global/window-open.snippet.d.ts +3 -8
- package/lib/runjs-context/snippets/global/window-open.snippet.js +8 -1
- package/lib/runjs-context/snippets/index.d.ts +14 -3
- package/lib/runjs-context/snippets/index.js +162 -40
- package/lib/runjs-context/snippets/scene/block/add-event-listener.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{jsblock → block}/add-event-listener.snippet.js +11 -2
- package/lib/runjs-context/snippets/scene/block/api-fetch-render-list.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/block/api-fetch-render-list.snippet.js +64 -0
- package/lib/runjs-context/snippets/scene/block/chartjs-bar.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/block/chartjs-bar.snippet.js +99 -0
- package/lib/runjs-context/snippets/{libs → scene/block}/echarts-init.snippet.js +24 -7
- package/lib/runjs-context/snippets/scene/block/render-antd-icons.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/block/render-antd-icons.snippet.js +65 -0
- package/lib/runjs-context/snippets/scene/block/render-button-handler.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{jsblock → block}/render-button-handler.snippet.js +17 -9
- package/lib/runjs-context/snippets/scene/block/render-iframe.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/block/render-iframe.snippet.js +57 -0
- package/lib/runjs-context/snippets/scene/block/render-info-card.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/block/render-info-card.snippet.js +71 -0
- package/lib/runjs-context/snippets/scene/block/render-react-jsx.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{jsblock/render-card.snippet.js → block/render-react-jsx.snippet.js} +26 -13
- package/lib/runjs-context/snippets/scene/block/render-react.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{jsblock → block}/render-react.snippet.js +18 -17
- package/lib/runjs-context/snippets/scene/block/render-statistics.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/block/render-statistics.snippet.js +95 -0
- package/lib/runjs-context/snippets/scene/block/render-timeline.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/block/render-timeline.snippet.js +84 -0
- package/lib/runjs-context/snippets/scene/block/resource-example.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/block/resource-example.snippet.js +60 -0
- package/lib/runjs-context/snippets/scene/block/three-users-orbit.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/block/three-users-orbit.snippet.js +283 -0
- package/lib/runjs-context/snippets/scene/block/vue-component.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/block/vue-component.snippet.js +124 -0
- package/lib/runjs-context/snippets/scene/detail/color-by-value.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{jsfield → detail}/color-by-value.snippet.js +13 -3
- package/lib/runjs-context/snippets/scene/detail/copy-to-clipboard.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/{global → scene/detail}/copy-to-clipboard.snippet.js +28 -6
- package/lib/runjs-context/snippets/scene/detail/format-number.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{jsfield → detail}/format-number.snippet.js +13 -3
- package/lib/runjs-context/snippets/scene/detail/innerHTML-value.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{jsfield → detail}/innerHTML-value.snippet.js +13 -3
- package/lib/runjs-context/snippets/scene/detail/percentage-bar.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/detail/percentage-bar.snippet.js +82 -0
- package/lib/runjs-context/snippets/scene/detail/relative-time.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/detail/relative-time.snippet.js +80 -0
- package/lib/runjs-context/snippets/scene/detail/status-tag.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/detail/status-tag.snippet.js +74 -0
- package/lib/runjs-context/snippets/scene/form/calculate-total.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/form/calculate-total.snippet.js +63 -0
- package/lib/runjs-context/snippets/scene/form/cascade-select.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/form/cascade-select.snippet.js +81 -0
- package/lib/runjs-context/snippets/scene/form/conditional-required.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/form/conditional-required.snippet.js +64 -0
- package/lib/runjs-context/snippets/scene/form/copy-field-values.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/form/copy-field-values.snippet.js +74 -0
- package/lib/runjs-context/snippets/scene/form/render-basic.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{jsitem → form}/render-basic.snippet.js +11 -2
- package/lib/runjs-context/snippets/scene/form/set-disabled.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{linkage → form}/set-disabled.snippet.js +12 -3
- package/lib/runjs-context/snippets/scene/form/set-field-value.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{linkage → form}/set-field-value.snippet.js +12 -3
- package/lib/runjs-context/snippets/scene/form/set-required.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{linkage → form}/set-required.snippet.js +12 -3
- package/lib/runjs-context/snippets/scene/form/toggle-multiple-fields.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/form/toggle-multiple-fields.snippet.js +67 -0
- package/lib/runjs-context/snippets/scene/form/toggle-visible.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{linkage → form}/toggle-visible.snippet.js +12 -3
- package/lib/runjs-context/snippets/scene/table/cell-open-dialog.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/table/cell-open-dialog.snippet.js +64 -0
- package/lib/runjs-context/snippets/scene/table/collection-selected-count.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{actions → table}/collection-selected-count.snippet.js +11 -2
- package/lib/runjs-context/snippets/scene/table/concat-fields.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/table/concat-fields.snippet.js +79 -0
- package/lib/runjs-context/snippets/scene/table/destroy-selected.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/{global/log-json-record.snippet.js → scene/table/destroy-selected.snippet.js} +24 -11
- package/lib/runjs-context/snippets/scene/table/export-selected-json.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/table/export-selected-json.snippet.js +64 -0
- package/lib/runjs-context/snippets/scene/table/iterate-selected-rows.snippet.d.ts +11 -0
- package/lib/runjs-context/snippets/scene/{actions → table}/iterate-selected-rows.snippet.js +11 -2
- package/lib/runjs-context/snippets/types.d.ts +9 -1
- package/lib/scheduler/ModelOperationScheduler.d.ts +51 -0
- package/lib/scheduler/ModelOperationScheduler.js +262 -0
- package/lib/types.d.ts +28 -3
- package/lib/types.js +4 -3
- package/lib/utils/associationObjectVariable.d.ts +32 -0
- package/lib/utils/associationObjectVariable.js +157 -0
- package/lib/utils/buildSettingsViewInputArgs.d.ts +19 -0
- package/lib/utils/buildSettingsViewInputArgs.js +75 -0
- package/lib/utils/createEphemeralContext.d.ts +13 -0
- package/lib/utils/createEphemeralContext.js +140 -0
- package/lib/utils/flows.d.ts +10 -0
- package/lib/{runjs-context/snippets/global/api-request-post.snippet.js → utils/flows.js} +21 -15
- package/lib/utils/index.d.ts +7 -2
- package/lib/utils/index.js +21 -2
- package/lib/utils/jsxTransform.d.ts +15 -0
- package/lib/utils/jsxTransform.js +68 -0
- package/lib/utils/params-resolvers.js +3 -3
- package/lib/utils/parsePathnameToViewParams.d.ts +1 -1
- package/lib/utils/parsePathnameToViewParams.js +41 -5
- package/lib/utils/pruneFilter.d.ts +21 -0
- package/lib/{runjs-context/snippets/global/try-catch-async.snippet.js → utils/pruneFilter.js} +24 -16
- package/lib/utils/safeGlobals.d.ts +5 -3
- package/lib/utils/safeGlobals.js +40 -0
- package/lib/utils/schema-utils.js +2 -2
- package/lib/utils/serverContextParams.d.ts +1 -0
- package/lib/utils/translation.d.ts +4 -1
- package/lib/utils/translation.js +6 -2
- package/lib/utils/variablesParams.d.ts +22 -5
- package/lib/utils/variablesParams.js +132 -36
- package/lib/views/DrawerComponent.js +21 -2
- package/lib/views/PageComponent.js +2 -1
- package/lib/views/ViewNavigation.d.ts +3 -9
- package/lib/views/ViewNavigation.js +16 -2
- package/lib/views/createViewMeta.d.ts +29 -1
- package/lib/views/createViewMeta.js +338 -72
- package/lib/views/index.d.ts +1 -0
- package/lib/views/index.js +3 -0
- package/lib/views/useDialog.d.ts +9 -8
- package/lib/views/useDialog.js +19 -14
- package/lib/views/useDrawer.d.ts +9 -8
- package/lib/views/useDrawer.js +54 -35
- package/lib/views/usePage.d.ts +9 -8
- package/lib/views/usePage.js +20 -14
- package/package.json +6 -3
- package/src/BlockScopedFlowEngine.ts +86 -0
- package/src/FlowContextProvider.tsx +4 -2
- package/src/JSRunner.ts +3 -0
- package/src/ViewScopedFlowEngine.ts +15 -1
- package/src/__tests__/JSRunner.test.ts +62 -53
- package/src/__tests__/blockScopedFlowEngine.test.ts +154 -0
- package/src/__tests__/createViewMeta.popup.test.ts +132 -0
- package/src/__tests__/flow-engine.test.ts +3 -0
- package/src/__tests__/flowContext.test.ts +52 -0
- package/src/__tests__/flowContextCreateJSRunner.test.ts +163 -0
- package/src/__tests__/flowEngine.saveModel.test.ts +4 -0
- package/src/__tests__/flowRunJSContextDefine.test.ts +508 -0
- package/src/__tests__/flowSettings.open.test.tsx +2 -0
- package/src/__tests__/flowSettings.test.ts +2 -0
- package/src/__tests__/globalFlowRegistry.test.ts +1 -1
- package/src/__tests__/modelOperationScheduler.test.ts +346 -0
- package/src/__tests__/objectVariable.test.ts +464 -0
- package/src/__tests__/runjsContext.test.ts +216 -35
- package/src/__tests__/runjsContextImplementations.test.ts +217 -0
- package/src/__tests__/runjsContextRuntime.test.ts +269 -0
- package/src/__tests__/runjsEdgeCases.test.ts +281 -0
- package/src/__tests__/runjsLocales.test.ts +36 -0
- package/src/__tests__/runjsRuntimeFeatures.test.ts +461 -0
- package/src/__tests__/runjsSnippets.test.ts +140 -0
- package/src/__tests__/viewScopedFlowEngine.test.ts +3 -3
- package/src/acl/Acl.tsx +14 -0
- package/src/acl/__tests__/Acl.test.tsx +43 -0
- package/src/components/DynamicFlowsEditor.tsx +3 -4
- package/src/components/FieldModelRenderer.tsx +20 -7
- package/src/components/FieldSkeleton.tsx +27 -0
- package/src/components/FlowContextSelector.tsx +6 -2
- package/src/components/FlowModelRenderer.tsx +33 -81
- package/src/components/FormItem.tsx +8 -1
- package/src/components/MobilePopup.style.ts +220 -0
- package/src/components/MobilePopup.tsx +86 -0
- package/src/components/__tests__/flow-model-render-error-fallback.test.tsx +6 -6
- package/src/components/index.ts +1 -0
- package/src/components/settings/independents/dropdown/FlowsDropdownButton.tsx +1 -1
- package/src/components/settings/wrappers/contextual/DefaultSettingsIcon.tsx +17 -4
- package/src/components/settings/wrappers/contextual/FlowsContextMenu.tsx +1 -1
- package/src/components/settings/wrappers/contextual/FlowsFloatContextMenu.tsx +39 -10
- package/src/components/settings/wrappers/contextual/StepSettingsDialog.tsx +14 -1
- package/src/components/settings/wrappers/contextual/__tests__/DefaultSettingsIcon.test.tsx +425 -0
- package/src/components/subModel/__tests__/AddSubModelButton.test.tsx +5 -7
- package/src/components/variables/VariableInput.tsx +25 -5
- package/src/components/variables/VariableTag.tsx +54 -2
- package/src/components/variables/types.ts +2 -0
- package/src/data-source/__tests__/sortCollectionsByInherits.test.ts +125 -0
- package/src/data-source/index.ts +42 -11
- package/src/data-source/sortCollectionsByInherits.ts +61 -0
- package/src/emitter.ts +14 -0
- package/src/executor/FlowExecutor.ts +213 -119
- package/src/executor/__tests__/ctx-defs-injection.test.ts +197 -0
- package/src/executor/__tests__/flowExecutor.test.ts +151 -5
- package/src/flow-registry/GlobalFlowRegistry.ts +1 -0
- package/src/flow-registry/InstanceFlowRegistry.ts +1 -0
- package/src/flow-registry/__tests__/globalFlowRegistry.test.ts +54 -0
- package/src/flowContext.ts +303 -104
- package/src/flowEngine.ts +96 -6
- package/src/flowSettings.ts +12 -4
- package/src/hooks/useApplyAutoFlows.ts +3 -1
- package/src/index.ts +12 -1
- package/src/locale/en-US.json +4 -2
- package/src/locale/zh-CN.json +4 -2
- package/src/models/CollectionFieldModel.tsx +60 -8
- package/src/models/__tests__/dispatchEvent.behavior.test.ts +169 -0
- package/src/models/__tests__/flowModel.getFlows.sort.test.ts +33 -9
- package/src/models/__tests__/flowModel.scheduleModelOperation.test.tsx +129 -0
- package/src/models/__tests__/flowModel.test.ts +234 -111
- package/src/models/__tests__/forkFlowModel.test.ts +40 -7
- package/src/models/flowModel.tsx +197 -132
- package/src/models/forkFlowModel.ts +48 -8
- package/src/provider.tsx +10 -7
- package/src/resources/multiRecordResource.ts +28 -1
- package/src/resources/singleRecordResource.ts +19 -1
- package/src/resources/sqlResource.ts +20 -25
- package/src/runjs-context/contexts/FormJSFieldItemRunJSContext.ts +28 -21
- package/src/runjs-context/contexts/JSBlockRunJSContext.ts +46 -34
- package/src/runjs-context/contexts/JSCollectionActionRunJSContext.ts +15 -16
- package/src/runjs-context/contexts/JSColumnRunJSContext.ts +58 -0
- package/src/runjs-context/contexts/JSFieldRunJSContext.ts +30 -25
- package/src/runjs-context/contexts/JSItemRunJSContext.ts +25 -21
- package/src/runjs-context/contexts/JSRecordActionRunJSContext.ts +17 -18
- package/src/runjs-context/contexts/base.ts +196 -0
- package/src/runjs-context/helpers.ts +32 -30
- package/src/runjs-context/registry.ts +16 -47
- package/src/runjs-context/setup.ts +51 -0
- package/src/runjs-context/snippets/global/api-request.snippet.ts +38 -0
- package/src/runjs-context/snippets/global/clipboard-copy-text.snippet.ts +42 -0
- package/src/runjs-context/snippets/global/import-esm.snippet.ts +39 -0
- package/src/runjs-context/snippets/global/message-error.snippet.ts +6 -0
- package/src/runjs-context/snippets/global/message-success.snippet.ts +6 -0
- package/src/runjs-context/snippets/global/notification-open.snippet.ts +11 -1
- package/src/runjs-context/snippets/global/open-view-dialog.snippet.ts +10 -3
- package/src/runjs-context/snippets/global/open-view-drawer.snippet.ts +10 -3
- package/src/runjs-context/snippets/global/query-selector.snippet.ts +34 -0
- package/src/runjs-context/snippets/global/require-amd.snippet.ts +30 -0
- package/src/runjs-context/snippets/global/window-open.snippet.ts +11 -1
- package/src/runjs-context/snippets/index.ts +178 -39
- package/src/runjs-context/snippets/scene/{jsblock → block}/add-event-listener.snippet.ts +14 -2
- package/src/runjs-context/snippets/scene/block/api-fetch-render-list.snippet.ts +45 -0
- package/src/runjs-context/snippets/scene/block/chartjs-bar.snippet.ts +80 -0
- package/src/runjs-context/snippets/scene/block/echarts-init.snippet.ts +44 -0
- package/src/runjs-context/snippets/scene/block/render-antd-icons.snippet.ts +46 -0
- package/src/runjs-context/snippets/scene/block/render-button-handler.snippet.ts +35 -0
- package/src/runjs-context/snippets/scene/block/render-iframe.snippet.ts +38 -0
- package/src/runjs-context/snippets/scene/block/render-info-card.snippet.ts +52 -0
- package/src/runjs-context/snippets/scene/block/render-react-jsx.snippet.ts +39 -0
- package/src/runjs-context/snippets/scene/block/render-react.snippet.ts +38 -0
- package/src/runjs-context/snippets/scene/block/render-statistics.snippet.ts +76 -0
- package/src/runjs-context/snippets/scene/block/render-timeline.snippet.ts +65 -0
- package/src/runjs-context/snippets/scene/block/resource-example.snippet.ts +46 -0
- package/src/runjs-context/snippets/scene/block/three-users-orbit.snippet.ts +264 -0
- package/src/runjs-context/snippets/scene/block/vue-component.snippet.ts +105 -0
- package/src/runjs-context/snippets/scene/detail/color-by-value.snippet.ts +33 -0
- package/src/runjs-context/snippets/scene/detail/copy-to-clipboard.snippet.ts +45 -0
- package/src/runjs-context/snippets/scene/detail/format-number.snippet.ts +32 -0
- package/src/runjs-context/snippets/scene/detail/innerHTML-value.snippet.ts +31 -0
- package/src/runjs-context/snippets/scene/detail/percentage-bar.snippet.ts +63 -0
- package/src/runjs-context/snippets/scene/detail/relative-time.snippet.ts +61 -0
- package/src/runjs-context/snippets/scene/detail/status-tag.snippet.ts +55 -0
- package/src/runjs-context/snippets/scene/form/calculate-total.snippet.ts +44 -0
- package/src/runjs-context/snippets/scene/form/cascade-select.snippet.ts +62 -0
- package/src/runjs-context/snippets/scene/form/conditional-required.snippet.ts +45 -0
- package/src/runjs-context/snippets/scene/form/copy-field-values.snippet.ts +55 -0
- package/src/runjs-context/snippets/scene/{jsitem → form}/render-basic.snippet.ts +14 -2
- package/src/runjs-context/snippets/scene/{linkage → form}/set-disabled.snippet.ts +15 -3
- package/src/runjs-context/snippets/scene/{linkage → form}/set-field-value.snippet.ts +15 -3
- package/src/runjs-context/snippets/scene/{linkage → form}/set-required.snippet.ts +15 -3
- package/src/runjs-context/snippets/scene/form/toggle-multiple-fields.snippet.ts +48 -0
- package/src/runjs-context/snippets/scene/{linkage → form}/toggle-visible.snippet.ts +15 -3
- package/src/runjs-context/snippets/scene/table/cell-open-dialog.snippet.ts +45 -0
- package/src/runjs-context/snippets/scene/{actions → table}/collection-selected-count.snippet.ts +14 -2
- package/src/runjs-context/snippets/scene/table/concat-fields.snippet.ts +60 -0
- package/src/runjs-context/snippets/scene/table/destroy-selected.snippet.ts +36 -0
- package/src/runjs-context/snippets/scene/table/export-selected-json.snippet.ts +45 -0
- package/src/runjs-context/snippets/scene/{actions → table}/iterate-selected-rows.snippet.ts +14 -2
- package/src/runjs-context/snippets/types.ts +5 -1
- package/src/scheduler/ModelOperationScheduler.ts +304 -0
- package/src/types.ts +34 -0
- package/src/utils/__tests__/flows.test.ts +65 -0
- package/src/utils/__tests__/jsxTransform.test.ts +38 -0
- package/src/utils/__tests__/parsePathnameToViewParams.test.ts +25 -0
- package/src/utils/__tests__/pruneFilter.test.ts +38 -0
- package/src/utils/__tests__/safeGlobals.test.ts +22 -1
- package/src/utils/__tests__/variablesParams.test.ts +63 -0
- package/src/utils/associationObjectVariable.ts +180 -0
- package/src/utils/buildSettingsViewInputArgs.ts +72 -0
- package/src/utils/createEphemeralContext.ts +142 -0
- package/src/utils/flows.ts +23 -0
- package/src/utils/index.ts +11 -2
- package/src/utils/jsxTransform.ts +39 -0
- package/src/utils/params-resolvers.ts +2 -2
- package/src/utils/parsePathnameToViewParams.ts +50 -6
- package/src/utils/pruneFilter.ts +41 -0
- package/src/utils/safeGlobals.ts +49 -3
- package/src/utils/schema-utils.ts +1 -1
- package/src/utils/serverContextParams.ts +1 -0
- package/src/utils/translation.ts +7 -2
- package/src/utils/variablesParams.ts +156 -38
- package/src/views/DrawerComponent.tsx +21 -2
- package/src/views/PageComponent.tsx +1 -1
- package/src/views/ViewNavigation.ts +20 -12
- package/src/views/__tests__/ViewNavigation.test.ts +10 -0
- package/src/views/createViewMeta.ts +393 -70
- package/src/views/index.tsx +1 -0
- package/src/views/useDialog.tsx +24 -18
- package/src/views/useDrawer.tsx +74 -45
- package/src/views/usePage.tsx +26 -17
- package/lib/runjs-context/contexts/FlowRunJSContext.d.ts +0 -38
- package/lib/runjs-context/contexts/FlowRunJSContext.js +0 -217
- package/lib/runjs-context/contexts/LinkageRunJSContext.js +0 -62
- package/lib/runjs-context/index.d.ts +0 -19
- package/lib/runjs-context/index.js +0 -57
- package/lib/runjs-context/snippets/global/api-request-get.snippet.d.ts +0 -16
- package/lib/runjs-context/snippets/global/api-request-get.snippet.js +0 -42
- package/lib/runjs-context/snippets/global/api-request-post.snippet.d.ts +0 -16
- package/lib/runjs-context/snippets/global/console-log-ctx.snippet.d.ts +0 -16
- package/lib/runjs-context/snippets/global/console-log-ctx.snippet.js +0 -41
- package/lib/runjs-context/snippets/global/requireAsync.snippet.d.ts +0 -16
- package/lib/runjs-context/snippets/global/sleep.snippet.d.ts +0 -16
- package/lib/runjs-context/snippets/global/sleep.snippet.js +0 -43
- package/lib/runjs-context/snippets/global/try-catch-async.snippet.d.ts +0 -16
- package/lib/runjs-context/snippets/libs/echarts-init.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/actions/collection-selected-count.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/actions/iterate-selected-rows.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/actions/record-id-message.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/actions/record-id-message.snippet.js +0 -43
- package/lib/runjs-context/snippets/scene/actions/run-action-basic.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/actions/run-action-basic.snippet.js +0 -40
- package/lib/runjs-context/snippets/scene/jsblock/add-event-listener.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/jsblock/append-style.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/jsblock/append-style.snippet.js +0 -42
- package/lib/runjs-context/snippets/scene/jsblock/jsx-mount.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/jsblock/jsx-mount.snippet.js +0 -46
- package/lib/runjs-context/snippets/scene/jsblock/jsx-unmount.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/jsblock/jsx-unmount.snippet.js +0 -41
- package/lib/runjs-context/snippets/scene/jsblock/render-basic.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/jsblock/render-basic.snippet.js +0 -41
- package/lib/runjs-context/snippets/scene/jsblock/render-button-handler.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/jsblock/render-react.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/jsfield/color-by-value.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/jsfield/format-number.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/jsfield/innerHTML-value.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/jsitem/render-basic.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/linkage/set-disabled.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/linkage/set-field-value.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/linkage/set-required.snippet.d.ts +0 -15
- package/lib/runjs-context/snippets/scene/linkage/toggle-visible.snippet.d.ts +0 -15
- package/src/runjs-context/contexts/FlowRunJSContext.ts +0 -190
- package/src/runjs-context/contexts/LinkageRunJSContext.ts +0 -35
- package/src/runjs-context/index.ts +0 -20
- package/src/runjs-context/snippets/global/api-request-get.snippet.ts +0 -20
- package/src/runjs-context/snippets/global/api-request-post.snippet.ts +0 -20
- package/src/runjs-context/snippets/global/console-log-ctx.snippet.ts +0 -19
- package/src/runjs-context/snippets/global/copy-record-json.snippet.ts +0 -21
- package/src/runjs-context/snippets/global/copy-to-clipboard.snippet.ts +0 -21
- package/src/runjs-context/snippets/global/log-json-record.snippet.ts +0 -21
- package/src/runjs-context/snippets/global/requireAsync.snippet.ts +0 -24
- package/src/runjs-context/snippets/global/sleep.snippet.ts +0 -21
- package/src/runjs-context/snippets/global/try-catch-async.snippet.ts +0 -22
- package/src/runjs-context/snippets/global/view-navigation-push.snippet.ts +0 -23
- package/src/runjs-context/snippets/libs/echarts-init.snippet.ts +0 -24
- package/src/runjs-context/snippets/scene/actions/record-id-message.snippet.ts +0 -21
- package/src/runjs-context/snippets/scene/actions/run-action-basic.snippet.ts +0 -18
- package/src/runjs-context/snippets/scene/jsblock/append-style.snippet.ts +0 -20
- package/src/runjs-context/snippets/scene/jsblock/jsx-mount.snippet.ts +0 -24
- package/src/runjs-context/snippets/scene/jsblock/jsx-unmount.snippet.ts +0 -19
- package/src/runjs-context/snippets/scene/jsblock/render-basic.snippet.ts +0 -24
- package/src/runjs-context/snippets/scene/jsblock/render-button-handler.snippet.ts +0 -24
- package/src/runjs-context/snippets/scene/jsblock/render-card.snippet.ts +0 -30
- package/src/runjs-context/snippets/scene/jsblock/render-react.snippet.ts +0 -34
- package/src/runjs-context/snippets/scene/jsfield/color-by-value.snippet.ts +0 -20
- package/src/runjs-context/snippets/scene/jsfield/format-number.snippet.ts +0 -19
- package/src/runjs-context/snippets/scene/jsfield/innerHTML-value.snippet.ts +0 -18
- /package/lib/runjs-context/snippets/global/{copy-record-json.snippet.d.ts → api-request.snippet.d.ts} +0 -0
- /package/lib/runjs-context/snippets/global/{copy-to-clipboard.snippet.d.ts → clipboard-copy-text.snippet.d.ts} +0 -0
- /package/lib/runjs-context/snippets/global/{log-json-record.snippet.d.ts → import-esm.snippet.d.ts} +0 -0
- /package/lib/runjs-context/snippets/global/{view-navigation-push.snippet.d.ts → query-selector.snippet.d.ts} +0 -0
- /package/lib/runjs-context/snippets/scene/{jsblock/render-card.snippet.d.ts → block/echarts-init.snippet.d.ts} +0 -0
|
@@ -27,7 +27,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
28
|
var createViewMeta_exports = {};
|
|
29
29
|
__export(createViewMeta_exports, {
|
|
30
|
-
|
|
30
|
+
buildPopupRuntime: () => buildPopupRuntime,
|
|
31
|
+
createPopupMeta: () => createPopupMeta,
|
|
32
|
+
createViewMeta: () => createViewMeta,
|
|
33
|
+
registerPopupVariable: () => registerPopupVariable
|
|
31
34
|
});
|
|
32
35
|
module.exports = __toCommonJS(createViewMeta_exports);
|
|
33
36
|
var import_variablesParams = require("../utils/variablesParams");
|
|
@@ -79,93 +82,356 @@ function makeMetaFromValue(value, title, seen) {
|
|
|
79
82
|
return { type: "any", title };
|
|
80
83
|
}
|
|
81
84
|
__name(makeMetaFromValue, "makeMetaFromValue");
|
|
82
|
-
function
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const stack = Array.isArray(nav == null ? void 0 : nav.viewStack) ? nav.viewStack : [];
|
|
95
|
-
const stackMeta = {
|
|
96
|
-
type: "array",
|
|
97
|
-
title: t("\u89C6\u56FE\u5806\u6808"),
|
|
98
|
-
properties: void 0
|
|
99
|
-
};
|
|
100
|
-
if (stack.length) {
|
|
101
|
-
const children = {};
|
|
102
|
-
const max = Math.min(stack.length, 20);
|
|
103
|
-
for (let i = 0; i < max; i++) {
|
|
104
|
-
const item = stack[i] || {};
|
|
105
|
-
children[String(i)] = {
|
|
106
|
-
type: "object",
|
|
107
|
-
title: `#${i}`,
|
|
108
|
-
properties: {
|
|
109
|
-
viewUid: { type: "string", title: "viewUid" },
|
|
110
|
-
tabUid: { type: "string", title: "tabUid" },
|
|
111
|
-
filterByTk: { type: "string", title: "filterByTk" },
|
|
112
|
-
sourceId: { type: "string", title: "sourceId" }
|
|
113
|
-
}
|
|
85
|
+
function createViewMeta(ctx) {
|
|
86
|
+
const viewTitle = ctx.t("\u5F53\u524D\u89C6\u56FE");
|
|
87
|
+
const factory = /* @__PURE__ */ __name(async () => {
|
|
88
|
+
const view = ctx.view;
|
|
89
|
+
return {
|
|
90
|
+
type: "object",
|
|
91
|
+
title: ctx.t("\u5F53\u524D\u89C6\u56FE"),
|
|
92
|
+
buildVariablesParams: /* @__PURE__ */ __name((c) => {
|
|
93
|
+
const params = (0, import_variablesParams.inferViewRecordRef)(c);
|
|
94
|
+
if (params) {
|
|
95
|
+
return {
|
|
96
|
+
record: params
|
|
114
97
|
};
|
|
115
98
|
}
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
99
|
+
return void 0;
|
|
100
|
+
}, "buildVariablesParams"),
|
|
101
|
+
properties: /* @__PURE__ */ __name(async () => {
|
|
102
|
+
var _a, _b, _c;
|
|
103
|
+
const props = {};
|
|
104
|
+
const refNow = (0, import_variablesParams.inferViewRecordRef)(ctx);
|
|
105
|
+
if (refNow && refNow.collection) {
|
|
106
|
+
const recordFactory = /* @__PURE__ */ __name(async () => {
|
|
107
|
+
var _a2, _b2, _c2, _d;
|
|
108
|
+
try {
|
|
109
|
+
const ref = (0, import_variablesParams.inferViewRecordRef)(ctx);
|
|
110
|
+
if (!(ref == null ? void 0 : ref.collection)) return null;
|
|
111
|
+
const dsKey = ref.dataSourceKey || "main";
|
|
112
|
+
const ds = (_b2 = (_a2 = ctx.dataSourceManager) == null ? void 0 : _a2.getDataSource) == null ? void 0 : _b2.call(_a2, dsKey);
|
|
113
|
+
const col = (_d = (_c2 = ds == null ? void 0 : ds.collectionManager) == null ? void 0 : _c2.getCollection) == null ? void 0 : _d.call(_c2, ref.collection);
|
|
114
|
+
if (!col) return null;
|
|
115
|
+
return await (0, import_variablesParams.buildRecordMeta)(
|
|
116
|
+
() => col,
|
|
117
|
+
ctx.t("\u5F53\u524D\u89C6\u56FE\u8BB0\u5F55"),
|
|
118
|
+
(c) => (0, import_variablesParams.inferViewRecordRef)(c)
|
|
119
|
+
);
|
|
120
|
+
} catch (e) {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
}, "recordFactory");
|
|
124
|
+
recordFactory.title = ctx.t("\u5F53\u524D\u89C6\u56FE\u8BB0\u5F55");
|
|
125
|
+
recordFactory.hasChildren = true;
|
|
126
|
+
props.record = recordFactory;
|
|
127
|
+
}
|
|
128
|
+
props.type = { type: "string", title: ((_a = ctx.t) == null ? void 0 : _a.call(ctx, "\u7C7B\u578B")) || "\u7C7B\u578B" };
|
|
129
|
+
props.preventClose = { type: "boolean", title: ((_b = ctx.t) == null ? void 0 : _b.call(ctx, "\u662F\u5426\u5141\u8BB8\u5173\u95ED")) || "\u662F\u5426\u5141\u8BB8\u5173\u95ED" };
|
|
130
|
+
props.inputArgs = makeMetaFromValue(view == null ? void 0 : view.inputArgs, ((_c = ctx.t) == null ? void 0 : _c.call(ctx, "\u8F93\u5165\u53C2\u6570")) || "\u8F93\u5165\u53C2\u6570");
|
|
131
|
+
return props;
|
|
132
|
+
}, "properties")
|
|
133
|
+
};
|
|
134
|
+
}, "factory");
|
|
135
|
+
factory.title = viewTitle;
|
|
136
|
+
return factory;
|
|
122
137
|
}
|
|
123
|
-
__name(
|
|
124
|
-
function
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
138
|
+
__name(createViewMeta, "createViewMeta");
|
|
139
|
+
function createPopupMeta(ctx, anchorView) {
|
|
140
|
+
const t = /* @__PURE__ */ __name((k) => ctx.t(k), "t");
|
|
141
|
+
const resolveRecordRef = /* @__PURE__ */ __name(async (flowCtx) => {
|
|
142
|
+
const view = anchorView ?? flowCtx.view;
|
|
143
|
+
if (view) {
|
|
144
|
+
const base = await buildPopupRuntime(flowCtx, view);
|
|
145
|
+
const res = base == null ? void 0 : base.resource;
|
|
146
|
+
if ((res == null ? void 0 : res.collectionName) && res.filterByTk != null) {
|
|
147
|
+
return {
|
|
148
|
+
collection: res.collectionName,
|
|
149
|
+
dataSourceKey: res.dataSourceKey || "main",
|
|
150
|
+
filterByTk: res.filterByTk
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return (0, import_variablesParams.inferViewRecordRef)(flowCtx);
|
|
155
|
+
}, "resolveRecordRef");
|
|
156
|
+
const getCurrentCollection = /* @__PURE__ */ __name(async () => {
|
|
157
|
+
var _a, _b, _c, _d;
|
|
158
|
+
const ref = await resolveRecordRef(ctx);
|
|
159
|
+
if (!(ref == null ? void 0 : ref.collection)) return null;
|
|
160
|
+
const ds = (_b = (_a = ctx.dataSourceManager) == null ? void 0 : _a.getDataSource) == null ? void 0 : _b.call(_a, ref.dataSourceKey || "main");
|
|
161
|
+
return ((_d = (_c = ds == null ? void 0 : ds.collectionManager) == null ? void 0 : _c.getCollection) == null ? void 0 : _d.call(_c, ref.collection)) || null;
|
|
162
|
+
}, "getCurrentCollection");
|
|
163
|
+
const getParentRecordRef = /* @__PURE__ */ __name(async (level, flowCtx) => {
|
|
164
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
165
|
+
try {
|
|
166
|
+
const useCtx = flowCtx || ctx;
|
|
167
|
+
const nav = (_a = useCtx.view) == null ? void 0 : _a.navigation;
|
|
168
|
+
const stack = Array.isArray(nav == null ? void 0 : nav.viewStack) ? nav.viewStack : [];
|
|
169
|
+
if (stack.length < 2 || level < 1) return void 0;
|
|
170
|
+
const idx = stack.length - 1 - level;
|
|
171
|
+
if (idx < 0) return void 0;
|
|
172
|
+
const parent = stack[idx];
|
|
173
|
+
if (!(parent == null ? void 0 : parent.viewUid)) return void 0;
|
|
174
|
+
let model = (_c = (_b = useCtx.engine) == null ? void 0 : _b.getModel) == null ? void 0 : _c.call(_b, parent.viewUid);
|
|
175
|
+
if (!model) {
|
|
132
176
|
try {
|
|
133
|
-
|
|
134
|
-
if (!(ref == null ? void 0 : ref.collection)) return null;
|
|
135
|
-
const ds = (_b = (_a3 = ctx.dataSourceManager) == null ? void 0 : _a3.getDataSource) == null ? void 0 : _b.call(_a3, ref.dataSourceKey || "main");
|
|
136
|
-
return ((_d = (_c = ds == null ? void 0 : ds.collectionManager) == null ? void 0 : _c.getCollection) == null ? void 0 : _d.call(_c, ref.collection)) || null;
|
|
177
|
+
model = await useCtx.engine.loadModel({ uid: parent.viewUid });
|
|
137
178
|
} catch (e) {
|
|
138
|
-
|
|
179
|
+
(_e = (_d = useCtx.logger || ctx.logger) == null ? void 0 : _d.warn) == null ? void 0 : _e.call(_d, { err: e }, "[FlowEngine] popup.getParentRecordRef loadModel failed");
|
|
139
180
|
}
|
|
140
|
-
}
|
|
141
|
-
((
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
181
|
+
}
|
|
182
|
+
const params = ((_f = model == null ? void 0 : model.getStepParams) == null ? void 0 : _f.call(model, "popupSettings", "openView")) || {};
|
|
183
|
+
const collection = params == null ? void 0 : params.collectionName;
|
|
184
|
+
const dataSourceKey = (params == null ? void 0 : params.dataSourceKey) || "main";
|
|
185
|
+
const filterByTk = (parent == null ? void 0 : parent.filterByTk) ?? (parent == null ? void 0 : parent.sourceId);
|
|
186
|
+
if (!collection || typeof filterByTk === "undefined" || filterByTk === null) return void 0;
|
|
187
|
+
return { collection, dataSourceKey, filterByTk };
|
|
188
|
+
} catch (e) {
|
|
189
|
+
(_h = (_g = (flowCtx == null ? void 0 : flowCtx.logger) || ctx.logger) == null ? void 0 : _g.warn) == null ? void 0 : _h.call(_g, { err: e }, "[FlowEngine] popup.getParentRecordRef failed");
|
|
190
|
+
return void 0;
|
|
191
|
+
}
|
|
192
|
+
}, "getParentRecordRef");
|
|
193
|
+
const hasParentNow = /* @__PURE__ */ __name((level) => {
|
|
194
|
+
var _a;
|
|
195
|
+
try {
|
|
196
|
+
const nav = (_a = anchorView ?? ctx.view) == null ? void 0 : _a.navigation;
|
|
197
|
+
const stack = Array.isArray(nav == null ? void 0 : nav.viewStack) ? nav.viewStack : [];
|
|
198
|
+
return stack.length >= level + 1;
|
|
199
|
+
} catch (_) {
|
|
200
|
+
return false;
|
|
201
|
+
}
|
|
202
|
+
}, "hasParentNow");
|
|
203
|
+
const createParentFactory = /* @__PURE__ */ __name((level) => {
|
|
204
|
+
const factory2 = /* @__PURE__ */ __name(() => {
|
|
205
|
+
const meta = {
|
|
206
|
+
type: "object",
|
|
207
|
+
title: t("Parent popup"),
|
|
208
|
+
disabled: /* @__PURE__ */ __name(() => !hasParentNow(level), "disabled"),
|
|
209
|
+
disabledReason: /* @__PURE__ */ __name(() => !hasParentNow(level) ? t("No parent popup") : void 0, "disabledReason"),
|
|
210
|
+
properties: /* @__PURE__ */ __name(async () => {
|
|
211
|
+
const parentRef = await getParentRecordRef(level);
|
|
212
|
+
const props = {};
|
|
213
|
+
props.uid = { type: "string", title: t("Popup uid") };
|
|
214
|
+
if (parentRef) {
|
|
215
|
+
const parentCollection = (() => {
|
|
216
|
+
var _a, _b, _c, _d;
|
|
217
|
+
try {
|
|
218
|
+
const ds = (_b = (_a = ctx.dataSourceManager) == null ? void 0 : _a.getDataSource) == null ? void 0 : _b.call(_a, parentRef.dataSourceKey || "main");
|
|
219
|
+
return ((_d = (_c = ds == null ? void 0 : ds.collectionManager) == null ? void 0 : _c.getCollection) == null ? void 0 : _d.call(_c, parentRef.collection || "")) || null;
|
|
220
|
+
} catch (_) {
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
223
|
+
})();
|
|
224
|
+
const base = await (0, import_variablesParams.buildRecordMeta)(
|
|
225
|
+
() => parentCollection,
|
|
226
|
+
t("Popup record"),
|
|
227
|
+
() => parentRef
|
|
228
|
+
);
|
|
229
|
+
props.record = base || { type: "object", title: t("Popup record") };
|
|
230
|
+
} else {
|
|
231
|
+
props.record = { type: "object", title: t("Popup record") };
|
|
232
|
+
}
|
|
233
|
+
const resourceMeta = {
|
|
234
|
+
type: "object",
|
|
235
|
+
title: t("Data source"),
|
|
236
|
+
properties: /* @__PURE__ */ __name(async () => ({
|
|
237
|
+
dataSourceKey: { type: "string", title: t("Data source key") },
|
|
238
|
+
collectionName: { type: "string", title: t("Collection name") },
|
|
239
|
+
filterByTk: { type: "string", title: t("filterByTk") },
|
|
240
|
+
sourceId: { type: "string", title: t("sourceId") }
|
|
241
|
+
}), "properties")
|
|
242
|
+
};
|
|
243
|
+
props.resource = resourceMeta;
|
|
244
|
+
return props;
|
|
245
|
+
}, "properties")
|
|
246
|
+
};
|
|
247
|
+
return meta;
|
|
248
|
+
}, "factory");
|
|
249
|
+
factory2.title = t("Parent popup");
|
|
250
|
+
return factory2;
|
|
251
|
+
}, "createParentFactory");
|
|
252
|
+
const factory = /* @__PURE__ */ __name(() => {
|
|
253
|
+
const meta = {
|
|
146
254
|
type: "object",
|
|
147
|
-
title:
|
|
148
|
-
buildVariablesParams: /* @__PURE__ */ __name((c) => {
|
|
149
|
-
|
|
150
|
-
|
|
255
|
+
title: t("Current popup"),
|
|
256
|
+
buildVariablesParams: /* @__PURE__ */ __name(async (c) => {
|
|
257
|
+
var _a, _b, _c, _d, _e, _f;
|
|
258
|
+
const ref = await resolveRecordRef(c);
|
|
259
|
+
const inputArgs = (_a = c.view) == null ? void 0 : _a.inputArgs;
|
|
260
|
+
const params = {};
|
|
261
|
+
if (ref) params.record = ref;
|
|
262
|
+
try {
|
|
263
|
+
const nav = (_b = c.view) == null ? void 0 : _b.navigation;
|
|
264
|
+
const stack = Array.isArray(nav == null ? void 0 : nav.viewStack) ? nav.viewStack : [];
|
|
265
|
+
if (stack.length >= 2) {
|
|
266
|
+
let cur = params;
|
|
267
|
+
let level = 1;
|
|
268
|
+
let parentRef = await getParentRecordRef(level, c);
|
|
269
|
+
while (parentRef) {
|
|
270
|
+
if (!cur.parent) cur.parent = {};
|
|
271
|
+
cur.parent.record = parentRef;
|
|
272
|
+
cur = cur.parent;
|
|
273
|
+
level += 1;
|
|
274
|
+
parentRef = await getParentRecordRef(level, c);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
} catch (err) {
|
|
278
|
+
(_d = (_c = c.logger) == null ? void 0 : _c.debug) == null ? void 0 : _d.call(_c, { err }, "[FlowEngine] buildVariablesParams: build parent-chain failed");
|
|
279
|
+
}
|
|
280
|
+
try {
|
|
281
|
+
const srcId = inputArgs == null ? void 0 : inputArgs.sourceId;
|
|
282
|
+
const assoc = inputArgs == null ? void 0 : inputArgs.associationName;
|
|
283
|
+
const dsKey = (inputArgs == null ? void 0 : inputArgs.dataSourceKey) || "main";
|
|
284
|
+
if (srcId != null && srcId !== "" && assoc && typeof assoc === "string") {
|
|
285
|
+
const parentCollectionName = String(assoc).split(".")[0];
|
|
286
|
+
if (parentCollectionName) {
|
|
287
|
+
params.sourceRecord = {
|
|
288
|
+
collection: parentCollectionName,
|
|
289
|
+
dataSourceKey: dsKey,
|
|
290
|
+
filterByTk: srcId
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
} catch (err) {
|
|
295
|
+
(_f = (_e = c.logger) == null ? void 0 : _e.debug) == null ? void 0 : _f.call(_e, { err }, "[FlowEngine] buildVariablesParams: infer sourceRecord failed");
|
|
296
|
+
}
|
|
297
|
+
return params;
|
|
151
298
|
}, "buildVariablesParams"),
|
|
152
299
|
properties: /* @__PURE__ */ __name(async () => {
|
|
153
|
-
var
|
|
300
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
154
301
|
const props = {};
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
302
|
+
props.uid = { type: "string", title: t("Popup uid") };
|
|
303
|
+
const recordFactory = /* @__PURE__ */ __name(async () => {
|
|
304
|
+
const col = await getCurrentCollection();
|
|
305
|
+
if (!col) return null;
|
|
306
|
+
return await (0, import_variablesParams.buildRecordMeta)(
|
|
307
|
+
() => col,
|
|
308
|
+
t("Current popup record"),
|
|
309
|
+
(c) => resolveRecordRef(c)
|
|
310
|
+
);
|
|
311
|
+
}, "recordFactory");
|
|
312
|
+
recordFactory.title = t("Current popup record");
|
|
313
|
+
recordFactory.hasChildren = true;
|
|
314
|
+
props.record = recordFactory;
|
|
315
|
+
try {
|
|
316
|
+
const inputArgs = (_a = ctx.view) == null ? void 0 : _a.inputArgs;
|
|
317
|
+
const srcId = inputArgs == null ? void 0 : inputArgs.sourceId;
|
|
318
|
+
let assoc = inputArgs == null ? void 0 : inputArgs.associationName;
|
|
319
|
+
let dsKey = (inputArgs == null ? void 0 : inputArgs.dataSourceKey) || "main";
|
|
320
|
+
if (!assoc || typeof assoc !== "string" || !assoc.includes(".")) {
|
|
321
|
+
const nav = (_b = ctx.view) == null ? void 0 : _b.navigation;
|
|
322
|
+
const stack = Array.isArray(nav == null ? void 0 : nav.viewStack) ? nav.viewStack : [];
|
|
323
|
+
const last = stack == null ? void 0 : stack[stack.length - 1];
|
|
324
|
+
if (last == null ? void 0 : last.viewUid) {
|
|
325
|
+
let model = (_d = (_c = ctx == null ? void 0 : ctx.engine) == null ? void 0 : _c.getModel) == null ? void 0 : _d.call(_c, last.viewUid);
|
|
326
|
+
if (!model) {
|
|
327
|
+
model = await ctx.engine.loadModel({ uid: last.viewUid });
|
|
328
|
+
}
|
|
329
|
+
const p = ((_e = model == null ? void 0 : model.getStepParams) == null ? void 0 : _e.call(model, "popupSettings", "openView")) || {};
|
|
330
|
+
assoc = (p == null ? void 0 : p.associationName) || assoc;
|
|
331
|
+
dsKey = (p == null ? void 0 : p.dataSourceKey) || dsKey;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
if (srcId != null && srcId !== "" && assoc && typeof assoc === "string") {
|
|
335
|
+
const parentCollectionName = String(assoc).includes(".") ? String(assoc).split(".")[0] : void 0;
|
|
336
|
+
if (parentCollectionName) {
|
|
337
|
+
const parentCollectionAccessor = /* @__PURE__ */ __name(() => {
|
|
338
|
+
var _a2, _b2, _c2, _d2;
|
|
339
|
+
try {
|
|
340
|
+
const ds = (_b2 = (_a2 = ctx.dataSourceManager) == null ? void 0 : _a2.getDataSource) == null ? void 0 : _b2.call(_a2, dsKey);
|
|
341
|
+
return ((_d2 = (_c2 = ds == null ? void 0 : ds.collectionManager) == null ? void 0 : _c2.getCollection) == null ? void 0 : _d2.call(_c2, parentCollectionName)) || null;
|
|
342
|
+
} catch (_) {
|
|
343
|
+
return null;
|
|
344
|
+
}
|
|
345
|
+
}, "parentCollectionAccessor");
|
|
346
|
+
const srcMeta = await (0, import_variablesParams.buildRecordMeta)(parentCollectionAccessor, t("Current popup parent record"), () => ({
|
|
347
|
+
collection: parentCollectionName,
|
|
348
|
+
dataSourceKey: dsKey,
|
|
349
|
+
filterByTk: srcId
|
|
350
|
+
}));
|
|
351
|
+
if (srcMeta) {
|
|
352
|
+
props.sourceRecord = srcMeta;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
} catch (err) {
|
|
357
|
+
(_g = (_f = ctx.logger) == null ? void 0 : _f.debug) == null ? void 0 : _g.call(_f, { err }, "[FlowEngine] popup.properties: build sourceRecord failed");
|
|
358
|
+
}
|
|
359
|
+
const resourceMeta = {
|
|
360
|
+
type: "object",
|
|
361
|
+
title: t("Data source"),
|
|
362
|
+
properties: /* @__PURE__ */ __name(async () => ({
|
|
363
|
+
dataSourceKey: { type: "string", title: t("Data source key") },
|
|
364
|
+
collectionName: { type: "string", title: t("Collection name") },
|
|
365
|
+
filterByTk: { type: "string", title: t("filterByTk") },
|
|
366
|
+
sourceId: { type: "string", title: t("sourceId") }
|
|
367
|
+
}), "properties")
|
|
368
|
+
};
|
|
369
|
+
props.resource = resourceMeta;
|
|
370
|
+
const parentRef1 = await getParentRecordRef(1);
|
|
371
|
+
if (parentRef1) {
|
|
372
|
+
props.parent = createParentFactory(1);
|
|
373
|
+
}
|
|
160
374
|
return props;
|
|
161
375
|
}, "properties")
|
|
162
376
|
};
|
|
377
|
+
return meta;
|
|
163
378
|
}, "factory");
|
|
164
|
-
factory.title =
|
|
379
|
+
factory.title = t("Current popup");
|
|
380
|
+
factory.sort = 975;
|
|
165
381
|
return factory;
|
|
166
382
|
}
|
|
167
|
-
__name(
|
|
383
|
+
__name(createPopupMeta, "createPopupMeta");
|
|
384
|
+
async function buildPopupRuntime(ctx, view) {
|
|
385
|
+
var _a, _b;
|
|
386
|
+
const nav = view == null ? void 0 : view.navigation;
|
|
387
|
+
const stack = Array.isArray(nav == null ? void 0 : nav.viewStack) ? nav.viewStack : [];
|
|
388
|
+
const buildNode = /* @__PURE__ */ __name(async (idx) => {
|
|
389
|
+
var _a2, _b2, _c, _d, _e, _f, _g;
|
|
390
|
+
if (idx < 0 || !((_a2 = stack[idx]) == null ? void 0 : _a2.viewUid)) return void 0;
|
|
391
|
+
const viewUid = stack[idx].viewUid;
|
|
392
|
+
let model = (_c = (_b2 = ctx.engine) == null ? void 0 : _b2.getModel) == null ? void 0 : _c.call(_b2, viewUid);
|
|
393
|
+
if (!model) {
|
|
394
|
+
model = await ((_d = ctx.engine) == null ? void 0 : _d.loadModel({ uid: viewUid }));
|
|
395
|
+
}
|
|
396
|
+
const p = ((_e = model == null ? void 0 : model.getStepParams) == null ? void 0 : _e.call(model, "popupSettings", "openView")) || {};
|
|
397
|
+
const collectionName = p == null ? void 0 : p.collectionName;
|
|
398
|
+
const dataSourceKey = (p == null ? void 0 : p.dataSourceKey) || "main";
|
|
399
|
+
const node = {
|
|
400
|
+
uid: viewUid,
|
|
401
|
+
resource: {
|
|
402
|
+
dataSourceKey,
|
|
403
|
+
collectionName,
|
|
404
|
+
filterByTk: (_f = stack[idx]) == null ? void 0 : _f.filterByTk,
|
|
405
|
+
sourceId: (_g = stack[idx]) == null ? void 0 : _g.sourceId
|
|
406
|
+
}
|
|
407
|
+
};
|
|
408
|
+
const parentNode = await buildNode(idx - 1);
|
|
409
|
+
if (parentNode) node.parent = parentNode;
|
|
410
|
+
return node;
|
|
411
|
+
}, "buildNode");
|
|
412
|
+
const currentNode = await buildNode((((_b = (_a = view == null ? void 0 : view.navigation) == null ? void 0 : _a.viewStack) == null ? void 0 : _b.length) || 1) - 1);
|
|
413
|
+
return currentNode;
|
|
414
|
+
}
|
|
415
|
+
__name(buildPopupRuntime, "buildPopupRuntime");
|
|
416
|
+
function registerPopupVariable(ctx, view) {
|
|
417
|
+
const POPUP_SERVER_PATH_RE = /^(?:record|sourceRecord)(?:\.|$)|^parent(?:\.parent)*(?:\.(?:record|sourceRecord))(?:\.|$)/;
|
|
418
|
+
ctx.defineProperty("popup", {
|
|
419
|
+
get: /* @__PURE__ */ __name(async () => buildPopupRuntime(ctx, view), "get"),
|
|
420
|
+
meta: createPopupMeta(ctx, view),
|
|
421
|
+
resolveOnServer: /* @__PURE__ */ __name((p) => {
|
|
422
|
+
try {
|
|
423
|
+
return !!p && POPUP_SERVER_PATH_RE.test(p);
|
|
424
|
+
} catch (_) {
|
|
425
|
+
return false;
|
|
426
|
+
}
|
|
427
|
+
}, "resolveOnServer")
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
__name(registerPopupVariable, "registerPopupVariable");
|
|
168
431
|
// Annotate the CommonJS export names for ESM import in node:
|
|
169
432
|
0 && (module.exports = {
|
|
170
|
-
|
|
433
|
+
buildPopupRuntime,
|
|
434
|
+
createPopupMeta,
|
|
435
|
+
createViewMeta,
|
|
436
|
+
registerPopupVariable
|
|
171
437
|
});
|
package/lib/views/index.d.ts
CHANGED
package/lib/views/index.js
CHANGED
|
@@ -27,6 +27,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
27
27
|
var views_exports = {};
|
|
28
28
|
__export(views_exports, {
|
|
29
29
|
ViewNavigation: () => import_ViewNavigation.ViewNavigation,
|
|
30
|
+
createViewMeta: () => import_createViewMeta.createViewMeta,
|
|
30
31
|
useDialog: () => import_useDialog.useDialog,
|
|
31
32
|
useDrawer: () => import_useDrawer.useDrawer,
|
|
32
33
|
usePage: () => import_usePage.usePage,
|
|
@@ -38,9 +39,11 @@ var import_useDrawer = require("./useDrawer");
|
|
|
38
39
|
var import_usePage = require("./usePage");
|
|
39
40
|
var import_usePopover = require("./usePopover");
|
|
40
41
|
var import_ViewNavigation = require("./ViewNavigation");
|
|
42
|
+
var import_createViewMeta = require("./createViewMeta");
|
|
41
43
|
// Annotate the CommonJS export names for ESM import in node:
|
|
42
44
|
0 && (module.exports = {
|
|
43
45
|
ViewNavigation,
|
|
46
|
+
createViewMeta,
|
|
44
47
|
useDialog,
|
|
45
48
|
useDrawer,
|
|
46
49
|
usePage,
|
package/lib/views/useDialog.d.ts
CHANGED
|
@@ -9,24 +9,25 @@
|
|
|
9
9
|
import * as React from 'react';
|
|
10
10
|
export declare function useDialog(): (React.JSX.Element | {
|
|
11
11
|
open: (config: any, flowContext: any) => Promise<unknown> & {
|
|
12
|
-
type:
|
|
12
|
+
type: "dialog";
|
|
13
13
|
inputArgs: any;
|
|
14
14
|
preventClose: boolean;
|
|
15
15
|
destroy: () => void;
|
|
16
16
|
update: (newConfig: any) => void;
|
|
17
17
|
close: (result?: any, force?: boolean) => void;
|
|
18
|
-
Footer:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
18
|
+
Footer: React.FC<{
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
}>;
|
|
21
|
+
Header: React.FC<{
|
|
22
|
+
title?: React.ReactNode;
|
|
23
|
+
extra?: React.ReactNode;
|
|
24
|
+
}>;
|
|
25
25
|
setFooter: (footer: React.ReactNode) => void;
|
|
26
26
|
setHeader: (header: {
|
|
27
27
|
title?: React.ReactNode;
|
|
28
28
|
extra?: React.ReactNode;
|
|
29
29
|
}) => void;
|
|
30
30
|
navigation: any;
|
|
31
|
+
readonly record: unknown;
|
|
31
32
|
};
|
|
32
33
|
})[];
|
package/lib/views/useDialog.js
CHANGED
|
@@ -50,6 +50,7 @@ var import_DialogComponent = __toESM(require("./DialogComponent"));
|
|
|
50
50
|
var import_usePatchElement = __toESM(require("./usePatchElement"));
|
|
51
51
|
var import_provider = require("../provider");
|
|
52
52
|
var import_ViewScopedFlowEngine = require("../ViewScopedFlowEngine");
|
|
53
|
+
var import_variablesParams = require("../utils/variablesParams");
|
|
53
54
|
let uuid = 0;
|
|
54
55
|
function useDialog() {
|
|
55
56
|
const holderRef = React.useRef(null);
|
|
@@ -64,7 +65,7 @@ function useDialog() {
|
|
|
64
65
|
});
|
|
65
66
|
let currentFooter = null;
|
|
66
67
|
let currentHeader = null;
|
|
67
|
-
const FooterComponent = /* @__PURE__ */ __name(({ children
|
|
68
|
+
const FooterComponent = /* @__PURE__ */ __name(({ children }) => {
|
|
68
69
|
React.useEffect(() => {
|
|
69
70
|
var _a2;
|
|
70
71
|
currentFooter = children;
|
|
@@ -77,7 +78,7 @@ function useDialog() {
|
|
|
77
78
|
}, [children]);
|
|
78
79
|
return null;
|
|
79
80
|
}, "FooterComponent");
|
|
80
|
-
const HeaderComponent = /* @__PURE__ */ __name((
|
|
81
|
+
const HeaderComponent = /* @__PURE__ */ __name((props) => {
|
|
81
82
|
React.useEffect(() => {
|
|
82
83
|
var _a2;
|
|
83
84
|
currentHeader = props;
|
|
@@ -90,6 +91,15 @@ function useDialog() {
|
|
|
90
91
|
}, [props]);
|
|
91
92
|
return null;
|
|
92
93
|
}, "HeaderComponent");
|
|
94
|
+
const ctx = new import_flowContext.FlowContext();
|
|
95
|
+
const scopedEngine = (0, import_ViewScopedFlowEngine.createViewScopedEngine)(flowContext.engine);
|
|
96
|
+
ctx.defineProperty("engine", { value: scopedEngine });
|
|
97
|
+
ctx.addDelegate(scopedEngine.context);
|
|
98
|
+
if (config.inheritContext !== false) {
|
|
99
|
+
ctx.addDelegate(flowContext);
|
|
100
|
+
} else {
|
|
101
|
+
ctx.addDelegate(flowContext.engine.context);
|
|
102
|
+
}
|
|
93
103
|
const currentDialog = {
|
|
94
104
|
type: "dialog",
|
|
95
105
|
inputArgs: config.inputArgs || {},
|
|
@@ -123,22 +133,17 @@ function useDialog() {
|
|
|
123
133
|
currentHeader = header;
|
|
124
134
|
(_a2 = dialogRef.current) == null ? void 0 : _a2.setHeader(header);
|
|
125
135
|
}, "setHeader"),
|
|
126
|
-
navigation: (_a = config.inputArgs) == null ? void 0 : _a.navigation
|
|
136
|
+
navigation: (_a = config.inputArgs) == null ? void 0 : _a.navigation,
|
|
137
|
+
get record() {
|
|
138
|
+
return (0, import_variablesParams.getViewRecordFromParent)(flowContext, ctx);
|
|
139
|
+
}
|
|
127
140
|
};
|
|
128
|
-
const ctx = new import_flowContext.FlowContext();
|
|
129
141
|
ctx.defineProperty("view", {
|
|
130
142
|
get: /* @__PURE__ */ __name(() => currentDialog, "get"),
|
|
131
|
-
meta:
|
|
132
|
-
resolveOnServer:
|
|
143
|
+
// meta: createViewMeta(ctx),
|
|
144
|
+
resolveOnServer: (0, import_variablesParams.createViewRecordResolveOnServer)(ctx, () => (0, import_variablesParams.getViewRecordFromParent)(flowContext, ctx))
|
|
133
145
|
});
|
|
134
|
-
|
|
135
|
-
ctx.defineProperty("engine", { value: scopedEngine });
|
|
136
|
-
ctx.addDelegate(scopedEngine.context);
|
|
137
|
-
if (config.inheritContext !== false) {
|
|
138
|
-
ctx.addDelegate(flowContext);
|
|
139
|
-
} else {
|
|
140
|
-
ctx.addDelegate(flowContext.engine.context);
|
|
141
|
-
}
|
|
146
|
+
(0, import_createViewMeta.registerPopupVariable)(ctx, currentDialog);
|
|
142
147
|
const DialogWithContext = (0, import__.observer)(
|
|
143
148
|
() => {
|
|
144
149
|
var _a2, _b2, _c, _d;
|
package/lib/views/useDrawer.d.ts
CHANGED
|
@@ -10,24 +10,25 @@ import * as React from 'react';
|
|
|
10
10
|
import { FlowEngineContext } from '../flowContext';
|
|
11
11
|
export declare function useDrawer(): (React.JSX.Element | {
|
|
12
12
|
open: (config: any, flowContext: FlowEngineContext) => Promise<unknown> & {
|
|
13
|
-
type:
|
|
13
|
+
type: "drawer";
|
|
14
14
|
inputArgs: any;
|
|
15
15
|
preventClose: boolean;
|
|
16
16
|
destroy: () => void;
|
|
17
17
|
update: (newConfig: any) => void;
|
|
18
18
|
close: (result?: any, force?: boolean) => void;
|
|
19
|
-
Footer:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
19
|
+
Footer: React.FC<{
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
}>;
|
|
22
|
+
Header: React.FC<{
|
|
23
|
+
title?: React.ReactNode;
|
|
24
|
+
extra?: React.ReactNode;
|
|
25
|
+
}>;
|
|
26
26
|
setFooter: (footer: React.ReactNode) => void;
|
|
27
27
|
setHeader: (header: {
|
|
28
28
|
title?: React.ReactNode;
|
|
29
29
|
extra?: React.ReactNode;
|
|
30
30
|
}) => void;
|
|
31
31
|
navigation: any;
|
|
32
|
+
readonly record: unknown;
|
|
32
33
|
};
|
|
33
34
|
})[];
|