@opencrvs/toolkit 1.9.6-rc.b6b420e → 1.9.6-rc.bb417b0

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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencrvs/toolkit",
3
- "version": "1.9.6-rc.b6b420e",
3
+ "version": "1.9.6-rc.bb417b0",
4
4
  "description": "OpenCRVS toolkit for building country configurations",
5
5
  "license": "MPL-2.0",
6
6
  "exports": {