@secondstaxorg/sscomp 1.8.46-cle → 1.8.48

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.
package/dist/index.js CHANGED
@@ -25508,12 +25508,12 @@ const _jsxFileName$b = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\compon
25508
25508
  * Default SSX table component
25509
25509
  */
25510
25510
  const TablePrimary = (props) => {
25511
- const {thead,children,tbody,clickedRow,showPagination,itemsPerPage} = props;
25511
+ const {thead,children,tbody,clickedRow,showPagination,itemsPerPage,paginatedItems} = props;
25512
25512
  const [tbodyItems,setTbodyItems] = React$1.useState([]);
25513
25513
  const [tbodyOri,setTbodyOri] = React$1.useState(tbody);
25514
25514
 
25515
25515
  function sortByColumn(column){
25516
- if (tbody){
25516
+ if (tbody && tbody.length > 0){
25517
25517
  const sortedItems = [...tbody];
25518
25518
  sortedItems.sort((a,b) => a[column].localeCompare(b[column]));
25519
25519
  setTbodyOri(sortedItems);
@@ -25535,7 +25535,7 @@ const TablePrimary = (props) => {
25535
25535
  )
25536
25536
  , React$1.createElement('tbody', { className: "rounded-row", __self: undefined, __source: {fileName: _jsxFileName$b, lineNumber: 35}}
25537
25537
  , children
25538
- , tbodyItems && tbodyItems.map((item,index) => (
25538
+ , !children && tbodyItems && tbodyItems.map((item,index) => (
25539
25539
  React$1.createElement('tr', { key: index, className: clickedRow && 'clickable', onClick: ()=>{
25540
25540
  if (clickedRow) {
25541
25541
  clickedRow(item);
@@ -25558,7 +25558,10 @@ const TablePrimary = (props) => {
25558
25558
  )
25559
25559
  )
25560
25560
  , showPagination && itemsPerPage && itemsPerPage > 0 && tbodyOri &&
25561
- React$1.createElement(Pagination, { itemsPerPage: itemsPerPage, items: tbodyOri, paginatedItems: (arr)=>{setTbodyItems(arr);}, __self: undefined, __source: {fileName: _jsxFileName$b, lineNumber: 60}})
25561
+ React$1.createElement(Pagination, { itemsPerPage: itemsPerPage, items: tbodyOri, paginatedItems: (arr)=>{
25562
+ setTbodyItems(arr);
25563
+ paginatedItems(arr);
25564
+ }, __self: undefined, __source: {fileName: _jsxFileName$b, lineNumber: 60}})
25562
25565
 
25563
25566
  )
25564
25567
  )
@@ -25625,6 +25628,11 @@ const FieldContainer$2 = styled.div`
25625
25628
  display:grid;
25626
25629
  flex-direction: row;
25627
25630
  }
25631
+ &.read-only button:hover{
25632
+ outline: 1px solid ${theme.colors["neutral-100"]};
25633
+ background: ${theme.colors.white};
25634
+ cursor: default;
25635
+ }
25628
25636
  `;
25629
25637
 
25630
25638
  const OtherContainer = styled.div`
@@ -25778,7 +25786,7 @@ const Selector = (props) => {
25778
25786
  , subText && React$1.createElement('span', {__self: undefined, __source: {fileName: _jsxFileName$9, lineNumber: 96}}, subText)
25779
25787
  )
25780
25788
 
25781
- , React$1.createElement(FieldContainer$2, { className: arrangement, style: {width:width ? width : '100%',gridTemplateColumns:`repeat(${numCols ? numCols : itemsList.length},1fr)`}, __self: undefined, __source: {fileName: _jsxFileName$9, lineNumber: 99}}
25789
+ , React$1.createElement(FieldContainer$2, { className: `${arrangement} ${readonly ? 'read-only' : ''}`, style: {width:width ? width : '100%',gridTemplateColumns:`repeat(${numCols ? numCols : itemsList.length},1fr)`}, __self: undefined, __source: {fileName: _jsxFileName$9, lineNumber: 99}}
25782
25790
  , React$1.createElement(React$1.Fragment, null
25783
25791
  , itemsList.map((item,index) => (
25784
25792
  React$1.createElement(SelectorItem, { type: "button", key: index, className: evaluateSelection(item) ? 'selected' : '', onClick: () => {
@@ -25812,7 +25820,7 @@ const Selector = (props) => {
25812
25820
  , otherOption &&
25813
25821
  React$1.createElement(OtherContainer, {__self: undefined, __source: {fileName: _jsxFileName$9, lineNumber: 131}}
25814
25822
  , React$1.createElement('p', { className: "paragraph1Regular", __self: undefined, __source: {fileName: _jsxFileName$9, lineNumber: 132}}, "Other? Specify" )
25815
- , React$1.createElement(TextField, { placeholder: otherPlaceholder, value: otherVal, onChange: (e)=>{
25823
+ , React$1.createElement(TextField, { placeholder: otherPlaceholder, disabled: readonly, value: otherVal, onChange: (e)=>{
25816
25824
  if (readonly) return
25817
25825
  setOtherVal(e.target.value);
25818
25826
  }, __self: undefined, __source: {fileName: _jsxFileName$9, lineNumber: 133}})