openstack-uicore-foundation 4.1.95 → 4.1.96

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.
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={418:(e,t,r)=>{r.d(t,{default:()=>d});var n=r(8213),o=r.n(n),s=r(3838),l=r.n(s),i=r(6689),a=r.n(i);const c=["children","replaceNewLine","className"],d=e=>{let{children:t,replaceNewLine:r=!1,className:n=""}=e,s=l()(e,c);return a().createElement("span",o()({className:n,dangerouslySetInnerHTML:{__html:r?null==t?void 0:t.replace(/\n/g,"<br />"):t}},s))}},8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},580:e=>{e.exports=require("prop-types")},6689:e=>{e.exports=require("react")},2076:e=>{e.exports=require("react-tooltip")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var n={};return(()=>{r.r(n),r.d(n,{default:()=>b});var e=r(6689),t=r.n(e),o=r(580),s=r.n(o);class l extends t().Component{constructor(e){super(e),this.handleSort=this.handleSort.bind(this)}getSortClass(){if(!this.props.sortable)return null;switch(this.props.sortDir){case 1:return"sorting_asc";case-1:return"sorting_desc";default:return this.props.sortable?"sorting":null}}handleSort(e){e.preventDefault(),this.props.hasOwnProperty("onSort")&&this.props.sortable&&this.props.onSort(this.props.columnIndex,this.props.columnKey,this.props.sortDir?-1*this.props.sortDir:1,this.props.sortFunc)}render(){return t().createElement("th",{onClick:this.handleSort,className:this.getSortClass(),width:this.props.width},this.props.children)}}l.propTypes={onSort:s().func,sortDir:s().number,columnIndex:s().number,columnKey:s().any,sortable:s().bool,sortFunc:s().func};const i=l;var a=r(418);const c=e=>{let{children:r}=e,n="";return r&&(n=t().isValidElement(r)?r:t().createElement(a.default,null,r.toString())),t().createElement("td",e,n)};class d extends t().Component{constructor(e){super(e),this.handleEdit=this.handleEdit.bind(this),this.handleSelect=this.handleSelect.bind(this)}shouldDisplayAction(e){let{id:t}=this.props;return!e.hasOwnProperty("display")||e.display(t)}handleEdit(e,t){"checkbox"!==t.target.type&&(t.stopPropagation(),t.preventDefault(),this.props.actions.edit.onClick(e))}handleSelect(e,t){this.props.actions.edit.onSelected(e,t.target.checked)}render(){let{even:e,actions:r,id:n,children:o,checked:s}=this.props,l=e?"even":"odd";return(null==r?void 0:r.edit)&&this.shouldDisplayAction(r.edit)?t().createElement("tr",{role:"row",className:l+" can-edit",onClick:this.handleEdit.bind(this,n)},t().createElement("td",{key:n+"_select"},t().createElement("input",{type:"checkbox",id:n+"_select",name:n+"_select",checked:s,onChange:this.handleSelect.bind(this,n)})),o):t().createElement("tr",{role:"row",className:l},t().createElement("td",{key:n+"_select"},t().createElement("input",{type:"checkbox",id:n+"_select",name:n+"_select",checked:s,onChange:this.handleSelect.bind(this,n)})),o)}}class p extends t().Component{constructor(e){super(e),this.handleAction=this.handleAction.bind(this),this.shouldDisplayAction=this.shouldDisplayAction.bind(this)}shouldDisplayAction(e){let{id:t}=this.props;return!e.hasOwnProperty("display")||e.display(t)}handleAction(e,t,r){r.stopPropagation(),r.preventDefault(),e(t)}render(){let{actions:e,id:r}=this.props;return t().createElement("td",{className:"actions",key:"actions"},e.hasOwnProperty("delete")&&this.shouldDisplayAction(e.delete)&&t().createElement("a",{href:"","data-tip":"delete",onClick:this.handleAction.bind(this,e.delete.onClick,r)},t().createElement("i",{className:"fa fa-trash-o delete-icon"})),e.hasOwnProperty("custom")&&e.custom.map((e=>this.shouldDisplayAction(e)&&t().createElement("a",{href:"","data-tip":e.tooltip,key:"custom_"+e.name,onClick:this.handleAction.bind(this,e.onClick,r)},e.icon))))}}var h=r(2076);const u={sortFunc:(e,t)=>e<t?-1:e>t?1:0,sortable:!1,sortCol:0,sortDir:1,colWidth:""},m=(e,t,r,n)=>e&&e===r||r===t?n:null;class y extends t().Component{constructor(e){super(e)}render(){var e,r,n;let{options:o,columns:s}=this.props,l=o.hasOwnProperty("className")?o.className:"";return l+=null!==(e=o.actions)&&void 0!==e&&e.edit?" table-hover":"",t().createElement("div",null,t().createElement("table",{className:"table table-striped selectableTable "+l},t().createElement("thead",null,t().createElement("tr",null,t().createElement("th",null,t().createElement("input",{type:"checkbox",id:"select_all",name:"select_all",onChange:null===(r=o.actions)||void 0===r||null===(n=r.edit)||void 0===n?void 0:n.onSelectedAll,checked:o.selectedAll})),s.map(((e,r)=>{let n=void 0!==o.sortCol?o.sortCol:u.sortCol,s=void 0!==o.sortDir?o.sortDir:u.sortDir,l=void 0!==o.sortFunc?o.sortFunc:u.sortFunc,a=void 0!==e.sortable?e.sortable:u.sortable,c=void 0!==e.width?e.width:u.colWidth;return t().createElement(i,{onSort:this.props.onSort,sortDir:m(e.columnKey,r,n,s),sortable:a,sortFunc:l,columnIndex:r,columnKey:e.columnKey,width:c,key:"heading_"+r},e.value)})),o.actions&&t().createElement(i,{key:"actions_heading"},o.actionsHeader||" "))),t().createElement("tbody",null,s.length>0&&this.props.data.map(((e,r)=>Array.isArray(e)&&e.length!==s.length?(console.warn(`Data at row ${r} is ${e.length}. It should be ${s.length}.`),t().createElement("tr",{key:"row_"+r})):t().createElement(d,{checked:e.checked,even:r%2==0,key:"row_"+e.id,id:e.id,actions:o.actions},((e,r,n)=>{var o=r.map(((r,n)=>r.hasOwnProperty("render")?t().createElement(c,{key:e.id+"_field"+n,name:r.columnKey,id:e.id},r.render(e,e[r.columnKey])):t().createElement(c,{key:e.id+"_field"+n,name:r.columnKey,id:e.id},e[r.columnKey])));return n&&o.push(t().createElement(p,{key:"actions_cell",id:e.id,actions:n})),o})(e,s,o.actions)))))),t().createElement(h.Tooltip,{delayShow:10}))}}const b=y})(),n})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={418:(e,t,r)=>{r.d(t,{default:()=>d});var n=r(8213),o=r.n(n),s=r(3838),l=r.n(s),i=r(6689),a=r.n(i);const c=["children","replaceNewLine","className"],d=e=>{let{children:t,replaceNewLine:r=!1,className:n=""}=e,s=l()(e,c);return a().createElement("span",o()({className:n,dangerouslySetInnerHTML:{__html:r?null==t?void 0:t.replace(/\n/g,"<br />"):t}},s))}},8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},580:e=>{e.exports=require("prop-types")},6689:e=>{e.exports=require("react")},2076:e=>{e.exports=require("react-tooltip")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var n={};return(()=>{r.r(n),r.d(n,{default:()=>b});var e=r(6689),t=r.n(e),o=r(580),s=r.n(o);class l extends t().Component{constructor(e){super(e),this.handleSort=this.handleSort.bind(this)}getSortClass(){if(!this.props.sortable)return null;switch(this.props.sortDir){case 1:return"sorting_asc";case-1:return"sorting_desc";default:return this.props.sortable?"sorting":null}}handleSort(e){e.preventDefault(),this.props.hasOwnProperty("onSort")&&this.props.sortable&&this.props.onSort(this.props.columnIndex,this.props.columnKey,this.props.sortDir?-1*this.props.sortDir:1,this.props.sortFunc)}render(){return t().createElement("th",{onClick:this.handleSort,className:this.getSortClass(),width:this.props.width},this.props.children)}}l.propTypes={onSort:s().func,sortDir:s().number,columnIndex:s().number,columnKey:s().any,sortable:s().bool,sortFunc:s().func};const i=l;var a=r(418);const c=e=>{let{children:r}=e,n="";return r&&(n=t().isValidElement(r)?r:t().createElement(a.default,null,r.toString())),t().createElement("td",e,n)};class d extends t().Component{constructor(e){super(e),this.handleEdit=this.handleEdit.bind(this),this.handleSelect=this.handleSelect.bind(this)}shouldDisplayAction(e){let{id:t}=this.props;return!e.hasOwnProperty("display")||e.display(t)}handleEdit(e,t){"checkbox"!==t.target.type&&(t.stopPropagation(),t.preventDefault(),this.props.actions.edit.onClick(e))}handleSelect(e,t){this.props.actions.edit.onSelected(e,t.target.checked)}render(){let{even:e,actions:r,id:n,children:o,checked:s}=this.props,l=e?"even":"odd";return(null==r?void 0:r.edit)&&this.shouldDisplayAction(r.edit)?t().createElement("tr",{role:"row",className:l+" can-edit",onClick:this.handleEdit.bind(this,n)},t().createElement("td",{key:n+"_select"},t().createElement("input",{type:"checkbox",id:n+"_select",name:n+"_select",checked:s,onChange:this.handleSelect.bind(this,n)})),o):t().createElement("tr",{role:"row",className:l},t().createElement("td",{key:n+"_select"},t().createElement("input",{type:"checkbox",id:n+"_select",name:n+"_select",checked:s,onChange:this.handleSelect.bind(this,n)})),o)}}class p extends t().Component{constructor(e){super(e),this.handleAction=this.handleAction.bind(this),this.shouldDisplayAction=this.shouldDisplayAction.bind(this)}shouldDisplayAction(e){let{id:t}=this.props;return!e.hasOwnProperty("display")||e.display(t)}handleAction(e,t,r){r.stopPropagation(),r.preventDefault(),e(t)}render(){let{actions:e,id:r}=this.props;return t().createElement("td",{className:"actions",key:"actions"},e.hasOwnProperty("delete")&&this.shouldDisplayAction(e.delete)&&t().createElement("a",{href:"","data-tip":"delete",onClick:this.handleAction.bind(this,e.delete.onClick,r)},t().createElement("i",{className:"fa fa-trash-o delete-icon"})),e.hasOwnProperty("custom")&&e.custom.map((e=>this.shouldDisplayAction(e)&&t().createElement("a",{href:"","data-tip":e.tooltip,key:"custom_"+e.name,onClick:this.handleAction.bind(this,e.onClick,r)},e.icon))))}}var h=r(2076);const u={sortFunc:(e,t)=>e<t?-1:e>t?1:0,sortable:!1,sortCol:0,sortDir:1,colWidth:""},m=(e,t,r,n)=>e&&e===r||r===t?n:null;class y extends t().Component{constructor(e){super(e)}render(){var e,r,n;let{options:o,columns:s}=this.props,l=o.hasOwnProperty("className")?o.className:"";return l+=null!==(e=o.actions)&&void 0!==e&&e.edit?" table-hover":"",t().createElement("div",null,t().createElement("table",{className:"table table-striped selectableTable "+l},t().createElement("thead",null,t().createElement("tr",null,t().createElement("th",null,!o.disableSelectAll&&t().createElement("input",{type:"checkbox",id:"select_all",name:"select_all",onChange:null===(r=o.actions)||void 0===r||null===(n=r.edit)||void 0===n?void 0:n.onSelectedAll,checked:o.selectedAll})),s.map(((e,r)=>{let n=void 0!==o.sortCol?o.sortCol:u.sortCol,s=void 0!==o.sortDir?o.sortDir:u.sortDir,l=void 0!==o.sortFunc?o.sortFunc:u.sortFunc,a=void 0!==e.sortable?e.sortable:u.sortable,c=void 0!==e.width?e.width:u.colWidth;return t().createElement(i,{onSort:this.props.onSort,sortDir:m(e.columnKey,r,n,s),sortable:a,sortFunc:l,columnIndex:r,columnKey:e.columnKey,width:c,key:"heading_"+r},e.value)})),o.actions&&t().createElement(i,{key:"actions_heading"},o.actionsHeader||" "))),t().createElement("tbody",null,s.length>0&&this.props.data.map(((e,r)=>Array.isArray(e)&&e.length!==s.length?(console.warn(`Data at row ${r} is ${e.length}. It should be ${s.length}.`),t().createElement("tr",{key:"row_"+r})):t().createElement(d,{checked:e.checked,even:r%2==0,key:"row_"+e.id,id:e.id,actions:o.actions},((e,r,n)=>{var o=r.map(((r,n)=>r.hasOwnProperty("render")?t().createElement(c,{key:e.id+"_field"+n,name:r.columnKey,id:e.id},r.render(e,e[r.columnKey])):t().createElement(c,{key:e.id+"_field"+n,name:r.columnKey,id:e.id},e[r.columnKey])));return n&&o.push(t().createElement(p,{key:"actions_cell",id:e.id,actions:n})),o})(e,s,o.actions)))))),t().createElement(h.Tooltip,{delayShow:10}))}}const b=y})(),n})()));
2
2
  //# sourceMappingURL=table-selectable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components/table-selectable.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,8BAA+B,GAAIH,GAChB,iBAAZC,QACdA,QAAQ,+BAAiCD,IAEzCD,EAAK,+BAAiCC,GACvC,CATD,CASGK,MAAM,I,8KCHT,EAJgB,QAAC,SAACC,EAAD,eAAWC,GAAiB,EAA5B,UAAmCC,EAAY,IAAhD,EAAuDC,EAAvD,gBACZ,8BAAMD,UAAWA,EACXE,wBAAyB,CAAEC,OAAQJ,EAAiBD,aAAH,EAAGA,EAAUM,QAAQ,MAAO,UAAYN,IAAeG,GAFlG,C,WCFhBP,EAAOD,QAAUY,QAAQ,iC,WCAzBX,EAAOD,QAAUY,QAAQ,iD,UCAzBX,EAAOD,QAAUY,QAAQ,a,WCAzBX,EAAOD,QAAUY,QAAQ,Q,WCAzBX,EAAOD,QAAUY,QAAQ,gB,GCCrBC,EAA2B,C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ASA,KAG/EsC,CAAP,EA2E6BE,CAAUP,EAAKT,EAASD,EAAQvB,cAMjD,kBAAC,EAAAyC,QAAD,CAASC,UAAW,KAG/B,EAIL,S","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/raw-html/index.js","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/extends\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/objectWithoutProperties\"","webpack://openstack-uicore-foundation/external commonjs \"prop-types\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/external commonjs \"react-tooltip\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/./src/components/table-selectable/SelectableTableHeading.js","webpack://openstack-uicore-foundation/./src/components/table-selectable/SelectableTableCell.js","webpack://openstack-uicore-foundation/./src/components/table-selectable/SelectableTableRow.js","webpack://openstack-uicore-foundation/./src/components/table-selectable/SelectableActionsTableCell.js","webpack://openstack-uicore-foundation/./src/components/table-selectable/SelectableTable.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","import React from 'react';\n\nconst RawHTML = ({children, replaceNewLine = false, className = \"\", ...rest}) =>\n <span className={className}\n dangerouslySetInnerHTML={{ __html: replaceNewLine ? children?.replace(/\\n/g, '<br />') : children}} {...rest}/>\n\nexport default RawHTML;","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"prop-types\");","module.exports = require(\"react\");","module.exports = require(\"react-tooltip\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import React from 'react';\nimport PropTypes from 'prop-types';\n\nclass SelectableTableHeading extends React.Component {\n\n\tconstructor (props) {\n\t\tsuper(props);\n\t\tthis.handleSort = this.handleSort.bind(this);\n\t}\n\n\tgetSortClass() {\n\n\t\tif (!this.props.sortable) return null;\n\n\t\tswitch(this.props.sortDir) {\n\t\t\tcase 1:\n\t\t\t\treturn 'sorting_asc';\n\t\t\tcase -1:\n\t\t\t\treturn 'sorting_desc';\n\t\t\tdefault:\n\t\t\t\treturn this.props.sortable ? 'sorting' : null\n\t\t}\n\t}\n\n\thandleSort(e) {\n\t\te.preventDefault();\n\t\tif(!this.props.hasOwnProperty('onSort') || !this.props.sortable) return;\n\n\t\tthis.props.onSort(\n\t\t\tthis.props.columnIndex,\n\t\t\tthis.props.columnKey,\n\t\t\tthis.props.sortDir ? this.props.sortDir*-1 : 1,\n\t\t\tthis.props.sortFunc\n\t\t);\n\t}\n\n\trender () {\n\t\treturn (\n\t\t\t<th onClick={this.handleSort}\n\t\t\t\tclassName={this.getSortClass()}\n\t\t\t\twidth={this.props.width}\n\t\t\t\t>\n\t\t\t\t{this.props.children}\n\t\t\t</th>\n\t\t);\t\n\t}\n\t\n}\n\nSelectableTableHeading.propTypes = {\n\tonSort: PropTypes.func,\n\tsortDir: PropTypes.number,\n\tcolumnIndex: PropTypes.number,\n\tcolumnKey: PropTypes.any,\n\tsortable: PropTypes.bool,\n\tsortFunc: PropTypes.func\n};\n\nexport default SelectableTableHeading;","import React from 'react';\nimport RawHTML from '../raw-html';\n\nconst SelectableTableCell = (props) => {\n let {children} = props;\n\tlet value = '';\n\tif(children) {\n\t if (React.isValidElement(children)) {\n\t value = children;\n } else {\n\t value = <RawHTML>{children.toString()}</RawHTML>\n }\n }\n\n\treturn (\n\t\t<td {...props}>\n {value}\n\t\t</td>\n\t);\n};\n\nexport default SelectableTableCell;\n","import React from 'react';\n\nexport default class SelectableTableRow extends React.Component {\n\n constructor(props) {\n super(props);\n this.handleEdit = this.handleEdit.bind(this);\n this.handleSelect = this.handleSelect.bind(this);\n }\n\n shouldDisplayAction(action) {\n let {id} = this.props;\n if (!action.hasOwnProperty('display')) {\n return true;\n } else {\n return action.display(id);\n }\n }\n\n handleEdit(id, ev) {\n // by pass\n if(ev.target.type === \"checkbox\")\n return;\n ev.stopPropagation();\n ev.preventDefault();\n this.props.actions.edit.onClick(id);\n }\n\n handleSelect(id, ev) {\n this.props.actions.edit.onSelected(id, ev.target.checked);\n }\n\n render() {\n\n let {even, actions, id, children, checked} = this.props;\n let canEdit = (actions?.edit && this.shouldDisplayAction(actions.edit));\n let rowClass = even ? 'even' : 'odd';\n\n if (canEdit) {\n return (\n <tr role=\"row\" className={rowClass + \" can-edit\"} onClick={this.handleEdit.bind(this, id)}>\n <td key={id + '_select'}>\n <input\n type=\"checkbox\"\n id={id + '_select'}\n name={id + '_select'}\n checked={checked}\n onChange={this.handleSelect.bind(this, id)}\n />\n </td>\n {children}\n </tr>\n );\n }\n\n return (\n <tr role=\"row\" className={rowClass}>\n <td key={id + '_select'} >\n <input\n type=\"checkbox\"\n id={id + '_select'}\n name={id + '_select'}\n checked={checked}\n onChange={this.handleSelect.bind(this, id)}\n />\n </td>\n {children}\n </tr>\n );\n\n }\n};\n\n","import React from 'react';\n\nexport default class SelectableActionsTableCell extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.handleAction = this.handleAction.bind(this);\n this.shouldDisplayAction = this.shouldDisplayAction.bind(this);\n\n }\n\n shouldDisplayAction(action) {\n let {id} = this.props;\n\n if (!action.hasOwnProperty('display')) {\n return true;\n } else {\n return action.display(id);\n }\n }\n\n handleAction(action, id, ev) {\n ev.stopPropagation();\n ev.preventDefault();\n\n action(id);\n }\n\n render() {\n let {actions, id} = this.props;\n return (\n <td className=\"actions\" key=\"actions\">\n {actions.hasOwnProperty('delete') && this.shouldDisplayAction(actions.delete) &&\n <a href=\"\" data-tip=\"delete\" onClick={this.handleAction.bind(this, actions.delete.onClick, id)} >\n <i className=\"fa fa-trash-o delete-icon\"></i>\n </a>\n }\n {actions.hasOwnProperty('custom') && actions.custom.map(a =>\n this.shouldDisplayAction(a) &&\n <a href=\"\" data-tip={a.tooltip} key={'custom_' + a.name} onClick={this.handleAction.bind(this, a.onClick, id)}>\n {a.icon}\n </a>\n )}\n </td>\n );\n }\n};\n","import React from 'react';\nimport SelectableTableHeading from './SelectableTableHeading';\nimport SelectableTableCell from './SelectableTableCell';\nimport SelectableTableRow from './SelectableTableRow';\nimport SelectableActionsTableCell from './SelectableActionsTableCell';\nimport { Tooltip } from 'react-tooltip'\nimport './selectable-table.less';\n\nconst defaults = {\n sortFunc: (a,b) => (a < b ? -1 : (a > b ? 1 : 0)),\n sortable: false,\n sortCol: 0,\n sortDir: 1,\n colWidth: ''\n}\n\nconst createRow = (row, columns, actions) => {\n\n var action_buttons = '';\n var cells = columns.map((col,i) => {\n if(col.hasOwnProperty(\"render\"))\n return (\n <SelectableTableCell key={row['id'] + '_field' + i} name={col.columnKey} id={row.id} >\n {col.render(row, row[col.columnKey])}\n </SelectableTableCell>\n );\n\n return (\n <SelectableTableCell key={row['id'] + '_field' + i} name={col.columnKey} id={row.id}>\n {row[col.columnKey]}\n </SelectableTableCell>\n );\n });\n\n if (actions) {\n cells.push(<SelectableActionsTableCell key='actions_cell' id={row['id']} actions={actions} />);\n }\n\n return cells;\n};\n\nconst getSortDir = (columnKey, columnIndex, sortCol, sortDir) => {\n if(columnKey && (columnKey === sortCol)) {\n return sortDir;\n }\n if(sortCol === columnIndex) {\n return sortDir;\n }\n return null\n};\n\n\nclass SelectableTable extends React.Component {\n\n constructor(props) {\n super(props);\n }\n\n render() {\n let {options, columns} = this.props;\n let tableClass = options.hasOwnProperty('className') ? options.className : '';\n tableClass += options.actions?.edit ? ' table-hover' : '';\n\n return (\n <div>\n <table className={\"table table-striped selectableTable \" + tableClass}>\n <thead>\n <tr>\n <th>\n <input type=\"checkbox\" id=\"select_all\"\n name=\"select_all\"\n onChange={options.actions?.edit?.onSelectedAll}\n checked={options.selectedAll}/>\n </th>\n {columns.map((col,i) => {\n\n let sortCol = (typeof options.sortCol != 'undefined') ? options.sortCol : defaults.sortCol;\n let sortDir = (typeof options.sortDir != 'undefined') ? options.sortDir : defaults.sortDir;\n let sortFunc = (typeof options.sortFunc != 'undefined') ? options.sortFunc : defaults.sortFunc;\n let sortable = (typeof col.sortable != 'undefined') ? col.sortable : defaults.sortable;\n let colWidth = (typeof col.width != 'undefined') ? col.width : defaults.colWidth;\n\n return (\n <SelectableTableHeading\n onSort={this.props.onSort}\n sortDir={getSortDir(col.columnKey, i, sortCol, sortDir)}\n sortable={sortable}\n sortFunc={sortFunc}\n columnIndex={i}\n columnKey={col.columnKey}\n width={colWidth}\n key={'heading_'+i}\n >\n {col.value}\n </SelectableTableHeading>\n );\n })}\n {options.actions &&\n <SelectableTableHeading key='actions_heading' >\n {options.actionsHeader || ' '}\n </SelectableTableHeading>\n }\n </tr>\n </thead>\n <tbody>\n {columns.length > 0 && this.props.data.map((row,i) => {\n if(Array.isArray(row) && row.length !== columns.length) {\n console.warn(`Data at row ${i} is ${row.length}. It should be ${columns.length}.`);\n return <tr key={'row_'+i} />\n }\n\n return (\n <SelectableTableRow checked={row.checked} even={i%2 === 0} key={'row_'+row['id']} id={row['id']} actions={options.actions}>\n {createRow(row, columns, options.actions)}\n </SelectableTableRow>\n );\n })}\n </tbody>\n </table>\n <Tooltip delayShow={10} />\n </div>\n );\n }\n}\n\n\nexport default SelectableTable;\n"],"names":["root","factory","exports","module","define","amd","this","children","replaceNewLine","className","rest","dangerouslySetInnerHTML","__html","replace","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","SelectableTableHeading","React","constructor","props","super","handleSort","bind","getSortClass","sortable","sortDir","e","preventDefault","onSort","columnIndex","columnKey","sortFunc","render","onClick","width","propTypes","PropTypes","toString","SelectableTableRow","handleEdit","handleSelect","shouldDisplayAction","action","id","display","ev","target","type","stopPropagation","actions","edit","onSelected","checked","even","rowClass","role","name","onChange","SelectableActionsTableCell","handleAction","delete","href","custom","map","tooltip","icon","defaults","b","sortCol","colWidth","getSortDir","SelectableTable","options","columns","tableClass","onSelectedAll","selectedAll","col","i","actionsHeader","length","data","row","Array","isArray","console","warn","cells","push","createRow","Tooltip","delayShow"],"sourceRoot":""}
