11/**
2- * @preserve Basic Primitives Diagrams v5.6.0
2+ * @preserve Basic Primitives Diagrams v5.6.2
33 * Copyright (c) 2013 - 2019 Basic Primitives Inc
44 *
55 * Non-commercial - Free
3535
3636var primitives = {
3737 common: {
38- version: "5.6.0 "
38+ version: "5.6.2 "
3939 },
4040 orgdiagram: {},
4141 famdiagram: {},
@@ -7017,38 +7017,39 @@ primitives.common.FunctionReader.prototype.read = function (target, source, path
70177017
70187018/* /OptionsReaders/ObjectReader.js*/
70197019primitives.common.ObjectReader = function (dataTemplate, isNullable, defaultValue) {
7020- this.dataTemplate = dataTemplate;
7021- this.isNullable = isNullable;
7022- this.defaultValue = defaultValue;
7020+ this.dataTemplate = dataTemplate;
7021+ this.isNullable = isNullable;
7022+ this.defaultValue = defaultValue;
70237023};
70247024
70257025primitives.common.ObjectReader.prototype.read = function (target, source, path, context) {
7026- var result = null,
7027- property,
7028- propertyDataTemplate;
7026+ var result = null,
7027+ isTargetObject = primitives.common.isObject(target),
7028+ property,
7029+ propertyDataTemplate;
70297030
7030- if (!source) {
7031- source = this.isNullable ? null : this.defaultValue;
7032- }
7031+ if (!source) {
7032+ source = this.isNullable ? null : this.defaultValue;
7033+ }
70337034
7034- if (primitives.common.isObject(source)) {
7035- result = {};
7035+ if (primitives.common.isObject(source)) {
7036+ result = {};
70367037
7037- for (property in this.dataTemplate) {
7038- if (this.dataTemplate.hasOwnProperty(property)) {
7039- propertyDataTemplate = this.dataTemplate[property];
7038+ for (property in this.dataTemplate) {
7039+ if (this.dataTemplate.hasOwnProperty(property)) {
7040+ propertyDataTemplate = this.dataTemplate[property];
70407041
7041- result[property] = propertyDataTemplate.read(primitives.common.isObject(target) ? target[property] : null, source[property], path + "-" + property, context);
7042- }
7043- }
7044- } else {
7045- result = source;
7042+ result[property] = propertyDataTemplate.read(isTargetObject ? target[property] : null, source[property], path + "-" + property, context);
7043+ }
7044+ }
7045+ } else {
7046+ result = source;
70467047
7047- if (target !== source) {
7048- context.isChanged = true;
7049- }
7050- }
7051- return result;
7048+ if (target !== source) {
7049+ context.isChanged = true;
7050+ }
7051+ }
7052+ return result;
70527053};
70537054
70547055/* /OptionsReaders/ValueReader.js*/
@@ -7067,21 +7068,24 @@ primitives.common.ValueReader = function (acceptedTypes, isNullable, defaultValu
70677068};
70687069
70697070primitives.common.ValueReader.prototype.stringify = function (target) {
7070- var processed = [];
7071- var result = JSON.stringify(target, function (key, value) {
7072- if(key[0] === '_') {
7073- return null;
7074- }
7075- if (value !== null && typeof value == "object") {
7076- if (processed.indexOf(value) == -1) {
7077- processed.push(value);
7078- return value;
7071+ if (this.hash["object"] == true) {
7072+ var processed = [];
7073+ var result = JSON.stringify(target, function (key, value) {
7074+ if (key[0] === '_') {
7075+ return null;
70797076 }
7080- return null;
7081- }
7082- return value;
7083- });
7084- return result;
7077+ if (value !== null && typeof value == "object") {
7078+ if (processed.indexOf(value) == -1) {
7079+ processed.push(value);
7080+ return value;
7081+ }
7082+ return null;
7083+ }
7084+ return value;
7085+ });
7086+ return result;
7087+ }
7088+ return target;
70857089}
70867090
70877091primitives.common.ValueReader.prototype.read = function (target, source, path, context) {
@@ -17237,71 +17241,71 @@ primitives.orgdiagram.ItemsSizesOptionTask = function (optionsTask, defaultConfi
1723717241
1723817242/* /Controls/OrgDiagram/Tasks/Options/LabelsOptionTask.js*/
1723917243primitives.orgdiagram.LabelsOptionTask = function (optionsTask, defaultConfig, defaultItemConfig) {
17240- var _data = {},
17241- _hash = {};
17244+ var _data = {},
17245+ _hash = {};
1724217246
17243- var _dataTemplate = new primitives.common.ObjectReader({
17244- showLabels: new primitives.common.EnumerationReader(primitives.common.Enabled, false, defaultConfig.showLabels),
17245- labelOffset: new primitives.common.ValueReader(["number"], false, defaultConfig.labelOffset),
17246- labelFontSize: new primitives.common.ValueReader(["string"], false, defaultConfig.labelFontSize),
17247- labelFontFamily: new primitives.common.ValueReader(["string"], false, defaultConfig.labelFontFamily),
17248- labelFontStyle: new primitives.common.ValueReader(["string"], false, defaultConfig.labelFontStyle),
17249- labelFontWeight: new primitives.common.ValueReader(["string"], false, defaultConfig.labelFontWeight),
17250- labelColor: new primitives.common.ValueReader(["string"], false, defaultConfig.labelColor),
17251- labelSize: new primitives.common.ObjectReader({
17252- width: new primitives.common.ValueReader(["number"], false, defaultConfig.labelSize.width),
17253- height: new primitives.common.ValueReader(["number"], false, defaultConfig.labelSize.height)
17254- }, false, defaultConfig.labelSize),
17255- labelOrientation: new primitives.common.EnumerationReader(primitives.text.TextOrientationType, false, defaultConfig.labelOrientation),
17256- labelPlacement: new primitives.common.EnumerationReader(primitives.common.PlacementType, false, defaultConfig.labelPlacement),
17257- arrowsDirection: new primitives.common.EnumerationReader(primitives.common.GroupByType, false, defaultConfig.arrowsDirection),
17258- items: new primitives.common.ArrayReader(
17259- new primitives.common.ObjectReader({
17260- id: new primitives.common.ValueReader(["string", "number"], true),
17261- label: new primitives.common.ValueReader(["string", "number"], true),
17262- showLabel: new primitives.common.EnumerationReader(primitives.common.Enabled, false, defaultItemConfig.showLabel),
17263- labelSize: new primitives.common.ObjectReader({
17264- width: new primitives.common.ValueReader(["number"], false, 0),
17265- height: new primitives.common.ValueReader(["number"], false, 0)
17266- }, true),
17267- labelOrientation: new primitives.common.EnumerationReader(primitives.text.TextOrientationType, false, defaultItemConfig.labelOrientation),
17268- labelPlacement: new primitives.common.EnumerationReader(primitives.common.PlacementType, false, defaultItemConfig.labelPlacement)
17269- }),
17270- true,
17271- "id"
17272- )
17273- });
17247+ var _dataTemplate = new primitives.common.ObjectReader({
17248+ showLabels: new primitives.common.EnumerationReader(primitives.common.Enabled, false, defaultConfig.showLabels),
17249+ labelOffset: new primitives.common.ValueReader(["number"], false, defaultConfig.labelOffset),
17250+ labelFontSize: new primitives.common.ValueReader(["string"], false, defaultConfig.labelFontSize),
17251+ labelFontFamily: new primitives.common.ValueReader(["string"], false, defaultConfig.labelFontFamily),
17252+ labelFontStyle: new primitives.common.ValueReader(["string"], false, defaultConfig.labelFontStyle),
17253+ labelFontWeight: new primitives.common.ValueReader(["string"], false, defaultConfig.labelFontWeight),
17254+ labelColor: new primitives.common.ValueReader(["string"], false, defaultConfig.labelColor),
17255+ labelSize: new primitives.common.ObjectReader({
17256+ width: new primitives.common.ValueReader(["number"], false, defaultConfig.labelSize.width),
17257+ height: new primitives.common.ValueReader(["number"], false, defaultConfig.labelSize.height)
17258+ }, false, defaultConfig.labelSize),
17259+ labelOrientation: new primitives.common.EnumerationReader(primitives.text.TextOrientationType, false, defaultConfig.labelOrientation),
17260+ labelPlacement: new primitives.common.EnumerationReader(primitives.common.PlacementType, false, defaultConfig.labelPlacement),
17261+ arrowsDirection: new primitives.common.EnumerationReader(primitives.common.GroupByType, false, defaultConfig.arrowsDirection),
17262+ items: new primitives.common.ArrayReader(
17263+ new primitives.common.ObjectReader({
17264+ id: new primitives.common.ValueReader(["string", "number"], true),
17265+ label: new primitives.common.ValueReader(["string", "number", "object "], true),
17266+ showLabel: new primitives.common.EnumerationReader(primitives.common.Enabled, false, defaultItemConfig.showLabel),
17267+ labelSize: new primitives.common.ObjectReader({
17268+ width: new primitives.common.ValueReader(["number"], false, 0),
17269+ height: new primitives.common.ValueReader(["number"], false, 0)
17270+ }, true),
17271+ labelOrientation: new primitives.common.EnumerationReader(primitives.text.TextOrientationType, false, defaultItemConfig.labelOrientation),
17272+ labelPlacement: new primitives.common.EnumerationReader(primitives.common.PlacementType, false, defaultItemConfig.labelPlacement)
17273+ }),
17274+ true,
17275+ "id"
17276+ )
17277+ });
1727417278
17275- function process() {
17276- var context = {
17277- isChanged: false,
17278- hash: _hash
17279- };
17279+ function process() {
17280+ var context = {
17281+ isChanged: false,
17282+ hash: _hash
17283+ };
1728017284
17281- _data = _dataTemplate.read(_data, optionsTask.getOptions(), "options", context);
17285+ _data = _dataTemplate.read(_data, optionsTask.getOptions(), "options", context);
1728217286
17283- return context.isChanged;
17284- }
17287+ return context.isChanged;
17288+ }
1728517289
17286- function getItemsOptions() {
17287- return _hash["options-items"];
17288- }
17290+ function getItemsOptions() {
17291+ return _hash["options-items"];
17292+ }
1728917293
17290- function getItemOptions(itemid) {
17291- return _hash["options-items"][itemid];
17292- }
17294+ function getItemOptions(itemid) {
17295+ return _hash["options-items"][itemid];
17296+ }
1729317297
17294- function getOptions() {
17295- return _data;
17296- }
17298+ function getOptions() {
17299+ return _data;
17300+ }
1729717301
17298- return {
17299- process: process,
17300- getItemOptions: getItemOptions,
17301- getItemsOptions: getItemsOptions,
17302- getOptions: getOptions,
17303- description: "Checks items labels options."
17304- };
17302+ return {
17303+ process: process,
17304+ getItemOptions: getItemOptions,
17305+ getItemsOptions: getItemsOptions,
17306+ getOptions: getOptions,
17307+ description: "Checks items labels options."
17308+ };
1730517309};
1730617310
1730717311/* /Controls/OrgDiagram/Tasks/Options/LayoutOptionsTask.js*/
0 commit comments