@genesislcap/foundation-forms 14.397.2 → 14.398.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 (77) hide show
  1. package/dist/custom-elements.json +389 -4
  2. package/dist/dts/form.d.ts +100 -1
  3. package/dist/dts/form.d.ts.map +1 -1
  4. package/dist/dts/form.styles.d.ts.map +1 -1
  5. package/dist/dts/form.template.d.ts.map +1 -1
  6. package/dist/dts/jsonforms/json-forms.d.ts +13 -0
  7. package/dist/dts/jsonforms/json-forms.d.ts.map +1 -1
  8. package/dist/dts/jsonforms/renderers/ArrayListWrapperRenderer.d.ts +5 -0
  9. package/dist/dts/jsonforms/renderers/ArrayListWrapperRenderer.d.ts.map +1 -1
  10. package/dist/dts/jsonforms/renderers/BooleanControlRenderer.d.ts.map +1 -1
  11. package/dist/dts/jsonforms/renderers/ConnectedMultiselectControlRenderer.d.ts.map +1 -1
  12. package/dist/dts/jsonforms/renderers/ControlWrapperRenderer.d.ts.map +1 -1
  13. package/dist/dts/jsonforms/renderers/EnumControlRenderer.d.ts.map +1 -1
  14. package/dist/dts/jsonforms/renderers/LayoutFormGridRenderer.d.ts +3 -0
  15. package/dist/dts/jsonforms/renderers/LayoutFormGridRenderer.d.ts.map +1 -0
  16. package/dist/dts/jsonforms/renderers/RenderersRanks.d.ts +1 -0
  17. package/dist/dts/jsonforms/renderers/RenderersRanks.d.ts.map +1 -1
  18. package/dist/dts/jsonforms/testers/isOneOfOptionMultiselect.d.ts.map +1 -1
  19. package/dist/dts/types.d.ts +89 -2
  20. package/dist/dts/types.d.ts.map +1 -1
  21. package/dist/dts/utils/csv-parser.d.ts +85 -0
  22. package/dist/dts/utils/csv-parser.d.ts.map +1 -0
  23. package/dist/dts/utils/index.d.ts +1 -0
  24. package/dist/dts/utils/index.d.ts.map +1 -1
  25. package/dist/dts/utils/schema-utils.d.ts +46 -0
  26. package/dist/dts/utils/schema-utils.d.ts.map +1 -0
  27. package/dist/dts/utils/validation.d.ts +2 -0
  28. package/dist/dts/utils/validation.d.ts.map +1 -1
  29. package/dist/esm/form.js +423 -5
  30. package/dist/esm/form.styles.js +41 -1
  31. package/dist/esm/form.template.js +33 -1
  32. package/dist/esm/jsonforms/json-forms.js +30 -0
  33. package/dist/esm/jsonforms/renderers/ArrayListWrapperRenderer.js +223 -22
  34. package/dist/esm/jsonforms/renderers/BooleanControlRenderer.js +1 -2
  35. package/dist/esm/jsonforms/renderers/ConnectedMultiselectControlRenderer.js +13 -2
  36. package/dist/esm/jsonforms/renderers/ControlWrapperRenderer.js +25 -4
  37. package/dist/esm/jsonforms/renderers/EnumControlRenderer.js +14 -5
  38. package/dist/esm/jsonforms/renderers/LayoutFormGridRenderer.js +39 -0
  39. package/dist/esm/jsonforms/renderers/RenderersRanks.js +1 -0
  40. package/dist/esm/jsonforms/testers/isOneOfOptionMultiselect.js +1 -1
  41. package/dist/esm/utils/csv-parser.js +486 -0
  42. package/dist/esm/utils/index.js +1 -0
  43. package/dist/esm/utils/schema-utils.js +120 -0
  44. package/dist/esm/utils/validation.js +2 -0
  45. package/dist/foundation-forms.api.json +1028 -34
  46. package/dist/foundation-forms.d.ts +285 -2
  47. package/docs/api/foundation-forms.arrayrendereroptions.md +2 -2
  48. package/docs/api/foundation-forms.bulkrowstatus.md +22 -0
  49. package/docs/api/foundation-forms.bulkrowsubmitstatus.md +13 -0
  50. package/docs/api/foundation-forms.bulksubmitfaileditem.md +20 -0
  51. package/docs/api/foundation-forms.bulksubmitresult.md +18 -0
  52. package/docs/api/foundation-forms.bulksubmitsuccessitem.md +17 -0
  53. package/docs/api/foundation-forms.childuischemaresolver.md +15 -0
  54. package/docs/api/foundation-forms.csvmappingresult.mappedrows.md +13 -0
  55. package/docs/api/foundation-forms.csvmappingresult.md +77 -0
  56. package/docs/api/foundation-forms.csvmappingresult.unmappedcolumns.md +13 -0
  57. package/docs/api/foundation-forms.csvparseresult.errors.md +13 -0
  58. package/docs/api/foundation-forms.csvparseresult.headers.md +13 -0
  59. package/docs/api/foundation-forms.csvparseresult.md +96 -0
  60. package/docs/api/foundation-forms.csvparseresult.rows.md +13 -0
  61. package/docs/api/foundation-forms.downloadcsvtemplate.md +74 -0
  62. package/docs/api/foundation-forms.form.bulkinsert.md +13 -0
  63. package/docs/api/foundation-forms.form.bulkinsertmaxitems.md +13 -0
  64. package/docs/api/foundation-forms.form.bulkinsertminitems.md +13 -0
  65. package/docs/api/foundation-forms.form.clearrowsubmitstatuses.md +17 -0
  66. package/docs/api/foundation-forms.form.downloadcsvtemplate.md +17 -0
  67. package/docs/api/foundation-forms.form.handlecsvfileselected.md +54 -0
  68. package/docs/api/foundation-forms.form.md +132 -0
  69. package/docs/api/foundation-forms.form.rowsubmitstatuses.md +13 -0
  70. package/docs/api/foundation-forms.form.submitsinglerow.md +56 -0
  71. package/docs/api/foundation-forms.generatecsvtemplate.md +104 -0
  72. package/docs/api/foundation-forms.mapcsvtoschema.md +88 -0
  73. package/docs/api/foundation-forms.md +147 -0
  74. package/docs/api/foundation-forms.parsecsv.md +56 -0
  75. package/docs/api/foundation-forms.uischemaelementtype.md +1 -1
  76. package/docs/api-report.md.api.md +87 -4
  77. package/package.json +19 -17
