@secondstaxorg/sscomp 2.1.22 → 2.1.24

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
@@ -4925,7 +4925,7 @@ function round$1(e){return e+.5|0}const lim=(e,t,o)=>Math.max(Math.min(e,o),t);f
4925
4925
  gap: 4px;
4926
4926
  align-items: center;
4927
4927
  }
4928
- `,_jsxFileName$p="Z:\\DevCenter\\SSX\\Projects\\Component library\\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:14}},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:16}})),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([]),[g,f]=useState(""),[p,h]=useState("desc");function b(e){const o=t.some((t=>t.dataKey===e&&t.isDate));let a=[...u];g!==e?(o?a.sort(((t,o)=>new Date(t[e]).getTime()-new Date(o[e]).getTime())):a.sort(((t,o)=>String(t[e]).localeCompare(String(o[e])))),h("asc"),f(e)):"asc"===p?(o?a.sort(((t,o)=>new Date(o[e]).getTime()-new Date(t[e]).getTime())):a.sort(((t,o)=>String(o[e]).localeCompare(String(t[e])))),h("desc")):(o?a.sort(((t,o)=>new Date(t[e]).getTime()-new Date(o[e]).getTime())):a.sort(((t,o)=>String(t[e]).localeCompare(String(o[e])))),h("asc")),m(a)}return useEffect((()=>{a&&m(a)}),[a]),useEffect((()=>{l&&t.some((e=>e.dataKey===l))&&b(l)}),[l]),React__default$1.createElement(React__default$1.Fragment,null,React__default$1.createElement(TableContainer$1,{__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:132}},React__default$1.createElement(Table,{__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:133}},React__default$1.createElement("thead",{__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:134}},React__default$1.createElement("tr",{className:"rounded-row paragraph2Medium",__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:135}},t.map(((e,t)=>React__default$1.createElement("th",{key:t,onClick:()=>{b(e.dataKey)},__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:137}},React__default$1.createElement("span",{className:"thead-label",__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:140}},e.label," ",g===e.dataKey&&React__default$1.createElement(CaretDown,{direction:"asc"===p?"up":"down",__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:141}}))))))),React__default$1.createElement("tbody",{className:"rounded-row paragraph2Regular",__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:146}},o,!o&&u&&u.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:150}},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:156}},React__default$1.createElement("span",{__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:158}},_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:163}},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:165}}))))))))))),i&&n&&n>0&&u&&React__default$1.createElement(Pagination,{itemsPerPage:n,items:u,paginatedItems:e=>{m(e),c(e),s&&s(e)},__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:178}}))},TableContainer=styled.table`
4928
+ `,_jsxFileName$p="Z:\\DevCenter\\SSX\\Projects\\Component library\\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:14}},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:16}})),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([]),[g,f]=useState(""),[p,h]=useState("desc");function b(e){const o=t.some((t=>t.dataKey===e&&t.isDate));let a=[...u];g!==e?(o?a.sort(((t,o)=>new Date(t[e]).getTime()-new Date(o[e]).getTime())):a.sort(((t,o)=>String(t[e]).localeCompare(String(o[e])))),h("asc"),f(e)):"asc"===p?(o?a.sort(((t,o)=>new Date(o[e]).getTime()-new Date(t[e]).getTime())):a.sort(((t,o)=>String(o[e]).localeCompare(String(t[e])))),h("desc")):(o?a.sort(((t,o)=>new Date(t[e]).getTime()-new Date(o[e]).getTime())):a.sort(((t,o)=>String(t[e]).localeCompare(String(o[e])))),h("asc")),m(a)}return useEffect((()=>{a&&m(a)}),[a]),useEffect((()=>{l&&t.some((e=>e.dataKey===l))&&b(l)}),[l]),React__default$1.createElement(React__default$1.Fragment,null,React__default$1.createElement(TableContainer$1,{__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:132}},React__default$1.createElement(Table,{__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:133}},React__default$1.createElement("thead",{__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:134}},React__default$1.createElement("tr",{className:"rounded-row paragraph2Medium",__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:135}},t.map(((e,t)=>React__default$1.createElement("th",{key:t,onClick:()=>{b(e.dataKey)},__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:137}},React__default$1.createElement("span",{className:"thead-label",__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:140}},e.label," ",g===e.dataKey&&React__default$1.createElement(CaretDown,{direction:"asc"===p?"up":"down",__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:141}}))))))),React__default$1.createElement("tbody",{className:"rounded-row paragraph2Regular",__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:146}},o,!o&&u&&(n&&i&&n>0?d:u).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:149}},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:155}},React__default$1.createElement("span",{__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:157}},_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:162}},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:164}}))))))))))),i&&n&&n>0&&u&&React__default$1.createElement(Pagination,{itemsPerPage:n,items:u,paginatedItems:e=>{c(e),s&&s(e)},__self:void 0,__source:{fileName:_jsxFileName$p,lineNumber:177}}))},TableContainer=styled.table`
4929
4929
  width: 100%;
4930
4930
  background: white;
4931
4931
  border-collapse: collapse;