@socotra/ec-react-components 2.5.1-next.0 → 2.5.1-next.10
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 +161 -3
- package/dist/index.es.js +28949 -25449
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +54 -54
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -8,10 +8,16 @@ import { ElementConfig } from '@socotra/ec-react-schemas';
|
|
|
8
8
|
import { ElementRequest } from '@socotra/ec-react-schemas';
|
|
9
9
|
import { ElementResponse } from '@socotra/ec-react-schemas';
|
|
10
10
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
11
|
+
import { ModifyChangeInstructionCreateRequest } from '@socotra/ec-react-schemas';
|
|
12
|
+
import { ModifyChangeInstructionResponse } from '@socotra/ec-react-schemas';
|
|
13
|
+
import { ParamsChangeInstructionCreateRequest } from '@socotra/ec-react-schemas';
|
|
14
|
+
import { ParamsChangeInstructionResponse } from '@socotra/ec-react-schemas';
|
|
11
15
|
import { PolicyResponse } from '@socotra/ec-react-schemas';
|
|
16
|
+
import { ProductConfig } from '@socotra/ec-react-schemas';
|
|
12
17
|
import { QuoteRequest } from '@socotra/ec-react-schemas';
|
|
13
18
|
import { QuoteResponse } from '@socotra/ec-react-schemas';
|
|
14
19
|
import { SegmentResponse } from '@socotra/ec-react-schemas';
|
|
20
|
+
import { TransactionSnapshotResponse } from '@socotra/ec-react-schemas';
|
|
15
21
|
|
|
16
22
|
/**
|
|
17
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.
|
|
@@ -21,6 +27,14 @@ export declare const AccountForm: {
|
|
|
21
27
|
displayName: string;
|
|
22
28
|
};
|
|
23
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, title, handleSubmit, coverageTermTitle, paramsChangeInstruction, modifyChangeInstruction, preventFormResetOnDisabled, disabled, hideSubmitButton, validateOnSubmit, isSubmitting, submitButtonText, id, dataTypes, productModel, coverageTerms, }: Props_6): JSX_2.Element;
|
|
35
|
+
displayName: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
24
38
|
/**
|
|
25
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.
|
|
26
40
|
*/
|
|
@@ -29,6 +43,14 @@ export declare const ElementForm: {
|
|
|
29
43
|
displayName: string;
|
|
30
44
|
};
|
|
31
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
|
+
({ segmentResponse, title, handleSubmit, paramsChangeInstruction, coverageTermTitle, preventFormResetOnDisabled, disabled, hideSubmitButton, validateOnSubmit, isSubmitting, submitButtonText, id, dataTypes, productModel, coverageTerms, }: Props_5): JSX_2.Element;
|
|
51
|
+
displayName: string;
|
|
52
|
+
};
|
|
53
|
+
|
|
32
54
|
/**
|
|
33
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.
|
|
34
56
|
*/
|
|
@@ -151,9 +173,6 @@ declare type Props_2 = {
|
|
|
151
173
|
* Hides the submit button
|
|
152
174
|
*/
|
|
153
175
|
hideSubmitButton?: boolean;
|
|
154
|
-
/**
|
|
155
|
-
* The text to display on the submit button
|
|
156
|
-
*/
|
|
157
176
|
/**
|
|
158
177
|
* Whether to validate the form on submit
|
|
159
178
|
*/
|
|
@@ -244,6 +263,145 @@ declare type Props_4 = {
|
|
|
244
263
|
title?: string;
|
|
245
264
|
};
|
|
246
265
|
|
|
266
|
+
declare type Props_5 = {
|
|
267
|
+
/**
|
|
268
|
+
* The transaction snapshot object
|
|
269
|
+
*/
|
|
270
|
+
segmentResponse: SegmentResponse;
|
|
271
|
+
/**
|
|
272
|
+
* The params change instruction for the transaction, usually created when the transaction is first created
|
|
273
|
+
*/
|
|
274
|
+
paramsChangeInstruction: ParamsChangeInstructionResponse;
|
|
275
|
+
/**
|
|
276
|
+
* The product model for the transaction, taken from the tenant data model and product name
|
|
277
|
+
*/
|
|
278
|
+
productModel: ProductConfig;
|
|
279
|
+
/**
|
|
280
|
+
* The coverage terms for the transaction, taken from the tenant data model
|
|
281
|
+
*/
|
|
282
|
+
coverageTerms: CoverageTermsConfigRecord;
|
|
283
|
+
/**
|
|
284
|
+
* The custom data types for the configuration that may be referenced by the elementModel
|
|
285
|
+
*/
|
|
286
|
+
dataTypes: DataTypeConfigRecord;
|
|
287
|
+
/**
|
|
288
|
+
* The function to call when the form is submitted. It will create an `ElementRequest` from the form data.
|
|
289
|
+
*/
|
|
290
|
+
handleSubmit: (data: ElementRequest) => void;
|
|
291
|
+
/**
|
|
292
|
+
* The modify change instruction for the transaction, taken from the transaction stack of the transaction. For the form, use the last in the stack.
|
|
293
|
+
*/
|
|
294
|
+
element?: ElementResponse;
|
|
295
|
+
/**
|
|
296
|
+
* The title of the form, if unused the title will default to 'Transaction' or the product model display name
|
|
297
|
+
*/
|
|
298
|
+
title?: string;
|
|
299
|
+
/**
|
|
300
|
+
* The title of the coverage term section
|
|
301
|
+
*/
|
|
302
|
+
coverageTermTitle?: string;
|
|
303
|
+
/**
|
|
304
|
+
* Disables the form
|
|
305
|
+
*/
|
|
306
|
+
disabled?: boolean;
|
|
307
|
+
/**
|
|
308
|
+
* Set to true when the form is submitting to set fields to readonly and disable the submit button
|
|
309
|
+
*/
|
|
310
|
+
isSubmitting?: boolean;
|
|
311
|
+
/**
|
|
312
|
+
* Prevents the form from resetting when disabled
|
|
313
|
+
* default is true
|
|
314
|
+
*/
|
|
315
|
+
preventFormResetOnDisabled?: boolean;
|
|
316
|
+
/**
|
|
317
|
+
* Whether to validate the form on submit
|
|
318
|
+
*/
|
|
319
|
+
validateOnSubmit?: boolean;
|
|
320
|
+
/**
|
|
321
|
+
* Hides the submit button
|
|
322
|
+
*/
|
|
323
|
+
hideSubmitButton?: boolean;
|
|
324
|
+
/**
|
|
325
|
+
* The text to display on the submit button
|
|
326
|
+
*/
|
|
327
|
+
submitButtonText?: string;
|
|
328
|
+
/**
|
|
329
|
+
* ID for the form wrapper
|
|
330
|
+
* */
|
|
331
|
+
id?: string;
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
declare type Props_6 = {
|
|
335
|
+
/**
|
|
336
|
+
* The transaction snapshot object
|
|
337
|
+
*/
|
|
338
|
+
transactionSnapshot: TransactionSnapshotResponse;
|
|
339
|
+
/**
|
|
340
|
+
* The params change instruction for the transaction, usually created when the transaction is first created
|
|
341
|
+
*/
|
|
342
|
+
paramsChangeInstruction: ParamsChangeInstructionResponse;
|
|
343
|
+
/**
|
|
344
|
+
* The product model for the transaction, taken from the tenant data model and product name
|
|
345
|
+
*/
|
|
346
|
+
productModel: ProductConfig;
|
|
347
|
+
/**
|
|
348
|
+
* The coverage terms for the transaction, taken from the tenant data model
|
|
349
|
+
*/
|
|
350
|
+
coverageTerms: CoverageTermsConfigRecord;
|
|
351
|
+
/**
|
|
352
|
+
* The custom data types for the configuration that may be referenced by the elementModel
|
|
353
|
+
*/
|
|
354
|
+
dataTypes: DataTypeConfigRecord;
|
|
355
|
+
/**
|
|
356
|
+
* The function to call when the form is submitted. It will create an array of `ParamsChangeInstructionCreateRequest` and `ModifyChangeInstructionCreateRequest` from the form data.
|
|
357
|
+
*/
|
|
358
|
+
handleSubmit: (data: [
|
|
359
|
+
ParamsChangeInstructionCreateRequest,
|
|
360
|
+
ModifyChangeInstructionCreateRequest
|
|
361
|
+
]) => void;
|
|
362
|
+
/**
|
|
363
|
+
* The modify change instruction for the transaction, taken from the transaction stack of the transaction. For the form, use the last in the stack.
|
|
364
|
+
*/
|
|
365
|
+
modifyChangeInstruction?: ModifyChangeInstructionResponse;
|
|
366
|
+
/**
|
|
367
|
+
* The title of the coverage terms section
|
|
368
|
+
*/
|
|
369
|
+
coverageTermTitle?: string;
|
|
370
|
+
/**
|
|
371
|
+
* The title of the form, if unused the title will default to 'Transaction' or the product model display name
|
|
372
|
+
*/
|
|
373
|
+
title?: string;
|
|
374
|
+
/**
|
|
375
|
+
* Disables the form
|
|
376
|
+
*/
|
|
377
|
+
disabled?: boolean;
|
|
378
|
+
/**
|
|
379
|
+
* Set to true when the form is submitting to set fields to readonly and disable the submit button
|
|
380
|
+
*/
|
|
381
|
+
isSubmitting?: boolean;
|
|
382
|
+
/**
|
|
383
|
+
* Prevents the form from resetting when disabled
|
|
384
|
+
* default is true
|
|
385
|
+
*/
|
|
386
|
+
preventFormResetOnDisabled?: boolean;
|
|
387
|
+
/**
|
|
388
|
+
* Whether to validate the form on submit
|
|
389
|
+
*/
|
|
390
|
+
validateOnSubmit?: boolean;
|
|
391
|
+
/**
|
|
392
|
+
* Hides the submit button
|
|
393
|
+
*/
|
|
394
|
+
hideSubmitButton?: boolean;
|
|
395
|
+
/**
|
|
396
|
+
* The text to display on the submit button
|
|
397
|
+
*/
|
|
398
|
+
submitButtonText?: string;
|
|
399
|
+
/**
|
|
400
|
+
* ID for the form wrapper
|
|
401
|
+
* */
|
|
402
|
+
id?: string;
|
|
403
|
+
};
|
|
404
|
+
|
|
247
405
|
/**
|
|
248
406
|
* QuoteForm is a form for updating a quote. It required a product data model, custom data types, and quote object to render the form.
|
|
249
407
|
*/
|