@@ -24,7 +24,7 @@
24
24
  "type": {
25
25
  "text": "array"
26
26
  },
27
- "default": "[\n fallbackEntry,\n stringEntry,\n BooleanControlEntry,\n StringArrayEntry,\n LayoutArrayRendererEntry,\n LayoutCategorizationRendererEntry,\n LayoutGroupRendererEntry,\n LayoutHorizontalEntry,\n LayoutVertical2ColumnsEntry,\n LayoutRendererEntry,\n LayoutStepperRendererEntry,\n NumberControlRendererEntry,\n ConnectedMultiselectControlRendererEntry,\n EnumControlRendererEntry,\n ConnectedSelectControlRendererEntry,\n DateControlRendererEntry,\n InvisibleControlEntry,\n DividerControlRenderer,\n]",
27
+ "default": "[\n fallbackEntry,\n stringEntry,\n BooleanControlEntry,\n StringArrayEntry,\n LayoutArrayRendererEntry,\n LayoutCategorizationRendererEntry,\n LayoutGroupRendererEntry,\n LayoutHorizontalEntry,\n LayoutFormGridEntry,\n LayoutVertical2ColumnsEntry,\n LayoutRendererEntry,\n LayoutStepperRendererEntry,\n NumberControlRendererEntry,\n ConnectedMultiselectControlRendererEntry,\n EnumControlRendererEntry,\n ConnectedSelectControlRendererEntry,\n DateControlRendererEntry,\n InvisibleControlEntry,\n DividerControlRenderer,\n]",
28
28
  "description": "Set of default renderers used by the foundation-forms.",
29
29
  "privacy": "public"
30
30
  },
@@ -100,7 +100,7 @@
100
100
  "type": {
101
101
  "text": "RendererEntry[]"
102
102
  },
103
- "default": "[\n fallbackEntry,\n stringEntry,\n BooleanControlEntry,\n StringArrayEntry,\n LayoutArrayRendererEntry,\n LayoutCategorizationRendererEntry,\n LayoutGroupRendererEntry,\n LayoutHorizontalEntry,\n LayoutVertical2ColumnsEntry,\n LayoutRendererEntry,\n LayoutStepperRendererEntry,\n NumberControlRendererEntry,\n ConnectedMultiselectControlRendererEntry,\n EnumControlRendererEntry,\n ConnectedSelectControlRendererEntry,\n DateControlRendererEntry,\n InvisibleControlEntry,\n DividerControlRenderer,\n]",
103
+ "default": "[\n fallbackEntry,\n stringEntry,\n BooleanControlEntry,\n StringArrayEntry,\n LayoutArrayRendererEntry,\n LayoutCategorizationRendererEntry,\n LayoutGroupRendererEntry,\n LayoutHorizontalEntry,\n LayoutFormGridEntry,\n LayoutVertical2ColumnsEntry,\n LayoutRendererEntry,\n LayoutStepperRendererEntry,\n NumberControlRendererEntry,\n ConnectedMultiselectControlRendererEntry,\n EnumControlRendererEntry,\n ConnectedSelectControlRendererEntry,\n DateControlRendererEntry,\n InvisibleControlEntry,\n DividerControlRenderer,\n]",
104
104
  "description": "Allows to provide the main set of renderers used by the form. If not provided, the built-in renderers will be used by default.",
