openchs-models 1.30.2 → 1.30.3
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.
|
@@ -10,18 +10,18 @@ var _lodash = _interopRequireDefault(require("lodash"));
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
|
|
12
12
|
class FormElementStatus {
|
|
13
|
-
constructor(uuid, visibility, value, answersToSkip = [], validationErrors = [], answersToShow = [],
|
|
13
|
+
constructor(uuid, visibility, value, answersToSkip = [], validationErrors = [], answersToShow = [], resetValueIfNull = false) {
|
|
14
14
|
this.uuid = uuid;
|
|
15
15
|
this.visibility = visibility;
|
|
16
16
|
this.value = value;
|
|
17
17
|
this.answersToSkip = answersToSkip;
|
|
18
18
|
this.validationErrors = validationErrors;
|
|
19
19
|
this.answersToShow = answersToShow;
|
|
20
|
-
this.initializedWithNullValueOnPurpose =
|
|
20
|
+
this.initializedWithNullValueOnPurpose = resetValueIfNull && _lodash.default.isNil(value);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
static
|
|
24
|
-
return new FormElementStatus(uuid, visibility, value, answersToSkip, validationErrors, answersToShow,
|
|
23
|
+
static resetIfValueIsNull(uuid, visibility, value, answersToSkip = [], validationErrors = [], answersToShow = []) {
|
|
24
|
+
return new FormElementStatus(uuid, visibility, value, answersToSkip, validationErrors, answersToShow, true);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
_bool(formElementStatus, op) {
|