@ea-lab/reactive-json-docs 0.7.0 → 1.0.0-alpha.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.
Files changed (116) hide show
  1. package/package.json +7 -5
  2. package/public/rjbuild/docs/advanced-concepts/data-processors.md +2 -2
  3. package/public/rjbuild/docs/advanced-concepts/plugins/component-development-guide-llm.md +14 -14
  4. package/public/rjbuild/docs/advanced-concepts/plugins/plugin-system.md +47 -1
  5. package/public/rjbuild/docs/advanced-concepts/plugins/plugin-system.yaml +53 -1
  6. package/public/rjbuild/docs/core/action/HashChangeListener.md +1 -1
  7. package/public/rjbuild/docs/core/action/HashChangeListener.yaml +24 -6
  8. package/public/rjbuild/docs/core/action/Hide.md +2 -2
  9. package/public/rjbuild/docs/core/action/Hide.yaml +4 -3
  10. package/public/rjbuild/docs/core/action/MessageListener.md +4 -4
  11. package/public/rjbuild/docs/core/action/MessageListener.yaml +18 -6
  12. package/public/rjbuild/docs/core/action/ReactOnEvent.md +4 -4
  13. package/public/rjbuild/docs/core/action/ReactOnEvent.yaml +4 -4
  14. package/public/rjbuild/docs/core/action/Redirect.md +2 -2
  15. package/public/rjbuild/docs/core/action/Redirect.yaml +8 -2
  16. package/public/rjbuild/docs/core/action/VisuallyHide.md +2 -2
  17. package/public/rjbuild/docs/core/action/VisuallyHide.yaml +2 -2
  18. package/public/rjbuild/docs/core/dataMapping/simpleMapping.md +5 -5
  19. package/public/rjbuild/docs/core/dataMapping/simpleMapping.yaml +90 -60
  20. package/public/rjbuild/docs/core/element/debug/VariablesDebug.md +59 -0
  21. package/public/rjbuild/docs/core/element/debug/VariablesDebug.yaml +71 -0
  22. package/public/rjbuild/docs/core/element/form/Input.md +307 -0
  23. package/public/rjbuild/docs/core/element/form/Input.yaml +572 -0
  24. package/public/rjbuild/docs/core/element/html/FolderSortableTree.yaml +40 -12
  25. package/public/rjbuild/docs/core/element/html/FormatNumeral.yaml +21 -7
  26. package/public/rjbuild/docs/core/element/html/Html.yaml +26 -9
  27. package/public/rjbuild/docs/core/element/html/LabelFromValue.yaml +25 -8
  28. package/public/rjbuild/docs/core/element/html/PreformattedMarkup.yaml +23 -7
  29. package/public/rjbuild/docs/core/element/html/SortableTreeItemCollapseButton.yaml +7 -6
  30. package/public/rjbuild/docs/core/element/html/SyntaxHighlighter.yaml +56 -20
  31. package/public/rjbuild/docs/core/element/special/Count.md +8 -10
  32. package/public/rjbuild/docs/core/element/special/Count.yaml +121 -40
  33. package/public/rjbuild/docs/core/element/special/DataFilter.md +40 -41
  34. package/public/rjbuild/docs/core/element/special/DataFilter.yaml +197 -81
  35. package/public/rjbuild/docs/core/element/special/DelayedActions.md +13 -15
  36. package/public/rjbuild/docs/core/element/special/DelayedActions.yaml +32 -13
  37. package/public/rjbuild/docs/core/element/special/PageControls.md +8 -10
  38. package/public/rjbuild/docs/core/element/special/PageControls.yaml +9 -8
  39. package/public/rjbuild/docs/core/element/special/Phantom.md +9 -11
  40. package/public/rjbuild/docs/core/element/special/Phantom.yaml +22 -9
  41. package/public/rjbuild/docs/core/element/special/ReactiveJsonSubroot.md +7 -9
  42. package/public/rjbuild/docs/core/element/special/ReactiveJsonSubroot.yaml +167 -49
  43. package/public/rjbuild/docs/core/element/special/Switch.md +36 -38
  44. package/public/rjbuild/docs/core/element/special/Switch.yaml +68 -40
  45. package/public/rjbuild/docs/core/example/html.md +2 -2
  46. package/public/rjbuild/docs/core/example/html.yaml +2 -3
  47. package/public/rjbuild/docs/core/example/native-html-forms.md +245 -0
  48. package/public/rjbuild/docs/core/example/native-html-forms.yaml +393 -0
  49. package/public/rjbuild/docs/core/reaction/addData.md +17 -5
  50. package/public/rjbuild/docs/core/reaction/addData.yaml +70 -11
  51. package/public/rjbuild/docs/core/reaction/fetchData.md +1 -2
  52. package/public/rjbuild/docs/core/reaction/fetchData.yaml +84 -19
  53. package/public/rjbuild/docs/core/reaction/moveData.md +0 -4
  54. package/public/rjbuild/docs/core/reaction/moveData.yaml +28 -6
  55. package/public/rjbuild/docs/core/reaction/postMessage.md +0 -4
  56. package/public/rjbuild/docs/core/reaction/postMessage.yaml +29 -6
  57. package/public/rjbuild/docs/core/reaction/redirectNow.md +0 -4
  58. package/public/rjbuild/docs/core/reaction/redirectNow.yaml +10 -3
  59. package/public/rjbuild/docs/core/reaction/removeData.md +2 -6
  60. package/public/rjbuild/docs/core/reaction/removeData.yaml +40 -2
  61. package/public/rjbuild/docs/core/reaction/setClipboardData.md +0 -4
  62. package/public/rjbuild/docs/core/reaction/setClipboardData.yaml +10 -3
  63. package/public/rjbuild/docs/core/reaction/setData.md +18 -8
  64. package/public/rjbuild/docs/core/reaction/setData.yaml +43 -11
  65. package/public/rjbuild/docs/core/reaction/submitData.md +2 -3
  66. package/public/rjbuild/docs/core/reaction/submitData.yaml +43 -7
  67. package/public/rjbuild/docs/core/reaction/triggerEvent.md +0 -4
  68. package/public/rjbuild/docs/core/reaction/triggerEvent.yaml +25 -11
  69. package/public/rjbuild/docs/docs-components/Mermaid.md +254 -0
  70. package/public/rjbuild/docs/docs-components/Mermaid.yaml +339 -0
  71. package/public/rjbuild/docs/docs-components/index.yaml +1 -0
  72. package/public/rjbuild/docs/getting-started/actions.md +1 -1
  73. package/public/rjbuild/docs/index.yaml +2 -1
  74. package/public/rjbuild/docs/install.md +26 -29
  75. package/public/rjbuild/docs/install.yaml +4 -10
  76. package/public/rjbuild/docs/integration/bootstrap/action/Popover.md +26 -0
  77. package/public/rjbuild/docs/{core → integration/bootstrap}/action/Popover.yaml +28 -5
  78. package/public/rjbuild/docs/{core → integration/bootstrap}/action/Tooltip.md +4 -4
  79. package/public/rjbuild/docs/{core → integration/bootstrap}/action/Tooltip.yaml +16 -3
  80. package/public/rjbuild/docs/{core → integration/bootstrap}/element/form/CheckBoxField.md +8 -8
  81. package/public/rjbuild/docs/{core → integration/bootstrap}/element/form/CheckBoxField.yaml +40 -8
  82. package/public/rjbuild/docs/{core → integration/bootstrap}/element/form/DateField.md +5 -5
  83. package/public/rjbuild/docs/{core → integration/bootstrap}/element/form/DateField.yaml +27 -5
  84. package/public/rjbuild/docs/{core → integration/bootstrap}/element/form/NumberField.md +7 -7
  85. package/public/rjbuild/docs/{core → integration/bootstrap}/element/form/NumberField.yaml +32 -7
  86. package/public/rjbuild/docs/{core → integration/bootstrap}/element/form/SelectField.md +9 -9
  87. package/public/rjbuild/docs/{core → integration/bootstrap}/element/form/SelectField.yaml +46 -9
  88. package/public/rjbuild/docs/{core → integration/bootstrap}/element/form/TextAreaField.md +8 -8
  89. package/public/rjbuild/docs/{core → integration/bootstrap}/element/form/TextAreaField.yaml +36 -8
  90. package/public/rjbuild/docs/{core → integration/bootstrap}/element/form/TextField.md +8 -8
  91. package/public/rjbuild/docs/{core → integration/bootstrap}/element/form/TextField.yaml +38 -8
  92. package/public/rjbuild/docs/{core → integration/bootstrap}/element/form/formElementsCommon.md +2 -4
  93. package/public/rjbuild/docs/{core → integration/bootstrap}/element/form/index.md +0 -2
  94. package/public/rjbuild/docs/integration/bootstrap/element/html/AccordionItem.md +69 -0
  95. package/public/rjbuild/docs/{core → integration/bootstrap}/element/html/AccordionItem.yaml +19 -7
  96. package/public/rjbuild/docs/integration/bootstrap/element/html/Modal.md +127 -0
  97. package/public/rjbuild/docs/{core → integration/bootstrap}/element/html/Modal.yaml +35 -12
  98. package/public/rjbuild/docs/integration/bootstrap/element/html/Tabs.md +150 -0
  99. package/public/rjbuild/docs/{core → integration/bootstrap}/element/html/Tabs.yaml +24 -15
  100. package/public/rjbuild/docs/integration/bootstrap/element/html/index.md +13 -0
  101. package/public/rjbuild/docs/{core → integration/bootstrap}/element/special/BootstrapElement.md +4 -6
  102. package/public/rjbuild/docs/integration/bootstrap/element/special/BootstrapElement.yaml +29 -0
  103. package/public/rjbuild/docs/integration/bootstrap/element/special/index.md +19 -0
  104. package/public/rjbuild/docs/integration/bootstrap/example/website.md +41 -0
  105. package/public/rjbuild/docs/integration/bootstrap/overview.md +69 -0
  106. package/public/rjbuild/docs/integration/bootstrap/overview.yaml +87 -0
  107. package/public/rjbuild/docs/core/action/Popover.md +0 -26
  108. package/public/rjbuild/docs/core/element/special/BootstrapElement.yaml +0 -18
  109. /package/public/rjbuild/docs/{core → integration/bootstrap}/element/form/index.yaml +0 -0
  110. /package/public/rjbuild/docs/{core → integration/bootstrap}/example/accordion.md +0 -0
  111. /package/public/rjbuild/docs/{core → integration/bootstrap}/example/accordion.yaml +0 -0
  112. /package/public/rjbuild/docs/{core → integration/bootstrap}/example/dynamic-content.md +0 -0
  113. /package/public/rjbuild/docs/{core → integration/bootstrap}/example/dynamic-content.yaml +0 -0
  114. /package/public/rjbuild/docs/{core → integration/bootstrap}/example/website.yaml +0 -0
  115. /package/public/rjbuild/docs/{chartjs → integration/chartjs}/components.yaml +0 -0
  116. /package/public/rjbuild/docs/{chartjs → integration/chartjs}/overview.yaml +0 -0