105
105
  "privacy": "public"
106
106
  },
@@ -173,6 +173,70 @@
173
173
  "description": "Controls the visibility of the submit button.",
174
174
  "privacy": "public"
175
175
  },
176
+ {
177
+ "kind": "field",
178
+ "name": "bulkInsert",
179
+ "type": {
180
+ "text": "boolean"
181
+ },
182
+ "description": "When enabled, transforms the form into bulk insert mode where multiple records can be added.\nThe JSON schema will be wrapped as an array, and each item will be submitted separately.",
183
+ "privacy": "public"
184
+ },
185
+ {
186
+ "kind": "field",
187
+ "name": "bulkInsertMinItems",
188
+ "type": {
189
+ "text": "number"
190
+ },
191
+ "default": "1",
192
+ "description": "Minimum number of items required in bulk insert mode.",
193
+ "privacy": "public"
194
+ },
195
+ {
196
+ "kind": "field",
197
+ "name": "bulkInsertMaxItems",
198
+ "type": {
199
+ "text": "number | undefined"
200
+ },
201
+ "description": "Maximum number of items allowed in bulk insert mode. If not set, no maximum is enforced.",
202
+ "privacy": "public"
203
+ },
204
+ {
205
+ "kind": "field",
206
+ "name": "rowSubmitStatuses",
207
+ "type": {
208
+ "text": "Map<number, BulkRowStatus>"
209
+ },
210
+ "default": "new Map()",
211
+ "description": "Tracks the submission status for each row in bulk insert mode.\nKey is the row index, value is the status object.",
212
+ "privacy": "public"
213
+ },
214
+ {
215
+ "kind": "method",
216
+ "name": "clearRowSubmitStatuses",
217
+ "description": "Clears all row submit statuses, typically called when resetting the form.",
218
+ "privacy": "public"
219
+ },
220
+ {
221
+ "kind": "method",
222
+ "name": "submitSingleRow",
223
+ "return": {
224
+ "type": {
225
+ "text": ""
226
+ }
227
+ },
228
+ "parameters": [
229
+ {
230
+ "name": "index",
231
+ "type": {
232
+ "text": "number"
233
+ },
234
+ "description": "The index of the row to submit"
235
+ }
236
+ ],
237
+ "description": "Submits a single row in bulk insert mode.",
238
+ "privacy": "public"
239
+ },
176
240
  {
177
241
  "kind": "method",
178
242
  "name": "reset",
@@ -185,6 +249,27 @@
185
249
  "description": "Reset the form state",
186
250
  "privacy": "public"
187
251
  },
252
+ {
253
+ "kind": "method",
254
+ "name": "handleCsvFileSelected",
255
+ "parameters": [
256
+ {
257
+ "name": "event",
258
+ "type": {
259
+ "text": "Event"
260
+ },
261
+ "description": "The file input change event"
262
+ }
263
+ ],
264
+ "description": "Handles CSV file selection for bulk import.\nParses the CSV content and appends it to existing form items.",
265
+ "privacy": "public"
266
+ },
267
+ {
268
+ "kind": "method",
269
+ "name": "downloadCsvTemplate",
270
+ "description": "Downloads a CSV template file with headers and sample data based on the schema.\nIf a UI schema is provided, it will be used to determine which fields to include\nand in what order. Hidden fields will be excluded from the template.",
271
+ "privacy": "public"
272
+ },
188
273
  {
189
274
  "kind": "method",
190
275
  "name": "cloneNode",
@@ -438,6 +523,31 @@
438
523
  },
439
524
  "description": "Controls the visibility of the submit button.",
440
525
  "fieldName": "hideSubmit"
526
+ },
527
+ {
528
+ "name": "bulk-insert",
529
+ "type": {
530
+ "text": "boolean"
531
+ },
532
+ "description": "When enabled, transforms the form into bulk insert mode where multiple records can be added.\nThe JSON schema will be wrapped as an array, and each item will be submitted separately.",
533
+ "fieldName": "bulkInsert"
534
+ },
535
+ {
536
+ "name": "bulk-insert-min-items",
537
+ "type": {
538
+ "text": "number"
539
+ },
540
+ "default": "1",
541
+ "description": "Minimum number of items required in bulk insert mode.",
542
+ "fieldName": "bulkInsertMinItems"
543
+ },
544
+ {
545
+ "name": "bulk-insert-max-items",
546
+ "type": {
547
+ "text": "number | undefined"
548
+ },
549
+ "description": "Maximum number of items allowed in bulk insert mode. If not set, no maximum is enforced.",
550
+ "fieldName": "bulkInsertMaxItems"
441
551
  }
442
552
  ],
