@feathery/react 2.23.6 → 2.24.0

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.
Files changed (93) hide show
  1. package/cjs/elements/basic/TableElement/Actions.d.ts.map +1 -1
  2. package/cjs/elements/basic/TableElement/Pagination.d.ts.map +1 -1
  3. package/cjs/elements/basic/TableElement/styles.d.ts +27 -17
  4. package/cjs/elements/basic/TableElement/styles.d.ts.map +1 -1
  5. package/cjs/elements/fields/PhoneField/index.d.ts.map +1 -1
  6. package/cjs/{fthry_FormControl.BSFeGfR_.js → fthry_FormControl.vbX2P0I_.js} +1 -1
  7. package/cjs/{fthry_InlineTooltip.DdmX24ud.js → fthry_InlineTooltip.D1378Y1g.js} +2 -2
  8. package/cjs/{fthry_Overlay.dLOs3POl.js → fthry_Overlay.DhlLdnah.js} +1 -1
  9. package/cjs/{fthry_PaymentMethodField.B4hPg2W5.js → fthry_PaymentMethodField.QimHHZqH.js} +4 -4
  10. package/cjs/{fthry_Placeholder.CGG1eUWI.js → fthry_Placeholder.8Y7RwhTl.js} +1 -1
  11. package/cjs/{fthry_ShowEyeIcon.CqkQEvU3.js → fthry_ShowEyeIcon.CVTdgP0w.js} +1 -1
  12. package/cjs/{fthry_index.H0oI-pdw.js → fthry_index.0D8qcou0.js} +1 -1
  13. package/cjs/{fthry_index.Czm7tOJN.js → fthry_index.AMOwVXhk.js} +1 -1
  14. package/cjs/{fthry_index.DxydBYq9.js → fthry_index.B5Drq9vz.js} +5 -5
  15. package/cjs/{fthry_index.BMCo2zda.js → fthry_index.B9zwDhKc.js} +6 -6
  16. package/cjs/{fthry_index.B6OWca6B.js → fthry_index.BJSwRzFN.js} +5 -5
  17. package/cjs/{fthry_index.DRD0iTwt.js → fthry_index.BPfxLXMg.js} +35 -38
  18. package/cjs/{fthry_index.BqNLbMy7.js → fthry_index.Be1iNDQE.js} +1 -1
  19. package/cjs/{fthry_index.Ba5C9yId.js → fthry_index.BevZemwD.js} +6 -6
  20. package/cjs/{fthry_index.DC19EIx0.js → fthry_index.C2VUNz1O.js} +35 -15
  21. package/cjs/{fthry_index.CyaIdx9V.js → fthry_index.C97GC1Lu.js} +4 -4
  22. package/cjs/{fthry_index.CWjgaGDT.js → fthry_index.CoyBGmN7.js} +1 -1
  23. package/cjs/{fthry_index.DzZDhazI.js → fthry_index.Cwnl6Jru.js} +1 -1
  24. package/cjs/{fthry_index.Srl5eYm5.js → fthry_index.D76gElBb.js} +1 -1
  25. package/cjs/{fthry_index.BdTls4Lg.js → fthry_index.DS9mjpSE.js} +2 -2
  26. package/cjs/{fthry_index.CLUV_Y9k.js → fthry_index.DUzUC0Nl.js} +1 -1
  27. package/cjs/{fthry_index.CWlKeuqz.js → fthry_index.DYnHPsYG.js} +5 -5
  28. package/cjs/{fthry_index.BlbuXVF3.js → fthry_index.DoVLlKXI.js} +1 -1
  29. package/cjs/{fthry_index.B-tGwDjz.js → fthry_index.DxxEYM24.js} +3 -3
  30. package/cjs/{fthry_index.COIyjfXF.js → fthry_index.Fi-el7Xn.js} +3 -3
  31. package/cjs/{fthry_index.CAGAOhTh.js → fthry_index.Op6hP0Wx.js} +6 -6
  32. package/cjs/{fthry_index.CIAaigRJ.js → fthry_index.QuNimvtq.js} +4 -4
  33. package/cjs/{fthry_index.BMhDSvsN.js → fthry_index.WHMwSaaK.js} +2 -2
  34. package/cjs/{fthry_index.FziiiLJL.js → fthry_index.Z8k0J5TH.js} +54 -22
  35. package/cjs/{fthry_index.D4Iu9UG6.js → fthry_index.acd9c8KU.js} +4 -4
  36. package/cjs/{fthry_index.vuYMQcab.js → fthry_index.w7es6wJA.js} +8 -8
  37. package/cjs/{fthry_input.3eZioCQX.js → fthry_input.Bd5X8-FP.js} +1 -1
  38. package/cjs/{fthry_script.B0ZxbIbw.js → fthry_script.CdRA-K9H.js} +1 -1
  39. package/cjs/{fthry_styles.DDrbD7PV.js → fthry_styles.B3BfcPaL.js} +1 -1
  40. package/cjs/{fthry_useElementSize.DnuxzPqr.js → fthry_useElementSize.Cqwz6OB6.js} +1 -1
  41. package/cjs/{fthry_useSalesforceSync.uOFzu2dA.js → fthry_useSalesforceSync.CDuqbdgb.js} +1 -1
  42. package/cjs/{fthry_webfontloader.nyXgbNFp.js → fthry_webfontloader.C696SV-4.js} +1 -1
  43. package/cjs/index.js +1 -1
  44. package/cjs/utils/featheryClient/index.d.ts.map +1 -1
  45. package/dist/elements/basic/TableElement/Actions.d.ts.map +1 -1
  46. package/dist/elements/basic/TableElement/Pagination.d.ts.map +1 -1
  47. package/dist/elements/basic/TableElement/styles.d.ts +27 -17
  48. package/dist/elements/basic/TableElement/styles.d.ts.map +1 -1
  49. package/dist/elements/fields/PhoneField/index.d.ts.map +1 -1
  50. package/dist/{fthry_FormControl.BWQA5b0y.js → fthry_FormControl.XNq3-cui.js} +1 -1
  51. package/dist/{fthry_InlineTooltip.BZLGojXl.js → fthry_InlineTooltip.DGHEvC_N.js} +2 -2
  52. package/dist/{fthry_Overlay.Dtxj6U3L.js → fthry_Overlay.J6bfxjB6.js} +1 -1
  53. package/dist/{fthry_PaymentMethodField.C-mD7K2W.js → fthry_PaymentMethodField.CDQLu6HD.js} +4 -4
  54. package/dist/{fthry_Placeholder.hAt5rBVS.js → fthry_Placeholder.Mlmdw3dr.js} +1 -1
  55. package/dist/{fthry_ShowEyeIcon.C9RMRr7X.js → fthry_ShowEyeIcon.DP57fwQm.js} +1 -1
  56. package/dist/{fthry_index.BLC4N3MM.js → fthry_index.B1mI_nkL.js} +5 -5
  57. package/dist/{fthry_index.Cnj3D2sE.js → fthry_index.BIJhafFv.js} +4 -4
  58. package/dist/{fthry_index.C0uIFVvg.js → fthry_index.BdqBOOCg.js} +4 -4
  59. package/dist/{fthry_index.DsD0fPig.js → fthry_index.Bdu4nau6.js} +1 -1
  60. package/dist/{fthry_index.BXgOTSKx.js → fthry_index.BfQjfY-v.js} +54 -22
  61. package/dist/{fthry_index.M__FBiFq.js → fthry_index.Bn5uzN59.js} +5 -5
  62. package/dist/{fthry_index.C1M4obTx.js → fthry_index.C-djGiaS.js} +2 -2
  63. package/dist/{fthry_index.BHy82_xs.js → fthry_index.C0Dov5nE.js} +3 -3
  64. package/dist/{fthry_index.oi3hyRpZ.js → fthry_index.C5VHKe3D.js} +2 -2
  65. package/dist/{fthry_index.BOupY-M9.js → fthry_index.CA1Bdo9s.js} +4 -4
  66. package/dist/{fthry_index.D3AC3IRu.js → fthry_index.CBqbHxMx.js} +35 -15
  67. package/dist/{fthry_index.CDTlE3iz.js → fthry_index.C_GjXlZr.js} +5 -5
  68. package/dist/{fthry_index.B-icxM59.js → fthry_index.CrRjSHn5.js} +1 -1
  69. package/dist/{fthry_index.DsqQfUyE.js → fthry_index.Cu45IR9p.js} +1 -1
  70. package/dist/{fthry_index.C0qPFRWZ.js → fthry_index.CvvMEgBS.js} +1 -1
  71. package/dist/{fthry_index.DkySqYis.js → fthry_index.Cw42Sncj.js} +35 -38
  72. package/dist/{fthry_index.CZG2sz8l.js → fthry_index.CzM_hr1x.js} +3 -3
  73. package/dist/{fthry_index.BLWtc8eL.js → fthry_index.CzvRN7bv.js} +6 -6
  74. package/dist/{fthry_index.BESTuSD0.js → fthry_index.D52ARHUD.js} +6 -6
  75. package/dist/{fthry_index.m_O5twIG.js → fthry_index.D9Soe4dO.js} +1 -1
  76. package/dist/{fthry_index.BD_dUvCa.js → fthry_index.DE_JfnGK.js} +1 -1
  77. package/dist/{fthry_index.CpjGr8XJ.js → fthry_index.DsfZyITQ.js} +1 -1
  78. package/dist/{fthry_index.BRaDez8A.js → fthry_index.LEBoicJ3.js} +6 -6
  79. package/dist/{fthry_index.CioL9mXh.js → fthry_index.RUzLaqoe.js} +8 -8
  80. package/dist/{fthry_index.UjyJiWL6.js → fthry_index.drUEPtsd.js} +1 -1
  81. package/dist/{fthry_input.CabnFCSi.js → fthry_input.7cjySaDO.js} +1 -1
  82. package/dist/{fthry_script.DPOcbAqz.js → fthry_script.Bp60MFMf.js} +1 -1
  83. package/dist/{fthry_styles.C2mCy0WK.js → fthry_styles.COD2mOPV.js} +1 -1
  84. package/dist/{fthry_useElementSize.secLYB15.js → fthry_useElementSize.CmRwN1ei.js} +1 -1
  85. package/dist/{fthry_useSalesforceSync.Cpjc7KyH.js → fthry_useSalesforceSync.BVgXZfea.js} +1 -1
  86. package/dist/{fthry_webfontloader.ZS2IvgfF.js → fthry_webfontloader.BkfUAKKA.js} +1 -1
  87. package/dist/index.js +1 -1
  88. package/dist/utils/featheryClient/index.d.ts.map +1 -1
  89. package/package.json +2 -2
  90. package/umd/{PhoneField.42eae8ec161c28522777.js → PhoneField.7475243ed9d9c7374c28.js} +1 -1
  91. package/umd/TableElement.ee77e0f53a9ccac846ab.js +1 -0
  92. package/umd/index.js +1 -1
  93. package/umd/TableElement.8380efafa84627d75ce9.js +0 -1
