@secondstaxorg/sscomp 2.1.13 → 2.1.15

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.es.js CHANGED
@@ -4874,6 +4874,11 @@ function round$1(e){return e+.5|0}const lim=(e,t,o)=>Math.max(Math.min(e,o),t);f
4874
4874
  line-height: 19px;
4875
4875
  font-family: Circular Book Medium, sans-serif;*/
4876
4876
  }
4877
+ th .thead-label{
4878
+ width:100%;
4879
+ display: flex;
4880
+ justify-content: space-between;
4881
+ }
4877
4882
  tbody tr{
4878
4883
  background: ${theme.colors.white};
4879
4884
  }
@@ -4920,7 +4925,7 @@ function round$1(e){return e+.5|0}const lim=(e,t,o)=>Math.max(Math.min(e,o),t);f
4920
4925
  gap: 4px;
4921
4926
  align-items: center;
4922
4927
  }
4923
- `,_jsxFileName$p="D:\\SSX\\Projects\\SSX Comps\\sscomp\\src\\components\\TablePrimary\\index.tsx";function _nullishCoalesce$2(e,t){return null!=e?e:t()}function _optionalChain$c(e){let t,o=e[0],a=1;for(;a<e.length;){const r=e[a],i=e[a+1];if(a+=2,("optionalAccess"===r||"optionalCall"===r)&&null==o)return;"access"===r||"optionalAccess"===r?(t=o,o=i(o)):"call"!==r&&"optionalCall"!==r||(o=i(((...e)=>o.call(t,...e))),t=void 0)}return o}const TablePrimary=e=>{const{thead:t,children:o,tbody:a,clickedRow:r,showPagination:i,itemsPerPage:n,paginatedItems:s}=e,[l,d]=useState([]),[c,u]=useState(void 0),[m,g]=useState("");return useEffect((()=>{u(a)}),[a]),useEffect((()=>{i||d(a)}),[i,c]),React__default$1.createElement(React__default$1.Fragment,null,React__default$1.createElement(TableContainer$1,{__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:51}},React__default$1.createElement(Table,{__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:52}},React__default$1.createElement("thead",{__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:53}},React__default$1.createElement("tr",{className:"rounded-row paragraph2Medium",__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:54}},t.map(((e,t)=>React__default$1.createElement("th",{key:t,onClick:()=>{!function(e){if(!a||"string"==typeof a[0][e])if(e!==m){if(e===m);else if(g(e),a&&a.length>0){const t=[...a];t.sort(((t,o)=>t[e].localeCompare(o[e]))),u(t)}}else if(a&&a.length>0){const t=[...a];t.sort(((t,o)=>t[e].localeCompare(o[e])));let o=t.reverse();u(o),g("")}}(e.dataKey)},__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:56}},e.label))))),React__default$1.createElement("tbody",{className:"rounded-row paragraph2Regular",__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:62}},o,!o&&l&&l.map(((e,o)=>React__default$1.createElement("tr",{key:o,className:r&&"clickable",onClick:()=>{r&&r(e)},__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:65}},t.map(((o,a)=>React__default$1.createElement("td",{key:a,className:a==t.length-1&&r?"with-arrow":"",__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:70}},React__default$1.createElement("span",{__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:71}},_nullishCoalesce$2(_optionalChain$c([o,"access",e=>e.component,"optionalCall",t=>t(e)]),(()=>e[o.dataKey]))),a==t.length-1&&r&&React__default$1.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:76}},React__default$1.createElement("path",{d:"M10.3592 7.52685L6.58584 3.76019C6.52387 3.6977 6.45013 3.64811 6.36889 3.61426C6.28765 3.58041 6.20052 3.56299 6.11251 3.56299C6.0245 3.56299 5.93736 3.58041 5.85612 3.61426C5.77488 3.64811 5.70115 3.6977 5.63917 3.76019C5.51501 3.8851 5.44531 4.05406 5.44531 4.23019C5.44531 4.40631 5.51501 4.57528 5.63917 4.70019L8.93917 8.03352L5.63917 11.3335C5.51501 11.4584 5.44531 11.6274 5.44531 11.8035C5.44531 11.9796 5.51501 12.1486 5.63917 12.2735C5.70092 12.3365 5.77455 12.3866 5.8558 12.421C5.93705 12.4553 6.0243 12.4732 6.11251 12.4735C6.20071 12.4732 6.28797 12.4553 6.36922 12.421C6.45047 12.3866 6.5241 12.3365 6.58584 12.2735L10.3592 8.50685C10.4268 8.44443 10.4808 8.36866 10.5178 8.28432C10.5547 8.19999 10.5738 8.10892 10.5738 8.01685C10.5738 7.92479 10.5547 7.83372 10.5178 7.74938C10.4808 7.66505 10.4268 7.58928 10.3592 7.52685Z",fill:"#A4BBDD",__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:77}}))))))))))),i&&n&&n>0&&c&&React__default$1.createElement(Pagination,{itemsPerPage:n,items:c,paginatedItems:e=>{d(e),s(e)},__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:88}}))},TableContainer=styled.table`
4928
+ `,_jsxFileName$p="D:\\SSX\\Projects\\SSX Comps\\sscomp\\src\\components\\TablePrimary\\index.tsx";function _nullishCoalesce$2(e,t){return null!=e?e:t()}function _optionalChain$c(e){let t,o=e[0],a=1;for(;a<e.length;){const r=e[a],i=e[a+1];if(a+=2,("optionalAccess"===r||"optionalCall"===r)&&null==o)return;"access"===r||"optionalAccess"===r?(t=o,o=i(o)):"call"!==r&&"optionalCall"!==r||(o=i(((...e)=>o.call(t,...e))),t=void 0)}return o}const CaretDown=({direction:e})=>React__default$1.createElement("svg",{style:{transform:`rotate(${"up"===e?"180deg":"0deg"})`,width:15},fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:13}},React__default$1.createElement("path",{d:"M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z",__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:13}})),TablePrimary=e=>{const{thead:t,children:o,tbody:a,clickedRow:r,showPagination:i,itemsPerPage:n,paginatedItems:s,sortBy:l}=e,[d,c]=useState([]),[u,m]=useState(_nullishCoalesce$2(a,(()=>[]))),[g,f]=useState(_nullishCoalesce$2(a,(()=>[]))),[p,h]=useState(""),[b,_]=useState("desc");function N(e){let t;p!==e||"desc"===b?(t=u.sort(((t,o)=>t[e].localeCompare(o[e]))),_("asc"),h(e)):(t=u.sort(((t,o)=>o[e].localeCompare(t[e]))),_("desc"),h(e)),f(t)}return useEffect((()=>{l&&t.some((e=>e.dataKey===l))&&N(l)}),[l]),useEffect((()=>{i||c(a)}),[i,u]),React__default$1.createElement(React__default$1.Fragment,null,React__default$1.createElement(TableContainer$1,{__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:94}},React__default$1.createElement(Table,{__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:95}},React__default$1.createElement("thead",{__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:96}},React__default$1.createElement("tr",{className:"rounded-row paragraph2Medium",__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:97}},t.map(((e,t)=>React__default$1.createElement("th",{key:t,onClick:()=>{N(e.dataKey)},__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:99}},React__default$1.createElement("span",{className:"thead-label",__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:101}},e.label," ",p===e.dataKey&&React__default$1.createElement(CaretDown,{direction:"asc"===b?"up":"down",__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:101}}))))))),React__default$1.createElement("tbody",{className:"rounded-row paragraph2Regular",__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:105}},o,!o&&g&&g.map(((e,o)=>React__default$1.createElement("tr",{key:o,className:r&&"clickable",onClick:()=>{r&&r(e)},__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:108}},t.map(((o,a)=>React__default$1.createElement("td",{key:a,className:a==t.length-1&&r?"with-arrow":"",__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:113}},React__default$1.createElement("span",{__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:114}},_nullishCoalesce$2(_optionalChain$c([o,"access",e=>e.component,"optionalCall",t=>t(e)]),(()=>e[o.dataKey]))),a==t.length-1&&r&&React__default$1.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:119}},React__default$1.createElement("path",{d:"M10.3592 7.52685L6.58584 3.76019C6.52387 3.6977 6.45013 3.64811 6.36889 3.61426C6.28765 3.58041 6.20052 3.56299 6.11251 3.56299C6.0245 3.56299 5.93736 3.58041 5.85612 3.61426C5.77488 3.64811 5.70115 3.6977 5.63917 3.76019C5.51501 3.8851 5.44531 4.05406 5.44531 4.23019C5.44531 4.40631 5.51501 4.57528 5.63917 4.70019L8.93917 8.03352L5.63917 11.3335C5.51501 11.4584 5.44531 11.6274 5.44531 11.8035C5.44531 11.9796 5.51501 12.1486 5.63917 12.2735C5.70092 12.3365 5.77455 12.3866 5.8558 12.421C5.93705 12.4553 6.0243 12.4732 6.11251 12.4735C6.20071 12.4732 6.28797 12.4553 6.36922 12.421C6.45047 12.3866 6.5241 12.3365 6.58584 12.2735L10.3592 8.50685C10.4268 8.44443 10.4808 8.36866 10.5178 8.28432C10.5547 8.19999 10.5738 8.10892 10.5738 8.01685C10.5738 7.92479 10.5547 7.83372 10.5178 7.74938C10.4808 7.66505 10.4268 7.58928 10.3592 7.52685Z",fill:"#A4BBDD",__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:120}}))))))))))),i&&n&&n>0&&u&&React__default$1.createElement(Pagination,{itemsPerPage:n,items:u,paginatedItems:e=>{c(e),s(e)},__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:131}}))},TableContainer=styled.table`
4924
4929
  width: 100%;
4925
4930
  background: white;
4926
4931
  border-collapse: collapse;