@opencrvs/toolkit 1.9.6-rc.d22ac70 → 1.9.6-rc.d5ae78e

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.
@@ -119,14 +119,32 @@ declare const DateRangeMatcher: z.ZodObject<z.objectUtil.extendShape<{
119
119
  pivot: z.ZodOptional<z.ZodNumber>;
120
120
  days: z.ZodNumber;
121
121
  boost: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
122
+ alsoMatchAgainst: z.ZodOptional<z.ZodArray<z.ZodObject<{
123
+ $$field: z.ZodEffects<z.ZodString, string, string>;
124
+ $$subfield: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
125
+ }, "strip", z.ZodTypeAny, {
126
+ $$field: string;
127
+ $$subfield?: string[] | undefined;
128
+ }, {
129
+ $$field: string;
130
+ $$subfield?: string[] | undefined;
131
+ }>, "many">>;
122
132
  }, "strip", z.ZodTypeAny, {
123
133
  boost: number;
124
134
  days: number;
125
135
  pivot?: number | undefined;
136
+ alsoMatchAgainst?: {
137
+ $$field: string;
138
+ $$subfield?: string[] | undefined;
139
+ }[] | undefined;
126
140
  }, {
127
141
  days: number;
128
142
  boost?: number | undefined;
129
143
  pivot?: number | undefined;
144
+ alsoMatchAgainst?: {
145
+ $$field: string;
146
+ $$subfield?: string[] | undefined;
147
+ }[] | undefined;
130
148
  }>;
131
149
  }>, "strip", z.ZodTypeAny, {
132
150
  type: "dateRange";
@@ -134,6 +152,10 @@ declare const DateRangeMatcher: z.ZodObject<z.objectUtil.extendShape<{
134
152
  boost: number;
135
153
  days: number;
136
154
  pivot?: number | undefined;
155
+ alsoMatchAgainst?: {
156
+ $$field: string;
157
+ $$subfield?: string[] | undefined;
158
+ }[] | undefined;
137
159
  };
138
160
  fieldId: string;
139
161
  }, {
@@ -142,6 +164,10 @@ declare const DateRangeMatcher: z.ZodObject<z.objectUtil.extendShape<{
142
164
  days: number;
143
165
  boost?: number | undefined;
144
166
  pivot?: number | undefined;
167
+ alsoMatchAgainst?: {
168
+ $$field: string;
169
+ $$subfield?: string[] | undefined;
170
+ }[] | undefined;
145
171
  };
146
172
  fieldId: string;
147
173
  }>;
@@ -26,6 +26,10 @@ export declare function field(fieldId: string): {
26
26
  days: number;
27
27
  boost?: number | undefined;
28
28
  pivot?: number | undefined;
29
+ alsoMatchAgainst?: {
30
+ $$field: string;
31
+ $$subfield?: string[] | undefined;
32
+ }[] | undefined;
29
33
  };
30
34
  };
31
35
  };
@@ -26,6 +26,10 @@ export declare function field(fieldId: string): {
26
26
  days: number;
27
27
  boost?: number | undefined;
28
28
  pivot?: number | undefined;
29
+ alsoMatchAgainst?: {
30
+ $$field: string;
31
+ $$subfield?: string[] | undefined;
32
+ }[] | undefined;
29
33
  };
30
34
  };
31
35
  };
@@ -2588,7 +2588,8 @@ var DateRangeMatcher = Matcher.extend({
2588
2588
  */
2589
2589
  pivot: import_zod18.z.number().optional(),
2590
2590
  days: import_zod18.z.number(),
2591
- boost: import_zod18.z.number().optional().default(1)
2591
+ boost: import_zod18.z.number().optional().default(1),
2592
+ alsoMatchAgainst: import_zod18.z.array(FieldReference).optional()
2592
2593
  })
2593
2594
  });
2594
2595
  var Not = import_zod18.z.object({
@@ -7802,8 +7803,35 @@ var mother = defineFormPage({
7802
7803
  secured: true,
7803
7804
  validation: [],
7804
7805
  label: generateTranslationConfig("Date of birth"),
7806
+ conditionals: [
7807
+ {
7808
+ type: "SHOW",
7809
+ conditional: not(field("mother.dobUnknown").isEqualTo(true))
7810
+ }
7811
+ ]
7812
+ },
7813
+ {
7814
+ id: "mother.dobUnknown",
7815
+ type: "CHECKBOX",
7816
+ label: generateTranslationConfig("Exact date of birth unknown"),
7805
7817
  conditionals: []
7806
7818
  },
7819
+ {
7820
+ id: "mother.age",
7821
+ type: FieldType.AGE,
7822
+ required: true,
7823
+ analytics: true,
7824
+ label: generateTranslationConfig("Age of mother"),
7825
+ configuration: {
7826
+ asOfDate: field("child.dob")
7827
+ },
7828
+ conditionals: [
7829
+ {
7830
+ type: "SHOW",
7831
+ conditional: field("mother.dobUnknown").isEqualTo(true)
7832
+ }
7833
+ ]
7834
+ },
7807
7835
  {
7808
7836
  id: "mother.idType",
7809
7837
  type: FieldType.SELECT,
@@ -2111,7 +2111,8 @@ var DateRangeMatcher = Matcher.extend({
2111
2111
  */
2112
2112
  pivot: import_zod18.z.number().optional(),
2113
2113
  days: import_zod18.z.number(),
2114
- boost: import_zod18.z.number().optional().default(1)
2114
+ boost: import_zod18.z.number().optional().default(1),
2115
+ alsoMatchAgainst: import_zod18.z.array(FieldReference).optional()
2115
2116
  })
2116
2117
  });
2117
2118
  var Not = import_zod18.z.object({
@@ -6056,8 +6057,35 @@ var mother = defineFormPage({
6056
6057
  secured: true,
6057
6058
  validation: [],
6058
6059
  label: generateTranslationConfig("Date of birth"),
6060
+ conditionals: [
6061
+ {
6062
+ type: "SHOW",
6063
+ conditional: not(field("mother.dobUnknown").isEqualTo(true))
6064
+ }
6065
+ ]
6066
+ },
6067
+ {
6068
+ id: "mother.dobUnknown",
6069
+ type: "CHECKBOX",
6070
+ label: generateTranslationConfig("Exact date of birth unknown"),
6059
6071
  conditionals: []
6060
6072
  },
6073
+ {
6074
+ id: "mother.age",
6075
+ type: FieldType.AGE,
6076
+ required: true,
6077
+ analytics: true,
6078
+ label: generateTranslationConfig("Age of mother"),
6079
+ configuration: {
6080
+ asOfDate: field("child.dob")
6081
+ },
6082
+ conditionals: [
6083
+ {
6084
+ type: "SHOW",
6085
+ conditional: field("mother.dobUnknown").isEqualTo(true)
6086
+ }
6087
+ ]
6088
+ },
6061
6089
  {
6062
6090
  id: "mother.idType",
6063
6091
  type: FieldType.SELECT,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencrvs/toolkit",
3
- "version": "1.9.6-rc.d22ac70",
3
+ "version": "1.9.6-rc.d5ae78e",
4
4
  "description": "OpenCRVS toolkit for building country configurations",
5
5
  "license": "MPL-2.0",
6
6
  "exports": {