|
13 | 13 | let isValid: boolean | null = null;
|
14 | 14 | const steps: StepsConfiguration = {};
|
15 | 15 | const validator: ValidatorConfiguration = {
|
16 |
| - step: (step) => step.name.length > 0 |
| 16 | + step: step => step.name.length > 0 |
17 | 17 | };
|
18 | 18 | const toolbox: ToolboxConfiguration = {
|
19 | 19 | groups: [
|
|
25 | 25 | };
|
26 | 26 |
|
27 | 27 | function randId() {
|
28 |
| - return Math.round((Math.random() * 1000000)).toString(16); |
| 28 | + return Math.round(Math.random() * 1000000).toString(16); |
29 | 29 | }
|
30 | 30 |
|
31 | 31 | function createStep() {
|
|
37 | 37 | properties: {
|
38 | 38 | comment: 'Some comment'
|
39 | 39 | }
|
40 |
| - } |
| 40 | + }; |
41 | 41 | }
|
42 | 42 |
|
43 | 43 | function createDefinition(): Definition {
|
44 | 44 | return {
|
45 | 45 | properties: {
|
46 | 46 | velocity: 20
|
47 | 47 | },
|
48 |
| - sequence: [ |
49 |
| - createStep(), |
50 |
| - createStep() |
51 |
| - ] |
| 48 | + sequence: [createStep(), createStep()] |
52 | 49 | };
|
53 | 50 | }
|
54 | 51 |
|
55 |
| - function onDefinitionChanged({ detail }: { detail: { definition: Definition, isValid: boolean } }) { |
| 52 | + function onDefinitionChanged({ detail }: { detail: { definition: Definition; isValid: boolean } }) { |
56 | 53 | definition = detail.definition;
|
57 | 54 | isValid = detail.isValid;
|
58 | 55 | }
|
|
95 | 92 | </script>
|
96 | 93 |
|
97 | 94 | <SequentialWorkflowDesigner
|
98 |
| - definition={definition} |
| 95 | + {definition} |
99 | 96 | on:definitionChanged={onDefinitionChanged}
|
100 |
| - steps={steps} |
101 |
| - validator={validator} |
102 |
| - toolbox={toolbox} |
| 97 | + {steps} |
| 98 | + {validator} |
| 99 | + {toolbox} |
103 | 100 | stepEditor={StepEditor}
|
104 | 101 | rootEditor={RootEditor}
|
105 |
| - selectedStepId={selectedStepId} |
| 102 | + {selectedStepId} |
106 | 103 | on:selectedStepIdChanged={onSelectedStepIdChanged}
|
107 |
| - isToolboxCollapsed={isToolboxCollapsed} |
| 104 | + {isToolboxCollapsed} |
108 | 105 | on:isToolboxCollapsedChanged={onIsToolboxCollapsedChanged}
|
109 |
| - isEditorCollapsed={isEditorCollapsed} |
| 106 | + {isEditorCollapsed} |
110 | 107 | on:isEditorCollapsedChanged={onIsEditorCollapsedChanged}
|
111 |
| - isReadonly={isReadonly} /> |
| 108 | + {isReadonly} |
| 109 | +/> |
112 | 110 |
|
113 | 111 | <div class="block">
|
114 | 112 | <button on:click={toggleReadonly}>{isReadonly ? 'Enable editing' : 'Disable editing'}</button>
|
|
123 | 121 | </div>
|
124 | 122 |
|
125 | 123 | <div class="block">
|
126 |
| - Is valid: <strong>{isValid}</strong> |
127 |
| - Selected step: <strong>{selectedStepId}</strong> |
| 124 | + Is valid: <strong>{isValid}</strong> Selected step: <strong>{selectedStepId}</strong> |
128 | 125 | </div>
|
129 | 126 |
|
130 | 127 | <div class="block">
|
131 |
| - This demo uses Svelte and <a href="https://github.com/nocode-js/sequential-workflow-designer/tree/main/svelte">Sequential Workflow Designer for Svelte</a>. |
| 128 | + This demo uses Svelte and <a href="https://github.com/nocode-js/sequential-workflow-designer/tree/main/svelte" |
| 129 | + >Sequential Workflow Designer for Svelte</a |
| 130 | + >. |
132 | 131 | </div>
|
0 commit comments