@oliasoft-open-source/react-ui-library 4.6.1 → 4.6.2-beta-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/assets/{index-kDrJq_kq.js → index-21EwET8E.js} +2 -3
  2. package/dist/index.d.ts +0 -1
  3. package/dist/index.html +1 -1
  4. package/dist/index.js +2 -3
  5. package/dist/index.js.map +1 -1
  6. package/dist/storybook/assets/{Color-6VNJS4EI-LkypNDYY.js → Color-6VNJS4EI-tDs0DW6l.js} +1 -1
  7. package/dist/storybook/assets/{DocsRenderer-NNNQARDV-271EmMHR.js → DocsRenderer-NNNQARDV-4FhE5tBt.js} +1 -1
  8. package/dist/storybook/assets/{WithTooltip-V3YHNWJZ-5odABDuO.js → WithTooltip-V3YHNWJZ-4DkfkReL.js} +1 -1
  9. package/dist/storybook/assets/{afe.stories-gufd9PH8.js → afe.stories-yjkRmCqu.js} +1 -1
  10. package/dist/storybook/assets/{blowout.stories-TT3YZhxD.js → blowout.stories-fjMitjld.js} +1 -1
  11. package/dist/storybook/assets/{buttons-and-links-Sb4bneec.js → buttons-and-links-hjYalcqd.js} +1 -1
  12. package/dist/storybook/assets/{casing-loads.stories-58Yzw909.js → casing-loads.stories-Ilvo3kc-.js} +1 -1
  13. package/dist/storybook/assets/{chunk-HLWAVYOI-C-Uqv-lv.js → chunk-HLWAVYOI-cTxm6eFs.js} +1 -1
  14. package/dist/storybook/assets/{color-QEPOj0Ib.js → color-zQ_1Ab3p.js} +1 -1
  15. package/dist/storybook/assets/{file-input.stories-qbEqmWyt.js → file-input.stories-lKF1ABXX.js} +1 -1
  16. package/dist/storybook/assets/{form.stories-7v6JzvJl.js → form.stories-AikCzsZc.js} +1 -1
  17. package/dist/storybook/assets/{formation.stories-gIRSy7_9.js → formation.stories-4zFgtvwa.js} +1 -1
  18. package/dist/storybook/assets/{formatter-SWP5E3XI-a7sBt194.js → formatter-SWP5E3XI-Cfu_VZgT.js} +1 -1
  19. package/dist/storybook/assets/{iframe-Z5bUT4O1.js → iframe-uQDN-5FH.js} +2 -2
  20. package/dist/storybook/assets/{index-i2tVYo5N.js → index-Y7wjLv-G.js} +5 -5
  21. package/dist/storybook/assets/{input-validation-FFXJoKSI.js → input-validation-oMZurKNs.js} +1 -1
  22. package/dist/storybook/assets/{inputs-DtKO2too.js → inputs-x27d4m44.js} +1 -1
  23. package/dist/storybook/assets/{layout-forms-7ZIITxGs.js → layout-forms-kdhJZ6gZ.js} +1 -1
  24. package/dist/storybook/assets/{layout-general-zuo7KumY.js → layout-general-nsHljhz3.js} +1 -1
  25. package/dist/storybook/assets/{padding-and-spacing-3Mlm9PiC.js → padding-and-spacing-lmVoZ2oR.js} +1 -1
  26. package/dist/storybook/assets/{page.stories-OXhmRr73.js → page.stories-UQlnuZid.js} +1 -1
  27. package/dist/storybook/assets/{preview-0LPoYPAJ.js → preview-f8-piscl.js} +1 -1
  28. package/dist/storybook/assets/{preview-MDW-geT9.js → preview-oUKV_zRt.js} +2 -2
  29. package/dist/storybook/assets/{reservoirs.stories-vxBxhmZh.js → reservoirs.stories-TKohSiCU.js} +1 -1
  30. package/dist/storybook/assets/side-bar-dRjlh2Za.js +1 -0
  31. package/dist/storybook/assets/side-bar.stories-aKMnuHiZ.js +1 -0
  32. package/dist/storybook/assets/{site.stories-k6-tU36k.js → site.stories-Qfujz1ST.js} +1 -1
  33. package/dist/storybook/assets/{syntaxhighlighter-B5GMVT5T-jueltlMw.js → syntaxhighlighter-B5GMVT5T-rE3BvsrO.js} +1 -1
  34. package/dist/storybook/assets/{textarea-ygEac3d2.js → textarea-TSoWqDT8.js} +1 -1
  35. package/dist/storybook/assets/{textarea.stories-vr_I38NI.js → textarea.stories-w6XYooLd.js} +1 -1
  36. package/dist/storybook/assets/unit-table.stories-CO9oH2A7.js +107 -0
  37. package/dist/storybook/iframe.html +1 -1
  38. package/dist/storybook/index.json +1 -1
  39. package/dist/storybook/project.json +1 -1
  40. package/dist/storybook/stories.json +1 -1
  41. package/package.json +1 -1
  42. package/dist/404.html +0 -1
  43. package/dist/storybook/assets/side-bar-ZpHvA_KQ.js +0 -1
  44. package/dist/storybook/assets/side-bar.stories-GCjyz_UC.js +0 -27
  45. package/dist/storybook/assets/unit-table.stories-JkNu_Up6.js +0 -103
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-FsUICBgo.js";import{r as x}from"./index-RfLt4OUa.js";import{I as j}from"./common-types-U65vzrrz.js";import{T as g}from"./top-bar-ywJJBf-H.js";import{S as w}from"./side-bar-ZpHvA_KQ.js";import{H as r}from"./heading-jZsIIJF0.js";import{B as L}from"./button-shH4xakS.js";import{D as v}from"./drawer-GdbVQdWk.js";import{L as d}from"./list-PShi-3TE.js";import{F as n}from"./field-FZX0Z7IB.js";import{I as l}from"./input-2BhbKV-j.js";import{C as m}from"./check-box-2gxosI3y.js";import{P as f}from"./page-9-f6BzS0.js";import{R as t,C as a}from"./row-vFUhHoz5.js";import{A as u}from"./accordion-M-sY23Hd.js";import{S as s}from"./spacer-Yji9g2AW.js";import{T as F}from"./tabs-fcLbHC1n.js";import"./index-VW3EWkuE.js";import"./icon-8EQazuuW.js";import"./objectWithoutPropertiesLoose-9Q1jwsKS.js";import"./inheritsLoose-8sb_A2v4.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./actions-mOcj9IlF.js";import"./lodash-Bmg8FrMx.js";import"./tooltip-HEHiU__l.js";import"./index-miLrID2P.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./index-ugi_ZH6T.js";import"./help-icon-SKky6KLV.js";import"./spinner-R8Il4aRe.js";import"./index.es-VXFRDikp.js";import"./redux-F5dueAP3.js";import"./objectSpread2-93s0nBry.js";import"./tiny-invariant-R4kOKlvx.js";import"./memoize-one.esm-hqe5SRxC.js";import"./card-0r8RRVk-.js";import"./meta-content-lUynpOsR.js";import"./loader-TGOJBZQG.js";import"./label-uCFEME1p.js";import"./styled-components.browser.esm-qIipjd6c.js";import"./select.input-zP5tW20f.js";const C=[{label:"Import",value:"import",right:!0},{label:"Settings",value:"settings",right:!0}],S=()=>e.jsx("div",{style:{background:"#AAD3DF",borderLeft:"1px solid #8AB3BF",display:"flex",alignItems:"center",justifyContent:"center",color:"white",height:"100%"},children:"MAP"}),je={title:"Layout/Layout Examples",parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}}},o=()=>{const[i,b]=x.useState(!0);return e.jsxs(e.Fragment,{children:[e.jsx(g,{}),e.jsx(w,{options:{title:"",sections:[]},width:"250px"}),e.jsx(f,{padding:!1,scroll:!1,children:e.jsxs(t,{spacing:0,flex:!0,children:[e.jsxs(v,{button:e.jsx(L,{onClick:()=>b(!i),round:!0,icon:j.CHEVRON_LEFT}),open:i,width:300,closedWidth:"var(--size-sidebar)",children:[e.jsx(d,{drawer:!0,narrow:!i,list:{name:"Sites",items:[{id:1,name:"Main Site",type:"Heading"},{id:2,name:"Site name here",active:!0,label:{value:1,color:"#69779b"}},{id:3,name:"Locations",type:"Heading"},{id:4,name:"Ipsum",label:{value:2,color:"#69779b"}},{id:5,name:"Dolor",label:{value:3,color:"#69779b"}}]}}),e.jsx(d,{drawer:!0,narrow:!i,list:{name:"Wells",items:[{id:1,name:"Main Wellbore",type:"Heading"},{id:2,name:"Lorem",label:{value:1,color:"#77699b"}}]}}),e.jsx(d,{drawer:!0,narrow:!i,list:{name:"Targets",items:[{id:1,name:"Lorem",label:{value:1,color:"#9b6977"}}]}})]}),e.jsxs(a,{borderLeft:!0,flexbox:!0,children:[e.jsx(s,{}),e.jsx(F,{padding:!0,margin:!1,options:C}),e.jsxs(t,{spacing:0,flex:!0,children:[e.jsxs(a,{scroll:!0,padding:!0,width:550,children:[e.jsx(r,{top:!0,children:"Site name here"}),e.jsx(n,{label:"Name",children:e.jsx(l,{value:"Site name here",width:"200px"})}),e.jsxs(u,{heading:e.jsx(r,{children:"Coordinate Reference System"}),managed:!0,children:[e.jsx(n,{label:"Label",labelLeft:!0,labelWidth:"50px",children:e.jsx(l,{value:"Value",width:"100%"})}),e.jsx(n,{label:"Label",labelLeft:!0,labelWidth:"50px",children:e.jsx(l,{value:"Value",width:"100%"})}),e.jsx(n,{label:"Label",labelLeft:!0,labelWidth:"50px",children:e.jsx(l,{value:"Value",width:"100%"})}),e.jsx(n,{children:e.jsx(m,{label:"Dolor"})})]}),e.jsx(s,{}),e.jsx(r,{marginBottom:"var(--padding)",children:"Location"}),e.jsxs(t,{children:[e.jsx(a,{children:e.jsx(n,{label:"Label",children:e.jsx(l,{value:"Value",width:"100%"})})}),e.jsx(a,{children:e.jsx(n,{label:"Label",children:e.jsx(l,{value:"Value",width:"100%"})})}),e.jsx(a,{children:e.jsx(n,{label:"Label",children:e.jsx(l,{value:"Value",width:"100%"})})}),e.jsx(a,{children:e.jsx(n,{label:"Label",children:e.jsx(l,{value:"Value",width:"100%"})})})]}),e.jsx(s,{}),e.jsx(r,{marginBottom:"var(--padding)",children:"Model"}),e.jsxs(t,{children:[e.jsx(a,{children:e.jsx(n,{label:"Label",children:e.jsx(l,{value:"Value",width:"100%"})})}),e.jsx(a,{children:e.jsx(n,{label:"Label",children:e.jsx(l,{value:"Value",width:"100%"})})})]}),e.jsxs(u,{heading:e.jsx(r,{children:"Settings"}),managed:!0,children:[e.jsx(n,{children:e.jsx(m,{label:"Dolor"})}),e.jsxs(t,{children:[e.jsxs(a,{children:[e.jsx(n,{label:"Label",children:e.jsx(l,{value:"Value",width:"100%"})}),e.jsx(n,{label:"Label",children:e.jsx(l,{value:"Value",width:"100%"})})]}),e.jsxs(a,{children:[e.jsx(n,{label:"Label",children:e.jsx(l,{value:"Value",width:"100%"})}),e.jsx(n,{label:"Label",children:e.jsx(l,{value:"Value",width:"100%"})})]})]})]})]}),e.jsx(a,{children:e.jsx(S,{})})]})]})]})})]})};o.__docgenInfo={description:"",methods:[],displayName:"Site"};var p,c,h;o.parameters={...o.parameters,docs:{...(p=o.parameters)==null?void 0:p.docs,source:{originalSource:`() => {
1
+ import{j as e}from"./jsx-runtime-FsUICBgo.js";import{r as x}from"./index-RfLt4OUa.js";import{I as j}from"./common-types-U65vzrrz.js";import{T as g}from"./top-bar-ywJJBf-H.js";import{S as w}from"./side-bar-dRjlh2Za.js";import{H as r}from"./heading-jZsIIJF0.js";import{B as L}from"./button-shH4xakS.js";import{D as v}from"./drawer-GdbVQdWk.js";import{L as d}from"./list-PShi-3TE.js";import{F as n}from"./field-FZX0Z7IB.js";import{I as l}from"./input-2BhbKV-j.js";import{C as m}from"./check-box-2gxosI3y.js";import{P as f}from"./page-9-f6BzS0.js";import{R as t,C as a}from"./row-vFUhHoz5.js";import{A as u}from"./accordion-M-sY23Hd.js";import{S as s}from"./spacer-Yji9g2AW.js";import{T as F}from"./tabs-fcLbHC1n.js";import"./index-VW3EWkuE.js";import"./icon-8EQazuuW.js";import"./objectWithoutPropertiesLoose-9Q1jwsKS.js";import"./inheritsLoose-8sb_A2v4.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./actions-mOcj9IlF.js";import"./lodash-Bmg8FrMx.js";import"./tooltip-HEHiU__l.js";import"./index-miLrID2P.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./index-ugi_ZH6T.js";import"./help-icon-SKky6KLV.js";import"./spinner-R8Il4aRe.js";import"./index.es-VXFRDikp.js";import"./redux-F5dueAP3.js";import"./objectSpread2-93s0nBry.js";import"./tiny-invariant-R4kOKlvx.js";import"./memoize-one.esm-hqe5SRxC.js";import"./card-0r8RRVk-.js";import"./meta-content-lUynpOsR.js";import"./loader-TGOJBZQG.js";import"./label-uCFEME1p.js";import"./styled-components.browser.esm-qIipjd6c.js";import"./select.input-zP5tW20f.js";const C=[{label:"Import",value:"import",right:!0},{label:"Settings",value:"settings",right:!0}],S=()=>e.jsx("div",{style:{background:"#AAD3DF",borderLeft:"1px solid #8AB3BF",display:"flex",alignItems:"center",justifyContent:"center",color:"white",height:"100%"},children:"MAP"}),je={title:"Layout/Layout Examples",parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}}},o=()=>{const[i,b]=x.useState(!0);return e.jsxs(e.Fragment,{children:[e.jsx(g,{}),e.jsx(w,{options:{title:"",sections:[]},width:"250px"}),e.jsx(f,{padding:!1,scroll:!1,children:e.jsxs(t,{spacing:0,flex:!0,children:[e.jsxs(v,{button:e.jsx(L,{onClick:()=>b(!i),round:!0,icon:j.CHEVRON_LEFT}),open:i,width:300,closedWidth:"var(--size-sidebar)",children:[e.jsx(d,{drawer:!0,narrow:!i,list:{name:"Sites",items:[{id:1,name:"Main Site",type:"Heading"},{id:2,name:"Site name here",active:!0,label:{value:1,color:"#69779b"}},{id:3,name:"Locations",type:"Heading"},{id:4,name:"Ipsum",label:{value:2,color:"#69779b"}},{id:5,name:"Dolor",label:{value:3,color:"#69779b"}}]}}),e.jsx(d,{drawer:!0,narrow:!i,list:{name:"Wells",items:[{id:1,name:"Main Wellbore",type:"Heading"},{id:2,name:"Lorem",label:{value:1,color:"#77699b"}}]}}),e.jsx(d,{drawer:!0,narrow:!i,list:{name:"Targets",items:[{id:1,name:"Lorem",label:{value:1,color:"#9b6977"}}]}})]}),e.jsxs(a,{borderLeft:!0,flexbox:!0,children:[e.jsx(s,{}),e.jsx(F,{padding:!0,margin:!1,options:C}),e.jsxs(t,{spacing:0,flex:!0,children:[e.jsxs(a,{scroll:!0,padding:!0,width:550,children:[e.jsx(r,{top:!0,children:"Site name here"}),e.jsx(n,{label:"Name",children:e.jsx(l,{value:"Site name here",width:"200px"})}),e.jsxs(u,{heading:e.jsx(r,{children:"Coordinate Reference System"}),managed:!0,children:[e.jsx(n,{label:"Label",labelLeft:!0,labelWidth:"50px",children:e.jsx(l,{value:"Value",width:"100%"})}),e.jsx(n,{label:"Label",labelLeft:!0,labelWidth:"50px",children:e.jsx(l,{value:"Value",width:"100%"})}),e.jsx(n,{label:"Label",labelLeft:!0,labelWidth:"50px",children:e.jsx(l,{value:"Value",width:"100%"})}),e.jsx(n,{children:e.jsx(m,{label:"Dolor"})})]}),e.jsx(s,{}),e.jsx(r,{marginBottom:"var(--padding)",children:"Location"}),e.jsxs(t,{children:[e.jsx(a,{children:e.jsx(n,{label:"Label",children:e.jsx(l,{value:"Value",width:"100%"})})}),e.jsx(a,{children:e.jsx(n,{label:"Label",children:e.jsx(l,{value:"Value",width:"100%"})})}),e.jsx(a,{children:e.jsx(n,{label:"Label",children:e.jsx(l,{value:"Value",width:"100%"})})}),e.jsx(a,{children:e.jsx(n,{label:"Label",children:e.jsx(l,{value:"Value",width:"100%"})})})]}),e.jsx(s,{}),e.jsx(r,{marginBottom:"var(--padding)",children:"Model"}),e.jsxs(t,{children:[e.jsx(a,{children:e.jsx(n,{label:"Label",children:e.jsx(l,{value:"Value",width:"100%"})})}),e.jsx(a,{children:e.jsx(n,{label:"Label",children:e.jsx(l,{value:"Value",width:"100%"})})})]}),e.jsxs(u,{heading:e.jsx(r,{children:"Settings"}),managed:!0,children:[e.jsx(n,{children:e.jsx(m,{label:"Dolor"})}),e.jsxs(t,{children:[e.jsxs(a,{children:[e.jsx(n,{label:"Label",children:e.jsx(l,{value:"Value",width:"100%"})}),e.jsx(n,{label:"Label",children:e.jsx(l,{value:"Value",width:"100%"})})]}),e.jsxs(a,{children:[e.jsx(n,{label:"Label",children:e.jsx(l,{value:"Value",width:"100%"})}),e.jsx(n,{label:"Label",children:e.jsx(l,{value:"Value",width:"100%"})})]})]})]})]}),e.jsx(a,{children:e.jsx(S,{})})]})]})]})})]})};o.__docgenInfo={description:"",methods:[],displayName:"Site"};var p,c,h;o.parameters={...o.parameters,docs:{...(p=o.parameters)==null?void 0:p.docs,source:{originalSource:`() => {
2
2
  const [open, setOpen] = useState(true);
3
3
  return <>
4
4
  <TopBar />
@@ -1 +1 @@
1
- import{S as l,c as n,s as d}from"./index-i2tVYo5N.js";import"./iframe-Z5bUT4O1.js";import"../sb-preview/runtime.js";import"./index-RfLt4OUa.js";import"./index-miLrID2P.js";import"./inheritsLoose-8sb_A2v4.js";import"./assertThisInitialized-4q6YPdh3.js";import"./index-R5dkQuFe.js";import"./index-PPLHz8o0.js";export{l as SyntaxHighlighter,n as createCopyToClipboardFunction,d as default};
1
+ import{S as l,c as n,s as d}from"./index-Y7wjLv-G.js";import"./iframe-uQDN-5FH.js";import"../sb-preview/runtime.js";import"./index-RfLt4OUa.js";import"./index-miLrID2P.js";import"./inheritsLoose-8sb_A2v4.js";import"./assertThisInitialized-4q6YPdh3.js";import"./index-R5dkQuFe.js";import"./index-PPLHz8o0.js";export{l as SyntaxHighlighter,n as createCopyToClipboardFunction,d as default};
@@ -1 +1 @@
1
- import{j as o}from"./jsx-runtime-FsUICBgo.js";import{r as V}from"./index-RfLt4OUa.js";import{c as h}from"./index-VW3EWkuE.js";import{i as l}from"./types-5uVBABF4.js";import{D as z}from"./disabled-context-urNQThQz.js";import{T as k}from"./tooltip-HEHiU__l.js";const I="_inputInTable_66zck_1",N="_inputHover_66zck_13",R="_inputFocus_66zck_18",C="_inputError_66zck_25",S="_inputWarning_66zck_26",A="_inputDisabled_66zck_61",F="_hideScrollbars_66zck_67",H="_textarea_66zck_77",W="_small_66zck_116",w="_error_66zck_121",D="_warning_66zck_138",P="_monospace_66zck_155",t={inputInTable:I,inputHover:N,inputFocus:R,inputError:C,inputWarning:S,inputDisabled:A,hideScrollbars:F,textarea:H,small:W,error:w,warning:D,monospace:P},i=({name:r,value:u="",placeholder:s="",cols:d,rows:c,disabled:m=!1,onChange:p=()=>{},onKeyPress:f=()=>{},onFocus:v=()=>{},onBlur:_=()=>{},tabIndex:b=0,error:e=null,warning:a=null,tooltip:n=null,maxTooltipWidth:y,resize:x,monospace:g=!1,testId:E})=>{const T=V.useContext(z),q=o.jsx("textarea",{className:h(t.textarea,e?t.error:"",a?t.warning:"",g?t.monospace:""),name:r,value:u,placeholder:s,cols:d,rows:c,onChange:p,disabled:m||T,onKeyPress:f,onFocus:v,onBlur:_,tabIndex:b,style:{resize:x},"data-testid":E});return o.jsx(k,{error:!!e,warning:!!a,text:n||e||a,enabled:n&&l(n)||e&&l(e)||a&&l(a)||!1,maxWidth:y,placement:"bottom-center",children:q})};try{i.displayName="TextArea",i.__docgenInfo={description:"",displayName:"TextArea",props:{name:{defaultValue:null,description:"",name:"name",required:!1,type:{name:"string"}},value:{defaultValue:{value:""},description:"",name:"value",required:!1,type:{name:"TStringOrNumber"}},placeholder:{defaultValue:{value:""},description:"",name:"placeholder",required:!1,type:{name:"string"}},cols:{defaultValue:null,description:"",name:"cols",required:!1,type:{name:"number"}},rows:{defaultValue:null,description:"",name:"rows",required:!1,type:{name:"number"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},onChange:{defaultValue:{value:"() => {}"},description:"",name:"onChange",required:!1,type:{name:"((evt: ChangeEvent<HTMLTextAreaElement>) => void)"}},onKeyPress:{defaultValue:{value:"() => {}"},description:"",name:"onKeyPress",required:!1,type:{name:"((evt: KeyboardEvent<HTMLTextAreaElement>) => void)"}},onFocus:{defaultValue:{value:"() => {}"},description:"",name:"onFocus",required:!1,type:{name:"((evt: FocusEvent<HTMLTextAreaElement, Element>) => void)"}},onBlur:{defaultValue:{value:"() => {}"},description:"",name:"onBlur",required:!1,type:{name:"((evt: FocusEvent<HTMLTextAreaElement, Element>) => void)"}},tabIndex:{defaultValue:{value:"0"},description:"",name:"tabIndex",required:!1,type:{name:"number"}},error:{defaultValue:{value:"null"},description:"",name:"error",required:!1,type:{name:"string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null"}},warning:{defaultValue:{value:"null"},description:"",name:"warning",required:!1,type:{name:"string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null"}},tooltip:{defaultValue:{value:"null"},description:"",name:"tooltip",required:!1,type:{name:"string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null"}},maxTooltipWidth:{defaultValue:null,description:"",name:"maxTooltipWidth",required:!1,type:{name:"TStringOrNumber"}},resize:{defaultValue:null,description:"",name:"resize",required:!1,type:{name:"enum",value:[{value:'"inline"'},{value:'"-moz-initial"'},{value:'"inherit"'},{value:'"initial"'},{value:'"revert"'},{value:'"revert-layer"'},{value:'"unset"'},{value:'"vertical"'},{value:'"block"'},{value:'"both"'},{value:'"horizontal"'},{value:'"none"'}]}},monospace:{defaultValue:{value:"false"},description:"",name:"monospace",required:!1,type:{name:"boolean"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}export{i as T};
1
+ import{j as o}from"./jsx-runtime-FsUICBgo.js";import{r as V}from"./index-RfLt4OUa.js";import{c as h}from"./index-VW3EWkuE.js";import{i as l}from"./types-5uVBABF4.js";import{D as z}from"./disabled-context-urNQThQz.js";import{T as k}from"./tooltip-HEHiU__l.js";const I="_inputInTable_66zck_1",N="_inputHover_66zck_13",R="_inputFocus_66zck_18",C="_inputError_66zck_25",S="_inputWarning_66zck_26",A="_inputDisabled_66zck_61",F="_hideScrollbars_66zck_67",H="_textarea_66zck_77",W="_small_66zck_116",w="_error_66zck_121",D="_warning_66zck_138",P="_monospace_66zck_155",t={inputInTable:I,inputHover:N,inputFocus:R,inputError:C,inputWarning:S,inputDisabled:A,hideScrollbars:F,textarea:H,small:W,error:w,warning:D,monospace:P},i=({name:r,value:u="",placeholder:s="",cols:d,rows:c,disabled:m=!1,onChange:p=()=>{},onKeyPress:f=()=>{},onFocus:v=()=>{},onBlur:_=()=>{},tabIndex:b=0,error:e=null,warning:a=null,tooltip:n=null,maxTooltipWidth:y,resize:x,monospace:g=!1,testId:E})=>{const T=V.useContext(z),q=o.jsx("textarea",{className:h(t.textarea,e?t.error:"",a?t.warning:"",g?t.monospace:""),name:r,value:u,placeholder:s,cols:d,rows:c,onChange:p,disabled:m||T,onKeyPress:f,onFocus:v,onBlur:_,tabIndex:b,style:{resize:x},"data-testid":E});return o.jsx(k,{error:!!e,warning:!!a,text:n||e||a,enabled:n&&l(n)||e&&l(e)||a&&l(a)||!1,maxWidth:y,placement:"bottom-center",children:q})};try{i.displayName="TextArea",i.__docgenInfo={description:"",displayName:"TextArea",props:{name:{defaultValue:null,description:"",name:"name",required:!1,type:{name:"string"}},value:{defaultValue:{value:""},description:"",name:"value",required:!1,type:{name:"TStringOrNumber"}},placeholder:{defaultValue:{value:""},description:"",name:"placeholder",required:!1,type:{name:"string"}},cols:{defaultValue:null,description:"",name:"cols",required:!1,type:{name:"number"}},rows:{defaultValue:null,description:"",name:"rows",required:!1,type:{name:"number"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},onChange:{defaultValue:{value:"() => {}"},description:"",name:"onChange",required:!1,type:{name:"((evt: ChangeEvent<HTMLTextAreaElement>) => void)"}},onKeyPress:{defaultValue:{value:"() => {}"},description:"",name:"onKeyPress",required:!1,type:{name:"((evt: KeyboardEvent<HTMLTextAreaElement>) => void)"}},onFocus:{defaultValue:{value:"() => {}"},description:"",name:"onFocus",required:!1,type:{name:"((evt: FocusEvent<HTMLTextAreaElement, Element>) => void)"}},onBlur:{defaultValue:{value:"() => {}"},description:"",name:"onBlur",required:!1,type:{name:"((evt: FocusEvent<HTMLTextAreaElement, Element>) => void)"}},tabIndex:{defaultValue:{value:"0"},description:"",name:"tabIndex",required:!1,type:{name:"number"}},error:{defaultValue:{value:"null"},description:"",name:"error",required:!1,type:{name:"string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null"}},warning:{defaultValue:{value:"null"},description:"",name:"warning",required:!1,type:{name:"string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null"}},tooltip:{defaultValue:{value:"null"},description:"",name:"tooltip",required:!1,type:{name:"string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null"}},maxTooltipWidth:{defaultValue:null,description:"",name:"maxTooltipWidth",required:!1,type:{name:"TStringOrNumber"}},resize:{defaultValue:null,description:"",name:"resize",required:!1,type:{name:"enum",value:[{value:'"-moz-initial"'},{value:'"inherit"'},{value:'"initial"'},{value:'"revert"'},{value:'"revert-layer"'},{value:'"unset"'},{value:'"inline"'},{value:'"block"'},{value:'"both"'},{value:'"horizontal"'},{value:'"none"'},{value:'"vertical"'}]}},monospace:{defaultValue:{value:"false"},description:"",name:"monospace",required:!1,type:{name:"boolean"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}export{i as T};
@@ -1,4 +1,4 @@
1
- import{j as u}from"./jsx-runtime-FsUICBgo.js";import{T as s}from"./textarea-ygEac3d2.js";import"./index-RfLt4OUa.js";import"./index-VW3EWkuE.js";import"./types-5uVBABF4.js";import"./lodash-Bmg8FrMx.js";import"./disabled-context-urNQThQz.js";import"./tooltip-HEHiU__l.js";import"./index-miLrID2P.js";const{useArgs:g}=__STORYBOOK_MODULE_ADDONS__,C={title:"Forms/TextArea",component:s,args:{disabled:!1}},c=n=>{const[i,o]=g(),m=p=>{o({value:p.target.value})};return u.jsx(s,{...n,onChange:m})},e=c.bind({});var t,r,a;e.parameters={...e.parameters,docs:{...(t=e.parameters)==null?void 0:t.docs,source:{originalSource:`args => {
1
+ import{j as u}from"./jsx-runtime-FsUICBgo.js";import{T as s}from"./textarea-TSoWqDT8.js";import"./index-RfLt4OUa.js";import"./index-VW3EWkuE.js";import"./types-5uVBABF4.js";import"./lodash-Bmg8FrMx.js";import"./disabled-context-urNQThQz.js";import"./tooltip-HEHiU__l.js";import"./index-miLrID2P.js";const{useArgs:g}=__STORYBOOK_MODULE_ADDONS__,C={title:"Forms/TextArea",component:s,args:{disabled:!1}},c=n=>{const[i,o]=g(),m=p=>{o({value:p.target.value})};return u.jsx(s,{...n,onChange:m})},e=c.bind({});var t,r,a;e.parameters={...e.parameters,docs:{...(t=e.parameters)==null?void 0:t.docs,source:{originalSource:`args => {
2
2
  const [_, updateArgs] = useArgs();
3
3
  const handleChange = (evt: ChangeEvent<HTMLTextAreaElement>) => {
4
4
  updateArgs({
@@ -0,0 +1,107 @@
1
+ import{j as s}from"./jsx-runtime-FsUICBgo.js";import{r as h}from"./index-RfLt4OUa.js";import{f as Q}from"./immer.esm-bD7SSJ7T.js";import{d as v}from"./index-qZmQ7nA9.js";import{G as J}from"./grid-u1mZpaML.js";import{C as D}from"./card-0r8RRVk-.js";import{F as $}from"./field-FZX0Z7IB.js";import{H as R}from"./heading-jZsIIJF0.js";import{S as W}from"./select-DZdWUrCW.js";import{l as X}from"./lodash-Bmg8FrMx.js";import{u as Y}from"./use-previous-VKMmnaK7.js";import{T as Z,C as K}from"./table-033R9jUC.js";import"./index-cCpkwrS5.js";import"./styled-components.browser.esm-qIipjd6c.js";import"./tslib.es6-OIsz3r9a.js";import"./index-VW3EWkuE.js";import"./label-uCFEME1p.js";import"./common-types-U65vzrrz.js";import"./help-icon-SKky6KLV.js";import"./tooltip-HEHiU__l.js";import"./index-miLrID2P.js";import"./icon-8EQazuuW.js";import"./objectWithoutPropertiesLoose-9Q1jwsKS.js";import"./inheritsLoose-8sb_A2v4.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./types-5uVBABF4.js";import"./assertThisInitialized-4q6YPdh3.js";import"./memoize-one.esm-hqe5SRxC.js";import"./types-VB5zD18b.js";import"./text-6KQ6ntOV.js";import"./actions-mOcj9IlF.js";import"./button-shH4xakS.js";import"./spinner-R8Il4aRe.js";import"./badge-23Ty_zBt.js";import"./select.input-zP5tW20f.js";import"./index.es-VXFRDikp.js";import"./redux-F5dueAP3.js";import"./objectSpread2-93s0nBry.js";import"./tiny-invariant-R4kOKlvx.js";import"./pagination-tnyyuMkB.js";import"./input-2BhbKV-j.js";import"./input-group-R8LoqKRn.js";import"./input-group-addon-BHVsW9mL.js";import"./number-input-CMhEMmUd.js";import"./check-box-2gxosI3y.js";import"./slider-MN9iDCsS.js";import"./index-ugi_ZH6T.js";import"./popover-cad2llTa.js";const ee=o=>o.reduce(({preferredUnits:t,storageUnits:n},{unitKey:i,preferredUnit:p,storageUnit:m})=>(t[i]=p,n[i]=m,{preferredUnits:t,storageUnits:n}),{preferredUnits:{},storageUnits:{}}),ne=({headers:o,rows:t,selectedUnits:n,storageUnits:i,onChangeUnit:p,convertBackToStorageUnit:m,enableCosmeticRounding:a,enableDisplayRounding:l})=>{const u=o?o.map(c=>({...c,cells:c.cells.map(r=>{if(r.type===K.AUTO_UNIT){const{unitKey:e}=r;return{value:n[e],type:K.SELECT,options:v.getUnitsForQuantity(e),native:!0,onChange:b=>p({unitKey:e,value:b.target.value})}}return r})})):[],d=t?t.map((c,r)=>({...c,cells:c.cells.map((e,b)=>{if("autoUnit"in e&&(e!=null&&e.autoUnit)&&(typeof(e==null?void 0:e.value)=="string"||typeof(e==null?void 0:e.value)=="number")){const{unitKey:g,value:U,formatDisplayValue:f}=e,T=l&&"roundDisplayValue"in e?e==null?void 0:e.roundDisplayValue:null,y=n[g],C=i[g],j=y!==C,A=j?v.convertAndGetValue(U,y,C):e.value,q=v.isScientificStringNum(U),N=a&&(j||!q)?v.roundToPrecision(A,14):A,k=f?f(N):N;return{...e,value:k,enableCosmeticRounding:a,enableDisplayRounding:l,roundDisplayValue:T,onChange:w=>{const{value:_}=w.target,S=i[g],V=n[g],O=V!==S?v.convertAndGetValue(_,S,V):_,z=m?S:V;if("onChange"in e){const{onChange:L}=e,M={...w,target:{...w.target,value:String(O),rowIndex:r,cellIndex:b,unit:z}};L(M)}}}}return e})})):[];return{convertedHeaders:u,convertedRows:d}},I=({table:o,unitConfig:t,convertBackToStorageUnit:n=!0,enableCosmeticRounding:i=!0,enableDisplayRounding:p=!0})=>{const{rows:m,headers:a,...l}=o,{storageUnits:u,preferredUnits:d}=ee(t),c=Y(d),[r,e]=h.useState(d),b=({unitKey:y,value:C})=>e({...r,[y]:C}),g=y=>ne({headers:a,rows:m,selectedUnits:y,storageUnits:u,onChangeUnit:b,convertBackToStorageUnit:n,enableCosmeticRounding:i,enableDisplayRounding:p}),U=g(r),[f,T]=h.useState(U);return h.useEffect(()=>{!X.isEqual(d,c)&&(e(d),T(g(d)))},[t]),h.useEffect(()=>{T(g(r))},[o,r]),s.jsx(Z,{table:{...l,headers:f.convertedHeaders,rows:f.convertedRows}})};try{I.displayName="UnitTable",I.__docgenInfo={description:"",displayName:"UnitTable",props:{table:{defaultValue:null,description:"",name:"table",required:!0,type:{name:"IUnitTable"}},unitConfig:{defaultValue:null,description:"",name:"unitConfig",required:!0,type:{name:"IUnitConfigItem[]"}},convertBackToStorageUnit:{defaultValue:{value:"true"},description:"",name:"convertBackToStorageUnit",required:!1,type:{name:"boolean"}},enableCosmeticRounding:{defaultValue:{value:"true"},description:"",name:"enableCosmeticRounding",required:!1,type:{name:"boolean"}},enableDisplayRounding:{defaultValue:{value:"true"},description:"",name:"enableDisplayRounding",required:!1,type:{name:"boolean"}},onListReorder:{defaultValue:null,description:"",name:"onListReorder",required:!1,type:{name:"((obj: { from: number; to: number; }) => void)"}}}}}catch{}const rn={title:"Basic/UnitTable",args:{}},te=!0,ae=!0,oe=!0,G="m",re=3,ie=(o,t)=>{const n=[t,t,t],i=[...Array(Number(o))].map((p,m)=>{const a=m,l=m+1.25,u=l-a;return[String(a),String(l),String(u)]});return[n].concat(i)},se=ie(re,G),le=({reduxTable:o,value:t,rowIndex:n,cellIndex:i})=>Q(o,p=>{p[n+1][i]=t}),x=()=>{const[o,t]=h.useState(G),[n,i]=h.useState(se),p=a=>{const{rowIndex:l,cellIndex:u,value:d,unit:c}=a.target,r=le({reduxTable:n,value:d,rowIndex:l,cellIndex:u});i(r)},m=n.reduce((a,l,u)=>(u===0?a.headers=[{cells:[{value:"From"},{value:"To"},{value:"Delta"}]},{cells:[{type:"AutoUnit",unitKey:"length"},{type:"AutoUnit",unitKey:"length"},{type:"AutoUnit",unitKey:"length"}]}]:a.rows=a.rows.concat({cells:l.map((d,c)=>{const r=u===1&&c===1;return{value:d,type:r?"Text":"NumberInput",unitKey:"length",onChange:p,roundDisplayValue:u===3&&c===2?f=>v.roundByMagnitude(f,2):null,formatDisplayValue:r?f=>`T* ${f}`:null,autoUnit:!0}})}),a),{headers:[],rows:[]});return s.jsxs(J,{columns:"1fr 1fr",gap:!0,children:[s.jsx(D,{heading:s.jsx(R,{children:"Global View Settings"}),children:s.jsx($,{label:"Active Unit Template",children:s.jsx(W,{options:v.getUnitsForQuantity("length"),value:{value:o},onChange:a=>t(a.target.value),width:"100px"})})}),s.jsx(D,{heading:s.jsx(R,{children:"UnitTable"}),children:s.jsx(I,{table:m,unitConfig:[{unitKey:"length",storageUnit:n[0][0],preferredUnit:o}],convertBackToStorageUnit:te,enableDisplayRounding:oe,enableCosmeticRounding:ae})}),s.jsx(D,{heading:s.jsx(R,{children:"Storage State (Redux)"}),children:s.jsx("pre",{children:s.jsx("code",{children:JSON.stringify(n,null,2)})})})]})};var E,H,F,P,B;x.parameters={...x.parameters,docs:{...(E=x.parameters)==null?void 0:E.docs,source:{originalSource:`() => {
2
+ const [preferredUnit, setPreferredUnit] = useState(initialUnit);
3
+ const [reduxTable, setReduxTable] = useState(initialTable);
4
+
5
+ /*********************************************************************************************************************
6
+ Cell onChange handler
7
+ *********************************************************************************************************************/
8
+ const onUpdateCell = (evt: IUnitTableOnChangeEvent) => {
9
+ const {
10
+ rowIndex,
11
+ cellIndex,
12
+ value,
13
+ unit
14
+ } = evt.target;
15
+ const nextTable = convertWholeTable ? convertStorageTable({
16
+ reduxTable,
17
+ value,
18
+ unit,
19
+ rowIndex,
20
+ cellIndex
21
+ }) : updateCell({
22
+ reduxTable,
23
+ value,
24
+ rowIndex,
25
+ cellIndex
26
+ });
27
+ setReduxTable(nextTable);
28
+ };
29
+
30
+ /*********************************************************************************************************************
31
+ Construct table view data (same as old Table component, with a new props)
32
+ *********************************************************************************************************************/
33
+ const tableViewData = reduxTable.reduce((acc, row, rowIndex) => {
34
+ if (rowIndex === 0) {
35
+ acc.headers = [{
36
+ cells: [{
37
+ value: 'From'
38
+ }, {
39
+ value: 'To'
40
+ }, {
41
+ value: 'Delta'
42
+ }]
43
+ }, {
44
+ cells: [{
45
+ type: 'AutoUnit',
46
+ unitKey: 'length'
47
+ }, {
48
+ type: 'AutoUnit',
49
+ unitKey: 'length'
50
+ }, {
51
+ type: 'AutoUnit',
52
+ unitKey: 'length'
53
+ }]
54
+ }];
55
+ } else {
56
+ acc.rows = acc.rows.concat({
57
+ cells: row.map((cell, cellIndex) => {
58
+ const specialCell = rowIndex === 1 && cellIndex === 1;
59
+ const type = specialCell ? 'Text' : 'NumberInput';
60
+ const formatDisplayValue = specialCell ? (value: number | string) => \`T* \${value}\` : null;
61
+ const customDisplayRounding = rowIndex === 3 && cellIndex === 2 ? (value: TStringNumberNull) => roundByMagnitude(value, 2) : null;
62
+ const value = cell;
63
+ return {
64
+ value,
65
+ type,
66
+ unitKey: 'length',
67
+ onChange: onUpdateCell,
68
+ roundDisplayValue: customDisplayRounding,
69
+ // optionally customize the display rounding of specific columns/cells
70
+ formatDisplayValue,
71
+ // optionally extend/customize the display formatting of specific columns/cells
72
+ autoUnit: true
73
+ };
74
+ })
75
+ });
76
+ }
77
+ return acc;
78
+ }, {
79
+ headers: ([] as any[]),
80
+ rows: ([] as IUnitTableRow[])
81
+ });
82
+ return <Grid columns="1fr 1fr" gap>
83
+ <Card heading={<Heading>Global View Settings</Heading>}>
84
+ <Field label="Active Unit Template">
85
+ <Select options={getUnitsForQuantity('length')} value={{
86
+ value: preferredUnit
87
+ }} onChange={evt => setPreferredUnit(evt.target.value)} width="100px" />
88
+ </Field>
89
+ </Card>
90
+ <Card heading={<Heading>UnitTable</Heading>}>
91
+ <UnitTable table={tableViewData}
92
+ //New props:
93
+ unitConfig={[{
94
+ unitKey: 'length',
95
+ storageUnit: reduxTable[0][0],
96
+ preferredUnit
97
+ }]}
98
+ //Most tables should just use the default values here (true):
99
+ convertBackToStorageUnit={convertBackToStorageUnit} enableDisplayRounding={enableDisplayRounding} enableCosmeticRounding={enableCosmeticRounding} />
100
+ </Card>
101
+ <Card heading={<Heading>Storage State (Redux)</Heading>}>
102
+ <pre>
103
+ <code>{JSON.stringify(reduxTable, null, 2)}</code>
104
+ </pre>
105
+ </Card>
106
+ </Grid>;
107
+ }`,...(F=(H=x.parameters)==null?void 0:H.docs)==null?void 0:F.source},description:{story:"Story",...(B=(P=x.parameters)==null?void 0:P.docs)==null?void 0:B.description}}};const sn=["UnitTablePrototype"];export{x as UnitTablePrototype,sn as __namedExportsOrder,rn as default};
@@ -359,7 +359,7 @@
359
359
  }
360
360
  </script>
361
361
 
362
- <script type="module" crossorigin src="./assets/iframe-Z5bUT4O1.js"></script>
362
+ <script type="module" crossorigin src="./assets/iframe-uQDN-5FH.js"></script>
363
363
  </head>
364
364
 
365
365
  <body>