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.
Files changed (81) hide show
  1. package/LICENSE +65 -0
  2. package/README.md +57 -0
  3. package/docs/ReportViewer.md +581 -0
  4. package/docs/fetchReportData.md +379 -0
  5. package/docs/printLayout.md +405 -0
  6. package/package.json +29 -1
  7. package/training/00-index.md +168 -0
  8. package/training/01-input.md +144 -0
  9. package/training/02-checkbox.md +107 -0
  10. package/training/03-dropdown.md +135 -0
  11. package/training/04-datepicker.md +139 -0
  12. package/training/05-radio.md +123 -0
  13. package/training/06-number.md +133 -0
  14. package/training/07-textarea.md +114 -0
  15. package/training/08-richtext.md +112 -0
  16. package/training/09-tag.md +110 -0
  17. package/training/10-time.md +107 -0
  18. package/training/11-toggle.md +108 -0
  19. package/training/12-signature.md +107 -0
  20. package/training/13-autocomplete.md +134 -0
  21. package/training/14-button.md +168 -0
  22. package/training/15-label.md +138 -0
  23. package/training/16-header.md +128 -0
  24. package/training/17-divider.md +96 -0
  25. package/training/18-image.md +105 -0
  26. package/training/19-link.md +108 -0
  27. package/training/20-banner.md +122 -0
  28. package/training/21-progress-circle.md +101 -0
  29. package/training/22-progress-line.md +93 -0
  30. package/training/23-menu.md +139 -0
  31. package/training/24-popover.md +114 -0
  32. package/training/25-layout.md +116 -0
  33. package/training/26-layout-cell.md +143 -0
  34. package/training/27-card.md +87 -0
  35. package/training/28-wizard.md +126 -0
  36. package/training/29-wizard-step.md +92 -0
  37. package/training/30-repeater.md +123 -0
  38. package/training/31-dialog.md +131 -0
  39. package/training/32-breadcrumb.md +121 -0
  40. package/training/33-dataGrid.md +129 -0
  41. package/training/34-dataTableViewer.md +115 -0
  42. package/training/35-reportViewer.md +673 -0
  43. package/training/36-viewRenderer.md +110 -0
  44. package/training/37-treeView.md +170 -0
  45. package/training/38-kpi-metric.md +148 -0
  46. package/training/39-kpi-trend.md +105 -0
  47. package/training/40-kpi-badge.md +112 -0
  48. package/training/41-kpi-statusDot.md +118 -0
  49. package/training/42-kpi-iconBox.md +114 -0
  50. package/training/43-kpi-gauge.md +143 -0
  51. package/training/44-kpi-bulletChart.md +126 -0
  52. package/training/45-kpi-colorScale.md +143 -0
  53. package/training/46-kpi-rating.md +125 -0
  54. package/training/47-kpi-countdown.md +151 -0
  55. package/training/48-fetchReportData.md +276 -0
  56. package/training/49-printLayout.md +215 -0
  57. package/training/examples/01-login-form.json +176 -0
  58. package/training/examples/02-contact-form.json +141 -0
  59. package/training/examples/03-kpi-cards-row.json +123 -0
  60. package/training/examples/04-settings-toggles.json +153 -0
  61. package/training/examples/05-user-profile-card.json +136 -0
  62. package/training/examples/06-date-range-filter.json +108 -0
  63. package/training/examples/07-search-bar-results.json +130 -0
  64. package/training/examples/08-notification-settings.json +131 -0
  65. package/training/examples/09-employee-profile-form.json +259 -0
  66. package/training/examples/10-invoice-form.json +241 -0
  67. package/training/examples/11-dashboard-overview.json +251 -0
  68. package/training/examples/12-registration-wizard.json +154 -0
  69. package/training/examples/13-product-catalog.json +168 -0
  70. package/training/examples/14-data-table-with-filters.json +180 -0
  71. package/training/examples/15-tabbed-profile.json +92 -0
  72. package/training/examples/16-kpi-full-row.json +203 -0
  73. package/training/examples/17-tree-detail-view.json +139 -0
  74. package/training/examples/18-employee-management.json +233 -0
  75. package/training/examples/19-sales-dashboard.json +272 -0
  76. package/training/examples/20-checkout-wizard.json +225 -0
  77. package/training/examples/21-analytics-page.json +222 -0
  78. package/training/examples/22-hr-onboarding.json +222 -0
  79. package/training/examples/23-document-browser.json +241 -0
  80. package/training/examples/24-order-management.json +290 -0
  81. package/training/examples/25-crm-contact-page.json +272 -0
