@secondstaxorg/sscomp 1.8.48 → 1.8.51
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 +3 -3
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +58 -34
- 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/TablePrimary/type.d.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -22244,17 +22244,19 @@ const TextField = (props) => {
|
|
|
22244
22244
|
const textFieldRef = React$1.useRef();
|
|
22245
22245
|
|
|
22246
22246
|
React$1.useEffect(()=>{
|
|
22247
|
-
|
|
22247
|
+
if (value && (value ).length > 0){
|
|
22248
|
+
setInputVal(value );
|
|
22249
|
+
}
|
|
22248
22250
|
},[value]);
|
|
22249
22251
|
|
|
22250
22252
|
React$1.useEffect(()=>{
|
|
22251
|
-
if (inputVal){
|
|
22253
|
+
if (inputVal.length > 0){
|
|
22252
22254
|
setBorderColor('success');
|
|
22253
22255
|
}
|
|
22254
22256
|
},[inputVal]);
|
|
22255
22257
|
|
|
22256
22258
|
function validate(){
|
|
22257
|
-
if (inputVal){
|
|
22259
|
+
if (inputVal.length > 0){
|
|
22258
22260
|
setBorderColor('success');
|
|
22259
22261
|
setErr(false);
|
|
22260
22262
|
}else {
|
|
@@ -22273,26 +22275,26 @@ const TextField = (props) => {
|
|
|
22273
22275
|
};
|
|
22274
22276
|
|
|
22275
22277
|
return (
|
|
22276
|
-
React$1.createElement('div', { style: style, __self: undefined, __source: {fileName: _jsxFileName$v, lineNumber:
|
|
22278
|
+
React$1.createElement('div', { style: style, __self: undefined, __source: {fileName: _jsxFileName$v, lineNumber: 50}}
|
|
22277
22279
|
, label &&
|
|
22278
|
-
React$1.createElement(InputLabel$5, {__self: undefined, __source: {fileName: _jsxFileName$v, lineNumber:
|
|
22279
|
-
, React$1.createElement('label', { className: "paragraph2Medium", __self: undefined, __source: {fileName: _jsxFileName$v, lineNumber:
|
|
22280
|
-
, subtext && React$1.createElement('span', { className: "paragraph1Regular", __self: undefined, __source: {fileName: _jsxFileName$v, lineNumber:
|
|
22280
|
+
React$1.createElement(InputLabel$5, {__self: undefined, __source: {fileName: _jsxFileName$v, lineNumber: 52}}
|
|
22281
|
+
, React$1.createElement('label', { className: "paragraph2Medium", __self: undefined, __source: {fileName: _jsxFileName$v, lineNumber: 53}}, label)
|
|
22282
|
+
, subtext && React$1.createElement('span', { className: "paragraph1Regular", __self: undefined, __source: {fileName: _jsxFileName$v, lineNumber: 54}}, subtext)
|
|
22281
22283
|
)
|
|
22282
22284
|
|
|
22283
|
-
, React$1.createElement(InputContainer$3, { className: `${borderColor} ${disabled ? 'disabled' : ''}`, style: {width:width ? width : '100%',border:disabled ? `1px solid ${theme.colors["neutral-100"]}` : ''}, __self: undefined, __source: {fileName: _jsxFileName$v, lineNumber:
|
|
22284
|
-
, React$1.createElement(InputField$2, { ref: textFieldRef, onBlur: validate, onInvalid: validate, value: inputVal, onChange: (e)=>{
|
|
22285
|
+
, React$1.createElement(InputContainer$3, { className: `${borderColor} ${disabled ? 'disabled' : ''}`, style: {width:width ? width : '100%',border:disabled ? `1px solid ${theme.colors["neutral-100"]}` : ''}, __self: undefined, __source: {fileName: _jsxFileName$v, lineNumber: 57}}
|
|
22286
|
+
, React$1.createElement(InputField$2, { ref: textFieldRef, onBlur: validate, onInvalid: validate, value: inputVal.length > 0 ? inputVal : '', onChange: (e)=>{
|
|
22285
22287
|
if (readonly) return
|
|
22286
22288
|
setInputVal(e.target.value);
|
|
22287
|
-
}, ...props, __self: undefined, __source: {fileName: _jsxFileName$v, lineNumber:
|
|
22289
|
+
}, ...props, __self: undefined, __source: {fileName: _jsxFileName$v, lineNumber: 58}})
|
|
22288
22290
|
)
|
|
22289
22291
|
, !inputVal && required && err &&
|
|
22290
|
-
React$1.createElement(ErrorMessage$3, {__self: undefined, __source: {fileName: _jsxFileName$v, lineNumber:
|
|
22292
|
+
React$1.createElement(ErrorMessage$3, {__self: undefined, __source: {fileName: _jsxFileName$v, lineNumber: 64}}
|
|
22291
22293
|
/*exclamation-triangle*/
|
|
22292
|
-
, React$1.createElement('svg', { width: "16", height: "14", viewBox: "0 0 16 14" , fill: "none", xmlns: "http://www.w3.org/2000/svg", __self: undefined, __source: {fileName: _jsxFileName$v, lineNumber:
|
|
22293
|
-
, React$1.createElement('path', { d: "M8.00006 9.66669C7.86821 9.66669 7.73931 9.70578 7.62968 9.77904C7.52005 9.85229 7.4346 9.95641 7.38414 10.0782C7.33368 10.2 7.32048 10.3341 7.3462 10.4634C7.37193 10.5927 7.43542 10.7115 7.52866 10.8048C7.62189 10.898 7.74068 10.9615 7.87 10.9872C7.99932 11.0129 8.13336 10.9997 8.25518 10.9493C8.377 10.8988 8.48112 10.8134 8.55437 10.7037C8.62763 10.5941 8.66673 10.4652 8.66673 10.3334C8.66673 10.1565 8.59649 9.98697 8.47146 9.86195C8.34644 9.73692 8.17687 9.66669 8.00006 9.66669ZM15.1134 10.6467L9.74673 1.31335C9.57326 1.00236 9.31992 0.743323 9.01285 0.562997C8.70579 0.382672 8.35615 0.287598 8.00006 0.287598C7.64396 0.287598 7.29433 0.382672 6.98726 0.562997C6.6802 0.743323 6.42686 1.00236 6.25339 1.31335L0.92006 10.6467C0.74059 10.9494 0.644155 11.294 0.640489 11.6459C0.636824 11.9978 0.726058 12.3444 0.899184 12.6507C1.07231 12.9571 1.3232 13.2123 1.62652 13.3907C1.92984 13.5691 2.27485 13.6643 2.62673 13.6667H13.3734C13.7281 13.6702 14.0773 13.5793 14.3853 13.4033C14.6933 13.2273 14.949 12.9726 15.126 12.6652C15.3031 12.3579 15.3953 12.009 15.3931 11.6542C15.3908 11.2995 15.2943 10.9518 15.1134 10.6467ZM13.9601 11.98C13.9016 12.084 13.8164 12.1704 13.7132 12.2302C13.61 12.29 13.4927 12.321 13.3734 12.32H2.62673C2.50747 12.321 2.39013 12.29 2.28694 12.2302C2.18375 12.1704 2.0985 12.084 2.04006 11.98C1.98155 11.8787 1.95074 11.7637 1.95074 11.6467C1.95074 11.5297 1.98155 11.4147 2.04006 11.3134L7.37339 1.98002C7.42934 1.87082 7.51433 1.77917 7.61902 1.71518C7.72371 1.65119 7.84403 1.61733 7.96673 1.61733C8.08942 1.61733 8.20974 1.65119 8.31443 1.71518C8.41912 1.77917 8.50411 1.87082 8.56006 1.98002L13.9267 11.3134C13.9929 11.4132 14.0309 11.5291 14.0367 11.6488C14.0426 11.7684 14.0161 11.8875 13.9601 11.9934V11.98ZM8.00006 4.33335C7.82325 4.33335 7.65368 4.40359 7.52866 4.52861C7.40363 4.65364 7.33339 4.82321 7.33339 5.00002V7.66669C7.33339 7.8435 7.40363 8.01307 7.52866 8.13809C7.65368 8.26311 7.82325 8.33335 8.00006 8.33335C8.17687 8.33335 8.34644 8.26311 8.47146 8.13809C8.59649 8.01307 8.66673 7.8435 8.66673 7.66669V5.00002C8.66673 4.82321 8.59649 4.65364 8.47146 4.52861C8.34644 4.40359 8.17687 4.33335 8.00006 4.33335Z" , fill: "#F80000", __self: undefined, __source: {fileName: _jsxFileName$v, lineNumber:
|
|
22294
|
+
, React$1.createElement('svg', { width: "16", height: "14", viewBox: "0 0 16 14" , fill: "none", xmlns: "http://www.w3.org/2000/svg", __self: undefined, __source: {fileName: _jsxFileName$v, lineNumber: 66}}
|
|
22295
|
+
, React$1.createElement('path', { d: "M8.00006 9.66669C7.86821 9.66669 7.73931 9.70578 7.62968 9.77904C7.52005 9.85229 7.4346 9.95641 7.38414 10.0782C7.33368 10.2 7.32048 10.3341 7.3462 10.4634C7.37193 10.5927 7.43542 10.7115 7.52866 10.8048C7.62189 10.898 7.74068 10.9615 7.87 10.9872C7.99932 11.0129 8.13336 10.9997 8.25518 10.9493C8.377 10.8988 8.48112 10.8134 8.55437 10.7037C8.62763 10.5941 8.66673 10.4652 8.66673 10.3334C8.66673 10.1565 8.59649 9.98697 8.47146 9.86195C8.34644 9.73692 8.17687 9.66669 8.00006 9.66669ZM15.1134 10.6467L9.74673 1.31335C9.57326 1.00236 9.31992 0.743323 9.01285 0.562997C8.70579 0.382672 8.35615 0.287598 8.00006 0.287598C7.64396 0.287598 7.29433 0.382672 6.98726 0.562997C6.6802 0.743323 6.42686 1.00236 6.25339 1.31335L0.92006 10.6467C0.74059 10.9494 0.644155 11.294 0.640489 11.6459C0.636824 11.9978 0.726058 12.3444 0.899184 12.6507C1.07231 12.9571 1.3232 13.2123 1.62652 13.3907C1.92984 13.5691 2.27485 13.6643 2.62673 13.6667H13.3734C13.7281 13.6702 14.0773 13.5793 14.3853 13.4033C14.6933 13.2273 14.949 12.9726 15.126 12.6652C15.3031 12.3579 15.3953 12.009 15.3931 11.6542C15.3908 11.2995 15.2943 10.9518 15.1134 10.6467ZM13.9601 11.98C13.9016 12.084 13.8164 12.1704 13.7132 12.2302C13.61 12.29 13.4927 12.321 13.3734 12.32H2.62673C2.50747 12.321 2.39013 12.29 2.28694 12.2302C2.18375 12.1704 2.0985 12.084 2.04006 11.98C1.98155 11.8787 1.95074 11.7637 1.95074 11.6467C1.95074 11.5297 1.98155 11.4147 2.04006 11.3134L7.37339 1.98002C7.42934 1.87082 7.51433 1.77917 7.61902 1.71518C7.72371 1.65119 7.84403 1.61733 7.96673 1.61733C8.08942 1.61733 8.20974 1.65119 8.31443 1.71518C8.41912 1.77917 8.50411 1.87082 8.56006 1.98002L13.9267 11.3134C13.9929 11.4132 14.0309 11.5291 14.0367 11.6488C14.0426 11.7684 14.0161 11.8875 13.9601 11.9934V11.98ZM8.00006 4.33335C7.82325 4.33335 7.65368 4.40359 7.52866 4.52861C7.40363 4.65364 7.33339 4.82321 7.33339 5.00002V7.66669C7.33339 7.8435 7.40363 8.01307 7.52866 8.13809C7.65368 8.26311 7.82325 8.33335 8.00006 8.33335C8.17687 8.33335 8.34644 8.26311 8.47146 8.13809C8.59649 8.01307 8.66673 7.8435 8.66673 7.66669V5.00002C8.66673 4.82321 8.59649 4.65364 8.47146 4.52861C8.34644 4.40359 8.17687 4.33335 8.00006 4.33335Z" , fill: "#F80000", __self: undefined, __source: {fileName: _jsxFileName$v, lineNumber: 67}})
|
|
22294
22296
|
)
|
|
22295
|
-
, errMsg ? React$1.createElement('span', { className: "paragraph1Regular", __self: undefined, __source: {fileName: _jsxFileName$v, lineNumber:
|
|
22297
|
+
, errMsg ? React$1.createElement('span', { className: "paragraph1Regular", __self: undefined, __source: {fileName: _jsxFileName$v, lineNumber: 69}}, errMsg) : React$1.createElement('span', { className: "paragraph1Regular", __self: undefined, __source: {fileName: _jsxFileName$v, lineNumber: 69}}, "This field is required" )
|
|
22296
22298
|
)
|
|
22297
22299
|
|
|
22298
22300
|
)
|
|
@@ -25511,43 +25513,65 @@ const TablePrimary = (props) => {
|
|
|
25511
25513
|
const {thead,children,tbody,clickedRow,showPagination,itemsPerPage,paginatedItems} = props;
|
|
25512
25514
|
const [tbodyItems,setTbodyItems] = React$1.useState([]);
|
|
25513
25515
|
const [tbodyOri,setTbodyOri] = React$1.useState(tbody);
|
|
25516
|
+
const [sortedCol,setSortedCol] = React$1.useState('');
|
|
25514
25517
|
|
|
25515
25518
|
function sortByColumn(column){
|
|
25516
|
-
if (
|
|
25517
|
-
|
|
25518
|
-
|
|
25519
|
-
|
|
25519
|
+
if (column === sortedCol){
|
|
25520
|
+
if (tbody && tbody.length > 0){
|
|
25521
|
+
const sortedItems = [...tbody];
|
|
25522
|
+
sortedItems.sort((a,b) => a[column].localeCompare(b[column]));
|
|
25523
|
+
let revSort = sortedItems.reverse();
|
|
25524
|
+
setTbodyItems(revSort);
|
|
25525
|
+
setSortedCol('');
|
|
25526
|
+
}
|
|
25527
|
+
|
|
25528
|
+
return
|
|
25529
|
+
}else if(column !== sortedCol){
|
|
25530
|
+
setSortedCol(column);
|
|
25531
|
+
if (tbody && tbody.length > 0){
|
|
25532
|
+
const sortedItems = [...tbody];
|
|
25533
|
+
sortedItems.sort((a,b) => a[column].localeCompare(b[column]));
|
|
25534
|
+
setTbodyItems(sortedItems);
|
|
25535
|
+
}
|
|
25536
|
+
|
|
25537
|
+
return
|
|
25520
25538
|
}
|
|
25521
25539
|
}
|
|
25522
25540
|
|
|
25541
|
+
React$1.useEffect(()=>{
|
|
25542
|
+
if (!showPagination){
|
|
25543
|
+
setTbodyItems(tbody );
|
|
25544
|
+
}
|
|
25545
|
+
},[showPagination]);
|
|
25546
|
+
|
|
25523
25547
|
return (
|
|
25524
25548
|
React$1.createElement(React$1.Fragment, null
|
|
25525
|
-
, React$1.createElement(TableContainer$1, {__self: undefined, __source: {fileName: _jsxFileName$b, lineNumber:
|
|
25526
|
-
, React$1.createElement(Table, {__self: undefined, __source: {fileName: _jsxFileName$b, lineNumber:
|
|
25527
|
-
, React$1.createElement('thead', {__self: undefined, __source: {fileName: _jsxFileName$b, lineNumber:
|
|
25528
|
-
, React$1.createElement('tr', { className: "rounded-row", __self: undefined, __source: {fileName: _jsxFileName$b, lineNumber:
|
|
25549
|
+
, React$1.createElement(TableContainer$1, {__self: undefined, __source: {fileName: _jsxFileName$b, lineNumber: 46}}
|
|
25550
|
+
, React$1.createElement(Table, {__self: undefined, __source: {fileName: _jsxFileName$b, lineNumber: 47}}
|
|
25551
|
+
, React$1.createElement('thead', {__self: undefined, __source: {fileName: _jsxFileName$b, lineNumber: 48}}
|
|
25552
|
+
, React$1.createElement('tr', { className: "rounded-row", __self: undefined, __source: {fileName: _jsxFileName$b, lineNumber: 49}}
|
|
25529
25553
|
, thead.map((item,index) => (
|
|
25530
25554
|
React$1.createElement('th', { key: index, onClick: ()=>{
|
|
25531
25555
|
sortByColumn(item.dataKey);
|
|
25532
|
-
}, __self: undefined, __source: {fileName: _jsxFileName$b, lineNumber:
|
|
25556
|
+
}, __self: undefined, __source: {fileName: _jsxFileName$b, lineNumber: 51}}, item.label)
|
|
25533
25557
|
))
|
|
25534
25558
|
)
|
|
25535
25559
|
)
|
|
25536
|
-
, React$1.createElement('tbody', { className: "rounded-row", __self: undefined, __source: {fileName: _jsxFileName$b, lineNumber:
|
|
25560
|
+
, React$1.createElement('tbody', { className: "rounded-row", __self: undefined, __source: {fileName: _jsxFileName$b, lineNumber: 57}}
|
|
25537
25561
|
, children
|
|
25538
25562
|
, !children && tbodyItems && tbodyItems.map((item,index) => (
|
|
25539
25563
|
React$1.createElement('tr', { key: index, className: clickedRow && 'clickable', onClick: ()=>{
|
|
25540
25564
|
if (clickedRow) {
|
|
25541
25565
|
clickedRow(item);
|
|
25542
|
-
}}, __self: undefined, __source: {fileName: _jsxFileName$b, lineNumber:
|
|
25566
|
+
}}, __self: undefined, __source: {fileName: _jsxFileName$b, lineNumber: 60}}
|
|
25543
25567
|
, thead.map((cellItem,index) => (
|
|
25544
|
-
React$1.createElement('td', { key: index, className: (index == thead.length - 1 && clickedRow) ? 'with-arrow' : '', __self: undefined, __source: {fileName: _jsxFileName$b, lineNumber:
|
|
25545
|
-
, React$1.createElement('span', {__self: undefined, __source: {fileName: _jsxFileName$b, lineNumber:
|
|
25568
|
+
React$1.createElement('td', { key: index, className: (index == thead.length - 1 && clickedRow) ? 'with-arrow' : '', __self: undefined, __source: {fileName: _jsxFileName$b, lineNumber: 65}}
|
|
25569
|
+
, React$1.createElement('span', {__self: undefined, __source: {fileName: _jsxFileName$b, lineNumber: 66}}
|
|
25546
25570
|
, item[cellItem.dataKey]
|
|
25547
25571
|
)
|
|
25548
25572
|
, (index == thead.length - 1 && clickedRow) &&
|
|
25549
|
-
React$1.createElement('svg', { width: "16", height: "16", viewBox: "0 0 16 16" , fill: "none", xmlns: "http://www.w3.org/2000/svg", __self: undefined, __source: {fileName: _jsxFileName$b, lineNumber:
|
|
25550
|
-
, React$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: undefined, __source: {fileName: _jsxFileName$b, lineNumber:
|
|
25573
|
+
React$1.createElement('svg', { width: "16", height: "16", viewBox: "0 0 16 16" , fill: "none", xmlns: "http://www.w3.org/2000/svg", __self: undefined, __source: {fileName: _jsxFileName$b, lineNumber: 70}}
|
|
25574
|
+
, React$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: undefined, __source: {fileName: _jsxFileName$b, lineNumber: 71}})
|
|
25551
25575
|
)
|
|
25552
25576
|
|
|
25553
25577
|
)
|
|
@@ -25561,7 +25585,7 @@ const TablePrimary = (props) => {
|
|
|
25561
25585
|
React$1.createElement(Pagination, { itemsPerPage: itemsPerPage, items: tbodyOri, paginatedItems: (arr)=>{
|
|
25562
25586
|
setTbodyItems(arr);
|
|
25563
25587
|
paginatedItems(arr);
|
|
25564
|
-
}, __self: undefined, __source: {fileName: _jsxFileName$b, lineNumber:
|
|
25588
|
+
}, __self: undefined, __source: {fileName: _jsxFileName$b, lineNumber: 82}})
|
|
25565
25589
|
|
|
25566
25590
|
)
|
|
25567
25591
|
)
|
|
@@ -25729,19 +25753,19 @@ const Selector = (props) => {
|
|
|
25729
25753
|
|
|
25730
25754
|
React$1.useEffect(()=>{
|
|
25731
25755
|
if (value){
|
|
25732
|
-
if (Array.isArray(value)){
|
|
25756
|
+
if (Array.isArray(value) && value.length > 0){
|
|
25733
25757
|
setSelectedOptions(value);
|
|
25734
25758
|
}else {
|
|
25735
25759
|
let inArray = false;
|
|
25736
25760
|
|
|
25737
|
-
if (value.label){
|
|
25738
|
-
inArray = itemsList.some((item) => item.label.toLowerCase() === value.label.toLowerCase());
|
|
25761
|
+
if ((value ).label){
|
|
25762
|
+
inArray = itemsList.some((item) => item.label.toLowerCase() === (value ).label.toLowerCase());
|
|
25739
25763
|
}
|
|
25740
25764
|
|
|
25741
25765
|
if (inArray){
|
|
25742
25766
|
setSelectedOptions([value]);
|
|
25743
25767
|
}else {
|
|
25744
|
-
setOtherVal(value.label);
|
|
25768
|
+
setOtherVal((value ).label);
|
|
25745
25769
|
}
|
|
25746
25770
|
}
|
|
25747
25771
|
}
|