-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: sync changes from v2 to v2-develop (#144)
Co-authored-by: ecarreras <[email protected]>
- Loading branch information
Showing
6 changed files
with
67 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@gisce/ooui", | ||
"version": "2.19.0", | ||
"version": "2.20.0", | ||
"engines": { | ||
"node": "20.5.0" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import ContainerWidget from "./ContainerWidget"; | ||
|
||
class Spinner extends ContainerWidget { | ||
_loading = false; | ||
get loading(): boolean { | ||
return this._loading; | ||
} | ||
|
||
set loading(value: boolean) { | ||
this._loading = value; | ||
} | ||
|
||
constructor(props?: any) { | ||
super(props); | ||
if (props) { | ||
if (props.loading) { | ||
this._loading = props.loading; | ||
} | ||
} | ||
} | ||
} | ||
|
||
export default Spinner; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import WidgetFactory from "../WidgetFactory"; | ||
import Spinner from "../Spinner"; | ||
import { it, expect, describe } from "vitest"; | ||
|
||
describe("A Spinner", () => { | ||
it("should have an id corresponding to field name", () => { | ||
const widgetFactory = new WidgetFactory(); | ||
const props = { | ||
name: "spinner", | ||
}; | ||
|
||
const widget = widgetFactory.createWidget("spinner", props); | ||
expect(widget).toBeInstanceOf(Spinner); | ||
}); | ||
|
||
it("should properly set label", () => { | ||
const widgetFactory = new WidgetFactory(); | ||
const props = { | ||
name: "spinner", | ||
string: "spinner caption", | ||
}; | ||
const widget = widgetFactory.createWidget("spinner", props); | ||
|
||
expect(widget.label).toBe("spinner caption"); | ||
}); | ||
|
||
it("should have loading as false by default", () => { | ||
const widgetFactory = new WidgetFactory(); | ||
const props = { | ||
name: "spinner", | ||
}; | ||
const widget = widgetFactory.createWidget("spinner", props); | ||
expect(widget.loading).toBe(false); | ||
}); | ||
}); |