@zonos/amino 5.4.30 → 5.4.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";var e=require("../../_tslib-bd4862e8.js"),l=require("react/jsx-runtime"),o=require("react"),i=require("clsx"),t=require("../checkbox/Checkbox.js"),d=require("../skeleton/Skeleton.js"),a=require("../table/TableRowCollapse.js"),r=require("../text/Text.js"),n=require("../tooltip/Tooltip.js"),m=require("../../style-inject.es-d4ddeae4.js");function s(e){return e&&e.__esModule?e:{default:e}}require("framer-motion"),require("../help-text/HelpText.js"),require("../../styles/constants/theme.js"),require("../../icons/CheckmarkIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../global.module-569e4fd5.js"),require("../../utils/getTestId.js"),require("../button/Button.js"),require("../button/RippleGroup.js"),require("uuid"),require("../button/_Ripple.js"),require("../../utils/getAminoColor.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("../collapse/Collapse.js"),require("@mui/material/Collapse"),require("../table/TableCell.js"),require("../table/TableRow.js"),require("../../icons/ChevronUpIcon.js"),require("@mui/material/styles"),require("@mui/material/Tooltip"),require("../flex/Flex.js");var b=s(o),_=s(i),u="Amino_SimpleTable-module__tableContainer--UsGFZ",c="Amino_SimpleTable-module__tableStyled--Q3YSy",p="Amino_SimpleTable-module__noHeaders---Nf59",h="Amino_SimpleTable-module__bordered--rYjAD",S="Amino_SimpleTable-module__noPadding--b5Y-c",y="Amino_SimpleTable-module__withHover--eL3XX",x="Amino_SimpleTable-module__clickable--XnaaE",T="Amino_SimpleTable-module__allowTextWrap--yVvjm",A="Amino_SimpleTable-module__loading--bvjof",v="Amino_SimpleTable-module__skeletonCellWrapper--I8vJ7",j="Amino_SimpleTable-module__shouldTruncate--x-zmL",f="Amino_SimpleTable-module__collapsible--ozkOZ",g="Amino_SimpleTable-module__collapsed--VazPW",k="Amino_SimpleTable-module__styledCheckbox---753a";m.styleInject(".Amino_SimpleTable-module__tableContainer--UsGFZ{width:100%}.Amino_SimpleTable-module__tableStyled--Q3YSy{border-collapse:initial;border-spacing:0;font-size:var(--amino-font-size-base);width:100%}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__noHeaders---Nf59 thead{display:none;max-height:0}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__bordered--rYjAD th{border:none}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__bordered--rYjAD tr:first-child td{border-top:var(--amino-border-subtle)}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__bordered--rYjAD tr:first-child td:first-child{border-top-left-radius:12px}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__bordered--rYjAD tr:first-child td:last-child{border-top-right-radius:12px}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__bordered--rYjAD tr:last-child td:first-child{border-bottom-left-radius:12px}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__bordered--rYjAD tr:last-child td:last-child{border-bottom-right-radius:12px}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__bordered--rYjAD td:first-child{border-left:var(--amino-border-subtle)}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__bordered--rYjAD td:last-child{border-right:var(--amino-border-subtle)}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead{text-transform:none}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead>tr{border-bottom:var(--amino-border-subtle);height:48px}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead>tr>th{background-color:var(--amino-gray-0);border-bottom:var(--amino-border-subtle);padding:12px;position:-webkit-sticky;position:sticky;top:0;white-space:nowrap}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead>tr>th.Amino_SimpleTable-module__noPadding--b5Y-c{padding:0}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr{height:48px}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr.Amino_SimpleTable-module__withHover--eL3XX:hover{background-color:var(--amino-hover-color)}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr.Amino_SimpleTable-module__clickable--XnaaE{cursor:pointer}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr:not(:hover) .row-hover-show{visibility:collapse}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td{border-bottom:var(--amino-border-subtle);padding:0}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td>:first-child{display:block;height:100%;padding:12px;white-space:nowrap;width:100%}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td>:first-child.Amino_SimpleTable-module__noPadding--b5Y-c{padding:0}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td>:first-child.Amino_SimpleTable-module__allowTextWrap--yVvjm{white-space:normal}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td>:first-child.Amino_SimpleTable-module__loading--bvjof{text-align:center}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td>:first-child.Amino_SimpleTable-module__skeletonCellWrapper--I8vJ7{display:flex}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td>:first-child:not(:hover) .cell-hover-show{visibility:collapse}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__shouldTruncate--x-zmL{max-width:var(--amino-cell-min-width);min-width:var(--amino-cell-min-width)}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__shouldTruncate--x-zmL>:first-child{overflow:hidden;text-overflow:ellipsis}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__collapsible--ozkOZ tr>td:last-child{width:40px}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__collapsible--ozkOZ tr>td:last-child>div{padding:0}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__collapsible--ozkOZ.Amino_SimpleTable-module__bordered--rYjAD tr:nth-last-child(2).Amino_SimpleTable-module__collapsed--VazPW td:first-child{border-bottom-left-radius:12px}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__collapsible--ozkOZ.Amino_SimpleTable-module__bordered--rYjAD tr:nth-last-child(2).Amino_SimpleTable-module__collapsed--VazPW td:last-child{border-bottom-right-radius:12px}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__collapsible--ozkOZ>tbody *{transition:var(--amino-transition)}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__collapsible--ozkOZ>tbody>tr{height:auto}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__collapsible--ozkOZ>tbody>tr:not(.Amino_SimpleTable-module__collapsed--VazPW) td{border-bottom:var(--amino-border-subtle)}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__collapsible--ozkOZ>tbody>tr.Amino_SimpleTable-module__collapsed--VazPW+tr>td{border:0}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__collapsible--ozkOZ>tbody>tr.Amino_SimpleTable-module__collapsed--VazPW+tr>td>:first-child{padding:0}.Amino_SimpleTable-module__styledCheckbox---753a{display:inline-flex;padding:12px}");var C=function(e){switch(e){case"center":return"center";case"end":return"flex-end";default:return"flex-start"}},w=800;exports.SimpleTable=function(i){var m=i.bordered,s=void 0!==m&&m,Y=i.className,Q=i.collapsible,q=void 0===Q?{enabled:!1}:Q,z=i.CustomLinkComponent,R=i.getRowLink,D=i.headers,N=i.items,W=i.keyExtractor,H=i.loading,P=void 0!==H&&H,Z=i.loadingItems,O=void 0===Z?10:Z,V=i.loadingSkeletonHeight,F=void 0===V?13:V,I=i.maxHeight,L=void 0===I?"100%":I,M=i.noHoverBackground,X=void 0!==M&&M,E=i.onRowClick,B=i.onRowHover,G=i.renderFooter,U=i.selectable,J=void 0===U?{enabled:!1}:U,K=i.style,$=e.__read(o.useState([]),2),ee=$[0],le=$[1],oe=function(e,o){var i=o[e.key],t=function(i){var t=b.default.Children.toArray(i).some((function(e){return!!b.default.isValidElement(e)&&/row-hover-show|cell-hover-show/.test(e.props.className)})),d=_.default("truncate"===e.textWrapMethod&&!t&&j),a={"--amino-cell-min-width":"".concat(e.minWidth||0,"px")},r=_.default(e.noPadding&&S,"normal"===e.textWrapMethod&&T),m={textAlign:e.align||"start"},s=function(e){switch(e){case"center":return"bottom";case"end":return"bottom-end";default:return"bottom-start"}}(e.align);if(R&&!J.anySelected&&!e.disabledLink){var u=z||"a";return l.jsx("td",{className:d,style:a,children:l.jsx(n.Tooltip,{disabled:"truncate"!==e.textWrapMethod,enterDelay:w,enterNextDelay:w,placement:s,subtitle:i,children:l.jsx(u,{className:r,href:R(o),style:m,children:i})})})}return l.jsx("td",{className:d,style:a,children:l.jsx(n.Tooltip,{disabled:"truncate"!==e.textWrapMethod,enterDelay:w,enterNextDelay:w,placement:s,subtitle:i,children:l.jsx("span",{className:r,style:m,children:i})})})};return e.renderCustom?l.jsx(l.Fragment,{children:t(e.renderCustom(i,o))}):l.jsx(l.Fragment,{children:t(String(i))})};return l.jsx("div",{className:_.default(u,Y),style:e.__assign({maxHeight:L},K),children:l.jsxs("table",{className:_.default(q.enabled&&f,c,s&&h,D.every((function(e){return!e.name}))&&p),children:[l.jsxs("colgroup",{children:[!!J.onHeaderCheckboxChange&&l.jsx("col",{width:0}),D.map((function(e){return l.jsx("col",{style:{minWidth:void 0!==e.minWidth?"".concat(e.minWidth,"px"):void 0},width:void 0!==e.width?"".concat(e.width,"%"):void 0},e.key)})),q.enabled&&l.jsx("col",{})]}),l.jsx("thead",{children:l.jsxs("tr",{children:[!!J.onHeaderCheckboxChange&&l.jsx("th",{className:S,children:J.renderCustomHeaderCheckbox||l.jsx(t.Checkbox,{checked:!P&&J.headerCheckboxValue||!1,className:k,disabled:P,onChange:J.onHeaderCheckboxChange})}),D.map((function(e){return l.jsx("th",{className:_.default(e.noPadding&&S),style:{textAlign:e.align||"start"},children:"string"==typeof e.name?l.jsx(r.Text,{color:"gray800",type:"small-header",children:e.name}):e.name},e.key)})),q.enabled&&l.jsx("th",{})]})}),l.jsx("tbody",{children:function(){var i;return P?e.__spreadArray([],e.__read(Array(O).keys()),!1).map((function(e){return l.jsxs("tr",{children:[J.enabled&&l.jsx("td",{children:l.jsx("div",{children:l.jsx(d.Skeleton,{height:F},e)})}),D.map((function(o){return l.jsx("td",{className:_.default(A,o.noPadding&&S),children:l.jsx("div",{className:v,style:{justifyContent:C(o.align)},children:l.jsx(d.Skeleton,{height:F,style:{width:"50%"}},e)})},o.key)}))]},e)})):q.enabled&&(null===(i=q.collapseContent)||void 0===i?void 0:i.length)?N.map((function(e,i){var d,r,n,m,s,b=W(e),u=!ee.includes(b);return l.jsx(a.TableRowCollapse,{className:_.default(!X&&y,u&&g),collapsed:u,onToggleCollapse:function(){return e=b,le(ee.includes(e)?ee.filter((function(l){return l!==e})):ee.concat(e));var e},rowContent:l.jsxs(l.Fragment,{children:[J.enabled&&l.jsx("td",{children:(null===(d=J.renderCustomRowCheckbox)||void 0===d?void 0:d.call(J,e,i))||l.jsx(t.Checkbox,{checked:(null===(r=J.isRowChecked)||void 0===r?void 0:r.call(J,e,i))||!1,disabled:(null===(n=J.isRowCheckboxDisabled)||void 0===n?void 0:n.call(J,e,i))||!1,onChange:function(l){var o;return null===(o=J.onRowCheckboxChange)||void 0===o?void 0:o.call(J,l,e,i)}})}),D.map((function(i){return l.jsx(o.Fragment,{children:oe(i,e)},i.key)}))]}),children:null===(s=null===(m=q.collapseContent)||void 0===m?void 0:m.find((function(e){return e.key===b})))||void 0===s?void 0:s.content},b)})):N.map((function(e,i){var d,a,r,n=!!E||!!J.anySelected&&!!J.onRowCheckboxChange;return l.jsxs("tr",{className:_.default(n&&x,!X&&y),onClick:function(l){var o,t,d;J.anySelected?(null===(o=J.isRowCheckboxDisabled)||void 0===o?void 0:o.call(J,e,i))||(l.preventDefault(),null===(t=J.onRowCheckboxChange)||void 0===t||t.call(J,!(null===(d=J.isRowChecked)||void 0===d?void 0:d.call(J,e,i)),e,i)):null==E||E(e)},onMouseEnter:function(){return null==B?void 0:B(e)},children:[J.enabled&&l.jsx("td",{children:(null===(d=J.renderCustomRowCheckbox)||void 0===d?void 0:d.call(J,e,i))||l.jsx(t.Checkbox,{checked:(null===(a=J.isRowChecked)||void 0===a?void 0:a.call(J,e,i))||!1,disabled:(null===(r=J.isRowCheckboxDisabled)||void 0===r?void 0:r.call(J,e,i))||!1,onChange:function(l){var o;return null===(o=J.onRowCheckboxChange)||void 0===o?void 0:o.call(J,l,e,i)}})}),D.map((function(i){return l.jsx(o.Fragment,{children:oe(i,e)},i.key)}))]},W(e))}))}()}),G]})})};
1
+ "use strict";var e=require("../../_tslib-bd4862e8.js"),l=require("react/jsx-runtime"),o=require("react"),i=require("clsx"),t=require("../checkbox/Checkbox.js"),d=require("../skeleton/Skeleton.js"),a=require("../table/TableRowCollapse.js"),r=require("../text/Text.js"),n=require("../tooltip/Tooltip.js"),m=require("../../style-inject.es-d4ddeae4.js");function s(e){return e&&e.__esModule?e:{default:e}}require("framer-motion"),require("../help-text/HelpText.js"),require("../../styles/constants/theme.js"),require("../../icons/CheckmarkIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../global.module-569e4fd5.js"),require("../../utils/getTestId.js"),require("../button/Button.js"),require("../button/RippleGroup.js"),require("uuid"),require("../button/_Ripple.js"),require("../../utils/getAminoColor.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("../collapse/Collapse.js"),require("@mui/material/Collapse"),require("../table/TableCell.js"),require("../table/TableRow.js"),require("../../icons/ChevronUpIcon.js"),require("@mui/material/styles"),require("@mui/material/Tooltip"),require("../flex/Flex.js");var b=s(o),_=s(i),u="Amino_SimpleTable-module__tableContainer--UsGFZ",c="Amino_SimpleTable-module__tableStyled--Q3YSy",p="Amino_SimpleTable-module__noHeaders---Nf59",h="Amino_SimpleTable-module__bordered--rYjAD",S="Amino_SimpleTable-module__noPadding--b5Y-c",y="Amino_SimpleTable-module__withHover--eL3XX",x="Amino_SimpleTable-module__clickable--XnaaE",T="Amino_SimpleTable-module__allowTextWrap--yVvjm",A="Amino_SimpleTable-module__loading--bvjof",v="Amino_SimpleTable-module__skeletonCellWrapper--I8vJ7",j="Amino_SimpleTable-module__shouldTruncate--x-zmL",f="Amino_SimpleTable-module__collapsible--ozkOZ",g="Amino_SimpleTable-module__collapsed--VazPW",k="Amino_SimpleTable-module__styledCheckbox---753a";m.styleInject(".Amino_SimpleTable-module__tableContainer--UsGFZ{width:100%}.Amino_SimpleTable-module__tableStyled--Q3YSy{border-collapse:initial;border-spacing:0;font-size:var(--amino-font-size-base);width:100%}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__noHeaders---Nf59 thead{display:none;max-height:0}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__bordered--rYjAD th{border:none}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__bordered--rYjAD tr:first-child td{border-top:var(--amino-border-subtle)}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__bordered--rYjAD tr:first-child td:first-child{border-top-left-radius:12px}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__bordered--rYjAD tr:first-child td:last-child{border-top-right-radius:12px}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__bordered--rYjAD tr:last-child td:first-child{border-bottom-left-radius:12px}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__bordered--rYjAD tr:last-child td:last-child{border-bottom-right-radius:12px}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__bordered--rYjAD td:first-child{border-left:var(--amino-border-subtle)}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__bordered--rYjAD td:last-child{border-right:var(--amino-border-subtle)}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead{text-transform:none}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead>tr{border-bottom:var(--amino-border-subtle);height:48px}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead>tr>th{background-color:var(--amino-gray-0);border-bottom:var(--amino-border-subtle);padding:12px;position:-webkit-sticky;position:sticky;top:0;white-space:nowrap;z-index:1}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead>tr>th.Amino_SimpleTable-module__noPadding--b5Y-c{padding:0}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr{height:48px}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr.Amino_SimpleTable-module__withHover--eL3XX:hover{background-color:var(--amino-hover-color)}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr.Amino_SimpleTable-module__clickable--XnaaE{cursor:pointer}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr:not(:hover) .row-hover-show{visibility:collapse}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td{border-bottom:var(--amino-border-subtle);padding:0}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td>:first-child{display:block;height:100%;padding:12px;white-space:nowrap;width:100%}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td>:first-child.tooltip-wrapper{padding:12px 0}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td>:first-child.tooltip-wrapper>a{padding:12px}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td>:first-child.Amino_SimpleTable-module__noPadding--b5Y-c{padding:0}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td>:first-child.Amino_SimpleTable-module__allowTextWrap--yVvjm{white-space:normal}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td>:first-child.Amino_SimpleTable-module__loading--bvjof{text-align:center}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td>:first-child.Amino_SimpleTable-module__skeletonCellWrapper--I8vJ7{display:flex}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td>:first-child:not(:hover) .cell-hover-show{visibility:collapse}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__shouldTruncate--x-zmL{max-width:var(--amino-cell-min-width);min-width:var(--amino-cell-min-width)}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__shouldTruncate--x-zmL>:first-child{overflow:hidden;text-overflow:ellipsis}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__collapsible--ozkOZ tr>td:last-child{width:40px}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__collapsible--ozkOZ tr>td:last-child>div{padding:0}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__collapsible--ozkOZ.Amino_SimpleTable-module__bordered--rYjAD tr:nth-last-child(2).Amino_SimpleTable-module__collapsed--VazPW td:first-child{border-bottom-left-radius:12px}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__collapsible--ozkOZ.Amino_SimpleTable-module__bordered--rYjAD tr:nth-last-child(2).Amino_SimpleTable-module__collapsed--VazPW td:last-child{border-bottom-right-radius:12px}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__collapsible--ozkOZ>tbody *{transition:var(--amino-transition)}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__collapsible--ozkOZ>tbody>tr{height:auto}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__collapsible--ozkOZ>tbody>tr:not(.Amino_SimpleTable-module__collapsed--VazPW) td{border-bottom:var(--amino-border-subtle)}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__collapsible--ozkOZ>tbody>tr.Amino_SimpleTable-module__collapsed--VazPW+tr>td{border:0}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__collapsible--ozkOZ>tbody>tr.Amino_SimpleTable-module__collapsed--VazPW+tr>td>:first-child{padding:0}.Amino_SimpleTable-module__styledCheckbox---753a{display:inline-flex;padding:12px}");var C=function(e){switch(e){case"center":return"center";case"end":return"flex-end";default:return"flex-start"}},w=800;exports.SimpleTable=function(i){var m=i.bordered,s=void 0!==m&&m,Y=i.className,Q=i.collapsible,q=void 0===Q?{enabled:!1}:Q,z=i.CustomLinkComponent,R=i.getRowLink,D=i.headers,N=i.items,W=i.keyExtractor,H=i.loading,P=void 0!==H&&H,Z=i.loadingItems,O=void 0===Z?10:Z,V=i.loadingSkeletonHeight,F=void 0===V?13:V,I=i.maxHeight,L=void 0===I?"100%":I,M=i.noHoverBackground,X=void 0!==M&&M,E=i.onRowClick,B=i.onRowHover,G=i.renderFooter,U=i.selectable,J=void 0===U?{enabled:!1}:U,K=i.style,$=e.__read(o.useState([]),2),ee=$[0],le=$[1],oe=function(e,o){var i=o[e.key],t=function(i){var t=b.default.Children.toArray(i).some((function(e){return!!b.default.isValidElement(e)&&/row-hover-show|cell-hover-show/.test(e.props.className)})),d=_.default("truncate"===e.textWrapMethod&&!t&&j),a={"--amino-cell-min-width":"".concat(e.minWidth||0,"px")},r=_.default(e.noPadding&&S,"normal"===e.textWrapMethod&&T),m={textAlign:e.align||"start"},s=function(e){switch(e){case"center":return"bottom";case"end":return"bottom-end";default:return"bottom-start"}}(e.align);if(R&&!J.anySelected&&!e.disabledLink){var u=z||"a";return l.jsx("td",{className:d,style:a,children:l.jsx(n.Tooltip,{disabled:"truncate"!==e.textWrapMethod,enterDelay:w,enterNextDelay:w,placement:s,subtitle:i,children:l.jsx(u,{className:r,href:R(o),style:m,children:i})})})}return l.jsx("td",{className:d,style:a,children:l.jsx(n.Tooltip,{disabled:"truncate"!==e.textWrapMethod,enterDelay:w,enterNextDelay:w,placement:s,subtitle:i,children:l.jsx("span",{className:r,style:m,children:i})})})};return e.renderCustom?l.jsx(l.Fragment,{children:t(e.renderCustom(i,o))}):l.jsx(l.Fragment,{children:t(String(i))})};return l.jsx("div",{className:_.default(u,Y),style:e.__assign({maxHeight:L},K),children:l.jsxs("table",{className:_.default(q.enabled&&f,c,s&&h,D.every((function(e){return!e.name}))&&p),children:[l.jsxs("colgroup",{children:[!!J.onHeaderCheckboxChange&&l.jsx("col",{width:0}),D.map((function(e){return l.jsx("col",{style:{minWidth:void 0!==e.minWidth?"".concat(e.minWidth,"px"):void 0},width:void 0!==e.width?"".concat(e.width,"%"):void 0},e.key)})),q.enabled&&l.jsx("col",{})]}),l.jsx("thead",{children:l.jsxs("tr",{children:[!!J.onHeaderCheckboxChange&&l.jsx("th",{className:S,children:J.renderCustomHeaderCheckbox||l.jsx(t.Checkbox,{checked:!P&&J.headerCheckboxValue||!1,className:k,disabled:P,onChange:J.onHeaderCheckboxChange})}),D.map((function(e){return l.jsx("th",{className:_.default(e.noPadding&&S),style:{textAlign:e.align||"start"},children:"string"==typeof e.name?l.jsx(r.Text,{color:"gray800",type:"small-header",children:e.name}):e.name},e.key)})),q.enabled&&l.jsx("th",{})]})}),l.jsx("tbody",{children:function(){var i;return P?e.__spreadArray([],e.__read(Array(O).keys()),!1).map((function(e){return l.jsxs("tr",{children:[J.enabled&&l.jsx("td",{children:l.jsx("div",{children:l.jsx(d.Skeleton,{height:F},e)})}),D.map((function(o){return l.jsx("td",{className:_.default(A,o.noPadding&&S),children:l.jsx("div",{className:v,style:{justifyContent:C(o.align)},children:l.jsx(d.Skeleton,{height:F,style:{width:"50%"}},e)})},o.key)}))]},e)})):q.enabled&&(null===(i=q.collapseContent)||void 0===i?void 0:i.length)?N.map((function(e,i){var d,r,n,m,s,b=W(e),u=!ee.includes(b);return l.jsx(a.TableRowCollapse,{className:_.default(!X&&y,u&&g),collapsed:u,onToggleCollapse:function(){return e=b,le(ee.includes(e)?ee.filter((function(l){return l!==e})):ee.concat(e));var e},rowContent:l.jsxs(l.Fragment,{children:[J.enabled&&l.jsx("td",{children:(null===(d=J.renderCustomRowCheckbox)||void 0===d?void 0:d.call(J,e,i))||l.jsx(t.Checkbox,{checked:(null===(r=J.isRowChecked)||void 0===r?void 0:r.call(J,e,i))||!1,disabled:(null===(n=J.isRowCheckboxDisabled)||void 0===n?void 0:n.call(J,e,i))||!1,onChange:function(l){var o;return null===(o=J.onRowCheckboxChange)||void 0===o?void 0:o.call(J,l,e,i)}})}),D.map((function(i){return l.jsx(o.Fragment,{children:oe(i,e)},i.key)}))]}),children:null===(s=null===(m=q.collapseContent)||void 0===m?void 0:m.find((function(e){return e.key===b})))||void 0===s?void 0:s.content},b)})):N.map((function(e,i){var d,a,r,n=!!E||!!J.anySelected&&!!J.onRowCheckboxChange;return l.jsxs("tr",{className:_.default(n&&x,!X&&y),onClick:function(l){var o,t,d;J.anySelected?(null===(o=J.isRowCheckboxDisabled)||void 0===o?void 0:o.call(J,e,i))||(l.preventDefault(),null===(t=J.onRowCheckboxChange)||void 0===t||t.call(J,!(null===(d=J.isRowChecked)||void 0===d?void 0:d.call(J,e,i)),e,i)):null==E||E(e)},onMouseEnter:function(){return null==B?void 0:B(e)},children:[J.enabled&&l.jsx("td",{children:(null===(d=J.renderCustomRowCheckbox)||void 0===d?void 0:d.call(J,e,i))||l.jsx(t.Checkbox,{checked:(null===(a=J.isRowChecked)||void 0===a?void 0:a.call(J,e,i))||!1,disabled:(null===(r=J.isRowCheckboxDisabled)||void 0===r?void 0:r.call(J,e,i))||!1,onChange:function(l){var o;return null===(o=J.onRowCheckboxChange)||void 0===o?void 0:o.call(J,l,e,i)}})}),D.map((function(i){return l.jsx(o.Fragment,{children:oe(i,e)},i.key)}))]},W(e))}))}()}),G]})})};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zonos/amino",
3
- "version": "5.4.30",
3
+ "version": "5.4.31",
4
4
  "description": "Core UI components for Amino",
5
5
  "repository": "git@github.com:Zonos/amino.git",
6
6
  "license": "MIT",