@oliasoft-open-source/react-ui-library 4.0.0-beta-73 → 4.0.0-beta-74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/assets/{index-b19cfcad.css → index-127b2a09.css} +35 -35
  2. package/dist/assets/{index-a440ffa4.js → index-c80b6ce9.js} +12 -12
  3. package/dist/global.css +35 -35
  4. package/dist/index.html +1 -1
  5. package/dist/index.js +12 -12
  6. package/dist/storybook/assets/{Color-6VNJS4EI-67f4abe7.js → Color-6VNJS4EI-c8b26dad.js} +1 -1
  7. package/dist/storybook/assets/{DocsRenderer-NNNQARDV-30ed94ed.js → DocsRenderer-NNNQARDV-cdec539e.js} +1 -1
  8. package/dist/storybook/assets/{WithTooltip-4HIR6TLV-ebcb222a.js → WithTooltip-4HIR6TLV-7cb889f4.js} +1 -1
  9. package/dist/storybook/assets/{accordion.stories-5b158e03.js → accordion.stories-ad03b4bc.js} +1 -1
  10. package/dist/storybook/assets/{button.stories-1f8ade76.js → button.stories-5f73ddef.js} +1 -1
  11. package/dist/storybook/assets/{buttons-and-links-c7fd0bbb.js → buttons-and-links-ab7c3569.js} +1 -1
  12. package/dist/storybook/assets/{casing-loads.stories-917d2453.js → casing-loads.stories-656e5aae.js} +1 -1
  13. package/dist/storybook/assets/{cell.stories-854f1794.js → cell.stories-d4e422d8.js} +1 -1
  14. package/dist/storybook/assets/{chunk-HLWAVYOI-dd64d35e.js → chunk-HLWAVYOI-6aec5928.js} +1 -1
  15. package/dist/storybook/assets/{color-4e2a8931.js → color-ac480967.js} +1 -1
  16. package/dist/storybook/assets/{drawer.stories-d4daea89.js → drawer.stories-4b58fc68.js} +1 -1
  17. package/dist/storybook/assets/{file-input.stories-735eec97.js → file-input.stories-6878a9b8.js} +1 -1
  18. package/dist/storybook/assets/{flex-02e2c67f.js → flex-1d14d86c.js} +1 -1
  19. package/dist/storybook/assets/{flex.stories-4e27de5e.js → flex.stories-6a278b40.js} +1 -1
  20. package/dist/storybook/assets/{footer.stories-169535f7.js → footer.stories-6bfdf4a6.js} +1 -1
  21. package/dist/storybook/assets/{form.stories-3a33b15f.js → form.stories-c29a7b5c.js} +1 -1
  22. package/dist/storybook/assets/{formation.stories-a79dcf52.js → formation.stories-ab5ccc2b.js} +1 -1
  23. package/dist/storybook/assets/{formatter-SWP5E3XI-c320a281.js → formatter-SWP5E3XI-0dd13710.js} +1 -1
  24. package/dist/storybook/assets/{heading.stories-48a34eee.js → heading.stories-6ff7f5ed.js} +1 -1
  25. package/dist/storybook/assets/{icon.stories-c692818a.js → icon.stories-466d158f.js} +1 -1
  26. package/dist/storybook/assets/{iframe-e4f07b05.js → iframe-947f9c55.js} +1 -1
  27. package/dist/storybook/assets/{index-39f0d819.js → index-8d6dd410.js} +4 -4
  28. package/dist/storybook/assets/{input-validation-26e84678.js → input-validation-45be383d.js} +1 -1
  29. package/dist/storybook/assets/{inputs-5960bfa8.js → inputs-acab42d2.js} +1 -1
  30. package/dist/storybook/assets/{layout-forms-0875589e.js → layout-forms-42aaee56.js} +1 -1
  31. package/dist/storybook/assets/{layout-general-7ef63da0.js → layout-general-99d47759.js} +1 -1
  32. package/dist/storybook/assets/{list.stories-34a8b13c.js → list.stories-c8b4f325.js} +1 -1
  33. package/dist/storybook/assets/{list.stories-data-705861e1.js → list.stories-data-ba40864f.js} +1 -1
  34. package/dist/storybook/assets/{menu.stories-0db717e0.js → menu.stories-8d724757.js} +1 -1
  35. package/dist/storybook/assets/{menu.stories-data-53e2c46a.js → menu.stories-data-28e27478.js} +1 -1
  36. package/dist/storybook/assets/{padding-and-spacing-cf646a93.js → padding-and-spacing-9d315c16.js} +1 -1
  37. package/dist/storybook/assets/{popover.stories-74d1f7d0.js → popover.stories-5ff63b56.js} +1 -1
  38. package/dist/storybook/assets/preview-2e7a6af0.js +1 -0
  39. package/dist/storybook/assets/{preview-ee944e2a.js → preview-54f66d52.js} +1 -1
  40. package/dist/storybook/assets/{row.stories-1204b9f4.js → row.stories-dbcfcbe1.js} +1 -1
  41. package/dist/storybook/assets/{side-bar.stories-7efb356a.js → side-bar.stories-7476c9a2.js} +1 -1
  42. package/dist/storybook/assets/{spacer.stories-f567c62c.js → spacer.stories-a2798d47.js} +1 -1
  43. package/dist/storybook/assets/{syntaxhighlighter-NMPM6SWI-9beb83d2.js → syntaxhighlighter-NMPM6SWI-278ec58f.js} +1 -1
  44. package/dist/storybook/assets/{table-cf018f89.js → table-24be8f4e.js} +1 -1
  45. package/dist/storybook/assets/table-41cb8b17.css +1 -0
  46. package/dist/storybook/assets/{table.stories-7f548edc.js → table.stories-9251bb1e.js} +1 -1
  47. package/dist/storybook/assets/{table.stories-data-35274dd0.js → table.stories-data-ddbcf8c3.js} +1 -1
  48. package/dist/storybook/assets/{textarea-72dda6a0.js → textarea-5ebdd171.js} +1 -1
  49. package/dist/storybook/assets/{textarea.stories-52b6895a.js → textarea.stories-02879684.js} +1 -1
  50. package/dist/storybook/assets/{title.stories-674fb67e.js → title.stories-f438f1b4.js} +1 -1
  51. package/dist/storybook/assets/{tooltip.test-case.stories-00e608c7.js → tooltip.test-case.stories-4c1ea273.js} +1 -1
  52. package/dist/storybook/iframe.html +1 -1
  53. package/dist/storybook/project.json +1 -1
  54. package/package.json +1 -1
  55. package/dist/storybook/assets/preview-aeb21425.js +0 -1
  56. package/dist/storybook/assets/table-9455392a.css +0 -1