443
553
  "mixins": [
@@ -1161,6 +1271,32 @@
1161
1271
  "kind": "method",
1162
1272
  "name": "configChanged"
1163
1273
  },
1274
+ {
1275
+ "kind": "field",
1276
+ "name": "rowSubmitStatuses",
1277
+ "type": {
1278
+ "text": "Map<number, BulkRowStatus>"
1279
+ },
1280
+ "default": "new Map()",
1281
+ "description": "Row submit statuses for bulk insert mode.\nPassed from the parent foundation-form."
1282
+ },
1283
+ {
1284
+ "kind": "method",
1285
+ "name": "rowSubmitStatusesChanged"
1286
+ },
1287
+ {
1288
+ "kind": "field",
1289
+ "name": "bulkInsert",
1290
+ "type": {
1291
+ "text": "boolean"
1292
+ },
1293
+ "default": "false",
1294
+ "description": "Whether the form is in bulk insert mode.\nPassed from the parent foundation-form."
1295
+ },
1296
+ {
1297
+ "kind": "method",
1298
+ "name": "bulkInsertChanged"
1299
+ },
1164
1300
  {
1165
1301
  "kind": "field",
1166
1302
  "name": "props",
@@ -1241,6 +1377,173 @@
1241
1377
  "declarations": [],
1242
1378
  "exports": []
1243
1379
  },
1380
+ {
1381
+ "kind": "javascript-module",
1382
+ "path": "src/utils/csv-parser.ts",
1383
+ "declarations": [
1384
+ {
1385
+ "kind": "function",
1386
+ "name": "parseCsv",
1387
+ "return": {
1388
+ "type": {
1389
+ "text": ""
1390
+ }
1391
+ },
1392
+ "parameters": [
1393
+ {
1394
+ "name": "content",
1395
+ "type": {
1396
+ "text": "string"
1397
+ },
1398
+ "description": "The CSV content as a string"
1399
+ }
1400
+ ],
1401
+ "description": "Parses a CSV string into headers and rows using PapaParse.\nHandles quoted fields, escaped quotes, empty values, and mixed line endings.",
1402
+ "privacy": "public"
1403
+ },
1404
+ {
1405
+ "kind": "function",
1406
+ "name": "mapCsvToSchema",
1407
+ "return": {
1408
+ "type": {
1409
+ "text": ""
1410
+ }
1411
+ },
1412
+ "parameters": [
1413
+ {
1414
+ "name": "csvRows",
1415
+ "type": {
1416
+ "text": "Record<string, string>[]"
1417
+ },
1418
+ "description": "The parsed CSV rows"
1419
+ },
1420
+ {
1421
+ "name": "schema",
1422
+ "type": {
1423
+ "text": "JSONSchema7 | undefined"
1424
+ },
1425
+ "description": "The JSON schema defining the fields"
1426
+ },
1427
+ {
1428
+ "name": "uiSchema",
1429
+ "optional": true,
1430
+ "type": {
1431
+ "text": "UiSchema"
1432
+ },
1433
+ "description": "Optional UI schema to map labels to field names on import"
1434
+ }
1435
+ ],
1436
+ "description": "Maps CSV rows to schema fields with case-insensitive matching.\nWhen uiSchema is provided, CSV headers can also match UI schema labels.\nConverts values to appropriate types based on schema definition.",
1437
+ "privacy": "public"
1438
+ },
1439
+ {
1440
+ "kind": "function",
1441
+ "name": "generateCsvTemplate",
1442
+ "return": {
1443
+ "type": {
1444
+ "text": ""
1445
+ }
1446
+ },
1447
+ "parameters": [
1448
+ {
1449
+ "name": "schema",
1450
+ "type": {
1451
+ "text": "JSONSchema7 | undefined"
1452
+ },
1453
+ "description": "The JSON schema defining the fields"
1454
+ },
1455
+ {
1456
+ "name": "uiSchema",
1457
+ "optional": true,
1458
+ "type": {
1459
+ "text": "UiSchema"
1460
+ },
1461
+ "description": "Optional UI schema to determine field order and visibility"
1462
+ },
1463
+ {
1464
+ "name": "includeOptionalFields",
1465
+ "default": "true",
1466
+ "type": {
1467
+ "text": "boolean"
1468
+ },
1469
+ "description": "Whether to include optional fields when no UI schema (default: true)"
1470
+ },
1471
+ {
1472
+ "name": "includeBom",
1473
+ "default": "true",
1474
+ "type": {
1475
+ "text": "boolean"
1476
+ },
1477
+ "description": "Whether to prepend UTF-8 BOM for Excel compatibility (default: true)"
1478
+ }
1479
+ ],
1480
+ "description": "Generates a CSV template string with headers and sample data based on JSON schema.\nIf a UI schema is provided, it will be used to determine which fields to include\nand in what order. Hidden fields in the UI schema will be excluded.",
1481
+ "privacy": "public"
1482
+ },
1483
+ {
1484
+ "kind": "function",
1485
+ "name": "downloadCsvTemplate",
1486
+ "return": {
1487
+ "type": {
1488
+ "text": "void"
1489
+ }
1490
+ },
1491
+ "parameters": [
1492
+ {
1493
+ "name": "csvContent",
1494
+ "type": {
1495
+ "text": "string"
1496
+ },
1497
+ "description": "The CSV content to download"
1498
+ },
1499
+ {
1500
+ "name": "fileName",
1501
+ "default": "'template.csv'",
1502
+ "type": {
1503
+ "text": "string"
1504
+ },
1505
+ "description": "The name for the downloaded file (default: 'template.csv')"
1506
+ }
1507
+ ],
1508
+ "description": "Triggers a download of the CSV template file in the browser.",
1509
+ "privacy": "public"
1510
+ }
1511
+ ],
1512
+ "exports": [
1513
+ {
1514
+ "kind": "js",
1515
+ "name": "parseCsv",
1516
+ "declaration": {
1517
+ "name": "parseCsv",
1518
+ "module": "src/utils/csv-parser.ts"
1519
+ }
1520
+ },
1521
+ {
1522
+ "kind": "js",
1523
+ "name": "mapCsvToSchema",
1524
+ "declaration": {
1525
+ "name": "mapCsvToSchema",
1526
+ "module": "src/utils/csv-parser.ts"
1527
+ }
1528
+ },
1529
+ {
1530
+ "kind": "js",
1531
+ "name": "generateCsvTemplate",
1532
+ "declaration": {
1533
+ "name": "generateCsvTemplate",
1534
+ "module": "src/utils/csv-parser.ts"
1535
+ }
1536
+ },
1537
+ {
1538
+ "kind": "js",
1539
+ "name": "downloadCsvTemplate",
1540
+ "declaration": {
1541
+ "name": "downloadCsvTemplate",
1542
+ "module": "src/utils/csv-parser.ts"
1543
+ }
1544
+ }
1545
+ ]
1546
+ },
1244
1547
  {
1245
1548
  "kind": "javascript-module",
1246
1549
  "path": "src/utils/filters.ts",
@@ -1294,6 +1597,14 @@
1294
1597
  "path": "src/utils/index.ts",
1295
1598
  "declarations": [],
1296
1599
  "exports": [
1600
+ {
1601
+ "kind": "js",
1602
+ "name": "*",
1603
+ "declaration": {
1604
+ "name": "*",
1605
+ "package": "./csv-parser"
1606
+ }
1607
+ },
1297
1608
  {
1298
1609
  "kind": "js",
1299
1610
  "name": "*",
@@ -1342,6 +1653,12 @@
1342
1653
  "declarations": [],
1343
1654
  "exports": []
1344
1655
  },
1656
+ {
1657
+ "kind": "javascript-module",
1658
+ "path": "src/utils/schema-utils.ts",
1659
+ "declarations": [],
1660
+ "exports": []
1661
+ },
1345
1662
  {
1346
1663
  "kind": "javascript-module",
1347
1664
  "path": "src/utils/translation.ts",
@@ -1413,7 +1730,8 @@
1413
1730
  }
1414
1731
  }
1415
1732
  ],
