@oliasoft-open-source/react-ui-library 4.10.10-beta-1 → 4.10.10-beta-2

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 (37) hide show
  1. package/dist/assets/{index-BpSdrNXy.css → index-BVDOZzNV.css} +34 -5
  2. package/dist/assets/{index-DNn0fRjY.js → index-BxBkiGq9.js} +294 -276
  3. package/dist/index.html +1 -1
  4. package/dist/index.js +3 -3
  5. package/dist/index.js.map +1 -1
  6. package/dist/storybook/assets/{Color-KGDBMAHA-Ctoumk1_.js → Color-KGDBMAHA-CctQ8zTI.js} +1 -1
  7. package/dist/storybook/assets/{DocsRenderer-PKQXORMH-D6snvJ2n.js → DocsRenderer-PKQXORMH-Zbe4Dzzy.js} +1 -1
  8. package/dist/storybook/assets/{accordion.stories-DFLo2Xxp.js → accordion.stories-LYfONeFa.js} +1 -1
  9. package/dist/storybook/assets/{buttons-and-links-Cp6CY221.js → buttons-and-links-CFN44Cob.js} +1 -1
  10. package/dist/storybook/assets/{casing-loads.stories-D2tl6Xaj.js → casing-loads.stories-wqdpuEvF.js} +1 -1
  11. package/dist/storybook/assets/{cell.stories-3u3qlMqR.js → cell.stories-Cs-CvVVa.js} +1 -1
  12. package/dist/storybook/assets/{chunk-HLWAVYOI-kUA3ddmK.js → chunk-HLWAVYOI-BVQ7Qv4V.js} +1 -1
  13. package/dist/storybook/assets/{color-B-anC3UD.js → color-gNoqTcFO.js} +1 -1
  14. package/dist/storybook/assets/{footer.stories-BHyYr-w1.js → footer.stories-CqmBCXaH.js} +1 -1
  15. package/dist/storybook/assets/{form.stories-f2Uxr04c.js → form.stories-DxVoyy_9.js} +1 -1
  16. package/dist/storybook/assets/{formation.stories-Djd9Xcyb.js → formation.stories-DjCwvWjt.js} +1 -1
  17. package/dist/storybook/assets/{iframe-BPqD7cXD.js → iframe-CGWaHu-t.js} +2 -2
  18. package/dist/storybook/assets/{index-C_d1lYll.js → index-bSCX8Crm.js} +4 -4
  19. package/dist/storybook/assets/{index-D_vfgX3I.js → index-unr6hIHm.js} +1 -1
  20. package/dist/storybook/assets/{input-validation-DWk2h2sH.js → input-validation-BnZeK9vy.js} +1 -1
  21. package/dist/storybook/assets/{inputs-DxXk84P7.js → inputs-DrmDpBdS.js} +1 -1
  22. package/dist/storybook/assets/{layout-forms-DsvEdOzO.js → layout-forms-Cb1DHXbc.js} +1 -1
  23. package/dist/storybook/assets/{layout-general-Be12Eyfp.js → layout-general-CJ3B_RMV.js} +1 -1
  24. package/dist/storybook/assets/{padding-and-spacing-BSmTd9GW.js → padding-and-spacing-CMQyKR3i.js} +1 -1
  25. package/dist/storybook/assets/{preview-CL_1oTTQ.js → preview-Bh9xpkWX.js} +1 -1
  26. package/dist/storybook/assets/{preview-DZPidHkD.js → preview-ClrW9kly.js} +2 -2
  27. package/dist/storybook/assets/{row.stories-BuIxD-aT.js → row.stories-CocH7P15.js} +1 -1
  28. package/dist/storybook/assets/{slider-CNPYg8Sz.js → slider-FeTfWTXx.js} +1 -1
  29. package/dist/storybook/assets/{slider.stories-BH6uxhwC.js → slider.stories-CTTIERmo.js} +1 -1
  30. package/dist/storybook/assets/{table-B5fM_vjN.js → table-DTe-5k91.js} +1 -1
  31. package/dist/storybook/assets/{table.stories-HRJd7a1D.js → table.stories-C41s0aQQ.js} +1 -1
  32. package/dist/storybook/assets/{title.stories-C1rVRHkF.js → title.stories-cJxIkKRU.js} +1 -1
  33. package/dist/storybook/assets/{unit-table.stories-DVqdGdEC.js → unit-table.stories-fpuLLOXX.js} +1 -1
  34. package/dist/storybook/assets/{unit-table.test-case.stories-CThfe_IO.js → unit-table.test-case.stories-DWoJ6629.js} +1 -1
  35. package/dist/storybook/iframe.html +1 -1
  36. package/dist/storybook/project.json +1 -1
  37. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import{j as n}from"./jsx-runtime-eps93zm2.js";import{r as v}from"./index-DhsZuJvc.js";import{f as Q}from"./immer.esm-BwVl9PS2.js";import{d as y}from"./index-C0x1JmaP.js";import{G as X}from"./grid-DRkC-bt8.js";import{S as Y}from"./spacer-BWoNR27H.js";import{C as V}from"./card-EcjmryU9.js";import{F as L}from"./field-HrLaMLbx.js";import{H as F}from"./heading-CRNoBc7q.js";import{S as N}from"./select-03uRbc4I.js";import{T as W}from"./toggle-BbFVf61v.js";import{l as Z}from"./lodash-c4VUpsOs.js";import{u as ee}from"./use-previous-D775JrO6.js";import{T as te,C as K}from"./table-B5fM_vjN.js";import"./index-DRSy5Ssd.js";import"./styled-components.browser.esm-BQ9GQzDc.js";import"./index-Bk2sglWO.js";import"./label-CqmyC9he.js";import"./common-types-Sih75Sav.js";import"./help-icon-Buhx5nl6.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./disabled-context-rmpd7YJS.js";import"./types-Dx2TtIG9.js";import"./enum-Bnn40S8Q.js";import"./assertThisInitialized-B9jnkVVz.js";import"./memoize-one.esm-CcMeOnPo.js";import"./types-BmbYqTX_.js";import"./text-B3-TSWok.js";import"./actions-D-uVCDzk.js";import"./button-DHevvVBE.js";import"./spinner-AWUe4xwQ.js";import"./badge-CLQ59MDF.js";import"./select.input-CJed_LLR.js";import"./helpers-JJxzGegQ.js";import"./index.es-DazXb-ul.js";import"./redux-tRgGMjwY.js";import"./objectSpread2-DW4nTBoq.js";import"./tiny-invariant-DqLgxztJ.js";import"./pagination-DWc8zp3k.js";import"./input-DTXbDJaL.js";import"./input-group-BaRSJAEN.js";import"./input-group-addon-D68iUKV2.js";import"./number-input-CJJvhIIv.js";import"./check-box-DPLaOkRR.js";import"./slider-CNPYg8Sz.js";import"./index-BI4_Bp97.js";import"./popover-rq33c1W2.js";const ne=l=>l.reduce(({preferredUnits:i,storageUnits:r},{unitKey:s,preferredUnit:a,storageUnit:m})=>(i[s]=a,r[s]=m,{preferredUnits:i,storageUnits:r}),{preferredUnits:{},storageUnits:{}}),ae=({headers:l,rows:i,selectedUnits:r,storageUnits:s,onChangeUnit:a,convertBackToStorageUnit:m,enableCosmeticRounding:h,enableDisplayRounding:U})=>{const u=l?l.map(d=>({...d,cells:d.cells.map(c=>{var t;if(c.type===K.AUTO_UNIT){const{testId:S,unitKey:p}=c;return{value:r[p],type:K.SELECT,searchable:!1,options:(t=y.getUnitsForQuantity(p))==null?void 0:t.map(T=>({label:y.label(T),value:T})),native:c.native,onChange:T=>a({unitKey:p,value:T.target.value}),testId:S}}return c})})):[],o=i?i.map((d,c)=>({...d,cells:d.cells.map((t,S)=>{if("autoUnit"in t&&(t!=null&&t.autoUnit)&&(typeof(t==null?void 0:t.value)=="string"||typeof(t==null?void 0:t.value)=="number")){const{unitKey:p,value:T,formatDisplayValue:D}=t,j=U&&"roundDisplayValue"in t?t==null?void 0:t.roundDisplayValue:null,g=r[p],b=s[p],e=g!==b,f=e?y.convertAndGetValue(T,g,b):t.value,C=D?D(f):f;return{...t,value:C,enableCosmeticRounding:h&&e,enableDisplayRounding:U,roundDisplayValue:j,onChange:w=>{const{value:x}=w.target,R=s[p],E=r[p],A=E!==R,B=m?R:E,H=A?y.convertAndGetValue(x,B,E):x;if("onChange"in t){const{onChange:I}=t,J={...w,target:{...w.target,value:String(H),rowIndex:c,cellIndex:S,unit:B}};I(J)}}}}return t})})):[];return{convertedHeaders:u,convertedRows:o}},z=({table:l,unitConfig:i,convertBackToStorageUnit:r=!0,enableCosmeticRounding:s=!0,enableDisplayRounding:a=!0})=>{const{rows:m,headers:h,...U}=l,{storageUnits:u,preferredUnits:o}=ne(i),d=ee(o),[c,t]=v.useState(o),S=({unitKey:g,value:b})=>{t({...c,[g]:b});const e=i.find(f=>f.unitKey===g);e&&typeof e.onChange=="function"&&e.onChange({oldUnit:c[g],newUnit:b,unitKey:g})},p=g=>ae({headers:h,rows:m,selectedUnits:g,storageUnits:u,onChangeUnit:S,convertBackToStorageUnit:r,enableCosmeticRounding:s,enableDisplayRounding:a}),T=p(c),[D,j]=v.useState(T);return v.useEffect(()=>{!Z.isEqual(o,d)&&(Object.keys(o).forEach(b=>{const e=d==null?void 0:d[b],f=o[b];e!==f&&S({unitKey:b,value:f})}),j(p(o)))},[i]),v.useEffect(()=>{j(p(c))},[l,c]),n.jsx(te,{table:{...U,headers:D.convertedHeaders,rows:D.convertedRows}})};z.__docgenInfo={description:"",methods:[],displayName:"UnitTable",props:{table:{required:!0,tsType:{name:"IUnitTable"},description:""},unitConfig:{required:!0,tsType:{name:"Array",elements:[{name:"IUnitConfigItem"}],raw:"IUnitConfigItem[]"},description:""},convertBackToStorageUnit:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}},enableCosmeticRounding:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}},enableDisplayRounding:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}}},composes:["Omit"]};const ct={title:"Basic/UnitTable",args:{}},ie=!0,re=!0,oe=!0,le=!1,_="ft",M="C",se=3,ue=(l,i,r)=>{const s=[i,i,r],a=[...Array(l)].map((m,h)=>{const U=h,u=h+1.25,o=4+h*.25;return[String(U),String(u),String(o)]});return[s,...a]},de=ue(se,_,M),ce=({reduxTable:l,value:i,unit:r,rowIndex:s,cellIndex:a})=>Q(l,m=>{const h=m[0][a],U=(u,o)=>o===0;return m.forEach((u,o)=>{if(U(u,o)){u[a]=r;return}if(o===s+1){u[a]=String(i);return}const d=y.convertAndGetValue(u[a],r,h);u[a]=String(d)}),m}),pe=({reduxTable:l,value:i,rowIndex:r,cellIndex:s})=>Q(l,a=>{a[r+1][s]=i}),k=()=>{var g,b;const[l,i]=v.useState(_),[r,s]=v.useState(M),[a,m]=v.useState(de),[h,U]=v.useState(ie),[u,o]=v.useState(oe),[d,c]=v.useState(re),[t,S]=v.useState(le),[p,T]=v.useState(_),D=e=>{const{rowIndex:f,cellIndex:C,value:w,unit:x}=e.target,R=t?ce({reduxTable:a,value:w,unit:x,rowIndex:f,cellIndex:C}):pe({reduxTable:a,value:w,rowIndex:f,cellIndex:C});m(R)},j=a.reduce((e,f,C)=>(C===0?e.headers=[{cells:[{value:"From"},{value:"To"},{value:"Temperature"}]},{cells:[{type:"AutoUnit",unitKey:"length"},{type:"AutoUnit",unitKey:"length"},{type:"AutoUnit",unitKey:"temperature",testId:"table-unit-selector-3"}]}]:e.rows=e.rows.concat({cells:f.map((w,x)=>{const R=C===1&&x===1;return{value:w,type:R?"Text":"NumberInput",unitKey:x===2?"temperature":"length",onChange:D,roundDisplayValue:C===3&&x===2?I=>y.roundByMagnitude(I,2):null,formatDisplayValue:R?I=>`T* ${I}`:null,autoUnit:!0,testId:`testId_${C}_${x}`}})}),e),{testId:"testId",headers:[],rows:[]});return n.jsxs(X,{columns:"1fr 1fr",gap:!0,children:[n.jsxs(V,{heading:n.jsx(F,{children:"Settings"}),children:[n.jsx(L,{label:"Convert back to storage unit:",labelLeft:!0,labelWidth:200,children:n.jsx(W,{checked:h,onChange:e=>U(e.target.checked)})}),n.jsx(L,{label:"Enable display rounding:",labelLeft:!0,labelWidth:200,children:n.jsx(W,{checked:u,onChange:e=>o(e.target.checked)})}),n.jsx(L,{label:"Enable cosmetic rounding:",labelLeft:!0,labelWidth:200,children:n.jsx(W,{checked:d,onChange:e=>c(e.target.checked)})}),n.jsx(L,{label:"Convert whole table:",labelLeft:!0,labelWidth:200,children:n.jsx(W,{checked:t,onChange:e=>S(e.target.checked)})})]}),n.jsxs(V,{heading:n.jsx(F,{children:"Unit template"}),children:[n.jsx(L,{label:"Length unit:",labelLeft:!0,labelWidth:120,children:n.jsx(N,{options:(g=y.getUnitsForQuantity("length"))==null?void 0:g.map(e=>({value:e,label:y.label(e)})),value:{value:l},onChange:e=>i(e.target.value),width:"100px"})}),n.jsx(L,{label:"Temperature unit:",labelLeft:!0,labelWidth:120,children:n.jsx(N,{options:(b=y.getUnitsForQuantity("temperature"))==null?void 0:b.map(e=>({value:e,label:y.label(e)})),value:{value:r},onChange:e=>s(e.target.value),width:"100px"})})]}),n.jsx(V,{heading:n.jsx(F,{children:"Storage State (Redux)"}),children:n.jsx("pre",{children:n.jsx("code",{children:JSON.stringify(a,null,2)})})}),n.jsxs(V,{heading:n.jsx(F,{children:"UnitTable"}),children:[n.jsx(z,{table:j,unitConfig:[{unitKey:"length",storageUnit:a[0][0],preferredUnit:l,onChange:({newUnit:e})=>T(e)},{unitKey:"temperature",storageUnit:a[0][2],preferredUnit:r}],convertBackToStorageUnit:h,enableDisplayRounding:u,enableCosmeticRounding:d}),n.jsx(Y,{height:20}),n.jsx(L,{label:"Displayed length unit:",labelLeft:!0,labelWidth:150,children:p})]})]})};k.__docgenInfo={description:"",methods:[],displayName:"UnitTableExample"};var G,O,P,q,$;k.parameters={...k.parameters,docs:{...(G=k.parameters)==null?void 0:G.docs,source:{originalSource:`() => {
1
+ import{j as n}from"./jsx-runtime-eps93zm2.js";import{r as v}from"./index-DhsZuJvc.js";import{f as Q}from"./immer.esm-BwVl9PS2.js";import{d as y}from"./index-C0x1JmaP.js";import{G as X}from"./grid-DRkC-bt8.js";import{S as Y}from"./spacer-BWoNR27H.js";import{C as V}from"./card-EcjmryU9.js";import{F as L}from"./field-HrLaMLbx.js";import{H as F}from"./heading-CRNoBc7q.js";import{S as N}from"./select-03uRbc4I.js";import{T as W}from"./toggle-BbFVf61v.js";import{l as Z}from"./lodash-c4VUpsOs.js";import{u as ee}from"./use-previous-D775JrO6.js";import{T as te,C as K}from"./table-DTe-5k91.js";import"./index-DRSy5Ssd.js";import"./styled-components.browser.esm-BQ9GQzDc.js";import"./index-Bk2sglWO.js";import"./label-CqmyC9he.js";import"./common-types-Sih75Sav.js";import"./help-icon-Buhx5nl6.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./disabled-context-rmpd7YJS.js";import"./types-Dx2TtIG9.js";import"./enum-Bnn40S8Q.js";import"./assertThisInitialized-B9jnkVVz.js";import"./memoize-one.esm-CcMeOnPo.js";import"./types-BmbYqTX_.js";import"./text-B3-TSWok.js";import"./actions-D-uVCDzk.js";import"./button-DHevvVBE.js";import"./spinner-AWUe4xwQ.js";import"./badge-CLQ59MDF.js";import"./select.input-CJed_LLR.js";import"./helpers-JJxzGegQ.js";import"./index.es-DazXb-ul.js";import"./redux-tRgGMjwY.js";import"./objectSpread2-DW4nTBoq.js";import"./tiny-invariant-DqLgxztJ.js";import"./pagination-DWc8zp3k.js";import"./input-DTXbDJaL.js";import"./input-group-BaRSJAEN.js";import"./input-group-addon-D68iUKV2.js";import"./number-input-CJJvhIIv.js";import"./check-box-DPLaOkRR.js";import"./slider-FeTfWTXx.js";import"./index-BI4_Bp97.js";import"./popover-rq33c1W2.js";const ne=l=>l.reduce(({preferredUnits:i,storageUnits:r},{unitKey:s,preferredUnit:a,storageUnit:m})=>(i[s]=a,r[s]=m,{preferredUnits:i,storageUnits:r}),{preferredUnits:{},storageUnits:{}}),ae=({headers:l,rows:i,selectedUnits:r,storageUnits:s,onChangeUnit:a,convertBackToStorageUnit:m,enableCosmeticRounding:h,enableDisplayRounding:U})=>{const u=l?l.map(d=>({...d,cells:d.cells.map(c=>{var t;if(c.type===K.AUTO_UNIT){const{testId:S,unitKey:p}=c;return{value:r[p],type:K.SELECT,searchable:!1,options:(t=y.getUnitsForQuantity(p))==null?void 0:t.map(T=>({label:y.label(T),value:T})),native:c.native,onChange:T=>a({unitKey:p,value:T.target.value}),testId:S}}return c})})):[],o=i?i.map((d,c)=>({...d,cells:d.cells.map((t,S)=>{if("autoUnit"in t&&(t!=null&&t.autoUnit)&&(typeof(t==null?void 0:t.value)=="string"||typeof(t==null?void 0:t.value)=="number")){const{unitKey:p,value:T,formatDisplayValue:D}=t,j=U&&"roundDisplayValue"in t?t==null?void 0:t.roundDisplayValue:null,g=r[p],b=s[p],e=g!==b,f=e?y.convertAndGetValue(T,g,b):t.value,C=D?D(f):f;return{...t,value:C,enableCosmeticRounding:h&&e,enableDisplayRounding:U,roundDisplayValue:j,onChange:w=>{const{value:x}=w.target,R=s[p],E=r[p],A=E!==R,B=m?R:E,H=A?y.convertAndGetValue(x,B,E):x;if("onChange"in t){const{onChange:I}=t,J={...w,target:{...w.target,value:String(H),rowIndex:c,cellIndex:S,unit:B}};I(J)}}}}return t})})):[];return{convertedHeaders:u,convertedRows:o}},z=({table:l,unitConfig:i,convertBackToStorageUnit:r=!0,enableCosmeticRounding:s=!0,enableDisplayRounding:a=!0})=>{const{rows:m,headers:h,...U}=l,{storageUnits:u,preferredUnits:o}=ne(i),d=ee(o),[c,t]=v.useState(o),S=({unitKey:g,value:b})=>{t({...c,[g]:b});const e=i.find(f=>f.unitKey===g);e&&typeof e.onChange=="function"&&e.onChange({oldUnit:c[g],newUnit:b,unitKey:g})},p=g=>ae({headers:h,rows:m,selectedUnits:g,storageUnits:u,onChangeUnit:S,convertBackToStorageUnit:r,enableCosmeticRounding:s,enableDisplayRounding:a}),T=p(c),[D,j]=v.useState(T);return v.useEffect(()=>{!Z.isEqual(o,d)&&(Object.keys(o).forEach(b=>{const e=d==null?void 0:d[b],f=o[b];e!==f&&S({unitKey:b,value:f})}),j(p(o)))},[i]),v.useEffect(()=>{j(p(c))},[l,c]),n.jsx(te,{table:{...U,headers:D.convertedHeaders,rows:D.convertedRows}})};z.__docgenInfo={description:"",methods:[],displayName:"UnitTable",props:{table:{required:!0,tsType:{name:"IUnitTable"},description:""},unitConfig:{required:!0,tsType:{name:"Array",elements:[{name:"IUnitConfigItem"}],raw:"IUnitConfigItem[]"},description:""},convertBackToStorageUnit:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}},enableCosmeticRounding:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}},enableDisplayRounding:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}}},composes:["Omit"]};const ct={title:"Basic/UnitTable",args:{}},ie=!0,re=!0,oe=!0,le=!1,_="ft",M="C",se=3,ue=(l,i,r)=>{const s=[i,i,r],a=[...Array(l)].map((m,h)=>{const U=h,u=h+1.25,o=4+h*.25;return[String(U),String(u),String(o)]});return[s,...a]},de=ue(se,_,M),ce=({reduxTable:l,value:i,unit:r,rowIndex:s,cellIndex:a})=>Q(l,m=>{const h=m[0][a],U=(u,o)=>o===0;return m.forEach((u,o)=>{if(U(u,o)){u[a]=r;return}if(o===s+1){u[a]=String(i);return}const d=y.convertAndGetValue(u[a],r,h);u[a]=String(d)}),m}),pe=({reduxTable:l,value:i,rowIndex:r,cellIndex:s})=>Q(l,a=>{a[r+1][s]=i}),k=()=>{var g,b;const[l,i]=v.useState(_),[r,s]=v.useState(M),[a,m]=v.useState(de),[h,U]=v.useState(ie),[u,o]=v.useState(oe),[d,c]=v.useState(re),[t,S]=v.useState(le),[p,T]=v.useState(_),D=e=>{const{rowIndex:f,cellIndex:C,value:w,unit:x}=e.target,R=t?ce({reduxTable:a,value:w,unit:x,rowIndex:f,cellIndex:C}):pe({reduxTable:a,value:w,rowIndex:f,cellIndex:C});m(R)},j=a.reduce((e,f,C)=>(C===0?e.headers=[{cells:[{value:"From"},{value:"To"},{value:"Temperature"}]},{cells:[{type:"AutoUnit",unitKey:"length"},{type:"AutoUnit",unitKey:"length"},{type:"AutoUnit",unitKey:"temperature",testId:"table-unit-selector-3"}]}]:e.rows=e.rows.concat({cells:f.map((w,x)=>{const R=C===1&&x===1;return{value:w,type:R?"Text":"NumberInput",unitKey:x===2?"temperature":"length",onChange:D,roundDisplayValue:C===3&&x===2?I=>y.roundByMagnitude(I,2):null,formatDisplayValue:R?I=>`T* ${I}`:null,autoUnit:!0,testId:`testId_${C}_${x}`}})}),e),{testId:"testId",headers:[],rows:[]});return n.jsxs(X,{columns:"1fr 1fr",gap:!0,children:[n.jsxs(V,{heading:n.jsx(F,{children:"Settings"}),children:[n.jsx(L,{label:"Convert back to storage unit:",labelLeft:!0,labelWidth:200,children:n.jsx(W,{checked:h,onChange:e=>U(e.target.checked)})}),n.jsx(L,{label:"Enable display rounding:",labelLeft:!0,labelWidth:200,children:n.jsx(W,{checked:u,onChange:e=>o(e.target.checked)})}),n.jsx(L,{label:"Enable cosmetic rounding:",labelLeft:!0,labelWidth:200,children:n.jsx(W,{checked:d,onChange:e=>c(e.target.checked)})}),n.jsx(L,{label:"Convert whole table:",labelLeft:!0,labelWidth:200,children:n.jsx(W,{checked:t,onChange:e=>S(e.target.checked)})})]}),n.jsxs(V,{heading:n.jsx(F,{children:"Unit template"}),children:[n.jsx(L,{label:"Length unit:",labelLeft:!0,labelWidth:120,children:n.jsx(N,{options:(g=y.getUnitsForQuantity("length"))==null?void 0:g.map(e=>({value:e,label:y.label(e)})),value:{value:l},onChange:e=>i(e.target.value),width:"100px"})}),n.jsx(L,{label:"Temperature unit:",labelLeft:!0,labelWidth:120,children:n.jsx(N,{options:(b=y.getUnitsForQuantity("temperature"))==null?void 0:b.map(e=>({value:e,label:y.label(e)})),value:{value:r},onChange:e=>s(e.target.value),width:"100px"})})]}),n.jsx(V,{heading:n.jsx(F,{children:"Storage State (Redux)"}),children:n.jsx("pre",{children:n.jsx("code",{children:JSON.stringify(a,null,2)})})}),n.jsxs(V,{heading:n.jsx(F,{children:"UnitTable"}),children:[n.jsx(z,{table:j,unitConfig:[{unitKey:"length",storageUnit:a[0][0],preferredUnit:l,onChange:({newUnit:e})=>T(e)},{unitKey:"temperature",storageUnit:a[0][2],preferredUnit:r}],convertBackToStorageUnit:h,enableDisplayRounding:u,enableCosmeticRounding:d}),n.jsx(Y,{height:20}),n.jsx(L,{label:"Displayed length unit:",labelLeft:!0,labelWidth:150,children:p})]})]})};k.__docgenInfo={description:"",methods:[],displayName:"UnitTableExample"};var G,O,P,q,$;k.parameters={...k.parameters,docs:{...(G=k.parameters)==null?void 0:G.docs,source:{originalSource:`() => {
2
2
  const [preferredLengthUnit, setPreferredLengthUnit] = useState(initialLengthUnit);
3
3
  const [preferredTemperatureUnit, setPreferredTemperatureUnit] = useState(initialTemperatureUnit);
4
4
  const [reduxTable, setReduxTable] = useState<TTable>(initialTable);
@@ -1 +1 @@
1
- import{w as p,u as i,e as r,f as s,a as n}from"./index-DMAnyMX5.js";import{UnitTableExample as c}from"./unit-table.stories-DVqdGdEC.js";import"./index-CF7H4eMJ.js";import"./jsx-runtime-eps93zm2.js";import"./index-DhsZuJvc.js";import"./immer.esm-BwVl9PS2.js";import"./index-C0x1JmaP.js";import"./index-DRSy5Ssd.js";import"./grid-DRkC-bt8.js";import"./styled-components.browser.esm-BQ9GQzDc.js";import"./spacer-BWoNR27H.js";import"./card-EcjmryU9.js";import"./index-Bk2sglWO.js";import"./field-HrLaMLbx.js";import"./label-CqmyC9he.js";import"./common-types-Sih75Sav.js";import"./help-icon-Buhx5nl6.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./disabled-context-rmpd7YJS.js";import"./heading-CRNoBc7q.js";import"./select-03uRbc4I.js";import"./lodash-c4VUpsOs.js";import"./types-Dx2TtIG9.js";import"./enum-Bnn40S8Q.js";import"./assertThisInitialized-B9jnkVVz.js";import"./memoize-one.esm-CcMeOnPo.js";import"./types-BmbYqTX_.js";import"./text-B3-TSWok.js";import"./actions-D-uVCDzk.js";import"./button-DHevvVBE.js";import"./spinner-AWUe4xwQ.js";import"./badge-CLQ59MDF.js";import"./select.input-CJed_LLR.js";import"./helpers-JJxzGegQ.js";import"./toggle-BbFVf61v.js";import"./use-previous-D775JrO6.js";import"./table-B5fM_vjN.js";import"./index.es-DazXb-ul.js";import"./redux-tRgGMjwY.js";import"./objectSpread2-DW4nTBoq.js";import"./tiny-invariant-DqLgxztJ.js";import"./pagination-DWc8zp3k.js";import"./input-DTXbDJaL.js";import"./input-group-BaRSJAEN.js";import"./input-group-addon-D68iUKV2.js";import"./number-input-CJJvhIIv.js";import"./check-box-DPLaOkRR.js";import"./slider-CNPYg8Sz.js";import"./index-BI4_Bp97.js";import"./popover-rq33c1W2.js";const ut={title:"Basic/UnitTable/Test Cases",args:{},tags:["!autodocs"]},w=c.bind({});w.play=async({canvasElement:o,step:e})=>{const a=p(o),m=p(o.ownerDocument.body);await e("Can enter decimal values",async()=>{const t=a.getByTestId("testId_2_1");await i.clear(t),await i.type(t,"123.123456789"),await i.click(o),await r(a.getByDisplayValue("123.12")).toBeInTheDocument()}),await e("Can enter comma decimals (converts to dot)",async()=>{const t=a.getByTestId("testId_2_1");await i.clear(t),await i.type(t,"123,456"),await i.click(o),await r(a.getByDisplayValue("123.46")).toBeInTheDocument()}),await e("Can enter small numbers",async()=>{const t=a.getByTestId("testId_2_1");await i.clear(t),await i.type(t,"0.0000000023"),await i.click(o),await r(t).toHaveDisplayValue("0.00")}),await e("Can enter large numbers",async()=>{const t=a.getByTestId("testId_2_1");await i.clear(t),await i.type(t,"999999999999"),await i.click(o),await r(a.getByDisplayValue("999999999999.00")).toBeInTheDocument()}),await e("Shows validation error for non-numeric input",async()=>{const t=a.getByTestId("testId_2_1");await i.clear(t),await i.type(t,"123x45s6"),await i.click(o),await r(a.getByDisplayValue("123x45s6")).toBeInTheDocument(),await s.mouseOver(t),await n(()=>{r(m.getByText("Must be a numerical value")).toBeInTheDocument()})})};const yt=["Test"];export{w as Test,yt as __namedExportsOrder,ut as default};
1
+ import{w as p,u as i,e as r,f as s,a as n}from"./index-DMAnyMX5.js";import{UnitTableExample as c}from"./unit-table.stories-fpuLLOXX.js";import"./index-CF7H4eMJ.js";import"./jsx-runtime-eps93zm2.js";import"./index-DhsZuJvc.js";import"./immer.esm-BwVl9PS2.js";import"./index-C0x1JmaP.js";import"./index-DRSy5Ssd.js";import"./grid-DRkC-bt8.js";import"./styled-components.browser.esm-BQ9GQzDc.js";import"./spacer-BWoNR27H.js";import"./card-EcjmryU9.js";import"./index-Bk2sglWO.js";import"./field-HrLaMLbx.js";import"./label-CqmyC9he.js";import"./common-types-Sih75Sav.js";import"./help-icon-Buhx5nl6.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./disabled-context-rmpd7YJS.js";import"./heading-CRNoBc7q.js";import"./select-03uRbc4I.js";import"./lodash-c4VUpsOs.js";import"./types-Dx2TtIG9.js";import"./enum-Bnn40S8Q.js";import"./assertThisInitialized-B9jnkVVz.js";import"./memoize-one.esm-CcMeOnPo.js";import"./types-BmbYqTX_.js";import"./text-B3-TSWok.js";import"./actions-D-uVCDzk.js";import"./button-DHevvVBE.js";import"./spinner-AWUe4xwQ.js";import"./badge-CLQ59MDF.js";import"./select.input-CJed_LLR.js";import"./helpers-JJxzGegQ.js";import"./toggle-BbFVf61v.js";import"./use-previous-D775JrO6.js";import"./table-DTe-5k91.js";import"./index.es-DazXb-ul.js";import"./redux-tRgGMjwY.js";import"./objectSpread2-DW4nTBoq.js";import"./tiny-invariant-DqLgxztJ.js";import"./pagination-DWc8zp3k.js";import"./input-DTXbDJaL.js";import"./input-group-BaRSJAEN.js";import"./input-group-addon-D68iUKV2.js";import"./number-input-CJJvhIIv.js";import"./check-box-DPLaOkRR.js";import"./slider-FeTfWTXx.js";import"./index-BI4_Bp97.js";import"./popover-rq33c1W2.js";const ut={title:"Basic/UnitTable/Test Cases",args:{},tags:["!autodocs"]},w=c.bind({});w.play=async({canvasElement:o,step:e})=>{const a=p(o),m=p(o.ownerDocument.body);await e("Can enter decimal values",async()=>{const t=a.getByTestId("testId_2_1");await i.clear(t),await i.type(t,"123.123456789"),await i.click(o),await r(a.getByDisplayValue("123.12")).toBeInTheDocument()}),await e("Can enter comma decimals (converts to dot)",async()=>{const t=a.getByTestId("testId_2_1");await i.clear(t),await i.type(t,"123,456"),await i.click(o),await r(a.getByDisplayValue("123.46")).toBeInTheDocument()}),await e("Can enter small numbers",async()=>{const t=a.getByTestId("testId_2_1");await i.clear(t),await i.type(t,"0.0000000023"),await i.click(o),await r(t).toHaveDisplayValue("0.00")}),await e("Can enter large numbers",async()=>{const t=a.getByTestId("testId_2_1");await i.clear(t),await i.type(t,"999999999999"),await i.click(o),await r(a.getByDisplayValue("999999999999.00")).toBeInTheDocument()}),await e("Shows validation error for non-numeric input",async()=>{const t=a.getByTestId("testId_2_1");await i.clear(t),await i.type(t,"123x45s6"),await i.click(o),await r(a.getByDisplayValue("123x45s6")).toBeInTheDocument(),await s.mouseOver(t),await n(()=>{r(m.getByText("Must be a numerical value")).toBeInTheDocument()})})};const yt=["Test"];export{w as Test,yt as __namedExportsOrder,ut as default};
@@ -509,7 +509,7 @@
509
509
  }
510
510
  </script>
511
511
 
512
- <script type="module" crossorigin src="./assets/iframe-BPqD7cXD.js"></script>
512
+ <script type="module" crossorigin src="./assets/iframe-CGWaHu-t.js"></script>
513
513
  </head>
514
514
 
515
515
  <body>
@@ -1 +1 @@
1
- {"generatedAt":1724933220604,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":false,"hasStorybookEslint":true,"refCount":0,"testPackages":{"@types/jest":"29.5.12","@vitest/coverage-c8":"0.31.4","eslint-plugin-vitest":null,"eslint-plugin-vitest-globals":"1.5.0","vitest":"1.6.0"},"packageManager":{"type":"yarn","version":"1.22.19"},"typescriptOptions":{"reactDocgen":"react-docgen"},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/react-vite","options":{}},"builder":"@storybook/builder-vite","renderer":"@storybook/react","storybookVersion":"8.2.8","storybookVersionSpecifier":"^8.2.4","language":"typescript","storybookPackages":{"@storybook/addon-essentials":{"version":"8.2.8"},"@storybook/addon-links":{"version":"8.2.8"},"@storybook/preview-api":{"version":"8.2.8"},"@storybook/react":{"version":"8.2.8"},"@storybook/react-vite":{"version":"8.2.8"},"@storybook/test":{"version":"8.2.8"},"@storybook/test-runner":{"version":"0.19.1"},"eslint-plugin-storybook":{"version":"0.6.15"},"storybook":{"version":"8.2.8"}},"addons":{"@storybook/addon-actions":{"version":"8.2.8"},"@storybook/addon-docs":{"version":"8.2.8"},"@storybook/addon-interactions":{"version":"8.2.8"},"storybook-dark-mode":{"version":"4.0.2"}}}
1
+ {"generatedAt":1724935681165,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":false,"hasStorybookEslint":true,"refCount":0,"testPackages":{"@types/jest":"29.5.12","@vitest/coverage-c8":"0.31.4","eslint-plugin-vitest":null,"eslint-plugin-vitest-globals":"1.5.0","vitest":"1.6.0"},"packageManager":{"type":"yarn","version":"1.22.19"},"typescriptOptions":{"reactDocgen":"react-docgen"},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/react-vite","options":{}},"builder":"@storybook/builder-vite","renderer":"@storybook/react","storybookVersion":"8.2.8","storybookVersionSpecifier":"^8.2.4","language":"typescript","storybookPackages":{"@storybook/addon-essentials":{"version":"8.2.8"},"@storybook/addon-links":{"version":"8.2.8"},"@storybook/preview-api":{"version":"8.2.8"},"@storybook/react":{"version":"8.2.8"},"@storybook/react-vite":{"version":"8.2.8"},"@storybook/test":{"version":"8.2.8"},"@storybook/test-runner":{"version":"0.19.1"},"eslint-plugin-storybook":{"version":"0.6.15"},"storybook":{"version":"8.2.8"}},"addons":{"@storybook/addon-actions":{"version":"8.2.8"},"@storybook/addon-docs":{"version":"8.2.8"},"@storybook/addon-interactions":{"version":"8.2.8"},"storybook-dark-mode":{"version":"4.0.2"}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/react-ui-library",
3
- "version": "4.10.10-beta-1",
3
+ "version": "4.10.10-beta-2",
4
4
  "description": "Reusable UI components for React projects",
5
5
  "homepage": "https://oliasoft-open-source.gitlab.io/react-ui-library",
6
6
  "bugs": {