@@ -0,0 +1,133 @@
1
+ # Component: number
2
+
3
+ A numeric input field with built-in formatting: currency, percentage, decimal, or custom mask patterns.
4
+
5
+ ---
6
+
7
+ ## Props — Main Tab
8
+
9
+ | Prop | Type | Options / Notes |
10
+ |------|------|-----------------|
11
+ | `key` | expression | Unique identifier. Value stored as a number 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, e.g. `data.price`. |
16
+ | `placeholder` | text | Hint text shown when empty. |
17
+ | `size` | select | `small` · `medium` · `large` |
18
+ | `disabled` | boolean | Disables the field. |
19
+ | `enabled` | boolean | Enable/disable from an expression. |
20
+ | `formatType` | select | `decimal` · `currency` · `percentage` · `custom` — Controls how the number is formatted/displayed. |
21
+ | `decimalScale` | expression | Number of decimal places, e.g. `2`. |
22
+ | `fixedDecimalScale` | boolean | Always shows the decimal places (e.g. `10.00` instead of `10`). |
23
+ | `thousandSeparator` | boolean | Adds comma separators every 3 digits (e.g. `1,000,000`). |
24
+ | `currencySymbol` | text | Symbol shown when `formatType: currency`, e.g. `"$"`, `"€"`, `"AED"`. |
25
+ | `prefix` | text | Text prefix before the number, e.g. `"$"` or `"+"`. |
26
+ | `suffix` | text | Text suffix after the number, e.g. `"%"` or `" kg"`. |
27
+ | `allowNegative` | boolean | Permits entering negative values. Default: `true`. |
28
+ | `format` | text | Custom mask pattern, e.g. `"#### #### #### ####"` for credit card numbers. |
29
+
30
+ ---
31
+
32
+ ## Props — Style Tab
33
+
34
+ | Prop | Type | Options / Notes |
35
+ |------|------|-----------------|
36
+ | `color` | select | `default` · `primary` · `secondary` · `error` · `warning` · `info` · `success` |
37
+ | `display` | expression | CSS display. |
38
+ | `width` | expression | Field width. |
39
+ | `height` | expression | Height override. |
40
+ | `margin` | expression | Outer spacing. |
41
+ | `padding` | expression | Inner padding. |
42
+ | `flexDirection` | select | `row` · `column` · `row-reverse` · `column-reverse` |
43
+ | `justifyContent` | select | `flex-start` · `center` · `flex-end` · `space-between` · `space-around` · `space-evenly` |
44
+ | `alignItems` | select | `flex-start` · `center` · `flex-end` · `stretch` · `baseline` |
45
+ | `gap` | expression | Gap between elements. |
46
+
47
+ ---
48
+
49
+ ## Props — Actions Tab
50
+
51
+ | Event | Type | Notes |
52
+ |-------|------|-------|
53
+ | `onChange` | action (custom) | Fires when the numeric value changes. New value in `form[key]`. |
54
+
55
+ ---
56
+
57
+ ## Use Cases
58
+
59
+ **When to use:**
60
+ - Price, salary, quantity, or any numeric form field.
61
+ - Currency amounts needing `$` prefix and thousands separator.
62
+ - Percentage inputs with `%` suffix.
63
+ - Masked formats like phone numbers, credit card numbers.
64
+
65
+ **When NOT to use:**
66
+ - Plain unformatted integer → a regular `input` may suffice.
67
+ - Date/time values → use `datepicker` / `time`.
68
+
69
+ ---
70
+
71
+ ## Schema Examples
72
+
73
+ ### Currency field
74
+ ```json
75
+ {
76
+ "type": "number",
77
+ "props": {
78
+ "key": "price",
79
+ "label": "Price",
80
+ "formatType": "currency",
81
+ "currencySymbol": "$",
82
+ "decimalScale": 2,
83
+ "fixedDecimalScale": true,
84
+ "thousandSeparator": true,
85
+ "required": true
86
+ },
87
+ "style": { "width": "100%" }
88
+ }
89
+ ```
90
+
91
+ ### Percentage
92
+ ```json
93
+ {
94
+ "type": "number",
95
+ "props": {
96
+ "key": "taxRate",
97
+ "label": "Tax Rate",
98
+ "formatType": "percentage",
99
+ "suffix": "%",
100
+ "decimalScale": 2,
101
+ "allowNegative": false
102
+ }
103
+ }
104
+ ```
105
+
106
+ ### Credit card mask
107
+ ```json
108
+ {
109
+ "type": "number",
110
+ "props": {
111
+ "key": "cardNumber",
112
+ "label": "Card Number",
113
+ "formatType": "custom",
114
+ "format": "#### #### #### ####",
115
+ "placeholder": "0000 0000 0000 0000"
116
+ }
117
+ }
118
+ ```
119
+
120
+ ### Plain integer with separator
121
+ ```json
122
+ {
123
+ "type": "number",
124
+ "props": {
125
+ "key": "quantity",
126
+ "label": "Quantity",
127
+ "formatType": "decimal",
128
+ "decimalScale": 0,
129
+ "thousandSeparator": true,
130
+ "allowNegative": false
131
+ }
132
+ }
133
+ ```
@@ -0,0 +1,114 @@
1
+ # Component: textarea
2
+
3
+ A multi-line text input field. Auto-grows from a minimum row count up to `maxRows`.
4
+
5
+ ---
6
+
7
+ ## Props — Main Tab
8
+
9
+ | Prop | Type | Options / Notes |
10
+ |------|------|-----------------|
11
+ | `key` | expression | Unique identifier. Value 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, e.g. `data.notes`. |
16
+ | `placeholder` | text | Greyed hint text when empty. |
17
+ | `rows` | number | Minimum visible rows (default: `4`). |
18
+ | `maxRows` | number | Maximum rows before scrolling begins. Leave blank for unlimited growth. |
19
+ | `size` | select | `small` · `medium` · `large` |
20
+ | `disabled` | boolean | Disables the field. |
21
+ | `enabled` | boolean | Enable/disable from an expression. |
22
+
23
+ ---
24
+
25
+ ## Props — Style Tab
26
+
27
+ | Prop | Type | Options / Notes |
28
+ |------|------|-----------------|
29
+ | `color` | select | `default` · `primary` · `secondary` · `error` · `warning` · `info` · `success` |
30
+ | `display` | expression | CSS display. |
31
+ | `width` | expression | Field width. |
32
+ | `height` | expression | Height override. |
33
+ | `margin` | expression | Outer spacing. |
34
+ | `padding` | expression | Inner padding. |
35
+ | `flexDirection` | select | `row` · `column` · `row-reverse` · `column-reverse` |
36
+ | `justifyContent` | select | `flex-start` · `center` · `flex-end` · `space-between` · `space-around` · `space-evenly` |
37
+ | `alignItems` | select | `flex-start` · `center` · `flex-end` · `stretch` · `baseline` |
38
+ | `gap` | expression | Gap between elements. |
39
+
40
+ ---
41
+
42
+ ## Props — Actions Tab
43
+
44
+ | Event | Type | Notes |
45
+ |-------|------|-------|
46
+ | `onChange` | action (custom) | Fires when content changes. |
47
+ | `onBlur` | action (custom) | Fires when the field loses focus (useful for save-on-leave). |
48
+
49
+ ---
50
+
51
+ ## Use Cases
52
+
53
+ **When to use:**
54
+ - Comments, notes, descriptions, addresses, bio fields.
55
+ - Any multi-line plain text that does NOT need formatting.
56
+ - Large text entries in forms.
57
+
58
+ **When NOT to use:**
59
+ - Rich text with bold/italic/lists → use `richtext`.
60
+ - Single-line input → use `input`.
61
+ - Code/JSON entry → use `input` or a code field.
62
+
63
+ ---
64
+
65
+ ## Schema Examples
66
+
67
+ ### Notes field
68
+ ```json
69
+ {
70
+ "type": "textarea",
71
+ "props": {
72
+ "key": "notes",
73
+ "label": "Notes",
74
+ "placeholder": "Enter any additional notes...",
75
+ "rows": 4,
76
+ "maxRows": 10
77
+ },
78
+ "style": { "width": "100%" }
79
+ }
80
+ ```
81
+
82
+ ### Description with limits
83
+ ```json
84
+ {
85
+ "type": "textarea",
86
+ "props": {
87
+ "key": "description",
88
+ "label": "Description",
89
+ "required": true,
90
+ "rows": 3,
91
+ "maxRows": 6,
92
+ "placeholder": "Describe the issue in detail"
93
+ }
94
+ }
95
+ ```
96
+
97
+ ### With onBlur auto-save
98
+ ```json
99
+ {
100
+ "type": "textarea",
101
+ "props": {
102
+ "key": "memo",
103
+ "label": "Memo",
104
+ "rows": 5,
105
+ "value": "data.record.memo"
106
+ },
107
+ "actions": {
108
+ "onBlur": {
109
+ "type": "custom",
110
+ "code": "saveMemo({ id: data.record.id, memo: form.memo })"
111
+ }
112
+ }
113
+ }
114
+ ```
@@ -0,0 +1,112 @@
1
+ # Component: richtext
2
+
3
+ A WYSIWYG rich text editor (SunEditor). Supports bold, italic, lists, tables, and custom toolbars. Value is stored as HTML string.
4
+
5
+ ---
6
+
7
+ ## Props — Main Tab
8
+
9
+ | Prop | Type | Options / Notes |
10
+ |------|------|-----------------|
11
+ | `key` | expression | Unique identifier. Value stored as HTML string 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 HTML value, e.g. `data.article.body`. |
16
+ | `placeholder` | text | Hint shown when editor is empty. |
17
+ | `disabled` | boolean | Disables the editor. |
18
+ | `enabled` | boolean | Enable/disable from an expression. |
19
+ | `height` | text | Editor height including toolbar, e.g. `"300px"`, `"500px"`. |
20
+ | `mode` | select | `classic` — full toolbar above. `inline` — toolbar appears on text selection. `balloon` — compact balloon toolbar on selection. `balloon-always` — balloon always visible. |
21
+ | `toolbar` | expression | Array of toolbar button names to include. If blank, shows default full toolbar. E.g. `['bold', 'italic', 'list', 'table']`. |
22
+ | `resizingBar` | boolean | Shows a draggable bar at the bottom to resize the editor height. |
23
+ | `showPathLabel` | boolean | Shows the HTML path breadcrumb at the bottom. |
24
+ | `charCounter` | boolean | Displays a character count indicator. |
25
+ | `maxCharCount` | expression | Maximum allowed characters. Enforces a hard limit when set. |
26
+
27
+ ---
28
+
29
+ ## Props — Style Tab
30
+
31
+ Uses common input style fields:
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 | Wrapper height. |
39
+ | `margin` | expression | Outer spacing. |
40
+ | `padding` | expression | Inner padding. |
41
+
42
+ ---
43
+
44
+ ## Props — Actions Tab
45
+
46
+ No actions defined for richtext by default. Use the `onChange` pattern via a wrapping form or custom logic.
47
+
48
+ ---
49
+
50
+ ## Use Cases
51
+
52
+ **When to use:**
53
+ - Article body, blog post content, email templates.
54
+ - Product descriptions needing formatting.
55
+ - Policy/documentation editors.
56
+ - Any case where HTML output is needed.
57
+
58
+ **When NOT to use:**
59
+ - Plain text notes → use `textarea`.
60
+ - Code entry → use a code editor field.
61
+ - Short single-line text → use `input`.
62
+
63
+ ---
64
+
65
+ ## Schema Examples
66
+
67
+ ### Full classic editor
68
+ ```json
69
+ {
70
+ "type": "richtext",
71
+ "props": {
72
+ "key": "articleBody",
73
+ "label": "Article Body",
74
+ "required": true,
75
+ "height": "400px",
76
+ "mode": "classic",
77
+ "resizingBar": true,
78
+ "charCounter": true,
79
+ "maxCharCount": 5000
80
+ },
81
+ "style": { "width": "100%" }
82
+ }
83
+ ```
84
+
85
+ ### Inline mode with minimal toolbar
86
+ ```json
87
+ {
88
+ "type": "richtext",
89
+ "props": {
90
+ "key": "emailTemplate",
91
+ "label": "Email Body",
92
+ "height": "250px",
93
+ "mode": "inline",
94
+ "toolbar": "['bold', 'italic', 'underline', 'list', 'link']",
95
+ "showPathLabel": false
96
+ }
97
+ }
98
+ ```
99
+
100
+ ### Read-only display (disabled)
101
+ ```json
102
+ {
103
+ "type": "richtext",
104
+ "props": {
105
+ "key": "policyContent",
106
+ "label": "Policy",
107
+ "value": "data.policy.content",
108
+ "disabled": true,
109
+ "height": "300px"
110
+ }
111
+ }
112
+ ```
@@ -0,0 +1,110 @@
1
+ # Component: tag
2
+
3
+ A multi-value chip/tag input. Users can select from a predefined list and/or type custom tags (freeSolo mode). Value is an array.
4
+
5
+ ---
6
+
7
+ ## Props — Main Tab
8
+
9
+ | Prop | Type | Options / Notes |
10
+ |------|------|-----------------|
11
+ | `key` | expression | Unique identifier. Value stored as an array 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 array value, e.g. `data.selectedTags`. |
16
+ | `placeholder` | text | Hint shown when no tags selected. |
17
+ | `size` | select | `small` · `medium` · `large` |
18
+ | `disabled` | boolean | Disables the tag input. |
19
+ | `enabled` | boolean | Enable/disable from an expression. |
20
+ | `options` | options-editor | Predefined `{ label, value }` pairs to suggest. Can also be bound to `data.tagList`. |
21
+ | `freeSolo` | boolean | `true` allows users to type and add arbitrary tags not in the options list. |
22
+
23
+ ---
24
+
25
+ ## Props — Style Tab
26
+
27
+ | Prop | Type | Options / Notes |
28
+ |------|------|-----------------|
29
+ | `color` | select | `default` · `primary` · `secondary` · `error` · `warning` · `info` · `success` |
30
+ | `display` | expression | CSS display. |
31
+ | `width` | expression | Field width. |
32
+ | `height` | expression | Wrapper height. |
33
+ | `margin` | expression | Outer spacing. |
34
+ | `padding` | expression | Inner padding. |
35
+ | `flexDirection` | select | `row` · `column` · `row-reverse` · `column-reverse` |
36
+ | `justifyContent` | select | `flex-start` · `center` · `flex-end` · `space-between` · `space-around` · `space-evenly` |
37
+ | `alignItems` | select | `flex-start` · `center` · `flex-end` · `stretch` · `baseline` |
38
+ | `gap` | expression | Gap between elements. |
39
+
40
+ ---
41
+
42
+ ## Props — Actions Tab
43
+
44
+ | Event | Type | Notes |
45
+ |-------|------|-------|
46
+ | `onChange` | action (custom) | Fires when tags are added or removed. New array in `form[key]`. |
47
+
48
+ ---
49
+
50
+ ## Use Cases
51
+
52
+ **When to use:**
53
+ - Multi-value selection where values render as chips: skills, categories, labels, interests.
54
+ - Keyword/tag fields where users define custom values (`freeSolo: true`).
55
+ - Filtering systems with multiple concurrent tags.
56
+
57
+ **When NOT to use:**
58
+ - Single selection → use `dropdown`.
59
+ - Mutually exclusive options → use `radio`.
60
+ - Large structured lists → use `autocomplete` or `dropdown multiple`.
61
+
62
+ ---
63
+
64
+ ## Schema Examples
65
+
66
+ ### Tag field with predefined options
67
+ ```json
68
+ {
69
+ "type": "tag",
70
+ "props": {
71
+ "key": "skills",
72
+ "label": "Skills",
73
+ "options": [
74
+ { "label": "JavaScript", "value": "js" },
75
+ { "label": "Python", "value": "py" },
76
+ { "label": "React", "value": "react" },
77
+ { "label": "SQL", "value": "sql" }
78
+ ],
79
+ "placeholder": "Select skills..."
80
+ },
81
+ "style": { "width": "100%" }
82
+ }
83
+ ```
84
+
85
+ ### Free-text tags (no predefined list)
86
+ ```json
87
+ {
88
+ "type": "tag",
89
+ "props": {
90
+ "key": "keywords",
91
+ "label": "Keywords",
92
+ "freeSolo": true,
93
+ "placeholder": "Type and press Enter to add"
94
+ }
95
+ }
96
+ ```
97
+
98
+ ### Pre-filled with data
99
+ ```json
100
+ {
101
+ "type": "tag",
102
+ "props": {
103
+ "key": "categories",
104
+ "label": "Categories",
105
+ "value": "data.item.categories",
106
+ "options": "data.allCategories",
107
+ "size": "small"
108
+ }
109
+ }
110
+ ```
@@ -0,0 +1,107 @@
1
+ # Component: time
2
+
3
+ A time picker field with clock popup. Supports 12-hour AM/PM and 24-hour formats, and configurable minute steps.
4
+
5
+ ---
6
+
7
+ ## Props — Main Tab
8
+
9
+ | Prop | Type | Options / Notes |
10
+ |------|------|-----------------|
11
+ | `key` | expression | Unique identifier. Value stored as time string 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, e.g. `data.appointmentTime`. |
16
+ | `placeholder` | text | Hint shown when empty, e.g. `"HH:MM"`. |
17
+ | `size` | select | `small` · `medium` · `large` |
18
+ | `disabled` | boolean | Disables the field. |
19
+ | `enabled` | boolean | Enable/disable from an expression. |
20
+ | `ampm` | boolean | `true` shows 12-hour clock with AM/PM. `false` (default) uses 24-hour. |
21
+ | `minutesStep` | expression | Step size for minute selection, e.g. `5`, `15`, `30`. Default: `1`. |
22
+ | `readOnly` | boolean | Displays value but prevents editing. |
23
+
24
+ ---
25
+
26
+ ## Props — Style Tab
27
+
28
+ | Prop | Type | Options / Notes |
29
+ |------|------|-----------------|
30
+ | `color` | select | `default` · `primary` · `secondary` · `error` · `warning` · `info` · `success` |
31
+ | `display` | expression | CSS display. |
32
+ | `width` | expression | Field width. |
33
+ | `height` | expression | Height override. |
34
+ | `margin` | expression | Outer spacing. |
35
+ | `padding` | expression | Inner padding. |
36
+ | `flexDirection` | select | `row` · `column` · `row-reverse` · `column-reverse` |
37
+ | `justifyContent` | select | `flex-start` · `center` · `flex-end` · `space-between` · `space-around` · `space-evenly` |
38
+ | `alignItems` | select | `flex-start` · `center` · `flex-end` · `stretch` · `baseline` |
39
+ | `gap` | expression | Gap between elements. |
40
+
41
+ ---
42
+
43
+ ## Props — Actions Tab
44
+
45
+ | Event | Type | Notes |
46
+ |-------|------|-------|
47
+ | `onChange` | action (custom) | Fires when the time changes. New value in `form[key]`. |
48
+
49
+ ---
50
+
51
+ ## Use Cases
52
+
53
+ **When to use:**
54
+ - Appointment time, shift start/end, schedule entry fields.
55
+ - Time-only selection when date is handled separately.
56
+ - Meeting booking with quarter-hour steps (`minutesStep: 15`).
57
+
58
+ **When NOT to use:**
59
+ - Date-only → use `datepicker`.
60
+ - Duration entry (hours + minutes as a number) → use `number`.
61
+
62
+ ---
63
+
64
+ ## Schema Examples
65
+
66
+ ### 24-hour time field
67
+ ```json
68
+ {
69
+ "type": "time",
70
+ "props": {
71
+ "key": "startTime",
72
+ "label": "Start Time",
73
+ "required": true,
74
+ "ampm": false,
75
+ "minutesStep": 15,
76
+ "placeholder": "HH:MM"
77
+ }
78
+ }
79
+ ```
80
+
81
+ ### 12-hour AM/PM
82
+ ```json
83
+ {
84
+ "type": "time",
85
+ "props": {
86
+ "key": "appointmentTime",
87
+ "label": "Appointment Time",
88
+ "ampm": true,
89
+ "minutesStep": 30
90
+ },
91
+ "style": { "width": "200px" }
92
+ }
93
+ ```
94
+
95
+ ### Read-only
96
+ ```json
97
+ {
98
+ "type": "time",
99
+ "props": {
100
+ "key": "closingTime",
101
+ "label": "Closing Time",
102
+ "value": "data.store.closingTime",
103
+ "readOnly": true,
104
+ "ampm": false
105
+ }
106
+ }
107
+ ```
@@ -0,0 +1,108 @@
1
+ # Component: toggle
2
+
3
+ A Material UI Switch rendered as a sliding toggle. Boolean on/off, with color variants.
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]`. |
12
+ | `label` | expression | Label text shown next to the toggle. |
13
+ | `labelPosition` | select | `top` · `left` · `right` · `none` |
14
+ | `required` | boolean | Marks field required. |
15
+ | `value` | expression | Controlled boolean value, e.g. `data.settings.darkMode`. |
16
+ | `size` | select | `small` · `medium` · `large` |
17
+ | `color` | select | `default` · `primary` · `secondary` · `error` · `warning` · `info` · `success` — Color of the toggle when ON. |
18
+ | `disabled` | boolean | Prevents toggling. |
19
+ | `enabled` | boolean | Enable/disable from an expression. |
20
+
21
+ ---
22
+
23
+ ## Props — Style Tab
24
+
25
+ | Prop | Type | Options / Notes |
26
+ |------|------|-----------------|
27
+ | `color` | select | `default` · `primary` · `secondary` · `error` · `warning` · `info` · `success` |
28
+ | `display` | expression | CSS display. |
29
+ | `width` | expression | Wrapper width. |
30
+ | `height` | expression | Wrapper height. |
31
+ | `margin` | expression | Outer spacing. |
32
+ | `padding` | expression | Inner padding. |
33
+ | `flexDirection` | select | `row` · `column` · `row-reverse` · `column-reverse` |
34
+ | `justifyContent` | select | `flex-start` · `center` · `flex-end` · `space-between` · `space-around` · `space-evenly` |
35
+ | `alignItems` | select | `flex-start` · `center` · `flex-end` · `stretch` · `baseline` |
36
+ | `gap` | expression | Gap between elements. |
37
+
38
+ ---
39
+
40
+ ## Props — Actions Tab
41
+
42
+ | Event | Type | Notes |
43
+ |-------|------|-------|
44
+ | `onChange` | action (custom) | Fires when the toggle state changes. New boolean value in `form[key]`. |
45
+
46
+ ---
47
+
48
+ ## Use Cases
49
+
50
+ **When to use:**
51
+ - On/Off feature flags: dark mode, notifications, maintenance mode.
52
+ - Settings panels with instant effect toggles.
53
+ - Any boolean that benefits from the visual "switch" metaphor over a checkbox.
54
+
55
+ **When NOT to use:**
56
+ - Needs confirmation before applying → use `checkbox` + a save button.
57
+ - Multiple mutually exclusive options → use `radio`.
58
+ - Multi-select → use `tag` or `dropdown multiple`.
59
+
60
+ ---
61
+
62
+ ## Schema Examples
63
+
64
+ ### Feature toggle
65
+ ```json
66
+ {
67
+ "type": "toggle",
68
+ "props": {
69
+ "key": "notifications",
70
+ "label": "Enable Notifications",
71
+ "color": "primary",
72
+ "size": "medium",
73
+ "value": "data.settings.notifications"
74
+ }
75
+ }
76
+ ```
77
+
78
+ ### With onChange (immediate effect)
79
+ ```json
80
+ {
81
+ "type": "toggle",
82
+ "props": {
83
+ "key": "darkMode",
84
+ "label": "Dark Mode",
85
+ "color": "secondary"
86
+ },
87
+ "actions": {
88
+ "onChange": {
89
+ "type": "custom",
90
+ "code": "setTheme(form.darkMode ? 'dark' : 'light')"
91
+ }
92
+ }
93
+ }
94
+ ```
95
+
96
+ ### Disabled read-only status
97
+ ```json
98
+ {
99
+ "type": "toggle",
100
+ "props": {
101
+ "key": "isVerified",
102
+ "label": "Verified",
103
+ "value": "data.user.isVerified",
104
+ "color": "success",
105
+ "disabled": true
106
+ }
107
+ }
108
+ ```