neo-neo-bblessed
Version:
A fork of neo-blessed (which is a fork of blessed) with bug fixes and maintenance.
3 lines (2 loc) • 625 B
JavaScript
const a=require("./node"),i=require("./checkbox");function e(n){const o=this;if(!(this instanceof a))return new e(n);n=n||{},i.call(this,n),this.on("check",function(){let t=o;for(;(t=t.parent)&&!(t.type==="radio-set"||t.type==="form"););t=t||o.parent,t&&t.forDescendants(function(r){r.type!=="radio-button"||r===o||r.uncheck()})})}e.prototype.__proto__=i.prototype,e.prototype.type="radio-button",e.prototype.render=function(){return this.clearPos(!0),this.setContent("("+(this.checked?"*":" ")+") "+this.text,!0),this._render()},e.prototype.toggle=e.prototype.check,module.exports=e;
//# sourceMappingURL=radiobutton.js.map