@feathery/react 2.23.5 → 2.23.6

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 (86) hide show
  1. package/cjs/elements/basic/ButtonElement.d.ts.map +1 -1
  2. package/cjs/elements/basic/TableElement/useTableData.d.ts +1 -0
  3. package/cjs/elements/basic/TableElement/useTableData.d.ts.map +1 -1
  4. package/cjs/{fthry_FormControl.CscXHID3.js → fthry_FormControl.BSFeGfR_.js} +1 -1
  5. package/cjs/{fthry_InlineTooltip.ZpgEmPO3.js → fthry_InlineTooltip.DdmX24ud.js} +2 -2
  6. package/cjs/{fthry_Overlay.BTS_EcV3.js → fthry_Overlay.dLOs3POl.js} +1 -1
  7. package/cjs/{fthry_PaymentMethodField.D902pJlo.js → fthry_PaymentMethodField.B4hPg2W5.js} +4 -4
  8. package/cjs/{fthry_Placeholder.Ctq06SYu.js → fthry_Placeholder.CGG1eUWI.js} +1 -1
  9. package/cjs/{fthry_ShowEyeIcon.q9BhUK2g.js → fthry_ShowEyeIcon.CqkQEvU3.js} +1 -1
  10. package/cjs/{fthry_index.B4YVBeqY.js → fthry_index.B-tGwDjz.js} +3 -3
  11. package/cjs/{fthry_index.DGctX9WE.js → fthry_index.B6OWca6B.js} +5 -5
  12. package/cjs/{fthry_index.Bh5jAAhx.js → fthry_index.BMCo2zda.js} +6 -6
  13. package/cjs/{fthry_index.Jp2CJ4is.js → fthry_index.BMhDSvsN.js} +2 -2
  14. package/cjs/{fthry_index.-Y9ZJS34.js → fthry_index.Ba5C9yId.js} +6 -6
  15. package/cjs/{fthry_index.BmT77CVY.js → fthry_index.BdTls4Lg.js} +2 -2
  16. package/cjs/{fthry_index.B_UehadW.js → fthry_index.BlbuXVF3.js} +1 -1
  17. package/cjs/{fthry_index.C6-dnyHD.js → fthry_index.BqNLbMy7.js} +1 -1
  18. package/cjs/{fthry_index.BS6b2BTF.js → fthry_index.CAGAOhTh.js} +6 -6
  19. package/cjs/{fthry_index.CWofoHQs.js → fthry_index.CIAaigRJ.js} +4 -4
  20. package/cjs/{fthry_index.CSwhuTPY.js → fthry_index.CLUV_Y9k.js} +1 -1
  21. package/cjs/{fthry_index.jot4NArP.js → fthry_index.COIyjfXF.js} +3 -3
  22. package/cjs/{fthry_index.9PFsbc4I.js → fthry_index.CWjgaGDT.js} +1 -1
  23. package/cjs/{fthry_index.D36o5hns.js → fthry_index.CWlKeuqz.js} +5 -5
  24. package/cjs/{fthry_index.dGUMsRB1.js → fthry_index.CyaIdx9V.js} +4 -4
  25. package/cjs/{fthry_index.lGGMSnRj.js → fthry_index.Czm7tOJN.js} +1 -1
  26. package/cjs/{fthry_index.BYTU7WTg.js → fthry_index.D4Iu9UG6.js} +4 -4
  27. package/cjs/{fthry_index.Bl2kuNOo.js → fthry_index.DC19EIx0.js} +5 -5
  28. package/cjs/{fthry_index._iQAHcD9.js → fthry_index.DRD0iTwt.js} +39 -29
  29. package/cjs/{fthry_index.Nrwqiq0j.js → fthry_index.DxydBYq9.js} +5 -5
  30. package/cjs/{fthry_index.Bsklltx4.js → fthry_index.DzZDhazI.js} +1 -1
  31. package/cjs/{fthry_index.CbASwLjr.js → fthry_index.FziiiLJL.js} +54 -4
  32. package/cjs/{fthry_index.CTqVrxjv.js → fthry_index.H0oI-pdw.js} +1 -1
  33. package/cjs/{fthry_index.mEUshDAA.js → fthry_index.Srl5eYm5.js} +1 -1
  34. package/cjs/{fthry_index.BuQ1HIIN.js → fthry_index.vuYMQcab.js} +8 -8
  35. package/cjs/{fthry_input.3JtjJgPY.js → fthry_input.3eZioCQX.js} +1 -1
  36. package/cjs/{fthry_script.DOCG8gyM.js → fthry_script.B0ZxbIbw.js} +1 -1
  37. package/cjs/{fthry_styles.CVqE6wer.js → fthry_styles.DDrbD7PV.js} +1 -1
  38. package/cjs/{fthry_useElementSize.B5-XFuix.js → fthry_useElementSize.DnuxzPqr.js} +1 -1
  39. package/cjs/{fthry_useSalesforceSync.D9f_IkFv.js → fthry_useSalesforceSync.uOFzu2dA.js} +1 -1
  40. package/cjs/{fthry_webfontloader.5X-HEWHN.js → fthry_webfontloader.nyXgbNFp.js} +1 -1
  41. package/cjs/index.js +1 -1
  42. package/dist/elements/basic/ButtonElement.d.ts.map +1 -1
  43. package/dist/elements/basic/TableElement/useTableData.d.ts +1 -0
  44. package/dist/elements/basic/TableElement/useTableData.d.ts.map +1 -1
  45. package/dist/{fthry_FormControl.Bt83gTi3.js → fthry_FormControl.BWQA5b0y.js} +1 -1
  46. package/dist/{fthry_InlineTooltip.BADFGh_F.js → fthry_InlineTooltip.BZLGojXl.js} +2 -2
  47. package/dist/{fthry_Overlay.CsBPXuR_.js → fthry_Overlay.Dtxj6U3L.js} +1 -1
  48. package/dist/{fthry_PaymentMethodField.CVKE3t_i.js → fthry_PaymentMethodField.C-mD7K2W.js} +4 -4
  49. package/dist/{fthry_Placeholder.9MqCxqHS.js → fthry_Placeholder.hAt5rBVS.js} +1 -1
  50. package/dist/{fthry_ShowEyeIcon.CxXoA4_B.js → fthry_ShowEyeIcon.C9RMRr7X.js} +1 -1
  51. package/dist/{fthry_index.CyjNCuWE.js → fthry_index.B-icxM59.js} +1 -1
  52. package/dist/{fthry_index.Dte366nP.js → fthry_index.BD_dUvCa.js} +1 -1
  53. package/dist/{fthry_index.7TulZeVg.js → fthry_index.BESTuSD0.js} +6 -6
  54. package/dist/{fthry_index.CefyT_Xy.js → fthry_index.BHy82_xs.js} +3 -3
  55. package/dist/{fthry_index.C4cVkdmR.js → fthry_index.BLC4N3MM.js} +5 -5
  56. package/dist/{fthry_index.D86GTeP3.js → fthry_index.BLWtc8eL.js} +6 -6
  57. package/dist/{fthry_index.Beh4LhUb.js → fthry_index.BOupY-M9.js} +4 -4
  58. package/dist/{fthry_index.CnNPiyfF.js → fthry_index.BRaDez8A.js} +6 -6
  59. package/dist/{fthry_index.AdQD-dII.js → fthry_index.BXgOTSKx.js} +54 -4
  60. package/dist/{fthry_index.qQius3J9.js → fthry_index.C0qPFRWZ.js} +1 -1
  61. package/dist/{fthry_index.BIkyi9OD.js → fthry_index.C0uIFVvg.js} +4 -4
  62. package/dist/{fthry_index.BbSZxIR5.js → fthry_index.C1M4obTx.js} +2 -2
  63. package/dist/{fthry_index.FjbxGNs2.js → fthry_index.CDTlE3iz.js} +5 -5
  64. package/dist/{fthry_index.5oEnjTzQ.js → fthry_index.CZG2sz8l.js} +3 -3
  65. package/dist/{fthry_index.BQTGcd6O.js → fthry_index.CioL9mXh.js} +8 -8
  66. package/dist/{fthry_index.B0_n9jqc.js → fthry_index.Cnj3D2sE.js} +4 -4
  67. package/dist/{fthry_index.CsQzji9M.js → fthry_index.CpjGr8XJ.js} +1 -1
  68. package/dist/{fthry_index.Cy8OGyJ9.js → fthry_index.D3AC3IRu.js} +5 -5
  69. package/dist/{fthry_index.EFk2iysz.js → fthry_index.DkySqYis.js} +39 -29
  70. package/dist/{fthry_index.BPmvHG0R.js → fthry_index.DsD0fPig.js} +1 -1
  71. package/dist/{fthry_index.Degy27gw.js → fthry_index.DsqQfUyE.js} +1 -1
  72. package/dist/{fthry_index.C0FNSGu0.js → fthry_index.M__FBiFq.js} +5 -5
  73. package/dist/{fthry_index.D4ENNIPP.js → fthry_index.UjyJiWL6.js} +1 -1
  74. package/dist/{fthry_index.DpU0lL2P.js → fthry_index.m_O5twIG.js} +1 -1
  75. package/dist/{fthry_index.DoxZOyru.js → fthry_index.oi3hyRpZ.js} +2 -2
  76. package/dist/{fthry_input.BMNwRyD_.js → fthry_input.CabnFCSi.js} +1 -1
  77. package/dist/{fthry_script.0KhNn8f9.js → fthry_script.DPOcbAqz.js} +1 -1
  78. package/dist/{fthry_styles.DtCYeZPi.js → fthry_styles.C2mCy0WK.js} +1 -1
  79. package/dist/{fthry_useElementSize.fW6iiT11.js → fthry_useElementSize.secLYB15.js} +1 -1
  80. package/dist/{fthry_useSalesforceSync.BIkirclp.js → fthry_useSalesforceSync.Cpjc7KyH.js} +1 -1
  81. package/dist/{fthry_webfontloader.Dyilj6id.js → fthry_webfontloader.ZS2IvgfF.js} +1 -1
  82. package/dist/index.js +1 -1
  83. package/package.json +1 -1
  84. package/umd/TableElement.8380efafa84627d75ce9.js +1 -0
  85. package/umd/index.js +1 -1
  86. package/umd/TableElement.8fe7915eeb32e23ba816.js +0 -1
