Skip to content

Releases: Elius94/console-gui-tools

v3.0.4

25 May 08:33
5fceb67
Compare
Choose a tag to compare

What's Changed

  • [Bug]: Input popup doesn't handle special characters properly by @Elius94 in #66

Full Changelog: v3.0.3...v3.0.4

v3.0.3

22 May 08:34
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v3.0.2...v3.0.3

v3.0.2

30 Jan 15:17
Compare
Choose a tag to compare

Full Changelog: v3.0.1...v3.0.2

v3.0.1

27 Jan 15:43
Compare
Choose a tag to compare

Full Changelog: v3.0.0...v3.0.1

v3.0.0

27 Jan 15:33
f96de50
Compare
Choose a tag to compare

New Major Release v3.x.x

Classes

BoxControl

Interfaces

BoxConfig : Object

The configuration for the Box class.

BoxStyle : Object

The style of the box.

BoxConfig : Object

The configuration for the Box class.

Kind: global interface
Properties

Name Type Description
id string

The id of the box.

x number

The x position of the box.

y number

The y position of the box.

[width] number

The width of the box.

[height] number

The height of the box.

[style] BoxStyle

The style of the box.

[visible] boolean

If the box is visible.

[draggable] boolean

If the box is draggable.

BoxStyle : Object

The style of the box.

Kind: global interface
Properties

Name Type Description
[boxed] boolean

If the box is boxed.

[color] chalk.ForegroundColorName | HEX | RGB | ""

The color of the box.

[label] string

The label of the box.

Box ⇐ Control

Kind: global class
Extends: Control

new Box(config)

The class that represents a box.

image

Example of a box containing a list of process running on the computer.

Param Type Description
config BoxConfig

The configuration of the box.

Example

const box = new Box({ 
  id: "box", 
  x: 0, 
  y: 0, 
  width: 10, 
  height: 5, 
  style: { boxed: true, color: "red", label: "Box" } 
})
box.setContent(new InPageWidgetBuilder(5).addText("Hello World!"))

The box is a control widget that allows you to create a box with a title and a content. The content is a InPageWidgetBuilder object, so you can add rows to it. It can have a title and can be boxed or not. It can be used to place some texts in a specific position of the screen, without using the layout. It also can be draggable.

new Box({
    id: "box1",
    x: 22,
    y: 3,
    width: 28,
    height: 3,
    draggable: true,
    style: {
        boxed: true,
    }
}).setContent(new InPageWidgetBuilder().addRow({ text: "This is a draggable Box!", color: "rgb(255,0,0)", bg: "rgb(0,0,255)"}))

See the Box documentation for more information. or try the Box example.

htop

This example is inspired by the htop command line tool.

New Class Constructor Syntax

Since this release, every public constructor have now only one config prop with mandatory properties and others that are optional.

This is the full list of the affected classes:

Migration Guide

To adapt the old syntax it's so simple:
Change the Class Constructor with only one object as props.

For example:

Before:

new ConfirmPopup("popupQuit", "Are you sure you want to quit?").show().on("confirm", () => closeApp())

After:

new ConfirmPopup({
    id: "popupQuit", 
    title: "Are you sure you want to quit?"
}).show().on("confirm", () => closeApp())

Other minor changes are:

What's Changed

Full Changelog: v2.6.0...v3.0.0

v2.6.0

11 Jan 18:10
Compare
Choose a tag to compare

What's Changed

  • feat(widgets/ProgressBar): add custom increment by @h-sifat in #59

New Contributors

Full Changelog: v2.5.0...v2.6.0

v2.5.0

11 Jan 10:27
Compare
Choose a tag to compare

Full Changelog: v2.4.2...v2.5.0

v2.4.2

10 Jan 17:14
Compare
Choose a tag to compare

Full Changelog: v2.4.1...v2.4.2

v2.4.1

10 Jan 17:08
Compare
Choose a tag to compare

Full Changelog: v2.4.0...v2.4.1

v2.4.0

10 Jan 16:57
Compare
Choose a tag to compare

Full Changelog: v2.3.3...v2.4.0