@laerdal/life-react-components 1.3.2-dev.15.full → 1.3.2-dev.17

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.
@@ -14,7 +14,7 @@ import * as React from 'react';
14
14
  import { Checkbox } from '../InputFields';
15
15
  import IconButton from '../Button/Iconbutton';
16
16
  import { HyperLink } from '../HyperLink';
17
- import { StyledTableBody, StyledTableBodyRow, StyledTableCell, StyledTableCellContent, StyledTableCellIcon } from './TableStyles';
17
+ import { StyledTableBody, StyledTableBodyRow, StyledTableCell, StyledTableCellContent, StyledTableCellIcon, StyledTableCellText } from './TableStyles';
18
18
 
19
19
  const TableBody = props => {
20
20
  const renderCellBody = (column, row) => {
@@ -23,7 +23,7 @@ const TableBody = props => {
23
23
  {
24
24
  const props = _objectSpread({
25
25
  variant: 'default',
26
- href: ''
26
+ href: '#'
27
27
  }, column.additionalProps);
28
28
 
29
29
  return /*#__PURE__*/React.createElement(HyperLink, _extends({
@@ -87,7 +87,7 @@ const TableBody = props => {
87
87
  case 'number':
88
88
  case 'text':
89
89
  default:
90
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledTableCellIcon, null, column.icon), /*#__PURE__*/React.createElement("span", null, row[column.key]));
90
+ return /*#__PURE__*/React.createElement(React.Fragment, null, column.icon && /*#__PURE__*/React.createElement(StyledTableCellIcon, null, column.icon), /*#__PURE__*/React.createElement(StyledTableCellText, null, row[column.key]));
91
91
  }
92
92
  };
93
93
 
@@ -116,7 +116,7 @@ const TableBody = props => {
116
116
  },
117
117
  title: column.shortenText && row[column.key]
118
118
  }, /*#__PURE__*/React.createElement(StyledTableCellContent, {
119
- className: `${column.shortenText && `truncate-text`} ${column.justify || ''}`
119
+ className: `${column.shortenText ? `truncate-text` : ''} ${column.justify || ''}`
120
120
  }, renderCellBody(column, row)))))) : /*#__PURE__*/React.createElement(StyledTableBodyRow, {
121
121
  "data-testid": "TestTableNoDataRow"
122
122
  }, /*#__PURE__*/React.createElement(StyledTableCell, {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/Table/TableBody.tsx"],"names":["Button","Size","React","Checkbox","IconButton","HyperLink","StyledTableBody","StyledTableBodyRow","StyledTableCell","StyledTableCellContent","StyledTableCellIcon","TableBody","props","renderCellBody","column","row","type","variant","href","additionalProps","colorFn","color","key","e","preventDefault","stopPropagation","action","iconColor","shape","useTransparentBackground","icon","size","Small","customContent","currentPageRows","length","map","index","selectable","onRowClick","event","undefined","multiSelect","selected","indexOf","keyExpr","columns","maxWidth","width","shortenText","justify"],"mappings":";;;;;;;;;;AACA,SAAQA,MAAR,QAAqB,WAArB;AACA,SAAQC,IAAR,QAAmB,UAAnB;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SAAQC,QAAR,QAAuB,gBAAvB;AAEA,OAAOC,UAAP,MAA0C,sBAA1C;AAEA,SAAQC,SAAR,QAAwB,cAAxB;AACA,SACEC,eADF,EAEEC,kBAFF,EAGEC,eAHF,EAIEC,sBAJF,EAKEC,mBALF,QAMO,eANP;;AAeA,MAAMC,SAAmC,GAAIC,KAAD,IAAW;AAEnD,QAAMC,cAAc,GAAG,CAACC,MAAD,EAAsBC,GAAtB,KAAmC;AACxD,YAAQD,MAAM,CAACE,IAAf;AACE,WAAK,MAAL;AAAa;AACX,gBAAMJ,KAAK;AAAKK,YAAAA,OAAO,EAAE,SAAd;AAAyBC,YAAAA,IAAI,EAAE;AAA/B,aAAsCJ,MAAM,CAACK,eAA7C,CAAX;;AACA,8BACE,oBAAC,SAAD;AAAW,YAAA,KAAK,EAAEL,MAAM,CAACM,OAAP,IAAkB;AAACC,cAAAA,KAAK,EAAEP,MAAM,CAACM,OAAP,CAAeL,GAAf,EAAoBD,MAAM,CAACQ,GAA3B;AAAR;AAApC,aACeV,KADf;AAEW,YAAA,OAAO,EAAGW,CAAD,IAAO;AACdA,cAAAA,CAAC,CAACC,cAAF;AACAD,cAAAA,CAAC,CAACE,e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CAAC8B,WAAN,GAAoB,CAApB,GAAwB,CAAhD;AAA1B,kBACE,oBAAC,sBAAD;AAAwB,IAAA,SAAS,EAAE;AAAnC,oCADF,CADF,CAtCJ,CADF;AAkDD,CAnHH;;;AALER,EAAAA,e;AACAK,EAAAA,U;AACAI,EAAAA,Q;;AAyHF,eAAehC,SAAf","sourcesContent":["import {TableColumn, TableProps} from './TableTypes';\nimport {Button} from '../Button';\nimport {Size} from '../types';\nimport * as React from 'react';\nimport {Checkbox} from '../InputFields';\nimport {ButtonProps} from '../Button/Button';\nimport IconButton, {IconButtonProps} from '../Button/Iconbutton';\nimport {HyperlinkProps} from '../HyperLink/HyperLink';\nimport {HyperLink} from '../HyperLink';\nimport {\n StyledTableBody,\n StyledTableBodyRow,\n StyledTableCell,\n StyledTableCellContent,\n StyledTableCellIcon\n} from './TableStyles';\n\n\ninterface TableBodyProps extends TableProps {\n currentPageRows: any[];\n onRowClick?: (row: any) => void;\n selected?: any | any[];\n}\n\nconst TableBody: React.FC<TableBodyProps> = (props) => {\n\n const renderCellBody = (column: TableColumn, row: any) => {\n switch (column.type) {\n case 'link': {\n const props = ({variant: 'default', href: '', ...column.additionalProps}) as HyperlinkProps;\n return (\n <HyperLink style={column.colorFn && {color: column.colorFn(row, column.key)}}\n {...props}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {row[column.key]}\n </HyperLink>\n );\n }\n case 'icon': {\n const props = ({\n iconColor: column.colorFn && column.colorFn(row, column.key),\n variant: 'secondary',\n shape: 'circular',\n useTransparentBackground: true,\n ...column.additionalProps\n }) as IconButtonProps;\n return <IconButton {...props}\n action={(e) => {\n e?.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {column.icon}\n </IconButton>\n }\n case 'button': {\n const props = ({\n variant: 'tertiary',\n size: Size.Small,\n ...column.additionalProps\n }) as ButtonProps;\n return <Button style={column.colorFn && {color: column.colorFn(row, column.key)}}\n {...props}\n onClick={(e) => {\n e?.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {row[column.key]}\n </Button>\n }\n case 'boolean':\n return <Checkbox selected={!!row[column.key]} readonly={true}/>;\n case 'custom':\n return column.customContent && column.customContent(row, column.key);\n case 'number':\n case 'text':\n default:\n return (\n <>\n <StyledTableCellIcon>{column.icon}</StyledTableCellIcon>\n <span>{row[column.key]}</span>\n </>\n );\n }\n }\n\n return (\n <StyledTableBody>\n {props.currentPageRows.length > 0 ? (\n props.currentPageRows.map((row: any, index: number) => (\n <StyledTableBodyRow key={`row_${index}`}\n className={props.selectable ? 'selectable' : ''}\n onClick={() => props.onRowClick && props.onRowClick(row)}\n onMouseDown={(event) => event.preventDefault()}\n onKeyPress={(e) => {\n if (e.key === 'Enter') {\n props.onRowClick && props.onRowClick(row);\n }\n }}\n tabIndex={props.selectable ? 0 : undefined}\n data-testid=\"TestTableDataRow\">\n {\n props.multiSelect &&\n <StyledTableCell>\n <StyledTableCellContent>\n <Checkbox selected={props.selected?.indexOf(props.keyExpr ? row[props.keyExpr] : row) > -1}\n readonly={true}/>\n </StyledTableCellContent>\n </StyledTableCell>\n }\n {props.columns.map((column: TableColumn) => (\n <StyledTableCell key={`row_${index}_${column.key}`}\n style={column.colorFn ? {\n color: column.colorFn(row, column.key),\n maxWidth: column.width\n } : {maxWidth: column.width}}\n title={column.shortenText && row[column.key]}>\n <StyledTableCellContent className={`${column.shortenText && `truncate-text`} ${column.justify || ''}`}>\n {renderCellBody(column, row)}\n </StyledTableCellContent>\n </StyledTableCell>\n ))}\n </StyledTableBodyRow>\n ))\n ) : (\n <StyledTableBodyRow data-testid=\"TestTableNoDataRow\">\n <StyledTableCell colSpan={props.columns.length + (props.multiSelect ? 1 : 0)}>\n <StyledTableCellContent className={'center'}>\n There are no rows to display\n </StyledTableCellContent>\n </StyledTableCell>\n </StyledTableBodyRow>\n )}\n\n </StyledTableBody>\n );\n }\n;\n\nexport default TableBody;\n"],"file":"TableBody.js"}
1
+ {"version":3,"sources":["../../../src/Table/TableBody.tsx"],"names":["Button","Size","React","Checkbox","IconButton","HyperLink","StyledTableBody","StyledTableBodyRow","StyledTableCell","StyledTableCellContent","StyledTableCellIcon","StyledTableCellText","TableBody","props","renderCellBody","column","row","type","variant","href","additionalProps","colorFn","color","key","e","preventDefault","stopPropagation","action","iconColor","shape","useTransparentBackground","icon","size","Small","customContent","currentPageRows","length","map","index","selectable","onRowClick","event","undefined","multiSelect","selected","indexOf","keyExpr","columns","maxWidth","width","shortenText","justify"],"mappings":";;;;;;;;;;AACA,SAAQA,MAAR,QAAqB,WAArB;AACA,SAAQC,IAAR,QAAmB,UAAnB;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SAAQC,QAAR,QAAuB,gBAAvB;AAEA,OAAOC,UAAP,MAA0C,sBAA1C;AAEA,SAAQC,SAAR,QAAwB,cAAxB;AACA,SACEC,eADF,EAEEC,kBAFF,EAGEC,eAHF,EAIEC,sBAJF,EAKEC,mBALF,EAKuBC,mBALvB,QAMO,eANP;;AAeA,MAAMC,SAAmC,GAAIC,KAAD,IAAW;AAEnD,QAAMC,cAAc,GAAG,CAACC,MAAD,EAAsBC,GAAtB,KAAmC;AACxD,YAAQD,MAAM,CAACE,IAAf;AACE,WAAK,MAAL;AAAa;AACX,gBAAMJ,KAAK;AAAKK,YAAAA,OAAO,EAAE,SAAd;AAAyBC,YAAAA,IAAI,EAAE;AAA/B,aAAuCJ,MAAM,CAACK,eAA9C,CAAX;;AACA,8BACE,oBAAC,SAAD;AAAW,YAAA,KAAK,EAAEL,MAAM,CAACM,OAAP,IAAkB;AAACC,cAAAA,KAAK,EAAEP,MAAM,CAACM,OAAP,CAAeL,GAAf,EAAoBD,MAAM,CAACQ,GAA3B;AAAR;AAApC,aACeV,KADf;AAEW,YAAA,OAAO,EAAGW,CAAD,IAAO;AACdA,cAAAA,CAAC,CAACC,cAAF;AACAD,cAAAA,CAAC,CAACE,eAAF;AACAX,cAAAA,MAAM,CAACY,MAAP,IAAiBZ,M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BvB,KAAK,CAAC8B,WAAN,GAAoB,CAApB,GAAwB,CAAhD;AAA1B,kBACE,oBAAC,sBAAD;AAAwB,IAAA,SAAS,EAAE;AAAnC,oCADF,CADF,CAvCJ,CADF;AAmDD,CAvHH;;;AALER,EAAAA,e;AACAK,EAAAA,U;AACAI,EAAAA,Q;;AA6HF,eAAehC,SAAf","sourcesContent":["import {TableColumn, TableProps} from './TableTypes';\nimport {Button} from '../Button';\nimport {Size} from '../types';\nimport * as React from 'react';\nimport {Checkbox} from '../InputFields';\nimport {ButtonProps} from '../Button/Button';\nimport IconButton, {IconButtonProps} from '../Button/Iconbutton';\nimport {HyperlinkProps} from '../HyperLink/HyperLink';\nimport {HyperLink} from '../HyperLink';\nimport {\n StyledTableBody,\n StyledTableBodyRow,\n StyledTableCell,\n StyledTableCellContent,\n StyledTableCellIcon, StyledTableCellText\n} from './TableStyles';\n\n\ninterface TableBodyProps extends TableProps {\n currentPageRows: any[];\n onRowClick?: (row: any) => void;\n selected?: any | any[];\n}\n\nconst TableBody: React.FC<TableBodyProps> = (props) => {\n\n const renderCellBody = (column: TableColumn, row: any) => {\n switch (column.type) {\n case 'link': {\n const props = ({variant: 'default', href: '#', ...column.additionalProps}) as HyperlinkProps;\n return (\n <HyperLink style={column.colorFn && {color: column.colorFn(row, column.key)}}\n {...props}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {row[column.key]}\n </HyperLink>\n );\n }\n case 'icon': {\n const props = ({\n iconColor: column.colorFn && column.colorFn(row, column.key),\n variant: 'secondary',\n shape: 'circular',\n useTransparentBackground: true,\n ...column.additionalProps\n }) as IconButtonProps;\n return <IconButton {...props}\n action={(e) => {\n e?.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {column.icon}\n </IconButton>\n }\n case 'button': {\n const props = ({\n variant: 'tertiary',\n size: Size.Small,\n ...column.additionalProps\n }) as ButtonProps;\n return <Button style={column.colorFn && {color: column.colorFn(row, column.key)}}\n {...props}\n onClick={(e) => {\n e?.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {row[column.key]}\n </Button>\n }\n case 'boolean':\n return <Checkbox selected={!!row[column.key]} readonly={true}/>;\n case 'custom':\n return column.customContent && column.customContent(row, column.key);\n case 'number':\n case 'text':\n default:\n return (\n <>\n {\n column.icon &&\n <StyledTableCellIcon>{column.icon}</StyledTableCellIcon>\n }\n <StyledTableCellText>{row[column.key]}</StyledTableCellText>\n </>\n );\n }\n }\n\n return (\n <StyledTableBody>\n {props.currentPageRows.length > 0 ? (\n props.currentPageRows.map((row: any, index: number) => (\n <StyledTableBodyRow key={`row_${index}`}\n className={props.selectable ? 'selectable' : ''}\n onClick={() => props.onRowClick && props.onRowClick(row)}\n onMouseDown={(event) => event.preventDefault()}\n onKeyPress={(e) => {\n if (e.key === 'Enter') {\n props.onRowClick && props.onRowClick(row);\n }\n }}\n tabIndex={props.selectable ? 0 : undefined}\n data-testid=\"TestTableDataRow\">\n {\n props.multiSelect &&\n <StyledTableCell>\n <StyledTableCellContent>\n <Checkbox selected={props.selected?.indexOf(props.keyExpr ? row[props.keyExpr] : row) > -1}\n readonly={true}/>\n </StyledTableCellContent>\n </StyledTableCell>\n }\n {props.columns.map((column: TableColumn) => (\n <StyledTableCell key={`row_${index}_${column.key}`}\n style={column.colorFn ? {\n color: column.colorFn(row, column.key),\n maxWidth: column.width\n } : {maxWidth: column.width}}\n title={column.shortenText && row[column.key]}>\n <StyledTableCellContent\n className={`${column.shortenText ? `truncate-text` : ''} ${column.justify || ''}`}>\n {renderCellBody(column, row)}\n </StyledTableCellContent>\n </StyledTableCell>\n ))}\n </StyledTableBodyRow>\n ))\n ) : (\n <StyledTableBodyRow data-testid=\"TestTableNoDataRow\">\n <StyledTableCell colSpan={props.columns.length + (props.multiSelect ? 1 : 0)}>\n <StyledTableCellContent className={'center'}>\n There are no rows to display\n </StyledTableCellContent>\n </StyledTableCell>\n </StyledTableBodyRow>\n )}\n\n </StyledTableBody>\n );\n }\n;\n\nexport default TableBody;\n"],"file":"TableBody.js"}
@@ -28,6 +28,7 @@ const TableFooter = props => {
28
28
  }, props.isCollapsed && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, "Show more(", props.rows.length - props.rowsPerPage, ")"), /*#__PURE__*/React.createElement(SystemIcons.ArrowDropDown, null)), !props.isCollapsed && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, "Show less"), /*#__PURE__*/React.createElement(SystemIcons.ArrowDropUp, null))), !props.accordion && /*#__PURE__*/React.createElement(StyledTableFooterContent, null, /*#__PURE__*/React.createElement(DropdownFilter, {
29
29
  id: "rows-per-page",
30
30
  list: rowsPerPageValues,
31
+ margin: '0',
31
32
  disableSorting: true,
32
33
  onSelect: value => props.onRowsPerPageChange(+value),
33
34
  initalValue: dropDownText,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/Table/TableFooter.tsx"],"names":["React","DropdownFilter","IconButton","ChevronLeft","ChevronRight","COLORS","StyledTableFooter","StyledTableFooterCollapseButton","StyledTableFooterContent","StyledTableFooterControls","StyledTableFooterCurrentInfo","SystemIcons","TableFooter","props","rowsPerPageValues","label","dropDownText","rowsPerPage","columns","length","multiSelect","accordion","setIsCollapsed","isCollapsed","e","preventDefault","rows","value","onRowsPerPageChange","total","from","to","prevPage","neutral_600","nextPage"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,SAAQC,cAAR,QAA6B,aAA7B;AACA,SAAQC,UAAR,QAAyB,WAAzB;AACA,SAAQC,WAAR,EAAqBC,YAArB,QAAwC,kCAAxC;AACA,SAAQC,MAAR,QAAqB,WAArB;AAEA,SACEC,iBADF,EACqBC,+BADrB,EAEEC,wBAFF,EAGEC,yBAHF,EAIEC,4BAJF,QAKO,eALP;AAMA,SAAQC,WAAR,QAA0B,UAA1B;;AAeA,MAAMC,WAAsD,GAAIC,KAAD,IAAW;AACxE,QAAMC,iBAAuC,GAAG,CA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A3B,CAJvB;AAKE,IAAA,WAAW,EAAEX,YALf;AAME,IAAA,gBAAgB,EAAE,IANpB;AAOE,IAAA,QAAQ,EAAE;AAPZ,IADF,eAUE,oBAAC,4BAAD,QACGH,KAAK,CAACgB,KAAN,KAAgB,CAAhB,GAAoB,CAApB,GAAwBhB,KAAK,CAACiB,IADjC,OACwCjB,KAAK,CAACkB,EAD9C,UACsDlB,KAAK,CAACgB,KAD5D,CAVF,eAaE,oBAAC,yBAAD,qBACE,oBAAC,UAAD;AAAY,IAAA,OAAO,EAAC,WAApB;AAAgC,IAAA,KAAK,EAAC,UAAtC;AAAiD,IAAA,MAAM,EAAE,MAAMhB,KAAK,CAACmB,QAAN,EAA/D;AACY,IAAA,QAAQ,EAAEnB,KAAK,CAACiB,IAAN,KAAe;AADrC,kBAEE,oBAAC,WAAD;AAAa,IAAA,IAAI,EAAC,IAAlB;AAAuB,IAAA,KAAK,EAAEzB,MAAM,CAAC4B;AAArC,IAFF,CADF,eAKE,oBAAC,UAAD;AAAY,IAAA,OAAO,EAAC,WAApB;AAAgC,IAAA,KAAK,EAAC,UAAtC;AAAiD,IAAA,MAAM,EAAE,MAAMpB,KAAK,CAACqB,QAAN,EAA/D;AACY,IAAA,QAAQ,EAAErB,KAAK,CAACkB,EAAN,KAAalB,KAAK,CAACgB;AADzC,kBAEE,oBAAC,YAAD;AAAc,IAAA,IAAI,EAAC,IAAnB;AAAwB,IAAA,KAAK,EAAExB,MAAM,CAAC4B;AAAtC,IAFF,CALF,CAbF,CAxBJ,CADF,CADF,CADF;AAwDD,CA7DD;;;AAXEL,EAAAA,mB;AACAX,EAAAA,W;AACAa,EAAAA,I;AACAC,EAAAA,E;AACAF,EAAAA,K;AACAK,EAAAA,Q;AACAF,EAAAA,Q;AACAV,EAAAA,c;AACAC,EAAAA,W;;AAmEF,eAAeX,WAAf","sourcesContent":["import React from 'react';\nimport {TableProps} from './TableTypes';\nimport {DropdownFilter} from '../Dropdown';\nimport {IconButton} from '../Button';\nimport {ChevronLeft, ChevronRight} from '../icons/systemicons/SystemIcons';\nimport {COLORS} from '../styles';\nimport {DropdownFilterItem} from '../Dropdown/DropdownFilter';\nimport {\n StyledTableFooter, StyledTableFooterCollapseButton,\n StyledTableFooterContent,\n StyledTableFooterControls,\n StyledTableFooterCurrentInfo\n} from './TableStyles';\nimport {SystemIcons} from '../icons';\n\n\ninterface TableFooterProps extends TableProps {\n onRowsPerPageChange: (value: number) => void;\n rowsPerPage: number;\n from?: number;\n to?: number;\n total?: number;\n nextPage: () => void;\n prevPage: () => void;\n setIsCollapsed: (isCollapsed: boolean) => void;\n isCollapsed: boolean;\n}\n\nconst TableFooter: React.FunctionComponent<TableFooterProps> = (props) => {\n const rowsPerPageValues: DropdownFilterItem[] = [{label: '10'}, {label: '20'}, {label: '50'}, {label: '100'}];\n\n const dropDownText = `Rows per page: ${props.rowsPerPage}`;\n\n return (\n <StyledTableFooter>\n <tr>\n <td colSpan={props.columns.length + (props.multiSelect ? 1 : 0)} data-testid=\"TestTableFooterRow\">\n {\n props.accordion &&\n <StyledTableFooterCollapseButton onClick={() => props.setIsCollapsed(!props.isCollapsed)}\n onMouseDown={e => e.preventDefault()}\n disabled={props.isCollapsed && props.rows.length <= props.rowsPerPage}>\n {\n props.isCollapsed &&\n <>\n <span>Show more({props.rows.length - props.rowsPerPage})</span>\n <SystemIcons.ArrowDropDown/>\n </>\n }\n {\n !props.isCollapsed &&\n <>\n <span>Show less</span>\n <SystemIcons.ArrowDropUp/>\n </>\n }\n </StyledTableFooterCollapseButton>\n }\n {\n !props.accordion &&\n <StyledTableFooterContent>\n <DropdownFilter\n id=\"rows-per-page\"\n list={rowsPerPageValues}\n disableSorting={true}\n onSelect={(value) => props.onRowsPerPageChange(+value)}\n initalValue={dropDownText}\n keepInitialValue={true}\n isButton={true}\n />\n <StyledTableFooterCurrentInfo>\n {props.total === 0 ? 0 : props.from}-{props.to} of {props.total}\n </StyledTableFooterCurrentInfo>\n <StyledTableFooterControls>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => props.prevPage()}\n disabled={props.from === 1}>\n <ChevronLeft size=\"24\" color={COLORS.neutral_600}/>\n </IconButton>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => props.nextPage()}\n disabled={props.to === props.total}>\n <ChevronRight size=\"24\" color={COLORS.neutral_600}/>\n </IconButton>\n </StyledTableFooterControls>\n </StyledTableFooterContent>\n }\n </td>\n </tr>\n </StyledTableFooter>\n );\n};\n\n\nexport default TableFooter;\n"],"file":"TableFooter.js"}
1
+ {"version":3,"sources":["../../../src/Table/TableFooter.tsx"],"names":["React","DropdownFilter","IconButton","ChevronLeft","ChevronRight","COLORS","StyledTableFooter","StyledTableFooterCollapseButton","StyledTableFooterContent","StyledTableFooterControls","StyledTableFooterCurrentInfo","SystemIcons","TableFooter","props","rowsPerPageValues","label","dropDownText","rowsPerPage","columns","length","multiSelect","accordion","setIsCollapsed","isCollapsed","e","preventDefault","rows","value","onRowsPerPageChange","total","from","to","prevPage","neutral_600","nextPage"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,SAAQC,cAAR,QAA6B,aAA7B;AACA,SAAQC,UAAR,QAAyB,WAAzB;AACA,SAAQC,WAAR,EAAqBC,YAArB,QAAwC,kCAAxC;AACA,SAAQC,MAAR,QAAqB,WAArB;AAEA,SACEC,iBADF,EACqBC,+BADrB,EAEEC,wBAFF,EAGEC,yBAHF,EAIEC,4BAJF,QAKO,eALP;AAMA,SAAQC,WAAR,QAA0B,UAA1B;;AAeA,MAAMC,WAAsD,GAAIC,KAAD,IAAW;AACxE,QAAMC,iBAAuC,GAAG,CAAC;AAACC,IAAAA,KAAK,EAAE;AAAR,GAAD,EAAgB;AAACA,IAAAA,KAAK,EAAE;AAAR,GAAhB,EAA+B;AAACA,IAAAA,KAAK,EAAE;AAAR,GAA/B,EAA8C;AAACA,IAAAA,KAAK,EAAE;AAAR,GAA9C,CAAhD;AAEA,QAAMC,YAAY,GAAI,kBAAiBH,KA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KAAK,CAACiB,IADjC,OACwCjB,KAAK,CAACkB,EAD9C,UACsDlB,KAAK,CAACgB,KAD5D,CAXF,eAcE,oBAAC,yBAAD,qBACE,oBAAC,UAAD;AAAY,IAAA,OAAO,EAAC,WAApB;AAAgC,IAAA,KAAK,EAAC,UAAtC;AAAiD,IAAA,MAAM,EAAE,MAAMhB,KAAK,CAACmB,QAAN,EAA/D;AACY,IAAA,QAAQ,EAAEnB,KAAK,CAACiB,IAAN,KAAe;AADrC,kBAEE,oBAAC,WAAD;AAAa,IAAA,IAAI,EAAC,IAAlB;AAAuB,IAAA,KAAK,EAAEzB,MAAM,CAAC4B;AAArC,IAFF,CADF,eAKE,oBAAC,UAAD;AAAY,IAAA,OAAO,EAAC,WAApB;AAAgC,IAAA,KAAK,EAAC,UAAtC;AAAiD,IAAA,MAAM,EAAE,MAAMpB,KAAK,CAACqB,QAAN,EAA/D;AACY,IAAA,QAAQ,EAAErB,KAAK,CAACkB,EAAN,KAAalB,KAAK,CAACgB;AADzC,kBAEE,oBAAC,YAAD;AAAc,IAAA,IAAI,EAAC,IAAnB;AAAwB,IAAA,KAAK,EAAExB,MAAM,CAAC4B;AAAtC,IAFF,CALF,CAdF,CAxBJ,CADF,CADF,CADF;AAyDD,CA9DD;;;AAXEL,EAAAA,mB;AACAX,EAAAA,W;AACAa,EAAAA,I;AACAC,EAAAA,E;AACAF,EAAAA,K;AACAK,EAAAA,Q;AACAF,EAAAA,Q;AACAV,EAAAA,c;AACAC,EAAAA,W;;AAoEF,eAAeX,WAAf","sourcesContent":["import React from 'react';\nimport {TableProps} from './TableTypes';\nimport {DropdownFilter} from '../Dropdown';\nimport {IconButton} from '../Button';\nimport {ChevronLeft, ChevronRight} from '../icons/systemicons/SystemIcons';\nimport {COLORS} from '../styles';\nimport {DropdownFilterItem} from '../Dropdown/DropdownFilter';\nimport {\n StyledTableFooter, StyledTableFooterCollapseButton,\n StyledTableFooterContent,\n StyledTableFooterControls,\n StyledTableFooterCurrentInfo\n} from './TableStyles';\nimport {SystemIcons} from '../icons';\n\n\ninterface TableFooterProps extends TableProps {\n onRowsPerPageChange: (value: number) => void;\n rowsPerPage: number;\n from?: number;\n to?: number;\n total?: number;\n nextPage: () => void;\n prevPage: () => void;\n setIsCollapsed: (isCollapsed: boolean) => void;\n isCollapsed: boolean;\n}\n\nconst TableFooter: React.FunctionComponent<TableFooterProps> = (props) => {\n const rowsPerPageValues: DropdownFilterItem[] = [{label: '10'}, {label: '20'}, {label: '50'}, {label: '100'}];\n\n const dropDownText = `Rows per page: ${props.rowsPerPage}`;\n\n return (\n <StyledTableFooter>\n <tr>\n <td colSpan={props.columns.length + (props.multiSelect ? 1 : 0)} data-testid=\"TestTableFooterRow\">\n {\n props.accordion &&\n <StyledTableFooterCollapseButton onClick={() => props.setIsCollapsed(!props.isCollapsed)}\n onMouseDown={e => e.preventDefault()}\n disabled={props.isCollapsed && props.rows.length <= props.rowsPerPage}>\n {\n props.isCollapsed &&\n <>\n <span>Show more({props.rows.length - props.rowsPerPage})</span>\n <SystemIcons.ArrowDropDown/>\n </>\n }\n {\n !props.isCollapsed &&\n <>\n <span>Show less</span>\n <SystemIcons.ArrowDropUp/>\n </>\n }\n </StyledTableFooterCollapseButton>\n }\n {\n !props.accordion &&\n <StyledTableFooterContent>\n <DropdownFilter\n id=\"rows-per-page\"\n list={rowsPerPageValues}\n margin={'0'}\n disableSorting={true}\n onSelect={(value) => props.onRowsPerPageChange(+value)}\n initalValue={dropDownText}\n keepInitialValue={true}\n isButton={true}\n />\n <StyledTableFooterCurrentInfo>\n {props.total === 0 ? 0 : props.from}-{props.to} of {props.total}\n </StyledTableFooterCurrentInfo>\n <StyledTableFooterControls>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => props.prevPage()}\n disabled={props.from === 1}>\n <ChevronLeft size=\"24\" color={COLORS.neutral_600}/>\n </IconButton>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => props.nextPage()}\n disabled={props.to === props.total}>\n <ChevronRight size=\"24\" color={COLORS.neutral_600}/>\n </IconButton>\n </StyledTableFooterControls>\n </StyledTableFooterContent>\n }\n </td>\n </tr>\n </StyledTableFooter>\n );\n};\n\n\nexport default TableFooter;\n"],"file":"TableFooter.js"}
@@ -19,6 +19,7 @@ export const TableWrapper = styled.div`
19
19
  export const StyledTable = styled.table`
20
20
  background: transparent;
21
21
  width: 100%;
22
+ table-layout: fixed;
22
23
  `;
23
24
  export const StyledTableHeader = styled.thead`
24
25
  `;
@@ -93,6 +94,10 @@ export const StyledTableHeaderColumn = styled.th`
93
94
  opacity: 1;
94
95
  }
95
96
 
97
+ &.sorted {
98
+ background-color: ${COLORS.neutral_20};
99
+ }
100
+
96
101
  `;
97
102
  export const StyledTableBodyRow = styled.tr`
98
103
  cursor: pointer;
@@ -131,10 +136,11 @@ export const StyledTableCellContent = styled.div`
131
136
  min-height: 48px;
132
137
 
133
138
  padding: 0 16px;
134
- ${ComponentSStyling(ComponentTextStyle.Regular, null)}
139
+ ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}
135
140
 
136
141
  display: flex;
137
142
  align-items: center;
143
+ justify-content: left;
138
144
  gap: 8px;
139
145
 
140
146
  &.truncate-text,
@@ -167,6 +173,9 @@ export const StyledTableCellIcon = styled.div`
167
173
  height: 24px;
168
174
  }
169
175
  `;
176
+ export const StyledTableCellText = styled.span`
177
+ padding: 12px 0;
178
+ `;
170
179
  export const StyledTableFooter = styled.tfoot`
171
180
  `;
172
181
  export const StyledTableFooterContent = styled.div`
@@ -178,6 +187,7 @@ export const StyledTableFooterContent = styled.div`
178
187
  display: flex;
179
188
  align-items: center;
180
189
  justify-content: right;
190
+
181
191
  `;
182
192
  export const StyledTableFooterCurrentInfo = styled.span`
183
193
  padding: 0 16px;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/Table/TableStyles.ts"],"names":["styled","COLORS","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentTextStyle","ComponentXSStyling","Z_INDEXES","TableWrapper","div","StyledTable","table","StyledTableHeader","thead","StyledTableHeaderTitle","tr","StyledTableHeaderTitleContent","neutral_200","Bold","black","StyledTableHeaderColumns","StyledTableHeaderColumnContent","StyledTableHeaderColumn","th","neutral_600","white","primary_20","primary_700","hover","primary_100","primary_800","active","focus_25","focus","StyledTableBodyRow","primary_200","StyledTableBody","tbody","neutral_100","neutral_20","StyledTableCell","td","StyledTableCellContent","Regular","StyledTableCellIcon","neutral_700","StyledTableFooter","tfoot","StyledTableFooterContent","StyledTableFooterCurrentInfo","span","StyledTableFooterControls","StyledTableSpinner","StyledTableFooterCollapseButton","button","neutral_800"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,MAAP,MAAmB,mBAAnB;AAEA;AACA;AACA;;AACA,SAAQC,MAAR,QAAqB,WAArB;AACA,SACEC,iBADF,EAEEC,iBAFF,EAGEC,iBAHF,EAIEC,kBAJF,EAKEC,kBALF,QAMO,sBANP;AAOA,SAAQC,SAAR,QAAwB,qBAAxB;AAEA;AACA;AACA;;AAEA,OAAO,MAAMC,YAAY,GAAGR,MAAM,CAACS,GAAI;AACvC;AACA,CAFO;AAKP,OAAO,MAAMC,WAAW,GAAGV,MAAM,CAACW,KAAM;AACxC;AACA;AACA,CAHO;AAKP,OAAO,MAAMC,iBAAiB,GAAGZ,MAAM,CAACa,KAAM;AAC9C,CADO;AAGP,OAAO,MAAMC,sBAAsB,GAAGd,MAAM,CAACe,EAAG;AAChD,CADO;AAGP,OAAO,MAAMC,6BAA6B,GAAGhB,MAAM,CAACS,GAAI;AACxD;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6BR,MAAM,CAACgB,WAAY;AAChD,0BAA0BhB,MAAM,CAACgB,WAAY;AAC7C;AACA;AACA,IAAIf,iBAAiB,CAACG,kBAAkB,CAACa,IAApB,EAA0BjB,MAAM,CAACkB,KAAjC,CAAwC;AAC7D;AACA;AACA;AACA,CAfO;AAiBP,OAAO,MAAMC,wBAAwB,GAAGpB,MAAM,CAACe,EAAG;AAClD,CADO;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B,GAAGrD,MAAM,CAACsD,MAAO;AAC7D;AACA,6BAA6BrD,MAAM,CAACgB,WAAY;AAChD,0BAA0BhB,MAAM,CAACgB,WAAY;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgBhB,MAAM,CAACwB,KAAM;AAC7B;AACA;AACA;AACA,IAAItB,iBAAiB,CAACE,kBAAkB,CAACa,IAApB,EAA0BjB,MAAM,CAACsD,WAAjC,CAA8C;AACnE;AACA;AACA,eAAehD,SAAS,CAAC0B,KAAM;AAC/B,aAAahC,MAAM,CAACuB,WAAY;AAChC;AACA;AACA;AACA;AACA,eAAejB,SAAS,CAACqB,KAAM;AAC/B,kBAAkB3B,MAAM,CAACyB,UAAW;AACpC,aAAazB,MAAM,CAAC0B,WAAY;AAChC;AACA;AACA;AACA;AACA,eAAepB,SAAS,CAACwB,MAAO;AAChC,kBAAkB9B,MAAM,CAAC4B,WAAY;AACrC,aAAa5B,MAAM,CAAC6B,WAAY;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,CA1CO","sourcesContent":["/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\n\n/**\n * Import custom style properties.\n */\nimport {COLORS} from '../styles';\nimport {\n ComponentLStyling,\n ComponentMStyling,\n ComponentSStyling,\n ComponentTextStyle,\n ComponentXSStyling\n} from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\n\n/**\n * Table styles\n */\n\nexport const TableWrapper = styled.div`\n position: relative;\n`;\n\n\nexport const StyledTable = styled.table`\n background: transparent;\n width: 100%;\n`;\n\nexport const StyledTableHeader = styled.thead`\n`;\n\nexport const StyledTableHeaderTitle = styled.tr`\n`;\n\nexport const StyledTableHeaderTitleContent = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n box-sizing: border-box;\n min-height: 56px;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 2px solid ${COLORS.neutral_200};\n padding: 0 16px;\n\n ${ComponentLStyling(ComponentTextStyle.Bold, COLORS.black)}\n .title-menu {\n margin-right: -16px;\n }\n`;\n\nexport const StyledTableHeaderColumns = styled.tr`\n`;\n\nexport const StyledTableHeaderColumnContent = styled.div`\n box-sizing: border-box;\n min-height: 56px;\n padding: 0 16px;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-top: 1px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n`;\n\nexport const StyledTableHeaderColumn = styled.th`\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n position: relative;\n\n background-color: ${COLORS.white};\n\n //fixes header heights no idea why\n height: 1px;\n\n &.sortable {\n cursor: pointer;\n\n &:hover {\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:active {\n background-color: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n box-shadow: none !important;\n z-index: ${Z_INDEXES.active};\n }\n\n &:focus {\n outline: none;\n box-shadow: 0 4px 12px ${COLORS.focus_25}, 0 0 8px ${COLORS.focus};\n z-index: ${Z_INDEXES.focus};\n }\n }\n\n &.sortable ${StyledTableHeaderColumnContent} > svg {\n opacity: 0;\n }\n\n &.sortable.sorted ${StyledTableHeaderColumnContent} > svg {\n opacity: 1;\n }\n\n`;\n\nexport const StyledTableBodyRow = styled.tr`\n cursor: pointer;\n position: relative;\n outline: none;\n\n &:hover {\n background-color: ${COLORS.primary_200};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:focus {\n background-color: ${COLORS.primary_200};\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2E7FA1;\n z-index: ${Z_INDEXES.focus};\n outline: none;\n }\n\n &:active {\n box-shadow: none;\n z-index: ${Z_INDEXES.active};\n }\n\n`;\n\nexport const StyledTableBody = styled.tbody`\n ${StyledTableBodyRow}:nth-child(odd):not(:hover):not(:focus):not(:active) {\n background-color: ${COLORS.neutral_100};\n }\n\n ${StyledTableBodyRow}:nth-child(even):not(:hover):not(:focus):not(:active) {\n background-color: ${COLORS.neutral_20};\n }\n`;\n\n\nexport const StyledTableCell = styled.td``;\n\nexport const StyledTableCellContent = styled.div`\n min-height: 48px;\n\n padding: 0 16px;\n ${ComponentSStyling(ComponentTextStyle.Regular, null)}\n\n display: flex;\n align-items: center;\n gap: 8px;\n\n &.truncate-text,\n &.truncate-text span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &.left {\n justify-content: left;\n }\n\n &.right {\n justify-content: right;\n }\n\n &.center {\n justify-content: center;\n }\n`;\n\nexport const StyledTableCellIcon = styled.div`\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n\n svg {\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n }\n`;\n\n\nexport const StyledTableFooter = styled.tfoot`\n`;\n\nexport const StyledTableFooterContent = styled.div`\n border-top: 2px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n box-sizing: border-box;\n min-height: 56px;\n\n display: flex;\n align-items: center;\n justify-content: right;\n`;\n\nexport const StyledTableFooterCurrentInfo = styled.span`\n padding: 0 16px;\n ${ComponentXSStyling(ComponentTextStyle.Regular, COLORS.black)}\n`;\n\nexport const StyledTableFooterControls = styled.div`\n display: flex;\n`;\n\nexport const StyledTableSpinner = styled.div`\n height: 100%;\n width: 100%;\n position: absolute;\n background-color: rgba(0, 0, 0, 0.5);\n top: 0;\n`;\n\nexport const StyledTableFooterCollapseButton = styled.button`\n position: relative;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 1px solid ${COLORS.neutral_200};\n border-left: none;\n border-right: none;\n box-sizing: border-box;\n min-height: 48px;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n gap: 4px;\n background: ${COLORS.white};\n\n cursor: pointer;\n\n ${ComponentMStyling(ComponentTextStyle.Bold, COLORS.neutral_800)}\n &:focus {\n outline: none;\n z-index: ${Z_INDEXES.focus};\n color: ${COLORS.neutral_600};\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2E7FA1;\n }\n\n &:hover {\n z-index: ${Z_INDEXES.hover};\n background: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n }\n\n &:active {\n box-shadow: none;\n z-index: ${Z_INDEXES.active};\n background: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n }\n\n &:disabled {\n display: none;\n }\n\n`;\n"],"file":"TableStyles.js"}
1
+ {"version":3,"sources":["../../../src/Table/TableStyles.ts"],"names":["styled","COLORS","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentTextStyle","ComponentXSStyling","Z_INDEXES","TableWrapper","div","StyledTable","table","StyledTableHeader","thead","StyledTableHeaderTitle","tr","StyledTableHeaderTitleContent","neutral_200","Bold","black","StyledTableHeaderColumns","StyledTableHeaderColumnContent","StyledTableHeaderColumn","th","neutral_600","white","primary_20","primary_700","hover","primary_100","primary_800","active","focus_25","focus","neutral_20","StyledTableBodyRow","primary_200","StyledTableBody","tbody","neutral_100","StyledTableCell","td","StyledTableCellContent","Regular","StyledTableCellIcon","neutral_700","StyledTableCellText","span","StyledTableFooter","tfoot","StyledTableFooterContent","StyledTableFooterCurrentInfo","StyledTableFooterControls","StyledTableSpinner","StyledTableFooterCollapseButton","button","neutral_800"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,MAAP,MAAmB,mBAAnB;AAEA;AACA;AACA;;AACA,SAAQC,MAAR,QAAqB,WAArB;AACA,SACEC,iBADF,EAEEC,iBAFF,EAGEC,iBAHF,EAIEC,kBAJF,EAKEC,kBALF,QAMO,sBANP;AAOA,SAAQC,SAAR,QAAwB,qBAAxB;AAEA;AACA;AACA;;AAEA,OAAO,MAAMC,YAAY,GAAGR,MAAM,CAACS,GAAI;AACvC;AACA,CAFO;AAKP,OAAO,MAAMC,WAAW,GAAGV,MAAM,CAACW,KAAM;AACxC;AACA;AACA;AACA,CAJO;AAMP,OAAO,MAAMC,iBA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;AACA;AACA;AACA;AACA,CA1CO","sourcesContent":["/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\n\n/**\n * Import custom style properties.\n */\nimport {COLORS} from '../styles';\nimport {\n ComponentLStyling,\n ComponentMStyling,\n ComponentSStyling,\n ComponentTextStyle,\n ComponentXSStyling\n} from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\n\n/**\n * Table styles\n */\n\nexport const TableWrapper = styled.div`\n position: relative;\n`;\n\n\nexport const StyledTable = styled.table`\n background: transparent;\n width: 100%;\n table-layout: fixed;\n`;\n\nexport const StyledTableHeader = styled.thead`\n`;\n\nexport const StyledTableHeaderTitle = styled.tr`\n`;\n\nexport const StyledTableHeaderTitleContent = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n box-sizing: border-box;\n min-height: 56px;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 2px solid ${COLORS.neutral_200};\n padding: 0 16px;\n\n ${ComponentLStyling(ComponentTextStyle.Bold, COLORS.black)}\n .title-menu {\n margin-right: -16px;\n }\n`;\n\nexport const StyledTableHeaderColumns = styled.tr`\n`;\n\nexport const StyledTableHeaderColumnContent = styled.div`\n box-sizing: border-box;\n min-height: 56px;\n padding: 0 16px;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-top: 1px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n`;\n\nexport const StyledTableHeaderColumn = styled.th`\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n position: relative;\n\n background-color: ${COLORS.white};\n\n //fixes header heights no idea why\n height: 1px;\n\n &.sortable {\n cursor: pointer;\n\n &:hover {\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:active {\n background-color: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n box-shadow: none !important;\n z-index: ${Z_INDEXES.active};\n }\n\n &:focus {\n outline: none;\n box-shadow: 0 4px 12px ${COLORS.focus_25}, 0 0 8px ${COLORS.focus};\n z-index: ${Z_INDEXES.focus};\n }\n }\n\n &.sortable ${StyledTableHeaderColumnContent} > svg {\n opacity: 0;\n }\n\n &.sortable.sorted ${StyledTableHeaderColumnContent} > svg {\n opacity: 1;\n }\n\n &.sorted {\n background-color: ${COLORS.neutral_20};\n }\n\n`;\n\nexport const StyledTableBodyRow = styled.tr`\n cursor: pointer;\n position: relative;\n outline: none;\n\n &:hover {\n background-color: ${COLORS.primary_200};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:focus {\n background-color: ${COLORS.primary_200};\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2E7FA1;\n z-index: ${Z_INDEXES.focus};\n outline: none;\n }\n\n &:active {\n box-shadow: none;\n z-index: ${Z_INDEXES.active};\n }\n\n`;\n\nexport const StyledTableBody = styled.tbody`\n ${StyledTableBodyRow}:nth-child(odd):not(:hover):not(:focus):not(:active) {\n background-color: ${COLORS.neutral_100};\n }\n\n ${StyledTableBodyRow}:nth-child(even):not(:hover):not(:focus):not(:active) {\n background-color: ${COLORS.neutral_20};\n }\n`;\n\n\nexport const StyledTableCell = styled.td``;\n\nexport const StyledTableCellContent = styled.div`\n min-height: 48px;\n\n padding: 0 16px;\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n\n display: flex;\n align-items: center;\n justify-content: left;\n gap: 8px;\n\n &.truncate-text,\n &.truncate-text span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &.left {\n justify-content: left;\n }\n\n &.right {\n justify-content: right;\n }\n\n &.center {\n justify-content: center;\n }\n`;\n\nexport const StyledTableCellIcon = styled.div`\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n\n svg {\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n }\n`;\n\nexport const StyledTableCellText = styled.span`\n padding: 12px 0;\n`;\n\n\nexport const StyledTableFooter = styled.tfoot`\n`;\n\nexport const StyledTableFooterContent = styled.div`\n border-top: 2px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n box-sizing: border-box;\n min-height: 56px;\n\n display: flex;\n align-items: center;\n justify-content: right;\n\n`;\n\nexport const StyledTableFooterCurrentInfo = styled.span`\n padding: 0 16px;\n ${ComponentXSStyling(ComponentTextStyle.Regular, COLORS.black)}\n`;\n\nexport const StyledTableFooterControls = styled.div`\n display: flex;\n`;\n\nexport const StyledTableSpinner = styled.div`\n height: 100%;\n width: 100%;\n position: absolute;\n background-color: rgba(0, 0, 0, 0.5);\n top: 0;\n`;\n\nexport const StyledTableFooterCollapseButton = styled.button`\n position: relative;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 1px solid ${COLORS.neutral_200};\n border-left: none;\n border-right: none;\n box-sizing: border-box;\n min-height: 48px;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n gap: 4px;\n background: ${COLORS.white};\n\n cursor: pointer;\n\n ${ComponentMStyling(ComponentTextStyle.Bold, COLORS.neutral_800)}\n &:focus {\n outline: none;\n z-index: ${Z_INDEXES.focus};\n color: ${COLORS.neutral_600};\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2E7FA1;\n }\n\n &:hover {\n z-index: ${Z_INDEXES.hover};\n background: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n }\n\n &:active {\n box-shadow: none;\n z-index: ${Z_INDEXES.active};\n background: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n }\n\n &:disabled {\n display: none;\n }\n\n`;\n"],"file":"TableStyles.js"}
@@ -44,7 +44,7 @@ var TableBody = function TableBody(props) {
44
44
  {
45
45
  var _props = _objectSpread({
46
46
  variant: 'default',
47
- href: ''
47
+ href: '#'
48
48
  }, column.additionalProps);
49
49
 
50
50
  return /*#__PURE__*/React.createElement(_HyperLink.HyperLink, _extends({
@@ -108,7 +108,7 @@ var TableBody = function TableBody(props) {
108
108
  case 'number':
109
109
  case 'text':
110
110
  default:
111
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_TableStyles.StyledTableCellIcon, null, column.icon), /*#__PURE__*/React.createElement("span", null, row[column.key]));
111
+ return /*#__PURE__*/React.createElement(React.Fragment, null, column.icon && /*#__PURE__*/React.createElement(_TableStyles.StyledTableCellIcon, null, column.icon), /*#__PURE__*/React.createElement(_TableStyles.StyledTableCellText, null, row[column.key]));
112
112
  }
113
113
  };
114
114
 
@@ -145,7 +145,7 @@ var TableBody = function TableBody(props) {
145
145
  },
146
146
  title: column.shortenText && row[column.key]
147
147
  }, /*#__PURE__*/React.createElement(_TableStyles.StyledTableCellContent, {
148
- className: "".concat(column.shortenText && "truncate-text", " ").concat(column.justify || '')
148
+ className: "".concat(column.shortenText ? "truncate-text" : '', " ").concat(column.justify || '')
149
149
  }, renderCellBody(column, row)));
150
150
  }));
151
151
  }) : /*#__PURE__*/React.createElement(_TableStyles.StyledTableBodyRow, {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/Table/TableBody.tsx"],"names":["TableBody","props","renderCellBody","column","row","type","variant","href","additionalProps","colorFn","color","key","e","preventDefault","stopPropagation","action","iconColor","shape","useTransparentBackground","icon","size","Size","Small","customContent","currentPageRows","length","map","index","selectable","onRowClick","event","undefined","multiSelect","selected","indexOf","keyExpr","columns","maxWidth","width","shortenText","justify"],"mappings":";;;;;;;;;;;AACA;;AACA;;AACA;;AACA;;AAEA;;AAEA;;AACA;;;;;;;;;;;;;;;;AAeA,IAAMA,SAAmC,GAAG,SAAtCA,SAAsC,CAACC,KAAD,EAAW;AAEnD,MAAMC,cAAc,GAAG,SAAjBA,cAAiB,CAACC,MAAD,EAAsBC,GAAtB,EAAmC;AACxD,YAAQD,MAAM,CAACE,IAAf;AACE,WAAK,MAAL;AAAa;AACX,cAAMJ,MAAK;AAAKK,YAAAA,OAAO,EAAE,SAAd;AAAyBC,YAAAA,IAAI,EAAE;AA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D,UAAAA,QAAQ,EAAElC,MAAM,CAACmC;AAAlB,SAJrB;AAKiB,QAAA,KAAK,EAAEnC,MAAM,CAACoC,WAAP,IAAsBnC,GAAG,CAACD,MAAM,CAACQ,GAAR;AALjD,sBAME,oBAAC,mCAAD;AAAwB,QAAA,SAAS,YAAKR,MAAM,CAACoC,WAAP,mBAAL,cAA8CpC,MAAM,CAACqC,OAAP,IAAkB,EAAhE;AAAjC,SACGtC,cAAc,CAACC,MAAD,EAASC,GAAT,CADjB,CANF,CADiB;AAAA,KAAlB,CApBH,CADwB;AAAA,GAA1B,CADD,gBAqCC,oBAAC,+BAAD;AAAoB,mBAAY;AAAhC,kBACE,oBAAC,4BAAD;AAAiB,IAAA,OAAO,EAAEH,KAAK,CAACmC,OAAN,CAAcX,MAAd,IAAwBxB,KAAK,CAAC+B,WAAN,GAAoB,CAApB,GAAwB,CAAhD;AAA1B,kBACE,oBAAC,mCAAD;AAAwB,IAAA,SAAS,EAAE;AAAnC,oCADF,CADF,CAtCJ,CADF;AAkDD,CAnHH;;;AALER,EAAAA,e;AACAK,EAAAA,U;AACAI,EAAAA,Q;;eAyHajC,S","sourcesContent":["import {TableColumn, TableProps} from './TableTypes';\nimport {Button} from '../Button';\nimport {Size} from '../types';\nimport * as React from 'react';\nimport {Checkbox} from '../InputFields';\nimport {ButtonProps} from '../Button/Button';\nimport IconButton, {IconButtonProps} from '../Button/Iconbutton';\nimport {HyperlinkProps} from '../HyperLink/HyperLink';\nimport {HyperLink} from '../HyperLink';\nimport {\n StyledTableBody,\n StyledTableBodyRow,\n StyledTableCell,\n StyledTableCellContent,\n StyledTableCellIcon\n} from './TableStyles';\n\n\ninterface TableBodyProps extends TableProps {\n currentPageRows: any[];\n onRowClick?: (row: any) => void;\n selected?: any | any[];\n}\n\nconst TableBody: React.FC<TableBodyProps> = (props) => {\n\n const renderCellBody = (column: TableColumn, row: any) => {\n switch (column.type) {\n case 'link': {\n const props = ({variant: 'default', href: '', ...column.additionalProps}) as HyperlinkProps;\n return (\n <HyperLink style={column.colorFn && {color: column.colorFn(row, column.key)}}\n {...props}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {row[column.key]}\n </HyperLink>\n );\n }\n case 'icon': {\n const props = ({\n iconColor: column.colorFn && column.colorFn(row, column.key),\n variant: 'secondary',\n shape: 'circular',\n useTransparentBackground: true,\n ...column.additionalProps\n }) as IconButtonProps;\n return <IconButton {...props}\n action={(e) => {\n e?.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {column.icon}\n </IconButton>\n }\n case 'button': {\n const props = ({\n variant: 'tertiary',\n size: Size.Small,\n ...column.additionalProps\n }) as ButtonProps;\n return <Button style={column.colorFn && {color: column.colorFn(row, column.key)}}\n {...props}\n onClick={(e) => {\n e?.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {row[column.key]}\n </Button>\n }\n case 'boolean':\n return <Checkbox selected={!!row[column.key]} readonly={true}/>;\n case 'custom':\n return column.customContent && column.customContent(row, column.key);\n case 'number':\n case 'text':\n default:\n return (\n <>\n <StyledTableCellIcon>{column.icon}</StyledTableCellIcon>\n <span>{row[column.key]}</span>\n </>\n );\n }\n }\n\n return (\n <StyledTableBody>\n {props.currentPageRows.length > 0 ? (\n props.currentPageRows.map((row: any, index: number) => (\n <StyledTableBodyRow key={`row_${index}`}\n className={props.selectable ? 'selectable' : ''}\n onClick={() => props.onRowClick && props.onRowClick(row)}\n onMouseDown={(event) => event.preventDefault()}\n onKeyPress={(e) => {\n if (e.key === 'Enter') {\n props.onRowClick && props.onRowClick(row);\n }\n }}\n tabIndex={props.selectable ? 0 : undefined}\n data-testid=\"TestTableDataRow\">\n {\n props.multiSelect &&\n <StyledTableCell>\n <StyledTableCellContent>\n <Checkbox selected={props.selected?.indexOf(props.keyExpr ? row[props.keyExpr] : row) > -1}\n readonly={true}/>\n </StyledTableCellContent>\n </StyledTableCell>\n }\n {props.columns.map((column: TableColumn) => (\n <StyledTableCell key={`row_${index}_${column.key}`}\n style={column.colorFn ? {\n color: column.colorFn(row, column.key),\n maxWidth: column.width\n } : {maxWidth: column.width}}\n title={column.shortenText && row[column.key]}>\n <StyledTableCellContent className={`${column.shortenText && `truncate-text`} ${column.justify || ''}`}>\n {renderCellBody(column, row)}\n </StyledTableCellContent>\n </StyledTableCell>\n ))}\n </StyledTableBodyRow>\n ))\n ) : (\n <StyledTableBodyRow data-testid=\"TestTableNoDataRow\">\n <StyledTableCell colSpan={props.columns.length + (props.multiSelect ? 1 : 0)}>\n <StyledTableCellContent className={'center'}>\n There are no rows to display\n </StyledTableCellContent>\n </StyledTableCell>\n </StyledTableBodyRow>\n )}\n\n </StyledTableBody>\n );\n }\n;\n\nexport default TableBody;\n"],"file":"TableBody.js"}
1
+ {"version":3,"sources":["../../../src/Table/TableBody.tsx"],"names":["TableBody","props","renderCellBody","column","row","type","variant","href","additionalProps","colorFn","color","key","e","preventDefault","stopPropagation","action","iconColor","shape","useTransparentBackground","icon","size","Size","Small","customContent","currentPageRows","length","map","index","selectable","onRowClick","event","undefined","multiSelect","selected","indexOf","keyExpr","columns","maxWidth","width","shortenText","justify"],"mappings":";;;;;;;;;;;AACA;;AACA;;AACA;;AACA;;AAEA;;AAEA;;AACA;;;;;;;;;;;;;;;;AAeA,IAAMA,SAAmC,GAAG,SAAtCA,SAAsC,CAACC,KAAD,EAAW;AAEnD,MAAMC,cAAc,GAAG,SAAjBA,cAAiB,CAACC,MAAD,EAAsBC,GAAtB,EAAmC;AACxD,YAAQD,MAAM,CAACE,IAAf;AACE,WAAK,MAAL;AAAa;AACX,cAAMJ,MAAK;AAAKK,YAAAA,OAAO,EAAE,SAAd;AAAyBC,YAAAA,IAAI,EAAE;AAA/B,aAAuCJ,MAAM,CAACK,eAA9C,CAAX;;AACA,8BACE,oBAAC,oBAAD;AAAW,YAAA,KAAK,EAAEL,MAAM,CAACM,OAAP,IAAkB;AAACC,cAAAA,KAAK,EAAEP,MAAM,CAACM,OAAP,CAAeL,GAA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AACQ,GAAR;AALjD,sBAME,oBAAC,mCAAD;AACE,QAAA,SAAS,YAAKR,MAAM,CAACoC,WAAP,qBAAuC,EAA5C,cAAkDpC,MAAM,CAACqC,OAAP,IAAkB,EAApE;AADX,SAEGtC,cAAc,CAACC,MAAD,EAASC,GAAT,CAFjB,CANF,CADiB;AAAA,KAAlB,CApBH,CADwB;AAAA,GAA1B,CADD,gBAsCC,oBAAC,+BAAD;AAAoB,mBAAY;AAAhC,kBACE,oBAAC,4BAAD;AAAiB,IAAA,OAAO,EAAEH,KAAK,CAACmC,OAAN,CAAcX,MAAd,IAAwBxB,KAAK,CAAC+B,WAAN,GAAoB,CAApB,GAAwB,CAAhD;AAA1B,kBACE,oBAAC,mCAAD;AAAwB,IAAA,SAAS,EAAE;AAAnC,oCADF,CADF,CAvCJ,CADF;AAmDD,CAvHH;;;AALER,EAAAA,e;AACAK,EAAAA,U;AACAI,EAAAA,Q;;eA6HajC,S","sourcesContent":["import {TableColumn, TableProps} from './TableTypes';\nimport {Button} from '../Button';\nimport {Size} from '../types';\nimport * as React from 'react';\nimport {Checkbox} from '../InputFields';\nimport {ButtonProps} from '../Button/Button';\nimport IconButton, {IconButtonProps} from '../Button/Iconbutton';\nimport {HyperlinkProps} from '../HyperLink/HyperLink';\nimport {HyperLink} from '../HyperLink';\nimport {\n StyledTableBody,\n StyledTableBodyRow,\n StyledTableCell,\n StyledTableCellContent,\n StyledTableCellIcon, StyledTableCellText\n} from './TableStyles';\n\n\ninterface TableBodyProps extends TableProps {\n currentPageRows: any[];\n onRowClick?: (row: any) => void;\n selected?: any | any[];\n}\n\nconst TableBody: React.FC<TableBodyProps> = (props) => {\n\n const renderCellBody = (column: TableColumn, row: any) => {\n switch (column.type) {\n case 'link': {\n const props = ({variant: 'default', href: '#', ...column.additionalProps}) as HyperlinkProps;\n return (\n <HyperLink style={column.colorFn && {color: column.colorFn(row, column.key)}}\n {...props}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {row[column.key]}\n </HyperLink>\n );\n }\n case 'icon': {\n const props = ({\n iconColor: column.colorFn && column.colorFn(row, column.key),\n variant: 'secondary',\n shape: 'circular',\n useTransparentBackground: true,\n ...column.additionalProps\n }) as IconButtonProps;\n return <IconButton {...props}\n action={(e) => {\n e?.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {column.icon}\n </IconButton>\n }\n case 'button': {\n const props = ({\n variant: 'tertiary',\n size: Size.Small,\n ...column.additionalProps\n }) as ButtonProps;\n return <Button style={column.colorFn && {color: column.colorFn(row, column.key)}}\n {...props}\n onClick={(e) => {\n e?.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {row[column.key]}\n </Button>\n }\n case 'boolean':\n return <Checkbox selected={!!row[column.key]} readonly={true}/>;\n case 'custom':\n return column.customContent && column.customContent(row, column.key);\n case 'number':\n case 'text':\n default:\n return (\n <>\n {\n column.icon &&\n <StyledTableCellIcon>{column.icon}</StyledTableCellIcon>\n }\n <StyledTableCellText>{row[column.key]}</StyledTableCellText>\n </>\n );\n }\n }\n\n return (\n <StyledTableBody>\n {props.currentPageRows.length > 0 ? (\n props.currentPageRows.map((row: any, index: number) => (\n <StyledTableBodyRow key={`row_${index}`}\n className={props.selectable ? 'selectable' : ''}\n onClick={() => props.onRowClick && props.onRowClick(row)}\n onMouseDown={(event) => event.preventDefault()}\n onKeyPress={(e) => {\n if (e.key === 'Enter') {\n props.onRowClick && props.onRowClick(row);\n }\n }}\n tabIndex={props.selectable ? 0 : undefined}\n data-testid=\"TestTableDataRow\">\n {\n props.multiSelect &&\n <StyledTableCell>\n <StyledTableCellContent>\n <Checkbox selected={props.selected?.indexOf(props.keyExpr ? row[props.keyExpr] : row) > -1}\n readonly={true}/>\n </StyledTableCellContent>\n </StyledTableCell>\n }\n {props.columns.map((column: TableColumn) => (\n <StyledTableCell key={`row_${index}_${column.key}`}\n style={column.colorFn ? {\n color: column.colorFn(row, column.key),\n maxWidth: column.width\n } : {maxWidth: column.width}}\n title={column.shortenText && row[column.key]}>\n <StyledTableCellContent\n className={`${column.shortenText ? `truncate-text` : ''} ${column.justify || ''}`}>\n {renderCellBody(column, row)}\n </StyledTableCellContent>\n </StyledTableCell>\n ))}\n </StyledTableBodyRow>\n ))\n ) : (\n <StyledTableBodyRow data-testid=\"TestTableNoDataRow\">\n <StyledTableCell colSpan={props.columns.length + (props.multiSelect ? 1 : 0)}>\n <StyledTableCellContent className={'center'}>\n There are no rows to display\n </StyledTableCellContent>\n </StyledTableCell>\n </StyledTableBodyRow>\n )}\n\n </StyledTableBody>\n );\n }\n;\n\nexport default TableBody;\n"],"file":"TableBody.js"}
@@ -48,6 +48,7 @@ var TableFooter = function TableFooter(props) {
48
48
  }, props.isCollapsed && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", null, "Show more(", props.rows.length - props.rowsPerPage, ")"), /*#__PURE__*/_react.default.createElement(_icons.SystemIcons.ArrowDropDown, null)), !props.isCollapsed && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", null, "Show less"), /*#__PURE__*/_react.default.createElement(_icons.SystemIcons.ArrowDropUp, null))), !props.accordion && /*#__PURE__*/_react.default.createElement(_TableStyles.StyledTableFooterContent, null, /*#__PURE__*/_react.default.createElement(_Dropdown.DropdownFilter, {
49
49
  id: "rows-per-page",
50
50
  list: rowsPerPageValues,
51
+ margin: '0',
51
52
  disableSorting: true,
52
53
  onSelect: function onSelect(value) {
53
54
  return props.onRowsPerPageChange(+value);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/Table/TableFooter.tsx"],"names":["TableFooter","props","rowsPerPageValues","label","dropDownText","rowsPerPage","columns","length","multiSelect","accordion","setIsCollapsed","isCollapsed","e","preventDefault","rows","value","onRowsPerPageChange","total","from","to","prevPage","COLORS","neutral_600","nextPage"],"mappings":";;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AAEA;;AAMA;;;;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,EAAAA,K;AACAM,EAAAA,Q;AACAH,EAAAA,Q;AACAV,EAAAA,c;AACAC,EAAAA,W;;eAmEaX,W","sourcesContent":["import React from 'react';\nimport {TableProps} from './TableTypes';\nimport {DropdownFilter} from '../Dropdown';\nimport {IconButton} from '../Button';\nimport {ChevronLeft, ChevronRight} from '../icons/systemicons/SystemIcons';\nimport {COLORS} from '../styles';\nimport {DropdownFilterItem} from '../Dropdown/DropdownFilter';\nimport {\n StyledTableFooter, StyledTableFooterCollapseButton,\n StyledTableFooterContent,\n StyledTableFooterControls,\n StyledTableFooterCurrentInfo\n} from './TableStyles';\nimport {SystemIcons} from '../icons';\n\n\ninterface TableFooterProps extends TableProps {\n onRowsPerPageChange: (value: number) => void;\n rowsPerPage: number;\n from?: number;\n to?: number;\n total?: number;\n nextPage: () => void;\n prevPage: () => void;\n setIsCollapsed: (isCollapsed: boolean) => void;\n isCollapsed: boolean;\n}\n\nconst TableFooter: React.FunctionComponent<TableFooterProps> = (props) => {\n const rowsPerPageValues: DropdownFilterItem[] = [{label: '10'}, {label: '20'}, {label: '50'}, {label: '100'}];\n\n const dropDownText = `Rows per page: ${props.rowsPerPage}`;\n\n return (\n <StyledTableFooter>\n <tr>\n <td colSpan={props.columns.length + (props.multiSelect ? 1 : 0)} data-testid=\"TestTableFooterRow\">\n {\n props.accordion &&\n <StyledTableFooterCollapseButton onClick={() => props.setIsCollapsed(!props.isCollapsed)}\n onMouseDown={e => e.preventDefault()}\n disabled={props.isCollapsed && props.rows.length <= props.rowsPerPage}>\n {\n props.isCollapsed &&\n <>\n <span>Show more({props.rows.length - props.rowsPerPage})</span>\n <SystemIcons.ArrowDropDown/>\n </>\n }\n {\n !props.isCollapsed &&\n <>\n <span>Show less</span>\n <SystemIcons.ArrowDropUp/>\n </>\n }\n </StyledTableFooterCollapseButton>\n }\n {\n !props.accordion &&\n <StyledTableFooterContent>\n <DropdownFilter\n id=\"rows-per-page\"\n list={rowsPerPageValues}\n disableSorting={true}\n onSelect={(value) => props.onRowsPerPageChange(+value)}\n initalValue={dropDownText}\n keepInitialValue={true}\n isButton={true}\n />\n <StyledTableFooterCurrentInfo>\n {props.total === 0 ? 0 : props.from}-{props.to} of {props.total}\n </StyledTableFooterCurrentInfo>\n <StyledTableFooterControls>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => props.prevPage()}\n disabled={props.from === 1}>\n <ChevronLeft size=\"24\" color={COLORS.neutral_600}/>\n </IconButton>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => props.nextPage()}\n disabled={props.to === props.total}>\n <ChevronRight size=\"24\" color={COLORS.neutral_600}/>\n </IconButton>\n </StyledTableFooterControls>\n </StyledTableFooterContent>\n }\n </td>\n </tr>\n </StyledTableFooter>\n );\n};\n\n\nexport default TableFooter;\n"],"file":"TableFooter.js"}
1
+ {"version":3,"sources":["../../../src/Table/TableFooter.tsx"],"names":["TableFooter","props","rowsPerPageValues","label","dropDownText","rowsPerPage","columns","length","multiSelect","accordion","setIsCollapsed","isCollapsed","e","preventDefault","rows","value","onRowsPerPageChange","total","from","to","prevPage","COLORS","neutral_600","nextPage"],"mappings":";;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AAEA;;AAMA;;;;AAeA,IAAMA,WAAsD,GAAG,SAAzDA,WAAyD,CAACC,KAAD,EAAW;AACxE,MAAMC,iBAAuC,GAAG,CAAC;AAACC,IAAAA,KAAK,EAAE;AAAR,GAAD,EAAgB;AAACA,IAAAA,KAAK,EAAE;AAAR,GAAhB,EAA+B;AAACA,IAAAA,KAAK,EAAE;AAAR,GAA/B,EAA8C;AAACA,IAAAA,KAAK,EAAE;AAAR,GAA9C,CAAhD;AAEA,MAAMC,YAAY,4BAAqBH,KAAK,CAACI,WAA3B,CAAlB;AAEA,sBACE,6BAAC,8BAAD,qBACE,sDACE;AAAI,IAAA,OAAO,EAAEJ,KAAK,CAACK,OAAN,CAAcC,MAAd,IAAwBN,KAAK,CAACO,WAAN,GAAoB,CAApB,GAAwB,CAA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sCAAD,qBACE,6BAAC,kBAAD;AAAY,IAAA,OAAO,EAAC,WAApB;AAAgC,IAAA,KAAK,EAAC,UAAtC;AAAiD,IAAA,MAAM,EAAE;AAAA,aAAMhB,KAAK,CAACmB,QAAN,EAAN;AAAA,KAAzD;AACY,IAAA,QAAQ,EAAEnB,KAAK,CAACiB,IAAN,KAAe;AADrC,kBAEE,6BAAC,wBAAD;AAAa,IAAA,IAAI,EAAC,IAAlB;AAAuB,IAAA,KAAK,EAAEG,eAAOC;AAArC,IAFF,CADF,eAKE,6BAAC,kBAAD;AAAY,IAAA,OAAO,EAAC,WAApB;AAAgC,IAAA,KAAK,EAAC,UAAtC;AAAiD,IAAA,MAAM,EAAE;AAAA,aAAMrB,KAAK,CAACsB,QAAN,EAAN;AAAA,KAAzD;AACY,IAAA,QAAQ,EAAEtB,KAAK,CAACkB,EAAN,KAAalB,KAAK,CAACgB;AADzC,kBAEE,6BAAC,yBAAD;AAAc,IAAA,IAAI,EAAC,IAAnB;AAAwB,IAAA,KAAK,EAAEI,eAAOC;AAAtC,IAFF,CALF,CAdF,CAxBJ,CADF,CADF,CADF;AAyDD,CA9DD;;;AAXEN,EAAAA,mB;AACAX,EAAAA,W;AACAa,EAAAA,I;AACAC,EAAAA,E;AACAF,EAAAA,K;AACAM,EAAAA,Q;AACAH,EAAAA,Q;AACAV,EAAAA,c;AACAC,EAAAA,W;;eAoEaX,W","sourcesContent":["import React from 'react';\nimport {TableProps} from './TableTypes';\nimport {DropdownFilter} from '../Dropdown';\nimport {IconButton} from '../Button';\nimport {ChevronLeft, ChevronRight} from '../icons/systemicons/SystemIcons';\nimport {COLORS} from '../styles';\nimport {DropdownFilterItem} from '../Dropdown/DropdownFilter';\nimport {\n StyledTableFooter, StyledTableFooterCollapseButton,\n StyledTableFooterContent,\n StyledTableFooterControls,\n StyledTableFooterCurrentInfo\n} from './TableStyles';\nimport {SystemIcons} from '../icons';\n\n\ninterface TableFooterProps extends TableProps {\n onRowsPerPageChange: (value: number) => void;\n rowsPerPage: number;\n from?: number;\n to?: number;\n total?: number;\n nextPage: () => void;\n prevPage: () => void;\n setIsCollapsed: (isCollapsed: boolean) => void;\n isCollapsed: boolean;\n}\n\nconst TableFooter: React.FunctionComponent<TableFooterProps> = (props) => {\n const rowsPerPageValues: DropdownFilterItem[] = [{label: '10'}, {label: '20'}, {label: '50'}, {label: '100'}];\n\n const dropDownText = `Rows per page: ${props.rowsPerPage}`;\n\n return (\n <StyledTableFooter>\n <tr>\n <td colSpan={props.columns.length + (props.multiSelect ? 1 : 0)} data-testid=\"TestTableFooterRow\">\n {\n props.accordion &&\n <StyledTableFooterCollapseButton onClick={() => props.setIsCollapsed(!props.isCollapsed)}\n onMouseDown={e => e.preventDefault()}\n disabled={props.isCollapsed && props.rows.length <= props.rowsPerPage}>\n {\n props.isCollapsed &&\n <>\n <span>Show more({props.rows.length - props.rowsPerPage})</span>\n <SystemIcons.ArrowDropDown/>\n </>\n }\n {\n !props.isCollapsed &&\n <>\n <span>Show less</span>\n <SystemIcons.ArrowDropUp/>\n </>\n }\n </StyledTableFooterCollapseButton>\n }\n {\n !props.accordion &&\n <StyledTableFooterContent>\n <DropdownFilter\n id=\"rows-per-page\"\n list={rowsPerPageValues}\n margin={'0'}\n disableSorting={true}\n onSelect={(value) => props.onRowsPerPageChange(+value)}\n initalValue={dropDownText}\n keepInitialValue={true}\n isButton={true}\n />\n <StyledTableFooterCurrentInfo>\n {props.total === 0 ? 0 : props.from}-{props.to} of {props.total}\n </StyledTableFooterCurrentInfo>\n <StyledTableFooterControls>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => props.prevPage()}\n disabled={props.from === 1}>\n <ChevronLeft size=\"24\" color={COLORS.neutral_600}/>\n </IconButton>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => props.nextPage()}\n disabled={props.to === props.total}>\n <ChevronRight size=\"24\" color={COLORS.neutral_600}/>\n </IconButton>\n </StyledTableFooterControls>\n </StyledTableFooterContent>\n }\n </td>\n </tr>\n </StyledTableFooter>\n );\n};\n\n\nexport default TableFooter;\n"],"file":"TableFooter.js"}
@@ -14,6 +14,7 @@ export declare const StyledTableBody: import("styled-components").StyledComponen
14
14
  export declare const StyledTableCell: import("styled-components").StyledComponent<"td", any, {}, never>;
15
15
  export declare const StyledTableCellContent: import("styled-components").StyledComponent<"div", any, {}, never>;
16
16
  export declare const StyledTableCellIcon: import("styled-components").StyledComponent<"div", any, {}, never>;
17
+ export declare const StyledTableCellText: import("styled-components").StyledComponent<"span", any, {}, never>;
17
18
  export declare const StyledTableFooter: import("styled-components").StyledComponent<"tfoot", any, {}, never>;
18
19
  export declare const StyledTableFooterContent: import("styled-components").StyledComponent<"div", any, {}, never>;
19
20
  export declare const StyledTableFooterCurrentInfo: import("styled-components").StyledComponent<"span", any, {}, never>;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.StyledTableFooterCollapseButton = exports.StyledTableSpinner = exports.StyledTableFooterControls = exports.StyledTableFooterCurrentInfo = exports.StyledTableFooterContent = exports.StyledTableFooter = exports.StyledTableCellIcon = exports.StyledTableCellContent = exports.StyledTableCell = exports.StyledTableBody = exports.StyledTableBodyRow = exports.StyledTableHeaderColumn = exports.StyledTableHeaderColumnContent = exports.StyledTableHeaderColumns = exports.StyledTableHeaderTitleContent = exports.StyledTableHeaderTitle = exports.StyledTableHeader = exports.StyledTable = exports.TableWrapper = void 0;
6
+ exports.StyledTableFooterCollapseButton = exports.StyledTableSpinner = exports.StyledTableFooterControls = exports.StyledTableFooterCurrentInfo = exports.StyledTableFooterContent = exports.StyledTableFooter = exports.StyledTableCellText = exports.StyledTableCellIcon = exports.StyledTableCellContent = exports.StyledTableCell = exports.StyledTableBody = exports.StyledTableBodyRow = exports.StyledTableHeaderColumn = exports.StyledTableHeaderColumnContent = exports.StyledTableHeaderColumns = exports.StyledTableHeaderTitleContent = exports.StyledTableHeaderTitle = exports.StyledTableHeader = exports.StyledTable = exports.TableWrapper = void 0;
7
7
 
8
8
  var _styledComponents = _interopRequireDefault(require("styled-components"));
9
9
 
@@ -13,7 +13,7 @@ var _typography = require("../styles/typography");
13
13
 
14
14
  var _zIndexes = require("../styles/z-indexes");
15
15
 
16
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19;
16
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20;
17
17
 
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
19
 
@@ -26,7 +26,7 @@ var TableWrapper = _styledComponents.default.div(_templateObject || (_templateOb
26
26
 
27
27
  exports.TableWrapper = TableWrapper;
28
28
 
29
- var StyledTable = _styledComponents.default.table(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: transparent;\n width: 100%;\n"])));
29
+ var StyledTable = _styledComponents.default.table(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: transparent;\n width: 100%;\n table-layout: fixed;\n"])));
30
30
 
31
31
  exports.StyledTable = StyledTable;
32
32
 
@@ -50,7 +50,7 @@ var StyledTableHeaderColumnContent = _styledComponents.default.div(_templateObje
50
50
 
51
51
  exports.StyledTableHeaderColumnContent = StyledTableHeaderColumnContent;
52
52
 
53
- var StyledTableHeaderColumn = _styledComponents.default.th(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n ", "\n position: relative;\n\n background-color: ", ";\n\n //fixes header heights no idea why\n height: 1px;\n\n &.sortable {\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n color: ", ";\n z-index: ", ";\n }\n\n &:active {\n background-color: ", ";\n color: ", ";\n box-shadow: none !important;\n z-index: ", ";\n }\n\n &:focus {\n outline: none;\n box-shadow: 0 4px 12px ", ", 0 0 8px ", ";\n z-index: ", ";\n }\n }\n\n &.sortable ", " > svg {\n opacity: 0;\n }\n\n &.sortable.sorted ", " > svg {\n opacity: 1;\n }\n\n"])), (0, _typography.ComponentSStyling)(_typography.ComponentTextStyle.Bold, _styles.COLORS.neutral_600), _styles.COLORS.white, _styles.COLORS.primary_20, _styles.COLORS.primary_700, _zIndexes.Z_INDEXES.hover, _styles.COLORS.primary_100, _styles.COLORS.primary_800, _zIndexes.Z_INDEXES.active, _styles.COLORS.focus_25, _styles.COLORS.focus, _zIndexes.Z_INDEXES.focus, StyledTableHeaderColumnContent, StyledTableHeaderColumnContent);
53
+ var StyledTableHeaderColumn = _styledComponents.default.th(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n ", "\n position: relative;\n\n background-color: ", ";\n\n //fixes header heights no idea why\n height: 1px;\n\n &.sortable {\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n color: ", ";\n z-index: ", ";\n }\n\n &:active {\n background-color: ", ";\n color: ", ";\n box-shadow: none !important;\n z-index: ", ";\n }\n\n &:focus {\n outline: none;\n box-shadow: 0 4px 12px ", ", 0 0 8px ", ";\n z-index: ", ";\n }\n }\n\n &.sortable ", " > svg {\n opacity: 0;\n }\n\n &.sortable.sorted ", " > svg {\n opacity: 1;\n }\n\n &.sorted {\n background-color: ", ";\n }\n\n"])), (0, _typography.ComponentSStyling)(_typography.ComponentTextStyle.Bold, _styles.COLORS.neutral_600), _styles.COLORS.white, _styles.COLORS.primary_20, _styles.COLORS.primary_700, _zIndexes.Z_INDEXES.hover, _styles.COLORS.primary_100, _styles.COLORS.primary_800, _zIndexes.Z_INDEXES.active, _styles.COLORS.focus_25, _styles.COLORS.focus, _zIndexes.Z_INDEXES.focus, StyledTableHeaderColumnContent, StyledTableHeaderColumnContent, _styles.COLORS.neutral_20);
54
54
 
55
55
  exports.StyledTableHeaderColumn = StyledTableHeaderColumn;
56
56
 
@@ -66,7 +66,7 @@ var StyledTableCell = _styledComponents.default.td(_templateObject11 || (_templa
66
66
 
67
67
  exports.StyledTableCell = StyledTableCell;
68
68
 
69
- var StyledTableCellContent = _styledComponents.default.div(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n min-height: 48px;\n\n padding: 0 16px;\n ", "\n\n display: flex;\n align-items: center;\n gap: 8px;\n\n &.truncate-text,\n &.truncate-text span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &.left {\n justify-content: left;\n }\n\n &.right {\n justify-content: right;\n }\n\n &.center {\n justify-content: center;\n }\n"])), (0, _typography.ComponentSStyling)(_typography.ComponentTextStyle.Regular, null));
69
+ var StyledTableCellContent = _styledComponents.default.div(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n min-height: 48px;\n\n padding: 0 16px;\n ", "\n\n display: flex;\n align-items: center;\n justify-content: left;\n gap: 8px;\n\n &.truncate-text,\n &.truncate-text span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &.left {\n justify-content: left;\n }\n\n &.right {\n justify-content: right;\n }\n\n &.center {\n justify-content: center;\n }\n"])), (0, _typography.ComponentSStyling)(_typography.ComponentTextStyle.Regular, _styles.COLORS.black));
70
70
 
71
71
  exports.StyledTableCellContent = StyledTableCellContent;
72
72
 
@@ -74,27 +74,31 @@ var StyledTableCellIcon = _styledComponents.default.div(_templateObject13 || (_t
74
74
 
75
75
  exports.StyledTableCellIcon = StyledTableCellIcon;
76
76
 
77
- var StyledTableFooter = _styledComponents.default.tfoot(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n"])));
77
+ var StyledTableCellText = _styledComponents.default.span(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n padding: 12px 0;\n"])));
78
+
79
+ exports.StyledTableCellText = StyledTableCellText;
80
+
81
+ var StyledTableFooter = _styledComponents.default.tfoot(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n"])));
78
82
 
79
83
  exports.StyledTableFooter = StyledTableFooter;
80
84
 
81
- var StyledTableFooterContent = _styledComponents.default.div(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n border-top: 2px solid ", ";\n border-bottom: 1px solid ", ";\n box-sizing: border-box;\n min-height: 56px;\n\n display: flex;\n align-items: center;\n justify-content: right;\n"])), _styles.COLORS.neutral_200, _styles.COLORS.neutral_200);
85
+ var StyledTableFooterContent = _styledComponents.default.div(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n border-top: 2px solid ", ";\n border-bottom: 1px solid ", ";\n box-sizing: border-box;\n min-height: 56px;\n\n display: flex;\n align-items: center;\n justify-content: right;\n\n"])), _styles.COLORS.neutral_200, _styles.COLORS.neutral_200);
82
86
 
83
87
  exports.StyledTableFooterContent = StyledTableFooterContent;
84
88
 
85
- var StyledTableFooterCurrentInfo = _styledComponents.default.span(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n padding: 0 16px;\n ", "\n"])), (0, _typography.ComponentXSStyling)(_typography.ComponentTextStyle.Regular, _styles.COLORS.black));
89
+ var StyledTableFooterCurrentInfo = _styledComponents.default.span(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n padding: 0 16px;\n ", "\n"])), (0, _typography.ComponentXSStyling)(_typography.ComponentTextStyle.Regular, _styles.COLORS.black));
86
90
 
87
91
  exports.StyledTableFooterCurrentInfo = StyledTableFooterCurrentInfo;
88
92
 
89
- var StyledTableFooterControls = _styledComponents.default.div(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n display: flex;\n"])));
93
+ var StyledTableFooterControls = _styledComponents.default.div(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n display: flex;\n"])));
90
94
 
91
95
  exports.StyledTableFooterControls = StyledTableFooterControls;
92
96
 
93
- var StyledTableSpinner = _styledComponents.default.div(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n height: 100%;\n width: 100%;\n position: absolute;\n background-color: rgba(0, 0, 0, 0.5);\n top: 0;\n"])));
97
+ var StyledTableSpinner = _styledComponents.default.div(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n height: 100%;\n width: 100%;\n position: absolute;\n background-color: rgba(0, 0, 0, 0.5);\n top: 0;\n"])));
94
98
 
95
99
  exports.StyledTableSpinner = StyledTableSpinner;
96
100
 
97
- var StyledTableFooterCollapseButton = _styledComponents.default.button(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n position: relative;\n border-bottom: 1px solid ", ";\n border-top: 1px solid ", ";\n border-left: none;\n border-right: none;\n box-sizing: border-box;\n min-height: 48px;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n gap: 4px;\n background: ", ";\n\n cursor: pointer;\n\n ", "\n &:focus {\n outline: none;\n z-index: ", ";\n color: ", ";\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2E7FA1;\n }\n\n &:hover {\n z-index: ", ";\n background: ", ";\n color: ", ";\n }\n\n &:active {\n box-shadow: none;\n z-index: ", ";\n background: ", ";\n color: ", ";\n }\n\n &:disabled {\n display: none;\n }\n\n"])), _styles.COLORS.neutral_200, _styles.COLORS.neutral_200, _styles.COLORS.white, (0, _typography.ComponentMStyling)(_typography.ComponentTextStyle.Bold, _styles.COLORS.neutral_800), _zIndexes.Z_INDEXES.focus, _styles.COLORS.neutral_600, _zIndexes.Z_INDEXES.hover, _styles.COLORS.primary_20, _styles.COLORS.primary_700, _zIndexes.Z_INDEXES.active, _styles.COLORS.primary_100, _styles.COLORS.primary_800);
101
+ var StyledTableFooterCollapseButton = _styledComponents.default.button(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n position: relative;\n border-bottom: 1px solid ", ";\n border-top: 1px solid ", ";\n border-left: none;\n border-right: none;\n box-sizing: border-box;\n min-height: 48px;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n gap: 4px;\n background: ", ";\n\n cursor: pointer;\n\n ", "\n &:focus {\n outline: none;\n z-index: ", ";\n color: ", ";\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2E7FA1;\n }\n\n &:hover {\n z-index: ", ";\n background: ", ";\n color: ", ";\n }\n\n &:active {\n box-shadow: none;\n z-index: ", ";\n background: ", ";\n color: ", ";\n }\n\n &:disabled {\n display: none;\n }\n\n"])), _styles.COLORS.neutral_200, _styles.COLORS.neutral_200, _styles.COLORS.white, (0, _typography.ComponentMStyling)(_typography.ComponentTextStyle.Bold, _styles.COLORS.neutral_800), _zIndexes.Z_INDEXES.focus, _styles.COLORS.neutral_600, _zIndexes.Z_INDEXES.hover, _styles.COLORS.primary_20, _styles.COLORS.primary_700, _zIndexes.Z_INDEXES.active, _styles.COLORS.primary_100, _styles.COLORS.primary_800);
98
102
 
99
103
  exports.StyledTableFooterCollapseButton = StyledTableFooterCollapseButton;
100
104
  //# sourceMappingURL=TableStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/Table/TableStyles.ts"],"names":["TableWrapper","styled","div","StyledTable","table","StyledTableHeader","thead","StyledTableHeaderTitle","tr","StyledTableHeaderTitleContent","COLORS","neutral_200","ComponentTextStyle","Bold","black","StyledTableHeaderColumns","StyledTableHeaderColumnContent","StyledTableHeaderColumn","th","neutral_600","white","primary_20","primary_700","Z_INDEXES","hover","primary_100","primary_800","active","focus_25","focus","StyledTableBodyRow","primary_200","StyledTableBody","tbody","neutral_100","neutral_20","StyledTableCell","td","StyledTableCellContent","Regular","StyledTableCellIcon","neutral_700","StyledTableFooter","tfoot","StyledTableFooterContent","StyledTableFooterCurrentInfo","span","StyledTableFooterControls","StyledTableSpinner","StyledTableFooterCollapseButton","button","neutral_800"],"mappings":";;;;;;;AAGA;;AAKA;;AACA;;AAOA;;;;;;;;AAEA;AACA;AACA;AAEO,IAAMA,YAAY,GAAGC,0BAAOC,GAAV,8FAAlB;;;;AAKA,IAAMC,WAAW,GAA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GAAV,+cAI/B,mCAAkBU,+BAAmB2B,OAArC,EAA8C,IAA9C,CAJ+B,CAA5B;;;;AA8BA,IAAMC,mBAAmB,GAAGvC,0BAAOC,GAAV,oMACrBQ,eAAO+B,WADc,EAMnB/B,eAAO+B,WANY,CAAzB;;;;AAaA,IAAMC,iBAAiB,GAAGzC,0BAAO0C,KAAV,2EAAvB;;;;AAGA,IAAMC,wBAAwB,GAAG3C,0BAAOC,GAAV,oQACXQ,eAAOC,WADI,EAERD,eAAOC,WAFC,CAA9B;;;;AAWA,IAAMkC,4BAA4B,GAAG5C,0BAAO6C,IAAV,wGAErC,oCAAmBlC,+BAAmB2B,OAAtC,EAA+C7B,eAAOI,KAAtD,CAFqC,CAAlC;;;;AAKA,IAAMiC,yBAAyB,GAAG9C,0BAAOC,GAAV,6FAA/B;;;;AAIA,IAAM8C,kBAAkB,GAAG/C,0BAAOC,GAAV,uLAAxB;;;;AAQA,IAAM+C,+BAA+B,GAAGhD,0BAAOiD,MAAV,yxBAEfxC,eAAOC,WAFQ,EAGlBD,eAAOC,WAHW,EAa5BD,eAAOU,KAbqB,EAiBxC,mCAAkBR,+BAAmBC,IAArC,EAA2CH,eAAOyC,WAAlD,CAjBwC,EAoB7B5B,oBAAUM,KApBmB,EAqB/BnB,eAAOS,WArBwB,EA0B7BI,oBAAUC,KA1BmB,EA2B1Bd,eAAOW,UA3BmB,EA4B/BX,eAAOY,WA5BwB,EAiC7BC,oBAAUI,MAjCmB,EAkC1BjB,eAAOe,WAlCmB,EAmC/Bf,eAAOgB,WAnCwB,CAArC","sourcesContent":["/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\n\n/**\n * Import custom style properties.\n */\nimport {COLORS} from '../styles';\nimport {\n ComponentLStyling,\n ComponentMStyling,\n ComponentSStyling,\n ComponentTextStyle,\n ComponentXSStyling\n} from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\n\n/**\n * Table styles\n */\n\nexport const TableWrapper = styled.div`\n position: relative;\n`;\n\n\nexport const StyledTable = styled.table`\n background: transparent;\n width: 100%;\n`;\n\nexport const StyledTableHeader = styled.thead`\n`;\n\nexport const StyledTableHeaderTitle = styled.tr`\n`;\n\nexport const StyledTableHeaderTitleContent = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n box-sizing: border-box;\n min-height: 56px;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 2px solid ${COLORS.neutral_200};\n padding: 0 16px;\n\n ${ComponentLStyling(ComponentTextStyle.Bold, COLORS.black)}\n .title-menu {\n margin-right: -16px;\n }\n`;\n\nexport const StyledTableHeaderColumns = styled.tr`\n`;\n\nexport const StyledTableHeaderColumnContent = styled.div`\n box-sizing: border-box;\n min-height: 56px;\n padding: 0 16px;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-top: 1px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n`;\n\nexport const StyledTableHeaderColumn = styled.th`\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n position: relative;\n\n background-color: ${COLORS.white};\n\n //fixes header heights no idea why\n height: 1px;\n\n &.sortable {\n cursor: pointer;\n\n &:hover {\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:active {\n background-color: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n box-shadow: none !important;\n z-index: ${Z_INDEXES.active};\n }\n\n &:focus {\n outline: none;\n box-shadow: 0 4px 12px ${COLORS.focus_25}, 0 0 8px ${COLORS.focus};\n z-index: ${Z_INDEXES.focus};\n }\n }\n\n &.sortable ${StyledTableHeaderColumnContent} > svg {\n opacity: 0;\n }\n\n &.sortable.sorted ${StyledTableHeaderColumnContent} > svg {\n opacity: 1;\n }\n\n`;\n\nexport const StyledTableBodyRow = styled.tr`\n cursor: pointer;\n position: relative;\n outline: none;\n\n &:hover {\n background-color: ${COLORS.primary_200};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:focus {\n background-color: ${COLORS.primary_200};\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2E7FA1;\n z-index: ${Z_INDEXES.focus};\n outline: none;\n }\n\n &:active {\n box-shadow: none;\n z-index: ${Z_INDEXES.active};\n }\n\n`;\n\nexport const StyledTableBody = styled.tbody`\n ${StyledTableBodyRow}:nth-child(odd):not(:hover):not(:focus):not(:active) {\n background-color: ${COLORS.neutral_100};\n }\n\n ${StyledTableBodyRow}:nth-child(even):not(:hover):not(:focus):not(:active) {\n background-color: ${COLORS.neutral_20};\n }\n`;\n\n\nexport const StyledTableCell = styled.td``;\n\nexport const StyledTableCellContent = styled.div`\n min-height: 48px;\n\n padding: 0 16px;\n ${ComponentSStyling(ComponentTextStyle.Regular, null)}\n\n display: flex;\n align-items: center;\n gap: 8px;\n\n &.truncate-text,\n &.truncate-text span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &.left {\n justify-content: left;\n }\n\n &.right {\n justify-content: right;\n }\n\n &.center {\n justify-content: center;\n }\n`;\n\nexport const StyledTableCellIcon = styled.div`\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n\n svg {\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n }\n`;\n\n\nexport const StyledTableFooter = styled.tfoot`\n`;\n\nexport const StyledTableFooterContent = styled.div`\n border-top: 2px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n box-sizing: border-box;\n min-height: 56px;\n\n display: flex;\n align-items: center;\n justify-content: right;\n`;\n\nexport const StyledTableFooterCurrentInfo = styled.span`\n padding: 0 16px;\n ${ComponentXSStyling(ComponentTextStyle.Regular, COLORS.black)}\n`;\n\nexport const StyledTableFooterControls = styled.div`\n display: flex;\n`;\n\nexport const StyledTableSpinner = styled.div`\n height: 100%;\n width: 100%;\n position: absolute;\n background-color: rgba(0, 0, 0, 0.5);\n top: 0;\n`;\n\nexport const StyledTableFooterCollapseButton = styled.button`\n position: relative;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 1px solid ${COLORS.neutral_200};\n border-left: none;\n border-right: none;\n box-sizing: border-box;\n min-height: 48px;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n gap: 4px;\n background: ${COLORS.white};\n\n cursor: pointer;\n\n ${ComponentMStyling(ComponentTextStyle.Bold, COLORS.neutral_800)}\n &:focus {\n outline: none;\n z-index: ${Z_INDEXES.focus};\n color: ${COLORS.neutral_600};\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2E7FA1;\n }\n\n &:hover {\n z-index: ${Z_INDEXES.hover};\n background: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n }\n\n &:active {\n box-shadow: none;\n z-index: ${Z_INDEXES.active};\n background: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n }\n\n &:disabled {\n display: none;\n }\n\n`;\n"],"file":"TableStyles.js"}
1
+ {"version":3,"sources":["../../../src/Table/TableStyles.ts"],"names":["TableWrapper","styled","div","StyledTable","table","StyledTableHeader","thead","StyledTableHeaderTitle","tr","StyledTableHeaderTitleContent","COLORS","neutral_200","ComponentTextStyle","Bold","black","StyledTableHeaderColumns","StyledTableHeaderColumnContent","StyledTableHeaderColumn","th","neutral_600","white","primary_20","primary_700","Z_INDEXES","hover","primary_100","primary_800","active","focus_25","focus","neutral_20","StyledTableBodyRow","primary_200","StyledTableBody","tbody","neutral_100","StyledTableCell","td","StyledTableCellContent","Regular","StyledTableCellIcon","neutral_700","StyledTableCellText","span","StyledTableFooter","tfoot","StyledTableFooterContent","StyledTableFooterCurrentInfo","StyledTableFooterControls","StyledTableSpinner","StyledTableFooterCollapseButton","button","neutral_800"],"mappings":";;;;;;;AAGA;;AAKA;;AACA;;AAOA;;;;;;;;AAEA;AACA;AACA;AAEO,IAAMA,YAAY,GAAGC,0BAAOC,GAAV,8FAAlB;;;;AAKA,IAAMC,WAAW,GA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,sBAAsB,GAAGrC,0BAAOC,GAAV,yeAI/B,mCAAkBU,+BAAmB2B,OAArC,EAA8C7B,eAAOI,KAArD,CAJ+B,CAA5B;;;;AA+BA,IAAM0B,mBAAmB,GAAGvC,0BAAOC,GAAV,oMACrBQ,eAAO+B,WADc,EAMnB/B,eAAO+B,WANY,CAAzB;;;;AAYA,IAAMC,mBAAmB,GAAGzC,0BAAO0C,IAAV,+FAAzB;;;;AAKA,IAAMC,iBAAiB,GAAG3C,0BAAO4C,KAAV,2EAAvB;;;;AAGA,IAAMC,wBAAwB,GAAG7C,0BAAOC,GAAV,sQACXQ,eAAOC,WADI,EAERD,eAAOC,WAFC,CAA9B;;;;AAYA,IAAMoC,4BAA4B,GAAG9C,0BAAO0C,IAAV,wGAErC,oCAAmB/B,+BAAmB2B,OAAtC,EAA+C7B,eAAOI,KAAtD,CAFqC,CAAlC;;;;AAKA,IAAMkC,yBAAyB,GAAG/C,0BAAOC,GAAV,6FAA/B;;;;AAIA,IAAM+C,kBAAkB,GAAGhD,0BAAOC,GAAV,uLAAxB;;;;AAQA,IAAMgD,+BAA+B,GAAGjD,0BAAOkD,MAAV,yxBAEfzC,eAAOC,WAFQ,EAGlBD,eAAOC,WAHW,EAa5BD,eAAOU,KAbqB,EAiBxC,mCAAkBR,+BAAmBC,IAArC,EAA2CH,eAAO0C,WAAlD,CAjBwC,EAoB7B7B,oBAAUM,KApBmB,EAqB/BnB,eAAOS,WArBwB,EA0B7BI,oBAAUC,KA1BmB,EA2B1Bd,eAAOW,UA3BmB,EA4B/BX,eAAOY,WA5BwB,EAiC7BC,oBAAUI,MAjCmB,EAkC1BjB,eAAOe,WAlCmB,EAmC/Bf,eAAOgB,WAnCwB,CAArC","sourcesContent":["/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\n\n/**\n * Import custom style properties.\n */\nimport {COLORS} from '../styles';\nimport {\n ComponentLStyling,\n ComponentMStyling,\n ComponentSStyling,\n ComponentTextStyle,\n ComponentXSStyling\n} from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\n\n/**\n * Table styles\n */\n\nexport const TableWrapper = styled.div`\n position: relative;\n`;\n\n\nexport const StyledTable = styled.table`\n background: transparent;\n width: 100%;\n table-layout: fixed;\n`;\n\nexport const StyledTableHeader = styled.thead`\n`;\n\nexport const StyledTableHeaderTitle = styled.tr`\n`;\n\nexport const StyledTableHeaderTitleContent = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n box-sizing: border-box;\n min-height: 56px;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 2px solid ${COLORS.neutral_200};\n padding: 0 16px;\n\n ${ComponentLStyling(ComponentTextStyle.Bold, COLORS.black)}\n .title-menu {\n margin-right: -16px;\n }\n`;\n\nexport const StyledTableHeaderColumns = styled.tr`\n`;\n\nexport const StyledTableHeaderColumnContent = styled.div`\n box-sizing: border-box;\n min-height: 56px;\n padding: 0 16px;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-top: 1px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n`;\n\nexport const StyledTableHeaderColumn = styled.th`\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n position: relative;\n\n background-color: ${COLORS.white};\n\n //fixes header heights no idea why\n height: 1px;\n\n &.sortable {\n cursor: pointer;\n\n &:hover {\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:active {\n background-color: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n box-shadow: none !important;\n z-index: ${Z_INDEXES.active};\n }\n\n &:focus {\n outline: none;\n box-shadow: 0 4px 12px ${COLORS.focus_25}, 0 0 8px ${COLORS.focus};\n z-index: ${Z_INDEXES.focus};\n }\n }\n\n &.sortable ${StyledTableHeaderColumnContent} > svg {\n opacity: 0;\n }\n\n &.sortable.sorted ${StyledTableHeaderColumnContent} > svg {\n opacity: 1;\n }\n\n &.sorted {\n background-color: ${COLORS.neutral_20};\n }\n\n`;\n\nexport const StyledTableBodyRow = styled.tr`\n cursor: pointer;\n position: relative;\n outline: none;\n\n &:hover {\n background-color: ${COLORS.primary_200};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:focus {\n background-color: ${COLORS.primary_200};\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2E7FA1;\n z-index: ${Z_INDEXES.focus};\n outline: none;\n }\n\n &:active {\n box-shadow: none;\n z-index: ${Z_INDEXES.active};\n }\n\n`;\n\nexport const StyledTableBody = styled.tbody`\n ${StyledTableBodyRow}:nth-child(odd):not(:hover):not(:focus):not(:active) {\n background-color: ${COLORS.neutral_100};\n }\n\n ${StyledTableBodyRow}:nth-child(even):not(:hover):not(:focus):not(:active) {\n background-color: ${COLORS.neutral_20};\n }\n`;\n\n\nexport const StyledTableCell = styled.td``;\n\nexport const StyledTableCellContent = styled.div`\n min-height: 48px;\n\n padding: 0 16px;\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n\n display: flex;\n align-items: center;\n justify-content: left;\n gap: 8px;\n\n &.truncate-text,\n &.truncate-text span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &.left {\n justify-content: left;\n }\n\n &.right {\n justify-content: right;\n }\n\n &.center {\n justify-content: center;\n }\n`;\n\nexport const StyledTableCellIcon = styled.div`\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n\n svg {\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n }\n`;\n\nexport const StyledTableCellText = styled.span`\n padding: 12px 0;\n`;\n\n\nexport const StyledTableFooter = styled.tfoot`\n`;\n\nexport const StyledTableFooterContent = styled.div`\n border-top: 2px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n box-sizing: border-box;\n min-height: 56px;\n\n display: flex;\n align-items: center;\n justify-content: right;\n\n`;\n\nexport const StyledTableFooterCurrentInfo = styled.span`\n padding: 0 16px;\n ${ComponentXSStyling(ComponentTextStyle.Regular, COLORS.black)}\n`;\n\nexport const StyledTableFooterControls = styled.div`\n display: flex;\n`;\n\nexport const StyledTableSpinner = styled.div`\n height: 100%;\n width: 100%;\n position: absolute;\n background-color: rgba(0, 0, 0, 0.5);\n top: 0;\n`;\n\nexport const StyledTableFooterCollapseButton = styled.button`\n position: relative;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 1px solid ${COLORS.neutral_200};\n border-left: none;\n border-right: none;\n box-sizing: border-box;\n min-height: 48px;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n gap: 4px;\n background: ${COLORS.white};\n\n cursor: pointer;\n\n ${ComponentMStyling(ComponentTextStyle.Bold, COLORS.neutral_800)}\n &:focus {\n outline: none;\n z-index: ${Z_INDEXES.focus};\n color: ${COLORS.neutral_600};\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2E7FA1;\n }\n\n &:hover {\n z-index: ${Z_INDEXES.hover};\n background: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n }\n\n &:active {\n box-shadow: none;\n z-index: ${Z_INDEXES.active};\n background: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n }\n\n &:disabled {\n display: none;\n }\n\n`;\n"],"file":"TableStyles.js"}
@@ -157,7 +157,7 @@
157
157
  {
158
158
  const props = _objectSpread({
159
159
  variant: 'default',
160
- href: ''
160
+ href: '#'
161
161
  }, column.additionalProps);
162
162
 
163
163
  return /*#__PURE__*/React.createElement(_HyperLink.HyperLink, _extends({
@@ -221,7 +221,7 @@
221
221
  case 'number':
222
222
  case 'text':
223
223
  default:
224
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_TableStyles.StyledTableCellIcon, null, column.icon), /*#__PURE__*/React.createElement("span", null, row[column.key]));
224
+ return /*#__PURE__*/React.createElement(React.Fragment, null, column.icon && /*#__PURE__*/React.createElement(_TableStyles.StyledTableCellIcon, null, column.icon), /*#__PURE__*/React.createElement(_TableStyles.StyledTableCellText, null, row[column.key]));
225
225
  }
226
226
  };
227
227
 
@@ -250,7 +250,7 @@
250
250
  },
251
251
  title: column.shortenText && row[column.key]
252
252
  }, /*#__PURE__*/React.createElement(_TableStyles.StyledTableCellContent, {
253
- className: `${column.shortenText && `truncate-text`} ${column.justify || ''}`
253
+ className: `${column.shortenText ? `truncate-text` : ''} ${column.justify || ''}`
254
254
  }, renderCellBody(column, row)))))) : /*#__PURE__*/React.createElement(_TableStyles.StyledTableBodyRow, {
255
255
  "data-testid": "TestTableNoDataRow"
256
256
  }, /*#__PURE__*/React.createElement(_TableStyles.StyledTableCell, {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/Table/TableBody.tsx"],"names":["currentPageRows","onRowClick","selected","TableBody","props","renderCellBody","column","variant","href","color","e","row","iconColor","shape","useTransparentBackground","size","Size","Small","index","event","key","maxWidth","width"],"mappings":";;;;;;;;;;;;;;;;;;;;;MAGA,K;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,QAAMG,SAAmC,GAAIC,KAAD,IAAW;AAEnD,UAAMC,cAAc,GAAG,CAAA,MAAA,EAAA,GAAA,KAAmC;AACxD,cAAQC,MAAM,CAAd,IAAA;AACE,aAAA,MAAA;AAAa;AACX,kBAAMF,KAAK,GAAA,aAAA,CAAA;AAAKG,cAAAA,OAAO,EAAZ,SAAA;AAAyBC,cAAAA,IAAI,EAAE;AAA/B,aAAA,EAAsCF,MAAM,CAAvD,eAAW,CAAX;;AACA,mBAAA,aACE,KAAA,CAAA,aAAA,CAAA,oBAAA,EAAA,QAAA,CAAA;AAAW,cAAA,KAAK,EAAEA,MAAM,CAANA,OAAAA,IAAkB;AAACG,gBAAAA,KAAK,EAAEH,MAAM,C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Y,KAAM,IAAGZ,MAAM,CAACc,GAA7C,EAAA;AACiB,MAAA,KAAK,EAAE,MAAM,CAAN,OAAA,GAAiB;AACtBX,QAAAA,KAAK,EAAEH,MAAM,CAANA,OAAAA,CAAAA,GAAAA,EAAoBA,MAAM,CADX,GACfA,CADe;AAEtBe,QAAAA,QAAQ,EAAEf,MAAM,CAACgB;AAFK,OAAjB,GAGH;AAACD,QAAAA,QAAQ,EAAEf,MAAM,CAACgB;AAAlB,OAJrB;AAKiB,MAAA,KAAK,EAAEhB,MAAM,CAANA,WAAAA,IAAsBK,GAAG,CAACL,MAAM,CAAP,GAAA;AALjD,KAAA,EAAA,aAME,KAAA,CAAA,aAAA,CAAA,mCAAA,EAAA;AAAwB,MAAA,SAAS,EAAG,GAAEA,MAAM,CAANA,WAAAA,IAAuB,eAAe,IAAGA,MAAM,CAANA,OAAAA,IAAkB,EAAG;AAApG,KAAA,EACGD,cAAc,CAAA,MAAA,EA9B1B,GA8B0B,CADjB,CANF,CADDD,CApBH,CADF,CADD,GAAA,aAqCC,KAAA,CAAA,aAAA,CAAA,+BAAA,EAAA;AAAoB,qBAAY;AAAhC,KAAA,EAAA,aACE,KAAA,CAAA,aAAA,CAAA,4BAAA,EAAA;AAAiB,MAAA,OAAO,EAAEA,KAAK,CAALA,OAAAA,CAAAA,MAAAA,IAAwBA,KAAK,CAALA,WAAAA,GAAAA,CAAAA,GAAxBA,CAAAA;AAA1B,KAAA,EAAA,aACE,KAAA,CAAA,aAAA,CAAA,mCAAA,EAAA;AAAwB,MAAA,SAAS,EAAE;AAAnC,KAAA,EAzCV,8BAyCU,CADF,CADF,CAtCJ,CADF;AAjEJ,GAAA;;;AALEJ,IAAAA,e;AACAC,IAAAA,U;AACAC,IAAAA,Q;;oBAyHF,S","sourcesContent":["import {TableColumn, TableProps} from './TableTypes';\nimport {Button} from '../Button';\nimport {Size} from '../types';\nimport * as React from 'react';\nimport {Checkbox} from '../InputFields';\nimport {ButtonProps} from '../Button/Button';\nimport IconButton, {IconButtonProps} from '../Button/Iconbutton';\nimport {HyperlinkProps} from '../HyperLink/HyperLink';\nimport {HyperLink} from '../HyperLink';\nimport {\n StyledTableBody,\n StyledTableBodyRow,\n StyledTableCell,\n StyledTableCellContent,\n StyledTableCellIcon\n} from './TableStyles';\n\n\ninterface TableBodyProps extends TableProps {\n currentPageRows: any[];\n onRowClick?: (row: any) => void;\n selected?: any | any[];\n}\n\nconst TableBody: React.FC<TableBodyProps> = (props) => {\n\n const renderCellBody = (column: TableColumn, row: any) => {\n switch (column.type) {\n case 'link': {\n const props = ({variant: 'default', href: '', ...column.additionalProps}) as HyperlinkProps;\n return (\n <HyperLink style={column.colorFn && {color: column.colorFn(row, column.key)}}\n {...props}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {row[column.key]}\n </HyperLink>\n );\n }\n case 'icon': {\n const props = ({\n iconColor: column.colorFn && column.colorFn(row, column.key),\n variant: 'secondary',\n shape: 'circular',\n useTransparentBackground: true,\n ...column.additionalProps\n }) as IconButtonProps;\n return <IconButton {...props}\n action={(e) => {\n e?.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {column.icon}\n </IconButton>\n }\n case 'button': {\n const props = ({\n variant: 'tertiary',\n size: Size.Small,\n ...column.additionalProps\n }) as ButtonProps;\n return <Button style={column.colorFn && {color: column.colorFn(row, column.key)}}\n {...props}\n onClick={(e) => {\n e?.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {row[column.key]}\n </Button>\n }\n case 'boolean':\n return <Checkbox selected={!!row[column.key]} readonly={true}/>;\n case 'custom':\n return column.customContent && column.customContent(row, column.key);\n case 'number':\n case 'text':\n default:\n return (\n <>\n <StyledTableCellIcon>{column.icon}</StyledTableCellIcon>\n <span>{row[column.key]}</span>\n </>\n );\n }\n }\n\n return (\n <StyledTableBody>\n {props.currentPageRows.length > 0 ? (\n props.currentPageRows.map((row: any, index: number) => (\n <StyledTableBodyRow key={`row_${index}`}\n className={props.selectable ? 'selectable' : ''}\n onClick={() => props.onRowClick && props.onRowClick(row)}\n onMouseDown={(event) => event.preventDefault()}\n onKeyPress={(e) => {\n if (e.key === 'Enter') {\n props.onRowClick && props.onRowClick(row);\n }\n }}\n tabIndex={props.selectable ? 0 : undefined}\n data-testid=\"TestTableDataRow\">\n {\n props.multiSelect &&\n <StyledTableCell>\n <StyledTableCellContent>\n <Checkbox selected={props.selected?.indexOf(props.keyExpr ? row[props.keyExpr] : row) > -1}\n readonly={true}/>\n </StyledTableCellContent>\n </StyledTableCell>\n }\n {props.columns.map((column: TableColumn) => (\n <StyledTableCell key={`row_${index}_${column.key}`}\n style={column.colorFn ? {\n color: column.colorFn(row, column.key),\n maxWidth: column.width\n } : {maxWidth: column.width}}\n title={column.shortenText && row[column.key]}>\n <StyledTableCellContent className={`${column.shortenText && `truncate-text`} ${column.justify || ''}`}>\n {renderCellBody(column, row)}\n </StyledTableCellContent>\n </StyledTableCell>\n ))}\n </StyledTableBodyRow>\n ))\n ) : (\n <StyledTableBodyRow data-testid=\"TestTableNoDataRow\">\n <StyledTableCell colSpan={props.columns.length + (props.multiSelect ? 1 : 0)}>\n <StyledTableCellContent className={'center'}>\n There are no rows to display\n </StyledTableCellContent>\n </StyledTableCell>\n </StyledTableBodyRow>\n )}\n\n </StyledTableBody>\n );\n }\n;\n\nexport default TableBody;\n"],"file":"TableBody.js"}
1
+ {"version":3,"sources":["../../../src/Table/TableBody.tsx"],"names":["currentPageRows","onRowClick","selected","TableBody","props","renderCellBody","column","variant","href","color","e","row","iconColor","shape","useTransparentBackground","size","Size","Small","index","event","key","maxWidth","width"],"mappings":";;;;;;;;;;;;;;;;;;;;;MAGA,K;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,QAAMG,SAAmC,GAAIC,KA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AAAiB,MAAA,OAAO,EAAEA,KAAK,CAALA,OAAAA,CAAAA,MAAAA,IAAwBA,KAAK,CAALA,WAAAA,GAAAA,CAAAA,GAAxBA,CAAAA;AAA1B,KAAA,EAAA,aACE,KAAA,CAAA,aAAA,CAAA,mCAAA,EAAA;AAAwB,MAAA,SAAS,EAAE;AAAnC,KAAA,EA1CV,8BA0CU,CADF,CADF,CAvCJ,CADF;AApEJ,GAAA;;;AALEJ,IAAAA,e;AACAC,IAAAA,U;AACAC,IAAAA,Q;;oBA6HF,S","sourcesContent":["import {TableColumn, TableProps} from './TableTypes';\nimport {Button} from '../Button';\nimport {Size} from '../types';\nimport * as React from 'react';\nimport {Checkbox} from '../InputFields';\nimport {ButtonProps} from '../Button/Button';\nimport IconButton, {IconButtonProps} from '../Button/Iconbutton';\nimport {HyperlinkProps} from '../HyperLink/HyperLink';\nimport {HyperLink} from '../HyperLink';\nimport {\n StyledTableBody,\n StyledTableBodyRow,\n StyledTableCell,\n StyledTableCellContent,\n StyledTableCellIcon, StyledTableCellText\n} from './TableStyles';\n\n\ninterface TableBodyProps extends TableProps {\n currentPageRows: any[];\n onRowClick?: (row: any) => void;\n selected?: any | any[];\n}\n\nconst TableBody: React.FC<TableBodyProps> = (props) => {\n\n const renderCellBody = (column: TableColumn, row: any) => {\n switch (column.type) {\n case 'link': {\n const props = ({variant: 'default', href: '#', ...column.additionalProps}) as HyperlinkProps;\n return (\n <HyperLink style={column.colorFn && {color: column.colorFn(row, column.key)}}\n {...props}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {row[column.key]}\n </HyperLink>\n );\n }\n case 'icon': {\n const props = ({\n iconColor: column.colorFn && column.colorFn(row, column.key),\n variant: 'secondary',\n shape: 'circular',\n useTransparentBackground: true,\n ...column.additionalProps\n }) as IconButtonProps;\n return <IconButton {...props}\n action={(e) => {\n e?.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {column.icon}\n </IconButton>\n }\n case 'button': {\n const props = ({\n variant: 'tertiary',\n size: Size.Small,\n ...column.additionalProps\n }) as ButtonProps;\n return <Button style={column.colorFn && {color: column.colorFn(row, column.key)}}\n {...props}\n onClick={(e) => {\n e?.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {row[column.key]}\n </Button>\n }\n case 'boolean':\n return <Checkbox selected={!!row[column.key]} readonly={true}/>;\n case 'custom':\n return column.customContent && column.customContent(row, column.key);\n case 'number':\n case 'text':\n default:\n return (\n <>\n {\n column.icon &&\n <StyledTableCellIcon>{column.icon}</StyledTableCellIcon>\n }\n <StyledTableCellText>{row[column.key]}</StyledTableCellText>\n </>\n );\n }\n }\n\n return (\n <StyledTableBody>\n {props.currentPageRows.length > 0 ? (\n props.currentPageRows.map((row: any, index: number) => (\n <StyledTableBodyRow key={`row_${index}`}\n className={props.selectable ? 'selectable' : ''}\n onClick={() => props.onRowClick && props.onRowClick(row)}\n onMouseDown={(event) => event.preventDefault()}\n onKeyPress={(e) => {\n if (e.key === 'Enter') {\n props.onRowClick && props.onRowClick(row);\n }\n }}\n tabIndex={props.selectable ? 0 : undefined}\n data-testid=\"TestTableDataRow\">\n {\n props.multiSelect &&\n <StyledTableCell>\n <StyledTableCellContent>\n <Checkbox selected={props.selected?.indexOf(props.keyExpr ? row[props.keyExpr] : row) > -1}\n readonly={true}/>\n </StyledTableCellContent>\n </StyledTableCell>\n }\n {props.columns.map((column: TableColumn) => (\n <StyledTableCell key={`row_${index}_${column.key}`}\n style={column.colorFn ? {\n color: column.colorFn(row, column.key),\n maxWidth: column.width\n } : {maxWidth: column.width}}\n title={column.shortenText && row[column.key]}>\n <StyledTableCellContent\n className={`${column.shortenText ? `truncate-text` : ''} ${column.justify || ''}`}>\n {renderCellBody(column, row)}\n </StyledTableCellContent>\n </StyledTableCell>\n ))}\n </StyledTableBodyRow>\n ))\n ) : (\n <StyledTableBodyRow data-testid=\"TestTableNoDataRow\">\n <StyledTableCell colSpan={props.columns.length + (props.multiSelect ? 1 : 0)}>\n <StyledTableCellContent className={'center'}>\n There are no rows to display\n </StyledTableCellContent>\n </StyledTableCell>\n </StyledTableBodyRow>\n )}\n\n </StyledTableBody>\n );\n }\n;\n\nexport default TableBody;\n"],"file":"TableBody.js"}
@@ -48,6 +48,7 @@
48
48
  }, props.isCollapsed && /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, /*#__PURE__*/_react2.default.createElement("span", null, "Show more(", props.rows.length - props.rowsPerPage, ")"), /*#__PURE__*/_react2.default.createElement(_icons.SystemIcons.ArrowDropDown, null)), !props.isCollapsed && /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, /*#__PURE__*/_react2.default.createElement("span", null, "Show less"), /*#__PURE__*/_react2.default.createElement(_icons.SystemIcons.ArrowDropUp, null))), !props.accordion && /*#__PURE__*/_react2.default.createElement(_TableStyles.StyledTableFooterContent, null, /*#__PURE__*/_react2.default.createElement(_Dropdown.DropdownFilter, {
49
49
  id: "rows-per-page",
50
50
  list: rowsPerPageValues,
51
+ margin: '0',
51
52
  disableSorting: true,
52
53
  onSelect: value => props.onRowsPerPageChange(+value),
53
54
  initalValue: dropDownText,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/Table/TableFooter.tsx"],"names":["onRowsPerPageChange","rowsPerPage","from","to","total","nextPage","prevPage","setIsCollapsed","isCollapsed","TableFooter","props","rowsPerPageValues","label","dropDownText","e","value","COLORS","neutral_600"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,QAAMS,WAAsD,GAAIC,KAAD,IAAW;AACxE,UAAMC,iBAAuC,GAAG,CAAC;AAACC,MAAAA,KAAK,EAAE;AAAR,KAAD,EAAgB;AAACA,MAAAA,KAAK,EAAE;AAAR,KAAhB,EAA+B;AAACA,MAAAA,KAAK,EAAE;AAAR,KAA/B,EAA8C;AAACA,MAAAA,KAAK,EAAE;AAAR,KAA9C,CAAhD;AAEA,UAAMC,YAAY,GAAI,kBAAiBH,KAAK,CAACT,WAA7C,EA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AAA,aAAA,CAAA,yBAAA,EAAA;AAAc,MAAA,IAAI,EAAlB,IAAA;AAAwB,MAAA,KAAK,EAAEY,eAAOC;AAAtC,KAAA,CAFF,CALF,CAbF,CAxBJ,CADF,CADF,CADF;AALF,GAAA;;;AAXEjB,IAAAA,mB;AACAC,IAAAA,W;AACAC,IAAAA,I;AACAC,IAAAA,E;AACAC,IAAAA,K;AACAC,IAAAA,Q;AACAC,IAAAA,Q;AACAC,IAAAA,c;AACAC,IAAAA,W;;oBAmEF,W","sourcesContent":["import React from 'react';\nimport {TableProps} from './TableTypes';\nimport {DropdownFilter} from '../Dropdown';\nimport {IconButton} from '../Button';\nimport {ChevronLeft, ChevronRight} from '../icons/systemicons/SystemIcons';\nimport {COLORS} from '../styles';\nimport {DropdownFilterItem} from '../Dropdown/DropdownFilter';\nimport {\n StyledTableFooter, StyledTableFooterCollapseButton,\n StyledTableFooterContent,\n StyledTableFooterControls,\n StyledTableFooterCurrentInfo\n} from './TableStyles';\nimport {SystemIcons} from '../icons';\n\n\ninterface TableFooterProps extends TableProps {\n onRowsPerPageChange: (value: number) => void;\n rowsPerPage: number;\n from?: number;\n to?: number;\n total?: number;\n nextPage: () => void;\n prevPage: () => void;\n setIsCollapsed: (isCollapsed: boolean) => void;\n isCollapsed: boolean;\n}\n\nconst TableFooter: React.FunctionComponent<TableFooterProps> = (props) => {\n const rowsPerPageValues: DropdownFilterItem[] = [{label: '10'}, {label: '20'}, {label: '50'}, {label: '100'}];\n\n const dropDownText = `Rows per page: ${props.rowsPerPage}`;\n\n return (\n <StyledTableFooter>\n <tr>\n <td colSpan={props.columns.length + (props.multiSelect ? 1 : 0)} data-testid=\"TestTableFooterRow\">\n {\n props.accordion &&\n <StyledTableFooterCollapseButton onClick={() => props.setIsCollapsed(!props.isCollapsed)}\n onMouseDown={e => e.preventDefault()}\n disabled={props.isCollapsed && props.rows.length <= props.rowsPerPage}>\n {\n props.isCollapsed &&\n <>\n <span>Show more({props.rows.length - props.rowsPerPage})</span>\n <SystemIcons.ArrowDropDown/>\n </>\n }\n {\n !props.isCollapsed &&\n <>\n <span>Show less</span>\n <SystemIcons.ArrowDropUp/>\n </>\n }\n </StyledTableFooterCollapseButton>\n }\n {\n !props.accordion &&\n <StyledTableFooterContent>\n <DropdownFilter\n id=\"rows-per-page\"\n list={rowsPerPageValues}\n disableSorting={true}\n onSelect={(value) => props.onRowsPerPageChange(+value)}\n initalValue={dropDownText}\n keepInitialValue={true}\n isButton={true}\n />\n <StyledTableFooterCurrentInfo>\n {props.total === 0 ? 0 : props.from}-{props.to} of {props.total}\n </StyledTableFooterCurrentInfo>\n <StyledTableFooterControls>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => props.prevPage()}\n disabled={props.from === 1}>\n <ChevronLeft size=\"24\" color={COLORS.neutral_600}/>\n </IconButton>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => props.nextPage()}\n disabled={props.to === props.total}>\n <ChevronRight size=\"24\" color={COLORS.neutral_600}/>\n </IconButton>\n </StyledTableFooterControls>\n </StyledTableFooterContent>\n }\n </td>\n </tr>\n </StyledTableFooter>\n );\n};\n\n\nexport default TableFooter;\n"],"file":"TableFooter.js"}
1
+ {"version":3,"sources":["../../../src/Table/TableFooter.tsx"],"names":["onRowsPerPageChange","rowsPerPage","from","to","total","nextPage","prevPage","setIsCollapsed","isCollapsed","TableFooter","props","rowsPerPageValues","label","dropDownText","e","value","COLORS","neutral_600"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,QAAMS,WAAsD,GAAIC,KAAD,IAAW;AACxE,UAAMC,iBAAuC,GAAG,CAAC;AAACC,MAAAA,KAAK,EAAE;AAAR,KAAD,EAAgB;AAACA,MAAAA,KAAK,EAAE;AAAR,KAAhB,EAA+B;AAACA,MAAAA,KAAK,EAAE;AAAR,KAA/B,EAA8C;AAACA,MAAAA,KAAK,EAAE;AAAR,KAA9C,CAAhD;AAEA,UAAMC,YAAY,GAAI,kBAAiBH,KAAK,CA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aA,KAAK,CAACN;AADzC,KAAA,EAAA,aAEE,gBAAA,aAAA,CAAA,yBAAA,EAAA;AAAc,MAAA,IAAI,EAAlB,IAAA;AAAwB,MAAA,KAAK,EAAEY,eAAOC;AAAtC,KAAA,CAFF,CALF,CAdF,CAxBJ,CADF,CADF,CADF;AALF,GAAA;;;AAXEjB,IAAAA,mB;AACAC,IAAAA,W;AACAC,IAAAA,I;AACAC,IAAAA,E;AACAC,IAAAA,K;AACAC,IAAAA,Q;AACAC,IAAAA,Q;AACAC,IAAAA,c;AACAC,IAAAA,W;;oBAoEF,W","sourcesContent":["import React from 'react';\nimport {TableProps} from './TableTypes';\nimport {DropdownFilter} from '../Dropdown';\nimport {IconButton} from '../Button';\nimport {ChevronLeft, ChevronRight} from '../icons/systemicons/SystemIcons';\nimport {COLORS} from '../styles';\nimport {DropdownFilterItem} from '../Dropdown/DropdownFilter';\nimport {\n StyledTableFooter, StyledTableFooterCollapseButton,\n StyledTableFooterContent,\n StyledTableFooterControls,\n StyledTableFooterCurrentInfo\n} from './TableStyles';\nimport {SystemIcons} from '../icons';\n\n\ninterface TableFooterProps extends TableProps {\n onRowsPerPageChange: (value: number) => void;\n rowsPerPage: number;\n from?: number;\n to?: number;\n total?: number;\n nextPage: () => void;\n prevPage: () => void;\n setIsCollapsed: (isCollapsed: boolean) => void;\n isCollapsed: boolean;\n}\n\nconst TableFooter: React.FunctionComponent<TableFooterProps> = (props) => {\n const rowsPerPageValues: DropdownFilterItem[] = [{label: '10'}, {label: '20'}, {label: '50'}, {label: '100'}];\n\n const dropDownText = `Rows per page: ${props.rowsPerPage}`;\n\n return (\n <StyledTableFooter>\n <tr>\n <td colSpan={props.columns.length + (props.multiSelect ? 1 : 0)} data-testid=\"TestTableFooterRow\">\n {\n props.accordion &&\n <StyledTableFooterCollapseButton onClick={() => props.setIsCollapsed(!props.isCollapsed)}\n onMouseDown={e => e.preventDefault()}\n disabled={props.isCollapsed && props.rows.length <= props.rowsPerPage}>\n {\n props.isCollapsed &&\n <>\n <span>Show more({props.rows.length - props.rowsPerPage})</span>\n <SystemIcons.ArrowDropDown/>\n </>\n }\n {\n !props.isCollapsed &&\n <>\n <span>Show less</span>\n <SystemIcons.ArrowDropUp/>\n </>\n }\n </StyledTableFooterCollapseButton>\n }\n {\n !props.accordion &&\n <StyledTableFooterContent>\n <DropdownFilter\n id=\"rows-per-page\"\n list={rowsPerPageValues}\n margin={'0'}\n disableSorting={true}\n onSelect={(value) => props.onRowsPerPageChange(+value)}\n initalValue={dropDownText}\n keepInitialValue={true}\n isButton={true}\n />\n <StyledTableFooterCurrentInfo>\n {props.total === 0 ? 0 : props.from}-{props.to} of {props.total}\n </StyledTableFooterCurrentInfo>\n <StyledTableFooterControls>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => props.prevPage()}\n disabled={props.from === 1}>\n <ChevronLeft size=\"24\" color={COLORS.neutral_600}/>\n </IconButton>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => props.nextPage()}\n disabled={props.to === props.total}>\n <ChevronRight size=\"24\" color={COLORS.neutral_600}/>\n </IconButton>\n </StyledTableFooterControls>\n </StyledTableFooterContent>\n }\n </td>\n </tr>\n </StyledTableFooter>\n );\n};\n\n\nexport default TableFooter;\n"],"file":"TableFooter.js"}
@@ -16,7 +16,7 @@
16
16
  Object.defineProperty(exports, "__esModule", {
17
17
  value: true
18
18
  });
19
- exports.StyledTableFooterCollapseButton = exports.StyledTableSpinner = exports.StyledTableFooterControls = exports.StyledTableFooterCurrentInfo = exports.StyledTableFooterContent = exports.StyledTableFooter = exports.StyledTableCellIcon = exports.StyledTableCellContent = exports.StyledTableCell = exports.StyledTableBody = exports.StyledTableBodyRow = exports.StyledTableHeaderColumn = exports.StyledTableHeaderColumnContent = exports.StyledTableHeaderColumns = exports.StyledTableHeaderTitleContent = exports.StyledTableHeaderTitle = exports.StyledTableHeader = exports.StyledTable = exports.TableWrapper = undefined;
19
+ exports.StyledTableFooterCollapseButton = exports.StyledTableSpinner = exports.StyledTableFooterControls = exports.StyledTableFooterCurrentInfo = exports.StyledTableFooterContent = exports.StyledTableFooter = exports.StyledTableCellText = exports.StyledTableCellIcon = exports.StyledTableCellContent = exports.StyledTableCell = exports.StyledTableBody = exports.StyledTableBodyRow = exports.StyledTableHeaderColumn = exports.StyledTableHeaderColumnContent = exports.StyledTableHeaderColumns = exports.StyledTableHeaderTitleContent = exports.StyledTableHeaderTitle = exports.StyledTableHeader = exports.StyledTable = exports.TableWrapper = undefined;
20
20
 
21
21
  var _styledComponents2 = _interopRequireDefault(_styledComponents);
22
22
 
@@ -43,6 +43,7 @@
43
43
  const StyledTable = exports.StyledTable = _styledComponents2.default.table`
44
44
  background: transparent;
45
45
  width: 100%;
46
+ table-layout: fixed;
46
47
  `;
47
48
  const StyledTableHeader = exports.StyledTableHeader = _styledComponents2.default.thead`
48
49
  `;
@@ -117,6 +118,10 @@
117
118
  opacity: 1;
118
119
  }
119
120
 
121
+ &.sorted {
122
+ background-color: ${_styles.COLORS.neutral_20};
123
+ }
124
+
120
125
  `;
121
126
  const StyledTableBodyRow = exports.StyledTableBodyRow = _styledComponents2.default.tr`
122
127
  cursor: pointer;
@@ -155,10 +160,11 @@
155
160
  min-height: 48px;
156
161
 
157
162
  padding: 0 16px;
158
- ${(0, _typography.ComponentSStyling)(_typography.ComponentTextStyle.Regular, null)}
163
+ ${(0, _typography.ComponentSStyling)(_typography.ComponentTextStyle.Regular, _styles.COLORS.black)}
159
164
 
160
165
  display: flex;
161
166
  align-items: center;
167
+ justify-content: left;
162
168
  gap: 8px;
163
169
 
164
170
  &.truncate-text,
@@ -190,6 +196,9 @@
190
196
  width: 24px;
191
197
  height: 24px;
192
198
  }
199
+ `;
200
+ const StyledTableCellText = exports.StyledTableCellText = _styledComponents2.default.span`
201
+ padding: 12px 0;
193
202
  `;
194
203
  const StyledTableFooter = exports.StyledTableFooter = _styledComponents2.default.tfoot`
195
204
  `;
@@ -202,6 +211,7 @@
202
211
  display: flex;
203
212
  align-items: center;
204
213
  justify-content: right;
214
+
205
215
  `;
206
216
  const StyledTableFooterCurrentInfo = exports.StyledTableFooterCurrentInfo = _styledComponents2.default.span`
207
217
  padding: 0 16px;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/Table/TableStyles.ts"],"names":["TableWrapper","styled","div","StyledTable","table","StyledTableHeader","thead","StyledTableHeaderTitle","tr","StyledTableHeaderTitleContent","COLORS","neutral_200","ComponentLStyling","ComponentTextStyle","StyledTableHeaderColumns","StyledTableHeaderColumnContent","StyledTableHeaderColumn","th","ComponentSStyling","white","primary_20","primary_700","Z_INDEXES","hover","primary_100","primary_800","active","focus_25","focus","StyledTableBodyRow","primary_200","StyledTableBody","tbody","neutral_100","neutral_20","StyledTableCell","td","StyledTableCellContent","StyledTableCellIcon","neutral_700","StyledTableFooter","tfoot","StyledTableFooterContent","StyledTableFooterCurrentInfo","span","ComponentXSStyling","StyledTableFooterControls","StyledTableSpinner","StyledTableFooterCollapseButton","button","ComponentMStyling","neutral_600"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;AAEO,QAAMA,YAAY,WAAZA,YAAY,GAAGC,2BAAOC,GAAI;AACvC;AADO,CAAA;AAKA,QAAMC,WAAW,WAAXA,WAAW,GAAGF,2BAAOG,KAAM;AACxC;AACA;AAFO,CAAA;AAKA,QAAMC,iBAAiB,WAAjBA,iBAAiB,GAAGJ,2BAAOK,KAAM;AAAvC,CAAA;AAGA,QAAMC,sBAAsB,WAAtBA,sBAAsB,GAAGN,2BAAOO,EAAG;AAAzC,CAAA;AAGA,QAAMC,6BAA6B,WAA7BA,6BAA6B,GAAGR,2BAAOC,GAAI;AACxD;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6BQ,eAAOC,WAAY;AAChD,0BAA0BD,eAAOC,WAAY;AAC7C;AACA;AACA,IAAIC,mCAAkBC,+BAAD,IAAjBD,EAA2CF,eAA1B,KAAjBE,CAA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+BAA+B,WAA/BA,+BAA+B,GAAG/C,2BAAOgD,MAAO;AAC7D;AACA,6BAA6BvC,eAAOC,WAAY;AAChD,0BAA0BD,eAAOC,WAAY;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgBD,eAAOS,KAAM;AAC7B;AACA;AACA;AACA,IAAI+B,mCAAkBrC,+BAAD,IAAjBqC,EAA2CxC,eAA1B,WAAjBwC,CAA+D;AACnE;AACA;AACA,eAAe5B,oBAAUM,KAAM;AAC/B,aAAalB,eAAOyC,WAAY;AAChC;AACA;AACA;AACA;AACA,eAAe7B,oBAAUC,KAAM;AAC/B,kBAAkBb,eAAOU,UAAW;AACpC,aAAaV,eAAOW,WAAY;AAChC;AACA;AACA;AACA;AACA,eAAeC,oBAAUI,MAAO;AAChC,kBAAkBhB,eAAOc,WAAY;AACrC,aAAad,eAAOe,WAAY;AAChC;AACA;AACA;AACA;AACA;AACA;AAzCO,CAAA","sourcesContent":["/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\n\n/**\n * Import custom style properties.\n */\nimport {COLORS} from '../styles';\nimport {\n ComponentLStyling,\n ComponentMStyling,\n ComponentSStyling,\n ComponentTextStyle,\n ComponentXSStyling\n} from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\n\n/**\n * Table styles\n */\n\nexport const TableWrapper = styled.div`\n position: relative;\n`;\n\n\nexport const StyledTable = styled.table`\n background: transparent;\n width: 100%;\n`;\n\nexport const StyledTableHeader = styled.thead`\n`;\n\nexport const StyledTableHeaderTitle = styled.tr`\n`;\n\nexport const StyledTableHeaderTitleContent = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n box-sizing: border-box;\n min-height: 56px;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 2px solid ${COLORS.neutral_200};\n padding: 0 16px;\n\n ${ComponentLStyling(ComponentTextStyle.Bold, COLORS.black)}\n .title-menu {\n margin-right: -16px;\n }\n`;\n\nexport const StyledTableHeaderColumns = styled.tr`\n`;\n\nexport const StyledTableHeaderColumnContent = styled.div`\n box-sizing: border-box;\n min-height: 56px;\n padding: 0 16px;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-top: 1px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n`;\n\nexport const StyledTableHeaderColumn = styled.th`\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n position: relative;\n\n background-color: ${COLORS.white};\n\n //fixes header heights no idea why\n height: 1px;\n\n &.sortable {\n cursor: pointer;\n\n &:hover {\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:active {\n background-color: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n box-shadow: none !important;\n z-index: ${Z_INDEXES.active};\n }\n\n &:focus {\n outline: none;\n box-shadow: 0 4px 12px ${COLORS.focus_25}, 0 0 8px ${COLORS.focus};\n z-index: ${Z_INDEXES.focus};\n }\n }\n\n &.sortable ${StyledTableHeaderColumnContent} > svg {\n opacity: 0;\n }\n\n &.sortable.sorted ${StyledTableHeaderColumnContent} > svg {\n opacity: 1;\n }\n\n`;\n\nexport const StyledTableBodyRow = styled.tr`\n cursor: pointer;\n position: relative;\n outline: none;\n\n &:hover {\n background-color: ${COLORS.primary_200};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:focus {\n background-color: ${COLORS.primary_200};\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2E7FA1;\n z-index: ${Z_INDEXES.focus};\n outline: none;\n }\n\n &:active {\n box-shadow: none;\n z-index: ${Z_INDEXES.active};\n }\n\n`;\n\nexport const StyledTableBody = styled.tbody`\n ${StyledTableBodyRow}:nth-child(odd):not(:hover):not(:focus):not(:active) {\n background-color: ${COLORS.neutral_100};\n }\n\n ${StyledTableBodyRow}:nth-child(even):not(:hover):not(:focus):not(:active) {\n background-color: ${COLORS.neutral_20};\n }\n`;\n\n\nexport const StyledTableCell = styled.td``;\n\nexport const StyledTableCellContent = styled.div`\n min-height: 48px;\n\n padding: 0 16px;\n ${ComponentSStyling(ComponentTextStyle.Regular, null)}\n\n display: flex;\n align-items: center;\n gap: 8px;\n\n &.truncate-text,\n &.truncate-text span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &.left {\n justify-content: left;\n }\n\n &.right {\n justify-content: right;\n }\n\n &.center {\n justify-content: center;\n }\n`;\n\nexport const StyledTableCellIcon = styled.div`\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n\n svg {\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n }\n`;\n\n\nexport const StyledTableFooter = styled.tfoot`\n`;\n\nexport const StyledTableFooterContent = styled.div`\n border-top: 2px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n box-sizing: border-box;\n min-height: 56px;\n\n display: flex;\n align-items: center;\n justify-content: right;\n`;\n\nexport const StyledTableFooterCurrentInfo = styled.span`\n padding: 0 16px;\n ${ComponentXSStyling(ComponentTextStyle.Regular, COLORS.black)}\n`;\n\nexport const StyledTableFooterControls = styled.div`\n display: flex;\n`;\n\nexport const StyledTableSpinner = styled.div`\n height: 100%;\n width: 100%;\n position: absolute;\n background-color: rgba(0, 0, 0, 0.5);\n top: 0;\n`;\n\nexport const StyledTableFooterCollapseButton = styled.button`\n position: relative;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 1px solid ${COLORS.neutral_200};\n border-left: none;\n border-right: none;\n box-sizing: border-box;\n min-height: 48px;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n gap: 4px;\n background: ${COLORS.white};\n\n cursor: pointer;\n\n ${ComponentMStyling(ComponentTextStyle.Bold, COLORS.neutral_800)}\n &:focus {\n outline: none;\n z-index: ${Z_INDEXES.focus};\n color: ${COLORS.neutral_600};\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2E7FA1;\n }\n\n &:hover {\n z-index: ${Z_INDEXES.hover};\n background: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n }\n\n &:active {\n box-shadow: none;\n z-index: ${Z_INDEXES.active};\n background: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n }\n\n &:disabled {\n display: none;\n }\n\n`;\n"],"file":"TableStyles.js"}
1
+ {"version":3,"sources":["../../../src/Table/TableStyles.ts"],"names":["TableWrapper","styled","div","StyledTable","table","StyledTableHeader","thead","StyledTableHeaderTitle","tr","StyledTableHeaderTitleContent","COLORS","neutral_200","ComponentLStyling","ComponentTextStyle","StyledTableHeaderColumns","StyledTableHeaderColumnContent","StyledTableHeaderColumn","th","ComponentSStyling","white","primary_20","primary_700","Z_INDEXES","hover","primary_100","primary_800","active","focus_25","focus","neutral_20","StyledTableBodyRow","primary_200","StyledTableBody","tbody","neutral_100","StyledTableCell","td","StyledTableCellContent","StyledTableCellIcon","neutral_700","StyledTableCellText","span","StyledTableFooter","tfoot","StyledTableFooterContent","StyledTableFooterCurrentInfo","ComponentXSStyling","StyledTableFooterControls","StyledTableSpinner","StyledTableFooterCollapseButton","button","ComponentMStyling","neutral_600"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;AAEO,QAAMA,YAAY,WAAZA,YAAY,GAAGC,2BAAOC,GAAI;AACvC;AADO,CAAA;AAKA,QAAMC,WAAW,WAAXA,WAAW,GAAGF,2BAAOG,KAAM;AACxC;AACA;AACA;AAHO,CAAA;AAMA,QAAMC,iBAAiB,WAAjBA,iBAAiB,GAAGJ,2BAAOK,KAAM;AAAvC,CAAA;AAGA,QAAMC,sBAAsB,WAAtBA,sBAAsB,GAAGN,2BAAOO,EAAG;AAAzC,CAAA;AAGA,QAAMC,6BAA6B,WAA7BA,6BAA6B,GAAGR,2BAAOC,GAAI;AACxD;AACA;AACA;AACA;AACA;AACA;AACA,6B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AAIK,oCAAmBjC,+BAAD,OAAlBiC,EAA+CpC,eAA7B,KAAlBoC,CAA6D;AAF1D,CAAA;AAKA,QAAMC,yBAAyB,WAAzBA,yBAAyB,GAAG9C,2BAAOC,GAAI;AACpD;AADO,CAAA;AAIA,QAAM8C,kBAAkB,WAAlBA,kBAAkB,GAAG/C,2BAAOC,GAAI;AAC7C;AACA;AACA;AACA;AACA;AALO,CAAA;AAQA,QAAM+C,+BAA+B,WAA/BA,+BAA+B,GAAGhD,2BAAOiD,MAAO;AAC7D;AACA,6BAA6BxC,eAAOC,WAAY;AAChD,0BAA0BD,eAAOC,WAAY;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgBD,eAAOS,KAAM;AAC7B;AACA;AACA;AACA,IAAIgC,mCAAkBtC,+BAAD,IAAjBsC,EAA2CzC,eAA1B,WAAjByC,CAA+D;AACnE;AACA;AACA,eAAe7B,oBAAUM,KAAM;AAC/B,aAAalB,eAAO0C,WAAY;AAChC;AACA;AACA;AACA;AACA,eAAe9B,oBAAUC,KAAM;AAC/B,kBAAkBb,eAAOU,UAAW;AACpC,aAAaV,eAAOW,WAAY;AAChC;AACA;AACA;AACA;AACA,eAAeC,oBAAUI,MAAO;AAChC,kBAAkBhB,eAAOc,WAAY;AACrC,aAAad,eAAOe,WAAY;AAChC;AACA;AACA;AACA;AACA;AACA;AAzCO,CAAA","sourcesContent":["/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\n\n/**\n * Import custom style properties.\n */\nimport {COLORS} from '../styles';\nimport {\n ComponentLStyling,\n ComponentMStyling,\n ComponentSStyling,\n ComponentTextStyle,\n ComponentXSStyling\n} from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\n\n/**\n * Table styles\n */\n\nexport const TableWrapper = styled.div`\n position: relative;\n`;\n\n\nexport const StyledTable = styled.table`\n background: transparent;\n width: 100%;\n table-layout: fixed;\n`;\n\nexport const StyledTableHeader = styled.thead`\n`;\n\nexport const StyledTableHeaderTitle = styled.tr`\n`;\n\nexport const StyledTableHeaderTitleContent = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n box-sizing: border-box;\n min-height: 56px;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 2px solid ${COLORS.neutral_200};\n padding: 0 16px;\n\n ${ComponentLStyling(ComponentTextStyle.Bold, COLORS.black)}\n .title-menu {\n margin-right: -16px;\n }\n`;\n\nexport const StyledTableHeaderColumns = styled.tr`\n`;\n\nexport const StyledTableHeaderColumnContent = styled.div`\n box-sizing: border-box;\n min-height: 56px;\n padding: 0 16px;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-top: 1px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n`;\n\nexport const StyledTableHeaderColumn = styled.th`\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n position: relative;\n\n background-color: ${COLORS.white};\n\n //fixes header heights no idea why\n height: 1px;\n\n &.sortable {\n cursor: pointer;\n\n &:hover {\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:active {\n background-color: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n box-shadow: none !important;\n z-index: ${Z_INDEXES.active};\n }\n\n &:focus {\n outline: none;\n box-shadow: 0 4px 12px ${COLORS.focus_25}, 0 0 8px ${COLORS.focus};\n z-index: ${Z_INDEXES.focus};\n }\n }\n\n &.sortable ${StyledTableHeaderColumnContent} > svg {\n opacity: 0;\n }\n\n &.sortable.sorted ${StyledTableHeaderColumnContent} > svg {\n opacity: 1;\n }\n\n &.sorted {\n background-color: ${COLORS.neutral_20};\n }\n\n`;\n\nexport const StyledTableBodyRow = styled.tr`\n cursor: pointer;\n position: relative;\n outline: none;\n\n &:hover {\n background-color: ${COLORS.primary_200};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:focus {\n background-color: ${COLORS.primary_200};\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2E7FA1;\n z-index: ${Z_INDEXES.focus};\n outline: none;\n }\n\n &:active {\n box-shadow: none;\n z-index: ${Z_INDEXES.active};\n }\n\n`;\n\nexport const StyledTableBody = styled.tbody`\n ${StyledTableBodyRow}:nth-child(odd):not(:hover):not(:focus):not(:active) {\n background-color: ${COLORS.neutral_100};\n }\n\n ${StyledTableBodyRow}:nth-child(even):not(:hover):not(:focus):not(:active) {\n background-color: ${COLORS.neutral_20};\n }\n`;\n\n\nexport const StyledTableCell = styled.td``;\n\nexport const StyledTableCellContent = styled.div`\n min-height: 48px;\n\n padding: 0 16px;\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n\n display: flex;\n align-items: center;\n justify-content: left;\n gap: 8px;\n\n &.truncate-text,\n &.truncate-text span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &.left {\n justify-content: left;\n }\n\n &.right {\n justify-content: right;\n }\n\n &.center {\n justify-content: center;\n }\n`;\n\nexport const StyledTableCellIcon = styled.div`\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n\n svg {\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n }\n`;\n\nexport const StyledTableCellText = styled.span`\n padding: 12px 0;\n`;\n\n\nexport const StyledTableFooter = styled.tfoot`\n`;\n\nexport const StyledTableFooterContent = styled.div`\n border-top: 2px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n box-sizing: border-box;\n min-height: 56px;\n\n display: flex;\n align-items: center;\n justify-content: right;\n\n`;\n\nexport const StyledTableFooterCurrentInfo = styled.span`\n padding: 0 16px;\n ${ComponentXSStyling(ComponentTextStyle.Regular, COLORS.black)}\n`;\n\nexport const StyledTableFooterControls = styled.div`\n display: flex;\n`;\n\nexport const StyledTableSpinner = styled.div`\n height: 100%;\n width: 100%;\n position: absolute;\n background-color: rgba(0, 0, 0, 0.5);\n top: 0;\n`;\n\nexport const StyledTableFooterCollapseButton = styled.button`\n position: relative;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 1px solid ${COLORS.neutral_200};\n border-left: none;\n border-right: none;\n box-sizing: border-box;\n min-height: 48px;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n gap: 4px;\n background: ${COLORS.white};\n\n cursor: pointer;\n\n ${ComponentMStyling(ComponentTextStyle.Bold, COLORS.neutral_800)}\n &:focus {\n outline: none;\n z-index: ${Z_INDEXES.focus};\n color: ${COLORS.neutral_600};\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2E7FA1;\n }\n\n &:hover {\n z-index: ${Z_INDEXES.hover};\n background: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n }\n\n &:active {\n box-shadow: none;\n z-index: ${Z_INDEXES.active};\n background: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n }\n\n &:disabled {\n display: none;\n }\n\n`;\n"],"file":"TableStyles.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laerdal/life-react-components",
3
- "version": "1.3.2-dev.15.full",
3
+ "version": "1.3.2-dev.17",
4
4
  "private": false,
5
5
  "author": "Thomas Kalve <thomas.kalve@laerdal.com>",
6
6
  "contributors": [