@socotra/ec-react-components 2.5.1-next.9 → 2.6.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/index.d.ts CHANGED
@@ -23,7 +23,15 @@ import { TransactionSnapshotResponse } from '@socotra/ec-react-schemas';
23
23
  * 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.
24
24
  */
25
25
  export declare const AccountForm: {
26
- ({ accountsModel, accountType, dataTypes, advancedOptions, disabled, handleSubmit, isSubmitting, preventFormResetOnDisabled, hideSubmitButton, validateOnSubmit, account, defaultValues, submitButtonText, id, }: Props): JSX_2.Element;
26
+ ({ accountsModel, accountType, dataTypes, advancedOptions, disabled, handleSubmit, isSubmitting, preventFormResetOnDisabled, hideSubmitButton, validateOnSubmit, account, defaultValues, submitButtonText, id, titles, }: Props): JSX_2.Element;
27
+ displayName: string;
28
+ };
29
+
30
+ /**
31
+ * `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.
32
+ */
33
+ export declare const DraftTransactionForm: {
34
+ ({ transactionSnapshot, handleSubmit, paramsChangeInstruction, modifyChangeInstruction, preventFormResetOnDisabled, disabled, hideSubmitButton, validateOnSubmit, isSubmitting, submitButtonText, id, dataTypes, productModel, coverageTerms, titles, }: Props_6): JSX_2.Element;
27
35
  displayName: string;
28
36
  };
29
37
 
