ebta-workflow-prod 4.0.1 → 4.0.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ebta-workflow-prod",
3
3
  "private": false,
4
- "version": "4.0.1",
4
+ "version": "4.0.2",
5
5
  "description": "",
6
6
  "license": "UNLICENSED",
7
7
  "author": "",
@@ -0,0 +1,38 @@
1
+ import * as React from "react";
2
+ import { FormElementProps, FormElementRegistration } from "@vertigis/workflow";
3
+
4
+ /**
5
+ * The generic type argument provided to `FormElementProps<T>` controls the type
6
+ * of `props.value` and `props.setValue(value)`. If your element doesn't need a
7
+ * `value`, you can omit the type argument.
8
+ *
9
+ * You can also declare additional public properties of your element by adding
10
+ * properties to this interface. The properties will be managed by the Workflow
11
+ * runtime, and passed in as `props`. You can update the properties by using
12
+ * `props.setProperty(key, value)`.
13
+ */
14
+ interface SampleInputProps extends FormElementProps<string> {}
15
+
16
+ /**
17
+ * A Workflow element built using React.
18
+ * @displayName SampleInput
19
+ * @description sampleInput
20
+ * @param props The props that will be provided by the Workflow runtime.
21
+ */
22
+ function SampleInput(props: SampleInputProps): React.ReactElement {
23
+ const { setValue, value } = props;
24
+ return (
25
+ <input
26
+ onChange={(event) => setValue(event.currentTarget.value)}
27
+ value={value}
28
+ />
29
+ );
30
+ }
31
+
32
+ const SampleInputElementRegistration: FormElementRegistration<SampleInputProps> = {
33
+ component: SampleInput,
34
+ getInitialProperties: () => ({ value: "Hello World" }),
35
+ id: "SampleInput",
36
+ };
37
+
38
+ export default SampleInputElementRegistration;
package/src/index.ts CHANGED
@@ -39,3 +39,5 @@ export { default as GetTaskStatusActivity } from "./activities/GetTaskStatus";
39
39
  export { default as DrapGeometryActivity } from "./activities/DrapGeometry";
40
40
 
41
41
  export { default as SampleActivity } from "./activities/Sample";
42
+
43
+ export { default as SampleInputRegistration } from "./elements/SampleInput";