@ea-lab/reactive-json-docs 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/README-npm.md +49 -0
  2. package/README.md +86 -0
  3. package/package.json +79 -0
  4. package/public/rjbuild/component-doc/chartjs/components.yaml +252 -0
  5. package/public/rjbuild/component-doc/chartjs/overview.yaml +51 -0
  6. package/public/rjbuild/component-doc/core/action/HashChangeListener.md +90 -0
  7. package/public/rjbuild/component-doc/core/action/HashChangeListener.yaml +124 -0
  8. package/public/rjbuild/component-doc/core/action/Hide.md +22 -0
  9. package/public/rjbuild/component-doc/core/action/Hide.yaml +60 -0
  10. package/public/rjbuild/component-doc/core/action/MessageListener.md +93 -0
  11. package/public/rjbuild/component-doc/core/action/MessageListener.yaml +153 -0
  12. package/public/rjbuild/component-doc/core/action/Popover.md +26 -0
  13. package/public/rjbuild/component-doc/core/action/Popover.yaml +100 -0
  14. package/public/rjbuild/component-doc/core/action/ReactOnEvent.md +81 -0
  15. package/public/rjbuild/component-doc/core/action/ReactOnEvent.yaml +133 -0
  16. package/public/rjbuild/component-doc/core/action/Redirect.md +20 -0
  17. package/public/rjbuild/component-doc/core/action/Redirect.yaml +68 -0
  18. package/public/rjbuild/component-doc/core/action/Tooltip.md +22 -0
  19. package/public/rjbuild/component-doc/core/action/Tooltip.yaml +90 -0
  20. package/public/rjbuild/component-doc/core/action/VisuallyHide.md +21 -0
  21. package/public/rjbuild/component-doc/core/action/VisuallyHide.yaml +62 -0
  22. package/public/rjbuild/component-doc/core/action/index.md +214 -0
  23. package/public/rjbuild/component-doc/core/action/index.yaml +278 -0
  24. package/public/rjbuild/component-doc/core/element/form/CheckBoxField.md +276 -0
  25. package/public/rjbuild/component-doc/core/element/form/CheckBoxField.yaml +338 -0
  26. package/public/rjbuild/component-doc/core/element/form/DateField.md +189 -0
  27. package/public/rjbuild/component-doc/core/element/form/DateField.yaml +264 -0
  28. package/public/rjbuild/component-doc/core/element/form/NumberField.md +136 -0
  29. package/public/rjbuild/component-doc/core/element/form/NumberField.yaml +103 -0
  30. package/public/rjbuild/component-doc/core/element/form/SelectField.md +304 -0
  31. package/public/rjbuild/component-doc/core/element/form/SelectField.yaml +360 -0
  32. package/public/rjbuild/component-doc/core/element/form/TextAreaField.md +134 -0
  33. package/public/rjbuild/component-doc/core/element/form/TextAreaField.yaml +146 -0
  34. package/public/rjbuild/component-doc/core/element/form/TextField.md +129 -0
  35. package/public/rjbuild/component-doc/core/element/form/TextField.yaml +147 -0
  36. package/public/rjbuild/component-doc/core/element/form/formElementsCommon.md +106 -0
  37. package/public/rjbuild/component-doc/core/element/form/index.md +50 -0
  38. package/public/rjbuild/component-doc/core/element/form/index.yaml +96 -0
  39. package/public/rjbuild/component-doc/core/element/html/AccordionItem.yaml +47 -0
  40. package/public/rjbuild/component-doc/core/element/html/FolderSortableTree.yaml +81 -0
  41. package/public/rjbuild/component-doc/core/element/html/FormatNumeral.yaml +58 -0
  42. package/public/rjbuild/component-doc/core/element/html/Html.yaml +67 -0
  43. package/public/rjbuild/component-doc/core/element/html/LabelFromValue.yaml +54 -0
  44. package/public/rjbuild/component-doc/core/element/html/Modal.yaml +93 -0
  45. package/public/rjbuild/component-doc/core/element/html/PreformattedMarkup.yaml +37 -0
  46. package/public/rjbuild/component-doc/core/element/html/SortableTreeItemCollapseButton.yaml +92 -0
  47. package/public/rjbuild/component-doc/core/element/html/Tabs.yaml +57 -0
  48. package/public/rjbuild/component-doc/core/element/special/BootstrapElement.md +17 -0
  49. package/public/rjbuild/component-doc/core/element/special/BootstrapElement.yaml +18 -0
  50. package/public/rjbuild/component-doc/core/element/special/Count.md +37 -0
  51. package/public/rjbuild/component-doc/core/element/special/Count.yaml +325 -0
  52. package/public/rjbuild/component-doc/core/element/special/DataFilter.md +149 -0
  53. package/public/rjbuild/component-doc/core/element/special/DataFilter.yaml +315 -0
  54. package/public/rjbuild/component-doc/core/element/special/DelayedActions.md +51 -0
  55. package/public/rjbuild/component-doc/core/element/special/DelayedActions.yaml +55 -0
  56. package/public/rjbuild/component-doc/core/element/special/PageControls.md +126 -0
  57. package/public/rjbuild/component-doc/core/element/special/PageControls.yaml +133 -0
  58. package/public/rjbuild/component-doc/core/element/special/Phantom.md +31 -0
  59. package/public/rjbuild/component-doc/core/element/special/Phantom.yaml +34 -0
  60. package/public/rjbuild/component-doc/core/element/special/ReactiveJsonSubroot.md +27 -0
  61. package/public/rjbuild/component-doc/core/element/special/ReactiveJsonSubroot.yaml +51 -0
  62. package/public/rjbuild/component-doc/core/element/special/Switch.md +262 -0
  63. package/public/rjbuild/component-doc/core/element/special/Switch.yaml +348 -0
  64. package/public/rjbuild/component-doc/core/example/accordion.md +96 -0
  65. package/public/rjbuild/component-doc/core/example/accordion.yaml +64 -0
  66. package/public/rjbuild/component-doc/core/example/dynamic-content.md +197 -0
  67. package/public/rjbuild/component-doc/core/example/dynamic-content.yaml +237 -0
  68. package/public/rjbuild/component-doc/core/example/html.md +66 -0
  69. package/public/rjbuild/component-doc/core/example/html.yaml +83 -0
  70. package/public/rjbuild/component-doc/core/example/website.yaml +1663 -0
  71. package/public/rjbuild/component-doc/core/reaction/addData.md +96 -0
  72. package/public/rjbuild/component-doc/core/reaction/addData.yaml +133 -0
  73. package/public/rjbuild/component-doc/core/reaction/fetchData.md +60 -0
  74. package/public/rjbuild/component-doc/core/reaction/fetchData.yaml +156 -0
  75. package/public/rjbuild/component-doc/core/reaction/index.md +236 -0
  76. package/public/rjbuild/component-doc/core/reaction/index.yaml +254 -0
  77. package/public/rjbuild/component-doc/core/reaction/moveData.md +68 -0
  78. package/public/rjbuild/component-doc/core/reaction/moveData.yaml +71 -0
  79. package/public/rjbuild/component-doc/core/reaction/postMessage.md +63 -0
  80. package/public/rjbuild/component-doc/core/reaction/postMessage.yaml +68 -0
  81. package/public/rjbuild/component-doc/core/reaction/redirectNow.md +37 -0
  82. package/public/rjbuild/component-doc/core/reaction/redirectNow.yaml +37 -0
  83. package/public/rjbuild/component-doc/core/reaction/removeData.md +78 -0
  84. package/public/rjbuild/component-doc/core/reaction/removeData.yaml +56 -0
  85. package/public/rjbuild/component-doc/core/reaction/setClipboardData.md +44 -0
  86. package/public/rjbuild/component-doc/core/reaction/setClipboardData.yaml +41 -0
  87. package/public/rjbuild/component-doc/core/reaction/setData.md +93 -0
  88. package/public/rjbuild/component-doc/core/reaction/setData.yaml +85 -0
  89. package/public/rjbuild/component-doc/core/reaction/submitData.md +138 -0
  90. package/public/rjbuild/component-doc/core/reaction/submitData.yaml +141 -0
  91. package/public/rjbuild/component-doc/core/reaction/triggerEvent.md +59 -0
  92. package/public/rjbuild/component-doc/core/reaction/triggerEvent.yaml +59 -0
  93. package/public/rjbuild/component-doc/index.yaml +13 -0
