@socotra/ec-react-components 2.19.3-next.4 → 2.19.3-next.5

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 CHANGED
@@ -15,6 +15,7 @@ import { ElementConfig } from '@socotra/ec-react-schemas';
15
15
  import { ElementRequest } from '@socotra/ec-react-schemas';
16
16
  import { ElementResponse } from '@socotra/ec-react-schemas';
17
17
  import { EvaluateConstraintsRequest } from '@socotra/ec-react-schemas';
18
+ import { ForwardRefExoticComponent } from 'react';
18
19
  import { JSX as JSX_2 } from 'react/jsx-runtime';
19
20
  import { ModifyChangeInstructionCreateRequest } from '@socotra/ec-react-schemas';
20
21
  import { ModifyChangeInstructionResponse } from '@socotra/ec-react-schemas';
@@ -27,6 +28,7 @@ import { ProductConfig } from '@socotra/ec-react-schemas';
27
28
  import { QuoteDependencyMapResponse } from '@socotra/ec-react-schemas';
28
29
  import { QuoteRequest } from '@socotra/ec-react-schemas';
29
30
  import { QuoteResponse } from '@socotra/ec-react-schemas';
31
+ import { RefAttributes } from 'react';
30
32
  import { ReversalTypeConfigRecord } from '@socotra/ec-react-schemas';
31
33
  import { SegmentResponse } from '@socotra/ec-react-schemas';
32
34
  import { TransactionMethodEnum } from '@socotra/ec-react-schemas';
@@ -36,7 +38,7 @@ import { TransactionSnapshotResponse } from '@socotra/ec-react-schemas';
36
38
  * AccountForm is a form for creating or updating an account. It required a resolved data model, custom data types, and an optional account object to put the form in update mode.
37
39
  */
38
40
  export declare const AccountForm: {
39
- ({ dataModel, accountType, disabled, handleSubmit, isSubmitting, preventFormResetOnDisabled, hideSubmitButton, hideAdvancedFields, validateOnSubmit, account, submitButtonText, id, titles, }: Props): JSX_2.Element;
41
+ ({ dataModel, accountType, disabled, handleSubmit, isSubmitting, preventFormResetOnDisabled, hideSubmitButton, hideAdvancedFields, validateOnSubmit, account, submitButtonText, id, titles, styles, }: Props): JSX_2.Element;
40
42
  displayName: string;
41
43
  };
42
44
 
