@ea-lab/reactive-json-docs 0.4.0 → 0.5.0
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 +2 -2
- package/public/rjbuild/docs/advanced-concepts/index.md +1 -0
- package/public/rjbuild/docs/advanced-concepts/index.yaml +1 -0
- package/public/rjbuild/docs/advanced-concepts/plugins/component-development.md +1 -1
- package/public/rjbuild/docs/advanced-concepts/plugins/component-development.yaml +1 -1
- package/public/rjbuild/docs/core/action/Hide.md +1 -1
- package/public/rjbuild/docs/core/action/Hide.yaml +10 -10
- package/public/rjbuild/docs/core/action/ReactOnEvent.md +12 -12
- package/public/rjbuild/docs/core/action/ReactOnEvent.yaml +61 -101
- package/public/rjbuild/docs/core/action/Redirect.md +10 -2
- package/public/rjbuild/docs/core/action/Redirect.yaml +18 -51
- package/public/rjbuild/docs/core/action/VisuallyHide.yaml +10 -12
- package/public/rjbuild/docs/core/action/index.md +19 -204
- package/public/rjbuild/docs/core/action/index.yaml +19 -264
- package/public/rjbuild/docs/core/element/form/DateField.md +1 -1
- package/public/rjbuild/docs/core/element/form/DateField.yaml +4 -4
- package/public/rjbuild/docs/core/element/form/SelectField.yaml +2 -2
- package/public/rjbuild/docs/core/example/website.yaml +10 -10
- package/public/rjbuild/docs/core/reaction/index.md +17 -229
- package/public/rjbuild/docs/core/reaction/index.yaml +14 -242
- package/public/rjbuild/docs/core/reaction/setData.md +1 -1
- package/public/rjbuild/docs/core/reaction/setData.yaml +1 -1
- package/public/rjbuild/docs/docs-components/index.md +0 -2
- package/public/rjbuild/docs/docs-components/index.yaml +0 -2
- package/public/rjbuild/docs/getting-started/actions.md +294 -0
- package/public/rjbuild/docs/getting-started/actions.yaml +403 -0
- package/public/rjbuild/docs/getting-started/index.md +30 -6
- package/public/rjbuild/docs/getting-started/index.yaml +20 -6
- package/public/rjbuild/docs/getting-started/reactions.md +301 -0
- package/public/rjbuild/docs/getting-started/reactions.yaml +300 -0
- package/public/rjbuild/docs/getting-started/rjbuild-structure.md +10 -4
- package/public/rjbuild/docs/getting-started/rjbuild-structure.yaml +10 -4
- package/public/rjbuild/docs/getting-started/{template.md → template-contexts-data-binding.md} +16 -12
- package/public/rjbuild/docs/getting-started/{template.yaml → template-contexts-data-binding.yaml} +28 -14
- /package/public/rjbuild/docs/{core/reaction → advanced-concepts}/forward-update.md +0 -0
- /package/public/rjbuild/docs/{core/reaction → advanced-concepts}/forward-update.yaml +0 -0
|
@@ -1,214 +1,29 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Actions
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> For an introduction to the actions system and detailed examples, see [Getting Started: Actions](../../getting-started/actions.md).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Actions in Reactive-JSON allow you to modify element behavior and appearance based on dynamic conditions. They are evaluated continuously based on data state and provide state-driven UI adaptation.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Available Action Components
|
|
8
8
|
|
|
9
|
-
###
|
|
9
|
+
### Visibility Control
|
|
10
|
+
- **[Hide](./Hide.md)**: Completely hides the element and its children
|
|
11
|
+
- **[VisuallyHide](./VisuallyHide.md)**: Visually hides the element while keeping it accessible to screen readers
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
content: "My content"
|
|
15
|
-
actions:
|
|
16
|
-
- what: hide # Action type
|
|
17
|
-
when: ~.my_condition # Condition to evaluate
|
|
18
|
-
is: true # Expected value
|
|
19
|
-
```
|
|
13
|
+
### User Interaction
|
|
14
|
+
- **[Tooltip](./Tooltip.md)**: Displays a tooltip on hover
|
|
15
|
+
- **[Popover](./Popover.md)**: Shows a more complex popover on click
|
|
20
16
|
|
|
21
|
-
|
|
17
|
+
### Navigation
|
|
18
|
+
- **[Redirect](./Redirect.md)**: Redirects to a specified URL
|
|
22
19
|
|
|
23
|
-
|
|
20
|
+
### Event Management
|
|
24
21
|
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
- **Conditional properties**: Define when the action should be executed (optional)
|
|
22
|
+
Those actions have a special handling in Reactive-JSON. The engine transparently load them
|
|
23
|
+
when the user requests a [reaction](../../getting-started/reactions.md) on a given element component.
|
|
28
24
|
|
|
29
|
-
|
|
25
|
+
As a user, you won't need to work with them directly.
|
|
30
26
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
- **[
|
|
34
|
-
- **[visuallyHide](VisuallyHide.md)**: Visually hides the element while keeping it accessible to screen readers
|
|
35
|
-
- **[tooltip](Tooltip.md)**: Displays a tooltip on hover
|
|
36
|
-
- **[popover](Popover.md)**: Shows a more complex popover on click
|
|
37
|
-
- **[redirect](Redirect.md)**: Redirects to a specified URL
|
|
38
|
-
|
|
39
|
-
For detailed documentation of each action, including properties and examples, see their respective documentation pages.
|
|
40
|
-
|
|
41
|
-
## Conditional Execution
|
|
42
|
-
|
|
43
|
-
Actions can be made conditional using various comparison operators. If no conditions are specified, the action will always execute.
|
|
44
|
-
|
|
45
|
-
### Basic Comparisons
|
|
46
|
-
- `is`: Value equals exactly
|
|
47
|
-
- `isNot`: Value is different from
|
|
48
|
-
|
|
49
|
-
```yaml
|
|
50
|
-
actions:
|
|
51
|
-
- what: hide
|
|
52
|
-
when: ~.status
|
|
53
|
-
is: "inactive"
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### Empty Value Tests
|
|
57
|
-
- `isEmpty: true`: Value is empty (null, undefined, "", [], {})
|
|
58
|
-
- `isEmpty: "not"`: Value is not empty
|
|
59
|
-
|
|
60
|
-
```yaml
|
|
61
|
-
actions:
|
|
62
|
-
- what: hide
|
|
63
|
-
when: ~.user.name
|
|
64
|
-
isEmpty: true
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### Content Search
|
|
68
|
-
- `contains`: Contains a substring or element
|
|
69
|
-
- `containsNot`: Does not contain a substring or element
|
|
70
|
-
- `containedBy`: Value is contained within another value
|
|
71
|
-
- `containedByNot`: Value is not contained within another value
|
|
72
|
-
|
|
73
|
-
```yaml
|
|
74
|
-
actions:
|
|
75
|
-
- what: hide
|
|
76
|
-
when: ~.user.roles
|
|
77
|
-
contains: "admin"
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### Numeric and Date Comparisons
|
|
81
|
-
- `">"`: Greater than
|
|
82
|
-
- `"<"`: Less than
|
|
83
|
-
- `">="`: Greater than or equal to
|
|
84
|
-
- `"<="`: Less than or equal to
|
|
85
|
-
- `compareAsDates: true`: Compare values as dates
|
|
86
|
-
|
|
87
|
-
```yaml
|
|
88
|
-
actions:
|
|
89
|
-
- what: hide
|
|
90
|
-
when: ~.user.age
|
|
91
|
-
"<": 18
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
### Complex Conditions
|
|
95
|
-
- `andConditions`: All conditions must be true
|
|
96
|
-
- `orConditions`: At least one condition must be true
|
|
97
|
-
|
|
98
|
-
```yaml
|
|
99
|
-
actions:
|
|
100
|
-
- what: hide
|
|
101
|
-
andConditions:
|
|
102
|
-
- when: ~.user.role
|
|
103
|
-
is: "user"
|
|
104
|
-
- when: ~.feature_enabled
|
|
105
|
-
is: false
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
## Data Integration
|
|
109
|
-
|
|
110
|
-
Actions use Reactive-JSON's template system with the `~` operator to access data:
|
|
111
|
-
|
|
112
|
-
- `~.property`: Access a property from the data context
|
|
113
|
-
- `~.object.property`: Navigate through nested objects
|
|
114
|
-
- `~.array[0]`: Access array elements
|
|
115
|
-
|
|
116
|
-
The template system resolves these paths at runtime and provides the current values for condition evaluation.
|
|
117
|
-
|
|
118
|
-
## Execution Order and Behavior
|
|
119
|
-
|
|
120
|
-
1. **Sequential evaluation**: Actions are evaluated in the order they appear in the array
|
|
121
|
-
2. **Condition precedence**: Conditions are evaluated before action execution
|
|
122
|
-
3. **Early termination**: Some actions (like `hide`) prevent subsequent actions from executing
|
|
123
|
-
4. **Synchronous execution**: All condition evaluations and actions are synchronous
|
|
124
|
-
|
|
125
|
-
## Practical Examples
|
|
126
|
-
|
|
127
|
-
### Conditional Element Visibility
|
|
128
|
-
|
|
129
|
-
```yaml
|
|
130
|
-
renderView:
|
|
131
|
-
- type: div
|
|
132
|
-
content: "Admin-only section"
|
|
133
|
-
actions:
|
|
134
|
-
- what: hide
|
|
135
|
-
when: ~.user.role
|
|
136
|
-
isNot: "admin"
|
|
137
|
-
|
|
138
|
-
- type: button
|
|
139
|
-
content: "Advanced feature"
|
|
140
|
-
actions:
|
|
141
|
-
- what: hide
|
|
142
|
-
when: ~.user.permissions
|
|
143
|
-
containsNot: "advanced_actions"
|
|
144
|
-
|
|
145
|
-
data:
|
|
146
|
-
user:
|
|
147
|
-
role: "user"
|
|
148
|
-
permissions: ["read", "write"]
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### Contextual Help Interface
|
|
152
|
-
|
|
153
|
-
```yaml
|
|
154
|
-
renderView:
|
|
155
|
-
- type: label
|
|
156
|
-
content: "Username"
|
|
157
|
-
actions:
|
|
158
|
-
- what: tooltip
|
|
159
|
-
content: "Use only letters and numbers"
|
|
160
|
-
placement: "right"
|
|
161
|
-
|
|
162
|
-
- type: button
|
|
163
|
-
content: "More info"
|
|
164
|
-
actions:
|
|
165
|
-
- what: popover
|
|
166
|
-
title: "Detailed help"
|
|
167
|
-
content: "Complete instructions..."
|
|
168
|
-
placement: "top"
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
### Authentication Flow
|
|
172
|
-
|
|
173
|
-
```yaml
|
|
174
|
-
renderView:
|
|
175
|
-
- type: div
|
|
176
|
-
content: "Access denied"
|
|
177
|
-
actions:
|
|
178
|
-
- what: redirect
|
|
179
|
-
to: "/login"
|
|
180
|
-
when: ~.user.authenticated
|
|
181
|
-
is: false
|
|
182
|
-
|
|
183
|
-
- what: hide
|
|
184
|
-
when: ~.user.authenticated
|
|
185
|
-
is: true
|
|
186
|
-
|
|
187
|
-
data:
|
|
188
|
-
user:
|
|
189
|
-
authenticated: false
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
## Technical Limitations
|
|
193
|
-
|
|
194
|
-
1. **Execution order**: Actions are evaluated in definition order and cannot be reordered dynamically
|
|
195
|
-
2. **Hide behavior**: Once an element is hidden with the `hide` action, no subsequent actions execute
|
|
196
|
-
3. **Synchronous evaluation**: All conditions and actions are evaluated synchronously
|
|
197
|
-
4. **Data scope**: Actions can only access data from the current template context and global context
|
|
198
|
-
5. **No side effects**: Actions cannot directly modify global state or trigger reactions
|
|
199
|
-
6. **External dependencies**: Some actions (tooltip, popover) require React Bootstrap components
|
|
200
|
-
|
|
201
|
-
## Best Practices
|
|
202
|
-
|
|
203
|
-
1. **Keep conditions simple**: Avoid overly complex condition logic for better maintainability
|
|
204
|
-
2. **Consider performance**: Minimize frequently-evaluated complex conditions
|
|
205
|
-
3. **Use appropriate actions**: Choose `visuallyHide` over `hide` when content should remain accessible
|
|
206
|
-
4. **Test thoroughly**: Verify action behavior with different data states
|
|
207
|
-
5. **Document complex logic**: Add comments for non-obvious conditional logic
|
|
208
|
-
6. **Order matters**: Place critical actions (like `hide`) early in the action array when appropriate
|
|
209
|
-
|
|
210
|
-
## Related Documentation
|
|
211
|
-
|
|
212
|
-
- **Individual Action Documentation**: See the dedicated pages for each action type
|
|
213
|
-
- **[Reactions System](../reaction/index.md)**: Learn about handling user events and state changes
|
|
214
|
-
- **[Template System](../../template-system.md)**: Understand data binding and template expressions
|
|
27
|
+
- **[HashChangeListener](./HashChangeListener.md)**: Listens for URL hash changes
|
|
28
|
+
- **[MessageListener](./MessageListener.md)**: Listens for window messages
|
|
29
|
+
- **[ReactOnEvent](./ReactOnEvent.md)**: Reacts to custom events
|
|
@@ -1,278 +1,33 @@
|
|
|
1
1
|
renderView:
|
|
2
2
|
- type: Markdown
|
|
3
3
|
content: |
|
|
4
|
-
#
|
|
4
|
+
# Actions
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
> For an introduction to the actions system and detailed examples, see [Getting Started: Actions](../../getting-started/actions).
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Actions in Reactive-JSON allow you to modify element behavior and appearance based on dynamic conditions. They are evaluated continuously based on data state and provide state-driven UI adaptation.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## Available Action Components
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- type: Markdown
|
|
16
|
-
content: |
|
|
17
|
-
This example demonstrates the fundamental structure of actions in Reactive-JSON.
|
|
18
|
-
|
|
19
|
-
Actions are defined as an array on any element and consist of:
|
|
20
|
-
- `what`: The type of action to execute
|
|
21
|
-
- **Action-specific properties**: Vary depending on the action type
|
|
22
|
-
- **Conditional properties**: Define when the action should be executed (optional)
|
|
12
|
+
### Visibility Control
|
|
13
|
+
- **[Hide](./Hide)**: Completely hides the element and its children
|
|
14
|
+
- **[VisuallyHide](./VisuallyHide)**: Visually hides the element while keeping it accessible to screen readers
|
|
23
15
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
content: "Toggle visibility"
|
|
28
|
-
actions:
|
|
29
|
-
- what: setData
|
|
30
|
-
on: click
|
|
31
|
-
path: ~.my_condition
|
|
32
|
-
value: false
|
|
33
|
-
when: ~.my_condition
|
|
34
|
-
is: true
|
|
35
|
-
stopPropagation: true
|
|
36
|
-
- what: setData
|
|
37
|
-
on: click
|
|
38
|
-
path: ~.my_condition
|
|
39
|
-
value: true
|
|
40
|
-
when: ~.my_condition
|
|
41
|
-
is: false
|
|
42
|
-
stopPropagation: true
|
|
16
|
+
### User Interaction
|
|
17
|
+
- **[Tooltip](./Tooltip)**: Displays a tooltip on hover
|
|
18
|
+
- **[Popover](./Popover)**: Shows a more complex popover on click
|
|
43
19
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
attributes:
|
|
47
|
-
style:
|
|
48
|
-
padding: "10px"
|
|
49
|
-
border: "1px solid #ccc"
|
|
50
|
-
margin: "5px 0"
|
|
51
|
-
actions:
|
|
52
|
-
- what: hide # Action type
|
|
53
|
-
when: ~.my_condition # Condition to evaluate
|
|
54
|
-
is: true # Expected value
|
|
20
|
+
### Navigation
|
|
21
|
+
- **[Redirect](./Redirect)**: Redirects to a specified URL
|
|
55
22
|
|
|
56
|
-
|
|
57
|
-
my_condition: false
|
|
23
|
+
### Event Management
|
|
58
24
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
## Action Types
|
|
62
|
-
|
|
63
|
-
Reactive-JSON provides several built-in actions:
|
|
64
|
-
|
|
65
|
-
- **[hide](Hide)**: Completely hides the element and its children
|
|
66
|
-
- **[visuallyHide](VisuallyHide)**: Visually hides the element while keeping it accessible to screen readers
|
|
67
|
-
- **[tooltip](Tooltip)**: Displays a tooltip on hover
|
|
68
|
-
- **[popover](Popover)**: Shows a more complex popover on click
|
|
69
|
-
- **[redirect](Redirect)**: Redirects to a specified URL
|
|
70
|
-
|
|
71
|
-
For detailed documentation of each action, including properties and examples, see their respective documentation pages.
|
|
72
|
-
|
|
73
|
-
- type: RjBuildDescriber
|
|
74
|
-
title: "Basic Conditional Actions"
|
|
75
|
-
description:
|
|
76
|
-
- type: Markdown
|
|
77
|
-
content: |
|
|
78
|
-
This example shows simple conditional actions using `is` and `isEmpty` conditions.
|
|
79
|
-
|
|
80
|
-
toDescribe:
|
|
81
|
-
renderView:
|
|
82
|
-
- type: div
|
|
83
|
-
content:
|
|
84
|
-
- type: div
|
|
85
|
-
content: "This shows only when status is 'active'"
|
|
86
|
-
attributes:
|
|
87
|
-
style:
|
|
88
|
-
padding: "10px"
|
|
89
|
-
backgroundColor: "#e8f5e8"
|
|
90
|
-
margin: "5px 0"
|
|
91
|
-
actions:
|
|
92
|
-
- what: hide
|
|
93
|
-
when: ~.status
|
|
94
|
-
isNot: "active"
|
|
95
|
-
|
|
96
|
-
- type: div
|
|
97
|
-
content: "This shows only when text is not empty"
|
|
98
|
-
attributes:
|
|
99
|
-
style:
|
|
100
|
-
padding: "10px"
|
|
101
|
-
backgroundColor: "#f0f8ff"
|
|
102
|
-
margin: "5px 0"
|
|
103
|
-
actions:
|
|
104
|
-
- what: hide
|
|
105
|
-
when: ~.text_input
|
|
106
|
-
isEmpty: true
|
|
107
|
-
|
|
108
|
-
- type: div
|
|
109
|
-
content:
|
|
110
|
-
- type: label
|
|
111
|
-
content: "Status: "
|
|
112
|
-
- type: SelectField
|
|
113
|
-
dataLocation: ~.status
|
|
114
|
-
options:
|
|
115
|
-
- value: "inactive"
|
|
116
|
-
label: "Inactive"
|
|
117
|
-
- value: "active"
|
|
118
|
-
label: "Active"
|
|
119
|
-
|
|
120
|
-
- type: br
|
|
121
|
-
|
|
122
|
-
- type: label
|
|
123
|
-
content: "Text: "
|
|
124
|
-
- type: TextField
|
|
125
|
-
dataLocation: ~.text_input
|
|
126
|
-
placeholder: "Type something..."
|
|
127
|
-
|
|
128
|
-
data:
|
|
129
|
-
status: "inactive"
|
|
130
|
-
text_input: ""
|
|
131
|
-
|
|
132
|
-
- type: RjBuildDescriber
|
|
133
|
-
title: "Tooltip Action Example"
|
|
134
|
-
description:
|
|
135
|
-
- type: Markdown
|
|
136
|
-
content: |
|
|
137
|
-
This example demonstrates the tooltip action with conditional display.
|
|
138
|
-
|
|
139
|
-
toDescribe:
|
|
140
|
-
renderView:
|
|
141
|
-
- type: div
|
|
142
|
-
content:
|
|
143
|
-
- type: button
|
|
144
|
-
content: "Hover for help (when enabled)"
|
|
145
|
-
actions:
|
|
146
|
-
- what: tooltip
|
|
147
|
-
content: "This is a helpful tooltip!"
|
|
148
|
-
placement: "top"
|
|
149
|
-
when: ~.show_tooltips
|
|
150
|
-
is: true
|
|
151
|
-
|
|
152
|
-
- type: br
|
|
153
|
-
- type: br
|
|
154
|
-
|
|
155
|
-
- type: label
|
|
156
|
-
content:
|
|
157
|
-
- type: CheckBoxField
|
|
158
|
-
dataLocation: ~.show_tooltips
|
|
159
|
-
options:
|
|
160
|
-
- value: true
|
|
161
|
-
label: ""
|
|
162
|
-
- " Enable tooltips"
|
|
163
|
-
|
|
164
|
-
data:
|
|
165
|
-
show_tooltips: true
|
|
166
|
-
|
|
167
|
-
- type: RjBuildDescriber
|
|
168
|
-
title: "Practical Form Example"
|
|
169
|
-
description:
|
|
170
|
-
- type: Markdown
|
|
171
|
-
content: |
|
|
172
|
-
This example shows a simple form with conditional submit button and validation messages.
|
|
173
|
-
|
|
174
|
-
toDescribe:
|
|
175
|
-
renderView:
|
|
176
|
-
- type: div
|
|
177
|
-
content:
|
|
178
|
-
- type: h4
|
|
179
|
-
content: "Simple Contact Form"
|
|
180
|
-
|
|
181
|
-
- type: div
|
|
182
|
-
content:
|
|
183
|
-
- type: label
|
|
184
|
-
content: "Name: "
|
|
185
|
-
- type: TextField
|
|
186
|
-
dataLocation: ~.form.name
|
|
187
|
-
placeholder: "Enter your name"
|
|
188
|
-
|
|
189
|
-
- type: br
|
|
190
|
-
|
|
191
|
-
- type: div
|
|
192
|
-
content:
|
|
193
|
-
- type: label
|
|
194
|
-
content: "Email: "
|
|
195
|
-
- type: TextField
|
|
196
|
-
dataLocation: ~.form.email
|
|
197
|
-
inputType: "email"
|
|
198
|
-
placeholder: "Enter your email"
|
|
199
|
-
|
|
200
|
-
- type: br
|
|
201
|
-
|
|
202
|
-
- type: div
|
|
203
|
-
content: "Please fill in both fields"
|
|
204
|
-
attributes:
|
|
205
|
-
style:
|
|
206
|
-
color: "red"
|
|
207
|
-
fontSize: "14px"
|
|
208
|
-
actions:
|
|
209
|
-
- what: hide
|
|
210
|
-
andConditions:
|
|
211
|
-
- when: ~.form.name
|
|
212
|
-
isEmpty: not
|
|
213
|
-
- when: ~.form.email
|
|
214
|
-
isEmpty: not
|
|
215
|
-
|
|
216
|
-
- type: button
|
|
217
|
-
content: "Submit"
|
|
218
|
-
attributes:
|
|
219
|
-
style:
|
|
220
|
-
backgroundColor: "#4caf50"
|
|
221
|
-
color: "white"
|
|
222
|
-
border: "none"
|
|
223
|
-
padding: "8px 16px"
|
|
224
|
-
actions:
|
|
225
|
-
- what: hide
|
|
226
|
-
when: ~.form.name
|
|
227
|
-
isEmpty: true
|
|
228
|
-
- what: hide
|
|
229
|
-
when: ~.form.email
|
|
230
|
-
isEmpty: true
|
|
231
|
-
- what: setData
|
|
232
|
-
on: click
|
|
233
|
-
path: ~.submitted
|
|
234
|
-
value: true
|
|
235
|
-
|
|
236
|
-
- type: div
|
|
237
|
-
content: "✅ Form submitted successfully!"
|
|
238
|
-
attributes:
|
|
239
|
-
style:
|
|
240
|
-
color: "green"
|
|
241
|
-
marginTop: "10px"
|
|
242
|
-
fontWeight: "bold"
|
|
243
|
-
actions:
|
|
244
|
-
- what: hide
|
|
245
|
-
when: ~.submitted
|
|
246
|
-
isNot: true
|
|
247
|
-
|
|
248
|
-
data:
|
|
249
|
-
form:
|
|
250
|
-
name: ""
|
|
251
|
-
email: ""
|
|
252
|
-
submitted: false
|
|
253
|
-
|
|
254
|
-
- type: Markdown
|
|
255
|
-
content: |
|
|
256
|
-
## Technical Limitations
|
|
257
|
-
|
|
258
|
-
1. **Execution order**: Actions are evaluated in definition order and cannot be reordered dynamically
|
|
259
|
-
2. **Hide behavior**: Once an element is hidden with the `hide` action, no subsequent actions execute
|
|
260
|
-
3. **Synchronous evaluation**: All conditions and actions are evaluated synchronously
|
|
261
|
-
4. **Data scope**: Actions can only access data from the current template context and global context
|
|
262
|
-
5. **No side effects**: Actions cannot directly modify global state or trigger reactions
|
|
263
|
-
6. **External dependencies**: Some actions (tooltip, popover) require React Bootstrap components
|
|
264
|
-
|
|
265
|
-
## Best Practices
|
|
25
|
+
Those actions have a special handling in Reactive-JSON. The engine transparently load them
|
|
26
|
+
when the user requests a [reaction](../../getting-started/reactions) on a given element component.
|
|
266
27
|
|
|
267
|
-
|
|
268
|
-
2. **Consider performance**: Minimize frequently-evaluated complex conditions
|
|
269
|
-
3. **Use appropriate actions**: Choose `visuallyHide` over `hide` when content should remain accessible
|
|
270
|
-
4. **Test thoroughly**: Verify action behavior with different data states
|
|
271
|
-
5. **Document complex logic**: Add comments for non-obvious conditional logic
|
|
272
|
-
6. **Order matters**: Place critical actions (like `hide`) early in the action array when appropriate
|
|
28
|
+
As a user, you won't need to work with them directly.
|
|
273
29
|
|
|
274
|
-
|
|
30
|
+
- **[HashChangeListener](./HashChangeListener)**: Listens for URL hash changes
|
|
31
|
+
- **[MessageListener](./MessageListener)**: Listens for window messages
|
|
32
|
+
- **[ReactOnEvent](./ReactOnEvent)**: Reacts to custom events
|
|
275
33
|
|
|
276
|
-
- **Individual Action Documentation**: See the dedicated pages for each action type
|
|
277
|
-
- **[Reactions System](../reaction/index)**: Learn about handling user events and state changes
|
|
278
|
-
- **[Template System](../../template-system)**: Understand data binding and template expressions
|
|
@@ -124,13 +124,13 @@ renderView:
|
|
|
124
124
|
actions:
|
|
125
125
|
- what: hide
|
|
126
126
|
when: ~.startDate
|
|
127
|
-
|
|
127
|
+
isNotEmpty:
|
|
128
128
|
- what: hide
|
|
129
129
|
when: ~.endDate
|
|
130
|
-
|
|
130
|
+
isNotEmpty:
|
|
131
131
|
- what: hide
|
|
132
132
|
when: ~.reminderDate
|
|
133
|
-
|
|
133
|
+
isNotEmpty:
|
|
134
134
|
data:
|
|
135
135
|
startDate: null
|
|
136
136
|
endDate: null
|
|
@@ -176,7 +176,7 @@ renderView:
|
|
|
176
176
|
path: ~.message
|
|
177
177
|
value: "✓ Meeting date is set!"
|
|
178
178
|
when: ~.meetingDate
|
|
179
|
-
|
|
179
|
+
isNotEmpty:
|
|
180
180
|
- what: setData
|
|
181
181
|
on: click
|
|
182
182
|
path: ~.message
|
|
@@ -275,7 +275,7 @@ renderView:
|
|
|
275
275
|
actions:
|
|
276
276
|
- what: hide
|
|
277
277
|
when: ~.category
|
|
278
|
-
|
|
278
|
+
isNotEmpty:
|
|
279
279
|
- type: span
|
|
280
280
|
content: "✗ not empty"
|
|
281
281
|
attributes:
|
|
@@ -311,7 +311,7 @@ renderView:
|
|
|
311
311
|
actions:
|
|
312
312
|
- what: hide
|
|
313
313
|
when: ~.description
|
|
314
|
-
|
|
314
|
+
isNotEmpty:
|
|
315
315
|
- ")"
|
|
316
316
|
data:
|
|
317
317
|
category: ""
|
|
@@ -1252,11 +1252,11 @@ renderView:
|
|
|
1252
1252
|
- what: hide
|
|
1253
1253
|
andConditions:
|
|
1254
1254
|
- when: ~.contact_form.nom
|
|
1255
|
-
|
|
1255
|
+
isNotEmpty:
|
|
1256
1256
|
- when: ~.contact_form.email
|
|
1257
|
-
|
|
1257
|
+
isNotEmpty:
|
|
1258
1258
|
- when: ~.contact_form.sujet
|
|
1259
|
-
|
|
1259
|
+
isNotEmpty:
|
|
1260
1260
|
content: "Complétez tous les champs"
|
|
1261
1261
|
|
|
1262
1262
|
# Bouton Suivant actif
|
|
@@ -1289,11 +1289,11 @@ renderView:
|
|
|
1289
1289
|
value: 2
|
|
1290
1290
|
andConditions:
|
|
1291
1291
|
- when: ~.contact_form.nom
|
|
1292
|
-
|
|
1292
|
+
isNotEmpty:
|
|
1293
1293
|
- when: ~.contact_form.email
|
|
1294
|
-
|
|
1294
|
+
isNotEmpty:
|
|
1295
1295
|
- when: ~.contact_form.sujet
|
|
1296
|
-
|
|
1296
|
+
isNotEmpty:
|
|
1297
1297
|
content: "Suivant →"
|
|
1298
1298
|
|
|
1299
1299
|
# Boutons de navigation - ÉTAPE 2
|
|
@@ -1345,7 +1345,7 @@ renderView:
|
|
|
1345
1345
|
actions:
|
|
1346
1346
|
- what: hide
|
|
1347
1347
|
when: ~.contact_form.message
|
|
1348
|
-
|
|
1348
|
+
isNotEmpty:
|
|
1349
1349
|
content: "Veuillez saisir votre message"
|
|
1350
1350
|
|
|
1351
1351
|
# Bouton Envoyer actif
|
|
@@ -1371,19 +1371,19 @@ renderView:
|
|
|
1371
1371
|
path: ~.show_contact_modal
|
|
1372
1372
|
value: false
|
|
1373
1373
|
when: ~.contact_form.message
|
|
1374
|
-
|
|
1374
|
+
isNotEmpty:
|
|
1375
1375
|
- what: setData
|
|
1376
1376
|
on: click
|
|
1377
1377
|
path: ~.message_sent
|
|
1378
1378
|
value: true
|
|
1379
1379
|
when: ~.contact_form.message
|
|
1380
|
-
|
|
1380
|
+
isNotEmpty:
|
|
1381
1381
|
- what: setData
|
|
1382
1382
|
on: click
|
|
1383
1383
|
path: ~.contact_form_step
|
|
1384
1384
|
value: 1
|
|
1385
1385
|
when: ~.contact_form.message
|
|
1386
|
-
|
|
1386
|
+
isNotEmpty:
|
|
1387
1387
|
content: "Envoyer la Missive"
|
|
1388
1388
|
|
|
1389
1389
|
templates:
|