diff --git a/package-lock.json b/package-lock.json index eae5336..589f45a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@gisce/ooui", - "version": "2.25.0", + "version": "2.26.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@gisce/ooui", - "version": "2.25.0", + "version": "2.26.0", "dependencies": { "@gisce/conscheck": "1.0.9", "html-entities": "^2.3.3", diff --git a/package.json b/package.json index f32f698..2bacc50 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gisce/ooui", - "version": "2.25.0", + "version": "2.26.0", "engines": { "node": "20.5.0" }, diff --git a/src/Group.ts b/src/Group.ts index c792454..7dc9045 100644 --- a/src/Group.ts +++ b/src/Group.ts @@ -10,12 +10,29 @@ class Group extends Spinner { this._icon = value; } + _height: number | undefined; + get height(): number | undefined { + return this._height; + } + + set height(value: number | undefined) { + this._height = value; + } + constructor(props: any) { super(props); if (props) { if (props.icon) { this._icon = props.icon; } + if (props.height) { + try { + this._height = parseInt(props.height); + } catch (e) { + console.log("Error parsing height"); + this._height = undefined; + } + } } } } diff --git a/src/spec/Group.spec.ts b/src/spec/Group.spec.ts index 91133cc..1f4f074 100644 --- a/src/spec/Group.spec.ts +++ b/src/spec/Group.spec.ts @@ -58,5 +58,14 @@ describe("A Group", () => { const widget = widgetFactory.createWidget("group", props); expect(widget.loading).toBe(true); }); + it("should allow to set height", () => { + const widgetFactory = new WidgetFactory(); + const props = { + string: "A group", + height: 100, + }; + const widget = widgetFactory.createWidget("group", props); + expect(widget.height).toBe(100); + }); }); });