@fluid-experimental/property-properties 2.0.0-internal.3.0.2 → 2.0.0-internal.3.2.0
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/README.md +1 -0
- package/dist/containerSerializer.d.ts.map +1 -1
- package/dist/containerSerializer.js +5 -5
- package/dist/containerSerializer.js.map +1 -1
- package/dist/enableValidations.js.map +1 -1
- package/dist/index.d.ts +19 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/properties/abstractStaticCollectionProperty.d.ts +10 -10
- package/dist/properties/abstractStaticCollectionProperty.d.ts.map +1 -1
- package/dist/properties/abstractStaticCollectionProperty.js +70 -53
- package/dist/properties/abstractStaticCollectionProperty.js.map +1 -1
- package/dist/properties/arrayProperty.d.ts.map +1 -1
- package/dist/properties/arrayProperty.js +152 -103
- package/dist/properties/arrayProperty.js.map +1 -1
- package/dist/properties/baseProperty.d.ts +4 -4
- package/dist/properties/baseProperty.d.ts.map +1 -1
- package/dist/properties/baseProperty.js +69 -47
- package/dist/properties/baseProperty.js.map +1 -1
- package/dist/properties/boolProperty.d.ts.map +1 -1
- package/dist/properties/boolProperty.js +3 -3
- package/dist/properties/boolProperty.js.map +1 -1
- package/dist/properties/containerProperty.d.ts +8 -8
- package/dist/properties/containerProperty.d.ts.map +1 -1
- package/dist/properties/containerProperty.js +33 -26
- package/dist/properties/containerProperty.js.map +1 -1
- package/dist/properties/enumArrayProperty.d.ts.map +1 -1
- package/dist/properties/enumArrayProperty.js +14 -14
- package/dist/properties/enumArrayProperty.js.map +1 -1
- package/dist/properties/enumProperty.d.ts.map +1 -1
- package/dist/properties/enumProperty.js +17 -17
- package/dist/properties/enumProperty.js.map +1 -1
- package/dist/properties/floatProperties.js +4 -4
- package/dist/properties/floatProperties.js.map +1 -1
- package/dist/properties/index.d.ts +23 -23
- package/dist/properties/index.d.ts.map +1 -1
- package/dist/properties/index.js.map +1 -1
- package/dist/properties/indexedCollectionBaseProperty.d.ts.map +1 -1
- package/dist/properties/indexedCollectionBaseProperty.js +47 -37
- package/dist/properties/indexedCollectionBaseProperty.js.map +1 -1
- package/dist/properties/intProperties.d.ts.map +1 -1
- package/dist/properties/intProperties.js +10 -10
- package/dist/properties/intProperties.js.map +1 -1
- package/dist/properties/lazyLoadedProperties.js.map +1 -1
- package/dist/properties/mapProperty.d.ts.map +1 -1
- package/dist/properties/mapProperty.js +21 -17
- package/dist/properties/mapProperty.js.map +1 -1
- package/dist/properties/namedNodeProperty.d.ts.map +1 -1
- package/dist/properties/namedNodeProperty.js +3 -3
- package/dist/properties/namedNodeProperty.js.map +1 -1
- package/dist/properties/namedProperty.d.ts.map +1 -1
- package/dist/properties/namedProperty.js +7 -5
- package/dist/properties/namedProperty.js.map +1 -1
- package/dist/properties/nodeProperty.d.ts.map +1 -1
- package/dist/properties/nodeProperty.js +5 -3
- package/dist/properties/nodeProperty.js.map +1 -1
- package/dist/properties/primitiveTypeCasts.d.ts.map +1 -1
- package/dist/properties/primitiveTypeCasts.js +9 -9
- package/dist/properties/primitiveTypeCasts.js.map +1 -1
- package/dist/properties/referenceArrayProperty.d.ts.map +1 -1
- package/dist/properties/referenceArrayProperty.js +31 -25
- package/dist/properties/referenceArrayProperty.js.map +1 -1
- package/dist/properties/referenceMapProperty.d.ts.map +1 -1
- package/dist/properties/referenceMapProperty.js +18 -18
- package/dist/properties/referenceMapProperty.js.map +1 -1
- package/dist/properties/referenceProperty.d.ts.map +1 -1
- package/dist/properties/referenceProperty.js +33 -29
- package/dist/properties/referenceProperty.js.map +1 -1
- package/dist/properties/setProperty.d.ts.map +1 -1
- package/dist/properties/setProperty.js +31 -29
- package/dist/properties/setProperty.js.map +1 -1
- package/dist/properties/stringProperty.d.ts.map +1 -1
- package/dist/properties/stringProperty.js +56 -40
- package/dist/properties/stringProperty.js.map +1 -1
- package/dist/properties/uintProperties.js +5 -5
- package/dist/properties/uintProperties.js.map +1 -1
- package/dist/properties/valueArrayProperty.d.ts +1 -1
- package/dist/properties/valueArrayProperty.d.ts.map +1 -1
- package/dist/properties/valueArrayProperty.js +30 -29
- package/dist/properties/valueArrayProperty.js.map +1 -1
- package/dist/properties/valueMapProperty.d.ts.map +1 -1
- package/dist/properties/valueMapProperty.js +31 -29
- package/dist/properties/valueMapProperty.js.map +1 -1
- package/dist/properties/valueProperty.d.ts.map +1 -1
- package/dist/properties/valueProperty.js +11 -9
- package/dist/properties/valueProperty.js.map +1 -1
- package/dist/propertyFactory.d.ts.map +1 -1
- package/dist/propertyFactory.js +309 -252
- package/dist/propertyFactory.js.map +1 -1
- package/dist/propertyTemplate.d.ts +17 -17
- package/dist/propertyTemplate.d.ts.map +1 -1
- package/dist/propertyTemplate.js +64 -45
- package/dist/propertyTemplate.js.map +1 -1
- package/dist/propertyTemplateWrapper.d.ts.map +1 -1
- package/dist/propertyTemplateWrapper.js +40 -25
- package/dist/propertyTemplateWrapper.js.map +1 -1
- package/dist/propertyUtils.d.ts.map +1 -1
- package/dist/propertyUtils.js.map +1 -1
- package/dist/test/properties/arrayProperty.spec.js +566 -490
- package/dist/test/properties/arrayProperty.spec.js.map +1 -1
- package/dist/test/properties/baseProperty.spec.js +293 -280
- package/dist/test/properties/baseProperty.spec.js.map +1 -1
- package/dist/test/properties/containerProperty.spec.js +100 -94
- package/dist/test/properties/containerProperty.spec.js.map +1 -1
- package/dist/test/properties/customArrayProperty.spec.js +174 -147
- package/dist/test/properties/customArrayProperty.spec.js.map +1 -1
- package/dist/test/properties/enumArrayProperty.spec.js +67 -63
- package/dist/test/properties/enumArrayProperty.spec.js.map +1 -1
- package/dist/test/properties/enumProperty.spec.js +115 -97
- package/dist/test/properties/enumProperty.spec.js.map +1 -1
- package/dist/test/properties/float32.spec.js +5 -5
- package/dist/test/properties/float32.spec.js.map +1 -1
- package/dist/test/properties/int64ArrayProperty.spec.js +157 -93
- package/dist/test/properties/int64ArrayProperty.spec.js.map +1 -1
- package/dist/test/properties/int64MapProperty.spec.js +185 -166
- package/dist/test/properties/int64MapProperty.spec.js.map +1 -1
- package/dist/test/properties/int64Property.spec.js +109 -109
- package/dist/test/properties/int64Property.spec.js.map +1 -1
- package/dist/test/properties/isLeafNode.spec.js +75 -76
- package/dist/test/properties/isLeafNode.spec.js.map +1 -1
- package/dist/test/properties/mapProperty.spec.js +571 -531
- package/dist/test/properties/mapProperty.spec.js.map +1 -1
- package/dist/test/properties/namedNodeProperty.spec.js +31 -31
- package/dist/test/properties/namedNodeProperty.spec.js.map +1 -1
- package/dist/test/properties/nodeProperty.spec.js +805 -795
- package/dist/test/properties/nodeProperty.spec.js.map +1 -1
- package/dist/test/properties/referenceProperty.spec.js +729 -679
- package/dist/test/properties/referenceProperty.spec.js.map +1 -1
- package/dist/test/properties/relationshipProperty.spec.js +16 -16
- package/dist/test/properties/relationshipProperty.spec.js.map +1 -1
- package/dist/test/properties/setProperty.spec.js +288 -227
- package/dist/test/properties/setProperty.spec.js.map +1 -1
- package/dist/test/properties/stringProperty.spec.js +326 -318
- package/dist/test/properties/stringProperty.spec.js.map +1 -1
- package/dist/test/properties/uint64Property.spec.js +46 -36
- package/dist/test/properties/uint64Property.spec.js.map +1 -1
- package/dist/test/properties/valueMapProperty.spec.js +259 -246
- package/dist/test/properties/valueMapProperty.spec.js.map +1 -1
- package/dist/test/properties/valueProperty.spec.js +49 -43
- package/dist/test/properties/valueProperty.spec.js.map +1 -1
- package/dist/test/propertyFactory.spec.js +2038 -1631
- package/dist/test/propertyFactory.spec.js.map +1 -1
- package/dist/test/propertyTemplateWrapper.spec.js +72 -102
- package/dist/test/propertyTemplateWrapper.spec.js.map +1 -1
- package/dist/test/propertyUtils.spec.js +22 -21
- package/dist/test/propertyUtils.spec.js.map +1 -1
- package/dist/test/reversibleChangeset.spec.js +857 -703
- package/dist/test/reversibleChangeset.spec.js.map +1 -1
- package/dist/test/setup.js +5 -5
- package/dist/test/setup.js.map +1 -1
- package/dist/test/tsconfig.tsbuildinfo +1 -1
- package/dist/test/utils.spec.js +1334 -1144
- package/dist/test/utils.spec.js.map +1 -1
- package/dist/test/validation/badMissingSemverInTypeid.js +20 -20
- package/dist/test/validation/badMissingSemverInTypeid.js.map +1 -1
- package/dist/test/validation/badPrimitiveTypeid.js +12 -12
- package/dist/test/validation/badPrimitiveTypeid.js.map +1 -1
- package/dist/test/validation/goodColorId.js +91 -91
- package/dist/test/validation/goodColorId.js.map +1 -1
- package/dist/test/validation/goodColorPalette.js +4 -4
- package/dist/test/validation/goodColorPalette.js.map +1 -1
- package/dist/test/validation/goodPointId.js +20 -20
- package/dist/test/validation/goodPointId.js.map +1 -1
- package/dist/test/validation/reversibleChangeSetTestData.js +23841 -2
- package/dist/test/validation/reversibleChangeSetTestData.js.map +1 -1
- package/lib/containerSerializer.d.ts.map +1 -1
- package/lib/containerSerializer.js +5 -5
- package/lib/containerSerializer.js.map +1 -1
- package/lib/enableValidations.js.map +1 -1
- package/lib/index.d.ts +19 -19
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +19 -19
- package/lib/index.js.map +1 -1
- package/lib/properties/abstractStaticCollectionProperty.d.ts +10 -10
- package/lib/properties/abstractStaticCollectionProperty.d.ts.map +1 -1
- package/lib/properties/abstractStaticCollectionProperty.js +70 -53
- package/lib/properties/abstractStaticCollectionProperty.js.map +1 -1
- package/lib/properties/arrayProperty.d.ts.map +1 -1
- package/lib/properties/arrayProperty.js +152 -103
- package/lib/properties/arrayProperty.js.map +1 -1
- package/lib/properties/baseProperty.d.ts +4 -4
- package/lib/properties/baseProperty.d.ts.map +1 -1
- package/lib/properties/baseProperty.js +73 -51
- package/lib/properties/baseProperty.js.map +1 -1
- package/lib/properties/boolProperty.d.ts.map +1 -1
- package/lib/properties/boolProperty.js +3 -3
- package/lib/properties/boolProperty.js.map +1 -1
- package/lib/properties/containerProperty.d.ts +8 -8
- package/lib/properties/containerProperty.d.ts.map +1 -1
- package/lib/properties/containerProperty.js +33 -26
- package/lib/properties/containerProperty.js.map +1 -1
- package/lib/properties/enumArrayProperty.d.ts.map +1 -1
- package/lib/properties/enumArrayProperty.js +14 -14
- package/lib/properties/enumArrayProperty.js.map +1 -1
- package/lib/properties/enumProperty.d.ts.map +1 -1
- package/lib/properties/enumProperty.js +17 -17
- package/lib/properties/enumProperty.js.map +1 -1
- package/lib/properties/floatProperties.js +4 -4
- package/lib/properties/floatProperties.js.map +1 -1
- package/lib/properties/index.d.ts +23 -23
- package/lib/properties/index.d.ts.map +1 -1
- package/lib/properties/index.js +23 -23
- package/lib/properties/index.js.map +1 -1
- package/lib/properties/indexedCollectionBaseProperty.d.ts.map +1 -1
- package/lib/properties/indexedCollectionBaseProperty.js +47 -37
- package/lib/properties/indexedCollectionBaseProperty.js.map +1 -1
- package/lib/properties/intProperties.d.ts.map +1 -1
- package/lib/properties/intProperties.js +10 -10
- package/lib/properties/intProperties.js.map +1 -1
- package/lib/properties/lazyLoadedProperties.js.map +1 -1
- package/lib/properties/mapProperty.d.ts.map +1 -1
- package/lib/properties/mapProperty.js +21 -17
- package/lib/properties/mapProperty.js.map +1 -1
- package/lib/properties/namedNodeProperty.d.ts.map +1 -1
- package/lib/properties/namedNodeProperty.js +3 -3
- package/lib/properties/namedNodeProperty.js.map +1 -1
- package/lib/properties/namedProperty.d.ts.map +1 -1
- package/lib/properties/namedProperty.js +7 -5
- package/lib/properties/namedProperty.js.map +1 -1
- package/lib/properties/nodeProperty.d.ts.map +1 -1
- package/lib/properties/nodeProperty.js +5 -3
- package/lib/properties/nodeProperty.js.map +1 -1
- package/lib/properties/primitiveTypeCasts.d.ts.map +1 -1
- package/lib/properties/primitiveTypeCasts.js +9 -9
- package/lib/properties/primitiveTypeCasts.js.map +1 -1
- package/lib/properties/referenceArrayProperty.d.ts.map +1 -1
- package/lib/properties/referenceArrayProperty.js +31 -25
- package/lib/properties/referenceArrayProperty.js.map +1 -1
- package/lib/properties/referenceMapProperty.d.ts.map +1 -1
- package/lib/properties/referenceMapProperty.js +18 -18
- package/lib/properties/referenceMapProperty.js.map +1 -1
- package/lib/properties/referenceProperty.d.ts.map +1 -1
- package/lib/properties/referenceProperty.js +33 -29
- package/lib/properties/referenceProperty.js.map +1 -1
- package/lib/properties/setProperty.d.ts.map +1 -1
- package/lib/properties/setProperty.js +31 -29
- package/lib/properties/setProperty.js.map +1 -1
- package/lib/properties/stringProperty.d.ts.map +1 -1
- package/lib/properties/stringProperty.js +56 -40
- package/lib/properties/stringProperty.js.map +1 -1
- package/lib/properties/uintProperties.js +5 -5
- package/lib/properties/uintProperties.js.map +1 -1
- package/lib/properties/valueArrayProperty.d.ts +1 -1
- package/lib/properties/valueArrayProperty.d.ts.map +1 -1
- package/lib/properties/valueArrayProperty.js +30 -29
- package/lib/properties/valueArrayProperty.js.map +1 -1
- package/lib/properties/valueMapProperty.d.ts.map +1 -1
- package/lib/properties/valueMapProperty.js +31 -29
- package/lib/properties/valueMapProperty.js.map +1 -1
- package/lib/properties/valueProperty.d.ts.map +1 -1
- package/lib/properties/valueProperty.js +11 -9
- package/lib/properties/valueProperty.js.map +1 -1
- package/lib/propertyFactory.d.ts.map +1 -1
- package/lib/propertyFactory.js +309 -252
- package/lib/propertyFactory.js.map +1 -1
- package/lib/propertyTemplate.d.ts +17 -17
- package/lib/propertyTemplate.d.ts.map +1 -1
- package/lib/propertyTemplate.js +64 -45
- package/lib/propertyTemplate.js.map +1 -1
- package/lib/propertyTemplateWrapper.d.ts.map +1 -1
- package/lib/propertyTemplateWrapper.js +40 -25
- package/lib/propertyTemplateWrapper.js.map +1 -1
- package/lib/propertyUtils.d.ts.map +1 -1
- package/lib/propertyUtils.js.map +1 -1
- package/package.json +28 -28
- package/src/index.d.ts +2750 -2681
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valueMapProperty.js","sourceRoot":"","sources":["../../src/properties/valueMapProperty.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AAEH,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,EAAE,GAAG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C,OAAO,GAAG,OAAO,CAAC;AAC7C,gBAAgB,CAAC,SAAS,CAAC,YAAY,GAAG,aAAa,CAAC,KAAK,CAAC;AAE9D;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,gBAAgB;IACjD;;;;;;;;OAQG;IACH,YAAY,SAAS;QACjB,KAAK,CAAC,SAAS,CAAC,CAAC;IACrB,CAAC;CACJ;AACD,eAAe,CAAC,SAAS,CAAC,OAAO,GAAG,MAAM,CAAC;AAC3C,eAAe,CAAC,SAAS,CAAC,YAAY,GAAG,aAAa,CAAC,IAAI,CAAC;AAE5D;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,gBAAgB;IACnD;;;;;;;;OAQG;IACH,YAAY,SAAS;QACjB,KAAK,CAAC,SAAS,CAAC,CAAC;IACrB,CAAC;CACJ;AACD,iBAAiB,CAAC,SAAS,CAAC,OAAO,GAAG,QAAQ,CAAC;AAC/C,iBAAiB,CAAC,SAAS,CAAC,YAAY,GAAG,aAAa,CAAC,MAAM,CAAC;AAEhE;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,gBAAgB;IACjD;;;;;;;;OAQG;IACH,YAAY,SAAS;QACjB,KAAK,CAAC,SAAS,CAAC,CAAC;IACrB,CAAC;CACJ;AACD,eAAe,CAAC,SAAS,CAAC,OAAO,GAAG,MAAM,CAAC;AAC3C,eAAe,CAAC,SAAS,CAAC,YAAY,GAAG,aAAa,CAAC,OAAO,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @fileoverview Definition of the valuemap property class\n */\n\nconst _ = require('lodash');\nconst { MSG } = require('@fluid-experimental/property-common').constants;\nconst { Int64, Uint64 } = require('@fluid-experimental/property-common');\nconst { Int64Property, Uint64Property } = require('../properties/intProperties');\nconst { validationsEnabled } = require('../enableValidations');\nconst { _castFunctors } = require('./primitiveTypeCasts');\nconst { BaseProperty } = require('./baseProperty');\nconst { MapProperty } = require('./mapProperty');\n\n/**\n * A ValueMapProperty is a collection class that can contain an dictionary that maps from strings to primitive types.\n */\nexport class ValueMapProperty extends MapProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.MapProperty\n * @alias property-properties.ValueMapProperty\n * @category Maps\n */\n constructor(in_params) {\n super(in_params);\n }\n\n /**\n * Inserts a value into the map. Using insert with a key that already exists will throw an error.\n *\n * @param {string} in_key - The key under which the entry is added\n * @param {*} in_value - The primitive type value to set\n * @throws if a value already exists for in_key\n */\n insert(in_key, in_value) {\n var castedValue = this._castFunctor ? this._castFunctor(in_value) : in_value;\n this._insert(in_key, castedValue, true);\n }\n\n /**\n * Returns an object with all the nested values contained in this property.\n *\n * @example\n * ```javascript\n * {\n * 'firstString': 'test1',\n * 'secondString': 'test2'\n * }\n * ```\n */\n getValues() {\n var ids = this.getIds();\n var result = {};\n for (var i = 0; i < ids.length; i++) {\n result[ids[i]] = this.get(ids[i]);\n }\n return result;\n }\n\n /**\n * Return a JSON representation of the map and its items.\n * @return {object} A JSON representation of the map and its items.\n * @private\n */\n _toJson() {\n return {\n id: this.getId(),\n context: this._context,\n typeid: this.getTypeid(),\n isConstant: this._isConstant,\n value: this.getValues(),\n };\n }\n\n /**\n * Repeatedly calls back the given function with human-readable string\n * representations of the property's sub-properties.\n * @param {string} indent - Leading spaces to create the tree representation\n * @param {function} printFct - Function to call for printing each property\n */\n _prettyPrintChildren(indent, printFct) {\n indent += ' ';\n var prefix = '';\n var suffix = '';\n if (this.getTypeid() === 'String') {\n prefix = '\"';\n suffix = '\"';\n }\n _.mapValues(this._dynamicChildren, function(val, key) {\n printFct(indent + key + ': ' + prefix + val + suffix);\n });\n }\n\n /**\n * Sets the value of a property into the map.\n *\n * @param {string} in_key - The key under which the entry is set\n * @param {*} in_value - The value to be set\n */\n set(in_key, in_value) {\n if (validationsEnabled.enabled) {\n this._checkIsNotReadOnly(true);\n }\n var castedValue = this._castFunctor ? this._castFunctor(in_value) : in_value;\n if (this._dynamicChildren[in_key] !== castedValue) {\n if (validationsEnabled.enabled) {\n this._checkIsNotReadOnly(true);\n }\n if (this._dynamicChildren[in_key] !== undefined) {\n this._removeByKey(in_key, false);\n }\n this._insert(in_key, castedValue, false);\n // Make one final report\n this._reportDirtinessToView();\n }\n }\n\n _getValue(in_key) {\n return this._dynamicChildren[in_key];\n }\n\n /**\n * @inheritdoc\n */\n _reapplyDirtyFlags(in_pendingChangeSet, in_dirtyChangeSet) {\n BaseProperty.prototype._reapplyDirtyFlags.call(this, in_pendingChangeSet, in_dirtyChangeSet);\n\n var i, j, keys, key;\n\n // Remove existing entries\n // (we remove before we add, so that a remove+add operation in effect becomes a replace)\n if (in_pendingChangeSet.remove) {\n if (_.isArray(in_pendingChangeSet.remove)) {\n for (i = 0; i < in_pendingChangeSet.remove.length; i++) {\n key = in_pendingChangeSet.remove[i];\n this._pendingChanges.remove[key] = true;\n }\n } else {\n // handle remove is an object case:\n keys = Object.keys(in_pendingChangeSet.remove);\n for (j = 0; j < keys.length; j++) {\n this._pendingChanges.remove[keys[j]] = true;\n }\n }\n }\n\n // Inserted entries\n if (in_pendingChangeSet.insert) {\n keys = Object.keys(in_pendingChangeSet.insert);\n for (i = 0; i < keys.length; i++) {\n if (this._dynamicChildren[keys[i]] !== undefined) {\n this._pendingChanges.insert[keys[i]] = true;\n } else {\n throw new Error(`${MSG.CANT_DIRTY_MISSING_PROPERTY}${keys[i]}`);\n }\n }\n }\n\n // Modify entries\n if (in_pendingChangeSet.modify) {\n var modifiedPendingEntries = in_pendingChangeSet ? in_pendingChangeSet.modify || {} : {};\n var modifiedDirtyEntries = in_dirtyChangeSet ? in_dirtyChangeSet.modify || {} : {};\n keys = Object.keys(modifiedPendingEntries).concat(Object.keys(modifiedDirtyEntries));\n for (i = 0; i < keys.length; i++) {\n key = keys[i];\n if (this._dynamicChildren[key] !== undefined) {\n if (modifiedPendingEntries[key]) {\n if (!this._pendingChanges.insert[key]) {\n this._pendingChanges.modify[key] = true;\n }\n }\n if (modifiedDirtyEntries[key]) {\n if (!this._dirtyChanges.insert[key]) {\n this._dirtyChanges.modify[key] = true;\n }\n }\n } else {\n throw new Error(MSG.MODIFY_NON_EXISTING_ENTRY + key);\n }\n }\n }\n\n // If working with primitive types, we have to update the dirty flag, when one of the entries\n // was changed\n this._setDirty(false);\n }\n}\n// The value map contains primitive types\nValueMapProperty.prototype._containsPrimitiveTypes = true;\n\n/**\n * A ValueMapProperty which stores Float32 values\n */\nexport class Float32MapProperty extends ValueMapProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueMapProperty\n * @alias property-properties.Float32MapProperty\n * @category Maps\n */\n constructor(in_params) {\n super(in_params);\n }\n}\nFloat32MapProperty.prototype._typeid = 'Float32';\nFloat32MapProperty.prototype._castFunctor = _castFunctors.Float32;\n\n/**\n * A ValueMapProperty which stores Float64 values\n */\nexport class Float64MapProperty extends ValueMapProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueMapProperty\n * @alias property-properties.Float64MapProperty\n * @category Maps\n */\n constructor(in_params) {\n super(in_params);\n }\n}\nFloat64MapProperty.prototype._typeid = 'Float64';\nFloat64MapProperty.prototype._castFunctor = _castFunctors.Float64;\n\n/**\n * A ValueMapProperty which stores Uint32 values\n */\nexport class Uint32MapProperty extends ValueMapProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueMapProperty\n * @alias property-properties.Uint32MapProperty\n * @category Maps\n */\n constructor(in_params) {\n super(in_params);\n }\n}\nUint32MapProperty.prototype._typeid = 'Uint32';\nUint32MapProperty.prototype._castFunctor = _castFunctors.Uint32;\n\n/**\n * A ValueMapProperty which stores Uint16 values\n */\nexport class Uint16MapProperty extends ValueMapProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueMapProperty\n * @alias property-properties.Uint16MapProperty\n * @category Maps\n */\n constructor(in_params) {\n super(in_params);\n }\n}\nUint16MapProperty.prototype._typeid = 'Uint16';\nUint16MapProperty.prototype._castFunctor = _castFunctors.Uint16;\n\n/**\n * A ValueMapProperty which stores Uint8 values\n */\nexport class Uint8MapProperty extends ValueMapProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueMapProperty\n * @alias property-properties.Uint8MapProperty\n * @category Maps\n */\n constructor(in_params) {\n super(in_params);\n }\n}\nUint8MapProperty.prototype._typeid = 'Uint8';\nUint8MapProperty.prototype._castFunctor = _castFunctors.Uint8;\n\n/**\n * A ValueMapProperty which stores Int32 values\n */\nexport class Int32MapProperty extends ValueMapProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueMapProperty\n * @alias property-properties.Int32MapProperty\n * @category Maps\n */\n constructor(in_params) {\n super(in_params);\n }\n}\nInt32MapProperty.prototype._typeid = 'Int32';\nInt32MapProperty.prototype._castFunctor = _castFunctors.Int32;\n\n/**\n * An abstract base class for 64 bit integer map properties\n */\nexport class Integer64MapProperty extends ValueMapProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueMapProperty\n * @alias property-properties.Integer64MapProperty\n * @category Maps\n */\n constructor(in_params) {\n super(in_params);\n }\n\n /**\n * Sets the entry with the given key to the value passed in\n *\n * Note: this will overwrite an already existing value\n *\n * @param {string} in_key - The key under which the entry is stored\n * @param {Int64|Uint64|string|number} in_value - The value or property to store in the map\n */\n set(in_key, in_value) {\n var castedValue = this._castFunctor ? this._castFunctor(in_value) : in_value;\n var myValue = this._dynamicChildren[in_key];\n if (myValue === undefined) {\n this._insert(in_key, castedValue, true);\n } else if (myValue.getValueHigh() !== castedValue.getValueHigh() ||\n myValue.getValueLow() !== castedValue.getValueLow()) {\n this._removeByKey(in_key, false);\n this._insert(in_key, castedValue, false);\n // Make one final report\n this._reportDirtinessToView();\n }\n }\n\n /**\n * Function to serialize special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on serialization. For supported types, we can just return the input here.\n *\n * @param {*} in_obj - The object to be serialized\n * @return {property-properties.SerializedChangeSet} the serialized object\n */\n _serializeValue(in_obj) {\n return [in_obj.getValueLow(), in_obj.getValueHigh()];\n }\n\n /**\n * @inheritdoc\n */\n _prettyPrintChildren(indent, printFct) {\n indent += ' ';\n var int64Prop;\n _.mapValues(this._dynamicChildren, function(val, key) {\n // TODO: The 'toString()' function is defined on Integer64Property, so we need to create\n // such object to use it. It would be better to have it in Utils Integer64.prototype.toString\n int64Prop = val instanceof Int64 ? new Int64Property({}) : new Uint64Property({});\n int64Prop.setValueLow(val.getValueLow());\n int64Prop.setValueHigh(val.getValueHigh());\n printFct(indent + key + ': ' + int64Prop);\n });\n }\n}\n\n/**\n * A ValueMapProperty which stores Int64 Properties\n */\nexport class Int64MapProperty extends Integer64MapProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends Integer64MapProperty\n * @alias property-properties.Int64MapProperty\n * @category Maps\n */\n constructor(in_params) {\n super(in_params);\n }\n\n /**\n * Specialized function to deserialize Int64 primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on deserialization. For supported types, we can just return the input here.\n *\n * @param {property-properties.SerializedChangeSet} in_serializedObj - The object to be deserialized\n * @return {Int64} the deserialized value\n */\n _deserializeValue(in_serializedObj) {\n return new Int64(in_serializedObj[0], in_serializedObj[1]);\n }\n}\nInt64MapProperty.prototype._typeid = 'Int64';\nInt64MapProperty.prototype._castFunctor = _castFunctors.Int64;\n\n/**\n * A ValueMapProperty which stores Uint64 Properties\n */\nexport class Uint64MapProperty extends Integer64MapProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends Integer64MapProperty\n * @alias property-properties.Uint64MapProperty\n * @category Maps\n */\n constructor(in_params) {\n super(in_params);\n }\n\n /**\n * Specialized function to deserialize Uint64 primitive types.\n * Some primitive types (e.g. Uint64, which is not natively supported by javascript) require\n * special treatment on deserialization. For supported types, we can just return the input here.\n *\n * @param {property-properties.SerializedChangeSet} in_serializedObj - The object to be deserialized\n * @return {Uint64} the deserialized value\n */\n _deserializeValue(in_serializedObj) {\n return new Uint64(in_serializedObj[0], in_serializedObj[1]);\n }\n}\nUint64MapProperty.prototype._typeid = 'Uint64';\nUint64MapProperty.prototype._castFunctor = _castFunctors.Uint64;\n\n/**\n * A ValueMapProperty which stores Int16 values\n */\nexport class Int16MapProperty extends ValueMapProperty {\n /** @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueMapProperty\n * @alias property-properties.Int16MapProperty\n * @category Maps\n */\n constructor(in_params) {\n super(in_params);\n }\n}\nInt16MapProperty.prototype._typeid = 'Int16';\nInt16MapProperty.prototype._castFunctor = _castFunctors.Int16;\n\n/**\n * A ValueMapProperty which stores Int8 values\n */\nexport class Int8MapProperty extends ValueMapProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueMapProperty\n * @alias property-properties.Int8MapProperty\n * @category Maps\n */\n constructor(in_params) {\n super(in_params);\n }\n}\nInt8MapProperty.prototype._typeid = 'Int8';\nInt8MapProperty.prototype._castFunctor = _castFunctors.Int8;\n\n/**\n * A ValueMapProperty which stores string values\n */\nexport class StringMapProperty extends ValueMapProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueMapProperty\n * @alias property-properties.StringMapProperty\n * @category Maps\n */\n constructor(in_params) {\n super(in_params);\n }\n}\nStringMapProperty.prototype._typeid = 'String';\nStringMapProperty.prototype._castFunctor = _castFunctors.String;\n\n/**\n * A ValueMapProperty which stores boolean values\n */\nexport class BoolMapProperty extends ValueMapProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueMapProperty\n * @alias property-properties.BoolMapProperty\n * @category Maps\n */\n constructor(in_params) {\n super(in_params);\n }\n}\nBoolMapProperty.prototype._typeid = 'Bool';\nBoolMapProperty.prototype._castFunctor = _castFunctors.Boolean;\n"]}
|
|
1
|
+
{"version":3,"file":"valueMapProperty.js","sourceRoot":"","sources":["../../src/properties/valueMapProperty.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AAEH,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC;AACzE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC;AACzE,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AACjF,MAAM,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAC/D,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAC1D,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AACnD,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAEjD;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IAChD;;;;;;;;OAQG;IACH,YAAY,SAAS;QACpB,KAAK,CAAC,SAAS,CAAC,CAAC;IAClB,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,MAAM,EAAE,QAAQ;QACtB,IAAI,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;QA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AC,YAAY,GAAG,aAAa,CAAC,OAAO,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @fileoverview Definition of the valuemap property class\n */\n\nconst _ = require(\"lodash\");\nconst { MSG } = require(\"@fluid-experimental/property-common\").constants;\nconst { Int64, Uint64 } = require(\"@fluid-experimental/property-common\");\nconst { Int64Property, Uint64Property } = require(\"../properties/intProperties\");\nconst { validationsEnabled } = require(\"../enableValidations\");\nconst { _castFunctors } = require(\"./primitiveTypeCasts\");\nconst { BaseProperty } = require(\"./baseProperty\");\nconst { MapProperty } = require(\"./mapProperty\");\n\n/**\n * A ValueMapProperty is a collection class that can contain an dictionary that maps from strings to primitive types.\n */\nexport class ValueMapProperty extends MapProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.MapProperty\n\t * @alias property-properties.ValueMapProperty\n\t * @category Maps\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n\n\t/**\n\t * Inserts a value into the map. Using insert with a key that already exists will throw an error.\n\t *\n\t * @param {string} in_key - The key under which the entry is added\n\t * @param {*} in_value - The primitive type value to set\n\t * @throws if a value already exists for in_key\n\t */\n\tinsert(in_key, in_value) {\n\t\tvar castedValue = this._castFunctor ? this._castFunctor(in_value) : in_value;\n\t\tthis._insert(in_key, castedValue, true);\n\t}\n\n\t/**\n\t * Returns an object with all the nested values contained in this property.\n\t *\n\t * @example\n\t * ```javascript\n\t * {\n\t * 'firstString': 'test1',\n\t * 'secondString': 'test2'\n\t * }\n\t * ```\n\t */\n\tgetValues() {\n\t\tvar ids = this.getIds();\n\t\tvar result = {};\n\t\tfor (var i = 0; i < ids.length; i++) {\n\t\t\tresult[ids[i]] = this.get(ids[i]);\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * Return a JSON representation of the map and its items.\n\t * @return {object} A JSON representation of the map and its items.\n\t * @private\n\t */\n\t_toJson() {\n\t\treturn {\n\t\t\tid: this.getId(),\n\t\t\tcontext: this._context,\n\t\t\ttypeid: this.getTypeid(),\n\t\t\tisConstant: this._isConstant,\n\t\t\tvalue: this.getValues(),\n\t\t};\n\t}\n\n\t/**\n\t * Repeatedly calls back the given function with human-readable string\n\t * representations of the property's sub-properties.\n\t * @param {string} indent - Leading spaces to create the tree representation\n\t * @param {function} printFct - Function to call for printing each property\n\t */\n\t_prettyPrintChildren(indent, printFct) {\n\t\tindent += \" \";\n\t\tvar prefix = \"\";\n\t\tvar suffix = \"\";\n\t\tif (this.getTypeid() === \"String\") {\n\t\t\tprefix = '\"';\n\t\t\tsuffix = '\"';\n\t\t}\n\t\t_.mapValues(this._dynamicChildren, function (val, key) {\n\t\t\tprintFct(indent + key + \": \" + prefix + val + suffix);\n\t\t});\n\t}\n\n\t/**\n\t * Sets the value of a property into the map.\n\t *\n\t * @param {string} in_key - The key under which the entry is set\n\t * @param {*} in_value - The value to be set\n\t */\n\tset(in_key, in_value) {\n\t\tif (validationsEnabled.enabled) {\n\t\t\tthis._checkIsNotReadOnly(true);\n\t\t}\n\t\tvar castedValue = this._castFunctor ? this._castFunctor(in_value) : in_value;\n\t\tif (this._dynamicChildren[in_key] !== castedValue) {\n\t\t\tif (validationsEnabled.enabled) {\n\t\t\t\tthis._checkIsNotReadOnly(true);\n\t\t\t}\n\t\t\tif (this._dynamicChildren[in_key] !== undefined) {\n\t\t\t\tthis._removeByKey(in_key, false);\n\t\t\t}\n\t\t\tthis._insert(in_key, castedValue, false);\n\t\t\t// Make one final report\n\t\t\tthis._reportDirtinessToView();\n\t\t}\n\t}\n\n\t_getValue(in_key) {\n\t\treturn this._dynamicChildren[in_key];\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\t_reapplyDirtyFlags(in_pendingChangeSet, in_dirtyChangeSet) {\n\t\tBaseProperty.prototype._reapplyDirtyFlags.call(\n\t\t\tthis,\n\t\t\tin_pendingChangeSet,\n\t\t\tin_dirtyChangeSet,\n\t\t);\n\n\t\tvar i, j, keys, key;\n\n\t\t// Remove existing entries\n\t\t// (we remove before we add, so that a remove+add operation in effect becomes a replace)\n\t\tif (in_pendingChangeSet.remove) {\n\t\t\tif (_.isArray(in_pendingChangeSet.remove)) {\n\t\t\t\tfor (i = 0; i < in_pendingChangeSet.remove.length; i++) {\n\t\t\t\t\tkey = in_pendingChangeSet.remove[i];\n\t\t\t\t\tthis._pendingChanges.remove[key] = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// handle remove is an object case:\n\t\t\t\tkeys = Object.keys(in_pendingChangeSet.remove);\n\t\t\t\tfor (j = 0; j < keys.length; j++) {\n\t\t\t\t\tthis._pendingChanges.remove[keys[j]] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Inserted entries\n\t\tif (in_pendingChangeSet.insert) {\n\t\t\tkeys = Object.keys(in_pendingChangeSet.insert);\n\t\t\tfor (i = 0; i < keys.length; i++) {\n\t\t\t\tif (this._dynamicChildren[keys[i]] !== undefined) {\n\t\t\t\t\tthis._pendingChanges.insert[keys[i]] = true;\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error(`${MSG.CANT_DIRTY_MISSING_PROPERTY}${keys[i]}`);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Modify entries\n\t\tif (in_pendingChangeSet.modify) {\n\t\t\tvar modifiedPendingEntries = in_pendingChangeSet\n\t\t\t\t? in_pendingChangeSet.modify || {}\n\t\t\t\t: {};\n\t\t\tvar modifiedDirtyEntries = in_dirtyChangeSet ? in_dirtyChangeSet.modify || {} : {};\n\t\t\tkeys = Object.keys(modifiedPendingEntries).concat(Object.keys(modifiedDirtyEntries));\n\t\t\tfor (i = 0; i < keys.length; i++) {\n\t\t\t\tkey = keys[i];\n\t\t\t\tif (this._dynamicChildren[key] !== undefined) {\n\t\t\t\t\tif (modifiedPendingEntries[key]) {\n\t\t\t\t\t\tif (!this._pendingChanges.insert[key]) {\n\t\t\t\t\t\t\tthis._pendingChanges.modify[key] = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (modifiedDirtyEntries[key]) {\n\t\t\t\t\t\tif (!this._dirtyChanges.insert[key]) {\n\t\t\t\t\t\t\tthis._dirtyChanges.modify[key] = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error(MSG.MODIFY_NON_EXISTING_ENTRY + key);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If working with primitive types, we have to update the dirty flag, when one of the entries\n\t\t// was changed\n\t\tthis._setDirty(false);\n\t}\n}\n// The value map contains primitive types\nValueMapProperty.prototype._containsPrimitiveTypes = true;\n\n/**\n * A ValueMapProperty which stores Float32 values\n */\nexport class Float32MapProperty extends ValueMapProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueMapProperty\n\t * @alias property-properties.Float32MapProperty\n\t * @category Maps\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n}\nFloat32MapProperty.prototype._typeid = \"Float32\";\nFloat32MapProperty.prototype._castFunctor = _castFunctors.Float32;\n\n/**\n * A ValueMapProperty which stores Float64 values\n */\nexport class Float64MapProperty extends ValueMapProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueMapProperty\n\t * @alias property-properties.Float64MapProperty\n\t * @category Maps\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n}\nFloat64MapProperty.prototype._typeid = \"Float64\";\nFloat64MapProperty.prototype._castFunctor = _castFunctors.Float64;\n\n/**\n * A ValueMapProperty which stores Uint32 values\n */\nexport class Uint32MapProperty extends ValueMapProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueMapProperty\n\t * @alias property-properties.Uint32MapProperty\n\t * @category Maps\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n}\nUint32MapProperty.prototype._typeid = \"Uint32\";\nUint32MapProperty.prototype._castFunctor = _castFunctors.Uint32;\n\n/**\n * A ValueMapProperty which stores Uint16 values\n */\nexport class Uint16MapProperty extends ValueMapProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueMapProperty\n\t * @alias property-properties.Uint16MapProperty\n\t * @category Maps\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n}\nUint16MapProperty.prototype._typeid = \"Uint16\";\nUint16MapProperty.prototype._castFunctor = _castFunctors.Uint16;\n\n/**\n * A ValueMapProperty which stores Uint8 values\n */\nexport class Uint8MapProperty extends ValueMapProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueMapProperty\n\t * @alias property-properties.Uint8MapProperty\n\t * @category Maps\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n}\nUint8MapProperty.prototype._typeid = \"Uint8\";\nUint8MapProperty.prototype._castFunctor = _castFunctors.Uint8;\n\n/**\n * A ValueMapProperty which stores Int32 values\n */\nexport class Int32MapProperty extends ValueMapProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueMapProperty\n\t * @alias property-properties.Int32MapProperty\n\t * @category Maps\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n}\nInt32MapProperty.prototype._typeid = \"Int32\";\nInt32MapProperty.prototype._castFunctor = _castFunctors.Int32;\n\n/**\n * An abstract base class for 64 bit integer map properties\n */\nexport class Integer64MapProperty extends ValueMapProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueMapProperty\n\t * @alias property-properties.Integer64MapProperty\n\t * @category Maps\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n\n\t/**\n\t * Sets the entry with the given key to the value passed in\n\t *\n\t * Note: this will overwrite an already existing value\n\t *\n\t * @param {string} in_key - The key under which the entry is stored\n\t * @param {Int64|Uint64|string|number} in_value - The value or property to store in the map\n\t */\n\tset(in_key, in_value) {\n\t\tvar castedValue = this._castFunctor ? this._castFunctor(in_value) : in_value;\n\t\tvar myValue = this._dynamicChildren[in_key];\n\t\tif (myValue === undefined) {\n\t\t\tthis._insert(in_key, castedValue, true);\n\t\t} else if (\n\t\t\tmyValue.getValueHigh() !== castedValue.getValueHigh() ||\n\t\t\tmyValue.getValueLow() !== castedValue.getValueLow()\n\t\t) {\n\t\t\tthis._removeByKey(in_key, false);\n\t\t\tthis._insert(in_key, castedValue, false);\n\t\t\t// Make one final report\n\t\t\tthis._reportDirtinessToView();\n\t\t}\n\t}\n\n\t/**\n\t * Function to serialize special primitive types.\n\t * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n\t * special treatment on serialization. For supported types, we can just return the input here.\n\t *\n\t * @param {*} in_obj - The object to be serialized\n\t * @return {property-properties.SerializedChangeSet} the serialized object\n\t */\n\t_serializeValue(in_obj) {\n\t\treturn [in_obj.getValueLow(), in_obj.getValueHigh()];\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\t_prettyPrintChildren(indent, printFct) {\n\t\tindent += \" \";\n\t\tvar int64Prop;\n\t\t_.mapValues(this._dynamicChildren, function (val, key) {\n\t\t\t// TODO: The 'toString()' function is defined on Integer64Property, so we need to create\n\t\t\t// such object to use it. It would be better to have it in Utils Integer64.prototype.toString\n\t\t\tint64Prop = val instanceof Int64 ? new Int64Property({}) : new Uint64Property({});\n\t\t\tint64Prop.setValueLow(val.getValueLow());\n\t\t\tint64Prop.setValueHigh(val.getValueHigh());\n\t\t\tprintFct(indent + key + \": \" + int64Prop);\n\t\t});\n\t}\n}\n\n/**\n * A ValueMapProperty which stores Int64 Properties\n */\nexport class Int64MapProperty extends Integer64MapProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends Integer64MapProperty\n\t * @alias property-properties.Int64MapProperty\n\t * @category Maps\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n\n\t/**\n\t * Specialized function to deserialize Int64 primitive types.\n\t * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n\t * special treatment on deserialization. For supported types, we can just return the input here.\n\t *\n\t * @param {property-properties.SerializedChangeSet} in_serializedObj - The object to be deserialized\n\t * @return {Int64} the deserialized value\n\t */\n\t_deserializeValue(in_serializedObj) {\n\t\treturn new Int64(in_serializedObj[0], in_serializedObj[1]);\n\t}\n}\nInt64MapProperty.prototype._typeid = \"Int64\";\nInt64MapProperty.prototype._castFunctor = _castFunctors.Int64;\n\n/**\n * A ValueMapProperty which stores Uint64 Properties\n */\nexport class Uint64MapProperty extends Integer64MapProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends Integer64MapProperty\n\t * @alias property-properties.Uint64MapProperty\n\t * @category Maps\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n\n\t/**\n\t * Specialized function to deserialize Uint64 primitive types.\n\t * Some primitive types (e.g. Uint64, which is not natively supported by javascript) require\n\t * special treatment on deserialization. For supported types, we can just return the input here.\n\t *\n\t * @param {property-properties.SerializedChangeSet} in_serializedObj - The object to be deserialized\n\t * @return {Uint64} the deserialized value\n\t */\n\t_deserializeValue(in_serializedObj) {\n\t\treturn new Uint64(in_serializedObj[0], in_serializedObj[1]);\n\t}\n}\nUint64MapProperty.prototype._typeid = \"Uint64\";\nUint64MapProperty.prototype._castFunctor = _castFunctors.Uint64;\n\n/**\n * A ValueMapProperty which stores Int16 values\n */\nexport class Int16MapProperty extends ValueMapProperty {\n\t/** @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueMapProperty\n\t * @alias property-properties.Int16MapProperty\n\t * @category Maps\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n}\nInt16MapProperty.prototype._typeid = \"Int16\";\nInt16MapProperty.prototype._castFunctor = _castFunctors.Int16;\n\n/**\n * A ValueMapProperty which stores Int8 values\n */\nexport class Int8MapProperty extends ValueMapProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueMapProperty\n\t * @alias property-properties.Int8MapProperty\n\t * @category Maps\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n}\nInt8MapProperty.prototype._typeid = \"Int8\";\nInt8MapProperty.prototype._castFunctor = _castFunctors.Int8;\n\n/**\n * A ValueMapProperty which stores string values\n */\nexport class StringMapProperty extends ValueMapProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueMapProperty\n\t * @alias property-properties.StringMapProperty\n\t * @category Maps\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n}\nStringMapProperty.prototype._typeid = \"String\";\nStringMapProperty.prototype._castFunctor = _castFunctors.String;\n\n/**\n * A ValueMapProperty which stores boolean values\n */\nexport class BoolMapProperty extends ValueMapProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueMapProperty\n\t * @alias property-properties.BoolMapProperty\n\t * @category Maps\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n}\nBoolMapProperty.prototype._typeid = \"Bool\";\nBoolMapProperty.prototype._castFunctor = _castFunctors.Boolean;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valueProperty.d.ts","sourceRoot":"","sources":["../../src/properties/valueProperty.js"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH;
|
|
1
|
+
{"version":3,"file":"valueProperty.d.ts","sourceRoot":"","sources":["../../src/properties/valueProperty.js"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH;IACC;;;;;;;;;;;;OAYG;IACH,wBAGC;IADA,WAAsB;IAcvB;;;OAGG;IACH,gBAEC;IAYD;;;OAGG;IACH,8BAGC;IAED;;;;;;;OAOG;IACH,2CAJW,OAAO,GAEN,OAAO,CAelB;IAqGD,oBAEC;IALD,iBAEC;CAID"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
const { ChangeSet } = require(
|
|
6
|
-
const { MSG } = require(
|
|
7
|
-
const { BaseProperty } = require(
|
|
5
|
+
const { ChangeSet } = require("@fluid-experimental/property-changeset");
|
|
6
|
+
const { MSG } = require("@fluid-experimental/property-common").constants;
|
|
7
|
+
const { BaseProperty } = require("./baseProperty");
|
|
8
8
|
/**
|
|
9
9
|
* This class serves as a view to read, write and listen to changes in an
|
|
10
10
|
* object's value field. To do this we simply keep a pointer to the object and
|
|
@@ -104,7 +104,7 @@ export class ValueProperty extends BaseProperty {
|
|
|
104
104
|
_applyChangeset(in_changeSet, in_reportToView, in_filteringOptions) {
|
|
105
105
|
if (!ChangeSet.isEmptyChangeSet(in_changeSet)) {
|
|
106
106
|
var newVal = in_changeSet;
|
|
107
|
-
if (typeof newVal ===
|
|
107
|
+
if (typeof newVal === "object") {
|
|
108
108
|
newVal = newVal.value;
|
|
109
109
|
}
|
|
110
110
|
this._setValue(newVal, in_reportToView);
|
|
@@ -114,10 +114,12 @@ export class ValueProperty extends BaseProperty {
|
|
|
114
114
|
* @inheritdoc
|
|
115
115
|
*/
|
|
116
116
|
_reapplyDirtyFlags(in_pendingChangeSet, in_dirtyChangeSet) {
|
|
117
|
-
const flags = (ChangeSet.isEmptyChangeSet(in_pendingChangeSet)
|
|
118
|
-
BaseProperty.MODIFIED_STATE_FLAGS.CLEAN
|
|
119
|
-
|
|
120
|
-
|
|
117
|
+
const flags = (ChangeSet.isEmptyChangeSet(in_pendingChangeSet)
|
|
118
|
+
? BaseProperty.MODIFIED_STATE_FLAGS.CLEAN
|
|
119
|
+
: BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE) |
|
|
120
|
+
(ChangeSet.isEmptyChangeSet(in_dirtyChangeSet)
|
|
121
|
+
? BaseProperty.MODIFIED_STATE_FLAGS.CLEAN
|
|
122
|
+
: BaseProperty.MODIFIED_STATE_FLAGS.DIRTY);
|
|
121
123
|
if (flags) {
|
|
122
124
|
this._setDirty(false, this, flags);
|
|
123
125
|
}
|
|
@@ -153,7 +155,7 @@ export class ValueProperty extends BaseProperty {
|
|
|
153
155
|
* @param {function} printFct - Function to call for printing each property
|
|
154
156
|
*/
|
|
155
157
|
_prettyPrint(indent, externalId, printFct) {
|
|
156
|
-
printFct(indent + externalId + this.getId() +
|
|
158
|
+
printFct(indent + externalId + this.getId() + " (" + this.getTypeid() + "): " + this.value);
|
|
157
159
|
}
|
|
158
160
|
/**
|
|
159
161
|
* Return a JSON representation of the property.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valueProperty.js","sourceRoot":"","sources":["../../src/properties/valueProperty.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AACxE,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC;AACzE,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,OAAO,aAAc,SAAQ,YAAY;IAC3C;;;;;;;;;;;;OAYG;IACH,YAAY,SAAS;QACjB,KAAK,CAAC,SAAS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L,CAAC;IAED;;;;;;OAMG;IACH,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ;QACrC,QAAQ,CAAC,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC,KAAK,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,SAAS,EAAE,GAAG,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;IAChG,CAAC;IAED;;;;OAIG;IACH,OAAO;QACH,OAAO;YACH,EAAE,EAAE,IAAI,CAAC,KAAK,EAAE;YAChB,OAAO,EAAE,IAAI,CAAC,QAAQ;YACtB,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE;YACxB,UAAU,EAAE,IAAI,CAAC,WAAW;YAC5B,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE;SACzB,CAAC;IACN,CAAC;IAED,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAChD,CAAC;IACD,IAAI,KAAK,CAAC,GAAG;QACT,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAClC,CAAC;CACJ","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nconst { ChangeSet } = require('@fluid-experimental/property-changeset');\nconst { MSG } = require('@fluid-experimental/property-common').constants;\nconst { BaseProperty } = require('./baseProperty');\n\n/**\n * This class serves as a view to read, write and listen to changes in an\n * object's value field. To do this we simply keep a pointer to the object and\n * its associated data field that we are interested in. If no data field is\n * present this property will fail constructing.\n */\nexport class ValueProperty extends BaseProperty {\n /**\n * @virtual\n * @param {Object=} in_params - The parameters\n * @param {Object=} in_params.dataObj - Optional argument containing an object that should be used as the backing\n * store of this value property.\n * @param {Object=} in_params.dataId - optional argument must be provided when in_params.dataObj is passed. Must\n * contain a valid member name of dataObj. This member will be used to set/get values of this value property.\n * @constructor\n * @protected\n * @extends property-properties.BaseProperty\n * @alias property-properties.ValueProperty\n * @category Value Properties\n */\n constructor(in_params) {\n super(in_params);\n this._data = undefined;\n }\n\n /**\n * Is this property a leaf node with regard to flattening?\n *\n * TODO: Which semantics should flattening have? It stops at primitive types and collections?\n *\n * @return {boolean} Is it a leaf with regard to flattening?\n */\n _isFlattenLeaf() {\n return true;\n }\n\n /**\n * returns the current value of ValueProperty\n * @return {*} the current value\n */\n getValue() {\n return this._data;\n }\n\n /**\n * Ensure the array dirty mask is also cleaned when cleaning the tree.\n *\n * @param {property-properties.BaseProperty.MODIFIED_STATE_FLAGS} [in_flags] - The flags to clean.\n * If none are supplied all will be removed.\n */\n cleanDirty(in_flags) {\n this._cleanDirty(in_flags);\n }\n\n /**\n * @param {*} in_value - The new value\n * @throws If property is read only\n */\n setValue(in_value) {\n this._checkIsNotReadOnly(true);\n this._setValue(in_value, true);\n }\n\n /**\n * Internal function to update the value of a property\n *\n * @param {*} in_value - The new value\n * @param {boolean} [in_reportToView = true] - By default, the dirtying will always be reported to the checkout view\n * and trigger a modified event there. When batching updates, this can be prevented via this flag.\n * @return {boolean} true if the value was actually changed\n */\n _setValue(in_value, in_reportToView) {\n // dirtiness check: setValue casts the input e.g. in an\n // int property 1.2 gets cast to 1, in a boolean property\n // false gets cast to 0,... so we first have to cast(set)\n // and then compare the value here:\n var oldValue = this._data;\n var castedValue = this._castFunctor(in_value);\n var changed = castedValue !== oldValue;\n if (changed) {\n this._data = castedValue;\n this._setDirty(in_reportToView);\n }\n return changed;\n }\n\n /**\n * @inheritdoc\n */\n _deserialize(in_serializedObj, in_reportToView,\n in_filteringOptions, in_createChangeSet) {\n if (ChangeSet.isEmptyChangeSet(in_serializedObj)) {\n console.warn(MSG.DESERIALIZE_EMPTY_CHANGESET);\n return undefined;\n } else {\n var changed = this._setValue(in_serializedObj, in_reportToView);\n return changed ? this._data : undefined;\n }\n }\n\n /**\n * @inheritdoc\n */\n _applyChangeset(in_changeSet, in_reportToView, in_filteringOptions) {\n if (!ChangeSet.isEmptyChangeSet(in_changeSet)) {\n var newVal = in_changeSet;\n if (typeof newVal === 'object') {\n newVal = newVal.value;\n }\n this._setValue(newVal, in_reportToView);\n }\n }\n\n /**\n * @inheritdoc\n */\n _reapplyDirtyFlags(in_pendingChangeSet, in_dirtyChangeSet) {\n const flags = (ChangeSet.isEmptyChangeSet(in_pendingChangeSet) ?\n BaseProperty.MODIFIED_STATE_FLAGS.CLEAN : BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE) |\n (ChangeSet.isEmptyChangeSet(in_dirtyChangeSet) ?\n BaseProperty.MODIFIED_STATE_FLAGS.CLEAN : BaseProperty.MODIFIED_STATE_FLAGS.DIRTY);\n if (flags) {\n this._setDirty(false, this, flags);\n }\n }\n\n /**\n * Serialize the property\n *\n * @param {boolean} in_dirtyOnly - Only include dirty entries in the serialization\n * @param {boolean} in_includeRootTypeid - Include the typeid of the root of the hierarchy.\n * Has no effect for ValueProperty\n * @param {property-properties.BaseProperty.MODIFIED_STATE_FLAGS} [in_dirtinessType] -\n * The type of dirtiness to use when reporting dirty changes. By default this is `PENDING_CHANGE`.\n * @param {boolean} [in_includeReferencedRepositories=false] - If this is set to true, the serialize\n * function will descend into referenced repositories. WARNING: if there are loops in the references\n * this can result in an infinite loop\n *\n * @return {*} The serialized representation of this property\n * @private\n */\n _serialize(in_dirtyOnly, in_includeRootTypeid,\n in_dirtinessType, in_includeReferencedRepositories) {\n if (in_dirtyOnly) {\n return this._isDirty(in_dirtinessType) ? this._data : {};\n } else {\n return this._data;\n }\n }\n\n /**\n * Calls back the given function with a human-readable string\n * representation of the property.\n * @param {string} indent - Leading spaces to create the tree representation\n * @param {string} externalId - Name of the current property at the upper level. Used for arrays.\n * @param {function} printFct - Function to call for printing each property\n */\n _prettyPrint(indent, externalId, printFct) {\n printFct(indent + externalId + this.getId() + ' (' + this.getTypeid() + '): ' + this.value);\n }\n\n /**\n * Return a JSON representation of the property.\n * @return {object} A JSON representation of the property.\n * @private\n */\n _toJson() {\n return {\n id: this.getId(),\n context: this._context,\n typeid: this.getTypeid(),\n isConstant: this._isConstant,\n value: this.getValue(),\n };\n }\n\n get value() {\n return this.getValue.apply(this, arguments);\n }\n set value(val) {\n this.setValue.call(this, val);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"valueProperty.js","sourceRoot":"","sources":["../../src/properties/valueProperty.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AACxE,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC;AACzE,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,OAAO,aAAc,SAAQ,YAAY;IAC9C;;;;;;;;;;;;OAYG;IACH,YAAY,SAAS;QACpB,KAAK,CAAC,SAAS,CAAC,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;IACxB,CAAC;IAED;;;;;;OAMG;IACH,cAAc;QACb,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;OAGG;IACH,QAAQ;QACP,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IAED;;;;;OAKG;IACH,UAAU,CAAC,QAAQ;QAClB,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACH,QAAQ,CAAC,QAAQ;QAChB,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAC/B,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAChC,CAAC;IAED;;;;;;;OAOG;IACH,SAAS,CAAC,QAAQ,EAAE,eAAe;QAClC,uDAAuD;QACvD,yDAAyD;QACzD,yDAAyD;QACzD,mCAAmC;QACnC,IAAI,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC;QAC1B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QACZ,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC/B,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nconst { ChangeSet } = require(\"@fluid-experimental/property-changeset\");\nconst { MSG } = require(\"@fluid-experimental/property-common\").constants;\nconst { BaseProperty } = require(\"./baseProperty\");\n\n/**\n * This class serves as a view to read, write and listen to changes in an\n * object's value field. To do this we simply keep a pointer to the object and\n * its associated data field that we are interested in. If no data field is\n * present this property will fail constructing.\n */\nexport class ValueProperty extends BaseProperty {\n\t/**\n\t * @virtual\n\t * @param {Object=} in_params - The parameters\n\t * @param {Object=} in_params.dataObj - Optional argument containing an object that should be used as the backing\n\t * store of this value property.\n\t * @param {Object=} in_params.dataId - optional argument must be provided when in_params.dataObj is passed. Must\n\t * contain a valid member name of dataObj. This member will be used to set/get values of this value property.\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.BaseProperty\n\t * @alias property-properties.ValueProperty\n\t * @category Value Properties\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t\tthis._data = undefined;\n\t}\n\n\t/**\n\t * Is this property a leaf node with regard to flattening?\n\t *\n\t * TODO: Which semantics should flattening have? It stops at primitive types and collections?\n\t *\n\t * @return {boolean} Is it a leaf with regard to flattening?\n\t */\n\t_isFlattenLeaf() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * returns the current value of ValueProperty\n\t * @return {*} the current value\n\t */\n\tgetValue() {\n\t\treturn this._data;\n\t}\n\n\t/**\n\t * Ensure the array dirty mask is also cleaned when cleaning the tree.\n\t *\n\t * @param {property-properties.BaseProperty.MODIFIED_STATE_FLAGS} [in_flags] - The flags to clean.\n\t * If none are supplied all will be removed.\n\t */\n\tcleanDirty(in_flags) {\n\t\tthis._cleanDirty(in_flags);\n\t}\n\n\t/**\n\t * @param {*} in_value - The new value\n\t * @throws If property is read only\n\t */\n\tsetValue(in_value) {\n\t\tthis._checkIsNotReadOnly(true);\n\t\tthis._setValue(in_value, true);\n\t}\n\n\t/**\n\t * Internal function to update the value of a property\n\t *\n\t * @param {*} in_value - The new value\n\t * @param {boolean} [in_reportToView = true] - By default, the dirtying will always be reported to the checkout view\n\t * and trigger a modified event there. When batching updates, this can be prevented via this flag.\n\t * @return {boolean} true if the value was actually changed\n\t */\n\t_setValue(in_value, in_reportToView) {\n\t\t// dirtiness check: setValue casts the input e.g. in an\n\t\t// int property 1.2 gets cast to 1, in a boolean property\n\t\t// false gets cast to 0,... so we first have to cast(set)\n\t\t// and then compare the value here:\n\t\tvar oldValue = this._data;\n\t\tvar castedValue = this._castFunctor(in_value);\n\t\tvar changed = castedValue !== oldValue;\n\t\tif (changed) {\n\t\t\tthis._data = castedValue;\n\t\t\tthis._setDirty(in_reportToView);\n\t\t}\n\t\treturn changed;\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\t_deserialize(in_serializedObj, in_reportToView, in_filteringOptions, in_createChangeSet) {\n\t\tif (ChangeSet.isEmptyChangeSet(in_serializedObj)) {\n\t\t\tconsole.warn(MSG.DESERIALIZE_EMPTY_CHANGESET);\n\t\t\treturn undefined;\n\t\t} else {\n\t\t\tvar changed = this._setValue(in_serializedObj, in_reportToView);\n\t\t\treturn changed ? this._data : undefined;\n\t\t}\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\t_applyChangeset(in_changeSet, in_reportToView, in_filteringOptions) {\n\t\tif (!ChangeSet.isEmptyChangeSet(in_changeSet)) {\n\t\t\tvar newVal = in_changeSet;\n\t\t\tif (typeof newVal === \"object\") {\n\t\t\t\tnewVal = newVal.value;\n\t\t\t}\n\t\t\tthis._setValue(newVal, in_reportToView);\n\t\t}\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\t_reapplyDirtyFlags(in_pendingChangeSet, in_dirtyChangeSet) {\n\t\tconst flags =\n\t\t\t(ChangeSet.isEmptyChangeSet(in_pendingChangeSet)\n\t\t\t\t? BaseProperty.MODIFIED_STATE_FLAGS.CLEAN\n\t\t\t\t: BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE) |\n\t\t\t(ChangeSet.isEmptyChangeSet(in_dirtyChangeSet)\n\t\t\t\t? BaseProperty.MODIFIED_STATE_FLAGS.CLEAN\n\t\t\t\t: BaseProperty.MODIFIED_STATE_FLAGS.DIRTY);\n\t\tif (flags) {\n\t\t\tthis._setDirty(false, this, flags);\n\t\t}\n\t}\n\n\t/**\n\t * Serialize the property\n\t *\n\t * @param {boolean} in_dirtyOnly - Only include dirty entries in the serialization\n\t * @param {boolean} in_includeRootTypeid - Include the typeid of the root of the hierarchy.\n\t * Has no effect for ValueProperty\n\t * @param {property-properties.BaseProperty.MODIFIED_STATE_FLAGS} [in_dirtinessType] -\n\t * The type of dirtiness to use when reporting dirty changes. By default this is `PENDING_CHANGE`.\n\t * @param {boolean} [in_includeReferencedRepositories=false] - If this is set to true, the serialize\n\t * function will descend into referenced repositories. WARNING: if there are loops in the references\n\t * this can result in an infinite loop\n\t *\n\t * @return {*} The serialized representation of this property\n\t * @private\n\t */\n\t_serialize(\n\t\tin_dirtyOnly,\n\t\tin_includeRootTypeid,\n\t\tin_dirtinessType,\n\t\tin_includeReferencedRepositories,\n\t) {\n\t\tif (in_dirtyOnly) {\n\t\t\treturn this._isDirty(in_dirtinessType) ? this._data : {};\n\t\t} else {\n\t\t\treturn this._data;\n\t\t}\n\t}\n\n\t/**\n\t * Calls back the given function with a human-readable string\n\t * representation of the property.\n\t * @param {string} indent - Leading spaces to create the tree representation\n\t * @param {string} externalId - Name of the current property at the upper level. Used for arrays.\n\t * @param {function} printFct - Function to call for printing each property\n\t */\n\t_prettyPrint(indent, externalId, printFct) {\n\t\tprintFct(indent + externalId + this.getId() + \" (\" + this.getTypeid() + \"): \" + this.value);\n\t}\n\n\t/**\n\t * Return a JSON representation of the property.\n\t * @return {object} A JSON representation of the property.\n\t * @private\n\t */\n\t_toJson() {\n\t\treturn {\n\t\t\tid: this.getId(),\n\t\t\tcontext: this._context,\n\t\t\ttypeid: this.getTypeid(),\n\t\t\tisConstant: this._isConstant,\n\t\t\tvalue: this.getValue(),\n\t\t};\n\t}\n\n\tget value() {\n\t\treturn this.getValue.apply(this, arguments);\n\t}\n\tset value(val) {\n\t\tthis.setValue.call(this, val);\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propertyFactory.d.ts","sourceRoot":"","sources":["../src/propertyFactory.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"propertyFactory.d.ts","sourceRoot":"","sources":["../src/propertyFactory.js"],"names":[],"mappings":";AAk5EA,4CAAuD"}
|