@fluid-experimental/property-properties 2.0.0-dev.7.4.0.215930 → 2.0.0-dev.7.4.0.217212

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.
Files changed (162) hide show
  1. package/dist/enableValidations.d.ts +1 -0
  2. package/dist/enableValidations.d.ts.map +1 -1
  3. package/dist/enableValidations.js +1 -0
  4. package/dist/enableValidations.js.map +1 -1
  5. package/dist/properties/arrayProperty.d.ts +3 -0
  6. package/dist/properties/arrayProperty.d.ts.map +1 -1
  7. package/dist/properties/arrayProperty.js +3 -0
  8. package/dist/properties/arrayProperty.js.map +1 -1
  9. package/dist/properties/baseProperty.d.ts +1 -0
  10. package/dist/properties/baseProperty.d.ts.map +1 -1
  11. package/dist/properties/baseProperty.js +1 -0
  12. package/dist/properties/baseProperty.js.map +1 -1
  13. package/dist/properties/containerProperty.d.ts +1 -0
  14. package/dist/properties/containerProperty.d.ts.map +1 -1
  15. package/dist/properties/containerProperty.js +1 -0
  16. package/dist/properties/containerProperty.js.map +1 -1
  17. package/dist/properties/enumArrayProperty.d.ts +1 -0
  18. package/dist/properties/enumArrayProperty.d.ts.map +1 -1
  19. package/dist/properties/enumArrayProperty.js +1 -0
  20. package/dist/properties/enumArrayProperty.js.map +1 -1
  21. package/dist/properties/enumProperty.d.ts +1 -0
  22. package/dist/properties/enumProperty.d.ts.map +1 -1
  23. package/dist/properties/enumProperty.js +1 -0
  24. package/dist/properties/enumProperty.js.map +1 -1
  25. package/dist/properties/intProperties.d.ts +2 -0
  26. package/dist/properties/intProperties.d.ts.map +1 -1
  27. package/dist/properties/intProperties.js +2 -0
  28. package/dist/properties/intProperties.js.map +1 -1
  29. package/dist/properties/mapProperty.d.ts +1 -0
  30. package/dist/properties/mapProperty.d.ts.map +1 -1
  31. package/dist/properties/mapProperty.js +1 -0
  32. package/dist/properties/mapProperty.js.map +1 -1
  33. package/dist/properties/nodeProperty.d.ts +1 -0
  34. package/dist/properties/nodeProperty.d.ts.map +1 -1
  35. package/dist/properties/nodeProperty.js +1 -0
  36. package/dist/properties/nodeProperty.js.map +1 -1
  37. package/dist/properties/referenceArrayProperty.d.ts +1 -0
  38. package/dist/properties/referenceArrayProperty.d.ts.map +1 -1
  39. package/dist/properties/referenceArrayProperty.js +1 -0
  40. package/dist/properties/referenceArrayProperty.js.map +1 -1
  41. package/dist/properties/referenceMapProperty.d.ts +1 -0
  42. package/dist/properties/referenceMapProperty.d.ts.map +1 -1
  43. package/dist/properties/referenceMapProperty.js +1 -0
  44. package/dist/properties/referenceMapProperty.js.map +1 -1
  45. package/dist/properties/referenceProperty.d.ts +1 -0
  46. package/dist/properties/referenceProperty.d.ts.map +1 -1
  47. package/dist/properties/referenceProperty.js +1 -0
  48. package/dist/properties/referenceProperty.js.map +1 -1
  49. package/dist/properties/setProperty.d.ts +1 -0
  50. package/dist/properties/setProperty.d.ts.map +1 -1
  51. package/dist/properties/setProperty.js +1 -0
  52. package/dist/properties/setProperty.js.map +1 -1
  53. package/dist/properties/stringProperty.d.ts +1 -0
  54. package/dist/properties/stringProperty.d.ts.map +1 -1
  55. package/dist/properties/stringProperty.js +1 -0
  56. package/dist/properties/stringProperty.js.map +1 -1
  57. package/dist/properties/valueArrayProperty.d.ts +1 -0
  58. package/dist/properties/valueArrayProperty.d.ts.map +1 -1
  59. package/dist/properties/valueArrayProperty.js +1 -0
  60. package/dist/properties/valueArrayProperty.js.map +1 -1
  61. package/dist/properties/valueMapProperty.d.ts +1 -0
  62. package/dist/properties/valueMapProperty.d.ts.map +1 -1
  63. package/dist/properties/valueMapProperty.js +1 -0
  64. package/dist/properties/valueMapProperty.js.map +1 -1
  65. package/dist/properties/valueProperty.d.ts +1 -0
  66. package/dist/properties/valueProperty.d.ts.map +1 -1
  67. package/dist/properties/valueProperty.js +1 -0
  68. package/dist/properties/valueProperty.js.map +1 -1
  69. package/dist/propertyFactory.d.ts +3 -0
  70. package/dist/propertyFactory.d.ts.map +1 -1
  71. package/dist/propertyFactory.js +3 -0
  72. package/dist/propertyFactory.js.map +1 -1
  73. package/dist/propertyTemplate.d.ts +5 -6
  74. package/dist/propertyTemplate.d.ts.map +1 -1
  75. package/dist/propertyTemplate.js +3 -4
  76. package/dist/propertyTemplate.js.map +1 -1
  77. package/dist/propertyUtils.d.ts +3 -0
  78. package/dist/propertyUtils.d.ts.map +1 -1
  79. package/dist/propertyUtils.js +3 -0
  80. package/dist/propertyUtils.js.map +1 -1
  81. package/dist/test/tsconfig.tsbuildinfo +1 -1
  82. package/lib/enableValidations.d.ts +1 -0
  83. package/lib/enableValidations.d.ts.map +1 -1
  84. package/lib/enableValidations.js +1 -0
  85. package/lib/enableValidations.js.map +1 -1
  86. package/lib/properties/arrayProperty.d.ts +3 -0
  87. package/lib/properties/arrayProperty.d.ts.map +1 -1
  88. package/lib/properties/arrayProperty.js +3 -0
  89. package/lib/properties/arrayProperty.js.map +1 -1
  90. package/lib/properties/baseProperty.d.ts +1 -0
  91. package/lib/properties/baseProperty.d.ts.map +1 -1
  92. package/lib/properties/baseProperty.js +1 -0
  93. package/lib/properties/baseProperty.js.map +1 -1
  94. package/lib/properties/containerProperty.d.ts +1 -0
  95. package/lib/properties/containerProperty.d.ts.map +1 -1
  96. package/lib/properties/containerProperty.js +1 -0
  97. package/lib/properties/containerProperty.js.map +1 -1
  98. package/lib/properties/enumArrayProperty.d.ts +1 -0
  99. package/lib/properties/enumArrayProperty.d.ts.map +1 -1
  100. package/lib/properties/enumArrayProperty.js +1 -0
  101. package/lib/properties/enumArrayProperty.js.map +1 -1
  102. package/lib/properties/enumProperty.d.ts +1 -0
  103. package/lib/properties/enumProperty.d.ts.map +1 -1
  104. package/lib/properties/enumProperty.js +1 -0
  105. package/lib/properties/enumProperty.js.map +1 -1
  106. package/lib/properties/intProperties.d.ts +2 -0
  107. package/lib/properties/intProperties.d.ts.map +1 -1
  108. package/lib/properties/intProperties.js +2 -0
  109. package/lib/properties/intProperties.js.map +1 -1
  110. package/lib/properties/mapProperty.d.ts +1 -0
  111. package/lib/properties/mapProperty.d.ts.map +1 -1
  112. package/lib/properties/mapProperty.js +1 -0
  113. package/lib/properties/mapProperty.js.map +1 -1
  114. package/lib/properties/nodeProperty.d.ts +1 -0
  115. package/lib/properties/nodeProperty.d.ts.map +1 -1
  116. package/lib/properties/nodeProperty.js +1 -0
  117. package/lib/properties/nodeProperty.js.map +1 -1
  118. package/lib/properties/referenceArrayProperty.d.ts +1 -0
  119. package/lib/properties/referenceArrayProperty.d.ts.map +1 -1
  120. package/lib/properties/referenceArrayProperty.js +1 -0
  121. package/lib/properties/referenceArrayProperty.js.map +1 -1
  122. package/lib/properties/referenceMapProperty.d.ts +1 -0
  123. package/lib/properties/referenceMapProperty.d.ts.map +1 -1
  124. package/lib/properties/referenceMapProperty.js +1 -0
  125. package/lib/properties/referenceMapProperty.js.map +1 -1
  126. package/lib/properties/referenceProperty.d.ts +1 -0
  127. package/lib/properties/referenceProperty.d.ts.map +1 -1
  128. package/lib/properties/referenceProperty.js +1 -0
  129. package/lib/properties/referenceProperty.js.map +1 -1
  130. package/lib/properties/setProperty.d.ts +1 -0
  131. package/lib/properties/setProperty.d.ts.map +1 -1
  132. package/lib/properties/setProperty.js +1 -0
  133. package/lib/properties/setProperty.js.map +1 -1
  134. package/lib/properties/stringProperty.d.ts +1 -0
  135. package/lib/properties/stringProperty.d.ts.map +1 -1
  136. package/lib/properties/stringProperty.js +1 -0
  137. package/lib/properties/stringProperty.js.map +1 -1
  138. package/lib/properties/valueArrayProperty.d.ts +1 -0
  139. package/lib/properties/valueArrayProperty.d.ts.map +1 -1
  140. package/lib/properties/valueArrayProperty.js +1 -0
  141. package/lib/properties/valueArrayProperty.js.map +1 -1
  142. package/lib/properties/valueMapProperty.d.ts +1 -0
  143. package/lib/properties/valueMapProperty.d.ts.map +1 -1
  144. package/lib/properties/valueMapProperty.js +1 -0
  145. package/lib/properties/valueMapProperty.js.map +1 -1
  146. package/lib/properties/valueProperty.d.ts +1 -0
  147. package/lib/properties/valueProperty.d.ts.map +1 -1
  148. package/lib/properties/valueProperty.js +1 -0
  149. package/lib/properties/valueProperty.js.map +1 -1
  150. package/lib/propertyFactory.d.ts +3 -0
  151. package/lib/propertyFactory.d.ts.map +1 -1
  152. package/lib/propertyFactory.js +3 -0
  153. package/lib/propertyFactory.js.map +1 -1
  154. package/lib/propertyTemplate.d.ts +5 -6
  155. package/lib/propertyTemplate.d.ts.map +1 -1
  156. package/lib/propertyTemplate.js +3 -4
  157. package/lib/propertyTemplate.js.map +1 -1
  158. package/lib/propertyUtils.d.ts +3 -0
  159. package/lib/propertyUtils.d.ts.map +1 -1
  160. package/lib/propertyUtils.js +3 -0
  161. package/lib/propertyUtils.js.map +1 -1
  162. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"intProperties.d.ts","sourceRoot":"","sources":["../../src/properties/intProperties.js"],"names":[],"mappings":"AAsBA;IAaE,cAAc;IAIhB,kBAAmC;CAFlC;AAID;;GAEG;AACH;IAYE,cAAc;IAIhB,kBAAoC;CAFnC;AAID;;GAEG;AACH;IAYE,cAAc;IAIhB,kBAAoC;CAFnC;AAID;;GAEG;AACH;IACC;;;;;;;;OAQG;IACH,wBAKC;IAHA,qBAAsC;IAKvC;;;;;;;;OAQG;IACH,oBANW,KAAK,kBAAc,oBACnB,OAAO,GAEN,OAAO,CAmBlB;IAED;;OAEG;IACH,gBAFY,MAAM,CAIjB;IAED;;OAEG;IACH,eAFY,MAAM,CAIjB;IAED;;;;OAIG;IACH,sBAJW,MAAM,GAEL,OAAO,CAYlB;IAED;;;;OAIG;IACH,oBAJW,MAAM,GAEL,OAAO,CAYlB;IAED;;OAEG;IACH,qHAYC;IAiDD;;;;;;OAMG;IACH,oBAJW,MAAM,GAEL,MAAM,CAIjB;IAED;;;;;;;;;;OAUG;IACH,sBARW,MAAM,aACN,MAAM,QAahB;CACD;AAED;;GAEG;AACH;IACC;;;;;;;OAOG;IACH,wBAEC;IAGF,8DAAoC;CAFnC;AAID;;GAEG;AACH;IACC;;;;;;;OAOG;IACH,wBAEC;IAGF,8DAAqC;CAFpC"}
