@icure/form 2.1.2 → 2.1.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.
Files changed (61) hide show
  1. package/.yarn/cache/{libphonenumber-js-npm-1.12.34-cd35ce8e26-e4bb10ba42.zip → libphonenumber-js-npm-1.12.38-a5180a8a02-2a2eeb122d.zip} +0 -0
  2. package/.yarn/cache/{lodash-npm-4.17.21-6382451519-eb835a2e51.zip → lodash-npm-4.17.23-50bdb1c01a-7daad39758.zip} +0 -0
  3. package/.yarn/cache/{markdown-it-npm-14.1.0-e337d75bfe-07296b45eb.zip → markdown-it-npm-14.1.1-45c173274d-d6d55865c6.zip} +0 -0
  4. package/.yarn/cache/prosemirror-markdown-npm-1.13.4-1a47b172bd-3306b4eca0.zip +0 -0
  5. package/.yarn/cache/prosemirror-transform-npm-1.11.0-fa260ad6f3-71989931b8.zip +0 -0
  6. package/.yarn/cache/{prosemirror-view-npm-1.41.5-39b37df338-ee47e9091a.zip → prosemirror-view-npm-1.41.6-a9d2feed27-68f6a8bd66.zip} +0 -0
  7. package/.yarn/install-state.gz +0 -0
  8. package/components/common/field.d.ts +14 -2
  9. package/components/common/field.js +95 -2
  10. package/components/common/field.js.map +1 -1
  11. package/components/common/utils.js +11 -1
  12. package/components/common/utils.js.map +1 -1
  13. package/components/icure-button-group/index.js +1 -1
  14. package/components/icure-button-group/index.js.map +1 -1
  15. package/components/icure-form/fields/button-group/checkbox.js +3 -4
  16. package/components/icure-form/fields/button-group/checkbox.js.map +1 -1
  17. package/components/icure-form/fields/button-group/radio-button.js +3 -4
  18. package/components/icure-form/fields/button-group/radio-button.js.map +1 -1
  19. package/components/icure-form/fields/date-picker/date-picker.js +3 -4
  20. package/components/icure-form/fields/date-picker/date-picker.js.map +1 -1
  21. package/components/icure-form/fields/date-picker/date-time-picker.js +3 -4
  22. package/components/icure-form/fields/date-picker/date-time-picker.js.map +1 -1
  23. package/components/icure-form/fields/date-picker/time-picker.js +3 -4
  24. package/components/icure-form/fields/date-picker/time-picker.js.map +1 -1
  25. package/components/icure-form/fields/dropdown/dropdown-field.js +3 -4
  26. package/components/icure-form/fields/dropdown/dropdown-field.js.map +1 -1
  27. package/components/icure-form/fields/measure-field/measure-field.js +3 -4
  28. package/components/icure-form/fields/measure-field/measure-field.js.map +1 -1
  29. package/components/icure-form/fields/number-field/number-field.js +3 -4
  30. package/components/icure-form/fields/number-field/number-field.js.map +1 -1
  31. package/components/icure-form/fields/text-field/text-field.js +3 -4
  32. package/components/icure-form/fields/text-field/text-field.js.map +1 -1
  33. package/components/icure-form/fields/utils/index.d.ts +0 -5
  34. package/components/icure-form/fields/utils/index.js +1 -12
  35. package/components/icure-form/fields/utils/index.js.map +1 -1
  36. package/components/icure-form/index.js +14 -10
  37. package/components/icure-form/index.js.map +1 -1
  38. package/components/icure-form/renderer/form/form.js +10 -8
  39. package/components/icure-form/renderer/form/form.js.map +1 -1
  40. package/components/icure-text-field/index.js +0 -2
  41. package/components/icure-text-field/index.js.map +1 -1
  42. package/components/icure-text-field/schema/measure-schema.js +0 -1
  43. package/components/icure-text-field/schema/measure-schema.js.map +1 -1
  44. package/components/model/index.d.ts +17 -17
  45. package/components/model/index.js +34 -30
  46. package/components/model/index.js.map +1 -1
  47. package/generic/model.d.ts +11 -6
  48. package/generic/model.js.map +1 -1
  49. package/icure/form-values-container.d.ts +33 -21
  50. package/icure/form-values-container.js +325 -154
  51. package/icure/form-values-container.js.map +1 -1
  52. package/icure/icure-utils.js +48 -18
  53. package/icure/icure-utils.js.map +1 -1
  54. package/package.json +1 -1
  55. package/utils/code-utils.js +2 -2
  56. package/utils/code-utils.js.map +1 -1
  57. package/utils/fields-values-provider.d.ts +1 -1
  58. package/utils/fields-values-provider.js +6 -4
  59. package/utils/fields-values-provider.js.map +1 -1
  60. package/.yarn/cache/prosemirror-markdown-npm-1.13.2-6e2f179fd8-ce9fcb3b13.zip +0 -0
  61. package/.yarn/cache/prosemirror-transform-npm-1.10.5-5b3b4f5f61-6f5921e53a.zip +0 -0