@@ -1,12 +1,12 @@
1
- import { j as jsx, _ as __assign, u as useBorder, b as __read, C as countryData, c as fieldValues, a as jsxs, h as hoverStylesGuard, w as css, x as __makeTemplateObject, G as Global, k as iosScrollOnFocus, r as resetStyles } from './fthry_index.EFk2iysz.js';
1
+ import { j as jsx, _ as __assign, u as useBorder, b as __read, C as countryData, c as fieldValues, a as jsxs, h as hoverStylesGuard, w as css, x as __makeTemplateObject, G as Global, k as iosScrollOnFocus, r as resetStyles } from './fthry_index.DkySqYis.js';
2
2
  import { useState, useRef, useEffect } from 'react';
3
- import { I as InlineTooltip } from './fthry_InlineTooltip.BADFGh_F.js';
4
- import { u as useSalesforceSync } from './fthry_useSalesforceSync.BIkirclp.js';
3
+ import { I as InlineTooltip } from './fthry_InlineTooltip.BZLGojXl.js';
4
+ import { u as useSalesforceSync } from './fthry_useSalesforceSync.Cpjc7KyH.js';
5
5
  import 'react/jsx-runtime';
6
6
  import 'react-dom/client';
7
7
  import 'jszip';
8
8
  import 'react-dom';
