@oliasoft-open-source/react-ui-library 4.11.2-beta-2 → 4.11.2-beta-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/global.css +14 -12
- package/dist/index.js +20 -23
- package/dist/index.js.map +1 -1
- package/dist/storybook/assets/Color-KGDBMAHA-BU5Cvr93.js +1 -0
- package/dist/storybook/assets/DocsRenderer-PKQXORMH-giM41WN8.js +1 -0
- package/dist/storybook/assets/{accordion-6ouB0WTt.js → accordion-BiuI_LCA.js} +1 -1
- package/dist/storybook/assets/{accordion.stories-DtRR01fE.js → accordion.stories-BlHfHegj.js} +2 -2
- package/dist/storybook/assets/{actions-KLRbmKRF.js → actions-Bax0KeqM.js} +1 -1
- package/dist/storybook/assets/{actions.stories-C23gWRWM.js → actions.stories-BnPZKqOJ.js} +1 -1
- package/dist/storybook/assets/{afe.stories-BS17Wy3X.js → afe.stories-C9XjJj62.js} +2 -2
- package/dist/storybook/assets/{badge.stories-DU2dncNt.js → badge.stories-DA_eeQyi.js} +1 -1
- package/dist/storybook/assets/{blowout.stories-Cylh2TXs.js → blowout.stories-DH-sYHgB.js} +1 -1
- package/dist/storybook/assets/{button-CjbZ5CrF.js → button-Cbv7WK6k.js} +1 -1
- package/dist/storybook/assets/{button-group-DubmMwSS.js → button-group-D2fGP_bX.js} +1 -1
- package/dist/storybook/assets/{button-group.stories-PQ9lcPIH.js → button-group.stories-BETADGti.js} +1 -1
- package/dist/storybook/assets/{button.stories-DKC1fejY.js → button.stories-C03VvX8K.js} +2 -2
- package/dist/storybook/assets/{buttons-and-links-wxWmkOUF.js → buttons-and-links-BA3MNFjq.js} +2 -2
- package/dist/storybook/assets/{card.stories-Bn6LpucB.js → card.stories-CsTB0DuM.js} +1 -1
- package/dist/storybook/assets/{casing-loads.stories-DfN1h9Nf.js → casing-loads.stories-Cl2tJipP.js} +2 -2
- package/dist/storybook/assets/{cell.stories-CreKyw65.js → cell.stories-rzJE_qJC.js} +2 -2
- package/dist/storybook/assets/{check-box-wCvXxtCz.js → check-box-DPLaOkRR.js} +1 -1
- package/dist/storybook/assets/{check-box.stories-nJkLcHZb.js → check-box.stories-BJ0ShmeC.js} +1 -1
- package/dist/storybook/assets/{check-box.test-case.stories-B2vjtKjR.js → check-box.test-case.stories-CzuYZkUh.js} +1 -1
- package/dist/storybook/assets/{chunk-HLWAVYOI-CEGdiTjE.js → chunk-HLWAVYOI-Dvbg03uT.js} +1 -1
- package/dist/storybook/assets/color-DIyQ13kP.js +25 -0
- package/dist/storybook/assets/{column.stories-DATtbLrP.js → column.stories-DDTHFELF.js} +1 -1
- package/dist/storybook/assets/{dialog-B-Q5su6I.js → dialog-DkpQscuI.js} +1 -1
- package/dist/storybook/assets/{drawer-X4ZJ2aZ0.js → drawer-DaQ1xGjV.js} +1 -1
- package/dist/storybook/assets/drawer.stories-C08XBVTq.js +113 -0
- package/dist/storybook/assets/{empty.stories-CYf8-mRm.js → empty.stories-L7LSMcLe.js} +1 -1
- package/dist/storybook/assets/{field-C5_fLDpy.js → field-HrLaMLbx.js} +1 -1
- package/dist/storybook/assets/{field.stories-DW0W89lR.js → field.stories-CYpQ669-.js} +1 -1
- package/dist/storybook/assets/{file-button.stories-C_GvNiIi.js → file-button.stories-CRaTdLfv.js} +1 -1
- package/dist/storybook/assets/{file-input-BAwHZe0n.js → file-input-yalPf7-m.js} +1 -1
- package/dist/storybook/assets/{file-input.stories-DYXTB7gQ.js → file-input.stories-DMTQqAF8.js} +1 -1
- package/dist/storybook/assets/{flex.stories-DkN6INc7.js → flex.stories-CLwPyEMp.js} +1 -1
- package/dist/storybook/assets/footer.stories-C6M5S0UZ.js +3 -0
- package/dist/storybook/assets/form.stories-BNORsn6Z.js +49 -0
- package/dist/storybook/assets/formation.stories-1WX1Nu1P.js +74 -0
- package/dist/storybook/assets/{heading-NkLgQYoP.js → heading-CRNoBc7q.js} +1 -1
- package/dist/storybook/assets/{heading.stories-nI_cFnAN.js → heading.stories-DahFxeiX.js} +1 -1
- package/dist/storybook/assets/{help-icon-41R-Z9N1.js → help-icon-Buhx5nl6.js} +1 -1
- package/dist/storybook/assets/{help-icon.stories-DBYh0YX7.js → help-icon.stories-DbmZ1fgP.js} +1 -1
- package/dist/storybook/assets/icon-BSFY3vDO.js +8 -0
- package/dist/storybook/assets/{icon.stories-C4pR7xky.js → icon.stories-fnZUR-LK.js} +1 -1
- package/dist/storybook/assets/iframe-B0e2q2Zd.js +2 -0
- package/dist/storybook/assets/index-BXJ79Lvz.js +1 -0
- package/dist/storybook/assets/{index-D4ghw39u.js → index-BlyDuQBv.js} +8 -8
- package/dist/storybook/assets/{index.es-D2piFfFj.js → index.es-DazXb-ul.js} +4 -4
- package/dist/storybook/assets/inheritsLoose-DP0QEDDI.js +1 -0
- package/dist/storybook/assets/{initialize-context-rEvM6bdZ.js → initialize-context-Y03pJPr5.js} +1 -1
- package/dist/storybook/assets/{input-group.stories-Ddz8LT4X.js → input-group.stories-BCajsqAk.js} +2 -2
- package/dist/storybook/assets/{input-validation-CuPnRCxY.js → input-validation-CLZKtfoW.js} +2 -2
- package/dist/storybook/assets/{inputs-CTDqn8NT.js → inputs-DlW6Jeem.js} +2 -2
- package/dist/storybook/assets/{label-hiSz3I8H.js → label-CqmyC9he.js} +1 -1
- package/dist/storybook/assets/{label.stories-Cyv5jBAO.js → label.stories-C0AO5F1a.js} +1 -1
- package/dist/storybook/assets/layout-forms-C6ZH-nYk.js +16 -0
- package/dist/storybook/assets/{layout-general-BDvvrYSA.js → layout-general-CWqOMwXA.js} +2 -2
- package/dist/storybook/assets/{list-BuGEbcVL.js → list-By3wp5Wa.js} +1 -1
- package/dist/storybook/assets/{list.stories-B5c_uQGt.js → list.stories-BcDHHHYJ.js} +2 -2
- package/dist/storybook/assets/{list.stories-data-8Z0neBbX.js → list.stories-data-Doo2Rqun.js} +1 -1
- package/dist/storybook/assets/{loader.stories-CNWIIZ6E.js → loader.stories-Q0U2BqZX.js} +1 -1
- package/dist/storybook/assets/{menu.stories-BdTFPm_7.js → menu.stories-1I5AGGQx.js} +2 -2
- package/dist/storybook/assets/{menu.test-case.stories-CSHeRTes.js → menu.test-case.stories-XN9XFV-D.js} +1 -1
- package/dist/storybook/assets/{message-y9kZ5iw6.js → message-BRyKdRaX.js} +1 -1
- package/dist/storybook/assets/{message.stories-B7RGjzak.js → message.stories-bCqCYIuN.js} +1 -1
- package/dist/storybook/assets/{meta-content-CDd9TzY4.js → meta-content-DNgQbAW0.js} +1 -1
- package/dist/storybook/assets/{modal.stories-DZi9oABL.js → modal.stories-C2d-Em5V.js} +2 -2
- package/dist/storybook/assets/{modal.test-case.stories-BEw1SVN7.js → modal.test-case.stories-Ci1WRYdo.js} +1 -1
- package/dist/storybook/assets/{number-input-CNnU6gOF.js → number-input-B3_gmeWr.js} +1 -1
- package/dist/storybook/assets/{number-input.stories-Bo26PJmJ.js → number-input.stories-epjUq9ve.js} +1 -1
- package/dist/storybook/assets/number-input.test-case.stories-DeEtalIU.js +95 -0
- package/dist/storybook/assets/{option-dropdown.stories-B1pkizRG.js → option-dropdown.stories-CznUbXVi.js} +1 -1
- package/dist/storybook/assets/{padding-and-spacing-mPE53XO4.js → padding-and-spacing-CfnXk0Zn.js} +2 -2
- package/dist/storybook/assets/{page.stories-Zuw5G3Q1.js → page.stories-DthnK8qb.js} +1 -1
- package/dist/storybook/assets/{pagination-CiGr3h9N.js → pagination-CR1nxnnq.js} +1 -1
- package/dist/storybook/assets/{pagination.stories-Dd2mM2qz.js → pagination.stories-qXmBYwYc.js} +2 -2
- package/dist/storybook/assets/{pop-confirm.stories-DiPq3JCu.js → pop-confirm.stories-CHa0qUBe.js} +1 -1
- package/dist/storybook/assets/{popover-C9ygeajM.js → popover-C_2P8LFJ.js} +1 -1
- package/dist/storybook/assets/popover.stories-DZTfimDf.js +10 -0
- package/dist/storybook/assets/preview-b9pkIJl_.js +2 -0
- package/dist/storybook/assets/{preview-orqWJ2ST.js → preview-jWpKVqju.js} +2 -2
- package/dist/storybook/assets/projects.stories-BPm6ucAe.js +47 -0
- package/dist/storybook/assets/{radio-button-C3RuBqEf.js → radio-button-C4ljBRED.js} +1 -1
- package/dist/storybook/assets/{radio-button.stories-B0KZMz4B.js → radio-button.stories-D1rWr6ms.js} +1 -1
- package/dist/storybook/assets/{radio-button.test-case.stories-BwUah-6O.js → radio-button.test-case.stories-DglmHlWs.js} +1 -1
- package/dist/storybook/assets/react-router-dom-Ck2Y_Fzc.js +8 -0
- package/dist/storybook/assets/{reservoirs.stories-CDD0TjSy.js → reservoirs.stories-r1Ip90kJ.js} +2 -2
- package/dist/storybook/assets/{rich-text-input.stories-D1j_y7V_.js → rich-text-input.stories-DwaseXZv.js} +3 -3
- package/dist/storybook/assets/{row.stories-DB38kAZL.js → row.stories-DRvH8Grn.js} +2 -2
- package/dist/storybook/assets/{select-B3sB0hqr.js → select-Cwks-WA0.js} +2 -2
- package/dist/storybook/assets/{select.stories-BSoB4ldP.js → select.stories-DjGSNDXK.js} +2 -2
- package/dist/storybook/assets/{select.stories-data-BEF6nqsN.js → select.stories-data-DxgWKlU6.js} +1 -1
- package/dist/storybook/assets/select.test-case.stories-CrXzt4qn.js +82 -0
- package/dist/storybook/assets/{side-bar-D2164Tn-.js → side-bar-wpFQ5NEE.js} +1 -1
- package/dist/storybook/assets/{side-bar.stories-E0tQZmAY.js → side-bar.stories-LjClxJcG.js} +1 -1
- package/dist/storybook/assets/{site.stories-Dmk01rYh.js → site.stories-BnWmALGd.js} +2 -2
- package/dist/storybook/assets/slider-CcpE4BLD.js +27 -0
- package/dist/storybook/assets/{slider-DPdTVMP0.css → slider-DnRddBCy.css} +1 -1
- package/dist/storybook/assets/slider.stories-BqlRLY_C.js +171 -0
- package/dist/storybook/assets/{smart-upload-modal.stories-CUln0bMR.js → smart-upload-modal.stories-BlTSF64K.js} +1 -1
- package/dist/storybook/assets/{spacer.stories-BVuZoGQG.js → spacer.stories-BT2S6B0R.js} +1 -1
- package/dist/storybook/assets/{table-Bl5BWKeT.js → table-DoyDBG6l.js} +1 -1
- package/dist/storybook/assets/{table.stories-CqW7dMju.js → table.stories-BgWKzIob.js} +2 -2
- package/dist/storybook/assets/{table.stories-data-CElcAZ7Y.js → table.stories-data-C7mC5R8Q.js} +1 -1
- package/dist/storybook/assets/text-link.stories-BQAkVO-W.js +14 -0
- package/dist/storybook/assets/{title.stories-HWf-jbB_.js → title.stories-Rv6ZO_Wl.js} +2 -2
- package/dist/storybook/assets/{toaster-BMWF3yRW.js → toaster-O8ftrUAJ.js} +1 -1
- package/dist/storybook/assets/{toaster.stories-shnom1S1.js → toaster.stories-CdpwLBSo.js} +1 -1
- package/dist/storybook/assets/{toaster.test-case.stories-BndtbjCb.js → toaster.test-case.stories-Cy3_Gvs_.js} +1 -1
- package/dist/storybook/assets/{toggle-C0zvrIOF.js → toggle-BbFVf61v.js} +1 -1
- package/dist/storybook/assets/{toggle.stories-HIP6dA5T.js → toggle.stories-BAislK3I.js} +1 -1
- package/dist/storybook/assets/{toggle.test-case.stories-SLhE2A5P.js → toggle.test-case.stories-CeUwdhGD.js} +1 -1
- package/dist/storybook/assets/{tooltip.test-case.stories-B_zX5FCQ.js → tooltip.test-case.stories-De9h8ThH.js} +1 -1
- package/dist/storybook/assets/{top-bar-4AZm07Mc.js → top-bar-Bjf6PQE1.js} +1 -1
- package/dist/storybook/assets/top-bar.stories-1hZmlzDT.js +21 -0
- package/dist/storybook/assets/{top-bar.testcase.stories-DN3MQDLk.js → top-bar.testcase.stories-BsFYqaw6.js} +1 -1
- package/dist/storybook/assets/{tree.stories-0qtpSom_.js → tree.stories-NGZfmH_B.js} +1 -1
- package/dist/storybook/assets/{unit-input-BGnD9Z8O.js → unit-input-BXg4VphV.js} +1 -1
- package/dist/storybook/assets/{unit-input.stories-CGRypKCW.js → unit-input.stories-Btz2M_TP.js} +1 -1
- package/dist/storybook/assets/unit-input.test-case.stories-CZD1jf36.js +220 -0
- package/dist/storybook/assets/unit-table.stories-CISvZMxX.js +152 -0
- package/dist/storybook/assets/unit-table.test-case.stories-tEype9om.js +1 -0
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/index.json +1 -1
- package/dist/storybook/project.json +1 -1
- package/package.json +1 -1
- package/dist/storybook/assets/Color-KGDBMAHA-Bqds5h8Z.js +0 -1
- package/dist/storybook/assets/DocsRenderer-PKQXORMH-DCqVP8-K.js +0 -1
- package/dist/storybook/assets/color-BQwVduH-.js +0 -25
- package/dist/storybook/assets/drawer.stories-Di0z4mQf.js +0 -113
- package/dist/storybook/assets/extends-CF3RwP-h.js +0 -1
- package/dist/storybook/assets/footer.stories-BGYrbMcS.js +0 -3
- package/dist/storybook/assets/form.stories-QcF3dSbt.js +0 -49
- package/dist/storybook/assets/formation.stories-DnQfJcH1.js +0 -74
- package/dist/storybook/assets/icon-BP4BO6-k.js +0 -8
- package/dist/storybook/assets/iframe-DzDQhvl_.js +0 -2
- package/dist/storybook/assets/index-DO2UUQkG.js +0 -1
- package/dist/storybook/assets/inheritsLoose-DR8r8Ogv.js +0 -1
- package/dist/storybook/assets/layout-forms-BNzU7smr.js +0 -16
- package/dist/storybook/assets/number-input.test-case.stories-noFGMaR2.js +0 -92
- package/dist/storybook/assets/popover.stories-BjQWHpS3.js +0 -10
- package/dist/storybook/assets/preview-SSh22Coz.js +0 -2
- package/dist/storybook/assets/projects.stories-Rn2Q-yAl.js +0 -47
- package/dist/storybook/assets/react-router-dom-CMITYWBH.js +0 -8
- package/dist/storybook/assets/select.test-case.stories-trBjoExl.js +0 -82
- package/dist/storybook/assets/slider-CSesKEJF.js +0 -27
- package/dist/storybook/assets/slider.stories-CX-hT1FF.js +0 -134
- package/dist/storybook/assets/text-link.stories-BsuVBOWo.js +0 -14
- package/dist/storybook/assets/top-bar.stories-DbuzGzjw.js +0 -21
- package/dist/storybook/assets/unit-input.test-case.stories-fGxudkap.js +0 -220
- package/dist/storybook/assets/unit-table.stories-BqLmWCPl.js +0 -152
- package/dist/storybook/assets/unit-table.test-case.stories-DgT7qcpi.js +0 -1
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import{j as n}from"./jsx-runtime-eps93zm2.js";import{S as A}from"./slider-CcpE4BLD.js";import{T as se}from"./text-B3-TSWok.js";import"./index-DhsZuJvc.js";import"./lodash-c4VUpsOs.js";import"./objectSpread2-DW4nTBoq.js";import"./index-Bk2sglWO.js";import"./inheritsLoose-DP0QEDDI.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./memoize-one.esm-CcMeOnPo.js";import"./index-BI4_Bp97.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./button-Cbv7WK6k.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./index-CEuq6vkz.js";const{useArgs:ae}=__STORYBOOK_MODULE_PREVIEW_API__,re=[{label:"S1...",tooltip:"S1 Production",value:20},{label:"S2...",tooltip:"S2 Cementing",value:40},{label:"S3...",tooltip:n.jsxs("span",{children:[n.jsx("strong",{children:"S3"})," Drilling"]}),value:60},{label:"S4...",tooltip:"S4 Shut in",value:80},{label:"S5...",tooltip:"S5 Circulate",value:100}],je={title:"Forms/Slider",component:A,args:{value:50,min:0,max:100,step:1,showTooltip:!1,label:""}},e=r=>{const[m,v]=ae(),b=x=>{v({value:x.target.value})};return n.jsx("div",{style:{paddingTop:40},children:n.jsx(A,{...r,onChange:b})})},h=e.bind({}),s=e.bind({});s.args={range:!0,value:[10,40]};const t=e.bind({});t.args={label:"Number of aardvarks"};const o=e.bind({});o.args={range:!0,value:[10,40],showArrows:!0};const l=r=>{const[{value:m},v]=ae(),b=x=>{v({value:x.target.value})};return n.jsx(n.Fragment,{children:n.jsx(A,{...r,label:n.jsxs("span",{children:["Fixed width label: ",n.jsx("strong",{children:m*Math.random()})]}),labelWidth:"400px",value:m,onChange:b})})},d=e.bind({});d.args={showTooltip:!0};const i=e.bind({});i.args={showTooltip:!0,tooltipFormatter:r=>n.jsx(se,{warning:!0,children:`${r} extra info lorem ipsum`})};const p=e.bind({});p.args={showArrows:!0};const g=e.bind({});g.args={marks:re};const a=e.bind({});a.args={small:!0};a.parameters={docs:{description:{story:"Reduces the vertical height of the `Slider` container to align with other `small` elements."}}};const u=e.bind({});u.args={disabled:!0};const c=e.bind({});c.args={marks:re,vertical:{enabled:!0,width:"100px",height:"400px"}};l.__docgenInfo={description:"",methods:[],displayName:"JSXLabel"};var S,C,y;h.parameters={...h.parameters,docs:{...(S=h.parameters)==null?void 0:S.docs,source:{originalSource:`args => {
|
|
2
|
+
const [_, updateArgs] = useArgs();
|
|
3
|
+
const handleChange = (evt: any) => {
|
|
4
|
+
updateArgs({
|
|
5
|
+
value: evt.target.value
|
|
6
|
+
});
|
|
7
|
+
};
|
|
8
|
+
return <div style={{
|
|
9
|
+
paddingTop: 40
|
|
10
|
+
}}>
|
|
11
|
+
<Slider
|
|
12
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
13
|
+
{...args} onChange={handleChange} />
|
|
14
|
+
</div>;
|
|
15
|
+
}`,...(y=(C=h.parameters)==null?void 0:C.docs)==null?void 0:y.source}}};var _,j,T;s.parameters={...s.parameters,docs:{...(_=s.parameters)==null?void 0:_.docs,source:{originalSource:`args => {
|
|
16
|
+
const [_, updateArgs] = useArgs();
|
|
17
|
+
const handleChange = (evt: any) => {
|
|
18
|
+
updateArgs({
|
|
19
|
+
value: evt.target.value
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
return <div style={{
|
|
23
|
+
paddingTop: 40
|
|
24
|
+
}}>
|
|
25
|
+
<Slider
|
|
26
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
27
|
+
{...args} onChange={handleChange} />
|
|
28
|
+
</div>;
|
|
29
|
+
}`,...(T=(j=s.parameters)==null?void 0:j.docs)==null?void 0:T.source}}};var w,f,R;t.parameters={...t.parameters,docs:{...(w=t.parameters)==null?void 0:w.docs,source:{originalSource:`args => {
|
|
30
|
+
const [_, updateArgs] = useArgs();
|
|
31
|
+
const handleChange = (evt: any) => {
|
|
32
|
+
updateArgs({
|
|
33
|
+
value: evt.target.value
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
return <div style={{
|
|
37
|
+
paddingTop: 40
|
|
38
|
+
}}>
|
|
39
|
+
<Slider
|
|
40
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
41
|
+
{...args} onChange={handleChange} />
|
|
42
|
+
</div>;
|
|
43
|
+
}`,...(R=(f=t.parameters)==null?void 0:f.docs)==null?void 0:R.source}}};var F,D,L;o.parameters={...o.parameters,docs:{...(F=o.parameters)==null?void 0:F.docs,source:{originalSource:`args => {
|
|
44
|
+
const [_, updateArgs] = useArgs();
|
|
45
|
+
const handleChange = (evt: any) => {
|
|
46
|
+
updateArgs({
|
|
47
|
+
value: evt.target.value
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
return <div style={{
|
|
51
|
+
paddingTop: 40
|
|
52
|
+
}}>
|
|
53
|
+
<Slider
|
|
54
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
55
|
+
{...args} onChange={handleChange} />
|
|
56
|
+
</div>;
|
|
57
|
+
}`,...(L=(D=o.parameters)==null?void 0:D.docs)==null?void 0:L.source}}};var E,M,O;l.parameters={...l.parameters,docs:{...(E=l.parameters)==null?void 0:E.docs,source:{originalSource:`args => {
|
|
58
|
+
const [{
|
|
59
|
+
value
|
|
60
|
+
}, updateArgs] = useArgs();
|
|
61
|
+
const handleChange = (evt: any) => {
|
|
62
|
+
updateArgs({
|
|
63
|
+
value: evt.target.value
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
return <>
|
|
67
|
+
<Slider
|
|
68
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
69
|
+
{...args} label={<span>
|
|
70
|
+
Fixed width label: <strong>{value * Math.random()}</strong>
|
|
71
|
+
</span>} labelWidth="400px" value={value} onChange={handleChange} />
|
|
72
|
+
</>;
|
|
73
|
+
}`,...(O=(M=l.parameters)==null?void 0:M.docs)==null?void 0:O.source}}};var W,k,I;d.parameters={...d.parameters,docs:{...(W=d.parameters)==null?void 0:W.docs,source:{originalSource:`args => {
|
|
74
|
+
const [_, updateArgs] = useArgs();
|
|
75
|
+
const handleChange = (evt: any) => {
|
|
76
|
+
updateArgs({
|
|
77
|
+
value: evt.target.value
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
return <div style={{
|
|
81
|
+
paddingTop: 40
|
|
82
|
+
}}>
|
|
83
|
+
<Slider
|
|
84
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
85
|
+
{...args} onChange={handleChange} />
|
|
86
|
+
</div>;
|
|
87
|
+
}`,...(I=(k=d.parameters)==null?void 0:k.docs)==null?void 0:I.source}}};var J,P,V;i.parameters={...i.parameters,docs:{...(J=i.parameters)==null?void 0:J.docs,source:{originalSource:`args => {
|
|
88
|
+
const [_, updateArgs] = useArgs();
|
|
89
|
+
const handleChange = (evt: any) => {
|
|
90
|
+
updateArgs({
|
|
91
|
+
value: evt.target.value
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
return <div style={{
|
|
95
|
+
paddingTop: 40
|
|
96
|
+
}}>
|
|
97
|
+
<Slider
|
|
98
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
99
|
+
{...args} onChange={handleChange} />
|
|
100
|
+
</div>;
|
|
101
|
+
}`,...(V=(P=i.parameters)==null?void 0:P.docs)==null?void 0:V.source}}};var X,N,B;p.parameters={...p.parameters,docs:{...(X=p.parameters)==null?void 0:X.docs,source:{originalSource:`args => {
|
|
102
|
+
const [_, updateArgs] = useArgs();
|
|
103
|
+
const handleChange = (evt: any) => {
|
|
104
|
+
updateArgs({
|
|
105
|
+
value: evt.target.value
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
return <div style={{
|
|
109
|
+
paddingTop: 40
|
|
110
|
+
}}>
|
|
111
|
+
<Slider
|
|
112
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
113
|
+
{...args} onChange={handleChange} />
|
|
114
|
+
</div>;
|
|
115
|
+
}`,...(B=(N=p.parameters)==null?void 0:N.docs)==null?void 0:B.source}}};var K,U,Y;g.parameters={...g.parameters,docs:{...(K=g.parameters)==null?void 0:K.docs,source:{originalSource:`args => {
|
|
116
|
+
const [_, updateArgs] = useArgs();
|
|
117
|
+
const handleChange = (evt: any) => {
|
|
118
|
+
updateArgs({
|
|
119
|
+
value: evt.target.value
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
return <div style={{
|
|
123
|
+
paddingTop: 40
|
|
124
|
+
}}>
|
|
125
|
+
<Slider
|
|
126
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
127
|
+
{...args} onChange={handleChange} />
|
|
128
|
+
</div>;
|
|
129
|
+
}`,...(Y=(U=g.parameters)==null?void 0:U.docs)==null?void 0:Y.source}}};var $,q,z;a.parameters={...a.parameters,docs:{...($=a.parameters)==null?void 0:$.docs,source:{originalSource:`args => {
|
|
130
|
+
const [_, updateArgs] = useArgs();
|
|
131
|
+
const handleChange = (evt: any) => {
|
|
132
|
+
updateArgs({
|
|
133
|
+
value: evt.target.value
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
return <div style={{
|
|
137
|
+
paddingTop: 40
|
|
138
|
+
}}>
|
|
139
|
+
<Slider
|
|
140
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
141
|
+
{...args} onChange={handleChange} />
|
|
142
|
+
</div>;
|
|
143
|
+
}`,...(z=(q=a.parameters)==null?void 0:q.docs)==null?void 0:z.source}}};var G,H,Q;u.parameters={...u.parameters,docs:{...(G=u.parameters)==null?void 0:G.docs,source:{originalSource:`args => {
|
|
144
|
+
const [_, updateArgs] = useArgs();
|
|
145
|
+
const handleChange = (evt: any) => {
|
|
146
|
+
updateArgs({
|
|
147
|
+
value: evt.target.value
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
return <div style={{
|
|
151
|
+
paddingTop: 40
|
|
152
|
+
}}>
|
|
153
|
+
<Slider
|
|
154
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
155
|
+
{...args} onChange={handleChange} />
|
|
156
|
+
</div>;
|
|
157
|
+
}`,...(Q=(H=u.parameters)==null?void 0:H.docs)==null?void 0:Q.source}}};var Z,ee,ne;c.parameters={...c.parameters,docs:{...(Z=c.parameters)==null?void 0:Z.docs,source:{originalSource:`args => {
|
|
158
|
+
const [_, updateArgs] = useArgs();
|
|
159
|
+
const handleChange = (evt: any) => {
|
|
160
|
+
updateArgs({
|
|
161
|
+
value: evt.target.value
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
return <div style={{
|
|
165
|
+
paddingTop: 40
|
|
166
|
+
}}>
|
|
167
|
+
<Slider
|
|
168
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
169
|
+
{...args} onChange={handleChange} />
|
|
170
|
+
</div>;
|
|
171
|
+
}`,...(ne=(ee=c.parameters)==null?void 0:ee.docs)==null?void 0:ne.source}}};const Te=["Default","Range","Label","RangeWithArrows","JSXLabel","Tooltip","FormattedTooltip","Arrows","Marks","Small","Disabled","Vertical"];export{p as Arrows,h as Default,u as Disabled,i as FormattedTooltip,l as JSXLabel,t as Label,g as Marks,s as Range,o as RangeWithArrows,a as Small,d as Tooltip,c as Vertical,Te as __namedExportsOrder,je as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as i}from"./index-DhsZuJvc.js";import{B as h}from"./button-
|
|
1
|
+
import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as i}from"./index-DhsZuJvc.js";import{B as h}from"./button-Cbv7WK6k.js";import{u as Q,M as z,D as G}from"./dialog-DkpQscuI.js";import{F as J}from"./file-input-yalPf7-m.js";import{S}from"./spacer-BWoNR27H.js";import{T as W}from"./text-B3-TSWok.js";import{P as X}from"./progress-bar-C_kV6r0Q.js";import{d as Y}from"./index-C0x1JmaP.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./portal-GQ0_cLB6.js";import"./lodash-c4VUpsOs.js";import"./heading-CRNoBc7q.js";import"./help-icon-Buhx5nl6.js";import"./input-group-BaRSJAEN.js";import"./input-Db9WkmPP.js";import"./types-Dx2TtIG9.js";import"./index-DRSy5Ssd.js";const U=250,g=4e4,b=20,I=500,M=({visible:s,prompt:p,onCloseModal:f,onUpload:m,onComplete:y,onFailed:n,onError:a,width:F,heading:_,dialogText:E,fileInputText:k,fileInputPlaceholder:N,uploadText:V,cancelText:B,testId:d})=>{const[c,v]=i.useState(null),[C,u]=i.useState(!1),[P,T]=i.useState(0);let o=0;const R=()=>{o=o+U,T(o)},A=t=>{let r=o+t;r>=.99*g&&(r=g),o=r,T(o)};i.useEffect(()=>{v(null)},[s]);const L=t=>{t.target.value&&v(t.target.value)},H=async()=>{T(0);const t=setInterval(R,U);try{if(!c)return;u(!0);const r=await m(p,c);if(!s)return;if(r){clearInterval(t);const K=setInterval(A,I/b,(g-o)/(b-1));setTimeout(()=>{y(r),clearInterval(K),u(!1)},I)}else n==null||n(),u(!1)}catch(r){a==null||a(r),u(!1)}finally{clearInterval(t)}},O=()=>{H()},x=()=>{f()},$=e.jsxs(e.Fragment,{children:[e.jsx(W,{children:E||"Upload file and extract data using a LLM"}),e.jsx(S,{}),e.jsx(J,{placeholder:N||"No file",label:k||"Select",file:c||void 0,onChange:L,testId:`${d}-file-input`,accept:"image/*"}),C&&e.jsxs(e.Fragment,{children:[e.jsx(S,{}),e.jsx(X,{percentage:Y.roundByMagnitudeToFixed(100*P/g,3)})]})]}),D=e.jsxs(e.Fragment,{children:[e.jsx(h,{label:V||"Upload",colored:!0,onClick:O,disabled:!c||C,testId:`${d}-button-upload`}),e.jsx(h,{label:B||"Cancel",onClick:x,testId:`${d}-button-cancel`})]});return Q("Escape",()=>x()),e.jsx(z,{visible:s,centered:!0,children:e.jsx(G,{dialog:{scroll:!0,heading:_||"Smart Upload",content:$,footer:D,onClose:x,width:F||350,testId:d}})})};M.__docgenInfo={description:"",methods:[],displayName:"SmartUploadModal",props:{visible:{required:!0,tsType:{name:"boolean"},description:""},prompt:{required:!0,tsType:{name:"string"},description:""},onCloseModal:{required:!0,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},onUpload:{required:!0,tsType:{name:"signature",type:"function",raw:"(prompt: string, file: File) => any",signature:{arguments:[{type:{name:"string"},name:"prompt"},{type:{name:"File"},name:"file"}],return:{name:"any"}}},description:""},onComplete:{required:!0,tsType:{name:"signature",type:"function",raw:"(data: { [key: string]: string }[]) => void",signature:{arguments:[{type:{name:"Array",elements:[{name:"signature",type:"object",raw:"{ [key: string]: string }",signature:{properties:[{key:{name:"string"},value:{name:"string",required:!0}}]}}],raw:"{ [key: string]: string }[]"},name:"data"}],return:{name:"void"}}},description:""},onFailed:{required:!1,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},onError:{required:!1,tsType:{name:"signature",type:"function",raw:"(error: any) => void",signature:{arguments:[{type:{name:"any"},name:"error"}],return:{name:"void"}}},description:""},width:{required:!1,tsType:{name:"number"},description:""},heading:{required:!1,tsType:{name:"string"},description:""},dialogText:{required:!1,tsType:{name:"string"},description:""},fileInputText:{required:!1,tsType:{name:"string"},description:""},fileInputPlaceholder:{required:!1,tsType:{name:"string"},description:""},uploadText:{required:!1,tsType:{name:"string"},description:""},cancelText:{required:!1,tsType:{name:"string"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const Ie={title:"Ai/SmartUploadModal",component:M,args:{visible:!0,prompt:"This is a prompt",onCloseModal:()=>{},onUpload:()=>{},onComplete:()=>{}},parameters:{docs:{story:{inline:!1,iframeHeight:400}}}},l=()=>{const[s,p]=i.useState(!0),f=()=>{p(!0)},m=()=>{p(!1)},y=()=>(console.log("Uploading"),new Promise(a=>{setTimeout(()=>{a([])},4e3)})),n=()=>{console.log("Completed"),m()};return e.jsxs(e.Fragment,{children:[e.jsx(M,{visible:s,prompt:"This is a prompt",onCloseModal:m,onUpload:y,onComplete:n}),e.jsx(h,{label:"Open Modal",onClick:f})]})};l.__docgenInfo={description:"",methods:[],displayName:"SmartUpload"};var j,q,w;l.parameters={...l.parameters,docs:{...(j=l.parameters)==null?void 0:j.docs,source:{originalSource:`() => {
|
|
2
2
|
const [visible, setVisible] = useState(true);
|
|
3
3
|
const openModal = () => {
|
|
4
4
|
setVisible(true);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r}from"./jsx-runtime-eps93zm2.js";import{S as h}from"./spacer-BWoNR27H.js";import{F as j}from"./flex-EllkLxgO.js";import{B as s}from"./button-
|
|
1
|
+
import{j as r}from"./jsx-runtime-eps93zm2.js";import{S as h}from"./spacer-BWoNR27H.js";import{F as j}from"./flex-EllkLxgO.js";import{B as s}from"./button-Cbv7WK6k.js";import"./index-DhsZuJvc.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";const W={title:"Layout/Spacer",component:h,argTypes:{width:{control:"text"},height:{control:"text"}}},p=t=>r.jsx(h,{...t}),a=p.bind({});a.decorators=[t=>r.jsxs(r.Fragment,{children:[r.jsx(s,{label:"Button"}),t(),r.jsx(s,{label:"Button"})]})];const e=p.bind({});e.args={height:"var(--padding-xxs)"};e.decorators=[t=>r.jsxs(r.Fragment,{children:[r.jsx(s,{label:"Button"}),t(),r.jsx(s,{label:"Button"})]})];const o=p.bind({});o.args={width:"var(--padding)"};o.decorators=[t=>r.jsxs(j,{children:[r.jsx(s,{label:"Button"}),t(),r.jsx(s,{label:"Button"})]})];var c,i,m;a.parameters={...a.parameters,docs:{...(c=a.parameters)==null?void 0:c.docs,source:{originalSource:"(args: ISpacerProps) => <Spacer {...args} />",...(m=(i=a.parameters)==null?void 0:i.docs)==null?void 0:m.source}}};var n,d,l;e.parameters={...e.parameters,docs:{...(n=e.parameters)==null?void 0:n.docs,source:{originalSource:"(args: ISpacerProps) => <Spacer {...args} />",...(l=(d=e.parameters)==null?void 0:d.docs)==null?void 0:l.source}}};var u,g,x;o.parameters={...o.parameters,docs:{...(u=o.parameters)==null?void 0:u.docs,source:{originalSource:"(args: ISpacerProps) => <Spacer {...args} />",...(x=(g=o.parameters)==null?void 0:g.docs)==null?void 0:x.source}}};const L=["Default","Height","Width"];export{a as Default,e as Height,o as Width,L as __namedExportsOrder,W as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as n}from"./jsx-runtime-eps93zm2.js";import{r as S}from"./index-DhsZuJvc.js";import{c as T}from"./index-Bk2sglWO.js";import{I as Le,D as We,C as Fe,P as Pe}from"./index.es-D2piFfFj.js";import{l as De}from"./lodash-c4VUpsOs.js";import{A as ae}from"./actions-KLRbmKRF.js";import{H as Oe}from"./heading-NkLgQYoP.js";import{P as Be}from"./pagination-CiGr3h9N.js";import{A as h,I as $}from"./common-types-Sih75Sav.js";import{I as $e}from"./input-Db9WkmPP.js";import{N as Me}from"./number-input-CNnU6gOF.js";import{S as Ge}from"./select-B3sB0hqr.js";import{D as Ve}from"./disabled-context-rmpd7YJS.js";import{i as M}from"./types-Dx2TtIG9.js";import{T as ie}from"./tooltip-1V7clEnw.js";import{C as Ue}from"./check-box-wCvXxtCz.js";import{S as ze}from"./slider-CSesKEJF.js";import{I as G}from"./icon-BP4BO6-k.js";import{P as Ke}from"./popover-C9ygeajM.js";import{H as fe}from"./help-icon-41R-Z9N1.js";import{T as Y}from"./text-B3-TSWok.js";const Xe="_inputInTable_1dg3w_1",Ye="_inputHover_1dg3w_13",Je="_inputFocus_1dg3w_18",Qe="_inputError_1dg3w_25",Ze="_inputWarning_1dg3w_26",en="_inputDisabled_1dg3w_61",nn="_hideScrollbars_1dg3w_67",tn="_wrapper_1dg3w_85",rn="_bordered_1dg3w_93",an="_scroll_1dg3w_98",on="_table_1dg3w_108",sn="_striped_1dg3w_188",L={inputInTable:Xe,inputHover:Ye,inputFocus:Je,inputError:Qe,inputWarning:Ze,inputDisabled:en,hideScrollbars:nn,wrapper:tn,bordered:rn,scroll:an,table:on,striped:sn},ln="_title_zn5s7_1",dn={title:ln},Q=({name:e=null,actions:t=null,actionsRight:r=!1,testId:i})=>{const a=e!==null,o=t!==null;if(!a&&!o)return null;const s=()=>{if(!o)return null;const c=n.jsx(ae,{actions:t});return r?c:n.jsx("div",{children:c})};return n.jsxs("div",{className:dn.title,children:[a?n.jsx(Oe,{children:n.jsx("span",{"data-testid":i,children:e})}):null,s()]})};Q.__docgenInfo={description:"",methods:[],displayName:"Title",props:{name:{required:!1,tsType:{name:"union",raw:"TStringOrNumber | ReactNode",elements:[{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},{name:"ReactNode"}]},description:"",defaultValue:{value:"null",computed:!1}},actions:{required:!1,tsType:{name:"any"},description:"",defaultValue:{value:"null",computed:!1}},actionsRight:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},testId:{required:!1,tsType:{name:"string"},description:""}}};const un="_footer_4sumy_1",cn="_section_4sumy_7",J={footer:un,section:cn},Z=({colSpan:e,pagination:t,actions:r,content:i})=>{const a=r&&r.length,o=i!=null,s=()=>{var d,p;if(t){const{rowCount:u,rowsPerPage:y}=t,I=Number((p=(d=y==null?void 0:y.options)==null?void 0:d[0])==null?void 0:p.value);return u>I}return!1};return a||o||s()?n.jsxs("div",{className:J.footer,children:[o?n.jsx("div",{className:J.section,children:n.jsx("div",{children:i})}):null,a||s()?n.jsxs("div",{className:J.section,children:[s()?n.jsx(Be,{pagination:t}):n.jsx("div",{}),a&&n.jsx("div",{children:n.jsx(ae,{actions:r})})]}):null]}):null};Z.__docgenInfo={description:"",methods:[],displayName:"Footer",props:{colSpan:{required:!1,tsType:{name:"number"},description:""},pagination:{required:!0,tsType:{name:"IPagination"},description:""},actions:{required:!1,tsType:{name:"Array",elements:[{name:"IAction"}],raw:"IAction[]"},description:""},content:{required:!1,tsType:{name:"ReactNode"},description:""}}};const Ce=e=>{const t=Math.max(...e.reduce((r,i)=>{const a=i.cells.map(o=>o.colSpan?o.colSpan:1).reduce((o,s)=>o+s,0);return r.concat(a)},[]));return isNaN(t)?0:t},pn=(e,t)=>{const r=[Ce(t),Ce(e)];return Math.max(...r)},be=e=>e.reduce((t,r)=>r.actions&&r.actions.length>0?1:t,0),mn=(e,t)=>be(t)>0||be(e)>0,ee=({table:e,children:t})=>{const{rows:r,infiniteScroll:i}=e,a=Math.ceil(window.innerHeight/30),[o,s]=i?S.useState(a):[r.length,null],[c,d]=i?S.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:L.scroll,children:i?n.jsx(Le,{dataLength:Math.min(r.length,o+a),next:p,hasMore:c,scrollableTarget:"scrollWrapper",style:{overflow:"initial"},loader:null,children:t({visibleRows:o})}):t({visibleRows:o})})};ee.__docgenInfo={description:"",methods:[],displayName:"TableScrollWrapper",props:{table:{required:!0,tsType:{name:"ITableProps"},description:""},children:{required:!0,tsType:{name:"signature",type:"function",raw:"(props: { visibleRows: number }) => ReactNode",signature:{arguments:[{type:{name:"signature",type:"object",raw:"{ visibleRows: number }",signature:{properties:[{key:"visibleRows",value:{name:"number",required:!0}}]}},name:"props"}],return:{name:"ReactNode"}}},description:""}}};const gn="_clickableRow_m64j5_1",In="_hoverableRow_m64j5_4",yn="_rowActive_m64j5_4",Cn="_expandableRow_m64j5_8",bn="_flush_m64j5_8",hn="_dragIconCell_m64j5_34",fn="_dragIcon_m64j5_34",R={clickableRow:gn,hoverableRow:In,rowActive:yn,expandableRow:Cn,flush:bn,dragIconCell:hn,dragIcon:fn},ne=({colSpan:e,children:t,flush:r})=>n.jsx("tr",{children:n.jsx("td",{colSpan:e,className:T(R.expandableRow,r?R.flush:""),children:t})});ne.__docgenInfo={description:"",methods:[],displayName:"ExpandedContentRow",props:{colSpan:{required:!0,tsType:{name:"number"},description:""},children:{required:!0,tsType:{name:"ReactNode"},description:""},flush:{required:!1,tsType:{name:"boolean"},description:""}}};const he=(e,t={leftAligned:"",rightAligned:"",centerAligned:""},r=!1)=>{if(!e)return null;const{bodyAlignment:i,headerAlignment:a,isHeader:o}=e;switch(o&&a?a:i){case h.LEFT:return r?h.LEFT:t.leftAligned;case h.RIGHT:return r?h.RIGHT:t.rightAligned;case h.CENTER:return r?h.CENTER:t.centerAligned;default:return r?h.LEFT:t.leftAligned}},_n=(e,t=!1,r=0)=>{if(!e||e.length===0)return[];const i=e.every(o=>Array.isArray(o)),a=e.every(o=>typeof o=="string");return i&&t?e[r]||[]:a?e:(console.warn("getHeaderAlignment: alignments array contains a mix of strings and arrays, returning an empty array."),[])},wn="_inputInTable_ie6ng_1",xn="_inputHover_ie6ng_13",Tn="_inputFocus_ie6ng_18",vn="_inputError_ie6ng_25",An="_inputWarning_ie6ng_26",Rn="_inputDisabled_ie6ng_61",jn="_hideScrollbars_ie6ng_67",kn="_cell_ie6ng_77",qn="_disabledLink_ie6ng_87",Nn="_inputWrapper_ie6ng_91",Sn="_numberInputWrapper_ie6ng_106",En="_breakWord_ie6ng_113",Hn="_inputCell_ie6ng_116",Ln="_sliderCell_ie6ng_119",Wn="_staticCell_ie6ng_123",Fn="_staticCellContent_ie6ng_126",Pn="_unit_ie6ng_148",Dn="_sortingCell_ie6ng_151",On="_sortingCellIcon_ie6ng_162",Bn="_icon_ie6ng_173",$n="_checkBoxCell_ie6ng_177",Mn="_iconCellWrapper_ie6ng_181",Gn="_actionsCell_ie6ng_185",Vn="_rightAligned_ie6ng_193",Un="_centerAligned_ie6ng_199",zn="_leftAligned_ie6ng_205",Kn="_popover_ie6ng_208",Xn="_disabledPointerEvents_ie6ng_211",l={inputInTable:wn,inputHover:xn,inputFocus:Tn,inputError:vn,inputWarning:An,inputDisabled:Rn,hideScrollbars:jn,cell:kn,disabledLink:qn,inputWrapper:Nn,numberInputWrapper:Sn,breakWord:En,inputCell:Hn,sliderCell:Ln,staticCell:Wn,staticCellContent:Fn,unit:Pn,sortingCell:Dn,sortingCellIcon:On,icon:Bn,checkBoxCell:$n,iconCellWrapper:Mn,actionsCell:Gn,rightAligned:Vn,centerAligned:Un,leftAligned:zn,popover:Kn,disabledPointerEvents:Xn},te=({cell:e,columnAlignment:t,testId:r,type:i})=>n.jsx($e,{name:e.name,value:e.value,onChange:a=>{var o;return(o=e.onChange)==null?void 0:o.call(e,a)},onFocus:e.onFocus,onBlur:e.onBlur,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===h.RIGHT,testId:r,tabIndex:e.disabled?-1:0,tooltip:e.tooltip,type:i});te.__docgenInfo={description:"",methods:[],displayName:"InputCell",props:{cell:{required:!0,tsType:{name:"IInputCell"},description:""},columnAlignment:{required:!1,tsType:{name:"union",raw:"Align.LEFT | Align.RIGHT | string",elements:[{name:"Align.LEFT"},{name:"Align.RIGHT"},{name:"string"}]},description:""},testId:{required:!1,tsType:{name:"string"},description:""},type:{required:!1,tsType:{name:"union",raw:"'text' | 'date'",elements:[{name:"literal",value:"'text'"},{name:"literal",value:"'date'"}]},description:""}}};const _e=({cell:e,testId:t})=>n.jsx(Me,{name:e.name,value:e.value,onChange:r=>{var i;return(i=e.onChange)==null?void 0:i.call(e,r)},onFocus:e.onFocus,onBlur:e.onBlur,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,enableCosmeticRounding:e.enableCosmeticRounding,enableDisplayRounding:e.enableDisplayRounding,roundDisplayValue:e.roundDisplayValue});_e.__docgenInfo={description:"",methods:[],displayName:"NumberInputCell",props:{cell:{required:!0,tsType:{name:"INumberInputCell"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const we=({cell:e,columnAlignment:t,testId:r})=>n.jsx(Ge,{name:e.name,borderRadius:0,options:e.options,onChange:i=>{var a;return(a=e.onChange)==null?void 0:a.call(e,i)},onCreate:e.onCreate?i=>e.onCreate&&e.onCreate(i):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,multi:e.multi,right:t===h.RIGHT,testId:r,tabIndex:e.disabled?-1:0});we.__docgenInfo={description:"",methods:[],displayName:"SelectCell",props:{cell:{required:!0,tsType:{name:"ISelectCell"},description:""},columnAlignment:{required:!1,tsType:{name:"union",raw:"Align.LEFT | Align.RIGHT | string",elements:[{name:"Align.LEFT"},{name:"Align.RIGHT"},{name:"string"}]},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const xe=({cell:e,columnAlignment:t,testId:r})=>n.jsx("div",{className:T(l.inputWrapper,e.type==="NumberInput"?l.numberInputWrapper:""),children:e.type==="Input"?n.jsx(te,{cell:e,columnAlignment:t,testId:r}):e.type==="NumberInput"?n.jsx(_e,{cell:e,testId:r}):e.type==="DateInput"?n.jsx(te,{cell:e,testId:r,type:"date"}):e.type==="Select"?n.jsx(we,{cell:e,columnAlignment:t,testId:r}):null});xe.__docgenInfo={description:"",methods:[],displayName:"InputCellWrapper",props:{cell:{required:!0,tsType:{name:"any"},description:""},columnAlignment:{required:!0,tsType:{name:"union",raw:"Align.LEFT | Align.RIGHT | string",elements:[{name:"Align.LEFT"},{name:"Align.RIGHT"},{name:"string"}]},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const Te=({cell:e,testId:t})=>{const r=S.useContext(Ve),{error:i,warning:a,tooltip:o,maxTooltipWidth:s}=e,c=d=>M(d);return n.jsx("div",{className:l.inputWrapper,children:n.jsx(ie,{error:!!i,warning:!!a,text:o||i||a,enabled:c(o)||c(i)||c(a)||!1,maxWidth:s,placement:"bottom-center",children:n.jsx("div",{className:l.staticCellContent,"data-error":i||null,"data-warning":a||null,children:n.jsx("a",{className:T((e.disabled||r)&&l.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})})})})};Te.__docgenInfo={description:"",methods:[],displayName:"LinkCell",props:{cell:{required:!0,tsType:{name:"ILinkCell"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const ve=({cell:e,testId:t})=>n.jsx(Ue,{label:e.label,checked:e.checked,isInTable:!0,disabled:e.disabled,onChange:r=>e.onChange(r),testId:t,tabIndex:e.disabled?-1:0});ve.__docgenInfo={description:"",methods:[],displayName:"CheckBoxCell",props:{cell:{required:!0,tsType:{name:"ICheckBoxCell"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const Ae=({cell:e})=>n.jsx("div",{className:l.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})});Ae.__docgenInfo={description:"",methods:[],displayName:"SliderCell",props:{cell:{required:!0,tsType:{name:"ISliderCell"},description:""}}};const Re=({cell:e})=>{const{tooltip:t,icon:r}=e;return n.jsx("div",{className:l.iconCellWrapper,children:n.jsx(ie,{text:t,enabled:!!t&&M(t),display:"flex",placement:"top-center",children:n.jsx(G,{icon:r})})})};Re.__docgenInfo={description:"",methods:[],displayName:"IconCell",props:{cell:{required:!0,tsType:{name:"IIconCell"},description:""}}};const je=({cell:e})=>n.jsx(ae,{actions:e.actions});je.__docgenInfo={description:"",methods:[],displayName:"ActionsCell",props:{cell:{required:!0,tsType:{name:"IActionCell"},description:""}}};const ke=({cell:e})=>{const{helpIcon:t}=e;return t?n.jsx("div",{className:l.icon,children:n.jsx(fe,{onClick:t.onClick,text:t.tooltip})}):null};ke.__docgenInfo={description:"",methods:[],displayName:"CellHelpIcon",props:{cell:{required:!0,tsType:{name:"IHelpIconCell"},description:""}}};const qe=({cell:e})=>{const{libraryIcon:t}=e;return t?n.jsx("div",{className:l.icon,children:n.jsx(fe,{onClick:t.onClick,text:t.tooltip,icon:$.LIBRARY})}):null};qe.__docgenInfo={description:"",methods:[],displayName:"CellLibraryIcon",props:{cell:{required:!0,tsType:{name:"ILibraryIconCell"},description:""}}};const Ne=({cell:e})=>{const{hasSort:t,sort:r,sortPriority:i}=e;return t?n.jsxs("span",{className:l.sortingCellIcon,children:[r==="down"?n.jsx(Y,{link:!0,children:n.jsx(G,{icon:$.SORT_ASCENDING})}):r==="up"?n.jsx(Y,{link:!0,children:n.jsx(G,{icon:$.SORT_DESCENDING})}):n.jsx(Y,{faint:!0,children:n.jsx(G,{icon:$.SORT_DESCENDING})}),i&&r?n.jsx("sup",{children:i}):null]}):null};Ne.__docgenInfo={description:"",methods:[],displayName:"Sort",props:{cell:{required:!0,tsType:{name:"ISortCell"},description:""}}};const oe=({cell:e,isHeader:t,testId:r})=>{const{error:i,warning:a,tooltip:o,maxTooltipWidth:s,hasSort:c,onSort:d,type:p}=e,u=n.jsxs("div",{className:T(l.staticCellContent,p==="Unit"?l.unit:""),onClick:c?y=>d&&d(y):()=>{},"data-error":i||null,"data-warning":a||null,"data-testid":r,children:[e.value,t?n.jsxs(n.Fragment,{children:[n.jsx(ke,{cell:e}),n.jsx(qe,{cell:e}),n.jsx(Ne,{cell:e})]}):null]});return n.jsx("div",{className:l.inputWrapper,children:n.jsx(ie,{error:!!i,warning:!!a,text:o||i||a,enabled:o&&M(o)||i&&M(i)||a&&M(a)||!1,maxWidth:s,display:"block",placement:"bottom-center",children:u})})};oe.__docgenInfo={description:"",methods:[],displayName:"StaticCell",props:{cell:{required:!0,tsType:{name:"IStaticCell"},description:""},isHeader:{required:!1,tsType:{name:"boolean"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const Se=({cell:e,testId:t})=>{const{content:r,fullWidth:i,closeOnOutsideClick:a,disabled:o}=e;return n.jsx(Ke,{content:r,fullWidth:i,closeOnOutsideClick:a,disabled:o,children:n.jsx("div",{className:l.popover,children:n.jsx(oe,{cell:e,testId:t})})})};Se.__docgenInfo={description:"",methods:[],displayName:"PopoverCell",props:{cell:{required:!0,tsType:{name:"IPopoverCell"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const Ee=({cell:e,isHeader:t,columnAlignment:r,testId:i})=>{if(!e)return null;switch(e.type){case"Input":case"NumberInput":case"DateInput":case"Select":return n.jsx(xe,{cell:e,columnAlignment:r,testId:i});case"Link":return n.jsx(Te,{cell:e,testId:i});case"CheckBox":return n.jsx(ve,{cell:e,testId:i});case"Slider":return n.jsx(Ae,{cell:e});case"Icon":return n.jsx(Re,{cell:e});case"Actions":return n.jsx(je,{cell:e});case"Popover":return n.jsx(Se,{cell:e});default:return n.jsx(oe,{cell:e,isHeader:t,testId:i})}};Ee.__docgenInfo={description:"",methods:[],displayName:"CellWrapper",props:{cell:{required:!0,tsType:{name:"any"},description:""},isHeader:{required:!0,tsType:{name:"boolean"},description:""},columnAlignment:{required:!0,tsType:{name:"union",raw:"Align.LEFT | Align.RIGHT | string",elements:[{name:"Align.LEFT"},{name:"Align.RIGHT"},{name:"string"}]},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};var j=(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))(j||{});const re=({cell:e,isHeader:t,columnHeaderAlignment:r,columnAlignment:i=h.LEFT,width:a,snapshot:o,testId:s})=>{if(!e)return null;const{style:c,colSpan:d,rowSpan:p,width:u}=e,y=S.useRef(null),I={bodyAlignment:i,headerAlignment:r,isHeader:t},W=he(I,l),f=he(I,l,!0),F=e.type===j.INPUT||e.type===j.NUMBER_INPUT||e.type===j.SELECT||e.type===j.POPOVER?l.inputCell:e.type===j.SLIDER?l.sliderCell:e.type===j.CHECKBOX?l.checkBoxCell:e.type===j.ACTIONS?l.actionsCell:l.staticCell,v=T(l.cell,F,e.hasSort?l.sortingCell:null,W,e.breakWord?l.breakWord:""),E=u??a??((o==null?void 0:o.isDragging)&&y.current&&y.current.offsetWidth)??void 0,_={width:E,minWidth:E,...c},A=t?"th":"td";return n.jsx(A,{ref:y,className:v,style:_,colSpan:d,rowSpan:p,children:n.jsx(Ee,{cell:e,columnAlignment:f??h.RIGHT,isHeader:t,testId:s})})};re.__docgenInfo={description:"",methods:[],displayName:"Cell",props:{cell:{required:!1,tsType:{name:"union",raw:`| IPopoverCell
|
|
1
|
+
import{j as n}from"./jsx-runtime-eps93zm2.js";import{r as S}from"./index-DhsZuJvc.js";import{c as T}from"./index-Bk2sglWO.js";import{I as Le,D as We,C as Fe,P as Pe}from"./index.es-DazXb-ul.js";import{l as De}from"./lodash-c4VUpsOs.js";import{A as ae}from"./actions-Bax0KeqM.js";import{H as Oe}from"./heading-CRNoBc7q.js";import{P as Be}from"./pagination-CR1nxnnq.js";import{A as h,I as $}from"./common-types-Sih75Sav.js";import{I as $e}from"./input-Db9WkmPP.js";import{N as Me}from"./number-input-B3_gmeWr.js";import{S as Ge}from"./select-Cwks-WA0.js";import{D as Ve}from"./disabled-context-rmpd7YJS.js";import{i as M}from"./types-Dx2TtIG9.js";import{T as ie}from"./tooltip-1V7clEnw.js";import{C as Ue}from"./check-box-DPLaOkRR.js";import{S as ze}from"./slider-CcpE4BLD.js";import{I as G}from"./icon-BSFY3vDO.js";import{P as Ke}from"./popover-C_2P8LFJ.js";import{H as fe}from"./help-icon-Buhx5nl6.js";import{T as Y}from"./text-B3-TSWok.js";const Xe="_inputInTable_1dg3w_1",Ye="_inputHover_1dg3w_13",Je="_inputFocus_1dg3w_18",Qe="_inputError_1dg3w_25",Ze="_inputWarning_1dg3w_26",en="_inputDisabled_1dg3w_61",nn="_hideScrollbars_1dg3w_67",tn="_wrapper_1dg3w_85",rn="_bordered_1dg3w_93",an="_scroll_1dg3w_98",on="_table_1dg3w_108",sn="_striped_1dg3w_188",L={inputInTable:Xe,inputHover:Ye,inputFocus:Je,inputError:Qe,inputWarning:Ze,inputDisabled:en,hideScrollbars:nn,wrapper:tn,bordered:rn,scroll:an,table:on,striped:sn},ln="_title_zn5s7_1",dn={title:ln},Q=({name:e=null,actions:t=null,actionsRight:r=!1,testId:i})=>{const a=e!==null,o=t!==null;if(!a&&!o)return null;const s=()=>{if(!o)return null;const c=n.jsx(ae,{actions:t});return r?c:n.jsx("div",{children:c})};return n.jsxs("div",{className:dn.title,children:[a?n.jsx(Oe,{children:n.jsx("span",{"data-testid":i,children:e})}):null,s()]})};Q.__docgenInfo={description:"",methods:[],displayName:"Title",props:{name:{required:!1,tsType:{name:"union",raw:"TStringOrNumber | ReactNode",elements:[{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},{name:"ReactNode"}]},description:"",defaultValue:{value:"null",computed:!1}},actions:{required:!1,tsType:{name:"any"},description:"",defaultValue:{value:"null",computed:!1}},actionsRight:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},testId:{required:!1,tsType:{name:"string"},description:""}}};const un="_footer_4sumy_1",cn="_section_4sumy_7",J={footer:un,section:cn},Z=({colSpan:e,pagination:t,actions:r,content:i})=>{const a=r&&r.length,o=i!=null,s=()=>{var d,p;if(t){const{rowCount:u,rowsPerPage:y}=t,I=Number((p=(d=y==null?void 0:y.options)==null?void 0:d[0])==null?void 0:p.value);return u>I}return!1};return a||o||s()?n.jsxs("div",{className:J.footer,children:[o?n.jsx("div",{className:J.section,children:n.jsx("div",{children:i})}):null,a||s()?n.jsxs("div",{className:J.section,children:[s()?n.jsx(Be,{pagination:t}):n.jsx("div",{}),a&&n.jsx("div",{children:n.jsx(ae,{actions:r})})]}):null]}):null};Z.__docgenInfo={description:"",methods:[],displayName:"Footer",props:{colSpan:{required:!1,tsType:{name:"number"},description:""},pagination:{required:!0,tsType:{name:"IPagination"},description:""},actions:{required:!1,tsType:{name:"Array",elements:[{name:"IAction"}],raw:"IAction[]"},description:""},content:{required:!1,tsType:{name:"ReactNode"},description:""}}};const Ce=e=>{const t=Math.max(...e.reduce((r,i)=>{const a=i.cells.map(o=>o.colSpan?o.colSpan:1).reduce((o,s)=>o+s,0);return r.concat(a)},[]));return isNaN(t)?0:t},pn=(e,t)=>{const r=[Ce(t),Ce(e)];return Math.max(...r)},be=e=>e.reduce((t,r)=>r.actions&&r.actions.length>0?1:t,0),mn=(e,t)=>be(t)>0||be(e)>0,ee=({table:e,children:t})=>{const{rows:r,infiniteScroll:i}=e,a=Math.ceil(window.innerHeight/30),[o,s]=i?S.useState(a):[r.length,null],[c,d]=i?S.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:L.scroll,children:i?n.jsx(Le,{dataLength:Math.min(r.length,o+a),next:p,hasMore:c,scrollableTarget:"scrollWrapper",style:{overflow:"initial"},loader:null,children:t({visibleRows:o})}):t({visibleRows:o})})};ee.__docgenInfo={description:"",methods:[],displayName:"TableScrollWrapper",props:{table:{required:!0,tsType:{name:"ITableProps"},description:""},children:{required:!0,tsType:{name:"signature",type:"function",raw:"(props: { visibleRows: number }) => ReactNode",signature:{arguments:[{type:{name:"signature",type:"object",raw:"{ visibleRows: number }",signature:{properties:[{key:"visibleRows",value:{name:"number",required:!0}}]}},name:"props"}],return:{name:"ReactNode"}}},description:""}}};const gn="_clickableRow_m64j5_1",In="_hoverableRow_m64j5_4",yn="_rowActive_m64j5_4",Cn="_expandableRow_m64j5_8",bn="_flush_m64j5_8",hn="_dragIconCell_m64j5_34",fn="_dragIcon_m64j5_34",R={clickableRow:gn,hoverableRow:In,rowActive:yn,expandableRow:Cn,flush:bn,dragIconCell:hn,dragIcon:fn},ne=({colSpan:e,children:t,flush:r})=>n.jsx("tr",{children:n.jsx("td",{colSpan:e,className:T(R.expandableRow,r?R.flush:""),children:t})});ne.__docgenInfo={description:"",methods:[],displayName:"ExpandedContentRow",props:{colSpan:{required:!0,tsType:{name:"number"},description:""},children:{required:!0,tsType:{name:"ReactNode"},description:""},flush:{required:!1,tsType:{name:"boolean"},description:""}}};const he=(e,t={leftAligned:"",rightAligned:"",centerAligned:""},r=!1)=>{if(!e)return null;const{bodyAlignment:i,headerAlignment:a,isHeader:o}=e;switch(o&&a?a:i){case h.LEFT:return r?h.LEFT:t.leftAligned;case h.RIGHT:return r?h.RIGHT:t.rightAligned;case h.CENTER:return r?h.CENTER:t.centerAligned;default:return r?h.LEFT:t.leftAligned}},_n=(e,t=!1,r=0)=>{if(!e||e.length===0)return[];const i=e.every(o=>Array.isArray(o)),a=e.every(o=>typeof o=="string");return i&&t?e[r]||[]:a?e:(console.warn("getHeaderAlignment: alignments array contains a mix of strings and arrays, returning an empty array."),[])},wn="_inputInTable_ie6ng_1",xn="_inputHover_ie6ng_13",Tn="_inputFocus_ie6ng_18",vn="_inputError_ie6ng_25",An="_inputWarning_ie6ng_26",Rn="_inputDisabled_ie6ng_61",jn="_hideScrollbars_ie6ng_67",kn="_cell_ie6ng_77",qn="_disabledLink_ie6ng_87",Nn="_inputWrapper_ie6ng_91",Sn="_numberInputWrapper_ie6ng_106",En="_breakWord_ie6ng_113",Hn="_inputCell_ie6ng_116",Ln="_sliderCell_ie6ng_119",Wn="_staticCell_ie6ng_123",Fn="_staticCellContent_ie6ng_126",Pn="_unit_ie6ng_148",Dn="_sortingCell_ie6ng_151",On="_sortingCellIcon_ie6ng_162",Bn="_icon_ie6ng_173",$n="_checkBoxCell_ie6ng_177",Mn="_iconCellWrapper_ie6ng_181",Gn="_actionsCell_ie6ng_185",Vn="_rightAligned_ie6ng_193",Un="_centerAligned_ie6ng_199",zn="_leftAligned_ie6ng_205",Kn="_popover_ie6ng_208",Xn="_disabledPointerEvents_ie6ng_211",l={inputInTable:wn,inputHover:xn,inputFocus:Tn,inputError:vn,inputWarning:An,inputDisabled:Rn,hideScrollbars:jn,cell:kn,disabledLink:qn,inputWrapper:Nn,numberInputWrapper:Sn,breakWord:En,inputCell:Hn,sliderCell:Ln,staticCell:Wn,staticCellContent:Fn,unit:Pn,sortingCell:Dn,sortingCellIcon:On,icon:Bn,checkBoxCell:$n,iconCellWrapper:Mn,actionsCell:Gn,rightAligned:Vn,centerAligned:Un,leftAligned:zn,popover:Kn,disabledPointerEvents:Xn},te=({cell:e,columnAlignment:t,testId:r,type:i})=>n.jsx($e,{name:e.name,value:e.value,onChange:a=>{var o;return(o=e.onChange)==null?void 0:o.call(e,a)},onFocus:e.onFocus,onBlur:e.onBlur,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===h.RIGHT,testId:r,tabIndex:e.disabled?-1:0,tooltip:e.tooltip,type:i});te.__docgenInfo={description:"",methods:[],displayName:"InputCell",props:{cell:{required:!0,tsType:{name:"IInputCell"},description:""},columnAlignment:{required:!1,tsType:{name:"union",raw:"Align.LEFT | Align.RIGHT | string",elements:[{name:"Align.LEFT"},{name:"Align.RIGHT"},{name:"string"}]},description:""},testId:{required:!1,tsType:{name:"string"},description:""},type:{required:!1,tsType:{name:"union",raw:"'text' | 'date'",elements:[{name:"literal",value:"'text'"},{name:"literal",value:"'date'"}]},description:""}}};const _e=({cell:e,testId:t})=>n.jsx(Me,{name:e.name,value:e.value,onChange:r=>{var i;return(i=e.onChange)==null?void 0:i.call(e,r)},onFocus:e.onFocus,onBlur:e.onBlur,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,enableCosmeticRounding:e.enableCosmeticRounding,enableDisplayRounding:e.enableDisplayRounding,roundDisplayValue:e.roundDisplayValue});_e.__docgenInfo={description:"",methods:[],displayName:"NumberInputCell",props:{cell:{required:!0,tsType:{name:"INumberInputCell"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const we=({cell:e,columnAlignment:t,testId:r})=>n.jsx(Ge,{name:e.name,borderRadius:0,options:e.options,onChange:i=>{var a;return(a=e.onChange)==null?void 0:a.call(e,i)},onCreate:e.onCreate?i=>e.onCreate&&e.onCreate(i):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,multi:e.multi,right:t===h.RIGHT,testId:r,tabIndex:e.disabled?-1:0});we.__docgenInfo={description:"",methods:[],displayName:"SelectCell",props:{cell:{required:!0,tsType:{name:"ISelectCell"},description:""},columnAlignment:{required:!1,tsType:{name:"union",raw:"Align.LEFT | Align.RIGHT | string",elements:[{name:"Align.LEFT"},{name:"Align.RIGHT"},{name:"string"}]},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const xe=({cell:e,columnAlignment:t,testId:r})=>n.jsx("div",{className:T(l.inputWrapper,e.type==="NumberInput"?l.numberInputWrapper:""),children:e.type==="Input"?n.jsx(te,{cell:e,columnAlignment:t,testId:r}):e.type==="NumberInput"?n.jsx(_e,{cell:e,testId:r}):e.type==="DateInput"?n.jsx(te,{cell:e,testId:r,type:"date"}):e.type==="Select"?n.jsx(we,{cell:e,columnAlignment:t,testId:r}):null});xe.__docgenInfo={description:"",methods:[],displayName:"InputCellWrapper",props:{cell:{required:!0,tsType:{name:"any"},description:""},columnAlignment:{required:!0,tsType:{name:"union",raw:"Align.LEFT | Align.RIGHT | string",elements:[{name:"Align.LEFT"},{name:"Align.RIGHT"},{name:"string"}]},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const Te=({cell:e,testId:t})=>{const r=S.useContext(Ve),{error:i,warning:a,tooltip:o,maxTooltipWidth:s}=e,c=d=>M(d);return n.jsx("div",{className:l.inputWrapper,children:n.jsx(ie,{error:!!i,warning:!!a,text:o||i||a,enabled:c(o)||c(i)||c(a)||!1,maxWidth:s,placement:"bottom-center",children:n.jsx("div",{className:l.staticCellContent,"data-error":i||null,"data-warning":a||null,children:n.jsx("a",{className:T((e.disabled||r)&&l.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})})})})};Te.__docgenInfo={description:"",methods:[],displayName:"LinkCell",props:{cell:{required:!0,tsType:{name:"ILinkCell"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const ve=({cell:e,testId:t})=>n.jsx(Ue,{label:e.label,checked:e.checked,isInTable:!0,disabled:e.disabled,onChange:r=>e.onChange(r),testId:t,tabIndex:e.disabled?-1:0});ve.__docgenInfo={description:"",methods:[],displayName:"CheckBoxCell",props:{cell:{required:!0,tsType:{name:"ICheckBoxCell"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const Ae=({cell:e})=>n.jsx("div",{className:l.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})});Ae.__docgenInfo={description:"",methods:[],displayName:"SliderCell",props:{cell:{required:!0,tsType:{name:"ISliderCell"},description:""}}};const Re=({cell:e})=>{const{tooltip:t,icon:r}=e;return n.jsx("div",{className:l.iconCellWrapper,children:n.jsx(ie,{text:t,enabled:!!t&&M(t),display:"flex",placement:"top-center",children:n.jsx(G,{icon:r})})})};Re.__docgenInfo={description:"",methods:[],displayName:"IconCell",props:{cell:{required:!0,tsType:{name:"IIconCell"},description:""}}};const je=({cell:e})=>n.jsx(ae,{actions:e.actions});je.__docgenInfo={description:"",methods:[],displayName:"ActionsCell",props:{cell:{required:!0,tsType:{name:"IActionCell"},description:""}}};const ke=({cell:e})=>{const{helpIcon:t}=e;return t?n.jsx("div",{className:l.icon,children:n.jsx(fe,{onClick:t.onClick,text:t.tooltip})}):null};ke.__docgenInfo={description:"",methods:[],displayName:"CellHelpIcon",props:{cell:{required:!0,tsType:{name:"IHelpIconCell"},description:""}}};const qe=({cell:e})=>{const{libraryIcon:t}=e;return t?n.jsx("div",{className:l.icon,children:n.jsx(fe,{onClick:t.onClick,text:t.tooltip,icon:$.LIBRARY})}):null};qe.__docgenInfo={description:"",methods:[],displayName:"CellLibraryIcon",props:{cell:{required:!0,tsType:{name:"ILibraryIconCell"},description:""}}};const Ne=({cell:e})=>{const{hasSort:t,sort:r,sortPriority:i}=e;return t?n.jsxs("span",{className:l.sortingCellIcon,children:[r==="down"?n.jsx(Y,{link:!0,children:n.jsx(G,{icon:$.SORT_ASCENDING})}):r==="up"?n.jsx(Y,{link:!0,children:n.jsx(G,{icon:$.SORT_DESCENDING})}):n.jsx(Y,{faint:!0,children:n.jsx(G,{icon:$.SORT_DESCENDING})}),i&&r?n.jsx("sup",{children:i}):null]}):null};Ne.__docgenInfo={description:"",methods:[],displayName:"Sort",props:{cell:{required:!0,tsType:{name:"ISortCell"},description:""}}};const oe=({cell:e,isHeader:t,testId:r})=>{const{error:i,warning:a,tooltip:o,maxTooltipWidth:s,hasSort:c,onSort:d,type:p}=e,u=n.jsxs("div",{className:T(l.staticCellContent,p==="Unit"?l.unit:""),onClick:c?y=>d&&d(y):()=>{},"data-error":i||null,"data-warning":a||null,"data-testid":r,children:[e.value,t?n.jsxs(n.Fragment,{children:[n.jsx(ke,{cell:e}),n.jsx(qe,{cell:e}),n.jsx(Ne,{cell:e})]}):null]});return n.jsx("div",{className:l.inputWrapper,children:n.jsx(ie,{error:!!i,warning:!!a,text:o||i||a,enabled:o&&M(o)||i&&M(i)||a&&M(a)||!1,maxWidth:s,display:"block",placement:"bottom-center",children:u})})};oe.__docgenInfo={description:"",methods:[],displayName:"StaticCell",props:{cell:{required:!0,tsType:{name:"IStaticCell"},description:""},isHeader:{required:!1,tsType:{name:"boolean"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const Se=({cell:e,testId:t})=>{const{content:r,fullWidth:i,closeOnOutsideClick:a,disabled:o}=e;return n.jsx(Ke,{content:r,fullWidth:i,closeOnOutsideClick:a,disabled:o,children:n.jsx("div",{className:l.popover,children:n.jsx(oe,{cell:e,testId:t})})})};Se.__docgenInfo={description:"",methods:[],displayName:"PopoverCell",props:{cell:{required:!0,tsType:{name:"IPopoverCell"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const Ee=({cell:e,isHeader:t,columnAlignment:r,testId:i})=>{if(!e)return null;switch(e.type){case"Input":case"NumberInput":case"DateInput":case"Select":return n.jsx(xe,{cell:e,columnAlignment:r,testId:i});case"Link":return n.jsx(Te,{cell:e,testId:i});case"CheckBox":return n.jsx(ve,{cell:e,testId:i});case"Slider":return n.jsx(Ae,{cell:e});case"Icon":return n.jsx(Re,{cell:e});case"Actions":return n.jsx(je,{cell:e});case"Popover":return n.jsx(Se,{cell:e});default:return n.jsx(oe,{cell:e,isHeader:t,testId:i})}};Ee.__docgenInfo={description:"",methods:[],displayName:"CellWrapper",props:{cell:{required:!0,tsType:{name:"any"},description:""},isHeader:{required:!0,tsType:{name:"boolean"},description:""},columnAlignment:{required:!0,tsType:{name:"union",raw:"Align.LEFT | Align.RIGHT | string",elements:[{name:"Align.LEFT"},{name:"Align.RIGHT"},{name:"string"}]},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};var j=(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))(j||{});const re=({cell:e,isHeader:t,columnHeaderAlignment:r,columnAlignment:i=h.LEFT,width:a,snapshot:o,testId:s})=>{if(!e)return null;const{style:c,colSpan:d,rowSpan:p,width:u}=e,y=S.useRef(null),I={bodyAlignment:i,headerAlignment:r,isHeader:t},W=he(I,l),f=he(I,l,!0),F=e.type===j.INPUT||e.type===j.NUMBER_INPUT||e.type===j.SELECT||e.type===j.POPOVER?l.inputCell:e.type===j.SLIDER?l.sliderCell:e.type===j.CHECKBOX?l.checkBoxCell:e.type===j.ACTIONS?l.actionsCell:l.staticCell,v=T(l.cell,F,e.hasSort?l.sortingCell:null,W,e.breakWord?l.breakWord:""),E=u??a??((o==null?void 0:o.isDragging)&&y.current&&y.current.offsetWidth)??void 0,_={width:E,minWidth:E,...c},A=t?"th":"td";return n.jsx(A,{ref:y,className:v,style:_,colSpan:d,rowSpan:p,children:n.jsx(Ee,{cell:e,columnAlignment:f??h.RIGHT,isHeader:t,testId:s})})};re.__docgenInfo={description:"",methods:[],displayName:"Cell",props:{cell:{required:!1,tsType:{name:"union",raw:`| IPopoverCell
|
|
2
2
|
| IStaticCell
|
|
3
3
|
| ISelectCell
|
|
4
4
|
| IHelpIconCell
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as n}from"./jsx-runtime-eps93zm2.js";import{r as S}from"./index-DhsZuJvc.js";import{f as ne}from"./immer.esm-BwVl9PS2.js";import{l as Z}from"./lodash-c4VUpsOs.js";import{G as le}from"./grid-DRkC-bt8.js";import{T as W}from"./text-B3-TSWok.js";import{T as D}from"./table-Bl5BWKeT.js";import{C as dn}from"./card-EcjmryU9.js";import{I as se}from"./input-Db9WkmPP.js";import{F as oe}from"./field-C5_fLDpy.js";import{H as un}from"./heading-NkLgQYoP.js";import{t as ae,x as pn,y as mn,z as gn,A as bn,B as hn,C as wn,D as yn}from"./table.stories-data-CElcAZ7Y.js";import"./styled-components.browser.esm-BQ9GQzDc.js";import"./index-Bk2sglWO.js";import"./index.es-D2piFfFj.js";import"./inheritsLoose-DR8r8Ogv.js";import"./extends-CF3RwP-h.js";import"./redux-tRgGMjwY.js";import"./objectSpread2-DW4nTBoq.js";import"./tiny-invariant-DqLgxztJ.js";import"./index-CUZDtIZe.js";import"./memoize-one.esm-CcMeOnPo.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./actions-KLRbmKRF.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./button-CjbZ5CrF.js";import"./spinner-AWUe4xwQ.js";import"./icon-BP4BO6-k.js";import"./index-CEuq6vkz.js";import"./tooltip-1V7clEnw.js";import"./types-BmbYqTX_.js";import"./types-Dx2TtIG9.js";import"./badge-CLQ59MDF.js";import"./pagination-CiGr3h9N.js";import"./select-B3sB0hqr.js";import"./enum-Bnn40S8Q.js";import"./assertThisInitialized-B9jnkVVz.js";import"./select.input-CJed_LLR.js";import"./helpers-JJxzGegQ.js";import"./input-group-BaRSJAEN.js";import"./input-group-addon-D68iUKV2.js";import"./number-input-CNnU6gOF.js";import"./index-C0x1JmaP.js";import"./index-DRSy5Ssd.js";import"./check-box-wCvXxtCz.js";import"./help-icon-41R-Z9N1.js";import"./slider-CSesKEJF.js";import"./index-BI4_Bp97.js";import"./popover-C9ygeajM.js";import"./label-hiSz3I8H.js";import"./flex-EllkLxgO.js";const wt={title:"Basic/Table",component:D,args:{table:{...ae}}},A=h=>n.jsx(D,{...h}),te=A.bind({}),E=A.bind({});E.args={table:{...ae,fixedWidth:"400px"}};const L=A.bind({});L.args={table:{...ae,fixedWidth:"auto"}};const _=A.bind({});_.args={table:pn};_.parameters={docs:{description:{story:"Use sparingly when certain columns cannot be below a certain width. Unless the Table is auto width, set one column to `auto` to use remaining space."}}};const Q=A.bind({});Q.args={table:mn};const O=A.bind({});O.args={table:gn};O.parameters={docs:{description:{story:"This is only required when you need to override `columnAlignment` in header cells (i.e. they have different alignment)"}}};const G=A.bind({});G.args={table:bn};const N=A.bind({});N.args={table:hn};N.decorators=[h=>n.jsx("div",{style:{position:"absolute",inset:0,padding:"var(--padding)"},children:n.jsx(h,{})})];const U=A.bind({});U.args={table:wn};U.parameters={docs:{description:{story:"If a `maxHeight` is set, the table should only fill that height if it needs to."}}};const $=A.bind({});$.args={table:yn};const M=()=>n.jsx(dn,{heading:n.jsx(un,{children:"Card heading"}),padding:!1,children:n.jsx(D,{table:{...ae,bordered:!1}})});M.parameters={docs:{source:{type:"dynamic"}}};const q=()=>{const h=["Section","Width","Height"];let g=["","m","m"],o=[...Array(175).keys()].map((l,t)=>[t,t*2,t*2]);const x=(l,t,r)=>l==="m"&&t==="ft"?r*3.28084:l==="ft"&&t==="m"?r/3.28084:r,i=(l,t,r,c)=>{o[t][r]=l.target.value,c()},R=l=>{o=o.concat([["","",""]]),l()},k=(l,t)=>{o=o.filter((r,c)=>c!==l),t()},p=(l,t,r)=>{const c=g[t],b=l.target.value;g=g.map((y,s)=>s===t?b:y),o=o.map(y=>y.map((s,u)=>u===t?x(c,b,s):s)),r()},w=()=>{const l=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[t,r]=S.useState(10),[c,b]=S.useState(1),[y,s]=S.useState(!1),u=()=>{s(!y)},j=()=>{const e=Math.ceil(o.length/t);b(e)},T=(c-1)*t,a=t===0?o.length-1:T+t,m={headers:[{cells:h.map(e=>({value:e})),actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{R(u),j()}}]},{cells:[{},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:g[1],type:"Select",native:!0,onChange:e=>p(e,1,u)},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:g[2],type:"Select",native:!0,onChange:e=>p(e,2,u)}]}],rows:o.slice(T,a).map((e,d)=>{const I=T+d;return{cells:[...Array(3).keys()].map((P,v)=>({value:e[v],type:"Input",onChange:C=>i(C,I,v,u)})),actions:[{label:"Delete",icon:"minus",onClick:()=>k(I,u)}]}}),footer:{pagination:{rowCount:o.length,selectedPage:c,rowsPerPage:{onChange:e=>{const{value:d}=e.target;r(Number(d))},options:l,value:t},onSelectPage:e=>b(e),small:!0}}};return n.jsx(D,{table:m})};return n.jsx(w,{})},K=()=>{const h=["Section","Width","Height"];let g=[...Array(20).keys()].map((x,i)=>({Section:Z.random(0,100),Width:Z.random(0,100),Height:Z.random(0,100)}));const o=()=>{const[x,i]=S.useState({Section:"up"}),R=(r,c)=>r.sort((b,y)=>Object.entries(c).map(([s,u])=>{switch(u){case"up":return b[s]-y[s];case"down":return y[s]-b[s];default:return 0}}).reduce((s,u)=>s||u,0)),k=(r,c,b)=>({dataSortCells:r.map(s=>{const u=Object.keys(c).includes(s)?c[s]:"",j=`${s[0].toUpperCase()}${s.slice(1)}`;return{key:s,value:j,hasSort:!0,sort:u,onSort:()=>{const T=u==="up"?"down":"up";b({[s]:T})}}})}),{dataSortCells:p}=k(h,x,i),l=[...R(g,x).map(r=>({cells:Object.entries(r).map(([b,y])=>({key:b,value:y,type:"Input",disabled:!0}))}))],t={headers:[{cells:p}],rows:l};return n.jsx(D,{table:t})};return n.jsx(o,{})},B=()=>{const h=["Section","Width","Height"];let g=[...Array(175).keys()].map((x,i)=>({Section:i,Width:i*2,Height:i*2}));const o=()=>{const x=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[i,R]=S.useState(10),[k,p]=S.useState(1),[w,l]=S.useState({}),[t,r]=S.useState({});S.useEffect(()=>{p(1)},[w,t]);const c=(k-1)*i,b=i===0?g.length-1:c+i,y=(e,d,I)=>e.filter(P=>Object.keys(d).every(v=>d[v]===""?!0:P[v].toString().includes(d[v]))).sort((P,v)=>Object.entries(I).map(([C,H])=>{switch(H){case"up":return P[C]-v[C];case"down":return v[C]-P[C];default:return 0}}).reduce((C,H)=>C||H,0)),s=(e,d,I,P,v)=>{const C=e.map(f=>{const V=Object.keys(P).includes(f)?P[f]:"",F=`${f[0].toUpperCase()}${f.slice(1)}`;return{key:f,value:F,hasSort:!0,sort:V,onSort:()=>{const ee=V===""?"up":V==="up"?"down":"";v({...P,[f]:ee})}}}),H=e.map(f=>{const V=Object.keys(d).includes(f)?d[f]:"";return{key:f,value:V,type:"Input",placeholder:"Filter",onChange:F=>I({...d,[f]:F.target.value})}});return{dataSortCells:C,dataFilterCells:H}},{dataSortCells:u,dataFilterCells:j}=s(h,w,l,t,r),T=y(g,w,t),a=[...T.slice(c,b).map(e=>({cells:Object.entries(e).map(([I,P])=>({key:I,value:P,type:"Input",disabled:!0}))}))],m={headers:[{cells:u},{cells:j}],rows:a,footer:{pagination:{rowCount:T.length,selectedPage:k,rowsPerPage:{onChange:e=>{const{value:d}=e.target;R(Number(d))},options:x,value:i},onSelectPage:e=>p(e),small:!0}}};return n.jsx(D,{table:m})};return n.jsx(o,{})},z=()=>{const h={tea:3.6,coffee:3.2,orange:4.1},g=[{label:"Tea",value:"tea"},{label:"Coffee",value:"coffee"},{label:"Orange juice",value:"orange"}],o={cells:[{type:"Select",options:g,value:{value:"tea"}},{type:"Input"},{type:"Static"}]},x=[...Array(15).keys()].map((a,m)=>({cells:[{type:"Select",options:g,value:{value:"tea"}},{type:"Input",value:m+1},{type:"Static"}]})),[i,R]=S.useState(x),k=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[p,w]=S.useState(10),[l,t]=S.useState(1),r=(l-1)*p,c=p===0?i.length-1:r+p,b=({newRow:a}={})=>{const m=ne(i,e=>{e.push(a??o)});R(m)},y=({rowIndex:a})=>{const m=ne(i,e=>{delete e[a]}).filter(e=>e);R(m)},s=({rowIndex:a,value:m})=>{const e=ne(i,d=>{d[a].cells[0].value.value=m});R(e)},u=({rowIndex:a,value:m})=>{const e=ne(i,d=>{d[a].cells[1].value=m});R(e)},j=({value:a})=>{const m=Number(a);return!Z.isNaN(m)&&Z.isInteger(m)&&m>0},T=i.slice(r,c).map((a,m)=>{const e=r+m;return i.length-1,{...a,cells:a==null?void 0:a.cells.map((d,I)=>{var f,V,F,ee,ie;const P=(F=(V=(f=a==null?void 0:a.cells)==null?void 0:f[0])==null?void 0:V.value)==null?void 0:F.value,v=Number((ie=(ee=a==null?void 0:a.cells)==null?void 0:ee[1])==null?void 0:ie.value),C=h==null?void 0:h[P],H=C&&j({value:v})?(C*v).toFixed(2):null;if(I===0)return{...d,onChange:re=>s({rowIndex:e,value:re.target.value})};if(I===1)return{...d,onChange:re=>u({rowIndex:e,value:re.target.value}),error:j({value:d.value})?null:"Must be valid whole number"};if(I===2)return{...d,value:H}}),actions:[{label:"Delete",icon:"minus",onClick:()=>y({rowIndex:e})}]}});return n.jsx(D,{table:{defaultEmptyRow:o,onAddRow:b,columnAlignment:["left","right","right"],headers:[{cells:[{value:"Drink"},{value:"Quantity"},{value:"Total Price (£)"}],actions:[{primary:!0,icon:"plus",label:"Add",onClick:()=>b()}]}],rows:T,footer:{pagination:{rowCount:i.length,selectedPage:l,rowsPerPage:{onChange:a=>{const{value:m}=a.target;w(Number(m))},options:k,value:p},onSelectPage:a=>t(a),small:!0}}}})},J=()=>{const h=["Section","Width","Height"];let g=Array.from(Array(10),(p,w)=>[w,w*2,w*2]);const[o,x]=S.useState({pastedValues:"",rowIndex:0,cellIndex:0}),i=(p,w,l,t)=>{g[w][l]=Number(p.target.value),t()},R=(p,w,l,t)=>{var c;let r=((c=p==null?void 0:p.clipboardData)==null?void 0:c.getData("text"))??"";return x({rowIndex:w,cellIndex:l,pastedValues:r}),t(),{pastedData:o}},k=()=>{const[p,w]=S.useState(!1),l=()=>{w(!p)},t={headers:[{cells:h.map(r=>({value:r}))}],rows:g.map((r,c)=>{const b=c;return{cells:[...Array(3).keys()].map((y,s)=>({value:r[s],type:"Input",onChange:u=>i(u,b,s,l),onPaste:u=>R(u,b,s,l)}))}})};return n.jsxs(n.Fragment,{children:[n.jsx(D,{table:t}),n.jsx(oe,{label:"Pasted Data",children:n.jsx(se,{value:o.pastedValues})}),n.jsx(oe,{label:"At Row",children:n.jsx(se,{value:o.rowIndex})}),n.jsx(oe,{label:"At Cell Index",children:n.jsx(se,{value:o.cellIndex})})]})};return n.jsx(k,{})},X=()=>{const h={fixedWidth:"auto",name:"Table title",actions:[{icon:"download",tooltip:"Download"}],columnAlignment:[...Array(10)].map((g,o)=>"right"),headers:[{cells:[...Array(10)].map((g,o)=>({value:"Heading"}))},{cells:[...Array(10)].map((g,o)=>({options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],type:"Select",searchable:!1,value:{label:"m",value:"m"},autoLayerWidth:!0}))}],rows:[...Array(10)].map((g,o)=>({cells:[...Array(10)].map((x,i)=>({value:123.45})),actions:[{icon:"help",tooltip:n.jsxs(le,{children:[n.jsx(W,{bold:!0,children:"Title goes here lorem ipsum"}),n.jsx(W,{children:"Label: 123.45m"}),n.jsx(W,{children:"Another label: 123.45m"}),n.jsx(W,{children:"Label: 123.45m"})]})}]}))};return n.jsx(D,{table:h})},Y=()=>{const h={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(le,{children:[n.jsx(W,{bold:!0,children:"Title goes here"}),n.jsx(W,{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(le,{children:[n.jsx(W,{bold:!0,children:"Title goes here"}),n.jsx(W,{children:"Details go here"})]})}]}]};return n.jsx(D,{table:h})};M.__docgenInfo={description:"",methods:[],displayName:"InCard"};q.__docgenInfo={description:"",methods:[],displayName:"Managed"};K.__docgenInfo={description:"",methods:[],displayName:"ManagedWithSort"};B.__docgenInfo={description:"",methods:[],displayName:"ManagedWithFilterAndMultipleSort"};z.__docgenInfo={description:"",methods:[],displayName:"AutoAddNewRow"};J.__docgenInfo={description:"",methods:[],displayName:"OnPasteCallback"};X.__docgenInfo={description:"",methods:[],displayName:"ExampleTableWithInfoTooltips"};Y.__docgenInfo={description:"",methods:[],displayName:"ExampleTableWithInlineUnits"};var ce,de,ue;te.parameters={...te.parameters,docs:{...(ce=te.parameters)==null?void 0:ce.docs,source:{originalSource:`args => {
|
|
1
|
+
import{j as n}from"./jsx-runtime-eps93zm2.js";import{r as S}from"./index-DhsZuJvc.js";import{f as ne}from"./immer.esm-BwVl9PS2.js";import{l as Z}from"./lodash-c4VUpsOs.js";import{G as le}from"./grid-DRkC-bt8.js";import{T as W}from"./text-B3-TSWok.js";import{T as D}from"./table-DoyDBG6l.js";import{C as dn}from"./card-EcjmryU9.js";import{I as se}from"./input-Db9WkmPP.js";import{F as oe}from"./field-HrLaMLbx.js";import{H as un}from"./heading-CRNoBc7q.js";import{t as ae,x as pn,y as mn,z as gn,A as bn,B as hn,C as wn,D as yn}from"./table.stories-data-C7mC5R8Q.js";import"./styled-components.browser.esm-BQ9GQzDc.js";import"./index-Bk2sglWO.js";import"./index.es-DazXb-ul.js";import"./inheritsLoose-DP0QEDDI.js";import"./redux-tRgGMjwY.js";import"./objectSpread2-DW4nTBoq.js";import"./tiny-invariant-DqLgxztJ.js";import"./index-CUZDtIZe.js";import"./memoize-one.esm-CcMeOnPo.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./actions-Bax0KeqM.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./button-Cbv7WK6k.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./index-CEuq6vkz.js";import"./tooltip-1V7clEnw.js";import"./types-BmbYqTX_.js";import"./types-Dx2TtIG9.js";import"./badge-CLQ59MDF.js";import"./pagination-CR1nxnnq.js";import"./select-Cwks-WA0.js";import"./enum-Bnn40S8Q.js";import"./assertThisInitialized-B9jnkVVz.js";import"./select.input-CJed_LLR.js";import"./helpers-JJxzGegQ.js";import"./input-group-BaRSJAEN.js";import"./input-group-addon-D68iUKV2.js";import"./number-input-B3_gmeWr.js";import"./index-C0x1JmaP.js";import"./index-DRSy5Ssd.js";import"./check-box-DPLaOkRR.js";import"./help-icon-Buhx5nl6.js";import"./slider-CcpE4BLD.js";import"./index-BI4_Bp97.js";import"./popover-C_2P8LFJ.js";import"./label-CqmyC9he.js";import"./flex-EllkLxgO.js";const ht={title:"Basic/Table",component:D,args:{table:{...ae}}},A=h=>n.jsx(D,{...h}),te=A.bind({}),E=A.bind({});E.args={table:{...ae,fixedWidth:"400px"}};const L=A.bind({});L.args={table:{...ae,fixedWidth:"auto"}};const _=A.bind({});_.args={table:pn};_.parameters={docs:{description:{story:"Use sparingly when certain columns cannot be below a certain width. Unless the Table is auto width, set one column to `auto` to use remaining space."}}};const Q=A.bind({});Q.args={table:mn};const O=A.bind({});O.args={table:gn};O.parameters={docs:{description:{story:"This is only required when you need to override `columnAlignment` in header cells (i.e. they have different alignment)"}}};const G=A.bind({});G.args={table:bn};const N=A.bind({});N.args={table:hn};N.decorators=[h=>n.jsx("div",{style:{position:"absolute",inset:0,padding:"var(--padding)"},children:n.jsx(h,{})})];const U=A.bind({});U.args={table:wn};U.parameters={docs:{description:{story:"If a `maxHeight` is set, the table should only fill that height if it needs to."}}};const $=A.bind({});$.args={table:yn};const M=()=>n.jsx(dn,{heading:n.jsx(un,{children:"Card heading"}),padding:!1,children:n.jsx(D,{table:{...ae,bordered:!1}})});M.parameters={docs:{source:{type:"dynamic"}}};const q=()=>{const h=["Section","Width","Height"];let g=["","m","m"],o=[...Array(175).keys()].map((l,t)=>[t,t*2,t*2]);const x=(l,t,r)=>l==="m"&&t==="ft"?r*3.28084:l==="ft"&&t==="m"?r/3.28084:r,i=(l,t,r,c)=>{o[t][r]=l.target.value,c()},R=l=>{o=o.concat([["","",""]]),l()},k=(l,t)=>{o=o.filter((r,c)=>c!==l),t()},p=(l,t,r)=>{const c=g[t],b=l.target.value;g=g.map((y,s)=>s===t?b:y),o=o.map(y=>y.map((s,u)=>u===t?x(c,b,s):s)),r()},w=()=>{const l=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[t,r]=S.useState(10),[c,b]=S.useState(1),[y,s]=S.useState(!1),u=()=>{s(!y)},j=()=>{const e=Math.ceil(o.length/t);b(e)},T=(c-1)*t,a=t===0?o.length-1:T+t,m={headers:[{cells:h.map(e=>({value:e})),actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{R(u),j()}}]},{cells:[{},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:g[1],type:"Select",native:!0,onChange:e=>p(e,1,u)},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:g[2],type:"Select",native:!0,onChange:e=>p(e,2,u)}]}],rows:o.slice(T,a).map((e,d)=>{const I=T+d;return{cells:[...Array(3).keys()].map((P,v)=>({value:e[v],type:"Input",onChange:C=>i(C,I,v,u)})),actions:[{label:"Delete",icon:"minus",onClick:()=>k(I,u)}]}}),footer:{pagination:{rowCount:o.length,selectedPage:c,rowsPerPage:{onChange:e=>{const{value:d}=e.target;r(Number(d))},options:l,value:t},onSelectPage:e=>b(e),small:!0}}};return n.jsx(D,{table:m})};return n.jsx(w,{})},K=()=>{const h=["Section","Width","Height"];let g=[...Array(20).keys()].map((x,i)=>({Section:Z.random(0,100),Width:Z.random(0,100),Height:Z.random(0,100)}));const o=()=>{const[x,i]=S.useState({Section:"up"}),R=(r,c)=>r.sort((b,y)=>Object.entries(c).map(([s,u])=>{switch(u){case"up":return b[s]-y[s];case"down":return y[s]-b[s];default:return 0}}).reduce((s,u)=>s||u,0)),k=(r,c,b)=>({dataSortCells:r.map(s=>{const u=Object.keys(c).includes(s)?c[s]:"",j=`${s[0].toUpperCase()}${s.slice(1)}`;return{key:s,value:j,hasSort:!0,sort:u,onSort:()=>{const T=u==="up"?"down":"up";b({[s]:T})}}})}),{dataSortCells:p}=k(h,x,i),l=[...R(g,x).map(r=>({cells:Object.entries(r).map(([b,y])=>({key:b,value:y,type:"Input",disabled:!0}))}))],t={headers:[{cells:p}],rows:l};return n.jsx(D,{table:t})};return n.jsx(o,{})},B=()=>{const h=["Section","Width","Height"];let g=[...Array(175).keys()].map((x,i)=>({Section:i,Width:i*2,Height:i*2}));const o=()=>{const x=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[i,R]=S.useState(10),[k,p]=S.useState(1),[w,l]=S.useState({}),[t,r]=S.useState({});S.useEffect(()=>{p(1)},[w,t]);const c=(k-1)*i,b=i===0?g.length-1:c+i,y=(e,d,I)=>e.filter(P=>Object.keys(d).every(v=>d[v]===""?!0:P[v].toString().includes(d[v]))).sort((P,v)=>Object.entries(I).map(([C,H])=>{switch(H){case"up":return P[C]-v[C];case"down":return v[C]-P[C];default:return 0}}).reduce((C,H)=>C||H,0)),s=(e,d,I,P,v)=>{const C=e.map(f=>{const V=Object.keys(P).includes(f)?P[f]:"",F=`${f[0].toUpperCase()}${f.slice(1)}`;return{key:f,value:F,hasSort:!0,sort:V,onSort:()=>{const ee=V===""?"up":V==="up"?"down":"";v({...P,[f]:ee})}}}),H=e.map(f=>{const V=Object.keys(d).includes(f)?d[f]:"";return{key:f,value:V,type:"Input",placeholder:"Filter",onChange:F=>I({...d,[f]:F.target.value})}});return{dataSortCells:C,dataFilterCells:H}},{dataSortCells:u,dataFilterCells:j}=s(h,w,l,t,r),T=y(g,w,t),a=[...T.slice(c,b).map(e=>({cells:Object.entries(e).map(([I,P])=>({key:I,value:P,type:"Input",disabled:!0}))}))],m={headers:[{cells:u},{cells:j}],rows:a,footer:{pagination:{rowCount:T.length,selectedPage:k,rowsPerPage:{onChange:e=>{const{value:d}=e.target;R(Number(d))},options:x,value:i},onSelectPage:e=>p(e),small:!0}}};return n.jsx(D,{table:m})};return n.jsx(o,{})},z=()=>{const h={tea:3.6,coffee:3.2,orange:4.1},g=[{label:"Tea",value:"tea"},{label:"Coffee",value:"coffee"},{label:"Orange juice",value:"orange"}],o={cells:[{type:"Select",options:g,value:{value:"tea"}},{type:"Input"},{type:"Static"}]},x=[...Array(15).keys()].map((a,m)=>({cells:[{type:"Select",options:g,value:{value:"tea"}},{type:"Input",value:m+1},{type:"Static"}]})),[i,R]=S.useState(x),k=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[p,w]=S.useState(10),[l,t]=S.useState(1),r=(l-1)*p,c=p===0?i.length-1:r+p,b=({newRow:a}={})=>{const m=ne(i,e=>{e.push(a??o)});R(m)},y=({rowIndex:a})=>{const m=ne(i,e=>{delete e[a]}).filter(e=>e);R(m)},s=({rowIndex:a,value:m})=>{const e=ne(i,d=>{d[a].cells[0].value.value=m});R(e)},u=({rowIndex:a,value:m})=>{const e=ne(i,d=>{d[a].cells[1].value=m});R(e)},j=({value:a})=>{const m=Number(a);return!Z.isNaN(m)&&Z.isInteger(m)&&m>0},T=i.slice(r,c).map((a,m)=>{const e=r+m;return i.length-1,{...a,cells:a==null?void 0:a.cells.map((d,I)=>{var f,V,F,ee,ie;const P=(F=(V=(f=a==null?void 0:a.cells)==null?void 0:f[0])==null?void 0:V.value)==null?void 0:F.value,v=Number((ie=(ee=a==null?void 0:a.cells)==null?void 0:ee[1])==null?void 0:ie.value),C=h==null?void 0:h[P],H=C&&j({value:v})?(C*v).toFixed(2):null;if(I===0)return{...d,onChange:re=>s({rowIndex:e,value:re.target.value})};if(I===1)return{...d,onChange:re=>u({rowIndex:e,value:re.target.value}),error:j({value:d.value})?null:"Must be valid whole number"};if(I===2)return{...d,value:H}}),actions:[{label:"Delete",icon:"minus",onClick:()=>y({rowIndex:e})}]}});return n.jsx(D,{table:{defaultEmptyRow:o,onAddRow:b,columnAlignment:["left","right","right"],headers:[{cells:[{value:"Drink"},{value:"Quantity"},{value:"Total Price (£)"}],actions:[{primary:!0,icon:"plus",label:"Add",onClick:()=>b()}]}],rows:T,footer:{pagination:{rowCount:i.length,selectedPage:l,rowsPerPage:{onChange:a=>{const{value:m}=a.target;w(Number(m))},options:k,value:p},onSelectPage:a=>t(a),small:!0}}}})},J=()=>{const h=["Section","Width","Height"];let g=Array.from(Array(10),(p,w)=>[w,w*2,w*2]);const[o,x]=S.useState({pastedValues:"",rowIndex:0,cellIndex:0}),i=(p,w,l,t)=>{g[w][l]=Number(p.target.value),t()},R=(p,w,l,t)=>{var c;let r=((c=p==null?void 0:p.clipboardData)==null?void 0:c.getData("text"))??"";return x({rowIndex:w,cellIndex:l,pastedValues:r}),t(),{pastedData:o}},k=()=>{const[p,w]=S.useState(!1),l=()=>{w(!p)},t={headers:[{cells:h.map(r=>({value:r}))}],rows:g.map((r,c)=>{const b=c;return{cells:[...Array(3).keys()].map((y,s)=>({value:r[s],type:"Input",onChange:u=>i(u,b,s,l),onPaste:u=>R(u,b,s,l)}))}})};return n.jsxs(n.Fragment,{children:[n.jsx(D,{table:t}),n.jsx(oe,{label:"Pasted Data",children:n.jsx(se,{value:o.pastedValues})}),n.jsx(oe,{label:"At Row",children:n.jsx(se,{value:o.rowIndex})}),n.jsx(oe,{label:"At Cell Index",children:n.jsx(se,{value:o.cellIndex})})]})};return n.jsx(k,{})},X=()=>{const h={fixedWidth:"auto",name:"Table title",actions:[{icon:"download",tooltip:"Download"}],columnAlignment:[...Array(10)].map((g,o)=>"right"),headers:[{cells:[...Array(10)].map((g,o)=>({value:"Heading"}))},{cells:[...Array(10)].map((g,o)=>({options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],type:"Select",searchable:!1,value:{label:"m",value:"m"},autoLayerWidth:!0}))}],rows:[...Array(10)].map((g,o)=>({cells:[...Array(10)].map((x,i)=>({value:123.45})),actions:[{icon:"help",tooltip:n.jsxs(le,{children:[n.jsx(W,{bold:!0,children:"Title goes here lorem ipsum"}),n.jsx(W,{children:"Label: 123.45m"}),n.jsx(W,{children:"Another label: 123.45m"}),n.jsx(W,{children:"Label: 123.45m"})]})}]}))};return n.jsx(D,{table:h})},Y=()=>{const h={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(le,{children:[n.jsx(W,{bold:!0,children:"Title goes here"}),n.jsx(W,{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(le,{children:[n.jsx(W,{bold:!0,children:"Title goes here"}),n.jsx(W,{children:"Details go here"})]})}]}]};return n.jsx(D,{table:h})};M.__docgenInfo={description:"",methods:[],displayName:"InCard"};q.__docgenInfo={description:"",methods:[],displayName:"Managed"};K.__docgenInfo={description:"",methods:[],displayName:"ManagedWithSort"};B.__docgenInfo={description:"",methods:[],displayName:"ManagedWithFilterAndMultipleSort"};z.__docgenInfo={description:"",methods:[],displayName:"AutoAddNewRow"};J.__docgenInfo={description:"",methods:[],displayName:"OnPasteCallback"};X.__docgenInfo={description:"",methods:[],displayName:"ExampleTableWithInfoTooltips"};Y.__docgenInfo={description:"",methods:[],displayName:"ExampleTableWithInlineUnits"};var ce,de,ue;te.parameters={...te.parameters,docs:{...(ce=te.parameters)==null?void 0:ce.docs,source:{originalSource:`args => {
|
|
2
2
|
return <Table
|
|
3
3
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
4
4
|
{...args} />;
|
|
@@ -769,4 +769,4 @@ import{j as n}from"./jsx-runtime-eps93zm2.js";import{r as S}from"./index-DhsZuJv
|
|
|
769
769
|
}]
|
|
770
770
|
};
|
|
771
771
|
return <Table table={table} />;
|
|
772
|
-
}`,...(cn=(ln=Y.parameters)==null?void 0:ln.docs)==null?void 0:cn.source}}};const
|
|
772
|
+
}`,...(cn=(ln=Y.parameters)==null?void 0:ln.docs)==null?void 0:cn.source}}};const wt=["Default","FixedWidth","AutoWidth","ColumnWidths","ColumnAlignment","ColumnHeaderAlignment","InfiniteScrollFixedHeight","InfiniteScrollFullHeight","InfiniteScrollShort","InfiniteScrollWithDragAndDrop","InCard","Managed","ManagedWithSort","ManagedWithFilterAndMultipleSort","AutoAddNewRow","OnPasteCallback","ExampleTableWithInfoTooltips","ExampleTableWithInlineUnits"];export{z as AutoAddNewRow,L as AutoWidth,Q as ColumnAlignment,O as ColumnHeaderAlignment,_ as ColumnWidths,te as Default,X as ExampleTableWithInfoTooltips,Y as ExampleTableWithInlineUnits,E as FixedWidth,M as InCard,G as InfiniteScrollFixedHeight,N as InfiniteScrollFullHeight,U as InfiniteScrollShort,$ as InfiniteScrollWithDragAndDrop,q as Managed,B as ManagedWithFilterAndMultipleSort,K as ManagedWithSort,J as OnPasteCallback,wt as __namedExportsOrder,ht as default};
|
package/dist/storybook/assets/{table.stories-data-CElcAZ7Y.js → table.stories-data-C7mC5R8Q.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./jsx-runtime-eps93zm2.js";import{I as o,T as c}from"./common-types-Sih75Sav.js";import{F as v}from"./flex-EllkLxgO.js";import{M as p}from"./actions-KLRbmKRF.js";import{T as d}from"./text-B3-TSWok.js";import{I as n}from"./icon-BP4BO6-k.js";import{M as r}from"./types-BmbYqTX_.js";const e={headers:[{cells:[{value:"Name"},{value:"Weight"},{value:"Energy"},{value:"Origin"}]}],rows:[{cells:[{value:"Brown rice",testId:"table-tbody-cell-brown-rice"},{value:100,testId:"table-tbody-cell-100"},{value:361,testId:"table-tbody-cell-361"},{value:"Vietnam",testId:"table-tbody-cell-vietnam"}]},{cells:[{value:"Buckwheat",testId:"table-tbody-cell-buckwheat"},{value:50,testId:"table-tbody-cell-50"},{value:358,testId:"table-tbody-cell-358"},{value:"Poland",testId:"table-tbody-cell-poland"}]},{cells:[{value:"Couscous",testId:"table-tbody-cell-couscous"},{value:10,testId:"table-tbody-cell-10"},{value:368,testId:"table-tbody-cell-368"},{value:"France",testId:"table-tbody-cell-france"}]}]},x={...e,columnWidths:["200px","20%","100px","auto"]},S={...e,rows:e.rows.map(l=>({...l,cells:l.cells.map(a=>({...a,tooltip:"Tooltip"}))}))},f={...e,rows:e.rows.map(l=>({...l,cells:l.cells.map(a=>({...a,width:"200px"}))}))},W={...e,rows:e.rows.map(l=>({...l,cells:l.cells.map(a=>({...a,style:{width:"200px",background:"var(--color-background-table-header)",fontWeight:"bold"}}))}))},F={...e,rows:[{cells:[{breakWord:!0,value:"LoremipsumdolorsitametconsecteturadipiscingelitseddoeiusmodtemporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeufugiatnullapariaturufugiatnullapariatur"},{value:100},{value:361},{value:"Vietnam"}]},...e.rows]},D={...e,headers:[...e.headers,{cells:[{},{options:[{label:"kg",value:"kg"},{label:"tonnes",value:"tonnes"}],type:"Select",searchable:!1,value:{label:"kg",value:"kg"},onChange:()=>{}},{type:"Unit",value:"kcal / 100g"},{}]}]},L={...e,rows:e.rows.map((l,a)=>({...l,active:a===0,onRowClick:()=>{}}))},E={...e,rows:e.rows.map((l,a)=>({...l,error:a===1}))},P={...e,rows:e.rows.map((l,a)=>({...l,warning:a===1}))},A={...e,name:"Food"},N={...e,name:t.jsxs(v,{gap:"var(--padding-xs)",alignItems:"center",children:["Food",t.jsx(n,{icon:o.STAR})]})},u=[{childComponent:t.jsx(p,{menu:{label:"Import food",trigger:c.DROP_DOWN_BUTTON,sections:[{type:r.HEADING,label:"Import options"},{type:r.OPTION,label:"Import from csv"},{type:r.OPTION,label:"Import from library"}],small:!0}})}],V={...e,name:"Food",actions:u,testId:"table-child-component"},B={...e,actions:u,actionsRight:!0},i={...e,headers:[...e.headers,{cells:[{},{options:[{label:"kg",value:"kg"},{label:"tonnes",value:"tonnes"}],type:"Select",native:!0,value:{label:"kg",value:"kg"},onChange:()=>{}},{type:"Unit",value:"kcal / 100g"},{}]}],bordered:!0,infiniteScroll:!0,maxHeight:"500px",stickyHeaders:!0,rows:Array.from({length:100},(l,a)=>({cells:[{type:"Input",value:`Strawberry Letter ${a+1}`},{type:"Input",value:100},{type:"Input",value:361},{type:"Input",value:"Vietnam"}]})),footer:{content:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:"Footer content:"})," goes here"]})}},O={...i,maxHeight:"100%"},j={...i,rows:Array.from({length:1},(l,a)=>({cells:[{type:"Input",value:`Strawberry Letter ${a+1}`},{type:"Input",value:100},{type:"Input",value:361},{type:"Input",value:"Vietnam"}]}))},T={...i,draggable:!0},R={...e,rows:e.rows.map(l=>({...l,onRowFocus:()=>{}}))},b=()=>t.jsxs("ul",{children:[t.jsx("li",{children:"Carrots"}),t.jsx("li",{children:"Chocolate"}),t.jsx("li",{children:"Chorizo"})]}),H={headers:[{cells:[{value:"Name"},{value:"Content"}]}],rows:[{cells:[{value:"Sub-component"},{value:b()}]},{cells:[{value:"JSX"},{value:t.jsxs("div",{children:["Some ",t.jsx(d,{bold:!0,children:"bold content"})]})}]}]},m={...e,headers:[{cells:[{value:""},{value:"Stats",colSpan:2},{value:""}]},...e.headers],rows:[...e.rows,{cells:[{value:"Total",colSpan:4}]}]},q={...e,headers:[{cells:[{value:"Name",colSpan:2},{value:"Origin",rowSpan:2}]},{cells:[{value:"English"},{value:"Chinese"}]}],rows:[{cells:[{type:"Input",value:"Brown rice"},{type:"Input",value:"糙米"},{type:"Select",options:[{label:"China",value:"China"},{label:"France",value:"France"},{label:"Poland",value:"Poland"}],value:{label:"China",value:"China"},rowSpan:2}]},{cells:[{type:"Input",value:"White rice"},{type:"Input",value:"白米"}]}]},M={...e,columnWidths:["auto","120px","120px","auto"],headers:[{cells:[{value:"Header"},{value:"Header",colSpan:2},{value:"Header"}]}]},U={...e,columnAlignment:["left","right","right","left"]},J={...m,columnAlignment:["left","right","right","left","right"],columnHeaderAlignments:[["","center",""],["","right","right",""]]},s={fixedWidth:"auto",headers:[{cells:[{value:"Input",testId:"with-editable-cells-cell-name",width:"140px"},{value:"Select (native)",width:"140px"},{value:"Number Input",width:"140px"},{value:"Select (custom)",width:"140px"},{value:"Slider",width:"140px"},{value:"Static"}]}],rows:[{cells:[{value:"Buckwheat",type:"Input",onChange:()=>{},testId:"table-tbody-cell-buckwheat"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{}},{value:361,type:"NumberInput",onChange:()=>{}},{type:"Select",options:[{label:"France",value:"France"},{label:"Poland",value:"Poland"},{label:"Vietnam",value:"Vietnam"}],value:{label:"Poland",value:"Poland"},onChange:()=>{}},{type:"Slider",value:50,min:0,max:100,onChange:()=>{}},{value:361}]},{cells:[{value:"",type:"Input",onChange:()=>{},testId:"table-tbody-cell-arborio",error:"Error"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{},error:"Error"},{value:361,type:"NumberInput",onChange:()=>{},error:"Error"},{type:"Select",options:[{label:"France",value:"France"},{label:"Italy",value:"Italy"},{label:"Vietnam",value:"Vietnam"}],value:{label:"Italy",value:"Italy"},onChange:()=>{},error:"Error"},{type:"Slider",value:50,min:0,max:100,onChange:()=>{},error:"Error"},{value:361,error:"Error"}]},{cells:[{value:"Couscous",type:"Input",onChange:()=>{},testId:"table-tbody-cell-couscous",warning:"Warning"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{},warning:"Warning"},{value:361,type:"NumberInput",onChange:()=>{},warning:"Warning"},{type:"Select",options:[{label:"France",value:"France"},{label:"Poland",value:"Poland"},{label:"Vietnam",value:"Vietnam"}],value:{label:"France",value:"France"},onChange:()=>{},warning:"Warning"},{type:"Slider",value:50,min:0,max:100,onChange:()=>{},warning:"Warning"},{value:361,warning:"Warning"}]}]},z={...e,headers:e.headers.map(l=>({...l,cells:[{type:"CheckBox",onChange:()=>{}},...l.cells]})),rows:e.rows.map(l=>({...l,cells:[{type:"CheckBox",onChange:()=>{}},...l.cells]}))},_={...s,rows:s.rows.map(l=>({...l,cells:l.cells.map(a=>({...a,disabled:!0}))}))},G={...e,headers:[...e.headers,{cells:[{value:"",type:"Input",placeholder:"Search",onChange:()=>{}},{value:"",type:"Input",placeholder:"Search",onChange:()=>{}},{value:"",type:"Input",placeholder:"Search",onChange:()=>{}},{value:"",type:"Input",placeholder:"Search",onChange:()=>{}}]}]},$={headers:[{cells:[{value:"Name"},{value:"Weight (kg)",hasSort:!0,sort:"up",sortPriority:1,onSort:()=>{}},{value:"Energy (kcal / 100g)",hasSort:!0,sort:"down",sortPriority:2,onSort:()=>{}},{value:"Origin",hasSort:!0,sort:"",sortPriority:1,onSort:()=>{}}]}],rows:[{cells:[{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"}]}]},K={headers:[{cells:[{},{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"}]}],rows:[{cells:[{type:"Icon",icon:t.jsx(n,{icon:o.SUCCESS,color:"var(--color-text-success)"}),tooltip:"Success tooltip here",width:"var(--size)"},{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"}]},{cells:[{type:"Icon",icon:t.jsx(n,{icon:o.WARNING,color:"var(--color-text-warning)"}),tooltip:"Warning tooltip here",width:"var(--size)"},{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}]},{cells:[{type:"Icon",icon:t.jsx(n,{icon:o.ERROR,color:"var(--color-text-error)"}),tooltip:"Error tooltip here",width:"var(--size)"},{value:"Couscous"},{value:10},{value:368},{value:"France"}]}]},X={headers:[{cells:[{value:"Lorem"},{value:"Ipsum"}]}],rows:[{cells:[{type:"Link",value:"Link text",onClick:()=>console.log("Link clicked")},{type:"Link",value:"Disabled link text",disabled:!0,onClick:()=>console.log("Link clicked")}]},{cells:[{type:"Link",value:"Static warning link",warning:"Warning message",onClick:()=>console.log("Link clicked")},{type:"Link",value:"Static error link",error:"Error message",onClick:()=>console.log("Link clicked")}]}]},Q={headers:[{cells:[{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{}}]}],rows:[{cells:[{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{label:"test",icon:"minus",onClick:()=>{},hidden:!0}]}]},Y={headers:[{cells:[{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"}],actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{}}]}],rows:[{cells:[{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"}],actions:[{label:"More",subActions:[{label:"Move Up",icon:"up",onClick:()=>{}},{label:"Move Down",icon:"down",onClick:()=>{}}]},{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}],actions:[{label:"More",subActions:[{label:"Move Up",icon:"up",onClick:()=>{}},{label:"Move Down",icon:"down",onClick:()=>{}}]},{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"}],actions:[{label:"More",subActions:[{label:"Move Up",icon:"up",onClick:()=>{}},{label:"Move Down",icon:"down",onClick:()=>{}}]},{label:"Delete",icon:"minus",onClick:()=>{}}]}]},Z={...e,footer:{content:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:"Footer content:"})," goes here"]}),pagination:{rowCount:500,selectedPage:10,rowsPerPage:{onChange:()=>{},options:[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],value:20},goTo:{onChange:()=>{}},onSelectPage:()=>{},small:!0},actions:[{label:"Star",icon:"star",onClick:()=>{}}]}},ee={...e,headers:e.headers.map(l=>({...l,cells:l.cells.map(a=>({...a,helpIcon:{onClick:()=>console.log("Help clicked"),tooltip:"Help text goes here"},libraryIcon:{onClick:()=>console.log("Library clicked"),tooltip:"Edit in library"}}))}))},le={columnWidths:[void 0,"100px","100px","100px",void 0],columnAlignment:["left","right","right","left","left","left","right"],headers:[{cells:[{value:"Lorem ipsum dolor sit amet consectetur adipiscing elit sed doeius mod tempor incididunt laboreet dolore magna aliqua"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"},{value:"Text"},{value:"Static"},{value:"Static Right"}]}],rows:[{cells:[{breakWord:!0,value:"LoremipsumdolorsitametconsecteturadipiscingelitseddoeiusmodtemporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeufugiatnullapariaturufugiatnullapariatur"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{},disabled:!0},{type:"NumberInput",value:361},{type:"Select",options:[{label:"Vietnam",value:"Vietnam"},{label:"Other",value:"Other"}],value:{label:"Vietnam",value:"Vietnam"},onChange:()=>{},error:"Error"},{value:"Brown rice",type:"Input",onChange:()=>{},testId:"table-tbody-cell-brown-rice",warning:"Warning message"},{value:"Static warning",warning:"Warning message"},{value:"100"}]},{cells:[{value:"Buckwheat"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{}},{type:"NumberInput",value:361},{type:"Select",options:[{label:"Vietnam",value:"Vietnam"},{label:"Other",value:"Other"}],value:{label:"Vietnam",value:"Vietnam"},onChange:()=>{}},{value:"Brown rice",type:"Input",onChange:()=>{},testId:"table-tbody-cell-brown-rice"},{type:"Link",value:"Static error link",error:"Error message"},{value:"100"}]}]},ae={fixedWidth:"auto",headers:[{cells:[{value:"Name"},{value:"Date of birth"}]}],rows:[{cells:[{value:"John Smith",width:"140px"},{value:"1980-05-05",type:"DateInput",width:"110px"}]},{cells:[{value:"Jane Doe",width:"140px"},{value:"1984-12-12",type:"DateInput",width:"110px"}]}]};export{i as A,O as B,j as C,T as D,D as E,A as F,N as G,V as H,G as I,$ as J,B as K,ee as L,s as a,_ as b,ae as c,m as d,M as e,f,W as g,q as h,z as i,K as j,X as k,Q as l,Y as m,H as n,S as o,F as p,le as q,Z as r,L as s,e as t,E as u,P as v,R as w,x,U as y,J as z};
|
|
1
|
+
import{j as t}from"./jsx-runtime-eps93zm2.js";import{I as o,T as c}from"./common-types-Sih75Sav.js";import{F as v}from"./flex-EllkLxgO.js";import{M as p}from"./actions-Bax0KeqM.js";import{T as d}from"./text-B3-TSWok.js";import{I as n}from"./icon-BSFY3vDO.js";import{M as r}from"./types-BmbYqTX_.js";const e={headers:[{cells:[{value:"Name"},{value:"Weight"},{value:"Energy"},{value:"Origin"}]}],rows:[{cells:[{value:"Brown rice",testId:"table-tbody-cell-brown-rice"},{value:100,testId:"table-tbody-cell-100"},{value:361,testId:"table-tbody-cell-361"},{value:"Vietnam",testId:"table-tbody-cell-vietnam"}]},{cells:[{value:"Buckwheat",testId:"table-tbody-cell-buckwheat"},{value:50,testId:"table-tbody-cell-50"},{value:358,testId:"table-tbody-cell-358"},{value:"Poland",testId:"table-tbody-cell-poland"}]},{cells:[{value:"Couscous",testId:"table-tbody-cell-couscous"},{value:10,testId:"table-tbody-cell-10"},{value:368,testId:"table-tbody-cell-368"},{value:"France",testId:"table-tbody-cell-france"}]}]},x={...e,columnWidths:["200px","20%","100px","auto"]},S={...e,rows:e.rows.map(l=>({...l,cells:l.cells.map(a=>({...a,tooltip:"Tooltip"}))}))},f={...e,rows:e.rows.map(l=>({...l,cells:l.cells.map(a=>({...a,width:"200px"}))}))},W={...e,rows:e.rows.map(l=>({...l,cells:l.cells.map(a=>({...a,style:{width:"200px",background:"var(--color-background-table-header)",fontWeight:"bold"}}))}))},F={...e,rows:[{cells:[{breakWord:!0,value:"LoremipsumdolorsitametconsecteturadipiscingelitseddoeiusmodtemporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeufugiatnullapariaturufugiatnullapariatur"},{value:100},{value:361},{value:"Vietnam"}]},...e.rows]},D={...e,headers:[...e.headers,{cells:[{},{options:[{label:"kg",value:"kg"},{label:"tonnes",value:"tonnes"}],type:"Select",searchable:!1,value:{label:"kg",value:"kg"},onChange:()=>{}},{type:"Unit",value:"kcal / 100g"},{}]}]},L={...e,rows:e.rows.map((l,a)=>({...l,active:a===0,onRowClick:()=>{}}))},E={...e,rows:e.rows.map((l,a)=>({...l,error:a===1}))},P={...e,rows:e.rows.map((l,a)=>({...l,warning:a===1}))},A={...e,name:"Food"},N={...e,name:t.jsxs(v,{gap:"var(--padding-xs)",alignItems:"center",children:["Food",t.jsx(n,{icon:o.STAR})]})},u=[{childComponent:t.jsx(p,{menu:{label:"Import food",trigger:c.DROP_DOWN_BUTTON,sections:[{type:r.HEADING,label:"Import options"},{type:r.OPTION,label:"Import from csv"},{type:r.OPTION,label:"Import from library"}],small:!0}})}],V={...e,name:"Food",actions:u,testId:"table-child-component"},B={...e,actions:u,actionsRight:!0},i={...e,headers:[...e.headers,{cells:[{},{options:[{label:"kg",value:"kg"},{label:"tonnes",value:"tonnes"}],type:"Select",native:!0,value:{label:"kg",value:"kg"},onChange:()=>{}},{type:"Unit",value:"kcal / 100g"},{}]}],bordered:!0,infiniteScroll:!0,maxHeight:"500px",stickyHeaders:!0,rows:Array.from({length:100},(l,a)=>({cells:[{type:"Input",value:`Strawberry Letter ${a+1}`},{type:"Input",value:100},{type:"Input",value:361},{type:"Input",value:"Vietnam"}]})),footer:{content:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:"Footer content:"})," goes here"]})}},O={...i,maxHeight:"100%"},j={...i,rows:Array.from({length:1},(l,a)=>({cells:[{type:"Input",value:`Strawberry Letter ${a+1}`},{type:"Input",value:100},{type:"Input",value:361},{type:"Input",value:"Vietnam"}]}))},T={...i,draggable:!0},R={...e,rows:e.rows.map(l=>({...l,onRowFocus:()=>{}}))},b=()=>t.jsxs("ul",{children:[t.jsx("li",{children:"Carrots"}),t.jsx("li",{children:"Chocolate"}),t.jsx("li",{children:"Chorizo"})]}),H={headers:[{cells:[{value:"Name"},{value:"Content"}]}],rows:[{cells:[{value:"Sub-component"},{value:b()}]},{cells:[{value:"JSX"},{value:t.jsxs("div",{children:["Some ",t.jsx(d,{bold:!0,children:"bold content"})]})}]}]},m={...e,headers:[{cells:[{value:""},{value:"Stats",colSpan:2},{value:""}]},...e.headers],rows:[...e.rows,{cells:[{value:"Total",colSpan:4}]}]},q={...e,headers:[{cells:[{value:"Name",colSpan:2},{value:"Origin",rowSpan:2}]},{cells:[{value:"English"},{value:"Chinese"}]}],rows:[{cells:[{type:"Input",value:"Brown rice"},{type:"Input",value:"糙米"},{type:"Select",options:[{label:"China",value:"China"},{label:"France",value:"France"},{label:"Poland",value:"Poland"}],value:{label:"China",value:"China"},rowSpan:2}]},{cells:[{type:"Input",value:"White rice"},{type:"Input",value:"白米"}]}]},M={...e,columnWidths:["auto","120px","120px","auto"],headers:[{cells:[{value:"Header"},{value:"Header",colSpan:2},{value:"Header"}]}]},U={...e,columnAlignment:["left","right","right","left"]},J={...m,columnAlignment:["left","right","right","left","right"],columnHeaderAlignments:[["","center",""],["","right","right",""]]},s={fixedWidth:"auto",headers:[{cells:[{value:"Input",testId:"with-editable-cells-cell-name",width:"140px"},{value:"Select (native)",width:"140px"},{value:"Number Input",width:"140px"},{value:"Select (custom)",width:"140px"},{value:"Slider",width:"140px"},{value:"Static"}]}],rows:[{cells:[{value:"Buckwheat",type:"Input",onChange:()=>{},testId:"table-tbody-cell-buckwheat"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{}},{value:361,type:"NumberInput",onChange:()=>{}},{type:"Select",options:[{label:"France",value:"France"},{label:"Poland",value:"Poland"},{label:"Vietnam",value:"Vietnam"}],value:{label:"Poland",value:"Poland"},onChange:()=>{}},{type:"Slider",value:50,min:0,max:100,onChange:()=>{}},{value:361}]},{cells:[{value:"",type:"Input",onChange:()=>{},testId:"table-tbody-cell-arborio",error:"Error"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{},error:"Error"},{value:361,type:"NumberInput",onChange:()=>{},error:"Error"},{type:"Select",options:[{label:"France",value:"France"},{label:"Italy",value:"Italy"},{label:"Vietnam",value:"Vietnam"}],value:{label:"Italy",value:"Italy"},onChange:()=>{},error:"Error"},{type:"Slider",value:50,min:0,max:100,onChange:()=>{},error:"Error"},{value:361,error:"Error"}]},{cells:[{value:"Couscous",type:"Input",onChange:()=>{},testId:"table-tbody-cell-couscous",warning:"Warning"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{},warning:"Warning"},{value:361,type:"NumberInput",onChange:()=>{},warning:"Warning"},{type:"Select",options:[{label:"France",value:"France"},{label:"Poland",value:"Poland"},{label:"Vietnam",value:"Vietnam"}],value:{label:"France",value:"France"},onChange:()=>{},warning:"Warning"},{type:"Slider",value:50,min:0,max:100,onChange:()=>{},warning:"Warning"},{value:361,warning:"Warning"}]}]},z={...e,headers:e.headers.map(l=>({...l,cells:[{type:"CheckBox",onChange:()=>{}},...l.cells]})),rows:e.rows.map(l=>({...l,cells:[{type:"CheckBox",onChange:()=>{}},...l.cells]}))},_={...s,rows:s.rows.map(l=>({...l,cells:l.cells.map(a=>({...a,disabled:!0}))}))},G={...e,headers:[...e.headers,{cells:[{value:"",type:"Input",placeholder:"Search",onChange:()=>{}},{value:"",type:"Input",placeholder:"Search",onChange:()=>{}},{value:"",type:"Input",placeholder:"Search",onChange:()=>{}},{value:"",type:"Input",placeholder:"Search",onChange:()=>{}}]}]},$={headers:[{cells:[{value:"Name"},{value:"Weight (kg)",hasSort:!0,sort:"up",sortPriority:1,onSort:()=>{}},{value:"Energy (kcal / 100g)",hasSort:!0,sort:"down",sortPriority:2,onSort:()=>{}},{value:"Origin",hasSort:!0,sort:"",sortPriority:1,onSort:()=>{}}]}],rows:[{cells:[{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"}]}]},K={headers:[{cells:[{},{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"}]}],rows:[{cells:[{type:"Icon",icon:t.jsx(n,{icon:o.SUCCESS,color:"var(--color-text-success)"}),tooltip:"Success tooltip here",width:"var(--size)"},{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"}]},{cells:[{type:"Icon",icon:t.jsx(n,{icon:o.WARNING,color:"var(--color-text-warning)"}),tooltip:"Warning tooltip here",width:"var(--size)"},{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}]},{cells:[{type:"Icon",icon:t.jsx(n,{icon:o.ERROR,color:"var(--color-text-error)"}),tooltip:"Error tooltip here",width:"var(--size)"},{value:"Couscous"},{value:10},{value:368},{value:"France"}]}]},X={headers:[{cells:[{value:"Lorem"},{value:"Ipsum"}]}],rows:[{cells:[{type:"Link",value:"Link text",onClick:()=>console.log("Link clicked")},{type:"Link",value:"Disabled link text",disabled:!0,onClick:()=>console.log("Link clicked")}]},{cells:[{type:"Link",value:"Static warning link",warning:"Warning message",onClick:()=>console.log("Link clicked")},{type:"Link",value:"Static error link",error:"Error message",onClick:()=>console.log("Link clicked")}]}]},Q={headers:[{cells:[{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{}}]}],rows:[{cells:[{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{label:"test",icon:"minus",onClick:()=>{},hidden:!0}]}]},Y={headers:[{cells:[{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"}],actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{}}]}],rows:[{cells:[{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"}],actions:[{label:"More",subActions:[{label:"Move Up",icon:"up",onClick:()=>{}},{label:"Move Down",icon:"down",onClick:()=>{}}]},{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}],actions:[{label:"More",subActions:[{label:"Move Up",icon:"up",onClick:()=>{}},{label:"Move Down",icon:"down",onClick:()=>{}}]},{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"}],actions:[{label:"More",subActions:[{label:"Move Up",icon:"up",onClick:()=>{}},{label:"Move Down",icon:"down",onClick:()=>{}}]},{label:"Delete",icon:"minus",onClick:()=>{}}]}]},Z={...e,footer:{content:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:"Footer content:"})," goes here"]}),pagination:{rowCount:500,selectedPage:10,rowsPerPage:{onChange:()=>{},options:[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],value:20},goTo:{onChange:()=>{}},onSelectPage:()=>{},small:!0},actions:[{label:"Star",icon:"star",onClick:()=>{}}]}},ee={...e,headers:e.headers.map(l=>({...l,cells:l.cells.map(a=>({...a,helpIcon:{onClick:()=>console.log("Help clicked"),tooltip:"Help text goes here"},libraryIcon:{onClick:()=>console.log("Library clicked"),tooltip:"Edit in library"}}))}))},le={columnWidths:[void 0,"100px","100px","100px",void 0],columnAlignment:["left","right","right","left","left","left","right"],headers:[{cells:[{value:"Lorem ipsum dolor sit amet consectetur adipiscing elit sed doeius mod tempor incididunt laboreet dolore magna aliqua"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"},{value:"Text"},{value:"Static"},{value:"Static Right"}]}],rows:[{cells:[{breakWord:!0,value:"LoremipsumdolorsitametconsecteturadipiscingelitseddoeiusmodtemporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeufugiatnullapariaturufugiatnullapariatur"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{},disabled:!0},{type:"NumberInput",value:361},{type:"Select",options:[{label:"Vietnam",value:"Vietnam"},{label:"Other",value:"Other"}],value:{label:"Vietnam",value:"Vietnam"},onChange:()=>{},error:"Error"},{value:"Brown rice",type:"Input",onChange:()=>{},testId:"table-tbody-cell-brown-rice",warning:"Warning message"},{value:"Static warning",warning:"Warning message"},{value:"100"}]},{cells:[{value:"Buckwheat"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{}},{type:"NumberInput",value:361},{type:"Select",options:[{label:"Vietnam",value:"Vietnam"},{label:"Other",value:"Other"}],value:{label:"Vietnam",value:"Vietnam"},onChange:()=>{}},{value:"Brown rice",type:"Input",onChange:()=>{},testId:"table-tbody-cell-brown-rice"},{type:"Link",value:"Static error link",error:"Error message"},{value:"100"}]}]},ae={fixedWidth:"auto",headers:[{cells:[{value:"Name"},{value:"Date of birth"}]}],rows:[{cells:[{value:"John Smith",width:"140px"},{value:"1980-05-05",type:"DateInput",width:"110px"}]},{cells:[{value:"Jane Doe",width:"140px"},{value:"1984-12-12",type:"DateInput",width:"110px"}]}]};export{i as A,O as B,j as C,T as D,D as E,A as F,N as G,V as H,G as I,$ as J,B as K,ee as L,s as a,_ as b,ae as c,m as d,M as e,f,W as g,q as h,z as i,K as j,X as k,Q as l,Y as m,H as n,S as o,F as p,le as q,Z as r,L as s,e as t,E as u,P as v,R as w,x,U as y,J as z};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{j as e}from"./jsx-runtime-eps93zm2.js";import{H as E,L as i,S as j,R as c}from"./react-router-dom-Ck2Y_Fzc.js";import{F as y}from"./flex-EllkLxgO.js";import{T as S}from"./text-B3-TSWok.js";import"./index-DhsZuJvc.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./tiny-invariant-DqLgxztJ.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./index-Bk2sglWO.js";const r=({children:a,href:o=void 0,target:T=void 0,testId:R,onClick:L,component:v="a"})=>e.jsx(v,{href:o,to:o,target:T,onClick:L,"data-testid":R,children:e.jsx(S,{link:!0,children:a})});r.__docgenInfo={description:"",methods:[],displayName:"TextLink",props:{href:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"undefined",computed:!0}},target:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"undefined",computed:!0}},testId:{required:!1,tsType:{name:"string"},description:""},onClick:{required:!1,tsType:{name:"signature",type:"function",raw:"(e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void",signature:{arguments:[{type:{name:"ReactMouseEvent",raw:"React.MouseEvent<HTMLAnchorElement, MouseEvent>",elements:[{name:"HTMLAnchorElement"},{name:"MouseEvent"}]},name:"e"}],return:{name:"void"}}},description:""},children:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},component:{required:!1,tsType:{name:"ReactElementType",raw:"React.ElementType"},description:"",defaultValue:{value:"'a'",computed:!1}}}};const N={title:"Basic/TextLink",component:r,args:{children:"Link text goes here",href:"http://oliasoft.com"}},k=a=>e.jsx(r,{...a}),n=k.bind({}),t=k.bind({});t.args={href:void 0,onClick:()=>console.log("Clicked!")};const s=()=>e.jsxs(E,{children:[e.jsxs(y,{gap:!0,children:[e.jsx(r,{component:i,href:"/dashboard",children:"Dashboard"}),e.jsx(r,{component:i,href:"/settings",children:"Settings"})]}),e.jsxs(j,{children:[e.jsx(c,{path:"/dashboard",children:"Dashboard"}),e.jsx(c,{path:"/settings",children:"Settings"})]})]});s.__docgenInfo={description:"",methods:[],displayName:"AsRouterLink"};var d,p,m;n.parameters={...n.parameters,docs:{...(d=n.parameters)==null?void 0:d.docs,source:{originalSource:"args => <TextLink {...args} />",...(m=(p=n.parameters)==null?void 0:p.docs)==null?void 0:m.source}}};var u,l,h;t.parameters={...t.parameters,docs:{...(u=t.parameters)==null?void 0:u.docs,source:{originalSource:"args => <TextLink {...args} />",...(h=(l=t.parameters)==null?void 0:l.docs)==null?void 0:h.source}}};var g,f,x;s.parameters={...s.parameters,docs:{...(g=s.parameters)==null?void 0:g.docs,source:{originalSource:`() => <HashRouter>
|
|
2
|
+
<Flex gap>
|
|
3
|
+
<TextLink component={Link} href="/dashboard">
|
|
4
|
+
Dashboard
|
|
5
|
+
</TextLink>
|
|
6
|
+
<TextLink component={Link} href="/settings">
|
|
7
|
+
Settings
|
|
8
|
+
</TextLink>
|
|
9
|
+
</Flex>
|
|
10
|
+
<Switch>
|
|
11
|
+
<Route path="/dashboard">Dashboard</Route>
|
|
12
|
+
<Route path="/settings">Settings</Route>
|
|
13
|
+
</Switch>
|
|
14
|
+
</HashRouter>`,...(x=(f=s.parameters)==null?void 0:f.docs)==null?void 0:x.source}}};const I=["Default","OnClick","AsRouterLink"];export{s as AsRouterLink,n as Default,t as OnClick,I as __namedExportsOrder,N as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as G}from"./jsx-runtime-eps93zm2.js";import{T as X}from"./table-
|
|
1
|
+
import{j as G}from"./jsx-runtime-eps93zm2.js";import{T as X}from"./table-DoyDBG6l.js";import{t as K,E as O,s as W,F as k,G as q,H as z,I as D,J as M,K as P,L as Q}from"./table.stories-data-C7mC5R8Q.js";import"./index-DhsZuJvc.js";import"./index-Bk2sglWO.js";import"./index.es-DazXb-ul.js";import"./inheritsLoose-DP0QEDDI.js";import"./redux-tRgGMjwY.js";import"./objectSpread2-DW4nTBoq.js";import"./tiny-invariant-DqLgxztJ.js";import"./index-CUZDtIZe.js";import"./memoize-one.esm-CcMeOnPo.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./lodash-c4VUpsOs.js";import"./actions-Bax0KeqM.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./button-Cbv7WK6k.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./index-CEuq6vkz.js";import"./tooltip-1V7clEnw.js";import"./types-BmbYqTX_.js";import"./types-Dx2TtIG9.js";import"./badge-CLQ59MDF.js";import"./heading-CRNoBc7q.js";import"./help-icon-Buhx5nl6.js";import"./pagination-CR1nxnnq.js";import"./select-Cwks-WA0.js";import"./enum-Bnn40S8Q.js";import"./assertThisInitialized-B9jnkVVz.js";import"./text-B3-TSWok.js";import"./select.input-CJed_LLR.js";import"./helpers-JJxzGegQ.js";import"./input-Db9WkmPP.js";import"./input-group-BaRSJAEN.js";import"./input-group-addon-D68iUKV2.js";import"./number-input-B3_gmeWr.js";import"./index-C0x1JmaP.js";import"./index-DRSy5Ssd.js";import"./check-box-DPLaOkRR.js";import"./slider-CcpE4BLD.js";import"./index-BI4_Bp97.js";import"./popover-C_2P8LFJ.js";import"./flex-EllkLxgO.js";const Or={title:"Basic/Table/Title & Header",component:X,args:{table:{...K}}},r=B=>G.jsx(X,{...B}),e=r.bind({});e.args={table:O};const s=r.bind({});s.args={table:W};const a=r.bind({});a.args={table:k};const t=r.bind({});t.args={table:q};const o=r.bind({});o.args={table:z};const n=r.bind({});n.args={table:D};const i=r.bind({});i.args={table:M};const p=r.bind({});p.args={table:P};const m=r.bind({});m.args={table:Q};var l,c,d;e.parameters={...e.parameters,docs:{...(l=e.parameters)==null?void 0:l.docs,source:{originalSource:`args => {
|
|
2
2
|
return <Table
|
|
3
3
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
4
4
|
{...args} />;
|
|
@@ -34,4 +34,4 @@ import{j as G}from"./jsx-runtime-eps93zm2.js";import{T as X}from"./table-Bl5BWKe
|
|
|
34
34
|
return <Table
|
|
35
35
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
36
36
|
{...args} />;
|
|
37
|
-
}`,...(_=(U=m.parameters)==null?void 0:U.docs)==null?void 0:_.source}}};const
|
|
37
|
+
}`,...(_=(U=m.parameters)==null?void 0:U.docs)==null?void 0:_.source}}};const Wr=["Units","ActiveRow","Title","TitleJSX","ChildComponent","Filter","Sort","HeaderActionsNoLabel","HelpAndLibraryIcons"];export{s as ActiveRow,o as ChildComponent,n as Filter,p as HeaderActionsNoLabel,m as HelpAndLibraryIcons,i as Sort,a as Title,t as TitleJSX,e as Units,Wr as __namedExportsOrder,Or as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as c}from"./jsx-runtime-eps93zm2.js";import{t as s,S as l}from"./toaster-7wnI6hqB.js";import{a as r,M as f,D as E}from"./message-
|
|
1
|
+
import{j as c}from"./jsx-runtime-eps93zm2.js";import{t as s,S as l}from"./toaster-7wnI6hqB.js";import{a as r,M as f,D as E}from"./message-BRyKdRaX.js";const I=({id:t,message:e={type:r.INFO,content:""},autoClose:o=6e3,onClose:i})=>{const{type:p=r.INFO}=e??{},u=({closeToast:d})=>c.jsx(E,{type:p,onClose:d,isInToast:!0,testId:t!==void 0?t.toString()+"-dismiss":void 0}),n=c.jsx(f,{message:{...e,visible:!0,width:"100%",maxHeight:"500px",withDismiss:!1}}),a=(()=>{switch(e==null?void 0:e.type){case r.SUCCESS:return s.TYPE.SUCCESS;case r.WARNING:return s.TYPE.WARNING;case r.ERROR:return s.TYPE.ERROR;default:return s.TYPE.INFO}})();return t!==void 0&&s.isActive(t)?s.update(t,{render:n,autoClose:o,onClose:i,type:a}):s(n,{toastId:t,autoClose:o,onClose:i,hideProgressBar:o===!1,icon:!1,closeOnClick:!1,pauseOnHover:!0,draggable:!1,closeButton:u,transition:l,type:a})},T=t=>{s.dismiss(t)};export{T as d,I as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./jsx-runtime-eps93zm2.js";import{G as W}from"./grid-DRkC-bt8.js";import{T as m}from"./text-B3-TSWok.js";import{F as P}from"./flex-EllkLxgO.js";import{t as d,d as p}from"./toaster-
|
|
1
|
+
import{j as s}from"./jsx-runtime-eps93zm2.js";import{G as W}from"./grid-DRkC-bt8.js";import{T as m}from"./text-B3-TSWok.js";import{F as P}from"./flex-EllkLxgO.js";import{t as d,d as p}from"./toaster-O8ftrUAJ.js";import{B as o}from"./button-Cbv7WK6k.js";import{S as q}from"./spacer-BWoNR27H.js";import{a as g}from"./message-BRyKdRaX.js";import"./index-DhsZuJvc.js";import"./styled-components.browser.esm-BQ9GQzDc.js";import"./index-Bk2sglWO.js";import"./toaster-7wnI6hqB.js";import"./index-CUZDtIZe.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./tooltip-1V7clEnw.js";const L={type:g.SUCCESS,icon:!0,heading:"Heading",content:"Great results"},U={type:g.ERROR,icon:!0,heading:"Heading",content:"An error has happened",details:"Bad input data lorem ipsum dolor est compendum lorem ipsum."},z={type:g.WARNING,icon:!0,heading:"Heading",content:"Warning message"},J={type:g.INFO,icon:!0,heading:"Heading",content:"Long content lorem ipsum dolor est compendum lorem ipsum."},xs={title:"Modals/Toaster",parameters:{docs:{story:{inline:!1,iframeHeight:400}}},source:{type:"code"},args:{id:void 0,message:J,autoClose:6e3,onClose:()=>{}}},x=e=>s.jsx(o,{onClick:()=>d({...e,onClose:()=>console.log("toast closed")}),label:"Show toast"}),u=x.bind({}),r=x.bind({});r.args={message:L};const a=x.bind({});a.args={message:z};const n=x.bind({});n.args={message:U};const t=()=>s.jsx(o,{label:"Show Toast",onClick:()=>{const e=Math.random()>=.5;d({message:{type:e?"Success":"Error",icon:!0,content:e?"Success":"Error"},onClose:()=>console.log("toast closed"),id:"uniqueId"})}});t.parameters={docs:{iframeHeight:200,description:{story:"Pass a unique `id` in the `toast` object to prevent duplicates. Successive toasts with the same ID will update the existing toast."}}};const i=()=>{const e="sessionExpiring",S={type:"Info",content:s.jsxs(W,{children:[s.jsx(m,{bold:!0,children:"You will be signed out soon"}),s.jsx(m,{children:"For your security, you will be automatically signed out in 30 minutes unless you extend your session."}),s.jsx(q,{height:"var(--padding-xxs)"}),s.jsxs(P,{gap:"var(--padding-xs)",children:[s.jsx(o,{label:"Extend session",small:!0,colored:"success",onClick:()=>p(e)}),s.jsx(o,{label:"Dismiss",small:!0,onClick:()=>p(e)})]})]})};return s.jsx(o,{label:"Show Toast",onClick:()=>d({message:S,autoClose:!1,id:e})})},c=()=>{const e="sessionExpiringSoon",S={type:"Error",content:s.jsxs(W,{children:[s.jsx(m,{bold:!0,children:"You will be signed out very soon"}),s.jsx(m,{children:"For your security, you will be automatically signed out in 30 minutes unless you extend your session."}),s.jsx(q,{height:"var(--padding-xxs)"}),s.jsxs(P,{gap:"var(--padding-xs)",children:[s.jsx(o,{label:"Extend session",small:!0,colored:"success",onClick:()=>p(e)}),s.jsx(o,{label:"Dismiss",small:!0,onClick:()=>p(e)})]})]})};return s.jsx(o,{label:"Show Toast",onClick:()=>d({message:S,autoClose:!1,id:e})})},l=()=>{const e={type:"Success",content:"Your session has been extended for 1 hour"};return s.jsx(o,{label:"Show Toast",onClick:()=>d({message:e})})};t.__docgenInfo={description:"",methods:[],displayName:"PreventDuplicates"};i.__docgenInfo={description:"",methods:[],displayName:"SessionExpiring"};c.__docgenInfo={description:"",methods:[],displayName:"SessionExpiringSoon"};l.__docgenInfo={description:"",methods:[],displayName:"SessionExtended"};var h,y,T;u.parameters={...u.parameters,docs:{...(h=u.parameters)==null?void 0:h.docs,source:{originalSource:`args => {
|
|
2
2
|
return <Button onClick={() => toast({
|
|
3
3
|
...args,
|
|
4
4
|
onClose: () => console.log('toast closed')
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as g}from"./jsx-runtime-eps93zm2.js";import{w as l,u as n,e as c,a as m}from"./index-DMAnyMX5.js";import{t as w}from"./toaster-
|
|
1
|
+
import{j as g}from"./jsx-runtime-eps93zm2.js";import{w as l,u as n,e as c,a as m}from"./index-DMAnyMX5.js";import{t as w}from"./toaster-O8ftrUAJ.js";import{B as y}from"./button-Cbv7WK6k.js";import{a as h}from"./message-BRyKdRaX.js";import"./index-DhsZuJvc.js";import"./index-CF7H4eMJ.js";import"./toaster-7wnI6hqB.js";import"./index-CUZDtIZe.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./tooltip-1V7clEnw.js";const T={type:h.INFO,icon:!0,heading:"Heading",content:"Long content lorem ipsum dolor est compendum lorem ipsum."},O={title:"Modals/Toaster/Test Cases",parameters:{docs:{story:{inline:!1,iframeHeight:400}}},source:{type:"code"},args:{id:void 0,message:T,autoClose:6e3,onClose:()=>{}},tags:["!autodocs"]},B=s=>g.jsx(y,{onClick:()=>w({...s,onClose:()=>console.log("toast closed")}),label:"Show toast"}),e=B.bind({});e.args={id:"testId",autoClose:50};e.play=async({canvasElement:s,step:a})=>{const r=l(s),i=l(s.ownerDocument.body);await a("Toast should appear when triggered",async()=>{const t=r.getByText("Show toast");await n.click(t);const o=i.getByRole("alert");await c(o).toBeInTheDocument()}),await a("Duplicate toasts shouldn't be created",async()=>{const t=r.getByText("Show toast");await n.click(t);const o=i.queryAllByRole("alert");await c(o).toHaveLength(1)}),await a("Toast should disappear when close button pressed",async()=>{const t=i.getByRole("alert"),o=r.getByTestId("testId-dismiss");await n.click(o),await m(()=>c(t).not.toBeInTheDocument(),{timeout:2500})}),await a("Toast should automatically close",async()=>{const t=i.queryByRole("alert"),o=r.getByText("Show toast");await n.click(o),await m(()=>c(t).not.toBeInTheDocument(),{timeout:2500})})};var p,d,u;e.parameters={...e.parameters,docs:{...(p=e.parameters)==null?void 0:p.docs,source:{originalSource:`args => {
|
|
2
2
|
return <Button onClick={() => toast({
|
|
3
3
|
...args,
|
|
4
4
|
onClose: () => console.log('toast closed')
|