@zonos/amino 5.4.8 → 5.4.9

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,4 +1,4 @@
1
- import { type ReactNode } from 'react';
1
+ import React, { type ReactNode } from 'react';
2
2
  import type { BaseProps } from "../../types/BaseProps";
3
3
  import type { ReactComponent } from "../../types/ReactComponent";
4
4
  type SimpleTableHeaderBaseProps = {
@@ -7,6 +7,11 @@ type SimpleTableHeaderBaseProps = {
7
7
  * @default 'start'
8
8
  */
9
9
  align?: 'start' | 'center' | 'end';
10
+ /**
11
+ * Disable truncating cell content
12
+ * @default false
13
+ */
14
+ disableTruncate?: boolean;
10
15
  /**
11
16
  * @default false
12
17
  * Disable link routing on cells
@@ -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"),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("../../global.module-569e4fd5.js"),require("../../utils/getTestId.js");var m=r(i),s="Amino_SimpleTable-module__tableContainer--UsGFZ",c="Amino_SimpleTable-module__tableStyled--Q3YSy",b="Amino_SimpleTable-module__noPadding--b5Y-c",u="Amino_SimpleTable-module__withHover--eL3XX",_="Amino_SimpleTable-module__clickable--XnaaE",h="Amino_SimpleTable-module__loading--bvjof",y="Amino_SimpleTable-module__cellLink--jySVK",p="Amino_SimpleTable-module__styledCheckbox---753a",S="Amino_SimpleTable-module__skeletonCellWrapper--I8vJ7";d.styleInject(".Amino_SimpleTable-module__tableContainer--UsGFZ{overflow:auto;width:100%}.Amino_SimpleTable-module__tableStyled--Q3YSy{border-collapse:initial;border-spacing:0;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: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 x=function(e){switch(e){case"center":return"center";case"end":return"flex-end";default:return"flex-start"}};exports.SimpleTable=function(i){var d=i.className,r=i.CustomLinkComponent,g=i.getRowLink,v=i.headers,k=i.items,j=i.keyExtractor,A=i.loading,T=void 0!==A&&A,C=i.loadingItems,f=void 0===C?10:C,w=i.loadingSkeletonHeight,Y=void 0===w?13:w,Q=i.maxHeight,q=void 0===Q?"100%":Q,H=i.noHoverBackground,N=void 0!==H&&H,R=i.onRowClick,L=i.onRowHover,P=i.renderFooter,I=i.selectable,F=void 0===I?{enabled:!1}:I,X=i.style,V=function(e,o){var i=o[e.key],t=function(i){if(g&&!F.anySelected&&!e.disabledLink){var t=r||"a";return l.jsx("td",{className:y,children:l.jsx(t,{className:m.default(e.noPadding&&b),href:g(o),style:{textAlign:e.align||"start"},children:i})})}return l.jsx("td",{className:m.default(e.noPadding&&b),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.jsx("div",{className:m.default(s,d),style:e.__assign({maxHeight:q},X),children:l.jsxs("table",{className:c,children:[l.jsxs("colgroup",{children:[!!F.onHeaderCheckboxChange&&l.jsx("col",{width:0}),v.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:[!!F.onHeaderCheckboxChange&&l.jsx("th",{className:b,children:F.renderCustomHeaderCheckbox||l.jsx(t.Checkbox,{checked:!T&&F.headerCheckboxValue||!1,className:p,disabled:T,onChange:F.onHeaderCheckboxChange})}),v.map((function(e){return l.jsx("th",{className:m.default(e.noPadding&&b),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:T?e.__spreadArray([],e.__read(Array(f).keys()),!1).map((function(e){return l.jsxs("tr",{children:[F.enabled&&l.jsx("td",{children:l.jsx(n.Skeleton,{height:Y},e)}),v.map((function(o){return l.jsx("td",{className:m.default(h,o.noPadding&&b),children:l.jsx("div",{className:S,style:{justifyContent:x(o.align)},children:l.jsx(n.Skeleton,{height:Y,style:{width:"50%"}},e)})},o.key)}))]},e)})):k.map((function(e,i){var n,a,d,r=!!R||!!F.anySelected&&!!F.onRowCheckboxChange;return l.jsxs("tr",{className:m.default(r&&_,!N&&u),onClick:function(l){var o,t,n;F.anySelected?(null===(o=F.isRowCheckboxDisabled)||void 0===o?void 0:o.call(F,e,i))||(l.preventDefault(),null===(t=F.onRowCheckboxChange)||void 0===t||t.call(F,!(null===(n=F.isRowChecked)||void 0===n?void 0:n.call(F,e,i)),e,i)):null==R||R(e)},onMouseEnter:function(){return null==L?void 0:L(e)},children:[F.enabled&&l.jsx("td",{children:(null===(n=F.renderCustomRowCheckbox)||void 0===n?void 0:n.call(F,e,i))||l.jsx(t.Checkbox,{checked:(null===(a=F.isRowChecked)||void 0===a?void 0:a.call(F,e,i))||!1,disabled:(null===(d=F.isRowCheckboxDisabled)||void 0===d?void 0:d.call(F,e,i))||!1,onChange:function(l){var o;return null===(o=F.onRowCheckboxChange)||void 0===o?void 0:o.call(F,l,e,i)}})}),v.map((function(i){return l.jsx(o.Fragment,{children:V(i,e)},i.key)}))]},j(e))}))}),P]})})};
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("../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");var m=r(o),s=r(i),c="Amino_SimpleTable-module__tableContainer--UsGFZ",b="Amino_SimpleTable-module__tableStyled--Q3YSy",u="Amino_SimpleTable-module__noPadding--b5Y-c",_="Amino_SimpleTable-module__withHover--eL3XX",h="Amino_SimpleTable-module__clickable--XnaaE",p="Amino_SimpleTable-module__noTruncate--jzBpJ",y="Amino_SimpleTable-module__loading--bvjof",S="Amino_SimpleTable-module__cellLink--jySVK",x="Amino_SimpleTable-module__styledCheckbox---753a",v="Amino_SimpleTable-module__skeletonCellWrapper--I8vJ7";d.styleInject(".Amino_SimpleTable-module__tableContainer--UsGFZ{width:100%}.Amino_SimpleTable-module__tableStyled--Q3YSy{border-collapse:initial;border-spacing:0;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);max-width:0;overflow:hidden;padding:12px;text-overflow:ellipsis;white-space:nowrap}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__noTruncate--jzBpJ{max-width:100%;overflow:visible;overflow:initial;white-space:inherit}.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 g=function(e){switch(e){case"center":return"center";case"end":return"flex-end";default:return"flex-start"}};exports.SimpleTable=function(i){var d=i.className,r=i.CustomLinkComponent,k=i.getRowLink,j=i.headers,T=i.items,A=i.keyExtractor,f=i.loading,C=void 0!==f&&f,w=i.loadingItems,Y=void 0===w?10:w,Q=i.loadingSkeletonHeight,q=void 0===Q?13:Q,N=i.maxHeight,H=void 0===N?"100%":N,R=i.noHoverBackground,L=void 0!==R&&R,P=i.onRowClick,I=i.onRowHover,F=i.renderFooter,V=i.selectable,X=void 0===V?{enabled:!1}:V,E=i.style,B=function(e,o){var i=o[e.key],t=function(i){var t=m.default.Children.toArray(i).some((function(e){return!!m.default.isValidElement(e)&&/row-hover-show|cell-hover-show/.test(e.props.className)}));if(k&&!X.anySelected&&!e.disabledLink){var n=r||"a";return l.jsx("td",{className:S,children:l.jsx(n,{className:s.default(e.noPadding&&u,(e.disableTruncate||t)&&p),href:k(o),style:{textAlign:e.align||"start"},children:i})})}return l.jsx("td",{className:s.default(e.noPadding&&u,(e.disableTruncate||t)&&p),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.jsx("div",{className:s.default(c,d),style:e.__assign({maxHeight:H},E),children:l.jsxs("table",{className:b,children:[l.jsxs("colgroup",{children:[!!X.onHeaderCheckboxChange&&l.jsx("col",{width:0}),j.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:[!!X.onHeaderCheckboxChange&&l.jsx("th",{className:u,children:X.renderCustomHeaderCheckbox||l.jsx(t.Checkbox,{checked:!C&&X.headerCheckboxValue||!1,className:x,disabled:C,onChange:X.onHeaderCheckboxChange})}),j.map((function(e){return l.jsx("th",{className:s.default(e.noPadding&&u),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:C?e.__spreadArray([],e.__read(Array(Y).keys()),!1).map((function(e){return l.jsxs("tr",{children:[X.enabled&&l.jsx("td",{children:l.jsx(n.Skeleton,{height:q},e)}),j.map((function(o){return l.jsx("td",{className:s.default(y,o.noPadding&&u),children:l.jsx("div",{className:v,style:{justifyContent:g(o.align)},children:l.jsx(n.Skeleton,{height:q,style:{width:"50%"}},e)})},o.key)}))]},e)})):T.map((function(e,i){var n,a,d,r=!!P||!!X.anySelected&&!!X.onRowCheckboxChange;return l.jsxs("tr",{className:s.default(r&&h,!L&&_),onClick:function(l){var o,t,n;X.anySelected?(null===(o=X.isRowCheckboxDisabled)||void 0===o?void 0:o.call(X,e,i))||(l.preventDefault(),null===(t=X.onRowCheckboxChange)||void 0===t||t.call(X,!(null===(n=X.isRowChecked)||void 0===n?void 0:n.call(X,e,i)),e,i)):null==P||P(e)},onMouseEnter:function(){return null==I?void 0:I(e)},children:[X.enabled&&l.jsx("td",{children:(null===(n=X.renderCustomRowCheckbox)||void 0===n?void 0:n.call(X,e,i))||l.jsx(t.Checkbox,{checked:(null===(a=X.isRowChecked)||void 0===a?void 0:a.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 o;return null===(o=X.onRowCheckboxChange)||void 0===o?void 0:o.call(X,l,e,i)}})}),j.map((function(i){return l.jsx(o.Fragment,{children:B(i,e)},i.key)}))]},A(e))}))}),F]})})};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zonos/amino",
3
- "version": "5.4.8",
3
+ "version": "5.4.9",
4
4
  "description": "Core UI components for Amino",
5
5
  "repository": "git@github.com:Zonos/amino.git",
6
6
  "license": "MIT",