@fluid-experimental/property-properties 2.0.0-internal.3.0.2 → 2.0.0-internal.3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/README.md +1 -0
  2. package/dist/containerSerializer.d.ts.map +1 -1
  3. package/dist/containerSerializer.js +5 -5
  4. package/dist/containerSerializer.js.map +1 -1
  5. package/dist/enableValidations.js.map +1 -1
  6. package/dist/index.d.ts +19 -19
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/properties/abstractStaticCollectionProperty.d.ts +10 -10
  10. package/dist/properties/abstractStaticCollectionProperty.d.ts.map +1 -1
  11. package/dist/properties/abstractStaticCollectionProperty.js +70 -53
  12. package/dist/properties/abstractStaticCollectionProperty.js.map +1 -1
  13. package/dist/properties/arrayProperty.d.ts.map +1 -1
  14. package/dist/properties/arrayProperty.js +152 -103
  15. package/dist/properties/arrayProperty.js.map +1 -1
  16. package/dist/properties/baseProperty.d.ts +4 -4
  17. package/dist/properties/baseProperty.d.ts.map +1 -1
  18. package/dist/properties/baseProperty.js +69 -47
  19. package/dist/properties/baseProperty.js.map +1 -1
  20. package/dist/properties/boolProperty.d.ts.map +1 -1
  21. package/dist/properties/boolProperty.js +3 -3
  22. package/dist/properties/boolProperty.js.map +1 -1
  23. package/dist/properties/containerProperty.d.ts +8 -8
  24. package/dist/properties/containerProperty.d.ts.map +1 -1
  25. package/dist/properties/containerProperty.js +33 -26
  26. package/dist/properties/containerProperty.js.map +1 -1
  27. package/dist/properties/enumArrayProperty.d.ts.map +1 -1
  28. package/dist/properties/enumArrayProperty.js +14 -14
  29. package/dist/properties/enumArrayProperty.js.map +1 -1
  30. package/dist/properties/enumProperty.d.ts.map +1 -1
  31. package/dist/properties/enumProperty.js +17 -17
  32. package/dist/properties/enumProperty.js.map +1 -1
  33. package/dist/properties/floatProperties.js +4 -4
  34. package/dist/properties/floatProperties.js.map +1 -1
  35. package/dist/properties/index.d.ts +23 -23
  36. package/dist/properties/index.d.ts.map +1 -1
  37. package/dist/properties/index.js.map +1 -1
  38. package/dist/properties/indexedCollectionBaseProperty.d.ts.map +1 -1
  39. package/dist/properties/indexedCollectionBaseProperty.js +47 -37
  40. package/dist/properties/indexedCollectionBaseProperty.js.map +1 -1
  41. package/dist/properties/intProperties.d.ts.map +1 -1
  42. package/dist/properties/intProperties.js +10 -10
  43. package/dist/properties/intProperties.js.map +1 -1
  44. package/dist/properties/lazyLoadedProperties.js.map +1 -1
  45. package/dist/properties/mapProperty.d.ts.map +1 -1
  46. package/dist/properties/mapProperty.js +21 -17
  47. package/dist/properties/mapProperty.js.map +1 -1
  48. package/dist/properties/namedNodeProperty.d.ts.map +1 -1
  49. package/dist/properties/namedNodeProperty.js +3 -3
  50. package/dist/properties/namedNodeProperty.js.map +1 -1
  51. package/dist/properties/namedProperty.d.ts.map +1 -1
  52. package/dist/properties/namedProperty.js +7 -5
  53. package/dist/properties/namedProperty.js.map +1 -1
  54. package/dist/properties/nodeProperty.d.ts.map +1 -1
  55. package/dist/properties/nodeProperty.js +5 -3
  56. package/dist/properties/nodeProperty.js.map +1 -1
  57. package/dist/properties/primitiveTypeCasts.d.ts.map +1 -1
  58. package/dist/properties/primitiveTypeCasts.js +9 -9
  59. package/dist/properties/primitiveTypeCasts.js.map +1 -1
  60. package/dist/properties/referenceArrayProperty.d.ts.map +1 -1
  61. package/dist/properties/referenceArrayProperty.js +31 -25
  62. package/dist/properties/referenceArrayProperty.js.map +1 -1
  63. package/dist/properties/referenceMapProperty.d.ts.map +1 -1
  64. package/dist/properties/referenceMapProperty.js +18 -18
  65. package/dist/properties/referenceMapProperty.js.map +1 -1
  66. package/dist/properties/referenceProperty.d.ts.map +1 -1
  67. package/dist/properties/referenceProperty.js +33 -29
  68. package/dist/properties/referenceProperty.js.map +1 -1
  69. package/dist/properties/setProperty.d.ts.map +1 -1
  70. package/dist/properties/setProperty.js +31 -29
  71. package/dist/properties/setProperty.js.map +1 -1
  72. package/dist/properties/stringProperty.d.ts.map +1 -1
  73. package/dist/properties/stringProperty.js +56 -40
  74. package/dist/properties/stringProperty.js.map +1 -1
  75. package/dist/properties/uintProperties.js +5 -5
  76. package/dist/properties/uintProperties.js.map +1 -1
  77. package/dist/properties/valueArrayProperty.d.ts +1 -1
  78. package/dist/properties/valueArrayProperty.d.ts.map +1 -1
  79. package/dist/properties/valueArrayProperty.js +30 -29
  80. package/dist/properties/valueArrayProperty.js.map +1 -1
  81. package/dist/properties/valueMapProperty.d.ts.map +1 -1
  82. package/dist/properties/valueMapProperty.js +31 -29
  83. package/dist/properties/valueMapProperty.js.map +1 -1
  84. package/dist/properties/valueProperty.d.ts.map +1 -1
  85. package/dist/properties/valueProperty.js +11 -9
  86. package/dist/properties/valueProperty.js.map +1 -1
  87. package/dist/propertyFactory.d.ts.map +1 -1
  88. package/dist/propertyFactory.js +309 -252
  89. package/dist/propertyFactory.js.map +1 -1
  90. package/dist/propertyTemplate.d.ts +17 -17
  91. package/dist/propertyTemplate.d.ts.map +1 -1
  92. package/dist/propertyTemplate.js +64 -45
  93. package/dist/propertyTemplate.js.map +1 -1
  94. package/dist/propertyTemplateWrapper.d.ts.map +1 -1
  95. package/dist/propertyTemplateWrapper.js +40 -25
  96. package/dist/propertyTemplateWrapper.js.map +1 -1
  97. package/dist/propertyUtils.d.ts.map +1 -1
  98. package/dist/propertyUtils.js.map +1 -1
  99. package/dist/test/properties/arrayProperty.spec.js +566 -490
  100. package/dist/test/properties/arrayProperty.spec.js.map +1 -1
  101. package/dist/test/properties/baseProperty.spec.js +293 -280
  102. package/dist/test/properties/baseProperty.spec.js.map +1 -1
  103. package/dist/test/properties/containerProperty.spec.js +100 -94
  104. package/dist/test/properties/containerProperty.spec.js.map +1 -1
  105. package/dist/test/properties/customArrayProperty.spec.js +174 -147
  106. package/dist/test/properties/customArrayProperty.spec.js.map +1 -1
  107. package/dist/test/properties/enumArrayProperty.spec.js +67 -63
  108. package/dist/test/properties/enumArrayProperty.spec.js.map +1 -1
  109. package/dist/test/properties/enumProperty.spec.js +115 -97
  110. package/dist/test/properties/enumProperty.spec.js.map +1 -1
  111. package/dist/test/properties/float32.spec.js +5 -5
  112. package/dist/test/properties/float32.spec.js.map +1 -1
  113. package/dist/test/properties/int64ArrayProperty.spec.js +157 -93
  114. package/dist/test/properties/int64ArrayProperty.spec.js.map +1 -1
  115. package/dist/test/properties/int64MapProperty.spec.js +185 -166
  116. package/dist/test/properties/int64MapProperty.spec.js.map +1 -1
  117. package/dist/test/properties/int64Property.spec.js +109 -109
  118. package/dist/test/properties/int64Property.spec.js.map +1 -1
  119. package/dist/test/properties/isLeafNode.spec.js +75 -76
  120. package/dist/test/properties/isLeafNode.spec.js.map +1 -1
  121. package/dist/test/properties/mapProperty.spec.js +571 -531
  122. package/dist/test/properties/mapProperty.spec.js.map +1 -1
  123. package/dist/test/properties/namedNodeProperty.spec.js +31 -31
  124. package/dist/test/properties/namedNodeProperty.spec.js.map +1 -1
  125. package/dist/test/properties/nodeProperty.spec.js +805 -795
  126. package/dist/test/properties/nodeProperty.spec.js.map +1 -1
  127. package/dist/test/properties/referenceProperty.spec.js +729 -679
  128. package/dist/test/properties/referenceProperty.spec.js.map +1 -1
  129. package/dist/test/properties/relationshipProperty.spec.js +16 -16
  130. package/dist/test/properties/relationshipProperty.spec.js.map +1 -1
  131. package/dist/test/properties/setProperty.spec.js +288 -227
  132. package/dist/test/properties/setProperty.spec.js.map +1 -1
  133. package/dist/test/properties/stringProperty.spec.js +326 -318
  134. package/dist/test/properties/stringProperty.spec.js.map +1 -1
  135. package/dist/test/properties/uint64Property.spec.js +46 -36
  136. package/dist/test/properties/uint64Property.spec.js.map +1 -1
  137. package/dist/test/properties/valueMapProperty.spec.js +259 -246
  138. package/dist/test/properties/valueMapProperty.spec.js.map +1 -1
  139. package/dist/test/properties/valueProperty.spec.js +49 -43
  140. package/dist/test/properties/valueProperty.spec.js.map +1 -1
  141. package/dist/test/propertyFactory.spec.js +2038 -1631
  142. package/dist/test/propertyFactory.spec.js.map +1 -1
  143. package/dist/test/propertyTemplateWrapper.spec.js +72 -102
  144. package/dist/test/propertyTemplateWrapper.spec.js.map +1 -1
  145. package/dist/test/propertyUtils.spec.js +22 -21
  146. package/dist/test/propertyUtils.spec.js.map +1 -1
  147. package/dist/test/reversibleChangeset.spec.js +857 -703
  148. package/dist/test/reversibleChangeset.spec.js.map +1 -1
  149. package/dist/test/setup.js +5 -5
  150. package/dist/test/setup.js.map +1 -1
  151. package/dist/test/tsconfig.tsbuildinfo +1 -1
  152. package/dist/test/utils.spec.js +1334 -1144
  153. package/dist/test/utils.spec.js.map +1 -1
  154. package/dist/test/validation/badMissingSemverInTypeid.js +20 -20
  155. package/dist/test/validation/badMissingSemverInTypeid.js.map +1 -1
  156. package/dist/test/validation/badPrimitiveTypeid.js +12 -12
  157. package/dist/test/validation/badPrimitiveTypeid.js.map +1 -1
  158. package/dist/test/validation/goodColorId.js +91 -91
  159. package/dist/test/validation/goodColorId.js.map +1 -1
  160. package/dist/test/validation/goodColorPalette.js +4 -4
  161. package/dist/test/validation/goodColorPalette.js.map +1 -1
  162. package/dist/test/validation/goodPointId.js +20 -20
  163. package/dist/test/validation/goodPointId.js.map +1 -1
  164. package/dist/test/validation/reversibleChangeSetTestData.js +23841 -2
  165. package/dist/test/validation/reversibleChangeSetTestData.js.map +1 -1
  166. package/lib/containerSerializer.d.ts.map +1 -1
  167. package/lib/containerSerializer.js +5 -5
  168. package/lib/containerSerializer.js.map +1 -1
  169. package/lib/enableValidations.js.map +1 -1
  170. package/lib/index.d.ts +19 -19
  171. package/lib/index.d.ts.map +1 -1
  172. package/lib/index.js +19 -19
  173. package/lib/index.js.map +1 -1
  174. package/lib/properties/abstractStaticCollectionProperty.d.ts +10 -10
  175. package/lib/properties/abstractStaticCollectionProperty.d.ts.map +1 -1
  176. package/lib/properties/abstractStaticCollectionProperty.js +70 -53
  177. package/lib/properties/abstractStaticCollectionProperty.js.map +1 -1
  178. package/lib/properties/arrayProperty.d.ts.map +1 -1
  179. package/lib/properties/arrayProperty.js +152 -103
  180. package/lib/properties/arrayProperty.js.map +1 -1
  181. package/lib/properties/baseProperty.d.ts +4 -4
  182. package/lib/properties/baseProperty.d.ts.map +1 -1
  183. package/lib/properties/baseProperty.js +73 -51
  184. package/lib/properties/baseProperty.js.map +1 -1
  185. package/lib/properties/boolProperty.d.ts.map +1 -1
  186. package/lib/properties/boolProperty.js +3 -3
  187. package/lib/properties/boolProperty.js.map +1 -1
  188. package/lib/properties/containerProperty.d.ts +8 -8
  189. package/lib/properties/containerProperty.d.ts.map +1 -1
  190. package/lib/properties/containerProperty.js +33 -26
  191. package/lib/properties/containerProperty.js.map +1 -1
  192. package/lib/properties/enumArrayProperty.d.ts.map +1 -1
  193. package/lib/properties/enumArrayProperty.js +14 -14
  194. package/lib/properties/enumArrayProperty.js.map +1 -1
  195. package/lib/properties/enumProperty.d.ts.map +1 -1
  196. package/lib/properties/enumProperty.js +17 -17
  197. package/lib/properties/enumProperty.js.map +1 -1
  198. package/lib/properties/floatProperties.js +4 -4
  199. package/lib/properties/floatProperties.js.map +1 -1
  200. package/lib/properties/index.d.ts +23 -23
  201. package/lib/properties/index.d.ts.map +1 -1
  202. package/lib/properties/index.js +23 -23
  203. package/lib/properties/index.js.map +1 -1
  204. package/lib/properties/indexedCollectionBaseProperty.d.ts.map +1 -1
  205. package/lib/properties/indexedCollectionBaseProperty.js +47 -37
  206. package/lib/properties/indexedCollectionBaseProperty.js.map +1 -1
  207. package/lib/properties/intProperties.d.ts.map +1 -1
  208. package/lib/properties/intProperties.js +10 -10
  209. package/lib/properties/intProperties.js.map +1 -1
  210. package/lib/properties/lazyLoadedProperties.js.map +1 -1
  211. package/lib/properties/mapProperty.d.ts.map +1 -1
  212. package/lib/properties/mapProperty.js +21 -17
  213. package/lib/properties/mapProperty.js.map +1 -1
  214. package/lib/properties/namedNodeProperty.d.ts.map +1 -1
  215. package/lib/properties/namedNodeProperty.js +3 -3
  216. package/lib/properties/namedNodeProperty.js.map +1 -1
  217. package/lib/properties/namedProperty.d.ts.map +1 -1
  218. package/lib/properties/namedProperty.js +7 -5
  219. package/lib/properties/namedProperty.js.map +1 -1
  220. package/lib/properties/nodeProperty.d.ts.map +1 -1
  221. package/lib/properties/nodeProperty.js +5 -3
  222. package/lib/properties/nodeProperty.js.map +1 -1
  223. package/lib/properties/primitiveTypeCasts.d.ts.map +1 -1
  224. package/lib/properties/primitiveTypeCasts.js +9 -9
  225. package/lib/properties/primitiveTypeCasts.js.map +1 -1
  226. package/lib/properties/referenceArrayProperty.d.ts.map +1 -1
  227. package/lib/properties/referenceArrayProperty.js +31 -25
  228. package/lib/properties/referenceArrayProperty.js.map +1 -1
  229. package/lib/properties/referenceMapProperty.d.ts.map +1 -1
  230. package/lib/properties/referenceMapProperty.js +18 -18
  231. package/lib/properties/referenceMapProperty.js.map +1 -1
  232. package/lib/properties/referenceProperty.d.ts.map +1 -1
  233. package/lib/properties/referenceProperty.js +33 -29
  234. package/lib/properties/referenceProperty.js.map +1 -1
  235. package/lib/properties/setProperty.d.ts.map +1 -1
  236. package/lib/properties/setProperty.js +31 -29
  237. package/lib/properties/setProperty.js.map +1 -1
  238. package/lib/properties/stringProperty.d.ts.map +1 -1
  239. package/lib/properties/stringProperty.js +56 -40
  240. package/lib/properties/stringProperty.js.map +1 -1
  241. package/lib/properties/uintProperties.js +5 -5
  242. package/lib/properties/uintProperties.js.map +1 -1
  243. package/lib/properties/valueArrayProperty.d.ts +1 -1
  244. package/lib/properties/valueArrayProperty.d.ts.map +1 -1
  245. package/lib/properties/valueArrayProperty.js +30 -29
  246. package/lib/properties/valueArrayProperty.js.map +1 -1
  247. package/lib/properties/valueMapProperty.d.ts.map +1 -1
  248. package/lib/properties/valueMapProperty.js +31 -29
  249. package/lib/properties/valueMapProperty.js.map +1 -1
  250. package/lib/properties/valueProperty.d.ts.map +1 -1
  251. package/lib/properties/valueProperty.js +11 -9
  252. package/lib/properties/valueProperty.js.map +1 -1
  253. package/lib/propertyFactory.d.ts.map +1 -1
  254. package/lib/propertyFactory.js +309 -252
  255. package/lib/propertyFactory.js.map +1 -1
  256. package/lib/propertyTemplate.d.ts +17 -17
  257. package/lib/propertyTemplate.d.ts.map +1 -1
  258. package/lib/propertyTemplate.js +64 -45
  259. package/lib/propertyTemplate.js.map +1 -1
  260. package/lib/propertyTemplateWrapper.d.ts.map +1 -1
  261. package/lib/propertyTemplateWrapper.js +40 -25
  262. package/lib/propertyTemplateWrapper.js.map +1 -1
  263. package/lib/propertyUtils.d.ts.map +1 -1
  264. package/lib/propertyUtils.js.map +1 -1
  265. package/package.json +28 -28
  266. package/src/index.d.ts +2750 -2681
