robobyte-front-builder 1.0.26 → 1.0.27
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/LICENSE +65 -0
- package/README.md +57 -0
- package/docs/ReportViewer.md +581 -0
- package/docs/fetchReportData.md +379 -0
- package/docs/printLayout.md +405 -0
- package/package.json +29 -1
- package/training/00-index.md +168 -0
- package/training/01-input.md +144 -0
- package/training/02-checkbox.md +107 -0
- package/training/03-dropdown.md +135 -0
- package/training/04-datepicker.md +139 -0
- package/training/05-radio.md +123 -0
- package/training/06-number.md +133 -0
- package/training/07-textarea.md +114 -0
- package/training/08-richtext.md +112 -0
- package/training/09-tag.md +110 -0
- package/training/10-time.md +107 -0
- package/training/11-toggle.md +108 -0
- package/training/12-signature.md +107 -0
- package/training/13-autocomplete.md +134 -0
- package/training/14-button.md +168 -0
- package/training/15-label.md +138 -0
- package/training/16-header.md +128 -0
- package/training/17-divider.md +96 -0
- package/training/18-image.md +105 -0
- package/training/19-link.md +108 -0
- package/training/20-banner.md +122 -0
- package/training/21-progress-circle.md +101 -0
- package/training/22-progress-line.md +93 -0
- package/training/23-menu.md +139 -0
- package/training/24-popover.md +114 -0
- package/training/25-layout.md +116 -0
- package/training/26-layout-cell.md +143 -0
- package/training/27-card.md +87 -0
- package/training/28-wizard.md +126 -0
- package/training/29-wizard-step.md +92 -0
- package/training/30-repeater.md +123 -0
- package/training/31-dialog.md +131 -0
- package/training/32-breadcrumb.md +121 -0
- package/training/33-dataGrid.md +129 -0
- package/training/34-dataTableViewer.md +115 -0
- package/training/35-reportViewer.md +673 -0
- package/training/36-viewRenderer.md +110 -0
- package/training/37-treeView.md +170 -0
- package/training/38-kpi-metric.md +148 -0
- package/training/39-kpi-trend.md +105 -0
- package/training/40-kpi-badge.md +112 -0
- package/training/41-kpi-statusDot.md +118 -0
- package/training/42-kpi-iconBox.md +114 -0
- package/training/43-kpi-gauge.md +143 -0
- package/training/44-kpi-bulletChart.md +126 -0
- package/training/45-kpi-colorScale.md +143 -0
- package/training/46-kpi-rating.md +125 -0
- package/training/47-kpi-countdown.md +151 -0
- package/training/48-fetchReportData.md +276 -0
- package/training/49-printLayout.md +215 -0
- package/training/examples/01-login-form.json +176 -0
- package/training/examples/02-contact-form.json +141 -0
- package/training/examples/03-kpi-cards-row.json +123 -0
- package/training/examples/04-settings-toggles.json +153 -0
- package/training/examples/05-user-profile-card.json +136 -0
- package/training/examples/06-date-range-filter.json +108 -0
- package/training/examples/07-search-bar-results.json +130 -0
- package/training/examples/08-notification-settings.json +131 -0
- package/training/examples/09-employee-profile-form.json +259 -0
- package/training/examples/10-invoice-form.json +241 -0
- package/training/examples/11-dashboard-overview.json +251 -0
- package/training/examples/12-registration-wizard.json +154 -0
- package/training/examples/13-product-catalog.json +168 -0
- package/training/examples/14-data-table-with-filters.json +180 -0
- package/training/examples/15-tabbed-profile.json +92 -0
- package/training/examples/16-kpi-full-row.json +203 -0
- package/training/examples/17-tree-detail-view.json +139 -0
- package/training/examples/18-employee-management.json +233 -0
- package/training/examples/19-sales-dashboard.json +272 -0
- package/training/examples/20-checkout-wizard.json +225 -0
- package/training/examples/21-analytics-page.json +222 -0
- package/training/examples/22-hr-onboarding.json +222 -0
- package/training/examples/23-document-browser.json +241 -0
- package/training/examples/24-order-management.json +290 -0
- package/training/examples/25-crm-contact-page.json +272 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# Component: input
|
|
2
|
+
|
|
3
|
+
A single-line text input field. Supports labels, placeholders, icons, and real-time validation feedback.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Props — Main Tab
|
|
8
|
+
|
|
9
|
+
| Prop | Type | Options / Notes |
|
|
10
|
+
|------|------|-----------------|
|
|
11
|
+
| `key` | expression | Unique identifier. The user's typed value is stored in `data[key]` and `form[key]`. |
|
|
12
|
+
| `label` | expression | Label text shown above/beside the field. |
|
|
13
|
+
| `labelPosition` | select | `top` · `left` · `right` · `none` |
|
|
14
|
+
| `required` | boolean | Marks field as required; shows asterisk on label. |
|
|
15
|
+
| `value` | expression | Initial/controlled value. Bind to `data.someKey` to pre-fill. |
|
|
16
|
+
| `placeholder` | text | Greyed hint text shown when empty. |
|
|
17
|
+
| `size` | select | `small` · `medium` · `large` |
|
|
18
|
+
| `prefix` | icon | MUI icon displayed at the start of the input. |
|
|
19
|
+
| `suffix` | icon | MUI icon displayed at the end of the input. |
|
|
20
|
+
| `labelPrefix` | icon | Icon displayed before the label text. |
|
|
21
|
+
| `labelSuffix` | icon | Icon displayed after the label text. |
|
|
22
|
+
| `labelIconSize` | expression | Size of label icons, e.g. `"18px"`. |
|
|
23
|
+
| `labelIconColor` | expression | Color of label icons, e.g. `"primary.main"`. |
|
|
24
|
+
| `labelFontSize` | expression | Label text size, e.g. `"14px"`. |
|
|
25
|
+
| `labelFontWeight` | expression | Label font weight, e.g. `"600"`. |
|
|
26
|
+
| `labelColor` | expression | Label text color, e.g. `"#333"` or `"text.secondary"`. |
|
|
27
|
+
| `labelFontStyle` | select | `normal` · `italic` · `oblique` |
|
|
28
|
+
| `labelLetterSpacing` | expression | Letter spacing for label, e.g. `"0.05em"`. |
|
|
29
|
+
| `disabled` | boolean | Disables the field entirely. |
|
|
30
|
+
| `enabled` | boolean | Enables/disables the field from an expression, e.g. `data.isEditable`. |
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Props — Style Tab
|
|
35
|
+
|
|
36
|
+
| Prop | Type | Options / Notes |
|
|
37
|
+
|------|------|-----------------|
|
|
38
|
+
| `elementStyle` | expression | CSS object applied directly to the component wrapper as a style override. Highest priority. E.g. `{ outline: '2px solid red' }`. |
|
|
39
|
+
| `elementCss` | expression | CSS string applied to the component wrapper. Alternative to `elementStyle` for shorthand CSS. E.g. `"outline: 2px solid red; transition: all 0.2s"`. |
|
|
40
|
+
| `color` | select | `default` · `primary` · `secondary` · `error` · `warning` · `info` · `success` — MUI color variant for the field border/focus ring. |
|
|
41
|
+
| `display` | expression | CSS display, e.g. `"flex"`. |
|
|
42
|
+
| `width` | expression | Field width, e.g. `"100%"` or `"320px"`. |
|
|
43
|
+
| `height` | expression | Field height override. |
|
|
44
|
+
| `margin` | expression | Outer spacing, e.g. `"0 8px"`. |
|
|
45
|
+
| `padding` | expression | Inner padding override. |
|
|
46
|
+
| `flexDirection` | select | `row` · `column` · `row-reverse` · `column-reverse` |
|
|
47
|
+
| `justifyContent` | select | `flex-start` · `center` · `flex-end` · `space-between` · `space-around` · `space-evenly` |
|
|
48
|
+
| `alignItems` | select | `flex-start` · `center` · `flex-end` · `stretch` · `baseline` |
|
|
49
|
+
| `gap` | expression | Gap between label and input when stacked. |
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Props — Actions Tab
|
|
54
|
+
|
|
55
|
+
| Event | Type | Notes |
|
|
56
|
+
|-------|------|-------|
|
|
57
|
+
| `onChange` | action (custom) | Fires every time the user changes the input value. Use to trigger calculations, show/hide elements, or call APIs. |
|
|
58
|
+
| `onBlur` | action (custom) | Fires when the field loses focus. Use for validation or save-on-leave patterns. |
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Use Cases
|
|
63
|
+
|
|
64
|
+
**When to use:**
|
|
65
|
+
- Collecting short free-text: names, emails, usernames, search queries, addresses.
|
|
66
|
+
- Any single-line form field that needs validation or a label.
|
|
67
|
+
- Fields requiring icons (e.g. a search icon prefix or password-eye suffix).
|
|
68
|
+
|
|
69
|
+
**When NOT to use:**
|
|
70
|
+
- Multi-line text → use `textarea` or `richtext`.
|
|
71
|
+
- Number input with formatting → use `number`.
|
|
72
|
+
- Date input → use `datepicker`.
|
|
73
|
+
- Selection from a list → use `dropdown`, `radio`, or `autocomplete`.
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Schema Examples
|
|
78
|
+
|
|
79
|
+
### Minimal text input
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"type": "input",
|
|
83
|
+
"props": {
|
|
84
|
+
"key": "firstName",
|
|
85
|
+
"label": "First Name",
|
|
86
|
+
"placeholder": "Enter your first name",
|
|
87
|
+
"required": true
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Pre-filled, sized, with icons
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"type": "input",
|
|
96
|
+
"props": {
|
|
97
|
+
"key": "email",
|
|
98
|
+
"label": "Email Address",
|
|
99
|
+
"labelPosition": "top",
|
|
100
|
+
"value": "data.userEmail",
|
|
101
|
+
"placeholder": "user@example.com",
|
|
102
|
+
"prefix": "EmailOutlined",
|
|
103
|
+
"size": "medium",
|
|
104
|
+
"required": true
|
|
105
|
+
},
|
|
106
|
+
"style": {
|
|
107
|
+
"width": "100%",
|
|
108
|
+
"color": "primary"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Disabled read-only field
|
|
114
|
+
```json
|
|
115
|
+
{
|
|
116
|
+
"type": "input",
|
|
117
|
+
"props": {
|
|
118
|
+
"key": "userId",
|
|
119
|
+
"label": "User ID",
|
|
120
|
+
"value": "data.userId",
|
|
121
|
+
"labelPosition": "left",
|
|
122
|
+
"disabled": true
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### With onChange action
|
|
128
|
+
```json
|
|
129
|
+
{
|
|
130
|
+
"type": "input",
|
|
131
|
+
"props": {
|
|
132
|
+
"key": "searchQuery",
|
|
133
|
+
"label": "Search",
|
|
134
|
+
"prefix": "SearchOutlined",
|
|
135
|
+
"placeholder": "Type to filter..."
|
|
136
|
+
},
|
|
137
|
+
"actions": {
|
|
138
|
+
"onChange": {
|
|
139
|
+
"type": "custom",
|
|
140
|
+
"code": "setData({ filteredList: data.fullList.filter(i => i.name.includes(form.searchQuery)) })"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
```
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Component: checkbox
|
|
2
|
+
|
|
3
|
+
A boolean toggle rendered as a checkbox. Stores `true`/`false` in `data[key]`.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Props — Main Tab
|
|
8
|
+
|
|
9
|
+
| Prop | Type | Options / Notes |
|
|
10
|
+
|------|------|-----------------|
|
|
11
|
+
| `key` | expression | Unique identifier. Value stored as boolean in `data[key]` and `form[key]`. |
|
|
12
|
+
| `label` | expression | Label text shown next to the checkbox. |
|
|
13
|
+
| `labelPosition` | select | `top` · `left` · `right` · `none` |
|
|
14
|
+
| `required` | boolean | Marks field required. |
|
|
15
|
+
| `value` | expression | Controlled checked state, e.g. `data.isActive`. |
|
|
16
|
+
| `size` | select | `small` · `medium` · `large` |
|
|
17
|
+
| `disabled` | boolean | Prevents toggling. |
|
|
18
|
+
| `enabled` | boolean | Enable/disable from an expression. |
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Props — Style Tab
|
|
23
|
+
|
|
24
|
+
Same as Input style tab:
|
|
25
|
+
|
|
26
|
+
| Prop | Type | Options / Notes |
|
|
27
|
+
|------|------|-----------------|
|
|
28
|
+
| `color` | select | `default` · `primary` · `secondary` · `error` · `warning` · `info` · `success` |
|
|
29
|
+
| `display` | expression | CSS display override. |
|
|
30
|
+
| `width` | expression | Wrapper width. |
|
|
31
|
+
| `height` | expression | Wrapper height. |
|
|
32
|
+
| `margin` | expression | Outer margin. |
|
|
33
|
+
| `padding` | expression | Inner padding. |
|
|
34
|
+
| `flexDirection` | select | `row` · `column` · `row-reverse` · `column-reverse` |
|
|
35
|
+
| `justifyContent` | select | `flex-start` · `center` · `flex-end` · `space-between` · `space-around` · `space-evenly` |
|
|
36
|
+
| `alignItems` | select | `flex-start` · `center` · `flex-end` · `stretch` · `baseline` |
|
|
37
|
+
| `gap` | expression | Gap between elements. |
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Props — Actions Tab
|
|
42
|
+
|
|
43
|
+
| Event | Type | Notes |
|
|
44
|
+
|-------|------|-------|
|
|
45
|
+
| `onChange` | action (custom) | Fires when the checkbox is toggled. The new value is in `form[key]`. |
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Use Cases
|
|
50
|
+
|
|
51
|
+
**When to use:**
|
|
52
|
+
- Accept terms & conditions.
|
|
53
|
+
- Boolean flags on forms: `isActive`, `rememberMe`, `newsletter`.
|
|
54
|
+
- Feature toggles in a settings panel.
|
|
55
|
+
- Multi-select when combined with multiple checkboxes (or use `tag`/`dropdown multiple`).
|
|
56
|
+
|
|
57
|
+
**When NOT to use:**
|
|
58
|
+
- Mutually exclusive options → use `radio`.
|
|
59
|
+
- On/Off toggle with a different appearance → use `toggle`.
|
|
60
|
+
- Multiple-choice with a list → use `dropdown` with `multiple: true`.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Schema Examples
|
|
65
|
+
|
|
66
|
+
### Simple boolean checkbox
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"type": "checkbox",
|
|
70
|
+
"props": {
|
|
71
|
+
"key": "acceptTerms",
|
|
72
|
+
"label": "I accept the terms and conditions",
|
|
73
|
+
"required": true
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Controlled with expression
|
|
79
|
+
```json
|
|
80
|
+
{
|
|
81
|
+
"type": "checkbox",
|
|
82
|
+
"props": {
|
|
83
|
+
"key": "isActive",
|
|
84
|
+
"label": "Active",
|
|
85
|
+
"value": "data.record.isActive",
|
|
86
|
+
"labelPosition": "right",
|
|
87
|
+
"color": "success"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### With onChange
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"type": "checkbox",
|
|
96
|
+
"props": {
|
|
97
|
+
"key": "showDetails",
|
|
98
|
+
"label": "Show additional details"
|
|
99
|
+
},
|
|
100
|
+
"actions": {
|
|
101
|
+
"onChange": {
|
|
102
|
+
"type": "custom",
|
|
103
|
+
"code": "setData({ detailsVisible: form.showDetails })"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# Component: dropdown
|
|
2
|
+
|
|
3
|
+
A select input letting users choose one or multiple options from a list. Options can be static or data-driven.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Props — Main Tab
|
|
8
|
+
|
|
9
|
+
| Prop | Type | Options / Notes |
|
|
10
|
+
|------|------|-----------------|
|
|
11
|
+
| `key` | expression | Unique identifier. Selected value(s) stored in `data[key]` and `form[key]`. |
|
|
12
|
+
| `label` | expression | Label text. |
|
|
13
|
+
| `labelPosition` | select | `top` · `left` · `right` · `none` |
|
|
14
|
+
| `required` | boolean | Marks field required. |
|
|
15
|
+
| `value` | expression | Controlled value. For multiple, pass an array. |
|
|
16
|
+
| `placeholder` | text | Greyed hint text when nothing is selected. |
|
|
17
|
+
| `size` | select | `small` · `medium` · `large` |
|
|
18
|
+
| `disabled` | boolean | Disables the dropdown. |
|
|
19
|
+
| `enabled` | boolean | Enable/disable from an expression. |
|
|
20
|
+
| `fullWidth` | boolean | Stretches the dropdown to fill its container. |
|
|
21
|
+
| `options` | options-editor | Static list of `{ label, value }` pairs. Can also be bound to `data.someArray`. |
|
|
22
|
+
| `multiple` | boolean | Allows selecting multiple items (value becomes an array). |
|
|
23
|
+
| `native` | boolean | Renders as a native HTML `<select>` element instead of MUI. |
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Props — Style Tab
|
|
28
|
+
|
|
29
|
+
| Prop | Type | Options / Notes |
|
|
30
|
+
|------|------|-----------------|
|
|
31
|
+
| `color` | select | `default` · `primary` · `secondary` · `error` · `warning` · `info` · `success` |
|
|
32
|
+
| `display` | expression | CSS display. |
|
|
33
|
+
| `width` | expression | e.g. `"100%"` or `"280px"`. |
|
|
34
|
+
| `height` | expression | Height override. |
|
|
35
|
+
| `margin` | expression | Outer spacing. |
|
|
36
|
+
| `padding` | expression | Inner padding override. |
|
|
37
|
+
| `flexDirection` | select | `row` · `column` · `row-reverse` · `column-reverse` |
|
|
38
|
+
| `justifyContent` | select | `flex-start` · `center` · `flex-end` · `space-between` · `space-around` · `space-evenly` |
|
|
39
|
+
| `alignItems` | select | `flex-start` · `center` · `flex-end` · `stretch` · `baseline` |
|
|
40
|
+
| `gap` | expression | Gap between elements. |
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Props — Actions Tab
|
|
45
|
+
|
|
46
|
+
| Event | Type | Notes |
|
|
47
|
+
|-------|------|-------|
|
|
48
|
+
| `onChange` | action (custom) | Fires when selection changes. New value is in `form[key]`. |
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Use Cases
|
|
53
|
+
|
|
54
|
+
**When to use:**
|
|
55
|
+
- Choosing from a fixed list (countries, categories, statuses).
|
|
56
|
+
- Filtering data by a field when bound to data array.
|
|
57
|
+
- Multi-select: `multiple: true` for tag-like selection with a list.
|
|
58
|
+
|
|
59
|
+
**When NOT to use:**
|
|
60
|
+
- Only 2–4 choices visible at once → use `radio`.
|
|
61
|
+
- Freeform text with suggestions → use `autocomplete`.
|
|
62
|
+
- Boolean on/off → use `checkbox` or `toggle`.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Schema Examples
|
|
67
|
+
|
|
68
|
+
### Static options
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"type": "dropdown",
|
|
72
|
+
"props": {
|
|
73
|
+
"key": "status",
|
|
74
|
+
"label": "Status",
|
|
75
|
+
"required": true,
|
|
76
|
+
"placeholder": "Select status",
|
|
77
|
+
"options": [
|
|
78
|
+
{ "label": "Active", "value": "active" },
|
|
79
|
+
{ "label": "Inactive", "value": "inactive" },
|
|
80
|
+
{ "label": "Pending", "value": "pending" }
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
"style": { "width": "100%", "color": "primary" }
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Dynamic options from data
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"type": "dropdown",
|
|
91
|
+
"props": {
|
|
92
|
+
"key": "departmentId",
|
|
93
|
+
"label": "Department",
|
|
94
|
+
"value": "data.employee.departmentId",
|
|
95
|
+
"options": "data.departments",
|
|
96
|
+
"fullWidth": true
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Multiple select
|
|
102
|
+
```json
|
|
103
|
+
{
|
|
104
|
+
"type": "dropdown",
|
|
105
|
+
"props": {
|
|
106
|
+
"key": "roles",
|
|
107
|
+
"label": "Roles",
|
|
108
|
+
"multiple": true,
|
|
109
|
+
"options": [
|
|
110
|
+
{ "label": "Admin", "value": "admin" },
|
|
111
|
+
{ "label": "Editor", "value": "editor" },
|
|
112
|
+
{ "label": "Viewer", "value": "viewer" }
|
|
113
|
+
],
|
|
114
|
+
"fullWidth": true
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### With onChange to cascade another field
|
|
120
|
+
```json
|
|
121
|
+
{
|
|
122
|
+
"type": "dropdown",
|
|
123
|
+
"props": {
|
|
124
|
+
"key": "countryId",
|
|
125
|
+
"label": "Country",
|
|
126
|
+
"options": "data.countries"
|
|
127
|
+
},
|
|
128
|
+
"actions": {
|
|
129
|
+
"onChange": {
|
|
130
|
+
"type": "custom",
|
|
131
|
+
"code": "setData({ cities: [], selectedCity: null }); fetchCities(form.countryId)"
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# Component: datepicker
|
|
2
|
+
|
|
3
|
+
A date selection field with a calendar popup. Supports date formats, range restrictions, and view modes.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Props — Main Tab
|
|
8
|
+
|
|
9
|
+
| Prop | Type | Options / Notes |
|
|
10
|
+
|------|------|-----------------|
|
|
11
|
+
| `key` | expression | Unique identifier. Selected date string stored in `data[key]`. |
|
|
12
|
+
| `label` | expression | Label text. |
|
|
13
|
+
| `labelPosition` | select | `top` · `left` · `right` · `none` |
|
|
14
|
+
| `required` | boolean | Marks field required. |
|
|
15
|
+
| `value` | expression | Controlled value. Pass a date string or `data.someDate`. |
|
|
16
|
+
| `placeholder` | text | Hint text, e.g. `"YYYY-MM-DD"`. |
|
|
17
|
+
| `size` | select | `small` · `medium` · `large` |
|
|
18
|
+
| `disabled` | boolean | Disables the field. |
|
|
19
|
+
| `enabled` | boolean | Enable/disable from an expression. |
|
|
20
|
+
| `format` | text | Output format string, e.g. `"YYYY-MM-DD"`, `"DD/MM/YYYY"`, `"MM-DD-YYYY"`. |
|
|
21
|
+
| `views` | select | Which calendar panel to show: `day` · `month` · `year` |
|
|
22
|
+
| `openTo` | select | Which view opens first: `day` · `month` · `year` |
|
|
23
|
+
| `minDate` | expression | Earliest selectable date, e.g. `"2020-01-01"` or `data.contractStart`. |
|
|
24
|
+
| `maxDate` | expression | Latest selectable date, e.g. `new Date().toISOString()`. |
|
|
25
|
+
| `disableFuture` | boolean | Prevents selecting dates after today. |
|
|
26
|
+
| `disablePast` | boolean | Prevents selecting dates before today. |
|
|
27
|
+
| `readOnly` | boolean | Shows value but prevents editing. |
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Props — Style Tab
|
|
32
|
+
|
|
33
|
+
| Prop | Type | Options / Notes |
|
|
34
|
+
|------|------|-----------------|
|
|
35
|
+
| `color` | select | `default` · `primary` · `secondary` · `error` · `warning` · `info` · `success` |
|
|
36
|
+
| `display` | expression | CSS display. |
|
|
37
|
+
| `width` | expression | Field width. |
|
|
38
|
+
| `height` | expression | Height override. |
|
|
39
|
+
| `margin` | expression | Outer spacing. |
|
|
40
|
+
| `padding` | expression | Inner padding. |
|
|
41
|
+
| `flexDirection` | select | `row` · `column` · `row-reverse` · `column-reverse` |
|
|
42
|
+
| `justifyContent` | select | `flex-start` · `center` · `flex-end` · `space-between` · `space-around` · `space-evenly` |
|
|
43
|
+
| `alignItems` | select | `flex-start` · `center` · `flex-end` · `stretch` · `baseline` |
|
|
44
|
+
| `gap` | expression | Gap between elements. |
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Props — Actions Tab
|
|
49
|
+
|
|
50
|
+
| Event | Type | Notes |
|
|
51
|
+
|-------|------|-------|
|
|
52
|
+
| `onChange` | action (custom) | Fires when the user selects a date. New value in `form[key]`. |
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Use Cases
|
|
57
|
+
|
|
58
|
+
**When to use:**
|
|
59
|
+
- Date-of-birth, start date, end date, due date fields.
|
|
60
|
+
- Booking/scheduling forms.
|
|
61
|
+
- Filtering data by date range (use two datepickers with `minDate`/`maxDate` cross-linked).
|
|
62
|
+
- Year-only or month-only selection via `views: year` or `views: month`.
|
|
63
|
+
|
|
64
|
+
**When NOT to use:**
|
|
65
|
+
- Time-only input → use `time`.
|
|
66
|
+
- Date + time → combine `datepicker` + `time` or use a datetime field.
|
|
67
|
+
- Read-only date display → use `label`.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Schema Examples
|
|
72
|
+
|
|
73
|
+
### Simple date field
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"type": "datepicker",
|
|
77
|
+
"props": {
|
|
78
|
+
"key": "birthDate",
|
|
79
|
+
"label": "Date of Birth",
|
|
80
|
+
"format": "DD/MM/YYYY",
|
|
81
|
+
"disableFuture": true,
|
|
82
|
+
"required": true
|
|
83
|
+
},
|
|
84
|
+
"style": { "width": "100%" }
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Date range (start / end)
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"type": "datepicker",
|
|
92
|
+
"props": {
|
|
93
|
+
"key": "startDate",
|
|
94
|
+
"label": "Start Date",
|
|
95
|
+
"format": "YYYY-MM-DD",
|
|
96
|
+
"maxDate": "data.endDate"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"type": "datepicker",
|
|
103
|
+
"props": {
|
|
104
|
+
"key": "endDate",
|
|
105
|
+
"label": "End Date",
|
|
106
|
+
"format": "YYYY-MM-DD",
|
|
107
|
+
"minDate": "data.startDate",
|
|
108
|
+
"disablePast": true
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Month/year picker only
|
|
114
|
+
```json
|
|
115
|
+
{
|
|
116
|
+
"type": "datepicker",
|
|
117
|
+
"props": {
|
|
118
|
+
"key": "reportMonth",
|
|
119
|
+
"label": "Report Month",
|
|
120
|
+
"views": "month",
|
|
121
|
+
"openTo": "month",
|
|
122
|
+
"format": "MM/YYYY"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Read-only display
|
|
128
|
+
```json
|
|
129
|
+
{
|
|
130
|
+
"type": "datepicker",
|
|
131
|
+
"props": {
|
|
132
|
+
"key": "createdAt",
|
|
133
|
+
"label": "Created",
|
|
134
|
+
"value": "data.record.createdAt",
|
|
135
|
+
"readOnly": true,
|
|
136
|
+
"format": "DD MMM YYYY"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
```
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Component: radio
|
|
2
|
+
|
|
3
|
+
A group of radio buttons for mutually exclusive selection. Ideal for 2–6 options visible at once.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Props — Main Tab
|
|
8
|
+
|
|
9
|
+
| Prop | Type | Options / Notes |
|
|
10
|
+
|------|------|-----------------|
|
|
11
|
+
| `key` | expression | Unique identifier. Selected value stored in `data[key]` and `form[key]`. |
|
|
12
|
+
| `label` | expression | Group label shown above/beside the buttons. |
|
|
13
|
+
| `labelPosition` | select | `top` · `left` · `right` · `none` |
|
|
14
|
+
| `required` | boolean | Marks the group required. |
|
|
15
|
+
| `value` | expression | Controlled selected value, e.g. `data.gender`. |
|
|
16
|
+
| `size` | select | `small` · `medium` · `large` |
|
|
17
|
+
| `disabled` | boolean | Disables all radio buttons. |
|
|
18
|
+
| `enabled` | boolean | Enable/disable from an expression. |
|
|
19
|
+
| `options` | options-editor | List of `{ label, value }` pairs defining the choices. |
|
|
20
|
+
| `row` | boolean | `true` renders buttons horizontally (inline). Default is vertical stack. |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Props — Style Tab
|
|
25
|
+
|
|
26
|
+
| Prop | Type | Options / Notes |
|
|
27
|
+
|------|------|-----------------|
|
|
28
|
+
| `color` | select | `default` · `primary` · `secondary` · `error` · `warning` · `info` · `success` |
|
|
29
|
+
| `display` | expression | CSS display. |
|
|
30
|
+
| `width` | expression | Wrapper width. |
|
|
31
|
+
| `height` | expression | Wrapper height. |
|
|
32
|
+
| `margin` | expression | Outer margin. |
|
|
33
|
+
| `padding` | expression | Inner padding. |
|
|
34
|
+
| `flexDirection` | select | `row` · `column` · `row-reverse` · `column-reverse` |
|
|
35
|
+
| `justifyContent` | select | `flex-start` · `center` · `flex-end` · `space-between` · `space-around` · `space-evenly` |
|
|
36
|
+
| `alignItems` | select | `flex-start` · `center` · `flex-end` · `stretch` · `baseline` |
|
|
37
|
+
| `gap` | expression | Gap between options. |
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Props — Actions Tab
|
|
42
|
+
|
|
43
|
+
| Event | Type | Notes |
|
|
44
|
+
|-------|------|-------|
|
|
45
|
+
| `onChange` | action (custom) | Fires when the user selects a different option. New value in `form[key]`. |
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Use Cases
|
|
50
|
+
|
|
51
|
+
**When to use:**
|
|
52
|
+
- Mutually exclusive options where all choices should be visible: gender, payment method, priority level.
|
|
53
|
+
- Small option sets (2–5 items). Larger sets → use `dropdown`.
|
|
54
|
+
- Survey-style questions.
|
|
55
|
+
|
|
56
|
+
**When NOT to use:**
|
|
57
|
+
- More than 5–6 options → use `dropdown`.
|
|
58
|
+
- Boolean yes/no that looks like a switch → use `toggle`.
|
|
59
|
+
- Multi-selection → use `checkbox` group or `dropdown multiple`.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Schema Examples
|
|
64
|
+
|
|
65
|
+
### Horizontal radio group
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"type": "radio",
|
|
69
|
+
"props": {
|
|
70
|
+
"key": "gender",
|
|
71
|
+
"label": "Gender",
|
|
72
|
+
"required": true,
|
|
73
|
+
"row": true,
|
|
74
|
+
"options": [
|
|
75
|
+
{ "label": "Male", "value": "male" },
|
|
76
|
+
{ "label": "Female", "value": "female" },
|
|
77
|
+
{ "label": "Other", "value": "other" }
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Vertical with controlled value
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"type": "radio",
|
|
87
|
+
"props": {
|
|
88
|
+
"key": "priority",
|
|
89
|
+
"label": "Priority",
|
|
90
|
+
"value": "data.task.priority",
|
|
91
|
+
"color": "primary",
|
|
92
|
+
"options": [
|
|
93
|
+
{ "label": "Low", "value": "low" },
|
|
94
|
+
{ "label": "Medium", "value": "medium" },
|
|
95
|
+
{ "label": "High", "value": "high" },
|
|
96
|
+
{ "label": "Critical", "value": "critical" }
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### With onChange
|
|
103
|
+
```json
|
|
104
|
+
{
|
|
105
|
+
"type": "radio",
|
|
106
|
+
"props": {
|
|
107
|
+
"key": "paymentMethod",
|
|
108
|
+
"label": "Payment Method",
|
|
109
|
+
"row": true,
|
|
110
|
+
"options": [
|
|
111
|
+
{ "label": "Credit Card", "value": "card" },
|
|
112
|
+
{ "label": "Bank Transfer", "value": "bank" },
|
|
113
|
+
{ "label": "Cash", "value": "cash" }
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
"actions": {
|
|
117
|
+
"onChange": {
|
|
118
|
+
"type": "custom",
|
|
119
|
+
"code": "setData({ showCardForm: form.paymentMethod === 'card' })"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
```
|