@oliasoft-open-source/react-ui-library 4.5.0 → 4.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/index.js +3 -2
  2. package/dist/index.js.map +1 -1
  3. package/dist/storybook/assets/{Color-6VNJS4EI-HEi_eHev.js → Color-6VNJS4EI-hAS5LjG0.js} +1 -1
  4. package/dist/storybook/assets/{DocsRenderer-NNNQARDV-inNf3vhV.js → DocsRenderer-NNNQARDV-t6iXcjlI.js} +1 -1
  5. package/dist/storybook/assets/{WithTooltip-4HIR6TLV-YjRbtiQd.js → WithTooltip-4HIR6TLV-EXM_UisT.js} +1 -1
  6. package/dist/storybook/assets/{accordion.stories-DAmwlTmm.js → accordion.stories-HoiQl98a.js} +1 -1
  7. package/dist/storybook/assets/{afe.stories-YefEu4ve.js → afe.stories-n9sXDAMv.js} +1 -1
  8. package/dist/storybook/assets/{blowout.stories-FLPAE9fr.js → blowout.stories-ro9WCHli.js} +1 -1
  9. package/dist/storybook/assets/{buttons-and-links-M1gBHZkR.js → buttons-and-links-ftv0zbwN.js} +1 -1
  10. package/dist/storybook/assets/{casing-loads.stories-7fO3E08h.js → casing-loads.stories-ONI2BhpU.js} +1 -1
  11. package/dist/storybook/assets/{cell.stories-S9IDsuIA.js → cell.stories-FGJr13HC.js} +1 -1
  12. package/dist/storybook/assets/{chunk-HLWAVYOI-H4e42Z9I.js → chunk-HLWAVYOI-jhhGhXKB.js} +1 -1
  13. package/dist/storybook/assets/{color-heFzWL2m.js → color-4GYIInYi.js} +1 -1
  14. package/dist/storybook/assets/{drawer.stories-HJN51eTr.js → drawer.stories-a2C35tbD.js} +1 -1
  15. package/dist/storybook/assets/{footer.stories-4uhW-z_4.js → footer.stories-nCkpV7Yt.js} +1 -1
  16. package/dist/storybook/assets/{formation.stories-PmRbjLVy.js → formation.stories-R3W7H_Rc.js} +1 -1
  17. package/dist/storybook/assets/{formatter-SWP5E3XI-PYpdbOxZ.js → formatter-SWP5E3XI-nDlvV_yz.js} +1 -1
  18. package/dist/storybook/assets/iframe-fZf8RXY8.js +7 -0
  19. package/dist/storybook/assets/{index-kEA1EH0x.js → index-J809fMmq.js} +5 -5
  20. package/dist/storybook/assets/{input-validation-SIDSAFaH.js → input-validation-KCJCN0yQ.js} +1 -1
  21. package/dist/storybook/assets/{inputs-Q-JCPEm_.js → inputs-5Dsixbp9.js} +1 -1
  22. package/dist/storybook/assets/{layout-forms-sTxS59Zq.js → layout-forms-hLUZFgjt.js} +1 -1
  23. package/dist/storybook/assets/{layout-general-82Ja2Lb_.js → layout-general-pWHB8pQP.js} +1 -1
  24. package/dist/storybook/assets/{list-5kbN7yr8.js → list-FJ7byNrg.js} +1 -1
  25. package/dist/storybook/assets/{list.stories-a1qTCCEj.js → list.stories-nWamVbJ2.js} +1 -1
  26. package/dist/storybook/assets/{padding-and-spacing-CLf0dRGb.js → padding-and-spacing-PD_4uQcK.js} +1 -1
  27. package/dist/storybook/assets/{page.stories-eHXLB7iO.js → page.stories-B5gzoAi8.js} +1 -1
  28. package/dist/storybook/assets/{preview-niHg4y_T.js → preview-cyb8LEBC.js} +1 -1
  29. package/dist/storybook/assets/{preview-kCAXH-J5.js → preview-jdsgMyUk.js} +2 -2
  30. package/dist/storybook/assets/{projects.stories-GYkShoTB.js → projects.stories-UU4irLQZ.js} +1 -1
  31. package/dist/storybook/assets/{reservoirs.stories-ZhxgN63G.js → reservoirs.stories-iKvudcEf.js} +1 -1
  32. package/dist/storybook/assets/{row.stories-HVr8m6RK.js → row.stories-J389Ezfp.js} +1 -1
  33. package/dist/storybook/assets/{site.stories-AbEac__s.js → site.stories-4pPVEtn7.js} +1 -1
  34. package/dist/storybook/assets/{syntaxhighlighter-NMPM6SWI-q5ulcVwD.js → syntaxhighlighter-NMPM6SWI-Bt8NQoOb.js} +1 -1
  35. package/dist/storybook/assets/{table-_jWgMFOi.js → table-fX2iU96a.js} +1 -1
  36. package/dist/storybook/assets/{table.stories-lwqVUJHa.js → table.stories-CIbyraqh.js} +1 -1
  37. package/dist/storybook/assets/{title.stories-Djnk3crF.js → title.stories-nSN4OumV.js} +1 -1
  38. package/dist/storybook/assets/{top-bar-uqbsCAt-.js → top-bar-0fDAFWyC.js} +1 -1
  39. package/dist/storybook/assets/{top-bar.stories-lt8T4EVJ.js → top-bar.stories-YKtteM_h.js} +1 -1
  40. package/dist/storybook/assets/{top-bar.testcase.stories-_Nc_6uY7.js → top-bar.testcase.stories-Z-6C5D2R.js} +1 -1
  41. package/dist/storybook/assets/unit-input.stories-0l2v-aF9.js +273 -0
  42. package/dist/storybook/assets/unit-table.stories-62i0bHyO.js +103 -0
  43. package/dist/storybook/assets/use-previous-VKMmnaK7.js +1 -0
  44. package/dist/storybook/iframe.html +1 -1
  45. package/dist/storybook/index.json +1 -1
  46. package/dist/storybook/project.json +1 -1
  47. package/dist/storybook/stories.json +1 -1
  48. package/package.json +3 -3
  49. package/dist/storybook/assets/iframe-IZZyfjHT.js +0 -7
  50. package/dist/storybook/assets/unit-input.stories-ZdrR9JWT.js +0 -273
