@oliasoft-open-source/react-ui-library 4.12.0-beta-1 → 4.12.0-beta-3

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 (51) hide show
  1. package/dist/assets/{index-BVCFmQTa.js → index-BMWyiwz3.js} +169 -145
  2. package/dist/assets/{index-BU9wzZv9.css → index-BaYhOc6M.css} +37 -5
  3. package/dist/global.css +643 -643
  4. package/dist/index.html +1 -1
  5. package/dist/index.js +347 -369
  6. package/dist/index.js.map +1 -1
  7. package/dist/storybook/assets/{Color-KGDBMAHA-CK3d59Om.js → Color-KGDBMAHA-BU5Cvr93.js} +1 -1
  8. package/dist/storybook/assets/{DocsRenderer-PKQXORMH-C_QE44cn.js → DocsRenderer-PKQXORMH-giM41WN8.js} +1 -1
  9. package/dist/storybook/assets/{accordion.stories-C3VY77Jy.js → accordion.stories-BlHfHegj.js} +1 -1
  10. package/dist/storybook/assets/{buttons-and-links-FQEbqz9H.js → buttons-and-links-BA3MNFjq.js} +1 -1
  11. package/dist/storybook/assets/{casing-loads.stories-B7JIoJVk.js → casing-loads.stories-Cl2tJipP.js} +1 -1
  12. package/dist/storybook/assets/{cell.stories-xZiHEc0P.js → cell.stories-rzJE_qJC.js} +1 -1
  13. package/dist/storybook/assets/{chunk-HLWAVYOI-EhWEisNT.js → chunk-HLWAVYOI-Dvbg03uT.js} +1 -1
  14. package/dist/storybook/assets/{color-B3dajHjs.js → color-DIyQ13kP.js} +1 -1
  15. package/dist/storybook/assets/{footer.stories-BxzKeFAK.js → footer.stories-C6M5S0UZ.js} +1 -1
  16. package/dist/storybook/assets/{formation.stories-C5Hkb3iK.js → formation.stories-1WX1Nu1P.js} +1 -1
  17. package/dist/storybook/assets/{iframe-DOUoMheZ.js → iframe-B0e2q2Zd.js} +2 -2
  18. package/dist/storybook/assets/{index-KVAIZqzA.js → index-BXJ79Lvz.js} +1 -1
  19. package/dist/storybook/assets/{index-AKsHS-dO.js → index-BlyDuQBv.js} +4 -4
  20. package/dist/storybook/assets/{initialize-context-rEvM6bdZ.js → initialize-context-Y03pJPr5.js} +1 -1
  21. package/dist/storybook/assets/{input-validation-BNoUk3q6.js → input-validation-CLZKtfoW.js} +1 -1
  22. package/dist/storybook/assets/{inputs-Dql6Fq32.js → inputs-DlW6Jeem.js} +1 -1
  23. package/dist/storybook/assets/{layout-forms-DuFo_rwV.js → layout-forms-C6ZH-nYk.js} +1 -1
  24. package/dist/storybook/assets/{layout-general-C-UddRr1.js → layout-general-CWqOMwXA.js} +1 -1
  25. package/dist/storybook/assets/menu.test-case.stories-XN9XFV-D.js +3 -0
  26. package/dist/storybook/assets/{modal.test-case.stories-H8AYyvAl.js → modal.test-case.stories-Ci1WRYdo.js} +2 -2
  27. package/dist/storybook/assets/{number-input-CNnU6gOF.js → number-input-B3_gmeWr.js} +1 -1
  28. package/dist/storybook/assets/{number-input.stories-Bo26PJmJ.js → number-input.stories-epjUq9ve.js} +1 -1
  29. package/dist/storybook/assets/number-input.test-case.stories-DeEtalIU.js +95 -0
  30. package/dist/storybook/assets/{padding-and-spacing-B9ObVTUS.js → padding-and-spacing-CfnXk0Zn.js} +1 -1
  31. package/dist/storybook/assets/{preview-_21fnvwa.js → preview-b9pkIJl_.js} +2 -2
  32. package/dist/storybook/assets/{preview-dBqj-M8_.js → preview-jWpKVqju.js} +1 -1
  33. package/dist/storybook/assets/{row.stories-BrPMTnKK.js → row.stories-DRvH8Grn.js} +1 -1
  34. package/dist/storybook/assets/select.test-case.stories-CrXzt4qn.js +82 -0
  35. package/dist/storybook/assets/{table-iVsvoMpy.js → table-DoyDBG6l.js} +1 -1
  36. package/dist/storybook/assets/{table.stories-DmGMjcFw.js → table.stories-BgWKzIob.js} +1 -1
  37. package/dist/storybook/assets/{title.stories-D2LDNgbT.js → title.stories-Rv6ZO_Wl.js} +1 -1
  38. package/dist/storybook/assets/toaster.test-case.stories-Cy3_Gvs_.js +6 -0
  39. package/dist/storybook/assets/{unit-input-Byipu-z0.js → unit-input-BXg4VphV.js} +1 -1
  40. package/dist/storybook/assets/{unit-input.stories-CChVbxmI.js → unit-input.stories-Btz2M_TP.js} +1 -1
  41. package/dist/storybook/assets/{unit-input.test-case.stories-BwKiucyc.js → unit-input.test-case.stories-CZD1jf36.js} +1 -1
  42. package/dist/storybook/assets/{unit-table.stories-B7rN0MF0.js → unit-table.stories-CISvZMxX.js} +1 -1
  43. package/dist/storybook/assets/{unit-table.test-case.stories-BIMbgiTz.js → unit-table.test-case.stories-tEype9om.js} +1 -1
  44. package/dist/storybook/iframe.html +1 -1
  45. package/dist/storybook/index.json +1 -1
  46. package/dist/storybook/project.json +1 -1
  47. package/package.json +1 -1
  48. package/dist/storybook/assets/menu.test-case.stories-BFYhvtSH.js +0 -3
  49. package/dist/storybook/assets/number-input.test-case.stories-BBKpBWfA.js +0 -92
  50. package/dist/storybook/assets/select.test-case.stories-B6On-PjA.js +0 -82
  51. package/dist/storybook/assets/toaster.test-case.stories-BhWnh4Cd.js +0 -6