1416
- "description": "Computes a human-friendly anyOf error message for a given control path.\nPrefers UI schema custom message, then JSON schema errorMessage.anyOf, then a constructed fallback."
1733
+ "description": "Computes a human-friendly anyOf error message for a given control path.\nPrefers UI schema custom message, then JSON schema errorMessage.anyOf, then a constructed fallback.",
1734
+ "privacy": "public"
1417
1735
  }
1418
1736
  ],
1419
1737
  "exports": [
@@ -1492,6 +1810,20 @@
1492
1810
  }
1493
1811
  }
1494
1812
  ]
1813
+ },
1814
+ {
1815
+ "kind": "method",
1816
+ "name": "submitRow",
1817
+ "parameters": [
1818
+ {
1819
+ "name": "index",
1820
+ "type": {
1821
+ "text": "number"
1822
+ },
1823
+ "description": "The row index to submit"
1824
+ }
1825
+ ],
1826
+ "description": "Submits a single row by emitting an event that bubbles up to the foundation-form."
1495
1827
  }
1496
1828
  ],
1497
1829
  "superclass": {
@@ -1751,7 +2083,7 @@
1751
2083
  {
1752
2084
  "kind": "variable",
1753
2085
  "name": "ControlWrapperRendererTemplate",
1754
- "default": "html`\n <template>\n ${when(\n (x) => x.control?.visible,\n html`\n <div\n class=${(x) =>\n classNames(\n ['wrapperRoot', true],\n ['labelLeft', x.jsonForms?.core?.uischema?.options?.labelPlacement === 'left'],\n )}\n id=${(x) => x.control.path + '-wrapper'}\n data-test-id=${(x) => x.control.path + '-wrapper'}\n >\n ${when(\n (x) => !x.hideLabel,\n html`\n <div for=\"${(x) => x.control.path + '-wrapper'}\" class=\"label\">\n <span>\n ${(x) => x.computedLabel}${when(\n (x) => x.control.uischema?.options?.tooltip,\n (x) => x.getPrefixedTooltip,\n )}\n </span>\n </div>\n `,\n )}\n\n <div class=\"wrapper\">\n <slot></slot>\n </div>\n <div\n class=\"${(x) =>\n (x.control.errors || x.anyOfError) && x.touched ? 'error' : 'description'}\"\n >\n ${(x) =>\n x.touched && (x.control.errors || x.anyOfError)\n ? [x.control.errors, x.anyOfError].filter(Boolean).join(' ')\n : x.showDescription\n ? x.control.description\n : ''}\n </div>\n </div>\n `,\n )}\n </template>\n`"
2086
+ "default": "html`\n <template>\n ${when(\n (x) => x.control?.visible,\n html`\n <div\n class=${(x) =>\n classNames(\n ['wrapperRoot', true],\n ['labelLeft', x.jsonForms?.core?.uischema?.options?.labelPlacement === 'left'],\n )}\n id=${(x) => x.control.path + '-wrapper'}\n data-test-id=${(x) => x.control.path + '-wrapper'}\n role=\"group\"\n aria-labelledby=${(x) => (x.computedLabel ? x.control.path + '-label' : null)}\n >\n ${when(\n (x) => x.computedLabel,\n html`\n <label\n id=\"${(x) => x.control.path + '-label'}\"\n for=\"${(x) => x.control.path}\"\n class=\"${(x) => classNames('label', ['visually-hidden', x.hideLabel])}\"\n >\n <span>\n ${(x) => x.computedLabel}${when(\n (x) => x.control.uischema?.options?.tooltip,\n (x) => x.getPrefixedTooltip,\n )}\n </span>\n </label>\n `,\n )}\n\n <div class=\"wrapper\">\n <slot></slot>\n </div>\n <div\n class=\"${(x) =>\n (x.control.errors || x.anyOfError) && x.touched ? 'error' : 'description'}\"\n >\n ${(x) =>\n x.touched && (x.control.errors || x.anyOfError)\n ? [x.control.errors, x.anyOfError].filter(Boolean).join(' ')\n : x.showDescription\n ? x.control.description\n : ''}\n </div>\n </div>\n `,\n )}\n </template>\n`"
1755
2087
  },
1756
2088
  {
1757
2089
  "kind": "class",
@@ -2273,6 +2605,43 @@
2273
2605
  }
2274
2606
  ]