@@ -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-cf018f89.js";import{T as V}from"./text-ad1f5f1d.js";import{t as g,i as W,q as B}from"./table.stories-data-35274dd0.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-27bfe219.js";import"./select-83e9d851.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-7cb3ea4d.js";import"./index-54f0d271.js";import"./check-box-b38490e5.js";import"./slider-5d5442fe.js";import"./index-c7f280f6.js";import"./popover-c1234faa.js";import"./flex-02e2c67f.js";const Ae={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 => {
1
+ import{j as o}from"./jsx-runtime-f961835c.js";import{r as R}from"./index-f80c8c95.js";import{T as c}from"./table-24be8f4e.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-27bfe219.js";import"./select-83e9d851.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-7cb3ea4d.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 Ae={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} />;
@@ -1 +1 @@
1
- import{j as a}from"./jsx-runtime-f961835c.js";import{I as t}from"./common-types-2c81813f.js";import{S as m}from"./side-bar-51697e1e.js";import{F as g}from"./flex-02e2c67f.js";import{B as u}from"./badge-20e7ee0b.js";import{s as S}from"./icon-custom-822ce507.js";import"./index-f80c8c95.js";import"./index-a80ed1cf.js";import"./index-c7f280f6.js";import"./drawer-907c8484.js";import"./lodash-75c70a11.js";import"./index-c89a1915.js";import"./index-3d476d02.js";import"./icon-8acf9925.js";import"./inheritsLoose-c82a83d4.js";import"./tslib.es6-dfef685f.js";import"./disabled-context-d654f6ff.js";import"./button-050c998a.js";import"./spinner-a81ebe38.js";import"./tooltip-856042a7.js";const h=[{heading:"First Heading",items:[{label:"Section A",value:"/path/to/something",onClick:()=>{},icon:S},{label:a.jsxs(g,{alignItems:"center",gap:"var(--padding-xxs)",children:["Section B",a.jsx(u,{small:!0,title:"BETA"})]}),value:"/path/to/something",onClick:()=>{},icon:t.HELP,isActive:!0},{label:"Section C",value:"/path/to/something",onClick:()=>{},icon:t.EDIT},{label:"Experimental Section",value:"/path/to/something",onClick:()=>{},icon:t.LIBRARY,isExperimental:!0}]},{heading:"Second Heading",items:[{label:"Section 1",value:"/path/to/something",onClick:()=>{},icon:t.SETTINGS},{label:"Section 2",value:"/path/to/something",onClick:()=>{},icon:t.STAR},{label:"Invalid Section",value:"/path/to/something",onClick:()=>{},icon:t.NOTIFICATION,invalid:!0}]}],L={title:"Navigation/SideBar",component:m,parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}},args:{options:{title:"Title",sections:h},startOpen:!1},argTypes:{top:{control:{type:"text"}},startOpen:{control:{type:"boolean"}}}},c=d=>a.jsx(m,{...d}),o=c.bind({}),e=c.bind({});e.args={startOpen:!0};var i,r,s;o.parameters={...o.parameters,docs:{...(i=o.parameters)==null?void 0:i.docs,source:{originalSource:"args => <SideBar {...args} />",...(s=(r=o.parameters)==null?void 0:r.docs)==null?void 0:s.source}}};var n,l,p;e.parameters={...e.parameters,docs:{...(n=e.parameters)==null?void 0:n.docs,source:{originalSource:"args => <SideBar {...args} />",...(p=(l=e.parameters)==null?void 0:l.docs)==null?void 0:p.source}}};const G=["Default","StartOpen"];export{o as Default,e as StartOpen,G as __namedExportsOrder,L as default};
1
+ import{j as a}from"./jsx-runtime-f961835c.js";import{I as t}from"./common-types-2c81813f.js";import{S as m}from"./side-bar-51697e1e.js";import{F as g}from"./flex-1d14d86c.js";import{B as u}from"./badge-20e7ee0b.js";import{s as S}from"./icon-custom-822ce507.js";import"./index-f80c8c95.js";import"./index-a80ed1cf.js";import"./index-c7f280f6.js";import"./drawer-907c8484.js";import"./lodash-75c70a11.js";import"./index-c89a1915.js";import"./index-3d476d02.js";import"./icon-8acf9925.js";import"./inheritsLoose-c82a83d4.js";import"./tslib.es6-dfef685f.js";import"./disabled-context-d654f6ff.js";import"./button-050c998a.js";import"./spinner-a81ebe38.js";import"./tooltip-856042a7.js";const h=[{heading:"First Heading",items:[{label:"Section A",value:"/path/to/something",onClick:()=>{},icon:S},{label:a.jsxs(g,{alignItems:"center",gap:"var(--padding-xxs)",children:["Section B",a.jsx(u,{small:!0,title:"BETA"})]}),value:"/path/to/something",onClick:()=>{},icon:t.HELP,isActive:!0},{label:"Section C",value:"/path/to/something",onClick:()=>{},icon:t.EDIT},{label:"Experimental Section",value:"/path/to/something",onClick:()=>{},icon:t.LIBRARY,isExperimental:!0}]},{heading:"Second Heading",items:[{label:"Section 1",value:"/path/to/something",onClick:()=>{},icon:t.SETTINGS},{label:"Section 2",value:"/path/to/something",onClick:()=>{},icon:t.STAR},{label:"Invalid Section",value:"/path/to/something",onClick:()=>{},icon:t.NOTIFICATION,invalid:!0}]}],L={title:"Navigation/SideBar",component:m,parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}},args:{options:{title:"Title",sections:h},startOpen:!1},argTypes:{top:{control:{type:"text"}},startOpen:{control:{type:"boolean"}}}},c=d=>a.jsx(m,{...d}),o=c.bind({}),e=c.bind({});e.args={startOpen:!0};var i,r,s;o.parameters={...o.parameters,docs:{...(i=o.parameters)==null?void 0:i.docs,source:{originalSource:"args => <SideBar {...args} />",...(s=(r=o.parameters)==null?void 0:r.docs)==null?void 0:s.source}}};var n,l,p;e.parameters={...e.parameters,docs:{...(n=e.parameters)==null?void 0:n.docs,source:{originalSource:"args => <SideBar {...args} />",...(p=(l=e.parameters)==null?void 0:l.docs)==null?void 0:p.source}}};const G=["Default","StartOpen"];export{o as Default,e as StartOpen,G as __namedExportsOrder,L as default};
@@ -1 +1 @@
1
- import{j as r}from"./jsx-runtime-f961835c.js";import{S as h}from"./spacer-54db0620.js";import{F as j}from"./flex-02e2c67f.js";import{B as s}from"./button-050c998a.js";import"./index-f80c8c95.js";import"./index-a80ed1cf.js";import"./common-types-2c81813f.js";import"./disabled-context-d654f6ff.js";import"./spinner-a81ebe38.js";import"./icon-8acf9925.js";import"./inheritsLoose-c82a83d4.js";import"./tslib.es6-dfef685f.js";import"./index-c89a1915.js";import"./tooltip-856042a7.js";import"./index-3d476d02.js";const W={title:"Layout/Spacer",component:h,argTypes:{width:{control:"text"},height:{control:"text"}}},p=t=>r.jsx(h,{...t}),a=p.bind({});a.decorators=[t=>r.jsxs(r.Fragment,{children:[r.jsx(s,{label:"Button"}),t(),r.jsx(s,{label:"Button"})]})];const e=p.bind({});e.args={height:"var(--padding-xxs)"};e.decorators=[t=>r.jsxs(r.Fragment,{children:[r.jsx(s,{label:"Button"}),t(),r.jsx(s,{label:"Button"})]})];const o=p.bind({});o.args={width:"var(--padding)"};o.decorators=[t=>r.jsxs(j,{children:[r.jsx(s,{label:"Button"}),t(),r.jsx(s,{label:"Button"})]})];var c,i,m;a.parameters={...a.parameters,docs:{...(c=a.parameters)==null?void 0:c.docs,source:{originalSource:"(args: ISpacerProps) => <Spacer {...args} />",...(m=(i=a.parameters)==null?void 0:i.docs)==null?void 0:m.source}}};var n,d,l;e.parameters={...e.parameters,docs:{...(n=e.parameters)==null?void 0:n.docs,source:{originalSource:"(args: ISpacerProps) => <Spacer {...args} />",...(l=(d=e.parameters)==null?void 0:d.docs)==null?void 0:l.source}}};var u,g,x;o.parameters={...o.parameters,docs:{...(u=o.parameters)==null?void 0:u.docs,source:{originalSource:"(args: ISpacerProps) => <Spacer {...args} />",...(x=(g=o.parameters)==null?void 0:g.docs)==null?void 0:x.source}}};const L=["Default","Height","Width"];export{a as Default,e as Height,o as Width,L as __namedExportsOrder,W as default};
1
+ import{j as r}from"./jsx-runtime-f961835c.js";import{S as h}from"./spacer-54db0620.js";import{F as j}from"./flex-1d14d86c.js";import{B as s}from"./button-050c998a.js";import"./index-f80c8c95.js";import"./index-a80ed1cf.js";import"./common-types-2c81813f.js";import"./disabled-context-d654f6ff.js";import"./spinner-a81ebe38.js";import"./icon-8acf9925.js";import"./inheritsLoose-c82a83d4.js";import"./tslib.es6-dfef685f.js";import"./index-c89a1915.js";import"./tooltip-856042a7.js";import"./index-3d476d02.js";const W={title:"Layout/Spacer",component:h,argTypes:{width:{control:"text"},height:{control:"text"}}},p=t=>r.jsx(h,{...t}),a=p.bind({});a.decorators=[t=>r.jsxs(r.Fragment,{children:[r.jsx(s,{label:"Button"}),t(),r.jsx(s,{label:"Button"})]})];const e=p.bind({});e.args={height:"var(--padding-xxs)"};e.decorators=[t=>r.jsxs(r.Fragment,{children:[r.jsx(s,{label:"Button"}),t(),r.jsx(s,{label:"Button"})]})];const o=p.bind({});o.args={width:"var(--padding)"};o.decorators=[t=>r.jsxs(j,{children:[r.jsx(s,{label:"Button"}),t(),r.jsx(s,{label:"Button"})]})];var c,i,m;a.parameters={...a.parameters,docs:{...(c=a.parameters)==null?void 0:c.docs,source:{originalSource:"(args: ISpacerProps) => <Spacer {...args} />",...(m=(i=a.parameters)==null?void 0:i.docs)==null?void 0:m.source}}};var n,d,l;e.parameters={...e.parameters,docs:{...(n=e.parameters)==null?void 0:n.docs,source:{originalSource:"(args: ISpacerProps) => <Spacer {...args} />",...(l=(d=e.parameters)==null?void 0:d.docs)==null?void 0:l.source}}};var u,g,x;o.parameters={...o.parameters,docs:{...(u=o.parameters)==null?void 0:u.docs,source:{originalSource:"(args: ISpacerProps) => <Spacer {...args} />",...(x=(g=o.parameters)==null?void 0:g.docs)==null?void 0:x.source}}};const L=["Default","Height","Width"];export{a as Default,e as Height,o as Width,L as __namedExportsOrder,W as default};
@@ -1 +1 @@
1
- import{S as l,c as n,s as d}from"./index-39f0d819.js";import"./iframe-e4f07b05.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
+ import{S as l,c as n,s as d}from"./index-8d6dd410.js";import"./iframe-947f9c55.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-27bfe219.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-83e9d851.js";import{D as Ue}from"./disabled-context-d654f6ff.js";import{i as O}from"./types-332ceaf3.js";import{T as he}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_cydch_1",Ye="_inputHover_cydch_13",Qe="_inputFocus_cydch_18",Ze="_inputError_cydch_25",en="_inputWarning_cydch_26",nn="_inputDisabled_cydch_61",tn="_hideScrollbars_cydch_67",rn="_wrapper_cydch_85",an="_bordered_cydch_93",ln="_scroll_cydch_98",on="_table_cydch_108",sn="_striped_cydch_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",hn="_rowActive_11d5t_4",fn="_expandableRow_11d5t_8",bn="_flush_11d5t_8",xn="_dragIconCell_11d5t_28",Cn="_dragIcon_11d5t_28",R={clickableRow:gn,hoverableRow:yn,rowActive:hn,expandableRow:fn,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(he,{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(he,{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(he,{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((f,v)=>{const fe=`${a?0:1}_${t}_${v}`;return n.jsx(Y,{cell:f,isHeader:a,columnAlignment:s[v],columnHeaderAlignment:L[v],width:g?g[v]:void 0,snapshot:p,testId:f.testId},fe)}),V=u&&n.jsx(Y,{cell:{type:S.ACTIONS,actions:e.actions},isHeader:a},l),k=(f,v)=>({minWidth:f&&`${y}px`,width:f&&"100%",display:f&&"table",background:f&&"var(--color-background-listitem-active)",border:f&&"var(--color-border)",borderTop:f&&0,opacity:f&&.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),f=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&&f,ke={cells:v?x.cells.map((m,j)=>(m==null?void 0:m.type)==="Input"?{...m,onChange:_=>{var M;const h=(M=_==null?void 0:_.target)==null?void 0:M.value,D={...x,cells:x.cells.map((G,We)=>({...G,value:We===j?h: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 h,D;const j=(h=m==null?void 0:m.source)==null?void 0:h.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((_,h)=>n.jsx(F,{rowIndex:h,isHeader:!0,row:_,columnCount:V,columnWidths:l,colSpan:W,hasRowActions:k,columnAlignment:c,columnHeaderAlignments:p,draggableTable:P},`0_${h}`))}),n.jsxs("tbody",{children:[Z.slice(0,j).map((_,h)=>n.jsx(De,{draggableId:h+"",index:h,isDragDisabled:_.noDrag,children:(D,M)=>n.jsx(F,{rowIndex:h,row:_,columnCount:V,columnWidths:l,colSpan:W,hasRowActions:k,columnAlignment:c,provided:D,snapshot:M,draggableTable:P,width:I.width},`1_${h}`)},`index_${h}`)),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-27bfe219.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-83e9d851.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};
@@ -0,0 +1 @@
1
+ ._inputInTable_y9car_1{background-color:transparent;border-radius:inherit!important;height:var(--size);min-height:100%}._inputInTable_y9car_1:not(:hover){border-color:transparent}._inputInTable_y9car_1:not(:focus){box-shadow:none}._inputHover_y9car_13{position:relative;border-color:var(--color-border-hover);z-index:2}._inputFocus_y9car_18{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputError_y9car_25,._inputWarning_y9car_26{position:relative}._inputError_y9car_25{z-index:2;border-color:var(--color-border-error);color:var(--color-text-error)!important;background-color:var(--color-background-error-muted)}._inputError_y9car_25:hover{border-color:var(--color-border-error-hover)!important}._inputError_y9car_25:focus{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputWarning_y9car_26{z-index:1;border-color:var(--color-border-warning);color:var(--color-text-warning)!important;background-color:var(--color-background-warning-muted)}._inputWarning_y9car_26:hover{border-color:var(--color-border-warning-hover)!important}._inputWarning_y9car_26:focus{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputDisabled_y9car_61{pointer-events:none;background-color:var(--color-background-disabled);color:var(--color-text-muted);box-shadow:none}._hideScrollbars_y9car_67{scrollbar-width:none;-ms-overflow-style:none}._hideScrollbars_y9car_67::-webkit-scrollbar{display:none}:root{--color-background-table-header: var(--color-neutral-150);--color-background-table-row-tinted: var(--color-neutral-50)}html[data-theme=dark]{--color-background-table-header: var(--color-neutral-800);--color-background-table-row-tinted: var(--color-neutral-800)}._wrapper_y9car_85{border-radius:inherit;max-height:100%;max-width:100%;display:flex;flex-direction:column;overflow:hidden}._wrapper_y9car_85._bordered_y9car_93{border-radius:var(--border-radius);border:1px solid var(--color-border);box-shadow:var(--shadow-card)}._scroll_y9car_98{overflow-y:auto;border-radius:inherit;flex:1;min-height:0}._scroll_y9car_98:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}._table_y9car_108{background:var(--color-background-raised);color:var(--color-text);border-collapse:separate;border-spacing:0;border-radius:inherit;width:100%;font-variant-numeric:tabular-nums}._table_y9car_108>:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}._table_y9car_108>:first-child>:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}._table_y9car_108>:first-child>:first-child>:first-child{border-top-left-radius:inherit}._table_y9car_108>:first-child>:first-child>:last-child{border-top-right-radius:inherit}._table_y9car_108>:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}._table_y9car_108>:last-child>:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}._table_y9car_108>:last-child>:last-child>:first-child{border-bottom-left-radius:inherit}._table_y9car_108>:last-child>:last-child>:last-child{border-bottom-right-radius:inherit}th,td{padding:var(--padding-input)!important;height:var(--size);background:inherit;border-color:var(--color-border);border-style:solid;border-width:0}th:not(:first-child),td:not(:first-child){border-left-width:1px}._table_y9car_108>*:not(:last-child)>tr th,._table_y9car_108>*:not(:last-child)>tr td,._table_y9car_108>*:last-child>tr:not(:last-child) th,._table_y9car_108>*:last-child>tr:not(:last-child) td{border-bottom-width:1px}@-moz-document url-prefix(){tr{height:var(--size)}td,th{height:100%}}thead{position:sticky;top:0;overflow:hidden;z-index:5}thead tr{background-color:var(--color-background-table-header)}tbody{overflow:hidden}tbody tr{background-color:var(--color-background-raised)}._striped_y9car_188 tbody tr:nth-child(2n){background-color:var(--color-background-table-row-tinted)}._title_11pbp_1{background-color:var(--color-background-cardheader);border-bottom:1px solid var(--color-border);padding:var(--padding-xxs) var(--padding-sm);display:flex;align-items:center;justify-content:space-between;gap:4px;width:100%;border-top-left-radius:inherit;border-top-right-radius:inherit}._footer_4sumy_1{background-color:var(--color-background-table-header);z-index:4;overflow:hidden;flex-shrink:0}._section_4sumy_7{padding:var(--padding-input);display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--color-border)}._clickableRow_11d5t_1{cursor:pointer}._hoverableRow_11d5t_4:not(._rowActive_11d5t_4):hover,._clickableRow_11d5t_1:not(._rowActive_11d5t_4):hover{background-color:var(--color-background-listitem-hover)!important}._expandableRow_11d5t_8._flush_11d5t_8{padding:0!important;height:auto!important}._rowActive_11d5t_4{position:relative;background-color:var(--color-background-listitem-active)!important}._rowActive_11d5t_4:after{content:"";position:absolute;left:0;top:0;bottom:0;width:2px;border-top-left-radius:inherit;border-bottom-left-radius:inherit;transition:background .3s;background:var(--color-background-primary)}._dragIconCell_11d5t_28{width:var(--size);min-width:var(--size);position:relative}._dragIcon_11d5t_28{display:flex;align-items:center;justify-content:center;position:absolute;top:0;right:0;bottom:0;left:0;color:var(--color-text-faint)}._dragIcon_11d5t_28:hover{color:var(--color-text-primary-hover)}._dragIcon_11d5t_28:active{color:var(--color-text-primary-active)}._inputInTable_u3xdj_1{background-color:transparent;border-radius:inherit!important;height:var(--size);min-height:100%}._inputInTable_u3xdj_1:not(:hover){border-color:transparent}._inputInTable_u3xdj_1:not(:focus){box-shadow:none}._inputHover_u3xdj_13{position:relative;border-color:var(--color-border-hover);z-index:2}._inputFocus_u3xdj_18{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputError_u3xdj_25,._inputWarning_u3xdj_26{position:relative}._inputError_u3xdj_25{z-index:2;border-color:var(--color-border-error);color:var(--color-text-error)!important;background-color:var(--color-background-error-muted)}._inputError_u3xdj_25:hover{border-color:var(--color-border-error-hover)!important}._inputError_u3xdj_25:focus{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputWarning_u3xdj_26{z-index:1;border-color:var(--color-border-warning);color:var(--color-text-warning)!important;background-color:var(--color-background-warning-muted)}._inputWarning_u3xdj_26:hover{border-color:var(--color-border-warning-hover)!important}._inputWarning_u3xdj_26:focus{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputDisabled_u3xdj_61{pointer-events:none;background-color:var(--color-background-disabled);color:var(--color-text-muted);box-shadow:none}._hideScrollbars_u3xdj_67{scrollbar-width:none;-ms-overflow-style:none}._hideScrollbars_u3xdj_67::-webkit-scrollbar{display:none}._cell_u3xdj_77 a{cursor:pointer;color:var(--color-text-primary)}._cell_u3xdj_77 a:hover{color:var(--color-text-primary-hover)}._cell_u3xdj_77 a:active{color:var(--color-text-primary-active)}._cell_u3xdj_77 a._disabledLink_u3xdj_87{color:var(--color-text-faint)!important;cursor:default!important}._inputWrapper_u3xdj_91{height:100%;border-radius:inherit}._inputWrapper_u3xdj_91>span,._inputWrapper_u3xdj_91>span>span,._inputWrapper_u3xdj_91>span>span>div{height:100%;border-radius:inherit}._inputWrapper_u3xdj_91>div,._inputWrapper_u3xdj_91>div>span{height:100%;border-radius:inherit}._breakWord_u3xdj_106{word-break:break-word}._inputCell_u3xdj_109{padding:0!important}._sliderCell_u3xdj_112{padding-top:0!important;padding-bottom:0!important}._staticCell_u3xdj_116{padding:0!important}._staticCell_u3xdj_116 ._staticCellContent_u3xdj_119{line-height:1.25;min-height:100%;padding:var(--padding-input);position:relative;border-radius:inherit;display:flex;align-items:center}tbody ._staticCell_u3xdj_116 ._staticCellContent_u3xdj_119{color:var(--color-text-muted)}._staticCell_u3xdj_116 ._staticCellContent_u3xdj_119._error_u3xdj_131,._staticCell_u3xdj_116 ._staticCellContent_u3xdj_119._warning_u3xdj_132{border:1px solid transparent}._staticCell_u3xdj_116 ._staticCellContent_u3xdj_119._error_u3xdj_131{background-color:var(--color-background-error-muted)}._staticCell_u3xdj_116 ._staticCellContent_u3xdj_119._warning_u3xdj_132{background-color:var(--color-background-warning-muted)}._staticCell_u3xdj_116 ._staticCellContent_u3xdj_119._unit_u3xdj_141{font-weight:400}._sortingCell_u3xdj_144 ._staticCellContent_u3xdj_119{position:relative;padding-right:calc(var(--size) + var(--padding-xxs))!important;cursor:pointer!important}._sortingCell_u3xdj_144 ._staticCellContent_u3xdj_119:hover{background-color:#0000000d!important}[data-theme=dark] ._sortingCell_u3xdj_144 ._staticCellContent_u3xdj_119:hover{background-color:#ffffff1a!important}._sortingCell_u3xdj_144 ._sortingCellIcon_u3xdj_155{font-size:var(--size-xs);position:absolute;right:var(--padding-input-x);top:50%;transform:translateY(-50%);display:flex}._sortingCell_u3xdj_144 ._sortingCellIcon_u3xdj_155>*{display:flex}._icon_u3xdj_166{display:inline-flex;margin-left:var(--padding-xxs)}._checkBoxCell_u3xdj_170{padding-block:0!important;width:var(--size)}._iconCellWrapper_u3xdj_174{display:flex;justify-content:center}._actionsCell_u3xdj_178{width:var(--size-sm);padding:0 calc((var(--size) - var(--size-sm)) / 2)!important;position:sticky;right:0;background:inherit;z-index:4}._rightAligned_u3xdj_186{text-align:right!important}._rightAligned_u3xdj_186 ._staticCellContent_u3xdj_119{justify-content:flex-end}._centerAligned_u3xdj_192{text-align:center!important}._centerAligned_u3xdj_192 ._staticCellContent_u3xdj_119{justify-content:center}._leftAligned_u3xdj_198{text-align:left!important}._popover_u3xdj_201{padding:var(--padding-input)}._disabledPointerEvents_u3xdj_204{pointer-events:none}
@@ -1,4 +1,4 @@
1
- import{j as c}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 ae}from"./lodash-75c70a11.js";import{T}from"./table-cf018f89.js";import{C as Ge}from"./card-3847c251.js";import{I as ee}from"./input-05f21b51.js";import{F as ne}from"./field-248df38c.js";import{H as Je}from"./heading-39e599c8.js";import{t as Y,a as Xe,b as Ye,c as Ze,d as en,e as nn,f as tn,g as an}from"./table.stories-data-35274dd0.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"./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-27bfe219.js";import"./select-83e9d851.js";import"./assertThisInitialized-081f9914.js";import"./text-ad1f5f1d.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-02e2c67f.js";const Xn={title:"Basic/Table",component:T,args:{table:{...Y}}},I=h=>c.jsx(T,{...h}),B=I.bind({}),N=I.bind({});N.args={table:{...Y,fixedWidth:"400px"}};const M=I.bind({});M.args={table:{...Y,fixedWidth:"auto"}};const O=I.bind({});O.args={table:Xe};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 Q=I.bind({});Q.args={table:Ye};const W=I.bind({});W.args={table:Ze};W.parameters={docs:{description:{story:"This is only required when you need to override `columnAlignment` in header cells (i.e. they have different alignment)"}}};const _=I.bind({});_.args={table:en};const U=I.bind({});U.args={table:nn};U.decorators=[h=>c.jsx("div",{style:{position:"absolute",inset:0,padding:"var(--padding)"},children:c.jsx(h,{})})];const E=I.bind({});E.args={table:tn};E.parameters={docs:{description:{story:"If a `maxHeight` is set, the table should only fill that height if it needs to."}}};const L=I.bind({});L.args={table:an};const q=()=>c.jsx(Ge,{heading:c.jsx(Je,{children:"Card heading"}),padding:!1,children:c.jsx(T,{table:{...Y,bordered:!1}})});q.parameters={docs:{source:{type:"dynamic"}}};const z=()=>{const h=["Section","Width","Height"];let m=["","m","m"],o=[...Array(175).keys()].map((a,n)=>[n,n*2,n*2]);const k=(a,n,s)=>a==="m"&&n==="ft"?s*3.28084:a==="ft"&&n==="m"?s/3.28084:s,l=(a,n,s,u)=>{o[n][s]=a.target.value,u()},C=a=>{o=o.concat([["","",""]]),a()},A=(a,n)=>{o=o.filter((s,u)=>u!==a),n()},d=(a,n,s)=>{const u=m[n],y=a.target.value;m=m.map((R,b)=>b===n?y:R),o=o.map(R=>R.map((b,g)=>g===n?k(u,y,b):b)),s()},p=()=>{const a=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[n,s]=S.useState(10),[u,y]=S.useState(1),[R,b]=S.useState(!1),g=()=>{b(!R)},F=()=>{const e=Math.ceil(o.length/n);y(e)},D=(u-1)*n,t=n===0?o.length-1:D+n,i={headers:[{cells:h.map(e=>({value:e})),actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{C(g),F()}}]},{cells:[{},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:m[1],type:"Select",native:!0,onChange:e=>d(e,1,g)},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:m[2],type:"Select",native:!0,onChange:e=>d(e,2,g)}]}],rows:o.slice(D,t).map((e,r)=>{const x=D+r;return{cells:[...Array(3).keys()].map((f,w)=>({value:e[w],type:"Input",onChange:P=>l(P,x,w,g)})),actions:[{label:"Delete",icon:"minus",onClick:()=>A(x,g)}]}}),footer:{pagination:{rowCount:o.length,selectedPage:u,rowsPerPage:{onChange:e=>{const{value:r}=e.target;s(Number(r))},options:a,value:n},onSelectPage:e=>y(e),small:!0}}};return c.jsx(T,{table:i})};return c.jsx(p,{})},G=()=>{const h=["Section","Width","Height"];let m=[...Array(175).keys()].map((k,l)=>({Section:l,Width:l*2,Height:l*2}));const o=()=>{const k=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[l,C]=S.useState(10),[A,d]=S.useState(1),[p,a]=S.useState({}),[n,s]=S.useState({});S.useEffect(()=>{d(1)},[p,n]);const u=(A-1)*l,y=l===0?m.length-1:u+l,R=(e,r,x)=>e.filter(f=>Object.keys(r).every(w=>r[w]===""?!0:f[w].toString().includes(r[w]))).sort((f,w)=>Object.entries(x).map(([P,j])=>{switch(j){case"up":return f[P]-w[P];case"down":return w[P]-f[P];default:return 0}}).reduce((P,j)=>P||j,0)),b=(e,r,x,f,w)=>{const P=e.map(v=>{const V=Object.keys(f).includes(v)?f[v]:"",H=`${v[0].toUpperCase()}${v.slice(1)}`;return{key:v,value:H,hasSort:!0,sort:V,onSort:()=>{const $=V===""?"up":V==="up"?"down":"";w({...f,[v]:$})}}}),j=e.map(v=>{const V=Object.keys(r).includes(v)?r[v]:"";return{key:v,value:V,type:"Input",placeholder:"Filter",onChange:H=>x({...r,[v]:H.target.value})}});return{dataSortCells:P,dataFilterCells:j}},{dataSortCells:g,dataFilterCells:F}=b(h,p,a,n,s),D=R(m,p,n),t=[...D.slice(u,y).map(e=>({cells:Object.entries(e).map(([x,f])=>({key:x,value:f,type:"Input",disabled:!0}))}))],i={headers:[{cells:g},{cells:F}],rows:t,footer:{pagination:{rowCount:D.length,selectedPage:A,rowsPerPage:{onChange:e=>{const{value:r}=e.target;C(Number(r))},options:k,value:l},onSelectPage:e=>d(e),small:!0}}};return c.jsx(T,{table:i})};return c.jsx(o,{})},J=()=>{const h={tea:3.6,coffee:3.2,orange:4.1},m=[{label:"Tea",value:"tea"},{label:"Coffee",value:"coffee"},{label:"Orange juice",value:"orange"}],o={cells:[{type:"Select",options:m,value:{value:"tea"}},{type:"Input"},{type:"Static"}]},k=[...Array(15).keys()].map((t,i)=>({cells:[{type:"Select",options:m,value:{value:"tea"}},{type:"Input",value:i+1},{type:"Static"}]})),[l,C]=S.useState(k),A=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[d,p]=S.useState(10),[a,n]=S.useState(1),s=(a-1)*d,u=d===0?l.length-1:s+d,y=({newRow:t}={})=>{const i=K(l,e=>{e.push(t??o)});C(i)},R=({rowIndex:t})=>{const i=K(l,e=>{delete e[t]}).filter(e=>e);C(i)},b=({rowIndex:t,value:i})=>{const e=K(l,r=>{r[t].cells[0].value.value=i});C(e)},g=({rowIndex:t,value:i})=>{const e=K(l,r=>{r[t].cells[1].value=i});C(e)},F=({value:t})=>{const i=Number(t);return!ae.isNaN(i)&&ae.isInteger(i)&&i>0},D=l.slice(s,u).map((t,i)=>{const e=s+i;return l.length-1,{...t,cells:t==null?void 0:t.cells.map((r,x)=>{var v,V,H,$,te;const f=(H=(V=(v=t==null?void 0:t.cells)==null?void 0:v[0])==null?void 0:V.value)==null?void 0:H.value,w=Number((te=($=t==null?void 0:t.cells)==null?void 0:$[1])==null?void 0:te.value),P=h==null?void 0:h[f],j=P&&F({value:w})?(P*w).toFixed(2):null;if(x===0)return{...r,onChange:Z=>b({rowIndex:e,value:Z.target.value})};if(x===1)return{...r,onChange:Z=>g({rowIndex:e,value:Z.target.value}),error:F({value:r.value})?null:"Must be valid whole number"};if(x===2)return{...r,value:j}}),actions:[{label:"Delete",icon:"minus",onClick:()=>R({rowIndex:e})}]}});return c.jsx(T,{table:{defaultEmptyRow:o,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:l.length,selectedPage:a,rowsPerPage:{onChange:t=>{const{value:i}=t.target;p(Number(i))},options:A,value:d},onSelectPage:t=>n(t),small:!0}}}})},X=()=>{const h=["Section","Width","Height"];let m=Array.from(Array(10),(d,p)=>[p,p*2,p*2]);const[o,k]=S.useState({pastedValues:"",rowIndex:0,cellIndex:0}),l=(d,p,a,n)=>{m[p][a]=Number(d.target.value),n()},C=(d,p,a,n)=>{var u;let s=((u=d==null?void 0:d.clipboardData)==null?void 0:u.getData("text"))??"";return k({rowIndex:p,cellIndex:a,pastedValues:s}),n(),{pastedData:o}},A=()=>{const[d,p]=S.useState(!1),a=()=>{p(!d)},n={headers:[{cells:h.map(s=>({value:s}))}],rows:m.map((s,u)=>{const y=u;return{cells:[...Array(3).keys()].map((R,b)=>({value:s[b],type:"Input",onChange:g=>l(g,y,b,a),onPaste:g=>C(g,y,b,a)}))}})};return c.jsxs(c.Fragment,{children:[c.jsx(T,{table:n}),c.jsx(ne,{label:"Pasted Data",children:c.jsx(ee,{value:o.pastedValues})}),c.jsx(ne,{label:"At Row",children:c.jsx(ee,{value:o.rowIndex})}),c.jsx(ne,{label:"At Cell Index",children:c.jsx(ee,{value:o.cellIndex})})]})};return c.jsx(A,{})};var re,se,oe;B.parameters={...B.parameters,docs:{...(re=B.parameters)==null?void 0:re.docs,source:{originalSource:`args => {
1
+ import{j as c}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 ae}from"./lodash-75c70a11.js";import{T}from"./table-24be8f4e.js";import{C as Ge}from"./card-3847c251.js";import{I as ee}from"./input-05f21b51.js";import{F as ne}from"./field-248df38c.js";import{H as Je}from"./heading-39e599c8.js";import{t as Y,a as Xe,b as Ye,c as Ze,d as en,e as nn,f as tn,g as an}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"./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-27bfe219.js";import"./select-83e9d851.js";import"./assertThisInitialized-081f9914.js";import"./text-ad1f5f1d.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 Xn={title:"Basic/Table",component:T,args:{table:{...Y}}},I=h=>c.jsx(T,{...h}),B=I.bind({}),N=I.bind({});N.args={table:{...Y,fixedWidth:"400px"}};const M=I.bind({});M.args={table:{...Y,fixedWidth:"auto"}};const O=I.bind({});O.args={table:Xe};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 Q=I.bind({});Q.args={table:Ye};const W=I.bind({});W.args={table:Ze};W.parameters={docs:{description:{story:"This is only required when you need to override `columnAlignment` in header cells (i.e. they have different alignment)"}}};const _=I.bind({});_.args={table:en};const U=I.bind({});U.args={table:nn};U.decorators=[h=>c.jsx("div",{style:{position:"absolute",inset:0,padding:"var(--padding)"},children:c.jsx(h,{})})];const E=I.bind({});E.args={table:tn};E.parameters={docs:{description:{story:"If a `maxHeight` is set, the table should only fill that height if it needs to."}}};const L=I.bind({});L.args={table:an};const q=()=>c.jsx(Ge,{heading:c.jsx(Je,{children:"Card heading"}),padding:!1,children:c.jsx(T,{table:{...Y,bordered:!1}})});q.parameters={docs:{source:{type:"dynamic"}}};const z=()=>{const h=["Section","Width","Height"];let m=["","m","m"],o=[...Array(175).keys()].map((a,n)=>[n,n*2,n*2]);const k=(a,n,s)=>a==="m"&&n==="ft"?s*3.28084:a==="ft"&&n==="m"?s/3.28084:s,l=(a,n,s,u)=>{o[n][s]=a.target.value,u()},C=a=>{o=o.concat([["","",""]]),a()},A=(a,n)=>{o=o.filter((s,u)=>u!==a),n()},d=(a,n,s)=>{const u=m[n],y=a.target.value;m=m.map((R,b)=>b===n?y:R),o=o.map(R=>R.map((b,g)=>g===n?k(u,y,b):b)),s()},p=()=>{const a=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[n,s]=S.useState(10),[u,y]=S.useState(1),[R,b]=S.useState(!1),g=()=>{b(!R)},F=()=>{const e=Math.ceil(o.length/n);y(e)},D=(u-1)*n,t=n===0?o.length-1:D+n,i={headers:[{cells:h.map(e=>({value:e})),actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{C(g),F()}}]},{cells:[{},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:m[1],type:"Select",native:!0,onChange:e=>d(e,1,g)},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:m[2],type:"Select",native:!0,onChange:e=>d(e,2,g)}]}],rows:o.slice(D,t).map((e,r)=>{const x=D+r;return{cells:[...Array(3).keys()].map((f,w)=>({value:e[w],type:"Input",onChange:P=>l(P,x,w,g)})),actions:[{label:"Delete",icon:"minus",onClick:()=>A(x,g)}]}}),footer:{pagination:{rowCount:o.length,selectedPage:u,rowsPerPage:{onChange:e=>{const{value:r}=e.target;s(Number(r))},options:a,value:n},onSelectPage:e=>y(e),small:!0}}};return c.jsx(T,{table:i})};return c.jsx(p,{})},G=()=>{const h=["Section","Width","Height"];let m=[...Array(175).keys()].map((k,l)=>({Section:l,Width:l*2,Height:l*2}));const o=()=>{const k=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[l,C]=S.useState(10),[A,d]=S.useState(1),[p,a]=S.useState({}),[n,s]=S.useState({});S.useEffect(()=>{d(1)},[p,n]);const u=(A-1)*l,y=l===0?m.length-1:u+l,R=(e,r,x)=>e.filter(f=>Object.keys(r).every(w=>r[w]===""?!0:f[w].toString().includes(r[w]))).sort((f,w)=>Object.entries(x).map(([P,j])=>{switch(j){case"up":return f[P]-w[P];case"down":return w[P]-f[P];default:return 0}}).reduce((P,j)=>P||j,0)),b=(e,r,x,f,w)=>{const P=e.map(v=>{const V=Object.keys(f).includes(v)?f[v]:"",H=`${v[0].toUpperCase()}${v.slice(1)}`;return{key:v,value:H,hasSort:!0,sort:V,onSort:()=>{const $=V===""?"up":V==="up"?"down":"";w({...f,[v]:$})}}}),j=e.map(v=>{const V=Object.keys(r).includes(v)?r[v]:"";return{key:v,value:V,type:"Input",placeholder:"Filter",onChange:H=>x({...r,[v]:H.target.value})}});return{dataSortCells:P,dataFilterCells:j}},{dataSortCells:g,dataFilterCells:F}=b(h,p,a,n,s),D=R(m,p,n),t=[...D.slice(u,y).map(e=>({cells:Object.entries(e).map(([x,f])=>({key:x,value:f,type:"Input",disabled:!0}))}))],i={headers:[{cells:g},{cells:F}],rows:t,footer:{pagination:{rowCount:D.length,selectedPage:A,rowsPerPage:{onChange:e=>{const{value:r}=e.target;C(Number(r))},options:k,value:l},onSelectPage:e=>d(e),small:!0}}};return c.jsx(T,{table:i})};return c.jsx(o,{})},J=()=>{const h={tea:3.6,coffee:3.2,orange:4.1},m=[{label:"Tea",value:"tea"},{label:"Coffee",value:"coffee"},{label:"Orange juice",value:"orange"}],o={cells:[{type:"Select",options:m,value:{value:"tea"}},{type:"Input"},{type:"Static"}]},k=[...Array(15).keys()].map((t,i)=>({cells:[{type:"Select",options:m,value:{value:"tea"}},{type:"Input",value:i+1},{type:"Static"}]})),[l,C]=S.useState(k),A=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[d,p]=S.useState(10),[a,n]=S.useState(1),s=(a-1)*d,u=d===0?l.length-1:s+d,y=({newRow:t}={})=>{const i=K(l,e=>{e.push(t??o)});C(i)},R=({rowIndex:t})=>{const i=K(l,e=>{delete e[t]}).filter(e=>e);C(i)},b=({rowIndex:t,value:i})=>{const e=K(l,r=>{r[t].cells[0].value.value=i});C(e)},g=({rowIndex:t,value:i})=>{const e=K(l,r=>{r[t].cells[1].value=i});C(e)},F=({value:t})=>{const i=Number(t);return!ae.isNaN(i)&&ae.isInteger(i)&&i>0},D=l.slice(s,u).map((t,i)=>{const e=s+i;return l.length-1,{...t,cells:t==null?void 0:t.cells.map((r,x)=>{var v,V,H,$,te;const f=(H=(V=(v=t==null?void 0:t.cells)==null?void 0:v[0])==null?void 0:V.value)==null?void 0:H.value,w=Number((te=($=t==null?void 0:t.cells)==null?void 0:$[1])==null?void 0:te.value),P=h==null?void 0:h[f],j=P&&F({value:w})?(P*w).toFixed(2):null;if(x===0)return{...r,onChange:Z=>b({rowIndex:e,value:Z.target.value})};if(x===1)return{...r,onChange:Z=>g({rowIndex:e,value:Z.target.value}),error:F({value:r.value})?null:"Must be valid whole number"};if(x===2)return{...r,value:j}}),actions:[{label:"Delete",icon:"minus",onClick:()=>R({rowIndex:e})}]}});return c.jsx(T,{table:{defaultEmptyRow:o,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:l.length,selectedPage:a,rowsPerPage:{onChange:t=>{const{value:i}=t.target;p(Number(i))},options:A,value:d},onSelectPage:t=>n(t),small:!0}}}})},X=()=>{const h=["Section","Width","Height"];let m=Array.from(Array(10),(d,p)=>[p,p*2,p*2]);const[o,k]=S.useState({pastedValues:"",rowIndex:0,cellIndex:0}),l=(d,p,a,n)=>{m[p][a]=Number(d.target.value),n()},C=(d,p,a,n)=>{var u;let s=((u=d==null?void 0:d.clipboardData)==null?void 0:u.getData("text"))??"";return k({rowIndex:p,cellIndex:a,pastedValues:s}),n(),{pastedData:o}},A=()=>{const[d,p]=S.useState(!1),a=()=>{p(!d)},n={headers:[{cells:h.map(s=>({value:s}))}],rows:m.map((s,u)=>{const y=u;return{cells:[...Array(3).keys()].map((R,b)=>({value:s[b],type:"Input",onChange:g=>l(g,y,b,a),onPaste:g=>C(g,y,b,a)}))}})};return c.jsxs(c.Fragment,{children:[c.jsx(T,{table:n}),c.jsx(ne,{label:"Pasted Data",children:c.jsx(ee,{value:o.pastedValues})}),c.jsx(ne,{label:"At Row",children:c.jsx(ee,{value:o.rowIndex})}),c.jsx(ne,{label:"At Cell Index",children:c.jsx(ee,{value:o.cellIndex})})]})};return c.jsx(A,{})};var re,se,oe;B.parameters={...B.parameters,docs:{...(re=B.parameters)==null?void 0:re.docs,source:{originalSource:`args => {
2
2
  return <Table
3
3
  // eslint-disable-next-line react/jsx-props-no-spreading
4
4
  {...args} />;
@@ -1 +1 @@
1
- import{j as a}from"./jsx-runtime-f961835c.js";import{I as o,T as c}from"./common-types-2c81813f.js";import{F as v}from"./flex-02e2c67f.js";import{M as p}from"./actions-83a2a04e.js";import{T as d}from"./text-ad1f5f1d.js";import{I as n}from"./icon-8acf9925.js";import{M as r}from"./types-cc224262.js";const e={headers:[{cells:[{value:"Name"},{value:"Weight"},{value:"Energy"},{value:"Origin"}]}],rows:[{cells:[{value:"Brown rice",testId:"table-tbody-cell-brown-rice"},{value:100,testId:"table-tbody-cell-100"},{value:361,testId:"table-tbody-cell-361"},{value:"Vietnam",testId:"table-tbody-cell-vietnam"}]},{cells:[{value:"Buckwheat",testId:"table-tbody-cell-buckwheat"},{value:50,testId:"table-tbody-cell-50"},{value:358,testId:"table-tbody-cell-358"},{value:"Poland",testId:"table-tbody-cell-poland"}]},{cells:[{value:"Couscous",testId:"table-tbody-cell-couscous"},{value:10,testId:"table-tbody-cell-10"},{value:368,testId:"table-tbody-cell-368"},{value:"France",testId:"table-tbody-cell-france"}]}]},S={...e,columnWidths:["200px","20%","100px","auto"]},x={...e,rows:e.rows.map(l=>({...l,cells:l.cells.map(t=>({...t,tooltip:"Tooltip"}))}))},f={...e,rows:e.rows.map(l=>({...l,cells:l.cells.map(t=>({...t,width:"200px"}))}))},W={...e,rows:e.rows.map(l=>({...l,cells:l.cells.map(t=>({...t,style:{width:"200px",background:"var(--color-background-table-header)",fontWeight:"bold"}}))}))},F={...e,rows:[{cells:[{breakWord:!0,value:"LoremipsumdolorsitametconsecteturadipiscingelitseddoeiusmodtemporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeufugiatnullapariaturufugiatnullapariatur"},{value:100},{value:361},{value:"Vietnam"}]},...e.rows]},L={...e,headers:[...e.headers,{cells:[{},{options:[{label:"kg",value:"kg"},{label:"tonnes",value:"tonnes"}],type:"Select",searchable:!1,value:{label:"kg",value:"kg"},onChange:()=>{}},{type:"Unit",value:"kcal / 100g"},{}]}]},A={...e,rows:e.rows.map((l,t)=>({...l,active:t===0,onRowClick:()=>{}}))},D={...e,name:"Food"},E={...e,name:a.jsxs(v,{gap:"var(--padding-xs)",alignItems:"center",children:["Food",a.jsx(n,{icon:o.STAR})]})},u=[{childComponent:a.jsx(p,{menu:{label:"Import food",trigger:c.DROP_DOWN_BUTTON,sections:[{type:r.HEADING,label:"Import options"},{type:r.OPTION,label:"Import from csv"},{type:r.OPTION,label:"Import from library"}],small:!0}})}],P={...e,name:"Food",actions:u,testId:"table-child-component"},V={...e,actions:u,actionsRight:!0},i={...e,headers:[...e.headers,{cells:[{},{options:[{label:"kg",value:"kg"},{label:"tonnes",value:"tonnes"}],type:"Select",native:!0,value:{label:"kg",value:"kg"},onChange:()=>{}},{type:"Unit",value:"kcal / 100g"},{}]}],bordered:!0,infiniteScroll:!0,maxHeight:"500px",stickyHeaders:!0,rows:Array.from({length:100},(l,t)=>({cells:[{type:"Input",value:`Strawberry Letter ${t+1}`},{type:"Input",value:100},{type:"Input",value:361},{type:"Input",value:"Vietnam"}]})),footer:{content:a.jsxs(a.Fragment,{children:[a.jsx("strong",{children:"Footer content:"})," goes here"]})}},B={...i,maxHeight:"100%"},O={...i,rows:Array.from({length:1},(l,t)=>({cells:[{type:"Input",value:`Strawberry Letter ${t+1}`},{type:"Input",value:100},{type:"Input",value:361},{type:"Input",value:"Vietnam"}]}))},j={...i,draggable:!0},N={...e,rows:e.rows.map(l=>({...l,onRowFocus:()=>{}}))},b=()=>a.jsxs("ul",{children:[a.jsx("li",{children:"Carrots"}),a.jsx("li",{children:"Chocolate"}),a.jsx("li",{children:"Chorizo"})]}),T={headers:[{cells:[{value:"Name"},{value:"Content"}]}],rows:[{cells:[{value:"Sub-component"},{value:b()}]},{cells:[{value:"JSX"},{value:a.jsxs("div",{children:["Some ",a.jsx(d,{bold:!0,children:"bold content"})]})}]}]},m={...e,headers:[{cells:[{value:""},{value:"Stats",colSpan:2},{value:""}]},...e.headers],rows:[...e.rows,{cells:[{value:"Total",colSpan:4}]}]},H={...e,headers:[{cells:[{value:"Name",colSpan:2},{value:"Origin",rowSpan:2}]},{cells:[{value:"English"},{value:"Chinese"}]}],rows:[{cells:[{type:"Input",value:"Brown rice"},{type:"Input",value:"糙米"},{type:"Select",options:[{label:"China",value:"China"},{label:"France",value:"France"},{label:"Poland",value:"Poland"}],value:{label:"China",value:"China"},rowSpan:2}]},{cells:[{type:"Input",value:"White rice"},{type:"Input",value:"白米"}]}]},q={...e,columnWidths:["auto","120px","120px","auto"],headers:[{cells:[{value:"Header"},{value:"Header",colSpan:2},{value:"Header"}]}]},R={...e,columnAlignment:["left","right","right","left"]},M={...m,columnAlignment:["left","right","right","left","right"],columnHeaderAlignments:[["","center",""],["","right","right",""]]},s={fixedWidth:"auto",headers:[{cells:[{value:"Input",testId:"with-editable-cells-cell-name",width:"140px"},{value:"Select (native)",width:"140px"},{value:"Number Input",width:"140px"},{value:"Select (custom)",width:"140px"},{value:"Slider",width:"140px"},{value:"Static"}]}],rows:[{cells:[{value:"Buckwheat",type:"Input",onChange:()=>{},testId:"table-tbody-cell-buckwheat"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{}},{value:361,type:"NumberInput",onChange:()=>{}},{type:"Select",options:[{label:"France",value:"France"},{label:"Poland",value:"Poland"},{label:"Vietnam",value:"Vietnam"}],value:{label:"Poland",value:"Poland"},onChange:()=>{}},{type:"Slider",value:50,min:0,max:100,onChange:()=>{}},{value:361}]},{cells:[{value:"Arborio rice",type:"Input",onChange:()=>{},testId:"table-tbody-cell-arborio",error:"Error"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{},error:"Error"},{value:361,type:"NumberInput",onChange:()=>{},error:"Error"},{type:"Select",options:[{label:"France",value:"France"},{label:"Italy",value:"Italy"},{label:"Vietnam",value:"Vietnam"}],value:{label:"Italy",value:"Italy"},onChange:()=>{},error:"Error"},{type:"Slider",value:50,min:0,max:100,onChange:()=>{},error:"Error"},{value:361,error:"Error"}]},{cells:[{value:"Couscous",type:"Input",onChange:()=>{},testId:"table-tbody-cell-couscous",warning:"Warning"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{},warning:"Warning"},{value:361,type:"NumberInput",onChange:()=>{},warning:"Warning"},{type:"Select",options:[{label:"France",value:"France"},{label:"Poland",value:"Poland"},{label:"Vietnam",value:"Vietnam"}],value:{label:"France",value:"France"},onChange:()=>{},warning:"Warning"},{type:"Slider",value:50,min:0,max:100,onChange:()=>{},warning:"Warning"},{value:361,warning:"Warning"}]}]},U={...e,headers:e.headers.map(l=>({...l,cells:[{type:"CheckBox",onChange:()=>{}},...l.cells]})),rows:e.rows.map(l=>({...l,cells:[{type:"CheckBox",onChange:()=>{}},...l.cells]}))},z={...s,rows:s.rows.map(l=>({...l,cells:l.cells.map(t=>({...t,disabled:!0}))}))},_={...e,headers:[...e.headers,{cells:[{value:"",type:"Input",placeholder:"Search",onChange:()=>{}},{value:"",type:"Input",placeholder:"Search",onChange:()=>{}},{value:"",type:"Input",placeholder:"Search",onChange:()=>{}},{value:"",type:"Input",placeholder:"Search",onChange:()=>{}}]}]},G={headers:[{cells:[{value:"Name"},{value:"Weight (kg)",hasSort:!0,sort:"up",sortPriority:1,onSort:()=>{}},{value:"Energy (kcal / 100g)",hasSort:!0,sort:"down",sortPriority:2,onSort:()=>{}},{value:"Origin",hasSort:!0,sort:"",sortPriority:1,onSort:()=>{}}]}],rows:[{cells:[{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"}]}]},J={headers:[{cells:[{},{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"}]}],rows:[{cells:[{type:"Icon",icon:a.jsx(n,{icon:o.SUCCESS,color:"var(--color-text-success)"}),tooltip:"Success tooltip here",width:"var(--size)"},{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"}]},{cells:[{type:"Icon",icon:a.jsx(n,{icon:o.WARNING,color:"var(--color-text-warning)"}),tooltip:"Warning tooltip here",width:"var(--size)"},{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}]},{cells:[{type:"Icon",icon:a.jsx(n,{icon:o.ERROR,color:"var(--color-text-error)"}),tooltip:"Error tooltip here",width:"var(--size)"},{value:"Couscous"},{value:10},{value:368},{value:"France"}]}]},$={headers:[{cells:[{value:"Lorem"},{value:"Ipsum"}]}],rows:[{cells:[{type:"Link",value:"Link text",onClick:()=>console.log("Link clicked")},{type:"Link",value:"Disabled link text",disabled:!0,onClick:()=>console.log("Link clicked")}]},{cells:[{type:"Link",value:"Static warning link",warning:"Warning message",onClick:()=>console.log("Link clicked")},{type:"Link",value:"Static error link",error:"Error message",onClick:()=>console.log("Link clicked")}]}]},X={headers:[{cells:[{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{}}]}],rows:[{cells:[{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{label:"test",icon:"minus",onClick:()=>{},hidden:!0}]}]},K={headers:[{cells:[{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"}],actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{}}]}],rows:[{cells:[{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"}],actions:[{label:"More",subActions:[{label:"Move Up",icon:"up",onClick:()=>{}},{label:"Move Down",icon:"down",onClick:()=>{}}]},{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}],actions:[{label:"More",subActions:[{label:"Move Up",icon:"up",onClick:()=>{}},{label:"Move Down",icon:"down",onClick:()=>{}}]},{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"}],actions:[{label:"More",subActions:[{label:"Move Up",icon:"up",onClick:()=>{}},{label:"Move Down",icon:"down",onClick:()=>{}}]},{label:"Delete",icon:"minus",onClick:()=>{}}]}]},Q={...e,footer:{content:a.jsxs(a.Fragment,{children:[a.jsx("strong",{children:"Footer content:"})," goes here"]}),pagination:{rowCount:500,selectedPage:10,rowsPerPage:{onChange:()=>{},options:[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],value:20},goTo:{onChange:()=>{}},onSelectPage:()=>{},small:!0},actions:[{label:"Star",icon:"star",onClick:()=>{}}]}},Y={...e,headers:e.headers.map(l=>({...l,cells:l.cells.map(t=>({...t,helpIcon:{onClick:()=>console.log("Help clicked"),tooltip:"Help text goes here"},libraryIcon:{onClick:()=>console.log("Library clicked"),tooltip:"Edit in library"}}))}))},Z={columnWidths:[void 0,"100px","100px","100px",void 0],columnAlignment:["left","right","left","left","left","right"],columnHeaderAlignments:[["left","right","left","left","left","right"]],headers:[{cells:[{value:"Lorem ipsum dolor sit amet consectetur adipiscing elit sed doeius mod tempor incididunt laboreet dolore magna aliqua"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"},{value:"Static"},{value:"Static Right"}]}],rows:[{cells:[{breakWord:!0,value:"LoremipsumdolorsitametconsecteturadipiscingelitseddoeiusmodtemporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeufugiatnullapariaturufugiatnullapariatur"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{},disabled:!0},{type:"Select",options:[{label:"Vietnam",value:"Vietnam"},{label:"Other",value:"Other"}],value:{label:"Vietnam",value:"Vietnam"},onChange:()=>{},error:"Error"},{value:"Brown rice",type:"Input",onChange:()=>{},testId:"table-tbody-cell-brown-rice",warning:"Warning message"},{value:"Static warning",warning:"Warning message"},{value:"100"}]},{cells:[{value:"Buckwheat"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{}},{type:"Select",options:[{label:"Vietnam",value:"Vietnam"},{label:"Other",value:"Other"}],value:{label:"Vietnam",value:"Vietnam"},onChange:()=>{}},{value:"Brown rice",type:"Input",onChange:()=>{},testId:"table-tbody-cell-brown-rice"},{type:"Link",value:"Static error link",error:"Error message"},{value:"100"}]}]};export{U as A,J as B,$ as C,X as D,K as E,T as F,x as G,F as H,Z as I,S as a,R as b,M as c,i as d,B as e,O as f,j as g,L as h,A as i,D as j,E as k,P as l,_ as m,G as n,V as o,Y as p,N as q,Q as r,s,e as t,z as u,m as v,q as w,f as x,W as y,H as z};
1
+ import{j as a}from"./jsx-runtime-f961835c.js";import{I as o,T as c}from"./common-types-2c81813f.js";import{F as v}from"./flex-1d14d86c.js";import{M as p}from"./actions-83a2a04e.js";import{T as d}from"./text-ad1f5f1d.js";import{I as n}from"./icon-8acf9925.js";import{M as r}from"./types-cc224262.js";const e={headers:[{cells:[{value:"Name"},{value:"Weight"},{value:"Energy"},{value:"Origin"}]}],rows:[{cells:[{value:"Brown rice",testId:"table-tbody-cell-brown-rice"},{value:100,testId:"table-tbody-cell-100"},{value:361,testId:"table-tbody-cell-361"},{value:"Vietnam",testId:"table-tbody-cell-vietnam"}]},{cells:[{value:"Buckwheat",testId:"table-tbody-cell-buckwheat"},{value:50,testId:"table-tbody-cell-50"},{value:358,testId:"table-tbody-cell-358"},{value:"Poland",testId:"table-tbody-cell-poland"}]},{cells:[{value:"Couscous",testId:"table-tbody-cell-couscous"},{value:10,testId:"table-tbody-cell-10"},{value:368,testId:"table-tbody-cell-368"},{value:"France",testId:"table-tbody-cell-france"}]}]},S={...e,columnWidths:["200px","20%","100px","auto"]},x={...e,rows:e.rows.map(l=>({...l,cells:l.cells.map(t=>({...t,tooltip:"Tooltip"}))}))},f={...e,rows:e.rows.map(l=>({...l,cells:l.cells.map(t=>({...t,width:"200px"}))}))},W={...e,rows:e.rows.map(l=>({...l,cells:l.cells.map(t=>({...t,style:{width:"200px",background:"var(--color-background-table-header)",fontWeight:"bold"}}))}))},F={...e,rows:[{cells:[{breakWord:!0,value:"LoremipsumdolorsitametconsecteturadipiscingelitseddoeiusmodtemporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeufugiatnullapariaturufugiatnullapariatur"},{value:100},{value:361},{value:"Vietnam"}]},...e.rows]},L={...e,headers:[...e.headers,{cells:[{},{options:[{label:"kg",value:"kg"},{label:"tonnes",value:"tonnes"}],type:"Select",searchable:!1,value:{label:"kg",value:"kg"},onChange:()=>{}},{type:"Unit",value:"kcal / 100g"},{}]}]},A={...e,rows:e.rows.map((l,t)=>({...l,active:t===0,onRowClick:()=>{}}))},D={...e,name:"Food"},E={...e,name:a.jsxs(v,{gap:"var(--padding-xs)",alignItems:"center",children:["Food",a.jsx(n,{icon:o.STAR})]})},u=[{childComponent:a.jsx(p,{menu:{label:"Import food",trigger:c.DROP_DOWN_BUTTON,sections:[{type:r.HEADING,label:"Import options"},{type:r.OPTION,label:"Import from csv"},{type:r.OPTION,label:"Import from library"}],small:!0}})}],P={...e,name:"Food",actions:u,testId:"table-child-component"},V={...e,actions:u,actionsRight:!0},i={...e,headers:[...e.headers,{cells:[{},{options:[{label:"kg",value:"kg"},{label:"tonnes",value:"tonnes"}],type:"Select",native:!0,value:{label:"kg",value:"kg"},onChange:()=>{}},{type:"Unit",value:"kcal / 100g"},{}]}],bordered:!0,infiniteScroll:!0,maxHeight:"500px",stickyHeaders:!0,rows:Array.from({length:100},(l,t)=>({cells:[{type:"Input",value:`Strawberry Letter ${t+1}`},{type:"Input",value:100},{type:"Input",value:361},{type:"Input",value:"Vietnam"}]})),footer:{content:a.jsxs(a.Fragment,{children:[a.jsx("strong",{children:"Footer content:"})," goes here"]})}},B={...i,maxHeight:"100%"},O={...i,rows:Array.from({length:1},(l,t)=>({cells:[{type:"Input",value:`Strawberry Letter ${t+1}`},{type:"Input",value:100},{type:"Input",value:361},{type:"Input",value:"Vietnam"}]}))},j={...i,draggable:!0},N={...e,rows:e.rows.map(l=>({...l,onRowFocus:()=>{}}))},b=()=>a.jsxs("ul",{children:[a.jsx("li",{children:"Carrots"}),a.jsx("li",{children:"Chocolate"}),a.jsx("li",{children:"Chorizo"})]}),T={headers:[{cells:[{value:"Name"},{value:"Content"}]}],rows:[{cells:[{value:"Sub-component"},{value:b()}]},{cells:[{value:"JSX"},{value:a.jsxs("div",{children:["Some ",a.jsx(d,{bold:!0,children:"bold content"})]})}]}]},m={...e,headers:[{cells:[{value:""},{value:"Stats",colSpan:2},{value:""}]},...e.headers],rows:[...e.rows,{cells:[{value:"Total",colSpan:4}]}]},H={...e,headers:[{cells:[{value:"Name",colSpan:2},{value:"Origin",rowSpan:2}]},{cells:[{value:"English"},{value:"Chinese"}]}],rows:[{cells:[{type:"Input",value:"Brown rice"},{type:"Input",value:"糙米"},{type:"Select",options:[{label:"China",value:"China"},{label:"France",value:"France"},{label:"Poland",value:"Poland"}],value:{label:"China",value:"China"},rowSpan:2}]},{cells:[{type:"Input",value:"White rice"},{type:"Input",value:"白米"}]}]},q={...e,columnWidths:["auto","120px","120px","auto"],headers:[{cells:[{value:"Header"},{value:"Header",colSpan:2},{value:"Header"}]}]},R={...e,columnAlignment:["left","right","right","left"]},M={...m,columnAlignment:["left","right","right","left","right"],columnHeaderAlignments:[["","center",""],["","right","right",""]]},s={fixedWidth:"auto",headers:[{cells:[{value:"Input",testId:"with-editable-cells-cell-name",width:"140px"},{value:"Select (native)",width:"140px"},{value:"Number Input",width:"140px"},{value:"Select (custom)",width:"140px"},{value:"Slider",width:"140px"},{value:"Static"}]}],rows:[{cells:[{value:"Buckwheat",type:"Input",onChange:()=>{},testId:"table-tbody-cell-buckwheat"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{}},{value:361,type:"NumberInput",onChange:()=>{}},{type:"Select",options:[{label:"France",value:"France"},{label:"Poland",value:"Poland"},{label:"Vietnam",value:"Vietnam"}],value:{label:"Poland",value:"Poland"},onChange:()=>{}},{type:"Slider",value:50,min:0,max:100,onChange:()=>{}},{value:361}]},{cells:[{value:"Arborio rice",type:"Input",onChange:()=>{},testId:"table-tbody-cell-arborio",error:"Error"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{},error:"Error"},{value:361,type:"NumberInput",onChange:()=>{},error:"Error"},{type:"Select",options:[{label:"France",value:"France"},{label:"Italy",value:"Italy"},{label:"Vietnam",value:"Vietnam"}],value:{label:"Italy",value:"Italy"},onChange:()=>{},error:"Error"},{type:"Slider",value:50,min:0,max:100,onChange:()=>{},error:"Error"},{value:361,error:"Error"}]},{cells:[{value:"Couscous",type:"Input",onChange:()=>{},testId:"table-tbody-cell-couscous",warning:"Warning"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{},warning:"Warning"},{value:361,type:"NumberInput",onChange:()=>{},warning:"Warning"},{type:"Select",options:[{label:"France",value:"France"},{label:"Poland",value:"Poland"},{label:"Vietnam",value:"Vietnam"}],value:{label:"France",value:"France"},onChange:()=>{},warning:"Warning"},{type:"Slider",value:50,min:0,max:100,onChange:()=>{},warning:"Warning"},{value:361,warning:"Warning"}]}]},U={...e,headers:e.headers.map(l=>({...l,cells:[{type:"CheckBox",onChange:()=>{}},...l.cells]})),rows:e.rows.map(l=>({...l,cells:[{type:"CheckBox",onChange:()=>{}},...l.cells]}))},z={...s,rows:s.rows.map(l=>({...l,cells:l.cells.map(t=>({...t,disabled:!0}))}))},_={...e,headers:[...e.headers,{cells:[{value:"",type:"Input",placeholder:"Search",onChange:()=>{}},{value:"",type:"Input",placeholder:"Search",onChange:()=>{}},{value:"",type:"Input",placeholder:"Search",onChange:()=>{}},{value:"",type:"Input",placeholder:"Search",onChange:()=>{}}]}]},G={headers:[{cells:[{value:"Name"},{value:"Weight (kg)",hasSort:!0,sort:"up",sortPriority:1,onSort:()=>{}},{value:"Energy (kcal / 100g)",hasSort:!0,sort:"down",sortPriority:2,onSort:()=>{}},{value:"Origin",hasSort:!0,sort:"",sortPriority:1,onSort:()=>{}}]}],rows:[{cells:[{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"}]}]},J={headers:[{cells:[{},{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"}]}],rows:[{cells:[{type:"Icon",icon:a.jsx(n,{icon:o.SUCCESS,color:"var(--color-text-success)"}),tooltip:"Success tooltip here",width:"var(--size)"},{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"}]},{cells:[{type:"Icon",icon:a.jsx(n,{icon:o.WARNING,color:"var(--color-text-warning)"}),tooltip:"Warning tooltip here",width:"var(--size)"},{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}]},{cells:[{type:"Icon",icon:a.jsx(n,{icon:o.ERROR,color:"var(--color-text-error)"}),tooltip:"Error tooltip here",width:"var(--size)"},{value:"Couscous"},{value:10},{value:368},{value:"France"}]}]},$={headers:[{cells:[{value:"Lorem"},{value:"Ipsum"}]}],rows:[{cells:[{type:"Link",value:"Link text",onClick:()=>console.log("Link clicked")},{type:"Link",value:"Disabled link text",disabled:!0,onClick:()=>console.log("Link clicked")}]},{cells:[{type:"Link",value:"Static warning link",warning:"Warning message",onClick:()=>console.log("Link clicked")},{type:"Link",value:"Static error link",error:"Error message",onClick:()=>console.log("Link clicked")}]}]},X={headers:[{cells:[{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{}}]}],rows:[{cells:[{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{label:"test",icon:"minus",onClick:()=>{},hidden:!0}]}]},K={headers:[{cells:[{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"}],actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{}}]}],rows:[{cells:[{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"}],actions:[{label:"More",subActions:[{label:"Move Up",icon:"up",onClick:()=>{}},{label:"Move Down",icon:"down",onClick:()=>{}}]},{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}],actions:[{label:"More",subActions:[{label:"Move Up",icon:"up",onClick:()=>{}},{label:"Move Down",icon:"down",onClick:()=>{}}]},{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"}],actions:[{label:"More",subActions:[{label:"Move Up",icon:"up",onClick:()=>{}},{label:"Move Down",icon:"down",onClick:()=>{}}]},{label:"Delete",icon:"minus",onClick:()=>{}}]}]},Q={...e,footer:{content:a.jsxs(a.Fragment,{children:[a.jsx("strong",{children:"Footer content:"})," goes here"]}),pagination:{rowCount:500,selectedPage:10,rowsPerPage:{onChange:()=>{},options:[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],value:20},goTo:{onChange:()=>{}},onSelectPage:()=>{},small:!0},actions:[{label:"Star",icon:"star",onClick:()=>{}}]}},Y={...e,headers:e.headers.map(l=>({...l,cells:l.cells.map(t=>({...t,helpIcon:{onClick:()=>console.log("Help clicked"),tooltip:"Help text goes here"},libraryIcon:{onClick:()=>console.log("Library clicked"),tooltip:"Edit in library"}}))}))},Z={columnWidths:[void 0,"100px","100px","100px",void 0],columnAlignment:["left","right","left","left","left","right"],columnHeaderAlignments:[["left","right","left","left","left","right"]],headers:[{cells:[{value:"Lorem ipsum dolor sit amet consectetur adipiscing elit sed doeius mod tempor incididunt laboreet dolore magna aliqua"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"},{value:"Static"},{value:"Static Right"}]}],rows:[{cells:[{breakWord:!0,value:"LoremipsumdolorsitametconsecteturadipiscingelitseddoeiusmodtemporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeufugiatnullapariaturufugiatnullapariatur"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{},disabled:!0},{type:"Select",options:[{label:"Vietnam",value:"Vietnam"},{label:"Other",value:"Other"}],value:{label:"Vietnam",value:"Vietnam"},onChange:()=>{},error:"Error"},{value:"Brown rice",type:"Input",onChange:()=>{},testId:"table-tbody-cell-brown-rice",warning:"Warning message"},{value:"Static warning",warning:"Warning message"},{value:"100"}]},{cells:[{value:"Buckwheat"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{}},{type:"Select",options:[{label:"Vietnam",value:"Vietnam"},{label:"Other",value:"Other"}],value:{label:"Vietnam",value:"Vietnam"},onChange:()=>{}},{value:"Brown rice",type:"Input",onChange:()=>{},testId:"table-tbody-cell-brown-rice"},{type:"Link",value:"Static error link",error:"Error message"},{value:"100"}]}]};export{U as A,J as B,$ as C,X as D,K as E,T as F,x as G,F as H,Z as I,S as a,R as b,M as c,i as d,B as e,O as f,j as g,L as h,A as i,D as j,E as k,P as l,_ as m,G as n,V as o,Y as p,N as q,Q as r,s,e as t,z as u,m as v,q as w,f as x,W as y,H as z};
@@ -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:'"-moz-initial"'},{value:'"inherit"'},{value:'"initial"'},{value:'"revert"'},{value:'"revert-layer"'},{value:'"unset"'},{value:'"block"'},{value:'"both"'},{value:'"horizontal"'},{value:'"inline"'},{value:'"none"'},{value:'"vertical"'}]}},monospace:{defaultValue:{value:"false"},description:"",name:"monospace",required:!1,type:{name:"boolean"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}export{i as T};
1
+ 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-72dda6a0.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 => {
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-cf018f89.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-35274dd0.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-27bfe219.js";import"./select-83e9d851.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-7cb3ea4d.js";import"./index-54f0d271.js";import"./check-box-b38490e5.js";import"./slider-5d5442fe.js";import"./index-c7f280f6.js";import"./popover-c1234faa.js";import"./flex-02e2c67f.js";const kr={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 => {
1
+ import{j as B}from"./jsx-runtime-f961835c.js";import{T as X}from"./table-24be8f4e.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-27bfe219.js";import"./select-83e9d851.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-7cb3ea4d.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 kr={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} />;
@@ -1,3 +1,3 @@
1
- import{j as s}from"./jsx-runtime-f961835c.js";import{T as p}from"./tooltip-856042a7.js";import{M as m}from"./actions-83a2a04e.js";import{m as n}from"./menu.stories-data-53e2c46a.js";import"./index-f80c8c95.js";import"./index-3d476d02.js";import"./index-a80ed1cf.js";import"./lodash-75c70a11.js";import"./common-types-2c81813f.js";import"./disabled-context-d654f6ff.js";import"./button-050c998a.js";import"./spinner-a81ebe38.js";import"./icon-8acf9925.js";import"./inheritsLoose-c82a83d4.js";import"./tslib.es6-dfef685f.js";import"./index-c89a1915.js";import"./types-cc224262.js";import"./types-332ceaf3.js";import"./badge-20e7ee0b.js";import"./flex-02e2c67f.js";const R={title:"Basic/Tooltip/Test Cases",component:p,args:{text:"Tooltip text"}},a=i=>s.jsx(p,{...i}),o=a.bind({});o.args={children:s.jsx(m,{menu:n}),placement:"bottom-end",display:"inline-block"};var t,r,e;o.parameters={...o.parameters,docs:{...(t=o.parameters)==null?void 0:t.docs,source:{originalSource:`args => <Tooltip
1
+ import{j as s}from"./jsx-runtime-f961835c.js";import{T as p}from"./tooltip-856042a7.js";import{M as m}from"./actions-83a2a04e.js";import{m as n}from"./menu.stories-data-28e27478.js";import"./index-f80c8c95.js";import"./index-3d476d02.js";import"./index-a80ed1cf.js";import"./lodash-75c70a11.js";import"./common-types-2c81813f.js";import"./disabled-context-d654f6ff.js";import"./button-050c998a.js";import"./spinner-a81ebe38.js";import"./icon-8acf9925.js";import"./inheritsLoose-c82a83d4.js";import"./tslib.es6-dfef685f.js";import"./index-c89a1915.js";import"./types-cc224262.js";import"./types-332ceaf3.js";import"./badge-20e7ee0b.js";import"./flex-1d14d86c.js";const R={title:"Basic/Tooltip/Test Cases",component:p,args:{text:"Tooltip text"}},a=i=>s.jsx(p,{...i}),o=a.bind({});o.args={children:s.jsx(m,{menu:n}),placement:"bottom-end",display:"inline-block"};var t,r,e;o.parameters={...o.parameters,docs:{...(t=o.parameters)==null?void 0:t.docs,source:{originalSource:`args => <Tooltip
2
2
  // eslint-disable-next-line react/jsx-props-no-spreading
3
3
  {...args} />`,...(e=(r=o.parameters)==null?void 0:r.docs)==null?void 0:e.source}}};const S=["CloseWhenMenuOpen"];export{o as CloseWhenMenuOpen,S as __namedExportsOrder,R as default};
@@ -357,7 +357,7 @@
357
357
  }
358
358
  </script>
359
359
 
360
- <script type="module" crossorigin src="./assets/iframe-e4f07b05.js"></script>
360
+ <script type="module" crossorigin src="./assets/iframe-947f9c55.js"></script>
361
361
  </head>
362
362
 
363
363
  <body>
@@ -1 +1 @@
1
- {"generatedAt":1704717437701,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":false,"hasStorybookEslint":true,"refCount":0,"packageManager":{"type":"yarn","version":"1.22.19"},"features":{"storyStoreV7":true},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/react-vite","options":{}},"builder":"@storybook/builder-vite","renderer":"@storybook/react","storybookVersion":"7.5.3","storybookVersionSpecifier":"^7.5.3","language":"typescript","storybookPackages":{"@storybook/addon-essentials":{"version":"7.5.3"},"@storybook/addon-links":{"version":"7.5.3"},"@storybook/addons":{"version":"7.5.3"},"@storybook/react":{"version":"7.5.3"},"@storybook/react-vite":{"version":"7.5.3"},"eslint-plugin-storybook":{"version":"0.6.15"},"storybook":{"version":"7.5.3"}},"addons":{"@storybook/addon-actions":{"version":"7.5.3"},"@storybook/addon-docs":{"version":"7.5.3"},"storybook-dark-mode":{"version":"3.0.3"}}}
1
+ {"generatedAt":1704722869270,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":false,"hasStorybookEslint":true,"refCount":0,"packageManager":{"type":"yarn","version":"1.22.19"},"features":{"storyStoreV7":true},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/react-vite","options":{}},"builder":"@storybook/builder-vite","renderer":"@storybook/react","storybookVersion":"7.5.3","storybookVersionSpecifier":"^7.5.3","language":"typescript","storybookPackages":{"@storybook/addon-essentials":{"version":"7.5.3"},"@storybook/addon-links":{"version":"7.5.3"},"@storybook/addons":{"version":"7.5.3"},"@storybook/react":{"version":"7.5.3"},"@storybook/react-vite":{"version":"7.5.3"},"eslint-plugin-storybook":{"version":"0.6.15"},"storybook":{"version":"7.5.3"}},"addons":{"@storybook/addon-actions":{"version":"7.5.3"},"@storybook/addon-docs":{"version":"7.5.3"},"storybook-dark-mode":{"version":"3.0.3"}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/react-ui-library",
3
- "version": "4.0.0-beta-73",
3
+ "version": "4.0.0-beta-74",
4
4
  "description": "Reusable UI components for React projects",
5
5
  "homepage": "https://oliasoft-open-source.gitlab.io/react-ui-library",
6
6
  "bugs": {
@@ -1 +0,0 @@
1
- import{_ as e}from"./iframe-e4f07b05.js";import"../sb-preview/runtime.js";var a={docs:{renderer:async()=>{let{DocsRenderer:r}=await e(()=>import("./DocsRenderer-NNNQARDV-30ed94ed.js"),["./DocsRenderer-NNNQARDV-30ed94ed.js","./chunk-HLWAVYOI-dd64d35e.js","./iframe-e4f07b05.js","./index-f80c8c95.js","./react-16-147b12fd.js","./index-3d476d02.js","./index-39f0d819.js","./extends-98964cd2.js","./assertThisInitialized-081f9914.js","./inheritsLoose-c82a83d4.js","./index-cf68f115.js"],import.meta.url);return new r}}};export{a as parameters};
@@ -1 +0,0 @@
1
- ._inputInTable_cydch_1{background-color:transparent;border-radius:inherit!important;height:var(--size);min-height:100%}._inputInTable_cydch_1:not(:hover){border-color:transparent}._inputInTable_cydch_1:not(:focus){box-shadow:none}._inputHover_cydch_13{position:relative;border-color:var(--color-border-hover);z-index:2}._inputFocus_cydch_18{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputError_cydch_25,._inputWarning_cydch_26{position:relative}._inputError_cydch_25{z-index:2;border-color:var(--color-border-error);color:var(--color-text-error)!important;background-color:var(--color-background-error-muted)}._inputError_cydch_25:hover{border-color:var(--color-border-error-hover)!important}._inputError_cydch_25:focus{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputWarning_cydch_26{z-index:1;border-color:var(--color-border-warning);color:var(--color-text-warning)!important;background-color:var(--color-background-warning-muted)}._inputWarning_cydch_26:hover{border-color:var(--color-border-warning-hover)!important}._inputWarning_cydch_26:focus{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputDisabled_cydch_61{pointer-events:none;background-color:var(--color-background-disabled);color:var(--color-text-muted);box-shadow:none}._hideScrollbars_cydch_67{scrollbar-width:none;-ms-overflow-style:none}._hideScrollbars_cydch_67::-webkit-scrollbar{display:none}:root{--color-background-table-header: var(--color-neutral-150);--color-background-table-row-tinted: var(--color-neutral-50)}html[data-theme=dark]{--color-background-table-header: var(--color-neutral-800);--color-background-table-row-tinted: rgba(255, 255, 255, .025)}._wrapper_cydch_85{border-radius:inherit;max-height:100%;max-width:100%;display:flex;flex-direction:column;overflow:hidden}._wrapper_cydch_85._bordered_cydch_93{border-radius:var(--border-radius);border:1px solid var(--color-border);box-shadow:var(--shadow-card)}._scroll_cydch_98{overflow-y:auto;border-radius:inherit;flex:1;min-height:0}._scroll_cydch_98:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}._table_cydch_108{background:var(--color-background-raised);color:var(--color-text);border-collapse:separate;border-spacing:0;border-radius:inherit;width:100%;font-variant-numeric:tabular-nums}._table_cydch_108>:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}._table_cydch_108>:first-child>:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}._table_cydch_108>:first-child>:first-child>:first-child{border-top-left-radius:inherit}._table_cydch_108>:first-child>:first-child>:last-child{border-top-right-radius:inherit}._table_cydch_108>:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}._table_cydch_108>:last-child>:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}._table_cydch_108>:last-child>:last-child>:first-child{border-bottom-left-radius:inherit}._table_cydch_108>:last-child>:last-child>:last-child{border-bottom-right-radius:inherit}th,td{padding:var(--padding-input)!important;height:var(--size);background:inherit;border-color:var(--color-border);border-style:solid;border-width:0}th:not(:first-child),td:not(:first-child){border-left-width:1px}._table_cydch_108>*:not(:last-child)>tr th,._table_cydch_108>*:not(:last-child)>tr td,._table_cydch_108>*:last-child>tr:not(:last-child) th,._table_cydch_108>*:last-child>tr:not(:last-child) td{border-bottom-width:1px}@-moz-document url-prefix(){tr{height:var(--size)}td,th{height:100%}}thead{position:sticky;top:0;overflow:hidden;z-index:5}thead tr{background-color:var(--color-background-table-header)}tbody{overflow:hidden}tbody tr{background-color:var(--color-background-raised)}._striped_cydch_188 tbody tr:nth-child(2n){background-color:var(--color-background-table-row-tinted)}._title_11pbp_1{background-color:var(--color-background-cardheader);border-bottom:1px solid var(--color-border);padding:var(--padding-xxs) var(--padding-sm);display:flex;align-items:center;justify-content:space-between;gap:4px;width:100%;border-top-left-radius:inherit;border-top-right-radius:inherit}._footer_4sumy_1{background-color:var(--color-background-table-header);z-index:4;overflow:hidden;flex-shrink:0}._section_4sumy_7{padding:var(--padding-input);display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--color-border)}._clickableRow_11d5t_1{cursor:pointer}._hoverableRow_11d5t_4:not(._rowActive_11d5t_4):hover,._clickableRow_11d5t_1:not(._rowActive_11d5t_4):hover{background-color:var(--color-background-listitem-hover)!important}._expandableRow_11d5t_8._flush_11d5t_8{padding:0!important;height:auto!important}._rowActive_11d5t_4{position:relative;background-color:var(--color-background-listitem-active)!important}._rowActive_11d5t_4:after{content:"";position:absolute;left:0;top:0;bottom:0;width:2px;border-top-left-radius:inherit;border-bottom-left-radius:inherit;transition:background .3s;background:var(--color-background-primary)}._dragIconCell_11d5t_28{width:var(--size);min-width:var(--size);position:relative}._dragIcon_11d5t_28{display:flex;align-items:center;justify-content:center;position:absolute;top:0;right:0;bottom:0;left:0;color:var(--color-text-faint)}._dragIcon_11d5t_28:hover{color:var(--color-text-primary-hover)}._dragIcon_11d5t_28:active{color:var(--color-text-primary-active)}._inputInTable_u3xdj_1{background-color:transparent;border-radius:inherit!important;height:var(--size);min-height:100%}._inputInTable_u3xdj_1:not(:hover){border-color:transparent}._inputInTable_u3xdj_1:not(:focus){box-shadow:none}._inputHover_u3xdj_13{position:relative;border-color:var(--color-border-hover);z-index:2}._inputFocus_u3xdj_18{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputError_u3xdj_25,._inputWarning_u3xdj_26{position:relative}._inputError_u3xdj_25{z-index:2;border-color:var(--color-border-error);color:var(--color-text-error)!important;background-color:var(--color-background-error-muted)}._inputError_u3xdj_25:hover{border-color:var(--color-border-error-hover)!important}._inputError_u3xdj_25:focus{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputWarning_u3xdj_26{z-index:1;border-color:var(--color-border-warning);color:var(--color-text-warning)!important;background-color:var(--color-background-warning-muted)}._inputWarning_u3xdj_26:hover{border-color:var(--color-border-warning-hover)!important}._inputWarning_u3xdj_26:focus{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputDisabled_u3xdj_61{pointer-events:none;background-color:var(--color-background-disabled);color:var(--color-text-muted);box-shadow:none}._hideScrollbars_u3xdj_67{scrollbar-width:none;-ms-overflow-style:none}._hideScrollbars_u3xdj_67::-webkit-scrollbar{display:none}._cell_u3xdj_77 a{cursor:pointer;color:var(--color-text-primary)}._cell_u3xdj_77 a:hover{color:var(--color-text-primary-hover)}._cell_u3xdj_77 a:active{color:var(--color-text-primary-active)}._cell_u3xdj_77 a._disabledLink_u3xdj_87{color:var(--color-text-faint)!important;cursor:default!important}._inputWrapper_u3xdj_91{height:100%;border-radius:inherit}._inputWrapper_u3xdj_91>span,._inputWrapper_u3xdj_91>span>span,._inputWrapper_u3xdj_91>span>span>div{height:100%;border-radius:inherit}._inputWrapper_u3xdj_91>div,._inputWrapper_u3xdj_91>div>span{height:100%;border-radius:inherit}._breakWord_u3xdj_106{word-break:break-word}._inputCell_u3xdj_109{padding:0!important}._sliderCell_u3xdj_112{padding-top:0!important;padding-bottom:0!important}._staticCell_u3xdj_116{padding:0!important}._staticCell_u3xdj_116 ._staticCellContent_u3xdj_119{line-height:1.25;min-height:100%;padding:var(--padding-input);position:relative;border-radius:inherit;display:flex;align-items:center}tbody ._staticCell_u3xdj_116 ._staticCellContent_u3xdj_119{color:var(--color-text-muted)}._staticCell_u3xdj_116 ._staticCellContent_u3xdj_119._error_u3xdj_131,._staticCell_u3xdj_116 ._staticCellContent_u3xdj_119._warning_u3xdj_132{border:1px solid transparent}._staticCell_u3xdj_116 ._staticCellContent_u3xdj_119._error_u3xdj_131{background-color:var(--color-background-error-muted)}._staticCell_u3xdj_116 ._staticCellContent_u3xdj_119._warning_u3xdj_132{background-color:var(--color-background-warning-muted)}._staticCell_u3xdj_116 ._staticCellContent_u3xdj_119._unit_u3xdj_141{font-weight:400}._sortingCell_u3xdj_144 ._staticCellContent_u3xdj_119{position:relative;padding-right:calc(var(--size) + var(--padding-xxs))!important;cursor:pointer!important}._sortingCell_u3xdj_144 ._staticCellContent_u3xdj_119:hover{background-color:#0000000d!important}[data-theme=dark] ._sortingCell_u3xdj_144 ._staticCellContent_u3xdj_119:hover{background-color:#ffffff1a!important}._sortingCell_u3xdj_144 ._sortingCellIcon_u3xdj_155{font-size:var(--size-xs);position:absolute;right:var(--padding-input-x);top:50%;transform:translateY(-50%);display:flex}._sortingCell_u3xdj_144 ._sortingCellIcon_u3xdj_155>*{display:flex}._icon_u3xdj_166{display:inline-flex;margin-left:var(--padding-xxs)}._checkBoxCell_u3xdj_170{padding-block:0!important;width:var(--size)}._iconCellWrapper_u3xdj_174{display:flex;justify-content:center}._actionsCell_u3xdj_178{width:var(--size-sm);padding:0 calc((var(--size) - var(--size-sm)) / 2)!important;position:sticky;right:0;background:inherit;z-index:4}._rightAligned_u3xdj_186{text-align:right!important}._rightAligned_u3xdj_186 ._staticCellContent_u3xdj_119{justify-content:flex-end}._centerAligned_u3xdj_192{text-align:center!important}._centerAligned_u3xdj_192 ._staticCellContent_u3xdj_119{justify-content:center}._leftAligned_u3xdj_198{text-align:left!important}._popover_u3xdj_201{padding:var(--padding-input)}._disabledPointerEvents_u3xdj_204{pointer-events:none}