@opencrvs/toolkit 1.9.6-rc.f6a6a64 → 1.9.6

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.
@@ -230,6 +230,15 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
230
230
  }, {
231
231
  data?: any;
232
232
  }>>> | z.ZodObject<{
233
+ numericValue: z.ZodNumber;
234
+ unit: z.ZodString;
235
+ }, "strip", z.ZodTypeAny, {
236
+ numericValue: number;
237
+ unit: string;
238
+ }, {
239
+ numericValue: number;
240
+ unit: string;
241
+ }> | z.ZodObject<{
233
242
  numericValue: z.ZodOptional<z.ZodNumber>;
234
243
  unit: z.ZodOptional<z.ZodString>;
235
244
  }, "strip", z.ZodTypeAny, {
@@ -239,6 +248,15 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
239
248
  numericValue?: number | undefined;
240
249
  unit?: string | undefined;
241
250
  }> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
251
+ numericValue: z.ZodNumber;
252
+ unit: z.ZodString;
253
+ }, "strip", z.ZodTypeAny, {
254
+ numericValue: number;
255
+ unit: string;
256
+ }, {
257
+ numericValue: number;
258
+ unit: string;
259
+ }>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
242
260
  numericValue: z.ZodOptional<z.ZodNumber>;
243
261
  unit: z.ZodOptional<z.ZodString>;
244
262
  }, "strip", z.ZodTypeAny, {
@@ -3009,7 +3009,7 @@ function mapFieldTypeToZod(field3, actionType) {
3009
3009
  schema = NumberFieldValue;
3010
3010
  break;
3011
3011
  case FieldType.NUMBER_WITH_UNIT:
3012
- schema = NumberWithUnitFieldUpdateValue;
3012
+ schema = field3.required ? NumberWithUnitFieldValue : NumberWithUnitFieldUpdateValue;
3013
3013
  break;
3014
3014
  case FieldType.CHECKBOX:
3015
3015
  schema = CheckboxFieldValue;
@@ -3400,7 +3400,7 @@ function isFieldVisible(field3, form, context) {
3400
3400
  }
3401
3401
  function isFieldEmptyAndNotRequired(field3, form) {
3402
3402
  const fieldValue = form[field3.id];
3403
- return !field3.required && (fieldValue === void 0 || fieldValue === "");
3403
+ return !field3.required && (fieldValue === void 0 || fieldValue === "" || fieldValue && typeof fieldValue === "object" && Object.values(fieldValue).every((v) => v === void 0 || v === ""));
3404
3404
  }
3405
3405
  function isFieldEnabled(field3, form, context) {
3406
3406
  return isFieldConditionMet(field3, form, ConditionalType.ENABLE, context);
@@ -8889,12 +8889,8 @@ var window2 = () => ({
8889
8889
  }
8890
8890
  }
8891
8891
  });
8892
- var KNOWN_SYSTEM_KEYS = ["$$date", "$$time"];
8893
8892
  function isTemplateVariable(value) {
8894
- if (typeof value === "string" && KNOWN_SYSTEM_KEYS.includes(value)) {
8895
- return true;
8896
- }
8897
- return false;
8893
+ return typeof value === "string" && value.startsWith("$");
8898
8894
  }
8899
8895
  function isFieldValue(value) {
8900
8896
  return FieldValue.safeParse(value).success;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencrvs/toolkit",
3
- "version": "1.9.6-rc.f6a6a64",
3
+ "version": "1.9.6",
4
4
  "description": "OpenCRVS toolkit for building country configurations",
5
5
  "license": "MPL-2.0",
6
6
  "exports": {