@laerdal/life-react-components 1.3.2-dev.8 → 1.4.1-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/Button/DualFunctionButton.js +4 -0
  2. package/dist/Button/DualFunctionButton.js.map +1 -1
  3. package/dist/Button/Iconbutton.d.ts +2 -2
  4. package/dist/Button/Iconbutton.js +0 -1
  5. package/dist/Button/Iconbutton.js.map +1 -1
  6. package/dist/Dropdown/DropdownButton.d.ts +1 -1
  7. package/dist/Dropdown/DropdownButton.js +3 -1
  8. package/dist/Dropdown/DropdownButton.js.map +1 -1
  9. package/dist/Dropdown/DropdownButtonTypes.d.ts +1 -0
  10. package/dist/Dropdown/DropdownContent.js +8 -8
  11. package/dist/Dropdown/DropdownContent.js.map +1 -1
  12. package/dist/Dropdown/DropdownFilter.d.ts +1 -1
  13. package/dist/Dropdown/DropdownFilter.js.map +1 -1
  14. package/dist/HyperLink/HyperLink.d.ts +1 -1
  15. package/dist/HyperLink/HyperLink.js +2 -2
  16. package/dist/HyperLink/HyperLink.js.map +1 -1
  17. package/dist/InputFields/Checkbox.d.ts +3 -2
  18. package/dist/InputFields/Checkbox.js +13 -11
  19. package/dist/InputFields/Checkbox.js.map +1 -1
  20. package/dist/Modals/ModalDialog.d.ts +2 -1
  21. package/dist/Modals/ModalDialog.js +7 -4
  22. package/dist/Modals/ModalDialog.js.map +1 -1
  23. package/dist/Modals/ModalNote.d.ts +1 -1
  24. package/dist/Modals/ModalNote.js +1 -1
  25. package/dist/Modals/ModalNote.js.map +1 -1
  26. package/dist/Table/Table.js +158 -231
  27. package/dist/Table/Table.js.map +1 -1
  28. package/dist/Table/TableBody.d.ts +9 -0
  29. package/dist/Table/TableBody.js +164 -0
  30. package/dist/Table/TableBody.js.map +1 -0
  31. package/dist/Table/TableFooter.d.ts +15 -0
  32. package/dist/Table/TableFooter.js +103 -0
  33. package/dist/Table/TableFooter.js.map +1 -0
  34. package/dist/Table/TableHeaders.d.ts +9 -0
  35. package/dist/Table/TableHeaders.js +83 -0
  36. package/dist/Table/TableHeaders.js.map +1 -0
  37. package/dist/Table/TableStyles.d.ts +19 -7
  38. package/dist/Table/TableStyles.js +22 -9
  39. package/dist/Table/TableStyles.js.map +1 -1
  40. package/dist/Table/TableTypes.d.ts +26 -16
  41. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
2
 
3
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
3
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20;
4
4
 
5
5
  /**
6
6
  * Import third-party libraries.
@@ -11,17 +11,30 @@ import styled from 'styled-components';
11
11
  */
12
12
 
13
13
  import { COLORS } from '../styles';
14
- import { ComponentLStyling, ComponentSStyling, ComponentTextStyle, ComponentXSStyling } from '../styles/typography';
14
+ import { ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentTextStyle, ComponentXSStyling } from '../styles/typography';
15
+ import { Z_INDEXES } from '../styles/z-indexes';
15
16
  /**
16
17
  * Table styles
17
18
  */
18
19
 
19
20
  export var TableWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n"])));