2275
2607
  },
2608
+ {
2609
+ "kind": "javascript-module",
2610
+ "path": "src/jsonforms/renderers/LayoutFormGridRenderer.ts",
2611
+ "declarations": [
2612
+ {
2613
+ "kind": "variable",
2614
+ "name": "LayoutFormGridRendererTemplate",
2615
+ "default": "html`\n <template>\n <layout-wrapper :control=${(x) => x.control}>\n <div\n style=\"\n display: grid;\n grid-template-columns: repeat(4, 1fr);\n gap: 8px;\n \"\n >\n ${repeat(\n (x) => x.control.uischema.elements,\n html`\n <dispatch-renderer\n ?submitted=${(x, ctx) => ctx.parent.submitted}\n :dispatch=${(x, ctx) => ctx.parent.dispatch}\n :jsonforms=${(x, ctx) => ctx.parent.jsonforms}\n :prefix=${(x, ctx) => ctx.parent.prefix}\n :props=${(x, ctx) => ({\n uischema: x,\n schema: ctx.parent.control.schema,\n renderers: ctx.parent.control.renderers,\n path: ctx.parent.control.path,\n enabled: ctx.parent.control.enabled,\n })}\n ></dispatch-renderer>\n `,\n )}\n </div>\n </layout-wrapper>\n </template>\n`"
2616
+ },
2617
+ {
2618
+ "kind": "variable",
2619
+ "name": "LayoutFormGridEntry",
2620
+ "type": {
2621
+ "text": "any"
2622
+ },
2623
+ "default": "{\n renderer: LayoutFormGridRendererTemplate,\n tester: rankWith(LAYOUT_FORM_GRID_RANK, (uiSchema) => uiSchema.type === 'FormGridLayout'),\n mapper: mapStateToLayoutProps,\n}"
2624
+ }
2625
+ ],
2626
+ "exports": [
2627
+ {
2628
+ "kind": "js",
2629
+ "name": "LayoutFormGridRendererTemplate",
2630
+ "declaration": {
2631
+ "name": "LayoutFormGridRendererTemplate",
2632
+ "module": "src/jsonforms/renderers/LayoutFormGridRenderer.ts"
2633
+ }
2634
+ },
2635
+ {
2636
+ "kind": "js",
2637
+ "name": "LayoutFormGridEntry",
2638
+ "declaration": {
2639
+ "name": "LayoutFormGridEntry",
2640
+ "module": "src/jsonforms/renderers/LayoutFormGridRenderer.ts"
2641
+ }
2642
+ }
2643
+ ]
2644
+ },
2276
2645
  {
2277
2646
  "kind": "javascript-module",
2278
2647
  "path": "src/jsonforms/renderers/LayoutGroupRenderer.ts",
@@ -2678,6 +3047,14 @@
2678
3047
  },
