@sprucelabs/spruce-cli
Version:
Command line interface for building Spruce skills.
42 lines • 1.43 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const terminal_kit_1 = __importDefault(require("terminal-kit"));
const termKit_utility_1 = __importDefault(require("./termKit.utility"));
const TkBaseWidget_1 = __importDefault(require("./TkBaseWidget"));
const termKit = terminal_kit_1.default;
class TkPopupWidget extends TkBaseWidget_1.default {
popup;
type = 'popup';
constructor(options) {
super({
shouldLockHeightWithParent: true,
shouldLockWidthWithParent: true,
...options,
});
const { parent, ...rest } = options;
const frame = termKit_utility_1.default.buildFrame(options, parent);
this.popup = new termKit.Window({
parent: parent ? parent.getTermKitElement() : undefined,
movable: true,
...rest,
...frame,
});
this.popup.__widget = this;
}
getTermKitElement() {
return this.popup;
}
getFrame() {
return {
left: this.popup.outputDst.x,
top: this.popup.outputDst.y,
width: this.popup.inputWidth,
height: this.popup.inputHeight,
};
}
}
exports.default = TkPopupWidget;
//# sourceMappingURL=TkPopupWidget.js.map