@zonos/amino 5.3.14 → 5.3.15
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"),t=require("clsx"),i=require("../checkbox/Checkbox.js"),n=require("../skeleton/Skeleton.js"),a=require("../text/Text.js"),d=require("../../style-inject.es-d4ddeae4.js");function r(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("../../utils/getTestId.js");var m=r(t),s="Amino_SimpleTable-module__tableStyled--Q3YSy",c="Amino_SimpleTable-module__noPadding--b5Y-c",
|
|
1
|
+
"use strict";var e=require("../../_tslib-bd4862e8.js"),l=require("react/jsx-runtime"),o=require("react"),t=require("clsx"),i=require("../checkbox/Checkbox.js"),n=require("../skeleton/Skeleton.js"),a=require("../text/Text.js"),d=require("../../style-inject.es-d4ddeae4.js");function r(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("../../utils/getTestId.js");var m=r(t),s="Amino_SimpleTable-module__tableStyled--Q3YSy",c="Amino_SimpleTable-module__noPadding--b5Y-c",b="Amino_SimpleTable-module__withHover--eL3XX",u="Amino_SimpleTable-module__clickable--XnaaE",_="Amino_SimpleTable-module__loading--bvjof",h="Amino_SimpleTable-module__cellLink--jySVK",y="Amino_SimpleTable-module__styledCheckbox---753a",S="Amino_SimpleTable-module__skeletonCellWrapper--I8vJ7";d.styleInject(".Amino_SimpleTable-module__tableStyled--Q3YSy{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{padding:12px;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{border-bottom:var(--amino-border-subtle);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{padding:12px}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__noPadding--b5Y-c{padding:0}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__loading--bvjof{text-align:center}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td:not(:hover) .cell-hover-show{visibility:collapse}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__cellLink--jySVK{padding:0}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__cellLink--jySVK>a{display:block;height:100%;padding:12px;width:100%}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__cellLink--jySVK>a.Amino_SimpleTable-module__noPadding--b5Y-c{padding:0}.Amino_SimpleTable-module__styledCheckbox---753a{display:inline-flex;padding:12px}.Amino_SimpleTable-module__skeletonCellWrapper--I8vJ7{display:flex}");var p=function(e){switch(e){case"center":return"center";case"end":return"flex-end";default:return"flex-start"}};exports.SimpleTable=function(t){var d=t.className,r=t.CustomLinkComponent,x=t.getRowLink,g=t.headers,k=t.items,v=t.keyExtractor,j=t.loading,A=void 0!==j&&j,T=t.loadingItems,C=void 0===T?10:T,f=t.loadingSkeletonHeight,w=void 0===f?13:f,Y=t.noHoverBackground,Q=void 0!==Y&&Y,q=t.onRowClick,N=t.onRowHover,R=t.renderFooter,H=t.selectable,L=void 0===H?{enabled:!1}:H,P=t.style,I=function(e,o){var t=o[e.key],i=function(t){if(x&&!L.anySelected&&!e.disabledLink){var i=r||"a";return l.jsx("td",{className:h,children:l.jsx(i,{className:m.default(e.noPadding&&c),href:x(o),style:{textAlign:e.align||"start"},children:t})})}return l.jsx("td",{className:m.default(e.noPadding&&c),style:{textAlign:e.align||"start"},children:t})};return e.renderCustom?l.jsx(l.Fragment,{children:i(e.renderCustom(t,o))}):l.jsx(l.Fragment,{children:i(String(t))})};return l.jsxs("table",{className:m.default(d,s),style:P,children:[l.jsxs("colgroup",{children:[!!L.onHeaderCheckboxChange&&l.jsx("col",{width:0}),g.map((function(e){return l.jsx("col",{width:void 0!==e.width?"".concat(e.width,"%"):void 0},e.key)}))]}),l.jsx("thead",{children:l.jsxs("tr",{children:[!!L.onHeaderCheckboxChange&&l.jsx("th",{className:c,children:L.renderCustomHeaderCheckbox||l.jsx(i.Checkbox,{checked:!A&&L.headerCheckboxValue||!1,className:y,disabled:A,onChange:L.onHeaderCheckboxChange})}),g.map((function(e){return l.jsx("th",{className:m.default(e.noPadding&&c),style:{textAlign:e.align||"start"},children:"string"==typeof e.name?l.jsx(a.Text,{color:"gray800",type:"small-header",children:e.name}):e.name},e.key)}))]})}),l.jsx("tbody",{children:A?e.__spreadArray([],e.__read(Array(C).keys()),!1).map((function(e){return l.jsxs("tr",{children:[L.enabled&&l.jsx("td",{children:l.jsx(n.Skeleton,{height:w},e)}),g.map((function(o){return l.jsx("td",{className:m.default(_,o.noPadding&&c),children:l.jsx("div",{className:S,style:{justifyContent:p(o.align)},children:l.jsx(n.Skeleton,{height:w,style:{width:"50%"}},e)})},o.key)}))]},e)})):k.map((function(e,t){var n,a,d,r=!!q||!!L.anySelected&&!!L.onRowCheckboxChange;return l.jsxs("tr",{className:m.default(r&&u,!Q&&b),onClick:function(){var l,o,i;L.anySelected?(null===(l=L.isRowCheckboxDisabled)||void 0===l?void 0:l.call(L,e,t))||null===(o=L.onRowCheckboxChange)||void 0===o||o.call(L,!(null===(i=L.isRowChecked)||void 0===i?void 0:i.call(L,e,t)),e,t):null==q||q(e)},onMouseEnter:function(){return null==N?void 0:N(e)},children:[L.enabled&&l.jsx("td",{className:c,children:(null===(n=L.renderCustomRowCheckbox)||void 0===n?void 0:n.call(L,e,t))||l.jsx(i.Checkbox,{checked:(null===(a=L.isRowChecked)||void 0===a?void 0:a.call(L,e,t))||!1,className:y,disabled:(null===(d=L.isRowCheckboxDisabled)||void 0===d?void 0:d.call(L,e,t))||!1,onChange:function(l){var o;return null===(o=L.onRowCheckboxChange)||void 0===o?void 0:o.call(L,l,e,t)}})}),g.map((function(t){return l.jsx(o.Fragment,{children:I(t,e)},t.key)}))]},v(e))}))}),R]})};
|