@zonos/amino 5.1.90 → 5.1.91
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.
|
@@ -22,7 +22,7 @@ export type SimpleTableHeader<T extends object> = {
|
|
|
22
22
|
/** The key for each record that the header corresponds to */
|
|
23
23
|
key: Key;
|
|
24
24
|
/** null means don't show a header for this column */
|
|
25
|
-
name:
|
|
25
|
+
name: ReactNode | null;
|
|
26
26
|
renderCustom?: (value: T[Key], item: T) => React.ReactNode;
|
|
27
27
|
} & SimpleTableHeaderBaseProps;
|
|
28
28
|
}[keyof T extends React.Key ? keyof T : never];
|
|
@@ -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"),n=require("../skeleton/Skeleton.js"),
|
|
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"),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("../../icons/CheckmarkIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../styles/constants/theme.js"),require("../../utils/getTestId.js");var m=r(i),s="Amino_SimpleTable-module__tableStyled--Q3YSy",c="Amino_SimpleTable-module__noPadding--b5Y-c",_="Amino_SimpleTable-module__withHover--eL3XX",b="Amino_SimpleTable-module__clickable--XnaaE",u="Amino_SimpleTable-module__loading--bvjof",h="Amino_SimpleTable-module__cellLink--jySVK",S="Amino_SimpleTable-module__styledCheckbox---753a";d.styleInject(".Amino_SimpleTable-module__tableStyled--Q3YSy{width:100%}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead{text-transform:uppercase}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead>tr{border-bottom:var(--amino-border);height:56px}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead>tr>th{padding:16px;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);height:48px}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr.Amino_SimpleTable-module__withHover--eL3XX:hover{background-color:var(--amino-gray-50)}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr.Amino_SimpleTable-module__clickable--XnaaE{cursor:pointer}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr:not(:hover) .Amino_SimpleTable-module__row-hover-show--wkowE{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) .Amino_SimpleTable-module__cell-hover-show--fenGT{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}");exports.SimpleTable=function(i){var d=i.className,r=i.getRowLink,y=i.headers,p=i.items,x=i.keyExtractor,g=i.loading,k=void 0!==g&&g,j=i.loadingItems,v=void 0===j?10:j,A=i.noHoverBackground,T=void 0!==A&&A,C=i.onRowClick,f=i.onRowHover,w=i.renderFooter,Y=i.selectable,Q=void 0===Y?{enabled:!1}:Y,q=i.style,N=function(e,o){var i=o[e.key],t=function(i){return r&&!Q.anySelected?l.jsx("td",{className:h,children:l.jsx("a",{className:m.default(e.noPadding&&c),href:r(o),style:{textAlign:e.align||"start"},children:i})}):l.jsx("td",{className:m.default(e.noPadding&&c),style:{textAlign:e.align||"start"},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.jsxs("table",{className:m.default(d,s),style:q,children:[l.jsxs("colgroup",{children:[!!Q.onHeaderCheckboxChange&&l.jsx("col",{width:0}),y.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:[!!Q.onHeaderCheckboxChange&&l.jsx("th",{className:c,children:Q.renderCustomHeaderCheckbox||l.jsx(t.Checkbox,{checked:!k&&Q.headerCheckboxValue||!1,className:S,disabled:k,onChange:Q.onHeaderCheckboxChange})}),y.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:k?e.__spreadArray([],e.__read(Array(v).keys()),!1).map((function(e){return l.jsxs("tr",{children:[Q.enabled&&l.jsx("td",{children:l.jsx(n.Skeleton,{height:30},e)}),y.map((function(o){return l.jsx("td",{className:m.default(u,o.noPadding&&c),children:l.jsx(n.Skeleton,{height:30},e)},o.key)}))]},e)})):p.map((function(e,i){var n,a,d,r=!!C||!!Q.anySelected&&!!Q.onRowCheckboxChange;return l.jsxs("tr",{className:m.default(r&&b,!T&&_),onClick:function(){var l,o,t;Q.anySelected?(null===(l=Q.isRowCheckboxDisabled)||void 0===l?void 0:l.call(Q,e,i))||null===(o=Q.onRowCheckboxChange)||void 0===o||o.call(Q,!(null===(t=Q.isRowChecked)||void 0===t?void 0:t.call(Q,e,i)),e,i):null==C||C(e)},onMouseEnter:function(){return null==f?void 0:f(e)},children:[Q.enabled&&l.jsx("td",{className:c,children:(null===(n=Q.renderCustomRowCheckbox)||void 0===n?void 0:n.call(Q,e,i))||l.jsx(t.Checkbox,{checked:(null===(a=Q.isRowChecked)||void 0===a?void 0:a.call(Q,e,i))||!1,className:S,disabled:(null===(d=Q.isRowCheckboxDisabled)||void 0===d?void 0:d.call(Q,e,i))||!1,onChange:function(l){var o;return null===(o=Q.onRowCheckboxChange)||void 0===o?void 0:o.call(Q,l,e,i)}})}),y.map((function(i){return l.jsx(o.Fragment,{children:N(i,e)},i.key)}))]},x(e))}))}),w]})};
|