9
- import './fthry_Overlay.CsBPXuR_.js';
9
+ import './fthry_Overlay.Dtxj6U3L.js';
10
10
 
11
11
  var ae = [
12
12
  { name: 'Abu Dhabi', code: 'AZ' },
@@ -1,4 +1,4 @@
1
- import { v as featheryWindow, a as jsxs, _ as __assign, j as jsx, b as __read, u as useBorder, h as hoverStylesGuard, am as isNum } from './fthry_index.EFk2iysz.js';
1
+ import { v as featheryWindow, a as jsxs, _ as __assign, j as jsx, b as __read, u as useBorder, h as hoverStylesGuard, am as isNum } from './fthry_index.DkySqYis.js';
2
2
  import { useRef, useCallback, useEffect, useState } from 'react';
3
3
  import 'react/jsx-runtime';
4
4
  import 'react-dom/client';
@@ -1,9 +1,9 @@
1
- import { z as __rest, b as __read, C as countryData, ai as phoneLib, aj as authState, ak as firebaseSMSCountries, a as jsxs, j as jsx, _ as __assign, F as Fragment, D as DROPDOWN_Z_INDEX, u as useBorder, al as phoneLibPromise, h as hoverStylesGuard, am as isNum, k as iosScrollOnFocus, r as resetStyles } from './fthry_index.EFk2iysz.js';
1
+ import { z as __rest, b as __read, C as countryData, ai as phoneLib, aj as authState, ak as firebaseSMSCountries, a as jsxs, j as jsx, _ as __assign, F as Fragment, D as DROPDOWN_Z_INDEX, u as useBorder, al as phoneLibPromise, h as hoverStylesGuard, am as isNum, k as iosScrollOnFocus, r as resetStyles } from './fthry_index.DkySqYis.js';
2
2
  import { forwardRef, useRef, useState, useEffect, useMemo, memo } from 'react';
3
- import { P as Placeholder } from './fthry_Placeholder.9MqCxqHS.js';
4
- import { I as InlineTooltip } from './fthry_InlineTooltip.BADFGh_F.js';
5
- import { O as Overlay } from './fthry_Overlay.CsBPXuR_.js';
6
- import { u as useElementSize } from './fthry_useElementSize.fW6iiT11.js';
3
+ import { P as Placeholder } from './fthry_Placeholder.hAt5rBVS.js';
4
+ import { I as InlineTooltip } from './fthry_InlineTooltip.BZLGojXl.js';
5
+ import { O as Overlay } from './fthry_Overlay.Dtxj6U3L.js';
6
+ import { u as useElementSize } from './fthry_useElementSize.secLYB15.js';
7
7
  import 'react/jsx-runtime';
8
8
  import 'react-dom/client';
9
9
  import 'jszip';
@@ -39437,7 +39437,7 @@ function useTrackUserInteraction(formRef, activeStep, stepKey, formName) {
39437
39437
  }, [activeStep, stepKey, formName]);