@@ -1 +0,0 @@
1
- "use strict";(this.webpackChunkFeathery=this.webpackChunkFeathery||[]).push([[844],{6056:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Se});var n=r(5944),o=r(7294),i=r(426),a=function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)},l="#ffffff",c="#f9fafb",s="#f3f4f6",u="#e5e7eb",d="#9ca3af",f="#4b5563",p="#111827",h="#1d4ed8",g={width:"16px",height:"16px",color:"#6b7280"},v={display:"flex",flexDirection:"column",gap:"2px","& svg":{marginInlineStart:"4px",width:"20px",height:"20px"}},y={width:"12px",height:"12px",color:d,opacity:.3,'&[data-active="true"]':{color:h,opacity:1}},b={display:"flex",alignItems:"center",gap:"8px"},m={position:"relative",overflowX:"auto",overflowY:"auto",backgroundColor:l,boxShadow:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",borderRadius:"8px",border:"1px solid ".concat(u),minWidth:"100%",maxWidth:"100%",height:"100%",boxSizing:"border-box"},x={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"64px 24px",textAlign:"center"},w={color:f,fontSize:"16px",fontWeight:"500",margin:0},C={padding:"16px",borderBottom:"1px solid ".concat(u)},k={position:"relative"},S={position:"absolute",top:0,bottom:0,left:0,display:"flex",alignItems:"center",paddingLeft:"12px",pointerEvents:"none"},Z={display:"block",width:"100%",maxWidth:"384px",paddingLeft:"36px",paddingRight:"12px",paddingTop:"10px",paddingBottom:"10px",backgroundColor:c,border:"1px solid ".concat(u),color:p,fontSize:"14px",borderRadius:"8px",boxShadow:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",boxSizing:"border-box"},_={width:"100%",maxWidth:"100%",fontSize:"14px",textAlign:"left",color:f,textIndent:0,borderColor:"inherit",borderCollapse:"collapse"},P={fontSize:"14px",color:f,backgroundColor:c,borderBottom:"1px solid ".concat(u)},I={padding:"12px 24px",fontWeight:"500",userSelect:"none"},R={backgroundColor:l,borderBottom:"1px solid ".concat(u),transition:"background-color 0.2s"},A={padding:"16px 24px",wordBreak:"break-word",overflowWrap:"anywhere"},B={display:"flex",alignItems:"center",flexWrap:"wrap",justifyContent:"space-between",padding:"16px",gap:"8px"},L={fontSize:"14px",fontWeight:"normal",color:f},T={fontWeight:"600",color:p},j={display:"flex",marginLeft:"-1px",fontSize:"14px",listStyle:"none",padding:0,margin:0},D={display:"flex",alignItems:"center",justifyContent:"center",color:f,backgroundColor:c,boxSizing:"border-box",border:"1px solid ".concat(u),fontWeight:"500",fontSize:"14px",textDecoration:"none",cursor:"pointer",height:"36px",wordBreak:"keep-all",overflowWrap:"normal","&:hover":{backgroundColor:s,color:p},"&:disabled:hover":{color:f,backgroundColor:c,cursor:"auto"}},M=a(a({},D),{borderRadius:"4px",paddingInline:"8px",width:"auto",height:"28px",position:"relative"}),O={width:"16px",height:"16px",color:f},W={position:"fixed",backgroundColor:l,border:"1px solid ".concat("#d1d5db"),borderRadius:"4px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)",zIndex:9999,minWidth:"120px"},X={display:"block",width:"100%",textAlign:"left",paddingLeft:"12px",paddingRight:"12px",paddingTop:"8px",paddingBottom:"8px",fontSize:"14px",color:"#374151",backgroundColor:"transparent",border:"none",cursor:"pointer",whiteSpace:"nowrap",position:"relative","&:hover":{backgroundColor:s},"&:disabled:hover":{backgroundColor:"transparent",cursor:"auto"},"&:first-of-type":{borderTopLeftRadius:"4px",borderTopRightRadius:"4px"},"&:last-of-type":{borderBottomLeftRadius:"4px",borderBottomRightRadius:"4px"}},N=a(a({},M),{aspectRatio:1,paddingLeft:0,paddingRight:0}),z={display:"flex",gap:"8px",justifyContent:"flex-end"},E=a(a({},D),{width:"36px",borderRightWidth:0}),F=a(a({},E),{borderTopLeftRadius:"8px",borderBottomLeftRadius:"8px",paddingLeft:"12px",paddingRight:"12px",width:"auto"}),V=a(a({},E),{borderTopRightRadius:"8px",borderBottomRightRadius:"8px",paddingLeft:"12px",paddingRight:"12px",width:"auto",borderRightWidth:1}),Q=a(a({},E),{color:h,backgroundColor:"#eff6ff",border:"1px solid ".concat(u)}),Y=a(a({},E),{cursor:"default","&:focus":{outline:"none"}}),H={opacity:.8,cursor:"default",color:d,"&:hover":{backgroundColor:c,color:d}},$=function(){return $=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},$.apply(this,arguments)};function q(){return(0,n.tZ)("svg",$({css:g,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2},{children:(0,n.tZ)("path",{strokeLinecap:"round",d:"M21 21l-3.5-3.5M17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"})}))}function K(e){var t=e.searchQuery,r=e.onSearchChange;return(0,n.tZ)("div",$({css:C},{children:(0,n.BX)("div",$({css:k},{children:[(0,n.tZ)("div",$({css:S},{children:(0,n.tZ)(q,{})})),(0,n.tZ)("input",{type:"text",css:Z,placeholder:"Search",value:t,onChange:function(e){return r(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&e.preventDefault()}})]}))}))}var G=function(){return G=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},G.apply(this,arguments)};function J(e){var t=e.isSorted,r=e.sortDirection;return(0,n.BX)("svg",G({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},{children:[(0,n.tZ)("path",{css:y,stroke:"currentColor","data-active":t&&"asc"===r||void 0,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"m8 9 4-4 4 4"}),(0,n.tZ)("path",{css:y,stroke:"currentColor","data-active":t&&"desc"===r||void 0,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"m8 15 4 4 4-4"})]}))}function U(e){var t=e.columns,r=e.enableSort,o=e.sortColumn,i=e.sortDirection,a=e.onSort,l=e.styles;return(0,n.tZ)(n.HY,{children:t.map((function(e,t){var c=r,s=o===e.name,u=0===t;return(0,n.tZ)("th",G({scope:"col",onClick:function(){return c&&a(e.name)},css:G(G(G(G({},I),u?{}:{paddingLeft:0}),l.getTarget("th")),c?{cursor:"pointer"}:{})},{children:(0,n.BX)("div",G({css:b},{children:[(0,n.tZ)("span",{children:e.name}),c&&(0,n.tZ)("span",G({css:v},{children:(0,n.tZ)(J,{isSorted:s,sortDirection:i})}))]}))}),t)}))})}var ee=function(){return ee=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ee.apply(this,arguments)};function te(e){var t=e.currentPage,r=e.totalItems,o=e.rowsPerPage;return(0,n.BX)("span",ee({css:L},{children:["Showing"," ",(0,n.BX)("span",ee({css:T},{children:[t*o+1,"-",Math.min((t+1)*o,r)]}))," ","of ",(0,n.tZ)("span",ee({css:T},{children:r}))]}))}function re(e){var t=e.disabled,r=e.onClick;return(0,n.tZ)("button",ee({type:"button",onClick:r,disabled:t,css:ee(ee({},F),t?H:{})},{children:"Previous"}))}function ne(e){var t=e.disabled,r=e.onClick;return(0,n.tZ)("button",ee({type:"button",onClick:r,disabled:t,css:ee(ee({},V),t?H:{})},{children:"Next"}))}function oe(e){var t=e.currentPage,r=e.totalPages,o=e.onPageChange;return(0,n.tZ)(n.HY,{children:Array.from({length:r},(function(e,i){var a=0===i||i===r-1||Math.abs(i-t)<=1;if(1===i&&t>2||i===r-2&&t<r-3)return(0,n.tZ)("li",{children:(0,n.tZ)("button",ee({type:"button",disabled:!0,css:Y},{children:"..."}))},i);if(!a)return null;var l=i===t;return(0,n.tZ)("li",{children:(0,n.tZ)("button",ee({type:"button",onClick:function(){return o(i)},"aria-current":l?"page":void 0,css:l?Q:E},{children:i+1}))},i)}))})}function ie(e){var t=e.currentPage,r=e.totalPages,o=e.totalItems,i=e.rowsPerPage,a=e.onPageChange;return r<=1?null:(0,n.BX)("nav",ee({css:B,"aria-label":"Table navigation"},{children:[(0,n.tZ)(te,{currentPage:t,totalItems:o,rowsPerPage:i}),(0,n.BX)("ul",ee({css:j},{children:[(0,n.tZ)("li",{children:(0,n.tZ)(re,{disabled:0===t,onClick:function(){return a(Math.max(0,t-1))}})}),(0,n.tZ)(oe,{currentPage:t,totalPages:r,onPageChange:a}),(0,n.tZ)("li",{children:(0,n.tZ)(ne,{disabled:t>=r-1,onClick:function(){a(Math.min(r-1,t+1))}})})]}))]}))}var ae=r(3935),le=r(1142),ce=r(9479),se=function(){return se=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},se.apply(this,arguments)},ue=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a};function de(){return(0,n.BX)("svg",se({css:O,fill:"currentColor",viewBox:"0 0 24 24"},{children:[(0,n.tZ)("circle",{cx:"12",cy:"5",r:"2"}),(0,n.tZ)("circle",{cx:"12",cy:"12",r:"2"}),(0,n.tZ)("circle",{cx:"12",cy:"19",r:"2"})]}))}function fe(e){var t,r,i,a=e.actions,l=e.rowIndex,c=e.columnData,s=e.fieldValues,u=e.onClick,d=e.forceInlineButtons,f=void 0!==d&&d,p=e.tableId,h=void 0===p?"":p,g=e.buttonLoaders,v=void 0===g?{}:g;if(0===a.length)return null;var y=ue((0,o.useState)(!1),2),b=y[0],m=y[1],x=ue((0,o.useState)({top:0,left:0}),2),w=x[0],C=x[1],k=(0,o.useRef)(null),S=(0,o.useRef)(null),Z=(0,o.useRef)(null),_=!f&&a.length>1;(0,o.useEffect)((function(){var e=function(e){S.current&&!S.current.contains(e.target)&&Z.current&&!Z.current.contains(e.target)&&m(!1)};return b&&(0,ce.me)().addEventListener("mousedown",e),function(){(0,ce.me)().removeEventListener("mousedown",e)}}),[b]);var P=function(e){m(!1);var t=s||le.u4,r={};c.forEach((function(e){var n=t[e.field_key],o=Array.isArray(n)?n[l]:n;r[e.name]=o})),u({action:e.label,rowIndex:l,rowData:r})},I=null!==(i=null===(r=v["".concat(h,"_").concat(l,"_").concat(null===(t=a.find((function(e){var t,r="".concat(h,"_").concat(l,"_").concat(e.label);return null===(t=v[r])||void 0===t?void 0:t.loader})))||void 0===t?void 0:t.label)])||void 0===r?void 0:r.loader)&&void 0!==i?i:null;return(0,n.tZ)("div",se({ref:k,css:z},{children:_?(0,n.BX)(n.HY,{children:[(0,n.tZ)("button",se({ref:Z,type:"button",disabled:I,onClick:function(e){e.stopPropagation(),function(){if(!b&&Z.current){var e=Z.current.getBoundingClientRect();C({top:e.bottom+4,left:e.right})}m(!b)}()},css:N},{children:I?(0,n.tZ)("div",se({style:{height:"16px",width:"16px",display:"flex",alignItems:"center",justifyContent:"center"}},{children:I})):(0,n.tZ)(de,{})})),b&&(0,ae.createPortal)((0,n.tZ)("div",se({ref:S,css:se(se({},W),{top:"".concat(w.top,"px"),left:"".concat(w.left,"px"),transform:"translateX(-100%)"})},{children:a.map((function(e,t){var r=Object.keys(v).length>0;return(0,n.tZ)("button",se({type:"button",onClick:function(t){t.stopPropagation(),P(e)},css:X,disabled:r},{children:e.label}),t)}))})),(0,ce.me)().body)]}):a.map((function(e,t){var r,o="".concat(h,"_").concat(l,"_").concat(e.label),i=null===(r=v[o])||void 0===r?void 0:r.loader,a=Object.keys(v).length>0;return(0,n.BX)("button",se({type:"button",onClick:function(t){t.stopPropagation(),P(e)},css:M,disabled:a},{children:[(0,n.tZ)("span",se({style:{visibility:i?"hidden":"visible"}},{children:e.label})),i&&(0,n.tZ)("div",se({style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",height:"16px",width:"16px"}},{children:i}))]}),t)}))}))}var pe=function(){return pe=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},pe.apply(this,arguments)};function he(e){var t=e.hasSearchQuery;return(0,n.BX)("div",pe({css:x},{children:[t&&(0,n.tZ)("svg",pe({css:{width:"48px",height:"48px",color:"#9ca3af",marginBottom:"16px"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5},{children:(0,n.tZ)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"})})),(0,n.tZ)("p",pe({css:w},{children:t?"No results found":"No data available"})),t&&(0,n.tZ)("p",pe({css:pe(pe({},w),{fontSize:"14px",marginTop:"8px"})},{children:"Try adjusting your search query"}))]}))}var ge=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a};function ve(e){var t,r=function(e){if(null==e||""===e)return null;var t=String(e).trim().replace(/[$€£¥]/g,"").replace(/[,%]/g,"").replace(/\s/g,""),r=parseFloat(t);return isNaN(r)?null:r}(e),n=function(e){var t,r,n,o;if(null==e||""===e)return null;var i=String(e).trim(),a=new Date(i);if(!isNaN(a.getTime()))return a;try{for(var l=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}([/^(\d{1,2})[/-](\d{1,2})[/-](\d{2,4})$/,/^(\d{4})[/-](\d{1,2})[/-](\d{1,2})$/]),c=l.next();!c.done;c=l.next()){var s=c.value,u=i.match(s);if(u){var d=void 0,f=void 0,p=void 0;4===u[1].length?(d=(n=ge(u,4))[1],f=n[2],p=n[3]):(f=(o=ge(u,4))[1],p=o[2],d=o[3]),2===d.length&&(d=parseInt(d)<50?"20".concat(d):"19".concat(d));var h=new Date(parseInt(d),parseInt(f)-1,parseInt(p));if(!isNaN(h.getTime()))return h}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return null}(e);return{original:e,asNumber:r,asDate:n,asString:null!==(t=(0,i.e7)(e))&&void 0!==t?t:""}}function ye(e,t){return null!==e.asNumber&&null!==t.asNumber?e.asNumber-t.asNumber:null!==e.asDate&&null!==t.asDate?e.asDate.getTime()-t.asDate.getTime():e.asString.localeCompare(t.asString)}var be=function(){return be=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},be.apply(this,arguments)},me=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},xe=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},we=function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};function Ce(e){return"".concat("__feathery_table_page_").concat(e)}var ke=function(){return ke=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ke.apply(this,arguments)};const Se=function(e){var t=e.element,r=e.responsiveStyles,a=e.onClick,l=void 0===a?function(){}:a,c=e.editMode,s=void 0!==c&&c,u=e.buttonLoaders,d=void 0===u?{}:u,f=(0,o.useMemo)((function(){return function(e){return e.addTargets("table","thead","tbody","th","td","tr"),e}(r)}),[r]),p=function(e){var t,r,n,a,l,c,s,u,d,f,p=e.element,h=e.editMode,g=void 0!==h&&h,v=(null===(t=p.properties)||void 0===t?void 0:t.columns)||[],y=((null===(r=p.properties)||void 0===r?void 0:r.actions)||[]).filter((function(e){return e.label&&""!==e.label.trim()})),b=null!==(a=null===(n=p.properties)||void 0===n?void 0:n.search)&&void 0!==a&&a,m=null!==(c=null===(l=p.properties)||void 0===l?void 0:l.sort)&&void 0!==c&&c,x=null!==(u=null===(s=p.properties)||void 0===s?void 0:s.transpose)&&void 0!==u&&u,w=null!==(f=null===(d=p.properties)||void 0===d?void 0:d.pagination)&&void 0!==f?f:0,C="number"==typeof w&&w>0?Math.floor(w):0,k=C>0,S=(0,o.useMemo)((function(){var e=v;return g&&(e=e.map((function(e,t){return be(be({},e),{field_key:"example_column_".concat(t)})}))),e}),[g,v]),Z=(0,o.useMemo)((function(){return g?function(e,t){void 0===t&&(t=2);var r={};return e.forEach((function(e){r[e.field_key]=Array(t).fill("Sample")})),r}(S):le.u4}),[g,S,v.length]),_=xe((0,o.useState)(""),2),P=_[0],I=_[1],R=xe((0,o.useState)(null),2),A=R[0],B=R[1],L=xe((0,o.useState)("asc"),2),T=L[0],j=L[1],D=xe((0,o.useState)((function(){return function(e){var t=Ce(e),r=sessionStorage.getItem(t);if(!r)return 0;var n=parseInt(r,10);return Number.isInteger(n)&&n>=0?n:0}(p.id)})),2),M=D[0],O=D[1],W=(0,o.useMemo)((function(){return S.reduce((function(e,t){var r=Z[t.field_key];return Array.isArray(r)?Math.max(e,r.length):e}),0)}),[S,Z]),X=(0,o.useMemo)((function(){return Array.from({length:W},(function(e,t){return t}))}),[W]),N=(0,o.useMemo)((function(){return x&&b&&P.trim()?X.filter((function(e){return S.some((function(t){var r,n=Z[t.field_key],o=Array.isArray(n)?n[e]:n;return(null!==(r=(0,i.e7)(o))&&void 0!==r?r:"").toLowerCase().includes(P.toLowerCase().trim())}))})):X}),[x,X,S,P,b,Z]),z=xe((0,o.useState)(null),2),E=z[0],F=z[1],V=(0,o.useMemo)((function(){if(!x||!m||null===E)return N;var e=S[E];return e?we([],xe(N),!1).sort((function(t,r){var n=Z[e.field_key],o=Array.isArray(n)?n[t]:n,i=Array.isArray(n)?n[r]:n,a=ye(ve(o),ve(i));return"asc"===T?a:-a})):N}),[x,N,E,T,S,Z,m]),Q=(0,o.useMemo)((function(){if(!x||!k)return V;var e=M*C,t=e+C;return V.slice(e,t)}),[x,V,M,C,k]),Y=(0,o.useMemo)((function(){if(!x||0===W)return{columns:S,activeFieldValues:Z,transposedRowIndices:[]};var e=function(e,t,r,n){var o,i,a,l,c,s,u=n||Array.from({length:r},(function(e,t){return t})),d=[{name:"",field_id:"_transpose_field_name",field_type:"text",field_key:"_transpose_field_name"}];try{for(var f=me(u),p=f.next();!p.done;p=f.next()){var h=p.value;d.push({name:"",field_id:"_transpose_row_".concat(h),field_type:"text",field_key:"_transpose_row_".concat(h),originalRowIndex:h})}}catch(e){o={error:e}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}var g={_transpose_field_name:e.map((function(e){return e.name}))};try{for(var v=me(u),y=v.next();!y.done;y=v.next()){h=y.value;var b=[];try{for(var m=(c=void 0,me(e)),x=m.next();!x.done;x=m.next()){var w=t[x.value.field_key],C=Array.isArray(w)?w[h]:w;b.push(C)}}catch(e){c={error:e}}finally{try{x&&!x.done&&(s=m.return)&&s.call(m)}finally{if(c)throw c.error}}g["_transpose_row_".concat(h)]=b}}catch(e){a={error:e}}finally{try{y&&!y.done&&(l=v.return)&&l.call(v)}finally{if(a)throw a.error}}return{transposedColumns:d,transposedFieldValues:g,includedRowIndices:u}}(S,Z,W,Q);return{columns:e.transposedColumns,activeFieldValues:e.transposedFieldValues,transposedRowIndices:e.includedRowIndices}}),[x,S,Z,W,Q]),H=Y.columns,$=Y.activeFieldValues,q=Y.transposedRowIndices,K=(0,o.useMemo)((function(){return H.reduce((function(e,t){var r=$[t.field_key];return Array.isArray(r)?Math.max(e,r.length):e}),0)}),[H,$]),G=(0,o.useMemo)((function(){return Array.from({length:K},(function(e,t){return t}))}),[K]),J=(0,o.useMemo)((function(){return x?G:b&&P.trim()?G.filter((function(e){return H.some((function(t){var r,n=$[t.field_key],o=Array.isArray(n)?n[e]:n;return(null!==(r=(0,i.e7)(o))&&void 0!==r?r:"").toLowerCase().includes(P.toLowerCase().trim())}))})):G}),[x,G,H,P,b,$]),U=(0,o.useMemo)((function(){if(x)return J;if(!m||!A)return J;var e=H.find((function(e){return e.name===A}));return e?we([],xe(J),!1).sort((function(t,r){var n=$[e.field_key],o=Array.isArray(n)?n[t]:n,i=Array.isArray(n)?n[r]:n,a=ye(ve(o),ve(i));return"asc"===T?a:-a})):J}),[x,J,A,T,H,m,$]),ee=(0,o.useMemo)((function(){if(x)return G;if(!k)return U;var e=M*C,t=e+C;return U.slice(e,t)}),[x,G,U,M,C,k]),te=(0,o.useRef)({initialMount:!0,search:"",sortColumn:"",sortDirection:""});(0,o.useEffect)((function(){var e=te.current;if(e.initialMount)return e.initialMount=!1,e.search=P,e.sortColumn=A,void(e.sortDirection=T);P===e.search&&A===e.sortColumn&&T===e.sortDirection||(O(0),e.search=P,e.sortColumn=A,e.sortDirection=T)}),[P,A,T]);var re=x?V.length:U.length,ne=k?Math.ceil(re/C):1;(0,o.useEffect)((function(){var e,t,r;p.id&&(e=p.id,t=M,r=Ce(e),sessionStorage.setItem(r,t.toString()))}),[p.id,M]),(0,o.useEffect)((function(){ne>0&&M>=ne&&O(ne-1)}),[ne]);var oe=K>0,ie=x?N.length>0:J.length>0;return{enableSearch:b,searchQuery:P,hasSearchResults:ie,setSearchQuery:I,enableSort:m,sortColumn:A,sortDirection:T,sortedColumnIndex:E,handleSort:function(e){m&&(A===e?"asc"===T?j("desc"):(B(null),j("asc")):(B(e),j("asc")))},handleTransposedSort:function(e){m&&x&&(E===e?"asc"===T?j("desc"):(F(null),j("asc")):(F(e),j("asc")))},enablePagination:k,currentPage:M,paginatedRowIndices:ee,rowsPerPage:C,setCurrentPage:O,columns:H,actions:y,isTransposed:x&&W>0,transposedRowIndices:q,totalRows:re,totalPages:ne,hasData:oe,activeFieldValues:$,baseColumns:S,baseFieldValues:Z}}({element:t,editMode:s}),h=p.enableSearch,g=p.searchQuery,y=p.setSearchQuery,x=p.enableSort,w=p.sortColumn,C=p.sortDirection,k=p.sortedColumnIndex,S=p.handleSort,Z=p.handleTransposedSort,B=p.enablePagination,L=p.currentPage,T=p.setCurrentPage,j=p.paginatedRowIndices,D=p.rowsPerPage,M=p.columns,O=p.actions,W=p.isTransposed,X=p.transposedRowIndices,N=p.totalRows,z=p.totalPages,E=p.hasData,F=p.hasSearchResults,V=p.activeFieldValues,Q=p.baseColumns,Y=p.baseFieldValues,H=!E||E&&!F;return(0,n.tZ)("div",ke({css:ke(ke({},m),f.getTarget("container"))},{children:(0,n.BX)("div",ke({css:{minWidth:"fit-content"}},{children:[h&&(0,n.tZ)(K,{searchQuery:g,onSearchChange:y}),H?(0,n.tZ)(he,{hasSearchQuery:g.trim().length>0}):(0,n.BX)("table",ke({css:ke(ke({},_),f.getTarget("table"))},{children:[!W&&(0,n.tZ)("thead",ke({css:P},{children:(0,n.BX)("tr",{children:[(0,n.tZ)(U,{columns:M,enableSort:x,sortColumn:w,sortDirection:C,onSort:S,styles:f}),O.length>0&&(0,n.tZ)("th",{scope:"col",css:ke(ke(ke({},I),{paddingLeft:0}),f.getTarget("th"))})]})})),(0,n.BX)("tbody",ke({css:f.getTarget("tbody")},{children:[j.map((function(e){var r={};return W||M.forEach((function(t){var n=V[t.field_key],o=Array.isArray(n)?n[e]:n;r[t.name]=o})),(0,n.BX)("tr",ke({css:ke(ke({},R),f.getTarget("tr")),onClick:function(){W||l({rowIndex:e,rowData:r})}},{children:[M.map((function(t,r){var o,a,c=V[t.field_key],s=Array.isArray(c)?c[e]:c,u=W&&0===r,d=u&&x,p=k===e,h=0===r,g=1===r,y=W&&!u?t.originalRowIndex:void 0,m=u?ke(ke(ke(ke({},I),{backgroundColor:"#f9fafb",borderRight:"1px solid #e5e7eb",width:"1px",whiteSpace:"nowrap"}),f.getTarget("th")),d?{cursor:"pointer"}:{}):ke(ke(ke(ke({},A),W?g?{}:{paddingLeft:0}:h?{}:{paddingLeft:0}),W&&!u?{cursor:"pointer"}:{}),f.getTarget("td")),w=u?"th":"td";return(0,n.tZ)(w,ke({css:m,onClick:function(t){if(d)Z(e);else if(W&&void 0!==y){t.stopPropagation();var r={};Q.forEach((function(e){var t=Y[e.field_key],n=Array.isArray(t)?t[y]:t;r[e.name]=n})),l({rowIndex:y,rowData:r})}}},u?{scope:"row"}:{},{children:u&&d?(0,n.BX)("div",ke({css:ke(ke({},b),{justifyContent:"space-between"})},{children:[(0,n.tZ)("span",{children:null!==(o=(0,i.e7)(s))&&void 0!==o?o:""}),(0,n.tZ)("span",ke({css:v},{children:(0,n.tZ)(J,{isSorted:p,sortDirection:C})}))]})):null!==(a=(0,i.e7)(s))&&void 0!==a?a:""}),r)})),!W&&O.length>0&&(0,n.tZ)("td",ke({css:ke(ke(ke({},A),{paddingLeft:0}),f.getTarget("td"))},{children:(0,n.tZ)(fe,{actions:O,rowIndex:e,columnData:Q,fieldValues:Y,onClick:l,tableId:t.id,buttonLoaders:d})}))]}),e)})),W&&O.length>0&&(0,n.BX)("tr",ke({css:ke(ke({},R),f.getTarget("tr"))},{children:[(0,n.tZ)("th",{scope:"row",css:ke(ke(ke({},I),{backgroundColor:"#f9fafb",borderRight:"1px solid #e5e7eb",width:"1px",whiteSpace:"nowrap"}),f.getTarget("th"))}),X.map((function(e,r){return(0,n.tZ)("td",ke({css:ke(ke(ke({},A),0===r?{}:{paddingLeft:0}),f.getTarget("td"))},{children:(0,n.tZ)("div",ke({css:{display:"flex",justifyContent:"flex-start"}},{children:(0,n.tZ)(fe,{actions:O,rowIndex:e,columnData:Q,fieldValues:Y,onClick:l,forceInlineButtons:!0,tableId:t.id,buttonLoaders:d})}))}),e)}))]}))]}))]})),!H&&B&&(0,n.tZ)(ie,{currentPage:L,totalPages:z,totalItems:N,rowsPerPage:D,onPageChange:T})]}))}))}}}]);