@ukhomeoffice/cop-react-form-renderer 5.26.0 → 5.26.1
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.
|
@@ -12,7 +12,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
12
12
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
13
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
14
14
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
15
|
-
var DEFAULT_VALUES = (_DEFAULT_VALUES = {}, _defineProperty(_DEFAULT_VALUES, _models.ComponentTypes.COLLECTION, []), _defineProperty(_DEFAULT_VALUES, _models.ComponentTypes.CONTAINER, {}),
|
|
15
|
+
var DEFAULT_VALUES = (_DEFAULT_VALUES = {}, _defineProperty(_DEFAULT_VALUES, _models.ComponentTypes.COLLECTION, []), _defineProperty(_DEFAULT_VALUES, _models.ComponentTypes.CONTAINER, {}), _DEFAULT_VALUES);
|
|
16
16
|
var getDefaultValue = function getDefaultValue(component, formData) {
|
|
17
17
|
if (!component) {
|
|
18
18
|
return '';
|
|
@@ -33,11 +33,6 @@ describe('utils.Component.defaultValue', function () {
|
|
|
33
33
|
type: _models.ComponentTypes.CONTAINER
|
|
34
34
|
})).toEqual({});
|
|
35
35
|
});
|
|
36
|
-
it("should return an empty object if the component type is 'file'", function () {
|
|
37
|
-
expect((0, _getDefaultValue.default)({
|
|
38
|
-
type: _models.ComponentTypes.FILE
|
|
39
|
-
})).toEqual({});
|
|
40
|
-
});
|
|
41
36
|
it('should return defaultValue if the component has defaultValue prop', function () {
|
|
42
37
|
expect((0, _getDefaultValue.default)({
|
|
43
38
|
type: _models.ComponentTypes.AUTOCOMPLETE,
|