@@ -0,0 +1,50 @@
1
+ # Form Elements
2
+
3
+ ## Introduction
4
+
5
+ Form elements in Reactive-JSON provide interactive input components based on React Bootstrap. These components automatically manage state through the global data context and support template evaluation for dynamic content.
6
+
7
+ All form elements support:
8
+ - Dynamic data binding via `dataLocation` or automatic field naming
9
+ - Template evaluation for labels, placeholders, and options
10
+ - Action system integration for conditional logic
11
+ - React Bootstrap styling and attributes
12
+ - Automatic state synchronization with the global data context
13
+
14
+ ## Available Components
15
+
16
+ - **TextField**: Single-line text input with customizable input types
17
+ - **NumberField**: Numeric input field with number-specific validation
18
+ - **TextAreaField**: Multi-line text input with configurable rows
19
+ - **SelectField**: Dropdown selection with static or dynamic options
20
+ - **CheckBoxField**: Checkbox/radio button groups with multiple selection modes
21
+ - **DateField**: Date and datetime input field (limited support)
22
+
23
+ ## Common Properties
24
+
25
+ All form components share these common properties:
26
+
27
+ - `dataLocation` (string, optional): Path to bind the field value in the data context
28
+ - `defaultFieldValue` (any, optional): Default value when no data is present
29
+ - `label` (string, optional): Field label text (supports template evaluation)
30
+ - `attributes` (object, optional): Attributes applied to the Form.Group container
31
+ - `inputAttributes` (object, optional): Attributes applied directly to the input element
32
+ - `actions` (array, optional): Actions to execute based on field state
33
+
34
+ ## Data Management
35
+
36
+ Form elements use two approaches for data management:
37
+
38
+ 1. **Explicit data location**: Use `dataLocation` to specify exact path in global data
39
+ 2. **Automatic field naming**: Use the component's `datafield` parameter for template-scoped data
40
+
41
+ The data is automatically synchronized with the global data context on user input changes.
42
+
43
+ ## Limitations
44
+
45
+ - No built-in form validation beyond basic HTML5 validation
46
+ - No support for file upload inputs
47
+ - Limited date field support (only datetime-local type)
48
+ - No built-in error handling or validation messages
49
+ - No support for complex nested form structures
50
+ - No automatic form submission handling
@@ -0,0 +1,96 @@
1
+ renderView:
2
+ - type: Markdown
3
+ content: |
4
+ # Form Elements
5
+
6
+ Interactive demonstration of Reactive-JSON form components with real-time data binding.
7
+
8
+ - type: RjBuildDescriber
9
+ title: "Complete Form Example"
10
+ description: "All form components working together with data binding"
11
+ toDescribe:
12
+ renderView:
13
+ - type: div
14
+ attributes:
15
+ style:
16
+ display: grid
17
+ gridTemplateColumns: "1fr 1fr"
18
+ gap: "20px"
19
+ content:
20
+ - type: div
21
+ content:
22
+ - type: TextField
23
+ dataLocation: ~.name
24
+ label: "Full Name:"
25
+ placeholder: "Enter your full name"
26
+ - type: NumberField
27
+ dataLocation: ~.age
28
+ label: "Age:"
29
+ placeholder: "Enter your age"
30
+ - type: SelectField
31
+ dataLocation: ~.country
32
+ label: "Country:"
33
+ options:
34
+ - label: "Select a country"
35
+ value: ""
36
+ - label: "France"
37
+ value: "fr"
38
+ - label: "United States"
39
+ value: "us"
40
+ - label: "Canada"
41
+ value: "ca"
42
+ - type: CheckBoxField
43
+ dataLocation: ~.interests
44
+ label: "Interests:"
45
+ options:
46
+ - label: "Technology"
47
+ value: "tech"
48
+ - label: "Sports"
49
+ value: "sports"
50
+ - label: "Music"
51
+ value: "music"
52
+ - type: TextAreaField
53
+ dataLocation: ~.comments
54
+ label: "Comments:"
55
+ placeholder: "Additional comments..."
56
+ rows: 4
57
+ - type: div
58
+ content:
59
+ - type: strong
60
+ content: "Live Data Preview:"
61
+ - type: PreformattedMarkup
62
+ content: ["<pre>", ~.formData, "</pre>"]
63
+ actions:
64
+ - what: setData
65
+ when: ~.formData
66
+ is: undefined
67
+ key: formData
68
+ value: "{}"
69
+ - type: div
70
+ content:
71
+ - "Name: "
72
+ - ~.name
73
+ - type: div
74
+ content:
75
+ - "Age: "
76
+ - ~.age
77
+ - type: div
78
+ content:
79
+ - "Country: "
80
+ - ~.country
81
+ - type: div
82
+ content: "Interests selected in checkbox above"
83
+ - type: div
84
+ content:
85
+ - "Comments: "
86
+ - ~.comments
87
+ data:
88
+ name: ""
89
+ age: ""
90
+ country: ""
91
+ interests: []
92
+ comments: ""
93
+ formData: ""
94
+
95
+ templates: {}
96
+ data: {}
@@ -0,0 +1,47 @@
1
+ renderView:
2
+ - type: Markdown
3
+ content: |
4
+ # AccordionItem
5
+
6
+ The `AccordionItem` component is used inside a parent `BsAccordion` component. This parent is a React-Bootstrap Accordion adapted for Reactive-JSON, supporting templates and actions via the `BootstrapElement` system.
7
+
8
+ **Important:** `AccordionItem` must be a direct child of `BsAccordion`.
9
+
10
+ ## Properties
11
+ - `header` (object, optional): Content for the accordion header
12
+ - `body` (object, optional): Content for the accordion body
13
+ - `attributes` (object, optional): Additional attributes for the Accordion.Item
14
+
15
+ - type: RjBuildDescriber
16
+ title: "Interactive Example: Accordion with multiple sections"
17
+ description:
18
+ - type: Markdown
19
+ content: |
20
+ Click the headers to expand/collapse each section. Each section is an AccordionItem with its own header and body. The parent BsAccordion supports templates and actions.
21
+ toDescribe:
22
+ renderView:
23
+ - type: BsAccordion
24
+ content:
25
+ - type: AccordionItem
26
+ header: General Info
27
+ body:
28
+ type: Markdown
29
+ content: "This section contains general information."
30
+ - type: AccordionItem
31
+ header:
32
+ type: div
33
+ content:
34
+ - type: strong
35
+ content: Important!
36
+ - " Details"
37
+ body:
38
+ type: Markdown
39
+ content: "This section contains more details."
40
+
41
+ - type: Markdown
42
+ content: |
43
+ ## Limitations
44
+ - Only works inside a parent BsAccordion component
45
+ - No built-in support for nested accordions
46
+ - The eventKey is set automatically; custom keys are not supported directly
47
+ - No animation customization beyond what react-bootstrap provides
@@ -0,0 +1,81 @@
1
+ renderView:
2
+ - type: Markdown
3
+ content: |
4
+ # FolderSortableTree
5
+
6
+ The `FolderSortableTree` component displays a drag-and-drop tree for hierarchical data. Each node is rendered using a template, and the structure is fully editable by the user.
7
+
8
+ This component is based on the [dnd-kit-sortable-tree](https://github.com/shaddix/dnd-kit-sortable-tree) library. For advanced configuration and available options, see the library documentation.
9
+
10
+ **Note:** For each node, all properties to display in the template (like `name`, `age`, etc.) must be placed inside a `value` object. The itemTemplate only has access to the fields inside `value` for each node. Children are listed in the `children` array.
11
+
12
+ ## Properties
13
+ - `dataLocation` (string, required): Path to the tree data
14
+ - `itemTemplate` (object, required): Template for each tree item
15
+ - `maxDepth` (number, optional): Maximum allowed depth
16
+ - `maxDepthIsAbsolute` (boolean, optional): If true, maxDepth is absolute from the root (default: true)
17
+ - `treeRootPath` (string, optional): Path to a subtree to display as the root
18
+ - `keepBaseItem` (boolean, optional): If true, keeps the base item when using treeRootPath
19
+ - `sortableTreeOptions` (object, optional): Additional options for SortableTree
20
+
21
+ - type: RjBuildDescriber
22
+ title: "Interactive Example: Editable family tree"
23
+ description:
24
+ - type: Markdown
25
+ content: |
26
+ Drag and drop nodes to reorder or nest them. Each node is rendered using the template below, showing both name and age.
27
+ toDescribe:
28
+ renderView:
29
+ - type: FolderSortableTree
30
+ dataLocation: ~.tree
31
+ itemTemplate:
32
+ - type: div
33
+ content:
34
+ - type: strong
35
+ content: "Name: "
36
+ - ~.name
37
+ - ", "
38
+ - type: strong
39
+ content: "Age: "
40
+ - ~.age
41
+ data:
42
+ tree:
43
+ - id: 1
44
+ value:
45
+ name: "Alice (grandmother)"
46
+ age: 78
47
+ children:
48
+ - id: 2
49
+ value:
50
+ name: "Bob (son)"
51
+ age: 50
52
+ children:
53
+ - id: 4
54
+ value:
55
+ name: "Diana (granddaughter)"
56
+ age: 20
57
+ children: []
58
+ - id: 5
59
+ value:
60
+ name: "Eve (grandson)"
61
+ age: 18
62
+ children: []
63
+ - id: 3
64
+ value:
65
+ name: "Carol (daughter)"
66
+ age: 48
67
+ children:
68
+ - id: 6
69
+ value:
70
+ name: "Frank (grandson)"
71
+ age: 22
72
+ children: []
73
+
74
+ - type: Markdown
75
+ content: |
76
+ ## Limitations
77
+ - Tree data must be an array of objects with `id`, `children`, and `value` keys
78
+ - No built-in async loading of children
79
+ - No built-in search/filter UI
80
+ - Only one tree can be edited at a time per component instance
81
+ - No animation customization beyond what dnd-kit-sortable-tree provides
@@ -0,0 +1,58 @@
1
+ renderView:
2
+ - type: Markdown
3
+ content: |
4
+ # FormatNumeral
5
+
6
+ The `FormatNumeral` component displays a number as a Roman numeral or Latin letter. Useful for sections, lists, or any context where a non-Arabic numeral is needed.
7
+
8
+ ## Properties
9
+ - `content` (number, required): The number to format
10
+ - `format` (string, required): One of `roman-upper`, `roman-lower`, `latin-upper`, `latin-lower`
11
+ - `attributes` (object, optional): Additional attributes for the root element
12
+
13
+ - type: RjBuildDescriber
14
+ title: "Interactive Example: Format a number"
15
+ description:
16
+ - type: Markdown
17
+ content: |
18
+ Change the number and format to see the result. Only positive integers are supported.
19
+ toDescribe:
20
+ renderView:
21
+ - type: div
22
+ content:
23
+ - type: NumberField
24
+ label: "Number:"
25
+ dataLocation: ~.num
26
+ inputAttributes:
27
+ min: 1
28
+ max: 3999
29
+ - type: SelectField
30
+ label: "Format:"
31
+ dataLocation: ~.fmt
32
+ options:
33
+ - label: "Roman Upper (I, II, III)"
34
+ value: roman-upper
35
+ - label: "Roman Lower (i, ii, iii)"
36
+ value: roman-lower
37
+ - label: "Latin Upper (A, B, C)"
38
+ value: latin-upper
39
+ - label: "Latin Lower (a, b, c)"
40
+ value: latin-lower
41
+ - type: div
42
+ content:
43
+ - type: strong
44
+ content: "Result: "
45
+ - type: FormatNumeral
46
+ content: ~.num
47
+ format: ~.fmt
48
+ data:
49
+ num: 3
50
+ fmt: roman-upper
51
+
52
+ - type: Markdown
53
+ content: |
54
+ ## Limitations
55
+ - Only positive integers are supported (no zero, negative, or fractional numbers)
56
+ - No support for custom numeral systems
57
+ - No localization or language-specific formatting
58
+ - No error message for invalid input; nothing is rendered if the input is invalid
@@ -0,0 +1,67 @@
1
+ renderView:
2
+ - type: Markdown
3
+ content: |
4
+ # Html
5
+
6
+ The `Html` component renders any HTML tag with static attributes and content. Use it to create custom wrappers, sections, or inject arbitrary tags with full template support.
7
+
8
+ **Note:** The `tag` property must be a static string. It cannot be set dynamically via template or data.
9
+
10
+ ## Properties
11
+ - `tag` (string, required): The HTML tag to render (e.g., div, span, section)
12
+ - `attributes` (object, optional): Attributes for the tag (class, id, etc.)
13
+ - `content` (object/array, optional): Content to render inside the tag (any Reactive-JSON view or array)
14
+ - `extra` (object, optional): Additional content rendered after the main tag
15
+
16
+ - type: BsAlert
17
+ attributes:
18
+ variant: info
19
+ content:
20
+ - "In most cases, you do not need to use the Html component directly. It is more convenient to use 'type: tagName' (e.g., 'type: div', 'type: span') instead of 'type: Html, tag: tagName'. The Html component is used internally by the engine as a fallback when no specific component is found for a given type."
21
+
22
+ - type: RjBuildDescriber
23
+ title: "Interactive Example: Custom HTML tag (static tag only)"
24
+ description:
25
+ - type: Markdown
26
+ content: |
27
+ Change the priority and content to see how the Html component renders dynamic HTML.
28
+ toDescribe:
29
+ renderView:
30
+ - type: div
31
+ content:
32
+ - type: SelectField
33
+ dataLocation: ~.class
34
+ label: "Priority:"
35
+ options:
36
+ - label: "Normal"
37
+ value: ""
38
+ - label: "Important (blue)"
39
+ value: "text-primary"
40
+ - label: "Warning (orange)"
41
+ value: "text-warning"
42
+ - label: "Critical (red)"
43
+ value: "text-danger"
44
+ - type: TextField
45
+ dataLocation: ~.txt
46
+ label: "Content"
47
+ - type: div
48
+ content:
49
+ type: strong
50
+ content: "Rendered:"
51
+ - type: Html
52
+ tag: div
53
+ attributes:
54
+ class: ~.class
55
+ content: ~.txt
56
+ data:
57
+ class: ""
58
+ txt: Hello world!
59
+
60
+ - type: Markdown
61
+ content: |
62
+ ## Limitations
63
+ - The `tag` property does not support template evaluation and must be a static string
64
+ - No validation of tag names; invalid tags may cause rendering errors
65
+ - No support for dangerouslySetInnerHTML (use PreformattedMarkup for raw HTML)
66
+ - No built-in support for event handlers (use actions system for interactivity)
67
+ - No automatic support for custom attributes beyond React's attribute normalization
@@ -0,0 +1,54 @@
1
+ renderView:
2
+ - type: Markdown
3
+ content: |
4
+ # LabelFromValue
5
+
6
+ The `LabelFromValue` component displays the label associated with a value, using an option-like structure. It is useful for showing the display label of a value selected in a SelectField or any value/label mapping.
7
+
8
+ ## Properties
9
+ - `dataLocation` (string, required): Path to the value
10
+ - `options` (array, optional): Array of `{label, value}` objects
11
+ - `dynamicOptions` (any, optional): Template value for dynamic options
12
+ - `defaultFieldValue` (any, optional): Default value if none is set
13
+
14
+ - type: RjBuildDescriber
15
+ title: "Interactive Example: Display label from value"
16
+ description:
17
+ - type: Markdown
18
+ content: |
19
+ Select a status to see the corresponding label displayed below.
20
+ toDescribe:
21
+ renderView:
22
+ - type: SelectField
23
+ dataLocation: ~.status
24
+ label: "Status"
25
+ options:
26
+ - label: "Active"
27
+ value: 1
28
+ - label: "Inactive"
29
+ value: 2
30
+ - label: "Pending"
31
+ value: 3
32
+ - type: div
33
+ content:
34
+ - type: strong
35
+ content: "Label: "
36
+ - type: LabelFromValue
37
+ dataLocation: ~.status
38
+ options:
39
+ - label: "Active"
40
+ value: 1
41
+ - label: "Inactive"
42
+ value: 2
43
+ - label: "Pending"
44
+ value: 3
45
+ data:
46
+ status: 3
47
+
48
+ - type: Markdown
49
+ content: |
50
+ ## Limitations
51
+ - Only the first matching label is displayed; duplicate values in options are not supported
52
+ - No support for grouped options or nested structures
53
+ - No built-in formatting for the label (use a wrapper if needed)
54
+ - If no options are provided, the raw value is shown
@@ -0,0 +1,93 @@
1
+ # Example usage of Modal component in Reactive-JSON
2
+ renderView:
3
+ - type: Markdown
4
+ content: |
5
+ # Modal
6
+
7
+ The `Modal` component displays a dialog that can be controlled by local state or by a boolean in the global data context. It is useful for confirmations, information, or any overlay content.
8
+
9
+ ## Properties
10
+ - `headerTitle` (object, optional): Content for the modal header (any Reactive-JSON view)
11
+ - `body` (object, optional): Content for the modal body (any Reactive-JSON view)
12
+ - `closeButton` (boolean, optional): Show a close button in the header (default: false)
13
+ - `showBoolPath` (string or boolean, optional): If a string, path to a boolean in data controlling visibility; otherwise, local state is used
14
+ - `attributes` (object, optional): Additional attributes for the modal (size, centered, etc.)
15
+ - `className` (string, optional): Additional CSS classes (always includes `reactive-json`)
16
+
17
+ - type: RjBuildDescriber
18
+ title: "Interactive Example: Modal controlled by data path"
19
+ description:
20
+ - type: Markdown
21
+ content: |
22
+ Click the button to open the modal. The modal's visibility is controlled by the `show_modal` value in the data context. Closing the modal sets `show_modal` to false.
23
+ toDescribe:
24
+ renderView:
25
+ - type: button
26
+ content: "Open Modal"
27
+ actions:
28
+ - what: setData
29
+ on: click
30
+ path: ~.show_modal
31
+ value: true
32
+ - type: Modal
33
+ showBoolPath: ~.show_modal
34
+ headerTitle:
35
+ type: Markdown
36
+ content: "Modal Title"
37
+ body:
38
+ type: Markdown
39
+ content: "This modal is controlled by global data."
40
+ closeButton: true
41
+ data:
42
+ show_modal: false
43
+
44
+ - type: RjBuildDescriber
45
+ title: "Multiple Modals Example"
46
+ description: This example demonstrates how to have multiple modals open simultaneously. Each modal is controlled by a different data path, allowing independent visibility control.
47
+ toDescribe:
48
+ renderView:
49
+ - type: div
50
+ content:
51
+ - type: button
52
+ content: "Open First Modal"
53
+ actions:
54
+ - what: setData
55
+ on: click
56
+ path: ~.modal_one
57
+ value: true
58
+ - type: Modal
59
+ showBoolPath: ~.modal_one
60
+ headerTitle: "First Modal"
61
+ body:
62
+ - type: Markdown
63
+ content: "This is the first modal. You can open another one!"
64
+ - type: button
65
+ content: "Open Second Modal"
66
+ actions:
67
+ - what: setData
68
+ on: click
69
+ path: ~.modal_two
70
+ value: true
71
+ closeButton: true
72
+ - type: Modal
73
+ showBoolPath: ~.modal_two
74
+ headerTitle: "Second Modal"
75
+ body:
76
+ type: Markdown
77
+ content: "This is the second modal. Both can be open at the same time!"
78
+ closeButton: true
79
+ data:
80
+ modal_one: false
81
+ modal_two: false
82
+
83
+ - type: Markdown
84
+ content: |
85
+ ## Limitations
86
+ - No built-in async or loading state
87
+ - No advanced accessibility beyond react-bootstrap
88
+ - If `showBoolPath` is a data path, it must resolve to a boolean
89
+ - No animation customization beyond react-bootstrap
90
+
91
+ ## Notes
92
+ - Multiple modals can be displayed simultaneously by using different `showBoolPath` values or state-controlled modals
93
+ - Each modal is independently controlled and managed
@@ -0,0 +1,37 @@
1
+ renderView:
2
+ - type: Markdown
3
+ content: |
4
+ # PreformattedMarkup
5
+
6
+ The `PreformattedMarkup` component renders HTML content with a strict allowlist of tags for safety. Use it to display rich text or HTML snippets, with filtering to prevent unwanted markup.
7
+
8
+ ## Properties
9
+ - `content` (string, required): The HTML string to render (can use template values)
10
+ - `htmlTagAllowList` (array, optional): List of allowed tags (overrides default)
11
+ - `additionalAllowedTags` (array, optional): Tags to add to the allowlist
12
+
13
+ **Default allowed tags:** abbr, acronym, b, blockquote, br, caption, code, div, em, h1-h6, i, li, ol, p, span, sup, strong, table, tbody, td, tfoot, th, thead, tr, ul
14
+
15
+ - type: RjBuildDescriber
16
+ title: "Interactive Example: Filtered HTML rendering"
17
+ description:
18
+ - type: Markdown
19
+ content: |
20
+ Only allowed tags are rendered. Try editing the content to add disallowed tags (like `<script>`, `<u>`, or `<img>`): they will be stripped.
21
+ toDescribe:
22
+ renderView:
23
+ - type: TextField
24
+ label: "HTML Content"
25
+ dataLocation: ~.html_content
26
+ - type: PreformattedMarkup
27
+ content: ~.html_content
28
+ data:
29
+ html_content: "<h2>Welcome</h2><p>This <b>component</b> only allows certain tags.<br><u>Underline</u> <img src='x' /></p>"
30
+
31
+ - type: Markdown
32
+ content: |
33
+ ## Limitations
34
+ - Only allowed tags are rendered; all others are stripped
35
+ - No support for custom attributes or inline styles
36
+ - No script, style, or event attributes are executed
37
+ - Not suitable for rendering untrusted HTML with complex requirements
@@ -0,0 +1,92 @@
1
+ renderView:
2
+ - type: Markdown
3
+ content: |
4
+ # SortableTreeItemCollapseButton
5
+
6
+ The `SortableTreeItemCollapseButton` component provides a collapse/expand button for tree items in a `FolderSortableTree`.
7
+
8
+ Use this component when you want to customize the location of this button in the tree item.
9
+
10
+ It's especially useful when the `manualDrag` option of the parent SortableTree is `true`, which causes the
11
+ disappearance of the default collapse button.
12
+
13
+ ## Properties
14
+ No properties.
15
+
16
+ ## Technical Details
17
+ - Renders a button with CSS classes for styling
18
+ - Only appears when the tree item has children and supports collapsing
19
+
20
+ - type: RjBuildDescriber
21
+ title: "Interactive Example: Tree with a right aligned collapse button"
22
+ description:
23
+ - type: Markdown
24
+ content: |
25
+ This example shows a `FolderSortableTree` with `SortableTreeItemCollapseButton` components in each item
26
+ template. Click the collapse buttons to expand/collapse tree nodes.
27
+ toDescribe:
28
+ renderView:
29
+ - # Inline style, because we want to style an element that is internally handled by the SortableTree lib.
30
+ # It's better to put this in a CSS file or in the <head> though.
31
+ # This code simply makes the item grow, and is needed only for a nicer presentation of the collapse button.
32
+ type: style
33
+ content: ".dnd-sortable-tree_folder_tree-item { flex-grow: 1; }"
34
+ - type: FolderSortableTree
35
+ sortableTreeOptions:
36
+ disableCollapseOnItemClick: true
37
+ manualDrag: true
38
+ showDragHandle: true
39
+ dataLocation: ~.tree
40
+ itemTemplate:
41
+ type: div
42
+ attributes:
43
+ class: align-items-center d-flex flex-grow-1 gap-2
44
+ content:
45
+ - type: div
46
+ content:
47
+ - type: span
48
+ content: ~.name
49
+ - type: div
50
+ attributes:
51
+ class: d-grid flex-grow-1 justify-content-end
52
+ style:
53
+ gridTemplateColumns: 1fr 8em 2em
54
+ content:
55
+ - # Takes the remaining space (1fr).
56
+ type: div
57
+ - type: div
58
+ attributes:
59
+ class: text-end
60
+ content: [" (", ~.count, " items)"]
61
+ - type: SortableTreeItemCollapseButton
62
+ data:
63
+ tree:
64
+ - id: 1
65
+ value:
66
+ name: "Root Folder"
67
+ count: 3
68
+ children:
69
+ - id: 2
70
+ value:
71
+ name: "Subfolder 1"
72
+ count: 1
73
+ children:
74
+ - id: 3
75
+ value:
76
+ name: "File 1"
77
+ count: 0
78
+ children: []
79
+ - id: 4
80
+ value:
81
+ name: "Subfolder 2"
82
+ count: 0
83
+ children: []
84
+
85
+ - type: Markdown
86
+ content: |
87
+ ## Limitations
88
+ - Only works within the template context of a `FolderSortableTree` item
89
+ - The button only appears when the tree item has children (`childCount > 0`)
90
+ - No customization of the collapse/expand behavior beyond what the underlying SortableTree provides
91
+ - The styling is controlled by the dnd-kit-sortable-tree CSS classes. You will need to provide CSS to override
92
+ the default styling.