@socotra/ec-react-utils 2.8.1-next.2 → 2.8.1-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 CHANGED
@@ -2,6 +2,7 @@ import { AccountConfigRecord } from '@socotra/ec-react-schemas';
2
2
  import { AccountResponse } from '@socotra/ec-react-schemas';
3
3
  import { ConstraintEvaluationResponse } from '@socotra/ec-react-schemas';
4
4
  import { CoverageTermsConfigRecord } from '@socotra/ec-react-schemas';
5
+ import { DataFieldValue } from '@socotra/ec-react-schemas';
5
6
  import { DataModel } from '@socotra/ec-react-schemas';
6
7
  import { DataTypeConfigRecord } from '@socotra/ec-react-schemas';
7
8
  import { ElementConfig } from '@socotra/ec-react-schemas';
@@ -11,6 +12,7 @@ import { FieldConfigRecord } from '@socotra/ec-react-schemas';
11
12
  import { JsonSchema7 } from '@jsonforms/core';
12
13
  import { ModifyChangeInstructionCreateRequest } from '@socotra/ec-react-schemas';
13
14
  import { ParamsChangeInstructionCreateRequest } from '@socotra/ec-react-schemas';
15
+ import { PrimitiveValue } from '@socotra/ec-react-schemas';
14
16
  import { ProductConfig } from '@socotra/ec-react-schemas';
15
17
  import { Quantifiers } from '@socotra/ec-react-schemas';
16
18
  import { QuoteDependencyMapResponse } from '@socotra/ec-react-schemas';
@@ -23,6 +25,14 @@ declare type AnyObject = {
23
25
  [key: string]: any;
24
26
  };
25
27
 
28
+ export declare const compareData: (originalData: Record<string, PrimitiveValue>, updatedData: Record<string, PrimitiveValue>, path?: string[]) => DataChange[];
29
+
30
+ declare type DataChange = {
31
+ originalValue: DataFieldValue;
32
+ newValue: DataFieldValue;
33
+ path: string[];
34
+ };
35
+
26
36
  /**
27
37
  * The function `dataModelToJSONSchema` converts a data model to a JSON schema based on specified
28
38
  * criteria and data types.
@@ -365,6 +375,8 @@ export declare const getQuoteRequest: ({ data }: QuoteFormData) => QuoteRequest;
365
375
  */
366
376
  export declare function getRemoveDataFieldValues(originalObj: AnyObject, modifiedObj: AnyObject): AnyObject;
367
377
 
378
+ export declare const getUpdatedDataFromConstraints: (newData: Record<string, PrimitiveValue>, originalData: Record<string, PrimitiveValue>, dependencyMap: QuoteDependencyMapResponse, elementLocator: string) => Record<string, PrimitiveValue>;
379
+
368
380
  declare type ProductElement = Record<string, ElementConfig & {
369
381
  quantifier: Quantifiers;
370
382
  }>;