forked from PlanQK/workflow-modeler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
HiddenFieldEntry.js
82 lines (80 loc) · 2.27 KB
/
HiddenFieldEntry.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import { TextFieldEntry, SelectEntry } from "@bpmn-io/properties-panel";
import React from "@bpmn-io/properties-panel/preact/compat";
/**
* Entry which can be used in a properties group of the properties panel. Allows the definition of a TextFieldEntry
* which can be hidden if needed. Can be used to create a group with a dynamically changing set of entries based on the
* values of the entries.
*
* @param id Id of the entry
* @param element The element the properties are displayed for
* @param label The label of the entry
* @param getValue callback to get the value represented by this entry.
* @param setValue callback to set the value represented by this entry.
* @param debounce Debounce module of the bpmn-js modeler.
* @param hidden lean flag defining if the entry is hidden or visible.
* @return {JSX.Element}
* @constructor
*/
export function HiddenTextFieldEntry({
id,
element,
label,
getValue,
setValue,
debounce,
hidden,
}) {
return (
<>
{!hidden() && (
<TextFieldEntry
id={id}
element={element}
label={label}
getValue={getValue}
setValue={setValue}
debounce={debounce}
/>
)}
</>
);
}
/**
* Entry which can be used in a properties group of the properties panel. Allows the definition of a TextFieldEntry
* which can be hidden if needed. Can be used to create a group with a dynamically changing set of entries based on the
* values of the entries.
*
* @param id Id of the entry
* @param element The element the properties are displayed for
* @param label The label of the entry
* @param getValue callback to get the value represented by this entry.
* @param setValue callback to set the value represented by this entry.
* @param debounce Debounce module of the bpmn-js modeler.
* @param hidden lean flag defining if the entry is hidden or visible.
* @return {JSX.Element}
* @constructor
*/
export function HiddenSelectEntry({
id,
label,
getValue,
setValue,
getOptions,
debounce,
hidden,
}) {
return (
<>
{!hidden() && (
<SelectEntry
id={id}
label={label}
getValue={getValue}
getOptions={getOptions}
setValue={setValue}
debounce={debounce}
/>
)}
</>
);
}