@genesislcap/foundation-forms 14.483.3-alpha-92cb1f2a8.0 → 14.484.1

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.
@@ -16,6 +16,8 @@ import { KVStorage } from '@genesislcap/foundation-comms';
16
16
  import { Layout } from '@jsonforms/core';
17
17
  import { LayoutCacheContainer } from '@genesislcap/foundation-utils';
18
18
  import { Logger } from '@genesislcap/foundation-logger';
19
+ import type { Message } from '@genesislcap/foundation-comms';
20
+ import type { MessageError } from '@genesislcap/foundation-comms';
19
21
  import { OwnPropsOfControl } from '@jsonforms/core';
20
22
  import { RankedTester } from '@jsonforms/core';
21
23
  import { RuleEffect } from '@jsonforms/core';
@@ -443,6 +445,31 @@ export declare const controlWrapperTemplate: (options: ControlWrapperOptions) =>
443
445
  */
444
446
  export declare const createExpressions: (payload: any) => Expressions;
445
447
 
448
+ /**
449
+ * Detail payload for the `csv-imported` event fired by {@link Form} when CSV data is
450
+ * successfully imported into bulk insert rows.
451
+ * @public
452
+ */
453
+ export declare type CsvImportedEventDetail = {
454
+ /**
455
+ * Number of rows actually appended to the form data.
456
+ */
457
+ rowCount: number;
458
+ /**
459
+ * Number of rows present in the source CSV file (may exceed `rowCount` if truncated
460
+ * by `bulkInsertMaxItems`).
461
+ */
462
+ totalRowsInFile: number;
463
+ /**
464
+ * CSV columns that could not be matched to a schema field.
465
+ */
466
+ unmappedColumns: string[];
467
+ /**
468
+ * The name of the imported CSV file.
469
+ */
470
+ fileName: string;
471
+ };
472
+
446
473
  /**
447
474
  * Result of mapping CSV data to schema fields.
448
475
  * @public
@@ -458,6 +485,22 @@ export declare interface CsvMappingResult {
458
485
  unmappedColumns: string[];
459
486
  }
460
487
 
488
+ /**
489
+ * Detail payload for the `csv-parse-error` event fired by {@link Form} when CSV import
490
+ * parsing or mapping fails.
491
+ * @public
492
+ */
493
+ export declare type CsvParseErrorEventDetail = {
494
+ /**
495
+ * Human-readable descriptions of what went wrong.
496
+ */
497
+ errors: string[];
498
+ /**
499
+ * The name of the CSV file that failed to import.
500
+ */
501
+ fileName: string;
502
+ };
503
+
461
504
  /**
462
505
  * Result of parsing a CSV file.
463
506
  * @public
@@ -477,6 +520,30 @@ export declare interface CsvParseResult {
477
520
  errors: string[];
478
521
  }
479
522
 
523
+ /**
524
+ * Detail payload for the `csv-template-downloaded` event fired by {@link Form} after a
525
+ * CSV template file has been generated and downloaded.
526
+ * @public
527
+ */
528
+ export declare type CsvTemplateDownloadedEventDetail = {
529
+ /**
530
+ * The name of the downloaded file.
531
+ */
532
+ fileName: string;
533
+ };
534
+
535
+ /**
536
+ * Detail payload for the `csv-template-error` event fired by {@link Form} when a CSV
537
+ * template cannot be generated.
538
+ * @public
539
+ */
540
+ export declare type CsvTemplateErrorEventDetail = {
541
+ /**
542
+ * Description of why the template could not be generated.
543
+ */
544
+ error: string;
545
+ };
546
+
480
547
  declare class DispatchRenderer extends FASTElement {
481
548
  jsonforms: any;
482
549
  jsonformsChanged(): void;
@@ -536,7 +603,7 @@ export declare function extractFieldsFromUiSchema(uiSchema: UiSchema): Array<{
536
603
  * @public
537
604
  *
538
605
  * @fires change - Fired when built criteria (`value`) updates
539
- * @fires submit - Fired when filter values are submitted
606
+ * @fires submit - Fired when filter values are submitted. detail: `FilterSubmitEventDetail`
540
607
  */
541
608
  export declare class Filters extends Filters_base {
542
609
  kvStorage: KVStorage;
@@ -1041,26 +1108,37 @@ export declare const filtersLogger: Logger;
1041
1108
  */
1042
1109
  export declare const filtersRenderers: any[];
1043
1110
 
1111
+ /**
1112
+ * Detail payload for the `submit` event fired by `Filters` when filter values are submitted.
1113
+ * @public
1114
+ */
1115
+ export declare type FilterSubmitEventDetail = {
1116
+ /**
1117
+ * The filter form data that was submitted.
1118
+ */
1119
+ payload: Record<string, unknown>;
1120
+ };
1121
+
1044
1122
  /**
1045
1123
  * Foundation form component for automatically generated forms based on json schema
1046
1124
  * obtained from the api, supplied initial data or supplied JSON schema.
1047
1125
  * Allowing customisable form elements using UI schema and set of custom renderers
1048
1126
  * @public
1049
1127
  *
1050
- * @fires submit - Fired when the form is submitted (includes payload and validation errors)
1051
- * @fires submit-failure - Fired when submit fails (server or client validation)
1128
+ * @fires submit - Fired when the form is submitted (includes payload and validation errors). detail: `SubmitEventDetail`
1129
+ * @fires submit-failure - Fired when submit fails (server or client validation). detail: `SubmitFailureEventDetail`
1052
1130
  * @fires submit-success - Fired when submit succeeds
1053
- * @fires submit-partial-success - Fired when bulk submit partially succeeds
1131
+ * @fires submit-partial-success - Fired when bulk submit partially succeeds. detail: `SubmitPartialSuccessEventDetail`
1054
1132
  * @fires reset-clicked - Fired reset button is clicked
1055
- * @fires row-status-changed - Fired when row submit status changes
1056
- * @fires bulk-submit-complete - Fired when bulk submit completes
1057
- * @fires row-submit-failure - Fired when a single row submit fails
1058
- * @fires row-submit-success - Fired when a single row submit succeeds
1059
- * @fires data-change - Fired when form data changes
1060
- * @fires csv-parse-error - Fired when CSV import parsing fails
1061
- * @fires csv-imported - Fired when CSV data is imported successfully
1062
- * @fires csv-template-error - Fired when CSV template cannot be generated
1063
- * @fires csv-template-downloaded - Fired when CSV template is downloaded
1133
+ * @fires row-status-changed - Fired when row submit status changes. detail: `RowStatusChangedEventDetail`
1134
+ * @fires bulk-submit-complete - Fired when bulk submit completes. detail: `BulkSubmitResult`
1135
+ * @fires row-submit-failure - Fired when a single row submit fails. detail: `RowSubmitFailureEventDetail`
1136
+ * @fires row-submit-success - Fired when a single row submit succeeds. detail: `RowSubmitSuccessEventDetail`
1137
+ * @fires data-change - Fired when form data changes. detail: `FormDataChangeEventDetail`
1138
+ * @fires csv-parse-error - Fired when CSV import parsing fails. detail: `CsvParseErrorEventDetail`
1139
+ * @fires csv-imported - Fired when CSV data is imported successfully. detail: `CsvImportedEventDetail`
1140
+ * @fires csv-template-error - Fired when CSV template cannot be generated. detail: `CsvTemplateErrorEventDetail`
1141
+ * @fires csv-template-downloaded - Fired when CSV template is downloaded. detail: `CsvTemplateDownloadedEventDetail`
1064
1142
  */
1065
1143
  export declare class Form extends Form_base {
1066
1144
  /**
@@ -1330,7 +1408,7 @@ export declare class Form extends Form_base {
1330
1408
  /**
1331
1409
  * @internal
1332
1410
  */
1333
- onChange(event: CustomEvent): void;
1411
+ onChange(event: CustomEvent<FormDataChangeEventDetail>): void;
1334
1412
  /**
1335
1413
  * @internal
1336
1414
  */
@@ -1759,6 +1837,31 @@ declare const Form_base: (new (...args: any[]) => {
1759
1837
  focus(options?: FocusOptions): void;
1760
1838
  }) & typeof FoundationElement;
1761
1839
 
1840
+ /**
1841
+ * Detail payload for the `data-change` event fired by {@link Form} and `JSONForms` whenever
1842
+ * the bound form data changes.
1843
+ * @public
1844
+ */
1845
+ export declare type FormDataChangeEventDetail = {
1846
+ /**
1847
+ * The current form data.
1848
+ */
1849
+ data: Record<string, unknown>;
1850
+ /**
1851
+ * Validation errors produced by JSON Forms/Ajv for the current data.
1852
+ */
1853
+ errors: ErrorObject[];
1854
+ /**
1855
+ * Additional errors merged in from custom `validateFn`s and server-side field errors.
1856
+ */
1857
+ additionalErrors: ErrorObject[];
1858
+ /**
1859
+ * The instance path that triggered this change, when known (e.g. from a single-field edit).
1860
+ * Omitted on full re-initializations (e.g. schema swap, reset).
1861
+ */
1862
+ path?: string;
1863
+ };
1864
+
1762
1865
  /** @internal */
1763
1866
  export declare const foundationFormStyles: ElementStyles;
1764
1867
 
@@ -2195,6 +2298,67 @@ export declare type RendererEntry = {
2195
2298
  */
2196
2299
  export declare const renderers: any[];
2197
2300
 
2301
+ /**
2302
+ * Detail payload for the `row-status-changed` event fired by {@link Form} whenever the
2303
+ * submission status of one or all bulk insert rows changes.
2304
+ * @public
2305
+ */
2306
+ export declare type RowStatusChangedEventDetail = {
2307
+ /**
2308
+ * The full map of row index to submission status.
2309
+ */
2310
+ statuses: Map<number, BulkRowStatus>;
2311
+ /**
2312
+ * The index of the row that changed. Omitted when all rows changed at once
2313
+ * (e.g. when submission starts).
2314
+ */
2315
+ index?: number;
2316
+ /**
2317
+ * The new status of the row at `index`. Omitted together with `index`.
2318
+ */
2319
+ status?: BulkRowStatus;
2320
+ };
2321
+
2322
+ /**
2323
+ * Detail payload for the `row-submit-failure` event fired by {@link Form} when a single
2324
+ * bulk insert row fails to submit.
2325
+ * @public
2326
+ */
2327
+ export declare type RowSubmitFailureEventDetail = {
2328
+ /**
2329
+ * The index of the row that failed.
2330
+ */
2331
+ index: number;
2332
+ /**
2333
+ * The row's data.
2334
+ */
2335
+ item: Record<string, unknown>;
2336
+ /**
2337
+ * The errors returned from the server or local validation.
2338
+ */
2339
+ errors: MessageError[];
2340
+ };
2341
+
2342
+ /**
2343
+ * Detail payload for the `row-submit-success` event fired by {@link Form} when a single
2344
+ * bulk insert row is submitted successfully.
2345
+ * @public
2346
+ */
2347
+ export declare type RowSubmitSuccessEventDetail = {
2348
+ /**
2349
+ * The index of the row that succeeded.
2350
+ */
2351
+ index: number;
2352
+ /**
2353
+ * The row's data.
2354
+ */
2355
+ item: Record<string, unknown>;
2356
+ /**
2357
+ * The server response for this row.
2358
+ */
2359
+ response: Message;
2360
+ };
2361
+
2198
2362
  declare type Rule = {
2199
2363
  condition: SchemaBasedCondition;
2200
2364
  effect: RuleEffect;
@@ -2350,6 +2514,54 @@ export declare type StringRendererOptions = {
2350
2514
  changeOnInput?: boolean;
2351
2515
  };
2352
2516
 
2517
+ /**
2518
+ * Detail payload for the `submit` event fired by {@link Form} before a submission
2519
+ * request is sent.
2520
+ * @public
2521
+ */
2522
+ export declare type SubmitEventDetail = {
2523
+ /**
2524
+ * The form data being submitted. Shape depends on the consumer's JSON schema.
2525
+ */
2526
+ payload: Record<string, unknown>;
2527
+ /**
2528
+ * Client-side validation errors collected so far. Empty when the payload is valid.
2529
+ */
2530
+ errors: ErrorObject[];
2531
+ };
2532
+
2533
+ /**
2534
+ * Detail payload for the `submit-failure` event fired by {@link Form} when a submission
2535
+ * is rejected by client-side validation, bulk item-count limits, or the server (EVENT_NACK).
2536
+ * @public
2537
+ */
2538
+ export declare type SubmitFailureEventDetail = {
2539
+ /**
2540
+ * The form data that failed to submit.
2541
+ */
2542
+ payload: Record<string, unknown>;
2543
+ /**
2544
+ * The errors returned from the server or local validation.
2545
+ */
2546
+ errors: MessageError[];
2547
+ };
2548
+
2549
+ /**
2550
+ * Detail payload for the `submit-partial-success` event fired by {@link Form} when a bulk
2551
+ * insert submission has a mix of successful and failed rows.
2552
+ * @public
2553
+ */
2554
+ export declare type SubmitPartialSuccessEventDetail = {
2555
+ /**
2556
+ * The full bulk insert form data (all rows) that was submitted.
2557
+ */
2558
+ payload: Record<string, unknown>;
2559
+ /**
2560
+ * The aggregated per-row results.
2561
+ */
2562
+ results: BulkSubmitResult;
2563
+ };
2564
+
2353
2565
  /**
2354
2566
  * The UI schema, which is passed to JSON Forms, describes the general layout of a form and is just a regular JSON object.
2355
2567
  * It describes the form by means of different UI schema elements, which can often be categorized into either Controls or Layouts.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-forms",
3
3
  "description": "Genesis Foundation Forms",
4
- "version": "14.483.3-alpha-92cb1f2a8.0",
4
+ "version": "14.484.1",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -59,13 +59,13 @@
59
59
  }
60
60
  },
61
61
  "devDependencies": {
62
- "@genesislcap/foundation-testing": "14.483.3-alpha-92cb1f2a8.0",
63
- "@genesislcap/genx": "14.483.3-alpha-92cb1f2a8.0",
64
- "@genesislcap/rollup-builder": "14.483.3-alpha-92cb1f2a8.0",
65
- "@genesislcap/ts-builder": "14.483.3-alpha-92cb1f2a8.0",
66
- "@genesislcap/uvu-playwright-builder": "14.483.3-alpha-92cb1f2a8.0",
67
- "@genesislcap/vite-builder": "14.483.3-alpha-92cb1f2a8.0",
68
- "@genesislcap/webpack-builder": "14.483.3-alpha-92cb1f2a8.0",
62
+ "@genesislcap/foundation-testing": "14.484.1",
63
+ "@genesislcap/genx": "14.484.1",
64
+ "@genesislcap/rollup-builder": "14.484.1",
65
+ "@genesislcap/ts-builder": "14.484.1",
66
+ "@genesislcap/uvu-playwright-builder": "14.484.1",
67
+ "@genesislcap/vite-builder": "14.484.1",
68
+ "@genesislcap/webpack-builder": "14.484.1",
69
69
  "@types/json-schema": "^7.0.11",
70
70
  "@types/papaparse": "^5.3.14"
71
71
  },
@@ -82,12 +82,12 @@
82
82
  }
83
83
  },
84
84
  "dependencies": {
85
- "@genesislcap/foundation-comms": "14.483.3-alpha-92cb1f2a8.0",
86
- "@genesislcap/foundation-criteria": "14.483.3-alpha-92cb1f2a8.0",
87
- "@genesislcap/foundation-logger": "14.483.3-alpha-92cb1f2a8.0",
88
- "@genesislcap/foundation-notifications": "14.483.3-alpha-92cb1f2a8.0",
89
- "@genesislcap/foundation-ui": "14.483.3-alpha-92cb1f2a8.0",
90
- "@genesislcap/foundation-utils": "14.483.3-alpha-92cb1f2a8.0",
85
+ "@genesislcap/foundation-comms": "14.484.1",
86
+ "@genesislcap/foundation-criteria": "14.484.1",
87
+ "@genesislcap/foundation-logger": "14.484.1",
88
+ "@genesislcap/foundation-notifications": "14.484.1",
89
+ "@genesislcap/foundation-ui": "14.484.1",
90
+ "@genesislcap/foundation-utils": "14.484.1",
91
91
  "@json-schema-tools/dereferencer": "^1.6.1",
92
92
  "@jsonforms/core": "^3.2.1",
93
93
  "@microsoft/fast-components": "2.30.6",
@@ -109,5 +109,5 @@
109
109
  "access": "public"
110
110
  },
111
111
  "customElements": "dist/custom-elements.json",
112
- "gitHead": "0eb24727d93845a0d201332a85a26d9b0b4fd7df"
112
+ "gitHead": "805c947c8df90977fa68f5da82e358de498ada51"
113
113
  }