@oliasoft-open-source/react-ui-library 4.1.2 → 4.1.4
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.
- package/dist/404.html +1 -1
- package/dist/assets/{index-8ad0a531.css → index-4e076e2d.css} +61 -54
- package/dist/assets/{index-c1fad522.js → index-b17ea451.js} +37 -34
- package/dist/index.d.ts +4 -2
- package/dist/index.html +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/storybook/assets/{Color-6VNJS4EI-fcadb840.js → Color-6VNJS4EI-d27e5bb5.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-NNNQARDV-2533de58.js → DocsRenderer-NNNQARDV-6a6b4a3d.js} +1 -1
- package/dist/storybook/assets/{WithTooltip-4HIR6TLV-f11e9381.js → WithTooltip-4HIR6TLV-ee9133da.js} +1 -1
- package/dist/storybook/assets/{afe.stories-81d98513.js → afe.stories-86276073.js} +1 -1
- package/dist/storybook/assets/{blowout.stories-2af165bb.js → blowout.stories-0584fa9e.js} +1 -1
- package/dist/storybook/assets/{buttons-and-links-1c8ae7a6.js → buttons-and-links-7ae5425e.js} +1 -1
- package/dist/storybook/assets/{casing-loads.stories-28b26c48.js → casing-loads.stories-e5e1eaa9.js} +1 -1
- package/dist/storybook/assets/{chunk-HLWAVYOI-9bc2e116.js → chunk-HLWAVYOI-2bef6b9b.js} +1 -1
- package/dist/storybook/assets/{color-4443720e.js → color-13e423e2.js} +1 -1
- package/dist/storybook/assets/{drawer-3f83a4d2.js → drawer-7f450988.js} +2 -2
- package/dist/storybook/assets/drawer-e350211a.css +1 -0
- package/dist/storybook/assets/{drawer.stories-89a4e1bb.js → drawer.stories-2512fef1.js} +1 -1
- package/dist/storybook/assets/{file-input.stories-0e546123.js → file-input.stories-b496f4ea.js} +1 -1
- package/dist/storybook/assets/{form.stories-c02bea64.js → form.stories-431b9233.js} +1 -1
- package/dist/storybook/assets/{formation.stories-425327da.js → formation.stories-262bd728.js} +1 -1
- package/dist/storybook/assets/{formatter-SWP5E3XI-47836cd9.js → formatter-SWP5E3XI-5228d2cc.js} +1 -1
- package/dist/storybook/assets/iframe-a2fe9ab2.js +1 -0
- package/dist/storybook/assets/{index-5b92cd01.js → index-8cfd8772.js} +4 -4
- package/dist/storybook/assets/{input-validation-3a6661e4.js → input-validation-ded4be10.js} +1 -1
- package/dist/storybook/assets/{inputs-10a539e4.js → inputs-7cd3baeb.js} +1 -1
- package/dist/storybook/assets/{layout-forms-659a3050.js → layout-forms-23e415b3.js} +1 -1
- package/dist/storybook/assets/{layout-general-47c0a175.js → layout-general-10455156.js} +1 -1
- package/dist/storybook/assets/{padding-and-spacing-7aa7701c.js → padding-and-spacing-622b1fd7.js} +1 -1
- package/dist/storybook/assets/{page.stories-f1dbfb8f.js → page.stories-87c7b257.js} +1 -1
- package/dist/storybook/assets/preview-327d400b.js +1 -0
- package/dist/storybook/assets/{preview-c8f75f89.js → preview-d06c675f.js} +1 -1
- package/dist/storybook/assets/{reservoirs.stories-947b8763.js → reservoirs.stories-457be056.js} +1 -1
- package/dist/storybook/assets/{side-bar-3f68848d.js → side-bar-f26ab0ce.js} +1 -1
- package/dist/storybook/assets/{side-bar.stories-e9280e56.js → side-bar.stories-d5504e52.js} +1 -1
- package/dist/storybook/assets/{site.stories-e9c1c143.js → site.stories-46091c50.js} +1 -1
- package/dist/storybook/assets/{syntaxhighlighter-NMPM6SWI-87964e94.js → syntaxhighlighter-NMPM6SWI-f9c29eb0.js} +1 -1
- package/dist/storybook/assets/{table.stories-bc0b72fb.js → table.stories-4b91e144.js} +63 -16
- package/dist/storybook/assets/{textarea-54dd1c9a.js → textarea-eef180d9.js} +1 -1
- package/dist/storybook/assets/{textarea.stories-4b85aa60.js → textarea.stories-4182caf6.js} +1 -1
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/index.json +1 -1
- package/dist/storybook/project.json +1 -1
- package/dist/storybook/stories.json +1 -1
- package/package.json +1 -1
- package/dist/storybook/assets/drawer-21c7feed.css +0 -1
- package/dist/storybook/assets/iframe-39743b5e.js +0 -1
- package/dist/storybook/assets/preview-56b87e3d.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-f961835c.js";import{r as x}from"./index-f80c8c95.js";import{I as j}from"./common-types-2c81813f.js";import{T as g}from"./top-bar-a84b9365.js";import{S as w}from"./side-bar-
|
|
1
|
+
import{j as e}from"./jsx-runtime-f961835c.js";import{r as x}from"./index-f80c8c95.js";import{I as j}from"./common-types-2c81813f.js";import{T as g}from"./top-bar-a84b9365.js";import{S as w}from"./side-bar-f26ab0ce.js";import{H as t}from"./heading-d29eb744.js";import{B as L}from"./button-74c97e4a.js";import{D as v}from"./drawer-7f450988.js";import{L as d}from"./list-0dc3df85.js";import{F as l}from"./field-a094cd72.js";import{I as a}from"./input-d68625a5.js";import{C as m}from"./check-box-e21258d5.js";import{P as f}from"./page-6d07f774.js";import{R as o,C as i}from"./row-2299f0e7.js";import{A as u}from"./accordion-168fa7c5.js";import{S as s}from"./spacer-54db0620.js";import{T as F}from"./tabs-cdfc5225.js";import"./index-a80ed1cf.js";import"./icon-e9cbb4d7.js";import"./inheritsLoose-d4851ab8.js";import"./tslib.es6-dfef685f.js";import"./index-c89a1915.js";import"./disabled-context-d654f6ff.js";import"./actions-2d4e1c8e.js";import"./lodash-75c70a11.js";import"./tooltip-23e84186.js";import"./index-3d476d02.js";import"./types-cc224262.js";import"./types-332ceaf3.js";import"./badge-20e7ee0b.js";import"./index-c7f280f6.js";import"./help-icon-d4189b1b.js";import"./spinner-a81ebe38.js";import"./index.es-85cc7dfc.js";import"./redux-10ee6be7.js";import"./objectSpread2-fdee9b6d.js";import"./memoize-one.esm-52518564.js";import"./card-3847c251.js";import"./list-heading-88cc8a9b.js";import"./loader-87ec8334.js";import"./label-13d490a3.js";import"./styled-components.browser.esm-416d73e5.js";import"./select.input-88b6ebab.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"}),be={title:"Layout/Layout Examples",parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}}},n=()=>{const[r,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(o,{spacing:0,flex:!0,children:[e.jsxs(v,{button:e.jsx(L,{onClick:()=>b(!r),round:!0,icon:j.CHEVRON_LEFT}),open:r,width:300,closedWidth:"var(--size-sidebar)",children:[e.jsx(d,{drawer:!0,narrow:!r,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:!r,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:!r,list:{name:"Targets",items:[{id:1,name:"Lorem",label:{value:1,color:"#9b6977"}}]}})]}),e.jsxs(i,{borderLeft:!0,flexbox:!0,children:[e.jsx(s,{}),e.jsx(F,{padding:!0,margin:!1,options:C}),e.jsxs(o,{spacing:0,flex:!0,children:[e.jsxs(i,{scroll:!0,padding:!0,width:550,children:[e.jsx(t,{top:!0,children:"Site name here"}),e.jsx(l,{label:"Name",children:e.jsx(a,{value:"Site name here",width:"200px"})}),e.jsxs(u,{heading:e.jsx(t,{children:"Coordinate Reference System"}),managed:!0,children:[e.jsx(l,{label:"Label",labelLeft:!0,labelWidth:"50px",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{label:"Label",labelLeft:!0,labelWidth:"50px",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{label:"Label",labelLeft:!0,labelWidth:"50px",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{children:e.jsx(m,{label:"Dolor"})})]}),e.jsx(s,{}),e.jsx(t,{marginBottom:"var(--padding)",children:"Location"}),e.jsxs(o,{children:[e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})}),e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})}),e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})}),e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})})]}),e.jsx(s,{}),e.jsx(t,{marginBottom:"var(--padding)",children:"Model"}),e.jsxs(o,{children:[e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})}),e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})})]}),e.jsxs(u,{heading:e.jsx(t,{children:"Settings"}),managed:!0,children:[e.jsx(l,{children:e.jsx(m,{label:"Dolor"})}),e.jsxs(o,{children:[e.jsxs(i,{children:[e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})]}),e.jsxs(i,{children:[e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})]})]})]})]}),e.jsx(i,{children:e.jsx(S,{})})]})]})]})})]})};var p,c,h;n.parameters={...n.parameters,docs:{...(p=n.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 c,c as l,s as n}from"./index-
|
|
1
|
+
import{S as c,c as l,s as n}from"./index-8cfd8772.js";import"./iframe-a2fe9ab2.js";import"../sb-preview/runtime.js";import"./index-f80c8c95.js";import"./index-3d476d02.js";import"./inheritsLoose-d4851ab8.js";import"./assertThisInitialized-081f9914.js";import"./index-cf68f115.js";export{c as SyntaxHighlighter,l as createCopyToClipboardFunction,n as default};
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import{j as
|
|
1
|
+
import{j as a}from"./jsx-runtime-f961835c.js";import{r as P}from"./index-f80c8c95.js";import{f as $}from"./immer.esm-5c06d4d0.js";import{l as se}from"./lodash-75c70a11.js";import{G as en}from"./grid-3b729f81.js";import{T as K}from"./text-ad1f5f1d.js";import{T as j}from"./table-833837a1.js";import{C as nn}from"./card-3847c251.js";import{I as te}from"./input-d68625a5.js";import{F as ae}from"./field-a094cd72.js";import{H as tn}from"./heading-d29eb744.js";import{t as ee,a as an,b as rn,c as sn,d as on,e as ln,f as cn,g as dn}from"./table.stories-data-aefdf55f.js";import"./styled-components.browser.esm-416d73e5.js";import"./tslib.es6-dfef685f.js";import"./index-a80ed1cf.js";import"./index.es-85cc7dfc.js";import"./inheritsLoose-d4851ab8.js";import"./redux-10ee6be7.js";import"./objectSpread2-fdee9b6d.js";import"./index-3d476d02.js";import"./memoize-one.esm-52518564.js";import"./icon-e9cbb4d7.js";import"./index-c89a1915.js";import"./disabled-context-d654f6ff.js";import"./actions-2d4e1c8e.js";import"./common-types-2c81813f.js";import"./button-74c97e4a.js";import"./spinner-a81ebe38.js";import"./tooltip-23e84186.js";import"./types-cc224262.js";import"./types-332ceaf3.js";import"./badge-20e7ee0b.js";import"./pagination-e5a7b6d5.js";import"./select-62aa86c5.js";import"./assertThisInitialized-081f9914.js";import"./select.input-88b6ebab.js";import"./input-group-20c3add3.js";import"./input-group-addon-f8f6683a.js";import"./number-input-42f50494.js";import"./index-54f0d271.js";import"./check-box-e21258d5.js";import"./help-icon-d4189b1b.js";import"./slider-160e2152.js";import"./index-c7f280f6.js";import"./popover-06e375a5.js";import"./label-13d490a3.js";import"./flex-47732c42.js";const rt={title:"Basic/Table",component:j,args:{table:{...ee}}},I=m=>a.jsx(j,{...m}),B=I.bind({}),_=I.bind({});_.args={table:{...ee,fixedWidth:"400px"}};const N=I.bind({});N.args={table:{...ee,fixedWidth:"auto"}};const W=I.bind({});W.args={table:an};W.parameters={docs:{description:{story:"Use sparingly when certain columns cannot be below a certain width. Unless the Table is auto width, set one column to `auto` to use remaining space."}}};const M=I.bind({});M.args={table:rn};const O=I.bind({});O.args={table:sn};O.parameters={docs:{description:{story:"This is only required when you need to override `columnAlignment` in header cells (i.e. they have different alignment)"}}};const L=I.bind({});L.args={table:on};const U=I.bind({});U.args={table:ln};U.decorators=[m=>a.jsx("div",{style:{position:"absolute",inset:0,padding:"var(--padding)"},children:a.jsx(m,{})})];const E=I.bind({});E.args={table:cn};E.parameters={docs:{description:{story:"If a `maxHeight` is set, the table should only fill that height if it needs to."}}};const Q=I.bind({});Q.args={table:dn};const q=()=>a.jsx(nn,{heading:a.jsx(tn,{children:"Card heading"}),padding:!1,children:a.jsx(j,{table:{...ee,bordered:!1}})});q.parameters={docs:{source:{type:"dynamic"}}};const z=()=>{const m=["Section","Width","Height"];let u=["","m","m"],r=[...Array(175).keys()].map((s,n)=>[n,n*2,n*2]);const A=(s,n,i)=>s==="m"&&n==="ft"?i*3.28084:s==="ft"&&n==="m"?i/3.28084:i,l=(s,n,i,p)=>{r[n][i]=s.target.value,p()},C=s=>{r=r.concat([["","",""]]),s()},k=(s,n)=>{r=r.filter((i,p)=>p!==s),n()},d=(s,n,i)=>{const p=u[n],y=s.target.value;u=u.map((R,w)=>w===n?y:R),r=r.map(R=>R.map((w,b)=>b===n?A(p,y,w):w)),i()},g=()=>{const s=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[n,i]=P.useState(10),[p,y]=P.useState(1),[R,w]=P.useState(!1),b=()=>{w(!R)},F=()=>{const e=Math.ceil(r.length/n);y(e)},T=(p-1)*n,t=n===0?r.length-1:T+n,c={headers:[{cells:m.map(e=>({value:e})),actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{C(b),F()}}]},{cells:[{},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:u[1],type:"Select",native:!0,onChange:e=>d(e,1,b)},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:u[2],type:"Select",native:!0,onChange:e=>d(e,2,b)}]}],rows:r.slice(T,t).map((e,o)=>{const S=T+o;return{cells:[...Array(3).keys()].map((f,v)=>({value:e[v],type:"Input",onChange:x=>l(x,S,v,b)})),actions:[{label:"Delete",icon:"minus",onClick:()=>k(S,b)}]}}),footer:{pagination:{rowCount:r.length,selectedPage:p,rowsPerPage:{onChange:e=>{const{value:o}=e.target;i(Number(o))},options:s,value:n},onSelectPage:e=>y(e),small:!0}}};return a.jsx(j,{table:c})};return a.jsx(g,{})},J=()=>{const m=["Section","Width","Height"];let u=[...Array(175).keys()].map((A,l)=>({Section:l,Width:l*2,Height:l*2}));const r=()=>{const A=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[l,C]=P.useState(10),[k,d]=P.useState(1),[g,s]=P.useState({}),[n,i]=P.useState({});P.useEffect(()=>{d(1)},[g,n]);const p=(k-1)*l,y=l===0?u.length-1:p+l,R=(e,o,S)=>e.filter(f=>Object.keys(o).every(v=>o[v]===""?!0:f[v].toString().includes(o[v]))).sort((f,v)=>Object.entries(S).map(([x,V])=>{switch(V){case"up":return f[x]-v[x];case"down":return v[x]-f[x];default:return 0}}).reduce((x,V)=>x||V,0)),w=(e,o,S,f,v)=>{const x=e.map(h=>{const D=Object.keys(f).includes(h)?f[h]:"",H=`${h[0].toUpperCase()}${h.slice(1)}`;return{key:h,value:H,hasSort:!0,sort:D,onSort:()=>{const G=D===""?"up":D==="up"?"down":"";v({...f,[h]:G})}}}),V=e.map(h=>{const D=Object.keys(o).includes(h)?o[h]:"";return{key:h,value:D,type:"Input",placeholder:"Filter",onChange:H=>S({...o,[h]:H.target.value})}});return{dataSortCells:x,dataFilterCells:V}},{dataSortCells:b,dataFilterCells:F}=w(m,g,s,n,i),T=R(u,g,n),t=[...T.slice(p,y).map(e=>({cells:Object.entries(e).map(([S,f])=>({key:S,value:f,type:"Input",disabled:!0}))}))],c={headers:[{cells:b},{cells:F}],rows:t,footer:{pagination:{rowCount:T.length,selectedPage:k,rowsPerPage:{onChange:e=>{const{value:o}=e.target;C(Number(o))},options:A,value:l},onSelectPage:e=>d(e),small:!0}}};return a.jsx(j,{table:c})};return a.jsx(r,{})},X=()=>{const m={tea:3.6,coffee:3.2,orange:4.1},u=[{label:"Tea",value:"tea"},{label:"Coffee",value:"coffee"},{label:"Orange juice",value:"orange"}],r={cells:[{type:"Select",options:u,value:{value:"tea"}},{type:"Input"},{type:"Static"}]},A=[...Array(15).keys()].map((t,c)=>({cells:[{type:"Select",options:u,value:{value:"tea"}},{type:"Input",value:c+1},{type:"Static"}]})),[l,C]=P.useState(A),k=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[d,g]=P.useState(10),[s,n]=P.useState(1),i=(s-1)*d,p=d===0?l.length-1:i+d,y=({newRow:t}={})=>{const c=$(l,e=>{e.push(t??r)});C(c)},R=({rowIndex:t})=>{const c=$(l,e=>{delete e[t]}).filter(e=>e);C(c)},w=({rowIndex:t,value:c})=>{const e=$(l,o=>{o[t].cells[0].value.value=c});C(e)},b=({rowIndex:t,value:c})=>{const e=$(l,o=>{o[t].cells[1].value=c});C(e)},F=({value:t})=>{const c=Number(t);return!se.isNaN(c)&&se.isInteger(c)&&c>0},T=l.slice(i,p).map((t,c)=>{const e=i+c;return l.length-1,{...t,cells:t==null?void 0:t.cells.map((o,S)=>{var h,D,H,G,re;const f=(H=(D=(h=t==null?void 0:t.cells)==null?void 0:h[0])==null?void 0:D.value)==null?void 0:H.value,v=Number((re=(G=t==null?void 0:t.cells)==null?void 0:G[1])==null?void 0:re.value),x=m==null?void 0:m[f],V=x&&F({value:v})?(x*v).toFixed(2):null;if(S===0)return{...o,onChange:ne=>w({rowIndex:e,value:ne.target.value})};if(S===1)return{...o,onChange:ne=>b({rowIndex:e,value:ne.target.value}),error:F({value:o.value})?null:"Must be valid whole number"};if(S===2)return{...o,value:V}}),actions:[{label:"Delete",icon:"minus",onClick:()=>R({rowIndex:e})}]}});return a.jsx(j,{table:{defaultEmptyRow:r,onAddRow:y,columnAlignment:["left","right","right"],headers:[{cells:[{value:"Drink"},{value:"Quantity"},{value:"Total Price (£)"}],actions:[{primary:!0,icon:"plus",label:"Add",onClick:()=>y()}]}],rows:T,footer:{pagination:{rowCount:l.length,selectedPage:s,rowsPerPage:{onChange:t=>{const{value:c}=t.target;g(Number(c))},options:k,value:d},onSelectPage:t=>n(t),small:!0}}}})},Y=()=>{const m=["Section","Width","Height"];let u=Array.from(Array(10),(d,g)=>[g,g*2,g*2]);const[r,A]=P.useState({pastedValues:"",rowIndex:0,cellIndex:0}),l=(d,g,s,n)=>{u[g][s]=Number(d.target.value),n()},C=(d,g,s,n)=>{var p;let i=((p=d==null?void 0:d.clipboardData)==null?void 0:p.getData("text"))??"";return A({rowIndex:g,cellIndex:s,pastedValues:i}),n(),{pastedData:r}},k=()=>{const[d,g]=P.useState(!1),s=()=>{g(!d)},n={headers:[{cells:m.map(i=>({value:i}))}],rows:u.map((i,p)=>{const y=p;return{cells:[...Array(3).keys()].map((R,w)=>({value:i[w],type:"Input",onChange:b=>l(b,y,w,s),onPaste:b=>C(b,y,w,s)}))}})};return a.jsxs(a.Fragment,{children:[a.jsx(j,{table:n}),a.jsx(ae,{label:"Pasted Data",children:a.jsx(te,{value:r.pastedValues})}),a.jsx(ae,{label:"At Row",children:a.jsx(te,{value:r.rowIndex})}),a.jsx(ae,{label:"At Cell Index",children:a.jsx(te,{value:r.cellIndex})})]})};return a.jsx(k,{})},Z=()=>{const m={fixedWidth:"auto",name:"Table title",actions:[{icon:"download",tooltip:"Download"}],columnAlignment:[...Array(10)].map((u,r)=>"right"),headers:[{cells:[...Array(10)].map((u,r)=>({value:"Heading"}))},{cells:[...Array(10)].map((u,r)=>({options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],type:"Select",searchable:!1,value:{label:"m",value:"m"},autoLayerWidth:!0}))}],rows:[...Array(10)].map((u,r)=>({cells:[...Array(10)].map((A,l)=>({value:123.45})),actions:[{icon:"help",tooltip:a.jsxs(en,{children:[a.jsx(K,{bold:!0,children:"Title goes here lorem ipsum"}),a.jsx(K,{children:"Label: 123.45m"}),a.jsx(K,{children:"Another label: 123.45m"}),a.jsx(K,{children:"Label: 123.45m"})]})}]}))};return a.jsx(j,{table:m})};var oe,le,ie;B.parameters={...B.parameters,docs:{...(oe=B.parameters)==null?void 0:oe.docs,source:{originalSource:`args => {
|
|
2
2
|
return <Table
|
|
3
3
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
4
4
|
{...args} />;
|
|
5
|
-
}`,...(
|
|
5
|
+
}`,...(ie=(le=B.parameters)==null?void 0:le.docs)==null?void 0:ie.source}}};var ce,de,ue;_.parameters={..._.parameters,docs:{...(ce=_.parameters)==null?void 0:ce.docs,source:{originalSource:`args => {
|
|
6
6
|
return <Table
|
|
7
7
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
8
8
|
{...args} />;
|
|
9
|
-
}`,...(
|
|
9
|
+
}`,...(ue=(de=_.parameters)==null?void 0:de.docs)==null?void 0:ue.source}}};var pe,ge,me;N.parameters={...N.parameters,docs:{...(pe=N.parameters)==null?void 0:pe.docs,source:{originalSource:`args => {
|
|
10
10
|
return <Table
|
|
11
11
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
12
12
|
{...args} />;
|
|
13
|
-
}`,...(
|
|
13
|
+
}`,...(me=(ge=N.parameters)==null?void 0:ge.docs)==null?void 0:me.source}}};var be,we,ve;W.parameters={...W.parameters,docs:{...(be=W.parameters)==null?void 0:be.docs,source:{originalSource:`args => {
|
|
14
14
|
return <Table
|
|
15
15
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
16
16
|
{...args} />;
|
|
17
|
-
}`,...(
|
|
17
|
+
}`,...(ve=(we=W.parameters)==null?void 0:we.docs)==null?void 0:ve.source}}};var he,ye,fe;M.parameters={...M.parameters,docs:{...(he=M.parameters)==null?void 0:he.docs,source:{originalSource:`args => {
|
|
18
18
|
return <Table
|
|
19
19
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
20
20
|
{...args} />;
|
|
21
|
-
}`,...(
|
|
21
|
+
}`,...(fe=(ye=M.parameters)==null?void 0:ye.docs)==null?void 0:fe.source}}};var xe,Pe,Se;O.parameters={...O.parameters,docs:{...(xe=O.parameters)==null?void 0:xe.docs,source:{originalSource:`args => {
|
|
22
22
|
return <Table
|
|
23
23
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
24
24
|
{...args} />;
|
|
25
|
-
}`,...(
|
|
25
|
+
}`,...(Se=(Pe=O.parameters)==null?void 0:Pe.docs)==null?void 0:Se.source}}};var Ce,Re,Ie;L.parameters={...L.parameters,docs:{...(Ce=L.parameters)==null?void 0:Ce.docs,source:{originalSource:`args => {
|
|
26
26
|
return <Table
|
|
27
27
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
28
28
|
{...args} />;
|
|
29
|
-
}`,...(
|
|
29
|
+
}`,...(Ie=(Re=L.parameters)==null?void 0:Re.docs)==null?void 0:Ie.source}}};var Ae,ke,Te;U.parameters={...U.parameters,docs:{...(Ae=U.parameters)==null?void 0:Ae.docs,source:{originalSource:`args => {
|
|
30
30
|
return <Table
|
|
31
31
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
32
32
|
{...args} />;
|
|
33
|
-
}`,...(
|
|
33
|
+
}`,...(Te=(ke=U.parameters)==null?void 0:ke.docs)==null?void 0:Te.source}}};var De,je,Ve;E.parameters={...E.parameters,docs:{...(De=E.parameters)==null?void 0:De.docs,source:{originalSource:`args => {
|
|
34
34
|
return <Table
|
|
35
35
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
36
36
|
{...args} />;
|
|
37
|
-
}`,...(Ve=(
|
|
37
|
+
}`,...(Ve=(je=E.parameters)==null?void 0:je.docs)==null?void 0:Ve.source}}};var Fe,He,We;Q.parameters={...Q.parameters,docs:{...(Fe=Q.parameters)==null?void 0:Fe.docs,source:{originalSource:`args => {
|
|
38
38
|
return <Table
|
|
39
39
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
40
40
|
{...args} />;
|
|
41
|
-
}`,...(
|
|
41
|
+
}`,...(We=(He=Q.parameters)==null?void 0:He.docs)==null?void 0:We.source}}};var Oe,Ue,Ee;q.parameters={...q.parameters,docs:{...(Oe=q.parameters)==null?void 0:Oe.docs,source:{originalSource:`() => <Card heading={<Heading>Card heading</Heading>} padding={false}>
|
|
42
42
|
<Table table={({
|
|
43
43
|
...storyData.table,
|
|
44
44
|
bordered: false
|
|
45
45
|
} as any)} />
|
|
46
|
-
</Card>`,...(
|
|
46
|
+
</Card>`,...(Ee=(Ue=q.parameters)==null?void 0:Ue.docs)==null?void 0:Ee.source}}};var _e,Ne,Me;z.parameters={...z.parameters,docs:{...(_e=z.parameters)==null?void 0:_e.docs,source:{originalSource:`() => {
|
|
47
47
|
/*
|
|
48
48
|
Mock table data store (real apps should use Redux or similar)
|
|
49
49
|
*/
|
|
@@ -185,7 +185,7 @@ import{j as c}from"./jsx-runtime-f961835c.js";import{r as S}from"./index-f80c8c9
|
|
|
185
185
|
return <Table table={(table as any)} />;
|
|
186
186
|
};
|
|
187
187
|
return <ManagedTable />;
|
|
188
|
-
}`,...(
|
|
188
|
+
}`,...(Me=(Ne=z.parameters)==null?void 0:Ne.docs)==null?void 0:Me.source}}};var Le,Qe,qe;J.parameters={...J.parameters,docs:{...(Le=J.parameters)==null?void 0:Le.docs,source:{originalSource:`() => {
|
|
189
189
|
/*
|
|
190
190
|
Mock table data store (real apps should use Redux or similar)
|
|
191
191
|
*/
|
|
@@ -318,7 +318,7 @@ import{j as c}from"./jsx-runtime-f961835c.js";import{r as S}from"./index-f80c8c9
|
|
|
318
318
|
return <Table table={(table as any)} />;
|
|
319
319
|
};
|
|
320
320
|
return <TableWithSortAndFilter />;
|
|
321
|
-
}`,...(
|
|
321
|
+
}`,...(qe=(Qe=J.parameters)==null?void 0:Qe.docs)==null?void 0:qe.source}}};var Ge,$e,Ke;X.parameters={...X.parameters,docs:{...(Ge=X.parameters)==null?void 0:Ge.docs,source:{originalSource:`() => {
|
|
322
322
|
const prices = {
|
|
323
323
|
tea: 3.6,
|
|
324
324
|
coffee: 3.2,
|
|
@@ -506,7 +506,7 @@ import{j as c}from"./jsx-runtime-f961835c.js";import{r as S}from"./index-f80c8c9
|
|
|
506
506
|
}
|
|
507
507
|
}
|
|
508
508
|
} as any)} />;
|
|
509
|
-
}`,...($e=
|
|
509
|
+
}`,...(Ke=($e=X.parameters)==null?void 0:$e.docs)==null?void 0:Ke.source}}};var Be,ze,Je;Y.parameters={...Y.parameters,docs:{...(Be=Y.parameters)==null?void 0:Be.docs,source:{originalSource:`() => {
|
|
510
510
|
const headings = ['Section', 'Width', 'Height'];
|
|
511
511
|
let data = Array.from(Array(10), (_, i) => [i, i * 2, i * 2]);
|
|
512
512
|
const [pastedData, setpastedData] = useState<PastedData>({
|
|
@@ -578,4 +578,51 @@ import{j as c}from"./jsx-runtime-f961835c.js";import{r as S}from"./index-f80c8c9
|
|
|
578
578
|
</>;
|
|
579
579
|
};
|
|
580
580
|
return <CallbackCellTable />;
|
|
581
|
-
}`,...(
|
|
581
|
+
}`,...(Je=(ze=Y.parameters)==null?void 0:ze.docs)==null?void 0:Je.source}}};var Xe,Ye,Ze;Z.parameters={...Z.parameters,docs:{...(Xe=Z.parameters)==null?void 0:Xe.docs,source:{originalSource:`() => {
|
|
582
|
+
const table = {
|
|
583
|
+
fixedWidth: 'auto',
|
|
584
|
+
name: 'Table title',
|
|
585
|
+
actions: [{
|
|
586
|
+
icon: 'download',
|
|
587
|
+
tooltip: 'Download'
|
|
588
|
+
}],
|
|
589
|
+
columnAlignment: [...Array(10)].map((_, i) => 'right'),
|
|
590
|
+
headers: [{
|
|
591
|
+
cells: [...Array(10)].map((_, i) => ({
|
|
592
|
+
value: 'Heading'
|
|
593
|
+
}))
|
|
594
|
+
}, {
|
|
595
|
+
cells: [...Array(10)].map((_, i) => ({
|
|
596
|
+
options: [{
|
|
597
|
+
label: 'm',
|
|
598
|
+
value: 'm'
|
|
599
|
+
}, {
|
|
600
|
+
label: 'ft',
|
|
601
|
+
value: 'ft'
|
|
602
|
+
}],
|
|
603
|
+
type: 'Select',
|
|
604
|
+
searchable: false,
|
|
605
|
+
value: {
|
|
606
|
+
label: 'm',
|
|
607
|
+
value: 'm'
|
|
608
|
+
},
|
|
609
|
+
autoLayerWidth: true
|
|
610
|
+
}))
|
|
611
|
+
}],
|
|
612
|
+
rows: [...Array(10)].map((_, i) => ({
|
|
613
|
+
cells: [...Array(10)].map((_, i) => ({
|
|
614
|
+
value: 123.45
|
|
615
|
+
})),
|
|
616
|
+
actions: [{
|
|
617
|
+
icon: 'help',
|
|
618
|
+
tooltip: <Grid>
|
|
619
|
+
<Text bold>Title goes here lorem ipsum</Text>
|
|
620
|
+
<Text>Label: 123.45m</Text>
|
|
621
|
+
<Text>Another label: 123.45m</Text>
|
|
622
|
+
<Text>Label: 123.45m</Text>
|
|
623
|
+
</Grid>
|
|
624
|
+
}]
|
|
625
|
+
}))
|
|
626
|
+
};
|
|
627
|
+
return <Table table={table} />;
|
|
628
|
+
}`,...(Ze=(Ye=Z.parameters)==null?void 0:Ye.docs)==null?void 0:Ze.source}}};const st=["Default","FixedWidth","AutoWidth","ColumnWidths","ColumnAlignment","ColumnHeaderAlignment","InfiniteScrollFixedHeight","InfiniteScrollFullHeight","InfiniteScrollShort","InfiniteScrollWithDragAndDrop","InCard","Managed","ManagedWithFilterAndSort","AutoAddNewRow","OnPasteCallback","ExampleTableWithInfoTooltips"];export{X as AutoAddNewRow,N as AutoWidth,M as ColumnAlignment,O as ColumnHeaderAlignment,W as ColumnWidths,B as Default,Z as ExampleTableWithInfoTooltips,_ as FixedWidth,q as InCard,L as InfiniteScrollFixedHeight,U as InfiniteScrollFullHeight,E as InfiniteScrollShort,Q as InfiniteScrollWithDragAndDrop,z as Managed,J as ManagedWithFilterAndSort,Y as OnPasteCallback,st as __namedExportsOrder,rt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as o}from"./jsx-runtime-f961835c.js";import{r as V}from"./index-f80c8c95.js";import{c as h}from"./index-a80ed1cf.js";import{i as l}from"./types-332ceaf3.js";import{D as z}from"./disabled-context-d654f6ff.js";import{T as k}from"./tooltip-23e84186.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:'"none"'},{value:'"inherit"'},{value:'"inline"'},{value:'"initial"'},{value:'"-moz-initial"'},{value:'"revert"'},{value:'"revert-layer"'},{value:'"unset"'},{value:'"
|
|
1
|
+
import{j as o}from"./jsx-runtime-f961835c.js";import{r as V}from"./index-f80c8c95.js";import{c as h}from"./index-a80ed1cf.js";import{i as l}from"./types-332ceaf3.js";import{D as z}from"./disabled-context-d654f6ff.js";import{T as k}from"./tooltip-23e84186.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:'"none"'},{value:'"inherit"'},{value:'"inline"'},{value:'"initial"'},{value:'"-moz-initial"'},{value:'"revert"'},{value:'"revert-layer"'},{value:'"unset"'},{value:'"block"'},{value:'"both"'},{value:'"horizontal"'},{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-f961835c.js";import{T as s}from"./textarea-
|
|
1
|
+
import{j as u}from"./jsx-runtime-f961835c.js";import{T as s}from"./textarea-eef180d9.js";import"./index-f80c8c95.js";import"./index-a80ed1cf.js";import"./types-332ceaf3.js";import"./lodash-75c70a11.js";import"./disabled-context-d654f6ff.js";import"./tooltip-23e84186.js";import"./index-3d476d02.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({
|