@@ -31,7 +39,15 @@ export declare const AccountForm: {
31
39
  * 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.
32
40
  */
33
41
  export declare const ElementForm: {
34
- ({ elementModel, dataTypes, disabled, handleSubmit, coverageTerms, isSubmitting, preventFormResetOnDisabled, hideSubmitButton, element, validateOnSubmit, submitButtonText, id, }: Props_3): JSX_2.Element;
42
+ ({ elementModel, dataTypes, disabled, handleSubmit, coverageTerms, isSubmitting, preventFormResetOnDisabled, hideSubmitButton, element, validateOnSubmit, submitButtonText, id, titles, }: Props_3): JSX_2.Element;
43
+ displayName: string;
44
+ };
45
+
46
+ /**
47
+ * `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.
48
+ */
49
+ export declare const InitializedTransactionForm: {
50
+ ({ elementResponse, handleSubmit, paramsChangeInstruction, preventFormResetOnDisabled, disabled, hideSubmitButton, validateOnSubmit, isSubmitting, submitButtonText, id, dataTypes, productModel, coverageTerms, titles, }: Props_5): JSX_2.Element;
35
51
  displayName: string;
36
52
  };
37
53
 
@@ -39,7 +55,7 @@ export declare const ElementForm: {
39
55
  * QuoteForm is a form for updating a quote. It required a product data model, custom data types, and quote object to render the form.
40
56
  */
41
57
  export declare const PolicyForm: {
42
- ({ policy, segment, dataModel, id, title, }: Props_4): JSX_2.Element;
58
+ ({ policy, segment, dataModel, id, titles, }: Props_4): JSX_2.Element;
43
59
  displayName: string;
44
60
  };
45
61
 
@@ -121,6 +137,9 @@ declare type Props = {
121
137
  * ID for the form wrapper
122
138
  * */
123
139
  id?: string;
140
+ titles?: {
141
+ seeAdvancedDetails?: string;
142
+ };
124
143
  };
125
144
 
126
145
  declare type Props_2 = {
@@ -169,6 +188,21 @@ declare type Props_2 = {
169
188
  * ID for the form wrapper
170
189
  * */
171
190
  id?: string;
191
+ /**
192
+ * Titles for the form
193
+ */
194
+ titles?: {
195
+ details?: string;
196
+ seeAdvancedDetails?: string;
197
+ coverageTerms?: string;
198
+ currency?: string;
199
+ timezone?: string;
200
+ billingLevel?: string;
201
+ billingTrigger?: string;
202
+ durationBasis?: string;
203
+ delinquencyPlanName?: string;
204
+ autoRenewalPlanName?: string;
205
+ };
172
206
  };
173
207
 
174
208
  declare type Props_3 = {
@@ -222,6 +256,12 @@ declare type Props_3 = {
222
256
  * ID for the form wrapper
223
257
  * */
224
258
  id?: string;
259
+ /**
260
+ * Titles for the form
261
+ */
262
+ titles?: {
263
+ coverageTerms?: string;
264
+ };
225
265
  };
226
266
 
227
267
  declare type Props_4 = {
@@ -242,12 +282,82 @@ declare type Props_4 = {
242
282
  * */
243
283
  id?: string;
244
284
  /**
245
- * Form title
285
+ * Titles
246
286
  */
247
- title?: string;
287
+ titles?: {
288
+ formTitle?: string;
289
+ seeAdvancedDetails?: string;
290
+ };
248
291
  };
249
292
 
250
293
  declare type Props_5 = {
294
+ /**
295
+ * The transaction snapshot object
296
+ */
297
+ elementResponse: ElementResponse;
298
+ /**
299
+ * The params change instruction for the transaction, usually created when the transaction is first created
300
+ */
301
+ paramsChangeInstruction: ParamsChangeInstructionResponse;
302
+ /**
303
+ * The product model for the transaction, taken from the tenant data model and product name
304
+ */
305
+ productModel: ProductConfig;
306
+ /**
307
+ * The coverage terms for the transaction, taken from the tenant data model
308
+ */
309
+ coverageTerms: CoverageTermsConfigRecord;
310
+ /**
311
+ * The custom data types for the configuration that may be referenced by the elementModel
312
+ */
313
+ dataTypes: DataTypeConfigRecord;
314
+ /**
315
+ * The function to call when the form is submitted. It will create an `ElementRequest` from the form data.
316
+ */
317
+ handleSubmit: (data: ElementRequest) => void;
318
+ /**
319
+ * The modify change instruction for the transaction, taken from the transaction stack of the transaction. For the form, use the last in the stack.
320
+ */
321
+ element?: ElementResponse;
322
+ /**
323
+ * Disables the form
324
+ */
325
+ disabled?: boolean;
326
+ /**
327
+ * Set to true when the form is submitting to set fields to readonly and disable the submit button
328
+ */
329
+ isSubmitting?: boolean;
330
+ /**
331
+ * Prevents the form from resetting when disabled
332
+ * default is true
333
+ */
334
+ preventFormResetOnDisabled?: boolean;
335
+ /**
336
+ * Whether to validate the form on submit
337
+ */
338
+ validateOnSubmit?: boolean;
339
+ /**
340
+ * Hides the submit button
341
+ */
342
+ hideSubmitButton?: boolean;
343
+ /**
344
+ * The text to display on the submit button
345
+ */
346
+ submitButtonText?: string;
347
+ /**
348
+ * ID for the form wrapper
349
+ * */
350
+ id?: string;
351
+ /**
352
+ * Form titles
353
+ */
354
+ titles?: {
355
+ formTitle?: string;
356
+ coverageTerms?: string;
357
+ };
358
+ };
359
+
360
+ declare type Props_6 = {
251
361
  /**
252
362
  * The transaction snapshot object
253
363
  */
@@ -269,7 +379,7 @@ declare type Props_5 = {
269
379
  */
270
380
  dataTypes: DataTypeConfigRecord;
271
381
  /**
272
- * The function to call when the form is submitted. It will create an array of ParamsChangeInstructionCreateRequest and ModifyChangeInstructionCreateRequest from the form data.
382
+ * The function to call when the form is submitted. It will create an array of `ParamsChangeInstructionCreateRequest` and `ModifyChangeInstructionCreateRequest` from the form data.
273
383
  */
274
384
  handleSubmit: (data: [
275
385
  ParamsChangeInstructionCreateRequest,
@@ -279,10 +389,6 @@ declare type Props_5 = {
279
389
  * The modify change instruction for the transaction, taken from the transaction stack of the transaction. For the form, use the last in the stack.
280
390
  */
281
391
  modifyChangeInstruction?: ModifyChangeInstructionResponse;
282
- /**
283
- * The title of the form, if unused the title will default to 'Transaction' or the product model display name
284
- */
285
- title?: string;
286
392
  /**
287
393
  * Disables the form
288
394
  */
@@ -312,21 +418,20 @@ declare type Props_5 = {
312
418
  * ID for the form wrapper
313
419
  * */
314
420
  id?: string;
421
+ /**
422
+ * The form titles
423
+ */
424
+ titles?: {
425
+ coverageTerms?: string;
426
+ formTitle?: string;
427
+ };
315
428
  };
316
429
 
317
430
  /**
318
431
  * QuoteForm is a form for updating a quote. It required a product data model, custom data types, and quote object to render the form.
319
432
  */
320
433
  export declare const QuoteForm: {
321
- ({ quote, dataModel, dataTypes, disabled, handleSubmit, isSubmitting, preventFormResetOnDisabled, validateOnSubmit, hideSubmitButton, submitButtonText, id, }: Props_2): JSX_2.Element;
322
- displayName: string;
323
- };
324
-
325
- /**
326
- * TransactionForm is a form for updating a transaction on an issued policy. It requires a transactionSnapshot, paramsChangeInstruction (created when the transaction is created), and some other configuration settings from the tenant data model.
327
- */
328
- export declare const TransactionForm: {
329
- ({ transactionSnapshot, title, handleSubmit, paramsChangeInstruction, modifyChangeInstruction, preventFormResetOnDisabled, disabled, hideSubmitButton, validateOnSubmit, isSubmitting, submitButtonText, id, dataTypes, productModel, coverageTerms, }: Props_5): JSX_2.Element;
434
+ ({ quote, dataModel, dataTypes, disabled, handleSubmit, isSubmitting, preventFormResetOnDisabled, validateOnSubmit, hideSubmitButton, submitButtonText, id, titles, }: Props_2): JSX_2.Element;
330
435
  displayName: string;
331
436
  };
332
437