39438
39438
  }
39439
39439
 
39440
- var AssistantChat = lazy(function () { return import(/* webpackChunkName: "AssistantChat" */ './fthry_index.Dte366nP.js'); });
39440
+ var AssistantChat = lazy(function () { return import(/* webpackChunkName: "AssistantChat" */ './fthry_index.BD_dUvCa.js'); });
39441
39441
  var getSubmissionErrorMessage = function (error) {
39442
39442
  if (error instanceof TypeError && error.message === 'Failed to fetch') {
39443
39443
  return 'Unable to upload files. Please check your connection and try again.';
@@ -45981,9 +45981,9 @@ function init(sdkKey, options) {
45981
45981
  if (runningInClient()) {
45982
45982
  // Dynamically load libraries that must be client side
45983
45983
  global.scriptjsLoadPromise = import(
45984
- /* webpackChunkName: "scriptjs" */ './fthry_script.0KhNn8f9.js').then(function (n) { return n.s; });
45984
+ /* webpackChunkName: "scriptjs" */ './fthry_script.DPOcbAqz.js').then(function (n) { return n.s; });
45985
45985
  global.webfontloaderPromise = import(
45986
- /* webpackChunkName: "webfontloader" */ './fthry_webfontloader.Dyilj6id.js').then(function (n) { return n.w; });
45986
+ /* webpackChunkName: "webfontloader" */ './fthry_webfontloader.ZS2IvgfF.js').then(function (n) { return n.w; });
45987
45987
  // Client-side tracking logic
45988
45988
  if (initState.userTracking === 'cookie') {
45989
45989
  var cookieKey = "feathery-user-id-".concat(sdkKey);
@@ -46129,7 +46129,7 @@ function getFieldValues() {
46129
46129
  return __assign({}, fieldValues);
46130
46130
  }
46131
46131
  function logFeatheryBadge() {
46132
- console.log('%c Feathery %c v' + "2.23.5" + ' ', // replaced with real version during build
46132
+ console.log('%c Feathery %c v' + "2.23.6" + ' ', // replaced with real version during build
46133
46133
  'background: #e2626e; color: white; padding: 2px 6px; border-radius: 3px 0 0 3px; font-weight: bold;', 'background: #fce7e9; color: #c5495a; padding: 2px 6px; border-radius: 0 3px 3px 0;');
46134
46134
  }
46135
46135
 
@@ -47562,39 +47562,39 @@ breakpoint) {
47562
47562
  return styles.getTarget('inner-container', undefined, viewport === 'mobile');
47563
47563
  };
47564
47564
 
47565
- var AddressLine1 = lazy(function () { return import(/* webpackChunkName: "AddressField" */ './fthry_index.C4cVkdmR.js'); });
47566
- var ButtonGroupField = lazy(function () { return import(/* webpackChunkName: "ButtonGroupField" */ './fthry_index.BIkyi9OD.js'); });
47567
- var CheckboxField = lazy(function () { return import(/* webpackChunkName: "CheckboxField" */ './fthry_index.CyjNCuWE.js'); });
47565
+ var AddressLine1 = lazy(function () { return import(/* webpackChunkName: "AddressField" */ './fthry_index.BLC4N3MM.js'); });
47566
+ var ButtonGroupField = lazy(function () { return import(/* webpackChunkName: "ButtonGroupField" */ './fthry_index.C0uIFVvg.js'); });
47567
+ var CheckboxField = lazy(function () { return import(/* webpackChunkName: "CheckboxField" */ './fthry_index.B-icxM59.js'); });
47568
47568
  var CheckboxGroupField = lazy(function () {
47569
- return import(/* webpackChunkName: "CheckboxGroupField" */ './fthry_index.CnNPiyfF.js');
47569
+ return import(/* webpackChunkName: "CheckboxGroupField" */ './fthry_index.BRaDez8A.js');
47570
47570
  });
47571
- var ColorPickerField = lazy(function () { return import(/* webpackChunkName: "ColorPickerField" */ './fthry_index.Degy27gw.js'); });
47572
- var CustomField = lazy(function () { return import(/* webpackChunkName: "CustomField" */ './fthry_index.qQius3J9.js'); });
47571
+ var ColorPickerField = lazy(function () { return import(/* webpackChunkName: "ColorPickerField" */ './fthry_index.DsqQfUyE.js'); });
47572
+ var CustomField = lazy(function () { return import(/* webpackChunkName: "CustomField" */ './fthry_index.C0qPFRWZ.js'); });
47573
47573
  var DateSelectorField = lazy(function () {
47574
- return import(/* webpackChunkName: "DateSelectorField" */ './fthry_index.D86GTeP3.js');
47574
+ return import(/* webpackChunkName: "DateSelectorField" */ './fthry_index.BLWtc8eL.js');
47575
47575
  });
47576
- var DropdownField = lazy(function () { return import(/* webpackChunkName: "DropdownField" */ './fthry_index.B0_n9jqc.js'); });
47576
+ var DropdownField = lazy(function () { return import(/* webpackChunkName: "DropdownField" */ './fthry_index.Cnj3D2sE.js'); });
47577
47577
  var DropdownMultiField = lazy(function () {
47578
- return import(/* webpackChunkName: "DropdownMultiField" */ './fthry_index.FjbxGNs2.js');
47578
+ return import(/* webpackChunkName: "DropdownMultiField" */ './fthry_index.CDTlE3iz.js');
47579
47579
  });
47580
- var FileUploadField = lazy(function () { return import(/* webpackChunkName: "FileUploadField" */ './fthry_index.D4ENNIPP.js'); });
47581
- var MatrixField = lazy(function () { return import(/* webpackChunkName: "MatrixField" */ './fthry_index.CefyT_Xy.js'); });
47582
- var PasswordField = lazy(function () { return import(/* webpackChunkName: "PasswordField" */ './fthry_index.C0FNSGu0.js'); });
47580
+ var FileUploadField = lazy(function () { return import(/* webpackChunkName: "FileUploadField" */ './fthry_index.UjyJiWL6.js'); });
47581
+ var MatrixField = lazy(function () { return import(/* webpackChunkName: "MatrixField" */ './fthry_index.BHy82_xs.js'); });
47582
+ var PasswordField = lazy(function () { return import(/* webpackChunkName: "PasswordField" */ './fthry_index.M__FBiFq.js'); });
47583
47583
  var PaymentMethodField = lazy(function () {
47584
- return import(/* webpackChunkName: "PaymentMethodField" */ './fthry_PaymentMethodField.CVKE3t_i.js');
47584
+ return import(/* webpackChunkName: "PaymentMethodField" */ './fthry_PaymentMethodField.C-mD7K2W.js');
47585
47585
  });
47586
- var PhoneField = lazy(function () { return import(/* webpackChunkName: "PhoneField" */ './fthry_index.Cy8OGyJ9.js'); });
47587
- var PinInputField = lazy(function () { return import(/* webpackChunkName: "PinInputField" */ './fthry_index.CsQzji9M.js'); });
47588
- var QRScanner = lazy(function () { return import(/* webpackChunkName: "QRScanner" */ './fthry_index.BbSZxIR5.js'); });
47586
+ var PhoneField = lazy(function () { return import(/* webpackChunkName: "PhoneField" */ './fthry_index.D3AC3IRu.js'); });
47587
+ var PinInputField = lazy(function () { return import(/* webpackChunkName: "PinInputField" */ './fthry_index.CpjGr8XJ.js'); });
47588
+ var QRScanner = lazy(function () { return import(/* webpackChunkName: "QRScanner" */ './fthry_index.C1M4obTx.js'); });
47589
47589
  var RadioButtonGroupField = lazy(function () {
47590
47590
  return import(
47591
- /* webpackChunkName: "RadioButtonGroupField" */ './fthry_index.7TulZeVg.js');
47591
+ /* webpackChunkName: "RadioButtonGroupField" */ './fthry_index.BESTuSD0.js');
47592
47592
  });
47593
- var RatingField = lazy(function () { return import(/* webpackChunkName: "RatingField" */ './fthry_index.BPmvHG0R.js'); });
47594
- var SignatureField = lazy(function () { return import(/* webpackChunkName: "SignatureField" */ './fthry_index.5oEnjTzQ.js'); });
47595
- var SliderField = lazy(function () { return import(/* webpackChunkName: "SliderField" */ './fthry_index.DoxZOyru.js'); });
47596
- var TextField = lazy(function () { return import(/* webpackChunkName: "TextField" */ './fthry_index.BQTGcd6O.js'); });
47597
- var TextArea = lazy(function () { return import(/* webpackChunkName: "TextArea" */ './fthry_index.Beh4LhUb.js'); });
47593
+ var RatingField = lazy(function () { return import(/* webpackChunkName: "RatingField" */ './fthry_index.DsD0fPig.js'); });
47594
+ var SignatureField = lazy(function () { return import(/* webpackChunkName: "SignatureField" */ './fthry_index.CZG2sz8l.js'); });
47595
+ var SliderField = lazy(function () { return import(/* webpackChunkName: "SliderField" */ './fthry_index.oi3hyRpZ.js'); });
47596
+ var TextField = lazy(function () { return import(/* webpackChunkName: "TextField" */ './fthry_index.CioL9mXh.js'); });
47597
+ var TextArea = lazy(function () { return import(/* webpackChunkName: "TextArea" */ './fthry_index.BOupY-M9.js'); });
47598
47598
  var Fields = {
47599
47599
  AddressLine1: AddressLine1,
47600
47600
  ButtonGroupField: ButtonGroupField,
@@ -48301,15 +48301,25 @@ function ButtonElement(_a) {
48301
48301
  : __assign(__assign({}, styles.getTarget('buttonHover')), borderStyles.hover));
48302
48302
  var actions = (_b = element.properties.actions) !== null && _b !== void 0 ? _b : [];
48303
48303
  var noActions = actions.length === 0 && !element.properties.submit;
48304
+ var buttonDisabled = !editMode && (noActions || loader || disabled);
48305
+ var handleClick = function (e) {
48306
+ if (buttonDisabled) {
48307
+ e.preventDefault();
48308
+ return;
48309
+ }
48310
+ onClick === null || onClick === void 0 ? void 0 : onClick(e);
48311
+ };
48304
48312
  return (jsxs("button", __assign({ id: element.id, type: element.properties.submit ? 'submit' : 'button', className: active ? 'active' : undefined, style: {
48305
48313
  display: 'flex',
48306
- cursor: editMode || noActions ? 'default' : 'pointer',
48314
+ cursor: editMode || buttonDisabled ? 'default' : 'pointer',
48307
48315
  width: '100%',
48308
48316
  height: '100%',
48309
48317
  position: 'relative',
48310
48318
  flex: 1,
48311
48319
  lineHeight: 'normal'
48312
- }, css: __assign(__assign({ borderWidth: 0, justifyContent: 'center', alignItems: 'center', border: 'none', transition: '0.2s ease all !important', '&:disabled': __assign(__assign({ cursor: 'default !important' }, styles.getTarget('buttonDisabled')), borderStyles.disabled), '&:hover:enabled': hoverStyles, '&.active:enabled': activeStyles }, (active === null ? { '&:focus:enabled': activeStyles } : {})), { '&&&': styles.getTarget('button') }), disabled: !editMode && (noActions || loader || disabled), onClick: onClick, "aria-label": element.properties.aria_label }, elementProps, { children: [customBorder, children, loader ? (jsx$1("div", __assign({ css: styles.getTarget('loader') }, { children: loader }))) : (jsxs(Fragment, { children: [element.properties.image && (jsx$1("img", { src: element.properties.image, css: __assign(__assign({}, imgMaxSizeStyles), responsiveStyles.getTargets('img')) })), element.properties.text && (jsx$1(TextNodes, { element: element, responsiveStyles: responsiveStyles, cssTarget: 'buttonLabel', editMode: editMode, disabled: disabled, focused: focused, textCallbacks: textCallbacks, featheryContext: featheryContext, expand: !element.properties.image }))] })), !element.properties.submit && (jsx$1(ErrorInput, { id: "error_".concat(element.id), name: "error_".concat(element.id), "aria-label": element.properties.aria_label }))] }), element.id));
48320
+ }, css: __assign(__assign({ borderWidth: 0, justifyContent: 'center', alignItems: 'center', border: 'none', transition: '0.2s ease all !important', '&[aria-disabled="true"]': __assign(__assign({ cursor: 'default !important' }, styles.getTarget('buttonDisabled')), borderStyles.disabled), '&[aria-disabled="false"]:hover': hoverStyles, '&[aria-disabled="false"].active': activeStyles }, (active === null
48321
+ ? { '&[aria-disabled="false"]:focus': activeStyles }
48322
+ : {})), { '&&&': styles.getTarget('button') }), "aria-disabled": buttonDisabled, onClick: handleClick, "aria-label": element.properties.aria_label }, elementProps, { children: [customBorder, children, loader ? (jsx$1("div", __assign({ css: styles.getTarget('loader') }, { children: loader }))) : (jsxs(Fragment, { children: [element.properties.image && (jsx$1("img", { src: element.properties.image, css: __assign(__assign({}, imgMaxSizeStyles), responsiveStyles.getTargets('img')) })), element.properties.text && (jsx$1(TextNodes, { element: element, responsiveStyles: responsiveStyles, cssTarget: 'buttonLabel', editMode: editMode, disabled: disabled, focused: focused, textCallbacks: textCallbacks, featheryContext: featheryContext, expand: !element.properties.image }))] })), !element.properties.submit && (jsx$1(ErrorInput, { id: "error_".concat(element.id), name: "error_".concat(element.id), "aria-label": element.properties.aria_label }))] }), element.id));
48313
48323
  }