2679
3048
  "default": "2"
2680
3049
  },
3050
+ {
3051
+ "kind": "variable",
3052
+ "name": "LAYOUT_FORM_GRID_RANK",
3053
+ "type": {
3054
+ "text": "number"
3055
+ },
3056
+ "default": "2"
3057
+ },
2681
3058
  {
2682
3059
  "kind": "variable",
2683
3060
  "name": "INVISIBLE_CONTROL_RANK",
@@ -2816,6 +3193,14 @@
2816
3193
  "module": "src/jsonforms/renderers/RenderersRanks.ts"
2817
3194
  }
2818
3195
  },
3196
+ {
3197
+ "kind": "js",
3198
+ "name": "LAYOUT_FORM_GRID_RANK",
3199
+ "declaration": {
3200
+ "name": "LAYOUT_FORM_GRID_RANK",
3201
+ "module": "src/jsonforms/renderers/RenderersRanks.ts"
3202
+ }
3203
+ },
2819
3204
  {
2820
3205
  "kind": "js",
2821
3206
  "name": "INVISIBLE_CONTROL_RANK",
@@ -1,6 +1,6 @@
1
1
  import { FoundationElement } from '@microsoft/fast-foundation';
2
2
  import { JSONSchema7 } from 'json-schema';
3
- import { RendererEntry, UiSchema } from './types';
3
+ import { BulkRowStatus, RendererEntry, UiSchema } from './types';
4
4
  /**
5
5
  * Set of default renderers used by the foundation-forms.
6
6
  * @public
@@ -391,6 +391,16 @@ export declare class Form extends Form_base {
391
391
  */
392
392
  resourceName: string;
393
393
  private resourceNameChanged;
394
+ /**
395
+ * Initializes the data with default empty items for bulk insert mode.
396
+ * @internal
397
+ */
398
+ private initializeBulkInsertData;
399
+ /**
400
+ * Transforms the JSON schema to support bulk insert mode by wrapping it in an array.
401
+ * @internal
402
+ */
403
+ private transformSchemaForBulkInsert;
394
404
  /**
395
405
  * Optional confirmation message to display before form submission.
396
406
  * If set, a confirmation dialog will be shown when the user clicks submit.
@@ -413,6 +423,11 @@ export declare class Form extends Form_base {
413
423
  * @internal
414
424
  */
415
425
  approvalModal: any;
426
+ /**
427
+ * Reference to the CSV file input element for bulk import.
428
+ * @internal
429
+ */
430
+ csvFileInput: HTMLInputElement;
416
431
  /**
417
432
  * Stores the approval message entered by the user.
418
433
  * @internal
@@ -521,10 +536,75 @@ export declare class Form extends Form_base {
521
536
  * @public
522
537
  */
523
538
  hideSubmit: boolean;
539
+ /**
540
+ * When enabled, transforms the form into bulk insert mode where multiple records can be added.
541
+ * The JSON schema will be wrapped as an array, and each item will be submitted separately.
542
+ * @public
543
+ */
544
+ bulkInsert: boolean;
545
+ /**
546
+ * Minimum number of items required in bulk insert mode.
547
+ * @public
548
+ */
549
+ bulkInsertMinItems: number;
550
+ /**
551
+ * Maximum number of items allowed in bulk insert mode. If not set, no maximum is enforced.
552
+ * @public
553
+ */
554
+ bulkInsertMaxItems: number | undefined;
555
+ /**
556
+ * Stores the original schema before bulk insert transformation.
557
+ * @internal
558
+ */
559
+ private originalDetailsSchema;
560
+ /**
561
+ * User-provided UI schema for bulk insert mode, stored separately.
562
+ * @internal
563
+ */
564
+ private userProvidedUiSchema;
565
+ /**
566
+ * Tracks the submission status for each row in bulk insert mode.
567
+ * Key is the row index, value is the status object.
568
+ * @public
569
+ */
570
+ rowSubmitStatuses: Map<number, BulkRowStatus>;
524
571
  /**
525
572
  * @internal
526
573
  */
527
574
  _submit(): Promise<void>;
575
+ /**
576
+ * Handles bulk insert submission by iterating through items and submitting each separately.
577
+ * Updates rowSubmitStatuses to provide row-level feedback.
578
+ * @internal
579
+ */
580
+ private _submitBulk;
581
+ /**
582
+ * Updates the submit status for a specific row and triggers reactivity.
583
+ * @param index - The row index
584
+ * @param status - The new status object
585
+ * @internal
586
+ */
587
+ private updateRowStatus;
588
+ /**
589
+ * Clears all row submit statuses, typically called when resetting the form.
590
+ * @public
591
+ */
592
+ clearRowSubmitStatuses(): void;
593
+ /**
594
+ * Submits a single row in bulk insert mode.
595
+ * @param index - The index of the row to submit
596
+ * @returns Promise that resolves when submission is complete
597
+ * @public
598
+ */
599
+ submitSingleRow(index: number): Promise<void>;
600
+ /**
601
+ * Filters item data to only include fields defined in the UI schema.
602
+ * This ensures we don't submit default values for fields not shown in the UI.
603
+ * @param item - The item data to filter
604
+ * @returns Filtered item data containing only UI schema fields
605
+ * @internal
606
+ */
607
+ private filterDataByUiSchema;
528
608
  /**
529
609
  * Builds the commit payload for the form submission.
530
610
  * @internal
@@ -571,6 +651,25 @@ export declare class Form extends Form_base {
571
651
  * @internal
572
652
  */
573
653
  submitWithApproval(): Promise<void>;
654
+ /**
655
+ * Handles CSV file selection for bulk import.
656
+ * Parses the CSV content and appends it to existing form items.
657
+ * @param event - The file input change event
658
+ * @public
659
+ */
660
+ handleCsvFileSelected(event: Event): Promise<void>;
661
+ /**
662
+ * Clears the CSV file input to allow re-selection of the same file.
663
+ * @internal
664
+ */
665
+ private clearCsvFileInput;
666
+ /**
667
+ * Downloads a CSV template file with headers and sample data based on the schema.
668
+ * If a UI schema is provided, it will be used to determine which fields to include
669
+ * and in what order. Hidden fields will be excluded from the template.
670
+ * @public
671
+ */
672
+ downloadCsvTemplate(): void;
574
673
  }
