@genexus/designer-common
Advanced tools
Comparing version 0.0.44 to 0.0.45
@@ -6,4 +6,5 @@ import { IDesignerHost } from "../component-model"; | ||
import { GxmlNodeDescriptor } from "./gxml-node-descriptor"; | ||
import { GxmlNodeProperty } from "./gxml-node-property"; | ||
export declare type GxmlNodeProperties = { | ||
[key: string]: string; | ||
[key: string]: GxmlNodeProperty | string; | ||
}; | ||
@@ -49,3 +50,3 @@ export declare type GxmlNodeOptions = { | ||
getPropertyValue(name: string): string; | ||
getProperties(): AnyObject<string>; | ||
getProperties(): AnyObject<GxmlNodeProperty>; | ||
addNode(child: GxmlNode): void; | ||
@@ -52,0 +53,0 @@ insertNode(child: GxmlNode, position: number): void; |
@@ -7,2 +7,3 @@ import { Guid } from "../guid"; | ||
import { SetPropertyValueCommand } from "./commands/set-property-value-command"; | ||
import { GxmlNodeProperty } from "./gxml-node-property"; | ||
export class GxmlNode { | ||
@@ -18,4 +19,10 @@ constructor(document, options) { | ||
if (options.properties) { | ||
for (let prop of Object.entries(options.properties)) | ||
this._properties.set(prop[0], prop[1]); | ||
for (let prop of Object.entries(options.properties)) { | ||
let nodeProperty; | ||
if (typeof prop[1] === 'string') | ||
nodeProperty = new GxmlNodeProperty(prop[1], false); | ||
else | ||
nodeProperty = prop[1]; | ||
this._properties.set(prop[0], nodeProperty); | ||
} | ||
} | ||
@@ -109,3 +116,6 @@ } | ||
let oldValue = this.getPropertyValue(name); | ||
this._properties.set(name, value); | ||
if (this._properties.has(name)) | ||
this._properties.get(name).value = value; | ||
else | ||
this._properties.set(name, new GxmlNodeProperty(value, false)); | ||
if (!this.isNew) | ||
@@ -115,3 +125,4 @@ this._document.onChanged(new SetPropertyValueCommand(this, name, oldValue, value)); | ||
getPropertyValue(name) { | ||
return this._properties.get(name); | ||
var _a; | ||
return (_a = this._properties.get(name)) === null || _a === void 0 ? void 0 : _a.value; | ||
} | ||
@@ -204,3 +215,5 @@ getProperties() { | ||
}; | ||
this._properties.forEach((v, k) => data.properties[k] = v); | ||
for (let [key, property] of this._properties) | ||
if (!property.isDefault) | ||
data.properties[key] = property.value; | ||
return data; | ||
@@ -207,0 +220,0 @@ } |
{ | ||
"name": "@genexus/designer-common", | ||
"version": "0.0.44", | ||
"version": "0.0.45", | ||
"main": "lib/index.js", | ||
@@ -31,3 +31,3 @@ "typings": "lib/index.d.ts", | ||
}, | ||
"gitHead": "780865705a57b7923ddf0b2566c5e8925b822716" | ||
"gitHead": "dc59bd3f74d3cfb4289964b4c3a3e9269530a0d7" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
240233
200
3275