@@ -1 +1 @@
1
- {"version":3,"file":"setProperty.js","sourceRoot":"","sources":["../../src/properties/setProperty.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;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,6BAA6B,EAAE,GAAG,OAAO,CAAC,iCAAiC,CAAC,CAAC;AACrF,MAAM,EAAE,oBAAoB,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AAE7E,IAAI,WAAW,GAAG,YAAY,CAAC,WAAW,CAAC;AAE3C;;;GAGG;AACH,MAAM,OAAO,WAAY,SAAQ,6BAA6B;IAC1D;;;;;;;;;OASG;IACH,YAAY,SAAS,EAAE,QAAQ;QAC3B,K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ors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Definition of the set property 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 { IndexedCollectionBaseProperty } = require('./indexedCollectionBaseProperty');\nconst { LazyLoadedProperties: Property } = require('./lazyLoadedProperties');\n\nvar PATH_TOKENS = BaseProperty.PATH_TOKENS;\n\n/**\n * A SetProperty is a collection class that can contain an unordered set of properties. These properties\n * must derive from NamedProperty and their URN is used to identify them within the set.\n */\nexport class SetProperty extends IndexedCollectionBaseProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n * @param {string|undefined} in_scope - The scope in which the map typeid is defined\n *\n * @constructor\n * @protected\n * @extends property-properties.IndexedCollectionBaseProperty\n * @alias property-properties.SetProperty\n * @category Other Collections\n */\n constructor(in_params, in_scope) {\n super(in_params);\n\n this._scope = in_scope;\n\n /** Contains the actual entries of the set, indexed by their GUID */\n this._dynamicChildren = {};\n }\n\n // A set property falls back to NamedProperty, if none is specified\n\n /**\n * Is this property a leaf node with regard to flattening?\n *\n * TODO: Which semantics should flattening have? It stops at primitive types and collections?\n *\n * @return {boolean} Is it a leaf with regard to flattening?\n */\n _isFlattenLeaf() {\n return true;\n }\n\n /**\n * Returns an object with all the nested values contained in this property.\n * @return {object} An object representing the values of your property.\n * For example:\n *\n * ```json\n * {\n * position: {\n * x: 2,\n * y: 5\n * }\n * }\n * ```\n */\n getValues() {\n var ids = this.getIds();\n var result = {};\n for (var i = 0; i < ids.length; i++) {\n var child = this.get(ids[i]);\n if (child instanceof Property.ValueProperty || child instanceof Property.StringProperty) {\n result[ids[i]] = this.get(ids[i]).getValue();\n } else {\n result[ids[i]] = child.getValues();\n }\n }\n return result;\n }\n\n /**\n * Returns the full property type identifier for the ChangeSet including the enum type id\n * @param {boolean} [in_hideCollection=false] - If true the collection type (if applicable) will be omitted\n * @return {string} The typeid\n */\n getFullTypeid(in_hideCollection = false) {\n return in_hideCollection\n ? this._typeid\n : TypeIdHelper.createSerializationTypeId(this._typeid, 'set');\n }\n\n /**\n * Returns the path segment for a child\n *\n * @param {property-properties.NamedProperty} in_childNode - The child for which the path is returned\n *\n * @return {string} The path segment to resolve the child property under this property\n * @protected\n */\n _getPathSegmentForChildNode(in_childNode) {\n return '[' + in_childNode.getGuid() + ']';\n }\n\n /**\n * Resolves a direct child node based on the given path segment\n *\n * @param {String} in_segment - The path segment to resolve\n * @param {property-properties.PathHelper.TOKEN_TYPES} in_segmentType - The type of segment in the tokenized path\n *\n * @return {property-properties.BaseProperty|undefined} The child property that has been resolved\n * @protected\n */\n _resolvePathSegment(in_segment, in_segmentType) {\n // Base Properties only support paths separated via dots\n return in_segmentType === PathHelper.TOKEN_TYPES.ARRAY_TOKEN\n ? this._dynamicChildren[in_segment]\n : AbstractStaticCollectionProperty.prototype._resolvePathSegment.call(this, in_segment, in_segmentType);\n }\n\n /**\n * Inserts a property into the set\n *\n * @param {property-properties.NamedProperty} in_property - The property to insert\n * @throws if trying to insert non-named properties\n * @throws if trying to insert a property that has a parent\n * @throws if a property already exists with the same guid as in_property\n */\n insert(in_property) {\n if (in_property instanceof AbstractStaticCollectionProperty && in_property.has('guid')) {\n var guid = in_property.getGuid();\n this._insert(guid, in_property, true);\n } else {\n throw new Error(MSG.CANT_INSERT_NON_NAMED_PROPERTIES);\n }\n }\n\n /**\n * Adds a property to the set.\n *\n * - If the property's key exists, the entry is replaced with new one.\n *\n * - If the property's key does not exist, the property is appended.\n *\n * @param {NamedProperty|NamedNodeProperty|Object} in_property - The property to add to the list.\n */\n set(in_property) {\n this._checkIsNotReadOnly(true);\n\n if (in_property instanceof AbstractStaticCollectionProperty && in_property.has('guid')) {\n var guid = in_property.getGuid();\n if (this.has(guid)) {\n this.remove(guid);\n }\n\n this.insert(in_property);\n } else {\n throw new Error(MSG.CANT_INSERT_NON_NAMED_PROPERTIES);\n }\n }\n\n /**\n * Removes the given property from the set\n *\n * @param {property-properties.NamedProperty|string} in_entry - The property or its URN to remove from the set\n * @return {property-properties.NamedProperty} the property that was removed.\n * @throws if trying to remove an entry that does not exist\n */\n remove(in_entry) {\n if (_.isString(in_entry)) {\n var item = this.get(in_entry);\n this._removeByKey(in_entry, true);\n return item;\n } else {\n this._removeByKey(in_entry.getGuid(), true);\n return in_entry;\n }\n }\n\n /**\n * Returns an Object with all the entries of the set.\n *\n * WARNING: This is a direct access to the internal data-structure and the collection MUST NOT be modified.\n * It is read only for fast access and iteration. Insertion and deletion MUST be done via the insert and\n * remove functions of this class.\n *\n * @return {Object<String, property-properties.NamedProperty>} The map with all entries in the set.\n */\n getEntriesReadOnly() {\n return this._dynamicChildren;\n }\n\n /**\n * Returns the name of all the sub-properties of this property.\n *\n * @return {Array.<string>} An array of all the property ids\n */\n getIds() {\n return Object.keys(this._dynamicChildren);\n }\n\n /**\n * Returns the collection entry with the given ID\n *\n * @param {string|array<string|number>} in_ids - key of the entry to return or an array of keys if an array is\n * passed, the .get function will be performed on each id in sequence for example .get(['position','x']) is\n * equivalent to .get('position').get('x'). If .get resolves to a ReferenceProperty, it will return the property\n * that the ReferenceProperty refers to.\n * @param {Object} in_options - parameter object\n * @param {property-properties.BaseProperty.REFERENCE_RESOLUTION} [in_options.referenceResolutionMode=ALWAYS] - How\n * should this function behave during reference resolution?\n *\n * @return {property-properties.NamedProperty|undefined} The entry in the collection or undefined if none could be\n * found\n */\n get(in_ids, in_options) {\n if (_.isArray(in_ids)) {\n // Forward handling of arrays to the BaseProperty function\n return AbstractStaticCollectionProperty.prototype.get.call(this, in_ids, in_options);\n } else {\n var prop = this;\n in_options = in_options || {};\n in_options.referenceResolutionMode =\n in_options.referenceResolutionMode === undefined ? BaseProperty.REFERENCE_RESOLUTION.ALWAYS :\n in_options.referenceResolutionMode;\n switch (in_ids) {\n case PATH_TOKENS.ROOT: {\n prop = prop.getRoot();\n break;\n }\n case PATH_TOKENS.UP: {\n prop = prop.getParent();\n break;\n }\n case PATH_TOKENS.REF: {\n throw new Error(MSG.NO_GET_DEREFERENCE_ONLY);\n }\n default: {\n prop = prop._dynamicChildren[in_ids];\n break;\n }\n }\n\n return prop;\n }\n }\n\n /**\n * Checks whether a property with the given name exists\n *\n * @param {string} in_id - Name of the property\n * @return {boolean} True if the property exists, otherwise false.\n */\n has(in_id) {\n return this._dynamicChildren[in_id] !== undefined;\n }\n\n /**\n * Adds a list of properties to the set.\n * See {@link SetProperty.setValues}\n * @param {NamedProperty[]|NamedNodeProperty[]|Object[]} in_properties - The list of properties to add to the list\n * @param {Boolean} in_typed - If the set's items have a typeid and a value then create the\n * properties with that typeid, else use the set's typeid (support polymorphic items).\n * @private\n */\n _setValuesInternal(in_properties, in_typed) {\n this._checkIsNotReadOnly(true);\n\n var that = this;\n _.each(in_properties, function(property) {\n if (property instanceof BaseProperty) {\n that.set(property);\n } else {\n // If value is a JSON object (i.e: passed through a default value), create the property and add it to the set.\n if (in_typed) {\n that.set(Property.PropertyFactory._createProperty(\n property.typeid || that._typeid, null, property.value, that._getScope()));\n } else {\n that.set(Property.PropertyFactory._createProperty(\n that._typeid, null, property, that._getScope()));\n }\n }\n });\n }\n\n /**\n * Adds a list of properties to the set. See {@link SetProperty.setValues}\n * @param {NamedProperty[]|NamedNodeProperty[]|Object[]} in_properties - The list of properties to add to the list\n * @param {Boolean} in_typed - If the set's items have a typeid and a value then create the properties with that\n * typeid, else use the set's typeid (support polymorphic items).\n * @param {Bool} in_initial - Whether we are setting default/initial values or if the function is called directly\n * with the values to set.\n * @override\n */\n _setValues(in_properties, in_typed, in_initial) {\n if (in_initial) {\n this.clear();\n }\n\n this._setValuesInternal(in_properties, in_typed);\n }\n\n /**\n * Adds a list of properties to the set.\n * - If the property's key exists, the entry is replaced with new one.\n * - If the property's key does not exist, the property is appended.\n * @param {NamedProperty[]|NamedNodeProperty[]|Object[]} in_properties - The list of properties to add to the list\n * @override\n */\n setValues(in_properties) {\n var checkoutView = this._getCheckoutView();\n if (checkoutView !== undefined) {\n checkoutView.pushNotificationDelayScope();\n SetProperty.prototype._setValues.call(this, in_properties, false, false);\n checkoutView.popNotificationDelayScope();\n } else {\n SetProperty.prototype._setValues.call(this, in_properties, false, false);\n }\n }\n\n /**\n * Returns all entries of the set as an array.\n *\n * NOTE: This function creates a copy and thus is less efficient as getEntriesReadOnly.\n *\n * @return {Array.<property-properties.NamedProperty>} Array with all entries of the set. This array is a shallow copy\n * which can be modified by the caller without effects on the set.\n */\n getAsArray() {\n return _.values(this._dynamicChildren);\n }\n\n /**\n * Get the scope to which this property belongs to.\n * @return {string|undefined} The guid representing the scope in which the\n * set belongs to. If there is a workspace scope return it, else return the scope of this set.\n * @override\n * @private\n */\n _getScope() {\n var scope = IndexedCollectionBaseProperty.prototype._getScope.call(this);\n\n return scope !== undefined ? scope : this._scope;\n }\n\n /**\n * Delete all values from Set\n */\n clear() {\n var that = this;\n this.getIds().forEach(function(id) {\n that.remove(id);\n });\n }\n}\n\nSetProperty.prototype._typeid = 'NamedProperty';\nSetProperty.prototype._context = 'set';\n"]}
1
+ {"version":3,"file":"setProperty.js","sourceRoot":"","sources":["../../src/properties/setProperty.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;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,6BAA6B,EAAE,GAAG,OAA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AO,CAAC,UAAU,EAAE;YACjC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;IACJ,CAAC;CACD;AAED,WAAW,CAAC,SAAS,CAAC,OAAO,GAAG,eAAe,CAAC;AAChD,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 set property 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 { IndexedCollectionBaseProperty } = require(\"./indexedCollectionBaseProperty\");\nconst { LazyLoadedProperties: Property } = require(\"./lazyLoadedProperties\");\n\nvar PATH_TOKENS = BaseProperty.PATH_TOKENS;\n\n/**\n * A SetProperty is a collection class that can contain an unordered set of properties. These properties\n * must derive from NamedProperty and their URN is used to identify them within the set.\n */\nexport class SetProperty 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 *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.IndexedCollectionBaseProperty\n\t * @alias property-properties.SetProperty\n\t * @category Other Collections\n\t */\n\tconstructor(in_params, in_scope) {\n\t\tsuper(in_params);\n\n\t\tthis._scope = in_scope;\n\n\t\t/** Contains the actual entries of the set, indexed by their GUID */\n\t\tthis._dynamicChildren = {};\n\t}\n\n\t// A set property falls back to NamedProperty, if none is specified\n\n\t/**\n\t * Is this property a leaf node with regard to flattening?\n\t *\n\t * TODO: Which semantics should flattening have? It stops at primitive types and collections?\n\t *\n\t * @return {boolean} Is it a leaf with regard to flattening?\n\t */\n\t_isFlattenLeaf() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Returns an object with all the nested values contained in this property.\n\t * @return {object} An object representing the values of your property.\n\t * For example:\n\t *\n\t * ```json\n\t * {\n\t * position: {\n\t * x: 2,\n\t * y: 5\n\t * }\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\tif (\n\t\t\t\tchild instanceof Property.ValueProperty ||\n\t\t\t\tchild instanceof Property.StringProperty\n\t\t\t) {\n\t\t\t\tresult[ids[i]] = this.get(ids[i]).getValue();\n\t\t\t} else {\n\t\t\t\tresult[ids[i]] = child.getValues();\n\t\t\t}\n\t\t}\n\t\treturn result;\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, \"set\");\n\t}\n\n\t/**\n\t * Returns the path segment for a child\n\t *\n\t * @param {property-properties.NamedProperty} 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 \"[\" + in_childNode.getGuid() + \"]\";\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 {property-properties.BaseProperty|undefined} The child property that has been resolved\n\t * @protected\n\t */\n\t_resolvePathSegment(in_segment, in_segmentType) {\n\t\t// Base Properties only support paths separated via dots\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 into the set\n\t *\n\t * @param {property-properties.NamedProperty} in_property - The property to insert\n\t * @throws if trying to insert non-named properties\n\t * @throws if trying to insert a property that has a parent\n\t * @throws if a property already exists with the same guid as in_property\n\t */\n\tinsert(in_property) {\n\t\tif (in_property instanceof AbstractStaticCollectionProperty && in_property.has(\"guid\")) {\n\t\t\tvar guid = in_property.getGuid();\n\t\t\tthis._insert(guid, in_property, true);\n\t\t} else {\n\t\t\tthrow new Error(MSG.CANT_INSERT_NON_NAMED_PROPERTIES);\n\t\t}\n\t}\n\n\t/**\n\t * Adds a property to the set.\n\t *\n\t * - If the property's key exists, the entry is replaced with new one.\n\t *\n\t * - If the property's key does not exist, the property is appended.\n\t *\n\t * @param {NamedProperty|NamedNodeProperty|Object} in_property - The property to add to the list.\n\t */\n\tset(in_property) {\n\t\tthis._checkIsNotReadOnly(true);\n\n\t\tif (in_property instanceof AbstractStaticCollectionProperty && in_property.has(\"guid\")) {\n\t\t\tvar guid = in_property.getGuid();\n\t\t\tif (this.has(guid)) {\n\t\t\t\tthis.remove(guid);\n\t\t\t}\n\n\t\t\tthis.insert(in_property);\n\t\t} else {\n\t\t\tthrow new Error(MSG.CANT_INSERT_NON_NAMED_PROPERTIES);\n\t\t}\n\t}\n\n\t/**\n\t * Removes the given property from the set\n\t *\n\t * @param {property-properties.NamedProperty|string} in_entry - The property or its URN to remove from the set\n\t * @return {property-properties.NamedProperty} the property that was removed.\n\t * @throws if trying to remove an entry that does not exist\n\t */\n\tremove(in_entry) {\n\t\tif (_.isString(in_entry)) {\n\t\t\tvar item = this.get(in_entry);\n\t\t\tthis._removeByKey(in_entry, true);\n\t\t\treturn item;\n\t\t} else {\n\t\t\tthis._removeByKey(in_entry.getGuid(), true);\n\t\t\treturn in_entry;\n\t\t}\n\t}\n\n\t/**\n\t * Returns an Object with all the entries of the set.\n\t *\n\t * WARNING: This is a direct access to the internal data-structure and the collection MUST NOT be modified.\n\t * It is read only for fast access and iteration. Insertion and deletion MUST be done via the insert and\n\t * remove functions of this class.\n\t *\n\t * @return {Object<String, property-properties.NamedProperty>} The map with all entries in the set.\n\t */\n\tgetEntriesReadOnly() {\n\t\treturn this._dynamicChildren;\n\t}\n\n\t/**\n\t * Returns the name of all the sub-properties of this property.\n\t *\n\t * @return {Array.<string>} An array of all the property ids\n\t */\n\tgetIds() {\n\t\treturn Object.keys(this._dynamicChildren);\n\t}\n\n\t/**\n\t * Returns the collection entry with the given ID\n\t *\n\t * @param {string|array<string|number>} in_ids - key of the entry to return or an array of keys 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 *\n\t * @return {property-properties.NamedProperty|undefined} The entry in the collection or undefined if none could be\n\t * 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\tvar prop = this;\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\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\treturn prop;\n\t\t}\n\t}\n\n\t/**\n\t * Checks whether a property 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 * Adds a list of properties to the set.\n\t * See {@link SetProperty.setValues}\n\t * @param {NamedProperty[]|NamedNodeProperty[]|Object[]} in_properties - The list of properties to add to the list\n\t * @param {Boolean} in_typed - If the set'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_properties, in_typed) {\n\t\tthis._checkIsNotReadOnly(true);\n\n\t\tvar that = this;\n\t\t_.each(in_properties, function (property) {\n\t\t\tif (property instanceof BaseProperty) {\n\t\t\t\tthat.set(property);\n\t\t\t} else {\n\t\t\t\t// If value is a JSON object (i.e: passed through a default value), create the property and add it to the set.\n\t\t\t\tif (in_typed) {\n\t\t\t\t\tthat.set(\n\t\t\t\t\t\tProperty.PropertyFactory._createProperty(\n\t\t\t\t\t\t\tproperty.typeid || that._typeid,\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tproperty.value,\n\t\t\t\t\t\t\tthat._getScope(),\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tthat.set(\n\t\t\t\t\t\tProperty.PropertyFactory._createProperty(\n\t\t\t\t\t\t\tthat._typeid,\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\tthat._getScope(),\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 * Adds a list of properties to the set. See {@link SetProperty.setValues}\n\t * @param {NamedProperty[]|NamedNodeProperty[]|Object[]} in_properties - The list of properties to add to the list\n\t * @param {Boolean} in_typed - If the set's items have a typeid and a value then create the properties with that\n\t * typeid, else use the set's typeid (support polymorphic items).\n\t * @param {Bool} 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 * @override\n\t */\n\t_setValues(in_properties, in_typed, in_initial) {\n\t\tif (in_initial) {\n\t\t\tthis.clear();\n\t\t}\n\n\t\tthis._setValuesInternal(in_properties, in_typed);\n\t}\n\n\t/**\n\t * Adds a list of properties to the set.\n\t * - If the property's key exists, the entry is replaced with new one.\n\t * - If the property's key does not exist, the property is appended.\n\t * @param {NamedProperty[]|NamedNodeProperty[]|Object[]} in_properties - The list of properties to add to the list\n\t * @override\n\t */\n\tsetValues(in_properties) {\n\t\tvar checkoutView = this._getCheckoutView();\n\t\tif (checkoutView !== undefined) {\n\t\t\tcheckoutView.pushNotificationDelayScope();\n\t\t\tSetProperty.prototype._setValues.call(this, in_properties, false, false);\n\t\t\tcheckoutView.popNotificationDelayScope();\n\t\t} else {\n\t\t\tSetProperty.prototype._setValues.call(this, in_properties, false, false);\n\t\t}\n\t}\n\n\t/**\n\t * Returns all entries of the set 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.NamedProperty>} Array with all entries of the set. This array is a shallow copy\n\t * which can be modified by the caller without effects on the set.\n\t */\n\tgetAsArray() {\n\t\treturn _.values(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 * set belongs to. If there is a workspace scope return it, else return the scope of this set.\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 * Delete all values from Set\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\nSetProperty.prototype._typeid = \"NamedProperty\";\nSetProperty.prototype._context = \"set\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"stringProperty.d.ts","sourceRoot":"","sources":["../../src/properties/stringProperty.js"],"names":[],"mappings":"AAuDA;;GAEG;AACH;IACI;;;;;;;OAOG;IACH,wBAEC;IA6FD;;;;OAIG;IACH,0BAHW,MAAM,YACN,MAAM,QAMhB;IAsID;;;OAGG;IACH,mBAHW,MAAM,QAMhB;IA2BD;;;;;;;OAOG;IACH,oBALW,MAAM,oBACN,OAAO,GAEL,OAAO,CAyBnB;IAiPD,uBAEC;IAND,oBAEC;CAeJ"}
1
+ {"version":3,"file":"stringProperty.d.ts","sourceRoot":"","sources":["../../src/properties/stringProperty.js"],"names":[],"mappings":"AAuDA;;GAEG;AACH;IACC;;;;;;;OAOG;IACH,wBAEC;IAuGD;;;;OAIG;IACH,0BAHW,MAAM,YACN,MAAM,QAMhB;IA6JD;;;OAGG;IACH,mBAHW,MAAM,QAMhB;IA2BD;;;;;;;OAOG;IACH,oBALW,MAAM,oBACN,OAAO,GAEL,OAAO,CAyBnB;IAsQD,uBAEC;IAND,oBAEC;CAeD"}
@@ -5,13 +5,13 @@
5
5
  /**
6
6
  * @fileoverview Definition of the StringProperty class
7
7
  */
8
- const { ChangeSet } = require('@fluid-experimental/property-changeset');
9
- const { MSG } = require('@fluid-experimental/property-common').constants;
10
- const { ConsoleUtils } = require('@fluid-experimental/property-common');
11
- const _ = require('lodash');
12
- const { ArrayProperty } = require('./arrayProperty');
13
- const { BaseProperty } = require('./baseProperty');
14
- const { ValueArrayProperty } = require('./valueArrayProperty');
8
+ const { ChangeSet } = require("@fluid-experimental/property-changeset");
9
+ const { MSG } = require("@fluid-experimental/property-common").constants;
10
+ const { ConsoleUtils } = require("@fluid-experimental/property-common");
11
+ const _ = require("lodash");
12
+ const { ArrayProperty } = require("./arrayProperty");
13
+ const { BaseProperty } = require("./baseProperty");
14
+ const { ValueArrayProperty } = require("./valueArrayProperty");
15
15
  var MODIFIED_STATE_FLAGS = BaseProperty.MODIFIED_STATE_FLAGS;
16
16
  // Some global constant objects that are used to indicate a few special
17
17
  // cases for the dirty object. If the string was directly set to a literal,
@@ -20,22 +20,22 @@ var MODIFIED_STATE_FLAGS = BaseProperty.MODIFIED_STATE_FLAGS;
20
20
  // By using these special objects we avoid the memory overhead of having a separate
21
21
  // object for each array in this state.
22
22
  var PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE = {
23
- pending: 'setAsLiteral',
24
- dirty: 'setAsLiteral',
23
+ pending: "setAsLiteral",
24
+ dirty: "setAsLiteral",
25
25
  flags: MODIFIED_STATE_FLAGS.PENDING_CHANGE | MODIFIED_STATE_FLAGS.DIRTY,
26
26
  };
27
27
  var NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE = {
28
- pending: 'setAsLiteral',
28
+ pending: "setAsLiteral",
29
29
  dirty: undefined,
30
30
  flags: MODIFIED_STATE_FLAGS.PENDING_CHANGE,
31
31
  };
32
32
  var DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE = {
33
33
  pending: undefined,
34
- dirty: 'setAsLiteral',
34
+ dirty: "setAsLiteral",
35
35
  _flags: MODIFIED_STATE_FLAGS.DIRTY,
36
36
  set flags(flags) {
37
37
  this._flags = flags;
38
- console.log('flags was changed!');
38
+ console.log("flags was changed!");
39
39
  },
40
40
  get flags() {
41
41
  return this._flags;
@@ -74,7 +74,7 @@ export class StringProperty extends ValueArrayProperty {
74
74
  *
75
75
  * @param {property-properties.SerializedChangeSet} in_changeSet - The changeset to apply
76
76
  * @private
77
- */
77
+ */
78
78
  _updateChanges(in_changeSet) {
79
79
  // we need to convert the format to allow the application of the changes
80
80
  // since _performApplyAfterOnPropertyArray only understands insert/modify/remove commands
@@ -151,11 +151,11 @@ export class StringProperty extends ValueArrayProperty {
151
151
  this._setDirty();
152
152
  }
153
153
  /**
154
- * Returns the full property type identifier for the ChangeSet including the enum type id
155
- * @param {boolean} [in_hideCollection=false] - if true the collection type (if applicable) will be omitted
156
- * since that is not aplicable here, this param is ignored
157
- * @returns {string} The typeid
158
- */
154
+ * Returns the full property type identifier for the ChangeSet including the enum type id
155
+ * @param {boolean} [in_hideCollection=false] - if true the collection type (if applicable) will be omitted
156
+ * since that is not aplicable here, this param is ignored
157
+ * @returns {string} The typeid
158
+ */
159
159
  getFullTypeid(in_hideCollection) {
160
160
  return this._typeid;
161
161
  }
@@ -163,7 +163,7 @@ export class StringProperty extends ValueArrayProperty {
163
163
  * returns the String to an empty string.
164
164
  */
165
165
  clear() {
166
- this.setValue('');
166
+ this.setValue("");
167
167
  }
168
168
  /**
169
169
  * removes a given number of elements from the array property and shifts
@@ -177,10 +177,14 @@ export class StringProperty extends ValueArrayProperty {
177
177
  * @returns {String} the part of the string that was removed.
178
178
  */
179
179
  removeRange(in_offset, in_deleteCount) {
180
- ConsoleUtils.assert(_.isNumber(in_offset), MSG.NOT_NUMBER + 'in_offset, method: StringProperty.remove or .removeRange');
181
- ConsoleUtils.assert(_.isNumber(in_deleteCount), MSG.NOT_NUMBER + 'in_deleteCount, method: StringProperty.remove or .removeRange');
182
- ConsoleUtils.assert(in_offset + in_deleteCount < this.length + 1 && in_offset >= 0 && in_deleteCount > 0, MSG.REMOVE_OUT_OF_BOUNDS + 'Cannot remove ' + in_deleteCount + ' items starting at index ' + in_offset);
183
- var result = '';
180
+ ConsoleUtils.assert(_.isNumber(in_offset), MSG.NOT_NUMBER + "in_offset, method: StringProperty.remove or .removeRange");
181
+ ConsoleUtils.assert(_.isNumber(in_deleteCount), MSG.NOT_NUMBER + "in_deleteCount, method: StringProperty.remove or .removeRange");
182
+ ConsoleUtils.assert(in_offset + in_deleteCount < this.length + 1 && in_offset >= 0 && in_deleteCount > 0, MSG.REMOVE_OUT_OF_BOUNDS +
183
+ "Cannot remove " +
184
+ in_deleteCount +
185
+ " items starting at index " +
186
+ in_offset);
187
+ var result = "";
184
188
  for (var i = in_offset; i < in_offset + in_deleteCount; i++) {
185
189
  result += this.get(i);
186
190
  }
@@ -208,8 +212,7 @@ export class StringProperty extends ValueArrayProperty {
208
212
  return this._setValue(in_serializedObj, in_reportToView) ? in_serializedObj : {};
209
213
  }
210
214
  else {
211
- if (!in_serializedObj.insert ||
212
- !in_serializedObj.insert[0]) {
215
+ if (!in_serializedObj.insert || !in_serializedObj.insert[0]) {
213
216
  // we've got an empty object, so we have to wipe everything we've got
214
217
  if (oldStringLength > 0) {
215
218
  this.removeRange(0, oldStringLength, in_reportToView);
@@ -346,10 +349,10 @@ export class StringProperty extends ValueArrayProperty {
346
349
  this._dirty === DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE) {
347
350
  let newFlags = this._dirty.flags;
348
351
  if (in_pending === undefined) {
349
- newFlags &= 0xFFFFFFFF ^ BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE;
352
+ newFlags &= 0xffffffff ^ BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE;
350
353
  }
351
354
  if (in_dirty === undefined) {
352
- newFlags &= 0xFFFFFFFF ^ BaseProperty.MODIFIED_STATE_FLAGS.DIRTY;
355
+ newFlags &= 0xffffffff ^ BaseProperty.MODIFIED_STATE_FLAGS.DIRTY;
353
356
  }
354
357
  this._dirty = STRING_PROPERTY_SET_PROPERTY_VALUE_STATE_FLAGS[newFlags];
355
358
  }
@@ -391,7 +394,7 @@ export class StringProperty extends ValueArrayProperty {
391
394
  // distinguish it from a reversible changeset and from a simple changeset...
392
395
  // TODO: We need a formal way to know what kind of content we are to expect in a ChangeSet,
393
396
  // we should never have to guess that.
394
- if (typeof in_changeSet === 'string') {
397
+ if (typeof in_changeSet === "string") {
395
398
  // Let's consider it's a simple changeset.
396
399
  this._setValue(in_changeSet, in_reportToView);
397
400
  }
@@ -412,7 +415,14 @@ export class StringProperty extends ValueArrayProperty {
412
415
  * @param {function} printFct - Function to call for printing each property
413
416
  */
414
417
  _prettyPrint(indent, externalId, printFct) {
415
- printFct(indent + externalId + this.getId() + ' (' + this.getTypeid() + '): "' + this.value + '"');
418
+ printFct(indent +
419
+ externalId +
420
+ this.getId() +
421
+ " (" +
422
+ this.getTypeid() +
423
+ '): "' +
424
+ this.value +
425
+ '"');
416
426
  }
417
427
  /**
418
428
  * Return a JSON representation of the property.
@@ -472,7 +482,7 @@ export class StringProperty extends ValueArrayProperty {
472
482
  */
473
483
  insertRange(in_position, in_value) {
474
484
  if (_.isArray(in_value)) {
475
- in_value = in_value.join('');
485
+ in_value = in_value.join("");
476
486
  }
477
487
  this._insertRange(in_position, in_value);
478
488
  }
@@ -481,7 +491,7 @@ export class StringProperty extends ValueArrayProperty {
481
491
  * @param {Number} in_length - The initial length of the array
482
492
  */
483
493
  _dataArrayCreate(in_length) {
484
- this._dataArrayRef = '';
494
+ this._dataArrayRef = "";
485
495
  }
486
496
  /**
487
497
  * Returns the length of the data array
@@ -506,7 +516,7 @@ export class StringProperty extends ValueArrayProperty {
506
516
  _dataArrayGetValue(in_i) {
507
517
  in_i = in_i === undefined ? 0 : in_i;
508
518
  if (in_i >= this._size || in_i < 0) {
509
- throw new Error('Trying to access out of bounds!');
519
+ throw new Error("Trying to access out of bounds!");
510
520
  }
511
521
  return this._dataArrayRef[in_i];
512
522
  }
@@ -523,7 +533,10 @@ export class StringProperty extends ValueArrayProperty {
523
533
  * @param {String} in_range - The array to insert
524
534
  */
525
535
  _dataArrayInsertRange(in_position, in_range) {
526
- this._dataArrayRef = this._dataArrayRef.substr(0, in_position) + in_range + this._dataArrayRef.substr(in_position);
536
+ this._dataArrayRef =
537
+ this._dataArrayRef.substr(0, in_position) +
538
+ in_range +
539
+ this._dataArrayRef.substr(in_position);
527
540
  }
528
541
  /**
529
542
  * Removes a range from the data array
@@ -532,11 +545,12 @@ export class StringProperty extends ValueArrayProperty {
532
545
  */
533
546
  _dataArrayRemoveRange(in_position, in_length) {
534
547
  if (in_position + in_length < this._dataArrayRef.length + 1) {
535
- this._dataArrayRef = this._dataArrayRef.substr(0, in_position) +
536
- this._dataArrayRef.substr(in_position + in_length);
548
+ this._dataArrayRef =
549
+ this._dataArrayRef.substr(0, in_position) +
550
+ this._dataArrayRef.substr(in_position + in_length);
537
551
  }
538
552
  else {
539
- throw Error('DataArray removeRange in_offset + in_deleteCount is out of bounds.');
553
+ throw Error("DataArray removeRange in_offset + in_deleteCount is out of bounds.");
540
554
  }
541
555
  }
542
556
  /**
@@ -545,8 +559,10 @@ export class StringProperty extends ValueArrayProperty {
545
559
  * @param {String} in_values - The string with which the range is overwritten
546
560
  */
547
561
  _dataArraySetRange(in_position, in_values) {
548
- this._dataArrayRef = this._dataArrayRef.substr(0, in_position) + in_values +
549
- this._dataArrayRef.substr(in_position + in_values.length);
562
+ this._dataArrayRef =
563
+ this._dataArrayRef.substr(0, in_position) +
564
+ in_values +
565
+ this._dataArrayRef.substr(in_position + in_values.length);
550
566
  }
551
567
  get value() {
552
568
  return this.getValue();
@@ -563,7 +579,7 @@ export class StringProperty extends ValueArrayProperty {
563
579
  return undefined;
564
580
  }
565
581
  }
566
- StringProperty.prototype._typeid = 'String';
567
- StringProperty.prototype._context = 'single';
582
+ StringProperty.prototype._typeid = "String";
583
+ StringProperty.prototype._context = "single";
568
584
  StringProperty.prototype._noDirtyInBase = true;
569
585
  //# sourceMappingURL=stringProperty.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stringProperty.js","sourceRoot":"","sources":["../../src/properties/stringProperty.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AAEH,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AACxE,MAAM,EAAE,GAAG,EAAE,GAAG,O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F;IACL,CAAC;IAED;;;;OAIG;IACH,kBAAkB,CAAC,WAAW,EAAE,SAAS;QACrC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,GAAG,SAAS;YACtE,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IAClE,CAAC;IAED,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAED,IAAI,KAAK,CAAC,GAAG;QACT,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAClC,CAAC;IAED,kBAAkB;IAClB,SAAS,CAAC,WAAW,EAAE,yBAAyB;QAC5C,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,kBAAkB;IAClB,yBAAyB,CAAC,WAAW,EAAE,yBAAyB;QAC5D,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ;AAED,cAAc,CAAC,SAAS,CAAC,OAAO,GAAG,QAAQ,CAAC;AAC5C,cAAc,CAAC,SAAS,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC7C,cAAc,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,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 StringProperty class\n */\n\nconst { ChangeSet } = require('@fluid-experimental/property-changeset');\nconst { MSG } = require('@fluid-experimental/property-common').constants;\nconst { ConsoleUtils } = require('@fluid-experimental/property-common');\nconst _ = require('lodash');\nconst { ArrayProperty } = require('./arrayProperty');\nconst { BaseProperty } = require('./baseProperty');\nconst { ValueArrayProperty } = require('./valueArrayProperty');\n\nvar MODIFIED_STATE_FLAGS = BaseProperty.MODIFIED_STATE_FLAGS;\n\n// Some global constant objects that are used to indicate a few special\n// cases for the dirty object. If the string was directly set to a literal,\n// we don't need to store any ChangeSet, we only need to store the information\n// that it was updated to a literal and the dirty flags.\n// By using these special objects we avoid the memory overhead of having a separate\n// object for each array in this state.\nvar PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE = {\n pending: 'setAsLiteral',\n dirty: 'setAsLiteral',\n flags: MODIFIED_STATE_FLAGS.PENDING_CHANGE | MODIFIED_STATE_FLAGS.DIRTY,\n};\nvar NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE = {\n pending: 'setAsLiteral',\n dirty: undefined,\n flags: MODIFIED_STATE_FLAGS.PENDING_CHANGE,\n};\n\nvar DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE = {\n pending: undefined,\n dirty: 'setAsLiteral',\n _flags: MODIFIED_STATE_FLAGS.DIRTY,\n set flags(flags) {\n this._flags = flags;\n console.log('flags was changed!');\n },\n get flags() {\n return this._flags;\n },\n};\n\nvar STRING_PROPERTY_SET_PROPERTY_VALUE_STATE_FLAGS = [\n undefined,\n NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE,\n DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE,\n PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE,\n];\n\n/**\n * A primitive property for a string value.\n */\nexport class StringProperty extends ValueArrayProperty {\n /**\n * @param {Object=} in_params - The parameters\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.StringProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\n }\n\n /**\n * Get the string value\n * @returns {string} the JavaScript string primitive value of this StringProperty\n */\n getValue() {\n return this._dataArrayRef;\n }\n\n /**\n * Private helper function to update the internal dirty and pending changes\n *\n * @param {property-properties.SerializedChangeSet} in_changeSet - The changeset to apply\n * @private\n */\n _updateChanges(in_changeSet) {\n // we need to convert the format to allow the application of the changes\n // since _performApplyAfterOnPropertyArray only understands insert/modify/remove commands\n var pendingChangesWereSetBefore = false;\n var pendingChanges = this._getPendingChanges();\n\n if (_.isString(pendingChanges)) {\n pendingChanges = { insert: [[0, pendingChanges]] };\n pendingChangesWereSetBefore = true;\n }\n ChangeSet.prototype._performApplyAfterOnPropertyArray(pendingChanges,\n in_changeSet, this.getFullTypeid(true));\n if (pendingChangesWereSetBefore) {\n pendingChanges = pendingChanges.insert[0][1];\n }\n\n var dirtyChangesWereSetBefore = false;\n var dirtyChanges = this._getDirtyChanges();\n\n if (_.isString(dirtyChanges)) {\n dirtyChanges = { insert: [[0, dirtyChanges]] };\n dirtyChangesWereSetBefore = true;\n }\n ChangeSet.prototype._performApplyAfterOnPropertyArray(dirtyChanges,\n in_changeSet, this.getFullTypeid(true));\n if (dirtyChangesWereSetBefore) {\n dirtyChanges = dirtyChanges.insert[0][1];\n }\n\n this._setChanges(pendingChanges, dirtyChanges);\n }\n\n _getPendingChanges() {\n if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE) {\n return this.getValue();\n }\n\n return (this._dirty && this._dirty.pending) || {};\n }\n\n _getDirtyChanges() {\n if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n this._dirty === DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE) {\n return this.getValue();\n } else if (this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE) {\n return {};\n }\n\n return (this._dirty && this._dirty.dirty) || {};\n }\n\n /**\n * inserts a string starting at a position and shifts the rest of\n * the String to the right. Will not overwrite existing values.\n * @param {number} in_position - Target index\n * @param {string} in_value - Value to be inserted\n * @throws If in_position is smaller than zero, larger than the length of the string or not a number\n * @throws If in_value is not a string\n */\n insert(in_position, in_value) {\n ConsoleUtils.assert(_.isString(in_value), MSG.IN_VALUE_MUST_BE_STRING + in_value);\n this._insertRange(in_position, in_value);\n }\n\n /**\n * Adds letters to the end of the string\n * @param {string} in_value - The string to be pushed\n * @throws If in_value is not a string\n * @returns {number} The new length of the string.\n */\n push(in_value) {\n ConsoleUtils.assert(_.isString(in_value), MSG.IN_VALUE_MUST_BE_STRING + in_value);\n this._insertRange(this._dataArrayRef.length, in_value);\n return this.getLength();\n }\n\n /**\n * inserts values\n * @param {number} in_position - Target index\n * @param {string} in_value - The string to be inserted\n */\n _insertRange(in_position, in_value) {\n this._checkIsNotReadOnly(true);\n this._insertRangeWithoutDirtying(in_position, in_value);\n this._setDirty();\n }\n\n /**\n * Returns the full property type identifier for the ChangeSet including the enum type id\n * @param {boolean} [in_hideCollection=false] - if true the collection type (if applicable) will be omitted\n * since that is not aplicable here, this param is ignored\n * @returns {string} The typeid\n */\n getFullTypeid(in_hideCollection) {\n return this._typeid;\n }\n\n /**\n * returns the String to an empty string.\n */\n clear() {\n this.setValue('');\n }\n\n /**\n * removes a given number of elements from the array property and shifts\n * remaining values to the left.\n * @param {number} in_offset - Target start index\n * @param {number} in_deleteCount - number of elements to be deleted\n * @throws If in_offset is not a number\n * @throws If in_deleteCount is not a number\n * @throws If trying to remove an item with a parent\n * @throws If in_offset is smaller than zero or if in_offset + in_delete count is larger than the length of the array\n * @returns {String} the part of the string that was removed.\n */\n removeRange(in_offset, in_deleteCount) {\n ConsoleUtils.assert(_.isNumber(in_offset),\n MSG.NOT_NUMBER + 'in_offset, method: StringProperty.remove or .removeRange');\n ConsoleUtils.assert(_.isNumber(in_deleteCount),\n MSG.NOT_NUMBER + 'in_deleteCount, method: StringProperty.remove or .removeRange');\n ConsoleUtils.assert(in_offset + in_deleteCount < this.length + 1 && in_offset >= 0 && in_deleteCount > 0,\n MSG.REMOVE_OUT_OF_BOUNDS + 'Cannot remove ' + in_deleteCount + ' items starting at index ' + in_offset);\n var result = '';\n for (var i = in_offset; i < in_offset + in_deleteCount; i++) {\n result += this.get(i);\n }\n this._checkIsNotReadOnly(true);\n this._removeRangeWithoutDirtying(in_offset, in_deleteCount);\n this._setDirty();\n return result;\n }\n\n /**\n * @inheritdoc\n */\n _deserialize(in_serializedObj, in_reportToView,\n in_filteringOptions, in_createChangeSet) {\n if ((in_serializedObj.remove && in_serializedObj.remove.length > 0) ||\n (in_serializedObj.modify && in_serializedObj.modify.length > 0) ||\n (in_serializedObj.insert &&\n (in_serializedObj.insert.length > 1 ||\n (in_serializedObj.insert.length === 1 &&\n (in_serializedObj.insert[0][0] !== 0 ||\n !_.isString(in_serializedObj.insert[0][1])))))) {\n throw new Error(MSG.NO_NORMALIZED_CHANGESET);\n }\n\n var oldStringLength = this._dataArrayRef.length;\n var newStringData;\n if (_.isString(in_serializedObj)) {\n return this._setValue(in_serializedObj, in_reportToView) ? in_serializedObj : {};\n } else {\n if (!in_serializedObj.insert ||\n !in_serializedObj.insert[0]) {\n // we've got an empty object, so we have to wipe everything we've got\n if (oldStringLength > 0) {\n this.removeRange(0, oldStringLength, in_reportToView);\n return {\n remove: [[0, oldStringLength]],\n };\n } else {\n // the string was already empty, nothing has changed\n return {};\n }\n } else {\n newStringData = in_serializedObj.insert[0][1];\n }\n }\n\n if (newStringData === this._dataArrayRef) {\n // nothing changed\n return {};\n }\n\n // check if something was attached (very common case)\n if (newStringData.length > oldStringLength) {\n if (newStringData.substring(0, oldStringLength) === this._dataArrayRef) {\n var appendChanges = {\n insert: [[oldStringLength, newStringData.substring(oldStringLength)]],\n };\n this.insertRange(oldStringLength, newStringData.substring(oldStringLength), in_reportToView);\n return appendChanges;\n }\n }\n\n // most simplistic diff method: Remove all existing data and insert the new data\n var simpleChanges = {\n insert: [[0, newStringData]],\n };\n if (oldStringLength > 0) {\n simpleChanges.remove = [[0, oldStringLength]];\n this._removeRangeWithoutDirtying(0, oldStringLength, in_reportToView);\n }\n this.insertRange(0, newStringData, in_reportToView);\n return simpleChanges;\n }\n\n /**\n * Serialize the property\n *\n * @param {boolean} in_dirtyOnly - Only include dirty entries in the serialization\n * @param {boolean} in_includeRootTypeid - Include the typeid of the root of the hierarchy. Has no effect for\n * ArrayProperty.\n * @param {property-properties.BaseProperty.MODIFIED_STATE_FLAGS} [in_dirtinessType] - The type of dirtiness to use\n * when reporting dirty changes. By default this is `PENDING_CHANGE`.\n * @param {boolean} [in_includeReferencedRepositories=false] - If this is set to true, the serialize\n * function will descend into referenced repositories. WARNING: if there are loops in the references\n * this can result in an infinite loop\n *\n * @returns {Object} The serialized representation of this property\n * @private\n */\n _serialize(in_dirtyOnly, in_includeRootTypeid,\n in_dirtinessType, in_includeReferencedRepositories) {\n return in_dirtyOnly\n ? ArrayProperty.prototype._serialize.call(this, in_dirtyOnly, in_includeRootTypeid, in_dirtinessType)\n : this._dataArrayRef;\n }\n\n /**\n * @param {string} in_value - The new value\n * @throws If string property is read only\n */\n setValue(in_value) {\n this._checkIsNotReadOnly(true);\n this._setValue(in_value, true);\n }\n\n /**\n * See {@link StringProperty.setValues}\n * @param {string} in_values - The new values\n * @param {Bool} in_initial - Whether we are setting default/initial values or if the function is called directly\n * with the values to set.\n */\n _setValues(in_values, in_initial) {\n throw new Error(MSG.NO_VALUE_PROPERTY_SETVALUES);\n }\n\n /**\n * @param {string} in_values - The new values\n * @throws always - Cannot use .setValues on a StringProperty. Use .setValue() instead.\n */\n setValues(in_values) {\n StringProperty.prototype._setValues.call(this, in_values, false);\n }\n\n /**\n * @throws always - cannot call .getValues on a string. Use .getValue() instead\n */\n getValues() {\n throw new Error(MSG.NO_VALUE_PROPERTY_GETVALUES);\n }\n\n /**\n * Internal function to update the value of a property\n *\n * @param {string} in_value - The new value\n * @param {boolean} [in_reportToView = true] - By default, the dirtying will always be reported to the checkout view\n * and trigger a modified event there. When batching updates, this can be prevented via this flag.\n * @returns {boolean} true if the value was actually changed\n */\n _setValue(in_value, in_reportToView) {\n var oldValue = this._dataArrayRef;\n var castedValue = String(in_value);\n var changed = castedValue !== oldValue;\n if (changed) {\n var stringLength = this._dataArrayRef.length;\n if (stringLength > 0) {\n this._dataArrayRemoveRange(0, stringLength);\n }\n this._dataArrayInsertRange(0, castedValue);\n\n this._dirty = PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE;\n\n // The assignment in the line above already set this property to\n // dirty, so we only update the parent (instead of calling\n // setDirty on this property)\n if (this._parent) {\n this._parent._setDirty(in_reportToView, this);\n } else if (in_reportToView === true || in_reportToView === undefined) {\n this._reportDirtinessToView();\n }\n }\n return changed;\n }\n\n /**\n * Sets the pending and dirty changesets\n *\n * @param {property-properties.SerializedChangeSet|undefined|null} in_pending - The pending changeset. If null is\n * passed, no change will be applied. undefined indicates that the changes should be reset\n * @param {property-properties.SerializedChangeSet|undefined|null} in_dirty - The dirty changeset. If null is\n * passed, no change will be applied. undefined indicates that the changes should be reset\n */\n _setChanges(in_pending, in_dirty) {\n if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE ||\n this._dirty === DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE) {\n let newFlags = this._dirty.flags;\n if (in_pending === undefined) {\n newFlags &= 0xFFFFFFFF ^ BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE;\n }\n if (in_dirty === undefined) {\n newFlags &= 0xFFFFFFFF ^ BaseProperty.MODIFIED_STATE_FLAGS.DIRTY;\n }\n this._dirty = STRING_PROPERTY_SET_PROPERTY_VALUE_STATE_FLAGS[newFlags];\n } else {\n ArrayProperty.prototype._setChanges.call(this, in_pending, in_dirty);\n }\n }\n\n /**\n * Sets the dirty flags for this property\n * @param {Number} in_flags - The dirty flags\n */\n _setDirtyFlags(in_flags) {\n if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE ||\n this._dirty === DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE) {\n this._dirty = STRING_PROPERTY_SET_PROPERTY_VALUE_STATE_FLAGS[in_flags];\n return;\n }\n\n ArrayProperty.prototype._setDirtyFlags.call(this, in_flags);\n }\n\n /**\n * Gets the dirty flags for this property\n * @returns {Number} The dirty flags\n */\n _getDirtyFlags() {\n if (this._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE ||\n this._dirty === DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE) {\n return this._dirty.flags;\n }\n\n return ArrayProperty.prototype._getDirtyFlags.call(this);\n }\n\n /**\n * @inheritdoc\n */\n _applyChangeset(in_changeSet, in_reportToView) {\n // It is unfortunate, but because StringProperty derives from ArrayProperty, it can happen\n // that we receive here a ChangeSet that is formatted for an Array. We must be able to\n // distinguish it from a reversible changeset and from a simple changeset...\n // TODO: We need a formal way to know what kind of content we are to expect in a ChangeSet,\n // we should never have to guess that.\n if (typeof in_changeSet === 'string') {\n // Let's consider it's a simple changeset.\n this._setValue(in_changeSet, in_reportToView);\n } else if (in_changeSet.value !== undefined) {\n // Let's consider it's a reversible changeset.\n this._setValue(in_changeSet.value, in_reportToView);\n } else {\n // Let's consider it's an ArrayProperty-like changeset\n ArrayProperty.prototype._applyChangeset.call(this, in_changeSet, in_reportToView);\n }\n }\n\n /**\n * Calls back the given function with a human-readable string\n * representation of the property.\n * @param {string} indent - Leading spaces to create the tree representation\n * @param {string} externalId - Name of the current property at the upper level. Used for arrays.\n * @param {function} printFct - Function to call for printing each property\n */\n _prettyPrint(indent, externalId, printFct) {\n printFct(indent + externalId + this.getId() + ' (' + this.getTypeid() + '): \"' + this.value + '\"');\n }\n\n /**\n * Return a JSON representation of the property.\n * @returns {object} A JSON representation of the property.\n * @private\n */\n _toJson() {\n return {\n id: this.getId(),\n context: this._context,\n typeid: this.getTypeid(),\n isConstant: this._isConstant,\n value: this.value,\n };\n }\n\n /**\n * Sets the value of a character at a single index.\n * For example, if you have a string of value 'AAAA' and do .set(1, 'a') => 'AaAA'\n * @param {number} in_index - The index you wish to set\n * @param {string} in_character - The character you wish to set\n * @throws If length of in_character is longer than one character\n */\n set(in_index, in_character) {\n ConsoleUtils.assert(_.isNumber(in_index), MSG.STRING_SET_NEEDS_INDEX + in_index);\n\n if (in_character.length !== 1) {\n throw new Error(MSG.STRING_SET_ONE_CHAR);\n }\n\n this.setRange(in_index, in_character);\n }\n\n /**\n * sets values in a string starting at an index.\n * For example, if you have a string of Value 'AAAA' and do .setRange(1, 'aa') => AaaA\n * It will set as many letters as are in in_string.\n * @param {number} in_index - The index at which you wish to start setting\n * @param {string} in_string - The string you wish to set\n * @throws If in_index + length of in_string is longer than the original string\n */\n setRange(in_index, in_string) {\n ArrayProperty.prototype.setRange.call(this, in_index, in_string);\n }\n\n /**\n * get a letter at a given index\n * @param {number} in_index - The index\n * @returns {string} the single letter found at in_index\n */\n get(in_index) {\n return ArrayProperty.prototype.get.call(this, in_index);\n }\n\n /**\n * inserts a string starting at a position and shifts the rest of the String to the right.\n * Will not overwrite existing values.\n * For StringProperty, insert and insertRange work the same, except that .insert\n * checks that in_value is a string and .insertRange will accept an array of strings.\n * @param {number} in_position - Target index\n * @param {string | array<string>} in_value - value to be inserted\n * @throws If in_position is smaller than zero, larger than the length of the string or not a number\n */\n insertRange(in_position, in_value) {\n if (_.isArray(in_value)) {\n in_value = in_value.join('');\n }\n this._insertRange(in_position, in_value);\n }\n\n /**\n * Creates and initializes the data array\n * @param {Number} in_length - The initial length of the array\n */\n _dataArrayCreate(in_length) {\n this._dataArrayRef = '';\n }\n\n /**\n * Returns the length of the data array\n * @returns {Number} The length\n */\n _dataArrayGetLength() {\n return this._dataArrayRef.length;\n }\n\n /**\n * Returns the data array's internal buffer\n * @returns {Array} The buffer\n */\n _dataArrayGetBuffer() {\n return this._dataArrayRef;\n }\n\n /**\n * Returns an entry from the data array\n * @param {Number} in_i - Position in the array\n *\n * @returns {*} The value at index in_i\n */\n _dataArrayGetValue(in_i) {\n in_i = in_i === undefined ? 0 : in_i;\n if (in_i >= this._size || in_i < 0) {\n throw new Error('Trying to access out of bounds!');\n }\n\n return this._dataArrayRef[in_i];\n }\n\n /**\n * Set the array to the given new array\n * @param {String} in_newString - The new contents of the array\n */\n _dataArrayDeserialize(in_newString) {\n this._dataArrayRef = in_newString;\n }\n\n /**\n * Inserts a range into the data array\n * @param {Number} in_position - Position at which the insert should be done\n * @param {String} in_range - The array to insert\n */\n _dataArrayInsertRange(in_position, in_range) {\n this._dataArrayRef = this._dataArrayRef.substr(0, in_position) + in_range + this._dataArrayRef.substr(in_position);\n }\n\n /**\n * Removes a range from the data array\n * @param {Number} in_position - Position at which to start the removal\n * @param {Number} in_length - The number of entries to remove\n */\n _dataArrayRemoveRange(in_position, in_length) {\n if (in_position + in_length < this._dataArrayRef.length + 1) {\n this._dataArrayRef = this._dataArrayRef.substr(0, in_position) +\n this._dataArrayRef.substr(in_position + in_length);\n } else {\n throw Error('DataArray removeRange in_offset + in_deleteCount is out of bounds.');\n }\n }\n\n /**\n * Overwrites a range in the data array\n * @param {Number} in_position - Position at which to start the removal\n * @param {String} in_values - The string with which the range is overwritten\n */\n _dataArraySetRange(in_position, in_values) {\n this._dataArrayRef = this._dataArrayRef.substr(0, in_position) + in_values +\n this._dataArrayRef.substr(in_position + in_values.length);\n }\n\n get value() {\n return this.getValue();\n }\n\n set value(val) {\n this.setValue.call(this, val);\n }\n\n /** @inheritdoc */\n _traverse(in_callback, in_pathFromTraversalStart) {\n return undefined;\n }\n\n /** @inheritdoc */\n _traverseStaticProperties(in_callback, in_pathFromTraversalStart) {\n return undefined;\n }\n}\n\nStringProperty.prototype._typeid = 'String';\nStringProperty.prototype._context = 'single';\nStringProperty.prototype._noDirtyInBase = true;\n"]}
1
+ {"version":3,"file":"stringProperty.js","sourceRoot":"","sources":["../../src/properties/stringProperty.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AAEH,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AACxE,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC;AACzE,MAAM,EAAE,Y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CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC;gBACzC,SAAS;gBACT,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IAC5D,CAAC;IAED,IAAI,KAAK;QACR,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IACxB,CAAC;IAED,IAAI,KAAK,CAAC,GAAG;QACZ,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC/B,CAAC;IAED,kBAAkB;IAClB,SAAS,CAAC,WAAW,EAAE,yBAAyB;QAC/C,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,kBAAkB;IAClB,yBAAyB,CAAC,WAAW,EAAE,yBAAyB;QAC/D,OAAO,SAAS,CAAC;IAClB,CAAC;CACD;AAED,cAAc,CAAC,SAAS,CAAC,OAAO,GAAG,QAAQ,CAAC;AAC5C,cAAc,CAAC,SAAS,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC7C,cAAc,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,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 StringProperty class\n */\n\nconst { ChangeSet } = require(\"@fluid-experimental/property-changeset\");\nconst { MSG } = require(\"@fluid-experimental/property-common\").constants;\nconst { ConsoleUtils } = require(\"@fluid-experimental/property-common\");\nconst _ = require(\"lodash\");\nconst { ArrayProperty } = require(\"./arrayProperty\");\nconst { BaseProperty } = require(\"./baseProperty\");\nconst { ValueArrayProperty } = require(\"./valueArrayProperty\");\n\nvar MODIFIED_STATE_FLAGS = BaseProperty.MODIFIED_STATE_FLAGS;\n\n// Some global constant objects that are used to indicate a few special\n// cases for the dirty object. If the string was directly set to a literal,\n// we don't need to store any ChangeSet, we only need to store the information\n// that it was updated to a literal and the dirty flags.\n// By using these special objects we avoid the memory overhead of having a separate\n// object for each array in this state.\nvar PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE = {\n\tpending: \"setAsLiteral\",\n\tdirty: \"setAsLiteral\",\n\tflags: MODIFIED_STATE_FLAGS.PENDING_CHANGE | MODIFIED_STATE_FLAGS.DIRTY,\n};\nvar NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE = {\n\tpending: \"setAsLiteral\",\n\tdirty: undefined,\n\tflags: MODIFIED_STATE_FLAGS.PENDING_CHANGE,\n};\n\nvar DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE = {\n\tpending: undefined,\n\tdirty: \"setAsLiteral\",\n\t_flags: MODIFIED_STATE_FLAGS.DIRTY,\n\tset flags(flags) {\n\t\tthis._flags = flags;\n\t\tconsole.log(\"flags was changed!\");\n\t},\n\tget flags() {\n\t\treturn this._flags;\n\t},\n};\n\nvar STRING_PROPERTY_SET_PROPERTY_VALUE_STATE_FLAGS = [\n\tundefined,\n\tNO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE,\n\tDIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE,\n\tPENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE,\n];\n\n/**\n * A primitive property for a string value.\n */\nexport class StringProperty extends ValueArrayProperty {\n\t/**\n\t * @param {Object=} in_params - The parameters\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueArrayProperty\n\t * @alias property-properties.StringProperty\n\t * @category Arrays\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n\n\t/**\n\t * Get the string value\n\t * @returns {string} the JavaScript string primitive value of this StringProperty\n\t */\n\tgetValue() {\n\t\treturn this._dataArrayRef;\n\t}\n\n\t/**\n\t * Private helper function to update the internal dirty and pending changes\n\t *\n\t * @param {property-properties.SerializedChangeSet} in_changeSet - The changeset to apply\n\t * @private\n\t */\n\t_updateChanges(in_changeSet) {\n\t\t// we need to convert the format to allow the application of the changes\n\t\t// since _performApplyAfterOnPropertyArray only understands insert/modify/remove commands\n\t\tvar pendingChangesWereSetBefore = false;\n\t\tvar pendingChanges = this._getPendingChanges();\n\n\t\tif (_.isString(pendingChanges)) {\n\t\t\tpendingChanges = { insert: [[0, pendingChanges]] };\n\t\t\tpendingChangesWereSetBefore = true;\n\t\t}\n\t\tChangeSet.prototype._performApplyAfterOnPropertyArray(\n\t\t\tpendingChanges,\n\t\t\tin_changeSet,\n\t\t\tthis.getFullTypeid(true),\n\t\t);\n\t\tif (pendingChangesWereSetBefore) {\n\t\t\tpendingChanges = pendingChanges.insert[0][1];\n\t\t}\n\n\t\tvar dirtyChangesWereSetBefore = false;\n\t\tvar dirtyChanges = this._getDirtyChanges();\n\n\t\tif (_.isString(dirtyChanges)) {\n\t\t\tdirtyChanges = { insert: [[0, dirtyChanges]] };\n\t\t\tdirtyChangesWereSetBefore = true;\n\t\t}\n\t\tChangeSet.prototype._performApplyAfterOnPropertyArray(\n\t\t\tdirtyChanges,\n\t\t\tin_changeSet,\n\t\t\tthis.getFullTypeid(true),\n\t\t);\n\t\tif (dirtyChangesWereSetBefore) {\n\t\t\tdirtyChanges = dirtyChanges.insert[0][1];\n\t\t}\n\n\t\tthis._setChanges(pendingChanges, dirtyChanges);\n\t}\n\n\t_getPendingChanges() {\n\t\tif (\n\t\t\tthis._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n\t\t\tthis._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE\n\t\t) {\n\t\t\treturn this.getValue();\n\t\t}\n\n\t\treturn (this._dirty && this._dirty.pending) || {};\n\t}\n\n\t_getDirtyChanges() {\n\t\tif (\n\t\t\tthis._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n\t\t\tthis._dirty === DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE\n\t\t) {\n\t\t\treturn this.getValue();\n\t\t} else if (this._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE) {\n\t\t\treturn {};\n\t\t}\n\n\t\treturn (this._dirty && this._dirty.dirty) || {};\n\t}\n\n\t/**\n\t * inserts a string starting at a position and shifts the rest of\n\t * the String to the right. Will not overwrite existing values.\n\t * @param {number} in_position - Target index\n\t * @param {string} in_value - Value to be inserted\n\t * @throws If in_position is smaller than zero, larger than the length of the string or not a number\n\t * @throws If in_value is not a string\n\t */\n\tinsert(in_position, in_value) {\n\t\tConsoleUtils.assert(_.isString(in_value), MSG.IN_VALUE_MUST_BE_STRING + in_value);\n\t\tthis._insertRange(in_position, in_value);\n\t}\n\n\t/**\n\t * Adds letters to the end of the string\n\t * @param {string} in_value - The string to be pushed\n\t * @throws If in_value is not a string\n\t * @returns {number} The new length of the string.\n\t */\n\tpush(in_value) {\n\t\tConsoleUtils.assert(_.isString(in_value), MSG.IN_VALUE_MUST_BE_STRING + in_value);\n\t\tthis._insertRange(this._dataArrayRef.length, in_value);\n\t\treturn this.getLength();\n\t}\n\n\t/**\n\t * inserts values\n\t * @param {number} in_position - Target index\n\t * @param {string} in_value - The string to be inserted\n\t */\n\t_insertRange(in_position, in_value) {\n\t\tthis._checkIsNotReadOnly(true);\n\t\tthis._insertRangeWithoutDirtying(in_position, in_value);\n\t\tthis._setDirty();\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 * since that is not aplicable here, this param is ignored\n\t * @returns {string} The typeid\n\t */\n\tgetFullTypeid(in_hideCollection) {\n\t\treturn this._typeid;\n\t}\n\n\t/**\n\t * returns the String to an empty string.\n\t */\n\tclear() {\n\t\tthis.setValue(\"\");\n\t}\n\n\t/**\n\t * removes a given number of elements from the array property and shifts\n\t * 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 {String} the part of the string that was removed.\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: StringProperty.remove or .removeRange\",\n\t\t);\n\t\tConsoleUtils.assert(\n\t\t\t_.isNumber(in_deleteCount),\n\t\t\tMSG.NOT_NUMBER + \"in_deleteCount, method: StringProperty.remove or .removeRange\",\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 += this.get(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_deserialize(in_serializedObj, in_reportToView, in_filteringOptions, in_createChangeSet) {\n\t\tif (\n\t\t\t(in_serializedObj.remove && in_serializedObj.remove.length > 0) ||\n\t\t\t(in_serializedObj.modify && in_serializedObj.modify.length > 0) ||\n\t\t\t(in_serializedObj.insert &&\n\t\t\t\t(in_serializedObj.insert.length > 1 ||\n\t\t\t\t\t(in_serializedObj.insert.length === 1 &&\n\t\t\t\t\t\t(in_serializedObj.insert[0][0] !== 0 ||\n\t\t\t\t\t\t\t!_.isString(in_serializedObj.insert[0][1])))))\n\t\t) {\n\t\t\tthrow new Error(MSG.NO_NORMALIZED_CHANGESET);\n\t\t}\n\n\t\tvar oldStringLength = this._dataArrayRef.length;\n\t\tvar newStringData;\n\t\tif (_.isString(in_serializedObj)) {\n\t\t\treturn this._setValue(in_serializedObj, in_reportToView) ? in_serializedObj : {};\n\t\t} else {\n\t\t\tif (!in_serializedObj.insert || !in_serializedObj.insert[0]) {\n\t\t\t\t// we've got an empty object, so we have to wipe everything we've got\n\t\t\t\tif (oldStringLength > 0) {\n\t\t\t\t\tthis.removeRange(0, oldStringLength, in_reportToView);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tremove: [[0, oldStringLength]],\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\t// the string was already empty, nothing has changed\n\t\t\t\t\treturn {};\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnewStringData = in_serializedObj.insert[0][1];\n\t\t\t}\n\t\t}\n\n\t\tif (newStringData === this._dataArrayRef) {\n\t\t\t// nothing changed\n\t\t\treturn {};\n\t\t}\n\n\t\t// check if something was attached (very common case)\n\t\tif (newStringData.length > oldStringLength) {\n\t\t\tif (newStringData.substring(0, oldStringLength) === this._dataArrayRef) {\n\t\t\t\tvar appendChanges = {\n\t\t\t\t\tinsert: [[oldStringLength, newStringData.substring(oldStringLength)]],\n\t\t\t\t};\n\t\t\t\tthis.insertRange(\n\t\t\t\t\toldStringLength,\n\t\t\t\t\tnewStringData.substring(oldStringLength),\n\t\t\t\t\tin_reportToView,\n\t\t\t\t);\n\t\t\t\treturn appendChanges;\n\t\t\t}\n\t\t}\n\n\t\t// most simplistic diff method: Remove all existing data and insert the new data\n\t\tvar simpleChanges = {\n\t\t\tinsert: [[0, newStringData]],\n\t\t};\n\t\tif (oldStringLength > 0) {\n\t\t\tsimpleChanges.remove = [[0, oldStringLength]];\n\t\t\tthis._removeRangeWithoutDirtying(0, oldStringLength, in_reportToView);\n\t\t}\n\t\tthis.insertRange(0, newStringData, in_reportToView);\n\t\treturn simpleChanges;\n\t}\n\n\t/**\n\t * Serialize the property\n\t *\n\t * @param {boolean} in_dirtyOnly - Only include dirty entries in the serialization\n\t * @param {boolean} in_includeRootTypeid - Include the typeid of the root of the hierarchy. Has no effect for\n\t * ArrayProperty.\n\t * @param {property-properties.BaseProperty.MODIFIED_STATE_FLAGS} [in_dirtinessType] - The type of dirtiness to use\n\t * when reporting dirty changes. By default this is `PENDING_CHANGE`.\n\t * @param {boolean} [in_includeReferencedRepositories=false] - If this is set to true, the serialize\n\t * function will descend into referenced repositories. WARNING: if there are loops in the references\n\t * this can result in an infinite loop\n\t *\n\t * @returns {Object} 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\treturn in_dirtyOnly\n\t\t\t? ArrayProperty.prototype._serialize.call(\n\t\t\t\t\tthis,\n\t\t\t\t\tin_dirtyOnly,\n\t\t\t\t\tin_includeRootTypeid,\n\t\t\t\t\tin_dirtinessType,\n\t\t\t )\n\t\t\t: this._dataArrayRef;\n\t}\n\n\t/**\n\t * @param {string} in_value - The new value\n\t * @throws If string property is read only\n\t */\n\tsetValue(in_value) {\n\t\tthis._checkIsNotReadOnly(true);\n\t\tthis._setValue(in_value, true);\n\t}\n\n\t/**\n\t * See {@link StringProperty.setValues}\n\t * @param {string} in_values - The new values\n\t * @param {Bool} 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_setValues(in_values, in_initial) {\n\t\tthrow new Error(MSG.NO_VALUE_PROPERTY_SETVALUES);\n\t}\n\n\t/**\n\t * @param {string} in_values - The new values\n\t * @throws always - Cannot use .setValues on a StringProperty. Use .setValue() instead.\n\t */\n\tsetValues(in_values) {\n\t\tStringProperty.prototype._setValues.call(this, in_values, false);\n\t}\n\n\t/**\n\t * @throws always - cannot call .getValues on a string. Use .getValue() instead\n\t */\n\tgetValues() {\n\t\tthrow new Error(MSG.NO_VALUE_PROPERTY_GETVALUES);\n\t}\n\n\t/**\n\t * Internal function to update the value of a property\n\t *\n\t * @param {string} 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 * @returns {boolean} true if the value was actually changed\n\t */\n\t_setValue(in_value, in_reportToView) {\n\t\tvar oldValue = this._dataArrayRef;\n\t\tvar castedValue = String(in_value);\n\t\tvar changed = castedValue !== oldValue;\n\t\tif (changed) {\n\t\t\tvar stringLength = this._dataArrayRef.length;\n\t\t\tif (stringLength > 0) {\n\t\t\t\tthis._dataArrayRemoveRange(0, stringLength);\n\t\t\t}\n\t\t\tthis._dataArrayInsertRange(0, castedValue);\n\n\t\t\tthis._dirty = PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE;\n\n\t\t\t// The assignment in the line above already set this property to\n\t\t\t// dirty, so we only update the parent (instead of calling\n\t\t\t// setDirty on this property)\n\t\t\tif (this._parent) {\n\t\t\t\tthis._parent._setDirty(in_reportToView, this);\n\t\t\t} else if (in_reportToView === true || in_reportToView === undefined) {\n\t\t\t\tthis._reportDirtinessToView();\n\t\t\t}\n\t\t}\n\t\treturn changed;\n\t}\n\n\t/**\n\t * Sets the pending and dirty changesets\n\t *\n\t * @param {property-properties.SerializedChangeSet|undefined|null} in_pending - The pending changeset. If null is\n\t * passed, no change will be applied. undefined indicates that the changes should be reset\n\t * @param {property-properties.SerializedChangeSet|undefined|null} in_dirty - The dirty changeset. If null is\n\t * passed, no change will be applied. undefined indicates that the changes should be reset\n\t */\n\t_setChanges(in_pending, in_dirty) {\n\t\tif (\n\t\t\tthis._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n\t\t\tthis._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE ||\n\t\t\tthis._dirty === DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE\n\t\t) {\n\t\t\tlet newFlags = this._dirty.flags;\n\t\t\tif (in_pending === undefined) {\n\t\t\t\tnewFlags &= 0xffffffff ^ BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE;\n\t\t\t}\n\t\t\tif (in_dirty === undefined) {\n\t\t\t\tnewFlags &= 0xffffffff ^ BaseProperty.MODIFIED_STATE_FLAGS.DIRTY;\n\t\t\t}\n\t\t\tthis._dirty = STRING_PROPERTY_SET_PROPERTY_VALUE_STATE_FLAGS[newFlags];\n\t\t} else {\n\t\t\tArrayProperty.prototype._setChanges.call(this, in_pending, in_dirty);\n\t\t}\n\t}\n\n\t/**\n\t * Sets the dirty flags for this property\n\t * @param {Number} in_flags - The dirty flags\n\t */\n\t_setDirtyFlags(in_flags) {\n\t\tif (\n\t\t\tthis._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n\t\t\tthis._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE ||\n\t\t\tthis._dirty === DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE\n\t\t) {\n\t\t\tthis._dirty = STRING_PROPERTY_SET_PROPERTY_VALUE_STATE_FLAGS[in_flags];\n\t\t\treturn;\n\t\t}\n\n\t\tArrayProperty.prototype._setDirtyFlags.call(this, in_flags);\n\t}\n\n\t/**\n\t * Gets the dirty flags for this property\n\t * @returns {Number} The dirty flags\n\t */\n\t_getDirtyFlags() {\n\t\tif (\n\t\t\tthis._dirty === PENDING_AND_DIRTY_SET_TO_PROPERTY_VALUE ||\n\t\t\tthis._dirty === NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE ||\n\t\t\tthis._dirty === DIRTY_AND_NO_PENDING_SET_TO_PROPERTY_VALUE\n\t\t) {\n\t\t\treturn this._dirty.flags;\n\t\t}\n\n\t\treturn ArrayProperty.prototype._getDirtyFlags.call(this);\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\t_applyChangeset(in_changeSet, in_reportToView) {\n\t\t// It is unfortunate, but because StringProperty derives from ArrayProperty, it can happen\n\t\t// that we receive here a ChangeSet that is formatted for an Array. We must be able to\n\t\t// distinguish it from a reversible changeset and from a simple changeset...\n\t\t// TODO: We need a formal way to know what kind of content we are to expect in a ChangeSet,\n\t\t// we should never have to guess that.\n\t\tif (typeof in_changeSet === \"string\") {\n\t\t\t// Let's consider it's a simple changeset.\n\t\t\tthis._setValue(in_changeSet, in_reportToView);\n\t\t} else if (in_changeSet.value !== undefined) {\n\t\t\t// Let's consider it's a reversible changeset.\n\t\t\tthis._setValue(in_changeSet.value, in_reportToView);\n\t\t} else {\n\t\t\t// Let's consider it's an ArrayProperty-like changeset\n\t\t\tArrayProperty.prototype._applyChangeset.call(this, in_changeSet, in_reportToView);\n\t\t}\n\t}\n\n\t/**\n\t * Calls back the given function with a human-readable string\n\t * representation of the property.\n\t * @param {string} indent - Leading spaces to create the tree representation\n\t * @param {string} externalId - Name of the current property at the upper level. Used for arrays.\n\t * @param {function} printFct - Function to call for printing each property\n\t */\n\t_prettyPrint(indent, externalId, printFct) {\n\t\tprintFct(\n\t\t\tindent +\n\t\t\t\texternalId +\n\t\t\t\tthis.getId() +\n\t\t\t\t\" (\" +\n\t\t\t\tthis.getTypeid() +\n\t\t\t\t'): \"' +\n\t\t\t\tthis.value +\n\t\t\t\t'\"',\n\t\t);\n\t}\n\n\t/**\n\t * Return a JSON representation of the property.\n\t * @returns {object} A JSON representation of the property.\n\t * @private\n\t */\n\t_toJson() {\n\t\treturn {\n\t\t\tid: this.getId(),\n\t\t\tcontext: this._context,\n\t\t\ttypeid: this.getTypeid(),\n\t\t\tisConstant: this._isConstant,\n\t\t\tvalue: this.value,\n\t\t};\n\t}\n\n\t/**\n\t * Sets the value of a character at a single index.\n\t * For example, if you have a string of value 'AAAA' and do .set(1, 'a') => 'AaAA'\n\t * @param {number} in_index - The index you wish to set\n\t * @param {string} in_character - The character you wish to set\n\t * @throws If length of in_character is longer than one character\n\t */\n\tset(in_index, in_character) {\n\t\tConsoleUtils.assert(_.isNumber(in_index), MSG.STRING_SET_NEEDS_INDEX + in_index);\n\n\t\tif (in_character.length !== 1) {\n\t\t\tthrow new Error(MSG.STRING_SET_ONE_CHAR);\n\t\t}\n\n\t\tthis.setRange(in_index, in_character);\n\t}\n\n\t/**\n\t * sets values in a string starting at an index.\n\t * For example, if you have a string of Value 'AAAA' and do .setRange(1, 'aa') => AaaA\n\t * It will set as many letters as are in in_string.\n\t * @param {number} in_index - The index at which you wish to start setting\n\t * @param {string} in_string - The string you wish to set\n\t * @throws If in_index + length of in_string is longer than the original string\n\t */\n\tsetRange(in_index, in_string) {\n\t\tArrayProperty.prototype.setRange.call(this, in_index, in_string);\n\t}\n\n\t/**\n\t * get a letter at a given index\n\t * @param {number} in_index - The index\n\t * @returns {string} the single letter found at in_index\n\t */\n\tget(in_index) {\n\t\treturn ArrayProperty.prototype.get.call(this, in_index);\n\t}\n\n\t/**\n\t * inserts a string starting at a position and shifts the rest of the String to the right.\n\t * Will not overwrite existing values.\n\t * For StringProperty, insert and insertRange work the same, except that .insert\n\t * checks that in_value is a string and .insertRange will accept an array of strings.\n\t * @param {number} in_position - Target index\n\t * @param {string | array<string>} in_value - value to be inserted\n\t * @throws If in_position is smaller than zero, larger than the length of the string or not a number\n\t */\n\tinsertRange(in_position, in_value) {\n\t\tif (_.isArray(in_value)) {\n\t\t\tin_value = in_value.join(\"\");\n\t\t}\n\t\tthis._insertRange(in_position, in_value);\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 = \"\";\n\t}\n\n\t/**\n\t * Returns the length of the data array\n\t * @returns {Number} The length\n\t */\n\t_dataArrayGetLength() {\n\t\treturn this._dataArrayRef.length;\n\t}\n\n\t/**\n\t * Returns the data array's internal buffer\n\t * @returns {Array} The buffer\n\t */\n\t_dataArrayGetBuffer() {\n\t\treturn this._dataArrayRef;\n\t}\n\n\t/**\n\t * Returns an entry from the data array\n\t * @param {Number} in_i - Position in the array\n\t *\n\t * @returns {*} The value at index in_i\n\t */\n\t_dataArrayGetValue(in_i) {\n\t\tin_i = in_i === undefined ? 0 : in_i;\n\t\tif (in_i >= this._size || in_i < 0) {\n\t\t\tthrow new Error(\"Trying to access out of bounds!\");\n\t\t}\n\n\t\treturn this._dataArrayRef[in_i];\n\t}\n\n\t/**\n\t * Set the array to the given new array\n\t * @param {String} in_newString - The new contents of the array\n\t */\n\t_dataArrayDeserialize(in_newString) {\n\t\tthis._dataArrayRef = in_newString;\n\t}\n\n\t/**\n\t * Inserts a range into the data array\n\t * @param {Number} in_position - Position at which the insert should be done\n\t * @param {String} in_range - The array to insert\n\t */\n\t_dataArrayInsertRange(in_position, in_range) {\n\t\tthis._dataArrayRef =\n\t\t\tthis._dataArrayRef.substr(0, in_position) +\n\t\t\tin_range +\n\t\t\tthis._dataArrayRef.substr(in_position);\n\t}\n\n\t/**\n\t * Removes a range from the data array\n\t * @param {Number} in_position - Position at which to start the removal\n\t * @param {Number} in_length - The number of entries to remove\n\t */\n\t_dataArrayRemoveRange(in_position, in_length) {\n\t\tif (in_position + in_length < this._dataArrayRef.length + 1) {\n\t\t\tthis._dataArrayRef =\n\t\t\t\tthis._dataArrayRef.substr(0, in_position) +\n\t\t\t\tthis._dataArrayRef.substr(in_position + in_length);\n\t\t} else {\n\t\t\tthrow Error(\"DataArray removeRange in_offset + in_deleteCount is out of bounds.\");\n\t\t}\n\t}\n\n\t/**\n\t * Overwrites a range in the data array\n\t * @param {Number} in_position - Position at which to start the removal\n\t * @param {String} in_values - The string with which the range is overwritten\n\t */\n\t_dataArraySetRange(in_position, in_values) {\n\t\tthis._dataArrayRef =\n\t\t\tthis._dataArrayRef.substr(0, in_position) +\n\t\t\tin_values +\n\t\t\tthis._dataArrayRef.substr(in_position + in_values.length);\n\t}\n\n\tget value() {\n\t\treturn this.getValue();\n\t}\n\n\tset value(val) {\n\t\tthis.setValue.call(this, val);\n\t}\n\n\t/** @inheritdoc */\n\t_traverse(in_callback, in_pathFromTraversalStart) {\n\t\treturn undefined;\n\t}\n\n\t/** @inheritdoc */\n\t_traverseStaticProperties(in_callback, in_pathFromTraversalStart) {\n\t\treturn undefined;\n\t}\n}\n\nStringProperty.prototype._typeid = \"String\";\nStringProperty.prototype._context = \"single\";\nStringProperty.prototype._noDirtyInBase = true;\n"]}
@@ -5,8 +5,8 @@
5
5
  /**
6
6
  * @fileoverview Definition of the Uint32Property class
7
7
  */
8
- const { ValueProperty } = require('./valueProperty');
9
- const { _castFunctors } = require('./primitiveTypeCasts');
8
+ const { ValueProperty } = require("./valueProperty");
9
+ const { _castFunctors } = require("./primitiveTypeCasts");
10
10
  /**
11
11
  * A primitive property for an unsigned 8 bit integer value.
12
12
  */
@@ -25,7 +25,7 @@ export class Uint8Property extends ValueProperty {
25
25
  this._data = 0;
26
26
  }
27
27
  }
28
- Uint8Property.prototype._typeid = 'Uint8';
28
+ Uint8Property.prototype._typeid = "Uint8";
29
29
  Uint8Property.prototype._castFunctor = _castFunctors.Uint8;
30
30
  /**
31
31
  * A primitive property for an unsigned 16 bit integer value.
@@ -45,7 +45,7 @@ export class Uint16Property extends ValueProperty {
45
45
  this._data = 0;
46
46
  }
47
47
  }
48
- Uint16Property.prototype._typeid = 'Uint16';
48
+ Uint16Property.prototype._typeid = "Uint16";
49
49
  Uint16Property.prototype._castFunctor = _castFunctors.Uint16;
50
50
  /**
51
51
  * A primitive property for an unsigned 32 bit integer value.
@@ -65,6 +65,6 @@ export class Uint32Property extends ValueProperty {
65
65
  this._data = 0;
66
66
  }
67
67
  }
68
- Uint32Property.prototype._typeid = 'Uint32';
68
+ Uint32Property.prototype._typeid = "Uint32";
69
69
  Uint32Property.prototype._castFunctor = _castFunctors.Uint32;
70
70
  //# sourceMappingURL=uintProperties.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"uintProperties.js","sourceRoot":"","sources":["../../src/properties/uintProperties.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AAEH,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACrD,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAE1D;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,aAAa;IAC5C;;;;;;;OAOG;IACH,YAAY,SAAS;QACjB,KAAK,CAAC,SAAS,CAAC,CAAC;QACjB,wCAAwC;QACxC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IACnB,CAAC;CACJ;AACD,aAAa,CAAC,SAAS,CAAC,OAAO,GAAG,OAAO,CAAC;AAC1C,aAAa,CAAC,SAAS,CAAC,YAAY,GAAG,aAAa,CAAC,KAAK,CAAC;AAE3D;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,aAAa;IAC7C;;;;;;;OAOG;IACH,YAAY,SAAS;QACjB,KAAK,CAAC,SAAS,CAAC,CAAC;QACjB,wCAAwC;QACxC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IACnB,CAAC;CACJ;AACD,cAAc,CAAC,SAAS,CAAC,OAAO,GAAG,QAAQ,CAAC;AAC5C,cAAc,CAAC,SAAS,CAAC,YAAY,GAAG,aAAa,CAAC,MAAM,CAAC;AAE7D;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,aAAa;IAC7C;;;;;;;OAOG;IACH,YAAY,SAAS;QACjB,KAAK,CAAC,SAAS,CAAC,CAAC;QACjB,wCAAwC;QACxC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IACnB,CAAC;CACJ;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 * @fileoverview Definition of the Uint32Property class\n */\n\nconst { ValueProperty } = require('./valueProperty');\nconst { _castFunctors } = require('./primitiveTypeCasts');\n\n/**\n * A primitive property for an unsigned 8 bit integer value.\n */\nexport class Uint8Property extends ValueProperty {\n /**\n * @param {Object=} in_params - the parameters\n * @constructor\n * @private\n * @extends property-properties.ValueProperty\n * @alias property-properties.Uint8Property\n * @category Value Properties\n */\n constructor(in_params) {\n super(in_params);\n // default for this property type is '0'\n this._data = 0;\n }\n}\nUint8Property.prototype._typeid = 'Uint8';\nUint8Property.prototype._castFunctor = _castFunctors.Uint8;\n\n/**\n * A primitive property for an unsigned 16 bit integer value.\n */\nexport class Uint16Property extends ValueProperty {\n /**\n * @param {Object=} in_params - the parameters\n * @constructor\n * @private\n * @extends property-properties.ValueProperty\n * @alias property-properties.Uint16Property\n * @category Value Properties\n */\n constructor(in_params) {\n super(in_params);\n // default for this property type is '0'\n this._data = 0;\n }\n}\nUint16Property.prototype._typeid = 'Uint16';\nUint16Property.prototype._castFunctor = _castFunctors.Uint16;\n\n/**\n * A primitive property for an unsigned 32 bit integer value.\n */\nexport class Uint32Property extends ValueProperty {\n /**\n * @param {Object=} in_params - the parameters\n * @constructor\n * @protected\n * @extends property-properties.ValueProperty\n * @alias property-properties.Uint32Property\n * @category Value Properties\n */\n constructor(in_params) {\n super(in_params);\n // default for this property type is '0'\n this._data = 0;\n }\n}\nUint32Property.prototype._typeid = 'Uint32';\nUint32Property.prototype._castFunctor = _castFunctors.Uint32;\n"]}
1
+ {"version":3,"file":"uintProperties.js","sourceRoot":"","sources":["../../src/properties/uintProperties.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AAEH,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACrD,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAE1D;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,aAAa;IAC/C;;;;;;;OAOG;IACH,YAAY,SAAS;QACpB,KAAK,CAAC,SAAS,CAAC,CAAC;QACjB,wCAAwC;QACxC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IAChB,CAAC;CACD;AACD,aAAa,CAAC,SAAS,CAAC,OAAO,GAAG,OAAO,CAAC;AAC1C,aAAa,CAAC,SAAS,CAAC,YAAY,GAAG,aAAa,CAAC,KAAK,CAAC;AAE3D;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,aAAa;IAChD;;;;;;;OAOG;IACH,YAAY,SAAS;QACpB,KAAK,CAAC,SAAS,CAAC,CAAC;QACjB,wCAAwC;QACxC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IAChB,CAAC;CACD;AACD,cAAc,CAAC,SAAS,CAAC,OAAO,GAAG,QAAQ,CAAC;AAC5C,cAAc,CAAC,SAAS,CAAC,YAAY,GAAG,aAAa,CAAC,MAAM,CAAC;AAE7D;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,aAAa;IAChD;;;;;;;OAOG;IACH,YAAY,SAAS;QACpB,KAAK,CAAC,SAAS,CAAC,CAAC;QACjB,wCAAwC;QACxC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IAChB,CAAC;CACD;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 * @fileoverview Definition of the Uint32Property class\n */\n\nconst { ValueProperty } = require(\"./valueProperty\");\nconst { _castFunctors } = require(\"./primitiveTypeCasts\");\n\n/**\n * A primitive property for an unsigned 8 bit integer value.\n */\nexport class Uint8Property extends ValueProperty {\n\t/**\n\t * @param {Object=} in_params - the parameters\n\t * @constructor\n\t * @private\n\t * @extends property-properties.ValueProperty\n\t * @alias property-properties.Uint8Property\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}\nUint8Property.prototype._typeid = \"Uint8\";\nUint8Property.prototype._castFunctor = _castFunctors.Uint8;\n\n/**\n * A primitive property for an unsigned 16 bit integer value.\n */\nexport class Uint16Property extends ValueProperty {\n\t/**\n\t * @param {Object=} in_params - the parameters\n\t * @constructor\n\t * @private\n\t * @extends property-properties.ValueProperty\n\t * @alias property-properties.Uint16Property\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}\nUint16Property.prototype._typeid = \"Uint16\";\nUint16Property.prototype._castFunctor = _castFunctors.Uint16;\n\n/**\n * A primitive property for an unsigned 32 bit integer value.\n */\nexport class Uint32Property 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.Uint32Property\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}\nUint32Property.prototype._typeid = \"Uint32\";\nUint32Property.prototype._castFunctor = _castFunctors.Uint32;\n"]}
@@ -36,7 +36,7 @@ export class Uint8ArrayProperty extends ValueArrayProperty {
36
36
  /**
37
37
  * An ArrayProperty which stores Int8 values
38
38
  *
39
- */
39
+ */
40
40
  export class Int8ArrayProperty extends ValueArrayProperty {
41
41
  }
42
42
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"valueArrayProperty.d.ts","sourceRoot":"","sources":["../../src/properties/valueArrayProperty.js"],"names":[],"mappings":"AAsBA;;GAEG;AACH;IACI;;;;;;OAMG;IACH,wBAEC;IAED;;;;OAIG;IACH,uBAHW,MAAM,OAKhB;IAiEL,sBAAyC;CADxC;AAGD;;GAEG;AACH;CAqBC;AAGD;;GAEG;AACH;CAqBC;AAGD;;GAEG;AACH;CAqBC;AAGD;;;EAGE;AACF;CAqBC;AAGD;;GAEG;AACH;CAqBC;AAGD;;GAEG;AACH;CAqBC;AAGD;;GAEG;AACH;CAoBC;AAGD;;GAEG;AACH;CAqBC;AAGD;;GAEG;AACH;CA+EC;AACD;;GAEG;AACH;CAuEC;AAGD;;GAEG;AACH;CAuEC;AAGD;;GAEG;AACH;CAwBC;AAGD;;GAEG;AACH;CAwBC"}
1
+ {"version":3,"file":"valueArrayProperty.d.ts","sourceRoot":"","sources":["../../src/properties/valueArrayProperty.js"],"names":[],"mappings":"AAsBA;;GAEG;AACH;IACC;;;;;;OAMG;IACH,wBAEC;IAED;;;;OAIG;IACH,uBAHW,MAAM,OAKhB;IAiEF,sBAAyC;CADxC;AAGD;;GAEG;AACH;CAqBC;AAGD;;GAEG;AACH;CAqBC;AAGD;;GAEG;AACH;CAqBC;AAGD;;;GAGG;AACH;CAqBC;AAGD;;GAEG;AACH;CAqBC;AAGD;;GAEG;AACH;CAqBC;AAGD;;GAEG;AACH;CAoBC;AAGD;;GAEG;AACH;CAqBC;AAGD;;GAEG;AACH;CAgFC;AACD;;GAEG;AACH;CAuEC;AAGD;;GAEG;AACH;CAuEC;AAGD;;GAEG;AACH;CAwBC;AAGD;;GAEG;AACH;CAwBC"}