575
674
  export {};
576
675
  //# sourceMappingURL=form.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/form.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAqB1C,OAAO,EAAiB,aAAa,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAiBjE;;;GAGG;AACH,eAAO,MAAM,SAAS,OAmBrB,CAAC;;;;;;;kBAbM,CAAC;;;;;;;;8BAiDM,CAAC,cAGV,CADJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA8BwC,CAAA;4IAM3B,CAAC;wFAMyB,CAAC;+IASnC,CAAC;2FAIQ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BA6Cd,CAAC;;;;;;;;;;;;;;;;;;;;;;;mBAmEK,CAAC;;;;;;;;;;;;;6BA+BA,CAAC;8BAEkB,CAAC;kBACA,CAAC;;oBAEzB,CAAF;;sBACI,CAAC;oBAEE,CAAC;;;;;;;;gDAU2B,CAAA;;;;;;;;;;;;;;;;;;uBAqC/B,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EA4GyyC,CAAC;yBAA8E,CAAC;UAAoD,GAAG;WAAgD,GAAG;;gBAA6E,GAAG;;;;;;;WAA4V,GAAG;YAAiD,GAAG;;;;;;;;;;;oBAAupC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAiiO,CAAC;cAA6F,CAAC;eAA8F,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ACG,kBAAkB;IA+BxB;;;;;OAKG;IACG,qBAAqB,CAAC,KAAK,EAAE,KAAK;IAyFxC;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAMzB;;;;;OAKG;IACH,mBAAmB;CA2BpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"form.styles.d.ts","sourceRoot":"","sources":["../../src/form.styles.ts"],"names":[],"mappings":"AAKA,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,GAAI,SAAQ,MAAe,WAK7D,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,oBAAoB,iDAmEhC,CAAC"}
1
+ {"version":3,"file":"form.styles.d.ts","sourceRoot":"","sources":["../../src/form.styles.ts"],"names":[],"mappings":"AAKA,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,GAAI,SAAQ,MAAe,WAK7D,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,oBAAoB,iDA2GhC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"form.template.d.ts","sourceRoot":"","sources":["../../src/form.template.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAiBnC,gBAAgB;AAChB,eAAO,MAAM,eAAe,GAAI,WAAM,8DA4DrC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,2DAElC,CAAC"}
1
+ {"version":3,"file":"form.template.d.ts","sourceRoot":"","sources":["../../src/form.template.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAiBnC,gBAAgB;AAChB,eAAO,MAAM,eAAe,GAAI,WAAM,8DA+FrC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,2DAElC,CAAC"}