1
+ {"version":3,"file":"components/table-selectable.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,8BAA+B,GAAIH,GAChB,iBAAZC,QACdA,QAAQ,+BAAiCD,IAEzCD,EAAK,+BAAiCC,GACvC,CATD,CASGK,MAAM,I,8KCHT,EAJgB,QAAC,SAACC,EAAD,eAAWC,GAAiB,EAA5B,UAAmCC,EAAY,IAAhD,EAAuDC,EAAvD,gBACZ,8BAAMD,UAAWA,EACXE,wBAAyB,CAAEC,OAAQJ,EAAiBD,aAAH,EAAGA,EAAUM,QAAQ,MAAO,UAAYN,IAAeG,GAFlG,C,WCFhBP,EAAOD,QAAUY,QAAQ,iC,WCAzBX,EAAOD,QAAUY,QAAQ,iD,UCAzBX,EAAOD,QAAUY,QAAQ,a,WCAzBX,EAAOD,QAAUY,QAAQ,Q,WCAzBX,EAAOD,QAAUY,QAAQ,gB,GCCrBC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAahB,QAGrB,IAAIC,EAASY,EAAyBE,GAAY,CAGjDf,QAAS,CAAC,GAOX,OAHAkB,EAAoBH,GAAUd,EAAQA,EAAOD,QAASc,GAG/Cb,EAAOD,OACf,C,MCrBAc,EAAoBK,EAAKlB,IACxB,IAAImB,EAASnB,GAAUA,EAAOoB,WAC7B,IAAOpB,EAAiB,QACxB,IAAM,EAEP,OADAa,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,C,WCLdN,EAAoBQ,EAAI,CAACtB,EAASwB,KACjC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,EAAEF,EAAYC,KAASX,EAAoBY,EAAE1B,EAASyB,IA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AIF,wBAAwBR,EAAQQ,WAExD,wBAAIhF,IAAK,OAAS8E,KAIzB,kBAACzC,EAAD,CACIc,QAAS+B,EAAI/B,QACbC,KAAM0B,EAAI,GAAM,EAChB9E,IAAK,OAASkF,EAAG,GACjBxC,GAAIwC,EAAG,GACPlC,QAASuB,EAAQvB,SAtJvC,EAACkC,EAAKV,EAASxB,KAC7B,IACIuC,EAAQf,EAAQV,KAAI,CAACe,EAAKC,IACtBD,EAAIpE,eAAe,UAEf,kBAAC,EAAD,CACIT,IAAKkF,EAAG,GAAS,SAAWJ,EAC5BvB,KAAMsB,EAAIhD,UACVa,GAAIwC,EAAIxC,IAEPmC,EAAI9C,OAAOmD,EAAKA,EAAIL,EAAIhD,aAKjC,kBAAC,EAAD,CACI7B,IAAKkF,EAAG,GAAS,SAAWJ,EAC5BvB,KAAMsB,EAAIhD,UACVa,GAAIwC,EAAIxC,IAEPwC,EAAIL,EAAIhD,cAerB,OAVImB,GACAuC,EAAMC,KACF,kBAAC/B,EAAD,CACIzD,IAAI,eACJ0C,GAAIwC,EAAG,GACPlC,QAASA,KAKduC,CAAP,EAqHqCE,CACGP,EACAV,EACAD,EAAQvB,cAOpC,kBAAC,EAAA0C,QAAD,CAASC,UAAW,KAG/B,EAGL,S","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/raw-html/index.js","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/extends\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/objectWithoutProperties\"","webpack://openstack-uicore-foundation/external commonjs \"prop-types\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/external commonjs \"react-tooltip\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/./src/components/table-selectable/SelectableTableHeading.js","webpack://openstack-uicore-foundation/./src/components/table-selectable/SelectableTableCell.js","webpack://openstack-uicore-foundation/./src/components/table-selectable/SelectableTableRow.js","webpack://openstack-uicore-foundation/./src/components/table-selectable/SelectableActionsTableCell.js","webpack://openstack-uicore-foundation/./src/components/table-selectable/SelectableTable.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","import React from 'react';\n\nconst RawHTML = ({children, replaceNewLine = false, className = \"\", ...rest}) =>\n <span className={className}\n dangerouslySetInnerHTML={{ __html: replaceNewLine ? children?.replace(/\\n/g, '<br />') : children}} {...rest}/>\n\nexport default RawHTML;","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"prop-types\");","module.exports = require(\"react\");","module.exports = require(\"react-tooltip\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import React from 'react';\nimport PropTypes from 'prop-types';\n\nclass SelectableTableHeading extends React.Component {\n\n\tconstructor (props) {\n\t\tsuper(props);\n\t\tthis.handleSort = this.handleSort.bind(this);\n\t}\n\n\tgetSortClass() {\n\n\t\tif (!this.props.sortable) return null;\n\n\t\tswitch(this.props.sortDir) {\n\t\t\tcase 1:\n\t\t\t\treturn 'sorting_asc';\n\t\t\tcase -1:\n\t\t\t\treturn 'sorting_desc';\n\t\t\tdefault:\n\t\t\t\treturn this.props.sortable ? 'sorting' : null\n\t\t}\n\t}\n\n\thandleSort(e) {\n\t\te.preventDefault();\n\t\tif(!this.props.hasOwnProperty('onSort') || !this.props.sortable) return;\n\n\t\tthis.props.onSort(\n\t\t\tthis.props.columnIndex,\n\t\t\tthis.props.columnKey,\n\t\t\tthis.props.sortDir ? this.props.sortDir*-1 : 1,\n\t\t\tthis.props.sortFunc\n\t\t);\n\t}\n\n\trender () {\n\t\treturn (\n\t\t\t<th onClick={this.handleSort}\n\t\t\t\tclassName={this.getSortClass()}\n\t\t\t\twidth={this.props.width}\n\t\t\t\t>\n\t\t\t\t{this.props.children}\n\t\t\t</th>\n\t\t);\t\n\t}\n\t\n}\n\nSelectableTableHeading.propTypes = {\n\tonSort: PropTypes.func,\n\tsortDir: PropTypes.number,\n\tcolumnIndex: PropTypes.number,\n\tcolumnKey: PropTypes.any,\n\tsortable: PropTypes.bool,\n\tsortFunc: PropTypes.func\n};\n\nexport default SelectableTableHeading;","import React from 'react';\nimport RawHTML from '../raw-html';\n\nconst SelectableTableCell = (props) => {\n let {children} = props;\n\tlet value = '';\n\tif(children) {\n\t if (React.isValidElement(children)) {\n\t value = children;\n } else {\n\t value = <RawHTML>{children.toString()}</RawHTML>\n }\n }\n\n\treturn (\n\t\t<td {...props}>\n {value}\n\t\t</td>\n\t);\n};\n\nexport default SelectableTableCell;\n","import React from 'react';\n\nexport default class SelectableTableRow extends React.Component {\n\n constructor(props) {\n super(props);\n this.handleEdit = this.handleEdit.bind(this);\n this.handleSelect = this.handleSelect.bind(this);\n }\n\n shouldDisplayAction(action) {\n let {id} = this.props;\n if (!action.hasOwnProperty('display')) {\n return true;\n } else {\n return action.display(id);\n }\n }\n\n handleEdit(id, ev) {\n // by pass\n if(ev.target.type === \"checkbox\")\n return;\n ev.stopPropagation();\n ev.preventDefault();\n this.props.actions.edit.onClick(id);\n }\n\n handleSelect(id, ev) {\n this.props.actions.edit.onSelected(id, ev.target.checked);\n }\n\n render() {\n\n let {even, actions, id, children, checked} = this.props;\n let canEdit = (actions?.edit && this.shouldDisplayAction(actions.edit));\n let rowClass = even ? 'even' : 'odd';\n\n if (canEdit) {\n return (\n <tr role=\"row\" className={rowClass + \" can-edit\"} onClick={this.handleEdit.bind(this, id)}>\n <td key={id + '_select'}>\n <input\n type=\"checkbox\"\n id={id + '_select'}\n name={id + '_select'}\n checked={checked}\n onChange={this.handleSelect.bind(this, id)}\n />\n </td>\n {children}\n </tr>\n );\n }\n\n return (\n <tr role=\"row\" className={rowClass}>\n <td key={id + '_select'} >\n <input\n type=\"checkbox\"\n id={id + '_select'}\n name={id + '_select'}\n checked={checked}\n onChange={this.handleSelect.bind(this, id)}\n />\n </td>\n {children}\n </tr>\n );\n\n }\n};\n\n","import React from 'react';\n\nexport default class SelectableActionsTableCell extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.handleAction = this.handleAction.bind(this);\n this.shouldDisplayAction = this.shouldDisplayAction.bind(this);\n\n }\n\n shouldDisplayAction(action) {\n let {id} = this.props;\n\n if (!action.hasOwnProperty('display')) {\n return true;\n } else {\n return action.display(id);\n }\n }\n\n handleAction(action, id, ev) {\n ev.stopPropagation();\n ev.preventDefault();\n\n action(id);\n }\n\n render() {\n let {actions, id} = this.props;\n return (\n <td className=\"actions\" key=\"actions\">\n {actions.hasOwnProperty('delete') && this.shouldDisplayAction(actions.delete) &&\n <a href=\"\" data-tip=\"delete\" onClick={this.handleAction.bind(this, actions.delete.onClick, id)} >\n <i className=\"fa fa-trash-o delete-icon\"></i>\n </a>\n }\n {actions.hasOwnProperty('custom') && actions.custom.map(a =>\n this.shouldDisplayAction(a) &&\n <a href=\"\" data-tip={a.tooltip} key={'custom_' + a.name} onClick={this.handleAction.bind(this, a.onClick, id)}>\n {a.icon}\n </a>\n )}\n </td>\n );\n }\n};\n","import React from 'react';\nimport SelectableTableHeading from './SelectableTableHeading';\nimport SelectableTableCell from './SelectableTableCell';\nimport SelectableTableRow from './SelectableTableRow';\nimport SelectableActionsTableCell from './SelectableActionsTableCell';\nimport { Tooltip } from 'react-tooltip'\nimport './selectable-table.less';\n\nconst defaults = {\n sortFunc: (a, b) => (a < b ? -1 : a > b ? 1 : 0),\n sortable: false,\n sortCol: 0,\n sortDir: 1,\n colWidth: \"\",\n};\n\nconst createRow = (row, columns, actions) => {\n var action_buttons = \"\";\n var cells = columns.map((col, i) => {\n if (col.hasOwnProperty(\"render\"))\n return (\n <SelectableTableCell\n key={row[\"id\"] + \"_field\" + i}\n name={col.columnKey}\n id={row.id}\n >\n {col.render(row, row[col.columnKey])}\n </SelectableTableCell>\n );\n\n return (\n <SelectableTableCell\n key={row[\"id\"] + \"_field\" + i}\n name={col.columnKey}\n id={row.id}\n >\n {row[col.columnKey]}\n </SelectableTableCell>\n );\n });\n\n if (actions) {\n cells.push(\n <SelectableActionsTableCell\n key=\"actions_cell\"\n id={row[\"id\"]}\n actions={actions}\n />\n );\n }\n\n return cells;\n};\n\nconst getSortDir = (columnKey, columnIndex, sortCol, sortDir) => {\n if (columnKey && columnKey === sortCol) {\n return sortDir;\n }\n if (sortCol === columnIndex) {\n return sortDir;\n }\n return null;\n};\n\nclass SelectableTable extends React.Component {\n constructor(props) {\n super(props);\n }\n\n render() {\n let { options, columns } = this.props;\n let tableClass = options.hasOwnProperty(\"className\")\n ? options.className\n : \"\";\n tableClass += options.actions?.edit ? \" table-hover\" : \"\";\n\n return (\n <div>\n <table\n className={\n \"table table-striped selectableTable \" + tableClass\n }\n >\n <thead>\n <tr>\n <th>\n {!options.disableSelectAll && (\n <input\n type=\"checkbox\"\n id=\"select_all\"\n name=\"select_all\"\n onChange={\n options.actions?.edit?.onSelectedAll\n }\n checked={options.selectedAll}\n />\n )}\n </th>\n {columns.map((col, i) => {\n let sortCol =\n typeof options.sortCol != \"undefined\"\n ? options.sortCol\n : defaults.sortCol;\n let sortDir =\n typeof options.sortDir != \"undefined\"\n ? options.sortDir\n : defaults.sortDir;\n let sortFunc =\n typeof options.sortFunc != \"undefined\"\n ? options.sortFunc\n : defaults.sortFunc;\n let sortable =\n typeof col.sortable != \"undefined\"\n ? col.sortable\n : defaults.sortable;\n let colWidth =\n typeof col.width != \"undefined\"\n ? col.width\n : defaults.colWidth;\n\n return (\n <SelectableTableHeading\n onSort={this.props.onSort}\n sortDir={getSortDir(\n col.columnKey,\n i,\n sortCol,\n sortDir\n )}\n sortable={sortable}\n sortFunc={sortFunc}\n columnIndex={i}\n columnKey={col.columnKey}\n width={colWidth}\n key={\"heading_\" + i}\n >\n {col.value}\n </SelectableTableHeading>\n );\n })}\n {options.actions && (\n <SelectableTableHeading key=\"actions_heading\">\n {options.actionsHeader || \" \"}\n </SelectableTableHeading>\n )}\n </tr>\n </thead>\n <tbody>\n {columns.length > 0 &&\n this.props.data.map((row, i) => {\n if (\n Array.isArray(row) &&\n row.length !== columns.length\n ) {\n console.warn(\n `Data at row ${i} is ${row.length}. It should be ${columns.length}.`\n );\n return <tr key={\"row_\" + i} />;\n }\n\n return (\n <SelectableTableRow\n checked={row.checked}\n even={i % 2 === 0}\n key={\"row_\" + row[\"id\"]}\n id={row[\"id\"]}\n actions={options.actions}\n >\n {createRow(\n row,\n columns,\n options.actions\n )}\n </SelectableTableRow>\n );\n })}\n </tbody>\n </table>\n <Tooltip delayShow={10} />\n </div>\n );\n }\n}\n\nexport default SelectableTable;\n"],"names":["root","factory","exports","module","define","amd","this","children","replaceNewLine","className","rest","dangerouslySetInnerHTML","__html","replace","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","SelectableTableHeading","React","constructor","props","super","handleSort","bind","getSortClass","sortable","sortDir","e","preventDefault","onSort","columnIndex","columnKey","sortFunc","render","onClick","width","propTypes","PropTypes","toString","SelectableTableRow","handleEdit","handleSelect","shouldDisplayAction","action","id","display","ev","target","type","stopPropagation","actions","edit","onSelected","checked","even","rowClass","role","name","onChange","SelectableActionsTableCell","handleAction","delete","href","custom","map","tooltip","icon","defaults","b","sortCol","colWidth","getSortDir","SelectableTable","options","columns","tableClass","disableSelectAll","onSelectedAll","selectedAll","col","i","actionsHeader","length","data","row","Array","isArray","console","warn","cells","push","createRow","Tooltip","delayShow"],"sourceRoot":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openstack-uicore-foundation",
3
- "version": "4.1.95",
3
+ "version": "4.1.96",
4
4
  "description": "ui reactjs components for openstack marketing site",
5
5
  "main": "lib/openstack-uicore-foundation.js",
6
6
  "scripts": {