@@ -1,7 +1,5 @@
1
1
  # ReactiveJsonSubroot
2
2
 
3
- ## Introduction
4
-
5
3
  The `ReactiveJsonSubroot` component allows you to render a new Reactive-JSON root inside an existing application. It is useful for embedding a sub-application, isolating a part of the data tree, or rendering a separate rjbuild with its own options.
6
4
 
7
5
  With the `sharedUpdates` feature, the component can also propagate data changes back to the parent, enabling seamless communication between parent and subroot when working with shared data references.
@@ -60,15 +58,15 @@ When `sharedUpdates: true` is enabled, the component automatically detects templ
60
58
 
61
59
  ### Supported vs Unsupported Cases
62
60
 
63
- #### Supported cases
61
+ #### Supported cases
64
62
 
65
- ##### 1. Direct reference
63
+ ##### Direct reference
66
64
  ```yaml
67
65
  dataOverride: ~~.user
68
66
  # Modifications in the subroot propagate to "user" in the parent
69
67
  ```
70
68
 
71
- ##### 2. Object mapping with references
69
+ ##### Object mapping with references
72
70
  ```yaml
73
71
  dataOverride:
74
72
  userInfo: ~~.user
@@ -77,19 +75,19 @@ dataOverride:
77
75
  # Modifications to "settings" propagate to "config" in the parent
78
76
  ```
