@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.
- package/dist/custom-elements.json +630 -2
- package/dist/dts/form.d.ts +77 -0
- package/dist/dts/form.d.ts.map +1 -1
- package/dist/dts/form.styles.d.ts.map +1 -1
- package/dist/dts/form.template.d.ts.map +1 -1
- package/dist/dts/index.d.ts +3 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/jsonforms/renderers/CategorizationWrapperRenderer.d.ts.map +1 -1
- package/dist/dts/react.d.ts +10 -0
- package/dist/dts/review.d.ts +34 -0
- package/dist/dts/review.d.ts.map +1 -0
- package/dist/dts/review.styles.d.ts +3 -0
- package/dist/dts/review.styles.d.ts.map +1 -0
- package/dist/dts/review.template.d.ts +6 -0
- package/dist/dts/review.template.d.ts.map +1 -0
- package/dist/dts/utils/index.d.ts +1 -0
- package/dist/dts/utils/index.d.ts.map +1 -1
- package/dist/dts/utils/review-utils.d.ts +55 -0
- package/dist/dts/utils/review-utils.d.ts.map +1 -0
- package/dist/dts/utils/schema-utils.d.ts +12 -0
- package/dist/dts/utils/schema-utils.d.ts.map +1 -1
- package/dist/esm/form.js +120 -1
- package/dist/esm/form.styles.js +9 -2
- package/dist/esm/form.template.js +58 -24
- package/dist/esm/index.js +3 -0
- package/dist/esm/jsonforms/renderers/CategorizationWrapperRenderer.js +1 -45
- package/dist/esm/review.js +63 -0
- package/dist/esm/review.styles.js +93 -0
- package/dist/esm/review.template.js +38 -0
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/review-utils.js +205 -0
- package/dist/esm/utils/schema-utils.js +48 -0
- package/dist/foundation-forms.api.json +1044 -13
- package/dist/foundation-forms.d.ts +181 -0
- package/dist/react.cjs +7 -0
- package/dist/react.mjs +6 -0
- package/package.json +15 -15
package/dist/dts/form.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { FoundationElement } from '@microsoft/fast-foundation';
|
|
|
2
2
|
import { ErrorObject } from 'ajv';
|
|
3
3
|
import { JSONSchema7 } from 'json-schema';
|
|
4
4
|
import { BulkRowStatus, FormDataChangeEventDetail, RendererEntry, UiSchema } from './types';
|
|
5
|
+
import { ReviewSection } from './utils';
|
|
5
6
|
/**
|
|
6
7
|
* Set of default renderers used by the foundation-forms.
|
|
7
8
|
* @public
|
|
@@ -450,6 +451,12 @@ export declare class Form extends Form_base {
|
|
|
450
451
|
* @internal
|
|
451
452
|
*/
|
|
452
453
|
serverFieldErrors: ErrorObject[];
|
|
454
|
+
/**
|
|
455
|
+
* Reference to the json-forms child element — used to read live validation
|
|
456
|
+
* errors at submit time so review mode never activates when the form is invalid.
|
|
457
|
+
* @internal
|
|
458
|
+
*/
|
|
459
|
+
jsonFormsEl: any;
|
|
453
460
|
/**
|
|
454
461
|
* Stores the approval message entered by the user.
|
|
455
462
|
* @internal
|
|
@@ -573,6 +580,24 @@ export declare class Form extends Form_base {
|
|
|
573
580
|
* @public
|
|
574
581
|
*/
|
|
575
582
|
bulkInsert: boolean;
|
|
583
|
+
/**
|
|
584
|
+
* Text to appear on submit button
|
|
585
|
+
* @default Submit
|
|
586
|
+
* @public
|
|
587
|
+
*/
|
|
588
|
+
submitButtonText: string;
|
|
589
|
+
/**
|
|
590
|
+
* Text to appear on submit button in bulk insert mode
|
|
591
|
+
* @default Submit AllS
|
|
592
|
+
* @public
|
|
593
|
+
*/
|
|
594
|
+
bulkSubmitButtonText: string;
|
|
595
|
+
/**
|
|
596
|
+
* Text to appear on reset button
|
|
597
|
+
* @default Submit
|
|
598
|
+
* @public
|
|
599
|
+
*/
|
|
600
|
+
resetButtonText: string;
|
|
576
601
|
/**
|
|
577
602
|
* Minimum number of items required in bulk insert mode.
|
|
578
603
|
* @public
|
|
@@ -593,16 +618,68 @@ export declare class Form extends Form_base {
|
|
|
593
618
|
* @internal
|
|
594
619
|
*/
|
|
595
620
|
private userProvidedUiSchema;
|
|
621
|
+
/**
|
|
622
|
+
* When enabled, clicking submit with no validation errors shows a read-only preview
|
|
623
|
+
* of the form data before the final submission.
|
|
624
|
+
* @public
|
|
625
|
+
*/
|
|
626
|
+
showSubmitReview: boolean;
|
|
627
|
+
/**
|
|
628
|
+
* Text to appear on reset button
|
|
629
|
+
* @public
|
|
630
|
+
*/
|
|
631
|
+
reviewButtonText: string;
|
|
632
|
+
/**
|
|
633
|
+
* Heading shown at the top of the review panel.
|
|
634
|
+
* @public
|
|
635
|
+
*/
|
|
636
|
+
reviewHeading: string;
|
|
637
|
+
/**
|
|
638
|
+
* Name of a top-level data field whose value is shown as an identifier next to the
|
|
639
|
+
* review heading (e.g. a record's primary key). No identifier is shown when unset.
|
|
640
|
+
* @public
|
|
641
|
+
*/
|
|
642
|
+
reviewIdField: string;
|
|
596
643
|
/**
|
|
597
644
|
* Tracks the submission status for each row in bulk insert mode.
|
|
598
645
|
* Key is the row index, value is the status object.
|
|
599
646
|
* @public
|
|
600
647
|
*/
|
|
601
648
|
rowSubmitStatuses: Map<number, BulkRowStatus>;
|
|
649
|
+
/**
|
|
650
|
+
* Whether the form is currently showing the submit-review preview panel.
|
|
651
|
+
* @internal
|
|
652
|
+
*/
|
|
653
|
+
reviewMode: boolean;
|
|
654
|
+
/**
|
|
655
|
+
* Field label/value pairs rendered in the review panel, grouped into sections.
|
|
656
|
+
* @internal
|
|
657
|
+
*/
|
|
658
|
+
reviewSections: ReviewSection[];
|
|
659
|
+
/**
|
|
660
|
+
* Value of `reviewIdField` resolved from the current form data, if set.
|
|
661
|
+
* @internal
|
|
662
|
+
*/
|
|
663
|
+
get reviewRecordId(): string | undefined;
|
|
602
664
|
/**
|
|
603
665
|
* @internal
|
|
604
666
|
*/
|
|
605
667
|
_submit(): Promise<void>;
|
|
668
|
+
/**
|
|
669
|
+
* Called from the review panel to go back to the form.
|
|
670
|
+
* @internal
|
|
671
|
+
*/
|
|
672
|
+
backFromReview(): void;
|
|
673
|
+
/**
|
|
674
|
+
* Called from the review panel submit button to perform the actual submission.
|
|
675
|
+
* @internal
|
|
676
|
+
*/
|
|
677
|
+
_submitFromReview(): Promise<void>;
|
|
678
|
+
/**
|
|
679
|
+
* Performs the actual API submission after review (or directly when review is disabled).
|
|
680
|
+
* @internal
|
|
681
|
+
*/
|
|
682
|
+
private _performSubmit;
|
|
606
683
|
/**
|
|
607
684
|
* Handles bulk insert submission by iterating through items and submitting each separately.
|
|
608
685
|
* Updates rowSubmitStatuses to provide row-level feedback.
|
package/dist/dts/form.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/form.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAyB1C,OAAO,EACL,aAAa,EAOb,yBAAyB,EACzB,aAAa,EAOb,QAAQ,EACT,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/form.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAyB1C,OAAO,EACL,aAAa,EAOb,yBAAyB,EACzB,aAAa,EAOb,QAAQ,EACT,MAAM,SAAS,CAAC;AACjB,OAAO,EAWL,aAAa,EACd,MAAM,SAAS,CAAC;AAiBjB;;;GAGG;AACH,eAAO,MAAM,SAAS,OAwBrB,CAAC;;;;;;;kBAjEa,CAAC;;;;;;;;8BA2Dc,CAAC,cACzB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAkBN,CAAD;4IACuE,CAAC;wFAC6B,CAAC;+IAET,CAAC;2FAEpE,CAA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B;IAOzB;;;OAGG;IACH,kBAAkB;IAQlB;;;OAGG;IACG,kBAAkB;IAmCxB;;;;;OAKG;IACG,qBAAqB,CAAC,KAAK,EAAE,KAAK;IA4FxC;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAMzB;;;;;OAKG;IACH,mBAAmB;CA+BpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.styles.d.ts","sourceRoot":"","sources":["../../src/form.styles.ts"],"names":[],"mappings":"AAMA,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,GAAI,SAAQ,MAAe,WAK7D,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"form.styles.d.ts","sourceRoot":"","sources":["../../src/form.styles.ts"],"names":[],"mappings":"AAMA,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,GAAI,SAAQ,MAAe,WAK7D,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,oBAAoB,iDA2IhC,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;
|
|
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;AAmBnC,gBAAgB;AAChB,eAAO,MAAM,eAAe,GAAI,WAAM,8DA+JrC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,2DAElC,CAAC"}
|
package/dist/dts/index.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ export * from './filters';
|
|
|
2
2
|
export * from './form';
|
|
3
3
|
export * from './form.styles';
|
|
4
4
|
export * from './form.template';
|
|
5
|
+
export * from './review';
|
|
6
|
+
export * from './review.styles';
|
|
7
|
+
export * from './review.template';
|
|
5
8
|
export { MulticolumnDropdownControlRendererEntry, MulticolumnDropdownControlRendererTemplate, } from './jsonforms/renderers/MulticolumnDropdownControlRenderer';
|
|
6
9
|
export { LayoutVerticalCategorizationRendererEntry } from './jsonforms/renderers/LayoutVerticalCategorizationRenderer';
|
|
7
10
|
export { controlWrapperTemplate, controlWrapperStyles,
|
package/dist/dts/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,OAAO,EACL,uCAAuC,EACvC,0CAA0C,GAC3C,MAAM,0DAA0D,CAAC;AAClE,OAAO,EAAE,yCAAyC,EAAE,MAAM,4DAA4D,CAAC;AACvH,OAAO,EACL,sBAAsB,EACtB,oBAAoB;AACpB,8DAA8D;AAC9D,cAAc;AACd,8DAA8D;AAC9D,8BAA8B,GAC/B,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,qBAAqB;AACrB,6DAA6D;AAC7D,aAAa,GACd,MAAM,sCAAsC,CAAC;AAC9C,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,OAAO,EACL,uCAAuC,EACvC,0CAA0C,GAC3C,MAAM,0DAA0D,CAAC;AAClE,OAAO,EAAE,yCAAyC,EAAE,MAAM,4DAA4D,CAAC;AACvH,OAAO,EACL,sBAAsB,EACtB,oBAAoB;AACpB,8DAA8D;AAC9D,cAAc;AACd,8DAA8D;AAC9D,8BAA8B,GAC/B,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,qBAAqB;AACrB,6DAA6D;AAC7D,aAAa,GACd,MAAM,sCAAsC,CAAC;AAC9C,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CategorizationWrapperRenderer.d.ts","sourceRoot":"","sources":["../../../../src/jsonforms/renderers/CategorizationWrapperRenderer.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,WAAW,EAIZ,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"CategorizationWrapperRenderer.d.ts","sourceRoot":"","sources":["../../../../src/jsonforms/renderers/CategorizationWrapperRenderer.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,WAAW,EAIZ,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAY,eAAe,EAAE,MAAM,aAAa,CAAC;AAGxD;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,QAAQ,EAAE,eAAe,EAAE,GAC1B,MAAM,CAKR;AAED,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,eAAe,EAAE,IAAI,EAAE,GAAG,GAAG,MAAM,CAMrF;AAED,eAAO,MAAM,oBAAoB,iDAKhC,CAAC;AAEF,eAAO,MAAM,qCAAqC,GAChD,eAAe,+EA6DhB,CAAC;AAkBF,qBAQa,qBAAsB,SAAQ,WAAW;IACxC,IAAI,MAAC;IACL,OAAO,MAAC;IACR,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAgB;IACxC,cAAc,EAAE,MAAM,CAAK;IAEvC;;;;;;;OAOG;IACH,OAAO,CAAC,wBAAwB,CAAS;IAEzC,cAAc;IAUd,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAIjC,eAAe,CAAC,KAAK,EAAE,KAAK;IAQ5B,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO;CAQjD"}
|
package/dist/dts/react.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import type { StepperWrapper as StepperWrapperWC } from './jsonforms/renderers/S
|
|
|
15
15
|
import type { VerticalCategorizationWrapper as VerticalCategorizationWrapperWC } from './jsonforms/renderers/VerticalCategorizationWrapperRenderer';
|
|
16
16
|
import type { DispatchRenderer as DispatchRendererWC } from './jsonforms/renderers/dispatch-renderer';
|
|
17
17
|
import type { FoundationReactSlot as FoundationReactSlotWC } from './jsonforms/renderers/foundation-react-slot';
|
|
18
|
+
import type { Review as ReviewWC } from './review';
|
|
18
19
|
import type { BulkSubmitResult, CsvImportedEventDetail, CsvParseErrorEventDetail, CsvTemplateDownloadedEventDetail, CsvTemplateErrorEventDetail, FormDataChangeEventDetail, RowStatusChangedEventDetail, RowSubmitFailureEventDetail, RowSubmitSuccessEventDetail, SubmitFailureEventDetail, SubmitPartialSuccessEventDetail } from '@genesislcap/foundation-forms';
|
|
19
20
|
|
|
20
21
|
/** @internal Maps a web component class to its public props only.
|
|
@@ -68,6 +69,15 @@ export declare const Form: React.ForwardRefExoticComponent<
|
|
|
68
69
|
>;
|
|
69
70
|
export type FormRef = FormWC;
|
|
70
71
|
|
|
72
|
+
export declare const Review: React.ForwardRefExoticComponent<
|
|
73
|
+
React.PropsWithChildren<
|
|
74
|
+
Omit<PublicOf<ReviewWC>, 'children' | 'style'> &
|
|
75
|
+
HTMLWCProps & {
|
|
76
|
+
}
|
|
77
|
+
> & React.RefAttributes<ReviewWC>
|
|
78
|
+
>;
|
|
79
|
+
export type ReviewRef = ReviewWC;
|
|
80
|
+
|
|
71
81
|
export declare const Filters: React.ForwardRefExoticComponent<
|
|
72
82
|
React.PropsWithChildren<
|
|
73
83
|
Omit<PublicOf<FiltersWC>, 'children' | 'style'> &
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { FASTElement } from '@microsoft/fast-element';
|
|
2
|
+
import { type ReviewSection } from './utils/review-utils';
|
|
3
|
+
/**
|
|
4
|
+
* Read-only preview panel shown by `<foundation-form>` when `show-submit-review` is enabled.
|
|
5
|
+
* Renders the reviewed data grouped into sections with a header and a filter field.
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export declare class Review extends FASTElement {
|
|
9
|
+
prefix: string;
|
|
10
|
+
/**
|
|
11
|
+
* Title shown in the review header.
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
heading: string;
|
|
15
|
+
/**
|
|
16
|
+
* Optional identifier shown next to the heading, e.g. a record's primary key.
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
recordId: string;
|
|
20
|
+
/**
|
|
21
|
+
* Sections of label/value pairs to render, grouped by their nearest UI schema `Group`.
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
sections: ReviewSection[];
|
|
25
|
+
/**
|
|
26
|
+
* Free-text query filtering fields by label or value. Sections with no matching
|
|
27
|
+
* fields are hidden.
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
filterText: string;
|
|
31
|
+
/** @internal */
|
|
32
|
+
get filteredSections(): ReviewSection[];
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=review.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../src/review.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,WAAW,EAAwB,MAAM,yBAAyB,CAAC;AAGjG,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAEhF;;;;GAIG;AACH,qBAMa,MAAO,SAAQ,WAAW;IACQ,MAAM,EAAE,MAAM,CAAW;IAEtE;;;OAGG;IACG,OAAO,EAAE,MAAM,CAAY;IAEjC;;;OAGG;IAC+B,QAAQ,EAAE,MAAM,CAAC;IAEnD;;;OAGG;IACS,QAAQ,EAAE,aAAa,EAAE,CAAM;IAE3C;;;;OAIG;IACS,UAAU,EAAE,MAAM,CAAM;IAEpC,gBAAgB;IAChB,IACI,gBAAgB,IAAI,aAAa,EAAE,CAEtC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.styles.d.ts","sourceRoot":"","sources":["../../src/review.styles.ts"],"names":[],"mappings":"AAKA,gBAAgB;AAChB,eAAO,MAAM,0BAA0B,iDAyFtC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Review } from './review';
|
|
2
|
+
/** @internal */
|
|
3
|
+
export declare const getPrefixedReview: (prefix: any) => import("@microsoft/fast-element").ViewTemplate<Review, any>;
|
|
4
|
+
/** @internal */
|
|
5
|
+
export declare const foundationFormReviewTemplate: import("@microsoft/fast-element").ViewTemplate<Review, any>;
|
|
6
|
+
//# sourceMappingURL=review.template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.template.d.ts","sourceRoot":"","sources":["../../src/review.template.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGvC,gBAAgB;AAChB,eAAO,MAAM,iBAAiB,GAAI,WAAM,gEA0CvC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,4BAA4B,6DAExC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export type ReviewField = {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
};
|
|
5
|
+
export type ReviewSection = {
|
|
6
|
+
title: string | null;
|
|
7
|
+
fields: ReviewField[];
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Flattens `buildReviewSections` output into a single ordered list.
|
|
11
|
+
* Section titles are prepended to field labels as "Title — Field".
|
|
12
|
+
*/
|
|
13
|
+
export declare function buildReviewFields(data: Record<string, any>, uiSchema: any, schema: any): ReviewField[];
|
|
14
|
+
/**
|
|
15
|
+
* Builds the review panel's fields grouped into sections by their nearest `Group` layout.
|
|
16
|
+
* Ungrouped fields are collected into a single section with a `null` title (rendered with
|
|
17
|
+
* a placeholder heading). Falls back to a flat, single ungrouped section when no UI schema
|
|
18
|
+
* is available.
|
|
19
|
+
*/
|
|
20
|
+
export declare function buildReviewSections(data: Record<string, any>, uiSchema: any, schema: any): ReviewSection[];
|
|
21
|
+
/**
|
|
22
|
+
* Filters review sections down to fields whose label or value contains `query`
|
|
23
|
+
* (case-insensitive). Sections left with no matching fields are dropped entirely.
|
|
24
|
+
* Returns `sections` unchanged when `query` is blank.
|
|
25
|
+
*/
|
|
26
|
+
export declare function filterReviewSections(sections: ReviewSection[], query: string): ReviewSection[];
|
|
27
|
+
/**
|
|
28
|
+
* Recursively walks a UI schema element, collecting visible Control fields into `out`.
|
|
29
|
+
* Passes the nearest Group label down so children are labelled "Group — Field".
|
|
30
|
+
*/
|
|
31
|
+
export declare function collectReviewFields(element: any, data: any, out: ReviewField[], groupLabel: string | undefined, schema: any): void;
|
|
32
|
+
/**
|
|
33
|
+
* Looks up the display label for a raw value from `options.data` (used by segmented,
|
|
34
|
+
* radio group, and enum-with-explicit-data renderers). Returns `null` when no match found.
|
|
35
|
+
*/
|
|
36
|
+
export declare function resolveOptionLabel(raw: any, options: any): string | null;
|
|
37
|
+
/**
|
|
38
|
+
* For plain enum combobox fields (no options.data), applies the same `capitalCase`
|
|
39
|
+
* transform the renderer uses — e.g. `SEMI_ANNUAL` → `Semi Annual`.
|
|
40
|
+
* Navigates the JSON schema via the fieldName path to confirm the field is an enum
|
|
41
|
+
* before transforming. Returns `null` for non-enum fields.
|
|
42
|
+
*/
|
|
43
|
+
export declare function resolveEnumLabel(raw: any, fieldName: string, schema: any): string | null;
|
|
44
|
+
/**
|
|
45
|
+
* Navigates a `/properties/`-separated path in data to support nested object scopes
|
|
46
|
+
* such as `ADDRESS/properties/STREET` produced by Group layout UI schemas.
|
|
47
|
+
*/
|
|
48
|
+
export declare function getDataValueAtPath(data: any, fieldName: string): any;
|
|
49
|
+
/**
|
|
50
|
+
* Converts a raw field value to a display string for the review panel.
|
|
51
|
+
* Arrays of primitives are comma-joined; arrays of objects and plain objects
|
|
52
|
+
* are rendered as readable `key: value` lines.
|
|
53
|
+
*/
|
|
54
|
+
export declare function formatValueForReview(value: any): string;
|
|
55
|
+
//# sourceMappingURL=review-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-utils.d.ts","sourceRoot":"","sources":["../../../src/utils/review-utils.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,WAAW,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3D,MAAM,MAAM,aAAa,GAAG;IAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,WAAW,EAAE,CAAA;CAAE,CAAC;AAE5E;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACzB,QAAQ,EAAE,GAAG,EACb,MAAM,EAAE,GAAG,GACV,WAAW,EAAE,CAOf;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACzB,QAAQ,EAAE,GAAG,EACb,MAAM,EAAE,GAAG,GACV,aAAa,EAAE,CA2DjB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,aAAa,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,aAAa,EAAE,CAc9F;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,GAAG,EACZ,IAAI,EAAE,GAAG,EACT,GAAG,EAAE,WAAW,EAAE,EAClB,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,MAAM,EAAE,GAAG,GACV,IAAI,CA6BN;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,GAAG,MAAM,GAAG,IAAI,CAIxE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,MAAM,GAAG,IAAI,CAiBxF;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,GAAG,GAAG,CAEpE;AAYD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAuBvD"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ErrorObject } from 'ajv';
|
|
1
2
|
import type { UiSchema, UiSchemaElement } from '../types';
|
|
2
3
|
/**
|
|
3
4
|
* Extracted control info for grid layout rendering.
|
|
@@ -36,6 +37,17 @@ export declare function withGridView(uiSchema: UiSchema): UiSchema;
|
|
|
36
37
|
* @internal
|
|
37
38
|
*/
|
|
38
39
|
export declare function isBulkUiSchema(uischema: UiSchema): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Converts AJV validation errors to the JSON Schema scope strings they correspond to
|
|
42
|
+
* (e.g. `#/properties/ADDRESS/properties/STREET`). Used to match errors back to UI
|
|
43
|
+
* schema controls for features like categorization-tab error indicators.
|
|
44
|
+
*/
|
|
45
|
+
export declare function extractErrorScopes(errors: ErrorObject[]): string[];
|
|
46
|
+
/**
|
|
47
|
+
* Returns true when `uiSchema` (or any of its descendants) has a scope that appears
|
|
48
|
+
* in `errorScopes`. Walks both `elements` and `options.childElements`.
|
|
49
|
+
*/
|
|
50
|
+
export declare function uiSchemaHasAnyError(uiSchema: UiSchemaElement | UiSchema, errorScopes: string[]): boolean;
|
|
39
51
|
/**
|
|
40
52
|
* Generates a UI schema suitable for bulk insert mode with array control.
|
|
41
53
|
* @param userProvidedUiSchema - Optional user-provided UI schema to use as childUiSchema
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-utils.d.ts","sourceRoot":"","sources":["../../../src/utils/schema-utils.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"schema-utils.d.ts","sourceRoot":"","sources":["../../../src/utils/schema-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,KAAK,EAAiC,QAAQ,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEzF;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,iDAAiD;IACjD,QAAQ,EAAE,eAAe,CAAC;IAC1B,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,2FAA2F;IAC3F,SAAS,EAAE,MAAM,CAAC;CACnB;AAaD;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,QAAQ,GAAG,gBAAgB,EAAE,CA6ClF;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAiBzD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAK1D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,EAAE,CAelE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,eAAe,GAAG,QAAQ,EACpC,WAAW,EAAE,MAAM,EAAE,GACpB,OAAO,CAmBT;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,oBAAoB,CAAC,EAAE,QAAQ,GAAG,IAAI,GAAG,QAAQ,CAoBrF"}
|
package/dist/esm/form.js
CHANGED
|
@@ -29,7 +29,7 @@ import { NumberControlRendererEntry } from './jsonforms/renderers/NumberControlR
|
|
|
29
29
|
import { SegmentedControlRendererEntry } from './jsonforms/renderers/SegmentedControlRenderer';
|
|
30
30
|
import { StringArrayEntry } from './jsonforms/renderers/StringArrayControlRenderer';
|
|
31
31
|
import { StringControlRendererTemplate } from './jsonforms/renderers/StringControlRenderer';
|
|
32
|
-
import { downloadCsvTemplate as downloadCsvFile, extractFieldsFromUiSchema, generateCsvTemplate, logger, mapCsvToSchema, mapGenesisFieldErrorsToAdditionalErrors, parseCsv, } from './utils';
|
|
32
|
+
import { buildReviewSections, downloadCsvTemplate as downloadCsvFile, extractFieldsFromUiSchema, generateCsvTemplate, getDataValueAtPath, logger, mapCsvToSchema, mapGenesisFieldErrorsToAdditionalErrors, parseCsv, } from './utils';
|
|
33
33
|
import { findModalParent, showConfirmationDialog } from './utils/confirmation-dialog-utils';
|
|
34
34
|
import { removeDataPropertiesNotInSchema } from './utils/form-utils';
|
|
35
35
|
import { generateBulkUiSchema, isBulkUiSchema } from './utils/schema-utils';
|
|
@@ -149,17 +149,55 @@ let Form = class Form extends LifecycleMixin(FoundationElement) {
|
|
|
149
149
|
* @public
|
|
150
150
|
*/
|
|
151
151
|
this.data = {};
|
|
152
|
+
/**
|
|
153
|
+
* Text to appear on submit button
|
|
154
|
+
* @default Submit
|
|
155
|
+
* @public
|
|
156
|
+
*/
|
|
157
|
+
this.submitButtonText = 'Submit';
|
|
158
|
+
/**
|
|
159
|
+
* Text to appear on submit button in bulk insert mode
|
|
160
|
+
* @default Submit AllS
|
|
161
|
+
* @public
|
|
162
|
+
*/
|
|
163
|
+
this.bulkSubmitButtonText = 'Submit All';
|
|
164
|
+
/**
|
|
165
|
+
* Text to appear on reset button
|
|
166
|
+
* @default Submit
|
|
167
|
+
* @public
|
|
168
|
+
*/
|
|
169
|
+
this.resetButtonText = 'Reset';
|
|
152
170
|
/**
|
|
153
171
|
* Minimum number of items required in bulk insert mode.
|
|
154
172
|
* @public
|
|
155
173
|
*/
|
|
156
174
|
this.bulkInsertMinItems = 1;
|
|
175
|
+
/**
|
|
176
|
+
* Text to appear on reset button
|
|
177
|
+
* @public
|
|
178
|
+
*/
|
|
179
|
+
this.reviewButtonText = 'Review';
|
|
180
|
+
/**
|
|
181
|
+
* Heading shown at the top of the review panel.
|
|
182
|
+
* @public
|
|
183
|
+
*/
|
|
184
|
+
this.reviewHeading = 'Review';
|
|
157
185
|
/**
|
|
158
186
|
* Tracks the submission status for each row in bulk insert mode.
|
|
159
187
|
* Key is the row index, value is the status object.
|
|
160
188
|
* @public
|
|
161
189
|
*/
|
|
162
190
|
this.rowSubmitStatuses = new Map();
|
|
191
|
+
/**
|
|
192
|
+
* Whether the form is currently showing the submit-review preview panel.
|
|
193
|
+
* @internal
|
|
194
|
+
*/
|
|
195
|
+
this.reviewMode = false;
|
|
196
|
+
/**
|
|
197
|
+
* Field label/value pairs rendered in the review panel, grouped into sections.
|
|
198
|
+
* @internal
|
|
199
|
+
*/
|
|
200
|
+
this.reviewSections = [];
|
|
163
201
|
}
|
|
164
202
|
resourceNameChanged() {
|
|
165
203
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -258,11 +296,23 @@ let Form = class Form extends LifecycleMixin(FoundationElement) {
|
|
|
258
296
|
const { renderers: defaultRenderers = [], additionalRenderers = [] } = this;
|
|
259
297
|
this.mergedRenderers = [...defaultRenderers, ...additionalRenderers];
|
|
260
298
|
}
|
|
299
|
+
/**
|
|
300
|
+
* Value of `reviewIdField` resolved from the current form data, if set.
|
|
301
|
+
* @internal
|
|
302
|
+
*/
|
|
303
|
+
get reviewRecordId() {
|
|
304
|
+
if (!this.reviewIdField) {
|
|
305
|
+
return undefined;
|
|
306
|
+
}
|
|
307
|
+
const value = getDataValueAtPath(this.data, this.reviewIdField);
|
|
308
|
+
return value === undefined || value === null ? undefined : String(value);
|
|
309
|
+
}
|
|
261
310
|
/**
|
|
262
311
|
* @internal
|
|
263
312
|
*/
|
|
264
313
|
_submit() {
|
|
265
314
|
return __awaiter(this, void 0, void 0, function* () {
|
|
315
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
266
316
|
if (this.submitting) {
|
|
267
317
|
return;
|
|
268
318
|
}
|
|
@@ -287,6 +337,46 @@ let Form = class Form extends LifecycleMixin(FoundationElement) {
|
|
|
287
337
|
yield this._submitBulk();
|
|
288
338
|
return;
|
|
289
339
|
}
|
|
340
|
+
// Show review preview if enabled and the form has no validation errors.
|
|
341
|
+
// Read live errors directly from the json-forms element so we always use
|
|
342
|
+
// the current validation state (this.errors can lag in edge cases such as
|
|
343
|
+
// required fields with empty-string values not yet reported via data-change).
|
|
344
|
+
const jfEl = this.jsonFormsEl;
|
|
345
|
+
const hasErrors = jfEl
|
|
346
|
+
? ((_d = (_c = (_b = (_a = jfEl.jsonforms) === null || _a === void 0 ? void 0 : _a.core) === null || _b === void 0 ? void 0 : _b.errors) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) > 0 ||
|
|
347
|
+
((_h = (_g = (_f = (_e = jfEl.jsonforms) === null || _e === void 0 ? void 0 : _e.core) === null || _f === void 0 ? void 0 : _f.additionalErrors) === null || _g === void 0 ? void 0 : _g.length) !== null && _h !== void 0 ? _h : 0) > 0
|
|
348
|
+
: this.errors.length > 0;
|
|
349
|
+
if (this.showSubmitReview && !hasErrors) {
|
|
350
|
+
this.reviewSections = buildReviewSections(this.data || {}, this.userProvidedUiSchema || this.uischema, this.originalDetailsSchema || this.jsonSchema);
|
|
351
|
+
this.reviewMode = true;
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
yield this._performSubmit();
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Called from the review panel to go back to the form.
|
|
359
|
+
* @internal
|
|
360
|
+
*/
|
|
361
|
+
backFromReview() {
|
|
362
|
+
this.reviewMode = false;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Called from the review panel submit button to perform the actual submission.
|
|
366
|
+
* @internal
|
|
367
|
+
*/
|
|
368
|
+
_submitFromReview() {
|
|
369
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
370
|
+
this.reviewMode = false;
|
|
371
|
+
yield this._performSubmit();
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Performs the actual API submission after review (or directly when review is disabled).
|
|
376
|
+
* @internal
|
|
377
|
+
*/
|
|
378
|
+
_performSubmit() {
|
|
379
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
290
380
|
const payload = Object.assign({}, this.data);
|
|
291
381
|
const commitPayload = this.buildCommitPayload(payload);
|
|
292
382
|
logger.debug({ payload, errors: this.errors });
|
|
@@ -638,6 +728,8 @@ let Form = class Form extends LifecycleMixin(FoundationElement) {
|
|
|
638
728
|
*/
|
|
639
729
|
reset(clearData = true) {
|
|
640
730
|
this.submitted = false;
|
|
731
|
+
this.reviewMode = false;
|
|
732
|
+
this.reviewSections = [];
|
|
641
733
|
this.clearRowSubmitStatuses();
|
|
642
734
|
this.serverFieldErrors = [];
|
|
643
735
|
if (clearData) {
|
|
@@ -902,6 +994,15 @@ __decorate([
|
|
|
902
994
|
__decorate([
|
|
903
995
|
attr({ attribute: 'bulk-insert', mode: 'boolean' })
|
|
904
996
|
], Form.prototype, "bulkInsert", void 0);
|
|
997
|
+
__decorate([
|
|
998
|
+
attr({ attribute: 'submit-button-text' })
|
|
999
|
+
], Form.prototype, "submitButtonText", void 0);
|
|
1000
|
+
__decorate([
|
|
1001
|
+
attr({ attribute: 'bulk-submit-button-text' })
|
|
1002
|
+
], Form.prototype, "bulkSubmitButtonText", void 0);
|
|
1003
|
+
__decorate([
|
|
1004
|
+
attr({ attribute: 'reset-button-text' })
|
|
1005
|
+
], Form.prototype, "resetButtonText", void 0);
|
|
905
1006
|
__decorate([
|
|
906
1007
|
attr({
|
|
907
1008
|
attribute: 'bulk-insert-min-items',
|
|
@@ -920,9 +1021,27 @@ __decorate([
|
|
|
920
1021
|
},
|
|
921
1022
|
})
|
|
922
1023
|
], Form.prototype, "bulkInsertMaxItems", void 0);
|
|
1024
|
+
__decorate([
|
|
1025
|
+
attr({ attribute: 'show-submit-review', mode: 'boolean' })
|
|
1026
|
+
], Form.prototype, "showSubmitReview", void 0);
|
|
1027
|
+
__decorate([
|
|
1028
|
+
attr({ attribute: 'review-button-text' })
|
|
1029
|
+
], Form.prototype, "reviewButtonText", void 0);
|
|
1030
|
+
__decorate([
|
|
1031
|
+
attr({ attribute: 'review-heading' })
|
|
1032
|
+
], Form.prototype, "reviewHeading", void 0);
|
|
1033
|
+
__decorate([
|
|
1034
|
+
attr({ attribute: 'review-id-field' })
|
|
1035
|
+
], Form.prototype, "reviewIdField", void 0);
|
|
923
1036
|
__decorate([
|
|
924
1037
|
observable
|
|
925
1038
|
], Form.prototype, "rowSubmitStatuses", void 0);
|
|
1039
|
+
__decorate([
|
|
1040
|
+
observable
|
|
1041
|
+
], Form.prototype, "reviewMode", void 0);
|
|
1042
|
+
__decorate([
|
|
1043
|
+
observable
|
|
1044
|
+
], Form.prototype, "reviewSections", void 0);
|
|
926
1045
|
__decorate([
|
|
927
1046
|
volatile
|
|
928
1047
|
], Form.prototype, "isSubmitHidden", null);
|
package/dist/esm/form.styles.js
CHANGED
|
@@ -22,10 +22,17 @@ export const foundationFormStyles = css `
|
|
|
22
22
|
min-width: 64px;
|
|
23
23
|
width: 100%;
|
|
24
24
|
height: 100%;
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
box-sizing: border-box;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
foundation-form json-forms {
|
|
32
|
+
flex: 1;
|
|
25
33
|
overflow-y: auto;
|
|
26
|
-
|
|
34
|
+
min-height: 0;
|
|
27
35
|
scrollbar-color: var(--neutral-stroke-rest) transparent;
|
|
28
|
-
box-sizing: border-box;
|
|
29
36
|
}
|
|
30
37
|
|
|
31
38
|
foundation-form .actions {
|