-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js.map
1 lines (1 loc) · 15 KB
/
index.js.map
1
{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap bc35249045af7485e7db","webpack:///./src/index.js","webpack:///./src/Tab.jsx","webpack:///external \"react\"","webpack:///./src/Tabs.jsx","webpack:///external \"react-autobind\"","webpack:///external \"underscore\""],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;ACtBA,SAAQ,GAAR,GAAc,oBAAQ,CAAR,CAAd;AACA,SAAQ,IAAR,GAAe,oBAAQ,CAAR,CAAf,C;;;;;;;;;;;;;;ACDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAUM;;;;;;;;;;;8BACK;AACP,cACE;;WAAK,WAAU,aAAV,EAAL;SACE;;;AACE,mBAAK,UAAL;AACA,iBAAI,KAAK,KAAL,CAAW,MAAX;AACJ,wBAAW,cAAc,KAAK,KAAL,CAAW,UAAX,GAAwB,SAAxB,GAAoC,EAApC,CAAd;AACX,4BAAa,CAAC,KAAK,KAAL,CAAW,UAAX;YAJhB;WAMG,KAAK,KAAL,CAAW,QAAX;UAPL;QADF,CADO;;;;UADL;GAAY,gBAAM,SAAN;;AAiBlB,KAAI,SAAJ,GAAgB;AACd,WAAQ,gBAAM,SAAN,CAAgB,MAAhB,CAAuB,UAAvB;AACR,eAAY,gBAAM,SAAN,CAAgB,IAAhB;AACZ,aAAU,gBAAM,SAAN,CAAgB,IAAhB,CAAqB,UAArB;EAHZ;;AAMA,KAAI,YAAJ,GAAmB;AACjB,eAAY,KAAZ;EADF;;m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WAAI,KAAJ,EAAW;AACT,eAAM,cAAN,GADS;AAET,eAAM,eAAN,GAFS;QAAX;;AAKA,WAAI,MAAM,IAAI,GAAJ,CANW;AAOrB,WAAI,OAAO,KAAK,KAAL,CAAW,IAAX;;;AAPU,WAUrB,CAAK,KAAL,CAAW,IAAX,GAAkB,qBAAE,OAAF,CAAU,IAAV,EAAgB,qBAAE,SAAF,CAAY,IAAZ,EAAkB,EAAC,KAAK,GAAL,EAAnB,CAAhB,CAAlB,CAVqB;AAWrB,YAAK,QAAL,CAAc,EAAC,MAAM,KAAK,KAAL,CAAW,IAAX,EAArB;;;AAXqB,WAcjB,KAAK,WAAL,CAAiB,GAAjB,KAA0B,KAAK,KAAL,CAAW,IAAX,CAAgB,MAAhB,GAAyB,CAAzB,EAA6B;AACzD,8BAAE,KAAF,CAAQ;kBAAM,OAAK,UAAL,CAAgB,OAAK,KAAL,CAAW,IAAX,CAAgB,CAAhB,CAAhB;UAAN,CAAR,CADyD;QAA3D;;;;UAxKE;GAAa,gBAAM,SAAN;;AA8KnB,MAAK,SAAL,GAAiB;AACf,kBAAe,gBAAM,SAAN,CAAgB,IAAhB,CAAqB,UAArB;EADjB;;mBAIe,K;;;;;;AChNf,gD;;;;;;ACAA,gD","file":"index.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"), require(\"react-autobind\"), require(\"underscore\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\", \"react-autobind\", \"underscore\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"SaikuReactBootstrapTabs\"] = factory(require(\"react\"), require(\"react-autobind\"), require(\"underscore\"));\n\telse\n\t\troot[\"SaikuReactBootstrapTabs\"] = factory(root[\"react\"], root[\"react-autobind\"], root[\"underscore\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_4__, __WEBPACK_EXTERNAL_MODULE_5__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap bc35249045af7485e7db\n **/","/**\n * Copyright 2016 OSBI Ltd\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexports.Tab = require('./Tab');\nexports.Tabs = require('./Tabs');\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/index.js\n **/","/**\n * Copyright 2016 OSBI Ltd\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\n\n/**\n * This is the <Tab /> component. A tab should display its content if currently\n * selected. A tab must contain a tabKey and children.\n * @example\n * <Tab tabKey={2}>\n * <h1>Hello World</h1>\n * </Tab>\n */\nclass Tab extends React.Component {\n render() {\n return (\n <div className=\"tab-content\">\n <div\n role=\"tabpanel\"\n id={this.props.tabKey}\n className={'tab-pane' + (this.props.isSelected ? ' active' : '')}\n aria-hidden={!this.props.isSelected}\n >\n {this.props.children}\n </div>\n </div>\n );\n }\n}\n\nTab.propTypes = {\n tabKey: React.PropTypes.string.isRequired,\n isSelected: React.PropTypes.bool,\n children: React.PropTypes.node.isRequired\n};\n\nTab.defaultProps = {\n isSelected: false\n};\n\nexport default Tab;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/Tab.jsx\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external \"react\"\n ** module id = 2\n ** module chunks = 0\n **/","/**\n * Copyright 2016 OSBI Ltd\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport autoBind from 'react-autobind';\nimport _ from 'underscore';\nimport Tab from './Tab';\n\n/**\n * Saiku <Tabs /> component. It requires a createContent function, it is\n * responsible for populate the tab content, whenever the '+' button is pressed.\n * @example\n * function myContent() {\n * return (<h1>Tab Content</h1>);\n * }\n * <Tabs createContent={myContent}/>\n */\nclass Tabs extends React.Component {\n constructor(props) {\n super(props);\n\n this.id = _.uniqueId('tabs_');\n this.tabCounter = 1;\n this.state = {\n tabs: [],\n selectedTab: null\n };\n\n autoBind(this, 'renderTabButtons', 'renderTabPanels');\n autoBind(this, '_newTab', '_deleteTab', '_selectTab');\n }\n\n /**\n * Method automatically called when React already built and mounted the\n * component on a dom element. In this case, this method will create the\n * tabs' first tab, filled with the createContent function's content.\n */\n componentDidMount() {\n this._newTab();\n }\n\n render() {\n return (\n <div>\n <ul className=\"nav nav-tabs\" role=\"tablist\" key={this.id}>\n {this.state.tabs.map(this.renderTabButtons)}\n <li className=\"add-tab\" role=\"tab\">\n <a role=\"tab\" href=\"#\" onClick={this._newTab}>+</a>\n </li>\n </ul>\n {this.state.tabs.map(this.renderTabPanels)}\n </div>\n );\n }\n\n /**\n * Helper method called for each tab in order to render its button.\n * @param {Object} tab - an object containing tab data\n * @param {string} tab.key - unique tab identifier\n * @param {string} tab.title - text to be displayed on tab's button\n * @param {Object} tab.component - content returned by createContent function\n * @param {number} index - the index of the tab (the render order)\n */\n renderTabButtons(tab, index) {\n return (\n <li\n className={this._isSelected(tab) ? 'active' : ''}\n role=\"tab\"\n key={'tab_button_' + index}\n >\n <a\n role=\"tab\"\n href={'#' + tab.key}\n data-toggle=\"tab\"\n aria-expanded={this._isSelected(tab)}\n aria-controls={tab.key}\n onClick={(event) => this._selectTab(tab, event)}\n >\n <button\n className=\"close closeTab\"\n type=\"button\"\n onClick={(event) => this._deleteTab(tab, event)}\n >\n ×\n </button>\n {tab.title}\n </a>\n </li>\n );\n }\n\n /**\n * Helper method called for each tab in order to render its content.\n * @param {Object} tab - an object containing tab data\n * @param {string} tab.key - unique tab identifier\n * @param {string} tab.title - text to be displayed on tab's button\n * @param {Object} tab.component - content returned by createContent function\n * @param {number} index - the index of the tab (the render order)\n */\n renderTabPanels(tab, index) {\n return (\n <div className=\"tab-content\" key={tab.key + '_content'}>\n <Tab tabKey={tab.key} isSelected={this._isSelected(tab)}>\n {tab.component}\n </Tab>\n </div>\n );\n }\n\n /**\n * Utility method to test if a tab is selected of not.\n * @param {Object} tab - an object containing tab data\n * @param {string} tab.key - unique tab identifier\n * @param {string} tab.title - text to be displayed on tab's button\n * @param {Object} tab.component - content returned by createContent function\n */\n _isSelected(tab) {\n return tab.key === this.state.selectedTab;\n }\n\n /**\n * Method called when the '+' button is pressed. It will instantiate a new tab\n * component, passing the result of createContent function as its child. This\n * method also sets an incremental title to the tab ('Unsaved query(x)').\n */\n _newTab(event) {\n if (event) {\n event.preventDefault();\n }\n\n let tab = {\n key: _.uniqueId('tab_'),\n title: 'Unsaved query (' + (this.tabCounter) + ')',\n component: this.props.createContent()\n };\n\n this.state.tabs.push(tab);\n this.tabCounter++;\n\n this.setState({\n tabs: this.state.tabs\n });\n\n this._selectTab(tab);\n }\n\n /**\n * Method called when the user clicks on one tab button. It will set the\n * respective tab as the selected one.\n * @param {Object} tab - an object containing tab data\n * @param {string} tab.key - unique tab identifier\n * @param {string} tab.title - text to be displayed on tab's button\n * @param {Object} tab.component - content returned by createContent function\n */\n _selectTab(tab, event) {\n if (event) {\n event.preventDefault();\n }\n\n this.setState({selectedTab: tab.key});\n }\n\n /**\n * Method called when the user clicks on a tab's 'x' button. It will remove\n * this tab and, it it was the selected one, choose another tab to be the\n * new active.\n * @param {Object} tab - an object containing tab data\n * @param {string} tab.key - unique tab identifier\n * @param {string} tab.title - text to be displayed on tab's button\n * @param {Object} tab.component - content returned by createContent function\n */\n _deleteTab(tab, event) {\n if (event) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n let key = tab.key;\n let tabs = this.state.tabs;\n\n // Remove the tab\n this.state.tabs = _.without(tabs, _.findWhere(tabs, {key: key}));\n this.setState({tabs: this.state.tabs});\n\n // If the removed that is the selected, find and select another one\n if (this._isSelected(tab) && (this.state.tabs.length > 0)) {\n _.defer(() => this._selectTab(this.state.tabs[0]));\n }\n }\n}\n\nTabs.propTypes = {\n createContent: React.PropTypes.func.isRequired\n};\n\nexport default Tabs;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/Tabs.jsx\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_4__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external \"react-autobind\"\n ** module id = 4\n ** module chunks = 0\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_5__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external \"underscore\"\n ** module id = 5\n ** module chunks = 0\n **/"],"sourceRoot":""}