@@ -1,6 +1,7 @@
1
1
  import { FieldMetadata, FieldValue } from '../components/model';
2
2
  /**
3
3
  * VersionedData is a structure that contains the values of a form, organized by id and version.
4
+ * Versions are ordered most recent first.
4
5
  */
5
6
  export interface VersionedData<T> {
6
7
  [id: string]: Version<T>[];
@@ -50,21 +51,21 @@ export type ID = string;
50
51
  export interface FormValuesContainer<Value, Metadata> {
51
52
  compute<T, S extends {
52
53
  [key: string | symbol]: unknown;
53
- }>(formula: string, sandbox?: S): Promise<T | undefined>;
54
+ }>(formula: string, sandbox?: S): Promise<ComputationResult<T>>;
54
55
  getLabel(): string;
55
56
  getFormId(): string | undefined;
56
- getDefaultValue(label: string): Promise<FieldValue | undefined>;
57
+ getDefaultValueProvider(label: string): (() => Promise<FieldValue | undefined>) | undefined;
57
58
  getValues(revisionsFilter: (id: string, history: Version<Metadata>[]) => (string | null)[]): VersionedData<Value>;
58
59
  getMetadata(id: string, revisions: (string | null)[]): VersionedData<Metadata>;
59
60
  getChildren(): Promise<FormValuesContainer<Value, Metadata>[]>;
60
- getValidationErrors(): Promise<[FieldMetadata, string][]>;
61
- setValue(label: string, language: string, data?: Value, id?: string, metadata?: Metadata, changeListenersOverrider?: (fvc: FormValuesContainer<Value, Metadata>) => void): void;
61
+ getValidationErrors(): Promise<[FieldMetadata, string] | null>[];
62
+ setValue(label: string, language: string, data?: Value, id?: string, metadata?: Metadata, changeListenersOverrider?: (fvc: FormValuesContainer<Value, Metadata>, changedKeys: string[] | null) => void): void;
62
63
  setMetadata(metadata: Metadata, id?: string): void;
63
64
  delete(serviceId: string): void;
64
65
  addChild(anchorId: string, templateId: string, label: string): Promise<void>;
65
66
  removeChild(container: FormValuesContainer<Value, Metadata>): Promise<void>;
66
- registerChangeListener(listener: (newValue: FormValuesContainer<Value, Metadata>) => void): void;
67
- unregisterChangeListener(listener: (newValue: FormValuesContainer<Value, Metadata>) => void): void;
67
+ registerChangeListener(listener: (newValue: FormValuesContainer<Value, Metadata>, changedKeys: string[] | null, force: boolean) => void): void;
68
+ unregisterChangeListener(listener: (newValue: FormValuesContainer<Value, Metadata>, changedKeys: string[] | null, force: boolean) => void): void;
68
69
  synchronise(): FormValuesContainer<Value, Metadata>;
69
70
  }