20
- export var TableLoadingIndicator = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n height: 100%;\n width: 100%;\n position: absolute;\n background-color: rgba(0, 0, 0, 0.5);\n top: 0;\n"])));
21
- export var TableContainer = styled.table(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n background: transparent;\n width: 100%;\n border-top: 2px solid ", ";\n border-bottom: 2px solid ", ";\n"])), COLORS.neutral_200, COLORS.neutral_200);
22
- export var TableHeaderRowCol = styled.th(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background-color: ", ";\n border-bottom: 1px solid ", ";\n\n ", "\n padding: 16px 19px 16px 16px;\n\n div {\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n svg {\n cursor: pointer;\n }\n }\n"])), COLORS.neutral_20, COLORS.neutral_200, ComponentLStyling(ComponentTextStyle.Bold, COLORS.neutral_600));
23
- export var TableColumnHeaderCol = styled.th(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background-color: ", ";\n border-top: 1px solid ", ";\n\n ", "\n padding: 18px 16px;\n text-align: left;\n\n &.justify-center {\n text-align: center;\n }\n\n &.justify-left {\n text-align: left;\n }\n\n &.justify-right {\n text-align: right;\n }\n\n &.no-border {\n border: none;\n }\n\n &.sortable {\n cursor: pointer;\n\n > svg {\n float: right;\n }\n\n &:hover {\n background: ", ";\n }\n\n &:focus {\n background: ", ";\n }\n }\n"])), COLORS.white, COLORS.neutral_300, ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600), COLORS.primary_20, COLORS.primary_100);
24
- export var TableDataRow = styled.tr(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n background-color: ", ";\n\n &:nth-child(2n) {\n background-color: ", ";\n }\n\n &:hover {\n cursor: pointer;\n background-color: ", ";\n }\n\n &.no-rows:hover {\n cursor: default;\n background-color: ", ";\n }\n"])), COLORS.neutral_100, COLORS.neutral_20, COLORS.primary_200, COLORS.neutral_100);
25
- export var TableDataCol = styled.td(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n background: transparent;\n\n ", "\n padding: 15px 16px;\n border: none;\n\n &.truncate-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &.justify-center {\n text-align: center;\n }\n\n &.justify-left {\n text-align: left;\n }\n\n &.justify-right {\n text-align: right;\n }\n\n button {\n color: ", ";\n text-decoration: none;\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n\n &:focus {\n text-decoration: underline;\n outline: none;\n box-shadow: 0px 4px 12px ", ", 0px 0px 8px ", " !important;\n color: ", ";\n }\n }\n\n &.center {\n text-align: center;\n }\n"])), ComponentSStyling(ComponentTextStyle.Regular, COLORS.black), COLORS.primary_600, COLORS.primary_700, COLORS.focus_25, COLORS.focus, COLORS.primary_700);
26
- export var TableFooterCol = styled.td(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n border-top: 1px solid ", ";\n padding: 3.5px 20px 3.5px 16px;\n\n > div {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n\n > div > div:first-of-type {\n ", "\n display: block;\n padding-top: 11px;\n padding-left: 2px;\n padding-right: 30px;\n }\n\n span {\n ", "\n\n &.current-page-info {\n margin-right: 34px;\n margin-left: 39px;\n }\n }\n\n .controls {\n display: flex;\n justify-content: space-between;\n }\n }\n"])), COLORS.neutral_200, ComponentXSStyling(ComponentTextStyle.Regular, COLORS.black), ComponentSStyling(ComponentTextStyle.Regular, COLORS.black));
21
+ export var StyledTable = styled.table(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: transparent;\n width: 100%;\n table-layout: fixed;\n"])));
22
+ export var StyledTableHeader = styled.thead(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n"])));
23
+ export var StyledTableHeaderTitle = styled.tr(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n"])));
24
+ export var StyledTableHeaderTitleContent = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\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 ", ";\n border-top: 2px solid ", ";\n padding: 0 16px;\n\n ", "\n .title-menu {\n margin-right: -16px;\n }\n"])), COLORS.neutral_200, COLORS.neutral_200, ComponentLStyling(ComponentTextStyle.Bold, COLORS.black));
25
+ export var StyledTableHeaderColumns = styled.tr(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n"])));
26
+ export var StyledTableHeaderColumnContent = styled.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\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 ", ";\n border-bottom: 1px solid ", ";\n"])), COLORS.neutral_200, COLORS.neutral_200);
27
+ export var StyledTableHeaderColumn = styled.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"])), ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600), COLORS.white, COLORS.primary_20, COLORS.primary_700, Z_INDEXES.hover, COLORS.primary_100, COLORS.primary_800, Z_INDEXES.active, COLORS.focus_25, COLORS.focus, Z_INDEXES.focus, StyledTableHeaderColumnContent, StyledTableHeaderColumnContent, COLORS.neutral_20);
28
+ export var StyledTableBodyRow = styled.tr(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n cursor: pointer;\n position: relative;\n outline: none;\n\n &:hover {\n background-color: ", ";\n z-index: ", ";\n }\n\n &:focus {\n background-color: ", ";\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2E7FA1;\n z-index: ", ";\n outline: none;\n }\n\n &:active {\n box-shadow: none;\n z-index: ", ";\n }\n\n"])), COLORS.primary_200, Z_INDEXES.hover, COLORS.primary_200, Z_INDEXES.focus, Z_INDEXES.active);
29
+ export var StyledTableBody = styled.tbody(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n ", ":nth-child(odd):not(:hover):not(:focus):not(:active) {\n background-color: ", ";\n }\n\n ", ":nth-child(even):not(:hover):not(:focus):not(:active) {\n background-color: ", ";\n }\n"])), StyledTableBodyRow, COLORS.neutral_100, StyledTableBodyRow, COLORS.neutral_20);
30
+ export var StyledTableCell = styled.td(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral([""])));
31
+ export var StyledTableCellContent = styled.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\n a:first-letter,\n span:first-letter {\n text-transform: uppercase;\n }\n"])), ComponentSStyling(ComponentTextStyle.Regular, COLORS.black));
32
+ export var StyledTableCellIcon = styled.div(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n color: ", ";\n width: 24px;\n height: 24px;\n\n svg {\n color: ", ";\n width: 24px;\n height: 24px;\n }\n"])), COLORS.neutral_700, COLORS.neutral_700);
33
+ export var StyledTableCellText = styled.span(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n padding: 12px 0;\n"])));
34
+ export var StyledTableFooter = styled.tfoot(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n"])));
35
+ export var StyledTableFooterContent = styled.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"])), COLORS.neutral_200, COLORS.neutral_200);
36
+ export var StyledTableFooterCurrentInfo = styled.span(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n padding: 0 16px;\n ", "\n"])), ComponentXSStyling(ComponentTextStyle.Regular, COLORS.black));
37
+ export var StyledTableFooterControls = styled.div(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n display: flex;\n"])));
38
+ export var StyledTableSpinner = styled.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"])));
39
+ export var StyledTableFooterCollapseButton = styled.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"])), COLORS.neutral_200, COLORS.neutral_200, COLORS.white, ComponentMStyling(ComponentTextStyle.Bold, COLORS.neutral_800), Z_INDEXES.focus, COLORS.neutral_600, Z_INDEXES.hover, COLORS.primary_20, COLORS.primary_700, Z_INDEXES.active, COLORS.primary_100, COLORS.primary_800);
27
40
  //# sourceMappingURL=TableStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Table/TableStyles.ts"],"names":["styled","COLORS","ComponentLStyling","ComponentSStyling","ComponentTextStyle","ComponentXSStyling","TableWrapper","div","TableLoadingIndicator","TableContainer","table","neutral_200","TableHeaderRowCol","th","neutral_20","Bold","neutral_600","TableColumnHeaderCol","white","neutral_300","primary_20","primary_100","TableDataRow","tr","neutral_100","primary_200","TableDataCol","td","Regular","black","primary_600","primary_700","focus_25","focus","TableFooterCol"],"mappings":";;;;AAAA;AACA;AACA;AACA,OAAOA,MAAP,MAAmB,mBAAnB;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,WAAvB;AACA,SAASC,iBAAT,EAA+CC,iBAA/C,EAAkEC,kBAAlE,EAAsFC,kBAAtF,QAAgH,sBAAhH;AAEA;AACA;AACA;;AAEA,OAAO,IAAMC,YAAY,GAAGN,MAAM,CAACO,GAAV,8FAAlB;AAIP,OAAO,IAAMC,qBAAqB,GAAGR,MAAM,CAACO,GAAV,qLAA3B;AAQP,OAAO,IAAME,cAAc,GAAGT,MAAM,CAACU,KAAV,uLAGDT,MAAM,CAACU,WAHN,EAIEV,MAAM,CAACU,WAJT,CAApB;AAOP,OAAO,IAAMC,iBAAiB,GAAGZ,MAAM,CAACa,EAAV,iUACRZ,MAAM,CAACa,UADC,EAEDb,MAAM,CAACU,WAFN,EAI1BT,iBAAiB,CAACE,kBAAkB,CAACW,IAApB,EAA0Bd,MAAM,CAACe,WAAjC,CAJS,CAAvB;AAkBP,OAAO,IAAMC,oBAAoB,GAAGjB,MAAM,CAACa,EAAV,2jBACXZ,MAAM,CAACiB,KADI,EAEPjB,MAAM,CAACkB,WAFA,EAI7BhB,iBAAiB,CAACC,kBAAkB,CAACW,IAApB,EAA0Bd,MAAM,CAACe,WAAjC,CAJY,EAgCbf,MAAM,CAACmB,UAhCM,EAoCbnB,MAAM,CAACoB,WApCM,CAA1B;AAyCP,OAAO,IAAMC,YAAY,GAAGtB,MAAM,CAACuB,EAAV,oTACHtB,MAAM,CAACuB,WADJ,EAIDvB,MAAM,CAACa,UAJN,EASDb,MAAM,CAACwB,WATN,EAcDxB,MAAM,CAACuB,WAdN,CAAlB;AAkBP,OAAO,IAAME,YAAY,GAAG1B,MAAM,CAAC2B,EAAV,qwBAGrBxB,iBAAiB,CAACC,kBAAkB,CAACwB,OAApB,EAA6B3B,MAAM,CAAC4B,KAApC,CAHI,EA0BZ5B,MAAM,CAAC6B,WA1BK,EA8BV7B,MAAM,CAAC8B,WA9BG,EAqCQ9B,MAAM,CAAC+B,QArCf,EAqCwC/B,MAAM,CAACgC,KArC/C,EAsCVhC,MAAM,CAAC8B,WAtCG,CAAlB;AA+CP,OAAO,IAAMG,cAAc,GAAGlC,MAAM,CAAC2B,EAAV,kmBACD1B,MAAM,CAACU,WADN,EAUnBN,kBAAkB,CAACD,kBAAkB,CAACwB,OAApB,EAA6B3B,MAAM,CAAC4B,KAApC,CAVC,EAkBnB1B,iBAAiB,CAACC,kBAAkB,CAACwB,OAApB,EAA6B3B,MAAM,CAAC4B,KAApC,CAlBE,CAApB","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 { ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentTextStyle, ComponentXSStyling } from '../styles/typography';\n\n/**\n * Table styles\n */\n\nexport const TableWrapper = styled.div`\n position: relative;\n`;\n\nexport const TableLoadingIndicator = 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 TableContainer = styled.table`\n background: transparent;\n width: 100%;\n border-top: 2px solid ${COLORS.neutral_200};\n border-bottom: 2px solid ${COLORS.neutral_200};\n`;\n\nexport const TableHeaderRowCol = styled.th`\n background-color: ${COLORS.neutral_20};\n border-bottom: 1px solid ${COLORS.neutral_200};\n\n ${ComponentLStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n padding: 16px 19px 16px 16px;\n\n div {\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n svg {\n cursor: pointer;\n }\n }\n`;\n\nexport const TableColumnHeaderCol = styled.th`\n background-color: ${COLORS.white};\n border-top: 1px solid ${COLORS.neutral_300};\n\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n padding: 18px 16px;\n text-align: left;\n\n &.justify-center {\n text-align: center;\n }\n\n &.justify-left {\n text-align: left;\n }\n\n &.justify-right {\n text-align: right;\n }\n\n &.no-border {\n border: none;\n }\n\n &.sortable {\n cursor: pointer;\n\n > svg {\n float: right;\n }\n\n &:hover {\n background: ${COLORS.primary_20};\n }\n\n &:focus {\n background: ${COLORS.primary_100};\n }\n }\n`;\n\nexport const TableDataRow = styled.tr`\n background-color: ${COLORS.neutral_100};\n\n &:nth-child(2n) {\n background-color: ${COLORS.neutral_20};\n }\n\n &:hover {\n cursor: pointer;\n background-color: ${COLORS.primary_200};\n }\n\n &.no-rows:hover {\n cursor: default;\n background-color: ${COLORS.neutral_100};\n }\n`;\n\nexport const TableDataCol = styled.td`\n background: transparent;\n\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n padding: 15px 16px;\n border: none;\n\n &.truncate-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &.justify-center {\n text-align: center;\n }\n\n &.justify-left {\n text-align: left;\n }\n\n &.justify-right {\n text-align: right;\n }\n\n button {\n color: ${COLORS.primary_600};\n text-decoration: none;\n\n &:hover {\n color: ${COLORS.primary_700};\n text-decoration: underline;\n }\n\n &:focus {\n text-decoration: underline;\n outline: none;\n box-shadow: 0px 4px 12px ${COLORS.focus_25}, 0px 0px 8px ${COLORS.focus} !important;\n color: ${COLORS.primary_700};\n }\n }\n\n &.center {\n text-align: center;\n }\n`;\n\nexport const TableFooterCol = styled.td`\n border-top: 1px solid ${COLORS.neutral_200};\n padding: 3.5px 20px 3.5px 16px;\n\n > div {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n\n > div > div:first-of-type {\n ${ComponentXSStyling(ComponentTextStyle.Regular, COLORS.black)}\n display: block;\n padding-top: 11px;\n padding-left: 2px;\n padding-right: 30px;\n }\n\n span {\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n\n &.current-page-info {\n margin-right: 34px;\n margin-left: 39px;\n }\n }\n\n .controls {\n display: flex;\n justify-content: space-between;\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,IAAMC,YAAY,GAAGR,MAAM,CAACS,GAAV,8FAAlB;AAKP,OAAO,IAAMC,WAAW,GAAGV,MAAM,CAACW,KAAV,6IAAjB;AAMP,OAAO,IAAMC,iBAAiB,GAAGZ,MAAM,CAACa,KAAV,yEAAvB;AAGP,OAAO,IAAMC,sBAAsB,GAAGd,MAAM,CAACe,EAAV,yEAA5B;AAGP,OAAO,IAAMC,6BAA6B,GAAGhB,MAAM,CAACS,GAAV,sWAObR,MAAM,CAACgB,WAPM,EAQhBhB,MAAM,CAACgB,WARS,EAWtCf,iBAAiB,CAACG,kBAAkB,CAACa,IAApB,EAA0BjB,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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 a:first-letter,\n span:first-letter {\n text-transform: uppercase;\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"}
@@ -1,38 +1,49 @@
1
1
  /**
2
2
  * Types for the table.
3
3
  */
4
+ import { DropdownButtonProps } from '../Dropdown/DropdownButtonTypes';
5
+ import { ButtonProps } from '../Button/Button';
6
+ import { IconButtonProps } from '../Button/Iconbutton';
7
+ import { HyperlinkProps } from '../HyperLink/HyperLink';
4
8
  export interface TableProps {
5
- rowClick?: (row: any) => void;
6
- linkClick?: (row: any, key: string) => void;
7
- iconClick?: (row: any, key: string) => void;
8
9
  title?: string;
9
10
  columns: TableColumn[];
10
11
  rows: any[];
11
- remotePagination?: boolean;
12
+ accordion?: boolean;
13
+ collapsed?: boolean;
14
+ collapsedRows?: number;
15
+ remoteOperations?: boolean;
12
16
  pagination?: TablePagination;
13
- previousPageClick?: () => void;
14
- nextPageClick?: () => void;
15
- rowsPerPageChange?: (count: number) => void;
16
- triggerSortingChange?: (key: string, direction: TableSortingDirection) => void;
17
+ onPreviousPageClick?: () => void;
18
+ onNextPageClick?: () => void;
19
+ onRowsPerPageChange?: (count: number) => void;
20
+ onTriggerSortingChange?: (key: string, direction: TableSortingDirection) => void;
17
21
  showLoadingIndicator?: boolean;
22
+ menu?: Pick<DropdownButtonProps, 'items' | 'onClick' | 'disabled' | 'width' | 'itemsType' | 'multiSelect'>;
23
+ selectable?: boolean;
24
+ onSelectionChange?: (value: any | any[]) => void;
25
+ multiSelect?: boolean;
26
+ keyExpr?: string;
27
+ selectedRows?: any[];
18
28
  }
19
29
  export interface TableColumn {
30
+ key: string;
20
31
  name: string;
21
32
  filterValue?: string;
22
- key: string;
33
+ icon?: React.ReactNode;
34
+ width?: string | number;
23
35
  colorFn?: (row: any, key: string) => string;
24
- isIcon?: boolean;
25
- icon?: ColumnIcons;
26
- isLink?: boolean;
27
- width?: number;
36
+ justify?: TableJustification;
28
37
  shortenText?: boolean;
38
+ action?: (row: any, event: any) => void;
39
+ type?: TableColumnTypes;
40
+ additionalProps?: Pick<ButtonProps, 'variant' | 'size' | 'width' | 'icon'> | Pick<IconButtonProps, 'variant' | 'shape' | 'disabled'> | Pick<HyperlinkProps, 'variant'>;
29
41
  customContent?: (row: any, key: string) => any;
30
42
  sortable?: boolean;
31
- justify?: TableJustification;
32
43
  sortingDirection?: TableSortingDirection;
33
44
  }
45
+ export declare type TableColumnTypes = 'text' | 'boolean' | 'number' | 'custom' | 'button' | 'icon' | 'link';
34
46
  export declare type TableJustification = 'right' | 'left' | 'center';
35
- declare type ColumnIcons = 'Add' | 'ArrowDropDown' | 'ArrowDropUp' | 'ArrowLineDown' | 'ArrowLineLeft' | 'ArrowLineRight' | 'ArrowLineUp' | 'ArrowStopLeft' | 'ArrowStopRight' | 'Attachment' | 'Attention' | 'BackwardsFiveSec' | 'Book' | 'BookmarkOff' | 'BookmarkOn' | 'Bullet' | 'Calendar' | 'CheckboxOff' | 'CheckboxOn' | 'CheckboxSemi' | 'CheckComplete' | 'ChevronDown' | 'ChevronLeft' | 'ChevronRight' | 'ChevronUp' | 'Clear' | 'Close' | 'ClosedCaptionOff' | 'ClosedCaptionOn' | 'CloudAttention' | 'CloudCheck' | 'CloudDownload' | 'CloudLocked' | 'CloudNoConnection' | 'CloudSyncing' | 'CloudUpload' | 'Cloud' | 'Dashboard' | 'Delete' | 'Download' | 'DragHandle' | 'DragIndicator' | 'Edit' | 'Educator' | 'Equals' | 'EventLog' | 'ExtendTextArea' | 'Filter' | 'Forward' | 'ForwardSlash' | 'ForwardFiveSec' | 'FullscreenExit' | 'Fullscreen' | 'GearSettings' | 'GridView' | 'Group' | 'GuidedTour' | 'Help' | 'Hierarchy' | 'History' | 'Home' | 'Information' | 'Institute' | 'Language' | 'ListView' | 'LoadingMedium' | 'LoadingSmall' | 'LockedOff' | 'LockedOn' | 'Login' | 'Logout' | 'Loop' | 'Mail' | 'Manikin' | 'MapPoint' | 'Menu' | 'Minus' | 'MoreHorizontal' | 'MoreVertical' | 'NotificationNew' | 'Notification' | 'OpenFolder' | 'OpenNewWindow' | 'Pause' | 'PlayOutline' | 'Play' | 'Plus' | 'PointDown' | 'PointLeft' | 'PointRight' | 'PointUp' | 'RadioButtonOff' | 'RadioButtonOn' | 'Record' | 'Refresh' | 'Replay' | 'Rewind' | 'Save' | 'Search' | 'Share' | 'ShoppingCart' | 'StarFilled' | 'StarOutlined' | 'Stop' | 'Support' | 'Team' | 'ThumbsDown' | 'ThumbsUp' | 'TimeLimited' | 'Time' | 'Tip' | 'Upload' | 'Usb' | 'User' | 'Video' | 'VisibleOff' | 'VisibleOn' | 'VolumeDown' | 'VolumeOff' | 'VolumeUp';
36
47
  export declare type TableSortingDirection = 'asc' | 'desc';
37
48
  export interface TablePagination {
38
49
  from: number;
@@ -41,4 +52,3 @@ export interface TablePagination {
41
52
  currentPage: number;
42
53
  rowsPerPage: number;
43
54
  }
44
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laerdal/life-react-components",
3
- "version": "1.3.2-dev.8",
3
+ "version": "1.4.1-dev.2",
4
4
  "private": false,
5
5
  "author": "Thomas Kalve <thomas.kalve@laerdal.com>",
6
6
  "contributors": [