79
77
 
80
- ##### 3. Local references
78
+ ##### Local references
81
79
  ```yaml
82
80
  dataOverride: ~.localData
83
81
  # Modifications propagate to the local template context
84
82
  ```
85
83
 
86
- ##### 4. Hierarchical references
84
+ ##### Hierarchical references
87
85
  ```yaml
88
86
  dataOverride: ~>key.someData
89
87
  # Modifications propagate up the template hierarchy
90
88
  ```
91
89
 
92
- ##### 5. Arrays in dataOverride
90
+ ##### Arrays in dataOverride
93
91
  ```yaml
94
92
  dataOverride:
95
93
  - ~~.firstItem
@@ -97,7 +95,7 @@ dataOverride:
97
95
  # Array items with template references are properly handled
98
96
  ```
99
97
 
100
- #### Unsupported cases
98
+ #### Unsupported cases
101
99
 
102
100
  ##### Nested references in data
103
101
  ```yaml
@@ -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
- 4. **Flexibility**: Supports different referencing patterns (~~., ~., ~>) and arrays containing references
148
+ 4. **Flexibility**: Supports different referencing patterns (~~., ~., ~>) and arrays containing references
149
149
 
150
150
  ### Supported vs Unsupported Cases
151
151
 
152
- #### Supported cases
152
+ #### Supported cases
153
153
 
154
- ##### 1. Direct reference
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
- ##### 2. Object mapping with references
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
- ##### 3. Local references
169
+ ##### Local references
170
170
  ```yaml
