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