@genesislcap/foundation-forms 14.488.0 → 14.488.1-FUI-2571.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.
Files changed (37) hide show
  1. package/dist/custom-elements.json +630 -2
  2. package/dist/dts/form.d.ts +77 -0
  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/index.d.ts +3 -0
  7. package/dist/dts/index.d.ts.map +1 -1
  8. package/dist/dts/jsonforms/renderers/CategorizationWrapperRenderer.d.ts.map +1 -1
  9. package/dist/dts/react.d.ts +10 -0
  10. package/dist/dts/review.d.ts +34 -0
  11. package/dist/dts/review.d.ts.map +1 -0
  12. package/dist/dts/review.styles.d.ts +3 -0
  13. package/dist/dts/review.styles.d.ts.map +1 -0
  14. package/dist/dts/review.template.d.ts +6 -0
  15. package/dist/dts/review.template.d.ts.map +1 -0
  16. package/dist/dts/utils/index.d.ts +1 -0
  17. package/dist/dts/utils/index.d.ts.map +1 -1
  18. package/dist/dts/utils/review-utils.d.ts +55 -0
  19. package/dist/dts/utils/review-utils.d.ts.map +1 -0
  20. package/dist/dts/utils/schema-utils.d.ts +12 -0
  21. package/dist/dts/utils/schema-utils.d.ts.map +1 -1
  22. package/dist/esm/form.js +120 -1
  23. package/dist/esm/form.styles.js +9 -2
  24. package/dist/esm/form.template.js +58 -24
  25. package/dist/esm/index.js +3 -0
  26. package/dist/esm/jsonforms/renderers/CategorizationWrapperRenderer.js +1 -45
  27. package/dist/esm/review.js +63 -0
  28. package/dist/esm/review.styles.js +93 -0
  29. package/dist/esm/review.template.js +38 -0
  30. package/dist/esm/utils/index.js +1 -0
  31. package/dist/esm/utils/review-utils.js +205 -0
  32. package/dist/esm/utils/schema-utils.js +48 -0
  33. package/dist/foundation-forms.api.json +1044 -13
  34. package/dist/foundation-forms.d.ts +181 -0
  35. package/dist/react.cjs +7 -0
  36. package/dist/react.mjs +6 -0
  37. package/package.json +15 -15
@@ -179,6 +179,20 @@ export declare type ArrayRendererOptions = {
179
179
  showRowStatusIndicator?: boolean;
180
180
  };
181
181
 
182
+ /**
183
+ * Flattens `buildReviewSections` output into a single ordered list.
184
+ * Section titles are prepended to field labels as "Title — Field".
185
+ */
186
+ export declare function buildReviewFields(data: Record<string, any>, uiSchema: any, schema: any): ReviewField[];
187
+
188
+ /**
189
+ * Builds the review panel's fields grouped into sections by their nearest `Group` layout.
190
+ * Ungrouped fields are collected into a single section with a `null` title (rendered with
191
+ * a placeholder heading). Falls back to a flat, single ungrouped section when no UI schema
192
+ * is available.
193
+ */
194
+ export declare function buildReviewSections(data: Record<string, any>, uiSchema: any, schema: any): ReviewSection[];
195
+
182
196
  /**
183
197
  * Tracks the submission status and result for a single row in bulk insert mode.
184
198
  * @public
@@ -313,6 +327,12 @@ export declare type CategorizationRendererOptions = {
313
327
  */
314
328
  export declare type ChildUiSchemaResolver = (index: number, rowData: any, formData: any) => UiSchema;
315
329
 
330
+ /**
331
+ * Recursively walks a UI schema element, collecting visible Control fields into `out`.
332
+ * Passes the nearest Group label down so children are labelled "Group — Field".
333
+ */
334
+ export declare function collectReviewFields(element: any, data: any, out: ReviewField[], groupLabel: string | undefined, schema: any): void;
335
+
316
336
  /** @internal */
317
337
  export declare const comboboxRendererStyles: (prefix?: string) => string;
318
338
 
@@ -596,6 +616,13 @@ export declare function extractFieldsFromUiSchema(uiSchema: UiSchema): Array<{
596
616
  isHidden: boolean;
597
617
  }>;
598
618
 
619
+ /**
620
+ * Filters review sections down to fields whose label or value contains `query`
621
+ * (case-insensitive). Sections left with no matching fields are dropped entirely.
622
+ * Returns `sections` unchanged when `query` is blank.
623
+ */
624
+ export declare function filterReviewSections(sections: ReviewSection[], query: string): ReviewSection[];
625
+
599
626
  /**
600
627
  * Foundation filters component for automatically generated filters based on json schema
601
628
  * obtained from the api, supplied initial data or supplied JSON schema.
@@ -1196,6 +1223,12 @@ export declare class Form extends Form_base {
1196
1223
  * @internal
1197
1224
  */
