@nsshunt/stsui 1.10.24 → 1.10.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/stsconfig.mjs +20 -20
- package/dist/stsconfig.mjs.map +1 -1
- package/dist/stsconfig.umd.js +1 -1
- package/dist/stsconfig.umd.js.map +1 -1
- package/package.json +1 -2
package/dist/stsconfig.mjs
CHANGED
|
@@ -10,10 +10,10 @@ var h = (r, o, t) => (T(r, o, "read from private field"), t ? t.call(r) : o.get(
|
|
|
10
10
|
o instanceof WeakSet ? o.add(r) : o.set(r, t);
|
|
11
11
|
}, p = (r, o, t, e) => (T(r, o, "write to private field"), e ? e.call(r, t) : o.set(r, t), t);
|
|
12
12
|
var f = (r, o, t) => (T(r, o, "access private method"), t);
|
|
13
|
+
import z from "node:events";
|
|
13
14
|
import w from "blessed";
|
|
14
15
|
import "colors";
|
|
15
|
-
import { v4 as
|
|
16
|
-
const F = {};
|
|
16
|
+
import { v4 as F } from "uuid";
|
|
17
17
|
class K {
|
|
18
18
|
// options := { screen: <blessed screen>, top: <bool>, menuitems: [ { text: <string>, key: <string>, cb: <call back func> } ] }
|
|
19
19
|
constructor(o, t) {
|
|
@@ -54,8 +54,8 @@ class K {
|
|
|
54
54
|
return this.listb;
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
var l, C, k, S, U, D, R, I, B, b,
|
|
58
|
-
class
|
|
57
|
+
var l, C, k, S, U, D, R, I, B, b, m;
|
|
58
|
+
class Q extends z {
|
|
59
59
|
/**
|
|
60
60
|
*
|
|
61
61
|
* @param {*} data The screen layout data. Schema: { title: <str>,
|
|
@@ -103,7 +103,7 @@ class L extends F {
|
|
|
103
103
|
return null;
|
|
104
104
|
let e = this.screen.height;
|
|
105
105
|
this.uidata.menu !== null && (e -= this.uidata.menu.length);
|
|
106
|
-
const a = this.screen.width, s = this.uidata.grid.rows, d = this.uidata.grid.cols, c = t.pos,
|
|
106
|
+
const a = this.screen.width, s = this.uidata.grid.rows, d = this.uidata.grid.cols, c = t.pos, x = Math.floor(a / d), n = Math.floor(e / s);
|
|
107
107
|
let v = 0;
|
|
108
108
|
if (this.uidata.menu !== null) {
|
|
109
109
|
for (const [, H] of Object.entries(this.uidata.menu))
|
|
@@ -114,11 +114,11 @@ class L extends F {
|
|
|
114
114
|
}
|
|
115
115
|
const y = {
|
|
116
116
|
top: c.row * n + v,
|
|
117
|
-
left: c.col *
|
|
118
|
-
width:
|
|
117
|
+
left: c.col * x,
|
|
118
|
+
width: x * c.colSpan,
|
|
119
119
|
height: n * c.rowSpan
|
|
120
120
|
};
|
|
121
|
-
return c.col + c.colSpan === d && (y.width = a - c.col *
|
|
121
|
+
return c.col + c.colSpan === d && (y.width = a - c.col * x), c.row + c.rowSpan === s && (y.height = e - c.row * n), y;
|
|
122
122
|
});
|
|
123
123
|
u(this, U, (t, e) => {
|
|
124
124
|
const a = h(this, S).call(this, t);
|
|
@@ -233,26 +233,26 @@ class L extends F {
|
|
|
233
233
|
this.screenHeaderText = t, this.screenHeader && this.screenHeader.setContent(`[ ${t} ]`);
|
|
234
234
|
});
|
|
235
235
|
i(this, "IncRows", () => {
|
|
236
|
-
this.screen && this.screen.height / (this.uidata.grid.rows + 1) > this.minHeight && (this.uidata.grid.rows++, this.CheckCursor(), f(this, b,
|
|
236
|
+
this.screen && this.screen.height / (this.uidata.grid.rows + 1) > this.minHeight && (this.uidata.grid.rows++, this.CheckCursor(), f(this, b, m).call(this));
|
|
237
237
|
});
|
|
238
238
|
i(this, "DecRows", () => {
|
|
239
|
-
this.uidata.grid.rows > this.minRows && (this.uidata.grid.rows--, this.CheckCursor(), f(this, b,
|
|
239
|
+
this.uidata.grid.rows > this.minRows && (this.uidata.grid.rows--, this.CheckCursor(), f(this, b, m).call(this));
|
|
240
240
|
});
|
|
241
241
|
i(this, "IncCols", () => {
|
|
242
|
-
this.screen && this.screen.width / (this.uidata.grid.cols + 1) > this.minWidth && (this.uidata.grid.cols++, this.CheckCursor(), f(this, b,
|
|
242
|
+
this.screen && this.screen.width / (this.uidata.grid.cols + 1) > this.minWidth && (this.uidata.grid.cols++, this.CheckCursor(), f(this, b, m).call(this));
|
|
243
243
|
});
|
|
244
244
|
i(this, "DecCols", () => {
|
|
245
|
-
this.uidata.grid.cols > this.minCols && (this.uidata.grid.cols--, this.CheckCursor(), f(this, b,
|
|
245
|
+
this.uidata.grid.cols > this.minCols && (this.uidata.grid.cols--, this.CheckCursor(), f(this, b, m).call(this));
|
|
246
246
|
});
|
|
247
247
|
i(this, "CheckCursor", () => {
|
|
248
248
|
h(this, l) > this.TotalPanelNumber - this.ScreenCells && (p(this, l, this.TotalPanelNumber - this.ScreenCells), h(this, l) < 0 && p(this, l, 0)), this.UpdateCursorInfo();
|
|
249
249
|
});
|
|
250
250
|
i(this, "NextPage", () => {
|
|
251
251
|
const t = this.TotalPanelNumber - this.ScreenCells;
|
|
252
|
-
h(this, l) < t && (p(this, l, h(this, l) + this.ScreenCells), h(this, l) > t && p(this, l, t), f(this, b,
|
|
252
|
+
h(this, l) < t && (p(this, l, h(this, l) + this.ScreenCells), h(this, l) > t && p(this, l, t), f(this, b, m).call(this));
|
|
253
253
|
});
|
|
254
254
|
i(this, "PrevPage", () => {
|
|
255
|
-
h(this, l) > 0 && (p(this, l, h(this, l) - this.ScreenCells), h(this, l) < 0 && p(this, l, 0), f(this, b,
|
|
255
|
+
h(this, l) > 0 && (p(this, l, h(this, l) - this.ScreenCells), h(this, l) < 0 && p(this, l, 0), f(this, b, m).call(this));
|
|
256
256
|
});
|
|
257
257
|
i(this, "Exit", () => {
|
|
258
258
|
this.DestroyUI(), this.emit("exit");
|
|
@@ -307,10 +307,10 @@ l = new WeakMap(), C = new WeakMap(), k = new WeakMap(), S = new WeakMap(), U =
|
|
|
307
307
|
}
|
|
308
308
|
const a = {};
|
|
309
309
|
for (let s = 0; s < this.uidata.grid.cols * this.uidata.grid.rows; s++) {
|
|
310
|
-
const d = h(this, l) + s, c = s % this.uidata.grid.cols,
|
|
310
|
+
const d = h(this, l) + s, c = s % this.uidata.grid.cols, x = Math.floor(s / this.uidata.grid.cols), n = this.uidata.panels[t[d]];
|
|
311
311
|
if (typeof n < "u") {
|
|
312
312
|
if (typeof this.uiBoxes[n.id] > "u") {
|
|
313
|
-
if (n.pos = { row:
|
|
313
|
+
if (n.pos = { row: x, col: c, rowSpan: 1, colSpan: 1 }, !h(this, S).call(this, n))
|
|
314
314
|
return;
|
|
315
315
|
const { top: y, left: H, width: E, height: M } = h(this, S).call(this, n), g = w.box({
|
|
316
316
|
parent: this.screen,
|
|
@@ -353,21 +353,21 @@ l = new WeakMap(), C = new WeakMap(), k = new WeakMap(), S = new WeakMap(), U =
|
|
|
353
353
|
const P = { ...j.options };
|
|
354
354
|
P.top && P.top >= g.height - 3 && (P.top = g.height - 4);
|
|
355
355
|
const O = w[j.widget].call(this, P);
|
|
356
|
-
O.set("id",
|
|
356
|
+
O.set("id", F()), g.append(O), g.set(j.widget, O);
|
|
357
357
|
}
|
|
358
358
|
g.set("panel", n), this.uiBoxes[n.id].box = g, a[n.id] = !0;
|
|
359
359
|
} else
|
|
360
|
-
h(this, R).call(this, n,
|
|
360
|
+
h(this, R).call(this, n, x, c, this.uiBoxes[n.id]), a[n.id] = !0;
|
|
361
361
|
h(this, C) && h(this, C).call(this, this.uiBoxes[n.id].box, n);
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
364
|
for (const [s] of Object.entries(this.uiBoxes))
|
|
365
365
|
typeof a[s] > "u" ? (this.uiBoxes[s].box.hide(), this.uiBoxes[s].boxHeader.hide()) : (this.uiBoxes[s].box.show(), this.uiBoxes[s].boxHeader.show());
|
|
366
|
-
}, b = new WeakSet(),
|
|
366
|
+
}, b = new WeakSet(), m = function() {
|
|
367
367
|
this.SetupUI();
|
|
368
368
|
};
|
|
369
369
|
export {
|
|
370
370
|
K as MenuBar,
|
|
371
|
-
|
|
371
|
+
Q as STSUIFrame
|
|
372
372
|
};
|
|
373
373
|
//# sourceMappingURL=stsconfig.mjs.map
|
package/dist/stsconfig.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stsconfig.mjs","sources":["../__vite-browser-external","../src/menubar.ts","../src/stsuiframe.ts"],"sourcesContent":["export default {}","import blessed from 'blessed';\nimport * as stsBlessed from './index'\n\nexport interface menuitem {\n\ttext: string,\n\tkey: string,\n\tcb(): void\n}\n\nexport interface MenuBarOptions {\n\ttop: boolean\n\tmenuitems: menuitem[]\n}\n\nexport class MenuBar\n{\n private listb:stsBlessed.listbar | null = null;\n\n // options := { screen: <blessed screen>, top: <bool>, menuitems: [ { text: <string>, key: <string>, cb: <call back func> } ] }\n constructor(screen: stsBlessed.screen, options: MenuBarOptions) {\n const compoptions: stsBlessed.elementOptions = {\n parent: screen,\n left: 0,\n right: 0,\n height: 1,\n width: 'shrink',\n mouse: true,\n keys: true,\n autoCommandKeys: true,\n scrollable: true,\n style: {\n fg: 'yellow',\n bg: 'blue',\n\n item: {\n hover: {\n fg: 'white',\n bg: 'green',\n }\n },\n selected: {\n fg: 'black',\n bg: 'yellow',\n }\n }\n }\n if (options.top === true) {\n compoptions.top = 0;\n } else {\n compoptions.bottom = 0;\n }\n\n compoptions.commands = { };\n options.menuitems.forEach((menuItem) => {\n if (compoptions.commands) {\n compoptions.commands[menuItem.text] = {\n keys: [ menuItem.key ],\n callback: menuItem.cb\n }\n }\n })\n\n this.listb = blessed.listbar(compoptions);\n }\n\n get listbar()\n {\n return this.listb;\n }\n}\n","import EventEmitter from 'node:events'\n\n// https://github.com/yaronn/blessed-contrib\n//var contrib = require('blessed-contrib');\nimport blessed from 'blessed';\n\nimport 'colors';\n\nimport { v4 as uuidv4 } from 'uuid';\n\nimport * as stsBlessed from './index'\nimport * as MenuBar from './menubar'\n\nexport type menuOptions = MenuBar.MenuBarOptions[]\n\nexport interface widget {\n widget: string // Name of the blessed widget\n options: stsBlessed.elementOptions // blessed widget options - used in the constructor of the blessed widget\n}\n\nexport interface widgets {\n [widgetName: string]: widget\n}\n\nexport interface panel {\n id: string,\n pos?: {\n row: number,\n col: number,\n rowSpan: number,\n colSpan: number\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data: any\n panelHeader: string,\n widgets: widgets\n}\n\nexport interface panels {\n [panelId: string]: panel\n}\n\nexport interface gridData {\n\ttitle: string\n\tgrid: { rows: number, cols: number },\n\tmenu: menuOptions,\n\tpanels: panels\n}\n\nexport interface renderPanelCb {\n\t(box: stsBlessed.box, panel: panel): void\n}\n\nexport interface boxPos {\n\ttop: number,\n\tleft: number,\n\twidth: number,\n\theight: number\n}\n\nexport interface uiBox {\n\tbox: stsBlessed.box, // blessed box\n\tboxHeader: stsBlessed.listbar // blessed box\n}\n\nexport interface uiBoxes {\n\t[key: string]: uiBox\n}\n\nexport class STSUIFrame extends EventEmitter {\n//export class STSUIFrame {\n private uiBoxes:uiBoxes = { }; // { box: <<blessed box>>, boxHeader: <<blessed box>> }\n private screen: stsBlessed.screen | null = null;\n #cursor = 0; // panel index with the complete model data.\n #renderPanelFn: renderPanelCb | null = null;\n private screenHeaderText = '...';\n\n private minRows = 1;\n private minCols = 1;\n private minWidth = 40;\n private minHeight = 7;\n\n #cursorInfo: stsBlessed.box | null = null;\n private sortInfo: stsBlessed.box | null = null; // Current sort mode UI box control\n private screenHeader: stsBlessed.box | null = null;\n\n private uidata: gridData;\n\n /**\n * \n * @param {*} data The screen layout data. Schema: { title: <str>,\n * grid: { rows: <int>, cols: <int> }, \n * panels: [ { id: <str>, pos: { row: <int>, col: <int>, rowSpan: <int>, colSpan: <int> }, \n * template: <handlebars func>, widgets: { [ { <prop_name>: <blessed widget> } ] } } ] }\n */\n constructor(data: gridData, renderPanelFn: renderPanelCb | null = null) {\n super();\n this.uidata = data;\n this.#renderPanelFn = renderPanelFn;\n this.SetupUI();\n }\n\n /**\n * \n * @param {number} position The index (0 based) for the panel item to be calculated\n * @returns object with top, left, width and height correctly set\n */\n #CalcBoxPos = (panel: panel): boxPos | null => {\n // Calculate the position and dimensions for this UI element\n\n if (!this.screen) return null;\n if (!panel.pos) return null;\n\n let screenHeight = this.screen.height;\n if (this.uidata.menu !== null) {\n screenHeight -= this.uidata.menu.length; // Allow for any menu items\n }\n const screenWidth = this.screen.width;\n\n const rows = this.uidata.grid.rows;\n const cols = this.uidata.grid.cols;\n\n const pos = panel.pos;\n\n const colWidth = Math.floor(screenWidth / cols);\n const rowHeight = Math.floor(screenHeight / rows);\n\n // Allow for a top offset if a top menu is present\n let topoffset = 0;\n if (this.uidata.menu !== null) {\n for (const [, value] of Object.entries(this.uidata.menu)) {\n if (value.top === true) {\n topoffset = 1;\n break;\n }\n }\n }\n\n const boxPos: boxPos = {\n top: (pos.row * rowHeight) + topoffset,\n left: pos.col * colWidth,\n width: colWidth * pos.colSpan,\n height: rowHeight * pos.rowSpan\n }\n\n // Now check if this panel is on the far right and if so adjust for a perfect fit\n\n if ((pos.col + pos.colSpan) === cols) {\n //if (pos.col === (cols - 1)) {\n boxPos.width = screenWidth - (pos.col * colWidth);\n }\n\n // Now check if this panel is on the bottom and if so adjust for a perfect fit\n if ((pos.row + pos.rowSpan) === rows) {\n boxPos.height = screenHeight - (pos.row * rowHeight);\n }\n\n return boxPos;\n }\n\n #UpdateUIBoxPos = (panel: panel, uiBox: uiBox): void => {\n const pos: boxPos | null = this.#CalcBoxPos(panel);\n if (!pos) {\n return;\n }\n\n uiBox.box.top = pos.top;\n uiBox.box.left = pos.left;\n uiBox.box.width = pos.width;\n uiBox.box.height = pos.height;\n\n uiBox.boxHeader.top = pos.top;\n uiBox.boxHeader.left = pos.left + 2;\n\n if (typeof panel.widgets !== 'undefined' && panel.widgets !== null) {\n for (const [, value] of Object.entries(panel.widgets)) {\n if (value.widget === 'log') {\n const widget = uiBox.box.get(value.widget) as stsBlessed.element;\n if (widget.position.top >= (uiBox.box.height - 4)) {\n widget.position.top = uiBox.box.height - 4;\n } else {\n if (value.options.top) {\n widget.position.top = value.options.top;\n }\n }\n }\n }\n }\n };\n\n /**\n * ReSize the grid layout\n */\n #ReSize = (): void => {\n for (const [, value] of Object.entries(this.uiBoxes)) {\n this.#UpdateUIBoxPos(value.box.get('panel') as panel, value);\n }\n }\n\n #UpdatePanelPosition = (panel: panel, row: number, col: number, uiBox: uiBox): void => {\n // Update the panel position within the current screen view\n panel.pos = { row: row, col: col, rowSpan: 1, colSpan: 1 };\n this.#UpdateUIBoxPos(panel, uiBox);\n uiBox.boxHeader.setContent(panel.panelHeader);\n }\n\n /*\n ClickEx(panel: any) {\n //@@ override in sub-class\n }\n */\n\n /**\n * \n * Setup all panels\n */\n #SetupPanels(): void {\n if (!this.screen) {\n return;\n }\n\n const panelKeys = Object.keys(this.uidata.panels);\n\n // Check for deleted panels\n const uiBoxIds = Object.keys(this.uiBoxes);\n for (let i=0; i < uiBoxIds.length; i++) {\n if (typeof this.uidata.panels[uiBoxIds[i]] === 'undefined') {\n let uiBox: uiBox | null = this.uiBoxes[uiBoxIds[i]];\n if (typeof uiBox !== 'undefined') {\n this.screen.remove(uiBox.boxHeader);\n this.screen.remove(uiBox.box);\n uiBox = null;\n delete this.uiBoxes[uiBoxIds[i]];\n }\n }\n }\n\n const touched: Record<string, boolean> = { };\n\n for (let i=0; i < (this.uidata.grid.cols * this.uidata.grid.rows); i++) {\n const gridPos = this.#cursor + i;\n const col = i % this.uidata.grid.cols;\n const row = Math.floor(i / this.uidata.grid.cols);\n\n // Get the panel for this position within the grid\n const panel: panel = this.uidata.panels[panelKeys[gridPos]];\n if (typeof panel !== 'undefined') {\n if (typeof this.uiBoxes[panel.id] === 'undefined') {\n // Update the panel position within the current screen view\n panel.pos = { row: row, col: col, rowSpan: 1, colSpan: 1 };\n\n const calculatedBoxPos = this.#CalcBoxPos(panel);\n if (!calculatedBoxPos) {\n return\n }\n const { top, left, width, height } = this.#CalcBoxPos(panel) as boxPos;\n\n // Create the UI box\n const box: stsBlessed.box = blessed.box({\n parent: this.screen,\n top: top,\n left: left,\n width: width,\n height: height,\n style:\n {\n bg: '#101010' // was gray\n ,fg: 'white'\n },\n border:\n {\n type: 'line'\n },\n keys: false, // Do not allow default key handling for this box\n tags: true // Allow style in-line tags such as bolt, italics, etc.\n });\n\n const boxHeader: stsBlessed.listbar = blessed.box({\n parent: this.screen,\n top: top,\n left: left+2,\n width: 'shrink',\n height: 1,\n style:\n {\n bg: 'gray'\n , fg: 'white'\n },\n keys: false, // Do not allow default key handling for this box\n mouse: false,\n content: panel.panelHeader,\n tags: true // Allow style in-line tags such as bolt, italics, etc.\n });\n\n this.uiBoxes[panel.id] = { box: box, boxHeader: boxHeader };\n\n boxHeader.setIndex(-1);\n\n // https://stackoverflow.com/questions/20279484/how-to-access-the-correct-this-inside-a-callback\n box.on('click', () => {\n //this.emit('click', box.data.panel);\n this.emit('click', box.get('panel') as panel);\n //this.ClickEx(box.get('panel') as panel);\n });\n\n if (typeof panel.widgets !== 'undefined' && panel.widgets !== null) {\n for (const [, value] of Object.entries(panel.widgets)) {\n // Create a fresh copy of the options for this widget instance.\n // If this is not done, all widgets will use the same options object and will not be able\n // to update screen elements individually.\n const widgetoptions = {...value.options};\n\n // Ensure that we always show at least 2 lines of log data even if this means we position over the top of\n // elements above this position.\n if (widgetoptions.top && (widgetoptions.top >= (box.height - 3))) {\n widgetoptions.top = box.height - 4;\n }\n const widget: stsBlessed.element = blessed[value.widget].call(this, widgetoptions);\n widget.set('id', uuidv4());\n box.append(widget);\n box.set(value.widget, widget); // Set the user data for this widget. This allows the handlebars template access via the name from the box object.\n }\n }\n\n // The entire panel is accessible using the _panel property.\n // This is so that the model is accessible from within the handlebars templates.\n // Access to a named widget can be done using box._panel.widgets[name] or box._panel.widgets.name\n box.set('panel', panel);\n\n this.uiBoxes[panel.id].box = box;\n\n touched[panel.id] = true;\n } else {\n //@@ need to hide previous positions\n //@@ and show ones that are visible\n this.#UpdatePanelPosition(panel, row, col, this.uiBoxes[panel.id]);\n\n touched[panel.id] = true;\n //this.#uiBox[panel.id].box.show();\n }\n\n // Render the uiBox with the renderPanelFn using the panel as the utility including the model\n if (this.#renderPanelFn) {\n this.#renderPanelFn(this.uiBoxes[panel.id].box, panel);\n }\n }\n }\n\n for (const [key, ] of Object.entries(this.uiBoxes)) {\n if (typeof touched[key] === 'undefined') {\n this.uiBoxes[key].box.hide();\n this.uiBoxes[key].boxHeader.hide();\n } else {\n this.uiBoxes[key].box.show();\n this.uiBoxes[key].boxHeader.show();\n }\n }\n\n }\n\n get gridData(): gridData {\n return this.uidata;\n }\n\n set gridData(gridData: gridData) {\n this.uidata = gridData;\n this.#SetupPanels();\n this.UpdateCursorInfo();\n this.Render();\n }\n\n get gridDataPanels(): panels {\n return this.uidata.panels;\n }\n\n set gridDataPanels(gridDataPanels: panels) {\n this.uidata.panels = gridDataPanels;\n this.#SetupPanels();\n this.UpdateCursorInfo();\n this.Render();\n }\n\n /*\n ExitEx() {\n //@@ override in sub-class\n }\n\n EscapeEx() {\n //@@ override in sub-class\n }\n */\n\n // https://www.npmjs.com/package/blessed\n\n // data:= { title: <str>,\n // grid: { rows: <int>, cols: <int> }, \n // menu: [ { top: <bool>, menuitems: [ { text: <string>, key: <string>, cb: <func> } ] } ]\n // panels: [ { id: <str>, pos: { row: <int>, col: <int>, rowSpan: <int>, colSpan: <int> }, template: <str> } ] }\n /**\n * \n * @param {*} data UI Data\n */\n SetupUI = (): void => {\n this.DestroyUI();\n\n if (this.screen === null) {\n // Create a screen object.\n this.screen = blessed.screen({\n smartCSR: true\n });\n }\n\n if (!this.screen) {\n return;\n }\n\n const data = this.uidata;\n this.screen.title = data.title;\n this.screen.on('resize', () => {\n this.#ReSize();\n this.Render();\n });\n\n if (data.menu !== null) {\n for (let i = 0; i < data.menu.length; i++) {\n new MenuBar.MenuBar(this.screen, data.menu[i]);\n }\n }\n\n // Allow the serrvice to terminate by pressing Control-C.\n this.screen.key(['C-c'], (): void => {\n this.DestroyUI();\n this.emit('exit');\n //this.ExitEx();\n // Cleanly shutdown the main process. Exit code success (> 0 is exit in error state)\n //setTimeout(() => process.kill(process.pid), 0);\n });\n\n this.screen.key(['escape'], (): void => {\n this.emit('escape');\n //this.EscapeEx();\n // Cleanly shutdown the main process. Exit code success (> 0 is exit in error state)\n //setTimeout(() => process.kill(process.pid), 0);\n });\n\n this.#SetupPanels();\n\n this.#cursorInfo = blessed.box({\n parent: this.screen,\n bottom: 0,\n right: 0,\n width: 'shrink',\n height: 1,\n style:\n {\n bg: 'gray'\n , fg: 'white'\n },\n keys: false, // Do not allow default key handling for this box\n mouse: false,\n content: '',\n tags: true // Allow style in-line tags such as bolt, italics, etc.\n });\n\n this.sortInfo = blessed.box({\n parent: this.screen,\n top: 0,\n right: 0,\n width: 'shrink',\n height: 1,\n style:\n {\n bg: 'gray'\n , fg: 'white'\n },\n keys: false, // Do not allow default key handling for this box\n mouse: false,\n content: '',\n tags: true // Allow style in-line tags such as bolt, italics, etc.\n });\n\n\n this.screenHeader = blessed.box({\n parent: this.screen,\n top: 0,\n left: 'center',\n width: 'shrink',\n height: 1,\n style:\n {\n bg: 'gray'\n , fg: 'white'\n },\n keys: false, // Do not allow default key handling for this box\n mouse: false,\n content: `[ ... ]`,\n tags: true // Allow style in-line tags such as bolt, italics, etc.\n });\n\n this.UpdateCursorInfo();\n this.UpdateSortInfo('Default');\n this.UpdateScreenHeader(this.screenHeaderText);\n\n // Render the screen.\n this.Render();\n }\n\n UpdateCursorInfo = (): void => {\n if (this.#cursorInfo) {\n this.#cursorInfo.setContent(`Cursor: ${this.#cursor} / ${this.TotalPanelNumber}`);\n }\n }\n\n UpdateSortInfo = (sortMode: string): void => {\n if (this.sortInfo) {\n this.sortInfo.setContent(`Sort: ${sortMode}`);\n }\n }\n\n UpdateScreenHeader = (screenHeaderText: string): void => {\n this.screenHeaderText = screenHeaderText;\n if (this.screenHeader) {\n this.screenHeader.setContent(`[ ${screenHeaderText} ]`);\n }\n }\n\n get rows(): number {\n return this.uidata.grid.rows;\n }\n\n get cols(): number {\n return this.uidata.grid.cols;\n }\n\n IncRows = (): void => {\n if (this.screen && (this.screen.height / (this.uidata.grid.rows+1) > this.minHeight)) {\n this.uidata.grid.rows++;\n this.CheckCursor();\n this.#UpdateUI();\n }\n }\n\n DecRows = (): void => {\n if (this.uidata.grid.rows > this.minRows) {\n this.uidata.grid.rows--;\n this.CheckCursor();\n this.#UpdateUI();\n }\n }\n\n IncCols = (): void => {\n if (this.screen && (this.screen.width / (this.uidata.grid.cols+1) > this.minWidth)) {\n this.uidata.grid.cols++;\n this.CheckCursor();\n this.#UpdateUI();\n }\n }\n\n DecCols = (): void => {\n if (this.uidata.grid.cols > this.minCols) {\n this.uidata.grid.cols--;\n this.CheckCursor();\n this.#UpdateUI();\n }\n }\n\n get ScreenCells(): number {\n return this.uidata.grid.cols * this.uidata.grid.rows;\n }\n\n get TotalPanelNumber(): number {\n return Object.keys(this.uidata.panels).length;\n }\n\n CheckCursor = (): void => {\n if (this.#cursor > (this.TotalPanelNumber - this.ScreenCells)) {\n this.#cursor = this.TotalPanelNumber - this.ScreenCells;\n if (this.#cursor < 0) {\n this.#cursor = 0;\n }\n }\n this.UpdateCursorInfo();\n }\n\n NextPage = (): void => {\n const endpos = this.TotalPanelNumber - this.ScreenCells;\n if (this.#cursor < endpos) {\n this.#cursor += this.ScreenCells;\n if (this.#cursor > endpos) {\n this.#cursor = endpos;\n }\n this.#UpdateUI();\n }\n }\n\n PrevPage = (): void => {\n if (this.#cursor > 0) {\n this.#cursor -= this.ScreenCells;\n if (this.#cursor < 0) {\n this.#cursor = 0;\n }\n this.#UpdateUI();\n }\n }\n\n #UpdateUI(): void {\n this.SetupUI();\n\n //@@ fix screen render - should not need to blow entire screen away ...\n //this.#SetupPanels();\n //this.UpdateCursorInfo();\n //this.Render();\n }\n\n Exit = (): void => {\n this.DestroyUI();\n this.emit('exit');\n //this.ExitEx();\n }\n\n /**\n * \n */\n DestroyUI = (): void => {\n // Destroy the screen and disable UI log processing\n if (this.screen !== null) {\n this.uiBoxes = { };\n this.screen.destroy();\n this.screen = null;\n }\n }\n\n /**\n * Render the screen.\n */\n Render = (): void => {\n if (this.screen) {\n this.screen.render();\n }\n }\n}\n"],"names":["EventEmitter","MenuBar","screen","options","__publicField","compoptions","menuItem","blessed","STSUIFrame","data","renderPanelFn","__privateAdd","_SetupPanels","_UpdateUI","_cursor","_renderPanelFn","_cursorInfo","_CalcBoxPos","panel","screenHeight","screenWidth","rows","cols","pos","colWidth","rowHeight","topoffset","value","boxPos","_UpdateUIBoxPos","uiBox","__privateGet","widget","_ReSize","_UpdatePanelPosition","row","col","i","MenuBar.MenuBar","__privateMethod","SetupPanels_fn","__privateSet","sortMode","screenHeaderText","UpdateUI_fn","endpos","gridData","gridDataPanels","panelKeys","uiBoxIds","touched","gridPos","top","left","width","height","box","boxHeader","widgetoptions","uuidv4","key"],"mappings":";;;;;;;;;;;;;;;AAAA,MAAeA,IAAA,CAAA;ACcR,MAAMC,EACb;AAAA;AAAA,EAII,YAAYC,GAA2BC,GAAyB;AAHxD,IAAAC,EAAA,eAAkC;AAItC,UAAMC,IAAyC;AAAA,MAC3C,QAAQH;AAAA,MACR,MAAM;AAAA,MACN,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,OAAO;AAAA,MACP,MAAM;AAAA,MACN,iBAAiB;AAAA,MACjB,YAAY;AAAA,MACZ,OAAO;AAAA,QACH,IAAI;AAAA,QACJ,IAAI;AAAA,QAEJ,MAAM;AAAA,UACF,OAAO;AAAA,YACH,IAAI;AAAA,YACJ,IAAI;AAAA,UACR;AAAA,QACJ;AAAA,QACA,UAAU;AAAA,UACN,IAAI;AAAA,UACJ,IAAI;AAAA,QACR;AAAA,MACJ;AAAA,IAAA;AAEA,IAAAC,EAAQ,QAAQ,KAChBE,EAAY,MAAM,IAElBA,EAAY,SAAS,GAGzBA,EAAY,WAAW,IACfF,EAAA,UAAU,QAAQ,CAACG,MAAa;AACpC,MAAID,EAAY,aACAA,EAAA,SAASC,EAAS,IAAI,IAAI;AAAA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AMwC,IAAgB,EAAC,GAAG/B,EAAM,QAAO;AAIvC,YAAI+B,EAAc,OAAQA,EAAc,OAAQF,EAAI,SAAS,MAC3CE,EAAA,MAAMF,EAAI,SAAS;AAErC,kBAAMxB,IAA6BzB,EAAQoB,EAAM,MAAM,EAAE,KAAK,MAAM+B,CAAa;AAC1E,YAAA1B,EAAA,IAAI,MAAM2B,EAAQ,CAAA,GACzBH,EAAI,OAAOxB,CAAM,GACbwB,EAAA,IAAI7B,EAAM,QAAQK,CAAM;AAAA;AAOhC,QAAAwB,EAAA,IAAI,SAAStC,CAAK,GAEtB,KAAK,QAAQA,EAAM,EAAE,EAAE,MAAMsC,GAErBN,EAAAhC,EAAM,EAAE,IAAI;AAAA;AAIf,QAAAa,EAAA,MAAAG,GAAA,WAAqBhB,GAAOiB,GAAKC,GAAK,KAAK,QAAQlB,EAAM,EAAE,IAExDgC,EAAAhC,EAAM,EAAE,IAAI;AAKxB,MAAIa,EAAA,MAAKhB,MACLgB,EAAA,MAAKhB,GAAL,WAAoB,KAAK,QAAQG,EAAM,EAAE,EAAE,KAAKA;AAAA;AAAA;AAK5D,aAAW,CAAC0C,CAAK,KAAK,OAAO,QAAQ,KAAK,OAAO;AAC7C,IAAI,OAAOV,EAAQU,CAAG,IAAM,OACxB,KAAK,QAAQA,CAAG,EAAE,IAAI,KAAK,GAC3B,KAAK,QAAQA,CAAG,EAAE,UAAU,KAAK,MAEjC,KAAK,QAAQA,CAAG,EAAE,IAAI,KAAK,GAC3B,KAAK,QAAQA,CAAG,EAAE,UAAU,KAAK;AAI7C,GAuPA/C,IAAA,eAAA+B,IAAkB,WAAA;AACd,OAAK,QAAQ;AAMjB;"}
|
|
1
|
+
{"version":3,"file":"stsconfig.mjs","sources":["../src/menubar.ts","../src/stsuiframe.ts"],"sourcesContent":["import blessed from 'blessed';\nimport * as stsBlessed from './index'\n\nexport interface menuitem {\n\ttext: string,\n\tkey: string,\n\tcb(): void\n}\n\nexport interface MenuBarOptions {\n\ttop: boolean\n\tmenuitems: menuitem[]\n}\n\nexport class MenuBar\n{\n private listb:stsBlessed.listbar | null = null;\n\n // options := { screen: <blessed screen>, top: <bool>, menuitems: [ { text: <string>, key: <string>, cb: <call back func> } ] }\n constructor(screen: stsBlessed.screen, options: MenuBarOptions) {\n const compoptions: stsBlessed.elementOptions = {\n parent: screen,\n left: 0,\n right: 0,\n height: 1,\n width: 'shrink',\n mouse: true,\n keys: true,\n autoCommandKeys: true,\n scrollable: true,\n style: {\n fg: 'yellow',\n bg: 'blue',\n\n item: {\n hover: {\n fg: 'white',\n bg: 'green',\n }\n },\n selected: {\n fg: 'black',\n bg: 'yellow',\n }\n }\n }\n if (options.top === true) {\n compoptions.top = 0;\n } else {\n compoptions.bottom = 0;\n }\n\n compoptions.commands = { };\n options.menuitems.forEach((menuItem) => {\n if (compoptions.commands) {\n compoptions.commands[menuItem.text] = {\n keys: [ menuItem.key ],\n callback: menuItem.cb\n }\n }\n })\n\n this.listb = blessed.listbar(compoptions);\n }\n\n get listbar()\n {\n return this.listb;\n }\n}\n","import EventEmitter from 'node:events'\n\n// https://github.com/yaronn/blessed-contrib\n//var contrib = require('blessed-contrib');\nimport blessed from 'blessed';\n\nimport 'colors';\n\nimport { v4 as uuidv4 } from 'uuid';\n\nimport * as stsBlessed from './index'\nimport * as MenuBar from './menubar'\n\nexport type menuOptions = MenuBar.MenuBarOptions[]\n\nexport interface widget {\n widget: string // Name of the blessed widget\n options: stsBlessed.elementOptions // blessed widget options - used in the constructor of the blessed widget\n}\n\nexport interface widgets {\n [widgetName: string]: widget\n}\n\nexport interface panel {\n id: string,\n pos?: {\n row: number,\n col: number,\n rowSpan: number,\n colSpan: number\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data: any\n panelHeader: string,\n widgets: widgets\n}\n\nexport interface panels {\n [panelId: string]: panel\n}\n\nexport interface gridData {\n\ttitle: string\n\tgrid: { rows: number, cols: number },\n\tmenu: menuOptions,\n\tpanels: panels\n}\n\nexport interface renderPanelCb {\n\t(box: stsBlessed.box, panel: panel): void\n}\n\nexport interface boxPos {\n\ttop: number,\n\tleft: number,\n\twidth: number,\n\theight: number\n}\n\nexport interface uiBox {\n\tbox: stsBlessed.box, // blessed box\n\tboxHeader: stsBlessed.listbar // blessed box\n}\n\nexport interface uiBoxes {\n\t[key: string]: uiBox\n}\n\nexport class STSUIFrame extends EventEmitter {\n//export class STSUIFrame {\n private uiBoxes:uiBoxes = { }; // { box: <<blessed box>>, boxHeader: <<blessed box>> }\n private screen: stsBlessed.screen | null = null;\n #cursor = 0; // panel index with the complete model data.\n #renderPanelFn: renderPanelCb | null = null;\n private screenHeaderText = '...';\n\n private minRows = 1;\n private minCols = 1;\n private minWidth = 40;\n private minHeight = 7;\n\n #cursorInfo: stsBlessed.box | null = null;\n private sortInfo: stsBlessed.box | null = null; // Current sort mode UI box control\n private screenHeader: stsBlessed.box | null = null;\n\n private uidata: gridData;\n\n /**\n * \n * @param {*} data The screen layout data. Schema: { title: <str>,\n * grid: { rows: <int>, cols: <int> }, \n * panels: [ { id: <str>, pos: { row: <int>, col: <int>, rowSpan: <int>, colSpan: <int> }, \n * template: <handlebars func>, widgets: { [ { <prop_name>: <blessed widget> } ] } } ] }\n */\n constructor(data: gridData, renderPanelFn: renderPanelCb | null = null) {\n super();\n this.uidata = data;\n this.#renderPanelFn = renderPanelFn;\n this.SetupUI();\n }\n\n /**\n * \n * @param {number} position The index (0 based) for the panel item to be calculated\n * @returns object with top, left, width and height correctly set\n */\n #CalcBoxPos = (panel: panel): boxPos | null => {\n // Calculate the position and dimensions for this UI element\n\n if (!this.screen) return null;\n if (!panel.pos) return null;\n\n let screenHeight = this.screen.height;\n if (this.uidata.menu !== null) {\n screenHeight -= this.uidata.menu.length; // Allow for any menu items\n }\n const screenWidth = this.screen.width;\n\n const rows = this.uidata.grid.rows;\n const cols = this.uidata.grid.cols;\n\n const pos = panel.pos;\n\n const colWidth = Math.floor(screenWidth / cols);\n const rowHeight = Math.floor(screenHeight / rows);\n\n // Allow for a top offset if a top menu is present\n let topoffset = 0;\n if (this.uidata.menu !== null) {\n for (const [, value] of Object.entries(this.uidata.menu)) {\n if (value.top === true) {\n topoffset = 1;\n break;\n }\n }\n }\n\n const boxPos: boxPos = {\n top: (pos.row * rowHeight) + topoffset,\n left: pos.col * colWidth,\n width: colWidth * pos.colSpan,\n height: rowHeight * pos.rowSpan\n }\n\n // Now check if this panel is on the far right and if so adjust for a perfect fit\n\n if ((pos.col + pos.colSpan) === cols) {\n //if (pos.col === (cols - 1)) {\n boxPos.width = screenWidth - (pos.col * colWidth);\n }\n\n // Now check if this panel is on the bottom and if so adjust for a perfect fit\n if ((pos.row + pos.rowSpan) === rows) {\n boxPos.height = screenHeight - (pos.row * rowHeight);\n }\n\n return boxPos;\n }\n\n #UpdateUIBoxPos = (panel: panel, uiBox: uiBox): void => {\n const pos: boxPos | null = this.#CalcBoxPos(panel);\n if (!pos) {\n return;\n }\n\n uiBox.box.top = pos.top;\n uiBox.box.left = pos.left;\n uiBox.box.width = pos.width;\n uiBox.box.height = pos.height;\n\n uiBox.boxHeader.top = pos.top;\n uiBox.boxHeader.left = pos.left + 2;\n\n if (typeof panel.widgets !== 'undefined' && panel.widgets !== null) {\n for (const [, value] of Object.entries(panel.widgets)) {\n if (value.widget === 'log') {\n const widget = uiBox.box.get(value.widget) as stsBlessed.element;\n if (widget.position.top >= (uiBox.box.height - 4)) {\n widget.position.top = uiBox.box.height - 4;\n } else {\n if (value.options.top) {\n widget.position.top = value.options.top;\n }\n }\n }\n }\n }\n };\n\n /**\n * ReSize the grid layout\n */\n #ReSize = (): void => {\n for (const [, value] of Object.entries(this.uiBoxes)) {\n this.#UpdateUIBoxPos(value.box.get('panel') as panel, value);\n }\n }\n\n #UpdatePanelPosition = (panel: panel, row: number, col: number, uiBox: uiBox): void => {\n // Update the panel position within the current screen view\n panel.pos = { row: row, col: col, rowSpan: 1, colSpan: 1 };\n this.#UpdateUIBoxPos(panel, uiBox);\n uiBox.boxHeader.setContent(panel.panelHeader);\n }\n\n /*\n ClickEx(panel: any) {\n //@@ override in sub-class\n }\n */\n\n /**\n * \n * Setup all panels\n */\n #SetupPanels(): void {\n if (!this.screen) {\n return;\n }\n\n const panelKeys = Object.keys(this.uidata.panels);\n\n // Check for deleted panels\n const uiBoxIds = Object.keys(this.uiBoxes);\n for (let i=0; i < uiBoxIds.length; i++) {\n if (typeof this.uidata.panels[uiBoxIds[i]] === 'undefined') {\n let uiBox: uiBox | null = this.uiBoxes[uiBoxIds[i]];\n if (typeof uiBox !== 'undefined') {\n this.screen.remove(uiBox.boxHeader);\n this.screen.remove(uiBox.box);\n uiBox = null;\n delete this.uiBoxes[uiBoxIds[i]];\n }\n }\n }\n\n const touched: Record<string, boolean> = { };\n\n for (let i=0; i < (this.uidata.grid.cols * this.uidata.grid.rows); i++) {\n const gridPos = this.#cursor + i;\n const col = i % this.uidata.grid.cols;\n const row = Math.floor(i / this.uidata.grid.cols);\n\n // Get the panel for this position within the grid\n const panel: panel = this.uidata.panels[panelKeys[gridPos]];\n if (typeof panel !== 'undefined') {\n if (typeof this.uiBoxes[panel.id] === 'undefined') {\n // Update the panel position within the current screen view\n panel.pos = { row: row, col: col, rowSpan: 1, colSpan: 1 };\n\n const calculatedBoxPos = this.#CalcBoxPos(panel);\n if (!calculatedBoxPos) {\n return\n }\n const { top, left, width, height } = this.#CalcBoxPos(panel) as boxPos;\n\n // Create the UI box\n const box: stsBlessed.box = blessed.box({\n parent: this.screen,\n top: top,\n left: left,\n width: width,\n height: height,\n style:\n {\n bg: '#101010' // was gray\n ,fg: 'white'\n },\n border:\n {\n type: 'line'\n },\n keys: false, // Do not allow default key handling for this box\n tags: true // Allow style in-line tags such as bolt, italics, etc.\n });\n\n const boxHeader: stsBlessed.listbar = blessed.box({\n parent: this.screen,\n top: top,\n left: left+2,\n width: 'shrink',\n height: 1,\n style:\n {\n bg: 'gray'\n , fg: 'white'\n },\n keys: false, // Do not allow default key handling for this box\n mouse: false,\n content: panel.panelHeader,\n tags: true // Allow style in-line tags such as bolt, italics, etc.\n });\n\n this.uiBoxes[panel.id] = { box: box, boxHeader: boxHeader };\n\n boxHeader.setIndex(-1);\n\n // https://stackoverflow.com/questions/20279484/how-to-access-the-correct-this-inside-a-callback\n box.on('click', () => {\n //this.emit('click', box.data.panel);\n this.emit('click', box.get('panel') as panel);\n //this.ClickEx(box.get('panel') as panel);\n });\n\n if (typeof panel.widgets !== 'undefined' && panel.widgets !== null) {\n for (const [, value] of Object.entries(panel.widgets)) {\n // Create a fresh copy of the options for this widget instance.\n // If this is not done, all widgets will use the same options object and will not be able\n // to update screen elements individually.\n const widgetoptions = {...value.options};\n\n // Ensure that we always show at least 2 lines of log data even if this means we position over the top of\n // elements above this position.\n if (widgetoptions.top && (widgetoptions.top >= (box.height - 3))) {\n widgetoptions.top = box.height - 4;\n }\n const widget: stsBlessed.element = blessed[value.widget].call(this, widgetoptions);\n widget.set('id', uuidv4());\n box.append(widget);\n box.set(value.widget, widget); // Set the user data for this widget. This allows the handlebars template access via the name from the box object.\n }\n }\n\n // The entire panel is accessible using the _panel property.\n // This is so that the model is accessible from within the handlebars templates.\n // Access to a named widget can be done using box._panel.widgets[name] or box._panel.widgets.name\n box.set('panel', panel);\n\n this.uiBoxes[panel.id].box = box;\n\n touched[panel.id] = true;\n } else {\n //@@ need to hide previous positions\n //@@ and show ones that are visible\n this.#UpdatePanelPosition(panel, row, col, this.uiBoxes[panel.id]);\n\n touched[panel.id] = true;\n //this.#uiBox[panel.id].box.show();\n }\n\n // Render the uiBox with the renderPanelFn using the panel as the utility including the model\n if (this.#renderPanelFn) {\n this.#renderPanelFn(this.uiBoxes[panel.id].box, panel);\n }\n }\n }\n\n for (const [key, ] of Object.entries(this.uiBoxes)) {\n if (typeof touched[key] === 'undefined') {\n this.uiBoxes[key].box.hide();\n this.uiBoxes[key].boxHeader.hide();\n } else {\n this.uiBoxes[key].box.show();\n this.uiBoxes[key].boxHeader.show();\n }\n }\n\n }\n\n get gridData(): gridData {\n return this.uidata;\n }\n\n set gridData(gridData: gridData) {\n this.uidata = gridData;\n this.#SetupPanels();\n this.UpdateCursorInfo();\n this.Render();\n }\n\n get gridDataPanels(): panels {\n return this.uidata.panels;\n }\n\n set gridDataPanels(gridDataPanels: panels) {\n this.uidata.panels = gridDataPanels;\n this.#SetupPanels();\n this.UpdateCursorInfo();\n this.Render();\n }\n\n /*\n ExitEx() {\n //@@ override in sub-class\n }\n\n EscapeEx() {\n //@@ override in sub-class\n }\n */\n\n // https://www.npmjs.com/package/blessed\n\n // data:= { title: <str>,\n // grid: { rows: <int>, cols: <int> }, \n // menu: [ { top: <bool>, menuitems: [ { text: <string>, key: <string>, cb: <func> } ] } ]\n // panels: [ { id: <str>, pos: { row: <int>, col: <int>, rowSpan: <int>, colSpan: <int> }, template: <str> } ] }\n /**\n * \n * @param {*} data UI Data\n */\n SetupUI = (): void => {\n this.DestroyUI();\n\n if (this.screen === null) {\n // Create a screen object.\n this.screen = blessed.screen({\n smartCSR: true\n });\n }\n\n if (!this.screen) {\n return;\n }\n\n const data = this.uidata;\n this.screen.title = data.title;\n this.screen.on('resize', () => {\n this.#ReSize();\n this.Render();\n });\n\n if (data.menu !== null) {\n for (let i = 0; i < data.menu.length; i++) {\n new MenuBar.MenuBar(this.screen, data.menu[i]);\n }\n }\n\n // Allow the serrvice to terminate by pressing Control-C.\n this.screen.key(['C-c'], (): void => {\n this.DestroyUI();\n this.emit('exit');\n //this.ExitEx();\n // Cleanly shutdown the main process. Exit code success (> 0 is exit in error state)\n //setTimeout(() => process.kill(process.pid), 0);\n });\n\n this.screen.key(['escape'], (): void => {\n this.emit('escape');\n //this.EscapeEx();\n // Cleanly shutdown the main process. Exit code success (> 0 is exit in error state)\n //setTimeout(() => process.kill(process.pid), 0);\n });\n\n this.#SetupPanels();\n\n this.#cursorInfo = blessed.box({\n parent: this.screen,\n bottom: 0,\n right: 0,\n width: 'shrink',\n height: 1,\n style:\n {\n bg: 'gray'\n , fg: 'white'\n },\n keys: false, // Do not allow default key handling for this box\n mouse: false,\n content: '',\n tags: true // Allow style in-line tags such as bolt, italics, etc.\n });\n\n this.sortInfo = blessed.box({\n parent: this.screen,\n top: 0,\n right: 0,\n width: 'shrink',\n height: 1,\n style:\n {\n bg: 'gray'\n , fg: 'white'\n },\n keys: false, // Do not allow default key handling for this box\n mouse: false,\n content: '',\n tags: true // Allow style in-line tags such as bolt, italics, etc.\n });\n\n\n this.screenHeader = blessed.box({\n parent: this.screen,\n top: 0,\n left: 'center',\n width: 'shrink',\n height: 1,\n style:\n {\n bg: 'gray'\n , fg: 'white'\n },\n keys: false, // Do not allow default key handling for this box\n mouse: false,\n content: `[ ... ]`,\n tags: true // Allow style in-line tags such as bolt, italics, etc.\n });\n\n this.UpdateCursorInfo();\n this.UpdateSortInfo('Default');\n this.UpdateScreenHeader(this.screenHeaderText);\n\n // Render the screen.\n this.Render();\n }\n\n UpdateCursorInfo = (): void => {\n if (this.#cursorInfo) {\n this.#cursorInfo.setContent(`Cursor: ${this.#cursor} / ${this.TotalPanelNumber}`);\n }\n }\n\n UpdateSortInfo = (sortMode: string): void => {\n if (this.sortInfo) {\n this.sortInfo.setContent(`Sort: ${sortMode}`);\n }\n }\n\n UpdateScreenHeader = (screenHeaderText: string): void => {\n this.screenHeaderText = screenHeaderText;\n if (this.screenHeader) {\n this.screenHeader.setContent(`[ ${screenHeaderText} ]`);\n }\n }\n\n get rows(): number {\n return this.uidata.grid.rows;\n }\n\n get cols(): number {\n return this.uidata.grid.cols;\n }\n\n IncRows = (): void => {\n if (this.screen && (this.screen.height / (this.uidata.grid.rows+1) > this.minHeight)) {\n this.uidata.grid.rows++;\n this.CheckCursor();\n this.#UpdateUI();\n }\n }\n\n DecRows = (): void => {\n if (this.uidata.grid.rows > this.minRows) {\n this.uidata.grid.rows--;\n this.CheckCursor();\n this.#UpdateUI();\n }\n }\n\n IncCols = (): void => {\n if (this.screen && (this.screen.width / (this.uidata.grid.cols+1) > this.minWidth)) {\n this.uidata.grid.cols++;\n this.CheckCursor();\n this.#UpdateUI();\n }\n }\n\n DecCols = (): void => {\n if (this.uidata.grid.cols > this.minCols) {\n this.uidata.grid.cols--;\n this.CheckCursor();\n this.#UpdateUI();\n }\n }\n\n get ScreenCells(): number {\n return this.uidata.grid.cols * this.uidata.grid.rows;\n }\n\n get TotalPanelNumber(): number {\n return Object.keys(this.uidata.panels).length;\n }\n\n CheckCursor = (): void => {\n if (this.#cursor > (this.TotalPanelNumber - this.ScreenCells)) {\n this.#cursor = this.TotalPanelNumber - this.ScreenCells;\n if (this.#cursor < 0) {\n this.#cursor = 0;\n }\n }\n this.UpdateCursorInfo();\n }\n\n NextPage = (): void => {\n const endpos = this.TotalPanelNumber - this.ScreenCells;\n if (this.#cursor < endpos) {\n this.#cursor += this.ScreenCells;\n if (this.#cursor > endpos) {\n this.#cursor = endpos;\n }\n this.#UpdateUI();\n }\n }\n\n PrevPage = (): void => {\n if (this.#cursor > 0) {\n this.#cursor -= this.ScreenCells;\n if (this.#cursor < 0) {\n this.#cursor = 0;\n }\n this.#UpdateUI();\n }\n }\n\n #UpdateUI(): void {\n this.SetupUI();\n\n //@@ fix screen render - should not need to blow entire screen away ...\n //this.#SetupPanels();\n //this.UpdateCursorInfo();\n //this.Render();\n }\n\n Exit = (): void => {\n this.DestroyUI();\n this.emit('exit');\n //this.ExitEx();\n }\n\n /**\n * \n */\n DestroyUI = (): void => {\n // Destroy the screen and disable UI log processing\n if (this.screen !== null) {\n this.uiBoxes = { };\n this.screen.destroy();\n this.screen = null;\n }\n }\n\n /**\n * Render the screen.\n */\n Render = (): void => {\n if (this.screen) {\n this.screen.render();\n }\n }\n}\n"],"names":["MenuBar","screen","options","__publicField","compoptions","menuItem","blessed","STSUIFrame","EventEmitter","data","renderPanelFn","__privateAdd","_SetupPanels","_UpdateUI","_cursor","_renderPanelFn","_cursorInfo","_CalcBoxPos","panel","screenHeight","screenWidth","rows","cols","pos","colWidth","rowHeight","topoffset","value","boxPos","_UpdateUIBoxPos","uiBox","__privateGet","widget","_ReSize","_UpdatePanelPosition","row","col","i","MenuBar.MenuBar","__privateMethod","SetupPanels_fn","__privateSet","sortMode","screenHeaderText","UpdateUI_fn","endpos","gridData","gridDataPanels","panelKeys","uiBoxIds","touched","gridPos","top","left","width","height","box","boxHeader","widgetoptions","uuidv4","key"],"mappings":";;;;;;;;;;;;;;;;AAcO,MAAMA,EACb;AAAA;AAAA,EAII,YAAYC,GAA2BC,GAAyB;AAHxD,IAAAC,EAAA,eAAkC;AAItC,UAAMC,IAAyC;AAAA,MAC3C,QAAQH;AAAA,MACR,MAAM;AAAA,MACN,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,OAAO;AAAA,MACP,MAAM;AAAA,MACN,iBAAiB;AAAA,MACjB,YAAY;AAAA,MACZ,OAAO;AAAA,QACH,IAAI;AAAA,QACJ,IAAI;AAAA,QAEJ,MAAM;AAAA,UACF,OAAO;AAAA,YACH,IAAI;AAAA,YACJ,IAAI;AAAA,UACR;AAAA,QACJ;AAAA,QACA,UAAU;AAAA,UACN,IAAI;AAAA,UACJ,IAAI;AAAA,QACR;AAAA,MACJ;AAAA,IAAA;AAEA,IAAAC,EAAQ,QAAQ,KAChBE,EAAY,MAAM,IAElBA,EAAY,SAAS,GAGzBA,EAAY,WAAW,IACfF,EAAA,UAAU,QAAQ,CAACG,MAAa;AACpC,MAAID,EAAY,aACAA,EAAA,SAASC,EAAS,IAAI,IAAI;AAAA,QAClC,MAAM,CAAEA,EAAS,GAAI;AAAA,QACrB,UAAUA,EAAS;AAAA,MAAA;AAAA,IAE3B,CACH,GAEI,KAAA,QAAQC,EAAQ,QAAQF,CAAW;AAAA,EAC5C;AAAA,EAEA,IAAI,UACJ;AACI,WAAO,KAAK;AAAA,EAChB;AACJ;;ACAO,MAAMG,UAAmBC,EAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA0BzC,YAAYC,GAAgBC,IAAsC,MAAM;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QK,CAAM;AAAA;AAOhC,QAAAwB,EAAA,IAAI,SAAStC,CAAK,GAEtB,KAAK,QAAQA,EAAM,EAAE,EAAE,MAAMsC,GAErBN,EAAAhC,EAAM,EAAE,IAAI;AAAA;AAIf,QAAAa,EAAA,MAAAG,GAAA,WAAqBhB,GAAOiB,GAAKC,GAAK,KAAK,QAAQlB,EAAM,EAAE,IAExDgC,EAAAhC,EAAM,EAAE,IAAI;AAKxB,MAAIa,EAAA,MAAKhB,MACLgB,EAAA,MAAKhB,GAAL,WAAoB,KAAK,QAAQG,EAAM,EAAE,EAAE,KAAKA;AAAA;AAAA;AAK5D,aAAW,CAAC0C,CAAK,KAAK,OAAO,QAAQ,KAAK,OAAO;AAC7C,IAAI,OAAOV,EAAQU,CAAG,IAAM,OACxB,KAAK,QAAQA,CAAG,EAAE,IAAI,KAAK,GAC3B,KAAK,QAAQA,CAAG,EAAE,UAAU,KAAK,MAEjC,KAAK,QAAQA,CAAG,EAAE,IAAI,KAAK,GAC3B,KAAK,QAAQA,CAAG,EAAE,UAAU,KAAK;AAI7C,GAuPA/C,IAAA,eAAA+B,IAAkB,WAAA;AACd,OAAK,QAAQ;AAMjB;"}
|
package/dist/stsconfig.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(i
|
|
1
|
+
(function(s,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("node:events"),require("blessed"),require("colors"),require("uuid")):typeof define=="function"&&define.amd?define(["exports","node:events","blessed","colors","uuid"],i):(s=typeof globalThis<"u"?globalThis:s||self,i(s["@nsshunt/stsconfig"]={},s.events,s.blessed,null,s.uuid))})(this,function(s,i,r,D,$){var l,m,y,C,U,H,P,S,T,p,x;"use strict";var A=Object.defineProperty;var G=(s,i,r)=>i in s?A(s,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[i]=r;var n=(s,i,r)=>(G(s,typeof i!="symbol"?i+"":i,r),r),M=(s,i,r)=>{if(!i.has(s))throw TypeError("Cannot "+r)};var a=(s,i,r)=>(M(s,i,"read from private field"),r?r.call(s):i.get(s)),f=(s,i,r)=>{if(i.has(s))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(s):i.set(s,r)},b=(s,i,r,D)=>(M(s,i,"write to private field"),D?D.call(s,r):i.set(s,r),r);var g=(s,i,r)=>(M(s,i,"access private method"),r);class N{constructor(q,t){n(this,"listb",null);const e={parent:q,left:0,right:0,height:1,width:"shrink",mouse:!0,keys:!0,autoCommandKeys:!0,scrollable:!0,style:{fg:"yellow",bg:"blue",item:{hover:{fg:"white",bg:"green"}},selected:{fg:"black",bg:"yellow"}}};t.top===!0?e.top=0:e.bottom=0,e.commands={},t.menuitems.forEach(d=>{e.commands&&(e.commands[d.text]={keys:[d.key],callback:d.cb})}),this.listb=r.listbar(e)}get listbar(){return this.listb}}class F extends i{constructor(t,e=null){super();f(this,S);f(this,p);n(this,"uiBoxes",{});n(this,"screen",null);f(this,l,0);f(this,m,null);n(this,"screenHeaderText","...");n(this,"minRows",1);n(this,"minCols",1);n(this,"minWidth",40);n(this,"minHeight",7);f(this,y,null);n(this,"sortInfo",null);n(this,"screenHeader",null);n(this,"uidata");f(this,C,t=>{if(!this.screen||!t.pos)return null;let e=this.screen.height;this.uidata.menu!==null&&(e-=this.uidata.menu.length);const d=this.screen.width,o=this.uidata.grid.rows,u=this.uidata.grid.cols,c=t.pos,k=Math.floor(d/u),h=Math.floor(e/o);let R=0;if(this.uidata.menu!==null){for(const[,B]of Object.entries(this.uidata.menu))if(B.top===!0){R=1;break}}const I={top:c.row*h+R,left:c.col*k,width:k*c.colSpan,height:h*c.rowSpan};return c.col+c.colSpan===u&&(I.width=d-c.col*k),c.row+c.rowSpan===o&&(I.height=e-c.row*h),I});f(this,U,(t,e)=>{const d=a(this,C).call(this,t);if(d&&(e.box.top=d.top,e.box.left=d.left,e.box.width=d.width,e.box.height=d.height,e.boxHeader.top=d.top,e.boxHeader.left=d.left+2,typeof t.widgets<"u"&&t.widgets!==null)){for(const[,o]of Object.entries(t.widgets))if(o.widget==="log"){const u=e.box.get(o.widget);u.position.top>=e.box.height-4?u.position.top=e.box.height-4:o.options.top&&(u.position.top=o.options.top)}}});f(this,H,()=>{for(const[,t]of Object.entries(this.uiBoxes))a(this,U).call(this,t.box.get("panel"),t)});f(this,P,(t,e,d,o)=>{t.pos={row:e,col:d,rowSpan:1,colSpan:1},a(this,U).call(this,t,o),o.boxHeader.setContent(t.panelHeader)});n(this,"SetupUI",()=>{if(this.DestroyUI(),this.screen===null&&(this.screen=r.screen({smartCSR:!0})),!this.screen)return;const t=this.uidata;if(this.screen.title=t.title,this.screen.on("resize",()=>{a(this,H).call(this),this.Render()}),t.menu!==null)for(let e=0;e<t.menu.length;e++)new N(this.screen,t.menu[e]);this.screen.key(["C-c"],()=>{this.DestroyUI(),this.emit("exit")}),this.screen.key(["escape"],()=>{this.emit("escape")}),g(this,S,T).call(this),b(this,y,r.box({parent:this.screen,bottom:0,right:0,width:"shrink",height:1,style:{bg:"gray",fg:"white"},keys:!1,mouse:!1,content:"",tags:!0})),this.sortInfo=r.box({parent:this.screen,top:0,right:0,width:"shrink",height:1,style:{bg:"gray",fg:"white"},keys:!1,mouse:!1,content:"",tags:!0}),this.screenHeader=r.box({parent:this.screen,top:0,left:"center",width:"shrink",height:1,style:{bg:"gray",fg:"white"},keys:!1,mouse:!1,content:"[ ... ]",tags:!0}),this.UpdateCursorInfo(),this.UpdateSortInfo("Default"),this.UpdateScreenHeader(this.screenHeaderText),this.Render()});n(this,"UpdateCursorInfo",()=>{a(this,y)&&a(this,y).setContent(`Cursor: ${a(this,l)} / ${this.TotalPanelNumber}`)});n(this,"UpdateSortInfo",t=>{this.sortInfo&&this.sortInfo.setContent(`Sort: ${t}`)});n(this,"UpdateScreenHeader",t=>{this.screenHeaderText=t,this.screenHeader&&this.screenHeader.setContent(`[ ${t} ]`)});n(this,"IncRows",()=>{this.screen&&this.screen.height/(this.uidata.grid.rows+1)>this.minHeight&&(this.uidata.grid.rows++,this.CheckCursor(),g(this,p,x).call(this))});n(this,"DecRows",()=>{this.uidata.grid.rows>this.minRows&&(this.uidata.grid.rows--,this.CheckCursor(),g(this,p,x).call(this))});n(this,"IncCols",()=>{this.screen&&this.screen.width/(this.uidata.grid.cols+1)>this.minWidth&&(this.uidata.grid.cols++,this.CheckCursor(),g(this,p,x).call(this))});n(this,"DecCols",()=>{this.uidata.grid.cols>this.minCols&&(this.uidata.grid.cols--,this.CheckCursor(),g(this,p,x).call(this))});n(this,"CheckCursor",()=>{a(this,l)>this.TotalPanelNumber-this.ScreenCells&&(b(this,l,this.TotalPanelNumber-this.ScreenCells),a(this,l)<0&&b(this,l,0)),this.UpdateCursorInfo()});n(this,"NextPage",()=>{const t=this.TotalPanelNumber-this.ScreenCells;a(this,l)<t&&(b(this,l,a(this,l)+this.ScreenCells),a(this,l)>t&&b(this,l,t),g(this,p,x).call(this))});n(this,"PrevPage",()=>{a(this,l)>0&&(b(this,l,a(this,l)-this.ScreenCells),a(this,l)<0&&b(this,l,0),g(this,p,x).call(this))});n(this,"Exit",()=>{this.DestroyUI(),this.emit("exit")});n(this,"DestroyUI",()=>{this.screen!==null&&(this.uiBoxes={},this.screen.destroy(),this.screen=null)});n(this,"Render",()=>{this.screen&&this.screen.render()});this.uidata=t,b(this,m,e),this.SetupUI()}get gridData(){return this.uidata}set gridData(t){this.uidata=t,g(this,S,T).call(this),this.UpdateCursorInfo(),this.Render()}get gridDataPanels(){return this.uidata.panels}set gridDataPanels(t){this.uidata.panels=t,g(this,S,T).call(this),this.UpdateCursorInfo(),this.Render()}get rows(){return this.uidata.grid.rows}get cols(){return this.uidata.grid.cols}get ScreenCells(){return this.uidata.grid.cols*this.uidata.grid.rows}get TotalPanelNumber(){return Object.keys(this.uidata.panels).length}}l=new WeakMap,m=new WeakMap,y=new WeakMap,C=new WeakMap,U=new WeakMap,H=new WeakMap,P=new WeakMap,S=new WeakSet,T=function(){if(!this.screen)return;const t=Object.keys(this.uidata.panels),e=Object.keys(this.uiBoxes);for(let o=0;o<e.length;o++)if(typeof this.uidata.panels[e[o]]>"u"){let u=this.uiBoxes[e[o]];typeof u<"u"&&(this.screen.remove(u.boxHeader),this.screen.remove(u.box),u=null,delete this.uiBoxes[e[o]])}const d={};for(let o=0;o<this.uidata.grid.cols*this.uidata.grid.rows;o++){const u=a(this,l)+o,c=o%this.uidata.grid.cols,k=Math.floor(o/this.uidata.grid.cols),h=this.uidata.panels[t[u]];if(typeof h<"u"){if(typeof this.uiBoxes[h.id]>"u"){if(h.pos={row:k,col:c,rowSpan:1,colSpan:1},!a(this,C).call(this,h))return;const{top:I,left:B,width:E,height:K}=a(this,C).call(this,h),w=r.box({parent:this.screen,top:I,left:B,width:E,height:K,style:{bg:"#101010",fg:"white"},border:{type:"line"},keys:!1,tags:!0}),W=r.box({parent:this.screen,top:I,left:B+2,width:"shrink",height:1,style:{bg:"gray",fg:"white"},keys:!1,mouse:!1,content:h.panelHeader,tags:!0});if(this.uiBoxes[h.id]={box:w,boxHeader:W},W.setIndex(-1),w.on("click",()=>{this.emit("click",w.get("panel"))}),typeof h.widgets<"u"&&h.widgets!==null)for(const[,j]of Object.entries(h.widgets)){const v={...j.options};v.top&&v.top>=w.height-3&&(v.top=w.height-4);const O=r[j.widget].call(this,v);O.set("id",$.v4()),w.append(O),w.set(j.widget,O)}w.set("panel",h),this.uiBoxes[h.id].box=w,d[h.id]=!0}else a(this,P).call(this,h,k,c,this.uiBoxes[h.id]),d[h.id]=!0;a(this,m)&&a(this,m).call(this,this.uiBoxes[h.id].box,h)}}for(const[o]of Object.entries(this.uiBoxes))typeof d[o]>"u"?(this.uiBoxes[o].box.hide(),this.uiBoxes[o].boxHeader.hide()):(this.uiBoxes[o].box.show(),this.uiBoxes[o].boxHeader.show())},p=new WeakSet,x=function(){this.SetupUI()},s.MenuBar=N,s.STSUIFrame=F,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
|
|
2
2
|
//# sourceMappingURL=stsconfig.umd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stsconfig.umd.js","sources":["../__vite-browser-external","../src/menubar.ts","../src/stsuiframe.ts"],"sourcesContent":["export default {}","import blessed from 'blessed';\nimport * as stsBlessed from './index'\n\nexport interface menuitem {\n\ttext: string,\n\tkey: string,\n\tcb(): void\n}\n\nexport interface MenuBarOptions {\n\ttop: boolean\n\tmenuitems: menuitem[]\n}\n\nexport class MenuBar\n{\n private listb:stsBlessed.listbar | null = null;\n\n // options := { screen: <blessed screen>, top: <bool>, menuitems: [ { text: <string>, key: <string>, cb: <call back func> } ] }\n constructor(screen: stsBlessed.screen, options: MenuBarOptions) {\n const compoptions: stsBlessed.elementOptions = {\n parent: screen,\n left: 0,\n right: 0,\n height: 1,\n width: 'shrink',\n mouse: true,\n keys: true,\n autoCommandKeys: true,\n scrollable: true,\n style: {\n fg: 'yellow',\n bg: 'blue',\n\n item: {\n hover: {\n fg: 'white',\n bg: 'green',\n }\n },\n selected: {\n fg: 'black',\n bg: 'yellow',\n }\n }\n }\n if (options.top === true) {\n compoptions.top = 0;\n } else {\n compoptions.bottom = 0;\n }\n\n compoptions.commands = { };\n options.menuitems.forEach((menuItem) => {\n if (compoptions.commands) {\n compoptions.commands[menuItem.text] = {\n keys: [ menuItem.key ],\n callback: menuItem.cb\n }\n }\n })\n\n this.listb = blessed.listbar(compoptions);\n }\n\n get listbar()\n {\n return this.listb;\n }\n}\n","import EventEmitter from 'node:events'\n\n// https://github.com/yaronn/blessed-contrib\n//var contrib = require('blessed-contrib');\nimport blessed from 'blessed';\n\nimport 'colors';\n\nimport { v4 as uuidv4 } from 'uuid';\n\nimport * as stsBlessed from './index'\nimport * as MenuBar from './menubar'\n\nexport type menuOptions = MenuBar.MenuBarOptions[]\n\nexport interface widget {\n widget: string // Name of the blessed widget\n options: stsBlessed.elementOptions // blessed widget options - used in the constructor of the blessed widget\n}\n\nexport interface widgets {\n [widgetName: string]: widget\n}\n\nexport interface panel {\n id: string,\n pos?: {\n row: number,\n col: number,\n rowSpan: number,\n colSpan: number\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data: any\n panelHeader: string,\n widgets: widgets\n}\n\nexport interface panels {\n [panelId: string]: panel\n}\n\nexport interface gridData {\n\ttitle: string\n\tgrid: { rows: number, cols: number },\n\tmenu: menuOptions,\n\tpanels: panels\n}\n\nexport interface renderPanelCb {\n\t(box: stsBlessed.box, panel: panel): void\n}\n\nexport interface boxPos {\n\ttop: number,\n\tleft: number,\n\twidth: number,\n\theight: number\n}\n\nexport interface uiBox {\n\tbox: stsBlessed.box, // blessed box\n\tboxHeader: stsBlessed.listbar // blessed box\n}\n\nexport interface uiBoxes {\n\t[key: string]: uiBox\n}\n\nexport class STSUIFrame extends EventEmitter {\n//export class STSUIFrame {\n private uiBoxes:uiBoxes = { }; // { box: <<blessed box>>, boxHeader: <<blessed box>> }\n private screen: stsBlessed.screen | null = null;\n #cursor = 0; // panel index with the complete model data.\n #renderPanelFn: renderPanelCb | null = null;\n private screenHeaderText = '...';\n\n private minRows = 1;\n private minCols = 1;\n private minWidth = 40;\n private minHeight = 7;\n\n #cursorInfo: stsBlessed.box | null = null;\n private sortInfo: stsBlessed.box | null = null; // Current sort mode UI box control\n private screenHeader: stsBlessed.box | null = null;\n\n private uidata: gridData;\n\n /**\n * \n * @param {*} data The screen layout data. Schema: { title: <str>,\n * grid: { rows: <int>, cols: <int> }, \n * panels: [ { id: <str>, pos: { row: <int>, col: <int>, rowSpan: <int>, colSpan: <int> }, \n * template: <handlebars func>, widgets: { [ { <prop_name>: <blessed widget> } ] } } ] }\n */\n constructor(data: gridData, renderPanelFn: renderPanelCb | null = null) {\n super();\n this.uidata = data;\n this.#renderPanelFn = renderPanelFn;\n this.SetupUI();\n }\n\n /**\n * \n * @param {number} position The index (0 based) for the panel item to be calculated\n * @returns object with top, left, width and height correctly set\n */\n #CalcBoxPos = (panel: panel): boxPos | null => {\n // Calculate the position and dimensions for this UI element\n\n if (!this.screen) return null;\n if (!panel.pos) return null;\n\n let screenHeight = this.screen.height;\n if (this.uidata.menu !== null) {\n screenHeight -= this.uidata.menu.length; // Allow for any menu items\n }\n const screenWidth = this.screen.width;\n\n const rows = this.uidata.grid.rows;\n const cols = this.uidata.grid.cols;\n\n const pos = panel.pos;\n\n const colWidth = Math.floor(screenWidth / cols);\n const rowHeight = Math.floor(screenHeight / rows);\n\n // Allow for a top offset if a top menu is present\n let topoffset = 0;\n if (this.uidata.menu !== null) {\n for (const [, value] of Object.entries(this.uidata.menu)) {\n if (value.top === true) {\n topoffset = 1;\n break;\n }\n }\n }\n\n const boxPos: boxPos = {\n top: (pos.row * rowHeight) + topoffset,\n left: pos.col * colWidth,\n width: colWidth * pos.colSpan,\n height: rowHeight * pos.rowSpan\n }\n\n // Now check if this panel is on the far right and if so adjust for a perfect fit\n\n if ((pos.col + pos.colSpan) === cols) {\n //if (pos.col === (cols - 1)) {\n boxPos.width = screenWidth - (pos.col * colWidth);\n }\n\n // Now check if this panel is on the bottom and if so adjust for a perfect fit\n if ((pos.row + pos.rowSpan) === rows) {\n boxPos.height = screenHeight - (pos.row * rowHeight);\n }\n\n return boxPos;\n }\n\n #UpdateUIBoxPos = (panel: panel, uiBox: uiBox): void => {\n const pos: boxPos | null = this.#CalcBoxPos(panel);\n if (!pos) {\n return;\n }\n\n uiBox.box.top = pos.top;\n uiBox.box.left = pos.left;\n uiBox.box.width = pos.width;\n uiBox.box.height = pos.height;\n\n uiBox.boxHeader.top = pos.top;\n uiBox.boxHeader.left = pos.left + 2;\n\n if (typeof panel.widgets !== 'undefined' && panel.widgets !== null) {\n for (const [, value] of Object.entries(panel.widgets)) {\n if (value.widget === 'log') {\n const widget = uiBox.box.get(value.widget) as stsBlessed.element;\n if (widget.position.top >= (uiBox.box.height - 4)) {\n widget.position.top = uiBox.box.height - 4;\n } else {\n if (value.options.top) {\n widget.position.top = value.options.top;\n }\n }\n }\n }\n }\n };\n\n /**\n * ReSize the grid layout\n */\n #ReSize = (): void => {\n for (const [, value] of Object.entries(this.uiBoxes)) {\n this.#UpdateUIBoxPos(value.box.get('panel') as panel, value);\n }\n }\n\n #UpdatePanelPosition = (panel: panel, row: number, col: number, uiBox: uiBox): void => {\n // Update the panel position within the current screen view\n panel.pos = { row: row, col: col, rowSpan: 1, colSpan: 1 };\n this.#UpdateUIBoxPos(panel, uiBox);\n uiBox.boxHeader.setContent(panel.panelHeader);\n }\n\n /*\n ClickEx(panel: any) {\n //@@ override in sub-class\n }\n */\n\n /**\n * \n * Setup all panels\n */\n #SetupPanels(): void {\n if (!this.screen) {\n return;\n }\n\n const panelKeys = Object.keys(this.uidata.panels);\n\n // Check for deleted panels\n const uiBoxIds = Object.keys(this.uiBoxes);\n for (let i=0; i < uiBoxIds.length; i++) {\n if (typeof this.uidata.panels[uiBoxIds[i]] === 'undefined') {\n let uiBox: uiBox | null = this.uiBoxes[uiBoxIds[i]];\n if (typeof uiBox !== 'undefined') {\n this.screen.remove(uiBox.boxHeader);\n this.screen.remove(uiBox.box);\n uiBox = null;\n delete this.uiBoxes[uiBoxIds[i]];\n }\n }\n }\n\n const touched: Record<string, boolean> = { };\n\n for (let i=0; i < (this.uidata.grid.cols * this.uidata.grid.rows); i++) {\n const gridPos = this.#cursor + i;\n const col = i % this.uidata.grid.cols;\n const row = Math.floor(i / this.uidata.grid.cols);\n\n // Get the panel for this position within the grid\n const panel: panel = this.uidata.panels[panelKeys[gridPos]];\n if (typeof panel !== 'undefined') {\n if (typeof this.uiBoxes[panel.id] === 'undefined') {\n // Update the panel position within the current screen view\n panel.pos = { row: row, col: col, rowSpan: 1, colSpan: 1 };\n\n const calculatedBoxPos = this.#CalcBoxPos(panel);\n if (!calculatedBoxPos) {\n return\n }\n const { top, left, width, height } = this.#CalcBoxPos(panel) as boxPos;\n\n // Create the UI box\n const box: stsBlessed.box = blessed.box({\n parent: this.screen,\n top: top,\n left: left,\n width: width,\n height: height,\n style:\n {\n bg: '#101010' // was gray\n ,fg: 'white'\n },\n border:\n {\n type: 'line'\n },\n keys: false, // Do not allow default key handling for this box\n tags: true // Allow style in-line tags such as bolt, italics, etc.\n });\n\n const boxHeader: stsBlessed.listbar = blessed.box({\n parent: this.screen,\n top: top,\n left: left+2,\n width: 'shrink',\n height: 1,\n style:\n {\n bg: 'gray'\n , fg: 'white'\n },\n keys: false, // Do not allow default key handling for this box\n mouse: false,\n content: panel.panelHeader,\n tags: true // Allow style in-line tags such as bolt, italics, etc.\n });\n\n this.uiBoxes[panel.id] = { box: box, boxHeader: boxHeader };\n\n boxHeader.setIndex(-1);\n\n // https://stackoverflow.com/questions/20279484/how-to-access-the-correct-this-inside-a-callback\n box.on('click', () => {\n //this.emit('click', box.data.panel);\n this.emit('click', box.get('panel') as panel);\n //this.ClickEx(box.get('panel') as panel);\n });\n\n if (typeof panel.widgets !== 'undefined' && panel.widgets !== null) {\n for (const [, value] of Object.entries(panel.widgets)) {\n // Create a fresh copy of the options for this widget instance.\n // If this is not done, all widgets will use the same options object and will not be able\n // to update screen elements individually.\n const widgetoptions = {...value.options};\n\n // Ensure that we always show at least 2 lines of log data even if this means we position over the top of\n // elements above this position.\n if (widgetoptions.top && (widgetoptions.top >= (box.height - 3))) {\n widgetoptions.top = box.height - 4;\n }\n const widget: stsBlessed.element = blessed[value.widget].call(this, widgetoptions);\n widget.set('id', uuidv4());\n box.append(widget);\n box.set(value.widget, widget); // Set the user data for this widget. This allows the handlebars template access via the name from the box object.\n }\n }\n\n // The entire panel is accessible using the _panel property.\n // This is so that the model is accessible from within the handlebars templates.\n // Access to a named widget can be done using box._panel.widgets[name] or box._panel.widgets.name\n box.set('panel', panel);\n\n this.uiBoxes[panel.id].box = box;\n\n touched[panel.id] = true;\n } else {\n //@@ need to hide previous positions\n //@@ and show ones that are visible\n this.#UpdatePanelPosition(panel, row, col, this.uiBoxes[panel.id]);\n\n touched[panel.id] = true;\n //this.#uiBox[panel.id].box.show();\n }\n\n // Render the uiBox with the renderPanelFn using the panel as the utility including the model\n if (this.#renderPanelFn) {\n this.#renderPanelFn(this.uiBoxes[panel.id].box, panel);\n }\n }\n }\n\n for (const [key, ] of Object.entries(this.uiBoxes)) {\n if (typeof touched[key] === 'undefined') {\n this.uiBoxes[key].box.hide();\n this.uiBoxes[key].boxHeader.hide();\n } else {\n this.uiBoxes[key].box.show();\n this.uiBoxes[key].boxHeader.show();\n }\n }\n\n }\n\n get gridData(): gridData {\n return this.uidata;\n }\n\n set gridData(gridData: gridData) {\n this.uidata = gridData;\n this.#SetupPanels();\n this.UpdateCursorInfo();\n this.Render();\n }\n\n get gridDataPanels(): panels {\n return this.uidata.panels;\n }\n\n set gridDataPanels(gridDataPanels: panels) {\n this.uidata.panels = gridDataPanels;\n this.#SetupPanels();\n this.UpdateCursorInfo();\n this.Render();\n }\n\n /*\n ExitEx() {\n //@@ override in sub-class\n }\n\n EscapeEx() {\n //@@ override in sub-class\n }\n */\n\n // https://www.npmjs.com/package/blessed\n\n // data:= { title: <str>,\n // grid: { rows: <int>, cols: <int> }, \n // menu: [ { top: <bool>, menuitems: [ { text: <string>, key: <string>, cb: <func> } ] } ]\n // panels: [ { id: <str>, pos: { row: <int>, col: <int>, rowSpan: <int>, colSpan: <int> }, template: <str> } ] }\n /**\n * \n * @param {*} data UI Data\n */\n SetupUI = (): void => {\n this.DestroyUI();\n\n if (this.screen === null) {\n // Create a screen object.\n this.screen = blessed.screen({\n smartCSR: true\n });\n }\n\n if (!this.screen) {\n return;\n }\n\n const data = this.uidata;\n this.screen.title = data.title;\n this.screen.on('resize', () => {\n this.#ReSize();\n this.Render();\n });\n\n if (data.menu !== null) {\n for (let i = 0; i < data.menu.length; i++) {\n new MenuBar.MenuBar(this.screen, data.menu[i]);\n }\n }\n\n // Allow the serrvice to terminate by pressing Control-C.\n this.screen.key(['C-c'], (): void => {\n this.DestroyUI();\n this.emit('exit');\n //this.ExitEx();\n // Cleanly shutdown the main process. Exit code success (> 0 is exit in error state)\n //setTimeout(() => process.kill(process.pid), 0);\n });\n\n this.screen.key(['escape'], (): void => {\n this.emit('escape');\n //this.EscapeEx();\n // Cleanly shutdown the main process. Exit code success (> 0 is exit in error state)\n //setTimeout(() => process.kill(process.pid), 0);\n });\n\n this.#SetupPanels();\n\n this.#cursorInfo = blessed.box({\n parent: this.screen,\n bottom: 0,\n right: 0,\n width: 'shrink',\n height: 1,\n style:\n {\n bg: 'gray'\n , fg: 'white'\n },\n keys: false, // Do not allow default key handling for this box\n mouse: false,\n content: '',\n tags: true // Allow style in-line tags such as bolt, italics, etc.\n });\n\n this.sortInfo = blessed.box({\n parent: this.screen,\n top: 0,\n right: 0,\n width: 'shrink',\n height: 1,\n style:\n {\n bg: 'gray'\n , fg: 'white'\n },\n keys: false, // Do not allow default key handling for this box\n mouse: false,\n content: '',\n tags: true // Allow style in-line tags such as bolt, italics, etc.\n });\n\n\n this.screenHeader = blessed.box({\n parent: this.screen,\n top: 0,\n left: 'center',\n width: 'shrink',\n height: 1,\n style:\n {\n bg: 'gray'\n , fg: 'white'\n },\n keys: false, // Do not allow default key handling for this box\n mouse: false,\n content: `[ ... ]`,\n tags: true // Allow style in-line tags such as bolt, italics, etc.\n });\n\n this.UpdateCursorInfo();\n this.UpdateSortInfo('Default');\n this.UpdateScreenHeader(this.screenHeaderText);\n\n // Render the screen.\n this.Render();\n }\n\n UpdateCursorInfo = (): void => {\n if (this.#cursorInfo) {\n this.#cursorInfo.setContent(`Cursor: ${this.#cursor} / ${this.TotalPanelNumber}`);\n }\n }\n\n UpdateSortInfo = (sortMode: string): void => {\n if (this.sortInfo) {\n this.sortInfo.setContent(`Sort: ${sortMode}`);\n }\n }\n\n UpdateScreenHeader = (screenHeaderText: string): void => {\n this.screenHeaderText = screenHeaderText;\n if (this.screenHeader) {\n this.screenHeader.setContent(`[ ${screenHeaderText} ]`);\n }\n }\n\n get rows(): number {\n return this.uidata.grid.rows;\n }\n\n get cols(): number {\n return this.uidata.grid.cols;\n }\n\n IncRows = (): void => {\n if (this.screen && (this.screen.height / (this.uidata.grid.rows+1) > this.minHeight)) {\n this.uidata.grid.rows++;\n this.CheckCursor();\n this.#UpdateUI();\n }\n }\n\n DecRows = (): void => {\n if (this.uidata.grid.rows > this.minRows) {\n this.uidata.grid.rows--;\n this.CheckCursor();\n this.#UpdateUI();\n }\n }\n\n IncCols = (): void => {\n if (this.screen && (this.screen.width / (this.uidata.grid.cols+1) > this.minWidth)) {\n this.uidata.grid.cols++;\n this.CheckCursor();\n this.#UpdateUI();\n }\n }\n\n DecCols = (): void => {\n if (this.uidata.grid.cols > this.minCols) {\n this.uidata.grid.cols--;\n this.CheckCursor();\n this.#UpdateUI();\n }\n }\n\n get ScreenCells(): number {\n return this.uidata.grid.cols * this.uidata.grid.rows;\n }\n\n get TotalPanelNumber(): number {\n return Object.keys(this.uidata.panels).length;\n }\n\n CheckCursor = (): void => {\n if (this.#cursor > (this.TotalPanelNumber - this.ScreenCells)) {\n this.#cursor = this.TotalPanelNumber - this.ScreenCells;\n if (this.#cursor < 0) {\n this.#cursor = 0;\n }\n }\n this.UpdateCursorInfo();\n }\n\n NextPage = (): void => {\n const endpos = this.TotalPanelNumber - this.ScreenCells;\n if (this.#cursor < endpos) {\n this.#cursor += this.ScreenCells;\n if (this.#cursor > endpos) {\n this.#cursor = endpos;\n }\n this.#UpdateUI();\n }\n }\n\n PrevPage = (): void => {\n if (this.#cursor > 0) {\n this.#cursor -= this.ScreenCells;\n if (this.#cursor < 0) {\n this.#cursor = 0;\n }\n this.#UpdateUI();\n }\n }\n\n #UpdateUI(): void {\n this.SetupUI();\n\n //@@ fix screen render - should not need to blow entire screen away ...\n //this.#SetupPanels();\n //this.UpdateCursorInfo();\n //this.Render();\n }\n\n Exit = (): void => {\n this.DestroyUI();\n this.emit('exit');\n //this.ExitEx();\n }\n\n /**\n * \n */\n DestroyUI = (): void => {\n // Destroy the screen and disable UI log processing\n if (this.screen !== null) {\n this.uiBoxes = { };\n this.screen.destroy();\n this.screen = null;\n }\n }\n\n /**\n * Render the screen.\n */\n Render = (): void => {\n if (this.screen) {\n this.screen.render();\n }\n }\n}\n"],"names":["EventEmitter","MenuBar","screen","options","__publicField","compoptions","menuItem","blessed","STSUIFrame","data","renderPanelFn","__privateAdd","_SetupPanels","_UpdateUI","_cursor","_renderPanelFn","_cursorInfo","_CalcBoxPos","panel","screenHeight","screenWidth","rows","cols","pos","colWidth","rowHeight","topoffset","value","boxPos","_UpdateUIBoxPos","uiBox","__privateGet","widget","_ReSize","_UpdatePanelPosition","row","col","i","MenuBar.MenuBar","__privateMethod","SetupPanels_fn","__privateSet","sortMode","screenHeaderText","UpdateUI_fn","endpos","gridData","gridDataPanels","panelKeys","uiBoxIds","touched","gridPos","top","left","width","height","box","boxHeader","widgetoptions","uuidv4","key"],"mappings":"25BAAe,MAAAA,EAAA,CAAA,ECcR,MAAMC,CACb,CAII,YAAYC,EAA2BC,EAAyB,CAHxDC,EAAA,aAAkC,MAItC,MAAMC,EAAyC,CAC3C,OAAQH,EACR,KAAM,EACN,MAAO,EACP,OAAQ,EACR,MAAO,SACP,MAAO,GACP,KAAM,GACN,gBAAiB,GACjB,WAAY,GACZ,MAAO,CACH,GAAI,SACJ,GAAI,OAEJ,KAAM,CACF,MAAO,CACH,GAAI,QACJ,GAAI,OACR,CACJ,EACA,SAAU,CACN,GAAI,QACJ,GAAI,QACR,CACJ,CAAA,EAEAC,EAAQ,MAAQ,GAChBE,EAAY,IAAM,EAElBA,EAAY,OAAS,EAGzBA,EAAY,SAAW,GACfF,EAAA,UAAU,QAASG,GAAa,CAChCD,EAAY,WACAA,EAAA,SAASC,EAAS,IAAI,EAAI,CAClC,KAAM,CAAEA,EAAS,GAAI,EACrB,SAAUA,EAAS,EAAA,EAE3B,CACH,EAEI,KAAA,MAAQC,EAAQ,QAAQF,CAAW,CAC5C,CAEA,IAAI,SACJ,CACI,OAAO,KAAK,KAChB,CACJ,CCAO,MAAMG,UAAmBR,CAAa,CA0BzC,YAAYS,EAAgBC,EAAsC,KAAM,CAC9D,QAwHVC,EAAA,KAAAC,GAqY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EAAI,GAKpBa,EAAA,KAAKhB,IACLgB,EAAA,KAAKhB,GAAL,UAAoB,KAAK,QAAQG,EAAM,EAAE,EAAE,IAAKA,IAK5D,SAAW,CAAC0C,CAAK,IAAK,OAAO,QAAQ,KAAK,OAAO,EACzC,OAAOV,EAAQU,CAAG,EAAM,KACxB,KAAK,QAAQA,CAAG,EAAE,IAAI,KAAK,EAC3B,KAAK,QAAQA,CAAG,EAAE,UAAU,KAAK,IAEjC,KAAK,QAAQA,CAAG,EAAE,IAAI,KAAK,EAC3B,KAAK,QAAQA,CAAG,EAAE,UAAU,KAAK,EAI7C,EAuPA/C,EAAA,YAAA+B,EAAkB,UAAA,CACd,KAAK,QAAQ,CAMjB"}
|
|
1
|
+
{"version":3,"file":"stsconfig.umd.js","sources":["../src/menubar.ts","../src/stsuiframe.ts"],"sourcesContent":["import blessed from 'blessed';\nimport * as stsBlessed from './index'\n\nexport interface menuitem {\n\ttext: string,\n\tkey: string,\n\tcb(): void\n}\n\nexport interface MenuBarOptions {\n\ttop: boolean\n\tmenuitems: menuitem[]\n}\n\nexport class MenuBar\n{\n private listb:stsBlessed.listbar | null = null;\n\n // options := { screen: <blessed screen>, top: <bool>, menuitems: [ { text: <string>, key: <string>, cb: <call back func> } ] }\n constructor(screen: stsBlessed.screen, options: MenuBarOptions) {\n const compoptions: stsBlessed.elementOptions = {\n parent: screen,\n left: 0,\n right: 0,\n height: 1,\n width: 'shrink',\n mouse: true,\n keys: true,\n autoCommandKeys: true,\n scrollable: true,\n style: {\n fg: 'yellow',\n bg: 'blue',\n\n item: {\n hover: {\n fg: 'white',\n bg: 'green',\n }\n },\n selected: {\n fg: 'black',\n bg: 'yellow',\n }\n }\n }\n if (options.top === true) {\n compoptions.top = 0;\n } else {\n compoptions.bottom = 0;\n }\n\n compoptions.commands = { };\n options.menuitems.forEach((menuItem) => {\n if (compoptions.commands) {\n compoptions.commands[menuItem.text] = {\n keys: [ menuItem.key ],\n callback: menuItem.cb\n }\n }\n })\n\n this.listb = blessed.listbar(compoptions);\n }\n\n get listbar()\n {\n return this.listb;\n }\n}\n","import EventEmitter from 'node:events'\n\n// https://github.com/yaronn/blessed-contrib\n//var contrib = require('blessed-contrib');\nimport blessed from 'blessed';\n\nimport 'colors';\n\nimport { v4 as uuidv4 } from 'uuid';\n\nimport * as stsBlessed from './index'\nimport * as MenuBar from './menubar'\n\nexport type menuOptions = MenuBar.MenuBarOptions[]\n\nexport interface widget {\n widget: string // Name of the blessed widget\n options: stsBlessed.elementOptions // blessed widget options - used in the constructor of the blessed widget\n}\n\nexport interface widgets {\n [widgetName: string]: widget\n}\n\nexport interface panel {\n id: string,\n pos?: {\n row: number,\n col: number,\n rowSpan: number,\n colSpan: number\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data: any\n panelHeader: string,\n widgets: widgets\n}\n\nexport interface panels {\n [panelId: string]: panel\n}\n\nexport interface gridData {\n\ttitle: string\n\tgrid: { rows: number, cols: number },\n\tmenu: menuOptions,\n\tpanels: panels\n}\n\nexport interface renderPanelCb {\n\t(box: stsBlessed.box, panel: panel): void\n}\n\nexport interface boxPos {\n\ttop: number,\n\tleft: number,\n\twidth: number,\n\theight: number\n}\n\nexport interface uiBox {\n\tbox: stsBlessed.box, // blessed box\n\tboxHeader: stsBlessed.listbar // blessed box\n}\n\nexport interface uiBoxes {\n\t[key: string]: uiBox\n}\n\nexport class STSUIFrame extends EventEmitter {\n//export class STSUIFrame {\n private uiBoxes:uiBoxes = { }; // { box: <<blessed box>>, boxHeader: <<blessed box>> }\n private screen: stsBlessed.screen | null = null;\n #cursor = 0; // panel index with the complete model data.\n #renderPanelFn: renderPanelCb | null = null;\n private screenHeaderText = '...';\n\n private minRows = 1;\n private minCols = 1;\n private minWidth = 40;\n private minHeight = 7;\n\n #cursorInfo: stsBlessed.box | null = null;\n private sortInfo: stsBlessed.box | null = null; // Current sort mode UI box control\n private screenHeader: stsBlessed.box | null = null;\n\n private uidata: gridData;\n\n /**\n * \n * @param {*} data The screen layout data. Schema: { title: <str>,\n * grid: { rows: <int>, cols: <int> }, \n * panels: [ { id: <str>, pos: { row: <int>, col: <int>, rowSpan: <int>, colSpan: <int> }, \n * template: <handlebars func>, widgets: { [ { <prop_name>: <blessed widget> } ] } } ] }\n */\n constructor(data: gridData, renderPanelFn: renderPanelCb | null = null) {\n super();\n this.uidata = data;\n this.#renderPanelFn = renderPanelFn;\n this.SetupUI();\n }\n\n /**\n * \n * @param {number} position The index (0 based) for the panel item to be calculated\n * @returns object with top, left, width and height correctly set\n */\n #CalcBoxPos = (panel: panel): boxPos | null => {\n // Calculate the position and dimensions for this UI element\n\n if (!this.screen) return null;\n if (!panel.pos) return null;\n\n let screenHeight = this.screen.height;\n if (this.uidata.menu !== null) {\n screenHeight -= this.uidata.menu.length; // Allow for any menu items\n }\n const screenWidth = this.screen.width;\n\n const rows = this.uidata.grid.rows;\n const cols = this.uidata.grid.cols;\n\n const pos = panel.pos;\n\n const colWidth = Math.floor(screenWidth / cols);\n const rowHeight = Math.floor(screenHeight / rows);\n\n // Allow for a top offset if a top menu is present\n let topoffset = 0;\n if (this.uidata.menu !== null) {\n for (const [, value] of Object.entries(this.uidata.menu)) {\n if (value.top === true) {\n topoffset = 1;\n break;\n }\n }\n }\n\n const boxPos: boxPos = {\n top: (pos.row * rowHeight) + topoffset,\n left: pos.col * colWidth,\n width: colWidth * pos.colSpan,\n height: rowHeight * pos.rowSpan\n }\n\n // Now check if this panel is on the far right and if so adjust for a perfect fit\n\n if ((pos.col + pos.colSpan) === cols) {\n //if (pos.col === (cols - 1)) {\n boxPos.width = screenWidth - (pos.col * colWidth);\n }\n\n // Now check if this panel is on the bottom and if so adjust for a perfect fit\n if ((pos.row + pos.rowSpan) === rows) {\n boxPos.height = screenHeight - (pos.row * rowHeight);\n }\n\n return boxPos;\n }\n\n #UpdateUIBoxPos = (panel: panel, uiBox: uiBox): void => {\n const pos: boxPos | null = this.#CalcBoxPos(panel);\n if (!pos) {\n return;\n }\n\n uiBox.box.top = pos.top;\n uiBox.box.left = pos.left;\n uiBox.box.width = pos.width;\n uiBox.box.height = pos.height;\n\n uiBox.boxHeader.top = pos.top;\n uiBox.boxHeader.left = pos.left + 2;\n\n if (typeof panel.widgets !== 'undefined' && panel.widgets !== null) {\n for (const [, value] of Object.entries(panel.widgets)) {\n if (value.widget === 'log') {\n const widget = uiBox.box.get(value.widget) as stsBlessed.element;\n if (widget.position.top >= (uiBox.box.height - 4)) {\n widget.position.top = uiBox.box.height - 4;\n } else {\n if (value.options.top) {\n widget.position.top = value.options.top;\n }\n }\n }\n }\n }\n };\n\n /**\n * ReSize the grid layout\n */\n #ReSize = (): void => {\n for (const [, value] of Object.entries(this.uiBoxes)) {\n this.#UpdateUIBoxPos(value.box.get('panel') as panel, value);\n }\n }\n\n #UpdatePanelPosition = (panel: panel, row: number, col: number, uiBox: uiBox): void => {\n // Update the panel position within the current screen view\n panel.pos = { row: row, col: col, rowSpan: 1, colSpan: 1 };\n this.#UpdateUIBoxPos(panel, uiBox);\n uiBox.boxHeader.setContent(panel.panelHeader);\n }\n\n /*\n ClickEx(panel: any) {\n //@@ override in sub-class\n }\n */\n\n /**\n * \n * Setup all panels\n */\n #SetupPanels(): void {\n if (!this.screen) {\n return;\n }\n\n const panelKeys = Object.keys(this.uidata.panels);\n\n // Check for deleted panels\n const uiBoxIds = Object.keys(this.uiBoxes);\n for (let i=0; i < uiBoxIds.length; i++) {\n if (typeof this.uidata.panels[uiBoxIds[i]] === 'undefined') {\n let uiBox: uiBox | null = this.uiBoxes[uiBoxIds[i]];\n if (typeof uiBox !== 'undefined') {\n this.screen.remove(uiBox.boxHeader);\n this.screen.remove(uiBox.box);\n uiBox = null;\n delete this.uiBoxes[uiBoxIds[i]];\n }\n }\n }\n\n const touched: Record<string, boolean> = { };\n\n for (let i=0; i < (this.uidata.grid.cols * this.uidata.grid.rows); i++) {\n const gridPos = this.#cursor + i;\n const col = i % this.uidata.grid.cols;\n const row = Math.floor(i / this.uidata.grid.cols);\n\n // Get the panel for this position within the grid\n const panel: panel = this.uidata.panels[panelKeys[gridPos]];\n if (typeof panel !== 'undefined') {\n if (typeof this.uiBoxes[panel.id] === 'undefined') {\n // Update the panel position within the current screen view\n panel.pos = { row: row, col: col, rowSpan: 1, colSpan: 1 };\n\n const calculatedBoxPos = this.#CalcBoxPos(panel);\n if (!calculatedBoxPos) {\n return\n }\n const { top, left, width, height } = this.#CalcBoxPos(panel) as boxPos;\n\n // Create the UI box\n const box: stsBlessed.box = blessed.box({\n parent: this.screen,\n top: top,\n left: left,\n width: width,\n height: height,\n style:\n {\n bg: '#101010' // was gray\n ,fg: 'white'\n },\n border:\n {\n type: 'line'\n },\n keys: false, // Do not allow default key handling for this box\n tags: true // Allow style in-line tags such as bolt, italics, etc.\n });\n\n const boxHeader: stsBlessed.listbar = blessed.box({\n parent: this.screen,\n top: top,\n left: left+2,\n width: 'shrink',\n height: 1,\n style:\n {\n bg: 'gray'\n , fg: 'white'\n },\n keys: false, // Do not allow default key handling for this box\n mouse: false,\n content: panel.panelHeader,\n tags: true // Allow style in-line tags such as bolt, italics, etc.\n });\n\n this.uiBoxes[panel.id] = { box: box, boxHeader: boxHeader };\n\n boxHeader.setIndex(-1);\n\n // https://stackoverflow.com/questions/20279484/how-to-access-the-correct-this-inside-a-callback\n box.on('click', () => {\n //this.emit('click', box.data.panel);\n this.emit('click', box.get('panel') as panel);\n //this.ClickEx(box.get('panel') as panel);\n });\n\n if (typeof panel.widgets !== 'undefined' && panel.widgets !== null) {\n for (const [, value] of Object.entries(panel.widgets)) {\n // Create a fresh copy of the options for this widget instance.\n // If this is not done, all widgets will use the same options object and will not be able\n // to update screen elements individually.\n const widgetoptions = {...value.options};\n\n // Ensure that we always show at least 2 lines of log data even if this means we position over the top of\n // elements above this position.\n if (widgetoptions.top && (widgetoptions.top >= (box.height - 3))) {\n widgetoptions.top = box.height - 4;\n }\n const widget: stsBlessed.element = blessed[value.widget].call(this, widgetoptions);\n widget.set('id', uuidv4());\n box.append(widget);\n box.set(value.widget, widget); // Set the user data for this widget. This allows the handlebars template access via the name from the box object.\n }\n }\n\n // The entire panel is accessible using the _panel property.\n // This is so that the model is accessible from within the handlebars templates.\n // Access to a named widget can be done using box._panel.widgets[name] or box._panel.widgets.name\n box.set('panel', panel);\n\n this.uiBoxes[panel.id].box = box;\n\n touched[panel.id] = true;\n } else {\n //@@ need to hide previous positions\n //@@ and show ones that are visible\n this.#UpdatePanelPosition(panel, row, col, this.uiBoxes[panel.id]);\n\n touched[panel.id] = true;\n //this.#uiBox[panel.id].box.show();\n }\n\n // Render the uiBox with the renderPanelFn using the panel as the utility including the model\n if (this.#renderPanelFn) {\n this.#renderPanelFn(this.uiBoxes[panel.id].box, panel);\n }\n }\n }\n\n for (const [key, ] of Object.entries(this.uiBoxes)) {\n if (typeof touched[key] === 'undefined') {\n this.uiBoxes[key].box.hide();\n this.uiBoxes[key].boxHeader.hide();\n } else {\n this.uiBoxes[key].box.show();\n this.uiBoxes[key].boxHeader.show();\n }\n }\n\n }\n\n get gridData(): gridData {\n return this.uidata;\n }\n\n set gridData(gridData: gridData) {\n this.uidata = gridData;\n this.#SetupPanels();\n this.UpdateCursorInfo();\n this.Render();\n }\n\n get gridDataPanels(): panels {\n return this.uidata.panels;\n }\n\n set gridDataPanels(gridDataPanels: panels) {\n this.uidata.panels = gridDataPanels;\n this.#SetupPanels();\n this.UpdateCursorInfo();\n this.Render();\n }\n\n /*\n ExitEx() {\n //@@ override in sub-class\n }\n\n EscapeEx() {\n //@@ override in sub-class\n }\n */\n\n // https://www.npmjs.com/package/blessed\n\n // data:= { title: <str>,\n // grid: { rows: <int>, cols: <int> }, \n // menu: [ { top: <bool>, menuitems: [ { text: <string>, key: <string>, cb: <func> } ] } ]\n // panels: [ { id: <str>, pos: { row: <int>, col: <int>, rowSpan: <int>, colSpan: <int> }, template: <str> } ] }\n /**\n * \n * @param {*} data UI Data\n */\n SetupUI = (): void => {\n this.DestroyUI();\n\n if (this.screen === null) {\n // Create a screen object.\n this.screen = blessed.screen({\n smartCSR: true\n });\n }\n\n if (!this.screen) {\n return;\n }\n\n const data = this.uidata;\n this.screen.title = data.title;\n this.screen.on('resize', () => {\n this.#ReSize();\n this.Render();\n });\n\n if (data.menu !== null) {\n for (let i = 0; i < data.menu.length; i++) {\n new MenuBar.MenuBar(this.screen, data.menu[i]);\n }\n }\n\n // Allow the serrvice to terminate by pressing Control-C.\n this.screen.key(['C-c'], (): void => {\n this.DestroyUI();\n this.emit('exit');\n //this.ExitEx();\n // Cleanly shutdown the main process. Exit code success (> 0 is exit in error state)\n //setTimeout(() => process.kill(process.pid), 0);\n });\n\n this.screen.key(['escape'], (): void => {\n this.emit('escape');\n //this.EscapeEx();\n // Cleanly shutdown the main process. Exit code success (> 0 is exit in error state)\n //setTimeout(() => process.kill(process.pid), 0);\n });\n\n this.#SetupPanels();\n\n this.#cursorInfo = blessed.box({\n parent: this.screen,\n bottom: 0,\n right: 0,\n width: 'shrink',\n height: 1,\n style:\n {\n bg: 'gray'\n , fg: 'white'\n },\n keys: false, // Do not allow default key handling for this box\n mouse: false,\n content: '',\n tags: true // Allow style in-line tags such as bolt, italics, etc.\n });\n\n this.sortInfo = blessed.box({\n parent: this.screen,\n top: 0,\n right: 0,\n width: 'shrink',\n height: 1,\n style:\n {\n bg: 'gray'\n , fg: 'white'\n },\n keys: false, // Do not allow default key handling for this box\n mouse: false,\n content: '',\n tags: true // Allow style in-line tags such as bolt, italics, etc.\n });\n\n\n this.screenHeader = blessed.box({\n parent: this.screen,\n top: 0,\n left: 'center',\n width: 'shrink',\n height: 1,\n style:\n {\n bg: 'gray'\n , fg: 'white'\n },\n keys: false, // Do not allow default key handling for this box\n mouse: false,\n content: `[ ... ]`,\n tags: true // Allow style in-line tags such as bolt, italics, etc.\n });\n\n this.UpdateCursorInfo();\n this.UpdateSortInfo('Default');\n this.UpdateScreenHeader(this.screenHeaderText);\n\n // Render the screen.\n this.Render();\n }\n\n UpdateCursorInfo = (): void => {\n if (this.#cursorInfo) {\n this.#cursorInfo.setContent(`Cursor: ${this.#cursor} / ${this.TotalPanelNumber}`);\n }\n }\n\n UpdateSortInfo = (sortMode: string): void => {\n if (this.sortInfo) {\n this.sortInfo.setContent(`Sort: ${sortMode}`);\n }\n }\n\n UpdateScreenHeader = (screenHeaderText: string): void => {\n this.screenHeaderText = screenHeaderText;\n if (this.screenHeader) {\n this.screenHeader.setContent(`[ ${screenHeaderText} ]`);\n }\n }\n\n get rows(): number {\n return this.uidata.grid.rows;\n }\n\n get cols(): number {\n return this.uidata.grid.cols;\n }\n\n IncRows = (): void => {\n if (this.screen && (this.screen.height / (this.uidata.grid.rows+1) > this.minHeight)) {\n this.uidata.grid.rows++;\n this.CheckCursor();\n this.#UpdateUI();\n }\n }\n\n DecRows = (): void => {\n if (this.uidata.grid.rows > this.minRows) {\n this.uidata.grid.rows--;\n this.CheckCursor();\n this.#UpdateUI();\n }\n }\n\n IncCols = (): void => {\n if (this.screen && (this.screen.width / (this.uidata.grid.cols+1) > this.minWidth)) {\n this.uidata.grid.cols++;\n this.CheckCursor();\n this.#UpdateUI();\n }\n }\n\n DecCols = (): void => {\n if (this.uidata.grid.cols > this.minCols) {\n this.uidata.grid.cols--;\n this.CheckCursor();\n this.#UpdateUI();\n }\n }\n\n get ScreenCells(): number {\n return this.uidata.grid.cols * this.uidata.grid.rows;\n }\n\n get TotalPanelNumber(): number {\n return Object.keys(this.uidata.panels).length;\n }\n\n CheckCursor = (): void => {\n if (this.#cursor > (this.TotalPanelNumber - this.ScreenCells)) {\n this.#cursor = this.TotalPanelNumber - this.ScreenCells;\n if (this.#cursor < 0) {\n this.#cursor = 0;\n }\n }\n this.UpdateCursorInfo();\n }\n\n NextPage = (): void => {\n const endpos = this.TotalPanelNumber - this.ScreenCells;\n if (this.#cursor < endpos) {\n this.#cursor += this.ScreenCells;\n if (this.#cursor > endpos) {\n this.#cursor = endpos;\n }\n this.#UpdateUI();\n }\n }\n\n PrevPage = (): void => {\n if (this.#cursor > 0) {\n this.#cursor -= this.ScreenCells;\n if (this.#cursor < 0) {\n this.#cursor = 0;\n }\n this.#UpdateUI();\n }\n }\n\n #UpdateUI(): void {\n this.SetupUI();\n\n //@@ fix screen render - should not need to blow entire screen away ...\n //this.#SetupPanels();\n //this.UpdateCursorInfo();\n //this.Render();\n }\n\n Exit = (): void => {\n this.DestroyUI();\n this.emit('exit');\n //this.ExitEx();\n }\n\n /**\n * \n */\n DestroyUI = (): void => {\n // Destroy the screen and disable UI log processing\n if (this.screen !== null) {\n this.uiBoxes = { };\n this.screen.destroy();\n this.screen = null;\n }\n }\n\n /**\n * Render the screen.\n */\n Render = (): void => {\n if (this.screen) {\n this.screen.render();\n }\n }\n}\n"],"names":["MenuBar","screen","options","__publicField","compoptions","menuItem","blessed","STSUIFrame","EventEmitter","data","renderPanelFn","__privateAdd","_SetupPanels","_UpdateUI","_cursor","_renderPanelFn","_cursorInfo","_CalcBoxPos","panel","screenHeight","screenWidth","rows","cols","pos","colWidth","rowHeight","topoffset","value","boxPos","_UpdateUIBoxPos","uiBox","__privateGet","widget","_ReSize","_UpdatePanelPosition","row","col","i","MenuBar.MenuBar","__privateMethod","SetupPanels_fn","__privateSet","sortMode","screenHeaderText","UpdateUI_fn","endpos","gridData","gridDataPanels","panelKeys","uiBoxIds","touched","gridPos","top","left","width","height","box","boxHeader","widgetoptions","uuidv4","key"],"mappings":"28BAcO,MAAMA,CACb,CAII,YAAYC,EAA2BC,EAAyB,CAHxDC,EAAA,aAAkC,MAItC,MAAMC,EAAyC,CAC3C,OAAQH,EACR,KAAM,EACN,MAAO,EACP,OAAQ,EACR,MAAO,SACP,MAAO,GACP,KAAM,GACN,gBAAiB,GACjB,WAAY,GACZ,MAAO,CACH,GAAI,SACJ,GAAI,OAEJ,KAAM,CACF,MAAO,CACH,GAAI,QACJ,GAAI,OACR,CACJ,EACA,SAAU,CACN,GAAI,QACJ,GAAI,QACR,CACJ,CAAA,EAEAC,EAAQ,MAAQ,GAChBE,EAAY,IAAM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B,EAAM,MAAM,EAAE,KAAK,KAAM+B,CAAa,EAC1E1B,EAAA,IAAI,KAAM2B,EAAAA,GAAQ,CAAA,EACzBH,EAAI,OAAOxB,CAAM,EACbwB,EAAA,IAAI7B,EAAM,OAAQK,CAAM,EAOhCwB,EAAA,IAAI,QAAStC,CAAK,EAEtB,KAAK,QAAQA,EAAM,EAAE,EAAE,IAAMsC,EAErBN,EAAAhC,EAAM,EAAE,EAAI,QAIfa,EAAA,KAAAG,GAAA,UAAqBhB,EAAOiB,EAAKC,EAAK,KAAK,QAAQlB,EAAM,EAAE,GAExDgC,EAAAhC,EAAM,EAAE,EAAI,GAKpBa,EAAA,KAAKhB,IACLgB,EAAA,KAAKhB,GAAL,UAAoB,KAAK,QAAQG,EAAM,EAAE,EAAE,IAAKA,IAK5D,SAAW,CAAC0C,CAAK,IAAK,OAAO,QAAQ,KAAK,OAAO,EACzC,OAAOV,EAAQU,CAAG,EAAM,KACxB,KAAK,QAAQA,CAAG,EAAE,IAAI,KAAK,EAC3B,KAAK,QAAQA,CAAG,EAAE,UAAU,KAAK,IAEjC,KAAK,QAAQA,CAAG,EAAE,IAAI,KAAK,EAC3B,KAAK,QAAQA,CAAG,EAAE,UAAU,KAAK,EAI7C,EAuPA/C,EAAA,YAAA+B,EAAkB,UAAA,CACd,KAAK,QAAQ,CAMjB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nsshunt/stsui",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.26",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.umd.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -49,7 +49,6 @@
|
|
|
49
49
|
"@typescript-eslint/parser": "^5.57.0",
|
|
50
50
|
"eslint": "^8.37.0",
|
|
51
51
|
"jest": "^29.5.0",
|
|
52
|
-
"rollup-plugin-polyfill-node": "^0.12.0",
|
|
53
52
|
"rollup-plugin-visualizer": "^5.9.0",
|
|
54
53
|
"typescript": "^4.9.5",
|
|
55
54
|
"vite": "^4.2.1"
|