@ea-lab/reactive-json-docs 0.6.0 → 0.8.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/data-processors.md +2 -2
- package/public/rjbuild/docs/advanced-concepts/plugins/component-development-guide-llm.md +14 -14
- package/public/rjbuild/docs/core/action/HashChangeListener.md +1 -1
- package/public/rjbuild/docs/core/action/HashChangeListener.yaml +24 -6
- package/public/rjbuild/docs/core/action/Hide.md +2 -2
- package/public/rjbuild/docs/core/action/Hide.yaml +4 -3
- package/public/rjbuild/docs/core/action/MessageListener.md +4 -4
- package/public/rjbuild/docs/core/action/MessageListener.yaml +18 -6
- package/public/rjbuild/docs/core/action/Popover.md +5 -5
- package/public/rjbuild/docs/core/action/Popover.yaml +28 -5
- package/public/rjbuild/docs/core/action/ReactOnEvent.md +4 -4
- package/public/rjbuild/docs/core/action/ReactOnEvent.yaml +4 -4
- package/public/rjbuild/docs/core/action/Redirect.md +2 -2
- package/public/rjbuild/docs/core/action/Redirect.yaml +8 -2
- package/public/rjbuild/docs/core/action/Tooltip.md +3 -3
- package/public/rjbuild/docs/core/action/Tooltip.yaml +16 -3
- package/public/rjbuild/docs/core/action/VisuallyHide.md +2 -2
- package/public/rjbuild/docs/core/action/VisuallyHide.yaml +2 -2
- package/public/rjbuild/docs/core/dataMapping/simpleMapping.md +5 -5
- package/public/rjbuild/docs/core/dataMapping/simpleMapping.yaml +76 -56
- package/public/rjbuild/docs/core/element/debug/VariablesDebug.md +59 -0
- package/public/rjbuild/docs/core/element/debug/VariablesDebug.yaml +71 -0
- package/public/rjbuild/docs/core/element/form/CheckBoxField.md +8 -8
- package/public/rjbuild/docs/core/element/form/CheckBoxField.yaml +40 -8
- package/public/rjbuild/docs/core/element/form/DateField.md +5 -5
- package/public/rjbuild/docs/core/element/form/DateField.yaml +27 -5
- package/public/rjbuild/docs/core/element/form/NumberField.md +7 -7
- package/public/rjbuild/docs/core/element/form/NumberField.yaml +32 -7
- package/public/rjbuild/docs/core/element/form/SelectField.md +9 -9
- package/public/rjbuild/docs/core/element/form/SelectField.yaml +46 -9
- package/public/rjbuild/docs/core/element/form/TextAreaField.md +8 -8
- package/public/rjbuild/docs/core/element/form/TextAreaField.yaml +36 -8
- package/public/rjbuild/docs/core/element/form/TextField.md +8 -8
- package/public/rjbuild/docs/core/element/form/TextField.yaml +38 -8
- package/public/rjbuild/docs/core/element/form/formElementsCommon.md +2 -4
- package/public/rjbuild/docs/core/element/form/index.md +0 -2
- package/public/rjbuild/docs/core/element/html/AccordionItem.yaml +19 -7
- package/public/rjbuild/docs/core/element/html/FolderSortableTree.yaml +40 -12
- package/public/rjbuild/docs/core/element/html/FormatNumeral.yaml +21 -7
- package/public/rjbuild/docs/core/element/html/Html.yaml +26 -9
- package/public/rjbuild/docs/core/element/html/LabelFromValue.yaml +25 -8
- package/public/rjbuild/docs/core/element/html/Modal.yaml +35 -12
- package/public/rjbuild/docs/core/element/html/PreformattedMarkup.yaml +23 -7
- package/public/rjbuild/docs/core/element/html/SortableTreeItemCollapseButton.yaml +7 -6
- package/public/rjbuild/docs/core/element/html/SyntaxHighlighter.yaml +56 -20
- package/public/rjbuild/docs/core/element/html/Tabs.yaml +24 -15
- package/public/rjbuild/docs/core/element/special/BootstrapElement.md +4 -6
- package/public/rjbuild/docs/core/element/special/BootstrapElement.yaml +15 -4
- package/public/rjbuild/docs/core/element/special/Count.md +8 -10
- package/public/rjbuild/docs/core/element/special/Count.yaml +22 -9
- package/public/rjbuild/docs/core/element/special/DataFilter.md +40 -41
- package/public/rjbuild/docs/core/element/special/DataFilter.yaml +79 -43
- package/public/rjbuild/docs/core/element/special/DelayedActions.md +13 -15
- package/public/rjbuild/docs/core/element/special/DelayedActions.yaml +32 -13
- package/public/rjbuild/docs/core/element/special/PageControls.md +8 -10
- package/public/rjbuild/docs/core/element/special/PageControls.yaml +9 -8
- package/public/rjbuild/docs/core/element/special/Phantom.md +9 -11
- package/public/rjbuild/docs/core/element/special/Phantom.yaml +22 -9
- package/public/rjbuild/docs/core/element/special/ReactiveJsonSubroot.md +7 -9
- package/public/rjbuild/docs/core/element/special/ReactiveJsonSubroot.yaml +13 -15
- package/public/rjbuild/docs/core/element/special/Switch.md +31 -33
- package/public/rjbuild/docs/core/element/special/Switch.yaml +59 -22
- package/public/rjbuild/docs/core/reaction/addData.md +0 -2
- package/public/rjbuild/docs/core/reaction/addData.yaml +17 -2
- package/public/rjbuild/docs/core/reaction/fetchData.md +1 -2
- package/public/rjbuild/docs/core/reaction/fetchData.yaml +40 -11
- package/public/rjbuild/docs/core/reaction/moveData.md +0 -4
- package/public/rjbuild/docs/core/reaction/moveData.yaml +28 -6
- package/public/rjbuild/docs/core/reaction/postMessage.md +0 -4
- package/public/rjbuild/docs/core/reaction/postMessage.yaml +29 -6
- package/public/rjbuild/docs/core/reaction/redirectNow.md +0 -4
- package/public/rjbuild/docs/core/reaction/redirectNow.yaml +10 -3
- package/public/rjbuild/docs/core/reaction/removeData.md +2 -6
- package/public/rjbuild/docs/core/reaction/removeData.yaml +40 -2
- package/public/rjbuild/docs/core/reaction/setClipboardData.md +0 -4
- package/public/rjbuild/docs/core/reaction/setClipboardData.yaml +10 -3
- package/public/rjbuild/docs/core/reaction/setData.md +0 -4
- package/public/rjbuild/docs/core/reaction/setData.yaml +25 -7
- package/public/rjbuild/docs/core/reaction/submitData.md +2 -3
- package/public/rjbuild/docs/core/reaction/submitData.yaml +43 -7
- package/public/rjbuild/docs/core/reaction/triggerEvent.md +0 -4
- package/public/rjbuild/docs/core/reaction/triggerEvent.yaml +25 -11
- package/public/rjbuild/docs/install.md +24 -24
|
@@ -145,19 +145,19 @@ renderView:
|
|
|
145
145
|
1. **Automatic synchronization**: Data remains consistent between parent and subroot
|
|
146
146
|
2. **Simplicity**: No need to manually manage update callbacks
|
|
147
147
|
3. **Performance**: Avoids unnecessary re-renders by propagating directly to the right level
|
|
148
|
-
|
|
148
|
+
4. **Flexibility**: Supports different referencing patterns (~~., ~., ~>) and arrays containing references
|
|
149
149
|
|
|
150
150
|
### Supported vs Unsupported Cases
|
|
151
151
|
|
|
152
|
-
####
|
|
152
|
+
#### Supported cases
|
|
153
153
|
|
|
154
|
-
#####
|
|
154
|
+
##### Direct reference
|
|
155
155
|
```yaml
|
|
156
156
|
dataOverride: ~~.user
|
|
157
157
|
# Modifications in the subroot propagate to "user" in the parent
|
|
158
158
|
```
|
|
159
159
|
|
|
160
|
-
#####
|
|
160
|
+
##### Object mapping with references
|
|
161
161
|
```yaml
|
|
162
162
|
dataOverride:
|
|
163
163
|
userInfo: ~~.user
|
|
@@ -166,19 +166,19 @@ renderView:
|
|
|
166
166
|
# Modifications to "settings" propagate to "config" in the parent
|
|
167
167
|
```
|
|
168
168
|
|
|
169
|
-
#####
|
|
169
|
+
##### Local references
|
|
170
170
|
```yaml
|
|
171
171
|
dataOverride: ~.localData
|
|
172
172
|
# Modifications propagate to the local template context
|
|
173
173
|
```
|
|
174
174
|
|
|
175
|
-
#####
|
|
175
|
+
##### Hierarchical references
|
|
176
176
|
```yaml
|
|
177
177
|
dataOverride: ~>key.someData
|
|
178
178
|
# Modifications propagate up the template hierarchy
|
|
179
179
|
```
|
|
180
180
|
|
|
181
|
-
#####
|
|
181
|
+
##### Arrays in dataOverride
|
|
182
182
|
```yaml
|
|
183
183
|
dataOverride:
|
|
184
184
|
- ~~.firstItem
|
|
@@ -186,7 +186,7 @@ renderView:
|
|
|
186
186
|
# Array items with template references are properly handled
|
|
187
187
|
```
|
|
188
188
|
|
|
189
|
-
####
|
|
189
|
+
#### Unsupported cases
|
|
190
190
|
|
|
191
191
|
##### Nested references in data
|
|
192
192
|
```yaml
|
|
@@ -240,7 +240,7 @@ renderView:
|
|
|
240
240
|
padding: "1rem"
|
|
241
241
|
border: "2px solid #007bff"
|
|
242
242
|
borderRadius: "8px"
|
|
243
|
-
|
|
243
|
+
|
|
244
244
|
marginBottom: "1rem"
|
|
245
245
|
content:
|
|
246
246
|
- type: h4
|
|
@@ -262,7 +262,7 @@ renderView:
|
|
|
262
262
|
padding: "1rem"
|
|
263
263
|
border: "2px solid #28a745"
|
|
264
264
|
borderRadius: "8px"
|
|
265
|
-
|
|
265
|
+
|
|
266
266
|
content:
|
|
267
267
|
- type: h4
|
|
268
268
|
content: "Subroot Editor (with sharedUpdates)"
|
|
@@ -306,7 +306,7 @@ renderView:
|
|
|
306
306
|
padding: "1rem"
|
|
307
307
|
border: "1px solid #ddd"
|
|
308
308
|
borderRadius: "4px"
|
|
309
|
-
|
|
309
|
+
|
|
310
310
|
content:
|
|
311
311
|
- type: h5
|
|
312
312
|
content: "Profile Data"
|
|
@@ -320,7 +320,7 @@ renderView:
|
|
|
320
320
|
padding: "1rem"
|
|
321
321
|
border: "1px solid #ddd"
|
|
322
322
|
borderRadius: "4px"
|
|
323
|
-
|
|
323
|
+
|
|
324
324
|
content:
|
|
325
325
|
- type: h5
|
|
326
326
|
content: "Settings Data"
|
|
@@ -346,7 +346,7 @@ renderView:
|
|
|
346
346
|
padding: "1rem"
|
|
347
347
|
border: "2px solid #17a2b8"
|
|
348
348
|
borderRadius: "8px"
|
|
349
|
-
|
|
349
|
+
|
|
350
350
|
content:
|
|
351
351
|
- type: div
|
|
352
352
|
content:
|
|
@@ -386,7 +386,6 @@ renderView:
|
|
|
386
386
|
padding: "1rem"
|
|
387
387
|
border: "1px solid #ddd"
|
|
388
388
|
borderRadius: "4px"
|
|
389
|
-
backgroundColor: "#f9f9f9"
|
|
390
389
|
marginBottom: "1rem"
|
|
391
390
|
content:
|
|
392
391
|
- type: h4
|
|
@@ -410,7 +409,6 @@ renderView:
|
|
|
410
409
|
padding: "1rem"
|
|
411
410
|
border: "2px solid #ffc107"
|
|
412
411
|
borderRadius: "8px"
|
|
413
|
-
backgroundColor: "#fff3cd"
|
|
414
412
|
content:
|
|
415
413
|
- type: h4
|
|
416
414
|
content: "Array Items Editor"
|
|
@@ -1,32 +1,30 @@
|
|
|
1
1
|
# Switch
|
|
2
2
|
|
|
3
|
-
## Introduction
|
|
4
|
-
|
|
5
3
|
The `Switch` component allows you to render a list or collection of items using a template, with support for dynamic data, options, and pagination. It is useful for displaying arrays, lists, or collections where each item can be rendered with a specific template or configuration.
|
|
6
4
|
|
|
7
5
|
## Properties
|
|
8
|
-
- `content` (array/object, required): The data or path to the data to iterate over
|
|
9
|
-
- `options` (object, optional): Mapping of keys to templates for rendering each item (referenced by `load`)
|
|
10
|
-
- `singleOption` (object, optional): Template to use for each item when all items share the same structure (referenced by `load`)
|
|
11
|
-
- `cardinality` (number, optional): Maximum number of items to render (default: unlimited)
|
|
12
|
-
- `paginated` (boolean, optional): Whether to enable pagination (default: false)
|
|
13
|
-
- `paginationProps` (object, optional): Pagination configuration (page size, etc.)
|
|
14
|
-
- `before` (object, optional): Content to render before the list
|
|
15
|
-
- `after` (object, optional): Content to render after the list
|
|
16
|
-
- `contentWrapper` (object, optional): HTML element configuration to wrap the main content (items only, not before/after)
|
|
17
|
-
- `tag` (string, optional): HTML tag name (default: "div")
|
|
18
|
-
- `attributes` (object, optional): HTML attributes to apply to the wrapper element (supports template evaluation)
|
|
19
|
-
- `templates` (object, optional): Named templates referenced by `load` in `singleOption` or `options
|
|
6
|
+
- `content` (array/object, required): The data or path to the data to iterate over.
|
|
7
|
+
- `options` (object, optional): Mapping of keys to templates for rendering each item (referenced by `load`).
|
|
8
|
+
- `singleOption` (object, optional): Template to use for each item when all items share the same structure (referenced by `load`).
|
|
9
|
+
- `cardinality` (number, optional): Maximum number of items to render (default: unlimited).
|
|
10
|
+
- `paginated` (boolean, optional): Whether to enable pagination (default: false).
|
|
11
|
+
- `paginationProps` (object, optional): Pagination configuration (page size, etc.).
|
|
12
|
+
- `before` (object, optional): Content to render before the list.
|
|
13
|
+
- `after` (object, optional): Content to render after the list.
|
|
14
|
+
- `contentWrapper` (object, optional): HTML element configuration to wrap the main content (items only, not before/after).
|
|
15
|
+
- `tag` (string, optional): HTML tag name (default: "div").
|
|
16
|
+
- `attributes` (object, optional): HTML attributes to apply to the wrapper element (supports template evaluation).
|
|
17
|
+
- `templates` (object, optional): Named templates referenced by `load` in `singleOption` or `options`.
|
|
20
18
|
|
|
21
19
|
## Behavior
|
|
22
|
-
- Iterates over the provided data and renders each item using the specified template(s)
|
|
23
|
-
- If `options` is provided, uses the corresponding template for each key (with `load`)
|
|
24
|
-
- If `singleOption` is provided, uses the template referenced by `load` for all items
|
|
25
|
-
- Supports limiting the number of items with `cardinality
|
|
26
|
-
- Supports pagination if `paginated` is true
|
|
27
|
-
- Renders optional `before` and `after` content
|
|
28
|
-
- Can wrap the main content (items) with a custom HTML element using `contentWrapper
|
|
29
|
-
- Templates are defined in the `templates` object and referenced by name
|
|
20
|
+
- Iterates over the provided data and renders each item using the specified template(s).
|
|
21
|
+
- If `options` is provided, uses the corresponding template for each key (with `load`).
|
|
22
|
+
- If `singleOption` is provided, uses the template referenced by `load` for all items.
|
|
23
|
+
- Supports limiting the number of items with `cardinality`.
|
|
24
|
+
- Supports pagination if `paginated` is true.
|
|
25
|
+
- Renders optional `before` and `after` content.
|
|
26
|
+
- Can wrap the main content (items) with a custom HTML element using `contentWrapper`.
|
|
27
|
+
- Templates are defined in the `templates` object and referenced by name.
|
|
30
28
|
|
|
31
29
|
## Content Wrapper Feature
|
|
32
30
|
|
|
@@ -46,7 +44,7 @@ The wrapper only affects the main content items and does not interfere with pagi
|
|
|
46
44
|
|
|
47
45
|
## Examples
|
|
48
46
|
|
|
49
|
-
###
|
|
47
|
+
### Simple usage with `singleOption` (no pagination)
|
|
50
48
|
```yaml
|
|
51
49
|
renderView:
|
|
52
50
|
- type: Switch
|
|
@@ -65,7 +63,7 @@ data:
|
|
|
65
63
|
- name: "Charlie"
|
|
66
64
|
```
|
|
67
65
|
|
|
68
|
-
###
|
|
66
|
+
### Usage with `options` (different templates per key)
|
|
69
67
|
```yaml
|
|
70
68
|
renderView:
|
|
71
69
|
- type: Switch
|
|
@@ -94,7 +92,7 @@ data:
|
|
|
94
92
|
value: 25
|
|
95
93
|
```
|
|
96
94
|
|
|
97
|
-
###
|
|
95
|
+
### Usage with `singleOption`, pagination, before/after, and PageControls
|
|
98
96
|
```yaml
|
|
99
97
|
renderView:
|
|
100
98
|
- type: Switch
|
|
@@ -127,7 +125,7 @@ data:
|
|
|
127
125
|
- value: 10
|
|
128
126
|
```
|
|
129
127
|
|
|
130
|
-
###
|
|
128
|
+
### Usage with `contentWrapper` for CSS Grid Layout
|
|
131
129
|
```yaml
|
|
132
130
|
renderView:
|
|
133
131
|
- type: Switch
|
|
@@ -168,7 +166,7 @@ data:
|
|
|
168
166
|
description: "Description of product C"
|
|
169
167
|
```
|
|
170
168
|
|
|
171
|
-
###
|
|
169
|
+
### Usage with `contentWrapper` for Flexbox Layout
|
|
172
170
|
```yaml
|
|
173
171
|
renderView:
|
|
174
172
|
- type: Switch
|
|
@@ -201,7 +199,7 @@ data:
|
|
|
201
199
|
- text: "Item 3"
|
|
202
200
|
```
|
|
203
201
|
|
|
204
|
-
###
|
|
202
|
+
### Dynamic `contentWrapper` with Template Evaluation
|
|
205
203
|
```yaml
|
|
206
204
|
renderView:
|
|
207
205
|
- type: Switch
|
|
@@ -238,11 +236,11 @@ data:
|
|
|
238
236
|
```
|
|
239
237
|
|
|
240
238
|
## Limitations
|
|
241
|
-
- The data must be an array or object; strings and numbers are not supported
|
|
242
|
-
- If both `options` and `singleOption` are provided, `singleOption` takes precedence
|
|
243
|
-
- No built-in support for filtering or sorting (use DataFilter or custom logic)
|
|
244
|
-
- Pagination requires the `paginated` property to be set to true
|
|
245
|
-
- Templates must be defined in the `templates` object and referenced by `load
|
|
239
|
+
- The data must be an array or object; strings and numbers are not supported.
|
|
240
|
+
- If both `options` and `singleOption` are provided, `singleOption` takes precedence.
|
|
241
|
+
- No built-in support for filtering or sorting (use DataFilter or custom logic).
|
|
242
|
+
- Pagination requires the `paginated` property to be set to true.
|
|
243
|
+
- Templates must be defined in the `templates` object and referenced by `load`.
|
|
246
244
|
|
|
247
245
|
### Data Structure Requirements
|
|
248
246
|
Switch requires each item in the data to be an object, not a primitive value:
|
|
@@ -6,24 +6,61 @@ renderView:
|
|
|
6
6
|
The `Switch` component allows you to render a list or collection of items using a template, with support for dynamic data, options, and pagination. It is useful for displaying arrays, lists, or collections where each item can be rendered with a specific template or configuration.
|
|
7
7
|
|
|
8
8
|
## Properties
|
|
9
|
-
- `content` (object/array/string, required): The data or path to the data to iterate over
|
|
10
|
-
- `options` (object, optional): Mapping of keys to templates for rendering each item (used for object/array of objects)
|
|
11
|
-
- `singleOption` (object, optional): Template to use for each item when all items share the same structure
|
|
12
|
-
- `cardinality` (number, optional): Maximum number of items to render (default: unlimited)
|
|
13
|
-
- `paginated` (boolean, optional): Whether to enable pagination (default: false)
|
|
14
|
-
- `paginationProps` (object, optional): Pagination configuration (page size, etc.)
|
|
15
|
-
- `before` (object, optional): Content to render before the list
|
|
16
|
-
- `after` (object, optional): Content to render after the list
|
|
17
|
-
- `contentWrapper` (object, optional): HTML element configuration to wrap the main content (items only, not before/after)
|
|
18
|
-
- `tag` (string, optional): HTML tag name (default: "div")
|
|
19
|
-
- `attributes` (object, optional): HTML attributes to apply to the wrapper element (supports template evaluation)
|
|
20
9
|
|
|
10
|
+
- type: DefinitionList
|
|
11
|
+
content:
|
|
12
|
+
- term:
|
|
13
|
+
code: content
|
|
14
|
+
after: "(object|array|string, required)"
|
|
15
|
+
details:
|
|
16
|
+
type: Markdown
|
|
17
|
+
content: "Data or path to the data to iterate over."
|
|
18
|
+
- term:
|
|
19
|
+
code: options
|
|
20
|
+
after: "(object, optional)"
|
|
21
|
+
details: "Mapping of keys to templates for rendering each item (used for object/array of objects)."
|
|
22
|
+
- term:
|
|
23
|
+
code: singleOption
|
|
24
|
+
after: "(object, optional)"
|
|
25
|
+
details: "Template to use for each item when all items share the same structure."
|
|
26
|
+
- term:
|
|
27
|
+
code: cardinality
|
|
28
|
+
after: "(number, optional)"
|
|
29
|
+
details: "Maximum number of items to render (default: unlimited)."
|
|
30
|
+
- term:
|
|
31
|
+
code: paginated
|
|
32
|
+
after: "(boolean, optional)"
|
|
33
|
+
details: "Whether to enable pagination (default: false)."
|
|
34
|
+
- term:
|
|
35
|
+
code: paginationProps
|
|
36
|
+
after: "(object, optional)"
|
|
37
|
+
details: "Pagination configuration (page size, etc.)."
|
|
38
|
+
- term:
|
|
39
|
+
code: before
|
|
40
|
+
after: "(object, optional)"
|
|
41
|
+
details: "Content to render before the list."
|
|
42
|
+
- term:
|
|
43
|
+
code: after
|
|
44
|
+
after: "(object, optional)"
|
|
45
|
+
details: "Content to render after the list."
|
|
46
|
+
- term:
|
|
47
|
+
code: contentWrapper
|
|
48
|
+
after: "(object, optional)"
|
|
49
|
+
details:
|
|
50
|
+
type: Markdown
|
|
51
|
+
content: |
|
|
52
|
+
HTML element configuration to wrap the main content (items only, not before/after):
|
|
53
|
+
- `tag` (string, optional): HTML tag name (default: `div`)
|
|
54
|
+
- `attributes` (object, optional): HTML attributes to apply to the wrapper element (supports template evaluation)
|
|
55
|
+
|
|
56
|
+
- type: Markdown
|
|
57
|
+
content: |
|
|
21
58
|
## Behavior
|
|
22
|
-
- Iterates over the provided data and renders each item using the specified template(s)
|
|
23
|
-
- If `options` is provided, uses the corresponding template for each key
|
|
24
|
-
- If `singleOption` is provided, uses the same template for all items
|
|
25
|
-
- Supports limiting the number of items with `cardinality
|
|
26
|
-
- Supports pagination if `paginated` is true
|
|
59
|
+
- Iterates over the provided data and renders each item using the specified template(s).
|
|
60
|
+
- If `options` is provided, uses the corresponding template for each key.
|
|
61
|
+
- If `singleOption` is provided, uses the same template for all items.
|
|
62
|
+
- Supports limiting the number of items with `cardinality`.
|
|
63
|
+
- Supports pagination if `paginated` is true.
|
|
27
64
|
- Renders optional `before` and `after` content
|
|
28
65
|
- Can wrap the main content (items) with a custom HTML element using `contentWrapper`
|
|
29
66
|
|
|
@@ -88,7 +125,7 @@ renderView:
|
|
|
88
125
|
```
|
|
89
126
|
|
|
90
127
|
- type: RjBuildDescriber
|
|
91
|
-
title: "
|
|
128
|
+
title: "Simple usage with `singleOption` (no pagination)"
|
|
92
129
|
description: |
|
|
93
130
|
This example shows a basic Switch rendering a list of users with a single template.
|
|
94
131
|
toDescribe:
|
|
@@ -108,7 +145,7 @@ renderView:
|
|
|
108
145
|
- name: "Charlie"
|
|
109
146
|
|
|
110
147
|
- type: RjBuildDescriber
|
|
111
|
-
title: "
|
|
148
|
+
title: "Usage with `options` (different templates per key)"
|
|
112
149
|
description: |
|
|
113
150
|
This example shows how to use different templates for each key in the data.
|
|
114
151
|
toDescribe:
|
|
@@ -139,7 +176,7 @@ renderView:
|
|
|
139
176
|
value: 25
|
|
140
177
|
|
|
141
178
|
- type: RjBuildDescriber
|
|
142
|
-
title: "
|
|
179
|
+
title: "Usage with `singleOption` and pagination (4 per page, 10 items)"
|
|
143
180
|
description: |
|
|
144
181
|
This example demonstrates pagination with 4 items per page and 10 items in total. PageControls is added to the end of the list.
|
|
145
182
|
toDescribe:
|
|
@@ -173,7 +210,7 @@ renderView:
|
|
|
173
210
|
- value: 10
|
|
174
211
|
|
|
175
212
|
- type: RjBuildDescriber
|
|
176
|
-
title: "
|
|
213
|
+
title: "Usage with `contentWrapper` for CSS Grid Layout"
|
|
177
214
|
description: |
|
|
178
215
|
This example demonstrates how to use contentWrapper to apply a CSS Grid layout to the Switch items.
|
|
179
216
|
toDescribe:
|
|
@@ -239,7 +276,7 @@ renderView:
|
|
|
239
276
|
description: "Affordable product D"
|
|
240
277
|
|
|
241
278
|
- type: RjBuildDescriber
|
|
242
|
-
title: "
|
|
279
|
+
title: "Usage with `contentWrapper` and Pagination"
|
|
243
280
|
description: |
|
|
244
281
|
This example shows how contentWrapper works seamlessly with pagination.
|
|
245
282
|
toDescribe:
|
|
@@ -288,7 +325,7 @@ renderView:
|
|
|
288
325
|
- title: "Card 7"
|
|
289
326
|
|
|
290
327
|
- type: RjBuildDescriber
|
|
291
|
-
title: "
|
|
328
|
+
title: "Dynamic `contentWrapper` with Template Evaluation"
|
|
292
329
|
description: |
|
|
293
330
|
This example demonstrates how contentWrapper attributes can use template evaluation to create dynamic layouts.
|
|
294
331
|
toDescribe:
|
|
@@ -6,9 +6,24 @@ renderView:
|
|
|
6
6
|
`addData` is a reaction that allows adding data at a specified path in the application's data context. It's particularly useful for appending new items to arrays or adding new properties to objects.
|
|
7
7
|
|
|
8
8
|
## Properties
|
|
9
|
-
- `path` (string, required): The location where the data should be added (using template path syntax with `~` or `~~`). If the path does not exist, it will be created automatically.
|
|
10
|
-
- `value` (any, optional): The data to add. Can be any valid JSON value (string, number, object, array).
|
|
11
9
|
|
|
10
|
+
- type: DefinitionList
|
|
11
|
+
content:
|
|
12
|
+
- term:
|
|
13
|
+
code: path
|
|
14
|
+
after: "(string, required)"
|
|
15
|
+
details:
|
|
16
|
+
type: Markdown
|
|
17
|
+
content: "The location where the data should be added (using template path syntax with `~` or `~~`). If the path does not exist, it will be created automatically"
|
|
18
|
+
- term:
|
|
19
|
+
code: value
|
|
20
|
+
after: "(any, optional)"
|
|
21
|
+
details:
|
|
22
|
+
type: Markdown
|
|
23
|
+
content: "The data to add. Can be any valid JSON value (string, number, object, array)"
|
|
24
|
+
|
|
25
|
+
- type: Markdown
|
|
26
|
+
content: |
|
|
12
27
|
## Behavior
|
|
13
28
|
- If the path doesn't exist, it will be created automatically
|
|
14
29
|
- For arrays, the value is appended to the end
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
# Reactive-JSON fetchData Documentation
|
|
2
2
|
|
|
3
|
-
## Introduction
|
|
4
3
|
`fetchData` is a reaction that allows making HTTP requests to a server. It operates in multiple modes, depending on configuration values.
|
|
5
4
|
|
|
6
5
|
- Supports configurable HTTP methods (GET by default for backward compatibility)
|
|
@@ -9,11 +8,11 @@
|
|
|
9
8
|
- The response can refresh the app (default) or be ignored
|
|
10
9
|
|
|
11
10
|
## Properties
|
|
12
|
-
- `url` (string, required): The URL to call (must be a static string, dynamic URLs are not supported)
|
|
13
11
|
- `httpMethod` (string, optional): The HTTP method to use (default: "get"). Supports: get, post, put, patch, delete, etc.
|
|
14
12
|
- `refreshAppOnResponse` (boolean, optional): If true (default), the response will update the application. If false, the response is ignored (webhook mode).
|
|
15
13
|
- `updateOnlyData` (boolean, optional): When true and `refreshAppOnResponse` is true, only updates the data section instead of replacing the entire RjBuild. Preserves templates and renderView. Default: false.
|
|
16
14
|
- `updateDataAtLocation` (string, optional): When `updateOnlyData` is true, specifies where to place the response data using template path syntax (e.g., "~~.userProfile", "~.config.settings"). If not specified, replaces the entire data object.
|
|
15
|
+
- `url` (string, required): The URL to call (must be a static string, dynamic URLs are not supported)
|
|
17
16
|
|
|
18
17
|
## Behavior
|
|
19
18
|
- Supports configurable HTTP methods (GET by default for backward compatibility)
|
|
@@ -3,21 +3,50 @@ renderView:
|
|
|
3
3
|
content: |
|
|
4
4
|
# fetchData
|
|
5
5
|
|
|
6
|
-
fetchData is a reaction that allows making HTTP requests to a server. It operates in
|
|
6
|
+
`fetchData` is a reaction that allows making HTTP requests to a server. It operates in multiple modes, depending on configuration values.
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
**Important**: Dynamic URLs are not supported. URLs must be static strings.
|
|
8
|
+
- Supports configurable HTTP methods (GET by default for backward compatibility)
|
|
9
|
+
- Only one request can be active at a time
|
|
10
|
+
- The URL is evaluated via the template system before sending, but must resolve to a static string
|
|
11
|
+
- The response can refresh the app (default) or be ignored
|
|
13
12
|
|
|
14
13
|
## Properties
|
|
15
|
-
- `url` (string, required): The URL to call (must be a static string, dynamic URLs are not supported)
|
|
16
|
-
- `httpMethod` (string, optional): The HTTP method to use (default: "get"). Supports: get, post, put, patch, delete, etc.
|
|
17
|
-
- `refreshAppOnResponse` (boolean, optional): If true (default), the response will update the application. If false, the response is ignored (webhook mode).
|
|
18
|
-
- `updateOnlyData` (boolean, optional): When true and `refreshAppOnResponse` is true, only updates the data section instead of replacing the entire RjBuild. Preserves templates and renderView. Default: false.
|
|
19
|
-
- `updateDataAtLocation` (string, optional): When `updateOnlyData` is true, specifies where to place the response data using template path syntax (e.g., "~~.userProfile", "~.config.settings"). If not specified, replaces the entire data object.
|
|
20
14
|
|
|
15
|
+
- type: DefinitionList
|
|
16
|
+
content:
|
|
17
|
+
- term:
|
|
18
|
+
code: httpMethod
|
|
19
|
+
after: "(string, optional)"
|
|
20
|
+
details:
|
|
21
|
+
type: Markdown
|
|
22
|
+
content: "The HTTP method to use (default: \"get\"). Supports: get, post, put, patch, delete, etc."
|
|
23
|
+
- term:
|
|
24
|
+
code: refreshAppOnResponse
|
|
25
|
+
after: "(boolean, optional)"
|
|
26
|
+
details:
|
|
27
|
+
type: Markdown
|
|
28
|
+
content: "If true (default), the response will update the application. If false, the response is ignored (webhook mode)"
|
|
29
|
+
- term:
|
|
30
|
+
code: updateDataAtLocation
|
|
31
|
+
after: "(string, optional)"
|
|
32
|
+
details:
|
|
33
|
+
type: Markdown
|
|
34
|
+
content: "When `updateOnlyData` is true, specifies where to place the response data using template path syntax (e.g., \"~~.userProfile\", \"~.config.settings\"). If not specified, replaces the entire data object"
|
|
35
|
+
- term:
|
|
36
|
+
code: updateOnlyData
|
|
37
|
+
after: "(boolean, optional)"
|
|
38
|
+
details:
|
|
39
|
+
type: Markdown
|
|
40
|
+
content: "When true and `refreshAppOnResponse` is true, only updates the data section instead of replacing the entire RjBuild. Preserves templates and renderView. Default: false"
|
|
41
|
+
- term:
|
|
42
|
+
code: url
|
|
43
|
+
after: "(string, required)"
|
|
44
|
+
details:
|
|
45
|
+
type: Markdown
|
|
46
|
+
content: "The URL to call (must be a static string, dynamic URLs are not supported)"
|
|
47
|
+
|
|
48
|
+
- type: Markdown
|
|
49
|
+
content: |
|
|
21
50
|
## Behavior
|
|
22
51
|
- Supports configurable HTTP methods (GET by default for backward compatibility)
|
|
23
52
|
- Only one request can be active at a time
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
# Reaction: moveData
|
|
2
2
|
|
|
3
|
-
## Introduction
|
|
4
|
-
|
|
5
3
|
The `moveData` reaction changes the position of an element within an array in the global data context. This is particularly useful for reordering items in a list, for example, moving an item up or down. Like `removeData`, it can operate in `path` mode or `target` mode.
|
|
6
4
|
|
|
7
5
|
## Properties
|
|
8
6
|
|
|
9
|
-
- `what` (string, required): The name of the reaction, which must be `moveData`.
|
|
10
|
-
- `on` (string, required): The name of the event that triggers the reaction.
|
|
11
7
|
- `path` (string, optional): The path to the array element to move. Required if `target` is not used.
|
|
12
8
|
- `target` (string, optional): If set to `currentTemplateData`, the reaction will target the data associated with the current template item.
|
|
13
9
|
- `parentLevel` (number, optional): Used with `target: 'currentTemplateData'`. Specifies how many levels to go up from the current data path to find the element to move.
|
|
@@ -7,13 +7,35 @@ renderView:
|
|
|
7
7
|
|
|
8
8
|
## Properties
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
- type: DefinitionList
|
|
11
|
+
content:
|
|
12
|
+
- term:
|
|
13
|
+
code: path
|
|
14
|
+
after: "(string, optional)"
|
|
15
|
+
details:
|
|
16
|
+
type: Markdown
|
|
17
|
+
content: "The path to the array element to move. Required if `target` is not used"
|
|
18
|
+
- term:
|
|
19
|
+
code: target
|
|
20
|
+
after: "(string, optional)"
|
|
21
|
+
details:
|
|
22
|
+
type: Markdown
|
|
23
|
+
content: "If set to `currentTemplateData`, the reaction will target the data associated with the current template item"
|
|
24
|
+
- term:
|
|
25
|
+
code: parentLevel
|
|
26
|
+
after: "(number, optional)"
|
|
27
|
+
details:
|
|
28
|
+
type: Markdown
|
|
29
|
+
content: "Used with `target: 'currentTemplateData'`. Specifies how many levels to go up from the current data path to find the element to move"
|
|
30
|
+
- term:
|
|
31
|
+
code: increment
|
|
32
|
+
after: "(integer, required)"
|
|
33
|
+
details:
|
|
34
|
+
type: Markdown
|
|
35
|
+
content: "The number of positions to move the element. A positive integer moves it down (towards the end of the array), and a negative integer moves it up (towards the beginning)"
|
|
16
36
|
|
|
37
|
+
- type: Markdown
|
|
38
|
+
content: |
|
|
17
39
|
## Behavior
|
|
18
40
|
|
|
19
41
|
- When triggered, `moveData` repositions an element within an array.
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
# Reaction: postMessage
|
|
2
2
|
|
|
3
|
-
## Introduction
|
|
4
|
-
|
|
5
3
|
The `postMessage` reaction sends a message to another window or frame using the standard `window.postMessage` Web API. This is useful for communication between your Reactive-JSON application and a parent window (if embedded in an iframe) or for other cross-origin communication scenarios.
|
|
6
4
|
|
|
7
5
|
## Properties
|
|
8
6
|
|
|
9
|
-
- `what` (string, required): The name of the reaction, must be `postMessage`.
|
|
10
|
-
- `on` (string, required): The event that triggers the reaction (e.g., `click`, `change`).
|
|
11
7
|
- `message` (any, required): The data to send as the message. This value is evaluated and can be any serializable type (string, number, object, array).
|
|
12
8
|
- `messageTarget` (string, optional): The target window for the message. Can be `'parent'` (the default) or `'self'`.
|
|
13
9
|
- `targetOrigin` (string, optional): Specifies the origin of the target window for security. Defaults to the current window's origin (`window.location.origin`). Use `"*"` for any origin, but be aware of the security implications.
|
|
@@ -17,13 +17,36 @@ renderView:
|
|
|
17
17
|
- type: Markdown
|
|
18
18
|
content: |
|
|
19
19
|
## Properties
|
|
20
|
-
- `what` (string, required): The name of the reaction, must be `postMessage`.
|
|
21
|
-
- `on` (string, required): The event that triggers the reaction (e.g., `click`, `change`).
|
|
22
|
-
- `message` (any, required): The data to send as the message. This value is evaluated and can be any serializable type (string, number, object, array).
|
|
23
|
-
- `messageTarget` (string, optional): The target window for the message. Can be `'parent'` (the default) or `'self'`.
|
|
24
|
-
- `targetOrigin` (string, optional): Specifies the origin of the target window for security. Defaults to the current window's origin (`window.location.origin`). Use `"*"` for any origin, but be aware of the security implications.
|
|
25
|
-
- `includeChangedValue` (boolean, optional): If the trigger event is `change` on an input element, setting this to `true` will add the input's new value to the message payload under the key `changedValue`. Currently, this is only supported for checkboxes.
|
|
26
20
|
|
|
21
|
+
- type: DefinitionList
|
|
22
|
+
content:
|
|
23
|
+
- term:
|
|
24
|
+
code: message
|
|
25
|
+
after: "(any, required)"
|
|
26
|
+
details:
|
|
27
|
+
type: Markdown
|
|
28
|
+
content: "The data to send as the message. This value is evaluated and can be any serializable type (string, number, object, array)"
|
|
29
|
+
- term:
|
|
30
|
+
code: messageTarget
|
|
31
|
+
after: "(string, optional)"
|
|
32
|
+
details:
|
|
33
|
+
type: Markdown
|
|
34
|
+
content: "The target window for the message. Can be 'parent' (the default) or 'self'"
|
|
35
|
+
- term:
|
|
36
|
+
code: targetOrigin
|
|
37
|
+
after: "(string, optional)"
|
|
38
|
+
details:
|
|
39
|
+
type: Markdown
|
|
40
|
+
content: "Specifies the origin of the target window for security. Defaults to the current window's origin (`window.location.origin`). Use \"*\" for any origin, but be aware of the security implications"
|
|
41
|
+
- term:
|
|
42
|
+
code: includeChangedValue
|
|
43
|
+
after: "(boolean, optional)"
|
|
44
|
+
details:
|
|
45
|
+
type: Markdown
|
|
46
|
+
content: "If the trigger event is `change` on an input element, setting this to `true` will add the input's new value to the message payload under the key `changedValue`. Currently, this is only supported for checkboxes"
|
|
47
|
+
|
|
48
|
+
- type: Markdown
|
|
49
|
+
content: |
|
|
27
50
|
## Behavior
|
|
28
51
|
- When triggered, the reaction evaluates the `message` content.
|
|
29
52
|
- It identifies the target window based on `messageTarget` and the target origin from `targetOrigin`.
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
# Reaction: redirectNow
|
|
2
2
|
|
|
3
|
-
## Introduction
|
|
4
|
-
|
|
5
3
|
The `redirectNow` reaction performs an immediate browser redirection to a specified URL. It is useful for navigating to a new page after an action is completed, such as after submitting a form or clicking a link.
|
|
6
4
|
|
|
7
5
|
## Properties
|
|
8
6
|
|
|
9
|
-
- `what` (string, required): The name of the reaction, which must be `redirectNow`.
|
|
10
|
-
- `on` (string, required): The name of the event that triggers the reaction (e.g., `click`).
|
|
11
7
|
- `to` (string, required): The URL to redirect to. This value is evaluated, so it can be a static URL or dynamically constructed from data.
|
|
12
8
|
|
|
13
9
|
## Behavior
|
|
@@ -7,10 +7,17 @@ renderView:
|
|
|
7
7
|
|
|
8
8
|
## Properties
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
-
|
|
10
|
+
- type: DefinitionList
|
|
11
|
+
content:
|
|
12
|
+
- term:
|
|
13
|
+
code: to
|
|
14
|
+
after: "(string, required)"
|
|
15
|
+
details:
|
|
16
|
+
type: Markdown
|
|
17
|
+
content: "The URL to redirect to. This value is evaluated, so it can be a static URL or dynamically constructed from data"
|
|
13
18
|
|
|
19
|
+
- type: Markdown
|
|
20
|
+
content: |
|
|
14
21
|
## Behavior
|
|
15
22
|
|
|
16
23
|
- When triggered, the reaction evaluates the `to` property to get the target URL.
|