1198
1225
  serverFieldErrors: ErrorObject[];
1226
+ /**
1227
+ * Reference to the json-forms child element — used to read live validation
1228
+ * errors at submit time so review mode never activates when the form is invalid.
1229
+ * @internal
1230
+ */
1231
+ jsonFormsEl: any;
1199
1232
  /**
1200
1233
  * Stores the approval message entered by the user.
1201
1234
  * @internal
@@ -1319,6 +1352,24 @@ export declare class Form extends Form_base {
1319
1352
  * @public
1320
1353
  */
1321
1354
  bulkInsert: boolean;
1355
+ /**
1356
+ * Text to appear on submit button
1357
+ * @default Submit
1358
+ * @public
1359
+ */
1360
+ submitButtonText: string;
1361
+ /**
1362
+ * Text to appear on submit button in bulk insert mode
1363
+ * @default Submit AllS
1364
+ * @public
1365
+ */
1366
+ bulkSubmitButtonText: string;
1367
+ /**
1368
+ * Text to appear on reset button
1369
+ * @default Submit
1370
+ * @public
1371
+ */
1372
+ resetButtonText: string;
1322
1373
  /**
1323
1374
  * Minimum number of items required in bulk insert mode.
1324
1375
  * @public
@@ -1339,16 +1390,68 @@ export declare class Form extends Form_base {
1339
1390
  * @internal
1340
1391
  */
1341
1392
  private userProvidedUiSchema;
1393
+ /**
1394
+ * When enabled, clicking submit with no validation errors shows a read-only preview
1395
+ * of the form data before the final submission.
1396
+ * @public
1397
+ */
1398
+ showSubmitReview: boolean;
1399
+ /**
1400
+ * Text to appear on reset button
1401
+ * @public
1402
+ */
1403
+ reviewButtonText: string;
1404
+ /**
1405
+ * Heading shown at the top of the review panel.
1406
+ * @public
1407
+ */
1408
+ reviewHeading: string;
1409
+ /**
1410
+ * Name of a top-level data field whose value is shown as an identifier next to the
1411
+ * review heading (e.g. a record's primary key). No identifier is shown when unset.
1412
+ * @public
1413
+ */
1414
+ reviewIdField: string;
1342
1415
  /**
1343
1416
  * Tracks the submission status for each row in bulk insert mode.
1344
1417
  * Key is the row index, value is the status object.
1345
1418
  * @public
1346
1419
  */
1347
1420
  rowSubmitStatuses: Map<number, BulkRowStatus>;
1421
+ /**
1422
+ * Whether the form is currently showing the submit-review preview panel.
1423
+ * @internal
1424
+ */
1425
+ reviewMode: boolean;
1426
+ /**
1427
+ * Field label/value pairs rendered in the review panel, grouped into sections.
1428
+ * @internal
1429
+ */
1430
+ reviewSections: ReviewSection[];
1431
+ /**
1432
+ * Value of `reviewIdField` resolved from the current form data, if set.
1433
+ * @internal
1434
+ */
1435
+ get reviewRecordId(): string | undefined;
1348
1436
  /**
1349
1437
  * @internal
1350
1438
  */
1351
1439
  _submit(): Promise<void>;
1440
+ /**
1441
+ * Called from the review panel to go back to the form.
1442
+ * @internal
1443
+ */
1444
+ backFromReview(): void;
1445
+ /**
1446
+ * Called from the review panel submit button to perform the actual submission.
1447
+ * @internal
1448
+ */
1449
+ _submitFromReview(): Promise<void>;
1450
+ /**
1451
+ * Performs the actual API submission after review (or directly when review is disabled).
1452
+ * @internal
1453
+ */
1454
+ private _performSubmit;
1352
1455
  /**
1353
1456
  * Handles bulk insert submission by iterating through items and submitting each separately.
1354
1457
  * Updates rowSubmitStatuses to provide row-level feedback.
@@ -1837,6 +1940,13 @@ declare const Form_base: (new (...args: any[]) => {
1837
1940
  focus(options?: FocusOptions): void;
1838
1941
  }) & typeof FoundationElement;
1839
1942
 
1943
+ /**
1944
+ * Converts a raw field value to a display string for the review panel.
1945
+ * Arrays of primitives are comma-joined; arrays of objects and plain objects
1946
+ * are rendered as readable `key: value` lines.
1947
+ */
1948
+ export declare function formatValueForReview(value: any): string;
1949
+
1840
1950
  /**
1841
1951
  * Detail payload for the `data-change` event fired by {@link Form} and `JSONForms` whenever
1842
1952
  * the bound form data changes.
@@ -1862,6 +1972,12 @@ export declare type FormDataChangeEventDetail = {
1862
1972
  path?: string;
1863
1973
  };
1864
1974
 
1975
+ /** @internal */
1976
+ export declare const foundationFormReviewStyles: ElementStyles;
1977
+
1978
+ /** @internal */
1979
+ export declare const foundationFormReviewTemplate: ViewTemplate<Review, any>;
1980
+
1865
1981
  /** @internal */
