@fluid-experimental/property-properties 0.54.2 → 0.56.0-49831
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/properties/arrayProperty.d.ts.map +1 -1
- package/dist/properties/arrayProperty.js +4 -4
- package/dist/properties/arrayProperty.js.map +1 -1
- package/dist/properties/baseProperty.d.ts +1 -1
- package/dist/properties/baseProperty.d.ts.map +1 -1
- package/dist/properties/baseProperty.js +13 -12
- package/dist/properties/baseProperty.js.map +1 -1
- package/dist/properties/boolProperty.d.ts.map +1 -1
- package/dist/properties/boolProperty.js +3 -2
- package/dist/properties/boolProperty.js.map +1 -1
- package/dist/properties/containerProperty.d.ts +1 -1
- package/dist/properties/containerProperty.d.ts.map +1 -1
- package/dist/properties/containerProperty.js +12 -3
- package/dist/properties/containerProperty.js.map +1 -1
- package/dist/properties/enumArrayProperty.js +2 -1
- package/dist/properties/enumArrayProperty.js.map +1 -1
- package/dist/properties/enumProperty.d.ts.map +1 -1
- package/dist/properties/enumProperty.js +2 -1
- package/dist/properties/enumProperty.js.map +1 -1
- package/dist/properties/floatProperties.d.ts.map +1 -1
- package/dist/properties/floatProperties.js +6 -4
- package/dist/properties/floatProperties.js.map +1 -1
- package/dist/properties/indexedCollectionBaseProperty.d.ts +2 -2
- package/dist/properties/indexedCollectionBaseProperty.d.ts.map +1 -1
- package/dist/properties/indexedCollectionBaseProperty.js +2 -2
- package/dist/properties/indexedCollectionBaseProperty.js.map +1 -1
- package/dist/properties/intProperties.d.ts.map +1 -1
- package/dist/properties/intProperties.js +15 -10
- package/dist/properties/intProperties.js.map +1 -1
- package/dist/properties/mapProperty.d.ts.map +1 -1
- package/dist/properties/mapProperty.js +2 -1
- package/dist/properties/mapProperty.js.map +1 -1
- package/dist/properties/namedNodeProperty.js +2 -1
- package/dist/properties/namedNodeProperty.js.map +1 -1
- package/dist/properties/namedProperty.js +2 -1
- package/dist/properties/namedProperty.js.map +1 -1
- package/dist/properties/nodeProperty.d.ts.map +1 -1
- package/dist/properties/nodeProperty.js +3 -1
- package/dist/properties/nodeProperty.js.map +1 -1
- package/dist/properties/referenceArrayProperty.js +2 -1
- package/dist/properties/referenceArrayProperty.js.map +1 -1
- package/dist/properties/referenceMapProperty.js +2 -1
- package/dist/properties/referenceMapProperty.js.map +1 -1
- package/dist/properties/referenceProperty.d.ts +1 -1
- package/dist/properties/referenceProperty.d.ts.map +1 -1
- package/dist/properties/referenceProperty.js +3 -2
- package/dist/properties/referenceProperty.js.map +1 -1
- package/dist/properties/setProperty.d.ts.map +1 -1
- package/dist/properties/setProperty.js +3 -2
- package/dist/properties/setProperty.js.map +1 -1
- package/dist/properties/stringProperty.d.ts.map +1 -1
- package/dist/properties/stringProperty.js +12 -3
- package/dist/properties/stringProperty.js.map +1 -1
- package/dist/properties/uintProperties.d.ts.map +1 -1
- package/dist/properties/uintProperties.js +9 -6
- package/dist/properties/uintProperties.js.map +1 -1
- package/dist/properties/valueArrayProperty.d.ts +1 -1
- package/dist/properties/valueArrayProperty.d.ts.map +1 -1
- package/dist/properties/valueArrayProperty.js +25 -13
- package/dist/properties/valueArrayProperty.js.map +1 -1
- package/dist/properties/valueMapProperty.d.ts.map +1 -1
- package/dist/properties/valueMapProperty.js +38 -26
- package/dist/properties/valueMapProperty.js.map +1 -1
- package/dist/propertyFactory.d.ts.map +1 -1
- package/dist/propertyFactory.js +442 -86
- package/dist/propertyFactory.js.map +1 -1
- package/dist/propertyTemplateWrapper.d.ts +0 -34
- package/dist/propertyTemplateWrapper.d.ts.map +1 -1
- package/dist/propertyTemplateWrapper.js +0 -108
- package/dist/propertyTemplateWrapper.js.map +1 -1
- package/dist/test/propertyFactory.spec.js +5 -2
- package/dist/test/propertyFactory.spec.js.map +1 -1
- package/dist/test/tsconfig.tsbuildinfo +11 -11
- package/lib/properties/arrayProperty.js +4 -4
- package/lib/properties/arrayProperty.js.map +1 -1
- package/lib/properties/baseProperty.js +13 -12
- package/lib/properties/baseProperty.js.map +1 -1
- package/lib/properties/boolProperty.js +3 -2
- package/lib/properties/boolProperty.js.map +1 -1
- package/lib/properties/containerProperty.js +12 -3
- package/lib/properties/containerProperty.js.map +1 -1
- package/lib/properties/enumArrayProperty.js +2 -1
- package/lib/properties/enumArrayProperty.js.map +1 -1
- package/lib/properties/enumProperty.js +2 -1
- package/lib/properties/enumProperty.js.map +1 -1
- package/lib/properties/floatProperties.js +6 -4
- package/lib/properties/floatProperties.js.map +1 -1
- package/lib/properties/indexedCollectionBaseProperty.js +2 -2
- package/lib/properties/indexedCollectionBaseProperty.js.map +1 -1
- package/lib/properties/intProperties.js +15 -10
- package/lib/properties/intProperties.js.map +1 -1
- package/lib/properties/mapProperty.js +2 -1
- package/lib/properties/mapProperty.js.map +1 -1
- package/lib/properties/namedNodeProperty.js +2 -1
- package/lib/properties/namedNodeProperty.js.map +1 -1
- package/lib/properties/namedProperty.js +2 -1
- package/lib/properties/namedProperty.js.map +1 -1
- package/lib/properties/nodeProperty.js +3 -1
- package/lib/properties/nodeProperty.js.map +1 -1
- package/lib/properties/referenceArrayProperty.js +2 -1
- package/lib/properties/referenceArrayProperty.js.map +1 -1
- package/lib/properties/referenceMapProperty.js +2 -1
- package/lib/properties/referenceMapProperty.js.map +1 -1
- package/lib/properties/referenceProperty.js +3 -2
- package/lib/properties/referenceProperty.js.map +1 -1
- package/lib/properties/setProperty.js +3 -2
- package/lib/properties/setProperty.js.map +1 -1
- package/lib/properties/stringProperty.js +12 -3
- package/lib/properties/stringProperty.js.map +1 -1
- package/lib/properties/uintProperties.js +9 -6
- package/lib/properties/uintProperties.js.map +1 -1
- package/lib/properties/valueArrayProperty.js +25 -13
- package/lib/properties/valueArrayProperty.js.map +1 -1
- package/lib/properties/valueMapProperty.js +38 -26
- package/lib/properties/valueMapProperty.js.map +1 -1
- package/lib/propertyFactory.js +442 -86
- package/lib/propertyFactory.js.map +1 -1
- package/lib/propertyTemplateWrapper.js +0 -108
- package/lib/propertyTemplateWrapper.js.map +1 -1
- package/package.json +5 -5
|
@@ -53,11 +53,9 @@ export class StringProperty extends ValueArrayProperty {
|
|
|
53
53
|
* @category Arrays
|
|
54
54
|
*/
|
|
55
55
|
constructor(in_params) {
|
|
56
|
-
super(
|
|
56
|
+
super(in_params);
|
|
57
57
|
}
|
|
58
58
|
;
|
|
59
|
-
get _context() { return 'single'; }
|
|
60
|
-
get _noDirtyInBase() { return true; }
|
|
61
59
|
/**
|
|
62
60
|
* Get the string value
|
|
63
61
|
* @return {string} the JavaScript string primitive value of this StringProperty
|
|
@@ -590,5 +588,16 @@ export class StringProperty extends ValueArrayProperty {
|
|
|
590
588
|
set value(val) {
|
|
591
589
|
this.setValue.call(this, val);
|
|
592
590
|
}
|
|
591
|
+
/** @inheritdoc */
|
|
592
|
+
_traverse(in_callback, in_pathFromTraversalStart) {
|
|
593
|
+
return undefined;
|
|
594
|
+
}
|
|
595
|
+
/** @inheritdoc */
|
|
596
|
+
_traverseStaticProperties(in_callback, in_pathFromTraversalStart) {
|
|
597
|
+
return undefined;
|
|
598
|
+
}
|
|
593
599
|
}
|
|
600
|
+
StringProperty.prototype._typeid = 'String';
|
|
601
|
+
StringProperty.prototype._context = 'single';
|
|
602
|
+
StringProperty.prototype._noDirtyInBase = true;
|
|
594
603
|
//# 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,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAC/D,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACrD,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC;AACzE,MAAM,EA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AAC,CAAC,EAAE,WAAW,CAAC,GAAG,SAAS;YACtE,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IAClE,CAAC;IAAA,CAAC;IAGF,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;CACJ","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 _ = require('lodash');\nconst { ValueArrayProperty } = require('./valueArrayProperty');\nconst { ArrayProperty } = require('./arrayProperty');\nconst { MSG } = require('@fluid-experimental/property-common').constants;\nconst { ChangeSet } = require('@fluid-experimental/property-changeset');\nconst { ConsoleUtils } = require('@fluid-experimental/property-common');\nconst { BaseProperty } = require('./baseProperty');\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: 'setAsLiteral',\n dirty: undefined,\n flags: MODIFIED_STATE_FLAGS.DIRTY\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, typeid: 'String' });\n };\n\n\n get _context() { return 'single'; }\n get _noDirtyInBase() { return true; }\n\n /**\n * Get the string value\n * @return {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 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 * @return {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 /**\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 * @return {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 * @return {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 /**\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 if (this._setValue(in_serializedObj, in_reportToView)) {\n return in_serializedObj;\n } else {\n return {};\n }\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 -\n * Only include dirty entries in the serialization\n * @param {boolean} in_includeRootTypeid -\n * Include the typeid of the root of the hierarchy - has no effect for ArrayProperty\n * @param {property-properties.BaseProperty.MODIFIED_STATE_FLAGS} [in_dirtinessType] -\n * The type of dirtiness to use when reporting dirty changes. By default this is\n * PENDING_CHANGE\n * @param {boolean} [in_includeReferencedRepositories=false] - If this is set to true, the serialize\n * function will descend into referenced repositories. WARNING: if there are loops in the references\n * this can result in an infinite loop\n *\n * @return {Object} The serialized representation of this property\n * @private\n */\n _serialize(in_dirtyOnly, in_includeRootTypeid,\n in_dirtinessType, in_includeReferencedRepositories) {\n if (in_dirtyOnly) {\n return ArrayProperty.prototype._serialize.call(this, in_dirtyOnly, in_includeRootTypeid, in_dirtinessType);\n } else {\n // returns just the current data\n return this._dataArrayRef;\n }\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 * @param {string} in_values the new values\n * @param {Bool} in_initial - Whether we are setting default/initial values\n * or if the function is called directly with the values to set.\n * @see {setValues}\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 /**\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\n * can be prevented via this flag.\n * @return {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\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\n * The pending changeset. If null is passed, no change will be\n * applied. undefined indicates that the changes should be reset\n * @param {property-properties.SerializedChangeSet|undefined|null} in_dirty\n * The dirty changeset. If null is passed, no change will be\n * 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 in_pending === null && in_dirty === undefined) {\n this._dirty = NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE;\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 = 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 * @return {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 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.\n * Used for arrays.\n * @param {function} printFct - Function to call for printing each property\n */\n _prettyPrint(indent, externalId, printFct) {\n printFct(indent + externalId + this.getId() + ' (' + this.getTypeid() + '): \"' + this.value + '\"');\n };\n\n /**\n * Return a JSON representation of the property.\n * @return {object} A JSON representation of the property.\n * @private\n */\n _toJson() {\n return {\n id: this.getId(),\n context: this._context,\n typeid: this.getTypeid(),\n isConstant: this._isConstant,\n value: this.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 * @return {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 * @return {Number} The length\n */\n _dataArrayGetLength() {\n return this._dataArrayRef.length;\n };\n\n /**\n * Returns the data array's internal buffer\n * @return {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 * @return {*} 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\n get value() {\n return this.getValue();\n }\n\n set value(val) {\n this.setValue.call(this, val);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"stringProperty.js","sourceRoot":"","sources":["../../src/properties/stringProperty.js"],"names":[],"mappings":"AAAA;;;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K,CAAC,oEAAoE,CAAC,CAAC;SACrF;IACL,CAAC;IAAA,CAAC;IAEF;;;;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;IAAA,CAAC;IAGF,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 _ = require('lodash');\nconst { ValueArrayProperty } = require('./valueArrayProperty');\nconst { ArrayProperty } = require('./arrayProperty');\nconst { MSG } = require('@fluid-experimental/property-common').constants;\nconst { ChangeSet } = require('@fluid-experimental/property-changeset');\nconst { ConsoleUtils } = require('@fluid-experimental/property-common');\nconst { BaseProperty } = require('./baseProperty');\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: 'setAsLiteral',\n dirty: undefined,\n flags: MODIFIED_STATE_FLAGS.DIRTY\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 * @return {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 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 * @return {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 /**\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 * @return {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 * @return {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 /**\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 if (this._setValue(in_serializedObj, in_reportToView)) {\n return in_serializedObj;\n } else {\n return {};\n }\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 -\n * Only include dirty entries in the serialization\n * @param {boolean} in_includeRootTypeid -\n * Include the typeid of the root of the hierarchy - has no effect for ArrayProperty\n * @param {property-properties.BaseProperty.MODIFIED_STATE_FLAGS} [in_dirtinessType] -\n * The type of dirtiness to use when reporting dirty changes. By default this is\n * PENDING_CHANGE\n * @param {boolean} [in_includeReferencedRepositories=false] - If this is set to true, the serialize\n * function will descend into referenced repositories. WARNING: if there are loops in the references\n * this can result in an infinite loop\n *\n * @return {Object} The serialized representation of this property\n * @private\n */\n _serialize(in_dirtyOnly, in_includeRootTypeid,\n in_dirtinessType, in_includeReferencedRepositories) {\n if (in_dirtyOnly) {\n return ArrayProperty.prototype._serialize.call(this, in_dirtyOnly, in_includeRootTypeid, in_dirtinessType);\n } else {\n // returns just the current data\n return this._dataArrayRef;\n }\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 * @param {string} in_values the new values\n * @param {Bool} in_initial - Whether we are setting default/initial values\n * or if the function is called directly with the values to set.\n * @see {setValues}\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 /**\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\n * can be prevented via this flag.\n * @return {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\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\n * The pending changeset. If null is passed, no change will be\n * applied. undefined indicates that the changes should be reset\n * @param {property-properties.SerializedChangeSet|undefined|null} in_dirty\n * The dirty changeset. If null is passed, no change will be\n * 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 in_pending === null && in_dirty === undefined) {\n this._dirty = NO_DIRTY_AND_PENDING_SET_TO_PROPERTY_VALUE;\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 = 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 * @return {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 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.\n * Used for arrays.\n * @param {function} printFct - Function to call for printing each property\n */\n _prettyPrint(indent, externalId, printFct) {\n printFct(indent + externalId + this.getId() + ' (' + this.getTypeid() + '): \"' + this.value + '\"');\n };\n\n /**\n * Return a JSON representation of the property.\n * @return {object} A JSON representation of the property.\n * @private\n */\n _toJson() {\n return {\n id: this.getId(),\n context: this._context,\n typeid: this.getTypeid(),\n isConstant: this._isConstant,\n value: this.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 * @return {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 * @return {Number} The length\n */\n _dataArrayGetLength() {\n return this._dataArrayRef.length;\n };\n\n /**\n * Returns the data array's internal buffer\n * @return {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 * @return {*} 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\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"]}
|
|
@@ -20,13 +20,14 @@ export class Uint8Property extends ValueProperty {
|
|
|
20
20
|
* @category Value Properties
|
|
21
21
|
*/
|
|
22
22
|
constructor(in_params) {
|
|
23
|
-
super(
|
|
24
|
-
this._castFunctor = _castFunctors.Uint8;
|
|
23
|
+
super(in_params);
|
|
25
24
|
// default for this property type is '0'
|
|
26
25
|
this._data = 0;
|
|
27
26
|
}
|
|
28
27
|
;
|
|
29
28
|
}
|
|
29
|
+
Uint8Property.prototype._typeid = 'Uint8';
|
|
30
|
+
Uint8Property.prototype._castFunctor = _castFunctors.Uint8;
|
|
30
31
|
/**
|
|
31
32
|
* A primitive property for an unsigned 16 bit integer value.
|
|
32
33
|
*/
|
|
@@ -40,13 +41,14 @@ export class Uint16Property extends ValueProperty {
|
|
|
40
41
|
* @category Value Properties
|
|
41
42
|
*/
|
|
42
43
|
constructor(in_params) {
|
|
43
|
-
super(
|
|
44
|
-
this._castFunctor = _castFunctors.Uint16;
|
|
44
|
+
super(in_params);
|
|
45
45
|
// default for this property type is '0'
|
|
46
46
|
this._data = 0;
|
|
47
47
|
}
|
|
48
48
|
;
|
|
49
49
|
}
|
|
50
|
+
Uint16Property.prototype._typeid = 'Uint16';
|
|
51
|
+
Uint16Property.prototype._castFunctor = _castFunctors.Uint16;
|
|
50
52
|
/**
|
|
51
53
|
* A primitive property for an unsigned 32 bit integer value.
|
|
52
54
|
*/
|
|
@@ -60,11 +62,12 @@ export class Uint32Property extends ValueProperty {
|
|
|
60
62
|
* @category Value Properties
|
|
61
63
|
*/
|
|
62
64
|
constructor(in_params) {
|
|
63
|
-
super(
|
|
64
|
-
this._castFunctor = _castFunctors.Uint32;
|
|
65
|
+
super(in_params);
|
|
65
66
|
// default for this property type is '0'
|
|
66
67
|
this._data = 0;
|
|
67
68
|
}
|
|
68
69
|
;
|
|
69
70
|
}
|
|
71
|
+
Uint32Property.prototype._typeid = 'Uint32';
|
|
72
|
+
Uint32Property.prototype._castFunctor = _castFunctors.Uint32;
|
|
70
73
|
//# 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,
|
|
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;IAAA,CAAC;CACL;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;IAAA,CAAC;CACL;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;IAAA,CAAC;CACL;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"]}
|
|
@@ -25,7 +25,6 @@ export class ValueArrayProperty extends ArrayProperty {
|
|
|
25
25
|
*/
|
|
26
26
|
constructor(in_params) {
|
|
27
27
|
super(in_params, true);
|
|
28
|
-
this._isPrimitive = true;
|
|
29
28
|
}
|
|
30
29
|
;
|
|
31
30
|
/**
|
|
@@ -101,6 +100,7 @@ export class ValueArrayProperty extends ArrayProperty {
|
|
|
101
100
|
}
|
|
102
101
|
;
|
|
103
102
|
}
|
|
103
|
+
ValueArrayProperty.prototype._isPrimitive = true;
|
|
104
104
|
/**
|
|
105
105
|
* An ArrayProperty which stores Float32 values
|
|
106
106
|
*/
|
|
@@ -115,7 +115,7 @@ export class Float32ArrayProperty extends ValueArrayProperty {
|
|
|
115
115
|
* @category Arrays
|
|
116
116
|
*/
|
|
117
117
|
constructor(in_params) {
|
|
118
|
-
super(
|
|
118
|
+
super(in_params);
|
|
119
119
|
}
|
|
120
120
|
;
|
|
121
121
|
/**
|
|
@@ -127,6 +127,7 @@ export class Float32ArrayProperty extends ValueArrayProperty {
|
|
|
127
127
|
}
|
|
128
128
|
;
|
|
129
129
|
}
|
|
130
|
+
Float32ArrayProperty.prototype._typeid = 'Float32';
|
|
130
131
|
/**
|
|
131
132
|
* An ArrayProperty which stores Float64 values
|
|
132
133
|
*/
|
|
@@ -141,7 +142,7 @@ export class Float64ArrayProperty extends ValueArrayProperty {
|
|
|
141
142
|
* @category Arrays
|
|
142
143
|
*/
|
|
143
144
|
constructor(in_params) {
|
|
144
|
-
super(
|
|
145
|
+
super(in_params);
|
|
145
146
|
}
|
|
146
147
|
;
|
|
147
148
|
/**
|
|
@@ -153,6 +154,7 @@ export class Float64ArrayProperty extends ValueArrayProperty {
|
|
|
153
154
|
}
|
|
154
155
|
;
|
|
155
156
|
}
|
|
157
|
+
Float64ArrayProperty.prototype._typeid = 'Float64';
|
|
156
158
|
/**
|
|
157
159
|
* An ArrayProperty which stores Uint8 values
|
|
158
160
|
*/
|
|
@@ -167,7 +169,7 @@ export class Uint8ArrayProperty extends ValueArrayProperty {
|
|
|
167
169
|
* @category Arrays
|
|
168
170
|
*/
|
|
169
171
|
constructor(in_params) {
|
|
170
|
-
super(
|
|
172
|
+
super(in_params);
|
|
171
173
|
}
|
|
172
174
|
;
|
|
173
175
|
/**
|
|
@@ -179,6 +181,7 @@ export class Uint8ArrayProperty extends ValueArrayProperty {
|
|
|
179
181
|
}
|
|
180
182
|
;
|
|
181
183
|
}
|
|
184
|
+
Uint8ArrayProperty.prototype._typeid = 'Uint8';
|
|
182
185
|
/**
|
|
183
186
|
* An ArrayProperty which stores Int8 values
|
|
184
187
|
*
|
|
@@ -194,7 +197,7 @@ export class Int8ArrayProperty extends ValueArrayProperty {
|
|
|
194
197
|
* @category Arrays
|
|
195
198
|
*/
|
|
196
199
|
constructor(in_params) {
|
|
197
|
-
super(
|
|
200
|
+
super(in_params);
|
|
198
201
|
}
|
|
199
202
|
;
|
|
200
203
|
/**
|
|
@@ -206,6 +209,7 @@ export class Int8ArrayProperty extends ValueArrayProperty {
|
|
|
206
209
|
}
|
|
207
210
|
;
|
|
208
211
|
}
|
|
212
|
+
Int8ArrayProperty.prototype._typeid = 'Int8';
|
|
209
213
|
/**
|
|
210
214
|
* An ArrayProperty which stores Uint16 values
|
|
211
215
|
*/
|
|
@@ -220,7 +224,7 @@ export class Uint16ArrayProperty extends ValueArrayProperty {
|
|
|
220
224
|
* @category Arrays
|
|
221
225
|
*/
|
|
222
226
|
constructor(in_params) {
|
|
223
|
-
super(
|
|
227
|
+
super(in_params);
|
|
224
228
|
}
|
|
225
229
|
;
|
|
226
230
|
/**
|
|
@@ -232,6 +236,7 @@ export class Uint16ArrayProperty extends ValueArrayProperty {
|
|
|
232
236
|
}
|
|
233
237
|
;
|
|
234
238
|
}
|
|
239
|
+
Uint16ArrayProperty.prototype._typeid = 'Uint16';
|
|
235
240
|
/**
|
|
236
241
|
* An ArrayProperty which stores Int16 values
|
|
237
242
|
*/
|
|
@@ -246,7 +251,7 @@ export class Int16ArrayProperty extends ValueArrayProperty {
|
|
|
246
251
|
* @category Arrays
|
|
247
252
|
*/
|
|
248
253
|
constructor(in_params) {
|
|
249
|
-
super(
|
|
254
|
+
super(in_params);
|
|
250
255
|
}
|
|
251
256
|
;
|
|
252
257
|
/**
|
|
@@ -258,6 +263,7 @@ export class Int16ArrayProperty extends ValueArrayProperty {
|
|
|
258
263
|
}
|
|
259
264
|
;
|
|
260
265
|
}
|
|
266
|
+
Int16ArrayProperty.prototype._typeid = 'Int16';
|
|
261
267
|
/**
|
|
262
268
|
* An ArrayProperty which stores Uint32 values
|
|
263
269
|
*/
|
|
@@ -271,7 +277,7 @@ export class Uint32ArrayProperty extends ValueArrayProperty {
|
|
|
271
277
|
* @category Arrays
|
|
272
278
|
*/
|
|
273
279
|
constructor(in_params) {
|
|
274
|
-
super(
|
|
280
|
+
super(in_params);
|
|
275
281
|
}
|
|
276
282
|
;
|
|
277
283
|
/**
|
|
@@ -283,6 +289,7 @@ export class Uint32ArrayProperty extends ValueArrayProperty {
|
|
|
283
289
|
}
|
|
284
290
|
;
|
|
285
291
|
}
|
|
292
|
+
Uint32ArrayProperty.prototype._typeid = 'Uint32';
|
|
286
293
|
/**
|
|
287
294
|
* An ArrayProperty which stores Int32 values
|
|
288
295
|
*/
|
|
@@ -297,7 +304,7 @@ export class Int32ArrayProperty extends ValueArrayProperty {
|
|
|
297
304
|
* @category Arrays
|
|
298
305
|
*/
|
|
299
306
|
constructor(in_params) {
|
|
300
|
-
super(
|
|
307
|
+
super(in_params);
|
|
301
308
|
}
|
|
302
309
|
;
|
|
303
310
|
/**
|
|
@@ -309,6 +316,7 @@ export class Int32ArrayProperty extends ValueArrayProperty {
|
|
|
309
316
|
}
|
|
310
317
|
;
|
|
311
318
|
}
|
|
319
|
+
Int32ArrayProperty.prototype._typeid = 'Int32';
|
|
312
320
|
/**
|
|
313
321
|
* An ArrayProperty which stores Int64 values
|
|
314
322
|
*/
|
|
@@ -410,7 +418,7 @@ export class Int64ArrayProperty extends Integer64ArrayProperty {
|
|
|
410
418
|
* @category Arrays
|
|
411
419
|
*/
|
|
412
420
|
constructor(in_params) {
|
|
413
|
-
super(
|
|
421
|
+
super(in_params);
|
|
414
422
|
}
|
|
415
423
|
;
|
|
416
424
|
/**
|
|
@@ -472,6 +480,7 @@ export class Int64ArrayProperty extends Integer64ArrayProperty {
|
|
|
472
480
|
}
|
|
473
481
|
;
|
|
474
482
|
}
|
|
483
|
+
Int64ArrayProperty.prototype._typeid = 'Int64';
|
|
475
484
|
/**
|
|
476
485
|
* An ArrayProperty which stores Uint64 values
|
|
477
486
|
*/
|
|
@@ -486,7 +495,7 @@ export class Uint64ArrayProperty extends Integer64ArrayProperty {
|
|
|
486
495
|
* @category Arrays
|
|
487
496
|
*/
|
|
488
497
|
constructor(in_params) {
|
|
489
|
-
super(
|
|
498
|
+
super(in_params);
|
|
490
499
|
}
|
|
491
500
|
;
|
|
492
501
|
/**
|
|
@@ -548,6 +557,7 @@ export class Uint64ArrayProperty extends Integer64ArrayProperty {
|
|
|
548
557
|
}
|
|
549
558
|
;
|
|
550
559
|
}
|
|
560
|
+
Uint64ArrayProperty.prototype._typeid = 'Uint64';
|
|
551
561
|
/**
|
|
552
562
|
* An ArrayProperty which stores String values
|
|
553
563
|
*/
|
|
@@ -562,7 +572,7 @@ export class StringArrayProperty extends ValueArrayProperty {
|
|
|
562
572
|
* @category Arrays
|
|
563
573
|
*/
|
|
564
574
|
constructor(in_params) {
|
|
565
|
-
super(
|
|
575
|
+
super(in_params);
|
|
566
576
|
}
|
|
567
577
|
;
|
|
568
578
|
/**
|
|
@@ -577,6 +587,7 @@ export class StringArrayProperty extends ValueArrayProperty {
|
|
|
577
587
|
}
|
|
578
588
|
;
|
|
579
589
|
}
|
|
590
|
+
StringArrayProperty.prototype._typeid = 'String';
|
|
580
591
|
/**
|
|
581
592
|
* An ArrayProperty which stores Boolean values
|
|
582
593
|
*/
|
|
@@ -591,7 +602,7 @@ export class BoolArrayProperty extends ValueArrayProperty {
|
|
|
591
602
|
* @category Arrays
|
|
592
603
|
*/
|
|
593
604
|
constructor(in_params) {
|
|
594
|
-
super(
|
|
605
|
+
super(in_params, Array, true);
|
|
595
606
|
}
|
|
596
607
|
;
|
|
597
608
|
/**
|
|
@@ -606,4 +617,5 @@ export class BoolArrayProperty extends ValueArrayProperty {
|
|
|
606
617
|
}
|
|
607
618
|
;
|
|
608
619
|
}
|
|
620
|
+
BoolArrayProperty.prototype._typeid = 'Bool';
|
|
609
621
|
//# sourceMappingURL=valueArrayProperty.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valueArrayProperty.js","sourceRoot":"","sources":["../../src/properties/valueArrayProperty.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,2BAA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AAI,aAAa,CAAC,SAAS,CAAC,CAAC;QAClD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE;YAChC,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;SACrC;IACL,CAAC;IAAA,CAAC;CACL","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/* eslint-disable new-cap*/\n/**\n * @fileoverview Definition of the valuearray property class\n */\n\nconst _ = require('lodash');\nconst { MSG } = require('@fluid-experimental/property-common').constants;\nconst { _castFunctors } = require('./primitiveTypeCasts');\nconst {\n BaseDataArray,\n UniversalDataArray,\n BoolDataArray,\n Uint64,\n Int64\n} = require('@fluid-experimental/property-common');\nconst { ArrayProperty } = require('./arrayProperty');\nconst { Int64Property, Uint64Property } = require('../properties/intProperties');\n\n/**\n * An array property which stores primitive values\n */\nexport class ValueArrayProperty extends ArrayProperty {\n\n /**\n * @param {Object} in_params - Input parameters for property creation\n * @constructor\n * @protected\n * @extends property-properties.ArrayProperty\n * @alias property-properties.ValueArrayProperty\n */\n constructor(in_params) {\n super(in_params, true);\n };\n\n _isPrimitive = true;\n\n /**\n * returns the value at in_position for a primitive array\n * @param {number} in_position the array index\n * @return {*} the value\n */\n _getValue(in_position) {\n return this._dataArrayRef.getValue(in_position);\n };\n\n /**\n * returns the array of primitive values.\n * @return {Array<*>} the array of values.\n * For example: ['string1', 'string2']\n */\n getValues() {\n var result = [];\n var ids = this.getIds();\n for (var i = 0; i < ids.length; i++) {\n result.push(this.get(ids[i]));\n }\n return result;\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 return this.get(in_segment);\n };\n\n /**\n * Function to serialize special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on serialization. For supported types, we can just return the input here.\n *\n * @param {*} in_obj - The object to be serialized\n * @return {property-properties.SerializedChangeSet} the serialized object\n */\n _serializeValue(in_obj) {\n return in_obj;\n };\n\n /**\n * Function to serialize arrays of special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on serialization. For supported types, we can just return the input here.\n *\n * @param {Array} in_array - The array of special objects to be serialized\n * @return {Array<property-properties.SerializedChangeSet>} the serialized object\n */\n _serializeArray(in_array) {\n return in_array;\n };\n\n /**\n * Function to deserialize arrays of special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on deserialization. For supported types, we can just return the input here.\n *\n * @param {Array<property-properties.SerializedChangeSet>} in_serializedObj the serialized object\n * @return {Array} in_array - The array of special objects that were deserialized\n */\n _deserializeArray(in_serializedObj) {\n return in_serializedObj;\n };\n}\n\n/**\n * An ArrayProperty which stores Float32 values\n */\nexport class Float32ArrayProperty extends ValueArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.Float32ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super({ ...in_params, typeid: 'Float32' });\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 = new BaseDataArray(Float32Array, in_length);\n };\n}\n\n/**\n * An ArrayProperty which stores Float64 values\n */\nexport class Float64ArrayProperty extends ValueArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.Float64ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super({ ...in_params, typeid: 'Float64' });\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 = new BaseDataArray(Float64Array, in_length);\n };\n}\n\n/**\n * An ArrayProperty which stores Uint8 values\n */\nexport class Uint8ArrayProperty extends ValueArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.Uint8ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super({ ...in_params, typeid: 'Uint8' });\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 = new BaseDataArray(Uint8Array, in_length);\n };\n}\n\n/**\n * An ArrayProperty which stores Int8 values\n *\n*/\nexport class Int8ArrayProperty extends ValueArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.Int8ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super({ ...in_params, typeid: 'Int8' });\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 = new BaseDataArray(Int8Array, in_length);\n };\n\n}\n\n/**\n * An ArrayProperty which stores Uint16 values\n */\nexport class Uint16ArrayProperty extends ValueArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.Uint16ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super({ ...in_params, typeid: 'Uint16' });\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 = new BaseDataArray(Uint16Array, in_length);\n };\n}\n\n\n/**\n * An ArrayProperty which stores Int16 values\n */\nexport class Int16ArrayProperty extends ValueArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.Int16ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super({ ...in_params, typeid: 'Int16' });\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 = new BaseDataArray(Int16Array, in_length);\n };\n\n}\n\n/**\n * An ArrayProperty which stores Uint32 values\n */\nexport class Uint32ArrayProperty extends ValueArrayProperty {\n /** @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.Uint32ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super({ ...in_params, typeid: 'Uint32' });\n };\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 = new BaseDataArray(Uint32Array, in_length);\n };\n}\n\n\n/**\n * An ArrayProperty which stores Int32 values\n */\nexport class Int32ArrayProperty extends ValueArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.Int32ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super({ ...in_params, typeid: 'Int32' });\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 = new BaseDataArray(Int32Array, in_length);\n };\n}\n\n/**\n * An ArrayProperty which stores Int64 values\n */\nexport class Integer64ArrayProperty extends ValueArrayProperty {\n /** @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.Integer64ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\n };\n\n /**\n * Function to serialize special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on serialization. For supported types, we can just return the input here.\n *\n * @param {*} in_obj - The object to be serialized\n * @return {property-properties.SerializedChangeSet} the serialized object\n */\n _serializeValue(in_obj) {\n if (in_obj instanceof Int64 || in_obj instanceof Uint64) {\n return [in_obj.getValueLow(), in_obj.getValueHigh()];\n }\n return in_obj;\n };\n\n\n /**\n * Function to serialize arrays of special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on serialization. For supported types, we can just return the input here.\n *\n * @param {Array} in_array - The array of special objects to be serialized\n * @return {Array<property-properties.SerializedChangeSet>} the serialized object\n */\n _serializeArray(in_array) {\n var result = [];\n for (var i = 0; i < in_array.length; i++) {\n result.push(this._serializeValue(in_array[i]));\n }\n return result;\n };\n\n /**\n * Function to deserialize arrays of special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on deserialization. For supported types, we can just return the input here.\n *\n * @param {Array<property-properties.SerializedChangeSet>} in_serializedObj the serialized object\n * @return {Array} in_array - The array of special objects that were deserialized\n */\n _deserializeArray(in_serializedObj) {\n var result = [];\n for (var i = 0; i < in_serializedObj.length; i++) {\n result.push(this._deserializeValue(in_serializedObj[i]));\n }\n return result;\n };\n\n /**\n * @inheritdoc\n */\n _prettyPrint(indent, externalId, printFct) {\n\n printFct(indent + externalId + this.getId() + ' (Array of ' + this.getTypeid() + '): [');\n var childIndent = indent + ' ';\n var int64Prop;\n for (var i = 0; i < this._dataArrayGetLength(); i++) {\n // TODO: The 'toString()' function is defined on Integer64Property, so we need to create\n // such object to use it. It would be better to have it in Integer64.prototype.toString\n if (this._dataArrayGetValue(i) instanceof Int64) {\n int64Prop = new Int64Property({});\n } else {\n int64Prop = new Uint64Property({});\n }\n int64Prop.setValueLow(this._dataArrayGetValue(i).getValueLow());\n int64Prop.setValueHigh(this._dataArrayGetValue(i).getValueHigh());\n printFct(childIndent + i + ': ' + int64Prop);\n }\n printFct(indent + ']');\n };\n}\n/**\n * An ArrayProperty which stores Int64 values\n */\nexport class Int64ArrayProperty extends Integer64ArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.Integer64ArrayProperty\n * @alias property-properties.Int64ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super({ ...in_params, typeid: 'Int64' });\n };\n\n /**\n * Sets the array properties elements to the content of the given array\n * All changed elements must already exist. This will overwrite existing elements.\n * @param {number} in_offset target start index\n * @param {Array<*>|Array<property-properties.BaseProperty>} in_array contains the elements to be set\n * @throws if in_offset is not a number\n * @throws if in_offset is smaller than zero or higher than the length of the array\n */\n setRange(in_offset, in_array) {\n if (!_.isArray(in_array)) {\n throw new Error(MSG.IN_ARRAY_NOT_ARRAY + 'Int64ArrayProperty.setRange');\n }\n var out_array = in_array.map((element) => {\n return _castFunctors.Int64(element);\n });\n ArrayProperty.prototype.setRange.call(this, in_offset, out_array);\n };\n\n /**\n * Inserts the content of a given array into the array property\n * It will not overwrite the existing values but push them to the right instead.\n * E.g. [1, 2, 3] .insertRange(1, [9, 8]) => [1, 9, 8, 2, 3]\n * @param {number} in_offset target index\n * @param {Array<*>} in_array the array to be inserted\n * @throws if in_offset is smaller than zero, larger than the length of the array or not a number.\n * @throws if trying to insert a property that already has a parent.\n * @throws if tyring to modify a referenced property.\n */\n insertRange(in_offset, in_array) {\n var out_array = in_array.map((element) => {\n return _castFunctors.Int64(element);\n });\n ArrayProperty.prototype.insertRange.call(this, in_offset, out_array);\n };\n\n /**\n * Specialized function to deserialize Int64 primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on deserialization. For supported types, we can just return the input here.\n *\n * @param {property-properties.SerializedChangeSet} in_serializedObj - The object to be deserialized\n * @return {Int64} the deserialized value\n */\n _deserializeValue(in_serializedObj) {\n return new Int64(in_serializedObj[0], in_serializedObj[1]);\n };\n\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 = new UniversalDataArray(in_length);\n for (var i = 0; i < in_length; i++) {\n this._dataArraySetValue(i, new Int64());\n }\n };\n\n}\n\n/**\n * An ArrayProperty which stores Uint64 values\n */\nexport class Uint64ArrayProperty extends Integer64ArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.Integer64ArrayProperty\n * @alias property-properties.Uint64ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super({ ...in_params, typeid: 'Uint64' });\n };\n\n /**\n * Specialized function to deserialize Uint64 primitive types.\n * Some primitive types (e.g. Uint64, which is not natively supported by javascript) require\n * special treatment on deserialization. For supported types, we can just return the input here.\n *\n * @param {property-properties.SerializedChangeSet} in_serializedObj - The object to be deserialized\n * @return {Uint64} the deserialized value\n */\n _deserializeValue(in_serializedObj) {\n return new Uint64(in_serializedObj[0], in_serializedObj[1]);\n };\n\n /**\n * Sets the array properties elements to the content of the given array\n * All changed elements must already exist. This will overwrite existing elements.\n * @param {number} in_offset target start index\n * @param {Array<*>|Array<property-properties.BaseProperty>} in_array contains the elements to be set\n * @throws if in_offset is not a number\n * @throws if in_offset is smaller than zero or higher than the length of the array\n */\n setRange(in_offset, in_array) {\n if (!_.isArray(in_array)) {\n throw new Error(MSG.IN_ARRAY_NOT_ARRAY + 'Uint64ArrayProperty.setRange');\n }\n var out_array = in_array.map((element) => {\n return _castFunctors.Uint64(element);\n });\n ArrayProperty.prototype.setRange.call(this, in_offset, out_array);\n };\n\n /**\n * Inserts the content of a given array into the array property\n * It will not overwrite the existing values but push them to the right instead.\n * E.g. [1, 2, 3] .insertRange(1, [9, 8]) => [1, 9, 8, 2, 3]\n * @param {number} in_offset target index\n * @param {Array<*>} in_array the array to be inserted\n * @throws if in_offset is smaller than zero, larger than the length of the array or not a number.\n * @throws if trying to insert a property that already has a parent.\n * @throws if tyring to modify a referenced property.\n */\n insertRange(in_offset, in_array) {\n var out_array = in_array.map((element) => {\n return _castFunctors.Uint64(element);\n });\n ArrayProperty.prototype.insertRange.call(this, in_offset, out_array);\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 = new UniversalDataArray(in_length);\n for (var i = 0; i < in_length; i++) {\n this._dataArraySetValue(i, new Uint64());\n }\n };\n\n}\n\n/**\n * An ArrayProperty which stores String values\n */\nexport class StringArrayProperty extends ValueArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.StringArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super({ ...in_params, typeid: 'String' });\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 = new UniversalDataArray(in_length);\n for (var i = 0; i < in_length; i++) {\n this._dataArraySetValue(i, '');\n }\n };\n\n}\n\n/**\n * An ArrayProperty which stores Boolean values\n */\nexport class BoolArrayProperty extends ValueArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.BoolArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super({ ...in_params, typeid: 'Bool' }, Array, true);\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 = new BoolDataArray(in_length);\n for (var i = 0; i < in_length; i++) {\n this._dataArraySetValue(i, false);\n }\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"valueArrayProperty.js","sourceRoot":"","sources":["../../src/properties/valueArrayProperty.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,2BAA2B;AAC3B;;GAEG;AAEH,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC;AACzE,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;A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IAAI,CAAC,CAAC;IAClC,CAAC;IAAA,CAAC;IAEF;;;OAGG;IACH,gBAAgB,CAAC,SAAS;QACtB,IAAI,CAAC,aAAa,GAAG,IAAI,aAAa,CAAC,SAAS,CAAC,CAAC;QAClD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE;YAChC,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;SACrC;IACL,CAAC;IAAA,CAAC;CACL;AACD,iBAAiB,CAAC,SAAS,CAAC,OAAO,GAAG,MAAM,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/* eslint-disable new-cap*/\n/**\n * @fileoverview Definition of the valuearray property class\n */\n\nconst _ = require('lodash');\nconst { MSG } = require('@fluid-experimental/property-common').constants;\nconst { _castFunctors } = require('./primitiveTypeCasts');\nconst {\n BaseDataArray,\n UniversalDataArray,\n BoolDataArray,\n Uint64,\n Int64\n} = require('@fluid-experimental/property-common');\nconst { ArrayProperty } = require('./arrayProperty');\nconst { Int64Property, Uint64Property } = require('../properties/intProperties');\n\n/**\n * An array property which stores primitive values\n */\nexport class ValueArrayProperty extends ArrayProperty {\n\n /**\n * @param {Object} in_params - Input parameters for property creation\n * @constructor\n * @protected\n * @extends property-properties.ArrayProperty\n * @alias property-properties.ValueArrayProperty\n */\n constructor(in_params) {\n super(in_params, true);\n };\n\n /**\n * returns the value at in_position for a primitive array\n * @param {number} in_position the array index\n * @return {*} the value\n */\n _getValue(in_position) {\n return this._dataArrayRef.getValue(in_position);\n };\n\n /**\n * returns the array of primitive values.\n * @return {Array<*>} the array of values.\n * For example: ['string1', 'string2']\n */\n getValues() {\n var result = [];\n var ids = this.getIds();\n for (var i = 0; i < ids.length; i++) {\n result.push(this.get(ids[i]));\n }\n return result;\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 return this.get(in_segment);\n };\n\n /**\n * Function to serialize special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on serialization. For supported types, we can just return the input here.\n *\n * @param {*} in_obj - The object to be serialized\n * @return {property-properties.SerializedChangeSet} the serialized object\n */\n _serializeValue(in_obj) {\n return in_obj;\n };\n\n /**\n * Function to serialize arrays of special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on serialization. For supported types, we can just return the input here.\n *\n * @param {Array} in_array - The array of special objects to be serialized\n * @return {Array<property-properties.SerializedChangeSet>} the serialized object\n */\n _serializeArray(in_array) {\n return in_array;\n };\n\n /**\n * Function to deserialize arrays of special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on deserialization. For supported types, we can just return the input here.\n *\n * @param {Array<property-properties.SerializedChangeSet>} in_serializedObj the serialized object\n * @return {Array} in_array - The array of special objects that were deserialized\n */\n _deserializeArray(in_serializedObj) {\n return in_serializedObj;\n };\n}\nValueArrayProperty.prototype._isPrimitive = true;\n\n/**\n * An ArrayProperty which stores Float32 values\n */\nexport class Float32ArrayProperty extends ValueArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.Float32ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\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 = new BaseDataArray(Float32Array, in_length);\n };\n}\nFloat32ArrayProperty.prototype._typeid = 'Float32';\n\n/**\n * An ArrayProperty which stores Float64 values\n */\nexport class Float64ArrayProperty extends ValueArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.Float64ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\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 = new BaseDataArray(Float64Array, in_length);\n };\n}\nFloat64ArrayProperty.prototype._typeid = 'Float64';\n\n/**\n * An ArrayProperty which stores Uint8 values\n */\nexport class Uint8ArrayProperty extends ValueArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.Uint8ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\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 = new BaseDataArray(Uint8Array, in_length);\n };\n}\nUint8ArrayProperty.prototype._typeid = 'Uint8';\n\n/**\n * An ArrayProperty which stores Int8 values\n *\n*/\nexport class Int8ArrayProperty extends ValueArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.Int8ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\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 = new BaseDataArray(Int8Array, in_length);\n };\n}\nInt8ArrayProperty.prototype._typeid = 'Int8';\n\n/**\n * An ArrayProperty which stores Uint16 values\n */\nexport class Uint16ArrayProperty extends ValueArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.Uint16ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\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 = new BaseDataArray(Uint16Array, in_length);\n };\n}\nUint16ArrayProperty.prototype._typeid = 'Uint16';\n\n/**\n * An ArrayProperty which stores Int16 values\n */\nexport class Int16ArrayProperty extends ValueArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.Int16ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\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 = new BaseDataArray(Int16Array, in_length);\n };\n}\nInt16ArrayProperty.prototype._typeid = 'Int16';\n\n/**\n * An ArrayProperty which stores Uint32 values\n */\nexport class Uint32ArrayProperty extends ValueArrayProperty {\n /** @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.Uint32ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\n };\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 = new BaseDataArray(Uint32Array, in_length);\n };\n}\nUint32ArrayProperty.prototype._typeid = 'Uint32';\n\n/**\n * An ArrayProperty which stores Int32 values\n */\nexport class Int32ArrayProperty extends ValueArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.Int32ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\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 = new BaseDataArray(Int32Array, in_length);\n };\n}\nInt32ArrayProperty.prototype._typeid = 'Int32';\n\n/**\n * An ArrayProperty which stores Int64 values\n */\nexport class Integer64ArrayProperty extends ValueArrayProperty {\n /** @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.Integer64ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\n };\n\n /**\n * Function to serialize special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on serialization. For supported types, we can just return the input here.\n *\n * @param {*} in_obj - The object to be serialized\n * @return {property-properties.SerializedChangeSet} the serialized object\n */\n _serializeValue(in_obj) {\n if (in_obj instanceof Int64 || in_obj instanceof Uint64) {\n return [in_obj.getValueLow(), in_obj.getValueHigh()];\n }\n return in_obj;\n };\n\n\n /**\n * Function to serialize arrays of special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on serialization. For supported types, we can just return the input here.\n *\n * @param {Array} in_array - The array of special objects to be serialized\n * @return {Array<property-properties.SerializedChangeSet>} the serialized object\n */\n _serializeArray(in_array) {\n var result = [];\n for (var i = 0; i < in_array.length; i++) {\n result.push(this._serializeValue(in_array[i]));\n }\n return result;\n };\n\n /**\n * Function to deserialize arrays of special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on deserialization. For supported types, we can just return the input here.\n *\n * @param {Array<property-properties.SerializedChangeSet>} in_serializedObj the serialized object\n * @return {Array} in_array - The array of special objects that were deserialized\n */\n _deserializeArray(in_serializedObj) {\n var result = [];\n for (var i = 0; i < in_serializedObj.length; i++) {\n result.push(this._deserializeValue(in_serializedObj[i]));\n }\n return result;\n };\n\n /**\n * @inheritdoc\n */\n _prettyPrint(indent, externalId, printFct) {\n\n printFct(indent + externalId + this.getId() + ' (Array of ' + this.getTypeid() + '): [');\n var childIndent = indent + ' ';\n var int64Prop;\n for (var i = 0; i < this._dataArrayGetLength(); i++) {\n // TODO: The 'toString()' function is defined on Integer64Property, so we need to create\n // such object to use it. It would be better to have it in Integer64.prototype.toString\n if (this._dataArrayGetValue(i) instanceof Int64) {\n int64Prop = new Int64Property({});\n } else {\n int64Prop = new Uint64Property({});\n }\n int64Prop.setValueLow(this._dataArrayGetValue(i).getValueLow());\n int64Prop.setValueHigh(this._dataArrayGetValue(i).getValueHigh());\n printFct(childIndent + i + ': ' + int64Prop);\n }\n printFct(indent + ']');\n };\n}\n/**\n * An ArrayProperty which stores Int64 values\n */\nexport class Int64ArrayProperty extends Integer64ArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.Integer64ArrayProperty\n * @alias property-properties.Int64ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\n };\n\n /**\n * Sets the array properties elements to the content of the given array\n * All changed elements must already exist. This will overwrite existing elements.\n * @param {number} in_offset target start index\n * @param {Array<*>|Array<property-properties.BaseProperty>} in_array contains the elements to be set\n * @throws if in_offset is not a number\n * @throws if in_offset is smaller than zero or higher than the length of the array\n */\n setRange(in_offset, in_array) {\n if (!_.isArray(in_array)) {\n throw new Error(MSG.IN_ARRAY_NOT_ARRAY + 'Int64ArrayProperty.setRange');\n }\n var out_array = in_array.map((element) => {\n return _castFunctors.Int64(element);\n });\n ArrayProperty.prototype.setRange.call(this, in_offset, out_array);\n };\n\n /**\n * Inserts the content of a given array into the array property\n * It will not overwrite the existing values but push them to the right instead.\n * E.g. [1, 2, 3] .insertRange(1, [9, 8]) => [1, 9, 8, 2, 3]\n * @param {number} in_offset target index\n * @param {Array<*>} in_array the array to be inserted\n * @throws if in_offset is smaller than zero, larger than the length of the array or not a number.\n * @throws if trying to insert a property that already has a parent.\n * @throws if tyring to modify a referenced property.\n */\n insertRange(in_offset, in_array) {\n var out_array = in_array.map((element) => {\n return _castFunctors.Int64(element);\n });\n ArrayProperty.prototype.insertRange.call(this, in_offset, out_array);\n };\n\n /**\n * Specialized function to deserialize Int64 primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on deserialization. For supported types, we can just return the input here.\n *\n * @param {property-properties.SerializedChangeSet} in_serializedObj - The object to be deserialized\n * @return {Int64} the deserialized value\n */\n _deserializeValue(in_serializedObj) {\n return new Int64(in_serializedObj[0], in_serializedObj[1]);\n };\n\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 = new UniversalDataArray(in_length);\n for (var i = 0; i < in_length; i++) {\n this._dataArraySetValue(i, new Int64());\n }\n };\n\n}\nInt64ArrayProperty.prototype._typeid = 'Int64';\n\n/**\n * An ArrayProperty which stores Uint64 values\n */\nexport class Uint64ArrayProperty extends Integer64ArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.Integer64ArrayProperty\n * @alias property-properties.Uint64ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\n };\n\n /**\n * Specialized function to deserialize Uint64 primitive types.\n * Some primitive types (e.g. Uint64, which is not natively supported by javascript) require\n * special treatment on deserialization. For supported types, we can just return the input here.\n *\n * @param {property-properties.SerializedChangeSet} in_serializedObj - The object to be deserialized\n * @return {Uint64} the deserialized value\n */\n _deserializeValue(in_serializedObj) {\n return new Uint64(in_serializedObj[0], in_serializedObj[1]);\n };\n\n /**\n * Sets the array properties elements to the content of the given array\n * All changed elements must already exist. This will overwrite existing elements.\n * @param {number} in_offset target start index\n * @param {Array<*>|Array<property-properties.BaseProperty>} in_array contains the elements to be set\n * @throws if in_offset is not a number\n * @throws if in_offset is smaller than zero or higher than the length of the array\n */\n setRange(in_offset, in_array) {\n if (!_.isArray(in_array)) {\n throw new Error(MSG.IN_ARRAY_NOT_ARRAY + 'Uint64ArrayProperty.setRange');\n }\n var out_array = in_array.map((element) => {\n return _castFunctors.Uint64(element);\n });\n ArrayProperty.prototype.setRange.call(this, in_offset, out_array);\n };\n\n /**\n * Inserts the content of a given array into the array property\n * It will not overwrite the existing values but push them to the right instead.\n * E.g. [1, 2, 3] .insertRange(1, [9, 8]) => [1, 9, 8, 2, 3]\n * @param {number} in_offset target index\n * @param {Array<*>} in_array the array to be inserted\n * @throws if in_offset is smaller than zero, larger than the length of the array or not a number.\n * @throws if trying to insert a property that already has a parent.\n * @throws if tyring to modify a referenced property.\n */\n insertRange(in_offset, in_array) {\n var out_array = in_array.map((element) => {\n return _castFunctors.Uint64(element);\n });\n ArrayProperty.prototype.insertRange.call(this, in_offset, out_array);\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 = new UniversalDataArray(in_length);\n for (var i = 0; i < in_length; i++) {\n this._dataArraySetValue(i, new Uint64());\n }\n };\n}\nUint64ArrayProperty.prototype._typeid = 'Uint64';\n\n/**\n * An ArrayProperty which stores String values\n */\nexport class StringArrayProperty extends ValueArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.StringArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\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 = new UniversalDataArray(in_length);\n for (var i = 0; i < in_length; i++) {\n this._dataArraySetValue(i, '');\n }\n };\n\n}\nStringArrayProperty.prototype._typeid = 'String';\n\n/**\n * An ArrayProperty which stores Boolean values\n */\nexport class BoolArrayProperty extends ValueArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.BoolArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params, Array, true);\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 = new BoolDataArray(in_length);\n for (var i = 0; i < in_length; i++) {\n this._dataArraySetValue(i, false);\n }\n };\n}\nBoolArrayProperty.prototype._typeid = 'Bool';\n"]}
|