@opencrvs/toolkit 1.9.6-rc.a288e65 → 1.9.6-rc.a66f188
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, {
|
package/dist/events/index.js
CHANGED
|
@@ -2999,7 +2999,7 @@ function mapFieldTypeToZod(field3, actionType) {
|
|
|
2999
2999
|
schema = NumberFieldValue;
|
|
3000
3000
|
break;
|
|
3001
3001
|
case FieldType.NUMBER_WITH_UNIT:
|
|
3002
|
-
schema = NumberWithUnitFieldUpdateValue;
|
|
3002
|
+
schema = field3.required ? NumberWithUnitFieldValue : NumberWithUnitFieldUpdateValue;
|
|
3003
3003
|
break;
|
|
3004
3004
|
case FieldType.CHECKBOX:
|
|
3005
3005
|
schema = CheckboxFieldValue;
|
|
@@ -3390,7 +3390,7 @@ function isFieldVisible(field3, form, context) {
|
|
|
3390
3390
|
}
|
|
3391
3391
|
function isFieldEmptyAndNotRequired(field3, form) {
|
|
3392
3392
|
const fieldValue = form[field3.id];
|
|
3393
|
-
return !field3.required && (fieldValue === void 0 || fieldValue === "");
|
|
3393
|
+
return !field3.required && (fieldValue === void 0 || fieldValue === "" || fieldValue && typeof fieldValue === "object" && Object.values(fieldValue).every((v) => v === void 0 || v === ""));
|
|
3394
3394
|
}
|
|
3395
3395
|
function isFieldEnabled(field3, form, context) {
|
|
3396
3396
|
return isFieldConditionMet(field3, form, ConditionalType.ENABLE, context);
|