1866
1982
  export declare const foundationFormStyles: ElementStyles;
1867
1983
 
@@ -1939,9 +2055,18 @@ export declare enum GenesisType {
1939
2055
  */
1940
2056
  export declare const getAnyOfErrorMessage: (errors: Array<any> | undefined, schema: any, controlPath: string | undefined, uiCustomMsg?: string) => string;
1941
2057
 
2058
+ /**
2059
+ * Navigates a `/properties/`-separated path in data to support nested object scopes
2060
+ * such as `ADDRESS/properties/STREET` produced by Group layout UI schemas.
2061
+ */
2062
+ export declare function getDataValueAtPath(data: any, fieldName: string): any;
2063
+
1942
2064
  /** @internal */
1943
2065
  export declare const getPrefixedForm: (prefix: any) => ViewTemplate<Form, any>;
1944
2066
 
2067
+ /** @internal */
2068
+ export declare const getPrefixedReview: (prefix: any) => ViewTemplate<Review, any>;
2069
+
1945
2070
  /**
1946
2071
  * Fixed height (CSS value) for vertical categorization when `layout` is `{ type: 'vertical'; height?: string }`.
1947
2072
  * @public
@@ -2298,6 +2423,62 @@ export declare type RendererEntry = {
2298
2423
  */
2299
2424
  export declare const renderers: any[];
2300
2425
 
2426
+ /**
2427
+ * For plain enum combobox fields (no options.data), applies the same `capitalCase`
2428
+ * transform the renderer uses — e.g. `SEMI_ANNUAL` → `Semi Annual`.
2429
+ * Navigates the JSON schema via the fieldName path to confirm the field is an enum
2430
+ * before transforming. Returns `null` for non-enum fields.
2431
+ */
2432
+ export declare function resolveEnumLabel(raw: any, fieldName: string, schema: any): string | null;
2433
+
2434
+ /**
2435
+ * Looks up the display label for a raw value from `options.data` (used by segmented,
2436
+ * radio group, and enum-with-explicit-data renderers). Returns `null` when no match found.
2437
+ */
2438
+ export declare function resolveOptionLabel(raw: any, options: any): string | null;
2439
+
2440
+ /**
2441
+ * Read-only preview panel shown by `<foundation-form>` when `show-submit-review` is enabled.
2442
+ * Renders the reviewed data grouped into sections with a header and a filter field.
2443
+ * @public
2444
+ */
2445
+ export declare class Review extends FASTElement {
2446
+ prefix: string;
2447
+ /**
2448
+ * Title shown in the review header.
2449
+ * @public
2450
+ */
2451
+ heading: string;
2452
+ /**
2453
+ * Optional identifier shown next to the heading, e.g. a record's primary key.
2454
+ * @public
2455
+ */
2456
+ recordId: string;
2457
+ /**
2458
+ * Sections of label/value pairs to render, grouped by their nearest UI schema `Group`.
2459
+ * @public
2460
+ */
2461
+ sections: ReviewSection[];
2462
+ /**
2463
+ * Free-text query filtering fields by label or value. Sections with no matching
2464
+ * fields are hidden.
2465
+ * @internal
2466
+ */
2467
+ filterText: string;
2468
+ /** @internal */
2469
+ get filteredSections(): ReviewSection[];
2470
+ }
2471
+
2472
+ export declare type ReviewField = {
2473
+ label: string;
2474
+ value: string;
2475
+ };
2476
+
2477
+ export declare type ReviewSection = {
2478
+ title: string | null;
2479
+ fields: ReviewField[];
2480
+ };
2481
+
2301
2482
  /**
2302
2483
  * Detail payload for the `row-status-changed` event fired by {@link Form} whenever the
2303
2484
  * submission status of one or all bulk insert rows changes.
package/dist/react.cjs CHANGED
@@ -17,6 +17,7 @@ const { StepperWrapper: StepperWrapperWC } = require('./esm/jsonforms/renderers/
17
17
  const { VerticalCategorizationWrapper: VerticalCategorizationWrapperWC } = require('./esm/jsonforms/renderers/VerticalCategorizationWrapperRenderer.js');
18
18
  const { DispatchRenderer: DispatchRendererWC } = require('./esm/jsonforms/renderers/dispatch-renderer.js');
19
19
  const { FoundationReactSlot: FoundationReactSlotWC } = require('./esm/jsonforms/renderers/foundation-react-slot.js');
20
+ const { Review: ReviewWC } = require('./esm/review.js');
20
21
 
21
22
  function _mergeRefs(...refs) {
22
23
  return (value) => {
@@ -104,6 +105,11 @@ const Form = React.forwardRef(function Form(props, ref) {
104
105
  return React.createElement(customElements.getName(FormWC) ?? 'foundation-form', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
105
106
  });
106
107
 
108
+ const Review = React.forwardRef(function Review(props, ref) {
109
+ const { children, ...rest } = props;
110
+ return React.createElement(customElements.getName(ReviewWC) ?? 'foundation-form-review', { ...rest, ref }, children);
111
+ });
112
+
107
113
  const Filters = React.forwardRef(function Filters(props, ref) {
108
114
  const { children, ...rest } = props;
109
115
  return React.createElement(customElements.getName(FiltersWC) ?? 'foundation-filters', { ...rest, ref }, children);
@@ -168,6 +174,7 @@ const FoundationReactSlot = React.forwardRef(function FoundationReactSlot(props,
168
174
 
169
175
  module.exports = {
170
176
  Form,
177
+ Review,
171
178
  Filters,
172
179
  JSONForms,
173
180
  ArrayListWrapper,
package/dist/react.mjs CHANGED
@@ -15,6 +15,7 @@ import { StepperWrapper as StepperWrapperWC } from './esm/jsonforms/renderers/St
15
15
  import { VerticalCategorizationWrapper as VerticalCategorizationWrapperWC } from './esm/jsonforms/renderers/VerticalCategorizationWrapperRenderer.js';
16
16
  import { DispatchRenderer as DispatchRendererWC } from './esm/jsonforms/renderers/dispatch-renderer.js';
17
17
  import { FoundationReactSlot as FoundationReactSlotWC } from './esm/jsonforms/renderers/foundation-react-slot.js';
18
+ import { Review as ReviewWC } from './esm/review.js';
18
19
 
19
20
  function _mergeRefs(...refs) {
20
21
  return (value) => {
@@ -102,6 +103,11 @@ export const Form = React.forwardRef(function Form(props, ref) {
102
103
  return React.createElement(customElements.getName(FormWC) ?? 'foundation-form', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
103
104
  });
104
105
 
106
+ export const Review = React.forwardRef(function Review(props, ref) {
107
+ const { children, ...rest } = props;
108
+ return React.createElement(customElements.getName(ReviewWC) ?? 'foundation-form-review', { ...rest, ref }, children);
109
+ });
110
+
105
111
  export const Filters = React.forwardRef(function Filters(props, ref) {
106
112
  const { children, ...rest } = props;
107
113
  return React.createElement(customElements.getName(FiltersWC) ?? 'foundation-filters', { ...rest, ref }, children);
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.488.0",
4
+ "version": "14.488.1-FUI-2571.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.488.0",
63
- "@genesislcap/genx": "14.488.0",
64
- "@genesislcap/rollup-builder": "14.488.0",
65
- "@genesislcap/ts-builder": "14.488.0",
66
- "@genesislcap/uvu-playwright-builder": "14.488.0",
67
- "@genesislcap/vite-builder": "14.488.0",
68
- "@genesislcap/webpack-builder": "14.488.0",
62
+ "@genesislcap/foundation-testing": "14.488.1-FUI-2571.1",
63
+ "@genesislcap/genx": "14.488.1-FUI-2571.1",
64
+ "@genesislcap/rollup-builder": "14.488.1-FUI-2571.1",
65
+ "@genesislcap/ts-builder": "14.488.1-FUI-2571.1",
66
+ "@genesislcap/uvu-playwright-builder": "14.488.1-FUI-2571.1",
67
+ "@genesislcap/vite-builder": "14.488.1-FUI-2571.1",
68
+ "@genesislcap/webpack-builder": "14.488.1-FUI-2571.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.488.0",
86
- "@genesislcap/foundation-criteria": "14.488.0",
87
- "@genesislcap/foundation-logger": "14.488.0",
88
- "@genesislcap/foundation-notifications": "14.488.0",
89
- "@genesislcap/foundation-ui": "14.488.0",
90
- "@genesislcap/foundation-utils": "14.488.0",
85
+ "@genesislcap/foundation-comms": "14.488.1-FUI-2571.1",
86
+ "@genesislcap/foundation-criteria": "14.488.1-FUI-2571.1",
87
+ "@genesislcap/foundation-logger": "14.488.1-FUI-2571.1",
88
+ "@genesislcap/foundation-notifications": "14.488.1-FUI-2571.1",
89
+ "@genesislcap/foundation-ui": "14.488.1-FUI-2571.1",
90
+ "@genesislcap/foundation-utils": "14.488.1-FUI-2571.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": "621daeb7e3612007d300f8510bb6d12b80a5cb53"
112
+ "gitHead": "895e5ee6992484c60ac422e56dfe363b9e4b5add"
113
113
  }