@oliasoft-open-source/react-ui-library 4.2.0 → 4.2.1-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.
- package/dist/assets/{index-9e4179c3.css → index-0d78a198.css} +3 -0
- package/dist/assets/{index-cfa07a3f.js → index-26f804a8.js} +180 -175
- package/dist/index.d.ts +1 -1
- package/dist/index.html +1 -1
- package/dist/index.js +35 -17
- package/dist/index.js.map +1 -1
- package/dist/storybook/assets/{Color-6VNJS4EI-b934ab6b.js → Color-6VNJS4EI-38f93e87.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-NNNQARDV-ddf564a7.js → DocsRenderer-NNNQARDV-850c5573.js} +1 -1
- package/dist/storybook/assets/{WithTooltip-4HIR6TLV-8e7953d1.js → WithTooltip-4HIR6TLV-c574e731.js} +1 -1
- package/dist/storybook/assets/{accordion.stories-d52a4724.js → accordion.stories-41aed20e.js} +2 -2
- package/dist/storybook/assets/{afe.stories-dbb9e71e.js → afe.stories-a4fbd6ce.js} +1 -1
- package/dist/storybook/assets/{blowout.stories-af7f9432.js → blowout.stories-3d16e5ec.js} +1 -1
- package/dist/storybook/assets/{buttons-and-links-bea8e431.js → buttons-and-links-dab2a936.js} +1 -1
- package/dist/storybook/assets/{casing-loads.stories-97ec4b66.js → casing-loads.stories-d5882170.js} +2 -2
- package/dist/storybook/assets/{cell.stories-4a847cd0.js → cell.stories-0ae4bf08.js} +2 -2
- package/dist/storybook/assets/{chunk-HLWAVYOI-15cd9aaa.js → chunk-HLWAVYOI-48e544a6.js} +1 -1
- package/dist/storybook/assets/{color-d7525af7.js → color-c848f869.js} +1 -1
- package/dist/storybook/assets/{file-input.stories-a7e96582.js → file-input.stories-6878a9b8.js} +1 -1
- package/dist/storybook/assets/{footer.stories-da256be2.js → footer.stories-50a2e3db.js} +2 -2
- package/dist/storybook/assets/{form.stories-7c1518fa.js → form.stories-fb337772.js} +1 -1
- package/dist/storybook/assets/{formation.stories-a033bc86.js → formation.stories-3c9cd637.js} +2 -2
- package/dist/storybook/assets/{formatter-SWP5E3XI-bc797410.js → formatter-SWP5E3XI-3022f287.js} +1 -1
- package/dist/storybook/assets/iframe-c049b5de.js +1 -0
- package/dist/storybook/assets/{number-input-7cb3ea4d.js → index-57d7693e.js} +9 -9
- package/dist/storybook/assets/{index-ded8dd51.js → index-facfe879.js} +4 -4
- package/dist/storybook/assets/{input-validation-98dcb1cc.js → input-validation-36225c65.js} +1 -1
- package/dist/storybook/assets/{inputs-95a86db4.js → inputs-76e61ee6.js} +2 -2
- package/dist/storybook/assets/{layout-forms-2d1a89fa.js → layout-forms-e5b070bb.js} +1 -1
- package/dist/storybook/assets/{layout-general-d43e1deb.js → layout-general-86c12240.js} +1 -1
- package/dist/storybook/assets/number-input-cfbd9eb7.js +1 -0
- package/dist/storybook/assets/{number-input.stories-a78d1390.js → number-input.stories-8137782e.js} +2 -2
- package/dist/storybook/assets/{padding-and-spacing-175c928c.js → padding-and-spacing-27184e3b.js} +1 -1
- package/dist/storybook/assets/{page.stories-b69a6953.js → page.stories-8d0476d7.js} +1 -1
- package/dist/storybook/assets/preview-2ce67243.js +1 -0
- package/dist/storybook/assets/{preview-5b4b7caf.js → preview-b8e17d34.js} +1 -1
- package/dist/storybook/assets/{projects.stories-104a0c19.js → projects.stories-47d63f05.js} +1 -1
- package/dist/storybook/assets/{reservoirs.stories-0306bd1a.js → reservoirs.stories-537002ca.js} +1 -1
- package/dist/storybook/assets/{row.stories-d565ec28.js → row.stories-c12a3e52.js} +2 -2
- package/dist/storybook/assets/{site.stories-ae79a20c.js → site.stories-9486039d.js} +1 -1
- package/dist/storybook/assets/{syntaxhighlighter-NMPM6SWI-696a62ca.js → syntaxhighlighter-NMPM6SWI-abcfc30f.js} +1 -1
- package/dist/storybook/assets/{table-a19b5c53.js → table-134da40b.js} +1 -1
- package/dist/storybook/assets/{table.stories-4b24d81a.js → table.stories-8dd2a568.js} +2 -2
- package/dist/storybook/assets/{textarea-598f9fff.js → textarea-5ebdd171.js} +1 -1
- package/dist/storybook/assets/{textarea.stories-3902f4aa.js → textarea.stories-02879684.js} +1 -1
- package/dist/storybook/assets/{title.stories-00dc9f42.js → title.stories-2ba6aa87.js} +2 -2
- package/dist/storybook/assets/{top-bar-38689fe2.js → top-bar-2c70083e.js} +1 -1
- package/dist/storybook/assets/{top-bar.stories-3d9a6da1.js → top-bar.stories-bbfb7220.js} +1 -1
- package/dist/storybook/assets/{top-bar.testcase.stories-dc051455.js → top-bar.testcase.stories-1d4c6e3a.js} +1 -1
- package/dist/storybook/assets/unit-input.stories-035fa696.js +265 -0
- package/dist/storybook/assets/unit-input.stories-c251e2c8.css +1 -0
- 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/404.html +0 -1
- package/dist/storybook/assets/iframe-615023be.js +0 -1
- package/dist/storybook/assets/preview-e85ca407.js +0 -1
package/dist/storybook/assets/{reservoirs.stories-0306bd1a.js → reservoirs.stories-537002ca.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-f961835c.js";import{r as b}from"./index-f80c8c95.js";import{I as j}from"./common-types-2c81813f.js";import{T as w}from"./top-bar-
|
|
1
|
+
import{j as e}from"./jsx-runtime-f961835c.js";import{r as b}from"./index-f80c8c95.js";import{I as j}from"./common-types-2c81813f.js";import{T as w}from"./top-bar-2c70083e.js";import{S as L}from"./side-bar-10cceacd.js";import{H as t}from"./heading-39e599c8.js";import{B as m}from"./button-050c998a.js";import{D as v}from"./drawer-308b0a03.js";import{L as C}from"./list-bc0d9ad9.js";import{F as l}from"./field-248df38c.js";import{I as i}from"./input-05f21b51.js";import{C as p}from"./check-box-b38490e5.js";import{R as h}from"./radio-button-d69b72e4.js";import{C as d}from"./card-3847c251.js";import{F}from"./form-row-19dd7f6e.js";import{P as g}from"./page-6d07f774.js";import{R as a,C as r}from"./row-2299f0e7.js";import{S as R}from"./select-d4593fc0.js";import{S as f}from"./spacer-54db0620.js";import"./index-a80ed1cf.js";import"./icon-8acf9925.js";import"./inheritsLoose-c82a83d4.js";import"./tslib.es6-dfef685f.js";import"./index-c89a1915.js";import"./disabled-context-d654f6ff.js";import"./actions-83a2a04e.js";import"./lodash-75c70a11.js";import"./tooltip-856042a7.js";import"./index-3d476d02.js";import"./types-cc224262.js";import"./types-332ceaf3.js";import"./badge-20e7ee0b.js";import"./index-c7f280f6.js";import"./help-icon-c0abd380.js";import"./spinner-a81ebe38.js";import"./index.es-37e2ce0d.js";import"./extends-98964cd2.js";import"./redux-10ee6be7.js";import"./objectSpread2-fdee9b6d.js";import"./memoize-one.esm-52518564.js";import"./list-heading-2215213f.js";import"./loader-87ec8334.js";import"./label-e6d15b59.js";import"./select.input-88b6ebab.js";import"./styled-components.browser.esm-416d73e5.js";import"./assertThisInitialized-081f9914.js";import"./text-ad1f5f1d.js";const k=({width:o,height:n})=>e.jsx("div",{style:{background:"#ddd",width:o,height:n}}),ve={title:"Layout/Layout Examples",parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}}},s=()=>{const[o,n]=b.useState(!0);return e.jsxs(e.Fragment,{children:[e.jsx(w,{}),e.jsx(L,{options:{title:"",sections:[]}}),e.jsx(g,{padding:!1,scroll:!1,children:e.jsxs(a,{spacing:0,height:"100%",children:[e.jsx(v,{button:e.jsx(m,{onClick:()=>n(!o),round:!0,icon:j.CHEVRON_LEFT}),open:o,width:300,closedWidth:"var(--size-sidebar)",children:e.jsx(C,{drawer:!0,narrow:!o,list:{name:"Reservoirs",items:[{id:1,name:"Lorem",active:!0},{id:2,name:"Ipsum"}]}})}),e.jsxs(r,{scroll:!0,padding:!0,borderLeft:!0,children:[e.jsxs(a,{children:[e.jsxs(r,{children:[e.jsx(t,{top:!0,children:"Reservoir name here"}),e.jsxs(F,{children:[e.jsx(l,{label:"Name",children:e.jsx(i,{value:"Reservoir name here",width:"200px"})}),e.jsx(l,{label:"Lorem",children:e.jsx(h,{name:"example",options:[{label:"Aardvarks",value:"termites"},{label:"Monkeys",value:"bananas"}],value:{label:"Monkeys",value:"bananas"},inline:!0})}),e.jsx(l,{label:"Ipsum",children:e.jsx(R,{name:"example",options:[{label:"Monkeys",value:"bananas"},{label:"Possums",value:"slugs"}],value:{label:"Monkeys",value:"bananas"},native:!0})}),e.jsx(l,{children:e.jsx(p,{label:"Dolor"})})]})]}),e.jsx(r,{flex:!1,children:e.jsx(m,{onClick:()=>{},round:!0,icon:"question"})})]}),e.jsxs(a,{children:[e.jsx(r,{width:"50%",children:e.jsx(d,{heading:e.jsx(t,{onClickHelp:()=>console.log("help!"),children:"Reservoir Zone"}),children:e.jsxs(a,{children:[e.jsxs(r,{width:"50%",children:[e.jsxs(l,{label:"Label",helpText:"Lorem ipsum",children:[e.jsx(h,{options:[{label:"Aardvarks",value:"termites"},{label:"Monkeys",value:"bananas"}],value:{label:"Monkeys",value:"bananas"},inline:!0}),e.jsx(i,{width:"100%"})]}),e.jsxs(l,{label:"Label",helpText:"Lorem ipsum",children:[e.jsx(p,{label:"Lorem ipsum"}),e.jsx(i,{width:"100%",disabled:!0})]}),e.jsx(l,{label:"Label",helpText:"Lorem ipsum",children:e.jsx(i,{width:"100%"})}),e.jsx(l,{label:"Label",helpText:"Lorem ipsum",children:e.jsx(i,{width:"100%"})})]}),e.jsxs(r,{width:"50%",children:[e.jsx(l,{label:"Label",helpText:"Lorem ipsum",children:e.jsx(i,{width:"100%"})}),e.jsx(l,{label:"Label",helpText:"Lorem ipsum",children:e.jsx(i,{width:"100%"})}),e.jsx(l,{label:"Label",helpText:"Lorem ipsum",children:e.jsx(i,{width:"100%"})}),e.jsx(l,{label:"Label",helpText:"Lorem ipsum",children:e.jsx(i,{width:"100%"})})]})]})})}),e.jsxs(r,{width:"50%",children:[e.jsx(d,{heading:e.jsx(t,{children:"Reservoir Size"}),children:e.jsxs(a,{children:[e.jsxs(r,{width:"160px",children:[e.jsx(l,{label:"Length",children:e.jsx(i,{width:"100%"})}),e.jsx(l,{label:"Width",children:e.jsx(i,{width:"100%"})})]}),e.jsx(r,{children:e.jsx(k,{width:"100%",height:"100%"})})]})}),e.jsx(f,{}),e.jsx(d,{heading:e.jsx(t,{children:"Reservoir Properties"}),children:e.jsxs(a,{children:[e.jsx(r,{children:e.jsx(l,{label:"Label",children:e.jsx(i,{width:"100%"})})}),e.jsx(r,{children:e.jsx(l,{label:"Label",children:e.jsx(i,{width:"100%"})})}),e.jsx(r,{children:e.jsx(l,{label:"Label",children:e.jsx(i,{width:"100%"})})})]})})]})]})]})]})})]})};var u,x,c;s.parameters={...s.parameters,docs:{...(u=s.parameters)==null?void 0:u.docs,source:{originalSource:`() => {
|
|
2
2
|
const [open, setOpen] = useState(true);
|
|
3
3
|
return <>
|
|
4
4
|
<TopBar />
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o}from"./jsx-runtime-f961835c.js";import{r as R}from"./index-f80c8c95.js";import{T as c}from"./table-
|
|
1
|
+
import{j as o}from"./jsx-runtime-f961835c.js";import{r as R}from"./index-f80c8c95.js";import{T as c}from"./table-134da40b.js";import{T as V}from"./text-ad1f5f1d.js";import{t as g,i as W,q as B}from"./table.stories-data-ddbcf8c3.js";import"./index-a80ed1cf.js";import"./index.es-37e2ce0d.js";import"./inheritsLoose-c82a83d4.js";import"./extends-98964cd2.js";import"./redux-10ee6be7.js";import"./objectSpread2-fdee9b6d.js";import"./index-3d476d02.js";import"./memoize-one.esm-52518564.js";import"./icon-8acf9925.js";import"./tslib.es6-dfef685f.js";import"./index-c89a1915.js";import"./disabled-context-d654f6ff.js";import"./lodash-75c70a11.js";import"./actions-83a2a04e.js";import"./common-types-2c81813f.js";import"./button-050c998a.js";import"./spinner-a81ebe38.js";import"./tooltip-856042a7.js";import"./types-cc224262.js";import"./types-332ceaf3.js";import"./badge-20e7ee0b.js";import"./heading-39e599c8.js";import"./help-icon-c0abd380.js";import"./pagination-443065a8.js";import"./select-d4593fc0.js";import"./assertThisInitialized-081f9914.js";import"./select.input-88b6ebab.js";import"./input-05f21b51.js";import"./input-group-20c3add3.js";import"./input-group-addon-f8f6683a.js";import"./number-input-cfbd9eb7.js";import"./index-57d7693e.js";import"./index-54f0d271.js";import"./check-box-b38490e5.js";import"./slider-5d5442fe.js";import"./index-c7f280f6.js";import"./popover-c1234faa.js";import"./flex-1d14d86c.js";const Le={title:"Basic/Table/Row",component:c,args:{table:{...g}}},b=n=>o.jsx(c,{...n}),i=b.bind({});i.args={table:W};const p=b.bind({});p.args={table:B};const t=b.bind({});t.args={table:{...g,striped:!1}};t.parameters={docs:{description:{story:"`striped: false` removes tinted background on alternative rows."}}};const m=()=>{const[n,e]=R.useState(null),a=r=>e(n===r?null:r);return o.jsx(c,{table:{...g,striped:!1,rows:g.rows.map((r,d)=>({...r,onRowClick:()=>a(d),expandedContent:{content:n===d?o.jsx("div",{children:"Example expanded content"}):null}}))}})},w=()=>{const n={draggable:!0,headers:[{cells:[{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"}]}],rows:[{noDrag:!0,cells:[{value:"Undraggable"},{value:100},{value:361},{value:"Vietnam"}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"}]}]},e=(s,u,l)=>{const x=[...s];return s[l].noDrag?s:(x.splice(l,0,x.splice(u,1)[0]),x)},[a,r]=R.useState(n.rows),d=s=>{const{to:u,from:l}=s;e(a,l,u),r(e(a,l,u))};return o.jsx(c,{table:{...n,rows:a},onListReorder:d})},v=()=>{const[n,e]=R.useState("Hover any row!"),a=[1,2,3,4,5].map(r=>({cells:[{value:`Row ${r}`},{value:`${r**2}`}],onRowMouseEnter:()=>e(`Hovering row ${r}`),onRowMouseLeave:()=>e("Not hovering any row...")}));return o.jsxs(o.Fragment,{children:[o.jsx(V,{children:n}),o.jsx(c,{table:{fixedWidth:"100%",headers:[{cells:[{value:"Description"},{value:"Value"}],onRowMouseEnter:()=>e("Hovering header row"),onRowMouseLeave:()=>e("Not hovering any row...")}],rows:a}})]})};var y,D,E;i.parameters={...i.parameters,docs:{...(y=i.parameters)==null?void 0:y.docs,source:{originalSource:`args => {
|
|
2
2
|
return <Table
|
|
3
3
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
4
4
|
{...args} />;
|
|
@@ -119,4 +119,4 @@ import{j as o}from"./jsx-runtime-f961835c.js";import{r as R}from"./index-f80c8c9
|
|
|
119
119
|
rows
|
|
120
120
|
}} />
|
|
121
121
|
</>;
|
|
122
|
-
}`,...(O=($=v.parameters)==null?void 0:$.docs)==null?void 0:O.source}}};const
|
|
122
|
+
}`,...(O=($=v.parameters)==null?void 0:$.docs)==null?void 0:O.source}}};const Me=["ActiveRow","RowFocusEvent","NotStriped","Expandable","DragAndDrop","OnRowEnter"];export{i as ActiveRow,w as DragAndDrop,m as Expandable,t as NotStriped,v as OnRowEnter,p as RowFocusEvent,Me as __namedExportsOrder,Le as default};
|
|
@@ -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-
|
|
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-2c70083e.js";import{S as w}from"./side-bar-10cceacd.js";import{H as t}from"./heading-39e599c8.js";import{B as L}from"./button-050c998a.js";import{D as v}from"./drawer-308b0a03.js";import{L as d}from"./list-bc0d9ad9.js";import{F as l}from"./field-248df38c.js";import{I as a}from"./input-05f21b51.js";import{C as m}from"./check-box-b38490e5.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-1b587708.js";import{S as s}from"./spacer-54db0620.js";import{T as F}from"./tabs-cf5ccede.js";import"./index-a80ed1cf.js";import"./icon-8acf9925.js";import"./inheritsLoose-c82a83d4.js";import"./tslib.es6-dfef685f.js";import"./index-c89a1915.js";import"./disabled-context-d654f6ff.js";import"./actions-83a2a04e.js";import"./lodash-75c70a11.js";import"./tooltip-856042a7.js";import"./index-3d476d02.js";import"./types-cc224262.js";import"./types-332ceaf3.js";import"./badge-20e7ee0b.js";import"./index-c7f280f6.js";import"./help-icon-c0abd380.js";import"./spinner-a81ebe38.js";import"./index.es-37e2ce0d.js";import"./extends-98964cd2.js";import"./redux-10ee6be7.js";import"./objectSpread2-fdee9b6d.js";import"./memoize-one.esm-52518564.js";import"./card-3847c251.js";import"./list-heading-2215213f.js";import"./loader-87ec8334.js";import"./label-e6d15b59.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"}),xe={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 l,c as n,s as d}from"./index-
|
|
1
|
+
import{S as l,c as n,s as d}from"./index-facfe879.js";import"./iframe-c049b5de.js";import"../sb-preview/runtime.js";import"./index-f80c8c95.js";import"./index-3d476d02.js";import"./extends-98964cd2.js";import"./assertThisInitialized-081f9914.js";import"./inheritsLoose-c82a83d4.js";import"./index-cf68f115.js";export{l as SyntaxHighlighter,n as createCopyToClipboardFunction,d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as n}from"./jsx-runtime-f961835c.js";import{r as T}from"./index-f80c8c95.js";import{c as N}from"./index-a80ed1cf.js";import{I as He,D as Pe,C as Le,P as De}from"./index.es-37e2ce0d.js";import{l as Fe}from"./lodash-75c70a11.js";import{A as ye}from"./actions-83a2a04e.js";import{H as $e}from"./heading-39e599c8.js";import{P as Oe}from"./pagination-443065a8.js";import{A as b,I as $}from"./common-types-2c81813f.js";import{I as Be}from"./input-05f21b51.js";import{N as Me}from"./number-input-7cb3ea4d.js";import{S as Ge}from"./select-d4593fc0.js";import{D as Ue}from"./disabled-context-d654f6ff.js";import{i as O}from"./types-332ceaf3.js";import{T as fe}from"./tooltip-856042a7.js";import{C as Xe}from"./check-box-b38490e5.js";import{S as Je}from"./slider-5d5442fe.js";import{I as B}from"./icon-8acf9925.js";import{P as Ke}from"./popover-c1234faa.js";import{H as Ee}from"./help-icon-c0abd380.js";import{T as ee}from"./text-ad1f5f1d.js";const ze="_inputInTable_y9car_1",Ye="_inputHover_y9car_13",Qe="_inputFocus_y9car_18",Ze="_inputError_y9car_25",en="_inputWarning_y9car_26",nn="_inputDisabled_y9car_61",tn="_hideScrollbars_y9car_67",rn="_wrapper_y9car_85",an="_bordered_y9car_93",ln="_scroll_y9car_98",on="_table_y9car_108",sn="_striped_y9car_188",H={inputInTable:ze,inputHover:Ye,inputFocus:Qe,inputError:Ze,inputWarning:en,inputDisabled:nn,hideScrollbars:tn,wrapper:rn,bordered:an,scroll:ln,table:on,striped:sn},dn="_title_11pbp_1",cn={title:dn},U=({name:e=null,actions:t=null,actionsRight:a=!1,testId:l})=>{const r=e!==null,o=t!==null;if(!r&&!o)return null;const s=()=>{if(!o)return null;const u=n.jsx(ye,{actions:t});return a?u:n.jsx("div",{children:u})};return n.jsxs("div",{className:cn.title,children:[r?n.jsx($e,{children:n.jsx("span",{"data-testid":l,children:e})}):null,s()]})};try{U.displayName="Title",U.__docgenInfo={description:"",displayName:"Title",props:{name:{defaultValue:{value:"null"},description:"",name:"name",required:!1,type:{name:"string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null"}},actions:{defaultValue:{value:"null"},description:"",name:"actions",required:!1,type:{name:"any"}},actionsRight:{defaultValue:{value:"false"},description:"",name:"actionsRight",required:!1,type:{name:"boolean"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const un="_footer_4sumy_1",pn="_section_4sumy_7",ne={footer:un,section:pn},X=({colSpan:e,pagination:t,actions:a,content:l})=>{const r=a&&a.length,o=l!=null,s=()=>{var d,p;if(t){const{rowCount:c,rowsPerPage:y}=t,g=Number((p=(d=y==null?void 0:y.options)==null?void 0:d[0])==null?void 0:p.value);return c>g}return!1};return r||o||s()?n.jsxs("div",{className:ne.footer,children:[o?n.jsx("div",{className:ne.section,children:n.jsx("div",{children:l})}):null,r||s()?n.jsxs("div",{className:ne.section,children:[s()?n.jsx(Oe,{pagination:t}):n.jsx("div",{}),r&&n.jsx("div",{children:n.jsx(ye,{actions:a})})]}):null]}):null};try{X.displayName="Footer",X.__docgenInfo={description:"",displayName:"Footer",props:{colSpan:{defaultValue:null,description:"",name:"colSpan",required:!1,type:{name:"number"}},pagination:{defaultValue:null,description:"",name:"pagination",required:!0,type:{name:"IPagination"}},actions:{defaultValue:null,description:"",name:"actions",required:!1,type:{name:"IAction[]"}},content:{defaultValue:null,description:"",name:"content",required:!1,type:{name:"ReactNode"}}}}}catch{}const Se=e=>{const t=Math.max(...e.reduce((a,l)=>{const r=l.cells.map(o=>o.colSpan?o.colSpan:1).reduce((o,s)=>o+s,0);return a.concat(r)},[]));return isNaN(t)?0:t},mn=(e,t)=>{const a=[Se(t),Se(e)];return Math.max(...a)},Ve=e=>e.reduce((t,a)=>a.actions&&a.actions.length>0?1:t,0),_n=(e,t)=>Ve(t)>0||Ve(e)>0,J=({table:e,children:t})=>{const{rows:a,infiniteScroll:l}=e,r=Math.ceil(window.innerHeight/30),[o,s]=l?T.useState(r):[a.length,null],[u,d]=l?T.useState(o<a.length):[!1,null],p=()=>{if(o>=a.length&&d){d(!1);return}s&&s(o+r)};return n.jsx("div",{id:"scrollWrapper",className:H.scroll,children:l?n.jsx(He,{dataLength:Math.min(a.length,o+r),next:p,hasMore:u,scrollableTarget:"scrollWrapper",style:{overflow:"initial"},loader:null,children:t({visibleRows:o})}):t({visibleRows:o})})};try{J.displayName="TableScrollWrapper",J.__docgenInfo={description:"",displayName:"TableScrollWrapper",props:{table:{defaultValue:null,description:"",name:"table",required:!0,type:{name:"ITableProps"}}}}}catch{}const gn="_clickableRow_11d5t_1",yn="_hoverableRow_11d5t_4",fn="_rowActive_11d5t_4",hn="_expandableRow_11d5t_8",bn="_flush_11d5t_8",xn="_dragIconCell_11d5t_28",Cn="_dragIcon_11d5t_28",R={clickableRow:gn,hoverableRow:yn,rowActive:fn,expandableRow:hn,flush:bn,dragIconCell:xn,dragIcon:Cn},K=({colSpan:e,children:t,flush:a})=>n.jsx("tr",{children:n.jsx("td",{colSpan:e,className:N(R.expandableRow,a?R.flush:""),children:t})});try{K.displayName="ExpandedContentRow",K.__docgenInfo={description:"",displayName:"ExpandedContentRow",props:{colSpan:{defaultValue:null,description:"",name:"colSpan",required:!0,type:{name:"number"}},flush:{defaultValue:null,description:"",name:"flush",required:!1,type:{name:"boolean"}}}}}catch{}const Te=(e,t={leftAligned:"",rightAligned:"",centerAligned:""},a=!1)=>{if(!e)return null;const{bodyAlignment:l,headerAlignment:r,isHeader:o}=e;switch(o&&r?r:l){case b.LEFT:return a?b.LEFT:t.leftAligned;case b.RIGHT:return a?b.RIGHT:t.rightAligned;case b.CENTER:return a?b.CENTER:t.centerAligned;default:return a?b.LEFT:t.leftAligned}},In=(e,t=!1,a=0)=>{if(!e||e.length===0)return[];const l=e.every(o=>Array.isArray(o)),r=e.every(o=>typeof o=="string");return l&&t?e[a]||[]:r?e:(console.warn("getHeaderAlignment: alignments array contains a mix of strings and arrays, returning an empty array."),[])},jn="_inputInTable_u3xdj_1",Nn="_inputHover_u3xdj_13",wn="_inputFocus_u3xdj_18",An="_inputError_u3xdj_25",vn="_inputWarning_u3xdj_26",Rn="_inputDisabled_u3xdj_61",Sn="_hideScrollbars_u3xdj_67",Vn="_cell_u3xdj_77",Tn="_disabledLink_u3xdj_87",qn="_inputWrapper_u3xdj_91",En="_breakWord_u3xdj_106",kn="_inputCell_u3xdj_109",Wn="_sliderCell_u3xdj_112",Hn="_staticCell_u3xdj_116",Pn="_staticCellContent_u3xdj_119",Ln="_error_u3xdj_131",Dn="_warning_u3xdj_132",Fn="_unit_u3xdj_141",$n="_sortingCell_u3xdj_144",On="_sortingCellIcon_u3xdj_155",Bn="_icon_u3xdj_166",Mn="_checkBoxCell_u3xdj_170",Gn="_iconCellWrapper_u3xdj_174",Un="_actionsCell_u3xdj_178",Xn="_rightAligned_u3xdj_186",Jn="_centerAligned_u3xdj_192",Kn="_leftAligned_u3xdj_198",zn="_popover_u3xdj_201",Yn="_disabledPointerEvents_u3xdj_204",i={inputInTable:jn,inputHover:Nn,inputFocus:wn,inputError:An,inputWarning:vn,inputDisabled:Rn,hideScrollbars:Sn,cell:Vn,disabledLink:Tn,inputWrapper:qn,breakWord:En,inputCell:kn,sliderCell:Wn,staticCell:Hn,staticCellContent:Pn,error:Ln,warning:Dn,unit:Fn,sortingCell:$n,sortingCellIcon:On,icon:Bn,checkBoxCell:Mn,iconCellWrapper:Gn,actionsCell:Un,rightAligned:Xn,centerAligned:Jn,leftAligned:Kn,popover:zn,disabledPointerEvents:Yn},te=({cell:e,columnAlignment:t,testId:a})=>n.jsx(Be,{name:e.name,value:e.value,onChange:l=>{var r;return(r=e.onChange)==null?void 0:r.call(e,l)},onPaste:l=>{var r;return(r=e.onPaste)==null?void 0:r.call(e,l)},placeholder:e.placeholder,error:e.error,warning:e.warning,disabled:e.disabled,isInTable:!0,maxTooltipWidth:e.maxTooltipWidth,right:t===b.RIGHT,testId:a,tabIndex:e.disabled?-1:0,tooltip:e.tooltip});try{te.displayName="InputCell",te.__docgenInfo={description:"",displayName:"InputCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"IInputCell"}},columnAlignment:{defaultValue:null,description:"",name:"columnAlignment",required:!1,type:{name:"string"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const re=({cell:e,testId:t})=>n.jsx(Me,{name:e.name,value:e.value,onChange:a=>{var l;return(l=e.onChange)==null?void 0:l.call(e,a)},placeholder:e.placeholder,error:e.error,warning:e.warning,disabled:e.disabled,isInTable:!0,left:e.left,tabIndex:e.disabled?-1:0,testId:t,tooltip:e.tooltip,validationCallback:e.validationCallback,allowEmpty:e.allowEmpty});try{re.displayName="NumberInputCell",re.__docgenInfo={description:"",displayName:"NumberInputCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"INumberInputCell"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const ae=({cell:e,columnAlignment:t,testId:a})=>n.jsx(Ge,{name:e.name,borderRadius:0,options:e.options,onChange:l=>{var r;return(r=e.onChange)==null?void 0:r.call(e,l)},onCreate:e.onCreate?l=>e.onCreate&&e.onCreate(l):void 0,error:e.error,warning:e.warning,disabled:e.disabled,placeholder:e.placeholder,isInTable:!0,value:e.value,native:e.native,clearable:e.clearable,searchable:e.searchable,deprecatedEventHandler:e.deprecatedEventHandler,maxTooltipWidth:e.maxTooltipWidth,width:"100%",autoLayerWidth:e.autoLayerWidth,right:t===b.RIGHT,testId:a,tabIndex:e.disabled?-1:0});try{ae.displayName="SelectCell",ae.__docgenInfo={description:"",displayName:"SelectCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"ISelectCell"}},columnAlignment:{defaultValue:null,description:"",name:"columnAlignment",required:!1,type:{name:"string"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const le=({cell:e,columnAlignment:t,testId:a})=>n.jsx("div",{className:i.inputWrapper,children:e.type==="Input"?n.jsx(te,{cell:e,columnAlignment:t,testId:a}):e.type==="NumberInput"?n.jsx(re,{cell:e,testId:a}):e.type==="Select"?n.jsx(ae,{cell:e,columnAlignment:t,testId:a}):null});try{le.displayName="InputCellWrapper",le.__docgenInfo={description:"",displayName:"InputCellWrapper",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"any"}},columnAlignment:{defaultValue:null,description:"",name:"columnAlignment",required:!0,type:{name:"string"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const oe=({cell:e,testId:t})=>{const a=T.useContext(Ue),{error:l,warning:r,tooltip:o,maxTooltipWidth:s}=e,u=d=>O(d);return n.jsx("div",{className:i.inputWrapper,children:n.jsx(fe,{error:!!l,warning:!!r,text:o||l||r,enabled:u(o)||u(l)||u(r)||!1,maxWidth:s,placement:"bottom-center",children:n.jsx("div",{className:N(i.staticCellContent,l?i.error:r?i.warning:""),children:n.jsx("a",{className:N((e.disabled||a)&&i.disabledLink),onClick:e.disabled||a?void 0:d=>{var p;d.stopPropagation(),(p=e.onClick)==null||p.call(e,d)},"data-testid":t,children:e.value})})})})};try{oe.displayName="LinkCell",oe.__docgenInfo={description:"",displayName:"LinkCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"ILinkCell"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const ie=({cell:e,testId:t})=>n.jsx(Xe,{label:e.label,checked:e.checked,isInTable:!0,disabled:e.disabled,onChange:a=>e.onChange(a),testId:t,tabIndex:e.disabled?-1:0});try{ie.displayName="CheckBoxCell",ie.__docgenInfo={description:"",displayName:"CheckBoxCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"ICheckBoxCell"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const se=({cell:e})=>n.jsx("div",{className:i.inputWrapper,children:n.jsx(Je,{label:e.label,value:e.value,min:e.min,max:e.max,step:e.step,marks:e.marks,onChange:t=>e.onChange(t),showArrows:e.showArrows,showTooltip:e.showTooltip,tooltipFormatter:e.tooltipFormatter,disabled:e.disabled})});try{se.displayName="SliderCell",se.__docgenInfo={description:"",displayName:"SliderCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"ISliderCell"}}}}}catch{}const de=({cell:e})=>{const{tooltip:t,icon:a}=e;return n.jsx("div",{className:i.iconCellWrapper,children:n.jsx(fe,{text:t,enabled:!!t&&O(t),display:"flex",placement:"top-center",children:n.jsx(B,{icon:a})})})};try{de.displayName="IconCell",de.__docgenInfo={description:"",displayName:"IconCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"IIconCell"}}}}}catch{}const ce=({cell:e})=>n.jsx(ye,{actions:e.actions});try{ce.displayName="ActionsCell",ce.__docgenInfo={description:"",displayName:"ActionsCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"IActionCell"}}}}}catch{}const ue=({cell:e})=>{const{helpIcon:t}=e;return t?n.jsx("div",{className:i.icon,children:n.jsx(Ee,{onClick:t.onClick,text:t.tooltip})}):null};try{ue.displayName="CellHelpIcon",ue.__docgenInfo={description:"",displayName:"CellHelpIcon",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"IHelpIconCell"}}}}}catch{}const pe=({cell:e})=>{const{libraryIcon:t}=e;return t?n.jsx("div",{className:i.icon,children:n.jsx(Ee,{onClick:t.onClick,text:t.tooltip,icon:$.LIBRARY})}):null};try{pe.displayName="CellLibraryIcon",pe.__docgenInfo={description:"",displayName:"CellLibraryIcon",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"ILibraryIconCell"}}}}}catch{}const me=({cell:e})=>{const{hasSort:t,sort:a,sortPriority:l}=e;return t?n.jsxs("span",{className:i.sortingCellIcon,children:[a==="down"?n.jsx(ee,{link:!0,children:n.jsx(B,{icon:$.SORT_ASCENDING})}):a==="up"?n.jsx(ee,{link:!0,children:n.jsx(B,{icon:$.SORT_DESCENDING})}):n.jsx(ee,{faint:!0,children:n.jsx(B,{icon:$.SORT_DESCENDING})}),l&&a?n.jsx("sup",{children:l}):null]}):null};try{me.displayName="Sort",me.__docgenInfo={description:"",displayName:"Sort",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"ISortCell"}}}}}catch{}const z=({cell:e,isHeader:t,testId:a})=>{const{error:l,warning:r,tooltip:o,maxTooltipWidth:s,hasSort:u,onSort:d,type:p}=e,c=n.jsxs("div",{className:N(i.staticCellContent,p==="Unit"?i.unit:"",l?i.error:r?i.warning:""),onClick:u?y=>d&&d(y):()=>{},"data-testid":a,children:[e.value,t?n.jsxs(n.Fragment,{children:[n.jsx(ue,{cell:e}),n.jsx(pe,{cell:e}),n.jsx(me,{cell:e})]}):null]});return n.jsx("div",{className:i.inputWrapper,children:n.jsx(fe,{error:!!l,warning:!!r,text:o||l||r,enabled:o&&O(o)||l&&O(l)||r&&O(r)||!1,maxWidth:s,display:"block",placement:"bottom-center",children:c})})};try{z.displayName="StaticCell",z.__docgenInfo={description:"",displayName:"StaticCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"IStaticCell"}},isHeader:{defaultValue:null,description:"",name:"isHeader",required:!1,type:{name:"boolean"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const _e=({cell:e,testId:t})=>{const{content:a,fullWidth:l,closeOnOutsideClick:r,disabled:o}=e;return n.jsx(Ke,{content:a,fullWidth:l,closeOnOutsideClick:r,disabled:o,children:n.jsx("div",{className:i.popover,children:n.jsx(z,{cell:e,testId:t})})})};try{_e.displayName="PopoverCell",_e.__docgenInfo={description:"",displayName:"PopoverCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"IPopoverCell"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const ge=({cell:e,isHeader:t,columnAlignment:a,testId:l})=>{if(!e)return null;switch(e.type){case"Input":case"NumberInput":case"Select":return n.jsx(le,{cell:e,columnAlignment:a,testId:l});case"Link":return n.jsx(oe,{cell:e,testId:l});case"CheckBox":return n.jsx(ie,{cell:e,testId:l});case"Slider":return n.jsx(se,{cell:e});case"Icon":return n.jsx(de,{cell:e});case"Actions":return n.jsx(ce,{cell:e});case"Popover":return n.jsx(_e,{cell:e});default:return n.jsx(z,{cell:e,isHeader:t,testId:l})}};try{ge.displayName="CellWrapper",ge.__docgenInfo={description:"",displayName:"CellWrapper",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"any"}},isHeader:{defaultValue:null,description:"",name:"isHeader",required:!0,type:{name:"boolean"}},columnAlignment:{defaultValue:null,description:"",name:"columnAlignment",required:!0,type:{name:"string"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}var S=(e=>(e.INPUT="Input",e.NUMBER_INPUT="NumberInput",e.SELECT="Select",e.POPOVER="Popover",e.SLIDER="Slider",e.CHECKBOX="CheckBox",e.ACTIONS="Actions",e))(S||{});const Y=({cell:e,isHeader:t,columnHeaderAlignment:a,columnAlignment:l=b.LEFT,width:r,snapshot:o,testId:s})=>{if(!e)return null;const{style:u,colSpan:d,rowSpan:p,width:c}=e,y=T.useRef(null),g={bodyAlignment:l,headerAlignment:a,isHeader:t},P=Te(g,i),x=Te(g,i,!0),L=e.type===S.INPUT||e.type===S.NUMBER_INPUT||e.type===S.SELECT||e.type===S.POPOVER?i.inputCell:e.type===S.SLIDER?i.sliderCell:e.type===S.CHECKBOX?i.checkBoxCell:e.type===S.ACTIONS?i.actionsCell:i.staticCell,w=N(i.cell,L,e.hasSort?i.sortingCell:null,P,e.breakWord?i.breakWord:""),q=c??r??((o==null?void 0:o.isDragging)&&y.current&&y.current.offsetWidth)??void 0,C={width:q,minWidth:q,...u},A=t?"th":"td";return n.jsx(A,{ref:y,className:w,style:C,colSpan:d,rowSpan:p,children:n.jsx(ge,{cell:e,columnAlignment:x??b.RIGHT,isHeader:t,testId:s})})};try{Y.displayName="Cell",Y.__docgenInfo={description:"",displayName:"Cell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!1,type:{name:"TCellShape"}},isHeader:{defaultValue:null,description:"",name:"isHeader",required:!0,type:{name:"boolean"}},columnHeaderAlignment:{defaultValue:null,description:"",name:"columnHeaderAlignment",required:!1,type:{name:"string"}},columnAlignment:{defaultValue:{value:"Align.LEFT"},description:"",name:"columnAlignment",required:!1,type:{name:"Align.LEFT | Align.RIGHT | null"}},width:{defaultValue:null,description:"",name:"width",required:!1,type:{name:"TStringOrNumber"}},snapshot:{defaultValue:null,description:"",name:"snapshot",required:!1,type:{name:"any"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const F=({row:e,rowIndex:t,isHeader:a=!1,columnCount:l,colSpan:r,columnHeaderAlignments:o=[],columnAlignment:s=[],hasRowActions:u,draggableTable:d=!1,snapshot:p=null,provided:c=null,width:y,columnWidths:g,testId:P})=>{const x=T.useRef(null),L=In(o,a,t),{onRowClick:w,onRowFocus:q,onRowMouseEnter:C,onRowMouseLeave:A,expandedContent:I,active:Q}=e,E=e.cells.map((h,v)=>{const he=`${a?0:1}_${t}_${v}`;return n.jsx(Y,{cell:h,isHeader:a,columnAlignment:s[v],columnHeaderAlignment:L[v],width:g?g[v]:void 0,snapshot:p,testId:h.testId},he)}),V=u&&n.jsx(Y,{cell:{type:S.ACTIONS,actions:e.actions},isHeader:a},l),k=(h,v)=>({minWidth:h&&`${y}px`,width:h&&"100%",display:h&&"table",background:h&&"var(--color-background-listitem-active)",border:h&&"var(--color-border)",borderTop:h&&0,opacity:h&&.1,...v}),W=()=>e.noDrag?n.jsx("td",{"aria-labelledby":"unique-label-id"}):n.jsx("td",{className:R.dragIconCell,children:n.jsx("div",{...c.dragHandleProps,className:R.dragIcon,children:n.jsx(B,{icon:$.DRAG})})});return a?n.jsxs(n.Fragment,{children:[n.jsxs("tr",{ref:x,onClick:w,onMouseEnter:C,onMouseLeave:A,onFocus:q,className:N(w?R.clickableRow:null,C?R.hoverableRow:null),children:[d?n.jsx("th",{}):null,E,V]},t),I&&I.content?n.jsx(K,{colSpan:r,flush:I.flush===!0,children:I.content},`${t}_expanded_content`):null]}):n.jsxs(n.Fragment,{children:[n.jsxs("tr",{onClick:w,onMouseEnter:C,onMouseLeave:A,onFocus:q,className:N(w&&!w.noStyle?R.clickableRow:null,C&&!C.noStyle?R.hoverableRow:null,Q?R.rowActive:null),ref:(c==null?void 0:c.innerRef)||null,...(c==null?void 0:c.draggableProps)||null,style:p&&c?k(p.isDragging,c.draggableProps.style):null,children:[d?W():null,E,V]},t),I&&I.content?n.jsx(K,{colSpan:r,flush:I.flush===!0,children:I.content},`${t}_expanded_content`):null]})};try{F.displayName="Row",F.__docgenInfo={description:"",displayName:"Row",props:{row:{defaultValue:null,description:"",name:"row",required:!0,type:{name:"TRowType"}},rowIndex:{defaultValue:null,description:"",name:"rowIndex",required:!0,type:{name:"number"}},isHeader:{defaultValue:{value:"false"},description:"",name:"isHeader",required:!1,type:{name:"boolean"}},columnCount:{defaultValue:null,description:"",name:"columnCount",required:!0,type:{name:"number"}},colSpan:{defaultValue:null,description:"",name:"colSpan",required:!0,type:{name:"number"}},columnHeaderAlignments:{defaultValue:{value:"[]"},description:"",name:"columnHeaderAlignments",required:!1,type:{name:"string[] | string[][]"}},columnAlignment:{defaultValue:{value:"[]"},description:"",name:"columnAlignment",required:!1,type:{name:"string[]"}},hasRowActions:{defaultValue:null,description:"",name:"hasRowActions",required:!0,type:{name:"boolean"}},draggableTable:{defaultValue:{value:"false"},description:"",name:"draggableTable",required:!1,type:{name:"boolean"}},snapshot:{defaultValue:{value:"null"},description:"",name:"snapshot",required:!1,type:{name:"any"}},provided:{defaultValue:{value:"null"},description:"",name:"provided",required:!1,type:{name:"any"}},width:{defaultValue:null,description:"",name:"width",required:!1,type:{name:"TStringOrNumber"}},columnWidths:{defaultValue:null,description:"",name:"columnWidths",required:!1,type:{name:"string[]"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const qe=e=>{var Ie,je,Ne,we,Ae,ve,Re;const{onListReorder:t=()=>{},table:a}=e,{columnWidths:l,footer:r,name:o,rows:s=[],actions:u,actionsRight:d,columnHeaderAlignments:p,columnAlignment:c,striped:y=!0,testId:g,draggable:P,defaultEmptyRow:x=null,onAddRow:L=null,bordered:w=!0,maxHeight:q,fixedWidth:C}=a,A=T.useRef(null),[I,Q]=T.useState({width:0,height:0});T.useEffect(()=>{A.current&&Q({width:A.current.offsetWidth,height:A.current.offsetHeight})},[]);const E=Fe.get(e,"table.headers",[]),V=mn(s,E),k=_n(s,E),W=V+(k?1:0),h=r?((je=(Ie=r==null?void 0:r.pagination)==null?void 0:Ie.rowsPerPage)==null?void 0:je.value)===0||Number((Ne=r==null?void 0:r.pagination)==null?void 0:Ne.selectedPage)>=Number((we=r==null?void 0:r.pagination)==null?void 0:we.rowCount)/Number((ve=(Ae=r==null?void 0:r.pagination)==null?void 0:Ae.rowsPerPage)==null?void 0:ve.value):!0,v=((Re=x==null?void 0:x.cells)==null?void 0:Re.length)&&L&&h,ke={cells:v?x.cells.map((m,j)=>(m==null?void 0:m.type)==="Input"?{...m,onChange:_=>{var M;const f=(M=_==null?void 0:_.target)==null?void 0:M.value,D={...x,cells:x.cells.map((G,We)=>({...G,value:We===j?f:G==null?void 0:G.value}))};L({newRow:D})}}:{...m,disabled:!0}):null,testId:g?`${g}-last-empty-row`:void 0},Z=v?s.concat(ke):s,be={...a,rows:Z},xe=N(H.wrapper,w?H.bordered:""),Ce={maxHeight:q,width:C,display:C==="auto"?"inline-flex":"flex"};return P?n.jsxs("div",{ref:A,className:xe,style:Ce,children:[n.jsx(U,{actions:u,actionsRight:d,name:o,testId:g&&`${g}-title`}),n.jsx(Pe,{onDragEnd:m=>{var f,D;const j=(f=m==null?void 0:m.source)==null?void 0:f.index,_=(D=m==null?void 0:m.destination)==null?void 0:D.index;typeof j=="number"&&typeof _=="number"&&t({from:j,to:_})},children:n.jsx(Le,{droppableId:"droppable",children:m=>n.jsx(J,{table:be,children:({visibleRows:j})=>n.jsxs("table",{className:N(H.table,y?H.striped:""),"data-testid":g,ref:m.innerRef,children:[n.jsx("thead",{children:E.map((_,f)=>n.jsx(F,{rowIndex:f,isHeader:!0,row:_,columnCount:V,columnWidths:l,colSpan:W,hasRowActions:k,columnAlignment:c,columnHeaderAlignments:p,draggableTable:P},`0_${f}`))}),n.jsxs("tbody",{children:[Z.slice(0,j).map((_,f)=>n.jsx(De,{draggableId:f+"",index:f,isDragDisabled:_.noDrag,children:(D,M)=>n.jsx(F,{rowIndex:f,row:_,columnCount:V,columnWidths:l,colSpan:W,hasRowActions:k,columnAlignment:c,provided:D,snapshot:M,draggableTable:P,width:I.width},`1_${f}`)},`index_${f}`)),m.placeholder]})]})})})}),r&&n.jsx(X,{pagination:r.pagination,actions:r.actions,content:r.content})]}):n.jsxs("div",{className:xe,style:Ce,children:[n.jsx(U,{actions:u,actionsRight:d,name:o,testId:g&&`${g}-title`}),n.jsx(J,{table:be,children:({visibleRows:m})=>n.jsxs("table",{className:N(H.table,y?H.striped:""),"data-testid":g,children:[n.jsx("thead",{children:E.map((j,_)=>n.jsx(F,{rowIndex:_,isHeader:!0,row:j,columnCount:V,columnWidths:l,colSpan:W,hasRowActions:k,columnAlignment:c,columnHeaderAlignments:p},`0_${_}`))}),n.jsx("tbody",{children:Z.slice(0,m).map((j,_)=>n.jsx(F,{rowIndex:_,row:j,columnCount:V,columnWidths:l,colSpan:W,hasRowActions:k,columnAlignment:c},`1_${_}`))})]})}),r&&n.jsx(X,{colSpan:W,pagination:r.pagination,actions:r.actions,content:r.content})]})};try{qe.displayName="Table",qe.__docgenInfo={description:"",displayName:"Table",props:{onListReorder:{defaultValue:null,description:"",name:"onListReorder",required:!1,type:{name:"((obj: { from: number; to: number; }) => void)"}},table:{defaultValue:null,description:"",name:"table",required:!0,type:{name:"{ name?: string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null | undefined; ... 18 more ...; actions?: any; }"}}}}}catch{}export{qe as T};
|
|
1
|
+
import{j as n}from"./jsx-runtime-f961835c.js";import{r as T}from"./index-f80c8c95.js";import{c as N}from"./index-a80ed1cf.js";import{I as He,D as Pe,C as Le,P as De}from"./index.es-37e2ce0d.js";import{l as Fe}from"./lodash-75c70a11.js";import{A as ye}from"./actions-83a2a04e.js";import{H as $e}from"./heading-39e599c8.js";import{P as Oe}from"./pagination-443065a8.js";import{A as b,I as $}from"./common-types-2c81813f.js";import{I as Be}from"./input-05f21b51.js";import{N as Me}from"./number-input-cfbd9eb7.js";import{S as Ge}from"./select-d4593fc0.js";import{D as Ue}from"./disabled-context-d654f6ff.js";import{i as O}from"./types-332ceaf3.js";import{T as fe}from"./tooltip-856042a7.js";import{C as Xe}from"./check-box-b38490e5.js";import{S as Je}from"./slider-5d5442fe.js";import{I as B}from"./icon-8acf9925.js";import{P as Ke}from"./popover-c1234faa.js";import{H as Ee}from"./help-icon-c0abd380.js";import{T as ee}from"./text-ad1f5f1d.js";const ze="_inputInTable_y9car_1",Ye="_inputHover_y9car_13",Qe="_inputFocus_y9car_18",Ze="_inputError_y9car_25",en="_inputWarning_y9car_26",nn="_inputDisabled_y9car_61",tn="_hideScrollbars_y9car_67",rn="_wrapper_y9car_85",an="_bordered_y9car_93",ln="_scroll_y9car_98",on="_table_y9car_108",sn="_striped_y9car_188",H={inputInTable:ze,inputHover:Ye,inputFocus:Qe,inputError:Ze,inputWarning:en,inputDisabled:nn,hideScrollbars:tn,wrapper:rn,bordered:an,scroll:ln,table:on,striped:sn},dn="_title_11pbp_1",cn={title:dn},U=({name:e=null,actions:t=null,actionsRight:a=!1,testId:l})=>{const r=e!==null,o=t!==null;if(!r&&!o)return null;const s=()=>{if(!o)return null;const u=n.jsx(ye,{actions:t});return a?u:n.jsx("div",{children:u})};return n.jsxs("div",{className:cn.title,children:[r?n.jsx($e,{children:n.jsx("span",{"data-testid":l,children:e})}):null,s()]})};try{U.displayName="Title",U.__docgenInfo={description:"",displayName:"Title",props:{name:{defaultValue:{value:"null"},description:"",name:"name",required:!1,type:{name:"string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null"}},actions:{defaultValue:{value:"null"},description:"",name:"actions",required:!1,type:{name:"any"}},actionsRight:{defaultValue:{value:"false"},description:"",name:"actionsRight",required:!1,type:{name:"boolean"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const un="_footer_4sumy_1",pn="_section_4sumy_7",ne={footer:un,section:pn},X=({colSpan:e,pagination:t,actions:a,content:l})=>{const r=a&&a.length,o=l!=null,s=()=>{var d,p;if(t){const{rowCount:c,rowsPerPage:y}=t,g=Number((p=(d=y==null?void 0:y.options)==null?void 0:d[0])==null?void 0:p.value);return c>g}return!1};return r||o||s()?n.jsxs("div",{className:ne.footer,children:[o?n.jsx("div",{className:ne.section,children:n.jsx("div",{children:l})}):null,r||s()?n.jsxs("div",{className:ne.section,children:[s()?n.jsx(Oe,{pagination:t}):n.jsx("div",{}),r&&n.jsx("div",{children:n.jsx(ye,{actions:a})})]}):null]}):null};try{X.displayName="Footer",X.__docgenInfo={description:"",displayName:"Footer",props:{colSpan:{defaultValue:null,description:"",name:"colSpan",required:!1,type:{name:"number"}},pagination:{defaultValue:null,description:"",name:"pagination",required:!0,type:{name:"IPagination"}},actions:{defaultValue:null,description:"",name:"actions",required:!1,type:{name:"IAction[]"}},content:{defaultValue:null,description:"",name:"content",required:!1,type:{name:"ReactNode"}}}}}catch{}const Se=e=>{const t=Math.max(...e.reduce((a,l)=>{const r=l.cells.map(o=>o.colSpan?o.colSpan:1).reduce((o,s)=>o+s,0);return a.concat(r)},[]));return isNaN(t)?0:t},mn=(e,t)=>{const a=[Se(t),Se(e)];return Math.max(...a)},Ve=e=>e.reduce((t,a)=>a.actions&&a.actions.length>0?1:t,0),_n=(e,t)=>Ve(t)>0||Ve(e)>0,J=({table:e,children:t})=>{const{rows:a,infiniteScroll:l}=e,r=Math.ceil(window.innerHeight/30),[o,s]=l?T.useState(r):[a.length,null],[u,d]=l?T.useState(o<a.length):[!1,null],p=()=>{if(o>=a.length&&d){d(!1);return}s&&s(o+r)};return n.jsx("div",{id:"scrollWrapper",className:H.scroll,children:l?n.jsx(He,{dataLength:Math.min(a.length,o+r),next:p,hasMore:u,scrollableTarget:"scrollWrapper",style:{overflow:"initial"},loader:null,children:t({visibleRows:o})}):t({visibleRows:o})})};try{J.displayName="TableScrollWrapper",J.__docgenInfo={description:"",displayName:"TableScrollWrapper",props:{table:{defaultValue:null,description:"",name:"table",required:!0,type:{name:"ITableProps"}}}}}catch{}const gn="_clickableRow_11d5t_1",yn="_hoverableRow_11d5t_4",fn="_rowActive_11d5t_4",hn="_expandableRow_11d5t_8",bn="_flush_11d5t_8",xn="_dragIconCell_11d5t_28",Cn="_dragIcon_11d5t_28",R={clickableRow:gn,hoverableRow:yn,rowActive:fn,expandableRow:hn,flush:bn,dragIconCell:xn,dragIcon:Cn},K=({colSpan:e,children:t,flush:a})=>n.jsx("tr",{children:n.jsx("td",{colSpan:e,className:N(R.expandableRow,a?R.flush:""),children:t})});try{K.displayName="ExpandedContentRow",K.__docgenInfo={description:"",displayName:"ExpandedContentRow",props:{colSpan:{defaultValue:null,description:"",name:"colSpan",required:!0,type:{name:"number"}},flush:{defaultValue:null,description:"",name:"flush",required:!1,type:{name:"boolean"}}}}}catch{}const Te=(e,t={leftAligned:"",rightAligned:"",centerAligned:""},a=!1)=>{if(!e)return null;const{bodyAlignment:l,headerAlignment:r,isHeader:o}=e;switch(o&&r?r:l){case b.LEFT:return a?b.LEFT:t.leftAligned;case b.RIGHT:return a?b.RIGHT:t.rightAligned;case b.CENTER:return a?b.CENTER:t.centerAligned;default:return a?b.LEFT:t.leftAligned}},In=(e,t=!1,a=0)=>{if(!e||e.length===0)return[];const l=e.every(o=>Array.isArray(o)),r=e.every(o=>typeof o=="string");return l&&t?e[a]||[]:r?e:(console.warn("getHeaderAlignment: alignments array contains a mix of strings and arrays, returning an empty array."),[])},jn="_inputInTable_u3xdj_1",Nn="_inputHover_u3xdj_13",wn="_inputFocus_u3xdj_18",An="_inputError_u3xdj_25",vn="_inputWarning_u3xdj_26",Rn="_inputDisabled_u3xdj_61",Sn="_hideScrollbars_u3xdj_67",Vn="_cell_u3xdj_77",Tn="_disabledLink_u3xdj_87",qn="_inputWrapper_u3xdj_91",En="_breakWord_u3xdj_106",kn="_inputCell_u3xdj_109",Wn="_sliderCell_u3xdj_112",Hn="_staticCell_u3xdj_116",Pn="_staticCellContent_u3xdj_119",Ln="_error_u3xdj_131",Dn="_warning_u3xdj_132",Fn="_unit_u3xdj_141",$n="_sortingCell_u3xdj_144",On="_sortingCellIcon_u3xdj_155",Bn="_icon_u3xdj_166",Mn="_checkBoxCell_u3xdj_170",Gn="_iconCellWrapper_u3xdj_174",Un="_actionsCell_u3xdj_178",Xn="_rightAligned_u3xdj_186",Jn="_centerAligned_u3xdj_192",Kn="_leftAligned_u3xdj_198",zn="_popover_u3xdj_201",Yn="_disabledPointerEvents_u3xdj_204",i={inputInTable:jn,inputHover:Nn,inputFocus:wn,inputError:An,inputWarning:vn,inputDisabled:Rn,hideScrollbars:Sn,cell:Vn,disabledLink:Tn,inputWrapper:qn,breakWord:En,inputCell:kn,sliderCell:Wn,staticCell:Hn,staticCellContent:Pn,error:Ln,warning:Dn,unit:Fn,sortingCell:$n,sortingCellIcon:On,icon:Bn,checkBoxCell:Mn,iconCellWrapper:Gn,actionsCell:Un,rightAligned:Xn,centerAligned:Jn,leftAligned:Kn,popover:zn,disabledPointerEvents:Yn},te=({cell:e,columnAlignment:t,testId:a})=>n.jsx(Be,{name:e.name,value:e.value,onChange:l=>{var r;return(r=e.onChange)==null?void 0:r.call(e,l)},onPaste:l=>{var r;return(r=e.onPaste)==null?void 0:r.call(e,l)},placeholder:e.placeholder,error:e.error,warning:e.warning,disabled:e.disabled,isInTable:!0,maxTooltipWidth:e.maxTooltipWidth,right:t===b.RIGHT,testId:a,tabIndex:e.disabled?-1:0,tooltip:e.tooltip});try{te.displayName="InputCell",te.__docgenInfo={description:"",displayName:"InputCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"IInputCell"}},columnAlignment:{defaultValue:null,description:"",name:"columnAlignment",required:!1,type:{name:"string"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const re=({cell:e,testId:t})=>n.jsx(Me,{name:e.name,value:e.value,onChange:a=>{var l;return(l=e.onChange)==null?void 0:l.call(e,a)},placeholder:e.placeholder,error:e.error,warning:e.warning,disabled:e.disabled,isInTable:!0,left:e.left,tabIndex:e.disabled?-1:0,testId:t,tooltip:e.tooltip,validationCallback:e.validationCallback,allowEmpty:e.allowEmpty});try{re.displayName="NumberInputCell",re.__docgenInfo={description:"",displayName:"NumberInputCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"INumberInputCell"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const ae=({cell:e,columnAlignment:t,testId:a})=>n.jsx(Ge,{name:e.name,borderRadius:0,options:e.options,onChange:l=>{var r;return(r=e.onChange)==null?void 0:r.call(e,l)},onCreate:e.onCreate?l=>e.onCreate&&e.onCreate(l):void 0,error:e.error,warning:e.warning,disabled:e.disabled,placeholder:e.placeholder,isInTable:!0,value:e.value,native:e.native,clearable:e.clearable,searchable:e.searchable,deprecatedEventHandler:e.deprecatedEventHandler,maxTooltipWidth:e.maxTooltipWidth,width:"100%",autoLayerWidth:e.autoLayerWidth,right:t===b.RIGHT,testId:a,tabIndex:e.disabled?-1:0});try{ae.displayName="SelectCell",ae.__docgenInfo={description:"",displayName:"SelectCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"ISelectCell"}},columnAlignment:{defaultValue:null,description:"",name:"columnAlignment",required:!1,type:{name:"string"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const le=({cell:e,columnAlignment:t,testId:a})=>n.jsx("div",{className:i.inputWrapper,children:e.type==="Input"?n.jsx(te,{cell:e,columnAlignment:t,testId:a}):e.type==="NumberInput"?n.jsx(re,{cell:e,testId:a}):e.type==="Select"?n.jsx(ae,{cell:e,columnAlignment:t,testId:a}):null});try{le.displayName="InputCellWrapper",le.__docgenInfo={description:"",displayName:"InputCellWrapper",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"any"}},columnAlignment:{defaultValue:null,description:"",name:"columnAlignment",required:!0,type:{name:"string"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const oe=({cell:e,testId:t})=>{const a=T.useContext(Ue),{error:l,warning:r,tooltip:o,maxTooltipWidth:s}=e,u=d=>O(d);return n.jsx("div",{className:i.inputWrapper,children:n.jsx(fe,{error:!!l,warning:!!r,text:o||l||r,enabled:u(o)||u(l)||u(r)||!1,maxWidth:s,placement:"bottom-center",children:n.jsx("div",{className:N(i.staticCellContent,l?i.error:r?i.warning:""),children:n.jsx("a",{className:N((e.disabled||a)&&i.disabledLink),onClick:e.disabled||a?void 0:d=>{var p;d.stopPropagation(),(p=e.onClick)==null||p.call(e,d)},"data-testid":t,children:e.value})})})})};try{oe.displayName="LinkCell",oe.__docgenInfo={description:"",displayName:"LinkCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"ILinkCell"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const ie=({cell:e,testId:t})=>n.jsx(Xe,{label:e.label,checked:e.checked,isInTable:!0,disabled:e.disabled,onChange:a=>e.onChange(a),testId:t,tabIndex:e.disabled?-1:0});try{ie.displayName="CheckBoxCell",ie.__docgenInfo={description:"",displayName:"CheckBoxCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"ICheckBoxCell"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const se=({cell:e})=>n.jsx("div",{className:i.inputWrapper,children:n.jsx(Je,{label:e.label,value:e.value,min:e.min,max:e.max,step:e.step,marks:e.marks,onChange:t=>e.onChange(t),showArrows:e.showArrows,showTooltip:e.showTooltip,tooltipFormatter:e.tooltipFormatter,disabled:e.disabled})});try{se.displayName="SliderCell",se.__docgenInfo={description:"",displayName:"SliderCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"ISliderCell"}}}}}catch{}const de=({cell:e})=>{const{tooltip:t,icon:a}=e;return n.jsx("div",{className:i.iconCellWrapper,children:n.jsx(fe,{text:t,enabled:!!t&&O(t),display:"flex",placement:"top-center",children:n.jsx(B,{icon:a})})})};try{de.displayName="IconCell",de.__docgenInfo={description:"",displayName:"IconCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"IIconCell"}}}}}catch{}const ce=({cell:e})=>n.jsx(ye,{actions:e.actions});try{ce.displayName="ActionsCell",ce.__docgenInfo={description:"",displayName:"ActionsCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"IActionCell"}}}}}catch{}const ue=({cell:e})=>{const{helpIcon:t}=e;return t?n.jsx("div",{className:i.icon,children:n.jsx(Ee,{onClick:t.onClick,text:t.tooltip})}):null};try{ue.displayName="CellHelpIcon",ue.__docgenInfo={description:"",displayName:"CellHelpIcon",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"IHelpIconCell"}}}}}catch{}const pe=({cell:e})=>{const{libraryIcon:t}=e;return t?n.jsx("div",{className:i.icon,children:n.jsx(Ee,{onClick:t.onClick,text:t.tooltip,icon:$.LIBRARY})}):null};try{pe.displayName="CellLibraryIcon",pe.__docgenInfo={description:"",displayName:"CellLibraryIcon",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"ILibraryIconCell"}}}}}catch{}const me=({cell:e})=>{const{hasSort:t,sort:a,sortPriority:l}=e;return t?n.jsxs("span",{className:i.sortingCellIcon,children:[a==="down"?n.jsx(ee,{link:!0,children:n.jsx(B,{icon:$.SORT_ASCENDING})}):a==="up"?n.jsx(ee,{link:!0,children:n.jsx(B,{icon:$.SORT_DESCENDING})}):n.jsx(ee,{faint:!0,children:n.jsx(B,{icon:$.SORT_DESCENDING})}),l&&a?n.jsx("sup",{children:l}):null]}):null};try{me.displayName="Sort",me.__docgenInfo={description:"",displayName:"Sort",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"ISortCell"}}}}}catch{}const z=({cell:e,isHeader:t,testId:a})=>{const{error:l,warning:r,tooltip:o,maxTooltipWidth:s,hasSort:u,onSort:d,type:p}=e,c=n.jsxs("div",{className:N(i.staticCellContent,p==="Unit"?i.unit:"",l?i.error:r?i.warning:""),onClick:u?y=>d&&d(y):()=>{},"data-testid":a,children:[e.value,t?n.jsxs(n.Fragment,{children:[n.jsx(ue,{cell:e}),n.jsx(pe,{cell:e}),n.jsx(me,{cell:e})]}):null]});return n.jsx("div",{className:i.inputWrapper,children:n.jsx(fe,{error:!!l,warning:!!r,text:o||l||r,enabled:o&&O(o)||l&&O(l)||r&&O(r)||!1,maxWidth:s,display:"block",placement:"bottom-center",children:c})})};try{z.displayName="StaticCell",z.__docgenInfo={description:"",displayName:"StaticCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"IStaticCell"}},isHeader:{defaultValue:null,description:"",name:"isHeader",required:!1,type:{name:"boolean"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const _e=({cell:e,testId:t})=>{const{content:a,fullWidth:l,closeOnOutsideClick:r,disabled:o}=e;return n.jsx(Ke,{content:a,fullWidth:l,closeOnOutsideClick:r,disabled:o,children:n.jsx("div",{className:i.popover,children:n.jsx(z,{cell:e,testId:t})})})};try{_e.displayName="PopoverCell",_e.__docgenInfo={description:"",displayName:"PopoverCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"IPopoverCell"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const ge=({cell:e,isHeader:t,columnAlignment:a,testId:l})=>{if(!e)return null;switch(e.type){case"Input":case"NumberInput":case"Select":return n.jsx(le,{cell:e,columnAlignment:a,testId:l});case"Link":return n.jsx(oe,{cell:e,testId:l});case"CheckBox":return n.jsx(ie,{cell:e,testId:l});case"Slider":return n.jsx(se,{cell:e});case"Icon":return n.jsx(de,{cell:e});case"Actions":return n.jsx(ce,{cell:e});case"Popover":return n.jsx(_e,{cell:e});default:return n.jsx(z,{cell:e,isHeader:t,testId:l})}};try{ge.displayName="CellWrapper",ge.__docgenInfo={description:"",displayName:"CellWrapper",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"any"}},isHeader:{defaultValue:null,description:"",name:"isHeader",required:!0,type:{name:"boolean"}},columnAlignment:{defaultValue:null,description:"",name:"columnAlignment",required:!0,type:{name:"string"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}var S=(e=>(e.INPUT="Input",e.NUMBER_INPUT="NumberInput",e.SELECT="Select",e.POPOVER="Popover",e.SLIDER="Slider",e.CHECKBOX="CheckBox",e.ACTIONS="Actions",e))(S||{});const Y=({cell:e,isHeader:t,columnHeaderAlignment:a,columnAlignment:l=b.LEFT,width:r,snapshot:o,testId:s})=>{if(!e)return null;const{style:u,colSpan:d,rowSpan:p,width:c}=e,y=T.useRef(null),g={bodyAlignment:l,headerAlignment:a,isHeader:t},P=Te(g,i),x=Te(g,i,!0),L=e.type===S.INPUT||e.type===S.NUMBER_INPUT||e.type===S.SELECT||e.type===S.POPOVER?i.inputCell:e.type===S.SLIDER?i.sliderCell:e.type===S.CHECKBOX?i.checkBoxCell:e.type===S.ACTIONS?i.actionsCell:i.staticCell,w=N(i.cell,L,e.hasSort?i.sortingCell:null,P,e.breakWord?i.breakWord:""),q=c??r??((o==null?void 0:o.isDragging)&&y.current&&y.current.offsetWidth)??void 0,C={width:q,minWidth:q,...u},A=t?"th":"td";return n.jsx(A,{ref:y,className:w,style:C,colSpan:d,rowSpan:p,children:n.jsx(ge,{cell:e,columnAlignment:x??b.RIGHT,isHeader:t,testId:s})})};try{Y.displayName="Cell",Y.__docgenInfo={description:"",displayName:"Cell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!1,type:{name:"TCellShape"}},isHeader:{defaultValue:null,description:"",name:"isHeader",required:!0,type:{name:"boolean"}},columnHeaderAlignment:{defaultValue:null,description:"",name:"columnHeaderAlignment",required:!1,type:{name:"string"}},columnAlignment:{defaultValue:{value:"Align.LEFT"},description:"",name:"columnAlignment",required:!1,type:{name:"Align.LEFT | Align.RIGHT | null"}},width:{defaultValue:null,description:"",name:"width",required:!1,type:{name:"TStringOrNumber"}},snapshot:{defaultValue:null,description:"",name:"snapshot",required:!1,type:{name:"any"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const F=({row:e,rowIndex:t,isHeader:a=!1,columnCount:l,colSpan:r,columnHeaderAlignments:o=[],columnAlignment:s=[],hasRowActions:u,draggableTable:d=!1,snapshot:p=null,provided:c=null,width:y,columnWidths:g,testId:P})=>{const x=T.useRef(null),L=In(o,a,t),{onRowClick:w,onRowFocus:q,onRowMouseEnter:C,onRowMouseLeave:A,expandedContent:I,active:Q}=e,E=e.cells.map((h,v)=>{const he=`${a?0:1}_${t}_${v}`;return n.jsx(Y,{cell:h,isHeader:a,columnAlignment:s[v],columnHeaderAlignment:L[v],width:g?g[v]:void 0,snapshot:p,testId:h.testId},he)}),V=u&&n.jsx(Y,{cell:{type:S.ACTIONS,actions:e.actions},isHeader:a},l),k=(h,v)=>({minWidth:h&&`${y}px`,width:h&&"100%",display:h&&"table",background:h&&"var(--color-background-listitem-active)",border:h&&"var(--color-border)",borderTop:h&&0,opacity:h&&.1,...v}),W=()=>e.noDrag?n.jsx("td",{"aria-labelledby":"unique-label-id"}):n.jsx("td",{className:R.dragIconCell,children:n.jsx("div",{...c.dragHandleProps,className:R.dragIcon,children:n.jsx(B,{icon:$.DRAG})})});return a?n.jsxs(n.Fragment,{children:[n.jsxs("tr",{ref:x,onClick:w,onMouseEnter:C,onMouseLeave:A,onFocus:q,className:N(w?R.clickableRow:null,C?R.hoverableRow:null),children:[d?n.jsx("th",{}):null,E,V]},t),I&&I.content?n.jsx(K,{colSpan:r,flush:I.flush===!0,children:I.content},`${t}_expanded_content`):null]}):n.jsxs(n.Fragment,{children:[n.jsxs("tr",{onClick:w,onMouseEnter:C,onMouseLeave:A,onFocus:q,className:N(w&&!w.noStyle?R.clickableRow:null,C&&!C.noStyle?R.hoverableRow:null,Q?R.rowActive:null),ref:(c==null?void 0:c.innerRef)||null,...(c==null?void 0:c.draggableProps)||null,style:p&&c?k(p.isDragging,c.draggableProps.style):null,children:[d?W():null,E,V]},t),I&&I.content?n.jsx(K,{colSpan:r,flush:I.flush===!0,children:I.content},`${t}_expanded_content`):null]})};try{F.displayName="Row",F.__docgenInfo={description:"",displayName:"Row",props:{row:{defaultValue:null,description:"",name:"row",required:!0,type:{name:"TRowType"}},rowIndex:{defaultValue:null,description:"",name:"rowIndex",required:!0,type:{name:"number"}},isHeader:{defaultValue:{value:"false"},description:"",name:"isHeader",required:!1,type:{name:"boolean"}},columnCount:{defaultValue:null,description:"",name:"columnCount",required:!0,type:{name:"number"}},colSpan:{defaultValue:null,description:"",name:"colSpan",required:!0,type:{name:"number"}},columnHeaderAlignments:{defaultValue:{value:"[]"},description:"",name:"columnHeaderAlignments",required:!1,type:{name:"string[] | string[][]"}},columnAlignment:{defaultValue:{value:"[]"},description:"",name:"columnAlignment",required:!1,type:{name:"string[]"}},hasRowActions:{defaultValue:null,description:"",name:"hasRowActions",required:!0,type:{name:"boolean"}},draggableTable:{defaultValue:{value:"false"},description:"",name:"draggableTable",required:!1,type:{name:"boolean"}},snapshot:{defaultValue:{value:"null"},description:"",name:"snapshot",required:!1,type:{name:"any"}},provided:{defaultValue:{value:"null"},description:"",name:"provided",required:!1,type:{name:"any"}},width:{defaultValue:null,description:"",name:"width",required:!1,type:{name:"TStringOrNumber"}},columnWidths:{defaultValue:null,description:"",name:"columnWidths",required:!1,type:{name:"string[]"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const qe=e=>{var Ie,je,Ne,we,Ae,ve,Re;const{onListReorder:t=()=>{},table:a}=e,{columnWidths:l,footer:r,name:o,rows:s=[],actions:u,actionsRight:d,columnHeaderAlignments:p,columnAlignment:c,striped:y=!0,testId:g,draggable:P,defaultEmptyRow:x=null,onAddRow:L=null,bordered:w=!0,maxHeight:q,fixedWidth:C}=a,A=T.useRef(null),[I,Q]=T.useState({width:0,height:0});T.useEffect(()=>{A.current&&Q({width:A.current.offsetWidth,height:A.current.offsetHeight})},[]);const E=Fe.get(e,"table.headers",[]),V=mn(s,E),k=_n(s,E),W=V+(k?1:0),h=r?((je=(Ie=r==null?void 0:r.pagination)==null?void 0:Ie.rowsPerPage)==null?void 0:je.value)===0||Number((Ne=r==null?void 0:r.pagination)==null?void 0:Ne.selectedPage)>=Number((we=r==null?void 0:r.pagination)==null?void 0:we.rowCount)/Number((ve=(Ae=r==null?void 0:r.pagination)==null?void 0:Ae.rowsPerPage)==null?void 0:ve.value):!0,v=((Re=x==null?void 0:x.cells)==null?void 0:Re.length)&&L&&h,ke={cells:v?x.cells.map((m,j)=>(m==null?void 0:m.type)==="Input"?{...m,onChange:_=>{var M;const f=(M=_==null?void 0:_.target)==null?void 0:M.value,D={...x,cells:x.cells.map((G,We)=>({...G,value:We===j?f:G==null?void 0:G.value}))};L({newRow:D})}}:{...m,disabled:!0}):null,testId:g?`${g}-last-empty-row`:void 0},Z=v?s.concat(ke):s,be={...a,rows:Z},xe=N(H.wrapper,w?H.bordered:""),Ce={maxHeight:q,width:C,display:C==="auto"?"inline-flex":"flex"};return P?n.jsxs("div",{ref:A,className:xe,style:Ce,children:[n.jsx(U,{actions:u,actionsRight:d,name:o,testId:g&&`${g}-title`}),n.jsx(Pe,{onDragEnd:m=>{var f,D;const j=(f=m==null?void 0:m.source)==null?void 0:f.index,_=(D=m==null?void 0:m.destination)==null?void 0:D.index;typeof j=="number"&&typeof _=="number"&&t({from:j,to:_})},children:n.jsx(Le,{droppableId:"droppable",children:m=>n.jsx(J,{table:be,children:({visibleRows:j})=>n.jsxs("table",{className:N(H.table,y?H.striped:""),"data-testid":g,ref:m.innerRef,children:[n.jsx("thead",{children:E.map((_,f)=>n.jsx(F,{rowIndex:f,isHeader:!0,row:_,columnCount:V,columnWidths:l,colSpan:W,hasRowActions:k,columnAlignment:c,columnHeaderAlignments:p,draggableTable:P},`0_${f}`))}),n.jsxs("tbody",{children:[Z.slice(0,j).map((_,f)=>n.jsx(De,{draggableId:f+"",index:f,isDragDisabled:_.noDrag,children:(D,M)=>n.jsx(F,{rowIndex:f,row:_,columnCount:V,columnWidths:l,colSpan:W,hasRowActions:k,columnAlignment:c,provided:D,snapshot:M,draggableTable:P,width:I.width},`1_${f}`)},`index_${f}`)),m.placeholder]})]})})})}),r&&n.jsx(X,{pagination:r.pagination,actions:r.actions,content:r.content})]}):n.jsxs("div",{className:xe,style:Ce,children:[n.jsx(U,{actions:u,actionsRight:d,name:o,testId:g&&`${g}-title`}),n.jsx(J,{table:be,children:({visibleRows:m})=>n.jsxs("table",{className:N(H.table,y?H.striped:""),"data-testid":g,children:[n.jsx("thead",{children:E.map((j,_)=>n.jsx(F,{rowIndex:_,isHeader:!0,row:j,columnCount:V,columnWidths:l,colSpan:W,hasRowActions:k,columnAlignment:c,columnHeaderAlignments:p},`0_${_}`))}),n.jsx("tbody",{children:Z.slice(0,m).map((j,_)=>n.jsx(F,{rowIndex:_,row:j,columnCount:V,columnWidths:l,colSpan:W,hasRowActions:k,columnAlignment:c},`1_${_}`))})]})}),r&&n.jsx(X,{colSpan:W,pagination:r.pagination,actions:r.actions,content:r.content})]})};try{qe.displayName="Table",qe.__docgenInfo={description:"",displayName:"Table",props:{onListReorder:{defaultValue:null,description:"",name:"onListReorder",required:!1,type:{name:"((obj: { from: number; to: number; }) => void)"}},table:{defaultValue:null,description:"",name:"table",required:!0,type:{name:"{ name?: string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null | undefined; ... 18 more ...; actions?: any; }"}}}}}catch{}export{qe as T};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as n}from"./jsx-runtime-f961835c.js";import{r as S}from"./index-f80c8c95.js";import{f as K}from"./immer.esm-5c06d4d0.js";import{l as oe}from"./lodash-75c70a11.js";import{G as se}from"./grid-3b729f81.js";import{T as V}from"./text-ad1f5f1d.js";import{T as A}from"./table-a19b5c53.js";import{C as sn}from"./card-3847c251.js";import{I as ae}from"./input-05f21b51.js";import{F as re}from"./field-248df38c.js";import{H as ln}from"./heading-39e599c8.js";import{t as ne,a as on,b as cn,c as dn,d as un,e as pn,f as gn,g as mn}from"./table.stories-data-ddbcf8c3.js";import"./styled-components.browser.esm-416d73e5.js";import"./tslib.es6-dfef685f.js";import"./index-a80ed1cf.js";import"./index.es-37e2ce0d.js";import"./inheritsLoose-c82a83d4.js";import"./extends-98964cd2.js";import"./redux-10ee6be7.js";import"./objectSpread2-fdee9b6d.js";import"./index-3d476d02.js";import"./memoize-one.esm-52518564.js";import"./icon-8acf9925.js";import"./index-c89a1915.js";import"./disabled-context-d654f6ff.js";import"./actions-83a2a04e.js";import"./common-types-2c81813f.js";import"./button-050c998a.js";import"./spinner-a81ebe38.js";import"./tooltip-856042a7.js";import"./types-cc224262.js";import"./types-332ceaf3.js";import"./badge-20e7ee0b.js";import"./pagination-443065a8.js";import"./select-d4593fc0.js";import"./assertThisInitialized-081f9914.js";import"./select.input-88b6ebab.js";import"./input-group-20c3add3.js";import"./input-group-addon-f8f6683a.js";import"./number-input-7cb3ea4d.js";import"./index-54f0d271.js";import"./check-box-b38490e5.js";import"./help-icon-c0abd380.js";import"./slider-5d5442fe.js";import"./index-c7f280f6.js";import"./popover-c1234faa.js";import"./label-e6d15b59.js";import"./flex-1d14d86c.js";const ct={title:"Basic/Table",component:A,args:{table:{...ne}}},I=g=>n.jsx(A,{...g}),B=I.bind({}),_=I.bind({});_.args={table:{...ne,fixedWidth:"400px"}};const M=I.bind({});M.args={table:{...ne,fixedWidth:"auto"}};const O=I.bind({});O.args={table:on};O.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 L=I.bind({});L.args={table:cn};const U=I.bind({});U.args={table:dn};U.parameters={docs:{description:{story:"This is only required when you need to override `columnAlignment` in header cells (i.e. they have different alignment)"}}};const Q=I.bind({});Q.args={table:un};const E=I.bind({});E.args={table:pn};E.decorators=[g=>n.jsx("div",{style:{position:"absolute",inset:0,padding:"var(--padding)"},children:n.jsx(g,{})})];const N=I.bind({});N.args={table:gn};N.parameters={docs:{description:{story:"If a `maxHeight` is set, the table should only fill that height if it needs to."}}};const G=I.bind({});G.args={table:mn};const q=()=>n.jsx(sn,{heading:n.jsx(ln,{children:"Card heading"}),padding:!1,children:n.jsx(A,{table:{...ne,bordered:!1}})});q.parameters={docs:{source:{type:"dynamic"}}};const z=()=>{const g=["Section","Width","Height"];let u=["","m","m"],r=[...Array(175).keys()].map((s,t)=>[t,t*2,t*2]);const T=(s,t,i)=>s==="m"&&t==="ft"?i*3.28084:s==="ft"&&t==="m"?i/3.28084:i,o=(s,t,i,p)=>{r[t][i]=s.target.value,p()},C=s=>{r=r.concat([["","",""]]),s()},k=(s,t)=>{r=r.filter((i,p)=>p!==s),t()},d=(s,t,i)=>{const p=u[t],y=s.target.value;u=u.map((R,h)=>h===t?y:R),r=r.map(R=>R.map((h,b)=>b===t?T(p,y,h):h)),i()},m=()=>{const s=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[t,i]=S.useState(10),[p,y]=S.useState(1),[R,h]=S.useState(!1),b=()=>{h(!R)},W=()=>{const e=Math.ceil(r.length/t);y(e)},D=(p-1)*t,a=t===0?r.length-1:D+t,c={headers:[{cells:g.map(e=>({value:e})),actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{C(b),W()}}]},{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(D,a).map((e,l)=>{const P=D+l;return{cells:[...Array(3).keys()].map((f,w)=>({value:e[w],type:"Input",onChange:x=>o(x,P,w,b)})),actions:[{label:"Delete",icon:"minus",onClick:()=>k(P,b)}]}}),footer:{pagination:{rowCount:r.length,selectedPage:p,rowsPerPage:{onChange:e=>{const{value:l}=e.target;i(Number(l))},options:s,value:t},onSelectPage:e=>y(e),small:!0}}};return n.jsx(A,{table:c})};return n.jsx(m,{})},J=()=>{const g=["Section","Width","Height"];let u=[...Array(175).keys()].map((T,o)=>({Section:o,Width:o*2,Height:o*2}));const r=()=>{const T=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[o,C]=S.useState(10),[k,d]=S.useState(1),[m,s]=S.useState({}),[t,i]=S.useState({});S.useEffect(()=>{d(1)},[m,t]);const p=(k-1)*o,y=o===0?u.length-1:p+o,R=(e,l,P)=>e.filter(f=>Object.keys(l).every(w=>l[w]===""?!0:f[w].toString().includes(l[w]))).sort((f,w)=>Object.entries(P).map(([x,F])=>{switch(F){case"up":return f[x]-w[x];case"down":return w[x]-f[x];default:return 0}}).reduce((x,F)=>x||F,0)),h=(e,l,P,f,w)=>{const x=e.map(v=>{const j=Object.keys(f).includes(v)?f[v]:"",H=`${v[0].toUpperCase()}${v.slice(1)}`;return{key:v,value:H,hasSort:!0,sort:j,onSort:()=>{const $=j===""?"up":j==="up"?"down":"";w({...f,[v]:$})}}}),F=e.map(v=>{const j=Object.keys(l).includes(v)?l[v]:"";return{key:v,value:j,type:"Input",placeholder:"Filter",onChange:H=>P({...l,[v]:H.target.value})}});return{dataSortCells:x,dataFilterCells:F}},{dataSortCells:b,dataFilterCells:W}=h(g,m,s,t,i),D=R(u,m,t),a=[...D.slice(p,y).map(e=>({cells:Object.entries(e).map(([P,f])=>({key:P,value:f,type:"Input",disabled:!0}))}))],c={headers:[{cells:b},{cells:W}],rows:a,footer:{pagination:{rowCount:D.length,selectedPage:k,rowsPerPage:{onChange:e=>{const{value:l}=e.target;C(Number(l))},options:T,value:o},onSelectPage:e=>d(e),small:!0}}};return n.jsx(A,{table:c})};return n.jsx(r,{})},X=()=>{const g={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"}]},T=[...Array(15).keys()].map((a,c)=>({cells:[{type:"Select",options:u,value:{value:"tea"}},{type:"Input",value:c+1},{type:"Static"}]})),[o,C]=S.useState(T),k=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[d,m]=S.useState(10),[s,t]=S.useState(1),i=(s-1)*d,p=d===0?o.length-1:i+d,y=({newRow:a}={})=>{const c=K(o,e=>{e.push(a??r)});C(c)},R=({rowIndex:a})=>{const c=K(o,e=>{delete e[a]}).filter(e=>e);C(c)},h=({rowIndex:a,value:c})=>{const e=K(o,l=>{l[a].cells[0].value.value=c});C(e)},b=({rowIndex:a,value:c})=>{const e=K(o,l=>{l[a].cells[1].value=c});C(e)},W=({value:a})=>{const c=Number(a);return!oe.isNaN(c)&&oe.isInteger(c)&&c>0},D=o.slice(i,p).map((a,c)=>{const e=i+c;return o.length-1,{...a,cells:a==null?void 0:a.cells.map((l,P)=>{var v,j,H,$,le;const f=(H=(j=(v=a==null?void 0:a.cells)==null?void 0:v[0])==null?void 0:j.value)==null?void 0:H.value,w=Number((le=($=a==null?void 0:a.cells)==null?void 0:$[1])==null?void 0:le.value),x=g==null?void 0:g[f],F=x&&W({value:w})?(x*w).toFixed(2):null;if(P===0)return{...l,onChange:te=>h({rowIndex:e,value:te.target.value})};if(P===1)return{...l,onChange:te=>b({rowIndex:e,value:te.target.value}),error:W({value:l.value})?null:"Must be valid whole number"};if(P===2)return{...l,value:F}}),actions:[{label:"Delete",icon:"minus",onClick:()=>R({rowIndex:e})}]}});return n.jsx(A,{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:D,footer:{pagination:{rowCount:o.length,selectedPage:s,rowsPerPage:{onChange:a=>{const{value:c}=a.target;m(Number(c))},options:k,value:d},onSelectPage:a=>t(a),small:!0}}}})},Y=()=>{const g=["Section","Width","Height"];let u=Array.from(Array(10),(d,m)=>[m,m*2,m*2]);const[r,T]=S.useState({pastedValues:"",rowIndex:0,cellIndex:0}),o=(d,m,s,t)=>{u[m][s]=Number(d.target.value),t()},C=(d,m,s,t)=>{var p;let i=((p=d==null?void 0:d.clipboardData)==null?void 0:p.getData("text"))??"";return T({rowIndex:m,cellIndex:s,pastedValues:i}),t(),{pastedData:r}},k=()=>{const[d,m]=S.useState(!1),s=()=>{m(!d)},t={headers:[{cells:g.map(i=>({value:i}))}],rows:u.map((i,p)=>{const y=p;return{cells:[...Array(3).keys()].map((R,h)=>({value:i[h],type:"Input",onChange:b=>o(b,y,h,s),onPaste:b=>C(b,y,h,s)}))}})};return n.jsxs(n.Fragment,{children:[n.jsx(A,{table:t}),n.jsx(re,{label:"Pasted Data",children:n.jsx(ae,{value:r.pastedValues})}),n.jsx(re,{label:"At Row",children:n.jsx(ae,{value:r.rowIndex})}),n.jsx(re,{label:"At Cell Index",children:n.jsx(ae,{value:r.cellIndex})})]})};return n.jsx(k,{})},Z=()=>{const g={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((T,o)=>({value:123.45})),actions:[{icon:"help",tooltip:n.jsxs(se,{children:[n.jsx(V,{bold:!0,children:"Title goes here lorem ipsum"}),n.jsx(V,{children:"Label: 123.45m"}),n.jsx(V,{children:"Another label: 123.45m"}),n.jsx(V,{children:"Label: 123.45m"})]})}]}))};return n.jsx(A,{table:g})},ee=()=>{const g={fixedWidth:"auto",name:"Table title",actions:[{icon:"download",tooltip:"Download"}],headers:[{cells:[{value:"Label"},{value:"Value",colSpan:2}]}],rows:[{cells:[{value:"Country",style:{fontWeight:"bold"},width:"120px"},{value:"Norway",colSpan:2}],actions:[{icon:"help",tooltip:n.jsxs(se,{children:[n.jsx(V,{bold:!0,children:"Title goes here"}),n.jsx(V,{children:"Details go here"})]})}]},{cells:[{value:"Depth",style:{fontWeight:"bold"}},{value:123,width:"80px"},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:{label:"m",value:"m"},type:"Select",width:"80px"}],actions:[{icon:"help",tooltip:n.jsxs(se,{children:[n.jsx(V,{bold:!0,children:"Title goes here"}),n.jsx(V,{children:"Details go here"})]})}]}]};return n.jsx(A,{table:g})};var ie,ce,de;B.parameters={...B.parameters,docs:{...(ie=B.parameters)==null?void 0:ie.docs,source:{originalSource:`args => {
|
|
1
|
+
import{j as n}from"./jsx-runtime-f961835c.js";import{r as S}from"./index-f80c8c95.js";import{f as K}from"./immer.esm-5c06d4d0.js";import{l as oe}from"./lodash-75c70a11.js";import{G as se}from"./grid-3b729f81.js";import{T as V}from"./text-ad1f5f1d.js";import{T as A}from"./table-134da40b.js";import{C as sn}from"./card-3847c251.js";import{I as ae}from"./input-05f21b51.js";import{F as re}from"./field-248df38c.js";import{H as ln}from"./heading-39e599c8.js";import{t as ne,a as on,b as cn,c as dn,d as un,e as pn,f as gn,g as mn}from"./table.stories-data-ddbcf8c3.js";import"./styled-components.browser.esm-416d73e5.js";import"./tslib.es6-dfef685f.js";import"./index-a80ed1cf.js";import"./index.es-37e2ce0d.js";import"./inheritsLoose-c82a83d4.js";import"./extends-98964cd2.js";import"./redux-10ee6be7.js";import"./objectSpread2-fdee9b6d.js";import"./index-3d476d02.js";import"./memoize-one.esm-52518564.js";import"./icon-8acf9925.js";import"./index-c89a1915.js";import"./disabled-context-d654f6ff.js";import"./actions-83a2a04e.js";import"./common-types-2c81813f.js";import"./button-050c998a.js";import"./spinner-a81ebe38.js";import"./tooltip-856042a7.js";import"./types-cc224262.js";import"./types-332ceaf3.js";import"./badge-20e7ee0b.js";import"./pagination-443065a8.js";import"./select-d4593fc0.js";import"./assertThisInitialized-081f9914.js";import"./select.input-88b6ebab.js";import"./input-group-20c3add3.js";import"./input-group-addon-f8f6683a.js";import"./number-input-cfbd9eb7.js";import"./index-57d7693e.js";import"./index-54f0d271.js";import"./check-box-b38490e5.js";import"./help-icon-c0abd380.js";import"./slider-5d5442fe.js";import"./index-c7f280f6.js";import"./popover-c1234faa.js";import"./label-e6d15b59.js";import"./flex-1d14d86c.js";const dt={title:"Basic/Table",component:A,args:{table:{...ne}}},I=g=>n.jsx(A,{...g}),B=I.bind({}),_=I.bind({});_.args={table:{...ne,fixedWidth:"400px"}};const M=I.bind({});M.args={table:{...ne,fixedWidth:"auto"}};const O=I.bind({});O.args={table:on};O.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 L=I.bind({});L.args={table:cn};const U=I.bind({});U.args={table:dn};U.parameters={docs:{description:{story:"This is only required when you need to override `columnAlignment` in header cells (i.e. they have different alignment)"}}};const Q=I.bind({});Q.args={table:un};const E=I.bind({});E.args={table:pn};E.decorators=[g=>n.jsx("div",{style:{position:"absolute",inset:0,padding:"var(--padding)"},children:n.jsx(g,{})})];const N=I.bind({});N.args={table:gn};N.parameters={docs:{description:{story:"If a `maxHeight` is set, the table should only fill that height if it needs to."}}};const G=I.bind({});G.args={table:mn};const q=()=>n.jsx(sn,{heading:n.jsx(ln,{children:"Card heading"}),padding:!1,children:n.jsx(A,{table:{...ne,bordered:!1}})});q.parameters={docs:{source:{type:"dynamic"}}};const z=()=>{const g=["Section","Width","Height"];let u=["","m","m"],r=[...Array(175).keys()].map((s,t)=>[t,t*2,t*2]);const T=(s,t,i)=>s==="m"&&t==="ft"?i*3.28084:s==="ft"&&t==="m"?i/3.28084:i,o=(s,t,i,p)=>{r[t][i]=s.target.value,p()},C=s=>{r=r.concat([["","",""]]),s()},k=(s,t)=>{r=r.filter((i,p)=>p!==s),t()},d=(s,t,i)=>{const p=u[t],y=s.target.value;u=u.map((R,h)=>h===t?y:R),r=r.map(R=>R.map((h,b)=>b===t?T(p,y,h):h)),i()},m=()=>{const s=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[t,i]=S.useState(10),[p,y]=S.useState(1),[R,h]=S.useState(!1),b=()=>{h(!R)},W=()=>{const e=Math.ceil(r.length/t);y(e)},D=(p-1)*t,a=t===0?r.length-1:D+t,c={headers:[{cells:g.map(e=>({value:e})),actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{C(b),W()}}]},{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(D,a).map((e,l)=>{const P=D+l;return{cells:[...Array(3).keys()].map((f,w)=>({value:e[w],type:"Input",onChange:x=>o(x,P,w,b)})),actions:[{label:"Delete",icon:"minus",onClick:()=>k(P,b)}]}}),footer:{pagination:{rowCount:r.length,selectedPage:p,rowsPerPage:{onChange:e=>{const{value:l}=e.target;i(Number(l))},options:s,value:t},onSelectPage:e=>y(e),small:!0}}};return n.jsx(A,{table:c})};return n.jsx(m,{})},J=()=>{const g=["Section","Width","Height"];let u=[...Array(175).keys()].map((T,o)=>({Section:o,Width:o*2,Height:o*2}));const r=()=>{const T=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[o,C]=S.useState(10),[k,d]=S.useState(1),[m,s]=S.useState({}),[t,i]=S.useState({});S.useEffect(()=>{d(1)},[m,t]);const p=(k-1)*o,y=o===0?u.length-1:p+o,R=(e,l,P)=>e.filter(f=>Object.keys(l).every(w=>l[w]===""?!0:f[w].toString().includes(l[w]))).sort((f,w)=>Object.entries(P).map(([x,F])=>{switch(F){case"up":return f[x]-w[x];case"down":return w[x]-f[x];default:return 0}}).reduce((x,F)=>x||F,0)),h=(e,l,P,f,w)=>{const x=e.map(v=>{const j=Object.keys(f).includes(v)?f[v]:"",H=`${v[0].toUpperCase()}${v.slice(1)}`;return{key:v,value:H,hasSort:!0,sort:j,onSort:()=>{const $=j===""?"up":j==="up"?"down":"";w({...f,[v]:$})}}}),F=e.map(v=>{const j=Object.keys(l).includes(v)?l[v]:"";return{key:v,value:j,type:"Input",placeholder:"Filter",onChange:H=>P({...l,[v]:H.target.value})}});return{dataSortCells:x,dataFilterCells:F}},{dataSortCells:b,dataFilterCells:W}=h(g,m,s,t,i),D=R(u,m,t),a=[...D.slice(p,y).map(e=>({cells:Object.entries(e).map(([P,f])=>({key:P,value:f,type:"Input",disabled:!0}))}))],c={headers:[{cells:b},{cells:W}],rows:a,footer:{pagination:{rowCount:D.length,selectedPage:k,rowsPerPage:{onChange:e=>{const{value:l}=e.target;C(Number(l))},options:T,value:o},onSelectPage:e=>d(e),small:!0}}};return n.jsx(A,{table:c})};return n.jsx(r,{})},X=()=>{const g={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"}]},T=[...Array(15).keys()].map((a,c)=>({cells:[{type:"Select",options:u,value:{value:"tea"}},{type:"Input",value:c+1},{type:"Static"}]})),[o,C]=S.useState(T),k=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[d,m]=S.useState(10),[s,t]=S.useState(1),i=(s-1)*d,p=d===0?o.length-1:i+d,y=({newRow:a}={})=>{const c=K(o,e=>{e.push(a??r)});C(c)},R=({rowIndex:a})=>{const c=K(o,e=>{delete e[a]}).filter(e=>e);C(c)},h=({rowIndex:a,value:c})=>{const e=K(o,l=>{l[a].cells[0].value.value=c});C(e)},b=({rowIndex:a,value:c})=>{const e=K(o,l=>{l[a].cells[1].value=c});C(e)},W=({value:a})=>{const c=Number(a);return!oe.isNaN(c)&&oe.isInteger(c)&&c>0},D=o.slice(i,p).map((a,c)=>{const e=i+c;return o.length-1,{...a,cells:a==null?void 0:a.cells.map((l,P)=>{var v,j,H,$,le;const f=(H=(j=(v=a==null?void 0:a.cells)==null?void 0:v[0])==null?void 0:j.value)==null?void 0:H.value,w=Number((le=($=a==null?void 0:a.cells)==null?void 0:$[1])==null?void 0:le.value),x=g==null?void 0:g[f],F=x&&W({value:w})?(x*w).toFixed(2):null;if(P===0)return{...l,onChange:te=>h({rowIndex:e,value:te.target.value})};if(P===1)return{...l,onChange:te=>b({rowIndex:e,value:te.target.value}),error:W({value:l.value})?null:"Must be valid whole number"};if(P===2)return{...l,value:F}}),actions:[{label:"Delete",icon:"minus",onClick:()=>R({rowIndex:e})}]}});return n.jsx(A,{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:D,footer:{pagination:{rowCount:o.length,selectedPage:s,rowsPerPage:{onChange:a=>{const{value:c}=a.target;m(Number(c))},options:k,value:d},onSelectPage:a=>t(a),small:!0}}}})},Y=()=>{const g=["Section","Width","Height"];let u=Array.from(Array(10),(d,m)=>[m,m*2,m*2]);const[r,T]=S.useState({pastedValues:"",rowIndex:0,cellIndex:0}),o=(d,m,s,t)=>{u[m][s]=Number(d.target.value),t()},C=(d,m,s,t)=>{var p;let i=((p=d==null?void 0:d.clipboardData)==null?void 0:p.getData("text"))??"";return T({rowIndex:m,cellIndex:s,pastedValues:i}),t(),{pastedData:r}},k=()=>{const[d,m]=S.useState(!1),s=()=>{m(!d)},t={headers:[{cells:g.map(i=>({value:i}))}],rows:u.map((i,p)=>{const y=p;return{cells:[...Array(3).keys()].map((R,h)=>({value:i[h],type:"Input",onChange:b=>o(b,y,h,s),onPaste:b=>C(b,y,h,s)}))}})};return n.jsxs(n.Fragment,{children:[n.jsx(A,{table:t}),n.jsx(re,{label:"Pasted Data",children:n.jsx(ae,{value:r.pastedValues})}),n.jsx(re,{label:"At Row",children:n.jsx(ae,{value:r.rowIndex})}),n.jsx(re,{label:"At Cell Index",children:n.jsx(ae,{value:r.cellIndex})})]})};return n.jsx(k,{})},Z=()=>{const g={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((T,o)=>({value:123.45})),actions:[{icon:"help",tooltip:n.jsxs(se,{children:[n.jsx(V,{bold:!0,children:"Title goes here lorem ipsum"}),n.jsx(V,{children:"Label: 123.45m"}),n.jsx(V,{children:"Another label: 123.45m"}),n.jsx(V,{children:"Label: 123.45m"})]})}]}))};return n.jsx(A,{table:g})},ee=()=>{const g={fixedWidth:"auto",name:"Table title",actions:[{icon:"download",tooltip:"Download"}],headers:[{cells:[{value:"Label"},{value:"Value",colSpan:2}]}],rows:[{cells:[{value:"Country",style:{fontWeight:"bold"},width:"120px"},{value:"Norway",colSpan:2}],actions:[{icon:"help",tooltip:n.jsxs(se,{children:[n.jsx(V,{bold:!0,children:"Title goes here"}),n.jsx(V,{children:"Details go here"})]})}]},{cells:[{value:"Depth",style:{fontWeight:"bold"}},{value:123,width:"80px"},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:{label:"m",value:"m"},type:"Select",width:"80px"}],actions:[{icon:"help",tooltip:n.jsxs(se,{children:[n.jsx(V,{bold:!0,children:"Title goes here"}),n.jsx(V,{children:"Details go here"})]})}]}]};return n.jsx(A,{table:g})};var ie,ce,de;B.parameters={...B.parameters,docs:{...(ie=B.parameters)==null?void 0:ie.docs,source:{originalSource:`args => {
|
|
2
2
|
return <Table
|
|
3
3
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
4
4
|
{...args} />;
|
|
@@ -693,4 +693,4 @@ import{j as n}from"./jsx-runtime-f961835c.js";import{r as S}from"./index-f80c8c9
|
|
|
693
693
|
}]
|
|
694
694
|
};
|
|
695
695
|
return <Table table={table} />;
|
|
696
|
-
}`,...(rn=(an=ee.parameters)==null?void 0:an.docs)==null?void 0:rn.source}}};const
|
|
696
|
+
}`,...(rn=(an=ee.parameters)==null?void 0:an.docs)==null?void 0:rn.source}}};const ut=["Default","FixedWidth","AutoWidth","ColumnWidths","ColumnAlignment","ColumnHeaderAlignment","InfiniteScrollFixedHeight","InfiniteScrollFullHeight","InfiniteScrollShort","InfiniteScrollWithDragAndDrop","InCard","Managed","ManagedWithFilterAndSort","AutoAddNewRow","OnPasteCallback","ExampleTableWithInfoTooltips","ExampleTableWithInlineUnits"];export{X as AutoAddNewRow,M as AutoWidth,L as ColumnAlignment,U as ColumnHeaderAlignment,O as ColumnWidths,B as Default,Z as ExampleTableWithInfoTooltips,ee as ExampleTableWithInlineUnits,_ as FixedWidth,q as InCard,Q as InfiniteScrollFixedHeight,E as InfiniteScrollFullHeight,N as InfiniteScrollShort,G as InfiniteScrollWithDragAndDrop,z as Managed,J as ManagedWithFilterAndSort,Y as OnPasteCallback,ut as __namedExportsOrder,dt 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-856042a7.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:'"
|
|
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-856042a7.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:'"vertical"'},{value:'"initial"'},{value:'"-moz-initial"'},{value:'"inherit"'},{value:'"revert"'},{value:'"revert-layer"'},{value:'"unset"'},{value:'"inline"'},{value:'"none"'},{value:'"block"'},{value:'"both"'},{value:'"horizontal"'}]}},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-5ebdd171.js";import"./index-f80c8c95.js";import"./index-a80ed1cf.js";import"./types-332ceaf3.js";import"./lodash-75c70a11.js";import"./disabled-context-d654f6ff.js";import"./tooltip-856042a7.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({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as B}from"./jsx-runtime-f961835c.js";import{T as X}from"./table-
|
|
1
|
+
import{j as B}from"./jsx-runtime-f961835c.js";import{T as X}from"./table-134da40b.js";import{t as O,h as W,i as q,j as z,k as D,l as G,m as K,n as M,o as P,p as Q}from"./table.stories-data-ddbcf8c3.js";import"./index-f80c8c95.js";import"./index-a80ed1cf.js";import"./index.es-37e2ce0d.js";import"./inheritsLoose-c82a83d4.js";import"./extends-98964cd2.js";import"./redux-10ee6be7.js";import"./objectSpread2-fdee9b6d.js";import"./index-3d476d02.js";import"./memoize-one.esm-52518564.js";import"./icon-8acf9925.js";import"./tslib.es6-dfef685f.js";import"./index-c89a1915.js";import"./disabled-context-d654f6ff.js";import"./lodash-75c70a11.js";import"./actions-83a2a04e.js";import"./common-types-2c81813f.js";import"./button-050c998a.js";import"./spinner-a81ebe38.js";import"./tooltip-856042a7.js";import"./types-cc224262.js";import"./types-332ceaf3.js";import"./badge-20e7ee0b.js";import"./heading-39e599c8.js";import"./help-icon-c0abd380.js";import"./pagination-443065a8.js";import"./select-d4593fc0.js";import"./assertThisInitialized-081f9914.js";import"./text-ad1f5f1d.js";import"./select.input-88b6ebab.js";import"./input-05f21b51.js";import"./input-group-20c3add3.js";import"./input-group-addon-f8f6683a.js";import"./number-input-cfbd9eb7.js";import"./index-57d7693e.js";import"./index-54f0d271.js";import"./check-box-b38490e5.js";import"./slider-5d5442fe.js";import"./index-c7f280f6.js";import"./popover-c1234faa.js";import"./flex-1d14d86c.js";const Br={title:"Basic/Table/Title & Header",component:X,args:{table:{...O}}},r=k=>B.jsx(X,{...k}),e=r.bind({});e.args={table:W};const s=r.bind({});s.args={table:q};const a=r.bind({});a.args={table:z};const t=r.bind({});t.args={table:D};const o=r.bind({});o.args={table:G};const n=r.bind({});n.args={table:K};const i=r.bind({});i.args={table:M};const p=r.bind({});p.args={table:P};const l=r.bind({});l.args={table:Q};var m,c,d;e.parameters={...e.parameters,docs:{...(m=e.parameters)==null?void 0:m.docs,source:{originalSource:`args => {
|
|
2
2
|
return <Table
|
|
3
3
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
4
4
|
{...args} />;
|
|
@@ -34,4 +34,4 @@ import{j as B}from"./jsx-runtime-f961835c.js";import{T as X}from"./table-a19b5c5
|
|
|
34
34
|
return <Table
|
|
35
35
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
36
36
|
{...args} />;
|
|
37
|
-
}`,...(E=(_=l.parameters)==null?void 0:_.docs)==null?void 0:E.source}}};const
|
|
37
|
+
}`,...(E=(_=l.parameters)==null?void 0:_.docs)==null?void 0:E.source}}};const Or=["Units","ActiveRow","Title","TitleJSX","ChildComponent","Filter","Sort","HeaderActionsNoLabel","HelpAndLibraryIcons"];export{s as ActiveRow,o as ChildComponent,n as Filter,p as HeaderActionsNoLabel,l as HelpAndLibraryIcons,i as Sort,a as Title,t as TitleJSX,e as Units,Or as __namedExportsOrder,Br as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as n}from"./jsx-runtime-f961835c.js";import{c as u}from"./index-a80ed1cf.js";import{I as N}from"./icon-8acf9925.js";import{T as b}from"./common-types-2c81813f.js";import{B as x}from"./button-050c998a.js";import{M as v}from"./actions-83a2a04e.js";import{r as T}from"./index-f80c8c95.js";import{D as q}from"./disabled-context-d654f6ff.js";const V="_topbar_gmfjn_11",C="_fixed_gmfjn_21",k="_appSwitcher_gmfjn_29",E="_title_gmfjn_75",I="_logo_gmfjn_91",M="_label_gmfjn_94",B="_brand_gmfjn_99",w="_version_gmfjn_104",L="_left_gmfjn_111",H="_right_gmfjn_112",O="_item_gmfjn_126",S="_link_gmfjn_127",A="_button_gmfjn_139",P="_menu_gmfjn_140",R="_active_gmfjn_168",D="_alert_gmfjn_193",a={topbar:V,fixed:C,appSwitcher:k,title:E,logo:I,label:M,brand:B,version:w,left:L,right:H,item:O,link:S,button:A,menu:P,active:R,alert:D},f=({warning:e})=>n.jsx("div",{className:a.alert,children:e});try{f.displayName="Warning",f.__docgenInfo={description:"",displayName:"Warning",props:{warning:{defaultValue:null,description:"",name:"warning",required:!0,type:{name:"ReactNode"}}}}}catch{}const g=({icon:e,url:t,onClick:i})=>{const r=n.jsx(N,{icon:e});return t?n.jsx("a",{href:t,onClick:i,className:a.appSwitcher,children:r}):n.jsx("div",{onClick:i,className:a.appSwitcher,children:r})};try{g.displayName="AppSwitcher",g.__docgenInfo={description:"",displayName:"AppSwitcher",props:{icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},url:{defaultValue:null,description:"",name:"url",required:!1,type:{name:"string"}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"MouseEventHandler<
|
|
1
|
+
import{j as n}from"./jsx-runtime-f961835c.js";import{c as u}from"./index-a80ed1cf.js";import{I as N}from"./icon-8acf9925.js";import{T as b}from"./common-types-2c81813f.js";import{B as x}from"./button-050c998a.js";import{M as v}from"./actions-83a2a04e.js";import{r as T}from"./index-f80c8c95.js";import{D as q}from"./disabled-context-d654f6ff.js";const V="_topbar_gmfjn_11",C="_fixed_gmfjn_21",k="_appSwitcher_gmfjn_29",E="_title_gmfjn_75",I="_logo_gmfjn_91",M="_label_gmfjn_94",B="_brand_gmfjn_99",w="_version_gmfjn_104",L="_left_gmfjn_111",H="_right_gmfjn_112",O="_item_gmfjn_126",S="_link_gmfjn_127",A="_button_gmfjn_139",P="_menu_gmfjn_140",R="_active_gmfjn_168",D="_alert_gmfjn_193",a={topbar:V,fixed:C,appSwitcher:k,title:E,logo:I,label:M,brand:B,version:w,left:L,right:H,item:O,link:S,button:A,menu:P,active:R,alert:D},f=({warning:e})=>n.jsx("div",{className:a.alert,children:e});try{f.displayName="Warning",f.__docgenInfo={description:"",displayName:"Warning",props:{warning:{defaultValue:null,description:"",name:"warning",required:!0,type:{name:"ReactNode"}}}}}catch{}const g=({icon:e,url:t,onClick:i})=>{const r=n.jsx(N,{icon:e});return t?n.jsx("a",{href:t,onClick:i,className:a.appSwitcher,children:r}):n.jsx("div",{onClick:i,className:a.appSwitcher,children:r})};try{g.displayName="AppSwitcher",g.__docgenInfo={description:"",displayName:"AppSwitcher",props:{icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},url:{defaultValue:null,description:"",name:"url",required:!1,type:{name:"string"}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"MouseEventHandler<HTMLAnchorElement | HTMLDivElement>"}}}}}catch{}const h=({label:e,logo:t,url:i,version:r,onClick:s})=>{const o=n.jsxs("div",{className:a.title,children:[t&&n.jsx("div",{className:a.logo,children:t}),e&&n.jsx("span",{className:a.label,children:e}),r&&n.jsx("div",{className:a.version,children:r})]});return n.jsx("div",{className:u(a.item,a.brand),children:i?n.jsx("a",{href:i,onClick:s,children:o}):n.jsx("div",{onClick:s,children:o})})};try{h.displayName="Title",h.__docgenInfo={description:"",displayName:"Title",props:{label:{defaultValue:null,description:"",name:"label",required:!1,type:{name:"string | null"}},logo:{defaultValue:null,description:"",name:"logo",required:!1,type:{name:"ReactNode"}},url:{defaultValue:null,description:"",name:"url",required:!1,type:{name:"string"}},version:{defaultValue:null,description:"",name:"version",required:!1,type:{name:"TStringOrNumber"}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"MouseEventHandler<HTMLAnchorElement | HTMLDivElement>"}}}}}catch{}var d=(e=>(e.LINK="Link",e.BUTTON="Button",e.MENU="Menu",e.COMPONENT="Component",e))(d||{});const p=({label:e,url:t,icon:i,onClick:r,active:s,disabled:o,testId:_})=>{const l=T.useContext(q),c=y=>{(o||l)&&y.preventDefault(),r==null||r(y)};return n.jsxs("a",{className:u(a.link,s?a.active:""),href:t||"#",onClick:c,"aria-disabled":o||l,"data-testid":_,role:r&&!t?"button":void 0,children:[i,n.jsx("span",{className:a.label,children:e})]})};try{p.displayName="Link",p.__docgenInfo={description:"",displayName:"Link",props:{label:{defaultValue:null,description:"",name:"label",required:!1,type:{name:"string | null"}},url:{defaultValue:null,description:"",name:"url",required:!1,type:{name:"string"}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"MouseEventHandler<HTMLAnchorElement>"}},active:{defaultValue:null,description:"",name:"active",required:!1,type:{name:"boolean"}},disabled:{defaultValue:null,description:"",name:"disabled",required:!1,type:{name:"boolean"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const m=({element:e})=>{switch(e.type){case d.LINK:return n.jsx("div",{className:a.item,children:n.jsx(p,{label:e.label,url:e.url,icon:e.icon,onClick:e.onClick,active:e.active,disabled:e.disabled,testId:e.testId})});case d.BUTTON:return n.jsx("div",{className:u(a.item,a.button),children:n.jsx(x,{label:e.label,colored:e.colored,pill:!0,disabled:e.disabled,onClick:e.onClick,icon:e.icon,testId:e.testId})});case d.MENU:return n.jsx("div",{className:u(a.item,a.menu),children:n.jsx(v,{maxHeight:"100%",menu:{trigger:b.COMPONENT,fullHeightTrigger:!0,placement:"bottom-start",component:n.jsx(p,{label:e.label,icon:e.icon,onClick:e.onClick}),sections:e.sections}})});case d.COMPONENT:return n.jsx("div",{className:a.item,children:e.component});default:return null}};try{m.displayName="Element",m.__docgenInfo={description:"",displayName:"Element",props:{element:{defaultValue:null,description:"",name:"element",required:!0,type:{name:"TLinkElement | TButtonElement | TMenuElement | TComponentElement"}}}}}catch{}const j=({title:e,appSwitcher:t,content:i=[],contentRight:r=[],warning:s="",height:o="var(--size-topbar)",fixedPosition:_=!0})=>n.jsxs("div",{children:[s&&n.jsx(f,{warning:s}),n.jsxs("div",{className:u(a.topbar,_?a.fixed:""),style:{height:o},children:[!!t&&n.jsx(g,{icon:t.icon,url:t.url,onClick:t.onClick}),n.jsxs("div",{className:a.left,children:[e&&n.jsx(h,{label:e.label,logo:e.logo,url:e.url,version:e.version,onClick:e.onClick}),i.map((l,c)=>l?n.jsx(m,{element:l},c):null)]}),n.jsx("div",{className:a.right,children:r.map((l,c)=>l?n.jsx(m,{element:l},c):null)})]})]});try{j.displayName="TopBar",j.__docgenInfo={description:"",displayName:"TopBar",props:{title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"ITopBarTitleProps"}},appSwitcher:{defaultValue:null,description:"",name:"appSwitcher",required:!1,type:{name:"ITopBarAppSwitcherProps"}},content:{defaultValue:{value:"[]"},description:"",name:"content",required:!1,type:{name:"TTopBarContent[]"}},contentRight:{defaultValue:{value:"[]"},description:"",name:"contentRight",required:!1,type:{name:"TTopBarContent[]"}},warning:{defaultValue:{value:""},description:"",name:"warning",required:!1,type:{name:"string"}},height:{defaultValue:{value:"var(--size-topbar)"},description:"",name:"height",required:!1,type:{name:"TStringOrNumber"}},fixedPosition:{defaultValue:{value:"true"},description:"",name:"fixedPosition",required:!1,type:{name:"boolean"}}}}}catch{}export{j as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-f961835c.js";import{I as B,T as h}from"./common-types-2c81813f.js";import{T as C}from"./top-bar-
|
|
1
|
+
import{j as e}from"./jsx-runtime-f961835c.js";import{I as B,T as h}from"./common-types-2c81813f.js";import{T as C}from"./top-bar-2c70083e.js";import{M as I}from"./actions-83a2a04e.js";import{B as n}from"./button-050c998a.js";import{B as O}from"./badge-20e7ee0b.js";import{L as S}from"./logo-8068ccfc.js";import{s as j}from"./icon-custom-822ce507.js";import{M as a}from"./types-cc224262.js";import"./index-f80c8c95.js";import"./index-a80ed1cf.js";import"./icon-8acf9925.js";import"./inheritsLoose-c82a83d4.js";import"./tslib.es6-dfef685f.js";import"./index-c89a1915.js";import"./disabled-context-d654f6ff.js";import"./lodash-75c70a11.js";import"./tooltip-856042a7.js";import"./index-3d476d02.js";import"./types-332ceaf3.js";import"./spinner-a81ebe38.js";const N=[{type:"Link",label:"Link",onClick:()=>{}},{type:"Link",label:"Active",active:!0,onClick:()=>{}},{type:"Link",label:"Disabled",disabled:!0,onClick:()=>{}},{type:"Menu",label:"Dropdown",onClick:()=>{},sections:[{type:"Option",label:"Alpacas",onClick:()=>{}},{type:"Option",label:"Llamas",onClick:()=>{}}]},{type:"Button",label:"Save",colored:!0,onClick:()=>{},testId:"top-bar-button-save"}],v=[{type:"Component",component:e.jsx(O,{title:"3",small:!0,margin:"5px",children:e.jsx(n,{icon:B.NOTIFICATION,round:!0,onClick:()=>{}})})},{type:"Component",component:e.jsx(I,{menu:{trigger:h.COMPONENT,fullHeightTrigger:!0,placement:"bottom-end",component:e.jsx(n,{label:"TU",round:!0,onClick:()=>{}}),sections:[{type:a.HEADING,label:"Test User"},{type:a.OPTION,label:"Profile",icon:"user",onClick:()=>{}},{type:a.DIVIDER},{type:a.OPTION,label:"Sign out",icon:"lock",onClick:()=>{}}]}})}],Y={title:"Navigation/TopBar",component:C,parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}},argTypes:{height:{control:"text"}},args:{title:{logo:e.jsx("img",{src:S,alt:"logo"}),onClick:()=>{}},content:N,contentRight:v}},i=x=>e.jsx(C,{...x}),s=i.bind({}),r=i.bind({});r.args={warning:"Application update available. Please refresh your browser."};const o=i.bind({});o.args={title:{label:"Text Branding",onClick:()=>{}}};const t=i.bind({});t.args={appSwitcher:{icon:j,onClick:()=>{}}};var p,c,l;s.parameters={...s.parameters,docs:{...(p=s.parameters)==null?void 0:p.docs,source:{originalSource:"args => <TopBar {...args} />",...(l=(c=s.parameters)==null?void 0:c.docs)==null?void 0:l.source}}};var m,g,u;r.parameters={...r.parameters,docs:{...(m=r.parameters)==null?void 0:m.docs,source:{originalSource:"args => <TopBar {...args} />",...(u=(g=r.parameters)==null?void 0:g.docs)==null?void 0:u.source}}};var d,T,b;o.parameters={...o.parameters,docs:{...(d=o.parameters)==null?void 0:d.docs,source:{originalSource:"args => <TopBar {...args} />",...(b=(T=o.parameters)==null?void 0:T.docs)==null?void 0:b.source}}};var y,k,f;t.parameters={...t.parameters,docs:{...(y=t.parameters)==null?void 0:y.docs,source:{originalSource:"args => <TopBar {...args} />",...(f=(k=t.parameters)==null?void 0:k.docs)==null?void 0:f.source}}};const Z=["Default","WithWarning","TextBranding","AppSwitcher"];export{t as AppSwitcher,s as Default,o as TextBranding,r as WithWarning,Z as __namedExportsOrder,Y as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o}from"./jsx-runtime-f961835c.js";import{I as n}from"./common-types-2c81813f.js";import{T as l}from"./top-bar-
|
|
1
|
+
import{j as o}from"./jsx-runtime-f961835c.js";import{I as n}from"./common-types-2c81813f.js";import{T as l}from"./top-bar-2c70083e.js";import{B as s}from"./button-050c998a.js";import{B as m}from"./badge-20e7ee0b.js";import{L as p}from"./logo-8068ccfc.js";import"./index-f80c8c95.js";import"./index-a80ed1cf.js";import"./icon-8acf9925.js";import"./inheritsLoose-c82a83d4.js";import"./tslib.es6-dfef685f.js";import"./index-c89a1915.js";import"./disabled-context-d654f6ff.js";import"./actions-83a2a04e.js";import"./lodash-75c70a11.js";import"./tooltip-856042a7.js";import"./index-3d476d02.js";import"./types-cc224262.js";import"./types-332ceaf3.js";import"./spinner-a81ebe38.js";const h={title:"Navigation/TopBar/Test Cases",parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}}},t=()=>o.jsx(l,{title:{logo:o.jsx("img",{src:p,alt:"logo"}),version:"V1.2.3",onClick:()=>{}},content:[{type:"Link",label:"Link",onClick:()=>{}},{type:"Link",label:"Lorem ipsum dolor est compendum lorem ipsum dolor est compendum lorem ipsum dolor est (cloned 2022-06-17 01:33:42)",active:!0,onClick:()=>{}},{type:"Link",label:"Disabled",disabled:!0,onClick:()=>{}},{type:"Button",label:"Save",colored:!0,onClick:()=>{},testId:"top-bar-button-save"}],contentRight:[{type:"Component",component:o.jsx(m,{title:"3",small:!0,margin:"5px",children:o.jsx(s,{icon:n.NOTIFICATION,round:!0,onClick:()=>{}})})}]});var e,r,i;t.parameters={...t.parameters,docs:{...(e=t.parameters)==null?void 0:e.docs,source:{originalSource:`() => <TopBar title={{
|
|
2
2
|
logo: <img src={LogoSVG} alt="logo" />,
|
|
3
3
|
version: 'V1.2.3',
|
|
4
4
|
onClick: () => {}
|