@nocobase/plugin-workflow 2.2.0-alpha.1 → 2.2.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client-v2.d.ts +2 -0
- package/client-v2.js +1 -0
- package/dist/client/119.e7dbd037d52d1286.js +10 -0
- package/dist/client/142.d84a976875799df4.js +10 -0
- package/dist/client/159.3d5abee06b818db3.js +10 -0
- package/dist/client/276.69fb2aea13bc7c37.js +10 -0
- package/dist/client/346.66d060d37843d3d1.js +10 -0
- package/dist/client/382.80ebd002a9971b65.js +10 -0
- package/dist/client/394.d7eacf666590a6ae.js +10 -0
- package/dist/client/438.c4de8f085e490158.js +10 -0
- package/dist/client/509.2f72dd97808f12d1.js +10 -0
- package/dist/client/54.c452a382e9b3953d.js +10 -0
- package/dist/client/618.a97bc812678ab2a7.js +10 -0
- package/dist/client/635.3f165e9ed7e940b2.js +10 -0
- package/dist/client/67.4117e04bd42f9d42.js +10 -0
- package/dist/client/719.5801e3f1cf81b97b.js +10 -0
- package/dist/client/739.955f18b3dc31ae3a.js +10 -0
- package/dist/client/759.13aab01e6912ed8d.js +10 -0
- package/dist/client/772.1ebaef11a0ac8688.js +10 -0
- package/dist/client/782.332fd345a98b82c2.js +10 -0
- package/dist/client/828.77de843c49fb307a.js +10 -0
- package/dist/client/87.d2c2b5b1cae08bfc.js +10 -0
- package/dist/client/938.77649c32dae1c225.js +10 -0
- package/dist/client/964.cb1ecff7a46687b7.js +10 -0
- package/dist/client/972.4da2796f3f2df874.js +10 -0
- package/dist/client/AddNodeContext.d.ts +1 -9
- package/dist/client/Branch.d.ts +1 -1
- package/dist/client/BranchContext.d.ts +2 -10
- package/dist/client/FlowContext.d.ts +10 -5
- package/dist/client/NodeClipboardContext.d.ts +12 -2
- package/dist/client/NodeDragContext.d.ts +14 -2
- package/dist/client/RemoveNodeContext.d.ts +16 -2
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/nodeVariableUtils.d.ts +7 -6
- package/dist/client/nodes/calculation.d.ts +3 -75
- package/dist/client/nodes/condition.d.ts +7 -111
- package/dist/client/nodes/create.d.ts +3 -124
- package/dist/client/nodes/destroy.d.ts +2 -57
- package/dist/client/nodes/end.d.ts +2 -23
- package/dist/client/nodes/index.d.ts +2 -91
- package/dist/client/nodes/multi-conditions.d.ts +10 -48
- package/dist/client/nodes/output.d.ts +2 -44
- package/dist/client/nodes/query.d.ts +3 -255
- package/dist/client/nodes/update.d.ts +2 -117
- package/dist/client/style.d.ts +7 -26
- package/dist/client/triggers/collection.d.ts +3 -154
- package/dist/client/triggers/index.d.ts +2 -36
- package/dist/client/triggers/schedule/index.d.ts +8 -65
- package/dist/client/utils.d.ts +4 -5
- package/dist/client/variable.d.ts +4 -44
- package/dist/client-v2/119.81195bcd0d451279.js +10 -0
- package/dist/client-v2/142.3d386748090ff6d3.js +10 -0
- package/dist/client-v2/159.cb221540c286cd32.js +10 -0
- package/dist/client-v2/224.44a5e1227bee33fb.js +10 -0
- package/dist/client-v2/276.43297f402f31970e.js +10 -0
- package/dist/client-v2/326.bdc99ad8e7590970.js +10 -0
- package/dist/client-v2/346.8c038b3c99d4fdc9.js +10 -0
- package/dist/client-v2/382.05f5482bb512b179.js +10 -0
- package/dist/client-v2/387.ab3eac2eb447f36f.js +10 -0
- package/dist/client-v2/394.515ed058e7f72797.js +10 -0
- package/dist/client-v2/438.b7df0416b66f8f64.js +10 -0
- package/dist/client-v2/513.ab2bdd96ad9ece4d.js +10 -0
- package/dist/client-v2/54.287764bc467d65da.js +10 -0
- package/dist/client-v2/635.37de4abe241b30e8.js +10 -0
- package/dist/client-v2/719.05cf070ef89a78f4.js +10 -0
- package/dist/client-v2/739.906e94bbe6d52a3d.js +10 -0
- package/dist/client-v2/759.7b162ad3adf450f1.js +10 -0
- package/dist/client-v2/772.8e5148d8c1518449.js +10 -0
- package/dist/client-v2/938.717e47af39485b29.js +10 -0
- package/dist/client-v2/ExecutionCanvas.d.ts +15 -0
- package/dist/client-v2/canvas/AddNodeContext.d.ts +35 -0
- package/dist/client-v2/canvas/AddNodeContext.shared.d.ts +33 -0
- package/dist/client-v2/canvas/AddNodeSlot.d.ts +20 -0
- package/dist/client-v2/canvas/Branch.d.ts +32 -0
- package/dist/client-v2/canvas/BranchContext.d.ts +20 -0
- package/dist/client-v2/canvas/BranchRenderContext.d.ts +14 -0
- package/dist/client-v2/canvas/CanvasContent.d.ts +20 -0
- package/dist/client-v2/canvas/DownstreamBranchIndex.d.ts +20 -0
- package/dist/client-v2/canvas/Instruction.d.ts +139 -0
- package/dist/{client/triggers/schedule/EndsByField.d.ts → client-v2/canvas/JobButton.d.ts} +3 -3
- package/dist/client-v2/canvas/Node.d.ts +36 -0
- package/dist/client-v2/canvas/NodeClipboardContext.d.ts +64 -0
- package/dist/client-v2/canvas/NodeConfigDrawer.d.ts +27 -0
- package/dist/client-v2/canvas/NodeDragContext.d.ts +83 -0
- package/dist/client-v2/canvas/RemoveNodeContext.d.ts +45 -0
- package/dist/client-v2/canvas/WorkflowTypedVariableInput.d.ts +16 -0
- package/dist/client-v2/canvas/WorkflowVariableInput.d.ts +39 -0
- package/dist/client-v2/canvas/WorkflowVariableJsonTextArea.d.ts +15 -0
- package/dist/client-v2/canvas/WorkflowVariableTextArea.d.ts +18 -0
- package/dist/client-v2/canvas/adaptVariableOptionToMetaTree.d.ts +48 -0
- package/dist/client-v2/canvas/addNodeController.d.ts +70 -0
- package/dist/client-v2/canvas/collectionFieldOptions.d.ts +57 -0
- package/dist/client-v2/canvas/contexts.d.ts +84 -0
- package/dist/client-v2/canvas/dropImpact.d.ts +28 -0
- package/dist/client-v2/canvas/instructionAvailability.d.ts +26 -0
- package/dist/client-v2/canvas/nodeRenderDispatch.d.ts +79 -0
- package/dist/client-v2/canvas/nodeTree.d.ts +21 -0
- package/dist/client-v2/canvas/nodeVariableUtils.d.ts +14 -0
- package/dist/client-v2/canvas/removeNodeUtils.d.ts +31 -0
- package/dist/client-v2/canvas/style.d.ts +35 -0
- package/dist/client-v2/canvas/textAreaInsertion.d.ts +14 -0
- package/dist/client-v2/canvas/useWorkflowInstruction.d.ts +23 -0
- package/dist/client-v2/canvas/useWorkflowVariableOptions.d.ts +40 -0
- package/dist/client-v2/canvas/workflowVariableConverters.d.ts +13 -0
- package/dist/client-v2/components/Calculation.d.ts +18 -0
- package/dist/client-v2/components/ExecutionStatusIcon.d.ts +18 -0
- package/dist/{client/triggers/schedule/RepeatField.d.ts → client-v2/components/ExecutionStatusTag.d.ts} +3 -4
- package/dist/client-v2/components/ExecutionViewHeader.d.ts +29 -0
- package/dist/client-v2/components/ExecutionsDropdown.d.ts +25 -0
- package/dist/client-v2/components/FilterDynamicComponent.d.ts +22 -0
- package/dist/client-v2/components/HideVariableContext.d.ts +11 -0
- package/dist/client-v2/components/JobResultModal.d.ts +11 -0
- package/dist/client-v2/components/RadioWithTooltip.d.ts +23 -0
- package/dist/client-v2/components/SyncModeSelect.d.ts +16 -0
- package/dist/{client/triggers/schedule/OnField.d.ts → client-v2/components/SyncModeTag.d.ts} +3 -3
- package/dist/client-v2/components/TestRunButton.d.ts +36 -0
- package/dist/client-v2/components/TimeoutInput.d.ts +15 -0
- package/dist/client-v2/components/WorkflowCanvasHeader.d.ts +17 -0
- package/dist/client-v2/components/WorkflowDetailsModal.d.ts +25 -0
- package/dist/client-v2/components/WorkflowEnabledSwitch.d.ts +16 -0
- package/dist/client-v2/components/WorkflowMenu.d.ts +17 -0
- package/dist/client-v2/components/WorkflowRevisionsDropdown.d.ts +15 -0
- package/dist/client-v2/components/WorkflowVariableWrapper.d.ts +25 -0
- package/dist/client-v2/components/collection/AppendsSelect.d.ts +15 -0
- package/dist/client-v2/components/collection/AssignedFieldsEditor.d.ts +16 -0
- package/dist/client-v2/components/collection/CollectionCascader.d.ts +15 -0
- package/dist/client-v2/components/collection/FieldsSelect.d.ts +16 -0
- package/dist/client-v2/components/collection/PaginationFields.d.ts +14 -0
- package/dist/client-v2/components/collection/SortFieldsInput.d.ts +19 -0
- package/dist/client-v2/components/collection/TriggerCollectionRecordSelect.d.ts +15 -0
- package/dist/client-v2/components/collection/index.d.ts +16 -0
- package/dist/client-v2/components/collection/utils.d.ts +42 -0
- package/dist/client-v2/components/formatResultForDisplay.d.ts +17 -0
- package/dist/client-v2/components/jobStatus.d.ts +27 -0
- package/dist/client-v2/components/renderEngineReference.d.ts +10 -0
- package/dist/client-v2/components/workflowCanvas.d.ts +41 -0
- package/dist/client-v2/constants.d.ts +14 -0
- package/dist/client-v2/hooks/useWorkflowRuntimePaths.d.ts +37 -0
- package/dist/client-v2/index.d.ts +43 -0
- package/dist/client-v2/index.js +10 -0
- package/dist/client-v2/locale.d.ts +41 -0
- package/dist/{client → client-v2}/models/NodeDetailsGridModel.d.ts +1 -1
- package/dist/{client → client-v2}/models/NodeDetailsModel.d.ts +1 -1
- package/dist/{client → client-v2}/models/NodeValueModel.d.ts +1 -1
- package/dist/{client → client-v2}/models/TaskCardCommonItemModel.d.ts +1 -1
- package/dist/{client → client-v2}/models/index.d.ts +1 -0
- package/dist/client-v2/models/triggerWorkflows.d.ts +43 -0
- package/dist/client-v2/nodes/calculation.d.ts +38 -0
- package/dist/client-v2/nodes/collectionNode.d.ts +29 -0
- package/dist/client-v2/nodes/components/calculation.d.ts +11 -0
- package/dist/client-v2/nodes/components/collection.d.ts +15 -0
- package/dist/client-v2/nodes/components/condition.d.ts +25 -0
- package/dist/client-v2/nodes/components/conditionShared.d.ts +20 -0
- package/dist/client-v2/nodes/components/create.d.ts +12 -0
- package/dist/client-v2/nodes/components/destroy.d.ts +12 -0
- package/dist/{client/triggers/schedule/ScheduleConfig.d.ts → client-v2/nodes/components/end.d.ts} +1 -1
- package/dist/client-v2/nodes/components/filter.d.ts +16 -0
- package/dist/client-v2/nodes/components/multi-conditions.d.ts +13 -0
- package/dist/client-v2/nodes/components/multiConditionsShared.d.ts +20 -0
- package/dist/client-v2/nodes/components/output.d.ts +10 -0
- package/dist/client-v2/nodes/components/query.d.ts +12 -0
- package/dist/client-v2/nodes/components/update.d.ts +12 -0
- package/dist/client-v2/nodes/condition.d.ts +46 -0
- package/dist/client-v2/nodes/create.d.ts +30 -0
- package/dist/client-v2/nodes/destroy.d.ts +24 -0
- package/dist/client-v2/nodes/end.d.ts +21 -0
- package/dist/client-v2/nodes/multi-conditions.d.ts +34 -0
- package/dist/client-v2/nodes/output.d.ts +29 -0
- package/dist/client-v2/nodes/query.d.ts +32 -0
- package/dist/client-v2/nodes/update.d.ts +25 -0
- package/dist/client-v2/pages/ExecutionHistoryDrawer.d.ts +13 -0
- package/dist/client-v2/pages/ExecutionViewPage.d.ts +10 -0
- package/dist/client-v2/pages/WorkflowCanvasPage.d.ts +10 -0
- package/dist/client-v2/pages/WorkflowCategoryTabs.d.ts +25 -0
- package/dist/client-v2/pages/WorkflowFormDrawer.d.ts +39 -0
- package/dist/client-v2/pages/WorkflowPane.d.ts +10 -0
- package/dist/client-v2/plugin.d.ts +67 -0
- package/dist/client-v2/triggers/ExecuteWorkflowButton.d.ts +35 -0
- package/dist/client-v2/triggers/TriggerConfig.d.ts +22 -0
- package/dist/client-v2/triggers/TriggerExecutionButton.d.ts +13 -0
- package/dist/client-v2/triggers/collection/CollectionConfig.d.ts +14 -0
- package/dist/client-v2/triggers/collection/TriggerCollectionConfig.d.ts +11 -0
- package/dist/client-v2/triggers/collection/constants.d.ts +28 -0
- package/dist/client-v2/triggers/collection/index.d.ts +40 -0
- package/dist/client-v2/triggers/index.d.ts +61 -0
- package/dist/client-v2/triggers/schedule/EndsByField.d.ts +17 -0
- package/dist/client-v2/triggers/schedule/OnField.d.ts +20 -0
- package/dist/client-v2/triggers/schedule/RepeatField.d.ts +23 -0
- package/dist/client-v2/triggers/schedule/ScheduleConfig.d.ts +17 -0
- package/dist/client-v2/triggers/schedule/ScheduleModes.d.ts +41 -0
- package/dist/{client → client-v2}/triggers/schedule/TriggerScheduleConfig.d.ts +1 -0
- package/dist/{client → client-v2}/triggers/schedule/constants.d.ts +8 -5
- package/dist/client-v2/triggers/schedule/index.d.ts +40 -0
- package/dist/client-v2/triggers/schedule/locale/Cron.zh-CN.d.ts +11 -0
- package/dist/common/executionStatus.d.ts +44 -0
- package/dist/common/executionStatus.js +133 -0
- package/dist/externalVersion.js +16 -12
- package/dist/locale/de-DE.json +14 -1
- package/dist/locale/en-US.json +22 -2
- package/dist/locale/es-ES.json +14 -1
- package/dist/locale/fr-FR.json +14 -1
- package/dist/locale/hu-HU.json +14 -1
- package/dist/locale/id-ID.json +14 -1
- package/dist/locale/it-IT.json +14 -1
- package/dist/locale/ja-JP.json +14 -1
- package/dist/locale/ko-KR.json +14 -1
- package/dist/locale/nl-NL.json +14 -1
- package/dist/locale/pt-BR.json +14 -1
- package/dist/locale/ru-RU.json +14 -1
- package/dist/locale/tr-TR.json +14 -1
- package/dist/locale/uk-UA.json +14 -1
- package/dist/locale/vi-VN.json +14 -1
- package/dist/locale/zh-CN.json +21 -2
- package/dist/locale/zh-TW.json +14 -1
- package/dist/node_modules/cron-parser/package.json +1 -1
- package/dist/node_modules/joi/package.json +1 -1
- package/dist/node_modules/lru-cache/package.json +1 -1
- package/dist/node_modules/nodejs-snowflake/package.json +1 -1
- package/dist/server/Dispatcher.d.ts +1 -0
- package/dist/server/Dispatcher.js +46 -28
- package/dist/server/ExecutionTimeoutManager.js +2 -2
- package/dist/server/Processor.d.ts +16 -0
- package/dist/server/Processor.js +112 -0
- package/dist/server/actions/nodes.js +36 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/instructions/CreateInstruction.js +6 -2
- package/dist/server/instructions/DestroyInstruction.js +2 -1
- package/dist/server/instructions/QueryInstruction.js +2 -1
- package/dist/server/instructions/UpdateInstruction.js +2 -1
- package/dist/server/triggers/CollectionTrigger.d.ts +5 -0
- package/dist/server/triggers/CollectionTrigger.js +26 -1
- package/dist/server/utils.js +27 -27
- package/package.json +3 -2
- package/dist/client/618.19af7f84261c815d.js +0 -10
- package/dist/client/67.452743ce8ec30617.js +0 -10
- package/dist/client/964.ffbf5b47ed12bbdc.js +0 -10
- package/dist/client/triggers/schedule/ScheduleModes.d.ts +0 -170
- package/dist/client/triggers/schedule/locale/Cron.zh-CN.d.ts +0 -42
|
@@ -6,69 +6,12 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
export default class extends Trigger {
|
|
18
|
-
sync: boolean;
|
|
19
|
-
title: string;
|
|
20
|
-
description: string;
|
|
21
|
-
presetFieldset: {
|
|
22
|
-
mode: {
|
|
23
|
-
type: string;
|
|
24
|
-
title: string;
|
|
25
|
-
name: string;
|
|
26
|
-
'x-decorator': string;
|
|
27
|
-
'x-component': string;
|
|
28
|
-
enum: {
|
|
29
|
-
value: number;
|
|
30
|
-
label: string;
|
|
31
|
-
}[];
|
|
32
|
-
required: boolean;
|
|
33
|
-
default: number;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
fieldset: {
|
|
37
|
-
config: {
|
|
38
|
-
type: string;
|
|
39
|
-
'x-component': string;
|
|
40
|
-
'x-component-props': {};
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
triggerFieldset: {
|
|
44
|
-
proxy: {
|
|
45
|
-
type: string;
|
|
46
|
-
'x-component': string;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
validate(config: any): any;
|
|
50
|
-
scope: {
|
|
51
|
-
useCollectionDataSource: typeof useCollectionDataSource;
|
|
52
|
-
};
|
|
53
|
-
components: {
|
|
54
|
-
ScheduleConfig: () => import("react").JSX.Element;
|
|
55
|
-
TriggerScheduleConfig: typeof TriggerScheduleConfig;
|
|
56
|
-
TriggerCollectionRecordSelect: typeof TriggerCollectionRecordSelect;
|
|
57
|
-
WorkflowVariableWrapper: typeof WorkflowVariableWrapper;
|
|
58
|
-
};
|
|
59
|
-
useVariables: typeof useVariables;
|
|
60
|
-
useInitializers(config: any): SchemaInitializerItemType | null;
|
|
61
|
-
/**
|
|
62
|
-
* 2.0
|
|
63
|
-
*/
|
|
64
|
-
getCreateModelMenuItem({ config }: {
|
|
65
|
-
config: any;
|
|
66
|
-
}): SubModelItem | null;
|
|
67
|
-
useTempAssociationSource(config: any, workflow: any): {
|
|
68
|
-
collection: any;
|
|
69
|
-
nodeId: any;
|
|
70
|
-
nodeKey: string;
|
|
71
|
-
nodeType: "workflow";
|
|
72
|
-
};
|
|
9
|
+
/**
|
|
10
|
+
* v1 schedule trigger wrapper. The canonical metadata, loaders, validation,
|
|
11
|
+
* variables, and v2 block-create hooks live in `client-v2/triggers/schedule`.
|
|
12
|
+
* The legacy Formily artifacts are deliberately dropped here, so v1 trigger
|
|
13
|
+
* surfaces fall through to the inherited v2 loaders.
|
|
14
|
+
*/
|
|
15
|
+
import V2ScheduleTrigger from '../../../client-v2/triggers/schedule';
|
|
16
|
+
export default class ScheduleTrigger extends V2ScheduleTrigger {
|
|
73
17
|
}
|
|
74
|
-
export {};
|
package/dist/client/utils.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import type { BranchContextValue } from './BranchContext';
|
|
10
|
-
export
|
|
10
|
+
export { linkNodes } from '../client-v2/canvas/nodeTree';
|
|
11
11
|
export declare function traverseSchema(schema: any, fn: any): void;
|
|
12
12
|
export declare function getWorkflowDetailPath(id: string | number): string;
|
|
13
13
|
export declare function getWorkflowExecutionsPath(id: string | number): string;
|
|
@@ -15,9 +15,9 @@ type WorkflowCapabilityContext = {
|
|
|
15
15
|
engine: {
|
|
16
16
|
isWorkflowSync(workflow: any): boolean;
|
|
17
17
|
};
|
|
18
|
-
workflow
|
|
19
|
-
upstream
|
|
20
|
-
branchIndex
|
|
18
|
+
workflow?: any;
|
|
19
|
+
upstream?: any;
|
|
20
|
+
branchIndex?: number | null;
|
|
21
21
|
syncOnly?: boolean;
|
|
22
22
|
branchContext?: Pick<BranchContextValue, 'syncOnly'> | null;
|
|
23
23
|
};
|
|
@@ -26,4 +26,3 @@ type AvailableInstruction = {
|
|
|
26
26
|
isAvailable?(ctx: WorkflowCapabilityContext): boolean;
|
|
27
27
|
};
|
|
28
28
|
export declare function getInstructionAvailable(instruction: AvailableInstruction, ctx: WorkflowCapabilityContext): string;
|
|
29
|
-
export {};
|
|
@@ -7,39 +7,9 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
|
-
|
|
11
|
-
export type VariableOption
|
|
12
|
-
|
|
13
|
-
value?: string;
|
|
14
|
-
label?: string | React.ReactNode;
|
|
15
|
-
children?: VariableOption[] | null;
|
|
16
|
-
[key: string]: any;
|
|
17
|
-
};
|
|
18
|
-
export type VariableDataType = 'boolean' | 'number' | 'string' | 'date' | {
|
|
19
|
-
type: 'reference';
|
|
20
|
-
options: {
|
|
21
|
-
collection: string;
|
|
22
|
-
multiple?: boolean;
|
|
23
|
-
entity?: boolean;
|
|
24
|
-
};
|
|
25
|
-
} | ((field: any, options: {
|
|
26
|
-
collectionManager?: CollectionManager;
|
|
27
|
-
}) => boolean);
|
|
28
|
-
export type UseVariableOptions = {
|
|
29
|
-
types?: VariableDataType[];
|
|
30
|
-
fieldNames?: {
|
|
31
|
-
label?: string;
|
|
32
|
-
value?: string;
|
|
33
|
-
children?: string;
|
|
34
|
-
};
|
|
35
|
-
appends?: string[] | null;
|
|
36
|
-
depth?: number;
|
|
37
|
-
};
|
|
38
|
-
export declare const defaultFieldNames: {
|
|
39
|
-
readonly label: "label";
|
|
40
|
-
readonly value: "value";
|
|
41
|
-
readonly children: "children";
|
|
42
|
-
};
|
|
10
|
+
export { getCollectionFieldOptions, BaseTypeSets, defaultFieldNames } from '../client-v2/canvas/collectionFieldOptions';
|
|
11
|
+
export type { VariableOption, VariableDataType, UseVariableOptions } from '../client-v2/canvas/collectionFieldOptions';
|
|
12
|
+
import { type VariableOption, type UseVariableOptions } from '../client-v2/canvas/collectionFieldOptions';
|
|
43
13
|
export declare const nodesOptions: {
|
|
44
14
|
label: string;
|
|
45
15
|
value: string;
|
|
@@ -62,18 +32,8 @@ export declare const systemOptions: {
|
|
|
62
32
|
value: string;
|
|
63
33
|
useOptions(options: UseVariableOptions): any;
|
|
64
34
|
};
|
|
65
|
-
/**
|
|
66
|
-
* @deprecated
|
|
67
|
-
*/
|
|
68
|
-
export declare const BaseTypeSets: {
|
|
69
|
-
boolean: Set<string>;
|
|
70
|
-
number: Set<string>;
|
|
71
|
-
string: Set<string>;
|
|
72
|
-
date: Set<string>;
|
|
73
|
-
};
|
|
74
35
|
export declare function useWorkflowVariableOptions(options?: UseVariableOptions, preset?: VariableOption[]): VariableOption[];
|
|
75
|
-
export declare function
|
|
76
|
-
export declare function useGetDataSourceCollectionManager(dataSourceName?: any): CollectionManager;
|
|
36
|
+
export declare function useGetDataSourceCollectionManager(dataSourceName?: any): import("@nocobase/client").CollectionManager;
|
|
77
37
|
export declare function WorkflowVariableInput({ variableOptions, ...props }: {
|
|
78
38
|
[x: string]: any;
|
|
79
39
|
variableOptions: any;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_workflow_client_v2=self.webpackChunk_nocobase_plugin_workflow_client_v2||[]).push([["119"],{9082:function(e,n,t){t.d(n,{ConditionCanvasComponent:function(){return b},ConditionFieldset:function(){return m},ConditionPresetFieldset:function(){return d}});var r=t(9155),a=t.n(r),o=t(2059),l=t(9651),i=t(244),u=t(2235),c=t(5980),s=t(1173),f=t(9488);function m(){var e=(0,f.kj)();return a().createElement(a().Fragment,null,a().createElement(o.Form.Item,{name:["config","rejectOnFalse"],label:e("Mode")},a().createElement(o.Radio.Group,{disabled:!0,options:[{value:!0,label:e('Continue when "Yes"')},{value:!1,label:e('Branch into "Yes" and "No"')}]})),a().createElement(s.FW,{prefix:["config"]}))}function d(){var e=(0,f.kj)();return a().createElement(o.Form.Item,{name:["config","rejectOnFalse"],label:e("Mode"),rules:[{required:!0}],initialValue:!0},a().createElement(o.Radio.Group,{options:[{value:!0,label:e('Continue when "Yes"')},{value:!1,label:e('Branch into "Yes" and "No"')}]}))}function b(e){var n,t=e.data,r=(0,f.kj)(),o=(0,c.A)().styles,s=(null!=(n=(0,u.$K)())?n:{}).nodes,m=t.id,d=t.config,b=(void 0===d?{}:d).rejectOnFalse,p=(null!=s?s:[]).find(function(e){return e.upstreamId===m&&1===e.branchIndex}),v=(null!=s?s:[]).find(function(e){return e.upstreamId===m&&0===e.branchIndex});return a().createElement(i.z,{data:t},b?null:a().createElement("div",{className:o.nodeSubtreeClass},a().createElement("div",{className:o.branchBlockClass},a().createElement(l.l,{from:t,entry:v,branchIndex:0}),a().createElement(l.l,{from:t,entry:p,branchIndex:1})),a().createElement("div",{className:o.conditionClass},a().createElement("span",{style:{right:"4em"}},r("No")),a().createElement("span",{style:{left:"4em"}},r("Yes")))))}},1173:function(e,n,t){t.d(n,{FW:function(){return g}});var r=t(9155),a=t.n(r),o=t(8275),l=t(2059),i=t(5606),u=t(3440),c=t(9785),s=t(3210),f=t(9488);function m(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function d(e,n,t,r,a,o,l){try{var i=e[o](l),u=i.value}catch(e){t(e);return}i.done?n(u):Promise.resolve(u).then(r,a)}function b(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],l=!0,i=!1;try{for(a=a.call(e);!(l=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);l=!0);}catch(e){i=!0,r=e}finally{try{l||null==a.return||a.return()}finally{if(i)throw r}}return o}}(e,n)||v(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||v(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,n){if(e){if("string"==typeof e)return m(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return m(e,n)}}var y="basic";function h(e,n){return p(e).concat([n])}function g(e){var n,t,r,m=e.prefix,v=e.calculationLabel,g=e.expressionLabel,E=e.expressionItemProps,w=(0,f.kj)(),j=(n=(0,f.kj)(),t=Array.from(o.evaluators.getEntities()).filter(function(e){return["math.js","formula.js"].includes(b(e,1)[0])}).map(function(e){var n=b(e,2),t=n[0],r=n[1];return{value:t,label:r.label,tooltip:r.tooltip}}),[{value:y,label:n("Basic")}].concat(p(t))),I=null!=(r=l.Form.useWatch(h(m,"engine")))?r:y;return a().createElement(a().Fragment,null,a().createElement(l.Form.Item,{name:h(m,"engine"),label:w("Calculation engine"),rules:[{required:!0}],initialValue:y},a().createElement(c.$,{options:j})),a().createElement(l.Form.Item,{name:h(m,"calculation"),label:null!=v?v:w("Condition"),hidden:I!==y,dependencies:[h(m,"engine")],rules:[{required:I===y}]},a().createElement(u.S_,null)),a().createElement(l.Form.Item,function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({name:h(m,"expression"),label:null!=g?g:w("Condition expression"),hidden:I===y,dependencies:[h(m,"engine")],validateTrigger:["onChange","onBlur"],rules:[{required:I!==y},{validator:function(e,n){var t;return(t=function(){var e,t;return function(e,n){var t,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(l,"next",{value:u(0)}),i(l,"throw",{value:u(1)}),i(l,"return",{value:u(2)}),"function"==typeof Symbol&&i(l,Symbol.iterator,{value:function(){return this}}),l;function u(i){return function(u){var c=[i,u];if(t)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(o=0)),o;)try{if(t=1,r&&(a=2&c[0]?r.return:c[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,c[1])).done)return a;switch(r=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,r=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=n.call(e,o)}catch(e){c=[6,e],r=0}finally{t=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(r){if(I===y||!n||!(e=o.evaluators.get(I)))return[2];t=String(n).trim().replace(/{{([^{}]+)}}/g,' "1" ');try{e.evaluate(t)}catch(e){throw Error(w("Expression syntax error"))}return[2]})},function(){var e=this,n=arguments;return new Promise(function(r,a){var o=t.apply(e,n);function l(e){d(o,r,a,l,i,"next",e)}function i(e){d(o,r,a,l,i,"throw",e)}l(void 0)})})()}}],extra:I===y?void 0:(0,s.s)(I,w)},E),a().createElement(i.M,null)))}}}]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_workflow_client_v2=self.webpackChunk_nocobase_plugin_workflow_client_v2||[]).push([["142"],{5329:function(e,n,t){t.d(n,{F:function(){return u}});var r=t(9155),l=t.n(r),o=t(2059),a=t(7806),i=t(9488);function c(e){var n=e.value,t=e.onChange,o=e.disabled,i=e.onCollectionChanged,c=(0,r.useRef)();return l().createElement(a.XJ,{value:n,disabled:o,onChange:function(e){var r,l=null!=(r=c.current)?r:n;null==t||t(e),l&&l!==e&&(null==i||i(l,e)),c.current=e}})}function u(e){var n=e.disabled,t=e.onCollectionChanged,r=(0,i.kj)();return l().createElement(o.Form.Item,{name:["config","collection"],label:r("Collection"),rules:[{required:!0}]},l().createElement(c,{disabled:n,onCollectionChanged:t}))}},6855:function(e,n,t){t.d(n,{F:function(){return s}});var r=t(9155),l=t.n(r),o=t(2059),a=t(7768),i=t(1801),c=t(9488);function u(e,n,t,r,l,o,a){try{var i=e[o](a),c=i.value}catch(e){t(e);return}i.done?n(c):Promise.resolve(c).then(r,l)}function s(e){var n=e.collection,t=e.label,r=e.name,s=e.required,f=(0,c.kj)();return l().createElement(o.Form.Item,{name:void 0===r?["config","params","filter"]:r,label:null!=t?t:f("Filter"),validateTrigger:["onChange","onBlur"],rules:void 0===s||s?[{validator:function(e,n){var t;return(t=function(){return function(e,n){var t,r,l,o={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:c(0)}),i(a,"throw",{value:c(1)}),i(a,"return",{value:c(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function c(i){return function(c){var u=[i,c];if(t)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(t=1,r&&(l=2&u[0]?r.return:u[0]?r.throw||((l=r.return)&&l.call(r),0):r.next)&&!(l=l.call(r,u[1])).done)return l;switch(r=0,l&&(u=[2&u[0],l.value]),u[0]){case 0:case 1:l=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(l=(l=o.trys).length>0&&l[l.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!l||u[1]>l[0]&&u[1]<l[3])){o.label=u[1];break}if(6===u[0]&&o.label<l[1]){o.label=l[1],l=u;break}if(l&&o.label<l[2]){o.label=l[2],o.ops.push(u);break}l[2]&&o.ops.pop(),o.trys.pop();continue}u=n.call(e,o)}catch(e){u=[6,e],r=0}finally{t=l=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(e){if(!(0,a.isValidFilter)(n))throw Error(f("Please add at least one condition"));return[2]})},function(){var e=this,n=arguments;return new Promise(function(r,l){var o=t.apply(e,n);function a(e){u(o,r,l,a,i,"next",e)}function i(e){u(o,r,l,a,i,"throw",e)}a(void 0)})})()}}]:void 0},l().createElement(i.N$,{collection:n}))}},693:function(e,n,t){t.d(n,{QueryFieldset:function(){return d},QueryPresetFieldset:function(){return p}});var r=t(9155),l=t.n(r),o=t(2059),a=t(2235),i=t(7806),c=t(9785),u=t(9488),s=t(5329),f=t(6855);function m(){var e=(0,u.kj)(),n=o.Form.useWatch(["config","collection"]);return n?l().createElement(l().Fragment,null,l().createElement(f.F,{collection:n,required:!1}),l().createElement(o.Form.Item,{name:["config","params","sort"],label:e("Sort")},l().createElement(i.o5,{collection:n})),l().createElement(i.uc,{pageName:["config","params","page"],pageSizeName:["config","params","pageSize"]}),l().createElement(o.Form.Item,{name:["config","params","appends"],label:e("Preload associations"),extra:e("Please select the associated fields that need to be accessed in subsequent nodes. With more than two levels of to-many associations may cause performance issue, please use with caution.")},l().createElement(i.Kr,{collection:n}))):null}function d(){var e,n,t=(0,u.kj)(),i=(0,a.TA)(),f=o.Form.useFormInstance(),d=[{label:(e=(0,u.kj)())("Single record"),value:!1,tooltip:e("The result will be an object of the first matching record only, or null if no matched record.")},{label:e("Multiple records"),value:!0,tooltip:e("The result will be an array containing matched records, or an empty one if no matching records. This can be used to be processed in a loop node.")}];return(0,r.useEffect)(function(){void 0===f.getFieldValue(["config","multiple"])&&f.setFieldValue(["config","multiple"],!1)},[f]),l().createElement(l().Fragment,null,l().createElement(s.F,{disabled:!!(null==i||null==(n=i.config)?void 0:n.collection),onCollectionChanged:function(){f.setFieldValue(["config","params"],{})}}),l().createElement(o.Form.Item,{name:["config","multiple"],label:t("Result type")},l().createElement(c.$,{options:d})),l().createElement(m,null),l().createElement(o.Form.Item,{name:["config","failOnEmpty"],valuePropName:"checked"},l().createElement(o.Checkbox,null,t("Exit when query result is null"))))}function p(){return l().createElement(s.F,null)}}}]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_workflow_client_v2=self.webpackChunk_nocobase_plugin_workflow_client_v2||[]).push([["159"],{2066:function(e,r,n){n.d(r,{CalculationFieldset:function(){return p}});var t=n(9155),o=n.n(t),a=n(2059),l=n(8275),i=n(9785),u=n(3210),c=n(5606),s=n(9488);function f(e,r,n,t,o,a,l){try{var i=e[a](l),u=i.value}catch(e){n(e);return}i.done?r(u):Promise.resolve(u).then(t,o)}function p(){var e,r=(0,s.kj)(),n=null!=(e=a.Form.useWatch(["config","engine"]))?e:"formula.js";return o().createElement(o().Fragment,null,o().createElement(a.Form.Item,{name:["config","engine"],label:r("Calculation engine"),rules:[{required:!0}],initialValue:"formula.js"},o().createElement(i.$,{options:(0,l.getOptions)()})),o().createElement(a.Form.Item,{name:["config","expression"],label:r("Calculation expression"),dependencies:[["config","engine"]],validateTrigger:["onChange","onBlur"],rules:[{required:!0},{validator:function(e,t){var o;return(o=function(){var e,o;return function(e,r){var n,t,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(l,"next",{value:u(0)}),i(l,"throw",{value:u(1)}),i(l,"return",{value:u(2)}),"function"==typeof Symbol&&i(l,Symbol.iterator,{value:function(){return this}}),l;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(a=0)),a;)try{if(n=1,t&&(o=2&c[0]?t.return:c[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,c[1])).done)return o;switch(t=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,t=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=r.call(e,a)}catch(e){c=[6,e],t=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(a){if(!t||!(e=l.evaluators.get(n)))return[2];o=String(t).trim().replace(/{{([^{}]+)}}/g,' "1" ');try{e.evaluate(o)}catch(e){throw Error(r("Expression syntax error"))}return[2]})},function(){var e=this,r=arguments;return new Promise(function(n,t){var a=o.apply(e,r);function l(e){f(a,n,t,l,i,"next",e)}function i(e){f(a,n,t,l,i,"throw",e)}l(void 0)})})()}}],extra:(0,u.s)(n,r)},o().createElement(c.M,null)))}}}]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_workflow_client_v2=self.webpackChunk_nocobase_plugin_workflow_client_v2||[]).push([["224"],{7235:function(e,t,n){n.r(t),n.d(t,{default:function(){return ee}});var r=n(7375),o=n(3485),a=n(5477),l=n(7694),i=n(2625),u=n(2059),c=n(9155),s=n.n(c),d=n(358),f={dumpRules:"required",migrationRules:["overwrite","schema-only"],name:"workflows",dataCategory:"system",shared:!0,repository:"WorkflowRepository",createdBy:!0,updatedBy:!0,createdAt:!0,updatedAt:!0,fields:[{name:"id",type:"snowflakeId",primaryKey:!0,allowNull:!1,interface:"id",uiSchema:{type:"number",title:'{{t("ID")}}',"x-component":"InputNumber","x-component-props":{},"x-read-pretty":!0}},{name:"key",type:"uid"},{type:"string",name:"title",interface:"input",uiSchema:{title:'{{t("Name")}}',type:"string","x-component":"Input",required:!0}},{type:"boolean",name:"enabled",defaultValue:!1,interface:"radioGroup",uiSchema:{title:'{{t("Status", { ns: "'.concat(d.C,'" })}}'),type:"string",enum:[{label:'{{t("On", { ns: "'.concat(d.C,'" })}}'),value:!0,color:"#52c41a"},{label:'{{t("Off", { ns: "'.concat(d.C,'" })}}'),value:!1}],"x-component":"Radio.Group",default:!1}},{type:"text",name:"description",interface:"textarea",uiSchema:{title:'{{t("Description")}}',type:"string","x-component":"Input.TextArea"}},{type:"string",name:"type",required:!0,interface:"select",uiSchema:{title:'{{t("Trigger type", { ns: "'.concat(d.C,'" })}}'),type:"string","x-component":"Select",enum:"{{useTriggersOptions()}}",required:!0}},{type:"string",name:"triggerTitle"},{type:"jsonb",name:"config",required:!0,defaultValue:{}},{type:"hasMany",name:"nodes",target:"flow_nodes",onDelete:"CASCADE"},{type:"hasMany",name:"executions"},{type:"integer",name:"executed",defaultValue:0},{type:"integer",name:"allExecuted",defaultValue:0},{type:"boolean",name:"current"},{type:"boolean",name:"sync",defaultValue:!1,interface:"radioGroup",uiSchema:{title:'{{t("Mode", { ns: "'.concat(d.C,'" })}}'),type:"boolean","x-component":"Radio.Group",enum:[{label:'{{ t("Asynchronously", { ns: "'.concat(d.C,'" }) }}'),value:!1,color:"cyan"},{label:'{{ t("Synchronously", { ns: "'.concat(d.C,'" }) }}'),value:!0,color:"orange"}],required:!0}},{type:"hasMany",name:"revisions",target:"workflows",foreignKey:"key",sourceKey:"key",constraints:!1,onDelete:"NO ACTION"},{type:"jsonb",name:"options",defaultValue:{timeout:0}},{type:"hasOne",name:"stats",target:"workflowStats",foreignKey:"key",sourceKey:"key",constraints:!1},{type:"hasOne",name:"versionStats",target:"workflowVersionStats",foreignKey:"id",sourceKey:"id",constraints:!1,onDelete:"CASCADE"},{type:"belongsToMany",name:"categories",target:"workflowCategories",through:"workflowCategoryRelations",foreignKey:"workflowId",otherKey:"categoryId",sourceKey:"id",constraints:!1,interface:"m2m",uiSchema:{type:"array",title:'{{t("Category", { ns: "'.concat(d.C,'" })}}'),"x-component":"AssociationField","x-component-props":{multiple:!0,fieldNames:{label:"title",value:"id",color:"color"},mode:"Tag"},"x-read-pretty":!0}},{type:"belongsTo",name:"createdBy",target:"users",foreignKey:"createdById",interface:"m2o",uiSchema:{type:"number",title:'{{t("Created by")}}',"x-component":"AssociationField","x-component-props":{fieldNames:{label:"nickname",value:"id"}}}}],indexes:[{unique:!0,fields:["key","current"]}]},m=n(5927),p=n(7001),y=n(9488),b=n(4759),g=n(4315),v=n(5953);function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function w(e,t,n,r,o,a,l){try{var i=e[a](l),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,o)}function E(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function l(e){w(a,r,o,l,i,"next",e)}function i(e){w(a,r,o,l,i,"throw",e)}l(void 0)})}}function S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],l=!0,i=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);l=!0);}catch(e){i=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(i)throw r}}return a}}(e,t)||C(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h(e,t)}}function x(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(l,"next",{value:u(0)}),i(l,"throw",{value:u(1)}),i(l,"return",{value:u(2)}),"function"==typeof Symbol&&i(l,Symbol.iterator,{value:function(){return this}}),l;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var k=["red","magenta","volcano","orange","gold","lime","green","cyan","blue","geekblue","purple","default"];function A(e){var t=(0,v.useTranslation)().t,n=k.map(function(e){return{value:e,label:s().createElement(u.Tag,{color:"default"===e?void 0:e},t(e.charAt(0).toUpperCase()+e.slice(1)))}});return s().createElement(u.Select,{allowClear:!0,value:e.value,options:n,onChange:e.onChange})}function O(e){var t=e.activeKey,n=e.onChange,r=e.categories,a=e.refreshCategories,d=e.className,f=(0,y.ec)().t,m=(0,y.kj)(),p=(0,l.useFlowContext)(),b=u.App.useApp().modal,g=p.api.resource("workflowCategories"),v=S((0,c.useState)(null),2),w=v[0],k=v[1],O=S((0,c.useState)(!1),2),T=O[0],F=O[1],I=S((0,c.useState)(!1),2),M=I[0],j=I[1],D=S(u.Form.useForm(),1)[0],R=(0,c.useMemo)(function(){return((function(e){if(Array.isArray(e))return h(e)})(r)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||C(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).sort(function(e,t){var n,r;return(null!=(n=e.sort)?n:0)-(null!=(r=t.sort)?r:0)}).map(function(e){return{id:e.id,label:m(e.title),color:e.color}})},[r,m]),P=(0,i.useMemoizedFn)(function(e){return r.find(function(t){return String(t.id)===String(e)})}),z=(0,i.useMemoizedFn)(function(){k(null),D.resetFields(),F(!0)}),_=(0,i.useMemoizedFn)(function(e){var t=P(e);t&&(k(t),D.setFieldsValue({title:t.title,color:t.color}),F(!0))}),N=(0,i.useMemoizedFn)(function(e){var r=P(e);r&&b.confirm({title:f("Delete category"),content:f("Are you sure you want to delete it?"),onOk:function(){return E(function(){return x(this,function(e){switch(e.label){case 0:return[4,g.destroy({filterByTk:r.id})];case 1:return e.sent(),String(r.id)===t&&n("all"),a(),[2]}})})()}})}),L=(0,i.useMemoizedFn)(function(e,t){return E(function(){return x(this,function(n){switch(n.label){case 0:return[4,g.move({sourceId:e,targetId:t})];case 1:return n.sent(),a(),[2]}})})()}),B=(0,i.useMemoizedFn)(function(){return E(function(){var e;return x(this,function(t){switch(t.label){case 0:return[4,D.validateFields()];case 1:e=t.sent(),j(!0),t.label=2;case 2:if(t.trys.push([2,,7,8]),!w)return[3,4];return[4,g.update({filterByTk:w.id,values:e})];case 3:return t.sent(),[3,6];case 4:return[4,g.create({values:e})];case 5:t.sent(),t.label=6;case 6:return F(!1),a(),[3,8];case 7:return j(!1),[7];case 8:return[2]}})})()});return s().createElement(s().Fragment,null,s().createElement(o.SortableCategoryTabs,{className:d,activeKey:t,onChange:n,allTab:{key:"all",label:f("All")},categories:R,onAdd:z,onEdit:_,onDelete:N,onSort:L,menuLabels:{edit:f("Edit category"),delete:f("Delete category")}}),s().createElement(u.Modal,{title:w?f("Edit category"):f("Add category"),open:T,confirmLoading:M,onOk:B,onCancel:function(){return F(!1)},okText:f("Submit"),cancelText:f("Cancel"),destroyOnClose:!0},s().createElement(u.Form,{form:D,layout:"vertical"},s().createElement(u.Form.Item,{name:"title",label:f("Title"),rules:[{required:!0}]},s().createElement(u.Input,null)),s().createElement(u.Form.Item,{name:"color",label:f("Color")},s().createElement(A,null)))))}var T=n(9239);function F(e){var t=e.value,n=e.onChange,o=e.disabled,a=(0,y.ec)().t,l=[{value:!1,label:a("Asynchronously"),tooltip:a("Will be executed in the background as a queued task.")},{value:!0,label:a("Synchronously"),tooltip:a("For user actions that require immediate feedback. Can not use asynchronous nodes in such mode, and it is not recommended to perform time-consuming operations under synchronous mode.")}];return s().createElement(u.Radio.Group,{value:t,disabled:o,onChange:function(e){return null==n?void 0:n(e.target.value)}},l.map(function(e){return s().createElement(u.Radio,{key:String(e.value),value:e.value},s().createElement(u.Space,{size:"small"},e.label,s().createElement(u.Tooltip,{title:e.tooltip},s().createElement(r.QuestionCircleOutlined,null))))}))}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var M=[{value:1e3,label:"Seconds"},{value:6e4,label:"Minutes"},{value:36e5,label:"Hours"},{value:864e5,label:"Days"}];function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15552e6;return Math.min(Math.max(e,0),t)}function D(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6e4;return e&&null!=(t=null==(n=M.findLast(function(t){return e%t.value==0}))?void 0:n.value)?t:r}function R(e){var t,n=e.value,r=e.onChange,o=(0,y.ec)().t,a=j(Number(null!=n?n:0)),l=function(e){if(Array.isArray(e))return e}(t=(0,c.useState)(function(){return D(a)}))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],a=!0,l=!1;try{for(r=r.call(e);!(a=(t=r.next()).done)&&(o.push(t.value),2!==o.length);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==r.return||r.return()}finally{if(l)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return I(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return I(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),i=l[0],d=l[1];(0,c.useEffect)(function(){0!==a&&d(function(e){return D(a,e)})},[a]);var f=0===a?0:a/i,m=15552e6/i;return s().createElement(u.Space.Compact,{style:{width:"50%"}},s().createElement(u.InputNumber,{min:0,max:m,precision:0,value:f,onChange:function(e){return null==r?void 0:r(j(Number(e)||0,m)*i)},style:{width:"70%"}}),s().createElement(u.Select,{value:i,style:{width:"30%"},options:M.map(function(e){return{value:e.value,label:o(e.label)}}),onChange:function(e){var t=j(Number(null!=n?n:0)),o=0===t?0:t/i;d(e),null==r||r(j(o*e))}}))}function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function z(e,t,n,r,o,a,l){try{var i=e[a](l),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,o)}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],l=!0,i=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);l=!0);}catch(e){i=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(i)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return P(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return P(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function N(e){var t,n=e.mode,r=e.plugin,a=e.record,d=e.categoryOptions,f=e.onSubmitted,m=(0,y.ec)().t,p=(0,y.kj)(),b=(0,l.useFlowContext)(),g=u.theme.useToken().token,v=b.api.resource("workflows"),h=_(u.Form.useForm(),1)[0],w=_((0,c.useState)(!1),2),E=w[0],S=w[1],C=(0,c.useMemo)(function(){var e=Array.from(r.triggers.getEntities()).map(function(e){var t=_(e,2),n=t[0],r=t[1];return{value:n,label:(null==r?void 0:r.title)?p(r.title):String(n),description:(null==r?void 0:r.description)?p(r.description):void 0}});return"edit"===n&&(null==a?void 0:a.type)&&!e.some(function(e){return e.value===a.type})&&e.push({value:a.type,label:a.type,description:void 0}),e.sort(function(e,t){return String(e.label).localeCompare(String(t.label))})},[r,p,n,a]),x=(0,c.useMemo)(function(){return T.hi.filter(function(e){return!!e.value}).map(function(e){return{value:e.value,label:p(e.label),color:e.color,description:e.description?p(e.description):void 0}})},[p]),k=(0,c.useMemo)(function(){if("edit"===n){var t,r,o;return{title:null==a?void 0:a.title,type:null==a?void 0:a.type,sync:null!=(t=null==a?void 0:a.sync)&&t,description:null==a?void 0:a.description,categories:(null!=(r=null==a?void 0:a.categories)?r:[]).map(function(e){return e.id}),options:null!=(o=null==a?void 0:a.options)?o:{}}}return{type:e.type,sync:!1,options:{},config:{}}},[n,a,e.type]);(0,c.useEffect)(function(){h.setFieldsValue(k)},[h,k]);var A=null!=(t=u.Form.useWatch("type",h))?t:e.type,O=(0,c.useMemo)(function(){return r.getTriggerOptions(A)},[r,A]),I=(null==O?void 0:O.sync)!=null;(0,c.useEffect)(function(){I&&h.setFieldValue("sync",O.sync)},[I,O,h]);var M=(0,c.useMemo)(function(){if("create"!==n)return null;var e=null==O?void 0:O.PresetFieldsetLoader;return e?(0,c.lazy)(e):null},[n,O]),j=(0,i.useMemoizedFn)(function(){h.setFieldValue("config",{})}),D=(0,i.useMemoizedFn)(function(){var e;return(e=function(){var e,t,r,o,l,i;return function(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(l,"next",{value:u(0)}),i(l,"throw",{value:u(1)}),i(l,"return",{value:u(2)}),"function"==typeof Symbol&&i(l,Symbol.iterator,{value:function(){return this}}),l;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(u){switch(u.label){case 0:return[4,h.validateFields()];case 1:e=u.sent(),S(!0),u.label=2;case 2:if(u.trys.push([2,,7,8]),"create"!==n)return[3,4];return[4,v.create({values:{title:e.title,type:e.type,sync:!!e.sync,current:!0,config:null!=(t=e.config)?t:{},description:e.description,categories:null!=(r=e.categories)?r:[],options:null!=(o=e.options)?o:{}}})];case 3:return u.sent(),[3,6];case 4:return[4,v.update({filterByTk:a.id,values:{title:e.title,sync:!!e.sync,description:e.description,categories:null!=(l=e.categories)?l:[],options:null!=(i=e.options)?i:{}}})];case 5:u.sent(),u.label=6;case 6:return f(),[3,8];case 7:return S(!1),[7];case 8:return[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function l(e){z(a,r,o,l,i,"next",e)}function i(e){z(a,r,o,l,i,"throw",e)}l(void 0)})})()});return s().createElement(o.DrawerFormLayout,{title:m("create"===n?"Add new":"Edit"),onSubmit:D,submitting:E,submitText:m("Submit"),cancelText:m("Cancel")},s().createElement(u.Form,{form:h,layout:"vertical",initialValues:k},s().createElement(u.Form.Item,{name:"title",label:m("Title"),rules:[{required:!0}]},s().createElement(u.Input,null)),s().createElement(u.Form.Item,{name:"type",label:m("Trigger type"),rules:[{required:!0}]},s().createElement(u.Select,{options:C,disabled:"edit"===n,onChange:j,showSearch:!0,optionFilterProp:"label",popupMatchSelectWidth:!0,optionRender:function(e){var t,n;return s().createElement(u.Space,{direction:"vertical"},s().createElement(u.Tag,{color:"gold"},null==(t=e.data)?void 0:t.label),(null==(n=e.data)?void 0:n.description)?s().createElement(u.Typography.Text,{type:"secondary",style:{whiteSpace:"normal"}},e.data.description):null)}})),M?s().createElement("div",{style:{marginBottom:g.marginLG}},s().createElement("div",{style:{marginBottom:g.marginXS,fontWeight:600}},"".concat(m("Trigger configuration"),":")),s().createElement("div",{style:{padding:g.padding,border:"".concat(g.lineWidth,"px solid ").concat(g.colorBorderSecondary),borderRadius:g.borderRadiusLG}},s().createElement(c.Suspense,{fallback:s().createElement(u.Spin,null)},s().createElement(M,null)))):null,s().createElement(u.Form.Item,{name:"sync",label:m("Execute mode"),extra:m("Execute workflow asynchronously or synchronously based on trigger type, and could not be changed after created.")},s().createElement(F,{disabled:I||"edit"===n})),s().createElement(u.Form.Item,{name:"categories",label:m("Category")},s().createElement(u.Select,{mode:"multiple",allowClear:!0,options:d,optionFilterProp:"label"})),s().createElement(u.Form.Item,{name:"description",label:m("Description")},s().createElement(u.Input.TextArea,{autoSize:{minRows:2}})),s().createElement(u.Form.Item,{label:m("Advance options")},s().createElement(u.Card,{size:"small"},s().createElement(u.Form.Item,{name:["options","timeout"],label:m("Timeout settings"),extra:m("0 means unlimited. If you set any other value and the execution is still not completed when the timeout is reached, the execution plan will be terminated and the remaining nodes will not be executed. Time spent in queue is not counted; timing starts only after it first enters a processor."),initialValue:0},s().createElement(R,null)),s().createElement(u.Form.Item,{name:["options","stackLimit"],label:m("Maximum number of cycling triggers"),extra:m("The triggers of same workflow by some node (create, update and sub-flow etc.) more than this number will be ignored. Large number may cause performance issues. Please use with caution."),initialValue:1},s().createElement(u.InputNumber,{min:1,precision:0,style:{width:"50%"}})),s().createElement(u.Form.Item,{name:["options","deleteExecutionOnStatus"],label:m("Auto delete history when execution is on end status")},s().createElement(u.Select,{mode:"multiple",allowClear:!0,options:x,optionFilterProp:"label",optionRender:function(e){var t,n,r;return s().createElement(u.Space,null,s().createElement(u.Tag,{color:null==(t=e.data)?void 0:t.color},null==(n=e.data)?void 0:n.label),(null==(r=e.data)?void 0:r.description)?s().createElement("span",null,e.data.description):null)},tagRender:function(e){var t,n=e.value,r=e.label,o=e.closable,a=e.onClose;return s().createElement(u.Tag,{color:null==(t=T.m2[String(n)])?void 0:t.color,closable:o,onClose:a,onMouseDown:function(e){e.preventDefault(),e.stopPropagation()}},r)}}))))))}function L(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function B(e,t,n,r,o,a,l){try{var i=e[a](l),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,o)}function G(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function l(e){B(a,r,o,l,i,"next",e)}function i(e){B(a,r,o,l,i,"throw",e)}l(void 0)})}}function K(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function q(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function V(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],l=!0,i=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);l=!0);}catch(e){i=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(i)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return L(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return L(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function W(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(l,"next",{value:u(0)}),i(l,"throw",{value:u(1)}),i(l,"return",{value:u(2)}),"function"==typeof Symbol&&i(l,Symbol.iterator,{value:function(){return this}}),l;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function Q(){var e=U(["\n background: ",";\n padding: 0;\n "]);return Q=function(){return e},e}function $(){var e=U(["\n padding: ","px ","px 0 calc(","px - ","px);\n background: ",";\n\n .ant-tabs {\n margin-bottom: 0;\n }\n\n .ant-tabs-nav {\n margin-bottom: 0;\n }\n\n .ant-tabs-content-holder {\n display: none;\n }\n "]);return $=function(){return e},e}function J(){var e=U(["\n margin: 0 ","px ","px;\n padding: ","px;\n background: ",";\n border-radius: 0 ","px ","px ","px;\n "]);return J=function(){return e},e}var Y=["id","description","categories"];function H(e){var t=e.record,n=e.resource,r=e.onChanged,o=(0,y.ec)().t,a=u.App.useApp().message,l=V((0,c.useState)(!1),2),d=l[0],f=l[1],m=(0,i.useMemoizedFn)(function(e){return G(function(){return W(this,function(l){switch(l.label){case 0:if((null==t?void 0:t.id)==null)return[2];f(!0),l.label=1;case 1:return l.trys.push([1,3,4,5]),[4,n.update({filterByTk:t.id,values:{enabled:e}})];case 2:return l.sent(),setTimeout(function(){return r()},0),[3,5];case 3:return l.sent(),a.error(o("Operation failed")),[3,5];case 4:return f(!1),[7];case 5:return[2]}})})()});return s().createElement(u.Switch,{checked:!!(null==t?void 0:t.enabled),size:"small",disabled:d,loading:d,onClick:function(e,t){var n;return null==t||null==(n=t.stopPropagation)?void 0:n.call(t)},onChange:m})}function X(e){var t=e.record,n=e.resource,r=e.onSubmitted,a=(0,y.ec)().t,l=V(u.Form.useForm(),1)[0],d=V((0,c.useState)(!1),2),f=d[0],m=d[1],p=(0,i.useMemoizedFn)(function(){return G(function(){var e;return W(this,function(o){switch(o.label){case 0:return[4,l.validateFields()];case 1:e=o.sent(),m(!0),o.label=2;case 2:return o.trys.push([2,,4,5]),[4,n.revision({filterByTk:t.id,values:e})];case 3:return o.sent(),r(),[3,5];case 4:return m(!1),[7];case 5:return[2]}})})()});return s().createElement(o.DialogFormLayout,{title:a("Duplicate to new workflow"),onSubmit:p,submitting:f,submitText:a("Submit"),cancelText:a("Cancel")},s().createElement(u.Form,{form:l,layout:"vertical"},s().createElement(u.Form.Item,{name:"title",label:a("Title")},s().createElement(u.Input,null))))}function Z(){var e,t=(0,y.ec)().t,n=(0,y.kj)(),d=(0,l.useFlowContext)(),f=(0,p.TD)().getWorkflowCanvasPath,v=u.theme.useToken().token,h=u.App.useApp(),w=h.modal,E=h.message,S=d.api.resource("workflows"),C=d.app.pm.get(b.A),x=(0,a.css)(Q(),v.colorBgLayout),k=(0,a.css)($(),v.padding,v.padding,v.padding,v.lineWidth,v.colorBgLayout),A=(0,a.css)(J(),v.padding,v.padding,v.paddingLG,v.colorBgContainer,v.borderRadiusLG,v.borderRadiusLG,v.borderRadiusLG),T=(0,c.useMemo)(function(){var e,t,n,r;return null==(r=d.dataSourceManager)||null==(n=r.getDataSource)||null==(t=n.call(r,"main"))||null==(e=t.getCollection)?void 0:e.call(t,"workflows")},[d]),F=V((0,c.useState)("all"),2),I=F[0],M=F[1],j=V((0,c.useState)(1),2),D=j[0],R=j[1],P=V((0,c.useState)(o.DEFAULT_PAGE_SIZE),2),z=P[0],_=P[1],L=V((0,c.useState)([]),2),B=L[0],K=L[1],q=V((0,c.useState)(void 0),2),U=q[0],Z=q[1],ee=(0,i.useMemoizedFn)(function(e){Z(e),R(1)}),et=(0,i.useRequest)(function(){return G(function(){var e,t,n;return W(this,function(r){switch(r.label){case 0:return[4,d.api.resource("workflowCategories").list({paginate:!1,sort:["sort"]})];case 1:return[2,null!=(e=null==(n=r.sent())||null==(t=n.data)?void 0:t.data)?e:[]]}})})()}),en=et.data,er=et.refresh,eo=(0,c.useMemo)(function(){return en||[]},[en]),ea=(0,c.useMemo)(function(){return eo.map(function(e){var t;return{value:e.id,label:n(null!=(t=e.title)?t:"")}})},[eo,n]),el=(0,i.useRequest)(function(){return G(function(){var e,t;return W(this,function(n){switch(n.label){case 0:return e={current:!0},"all"!==I&&(e["categories.id"]=I),t=U?{$and:[e,U]}:e,[4,S.list({page:D,pageSize:z,sort:["-createdAt"],except:["config"],appends:["categories","stats"],filter:t})];case 1:var r,o,a,l,i;return[2,{records:l=Array.isArray(a=null==(o=null==(r=n.sent())?void 0:r.data)?void 0:o.data)?a:Array.isArray(null==a?void 0:a.data)?a.data:[],total:(i=(null==o?void 0:o.meta)||(null==a?void 0:a.meta)||{}).count||i.total||l.length}]}})})()},{refreshDeps:[D,z,I,U]}),ei=el.data,eu=el.loading,ec=el.refresh,es=(0,i.useMemoizedFn)(function(e,t){if(t!==z){_(t),R(1);return}R(e)}),ed=(0,i.useMemoizedFn)(function(e){var t=e?C.getTriggerOptions(e):void 0;return(null==t?void 0:t.title)?n(t.title):e}),ef=(0,i.useMemoizedFn)(function(e,t){d.viewer.drawer({width:"50%",closable:!0,content:function(){return s().createElement(N,{mode:e,plugin:C,record:t,categoryOptions:ea,onSubmitted:function(){return ec()}})}})}),em=(0,i.useMemoizedFn)(function(e){d.viewer.dialog({width:520,closable:!0,content:function(){return s().createElement(X,{record:e,resource:S,onSubmitted:function(){return ec()}})}})}),ep=(0,i.useMemoizedFn)(function(e){d.router.navigate(f(e.id))}),ey=(0,i.useMemoizedFn)(function(e){d.viewer.drawer({width:"60%",closable:!0,title:t("Execution history"),content:function(){return s().createElement(g.S,{workflowKey:e.key})}})}),eb=(0,i.useMemoizedFn)(function(e){w.confirm({title:t("Delete record"),content:t("Are you sure you want to delete it?"),onOk:function(){return G(function(){return W(this,function(t){switch(t.label){case 0:return[4,S.destroy({filterByTk:e})];case 1:return t.sent(),K([]),ec(),[2]}})})()}})}),eg=(0,i.useMemoizedFn)(function(){return G(function(){return W(this,function(e){switch(e.label){case 0:return[4,S.sync()];case 1:return e.sent(),E.success(t("Operation succeeded")),ec(),[2]}})})()}),ev=!!((null==(e=d.app)?void 0:e.name)&&"main"!==d.app.name||d.app.pm.get("multi-app-share-collection")),eh=(0,c.useMemo)(function(){return[{title:t("Title"),dataIndex:"title"},{title:t("Category"),dataIndex:"categories",render:function(e){return s().createElement(u.Space,{size:[0,4],wrap:!0},(null!=e?e:[]).map(function(e){return s().createElement(u.Tag,{key:e.id,color:"default"===e.color?void 0:e.color},n(e.title))}))}},{title:t("Trigger type"),dataIndex:"type",render:function(e){return e?s().createElement(u.Tag,{color:"gold"},ed(e)):null}},{title:t("Execute mode"),dataIndex:"sync",width:140,render:function(e){return s().createElement(m.t,{value:e})}},{title:t("Enabled"),dataIndex:"enabled",width:100,render:function(e,t){return s().createElement(H,{record:t,resource:S,onChanged:ec})}},{title:t("Executed"),dataIndex:["stats","executed"],width:100,render:function(e,t){var n,r;return s().createElement("a",{"aria-label":"executed-".concat(t.title),onClick:function(){return ey(t)}},null!=(n=null==(r=t.stats)?void 0:r.executed)?n:0)}},{title:t("Actions"),width:260,render:function(e,n){return s().createElement(u.Space,{size:"middle",wrap:!1,style:{whiteSpace:"nowrap"}},s().createElement("a",{onClick:function(){return ep(n)}},t("Configure")),s().createElement("a",{onClick:function(){return ef("edit",n)}},t("Edit")),s().createElement("a",{onClick:function(){return em(n)}},t("Duplicate")),s().createElement("a",{onClick:function(){return eb(n.id)}},t("Delete")))}}]},[eb,ep,em,ey,ef,ec,S,t,ed]);return s().createElement("div",{className:x},s().createElement(O,{className:k,activeKey:I,onChange:function(e){M(e),R(1)},categories:eo,refreshCategories:er}),s().createElement("div",{className:A},s().createElement(u.Flex,{justify:"space-between",align:"center",style:{marginBottom:v.margin}},s().createElement(o.CollectionFilter,{collection:T,nonfilterableFieldNames:Y,onChange:ee,t:n}),s().createElement(u.Space,null,s().createElement(u.Button,{icon:s().createElement(r.ReloadOutlined,null),onClick:function(){return ec()}},t("Refresh")),ev?s().createElement(u.Tooltip,{title:t("Sync enabled status of all workflows from database")},s().createElement(u.Button,{icon:s().createElement(r.SyncOutlined,null),onClick:eg},t("Sync"))):null,s().createElement(u.Button,{icon:s().createElement(r.DeleteOutlined,null),disabled:!B.length,onClick:function(){return eb(B)}},t("Delete")),s().createElement(u.Button,{type:"primary",icon:s().createElement(r.PlusOutlined,null),onClick:function(){return ef("create")}},t("Add new")))),s().createElement(o.Table,{rowKey:"id",loading:eu,columns:eh,dataSource:(null==ei?void 0:ei.records)||[],rowSelection:{selectedRowKeys:B,onChange:K},pagination:{current:D,pageSize:z,total:(null==ei?void 0:ei.total)||0,onChange:es}})))}function ee(){var e=(0,y.kj)(),t=(0,l.useFlowContext)().app.pm.get(b.A),n=(0,c.useMemo)(function(){var n=Array.from(t.triggers.getEntities()).map(function(t){var n=V(t,2),r=n[0],o=n[1];return{value:r,label:(null==o?void 0:o.title)?e(o.title):String(r)}}).sort(function(e,t){return String(e.label).localeCompare(String(t.label))});return[q(K({},f),{hidden:!0,fields:f.fields.map(function(e){return(null==e?void 0:e.name)==="type"&&e.uiSchema?q(K({},e),{uiSchema:q(K({},e.uiSchema),{enum:n})}):e})})]},[t,e]);return s().createElement(o.ExtendCollectionsProvider,{collections:n},s().createElement(Z,null))}},7001:function(e,t,n){n.d(t,{TD:function(){return l}});var r=n(2625),o=n(8401);function a(){return"u">typeof window&&"string"==typeof window.__nocobase_modern_client_prefix__&&window.__nocobase_modern_client_prefix__.trim().length>0}function l(){var e=(0,r.useMemoizedFn)(function(e){return a()?(0,o.JG)(e):"/admin/settings/workflow/workflows/".concat(e)}),t=(0,r.useMemoizedFn)(function(e){return a()?(0,o.Pq)(e):"/admin/settings/workflow/executions/".concat(e)});return{isV2Runtime:a(),getWorkflowCanvasPath:e,getWorkflowExecutionPath:t}}},9239:function(e,t,n){n.d(t,{GO:function(){return a},QQ:function(){return u},hi:function(){return l},m2:function(){return i}});var r=n(358);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a={QUEUEING:null,STARTED:0,RESOLVED:1,FAILED:-1,ERROR:-2,ABORTED:-3,CANCELED:-4,REJECTED:-5,RETRY_NEEDED:-6},l=[{value:a.QUEUEING,label:'{{t("Queueing", { ns: "'.concat(r.C,'" })}}'),color:"blue",description:'{{t("Triggered but still waiting in queue to execute.", { ns: "'.concat(r.C,'" })}}')},{value:a.STARTED,label:'{{t("On going", { ns: "'.concat(r.C,'" })}}'),color:"gold",description:'{{t("Started and executing, maybe waiting for an async callback (manual, delay etc.).", { ns: "'.concat(r.C,'" })}}')},{value:a.RESOLVED,label:'{{t("Resolved", { ns: "'.concat(r.C,'" })}}'),color:"green",description:'{{t("Successfully finished.", { ns: "'.concat(r.C,'" })}}')},{value:a.FAILED,label:'{{t("Failed", { ns: "'.concat(r.C,'" })}}'),color:"red",description:'{{t("Failed to satisfy node configurations.", { ns: "'.concat(r.C,'" })}}')},{value:a.ERROR,label:'{{t("Error", { ns: "'.concat(r.C,'" })}}'),color:"red",description:'{{t("Some node meets error.", { ns: "'.concat(r.C,'" })}}')},{value:a.ABORTED,label:'{{t("Aborted", { ns: "'.concat(r.C,'" })}}'),color:"red",description:'{{t("Running of some node was aborted by program flow.", { ns: "'.concat(r.C,'" })}}')},{value:a.CANCELED,label:'{{t("Canceled", { ns: "'.concat(r.C,'" })}}'),color:"volcano",description:'{{t("Manually canceled whole execution when waiting.", { ns: "'.concat(r.C,'" })}}')},{value:a.REJECTED,label:'{{t("Rejected", { ns: "'.concat(r.C,'" })}}'),color:"volcano",description:'{{t("Rejected from a manual node.", { ns: "'.concat(r.C,'" })}}')},{value:a.RETRY_NEEDED,label:'{{t("Retry needed", { ns: "'.concat(r.C,'" })}}'),color:"volcano",description:'{{t("General failed but should do another try.", { ns: "'.concat(r.C,'" })}}')}],i=l.reduce(function(e,t){return Object.assign(e,o({},t.value,t))},{}),u=[{value:r.K.TIMEOUT,label:'{{t("Timed out", { ns: "'.concat(r.C,'" })}}')},{value:r.K.MANUAL_CANCEL,label:'{{t("Canceled manually", { ns: "'.concat(r.C,'" })}}')},{value:r.K.PARENT_ABORTED,label:'{{t("Aborted with parent execution", { ns: "'.concat(r.C,'" })}}')}].reduce(function(e,t){return Object.assign(e,o({},t.value,t))},{})}}]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_workflow_client_v2=self.webpackChunk_nocobase_plugin_workflow_client_v2||[]).push([["276"],{5329:function(e,n,t){t.d(n,{F:function(){return c}});var r=t(9155),o=t.n(r),l=t(2059),a=t(7806),i=t(9488);function u(e){var n=e.value,t=e.onChange,l=e.disabled,i=e.onCollectionChanged,u=(0,r.useRef)();return o().createElement(a.XJ,{value:n,disabled:l,onChange:function(e){var r,o=null!=(r=u.current)?r:n;null==t||t(e),o&&o!==e&&(null==i||i(o,e)),u.current=e}})}function c(e){var n=e.disabled,t=e.onCollectionChanged,r=(0,i.kj)();return o().createElement(l.Form.Item,{name:["config","collection"],label:r("Collection"),rules:[{required:!0}]},o().createElement(u,{disabled:n,onCollectionChanged:t}))}},9671:function(e,n,t){t.d(n,{DestroyFieldset:function(){return f},DestroyPresetFieldset:function(){return s}});var r=t(9155),o=t.n(r),l=t(2059),a=t(2235),i=t(5329),u=t(6855);function c(){var e=l.Form.useWatch(["config","collection"]);return e?o().createElement(u.F,{collection:e}):null}function f(){var e,n=(0,a.TA)(),t=l.Form.useFormInstance();return o().createElement(o().Fragment,null,o().createElement(i.F,{disabled:!!(null==n||null==(e=n.config)?void 0:e.collection),onCollectionChanged:function(){t.setFieldValue(["config","params","filter"],{})}}),o().createElement(c,null))}function s(){return o().createElement(i.F,null)}},6855:function(e,n,t){t.d(n,{F:function(){return f}});var r=t(9155),o=t.n(r),l=t(2059),a=t(7768),i=t(1801),u=t(9488);function c(e,n,t,r,o,l,a){try{var i=e[l](a),u=i.value}catch(e){t(e);return}i.done?n(u):Promise.resolve(u).then(r,o)}function f(e){var n=e.collection,t=e.label,r=e.name,f=e.required,s=(0,u.kj)();return o().createElement(l.Form.Item,{name:void 0===r?["config","params","filter"]:r,label:null!=t?t:s("Filter"),validateTrigger:["onChange","onBlur"],rules:void 0===f||f?[{validator:function(e,n){var t;return(t=function(){return function(e,n){var t,r,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:u(0)}),i(a,"throw",{value:u(1)}),i(a,"return",{value:u(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function u(i){return function(u){var c=[i,u];if(t)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(l=0)),l;)try{if(t=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=n.call(e,l)}catch(e){c=[6,e],r=0}finally{t=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(e){if(!(0,a.isValidFilter)(n))throw Error(s("Please add at least one condition"));return[2]})},function(){var e=this,n=arguments;return new Promise(function(r,o){var l=t.apply(e,n);function a(e){c(l,r,o,a,i,"next",e)}function i(e){c(l,r,o,a,i,"throw",e)}a(void 0)})})()}}]:void 0},o().createElement(i.N$,{collection:n}))}}}]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_workflow_client_v2=self.webpackChunk_nocobase_plugin_workflow_client_v2||[]).push([["326"],{5927:function(e,t,n){n.d(t,{t:function(){return i}});var r=n(2059),o=n(9155),a=n.n(o),l=n(9488);function i(e){var t=e.value,n=(0,l.ec)().t;return t?a().createElement(r.Tag,{color:"orange"},n("Synchronously")):a().createElement(r.Tag,{color:"cyan"},n("Asynchronously"))}},4315:function(e,t,n){n.d(t,{S:function(){return I}});var r,o=n(7375),a=n(3485),l=n(7694),i=n(2625),c=n(2059),u=n(9185),s=n.n(u),p=n(9155),d=n.n(p),m=n(358),f={dumpRules:{group:"log"},migrationRules:["schema-only"],name:"executions",dataCategory:"business",shared:!0,fields:[{type:"snowflakeId",name:"id",interface:"id",uiSchema:{type:"number",title:'{{t("ID")}}',"x-component":"Input","x-component-props":{},"x-read-pretty":!0},primaryKey:!0,allowNull:!1},{type:"bigInt",name:"workflowId",interface:"id",uiSchema:{type:"number",title:'{{t("Version ID", { ns: "'.concat(m.C,'" })}}'),"x-component":"InputNumber","x-component-props":{},"x-read-pretty":!0}},{type:"belongsTo",name:"workflow",target:"workflows",foreignKey:"workflowId",interface:"m2o",uiSchema:{type:"object",title:'{{t("Version", { ns: "'.concat(m.C,'" })}}'),"x-component":"AssociationField","x-component-props":{fieldNames:{label:"id",value:"id"}},"x-read-pretty":!0}},{type:"string",name:"key"},{type:"string",name:"eventKey",unique:!0},{type:"hasMany",name:"jobs",onDelete:"CASCADE"},{type:"json",name:"context"},{type:"integer",name:"status",interface:"select",uiSchema:{title:'{{t("Status", { ns: "'.concat(m.C,'" })}}'),type:"string","x-component":"Select","x-decorator":"FormItem",enum:"{{ExecutionStatusOptions}}"}},{type:"string",name:"reason",uiSchema:{title:'{{t("Reason", { ns: "'.concat(m.C,'" })}}'),type:"string","x-component":"Select","x-decorator":"FormItem",enum:"{{ExecutionReasonOptions}}"}},{type:"boolean",name:"dispatched",defaultValue:!1},{type:"bigInt",name:"parentExecutionId",interface:"id",uiSchema:{type:"number",title:'{{t("Parent execution ID", { ns: "'.concat(m.C,'" })}}'),"x-component":"InputNumber","x-component-props":{},"x-read-pretty":!0}},{type:"json",name:"stack"},{type:"json",name:"output"},{type:"datetime",name:"startedAt",uiSchema:{type:"datetime",title:'{{t("Started at", { ns: "'.concat(m.C,'" })}}'),"x-component":"DatePicker","x-component-props":{},"x-read-pretty":!0}},{type:"datetime",name:"expiresAt",uiSchema:{type:"datetime",title:'{{t("Expires at", { ns: "'.concat(m.C,'" })}}'),"x-component":"DatePicker","x-component-props":{},"x-read-pretty":!0}},{type:"datetime",name:"createdAt",interface:"createdAt",uiSchema:{type:"datetime",title:'{{t("Triggered at", { ns: "'.concat(m.C,'" })}}'),"x-component":"DatePicker","x-component-props":{},"x-read-pretty":!0}},{type:"boolean",name:"manually",interface:"checkbox",uiSchema:{type:"boolean",title:'{{t("Triggered manually", { ns: "'.concat(m.C,'" })}}'),"x-component":"Checkbox","x-component-props":{},"x-read-pretty":!0}}],indexes:[{fields:["dispatched","id"]},{fields:["status","expiresAt"]},{fields:["parentExecutionId","status"]}]},y=n(9239),b=n(9488);function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var g=(h(r={},y.GO.QUEUEING,d().createElement(o.HourglassOutlined,null)),h(r,y.GO.STARTED,d().createElement(o.LoadingOutlined,null)),h(r,y.GO.RESOLVED,d().createElement(o.CheckOutlined,null)),h(r,y.GO.FAILED,d().createElement(o.ExclamationOutlined,null)),h(r,y.GO.ERROR,d().createElement(o.CloseOutlined,null)),h(r,y.GO.ABORTED,d().createElement(o.MinusOutlined,{rotate:90})),h(r,y.GO.CANCELED,d().createElement(o.MinusOutlined,{rotate:45})),h(r,y.GO.REJECTED,d().createElement(o.MinusOutlined,null)),h(r,y.GO.RETRY_NEEDED,d().createElement(o.RedoOutlined,null)),r);function E(e){var t=e.value,n=(0,b.kj)(),r=y.m2[t];if(!r)return null;var o=g[t];return d().createElement(c.Tag,{color:r.color,icon:o},n(r.label))}var v=n(7001);function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function x(e,t,n,r,o,a,l){try{var i=e[a](l),c=i.value}catch(e){n(e);return}i.done?t(c):Promise.resolve(c).then(r,o)}function O(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function l(e){x(a,r,o,l,i,"next",e)}function i(e){x(a,r,o,l,i,"throw",e)}l(void 0)})}}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function S(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function C(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],l=!0,i=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);l=!0);}catch(e){i=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(i)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(l,"next",{value:c(0)}),i(l,"throw",{value:c(1)}),i(l,"return",{value:c(2)}),"function"==typeof Symbol&&i(l,Symbol.iterator,{value:function(){return this}}),l;function c(i){return function(c){var u=[i,c];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}var A=["workflow"];function j(e){var t=e.workflowKey,n=(0,b.ec)().t,r=(0,b.kj)(),u=(0,l.useFlowContext)(),m=(0,l.useFlowEngine)(),f=(0,v.TD)().getWorkflowExecutionPath,h=c.theme.useToken().token,g=c.App.useApp(),w=g.modal,x=g.message,k=u.api.resource("executions"),S=(0,p.useMemo)(function(){var e,t,n,r;return null==(r=m.context.dataSourceManager)||null==(n=r.getDataSource)||null==(t=n.call(r,"main"))||null==(e=t.getCollection)?void 0:e.call(t,"executions")},[m]),j=C((0,p.useState)(1),2),I=j[0],T=j[1],P=C((0,p.useState)(20),2),R=P[0],M=P[1],F=C((0,p.useState)(void 0),2),G=F[0],_=F[1],z=C((0,p.useState)([]),2),N=z[0],B=z[1],K=(0,i.useMemoizedFn)(function(e){_(e),T(1)}),V=(0,i.useRequest)(function(){return O(function(){var e;return D(this,function(n){switch(n.label){case 0:return e=G?{$and:[{key:t},G]}:{key:t},[4,k.list({page:I,pageSize:R,sort:["-id"],except:["context","output","stack"],filter:e})];case 1:var r,o,a,l,i;return[2,{records:l=Array.isArray(a=null==(o=null==(r=n.sent())?void 0:r.data)?void 0:o.data)?a:Array.isArray(null==a?void 0:a.data)?a.data:[],total:(i=(null==o?void 0:o.meta)||(null==a?void 0:a.meta)||{}).count||i.total||l.length}]}})})()},{refreshDeps:[I,R,G,t]}),U=V.data,Y=V.loading,L=V.refresh,H=(0,i.useMemoizedFn)(function(e,t){if(t!==R){M(t),T(1);return}T(e)}),q=(0,i.useMemoizedFn)(function(e){w.confirm({title:n("Delete record"),content:n("Are you sure you want to delete it?"),onOk:function(){return O(function(){return D(this,function(t){switch(t.label){case 0:return[4,k.destroy({filterByTk:e})];case 1:return t.sent(),B([]),L(),[2]}})})()}})}),Q=(0,i.useMemoizedFn)(function(){w.confirm({title:n("Clear all executions"),content:n("Clear executions will not reset executed count, and started executions will not be deleted, are you sure you want to delete them all?"),onOk:function(){return O(function(){return D(this,function(e){switch(e.label){case 0:return[4,k.destroy({filter:{key:t}})];case 1:return e.sent(),x.success(n("Operation succeeded")),B([]),L(),[2]}})})()}})}),$=(0,i.useMemoizedFn)(function(e){w.confirm({title:n("Cancel the execution"),icon:d().createElement(o.ExclamationCircleFilled,null),content:n("Are you sure you want to cancel the execution?"),onOk:function(){return O(function(){return D(this,function(t){switch(t.label){case 0:return[4,k.cancel({filterByTk:e.id})];case 1:return t.sent(),x.success(n("Operation succeeded")),L(),[2]}})})()}})}),J=(0,i.useMemoizedFn)(function(e){var t,n;null==(n=u.view)||null==(t=n.close)||t.call(n),u.router.navigate(f(e.id))}),W=(0,p.useMemo)(function(){return[{title:n("ID"),dataIndex:"id"},{title:n("Triggered at"),dataIndex:"createdAt",render:function(e){return e?s()(e).format("YYYY-MM-DD HH:mm:ss"):null}},{title:n("Version"),dataIndex:"workflowId",render:function(e){return null!=e?"#".concat(e):null}},{title:n("Status"),dataIndex:"status",render:function(e,t){return d().createElement(c.Space,null,d().createElement(E,{value:e}),t.status===y.GO.STARTED||t.status===y.GO.QUEUEING?d().createElement(c.Tooltip,{title:n("Cancel the execution")},d().createElement(c.Button,{type:"link",danger:!0,onClick:function(){return $(t)},shape:"circle",size:"small",icon:d().createElement(o.StopOutlined,null)})):null)}},{title:n("Actions"),width:160,render:function(e,t){return d().createElement(c.Space,{size:"middle",wrap:!1,style:{whiteSpace:"nowrap"}},d().createElement("a",{onClick:function(){return J(t)}},n("View")),t.status!==y.GO.STARTED?d().createElement("a",{onClick:function(){return q(t.id)}},n("Delete")):null)}}]},[$,q,J,n]);return d().createElement("div",null,d().createElement(c.Flex,{justify:"space-between",align:"center",style:{marginBottom:h.margin}},d().createElement(a.CollectionFilter,{collection:S,nonfilterableFieldNames:A,onChange:K,t:r}),d().createElement(c.Space,null,d().createElement(c.Button,{icon:d().createElement(o.ReloadOutlined,null),onClick:function(){return L()}},n("Refresh")),d().createElement(c.Button,{icon:d().createElement(o.DeleteOutlined,null),disabled:!N.length,onClick:function(){return q(N)}},n("Delete")),d().createElement(c.Button,{danger:!0,onClick:Q},n("Clear")))),d().createElement(a.Table,{rowKey:"id",loading:Y,columns:W,dataSource:(null==U?void 0:U.records)||[],rowSelection:{selectedRowKeys:N,onChange:B},pagination:{current:I,pageSize:R,total:(null==U?void 0:U.total)||0,onChange:H}}))}function I(e){var t=e.workflowKey,n=(0,b.kj)(),r=(0,p.useMemo)(function(){var e=y.hi.map(function(e){return{value:e.value,label:n(e.label)}});return[S(k({},f),{fields:f.fields.map(function(t){return(null==t?void 0:t.name)==="status"&&t.uiSchema?S(k({},t),{uiSchema:S(k({},t.uiSchema),{enum:e})}):t})})]},[n]);return d().createElement(a.ExtendCollectionsProvider,{collections:r},d().createElement(j,{workflowKey:t}))}}}]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_workflow_client_v2=self.webpackChunk_nocobase_plugin_workflow_client_v2||[]).push([["346"],{3253:function(e,n,t){var r=t(9168),o=t.n(r),a=t(8433),i=t.n(a)()(o());i.push([e.id,".react-js-cron {\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n align-items: flex-start;\n flex-wrap: wrap;\n}\n.react-js-cron > div,\n.react-js-cron-field {\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n align-items: center;\n}\n.react-js-cron-field {\n margin-bottom: 10px;\n}\n.react-js-cron-field > span {\n margin-left: 5px;\n}\ndiv.react-js-cron-select {\n margin-left: 5px;\n}\n.react-js-cron-select.react-js-cron-select-no-prefix {\n margin-left: 0;\n}\ndiv.react-js-cron-error .react-js-cron-select .ant-select-selector {\n border-color: #ff4d4f;\n background: #fff6f6;\n}\ndiv.react-js-cron-custom-select {\n min-width: 70px;\n z-index: 1;\n}\ndiv.react-js-cron-error div.react-js-cron-custom-select {\n background: #fff6f6;\n}\ndiv.react-js-cron-select.react-js-cron-custom-select.ant-select\n div.ant-select-selector {\n padding-left: 11px;\n padding-right: 30px;\n}\n.react-js-cron-read-only\n div.react-js-cron-select.react-js-cron-custom-select.ant-select\n div.ant-select-selector {\n padding-right: 11px;\n}\ndiv.react-js-cron-custom-select .ant-select-selection-search {\n width: 0 !important;\n margin: 0 !important;\n}\ndiv.react-js-cron-custom-select .ant-select-selection-placeholder {\n position: static;\n top: 50%;\n right: auto;\n left: auto;\n transform: none;\n transition: none;\n opacity: 1;\n color: inherit;\n}\n.react-js-cron-week-days-placeholder\n .react-js-cron-custom-select\n .ant-select-selection-placeholder,\n.react-js-cron-month-days-placeholder\n .react-js-cron-custom-select\n .ant-select-selection-placeholder {\n opacity: 0.4;\n}\n.react-js-cron-custom-select-dropdown {\n min-width: 0 !important;\n width: 170px !important;\n}\n.react-js-cron-custom-select-dropdown .rc-virtual-list {\n max-height: none !important;\n}\n.react-js-cron-custom-select-dropdown-grid .rc-virtual-list-holder-inner {\n display: grid !important;\n grid-template-columns: repeat(4, 1fr);\n}\n.react-js-cron-custom-select-dropdown-grid\n .rc-virtual-list-holder-inner\n .ant-select-item-option-content {\n text-align: center;\n}\n.react-js-cron-custom-select-dropdown-hours-twelve-hour-clock {\n width: 260px !important;\n}\n.react-js-cron-custom-select-dropdown-minutes-large {\n width: 300px !important;\n}\n.react-js-cron-custom-select-dropdown-minutes-large\n .rc-virtual-list-holder-inner {\n grid-template-columns: repeat(7, 1fr);\n}\n.react-js-cron-custom-select-dropdown-minutes-medium {\n width: 215px !important;\n}\n.react-js-cron-custom-select-dropdown-minutes-medium\n .rc-virtual-list-holder-inner {\n grid-template-columns: repeat(5, 1fr);\n}\n.react-js-cron-period > span:first-child {\n margin-left: 0 !important;\n}\n.react-js-cron-period\n .react-js-cron-select.ant-select-single.ant-select-open\n .ant-select-selection-item {\n opacity: 1;\n}\n.react-js-cron-select-dropdown-period {\n min-width: 0 !important;\n width: auto !important;\n}\n.react-js-cron-clear-button {\n margin-left: 10px;\n margin-bottom: 10px;\n}\n.react-js-cron-disabled .react-js-cron-select.ant-select-disabled {\n background: #f5f5f5;\n}\ndiv.react-js-cron-select.react-js-cron-custom-select.ant-select\n div.ant-select-selector\n > .ant-select-selection-overflow {\n align-items: center;\n flex: initial;\n}\n",""]),n.A=i},8433:function(e){e.exports=function(e){var n=[];return n.toString=function(){return this.map(function(n){var t="",r=void 0!==n[5];return n[4]&&(t+="@supports (".concat(n[4],") {")),n[2]&&(t+="@media ".concat(n[2]," {")),r&&(t+="@layer".concat(n[5].length>0?" ".concat(n[5]):""," {")),t+=e(n),r&&(t+="}"),n[2]&&(t+="}"),n[4]&&(t+="}"),t}).join("")},n.i=function(e,t,r,o,a){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(r)for(var c=0;c<this.length;c++){var l=this[c][0];null!=l&&(i[l]=!0)}for(var s=0;s<e.length;s++){var u=[].concat(e[s]);r&&i[u[0]]||(void 0!==a&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=a),t&&(u[2]&&(u[1]="@media ".concat(u[2]," {").concat(u[1],"}")),u[2]=t),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),n.push(u))}},n}},9168:function(e){e.exports=function(e){return e[1]}},2837:function(e,n,t){t.d(n,{l4:function(){return F}});var r=t(2295),o=t(2059),a=t(9155),i=function(){return(i=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};function c(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>n.indexOf(r)&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>n.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}function l(e,n,t){if(t||2==arguments.length)for(var r,o=0,a=n.length;o<a;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}var s=[{name:"@yearly",value:"0 0 1 1 *"},{name:"@annually",value:"0 0 1 1 *"},{name:"@monthly",value:"0 0 1 * *"},{name:"@weekly",value:"0 0 * * 0"},{name:"@daily",value:"0 0 * * *"},{name:"@midnight",value:"0 0 * * *"},{name:"@hourly",value:"0 * * * *"}],u=[{type:"minutes",min:0,max:59,total:60},{type:"hours",min:0,max:23,total:24},{type:"month-days",min:1,max:31,total:31},{type:"months",min:1,max:12,total:12,alt:["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"]},{type:"week-days",min:0,max:6,total:7,alt:["SUN","MON","TUE","WED","THU","FRI","SAT"]}],d={everyText:"every",emptyMonths:"every month",emptyMonthDays:"every day of the month",emptyMonthDaysShort:"day of the month",emptyWeekDays:"every day of the week",emptyWeekDaysShort:"day of the week",emptyHours:"every hour",emptyMinutes:"every minute",emptyMinutesForHourPeriod:"every",yearOption:"year",monthOption:"month",weekOption:"week",dayOption:"day",hourOption:"hour",minuteOption:"minute",rebootOption:"reboot",prefixPeriod:"Every",prefixMonths:"in",prefixMonthDays:"on",prefixWeekDays:"on",prefixWeekDaysForMonthAndYearPeriod:"and",prefixHours:"at",prefixMinutes:":",prefixMinutesForHourPeriod:"at",suffixMinutesForHourPeriod:"minute(s)",errorInvalidCron:"Invalid cron expression",clearButtonText:"Clear",weekDays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],altWeekDays:["SUN","MON","TUE","WED","THU","FRI","SAT"],altMonths:["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"]};function p(e,n){for(var t=[],r=e;r<=n;r++)t.push(r);return t}function m(e){return e.sort(function(e,n){return e-n}),e}function f(e){var n=[];return e.forEach(function(e){0>n.indexOf(e)&&n.push(e)}),n}function h(e){return Object.entries(e).filter(function(e){var n=e[0],t=e[1];return n&&t}).map(function(e){return e[0]}).join(" ")}function y(e,n){e&&e({type:"invalid_cron",description:n.errorInvalidCron||d.errorInvalidCron})}function v(e){var n=parseInt(e,10),t=Number(e);return n===t?t:NaN}function g(e,n,t,r,o,a,i,c,l,d,h,g,b,x){t&&t(void 0),n(!1);var j=!1;if(!e){if("always"===r||a&&"for-default-value"===r)return;j=!0}if(!j){if(c&&(!0===c||c.includes(e))){if("@reboot"===e)return void x("reboot");var w=s.find(function(n){return n.name===e});w&&(e=w.value)}try{var M=function(e){if("string"!=typeof e)throw Error("Invalid cron string");var n=e.replace(/\s+/g," ").trim().split(" ");if(5===n.length)return n.map(function(e,n){var t=u[n];if("*"===e||"*/1"===e)return[];var r=m(f(k((function(e,n,t){if(t){e=e.toUpperCase();for(var r=0;r<t.length;r++)e=e.replace(t[r],"".concat(r+n))}return e})(e,t.min,t.alt).split(",").map(function(n){var r,o=n.split("/");if(o.length>2)throw Error('Invalid value "'.concat(e,' for "').concat(t.type,'"'));var a=o[0],i=o[1];r="*"===a?p(t.min,t.max):function(e,n,t){var r=e.split("-");if(1===r.length){var o=v(r[0]);if(isNaN(o))throw Error('Invalid value "'.concat(n,'" for ').concat(t.type));return[o]}if(2===r.length){var a=v(r[0]),i=v(r[1]);if(isNaN(a)||isNaN(i))throw Error('Invalid value "'.concat(n,'" for ').concat(t.type));if(i<a)throw Error('Max range is less than min range in "'.concat(e,'" for ').concat(t.type));return p(a,i)}throw Error('Invalid value "'.concat(e,'" for ').concat(t.type))}(a,e,t);var c=function(e,n){if(void 0!==e){var t=v(e);if(isNaN(t)||t<1)throw Error('Invalid interval step value "'.concat(e,'" for ').concat(n.type));return t}}(i,t),l=r,s=c;if(s){var u=l[0];l=l.filter(function(e){return e%s==u%s||e===u})}return l}).flat(),t))),o=O(r,t);if(void 0!==o)throw Error('Value "'.concat(o,'" out of range for ').concat(t.type));return r.length===t.total?[]:r});throw Error("Invalid cron string format")}(e),N=M[3].length>0?"year":M[2].length>0?"month":M[4].length>0?"week":M[1].length>0?"day":M[0].length>0?"hour":"minute";x(N),l(M[0]),d(M[1]),h(M[2]),g(M[3]),b(M[4])}catch(e){j=!0}}j&&(o.current=e,n(!0),y(t,i))}function b(e,n,t,r,o,a,i){return"reboot"===e?"@reboot":["minute"!==e&&a?a:[],"minute"!==e&&"hour"!==e&&o?o:[],("year"===e||"month"===e)&&t?t:[],"year"===e&&n?n:[],("year"===e||"month"===e||"week"===e)&&r?r:[]].map(function(e,n){var t=u[n];return x(w(e,t),t,i)}).join(" ")}function x(e,n,t,r,o){var a="";if(e.length===n.max-n.min+1||0===e.length)a="*";else{var i,c,l,s,u,d=function(e){if(e.length>2){var n=e[1]-e[0];if(n>1)return n}}(e);a=d&&function(e,n){for(var t=1;t<e.length;t++){var r=e[t-1];if(e[t]-r!==n)return!1}return!0}(e,d)?(i=e[0],c=M(e),l=e.length===(c-i)/d+1,i===n.min&&c+d>n.max&&l||0)?"*/".concat(d):"".concat(j(e[0],n,t,r,o),"-").concat(j(M(e),n,t,r,o),"/").concat(d):(s=[],u=null,e.forEach(function(e,n,t){e!==t[n+1]-1?null!==u?(s.push([u,e]),u=null):s.push(e):null===u&&(u=e)}),s).map(function(e){return Array.isArray(e)?"".concat(j(e[0],n,t,r,o),"-").concat(j(e[1],n,t,r,o)):j(e,n,t,r,o)}).join(",")}return a}function j(e,n,t,r,o){var a=e.toString(),i=n.type,c=n.alt,l=n.min,s=r&&(!0===r||r.includes(i)),u="24-hour-clock"===o&&("hours"===i||"minutes"===i);if(t&&"week-days"===i||t&&"months"===i?a=c[e-l]:e<10&&(s||u)&&(a=a.padStart(2,"0")),"hours"===i&&"12-hour-clock"===o){var d=e>=12?"PM":"AM",p=e%12||12;p<10&&s&&(p=p.toString().padStart(2,"0")),a="".concat(p).concat(d)}return a}function w(e,n){var t=m(f(k(e,n)));if(0===t.length)return t;var r=O(t,n);if(void 0!==r)throw Error('Value "'.concat(r,'" out of range for ').concat(n.type));return t}function k(e,n){return"week-days"===n.type&&(e=e.map(function(e){return 7===e?0:e})),e}function O(e,n){var t=e[0],r=e[e.length-1];return t<n.min?t:r>n.max?r:void 0}function M(e){return e[e.length-1]}function N(e){var n=e.value,t=e.grid,s=void 0===t||t,u=e.optionsList,p=e.setValue,f=e.locale,y=e.className,v=e.humanizeLabels,g=e.disabled,b=e.readOnly,k=e.leadingZero,O=e.clockFormat,M=e.period,N=e.unit,D=e.periodicityOnDoubleClick,S=e.mode,C=c(e,["value","grid","optionsList","setValue","locale","className","humanizeLabels","disabled","readOnly","leadingZero","clockFormat","period","unit","periodicityOnDoubleClick","mode"]),A=(0,a.useMemo)(function(){if(n&&Array.isArray(n))return n.map(function(e){return e.toString()})},[n]),E=(0,a.useMemo)(function(){return u?u.map(function(e,n){return{value:(0===N.min?n:n+1).toString(),label:e}}):l([],Array(N.total),!0).map(function(e,n){var t=0===N.min?n:n+1;return{value:t.toString(),label:j(t,N,v,k,O)}})},[u,k,v,O]),P=JSON.stringify(f),F=(0,a.useCallback)(function(e){var t=e.value;if(!n||n[0]!==Number(t))return(0,r.jsx)(r.Fragment,{});var o=x(w(n,N),N,v,k,O),a=o.match(/^\*\/([0-9]+),?/)||[];return(0,r.jsx)("div",{children:a[1]?"".concat(f.everyText||d.everyText," ").concat(a[1]):o})},[n,P,v,k,O]),T=(0,a.useCallback)(function(e){var t=Array.isArray(e)?m(e):[e],r=t;n&&(r="single"===S?[]:l([],n,!0),t.forEach(function(e){var t=Number(e);r=n.some(function(e){return e===t})?r.filter(function(e){return e!==t}):m(l(l([],r,!0),[t],!1))})),r.length===N.total?p([]):p(r)},[p,n]),_=(0,a.useCallback)(function(e){if(0!==e&&1!==e){for(var t=N.total+N.min,r=[],o=N.min;o<t;o++)o%e==0&&r.push(o);var a=n&&r&&n.length===r.length&&n.every(function(e,n){return e===r[n]});p(r.length===E.length||a?[]:r)}else p([])},[n,E,p]),V=(0,a.useRef)([]),I=(0,a.useCallback)(function(e){if(!b){var n=V.current;n.push({time:(new Date).getTime(),value:Number(e)});var t=window.setTimeout(function(){D&&n.length>1&&n[n.length-1].time-n[n.length-2].time<300?n[n.length-1].value===n[n.length-2].value?_(Number(e)):T([n[n.length-2].value,n[n.length-1].value]):T(Number(e)),V.current=[]},300);return function(){window.clearTimeout(t)}}},[V,T,_,b,D]),H=(0,a.useCallback)(function(){b||p([])},[p,b]),W=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-select":!0,"react-js-cron-custom-select":!0})["".concat(y,"-select")]=!!y,e))},[y]),L=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-select-dropdown":!0})["react-js-cron-select-dropdown-".concat(N.type)]=!0,e["react-js-cron-custom-select-dropdown"]=!0,e["react-js-cron-custom-select-dropdown-".concat(N.type)]=!0,e["react-js-cron-custom-select-dropdown-minutes-large"]="minutes"===N.type&&"hour"!==M&&"day"!==M,e["react-js-cron-custom-select-dropdown-minutes-medium"]="minutes"===N.type&&("day"===M||"hour"===M),e["react-js-cron-custom-select-dropdown-hours-twelve-hour-clock"]="hours"===N.type&&"12-hour-clock"===O,e["react-js-cron-custom-select-dropdown-grid"]=!!s,e["".concat(y,"-select-dropdown")]=!!y,e["".concat(y,"-select-dropdown-").concat(N.type)]=!!y,e))},[y,s,O,M]);return(0,r.jsx)(o.Select,i({mode:"single"!==S||D?"multiple":void 0,allowClear:!b,virtual:!1,open:!b&&void 0,value:A,onClear:H,tagRender:F,className:W,popupClassName:L,options:E,showSearch:!1,showArrow:!b,menuItemSelectedIcon:null,dropdownMatchSelectWidth:!1,onSelect:I,onDeselect:I,disabled:g,dropdownAlign:"minutes"!==N.type&&"hours"!==N.type||"day"===M||"hour"===M?void 0:{points:["tr","br"]},"data-testid":"custom-select-".concat(N.type)},C))}function D(e){var n=e.value,t=e.setValue,o=e.locale,c=e.className,l=e.disabled,s=e.readOnly,p=e.leadingZero,m=e.clockFormat,f=e.period,y=e.periodicityOnDoubleClick,v=e.mode,g=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-field":!0,"react-js-cron-hours":!0})["".concat(c,"-field")]=!!c,e["".concat(c,"-hours")]=!!c,e))},[c]);return(0,r.jsxs)("div",i({className:g},{children:[""!==o.prefixHours&&(0,r.jsx)("span",{children:o.prefixHours||d.prefixHours}),(0,r.jsx)(N,{placeholder:o.emptyHours||d.emptyHours,value:n,unit:u[1],setValue:t,locale:o,className:c,disabled:l,readOnly:s,leadingZero:p,clockFormat:m,period:f,periodicityOnDoubleClick:y,mode:v})]}))}function S(e){var n=e.value,t=e.setValue,o=e.locale,c=e.className,l=e.disabled,s=e.readOnly,p=e.leadingZero,m=e.clockFormat,f=e.period,y=e.periodicityOnDoubleClick,v=e.mode,g=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-field":!0,"react-js-cron-minutes":!0})["".concat(c,"-field")]=!!c,e["".concat(c,"-minutes")]=!!c,e))},[c]);return(0,r.jsxs)("div",i({className:g},{children:["hour"===f?""!==o.prefixMinutesForHourPeriod&&(0,r.jsx)("span",{children:o.prefixMinutesForHourPeriod||d.prefixMinutesForHourPeriod}):""!==o.prefixMinutes&&(0,r.jsx)("span",{children:o.prefixMinutes||d.prefixMinutes}),(0,r.jsx)(N,{placeholder:"hour"===f?o.emptyMinutesForHourPeriod||d.emptyMinutesForHourPeriod:o.emptyMinutes||d.emptyMinutes,value:n,unit:u[0],setValue:t,locale:o,className:c,disabled:l,readOnly:s,leadingZero:p,clockFormat:m,period:f,periodicityOnDoubleClick:y,mode:v}),"hour"===f&&""!==o.suffixMinutesForHourPeriod&&(0,r.jsx)("span",{children:o.suffixMinutesForHourPeriod||d.suffixMinutesForHourPeriod})]}))}function C(e){var n=e.value,t=e.setValue,o=e.locale,c=e.className,l=e.weekDays,s=e.disabled,p=e.readOnly,m=e.leadingZero,f=e.period,y=e.periodicityOnDoubleClick,v=e.mode,g=!l||0===l.length,b=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-field":!0,"react-js-cron-month-days":!0,"react-js-cron-month-days-placeholder":!g})["".concat(c,"-field")]=!!c,e["".concat(c,"-month-days")]=!!c,e))},[c,g]),x=JSON.stringify(o),j=(0,a.useMemo)(function(){return g?o.emptyMonthDays||d.emptyMonthDays:o.emptyMonthDaysShort||d.emptyMonthDaysShort},[g,x]);return p&&(!n||!(n.length>0))&&(n&&0!==n.length||l&&0!==l.length)?null:(0,r.jsxs)("div",i({className:b},{children:[""!==o.prefixMonthDays&&(0,r.jsx)("span",{children:o.prefixMonthDays||d.prefixMonthDays}),(0,r.jsx)(N,{placeholder:j,value:n,setValue:t,unit:u[2],locale:o,className:c,disabled:s,readOnly:p,leadingZero:m,period:f,periodicityOnDoubleClick:y,mode:v})]}))}function A(e){var n=e.value,t=e.setValue,o=e.locale,c=e.className,l=e.humanizeLabels,s=e.disabled,p=e.readOnly,m=e.period,f=e.periodicityOnDoubleClick,y=e.mode,v=o.months||d.months,g=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-field":!0,"react-js-cron-months":!0})["".concat(c,"-field")]=!!c,e["".concat(c,"-months")]=!!c,e))},[c]);return(0,r.jsxs)("div",i({className:g},{children:[""!==o.prefixMonths&&(0,r.jsx)("span",{children:o.prefixMonths||d.prefixMonths}),(0,r.jsx)(N,{placeholder:o.emptyMonths||d.emptyMonths,optionsList:v,grid:!1,value:n,unit:i(i({},u[3]),{alt:o.altMonths||d.altMonths}),setValue:t,locale:o,className:c,humanizeLabels:l,disabled:s,readOnly:p,period:m,periodicityOnDoubleClick:f,mode:y})]}))}function E(e){var n=e.value,t=e.setValue,c=e.locale,l=e.className,s=e.disabled,u=e.readOnly,p=e.shortcuts,m=e.allowedPeriods,f=[];m.includes("year")&&f.push({value:"year",label:c.yearOption||d.yearOption}),m.includes("month")&&f.push({value:"month",label:c.monthOption||d.monthOption}),m.includes("week")&&f.push({value:"week",label:c.weekOption||d.weekOption}),m.includes("day")&&f.push({value:"day",label:c.dayOption||d.dayOption}),m.includes("hour")&&f.push({value:"hour",label:c.hourOption||d.hourOption}),m.includes("minute")&&f.push({value:"minute",label:c.minuteOption||d.minuteOption}),m.includes("reboot")&&p&&(!0===p||p.includes("@reboot"))&&f.push({value:"reboot",label:c.rebootOption||d.rebootOption});var y=(0,a.useCallback)(function(e){u||t(e)},[t,u]),v=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-field":!0,"react-js-cron-period":!0})["".concat(l,"-field")]=!!l,e["".concat(l,"-period")]=!!l,e))},[l]),g=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-select":!0,"react-js-cron-select-no-prefix":""===c.prefixPeriod})["".concat(l,"-select")]=!!l,e))},[l,c.prefixPeriod]),b=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-select-dropdown":!0,"react-js-cron-select-dropdown-period":!0})["".concat(l,"-select-dropdown")]=!!l,e["".concat(l,"-select-dropdown-period")]=!!l,e))},[l]);return(0,r.jsxs)("div",i({className:v},{children:[""!==c.prefixPeriod&&(0,r.jsx)("span",{children:c.prefixPeriod||d.prefixPeriod}),(0,r.jsx)(o.Select,{defaultValue:n,value:n,onChange:y,options:f,className:g,popupClassName:b,disabled:s,showArrow:!u,open:!u&&void 0,"data-testid":"select-period"},JSON.stringify(c))]}))}function P(e){var n=e.value,t=e.setValue,o=e.locale,c=e.className,l=e.humanizeLabels,s=e.monthDays,p=e.disabled,m=e.readOnly,f=e.period,y=e.periodicityOnDoubleClick,v=e.mode,g=o.weekDays||d.weekDays,b="week"===f||!s||0===s.length,x=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-field":!0,"react-js-cron-week-days":!0,"react-js-cron-week-days-placeholder":!b})["".concat(c,"-field")]=!!c,e["".concat(c,"-week-days")]=!!c,e))},[c,b]),j=JSON.stringify(o),w=(0,a.useMemo)(function(){return b?o.emptyWeekDays||d.emptyWeekDays:o.emptyWeekDaysShort||d.emptyWeekDaysShort},[b,j]),k="week"===f||!m||n&&n.length>0||(!n||0===n.length)&&(!s||0===s.length),O=!m||s&&s.length>0||(!s||0===s.length)&&(!n||0===n.length);return k?(0,r.jsxs)("div",i({className:x},{children:[""!==o.prefixWeekDays&&("week"===f||!O)&&(0,r.jsx)("span",{children:o.prefixWeekDays||d.prefixWeekDays}),""!==o.prefixWeekDaysForMonthAndYearPeriod&&"week"!==f&&O&&(0,r.jsx)("span",{children:o.prefixWeekDaysForMonthAndYearPeriod||d.prefixWeekDaysForMonthAndYearPeriod}),(0,r.jsx)(N,{placeholder:w,optionsList:g,grid:!1,value:n,unit:i(i({},u[4]),{alt:o.altWeekDays||d.altWeekDays}),setValue:t,locale:o,className:c,humanizeLabels:l,disabled:p,readOnly:m,period:f,periodicityOnDoubleClick:y,mode:v})]})):null}function F(e){var n,t=e.clearButton,l=void 0===t||t,s=e.clearButtonProps,u=void 0===s?{}:s,p=e.clearButtonAction,m=void 0===p?"fill-with-every":p,f=e.locale,v=void 0===f?d:f,x=e.value,j=void 0===x?"":x,w=e.setValue,k=e.displayError,O=void 0===k||k,M=e.onError,N=e.className,F=e.defaultPeriod,T=e.allowEmpty,_=void 0===T?"for-default-value":T,V=e.humanizeLabels,I=void 0===V||V,H=e.humanizeValue,W=void 0!==H&&H,L=e.disabled,R=void 0!==L&&L,U=e.readOnly,J=void 0!==U&&U,z=e.leadingZero,Z=void 0!==z&&z,B=e.shortcuts,Y=void 0===B?["@yearly","@annually","@monthly","@weekly","@daily","@midnight","@hourly"]:B,G=e.clockFormat,$=e.periodicityOnDoubleClick,q=void 0===$||$,K=e.mode,Q=void 0===K?"multiple":K,X=e.allowedDropdowns,ee=void 0===X?["period","months","month-days","week-days","hours","minutes"]:X,en=e.allowedPeriods,et=(0,a.useRef)(j),er=(0,a.useRef)(void 0===F?"day":F),eo=(0,a.useState)(),ea=eo[0],ei=eo[1],ec=(0,a.useState)(),el=ec[0],es=ec[1],eu=(0,a.useState)(),ed=eu[0],ep=eu[1],em=(0,a.useState)(),ef=em[0],eh=em[1],ey=(0,a.useState)(),ev=ey[0],eg=ey[1],eb=(0,a.useState)(),ex=eb[0],ej=eb[1],ew=(0,a.useState)(!1),ek=ew[0],eO=ew[1],eM=(0,a.useState)(!1),eN=eM[0],eD=eM[1],eS=(n=(0,a.useRef)(eN),(0,a.useEffect)(function(){n.current=eN},[eN]),n.current),eC=JSON.stringify(v);(0,a.useEffect)(function(){g(j,eO,M,_,et,!0,v,Y,ej,eg,es,ep,eh,ei)},[]),(0,a.useEffect)(function(){j!==et.current&&g(j,eO,M,_,et,!1,v,Y,ej,eg,es,ep,eh,ei)},[j,et,eC,_,Y]),(0,a.useEffect)(function(){if(!(ea||ex||ed||el||ef||ev)||eN||eS)eN&&eD(!1);else{var e=ea||er.current,n=b(e,ed,el,ef,ev,ex,W);w(n,{selectedPeriod:e}),et.current=n,M&&M(void 0),eO(!1)}},[ea,el,ed,ef,ev,ex,W,eN]);var eA=(0,a.useCallback)(function(){es(void 0),ep(void 0),eh(void 0),eg(void 0),ej(void 0);var e="",n="reboot"!==ea&&ea?ea:er.current;n!==ea&&ei(n),"fill-with-every"===m&&(e=b(n,void 0,void 0,void 0,void 0,void 0)),w(e,{selectedPeriod:n}),et.current=e,eD(!0),"never"===_&&"empty"===m?(eO(!0),y(M,v)):(M&&M(void 0),eO(!1))},[ea,w,M,m]),eE=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron":!0,"react-js-cron-error":ek&&O,"react-js-cron-disabled":R,"react-js-cron-read-only":J})["".concat(N)]=!!N,e["".concat(N,"-error")]=ek&&O&&!!N,e["".concat(N,"-disabled")]=R&&!!N,e["".concat(N,"-read-only")]=J&&!!N,e))},[N,ek,O,R,J]),eP=u.className,eF=c(u,["className"]),eT=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-clear-button":!0})["".concat(N,"-clear-button")]=!!N,e["".concat(eP)]=!!eP,e))},[N,eP]),e_=JSON.stringify(eF),eV=(0,a.useMemo)(function(){return l&&!J?(0,r.jsx)(o.Button,i({className:eT,danger:!0,type:"primary",disabled:R},eF,{onClick:eA},{children:v.clearButtonText||d.clearButtonText})):null},[l,J,eC,eT,R,e_,eA]),eI=ea||er.current;return(0,r.jsxs)("div",i({className:eE},{children:[ee.includes("period")&&(0,r.jsx)(E,{value:eI,setValue:ei,locale:v,className:N,disabled:R,readOnly:J,shortcuts:Y,allowedPeriods:void 0===en?["year","month","week","day","hour","minute","reboot"]:en}),"reboot"===eI?eV:(0,r.jsxs)(r.Fragment,{children:["year"===eI&&ee.includes("months")&&(0,r.jsx)(A,{value:ed,setValue:ep,locale:v,className:N,humanizeLabels:I,disabled:R,readOnly:J,period:eI,periodicityOnDoubleClick:q,mode:Q}),("year"===eI||"month"===eI)&&ee.includes("month-days")&&(0,r.jsx)(C,{value:el,setValue:es,locale:v,className:N,weekDays:ef,disabled:R,readOnly:J,leadingZero:Z,period:eI,periodicityOnDoubleClick:q,mode:Q}),("year"===eI||"month"===eI||"week"===eI)&&ee.includes("week-days")&&(0,r.jsx)(P,{value:ef,setValue:eh,locale:v,className:N,humanizeLabels:I,monthDays:el,disabled:R,readOnly:J,period:eI,periodicityOnDoubleClick:q,mode:Q}),(0,r.jsxs)("div",{children:["minute"!==eI&&"hour"!==eI&&ee.includes("hours")&&(0,r.jsx)(D,{value:ev,setValue:eg,locale:v,className:N,disabled:R,readOnly:J,leadingZero:Z,clockFormat:G,period:eI,periodicityOnDoubleClick:q,mode:Q}),"minute"!==eI&&ee.includes("minutes")&&(0,r.jsx)(S,{value:ex,setValue:ej,locale:v,period:eI,className:N,disabled:R,readOnly:J,leadingZero:Z,clockFormat:G,periodicityOnDoubleClick:q,mode:Q}),eV]})]})]}))}Object.freeze({__proto__:null,setValuesFromCronString:g,getCronStringFromValues:b,partToString:x,formatValue:j,parsePartArray:w})},9245:function(e,n,t){var r=t(9155),o=Symbol.for("react.element"),a=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,c=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function s(e,n,t){var r,a={},s=null,u=null;for(r in void 0!==t&&(s=""+t),void 0!==n.key&&(s=""+n.key),void 0!==n.ref&&(u=n.ref),n)i.call(n,r)&&!l.hasOwnProperty(r)&&(a[r]=n[r]);if(e&&e.defaultProps)for(r in n=e.defaultProps)void 0===a[r]&&(a[r]=n[r]);return{$$typeof:o,type:e,key:s,ref:u,props:a,_owner:c.current}}n.Fragment=a,n.jsx=s,n.jsxs=s},2295:function(e,n,t){e.exports=t(9245)},4693:function(e,n,t){var r=t(4673),o=t.n(r),a=t(8598),i=t.n(a),c=t(9262),l=t.n(c),s=t(8657),u=t.n(s),d=t(1357),p=t.n(d),m=t(1626),f=t.n(m),h=t(3253),y={};y.styleTagTransform=f(),y.setAttributes=u(),y.insert=l().bind(null,"head"),y.domAPI=i(),y.insertStyleElement=p(),o()(h.A,y),h.A&&h.A.locals&&h.A.locals},4673:function(e){var n=[];function t(e){for(var t=-1,r=0;r<n.length;r++)if(n[r].identifier===e){t=r;break}return t}function r(e,r){for(var o={},a=[],i=0;i<e.length;i++){var c=e[i],l=r.base?c[0]+r.base:c[0],s=o[l]||0,u="".concat(l," ").concat(s);o[l]=s+1;var d=t(u),p={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==d)n[d].references++,n[d].updater(p);else{var m=function(e,n){var t=n.domAPI(n);return t.update(e),function(n){n?(n.css!==e.css||n.media!==e.media||n.sourceMap!==e.sourceMap||n.supports!==e.supports||n.layer!==e.layer)&&t.update(e=n):t.remove()}}(p,r);r.byIndex=i,n.splice(i,0,{identifier:u,updater:m,references:1})}a.push(u)}return a}e.exports=function(e,o){var a=r(e=e||[],o=o||{});return function(e){e=e||[];for(var i=0;i<a.length;i++){var c=t(a[i]);n[c].references--}for(var l=r(e,o),s=0;s<a.length;s++){var u=t(a[s]);0===n[u].references&&(n[u].updater(),n.splice(u,1))}a=l}}},9262:function(e){var n={};e.exports=function(e,t){var r=function(e){if(void 0===n[e]){var t=document.querySelector(e);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}n[e]=t}return n[e]}(e);if(!r)throw Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(t)}},1357:function(e){e.exports=function(e){var n=document.createElement("style");return e.setAttributes(n,e.attributes),e.insert(n,e.options),n}},8657:function(e,n,t){e.exports=function(e){var n=t.nc;n&&e.setAttribute("nonce",n)}},8598:function(e){e.exports=function(e){if("u"<typeof document)return{update:function(){},remove:function(){}};var n=e.insertStyleElement(e);return{update:function(t){var r,o,a;r="",t.supports&&(r+="@supports (".concat(t.supports,") {")),t.media&&(r+="@media ".concat(t.media," {")),(o=void 0!==t.layer)&&(r+="@layer".concat(t.layer.length>0?" ".concat(t.layer):""," {")),r+=t.css,o&&(r+="}"),t.media&&(r+="}"),t.supports&&(r+="}"),(a=t.sourceMap)&&"u">typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleTagTransform(r,n,e.options)},remove:function(){var e;null===(e=n).parentNode||e.parentNode.removeChild(e)}}}},1626:function(e){e.exports=function(e,n){if(n.styleSheet)n.styleSheet.cssText=e;else{for(;n.firstChild;)n.removeChild(n.firstChild);n.appendChild(document.createTextNode(e))}}}}]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_workflow_client_v2=self.webpackChunk_nocobase_plugin_workflow_client_v2||[]).push([["382"],{8765:function(e,r,n){n.r(r),n.d(r,{TriggerCollectionConfig:function(){return i}});var o=n(2059),t=n(9155),l=n.n(t),a=n(7806),c=n(9488);function i(){var e=(0,c.kj)();return l().createElement(o.Form.Item,{name:"data",label:e("Trigger data"),extra:e("Choose a record or primary key of a record in the collection to trigger."),rules:[{required:!0}]},l().createElement(a.g4,null))}r.default=i}}]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_workflow_client_v2=self.webpackChunk_nocobase_plugin_workflow_client_v2||[]).push([["387"],{2034:function(e,t,n){n.d(t,{i:function(){return O}});var r=n(9155),l=n.n(r),o=n(2059),a=n(7375),i=n(5477),c=n(7694),u=n(5980),s=n(9651),d=n(2235),f=n(3052),m=n(9488),p=n(4759),v=n(2625),g=n(3485),y=n(2404);function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function w(e){var t,n,r,i=e.triggerTitle,c=(0,m.kj)(),s=null!=(n=(0,d.$K)())?n:{},f=s.execution,p=s.workflow,v=function(e){if(Array.isArray(e))return e}(t=l().useState(!1))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var l=[],o=!0,a=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(l.push(t.value),2!==l.length);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(a)throw n}}return l}}(t)||function(e){if(e){if("string"==typeof e)return b(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return b(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),g=v[0],w=v[1],E=(0,u.A)().styles;return f?l().createElement(l().Fragment,null,l().createElement(o.Tooltip,{title:c("View result")},l().createElement(o.Button,{type:"primary",shape:"circle",size:"small",icon:l().createElement(a.InfoOutlined,null),className:E.nodeJobButtonClass,onClick:function(e){e.stopPropagation(),w(!0)},onMouseDown:function(e){return e.stopPropagation()}})),l().createElement(o.Modal,{open:g,onCancel:function(){return w(!1)},width:980,footer:null,title:l().createElement("div",{className:E.nodeTitleClass},l().createElement(o.Tag,null,i),l().createElement("strong",null,null==p?void 0:p.title)),destroyOnClose:!0,modalRender:function(e){return l().createElement("div",{onClick:function(e){return e.stopPropagation()},onMouseDown:function(e){return e.stopPropagation()}},e)}},l().createElement("div",{style:{marginBottom:16}},l().createElement("div",{style:{fontWeight:500,marginBottom:8}},c("Triggered at"),":"),l().createElement("div",null,(0,y.fU)(null==f?void 0:f.createdAt))),l().createElement("div",{style:{fontWeight:500,marginBottom:8}},c("Trigger variables"),":"),l().createElement(o.Input.TextArea,{value:JSON.stringify(null!=(r=null==f?void 0:f.context)?r:null,null,2),disabled:!0,autoSize:{minRows:4,maxRows:20},className:E.nodeJobResultClass,style:{whiteSpace:"pre",fontFamily:"monospace",fontSize:"80%"}}))):null}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t,n,r,l,o,a){try{var i=e[o](a),c=i.value}catch(e){n(e);return}i.done?t(c):Promise.resolve(c).then(r,l)}function C(e){return function(){var t=this,n=arguments;return new Promise(function(r,l){var o=e.apply(t,n);function a(e){h(o,r,l,a,i,"next",e)}function i(e){h(o,r,l,a,i,"throw",e)}a(void 0)})}}function T(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,l=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=l){var o=[],a=!0,i=!1;try{for(l=l.call(e);!(a=(n=l.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){i=!0,r=e}finally{try{a||null==l.return||l.return()}finally{if(i)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return E(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(e,t){var n,r,l,o={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:c(0)}),i(a,"throw",{value:c(1)}),i(a,"return",{value:c(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function c(i){return function(c){var u=[i,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(l=2&u[0]?r.return:u[0]?r.throw||((l=r.return)&&l.call(r),0):r.next)&&!(l=l.call(r,u[1])).done)return l;switch(r=0,l&&(u=[2&u[0],l.value]),u[0]){case 0:case 1:l=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(l=(l=o.trys).length>0&&l[l.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!l||u[1]>l[0]&&u[1]<l[3])){o.label=u[1];break}if(6===u[0]&&o.label<l[1]){o.label=l[1],l=u;break}if(l&&o.label<l[2]){o.label=l[2],o.ops.push(u);break}l[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=l=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function S(e){var t=e.trigger,n=e.t,r=o.theme.useToken().token;return t.description?l().createElement("div",{style:{marginBottom:r.marginLG,padding:r.padding,backgroundColor:r.colorFillAlter}},l().createElement(o.Typography.Paragraph,null,l().createElement(o.Typography.Text,null,n("Trigger type")),l().createElement(o.Typography.Text,null,": "),l().createElement(o.Tag,{icon:l().createElement(a.ThunderboltOutlined,null)},n(t.title))),l().createElement(o.Typography.Paragraph,{type:"secondary"},n(t.description))):null}function A(e){var t,n=e.trigger,a=e.workflow,i=e.onSubmitted,u=(0,c.useFlowContext)(),s=(0,m.kj)(),f=o.App.useApp().message,p=!!(null==a||null==(t=a.versionStats)?void 0:t.executed),y=T(o.Form.useForm(),1)[0],b=T((0,r.useState)(!1),2),w=b[0],E=b[1],h=(0,r.useMemo)(function(){return(null==n?void 0:n.FieldsetLoader)?(0,r.lazy)(n.FieldsetLoader):null},[n]),A=(0,r.useMemo)(function(){var e;return{config:null!=(e=a.config)?e:{}}},[a.config]);(0,r.useEffect)(function(){y.setFieldsValue(A)},[y,A]);var x=(0,v.useMemoizedFn)(function(){return C(function(){var e,t,n;return k(this,function(r){switch(r.label){case 0:return[4,y.validateFields()];case 1:e=r.sent(),E(!0),r.label=2;case 2:return r.trys.push([2,4,5,6]),[4,u.api.resource("workflows").update({filterByTk:a.id,values:{config:null!=(t=e.config)?t:{}}})];case 3:return r.sent(),null==i||i(),[3,6];case 4:throw n=r.sent(),f.error(s("Failed to save trigger")),console.error(n),n;case 5:return E(!1),[7];case 6:return[2]}})})()});return l().createElement(d.AA.Provider,{value:a},l().createElement(g.DrawerFormLayout,{title:s("Trigger"),onSubmit:x,submitting:w,submitText:s("Submit"),cancelText:s("Cancel"),footer:p?l().createElement("span",null):void 0},l().createElement(o.Form,{form:y,layout:"vertical",disabled:p},n?l().createElement(S,{trigger:n,t:s}):null,h?l().createElement(r.Suspense,{fallback:l().createElement(o.Skeleton,{active:!0,paragraph:{rows:4}})},l().createElement(h,null)):l().createElement(o.Typography.Paragraph,{type:"secondary"},n?s("This trigger's configuration has not been migrated to the new canvas yet."):s("This trigger type is not available in the new canvas yet.")))))}function x(){var e,t,n=(0,c.useFlowContext)(),i=(0,m.kj)(),s=(0,u.A)(),f=s.styles,g=s.cx,y=null!=(e=(0,d.$K)())?e:{},b=y.workflow,E=y.refresh,h=!!(0,d.S8)(),S=n.app.pm.get(p.q),x=(null==b?void 0:b.type)?S.getTriggerOptions(b.type):void 0,N=x?i(x.title):null!=(t=null==b?void 0:b.type)?t:i("Unknown trigger"),R=T((0,r.useState)(""),2),O=R[0],_=R[1];(0,r.useEffect)(function(){var e,t;_(null!=(e=null!=(t=null==b?void 0:b.triggerTitle)?t:null==b?void 0:b.title)?e:N)},[N,null==b?void 0:b.title,null==b?void 0:b.triggerTitle]);var I=(0,v.useMemoizedFn)(function(e){return C(function(){var t;return k(this,function(r){switch(r.label){case 0:if(!(null==b?void 0:b.id)||(_(t=e||N),t===b.triggerTitle))return[2];return[4,n.api.resource("workflows").update({filterByTk:b.id,values:{triggerTitle:t}})];case 1:return r.sent(),null==E||E(),[2]}})})()}),F=(0,v.useMemoizedFn)(function(){if(null==b?void 0:b.id){var e;(e={ctx:n,trigger:x,workflow:b,refresh:E}).ctx.viewer.drawer({width:"50%",closable:!0,content:function(){return l().createElement(A,{trigger:e.trigger,workflow:e.workflow,onSubmitted:e.refresh})}})}});if(!b)return null;var j=i("Trigger");return l().createElement("div",{className:f.nodeClass,role:"button","aria-label":"".concat(j,"-").concat(O),onClick:function(e){if(e.currentTarget.contains(e.target)){var t,n,r;n=t=e.target,(null!=(r=HTMLElement)&&"u">typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](n):n instanceof r)&&t.closest("textarea, input, button, a, .ant-dropdown, .workflow-node-actions, .ant-modal")||F()}}},l().createElement("div",{className:g(f.nodeCardClass,{invalid:!x})},l().createElement("div",{className:f.nodeHeaderClass},l().createElement("div",{className:g(f.nodeMetaClass,"workflow-node-meta")},l().createElement(o.Tooltip,{title:(null==x?void 0:x.description)?i(x.description):void 0},l().createElement(o.Tag,{color:x?"gold":"error",icon:l().createElement(a.ThunderboltOutlined,null)},l().createElement("span",{className:"type"},N)))),l().createElement("div",{className:"workflow-node-actions"},l().createElement(w,{triggerTitle:N}))),l().createElement("div",{className:"workflow-node-title"},l().createElement(o.Input.TextArea,{value:O,onChange:function(e){return _(e.target.value)},onBlur:function(e){return C(function(){return k(this,function(t){switch(t.label){case 0:return[4,I(e.target.value)];case 1:return t.sent(),[2]}})})()},autoSize:!0,disabled:h,"aria-label":i("Trigger title")}))))}function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function R(){var e,t=(0,u.A)().styles,n=(0,m.kj)(),r=(0,c.useFlowEngine)(),i=(0,f.x)(),s=null==i?void 0:i.clipboard;if(!s)return null;var d=r.context.app.pm.get(p.q),v=null==d?void 0:d.getInstruction(s.type),g=v?n(v.title):s.type;return l().createElement("div",{className:t.clipboardPreviewClass},l().createElement("div",{className:"workflow-clipboard-header"},l().createElement("span",null,n("Copied node")),l().createElement(o.Button,{type:"text",size:"small",icon:l().createElement(a.CloseOutlined,null),onClick:function(){return null==i?void 0:i.clearClipboard()}})),l().createElement("div",{className:"workflow-clipboard-card"},l().createElement("div",{className:"workflow-clipboard-type"},g),l().createElement("div",{className:"workflow-clipboard-title"},null!=(e=s.title)?e:s.type)))}function O(e){var t,n,a=e.entry,c=(0,u.A)(),f=c.styles,p=c.cx,v=(0,m.kj)(),g=(0,d.S8)();(null!=(n=(0,d.$K)())?n:{}).workflow;var y=function(e){if(Array.isArray(e))return e}(t=(0,r.useState)(100))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var l=[],o=!0,a=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(l.push(t.value),2!==l.length);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(a)throw n}}return l}}(t)||function(e){if(e){if("string"==typeof e)return N(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return N(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),b=y[0],w=y[1];return l().createElement("div",{className:p(f.workflowPageClass,(0,i.css)({height:"100%"}))},l().createElement("div",{className:"workflow-canvas-wrapper"},l().createElement("div",{className:"workflow-canvas",style:{zoom:b/100}},l().createElement("div",{className:p(f.branchBlockClass,(0,i.css)({marginTop:"0 !important"}))},l().createElement("div",{className:f.branchClass},g?l().createElement(o.Alert,{type:"warning",showIcon:!0,message:v("Executed workflow cannot be modified. Could be copied to a new version to modify."),style:{marginBottom:"1em"}}):null,l().createElement(x,null),l().createElement("div",{className:p(f.branchBlockClass,(0,i.css)({marginTop:"0 !important"}))},l().createElement(s.l,{entry:a})),l().createElement("div",{className:f.terminalClass},v("End"))))),l().createElement(R,null),l().createElement("div",{className:"workflow-canvas-zoomer"},l().createElement(o.Slider,{vertical:!0,reverse:!0,defaultValue:100,step:10,min:10,value:b,onChange:w}))))}},8761:function(e,t,n){n.d(t,{K:function(){return r}});function r(e){var t=new Map;e.forEach(function(e){return t.set(e.id,e)});var n=!0,r=!1,l=void 0;try{for(var o,a=t.values()[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var i=o.value;i.upstreamId&&(i.upstream=t.get(i.upstreamId)),i.downstreamId&&(i.downstream=t.get(i.downstreamId))}}catch(e){r=!0,l=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw l}}}},7001:function(e,t,n){n.d(t,{TD:function(){return a}});var r=n(2625),l=n(8401);function o(){return"u">typeof window&&"string"==typeof window.__nocobase_modern_client_prefix__&&window.__nocobase_modern_client_prefix__.trim().length>0}function a(){var e=(0,r.useMemoizedFn)(function(e){return o()?(0,l.JG)(e):"/admin/settings/workflow/workflows/".concat(e)}),t=(0,r.useMemoizedFn)(function(e){return o()?(0,l.Pq)(e):"/admin/settings/workflow/executions/".concat(e)});return{isV2Runtime:o(),getWorkflowCanvasPath:e,getWorkflowExecutionPath:t}}},9239:function(e,t,n){n.d(t,{GO:function(){return o},QQ:function(){return c},hi:function(){return a},m2:function(){return i}});var r=n(358);function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o={QUEUEING:null,STARTED:0,RESOLVED:1,FAILED:-1,ERROR:-2,ABORTED:-3,CANCELED:-4,REJECTED:-5,RETRY_NEEDED:-6},a=[{value:o.QUEUEING,label:'{{t("Queueing", { ns: "'.concat(r.C,'" })}}'),color:"blue",description:'{{t("Triggered but still waiting in queue to execute.", { ns: "'.concat(r.C,'" })}}')},{value:o.STARTED,label:'{{t("On going", { ns: "'.concat(r.C,'" })}}'),color:"gold",description:'{{t("Started and executing, maybe waiting for an async callback (manual, delay etc.).", { ns: "'.concat(r.C,'" })}}')},{value:o.RESOLVED,label:'{{t("Resolved", { ns: "'.concat(r.C,'" })}}'),color:"green",description:'{{t("Successfully finished.", { ns: "'.concat(r.C,'" })}}')},{value:o.FAILED,label:'{{t("Failed", { ns: "'.concat(r.C,'" })}}'),color:"red",description:'{{t("Failed to satisfy node configurations.", { ns: "'.concat(r.C,'" })}}')},{value:o.ERROR,label:'{{t("Error", { ns: "'.concat(r.C,'" })}}'),color:"red",description:'{{t("Some node meets error.", { ns: "'.concat(r.C,'" })}}')},{value:o.ABORTED,label:'{{t("Aborted", { ns: "'.concat(r.C,'" })}}'),color:"red",description:'{{t("Running of some node was aborted by program flow.", { ns: "'.concat(r.C,'" })}}')},{value:o.CANCELED,label:'{{t("Canceled", { ns: "'.concat(r.C,'" })}}'),color:"volcano",description:'{{t("Manually canceled whole execution when waiting.", { ns: "'.concat(r.C,'" })}}')},{value:o.REJECTED,label:'{{t("Rejected", { ns: "'.concat(r.C,'" })}}'),color:"volcano",description:'{{t("Rejected from a manual node.", { ns: "'.concat(r.C,'" })}}')},{value:o.RETRY_NEEDED,label:'{{t("Retry needed", { ns: "'.concat(r.C,'" })}}'),color:"volcano",description:'{{t("General failed but should do another try.", { ns: "'.concat(r.C,'" })}}')}],i=a.reduce(function(e,t){return Object.assign(e,l({},t.value,t))},{}),c=[{value:r.K.TIMEOUT,label:'{{t("Timed out", { ns: "'.concat(r.C,'" })}}')},{value:r.K.MANUAL_CANCEL,label:'{{t("Canceled manually", { ns: "'.concat(r.C,'" })}}')},{value:r.K.PARENT_ABORTED,label:'{{t("Aborted with parent execution", { ns: "'.concat(r.C,'" })}}')}].reduce(function(e,t){return Object.assign(e,l({},t.value,t))},{})}}]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_workflow_client_v2=self.webpackChunk_nocobase_plugin_workflow_client_v2||[]).push([["394"],{4137:function(e,l,n){n.r(l),n.d(l,{TriggerScheduleConfig:function(){return m}});var t=n(2059),r=n(9185),a=n.n(r),i=n(9155),o=n.n(i),u=n(2235),c=n(7806),d=n(9488),h=n(4869),v=n(1993);function f(e){var l=e.value,n=e.onChange,r=e.placeholder;return o().createElement(t.DatePicker,{showTime:!0,value:l?a()(l):null,placeholder:r,style:{width:"100%"},onChange:function(e){return null==n?void 0:n(e?e.toDate():null)}})}function m(){var e,l=(0,u.Zt)(),n=(0,d.kj)();if((null==l||null==(e=l.config)?void 0:e.mode)===v.a.DATE_FIELD){var r=h.th[v.a.DATE_FIELD].data;return o().createElement(t.Form.Item,{name:"data",label:n(r.title),extra:r.description?n(r.description):void 0,rules:r.required?[{required:!0}]:void 0},o().createElement(c.g4,null))}var a=h.th[v.a.STATIC].date;return o().createElement(t.Form.Item,{name:"date",label:n(a.title),initialValue:new Date,rules:a.required?[{required:!0}]:void 0},o().createElement(f,{placeholder:a.placeholder?n(a.placeholder):void 0}))}l.default=m}}]);
|