@cxtms/cx-schema 1.0.0

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 (133) hide show
  1. package/README.md +384 -0
  2. package/dist/cli.d.ts +6 -0
  3. package/dist/cli.d.ts.map +1 -0
  4. package/dist/cli.js +1523 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/index.d.ts +7 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +11 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/types.d.ts +111 -0
  11. package/dist/types.d.ts.map +1 -0
  12. package/dist/types.js +6 -0
  13. package/dist/types.js.map +1 -0
  14. package/dist/utils/schemaLoader.d.ts +17 -0
  15. package/dist/utils/schemaLoader.d.ts.map +1 -0
  16. package/dist/utils/schemaLoader.js +134 -0
  17. package/dist/utils/schemaLoader.js.map +1 -0
  18. package/dist/validator.d.ts +64 -0
  19. package/dist/validator.d.ts.map +1 -0
  20. package/dist/validator.js +380 -0
  21. package/dist/validator.js.map +1 -0
  22. package/dist/workflowValidator.d.ts +64 -0
  23. package/dist/workflowValidator.d.ts.map +1 -0
  24. package/dist/workflowValidator.js +410 -0
  25. package/dist/workflowValidator.js.map +1 -0
  26. package/package.json +50 -0
  27. package/schemas/actions/all.json +26 -0
  28. package/schemas/actions/confirm.json +21 -0
  29. package/schemas/actions/consoleLog.json +16 -0
  30. package/schemas/actions/dialog.json +25 -0
  31. package/schemas/actions/fileDownload.json +16 -0
  32. package/schemas/actions/forEach.json +31 -0
  33. package/schemas/actions/if.json +12 -0
  34. package/schemas/actions/mutation.json +25 -0
  35. package/schemas/actions/navigate.json +18 -0
  36. package/schemas/actions/navigateBack.json +22 -0
  37. package/schemas/actions/navigateBackOrClose.json +21 -0
  38. package/schemas/actions/notification.json +19 -0
  39. package/schemas/actions/openBarcodeScanner.json +104 -0
  40. package/schemas/actions/query.json +32 -0
  41. package/schemas/actions/refresh.json +13 -0
  42. package/schemas/actions/resetDirtyState.json +22 -0
  43. package/schemas/actions/setFields.json +21 -0
  44. package/schemas/actions/setStore.json +13 -0
  45. package/schemas/actions/validateForm.json +15 -0
  46. package/schemas/actions/workflow.json +24 -0
  47. package/schemas/components/README.md +147 -0
  48. package/schemas/components/appComponent.json +50 -0
  49. package/schemas/components/barcodeScanner.json +69 -0
  50. package/schemas/components/button.json +123 -0
  51. package/schemas/components/calendar.json +489 -0
  52. package/schemas/components/card.json +176 -0
  53. package/schemas/components/collection.json +54 -0
  54. package/schemas/components/dataGrid.json +119 -0
  55. package/schemas/components/datasource.json +151 -0
  56. package/schemas/components/dropdown.json +57 -0
  57. package/schemas/components/field-collection.json +618 -0
  58. package/schemas/components/field.json +265 -0
  59. package/schemas/components/form.json +234 -0
  60. package/schemas/components/index.json +68 -0
  61. package/schemas/components/layout.json +69 -0
  62. package/schemas/components/module.json +138 -0
  63. package/schemas/components/navDropdown.json +36 -0
  64. package/schemas/components/navbar.json +78 -0
  65. package/schemas/components/navbarItem.json +28 -0
  66. package/schemas/components/navbarLink.json +36 -0
  67. package/schemas/components/row.json +31 -0
  68. package/schemas/components/tab.json +34 -0
  69. package/schemas/components/tabs.json +35 -0
  70. package/schemas/components/timeline.json +172 -0
  71. package/schemas/components/timelineGrid.json +324 -0
  72. package/schemas/fields/README.md +66 -0
  73. package/schemas/fields/attachment.json +156 -0
  74. package/schemas/fields/autocomplete-googleplaces.json +130 -0
  75. package/schemas/fields/checkbox.json +82 -0
  76. package/schemas/fields/date.json +88 -0
  77. package/schemas/fields/datetime.json +75 -0
  78. package/schemas/fields/email.json +75 -0
  79. package/schemas/fields/index.json +53 -0
  80. package/schemas/fields/number.json +91 -0
  81. package/schemas/fields/password.json +70 -0
  82. package/schemas/fields/radio.json +94 -0
  83. package/schemas/fields/rangedatetime.json +56 -0
  84. package/schemas/fields/select-async.json +334 -0
  85. package/schemas/fields/select.json +115 -0
  86. package/schemas/fields/tel.json +79 -0
  87. package/schemas/fields/text.json +86 -0
  88. package/schemas/fields/textarea.json +95 -0
  89. package/schemas/fields/time.json +91 -0
  90. package/schemas/fields/url.json +74 -0
  91. package/schemas/schema.graphql +10492 -0
  92. package/schemas/schemas.json +598 -0
  93. package/schemas/workflows/activity.json +111 -0
  94. package/schemas/workflows/common/condition.json +48 -0
  95. package/schemas/workflows/common/expression.json +76 -0
  96. package/schemas/workflows/common/mapping.json +134 -0
  97. package/schemas/workflows/input.json +76 -0
  98. package/schemas/workflows/output.json +41 -0
  99. package/schemas/workflows/schedule.json +26 -0
  100. package/schemas/workflows/tasks/accounting-transaction.json +95 -0
  101. package/schemas/workflows/tasks/all.json +34 -0
  102. package/schemas/workflows/tasks/attachment.json +94 -0
  103. package/schemas/workflows/tasks/charge.json +90 -0
  104. package/schemas/workflows/tasks/commodity.json +89 -0
  105. package/schemas/workflows/tasks/contact.json +82 -0
  106. package/schemas/workflows/tasks/csv.json +79 -0
  107. package/schemas/workflows/tasks/document-render.json +105 -0
  108. package/schemas/workflows/tasks/document-send.json +84 -0
  109. package/schemas/workflows/tasks/email-send.json +110 -0
  110. package/schemas/workflows/tasks/error.json +72 -0
  111. package/schemas/workflows/tasks/export.json +90 -0
  112. package/schemas/workflows/tasks/foreach.json +69 -0
  113. package/schemas/workflows/tasks/generic.json +47 -0
  114. package/schemas/workflows/tasks/graphql.json +78 -0
  115. package/schemas/workflows/tasks/httpRequest.json +119 -0
  116. package/schemas/workflows/tasks/job.json +88 -0
  117. package/schemas/workflows/tasks/log.json +73 -0
  118. package/schemas/workflows/tasks/map.json +58 -0
  119. package/schemas/workflows/tasks/order.json +87 -0
  120. package/schemas/workflows/tasks/payment.json +85 -0
  121. package/schemas/workflows/tasks/setVariable.json +76 -0
  122. package/schemas/workflows/tasks/switch.json +75 -0
  123. package/schemas/workflows/tasks/template.json +73 -0
  124. package/schemas/workflows/tasks/validation.json +90 -0
  125. package/schemas/workflows/tasks/while.json +53 -0
  126. package/schemas/workflows/tasks/workflow-execute.json +82 -0
  127. package/schemas/workflows/trigger.json +86 -0
  128. package/schemas/workflows/variable.json +46 -0
  129. package/schemas/workflows/workflow.json +172 -0
  130. package/scripts/postinstall.js +161 -0
  131. package/scripts/setup-vscode.js +80 -0
  132. package/templates/module.yaml +83 -0
  133. package/templates/workflow.yaml +100 -0
