@feathery/react 2.16.4 → 2.17.1

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 (116) hide show
  1. package/cjs/Form/grid/Element/index.d.ts.map +1 -1
  2. package/cjs/Form/index.d.ts.map +1 -1
  3. package/cjs/elements/basic/TableElement/Actions.d.ts.map +1 -1
  4. package/cjs/elements/basic/TableElement/styles.d.ts +10 -4
  5. package/cjs/elements/basic/TableElement/styles.d.ts.map +1 -1
  6. package/cjs/{fthry_FormControl.Bgh-mIjy.js → fthry_FormControl.CGg0IeXr.js} +1 -1
  7. package/cjs/{fthry_InlineTooltip.auFs9a5s.js → fthry_InlineTooltip.P0bs46ac.js} +2 -2
  8. package/cjs/{fthry_Overlay.Bkd8kkoH.js → fthry_Overlay.YYMQ0rle.js} +1 -1
  9. package/cjs/{fthry_PaymentMethodField.CRU8I39r.js → fthry_PaymentMethodField.CkH4xfAT.js} +4 -4
  10. package/cjs/{fthry_Placeholder.DEgGUrBj.js → fthry_Placeholder.B3wxudxl.js} +1 -1
  11. package/cjs/{fthry_ShowEyeIcon.CtzgR1jF.js → fthry_ShowEyeIcon.Tz_ih5rK.js} +1 -1
  12. package/cjs/{fthry_index.CLXUeHKN.js → fthry_index.1MAhIX0W.js} +3 -3
  13. package/cjs/{fthry_index.CRDDr01i.js → fthry_index.4WkvE-YH.js} +8 -8
  14. package/cjs/{fthry_index.CVVkGWoS.js → fthry_index.AAoM4ARK.js} +1 -1
  15. package/cjs/{fthry_index.R4pSt2d2.js → fthry_index.B3Nxxram.js} +2 -2
  16. package/cjs/{fthry_index.Lkx3mO74.js → fthry_index.B3hbXn91.js} +4 -4
  17. package/cjs/{fthry_index.Blf8s7tI.js → fthry_index.B9dEQvKj.js} +5 -5
  18. package/cjs/{fthry_index.DSxgvkD6.js → fthry_index.BDLQgDdz.js} +6 -6
  19. package/cjs/{fthry_index.V5EVqSky.js → fthry_index.BMb8C3zB.js} +1 -1
  20. package/cjs/{fthry_index.DwLX_2Pg.js → fthry_index.BcXO_GGp.js} +6 -6
  21. package/cjs/{fthry_index.DsC9aI6w.js → fthry_index.BdRhmfps.js} +27 -20
  22. package/cjs/{fthry_index.C4sU4QL2.js → fthry_index.BigqliGp.js} +6 -6
  23. package/cjs/{fthry_index.CzboYjT9.js → fthry_index.C5sM9cV2.js} +4 -4
  24. package/cjs/{fthry_index.BgTQ1FlN.js → fthry_index.CORtDstR.js} +254 -200
  25. package/cjs/{fthry_index.KP0Ca3IU.js → fthry_index.CUL8hPrE.js} +3 -3
  26. package/cjs/{fthry_index.B2qUeiLW.js → fthry_index.CVYjh6Zs.js} +1 -1
  27. package/cjs/{fthry_index.BkrdVXlS.js → fthry_index.D1TUv38t.js} +1 -1
  28. package/cjs/{fthry_index.CLCxPTbZ.js → fthry_index.D2r7GgXn.js} +5 -5
  29. package/cjs/{fthry_index.oWGHOOOB.js → fthry_index.DH476wYp.js} +1 -1
  30. package/cjs/{fthry_index.Cp_TTbT2.js → fthry_index.DJnrLUVL.js} +2 -2
  31. package/cjs/{fthry_index.DrcVvx6M.js → fthry_index.DNET3Cav.js} +1 -1
  32. package/cjs/{fthry_index.D58YnjUa.js → fthry_index.Dey7yneu.js} +4 -4
  33. package/cjs/{fthry_index.DE8kmziv.js → fthry_index.MG424aMN.js} +5 -5
  34. package/cjs/{fthry_index.C2faZV4U.js → fthry_index.MrtH1Gel.js} +5 -5
  35. package/cjs/{fthry_index.CErXN5ib.js → fthry_index.mMYd51S5.js} +1 -1
  36. package/cjs/{fthry_input.BdPywaVl.js → fthry_input.C4SGzYQl.js} +1 -1
  37. package/cjs/{fthry_script.BvEAOIuu.js → fthry_script.DUTipoT7.js} +1 -1
  38. package/cjs/{fthry_styles.BnOkS_mr.js → fthry_styles.CFAKdAan.js} +1 -1
  39. package/cjs/{fthry_useElementSize._nmMVpU4.js → fthry_useElementSize.BtQK6i9p.js} +1 -1
  40. package/cjs/{fthry_useSalesforceSync.lNF_A1ej.js → fthry_useSalesforceSync.BUV5UUVK.js} +1 -1
  41. package/cjs/{fthry_webfontloader.BZzxrDoy.js → fthry_webfontloader.Cwoma3zP.js} +1 -1
  42. package/cjs/index.d.ts +1 -0
  43. package/cjs/index.d.ts.map +1 -1
  44. package/cjs/index.js +1 -1
  45. package/cjs/utils/error.d.ts +1 -3
  46. package/cjs/utils/error.d.ts.map +1 -1
  47. package/cjs/utils/featheryClient/index.d.ts.map +1 -1
  48. package/cjs/utils/featheryClient/integrationClient.d.ts +2 -1
  49. package/cjs/utils/featheryClient/integrationClient.d.ts.map +1 -1
  50. package/cjs/utils/featheryClient/utils.d.ts +1 -1
  51. package/cjs/utils/featheryClient/utils.d.ts.map +1 -1
  52. package/cjs/utils/formContext.d.ts +2 -1
  53. package/cjs/utils/formContext.d.ts.map +1 -1
  54. package/cjs/utils/internalState.d.ts +12 -0
  55. package/cjs/utils/internalState.d.ts.map +1 -1
  56. package/cjs/utils/offlineRequestHandler.d.ts.map +1 -1
  57. package/dist/Form/grid/Element/index.d.ts.map +1 -1
  58. package/dist/Form/index.d.ts.map +1 -1
  59. package/dist/elements/basic/TableElement/Actions.d.ts.map +1 -1
  60. package/dist/elements/basic/TableElement/styles.d.ts +10 -4
  61. package/dist/elements/basic/TableElement/styles.d.ts.map +1 -1
  62. package/dist/{fthry_FormControl.Wd2VCHPt.js → fthry_FormControl.Bioxj7wq.js} +1 -1
  63. package/dist/{fthry_InlineTooltip.D3ylgYg6.js → fthry_InlineTooltip.sJiz-yTZ.js} +2 -2
  64. package/dist/{fthry_Overlay.Bz5x-ENK.js → fthry_Overlay.CCU65uhM.js} +1 -1
  65. package/dist/{fthry_PaymentMethodField.CvChbYRg.js → fthry_PaymentMethodField.D351t5lU.js} +4 -4
  66. package/dist/{fthry_Placeholder.DQzBt8j6.js → fthry_Placeholder.D5xsGWT6.js} +1 -1
  67. package/dist/{fthry_ShowEyeIcon.C9zNt2Rx.js → fthry_ShowEyeIcon.DCre1ZOf.js} +1 -1
  68. package/dist/{fthry_index.trAJzW3J.js → fthry_index.51FWAy76.js} +6 -6
  69. package/dist/{fthry_index.qe9ZkKtP.js → fthry_index.6PhdBT7L.js} +3 -3
  70. package/dist/{fthry_index.DQZzSsuW.js → fthry_index.7smbCR3-.js} +5 -5
  71. package/dist/{fthry_index.CMkosVsI.js → fthry_index.B0ATnU9X.js} +1 -1
  72. package/dist/{fthry_index._BRuXPK7.js → fthry_index.B5gJtIjr.js} +5 -5
  73. package/dist/{fthry_index.DKGOaGCM.js → fthry_index.BBSWaOwU.js} +27 -20
  74. package/dist/{fthry_index.DR1bFoXt.js → fthry_index.Bam5r7n6.js} +6 -6
  75. package/dist/{fthry_index.DBoil0ob.js → fthry_index.Bea_tRX4.js} +1 -1
  76. package/dist/{fthry_index.B8xFLcFH.js → fthry_index.BlUnQrjf.js} +5 -5
  77. package/dist/{fthry_index.CRS1kqR5.js → fthry_index.C0bG11gb.js} +8 -8
  78. package/dist/{fthry_index.DgDP5DJn.js → fthry_index.C2w9x6iP.js} +4 -4
  79. package/dist/{fthry_index.CvA-hNZz.js → fthry_index.C6VNqhmD.js} +4 -4
  80. package/dist/{fthry_index.BGxTz3tO.js → fthry_index.CKp4eDpz.js} +5 -5
  81. package/dist/{fthry_index.DQZRjgq7.js → fthry_index.CMNWezqn.js} +4 -4
  82. package/dist/{fthry_index.BZaD9OWc.js → fthry_index.D6GwNGfH.js} +1 -1
  83. package/dist/{fthry_index.BGTWrYLi.js → fthry_index.DBYuRH02.js} +2 -2
  84. package/dist/{fthry_index.BaEZNStt.js → fthry_index.DO3vHeYe.js} +2 -2
  85. package/dist/{fthry_index.C7pfoDYO.js → fthry_index.DWjdqARb.js} +1 -1
  86. package/dist/{fthry_index.34WTfq_N.js → fthry_index.DkGL5tdN.js} +3 -3
  87. package/dist/{fthry_index.BcDHti-e.js → fthry_index.DvxZc_Uo.js} +1 -1
  88. package/dist/{fthry_index.lO5BG-D1.js → fthry_index.K2SSJIS_.js} +1 -1
  89. package/dist/{fthry_index.BOQHIUaq.js → fthry_index.hLsmydhA.js} +254 -200
  90. package/dist/{fthry_index.jDY08d87.js → fthry_index.skRpp8mY.js} +1 -1
  91. package/dist/{fthry_index.BqbKuP58.js → fthry_index.tduM4TFp.js} +6 -6
  92. package/dist/{fthry_input.IKXOLylO.js → fthry_input.BXzDNYjd.js} +1 -1
  93. package/dist/{fthry_script.Bh2Y_sWv.js → fthry_script.CzS4wRzm.js} +1 -1
  94. package/dist/{fthry_styles.BYvg16qE.js → fthry_styles.YqYePDRC.js} +1 -1
  95. package/dist/{fthry_useElementSize.CXuTu3xM.js → fthry_useElementSize.B4QMTDpv.js} +1 -1
  96. package/dist/{fthry_useSalesforceSync.B56mQC8q.js → fthry_useSalesforceSync.e2aqYcSo.js} +1 -1
  97. package/dist/{fthry_webfontloader.DbZ32V22.js → fthry_webfontloader.BIA_40Jh.js} +1 -1
  98. package/dist/index.d.ts +1 -0
  99. package/dist/index.d.ts.map +1 -1
  100. package/dist/index.js +1 -1
  101. package/dist/utils/error.d.ts +1 -3
  102. package/dist/utils/error.d.ts.map +1 -1
  103. package/dist/utils/featheryClient/index.d.ts.map +1 -1
  104. package/dist/utils/featheryClient/integrationClient.d.ts +2 -1
  105. package/dist/utils/featheryClient/integrationClient.d.ts.map +1 -1
  106. package/dist/utils/featheryClient/utils.d.ts +1 -1
  107. package/dist/utils/featheryClient/utils.d.ts.map +1 -1
  108. package/dist/utils/formContext.d.ts +2 -1
  109. package/dist/utils/formContext.d.ts.map +1 -1
  110. package/dist/utils/internalState.d.ts +12 -0
  111. package/dist/utils/internalState.d.ts.map +1 -1
  112. package/dist/utils/offlineRequestHandler.d.ts.map +1 -1
  113. package/package.json +2 -2
  114. package/umd/TableElement.8fe7915eeb32e23ba816.js +1 -0
  115. package/umd/index.js +1 -1
  116. package/umd/TableElement.36588e76b5cd28b8115b.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:()=>Ce});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",d="#e5e7eb",u="#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:u,opacity:.3,'&[data-active="true"]':{color:h,opacity:1}},b={display:"flex",alignItems:"center",gap:"8px"},x={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(d),minWidth:"100%",maxWidth:"100%",height:"100%",boxSizing:"border-box"},m={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"64px 24px",textAlign:"center"},w={color:f,fontSize:"16px",fontWeight:"500",margin:0},k={padding:"16px",borderBottom:"1px solid ".concat(d)},C={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(d),color:p,fontSize:"14px",borderRadius:"8px",boxShadow:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",boxSizing:"border-box"},P={width:"100%",maxWidth:"100%",fontSize:"14px",textAlign:"left",color:f,textIndent:0,borderColor:"inherit",borderCollapse:"collapse"},R={fontSize:"14px",color:f,backgroundColor:c,borderBottom:"1px solid ".concat(d)},_={padding:"12px 24px",fontWeight:"500",userSelect:"none"},I={backgroundColor:l,borderBottom:"1px solid ".concat(d),transition:"background-color 0.2s"},B={padding:"16px 24px",wordBreak:"break-word",overflowWrap:"anywhere"},A={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(d),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}},M=a(a({},D),{borderRadius:"4px",paddingInline:"8px",width:"auto",height:"28px",position:"relative"}),O={width:"16px",height:"16px",color:f},X={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"},W={display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"between",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"},"&:first-of-type":{borderTopLeftRadius:"4px",borderTopRightRadius:"4px"},"&:last-of-type":{borderBottomLeftRadius:"4px",borderBottomRightRadius:"4px"}},z=a(a({},M),{aspectRatio:1,paddingLeft:0,paddingRight:0}),N={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(d)}),Y=a(a({},E),{cursor:"default","&:focus":{outline:"none"}}),H={opacity:.8,cursor:"default",color:u,"&:hover":{backgroundColor:c,color:u}},$=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:k},{children:(0,n.BX)("div",$({css:C},{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,d=0===t;return(0,n.tZ)("th",G({scope:"col",onClick:function(){return c&&a(e.name)},css:G(G(G(G({},_),d?{}:{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:A,"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)},de=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 ue(){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=e.actions,r=e.rowIndex,i=e.columnData,a=e.fieldValues,l=e.onClick,c=e.forceInlineButtons,s=void 0!==c&&c,d=e.tableId,u=void 0===d?"":d,f=e.buttonLoaders,p=void 0===f?{}:f;if(0===t.length)return null;var h=de((0,o.useState)(!1),2),g=h[0],v=h[1],y=de((0,o.useState)({top:0,left:0}),2),b=y[0],x=y[1],m=(0,o.useRef)(null),w=(0,o.useRef)(null),k=(0,o.useRef)(null),C=!s&&t.length>1;(0,o.useEffect)((function(){var e=function(e){w.current&&!w.current.contains(e.target)&&k.current&&!k.current.contains(e.target)&&v(!1)};return g&&(0,ce.me)().addEventListener("mousedown",e),function(){(0,ce.me)().removeEventListener("mousedown",e)}}),[g]);var S=function(e){v(!1);var t=a||le.u4,n={};i.forEach((function(e){var o=t[e.field_key],i=Array.isArray(o)?o[r]:o;n[e.name]=i})),l({action:e.label,rowIndex:r,rowData:n})};return(0,n.tZ)("div",se({ref:m,css:N},{children:C?(0,n.BX)(n.HY,{children:[(0,n.tZ)("button",se({ref:k,type:"button",onClick:function(e){e.stopPropagation(),function(){if(!g&&k.current){var e=k.current.getBoundingClientRect();x({top:e.bottom+4,left:e.right})}v(!g)}()},css:z},{children:(0,n.tZ)(ue,{})})),g&&(0,ae.createPortal)((0,n.tZ)("div",se({ref:w,css:se(se({},X),{top:"".concat(b.top,"px"),left:"".concat(b.left,"px"),transform:"translateX(-100%)"})},{children:t.map((function(e,t){var o,i="".concat(u,"_").concat(r,"_").concat(e.label),a=null===(o=p[i])||void 0===o?void 0:o.loader,l=Object.keys(p).length>0;return(0,n.BX)("button",se({type:"button",onClick:function(){return S(e)},css:W,disabled:l},{children:[(0,n.tZ)("span",se({css:{flex:1}},{children:e.label})),a&&(0,n.tZ)("div",se({style:{height:"16px",width:"16px",flexShrink:0}},{children:a}))]}),t)}))})),(0,ce.me)().body)]}):t.map((function(e,t){var o,i="".concat(u,"_").concat(r,"_").concat(e.label),a=null===(o=p[i])||void 0===o?void 0:o.loader,l=Object.keys(p).length>0;return(0,n.BX)("button",se({type:"button",onClick:function(t){t.stopPropagation(),S(e)},css:M,disabled:l},{children:[(0,n.tZ)("span",se({style:{visibility:a?"hidden":"visible"}},{children:e.label})),a&&(0,n.tZ)("div",se({style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",height:"16px",width:"16px"}},{children:a}))]}),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:m},{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,d=i.match(s);if(d){var u=void 0,f=void 0,p=void 0;4===d[1].length?(u=(n=ge(d,4))[1],f=n[2],p=n[3]):(f=(o=ge(d,4))[1],p=o[2],u=o[3]),2===u.length&&(u=parseInt(u)<50?"20".concat(u):"19".concat(u));var h=new Date(parseInt(u),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)},xe=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.")},me=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))};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 Ce=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,d=e.buttonLoaders,u=void 0===d?{}:d,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,d,u,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,x=null!==(c=null===(l=p.properties)||void 0===l?void 0:l.sort)&&void 0!==c&&c,m=null!==(d=null===(s=p.properties)||void 0===s?void 0:s.transpose)&&void 0!==d&&d,w=null!==(f=null===(u=p.properties)||void 0===u?void 0:u.pagination)&&void 0!==f?f:0,k="number"==typeof w&&w>0?Math.floor(w):0,C=k>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]),P=me((0,o.useState)(""),2),R=P[0],_=P[1],I=me((0,o.useState)(null),2),B=I[0],A=I[1],L=me((0,o.useState)("asc"),2),T=L[0],j=L[1],D=me((0,o.useState)(0),2),M=D[0],O=D[1],X=(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]),W=(0,o.useMemo)((function(){return Array.from({length:X},(function(e,t){return t}))}),[X]),z=(0,o.useMemo)((function(){return m&&b&&R.trim()?W.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(R.toLowerCase().trim())}))})):W}),[m,W,S,R,b,Z]),N=me((0,o.useState)(null),2),E=N[0],F=N[1],V=(0,o.useMemo)((function(){if(!m||!x||null===E)return z;var e=S[E];return e?we([],me(z),!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})):z}),[m,z,E,T,S,Z,x]),Q=(0,o.useMemo)((function(){if(!m||!C)return V;var e=M*k,t=e+k;return V.slice(e,t)}),[m,V,M,k,C]),Y=(0,o.useMemo)((function(){if(!m||0===X)return{columns:S,activeFieldValues:Z,transposedRowIndices:[]};var e=function(e,t,r,n){var o,i,a,l,c,s,d=n||Array.from({length:r},(function(e,t){return t})),u=[{name:"",field_id:"_transpose_field_name",field_type:"text",field_key:"_transpose_field_name"}];try{for(var f=xe(d),p=f.next();!p.done;p=f.next()){var h=p.value;u.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=xe(d),y=v.next();!y.done;y=v.next()){h=y.value;var b=[];try{for(var x=(c=void 0,xe(e)),m=x.next();!m.done;m=x.next()){var w=t[m.value.field_key],k=Array.isArray(w)?w[h]:w;b.push(k)}}catch(e){c={error:e}}finally{try{m&&!m.done&&(s=x.return)&&s.call(x)}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:u,transposedFieldValues:g,includedRowIndices:d}}(S,Z,X,Q);return{columns:e.transposedColumns,activeFieldValues:e.transposedFieldValues,transposedRowIndices:e.includedRowIndices}}),[m,S,Z,X,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 m?G:b&&R.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(R.toLowerCase().trim())}))})):G}),[m,G,H,R,b,$]),U=(0,o.useMemo)((function(){if(m)return J;if(!x||!B)return J;var e=H.find((function(e){return e.name===B}));return e?we([],me(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}),[m,J,B,T,H,x,$]),ee=(0,o.useMemo)((function(){if(m)return G;if(!C)return U;var e=M*k,t=e+k;return U.slice(e,t)}),[m,G,U,M,k,C]);(0,o.useEffect)((function(){O(0)}),[R,B,T]);var te=m?V.length:U.length,re=C?Math.ceil(te/k):1,ne=K>0,oe=m?z.length>0:J.length>0;return{enableSearch:b,searchQuery:R,hasSearchResults:oe,setSearchQuery:_,enableSort:x,sortColumn:B,sortDirection:T,sortedColumnIndex:E,handleSort:function(e){x&&(B===e?"asc"===T?j("desc"):(A(null),j("asc")):(A(e),j("asc")))},handleTransposedSort:function(e){x&&m&&(E===e?"asc"===T?j("desc"):(F(null),j("asc")):(F(e),j("asc")))},enablePagination:C,currentPage:M,paginatedRowIndices:ee,rowsPerPage:k,setCurrentPage:O,columns:H,actions:y,isTransposed:m&&X>0,transposedRowIndices:q,totalRows:te,totalPages:re,hasData:ne,activeFieldValues:$,baseColumns:S,baseFieldValues:Z}}({element:t,editMode:s}),h=p.enableSearch,g=p.searchQuery,y=p.setSearchQuery,m=p.enableSort,w=p.sortColumn,k=p.sortDirection,C=p.sortedColumnIndex,S=p.handleSort,Z=p.handleTransposedSort,A=p.enablePagination,L=p.currentPage,T=p.setCurrentPage,j=p.paginatedRowIndices,D=p.rowsPerPage,M=p.columns,O=p.actions,X=p.isTransposed,W=p.transposedRowIndices,z=p.totalRows,N=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({},x),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({},P),f.getTarget("table"))},{children:[!X&&(0,n.tZ)("thead",ke({css:R},{children:(0,n.BX)("tr",{children:[(0,n.tZ)(U,{columns:M,enableSort:m,sortColumn:w,sortDirection:k,onSort:S,styles:f}),O.length>0&&(0,n.tZ)("th",{scope:"col",css:ke(ke(ke({},_),{paddingLeft:0}),f.getTarget("th"))})]})})),(0,n.BX)("tbody",ke({css:f.getTarget("tbody")},{children:[j.map((function(e){var r={};return X||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({},I),f.getTarget("tr")),onClick:function(){X||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,d=X&&0===r,u=d&&m,p=C===e,h=0===r,g=1===r,y=X&&!d?t.originalRowIndex:void 0,x=d?ke(ke(ke(ke({},_),{backgroundColor:"#f9fafb",borderRight:"1px solid #e5e7eb",width:"1px",whiteSpace:"nowrap"}),f.getTarget("th")),u?{cursor:"pointer"}:{}):ke(ke(ke(ke({},B),X?g?{}:{paddingLeft:0}:h?{}:{paddingLeft:0}),X&&!d?{cursor:"pointer"}:{}),f.getTarget("td")),w=d?"th":"td";return(0,n.tZ)(w,ke({css:x,onClick:function(t){if(u)Z(e);else if(X&&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})}}},d?{scope:"row"}:{},{children:d&&u?(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:k})}))]})):null!==(a=(0,i.e7)(s))&&void 0!==a?a:""}),r)})),!X&&O.length>0&&(0,n.tZ)("td",ke({css:ke(ke(ke({},B),{paddingLeft:0}),f.getTarget("td"))},{children:(0,n.tZ)(fe,{actions:O,rowIndex:e,columnData:Q,fieldValues:Y,onClick:l,tableId:t.id,buttonLoaders:u})}))]}),e)})),X&&O.length>0&&(0,n.BX)("tr",ke({css:ke(ke({},I),f.getTarget("tr"))},{children:[(0,n.tZ)("th",{scope:"row",css:ke(ke(ke({},_),{backgroundColor:"#f9fafb",borderRight:"1px solid #e5e7eb",width:"1px",whiteSpace:"nowrap"}),f.getTarget("th"))}),W.map((function(e,r){return(0,n.tZ)("td",ke({css:ke(ke(ke({},B),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:u})}))}),e)}))]}))]}))]})),!H&&A&&(0,n.tZ)(ie,{currentPage:L,totalPages:N,totalItems:z,rowsPerPage:D,onPageChange:T})]}))}))}}}]);