171
171
  dataOverride: ~.localData
172
172
  # Modifications propagate to the local template context
173
173
  ```
174
174
 
175
- ##### 4. Hierarchical references
175
+ ##### Hierarchical references
176
176
  ```yaml
177
177
  dataOverride: ~>key.someData
178
178
  # Modifications propagate up the template hierarchy
179
179
  ```
180
180
 
181
- ##### 5. Arrays in dataOverride
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
- #### Unsupported cases
189
+ #### Unsupported cases
190
190
 
191
191
  ##### Nested references in data
192
192
  ```yaml
@@ -212,7 +212,7 @@ renderView:
212
212
  renderView:
213
213
  - type: ReactiveJsonSubroot
214
214
  rjOptions:
215
- maybeRawAppRjBuild: '{"data":{"userName":"Alice","messageCount":3},"renderView":[{"type":"div","attributes":{"style":{"padding":"1rem","border":"1px solid #ddd","borderRadius":"8px","backgroundColor":"#f9f9f9"}},"content":[{"type":"h3","content":"~~.userName"},{"type":"p","content":["You have ","~~.messageCount"," new messages."]},{"type":"button","content":"Mark as read","attributes":{"style":{"backgroundColor":"#007bff","color":"white","border":"none","padding":"0.5rem 1rem","borderRadius":"4px"}}}]}]}'
215
+ maybeRawAppRjBuild: '{"data":{"userName":"Alice","messageCount":3},"renderView":[{"type":"div","attributes":{"style":{"padding":"1rem","border":"1px solid #ddd","borderRadius":"8px"}},"content":[{"type":"h3","content":"~~.userName"},{"type":"p","content":["You have ","~~.messageCount"," new messages."]},{"type":"button","content":"Mark as read","attributes":{"style":{"border":"1px solid #007bff","padding":"0.5rem 1rem","borderRadius":"4px"}}}]}]}'
216
216
 
