@ecrvs/opencrvs-toolkit 1.8.1-rc.a7ee8fb → 1.8.1-rc.fb8610c
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.
- package/dist/commons/conditionals/abbreviation.d.ts +5 -0
- package/dist/commons/conditionals/conditionals.d.ts +4 -0
- package/dist/commons/events/field.d.ts +12 -0
- package/dist/conditionals/index.js +27 -0
- package/dist/events/index.js +992 -0
- package/dist/notification/index.js +992 -0
- package/package.json +1 -1
|
@@ -121,6 +121,8 @@ export declare function createFieldConditionals(fieldId: string): {
|
|
|
121
121
|
isGreaterThan: (value: number | FieldReference) => JSONSchema;
|
|
122
122
|
isLessThan: (value: number | FieldReference) => JSONSchema;
|
|
123
123
|
isEqualTo(value: string | boolean | FieldReference): JSONSchema;
|
|
124
|
+
isEqualToSumOf(val1: FieldReference, val2: FieldReference): JSONSchema;
|
|
125
|
+
isAbbreviation(): JSONSchema;
|
|
124
126
|
/**
|
|
125
127
|
* Use case: Some fields are rendered when selection is not made, or boolean false is explicitly selected.
|
|
126
128
|
* @example field('recommender.none').isFalsy() vs not(field('recommender.none').isEqualTo(true))
|
|
@@ -165,6 +167,8 @@ export declare function createFieldConditionals(fieldId: string): {
|
|
|
165
167
|
isGreaterThan: (value: number | FieldReference) => JSONSchema;
|
|
166
168
|
isLessThan: (value: number | FieldReference) => JSONSchema;
|
|
167
169
|
isEqualTo(value: string | boolean | FieldReference): JSONSchema;
|
|
170
|
+
isEqualToSumOf(val1: FieldReference, val2: FieldReference): JSONSchema;
|
|
171
|
+
isAbbreviation(): JSONSchema;
|
|
168
172
|
/**
|
|
169
173
|
* Use case: Some fields are rendered when selection is not made, or boolean false is explicitly selected.
|
|
170
174
|
* @example field('recommender.none').isFalsy() vs not(field('recommender.none').isEqualTo(true))
|
|
@@ -95,6 +95,12 @@ export declare function field(fieldId: string, options?: {
|
|
|
95
95
|
isEqualTo(value: string | boolean | {
|
|
96
96
|
$$field: string;
|
|
97
97
|
}): import("../conditionals/conditionals").JSONSchema;
|
|
98
|
+
isEqualToSumOf(val1: {
|
|
99
|
+
$$field: string;
|
|
100
|
+
}, val2: {
|
|
101
|
+
$$field: string;
|
|
102
|
+
}): import("../conditionals/conditionals").JSONSchema;
|
|
103
|
+
isAbbreviation(): import("../conditionals/conditionals").JSONSchema;
|
|
98
104
|
isFalsy(): import("../conditionals/conditionals").JSONSchema;
|
|
99
105
|
isUndefined(): import("../conditionals/conditionals").JSONSchema;
|
|
100
106
|
inArray: (values: string[]) => import("../conditionals/conditionals").JSONSchema;
|
|
@@ -136,6 +142,12 @@ export declare function field(fieldId: string, options?: {
|
|
|
136
142
|
isEqualTo(value: string | boolean | {
|
|
137
143
|
$$field: string;
|
|
138
144
|
}): import("../conditionals/conditionals").JSONSchema;
|
|
145
|
+
isEqualToSumOf(val1: {
|
|
146
|
+
$$field: string;
|
|
147
|
+
}, val2: {
|
|
148
|
+
$$field: string;
|
|
149
|
+
}): import("../conditionals/conditionals").JSONSchema;
|
|
150
|
+
isAbbreviation(): import("../conditionals/conditionals").JSONSchema;
|
|
139
151
|
isFalsy(): import("../conditionals/conditionals").JSONSchema;
|
|
140
152
|
isUndefined(): import("../conditionals/conditionals").JSONSchema;
|
|
141
153
|
inArray: (values: string[]) => import("../conditionals/conditionals").JSONSchema;
|
|
@@ -355,6 +355,33 @@ function createFieldConditionals(fieldId) {
|
|
|
355
355
|
required: [fieldId]
|
|
356
356
|
});
|
|
357
357
|
},
|
|
358
|
+
isEqualToSumOf(val1, val2) {
|
|
359
|
+
const field1Id = val1.$$field;
|
|
360
|
+
const field2Id = val2.$$field;
|
|
361
|
+
return defineFormConditional({
|
|
362
|
+
type: "object",
|
|
363
|
+
properties: {
|
|
364
|
+
[fieldId]: { type: "number" },
|
|
365
|
+
[field1Id]: { type: "number" },
|
|
366
|
+
[field2Id]: { type: "number" }
|
|
367
|
+
},
|
|
368
|
+
required: [fieldId, field1Id, field2Id],
|
|
369
|
+
sumOf: {
|
|
370
|
+
sum: fieldId,
|
|
371
|
+
field1: field1Id,
|
|
372
|
+
field2: field2Id
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
},
|
|
376
|
+
isAbbreviation() {
|
|
377
|
+
return defineFormConditional({
|
|
378
|
+
type: "object",
|
|
379
|
+
properties: {
|
|
380
|
+
[fieldId]: { type: "string", isAbbreviation: true }
|
|
381
|
+
},
|
|
382
|
+
required: [fieldId]
|
|
383
|
+
});
|
|
384
|
+
},
|
|
358
385
|
/**
|
|
359
386
|
* Use case: Some fields are rendered when selection is not made, or boolean false is explicitly selected.
|
|
360
387
|
* @example field('recommender.none').isFalsy() vs not(field('recommender.none').isEqualTo(true))
|