48314
48324
 
48315
48325
  var formerProgress;
@@ -48534,7 +48544,7 @@ function ElementSkeleton(_a) {
48534
48544
  }
48535
48545
  var templateObject_1;
48536
48546
 
48537
- var TableElement = lazy(function () { return import(/* webpackChunkName: "TableElement" */ './fthry_index.AdQD-dII.js'); });
48547
+ var TableElement = lazy(function () { return import(/* webpackChunkName: "TableElement" */ './fthry_index.BXgOTSKx.js'); });
48538
48548
  var Basic = {
48539
48549
  ImageElement: ImageElement,
48540
48550
  VideoElement: VideoElement,
@@ -1,4 +1,4 @@
1
- import { j as jsx, _ as __assign, b as __read, a as jsxs, E as ErrorInput } from './fthry_index.EFk2iysz.js';
1
+ import { j as jsx, _ as __assign, b as __read, a as jsxs, E as ErrorInput } from './fthry_index.DkySqYis.js';
2
2
  import { useState } from 'react';
3
3
  import 'react/jsx-runtime';
4
4
  import 'react-dom/client';
@@ -1,4 +1,4 @@
1
- import { b as __read, a as jsxs$1, _ as __assign, j as jsx$1, t as FORM_Z_INDEX } from './fthry_index.EFk2iysz.js';
1
+ import { b as __read, a as jsxs$1, _ as __assign, j as jsx$1, t as FORM_Z_INDEX } from './fthry_index.DkySqYis.js';
2
2
  import React__default, { useRef, useEffect, useCallback, useState, useMemo, Fragment } from 'react';
3
3
  import { jsx, jsxs } from 'react/jsx-runtime';
4
4
  import 'react-dom/client';
@@ -1,13 +1,13 @@
1
- import { u as useBorder, b as __read, a as jsxs, _ as __assign, h as hoverStylesGuard, j as jsx, k as iosScrollOnFocus, t as FORM_Z_INDEX, r as resetStyles } from './fthry_index.EFk2iysz.js';
1
+ import { u as useBorder, b as __read, a as jsxs, _ as __assign, h as hoverStylesGuard, j as jsx, k as iosScrollOnFocus, t as FORM_Z_INDEX, r as resetStyles } from './fthry_index.DkySqYis.js';
2
2
  import { memo, useState, useRef } from 'react';
3
- import { P as Placeholder } from './fthry_Placeholder.9MqCxqHS.js';
4
- import { I as InlineTooltip } from './fthry_InlineTooltip.BADFGh_F.js';
5
- import { S as ShowEyeIcon, a as ShowEyeIcon$1 } from './fthry_ShowEyeIcon.CxXoA4_B.js';
3
+ import { P as Placeholder } from './fthry_Placeholder.hAt5rBVS.js';
4
+ import { I as InlineTooltip } from './fthry_InlineTooltip.BZLGojXl.js';
5
+ import { S as ShowEyeIcon, a as ShowEyeIcon$1 } from './fthry_ShowEyeIcon.C9RMRr7X.js';
6
6
  import 'react/jsx-runtime';
7
7
  import 'react-dom/client';
8
8
  import 'jszip';
9
9
  import 'react-dom';
10
- import './fthry_Overlay.CsBPXuR_.js';
10
+ import './fthry_Overlay.Dtxj6U3L.js';
11
11
 
12
12
  function PasswordField(_a) {
13
13
  var _b;
@@ -1,4 +1,4 @@
1
- import { a as jsxs, _ as __assign, j as jsx, b as __read, a9 as isEmptyArray, aa as toList, ab as useThumbnailData, e as __spreadArray, p as imgMaxSizeStyles, l as __awaiter, m as __generator, ac as downloadFile, ad as CloseIcon, k as iosScrollOnFocus, t as FORM_Z_INDEX, ae as justRemove } from './fthry_index.EFk2iysz.js';
1
+ import { a as jsxs, _ as __assign, j as jsx, b as __read, a9 as isEmptyArray, aa as toList, ab as useThumbnailData, e as __spreadArray, p as imgMaxSizeStyles, l as __awaiter, m as __generator, ac as downloadFile, ad as CloseIcon, k as iosScrollOnFocus, t as FORM_Z_INDEX, ae as justRemove } from './fthry_index.DkySqYis.js';
2
2
  import { useRef, useState, useEffect } from 'react';
3
3
  import 'react/jsx-runtime';
4
4
  import 'react-dom/client';
@@ -1,4 +1,4 @@
1
- import { g as getDefaultExportFromCjs } from './fthry_index.EFk2iysz.js';
1
+ import { g as getDefaultExportFromCjs } from './fthry_index.DkySqYis.js';
2
2
 
3
3
  var propTypes = {exports: {}};
4
4
 
@@ -1,6 +1,6 @@
1
- import { b as __read, a as jsxs, _ as __assign, j as jsx, h as hoverStylesGuard } from './fthry_index.EFk2iysz.js';
1
+ import { b as __read, a as jsxs, _ as __assign, j as jsx, h as hoverStylesGuard } from './fthry_index.DkySqYis.js';
2
2
  import { useState, useEffect } from 'react';
3
- import { S as SliderStyles, a as Slider } from './fthry_styles.DtCYeZPi.js';
3
+ import { S as SliderStyles, a as Slider } from './fthry_styles.C2mCy0WK.js';
4
4
  import 'react/jsx-runtime';
5
5
  import 'react-dom/client';
6
6
  import 'jszip';
@@ -1,5 +1,5 @@
1
1
  import React__default from 'react';
2
- import { P as PropTypes } from './fthry_index.DpU0lL2P.js';
2
+ import { P as PropTypes } from './fthry_index.m_O5twIG.js';
3
3
 
4
4
  /** Checks if value is string */
5
5
  function isString(str) {
@@ -1,4 +1,4 @@
1
- import { g as getDefaultExportFromCjs } from './fthry_index.EFk2iysz.js';
1
+ import { g as getDefaultExportFromCjs } from './fthry_index.DkySqYis.js';
2
2
 
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { useState, useMemo } from 'react';
3
- import { au as cls, a as jsxs, F as Fragment, j as jsx, G as Global, w as css, x as __makeTemplateObject } from './fthry_index.EFk2iysz.js';
3
+ import { au as cls, a as jsxs, F as Fragment, j as jsx, G as Global, w as css, x as __makeTemplateObject } from './fthry_index.DkySqYis.js';
4
4
  import { flushSync } from 'react-dom';
5
5
 
6
6
  function canUseDom() {
@@ -1,4 +1,4 @@
1
- import { b as __read, v as featheryWindow } from './fthry_index.EFk2iysz.js';
1
+ import { b as __read, v as featheryWindow } from './fthry_index.DkySqYis.js';
2
2
  import { useState, useLayoutEffect } from 'react';
3
3
 
4
4
  function useElementSize(anchorRef) {
@@ -1,4 +1,4 @@
1
- import { b as __read, l as __awaiter, m as __generator, n as FeatheryClient } from './fthry_index.EFk2iysz.js';
1
+ import { b as __read, l as __awaiter, m as __generator, n as FeatheryClient } from './fthry_index.DkySqYis.js';
2
2
  import { useState, useEffect } from 'react';
3
3
 
4
4
  function useSalesforceSync(salesforceSync, editMode) {
@@ -1,4 +1,4 @@
1
- import { g as getDefaultExportFromCjs } from './fthry_index.EFk2iysz.js';
1
+ import { g as getDefaultExportFromCjs } from './fthry_index.DkySqYis.js';
2
2
 
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { az as Elements, aI as Feathery, ay as Form, aG as LoginForm, aJ as StyledContainer, aE as getFieldValues, aA as init, aF as renderAt, aD as setFieldValues, aC as updateTheme, aB as updateUserId, aH as useAuthClient } from './fthry_index.EFk2iysz.js';
1
+ export { az as Elements, aI as Feathery, ay as Form, aG as LoginForm, aJ as StyledContainer, aE as getFieldValues, aA as init, aF as renderAt, aD as setFieldValues, aC as updateTheme, aB as updateUserId, aH as useAuthClient } from './fthry_index.DkySqYis.js';
2
2
  import 'react-dom/client';
3
3
  import 'react/jsx-runtime';
4
4
  import 'react';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feathery/react",
3
- "version": "2.23.5",
3
+ "version": "2.23.6",
4
4
  "description": "React library for Feathery",
5
5
  "author": "Boyang Dun",
6
6
  "license": "MIT",
@@ -0,0 +1 @@
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})]}))}))}}}]);