@zonos/amino 5.4.15 → 5.4.16
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"),t=require("react"),i=require("clsx"),o=require("../checkbox/Checkbox.js"),a=require("../skeleton/Skeleton.js"),n=require("../text/Text.js"),d=require("../tooltip/Tooltip.js"),r=require("../../style-inject.es-d4ddeae4.js");function
|
|
1
|
+
"use strict";var e=require("../../_tslib-bd4862e8.js"),l=require("react/jsx-runtime"),t=require("react"),i=require("clsx"),o=require("../checkbox/Checkbox.js"),a=require("../skeleton/Skeleton.js"),n=require("../text/Text.js"),d=require("../tooltip/Tooltip.js"),r=require("../../style-inject.es-d4ddeae4.js");function m(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("@mui/material/styles"),require("@mui/material/Tooltip"),require("../flex/Flex.js");var s=m(t),c=m(i),u="Amino_SimpleTable-module__tableContainer--UsGFZ",b="Amino_SimpleTable-module__tableStyled--Q3YSy",h="Amino_SimpleTable-module__noPadding--b5Y-c",_="Amino_SimpleTable-module__withHover--eL3XX",p="Amino_SimpleTable-module__clickable--XnaaE",y="Amino_SimpleTable-module__allowTextWrap--yVvjm",x="Amino_SimpleTable-module__loading--bvjof",S="Amino_SimpleTable-module__skeletonCellWrapper--I8vJ7",v="Amino_SimpleTable-module__shouldTruncate--x-zmL",g="Amino_SimpleTable-module__styledCheckbox---753a";r.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>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__styledCheckbox---753a{display:inline-flex;padding:12px}");var T=function(e){switch(e){case"center":return"center";case"end":return"flex-end";default:return"flex-start"}},f=800;exports.SimpleTable=function(i){var r=i.className,m=i.CustomLinkComponent,j=i.getRowLink,k=i.headers,w=i.items,A=i.keyExtractor,C=i.loading,Y=void 0!==C&&C,q=i.loadingItems,Q=void 0===q?10:q,N=i.loadingSkeletonHeight,H=void 0===N?13:N,W=i.maxHeight,R=void 0===W?"100%":W,L=i.noHoverBackground,D=void 0!==L&&L,F=i.onRowClick,I=i.onRowHover,M=i.renderFooter,P=i.selectable,X=void 0===P?{enabled:!1}:P,z=i.style,E=function(e,t){var i=t[e.key],o=function(i){var o=s.default.Children.toArray(i).some((function(e){return!!s.default.isValidElement(e)&&/row-hover-show|cell-hover-show/.test(e.props.className)})),a=c.default("truncate"===e.textWrapMethod&&!o&&v),n={"--amino-cell-min-width":"".concat(e.minWidth||0,"px")},r=c.default(e.noPadding&&h,"normal"===e.textWrapMethod&&y),u={textAlign:e.align||"start"},b=function(e){switch(e){case"center":return"bottom";case"end":return"bottom-end";default:return"bottom-start"}}(e.align);if(j&&!X.anySelected&&!e.disabledLink){var _=m||"a";return l.jsx("td",{className:a,style:n,children:l.jsx(d.Tooltip,{disabled:"truncate"!==e.textWrapMethod,enterDelay:f,enterNextDelay:f,placement:b,subtitle:i,children:l.jsx(_,{className:r,href:j(t),style:u,children:i})})})}return l.jsx("td",{className:a,style:n,children:l.jsx(d.Tooltip,{disabled:"truncate"!==e.textWrapMethod,enterDelay:f,enterNextDelay:f,placement:b,subtitle:i,children:l.jsx("span",{className:r,style:u,children:i})})})};return e.renderCustom?l.jsx(l.Fragment,{children:o(e.renderCustom(i,t))}):l.jsx(l.Fragment,{children:o(String(i))})};return l.jsx("div",{className:c.default(u,r),style:e.__assign({maxHeight:R},z),children:l.jsxs("table",{className:b,children:[l.jsxs("colgroup",{children:[!!X.onHeaderCheckboxChange&&l.jsx("col",{width:0}),k.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)}))]}),l.jsx("thead",{children:l.jsxs("tr",{children:[!!X.onHeaderCheckboxChange&&l.jsx("th",{className:h,children:X.renderCustomHeaderCheckbox||l.jsx(o.Checkbox,{checked:!Y&&X.headerCheckboxValue||!1,className:g,disabled:Y,onChange:X.onHeaderCheckboxChange})}),k.map((function(e){return l.jsx("th",{className:c.default(e.noPadding&&h),style:{textAlign:e.align||"start"},children:"string"==typeof e.name?l.jsx(n.Text,{color:"gray800",type:"small-header",children:e.name}):e.name},e.key)}))]})}),l.jsx("tbody",{children:Y?e.__spreadArray([],e.__read(Array(Q).keys()),!1).map((function(e){return l.jsxs("tr",{children:[X.enabled&&l.jsx("td",{children:l.jsx("div",{children:l.jsx(a.Skeleton,{height:H},e)})}),k.map((function(t){return l.jsx("td",{className:c.default(x,t.noPadding&&h),children:l.jsx("div",{className:S,style:{justifyContent:T(t.align)},children:l.jsx(a.Skeleton,{height:H,style:{width:"50%"}},e)})},t.key)}))]},e)})):w.map((function(e,i){var a,n,d,r=!!F||!!X.anySelected&&!!X.onRowCheckboxChange;return l.jsxs("tr",{className:c.default(r&&p,!D&&_),onClick:function(l){var t,o,a;X.anySelected?(null===(t=X.isRowCheckboxDisabled)||void 0===t?void 0:t.call(X,e,i))||(l.preventDefault(),null===(o=X.onRowCheckboxChange)||void 0===o||o.call(X,!(null===(a=X.isRowChecked)||void 0===a?void 0:a.call(X,e,i)),e,i)):null==F||F(e)},onMouseEnter:function(){return null==I?void 0:I(e)},children:[X.enabled&&l.jsx("td",{children:(null===(a=X.renderCustomRowCheckbox)||void 0===a?void 0:a.call(X,e,i))||l.jsx(o.Checkbox,{checked:(null===(n=X.isRowChecked)||void 0===n?void 0:n.call(X,e,i))||!1,disabled:(null===(d=X.isRowCheckboxDisabled)||void 0===d?void 0:d.call(X,e,i))||!1,onChange:function(l){var t;return null===(t=X.onRowCheckboxChange)||void 0===t?void 0:t.call(X,l,e,i)}})}),k.map((function(i){return l.jsx(t.Fragment,{children:E(i,e)},i.key)}))]},A(e))}))}),M]})})};
|