1
+ {"version":3,"file":"intProperties.d.ts","sourceRoot":"","sources":["../../src/properties/intProperties.js"],"names":[],"mappings":"AAsBA;IAaE,cAAc;IAIhB,kBAAmC;CAFlC;AAID;;GAEG;AACH;IAYE,cAAc;IAIhB,kBAAoC;CAFnC;AAID;;GAEG;AACH;IAYE,cAAc;IAIhB,kBAAoC;CAFnC;AAID;;GAEG;AACH;IACC;;;;;;;;OAQG;IACH,wBAKC;IAHA,qBAAsC;IAKvC;;;;;;;;OAQG;IACH,oBANW,KAAK,kBAAc,oBACnB,OAAO,GAEN,OAAO,CAmBlB;IAED;;OAEG;IACH,gBAFY,MAAM,CAIjB;IAED;;OAEG;IACH,eAFY,MAAM,CAIjB;IAED;;;;OAIG;IACH,sBAJW,MAAM,GAEL,OAAO,CAYlB;IAED;;;;OAIG;IACH,oBAJW,MAAM,GAEL,OAAO,CAYlB;IAED;;OAEG;IACH,qHAYC;IAiDD;;;;;;OAMG;IACH,oBAJW,MAAM,GAEL,MAAM,CAIjB;IAED;;;;;;;;;;OAUG;IACH,sBARW,MAAM,aACN,MAAM,QAahB;CACD;AAED;;;GAGG;AACH;IACC;;;;;;;OAOG;IACH,wBAEC;IAGF,8DAAoC;CAFnC;AAID;;;GAGG;AACH;IACC;;;;;;;OAOG;IACH,wBAEC;IAGF,8DAAqC;CAFpC"}
@@ -241,6 +241,7 @@ class Integer64Property extends ValueProperty {
241
241
  exports.Integer64Property = Integer64Property;
242
242
  /**
243
243
  * A primitive property class for big signed integer values.
244
+ * @internal
244
245
  */
245
246
  class Int64Property extends Integer64Property {
246
247
  /**
@@ -260,6 +261,7 @@ Int64Property.prototype._typeid = "Int64";
260
261
  Int64Property.prototype._castFunctor = _castFunctors.Int64;
261
262
  /**
262
263
  * A primitive property class for big unsingned integer values.
264
+ * @internal
263
265
  */
264
266
  class Uint64Property extends Integer64Property {
265
267
  /**
@@ -1 +1 @@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C,SAAS,CAAC,OAAO,GAAG,QAAQ,CAAC;AAC5C,cAAc,CAAC,SAAS,CAAC,YAAY,GAAG,aAAa,CAAC,MAAM,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Definition of the Int*Property classes\n */\n\nconst _ = require(\"lodash\");\nconst { ChangeSet } = require(\"@fluid-experimental/property-changeset\");\nconst {\n\tConsoleUtils,\n\tconstants: { MSG },\n\tUint64,\n\tInt64,\n} = require(\"@fluid-experimental/property-common\");\nconst { ValueProperty } = require(\"./valueProperty\");\nconst { _castFunctors } = require(\"./primitiveTypeCasts\");\n\nconst BIT32 = 4294967296;\n\nexport class Int8Property extends ValueProperty {\n\t/**\n\t * A primitive property for an signed 8 bit integer value.\n\t * @param {Object=} in_params - the parameters\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueProperty\n\t * @alias property-properties.Int8Property\n\t * @category Value Properties\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t\t// default for this property type is '0'\n\t\tthis._data = 0;\n\t}\n}\nInt8Property.prototype._typeid = \"Int8\";\nInt8Property.prototype._castFunctor = _castFunctors.Int8;\n\n/**\n * A primitive property for an signed 16 bit integer value.\n */\nexport class Int16Property extends ValueProperty {\n\t/**\n\t * @param {Object=} in_params - the parameters\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueProperty\n\t * @alias property-properties.Int16Property\n\t * @category Value Properties\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t\t// default for this property type is '0'\n\t\tthis._data = 0;\n\t}\n}\nInt16Property.prototype._typeid = \"Int16\";\nInt16Property.prototype._castFunctor = _castFunctors.Int16;\n\n/**\n * A primitive property for an signed 32 bit integer value.\n */\nexport class Int32Property extends ValueProperty {\n\t/**\n\t * @param {Object=} in_params - the parameters\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueProperty\n\t * @alias property-properties.Int32Property\n\t * @category Value Properties\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t\t// default for this property type is '0'\n\t\tthis._data = 0;\n\t}\n}\nInt32Property.prototype._typeid = \"Int32\";\nInt32Property.prototype._castFunctor = _castFunctors.Int32;\n\n/**\n * A primitive property base class for big integer values.\n */\nexport class Integer64Property extends ValueProperty {\n\t/**\n\t * @param {Object=} in_params - the parameters\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueProperty\n\t * @alias property-properties.Integer64Property\n\t * @abstract\n\t * @category Value Properties\n\t */\n\tconstructor(in_params, dataConstructor) {\n\t\tsuper(in_params);\n\t\tthis.DataConstructor = dataConstructor;\n\t\t// default for this property type is '0, 0'\n\t\tthis._data = new this.DataConstructor();\n\t}\n\n\t/**\n\t * Internal function to update the value of the Integer64Property\n\t *\n\t * @param {Int64|String|Number} 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 * @throws If in_value is a string that contains characters other than numbers\n\t */\n\t_setValue(in_value, in_reportToView) {\n\t\tvar oldLowValue = this._data.getValueLow();\n\t\tvar oldHighValue = this._data.getValueHigh();\n\n\t\tin_value = this._castFunctor(in_value);\n\n\t\tvar newHighValue = in_value.getValueHigh();\n\t\tvar newLowValue = in_value.getValueLow();\n\n\t\tvar changed = oldHighValue !== newHighValue || oldLowValue !== newLowValue;\n\n\t\tif (changed) {\n\t\t\tthis._data = in_value.clone();\n\t\t\tthis._setDirty(in_reportToView);\n\t\t}\n\t\treturn changed;\n\t}\n\n\t/**\n\t * @return {number} the higher 32 bit integer part\n\t */\n\tgetValueHigh() {\n\t\treturn this._data.getValueHigh();\n\t}\n\n\t/**\n\t * @return {number} the lower 32 bit integer part\n\t */\n\tgetValueLow() {\n\t\treturn this._data.getValueLow();\n\t}\n\n\t/**\n\t * @param {number} in_high - Set the higher 32 bit integer part\n\t * @throws If in_high is not a number\n\t * @return {boolean} true if the value was actually changed\n\t */\n\tsetValueHigh(in_high) {\n\t\tConsoleUtils.assert(_.isNumber(in_high), MSG.IN_HIGH_MUST_BE_NUMBER + in_high);\n\t\tvar changed = this._data.getValueHigh() !== in_high;\n\n\t\tif (changed) {\n\t\t\tvar newData = new this.DataConstructor(this.getValueLow(), in_high);\n\t\t\tthis._data = newData;\n\t\t\tthis._setDirty();\n\t\t}\n\t\treturn changed;\n\t}\n\n\t/**\n\t * @param {number} in_low - Set the lower 32 bit integer part\n\t * @throws If in_low is not a number\n\t * @return {boolean} true if the value was actually changed\n\t */\n\tsetValueLow(in_low) {\n\t\tConsoleUtils.assert(_.isNumber(in_low), MSG.IN_LOW_MUST_BE_NUMBER + in_low);\n\t\tvar changed = this._data.getValueLow() !== in_low;\n\n\t\tif (changed) {\n\t\t\tvar newData = new this.DataConstructor(in_low, this.getValueHigh());\n\t\t\tthis._data = newData;\n\t\t\tthis._setDirty();\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\treturn undefined;\n\t\t} else {\n\t\t\tConsoleUtils.assert(\n\t\t\t\t_.isArray(in_serializedObj) && in_serializedObj.length === 2,\n\t\t\t\tMSG.INVALID_INT64_CHANGESET,\n\t\t\t);\n\t\t\tvar readValue = new this.DataConstructor(in_serializedObj[0], in_serializedObj[1]);\n\t\t\tvar changed = this._setValue(readValue, in_reportToView);\n\t\t\treturn changed ? this.serialize() : 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\tif (!_.isArray(in_changeSet)) {\n\t\t\t\tin_changeSet = in_changeSet.value;\n\t\t\t}\n\t\t\tConsoleUtils.assert(\n\t\t\t\t_.isArray(in_changeSet) && in_changeSet.length === 2,\n\t\t\t\tMSG.INVALID_INT64_CHANGESET,\n\t\t\t);\n\t\t\tvar newVal = new this.DataConstructor(in_changeSet[0], in_changeSet[1]);\n\t\t\tthis._setValue(newVal, in_reportToView);\n\t\t}\n\t}\n\n\t/**\n\t * Serialize the property\n\t *\n\t * @param {boolean} in_dirtyOnly -\n\t * Only include dirty entries in the serialization\n\t * @param {boolean} in_includeRootTypeid -\n\t * Include the typeid of the root of the hierarchy - has no effect for value properties\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 * @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)\n\t\t\t\t? [this._data.getValueLow(), this._data.getValueHigh()]\n\t\t\t\t: {};\n\t\t} else {\n\t\t\treturn [this._data.getValueLow(), this._data.getValueHigh()];\n\t\t}\n\t}\n\n\t/**\n\t * The toString() method returns a string representing the specified Integer64 object.\n\t *\n\t * @param {number} [in_radix = 10] - An integer between 2 and 36 specifying\n\t * the base to use for representing numeric values.\n\t * @return {string} A string representing the specified Integer64 object.\n\t */\n\ttoString(in_radix) {\n\t\treturn this._data.toString(in_radix);\n\t}\n\n\t/**\n\t * The Integer64.fromString() method parses a string argument updates object's lower and higher 32 bit integer parts.\n\t *\n\t * @param {string} in_string - The value to parse. Leading whitespace in the string argument is ignored.\n\t * @param {number} [in_radix = 10] - An integer between 2 and 36 that represents the\n\t * radix (the base in mathematical numeral systems) of the above mentioned string.\n\t * @throws if in_string is not a string\n\t * @throws if in_radix is entered but is not a number between 2 and 36\n\t * @throws if the property is a Uint64 property and in_string is a negative number\n\t * @throws if in_string contains characters other than numbers\n\t */\n\tfromString(in_string, in_radix) {\n\t\tConsoleUtils.assert(_.isString(in_string), MSG.IN_STRING_MUST_BE_STRING + in_string);\n\t\tvar int = this._castFunctor(in_string, in_radix);\n\n\t\tthis.setValueHigh(int.getValueHigh());\n\t\tthis.setValueLow(int.getValueLow());\n\t}\n}\n\n/**\n * A primitive property class for big signed integer values.\n */\nexport class Int64Property extends Integer64Property {\n\t/**\n\t * @param {Object=} in_params - the parameters\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.Integer64Property\n\t * @alias property-properties.Int64Property\n\t * @category Value Properties\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params, Int64);\n\t}\n}\nInt64Property.prototype._typeid = \"Int64\";\nInt64Property.prototype._castFunctor = _castFunctors.Int64;\n\n/**\n * A primitive property class for big unsingned integer values.\n */\nexport class Uint64Property extends Integer64Property {\n\t/**\n\t * @param {Object=} in_params - the parameters\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.Integer64Property\n\t * @alias property-properties.Uint64Property\n\t * @category Value Properties\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params, Uint64);\n\t}\n}\nUint64Property.prototype._typeid = \"Uint64\";\nUint64Property.prototype._castFunctor = _castFunctors.Uint64;\n"]}
1
+ {"version":3,"file":"intProperties.js","sourceRoot":"","sources":["../../src/properties/intProperties.js"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AAEH,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AACxE,MAAM,EACL,YAAY,EACZ,SAAS,EAAE,EAAE,GAAG,EAAE,EAClB,MAAM,EACN,KAAK,GACL,GAAG,OAAO,CAAC,qCAAqC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C;IACtC,CAAC;IAED;;;;;;;;;;OAUG;IACH,UAAU,CAAC,SAAS,EAAE,QAAQ;QAC7B,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,GAAG,CAAC,wBAAwB,GAAG,SAAS,CAAC,CAAC;QACrF,IAAI,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAEjD,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC;QACtC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;IACrC,CAAC;CACD;AAzLD,8CAyLC;AAED;;;GAGG;AACH,MAAa,aAAc,SAAQ,iBAAiB;IACnD;;;;;;;OAOG;IACH,YAAY,SAAS;QACpB,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IACzB,CAAC;CACD;AAZD,sCAYC;AACD,aAAa,CAAC,SAAS,CAAC,OAAO,GAAG,OAAO,CAAC;AAC1C,aAAa,CAAC,SAAS,CAAC,YAAY,GAAG,aAAa,CAAC,KAAK,CAAC;AAE3D;;;GAGG;AACH,MAAa,cAAe,SAAQ,iBAAiB;IACpD;;;;;;;OAOG;IACH,YAAY,SAAS;QACpB,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC1B,CAAC;CACD;AAZD,wCAYC;AACD,cAAc,CAAC,SAAS,CAAC,OAAO,GAAG,QAAQ,CAAC;AAC5C,cAAc,CAAC,SAAS,CAAC,YAAY,GAAG,aAAa,CAAC,MAAM,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Definition of the Int*Property classes\n */\n\nconst _ = require(\"lodash\");\nconst { ChangeSet } = require(\"@fluid-experimental/property-changeset\");\nconst {\n\tConsoleUtils,\n\tconstants: { MSG },\n\tUint64,\n\tInt64,\n} = require(\"@fluid-experimental/property-common\");\nconst { ValueProperty } = require(\"./valueProperty\");\nconst { _castFunctors } = require(\"./primitiveTypeCasts\");\n\nconst BIT32 = 4294967296;\n\nexport class Int8Property extends ValueProperty {\n\t/**\n\t * A primitive property for an signed 8 bit integer value.\n\t * @param {Object=} in_params - the parameters\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueProperty\n\t * @alias property-properties.Int8Property\n\t * @category Value Properties\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t\t// default for this property type is '0'\n\t\tthis._data = 0;\n\t}\n}\nInt8Property.prototype._typeid = \"Int8\";\nInt8Property.prototype._castFunctor = _castFunctors.Int8;\n\n/**\n * A primitive property for an signed 16 bit integer value.\n */\nexport class Int16Property extends ValueProperty {\n\t/**\n\t * @param {Object=} in_params - the parameters\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueProperty\n\t * @alias property-properties.Int16Property\n\t * @category Value Properties\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t\t// default for this property type is '0'\n\t\tthis._data = 0;\n\t}\n}\nInt16Property.prototype._typeid = \"Int16\";\nInt16Property.prototype._castFunctor = _castFunctors.Int16;\n\n/**\n * A primitive property for an signed 32 bit integer value.\n */\nexport class Int32Property extends ValueProperty {\n\t/**\n\t * @param {Object=} in_params - the parameters\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueProperty\n\t * @alias property-properties.Int32Property\n\t * @category Value Properties\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t\t// default for this property type is '0'\n\t\tthis._data = 0;\n\t}\n}\nInt32Property.prototype._typeid = \"Int32\";\nInt32Property.prototype._castFunctor = _castFunctors.Int32;\n\n/**\n * A primitive property base class for big integer values.\n */\nexport class Integer64Property extends ValueProperty {\n\t/**\n\t * @param {Object=} in_params - the parameters\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueProperty\n\t * @alias property-properties.Integer64Property\n\t * @abstract\n\t * @category Value Properties\n\t */\n\tconstructor(in_params, dataConstructor) {\n\t\tsuper(in_params);\n\t\tthis.DataConstructor = dataConstructor;\n\t\t// default for this property type is '0, 0'\n\t\tthis._data = new this.DataConstructor();\n\t}\n\n\t/**\n\t * Internal function to update the value of the Integer64Property\n\t *\n\t * @param {Int64|String|Number} 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 * @throws If in_value is a string that contains characters other than numbers\n\t */\n\t_setValue(in_value, in_reportToView) {\n\t\tvar oldLowValue = this._data.getValueLow();\n\t\tvar oldHighValue = this._data.getValueHigh();\n\n\t\tin_value = this._castFunctor(in_value);\n\n\t\tvar newHighValue = in_value.getValueHigh();\n\t\tvar newLowValue = in_value.getValueLow();\n\n\t\tvar changed = oldHighValue !== newHighValue || oldLowValue !== newLowValue;\n\n\t\tif (changed) {\n\t\t\tthis._data = in_value.clone();\n\t\t\tthis._setDirty(in_reportToView);\n\t\t}\n\t\treturn changed;\n\t}\n\n\t/**\n\t * @return {number} the higher 32 bit integer part\n\t */\n\tgetValueHigh() {\n\t\treturn this._data.getValueHigh();\n\t}\n\n\t/**\n\t * @return {number} the lower 32 bit integer part\n\t */\n\tgetValueLow() {\n\t\treturn this._data.getValueLow();\n\t}\n\n\t/**\n\t * @param {number} in_high - Set the higher 32 bit integer part\n\t * @throws If in_high is not a number\n\t * @return {boolean} true if the value was actually changed\n\t */\n\tsetValueHigh(in_high) {\n\t\tConsoleUtils.assert(_.isNumber(in_high), MSG.IN_HIGH_MUST_BE_NUMBER + in_high);\n\t\tvar changed = this._data.getValueHigh() !== in_high;\n\n\t\tif (changed) {\n\t\t\tvar newData = new this.DataConstructor(this.getValueLow(), in_high);\n\t\t\tthis._data = newData;\n\t\t\tthis._setDirty();\n\t\t}\n\t\treturn changed;\n\t}\n\n\t/**\n\t * @param {number} in_low - Set the lower 32 bit integer part\n\t * @throws If in_low is not a number\n\t * @return {boolean} true if the value was actually changed\n\t */\n\tsetValueLow(in_low) {\n\t\tConsoleUtils.assert(_.isNumber(in_low), MSG.IN_LOW_MUST_BE_NUMBER + in_low);\n\t\tvar changed = this._data.getValueLow() !== in_low;\n\n\t\tif (changed) {\n\t\t\tvar newData = new this.DataConstructor(in_low, this.getValueHigh());\n\t\t\tthis._data = newData;\n\t\t\tthis._setDirty();\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\treturn undefined;\n\t\t} else {\n\t\t\tConsoleUtils.assert(\n\t\t\t\t_.isArray(in_serializedObj) && in_serializedObj.length === 2,\n\t\t\t\tMSG.INVALID_INT64_CHANGESET,\n\t\t\t);\n\t\t\tvar readValue = new this.DataConstructor(in_serializedObj[0], in_serializedObj[1]);\n\t\t\tvar changed = this._setValue(readValue, in_reportToView);\n\t\t\treturn changed ? this.serialize() : 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\tif (!_.isArray(in_changeSet)) {\n\t\t\t\tin_changeSet = in_changeSet.value;\n\t\t\t}\n\t\t\tConsoleUtils.assert(\n\t\t\t\t_.isArray(in_changeSet) && in_changeSet.length === 2,\n\t\t\t\tMSG.INVALID_INT64_CHANGESET,\n\t\t\t);\n\t\t\tvar newVal = new this.DataConstructor(in_changeSet[0], in_changeSet[1]);\n\t\t\tthis._setValue(newVal, in_reportToView);\n\t\t}\n\t}\n\n\t/**\n\t * Serialize the property\n\t *\n\t * @param {boolean} in_dirtyOnly -\n\t * Only include dirty entries in the serialization\n\t * @param {boolean} in_includeRootTypeid -\n\t * Include the typeid of the root of the hierarchy - has no effect for value properties\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 * @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)\n\t\t\t\t? [this._data.getValueLow(), this._data.getValueHigh()]\n\t\t\t\t: {};\n\t\t} else {\n\t\t\treturn [this._data.getValueLow(), this._data.getValueHigh()];\n\t\t}\n\t}\n\n\t/**\n\t * The toString() method returns a string representing the specified Integer64 object.\n\t *\n\t * @param {number} [in_radix = 10] - An integer between 2 and 36 specifying\n\t * the base to use for representing numeric values.\n\t * @return {string} A string representing the specified Integer64 object.\n\t */\n\ttoString(in_radix) {\n\t\treturn this._data.toString(in_radix);\n\t}\n\n\t/**\n\t * The Integer64.fromString() method parses a string argument updates object's lower and higher 32 bit integer parts.\n\t *\n\t * @param {string} in_string - The value to parse. Leading whitespace in the string argument is ignored.\n\t * @param {number} [in_radix = 10] - An integer between 2 and 36 that represents the\n\t * radix (the base in mathematical numeral systems) of the above mentioned string.\n\t * @throws if in_string is not a string\n\t * @throws if in_radix is entered but is not a number between 2 and 36\n\t * @throws if the property is a Uint64 property and in_string is a negative number\n\t * @throws if in_string contains characters other than numbers\n\t */\n\tfromString(in_string, in_radix) {\n\t\tConsoleUtils.assert(_.isString(in_string), MSG.IN_STRING_MUST_BE_STRING + in_string);\n\t\tvar int = this._castFunctor(in_string, in_radix);\n\n\t\tthis.setValueHigh(int.getValueHigh());\n\t\tthis.setValueLow(int.getValueLow());\n\t}\n}\n\n/**\n * A primitive property class for big signed integer values.\n * @internal\n */\nexport class Int64Property extends Integer64Property {\n\t/**\n\t * @param {Object=} in_params - the parameters\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.Integer64Property\n\t * @alias property-properties.Int64Property\n\t * @category Value Properties\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params, Int64);\n\t}\n}\nInt64Property.prototype._typeid = \"Int64\";\nInt64Property.prototype._castFunctor = _castFunctors.Int64;\n\n/**\n * A primitive property class for big unsingned integer values.\n * @internal\n */\nexport class Uint64Property extends Integer64Property {\n\t/**\n\t * @param {Object=} in_params - the parameters\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.Integer64Property\n\t * @alias property-properties.Uint64Property\n\t * @category Value Properties\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params, Uint64);\n\t}\n}\nUint64Property.prototype._typeid = \"Uint64\";\nUint64Property.prototype._castFunctor = _castFunctors.Uint64;\n"]}
@@ -6,6 +6,7 @@
6
6
  */
7
7
  /**
8
8
  * A MapProperty is a collection class that can contain an dictionary that maps from strings to properties.
9
+ * @internal
9
10
  */
10
11
  export class MapProperty extends IndexedCollectionBaseProperty {
11
12
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"mapProperty.d.ts","sourceRoot":"","sources":["../../src/properties/mapProperty.js"],"names":[],"mappings":"AAmBA;;;;;GAKG;AAEH;;GAEG;AACH;IACC;;;;;;;;OAQG;IACH,wBAQC;IALA,eAAsB;IACtB,qBAA2D;IAE3D,6CAA6C;IAC7C,qBAA0B;IAyB3B;;;;;;;;;OASG;IACH,2BAyDC;IAoGD;;;;;;;;;;;;OAYG;IACH,eAPW,MAAM,0BAsBhB;IAED;;;;;;OAMG;IACH,eAJW,MAAM,OAQhB;IAED;;;;;;;;;;OAUG;IACH,YANW,MAAM,0BAwBhB;IAeD;;;;;;;;;;;;;;OAcG;IACH,YAZW,MAAM,GAAG,MAAM,MAAM,CAAC,oBASrB,YAAY,GAAG,SAAS,CA0CnC;IAYD;;;;;;;OAOG;IACH,cAHY,eAAe,CAK1B;IA0BD;;OAEG;IACH,cAKC;CACD"}
1
+ {"version":3,"file":"mapProperty.d.ts","sourceRoot":"","sources":["../../src/properties/mapProperty.js"],"names":[],"mappings":"AAmBA;;;;;GAKG;AAEH;;;GAGG;AACH;IACC;;;;;;;;OAQG;IACH,wBAQC;IALA,eAAsB;IACtB,qBAA2D;IAE3D,6CAA6C;IAC7C,qBAA0B;IAyB3B;;;;;;;;;OASG;IACH,2BAyDC;IAoGD;;;;;;;;;;;;OAYG;IACH,eAPW,MAAM,0BAsBhB;IAED;;;;;;OAMG;IACH,eAJW,MAAM,OAQhB;IAED;;;;;;;;;;OAUG;IACH,YANW,MAAM,0BAwBhB;IAeD;;;;;;;;;;;;;;OAcG;IACH,YAZW,MAAM,GAAG,MAAM,MAAM,CAAC,oBASrB,YAAY,GAAG,SAAS,CA0CnC;IAYD;;;;;;;OAOG;IACH,cAHY,eAAe,CAK1B;IA0BD;;OAEG;IACH,cAKC;CACD"}
@@ -25,6 +25,7 @@ const PATH_TOKENS = BaseProperty.PATH_TOKENS;
25
25
  */
26
26
  /**
27
27
  * A MapProperty is a collection class that can contain an dictionary that maps from strings to properties.
28
+ * @internal
28
29
  */
29
30
  class MapProperty extends IndexedCollectionBaseProperty {
30
31
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"mapProperty.js","sourceRoot":"","sources":["../../src/properties/mapProperty.js"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AACH,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AACvF,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC;AACzE,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC;AACxE,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,EAAE,gCAAgC,EAAE,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AAC,gBAAgB,CAAC,CAAC;IAC3C,CAAC;IAED;;;;;;OAMG;IACH,SAAS;QACR,IAAI,KAAK,GAAG,6BAA6B,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEzE,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;IAClD,CAAC;IAED;;OAEG;IACH,KAAK;QACJ,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,UAAU,EAAE;YACjC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;IACJ,CAAC;CACD;AAvZD,kCAuZC;AAED,WAAW,CAAC,SAAS,CAAC,OAAO,GAAG,cAAc,CAAC;AAC/C,WAAW,CAAC,SAAS,CAAC,QAAQ,GAAG,KAAK,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Definition of the map property class\n */\nconst { PathHelper, TypeIdHelper } = require(\"@fluid-experimental/property-changeset\");\nconst { MSG } = require(\"@fluid-experimental/property-common\").constants;\nconst { ConsoleUtils } = require(\"@fluid-experimental/property-common\");\nconst _ = require(\"lodash\");\nconst { AbstractStaticCollectionProperty } = require(\"./abstractStaticCollectionProperty\");\nconst { BaseProperty } = require(\"./baseProperty\");\nconst { IndexedCollectionBaseProperty } = require(\"./indexedCollectionBaseProperty\");\nconst { LazyLoadedProperties: Property } = require(\"./lazyLoadedProperties\");\n\nconst PATH_TOKENS = BaseProperty.PATH_TOKENS;\n\n/**\n * typedef {property-properties.BaseProperty|string|number|boolean} property-properties.MapProperty~MapValueType\n *\n * The type of the values that are set/inserted into the map. Depending on the type of the map, these can either\n * be property objects or primitive values\n */\n\n/**\n * A MapProperty is a collection class that can contain an dictionary that maps from strings to properties.\n */\nexport class MapProperty extends IndexedCollectionBaseProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t * @param {string|undefined} in_scope - The scope in which the map typeid is defined\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.IndexedCollectionBaseProperty\n\t * @alias property-properties.MapProperty\n\t * @category Maps\n\t */\n\tconstructor(in_params, in_scope) {\n\t\tsuper(in_params);\n\n\t\tthis._scope = in_scope;\n\t\tthis._contextKeyType = in_params.contextKeyType || \"string\";\n\n\t\t/** Contains the actual entries of the map */\n\t\tthis._dynamicChildren = {};\n\t}\n\n\t/**\n\t * Returns the full property type identifier for the ChangeSet including the enum type id\n\t * @param {boolean} [in_hideCollection=false] - If true the collection type (if applicable) will be omitted\n\t * @return {string} The typeid\n\t */\n\tgetFullTypeid(in_hideCollection = false) {\n\t\treturn in_hideCollection\n\t\t\t? this._typeid\n\t\t\t: TypeIdHelper.createSerializationTypeId(this._typeid, \"map\");\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 * Sets multiple values in a map.\n\t *\n\t * See {@link MapProperty.setValues}\n\t *\n\t * @param {object} in_values - to assign to the collection\n\t * @param {Boolean} in_typed - If the map's items have a typeid and a value then create the\n\t * properties with that typeid, else use the set's typeid (support polymorphic items).\n\t * @private\n\t */\n\t_setValuesInternal(in_values, in_typed) {\n\t\tif (this._containsPrimitiveTypes) {\n\t\t\tvar that = this;\n\t\t\t_.each(in_values, function (value, key) {\n\t\t\t\tif (that.has(key)) {\n\t\t\t\t\tthat.remove(key);\n\t\t\t\t}\n\n\t\t\t\tthat.insert(key, value);\n\t\t\t});\n\t\t} else {\n\t\t\tvar that = this;\n\t\t\t_.each(in_values, function (value, key) {\n\t\t\t\tvar property = that.get(String(key), {\n\t\t\t\t\treferenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER,\n\t\t\t\t});\n\t\t\t\t// if key exists in set replace its value else insert a new key/value\n\t\t\t\tif (property) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tproperty instanceof Property.ValueProperty ||\n\t\t\t\t\t\tproperty instanceof Property.StringProperty\n\t\t\t\t\t) {\n\t\t\t\t\t\tproperty.setValue(value);\n\t\t\t\t\t} else if (property instanceof BaseProperty && _.isObject(value)) {\n\t\t\t\t\t\tproperty._setValues(value, false, false);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new TypeError(MSG.SET_VALUES_PATH_INVALID + key);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (value instanceof BaseProperty) {\n\t\t\t\t\t\tthat.insert(key, value);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (in_typed) {\n\t\t\t\t\t\t\tthat.insert(\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tProperty.PropertyFactory._createProperty(\n\t\t\t\t\t\t\t\t\tvalue.typeid || that._typeid,\n\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\tvalue.value,\n\t\t\t\t\t\t\t\t\tthat._getScope(),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthat.insert(\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tProperty.PropertyFactory._createProperty(\n\t\t\t\t\t\t\t\t\tthat._typeid,\n\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t\tthat._getScope(),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Sets multiple values in a map.\n\t *\n\t * See {@link MapProperty.setValues}\n\t *\n\t * @param {object} in_values - to assign to the collection\n\t * @param {boolean} in_typed - Whether the values are typed/polymorphic.\n\t * @param {boolean} in_initial - Whether we are setting default/initial values or if the function is called directly\n\t * with the values to set.\n\t *\n\t * @override\n\t */\n\t_setValues(in_values, in_typed, in_initial) {\n\t\tif (in_initial) {\n\t\t\tthis.clear();\n\t\t}\n\n\t\tthis._setValuesInternal(in_values, in_typed);\n\t}\n\n\t/**\n\t * Sets multiple values in a map.\n\t *\n\t * @param {object} in_values - to assign to the collection\n\t * @throws If one of the path in in_values does not exist in this property\n\t * @throws If trying to set a value to a path that leads to a Property other than ValueProperty or StringProperty\n\t *\n\t * @override\n\t */\n\tsetValues(in_values) {\n\t\tvar checkoutView = this._getCheckoutView();\n\t\tif (checkoutView !== undefined) {\n\t\t\tcheckoutView.pushNotificationDelayScope();\n\t\t\tthis._setValues(in_values, false, false);\n\t\t\tcheckoutView.popNotificationDelayScope();\n\t\t} else {\n\t\t\tthis._setValues(in_values, false, false);\n\t\t}\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 *\n\t * ```javascript\n\t * {\n\t * 'firstString': {\n\t * 'stringValue': 'test1'\n\t * },\n\t * 'secondString': {\n\t * 'stringValue': '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\tvar child = this.get(ids[i]);\n\t\t\tresult[ids[i]] = child.isPrimitiveType()\n\t\t\t\t? this.get(ids[i]).getValue()\n\t\t\t\t: child.getValues();\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * Returns the path segment for a child\n\t *\n\t * @param {property-properties.BaseProperty} in_childNode - The child for which the path is returned\n\t *\n\t * @return {string} The path segment to resolve the child property under this property\n\t * @protected\n\t */\n\t_getPathSegmentForChildNode(in_childNode) {\n\t\treturn \"[\" + PathHelper.quotePathSegmentIfNeeded(in_childNode._id) + \"]\";\n\t}\n\n\t/**\n\t * Resolves a direct child node based on the given path segment\n\t *\n\t * @param {String} in_segment - The path segment to resolve\n\t * @param {property-properties.PathHelper.TOKEN_TYPES} in_segmentType - The type of segment in the tokenized path\n\t *\n\t * @return {BaseProperty | undefined} The child property that has been resolved\n\t * @protected\n\t */\n\t_resolvePathSegment(in_segment, in_segmentType) {\n\t\treturn in_segmentType === PathHelper.TOKEN_TYPES.ARRAY_TOKEN\n\t\t\t? this._dynamicChildren[in_segment]\n\t\t\t: AbstractStaticCollectionProperty.prototype._resolvePathSegment.call(\n\t\t\t\t\tthis,\n\t\t\t\t\tin_segment,\n\t\t\t\t\tin_segmentType,\n\t\t\t );\n\t}\n\n\t/**\n\t * Inserts a property or value into the map\n\t *\n\t * Note: This will trigger an exception when this key already exists in the map. If you want to overwrite\n\t * existing entries you can use the set function.\n\t *\n\t * @param {string} in_key - The key under which the entry is added\n\t * @param {property-properties.Property} in_property - The property to insert\n\t * @throws If the property already exists\n\t * @throws If the property already has a parent\n\t * @throws If in_key is not a string\n\t * @throws If the property is a root property\n\t */\n\tinsert(in_key, in_property) {\n\t\tConsoleUtils.assert(_.isString(in_key), MSG.KEY_NOT_STRING + in_key);\n\t\tif (this._dynamicChildren[in_key] !== undefined) {\n\t\t\tthrow new Error(MSG.PROPERTY_ALREADY_EXISTS + in_key);\n\t\t}\n\t\tif (in_property instanceof BaseProperty) {\n\t\t\tin_property._validateInsertIn(this);\n\t\t\t// Set the ID of the entry, to make sure it corresponds to the used key\n\t\t\tin_property._setId(in_key);\n\n\t\t\t// Insert the entry into the collection\n\t\t\tthis._insert(in_key, in_property, true);\n\t\t} else {\n\t\t\tthrow new TypeError(MSG.NONVALUE_MAP_INSERT_PROP);\n\t\t}\n\t}\n\n\t/**\n\t * Removes the entry with the given key from the map\n\t *\n\t * @param {string} in_key - The key of the entry to remove from the map\n\t * @throws If trying to remove an entry that does not exist\n\t * @return {*} the item removed\n\t */\n\tremove(in_key) {\n\t\tvar item = this.get(in_key);\n\t\tthis._removeByKey(in_key, true);\n\t\treturn item;\n\t}\n\n\t/**\n\t * Sets the entry with the given key to the property 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 {property-properties.MapProperty~MapValueType} in_property - The property to store in the map\n\t * @throws If in_property is not a property\n\t * @throws If trying to insert a property that has a parent\n\t * @throws If in_key is not a string or a number\n\t */\n\tset(in_key, in_property) {\n\t\tthis._checkIsNotReadOnly(true);\n\t\tif (this._dynamicChildren[in_key] !== in_property) {\n\t\t\tif (this._containsPrimitiveTypes === false && in_property.getParent() !== undefined) {\n\t\t\t\tthrow new Error(MSG.INSERTED_ENTRY_WITH_PARENT);\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\t// Set the ID of the entry, to make sure it corresponds to the used key\n\t\t\tif (this._containsPrimitiveTypes === false) {\n\t\t\t\tin_property._setId(in_key);\n\t\t\t}\n\t\t\tthis._insert(in_key, in_property, false);\n\n\t\t\t// Make one final report\n\t\t\tthis._reportDirtinessToView();\n\t\t}\n\t}\n\n\t/**\n\t * Returns an Object with all the entries of the map.\n\t * Contrary ot .getValues, for Property Maps, this will return the Property, not an object with their nested values.\n\t * WARNING: This is a direct access to the internal data-structure and the collection MUST NOT be modified. It is\n\t * read only for fast access and iteration. Insertion and deletion MUST be done via the insert and remove functions\n\t * of this class.\n\t *\n\t * @return {Object} The map with all entries in the map.\n\t */\n\tgetEntriesReadOnly() {\n\t\treturn this._dynamicChildren;\n\t}\n\n\t/**\n\t * Returns the collection entry with the given key\n\t *\n\t * @param {string | Array<string>} in_ids - key of the entry to return or an array of keys\n\t * if an array is passed, the .get function will be performed on each id in sequence\n\t * for example .get(['position','x']) is equivalent to .get('position').get('x').\n\t * If .get resolves to a ReferenceProperty, it will return the property that the ReferenceProperty\n\t * refers to.\n\t * @param {Object} in_options - parameter object\n\t * @param {property-properties.BaseProperty.REFERENCE_RESOLUTION} [in_options.referenceResolutionMode=ALWAYS]- -\n\t * How should this function behave during reference resolution?\n\t *\n\t * @return {BaseProperty | undefined} The entry in the collection or undefined\n\t * if none could be found\n\t */\n\tget(in_ids, in_options) {\n\t\tif (_.isArray(in_ids)) {\n\t\t\t// Forward handling of arrays to the BaseProperty function\n\t\t\treturn AbstractStaticCollectionProperty.prototype.get.call(this, in_ids, in_options);\n\t\t} else {\n\t\t\tin_options = in_options || {};\n\t\t\tin_options.referenceResolutionMode =\n\t\t\t\tin_options.referenceResolutionMode === undefined\n\t\t\t\t\t? BaseProperty.REFERENCE_RESOLUTION.ALWAYS\n\t\t\t\t\t: in_options.referenceResolutionMode;\n\n\t\t\tvar prop = this;\n\t\t\tswitch (in_ids) {\n\t\t\t\tcase PATH_TOKENS.ROOT: {\n\t\t\t\t\tprop = prop.getRoot();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase PATH_TOKENS.UP: {\n\t\t\t\t\tprop = prop.getParent();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase PATH_TOKENS.REF: {\n\t\t\t\t\tthrow new Error(MSG.NO_GET_DEREFERENCE_ONLY);\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tprop = prop._dynamicChildren[in_ids];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Handle automatic reference resolution\n\t\t\tif (in_options.referenceResolutionMode === BaseProperty.REFERENCE_RESOLUTION.ALWAYS) {\n\t\t\t\tif (prop instanceof Property.ReferenceProperty) {\n\t\t\t\t\tprop = prop.ref;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn prop;\n\t\t}\n\t}\n\n\t/**\n\t * Checks whether an entry with the given name exists\n\t *\n\t * @param {string} in_id - Name of the property\n\t * @return {boolean} True if the property exists, otherwise false.\n\t */\n\thas(in_id) {\n\t\treturn this._dynamicChildren[in_id] !== undefined;\n\t}\n\n\t/**\n\t * Returns all entries of the map as an array.\n\t *\n\t * NOTE: This function creates a copy and thus is less efficient as getEntriesReadOnly.\n\t *\n\t * @return {Array.<property-properties.BaseProperty | *>} Array with all entries of the map. This array\n\t * is a shallow copy which can be modified by the caller without effects on the map.\n\t */\n\tgetAsArray() {\n\t\treturn _.values(this._dynamicChildren);\n\t}\n\n\t/**\n\t * Returns all keys found in the map\n\t *\n\t * NOTE: This function creates a copy and thus is less efficient as getEntriesReadOnly.\n\t *\n\t * @return {Array.<string>} The keys\n\t */\n\tgetIds() {\n\t\treturn Object.keys(this._dynamicChildren);\n\t}\n\n\t/**\n\t * Get the scope to which this property belongs to.\n\t * @return {string|undefined} The guid representing the scope in which the\n\t * map belongs to. If there is a workspace scope return it, else return the scope of this map.\n\t * @override\n\t * @private\n\t */\n\t_getScope() {\n\t\tvar scope = IndexedCollectionBaseProperty.prototype._getScope.call(this);\n\n\t\treturn scope !== undefined ? scope : this._scope;\n\t}\n\n\t/**\n\t * Deletes all values from the Map\n\t */\n\tclear() {\n\t\tvar that = this;\n\t\tthis.getIds().forEach(function (id) {\n\t\t\tthat.remove(id);\n\t\t});\n\t}\n}\n\nMapProperty.prototype._typeid = \"BaseProperty\";\nMapProperty.prototype._context = \"map\";\n"]}
1
+ {"version":3,"file":"mapProperty.js","sourceRoot":"","sources":["../../src/properties/mapProperty.js"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AACH,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AACvF,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC;AACzE,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC;AACxE,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,EAAE,gCAAgC,EAAE,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAAC;AAC3F,M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;;;OAMG;IACH,SAAS;QACR,IAAI,KAAK,GAAG,6BAA6B,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEzE,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;IAClD,CAAC;IAED;;OAEG;IACH,KAAK;QACJ,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,UAAU,EAAE;YACjC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;IACJ,CAAC;CACD;AAvZD,kCAuZC;AAED,WAAW,CAAC,SAAS,CAAC,OAAO,GAAG,cAAc,CAAC;AAC/C,WAAW,CAAC,SAAS,CAAC,QAAQ,GAAG,KAAK,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Definition of the map property class\n */\nconst { PathHelper, TypeIdHelper } = require(\"@fluid-experimental/property-changeset\");\nconst { MSG } = require(\"@fluid-experimental/property-common\").constants;\nconst { ConsoleUtils } = require(\"@fluid-experimental/property-common\");\nconst _ = require(\"lodash\");\nconst { AbstractStaticCollectionProperty } = require(\"./abstractStaticCollectionProperty\");\nconst { BaseProperty } = require(\"./baseProperty\");\nconst { IndexedCollectionBaseProperty } = require(\"./indexedCollectionBaseProperty\");\nconst { LazyLoadedProperties: Property } = require(\"./lazyLoadedProperties\");\n\nconst PATH_TOKENS = BaseProperty.PATH_TOKENS;\n\n/**\n * typedef {property-properties.BaseProperty|string|number|boolean} property-properties.MapProperty~MapValueType\n *\n * The type of the values that are set/inserted into the map. Depending on the type of the map, these can either\n * be property objects or primitive values\n */\n\n/**\n * A MapProperty is a collection class that can contain an dictionary that maps from strings to properties.\n * @internal\n */\nexport class MapProperty extends IndexedCollectionBaseProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t * @param {string|undefined} in_scope - The scope in which the map typeid is defined\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.IndexedCollectionBaseProperty\n\t * @alias property-properties.MapProperty\n\t * @category Maps\n\t */\n\tconstructor(in_params, in_scope) {\n\t\tsuper(in_params);\n\n\t\tthis._scope = in_scope;\n\t\tthis._contextKeyType = in_params.contextKeyType || \"string\";\n\n\t\t/** Contains the actual entries of the map */\n\t\tthis._dynamicChildren = {};\n\t}\n\n\t/**\n\t * Returns the full property type identifier for the ChangeSet including the enum type id\n\t * @param {boolean} [in_hideCollection=false] - If true the collection type (if applicable) will be omitted\n\t * @return {string} The typeid\n\t */\n\tgetFullTypeid(in_hideCollection = false) {\n\t\treturn in_hideCollection\n\t\t\t? this._typeid\n\t\t\t: TypeIdHelper.createSerializationTypeId(this._typeid, \"map\");\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 * Sets multiple values in a map.\n\t *\n\t * See {@link MapProperty.setValues}\n\t *\n\t * @param {object} in_values - to assign to the collection\n\t * @param {Boolean} in_typed - If the map's items have a typeid and a value then create the\n\t * properties with that typeid, else use the set's typeid (support polymorphic items).\n\t * @private\n\t */\n\t_setValuesInternal(in_values, in_typed) {\n\t\tif (this._containsPrimitiveTypes) {\n\t\t\tvar that = this;\n\t\t\t_.each(in_values, function (value, key) {\n\t\t\t\tif (that.has(key)) {\n\t\t\t\t\tthat.remove(key);\n\t\t\t\t}\n\n\t\t\t\tthat.insert(key, value);\n\t\t\t});\n\t\t} else {\n\t\t\tvar that = this;\n\t\t\t_.each(in_values, function (value, key) {\n\t\t\t\tvar property = that.get(String(key), {\n\t\t\t\t\treferenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER,\n\t\t\t\t});\n\t\t\t\t// if key exists in set replace its value else insert a new key/value\n\t\t\t\tif (property) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tproperty instanceof Property.ValueProperty ||\n\t\t\t\t\t\tproperty instanceof Property.StringProperty\n\t\t\t\t\t) {\n\t\t\t\t\t\tproperty.setValue(value);\n\t\t\t\t\t} else if (property instanceof BaseProperty && _.isObject(value)) {\n\t\t\t\t\t\tproperty._setValues(value, false, false);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new TypeError(MSG.SET_VALUES_PATH_INVALID + key);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (value instanceof BaseProperty) {\n\t\t\t\t\t\tthat.insert(key, value);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (in_typed) {\n\t\t\t\t\t\t\tthat.insert(\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tProperty.PropertyFactory._createProperty(\n\t\t\t\t\t\t\t\t\tvalue.typeid || that._typeid,\n\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\tvalue.value,\n\t\t\t\t\t\t\t\t\tthat._getScope(),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthat.insert(\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tProperty.PropertyFactory._createProperty(\n\t\t\t\t\t\t\t\t\tthat._typeid,\n\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t\tthat._getScope(),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Sets multiple values in a map.\n\t *\n\t * See {@link MapProperty.setValues}\n\t *\n\t * @param {object} in_values - to assign to the collection\n\t * @param {boolean} in_typed - Whether the values are typed/polymorphic.\n\t * @param {boolean} in_initial - Whether we are setting default/initial values or if the function is called directly\n\t * with the values to set.\n\t *\n\t * @override\n\t */\n\t_setValues(in_values, in_typed, in_initial) {\n\t\tif (in_initial) {\n\t\t\tthis.clear();\n\t\t}\n\n\t\tthis._setValuesInternal(in_values, in_typed);\n\t}\n\n\t/**\n\t * Sets multiple values in a map.\n\t *\n\t * @param {object} in_values - to assign to the collection\n\t * @throws If one of the path in in_values does not exist in this property\n\t * @throws If trying to set a value to a path that leads to a Property other than ValueProperty or StringProperty\n\t *\n\t * @override\n\t */\n\tsetValues(in_values) {\n\t\tvar checkoutView = this._getCheckoutView();\n\t\tif (checkoutView !== undefined) {\n\t\t\tcheckoutView.pushNotificationDelayScope();\n\t\t\tthis._setValues(in_values, false, false);\n\t\t\tcheckoutView.popNotificationDelayScope();\n\t\t} else {\n\t\t\tthis._setValues(in_values, false, false);\n\t\t}\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 *\n\t * ```javascript\n\t * {\n\t * 'firstString': {\n\t * 'stringValue': 'test1'\n\t * },\n\t * 'secondString': {\n\t * 'stringValue': '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\tvar child = this.get(ids[i]);\n\t\t\tresult[ids[i]] = child.isPrimitiveType()\n\t\t\t\t? this.get(ids[i]).getValue()\n\t\t\t\t: child.getValues();\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * Returns the path segment for a child\n\t *\n\t * @param {property-properties.BaseProperty} in_childNode - The child for which the path is returned\n\t *\n\t * @return {string} The path segment to resolve the child property under this property\n\t * @protected\n\t */\n\t_getPathSegmentForChildNode(in_childNode) {\n\t\treturn \"[\" + PathHelper.quotePathSegmentIfNeeded(in_childNode._id) + \"]\";\n\t}\n\n\t/**\n\t * Resolves a direct child node based on the given path segment\n\t *\n\t * @param {String} in_segment - The path segment to resolve\n\t * @param {property-properties.PathHelper.TOKEN_TYPES} in_segmentType - The type of segment in the tokenized path\n\t *\n\t * @return {BaseProperty | undefined} The child property that has been resolved\n\t * @protected\n\t */\n\t_resolvePathSegment(in_segment, in_segmentType) {\n\t\treturn in_segmentType === PathHelper.TOKEN_TYPES.ARRAY_TOKEN\n\t\t\t? this._dynamicChildren[in_segment]\n\t\t\t: AbstractStaticCollectionProperty.prototype._resolvePathSegment.call(\n\t\t\t\t\tthis,\n\t\t\t\t\tin_segment,\n\t\t\t\t\tin_segmentType,\n\t\t\t );\n\t}\n\n\t/**\n\t * Inserts a property or value into the map\n\t *\n\t * Note: This will trigger an exception when this key already exists in the map. If you want to overwrite\n\t * existing entries you can use the set function.\n\t *\n\t * @param {string} in_key - The key under which the entry is added\n\t * @param {property-properties.Property} in_property - The property to insert\n\t * @throws If the property already exists\n\t * @throws If the property already has a parent\n\t * @throws If in_key is not a string\n\t * @throws If the property is a root property\n\t */\n\tinsert(in_key, in_property) {\n\t\tConsoleUtils.assert(_.isString(in_key), MSG.KEY_NOT_STRING + in_key);\n\t\tif (this._dynamicChildren[in_key] !== undefined) {\n\t\t\tthrow new Error(MSG.PROPERTY_ALREADY_EXISTS + in_key);\n\t\t}\n\t\tif (in_property instanceof BaseProperty) {\n\t\t\tin_property._validateInsertIn(this);\n\t\t\t// Set the ID of the entry, to make sure it corresponds to the used key\n\t\t\tin_property._setId(in_key);\n\n\t\t\t// Insert the entry into the collection\n\t\t\tthis._insert(in_key, in_property, true);\n\t\t} else {\n\t\t\tthrow new TypeError(MSG.NONVALUE_MAP_INSERT_PROP);\n\t\t}\n\t}\n\n\t/**\n\t * Removes the entry with the given key from the map\n\t *\n\t * @param {string} in_key - The key of the entry to remove from the map\n\t * @throws If trying to remove an entry that does not exist\n\t * @return {*} the item removed\n\t */\n\tremove(in_key) {\n\t\tvar item = this.get(in_key);\n\t\tthis._removeByKey(in_key, true);\n\t\treturn item;\n\t}\n\n\t/**\n\t * Sets the entry with the given key to the property 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 {property-properties.MapProperty~MapValueType} in_property - The property to store in the map\n\t * @throws If in_property is not a property\n\t * @throws If trying to insert a property that has a parent\n\t * @throws If in_key is not a string or a number\n\t */\n\tset(in_key, in_property) {\n\t\tthis._checkIsNotReadOnly(true);\n\t\tif (this._dynamicChildren[in_key] !== in_property) {\n\t\t\tif (this._containsPrimitiveTypes === false && in_property.getParent() !== undefined) {\n\t\t\t\tthrow new Error(MSG.INSERTED_ENTRY_WITH_PARENT);\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\t// Set the ID of the entry, to make sure it corresponds to the used key\n\t\t\tif (this._containsPrimitiveTypes === false) {\n\t\t\t\tin_property._setId(in_key);\n\t\t\t}\n\t\t\tthis._insert(in_key, in_property, false);\n\n\t\t\t// Make one final report\n\t\t\tthis._reportDirtinessToView();\n\t\t}\n\t}\n\n\t/**\n\t * Returns an Object with all the entries of the map.\n\t * Contrary ot .getValues, for Property Maps, this will return the Property, not an object with their nested values.\n\t * WARNING: This is a direct access to the internal data-structure and the collection MUST NOT be modified. It is\n\t * read only for fast access and iteration. Insertion and deletion MUST be done via the insert and remove functions\n\t * of this class.\n\t *\n\t * @return {Object} The map with all entries in the map.\n\t */\n\tgetEntriesReadOnly() {\n\t\treturn this._dynamicChildren;\n\t}\n\n\t/**\n\t * Returns the collection entry with the given key\n\t *\n\t * @param {string | Array<string>} in_ids - key of the entry to return or an array of keys\n\t * if an array is passed, the .get function will be performed on each id in sequence\n\t * for example .get(['position','x']) is equivalent to .get('position').get('x').\n\t * If .get resolves to a ReferenceProperty, it will return the property that the ReferenceProperty\n\t * refers to.\n\t * @param {Object} in_options - parameter object\n\t * @param {property-properties.BaseProperty.REFERENCE_RESOLUTION} [in_options.referenceResolutionMode=ALWAYS]- -\n\t * How should this function behave during reference resolution?\n\t *\n\t * @return {BaseProperty | undefined} The entry in the collection or undefined\n\t * if none could be found\n\t */\n\tget(in_ids, in_options) {\n\t\tif (_.isArray(in_ids)) {\n\t\t\t// Forward handling of arrays to the BaseProperty function\n\t\t\treturn AbstractStaticCollectionProperty.prototype.get.call(this, in_ids, in_options);\n\t\t} else {\n\t\t\tin_options = in_options || {};\n\t\t\tin_options.referenceResolutionMode =\n\t\t\t\tin_options.referenceResolutionMode === undefined\n\t\t\t\t\t? BaseProperty.REFERENCE_RESOLUTION.ALWAYS\n\t\t\t\t\t: in_options.referenceResolutionMode;\n\n\t\t\tvar prop = this;\n\t\t\tswitch (in_ids) {\n\t\t\t\tcase PATH_TOKENS.ROOT: {\n\t\t\t\t\tprop = prop.getRoot();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase PATH_TOKENS.UP: {\n\t\t\t\t\tprop = prop.getParent();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase PATH_TOKENS.REF: {\n\t\t\t\t\tthrow new Error(MSG.NO_GET_DEREFERENCE_ONLY);\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tprop = prop._dynamicChildren[in_ids];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Handle automatic reference resolution\n\t\t\tif (in_options.referenceResolutionMode === BaseProperty.REFERENCE_RESOLUTION.ALWAYS) {\n\t\t\t\tif (prop instanceof Property.ReferenceProperty) {\n\t\t\t\t\tprop = prop.ref;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn prop;\n\t\t}\n\t}\n\n\t/**\n\t * Checks whether an entry with the given name exists\n\t *\n\t * @param {string} in_id - Name of the property\n\t * @return {boolean} True if the property exists, otherwise false.\n\t */\n\thas(in_id) {\n\t\treturn this._dynamicChildren[in_id] !== undefined;\n\t}\n\n\t/**\n\t * Returns all entries of the map as an array.\n\t *\n\t * NOTE: This function creates a copy and thus is less efficient as getEntriesReadOnly.\n\t *\n\t * @return {Array.<property-properties.BaseProperty | *>} Array with all entries of the map. This array\n\t * is a shallow copy which can be modified by the caller without effects on the map.\n\t */\n\tgetAsArray() {\n\t\treturn _.values(this._dynamicChildren);\n\t}\n\n\t/**\n\t * Returns all keys found in the map\n\t *\n\t * NOTE: This function creates a copy and thus is less efficient as getEntriesReadOnly.\n\t *\n\t * @return {Array.<string>} The keys\n\t */\n\tgetIds() {\n\t\treturn Object.keys(this._dynamicChildren);\n\t}\n\n\t/**\n\t * Get the scope to which this property belongs to.\n\t * @return {string|undefined} The guid representing the scope in which the\n\t * map belongs to. If there is a workspace scope return it, else return the scope of this map.\n\t * @override\n\t * @private\n\t */\n\t_getScope() {\n\t\tvar scope = IndexedCollectionBaseProperty.prototype._getScope.call(this);\n\n\t\treturn scope !== undefined ? scope : this._scope;\n\t}\n\n\t/**\n\t * Deletes all values from the Map\n\t */\n\tclear() {\n\t\tvar that = this;\n\t\tthis.getIds().forEach(function (id) {\n\t\t\tthat.remove(id);\n\t\t});\n\t}\n}\n\nMapProperty.prototype._typeid = \"BaseProperty\";\nMapProperty.prototype._context = \"map\";\n"]}
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * A property object that allows to add child properties dynamically.
3
+ * @internal
3
4
  */
4
5
  export class NodeProperty extends ContainerProperty {
5
6
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"nodeProperty.d.ts","sourceRoot":"","sources":["../../src/properties/nodeProperty.js"],"names":[],"mappings":"AAUA;;GAEG;AACH;IAsBC;;OAEG;IACH,oDAAsC;CACtC"}
1
+ {"version":3,"file":"nodeProperty.d.ts","sourceRoot":"","sources":["../../src/properties/nodeProperty.js"],"names":[],"mappings":"AAUA;;;GAGG;AACH;IAsBC;;OAEG;IACH,oDAAsC;CACtC"}
@@ -11,6 +11,7 @@ exports.NodeProperty = void 0;
11
11
  const { ContainerProperty } = require("./containerProperty");
12
12
  /**
13
13
  * A property object that allows to add child properties dynamically.
14
+ * @internal
14
15
  */
15
16
  class NodeProperty extends ContainerProperty {
16
17
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"nodeProperty.js","sourceRoot":"","sources":["../../src/properties/nodeProperty.js"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AACH,MAAM,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAE7D;;GAEG;AACH,MAAa,YAAa,SAAQ,iBAAiB;IAClD;;;;;;;;OAQG;IACH,YAAY,SAAS;QACpB,KAAK,CAAC,SAAS,CAAC,CAAC;QACjB,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,SAAS;QACR,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;OAEG;IACH,eAAe,CAAC,KAAK,EAAE,WAAW,IAAG,CAAC;CACtC;AA1BD,oCA0BC;AACD,YAAY,CAAC,SAAS,CAAC,OAAO,GAAG,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview This file contains the implementation of the NodeProperty class\n */\nconst { ContainerProperty } = require(\"./containerProperty\");\n\n/**\n * A property object that allows to add child properties dynamically.\n */\nexport class NodeProperty extends ContainerProperty {\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.ContainerProperty\n\t * @alias property-properties.NodeProperty\n\t * @category Other Collections\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t\tthis._dynamicChildren = {};\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\tisDynamic() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\t_validateInsert(in_id, in_property) {}\n}\nNodeProperty.prototype._typeid = \"NodeProperty\";\n"]}
1
+ {"version":3,"file":"nodeProperty.js","sourceRoot":"","sources":["../../src/properties/nodeProperty.js"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AACH,MAAM,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAE7D;;;GAGG;AACH,MAAa,YAAa,SAAQ,iBAAiB;IAClD;;;;;;;;OAQG;IACH,YAAY,SAAS;QACpB,KAAK,CAAC,SAAS,CAAC,CAAC;QACjB,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,SAAS;QACR,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;OAEG;IACH,eAAe,CAAC,KAAK,EAAE,WAAW,IAAG,CAAC;CACtC;AA1BD,oCA0BC;AACD,YAAY,CAAC,SAAS,CAAC,OAAO,GAAG,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview This file contains the implementation of the NodeProperty class\n */\nconst { ContainerProperty } = require(\"./containerProperty\");\n\n/**\n * A property object that allows to add child properties dynamically.\n * @internal\n */\nexport class NodeProperty extends ContainerProperty {\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.ContainerProperty\n\t * @alias property-properties.NodeProperty\n\t * @category Other Collections\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t\tthis._dynamicChildren = {};\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\tisDynamic() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\t_validateInsert(in_id, in_property) {}\n}\nNodeProperty.prototype._typeid = \"NodeProperty\";\n"]}
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * An ArrayProperty which stores reference values
3
+ * @internal
3
4
  */
4
5
  export class ReferenceArrayProperty extends ValueArrayProperty {
5
6
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"referenceArrayProperty.d.ts","sourceRoot":"","sources":["../../src/properties/referenceArrayProperty.js"],"names":[],"mappings":"AAgBA;;GAEG;AACH;IA+NC;;;;;;;;;;;OAWG;IACH,uEAJa,MAAM,MAAM,CAAC,CAcxB;IAvOF;;;;;;;OAOG;IACH,4BAFa,MAAM,CAIlB;IAoCD;;;;;;OAMG;IACH,8BAHW,MAAM,GACJ,OAAO,CAOnB;IAkBD;;;;;;;;;;OAUG;IACH,uBARW,MAAM,uBAWhB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;;OAIG;IACH,aAHa,aAAa,CAUzB;IAED;;;;OAIG;IACH,cAQC;IAED;;;;;;;OAOG;IACH,oBANW,MAAM,UAUhB;IAED;;;;;;;;;OASG;IACH,uBARW,MAAM,kBACN,MAAM,GAKJ,aAAa,CA2BzB;IAED;;OAEG;IACH,+DAYC;CAoCD"}
1
+ {"version":3,"file":"referenceArrayProperty.d.ts","sourceRoot":"","sources":["../../src/properties/referenceArrayProperty.js"],"names":[],"mappings":"AAgBA;;;GAGG;AACH;IA+NC;;;;;;;;;;;OAWG;IACH,uEAJa,MAAM,MAAM,CAAC,CAcxB;IAvOF;;;;;;;OAOG;IACH,4BAFa,MAAM,CAIlB;IAoCD;;;;;;OAMG;IACH,8BAHW,MAAM,GACJ,OAAO,CAOnB;IAkBD;;;;;;;;;;OAUG;IACH,uBARW,MAAM,uBAWhB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;;OAIG;IACH,aAHa,aAAa,CAUzB;IAED;;;;OAIG;IACH,cAQC;IAED;;;;;;;OAOG;IACH,oBANW,MAAM,UAUhB;IAED;;;;;;;;;OASG;IACH,uBARW,MAAM,kBACN,MAAM,GAKJ,aAAa,CA2BzB;IAED;;OAEG;IACH,+DAYC;CAoCD"}
@@ -18,6 +18,7 @@ const { ReferenceProperty } = require("./referenceProperty");
18
18
  const { ValueArrayProperty } = require("./valueArrayProperty");
19
19
  /**
20
20
  * An ArrayProperty which stores reference values
21
+ * @internal
21
22
  */
22
23
  class ReferenceArrayProperty extends ValueArrayProperty {
23
24
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"referenceArrayProperty.js","sourceRoot":"","sources":["../../src/properties/referenceArrayProperty.js"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH;;GAEG;AACH,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AACvF,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC;AACzE,MAAM,EAAE,kBAAkB,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC;AAC5F,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,EAAE,gCAAgC,EAAE,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAAC;AAC3F,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AACnD,MAAM,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAC7D,MAAM,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAE/D;;GAEG;AACH,MAAa,sBAAuB,SAAQ,kBAAkB;IAC7D;;;;;;;;OAQG;IACH,YAAY,SAAS;QACpB,KAAK,CAAC,SAAS,CAAC,CAAC;IAClB,CAAC;IAED;;;;;;;OAOG;IACH,wBAAwB;QACvB,OAAO,YAAY,CAAC,yCAAyC,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IACjF,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,GAAG,CAAC,MAAM,EAAE,UAAU;QACrB,UAAU,GAAG,UAAU,IAAI,EAAE,CAAC;QAC9B,UAAU,CAAC,uBAAuB;YACjC,UAAU,CAAC,uBAAuB,KAAK,SAAS;gBAC/C,CAAC,CAAC,YAAY,CAAC,oB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AAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE;YACnC,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;SAC/B;IACF,CAAC;;AA7NF,wDAsPC;AAvBA;;;;;;;;;;;GAWG;AACI,2CAAoB,GAAG,UAAU,QAAQ,EAAE,aAAa;IAC9D,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QACzB,MAAM,IAAI,SAAS,CAAC,GAAG,CAAC,kBAAkB,GAAG,yBAAyB,GAAG,aAAa,CAAC,CAAC;KACxF;IACD,IAAI,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC;IAC1B,IAAI,GAAG,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;IACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;QAC7B,GAAG,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;KAC5D;IACD,OAAO,GAAG,CAAC;AACZ,CAAC,CAAC;AAEH,sBAAsB,CAAC,SAAS,CAAC,OAAO,GAAG,WAAW,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 reference array property class\n */\nconst { PathHelper, TypeIdHelper } = require(\"@fluid-experimental/property-changeset\");\nconst { MSG } = require(\"@fluid-experimental/property-common\").constants;\nconst { UniversalDataArray, ConsoleUtils } = require(\"@fluid-experimental/property-common\");\nconst _ = require(\"lodash\");\nconst { AbstractStaticCollectionProperty } = require(\"./abstractStaticCollectionProperty\");\nconst { BaseProperty } = require(\"./baseProperty\");\nconst { ReferenceProperty } = require(\"./referenceProperty\");\nconst { ValueArrayProperty } = require(\"./valueArrayProperty\");\n\n/**\n * An ArrayProperty which stores reference values\n */\nexport class ReferenceArrayProperty extends ValueArrayProperty {\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.ArrayProperty\n\t * @alias property-properties.ReferenceArrayProperty\n\t * @category Arrays\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n\n\t/**\n\t * Returns the typeid for the target of this reference\n\t *\n\t * Note: This is the type that is specified in the typeid of this reference and not the actual type\n\t * of the referenced object, which might inherit from that typeid.\n\t *\n\t * @returns {string} The typeid of the nodes this reference may point to\n\t */\n\tgetReferenceTargetTypeId() {\n\t\treturn TypeIdHelper.extractReferenceTargetTypeIdFromReference(this.getTypeid());\n\t}\n\n\t/**\n\t * Resolves the referenced property for the given key\n\t *\n\t * @param {number | Array<string | number>} in_ids - the ID of the property or an array of IDs if an array is passed,\n\t * the .get function will be performed on each id in sequence for example .get([0, 'position','x']) is equivalent to\n\t * .get(0).get('position').get('x'). If `.get` resolves to a ReferenceProperty, it will, by default, return the\n\t * property that the ReferenceProperty refers to.\n\t * @param {Object} in_options - parameter object\n\t * @param {property-properties.BaseProperty.REFERENCE_RESOLUTION} [in_options.referenceResolutionMode=ALWAYS] - How\n\t * should this function behave during reference resolution?\n\t *\n\t * @returns {property-properties.BaseProperty|undefined} The property object the reference points to or undefined if\n\t * it could not be resolved\n\t */\n\tget(in_ids, in_options) {\n\t\tin_options = in_options || {};\n\t\tin_options.referenceResolutionMode =\n\t\t\tin_options.referenceResolutionMode === undefined\n\t\t\t\t? BaseProperty.REFERENCE_RESOLUTION.ALWAYS\n\t\t\t\t: in_options.referenceResolutionMode;\n\n\t\tif (_.isArray(in_ids)) {\n\t\t\t// Forward handling of arrays to the AbstractStaticCollectionProperty function\n\t\t\treturn AbstractStaticCollectionProperty.prototype.get.call(this, in_ids, in_options);\n\t\t} else {\n\t\t\tvar value = this._dataArrayRef.getValue(in_ids);\n\t\t\tif (value === undefined || value === \"\") {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\treturn this.getParent().resolvePath(value, in_options);\n\t\t}\n\t}\n\n\t/**\n\t * Checks whether the reference is valid. This is either the case when it is empty or when the referenced\n\t * property exists.\n\t *\n\t * @param {number} in_position - The target index\n\t * @returns {boolean} True if the reference is valid, otherwise false.\n\t */\n\tisReferenceValid(in_position) {\n\t\treturn (\n\t\t\tValueArrayProperty.prototype.get.call(this, in_position) === \"\" ||\n\t\t\tthis.get(in_position) !== undefined\n\t\t);\n\t}\n\n\t/**\n\t * Sets the range in the array to point to the given property objects or to be equal to the given paths\n\t *\n\t * @param {number} in_offset - Target start index\n\t * @param {Array<property-properties.BaseProperty|undefined|String>} in_array - Contains the properties to be set or\n\t * the paths to those properties. If undefined is passed, the reference will be set to an empty string to\n\t * indicate an empty reference.\n\t * @throws If in_offset is smaller than zero, larger than the length of the array or not a number\n\t * @throws If in_array is not an array\n\t * @throws If one of the items in in_array is defined, but is not a property or a string.\n\t */\n\tsetRange(in_offset, in_array) {\n\t\tvar arr = ReferenceArrayProperty._convertInputToPaths(in_array, \"setRange\");\n\t\tValueArrayProperty.prototype.setRange.call(this, in_offset, arr);\n\t}\n\n\t/**\n\t * Insert a range which points to the given property objects into the array\n\t *\n\t * @param {number} in_offset - Target start index\n\t * @param {Array<property-properties.BaseProperty|undefined|String>} in_array - Contains the properties to be set or\n\t * the paths to those properties. If undefined is passed, the reference will be set to an empty string to\n\t * indicate an empty reference.\n\t * @throws If in_offset is smaller than zero, larger than the length of the array or not a number\n\t * @throws If in_array is not an array\n\t * @throws If one of the items in in_array is defined, but is not a property or a string.\n\t */\n\tinsertRange(in_offset, in_array) {\n\t\tvar arr = ReferenceArrayProperty._convertInputToPaths(in_array, \"insertRange\");\n\t\tValueArrayProperty.prototype.insertRange.call(this, in_offset, arr);\n\t}\n\n\t/**\n\t * Returns the path value of a reference.\n\t * @param {number} in_id - The index of the property\n\t * @returns {string} The path string\n\t */\n\tgetValue(in_id) {\n\t\treturn this._dataArrayRef.getValue(in_id);\n\t}\n\n\t/**\n\t * Returns an object with all the nested values contained in this property\n\t * @returns {Array<String>} an array of strings representing the paths listed in this array\n\t * for example: ['/path1', '/path2']\n\t */\n\tgetValues() {\n\t\tvar result = [];\n\t\tvar ids = this.getIds();\n\t\tfor (var i = 0; i < ids.length; i++) {\n\t\t\tresult.push(this.getValue(ids[i]));\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * Removes the last element of the array\n\t * @throws If trying to modify a referenced property\n\t * @returns {String} deleted element (string path)\n\t */\n\tpop() {\n\t\tif (this._dataArrayRef.length > 0) {\n\t\t\tvar item = this.getValue(this._dataArrayRef.length - 1);\n\t\t\tthis.remove(this._dataArrayRef.length - 1);\n\t\t\treturn item;\n\t\t} else {\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\t/**\n\t * Removes an element of the array and shift remaining elements to the left\n\t * @param {number} in_position - The index that will be removed\n\t * @throws If in_position is not a number\n\t * @throws If trying to remove an item with a parent\n\t * @throws If trying to remove something that does not exist\n\t * @returns {String} the value that was removed (string path).\n\t */\n\tremove(in_position) {\n\t\tvar value = this.getValue(in_position);\n\t\tthis.removeRange(in_position, 1);\n\t\treturn value;\n\t}\n\n\t/**\n\t * Removes a given number of elements from the array and shifts remaining values to the left.\n\t * @param {number} in_offset - Target start index\n\t * @param {number} in_deleteCount - Number of elements to be deleted\n\t * @throws If in_offset is not a number\n\t * @throws If in_deleteCount is not a number\n\t * @throws If trying to remove an item with a parent\n\t * @throws If in_offset is smaller than zero or if in_offset + in_delete count is larger than the length of the array\n\t * @returns {Array<String>} an array containing the values removed (string paths)\n\t */\n\tremoveRange(in_offset, in_deleteCount) {\n\t\tConsoleUtils.assert(\n\t\t\t_.isNumber(in_offset),\n\t\t\tMSG.NOT_NUMBER + \"in_offset, method: ArrayProperty.removeRange or .remove\",\n\t\t);\n\t\tConsoleUtils.assert(\n\t\t\t_.isNumber(in_deleteCount),\n\t\t\tMSG.NOT_NUMBER + \"in_deleteCount, method: ArrayProperty.removeRange or .remove\",\n\t\t);\n\t\tConsoleUtils.assert(\n\t\t\tin_offset + in_deleteCount < this.length + 1 && in_offset >= 0 && in_deleteCount > 0,\n\t\t\tMSG.REMOVE_OUT_OF_BOUNDS +\n\t\t\t\t\"Cannot remove \" +\n\t\t\t\tin_deleteCount +\n\t\t\t\t\" items starting at index \" +\n\t\t\t\tin_offset,\n\t\t);\n\t\tvar result = [];\n\t\tfor (var i = in_offset; i < in_offset + in_deleteCount; i++) {\n\t\t\tresult.push(this.getValue(i));\n\t\t}\n\t\tthis._checkIsNotReadOnly(true);\n\t\tthis._removeRangeWithoutDirtying(in_offset, in_deleteCount);\n\t\tthis._setDirty();\n\t\treturn result;\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\t_resolvePathSegment(in_segment, in_segmentType) {\n\t\t// Array tokens are automatically resolved\n\t\treturn in_segmentType === PathHelper.TOKEN_TYPES.ARRAY_TOKEN\n\t\t\t? this.get(in_segment, {\n\t\t\t\t\treferenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER,\n\t\t\t })\n\t\t\t: // Everything else is handled by the implementation in the base property\n\t\t\t AbstractStaticCollectionProperty.prototype._resolvePathSegment.call(\n\t\t\t\t\tthis,\n\t\t\t\t\tin_segment,\n\t\t\t\t\tin_segmentType,\n\t\t\t );\n\t}\n\n\t/**\n\t * Creates and initializes the data array\n\t * @param {Number} in_length - The initial length of the array\n\t */\n\t_dataArrayCreate(in_length) {\n\t\tthis._dataArrayRef = new UniversalDataArray(in_length);\n\t\tfor (var i = 0; i < in_length; i++) {\n\t\t\tthis._dataArraySetValue(i, \"\");\n\t\t}\n\t}\n\n\t/**\n\t * Validates the array and returns a sanitized version of it containing only strings.\n\t *\n\t * @param {Array<property-properties.BaseProperty|undefined|String>} in_array - contains the properties to be set or\n\t * the paths to those properties. If undefined is passed, the reference will be set to an empty string to\n\t * indicate an empty reference.\n\t * @param {String} in_callerName - the name of the function that called, to make it appear in\n\t * the error message if any\n\t * @returns {Array<string>} The array of paths\n\t * @throws If in_array is not an array\n\t * @throws If one of the items in in_array is defined, but is not a property or a string.\n\t */\n\tstatic _convertInputToPaths = function (in_array, in_callerName) {\n\t\tif (!_.isArray(in_array)) {\n\t\t\tthrow new TypeError(MSG.IN_ARRAY_NOT_ARRAY + \"ReferenceArrayProperty.\" + in_callerName);\n\t\t}\n\t\tvar len = in_array.length;\n\t\tvar arr = new Array(len);\n\t\tfor (var i = 0; i < len; i++) {\n\t\t\tarr[i] = ReferenceProperty._convertInputToPath(in_array[i]);\n\t\t}\n\t\treturn arr;\n\t};\n}\nReferenceArrayProperty.prototype._typeid = \"Reference\";\n"]}
1
+ {"version":3,"file":"referenceArrayProperty.js","sourceRoot":"","sources":["../../src/properties/referenceArrayProperty.js"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH;;GAEG;AACH,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AACvF,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC;AACzE,MAAM,EAAE,kBAAkB,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC;AAC5F,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,EAAE,gCAAgC,EAAE,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAAC;AAC3F,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AACnD,MAAM,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAC7D,MAAM,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAE/D;;;GAGG;AACH,MAAa,sBAAuB,SAAQ,kBAAkB;IAC7D;;;;;;;;OAQG;IACH,YAAY,SAAS;QACpB,KAAK,CAAC,SAAS,CAAC,CAAC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AU,EAAE;gBACrB,uBAAuB,EAAE,YAAY,CAAC,oBAAoB,CAAC,KAAK;aAC/D,CAAC;YACJ,CAAC,CAAC,wEAAwE;gBACxE,gCAAgC,CAAC,SAAS,CAAC,mBAAmB,CAAC,IAAI,CACnE,IAAI,EACJ,UAAU,EACV,cAAc,CACb,CAAC;IACN,CAAC;IAED;;;OAGG;IACH,gBAAgB,CAAC,SAAS;QACzB,IAAI,CAAC,aAAa,GAAG,IAAI,kBAAkB,CAAC,SAAS,CAAC,CAAC;QACvD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE;YACnC,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;SAC/B;IACF,CAAC;;AA7NF,wDAsPC;AAvBA;;;;;;;;;;;GAWG;AACI,2CAAoB,GAAG,UAAU,QAAQ,EAAE,aAAa;IAC9D,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QACzB,MAAM,IAAI,SAAS,CAAC,GAAG,CAAC,kBAAkB,GAAG,yBAAyB,GAAG,aAAa,CAAC,CAAC;KACxF;IACD,IAAI,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC;IAC1B,IAAI,GAAG,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;IACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;QAC7B,GAAG,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;KAC5D;IACD,OAAO,GAAG,CAAC;AACZ,CAAC,CAAC;AAEH,sBAAsB,CAAC,SAAS,CAAC,OAAO,GAAG,WAAW,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 reference array property class\n */\nconst { PathHelper, TypeIdHelper } = require(\"@fluid-experimental/property-changeset\");\nconst { MSG } = require(\"@fluid-experimental/property-common\").constants;\nconst { UniversalDataArray, ConsoleUtils } = require(\"@fluid-experimental/property-common\");\nconst _ = require(\"lodash\");\nconst { AbstractStaticCollectionProperty } = require(\"./abstractStaticCollectionProperty\");\nconst { BaseProperty } = require(\"./baseProperty\");\nconst { ReferenceProperty } = require(\"./referenceProperty\");\nconst { ValueArrayProperty } = require(\"./valueArrayProperty\");\n\n/**\n * An ArrayProperty which stores reference values\n * @internal\n */\nexport class ReferenceArrayProperty extends ValueArrayProperty {\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.ArrayProperty\n\t * @alias property-properties.ReferenceArrayProperty\n\t * @category Arrays\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n\n\t/**\n\t * Returns the typeid for the target of this reference\n\t *\n\t * Note: This is the type that is specified in the typeid of this reference and not the actual type\n\t * of the referenced object, which might inherit from that typeid.\n\t *\n\t * @returns {string} The typeid of the nodes this reference may point to\n\t */\n\tgetReferenceTargetTypeId() {\n\t\treturn TypeIdHelper.extractReferenceTargetTypeIdFromReference(this.getTypeid());\n\t}\n\n\t/**\n\t * Resolves the referenced property for the given key\n\t *\n\t * @param {number | Array<string | number>} in_ids - the ID of the property or an array of IDs if an array is passed,\n\t * the .get function will be performed on each id in sequence for example .get([0, 'position','x']) is equivalent to\n\t * .get(0).get('position').get('x'). If `.get` resolves to a ReferenceProperty, it will, by default, return the\n\t * property that the ReferenceProperty refers to.\n\t * @param {Object} in_options - parameter object\n\t * @param {property-properties.BaseProperty.REFERENCE_RESOLUTION} [in_options.referenceResolutionMode=ALWAYS] - How\n\t * should this function behave during reference resolution?\n\t *\n\t * @returns {property-properties.BaseProperty|undefined} The property object the reference points to or undefined if\n\t * it could not be resolved\n\t */\n\tget(in_ids, in_options) {\n\t\tin_options = in_options || {};\n\t\tin_options.referenceResolutionMode =\n\t\t\tin_options.referenceResolutionMode === undefined\n\t\t\t\t? BaseProperty.REFERENCE_RESOLUTION.ALWAYS\n\t\t\t\t: in_options.referenceResolutionMode;\n\n\t\tif (_.isArray(in_ids)) {\n\t\t\t// Forward handling of arrays to the AbstractStaticCollectionProperty function\n\t\t\treturn AbstractStaticCollectionProperty.prototype.get.call(this, in_ids, in_options);\n\t\t} else {\n\t\t\tvar value = this._dataArrayRef.getValue(in_ids);\n\t\t\tif (value === undefined || value === \"\") {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\treturn this.getParent().resolvePath(value, in_options);\n\t\t}\n\t}\n\n\t/**\n\t * Checks whether the reference is valid. This is either the case when it is empty or when the referenced\n\t * property exists.\n\t *\n\t * @param {number} in_position - The target index\n\t * @returns {boolean} True if the reference is valid, otherwise false.\n\t */\n\tisReferenceValid(in_position) {\n\t\treturn (\n\t\t\tValueArrayProperty.prototype.get.call(this, in_position) === \"\" ||\n\t\t\tthis.get(in_position) !== undefined\n\t\t);\n\t}\n\n\t/**\n\t * Sets the range in the array to point to the given property objects or to be equal to the given paths\n\t *\n\t * @param {number} in_offset - Target start index\n\t * @param {Array<property-properties.BaseProperty|undefined|String>} in_array - Contains the properties to be set or\n\t * the paths to those properties. If undefined is passed, the reference will be set to an empty string to\n\t * indicate an empty reference.\n\t * @throws If in_offset is smaller than zero, larger than the length of the array or not a number\n\t * @throws If in_array is not an array\n\t * @throws If one of the items in in_array is defined, but is not a property or a string.\n\t */\n\tsetRange(in_offset, in_array) {\n\t\tvar arr = ReferenceArrayProperty._convertInputToPaths(in_array, \"setRange\");\n\t\tValueArrayProperty.prototype.setRange.call(this, in_offset, arr);\n\t}\n\n\t/**\n\t * Insert a range which points to the given property objects into the array\n\t *\n\t * @param {number} in_offset - Target start index\n\t * @param {Array<property-properties.BaseProperty|undefined|String>} in_array - Contains the properties to be set or\n\t * the paths to those properties. If undefined is passed, the reference will be set to an empty string to\n\t * indicate an empty reference.\n\t * @throws If in_offset is smaller than zero, larger than the length of the array or not a number\n\t * @throws If in_array is not an array\n\t * @throws If one of the items in in_array is defined, but is not a property or a string.\n\t */\n\tinsertRange(in_offset, in_array) {\n\t\tvar arr = ReferenceArrayProperty._convertInputToPaths(in_array, \"insertRange\");\n\t\tValueArrayProperty.prototype.insertRange.call(this, in_offset, arr);\n\t}\n\n\t/**\n\t * Returns the path value of a reference.\n\t * @param {number} in_id - The index of the property\n\t * @returns {string} The path string\n\t */\n\tgetValue(in_id) {\n\t\treturn this._dataArrayRef.getValue(in_id);\n\t}\n\n\t/**\n\t * Returns an object with all the nested values contained in this property\n\t * @returns {Array<String>} an array of strings representing the paths listed in this array\n\t * for example: ['/path1', '/path2']\n\t */\n\tgetValues() {\n\t\tvar result = [];\n\t\tvar ids = this.getIds();\n\t\tfor (var i = 0; i < ids.length; i++) {\n\t\t\tresult.push(this.getValue(ids[i]));\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * Removes the last element of the array\n\t * @throws If trying to modify a referenced property\n\t * @returns {String} deleted element (string path)\n\t */\n\tpop() {\n\t\tif (this._dataArrayRef.length > 0) {\n\t\t\tvar item = this.getValue(this._dataArrayRef.length - 1);\n\t\t\tthis.remove(this._dataArrayRef.length - 1);\n\t\t\treturn item;\n\t\t} else {\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\t/**\n\t * Removes an element of the array and shift remaining elements to the left\n\t * @param {number} in_position - The index that will be removed\n\t * @throws If in_position is not a number\n\t * @throws If trying to remove an item with a parent\n\t * @throws If trying to remove something that does not exist\n\t * @returns {String} the value that was removed (string path).\n\t */\n\tremove(in_position) {\n\t\tvar value = this.getValue(in_position);\n\t\tthis.removeRange(in_position, 1);\n\t\treturn value;\n\t}\n\n\t/**\n\t * Removes a given number of elements from the array and shifts remaining values to the left.\n\t * @param {number} in_offset - Target start index\n\t * @param {number} in_deleteCount - Number of elements to be deleted\n\t * @throws If in_offset is not a number\n\t * @throws If in_deleteCount is not a number\n\t * @throws If trying to remove an item with a parent\n\t * @throws If in_offset is smaller than zero or if in_offset + in_delete count is larger than the length of the array\n\t * @returns {Array<String>} an array containing the values removed (string paths)\n\t */\n\tremoveRange(in_offset, in_deleteCount) {\n\t\tConsoleUtils.assert(\n\t\t\t_.isNumber(in_offset),\n\t\t\tMSG.NOT_NUMBER + \"in_offset, method: ArrayProperty.removeRange or .remove\",\n\t\t);\n\t\tConsoleUtils.assert(\n\t\t\t_.isNumber(in_deleteCount),\n\t\t\tMSG.NOT_NUMBER + \"in_deleteCount, method: ArrayProperty.removeRange or .remove\",\n\t\t);\n\t\tConsoleUtils.assert(\n\t\t\tin_offset + in_deleteCount < this.length + 1 && in_offset >= 0 && in_deleteCount > 0,\n\t\t\tMSG.REMOVE_OUT_OF_BOUNDS +\n\t\t\t\t\"Cannot remove \" +\n\t\t\t\tin_deleteCount +\n\t\t\t\t\" items starting at index \" +\n\t\t\t\tin_offset,\n\t\t);\n\t\tvar result = [];\n\t\tfor (var i = in_offset; i < in_offset + in_deleteCount; i++) {\n\t\t\tresult.push(this.getValue(i));\n\t\t}\n\t\tthis._checkIsNotReadOnly(true);\n\t\tthis._removeRangeWithoutDirtying(in_offset, in_deleteCount);\n\t\tthis._setDirty();\n\t\treturn result;\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\t_resolvePathSegment(in_segment, in_segmentType) {\n\t\t// Array tokens are automatically resolved\n\t\treturn in_segmentType === PathHelper.TOKEN_TYPES.ARRAY_TOKEN\n\t\t\t? this.get(in_segment, {\n\t\t\t\t\treferenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER,\n\t\t\t })\n\t\t\t: // Everything else is handled by the implementation in the base property\n\t\t\t AbstractStaticCollectionProperty.prototype._resolvePathSegment.call(\n\t\t\t\t\tthis,\n\t\t\t\t\tin_segment,\n\t\t\t\t\tin_segmentType,\n\t\t\t );\n\t}\n\n\t/**\n\t * Creates and initializes the data array\n\t * @param {Number} in_length - The initial length of the array\n\t */\n\t_dataArrayCreate(in_length) {\n\t\tthis._dataArrayRef = new UniversalDataArray(in_length);\n\t\tfor (var i = 0; i < in_length; i++) {\n\t\t\tthis._dataArraySetValue(i, \"\");\n\t\t}\n\t}\n\n\t/**\n\t * Validates the array and returns a sanitized version of it containing only strings.\n\t *\n\t * @param {Array<property-properties.BaseProperty|undefined|String>} in_array - contains the properties to be set or\n\t * the paths to those properties. If undefined is passed, the reference will be set to an empty string to\n\t * indicate an empty reference.\n\t * @param {String} in_callerName - the name of the function that called, to make it appear in\n\t * the error message if any\n\t * @returns {Array<string>} The array of paths\n\t * @throws If in_array is not an array\n\t * @throws If one of the items in in_array is defined, but is not a property or a string.\n\t */\n\tstatic _convertInputToPaths = function (in_array, in_callerName) {\n\t\tif (!_.isArray(in_array)) {\n\t\t\tthrow new TypeError(MSG.IN_ARRAY_NOT_ARRAY + \"ReferenceArrayProperty.\" + in_callerName);\n\t\t}\n\t\tvar len = in_array.length;\n\t\tvar arr = new Array(len);\n\t\tfor (var i = 0; i < len; i++) {\n\t\t\tarr[i] = ReferenceProperty._convertInputToPath(in_array[i]);\n\t\t}\n\t\treturn arr;\n\t};\n}\nReferenceArrayProperty.prototype._typeid = \"Reference\";\n"]}
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * A StringMapProperty which stores reference values
3
+ * @internal
3
4
  */
4
5
  export class ReferenceMapProperty extends StringMapProperty {
5
6
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"referenceMapProperty.d.ts","sourceRoot":"","sources":["../../src/properties/referenceMapProperty.js"],"names":[],"mappings":"AAeA;;GAEG;AACH;IAcC;;;;;;;OAOG;IACH,4BAFa,MAAM,CAIlB;IAED;;;;;;;;;;;;;;OAcG;IACH,YAZW,MAAM,GAAG,MAAM,MAAM,GAAG,MAAM,CAAC,oBAS7B,YAAY,GAAG,SAAS,CAoBpC;IAED;;;;;;OAMG;IACH,eAJW,MAAM,UAQhB;IA0CD;;;;;;;;;;OAUG;IACH,+BAEC;IAiBD;;;;;;OAMG;IACH,yBAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;;OAIG;IACH,iBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;OAEG;IACH,+DAYC;CACD"}
1
+ {"version":3,"file":"referenceMapProperty.d.ts","sourceRoot":"","sources":["../../src/properties/referenceMapProperty.js"],"names":[],"mappings":"AAeA;;;GAGG;AACH;IAcC;;;;;;;OAOG;IACH,4BAFa,MAAM,CAIlB;IAED;;;;;;;;;;;;;;OAcG;IACH,YAZW,MAAM,GAAG,MAAM,MAAM,GAAG,MAAM,CAAC,oBAS7B,YAAY,GAAG,SAAS,CAoBpC;IAED;;;;;;OAMG;IACH,eAJW,MAAM,UAQhB;IA0CD;;;;;;;;;;OAUG;IACH,+BAEC;IAiBD;;;;;;OAMG;IACH,yBAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;;OAIG;IACH,iBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;OAEG;IACH,+DAYC;CACD"}
@@ -17,6 +17,7 @@ const { ReferenceProperty } = require("./referenceProperty");
17
17
  const { StringMapProperty } = require("./valueMapProperty");
18
18
  /**
19
19
  * A StringMapProperty which stores reference values
20
+ * @internal
20
21
  */
21
22
  class ReferenceMapProperty extends StringMapProperty {
22
23
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"referenceMapProperty.js","sourceRoot":"","sources":["../../src/properties/referenceMapProperty.js"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH;;GAEG;AACH,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AACvF,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC;AACzE,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AACnD,MAAM,EAAE,iBAAiB,EAAE,GAAG,O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BAAgB,CAAC,MAAM;QACtB,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC;IAC7F,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,MAAM;QACd,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,mBAAmB,CAAC,UAAU,EAAE,cAAc;QAC7C,0CAA0C;QAC1C,OAAO,cAAc,KAAK,UAAU,CAAC,WAAW,CAAC,WAAW;YAC3D,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE;gBACrB,uBAAuB,EAAE,YAAY,CAAC,oBAAoB,CAAC,KAAK;aAC/D,CAAC;YACJ,CAAC,CAAC,wEAAwE;gBACxE,gCAAgC,CAAC,SAAS,CAAC,mBAAmB,CAAC,IAAI,CACnE,IAAI,EACJ,UAAU,EACV,cAAc,CACb,CAAC;IACN,CAAC;CACD;AAnLD,oDAmLC;AAED,oBAAoB,CAAC,SAAS,CAAC,OAAO,GAAG,WAAW,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 reference map property class\n */\nconst { PathHelper, TypeIdHelper } = require(\"@fluid-experimental/property-changeset\");\nconst { MSG } = require(\"@fluid-experimental/property-common\").constants;\nconst _ = require(\"lodash\");\nconst { BaseProperty } = require(\"./baseProperty\");\nconst { ContainerProperty } = require(\"./containerProperty\");\nconst { ReferenceProperty } = require(\"./referenceProperty\");\nconst { StringMapProperty } = require(\"./valueMapProperty\");\n\n/**\n * A StringMapProperty which stores reference values\n */\nexport class ReferenceMapProperty extends StringMapProperty {\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.StringMapProperty\n\t * @alias property-properties.ReferenceMapProperty\n\t * @category Maps\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n\n\t/**\n\t * Returns the typeid for the target of this reference\n\t *\n\t * Note: This is the type that is specified in the typeid of this reference and not the actual type\n\t * of the referenced object, which might inherit from that typeid.\n\t *\n\t * @returns {string} The typeid of the nodes this reference may point to\n\t */\n\tgetReferenceTargetTypeId() {\n\t\treturn TypeIdHelper.extractReferenceTargetTypeIdFromReference(this.getTypeid());\n\t}\n\n\t/**\n\t * Resolves the referenced property for the given key\n\t *\n\t * @param {string | Array<string | number>} in_ids - The ID of the property or an array of IDs\n\t * if an array is passed, the .get function will be performed on each id in sequence\n\t * for example .get(['position','x']) is equivalent to .get('position').get('x').\n\t * If .get resolves to a ReferenceProperty, it will return the property that the ReferenceProperty\n\t * refers to.\n\t * @param {Object} in_options - parameter object\n\t * @param {property-properties.BaseProperty.REFERENCE_RESOLUTION} [in_options.referenceResolutionMode=ALWAYS] - How\n\t * should this function behave during reference resolution?\n\t *\n\t * @returns {BaseProperty | undefined} The property object the reference points to or undefined\n\t * if it could not be resolved\n\t */\n\tget(in_ids, in_options) {\n\t\tin_options = in_options || {};\n\t\tin_options.referenceResolutionMode =\n\t\t\tin_options.referenceResolutionMode === undefined\n\t\t\t\t? BaseProperty.REFERENCE_RESOLUTION.ALWAYS\n\t\t\t\t: in_options.referenceResolutionMode;\n\n\t\tif (_.isArray(in_ids)) {\n\t\t\t// Forward handling of arrays to the BaseProperty function\n\t\t\treturn AbstractStaticCollectionProperty.prototype.get.call(this, in_ids, in_options);\n\t\t} else {\n\t\t\tvar value = this._dynamicChildren[in_ids];\n\t\t\tif (value === undefined || value === \"\") {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn this.getParent().resolvePath(value, in_options);\n\t\t}\n\t}\n\n\t/**\n\t * Removes the entry with the given key from the map\n\t *\n\t * @param {string} in_key - The key of the entry to remove from the map\n\t * @throws If trying to remove an entry that does not exist\n\t * @returns {String} the item removed (a string pathT\n\t */\n\tremove(in_key) {\n\t\tvar item = this.getValue(in_key);\n\t\tthis._removeByKey(in_key, true);\n\t\treturn item;\n\t}\n\n\t/**\n\t * Returns an object with all the nested path values.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * 'firstPath': '/path',\n\t * 'secondPath': '/path2'\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.getValue(ids[i]);\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * Sets or inserts the reference to point to the given property object or to be equal to the given path string.\n\t *\n\t * @param {string} in_key - The key under which the entry is stored\n\t * @param {property-properties.BaseProperty|undefined|String} in_value - The property to assign to the reference or\n\t * the path to this property. If undefined is passed, the reference will be set to an empty string to\n\t * indicate an empty reference.\n\t * @throws If in_key is not a string\n\t * @throws If in_value is defined, but is not a property or a string.\n\t * @throws If map is read only\n\t */\n\tset(in_key, in_value) {\n\t\tif (!_.isString(in_key)) {\n\t\t\tthrow new TypeError(MSG.KEY_NOT_STRING + in_key);\n\t\t}\n\t\tvar value = ReferenceProperty._convertInputToPath(in_value);\n\t\tStringMapProperty.prototype.set.call(this, in_key, value);\n\t}\n\n\t/**\n\t * Sets or inserts the reference to point to the given property object or to be equal to the given path string.\n\t *\n\t * @param {string} in_key - The key under which the entry is stored\n\t * @param {property-properties.BaseProperty|undefined|String} in_value - The property to assign to the reference or\n\t * the path to this property. If undefined is passed, the reference will be set to an empty string to\n\t * indicate an empty reference.\n\t * @throws If in_key is not a string\n\t * @throws If in_value is defined, but is not a property or a string.\n\t * @deprecated\n\t */\n\tsetValue(...args) {\n\t\treturn this.set(...args);\n\t}\n\n\t/**\n\t * Inserts the reference to point to the given property object or to be equal to the given path string.\n\t *\n\t * @param {string} in_key - The key under which the entry is stored\n\t * @param {property-properties.BaseProperty|undefined|String} in_value - The property to assign to the reference or\n\t * the path to this property. If undefined is passed, the reference will be set to an empty string to\n\t * indicate an empty reference.\n\t * @throws If there is already an entry under in_key\n\t * @throws If in_value is defined, but is not a property or a string.\n\t */\n\tinsert(in_key, in_value) {\n\t\tvar value = ReferenceProperty._convertInputToPath(in_value);\n\t\tthis._insert(in_key, value, true);\n\t}\n\n\t/**\n\t * Checks whether the reference is valid. This is either the case when it is empty or when the referenced\n\t * property exists.\n\t *\n\t * @param {string} in_key - Key of the entry to check\n\t * @returns {boolean} True if the reference is valid, otherwise false.\n\t */\n\tisReferenceValid(in_key) {\n\t\treturn this.has(in_key) && (this.getValue(in_key) === \"\" || this.get(in_key) !== undefined);\n\t}\n\n\t/**\n\t * Returns the string value stored in the map\n\t * @param {string} in_key - The key of the reference\n\t * @returns {string} The path string\n\t */\n\tgetValue(in_key) {\n\t\treturn this._getValue(in_key);\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\t_resolvePathSegment(in_segment, in_segmentType) {\n\t\t// Array tokens are automatically resolved\n\t\treturn in_segmentType === PathHelper.TOKEN_TYPES.ARRAY_TOKEN\n\t\t\t? this.get(in_segment, {\n\t\t\t\t\treferenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER,\n\t\t\t })\n\t\t\t: // Everything else is handled by the implementation in the base property\n\t\t\t AbstractStaticCollectionProperty.prototype._resolvePathSegment.call(\n\t\t\t\t\tthis,\n\t\t\t\t\tin_segment,\n\t\t\t\t\tin_segmentType,\n\t\t\t );\n\t}\n}\n\nReferenceMapProperty.prototype._typeid = \"Reference\";\n"]}
1
+ {"version":3,"file":"referenceMapProperty.js","sourceRoot":"","sources":["../../src/properties/referenceMapProperty.js"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH;;GAEG;AACH,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AACvF,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,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AAM,EAAE,QAAQ;QACtB,IAAI,KAAK,GAAG,iBAAiB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;QAC5D,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IACnC,CAAC;IAED;;;;;;OAMG;IACH,gBAAgB,CAAC,MAAM;QACtB,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC;IAC7F,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,MAAM;QACd,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,mBAAmB,CAAC,UAAU,EAAE,cAAc;QAC7C,0CAA0C;QAC1C,OAAO,cAAc,KAAK,UAAU,CAAC,WAAW,CAAC,WAAW;YAC3D,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE;gBACrB,uBAAuB,EAAE,YAAY,CAAC,oBAAoB,CAAC,KAAK;aAC/D,CAAC;YACJ,CAAC,CAAC,wEAAwE;gBACxE,gCAAgC,CAAC,SAAS,CAAC,mBAAmB,CAAC,IAAI,CACnE,IAAI,EACJ,UAAU,EACV,cAAc,CACb,CAAC;IACN,CAAC;CACD;AAnLD,oDAmLC;AAED,oBAAoB,CAAC,SAAS,CAAC,OAAO,GAAG,WAAW,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 reference map property class\n */\nconst { PathHelper, TypeIdHelper } = require(\"@fluid-experimental/property-changeset\");\nconst { MSG } = require(\"@fluid-experimental/property-common\").constants;\nconst _ = require(\"lodash\");\nconst { BaseProperty } = require(\"./baseProperty\");\nconst { ContainerProperty } = require(\"./containerProperty\");\nconst { ReferenceProperty } = require(\"./referenceProperty\");\nconst { StringMapProperty } = require(\"./valueMapProperty\");\n\n/**\n * A StringMapProperty which stores reference values\n * @internal\n */\nexport class ReferenceMapProperty extends StringMapProperty {\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.StringMapProperty\n\t * @alias property-properties.ReferenceMapProperty\n\t * @category Maps\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n\n\t/**\n\t * Returns the typeid for the target of this reference\n\t *\n\t * Note: This is the type that is specified in the typeid of this reference and not the actual type\n\t * of the referenced object, which might inherit from that typeid.\n\t *\n\t * @returns {string} The typeid of the nodes this reference may point to\n\t */\n\tgetReferenceTargetTypeId() {\n\t\treturn TypeIdHelper.extractReferenceTargetTypeIdFromReference(this.getTypeid());\n\t}\n\n\t/**\n\t * Resolves the referenced property for the given key\n\t *\n\t * @param {string | Array<string | number>} in_ids - The ID of the property or an array of IDs\n\t * if an array is passed, the .get function will be performed on each id in sequence\n\t * for example .get(['position','x']) is equivalent to .get('position').get('x').\n\t * If .get resolves to a ReferenceProperty, it will return the property that the ReferenceProperty\n\t * refers to.\n\t * @param {Object} in_options - parameter object\n\t * @param {property-properties.BaseProperty.REFERENCE_RESOLUTION} [in_options.referenceResolutionMode=ALWAYS] - How\n\t * should this function behave during reference resolution?\n\t *\n\t * @returns {BaseProperty | undefined} The property object the reference points to or undefined\n\t * if it could not be resolved\n\t */\n\tget(in_ids, in_options) {\n\t\tin_options = in_options || {};\n\t\tin_options.referenceResolutionMode =\n\t\t\tin_options.referenceResolutionMode === undefined\n\t\t\t\t? BaseProperty.REFERENCE_RESOLUTION.ALWAYS\n\t\t\t\t: in_options.referenceResolutionMode;\n\n\t\tif (_.isArray(in_ids)) {\n\t\t\t// Forward handling of arrays to the BaseProperty function\n\t\t\treturn AbstractStaticCollectionProperty.prototype.get.call(this, in_ids, in_options);\n\t\t} else {\n\t\t\tvar value = this._dynamicChildren[in_ids];\n\t\t\tif (value === undefined || value === \"\") {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn this.getParent().resolvePath(value, in_options);\n\t\t}\n\t}\n\n\t/**\n\t * Removes the entry with the given key from the map\n\t *\n\t * @param {string} in_key - The key of the entry to remove from the map\n\t * @throws If trying to remove an entry that does not exist\n\t * @returns {String} the item removed (a string pathT\n\t */\n\tremove(in_key) {\n\t\tvar item = this.getValue(in_key);\n\t\tthis._removeByKey(in_key, true);\n\t\treturn item;\n\t}\n\n\t/**\n\t * Returns an object with all the nested path values.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * 'firstPath': '/path',\n\t * 'secondPath': '/path2'\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.getValue(ids[i]);\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * Sets or inserts the reference to point to the given property object or to be equal to the given path string.\n\t *\n\t * @param {string} in_key - The key under which the entry is stored\n\t * @param {property-properties.BaseProperty|undefined|String} in_value - The property to assign to the reference or\n\t * the path to this property. If undefined is passed, the reference will be set to an empty string to\n\t * indicate an empty reference.\n\t * @throws If in_key is not a string\n\t * @throws If in_value is defined, but is not a property or a string.\n\t * @throws If map is read only\n\t */\n\tset(in_key, in_value) {\n\t\tif (!_.isString(in_key)) {\n\t\t\tthrow new TypeError(MSG.KEY_NOT_STRING + in_key);\n\t\t}\n\t\tvar value = ReferenceProperty._convertInputToPath(in_value);\n\t\tStringMapProperty.prototype.set.call(this, in_key, value);\n\t}\n\n\t/**\n\t * Sets or inserts the reference to point to the given property object or to be equal to the given path string.\n\t *\n\t * @param {string} in_key - The key under which the entry is stored\n\t * @param {property-properties.BaseProperty|undefined|String} in_value - The property to assign to the reference or\n\t * the path to this property. If undefined is passed, the reference will be set to an empty string to\n\t * indicate an empty reference.\n\t * @throws If in_key is not a string\n\t * @throws If in_value is defined, but is not a property or a string.\n\t * @deprecated\n\t */\n\tsetValue(...args) {\n\t\treturn this.set(...args);\n\t}\n\n\t/**\n\t * Inserts the reference to point to the given property object or to be equal to the given path string.\n\t *\n\t * @param {string} in_key - The key under which the entry is stored\n\t * @param {property-properties.BaseProperty|undefined|String} in_value - The property to assign to the reference or\n\t * the path to this property. If undefined is passed, the reference will be set to an empty string to\n\t * indicate an empty reference.\n\t * @throws If there is already an entry under in_key\n\t * @throws If in_value is defined, but is not a property or a string.\n\t */\n\tinsert(in_key, in_value) {\n\t\tvar value = ReferenceProperty._convertInputToPath(in_value);\n\t\tthis._insert(in_key, value, true);\n\t}\n\n\t/**\n\t * Checks whether the reference is valid. This is either the case when it is empty or when the referenced\n\t * property exists.\n\t *\n\t * @param {string} in_key - Key of the entry to check\n\t * @returns {boolean} True if the reference is valid, otherwise false.\n\t */\n\tisReferenceValid(in_key) {\n\t\treturn this.has(in_key) && (this.getValue(in_key) === \"\" || this.get(in_key) !== undefined);\n\t}\n\n\t/**\n\t * Returns the string value stored in the map\n\t * @param {string} in_key - The key of the reference\n\t * @returns {string} The path string\n\t */\n\tgetValue(in_key) {\n\t\treturn this._getValue(in_key);\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\t_resolvePathSegment(in_segment, in_segmentType) {\n\t\t// Array tokens are automatically resolved\n\t\treturn in_segmentType === PathHelper.TOKEN_TYPES.ARRAY_TOKEN\n\t\t\t? this.get(in_segment, {\n\t\t\t\t\treferenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER,\n\t\t\t })\n\t\t\t: // Everything else is handled by the implementation in the base property\n\t\t\t AbstractStaticCollectionProperty.prototype._resolvePathSegment.call(\n\t\t\t\t\tthis,\n\t\t\t\t\tin_segment,\n\t\t\t\t\tin_segmentType,\n\t\t\t );\n\t}\n}\n\nReferenceMapProperty.prototype._typeid = \"Reference\";\n"]}
@@ -3,6 +3,7 @@
3
3
  * object's value field. To do this we simply keep a pointer to the object and
4
4
  * it's associated data field that we are interested in. If no data field is
5
5
  * present this property will have an undefined value.
6
+ * @internal
6
7
  */
7
8
  export class ReferenceProperty extends ValueProperty {
8
9
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"referenceProperty.d.ts","sourceRoot":"","sources":["../../src/properties/referenceProperty.js"],"names":[],"mappings":"AAgBA;;;;;GAKG;AACH;IA2KC;;;;;;;;OAQG;IACH,2CAHa,MAAM,CAoBlB;IAxLA,cAAe;IAWhB;;;;;;;OAOG;IACH,4BAFa,MAAM,CAIlB;IAED;;;;;;;;;;;;OAYG;IACH,YAVW,MAAM,GAAG,MAAM,GAAG,MAAM,MAAM,GAAG,MAAM,CAAC,oBAOtC,YAAY,GAAG,SAAS,CAkCpC;IAED;;;;;;;;;;OAUG;IACH,qBARW,MAAM,oBAIJ,YAAY,GAAG,SAAS,CAiBpC;IAED;;;;;OAKG;IACH,oBAFa,OAAO,CAInB;IAkBD;;;;;;;;OAQG;IACH,0BAEC;IAED;;OAEG;IACH,+DAUC;IAOD,kBAEC;IAND,eAEC;IAkCF,2CAAwC;CADvC"}
1
+ {"version":3,"file":"referenceProperty.d.ts","sourceRoot":"","sources":["../../src/properties/referenceProperty.js"],"names":[],"mappings":"AAgBA;;;;;;GAMG;AACH;IA2KC;;;;;;;;OAQG;IACH,2CAHa,MAAM,CAoBlB;IAxLA,cAAe;IAWhB;;;;;;;OAOG;IACH,4BAFa,MAAM,CAIlB;IAED;;;;;;;;;;;;OAYG;IACH,YAVW,MAAM,GAAG,MAAM,GAAG,MAAM,MAAM,GAAG,MAAM,CAAC,oBAOtC,YAAY,GAAG,SAAS,CAkCpC;IAED;;;;;;;;;;OAUG;IACH,qBARW,MAAM,oBAIJ,YAAY,GAAG,SAAS,CAiBpC;IAED;;;;;OAKG;IACH,oBAFa,OAAO,CAInB;IAkBD;;;;;;;;OAQG;IACH,0BAEC;IAED;;OAEG;IACH,+DAUC;IAOD,kBAEC;IAND,eAEC;IAkCF,2CAAwC;CADvC"}
@@ -20,6 +20,7 @@ const { ValueProperty } = require("./valueProperty");
20
20
  * object's value field. To do this we simply keep a pointer to the object and
21
21
  * it's associated data field that we are interested in. If no data field is
22
22
  * present this property will have an undefined value.
23
+ * @internal
23
24
  */
24
25
  class ReferenceProperty extends ValueProperty {
25
26
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"referenceProperty.js","sourceRoot":"","sources":["../../src/properties/referenceProperty.js"],"names":[],"mappings":";AAAA;;;GAGG;AACH;;GAEG;;;AAEH,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AACvF,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC;AACzE,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,EAAE,gCAAgC,EAAE,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAAC;AAC3F,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AACnD,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAC1D,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAErD;;;;;GAKG;AACH,MAAa,iBAAkB,SAAQ,aAAa;IACnD;;;;;;;;OAQG;IACH,YAAY,SAAS;QACpB,KAAK,CAAC,SAAS,CAAC,CAAC;QACjB,oDAAoD;QACpD,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IACjB,CAAC;IAED;;;OAGG;IACH,eAAe;QACd,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;;;;;OAOG;IACH,wBAAwB;QACvB,OAAO,YAAY,CAAC,yCAAyC,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IACjF,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,GAAG,CAAC,M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AI,CAAC;QACT,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;YACjC,IAAI,GAAG,QAAQ,CAAC;SAChB;aAAM,IAAI,QAAQ,KAAK,SAAS,EAAE;YAClC,IAAI,GAAG,EAAE,CAAC;SACV;aAAM,IAAI,QAAQ,YAAY,YAAY,EAAE;YAC5C,oGAAoG;YACpG,IAAI,GAAG,QAAQ,CAAC,eAAe,EAAE,CAAC;SAClC;aAAM,IAAI,QAAQ,YAAY,MAAM,EAAE;YACtC,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;SACxB;aAAM;YACN,MAAM,IAAI,SAAS,CAClB,GAAG,CAAC,qBAAqB,GAAG,GAAG,GAAG,OAAO,QAAQ,GAAG,IAAI,GAAG,QAAQ,CACnE,CAAC;SACF;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AAtMD,8CAsMC;AACD,iBAAiB,CAAC,SAAS,CAAC,YAAY,GAAG,aAAa,CAAC,MAAM,CAAC;AAChE,iBAAiB,CAAC,SAAS,CAAC,OAAO,GAAG,WAAW,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 ReferenceProperty class\n */\n\nconst { PathHelper, TypeIdHelper } = require(\"@fluid-experimental/property-changeset\");\nconst { MSG } = require(\"@fluid-experimental/property-common\").constants;\nconst _ = require(\"lodash\");\nconst { AbstractStaticCollectionProperty } = require(\"./abstractStaticCollectionProperty\");\nconst { BaseProperty } = require(\"./baseProperty\");\nconst { _castFunctors } = require(\"./primitiveTypeCasts\");\nconst { ValueProperty } = require(\"./valueProperty\");\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 * it's associated data field that we are interested in. If no data field is\n * present this property will have an undefined value.\n */\nexport class ReferenceProperty extends ValueProperty {\n\t/**\n\t * @param {Object=} in_params - The parameters\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueProperty\n\t * @alias property-properties.ReferenceProperty\n\t * @category Properties\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t\t// default for this property type is an empty string\n\t\tthis._data = \"\";\n\t}\n\n\t/**\n\t * Evaluates Reference properties as primitives.\n\t * @returns {boolean} true since Reference properties are primitives.\n\t */\n\tisPrimitiveType() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Returns the typeid for the target of this reference\n\t *\n\t * Note: This is the type that is specified in the typeid of this reference and not the actual type\n\t * of the referenced object, which might inherit from that typeid.\n\t *\n\t * @returns {string} The typeid of the nodes this reference may point to\n\t */\n\tgetReferenceTargetTypeId() {\n\t\treturn TypeIdHelper.extractReferenceTargetTypeIdFromReference(this.getTypeid());\n\t}\n\n\t/**\n\t * Resolves the referenced property\n\t *\n\t * @param {string | number | Array<string | number>} in_ids - The ID of the property or an array of IDs if an array is\n\t * passed, the .get function will be performed on each id in sequence for example .get(['position','x']) is\n\t * equivalent to .get('position').get('x'). If .get resolves to a ReferenceProperty, it will return the property\n\t * that the ReferenceProperty refers to.\n\t * @param {Object} in_options - parameter object\n\t * @param {property-properties.BaseProperty.REFERENCE_RESOLUTION} [in_options.referenceResolutionMode=ALWAYS] - How\n\t * should this function behave during reference resolution?\n\t * @returns {BaseProperty | undefined} The property object the reference points to or undefined if\n\t * it could not be resolved\n\t */\n\tget(in_ids, in_options) {\n\t\tin_options = in_options || {};\n\t\tin_options.referenceResolutionMode =\n\t\t\tin_options.referenceResolutionMode === undefined\n\t\t\t\t? BaseProperty.REFERENCE_RESOLUTION.ALWAYS\n\t\t\t\t: in_options.referenceResolutionMode;\n\n\t\tif (_.isArray(in_ids) && in_ids.length === 0) {\n\t\t\treturn this;\n\t\t}\n\n\t\t// Since this is a reference property, we return undefined, if reference resolution is disabled\n\t\tif (in_options.referenceResolutionMode !== BaseProperty.REFERENCE_RESOLUTION.ALWAYS) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (this.value === \"\") {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (this.getParent() === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\tvar resolvedProperty = this.getParent().resolvePath(this.value, {\n\t\t\treferenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.ALWAYS,\n\t\t});\n\n\t\treturn resolvedProperty !== undefined && _.isArray(in_ids)\n\t\t\t? // Forward handling of arrays to the BaseProperty function\n\t\t\t resolvedProperty.get(in_ids, in_options)\n\t\t\t: resolvedProperty;\n\t}\n\n\t/**\n\t * Expand a path returning the value or property at the end.\n\t *\n\t * @param {string} in_path - The path\n\t * @param {Object} in_options - Parameter object\n\t * @param {property-properties.BaseProperty.REFERENCE_RESOLUTION} [in_options.referenceResolutionMode=ALWAYS] - How\n\t * should this function behave during reference resolution?\n\t * @returns {BaseProperty | undefined} resolved path\n\t * @throws if the path resolves to a primitive value\n\t * @throws if in_path is not a valid path\n\t */\n\tresolvePath(in_path, in_options) {\n\t\tif (\n\t\t\tin_options &&\n\t\t\tin_options.referenceResolutionMode &&\n\t\t\tin_options.referenceResolutionMode === BaseProperty.REFERENCE_RESOLUTION.NEVER\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn AbstractStaticCollectionProperty.prototype.resolvePath.call(\n\t\t\tthis,\n\t\t\tin_path,\n\t\t\tin_options,\n\t\t);\n\t}\n\n\t/**\n\t * Checks whether the reference is valid. This is either the case when it is empty or when the referenced\n\t * property exists.\n\t *\n\t * @returns {boolean} True if the reference is valid, otherwise false.\n\t */\n\tisReferenceValid() {\n\t\treturn this.value === \"\" || this.ref !== undefined;\n\t}\n\n\t/**\n\t * Sets the reference to point to the given property object or to be equal to the given path string.\n\t *\n\t * @param {property-properties.BaseProperty|undefined|String} in_value - The property to assign to the reference or\n\t * the path to this property. If undefined is passed, the reference will be set to an empty string to\n\t * indicate an empty reference.\n\t * @throws if property is read only\n\t * @throws if in_value is defined, but is not a property or a string.\n\t */\n\tsetValue(in_value) {\n\t\tthis._checkIsNotReadOnly(true);\n\t\tvar value = ReferenceProperty._convertInputToPath(in_value);\n\t\t// Forward the call to setValue\n\t\tValueProperty.prototype.setValue.call(this, value);\n\t}\n\n\t/**\n\t * Sets the reference to point to the given property object or to be equal to the given path string.\n\t *\n\t * @param {property-properties.BaseProperty|undefined|String} in_value - The property to assign to the reference or\n\t * the path to this property. If undefined is passed, the reference will be set to an empty string to\n\t * indicate an empty reference.\n\t * @throws if property is read only\n\t * @throws if in_value is defined but is not a property or a string.\n\t */\n\tset(...args) {\n\t\treturn this.setValue(...args);\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\t_resolvePathSegment(in_segment, in_segmentType) {\n\t\t// path segments and array tokens are no longer automatically forwarded to the referenced node\n\t\treturn in_segmentType === PathHelper.TOKEN_TYPES.ARRAY_TOKEN ||\n\t\t\tin_segmentType === PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN\n\t\t\t? undefined\n\t\t\t: AbstractStaticCollectionProperty.prototype._resolvePathSegment.call(\n\t\t\t\t\tthis,\n\t\t\t\t\tin_segment,\n\t\t\t\t\tin_segmentType,\n\t\t\t );\n\t}\n\n\t// Define a property to simplify accessing the referenced path\n\tget ref() {\n\t\treturn this.get.apply(this, arguments);\n\t}\n\n\tset ref(val) {\n\t\tthis.set.call(this, val);\n\t}\n\n\t/**\n\t * Validates the input and does as much as possible to return a string representing a path.\n\t *\n\t * @param {property-properties.BaseProperty|undefined|String} in_value - Contains the property to be set or\n\t * the path to this property. If undefined is passed, the reference will be set to an empty string to\n\t * indicate an empty reference.\n\t * @returns {string} The path\n\t * @throws if in_value is defined, but is not a property or a string.\n\t */\n\tstatic _convertInputToPath(in_value) {\n\t\tvar path;\n\t\tif (typeof in_value === \"string\") {\n\t\t\tpath = in_value;\n\t\t} else if (in_value === undefined) {\n\t\t\tpath = \"\";\n\t\t} else if (in_value instanceof BaseProperty) {\n\t\t\t// TODO: Check whether this is still the correct path once we start to support repository references\n\t\t\tpath = in_value.getAbsolutePath();\n\t\t} else if (in_value instanceof String) {\n\t\t\tpath = String(in_value);\n\t\t} else {\n\t\t\tthrow new TypeError(\n\t\t\t\tMSG.PROPERTY_OR_UNDEFINED + \"(\" + typeof in_value + \") \" + in_value,\n\t\t\t);\n\t\t}\n\t\treturn path;\n\t}\n}\nReferenceProperty.prototype._castFunctor = _castFunctors.String;\nReferenceProperty.prototype._typeid = \"Reference\";\n"]}
1
+ {"version":3,"file":"referenceProperty.js","sourceRoot":"","sources":["../../src/properties/referenceProperty.js"],"names":[],"mappings":";AAAA;;;GAGG;AACH;;GAEG;;;AAEH,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AACvF,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC;AACzE,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,EAAE,gCAAgC,EAAE,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAAC;AAC3F,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AACnD,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAC1D,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAErD;;;;;;GAMG;AACH,MAAa,iBAAkB,SAAQ,aAAa;IACnD;;;;;;;;OAQG;IACH,YAAY,SAAS;QACpB,KAAK,CAAC,SAAS,CAAC,CAAC;QACjB,oDAAoD;QACpD,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IACjB,CAAC;IAED;;;OAGG;IACH,eAAe;QACd,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;;;;;OAOG;IACH,wBAAwB;QACvB,OAAO,YAAY,CAAC,yCAAyC,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IACjF,CAAC;IAED;;;;;;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mB,CAAC,QAAQ;QAClC,IAAI,IAAI,CAAC;QACT,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;YACjC,IAAI,GAAG,QAAQ,CAAC;SAChB;aAAM,IAAI,QAAQ,KAAK,SAAS,EAAE;YAClC,IAAI,GAAG,EAAE,CAAC;SACV;aAAM,IAAI,QAAQ,YAAY,YAAY,EAAE;YAC5C,oGAAoG;YACpG,IAAI,GAAG,QAAQ,CAAC,eAAe,EAAE,CAAC;SAClC;aAAM,IAAI,QAAQ,YAAY,MAAM,EAAE;YACtC,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;SACxB;aAAM;YACN,MAAM,IAAI,SAAS,CAClB,GAAG,CAAC,qBAAqB,GAAG,GAAG,GAAG,OAAO,QAAQ,GAAG,IAAI,GAAG,QAAQ,CACnE,CAAC;SACF;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AAtMD,8CAsMC;AACD,iBAAiB,CAAC,SAAS,CAAC,YAAY,GAAG,aAAa,CAAC,MAAM,CAAC;AAChE,iBAAiB,CAAC,SAAS,CAAC,OAAO,GAAG,WAAW,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 ReferenceProperty class\n */\n\nconst { PathHelper, TypeIdHelper } = require(\"@fluid-experimental/property-changeset\");\nconst { MSG } = require(\"@fluid-experimental/property-common\").constants;\nconst _ = require(\"lodash\");\nconst { AbstractStaticCollectionProperty } = require(\"./abstractStaticCollectionProperty\");\nconst { BaseProperty } = require(\"./baseProperty\");\nconst { _castFunctors } = require(\"./primitiveTypeCasts\");\nconst { ValueProperty } = require(\"./valueProperty\");\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 * it's associated data field that we are interested in. If no data field is\n * present this property will have an undefined value.\n * @internal\n */\nexport class ReferenceProperty extends ValueProperty {\n\t/**\n\t * @param {Object=} in_params - The parameters\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueProperty\n\t * @alias property-properties.ReferenceProperty\n\t * @category Properties\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t\t// default for this property type is an empty string\n\t\tthis._data = \"\";\n\t}\n\n\t/**\n\t * Evaluates Reference properties as primitives.\n\t * @returns {boolean} true since Reference properties are primitives.\n\t */\n\tisPrimitiveType() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Returns the typeid for the target of this reference\n\t *\n\t * Note: This is the type that is specified in the typeid of this reference and not the actual type\n\t * of the referenced object, which might inherit from that typeid.\n\t *\n\t * @returns {string} The typeid of the nodes this reference may point to\n\t */\n\tgetReferenceTargetTypeId() {\n\t\treturn TypeIdHelper.extractReferenceTargetTypeIdFromReference(this.getTypeid());\n\t}\n\n\t/**\n\t * Resolves the referenced property\n\t *\n\t * @param {string | number | Array<string | number>} in_ids - The ID of the property or an array of IDs if an array is\n\t * passed, the .get function will be performed on each id in sequence for example .get(['position','x']) is\n\t * equivalent to .get('position').get('x'). If .get resolves to a ReferenceProperty, it will return the property\n\t * that the ReferenceProperty refers to.\n\t * @param {Object} in_options - parameter object\n\t * @param {property-properties.BaseProperty.REFERENCE_RESOLUTION} [in_options.referenceResolutionMode=ALWAYS] - How\n\t * should this function behave during reference resolution?\n\t * @returns {BaseProperty | undefined} The property object the reference points to or undefined if\n\t * it could not be resolved\n\t */\n\tget(in_ids, in_options) {\n\t\tin_options = in_options || {};\n\t\tin_options.referenceResolutionMode =\n\t\t\tin_options.referenceResolutionMode === undefined\n\t\t\t\t? BaseProperty.REFERENCE_RESOLUTION.ALWAYS\n\t\t\t\t: in_options.referenceResolutionMode;\n\n\t\tif (_.isArray(in_ids) && in_ids.length === 0) {\n\t\t\treturn this;\n\t\t}\n\n\t\t// Since this is a reference property, we return undefined, if reference resolution is disabled\n\t\tif (in_options.referenceResolutionMode !== BaseProperty.REFERENCE_RESOLUTION.ALWAYS) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (this.value === \"\") {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (this.getParent() === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\tvar resolvedProperty = this.getParent().resolvePath(this.value, {\n\t\t\treferenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.ALWAYS,\n\t\t});\n\n\t\treturn resolvedProperty !== undefined && _.isArray(in_ids)\n\t\t\t? // Forward handling of arrays to the BaseProperty function\n\t\t\t resolvedProperty.get(in_ids, in_options)\n\t\t\t: resolvedProperty;\n\t}\n\n\t/**\n\t * Expand a path returning the value or property at the end.\n\t *\n\t * @param {string} in_path - The path\n\t * @param {Object} in_options - Parameter object\n\t * @param {property-properties.BaseProperty.REFERENCE_RESOLUTION} [in_options.referenceResolutionMode=ALWAYS] - How\n\t * should this function behave during reference resolution?\n\t * @returns {BaseProperty | undefined} resolved path\n\t * @throws if the path resolves to a primitive value\n\t * @throws if in_path is not a valid path\n\t */\n\tresolvePath(in_path, in_options) {\n\t\tif (\n\t\t\tin_options &&\n\t\t\tin_options.referenceResolutionMode &&\n\t\t\tin_options.referenceResolutionMode === BaseProperty.REFERENCE_RESOLUTION.NEVER\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn AbstractStaticCollectionProperty.prototype.resolvePath.call(\n\t\t\tthis,\n\t\t\tin_path,\n\t\t\tin_options,\n\t\t);\n\t}\n\n\t/**\n\t * Checks whether the reference is valid. This is either the case when it is empty or when the referenced\n\t * property exists.\n\t *\n\t * @returns {boolean} True if the reference is valid, otherwise false.\n\t */\n\tisReferenceValid() {\n\t\treturn this.value === \"\" || this.ref !== undefined;\n\t}\n\n\t/**\n\t * Sets the reference to point to the given property object or to be equal to the given path string.\n\t *\n\t * @param {property-properties.BaseProperty|undefined|String} in_value - The property to assign to the reference or\n\t * the path to this property. If undefined is passed, the reference will be set to an empty string to\n\t * indicate an empty reference.\n\t * @throws if property is read only\n\t * @throws if in_value is defined, but is not a property or a string.\n\t */\n\tsetValue(in_value) {\n\t\tthis._checkIsNotReadOnly(true);\n\t\tvar value = ReferenceProperty._convertInputToPath(in_value);\n\t\t// Forward the call to setValue\n\t\tValueProperty.prototype.setValue.call(this, value);\n\t}\n\n\t/**\n\t * Sets the reference to point to the given property object or to be equal to the given path string.\n\t *\n\t * @param {property-properties.BaseProperty|undefined|String} in_value - The property to assign to the reference or\n\t * the path to this property. If undefined is passed, the reference will be set to an empty string to\n\t * indicate an empty reference.\n\t * @throws if property is read only\n\t * @throws if in_value is defined but is not a property or a string.\n\t */\n\tset(...args) {\n\t\treturn this.setValue(...args);\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\t_resolvePathSegment(in_segment, in_segmentType) {\n\t\t// path segments and array tokens are no longer automatically forwarded to the referenced node\n\t\treturn in_segmentType === PathHelper.TOKEN_TYPES.ARRAY_TOKEN ||\n\t\t\tin_segmentType === PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN\n\t\t\t? undefined\n\t\t\t: AbstractStaticCollectionProperty.prototype._resolvePathSegment.call(\n\t\t\t\t\tthis,\n\t\t\t\t\tin_segment,\n\t\t\t\t\tin_segmentType,\n\t\t\t );\n\t}\n\n\t// Define a property to simplify accessing the referenced path\n\tget ref() {\n\t\treturn this.get.apply(this, arguments);\n\t}\n\n\tset ref(val) {\n\t\tthis.set.call(this, val);\n\t}\n\n\t/**\n\t * Validates the input and does as much as possible to return a string representing a path.\n\t *\n\t * @param {property-properties.BaseProperty|undefined|String} in_value - Contains the property to be set or\n\t * the path to this property. If undefined is passed, the reference will be set to an empty string to\n\t * indicate an empty reference.\n\t * @returns {string} The path\n\t * @throws if in_value is defined, but is not a property or a string.\n\t */\n\tstatic _convertInputToPath(in_value) {\n\t\tvar path;\n\t\tif (typeof in_value === \"string\") {\n\t\t\tpath = in_value;\n\t\t} else if (in_value === undefined) {\n\t\t\tpath = \"\";\n\t\t} else if (in_value instanceof BaseProperty) {\n\t\t\t// TODO: Check whether this is still the correct path once we start to support repository references\n\t\t\tpath = in_value.getAbsolutePath();\n\t\t} else if (in_value instanceof String) {\n\t\t\tpath = String(in_value);\n\t\t} else {\n\t\t\tthrow new TypeError(\n\t\t\t\tMSG.PROPERTY_OR_UNDEFINED + \"(\" + typeof in_value + \") \" + in_value,\n\t\t\t);\n\t\t}\n\t\treturn path;\n\t}\n}\nReferenceProperty.prototype._castFunctor = _castFunctors.String;\nReferenceProperty.prototype._typeid = \"Reference\";\n"]}
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * A SetProperty is a collection class that can contain an unordered set of properties. These properties
3
3
  * must derive from NamedProperty and their URN is used to identify them within the set.
4
+ * @internal
4
5
  */
5
6
  export class SetProperty extends IndexedCollectionBaseProperty {
6
7
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"setProperty.d.ts","sourceRoot":"","sources":["../../src/properties/setProperty.js"],"names":[],"mappings":"AAmBA;;;GAGG;AACH;IACC;;;;;;;;;OASG;IACH,wBAOC;IAJA,eAAsB;IAEtB,oEAAoE;IACpE,qBAA0B;IAgB3B;;;;;;;;;;;;;OAaG;IACH,aAZY,MAAM,CAuBjB;IA6CD;;;;;;;OAOG;IACH,+BAOC;IAED;;;;;;;;;OASG;IACH,iBAHW,uCAAsC,GACpC,YAAY,CAexB;IAED;;;;;;OAMG;IACH,gCASC;IAwBD;;;;;;;;;;;;;OAaG;IACH,YAXW,MAAM,GAAG,MAAM,MAAM,GAAG,MAAM,CAAC,oBAQ9B,YAAY,GAAG,SAAS,CAkCnC;IAYD;;;;;;;OAOG;IACH,2BA8BC;IAED;;;;;;;;OAQG;IACH,mCAPW,eAAe,GAAC,mBAAmB,GAAC,KAAQ,YAC5C,OAAO,cAEP,OAAO,QAUjB;IAED;;;;;;OAMG;IACH,kCAHW,eAAe,GAAC,mBAAmB,GAAC,KAAQ,QAYtD;IAED;;;;;;;OAOG;IACH,cAHY,eAAe,CAK1B;IAeD;;OAEG;IACH,cAKC;CACD"}
1
+ {"version":3,"file":"setProperty.d.ts","sourceRoot":"","sources":["../../src/properties/setProperty.js"],"names":[],"mappings":"AAmBA;;;;GAIG;AACH;IACC;;;;;;;;;OASG;IACH,wBAOC;IAJA,eAAsB;IAEtB,oEAAoE;IACpE,qBAA0B;IAgB3B;;;;;;;;;;;;;OAaG;IACH,aAZY,MAAM,CAuBjB;IA6CD;;;;;;;OAOG;IACH,+BAOC;IAED;;;;;;;;;OASG;IACH,iBAHW,uCAAsC,GACpC,YAAY,CAexB;IAED;;;;;;OAMG;IACH,gCASC;IAwBD;;;;;;;;;;;;;OAaG;IACH,YAXW,MAAM,GAAG,MAAM,MAAM,GAAG,MAAM,CAAC,oBAQ9B,YAAY,GAAG,SAAS,CAkCnC;IAYD;;;;;;;OAOG;IACH,2BA8BC;IAED;;;;;;;;OAQG;IACH,mCAPW,eAAe,GAAC,mBAAmB,GAAC,KAAQ,YAC5C,OAAO,cAEP,OAAO,QAUjB;IAED;;;;;;OAMG;IACH,kCAHW,eAAe,GAAC,mBAAmB,GAAC,KAAQ,QAYtD;IAED;;;;;;;OAOG;IACH,cAHY,eAAe,CAK1B;IAeD;;OAEG;IACH,cAKC;CACD"}
@@ -19,6 +19,7 @@ var PATH_TOKENS = BaseProperty.PATH_TOKENS;
19
19
  /**
20
20
  * A SetProperty is a collection class that can contain an unordered set of properties. These properties
21
21
  * must derive from NamedProperty and their URN is used to identify them within the set.
22
+ * @internal
22
23
  */
23
24
  class SetProperty extends IndexedCollectionBaseProperty {
24
25
  /**