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,126 @@
|
|
|
1
|
+
# Component: wizard
|
|
2
|
+
|
|
3
|
+
A multi-step stepper form. Contains `wizard-step` children. Handles navigation (Back/Next/Finish) with optional linear enforcement and lifecycle hooks.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Props — Main Tab
|
|
8
|
+
|
|
9
|
+
| Prop | Type | Options / Notes |
|
|
10
|
+
|------|------|-----------------|
|
|
11
|
+
| `key` | expression | Unique identifier for the wizard. |
|
|
12
|
+
| `orientation` | select | `horizontal` — stepper bar across the top. `vertical` — stepper on the left side. |
|
|
13
|
+
| `variant` | select | `standard` — step numbers above connector lines. `alternativeLabel` — step labels below the circles. |
|
|
14
|
+
| `linear` | boolean | `true` (default) forces sequential completion — user cannot jump to a later step without completing previous. `false` allows clicking any step. |
|
|
15
|
+
| `hideNavigation` | boolean | `true` hides Back/Next/Finish buttons. Use when you control navigation via custom buttons in step content. |
|
|
16
|
+
| `activeStep` | expression | Controlled active step index. When set, wizard is fully controlled from external state. |
|
|
17
|
+
| `backLabel` | expression | Label for the Back button. Default: `"Back"`. |
|
|
18
|
+
| `nextLabel` | expression | Label for the Next button. Default: `"Next"`. |
|
|
19
|
+
| `finishLabel` | expression | Label for the Finish button on the last step. Default: `"Finish"`. |
|
|
20
|
+
| `nextColor` | select | `primary` · `secondary` · `success` · `error` · `warning` · `info` · `inherit` |
|
|
21
|
+
| `nextVariant` | select | `text` · `outlined` · `contained` |
|
|
22
|
+
| `backColor` | select | Same options as nextColor. |
|
|
23
|
+
| `backVariant` | select | Same options as nextVariant. |
|
|
24
|
+
| `onStepChange` | code | Runs when the active step changes. Available variables: `from`, `to`, `direction` (`"next"` / `"back"` / `"jump"`), `goToStep`, `nextStep`, `prevStep`. |
|
|
25
|
+
| `onFinish` | code | Runs when the user clicks Finish on the last step. Available variables: `goToStep`, `nextStep`, `prevStep`. |
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Props — Style Tab
|
|
30
|
+
|
|
31
|
+
No dedicated style tab. Layout via parent cell.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Props — Actions Tab
|
|
36
|
+
|
|
37
|
+
No action tab — use `onStepChange` and `onFinish` code fields in Main.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Use Cases
|
|
42
|
+
|
|
43
|
+
**When to use:**
|
|
44
|
+
- Multi-step registration/onboarding forms.
|
|
45
|
+
- Checkout flows: Cart → Shipping → Payment → Review.
|
|
46
|
+
- Guided configuration wizards.
|
|
47
|
+
- Any process where steps have dependencies and need validation before proceeding.
|
|
48
|
+
|
|
49
|
+
**When NOT to use:**
|
|
50
|
+
- Simple tabbed content without sequential logic → use `menu`.
|
|
51
|
+
- Unlimited, non-linear navigation → use `menu`.
|
|
52
|
+
- Single form that doesn't need step structure.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Schema Examples
|
|
57
|
+
|
|
58
|
+
### Basic 3-step wizard
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"type": "wizard",
|
|
62
|
+
"props": {
|
|
63
|
+
"key": "registrationWizard",
|
|
64
|
+
"orientation": "horizontal",
|
|
65
|
+
"variant": "standard",
|
|
66
|
+
"linear": true,
|
|
67
|
+
"nextLabel": "Continue",
|
|
68
|
+
"finishLabel": "Submit Registration",
|
|
69
|
+
"nextColor": "primary",
|
|
70
|
+
"nextVariant": "contained"
|
|
71
|
+
},
|
|
72
|
+
"children": [
|
|
73
|
+
{
|
|
74
|
+
"type": "wizard-step",
|
|
75
|
+
"props": {
|
|
76
|
+
"key": "personal",
|
|
77
|
+
"label": "Personal Info",
|
|
78
|
+
"description": "Your basic details"
|
|
79
|
+
},
|
|
80
|
+
"children": [
|
|
81
|
+
{ "type": "input", "props": { "key": "firstName", "label": "First Name", "required": true } },
|
|
82
|
+
{ "type": "input", "props": { "key": "lastName", "label": "Last Name", "required": true } }
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"type": "wizard-step",
|
|
87
|
+
"props": {
|
|
88
|
+
"key": "contact",
|
|
89
|
+
"label": "Contact",
|
|
90
|
+
"description": "How to reach you"
|
|
91
|
+
},
|
|
92
|
+
"children": [
|
|
93
|
+
{ "type": "input", "props": { "key": "email", "label": "Email", "required": true } },
|
|
94
|
+
{ "type": "input", "props": { "key": "phone", "label": "Phone" } }
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"type": "wizard-step",
|
|
99
|
+
"props": {
|
|
100
|
+
"key": "confirm",
|
|
101
|
+
"label": "Review & Submit"
|
|
102
|
+
},
|
|
103
|
+
"children": [
|
|
104
|
+
{ "type": "label", "props": { "text": "Please review your details before submitting.", "variant": "body2" } }
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Wizard with onFinish submission
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"type": "wizard",
|
|
115
|
+
"props": {
|
|
116
|
+
"key": "checkoutWizard",
|
|
117
|
+
"orientation": "horizontal",
|
|
118
|
+
"linear": true,
|
|
119
|
+
"finishLabel": "Place Order",
|
|
120
|
+
"nextColor": "primary",
|
|
121
|
+
"nextVariant": "contained",
|
|
122
|
+
"onFinish": "submitOrder({ cart: data.cart, shipping: form })"
|
|
123
|
+
},
|
|
124
|
+
"children": []
|
|
125
|
+
}
|
|
126
|
+
```
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Component: wizard-step
|
|
2
|
+
|
|
3
|
+
A single step inside a `wizard`. Must be a direct child of `wizard`. Contains the form fields or content for that step.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Props — Main Tab
|
|
8
|
+
|
|
9
|
+
| Prop | Type | Options / Notes |
|
|
10
|
+
|------|------|-----------------|
|
|
11
|
+
| `key` | expression | Step identifier. Used in navigation logic. |
|
|
12
|
+
| `label` | expression | Step label shown in the stepper header, e.g. `"Personal Info"`. |
|
|
13
|
+
| `description` | expression | Short subtitle shown below the step label in the stepper. |
|
|
14
|
+
| `optional` | boolean | `true` shows `"(Optional)"` below the step label. |
|
|
15
|
+
| `completed` | expression | Expression returning `true` marks the step with a checkmark icon. |
|
|
16
|
+
| `error` | expression | Expression returning `true` marks the step in error state (red). |
|
|
17
|
+
| `onEnter` | code | Runs when this step becomes active. Available: `stepIndex`, `goToStep`, `nextStep`, `prevStep`. Use to load data or reset form state. |
|
|
18
|
+
| `onNext` | code | Runs before leaving this step when clicking Next. Return `true`/`undefined` to allow navigation. Return `false` to silently block. Return a string to block and display as an error message. Available: `stepIndex`, `goToStep`, `nextStep`, `prevStep`. |
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Props — Style Tab
|
|
23
|
+
|
|
24
|
+
No dedicated style tab.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Props — Actions Tab
|
|
29
|
+
|
|
30
|
+
No action tab — lifecycle code is in the Main tab via `onEnter` and `onNext`.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Use Cases
|
|
35
|
+
|
|
36
|
+
- Each step in a `wizard` flow.
|
|
37
|
+
- `onNext` for step validation: return `"Email is required"` if `!form.email`.
|
|
38
|
+
- `onEnter` to pre-load data for the step: fetch the user's address when entering the shipping step.
|
|
39
|
+
- `completed` expression to show a green checkmark when step data is valid.
|
|
40
|
+
- `error` expression to highlight a step that failed server-side validation.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Schema Examples
|
|
45
|
+
|
|
46
|
+
### Step with validation
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"type": "wizard-step",
|
|
50
|
+
"props": {
|
|
51
|
+
"key": "personalInfo",
|
|
52
|
+
"label": "Personal Info",
|
|
53
|
+
"description": "Your basic details",
|
|
54
|
+
"required": false,
|
|
55
|
+
"onNext": "if (!form.firstName || !form.email) return 'Please fill in all required fields.'"
|
|
56
|
+
},
|
|
57
|
+
"children": [
|
|
58
|
+
{ "type": "input", "props": { "key": "firstName", "label": "First Name", "required": true } },
|
|
59
|
+
{ "type": "input", "props": { "key": "email", "label": "Email", "required": true } }
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Step with data load on enter
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"type": "wizard-step",
|
|
68
|
+
"props": {
|
|
69
|
+
"key": "shipping",
|
|
70
|
+
"label": "Shipping",
|
|
71
|
+
"onEnter": "fetchAddresses({ userId: data.userId })"
|
|
72
|
+
},
|
|
73
|
+
"children": [
|
|
74
|
+
{ "type": "dropdown", "props": { "key": "addressId", "label": "Select Address", "options": "data.addresses" } }
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Optional step with completion indicator
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"type": "wizard-step",
|
|
83
|
+
"props": {
|
|
84
|
+
"key": "documents",
|
|
85
|
+
"label": "Documents",
|
|
86
|
+
"optional": true,
|
|
87
|
+
"completed": "data.documentsUploaded",
|
|
88
|
+
"error": "data.documentError"
|
|
89
|
+
},
|
|
90
|
+
"children": []
|
|
91
|
+
}
|
|
92
|
+
```
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Component: repeater
|
|
2
|
+
|
|
3
|
+
Renders a template multiple times — once per item in an array (or a fixed count). Each repetition has its own scoped `dataItem` and `itemIndex` available in expressions.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Props — Main Tab
|
|
8
|
+
|
|
9
|
+
| Prop | Type | Options / Notes |
|
|
10
|
+
|------|------|-----------------|
|
|
11
|
+
| `key` | expression | Unique identifier. When combined with `dataKey`, the complete array is accessible at `data[key]`. |
|
|
12
|
+
| `items` | expression | Array of objects to iterate, e.g. `data.employees`. Each item is exposed as `dataItem` in child expressions. |
|
|
13
|
+
| `count` | expression | Fixed number of repetitions when `items` is not set. The repeater generates `count` empty slots. |
|
|
14
|
+
| `dataKey` | expression | Parent data key where item values are stored/read back. When set, each item's inputs write to `data[dataKey][index]`, and the full array is readable at `data[dataKey]`. |
|
|
15
|
+
| `itemKey` | expression | Property on each item to use as the React key for stable rendering, e.g. `"id"`. Falls back to index. |
|
|
16
|
+
| `widgetId` | expression | ID of a saved widget to render as the item template. When set, the repeater fetches that widget and renders it instead of inline children. |
|
|
17
|
+
| `direction` | select | `vertical` — items stack top-to-bottom. `horizontal` — items flow left-to-right. `wrap` — horizontal flow that wraps to next line. |
|
|
18
|
+
| `gap` | expression | Spacing between items, e.g. `"16px"`. |
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Props — Style Tab
|
|
23
|
+
|
|
24
|
+
No dedicated style tab. Control via parent layout-cell.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Props — Actions Tab
|
|
29
|
+
|
|
30
|
+
No actions. Each child component inside the repeater handles its own events.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Available Variables Inside Repeater Children
|
|
35
|
+
|
|
36
|
+
- `dataItem` — the current item object from `items` array.
|
|
37
|
+
- `itemIndex` — the zero-based index of the current item.
|
|
38
|
+
- `data[dataKey][itemIndex]` — scoped form data for this item's inputs.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Use Cases
|
|
43
|
+
|
|
44
|
+
**When to use:**
|
|
45
|
+
- Rendering a list of cards: employee cards, product tiles.
|
|
46
|
+
- Line-item entry: invoice lines, order items (with `dataKey` for editable rows).
|
|
47
|
+
- Dynamic form: "Add another contact" pattern.
|
|
48
|
+
- Grid of similar items: photo gallery, tag list.
|
|
49
|
+
|
|
50
|
+
**When NOT to use:**
|
|
51
|
+
- Tabular data with sorting/filtering → use `dataGrid`.
|
|
52
|
+
- Static content that doesn't repeat → use `layout` cells.
|
|
53
|
+
- Server-paged large datasets → use `reportViewer`.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Schema Examples
|
|
58
|
+
|
|
59
|
+
### Read-only list of employee cards
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"type": "repeater",
|
|
63
|
+
"props": {
|
|
64
|
+
"key": "employeeList",
|
|
65
|
+
"items": "data.employees",
|
|
66
|
+
"itemKey": "id",
|
|
67
|
+
"direction": "vertical",
|
|
68
|
+
"gap": "12px"
|
|
69
|
+
},
|
|
70
|
+
"children": [
|
|
71
|
+
{
|
|
72
|
+
"type": "layout-cell",
|
|
73
|
+
"style": { "backgroundColor": "#fff", "borderRadius": "8px", "padding": "16px", "boxShadow": "0 1px 4px rgba(0,0,0,0.08)" },
|
|
74
|
+
"children": [
|
|
75
|
+
{ "type": "header", "props": { "text": "dataItem.name", "variant": "h6" } },
|
|
76
|
+
{ "type": "label", "props": { "text": "dataItem.role", "variant": "body2", "color": "textSecondary" } }
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Editable line items (with dataKey)
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"type": "repeater",
|
|
87
|
+
"props": {
|
|
88
|
+
"key": "invoiceLines",
|
|
89
|
+
"items": "data.lines",
|
|
90
|
+
"dataKey": "lines",
|
|
91
|
+
"itemKey": "id",
|
|
92
|
+
"direction": "vertical",
|
|
93
|
+
"gap": "8px"
|
|
94
|
+
},
|
|
95
|
+
"children": [
|
|
96
|
+
{
|
|
97
|
+
"type": "layout",
|
|
98
|
+
"props": { "cols": 3, "gap": 8 },
|
|
99
|
+
"children": [
|
|
100
|
+
{ "type": "layout-cell", "children": [{ "type": "input", "props": { "key": "description", "label": "Description", "value": "dataItem.description" } }] },
|
|
101
|
+
{ "type": "layout-cell", "children": [{ "type": "number", "props": { "key": "qty", "label": "Qty", "value": "dataItem.qty" } }] },
|
|
102
|
+
{ "type": "layout-cell", "children": [{ "type": "number", "props": { "key": "price", "label": "Price", "value": "dataItem.price", "formatType": "currency", "currencySymbol": "$" } }] }
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Fixed count (no data)
|
|
110
|
+
```json
|
|
111
|
+
{
|
|
112
|
+
"type": "repeater",
|
|
113
|
+
"props": {
|
|
114
|
+
"key": "ratings",
|
|
115
|
+
"count": 5,
|
|
116
|
+
"direction": "horizontal",
|
|
117
|
+
"gap": "8px"
|
|
118
|
+
},
|
|
119
|
+
"children": [
|
|
120
|
+
{ "type": "label", "props": { "text": "itemIndex + 1 + ' - Rating slot'", "variant": "caption" } }
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
```
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Component: dialog
|
|
2
|
+
|
|
3
|
+
A modal dialog overlay. Opened/closed via `openDialog(key)` / `closeDialog(key)` actions. Can contain inline child components or embed an entire saved view via `viewId`.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Props — Main Tab
|
|
8
|
+
|
|
9
|
+
| Prop | Type | Options / Notes |
|
|
10
|
+
|------|------|-----------------|
|
|
11
|
+
| `key` | expression | **Required.** The key passed to `openDialog(key)` and `closeDialog(key)` in action code. |
|
|
12
|
+
| `viewId` | expression | ID of a saved view to render as the dialog body. Leave blank to use inline dropped children. |
|
|
13
|
+
| `title` | expression | Dialog title shown in the header bar. |
|
|
14
|
+
| `hideTitle` | boolean | `true` hides the entire title bar (including close button). |
|
|
15
|
+
| `maxWidth` | select | `xs` · `sm` · `md` · `lg` · `xl` — Maximum width of the dialog. |
|
|
16
|
+
| `fullWidth` | boolean | Dialog stretches to the full `maxWidth`. |
|
|
17
|
+
| `fullScreen` | boolean | Dialog occupies the entire screen. |
|
|
18
|
+
| `showCloseButton` | boolean | Shows an × close button in the title bar. |
|
|
19
|
+
| `closeOnBackdrop` | boolean | Clicking outside the dialog closes it. |
|
|
20
|
+
| `dialogActions` | actions-config-editor | Buttons rendered in a DialogActions bar at the bottom. Each button has `label`, `color`, `variant`, and custom code. `closeDialog(key)` is available in action code. |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Props — Style Tab
|
|
25
|
+
|
|
26
|
+
No dedicated style tab.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Props — Actions Tab
|
|
31
|
+
|
|
32
|
+
No action tab. Dialog lifecycle is controlled via `openDialog`/`closeDialog` in other components' action code.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## How to Open and Close
|
|
37
|
+
|
|
38
|
+
From any action code (e.g. button onClick):
|
|
39
|
+
```javascript
|
|
40
|
+
openDialog('myDialog') // opens the dialog
|
|
41
|
+
closeDialog('myDialog') // closes the dialog
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Use Cases
|
|
47
|
+
|
|
48
|
+
**When to use:**
|
|
49
|
+
- Confirmation dialogs: "Are you sure you want to delete?"
|
|
50
|
+
- Edit forms in a modal: click a row → open edit dialog.
|
|
51
|
+
- Detail panels: view full record without leaving the page.
|
|
52
|
+
- Multi-step forms inside a dialog.
|
|
53
|
+
- Loading a complex sub-view (via `viewId`).
|
|
54
|
+
|
|
55
|
+
**When NOT to use:**
|
|
56
|
+
- Tooltips or small floating panels → use `popover`.
|
|
57
|
+
- Navigation between pages → use `viewRenderer` or routing.
|
|
58
|
+
- Inline expanding content → use `card` or conditional visibility.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Schema Examples
|
|
63
|
+
|
|
64
|
+
### Confirmation dialog
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"type": "dialog",
|
|
68
|
+
"props": {
|
|
69
|
+
"key": "confirmDelete",
|
|
70
|
+
"title": "Confirm Delete",
|
|
71
|
+
"maxWidth": "sm",
|
|
72
|
+
"fullWidth": true,
|
|
73
|
+
"showCloseButton": true,
|
|
74
|
+
"closeOnBackdrop": false,
|
|
75
|
+
"dialogActions": [
|
|
76
|
+
{
|
|
77
|
+
"label": "Cancel",
|
|
78
|
+
"variant": "text",
|
|
79
|
+
"color": "inherit",
|
|
80
|
+
"code": "closeDialog('confirmDelete')"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"label": "Delete",
|
|
84
|
+
"variant": "contained",
|
|
85
|
+
"color": "error",
|
|
86
|
+
"code": "deleteRecord({ id: data.selectedId }); closeDialog('confirmDelete')"
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
"children": [
|
|
91
|
+
{ "type": "label", "props": { "text": "This action cannot be undone. Are you sure?", "variant": "body1" } }
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Edit dialog with embedded view
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"type": "dialog",
|
|
100
|
+
"props": {
|
|
101
|
+
"key": "editEmployee",
|
|
102
|
+
"title": "Edit Employee",
|
|
103
|
+
"viewId": "data.editViewId",
|
|
104
|
+
"maxWidth": "md",
|
|
105
|
+
"fullWidth": true,
|
|
106
|
+
"showCloseButton": true,
|
|
107
|
+
"closeOnBackdrop": true,
|
|
108
|
+
"dialogActions": [
|
|
109
|
+
{ "label": "Close", "variant": "outlined", "color": "inherit", "code": "closeDialog('editEmployee')" }
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Full-screen form dialog
|
|
116
|
+
```json
|
|
117
|
+
{
|
|
118
|
+
"type": "dialog",
|
|
119
|
+
"props": {
|
|
120
|
+
"key": "newOrderForm",
|
|
121
|
+
"title": "New Order",
|
|
122
|
+
"fullScreen": true,
|
|
123
|
+
"showCloseButton": true,
|
|
124
|
+
"dialogActions": [
|
|
125
|
+
{ "label": "Cancel", "variant": "text", "color": "inherit", "code": "closeDialog('newOrderForm')" },
|
|
126
|
+
{ "label": "Submit", "variant": "contained", "color": "primary", "code": "submitForm(); closeDialog('newOrderForm')" }
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
"children": []
|
|
130
|
+
}
|
|
131
|
+
```
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Component: breadcrumb
|
|
2
|
+
|
|
3
|
+
A navigation trail or step indicator. Two visual modes: classic breadcrumb links, or a chevron-style step progress bar.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Props — Main Tab
|
|
8
|
+
|
|
9
|
+
| Prop | Type | Options / Notes |
|
|
10
|
+
|------|------|-----------------|
|
|
11
|
+
| `key` | expression | Unique identifier. |
|
|
12
|
+
| `items` | expression | Array of items: `[{ label, href?, disabled? }]`. Last item = current page in breadcrumb mode. |
|
|
13
|
+
| `variant` | select | `breadcrumb` — classic path trail with separator. `chevron` — arrow/step progress bar. |
|
|
14
|
+
| `mode` | select | `link` — items use `href` for navigation. `click` — items call `onClick` code. `none` — display only. |
|
|
15
|
+
| `separator` | expression | Separator character/string for breadcrumb variant, e.g. `"/"`, `">"`. Default: `"/"`. |
|
|
16
|
+
| `maxItems` | number | Maximum items shown before collapsing with an ellipsis (breadcrumb variant). |
|
|
17
|
+
| `linkUnderline` | select | `hover` · `always` · `none` — Link underline behavior. |
|
|
18
|
+
| `currentColor` | select | `text.primary` · `primary.main` · `text.secondary` · `inherit` — Color of the current (last) item. |
|
|
19
|
+
| `activeIndex` | expression | Active step index (chevron variant). Drives which step is highlighted. |
|
|
20
|
+
| `itemSize` | select | `small` · `medium` · `large` — Size of each step (chevron variant). |
|
|
21
|
+
| `fullWidth` | boolean | Chevron steps stretch to fill the full width. |
|
|
22
|
+
| `completedColor` | text | Background color of completed steps (chevron variant), e.g. `"#4caf50"`. |
|
|
23
|
+
| `activeColor` | text | Background color of the active step, e.g. `"#1976d2"`. |
|
|
24
|
+
| `pendingColor` | text | Background color of pending steps, e.g. `"#e0e0e0"`. |
|
|
25
|
+
| `completedTextColor` | text | Text color of completed steps. |
|
|
26
|
+
| `activeTextColor` | text | Text color of the active step. |
|
|
27
|
+
| `pendingTextColor` | text | Text color of pending steps. |
|
|
28
|
+
| `onClick` | code | Code run when an item is clicked (mode: click). Available: `item`, `index`. |
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Props — Style Tab
|
|
33
|
+
|
|
34
|
+
No dedicated style tab.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Props — Actions Tab
|
|
39
|
+
|
|
40
|
+
No dedicated action tab. Click behavior via `onClick` code in Main.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Use Cases
|
|
45
|
+
|
|
46
|
+
**When to use (breadcrumb variant):**
|
|
47
|
+
- Navigation trail showing the user's location in an app hierarchy.
|
|
48
|
+
- "Home > Category > Subcategory > Item" trails in detail pages.
|
|
49
|
+
|
|
50
|
+
**When to use (chevron variant):**
|
|
51
|
+
- Visual progress indicator for a multi-step process without built-in navigation.
|
|
52
|
+
- Status display: "Submitted → Under Review → Approved → Completed".
|
|
53
|
+
- Non-interactive pipeline status viewer.
|
|
54
|
+
|
|
55
|
+
**When NOT to use:**
|
|
56
|
+
- Interactive multi-step navigation with form fields per step → use `wizard`.
|
|
57
|
+
- Tab switching → use `menu`.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Schema Examples
|
|
62
|
+
|
|
63
|
+
### Classic breadcrumb (link mode)
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"type": "breadcrumb",
|
|
67
|
+
"props": {
|
|
68
|
+
"key": "navBreadcrumb",
|
|
69
|
+
"variant": "breadcrumb",
|
|
70
|
+
"mode": "link",
|
|
71
|
+
"items": [
|
|
72
|
+
{ "label": "Home", "href": "/" },
|
|
73
|
+
{ "label": "Employees", "href": "/employees" },
|
|
74
|
+
{ "label": "data.employee.name" }
|
|
75
|
+
],
|
|
76
|
+
"separator": "/",
|
|
77
|
+
"linkUnderline": "hover",
|
|
78
|
+
"currentColor": "text.primary"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Chevron status bar (display only)
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"type": "breadcrumb",
|
|
87
|
+
"props": {
|
|
88
|
+
"key": "orderStatus",
|
|
89
|
+
"variant": "chevron",
|
|
90
|
+
"mode": "none",
|
|
91
|
+
"items": [
|
|
92
|
+
{ "label": "Order Placed" },
|
|
93
|
+
{ "label": "Processing" },
|
|
94
|
+
{ "label": "Shipped" },
|
|
95
|
+
{ "label": "Delivered" }
|
|
96
|
+
],
|
|
97
|
+
"activeIndex": "data.order.statusIndex",
|
|
98
|
+
"fullWidth": true,
|
|
99
|
+
"completedColor": "#4caf50",
|
|
100
|
+
"activeColor": "#1976d2",
|
|
101
|
+
"pendingColor": "#e0e0e0",
|
|
102
|
+
"completedTextColor": "#ffffff",
|
|
103
|
+
"activeTextColor": "#ffffff",
|
|
104
|
+
"pendingTextColor": "#9e9e9e"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Clickable breadcrumb
|
|
110
|
+
```json
|
|
111
|
+
{
|
|
112
|
+
"type": "breadcrumb",
|
|
113
|
+
"props": {
|
|
114
|
+
"key": "folderNav",
|
|
115
|
+
"variant": "breadcrumb",
|
|
116
|
+
"mode": "click",
|
|
117
|
+
"items": "data.folderPath",
|
|
118
|
+
"onClick": "setData({ currentFolder: item.id }); loadFolder(item.id)"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|