{"_id":"blessed-tab-container","_rev":"1-6ec1bd9c3b990aecae422d2b14562603","name":"blessed-tab-container","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"blessed-tab-container","version":"1.0.0","description":"A CLI Multi-Tab Container Utilizing Labels For Blessed","main":"index.js","engines":{"node":">=8.3.0"},"scripts":{"test":"npm run lint","lint":"eslint lib/ index.js","docs":"rm -rf docs && node_modules/.bin/jsdoc --configure .jsdoc.json --verbose"},"repository":{"type":"git","url":"git+https://github.com/f3rno/blessed-tab-container.git"},"keywords":["blessed","cli","ascii","dashboard","ui","terminal"],"author":{"name":"Cris Mihalache","email":"me@f3rno.com"},"license":"MIT","bugs":{"url":"https://github.com/f3rno/blessed-tab-container/issues"},"homepage":"https://github.com/f3rno/blessed-tab-container#readme","devDependencies":{"blessed":"^0.1.81","blessed-contrib":"^4.8.19","colors":"^1.4.0","docdash":"^1.2.0","eslint":"^6.8.0","eslint-config-standard":"^14.1.1","eslint-plugin-import":"^2.20.2","eslint-plugin-jsdoc":"^22.1.0","eslint-plugin-lodash":"^6.0.0","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^4.2.1","eslint-plugin-standard":"^4.0.1","jsdoc":"^3.6.3"},"dependencies":{"lodash":"^4.17.15"},"gitHead":"b75f6cf9fd07fd0a501e6488f44b7f05f9446b39","_id":"blessed-tab-container@1.0.0","_nodeVersion":"13.12.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ySWWeMm3j+2ES9SV9lpOVPbLseOS+CHFvqi0IBu7VsQz4rE2NBrSMbvIyxtBO7Sg6b3nnNbDfcA6ysqZTvmDfw==","shasum":"686a7c73098cc8efe691a84341a8918fd84ce2ca","tarball":"https://registry.npmjs.org/blessed-tab-container/-/blessed-tab-container-1.0.0.tgz","fileCount":68,"unpackedSize":1283938,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegza2CRA9TVsSAnZWagAAqHYP/jEG11BVyRJHaBqXDiO4\nSoQZd3NeOrxMHKweIbhXHHHUhEirKPbengkXJKrotwrjiwRRxV0ADnKo5NPo\nc15qx93p9alr5J+s3n7ZQXHhiobBi7vU0GCKVxbCy/aTxNhcPOnrbqTJtR0s\ngP63xPofYoxq+ndJR2Itt8ZiUzIJv1vBmP8shK4ibYEPMN+rnUEMyBm3++yd\nwe+YleNT5RqCkzTT6+CfnVn6Nh79SvJweCatE51TIqyFd3RxYh4LbuwKWCe3\ntykgcY9+O7H756jtyRI+R+4uVIzRUylRKXACdiM31iij7Y10rBwXiPOxUXUK\njWflsPMNOp896u97buZ2kEnwjvXyJrSTYfWTp8OfxKHMnlAvr2SDJejdnSZm\niGwl58DPTsG2Z1W5FcADzSPKmtt9N48ChwNpkdQfeiVnE/laBI6XXpJoEdU2\nSCy7KuLGO7p1Xwbj9fEOFy7ODEAG6cqYRFqw8Gvu62eCyFb9UAQTFMXXbuJi\nxvkwZeyhDyvVpR+6aN1j3D9C5jF5VY9POeSzbPM8OGgrFFGEJ9DuXXVxnd9b\nF67izUYAUjoKS1/B4MzwaJGxDcskbMMudICBcisrT+ySvoRPiA7jMfno9abI\n//IzS1xJKa3KvTJ+pnag01ubm4KiLCD/5wuiZ6wUonBILTwzLoypVpdXPWOu\n+t+F\r\n=+poS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3QU6b2P47Wq729tEVURk626tf9p2UKTpJT2XjZSdv0AIhAMLSkS+/YcBMvqpqSPzGuJeOPUrf5GB6hPYX4KvmXRin"}]},"maintainers":[{"name":"f3rno","email":"me@f3rno.com"}],"_npmUser":{"name":"f3rno","email":"me@f3rno.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/blessed-tab-container_1.0.0_1585657526036_0.03716735734179344"},"_hasShrinkwrap":false}},"time":{"created":"2020-03-31T12:25:26.034Z","1.0.0":"2020-03-31T12:25:26.194Z","modified":"2022-04-12T03:42:41.849Z"},"maintainers":[{"name":"f3rno","email":"me@f3rno.com"}],"description":"A CLI Multi-Tab Container Utilizing Labels For Blessed","homepage":"https://github.com/f3rno/blessed-tab-container#readme","keywords":["blessed","cli","ascii","dashboard","ui","terminal"],"repository":{"type":"git","url":"git+https://github.com/f3rno/blessed-tab-container.git"},"author":{"name":"Cris Mihalache","email":"me@f3rno.com"},"bugs":{"url":"https://github.com/f3rno/blessed-tab-container/issues"},"license":"MIT","readme":"# Blessed Tab Container Element\n\n[![Build Status](https://travis-ci.org/f3rno/blessed-tab-container.svg?branch=master)](https://travis-ci.org/f3rno/blessed-tab-container)\n\nA tabbed container for the [`blessed`](https://github.com/chjj/blessed) CLI UI\nlibrary. Implements clickable tabs by rendering a tabline as the root element\nlabel, with each label styled to indicate the tabs' active & dirty status.\n\n![preview](/readme_assets/preview.png)\n\n## Features\n\n* Configurable tab styling\n* Indicates tab 'dirty' state in label\n* Tabs!\n\n## API\n\nThe tab container function returns an object with `setVisibleTab(label)` and\n`setDirty(tab)` methods. More details can be found in the [`docs/ folder`](/docs)\n\n## Example Usage\n\n```js\nconst BlessedTabContainer = require('blessed-tab-container')\nconst blessedContrib = require('blessed-contrib')\nconst colors = require('colors')\n\nconst screen = blessed.screen({ smartCSR: true })\n\nscreen.enableInput()\nscreen.key(['escape', 'q', 'C-c'], () => {\n  screen.destroy()\n  process.exit(0) // eslint-disable-line\n})\n\nconst grid = new blessedContrib.grid({\n  screen: screen,\n  rows: 1,\n  cols: 2\n})\n\nconst tabGroupA = []\nconst tabGroupB = []\n\nfor (let i = 0; i < 2; i += 1) {\n  tabGroupA.push(grid.set(0, 0, 1, 1, blessed.element, {\n    content: `Content for Tab ${i + 1}`\n  }))\n}\n\nfor (let i = 0; i < 5; i += 1) {\n  tabGroupB.push(grid.set(0, 1, 1, 1, blessed.element, {\n    content: `Content for Tab ${i + 1}`\n  }))\n}\n\nconst tabContainerSettings = {\n  screen,\n  tabSeperator: ' | ',\n  activeColorFunc: colors.bgBrightBlue.black,\n  dirtyColorFunc: colors.underline\n}\n\nconst tabContainerA = BlessedTabContainer({\n  ...tabContainerSettings,\n  defaultVisible: 'Tab 1',\n  tabs: tabGroupA.map((t, i) => ({\n    label: `Tab ${i + 1}`,\n    component: t\n  }))\n})\n\nconst tabContainerB = BlessedTabContainer({\n  ...tabContainerSettings,\n  defaultVisible: 'Tab 1',\n  tabs: tabGroupB.map((t, i) => ({\n    label: `Tab ${i + 1}`,\n    component: t\n  }))\n})\n\n// Do something with the containers\ntabContainerA.setVisibleTab('Tab 2')\ntabContainerB.setVisibleTab('Tab 4')\n\nscreen.render()\n```\n\n### Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n","readmeFilename":"README.md"}