@@ -0,0 +1,618 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "field-collection-component",
4
+ "title": "Field Collection Component",
5
+ "description": "A component for managing arrays of form fields with built-in add/remove functionality, grouping, and templates. Supports grouping items by any field (e.g., day of week, status, category) with per-group add buttons and custom group templates.",
6
+ "type": "object",
7
+ "required": ["component", "props"],
8
+ "properties": {
9
+ "component": {
10
+ "type": "string",
11
+ "const": "field-collection",
12
+ "description": "Component type identifier"
13
+ },
14
+ "name": {
15
+ "type": "string",
16
+ "description": "Unique identifier for the component",
17
+ "x-example": "businessHoursCollection"
18
+ },
19
+ "props": {
20
+ "type": "object",
21
+ "required": ["fieldName", "itemTemplate"],
22
+ "properties": {
23
+ "fieldName": {
24
+ "type": "string",
25
+ "description": "The form field name this collection binds to",
26
+ "x-example": "businessHours"
27
+ },
28
+ "itemTemplate": {
29
+ "oneOf": [
30
+ {
31
+ "type": "object",
32
+ "description": "Single component template for each item"
33
+ },
34
+ {
35
+ "type": "array",
36
+ "description": "Multiple component templates for each item",
37
+ "items": {
38
+ "type": "object"
39
+ }
40
+ }
41
+ ],
42
+ "x-example": {
43
+ "component": "layout",
44
+ "props": {
45
+ "cols": 3
46
+ },
47
+ "children": [
48
+ {
49
+ "component": "field",
50
+ "name": "startTime",
51
+ "props": {
52
+ "type": "time",
53
+ "label": "Start"
54
+ }
55
+ },
56
+ {
57
+ "component": "field",
58
+ "name": "endTime",
59
+ "props": {
60
+ "type": "time",
61
+ "label": "End"
62
+ }
63
+ }
64
+ ]
65
+ }
66
+ },
67
+ "options": {
68
+ "type": "object",
69
+ "description": "Collection management options",
70
+ "properties": {
71
+ "allowAdd": {
72
+ "type": "boolean",
73
+ "default": true,
74
+ "description": "Allow adding new items",
75
+ "x-example": true
76
+ },
77
+ "allowRemove": {
78
+ "type": "boolean",
79
+ "default": true,
80
+ "description": "Allow removing individual items",
81
+ "x-example": true
82
+ },
83
+ "allowRemoveAll": {
84
+ "type": "boolean",
85
+ "default": false,
86
+ "description": "Show remove all button",
87
+ "x-example": false
88
+ },
89
+ "allowReorder": {
90
+ "type": "boolean",
91
+ "default": true,
92
+ "description": "Allow drag-and-drop reordering",
93
+ "x-example": true
94
+ },
95
+ "minItems": {
96
+ "type": "integer",
97
+ "minimum": 0,
98
+ "default": 0,
99
+ "description": "Minimum number of items required",
100
+ "x-example": 1
101
+ },
102
+ "maxItems": {
103
+ "type": "integer",
104
+ "minimum": 1,
105
+ "default": null,
106
+ "description": "Maximum number of items allowed",
107
+ "x-example": 10
108
+ }
109
+ },
110
+ "x-example": {
111
+ "allowAdd": true,
112
+ "allowRemove": true,
113
+ "allowReorder": true,
114
+ "minItems": 0,
115
+ "maxItems": 7
116
+ }
117
+ },
118
+ "addButton": {
119
+ "type": "object",
120
+ "description": "Customize the add button",
121
+ "properties": {
122
+ "label": {
123
+ "type": ["string", "object"],
124
+ "description": "Button label (can be localized)",
125
+ "x-example": {
126
+ "en-US": "Add Time Slot"
127
+ }
128
+ },
129
+ "icon": {
130
+ "type": "string",
131
+ "default": "plus",
132
+ "description": "FontAwesome icon name",
133
+ "x-example": "plus"
134
+ },
135
+ "variant": {
136
+ "type": "string",
137
+ "enum": ["text", "outlined", "contained"],
138
+ "default": "outlined",
139
+ "description": "Material-UI button variant",
140
+ "x-example": "contained"
141
+ },
142
+ "position": {
143
+ "type": "string",
144
+ "enum": ["top", "bottom", "both"],
145
+ "default": "bottom",
146
+ "description": "Where to show the add button",
147
+ "x-example": "bottom"
148
+ }
149
+ },
150
+ "x-example": {
151
+ "label": {
152
+ "en-US": "Add New Item"
153
+ },
154
+ "icon": "plus",
155
+ "variant": "contained",
156
+ "position": "bottom"
157
+ }
158
+ },
159
+ "removeButton": {
160
+ "type": "object",
161
+ "description": "Customize the remove button",
162
+ "properties": {
163
+ "label": {
164
+ "type": ["string", "object"],
165
+ "description": "Button label (can be localized)",
166
+ "x-example": {
167
+ "en-US": "Remove"
168
+ }
169
+ },
170
+ "icon": {
171
+ "type": "string",
172
+ "default": "trash",
173
+ "description": "FontAwesome icon name",
174
+ "x-example": "trash"
175
+ },
176
+ "variant": {
177
+ "type": "string",
178
+ "enum": ["text", "outlined", "contained"],
179
+ "default": "outlined",
180
+ "description": "Material-UI button variant",
181
+ "x-example": "outlined"
182
+ }
183
+ },
184
+ "x-example": {
185
+ "icon": "trash",
186
+ "variant": "outlined"
187
+ }
188
+ },
189
+ "defaultItem": {
190
+ "type": ["object", "array", "string", "number", "boolean"],
191
+ "description": "Default values for new items",
192
+ "x-example": {
193
+ "dayOfWeek": 1,
194
+ "startTime": "09:00:00",
195
+ "endTime": "17:00:00",
196
+ "isClosed": false
197
+ }
198
+ },
199
+ "groupMode": {
200
+ "type": "boolean",
201
+ "default": false,
202
+ "description": "Enable grouping of items. When enabled, items are organized into groups based on the groupBy field value. Each group gets its own add button that automatically sets the groupBy field value for new items.",
203
+ "x-example": true
204
+ },
205
+ "groupBy": {
206
+ "type": "string",
207
+ "description": "Field name to group items by (required if groupMode is true). Common examples: 'dayOfWeek' for business hours, 'status' for tasks, 'category' for products.",
208
+ "x-example": "dayOfWeek"
209
+ },
210
+ "groups": {
211
+ "type": "array",
212
+ "description": "Define available groups. When groupMode is enabled, items are organized into these groups based on the groupBy field value. Each group gets its own add button when allowAdd is true.",
213
+ "items": {
214
+ "type": "object",
215
+ "required": ["key", "label"],
216
+ "properties": {
217
+ "key": {
218
+ "type": ["string", "number"],
219
+ "description": "Group identifier (matches the value in groupBy field)",
220
+ "x-example": 1
221
+ },
222
+ "label": {
223
+ "type": ["string", "object"],
224
+ "description": "Group display label (can be localized)",
225
+ "x-example": {
226
+ "en-US": "Monday"
227
+ }
228
+ },
229
+ "icon": {
230
+ "type": "string",
231
+ "description": "FontAwesome icon for the group",
232
+ "x-example": "calendar"
233
+ }
234
+ }
235
+ },
236
+ "x-example": [
237
+ {
238
+ "key": "pending",
239
+ "label": {
240
+ "en-US": "Pending"
241
+ },
242
+ "icon": "clock"
243
+ },
244
+ {
245
+ "key": "completed",
246
+ "label": {
247
+ "en-US": "Completed"
248
+ },
249
+ "icon": "check"
250
+ }
251
+ ]
252
+ },
253
+ "groupTemplate": {
254
+ "type": "object",
255
+ "description": "Custom template for group headers",
256
+ "x-example": {
257
+ "component": "layout",
258
+ "children": [
259
+ {
260
+ "component": "text",
261
+ "props": {
262
+ "value": "{{ groupLabel }} ({{ groupCount }})",
263
+ "type": "h5"
264
+ }
265
+ }
266
+ ]
267
+ }
268
+ },
269
+ "layout": {
270
+ "type": "string",
271
+ "enum": ["list", "grid", "accordion"],
272
+ "default": "list",
273
+ "description": "Layout style for items",
274
+ "x-example": "grid"
275
+ },
276
+ "cols": {
277
+ "type": "integer",
278
+ "minimum": 1,
279
+ "maximum": 12,
280
+ "default": 1,
281
+ "description": "Number of columns for grid layout",
282
+ "x-example": 2
283
+ },
284
+ "spacing": {
285
+ "type": "integer",
286
+ "minimum": 0,
287
+ "maximum": 10,
288
+ "default": 2,
289
+ "description": "Spacing between items (Material-UI spacing units)",
290
+ "x-example": 3
291
+ },
292
+ "showIndex": {
293
+ "type": "boolean",
294
+ "default": false,
295
+ "description": "Show item index numbers",
296
+ "x-example": true
297
+ },
298
+ "showDragHandle": {
299
+ "type": "boolean",
300
+ "default": false,
301
+ "description": "Show drag handle for reordering",
302
+ "x-example": true
303
+ },
304
+ "containerClass": {
305
+ "type": "string",
306
+ "description": "CSS class for the container",
307
+ "x-example": "business-hours-container"
308
+ },
309
+ "itemClass": {
310
+ "type": "string",
311
+ "description": "CSS class for each item",
312
+ "x-example": "collection-item"
313
+ }
314
+ }
315
+ }
316
+ },
317
+ "x-examples": {
318
+ "simplifiedBusinessHours": {
319
+ "component": "field-collection",
320
+ "name": "businessHoursSimple",
321
+ "props": {
322
+ "fieldName": "businessHours",
323
+ "groupMode": true,
324
+ "groupBy": "dayOfWeek",
325
+ "groups": [
326
+ { "key": 1, "label": "Monday" },
327
+ { "key": 2, "label": "Tuesday" },
328
+ { "key": 3, "label": "Wednesday" },
329
+ { "key": 4, "label": "Thursday" },
330
+ { "key": 5, "label": "Friday" },
331
+ { "key": 6, "label": "Saturday" },
332
+ { "key": 0, "label": "Sunday" }
333
+ ],
334
+ "layout": "accordion",
335
+ "defaultItem": {
336
+ "startTime": "09:00:00",
337
+ "endTime": "17:00:00"
338
+ },
339
+ "itemTemplate": {
340
+ "component": "layout",
341
+ "props": { "cols": 2 },
342
+ "children": [
343
+ {
344
+ "component": "field",
345
+ "name": "startTime",
346
+ "props": { "type": "time", "label": "Start" }
347
+ },
348
+ {
349
+ "component": "field",
350
+ "name": "endTime",
351
+ "props": { "type": "time", "label": "End" }
352
+ }
353
+ ]
354
+ }
355
+ }
356
+ },
357
+ "simple": {
358
+ "component": "field-collection",
359
+ "name": "phoneNumbers",
360
+ "props": {
361
+ "fieldName": "contacts.phoneNumbers",
362
+ "itemTemplate": {
363
+ "component": "field",
364
+ "name": "number",
365
+ "props": { "type": "tel", "label": "Phone Number" }
366
+ },
367
+ "defaultItem": { "number": "" },
368
+ "addButton": { "label": "Add Phone Number" }
369
+ }
370
+ },
371
+ "businessHours": {
372
+ "component": "field-collection",
373
+ "name": "mondayHours",
374
+ "props": {
375
+ "fieldName": "businessHoursMonday",
376
+ "options": { "allowAdd": true, "allowRemove": true, "minItems": 0, "maxItems": 3 },
377
+ "addButton": {
378
+ "label": { "en-US": "Add Time Slot" },
379
+ "icon": "plus",
380
+ "position": "bottom"
381
+ },
382
+ "defaultItem": { "dayOfWeek": 1, "startTime": "09:00:00", "endTime": "17:00:00" },
383
+ "layout": "list",
384
+ "showIndex": true,
385
+ "itemTemplate": {
386
+ "component": "layout",
387
+ "props": { "cols": 2 },
388
+ "children": [
389
+ { "component": "field", "name": "startTime", "props": { "label": "Start", "type": "time" } },
390
+ { "component": "field", "name": "endTime", "props": { "label": "End", "type": "time" } }
391
+ ]
392
+ }
393
+ }
394
+ },
395
+ "groupedTasks": {
396
+ "component": "field-collection",
397
+ "name": "tasksCollection",
398
+ "props": {
399
+ "fieldName": "project.tasks",
400
+ "groupMode": true,
401
+ "groupBy": "status",
402
+ "groups": [
403
+ { "key": "todo", "label": { "en-US": "To Do" }, "icon": "list" },
404
+ { "key": "in_progress", "label": { "en-US": "In Progress" }, "icon": "spinner" },
405
+ { "key": "done", "label": { "en-US": "Done" }, "icon": "check-circle" }
406
+ ],
407
+ "groupTemplate": {
408
+ "component": "layout",
409
+ "props": { "className": "group-header bg-gray-100 p-2 rounded" },
410
+ "children": [
411
+ { "component": "text", "props": { "value": "{{ groupLabel }}", "type": "h6" } },
412
+ { "component": "badge", "props": { "value": "{{ groupCount }}" } }
413
+ ]
414
+ },
415
+ "layout": "accordion",
416
+ "options": { "allowAdd": true, "allowRemove": true, "allowReorder": true },
417
+ "defaultItem": { "title": "", "description": "", "status": "todo", "assignee": null },
418
+ "addButton": { "label": { "en-US": "New Task" }, "icon": "plus", "variant": "contained", "position": "top" },
419
+ "itemTemplate": {
420
+ "component": "card",
421
+ "props": { "variant": "outlined" },
422
+ "children": [
423
+ {
424
+ "component": "layout",
425
+ "props": { "cols": 3 },
426
+ "children": [
427
+ {
428
+ "component": "field",
429
+ "name": "title",
430
+ "props": { "label": "Title", "type": "text", "required": true }
431
+ },
432
+ {
433
+ "component": "field",
434
+ "name": "status",
435
+ "props": {
436
+ "label": "Status",
437
+ "type": "select",
438
+ "options": [
439
+ { "value": "todo", "label": "To Do" },
440
+ { "value": "in_progress", "label": "In Progress" },
441
+ { "value": "done", "label": "Done" }
442
+ ]
443
+ }
444
+ },
445
+ {
446
+ "component": "field",
447
+ "name": "assignee",
448
+ "props": { "label": "Assignee", "type": "select", "options": "{{ users }}" }
449
+ }
450
+ ]
451
+ },
452
+ {
453
+ "component": "field",
454
+ "name": "description",
455
+ "props": { "label": "Description", "type": "textarea", "rows": 3 }
456
+ }
457
+ ]
458
+ }
459
+ }
460
+ },
461
+ "gridContacts": {
462
+ "component": "field-collection",
463
+ "name": "contactsGrid",
464
+ "props": {
465
+ "fieldName": "company.contacts",
466
+ "layout": "grid",
467
+ "cols": 3,
468
+ "spacing": 3,
469
+ "options": {
470
+ "allowAdd": true,
471
+ "allowRemove": true,
472
+ "allowRemoveAll": true,
473
+ "allowReorder": false,
474
+ "minItems": 1,
475
+ "maxItems": 12
476
+ },
477
+ "showDragHandle": false,
478
+ "showIndex": false,
479
+ "defaultItem": { "firstName": "", "lastName": "", "email": "", "phone": "", "department": "" },
480
+ "addButton": {
481
+ "label": { "en-US": "Add Contact" },
482
+ "icon": "user-plus",
483
+ "variant": "contained",
484
+ "position": "both"
485
+ },
486
+ "containerClass": "contacts-grid",
487
+ "itemClass": "contact-card",
488
+ "itemTemplate": {
489
+ "component": "card",
490
+ "props": { "variant": "elevation", "elevation": 2 },
491
+ "children": [
492
+ {
493
+ "component": "layout",
494
+ "props": { "cols": 1 },
495
+ "children": [
496
+ {
497
+ "component": "field",
498
+ "name": "firstName",
499
+ "props": { "label": "First Name", "type": "text", "required": true }
500
+ },
501
+ {
502
+ "component": "field",
503
+ "name": "lastName",
504
+ "props": { "label": "Last Name", "type": "text", "required": true }
505
+ },
506
+ {
507
+ "component": "field",
508
+ "name": "email",
509
+ "props": { "label": "Email", "type": "email", "required": true }
510
+ },
511
+ { "component": "field", "name": "phone", "props": { "label": "Phone", "type": "tel" } },
512
+ {
513
+ "component": "field",
514
+ "name": "department",
515
+ "props": {
516
+ "label": "Department",
517
+ "type": "select",
518
+ "options": [
519
+ { "value": "sales", "label": "Sales" },
520
+ { "value": "support", "label": "Support" },
521
+ { "value": "engineering", "label": "Engineering" },
522
+ { "value": "management", "label": "Management" }
523
+ ]
524
+ }
525
+ }
526
+ ]
527
+ }
528
+ ]
529
+ }
530
+ }
531
+ },
532
+ "businessHoursByDay": {
533
+ "component": "field-collection",
534
+ "name": "businessHoursCollection",
535
+ "props": {
536
+ "fieldName": "businessHours",
537
+ "groupMode": true,
538
+ "groupBy": "dayOfWeek",
539
+ "groups": [
540
+ { "key": 0, "label": { "en-US": "Sunday" }, "icon": "calendar-check" },
541
+ { "key": 1, "label": { "en-US": "Monday" }, "icon": "calendar" },
542
+ { "key": 2, "label": { "en-US": "Tuesday" }, "icon": "calendar" },
543
+ { "key": 3, "label": { "en-US": "Wednesday" }, "icon": "calendar" },
544
+ { "key": 4, "label": { "en-US": "Thursday" }, "icon": "calendar" },
545
+ { "key": 5, "label": { "en-US": "Friday" }, "icon": "calendar" },
546
+ { "key": 6, "label": { "en-US": "Saturday" }, "icon": "calendar-check" }
547
+ ],
548
+ "groupTemplate": {
549
+ "component": "layout",
550
+ "props": { "className": "d-flex justify-content-between align-items-center" },
551
+ "children": [
552
+ { "component": "text", "props": { "value": "{{ groupLabel }}", "type": "h6" } },
553
+ {
554
+ "component": "badge",
555
+ "props": {
556
+ "value": "{{ groupCount > 0 ? 'Open' : 'Closed' }}",
557
+ "variant": "{{ groupCount > 0 ? 'success' : 'danger' }}"
558
+ }
559
+ }
560
+ ]
561
+ },
562
+ "layout": "accordion",
563
+ "options": { "allowAdd": true, "allowRemove": true, "allowReorder": true, "minItems": 0, "maxItems": 21 },
564
+ "defaultItem": { "startTime": "09:00:00", "endTime": "17:00:00", "isOpen": true },
565
+ "showDragHandle": true,
566
+ "containerClass": "business-hours-container",
567
+ "itemTemplate": {
568
+ "component": "card",
569
+ "props": { "variant": "outlined" },
570
+ "children": [
571
+ {
572
+ "component": "layout",
573
+ "props": { "cols": 3 },
574
+ "children": [
575
+ {
576
+ "component": "field",
577
+ "name": "startTime",
578
+ "props": { "label": "Opening Time", "type": "time", "required": true }
579
+ },
580
+ {
581
+ "component": "field",
582
+ "name": "endTime",
583
+ "props": { "label": "Closing Time", "type": "time", "required": true }
584
+ },
585
+ { "component": "field", "name": "isOpen", "props": { "label": "Open", "type": "checkbox" } }
586
+ ]
587
+ }
588
+ ]
589
+ }
590
+ }
591
+ },
592
+ "multipleTemplates": {
593
+ "component": "field-collection",
594
+ "name": "addressesCollection",
595
+ "props": {
596
+ "fieldName": "user.addresses",
597
+ "itemTemplate": [
598
+ { "component": "text", "props": { "value": "Address {{ index + 1 }}", "type": "h6" } },
599
+ {
600
+ "component": "layout",
601
+ "props": { "cols": 2 },
602
+ "children": [
603
+ { "component": "field", "name": "street", "props": { "label": "Street Address", "type": "text" } },
604
+ { "component": "field", "name": "city", "props": { "label": "City", "type": "text" } },
605
+ { "component": "field", "name": "state", "props": { "label": "State", "type": "text" } },
606
+ { "component": "field", "name": "zipCode", "props": { "label": "ZIP Code", "type": "text" } }
607
+ ]
608
+ },
609
+ { "component": "field", "name": "isPrimary", "props": { "label": "Primary Address", "type": "checkbox" } }
610
+ ],
611
+ "defaultItem": { "street": "", "city": "", "state": "", "zipCode": "", "isPrimary": false },
612
+ "options": { "allowAdd": true, "allowRemove": true, "allowReorder": true, "minItems": 1, "maxItems": 5 },
613
+ "showIndex": true,
614
+ "showDragHandle": true
615
+ }
616
+ }
617
+ }
618
+ }