@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.
- package/README-npm.md +49 -0
- package/README.md +86 -0
- package/package.json +79 -0
- package/public/rjbuild/component-doc/chartjs/components.yaml +252 -0
- package/public/rjbuild/component-doc/chartjs/overview.yaml +51 -0
- package/public/rjbuild/component-doc/core/action/HashChangeListener.md +90 -0
- package/public/rjbuild/component-doc/core/action/HashChangeListener.yaml +124 -0
- package/public/rjbuild/component-doc/core/action/Hide.md +22 -0
- package/public/rjbuild/component-doc/core/action/Hide.yaml +60 -0
- package/public/rjbuild/component-doc/core/action/MessageListener.md +93 -0
- package/public/rjbuild/component-doc/core/action/MessageListener.yaml +153 -0
- package/public/rjbuild/component-doc/core/action/Popover.md +26 -0
- package/public/rjbuild/component-doc/core/action/Popover.yaml +100 -0
- package/public/rjbuild/component-doc/core/action/ReactOnEvent.md +81 -0
- package/public/rjbuild/component-doc/core/action/ReactOnEvent.yaml +133 -0
- package/public/rjbuild/component-doc/core/action/Redirect.md +20 -0
- package/public/rjbuild/component-doc/core/action/Redirect.yaml +68 -0
- package/public/rjbuild/component-doc/core/action/Tooltip.md +22 -0
- package/public/rjbuild/component-doc/core/action/Tooltip.yaml +90 -0
- package/public/rjbuild/component-doc/core/action/VisuallyHide.md +21 -0
- package/public/rjbuild/component-doc/core/action/VisuallyHide.yaml +62 -0
- package/public/rjbuild/component-doc/core/action/index.md +214 -0
- package/public/rjbuild/component-doc/core/action/index.yaml +278 -0
- package/public/rjbuild/component-doc/core/element/form/CheckBoxField.md +276 -0
- package/public/rjbuild/component-doc/core/element/form/CheckBoxField.yaml +338 -0
- package/public/rjbuild/component-doc/core/element/form/DateField.md +189 -0
- package/public/rjbuild/component-doc/core/element/form/DateField.yaml +264 -0
- package/public/rjbuild/component-doc/core/element/form/NumberField.md +136 -0
- package/public/rjbuild/component-doc/core/element/form/NumberField.yaml +103 -0
- package/public/rjbuild/component-doc/core/element/form/SelectField.md +304 -0
- package/public/rjbuild/component-doc/core/element/form/SelectField.yaml +360 -0
- package/public/rjbuild/component-doc/core/element/form/TextAreaField.md +134 -0
- package/public/rjbuild/component-doc/core/element/form/TextAreaField.yaml +146 -0
- package/public/rjbuild/component-doc/core/element/form/TextField.md +129 -0
- package/public/rjbuild/component-doc/core/element/form/TextField.yaml +147 -0
- package/public/rjbuild/component-doc/core/element/form/formElementsCommon.md +106 -0
- package/public/rjbuild/component-doc/core/element/form/index.md +50 -0
- package/public/rjbuild/component-doc/core/element/form/index.yaml +96 -0
- package/public/rjbuild/component-doc/core/element/html/AccordionItem.yaml +47 -0
- package/public/rjbuild/component-doc/core/element/html/FolderSortableTree.yaml +81 -0
- package/public/rjbuild/component-doc/core/element/html/FormatNumeral.yaml +58 -0
- package/public/rjbuild/component-doc/core/element/html/Html.yaml +67 -0
- package/public/rjbuild/component-doc/core/element/html/LabelFromValue.yaml +54 -0
- package/public/rjbuild/component-doc/core/element/html/Modal.yaml +93 -0
- package/public/rjbuild/component-doc/core/element/html/PreformattedMarkup.yaml +37 -0
- package/public/rjbuild/component-doc/core/element/html/SortableTreeItemCollapseButton.yaml +92 -0
- package/public/rjbuild/component-doc/core/element/html/Tabs.yaml +57 -0
- package/public/rjbuild/component-doc/core/element/special/BootstrapElement.md +17 -0
- package/public/rjbuild/component-doc/core/element/special/BootstrapElement.yaml +18 -0
- package/public/rjbuild/component-doc/core/element/special/Count.md +37 -0
- package/public/rjbuild/component-doc/core/element/special/Count.yaml +325 -0
- package/public/rjbuild/component-doc/core/element/special/DataFilter.md +149 -0
- package/public/rjbuild/component-doc/core/element/special/DataFilter.yaml +315 -0
- package/public/rjbuild/component-doc/core/element/special/DelayedActions.md +51 -0
- package/public/rjbuild/component-doc/core/element/special/DelayedActions.yaml +55 -0
- package/public/rjbuild/component-doc/core/element/special/PageControls.md +126 -0
- package/public/rjbuild/component-doc/core/element/special/PageControls.yaml +133 -0
- package/public/rjbuild/component-doc/core/element/special/Phantom.md +31 -0
- package/public/rjbuild/component-doc/core/element/special/Phantom.yaml +34 -0
- package/public/rjbuild/component-doc/core/element/special/ReactiveJsonSubroot.md +27 -0
- package/public/rjbuild/component-doc/core/element/special/ReactiveJsonSubroot.yaml +51 -0
- package/public/rjbuild/component-doc/core/element/special/Switch.md +262 -0
- package/public/rjbuild/component-doc/core/element/special/Switch.yaml +348 -0
- package/public/rjbuild/component-doc/core/example/accordion.md +96 -0
- package/public/rjbuild/component-doc/core/example/accordion.yaml +64 -0
- package/public/rjbuild/component-doc/core/example/dynamic-content.md +197 -0
- package/public/rjbuild/component-doc/core/example/dynamic-content.yaml +237 -0
- package/public/rjbuild/component-doc/core/example/html.md +66 -0
- package/public/rjbuild/component-doc/core/example/html.yaml +83 -0
- package/public/rjbuild/component-doc/core/example/website.yaml +1663 -0
- package/public/rjbuild/component-doc/core/reaction/addData.md +96 -0
- package/public/rjbuild/component-doc/core/reaction/addData.yaml +133 -0
- package/public/rjbuild/component-doc/core/reaction/fetchData.md +60 -0
- package/public/rjbuild/component-doc/core/reaction/fetchData.yaml +156 -0
- package/public/rjbuild/component-doc/core/reaction/index.md +236 -0
- package/public/rjbuild/component-doc/core/reaction/index.yaml +254 -0
- package/public/rjbuild/component-doc/core/reaction/moveData.md +68 -0
- package/public/rjbuild/component-doc/core/reaction/moveData.yaml +71 -0
- package/public/rjbuild/component-doc/core/reaction/postMessage.md +63 -0
- package/public/rjbuild/component-doc/core/reaction/postMessage.yaml +68 -0
- package/public/rjbuild/component-doc/core/reaction/redirectNow.md +37 -0
- package/public/rjbuild/component-doc/core/reaction/redirectNow.yaml +37 -0
- package/public/rjbuild/component-doc/core/reaction/removeData.md +78 -0
- package/public/rjbuild/component-doc/core/reaction/removeData.yaml +56 -0
- package/public/rjbuild/component-doc/core/reaction/setClipboardData.md +44 -0
- package/public/rjbuild/component-doc/core/reaction/setClipboardData.yaml +41 -0
- package/public/rjbuild/component-doc/core/reaction/setData.md +93 -0
- package/public/rjbuild/component-doc/core/reaction/setData.yaml +85 -0
- package/public/rjbuild/component-doc/core/reaction/submitData.md +138 -0
- package/public/rjbuild/component-doc/core/reaction/submitData.yaml +141 -0
- package/public/rjbuild/component-doc/core/reaction/triggerEvent.md +59 -0
- package/public/rjbuild/component-doc/core/reaction/triggerEvent.yaml +59 -0
- package/public/rjbuild/component-doc/index.yaml +13 -0
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
renderView:
|
|
2
|
+
- type: Markdown
|
|
3
|
+
content: |
|
|
4
|
+
# DateField
|
|
5
|
+
|
|
6
|
+
The `DateField` component renders a date and time input field using React Bootstrap. It provides a datetime-local input type for selecting both date and time values with automatic data binding to the global data context.
|
|
7
|
+
|
|
8
|
+
> **Warning**
|
|
9
|
+
> This component has limited support and is marked as TODO in the codebase. Currently only supports `datetime-local` input type.
|
|
10
|
+
|
|
11
|
+
## Properties
|
|
12
|
+
|
|
13
|
+
- `dataLocation` (string, optional): Path to bind the field value in the data context
|
|
14
|
+
- `defaultFieldValue` (string, optional): Default value when no data is present
|
|
15
|
+
- `label` (string, optional): Field label text
|
|
16
|
+
- `attributes` (object, optional): Attributes applied to the Form.Group container
|
|
17
|
+
- `actions` (array, optional): Actions to execute based on field state. Supports both actions (hide, tooltip, etc.) and conditional reactions (setData, fetchData, etc.) with full conditional logic support
|
|
18
|
+
|
|
19
|
+
## Data Management
|
|
20
|
+
|
|
21
|
+
The component automatically synchronizes its value with the global data context as an ISO 8601 datetime string format (YYYY-MM-DDTHH:mm). When using `dataLocation`, the value is stored at the specified path. Without `dataLocation`, the value is stored in the template context using the component's `datafield`.
|
|
22
|
+
|
|
23
|
+
## Date Format
|
|
24
|
+
|
|
25
|
+
The component uses the HTML5 `datetime-local` input type which:
|
|
26
|
+
- Displays a date and time picker in the browser
|
|
27
|
+
- Returns values in ISO 8601 format: `YYYY-MM-DDTHH:mm`
|
|
28
|
+
- Does not include timezone information
|
|
29
|
+
- Appearance varies by browser and operating system
|
|
30
|
+
|
|
31
|
+
- type: RjBuildDescriber
|
|
32
|
+
title: "Basic DateField Usage"
|
|
33
|
+
description: "Simple date and time input with current datetime"
|
|
34
|
+
toDescribe:
|
|
35
|
+
renderView:
|
|
36
|
+
- type: DateField
|
|
37
|
+
dataLocation: ~.eventDate
|
|
38
|
+
label: "Event Date and Time:"
|
|
39
|
+
- type: div
|
|
40
|
+
content:
|
|
41
|
+
- "Selected date: "
|
|
42
|
+
- type: strong
|
|
43
|
+
content: ~.eventDate
|
|
44
|
+
actions:
|
|
45
|
+
- what: hide
|
|
46
|
+
when: ~.eventDate
|
|
47
|
+
isEmpty: true
|
|
48
|
+
data:
|
|
49
|
+
eventDate: null
|
|
50
|
+
|
|
51
|
+
- type: RjBuildDescriber
|
|
52
|
+
title: "DateField with Default Value"
|
|
53
|
+
description: "DateField with pre-set default date and time"
|
|
54
|
+
toDescribe:
|
|
55
|
+
renderView:
|
|
56
|
+
- type: DateField
|
|
57
|
+
dataLocation: ~.deadline
|
|
58
|
+
label: "Project Deadline:"
|
|
59
|
+
defaultFieldValue: "2024-12-31T17:00"
|
|
60
|
+
- type: div
|
|
61
|
+
content:
|
|
62
|
+
- "Deadline: "
|
|
63
|
+
- ~.deadline
|
|
64
|
+
- type: div
|
|
65
|
+
attributes:
|
|
66
|
+
style:
|
|
67
|
+
fontSize: "14px"
|
|
68
|
+
color: "#666"
|
|
69
|
+
marginTop: "10px"
|
|
70
|
+
content: "Default value: 2024-12-31T17:00 (December 31, 2024 at 5:00 PM)"
|
|
71
|
+
data:
|
|
72
|
+
deadline: null
|
|
73
|
+
|
|
74
|
+
- type: RjBuildDescriber
|
|
75
|
+
title: "Multiple DateFields"
|
|
76
|
+
description: "Multiple date inputs for different purposes"
|
|
77
|
+
toDescribe:
|
|
78
|
+
renderView:
|
|
79
|
+
- type: DateField
|
|
80
|
+
dataLocation: ~.startDate
|
|
81
|
+
label: "Start Date:"
|
|
82
|
+
- type: DateField
|
|
83
|
+
dataLocation: ~.endDate
|
|
84
|
+
label: "End Date:"
|
|
85
|
+
- type: DateField
|
|
86
|
+
dataLocation: ~.reminderDate
|
|
87
|
+
label: "Reminder Date:"
|
|
88
|
+
- type: div
|
|
89
|
+
attributes:
|
|
90
|
+
style:
|
|
91
|
+
marginTop: "20px"
|
|
92
|
+
padding: "10px"
|
|
93
|
+
backgroundColor: "#f8f9fa"
|
|
94
|
+
borderRadius: "5px"
|
|
95
|
+
content:
|
|
96
|
+
- type: strong
|
|
97
|
+
content: "Schedule Summary:"
|
|
98
|
+
- type: div
|
|
99
|
+
content:
|
|
100
|
+
- "Start: "
|
|
101
|
+
- ~.startDate
|
|
102
|
+
actions:
|
|
103
|
+
- what: hide
|
|
104
|
+
when: ~.startDate
|
|
105
|
+
isEmpty: true
|
|
106
|
+
- type: div
|
|
107
|
+
content:
|
|
108
|
+
- "End: "
|
|
109
|
+
- ~.endDate
|
|
110
|
+
actions:
|
|
111
|
+
- what: hide
|
|
112
|
+
when: ~.endDate
|
|
113
|
+
isEmpty: true
|
|
114
|
+
- type: div
|
|
115
|
+
content:
|
|
116
|
+
- "Reminder: "
|
|
117
|
+
- ~.reminderDate
|
|
118
|
+
actions:
|
|
119
|
+
- what: hide
|
|
120
|
+
when: ~.reminderDate
|
|
121
|
+
isEmpty: true
|
|
122
|
+
- type: div
|
|
123
|
+
content: "No dates selected yet"
|
|
124
|
+
actions:
|
|
125
|
+
- what: hide
|
|
126
|
+
when: ~.startDate
|
|
127
|
+
isEmpty: "not"
|
|
128
|
+
- what: hide
|
|
129
|
+
when: ~.endDate
|
|
130
|
+
isEmpty: "not"
|
|
131
|
+
- what: hide
|
|
132
|
+
when: ~.reminderDate
|
|
133
|
+
isEmpty: "not"
|
|
134
|
+
data:
|
|
135
|
+
startDate: null
|
|
136
|
+
endDate: null
|
|
137
|
+
reminderDate: null
|
|
138
|
+
|
|
139
|
+
- type: RjBuildDescriber
|
|
140
|
+
title: "Interactive Date Management"
|
|
141
|
+
description: "Advanced example with conditional reactions and dynamic messaging"
|
|
142
|
+
toDescribe:
|
|
143
|
+
renderView:
|
|
144
|
+
- type: DateField
|
|
145
|
+
dataLocation: ~.meetingDate
|
|
146
|
+
label: "Meeting Date:"
|
|
147
|
+
- type: button
|
|
148
|
+
content: "Set to Tomorrow"
|
|
149
|
+
actions:
|
|
150
|
+
- what: setData
|
|
151
|
+
on: click
|
|
152
|
+
path: ~.meetingDate
|
|
153
|
+
value: "2024-12-25T14:00"
|
|
154
|
+
- type: button
|
|
155
|
+
content: "Clear Date"
|
|
156
|
+
attributes:
|
|
157
|
+
style:
|
|
158
|
+
marginLeft: "10px"
|
|
159
|
+
actions:
|
|
160
|
+
- what: setData
|
|
161
|
+
on: click
|
|
162
|
+
path: ~.meetingDate
|
|
163
|
+
value: null
|
|
164
|
+
- what: setData
|
|
165
|
+
on: click
|
|
166
|
+
path: ~.message
|
|
167
|
+
value: null
|
|
168
|
+
- type: button
|
|
169
|
+
content: "Validate Meeting"
|
|
170
|
+
attributes:
|
|
171
|
+
style:
|
|
172
|
+
marginLeft: "10px"
|
|
173
|
+
actions:
|
|
174
|
+
- what: setData
|
|
175
|
+
on: click
|
|
176
|
+
path: ~.message
|
|
177
|
+
value: "✓ Meeting date is set!"
|
|
178
|
+
when: ~.meetingDate
|
|
179
|
+
isEmpty: "not"
|
|
180
|
+
- what: setData
|
|
181
|
+
on: click
|
|
182
|
+
path: ~.message
|
|
183
|
+
value: "⚠ Please select a meeting date first"
|
|
184
|
+
when: ~.meetingDate
|
|
185
|
+
isEmpty: true
|
|
186
|
+
- type: div
|
|
187
|
+
attributes:
|
|
188
|
+
style:
|
|
189
|
+
marginTop: "15px"
|
|
190
|
+
padding: "10px"
|
|
191
|
+
borderRadius: "4px"
|
|
192
|
+
backgroundColor: "#d4edda"
|
|
193
|
+
color: "#155724"
|
|
194
|
+
content: ~.message
|
|
195
|
+
actions:
|
|
196
|
+
- what: hide
|
|
197
|
+
when: ~.message
|
|
198
|
+
isEmpty: true
|
|
199
|
+
- type: div
|
|
200
|
+
attributes:
|
|
201
|
+
style:
|
|
202
|
+
marginTop: "10px"
|
|
203
|
+
fontSize: "14px"
|
|
204
|
+
color: "#6c757d"
|
|
205
|
+
content: ["Selected: ", ~.meetingDate]
|
|
206
|
+
actions:
|
|
207
|
+
- what: hide
|
|
208
|
+
when: ~.meetingDate
|
|
209
|
+
isEmpty: true
|
|
210
|
+
data:
|
|
211
|
+
meetingDate: null
|
|
212
|
+
message: null
|
|
213
|
+
|
|
214
|
+
- type: Markdown
|
|
215
|
+
content: |
|
|
216
|
+
## Current Limitations
|
|
217
|
+
|
|
218
|
+
> **Development Status**
|
|
219
|
+
> The DateField component is currently limited and marked as TODO in the codebase. However, it integrates fully with reactive-json's action and reaction system for rich interactivity.
|
|
220
|
+
|
|
221
|
+
### Component Limitations
|
|
222
|
+
- Only supports `datetime-local` input type (hardcoded)
|
|
223
|
+
- No support for `date` input type (date only)
|
|
224
|
+
- No support for `time` input type (time only)
|
|
225
|
+
- No support for `month` or `week` input types
|
|
226
|
+
- No built-in date formatting or localization
|
|
227
|
+
- No timezone handling or conversion
|
|
228
|
+
- No support for inputAttributes property (not implemented)
|
|
229
|
+
- No template evaluation support for label property
|
|
230
|
+
|
|
231
|
+
### Browser and Validation Limitations
|
|
232
|
+
- No date validation beyond browser defaults
|
|
233
|
+
- No support for date ranges or multiple date selection
|
|
234
|
+
- No support for custom date picker libraries
|
|
235
|
+
- Limited browser compatibility for datetime-local input
|
|
236
|
+
|
|
237
|
+
### Workarounds Available
|
|
238
|
+
- ✅ **Date validation**: Use conditional reactions with `isEmpty`, `andConditions`, `orConditions`
|
|
239
|
+
- ✅ **Interactive behavior**: Full support for conditional actions and reactions
|
|
240
|
+
- ✅ **Dynamic messaging**: Use setData reactions to provide user feedback
|
|
241
|
+
- ✅ **Complex logic**: Combine multiple DateFields with sophisticated conditional logic
|
|
242
|
+
|
|
243
|
+
## Browser Compatibility
|
|
244
|
+
|
|
245
|
+
The `datetime-local` input type has varying support across browsers:
|
|
246
|
+
- Modern browsers provide native date/time pickers
|
|
247
|
+
- Older browsers may fall back to text input
|
|
248
|
+
- Mobile browsers typically provide optimized date/time selection interfaces
|
|
249
|
+
- Appearance and behavior can vary significantly between browsers
|
|
250
|
+
|
|
251
|
+
## Future Improvements
|
|
252
|
+
|
|
253
|
+
The component is marked for future enhancement to support:
|
|
254
|
+
- Dedicated `date` input type for date-only selection
|
|
255
|
+
- Dedicated `time` input type for time-only selection
|
|
256
|
+
- Better validation and error handling
|
|
257
|
+
- Custom date formatting options
|
|
258
|
+
- Timezone support
|
|
259
|
+
- Integration with date picker libraries
|
|
260
|
+
- Support for inputAttributes property
|
|
261
|
+
- Template evaluation for label property
|
|
262
|
+
|
|
263
|
+
templates: {}
|
|
264
|
+
data: {}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# NumberField
|
|
2
|
+
|
|
3
|
+
The `NumberField` component renders a numeric input field using React Bootstrap. It provides a number-specific input with browser validation and automatic data binding to the global data context.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
- `dataLocation` (string, optional): Path to bind the field value in the data context
|
|
8
|
+
- `defaultFieldValue` (number, optional): Default value when no data is present
|
|
9
|
+
- `label` (string, optional): Field label text (supports template evaluation)
|
|
10
|
+
- `placeholder` (string, optional): Placeholder text (supports template evaluation)
|
|
11
|
+
- `attributes` (object, optional): Attributes applied to the Form.Group container
|
|
12
|
+
- `inputAttributes` (object, optional): Attributes applied directly to the input element
|
|
13
|
+
- `actions` (array, optional): Actions to execute based on field state
|
|
14
|
+
|
|
15
|
+
## Data Management
|
|
16
|
+
|
|
17
|
+
The component stores the input value as a string in the data context. The browser's number input provides built-in validation, but the value should be converted to a number when needed for calculations.
|
|
18
|
+
|
|
19
|
+
## HTML5 Number Input Features
|
|
20
|
+
|
|
21
|
+
The component leverages HTML5 number input features:
|
|
22
|
+
- Automatic numeric keyboard on mobile devices
|
|
23
|
+
- Built-in validation for numeric values
|
|
24
|
+
- Support for min/max constraints
|
|
25
|
+
- Support for step increments
|
|
26
|
+
- Spinner controls for value adjustment
|
|
27
|
+
|
|
28
|
+
## Basic Example
|
|
29
|
+
|
|
30
|
+
```yaml
|
|
31
|
+
renderView:
|
|
32
|
+
- type: NumberField
|
|
33
|
+
dataLocation: ~.age
|
|
34
|
+
label: "Age:"
|
|
35
|
+
placeholder: "Enter your age"
|
|
36
|
+
|
|
37
|
+
data:
|
|
38
|
+
age: ""
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Number Input with Constraints
|
|
42
|
+
|
|
43
|
+
```yaml
|
|
44
|
+
renderView:
|
|
45
|
+
- type: NumberField
|
|
46
|
+
dataLocation: ~.quantity
|
|
47
|
+
label: "Quantity (1-100):"
|
|
48
|
+
placeholder: "Enter quantity"
|
|
49
|
+
inputAttributes:
|
|
50
|
+
min: 1
|
|
51
|
+
max: 100
|
|
52
|
+
step: 1
|
|
53
|
+
- type: NumberField
|
|
54
|
+
dataLocation: ~.price
|
|
55
|
+
label: "Price ($0.00-$999.99):"
|
|
56
|
+
placeholder: "0.00"
|
|
57
|
+
inputAttributes:
|
|
58
|
+
min: 0
|
|
59
|
+
max: 999.99
|
|
60
|
+
step: 0.01
|
|
61
|
+
|
|
62
|
+
data:
|
|
63
|
+
quantity: ""
|
|
64
|
+
price: ""
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Advanced Validation Example
|
|
68
|
+
|
|
69
|
+
Use `inputAttributes` to set validation constraints:
|
|
70
|
+
|
|
71
|
+
```yaml
|
|
72
|
+
renderView:
|
|
73
|
+
- type: NumberField
|
|
74
|
+
dataLocation: ~.quantity
|
|
75
|
+
label: "Quantity:"
|
|
76
|
+
inputAttributes:
|
|
77
|
+
min: 1
|
|
78
|
+
max: 100
|
|
79
|
+
step: 1
|
|
80
|
+
required: true
|
|
81
|
+
- type: NumberField
|
|
82
|
+
dataLocation: ~.temperature
|
|
83
|
+
label: "Temperature (°C):"
|
|
84
|
+
inputAttributes:
|
|
85
|
+
min: -273.15
|
|
86
|
+
max: 1000
|
|
87
|
+
step: 0.1
|
|
88
|
+
|
|
89
|
+
data:
|
|
90
|
+
quantity: ""
|
|
91
|
+
temperature: ""
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Complete Example
|
|
95
|
+
|
|
96
|
+
A comprehensive example showing different NumberField configurations:
|
|
97
|
+
|
|
98
|
+
```yaml
|
|
99
|
+
renderView:
|
|
100
|
+
- type: NumberField
|
|
101
|
+
dataLocation: ~.age
|
|
102
|
+
label: "Age:"
|
|
103
|
+
placeholder: "Enter your age"
|
|
104
|
+
inputAttributes:
|
|
105
|
+
min: 0
|
|
106
|
+
max: 120
|
|
107
|
+
step: 1
|
|
108
|
+
- type: NumberField
|
|
109
|
+
dataLocation: ~.price
|
|
110
|
+
label: "Price ($):"
|
|
111
|
+
placeholder: "0.00"
|
|
112
|
+
inputAttributes:
|
|
113
|
+
min: 0
|
|
114
|
+
step: 0.01
|
|
115
|
+
- type: div
|
|
116
|
+
content:
|
|
117
|
+
- "Age: "
|
|
118
|
+
- ~.age
|
|
119
|
+
- type: div
|
|
120
|
+
content:
|
|
121
|
+
- "Price: $"
|
|
122
|
+
- ~.price
|
|
123
|
+
|
|
124
|
+
data:
|
|
125
|
+
age: ""
|
|
126
|
+
price: ""
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Limitations
|
|
130
|
+
|
|
131
|
+
- Values are stored as strings
|
|
132
|
+
- No built-in number formatting (thousands separators, currency)
|
|
133
|
+
- No built-in error message display for validation failures
|
|
134
|
+
- Browser validation behavior varies across different browsers
|
|
135
|
+
- No support for complex number patterns or custom validation rules
|
|
136
|
+
- No automatic locale-specific number formatting
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
renderView:
|
|
2
|
+
- type: Markdown
|
|
3
|
+
content: |
|
|
4
|
+
# NumberField
|
|
5
|
+
|
|
6
|
+
The `NumberField` component renders a numeric input field using React Bootstrap. It provides a number-specific input with browser validation and automatic data binding to the global data context.
|
|
7
|
+
|
|
8
|
+
## Properties
|
|
9
|
+
|
|
10
|
+
- `dataLocation` (string, optional): Path to bind the field value in the data context
|
|
11
|
+
- `defaultFieldValue` (number, optional): Default value when no data is present
|
|
12
|
+
- `label` (string, optional): Field label text (supports template evaluation)
|
|
13
|
+
- `placeholder` (string, optional): Placeholder text (supports template evaluation)
|
|
14
|
+
- `attributes` (object, optional): Attributes applied to the Form.Group container
|
|
15
|
+
- `inputAttributes` (object, optional): Attributes applied directly to the input element
|
|
16
|
+
- `actions` (array, optional): Actions to execute based on field state
|
|
17
|
+
|
|
18
|
+
## Data Management
|
|
19
|
+
|
|
20
|
+
The component stores the input value as a string in the data context. The browser's number input provides built-in validation, but the value should be converted to a number when needed for calculations.
|
|
21
|
+
|
|
22
|
+
## HTML5 Number Input Features
|
|
23
|
+
|
|
24
|
+
The component leverages HTML5 number input features:
|
|
25
|
+
- Automatic numeric keyboard on mobile devices
|
|
26
|
+
- Built-in validation for numeric values
|
|
27
|
+
- Support for min/max constraints
|
|
28
|
+
- Support for step increments
|
|
29
|
+
- Spinner controls for value adjustment
|
|
30
|
+
|
|
31
|
+
- type: RjBuildDescriber
|
|
32
|
+
title: "Basic NumberField Usage"
|
|
33
|
+
description: "Simple numeric input with validation"
|
|
34
|
+
toDescribe:
|
|
35
|
+
renderView:
|
|
36
|
+
- type: NumberField
|
|
37
|
+
dataLocation: ~.age
|
|
38
|
+
label: "Age:"
|
|
39
|
+
placeholder: "Enter your age"
|
|
40
|
+
- type: div
|
|
41
|
+
content:
|
|
42
|
+
- "Current value: "
|
|
43
|
+
- type: strong
|
|
44
|
+
content: ~.age
|
|
45
|
+
data:
|
|
46
|
+
age: ""
|
|
47
|
+
|
|
48
|
+
- type: RjBuildDescriber
|
|
49
|
+
title: "Number Input with Constraints"
|
|
50
|
+
description: "NumberField with min, max, and step validation"
|
|
51
|
+
toDescribe:
|
|
52
|
+
renderView:
|
|
53
|
+
- type: NumberField
|
|
54
|
+
dataLocation: ~.quantity
|
|
55
|
+
label: "Quantity (1-100):"
|
|
56
|
+
placeholder: "Enter quantity"
|
|
57
|
+
inputAttributes:
|
|
58
|
+
min: 1
|
|
59
|
+
max: 100
|
|
60
|
+
step: 1
|
|
61
|
+
- type: NumberField
|
|
62
|
+
dataLocation: ~.price
|
|
63
|
+
label: "Price ($0.00-$999.99):"
|
|
64
|
+
placeholder: "0.00"
|
|
65
|
+
inputAttributes:
|
|
66
|
+
min: 0
|
|
67
|
+
max: 999.99
|
|
68
|
+
step: 0.01
|
|
69
|
+
- type: div
|
|
70
|
+
attributes:
|
|
71
|
+
style:
|
|
72
|
+
marginTop: "20px"
|
|
73
|
+
padding: "10px"
|
|
74
|
+
backgroundColor: "#f8f9fa"
|
|
75
|
+
borderRadius: "5px"
|
|
76
|
+
content:
|
|
77
|
+
- type: strong
|
|
78
|
+
content: "Current Values:"
|
|
79
|
+
- type: div
|
|
80
|
+
content:
|
|
81
|
+
- "Quantity: "
|
|
82
|
+
- ~.quantity
|
|
83
|
+
- type: div
|
|
84
|
+
content:
|
|
85
|
+
- "Price: $"
|
|
86
|
+
- ~.price
|
|
87
|
+
data:
|
|
88
|
+
quantity: ""
|
|
89
|
+
price: ""
|
|
90
|
+
|
|
91
|
+
- type: Markdown
|
|
92
|
+
content: |
|
|
93
|
+
## Limitations
|
|
94
|
+
|
|
95
|
+
- Values are stored as strings
|
|
96
|
+
- No built-in number formatting (thousands separators, currency)
|
|
97
|
+
- No built-in error message display for validation failures
|
|
98
|
+
- Browser validation behavior varies across different browsers
|
|
99
|
+
- No support for complex number patterns or custom validation rules
|
|
100
|
+
- No automatic locale-specific number formatting
|
|
101
|
+
|
|
102
|
+
templates: {}
|
|
103
|
+
data: {}
|