@@ -83,6 +85,11 @@ declare type BaseProps = {
83
85
  * ID for the form wrapper
84
86
  * */
85
87
  id?: string;
88
+ /**
89
+ * Custom form styling
90
+ * See https://github.com/eclipsesource/jsonforms/blob/master/packages/vanilla-renderers/Styles.md
91
+ */
92
+ styles?: StyleDefinition[];
86
93
  titles?: {
87
94
  seeAdvancedDetails?: string;
88
95
  truthyLabel?: string;
@@ -101,7 +108,7 @@ declare type BaseProps = {
101
108
  * `DraftTransactionForm` is a form for updating a transaction on an issued policy. It requires a transaction in a `draft` state, a `transactionSnapshot`, `paramsChangeInstruction` (created when the transaction is created), and data types / product model / coverage terms from the tenant data model.
102
109
  */
103
110
  export declare const DraftTransactionForm: {
104
- ({ transactionSnapshot, handleSubmit, paramsChangeInstruction, modifyChangeInstruction, preventFormResetOnDisabled, disabled, hideSubmitButton, validateOnSubmit, isSubmitting, submitButtonText, id, dataTypes, productModel, coverageTerms: coverageTermsDataModel, titles, }: Props_9): JSX_2.Element;
111
+ ({ transactionSnapshot, handleSubmit, paramsChangeInstruction, modifyChangeInstruction, preventFormResetOnDisabled, disabled, hideSubmitButton, validateOnSubmit, isSubmitting, submitButtonText, id, dataTypes, productModel, coverageTerms: coverageTermsDataModel, titles, styles, }: Props_9): JSX_2.Element;
105
112
  displayName: string;
106
113
  };
107
114
 
@@ -109,7 +116,7 @@ export declare const DraftTransactionForm: {
109
116
  * ElementForm is a form for creating or updating an element of a Quote. It required the element's data model, custom data types, and an element response object.
110
117
  */
111
118
  export declare const ElementForm: {
112
- ({ elementModel, dataTypes, disabled, handleSubmit, dataModel, timezone, coverageTerms: coverageTermsDataModel, isSubmitting, preventFormResetOnDisabled, hideSubmitButton, element, validateOnSubmit, hideAllFields, hideCoverageTerms, submitButtonText, id, titles, getEvaluatedConstraints, dependencyMap, quote, }: Props_3): JSX_2.Element;
119
+ ({ elementModel, dataTypes, disabled, handleSubmit, dataModel, timezone, coverageTerms: coverageTermsDataModel, isSubmitting, preventFormResetOnDisabled, hideSubmitButton, element, validateOnSubmit, hideAllFields, hideCoverageTerms, submitButtonText, id, titles, getEvaluatedConstraints, dependencyMap, quote, styles, }: Props_3): JSX_2.Element;
113
120
  displayName: string;
114
121
  };
115
122
 
@@ -117,7 +124,7 @@ export declare const ElementForm: {
117
124
  * Apply a payment to an existing invoice form
118
125
  */
119
126
  export declare const ExistingPaymentForm: {
120
- ({ accountLocator, invoiceLocator, balance, currency, validateOnSubmit, hideSubmitButton, submitButtonText, handleSubmit, isSubmitting, disabled, id, titles, invoiceBalance, }: Props_6): JSX_2.Element;
127
+ ({ accountLocator, invoiceLocator, balance, currency, validateOnSubmit, hideSubmitButton, submitButtonText, handleSubmit, isSubmitting, disabled, id, titles, invoiceBalance, styles, }: Props_6): JSX_2.Element;
121
128
  displayName: string;
122
129
  };
123
130
 
@@ -151,7 +158,7 @@ declare type GetPaymentFormDefaultFieldsProps = {
151
158
  * `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.
152
159
  */
153
160
  export declare const InitializedTransactionForm: {
154
- ({ elementResponse, handleSubmit, paramsChangeInstruction, preventFormResetOnDisabled, disabled, hideSubmitButton, validateOnSubmit, isSubmitting, submitButtonText, id, dataTypes, productModel, timezone, coverageTerms: coverageTermsDataModel, titles, getEvaluatedConstraints, dependencyMap, }: Props_8): JSX_2.Element;
161
+ ({ elementResponse, handleSubmit, paramsChangeInstruction, preventFormResetOnDisabled, disabled, hideSubmitButton, validateOnSubmit, isSubmitting, submitButtonText, id, dataTypes, productModel, timezone, coverageTerms: coverageTermsDataModel, titles, getEvaluatedConstraints, dependencyMap, styles, }: Props_8): JSX_2.Element;
155
162
  displayName: string;
156
163
  };
157
164
 
@@ -159,7 +166,7 @@ export declare const InitializedTransactionForm: {
159
166
  * DisbursementForm is a form for creating a disbursement.
160
167
  */
161
168
  export declare const NewDisbursementForm: {
162
- ({ accountLocator, accountBalance, currency, validateOnSubmit, hideSubmitButton, submitButtonText, handleSubmit, isSubmitting, disabled, dataModel, id, titles, }: Props_10): JSX_2.Element;
169
+ ({ accountLocator, accountBalance, currency, validateOnSubmit, hideSubmitButton, submitButtonText, handleSubmit, isSubmitting, disabled, dataModel, id, titles, styles, }: Props_10): JSX_2.Element;
163
170
  displayName: string;
164
171
  };
165
172
 
@@ -167,7 +174,7 @@ export declare const NewDisbursementForm: {
167
174
  * PaymentForm is a form for making a payment.
168
175
  */
169
176
  export declare const NewPaymentForm: {
170
- ({ accountLocator, invoiceLocator, currency, validateOnSubmit, hideSubmitButton, submitButtonText, handleSubmit, isSubmitting, disabled, dataModel, id, titles, invoiceBalance, }: Props_5): JSX_2.Element;
177
+ ({ accountLocator, invoiceLocator, currency, validateOnSubmit, hideSubmitButton, submitButtonText, handleSubmit, isSubmitting, disabled, dataModel, id, titles, invoiceBalance, styles, }: Props_5): JSX_2.Element;
171
178
  displayName: string;
172
179
  };
173
180
 
@@ -175,7 +182,7 @@ export declare const NewPaymentForm: {
175
182
  * PolicyForm is a form for updating a policy. It required a product data model, custom data types, and policy object to render the form.
176
183
  */
177
184
  export declare const PolicyForm: {
178
- ({ policy, segment, dataModel, hideAllFields, id, titles, }: Props_4): JSX_2.Element;
185
+ ({ policy, segment, dataModel, hideAllFields, id, titles, styles, }: Props_4): JSX_2.Element;
179
186
  displayName: string;
180
187
  };
181
188
 
@@ -238,6 +245,11 @@ declare type Props_10 = {
238
245
  * ID for the form wrapper
239
246
  * */
240
247
  id?: string;
248
+ /**
249
+ * Custom form styling
250
+ * See https://github.com/eclipsesource/jsonforms/blob/master/packages/vanilla-renderers/Styles.md
251
+ */
252
+ styles?: StyleDefinition[];
241
253
  /**
242
254
  * Titles
243
255
  */
@@ -257,10 +269,6 @@ declare type Props_2 = {
257
269
  * The resolved data model retrieved from data model response
258
270
  */
259
271
  dataModel: DataModel;
260
- /**
261
- * The custom data types for the configuration that may be referenced by the elementModel
262
- */
263
- dataTypes?: DataTypeConfigRecord;
264
272
  /**
265
273
  * The function to call when the form is submitted. It will create an QuoteRequest from the form data.
266
274
  */
@@ -355,6 +363,11 @@ declare type Props_2 = {
355
363
  * The hidden exception for the form
356
364
  */
357
365
  hiddenExceptions?: string[];
366
+ /**
367
+ * Custom form styling
368
+ * See https://github.com/eclipsesource/jsonforms/blob/master/packages/vanilla-renderers/Styles.md
369
+ */
370
+ styles?: StyleDefinition[];
358
371
  /**
359
372
  * Titles for the form
360
373
  */
@@ -476,6 +489,11 @@ declare type Props_3 = {
476
489
  * }
477
490
  */
478
491
  getEvaluatedConstraints?: (request: EvaluateConstraintsRequest, tenantLocator: string, locator: string) => Promise<ConstraintEvaluationResponse | undefined>;
492
+ /**
493
+ * Custom form styling
494
+ * See https://github.com/eclipsesource/jsonforms/blob/master/packages/vanilla-renderers/Styles.md
495
+ */
496
+ styles?: StyleDefinition[];
479
497
  /**
480
498
  * Titles for the form
481
499
  */
@@ -512,6 +530,11 @@ declare type Props_4 = {
512
530
  * ID for the form wrapper
513
531
  * */
514
532
  id?: string;
533
+ /**
534
+ * Custom form styling
535
+ * See https://github.com/eclipsesource/jsonforms/blob/master/packages/vanilla-renderers/Styles.md
536
+ */
537
+ styles?: StyleDefinition[];
515
538
  /**
516
539
  * Whether to hide all fields
517
540
  */
@@ -583,6 +606,11 @@ declare type Props_5 = {
583
606
  * ID for the form wrapper
584
607
  * */
585
608
  id?: string;
609
+ /**
610
+ * Custom form styling
611
+ * See https://github.com/eclipsesource/jsonforms/blob/master/packages/vanilla-renderers/Styles.md
612
+ */
613
+ styles?: StyleDefinition[];
586
614
  /**
587
615
  * Titles
588
616
  */
@@ -642,6 +670,11 @@ declare type Props_6 = {
642
670
  * ID for the form wrapper
643
671
  * */
644
672
  id?: string;
673
+ /**
674
+ * Custom form styling
675
+ * See https://github.com/eclipsesource/jsonforms/blob/master/packages/vanilla-renderers/Styles.md
676
+ */
677
+ styles?: StyleDefinition[];
645
678
  /**
646
679
  * Titles
647
680
  */
@@ -698,6 +731,11 @@ declare type Props_7 = {
698
731
  * ID for the form wrapper
699
732
  * */
700
733
  id?: string;
734
+ /**
735
+ * Custom form styling
736
+ * See https://github.com/eclipsesource/jsonforms/blob/master/packages/vanilla-renderers/Styles.md
737
+ */
738
+ styles?: StyleDefinition[];
701
739
  /**
702
740
  * Titles
703
741
  */
@@ -808,6 +846,11 @@ declare type Props_8 = {
808
846
  * }
809
847
  */
810
848
  getEvaluatedConstraints?: (request: EvaluateConstraintsRequest, tenantLocator: string, locator: string) => Promise<ConstraintEvaluationResponse | undefined>;
849
+ /**
850
+ * Custom form styling
851
+ * See https://github.com/eclipsesource/jsonforms/blob/master/packages/vanilla-renderers/Styles.md
852
+ */
853
+ styles?: StyleDefinition[];
811
854
  /**
812
855
  * Form titles
813
856
  */
@@ -880,6 +923,11 @@ declare type Props_9 = {
880
923
  * ID for the form wrapper
881
924
  * */
882
925
  id?: string;
926
+ /**
927
+ * Custom form styling
928
+ * See https://github.com/eclipsesource/jsonforms/blob/master/packages/vanilla-renderers/Styles.md
929
+ */
930
+ styles?: StyleDefinition[];
883
931
  /**
884
932
  * The form titles
885
933
  */
@@ -894,17 +942,24 @@ declare type Props_9 = {
894
942
  /**
895
943
  * QuoteForm is a form for updating a quote. It required a product data model, custom data types, and quote object to render the form.
896
944
  */
897
- export declare const QuoteForm: {
898
- ({ quote, dataModel, dataTypes, disabled, handleSubmit, isSubmitting, preventFormResetOnDisabled, validateOnSubmit, hideSubmitButton, hideDefaultFields, hideAdvancedFields, hideCoverageTerms, submitButtonText, id, titles, getEvaluatedConstraints, dependencyMap, hideAllFields, hiddenExceptions, }: Props_2): JSX_2.Element;
899
- displayName: string;
945
+ export declare const QuoteForm: ForwardRefExoticComponent<Props_2 & RefAttributes<QuoteFormRef>>;
946
+
947
+ export declare type QuoteFormRef = {
948
+ getValues: () => unknown;
949
+ subscribeOnChange: (field: string, callback: (value: unknown) => void) => () => void;
900
950
  };
901
951
 
902
952
  /**
903
953
  * Apply a payment to an existing invoice form
904
954
  */
905
955
  export declare const ReversePaymentForm: {
906
- ({ amount, reversalTypes, currency, validateOnSubmit, hideSubmitButton, submitButtonText, handleSubmit, isSubmitting, disabled, id, titles, }: Props_7): JSX_2.Element;
956
+ ({ amount, reversalTypes, currency, validateOnSubmit, hideSubmitButton, submitButtonText, handleSubmit, isSubmitting, disabled, id, titles, styles, }: Props_7): JSX_2.Element;
907
957
  displayName: string;
908
958
  };
909
959
 
960
+ export declare type StyleDefinition = {
961
+ name: 'array.layout' | 'array.button' | 'array.children' | 'categorization' | 'categorization.master' | 'categorization.detail' | 'category.subcategories' | 'category.group' | 'array.table' | 'array.table.table' | 'array.table.label' | 'array.table.button' | 'array.table.validation' | 'array.table.validation.error' | 'array.validation.error' | 'group.layout' | 'group.label' | 'group.layout.item' | 'horizontal.layout' | 'horizontal.layout.item' | 'vertical.layout' | 'vertical.layout.item' | 'control' | 'control.input' | 'control.checkbox' | 'control.label' | 'control.validation' | 'control.validation.error' | 'input.description';
962
+ classNames: string[];
963
+ };
964
+
910
965
  export { }