70
71
  /**
@@ -83,3 +84,7 @@ export type Suggestion = {
83
84
  [lng: string]: string;
84
85
  };
85
86
  };
87
+ export interface ComputationResult<T> {
88
+ value: T | undefined;
89
+ dependencies: string[];
90
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"model.js","sourceRoot":"","sources":["../../tmp/generic/model.ts"],"names":[],"mappings":"","sourcesContent":["import { FieldMetadata, FieldValue } from '../components/model'\n\n/**\n * VersionedData is a structure that contains the values of a form, organized by id and version.\n */\nexport interface VersionedData<T> {\n\t[id: string]: Version<T>[]\n}\n\n/**\n * Version is a structure that contains a value, a revision number and a modification timestamp used to sort the versions.\n */\nexport interface Version<T> {\n\trevision: string | null //null means that the version is not saved yet\n\tmodified?: number\n\tvalue: T\n}\n\nexport type ID = string\n/**\n * FormValuesContainer is a readonly structure that provides and handle the values of a form.\n * It is a tree structure where each node is a FormValuesContainer with the same Value and Metadata types.\n *\n * The following methods are provided and must be implemented by the concrete class:\n * - `compute(formula: string, sandbox?: S): T?` : computes a formula based on the values of the form, inside a provided sandbox. If no sandbox is provided, the default sandbox is used.\n * - `getLabel(): string` : returns the label of the form values container (used to display the title of the form in hierarchical contexts)\n * - `getFormId(): string?` : returns the id of the form values container\n * - `getValues(revisionsFilter: Lambda): VersionedData<Value>` : obtains the values to be displayed in the form, using a filter\n * \t\t\tto select the desired versioned data that are to be displayed in a specific field.\n * - `getMetadata(id: string, revisions: (string | null)[]): VersionedData<Metadata>` : obtains the metadata of a specific value, for the specified revisions.\n * - `getValidationErrors(): [FieldMetadata, string][]`: returns the validation errors of the form values container for the values that are currently stored in it.\n * - `getChildren(): FormValuesContainer<Value, Metadata>[]` : returns the children of the form values container\n * - `setValue(label: string, language: string, data?: Value, id?: string, metadata?: Metadata): FormValuesContainerMutation<Value, Metadata, FormValuesContainer<Value, Metadata>, ID>` :\n * \t\t\tmodifies the value associated to a field in the form values container. As a form values container is immutable, this method returns a mutation wrapping\n * \t\t\ta new form values container along with the modified value.\n * - `setMetadata(label: string, metadata: Metadata, id?: string): FormValuesContainerMutation<Value, Metadata, FormValuesContainer<Value, Metadata>, ID>` :\n * \t\t\tmodifies the metadata associated to a value in the form values container. As a form values container is immutable, this method returns a mutation wrapping\n * \t\t\ta new form values container along with the modified metadata.\n * - `delete(valueId: string): FormValuesContainerMutation<Value, Metadata, FormValuesContainer<Value, Metadata>, void>` :\n * \t\t\tdeletes a value from the form values container. As a form values container is immutable, this method returns a mutation wrapping\n * \t\t\ta new form values container without the deleted value.\n * - `addChild(anchorId: string, templateId: string, label: string): Promise<FormValuesContainerMutation<...>, FormValuesContainer<...>>>`:\n * \t\t\tadds a child to the form values container. As a form values container is immutable, this method returns a mutation wrapping\n * \t\t\ta new form values container with the added child.\n * - `removeChild(container: FormValuesContainer<Value, Metadata>): Promise<FormValuesContainerMutation<Value, Metadata, FormValuesContainer<Value, Metadata>, void>>` :\n * \t\t\tremoves a child from the form values container. As a form values container is immutable, this method returns a mutation wrapping\n * \t\t\ta new form values container without the removed child.\n * - `registerChangeListener(listener: (newValue: FormValuesContainer<Value, Metadata>) => void): void` :\n * \t\t\tregisters a listener that will be called whenever the form values container is modified.\n * - `unregisterChangeListener(listener: (newValue: FormValuesContainer<Value, Metadata>) => void): void` : unregisters a listener that was previously registered.\n *\n */\nexport interface FormValuesContainer<Value, Metadata> {\n\t//information retrieval\n\tcompute<T, S extends { [key: string | symbol]: unknown }>(formula: string, sandbox?: S): Promise<T | undefined>\n\tgetLabel(): string\n\tgetFormId(): string | undefined\n\tgetDefaultValue(label: string): Promise<FieldValue | undefined>\n\tgetValues(revisionsFilter: (id: string, history: Version<Metadata>[]) => (string | null)[]): VersionedData<Value>\n\tgetMetadata(id: string, revisions: (string | null)[]): VersionedData<Metadata>\n\tgetChildren(): Promise<FormValuesContainer<Value, Metadata>[]>\n\tgetValidationErrors(): Promise<[FieldMetadata, string][]>\n\t//modification\n\tsetValue(label: string, language: string, data?: Value, id?: string, metadata?: Metadata, changeListenersOverrider?: (fvc: FormValuesContainer<Value, Metadata>) => void): void\n\tsetMetadata(metadata: Metadata, id?: string): void\n\tdelete(serviceId: string): void\n\t//hierarchy\n\taddChild(anchorId: string, templateId: string, label: string): Promise<void>\n\tremoveChild(container: FormValuesContainer<Value, Metadata>): Promise<void>\n\t//listeners\n\tregisterChangeListener(listener: (newValue: FormValuesContainer<Value, Metadata>) => void): void\n\tunregisterChangeListener(listener: (newValue: FormValuesContainer<Value, Metadata>) => void): void\n\n\tsynchronise(): FormValuesContainer<Value, Metadata>\n}\n\n/**\n * FormValuesContainerMutation is a structure that wraps a new form values container along with the modified value.\n */\nexport interface FormValuesContainerMutation<Value, Metadata, FVC extends FormValuesContainer<Value, Metadata>, Result> {\n\tresult: Result\n\tformValuesContainer: FVC\n}\n\nexport type Suggestion = { id: string; code?: string; text: string; terms: string[]; label: { [lng: string]: string } }\n"]}
1
+ {"version":3,"file":"model.js","sourceRoot":"","sources":["../../tmp/generic/model.ts"],"names":[],"mappings":"","sourcesContent":["import { FieldMetadata, FieldValue } from '../components/model'\n\n/**\n * VersionedData is a structure that contains the values of a form, organized by id and version.\n * Versions are ordered most recent first.\n */\nexport interface VersionedData<T> {\n\t[id: string]: Version<T>[]\n}\n\n/**\n * Version is a structure that contains a value, a revision number and a modification timestamp used to sort the versions.\n */\nexport interface Version<T> {\n\trevision: string | null //null means that the version is not saved yet\n\tmodified?: number\n\tvalue: T\n}\n\nexport type ID = string\n/**\n * FormValuesContainer is a readonly structure that provides and handle the values of a form.\n * It is a tree structure where each node is a FormValuesContainer with the same Value and Metadata types.\n *\n * The following methods are provided and must be implemented by the concrete class:\n * - `compute(formula: string, sandbox?: S): T?` : computes a formula based on the values of the form, inside a provided sandbox. If no sandbox is provided, the default sandbox is used.\n * - `getLabel(): string` : returns the label of the form values container (used to display the title of the form in hierarchical contexts)\n * - `getFormId(): string?` : returns the id of the form values container\n * - `getValues(revisionsFilter: Lambda): VersionedData<Value>` : obtains the values to be displayed in the form, using a filter\n * \t\t\tto select the desired versioned data that are to be displayed in a specific field.\n * - `getMetadata(id: string, revisions: (string | null)[]): VersionedData<Metadata>` : obtains the metadata of a specific value, for the specified revisions.\n * - `getValidationErrors(): [FieldMetadata, string][]`: returns the validation errors of the form values container for the values that are currently stored in it.\n * - `getChildren(): FormValuesContainer<Value, Metadata>[]` : returns the children of the form values container\n * - `setValue(label: string, language: string, data?: Value, id?: string, metadata?: Metadata): FormValuesContainerMutation<Value, Metadata, FormValuesContainer<Value, Metadata>, ID>` :\n * \t\t\tmodifies the value associated to a field in the form values container. As a form values container is immutable, this method returns a mutation wrapping\n * \t\t\ta new form values container along with the modified value.\n * - `setMetadata(label: string, metadata: Metadata, id?: string): FormValuesContainerMutation<Value, Metadata, FormValuesContainer<Value, Metadata>, ID>` :\n * \t\t\tmodifies the metadata associated to a value in the form values container. As a form values container is immutable, this method returns a mutation wrapping\n * \t\t\ta new form values container along with the modified metadata.\n * - `delete(valueId: string): FormValuesContainerMutation<Value, Metadata, FormValuesContainer<Value, Metadata>, void>` :\n * \t\t\tdeletes a value from the form values container. As a form values container is immutable, this method returns a mutation wrapping\n * \t\t\ta new form values container without the deleted value.\n * - `addChild(anchorId: string, templateId: string, label: string): Promise<FormValuesContainerMutation<...>, FormValuesContainer<...>>>`:\n * \t\t\tadds a child to the form values container. As a form values container is immutable, this method returns a mutation wrapping\n * \t\t\ta new form values container with the added child.\n * - `removeChild(container: FormValuesContainer<Value, Metadata>): Promise<FormValuesContainerMutation<Value, Metadata, FormValuesContainer<Value, Metadata>, void>>` :\n * \t\t\tremoves a child from the form values container. As a form values container is immutable, this method returns a mutation wrapping\n * \t\t\ta new form values container without the removed child.\n * - `registerChangeListener(listener: (newValue: FormValuesContainer<Value, Metadata>) => void): void` :\n * \t\t\tregisters a listener that will be called whenever the form values container is modified.\n * - `unregisterChangeListener(listener: (newValue: FormValuesContainer<Value, Metadata>) => void): void` : unregisters a listener that was previously registered.\n *\n */\nexport interface FormValuesContainer<Value, Metadata> {\n\t//information retrieval\n\tcompute<T, S extends { [key: string | symbol]: unknown }>(formula: string, sandbox?: S): Promise<ComputationResult<T>>\n\tgetLabel(): string\n\tgetFormId(): string | undefined\n\tgetDefaultValueProvider(label: string): (() => Promise<FieldValue | undefined>) | undefined\n\tgetValues(revisionsFilter: (id: string, history: Version<Metadata>[]) => (string | null)[]): VersionedData<Value>\n\tgetMetadata(id: string, revisions: (string | null)[]): VersionedData<Metadata>\n\tgetChildren(): Promise<FormValuesContainer<Value, Metadata>[]>\n\tgetValidationErrors(): Promise<[FieldMetadata, string] | null>[]\n\t//modification\n\tsetValue(\n\t\tlabel: string,\n\t\tlanguage: string,\n\t\tdata?: Value,\n\t\tid?: string,\n\t\tmetadata?: Metadata,\n\t\tchangeListenersOverrider?: (fvc: FormValuesContainer<Value, Metadata>, changedKeys: string[] | null) => void,\n\t): void\n\tsetMetadata(metadata: Metadata, id?: string): void\n\tdelete(serviceId: string): void\n\t//hierarchy\n\taddChild(anchorId: string, templateId: string, label: string): Promise<void>\n\tremoveChild(container: FormValuesContainer<Value, Metadata>): Promise<void>\n\t//listeners\n\tregisterChangeListener(listener: (newValue: FormValuesContainer<Value, Metadata>, changedKeys: string[] | null, force: boolean) => void): void\n\tunregisterChangeListener(listener: (newValue: FormValuesContainer<Value, Metadata>, changedKeys: string[] | null, force: boolean) => void): void\n\n\tsynchronise(): FormValuesContainer<Value, Metadata>\n}\n\n/**\n * FormValuesContainerMutation is a structure that wraps a new form values container along with the modified value.\n */\nexport interface FormValuesContainerMutation<Value, Metadata, FVC extends FormValuesContainer<Value, Metadata>, Result> {\n\tresult: Result\n\tformValuesContainer: FVC\n}\n\nexport type Suggestion = { id: string; code?: string; text: string; terms: string[]; label: { [lng: string]: string } }\n\nexport interface ComputationResult<T> {\n\tvalue: T | undefined\n\tdependencies: string[]\n}\n"]}
@@ -1,7 +1,13 @@
1
1
  import { Contact, Form, Form as ICureForm, Service } from '@icure/api';
2
- import { FormValuesContainer, Version, VersionedData } from '../generic';
2
+ import { ComputationResult, FormValuesContainer, Version, VersionedData } from '../generic';
3
3
  import { ServiceMetadata } from './model';
4
4
  import { FieldMetadata, FieldValue, Validator } from '../components/model';
5
+ interface ComputedValueChange {
6
+ serviceId: string | undefined;
7
+ metadata: FieldMetadata;
8
+ language: string;
9
+ value: FieldValue | undefined;
10
+ }
5
11
  /** This class is a bridge between the ICure API and the generic FormValuesContainer interface.
6
12
  * It wraps around a ContactFormValuesContainer and provides a series of services:
7
13
  * - It computes dependent values when the form is created
@@ -30,10 +36,12 @@ export declare class BridgedFormValuesContainer implements FormValuesContainer<F
30
36
  private language;
31
37
  private changeListeners;
32
38
  private interpreterContext;
39
+ private dependenciesCache;
33
40
  private contact;
34
41
  private contactFormValuesContainer;
35
42
  private _id;
36
43
  private readonly mutateAndNotify;
44
+ private dependentValuesComputationIteration?;
37
45
  toString(): string;
38
46
  /**
39
47
  * Creates an instance of BridgedFormValuesContainer.
@@ -47,6 +55,7 @@ export declare class BridgedFormValuesContainer implements FormValuesContainer<F
47
55
  * @param language The language in which the values are displayed
48
56
  * @param changeListeners The listeners that will be notified when the values change
49
57
  * @param interpreterContext A map with keys that are the names of the variables and values that are the functions that return the values of the variables
58
+ * @param dependenciesCache
50
59
  */
51
60
  constructor(responsible: string, contactFormValuesContainer: ContactFormValuesContainer, interpreter?: (<T, S extends {
52
61
  [key: string | symbol]: unknown;
@@ -61,30 +70,30 @@ export declare class BridgedFormValuesContainer implements FormValuesContainer<F
61
70
  }[], validatorsProvider?: (anchorId: string | undefined, templateId: string) => {
62
71
  metadata: FieldMetadata;
63
72
  validators: Validator[];
64
- }[], language?: string, changeListeners?: ((newValue: BridgedFormValuesContainer) => void)[], interpreterContext?: {
73
+ }[], language?: string, changeListeners?: ((newValue: BridgedFormValuesContainer, changedKeys: string[] | null, force: boolean) => void)[], interpreterContext?: {
65
74
  [variable: string]: () => unknown;
75
+ }, dependenciesCache?: {
76
+ [formula: string]: string[];
66
77
  });
67
- init(): Promise<this>;
78
+ init(changedKeys?: string[] | null, pendingComputationIteration?: Promise<ComputedValueChange[]>): Promise<BridgedFormValuesContainer>;
68
79
  getLabel(): string;
69
80
  getFormId(): string | undefined;
70
81
  getContactFormValuesContainer(): ContactFormValuesContainer;
71
- registerChangeListener(listener: (newValue: BridgedFormValuesContainer) => void): void;
72
- unregisterChangeListener(listener: (newValue: BridgedFormValuesContainer) => void): void;
73
- getDefaultValue(label: string): Promise<FieldValue | undefined>;
82
+ registerChangeListener(listener: (newValue: BridgedFormValuesContainer, changedKeys: string[] | null, force: boolean) => void): void;
83
+ unregisterChangeListener(listener: (newValue: BridgedFormValuesContainer, changedKeys: string[] | null, force: boolean) => void): void;
84
+ getDefaultValueProvider(label: string): (() => Promise<FieldValue | undefined>) | undefined;
74
85
  getValues(revisionsFilter: (id: string, history: Version<FieldMetadata>[]) => (string | null)[]): VersionedData<FieldValue>;
75
86
  getMetadata(id: string, revisions: (string | null)[]): VersionedData<FieldMetadata>;
76
87
  private convertRawValue;
77
- private computeInitialValues;
78
88
  private computeDependentValues;
89
+ private quietlyApplyChangesOnContactFormValueContainer;
79
90
  setValue(label: string, language: string, fv?: FieldValue, id?: string, metadata?: FieldMetadata): void;
80
91
  setMetadata(meta: FieldMetadata, id?: string | undefined): void;
81
92
  delete(serviceId: string): void;
82
93
  private getVersionedValuesForKey;
83
- compute<T, S extends {
84
- [key: string | symbol]: unknown;
85
- }>(formula: string, sandbox?: S): Promise<T | undefined>;
94
+ compute<T>(formula: string): Promise<ComputationResult<T>>;
86
95
  getChildren(): Promise<FormValuesContainer<FieldValue, FieldMetadata>[]>;
87
- getValidationErrors(): Promise<[FieldMetadata, string][]>;
96
+ getValidationErrors(): Promise<[FieldMetadata, string] | null>[];
88
97
  addChild(anchorId: string, templateId: string, label: string): Promise<void>;
89
98
  removeChild(container: BridgedFormValuesContainer): Promise<void>;
90
99
  synchronise(): this;
@@ -102,11 +111,12 @@ export declare class ContactFormValuesContainer implements FormValuesContainer<S
102
111
  currentContact: Contact;
103
112
  contactsHistory: Contact[];
104
113
  children: ContactFormValuesContainer[];
114
+ anchorId?: string;
105
115
  serviceFactory: (label: string, serviceId?: string) => Service;
106
116
  formFactory: (parentId: string, anchorId: string, formTemplateId: string, label: string) => Promise<ICureForm>;
107
117
  formRecycler: (formId: string) => Promise<void>;
108
- changeListeners: ((newValue: ContactFormValuesContainer) => void)[];
109
- private _id;
118
+ changeListeners: ((newValue: ContactFormValuesContainer, changedKeys: string[] | null, force: boolean) => void)[];
119
+ _id: string;
110
120
  private _initialised;
111
121
  private indexedServices;
112
122
  toString(): string;
@@ -119,23 +129,24 @@ export declare class ContactFormValuesContainer implements FormValuesContainer<S
119
129
  * Returns a contact that combines the content of the contact in this form with the content of all contents stored in the children
120
130
  */
121
131
  allForms(): Form[];
122
- constructor(rootForm: ICureForm, currentContact: Contact, contactsHistory: Contact[], serviceFactory: (label: string, serviceId?: string) => Service, children: ContactFormValuesContainer[], formFactory: (parentId: string, anchorId: string, formTemplateId: string, label: string) => Promise<ICureForm>, formRecycler: (formId: string) => Promise<void>, changeListeners?: ((newValue: ContactFormValuesContainer) => void)[], initialised?: boolean);
132
+ constructor(rootForm: ICureForm, currentContact: Contact, contactsHistory: Contact[], serviceFactory: (label: string, serviceId?: string) => Service, children: ContactFormValuesContainer[], formFactory: (parentId: string, anchorId: string, formTemplateId: string, label: string) => Promise<ICureForm>, formRecycler: (formId: string) => Promise<void>, changeListeners?: ((newValue: ContactFormValuesContainer, changedKeys: string[] | null, force: boolean) => void)[], anchorId?: string, initialised?: boolean);
123
133
  synchronise(): this;
124
- registerChildFormValuesContainer(childFormValueContainer: ContactFormValuesContainer): void;
134
+ registerChildFormValuesContainer(childFormValueContainer: ContactFormValuesContainer, anchorId: string): void;
125
135
  static fromFormsHierarchy(rootForm: ICureForm, currentContact: Contact, contactsHistory: Contact[], serviceFactory: (label: string, serviceId?: string) => Service, formChildrenProvider: (parentId: string | undefined) => Promise<ICureForm[]>, formFactory: (parentId: string, anchorId: string, formTemplateId: string, label: string) => Promise<ICureForm>, formRecycler: (formId: string) => Promise<void>, changeListeners?: ((newValue: ContactFormValuesContainer) => void)[]): Promise<ContactFormValuesContainer>;
126
136
  getLabel(): string;
127
137
  getFormId(): string | undefined;
128
- registerChangeListener(listener: (newValue: ContactFormValuesContainer) => void): void;
129
- unregisterChangeListener(listener: (newValue: ContactFormValuesContainer) => void): void;
138
+ registerChangeListener(listener: (newValue: ContactFormValuesContainer, changedKeys: string[] | null, force: boolean) => void): void;
139
+ unregisterChangeListener(listener: (newValue: ContactFormValuesContainer, changedKeys: string[] | null, force: boolean) => void): void;
130
140
  getChildren(): Promise<ContactFormValuesContainer[]>;
131
- getValidationErrors(): Promise<[FieldMetadata, string][]>;
132
- getDefaultValue(): Promise<FieldValue | undefined>;
141
+ getValidationErrors(): Promise<[FieldMetadata, string] | null>[];
142
+ getDefaultValueProvider(): (() => Promise<FieldValue | undefined>) | undefined;
133
143
  getValues(revisionsFilter: (id: string, history: Version<ServiceMetadata>[]) => (string | null)[]): VersionedData<Service>;
134
144
  getMetadata(id: string, revisions: (string | null)[]): VersionedData<ServiceMetadata>;
135
145
  setMetadata(meta: ServiceMetadata, id?: string): void;
136
- setValue(label: string, language: string, value?: Service, id?: string, metadata?: ServiceMetadata, changeListenersOverrider?: (fvc: ContactFormValuesContainer) => void): void;
146
+ setValue(label: string, language: string, value?: Service, id?: string, metadata?: ServiceMetadata, changeListenersOverrider?: (fvc: ContactFormValuesContainer, changedKeys: string[] | null) => void): void;
137
147
  delete(serviceId: string): void;
138
- compute<T>(): Promise<T | undefined>;
148
+ toMarkdownTable(): string;
149
+ compute<T>(): Promise<ComputationResult<T>>;
139
150
  /** returns all services in history that match a selector
140
151
  *
141
152
  * @private
@@ -146,3 +157,4 @@ export declare class ContactFormValuesContainer implements FormValuesContainer<S
146
157
  private getServiceInCurrentContact;
147
158
  removeChild(container: ContactFormValuesContainer): Promise<void>;
148
159
  }
160
+ export {};