@@ -1,4 +1,4 @@
1
- import{j as at}from"./jsx-runtime-FsUICBgo.js";import{g as De,c as ct,a as Li,r as he,R as fe}from"./index-RfLt4OUa.js";import{T as Di}from"./toaster-eOozfa7U.js";import{r as ga,s as ma,t as qr,i as ki,v as ya,e as Hr,w as Mi,x as Bi,c as zr,y as Gi,z as Ui,A as qi,B as Hi,C as va,D as zi,E as Wi,F as Yi,G as Xi,H as Ki,I as Vi,J as Qi,K as Ji,p as ba}from"./index-gM75B7fB.js";import{f as Zi,k as Sa,h as eo,i as to,j as ro,l as no,o as ao,m as ke,p as io,q as oo,r as so,t as cn}from"./index-kEA1EH0x.js";import{a as lo}from"./isPlainObject-4RuU_w9g.js";import{e as pn}from"./index-cCpkwrS5.js";import"./chunk-HLWAVYOI-H4e42Z9I.js";import"./index-miLrID2P.js";import"./message-uMHaTEXV.js";import"./index-VW3EWkuE.js";import"./common-types-U65vzrrz.js";import"./icon-y1a2N5SZ.js";import"./inheritsLoose-Y9jOMJLd.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./iframe-IZZyfjHT.js";import"../sb-preview/runtime.js";import"./extends-dGVwEr9R.js";import"./assertThisInitialized-4q6YPdh3.js";import"./react-16-hgR7FrAp.js";var hn="DARK_MODE";const{global:uo}=__STORYBOOK_MODULE_GLOBAL__;__STORYBOOK_MODULE_CLIENT_LOGGER__;function Te(){return Te=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Te.apply(this,arguments)}function fo(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Qe(t,e){return Qe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Qe(t,e)}function co(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Qe(t,e)}function yr(t){return yr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yr(t)}function po(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function ho(){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 pt(t,e,r){return ho()?pt=Reflect.construct.bind():pt=function(n,s,o){var l=[null];l.push.apply(l,s);var a=Function.bind.apply(n,l),i=new a;return o&&Qe(i,o.prototype),i},pt.apply(null,arguments)}function vr(t){var e=typeof Map=="function"?new Map:void 0;return vr=function(r){if(r===null||!po(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(r))return e.get(r);e.set(r,n)}function n(){return pt(r,arguments,yr(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Qe(n,r)},vr(t)}var go={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 }).
1
+ import{j as at}from"./jsx-runtime-FsUICBgo.js";import{g as De,c as ct,a as Li,r as he,R as fe}from"./index-RfLt4OUa.js";import{T as Di}from"./toaster-eOozfa7U.js";import{r as ga,s as ma,t as qr,i as ki,v as ya,e as Hr,w as Mi,x as Bi,c as zr,y as Gi,z as Ui,A as qi,B as Hi,C as va,D as zi,E as Wi,F as Yi,G as Xi,H as Ki,I as Vi,J as Qi,K as Ji,p as ba}from"./index-gM75B7fB.js";import{f as Zi,k as Sa,h as eo,i as to,j as ro,l as no,o as ao,m as ke,p as io,q as oo,r as so,t as cn}from"./index-J809fMmq.js";import{a as lo}from"./isPlainObject-4RuU_w9g.js";import{e as pn}from"./index-cCpkwrS5.js";import"./chunk-HLWAVYOI-jhhGhXKB.js";import"./index-miLrID2P.js";import"./message-uMHaTEXV.js";import"./index-VW3EWkuE.js";import"./common-types-U65vzrrz.js";import"./icon-y1a2N5SZ.js";import"./inheritsLoose-Y9jOMJLd.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./iframe-fZf8RXY8.js";import"../sb-preview/runtime.js";import"./extends-dGVwEr9R.js";import"./assertThisInitialized-4q6YPdh3.js";import"./react-16-hgR7FrAp.js";var hn="DARK_MODE";const{global:uo}=__STORYBOOK_MODULE_GLOBAL__;__STORYBOOK_MODULE_CLIENT_LOGGER__;function Te(){return Te=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Te.apply(this,arguments)}function fo(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Qe(t,e){return Qe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Qe(t,e)}function co(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Qe(t,e)}function yr(t){return yr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yr(t)}function po(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function ho(){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 pt(t,e,r){return ho()?pt=Reflect.construct.bind():pt=function(n,s,o){var l=[null];l.push.apply(l,s);var a=Function.bind.apply(n,l),i=new a;return o&&Qe(i,o.prototype),i},pt.apply(null,arguments)}function vr(t){var e=typeof Map=="function"?new Map:void 0;return vr=function(r){if(r===null||!po(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(r))return e.get(r);e.set(r,n)}function n(){return pt(r,arguments,yr(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Qe(n,r)},vr(t)}var go={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
 
@@ -1,7 +1,7 @@
1
- import{_ as e}from"./iframe-IZZyfjHT.js";import"../sb-preview/runtime.js";var a={docs:{renderer:async()=>{let{DocsRenderer:r}=await e(()=>import("./DocsRenderer-NNNQARDV-inNf3vhV.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url);return new r}}};export{a as parameters};
1
+ import{_ as e}from"./iframe-fZf8RXY8.js";import"../sb-preview/runtime.js";var a={docs:{renderer:async()=>{let{DocsRenderer:r}=await e(()=>import("./DocsRenderer-NNNQARDV-t6iXcjlI.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url);return new r}}};export{a as parameters};
2
2
  function __vite__mapDeps(indexes) {
3
3
  if (!__vite__mapDeps.viteFileDeps) {
4
- __vite__mapDeps.viteFileDeps = ["./DocsRenderer-NNNQARDV-inNf3vhV.js","./chunk-HLWAVYOI-H4e42Z9I.js","./iframe-IZZyfjHT.js","./index-RfLt4OUa.js","./react-16-hgR7FrAp.js","./index-miLrID2P.js","./index-kEA1EH0x.js","./extends-dGVwEr9R.js","./assertThisInitialized-4q6YPdh3.js","./inheritsLoose-Y9jOMJLd.js","./index-gM75B7fB.js"]
4
+ __vite__mapDeps.viteFileDeps = ["./DocsRenderer-NNNQARDV-t6iXcjlI.js","./chunk-HLWAVYOI-jhhGhXKB.js","./iframe-fZf8RXY8.js","./index-RfLt4OUa.js","./react-16-hgR7FrAp.js","./index-miLrID2P.js","./index-J809fMmq.js","./extends-dGVwEr9R.js","./assertThisInitialized-4q6YPdh3.js","./inheritsLoose-Y9jOMJLd.js","./index-gM75B7fB.js"]
5
5
  }
6
6
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
7
7
  }
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-FsUICBgo.js";import"./index-RfLt4OUa.js";import{T as n}from"./top-bar-uqbsCAt-.js";import{L as r}from"./list-5kbN7yr8.js";import{P as p}from"./page-9-f6BzS0.js";import{R as c,C as o}from"./row-vFUhHoz5.js";import{T as d}from"./tabs-fcLbHC1n.js";import{S as u}from"./spacer-Yji9g2AW.js";import"./index-VW3EWkuE.js";import"./icon-y1a2N5SZ.js";import"./inheritsLoose-Y9jOMJLd.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./common-types-U65vzrrz.js";import"./button-IoNblLER.js";import"./spinner-R8Il4aRe.js";import"./tooltip-ZHdi6rl-.js";import"./index-miLrID2P.js";import"./actions-SGexXf58.js";import"./lodash-Bmg8FrMx.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./index.es-JXn3JM7k.js";import"./extends-dGVwEr9R.js";import"./redux-F5dueAP3.js";import"./objectSpread2-93s0nBry.js";import"./memoize-one.esm-hqe5SRxC.js";import"./card-0r8RRVk-.js";import"./list-heading-XbqCJOHh.js";import"./heading-cUVItwKq.js";import"./help-icon-nI9A506M.js";import"./loader-TGOJBZQG.js";import"./styled-components.browser.esm-qIipjd6c.js";import"./select.input-zP5tW20f.js";const t=[{label:"Browse",value:"Browse"},{label:"Recent",value:"Recent"},{label:"My Projects",value:"My Projects"}],s=[{id:1,name:"Lorem",active:!0},{id:2,name:"Ipsum"},{id:3,name:"Dolor"},{id:4,name:"Long name goes here lorem ipsum"},{id:5,name:"Lorem"},{id:6,name:"Ipsum"},{id:7,name:"Dolor"},{id:8,name:"Long name goes here lorem ipsum"},{id:9,name:"Lorem"},{id:10,name:"Ipsum"},{id:11,name:"Dolor"},{id:12,name:"Long name goes here lorem ipsum"},{id:13,name:"Lorem"},{id:14,name:"Ipsum"},{id:15,name:"Dolor"},{id:16,name:"Long name goes here lorem ipsum"}],X={title:"Layout/Layout Examples",parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}}},l=()=>e.jsxs(e.Fragment,{children:[e.jsx(n,{}),e.jsxs(p,{padding:!1,left:0,scroll:!1,children:[e.jsx(u,{}),e.jsx(d,{margin:!1,padding:!0,options:t,value:t[0]}),e.jsxs(c,{spacing:0,flex:!0,height:"100%",children:[e.jsx(o,{borderRight:!0,scroll:!0,showScrollbar:!1,children:e.jsx(r,{list:{name:"Country",items:s}})}),e.jsx(o,{borderRight:!0,scroll:!0,showScrollbar:!1,children:e.jsx(r,{list:{name:"Field",items:s}})}),e.jsx(o,{borderRight:!0,scroll:!0,showScrollbar:!1,children:e.jsx(r,{list:{name:"Site",items:s}})}),e.jsx(o,{borderRight:!0,scroll:!0,showScrollbar:!1,children:e.jsx(r,{list:{name:"Well",items:s}})}),e.jsx(o,{borderRight:!0,scroll:!0,showScrollbar:!1,children:e.jsx(r,{list:{name:"Wellbore",items:s}})}),e.jsx(o,{scroll:!0,showScrollbar:!1,children:e.jsx(r,{list:{name:"Design",items:s}})})]})]})]});var i,m,a;l.parameters={...l.parameters,docs:{...(i=l.parameters)==null?void 0:i.docs,source:{originalSource:`() => {
1
+ import{j as e}from"./jsx-runtime-FsUICBgo.js";import"./index-RfLt4OUa.js";import{T as n}from"./top-bar-0fDAFWyC.js";import{L as r}from"./list-FJ7byNrg.js";import{P as p}from"./page-9-f6BzS0.js";import{R as c,C as o}from"./row-vFUhHoz5.js";import{T as d}from"./tabs-fcLbHC1n.js";import{S as u}from"./spacer-Yji9g2AW.js";import"./index-VW3EWkuE.js";import"./icon-y1a2N5SZ.js";import"./inheritsLoose-Y9jOMJLd.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./common-types-U65vzrrz.js";import"./button-IoNblLER.js";import"./spinner-R8Il4aRe.js";import"./tooltip-ZHdi6rl-.js";import"./index-miLrID2P.js";import"./actions-SGexXf58.js";import"./lodash-Bmg8FrMx.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./index.es-JXn3JM7k.js";import"./extends-dGVwEr9R.js";import"./redux-F5dueAP3.js";import"./objectSpread2-93s0nBry.js";import"./memoize-one.esm-hqe5SRxC.js";import"./card-0r8RRVk-.js";import"./list-heading-XbqCJOHh.js";import"./heading-cUVItwKq.js";import"./help-icon-nI9A506M.js";import"./loader-TGOJBZQG.js";import"./styled-components.browser.esm-qIipjd6c.js";import"./select.input-zP5tW20f.js";const t=[{label:"Browse",value:"Browse"},{label:"Recent",value:"Recent"},{label:"My Projects",value:"My Projects"}],s=[{id:1,name:"Lorem",active:!0},{id:2,name:"Ipsum"},{id:3,name:"Dolor"},{id:4,name:"Long name goes here lorem ipsum"},{id:5,name:"Lorem"},{id:6,name:"Ipsum"},{id:7,name:"Dolor"},{id:8,name:"Long name goes here lorem ipsum"},{id:9,name:"Lorem"},{id:10,name:"Ipsum"},{id:11,name:"Dolor"},{id:12,name:"Long name goes here lorem ipsum"},{id:13,name:"Lorem"},{id:14,name:"Ipsum"},{id:15,name:"Dolor"},{id:16,name:"Long name goes here lorem ipsum"}],X={title:"Layout/Layout Examples",parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}}},l=()=>e.jsxs(e.Fragment,{children:[e.jsx(n,{}),e.jsxs(p,{padding:!1,left:0,scroll:!1,children:[e.jsx(u,{}),e.jsx(d,{margin:!1,padding:!0,options:t,value:t[0]}),e.jsxs(c,{spacing:0,flex:!0,height:"100%",children:[e.jsx(o,{borderRight:!0,scroll:!0,showScrollbar:!1,children:e.jsx(r,{list:{name:"Country",items:s}})}),e.jsx(o,{borderRight:!0,scroll:!0,showScrollbar:!1,children:e.jsx(r,{list:{name:"Field",items:s}})}),e.jsx(o,{borderRight:!0,scroll:!0,showScrollbar:!1,children:e.jsx(r,{list:{name:"Site",items:s}})}),e.jsx(o,{borderRight:!0,scroll:!0,showScrollbar:!1,children:e.jsx(r,{list:{name:"Well",items:s}})}),e.jsx(o,{borderRight:!0,scroll:!0,showScrollbar:!1,children:e.jsx(r,{list:{name:"Wellbore",items:s}})}),e.jsx(o,{scroll:!0,showScrollbar:!1,children:e.jsx(r,{list:{name:"Design",items:s}})})]})]})]});var i,m,a;l.parameters={...l.parameters,docs:{...(i=l.parameters)==null?void 0:i.docs,source:{originalSource:`() => {
2
2
  return <>
3
3
  <TopBar />
4
4
  <Page padding={false} left={0} scroll={false}>
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-FsUICBgo.js";import{r as b}from"./index-RfLt4OUa.js";import{I as j}from"./common-types-U65vzrrz.js";import{T as w}from"./top-bar-uqbsCAt-.js";import{S as L}from"./side-bar-GJ2tcZYY.js";import{H as t}from"./heading-cUVItwKq.js";import{B as m}from"./button-IoNblLER.js";import{D as v}from"./drawer-TM-jK3WR.js";import{L as C}from"./list-5kbN7yr8.js";import{F as l}from"./field-kOZPBHf6.js";import{I as i}from"./input-iDZqV-2m.js";import{C as p}from"./check-box-BX5dfQFk.js";import{R as h}from"./radio-button-QcS9mLYi.js";import{C as d}from"./card-0r8RRVk-.js";import{F}from"./form-row-bwoDTUga.js";import{P as g}from"./page-9-f6BzS0.js";import{R as a,C as r}from"./row-vFUhHoz5.js";import{S as R}from"./select-Z1HqJ5aU.js";import{S as f}from"./spacer-Yji9g2AW.js";import"./index-VW3EWkuE.js";import"./icon-y1a2N5SZ.js";import"./inheritsLoose-Y9jOMJLd.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./actions-SGexXf58.js";import"./lodash-Bmg8FrMx.js";import"./tooltip-ZHdi6rl-.js";import"./index-miLrID2P.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./index-ugi_ZH6T.js";import"./help-icon-nI9A506M.js";import"./spinner-R8Il4aRe.js";import"./index.es-JXn3JM7k.js";import"./extends-dGVwEr9R.js";import"./redux-F5dueAP3.js";import"./objectSpread2-93s0nBry.js";import"./memoize-one.esm-hqe5SRxC.js";import"./list-heading-XbqCJOHh.js";import"./loader-TGOJBZQG.js";import"./label-RpB4JmHX.js";import"./select.input-zP5tW20f.js";import"./styled-components.browser.esm-qIipjd6c.js";import"./assertThisInitialized-4q6YPdh3.js";import"./text-6KQ6ntOV.js";const k=({width:o,height:n})=>e.jsx("div",{style:{background:"#ddd",width:o,height:n}}),ve={title:"Layout/Layout Examples",parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}}},s=()=>{const[o,n]=b.useState(!0);return e.jsxs(e.Fragment,{children:[e.jsx(w,{}),e.jsx(L,{options:{title:"",sections:[]}}),e.jsx(g,{padding:!1,scroll:!1,children:e.jsxs(a,{spacing:0,height:"100%",children:[e.jsx(v,{button:e.jsx(m,{onClick:()=>n(!o),round:!0,icon:j.CHEVRON_LEFT}),open:o,width:300,closedWidth:"var(--size-sidebar)",children:e.jsx(C,{drawer:!0,narrow:!o,list:{name:"Reservoirs",items:[{id:1,name:"Lorem",active:!0},{id:2,name:"Ipsum"}]}})}),e.jsxs(r,{scroll:!0,padding:!0,borderLeft:!0,children:[e.jsxs(a,{children:[e.jsxs(r,{children:[e.jsx(t,{top:!0,children:"Reservoir name here"}),e.jsxs(F,{children:[e.jsx(l,{label:"Name",children:e.jsx(i,{value:"Reservoir name here",width:"200px"})}),e.jsx(l,{label:"Lorem",children:e.jsx(h,{name:"example",options:[{label:"Aardvarks",value:"termites"},{label:"Monkeys",value:"bananas"}],value:{label:"Monkeys",value:"bananas"},inline:!0})}),e.jsx(l,{label:"Ipsum",children:e.jsx(R,{name:"example",options:[{label:"Monkeys",value:"bananas"},{label:"Possums",value:"slugs"}],value:{label:"Monkeys",value:"bananas"},native:!0})}),e.jsx(l,{children:e.jsx(p,{label:"Dolor"})})]})]}),e.jsx(r,{flex:!1,children:e.jsx(m,{onClick:()=>{},round:!0,icon:"question"})})]}),e.jsxs(a,{children:[e.jsx(r,{width:"50%",children:e.jsx(d,{heading:e.jsx(t,{onClickHelp:()=>console.log("help!"),children:"Reservoir Zone"}),children:e.jsxs(a,{children:[e.jsxs(r,{width:"50%",children:[e.jsxs(l,{label:"Label",helpText:"Lorem ipsum",children:[e.jsx(h,{options:[{label:"Aardvarks",value:"termites"},{label:"Monkeys",value:"bananas"}],value:{label:"Monkeys",value:"bananas"},inline:!0}),e.jsx(i,{width:"100%"})]}),e.jsxs(l,{label:"Label",helpText:"Lorem ipsum",children:[e.jsx(p,{label:"Lorem ipsum"}),e.jsx(i,{width:"100%",disabled:!0})]}),e.jsx(l,{label:"Label",helpText:"Lorem ipsum",children:e.jsx(i,{width:"100%"})}),e.jsx(l,{label:"Label",helpText:"Lorem ipsum",children:e.jsx(i,{width:"100%"})})]}),e.jsxs(r,{width:"50%",children:[e.jsx(l,{label:"Label",helpText:"Lorem ipsum",children:e.jsx(i,{width:"100%"})}),e.jsx(l,{label:"Label",helpText:"Lorem ipsum",children:e.jsx(i,{width:"100%"})}),e.jsx(l,{label:"Label",helpText:"Lorem ipsum",children:e.jsx(i,{width:"100%"})}),e.jsx(l,{label:"Label",helpText:"Lorem ipsum",children:e.jsx(i,{width:"100%"})})]})]})})}),e.jsxs(r,{width:"50%",children:[e.jsx(d,{heading:e.jsx(t,{children:"Reservoir Size"}),children:e.jsxs(a,{children:[e.jsxs(r,{width:"160px",children:[e.jsx(l,{label:"Length",children:e.jsx(i,{width:"100%"})}),e.jsx(l,{label:"Width",children:e.jsx(i,{width:"100%"})})]}),e.jsx(r,{children:e.jsx(k,{width:"100%",height:"100%"})})]})}),e.jsx(f,{}),e.jsx(d,{heading:e.jsx(t,{children:"Reservoir Properties"}),children:e.jsxs(a,{children:[e.jsx(r,{children:e.jsx(l,{label:"Label",children:e.jsx(i,{width:"100%"})})}),e.jsx(r,{children:e.jsx(l,{label:"Label",children:e.jsx(i,{width:"100%"})})}),e.jsx(r,{children:e.jsx(l,{label:"Label",children:e.jsx(i,{width:"100%"})})})]})})]})]})]})]})})]})};var u,x,c;s.parameters={...s.parameters,docs:{...(u=s.parameters)==null?void 0:u.docs,source:{originalSource:`() => {
1
+ import{j as e}from"./jsx-runtime-FsUICBgo.js";import{r as b}from"./index-RfLt4OUa.js";import{I as j}from"./common-types-U65vzrrz.js";import{T as w}from"./top-bar-0fDAFWyC.js";import{S as L}from"./side-bar-GJ2tcZYY.js";import{H as t}from"./heading-cUVItwKq.js";import{B as m}from"./button-IoNblLER.js";import{D as v}from"./drawer-TM-jK3WR.js";import{L as C}from"./list-FJ7byNrg.js";import{F as l}from"./field-kOZPBHf6.js";import{I as i}from"./input-iDZqV-2m.js";import{C as p}from"./check-box-BX5dfQFk.js";import{R as h}from"./radio-button-QcS9mLYi.js";import{C as d}from"./card-0r8RRVk-.js";import{F}from"./form-row-bwoDTUga.js";import{P as g}from"./page-9-f6BzS0.js";import{R as a,C as r}from"./row-vFUhHoz5.js";import{S as R}from"./select-Z1HqJ5aU.js";import{S as f}from"./spacer-Yji9g2AW.js";import"./index-VW3EWkuE.js";import"./icon-y1a2N5SZ.js";import"./inheritsLoose-Y9jOMJLd.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./actions-SGexXf58.js";import"./lodash-Bmg8FrMx.js";import"./tooltip-ZHdi6rl-.js";import"./index-miLrID2P.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./index-ugi_ZH6T.js";import"./help-icon-nI9A506M.js";import"./spinner-R8Il4aRe.js";import"./index.es-JXn3JM7k.js";import"./extends-dGVwEr9R.js";import"./redux-F5dueAP3.js";import"./objectSpread2-93s0nBry.js";import"./memoize-one.esm-hqe5SRxC.js";import"./list-heading-XbqCJOHh.js";import"./loader-TGOJBZQG.js";import"./label-RpB4JmHX.js";import"./select.input-zP5tW20f.js";import"./styled-components.browser.esm-qIipjd6c.js";import"./assertThisInitialized-4q6YPdh3.js";import"./text-6KQ6ntOV.js";const k=({width:o,height:n})=>e.jsx("div",{style:{background:"#ddd",width:o,height:n}}),ve={title:"Layout/Layout Examples",parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}}},s=()=>{const[o,n]=b.useState(!0);return e.jsxs(e.Fragment,{children:[e.jsx(w,{}),e.jsx(L,{options:{title:"",sections:[]}}),e.jsx(g,{padding:!1,scroll:!1,children:e.jsxs(a,{spacing:0,height:"100%",children:[e.jsx(v,{button:e.jsx(m,{onClick:()=>n(!o),round:!0,icon:j.CHEVRON_LEFT}),open:o,width:300,closedWidth:"var(--size-sidebar)",children:e.jsx(C,{drawer:!0,narrow:!o,list:{name:"Reservoirs",items:[{id:1,name:"Lorem",active:!0},{id:2,name:"Ipsum"}]}})}),e.jsxs(r,{scroll:!0,padding:!0,borderLeft:!0,children:[e.jsxs(a,{children:[e.jsxs(r,{children:[e.jsx(t,{top:!0,children:"Reservoir name here"}),e.jsxs(F,{children:[e.jsx(l,{label:"Name",children:e.jsx(i,{value:"Reservoir name here",width:"200px"})}),e.jsx(l,{label:"Lorem",children:e.jsx(h,{name:"example",options:[{label:"Aardvarks",value:"termites"},{label:"Monkeys",value:"bananas"}],value:{label:"Monkeys",value:"bananas"},inline:!0})}),e.jsx(l,{label:"Ipsum",children:e.jsx(R,{name:"example",options:[{label:"Monkeys",value:"bananas"},{label:"Possums",value:"slugs"}],value:{label:"Monkeys",value:"bananas"},native:!0})}),e.jsx(l,{children:e.jsx(p,{label:"Dolor"})})]})]}),e.jsx(r,{flex:!1,children:e.jsx(m,{onClick:()=>{},round:!0,icon:"question"})})]}),e.jsxs(a,{children:[e.jsx(r,{width:"50%",children:e.jsx(d,{heading:e.jsx(t,{onClickHelp:()=>console.log("help!"),children:"Reservoir Zone"}),children:e.jsxs(a,{children:[e.jsxs(r,{width:"50%",children:[e.jsxs(l,{label:"Label",helpText:"Lorem ipsum",children:[e.jsx(h,{options:[{label:"Aardvarks",value:"termites"},{label:"Monkeys",value:"bananas"}],value:{label:"Monkeys",value:"bananas"},inline:!0}),e.jsx(i,{width:"100%"})]}),e.jsxs(l,{label:"Label",helpText:"Lorem ipsum",children:[e.jsx(p,{label:"Lorem ipsum"}),e.jsx(i,{width:"100%",disabled:!0})]}),e.jsx(l,{label:"Label",helpText:"Lorem ipsum",children:e.jsx(i,{width:"100%"})}),e.jsx(l,{label:"Label",helpText:"Lorem ipsum",children:e.jsx(i,{width:"100%"})})]}),e.jsxs(r,{width:"50%",children:[e.jsx(l,{label:"Label",helpText:"Lorem ipsum",children:e.jsx(i,{width:"100%"})}),e.jsx(l,{label:"Label",helpText:"Lorem ipsum",children:e.jsx(i,{width:"100%"})}),e.jsx(l,{label:"Label",helpText:"Lorem ipsum",children:e.jsx(i,{width:"100%"})}),e.jsx(l,{label:"Label",helpText:"Lorem ipsum",children:e.jsx(i,{width:"100%"})})]})]})})}),e.jsxs(r,{width:"50%",children:[e.jsx(d,{heading:e.jsx(t,{children:"Reservoir Size"}),children:e.jsxs(a,{children:[e.jsxs(r,{width:"160px",children:[e.jsx(l,{label:"Length",children:e.jsx(i,{width:"100%"})}),e.jsx(l,{label:"Width",children:e.jsx(i,{width:"100%"})})]}),e.jsx(r,{children:e.jsx(k,{width:"100%",height:"100%"})})]})}),e.jsx(f,{}),e.jsx(d,{heading:e.jsx(t,{children:"Reservoir Properties"}),children:e.jsxs(a,{children:[e.jsx(r,{children:e.jsx(l,{label:"Label",children:e.jsx(i,{width:"100%"})})}),e.jsx(r,{children:e.jsx(l,{label:"Label",children:e.jsx(i,{width:"100%"})})}),e.jsx(r,{children:e.jsx(l,{label:"Label",children:e.jsx(i,{width:"100%"})})})]})})]})]})]})]})})]})};var u,x,c;s.parameters={...s.parameters,docs:{...(u=s.parameters)==null?void 0:u.docs,source:{originalSource:`() => {
2
2
  const [open, setOpen] = useState(true);
3
3
  return <>
4
4
  <TopBar />
@@ -1,4 +1,4 @@
1
- import{j as o}from"./jsx-runtime-FsUICBgo.js";import{r as R}from"./index-RfLt4OUa.js";import{T as c}from"./table-_jWgMFOi.js";import{T as V}from"./text-6KQ6ntOV.js";import{t as g,i as W,q as B}from"./table.stories-data-2BZDVr2X.js";import"./index-VW3EWkuE.js";import"./index.es-JXn3JM7k.js";import"./inheritsLoose-Y9jOMJLd.js";import"./extends-dGVwEr9R.js";import"./redux-F5dueAP3.js";import"./objectSpread2-93s0nBry.js";import"./index-miLrID2P.js";import"./memoize-one.esm-hqe5SRxC.js";import"./icon-y1a2N5SZ.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./lodash-Bmg8FrMx.js";import"./actions-SGexXf58.js";import"./common-types-U65vzrrz.js";import"./button-IoNblLER.js";import"./spinner-R8Il4aRe.js";import"./tooltip-ZHdi6rl-.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./heading-cUVItwKq.js";import"./help-icon-nI9A506M.js";import"./pagination-Eaj_UOBW.js";import"./select-Z1HqJ5aU.js";import"./assertThisInitialized-4q6YPdh3.js";import"./select.input-zP5tW20f.js";import"./input-iDZqV-2m.js";import"./input-group-R8LoqKRn.js";import"./input-group-addon-BHVsW9mL.js";import"./number-input-d7hXQldd.js";import"./index-IQMsp8Ab.js";import"./index-cCpkwrS5.js";import"./check-box-BX5dfQFk.js";import"./slider-_5NQKbM-.js";import"./index-ugi_ZH6T.js";import"./popover-uAo1e4-D.js";import"./flex-ZVra76N-.js";const Le={title:"Basic/Table/Row",component:c,args:{table:{...g}}},b=n=>o.jsx(c,{...n}),i=b.bind({});i.args={table:W};const p=b.bind({});p.args={table:B};const t=b.bind({});t.args={table:{...g,striped:!1}};t.parameters={docs:{description:{story:"`striped: false` removes tinted background on alternative rows."}}};const m=()=>{const[n,e]=R.useState(null),a=r=>e(n===r?null:r);return o.jsx(c,{table:{...g,striped:!1,rows:g.rows.map((r,d)=>({...r,onRowClick:()=>a(d),expandedContent:{content:n===d?o.jsx("div",{children:"Example expanded content"}):null}}))}})},w=()=>{const n={draggable:!0,headers:[{cells:[{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"}]}],rows:[{noDrag:!0,cells:[{value:"Undraggable"},{value:100},{value:361},{value:"Vietnam"}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"}]}]},e=(s,u,l)=>{const x=[...s];return s[l].noDrag?s:(x.splice(l,0,x.splice(u,1)[0]),x)},[a,r]=R.useState(n.rows),d=s=>{const{to:u,from:l}=s;e(a,l,u),r(e(a,l,u))};return o.jsx(c,{table:{...n,rows:a},onListReorder:d})},v=()=>{const[n,e]=R.useState("Hover any row!"),a=[1,2,3,4,5].map(r=>({cells:[{value:`Row ${r}`},{value:`${r**2}`}],onRowMouseEnter:()=>e(`Hovering row ${r}`),onRowMouseLeave:()=>e("Not hovering any row...")}));return o.jsxs(o.Fragment,{children:[o.jsx(V,{children:n}),o.jsx(c,{table:{fixedWidth:"100%",headers:[{cells:[{value:"Description"},{value:"Value"}],onRowMouseEnter:()=>e("Hovering header row"),onRowMouseLeave:()=>e("Not hovering any row...")}],rows:a}})]})};var y,D,E;i.parameters={...i.parameters,docs:{...(y=i.parameters)==null?void 0:y.docs,source:{originalSource:`args => {
1
+ import{j as o}from"./jsx-runtime-FsUICBgo.js";import{r as R}from"./index-RfLt4OUa.js";import{T as c}from"./table-fX2iU96a.js";import{T as V}from"./text-6KQ6ntOV.js";import{t as g,i as W,q as B}from"./table.stories-data-2BZDVr2X.js";import"./index-VW3EWkuE.js";import"./index.es-JXn3JM7k.js";import"./inheritsLoose-Y9jOMJLd.js";import"./extends-dGVwEr9R.js";import"./redux-F5dueAP3.js";import"./objectSpread2-93s0nBry.js";import"./index-miLrID2P.js";import"./memoize-one.esm-hqe5SRxC.js";import"./icon-y1a2N5SZ.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./lodash-Bmg8FrMx.js";import"./actions-SGexXf58.js";import"./common-types-U65vzrrz.js";import"./button-IoNblLER.js";import"./spinner-R8Il4aRe.js";import"./tooltip-ZHdi6rl-.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./heading-cUVItwKq.js";import"./help-icon-nI9A506M.js";import"./pagination-Eaj_UOBW.js";import"./select-Z1HqJ5aU.js";import"./assertThisInitialized-4q6YPdh3.js";import"./select.input-zP5tW20f.js";import"./input-iDZqV-2m.js";import"./input-group-R8LoqKRn.js";import"./input-group-addon-BHVsW9mL.js";import"./number-input-d7hXQldd.js";import"./index-IQMsp8Ab.js";import"./index-cCpkwrS5.js";import"./check-box-BX5dfQFk.js";import"./slider-_5NQKbM-.js";import"./index-ugi_ZH6T.js";import"./popover-uAo1e4-D.js";import"./flex-ZVra76N-.js";const Le={title:"Basic/Table/Row",component:c,args:{table:{...g}}},b=n=>o.jsx(c,{...n}),i=b.bind({});i.args={table:W};const p=b.bind({});p.args={table:B};const t=b.bind({});t.args={table:{...g,striped:!1}};t.parameters={docs:{description:{story:"`striped: false` removes tinted background on alternative rows."}}};const m=()=>{const[n,e]=R.useState(null),a=r=>e(n===r?null:r);return o.jsx(c,{table:{...g,striped:!1,rows:g.rows.map((r,d)=>({...r,onRowClick:()=>a(d),expandedContent:{content:n===d?o.jsx("div",{children:"Example expanded content"}):null}}))}})},w=()=>{const n={draggable:!0,headers:[{cells:[{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"}]}],rows:[{noDrag:!0,cells:[{value:"Undraggable"},{value:100},{value:361},{value:"Vietnam"}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"}]}]},e=(s,u,l)=>{const x=[...s];return s[l].noDrag?s:(x.splice(l,0,x.splice(u,1)[0]),x)},[a,r]=R.useState(n.rows),d=s=>{const{to:u,from:l}=s;e(a,l,u),r(e(a,l,u))};return o.jsx(c,{table:{...n,rows:a},onListReorder:d})},v=()=>{const[n,e]=R.useState("Hover any row!"),a=[1,2,3,4,5].map(r=>({cells:[{value:`Row ${r}`},{value:`${r**2}`}],onRowMouseEnter:()=>e(`Hovering row ${r}`),onRowMouseLeave:()=>e("Not hovering any row...")}));return o.jsxs(o.Fragment,{children:[o.jsx(V,{children:n}),o.jsx(c,{table:{fixedWidth:"100%",headers:[{cells:[{value:"Description"},{value:"Value"}],onRowMouseEnter:()=>e("Hovering header row"),onRowMouseLeave:()=>e("Not hovering any row...")}],rows:a}})]})};var y,D,E;i.parameters={...i.parameters,docs:{...(y=i.parameters)==null?void 0:y.docs,source:{originalSource:`args => {
2
2
  return <Table
3
3
  // eslint-disable-next-line react/jsx-props-no-spreading
4
4
  {...args} />;
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-FsUICBgo.js";import{r as x}from"./index-RfLt4OUa.js";import{I as j}from"./common-types-U65vzrrz.js";import{T as g}from"./top-bar-uqbsCAt-.js";import{S as w}from"./side-bar-GJ2tcZYY.js";import{H as t}from"./heading-cUVItwKq.js";import{B as L}from"./button-IoNblLER.js";import{D as v}from"./drawer-TM-jK3WR.js";import{L as d}from"./list-5kbN7yr8.js";import{F as l}from"./field-kOZPBHf6.js";import{I as a}from"./input-iDZqV-2m.js";import{C as m}from"./check-box-BX5dfQFk.js";import{P as f}from"./page-9-f6BzS0.js";import{R as o,C as i}from"./row-vFUhHoz5.js";import{A as u}from"./accordion-6_27SROY.js";import{S as s}from"./spacer-Yji9g2AW.js";import{T as F}from"./tabs-fcLbHC1n.js";import"./index-VW3EWkuE.js";import"./icon-y1a2N5SZ.js";import"./inheritsLoose-Y9jOMJLd.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./actions-SGexXf58.js";import"./lodash-Bmg8FrMx.js";import"./tooltip-ZHdi6rl-.js";import"./index-miLrID2P.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./index-ugi_ZH6T.js";import"./help-icon-nI9A506M.js";import"./spinner-R8Il4aRe.js";import"./index.es-JXn3JM7k.js";import"./extends-dGVwEr9R.js";import"./redux-F5dueAP3.js";import"./objectSpread2-93s0nBry.js";import"./memoize-one.esm-hqe5SRxC.js";import"./card-0r8RRVk-.js";import"./list-heading-XbqCJOHh.js";import"./loader-TGOJBZQG.js";import"./label-RpB4JmHX.js";import"./styled-components.browser.esm-qIipjd6c.js";import"./select.input-zP5tW20f.js";const C=[{label:"Import",value:"import",right:!0},{label:"Settings",value:"settings",right:!0}],S=()=>e.jsx("div",{style:{background:"#AAD3DF",borderLeft:"1px solid #8AB3BF",display:"flex",alignItems:"center",justifyContent:"center",color:"white",height:"100%"},children:"MAP"}),xe={title:"Layout/Layout Examples",parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}}},n=()=>{const[r,b]=x.useState(!0);return e.jsxs(e.Fragment,{children:[e.jsx(g,{}),e.jsx(w,{options:{title:"",sections:[]},width:"250px"}),e.jsx(f,{padding:!1,scroll:!1,children:e.jsxs(o,{spacing:0,flex:!0,children:[e.jsxs(v,{button:e.jsx(L,{onClick:()=>b(!r),round:!0,icon:j.CHEVRON_LEFT}),open:r,width:300,closedWidth:"var(--size-sidebar)",children:[e.jsx(d,{drawer:!0,narrow:!r,list:{name:"Sites",items:[{id:1,name:"Main Site",type:"Heading"},{id:2,name:"Site name here",active:!0,label:{value:1,color:"#69779b"}},{id:3,name:"Locations",type:"Heading"},{id:4,name:"Ipsum",label:{value:2,color:"#69779b"}},{id:5,name:"Dolor",label:{value:3,color:"#69779b"}}]}}),e.jsx(d,{drawer:!0,narrow:!r,list:{name:"Wells",items:[{id:1,name:"Main Wellbore",type:"Heading"},{id:2,name:"Lorem",label:{value:1,color:"#77699b"}}]}}),e.jsx(d,{drawer:!0,narrow:!r,list:{name:"Targets",items:[{id:1,name:"Lorem",label:{value:1,color:"#9b6977"}}]}})]}),e.jsxs(i,{borderLeft:!0,flexbox:!0,children:[e.jsx(s,{}),e.jsx(F,{padding:!0,margin:!1,options:C}),e.jsxs(o,{spacing:0,flex:!0,children:[e.jsxs(i,{scroll:!0,padding:!0,width:550,children:[e.jsx(t,{top:!0,children:"Site name here"}),e.jsx(l,{label:"Name",children:e.jsx(a,{value:"Site name here",width:"200px"})}),e.jsxs(u,{heading:e.jsx(t,{children:"Coordinate Reference System"}),managed:!0,children:[e.jsx(l,{label:"Label",labelLeft:!0,labelWidth:"50px",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{label:"Label",labelLeft:!0,labelWidth:"50px",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{label:"Label",labelLeft:!0,labelWidth:"50px",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{children:e.jsx(m,{label:"Dolor"})})]}),e.jsx(s,{}),e.jsx(t,{marginBottom:"var(--padding)",children:"Location"}),e.jsxs(o,{children:[e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})}),e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})}),e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})}),e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})})]}),e.jsx(s,{}),e.jsx(t,{marginBottom:"var(--padding)",children:"Model"}),e.jsxs(o,{children:[e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})}),e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})})]}),e.jsxs(u,{heading:e.jsx(t,{children:"Settings"}),managed:!0,children:[e.jsx(l,{children:e.jsx(m,{label:"Dolor"})}),e.jsxs(o,{children:[e.jsxs(i,{children:[e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})]}),e.jsxs(i,{children:[e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})]})]})]})]}),e.jsx(i,{children:e.jsx(S,{})})]})]})]})})]})};var p,c,h;n.parameters={...n.parameters,docs:{...(p=n.parameters)==null?void 0:p.docs,source:{originalSource:`() => {
1
+ import{j as e}from"./jsx-runtime-FsUICBgo.js";import{r as x}from"./index-RfLt4OUa.js";import{I as j}from"./common-types-U65vzrrz.js";import{T as g}from"./top-bar-0fDAFWyC.js";import{S as w}from"./side-bar-GJ2tcZYY.js";import{H as t}from"./heading-cUVItwKq.js";import{B as L}from"./button-IoNblLER.js";import{D as v}from"./drawer-TM-jK3WR.js";import{L as d}from"./list-FJ7byNrg.js";import{F as l}from"./field-kOZPBHf6.js";import{I as a}from"./input-iDZqV-2m.js";import{C as m}from"./check-box-BX5dfQFk.js";import{P as f}from"./page-9-f6BzS0.js";import{R as o,C as i}from"./row-vFUhHoz5.js";import{A as u}from"./accordion-6_27SROY.js";import{S as s}from"./spacer-Yji9g2AW.js";import{T as F}from"./tabs-fcLbHC1n.js";import"./index-VW3EWkuE.js";import"./icon-y1a2N5SZ.js";import"./inheritsLoose-Y9jOMJLd.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./actions-SGexXf58.js";import"./lodash-Bmg8FrMx.js";import"./tooltip-ZHdi6rl-.js";import"./index-miLrID2P.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./index-ugi_ZH6T.js";import"./help-icon-nI9A506M.js";import"./spinner-R8Il4aRe.js";import"./index.es-JXn3JM7k.js";import"./extends-dGVwEr9R.js";import"./redux-F5dueAP3.js";import"./objectSpread2-93s0nBry.js";import"./memoize-one.esm-hqe5SRxC.js";import"./card-0r8RRVk-.js";import"./list-heading-XbqCJOHh.js";import"./loader-TGOJBZQG.js";import"./label-RpB4JmHX.js";import"./styled-components.browser.esm-qIipjd6c.js";import"./select.input-zP5tW20f.js";const C=[{label:"Import",value:"import",right:!0},{label:"Settings",value:"settings",right:!0}],S=()=>e.jsx("div",{style:{background:"#AAD3DF",borderLeft:"1px solid #8AB3BF",display:"flex",alignItems:"center",justifyContent:"center",color:"white",height:"100%"},children:"MAP"}),xe={title:"Layout/Layout Examples",parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}}},n=()=>{const[r,b]=x.useState(!0);return e.jsxs(e.Fragment,{children:[e.jsx(g,{}),e.jsx(w,{options:{title:"",sections:[]},width:"250px"}),e.jsx(f,{padding:!1,scroll:!1,children:e.jsxs(o,{spacing:0,flex:!0,children:[e.jsxs(v,{button:e.jsx(L,{onClick:()=>b(!r),round:!0,icon:j.CHEVRON_LEFT}),open:r,width:300,closedWidth:"var(--size-sidebar)",children:[e.jsx(d,{drawer:!0,narrow:!r,list:{name:"Sites",items:[{id:1,name:"Main Site",type:"Heading"},{id:2,name:"Site name here",active:!0,label:{value:1,color:"#69779b"}},{id:3,name:"Locations",type:"Heading"},{id:4,name:"Ipsum",label:{value:2,color:"#69779b"}},{id:5,name:"Dolor",label:{value:3,color:"#69779b"}}]}}),e.jsx(d,{drawer:!0,narrow:!r,list:{name:"Wells",items:[{id:1,name:"Main Wellbore",type:"Heading"},{id:2,name:"Lorem",label:{value:1,color:"#77699b"}}]}}),e.jsx(d,{drawer:!0,narrow:!r,list:{name:"Targets",items:[{id:1,name:"Lorem",label:{value:1,color:"#9b6977"}}]}})]}),e.jsxs(i,{borderLeft:!0,flexbox:!0,children:[e.jsx(s,{}),e.jsx(F,{padding:!0,margin:!1,options:C}),e.jsxs(o,{spacing:0,flex:!0,children:[e.jsxs(i,{scroll:!0,padding:!0,width:550,children:[e.jsx(t,{top:!0,children:"Site name here"}),e.jsx(l,{label:"Name",children:e.jsx(a,{value:"Site name here",width:"200px"})}),e.jsxs(u,{heading:e.jsx(t,{children:"Coordinate Reference System"}),managed:!0,children:[e.jsx(l,{label:"Label",labelLeft:!0,labelWidth:"50px",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{label:"Label",labelLeft:!0,labelWidth:"50px",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{label:"Label",labelLeft:!0,labelWidth:"50px",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{children:e.jsx(m,{label:"Dolor"})})]}),e.jsx(s,{}),e.jsx(t,{marginBottom:"var(--padding)",children:"Location"}),e.jsxs(o,{children:[e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})}),e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})}),e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})}),e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})})]}),e.jsx(s,{}),e.jsx(t,{marginBottom:"var(--padding)",children:"Model"}),e.jsxs(o,{children:[e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})}),e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})})]}),e.jsxs(u,{heading:e.jsx(t,{children:"Settings"}),managed:!0,children:[e.jsx(l,{children:e.jsx(m,{label:"Dolor"})}),e.jsxs(o,{children:[e.jsxs(i,{children:[e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})]}),e.jsxs(i,{children:[e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})]})]})]})]}),e.jsx(i,{children:e.jsx(S,{})})]})]})]})})]})};var p,c,h;n.parameters={...n.parameters,docs:{...(p=n.parameters)==null?void 0:p.docs,source:{originalSource:`() => {
2
2
  const [open, setOpen] = useState(true);
3
3
  return <>
4
4
  <TopBar />
@@ -1 +1 @@
1
- import{S as l,c as n,s as d}from"./index-kEA1EH0x.js";import"./iframe-IZZyfjHT.js";import"../sb-preview/runtime.js";import"./index-RfLt4OUa.js";import"./index-miLrID2P.js";import"./extends-dGVwEr9R.js";import"./assertThisInitialized-4q6YPdh3.js";import"./inheritsLoose-Y9jOMJLd.js";import"./index-gM75B7fB.js";export{l as SyntaxHighlighter,n as createCopyToClipboardFunction,d as default};
1
+ import{S as l,c as n,s as d}from"./index-J809fMmq.js";import"./iframe-fZf8RXY8.js";import"../sb-preview/runtime.js";import"./index-RfLt4OUa.js";import"./index-miLrID2P.js";import"./extends-dGVwEr9R.js";import"./assertThisInitialized-4q6YPdh3.js";import"./inheritsLoose-Y9jOMJLd.js";import"./index-gM75B7fB.js";export{l as SyntaxHighlighter,n as createCopyToClipboardFunction,d as default};
@@ -1 +1 @@
1
- import{j as n}from"./jsx-runtime-FsUICBgo.js";import{r as q}from"./index-RfLt4OUa.js";import{c as N}from"./index-VW3EWkuE.js";import{I as He,D as Pe,C as Le,P as De}from"./index.es-JXn3JM7k.js";import{l as Fe}from"./lodash-Bmg8FrMx.js";import{A as ge}from"./actions-SGexXf58.js";import{H as $e}from"./heading-cUVItwKq.js";import{P as Oe}from"./pagination-Eaj_UOBW.js";import{A as b,I as $}from"./common-types-U65vzrrz.js";import{I as Be}from"./input-iDZqV-2m.js";import{N as Me}from"./number-input-d7hXQldd.js";import{S as Ge}from"./select-Z1HqJ5aU.js";import{D as Ue}from"./disabled-context-urNQThQz.js";import{i as O}from"./types-5uVBABF4.js";import{T as fe}from"./tooltip-ZHdi6rl-.js";import{C as Xe}from"./check-box-BX5dfQFk.js";import{S as ze}from"./slider-_5NQKbM-.js";import{I as B}from"./icon-y1a2N5SZ.js";import{P as Je}from"./popover-uAo1e4-D.js";import{H as Ee}from"./help-icon-nI9A506M.js";import{T as ne}from"./text-6KQ6ntOV.js";const Ke="_inputInTable_y9car_1",Ye="_inputHover_y9car_13",Qe="_inputFocus_y9car_18",Ze="_inputError_y9car_25",en="_inputWarning_y9car_26",nn="_inputDisabled_y9car_61",tn="_hideScrollbars_y9car_67",rn="_wrapper_y9car_85",an="_bordered_y9car_93",ln="_scroll_y9car_98",on="_table_y9car_108",sn="_striped_y9car_188",H={inputInTable:Ke,inputHover:Ye,inputFocus:Qe,inputError:Ze,inputWarning:en,inputDisabled:nn,hideScrollbars:tn,wrapper:rn,bordered:an,scroll:ln,table:on,striped:sn},dn="_title_zn5s7_1",cn={title:dn},U=({name:e=null,actions:t=null,actionsRight:r=!1,testId:l})=>{const a=e!==null,o=t!==null;if(!a&&!o)return null;const s=()=>{if(!o)return null;const u=n.jsx(ge,{actions:t});return r?u:n.jsx("div",{children:u})};return n.jsxs("div",{className:cn.title,children:[a?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",te={footer:un,section:pn},X=({colSpan:e,pagination:t,actions:r,content:l})=>{const a=r&&r.length,o=l!=null,s=()=>{var d,p;if(t){const{rowCount:c,rowsPerPage:g}=t,y=Number((p=(d=g==null?void 0:g.options)==null?void 0:d[0])==null?void 0:p.value);return c>y}return!1};return a||o||s()?n.jsxs("div",{className:te.footer,children:[o?n.jsx("div",{className:te.section,children:n.jsx("div",{children:l})}):null,a||s()?n.jsxs("div",{className:te.section,children:[s()?n.jsx(Oe,{pagination:t}):n.jsx("div",{}),a&&n.jsx("div",{children:n.jsx(ge,{actions:r})})]}):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((r,l)=>{const a=l.cells.map(o=>o.colSpan?o.colSpan:1).reduce((o,s)=>o+s,0);return r.concat(a)},[]));return isNaN(t)?0:t},mn=(e,t)=>{const r=[Se(t),Se(e)];return Math.max(...r)},Ve=e=>e.reduce((t,r)=>r.actions&&r.actions.length>0?1:t,0),_n=(e,t)=>Ve(t)>0||Ve(e)>0,z=({table:e,children:t})=>{const{rows:r,infiniteScroll:l}=e,a=Math.ceil(window.innerHeight/30),[o,s]=l?q.useState(a):[r.length,null],[u,d]=l?q.useState(o<r.length):[!1,null],p=()=>{if(o>=r.length&&d){d(!1);return}s&&s(o+a)};return n.jsx("div",{id:"scrollWrapper",className:H.scroll,children:l?n.jsx(He,{dataLength:Math.min(r.length,o+a),next:p,hasMore:u,scrollableTarget:"scrollWrapper",style:{overflow:"initial"},loader:null,children:t({visibleRows:o})}):t({visibleRows:o})})};try{z.displayName="TableScrollWrapper",z.__docgenInfo={description:"",displayName:"TableScrollWrapper",props:{table:{defaultValue:null,description:"",name:"table",required:!0,type:{name:"ITableProps"}}}}}catch{}const yn="_clickableRow_11d5t_1",gn="_hoverableRow_11d5t_4",fn="_rowActive_11d5t_4",hn="_expandableRow_11d5t_8",bn="_flush_11d5t_8",xn="_dragIconCell_11d5t_28",Cn="_dragIcon_11d5t_28",R={clickableRow:yn,hoverableRow:gn,rowActive:fn,expandableRow:hn,flush:bn,dragIconCell:xn,dragIcon:Cn},J=({colSpan:e,children:t,flush:r})=>n.jsx("tr",{children:n.jsx("td",{colSpan:e,className:N(R.expandableRow,r?R.flush:""),children:t})});try{J.displayName="ExpandedContentRow",J.__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 qe=(e,t={leftAligned:"",rightAligned:"",centerAligned:""},r=!1)=>{if(!e)return null;const{bodyAlignment:l,headerAlignment:a,isHeader:o}=e;switch(o&&a?a:l){case b.LEFT:return r?b.LEFT:t.leftAligned;case b.RIGHT:return r?b.RIGHT:t.rightAligned;case b.CENTER:return r?b.CENTER:t.centerAligned;default:return r?b.LEFT:t.leftAligned}},In=(e,t=!1,r=0)=>{if(!e||e.length===0)return[];const l=e.every(o=>Array.isArray(o)),a=e.every(o=>typeof o=="string");return l&&t?e[r]||[]:a?e:(console.warn("getHeaderAlignment: alignments array contains a mix of strings and arrays, returning an empty array."),[])},jn="_inputInTable_u3xdj_1",Nn="_inputHover_u3xdj_13",wn="_inputFocus_u3xdj_18",vn="_inputError_u3xdj_25",An="_inputWarning_u3xdj_26",Rn="_inputDisabled_u3xdj_61",Sn="_hideScrollbars_u3xdj_67",Vn="_cell_u3xdj_77",qn="_disabledLink_u3xdj_87",Tn="_inputWrapper_u3xdj_91",En="_breakWord_u3xdj_106",kn="_inputCell_u3xdj_109",Wn="_sliderCell_u3xdj_112",Hn="_staticCell_u3xdj_116",Pn="_staticCellContent_u3xdj_119",Ln="_error_u3xdj_131",Dn="_warning_u3xdj_132",Fn="_unit_u3xdj_141",$n="_sortingCell_u3xdj_144",On="_sortingCellIcon_u3xdj_155",Bn="_icon_u3xdj_166",Mn="_checkBoxCell_u3xdj_170",Gn="_iconCellWrapper_u3xdj_174",Un="_actionsCell_u3xdj_178",Xn="_rightAligned_u3xdj_186",zn="_centerAligned_u3xdj_192",Jn="_leftAligned_u3xdj_198",Kn="_popover_u3xdj_201",Yn="_disabledPointerEvents_u3xdj_204",i={inputInTable:jn,inputHover:Nn,inputFocus:wn,inputError:vn,inputWarning:An,inputDisabled:Rn,hideScrollbars:Sn,cell:Vn,disabledLink:qn,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:zn,leftAligned:Jn,popover:Kn,disabledPointerEvents:Yn},K=({cell:e,columnAlignment:t,testId:r,type:l})=>n.jsx(Be,{name:e.name,value:e.value,onChange:a=>{var o;return(o=e.onChange)==null?void 0:o.call(e,a)},onPaste:a=>{var o;return(o=e.onPaste)==null?void 0:o.call(e,a)},placeholder:e.placeholder,error:e.error,warning:e.warning,disabled:e.disabled,isInTable:!0,maxTooltipWidth:e.maxTooltipWidth,right:t===b.RIGHT,testId:r,tabIndex:e.disabled?-1:0,tooltip:e.tooltip,type:l});try{K.displayName="InputCell",K.__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"}},type:{defaultValue:null,description:"",name:"type",required:!1,type:{name:"enum",value:[{value:'"text"'},{value:'"date"'}]}}}}}catch{}const re=({cell:e,testId:t})=>n.jsx(Me,{name:e.name,value:e.value,onChange:r=>{var l;return(l=e.onChange)==null?void 0:l.call(e,r)},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:r})=>n.jsx(Ge,{name:e.name,borderRadius:0,options:e.options,onChange:l=>{var a;return(a=e.onChange)==null?void 0:a.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:r,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:r})=>n.jsx("div",{className:i.inputWrapper,children:e.type==="Input"?n.jsx(K,{cell:e,columnAlignment:t,testId:r}):e.type==="NumberInput"?n.jsx(re,{cell:e,testId:r}):e.type==="DateInput"?n.jsx(K,{cell:e,testId:r,type:"date"}):e.type==="Select"?n.jsx(ae,{cell:e,columnAlignment:t,testId:r}):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 r=q.useContext(Ue),{error:l,warning:a,tooltip:o,maxTooltipWidth:s}=e,u=d=>O(d);return n.jsx("div",{className:i.inputWrapper,children:n.jsx(fe,{error:!!l,warning:!!a,text:o||l||a,enabled:u(o)||u(l)||u(a)||!1,maxWidth:s,placement:"bottom-center",children:n.jsx("div",{className:N(i.staticCellContent,l?i.error:a?i.warning:""),children:n.jsx("a",{className:N((e.disabled||r)&&i.disabledLink),onClick:e.disabled||r?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:r=>e.onChange(r),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(ze,{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:r}=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:r})})})};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(ge,{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:r,sortPriority:l}=e;return t?n.jsxs("span",{className:i.sortingCellIcon,children:[r==="down"?n.jsx(ne,{link:!0,children:n.jsx(B,{icon:$.SORT_ASCENDING})}):r==="up"?n.jsx(ne,{link:!0,children:n.jsx(B,{icon:$.SORT_DESCENDING})}):n.jsx(ne,{faint:!0,children:n.jsx(B,{icon:$.SORT_DESCENDING})}),l&&r?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 Y=({cell:e,isHeader:t,testId:r})=>{const{error:l,warning:a,tooltip:o,maxTooltipWidth:s,hasSort:u,onSort:d,type:p}=e,c=n.jsxs("div",{className:N(i.staticCellContent,p==="Unit"?i.unit:"",l?i.error:a?i.warning:""),onClick:u?g=>d&&d(g):()=>{},"data-testid":r,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:!!a,text:o||l||a,enabled:o&&O(o)||l&&O(l)||a&&O(a)||!1,maxWidth:s,display:"block",placement:"bottom-center",children:c})})};try{Y.displayName="StaticCell",Y.__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:r,fullWidth:l,closeOnOutsideClick:a,disabled:o}=e;return n.jsx(Je,{content:r,fullWidth:l,closeOnOutsideClick:a,disabled:o,children:n.jsx("div",{className:i.popover,children:n.jsx(Y,{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 ye=({cell:e,isHeader:t,columnAlignment:r,testId:l})=>{if(!e)return null;switch(e.type){case"Input":case"NumberInput":case"DateInput":case"Select":return n.jsx(le,{cell:e,columnAlignment:r,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(Y,{cell:e,isHeader:t,testId:l})}};try{ye.displayName="CellWrapper",ye.__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 Q=({cell:e,isHeader:t,columnHeaderAlignment:r,columnAlignment:l=b.LEFT,width:a,snapshot:o,testId:s})=>{if(!e)return null;const{style:u,colSpan:d,rowSpan:p,width:c}=e,g=q.useRef(null),y={bodyAlignment:l,headerAlignment:r,isHeader:t},P=qe(y,i),x=qe(y,i,!0),L=e.type===S.INPUT||e.type===S.NUMBER_INPUT||e.type===S.SELECT||e.type===S.POPOVER?i.inputCell:e.type===S.SLIDER?i.sliderCell:e.type===S.CHECKBOX?i.checkBoxCell:e.type===S.ACTIONS?i.actionsCell:i.staticCell,w=N(i.cell,L,e.hasSort?i.sortingCell:null,P,e.breakWord?i.breakWord:""),T=c??a??((o==null?void 0:o.isDragging)&&g.current&&g.current.offsetWidth)??void 0,C={width:T,minWidth:T,...u},v=t?"th":"td";return n.jsx(v,{ref:g,className:w,style:C,colSpan:d,rowSpan:p,children:n.jsx(ye,{cell:e,columnAlignment:x??b.RIGHT,isHeader:t,testId:s})})};try{Q.displayName="Cell",Q.__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:r=!1,columnCount:l,colSpan:a,columnHeaderAlignments:o=[],columnAlignment:s=[],hasRowActions:u,draggableTable:d=!1,snapshot:p=null,provided:c=null,width:g,columnWidths:y,testId:P})=>{const x=q.useRef(null),L=In(o,r,t),{onRowClick:w,onRowFocus:T,onRowMouseEnter:C,onRowMouseLeave:v,expandedContent:I,active:Z}=e,E=e.cells.map((h,A)=>{const he=`${r?0:1}_${t}_${A}`;return n.jsx(Q,{cell:h,isHeader:r,columnAlignment:s[A],columnHeaderAlignment:L[A],width:y?y[A]:void 0,snapshot:p,testId:h.testId},he)}),V=u&&n.jsx(Q,{cell:{type:S.ACTIONS,actions:e.actions},isHeader:r},l),k=(h,A)=>({minWidth:h&&`${g}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,...A}),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 r?n.jsxs(n.Fragment,{children:[n.jsxs("tr",{ref:x,onClick:w,onMouseEnter:C,onMouseLeave:v,onFocus:T,className:N(w?R.clickableRow:null,C?R.hoverableRow:null),children:[d?n.jsx("th",{}):null,E,V]},t),I&&I.content?n.jsx(J,{colSpan:a,flush:I.flush===!0,children:I.content},`${t}_expanded_content`):null]}):n.jsxs(n.Fragment,{children:[n.jsxs("tr",{onClick:w,onMouseEnter:C,onMouseLeave:v,onFocus:T,className:N(w&&!w.noStyle?R.clickableRow:null,C&&!C.noStyle?R.hoverableRow:null,Z?R.rowActive:null),ref:(c==null?void 0:c.innerRef)||null,...(c==null?void 0:c.draggableProps)||null,style:p&&c?k(p.isDragging,c.draggableProps.style):null,children:[d?W():null,E,V]},t),I&&I.content?n.jsx(J,{colSpan:a,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,je,Ne,we,ve,Ae,Re;const{onListReorder:t=()=>{},table:r}=e,{columnWidths:l,footer:a,name:o,rows:s=[],actions:u,actionsRight:d,columnHeaderAlignments:p,columnAlignment:c,striped:g=!0,testId:y,draggable:P,defaultEmptyRow:x=null,onAddRow:L=null,bordered:w=!0,maxHeight:T,fixedWidth:C}=r,v=q.useRef(null),[I,Z]=q.useState({width:0,height:0});q.useEffect(()=>{v.current&&Z({width:v.current.offsetWidth,height:v.current.offsetHeight})},[]);const E=Fe.get(e,"table.headers",[]),V=mn(s,E),k=_n(s,E),W=V+(k?1:0),h=a?((je=(Ie=a==null?void 0:a.pagination)==null?void 0:Ie.rowsPerPage)==null?void 0:je.value)===0||Number((Ne=a==null?void 0:a.pagination)==null?void 0:Ne.selectedPage)>=Number((we=a==null?void 0:a.pagination)==null?void 0:we.rowCount)/Number((Ae=(ve=a==null?void 0:a.pagination)==null?void 0:ve.rowsPerPage)==null?void 0:Ae.value):!0,A=((Re=x==null?void 0:x.cells)==null?void 0:Re.length)&&L&&h,ke={cells:A?x.cells.map((m,j)=>(m==null?void 0:m.type)==="Input"?{...m,onChange:_=>{var M;const f=(M=_==null?void 0:_.target)==null?void 0:M.value,D={...x,cells:x.cells.map((G,We)=>({...G,value:We===j?f:G==null?void 0:G.value}))};L({newRow:D})}}:{...m,disabled:!0}):null,testId:y?`${y}-last-empty-row`:void 0},ee=A?s.concat(ke):s,be={...r,rows:ee},xe=N(H.wrapper,w?H.bordered:""),Ce={maxHeight:T,width:C,display:C==="auto"?"inline-flex":"flex"};return P?n.jsxs("div",{ref:v,className:xe,style:Ce,children:[n.jsx(U,{actions:u,actionsRight:d,name:o,testId:y&&`${y}-title`}),n.jsx(Pe,{onDragEnd:m=>{var f,D;const j=(f=m==null?void 0:m.source)==null?void 0:f.index,_=(D=m==null?void 0:m.destination)==null?void 0:D.index;typeof j=="number"&&typeof _=="number"&&t({from:j,to:_})},children:n.jsx(Le,{droppableId:"droppable",children:m=>n.jsx(z,{table:be,children:({visibleRows:j})=>n.jsxs("table",{className:N(H.table,g?H.striped:""),"data-testid":y,ref:m.innerRef,children:[n.jsx("thead",{children:E.map((_,f)=>n.jsx(F,{rowIndex:f,isHeader:!0,row:_,columnCount:V,columnWidths:l,colSpan:W,hasRowActions:k,columnAlignment:c,columnHeaderAlignments:p,draggableTable:P},`0_${f}`))}),n.jsxs("tbody",{children:[ee.slice(0,j).map((_,f)=>n.jsx(De,{draggableId:f+"",index:f,isDragDisabled:_.noDrag,children:(D,M)=>n.jsx(F,{rowIndex:f,row:_,columnCount:V,columnWidths:l,colSpan:W,hasRowActions:k,columnAlignment:c,provided:D,snapshot:M,draggableTable:P,width:I.width},`1_${f}`)},`index_${f}`)),m.placeholder]})]})})})}),a&&n.jsx(X,{pagination:a.pagination,actions:a.actions,content:a.content})]}):n.jsxs("div",{className:xe,style:Ce,children:[n.jsx(U,{actions:u,actionsRight:d,name:o,testId:y&&`${y}-title`}),n.jsx(z,{table:be,children:({visibleRows:m})=>n.jsxs("table",{className:N(H.table,g?H.striped:""),"data-testid":y,children:[n.jsx("thead",{children:E.map((j,_)=>n.jsx(F,{rowIndex:_,isHeader:!0,row:j,columnCount:V,columnWidths:l,colSpan:W,hasRowActions:k,columnAlignment:c,columnHeaderAlignments:p},`0_${_}`))}),n.jsx("tbody",{children:ee.slice(0,m).map((j,_)=>n.jsx(F,{rowIndex:_,row:j,columnCount:V,columnWidths:l,colSpan:W,hasRowActions:k,columnAlignment:c},`1_${_}`))})]})}),a&&n.jsx(X,{colSpan:W,pagination:a.pagination,actions:a.actions,content:a.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-FsUICBgo.js";import{r as T}from"./index-RfLt4OUa.js";import{c as N}from"./index-VW3EWkuE.js";import{I as He,D as Pe,C as Le,P as De}from"./index.es-JXn3JM7k.js";import{l as Fe}from"./lodash-Bmg8FrMx.js";import{A as ge}from"./actions-SGexXf58.js";import{H as $e}from"./heading-cUVItwKq.js";import{P as Oe}from"./pagination-Eaj_UOBW.js";import{A as b,I as $}from"./common-types-U65vzrrz.js";import{I as Be}from"./input-iDZqV-2m.js";import{N as Me}from"./number-input-d7hXQldd.js";import{S as Ue}from"./select-Z1HqJ5aU.js";import{D as Ge}from"./disabled-context-urNQThQz.js";import{i as O}from"./types-5uVBABF4.js";import{T as fe}from"./tooltip-ZHdi6rl-.js";import{C as Xe}from"./check-box-BX5dfQFk.js";import{S as ze}from"./slider-_5NQKbM-.js";import{I as B}from"./icon-y1a2N5SZ.js";import{P as Je}from"./popover-uAo1e4-D.js";import{H as Ee}from"./help-icon-nI9A506M.js";import{T as ne}from"./text-6KQ6ntOV.js";const Ke="_inputInTable_y9car_1",Ye="_inputHover_y9car_13",Qe="_inputFocus_y9car_18",Ze="_inputError_y9car_25",en="_inputWarning_y9car_26",nn="_inputDisabled_y9car_61",tn="_hideScrollbars_y9car_67",rn="_wrapper_y9car_85",an="_bordered_y9car_93",ln="_scroll_y9car_98",on="_table_y9car_108",sn="_striped_y9car_188",H={inputInTable:Ke,inputHover:Ye,inputFocus:Qe,inputError:Ze,inputWarning:en,inputDisabled:nn,hideScrollbars:tn,wrapper:rn,bordered:an,scroll:ln,table:on,striped:sn},dn="_title_zn5s7_1",cn={title:dn},G=({name:e=null,actions:t=null,actionsRight:r=!1,testId:l})=>{const a=e!==null,o=t!==null;if(!a&&!o)return null;const s=()=>{if(!o)return null;const u=n.jsx(ge,{actions:t});return r?u:n.jsx("div",{children:u})};return n.jsxs("div",{className:cn.title,children:[a?n.jsx($e,{children:n.jsx("span",{"data-testid":l,children:e})}):null,s()]})};try{G.displayName="Title",G.__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",te={footer:un,section:pn},X=({colSpan:e,pagination:t,actions:r,content:l})=>{const a=r&&r.length,o=l!=null,s=()=>{var d,p;if(t){const{rowCount:c,rowsPerPage:g}=t,y=Number((p=(d=g==null?void 0:g.options)==null?void 0:d[0])==null?void 0:p.value);return c>y}return!1};return a||o||s()?n.jsxs("div",{className:te.footer,children:[o?n.jsx("div",{className:te.section,children:n.jsx("div",{children:l})}):null,a||s()?n.jsxs("div",{className:te.section,children:[s()?n.jsx(Oe,{pagination:t}):n.jsx("div",{}),a&&n.jsx("div",{children:n.jsx(ge,{actions:r})})]}):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((r,l)=>{const a=l.cells.map(o=>o.colSpan?o.colSpan:1).reduce((o,s)=>o+s,0);return r.concat(a)},[]));return isNaN(t)?0:t},mn=(e,t)=>{const r=[Se(t),Se(e)];return Math.max(...r)},Ve=e=>e.reduce((t,r)=>r.actions&&r.actions.length>0?1:t,0),_n=(e,t)=>Ve(t)>0||Ve(e)>0,z=({table:e,children:t})=>{const{rows:r,infiniteScroll:l}=e,a=Math.ceil(window.innerHeight/30),[o,s]=l?T.useState(a):[r.length,null],[u,d]=l?T.useState(o<r.length):[!1,null],p=()=>{if(o>=r.length&&d){d(!1);return}s&&s(o+a)};return n.jsx("div",{id:"scrollWrapper",className:H.scroll,children:l?n.jsx(He,{dataLength:Math.min(r.length,o+a),next:p,hasMore:u,scrollableTarget:"scrollWrapper",style:{overflow:"initial"},loader:null,children:t({visibleRows:o})}):t({visibleRows:o})})};try{z.displayName="TableScrollWrapper",z.__docgenInfo={description:"",displayName:"TableScrollWrapper",props:{table:{defaultValue:null,description:"",name:"table",required:!0,type:{name:"ITableProps"}}}}}catch{}const yn="_clickableRow_11d5t_1",gn="_hoverableRow_11d5t_4",fn="_rowActive_11d5t_4",hn="_expandableRow_11d5t_8",bn="_flush_11d5t_8",xn="_dragIconCell_11d5t_28",Cn="_dragIcon_11d5t_28",R={clickableRow:yn,hoverableRow:gn,rowActive:fn,expandableRow:hn,flush:bn,dragIconCell:xn,dragIcon:Cn},J=({colSpan:e,children:t,flush:r})=>n.jsx("tr",{children:n.jsx("td",{colSpan:e,className:N(R.expandableRow,r?R.flush:""),children:t})});try{J.displayName="ExpandedContentRow",J.__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:""},r=!1)=>{if(!e)return null;const{bodyAlignment:l,headerAlignment:a,isHeader:o}=e;switch(o&&a?a:l){case b.LEFT:return r?b.LEFT:t.leftAligned;case b.RIGHT:return r?b.RIGHT:t.rightAligned;case b.CENTER:return r?b.CENTER:t.centerAligned;default:return r?b.LEFT:t.leftAligned}},In=(e,t=!1,r=0)=>{if(!e||e.length===0)return[];const l=e.every(o=>Array.isArray(o)),a=e.every(o=>typeof o=="string");return l&&t?e[r]||[]:a?e:(console.warn("getHeaderAlignment: alignments array contains a mix of strings and arrays, returning an empty array."),[])},jn="_inputInTable_u3xdj_1",Nn="_inputHover_u3xdj_13",wn="_inputFocus_u3xdj_18",An="_inputError_u3xdj_25",vn="_inputWarning_u3xdj_26",Rn="_inputDisabled_u3xdj_61",Sn="_hideScrollbars_u3xdj_67",Vn="_cell_u3xdj_77",Tn="_disabledLink_u3xdj_87",qn="_inputWrapper_u3xdj_91",En="_breakWord_u3xdj_106",kn="_inputCell_u3xdj_109",Wn="_sliderCell_u3xdj_112",Hn="_staticCell_u3xdj_116",Pn="_staticCellContent_u3xdj_119",Ln="_error_u3xdj_131",Dn="_warning_u3xdj_132",Fn="_unit_u3xdj_141",$n="_sortingCell_u3xdj_144",On="_sortingCellIcon_u3xdj_155",Bn="_icon_u3xdj_166",Mn="_checkBoxCell_u3xdj_170",Un="_iconCellWrapper_u3xdj_174",Gn="_actionsCell_u3xdj_178",Xn="_rightAligned_u3xdj_186",zn="_centerAligned_u3xdj_192",Jn="_leftAligned_u3xdj_198",Kn="_popover_u3xdj_201",Yn="_disabledPointerEvents_u3xdj_204",i={inputInTable:jn,inputHover:Nn,inputFocus:wn,inputError:An,inputWarning:vn,inputDisabled:Rn,hideScrollbars:Sn,cell:Vn,disabledLink:Tn,inputWrapper:qn,breakWord:En,inputCell:kn,sliderCell:Wn,staticCell:Hn,staticCellContent:Pn,error:Ln,warning:Dn,unit:Fn,sortingCell:$n,sortingCellIcon:On,icon:Bn,checkBoxCell:Mn,iconCellWrapper:Un,actionsCell:Gn,rightAligned:Xn,centerAligned:zn,leftAligned:Jn,popover:Kn,disabledPointerEvents:Yn},K=({cell:e,columnAlignment:t,testId:r,type:l})=>n.jsx(Be,{name:e.name,value:e.value,onChange:a=>{var o;return(o=e.onChange)==null?void 0:o.call(e,a)},onPaste:a=>{var o;return(o=e.onPaste)==null?void 0:o.call(e,a)},placeholder:e.placeholder,error:e.error,warning:e.warning,disabled:e.disabled,isInTable:!0,maxTooltipWidth:e.maxTooltipWidth,right:t===b.RIGHT,testId:r,tabIndex:e.disabled?-1:0,tooltip:e.tooltip,type:l});try{K.displayName="InputCell",K.__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"}},type:{defaultValue:null,description:"",name:"type",required:!1,type:{name:"enum",value:[{value:'"text"'},{value:'"date"'}]}}}}}catch{}const re=({cell:e,testId:t})=>n.jsx(Me,{name:e.name,value:e.value,onChange:r=>{var l;return(l=e.onChange)==null?void 0:l.call(e,r)},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:r})=>n.jsx(Ue,{name:e.name,borderRadius:0,options:e.options,onChange:l=>{var a;return(a=e.onChange)==null?void 0:a.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:r,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:r})=>n.jsx("div",{className:i.inputWrapper,children:e.type==="Input"?n.jsx(K,{cell:e,columnAlignment:t,testId:r}):e.type==="NumberInput"?n.jsx(re,{cell:e,testId:r}):e.type==="DateInput"?n.jsx(K,{cell:e,testId:r,type:"date"}):e.type==="Select"?n.jsx(ae,{cell:e,columnAlignment:t,testId:r}):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 r=T.useContext(Ge),{error:l,warning:a,tooltip:o,maxTooltipWidth:s}=e,u=d=>O(d);return n.jsx("div",{className:i.inputWrapper,children:n.jsx(fe,{error:!!l,warning:!!a,text:o||l||a,enabled:u(o)||u(l)||u(a)||!1,maxWidth:s,placement:"bottom-center",children:n.jsx("div",{className:N(i.staticCellContent,l?i.error:a?i.warning:""),children:n.jsx("a",{className:N((e.disabled||r)&&i.disabledLink),onClick:e.disabled||r?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:r=>e.onChange(r),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(ze,{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:r}=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:r})})})};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(ge,{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:r,sortPriority:l}=e;return t?n.jsxs("span",{className:i.sortingCellIcon,children:[r==="down"?n.jsx(ne,{link:!0,children:n.jsx(B,{icon:$.SORT_ASCENDING})}):r==="up"?n.jsx(ne,{link:!0,children:n.jsx(B,{icon:$.SORT_DESCENDING})}):n.jsx(ne,{faint:!0,children:n.jsx(B,{icon:$.SORT_DESCENDING})}),l&&r?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 Y=({cell:e,isHeader:t,testId:r})=>{const{error:l,warning:a,tooltip:o,maxTooltipWidth:s,hasSort:u,onSort:d,type:p}=e,c=n.jsxs("div",{className:N(i.staticCellContent,p==="Unit"?i.unit:"",l?i.error:a?i.warning:""),onClick:u?g=>d&&d(g):()=>{},"data-testid":r,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:!!a,text:o||l||a,enabled:o&&O(o)||l&&O(l)||a&&O(a)||!1,maxWidth:s,display:"block",placement:"bottom-center",children:c})})};try{Y.displayName="StaticCell",Y.__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:r,fullWidth:l,closeOnOutsideClick:a,disabled:o}=e;return n.jsx(Je,{content:r,fullWidth:l,closeOnOutsideClick:a,disabled:o,children:n.jsx("div",{className:i.popover,children:n.jsx(Y,{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 ye=({cell:e,isHeader:t,columnAlignment:r,testId:l})=>{if(!e)return null;switch(e.type){case"Input":case"NumberInput":case"DateInput":case"Select":return n.jsx(le,{cell:e,columnAlignment:r,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(Y,{cell:e,isHeader:t,testId:l})}};try{ye.displayName="CellWrapper",ye.__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.AUTO_UNIT="AutoUnit",e))(S||{});const Q=({cell:e,isHeader:t,columnHeaderAlignment:r,columnAlignment:l=b.LEFT,width:a,snapshot:o,testId:s})=>{if(!e)return null;const{style:u,colSpan:d,rowSpan:p,width:c}=e,g=T.useRef(null),y={bodyAlignment:l,headerAlignment:r,isHeader:t},P=Te(y,i),x=Te(y,i,!0),L=e.type===S.INPUT||e.type===S.NUMBER_INPUT||e.type===S.SELECT||e.type===S.POPOVER?i.inputCell:e.type===S.SLIDER?i.sliderCell:e.type===S.CHECKBOX?i.checkBoxCell:e.type===S.ACTIONS?i.actionsCell:i.staticCell,w=N(i.cell,L,e.hasSort?i.sortingCell:null,P,e.breakWord?i.breakWord:""),q=c??a??((o==null?void 0:o.isDragging)&&g.current&&g.current.offsetWidth)??void 0,C={width:q,minWidth:q,...u},A=t?"th":"td";return n.jsx(A,{ref:g,className:w,style:C,colSpan:d,rowSpan:p,children:n.jsx(ye,{cell:e,columnAlignment:x??b.RIGHT,isHeader:t,testId:s})})};try{Q.displayName="Cell",Q.__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:r=!1,columnCount:l,colSpan:a,columnHeaderAlignments:o=[],columnAlignment:s=[],hasRowActions:u,draggableTable:d=!1,snapshot:p=null,provided:c=null,width:g,columnWidths:y,testId:P})=>{const x=T.useRef(null),L=In(o,r,t),{onRowClick:w,onRowFocus:q,onRowMouseEnter:C,onRowMouseLeave:A,expandedContent:I,active:Z}=e,E=e.cells.map((h,v)=>{const he=`${r?0:1}_${t}_${v}`;return n.jsx(Q,{cell:h,isHeader:r,columnAlignment:s[v],columnHeaderAlignment:L[v],width:y?y[v]:void 0,snapshot:p,testId:h.testId},he)}),V=u&&n.jsx(Q,{cell:{type:S.ACTIONS,actions:e.actions},isHeader:r},l),k=(h,v)=>({minWidth:h&&`${g}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 r?n.jsxs(n.Fragment,{children:[n.jsxs("tr",{ref:x,onClick:w,onMouseEnter:C,onMouseLeave:A,onFocus:q,className:N(w?R.clickableRow:null,C?R.hoverableRow:null),children:[d?n.jsx("th",{}):null,E,V]},t),I&&I.content?n.jsx(J,{colSpan:a,flush:I.flush===!0,children:I.content},`${t}_expanded_content`):null]}):n.jsxs(n.Fragment,{children:[n.jsxs("tr",{onClick:w,onMouseEnter:C,onMouseLeave:A,onFocus:q,className:N(w&&!w.noStyle?R.clickableRow:null,C&&!C.noStyle?R.hoverableRow:null,Z?R.rowActive:null),ref:(c==null?void 0:c.innerRef)||null,...(c==null?void 0:c.draggableProps)||null,style:p&&c?k(p.isDragging,c.draggableProps.style):null,children:[d?W():null,E,V]},t),I&&I.content?n.jsx(J,{colSpan:a,flush:I.flush===!0,children:I.content},`${t}_expanded_content`):null]})};try{F.displayName="Row",F.__docgenInfo={description:"",displayName:"Row",props:{row:{defaultValue:null,description:"",name:"row",required:!0,type:{name:"TRowType"}},rowIndex:{defaultValue:null,description:"",name:"rowIndex",required:!0,type:{name:"number"}},isHeader:{defaultValue:{value:"false"},description:"",name:"isHeader",required:!1,type:{name:"boolean"}},columnCount:{defaultValue:null,description:"",name:"columnCount",required:!0,type:{name:"number"}},colSpan:{defaultValue:null,description:"",name:"colSpan",required:!0,type:{name:"number"}},columnHeaderAlignments:{defaultValue:{value:"[]"},description:"",name:"columnHeaderAlignments",required:!1,type:{name:"string[] | string[][]"}},columnAlignment:{defaultValue:{value:"[]"},description:"",name:"columnAlignment",required:!1,type:{name:"string[]"}},hasRowActions:{defaultValue:null,description:"",name:"hasRowActions",required:!0,type:{name:"boolean"}},draggableTable:{defaultValue:{value:"false"},description:"",name:"draggableTable",required:!1,type:{name:"boolean"}},snapshot:{defaultValue:{value:"null"},description:"",name:"snapshot",required:!1,type:{name:"any"}},provided:{defaultValue:{value:"null"},description:"",name:"provided",required:!1,type:{name:"any"}},width:{defaultValue:null,description:"",name:"width",required:!1,type:{name:"TStringOrNumber"}},columnWidths:{defaultValue:null,description:"",name:"columnWidths",required:!1,type:{name:"string[]"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const qe=e=>{var Ie,je,Ne,we,Ae,ve,Re;const{onListReorder:t=()=>{},table:r}=e,{columnWidths:l,footer:a,name:o,rows:s=[],actions:u,actionsRight:d,columnHeaderAlignments:p,columnAlignment:c,striped:g=!0,testId:y,draggable:P,defaultEmptyRow:x=null,onAddRow:L=null,bordered:w=!0,maxHeight:q,fixedWidth:C}=r,A=T.useRef(null),[I,Z]=T.useState({width:0,height:0});T.useEffect(()=>{A.current&&Z({width:A.current.offsetWidth,height:A.current.offsetHeight})},[]);const E=Fe.get(e,"table.headers",[]),V=mn(s,E),k=_n(s,E),W=V+(k?1:0),h=a?((je=(Ie=a==null?void 0:a.pagination)==null?void 0:Ie.rowsPerPage)==null?void 0:je.value)===0||Number((Ne=a==null?void 0:a.pagination)==null?void 0:Ne.selectedPage)>=Number((we=a==null?void 0:a.pagination)==null?void 0:we.rowCount)/Number((ve=(Ae=a==null?void 0:a.pagination)==null?void 0:Ae.rowsPerPage)==null?void 0:ve.value):!0,v=((Re=x==null?void 0:x.cells)==null?void 0:Re.length)&&L&&h,ke={cells:v?x.cells.map((m,j)=>(m==null?void 0:m.type)==="Input"?{...m,onChange:_=>{var M;const f=(M=_==null?void 0:_.target)==null?void 0:M.value,D={...x,cells:x.cells.map((U,We)=>({...U,value:We===j?f:U==null?void 0:U.value}))};L({newRow:D})}}:{...m,disabled:!0}):null,testId:y?`${y}-last-empty-row`:void 0},ee=v?s.concat(ke):s,be={...r,rows:ee},xe=N(H.wrapper,w?H.bordered:""),Ce={maxHeight:q,width:C,display:C==="auto"?"inline-flex":"flex"};return P?n.jsxs("div",{ref:A,className:xe,style:Ce,children:[n.jsx(G,{actions:u,actionsRight:d,name:o,testId:y&&`${y}-title`}),n.jsx(Pe,{onDragEnd:m=>{var f,D;const j=(f=m==null?void 0:m.source)==null?void 0:f.index,_=(D=m==null?void 0:m.destination)==null?void 0:D.index;typeof j=="number"&&typeof _=="number"&&t({from:j,to:_})},children:n.jsx(Le,{droppableId:"droppable",children:m=>n.jsx(z,{table:be,children:({visibleRows:j})=>n.jsxs("table",{className:N(H.table,g?H.striped:""),"data-testid":y,ref:m.innerRef,children:[n.jsx("thead",{children:E.map((_,f)=>n.jsx(F,{rowIndex:f,isHeader:!0,row:_,columnCount:V,columnWidths:l,colSpan:W,hasRowActions:k,columnAlignment:c,columnHeaderAlignments:p,draggableTable:P},`0_${f}`))}),n.jsxs("tbody",{children:[ee.slice(0,j).map((_,f)=>n.jsx(De,{draggableId:f+"",index:f,isDragDisabled:_.noDrag,children:(D,M)=>n.jsx(F,{rowIndex:f,row:_,columnCount:V,columnWidths:l,colSpan:W,hasRowActions:k,columnAlignment:c,provided:D,snapshot:M,draggableTable:P,width:I.width},`1_${f}`)},`index_${f}`)),m.placeholder]})]})})})}),a&&n.jsx(X,{pagination:a.pagination,actions:a.actions,content:a.content})]}):n.jsxs("div",{className:xe,style:Ce,children:[n.jsx(G,{actions:u,actionsRight:d,name:o,testId:y&&`${y}-title`}),n.jsx(z,{table:be,children:({visibleRows:m})=>n.jsxs("table",{className:N(H.table,g?H.striped:""),"data-testid":y,children:[n.jsx("thead",{children:E.map((j,_)=>n.jsx(F,{rowIndex:_,isHeader:!0,row:j,columnCount:V,columnWidths:l,colSpan:W,hasRowActions:k,columnAlignment:c,columnHeaderAlignments:p},`0_${_}`))}),n.jsx("tbody",{children:ee.slice(0,m).map((j,_)=>n.jsx(F,{rowIndex:_,row:j,columnCount:V,columnWidths:l,colSpan:W,hasRowActions:k,columnAlignment:c},`1_${_}`))})]})}),a&&n.jsx(X,{colSpan:W,pagination:a.pagination,actions:a.actions,content:a.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{S as C,qe as T};
@@ -1,4 +1,4 @@
1
- import{j as n}from"./jsx-runtime-FsUICBgo.js";import{r as S}from"./index-RfLt4OUa.js";import{f as K}from"./immer.esm-bD7SSJ7T.js";import{l as oe}from"./lodash-Bmg8FrMx.js";import{G as se}from"./grid-u1mZpaML.js";import{T as V}from"./text-6KQ6ntOV.js";import{T as A}from"./table-_jWgMFOi.js";import{C as sn}from"./card-0r8RRVk-.js";import{I as ae}from"./input-iDZqV-2m.js";import{F as re}from"./field-kOZPBHf6.js";import{H as ln}from"./heading-cUVItwKq.js";import{t as ne,a as on,b as cn,c as dn,d as un,e as pn,f as gn,g as mn}from"./table.stories-data-2BZDVr2X.js";import"./styled-components.browser.esm-qIipjd6c.js";import"./tslib.es6-OIsz3r9a.js";import"./index-VW3EWkuE.js";import"./index.es-JXn3JM7k.js";import"./inheritsLoose-Y9jOMJLd.js";import"./extends-dGVwEr9R.js";import"./redux-F5dueAP3.js";import"./objectSpread2-93s0nBry.js";import"./index-miLrID2P.js";import"./memoize-one.esm-hqe5SRxC.js";import"./icon-y1a2N5SZ.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./actions-SGexXf58.js";import"./common-types-U65vzrrz.js";import"./button-IoNblLER.js";import"./spinner-R8Il4aRe.js";import"./tooltip-ZHdi6rl-.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./pagination-Eaj_UOBW.js";import"./select-Z1HqJ5aU.js";import"./assertThisInitialized-4q6YPdh3.js";import"./select.input-zP5tW20f.js";import"./input-group-R8LoqKRn.js";import"./input-group-addon-BHVsW9mL.js";import"./number-input-d7hXQldd.js";import"./index-IQMsp8Ab.js";import"./index-cCpkwrS5.js";import"./check-box-BX5dfQFk.js";import"./help-icon-nI9A506M.js";import"./slider-_5NQKbM-.js";import"./index-ugi_ZH6T.js";import"./popover-uAo1e4-D.js";import"./label-RpB4JmHX.js";import"./flex-ZVra76N-.js";const dt={title:"Basic/Table",component:A,args:{table:{...ne}}},I=g=>n.jsx(A,{...g}),B=I.bind({}),_=I.bind({});_.args={table:{...ne,fixedWidth:"400px"}};const M=I.bind({});M.args={table:{...ne,fixedWidth:"auto"}};const O=I.bind({});O.args={table:on};O.parameters={docs:{description:{story:"Use sparingly when certain columns cannot be below a certain width. Unless the Table is auto width, set one column to `auto` to use remaining space."}}};const L=I.bind({});L.args={table:cn};const U=I.bind({});U.args={table:dn};U.parameters={docs:{description:{story:"This is only required when you need to override `columnAlignment` in header cells (i.e. they have different alignment)"}}};const Q=I.bind({});Q.args={table:un};const E=I.bind({});E.args={table:pn};E.decorators=[g=>n.jsx("div",{style:{position:"absolute",inset:0,padding:"var(--padding)"},children:n.jsx(g,{})})];const N=I.bind({});N.args={table:gn};N.parameters={docs:{description:{story:"If a `maxHeight` is set, the table should only fill that height if it needs to."}}};const G=I.bind({});G.args={table:mn};const q=()=>n.jsx(sn,{heading:n.jsx(ln,{children:"Card heading"}),padding:!1,children:n.jsx(A,{table:{...ne,bordered:!1}})});q.parameters={docs:{source:{type:"dynamic"}}};const z=()=>{const g=["Section","Width","Height"];let u=["","m","m"],r=[...Array(175).keys()].map((s,t)=>[t,t*2,t*2]);const T=(s,t,i)=>s==="m"&&t==="ft"?i*3.28084:s==="ft"&&t==="m"?i/3.28084:i,o=(s,t,i,p)=>{r[t][i]=s.target.value,p()},C=s=>{r=r.concat([["","",""]]),s()},k=(s,t)=>{r=r.filter((i,p)=>p!==s),t()},d=(s,t,i)=>{const p=u[t],y=s.target.value;u=u.map((R,h)=>h===t?y:R),r=r.map(R=>R.map((h,b)=>b===t?T(p,y,h):h)),i()},m=()=>{const s=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[t,i]=S.useState(10),[p,y]=S.useState(1),[R,h]=S.useState(!1),b=()=>{h(!R)},W=()=>{const e=Math.ceil(r.length/t);y(e)},D=(p-1)*t,a=t===0?r.length-1:D+t,c={headers:[{cells:g.map(e=>({value:e})),actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{C(b),W()}}]},{cells:[{},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:u[1],type:"Select",native:!0,onChange:e=>d(e,1,b)},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:u[2],type:"Select",native:!0,onChange:e=>d(e,2,b)}]}],rows:r.slice(D,a).map((e,l)=>{const P=D+l;return{cells:[...Array(3).keys()].map((f,w)=>({value:e[w],type:"Input",onChange:x=>o(x,P,w,b)})),actions:[{label:"Delete",icon:"minus",onClick:()=>k(P,b)}]}}),footer:{pagination:{rowCount:r.length,selectedPage:p,rowsPerPage:{onChange:e=>{const{value:l}=e.target;i(Number(l))},options:s,value:t},onSelectPage:e=>y(e),small:!0}}};return n.jsx(A,{table:c})};return n.jsx(m,{})},J=()=>{const g=["Section","Width","Height"];let u=[...Array(175).keys()].map((T,o)=>({Section:o,Width:o*2,Height:o*2}));const r=()=>{const T=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[o,C]=S.useState(10),[k,d]=S.useState(1),[m,s]=S.useState({}),[t,i]=S.useState({});S.useEffect(()=>{d(1)},[m,t]);const p=(k-1)*o,y=o===0?u.length-1:p+o,R=(e,l,P)=>e.filter(f=>Object.keys(l).every(w=>l[w]===""?!0:f[w].toString().includes(l[w]))).sort((f,w)=>Object.entries(P).map(([x,F])=>{switch(F){case"up":return f[x]-w[x];case"down":return w[x]-f[x];default:return 0}}).reduce((x,F)=>x||F,0)),h=(e,l,P,f,w)=>{const x=e.map(v=>{const j=Object.keys(f).includes(v)?f[v]:"",H=`${v[0].toUpperCase()}${v.slice(1)}`;return{key:v,value:H,hasSort:!0,sort:j,onSort:()=>{const $=j===""?"up":j==="up"?"down":"";w({...f,[v]:$})}}}),F=e.map(v=>{const j=Object.keys(l).includes(v)?l[v]:"";return{key:v,value:j,type:"Input",placeholder:"Filter",onChange:H=>P({...l,[v]:H.target.value})}});return{dataSortCells:x,dataFilterCells:F}},{dataSortCells:b,dataFilterCells:W}=h(g,m,s,t,i),D=R(u,m,t),a=[...D.slice(p,y).map(e=>({cells:Object.entries(e).map(([P,f])=>({key:P,value:f,type:"Input",disabled:!0}))}))],c={headers:[{cells:b},{cells:W}],rows:a,footer:{pagination:{rowCount:D.length,selectedPage:k,rowsPerPage:{onChange:e=>{const{value:l}=e.target;C(Number(l))},options:T,value:o},onSelectPage:e=>d(e),small:!0}}};return n.jsx(A,{table:c})};return n.jsx(r,{})},X=()=>{const g={tea:3.6,coffee:3.2,orange:4.1},u=[{label:"Tea",value:"tea"},{label:"Coffee",value:"coffee"},{label:"Orange juice",value:"orange"}],r={cells:[{type:"Select",options:u,value:{value:"tea"}},{type:"Input"},{type:"Static"}]},T=[...Array(15).keys()].map((a,c)=>({cells:[{type:"Select",options:u,value:{value:"tea"}},{type:"Input",value:c+1},{type:"Static"}]})),[o,C]=S.useState(T),k=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[d,m]=S.useState(10),[s,t]=S.useState(1),i=(s-1)*d,p=d===0?o.length-1:i+d,y=({newRow:a}={})=>{const c=K(o,e=>{e.push(a??r)});C(c)},R=({rowIndex:a})=>{const c=K(o,e=>{delete e[a]}).filter(e=>e);C(c)},h=({rowIndex:a,value:c})=>{const e=K(o,l=>{l[a].cells[0].value.value=c});C(e)},b=({rowIndex:a,value:c})=>{const e=K(o,l=>{l[a].cells[1].value=c});C(e)},W=({value:a})=>{const c=Number(a);return!oe.isNaN(c)&&oe.isInteger(c)&&c>0},D=o.slice(i,p).map((a,c)=>{const e=i+c;return o.length-1,{...a,cells:a==null?void 0:a.cells.map((l,P)=>{var v,j,H,$,le;const f=(H=(j=(v=a==null?void 0:a.cells)==null?void 0:v[0])==null?void 0:j.value)==null?void 0:H.value,w=Number((le=($=a==null?void 0:a.cells)==null?void 0:$[1])==null?void 0:le.value),x=g==null?void 0:g[f],F=x&&W({value:w})?(x*w).toFixed(2):null;if(P===0)return{...l,onChange:te=>h({rowIndex:e,value:te.target.value})};if(P===1)return{...l,onChange:te=>b({rowIndex:e,value:te.target.value}),error:W({value:l.value})?null:"Must be valid whole number"};if(P===2)return{...l,value:F}}),actions:[{label:"Delete",icon:"minus",onClick:()=>R({rowIndex:e})}]}});return n.jsx(A,{table:{defaultEmptyRow:r,onAddRow:y,columnAlignment:["left","right","right"],headers:[{cells:[{value:"Drink"},{value:"Quantity"},{value:"Total Price (£)"}],actions:[{primary:!0,icon:"plus",label:"Add",onClick:()=>y()}]}],rows:D,footer:{pagination:{rowCount:o.length,selectedPage:s,rowsPerPage:{onChange:a=>{const{value:c}=a.target;m(Number(c))},options:k,value:d},onSelectPage:a=>t(a),small:!0}}}})},Y=()=>{const g=["Section","Width","Height"];let u=Array.from(Array(10),(d,m)=>[m,m*2,m*2]);const[r,T]=S.useState({pastedValues:"",rowIndex:0,cellIndex:0}),o=(d,m,s,t)=>{u[m][s]=Number(d.target.value),t()},C=(d,m,s,t)=>{var p;let i=((p=d==null?void 0:d.clipboardData)==null?void 0:p.getData("text"))??"";return T({rowIndex:m,cellIndex:s,pastedValues:i}),t(),{pastedData:r}},k=()=>{const[d,m]=S.useState(!1),s=()=>{m(!d)},t={headers:[{cells:g.map(i=>({value:i}))}],rows:u.map((i,p)=>{const y=p;return{cells:[...Array(3).keys()].map((R,h)=>({value:i[h],type:"Input",onChange:b=>o(b,y,h,s),onPaste:b=>C(b,y,h,s)}))}})};return n.jsxs(n.Fragment,{children:[n.jsx(A,{table:t}),n.jsx(re,{label:"Pasted Data",children:n.jsx(ae,{value:r.pastedValues})}),n.jsx(re,{label:"At Row",children:n.jsx(ae,{value:r.rowIndex})}),n.jsx(re,{label:"At Cell Index",children:n.jsx(ae,{value:r.cellIndex})})]})};return n.jsx(k,{})},Z=()=>{const g={fixedWidth:"auto",name:"Table title",actions:[{icon:"download",tooltip:"Download"}],columnAlignment:[...Array(10)].map((u,r)=>"right"),headers:[{cells:[...Array(10)].map((u,r)=>({value:"Heading"}))},{cells:[...Array(10)].map((u,r)=>({options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],type:"Select",searchable:!1,value:{label:"m",value:"m"},autoLayerWidth:!0}))}],rows:[...Array(10)].map((u,r)=>({cells:[...Array(10)].map((T,o)=>({value:123.45})),actions:[{icon:"help",tooltip:n.jsxs(se,{children:[n.jsx(V,{bold:!0,children:"Title goes here lorem ipsum"}),n.jsx(V,{children:"Label: 123.45m"}),n.jsx(V,{children:"Another label: 123.45m"}),n.jsx(V,{children:"Label: 123.45m"})]})}]}))};return n.jsx(A,{table:g})},ee=()=>{const g={fixedWidth:"auto",name:"Table title",actions:[{icon:"download",tooltip:"Download"}],headers:[{cells:[{value:"Label"},{value:"Value",colSpan:2}]}],rows:[{cells:[{value:"Country",style:{fontWeight:"bold"},width:"120px"},{value:"Norway",colSpan:2}],actions:[{icon:"help",tooltip:n.jsxs(se,{children:[n.jsx(V,{bold:!0,children:"Title goes here"}),n.jsx(V,{children:"Details go here"})]})}]},{cells:[{value:"Depth",style:{fontWeight:"bold"}},{value:123,width:"80px"},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:{label:"m",value:"m"},type:"Select",width:"80px"}],actions:[{icon:"help",tooltip:n.jsxs(se,{children:[n.jsx(V,{bold:!0,children:"Title goes here"}),n.jsx(V,{children:"Details go here"})]})}]}]};return n.jsx(A,{table:g})};var ie,ce,de;B.parameters={...B.parameters,docs:{...(ie=B.parameters)==null?void 0:ie.docs,source:{originalSource:`args => {
1
+ import{j as n}from"./jsx-runtime-FsUICBgo.js";import{r as S}from"./index-RfLt4OUa.js";import{f as K}from"./immer.esm-bD7SSJ7T.js";import{l as oe}from"./lodash-Bmg8FrMx.js";import{G as se}from"./grid-u1mZpaML.js";import{T as V}from"./text-6KQ6ntOV.js";import{T as A}from"./table-fX2iU96a.js";import{C as sn}from"./card-0r8RRVk-.js";import{I as ae}from"./input-iDZqV-2m.js";import{F as re}from"./field-kOZPBHf6.js";import{H as ln}from"./heading-cUVItwKq.js";import{t as ne,a as on,b as cn,c as dn,d as un,e as pn,f as gn,g as mn}from"./table.stories-data-2BZDVr2X.js";import"./styled-components.browser.esm-qIipjd6c.js";import"./tslib.es6-OIsz3r9a.js";import"./index-VW3EWkuE.js";import"./index.es-JXn3JM7k.js";import"./inheritsLoose-Y9jOMJLd.js";import"./extends-dGVwEr9R.js";import"./redux-F5dueAP3.js";import"./objectSpread2-93s0nBry.js";import"./index-miLrID2P.js";import"./memoize-one.esm-hqe5SRxC.js";import"./icon-y1a2N5SZ.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./actions-SGexXf58.js";import"./common-types-U65vzrrz.js";import"./button-IoNblLER.js";import"./spinner-R8Il4aRe.js";import"./tooltip-ZHdi6rl-.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./pagination-Eaj_UOBW.js";import"./select-Z1HqJ5aU.js";import"./assertThisInitialized-4q6YPdh3.js";import"./select.input-zP5tW20f.js";import"./input-group-R8LoqKRn.js";import"./input-group-addon-BHVsW9mL.js";import"./number-input-d7hXQldd.js";import"./index-IQMsp8Ab.js";import"./index-cCpkwrS5.js";import"./check-box-BX5dfQFk.js";import"./help-icon-nI9A506M.js";import"./slider-_5NQKbM-.js";import"./index-ugi_ZH6T.js";import"./popover-uAo1e4-D.js";import"./label-RpB4JmHX.js";import"./flex-ZVra76N-.js";const dt={title:"Basic/Table",component:A,args:{table:{...ne}}},I=g=>n.jsx(A,{...g}),B=I.bind({}),_=I.bind({});_.args={table:{...ne,fixedWidth:"400px"}};const M=I.bind({});M.args={table:{...ne,fixedWidth:"auto"}};const O=I.bind({});O.args={table:on};O.parameters={docs:{description:{story:"Use sparingly when certain columns cannot be below a certain width. Unless the Table is auto width, set one column to `auto` to use remaining space."}}};const L=I.bind({});L.args={table:cn};const U=I.bind({});U.args={table:dn};U.parameters={docs:{description:{story:"This is only required when you need to override `columnAlignment` in header cells (i.e. they have different alignment)"}}};const Q=I.bind({});Q.args={table:un};const E=I.bind({});E.args={table:pn};E.decorators=[g=>n.jsx("div",{style:{position:"absolute",inset:0,padding:"var(--padding)"},children:n.jsx(g,{})})];const N=I.bind({});N.args={table:gn};N.parameters={docs:{description:{story:"If a `maxHeight` is set, the table should only fill that height if it needs to."}}};const G=I.bind({});G.args={table:mn};const q=()=>n.jsx(sn,{heading:n.jsx(ln,{children:"Card heading"}),padding:!1,children:n.jsx(A,{table:{...ne,bordered:!1}})});q.parameters={docs:{source:{type:"dynamic"}}};const z=()=>{const g=["Section","Width","Height"];let u=["","m","m"],r=[...Array(175).keys()].map((s,t)=>[t,t*2,t*2]);const T=(s,t,i)=>s==="m"&&t==="ft"?i*3.28084:s==="ft"&&t==="m"?i/3.28084:i,o=(s,t,i,p)=>{r[t][i]=s.target.value,p()},C=s=>{r=r.concat([["","",""]]),s()},k=(s,t)=>{r=r.filter((i,p)=>p!==s),t()},d=(s,t,i)=>{const p=u[t],y=s.target.value;u=u.map((R,h)=>h===t?y:R),r=r.map(R=>R.map((h,b)=>b===t?T(p,y,h):h)),i()},m=()=>{const s=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[t,i]=S.useState(10),[p,y]=S.useState(1),[R,h]=S.useState(!1),b=()=>{h(!R)},W=()=>{const e=Math.ceil(r.length/t);y(e)},D=(p-1)*t,a=t===0?r.length-1:D+t,c={headers:[{cells:g.map(e=>({value:e})),actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{C(b),W()}}]},{cells:[{},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:u[1],type:"Select",native:!0,onChange:e=>d(e,1,b)},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:u[2],type:"Select",native:!0,onChange:e=>d(e,2,b)}]}],rows:r.slice(D,a).map((e,l)=>{const P=D+l;return{cells:[...Array(3).keys()].map((f,w)=>({value:e[w],type:"Input",onChange:x=>o(x,P,w,b)})),actions:[{label:"Delete",icon:"minus",onClick:()=>k(P,b)}]}}),footer:{pagination:{rowCount:r.length,selectedPage:p,rowsPerPage:{onChange:e=>{const{value:l}=e.target;i(Number(l))},options:s,value:t},onSelectPage:e=>y(e),small:!0}}};return n.jsx(A,{table:c})};return n.jsx(m,{})},J=()=>{const g=["Section","Width","Height"];let u=[...Array(175).keys()].map((T,o)=>({Section:o,Width:o*2,Height:o*2}));const r=()=>{const T=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[o,C]=S.useState(10),[k,d]=S.useState(1),[m,s]=S.useState({}),[t,i]=S.useState({});S.useEffect(()=>{d(1)},[m,t]);const p=(k-1)*o,y=o===0?u.length-1:p+o,R=(e,l,P)=>e.filter(f=>Object.keys(l).every(w=>l[w]===""?!0:f[w].toString().includes(l[w]))).sort((f,w)=>Object.entries(P).map(([x,F])=>{switch(F){case"up":return f[x]-w[x];case"down":return w[x]-f[x];default:return 0}}).reduce((x,F)=>x||F,0)),h=(e,l,P,f,w)=>{const x=e.map(v=>{const j=Object.keys(f).includes(v)?f[v]:"",H=`${v[0].toUpperCase()}${v.slice(1)}`;return{key:v,value:H,hasSort:!0,sort:j,onSort:()=>{const $=j===""?"up":j==="up"?"down":"";w({...f,[v]:$})}}}),F=e.map(v=>{const j=Object.keys(l).includes(v)?l[v]:"";return{key:v,value:j,type:"Input",placeholder:"Filter",onChange:H=>P({...l,[v]:H.target.value})}});return{dataSortCells:x,dataFilterCells:F}},{dataSortCells:b,dataFilterCells:W}=h(g,m,s,t,i),D=R(u,m,t),a=[...D.slice(p,y).map(e=>({cells:Object.entries(e).map(([P,f])=>({key:P,value:f,type:"Input",disabled:!0}))}))],c={headers:[{cells:b},{cells:W}],rows:a,footer:{pagination:{rowCount:D.length,selectedPage:k,rowsPerPage:{onChange:e=>{const{value:l}=e.target;C(Number(l))},options:T,value:o},onSelectPage:e=>d(e),small:!0}}};return n.jsx(A,{table:c})};return n.jsx(r,{})},X=()=>{const g={tea:3.6,coffee:3.2,orange:4.1},u=[{label:"Tea",value:"tea"},{label:"Coffee",value:"coffee"},{label:"Orange juice",value:"orange"}],r={cells:[{type:"Select",options:u,value:{value:"tea"}},{type:"Input"},{type:"Static"}]},T=[...Array(15).keys()].map((a,c)=>({cells:[{type:"Select",options:u,value:{value:"tea"}},{type:"Input",value:c+1},{type:"Static"}]})),[o,C]=S.useState(T),k=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[d,m]=S.useState(10),[s,t]=S.useState(1),i=(s-1)*d,p=d===0?o.length-1:i+d,y=({newRow:a}={})=>{const c=K(o,e=>{e.push(a??r)});C(c)},R=({rowIndex:a})=>{const c=K(o,e=>{delete e[a]}).filter(e=>e);C(c)},h=({rowIndex:a,value:c})=>{const e=K(o,l=>{l[a].cells[0].value.value=c});C(e)},b=({rowIndex:a,value:c})=>{const e=K(o,l=>{l[a].cells[1].value=c});C(e)},W=({value:a})=>{const c=Number(a);return!oe.isNaN(c)&&oe.isInteger(c)&&c>0},D=o.slice(i,p).map((a,c)=>{const e=i+c;return o.length-1,{...a,cells:a==null?void 0:a.cells.map((l,P)=>{var v,j,H,$,le;const f=(H=(j=(v=a==null?void 0:a.cells)==null?void 0:v[0])==null?void 0:j.value)==null?void 0:H.value,w=Number((le=($=a==null?void 0:a.cells)==null?void 0:$[1])==null?void 0:le.value),x=g==null?void 0:g[f],F=x&&W({value:w})?(x*w).toFixed(2):null;if(P===0)return{...l,onChange:te=>h({rowIndex:e,value:te.target.value})};if(P===1)return{...l,onChange:te=>b({rowIndex:e,value:te.target.value}),error:W({value:l.value})?null:"Must be valid whole number"};if(P===2)return{...l,value:F}}),actions:[{label:"Delete",icon:"minus",onClick:()=>R({rowIndex:e})}]}});return n.jsx(A,{table:{defaultEmptyRow:r,onAddRow:y,columnAlignment:["left","right","right"],headers:[{cells:[{value:"Drink"},{value:"Quantity"},{value:"Total Price (£)"}],actions:[{primary:!0,icon:"plus",label:"Add",onClick:()=>y()}]}],rows:D,footer:{pagination:{rowCount:o.length,selectedPage:s,rowsPerPage:{onChange:a=>{const{value:c}=a.target;m(Number(c))},options:k,value:d},onSelectPage:a=>t(a),small:!0}}}})},Y=()=>{const g=["Section","Width","Height"];let u=Array.from(Array(10),(d,m)=>[m,m*2,m*2]);const[r,T]=S.useState({pastedValues:"",rowIndex:0,cellIndex:0}),o=(d,m,s,t)=>{u[m][s]=Number(d.target.value),t()},C=(d,m,s,t)=>{var p;let i=((p=d==null?void 0:d.clipboardData)==null?void 0:p.getData("text"))??"";return T({rowIndex:m,cellIndex:s,pastedValues:i}),t(),{pastedData:r}},k=()=>{const[d,m]=S.useState(!1),s=()=>{m(!d)},t={headers:[{cells:g.map(i=>({value:i}))}],rows:u.map((i,p)=>{const y=p;return{cells:[...Array(3).keys()].map((R,h)=>({value:i[h],type:"Input",onChange:b=>o(b,y,h,s),onPaste:b=>C(b,y,h,s)}))}})};return n.jsxs(n.Fragment,{children:[n.jsx(A,{table:t}),n.jsx(re,{label:"Pasted Data",children:n.jsx(ae,{value:r.pastedValues})}),n.jsx(re,{label:"At Row",children:n.jsx(ae,{value:r.rowIndex})}),n.jsx(re,{label:"At Cell Index",children:n.jsx(ae,{value:r.cellIndex})})]})};return n.jsx(k,{})},Z=()=>{const g={fixedWidth:"auto",name:"Table title",actions:[{icon:"download",tooltip:"Download"}],columnAlignment:[...Array(10)].map((u,r)=>"right"),headers:[{cells:[...Array(10)].map((u,r)=>({value:"Heading"}))},{cells:[...Array(10)].map((u,r)=>({options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],type:"Select",searchable:!1,value:{label:"m",value:"m"},autoLayerWidth:!0}))}],rows:[...Array(10)].map((u,r)=>({cells:[...Array(10)].map((T,o)=>({value:123.45})),actions:[{icon:"help",tooltip:n.jsxs(se,{children:[n.jsx(V,{bold:!0,children:"Title goes here lorem ipsum"}),n.jsx(V,{children:"Label: 123.45m"}),n.jsx(V,{children:"Another label: 123.45m"}),n.jsx(V,{children:"Label: 123.45m"})]})}]}))};return n.jsx(A,{table:g})},ee=()=>{const g={fixedWidth:"auto",name:"Table title",actions:[{icon:"download",tooltip:"Download"}],headers:[{cells:[{value:"Label"},{value:"Value",colSpan:2}]}],rows:[{cells:[{value:"Country",style:{fontWeight:"bold"},width:"120px"},{value:"Norway",colSpan:2}],actions:[{icon:"help",tooltip:n.jsxs(se,{children:[n.jsx(V,{bold:!0,children:"Title goes here"}),n.jsx(V,{children:"Details go here"})]})}]},{cells:[{value:"Depth",style:{fontWeight:"bold"}},{value:123,width:"80px"},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:{label:"m",value:"m"},type:"Select",width:"80px"}],actions:[{icon:"help",tooltip:n.jsxs(se,{children:[n.jsx(V,{bold:!0,children:"Title goes here"}),n.jsx(V,{children:"Details go here"})]})}]}]};return n.jsx(A,{table:g})};var ie,ce,de;B.parameters={...B.parameters,docs:{...(ie=B.parameters)==null?void 0:ie.docs,source:{originalSource:`args => {
2
2
  return <Table
3
3
  // eslint-disable-next-line react/jsx-props-no-spreading
4
4
  {...args} />;
@@ -1,4 +1,4 @@
1
- import{j as B}from"./jsx-runtime-FsUICBgo.js";import{T as X}from"./table-_jWgMFOi.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-2BZDVr2X.js";import"./index-RfLt4OUa.js";import"./index-VW3EWkuE.js";import"./index.es-JXn3JM7k.js";import"./inheritsLoose-Y9jOMJLd.js";import"./extends-dGVwEr9R.js";import"./redux-F5dueAP3.js";import"./objectSpread2-93s0nBry.js";import"./index-miLrID2P.js";import"./memoize-one.esm-hqe5SRxC.js";import"./icon-y1a2N5SZ.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./lodash-Bmg8FrMx.js";import"./actions-SGexXf58.js";import"./common-types-U65vzrrz.js";import"./button-IoNblLER.js";import"./spinner-R8Il4aRe.js";import"./tooltip-ZHdi6rl-.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./heading-cUVItwKq.js";import"./help-icon-nI9A506M.js";import"./pagination-Eaj_UOBW.js";import"./select-Z1HqJ5aU.js";import"./assertThisInitialized-4q6YPdh3.js";import"./text-6KQ6ntOV.js";import"./select.input-zP5tW20f.js";import"./input-iDZqV-2m.js";import"./input-group-R8LoqKRn.js";import"./input-group-addon-BHVsW9mL.js";import"./number-input-d7hXQldd.js";import"./index-IQMsp8Ab.js";import"./index-cCpkwrS5.js";import"./check-box-BX5dfQFk.js";import"./slider-_5NQKbM-.js";import"./index-ugi_ZH6T.js";import"./popover-uAo1e4-D.js";import"./flex-ZVra76N-.js";const Br={title:"Basic/Table/Title & Header",component:X,args:{table:{...O}}},r=k=>B.jsx(X,{...k}),e=r.bind({});e.args={table:W};const s=r.bind({});s.args={table:q};const a=r.bind({});a.args={table:z};const t=r.bind({});t.args={table:D};const o=r.bind({});o.args={table:G};const n=r.bind({});n.args={table:K};const i=r.bind({});i.args={table:M};const p=r.bind({});p.args={table:P};const l=r.bind({});l.args={table:Q};var m,c,d;e.parameters={...e.parameters,docs:{...(m=e.parameters)==null?void 0:m.docs,source:{originalSource:`args => {
1
+ import{j as B}from"./jsx-runtime-FsUICBgo.js";import{T as X}from"./table-fX2iU96a.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-2BZDVr2X.js";import"./index-RfLt4OUa.js";import"./index-VW3EWkuE.js";import"./index.es-JXn3JM7k.js";import"./inheritsLoose-Y9jOMJLd.js";import"./extends-dGVwEr9R.js";import"./redux-F5dueAP3.js";import"./objectSpread2-93s0nBry.js";import"./index-miLrID2P.js";import"./memoize-one.esm-hqe5SRxC.js";import"./icon-y1a2N5SZ.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./lodash-Bmg8FrMx.js";import"./actions-SGexXf58.js";import"./common-types-U65vzrrz.js";import"./button-IoNblLER.js";import"./spinner-R8Il4aRe.js";import"./tooltip-ZHdi6rl-.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./heading-cUVItwKq.js";import"./help-icon-nI9A506M.js";import"./pagination-Eaj_UOBW.js";import"./select-Z1HqJ5aU.js";import"./assertThisInitialized-4q6YPdh3.js";import"./text-6KQ6ntOV.js";import"./select.input-zP5tW20f.js";import"./input-iDZqV-2m.js";import"./input-group-R8LoqKRn.js";import"./input-group-addon-BHVsW9mL.js";import"./number-input-d7hXQldd.js";import"./index-IQMsp8Ab.js";import"./index-cCpkwrS5.js";import"./check-box-BX5dfQFk.js";import"./slider-_5NQKbM-.js";import"./index-ugi_ZH6T.js";import"./popover-uAo1e4-D.js";import"./flex-ZVra76N-.js";const Br={title:"Basic/Table/Title & Header",component:X,args:{table:{...O}}},r=k=>B.jsx(X,{...k}),e=r.bind({});e.args={table:W};const s=r.bind({});s.args={table:q};const a=r.bind({});a.args={table:z};const t=r.bind({});t.args={table:D};const o=r.bind({});o.args={table:G};const n=r.bind({});n.args={table:K};const i=r.bind({});i.args={table:M};const p=r.bind({});p.args={table:P};const l=r.bind({});l.args={table:Q};var m,c,d;e.parameters={...e.parameters,docs:{...(m=e.parameters)==null?void 0:m.docs,source:{originalSource:`args => {
2
2
  return <Table
3
3
  // eslint-disable-next-line react/jsx-props-no-spreading
4
4
  {...args} />;
@@ -1 +1 @@
1
- import{j as n}from"./jsx-runtime-FsUICBgo.js";import{c as u}from"./index-VW3EWkuE.js";import{I as N}from"./icon-y1a2N5SZ.js";import{T as b}from"./common-types-U65vzrrz.js";import{B as x}from"./button-IoNblLER.js";import{M as v}from"./actions-SGexXf58.js";import{r as T}from"./index-RfLt4OUa.js";import{D as q}from"./disabled-context-urNQThQz.js";const V="_topbar_gmfjn_11",C="_fixed_gmfjn_21",k="_appSwitcher_gmfjn_29",E="_title_gmfjn_75",I="_logo_gmfjn_91",M="_label_gmfjn_94",B="_brand_gmfjn_99",w="_version_gmfjn_104",L="_left_gmfjn_111",H="_right_gmfjn_112",O="_item_gmfjn_126",S="_link_gmfjn_127",A="_button_gmfjn_139",P="_menu_gmfjn_140",R="_active_gmfjn_168",D="_alert_gmfjn_193",a={topbar:V,fixed:C,appSwitcher:k,title:E,logo:I,label:M,brand:B,version:w,left:L,right:H,item:O,link:S,button:A,menu:P,active:R,alert:D},f=({warning:e})=>n.jsx("div",{className:a.alert,children:e});try{f.displayName="Warning",f.__docgenInfo={description:"",displayName:"Warning",props:{warning:{defaultValue:null,description:"",name:"warning",required:!0,type:{name:"ReactNode"}}}}}catch{}const g=({icon:e,url:t,onClick:i})=>{const r=n.jsx(N,{icon:e});return t?n.jsx("a",{href:t,onClick:i,className:a.appSwitcher,children:r}):n.jsx("div",{onClick:i,className:a.appSwitcher,children:r})};try{g.displayName="AppSwitcher",g.__docgenInfo={description:"",displayName:"AppSwitcher",props:{icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},url:{defaultValue:null,description:"",name:"url",required:!1,type:{name:"string"}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"MouseEventHandler<HTMLDivElement | HTMLAnchorElement>"}}}}}catch{}const h=({label:e,logo:t,url:i,version:r,onClick:s})=>{const o=n.jsxs("div",{className:a.title,children:[t&&n.jsx("div",{className:a.logo,children:t}),e&&n.jsx("span",{className:a.label,children:e}),r&&n.jsx("div",{className:a.version,children:r})]});return n.jsx("div",{className:u(a.item,a.brand),children:i?n.jsx("a",{href:i,onClick:s,children:o}):n.jsx("div",{onClick:s,children:o})})};try{h.displayName="Title",h.__docgenInfo={description:"",displayName:"Title",props:{label:{defaultValue:null,description:"",name:"label",required:!1,type:{name:"string | null"}},logo:{defaultValue:null,description:"",name:"logo",required:!1,type:{name:"ReactNode"}},url:{defaultValue:null,description:"",name:"url",required:!1,type:{name:"string"}},version:{defaultValue:null,description:"",name:"version",required:!1,type:{name:"TStringOrNumber"}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"MouseEventHandler<HTMLDivElement | HTMLAnchorElement>"}}}}}catch{}var d=(e=>(e.LINK="Link",e.BUTTON="Button",e.MENU="Menu",e.COMPONENT="Component",e))(d||{});const p=({label:e,url:t,icon:i,onClick:r,active:s,disabled:o,testId:_})=>{const l=T.useContext(q),c=y=>{(o||l)&&y.preventDefault(),r==null||r(y)};return n.jsxs("a",{className:u(a.link,s?a.active:""),href:t||"#",onClick:c,"aria-disabled":o||l,"data-testid":_,role:r&&!t?"button":void 0,children:[i,n.jsx("span",{className:a.label,children:e})]})};try{p.displayName="Link",p.__docgenInfo={description:"",displayName:"Link",props:{label:{defaultValue:null,description:"",name:"label",required:!1,type:{name:"string | null"}},url:{defaultValue:null,description:"",name:"url",required:!1,type:{name:"string"}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"MouseEventHandler<HTMLAnchorElement>"}},active:{defaultValue:null,description:"",name:"active",required:!1,type:{name:"boolean"}},disabled:{defaultValue:null,description:"",name:"disabled",required:!1,type:{name:"boolean"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const m=({element:e})=>{switch(e.type){case d.LINK:return n.jsx("div",{className:a.item,children:n.jsx(p,{label:e.label,url:e.url,icon:e.icon,onClick:e.onClick,active:e.active,disabled:e.disabled,testId:e.testId})});case d.BUTTON:return n.jsx("div",{className:u(a.item,a.button),children:n.jsx(x,{label:e.label,colored:e.colored,pill:!0,disabled:e.disabled,onClick:e.onClick,icon:e.icon,testId:e.testId})});case d.MENU:return n.jsx("div",{className:u(a.item,a.menu),children:n.jsx(v,{maxHeight:"100%",menu:{trigger:b.COMPONENT,fullHeightTrigger:!0,placement:"bottom-start",component:n.jsx(p,{label:e.label,icon:e.icon,onClick:e.onClick}),sections:e.sections}})});case d.COMPONENT:return n.jsx("div",{className:a.item,children:e.component});default:return null}};try{m.displayName="Element",m.__docgenInfo={description:"",displayName:"Element",props:{element:{defaultValue:null,description:"",name:"element",required:!0,type:{name:"TLinkElement | TButtonElement | TMenuElement | TComponentElement"}}}}}catch{}const j=({title:e,appSwitcher:t,content:i=[],contentRight:r=[],warning:s="",height:o="var(--size-topbar)",fixedPosition:_=!0})=>n.jsxs("div",{children:[s&&n.jsx(f,{warning:s}),n.jsxs("div",{className:u(a.topbar,_?a.fixed:""),style:{height:o},children:[!!t&&n.jsx(g,{icon:t.icon,url:t.url,onClick:t.onClick}),n.jsxs("div",{className:a.left,children:[e&&n.jsx(h,{label:e.label,logo:e.logo,url:e.url,version:e.version,onClick:e.onClick}),i.map((l,c)=>l?n.jsx(m,{element:l},c):null)]}),n.jsx("div",{className:a.right,children:r.map((l,c)=>l?n.jsx(m,{element:l},c):null)})]})]});try{j.displayName="TopBar",j.__docgenInfo={description:"",displayName:"TopBar",props:{title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"ITopBarTitleProps"}},appSwitcher:{defaultValue:null,description:"",name:"appSwitcher",required:!1,type:{name:"ITopBarAppSwitcherProps"}},content:{defaultValue:{value:"[]"},description:"",name:"content",required:!1,type:{name:"TTopBarContent[]"}},contentRight:{defaultValue:{value:"[]"},description:"",name:"contentRight",required:!1,type:{name:"TTopBarContent[]"}},warning:{defaultValue:{value:""},description:"",name:"warning",required:!1,type:{name:"string"}},height:{defaultValue:{value:"var(--size-topbar)"},description:"",name:"height",required:!1,type:{name:"TStringOrNumber"}},fixedPosition:{defaultValue:{value:"true"},description:"",name:"fixedPosition",required:!1,type:{name:"boolean"}}}}}catch{}export{j as T};
1
+ import{j as n}from"./jsx-runtime-FsUICBgo.js";import{c as u}from"./index-VW3EWkuE.js";import{I as N}from"./icon-y1a2N5SZ.js";import{T as b}from"./common-types-U65vzrrz.js";import{B as x}from"./button-IoNblLER.js";import{M as v}from"./actions-SGexXf58.js";import{r as T}from"./index-RfLt4OUa.js";import{D as q}from"./disabled-context-urNQThQz.js";const V="_topbar_gmfjn_11",C="_fixed_gmfjn_21",k="_appSwitcher_gmfjn_29",E="_title_gmfjn_75",I="_logo_gmfjn_91",M="_label_gmfjn_94",B="_brand_gmfjn_99",w="_version_gmfjn_104",L="_left_gmfjn_111",H="_right_gmfjn_112",O="_item_gmfjn_126",S="_link_gmfjn_127",A="_button_gmfjn_139",P="_menu_gmfjn_140",R="_active_gmfjn_168",D="_alert_gmfjn_193",a={topbar:V,fixed:C,appSwitcher:k,title:E,logo:I,label:M,brand:B,version:w,left:L,right:H,item:O,link:S,button:A,menu:P,active:R,alert:D},f=({warning:e})=>n.jsx("div",{className:a.alert,children:e});try{f.displayName="Warning",f.__docgenInfo={description:"",displayName:"Warning",props:{warning:{defaultValue:null,description:"",name:"warning",required:!0,type:{name:"ReactNode"}}}}}catch{}const g=({icon:e,url:t,onClick:i})=>{const r=n.jsx(N,{icon:e});return t?n.jsx("a",{href:t,onClick:i,className:a.appSwitcher,children:r}):n.jsx("div",{onClick:i,className:a.appSwitcher,children:r})};try{g.displayName="AppSwitcher",g.__docgenInfo={description:"",displayName:"AppSwitcher",props:{icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},url:{defaultValue:null,description:"",name:"url",required:!1,type:{name:"string"}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"MouseEventHandler<HTMLAnchorElement | HTMLDivElement>"}}}}}catch{}const h=({label:e,logo:t,url:i,version:r,onClick:s})=>{const o=n.jsxs("div",{className:a.title,children:[t&&n.jsx("div",{className:a.logo,children:t}),e&&n.jsx("span",{className:a.label,children:e}),r&&n.jsx("div",{className:a.version,children:r})]});return n.jsx("div",{className:u(a.item,a.brand),children:i?n.jsx("a",{href:i,onClick:s,children:o}):n.jsx("div",{onClick:s,children:o})})};try{h.displayName="Title",h.__docgenInfo={description:"",displayName:"Title",props:{label:{defaultValue:null,description:"",name:"label",required:!1,type:{name:"string | null"}},logo:{defaultValue:null,description:"",name:"logo",required:!1,type:{name:"ReactNode"}},url:{defaultValue:null,description:"",name:"url",required:!1,type:{name:"string"}},version:{defaultValue:null,description:"",name:"version",required:!1,type:{name:"TStringOrNumber"}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"MouseEventHandler<HTMLAnchorElement | HTMLDivElement>"}}}}}catch{}var d=(e=>(e.LINK="Link",e.BUTTON="Button",e.MENU="Menu",e.COMPONENT="Component",e))(d||{});const p=({label:e,url:t,icon:i,onClick:r,active:s,disabled:o,testId:_})=>{const l=T.useContext(q),c=y=>{(o||l)&&y.preventDefault(),r==null||r(y)};return n.jsxs("a",{className:u(a.link,s?a.active:""),href:t||"#",onClick:c,"aria-disabled":o||l,"data-testid":_,role:r&&!t?"button":void 0,children:[i,n.jsx("span",{className:a.label,children:e})]})};try{p.displayName="Link",p.__docgenInfo={description:"",displayName:"Link",props:{label:{defaultValue:null,description:"",name:"label",required:!1,type:{name:"string | null"}},url:{defaultValue:null,description:"",name:"url",required:!1,type:{name:"string"}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"MouseEventHandler<HTMLAnchorElement>"}},active:{defaultValue:null,description:"",name:"active",required:!1,type:{name:"boolean"}},disabled:{defaultValue:null,description:"",name:"disabled",required:!1,type:{name:"boolean"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const m=({element:e})=>{switch(e.type){case d.LINK:return n.jsx("div",{className:a.item,children:n.jsx(p,{label:e.label,url:e.url,icon:e.icon,onClick:e.onClick,active:e.active,disabled:e.disabled,testId:e.testId})});case d.BUTTON:return n.jsx("div",{className:u(a.item,a.button),children:n.jsx(x,{label:e.label,colored:e.colored,pill:!0,disabled:e.disabled,onClick:e.onClick,icon:e.icon,testId:e.testId})});case d.MENU:return n.jsx("div",{className:u(a.item,a.menu),children:n.jsx(v,{maxHeight:"100%",menu:{trigger:b.COMPONENT,fullHeightTrigger:!0,placement:"bottom-start",component:n.jsx(p,{label:e.label,icon:e.icon,onClick:e.onClick}),sections:e.sections}})});case d.COMPONENT:return n.jsx("div",{className:a.item,children:e.component});default:return null}};try{m.displayName="Element",m.__docgenInfo={description:"",displayName:"Element",props:{element:{defaultValue:null,description:"",name:"element",required:!0,type:{name:"TLinkElement | TButtonElement | TMenuElement | TComponentElement"}}}}}catch{}const j=({title:e,appSwitcher:t,content:i=[],contentRight:r=[],warning:s="",height:o="var(--size-topbar)",fixedPosition:_=!0})=>n.jsxs("div",{children:[s&&n.jsx(f,{warning:s}),n.jsxs("div",{className:u(a.topbar,_?a.fixed:""),style:{height:o},children:[!!t&&n.jsx(g,{icon:t.icon,url:t.url,onClick:t.onClick}),n.jsxs("div",{className:a.left,children:[e&&n.jsx(h,{label:e.label,logo:e.logo,url:e.url,version:e.version,onClick:e.onClick}),i.map((l,c)=>l?n.jsx(m,{element:l},c):null)]}),n.jsx("div",{className:a.right,children:r.map((l,c)=>l?n.jsx(m,{element:l},c):null)})]})]});try{j.displayName="TopBar",j.__docgenInfo={description:"",displayName:"TopBar",props:{title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"ITopBarTitleProps"}},appSwitcher:{defaultValue:null,description:"",name:"appSwitcher",required:!1,type:{name:"ITopBarAppSwitcherProps"}},content:{defaultValue:{value:"[]"},description:"",name:"content",required:!1,type:{name:"TTopBarContent[]"}},contentRight:{defaultValue:{value:"[]"},description:"",name:"contentRight",required:!1,type:{name:"TTopBarContent[]"}},warning:{defaultValue:{value:""},description:"",name:"warning",required:!1,type:{name:"string"}},height:{defaultValue:{value:"var(--size-topbar)"},description:"",name:"height",required:!1,type:{name:"TStringOrNumber"}},fixedPosition:{defaultValue:{value:"true"},description:"",name:"fixedPosition",required:!1,type:{name:"boolean"}}}}}catch{}export{j as T};
@@ -1 +1 @@
1
- import{j as e}from"./jsx-runtime-FsUICBgo.js";import{I as B,T as h}from"./common-types-U65vzrrz.js";import{T as C}from"./top-bar-uqbsCAt-.js";import{M as I}from"./actions-SGexXf58.js";import{B as n}from"./button-IoNblLER.js";import{B as O}from"./badge-23Ty_zBt.js";import{L as S}from"./logo-nHW4TqZt.js";import{s as j}from"./icon-custom-PyWFQsS3.js";import{M as a}from"./types-VB5zD18b.js";import"./index-RfLt4OUa.js";import"./index-VW3EWkuE.js";import"./icon-y1a2N5SZ.js";import"./inheritsLoose-Y9jOMJLd.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./lodash-Bmg8FrMx.js";import"./tooltip-ZHdi6rl-.js";import"./index-miLrID2P.js";import"./types-5uVBABF4.js";import"./spinner-R8Il4aRe.js";const N=[{type:"Link",label:"Link",onClick:()=>{}},{type:"Link",label:"Active",active:!0,onClick:()=>{}},{type:"Link",label:"Disabled",disabled:!0,onClick:()=>{}},{type:"Menu",label:"Dropdown",onClick:()=>{},sections:[{type:"Option",label:"Alpacas",onClick:()=>{}},{type:"Option",label:"Llamas",onClick:()=>{}}]},{type:"Button",label:"Save",colored:!0,onClick:()=>{},testId:"top-bar-button-save"}],v=[{type:"Component",component:e.jsx(O,{title:"3",small:!0,margin:"5px",children:e.jsx(n,{icon:B.NOTIFICATION,round:!0,onClick:()=>{}})})},{type:"Component",component:e.jsx(I,{menu:{trigger:h.COMPONENT,fullHeightTrigger:!0,placement:"bottom-end",component:e.jsx(n,{label:"TU",round:!0,onClick:()=>{}}),sections:[{type:a.HEADING,label:"Test User"},{type:a.OPTION,label:"Profile",icon:"user",onClick:()=>{}},{type:a.DIVIDER},{type:a.OPTION,label:"Sign out",icon:"lock",onClick:()=>{}}]}})}],Y={title:"Navigation/TopBar",component:C,parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}},argTypes:{height:{control:"text"}},args:{title:{logo:e.jsx("img",{src:S,alt:"logo"}),onClick:()=>{}},content:N,contentRight:v}},i=x=>e.jsx(C,{...x}),s=i.bind({}),r=i.bind({});r.args={warning:"Application update available. Please refresh your browser."};const o=i.bind({});o.args={title:{label:"Text Branding",onClick:()=>{}}};const t=i.bind({});t.args={appSwitcher:{icon:j,onClick:()=>{}}};var p,c,l;s.parameters={...s.parameters,docs:{...(p=s.parameters)==null?void 0:p.docs,source:{originalSource:"args => <TopBar {...args} />",...(l=(c=s.parameters)==null?void 0:c.docs)==null?void 0:l.source}}};var m,g,u;r.parameters={...r.parameters,docs:{...(m=r.parameters)==null?void 0:m.docs,source:{originalSource:"args => <TopBar {...args} />",...(u=(g=r.parameters)==null?void 0:g.docs)==null?void 0:u.source}}};var d,T,b;o.parameters={...o.parameters,docs:{...(d=o.parameters)==null?void 0:d.docs,source:{originalSource:"args => <TopBar {...args} />",...(b=(T=o.parameters)==null?void 0:T.docs)==null?void 0:b.source}}};var y,k,f;t.parameters={...t.parameters,docs:{...(y=t.parameters)==null?void 0:y.docs,source:{originalSource:"args => <TopBar {...args} />",...(f=(k=t.parameters)==null?void 0:k.docs)==null?void 0:f.source}}};const Z=["Default","WithWarning","TextBranding","AppSwitcher"];export{t as AppSwitcher,s as Default,o as TextBranding,r as WithWarning,Z as __namedExportsOrder,Y as default};
1
+ import{j as e}from"./jsx-runtime-FsUICBgo.js";import{I as B,T as h}from"./common-types-U65vzrrz.js";import{T as C}from"./top-bar-0fDAFWyC.js";import{M as I}from"./actions-SGexXf58.js";import{B as n}from"./button-IoNblLER.js";import{B as O}from"./badge-23Ty_zBt.js";import{L as S}from"./logo-nHW4TqZt.js";import{s as j}from"./icon-custom-PyWFQsS3.js";import{M as a}from"./types-VB5zD18b.js";import"./index-RfLt4OUa.js";import"./index-VW3EWkuE.js";import"./icon-y1a2N5SZ.js";import"./inheritsLoose-Y9jOMJLd.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./lodash-Bmg8FrMx.js";import"./tooltip-ZHdi6rl-.js";import"./index-miLrID2P.js";import"./types-5uVBABF4.js";import"./spinner-R8Il4aRe.js";const N=[{type:"Link",label:"Link",onClick:()=>{}},{type:"Link",label:"Active",active:!0,onClick:()=>{}},{type:"Link",label:"Disabled",disabled:!0,onClick:()=>{}},{type:"Menu",label:"Dropdown",onClick:()=>{},sections:[{type:"Option",label:"Alpacas",onClick:()=>{}},{type:"Option",label:"Llamas",onClick:()=>{}}]},{type:"Button",label:"Save",colored:!0,onClick:()=>{},testId:"top-bar-button-save"}],v=[{type:"Component",component:e.jsx(O,{title:"3",small:!0,margin:"5px",children:e.jsx(n,{icon:B.NOTIFICATION,round:!0,onClick:()=>{}})})},{type:"Component",component:e.jsx(I,{menu:{trigger:h.COMPONENT,fullHeightTrigger:!0,placement:"bottom-end",component:e.jsx(n,{label:"TU",round:!0,onClick:()=>{}}),sections:[{type:a.HEADING,label:"Test User"},{type:a.OPTION,label:"Profile",icon:"user",onClick:()=>{}},{type:a.DIVIDER},{type:a.OPTION,label:"Sign out",icon:"lock",onClick:()=>{}}]}})}],Y={title:"Navigation/TopBar",component:C,parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}},argTypes:{height:{control:"text"}},args:{title:{logo:e.jsx("img",{src:S,alt:"logo"}),onClick:()=>{}},content:N,contentRight:v}},i=x=>e.jsx(C,{...x}),s=i.bind({}),r=i.bind({});r.args={warning:"Application update available. Please refresh your browser."};const o=i.bind({});o.args={title:{label:"Text Branding",onClick:()=>{}}};const t=i.bind({});t.args={appSwitcher:{icon:j,onClick:()=>{}}};var p,c,l;s.parameters={...s.parameters,docs:{...(p=s.parameters)==null?void 0:p.docs,source:{originalSource:"args => <TopBar {...args} />",...(l=(c=s.parameters)==null?void 0:c.docs)==null?void 0:l.source}}};var m,g,u;r.parameters={...r.parameters,docs:{...(m=r.parameters)==null?void 0:m.docs,source:{originalSource:"args => <TopBar {...args} />",...(u=(g=r.parameters)==null?void 0:g.docs)==null?void 0:u.source}}};var d,T,b;o.parameters={...o.parameters,docs:{...(d=o.parameters)==null?void 0:d.docs,source:{originalSource:"args => <TopBar {...args} />",...(b=(T=o.parameters)==null?void 0:T.docs)==null?void 0:b.source}}};var y,k,f;t.parameters={...t.parameters,docs:{...(y=t.parameters)==null?void 0:y.docs,source:{originalSource:"args => <TopBar {...args} />",...(f=(k=t.parameters)==null?void 0:k.docs)==null?void 0:f.source}}};const Z=["Default","WithWarning","TextBranding","AppSwitcher"];export{t as AppSwitcher,s as Default,o as TextBranding,r as WithWarning,Z as __namedExportsOrder,Y as default};
@@ -1,4 +1,4 @@
1
- import{j as o}from"./jsx-runtime-FsUICBgo.js";import{I as n}from"./common-types-U65vzrrz.js";import{T as l}from"./top-bar-uqbsCAt-.js";import{B as s}from"./button-IoNblLER.js";import{B as m}from"./badge-23Ty_zBt.js";import{L as p}from"./logo-nHW4TqZt.js";import"./index-RfLt4OUa.js";import"./index-VW3EWkuE.js";import"./icon-y1a2N5SZ.js";import"./inheritsLoose-Y9jOMJLd.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./actions-SGexXf58.js";import"./lodash-Bmg8FrMx.js";import"./tooltip-ZHdi6rl-.js";import"./index-miLrID2P.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./spinner-R8Il4aRe.js";const h={title:"Navigation/TopBar/Test Cases",parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}}},t=()=>o.jsx(l,{title:{logo:o.jsx("img",{src:p,alt:"logo"}),version:"V1.2.3",onClick:()=>{}},content:[{type:"Link",label:"Link",onClick:()=>{}},{type:"Link",label:"Lorem ipsum dolor est compendum lorem ipsum dolor est compendum lorem ipsum dolor est (cloned 2022-06-17 01:33:42)",active:!0,onClick:()=>{}},{type:"Link",label:"Disabled",disabled:!0,onClick:()=>{}},{type:"Button",label:"Save",colored:!0,onClick:()=>{},testId:"top-bar-button-save"}],contentRight:[{type:"Component",component:o.jsx(m,{title:"3",small:!0,margin:"5px",children:o.jsx(s,{icon:n.NOTIFICATION,round:!0,onClick:()=>{}})})}]});var e,r,i;t.parameters={...t.parameters,docs:{...(e=t.parameters)==null?void 0:e.docs,source:{originalSource:`() => <TopBar title={{
1
+ import{j as o}from"./jsx-runtime-FsUICBgo.js";import{I as n}from"./common-types-U65vzrrz.js";import{T as l}from"./top-bar-0fDAFWyC.js";import{B as s}from"./button-IoNblLER.js";import{B as m}from"./badge-23Ty_zBt.js";import{L as p}from"./logo-nHW4TqZt.js";import"./index-RfLt4OUa.js";import"./index-VW3EWkuE.js";import"./icon-y1a2N5SZ.js";import"./inheritsLoose-Y9jOMJLd.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./actions-SGexXf58.js";import"./lodash-Bmg8FrMx.js";import"./tooltip-ZHdi6rl-.js";import"./index-miLrID2P.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./spinner-R8Il4aRe.js";const h={title:"Navigation/TopBar/Test Cases",parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}}},t=()=>o.jsx(l,{title:{logo:o.jsx("img",{src:p,alt:"logo"}),version:"V1.2.3",onClick:()=>{}},content:[{type:"Link",label:"Link",onClick:()=>{}},{type:"Link",label:"Lorem ipsum dolor est compendum lorem ipsum dolor est compendum lorem ipsum dolor est (cloned 2022-06-17 01:33:42)",active:!0,onClick:()=>{}},{type:"Link",label:"Disabled",disabled:!0,onClick:()=>{}},{type:"Button",label:"Save",colored:!0,onClick:()=>{},testId:"top-bar-button-save"}],contentRight:[{type:"Component",component:o.jsx(m,{title:"3",small:!0,margin:"5px",children:o.jsx(s,{icon:n.NOTIFICATION,round:!0,onClick:()=>{}})})}]});var e,r,i;t.parameters={...t.parameters,docs:{...(e=t.parameters)==null?void 0:e.docs,source:{originalSource:`() => <TopBar title={{
2
2
  logo: <img src={LogoSVG} alt="logo" />,
3
3
  version: 'V1.2.3',
4
4
  onClick: () => {}