@secondstaxorg/sscomp 1.8.47 → 1.8.49

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
@@ -22244,17 +22244,19 @@ const TextField = (props) => {
22244
22244
  const textFieldRef = React$1.useRef();
22245
22245
 
22246
22246
  React$1.useEffect(()=>{
22247
- setInputVal(value );
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: 48}}
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: 50}}
22279
- , React$1.createElement('label', { className: "paragraph2Medium", __self: undefined, __source: {fileName: _jsxFileName$v, lineNumber: 51}}, label)
22280
- , subtext && React$1.createElement('span', { className: "paragraph1Regular", __self: undefined, __source: {fileName: _jsxFileName$v, lineNumber: 52}}, subtext)
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: 55}}
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: 56}})
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: 62}}
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: 64}}
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: 65}})
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: 67}}, errMsg) : React$1.createElement('span', { className: "paragraph1Regular", __self: undefined, __source: {fileName: _jsxFileName$v, lineNumber: 67}}, "This field is required" )
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
  )
@@ -25508,7 +25510,7 @@ const _jsxFileName$b = "D:\\SSX\\Project\\Component Library\\sscomp\\src\\compon
25508
25510
  * Default SSX table component
25509
25511
  */
25510
25512
  const TablePrimary = (props) => {
25511
- const {thead,children,tbody,clickedRow,showPagination,itemsPerPage} = props;
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);
25514
25516
 
@@ -25535,7 +25537,7 @@ const TablePrimary = (props) => {
25535
25537
  )
25536
25538
  , React$1.createElement('tbody', { className: "rounded-row", __self: undefined, __source: {fileName: _jsxFileName$b, lineNumber: 35}}
25537
25539
  , children
25538
- , tbodyItems && tbodyItems.map((item,index) => (
25540
+ , !children && tbodyItems && tbodyItems.map((item,index) => (
25539
25541
  React$1.createElement('tr', { key: index, className: clickedRow && 'clickable', onClick: ()=>{
25540
25542
  if (clickedRow) {
25541
25543
  clickedRow(item);
@@ -25558,7 +25560,10 @@ const TablePrimary = (props) => {
25558
25560
  )
25559
25561
  )
25560
25562
  , 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}})
25563
+ React$1.createElement(Pagination, { itemsPerPage: itemsPerPage, items: tbodyOri, paginatedItems: (arr)=>{
25564
+ setTbodyItems(arr);
25565
+ paginatedItems(arr);
25566
+ }, __self: undefined, __source: {fileName: _jsxFileName$b, lineNumber: 60}})
25562
25567
 
25563
25568
  )
25564
25569
  )
@@ -25726,19 +25731,19 @@ const Selector = (props) => {
25726
25731
 
25727
25732
  React$1.useEffect(()=>{
25728
25733
  if (value){
25729
- if (Array.isArray(value)){
25734
+ if (Array.isArray(value) && value.length > 0){
25730
25735
  setSelectedOptions(value);
25731
25736
  }else {
25732
25737
  let inArray = false;
25733
25738
 
25734
- if (value.label){
25735
- inArray = itemsList.some((item) => item.label.toLowerCase() === value.label.toLowerCase());
25739
+ if ((value ).label){
25740
+ inArray = itemsList.some((item) => item.label.toLowerCase() === (value ).label.toLowerCase());
25736
25741
  }
25737
25742
 
25738
25743
  if (inArray){
25739
25744
  setSelectedOptions([value]);
25740
25745
  }else {
25741
- setOtherVal(value.label);
25746
+ setOtherVal((value ).label);
25742
25747
  }
25743
25748
  }
25744
25749
  }