217
217
  - type: hr
218
218
 
@@ -240,7 +240,7 @@ renderView:
240
240
  padding: "1rem"
241
241
  border: "2px solid #007bff"
242
242
  borderRadius: "8px"
243
- backgroundColor: "#f8f9fa"
243
+
244
244
  marginBottom: "1rem"
245
245
  content:
246
246
  - type: h4
@@ -262,16 +262,34 @@ renderView:
262
262
  padding: "1rem"
263
263
  border: "2px solid #28a745"
264
264
  borderRadius: "8px"
265
- backgroundColor: "#e8f5e9"
265
+
266
266
  content:
267
267
  - type: h4
268
268
  content: "Subroot Editor (with sharedUpdates)"
269
- - type: TextField
270
- label: "Name"
271
- dataLocation: ~.name
272
- - type: TextField
273
- label: "Email"
274
- dataLocation: ~.email
269
+ - type: label
270
+ content: "Name"
271
+ - type: input
272
+ attributes:
273
+ type: text
274
+ value: ~.name
275
+ placeholder: "Name"
276
+ actions:
277
+ - what: setData
278
+ on: change
279
+ path: ~.name
280
+ value: "<reactive-json:event-new-value>"
281
+ - type: label
282
+ content: "Email"
283
+ - type: input
284
+ attributes:
285
+ type: email
286
+ value: ~.email
287
+ placeholder: "Email"
288
+ actions:
289
+ - what: setData
290
+ on: change
291
+ path: ~.email
292
+ value: "<reactive-json:event-new-value>"
275
293
  - type: p
276
294
  attributes:
277
295
  style:
@@ -306,7 +324,7 @@ renderView:
306
324
  padding: "1rem"
307
325
  border: "1px solid #ddd"
308
326
  borderRadius: "4px"
309
- backgroundColor: "#f5f5f5"
327
+
310
328
  content:
311
329
  - type: h5
312
330
  content: "Profile Data"
@@ -320,7 +338,7 @@ renderView:
320
338
  padding: "1rem"
321
339
  border: "1px solid #ddd"
322
340
  borderRadius: "4px"
323
- backgroundColor: "#f5f5f5"
341
+
324
342
  content:
325
343
  - type: h5
326
344
  content: "Settings Data"
@@ -346,28 +364,64 @@ renderView:
346
364
  padding: "1rem"
347
365
  border: "2px solid #17a2b8"
348
366
  borderRadius: "8px"
349
- backgroundColor: "#e3f2fd"
367
+
350
368
  content:
351
369
  - type: div
352
370
  content:
353
371
  - type: h5
354
372
  content: "Edit Profile"
355
- - type: TextField
356
- label: "Name"
357
- dataLocation: ~.userProfile.name
358
- - type: NumberField
359
- label: "Age"
360
- dataLocation: ~.userProfile.age
373
+ - type: label
374
+ content: "Name"
375
+ - type: input
376
+ attributes:
377
+ type: text
378
+ value: ~.userProfile.name
379
+ placeholder: "Name"
380
+ actions:
381
+ - what: setData
382
+ on: change
383
+ path: ~.userProfile.name
384
+ value: "<reactive-json:event-new-value>"
385
+ - type: label
386
+ content: "Age"
387
+ - type: input
388
+ attributes:
389
+ type: number
390
+ value: ~.userProfile.age
391
+ placeholder: "Age"
392
+ actions:
393
+ - what: setData
394
+ on: change
395
+ path: ~.userProfile.age
396
+ value: "<reactive-json:event-new-value>"
361
397
  - type: div
