@secondstaxorg/sscomp 2.1.23 → 2.1.25
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 +2 -2
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +22 -19
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
- package/types/components/Pagination/type.d.ts +4 -0
- package/types/components/TablePrimary/type.d.ts +8 -0
package/dist/index.js
CHANGED
|
@@ -715,7 +715,7 @@ const _jsxFileName$1n = "Z:\\DevCenter\\SSX\\Projects\\Component library\\sscomp
|
|
|
715
715
|
* Pagination component for paginating an array
|
|
716
716
|
*/
|
|
717
717
|
const Pagination = (props) => {
|
|
718
|
-
const {itemsPerPage,returnedPageNum,items,paginatedItems,labelOverrides,paginatedItemsRange,numItems} = props;
|
|
718
|
+
const {itemsPerPage,returnedPageNum,items,paginatedItems,labelOverrides,paginatedItemsRange,numItems,paginationPageNumber} = props;
|
|
719
719
|
const [pageNum,setPageNum] = React$1.useState(1);
|
|
720
720
|
const [startFrom,setStartFrom] = React$1.useState(1);
|
|
721
721
|
const [validation,setValidation] = React$1.useState('');
|
|
@@ -750,24 +750,27 @@ const Pagination = (props) => {
|
|
|
750
750
|
if (numItems) numItems(items.length); //return the number of items
|
|
751
751
|
},[items]);
|
|
752
752
|
|
|
753
|
+
React$1.useEffect(()=>{
|
|
754
|
+
if (paginationPageNumber) setPageNum((paginationPageNumber <= 0 || paginationPageNumber > pageNumbers.length) ? 1 : paginationPageNumber);
|
|
755
|
+
},[paginationPageNumber]);
|
|
753
756
|
|
|
754
757
|
return (
|
|
755
758
|
React$1.createElement(React$1.Fragment, null
|
|
756
759
|
, pageNumbers.length > 1 &&
|
|
757
|
-
React$1.createElement(PaginationContainer, {__self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber:
|
|
760
|
+
React$1.createElement(PaginationContainer, {__self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber: 51}}
|
|
758
761
|
, React$1.createElement(NumberButton, { onClick: ()=>{
|
|
759
762
|
setPageNum(pageNum - 1);
|
|
760
763
|
if (startFrom > 1) setStartFrom(startFrom - 1);
|
|
761
764
|
if (returnedPageNum) returnedPageNum(pageNum - 1);
|
|
762
|
-
}, disabled: pageNum === 1, __self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber:
|
|
765
|
+
}, disabled: pageNum === 1, __self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber: 52}}
|
|
763
766
|
, pageNum === 1 &&
|
|
764
|
-
React$1.createElement('svg', { width: "8", height: "12", viewBox: "0 0 8 12" , fill: "none", xmlns: "http://www.w3.org/2000/svg", __self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber:
|
|
765
|
-
, React$1.createElement('path', { d: "M3.2908 6.00019L6.8308 2.46019C7.01705 2.27283 7.12159 2.01938 7.12159 1.75519C7.12159 1.49101 7.01705 1.23756 6.8308 1.05019C6.73784 0.956464 6.62723 0.88207 6.50537 0.831301C6.38352 0.780533 6.25281 0.754395 6.1208 0.754395C5.98879 0.754395 5.85808 0.780533 5.73622 0.831301C5.61436 0.88207 5.50376 0.956464 5.4108 1.05019L1.1708 5.29019C1.07707 5.38316 1.00268 5.49376 0.951907 5.61562C0.901138 5.73748 0.875 5.86818 0.875 6.00019C0.875 6.1322 0.901138 6.26291 0.951907 6.38477C1.00268 6.50663 1.07707 6.61723 1.1708 6.71019L5.4108 11.0002C5.50424 11.0929 5.61505 11.1662 5.73689 11.216C5.85873 11.2657 5.98919 11.291 6.1208 11.2902C6.2524 11.291 6.38287 11.2657 6.5047 11.216C6.62654 11.1662 6.73736 11.0929 6.8308 11.0002C7.01705 10.8128 7.12159 10.5594 7.12159 10.2952C7.12159 10.031 7.01705 9.77756 6.8308 9.59019L3.2908 6.00019Z" , fill: "#E8EEF7", __self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber:
|
|
767
|
+
React$1.createElement('svg', { width: "8", height: "12", viewBox: "0 0 8 12" , fill: "none", xmlns: "http://www.w3.org/2000/svg", __self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber: 58}}
|
|
768
|
+
, React$1.createElement('path', { d: "M3.2908 6.00019L6.8308 2.46019C7.01705 2.27283 7.12159 2.01938 7.12159 1.75519C7.12159 1.49101 7.01705 1.23756 6.8308 1.05019C6.73784 0.956464 6.62723 0.88207 6.50537 0.831301C6.38352 0.780533 6.25281 0.754395 6.1208 0.754395C5.98879 0.754395 5.85808 0.780533 5.73622 0.831301C5.61436 0.88207 5.50376 0.956464 5.4108 1.05019L1.1708 5.29019C1.07707 5.38316 1.00268 5.49376 0.951907 5.61562C0.901138 5.73748 0.875 5.86818 0.875 6.00019C0.875 6.1322 0.901138 6.26291 0.951907 6.38477C1.00268 6.50663 1.07707 6.61723 1.1708 6.71019L5.4108 11.0002C5.50424 11.0929 5.61505 11.1662 5.73689 11.216C5.85873 11.2657 5.98919 11.291 6.1208 11.2902C6.2524 11.291 6.38287 11.2657 6.5047 11.216C6.62654 11.1662 6.73736 11.0929 6.8308 11.0002C7.01705 10.8128 7.12159 10.5594 7.12159 10.2952C7.12159 10.031 7.01705 9.77756 6.8308 9.59019L3.2908 6.00019Z" , fill: "#E8EEF7", __self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber: 59}})
|
|
766
769
|
)
|
|
767
770
|
|
|
768
771
|
, pageNum > 1 &&
|
|
769
|
-
React$1.createElement('svg', { width: "8", height: "12", viewBox: "0 0 8 12" , fill: "none", xmlns: "http://www.w3.org/2000/svg", __self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber:
|
|
770
|
-
, React$1.createElement('path', { d: "M3.2908 6.00019L6.8308 2.46019C7.01705 2.27283 7.12159 2.01938 7.12159 1.75519C7.12159 1.49101 7.01705 1.23756 6.8308 1.05019C6.73784 0.956464 6.62723 0.88207 6.50537 0.831301C6.38352 0.780533 6.25281 0.754395 6.1208 0.754395C5.98879 0.754395 5.85808 0.780533 5.73622 0.831301C5.61436 0.88207 5.50376 0.956464 5.4108 1.05019L1.1708 5.29019C1.07707 5.38316 1.00268 5.49376 0.951907 5.61562C0.901138 5.73748 0.875 5.86818 0.875 6.00019C0.875 6.1322 0.901138 6.26291 0.951907 6.38477C1.00268 6.50663 1.07707 6.61723 1.1708 6.71019L5.4108 11.0002C5.50424 11.0929 5.61505 11.1662 5.73689 11.216C5.85873 11.2657 5.98919 11.291 6.1208 11.2902C6.2524 11.291 6.38287 11.2657 6.5047 11.216C6.62654 11.1662 6.73736 11.0929 6.8308 11.0002C7.01705 10.8128 7.12159 10.5594 7.12159 10.2952C7.12159 10.031 7.01705 9.77756 6.8308 9.59019L3.2908 6.00019Z" , fill: "#070B12", __self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber:
|
|
772
|
+
React$1.createElement('svg', { width: "8", height: "12", viewBox: "0 0 8 12" , fill: "none", xmlns: "http://www.w3.org/2000/svg", __self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber: 63}}
|
|
773
|
+
, React$1.createElement('path', { d: "M3.2908 6.00019L6.8308 2.46019C7.01705 2.27283 7.12159 2.01938 7.12159 1.75519C7.12159 1.49101 7.01705 1.23756 6.8308 1.05019C6.73784 0.956464 6.62723 0.88207 6.50537 0.831301C6.38352 0.780533 6.25281 0.754395 6.1208 0.754395C5.98879 0.754395 5.85808 0.780533 5.73622 0.831301C5.61436 0.88207 5.50376 0.956464 5.4108 1.05019L1.1708 5.29019C1.07707 5.38316 1.00268 5.49376 0.951907 5.61562C0.901138 5.73748 0.875 5.86818 0.875 6.00019C0.875 6.1322 0.901138 6.26291 0.951907 6.38477C1.00268 6.50663 1.07707 6.61723 1.1708 6.71019L5.4108 11.0002C5.50424 11.0929 5.61505 11.1662 5.73689 11.216C5.85873 11.2657 5.98919 11.291 6.1208 11.2902C6.2524 11.291 6.38287 11.2657 6.5047 11.216C6.62654 11.1662 6.73736 11.0929 6.8308 11.0002C7.01705 10.8128 7.12159 10.5594 7.12159 10.2952C7.12159 10.031 7.01705 9.77756 6.8308 9.59019L3.2908 6.00019Z" , fill: "#070B12", __self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber: 64}})
|
|
771
774
|
)
|
|
772
775
|
|
|
773
776
|
)
|
|
@@ -777,26 +780,26 @@ const Pagination = (props) => {
|
|
|
777
780
|
onClick: () => {
|
|
778
781
|
if (returnedPageNum) returnedPageNum(number);
|
|
779
782
|
setPageNum(number);
|
|
780
|
-
}, __self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber:
|
|
783
|
+
}, __self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber: 70}}, number)
|
|
781
784
|
)
|
|
782
785
|
})
|
|
783
786
|
, React$1.createElement(NumberButton, { onClick: ()=>{
|
|
784
787
|
setPageNum(pageNum + 1);
|
|
785
788
|
if (startFrom + 10 < pageNumbers.length) setStartFrom(startFrom + 1);
|
|
786
789
|
if (returnedPageNum) returnedPageNum(pageNum + 1);
|
|
787
|
-
}, disabled: pageNum === pageNumbers.length, __self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber:
|
|
790
|
+
}, disabled: pageNum === pageNumbers.length, __self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber: 77}}
|
|
788
791
|
, pageNum !== pageNumbers.length &&
|
|
789
|
-
React$1.createElement('svg', { width: "8", height: "12", viewBox: "0 0 8 12" , fill: "none", xmlns: "http://www.w3.org/2000/svg", __self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber:
|
|
790
|
-
, React$1.createElement('path', { d: "M6.8336 5.29019L2.59361 1.05019C2.50064 0.956464 2.39004 0.88207 2.26818 0.831301C2.14632 0.780533 2.01562 0.754395 1.88361 0.754395C1.75159 0.754395 1.62089 0.780533 1.49903 0.831301C1.37717 0.88207 1.26657 0.956464 1.1736 1.05019C0.987354 1.23756 0.882812 1.49101 0.882812 1.75519C0.882812 2.01938 0.987354 2.27283 1.1736 2.46019L4.7136 6.00019L1.1736 9.54019C0.987354 9.72756 0.882812 9.98101 0.882812 10.2452C0.882813 10.5094 0.987354 10.7628 1.1736 10.9502C1.26705 11.0429 1.37786 11.1162 1.4997 11.166C1.62154 11.2157 1.752 11.241 1.88361 11.2402C2.01521 11.241 2.14567 11.2157 2.26751 11.166C2.38935 11.1162 2.50016 11.0429 2.59361 10.9502L6.8336 6.71019C6.92733 6.61723 7.00173 6.50663 7.0525 6.38477C7.10326 6.26291 7.1294 6.1322 7.1294 6.00019C7.1294 5.86818 7.10326 5.73748 7.0525 5.61562C7.00173 5.49376 6.92733 5.38316 6.8336 5.29019Z" , fill: "#070B12", __self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber:
|
|
792
|
+
React$1.createElement('svg', { width: "8", height: "12", viewBox: "0 0 8 12" , fill: "none", xmlns: "http://www.w3.org/2000/svg", __self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber: 83}}
|
|
793
|
+
, React$1.createElement('path', { d: "M6.8336 5.29019L2.59361 1.05019C2.50064 0.956464 2.39004 0.88207 2.26818 0.831301C2.14632 0.780533 2.01562 0.754395 1.88361 0.754395C1.75159 0.754395 1.62089 0.780533 1.49903 0.831301C1.37717 0.88207 1.26657 0.956464 1.1736 1.05019C0.987354 1.23756 0.882812 1.49101 0.882812 1.75519C0.882812 2.01938 0.987354 2.27283 1.1736 2.46019L4.7136 6.00019L1.1736 9.54019C0.987354 9.72756 0.882812 9.98101 0.882812 10.2452C0.882813 10.5094 0.987354 10.7628 1.1736 10.9502C1.26705 11.0429 1.37786 11.1162 1.4997 11.166C1.62154 11.2157 1.752 11.241 1.88361 11.2402C2.01521 11.241 2.14567 11.2157 2.26751 11.166C2.38935 11.1162 2.50016 11.0429 2.59361 10.9502L6.8336 6.71019C6.92733 6.61723 7.00173 6.50663 7.0525 6.38477C7.10326 6.26291 7.1294 6.1322 7.1294 6.00019C7.1294 5.86818 7.10326 5.73748 7.0525 5.61562C7.00173 5.49376 6.92733 5.38316 6.8336 5.29019Z" , fill: "#070B12", __self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber: 84}})
|
|
791
794
|
)
|
|
792
795
|
|
|
793
796
|
, pageNum === pageNumbers.length &&
|
|
794
|
-
React$1.createElement('svg', { width: "8", height: "12", viewBox: "0 0 8 12" , fill: "none", xmlns: "http://www.w3.org/2000/svg", __self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber:
|
|
795
|
-
, React$1.createElement('path', { d: "M6.8336 5.29019L2.59361 1.05019C2.50064 0.956464 2.39004 0.88207 2.26818 0.831301C2.14632 0.780533 2.01562 0.754395 1.88361 0.754395C1.75159 0.754395 1.62089 0.780533 1.49903 0.831301C1.37717 0.88207 1.26657 0.956464 1.1736 1.05019C0.987354 1.23756 0.882812 1.49101 0.882812 1.75519C0.882812 2.01938 0.987354 2.27283 1.1736 2.46019L4.7136 6.00019L1.1736 9.54019C0.987354 9.72756 0.882812 9.98101 0.882812 10.2452C0.882813 10.5094 0.987354 10.7628 1.1736 10.9502C1.26705 11.0429 1.37786 11.1162 1.4997 11.166C1.62154 11.2157 1.752 11.241 1.88361 11.2402C2.01521 11.241 2.14567 11.2157 2.26751 11.166C2.38935 11.1162 2.50016 11.0429 2.59361 10.9502L6.8336 6.71019C6.92733 6.61723 7.00173 6.50663 7.0525 6.38477C7.10326 6.26291 7.1294 6.1322 7.1294 6.00019C7.1294 5.86818 7.10326 5.73748 7.0525 5.61562C7.00173 5.49376 6.92733 5.38316 6.8336 5.29019Z" , fill: "#E8EEF7", __self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber:
|
|
797
|
+
React$1.createElement('svg', { width: "8", height: "12", viewBox: "0 0 8 12" , fill: "none", xmlns: "http://www.w3.org/2000/svg", __self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber: 88}}
|
|
798
|
+
, React$1.createElement('path', { d: "M6.8336 5.29019L2.59361 1.05019C2.50064 0.956464 2.39004 0.88207 2.26818 0.831301C2.14632 0.780533 2.01562 0.754395 1.88361 0.754395C1.75159 0.754395 1.62089 0.780533 1.49903 0.831301C1.37717 0.88207 1.26657 0.956464 1.1736 1.05019C0.987354 1.23756 0.882812 1.49101 0.882812 1.75519C0.882812 2.01938 0.987354 2.27283 1.1736 2.46019L4.7136 6.00019L1.1736 9.54019C0.987354 9.72756 0.882812 9.98101 0.882812 10.2452C0.882813 10.5094 0.987354 10.7628 1.1736 10.9502C1.26705 11.0429 1.37786 11.1162 1.4997 11.166C1.62154 11.2157 1.752 11.241 1.88361 11.2402C2.01521 11.241 2.14567 11.2157 2.26751 11.166C2.38935 11.1162 2.50016 11.0429 2.59361 10.9502L6.8336 6.71019C6.92733 6.61723 7.00173 6.50663 7.0525 6.38477C7.10326 6.26291 7.1294 6.1322 7.1294 6.00019C7.1294 5.86818 7.10326 5.73748 7.0525 5.61562C7.00173 5.49376 6.92733 5.38316 6.8336 5.29019Z" , fill: "#E8EEF7", __self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber: 89}})
|
|
796
799
|
)
|
|
797
800
|
|
|
798
801
|
)
|
|
799
|
-
, pageNumbers.length > 10 && React$1.createElement('span', { className: "paragraph2Regular", __self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber:
|
|
802
|
+
, pageNumbers.length > 10 && React$1.createElement('span', { className: "paragraph2Regular", __self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber: 93}}, React$1.createElement('input', { type: "text", className: `jump-to ${validation}`, placeholder: _optionalChain$O([labelOverrides, 'optionalAccess', _ => _.goTo]) || "Go to", onChange: (e)=>{
|
|
800
803
|
if (!e.target.value) {
|
|
801
804
|
setValidation('');
|
|
802
805
|
return
|
|
@@ -810,7 +813,7 @@ const Pagination = (props) => {
|
|
|
810
813
|
if (Number(e.target.value) > 10) setStartFrom(Number(e.target.value) - 10);
|
|
811
814
|
if (Number(e.target.value) < 10) setStartFrom(Number(e.target.value));
|
|
812
815
|
setValidation('success');
|
|
813
|
-
}, __self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber:
|
|
816
|
+
}, __self: undefined, __source: {fileName: _jsxFileName$1n, lineNumber: 93}}), " " , _optionalChain$O([labelOverrides, 'optionalAccess', _2 => _2.goTo]) || 'of', " " , pageNumbers.length)
|
|
814
817
|
|
|
815
818
|
)
|
|
816
819
|
|
|
@@ -27131,7 +27134,7 @@ const CaretDown = ({direction}) => {
|
|
|
27131
27134
|
* Default SSX table component
|
|
27132
27135
|
*/
|
|
27133
27136
|
const TablePrimary = (props) => {
|
|
27134
|
-
const {thead, children, tbody, clickedRow, showPagination, itemsPerPage, paginatedItems, sortBy} = props;
|
|
27137
|
+
const {thead, children, tbody, clickedRow, showPagination, itemsPerPage, paginatedItems, sortBy,paginationPageNumber,returnedPageNum} = props;
|
|
27135
27138
|
const [dataToShow, setDataToShow] = React$1.useState([]);
|
|
27136
27139
|
const [masterData, setMasterData] = React$1.useState([]);
|
|
27137
27140
|
const [sortedCol, setSortedCol] = React$1.useState('');
|
|
@@ -27253,7 +27256,7 @@ const TablePrimary = (props) => {
|
|
|
27253
27256
|
)
|
|
27254
27257
|
, React$1.createElement('tbody', { className: "rounded-row paragraph2Regular" , __self: undefined, __source: {fileName: _jsxFileName$p, lineNumber: 146}}
|
|
27255
27258
|
, children
|
|
27256
|
-
, !children && masterData && masterData.map((item, index) => (
|
|
27259
|
+
, !children && masterData && ((itemsPerPage && showPagination) && itemsPerPage > 0 ? dataToShow : masterData).map((item, index) => (
|
|
27257
27260
|
React$1.createElement('tr', { key: index, className: clickedRow && 'clickable', onClick: () => {
|
|
27258
27261
|
if (clickedRow) {
|
|
27259
27262
|
clickedRow(item);
|
|
@@ -27284,10 +27287,10 @@ const TablePrimary = (props) => {
|
|
|
27284
27287
|
, showPagination && itemsPerPage && itemsPerPage > 0 && masterData &&
|
|
27285
27288
|
React$1.createElement(Pagination, { itemsPerPage: itemsPerPage, items: masterData, paginatedItems: (arr) => {
|
|
27286
27289
|
// setTbodyItems(arr)
|
|
27287
|
-
setMasterData(arr)
|
|
27290
|
+
// setMasterData(arr)
|
|
27288
27291
|
setDataToShow(arr);
|
|
27289
27292
|
if (paginatedItems) paginatedItems(arr);
|
|
27290
|
-
}, __self: undefined, __source: {fileName: _jsxFileName$p, lineNumber: 177}})
|
|
27293
|
+
}, paginationPageNumber: paginationPageNumber, returnedPageNum: returnedPageNum, __self: undefined, __source: {fileName: _jsxFileName$p, lineNumber: 177}})
|
|
27291
27294
|
|
|
27292
27295
|
)
|
|
27293
27296
|
)
|