@@ -1 +1 @@
1
- import{r as a}from"./index-DhsZuJvc.js";import{d as e}from"./index-C0x1JmaP.js";import{s as d}from"./number-input-CNnU6gOF.js";const x=r=>{const t=a.useRef();return a.useEffect(()=>{t.current=r},[r]),t.current},C=(r,t)=>{const n=t==null?void 0:t[r];return n||(console.log(`Warning: 'unitTemplate' missing for '${r}'. Using initial unit, preferred unit or value unit.`),e.unitFromQuantity(r)??"")},g=r=>r==="undefined"||r===void 0||r===""||r==="null"||r===null||r==="NaN"||isNaN(r),m=({value:r,unitkey:t,toUnit:n})=>{var s;const i=e.ALT_UNITS[t];return!(!i||i.length===0||!((s=e.validateNumber(r))!=null&&s.valid)||!i.includes(n))},W=({value:r,unitkey:t,toUnit:n,fromUnit:i,doNotConvertValue:s=!1,exactPrecision:f=!1})=>{var c;const u=e.isValueWithUnit(r)?e.getValue(r):r;if(s)return{value:u,error:null};const l=i||(e.isValueWithUnit(r)?e.getUnit(r):e.unitFromQuantity(t));if(!((c=e.validateNumber(u))!=null&&c.valid))return{value:void 0,error:"Invalid number format"};if(!n)return{value:void 0,error:"Target unit is missing"};if(!l)return{value:void 0,error:"Source unit is missing"};if(g(u))return{value:void 0,error:"Value is invalid for conversion"};try{const o=e.withUnit(u,l);if(m({value:o,toUnit:n,unitkey:t})){const v=f?e.convertSamePrecision(o,n):e.convertAndGetValue(o,n);return{value:e.getValue(d(v)),error:null}}return{value:e.getValue(o),error:null}}catch{return{value:void 0,error:"Conversion not possible"}}};let U=a.createContext(null);const S=()=>a.useContext(U);export{S as a,m as b,W as c,C as g,g as i,x as u};
1
+ import{r as a}from"./index-DhsZuJvc.js";import{d as e}from"./index-C0x1JmaP.js";import{s as d}from"./number-input-B3_gmeWr.js";const x=r=>{const t=a.useRef();return a.useEffect(()=>{t.current=r},[r]),t.current},C=(r,t)=>{const n=t==null?void 0:t[r];return n||(console.log(`Warning: 'unitTemplate' missing for '${r}'. Using initial unit, preferred unit or value unit.`),e.unitFromQuantity(r)??"")},g=r=>r==="undefined"||r===void 0||r===""||r==="null"||r===null||r==="NaN"||isNaN(r),m=({value:r,unitkey:t,toUnit:n})=>{var s;const i=e.ALT_UNITS[t];return!(!i||i.length===0||!((s=e.validateNumber(r))!=null&&s.valid)||!i.includes(n))},W=({value:r,unitkey:t,toUnit:n,fromUnit:i,doNotConvertValue:s=!1,exactPrecision:f=!1})=>{var c;const u=e.isValueWithUnit(r)?e.getValue(r):r;if(s)return{value:u,error:null};const l=i||(e.isValueWithUnit(r)?e.getUnit(r):e.unitFromQuantity(t));if(!((c=e.validateNumber(u))!=null&&c.valid))return{value:void 0,error:"Invalid number format"};if(!n)return{value:void 0,error:"Target unit is missing"};if(!l)return{value:void 0,error:"Source unit is missing"};if(g(u))return{value:void 0,error:"Value is invalid for conversion"};try{const o=e.withUnit(u,l);if(m({value:o,toUnit:n,unitkey:t})){const v=f?e.convertSamePrecision(o,n):e.convertAndGetValue(o,n);return{value:e.getValue(d(v)),error:null}}return{value:e.getValue(o),error:null}}catch{return{value:void 0,error:"Conversion not possible"}}};let U=a.createContext(null);const S=()=>a.useContext(U);export{S as a,m as b,W as c,C as g,g as i,x as u};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as r}from"./index-BcNHZKhG.js";import{Z as s,$ as n}from"./index-AKsHS-dO.js";import{NonExistentValue as a,Error as l}from"./select.stories-DjGSNDXK.js";import"./index-DhsZuJvc.js";import"./iframe-DOUoMheZ.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";import"./select-Cwks-WA0.js";import"./lodash-c4VUpsOs.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./types-Dx2TtIG9.js";import"./tooltip-1V7clEnw.js";import"./enum-Bnn40S8Q.js";import"./index-CEuq6vkz.js";import"./memoize-one.esm-CcMeOnPo.js";import"./types-BmbYqTX_.js";import"./text-B3-TSWok.js";import"./actions-Bax0KeqM.js";import"./button-Cbv7WK6k.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./badge-CLQ59MDF.js";import"./select.input-CJed_LLR.js";import"./helpers-JJxzGegQ.js";import"./spacer-BWoNR27H.js";import"./select.stories-data-DxgWKlU6.js";function o(t){const i={code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",strong:"strong",...r(),...t.components};return e.jsxs(e.Fragment,{children:[e.jsx(s,{title:"Input Validation"}),`
1
+ import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as r}from"./index-BcNHZKhG.js";import{Z as s,$ as n}from"./index-BlyDuQBv.js";import{NonExistentValue as a,Error as l}from"./select.stories-DjGSNDXK.js";import"./index-DhsZuJvc.js";import"./iframe-B0e2q2Zd.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";import"./select-Cwks-WA0.js";import"./lodash-c4VUpsOs.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./types-Dx2TtIG9.js";import"./tooltip-1V7clEnw.js";import"./enum-Bnn40S8Q.js";import"./index-CEuq6vkz.js";import"./memoize-one.esm-CcMeOnPo.js";import"./types-BmbYqTX_.js";import"./text-B3-TSWok.js";import"./actions-Bax0KeqM.js";import"./button-Cbv7WK6k.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./badge-CLQ59MDF.js";import"./select.input-CJed_LLR.js";import"./helpers-JJxzGegQ.js";import"./spacer-BWoNR27H.js";import"./select.stories-data-DxgWKlU6.js";function o(t){const i={code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",strong:"strong",...r(),...t.components};return e.jsxs(e.Fragment,{children:[e.jsx(s,{title:"Input Validation"}),`
2
2
  `,e.jsx(i.h1,{id:"input-validation",children:"Input Validation"}),`
3
3
  `,e.jsx(i.h2,{id:"select",children:"Select"}),`
4
4
  `,e.jsx(i.h3,{id:"invalid-states",children:"Invalid states"}),`
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as s}from"./index-BcNHZKhG.js";import{Z as r,$ as o}from"./index-AKsHS-dO.js";import{Default as l}from"./button.stories-C03VvX8K.js";import{Default as a}from"./check-box.stories-BJ0ShmeC.js";import{Default as c}from"./file-input.stories-DMTQqAF8.js";import{Default as d,Date as p}from"./input.stories-SJy3TKkD.js";import{Default as h}from"./number-input.stories-Bo26PJmJ.js";import{Default as m}from"./option-dropdown.stories-CznUbXVi.js";import{Default as u}from"./radio-button.stories-D1rWr6ms.js";import{Native as f,Default as x}from"./select.stories-DjGSNDXK.js";import{Default as j}from"./slider.stories-BqlRLY_C.js";import{Default as b}from"./textarea.stories-CzsqRVpC.js";import{Default as g}from"./toggle.stories-BAislK3I.js";import"./index-DhsZuJvc.js";import"./iframe-DOUoMheZ.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";import"./react-router-dom-Ck2Y_Fzc.js";import"./index-CEuq6vkz.js";import"./tiny-invariant-DqLgxztJ.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./flex-EllkLxgO.js";import"./button-Cbv7WK6k.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./tooltip-1V7clEnw.js";import"./check-box-DPLaOkRR.js";import"./help-icon-Buhx5nl6.js";import"./file-input-yalPf7-m.js";import"./lodash-c4VUpsOs.js";import"./input-group-BaRSJAEN.js";import"./input-Db9WkmPP.js";import"./types-Dx2TtIG9.js";import"./spacer-BWoNR27H.js";import"./message-BRyKdRaX.js";import"./textarea-DflOOrxV.js";import"./index-C0x1JmaP.js";import"./index-DRSy5Ssd.js";import"./number-input-CNnU6gOF.js";import"./enum-Bnn40S8Q.js";import"./helpers-JJxzGegQ.js";import"./actions-Bax0KeqM.js";import"./types-BmbYqTX_.js";import"./badge-CLQ59MDF.js";import"./divider-DY9nJ_7N.js";import"./text-B3-TSWok.js";import"./radio-button-C4ljBRED.js";import"./select.input-CJed_LLR.js";import"./select-Cwks-WA0.js";import"./memoize-one.esm-CcMeOnPo.js";import"./select.stories-data-DxgWKlU6.js";import"./slider-CcpE4BLD.js";import"./objectSpread2-DW4nTBoq.js";import"./index-BI4_Bp97.js";import"./toggle-BbFVf61v.js";function i(n){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",strong:"strong",ul:"ul",...s(),...n.components};return e.jsxs(e.Fragment,{children:[e.jsx(r,{title:"Inputs"}),`
1
+ import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as s}from"./index-BcNHZKhG.js";import{Z as r,$ as o}from"./index-BlyDuQBv.js";import{Default as l}from"./button.stories-C03VvX8K.js";import{Default as a}from"./check-box.stories-BJ0ShmeC.js";import{Default as c}from"./file-input.stories-DMTQqAF8.js";import{Default as d,Date as p}from"./input.stories-SJy3TKkD.js";import{Default as h}from"./number-input.stories-epjUq9ve.js";import{Default as m}from"./option-dropdown.stories-CznUbXVi.js";import{Default as u}from"./radio-button.stories-D1rWr6ms.js";import{Native as f,Default as x}from"./select.stories-DjGSNDXK.js";import{Default as j}from"./slider.stories-BqlRLY_C.js";import{Default as b}from"./textarea.stories-CzsqRVpC.js";import{Default as g}from"./toggle.stories-BAislK3I.js";import"./index-DhsZuJvc.js";import"./iframe-B0e2q2Zd.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";import"./react-router-dom-Ck2Y_Fzc.js";import"./index-CEuq6vkz.js";import"./tiny-invariant-DqLgxztJ.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./flex-EllkLxgO.js";import"./button-Cbv7WK6k.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./tooltip-1V7clEnw.js";import"./check-box-DPLaOkRR.js";import"./help-icon-Buhx5nl6.js";import"./file-input-yalPf7-m.js";import"./lodash-c4VUpsOs.js";import"./input-group-BaRSJAEN.js";import"./input-Db9WkmPP.js";import"./types-Dx2TtIG9.js";import"./spacer-BWoNR27H.js";import"./message-BRyKdRaX.js";import"./textarea-DflOOrxV.js";import"./index-C0x1JmaP.js";import"./index-DRSy5Ssd.js";import"./number-input-B3_gmeWr.js";import"./enum-Bnn40S8Q.js";import"./helpers-JJxzGegQ.js";import"./actions-Bax0KeqM.js";import"./types-BmbYqTX_.js";import"./badge-CLQ59MDF.js";import"./divider-DY9nJ_7N.js";import"./text-B3-TSWok.js";import"./radio-button-C4ljBRED.js";import"./select.input-CJed_LLR.js";import"./select-Cwks-WA0.js";import"./memoize-one.esm-CcMeOnPo.js";import"./select.stories-data-DxgWKlU6.js";import"./slider-CcpE4BLD.js";import"./objectSpread2-DW4nTBoq.js";import"./index-BI4_Bp97.js";import"./toggle-BbFVf61v.js";function i(n){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",strong:"strong",ul:"ul",...s(),...n.components};return e.jsxs(e.Fragment,{children:[e.jsx(r,{title:"Inputs"}),`
2
2
  `,e.jsx(t.h1,{id:"inputs",children:"Inputs"}),`
3
3
  `,e.jsx(t.p,{children:"React UI Library provides a comprehensive set of user input components."}),`
4
4
  `,e.jsx(t.h2,{id:"button",children:"Button"}),`
@@ -1,4 +1,4 @@
1
- import{j as t}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as n}from"./index-BcNHZKhG.js";import{Z as s,$ as o}from"./index-AKsHS-dO.js";import{Default as p,LabelOnLeft as m}from"./field.stories-CYpQ669-.js";import{Default as l,LabelsOnLeft as a,Row as h}from"./form.stories-BNORsn6Z.js";import"./index-DhsZuJvc.js";import"./iframe-DOUoMheZ.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";import"./field-HrLaMLbx.js";import"./index-Bk2sglWO.js";import"./label-CqmyC9he.js";import"./common-types-Sih75Sav.js";import"./help-icon-Buhx5nl6.js";import"./tooltip-1V7clEnw.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./index-CEuq6vkz.js";import"./disabled-context-rmpd7YJS.js";import"./input-Db9WkmPP.js";import"./types-Dx2TtIG9.js";import"./lodash-c4VUpsOs.js";import"./text-B3-TSWok.js";import"./select-Cwks-WA0.js";import"./enum-Bnn40S8Q.js";import"./memoize-one.esm-CcMeOnPo.js";import"./types-BmbYqTX_.js";import"./actions-Bax0KeqM.js";import"./button-Cbv7WK6k.js";import"./spinner-AWUe4xwQ.js";import"./badge-CLQ59MDF.js";import"./select.input-CJed_LLR.js";import"./helpers-JJxzGegQ.js";import"./check-box-DPLaOkRR.js";import"./button-group-D2fGP_bX.js";import"./toggle-BbFVf61v.js";import"./input-group-BaRSJAEN.js";import"./input-group-addon-D68iUKV2.js";import"./slider-CcpE4BLD.js";import"./objectSpread2-DW4nTBoq.js";import"./index-BI4_Bp97.js";import"./textarea-DflOOrxV.js";import"./radio-button-C4ljBRED.js";import"./form-row-CM112EYF.js";function r(i){const e={code:"code",h1:"h1",h2:"h2",p:"p",...n(),...i.components};return t.jsxs(t.Fragment,{children:[t.jsx(s,{title:"Layout (Forms)"}),`
1
+ import{j as t}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as n}from"./index-BcNHZKhG.js";import{Z as s,$ as o}from"./index-BlyDuQBv.js";import{Default as p,LabelOnLeft as m}from"./field.stories-CYpQ669-.js";import{Default as l,LabelsOnLeft as a,Row as h}from"./form.stories-BNORsn6Z.js";import"./index-DhsZuJvc.js";import"./iframe-B0e2q2Zd.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";import"./field-HrLaMLbx.js";import"./index-Bk2sglWO.js";import"./label-CqmyC9he.js";import"./common-types-Sih75Sav.js";import"./help-icon-Buhx5nl6.js";import"./tooltip-1V7clEnw.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./index-CEuq6vkz.js";import"./disabled-context-rmpd7YJS.js";import"./input-Db9WkmPP.js";import"./types-Dx2TtIG9.js";import"./lodash-c4VUpsOs.js";import"./text-B3-TSWok.js";import"./select-Cwks-WA0.js";import"./enum-Bnn40S8Q.js";import"./memoize-one.esm-CcMeOnPo.js";import"./types-BmbYqTX_.js";import"./actions-Bax0KeqM.js";import"./button-Cbv7WK6k.js";import"./spinner-AWUe4xwQ.js";import"./badge-CLQ59MDF.js";import"./select.input-CJed_LLR.js";import"./helpers-JJxzGegQ.js";import"./check-box-DPLaOkRR.js";import"./button-group-D2fGP_bX.js";import"./toggle-BbFVf61v.js";import"./input-group-BaRSJAEN.js";import"./input-group-addon-D68iUKV2.js";import"./slider-CcpE4BLD.js";import"./objectSpread2-DW4nTBoq.js";import"./index-BI4_Bp97.js";import"./textarea-DflOOrxV.js";import"./radio-button-C4ljBRED.js";import"./form-row-CM112EYF.js";function r(i){const e={code:"code",h1:"h1",h2:"h2",p:"p",...n(),...i.components};return t.jsxs(t.Fragment,{children:[t.jsx(s,{title:"Layout (Forms)"}),`
2
2
  `,t.jsx(e.h1,{id:"layout-forms",children:"Layout (Forms)"}),`
3
3
  `,t.jsx(e.h2,{id:"field",children:"Field"}),`
4
4
  `,t.jsxs(e.p,{children:["This is a wrapper for any form element with default bottom margin, and props like ",t.jsx(e.code,{children:"label"})," for other default styling."]}),`
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as s}from"./index-BcNHZKhG.js";import{Z as r,$ as n}from"./index-AKsHS-dO.js";import{Center as d,SpaceBetween as l,JustifyEnd as a,Column as c}from"./flex.stories-CLwPyEMp.js";import{Default as h,CustomColumnWidth as p,DefaultGap as x,CustomGap as m,Responsive as u}from"./grid.stories-DqjhHHwX.js";import{Default as j,FixedWidth as f,NoPadding as w,ResponsiveWidth as g}from"./column.stories-DDTHFELF.js";import"./index-DhsZuJvc.js";import"./iframe-DOUoMheZ.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";import"./flex-EllkLxgO.js";import"./button-Cbv7WK6k.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./index-CEuq6vkz.js";import"./tooltip-1V7clEnw.js";import"./text-B3-TSWok.js";import"./grid-DRkC-bt8.js";import"./styled-components.browser.esm-BQ9GQzDc.js";import"./card-EcjmryU9.js";import"./row-Bmiy2Lh0.js";import"./heading-CRNoBc7q.js";import"./help-icon-Buhx5nl6.js";function t(i){const o={code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",...s(),...i.components};return e.jsxs(e.Fragment,{children:[e.jsx(r,{title:"Layout (General)"}),`
1
+ import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as s}from"./index-BcNHZKhG.js";import{Z as r,$ as n}from"./index-BlyDuQBv.js";import{Center as d,SpaceBetween as l,JustifyEnd as a,Column as c}from"./flex.stories-CLwPyEMp.js";import{Default as h,CustomColumnWidth as p,DefaultGap as x,CustomGap as m,Responsive as u}from"./grid.stories-DqjhHHwX.js";import{Default as j,FixedWidth as f,NoPadding as w,ResponsiveWidth as g}from"./column.stories-DDTHFELF.js";import"./index-DhsZuJvc.js";import"./iframe-B0e2q2Zd.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";import"./flex-EllkLxgO.js";import"./button-Cbv7WK6k.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./index-CEuq6vkz.js";import"./tooltip-1V7clEnw.js";import"./text-B3-TSWok.js";import"./grid-DRkC-bt8.js";import"./styled-components.browser.esm-BQ9GQzDc.js";import"./card-EcjmryU9.js";import"./row-Bmiy2Lh0.js";import"./heading-CRNoBc7q.js";import"./help-icon-Buhx5nl6.js";function t(i){const o={code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",...s(),...i.components};return e.jsxs(e.Fragment,{children:[e.jsx(r,{title:"Layout (General)"}),`
2
2
  `,e.jsx(o.h1,{id:"layout-general",children:"Layout (General)"}),`
3
3
  `,e.jsx(o.h2,{id:"flex",children:"Flex"}),`
4
4
  `,e.jsxs(o.p,{children:["The ",e.jsx(o.code,{children:"Flex"})," component is a basic flexbox wrapper with optional props for ",e.jsx(o.code,{children:"alignItems"}),", ",e.jsx(o.code,{children:"justifyContent"})," and ",e.jsx(o.code,{children:"flexDirection"}),". This is a conveninent way to center items vertically and/or horizontally, to align them to opposite edges, or align them to the far side."]}),`
@@ -0,0 +1,3 @@
1
+ import{j as y}from"./jsx-runtime-eps93zm2.js";import{w as n,u as m,e as r}from"./index-DMAnyMX5.js";import{M as l}from"./actions-Bax0KeqM.js";import{m as g}from"./menu.stories-data-CQ59XhzU.js";import"./index-DhsZuJvc.js";import"./index-CF7H4eMJ.js";import"./index-Bk2sglWO.js";import"./lodash-c4VUpsOs.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./button-Cbv7WK6k.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./types-BmbYqTX_.js";import"./types-Dx2TtIG9.js";import"./badge-CLQ59MDF.js";import"./flex-EllkLxgO.js";const F={title:"Basic/Menu/Test Cases",component:l,args:{menu:g},tags:["!autodocs"]},w=s=>y.jsx(l,{...s}),t=w.bind({});t.args={testId:"testId"};t.play=async({canvasElement:s,step:a})=>{const u=n(s),e=n(s.ownerDocument.body);await a("Clicking trigger should open menu",async()=>{const i=u.getByTestId("testId");await m.click(i);const o=await e.findByTestId("testId-layer");await r(o).toBeInTheDocument()}),await a("Clicking disabled item should do nothing",async()=>{await e.getByText("Knight").click();const o=await e.findByTestId("testId-layer");await r(o).toBeInTheDocument()}),await a("Clicking item should close menu",async()=>{const i=e.getByText("King");await m.click(i);const o=e.queryByTestId("testId-layer");await r(o).not.toBeInTheDocument()})};var c,p,d;t.parameters={...t.parameters,docs:{...(c=t.parameters)==null?void 0:c.docs,source:{originalSource:`args => <Menu
2
+ // eslint-disable-next-line react/jsx-props-no-spreading
3
+ {...args} />`,...(d=(p=t.parameters)==null?void 0:p.docs)==null?void 0:d.source}}};const G=["Test"];export{t as Test,G as __namedExportsOrder,F as default};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-eps93zm2.js";import{w as u,e as i,u as d}from"./index-DMAnyMX5.js";import{M as g,D as h}from"./dialog-DkpQscuI.js";import{B as l}from"./button-Cbv7WK6k.js";import"./index-DhsZuJvc.js";import"./index-CF7H4eMJ.js";import"./index-Bk2sglWO.js";import"./portal-GQ0_cLB6.js";import"./index-CUZDtIZe.js";import"./lodash-c4VUpsOs.js";import"./common-types-Sih75Sav.js";import"./heading-CRNoBc7q.js";import"./help-icon-Buhx5nl6.js";import"./tooltip-1V7clEnw.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./disabled-context-rmpd7YJS.js";import"./spinner-AWUe4xwQ.js";const{useArgs:M}=__STORYBOOK_MODULE_PREVIEW_API__,H={title:"Modals/Modal/Test Cases",component:g,args:{visible:!0,centered:!0,width:"300px",heading:"Are you sure?",content:e.jsx(e.Fragment,{children:"This will complete the transaction"}),footer:e.jsxs(e.Fragment,{children:[e.jsx(l,{label:"Okay",colored:!0,onClick:()=>{}}),e.jsx(l,{label:"Cancel",onClick:()=>{}})]}),onClose:()=>{}},parameters:{docs:{story:{inline:!1,iframeHeight:400}}},tags:["!autodocs"]},x=()=>{const[{visible:a,centered:n,...t},r]=M(),o=()=>{r({visible:!a})};return e.jsxs(e.Fragment,{children:[e.jsx(g,{visible:a,centered:n,children:e.jsx(h,{dialog:{...t,onClose:o}})}),e.jsx(l,{label:"Open Modal",onClick:o})]})},s=x.bind({});s.args={testId:"testId"};s.play=async({canvasElement:a,step:n})=>{const t=a.parentElement?u(a.parentElement):null;await i(t).toBeTruthy(),t&&(await n("Modal should appear when triggered",async()=>{const r=t.getByText("Open Modal");await d.click(r);const o=t.getByTestId("testId");await i(o).toBeInTheDocument()}),await n("Modal should disappear when close button pressed",async()=>{const r=t.getByTestId("testId"),o=t.getByTestId("testId-dismiss");await d.click(o),await i(r).not.toBeInTheDocument()}))};var c,p,m;s.parameters={...s.parameters,docs:{...(c=s.parameters)==null?void 0:c.docs,source:{originalSource:`() => {
1
+ import{j as e}from"./jsx-runtime-eps93zm2.js";import{w as d,u as c,e as p}from"./index-DMAnyMX5.js";import{M as b,D as h}from"./dialog-DkpQscuI.js";import{B as l}from"./button-Cbv7WK6k.js";import"./index-DhsZuJvc.js";import"./index-CF7H4eMJ.js";import"./index-Bk2sglWO.js";import"./portal-GQ0_cLB6.js";import"./index-CUZDtIZe.js";import"./lodash-c4VUpsOs.js";import"./common-types-Sih75Sav.js";import"./heading-CRNoBc7q.js";import"./help-icon-Buhx5nl6.js";import"./tooltip-1V7clEnw.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./disabled-context-rmpd7YJS.js";import"./spinner-AWUe4xwQ.js";const{useArgs:M}=__STORYBOOK_MODULE_PREVIEW_API__,K={title:"Modals/Modal/Test Cases",component:b,args:{visible:!0,centered:!0,width:"300px",heading:"Are you sure?",content:e.jsx(e.Fragment,{children:"This will complete the transaction"}),footer:e.jsxs(e.Fragment,{children:[e.jsx(l,{label:"Okay",colored:!0,onClick:()=>{}}),e.jsx(l,{label:"Cancel",onClick:()=>{}})]}),onClose:()=>{}},parameters:{docs:{story:{inline:!1,iframeHeight:400}}},tags:["!autodocs"]},x=()=>{const[{visible:s,centered:a,...n},r]=M(),t=()=>{r({visible:!s})};return e.jsxs(e.Fragment,{children:[e.jsx(b,{visible:s,centered:a,children:e.jsx(h,{dialog:{...n,onClose:t}})}),e.jsx(l,{label:"Open Modal",onClick:t})]})},o=x.bind({});o.args={testId:"testId"};o.play=async({canvasElement:s,step:a})=>{const n=d(s),r=d(s.ownerDocument.body);await a("Modal should appear when triggered",async()=>{const t=n.getByText("Open Modal");await c.click(t);const i=r.getByTestId("testId");await p(i).toBeInTheDocument()}),await a("Modal should disappear when close button pressed",async()=>{const t=r.getByTestId("testId"),i=n.getByTestId("testId-dismiss");await c.click(i),await p(t).not.toBeInTheDocument()})};var m,g,u;o.parameters={...o.parameters,docs:{...(m=o.parameters)==null?void 0:m.docs,source:{originalSource:`() => {
2
2
  const [{
3
3
  visible,
4
4
  centered,
@@ -18,4 +18,4 @@ import{j as e}from"./jsx-runtime-eps93zm2.js";import{w as u,e as i,u as d}from".
18
18
  </Modal>
19
19
  <Button label="Open Modal" onClick={toggleModal} />
20
20
  </>;
21
- }`,...(m=(p=s.parameters)==null?void 0:p.docs)==null?void 0:m.source}}};const K=["Test"];export{s as Test,K as __namedExportsOrder,H as default};
21
+ }`,...(u=(g=o.parameters)==null?void 0:g.docs)==null?void 0:u.source}}};const L=["Test"];export{o as Test,L as __namedExportsOrder,K as default};
@@ -1,4 +1,4 @@
1
- import{j as R}from"./jsx-runtime-eps93zm2.js";import{r as l}from"./index-DhsZuJvc.js";import{d as a}from"./index-C0x1JmaP.js";import{K as J,E as Q}from"./enum-Bnn40S8Q.js";import{l as X}from"./lodash-c4VUpsOs.js";import{i as S}from"./helpers-JJxzGegQ.js";import{I as Y}from"./input-Db9WkmPP.js";const $=14,s=n=>String(a.toString(n)),ee=n=>a.isScientificStringNum(n)?n:s(a.roundToPrecision(a.toNum(n),$)),ne=n=>n?typeof n=="string"?n:X.isArray(n)?n[0]:n.fieldName:"",te=({name:n,placeholder:p="",disabled:C=!1,error:b=!1,left:L=!1,small:k=!1,width:x="100%",value:c="",onChange:j=()=>{},onFocus:M=()=>{},onBlur:O=()=>{},tabIndex:H=0,testId:K,tooltip:P=null,warning:_=!1,validationCallback:E=()=>{},allowEmpty:A=!1,isInTable:D,groupOrder:W,enableCosmeticRounding:w=!0,enableDisplayRounding:g=!1,roundDisplayValue:N,disableInternalErrorValidationMessages:B=!1})=>{const y=e=>{const t=a.validateNumber(e);return p&&S(e)?{valid:!0,errors:[]}:A&&e===""||t.valid?{...t,valid:!0,errors:void 0}:t},q=e=>{var d;const t=!!(e!=null&&e.endsWith("0")),f=w&&e&&!t&&((d=y(e))==null?void 0:d.valid)?ee(e):e;return s(f)},i=l.useRef(null),[r,h]=l.useState(q(s(c))),[u,V]=l.useState(!1),o=ne(n),{valid:v,errors:T}=y(r),I=T&&T.length&&!B?T[0]:null;l.useEffect(()=>{const e=q(s(c));a.toNum(r)!==a.toNum(e)&&h(e)},[c,w,g]),l.useEffect(()=>{!u&&!v?E(o,I):E(o,null)},[u,v,b]);const F=e=>{var f,d;const t=e instanceof KeyboardEvent?r:(f=e==null?void 0:e.target)==null?void 0:f.value,m=a.cleanNumStr(t.replaceAll(" ","").replaceAll("|",""));if(h(m),(d=y(m))!=null&&d.valid||p&&S(t)){const z={...e,target:{...e.target,value:a.stripLeadingZeros(s(m)),name:o}};j(z)}};l.useEffect(()=>{if(i&&(i!=null&&i.current)&&g&&u){const e=i.current;e&&setTimeout(()=>{const{length:t}=s(r);e.setSelectionRange(t,t)},0)}},[u]);const U=e=>{V(!0),M(e)},Z=e=>{V(!1),O(e)},G=g&&!u&&v?N?s(N(r)):a.roundToFixed(r,2):r;return R.jsx(J,{handleKeys:[Q.ENTER],onKeyEvent:(e,t)=>F(t),children:R.jsx(Y,{type:"text",name:o,testId:K,disabled:C,placeholder:p,value:G,onChange:F,onFocus:U,onBlur:Z,error:I||b,warning:_,right:!L,small:k,width:x,isInTable:D,groupOrder:W,tabIndex:H,tooltip:P,ref:i},o)})};te.__docgenInfo={description:"",methods:[],displayName:"NumberInput",props:{name:{required:!1,tsType:{name:"union",raw:"string | { fieldName: string }",elements:[{name:"string"},{name:"signature",type:"object",raw:"{ fieldName: string }",signature:{properties:[{key:"fieldName",value:{name:"string",required:!0}}]}}]},description:""},placeholder:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},disabled:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},error:{required:!1,tsType:{name:"union",raw:"string | boolean",elements:[{name:"string"},{name:"boolean"}]},description:"",defaultValue:{value:"false",computed:!1}},left:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},small:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},width:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:"",defaultValue:{value:"'100%'",computed:!1}},value:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:"",defaultValue:{value:"''",computed:!1}},onChange:{required:!1,tsType:{name:"signature",type:"function",raw:`(
1
+ import{j as R}from"./jsx-runtime-eps93zm2.js";import{r as u}from"./index-DhsZuJvc.js";import{d as a}from"./index-C0x1JmaP.js";import{K as J,E as Q}from"./enum-Bnn40S8Q.js";import{l as X}from"./lodash-c4VUpsOs.js";import{i as S}from"./helpers-JJxzGegQ.js";import{I as Y}from"./input-Db9WkmPP.js";const $=14,s=n=>String(a.toString(n)),ee=n=>a.isScientificStringNum(n)?n:s(a.roundToPrecision(a.toNum(n),$)),ne=n=>n?typeof n=="string"?n:X.isArray(n)?n[0]:n.fieldName:"",te=({name:n,placeholder:p="",disabled:C=!1,error:b=!1,left:L=!1,small:k=!1,width:x="100%",value:c="",onChange:j=()=>{},onFocus:M=()=>{},onBlur:O=()=>{},tabIndex:H=0,testId:K,tooltip:_=null,warning:A=!1,validationCallback:E=()=>{},allowEmpty:D=!1,isInTable:P,groupOrder:W,enableCosmeticRounding:N=!0,enableDisplayRounding:g=!1,roundDisplayValue:w,disableInternalErrorValidationMessages:B=!1})=>{const y=e=>{const t=a.validateNumber(e),l=p&&S(e);return[1/0,-1/0].includes(Number(e))?{valid:!0,errors:[]}:l?{valid:!0,errors:[]}:D&&e===""||t.valid?{...t,valid:!0,errors:void 0}:t},q=e=>{var f;const t=!!(e!=null&&e.endsWith("0")),d=N&&e&&!t&&((f=y(e))==null?void 0:f.valid)?ee(e):e;return s(d)},i=u.useRef(null),[r,h]=u.useState(q(s(c))),[o,I]=u.useState(!1),m=ne(n),{valid:v,errors:T}=y(r),V=T&&T.length&&!B?T[0]:null;u.useEffect(()=>{const e=q(s(c));a.toNum(r)!==a.toNum(e)&&h(e)},[c,N,g]),u.useEffect(()=>{!o&&!v?E(m,V):E(m,null)},[o,v,b]);const F=e=>{var d,f;const t=e instanceof KeyboardEvent?r:(d=e==null?void 0:e.target)==null?void 0:d.value,l=a.cleanNumStr(t.replaceAll(" ","").replaceAll("|",""));if(h(l),(f=y(l))!=null&&f.valid||p&&S(t)){const z={...e,target:{...e.target,value:a.stripLeadingZeros(s(l)),name:m}};j(z)}};u.useEffect(()=>{if(i&&(i!=null&&i.current)&&g&&o){const e=i.current;e&&setTimeout(()=>{const{length:t}=s(r);e.setSelectionRange(t,t)},0)}},[o]);const U=e=>{I(!0),M(e)},Z=e=>{I(!1),O(e)},G=g&&!o&&v?w?s(w(r)):a.roundToFixed(r,2):r;return R.jsx(J,{handleKeys:[Q.ENTER],onKeyEvent:(e,t)=>F(t),children:R.jsx(Y,{type:"text",name:m,testId:K,disabled:C,placeholder:p,value:G,onChange:F,onFocus:U,onBlur:Z,error:V||b,warning:A,right:!L,small:k,width:x,isInTable:P,groupOrder:W,tabIndex:H,tooltip:_,ref:i},m)})};te.__docgenInfo={description:"",methods:[],displayName:"NumberInput",props:{name:{required:!1,tsType:{name:"union",raw:"string | { fieldName: string }",elements:[{name:"string"},{name:"signature",type:"object",raw:"{ fieldName: string }",signature:{properties:[{key:"fieldName",value:{name:"string",required:!0}}]}}]},description:""},placeholder:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},disabled:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},error:{required:!1,tsType:{name:"union",raw:"string | boolean",elements:[{name:"string"},{name:"boolean"}]},description:"",defaultValue:{value:"false",computed:!1}},left:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},small:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},width:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:"",defaultValue:{value:"'100%'",computed:!1}},value:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:"",defaultValue:{value:"''",computed:!1}},onChange:{required:!1,tsType:{name:"signature",type:"function",raw:`(
2
2
  event: TChangeEvent<T>,
3
3
  ...additionalProps: { [key: string]: any }[]
4
4
  ) => void`,signature:{arguments:[{type:{name:"intersection",raw:`ChangeEvent<T> & {
@@ -1,4 +1,4 @@
1
- import{j as Q}from"./jsx-runtime-eps93zm2.js";import{d as X}from"./index-C0x1JmaP.js";import{N as q}from"./number-input-CNnU6gOF.js";import"./index-DhsZuJvc.js";import"./index-DRSy5Ssd.js";import"./enum-Bnn40S8Q.js";import"./index-CEuq6vkz.js";import"./lodash-c4VUpsOs.js";import"./helpers-JJxzGegQ.js";import"./input-Db9WkmPP.js";import"./index-Bk2sglWO.js";import"./disabled-context-rmpd7YJS.js";import"./types-Dx2TtIG9.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";const{useArgs:Z}=__STORYBOOK_MODULE_PREVIEW_API__,he={title:"Forms/NumberInput",component:q,parameters:{canvas:{page:null}},args:{label:"Label"}},e=c=>{const[$,z]=Z(),G=J=>{z({value:J.target.value})};return Q.jsx(q,{onChange:G,value:123,...c})},d=e.bind({}),n=e.bind({});n.args={small:!0};const a=e.bind({});a.args={width:"150px"};const r=e.bind({});r.args={left:!0};const t=e.bind({});t.args={disabled:!0};const s=e.bind({});s.args={allowEmpty:!0,value:""};const u=e.bind({});u.args={warning:"This input number is almost 100!",value:"99"};const o=e.bind({});o.args={error:"This is a error message"};const g=e.bind({});g.args={value:"123test"};const p=e.bind({});p.args={value:"123.123456789",enableDisplayRounding:!0};const l=e.bind({});l.args={value:"123.123456789",enableDisplayRounding:!0,roundDisplayValue:c=>X.roundToFixed(c,4)};var m,i,h;d.parameters={...d.parameters,docs:{...(m=d.parameters)==null?void 0:m.docs,source:{originalSource:`args => {
1
+ import{j as Q}from"./jsx-runtime-eps93zm2.js";import{d as X}from"./index-C0x1JmaP.js";import{N as q}from"./number-input-B3_gmeWr.js";import"./index-DhsZuJvc.js";import"./index-DRSy5Ssd.js";import"./enum-Bnn40S8Q.js";import"./index-CEuq6vkz.js";import"./lodash-c4VUpsOs.js";import"./helpers-JJxzGegQ.js";import"./input-Db9WkmPP.js";import"./index-Bk2sglWO.js";import"./disabled-context-rmpd7YJS.js";import"./types-Dx2TtIG9.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";const{useArgs:Z}=__STORYBOOK_MODULE_PREVIEW_API__,he={title:"Forms/NumberInput",component:q,parameters:{canvas:{page:null}},args:{label:"Label"}},e=c=>{const[$,z]=Z(),G=J=>{z({value:J.target.value})};return Q.jsx(q,{onChange:G,value:123,...c})},d=e.bind({}),n=e.bind({});n.args={small:!0};const a=e.bind({});a.args={width:"150px"};const r=e.bind({});r.args={left:!0};const t=e.bind({});t.args={disabled:!0};const s=e.bind({});s.args={allowEmpty:!0,value:""};const u=e.bind({});u.args={warning:"This input number is almost 100!",value:"99"};const o=e.bind({});o.args={error:"This is a error message"};const g=e.bind({});g.args={value:"123test"};const p=e.bind({});p.args={value:"123.123456789",enableDisplayRounding:!0};const l=e.bind({});l.args={value:"123.123456789",enableDisplayRounding:!0,roundDisplayValue:c=>X.roundToFixed(c,4)};var m,i,h;d.parameters={...d.parameters,docs:{...(m=d.parameters)==null?void 0:m.docs,source:{originalSource:`args => {
2
2
  const [_, updateArgs] = useArgs();
3
3
  const handleChange = (evt: ChangeEvent<HTMLInputElement>) => {
4
4
  updateArgs({
@@ -0,0 +1,95 @@
1
+ import{j as a}from"./jsx-runtime-eps93zm2.js";import{r as l}from"./index-DhsZuJvc.js";import{w as u,u as n,e as o,f as D,a as C}from"./index-DMAnyMX5.js";import{S as x}from"./spacer-BWoNR27H.js";import{G as Z}from"./grid-DRkC-bt8.js";import{C as m}from"./card-EcjmryU9.js";import{B as $}from"./button-Cbv7WK6k.js";import{H as p}from"./heading-CRNoBc7q.js";import{I as se}from"./input-group-addon-D68iUKV2.js";import{S as re}from"./select-Cwks-WA0.js";import{I as oe}from"./input-group-BaRSJAEN.js";import{F as R}from"./field-HrLaMLbx.js";import{T as j}from"./toggle-BbFVf61v.js";import{T as ie}from"./text-B3-TSWok.js";import{M as le}from"./message-BRyKdRaX.js";import{I as ee}from"./icon-BSFY3vDO.js";import{N as c}from"./number-input-B3_gmeWr.js";import"./index-CF7H4eMJ.js";import"./styled-components.browser.esm-BQ9GQzDc.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./spinner-AWUe4xwQ.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./help-icon-Buhx5nl6.js";import"./lodash-c4VUpsOs.js";import"./types-Dx2TtIG9.js";import"./enum-Bnn40S8Q.js";import"./index-CEuq6vkz.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./memoize-one.esm-CcMeOnPo.js";import"./types-BmbYqTX_.js";import"./actions-Bax0KeqM.js";import"./badge-CLQ59MDF.js";import"./select.input-CJed_LLR.js";import"./helpers-JJxzGegQ.js";import"./label-CqmyC9he.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./index-C0x1JmaP.js";import"./index-DRSy5Ssd.js";import"./input-Db9WkmPP.js";const Ze={title:"Forms/NumberInput/Test Cases",component:c,parameters:{canvas:{page:null}},args:{label:"Label"},tags:["!autodocs"]},w=()=>a.jsxs(oe,{small:!0,children:[a.jsx(c,{value:123}),a.jsx(se,{children:"to"}),a.jsx(c,{value:123}),a.jsx(re,{options:[{value:"units",label:"units"}],width:"auto",value:"units"})]}),g=()=>{const[r,s]=l.useState("123|m");return a.jsx(c,{name:"example",onChange:e=>s(e.target.value),placeholder:"Type a value...",value:r,testId:"testId"})};g.play=async({canvasElement:r,step:s})=>{const e=u(r),i=u(r.ownerDocument.body);await s("Shows validation error for non-numeric input",async()=>{const t=e.getByTestId("testId");await n.clear(t),await n.type(t,"123x45s6"),await o(e.getByDisplayValue("123x45s6")).toBeInTheDocument(),await D.mouseOver(t),await o(t.getAttribute("data-error")).toEqual("Must be a numerical value"),await C(()=>{o(i.getByText("Must be a numerical value")).toBeInTheDocument()})})};const y=()=>{const[r,s]=l.useState("123");return a.jsx(c,{value:r,onChange:e=>{s(e.target.value)},testId:"testId",enableDisplayRounding:!0})};y.play=async({canvasElement:r,step:s})=>{const e=u(r);await s("Value should be rounded on blur",async()=>{const i=e.getByTestId("testId");await n.clear(i),await n.type(i,"123.123456789"),await n.click(r),await o(e.getByDisplayValue("123.12")).toBeInTheDocument()}),await s("Full value shown on focus",async()=>{const i=e.getByTestId("testId");await n.click(i),await o(e.getByDisplayValue("123.123456789")).toBeInTheDocument()})};const f=()=>{const[r,s]=l.useState(!0),e=()=>{s(!1),setTimeout(()=>s(!0),0)},[i,t]=l.useState("123");return a.jsxs(Z,{columns:"1fr 1fr",gap:!0,children:[a.jsxs(m,{heading:a.jsx(p,{children:"Storage State (Redux)"}),children:[i,a.jsx(x,{}),a.jsx($,{label:"Change value",onClick:()=>t(String(Math.floor(Math.random()*100)))})]}),a.jsx(m,{heading:a.jsx(p,{icon:a.jsx(ee,{icon:"refresh"}),onIconClick:e,children:"NumberInput"}),children:r&&a.jsx(c,{value:i,onChange:v=>{t(v.target.value)},error:Number(i)>=0?"":"Value must be positive"})})]})},I=()=>{const[r,s]=l.useState(!0),e=()=>{s(!1),setTimeout(()=>s(!0),0)},[i,t]=l.useState(!1),[v,te]=l.useState(!0),[T,S]=l.useState("0.6889763779527558"),[V,ae]=l.useState(""),ne=Number(T)*.3048;return a.jsxs(Z,{columns:"1fr 1fr",gap:!0,children:[a.jsxs(m,{heading:a.jsx(p,{children:"Settings"}),children:[a.jsx(R,{label:"Enable display rounding:",labelLeft:!0,labelWidth:200,children:a.jsx(j,{checked:i,onChange:d=>t(d.target.checked)})}),a.jsx(R,{label:"Enable cosmetic rounding:",labelLeft:!0,labelWidth:200,children:a.jsx(j,{checked:v,onChange:d=>te(d.target.checked)})})]}),a.jsxs(m,{heading:a.jsx(p,{icon:a.jsx(ee,{icon:"refresh",testId:"triggerRerenderTestId"}),onIconClick:e,children:"NumberInput (displayed in Meters)"}),children:[a.jsx(ie,{faint:!0,children:"Cosmetic Rounding Test Cases: type 0.21 then return (compare with enableCosmeticRounding on and off)"}),a.jsx(x,{}),r&&a.jsx(c,{name:"Example",value:ne,onChange:d=>{const B=String(Number(d.target.value)/.3048);S(B)},enableDisplayRounding:i,enableCosmeticRounding:v,error:Number(T)>=0?"":"Value must be positive",validationCallback:(d,B)=>{ae(B??"")},testId:"testId"})]}),a.jsxs(m,{heading:a.jsx(p,{children:"Storage State / Redux (stored in Feet)"}),children:[T,a.jsx(x,{}),a.jsx($,{label:"Change value",onClick:()=>S(String(Math.floor(Math.random()*100)))})]}),a.jsx(m,{heading:a.jsx(p,{children:"Test Validation Callback"}),children:V&&a.jsx(le,{message:{content:V,icon:!0,type:"Error",visible:!0}})})]})};I.play=async({canvasElement:r,step:s})=>{const e=u(r),i=u(r.ownerDocument.body);await s("Can enter decimal values",async()=>{const t=e.getByTestId("testId");await n.clear(t),await n.type(t,"123.123456789"),await n.click(r),await o(e.getByDisplayValue("123.123456789")).toBeInTheDocument()}),await s("Can enter scientific notation when storage unit is different",async()=>{const t=e.getByTestId("testId");await n.clear(t),await n.type(t,"-1.12e-3"),await o(e.getByDisplayValue("-1.12e-3")).toBeInTheDocument(),await e.getByTestId("triggerRerenderTestId").click(),await C(()=>{o(e.getByDisplayValue(-.00112)).toBeInTheDocument()})}),await s("Can enter comma decimals (converts to dot)",async()=>{const t=e.getByTestId("testId");await n.clear(t),await n.type(t,"123,456"),await o(e.getByDisplayValue("123.456")).toBeInTheDocument()}),await s("Can enter small numbers",async()=>{const t=e.getByTestId("testId");await n.clear(t),await n.type(t,"0.0000000023"),await o(e.getByDisplayValue("0.0000000023")).toBeInTheDocument()}),await s("Can enter large numbers",async()=>{const t=e.getByTestId("testId");await n.clear(t),await n.type(t,"999999999999"),await o(e.getByDisplayValue("999999999999")).toBeInTheDocument()}),await s("Shows validation error for non-numeric input",async()=>{const t=e.getByTestId("testId");await n.clear(t),await n.type(t,"123x45s6"),await n.click(r),await o(e.getByDisplayValue("123x45s6")).toBeInTheDocument(),await o(t.getAttribute("data-error")).toEqual("Must be a numerical value"),await D.mouseOver(t),await C(()=>{o(i.getAllByText("Must be a numerical value").length).toEqual(2)})})};const h=()=>{const[r,s]=l.useState("123");return a.jsx(c,{value:r,onChange:e=>{s(e.target.value)},testId:"testId"})};h.play=async({canvasElement:r,step:s})=>{const e=u(r),i=u(r.ownerDocument.body);await s("Can enter decimal values",async()=>{const t=e.getByTestId("testId");await n.clear(t),await n.type(t,"123.123456789"),await o(e.getByDisplayValue("123.123456789")).toBeInTheDocument()}),await s("Can enter scientific notation",async()=>{const t=e.getByTestId("testId");await n.clear(t),await n.type(t,"-1.12e3"),await o(e.getByDisplayValue("-1.12e3")).toBeInTheDocument()}),await s("Can enter comma decimals (converts to dot)",async()=>{const t=e.getByTestId("testId");await n.clear(t),await n.type(t,"123,456"),await o(e.getByDisplayValue("123.456")).toBeInTheDocument()}),await s("Can enter small numbers",async()=>{const t=e.getByTestId("testId");await n.clear(t),await n.type(t,"0.0000000023"),await o(e.getByDisplayValue("0.0000000023")).toBeInTheDocument()}),await s("Can enter large numbers",async()=>{const t=e.getByTestId("testId");await n.clear(t),await n.type(t,"999999999999"),await o(e.getByDisplayValue("999999999999")).toBeInTheDocument()}),await s("Shows validation error for non-numeric input",async()=>{const t=e.getByTestId("testId");await n.clear(t),await n.type(t,"123x45s6"),await o(e.getByDisplayValue("123x45s6")).toBeInTheDocument(),await o(t.getAttribute("data-error")).toEqual("Must be a numerical value"),await D.mouseOver(t),await C(()=>{o(i.getByText("Must be a numerical value")).toBeInTheDocument()})})};const b=()=>{const[r,s]=l.useState("123|m");return a.jsx(c,{name:"example",onChange:e=>s(e.target.value),placeholder:"Type a value...",value:r,testId:"testId"})};b.play=async({canvasElement:r,step:s})=>{const e=u(r);u(r.ownerDocument.body),await s("Shows validation error for non-numeric input",async()=>{const i=e.getByTestId("testId");await n.clear(i),await n.type(i,"Infinity"),await o(e.getByDisplayValue("Infinity")).toBeInTheDocument(),await o(i.getAttribute("data-error")).toBeNull()}),await s("Shows validation error for non-numeric input",async()=>{const i=e.getByTestId("testId");await n.clear(i),await n.type(i,"-Infinity"),await o(e.getByDisplayValue("-Infinity")).toBeInTheDocument(),await o(i.getAttribute("data-error")).toBeNull()})};w.__docgenInfo={description:"",methods:[],displayName:"TestInputGroup"};g.__docgenInfo={description:"",methods:[{name:"play",docblock:null,modifiers:["static"],params:[{name:"{ canvasElement, step }",optional:!1,type:null}],returns:null}],displayName:"Placeholder"};y.__docgenInfo={description:"",methods:[{name:"play",docblock:null,modifiers:["static"],params:[{name:"{ canvasElement, step }",optional:!1,type:null}],returns:null}],displayName:"TestDisplayRounding"};f.__docgenInfo={description:"",methods:[],displayName:"ManagedTestCase"};I.__docgenInfo={description:"",methods:[{name:"play",docblock:null,modifiers:["static"],params:[{name:"{ canvasElement, step }",optional:!1,type:null}],returns:null}],displayName:"DemoCosmeticRounding"};h.__docgenInfo={description:"",methods:[{name:"play",docblock:null,modifiers:["static"],params:[{name:"{ canvasElement, step }",optional:!1,type:null}],returns:null}],displayName:"TestUserInput"};b.__docgenInfo={description:"",methods:[{name:"play",docblock:null,modifiers:["static"],params:[{name:"{ canvasElement, step }",optional:!1,type:null}],returns:null}],displayName:"InfinityTest"};var k,N,E;w.parameters={...w.parameters,docs:{...(k=w.parameters)==null?void 0:k.docs,source:{originalSource:`() => <InputGroup small>
2
+ <NumberInput value={123} />
3
+ <InputGroupAddon>to</InputGroupAddon>
4
+ <NumberInput value={123} />
5
+ <Select options={[{
6
+ value: 'units',
7
+ label: 'units'
8
+ }]} width="auto" value="units" />
9
+ </InputGroup>`,...(E=(N=w.parameters)==null?void 0:N.docs)==null?void 0:E.source}}};var M,F,_;g.parameters={...g.parameters,docs:{...(M=g.parameters)==null?void 0:M.docs,source:{originalSource:`() => {
10
+ const [value, setValue] = useState('123|m');
11
+ return <NumberInput name="example" onChange={evt => setValue(evt.target.value)} placeholder="Type a value..." value={value} testId="testId" />;
12
+ }`,...(_=(F=g.parameters)==null?void 0:F.docs)==null?void 0:_.source}}};var G,H,A;y.parameters={...y.parameters,docs:{...(G=y.parameters)==null?void 0:G.docs,source:{originalSource:`() => {
13
+ const [value, setValue] = useState('123');
14
+ return <NumberInput value={value} onChange={evt => {
15
+ setValue(evt.target.value);
16
+ }} testId="testId" enableDisplayRounding />;
17
+ }`,...(A=(H=y.parameters)==null?void 0:H.docs)==null?void 0:A.source}}};var L,q,O;f.parameters={...f.parameters,docs:{...(L=f.parameters)==null?void 0:L.docs,source:{originalSource:`() => {
18
+ const [visible, setVisible] = useState(true);
19
+ const triggerRerender = () => {
20
+ setVisible(false);
21
+ setTimeout(() => setVisible(true), 0);
22
+ };
23
+ const [value, setValue] = useState('123');
24
+ return <Grid columns="1fr 1fr" gap>
25
+ <Card heading={<Heading>Storage State (Redux)</Heading>}>
26
+ {value}
27
+ <Spacer />
28
+ <Button label="Change value" onClick={() => setValue(String(Math.floor(Math.random() * 100)))} />
29
+ </Card>
30
+ <Card heading={<Heading icon={<Icon icon="refresh" />} onIconClick={triggerRerender}>
31
+ NumberInput
32
+ </Heading>}>
33
+ {visible && <NumberInput value={value} onChange={evt => {
34
+ setValue(evt.target.value);
35
+ }} error={Number(value) >= 0 ? '' : 'Value must be positive'} />}
36
+ </Card>
37
+ </Grid>;
38
+ }`,...(O=(q=f.parameters)==null?void 0:q.docs)==null?void 0:O.source}}};var W,P,U;I.parameters={...I.parameters,docs:{...(W=I.parameters)==null?void 0:W.docs,source:{originalSource:`() => {
39
+ const [visible, setVisible] = useState(true);
40
+ const triggerRerender = () => {
41
+ setVisible(false);
42
+ setTimeout(() => setVisible(true), 0);
43
+ };
44
+ const [enableDisplayRounding, setEnableDisplayRounding] = useState(false);
45
+ const [enableCosmeticRounding, setEnableCosmeticRounding] = useState(true);
46
+ const [valueInFeet, setValueInFeet] = useState('0.6889763779527558');
47
+ const [callBackError, setCallBackError] = useState('');
48
+ const valueInMeters = Number(valueInFeet) * 0.3048;
49
+ return <Grid columns="1fr 1fr" gap>
50
+ <Card heading={<Heading>Settings</Heading>}>
51
+ <Field label="Enable display rounding:" labelLeft labelWidth={200}>
52
+ <Toggle checked={enableDisplayRounding} onChange={evt => setEnableDisplayRounding(evt.target.checked)} />
53
+ </Field>
54
+ <Field label="Enable cosmetic rounding:" labelLeft labelWidth={200}>
55
+ <Toggle checked={enableCosmeticRounding} onChange={evt => setEnableCosmeticRounding(evt.target.checked)} />
56
+ </Field>
57
+ </Card>
58
+ <Card heading={<Heading icon={<Icon icon="refresh" testId="triggerRerenderTestId" />} onIconClick={triggerRerender}>
59
+ NumberInput (displayed in Meters)
60
+ </Heading>}>
61
+ <Text faint>
62
+ Cosmetic Rounding Test Cases: type 0.21 then return (compare with
63
+ enableCosmeticRounding on and off)
64
+ </Text>
65
+ <Spacer />
66
+ {visible && <NumberInput name="Example" value={valueInMeters} onChange={evt => {
67
+ const nextValueInFeet = String(Number(evt.target.value) / 0.3048);
68
+ setValueInFeet(nextValueInFeet); // convert back to ft
69
+ }} enableDisplayRounding={enableDisplayRounding} enableCosmeticRounding={enableCosmeticRounding} error={Number(valueInFeet) >= 0 ? '' : 'Value must be positive'} validationCallback={(name, error) => {
70
+ setCallBackError(error ?? '');
71
+ }} testId="testId" />}
72
+ </Card>
73
+ <Card heading={<Heading>Storage State / Redux (stored in Feet)</Heading>}>
74
+ {valueInFeet}
75
+ <Spacer />
76
+ <Button label="Change value" onClick={() => setValueInFeet(String(Math.floor(Math.random() * 100)))} />
77
+ </Card>
78
+ <Card heading={<Heading>Test Validation Callback</Heading>}>
79
+ {callBackError && <Message message={{
80
+ content: callBackError,
81
+ icon: true,
82
+ type: 'Error',
83
+ visible: true
84
+ }} />}
85
+ </Card>
86
+ </Grid>;
87
+ }`,...(U=(P=I.parameters)==null?void 0:P.docs)==null?void 0:U.source}}};var z,J,K;h.parameters={...h.parameters,docs:{...(z=h.parameters)==null?void 0:z.docs,source:{originalSource:`() => {
88
+ const [value, setValue] = useState('123');
89
+ return <NumberInput value={value} onChange={evt => {
90
+ setValue(evt.target.value);
91
+ }} testId="testId" />;
92
+ }`,...(K=(J=h.parameters)==null?void 0:J.docs)==null?void 0:K.source}}};var Q,X,Y;b.parameters={...b.parameters,docs:{...(Q=b.parameters)==null?void 0:Q.docs,source:{originalSource:`() => {
93
+ const [value, setValue] = useState('123|m');
94
+ return <NumberInput name="example" onChange={evt => setValue(evt.target.value)} placeholder="Type a value..." value={value} testId="testId" />;
95
+ }`,...(Y=(X=b.parameters)==null?void 0:X.docs)==null?void 0:Y.source}}};const $e=["TestInputGroup","Placeholder","TestDisplayRounding","ManagedTestCase","DemoCosmeticRounding","TestUserInput","InfinityTest"];export{I as DemoCosmeticRounding,b as InfinityTest,f as ManagedTestCase,g as Placeholder,y as TestDisplayRounding,w as TestInputGroup,h as TestUserInput,$e as __namedExportsOrder,Ze as default};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as r}from"./index-BcNHZKhG.js";import{Z as t}from"./index-AKsHS-dO.js";import"./index-DhsZuJvc.js";import"./iframe-DOUoMheZ.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";function i(s){const n={code:"code",h1:"h1",h2:"h2",li:"li",p:"p",strong:"strong",ul:"ul",...r(),...s.components};return e.jsxs(e.Fragment,{children:[e.jsx(t,{title:"Padding, Margin & Size"}),`
1
+ import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as r}from"./index-BcNHZKhG.js";import{Z as t}from"./index-BlyDuQBv.js";import"./index-DhsZuJvc.js";import"./iframe-B0e2q2Zd.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";function i(s){const n={code:"code",h1:"h1",h2:"h2",li:"li",p:"p",strong:"strong",ul:"ul",...r(),...s.components};return e.jsxs(e.Fragment,{children:[e.jsx(t,{title:"Padding, Margin & Size"}),`
2
2
  `,e.jsx(n.h1,{id:"padding-margin--size",children:"Padding, Margin & Size"}),`
3
3
  `,e.jsx(n.h2,{id:"padding--margin",children:"Padding & Margin"}),`
4
4
  `,e.jsx(n.p,{children:"There are standard CSS spacing variables for padding and margin."}),`
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DocsRenderer-PKQXORMH-C_QE44cn.js","./chunk-HLWAVYOI-EhWEisNT.js","./iframe-DOUoMheZ.js","./index-DhsZuJvc.js","./react-16-DXAfArL2.js","./index-CUZDtIZe.js","./index-AKsHS-dO.js","./inheritsLoose-DP0QEDDI.js","./assertThisInitialized-B9jnkVVz.js","./index-D6rZ4wEC.js"])))=>i.map(i=>d[i]);
2
- import{_ as a}from"./iframe-DOUoMheZ.js";import"../sb-preview/runtime.js";const{global:s}=__STORYBOOK_MODULE_GLOBAL__;var _=Object.entries(s.TAGS_OPTIONS??{}).reduce((e,r)=>{let[t,o]=r;return o.excludeFromDocsStories&&(e[t]=!0),e},{}),d={docs:{renderer:async()=>{let{DocsRenderer:e}=await a(()=>import("./DocsRenderer-PKQXORMH-C_QE44cn.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url);return new e},stories:{filter:e=>{var r;return(e.tags||[]).filter(t=>_[t]).length===0&&!((r=e.parameters.docs)!=null&&r.disable)}}}};export{d as parameters};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DocsRenderer-PKQXORMH-giM41WN8.js","./chunk-HLWAVYOI-Dvbg03uT.js","./iframe-B0e2q2Zd.js","./index-DhsZuJvc.js","./react-16-DXAfArL2.js","./index-CUZDtIZe.js","./index-BlyDuQBv.js","./inheritsLoose-DP0QEDDI.js","./assertThisInitialized-B9jnkVVz.js","./index-D6rZ4wEC.js"])))=>i.map(i=>d[i]);
2
+ import{_ as a}from"./iframe-B0e2q2Zd.js";import"../sb-preview/runtime.js";const{global:s}=__STORYBOOK_MODULE_GLOBAL__;var _=Object.entries(s.TAGS_OPTIONS??{}).reduce((e,r)=>{let[t,o]=r;return o.excludeFromDocsStories&&(e[t]=!0),e},{}),d={docs:{renderer:async()=>{let{DocsRenderer:e}=await a(()=>import("./DocsRenderer-PKQXORMH-giM41WN8.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url);return new e},stories:{filter:e=>{var r;return(e.tags||[]).filter(t=>_[t]).length===0&&!((r=e.parameters.docs)!=null&&r.disable)}}}};export{d as parameters};
@@ -1,3 +1,3 @@
1
- import{j as s}from"./jsx-runtime-eps93zm2.js";import{r as P,R as C}from"./index-DhsZuJvc.js";import{T as I}from"./toaster-7wnI6hqB.js";import"./message-BRyKdRaX.js";import{a4 as d,a5 as M}from"./index-AKsHS-dO.js";import{e as _}from"./index-DRSy5Ssd.js";import"./chunk-HLWAVYOI-EhWEisNT.js";import"./index-CUZDtIZe.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./disabled-context-rmpd7YJS.js";import"./iframe-DOUoMheZ.js";import"../sb-preview/runtime.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";import"./react-16-DXAfArL2.js";var v="DARK_MODE";function f(r){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(r)}var b;function A(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function k(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?A(Object(e),!0).forEach(function(n){R(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):A(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function R(r,t,e){return t=x(t),t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function x(r){var t=K(r,"string");return f(t)==="symbol"?t:String(t)}function K(r,t){if(f(r)!=="object"||r===null)return r;var e=r[Symbol.toPrimitive];if(e!==void 0){var n=e.call(r,t||"default");if(f(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}function p(r){return B(r)||U(r)||L(r)||N()}function N(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ import{j as s}from"./jsx-runtime-eps93zm2.js";import{r as P,R as C}from"./index-DhsZuJvc.js";import{T as I}from"./toaster-7wnI6hqB.js";import"./message-BRyKdRaX.js";import{a4 as d,a5 as M}from"./index-BlyDuQBv.js";import{e as _}from"./index-DRSy5Ssd.js";import"./chunk-HLWAVYOI-Dvbg03uT.js";import"./index-CUZDtIZe.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./disabled-context-rmpd7YJS.js";import"./iframe-B0e2q2Zd.js";import"../sb-preview/runtime.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";import"./react-16-DXAfArL2.js";var v="DARK_MODE";function f(r){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(r)}var b;function A(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function k(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?A(Object(e),!0).forEach(function(n){R(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):A(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function R(r,t,e){return t=x(t),t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function x(r){var t=K(r,"string");return f(t)==="symbol"?t:String(t)}function K(r,t){if(f(r)!=="object"||r===null)return r;var e=r[Symbol.toPrimitive];if(e!==void 0){var n=e.call(r,t||"default");if(f(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}function p(r){return B(r)||U(r)||L(r)||N()}function N(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function L(r,t){if(r){if(typeof r=="string")return h(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return h(r,t)}}function U(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function B(r){if(Array.isArray(r))return h(r)}function h(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}const{global:Y}=__STORYBOOK_MODULE_GLOBAL__;__STORYBOOK_MODULE_CORE_EVENTS__;var T=Y,$=T.document,g=T.window,j="sb-addon-themes-3";(b=g.matchMedia)===null||b===void 0||b.call(g,"(prefers-color-scheme: dark)");var O={classTarget:"body",dark:d.dark,darkClass:["dark"],light:d.light,lightClass:["light"],stylePreview:!1,userHasExplicitlySetTheTheme:!1},E=function(t){g.localStorage.setItem(j,JSON.stringify(t))},H=function(t,e){var n=e.current,a=e.darkClass,l=a===void 0?O.darkClass:a,o=e.lightClass,i=o===void 0?O.lightClass:o;if(n==="dark"){var u,c;(u=t.classList).remove.apply(u,p(y(i))),(c=t.classList).add.apply(c,p(y(l)))}else{var m,S;(m=t.classList).remove.apply(m,p(y(l))),(S=t.classList).add.apply(S,p(y(i)))}},y=function(t){var e=[];return e.concat(t).map(function(n){return n})},V=function(t){var e=$.querySelector(t.classTarget);e&&H(e,t)},D=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=g.localStorage.getItem(j);if(typeof e=="string"){var n=JSON.parse(e);return t&&(t.dark&&!_(n.dark,t.dark)&&(n.dark=t.dark,E(n)),t.light&&!_(n.light,t.light)&&(n.light=t.light,E(n))),n}return k(k({},O),t)};V(D());function W(r,t){return F(r)||J(r,t)||G(r,t)||q()}function q(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function G(r,t){if(r){if(typeof r=="string")return w(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return w(r,t)}}function w(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function J(r,t){var e=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(e!=null){var n,a,l,o,i=[],u=!0,c=!1;try{if(l=(e=e.call(r)).next,t!==0)for(;!(u=(n=l.call(e)).done)&&(i.push(n.value),i.length!==t);u=!0);}catch(m){c=!0,a=m}finally{try{if(!u&&e.return!=null&&(o=e.return(),Object(o)!==o))return}finally{if(c)throw a}}return i}}function F(r){if(Array.isArray(r))return r}const{addons:z,useState:Q,useEffect:X}=__STORYBOOK_MODULE_PREVIEW_API__;function Z(){var r=Q(D().current==="dark"),t=W(r,2),e=t[0],n=t[1];return X(function(){var a=z.getChannel();return a.on(v,n),function(){return a.off(v,n)}},[]),e}const Or=[r=>s.jsxs(s.Fragment,{children:[s.jsx(r,{}),s.jsx(I,{})]}),r=>{const t=Z();return P.useEffect(()=>document.documentElement.dataset.theme=t?"dark":"default",[t]),s.jsx(r,{})}],Sr={docs:{container:r=>{const[t,e]=C.useState(!1);r.context.channel.on(v,a=>e(a));const n={...r};return n.theme=t?d.dark:d.light,s.jsx(M,{...n})}},darkMode:{current:"light",stylePreview:!0}},_r=["autodocs"];export{Or as decorators,Sr as parameters,_r as tags};
@@ -1,4 +1,4 @@
1
- import{j as o}from"./jsx-runtime-eps93zm2.js";import{r as D}from"./index-DhsZuJvc.js";import{T as g}from"./table-iVsvoMpy.js";import{T as z}from"./text-B3-TSWok.js";import{t as R,s as G,u as J,v as K,w as Q}from"./table.stories-data-C7mC5R8Q.js";import"./index-Bk2sglWO.js";import"./index.es-DazXb-ul.js";import"./inheritsLoose-DP0QEDDI.js";import"./redux-tRgGMjwY.js";import"./objectSpread2-DW4nTBoq.js";import"./tiny-invariant-DqLgxztJ.js";import"./index-CUZDtIZe.js";import"./memoize-one.esm-CcMeOnPo.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./lodash-c4VUpsOs.js";import"./actions-Bax0KeqM.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./button-Cbv7WK6k.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./index-CEuq6vkz.js";import"./tooltip-1V7clEnw.js";import"./types-BmbYqTX_.js";import"./types-Dx2TtIG9.js";import"./badge-CLQ59MDF.js";import"./heading-CRNoBc7q.js";import"./help-icon-Buhx5nl6.js";import"./pagination-CR1nxnnq.js";import"./select-Cwks-WA0.js";import"./enum-Bnn40S8Q.js";import"./assertThisInitialized-B9jnkVVz.js";import"./select.input-CJed_LLR.js";import"./helpers-JJxzGegQ.js";import"./input-Db9WkmPP.js";import"./input-group-BaRSJAEN.js";import"./input-group-addon-D68iUKV2.js";import"./number-input-CNnU6gOF.js";import"./index-C0x1JmaP.js";import"./index-DRSy5Ssd.js";import"./check-box-DPLaOkRR.js";import"./slider-CcpE4BLD.js";import"./index-BI4_Bp97.js";import"./popover-C_2P8LFJ.js";import"./flex-EllkLxgO.js";const Be={title:"Basic/Table/Row",component:g,args:{table:{...R}}},v=n=>o.jsx(g,{...n}),i=v.bind({});i.args={table:G};const p=v.bind({});p.args={table:J};const c=v.bind({});c.args={table:K};const d=v.bind({});d.args={table:Q};const t=v.bind({});t.args={table:{...R,striped:!1}};t.parameters={docs:{description:{story:"`striped: false` removes tinted background on alternative rows."}}};const u=()=>{const[n,e]=D.useState(null),a=r=>e(n===r?null:r);return o.jsx(g,{table:{...R,striped:!1,rows:R.rows.map((r,x)=>({...r,onRowClick:()=>a(x),expandedContent:{content:n===x?o.jsx("div",{children:"Example expanded content"}):null}}))}})},m=()=>{const n={draggable:!0,headers:[{cells:[{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"}]}],rows:[{noDrag:!0,cells:[{value:"Undraggable"},{value:100},{value:361},{value:"Vietnam"}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"}]}]},e=(s,b,l)=>{const y=[...s];return s[l].noDrag?s:(y.splice(l,0,y.splice(b,1)[0]),y)},[a,r]=D.useState(n.rows),x=s=>{const{to:b,from:l}=s;e(a,l,b),r(e(a,l,b))};return o.jsx(g,{table:{...n,rows:a},onListReorder:x})},w=()=>{const[n,e]=D.useState("Hover any row!"),a=[1,2,3,4,5].map(r=>({cells:[{value:`Row ${r}`},{value:`${r**2}`}],onRowMouseEnter:()=>e(`Hovering row ${r}`),onRowMouseLeave:()=>e("Not hovering any row...")}));return o.jsxs(o.Fragment,{children:[o.jsx(z,{children:n}),o.jsx(g,{table:{fixedWidth:"100%",headers:[{cells:[{value:"Description"},{value:"Value"}],onRowMouseEnter:()=>e("Hovering header row"),onRowMouseLeave:()=>e("Not hovering any row...")}],rows:a}})]})};u.__docgenInfo={description:"",methods:[],displayName:"Expandable"};m.__docgenInfo={description:"",methods:[],displayName:"DragAndDrop"};w.__docgenInfo={description:"",methods:[],displayName:"OnRowEnter"};var E,h,T;i.parameters={...i.parameters,docs:{...(E=i.parameters)==null?void 0:E.docs,source:{originalSource:`args => {
1
+ import{j as o}from"./jsx-runtime-eps93zm2.js";import{r as D}from"./index-DhsZuJvc.js";import{T as g}from"./table-DoyDBG6l.js";import{T as z}from"./text-B3-TSWok.js";import{t as R,s as G,u as J,v as K,w as Q}from"./table.stories-data-C7mC5R8Q.js";import"./index-Bk2sglWO.js";import"./index.es-DazXb-ul.js";import"./inheritsLoose-DP0QEDDI.js";import"./redux-tRgGMjwY.js";import"./objectSpread2-DW4nTBoq.js";import"./tiny-invariant-DqLgxztJ.js";import"./index-CUZDtIZe.js";import"./memoize-one.esm-CcMeOnPo.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./lodash-c4VUpsOs.js";import"./actions-Bax0KeqM.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./button-Cbv7WK6k.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./index-CEuq6vkz.js";import"./tooltip-1V7clEnw.js";import"./types-BmbYqTX_.js";import"./types-Dx2TtIG9.js";import"./badge-CLQ59MDF.js";import"./heading-CRNoBc7q.js";import"./help-icon-Buhx5nl6.js";import"./pagination-CR1nxnnq.js";import"./select-Cwks-WA0.js";import"./enum-Bnn40S8Q.js";import"./assertThisInitialized-B9jnkVVz.js";import"./select.input-CJed_LLR.js";import"./helpers-JJxzGegQ.js";import"./input-Db9WkmPP.js";import"./input-group-BaRSJAEN.js";import"./input-group-addon-D68iUKV2.js";import"./number-input-B3_gmeWr.js";import"./index-C0x1JmaP.js";import"./index-DRSy5Ssd.js";import"./check-box-DPLaOkRR.js";import"./slider-CcpE4BLD.js";import"./index-BI4_Bp97.js";import"./popover-C_2P8LFJ.js";import"./flex-EllkLxgO.js";const Be={title:"Basic/Table/Row",component:g,args:{table:{...R}}},v=n=>o.jsx(g,{...n}),i=v.bind({});i.args={table:G};const p=v.bind({});p.args={table:J};const c=v.bind({});c.args={table:K};const d=v.bind({});d.args={table:Q};const t=v.bind({});t.args={table:{...R,striped:!1}};t.parameters={docs:{description:{story:"`striped: false` removes tinted background on alternative rows."}}};const u=()=>{const[n,e]=D.useState(null),a=r=>e(n===r?null:r);return o.jsx(g,{table:{...R,striped:!1,rows:R.rows.map((r,x)=>({...r,onRowClick:()=>a(x),expandedContent:{content:n===x?o.jsx("div",{children:"Example expanded content"}):null}}))}})},m=()=>{const n={draggable:!0,headers:[{cells:[{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"}]}],rows:[{noDrag:!0,cells:[{value:"Undraggable"},{value:100},{value:361},{value:"Vietnam"}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"}]}]},e=(s,b,l)=>{const y=[...s];return s[l].noDrag?s:(y.splice(l,0,y.splice(b,1)[0]),y)},[a,r]=D.useState(n.rows),x=s=>{const{to:b,from:l}=s;e(a,l,b),r(e(a,l,b))};return o.jsx(g,{table:{...n,rows:a},onListReorder:x})},w=()=>{const[n,e]=D.useState("Hover any row!"),a=[1,2,3,4,5].map(r=>({cells:[{value:`Row ${r}`},{value:`${r**2}`}],onRowMouseEnter:()=>e(`Hovering row ${r}`),onRowMouseLeave:()=>e("Not hovering any row...")}));return o.jsxs(o.Fragment,{children:[o.jsx(z,{children:n}),o.jsx(g,{table:{fixedWidth:"100%",headers:[{cells:[{value:"Description"},{value:"Value"}],onRowMouseEnter:()=>e("Hovering header row"),onRowMouseLeave:()=>e("Not hovering any row...")}],rows:a}})]})};u.__docgenInfo={description:"",methods:[],displayName:"Expandable"};m.__docgenInfo={description:"",methods:[],displayName:"DragAndDrop"};w.__docgenInfo={description:"",methods:[],displayName:"OnRowEnter"};var E,h,T;i.parameters={...i.parameters,docs:{...(E=i.parameters)==null?void 0:E.docs,source:{originalSource:`args => {
2
2
  return <Table
3
3
  // eslint-disable-next-line react/jsx-props-no-spreading
4
4
  {...args} />;
@@ -0,0 +1,82 @@
1
+ import{j as q}from"./jsx-runtime-eps93zm2.js";import{r as I}from"./index-DhsZuJvc.js";import{w as s,u as i,e as l}from"./index-DMAnyMX5.js";import{S as w}from"./select-Cwks-WA0.js";import{o as K}from"./select.stories-data-DxgWKlU6.js";import"./index-CF7H4eMJ.js";import"./lodash-c4VUpsOs.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./types-Dx2TtIG9.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./enum-Bnn40S8Q.js";import"./index-CEuq6vkz.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./memoize-one.esm-CcMeOnPo.js";import"./types-BmbYqTX_.js";import"./text-B3-TSWok.js";import"./actions-Bax0KeqM.js";import"./button-Cbv7WK6k.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./badge-CLQ59MDF.js";import"./select.input-CJed_LLR.js";import"./helpers-JJxzGegQ.js";const de={title:"Forms/Select/Test Cases",component:w,args:{options:K},tags:["!autodocs"]},v=n=>{const{multi:o,value:a}=n,[r,t]=I.useState(a||(o?[]:void 0)),e=c=>{const{value:u}=c.target;t(o?u:{value:u})};return q.jsx(w,{value:r,onChange:e,...n})},y=v.bind({});y.args={value:{label:"Vampires",value:"blood"},disabled:!0};const m=v.bind({});m.args={testId:"testId",clearable:!0};m.play=async({canvasElement:n,step:o})=>{const a=s(n),r=s(n.ownerDocument.body);await o("Select item with click",async()=>{const t=a.getByTestId("testId");await i.click(t);const e=await r.findByTestId("testId-layer");l(e).toBeInTheDocument();const c=s(e).getByText("Wombats");await i.click(c);const u=await a.findByTestId("testId-value");l(s(u).getByText("Wombats")).toBeInTheDocument()}),await o("Clear selected value",async()=>{const t=a.getByTestId("testId-clear");await i.click(t);const e=a.queryByTestId("testId-value");l(e).not.toBeInTheDocument()})};const p=v.bind({});p.args={testId:"testId",clearable:!0,multi:!0};p.play=async({canvasElement:n,step:o})=>{const a=s(n),r=s(n.ownerDocument.body);await o("Select items with click",async()=>{const t=a.getByTestId("testId");await i.click(t);const e=await r.findByTestId("testId-layer");await l(e).toBeInTheDocument();const c=s(e).getByText("Wombats");await i.click(c);const u=s(e).getByText("Kangaroos");await i.click(u),await i.click(n),await l(e).not.toBeInTheDocument();const T=await a.findByTestId("testId-value");await l(s(T).getByText("Wombats")).toBeInTheDocument(),await l(s(T).getByText("Kangaroos")).toBeInTheDocument()}),await o("Deselect item with click",async()=>{const t=a.getByTestId("testId");await i.click(t);const e=await r.findByTestId("testId-layer");await l(e).toBeInTheDocument();const c=s(e).getByText("Wombats");await i.click(c),await i.click(n),await l(e).not.toBeInTheDocument();const u=await a.findByTestId("testId-value");await l(s(u).queryByText("Wombats")).not.toBeInTheDocument()}),await o("Clear selected values",async()=>{const t=a.getByTestId("testId-clear");await i.click(t);const e=a.queryByTestId("testId-value");await l(e).not.toBeInTheDocument()})};const g=v.bind({});g.args={testId:"testId",disabled:!0};g.play=async({canvasElement:n,step:o})=>{const a=s(n),r=s(n.ownerDocument.body);await o("Clicking disabled trigger should not show layer",async()=>{await a.getByTestId("testId").click();const e=r.queryByTestId("testId-layer");await l(e).not.toBeInTheDocument()})};const d=()=>{const[n,o]=I.useState(K),[a,r]=I.useState(void 0);return q.jsx(w,{testId:"testId",name:"example",options:n,onChange:t=>r({value:t.target.value}),onCreate:t=>{const e={label:t,value:t};o([...n,e]),r(e)},value:a})};d.args={testId:"testId"};d.play=async({canvasElement:n,step:o})=>{const a=s(n),r=s(n.ownerDocument.body);await o("Create new item",async()=>{const t=a.getByTestId("testId-input");if(await l(t).toBeInTheDocument(),!t)return;await i.type(t,"New value");const e=r.getByText('Create "New value"');await i.click(e);const c=await a.findByTestId("testId-value");await l(s(c).getByText("New value")).toBeInTheDocument()})};d.__docgenInfo={description:"",methods:[{name:"play",docblock:null,modifiers:["static"],params:[{name:"{ canvasElement, step }",optional:!1,type:null}],returns:null}],displayName:"TestCreate"};var h,B,S;y.parameters={...y.parameters,docs:{...(h=y.parameters)==null?void 0:h.docs,source:{originalSource:`(args: any) => {
2
+ const {
3
+ multi,
4
+ value
5
+ } = args;
6
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
7
+ const handleChange = (evt: any) => {
8
+ const {
9
+ value
10
+ } = evt.target;
11
+ setSelectedValue(multi ? value : {
12
+ value
13
+ });
14
+ };
15
+ return <Select value={selectedValue} onChange={handleChange}
16
+ // eslint-disable-next-line react/jsx-props-no-spreading
17
+ {...args} />;
18
+ }`,...(S=(B=y.parameters)==null?void 0:B.docs)==null?void 0:S.source}}};var b,V,x;m.parameters={...m.parameters,docs:{...(b=m.parameters)==null?void 0:b.docs,source:{originalSource:`(args: any) => {
19
+ const {
20
+ multi,
21
+ value
22
+ } = args;
23
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
24
+ const handleChange = (evt: any) => {
25
+ const {
26
+ value
27
+ } = evt.target;
28
+ setSelectedValue(multi ? value : {
29
+ value
30
+ });
31
+ };
32
+ return <Select value={selectedValue} onChange={handleChange}
33
+ // eslint-disable-next-line react/jsx-props-no-spreading
34
+ {...args} />;
35
+ }`,...(x=(V=m.parameters)==null?void 0:V.docs)==null?void 0:x.source}}};var C,D,f;p.parameters={...p.parameters,docs:{...(C=p.parameters)==null?void 0:C.docs,source:{originalSource:`(args: any) => {
36
+ const {
37
+ multi,
38
+ value
39
+ } = args;
40
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
41
+ const handleChange = (evt: any) => {
42
+ const {
43
+ value
44
+ } = evt.target;
45
+ setSelectedValue(multi ? value : {
46
+ value
47
+ });
48
+ };
49
+ return <Select value={selectedValue} onChange={handleChange}
50
+ // eslint-disable-next-line react/jsx-props-no-spreading
51
+ {...args} />;
52
+ }`,...(f=(D=p.parameters)==null?void 0:D.docs)==null?void 0:f.source}}};var k,j,N;g.parameters={...g.parameters,docs:{...(k=g.parameters)==null?void 0:k.docs,source:{originalSource:`(args: any) => {
53
+ const {
54
+ multi,
55
+ value
56
+ } = args;
57
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
58
+ const handleChange = (evt: any) => {
59
+ const {
60
+ value
61
+ } = evt.target;
62
+ setSelectedValue(multi ? value : {
63
+ value
64
+ });
65
+ };
66
+ return <Select value={selectedValue} onChange={handleChange}
67
+ // eslint-disable-next-line react/jsx-props-no-spreading
68
+ {...args} />;
69
+ }`,...(N=(j=g.parameters)==null?void 0:j.docs)==null?void 0:N.source}}};var W,_,O;d.parameters={...d.parameters,docs:{...(W=d.parameters)==null?void 0:W.docs,source:{originalSource:`() => {
70
+ const [options, setOptions] = useState(storyData.options);
71
+ const [singleValue, setSingleValue] = useState<ISelectSelectedOption | undefined>(undefined);
72
+ return <Select testId="testId" name="example" options={options} onChange={evt => setSingleValue({
73
+ value: evt.target.value
74
+ })} onCreate={value => {
75
+ const newValue = {
76
+ label: value,
77
+ value
78
+ };
79
+ setOptions([...options, newValue]);
80
+ setSingleValue(newValue);
81
+ }} value={singleValue} />;
82
+ }`,...(O=(_=d.parameters)==null?void 0:_.docs)==null?void 0:O.source}}};const me=["TestDisabledNonExistentValue","Test","TestMulti","TestDisabled","TestCreate"];export{m as Test,d as TestCreate,g as TestDisabled,y as TestDisabledNonExistentValue,p as TestMulti,me as __namedExportsOrder,de as default};
@@ -1,4 +1,4 @@
1
- import{j as n}from"./jsx-runtime-eps93zm2.js";import{r as S}from"./index-DhsZuJvc.js";import{c as T}from"./index-Bk2sglWO.js";import{I as Le,D as We,C as Fe,P as Pe}from"./index.es-DazXb-ul.js";import{l as De}from"./lodash-c4VUpsOs.js";import{A as ae}from"./actions-Bax0KeqM.js";import{H as Oe}from"./heading-CRNoBc7q.js";import{P as Be}from"./pagination-CR1nxnnq.js";import{A as h,I as $}from"./common-types-Sih75Sav.js";import{I as $e}from"./input-Db9WkmPP.js";import{N as Me}from"./number-input-CNnU6gOF.js";import{S as Ge}from"./select-Cwks-WA0.js";import{D as Ve}from"./disabled-context-rmpd7YJS.js";import{i as M}from"./types-Dx2TtIG9.js";import{T as ie}from"./tooltip-1V7clEnw.js";import{C as Ue}from"./check-box-DPLaOkRR.js";import{S as ze}from"./slider-CcpE4BLD.js";import{I as G}from"./icon-BSFY3vDO.js";import{P as Ke}from"./popover-C_2P8LFJ.js";import{H as fe}from"./help-icon-Buhx5nl6.js";import{T as Y}from"./text-B3-TSWok.js";const Xe="_inputInTable_1dg3w_1",Ye="_inputHover_1dg3w_13",Je="_inputFocus_1dg3w_18",Qe="_inputError_1dg3w_25",Ze="_inputWarning_1dg3w_26",en="_inputDisabled_1dg3w_61",nn="_hideScrollbars_1dg3w_67",tn="_wrapper_1dg3w_85",rn="_bordered_1dg3w_93",an="_scroll_1dg3w_98",on="_table_1dg3w_108",sn="_striped_1dg3w_188",L={inputInTable:Xe,inputHover:Ye,inputFocus:Je,inputError:Qe,inputWarning:Ze,inputDisabled:en,hideScrollbars:nn,wrapper:tn,bordered:rn,scroll:an,table:on,striped:sn},ln="_title_zn5s7_1",dn={title:ln},Q=({name:e=null,actions:t=null,actionsRight:r=!1,testId:i})=>{const a=e!==null,o=t!==null;if(!a&&!o)return null;const s=()=>{if(!o)return null;const c=n.jsx(ae,{actions:t});return r?c:n.jsx("div",{children:c})};return n.jsxs("div",{className:dn.title,children:[a?n.jsx(Oe,{children:n.jsx("span",{"data-testid":i,children:e})}):null,s()]})};Q.__docgenInfo={description:"",methods:[],displayName:"Title",props:{name:{required:!1,tsType:{name:"union",raw:"TStringOrNumber | ReactNode",elements:[{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},{name:"ReactNode"}]},description:"",defaultValue:{value:"null",computed:!1}},actions:{required:!1,tsType:{name:"any"},description:"",defaultValue:{value:"null",computed:!1}},actionsRight:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},testId:{required:!1,tsType:{name:"string"},description:""}}};const un="_footer_4sumy_1",cn="_section_4sumy_7",J={footer:un,section:cn},Z=({colSpan:e,pagination:t,actions:r,content:i})=>{const a=r&&r.length,o=i!=null,s=()=>{var d,p;if(t){const{rowCount:u,rowsPerPage:y}=t,I=Number((p=(d=y==null?void 0:y.options)==null?void 0:d[0])==null?void 0:p.value);return u>I}return!1};return a||o||s()?n.jsxs("div",{className:J.footer,children:[o?n.jsx("div",{className:J.section,children:n.jsx("div",{children:i})}):null,a||s()?n.jsxs("div",{className:J.section,children:[s()?n.jsx(Be,{pagination:t}):n.jsx("div",{}),a&&n.jsx("div",{children:n.jsx(ae,{actions:r})})]}):null]}):null};Z.__docgenInfo={description:"",methods:[],displayName:"Footer",props:{colSpan:{required:!1,tsType:{name:"number"},description:""},pagination:{required:!0,tsType:{name:"IPagination"},description:""},actions:{required:!1,tsType:{name:"Array",elements:[{name:"IAction"}],raw:"IAction[]"},description:""},content:{required:!1,tsType:{name:"ReactNode"},description:""}}};const Ce=e=>{const t=Math.max(...e.reduce((r,i)=>{const a=i.cells.map(o=>o.colSpan?o.colSpan:1).reduce((o,s)=>o+s,0);return r.concat(a)},[]));return isNaN(t)?0:t},pn=(e,t)=>{const r=[Ce(t),Ce(e)];return Math.max(...r)},be=e=>e.reduce((t,r)=>r.actions&&r.actions.length>0?1:t,0),mn=(e,t)=>be(t)>0||be(e)>0,ee=({table:e,children:t})=>{const{rows:r,infiniteScroll:i}=e,a=Math.ceil(window.innerHeight/30),[o,s]=i?S.useState(a):[r.length,null],[c,d]=i?S.useState(o<r.length):[!1,null],p=()=>{if(o>=r.length&&d){d(!1);return}s&&s(o+a)};return n.jsx("div",{id:"scrollWrapper",className:L.scroll,children:i?n.jsx(Le,{dataLength:Math.min(r.length,o+a),next:p,hasMore:c,scrollableTarget:"scrollWrapper",style:{overflow:"initial"},loader:null,children:t({visibleRows:o})}):t({visibleRows:o})})};ee.__docgenInfo={description:"",methods:[],displayName:"TableScrollWrapper",props:{table:{required:!0,tsType:{name:"ITableProps"},description:""},children:{required:!0,tsType:{name:"signature",type:"function",raw:"(props: { visibleRows: number }) => ReactNode",signature:{arguments:[{type:{name:"signature",type:"object",raw:"{ visibleRows: number }",signature:{properties:[{key:"visibleRows",value:{name:"number",required:!0}}]}},name:"props"}],return:{name:"ReactNode"}}},description:""}}};const gn="_clickableRow_m64j5_1",In="_hoverableRow_m64j5_4",yn="_rowActive_m64j5_4",Cn="_expandableRow_m64j5_8",bn="_flush_m64j5_8",hn="_dragIconCell_m64j5_34",fn="_dragIcon_m64j5_34",R={clickableRow:gn,hoverableRow:In,rowActive:yn,expandableRow:Cn,flush:bn,dragIconCell:hn,dragIcon:fn},ne=({colSpan:e,children:t,flush:r})=>n.jsx("tr",{children:n.jsx("td",{colSpan:e,className:T(R.expandableRow,r?R.flush:""),children:t})});ne.__docgenInfo={description:"",methods:[],displayName:"ExpandedContentRow",props:{colSpan:{required:!0,tsType:{name:"number"},description:""},children:{required:!0,tsType:{name:"ReactNode"},description:""},flush:{required:!1,tsType:{name:"boolean"},description:""}}};const he=(e,t={leftAligned:"",rightAligned:"",centerAligned:""},r=!1)=>{if(!e)return null;const{bodyAlignment:i,headerAlignment:a,isHeader:o}=e;switch(o&&a?a:i){case h.LEFT:return r?h.LEFT:t.leftAligned;case h.RIGHT:return r?h.RIGHT:t.rightAligned;case h.CENTER:return r?h.CENTER:t.centerAligned;default:return r?h.LEFT:t.leftAligned}},_n=(e,t=!1,r=0)=>{if(!e||e.length===0)return[];const i=e.every(o=>Array.isArray(o)),a=e.every(o=>typeof o=="string");return i&&t?e[r]||[]:a?e:(console.warn("getHeaderAlignment: alignments array contains a mix of strings and arrays, returning an empty array."),[])},wn="_inputInTable_ie6ng_1",xn="_inputHover_ie6ng_13",Tn="_inputFocus_ie6ng_18",vn="_inputError_ie6ng_25",An="_inputWarning_ie6ng_26",Rn="_inputDisabled_ie6ng_61",jn="_hideScrollbars_ie6ng_67",kn="_cell_ie6ng_77",qn="_disabledLink_ie6ng_87",Nn="_inputWrapper_ie6ng_91",Sn="_numberInputWrapper_ie6ng_106",En="_breakWord_ie6ng_113",Hn="_inputCell_ie6ng_116",Ln="_sliderCell_ie6ng_119",Wn="_staticCell_ie6ng_123",Fn="_staticCellContent_ie6ng_126",Pn="_unit_ie6ng_148",Dn="_sortingCell_ie6ng_151",On="_sortingCellIcon_ie6ng_162",Bn="_icon_ie6ng_173",$n="_checkBoxCell_ie6ng_177",Mn="_iconCellWrapper_ie6ng_181",Gn="_actionsCell_ie6ng_185",Vn="_rightAligned_ie6ng_193",Un="_centerAligned_ie6ng_199",zn="_leftAligned_ie6ng_205",Kn="_popover_ie6ng_208",Xn="_disabledPointerEvents_ie6ng_211",l={inputInTable:wn,inputHover:xn,inputFocus:Tn,inputError:vn,inputWarning:An,inputDisabled:Rn,hideScrollbars:jn,cell:kn,disabledLink:qn,inputWrapper:Nn,numberInputWrapper:Sn,breakWord:En,inputCell:Hn,sliderCell:Ln,staticCell:Wn,staticCellContent:Fn,unit:Pn,sortingCell:Dn,sortingCellIcon:On,icon:Bn,checkBoxCell:$n,iconCellWrapper:Mn,actionsCell:Gn,rightAligned:Vn,centerAligned:Un,leftAligned:zn,popover:Kn,disabledPointerEvents:Xn},te=({cell:e,columnAlignment:t,testId:r,type:i})=>n.jsx($e,{name:e.name,value:e.value,onChange:a=>{var o;return(o=e.onChange)==null?void 0:o.call(e,a)},onFocus:e.onFocus,onBlur:e.onBlur,onPaste:a=>{var o;return(o=e.onPaste)==null?void 0:o.call(e,a)},placeholder:e.placeholder,error:e.error,warning:e.warning,disabled:e.disabled,isInTable:!0,maxTooltipWidth:e.maxTooltipWidth,right:t===h.RIGHT,testId:r,tabIndex:e.disabled?-1:0,tooltip:e.tooltip,type:i});te.__docgenInfo={description:"",methods:[],displayName:"InputCell",props:{cell:{required:!0,tsType:{name:"IInputCell"},description:""},columnAlignment:{required:!1,tsType:{name:"union",raw:"Align.LEFT | Align.RIGHT | string",elements:[{name:"Align.LEFT"},{name:"Align.RIGHT"},{name:"string"}]},description:""},testId:{required:!1,tsType:{name:"string"},description:""},type:{required:!1,tsType:{name:"union",raw:"'text' | 'date'",elements:[{name:"literal",value:"'text'"},{name:"literal",value:"'date'"}]},description:""}}};const _e=({cell:e,testId:t})=>n.jsx(Me,{name:e.name,value:e.value,onChange:r=>{var i;return(i=e.onChange)==null?void 0:i.call(e,r)},onFocus:e.onFocus,onBlur:e.onBlur,placeholder:e.placeholder,error:e.error,warning:e.warning,disabled:e.disabled,isInTable:!0,left:e.left,tabIndex:e.disabled?-1:0,testId:t,tooltip:e.tooltip,validationCallback:e.validationCallback,allowEmpty:e.allowEmpty,enableCosmeticRounding:e.enableCosmeticRounding,enableDisplayRounding:e.enableDisplayRounding,roundDisplayValue:e.roundDisplayValue});_e.__docgenInfo={description:"",methods:[],displayName:"NumberInputCell",props:{cell:{required:!0,tsType:{name:"INumberInputCell"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const we=({cell:e,columnAlignment:t,testId:r})=>n.jsx(Ge,{name:e.name,borderRadius:0,options:e.options,onChange:i=>{var a;return(a=e.onChange)==null?void 0:a.call(e,i)},onCreate:e.onCreate?i=>e.onCreate&&e.onCreate(i):void 0,error:e.error,warning:e.warning,disabled:e.disabled,placeholder:e.placeholder,isInTable:!0,value:e.value,native:e.native,clearable:e.clearable,searchable:e.searchable,deprecatedEventHandler:e.deprecatedEventHandler,maxTooltipWidth:e.maxTooltipWidth,width:"100%",autoLayerWidth:e.autoLayerWidth,multi:e.multi,right:t===h.RIGHT,testId:r,tabIndex:e.disabled?-1:0});we.__docgenInfo={description:"",methods:[],displayName:"SelectCell",props:{cell:{required:!0,tsType:{name:"ISelectCell"},description:""},columnAlignment:{required:!1,tsType:{name:"union",raw:"Align.LEFT | Align.RIGHT | string",elements:[{name:"Align.LEFT"},{name:"Align.RIGHT"},{name:"string"}]},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const xe=({cell:e,columnAlignment:t,testId:r})=>n.jsx("div",{className:T(l.inputWrapper,e.type==="NumberInput"?l.numberInputWrapper:""),children:e.type==="Input"?n.jsx(te,{cell:e,columnAlignment:t,testId:r}):e.type==="NumberInput"?n.jsx(_e,{cell:e,testId:r}):e.type==="DateInput"?n.jsx(te,{cell:e,testId:r,type:"date"}):e.type==="Select"?n.jsx(we,{cell:e,columnAlignment:t,testId:r}):null});xe.__docgenInfo={description:"",methods:[],displayName:"InputCellWrapper",props:{cell:{required:!0,tsType:{name:"any"},description:""},columnAlignment:{required:!0,tsType:{name:"union",raw:"Align.LEFT | Align.RIGHT | string",elements:[{name:"Align.LEFT"},{name:"Align.RIGHT"},{name:"string"}]},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const Te=({cell:e,testId:t})=>{const r=S.useContext(Ve),{error:i,warning:a,tooltip:o,maxTooltipWidth:s}=e,c=d=>M(d);return n.jsx("div",{className:l.inputWrapper,children:n.jsx(ie,{error:!!i,warning:!!a,text:o||i||a,enabled:c(o)||c(i)||c(a)||!1,maxWidth:s,placement:"bottom-center",children:n.jsx("div",{className:l.staticCellContent,"data-error":i||null,"data-warning":a||null,children:n.jsx("a",{className:T((e.disabled||r)&&l.disabledLink),onClick:e.disabled||r?void 0:d=>{var p;d.stopPropagation(),(p=e.onClick)==null||p.call(e,d)},"data-testid":t,children:e.value})})})})};Te.__docgenInfo={description:"",methods:[],displayName:"LinkCell",props:{cell:{required:!0,tsType:{name:"ILinkCell"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const ve=({cell:e,testId:t})=>n.jsx(Ue,{label:e.label,checked:e.checked,isInTable:!0,disabled:e.disabled,onChange:r=>e.onChange(r),testId:t,tabIndex:e.disabled?-1:0});ve.__docgenInfo={description:"",methods:[],displayName:"CheckBoxCell",props:{cell:{required:!0,tsType:{name:"ICheckBoxCell"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const Ae=({cell:e})=>n.jsx("div",{className:l.inputWrapper,children:n.jsx(ze,{label:e.label,value:e.value,min:e.min,max:e.max,step:e.step,marks:e.marks,onChange:t=>e.onChange(t),showArrows:e.showArrows,showTooltip:e.showTooltip,tooltipFormatter:e.tooltipFormatter,disabled:e.disabled})});Ae.__docgenInfo={description:"",methods:[],displayName:"SliderCell",props:{cell:{required:!0,tsType:{name:"ISliderCell"},description:""}}};const Re=({cell:e})=>{const{tooltip:t,icon:r}=e;return n.jsx("div",{className:l.iconCellWrapper,children:n.jsx(ie,{text:t,enabled:!!t&&M(t),display:"flex",placement:"top-center",children:n.jsx(G,{icon:r})})})};Re.__docgenInfo={description:"",methods:[],displayName:"IconCell",props:{cell:{required:!0,tsType:{name:"IIconCell"},description:""}}};const je=({cell:e})=>n.jsx(ae,{actions:e.actions});je.__docgenInfo={description:"",methods:[],displayName:"ActionsCell",props:{cell:{required:!0,tsType:{name:"IActionCell"},description:""}}};const ke=({cell:e})=>{const{helpIcon:t}=e;return t?n.jsx("div",{className:l.icon,children:n.jsx(fe,{onClick:t.onClick,text:t.tooltip})}):null};ke.__docgenInfo={description:"",methods:[],displayName:"CellHelpIcon",props:{cell:{required:!0,tsType:{name:"IHelpIconCell"},description:""}}};const qe=({cell:e})=>{const{libraryIcon:t}=e;return t?n.jsx("div",{className:l.icon,children:n.jsx(fe,{onClick:t.onClick,text:t.tooltip,icon:$.LIBRARY})}):null};qe.__docgenInfo={description:"",methods:[],displayName:"CellLibraryIcon",props:{cell:{required:!0,tsType:{name:"ILibraryIconCell"},description:""}}};const Ne=({cell:e})=>{const{hasSort:t,sort:r,sortPriority:i}=e;return t?n.jsxs("span",{className:l.sortingCellIcon,children:[r==="down"?n.jsx(Y,{link:!0,children:n.jsx(G,{icon:$.SORT_ASCENDING})}):r==="up"?n.jsx(Y,{link:!0,children:n.jsx(G,{icon:$.SORT_DESCENDING})}):n.jsx(Y,{faint:!0,children:n.jsx(G,{icon:$.SORT_DESCENDING})}),i&&r?n.jsx("sup",{children:i}):null]}):null};Ne.__docgenInfo={description:"",methods:[],displayName:"Sort",props:{cell:{required:!0,tsType:{name:"ISortCell"},description:""}}};const oe=({cell:e,isHeader:t,testId:r})=>{const{error:i,warning:a,tooltip:o,maxTooltipWidth:s,hasSort:c,onSort:d,type:p}=e,u=n.jsxs("div",{className:T(l.staticCellContent,p==="Unit"?l.unit:""),onClick:c?y=>d&&d(y):()=>{},"data-error":i||null,"data-warning":a||null,"data-testid":r,children:[e.value,t?n.jsxs(n.Fragment,{children:[n.jsx(ke,{cell:e}),n.jsx(qe,{cell:e}),n.jsx(Ne,{cell:e})]}):null]});return n.jsx("div",{className:l.inputWrapper,children:n.jsx(ie,{error:!!i,warning:!!a,text:o||i||a,enabled:o&&M(o)||i&&M(i)||a&&M(a)||!1,maxWidth:s,display:"block",placement:"bottom-center",children:u})})};oe.__docgenInfo={description:"",methods:[],displayName:"StaticCell",props:{cell:{required:!0,tsType:{name:"IStaticCell"},description:""},isHeader:{required:!1,tsType:{name:"boolean"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const Se=({cell:e,testId:t})=>{const{content:r,fullWidth:i,closeOnOutsideClick:a,disabled:o}=e;return n.jsx(Ke,{content:r,fullWidth:i,closeOnOutsideClick:a,disabled:o,children:n.jsx("div",{className:l.popover,children:n.jsx(oe,{cell:e,testId:t})})})};Se.__docgenInfo={description:"",methods:[],displayName:"PopoverCell",props:{cell:{required:!0,tsType:{name:"IPopoverCell"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const Ee=({cell:e,isHeader:t,columnAlignment:r,testId:i})=>{if(!e)return null;switch(e.type){case"Input":case"NumberInput":case"DateInput":case"Select":return n.jsx(xe,{cell:e,columnAlignment:r,testId:i});case"Link":return n.jsx(Te,{cell:e,testId:i});case"CheckBox":return n.jsx(ve,{cell:e,testId:i});case"Slider":return n.jsx(Ae,{cell:e});case"Icon":return n.jsx(Re,{cell:e});case"Actions":return n.jsx(je,{cell:e});case"Popover":return n.jsx(Se,{cell:e});default:return n.jsx(oe,{cell:e,isHeader:t,testId:i})}};Ee.__docgenInfo={description:"",methods:[],displayName:"CellWrapper",props:{cell:{required:!0,tsType:{name:"any"},description:""},isHeader:{required:!0,tsType:{name:"boolean"},description:""},columnAlignment:{required:!0,tsType:{name:"union",raw:"Align.LEFT | Align.RIGHT | string",elements:[{name:"Align.LEFT"},{name:"Align.RIGHT"},{name:"string"}]},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};var j=(e=>(e.INPUT="Input",e.NUMBER_INPUT="NumberInput",e.SELECT="Select",e.POPOVER="Popover",e.SLIDER="Slider",e.CHECKBOX="CheckBox",e.ACTIONS="Actions",e.AUTO_UNIT="AutoUnit",e))(j||{});const re=({cell:e,isHeader:t,columnHeaderAlignment:r,columnAlignment:i=h.LEFT,width:a,snapshot:o,testId:s})=>{if(!e)return null;const{style:c,colSpan:d,rowSpan:p,width:u}=e,y=S.useRef(null),I={bodyAlignment:i,headerAlignment:r,isHeader:t},W=he(I,l),f=he(I,l,!0),F=e.type===j.INPUT||e.type===j.NUMBER_INPUT||e.type===j.SELECT||e.type===j.POPOVER?l.inputCell:e.type===j.SLIDER?l.sliderCell:e.type===j.CHECKBOX?l.checkBoxCell:e.type===j.ACTIONS?l.actionsCell:l.staticCell,v=T(l.cell,F,e.hasSort?l.sortingCell:null,W,e.breakWord?l.breakWord:""),E=u??a??((o==null?void 0:o.isDragging)&&y.current&&y.current.offsetWidth)??void 0,_={width:E,minWidth:E,...c},A=t?"th":"td";return n.jsx(A,{ref:y,className:v,style:_,colSpan:d,rowSpan:p,children:n.jsx(Ee,{cell:e,columnAlignment:f??h.RIGHT,isHeader:t,testId:s})})};re.__docgenInfo={description:"",methods:[],displayName:"Cell",props:{cell:{required:!1,tsType:{name:"union",raw:`| IPopoverCell
1
+ import{j as n}from"./jsx-runtime-eps93zm2.js";import{r as S}from"./index-DhsZuJvc.js";import{c as T}from"./index-Bk2sglWO.js";import{I as Le,D as We,C as Fe,P as Pe}from"./index.es-DazXb-ul.js";import{l as De}from"./lodash-c4VUpsOs.js";import{A as ae}from"./actions-Bax0KeqM.js";import{H as Oe}from"./heading-CRNoBc7q.js";import{P as Be}from"./pagination-CR1nxnnq.js";import{A as h,I as $}from"./common-types-Sih75Sav.js";import{I as $e}from"./input-Db9WkmPP.js";import{N as Me}from"./number-input-B3_gmeWr.js";import{S as Ge}from"./select-Cwks-WA0.js";import{D as Ve}from"./disabled-context-rmpd7YJS.js";import{i as M}from"./types-Dx2TtIG9.js";import{T as ie}from"./tooltip-1V7clEnw.js";import{C as Ue}from"./check-box-DPLaOkRR.js";import{S as ze}from"./slider-CcpE4BLD.js";import{I as G}from"./icon-BSFY3vDO.js";import{P as Ke}from"./popover-C_2P8LFJ.js";import{H as fe}from"./help-icon-Buhx5nl6.js";import{T as Y}from"./text-B3-TSWok.js";const Xe="_inputInTable_1dg3w_1",Ye="_inputHover_1dg3w_13",Je="_inputFocus_1dg3w_18",Qe="_inputError_1dg3w_25",Ze="_inputWarning_1dg3w_26",en="_inputDisabled_1dg3w_61",nn="_hideScrollbars_1dg3w_67",tn="_wrapper_1dg3w_85",rn="_bordered_1dg3w_93",an="_scroll_1dg3w_98",on="_table_1dg3w_108",sn="_striped_1dg3w_188",L={inputInTable:Xe,inputHover:Ye,inputFocus:Je,inputError:Qe,inputWarning:Ze,inputDisabled:en,hideScrollbars:nn,wrapper:tn,bordered:rn,scroll:an,table:on,striped:sn},ln="_title_zn5s7_1",dn={title:ln},Q=({name:e=null,actions:t=null,actionsRight:r=!1,testId:i})=>{const a=e!==null,o=t!==null;if(!a&&!o)return null;const s=()=>{if(!o)return null;const c=n.jsx(ae,{actions:t});return r?c:n.jsx("div",{children:c})};return n.jsxs("div",{className:dn.title,children:[a?n.jsx(Oe,{children:n.jsx("span",{"data-testid":i,children:e})}):null,s()]})};Q.__docgenInfo={description:"",methods:[],displayName:"Title",props:{name:{required:!1,tsType:{name:"union",raw:"TStringOrNumber | ReactNode",elements:[{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},{name:"ReactNode"}]},description:"",defaultValue:{value:"null",computed:!1}},actions:{required:!1,tsType:{name:"any"},description:"",defaultValue:{value:"null",computed:!1}},actionsRight:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},testId:{required:!1,tsType:{name:"string"},description:""}}};const un="_footer_4sumy_1",cn="_section_4sumy_7",J={footer:un,section:cn},Z=({colSpan:e,pagination:t,actions:r,content:i})=>{const a=r&&r.length,o=i!=null,s=()=>{var d,p;if(t){const{rowCount:u,rowsPerPage:y}=t,I=Number((p=(d=y==null?void 0:y.options)==null?void 0:d[0])==null?void 0:p.value);return u>I}return!1};return a||o||s()?n.jsxs("div",{className:J.footer,children:[o?n.jsx("div",{className:J.section,children:n.jsx("div",{children:i})}):null,a||s()?n.jsxs("div",{className:J.section,children:[s()?n.jsx(Be,{pagination:t}):n.jsx("div",{}),a&&n.jsx("div",{children:n.jsx(ae,{actions:r})})]}):null]}):null};Z.__docgenInfo={description:"",methods:[],displayName:"Footer",props:{colSpan:{required:!1,tsType:{name:"number"},description:""},pagination:{required:!0,tsType:{name:"IPagination"},description:""},actions:{required:!1,tsType:{name:"Array",elements:[{name:"IAction"}],raw:"IAction[]"},description:""},content:{required:!1,tsType:{name:"ReactNode"},description:""}}};const Ce=e=>{const t=Math.max(...e.reduce((r,i)=>{const a=i.cells.map(o=>o.colSpan?o.colSpan:1).reduce((o,s)=>o+s,0);return r.concat(a)},[]));return isNaN(t)?0:t},pn=(e,t)=>{const r=[Ce(t),Ce(e)];return Math.max(...r)},be=e=>e.reduce((t,r)=>r.actions&&r.actions.length>0?1:t,0),mn=(e,t)=>be(t)>0||be(e)>0,ee=({table:e,children:t})=>{const{rows:r,infiniteScroll:i}=e,a=Math.ceil(window.innerHeight/30),[o,s]=i?S.useState(a):[r.length,null],[c,d]=i?S.useState(o<r.length):[!1,null],p=()=>{if(o>=r.length&&d){d(!1);return}s&&s(o+a)};return n.jsx("div",{id:"scrollWrapper",className:L.scroll,children:i?n.jsx(Le,{dataLength:Math.min(r.length,o+a),next:p,hasMore:c,scrollableTarget:"scrollWrapper",style:{overflow:"initial"},loader:null,children:t({visibleRows:o})}):t({visibleRows:o})})};ee.__docgenInfo={description:"",methods:[],displayName:"TableScrollWrapper",props:{table:{required:!0,tsType:{name:"ITableProps"},description:""},children:{required:!0,tsType:{name:"signature",type:"function",raw:"(props: { visibleRows: number }) => ReactNode",signature:{arguments:[{type:{name:"signature",type:"object",raw:"{ visibleRows: number }",signature:{properties:[{key:"visibleRows",value:{name:"number",required:!0}}]}},name:"props"}],return:{name:"ReactNode"}}},description:""}}};const gn="_clickableRow_m64j5_1",In="_hoverableRow_m64j5_4",yn="_rowActive_m64j5_4",Cn="_expandableRow_m64j5_8",bn="_flush_m64j5_8",hn="_dragIconCell_m64j5_34",fn="_dragIcon_m64j5_34",R={clickableRow:gn,hoverableRow:In,rowActive:yn,expandableRow:Cn,flush:bn,dragIconCell:hn,dragIcon:fn},ne=({colSpan:e,children:t,flush:r})=>n.jsx("tr",{children:n.jsx("td",{colSpan:e,className:T(R.expandableRow,r?R.flush:""),children:t})});ne.__docgenInfo={description:"",methods:[],displayName:"ExpandedContentRow",props:{colSpan:{required:!0,tsType:{name:"number"},description:""},children:{required:!0,tsType:{name:"ReactNode"},description:""},flush:{required:!1,tsType:{name:"boolean"},description:""}}};const he=(e,t={leftAligned:"",rightAligned:"",centerAligned:""},r=!1)=>{if(!e)return null;const{bodyAlignment:i,headerAlignment:a,isHeader:o}=e;switch(o&&a?a:i){case h.LEFT:return r?h.LEFT:t.leftAligned;case h.RIGHT:return r?h.RIGHT:t.rightAligned;case h.CENTER:return r?h.CENTER:t.centerAligned;default:return r?h.LEFT:t.leftAligned}},_n=(e,t=!1,r=0)=>{if(!e||e.length===0)return[];const i=e.every(o=>Array.isArray(o)),a=e.every(o=>typeof o=="string");return i&&t?e[r]||[]:a?e:(console.warn("getHeaderAlignment: alignments array contains a mix of strings and arrays, returning an empty array."),[])},wn="_inputInTable_ie6ng_1",xn="_inputHover_ie6ng_13",Tn="_inputFocus_ie6ng_18",vn="_inputError_ie6ng_25",An="_inputWarning_ie6ng_26",Rn="_inputDisabled_ie6ng_61",jn="_hideScrollbars_ie6ng_67",kn="_cell_ie6ng_77",qn="_disabledLink_ie6ng_87",Nn="_inputWrapper_ie6ng_91",Sn="_numberInputWrapper_ie6ng_106",En="_breakWord_ie6ng_113",Hn="_inputCell_ie6ng_116",Ln="_sliderCell_ie6ng_119",Wn="_staticCell_ie6ng_123",Fn="_staticCellContent_ie6ng_126",Pn="_unit_ie6ng_148",Dn="_sortingCell_ie6ng_151",On="_sortingCellIcon_ie6ng_162",Bn="_icon_ie6ng_173",$n="_checkBoxCell_ie6ng_177",Mn="_iconCellWrapper_ie6ng_181",Gn="_actionsCell_ie6ng_185",Vn="_rightAligned_ie6ng_193",Un="_centerAligned_ie6ng_199",zn="_leftAligned_ie6ng_205",Kn="_popover_ie6ng_208",Xn="_disabledPointerEvents_ie6ng_211",l={inputInTable:wn,inputHover:xn,inputFocus:Tn,inputError:vn,inputWarning:An,inputDisabled:Rn,hideScrollbars:jn,cell:kn,disabledLink:qn,inputWrapper:Nn,numberInputWrapper:Sn,breakWord:En,inputCell:Hn,sliderCell:Ln,staticCell:Wn,staticCellContent:Fn,unit:Pn,sortingCell:Dn,sortingCellIcon:On,icon:Bn,checkBoxCell:$n,iconCellWrapper:Mn,actionsCell:Gn,rightAligned:Vn,centerAligned:Un,leftAligned:zn,popover:Kn,disabledPointerEvents:Xn},te=({cell:e,columnAlignment:t,testId:r,type:i})=>n.jsx($e,{name:e.name,value:e.value,onChange:a=>{var o;return(o=e.onChange)==null?void 0:o.call(e,a)},onFocus:e.onFocus,onBlur:e.onBlur,onPaste:a=>{var o;return(o=e.onPaste)==null?void 0:o.call(e,a)},placeholder:e.placeholder,error:e.error,warning:e.warning,disabled:e.disabled,isInTable:!0,maxTooltipWidth:e.maxTooltipWidth,right:t===h.RIGHT,testId:r,tabIndex:e.disabled?-1:0,tooltip:e.tooltip,type:i});te.__docgenInfo={description:"",methods:[],displayName:"InputCell",props:{cell:{required:!0,tsType:{name:"IInputCell"},description:""},columnAlignment:{required:!1,tsType:{name:"union",raw:"Align.LEFT | Align.RIGHT | string",elements:[{name:"Align.LEFT"},{name:"Align.RIGHT"},{name:"string"}]},description:""},testId:{required:!1,tsType:{name:"string"},description:""},type:{required:!1,tsType:{name:"union",raw:"'text' | 'date'",elements:[{name:"literal",value:"'text'"},{name:"literal",value:"'date'"}]},description:""}}};const _e=({cell:e,testId:t})=>n.jsx(Me,{name:e.name,value:e.value,onChange:r=>{var i;return(i=e.onChange)==null?void 0:i.call(e,r)},onFocus:e.onFocus,onBlur:e.onBlur,placeholder:e.placeholder,error:e.error,warning:e.warning,disabled:e.disabled,isInTable:!0,left:e.left,tabIndex:e.disabled?-1:0,testId:t,tooltip:e.tooltip,validationCallback:e.validationCallback,allowEmpty:e.allowEmpty,enableCosmeticRounding:e.enableCosmeticRounding,enableDisplayRounding:e.enableDisplayRounding,roundDisplayValue:e.roundDisplayValue});_e.__docgenInfo={description:"",methods:[],displayName:"NumberInputCell",props:{cell:{required:!0,tsType:{name:"INumberInputCell"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const we=({cell:e,columnAlignment:t,testId:r})=>n.jsx(Ge,{name:e.name,borderRadius:0,options:e.options,onChange:i=>{var a;return(a=e.onChange)==null?void 0:a.call(e,i)},onCreate:e.onCreate?i=>e.onCreate&&e.onCreate(i):void 0,error:e.error,warning:e.warning,disabled:e.disabled,placeholder:e.placeholder,isInTable:!0,value:e.value,native:e.native,clearable:e.clearable,searchable:e.searchable,deprecatedEventHandler:e.deprecatedEventHandler,maxTooltipWidth:e.maxTooltipWidth,width:"100%",autoLayerWidth:e.autoLayerWidth,multi:e.multi,right:t===h.RIGHT,testId:r,tabIndex:e.disabled?-1:0});we.__docgenInfo={description:"",methods:[],displayName:"SelectCell",props:{cell:{required:!0,tsType:{name:"ISelectCell"},description:""},columnAlignment:{required:!1,tsType:{name:"union",raw:"Align.LEFT | Align.RIGHT | string",elements:[{name:"Align.LEFT"},{name:"Align.RIGHT"},{name:"string"}]},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const xe=({cell:e,columnAlignment:t,testId:r})=>n.jsx("div",{className:T(l.inputWrapper,e.type==="NumberInput"?l.numberInputWrapper:""),children:e.type==="Input"?n.jsx(te,{cell:e,columnAlignment:t,testId:r}):e.type==="NumberInput"?n.jsx(_e,{cell:e,testId:r}):e.type==="DateInput"?n.jsx(te,{cell:e,testId:r,type:"date"}):e.type==="Select"?n.jsx(we,{cell:e,columnAlignment:t,testId:r}):null});xe.__docgenInfo={description:"",methods:[],displayName:"InputCellWrapper",props:{cell:{required:!0,tsType:{name:"any"},description:""},columnAlignment:{required:!0,tsType:{name:"union",raw:"Align.LEFT | Align.RIGHT | string",elements:[{name:"Align.LEFT"},{name:"Align.RIGHT"},{name:"string"}]},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const Te=({cell:e,testId:t})=>{const r=S.useContext(Ve),{error:i,warning:a,tooltip:o,maxTooltipWidth:s}=e,c=d=>M(d);return n.jsx("div",{className:l.inputWrapper,children:n.jsx(ie,{error:!!i,warning:!!a,text:o||i||a,enabled:c(o)||c(i)||c(a)||!1,maxWidth:s,placement:"bottom-center",children:n.jsx("div",{className:l.staticCellContent,"data-error":i||null,"data-warning":a||null,children:n.jsx("a",{className:T((e.disabled||r)&&l.disabledLink),onClick:e.disabled||r?void 0:d=>{var p;d.stopPropagation(),(p=e.onClick)==null||p.call(e,d)},"data-testid":t,children:e.value})})})})};Te.__docgenInfo={description:"",methods:[],displayName:"LinkCell",props:{cell:{required:!0,tsType:{name:"ILinkCell"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const ve=({cell:e,testId:t})=>n.jsx(Ue,{label:e.label,checked:e.checked,isInTable:!0,disabled:e.disabled,onChange:r=>e.onChange(r),testId:t,tabIndex:e.disabled?-1:0});ve.__docgenInfo={description:"",methods:[],displayName:"CheckBoxCell",props:{cell:{required:!0,tsType:{name:"ICheckBoxCell"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const Ae=({cell:e})=>n.jsx("div",{className:l.inputWrapper,children:n.jsx(ze,{label:e.label,value:e.value,min:e.min,max:e.max,step:e.step,marks:e.marks,onChange:t=>e.onChange(t),showArrows:e.showArrows,showTooltip:e.showTooltip,tooltipFormatter:e.tooltipFormatter,disabled:e.disabled})});Ae.__docgenInfo={description:"",methods:[],displayName:"SliderCell",props:{cell:{required:!0,tsType:{name:"ISliderCell"},description:""}}};const Re=({cell:e})=>{const{tooltip:t,icon:r}=e;return n.jsx("div",{className:l.iconCellWrapper,children:n.jsx(ie,{text:t,enabled:!!t&&M(t),display:"flex",placement:"top-center",children:n.jsx(G,{icon:r})})})};Re.__docgenInfo={description:"",methods:[],displayName:"IconCell",props:{cell:{required:!0,tsType:{name:"IIconCell"},description:""}}};const je=({cell:e})=>n.jsx(ae,{actions:e.actions});je.__docgenInfo={description:"",methods:[],displayName:"ActionsCell",props:{cell:{required:!0,tsType:{name:"IActionCell"},description:""}}};const ke=({cell:e})=>{const{helpIcon:t}=e;return t?n.jsx("div",{className:l.icon,children:n.jsx(fe,{onClick:t.onClick,text:t.tooltip})}):null};ke.__docgenInfo={description:"",methods:[],displayName:"CellHelpIcon",props:{cell:{required:!0,tsType:{name:"IHelpIconCell"},description:""}}};const qe=({cell:e})=>{const{libraryIcon:t}=e;return t?n.jsx("div",{className:l.icon,children:n.jsx(fe,{onClick:t.onClick,text:t.tooltip,icon:$.LIBRARY})}):null};qe.__docgenInfo={description:"",methods:[],displayName:"CellLibraryIcon",props:{cell:{required:!0,tsType:{name:"ILibraryIconCell"},description:""}}};const Ne=({cell:e})=>{const{hasSort:t,sort:r,sortPriority:i}=e;return t?n.jsxs("span",{className:l.sortingCellIcon,children:[r==="down"?n.jsx(Y,{link:!0,children:n.jsx(G,{icon:$.SORT_ASCENDING})}):r==="up"?n.jsx(Y,{link:!0,children:n.jsx(G,{icon:$.SORT_DESCENDING})}):n.jsx(Y,{faint:!0,children:n.jsx(G,{icon:$.SORT_DESCENDING})}),i&&r?n.jsx("sup",{children:i}):null]}):null};Ne.__docgenInfo={description:"",methods:[],displayName:"Sort",props:{cell:{required:!0,tsType:{name:"ISortCell"},description:""}}};const oe=({cell:e,isHeader:t,testId:r})=>{const{error:i,warning:a,tooltip:o,maxTooltipWidth:s,hasSort:c,onSort:d,type:p}=e,u=n.jsxs("div",{className:T(l.staticCellContent,p==="Unit"?l.unit:""),onClick:c?y=>d&&d(y):()=>{},"data-error":i||null,"data-warning":a||null,"data-testid":r,children:[e.value,t?n.jsxs(n.Fragment,{children:[n.jsx(ke,{cell:e}),n.jsx(qe,{cell:e}),n.jsx(Ne,{cell:e})]}):null]});return n.jsx("div",{className:l.inputWrapper,children:n.jsx(ie,{error:!!i,warning:!!a,text:o||i||a,enabled:o&&M(o)||i&&M(i)||a&&M(a)||!1,maxWidth:s,display:"block",placement:"bottom-center",children:u})})};oe.__docgenInfo={description:"",methods:[],displayName:"StaticCell",props:{cell:{required:!0,tsType:{name:"IStaticCell"},description:""},isHeader:{required:!1,tsType:{name:"boolean"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const Se=({cell:e,testId:t})=>{const{content:r,fullWidth:i,closeOnOutsideClick:a,disabled:o}=e;return n.jsx(Ke,{content:r,fullWidth:i,closeOnOutsideClick:a,disabled:o,children:n.jsx("div",{className:l.popover,children:n.jsx(oe,{cell:e,testId:t})})})};Se.__docgenInfo={description:"",methods:[],displayName:"PopoverCell",props:{cell:{required:!0,tsType:{name:"IPopoverCell"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const Ee=({cell:e,isHeader:t,columnAlignment:r,testId:i})=>{if(!e)return null;switch(e.type){case"Input":case"NumberInput":case"DateInput":case"Select":return n.jsx(xe,{cell:e,columnAlignment:r,testId:i});case"Link":return n.jsx(Te,{cell:e,testId:i});case"CheckBox":return n.jsx(ve,{cell:e,testId:i});case"Slider":return n.jsx(Ae,{cell:e});case"Icon":return n.jsx(Re,{cell:e});case"Actions":return n.jsx(je,{cell:e});case"Popover":return n.jsx(Se,{cell:e});default:return n.jsx(oe,{cell:e,isHeader:t,testId:i})}};Ee.__docgenInfo={description:"",methods:[],displayName:"CellWrapper",props:{cell:{required:!0,tsType:{name:"any"},description:""},isHeader:{required:!0,tsType:{name:"boolean"},description:""},columnAlignment:{required:!0,tsType:{name:"union",raw:"Align.LEFT | Align.RIGHT | string",elements:[{name:"Align.LEFT"},{name:"Align.RIGHT"},{name:"string"}]},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};var j=(e=>(e.INPUT="Input",e.NUMBER_INPUT="NumberInput",e.SELECT="Select",e.POPOVER="Popover",e.SLIDER="Slider",e.CHECKBOX="CheckBox",e.ACTIONS="Actions",e.AUTO_UNIT="AutoUnit",e))(j||{});const re=({cell:e,isHeader:t,columnHeaderAlignment:r,columnAlignment:i=h.LEFT,width:a,snapshot:o,testId:s})=>{if(!e)return null;const{style:c,colSpan:d,rowSpan:p,width:u}=e,y=S.useRef(null),I={bodyAlignment:i,headerAlignment:r,isHeader:t},W=he(I,l),f=he(I,l,!0),F=e.type===j.INPUT||e.type===j.NUMBER_INPUT||e.type===j.SELECT||e.type===j.POPOVER?l.inputCell:e.type===j.SLIDER?l.sliderCell:e.type===j.CHECKBOX?l.checkBoxCell:e.type===j.ACTIONS?l.actionsCell:l.staticCell,v=T(l.cell,F,e.hasSort?l.sortingCell:null,W,e.breakWord?l.breakWord:""),E=u??a??((o==null?void 0:o.isDragging)&&y.current&&y.current.offsetWidth)??void 0,_={width:E,minWidth:E,...c},A=t?"th":"td";return n.jsx(A,{ref:y,className:v,style:_,colSpan:d,rowSpan:p,children:n.jsx(Ee,{cell:e,columnAlignment:f??h.RIGHT,isHeader:t,testId:s})})};re.__docgenInfo={description:"",methods:[],displayName:"Cell",props:{cell:{required:!1,tsType:{name:"union",raw:`| IPopoverCell
2
2
  | IStaticCell
3
3
  | ISelectCell
4
4
  | IHelpIconCell