362
398
  content:
363
399
  - type: h5
364
400
  content: "Edit Settings"
365
- - type: TextField
366
- label: "Theme"
367
- dataLocation: ~.userSettings.theme
368
- - type: TextField
369
- label: "Language"
370
- dataLocation: ~.userSettings.language
401
+ - type: label
402
+ content: "Theme"
403
+ - type: input
404
+ attributes:
405
+ type: text
406
+ value: ~.userSettings.theme
407
+ placeholder: "Theme"
408
+ actions:
409
+ - what: setData
410
+ on: change
411
+ path: ~.userSettings.theme
412
+ value: "<reactive-json:event-new-value>"
413
+ - type: label
414
+ content: "Language"
415
+ - type: input
416
+ attributes:
417
+ type: text
418
+ value: ~.userSettings.language
419
+ placeholder: "Language"
420
+ actions:
421
+ - what: setData
422
+ on: change
423
+ path: ~.userSettings.language
424
+ value: "<reactive-json:event-new-value>"
371
425
 
372
426
  - type: RjBuildDescriber
373
427
  title: Example with Array References
@@ -386,15 +440,46 @@ renderView:
386
440
  padding: "1rem"
387
441
  border: "1px solid #ddd"
388
442
  borderRadius: "4px"
389
- backgroundColor: "#f9f9f9"
390
443
  marginBottom: "1rem"
391
444
  content:
392
445
  - type: h4
393
446
  content: "Parent Items Display"
394
447
  - type: p
395
- content: ["Item 1: ", ~~.items.0.title, " (", ~~.items.0.completed, ")"]
396
- - type: p
397
- content: ["Item 2: ", ~~.items.1.title, " (", ~~.items.1.completed, ")"]
448
+ content:
449
+ - "Item 1: "
450
+ - ~~.items.0.title
451
+ - " (completed: "
452
+ - type: span
453
+ content: "Yes"
454
+ actions:
455
+ - what: hide
456
+ when: ~~.items.0.completed
457
+ is: false
458
+ - type: span
459
+ content: "No"
460
+ actions:
461
+ - what: hide
462
+ when: ~~.items.0.completed
463
+ is: true
464
+ - ")"
465
+ - type: p
466
+ content:
467
+ - "Item 2: "
468
+ - ~~.items.1.title
469
+ - " (completed: "
470
+ - type: span
471
+ content: "Yes"
472
+ actions:
473
+ - what: hide
474
+ when: ~~.items.1.completed
475
+ is: false
476
+ - type: span
477
+ content: "No"
478
+ actions:
479
+ - what: hide
480
+ when: ~~.items.1.completed
481
+ is: true
482
+ - ")"
398
483
 
399
484
  - type: ReactiveJsonSubroot
400
485
  sharedUpdates: true
@@ -410,7 +495,6 @@ renderView:
410
495
  padding: "1rem"
411
496
  border: "2px solid #ffc107"
412
497
  borderRadius: "8px"
413
- backgroundColor: "#fff3cd"
414
498
  content:
415
499
  - type: h4
416
500
  content: "Array Items Editor"
@@ -418,22 +502,56 @@ renderView:
418
502
  content:
419
503
  - type: h5
420
504
  content: "First Item"
421
- - type: TextField
422
- label: "Title"
423
- dataLocation: ~.0.title
424
- - type: CheckBoxField
425
- label: "Completed"
426
- dataLocation: ~.0.completed
505
+ - type: label
506
+ content: "Title"
507
+ - type: input
508
+ attributes:
509
+ type: text
510
+ value: ~.0.title
511
+ placeholder: "Title"
512
+ actions:
513
+ - what: setData
514
+ on: change
515
+ path: ~.0.title
516
+ value: "<reactive-json:event-new-value>"
517
+ - type: label
518
+ content: "Completed"
519
+ - type: input
520
+ attributes:
521
+ type: checkbox
522
+ checked: ~.0.completed
523
+ actions:
524
+ - what: setData
525
+ on: change
526
+ path: ~.0.completed
527
+ value: "<reactive-json:event-new-value>"
427
528
  - type: div
