@socotra/ec-react-components 2.8.0-next.3 → 2.8.0-next.4
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/index.d.ts +78 -2
- package/dist/index.es.js +11832 -11720
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +39 -39
- package/dist/index.umd.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -75,7 +75,7 @@ declare type GetPaymentFormDefaultFieldsProps = {
|
|
|
75
75
|
* `InitializedTransactionForm` is a form for updating a transaction on an issued policy. It requires a transaction in an `initialized` state, the current `segment`, and data types / product model / coverage terms from the tenant data model.
|
|
76
76
|
*/
|
|
77
77
|
export declare const InitializedTransactionForm: {
|
|
78
|
-
({ elementResponse, handleSubmit, paramsChangeInstruction, preventFormResetOnDisabled, disabled, hideSubmitButton, validateOnSubmit, isSubmitting, submitButtonText, id, dataTypes, productModel, coverageTerms, titles, }: Props_7): JSX_2.Element;
|
|
78
|
+
({ elementResponse, handleSubmit, paramsChangeInstruction, preventFormResetOnDisabled, disabled, hideSubmitButton, validateOnSubmit, isSubmitting, submitButtonText, id, dataTypes, productModel, coverageTerms, titles, getEvaluatedConstraints, dependencyMap, }: Props_7): JSX_2.Element;
|
|
79
79
|
displayName: string;
|
|
80
80
|
};
|
|
81
81
|
|
|
@@ -224,6 +224,44 @@ declare type Props_2 = {
|
|
|
224
224
|
* ID for the form wrapper
|
|
225
225
|
* */
|
|
226
226
|
id?: string;
|
|
227
|
+
/**
|
|
228
|
+
* The dependency map for the quote's constraints (if any)
|
|
229
|
+
*
|
|
230
|
+
* This map must be provided to enable the form to evaluate constraints, retrieved by
|
|
231
|
+
*
|
|
232
|
+
* @example
|
|
233
|
+
* const dependencyMap = await fetch(`/policy/${tenantLocator}/quotes/${locator}/constraints/dependency`, {
|
|
234
|
+
* method: "GET",
|
|
235
|
+
* headers: {
|
|
236
|
+
* Authorization: `Bearer ${token}`,
|
|
237
|
+
* "Content-Type": "application/json",
|
|
238
|
+
* }
|
|
239
|
+
* });
|
|
240
|
+
*/
|
|
241
|
+
dependencyMap?: QuoteDependencyMapResponse;
|
|
242
|
+
/**
|
|
243
|
+
* Evaluates constraints for the quote to determine the values of other fields
|
|
244
|
+
*
|
|
245
|
+
* This function must be provided to enable the form to evaluate constraints
|
|
246
|
+
*
|
|
247
|
+
* @param {object} request - The request object containing the quote locator
|
|
248
|
+
* @param {string} tenantLocator - The tenant locator
|
|
249
|
+
* @param {string} locator - The locator of the element to evaluate constraints for
|
|
250
|
+
* @example
|
|
251
|
+
* const getEvaluatedConstraints = async (request: EvaluateConstraintsRequest, tenantLocator: string, locator: string) => {
|
|
252
|
+
* const response = await fetch(`/policy/${tenantLocator}/quotes/${locator}/constraints/evaluate`, {
|
|
253
|
+
* method: "POST",
|
|
254
|
+
* body: JSON.stringify(request),
|
|
255
|
+
* headers: {
|
|
256
|
+
* Authorization: `Bearer ${token}`,
|
|
257
|
+
* "Content-Type": "application/json",
|
|
258
|
+
* }
|
|
259
|
+
* });
|
|
260
|
+
* const data = await response.json();
|
|
261
|
+
* return data;
|
|
262
|
+
* }
|
|
263
|
+
*/
|
|
264
|
+
getEvaluatedConstraints?: (request: EvaluateConstraintsRequest, tenantLocator: string, locator: string) => Promise<ConstraintEvaluationResponse | undefined>;
|
|
227
265
|
/**
|
|
228
266
|
* Titles for the form
|
|
229
267
|
*/
|
|
@@ -536,6 +574,44 @@ declare type Props_7 = {
|
|
|
536
574
|
* ID for the form wrapper
|
|
537
575
|
* */
|
|
538
576
|
id?: string;
|
|
577
|
+
/**
|
|
578
|
+
* The dependency map for the quote's constraints (if any)
|
|
579
|
+
*
|
|
580
|
+
* This map must be provided to enable the form to evaluate constraints, retrieved by
|
|
581
|
+
*
|
|
582
|
+
* @example
|
|
583
|
+
* const dependencyMap = await fetch(`/policy/${tenantLocator}/quotes/${locator}/constraints/dependency`, {
|
|
584
|
+
* method: "GET",
|
|
585
|
+
* headers: {
|
|
586
|
+
* Authorization: `Bearer ${token}`,
|
|
587
|
+
* "Content-Type": "application/json",
|
|
588
|
+
* }
|
|
589
|
+
* });
|
|
590
|
+
*/
|
|
591
|
+
dependencyMap?: QuoteDependencyMapResponse;
|
|
592
|
+
/**
|
|
593
|
+
* Evaluates constraints for the quote to determine the values of other fields
|
|
594
|
+
*
|
|
595
|
+
* This function must be provided to enable the form to evaluate constraints
|
|
596
|
+
*
|
|
597
|
+
* @param {object} request - The request object containing the quote locator
|
|
598
|
+
* @param {string} tenantLocator - The tenant locator
|
|
599
|
+
* @param {string} locator - The locator of the element to evaluate constraints for
|
|
600
|
+
* @example
|
|
601
|
+
* const getEvaluatedConstraints = async (request: EvaluateConstraintsRequest, tenantLocator: string, locator: string) => {
|
|
602
|
+
* const response = await fetch(`/policy/${tenantLocator}/quotes/${locator}/constraints/evaluate`, {
|
|
603
|
+
* method: "POST",
|
|
604
|
+
* body: JSON.stringify(request),
|
|
605
|
+
* headers: {
|
|
606
|
+
* Authorization: `Bearer ${token}`,
|
|
607
|
+
* "Content-Type": "application/json",
|
|
608
|
+
* }
|
|
609
|
+
* });
|
|
610
|
+
* const data = await response.json();
|
|
611
|
+
* return data;
|
|
612
|
+
* }
|
|
613
|
+
*/
|
|
614
|
+
getEvaluatedConstraints?: (request: EvaluateConstraintsRequest, tenantLocator: string, locator: string) => Promise<ConstraintEvaluationResponse | undefined>;
|
|
539
615
|
/**
|
|
540
616
|
* Form titles
|
|
541
617
|
*/
|
|
@@ -619,7 +695,7 @@ declare type Props_8 = {
|
|
|
619
695
|
* QuoteForm is a form for updating a quote. It required a product data model, custom data types, and quote object to render the form.
|
|
620
696
|
*/
|
|
621
697
|
export declare const QuoteForm: {
|
|
622
|
-
({ quote, dataModel, dataTypes, disabled, handleSubmit, isSubmitting, preventFormResetOnDisabled, validateOnSubmit, hideSubmitButton, submitButtonText, id, titles, }: Props_2): JSX_2.Element;
|
|
698
|
+
({ quote, dataModel, dataTypes, disabled, handleSubmit, isSubmitting, preventFormResetOnDisabled, validateOnSubmit, hideSubmitButton, submitButtonText, id, titles, getEvaluatedConstraints, dependencyMap, }: Props_2): JSX_2.Element;
|
|
623
699
|
displayName: string;
|
|
624
700
|
};
|
|
625
701
|
|