@zonos/amino 5.1.79 → 5.1.80
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 n=require("../../_tslib-ccfac372.js"),e=require("react/jsx-runtime"),i=require("
|
|
1
|
+
"use strict";var n=require("../../_tslib-ccfac372.js"),e=require("react/jsx-runtime"),i=require("react"),o=require("clsx"),r=require("styled-components"),t=require("../checkbox/Checkbox.js"),d=require("../skeleton/Skeleton.js"),a=require("../text/Text.js"),l=require("../../styles/constants/theme.js");function s(n){return n&&n.__esModule?n:{default:n}}require("framer-motion"),require("../../icons/CheckmarkIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../utils/getTestId.js"),require("../../style-inject.es-d4ddeae4.js");var c,h,u=s(o),g=s(r),x=g.default.table(c||(c=n.__makeTemplateObject(["\n width: 100%;\n\n > thead {\n text-transform: uppercase;\n\n > tr {\n border-bottom: ",";\n height: 56px;\n\n > th {\n padding: ",";\n white-space: nowrap;\n\n &.noPadding {\n padding: 0;\n }\n }\n }\n }\n\n > tbody {\n > tr {\n height: 48px;\n\n & {\n border-bottom: ",";\n }\n\n &.withHover:hover {\n background-color: ",";\n }\n\n &.clickable {\n cursor: pointer;\n }\n\n &:not(:hover) {\n .row-hover-show {\n visibility: collapse;\n }\n }\n\n > td {\n padding: ",";\n\n &.noPadding {\n padding: 0;\n }\n\n &.loading {\n text-align: center;\n }\n\n &:not(:hover) {\n .cell-hover-show {\n visibility: collapse;\n }\n }\n\n &.cellLink {\n padding: 0;\n\n > a {\n display: block;\n width: 100%;\n height: 100%;\n padding: ",";\n\n &.noPadding {\n padding: 0;\n }\n }\n }\n }\n }\n }\n"],["\n width: 100%;\n\n > thead {\n text-transform: uppercase;\n\n > tr {\n border-bottom: ",";\n height: 56px;\n\n > th {\n padding: ",";\n white-space: nowrap;\n\n &.noPadding {\n padding: 0;\n }\n }\n }\n }\n\n > tbody {\n > tr {\n height: 48px;\n\n & {\n border-bottom: ",";\n }\n\n &.withHover:hover {\n background-color: ",";\n }\n\n &.clickable {\n cursor: pointer;\n }\n\n &:not(:hover) {\n .row-hover-show {\n visibility: collapse;\n }\n }\n\n > td {\n padding: ",";\n\n &.noPadding {\n padding: 0;\n }\n\n &.loading {\n text-align: center;\n }\n\n &:not(:hover) {\n .cell-hover-show {\n visibility: collapse;\n }\n }\n\n &.cellLink {\n padding: 0;\n\n > a {\n display: block;\n width: 100%;\n height: 100%;\n padding: ",";\n\n &.noPadding {\n padding: 0;\n }\n }\n }\n }\n }\n }\n"])),l.theme.border,l.theme.space16,l.theme.border,l.theme.gray50,l.theme.space12,l.theme.space12),p=g.default(t.Checkbox)(h||(h=n.__makeTemplateObject(["\n padding: ",";\n display: inline-flex;\n"],["\n padding: ",";\n display: inline-flex;\n"])),l.theme.space12);exports.SimpleTable=function(o){var r=o.className,t=o.getRowLink,l=o.headers,s=o.items,c=o.keyExtractor,h=o.loading,g=void 0!==h&&h,b=o.loadingItems,m=void 0===b?10:b,k=o.noHoverBackground,v=void 0!==k&&k,j=o.onRowClick,w=o.onRowHover,y=o.renderFooter,C=o.selectable,f=void 0===C?{enabled:!1}:C,q=function(n,i){var o=i[n.key],r=function(o){return t&&!f.anySelected?e.jsx("td",{className:"cellLink",children:e.jsx("a",{className:u.default({noPadding:n.noPadding}),href:t(i),style:{textAlign:n.align||"start"},children:o})}):e.jsx("td",{className:u.default({noPadding:n.noPadding}),style:{textAlign:n.align||"start"},children:o})};return n.renderCustom?e.jsx(e.Fragment,{children:r(n.renderCustom(o,i))}):e.jsx(e.Fragment,{children:r(String(o))})};return e.jsxs(x,{className:r,children:[e.jsxs("colgroup",{children:[!!f.onHeaderCheckboxChange&&e.jsx("col",{width:0}),l.map((function(n){return e.jsx("col",{width:void 0!==n.width?"".concat(n.width,"%"):void 0},n.key)}))]}),e.jsx("thead",{children:e.jsxs("tr",{children:[!!f.onHeaderCheckboxChange&&e.jsx("th",{className:"noPadding",children:f.renderCustomHeaderCheckbox||e.jsx(p,{checked:!g&&f.headerCheckboxValue||!1,disabled:g,onChange:f.onHeaderCheckboxChange})}),l.map((function(n){return e.jsx("th",{style:{textAlign:n.align||"start"},children:e.jsx(a.Text,{color:"gray800",type:"small-header",children:n.name})},n.key)}))]})}),e.jsx("tbody",{children:g?n.__spreadArray([],n.__read(Array(m+1).keys()),!1).map((function(n){return e.jsxs("tr",{children:[f.enabled&&e.jsx("td",{children:e.jsx(d.Skeleton,{height:30},n)}),l.map((function(i){return e.jsx("td",{className:u.default({loading:!0,noPadding:i.noPadding}),children:e.jsx(d.Skeleton,{height:30},n)},i.key)}))]},n)})):s.map((function(n,o){var r,t,d,a=!!j||!!f.anySelected&&!!f.onRowCheckboxChange;return e.jsxs("tr",{className:u.default({clickable:a,withHover:!v}),onClick:function(){var e,i,r;f.anySelected?(null===(e=f.isRowCheckboxDisabled)||void 0===e?void 0:e.call(f,n,o))||null===(i=f.onRowCheckboxChange)||void 0===i||i.call(f,!(null===(r=f.isRowChecked)||void 0===r?void 0:r.call(f,n,o)),n,o):null==j||j(n)},onMouseEnter:function(){return null==w?void 0:w(n)},children:[f.enabled&&e.jsx("td",{className:"noPadding",children:(null===(r=f.renderCustomRowCheckbox)||void 0===r?void 0:r.call(f,n,o))||e.jsx(p,{checked:(null===(t=f.isRowChecked)||void 0===t?void 0:t.call(f,n,o))||!1,disabled:(null===(d=f.isRowCheckboxDisabled)||void 0===d?void 0:d.call(f,n,o))||!1,onChange:function(e){var i;return null===(i=f.onRowCheckboxChange)||void 0===i?void 0:i.call(f,e,n,o)}})}),l.map((function(o){return e.jsx(i.Fragment,{children:q(o,n)},o.key)}))]},c(n))}))}),y]})};
|