428
529
  content:
429
530
  - type: h5
430
531
  content: "Second Item"
431
- - type: TextField
432
- label: "Title"
433
- dataLocation: ~.1.title
434
- - type: CheckBoxField
435
- label: "Completed"
436
- dataLocation: ~.1.completed
532
+ - type: label
533
+ content: "Title"
534
+ - type: input
535
+ attributes:
536
+ type: text
537
+ value: ~.1.title
538
+ placeholder: "Title"
539
+ actions:
540
+ - what: setData
541
+ on: change
542
+ path: ~.1.title
543
+ value: "<reactive-json:event-new-value>"
544
+ - type: label
545
+ content: "Completed"
546
+ - type: input
547
+ attributes:
548
+ type: checkbox
549
+ checked: ~.1.completed
550
+ actions:
551
+ - what: setData
552
+ on: change
553
+ path: ~.1.completed
554
+ value: "<reactive-json:event-new-value>"
437
555
 
438
556
  - type: Markdown
439
557
  content: |
@@ -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
- ### 1. Simple usage with `singleOption` (no pagination)
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
- ### 2. Usage with `options` (different templates per key)
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
- ### 3. Usage with `singleOption`, pagination, before/after, and PageControls
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
- ### 4. Usage with `contentWrapper` for CSS Grid Layout
128
+ ### Usage with `contentWrapper` for CSS Grid Layout
131
129
  ```yaml
132
130
  renderView:
133
131
  - type: Switch
@@ -150,7 +148,7 @@ renderView:
150
148
  type: div
151
149
  attributes:
152
150
  style:
153
- border: "1px solid #ccc"
151
+ border: "1px solid currentColor"
154
152
  borderRadius: 8px
155
153
  padding: 1rem
156
154
  content:
@@ -168,7 +166,7 @@ data:
168
166
  description: "Description of product C"
169
167
  ```
170
168
 
171
- ### 5. Usage with `contentWrapper` for Flexbox Layout
169
+ ### Usage with `contentWrapper` for Flexbox Layout
172
170
  ```yaml
173
171
  renderView:
174
172
  - type: Switch
@@ -192,7 +190,7 @@ renderView:
192
190
  flex: "1 1 200px"
193
191
  margin: 0.5rem
194
192
  padding: 1rem
195
- backgroundColor: "#f0f0f0"
193
+ border: "1px solid currentColor"
196
194
  content: ~.text
197
195
  data:
198
196
  items:
@@ -201,7 +199,7 @@ data:
201
199
  - text: "Item 3"
202
200
  ```
203
201
 
204
- ### 6. Dynamic `contentWrapper` with Template Evaluation
202
+ ### Dynamic `contentWrapper` with Template Evaluation
205
203
  ```yaml
206
204
  renderView:
207
205
  - type: Switch
@@ -216,21 +214,21 @@ renderView:
216
214
  display: grid
217
215
  gridTemplateColumns: ~.gridColumns
218
216
  gap: ~.spacing
219
- backgroundColor: ~.theme.backgroundColor
217
+ border: ~.theme.border
220
218
  templates:
221
219
  imageItem:
222
220
  type: div
223
221
  attributes:
224
222
  style:
225
223
  padding: 1rem
226
- border: "1px solid #ddd"
224
+ border: "1px solid currentColor"
227
225
  content: ~.title
228
226
  data:
229
227
  layoutClass: "photo-gallery"
230
228
  gridColumns: "repeat(3, 1fr)"
231
229
  spacing: "2rem"
232
230
  theme:
233
- backgroundColor: "#f5f5f5"
231
+ border: "1px solid currentColor"
234
232
  galleries:
235
233
  - title: "Photo 1"
236
234
  - title: "Photo 2"
@@ -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: