openstack-uicore-foundation 4.1.61 → 4.1.63

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.
Files changed (33) hide show
  1. package/lib/components/extra-questions.js +1 -1
  2. package/lib/components/extra-questions.js.map +1 -1
  3. package/lib/components/free-text-search.js +1 -1
  4. package/lib/components/free-text-search.js.map +1 -1
  5. package/lib/components/index.js +1 -1
  6. package/lib/components/index.js.map +1 -1
  7. package/lib/components/simple-link-list.js +1 -1
  8. package/lib/components/simple-link-list.js.map +1 -1
  9. package/lib/components/table-editable.js +1 -1
  10. package/lib/components/table-editable.js.map +1 -1
  11. package/lib/components/table-selectable.js +1 -1
  12. package/lib/components/table-selectable.js.map +1 -1
  13. package/lib/components/table-sortable.js +1 -1
  14. package/lib/components/table-sortable.js.map +1 -1
  15. package/lib/components/table.js +1 -1
  16. package/lib/components/table.js.map +1 -1
  17. package/lib/css/components/extra-questions.css +1 -1
  18. package/lib/css/components/extra-questions.css.map +1 -1
  19. package/lib/css/components/free-text-search.css +1 -1
  20. package/lib/css/components/free-text-search.css.map +1 -1
  21. package/lib/css/components/index.css +2 -2
  22. package/lib/css/components/index.css.map +1 -1
  23. package/lib/css/components/simple-link-list.css +1 -1
  24. package/lib/css/components/simple-link-list.css.map +1 -1
  25. package/lib/css/components/table-editable.css +1 -1
  26. package/lib/css/components/table-editable.css.map +1 -1
  27. package/lib/css/components/table-selectable.css +1 -1
  28. package/lib/css/components/table-selectable.css.map +1 -1
  29. package/lib/css/components/table-sortable.css +1 -1
  30. package/lib/css/components/table-sortable.css.map +1 -1
  31. package/lib/css/components/table.css +1 -1
  32. package/lib/css/components/table.css.map +1 -1
  33. package/package.json +1 -1
@@ -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,OA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B,IACIsC,EAAQd,EAAQV,KAAI,CAACc,EAAIC,IACtBD,EAAInE,eAAe,UAEd,kBAAC,EAAD,CAAqBT,IAAKiF,EAAG,GAAS,SAAWJ,EAAGtB,KAAMqB,EAAI/C,UAAWa,GAAIuC,EAAIvC,IAC5EkC,EAAI7C,OAAOkD,EAAKA,EAAIL,EAAI/C,aAKjC,kBAAC,EAAD,CAAqB7B,IAAKiF,EAAG,GAAS,SAAWJ,EAAGtB,KAAMqB,EAAI/C,UAAWa,GAAIuC,EAAIvC,IAC5EuC,EAAIL,EAAI/C,cASrB,OAJImB,GACAsC,EAAMC,KAAK,kBAAC9B,EAAD,CAA4BzD,IAAI,eAAe0C,GAAIuC,EAAG,GAAQjC,QAASA,KAG/EsC,CAAP,EA2E6BE,CAAUP,EAAKT,EAASD,EAAQvB,cAMjD,kBAAC,IAAD,CAAcyC,UAAW,KAGpC,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.hasOwnProperty('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 ReactTooltip from 'react-tooltip'\nimport './selectable-table.css';\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.hasOwnProperty('edit')) ? ' table-hover' : '';\n\n return (\n <div>\n <table className={\"table table-striped dataTable \" + 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 <ReactTooltip 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","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,G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,cAMjD,kBAAC,IAAD,CAAcyC,UAAW,KAGpC,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 ReactTooltip 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 <ReactTooltip 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","delayShow"],"sourceRoot":""}
@@ -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),l=r(3838),i=r.n(l),a=r(6689),c=r.n(a);const s=["children","replaceNewLine","className"],d=e=>{let{children:t,replaceNewLine:r=!1,className:n=""}=e,l=i()(e,s);return c().createElement("span",o()({className:n,dangerouslySetInnerHTML:{__html:r?null==t?void 0:t.replace(/\n/g,"<br />"):t}},l))}},4391:(e,t,r)=>{r.d(t,{Z:()=>i});var n=r(6689),o=r.n(n),l=r(418);const i=e=>{let{children:t}=e,r="";return t&&(r=o().isValidElement(t)?t:o().createElement(l.default,null,t.toString())),o().createElement("td",e,r)}},8779:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},6517:e=>{e.exports=require("lodash")},580:e=>{e.exports=require("prop-types")},6689:e=>{e.exports=require("react")},7964:e=>{e.exports=require("react-dnd")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var l=t[n]={exports:{}};return e[n](l,l.exports,r),l.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:()=>C});var e=r(8779),t=r.n(e),o=r(6689),l=r.n(o),i=r(580),a=r.n(i);const c=require("immutability-helper");var s=r.n(c),d=r(7964);const u=require("react-dnd-html5-backend");class p extends l().Component{constructor(e){super(e)}render(){return l().createElement("th",{width:this.props.width},this.props.children)}}const m=p;class h extends l().Component{constructor(e){super(e),this.handleAction=this.handleAction.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:t}=this.props;return l().createElement("td",{className:"actions",key:"actions"},e.hasOwnProperty("edit")&&this.shouldDisplayAction(e.edit)&&l().createElement("a",{href:"","data-tip":"edit",onClick:this.handleAction.bind(this,e.edit.onClick,t)},l().createElement("i",{className:"fa fa-pencil-square-o"})),e.hasOwnProperty("delete")&&this.shouldDisplayAction(e.delete)&&l().createElement("a",{href:"","data-tip":"delete",onClick:this.handleAction.bind(this,e.delete.onClick,t)},l().createElement("i",{className:"fa fa-trash-o delete-icon"})),"custom"in e&&e.custom.map((e=>this.shouldDisplayAction(e,t)&&l().createElement("a",{href:"","data-tip":e.tooltip,key:"custom_"+e.name,onClick:this.handleAction.bind(this,e.onClick,t)},e.icon))))}}function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?y(Object(n),!0).forEach((function(r){t()(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const f=({text:e,even:t,id:r,index:n,moveCard:i,dropItem:a,children:c,findRow:s})=>{const u=s(r).index,p=(0,o.useRef)(null),[{handlerId:m},h]=(0,d.useDrop)({accept:"row",collect:e=>({handlerId:e.getHandlerId()}),hover(e,t){var r;if(!p.current)return;const o=e.index,l=n;if(o===l)return;const a=null===(r=p.current)||void 0===r?void 0:r.getBoundingClientRect(),c=(a.bottom-a.top)/2,s=t.getClientOffset().y-a.top;o<l&&s<c||o>l&&s>c||(i(o,l),e.index=l)}}),[{isDragging:y},f]=(0,d.useDrag)({type:"row",item:()=>({id:r,index:n}),end:(e,t)=>{const{id:r,index:n}=e;return t.didDrop()?a(r,n+1):i(n,u)},collect:e=>({isDragging:e.isDragging()})}),v=y?0:1;return f(h(p)),l().createElement("tr",{id:r,ref:p,role:"row",className:t?"even":"odd",style:b(b({},{border:"1px dashed gray",padding:"0.5rem 1rem",marginBottom:".5rem",backgroundColor:"white",cursor:"move"}),{},{opacity:v})},c)};f.propTypes={index:a().number.isRequired,id:a().any.isRequired,moveCard:a().func.isRequired};const v=f;var g=r(4656),O=r.n(g),w=r(4391),k=r(6517),E=r.n(k);function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const P="",j=({data:e,options:r,columns:n,dropCallback:i,orderField:a,idField:c})=>{var p,y,b,f;const[g,k]=(0,o.useState)(e),[j,C]=(0,o.useState)({});(0,o.useEffect)((()=>{k(e)}),[e]);const D=(e,t,r,n)=>l().createElement(v,{even:n%2==0,key:e.id,index:n,id:e.id,moveCard:N,findRow:_,dropItem:A},((e,t,r)=>{let n=t.map(((t,r)=>t.hasOwnProperty("render")?l().createElement(w.Z,{key:"cell_"+r,title:t.hasOwnProperty("title")?e[t.columnKey]:null},t.render(e,e[t.columnKey])):l().createElement(w.Z,{key:"cell_"+r,title:t.hasOwnProperty("title")?e[t.columnKey]:null},e[t.columnKey])));return r&&n.push(l().createElement(h,{key:"actions",id:e.id,actions:r})),n})(e,t,r.actions)),q=e=>(e.sort((function(e,t){const r=e[a],n=t[a];return r<n?-1:r>n?1:0})),e),_=(0,o.useCallback)((e=>{const t=g.filter((t=>t[c]===e))[0];return{row:t,index:g.indexOf(t)}}),[g]),N=(0,o.useCallback)(((e,t)=>{k((r=>{r=s()(r,{$splice:[[e,1],[t,0,r[e]]]});for(let e in r)r[e][a]=parseInt(e)+1;return q(r)}))}),[g,k]),A=(e,t)=>{const r=q(g);k(r),i(r,e,t)};let R=r.hasOwnProperty("className")?r.className:"",S=(null==r||null===(p=r.actions)||void 0===p||null===(y=p.save)||void 0===y?void 0:y.onClick)&&null!==(null==r||null===(b=r.actions)||void 0===b||null===(f=b.save)||void 0===f?void 0:f.onClick);return l().createElement("div",{className:"sortable-table-box"},l().createElement("i",null,O().translate("general.drag_and_drop")),l().createElement("table",{className:"table table-striped table-hover sortableTable "+R},l().createElement("thead",null,l().createElement("tr",null,n.map(((e,t)=>{let r=e.width?e.width:P;return l().createElement(m,{width:r,key:t},e.value)})),r.actions&&!E().isEmpty(r.actions)&&l().createElement(m,{key:"actions"},"Actions"))),l().createElement("tbody",null,n.length>0&&g.map(((e,t)=>Array.isArray(e)&&e.length!==n.length?(console.warn(`Data at row ${t} is ${e.length}. It should be ${n.length}.`),l().createElement("tr",null)):l().createElement(d.DndProvider,{backend:u.HTML5Backend,key:t},D(e,n,r,t))))),S&&l().createElement("tfoot",null,l().createElement("tr",null,((e,t,r,n)=>{let o=e.map(((e,r)=>{let o=void 0!==t[e.columnKey]?t[e.columnKey]:"";return"checkbox"===(null==e?void 0:e.input)?l().createElement("td",{key:"new_row_"+r,className:"checkbox-cell"},l().createElement("input",{type:"checkbox",id:"new_"+e.columnKey,name:e.columnKey,onChange:n,checked:o,title:null==e?void 0:e.value})):l().createElement("td",{key:"new_row_"+r},l().createElement("input",{className:"form-control",id:"new_"+e.columnKey,name:e.columnKey,placeholder:null==e?void 0:e.value,onChange:n,value:o}))}));return o.push(l().createElement("td",{key:"add_new"},l().createElement("button",{className:"btn btn-default",onClick:r}," Add"))),o})(n,j,(e=>{var t,n;e.preventDefault(),null==r||null===(t=r.actions)||void 0===t||null===(n=t.save)||void 0===n||n.onClick(j),C({})}),(e=>{let r=e.target,n=function(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?x(Object(n),!0).forEach((function(r){t()(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},j),{name:o,value:l}=r;"checkbox"===r.type&&(l=r.checked),n[o]=l,C(n)}))))))};j.defaultProps={idField:"id"},j.propTypes={data:a().array.isRequired,options:a().shape({className:a().string,actions:a().object}).isRequired,columns:a().arrayOf(a().shape({columnKey:a().string.isRequired,value:a().any.isRequired,input:a().string,render:a().func})).isRequired,dropCallback:a().func.isRequired,orderField:a().string.isRequired,idField:a().string};const C=j})(),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),l=r(3838),i=r.n(l),a=r(6689),c=r.n(a);const s=["children","replaceNewLine","className"],d=e=>{let{children:t,replaceNewLine:r=!1,className:n=""}=e,l=i()(e,s);return c().createElement("span",o()({className:n,dangerouslySetInnerHTML:{__html:r?null==t?void 0:t.replace(/\n/g,"<br />"):t}},l))}},4391:(e,t,r)=>{r.d(t,{Z:()=>i});var n=r(6689),o=r.n(n),l=r(418);const i=e=>{let{children:t}=e,r="";return t&&(r=o().isValidElement(t)?t:o().createElement(l.default,null,t.toString())),o().createElement("td",e,r)}},8779:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},6517:e=>{e.exports=require("lodash")},580:e=>{e.exports=require("prop-types")},6689:e=>{e.exports=require("react")},7964:e=>{e.exports=require("react-dnd")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var l=t[n]={exports:{}};return e[n](l,l.exports,r),l.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:()=>P});var e=r(8779),t=r.n(e),o=r(6689),l=r.n(o),i=r(580),a=r.n(i);const c=require("immutability-helper");var s=r.n(c),d=r(7964);const u=require("react-dnd-html5-backend");class p extends l().Component{constructor(e){super(e)}render(){return l().createElement("th",{width:this.props.width},this.props.children)}}const m=p;class h extends l().Component{constructor(e){super(e),this.handleAction=this.handleAction.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:t}=this.props;return l().createElement("td",{className:"actions",key:"actions"},e.hasOwnProperty("edit")&&this.shouldDisplayAction(e.edit)&&l().createElement("a",{href:"","data-tip":"edit",onClick:this.handleAction.bind(this,e.edit.onClick,t)},l().createElement("i",{className:"fa fa-pencil-square-o"})),e.hasOwnProperty("delete")&&this.shouldDisplayAction(e.delete)&&l().createElement("a",{href:"","data-tip":"delete",onClick:this.handleAction.bind(this,e.delete.onClick,t)},l().createElement("i",{className:"fa fa-trash-o delete-icon"})),"custom"in e&&e.custom.map((e=>this.shouldDisplayAction(e,t)&&l().createElement("a",{href:"","data-tip":e.tooltip,key:"custom_"+e.name,onClick:this.handleAction.bind(this,e.onClick,t)},e.icon))))}}function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?y(Object(n),!0).forEach((function(r){t()(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const f=({text:e,even:t,id:r,index:n,moveCard:i,dropItem:a,children:c,findRow:s})=>{const u=s(r).index,p=(0,o.useRef)(null),[{handlerId:m},h]=(0,d.useDrop)({accept:"row",collect:e=>({handlerId:e.getHandlerId()}),hover(e,t){var r;if(!p.current)return;const o=e.index,l=n;if(o===l)return;const a=null===(r=p.current)||void 0===r?void 0:r.getBoundingClientRect(),c=(a.bottom-a.top)/2,s=t.getClientOffset().y-a.top;o<l&&s<c||o>l&&s>c||(i(o,l),e.index=l)}}),[{isDragging:y},f]=(0,d.useDrag)({type:"row",item:()=>({id:r,index:n}),end:(e,t)=>{const{id:r,index:n}=e;return t.didDrop()?a(r,n+1):i(n,u)},collect:e=>({isDragging:e.isDragging()})}),v=y?0:1;return f(h(p)),l().createElement("tr",{id:r,ref:p,role:"row",className:t?"even":"odd",style:b(b({},{border:"1px dashed gray",padding:"0.5rem 1rem",marginBottom:".5rem",backgroundColor:"white",cursor:"move"}),{},{opacity:v})},c)};f.propTypes={index:a().number.isRequired,id:a().any.isRequired,moveCard:a().func.isRequired};const v=f;var g=r(4656),O=r.n(g),w=r(4391);r(6517);function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const E="",x=({data:e,options:r,columns:n,dropCallback:i,orderField:a,idField:c})=>{var p,y,b,f;const[g,x]=(0,o.useState)(e),[P,j]=(0,o.useState)({});(0,o.useEffect)((()=>{x(e)}),[e]);const C=(e,t,r,n)=>l().createElement(v,{even:n%2==0,key:e.id,index:n,id:e.id,moveCard:_,findRow:q,dropItem:N},((e,t,r)=>{let n=t.map(((t,r)=>t.hasOwnProperty("render")?l().createElement(w.Z,{key:"cell_"+r,title:t.hasOwnProperty("title")?e[t.columnKey]:null},t.render(e,e[t.columnKey])):l().createElement(w.Z,{key:"cell_"+r,title:t.hasOwnProperty("title")?e[t.columnKey]:null},e[t.columnKey])));return r&&n.push(l().createElement(h,{key:"actions",id:e.id,actions:r})),n})(e,t,r.actions)),D=e=>(e.sort((function(e,t){const r=e[a],n=t[a];return r<n?-1:r>n?1:0})),e),q=(0,o.useCallback)((e=>{const t=g.filter((t=>t[c]===e))[0];return{row:t,index:g.indexOf(t)}}),[g]),_=(0,o.useCallback)(((e,t)=>{x((r=>{r=s()(r,{$splice:[[e,1],[t,0,r[e]]]});for(let e in r)r[e][a]=parseInt(e)+1;return D(r)}))}),[g,x]),N=(e,t)=>{const r=D(g);x(r),i(r,e,t)};let A=r.hasOwnProperty("className")?r.className:"",R=(null==r||null===(p=r.actions)||void 0===p||null===(y=p.save)||void 0===y?void 0:y.onClick)&&null!==(null==r||null===(b=r.actions)||void 0===b||null===(f=b.save)||void 0===f?void 0:f.onClick);return l().createElement("div",{className:"sortable-table-box"},l().createElement("i",null,O().translate("general.drag_and_drop")),l().createElement("table",{className:"table table-striped table-hover sortableTable "+A},l().createElement("thead",null,l().createElement("tr",null,n.map(((e,t)=>{let r=e.width?e.width:E;return l().createElement(m,{width:r,key:t},e.value)})),r.actions&&l().createElement(m,{key:"actions"},"Actions"))),l().createElement("tbody",null,n.length>0&&g.map(((e,t)=>Array.isArray(e)&&e.length!==n.length?(console.warn(`Data at row ${t} is ${e.length}. It should be ${n.length}.`),l().createElement("tr",null)):l().createElement(d.DndProvider,{backend:u.HTML5Backend,key:t},C(e,n,r,t))))),R&&l().createElement("tfoot",null,l().createElement("tr",null,((e,t,r,n)=>{let o=e.map(((e,r)=>{let o=void 0!==t[e.columnKey]?t[e.columnKey]:"";return"checkbox"===(null==e?void 0:e.input)?l().createElement("td",{key:"new_row_"+r,className:"checkbox-cell"},l().createElement("input",{type:"checkbox",id:"new_"+e.columnKey,name:e.columnKey,onChange:n,checked:o,title:null==e?void 0:e.value})):l().createElement("td",{key:"new_row_"+r},l().createElement("input",{className:"form-control",id:"new_"+e.columnKey,name:e.columnKey,placeholder:null==e?void 0:e.value,onChange:n,value:o}))}));return o.push(l().createElement("td",{key:"add_new"},l().createElement("button",{className:"btn btn-default",onClick:r}," Add"))),o})(n,P,(e=>{var t,n;e.preventDefault(),null==r||null===(t=r.actions)||void 0===t||null===(n=t.save)||void 0===n||n.onClick(P),j({})}),(e=>{let r=e.target,n=function(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?k(Object(n),!0).forEach((function(r){t()(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},P),{name:o,value:l}=r;"checkbox"===r.type&&(l=r.checked),n[o]=l,j(n)}))))))};x.defaultProps={idField:"id"},x.propTypes={data:a().array.isRequired,options:a().shape({className:a().string,actions:a().object}).isRequired,columns:a().arrayOf(a().shape({columnKey:a().string.isRequired,value:a().any.isRequired,input:a().string,render:a().func})).isRequired,dropCallback:a().func.isRequired,orderField:a().string.isRequired,idField:a().string};const P=x})(),n})()));
2
2
  //# sourceMappingURL=table-sortable.js.map
@@ -1 +1 @@
1
- {"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IAAK,WAAa4G,GAClB,2BACIlI,UAAU,eACV8C,GAAI,OAASmF,EAAII,UACjB1E,KAAMsE,EAAII,UACVsC,YAAa1C,aAAF,EAAEA,EAAK3H,MAClBmK,SAAUH,EACVhK,MAAOiK,IARnB,IAmBR,OANAvC,EAAMM,KACF,wBAAIhH,IAAI,WACJ,4BAAQtB,UAAU,kBAAkBsD,QAAS+G,GAA7C,UAIDrC,CAAP,EAkIqB4C,CAAa1D,EAASO,GA1GvBzE,IAAO,QACvBA,EAAGE,iBACH+D,SAAA,UAAAA,EAAS9D,eAAT,mBAAkBqG,YAAlB,SAAwBlG,QAAQmE,GAChCC,EAAU,CAAC,EAAX,IAmDqB1E,IACrB,IAAI6H,EAAQ7H,EAAG8H,OACXC,E,iWAAY,IAAItD,IAChB,KAAC9D,EAAD,MAAOrD,GAASuK,EAED,aAAfA,EAAM/E,OACNxF,EAAQuK,EAAMH,SAElBK,EAAUpH,GAAQrD,EAClBoH,EAAUqD,EAAV,OAMJ,EA8CJhE,EAAciE,aAAe,CACzB3D,QAAS,MAGbN,EAAcH,UAAY,CACtBI,KAAMH,IAAAA,MAAAA,WACNI,QAASJ,IAAAA,MAAgB,CACrB7G,UAAW6G,IAAAA,OACX1D,QAAS0D,IAAAA,SACVoE,WACH/D,QAASL,IAAAA,QAAkBA,IAAAA,MAAgB,CACvCwB,UAAWxB,IAAAA,OAAAA,WACXvG,MAAOuG,IAAAA,IAAAA,WACP2D,MAAO3D,IAAAA,OACPtE,OAAQsE,IAAAA,QACRoE,WACJ9D,aAAcN,IAAAA,KAAAA,WACdO,WAAYP,IAAAA,OAAAA,WACZQ,QAASR,IAAAA,QAGb,S","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/raw-html/index.js","webpack://openstack-uicore-foundation/./src/components/table/TableCell.js","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/defineProperty\"","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 \"i18n-react/dist/i18n-react\"","webpack://openstack-uicore-foundation/external commonjs \"lodash\"","webpack://openstack-uicore-foundation/external commonjs \"prop-types\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/external commonjs \"react-dnd\"","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/external commonjs \"immutability-helper\"","webpack://openstack-uicore-foundation/external commonjs \"react-dnd-html5-backend\"","webpack://openstack-uicore-foundation/./src/components/table-sortable/SortableTableHeading.js","webpack://openstack-uicore-foundation/./src/components/table-sortable/SortableActionsTableCell.js","webpack://openstack-uicore-foundation/./src/components/table-sortable/SortableTableRow.js","webpack://openstack-uicore-foundation/./src/components/table-sortable/SortableTable.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;","import React from 'react';\nimport RawHTML from '../raw-html';\n\nconst TableCell = (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 TableCell;\n","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"i18n-react/dist/i18n-react\");","module.exports = require(\"lodash\");","module.exports = require(\"prop-types\");","module.exports = require(\"react\");","module.exports = require(\"react-dnd\");","// 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};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"immutability-helper\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react-dnd-html5-backend\");","import React from 'react';\n\nclass SortableTableHeading extends React.Component {\n\n\tconstructor (props) {\n\t\tsuper(props);\n\t}\n\n\trender () {\n\t\treturn (\n\t\t\t<th width={this.props.width}>\n\t\t\t\t{this.props.children}\n\t\t\t</th>\n\t\t);\t\n\t}\n\t\n}\n\nexport default SortableTableHeading;","import React from 'react';\n\nexport default class SortableActionsTableCell extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.handleAction = this.handleAction.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('edit') && this.shouldDisplayAction(actions.edit) &&\n <a href=\"\" data-tip=\"edit\" onClick={this.handleAction.bind(this, actions.edit.onClick, id)} >\n <i className=\"fa fa-pencil-square-o\"></i>\n </a>\n }\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 {'custom' in actions && actions.custom.map(a =>\n this.shouldDisplayAction(a, id) &&\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, { useRef } from 'react';\nimport { useDrag, useDrop } from 'react-dnd';\nimport PropTypes from 'prop-types';\n\nconst SortableTableRow = ({ text, even, id, index, moveCard, dropItem, children, findRow }) => {\n const originalIndex = findRow(id).index;\n\n const style = {\n border: '1px dashed gray',\n padding: '0.5rem 1rem',\n marginBottom: '.5rem',\n backgroundColor: 'white',\n cursor: 'move',\n };\n\n const refRow = useRef(null);\n const [{ handlerId }, drop] = useDrop({\n accept: 'row',\n collect(monitor) {\n return {\n handlerId: monitor.getHandlerId(),\n };\n },\n hover(item, monitor) {\n if (!refRow.current) {\n return;\n }\n const dragIndex = item.index;\n const hoverIndex = index;\n // Don't replace items with themselves\n if (dragIndex === hoverIndex) {\n return;\n }\n // Determine rectangle on screen\n const hoverBoundingRect = refRow.current?.getBoundingClientRect();\n // Get vertical middle\n const hoverMiddleY = (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;\n // Determine mouse position\n const clientOffset = monitor.getClientOffset();\n // Get pixels to the top\n const hoverClientY = clientOffset.y - hoverBoundingRect.top;\n // Only perform the move when the mouse has crossed half of the items height\n // When dragging downwards, only move when the cursor is below 50%\n // When dragging upwards, only move when the cursor is above 50%\n // Dragging downwards\n if (dragIndex < hoverIndex && hoverClientY < hoverMiddleY) {\n return;\n }\n // Dragging upwards\n if (dragIndex > hoverIndex && hoverClientY > hoverMiddleY) {\n return;\n }\n // Time to actually perform the action\n moveCard(dragIndex, hoverIndex);\n // Note: we're mutating the monitor item here!\n // Generally it's better to avoid mutations,\n // but it's good here for the sake of performance\n // to avoid expensive index searches.\n item.index = hoverIndex;\n },\n });\n const [{ isDragging }, drag] = useDrag({\n type: 'row',\n item: () => {\n return { id, index };\n },\n end:(_item, monitor) => {\n const { id: droppedId, index } = _item;\n const didDrop = monitor.didDrop()\n if(didDrop)\n return dropItem(droppedId, index + 1)\n // rollback\n return moveCard(index, originalIndex);\n },\n collect: (monitor) => ({\n isDragging: monitor.isDragging(),\n }),\n });\n\n const opacity = isDragging ? 0 : 1;\n\n drag(drop(refRow));\n\n return (\n <tr id={id} ref={refRow} role=\"row\" className={even ? 'even' : 'odd'} style={{ ...style, opacity }}>\n {children}\n </tr>\n );\n}\n\nSortableTableRow.propTypes = {\n index: PropTypes.number.isRequired,\n id: PropTypes.any.isRequired,\n moveCard: PropTypes.func.isRequired,\n};\n\nexport default SortableTableRow;\n\n","import React, {useEffect, useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport update from 'immutability-helper';\nimport {DndProvider} from 'react-dnd'\nimport {HTML5Backend} from 'react-dnd-html5-backend'\nimport SortableTableHeading from './SortableTableHeading';\nimport SortableActionsTableCell from './SortableActionsTableCell';\nimport SortableTableRow from './SortableTableRow';\nimport T from 'i18n-react/dist/i18n-react';\nimport './table-sortable.css';\nimport TableCell from \"../table/TableCell\";\nimport _ from 'lodash';\n\nconst defaults = {\n colWidth: ''\n}\n\nconst createRow = (row, columns, actions) => {\n\n let cells = columns.map((col, i) => {\n if (col.hasOwnProperty(\"render\"))\n return (\n <TableCell key={'cell_' + i} title={col.hasOwnProperty(\"title\") ? row[col.columnKey] : null}>\n {col.render(row, row[col.columnKey])}\n </TableCell>\n );\n\n return (\n <TableCell key={'cell_' + i} title={col.hasOwnProperty(\"title\") ? row[col.columnKey] : null}>\n {row[col.columnKey]}\n </TableCell>\n );\n });\n\n if (actions) {\n cells.push(<SortableActionsTableCell key='actions' id={row['id']} actions={actions}/>);\n }\n\n return cells;\n};\n\n\nconst renderNewRow = (columns, new_row, addNew, handleChange) => {\n\n let cells = columns.map((col, i) => {\n let cell_value = (typeof new_row[col.columnKey] !== 'undefined') ? new_row[col.columnKey] : '';\n\n if (col?.input === \"checkbox\")\n return (\n <td key={'new_row_' + i} className=\"checkbox-cell\">\n <input type=\"checkbox\"\n id={'new_' + col.columnKey}\n name={col.columnKey}\n onChange={handleChange}\n checked={cell_value}\n title={col?.value}\n />\n </td>);\n else\n return (\n <td key={'new_row_' + i}>\n <input\n className=\"form-control\"\n id={'new_' + col.columnKey}\n name={col.columnKey}\n placeholder={col?.value}\n onChange={handleChange}\n value={cell_value}/>\n </td>);\n\n });\n\n cells.push(\n <td key='add_new'>\n <button className=\"btn btn-default\" onClick={addNew}> Add</button>\n </td>\n );\n\n return cells;\n};\n\nconst SortableTable = ({data, options, columns, dropCallback, orderField, idField}) => {\n\n const [rows, setRows] = useState(data);\n const [newRow, setNewRow] = useState({});\n\n useEffect(() => {\n setRows(data);\n }, [data])\n\n\n const renderRow = (row, columns, options, index) => {\n return (\n <SortableTableRow even={index % 2 === 0} key={row.id} index={index} id={row.id}\n moveCard={moveRow}\n findRow={findRow}\n dropItem={onDropItem}>\n {createRow(row, columns, options.actions)}\n </SortableTableRow>\n )\n };\n\n const saveNewRow = (ev) => {\n ev.preventDefault();\n options?.actions?.save?.onClick(newRow);\n setNewRow({});\n }\n\n const sortRows = (rows2Sort) => {\n rows2Sort.sort(function (a, b) {\n const x = a[orderField];\n const y = b[orderField];\n return ((x < y) ? -1 : ((x > y) ? 1 : 0));\n });\n return rows2Sort;\n }\n\n const findRow = useCallback(\n (id) => {\n const row = rows.filter((r) => r[idField] === id)[0]\n return {\n row,\n index: rows.indexOf(row),\n }\n },\n [rows],\n )\n\n const moveRow = useCallback(\n (dragIndex, hoverIndex) => {\n\n setRows((prevRows) => {\n\n prevRows = update(prevRows, {\n $splice: [\n [dragIndex, 1],\n [hoverIndex, 0, prevRows[dragIndex]],\n ],\n });\n\n for (let i in prevRows) {\n prevRows[i][orderField] = parseInt(i) + 1;\n }\n\n return sortRows(prevRows)\n });\n },\n [rows, setRows],\n )\n\n const onDropItem = (id, newOrder) => {\n const sortedRows = sortRows(rows);\n setRows(sortedRows);\n dropCallback(sortedRows, id, newOrder)\n }\n\n const handleNewChange = (ev) => {\n let field = ev.target;\n let newRowTmp = {...newRow};\n let {name, value} = field;\n\n if (field.type === 'checkbox') {\n value = field.checked;\n }\n newRowTmp[name] = value;\n setNewRow(newRowTmp);\n }\n\n let tableClass = options.hasOwnProperty('className') ? options.className : '';\n let shouldRenderNewRow = options?.actions?.save?.onClick && options?.actions?.save?.onClick !== null;\n\n return (\n <div className=\"sortable-table-box\">\n <i>{T.translate(\"general.drag_and_drop\")}</i>\n <table className={\"table table-striped table-hover sortableTable \" + tableClass}>\n <thead>\n <tr>\n {columns.map((col, i) => {\n let colWidth = (col.width) ? col.width : defaults.colWidth;\n return (\n <SortableTableHeading width={colWidth} key={i}>\n {col.value}\n </SortableTableHeading>\n );\n })}\n {options.actions && !_.isEmpty(options.actions) &&\n <SortableTableHeading key='actions'>\n Actions\n </SortableTableHeading>\n }\n </tr>\n </thead>\n <tbody>\n {columns.length > 0 && rows.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/>\n }\n return (\n <DndProvider backend={HTML5Backend} key={i}>\n {renderRow(row, columns, options, i)}\n </DndProvider>\n );\n })}\n </tbody>\n {shouldRenderNewRow &&\n <tfoot>\n <tr>\n {renderNewRow(columns, newRow, saveNewRow, handleNewChange)}\n </tr>\n </tfoot>\n }\n </table>\n </div>\n );\n};\n\nSortableTable.defaultProps = {\n idField: 'id',\n}\n\nSortableTable.propTypes = {\n data: PropTypes.array.isRequired,\n options: PropTypes.shape({\n className: PropTypes.string,\n actions: PropTypes.object\n }).isRequired,\n columns: PropTypes.arrayOf(PropTypes.shape({\n columnKey: PropTypes.string.isRequired,\n value: PropTypes.any.isRequired,\n input: PropTypes.string,\n render: PropTypes.func,\n })).isRequired,\n dropCallback: PropTypes.func.isRequired,\n orderField: PropTypes.string.isRequired,\n idField: PropTypes.string,\n}\n\nexport default SortableTable;\n"],"names":["root","factory","exports","module","define","amd","this","children","replaceNewLine","className","rest","dangerouslySetInnerHTML","__html","replace","props","value","React","toString","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","SortableTableHeading","constructor","super","render","width","SortableActionsTableCell","handleAction","bind","shouldDisplayAction","action","id","display","ev","stopPropagation","preventDefault","actions","edit","href","onClick","delete","custom","map","tooltip","name","icon","SortableTableRow","text","even","index","moveCard","dropItem","findRow","originalIndex","refRow","useRef","handlerId","drop","useDrop","accept","collect","monitor","getHandlerId","hover","item","current","dragIndex","hoverIndex","hoverBoundingRect","getBoundingClientRect","hoverMiddleY","bottom","top","hoverClientY","getClientOffset","y","isDragging","drag","useDrag","type","end","_item","droppedId","didDrop","opacity","ref","role","style","border","padding","marginBottom","backgroundColor","cursor","propTypes","PropTypes","defaults","SortableTable","data","options","columns","dropCallback","orderField","idField","rows","setRows","useState","newRow","setNewRow","useEffect","renderRow","row","moveRow","onDropItem","cells","col","i","TableCell","title","columnKey","push","createRow","sortRows","rows2Sort","sort","b","x","useCallback","filter","indexOf","prevRows","update","$splice","parseInt","newOrder","sortedRows","tableClass","shouldRenderNewRow","save","T","colWidth","_","length","Array","isArray","console","warn","DndProvider","backend","HTML5Backend","new_row","addNew","handleChange","cell_value","input","onChange","checked","placeholder","renderNewRow","field","target","newRowTmp","defaultProps","isRequired"],"sourceRoot":""}
1
+ {"version":3,"file":"components/table-sortable.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,kECChB,MAkBA,EAlBmBI,IACf,IAAI,SAACP,GAAYO,EAChBC,EAAQ,GASZ,OARGR,IAEKQ,EADAC,IAAAA,eAAqBT,GACbA,EAEA,kBAAC,UAAD,KAAUA,EAASU,aAKlC,uBAAQH,EACGC,EAFZ,C,WCdDZ,EAAOD,QAAUgB,QAAQ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AA,WACNI,QAASJ,IAAAA,MAAgB,CACrB7G,UAAW6G,IAAAA,OACX1D,QAAS0D,IAAAA,SACVmE,WACH9D,QAASL,IAAAA,QAAkBA,IAAAA,MAAgB,CACvCwB,UAAWxB,IAAAA,OAAAA,WACXvG,MAAOuG,IAAAA,IAAAA,WACP0D,MAAO1D,IAAAA,OACPtE,OAAQsE,IAAAA,QACRmE,WACJ7D,aAAcN,IAAAA,KAAAA,WACdO,WAAYP,IAAAA,OAAAA,WACZQ,QAASR,IAAAA,QAGb,S","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/raw-html/index.js","webpack://openstack-uicore-foundation/./src/components/table/TableCell.js","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/defineProperty\"","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 \"i18n-react/dist/i18n-react\"","webpack://openstack-uicore-foundation/external commonjs \"lodash\"","webpack://openstack-uicore-foundation/external commonjs \"prop-types\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/external commonjs \"react-dnd\"","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/external commonjs \"immutability-helper\"","webpack://openstack-uicore-foundation/external commonjs \"react-dnd-html5-backend\"","webpack://openstack-uicore-foundation/./src/components/table-sortable/SortableTableHeading.js","webpack://openstack-uicore-foundation/./src/components/table-sortable/SortableActionsTableCell.js","webpack://openstack-uicore-foundation/./src/components/table-sortable/SortableTableRow.js","webpack://openstack-uicore-foundation/./src/components/table-sortable/SortableTable.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;","import React from 'react';\nimport RawHTML from '../raw-html';\n\nconst TableCell = (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 TableCell;\n","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"i18n-react/dist/i18n-react\");","module.exports = require(\"lodash\");","module.exports = require(\"prop-types\");","module.exports = require(\"react\");","module.exports = require(\"react-dnd\");","// 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};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"immutability-helper\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react-dnd-html5-backend\");","import React from 'react';\n\nclass SortableTableHeading extends React.Component {\n\n\tconstructor (props) {\n\t\tsuper(props);\n\t}\n\n\trender () {\n\t\treturn (\n\t\t\t<th width={this.props.width}>\n\t\t\t\t{this.props.children}\n\t\t\t</th>\n\t\t);\t\n\t}\n\t\n}\n\nexport default SortableTableHeading;","import React from 'react';\n\nexport default class SortableActionsTableCell extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.handleAction = this.handleAction.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('edit') && this.shouldDisplayAction(actions.edit) &&\n <a href=\"\" data-tip=\"edit\" onClick={this.handleAction.bind(this, actions.edit.onClick, id)} >\n <i className=\"fa fa-pencil-square-o\"></i>\n </a>\n }\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 {'custom' in actions && actions.custom.map(a =>\n this.shouldDisplayAction(a, id) &&\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, { useRef } from 'react';\nimport { useDrag, useDrop } from 'react-dnd';\nimport PropTypes from 'prop-types';\n\nconst SortableTableRow = ({ text, even, id, index, moveCard, dropItem, children, findRow }) => {\n const originalIndex = findRow(id).index;\n\n const style = {\n border: '1px dashed gray',\n padding: '0.5rem 1rem',\n marginBottom: '.5rem',\n backgroundColor: 'white',\n cursor: 'move',\n };\n\n const refRow = useRef(null);\n const [{ handlerId }, drop] = useDrop({\n accept: 'row',\n collect(monitor) {\n return {\n handlerId: monitor.getHandlerId(),\n };\n },\n hover(item, monitor) {\n if (!refRow.current) {\n return;\n }\n const dragIndex = item.index;\n const hoverIndex = index;\n // Don't replace items with themselves\n if (dragIndex === hoverIndex) {\n return;\n }\n // Determine rectangle on screen\n const hoverBoundingRect = refRow.current?.getBoundingClientRect();\n // Get vertical middle\n const hoverMiddleY = (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;\n // Determine mouse position\n const clientOffset = monitor.getClientOffset();\n // Get pixels to the top\n const hoverClientY = clientOffset.y - hoverBoundingRect.top;\n // Only perform the move when the mouse has crossed half of the items height\n // When dragging downwards, only move when the cursor is below 50%\n // When dragging upwards, only move when the cursor is above 50%\n // Dragging downwards\n if (dragIndex < hoverIndex && hoverClientY < hoverMiddleY) {\n return;\n }\n // Dragging upwards\n if (dragIndex > hoverIndex && hoverClientY > hoverMiddleY) {\n return;\n }\n // Time to actually perform the action\n moveCard(dragIndex, hoverIndex);\n // Note: we're mutating the monitor item here!\n // Generally it's better to avoid mutations,\n // but it's good here for the sake of performance\n // to avoid expensive index searches.\n item.index = hoverIndex;\n },\n });\n const [{ isDragging }, drag] = useDrag({\n type: 'row',\n item: () => {\n return { id, index };\n },\n end:(_item, monitor) => {\n const { id: droppedId, index } = _item;\n const didDrop = monitor.didDrop()\n if(didDrop)\n return dropItem(droppedId, index + 1)\n // rollback\n return moveCard(index, originalIndex);\n },\n collect: (monitor) => ({\n isDragging: monitor.isDragging(),\n }),\n });\n\n const opacity = isDragging ? 0 : 1;\n\n drag(drop(refRow));\n\n return (\n <tr id={id} ref={refRow} role=\"row\" className={even ? 'even' : 'odd'} style={{ ...style, opacity }}>\n {children}\n </tr>\n );\n}\n\nSortableTableRow.propTypes = {\n index: PropTypes.number.isRequired,\n id: PropTypes.any.isRequired,\n moveCard: PropTypes.func.isRequired,\n};\n\nexport default SortableTableRow;\n\n","import React, {useEffect, useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport update from 'immutability-helper';\nimport {DndProvider} from 'react-dnd'\nimport {HTML5Backend} from 'react-dnd-html5-backend'\nimport SortableTableHeading from './SortableTableHeading';\nimport SortableActionsTableCell from './SortableActionsTableCell';\nimport SortableTableRow from './SortableTableRow';\nimport T from 'i18n-react/dist/i18n-react';\nimport TableCell from \"../table/TableCell\";\nimport _ from 'lodash';\n\nimport './table-sortable.less';\n\nconst defaults = {\n colWidth: ''\n}\n\nconst createRow = (row, columns, actions) => {\n\n let cells = columns.map((col, i) => {\n if (col.hasOwnProperty(\"render\"))\n return (\n <TableCell key={'cell_' + i} title={col.hasOwnProperty(\"title\") ? row[col.columnKey] : null}>\n {col.render(row, row[col.columnKey])}\n </TableCell>\n );\n\n return (\n <TableCell key={'cell_' + i} title={col.hasOwnProperty(\"title\") ? row[col.columnKey] : null}>\n {row[col.columnKey]}\n </TableCell>\n );\n });\n\n if (actions) {\n cells.push(<SortableActionsTableCell key='actions' id={row['id']} actions={actions}/>);\n }\n\n return cells;\n};\n\n\nconst renderNewRow = (columns, new_row, addNew, handleChange) => {\n\n let cells = columns.map((col, i) => {\n let cell_value = (typeof new_row[col.columnKey] !== 'undefined') ? new_row[col.columnKey] : '';\n\n if (col?.input === \"checkbox\")\n return (\n <td key={'new_row_' + i} className=\"checkbox-cell\">\n <input type=\"checkbox\"\n id={'new_' + col.columnKey}\n name={col.columnKey}\n onChange={handleChange}\n checked={cell_value}\n title={col?.value}\n />\n </td>);\n else\n return (\n <td key={'new_row_' + i}>\n <input\n className=\"form-control\"\n id={'new_' + col.columnKey}\n name={col.columnKey}\n placeholder={col?.value}\n onChange={handleChange}\n value={cell_value}/>\n </td>);\n\n });\n\n cells.push(\n <td key='add_new'>\n <button className=\"btn btn-default\" onClick={addNew}> Add</button>\n </td>\n );\n\n return cells;\n};\n\nconst SortableTable = ({data, options, columns, dropCallback, orderField, idField}) => {\n\n const [rows, setRows] = useState(data);\n const [newRow, setNewRow] = useState({});\n\n useEffect(() => {\n setRows(data);\n }, [data])\n\n\n const renderRow = (row, columns, options, index) => {\n return (\n <SortableTableRow even={index % 2 === 0} key={row.id} index={index} id={row.id}\n moveCard={moveRow}\n findRow={findRow}\n dropItem={onDropItem}>\n {createRow(row, columns, options.actions)}\n </SortableTableRow>\n )\n };\n\n const saveNewRow = (ev) => {\n ev.preventDefault();\n options?.actions?.save?.onClick(newRow);\n setNewRow({});\n }\n\n const sortRows = (rows2Sort) => {\n rows2Sort.sort(function (a, b) {\n const x = a[orderField];\n const y = b[orderField];\n return ((x < y) ? -1 : ((x > y) ? 1 : 0));\n });\n return rows2Sort;\n }\n\n const findRow = useCallback(\n (id) => {\n const row = rows.filter((r) => r[idField] === id)[0]\n return {\n row,\n index: rows.indexOf(row),\n }\n },\n [rows],\n )\n\n const moveRow = useCallback(\n (dragIndex, hoverIndex) => {\n\n setRows((prevRows) => {\n\n prevRows = update(prevRows, {\n $splice: [\n [dragIndex, 1],\n [hoverIndex, 0, prevRows[dragIndex]],\n ],\n });\n\n for (let i in prevRows) {\n prevRows[i][orderField] = parseInt(i) + 1;\n }\n\n return sortRows(prevRows)\n });\n },\n [rows, setRows],\n )\n\n const onDropItem = (id, newOrder) => {\n const sortedRows = sortRows(rows);\n setRows(sortedRows);\n dropCallback(sortedRows, id, newOrder)\n }\n\n const handleNewChange = (ev) => {\n let field = ev.target;\n let newRowTmp = {...newRow};\n let {name, value} = field;\n\n if (field.type === 'checkbox') {\n value = field.checked;\n }\n newRowTmp[name] = value;\n setNewRow(newRowTmp);\n }\n\n let tableClass = options.hasOwnProperty('className') ? options.className : '';\n let shouldRenderNewRow = options?.actions?.save?.onClick && options?.actions?.save?.onClick !== null;\n\n return (\n <div className=\"sortable-table-box\">\n <i>{T.translate(\"general.drag_and_drop\")}</i>\n <table className={\"table table-striped table-hover sortableTable \" + tableClass}>\n <thead>\n <tr>\n {columns.map((col, i) => {\n let colWidth = (col.width) ? col.width : defaults.colWidth;\n return (\n <SortableTableHeading width={colWidth} key={i}>\n {col.value}\n </SortableTableHeading>\n );\n })}\n {options.actions &&\n <SortableTableHeading key='actions'>\n Actions\n </SortableTableHeading>\n }\n </tr>\n </thead>\n <tbody>\n {columns.length > 0 && rows.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/>\n }\n return (\n <DndProvider backend={HTML5Backend} key={i}>\n {renderRow(row, columns, options, i)}\n </DndProvider>\n );\n })}\n </tbody>\n {shouldRenderNewRow &&\n <tfoot>\n <tr>\n {renderNewRow(columns, newRow, saveNewRow, handleNewChange)}\n </tr>\n </tfoot>\n }\n </table>\n </div>\n );\n};\n\nSortableTable.defaultProps = {\n idField: 'id',\n}\n\nSortableTable.propTypes = {\n data: PropTypes.array.isRequired,\n options: PropTypes.shape({\n className: PropTypes.string,\n actions: PropTypes.object\n }).isRequired,\n columns: PropTypes.arrayOf(PropTypes.shape({\n columnKey: PropTypes.string.isRequired,\n value: PropTypes.any.isRequired,\n input: PropTypes.string,\n render: PropTypes.func,\n })).isRequired,\n dropCallback: PropTypes.func.isRequired,\n orderField: PropTypes.string.isRequired,\n idField: PropTypes.string,\n}\n\nexport default SortableTable;\n"],"names":["root","factory","exports","module","define","amd","this","children","replaceNewLine","className","rest","dangerouslySetInnerHTML","__html","replace","props","value","React","toString","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","SortableTableHeading","constructor","super","render","width","SortableActionsTableCell","handleAction","bind","shouldDisplayAction","action","id","display","ev","stopPropagation","preventDefault","actions","edit","href","onClick","delete","custom","map","tooltip","name","icon","SortableTableRow","text","even","index","moveCard","dropItem","findRow","originalIndex","refRow","useRef","handlerId","drop","useDrop","accept","collect","monitor","getHandlerId","hover","item","current","dragIndex","hoverIndex","hoverBoundingRect","getBoundingClientRect","hoverMiddleY","bottom","top","hoverClientY","getClientOffset","y","isDragging","drag","useDrag","type","end","_item","droppedId","didDrop","opacity","ref","role","style","border","padding","marginBottom","backgroundColor","cursor","propTypes","PropTypes","defaults","SortableTable","data","options","columns","dropCallback","orderField","idField","rows","setRows","useState","newRow","setNewRow","useEffect","renderRow","row","moveRow","onDropItem","cells","col","i","TableCell","title","columnKey","push","createRow","sortRows","rows2Sort","sort","b","x","useCallback","filter","indexOf","prevRows","update","$splice","parseInt","newOrder","sortedRows","tableClass","shouldRenderNewRow","save","T","colWidth","length","Array","isArray","console","warn","DndProvider","backend","HTML5Backend","new_row","addNew","handleChange","cell_value","input","onChange","checked","placeholder","renderNewRow","field","target","newRowTmp","defaultProps","isRequired"],"sourceRoot":""}
@@ -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 o=r(8213),n=r.n(o),s=r(3838),l=r.n(s),a=r(6689),i=r.n(a);const c=["children","replaceNewLine","className"],d=e=>{let{children:t,replaceNewLine:r=!1,className:o=""}=e,s=l()(e,c);return i().createElement("span",n()({className:o,dangerouslySetInnerHTML:{__html:r?null==t?void 0:t.replace(/\n/g,"<br />"):t}},s))}},4391:(e,t,r)=>{r.d(t,{Z:()=>l});var o=r(6689),n=r.n(o),s=r(418);const l=e=>{let{children:t}=e,r="";return t&&(r=n().isValidElement(t)?t:n().createElement(s.default,null,t.toString())),n().createElement("td",e,r)}},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(o){var n=t[o];if(void 0!==n)return n.exports;var s=t[o]={exports:{}};return e[o](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 o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})}})(),(()=>{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 o={};return(()=>{r.r(o),r.d(o,{default:()=>y});var e=r(6689),t=r.n(e),n=r(580),s=r.n(n);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 a=l;var i=r(4391);class c extends t().Component{constructor(e){super(e),this.handleEdit=this.handleEdit.bind(this)}shouldDisplayAction(e){let{id:t}=this.props;return!e.hasOwnProperty("display")||e.display(t)}handleEdit(e,t){t.stopPropagation(),t.preventDefault(),this.props.actions.edit.onClick(e)}render(){let{even:e,actions:r,id:o,children:n}=this.props,s=e?"even":"odd";return r.hasOwnProperty("edit")&&this.shouldDisplayAction(r.edit)?t().createElement("tr",{role:"row",className:s+" can-edit",onClick:this.handleEdit.bind(this,o)},n):t().createElement("tr",{role:"row",className:s},n)}}class d 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 p=r(2076),h=r.n(p);const u={sortFunc:(e,t)=>e<t?-1:e>t?1:0,sortable:!1,sortCol:0,sortDir:1,colWidth:""},m=(e,t,r,o)=>e&&e===r||r===t?o:null,y=e=>{let{options:r,columns:o}=e,n=r.hasOwnProperty("className")?r.className:"";return n+=r.actions.hasOwnProperty("edit")?" table-hover":"",t().createElement("div",null,t().createElement("table",{className:"table table-striped dataTable "+n},t().createElement("thead",null,t().createElement("tr",null,o.map(((o,n)=>{let s=void 0!==r.sortCol?r.sortCol:u.sortCol,l=void 0!==r.sortDir?r.sortDir:u.sortDir,i=void 0!==r.sortFunc?r.sortFunc:u.sortFunc,c=void 0!==o.sortable?o.sortable:u.sortable,d=void 0!==o.width?o.width:u.colWidth;return t().createElement(a,{onSort:e.onSort,sortDir:m(o.columnKey,n,s,l),sortable:c,sortFunc:i,columnIndex:n,columnKey:o.columnKey,width:d,key:"heading_"+n},o.value)})),r.actions&&t().createElement(a,{key:"actions_heading"},r.actionsHeader||" "))),t().createElement("tbody",null,o.length>0&&e.data.map(((e,n)=>Array.isArray(e)&&e.length!==o.length?(console.warn(`Data at row ${n} is ${e.length}. It should be ${o.length}.`),t().createElement("tr",{key:"row_"+n})):t().createElement(c,{even:n%2==0,key:"row_"+n,id:e.id,actions:r.actions},((e,r,o)=>{var n=r.map(((r,o)=>r.hasOwnProperty("render")?t().createElement(i.Z,{key:"cell_"+o},r.render(e,e[r.columnKey])):t().createElement(i.Z,{key:"cell_"+o,title:r.hasOwnProperty("title")?e[r.columnKey]:null},e[r.columnKey])));return o&&n.push(t().createElement(d,{key:"actions_cell",id:e.id,actions:o})),n})(e,o,r.actions)))))),t().createElement(h(),{delayShow:10}))}})(),o})()));
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 o=r(8213),n=r.n(o),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:o=""}=e,s=l()(e,c);return a().createElement("span",n()({className:o,dangerouslySetInnerHTML:{__html:r?null==t?void 0:t.replace(/\n/g,"<br />"):t}},s))}},4391:(e,t,r)=>{r.d(t,{Z:()=>l});var o=r(6689),n=r.n(o),s=r(418);const l=e=>{let{children:t}=e,r="";return t&&(r=n().isValidElement(t)?t:n().createElement(s.default,null,t.toString())),n().createElement("td",e,r)}},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(o){var n=t[o];if(void 0!==n)return n.exports;var s=t[o]={exports:{}};return e[o](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 o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})}})(),(()=>{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 o={};return(()=>{r.r(o),r.d(o,{default:()=>y});var e=r(6689),t=r.n(e),n=r(580),s=r.n(n);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(4391);class c extends t().Component{constructor(e){super(e),this.handleEdit=this.handleEdit.bind(this)}shouldDisplayAction(e){let{id:t}=this.props;return!e.hasOwnProperty("display")||e.display(t)}handleEdit(e,t){t.stopPropagation(),t.preventDefault(),this.props.actions.edit.onClick(e)}render(){let{even:e,actions:r,id:o,children:n}=this.props,s=e?"even":"odd";return(null==r?void 0:r.edit)&&this.shouldDisplayAction(r.edit)?t().createElement("tr",{role:"row",className:s+" can-edit",onClick:this.handleEdit.bind(this,o)},n):t().createElement("tr",{role:"row",className:s},n)}}class d 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 p=r(2076),u=r.n(p);const h={sortFunc:(e,t)=>e<t?-1:e>t?1:0,sortable:!1,sortCol:0,sortDir:1,colWidth:""},m=(e,t,r,o)=>e&&e===r||r===t?o:null,y=e=>{var r;let{options:o,columns:n}=e,s=o.hasOwnProperty("className")?o.className:"";return s+=null!==(r=o.actions)&&void 0!==r&&r.edit?" table-hover":"",t().createElement("div",null,t().createElement("table",{className:"table table-striped dataTable "+s},t().createElement("thead",null,t().createElement("tr",null,n.map(((r,n)=>{let s=void 0!==o.sortCol?o.sortCol:h.sortCol,l=void 0!==o.sortDir?o.sortDir:h.sortDir,a=void 0!==o.sortFunc?o.sortFunc:h.sortFunc,c=void 0!==r.sortable?r.sortable:h.sortable,d=void 0!==r.width?r.width:h.colWidth;return t().createElement(i,{onSort:e.onSort,sortDir:m(r.columnKey,n,s,l),sortable:c,sortFunc:a,columnIndex:n,columnKey:r.columnKey,width:d,key:"heading_"+n},r.value)})),o.actions&&t().createElement(i,{key:"actions_heading"},o.actionsHeader||" "))),t().createElement("tbody",null,n.length>0&&e.data.map(((e,r)=>Array.isArray(e)&&e.length!==n.length?(console.warn(`Data at row ${r} is ${e.length}. It should be ${n.length}.`),t().createElement("tr",{key:"row_"+r})):t().createElement(c,{even:r%2==0,key:"row_"+r,id:e.id,actions:o.actions},((e,r,o)=>{const n=r.map(((r,o)=>{const n=(null==r?void 0:r.styles)||{};return r.hasOwnProperty("render")?t().createElement(a.Z,{key:"cell_"+o,style:n},r.render(e,e[r.columnKey])):t().createElement(a.Z,{key:"cell_"+o,title:r.hasOwnProperty("title")?e[r.columnKey]:null,style:n},e[r.columnKey])}));return o&&n.push(t().createElement(d,{key:"actions_cell",id:e.id,actions:o})),n})(e,n,o.actions)))))),t().createElement(u(),{delayShow:10}))}})(),o})()));
2
2
  //# sourceMappingURL=table.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components/table.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,kECChB,M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wBAAwBL,EAAQK,WACjE,wBAAIlE,IAAK,OAAOgE,KAIvB,kBAAC/B,EAAD,CAAUU,KAAMqB,EAAE,GAAM,EAAGhE,IAAK,OAAOgE,EAAG3B,GAAI+B,EAAG,GAAQ3B,QAASmB,EAAQnB,SAnFpF,EAAC2B,EAAKP,EAASpB,KAE7B,IACIgC,EAAQZ,EAAQV,KAAI,CAACY,EAAIC,IACtBD,EAAItD,eAAe,UAEd,kBAACiE,EAAA,EAAD,CAAW1E,IAAK,QAAQgE,GACnBD,EAAInC,OAAOwC,EAAKA,EAAIL,EAAIrC,aAKjC,kBAACgD,EAAA,EAAD,CAAW1E,IAAK,QAAQgE,EAAGW,MAAOZ,EAAItD,eAAe,SAAW2D,EAAIL,EAAIrC,WAAa,MAChF0C,EAAIL,EAAIrC,cASrB,OAJIe,GACAgC,EAAMG,KAAK,kBAAC9B,EAAD,CAAkB9C,IAAI,eAAeqC,GAAI+B,EAAG,GAAQ3B,QAASA,KAGrEgC,CAAP,EA8D6BI,CAAUT,EAAKP,EAASD,EAAQnB,cAMrD,kBAAC,IAAD,CAAcqC,UAAW,KAlDjC,C","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/raw-html/index.js","webpack://openstack-uicore-foundation/./src/components/table/TableCell.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/TableHeading.js","webpack://openstack-uicore-foundation/./src/components/table/TableRow.js","webpack://openstack-uicore-foundation/./src/components/table/ActionsTableCell.js","webpack://openstack-uicore-foundation/./src/components/table/Table.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;","import React from 'react';\nimport RawHTML from '../raw-html';\n\nconst TableCell = (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 TableCell;\n","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 TableHeading 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\nTableHeading.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 TableHeading;","import React from 'react';\n\nexport default class TableRow extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.handleEdit = this.handleEdit.bind(this);\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 handleEdit(id, ev) {\n ev.stopPropagation();\n ev.preventDefault();\n\n this.props.actions.edit.onClick(id);\n }\n\n render() {\n let {even, actions, id, children} = this.props;\n let canEdit = (actions.hasOwnProperty('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 {children}\n </tr>\n );\n } else {\n return (\n <tr role=\"row\" className={rowClass}>\n {children}\n </tr>\n );\n }\n }\n};\n\n","import React from 'react';\n\nexport default class ActionsTableCell 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 TableHeading from './TableHeading';\nimport TableCell from './TableCell';\nimport TableRow from './TableRow';\nimport ActionsTableCell from './ActionsTableCell';\nimport ReactTooltip from 'react-tooltip'\n\nimport './table.css';\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 <TableCell key={'cell_'+i} >\n {col.render(row, row[col.columnKey])}\n </TableCell>\n );\n\n return (\n <TableCell key={'cell_'+i} title={col.hasOwnProperty(\"title\") ? row[col.columnKey] : null}>\n {row[col.columnKey]}\n </TableCell>\n );\n });\n\n if (actions) {\n cells.push(<ActionsTableCell 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\nconst Table = (props) => {\n let {options, columns} = props;\n let tableClass = options.hasOwnProperty('className') ? options.className : '';\n tableClass += (options.actions.hasOwnProperty('edit')) ? ' table-hover' : '';\n\n return (\n <div>\n <table className={\"table table-striped dataTable \" + tableClass}>\n <thead>\n <tr>\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 <TableHeading\n onSort={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 </TableHeading>\n );\n })}\n {options.actions &&\n <TableHeading key='actions_heading' >\n {options.actionsHeader || ' '}\n </TableHeading>\n }\n </tr>\n </thead>\n <tbody>\n {columns.length > 0 && 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 <TableRow even={i%2 === 0} key={'row_'+i} id={row['id']} actions={options.actions}>\n {createRow(row, columns, options.actions)}\n </TableRow>\n );\n })}\n </tbody>\n </table>\n <ReactTooltip delayShow={10} />\n </div>\n );\n};\n\nexport default Table;\n"],"names":["root","factory","exports","module","define","amd","this","children","replaceNewLine","className","rest","dangerouslySetInnerHTML","__html","replace","props","value","React","toString","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","TableHeading","constructor","super","handleSort","bind","getSortClass","sortable","sortDir","e","preventDefault","onSort","columnIndex","columnKey","sortFunc","render","onClick","width","propTypes","PropTypes","TableRow","handleEdit","shouldDisplayAction","action","id","display","ev","stopPropagation","actions","edit","even","rowClass","role","ActionsTableCell","handleAction","delete","href","custom","map","tooltip","name","icon","defaults","b","sortCol","colWidth","getSortDir","options","columns","tableClass","col","i","actionsHeader","length","data","row","Array","isArray","console","warn","cells","TableCell","title","push","createRow","delayShow"],"sourceRoot":""}
1
+ {"version":3,"file":"components/table.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0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foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/raw-html/index.js","webpack://openstack-uicore-foundation/./src/components/table/TableCell.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/TableHeading.js","webpack://openstack-uicore-foundation/./src/components/table/TableRow.js","webpack://openstack-uicore-foundation/./src/components/table/ActionsTableCell.js","webpack://openstack-uicore-foundation/./src/components/table/Table.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;","import React from 'react';\nimport RawHTML from '../raw-html';\n\nconst TableCell = (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 TableCell;\n","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 TableHeading 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\nTableHeading.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 TableHeading;","import React from 'react';\n\nexport default class TableRow extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.handleEdit = this.handleEdit.bind(this);\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 handleEdit(id, ev) {\n ev.stopPropagation();\n ev.preventDefault();\n\n this.props.actions.edit.onClick(id);\n }\n\n render() {\n let {even, actions, id, children} = 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 {children}\n </tr>\n );\n } else {\n return (\n <tr role=\"row\" className={rowClass}>\n {children}\n </tr>\n );\n }\n }\n};\n\n","import React from 'react';\n\nexport default class ActionsTableCell 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 TableHeading from './TableHeading';\nimport TableCell from './TableCell';\nimport TableRow from './TableRow';\nimport ActionsTableCell from './ActionsTableCell';\nimport ReactTooltip from 'react-tooltip'\n\nimport './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 const cells = columns.map((col,i) => {\n const colStyles = col?.styles || {};\n\n if(col.hasOwnProperty(\"render\"))\n return (\n <TableCell key={'cell_'+i} style={colStyles} >\n {col.render(row, row[col.columnKey])}\n </TableCell>\n );\n\n return (\n <TableCell\n key={'cell_'+i}\n title={col.hasOwnProperty(\"title\") ? row[col.columnKey] : null}\n style={colStyles}\n >\n {row[col.columnKey]}\n </TableCell>\n );\n });\n\n if (actions) {\n cells.push(<ActionsTableCell 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\nconst Table = (props) => {\n let {options, columns} = 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 dataTable \" + tableClass}>\n <thead>\n <tr>\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 <TableHeading\n onSort={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 </TableHeading>\n );\n })}\n {options.actions &&\n <TableHeading key='actions_heading' >\n {options.actionsHeader || ' '}\n </TableHeading>\n }\n </tr>\n </thead>\n <tbody>\n {columns.length > 0 && 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 <TableRow even={i%2 === 0} key={'row_'+i} id={row['id']} actions={options.actions}>\n {createRow(row, columns, options.actions)}\n </TableRow>\n );\n })}\n </tbody>\n </table>\n <ReactTooltip delayShow={10} />\n </div>\n );\n};\n\nexport default Table;\n"],"names":["root","factory","exports","module","define","amd","this","children","replaceNewLine","className","rest","dangerouslySetInnerHTML","__html","replace","props","value","React","toString","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","TableHeading","constructor","super","handleSort","bind","getSortClass","sortable","sortDir","e","preventDefault","onSort","columnIndex","columnKey","sortFunc","render","onClick","width","propTypes","PropTypes","TableRow","handleEdit","shouldDisplayAction","action","id","display","ev","stopPropagation","actions","edit","even","rowClass","role","ActionsTableCell","handleAction","delete","href","custom","map","tooltip","name","icon","defaults","b","sortCol","colWidth","getSortDir","options","columns","tableClass","col","i","actionsHeader","length","data","row","Array","isArray","console","warn","cells","colStyles","styles","TableCell","style","title","push","createRow","delayShow"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- .extra-question-error{color:red;display:block;font-size:12px;font-weight:700;margin:auto 0;padding:0}.extra-question-error:before{content:"\f071";font-family:FontAwesome;padding-right:5px}.questions-form{padding-bottom:5em}.questions-form h4{font-size:12pt}.questions-form .abc-checkbox{padding:0!important}.questions-form .form-check-label{font-weight:400!important}.questions-form .abc-radio label{max-width:90%}.questions-form form>div.checkbox-wrapper{align-items:start;display:grid;gap:15px;grid-template-columns:0fr 14fr;grid-template-rows:1fr}.questions-form form>div.checkbox-wrapper .input-wrapper,.questions-form form>div.checkbox-wrapper .input-wrapper .form-check{width:35px}.questions-form form>div.checkbox-wrapper .eq-checkbox-label{padding-top:0}
1
+ .extra-question-error{color:red;display:block;font-size:12px;font-weight:700;margin:auto 0;padding:0}.extra-question-error:before{content:"\f071";font-family:FontAwesome;padding-right:5px}.questions-form{padding-bottom:5em}.questions-form h4{font-size:12pt}.questions-form .abc-checkbox{padding:0!important}.questions-form .form-check-label{font-weight:400!important}.questions-form .abc-radio label{max-width:90%}.questions-form form>div.checkbox-wrapper{align-items:start;display:grid;gap:15px;grid-template-columns:0fr 14fr;grid-template-rows:1fr}.questions-form form>div.checkbox-wrapper .input-wrapper,.questions-form form>div.checkbox-wrapper .input-wrapper .form-check{width:35px}.questions-form form>div.checkbox-wrapper .checkbox-mandatory{color:red;padding-left:10px;position:absolute}.questions-form form>div.checkbox-wrapper .eq-checkbox-label{padding-top:0}
2
2
  /*# sourceMappingURL=extra-questions.css.map*/
@@ -1 +1 @@
1
- {"version":3,"file":"css/components/extra-questions.css","mappings":"AACA,sBAEI,SAAU,CADV,aAAc,CAEd,cAAe,CACf,eAAiB,CAEjB,cADA,SACc,CACjB,6BAIG,eAAgB,CADhB,uBAAwB,CAExB,iBAAkB,CACrB,gBAYG,kBAAmB,CAVvB,mBAEQ,cAAe,CAFvB,8BAKQ,mBAAqB,CAL7B,kCAQQ,yBAA8B,CARtC,iCAYQ,aAAc,CAZtB,0CAmBQ,kBAJA,YAAa,CACb,QAAS,CACT,8BAA+B,CAC/B,sBACkB,CAnB1B,8HAuBgB,UAAW,CAvB3B,6DA2BY,aAAgB","sources":["webpack://openstack-uicore-foundation/./src/components/extra-questions/index.scss"],"sourcesContent":["\n.extra-question-error {\n display: block;\n color: red;\n font-size: 12px;\n font-weight: bold;\n padding: 0;\n margin: auto 0;\n}\n\n.extra-question-error:before{\n font-family: FontAwesome;\n content: \"\\f071\";\n padding-right: 5px;\n}\n\n.questions-form {\n h4{\n font-size: 12pt;\n }\n .abc-checkbox{\n padding: 0 !important;\n }\n .form-check-label{\n font-weight: normal !important;\n }\n padding-bottom: 5em;\n .abc-radio label{\n max-width: 90%;\n }\n form > div.checkbox-wrapper {\n display: grid;\n gap: 15px;\n grid-template-columns: 0fr 14fr;\n grid-template-rows: 1fr;\n align-items: start;\n .input-wrapper {\n width: 35px;\n .form-check {\n width: 35px;\n }\n }\n .eq-checkbox-label {\n padding-top: 0px;\n }\n }\n}\n"],"names":[],"sourceRoot":""}
1
+ {"version":3,"file":"css/components/extra-questions.css","mappings":"AACA,sBAEI,SAAU,CADV,aAAc,CAEd,cAAe,CACf,eAAiB,CAEjB,cADA,SACc,CACjB,6BAIG,eAAgB,CADhB,uBAAwB,CAExB,iBAAkB,CACrB,gBAYG,kBAAmB,CAVvB,mBAEQ,cAAe,CAFvB,8BAKQ,mBAAqB,CAL7B,kCAQQ,yBAA8B,CARtC,iCAYQ,aAAc,CAZtB,0CAmBQ,kBAJA,YAAa,CACb,QAAS,CACT,8BAA+B,CAC/B,sBACkB,CAnB1B,8HAuBgB,UAAW,CAvB3B,8DA6BY,UADA,iBAAkB,CADlB,iBAEc,CA7B1B,6DAgCY,aAAgB","sources":["webpack://openstack-uicore-foundation/./src/components/extra-questions/index.scss"],"sourcesContent":["\n.extra-question-error {\n display: block;\n color: red;\n font-size: 12px;\n font-weight: bold;\n padding: 0;\n margin: auto 0;\n}\n\n.extra-question-error:before{\n font-family: FontAwesome;\n content: \"\\f071\";\n padding-right: 5px;\n}\n\n.questions-form {\n h4{\n font-size: 12pt;\n }\n .abc-checkbox{\n padding: 0 !important;\n }\n .form-check-label{\n font-weight: normal !important;\n }\n padding-bottom: 5em;\n .abc-radio label{\n max-width: 90%;\n }\n form > div.checkbox-wrapper {\n display: grid;\n gap: 15px;\n grid-template-columns: 0fr 14fr;\n grid-template-rows: 1fr;\n align-items: start;\n .input-wrapper {\n width: 35px;\n .form-check {\n width: 35px;\n }\n }\n .checkbox-mandatory {\n position: absolute;\n padding-left: 10px;\n color: #FF0000;\n }\n .eq-checkbox-label {\n padding-top: 0px;\n }\n }\n}\n"],"names":[],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- .extra-question-error{color:red;display:block;font-size:12px;font-weight:700;margin:auto 0;padding:0}.extra-question-error:before{content:"\f071";font-family:FontAwesome;padding-right:5px}.questions-form{padding-bottom:5em}.questions-form h4{font-size:12pt}.questions-form .abc-checkbox{padding:0!important}.questions-form .form-check-label{font-weight:400!important}.questions-form .abc-radio label{max-width:90%}.questions-form form>div.checkbox-wrapper{align-items:start;display:grid;gap:15px;grid-template-columns:0fr 14fr;grid-template-rows:1fr}.questions-form form>div.checkbox-wrapper .input-wrapper,.questions-form form>div.checkbox-wrapper .input-wrapper .form-check{width:35px}.questions-form form>div.checkbox-wrapper .eq-checkbox-label{padding-top:0}
1
+ .extra-question-error{color:red;display:block;font-size:12px;font-weight:700;margin:auto 0;padding:0}.extra-question-error:before{content:"\f071";font-family:FontAwesome;padding-right:5px}.questions-form{padding-bottom:5em}.questions-form h4{font-size:12pt}.questions-form .abc-checkbox{padding:0!important}.questions-form .form-check-label{font-weight:400!important}.questions-form .abc-radio label{max-width:90%}.questions-form form>div.checkbox-wrapper{align-items:start;display:grid;gap:15px;grid-template-columns:0fr 14fr;grid-template-rows:1fr}.questions-form form>div.checkbox-wrapper .input-wrapper,.questions-form form>div.checkbox-wrapper .input-wrapper .form-check{width:35px}.questions-form form>div.checkbox-wrapper .checkbox-mandatory{color:red;padding-left:10px;position:absolute}.questions-form form>div.checkbox-wrapper .eq-checkbox-label{padding-top:0}
2
2
  /*# sourceMappingURL=free-text-search.css.map*/
@@ -1 +1 @@
1
- {"version":3,"file":"css/components/free-text-search.css","mappings":"AACA,sBAEI,SAAU,CADV,aAAc,CAEd,cAAe,CACf,eAAiB,CAEjB,cADA,SACc,CACjB,6BAIG,eAAgB,CADhB,uBAAwB,CAExB,iBAAkB,CACrB,gBAYG,kBAAmB,CAVvB,mBAEQ,cAAe,CAFvB,8BAKQ,mBAAqB,CAL7B,kCAQQ,yBAA8B,CARtC,iCAYQ,aAAc,CAZtB,0CAmBQ,kBAJA,YAAa,CACb,QAAS,CACT,8BAA+B,CAC/B,sBACkB,CAnB1B,8HAuBgB,UAAW,CAvB3B,6DA2BY,aAAgB","sources":["webpack://openstack-uicore-foundation/./src/components/extra-questions/index.scss"],"sourcesContent":["\n.extra-question-error {\n display: block;\n color: red;\n font-size: 12px;\n font-weight: bold;\n padding: 0;\n margin: auto 0;\n}\n\n.extra-question-error:before{\n font-family: FontAwesome;\n content: \"\\f071\";\n padding-right: 5px;\n}\n\n.questions-form {\n h4{\n font-size: 12pt;\n }\n .abc-checkbox{\n padding: 0 !important;\n }\n .form-check-label{\n font-weight: normal !important;\n }\n padding-bottom: 5em;\n .abc-radio label{\n max-width: 90%;\n }\n form > div.checkbox-wrapper {\n display: grid;\n gap: 15px;\n grid-template-columns: 0fr 14fr;\n grid-template-rows: 1fr;\n align-items: start;\n .input-wrapper {\n width: 35px;\n .form-check {\n width: 35px;\n }\n }\n .eq-checkbox-label {\n padding-top: 0px;\n }\n }\n}\n"],"names":[],"sourceRoot":""}
1
+ {"version":3,"file":"css/components/free-text-search.css","mappings":"AACA,sBAEI,SAAU,CADV,aAAc,CAEd,cAAe,CACf,eAAiB,CAEjB,cADA,SACc,CACjB,6BAIG,eAAgB,CADhB,uBAAwB,CAExB,iBAAkB,CACrB,gBAYG,kBAAmB,CAVvB,mBAEQ,cAAe,CAFvB,8BAKQ,mBAAqB,CAL7B,kCAQQ,yBAA8B,CARtC,iCAYQ,aAAc,CAZtB,0CAmBQ,kBAJA,YAAa,CACb,QAAS,CACT,8BAA+B,CAC/B,sBACkB,CAnB1B,8HAuBgB,UAAW,CAvB3B,8DA6BY,UADA,iBAAkB,CADlB,iBAEc,CA7B1B,6DAgCY,aAAgB","sources":["webpack://openstack-uicore-foundation/./src/components/extra-questions/index.scss"],"sourcesContent":["\n.extra-question-error {\n display: block;\n color: red;\n font-size: 12px;\n font-weight: bold;\n padding: 0;\n margin: auto 0;\n}\n\n.extra-question-error:before{\n font-family: FontAwesome;\n content: \"\\f071\";\n padding-right: 5px;\n}\n\n.questions-form {\n h4{\n font-size: 12pt;\n }\n .abc-checkbox{\n padding: 0 !important;\n }\n .form-check-label{\n font-weight: normal !important;\n }\n padding-bottom: 5em;\n .abc-radio label{\n max-width: 90%;\n }\n form > div.checkbox-wrapper {\n display: grid;\n gap: 15px;\n grid-template-columns: 0fr 14fr;\n grid-template-rows: 1fr;\n align-items: start;\n .input-wrapper {\n width: 35px;\n .form-check {\n width: 35px;\n }\n }\n .checkbox-mandatory {\n position: absolute;\n padding-left: 10px;\n color: #FF0000;\n }\n .eq-checkbox-label {\n padding-top: 0px;\n }\n }\n}\n"],"names":[],"sourceRoot":""}