@oliasoft-open-source/react-ui-library 4.0.0-beta-61 → 4.0.0-beta-63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{index-815d3e96.css → index-6c077a65.css} +64 -64
- package/dist/assets/{index-bb4c3557.js → index-a82e6f39.js} +12 -12
- package/dist/global.css +64 -64
- package/dist/index.html +1 -1
- package/dist/index.js +12 -12
- package/dist/storybook/assets/{Color-6VNJS4EI-b198135c.js → Color-6VNJS4EI-7e423849.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-NNNQARDV-19e71c0e.js → DocsRenderer-NNNQARDV-2dd46d9d.js} +1 -1
- package/dist/storybook/assets/{WithTooltip-4HIR6TLV-2f83280b.js → WithTooltip-4HIR6TLV-35e2fc27.js} +1 -1
- package/dist/storybook/assets/{accordion.stories-e1a1a1da.js → accordion.stories-21c14f23.js} +1 -1
- package/dist/storybook/assets/{button.stories-f6bf1869.js → button.stories-f616a5a7.js} +1 -1
- package/dist/storybook/assets/{buttons-and-links-82ee1d3d.js → buttons-and-links-13fe0e25.js} +1 -1
- package/dist/storybook/assets/{casing-loads.stories-07b8c5bf.js → casing-loads.stories-78ef3b53.js} +1 -1
- package/dist/storybook/assets/{cell.stories-0c3541a7.js → cell.stories-9adb8aa5.js} +1 -1
- package/dist/storybook/assets/{chunk-HLWAVYOI-3f2e7bdd.js → chunk-HLWAVYOI-6467e5e7.js} +1 -1
- package/dist/storybook/assets/{color-338772bf.js → color-dd9acffc.js} +1 -1
- package/dist/storybook/assets/{drawer.stories-4eeb77c2.js → drawer.stories-423386fd.js} +1 -1
- package/dist/storybook/assets/{file-input.stories-8482bd38.js → file-input.stories-fdaa75a4.js} +1 -1
- package/dist/storybook/assets/{flex-47732c42.js → flex-89b67483.js} +1 -1
- package/dist/storybook/assets/{flex.stories-48fa85e8.js → flex.stories-a3bf4830.js} +1 -1
- package/dist/storybook/assets/{footer.stories-8a474f57.js → footer.stories-8c9428ca.js} +1 -1
- package/dist/storybook/assets/{form.stories-c6efa8b0.js → form.stories-efbb43c3.js} +1 -1
- package/dist/storybook/assets/{formation.stories-b909ce02.js → formation.stories-c630ccee.js} +1 -1
- package/dist/storybook/assets/{formatter-SWP5E3XI-25bcba07.js → formatter-SWP5E3XI-d279610b.js} +1 -1
- package/dist/storybook/assets/{heading.stories-674a496b.js → heading.stories-b7a1ea58.js} +1 -1
- package/dist/storybook/assets/{icon.stories-9a1cd92c.js → icon.stories-7c2ff97c.js} +1 -1
- package/dist/storybook/assets/{iframe-bc0fdebc.js → iframe-4747ce8b.js} +1 -1
- package/dist/storybook/assets/{index-c54905c0.js → index-2c7fdfcb.js} +4 -4
- package/dist/storybook/assets/{input-validation-7db01452.js → input-validation-c3bcbb50.js} +1 -1
- package/dist/storybook/assets/{inputs-b9d1bfa6.js → inputs-5a06878b.js} +1 -1
- package/dist/storybook/assets/{layout-forms-d1ce1a06.js → layout-forms-c9e86a8f.js} +1 -1
- package/dist/storybook/assets/{layout-general-97dba2ce.js → layout-general-a4a824bb.js} +1 -1
- package/dist/storybook/assets/{list.stories-339e0e65.js → list.stories-73e94d67.js} +1 -1
- package/dist/storybook/assets/{list.stories-data-f6c41ab7.js → list.stories-data-42b1569e.js} +1 -1
- package/dist/storybook/assets/{menu.stories-f2dea3a1.js → menu.stories-d8ebc8ba.js} +1 -1
- package/dist/storybook/assets/{menu.stories-data-50e9f9fe.js → menu.stories-data-01af235b.js} +1 -1
- package/dist/storybook/assets/{padding-and-spacing-a3a5213e.js → padding-and-spacing-b3477264.js} +1 -1
- package/dist/storybook/assets/{popover.stories-0f74eee3.js → popover.stories-9df99470.js} +1 -1
- package/dist/storybook/assets/{preview-4131d937.css → preview-0382129c.css} +1 -1
- package/dist/storybook/assets/{preview-074d29f8.js → preview-17593db1.js} +1 -1
- package/dist/storybook/assets/preview-c182026f.js +1 -0
- package/dist/storybook/assets/{row.stories-566dbfdc.js → row.stories-60809f8e.js} +1 -1
- package/dist/storybook/assets/{side-bar.stories-1735487e.js → side-bar.stories-133b27a4.js} +1 -1
- package/dist/storybook/assets/{spacer.stories-12160287.js → spacer.stories-0e5baa13.js} +1 -1
- package/dist/storybook/assets/{syntaxhighlighter-NMPM6SWI-9c89c825.js → syntaxhighlighter-NMPM6SWI-e46f153f.js} +1 -1
- package/dist/storybook/assets/{table-16e7479d.js → table-1b9ec776.js} +1 -1
- package/dist/storybook/assets/table-e3d80651.css +1 -0
- package/dist/storybook/assets/{table.stories-af5f3080.js → table.stories-25e52ed5.js} +1 -1
- package/dist/storybook/assets/{table.stories-data-07840afd.js → table.stories-data-05cc0578.js} +1 -1
- package/dist/storybook/assets/{textarea-54dd1c9a.js → textarea-51869bed.js} +1 -1
- package/dist/storybook/assets/{textarea.stories-4b85aa60.js → textarea.stories-08906cd1.js} +1 -1
- package/dist/storybook/assets/{title.stories-c91929de.js → title.stories-758b20eb.js} +1 -1
- package/dist/storybook/assets/{tooltip.test-case.stories-f0022f8c.js → tooltip.test-case.stories-a67f9e22.js} +1 -1
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/project.json +1 -1
- package/package.json +1 -1
- package/dist/storybook/assets/preview-de19c997.js +0 -1
- package/dist/storybook/assets/table-3dac6c8c.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as S}from"./jsx-runtime-f961835c.js";import{R as M}from"./index-f80c8c95.js";import{T as pe}from"./toaster-7efa1564.js";import{e as G}from"./index-54f0d271.js";import"./chunk-HLWAVYOI-
|
|
1
|
+
import{j as S}from"./jsx-runtime-f961835c.js";import{R as M}from"./index-f80c8c95.js";import{T as pe}from"./toaster-7efa1564.js";import{e as G}from"./index-54f0d271.js";import"./chunk-HLWAVYOI-6467e5e7.js";import{e as de,t as U}from"./index-2c7fdfcb.js";import"./index-3d476d02.js";import"./types-fe05eeca.js";import"./index-c89a1915.js";import"./index-a80ed1cf.js";import"./button-e6a6c574.js";import"./common-types-2c81813f.js";import"./disabled-context-d654f6ff.js";import"./spinner-cb92a546.js";import"./icon-c5e1f218.js";import"./inheritsLoose-d4851ab8.js";import"./tslib.es6-dfef685f.js";import"./tooltip-23e84186.js";import"./iframe-4747ce8b.js";import"../sb-preview/runtime.js";import"./react-16-147b12fd.js";import"./assertThisInitialized-081f9914.js";import"./index-97a99495.js";var W="DARK_MODE";const{global:ce}=__STORYBOOK_MODULE_GLOBAL__;__STORYBOOK_MODULE_CLIENT_LOGGER__;function b(){return b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},b.apply(this,arguments)}function me(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},h(e,t)}function ge(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,h(e,t)}function z(e){return z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},z(e)}function be(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function he(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function C(e,t,r){return he()?C=Reflect.construct.bind():C=function(a,n,o){var i=[null];i.push.apply(i,n);var l=Function.bind.apply(a,i),s=new l;return o&&h(s,o.prototype),s},C.apply(null,arguments)}function H(e){var t=typeof Map=="function"?new Map:void 0;return H=function(r){if(r===null||!be(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(r))return t.get(r);t.set(r,a)}function a(){return C(r,arguments,z(this).constructor)}return a.prototype=Object.create(r.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),h(a,r)},H(e)}var ye={1:`Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).
|
|
2
2
|
|
|
3
3
|
`,2:`Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).
|
|
4
4
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e}from"./iframe-4747ce8b.js";import"../sb-preview/runtime.js";var a={docs:{renderer:async()=>{let{DocsRenderer:r}=await e(()=>import("./DocsRenderer-NNNQARDV-2dd46d9d.js"),["./DocsRenderer-NNNQARDV-2dd46d9d.js","./chunk-HLWAVYOI-6467e5e7.js","./iframe-4747ce8b.js","./index-f80c8c95.js","./react-16-147b12fd.js","./index-3d476d02.js","./index-2c7fdfcb.js","./inheritsLoose-d4851ab8.js","./assertThisInitialized-081f9914.js","./index-97a99495.js"],import.meta.url);return new r}}};export{a as parameters};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o}from"./jsx-runtime-f961835c.js";import{r as R}from"./index-f80c8c95.js";import{T as c}from"./table-
|
|
1
|
+
import{j as o}from"./jsx-runtime-f961835c.js";import{r as R}from"./index-f80c8c95.js";import{T as c}from"./table-1b9ec776.js";import{T as V}from"./text-ad1f5f1d.js";import{t as g,i as W,q as B}from"./table.stories-data-05cc0578.js";import"./index-a80ed1cf.js";import"./index.es-ed1d81bc.js";import"./inheritsLoose-d4851ab8.js";import"./redux-10ee6be7.js";import"./objectSpread2-fdee9b6d.js";import"./index-3d476d02.js";import"./memoize-one.esm-52518564.js";import"./icon-c5e1f218.js";import"./tslib.es6-dfef685f.js";import"./index-c89a1915.js";import"./disabled-context-d654f6ff.js";import"./lodash-75c70a11.js";import"./actions-46447905.js";import"./common-types-2c81813f.js";import"./button-e6a6c574.js";import"./spinner-cb92a546.js";import"./tooltip-23e84186.js";import"./types-cc224262.js";import"./types-332ceaf3.js";import"./badge-3abf067b.js";import"./heading-61bdbf94.js";import"./help-icon-5be78589.js";import"./pagination-8a1d097c.js";import"./select-6b6d28f7.js";import"./assertThisInitialized-081f9914.js";import"./select.input-88b6ebab.js";import"./input-d68625a5.js";import"./input-group-20c3add3.js";import"./input-group-addon-f8f6683a.js";import"./number-input-42f50494.js";import"./index-54f0d271.js";import"./check-box-73be452f.js";import"./slider-cf2db7b4.js";import"./index-c7f280f6.js";import"./popover-e20a61fe.js";import"./flex-89b67483.js";const ke={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-bc0bfe9c.js";import{F as g}from"./flex-
|
|
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-bc0bfe9c.js";import{F as g}from"./flex-89b67483.js";import{B as u}from"./badge-3abf067b.js";import{s as S}from"./icon-custom-822ce507.js";import"./index-f80c8c95.js";import"./index-a80ed1cf.js";import"./index-c7f280f6.js";import"./drawer-2407de69.js";import"./lodash-75c70a11.js";import"./index-c89a1915.js";import"./index-3d476d02.js";import"./icon-c5e1f218.js";import"./inheritsLoose-d4851ab8.js";import"./tslib.es6-dfef685f.js";import"./disabled-context-d654f6ff.js";import"./button-e6a6c574.js";import"./spinner-cb92a546.js";import"./tooltip-23e84186.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-
|
|
1
|
+
import{j as r}from"./jsx-runtime-f961835c.js";import{S as h}from"./spacer-54db0620.js";import{F as j}from"./flex-89b67483.js";import{B as s}from"./button-e6a6c574.js";import"./index-f80c8c95.js";import"./index-a80ed1cf.js";import"./common-types-2c81813f.js";import"./disabled-context-d654f6ff.js";import"./spinner-cb92a546.js";import"./index-c89a1915.js";import"./icon-c5e1f218.js";import"./inheritsLoose-d4851ab8.js";import"./tslib.es6-dfef685f.js";import"./tooltip-23e84186.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 c,c as l,s as n}from"./index-
|
|
1
|
+
import{S as c,c as l,s as n}from"./index-2c7fdfcb.js";import"./iframe-4747ce8b.js";import"../sb-preview/runtime.js";import"./index-f80c8c95.js";import"./index-3d476d02.js";import"./inheritsLoose-d4851ab8.js";import"./assertThisInitialized-081f9914.js";import"./index-97a99495.js";export{c as SyntaxHighlighter,l as createCopyToClipboardFunction,n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as n}from"./jsx-runtime-f961835c.js";import{r as V}from"./index-f80c8c95.js";import{c as j}from"./index-a80ed1cf.js";import{I as He,D as Pe,C as Le,P as De}from"./index.es-ed1d81bc.js";import{l as Fe}from"./lodash-75c70a11.js";import{A as ye}from"./actions-46447905.js";import{H as $e}from"./heading-61bdbf94.js";import{P as Oe}from"./pagination-8a1d097c.js";import{A as b,I as $}from"./common-types-2c81813f.js";import{I as Be}from"./input-d68625a5.js";import{N as Me}from"./number-input-42f50494.js";import{S as Ge}from"./select-6b6d28f7.js";import{D as Ue}from"./disabled-context-d654f6ff.js";import{i as O}from"./types-332ceaf3.js";import{T as fe}from"./tooltip-23e84186.js";import{C as Xe}from"./check-box-73be452f.js";import{S as Je}from"./slider-cf2db7b4.js";import{I as B}from"./icon-c5e1f218.js";import{P as Ke}from"./popover-e20a61fe.js";import{H as Ee}from"./help-icon-5be78589.js";import{T as ee}from"./text-ad1f5f1d.js";const ze="_inputInTable_16p4q_1",Ye="_inputHover_16p4q_13",Qe="_inputFocus_16p4q_18",Ze="_inputError_16p4q_25",en="_inputWarning_16p4q_26",nn="_inputDisabled_16p4q_61",tn="_hideScrollbars_16p4q_67",rn="_wrapper_16p4q_85",an="_bordered_16p4q_93",ln="_scroll_16p4q_98",on="_table_16p4q_108",sn="_striped_16p4q_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)},qe=e=>e.reduce((t,a)=>a.actions&&a.actions.length>0?1:t,0),_n=(e,t)=>qe(t)>0||qe(e)>0,J=({table:e,children:t})=>{const{rows:a,infiniteScroll:l}=e,r=Math.ceil(window.innerHeight/30),[o,s]=l?V.useState(r):[a.length,null],[u,d]=l?V.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",Cn="_dragIconCell_11d5t_28",xn="_dragIcon_11d5t_28",R={clickableRow:gn,hoverableRow:yn,rowActive:fn,expandableRow:hn,flush:bn,dragIconCell:Cn,dragIcon:xn},K=({colSpan:e,children:t,flush:a})=>n.jsx("tr",{children:n.jsx("td",{colSpan:e,className:j(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 Ve=(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."),[])},Nn="_inputInTable_17dgc_1",jn="_inputHover_17dgc_13",wn="_inputFocus_17dgc_18",An="_inputError_17dgc_25",vn="_inputWarning_17dgc_26",Rn="_inputDisabled_17dgc_61",Sn="_hideScrollbars_17dgc_67",qn="_cell_17dgc_77",Vn="_disabledLink_17dgc_87",Tn="_inputWrapper_17dgc_91",En="_breakWord_17dgc_106",kn="_inputCell_17dgc_109",Wn="_sliderCell_17dgc_112",Hn="_staticCell_17dgc_116",Pn="_staticCellContent_17dgc_119",Ln="_error_17dgc_131",Dn="_warning_17dgc_132",Fn="_unit_17dgc_141",$n="_sortingCell_17dgc_144",On="_sortingCellIcon_17dgc_155",Bn="_icon_17dgc_166",Mn="_checkBoxCell_17dgc_170",Gn="_iconCellWrapper_17dgc_174",Un="_actionsCell_17dgc_178",Xn="_rightAligned_17dgc_186",Jn="_centerAligned_17dgc_192",Kn="_leftAligned_17dgc_198",zn="_popover_17dgc_201",Yn="_disabledPointerEvents_17dgc_204",i={inputInTable:Nn,inputHover:jn,inputFocus:wn,inputError:An,inputWarning:vn,inputDisabled:Rn,hideScrollbars:Sn,cell:qn,disabledLink:Vn,inputWrapper:Tn,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=V.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:j(i.staticCellContent,l?i.error:r?i.warning:""),children:n.jsx("a",{className:j((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:j(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=V.useRef(null),g={bodyAlignment:l,headerAlignment:a,isHeader:t},P=Ve(g,i),C=Ve(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=j(i.cell,L,e.hasSort?i.sortingCell:null,P,e.breakWord?i.breakWord:""),T=c??r??((o==null?void 0:o.isDragging)&&y.current&&y.current.offsetWidth)??void 0,x={width:T,minWidth:T,...u},A=t?"th":"td";return n.jsx(A,{ref:y,className:w,style:x,colSpan:d,rowSpan:p,children:n.jsx(ge,{cell:e,columnAlignment:C??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 C=V.useRef(null),L=In(o,a,t),{onRowClick:w,onRowFocus:T,onRowMouseEnter:x,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)}),q=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:C,onClick:w,onMouseEnter:x,onMouseLeave:A,onFocus:T,className:j(w?R.clickableRow:null,x?R.hoverableRow:null),children:[d?n.jsx("th",{}):null,E,q]},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:x,onMouseLeave:A,onFocus:T,className:j(w&&!w.noStyle?R.clickableRow:null,x&&!x.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,q]},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 Te=e=>{var Ie,Ne,je,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:C=null,onAddRow:L=null,bordered:w=!0,maxHeight:T,fixedWidth:x}=a,A=V.useRef(null),[I,Q]=V.useState({width:0,height:0});V.useEffect(()=>{A.current&&Q({width:A.current.offsetWidth,height:A.current.offsetHeight})},[]);const E=Fe.get(e,"table.headers",[]),q=mn(s,E),k=_n(s,E),W=q+(k?1:0),h=r?((Ne=(Ie=r==null?void 0:r.pagination)==null?void 0:Ie.rowsPerPage)==null?void 0:Ne.value)===0||Number((je=r==null?void 0:r.pagination)==null?void 0:je.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=C==null?void 0:C.cells)==null?void 0:Re.length)&&L&&h,ke={cells:v?C.cells.map((m,N)=>(m==null?void 0:m.type)==="Input"?{...m,onChange:_=>{var M;const f=(M=_==null?void 0:_.target)==null?void 0:M.value,D={...C,cells:C.cells.map((G,We)=>({...G,value:We===N?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},Ce=j(H.wrapper,w?H.bordered:""),xe={maxHeight:T,width:x,display:x==="auto"?"inline-flex":"flex"};return P?n.jsxs("div",{ref:A,className:Ce,style:xe,children:[n.jsx(U,{actions:u,actionsRight:d,name:o,testId:g&&`${g}-title`}),n.jsx(Pe,{onDragEnd:m=>{var f,D;const N=(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 N=="number"&&typeof _=="number"&&t({from:N,to:_})},children:n.jsx(Le,{droppableId:"droppable",children:m=>n.jsx(J,{table:be,children:({visibleRows:N})=>n.jsxs("table",{className:j(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:q,columnWidths:l,colSpan:W,hasRowActions:k,columnAlignment:c,columnHeaderAlignments:p,draggableTable:P},`0_${f}`))}),n.jsxs("tbody",{children:[Z.slice(0,N).map((_,f)=>n.jsx(De,{draggableId:f+"",index:f,isDragDisabled:_.noDrag,children:(D,M)=>n.jsx(F,{rowIndex:f,row:_,columnCount:q,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:Ce,style:xe,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:j(H.table,y?H.striped:""),"data-testid":g,children:[n.jsx("thead",{children:E.map((N,_)=>n.jsx(F,{rowIndex:_,isHeader:!0,row:N,columnCount:q,columnWidths:l,colSpan:W,hasRowActions:k,columnAlignment:c,columnHeaderAlignments:p},`0_${_}`))}),n.jsx("tbody",{children:Z.slice(0,m).map((N,_)=>n.jsx(F,{rowIndex:_,row:N,columnCount:q,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{Te.displayName="Table",Te.__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{Te as T};
|
|
1
|
+
import{j as n}from"./jsx-runtime-f961835c.js";import{r as T}from"./index-f80c8c95.js";import{c as j}from"./index-a80ed1cf.js";import{I as He,D as Pe,C as Le,P as De}from"./index.es-ed1d81bc.js";import{l as Fe}from"./lodash-75c70a11.js";import{A as ye}from"./actions-46447905.js";import{H as $e}from"./heading-61bdbf94.js";import{P as Oe}from"./pagination-8a1d097c.js";import{A as b,I as $}from"./common-types-2c81813f.js";import{I as Be}from"./input-d68625a5.js";import{N as Me}from"./number-input-42f50494.js";import{S as Ge}from"./select-6b6d28f7.js";import{D as Ue}from"./disabled-context-d654f6ff.js";import{i as O}from"./types-332ceaf3.js";import{T as he}from"./tooltip-23e84186.js";import{C as Xe}from"./check-box-73be452f.js";import{S as Je}from"./slider-cf2db7b4.js";import{I as B}from"./icon-c5e1f218.js";import{P as Ke}from"./popover-e20a61fe.js";import{H as Ee}from"./help-icon-5be78589.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},cn="_title_11pbp_1",dn={title:cn},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:dn.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 c,p;if(t){const{rowCount:d,rowsPerPage:y}=t,g=Number((p=(c=y==null?void 0:y.options)==null?void 0:c[0])==null?void 0:p.value);return d>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,c]=l?T.useState(o<a.length):[!1,null],p=()=>{if(o>=a.length&&c){c(!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",Cn="_dragIconCell_11d5t_28",xn="_dragIcon_11d5t_28",R={clickableRow:gn,hoverableRow:yn,rowActive:hn,expandableRow:fn,flush:bn,dragIconCell:Cn,dragIcon:xn},K=({colSpan:e,children:t,flush:a})=>n.jsx("tr",{children:n.jsx("td",{colSpan:e,className:j(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."),[])},Nn="_inputInTable_17dgc_1",jn="_inputHover_17dgc_13",wn="_inputFocus_17dgc_18",An="_inputError_17dgc_25",vn="_inputWarning_17dgc_26",Rn="_inputDisabled_17dgc_61",Sn="_hideScrollbars_17dgc_67",Vn="_cell_17dgc_77",Tn="_disabledLink_17dgc_87",qn="_inputWrapper_17dgc_91",En="_breakWord_17dgc_106",kn="_inputCell_17dgc_109",Wn="_sliderCell_17dgc_112",Hn="_staticCell_17dgc_116",Pn="_staticCellContent_17dgc_119",Ln="_error_17dgc_131",Dn="_warning_17dgc_132",Fn="_unit_17dgc_141",$n="_sortingCell_17dgc_144",On="_sortingCellIcon_17dgc_155",Bn="_icon_17dgc_166",Mn="_checkBoxCell_17dgc_170",Gn="_iconCellWrapper_17dgc_174",Un="_actionsCell_17dgc_178",Xn="_rightAligned_17dgc_186",Jn="_centerAligned_17dgc_192",Kn="_leftAligned_17dgc_198",zn="_popover_17dgc_201",Yn="_disabledPointerEvents_17dgc_204",i={inputInTable:Nn,inputHover:jn,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=c=>O(c);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:j(i.staticCellContent,l?i.error:r?i.warning:""),children:n.jsx("a",{className:j((e.disabled||a)&&i.disabledLink),onClick:e.disabled||a?void 0:c=>{var p;c.stopPropagation(),(p=e.onClick)==null||p.call(e,c)},"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 ce=({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{ce.displayName="IconCell",ce.__docgenInfo={description:"",displayName:"IconCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"IIconCell"}}}}}catch{}const de=({cell:e})=>n.jsx(ye,{actions:e.actions});try{de.displayName="ActionsCell",de.__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:c,type:p}=e,d=n.jsxs("div",{className:j(i.staticCellContent,p==="Unit"?i.unit:"",l?i.error:r?i.warning:""),onClick:u?y=>c&&c(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:d})})};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(ce,{cell:e});case"Actions":return n.jsx(de,{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:c,rowSpan:p,width:d}=e,y=T.useRef(null),g={bodyAlignment:l,headerAlignment:a,isHeader:t},P=Te(g,i),C=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=j(i.cell,L,e.hasSort?i.sortingCell:null,P,e.breakWord?i.breakWord:""),q=d??r??((o==null?void 0:o.isDragging)&&y.current&&y.current.offsetWidth)??void 0,x={width:q,minWidth:q,...u},A=t?"th":"td";return n.jsx(A,{ref:y,className:w,style:x,colSpan:c,rowSpan:p,children:n.jsx(ge,{cell:e,columnAlignment:C??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:c=!1,snapshot:p=null,provided:d=null,width:y,columnWidths:g,testId:P})=>{const C=T.useRef(null),L=In(o,a,t),{onRowClick:w,onRowFocus:q,onRowMouseEnter:x,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",{...d.dragHandleProps,className:R.dragIcon,children:n.jsx(B,{icon:$.DRAG})})});return a?n.jsxs(n.Fragment,{children:[n.jsxs("tr",{ref:C,onClick:w,onMouseEnter:x,onMouseLeave:A,onFocus:q,className:j(w?R.clickableRow:null,x?R.hoverableRow:null),children:[c?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:x,onMouseLeave:A,onFocus:q,className:j(w&&!w.noStyle?R.clickableRow:null,x&&!x.noStyle?R.hoverableRow:null,Q?R.rowActive:null),ref:(d==null?void 0:d.innerRef)||null,...(d==null?void 0:d.draggableProps)||null,style:p&&d?k(p.isDragging,d.draggableProps.style):null,children:[c?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,Ne,je,we,Ae,ve,Re;const{onListReorder:t=()=>{},table:a}=e,{columnWidths:l,footer:r,name:o,rows:s=[],actions:u,actionsRight:c,columnHeaderAlignments:p,columnAlignment:d,striped:y=!0,testId:g,draggable:P,defaultEmptyRow:C=null,onAddRow:L=null,bordered:w=!0,maxHeight:q,fixedWidth:x}=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?((Ne=(Ie=r==null?void 0:r.pagination)==null?void 0:Ie.rowsPerPage)==null?void 0:Ne.value)===0||Number((je=r==null?void 0:r.pagination)==null?void 0:je.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=C==null?void 0:C.cells)==null?void 0:Re.length)&&L&&f,ke={cells:v?C.cells.map((m,N)=>(m==null?void 0:m.type)==="Input"?{...m,onChange:_=>{var M;const h=(M=_==null?void 0:_.target)==null?void 0:M.value,D={...C,cells:C.cells.map((G,We)=>({...G,value:We===N?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},Ce=j(H.wrapper,w?H.bordered:""),xe={maxHeight:q,width:x,display:x==="auto"?"inline-flex":"flex"};return P?n.jsxs("div",{ref:A,className:Ce,style:xe,children:[n.jsx(U,{actions:u,actionsRight:c,name:o,testId:g&&`${g}-title`}),n.jsx(Pe,{onDragEnd:m=>{var h,D;const N=(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 N=="number"&&typeof _=="number"&&t({from:N,to:_})},children:n.jsx(Le,{droppableId:"droppable",children:m=>n.jsx(J,{table:be,children:({visibleRows:N})=>n.jsxs("table",{className:j(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:d,columnHeaderAlignments:p,draggableTable:P},`0_${h}`))}),n.jsxs("tbody",{children:[Z.slice(0,N).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:d,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:Ce,style:xe,children:[n.jsx(U,{actions:u,actionsRight:c,name:o,testId:g&&`${g}-title`}),n.jsx(J,{table:be,children:({visibleRows:m})=>n.jsxs("table",{className:j(H.table,y?H.striped:""),"data-testid":g,children:[n.jsx("thead",{children:E.map((N,_)=>n.jsx(F,{rowIndex:_,isHeader:!0,row:N,columnCount:V,columnWidths:l,colSpan:W,hasRowActions:k,columnAlignment:d,columnHeaderAlignments:p},`0_${_}`))}),n.jsx("tbody",{children:Z.slice(0,m).map((N,_)=>n.jsx(F,{rowIndex:_,row:N,columnCount:V,columnWidths:l,colSpan:W,hasRowActions:k,columnAlignment:d},`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_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_17dgc_1{background-color:transparent;border-radius:inherit!important;height:var(--size);min-height:100%}._inputInTable_17dgc_1:not(:hover){border-color:transparent}._inputInTable_17dgc_1:not(:focus){box-shadow:none}._inputHover_17dgc_13{position:relative;border-color:var(--color-border-hover);z-index:2}._inputFocus_17dgc_18{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputError_17dgc_25,._inputWarning_17dgc_26{position:relative}._inputError_17dgc_25{z-index:2;border-color:var(--color-border-error);color:var(--color-text-error)!important;background-color:var(--color-background-error-muted)}._inputError_17dgc_25:hover{border-color:var(--color-border-error-hover)!important}._inputError_17dgc_25:focus{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputWarning_17dgc_26{z-index:1;border-color:var(--color-border-warning);color:var(--color-text-warning)!important;background-color:var(--color-background-warning-muted)}._inputWarning_17dgc_26:hover{border-color:var(--color-border-warning-hover)!important}._inputWarning_17dgc_26:focus{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputDisabled_17dgc_61{pointer-events:none;background-color:var(--color-background-disabled);color:var(--color-text-muted);box-shadow:none}._hideScrollbars_17dgc_67{scrollbar-width:none;-ms-overflow-style:none}._hideScrollbars_17dgc_67::-webkit-scrollbar{display:none}._cell_17dgc_77 a{cursor:pointer;color:var(--color-text-primary)}._cell_17dgc_77 a:hover{color:var(--color-text-primary-hover)}._cell_17dgc_77 a:active{color:var(--color-text-primary-active)}._cell_17dgc_77 a._disabledLink_17dgc_87{color:var(--color-text-faint)!important;cursor:default!important}._inputWrapper_17dgc_91{height:100%;border-radius:inherit}._inputWrapper_17dgc_91>span,._inputWrapper_17dgc_91>span>span,._inputWrapper_17dgc_91>span>span>div{height:100%;border-radius:inherit}._inputWrapper_17dgc_91>div,._inputWrapper_17dgc_91>div>span{height:100%;border-radius:inherit}._breakWord_17dgc_106{word-break:break-word}._inputCell_17dgc_109{padding:0!important}._sliderCell_17dgc_112{padding-top:0!important;padding-bottom:0!important}._staticCell_17dgc_116{padding:0!important}._staticCell_17dgc_116 ._staticCellContent_17dgc_119{line-height:1.25;min-height:100%;padding:var(--padding-input);position:relative;border-radius:inherit;display:flex;align-items:center}tbody ._staticCell_17dgc_116 ._staticCellContent_17dgc_119{color:var(--color-text-muted)}._staticCell_17dgc_116 ._staticCellContent_17dgc_119._error_17dgc_131,._staticCell_17dgc_116 ._staticCellContent_17dgc_119._warning_17dgc_132{border:1px solid transparent}._staticCell_17dgc_116 ._staticCellContent_17dgc_119._error_17dgc_131{background-color:var(--color-background-error)}._staticCell_17dgc_116 ._staticCellContent_17dgc_119._warning_17dgc_132{background-color:var(--color-background-warning)}._staticCell_17dgc_116 ._staticCellContent_17dgc_119._unit_17dgc_141{font-weight:400}._sortingCell_17dgc_144 ._staticCellContent_17dgc_119{position:relative;padding-right:calc(var(--size) + var(--padding-xxs))!important;cursor:pointer!important}._sortingCell_17dgc_144 ._staticCellContent_17dgc_119:hover{background-color:#0000000d!important}[data-theme=dark] ._sortingCell_17dgc_144 ._staticCellContent_17dgc_119:hover{background-color:#ffffff1a!important}._sortingCell_17dgc_144 ._sortingCellIcon_17dgc_155{font-size:var(--size-xs);position:absolute;right:var(--padding-input-x);top:50%;transform:translateY(-50%);display:flex}._sortingCell_17dgc_144 ._sortingCellIcon_17dgc_155>*{display:flex}._icon_17dgc_166{display:inline-flex;margin-left:var(--padding-xxs)}._checkBoxCell_17dgc_170{padding-block:0!important;width:var(--size)}._iconCellWrapper_17dgc_174{display:flex;justify-content:center}._actionsCell_17dgc_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_17dgc_186{text-align:right!important}._rightAligned_17dgc_186 ._staticCellContent_17dgc_119{justify-content:flex-end}._centerAligned_17dgc_192{text-align:center!important}._centerAligned_17dgc_192 ._staticCellContent_17dgc_119{justify-content:center}._leftAligned_17dgc_198{text-align:left!important}._popover_17dgc_201{padding:var(--padding-input)}._disabledPointerEvents_17dgc_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-
|
|
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-1b9ec776.js";import{C as Ge}from"./card-3847c251.js";import{I as ee}from"./input-d68625a5.js";import{F as ne}from"./field-2424dd3c.js";import{H as Je}from"./heading-61bdbf94.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-05cc0578.js";import"./index-a80ed1cf.js";import"./index.es-ed1d81bc.js";import"./inheritsLoose-d4851ab8.js";import"./redux-10ee6be7.js";import"./objectSpread2-fdee9b6d.js";import"./index-3d476d02.js";import"./memoize-one.esm-52518564.js";import"./icon-c5e1f218.js";import"./tslib.es6-dfef685f.js";import"./index-c89a1915.js";import"./disabled-context-d654f6ff.js";import"./actions-46447905.js";import"./common-types-2c81813f.js";import"./button-e6a6c574.js";import"./spinner-cb92a546.js";import"./tooltip-23e84186.js";import"./types-cc224262.js";import"./types-332ceaf3.js";import"./badge-3abf067b.js";import"./pagination-8a1d097c.js";import"./select-6b6d28f7.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-42f50494.js";import"./index-54f0d271.js";import"./check-box-73be452f.js";import"./help-icon-5be78589.js";import"./slider-cf2db7b4.js";import"./index-c7f280f6.js";import"./popover-e20a61fe.js";import"./label-0958ef3a.js";import"./flex-89b67483.js";const Jn={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} />;
|
package/dist/storybook/assets/{table.stories-data-07840afd.js → table.stories-data-05cc0578.js}
RENAMED
|
@@ -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-47732c42.js";import{M as p}from"./actions-46447905.js";import{T as d}from"./text-ad1f5f1d.js";import{I as n}from"./icon-c5e1f218.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-89b67483.js";import{M as p}from"./actions-46447905.js";import{T as d}from"./text-ad1f5f1d.js";import{I as n}from"./icon-c5e1f218.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{J as A,$ as B,X as C,K as D,T as E,x as F,F as G,Z as H,Q 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,s as r,z as s,e as t,m as u,q as v,f as w,W as x,H as y,U 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-23e84186.js";const I="_inputInTable_66zck_1",N="_inputHover_66zck_13",R="_inputFocus_66zck_18",C="_inputError_66zck_25",S="_inputWarning_66zck_26",A="_inputDisabled_66zck_61",F="_hideScrollbars_66zck_67",H="_textarea_66zck_77",W="_small_66zck_116",w="_error_66zck_121",D="_warning_66zck_138",P="_monospace_66zck_155",t={inputInTable:I,inputHover:N,inputFocus:R,inputError:C,inputWarning:S,inputDisabled:A,hideScrollbars:F,textarea:H,small:W,error:w,warning:D,monospace:P},i=({name:r,value:u="",placeholder:s="",cols:d,rows:c,disabled:m=!1,onChange:p=()=>{},onKeyPress:f=()=>{},onFocus:v=()=>{},onBlur:_=()=>{},tabIndex:b=0,error:e=null,warning:a=null,tooltip:n=null,maxTooltipWidth:y,resize:x,monospace:g=!1,testId:E})=>{const T=V.useContext(z),q=o.jsx("textarea",{className:h(t.textarea,e?t.error:"",a?t.warning:"",g?t.monospace:""),name:r,value:u,placeholder:s,cols:d,rows:c,onChange:p,disabled:m||T,onKeyPress:f,onFocus:v,onBlur:_,tabIndex:b,style:{resize:x},"data-testid":E});return o.jsx(k,{error:!!e,warning:!!a,text:n||e||a,enabled:n&&l(n)||e&&l(e)||a&&l(a)||!1,maxWidth:y,placement:"bottom-center",children:q})};try{i.displayName="TextArea",i.__docgenInfo={description:"",displayName:"TextArea",props:{name:{defaultValue:null,description:"",name:"name",required:!1,type:{name:"string"}},value:{defaultValue:{value:""},description:"",name:"value",required:!1,type:{name:"TStringOrNumber"}},placeholder:{defaultValue:{value:""},description:"",name:"placeholder",required:!1,type:{name:"string"}},cols:{defaultValue:null,description:"",name:"cols",required:!1,type:{name:"number"}},rows:{defaultValue:null,description:"",name:"rows",required:!1,type:{name:"number"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},onChange:{defaultValue:{value:"() => {}"},description:"",name:"onChange",required:!1,type:{name:"((evt: ChangeEvent<HTMLTextAreaElement>) => void)"}},onKeyPress:{defaultValue:{value:"() => {}"},description:"",name:"onKeyPress",required:!1,type:{name:"((evt: KeyboardEvent<HTMLTextAreaElement>) => void)"}},onFocus:{defaultValue:{value:"() => {}"},description:"",name:"onFocus",required:!1,type:{name:"((evt: FocusEvent<HTMLTextAreaElement, Element>) => void)"}},onBlur:{defaultValue:{value:"() => {}"},description:"",name:"onBlur",required:!1,type:{name:"((evt: FocusEvent<HTMLTextAreaElement, Element>) => void)"}},tabIndex:{defaultValue:{value:"0"},description:"",name:"tabIndex",required:!1,type:{name:"number"}},error:{defaultValue:{value:"null"},description:"",name:"error",required:!1,type:{name:"string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null"}},warning:{defaultValue:{value:"null"},description:"",name:"warning",required:!1,type:{name:"string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null"}},tooltip:{defaultValue:{value:"null"},description:"",name:"tooltip",required:!1,type:{name:"string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null"}},maxTooltipWidth:{defaultValue:null,description:"",name:"maxTooltipWidth",required:!1,type:{name:"TStringOrNumber"}},resize:{defaultValue:null,description:"",name:"resize",required:!1,type:{name:"enum",value:[{value:'"
|
|
1
|
+
import{j as o}from"./jsx-runtime-f961835c.js";import{r as V}from"./index-f80c8c95.js";import{c as h}from"./index-a80ed1cf.js";import{i as l}from"./types-332ceaf3.js";import{D as z}from"./disabled-context-d654f6ff.js";import{T as k}from"./tooltip-23e84186.js";const I="_inputInTable_66zck_1",N="_inputHover_66zck_13",R="_inputFocus_66zck_18",C="_inputError_66zck_25",S="_inputWarning_66zck_26",A="_inputDisabled_66zck_61",F="_hideScrollbars_66zck_67",H="_textarea_66zck_77",W="_small_66zck_116",w="_error_66zck_121",D="_warning_66zck_138",P="_monospace_66zck_155",t={inputInTable:I,inputHover:N,inputFocus:R,inputError:C,inputWarning:S,inputDisabled:A,hideScrollbars:F,textarea:H,small:W,error:w,warning:D,monospace:P},i=({name:r,value:u="",placeholder:s="",cols:d,rows:c,disabled:m=!1,onChange:p=()=>{},onKeyPress:f=()=>{},onFocus:v=()=>{},onBlur:_=()=>{},tabIndex:b=0,error:e=null,warning:a=null,tooltip:n=null,maxTooltipWidth:y,resize:x,monospace:g=!1,testId:E})=>{const T=V.useContext(z),q=o.jsx("textarea",{className:h(t.textarea,e?t.error:"",a?t.warning:"",g?t.monospace:""),name:r,value:u,placeholder:s,cols:d,rows:c,onChange:p,disabled:m||T,onKeyPress:f,onFocus:v,onBlur:_,tabIndex:b,style:{resize:x},"data-testid":E});return o.jsx(k,{error:!!e,warning:!!a,text:n||e||a,enabled:n&&l(n)||e&&l(e)||a&&l(a)||!1,maxWidth:y,placement:"bottom-center",children:q})};try{i.displayName="TextArea",i.__docgenInfo={description:"",displayName:"TextArea",props:{name:{defaultValue:null,description:"",name:"name",required:!1,type:{name:"string"}},value:{defaultValue:{value:""},description:"",name:"value",required:!1,type:{name:"TStringOrNumber"}},placeholder:{defaultValue:{value:""},description:"",name:"placeholder",required:!1,type:{name:"string"}},cols:{defaultValue:null,description:"",name:"cols",required:!1,type:{name:"number"}},rows:{defaultValue:null,description:"",name:"rows",required:!1,type:{name:"number"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},onChange:{defaultValue:{value:"() => {}"},description:"",name:"onChange",required:!1,type:{name:"((evt: ChangeEvent<HTMLTextAreaElement>) => void)"}},onKeyPress:{defaultValue:{value:"() => {}"},description:"",name:"onKeyPress",required:!1,type:{name:"((evt: KeyboardEvent<HTMLTextAreaElement>) => void)"}},onFocus:{defaultValue:{value:"() => {}"},description:"",name:"onFocus",required:!1,type:{name:"((evt: FocusEvent<HTMLTextAreaElement, Element>) => void)"}},onBlur:{defaultValue:{value:"() => {}"},description:"",name:"onBlur",required:!1,type:{name:"((evt: FocusEvent<HTMLTextAreaElement, Element>) => void)"}},tabIndex:{defaultValue:{value:"0"},description:"",name:"tabIndex",required:!1,type:{name:"number"}},error:{defaultValue:{value:"null"},description:"",name:"error",required:!1,type:{name:"string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null"}},warning:{defaultValue:{value:"null"},description:"",name:"warning",required:!1,type:{name:"string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null"}},tooltip:{defaultValue:{value:"null"},description:"",name:"tooltip",required:!1,type:{name:"string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null"}},maxTooltipWidth:{defaultValue:null,description:"",name:"maxTooltipWidth",required:!1,type:{name:"TStringOrNumber"}},resize:{defaultValue:null,description:"",name:"resize",required:!1,type:{name:"enum",value:[{value:'"initial"'},{value:'"none"'},{value:'"inherit"'},{value:'"inline"'},{value:'"-moz-initial"'},{value:'"revert"'},{value:'"revert-layer"'},{value:'"unset"'},{value:'"vertical"'},{value:'"block"'},{value:'"both"'},{value:'"horizontal"'}]}},monospace:{defaultValue:{value:"false"},description:"",name:"monospace",required:!1,type:{name:"boolean"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}export{i as T};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as u}from"./jsx-runtime-f961835c.js";import{T as s}from"./textarea-
|
|
1
|
+
import{j as u}from"./jsx-runtime-f961835c.js";import{T as s}from"./textarea-51869bed.js";import"./index-f80c8c95.js";import"./index-a80ed1cf.js";import"./types-332ceaf3.js";import"./lodash-75c70a11.js";import"./disabled-context-d654f6ff.js";import"./tooltip-23e84186.js";import"./index-3d476d02.js";const{useArgs:g}=__STORYBOOK_MODULE_ADDONS__,C={title:"Forms/TextArea",component:s,args:{disabled:!1}},c=n=>{const[i,o]=g(),m=p=>{o({value:p.target.value})};return u.jsx(s,{...n,onChange:m})},e=c.bind({});var t,r,a;e.parameters={...e.parameters,docs:{...(t=e.parameters)==null?void 0:t.docs,source:{originalSource:`args => {
|
|
2
2
|
const [_, updateArgs] = useArgs();
|
|
3
3
|
const handleChange = (evt: ChangeEvent<HTMLTextAreaElement>) => {
|
|
4
4
|
updateArgs({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as B}from"./jsx-runtime-f961835c.js";import{T as X}from"./table-
|
|
1
|
+
import{j as B}from"./jsx-runtime-f961835c.js";import{T as X}from"./table-1b9ec776.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-05cc0578.js";import"./index-f80c8c95.js";import"./index-a80ed1cf.js";import"./index.es-ed1d81bc.js";import"./inheritsLoose-d4851ab8.js";import"./redux-10ee6be7.js";import"./objectSpread2-fdee9b6d.js";import"./index-3d476d02.js";import"./memoize-one.esm-52518564.js";import"./icon-c5e1f218.js";import"./tslib.es6-dfef685f.js";import"./index-c89a1915.js";import"./disabled-context-d654f6ff.js";import"./lodash-75c70a11.js";import"./actions-46447905.js";import"./common-types-2c81813f.js";import"./button-e6a6c574.js";import"./spinner-cb92a546.js";import"./tooltip-23e84186.js";import"./types-cc224262.js";import"./types-332ceaf3.js";import"./badge-3abf067b.js";import"./heading-61bdbf94.js";import"./help-icon-5be78589.js";import"./pagination-8a1d097c.js";import"./select-6b6d28f7.js";import"./assertThisInitialized-081f9914.js";import"./text-ad1f5f1d.js";import"./select.input-88b6ebab.js";import"./input-d68625a5.js";import"./input-group-20c3add3.js";import"./input-group-addon-f8f6683a.js";import"./number-input-42f50494.js";import"./index-54f0d271.js";import"./check-box-73be452f.js";import"./slider-cf2db7b4.js";import"./index-c7f280f6.js";import"./popover-e20a61fe.js";import"./flex-89b67483.js";const Xr={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-23e84186.js";import{M as m}from"./actions-46447905.js";import{m as n}from"./menu.stories-data-
|
|
1
|
+
import{j as s}from"./jsx-runtime-f961835c.js";import{T as p}from"./tooltip-23e84186.js";import{M as m}from"./actions-46447905.js";import{m as n}from"./menu.stories-data-01af235b.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-e6a6c574.js";import"./spinner-cb92a546.js";import"./index-c89a1915.js";import"./icon-c5e1f218.js";import"./inheritsLoose-d4851ab8.js";import"./tslib.es6-dfef685f.js";import"./types-cc224262.js";import"./types-332ceaf3.js";import"./badge-3abf067b.js";import"./flex-89b67483.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"generatedAt":
|
|
1
|
+
{"generatedAt":1702401093101,"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.1"}}}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e}from"./iframe-bc0fdebc.js";import"../sb-preview/runtime.js";var a={docs:{renderer:async()=>{let{DocsRenderer:r}=await e(()=>import("./DocsRenderer-NNNQARDV-19e71c0e.js"),["./DocsRenderer-NNNQARDV-19e71c0e.js","./chunk-HLWAVYOI-3f2e7bdd.js","./iframe-bc0fdebc.js","./index-f80c8c95.js","./react-16-147b12fd.js","./index-3d476d02.js","./index-c54905c0.js","./inheritsLoose-d4851ab8.js","./assertThisInitialized-081f9914.js","./index-97a99495.js"],import.meta.url);return new r}}};export{a as parameters};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._inputInTable_16p4q_1{background-color:transparent;border-radius:inherit!important;height:var(--size);min-height:100%}._inputInTable_16p4q_1:not(:hover){border-color:transparent}._inputInTable_16p4q_1:not(:focus){box-shadow:none}._inputHover_16p4q_13{position:relative;border-color:var(--color-border-hover);z-index:2}._inputFocus_16p4q_18{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputError_16p4q_25,._inputWarning_16p4q_26{position:relative}._inputError_16p4q_25{z-index:2;border-color:var(--color-border-error);color:var(--color-text-error)!important;background-color:var(--color-background-error-muted)}._inputError_16p4q_25:hover{border-color:var(--color-border-error-hover)!important}._inputError_16p4q_25:focus{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputWarning_16p4q_26{z-index:1;border-color:var(--color-border-warning);color:var(--color-text-warning)!important;background-color:var(--color-background-warning-muted)}._inputWarning_16p4q_26:hover{border-color:var(--color-border-warning-hover)!important}._inputWarning_16p4q_26:focus{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputDisabled_16p4q_61{pointer-events:none;background-color:var(--color-background-disabled);color:var(--color-text-muted);box-shadow:none}._hideScrollbars_16p4q_67{scrollbar-width:none;-ms-overflow-style:none}._hideScrollbars_16p4q_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-700);--color-background-table-row-tinted: var(--color-neutral-750)}._wrapper_16p4q_85{border-radius:inherit;max-height:100%;max-width:100%;display:flex;flex-direction:column;overflow:hidden}._wrapper_16p4q_85._bordered_16p4q_93{border-radius:var(--border-radius);border:1px solid var(--color-border);box-shadow:var(--shadow-card)}._scroll_16p4q_98{overflow-y:auto;border-radius:inherit;flex:1;min-height:0}._scroll_16p4q_98:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}._table_16p4q_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_16p4q_108>:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}._table_16p4q_108>:first-child>:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}._table_16p4q_108>:first-child>:first-child>:first-child{border-top-left-radius:inherit}._table_16p4q_108>:first-child>:first-child>:last-child{border-top-right-radius:inherit}._table_16p4q_108>:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}._table_16p4q_108>:last-child>:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}._table_16p4q_108>:last-child>:last-child>:first-child{border-bottom-left-radius:inherit}._table_16p4q_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_16p4q_108>*:not(:last-child)>tr th,._table_16p4q_108>*:not(:last-child)>tr td,._table_16p4q_108>*:last-child>tr:not(:last-child) th,._table_16p4q_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_16p4q_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_17dgc_1{background-color:transparent;border-radius:inherit!important;height:var(--size);min-height:100%}._inputInTable_17dgc_1:not(:hover){border-color:transparent}._inputInTable_17dgc_1:not(:focus){box-shadow:none}._inputHover_17dgc_13{position:relative;border-color:var(--color-border-hover);z-index:2}._inputFocus_17dgc_18{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputError_17dgc_25,._inputWarning_17dgc_26{position:relative}._inputError_17dgc_25{z-index:2;border-color:var(--color-border-error);color:var(--color-text-error)!important;background-color:var(--color-background-error-muted)}._inputError_17dgc_25:hover{border-color:var(--color-border-error-hover)!important}._inputError_17dgc_25:focus{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputWarning_17dgc_26{z-index:1;border-color:var(--color-border-warning);color:var(--color-text-warning)!important;background-color:var(--color-background-warning-muted)}._inputWarning_17dgc_26:hover{border-color:var(--color-border-warning-hover)!important}._inputWarning_17dgc_26:focus{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputDisabled_17dgc_61{pointer-events:none;background-color:var(--color-background-disabled);color:var(--color-text-muted);box-shadow:none}._hideScrollbars_17dgc_67{scrollbar-width:none;-ms-overflow-style:none}._hideScrollbars_17dgc_67::-webkit-scrollbar{display:none}._cell_17dgc_77 a{cursor:pointer;color:var(--color-text-primary)}._cell_17dgc_77 a:hover{color:var(--color-text-primary-hover)}._cell_17dgc_77 a:active{color:var(--color-text-primary-active)}._cell_17dgc_77 a._disabledLink_17dgc_87{color:var(--color-text-faint)!important;cursor:default!important}._inputWrapper_17dgc_91{height:100%;border-radius:inherit}._inputWrapper_17dgc_91>span,._inputWrapper_17dgc_91>span>span,._inputWrapper_17dgc_91>span>span>div{height:100%;border-radius:inherit}._inputWrapper_17dgc_91>div,._inputWrapper_17dgc_91>div>span{height:100%;border-radius:inherit}._breakWord_17dgc_106{word-break:break-word}._inputCell_17dgc_109{padding:0!important}._sliderCell_17dgc_112{padding-top:0!important;padding-bottom:0!important}._staticCell_17dgc_116{padding:0!important}._staticCell_17dgc_116 ._staticCellContent_17dgc_119{line-height:1.25;min-height:100%;padding:var(--padding-input);position:relative;border-radius:inherit;display:flex;align-items:center}tbody ._staticCell_17dgc_116 ._staticCellContent_17dgc_119{color:var(--color-text-muted)}._staticCell_17dgc_116 ._staticCellContent_17dgc_119._error_17dgc_131,._staticCell_17dgc_116 ._staticCellContent_17dgc_119._warning_17dgc_132{border:1px solid transparent}._staticCell_17dgc_116 ._staticCellContent_17dgc_119._error_17dgc_131{background-color:var(--color-background-error)}._staticCell_17dgc_116 ._staticCellContent_17dgc_119._warning_17dgc_132{background-color:var(--color-background-warning)}._staticCell_17dgc_116 ._staticCellContent_17dgc_119._unit_17dgc_141{font-weight:400}._sortingCell_17dgc_144 ._staticCellContent_17dgc_119{position:relative;padding-right:calc(var(--size) + var(--padding-xxs))!important;cursor:pointer!important}._sortingCell_17dgc_144 ._staticCellContent_17dgc_119:hover{background-color:#0000000d!important}[data-theme=dark] ._sortingCell_17dgc_144 ._staticCellContent_17dgc_119:hover{background-color:#ffffff1a!important}._sortingCell_17dgc_144 ._sortingCellIcon_17dgc_155{font-size:var(--size-xs);position:absolute;right:var(--padding-input-x);top:50%;transform:translateY(-50%);display:flex}._sortingCell_17dgc_144 ._sortingCellIcon_17dgc_155>*{display:flex}._icon_17dgc_166{display:inline-flex;margin-left:var(--padding-xxs)}._checkBoxCell_17dgc_170{padding-block:0!important;width:var(--size)}._iconCellWrapper_17dgc_174{display:flex;justify-content:center}._actionsCell_17dgc_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_17dgc_186{text-align:right!important}._rightAligned_17dgc_186 ._staticCellContent_17dgc_119{justify-content:flex-end}._centerAligned_17dgc_192{text-align:center!important}._centerAligned_17dgc_192 ._staticCellContent_17dgc_119{justify-content:center}._leftAligned_17dgc_198{text-align:left!important}._popover_17dgc_201{padding:var(--padding-input)}._disabledPointerEvents_17dgc_204{pointer-events:none}
|