@oliasoft-open-source/react-ui-library 4.11.0 → 4.11.2-beta-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{index-DoFa61ar.js → index-BMWyiwz3.js} +308 -304
- package/dist/assets/{index-BpSdrNXy.css → index-BaYhOc6M.css} +373 -341
- package/dist/global.css +658 -657
- package/dist/index.html +1 -1
- package/dist/index.js +347 -379
- package/dist/index.js.map +1 -1
- package/dist/storybook/assets/{Color-KGDBMAHA-C4DMqLTk.js → Color-KGDBMAHA-B-shawjD.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-PKQXORMH-4sK5I5fh.js → DocsRenderer-PKQXORMH-CcJF_zh-.js} +1 -1
- package/dist/storybook/assets/{accordion.stories-BSRBp5Mg.js → accordion.stories-BPKMbG3k.js} +1 -1
- package/dist/storybook/assets/{actions-D-uVCDzk.js → actions-Bax0KeqM.js} +2 -2
- package/dist/storybook/assets/{actions.stories-gKfuiKQy.js → actions.stories-BnPZKqOJ.js} +1 -1
- package/dist/storybook/assets/{afe.stories-DM18uTAa.js → afe.stories-C9XjJj62.js} +1 -1
- package/dist/storybook/assets/{badge.stories-Dkq_XgEW.js → badge.stories-DA_eeQyi.js} +1 -1
- package/dist/storybook/assets/{blowout.stories-DHdofVc-.js → blowout.stories-DH-sYHgB.js} +1 -1
- package/dist/storybook/assets/button-Cbv7WK6k.js +1 -0
- package/dist/storybook/assets/button-DtgxLQCF.css +1 -0
- package/dist/storybook/assets/{button-group-1DEZPmxq.js → button-group-D2fGP_bX.js} +1 -1
- package/dist/storybook/assets/{button-group.stories-C4V1k0z_.js → button-group.stories-BETADGti.js} +1 -1
- package/dist/storybook/assets/{button.stories-DA9DGYD2.js → button.stories-C03VvX8K.js} +1 -1
- package/dist/storybook/assets/{buttons-and-links-BAJT7RF7.js → buttons-and-links-BG2zqnHT.js} +1 -1
- package/dist/storybook/assets/{casing-loads.stories-CE6GJ021.js → casing-loads.stories-BbYDH_71.js} +1 -1
- package/dist/storybook/assets/{cell.stories-BkZwSf40.js → cell.stories-DC1Vo0__.js} +1 -1
- package/dist/storybook/assets/{chunk-HLWAVYOI-wyESLsMA.js → chunk-HLWAVYOI-CM47_bXG.js} +1 -1
- package/dist/storybook/assets/{color-CXm-Xks7.js → color-Cr-qn3FE.js} +1 -1
- package/dist/storybook/assets/{dialog-BelCA1mt.js → dialog-DkpQscuI.js} +1 -1
- package/dist/storybook/assets/drawer-BVc1xI9q.css +1 -0
- package/dist/storybook/assets/drawer-DaQ1xGjV.js +3 -0
- package/dist/storybook/assets/{drawer.stories-DcjyDHEs.js → drawer.stories-C08XBVTq.js} +1 -1
- package/dist/storybook/assets/{empty.stories-DcwF0pkK.js → empty.stories-L7LSMcLe.js} +1 -1
- package/dist/storybook/assets/{field.stories-DUGMwi1O.js → field.stories-CYpQ669-.js} +1 -1
- package/dist/storybook/assets/{file-button.stories-CU2pZcEO.js → file-button.stories-CRaTdLfv.js} +1 -1
- package/dist/storybook/assets/{file-input-B0-ERX66.js → file-input-yalPf7-m.js} +1 -1
- package/dist/storybook/assets/{file-input.stories-Cpd1NHbq.js → file-input.stories-DMTQqAF8.js} +1 -1
- package/dist/storybook/assets/{flex.stories-BhvJpHpN.js → flex.stories-CLwPyEMp.js} +1 -1
- package/dist/storybook/assets/{footer.stories-C1SojIiD.js → footer.stories-DstLAiJp.js} +1 -1
- package/dist/storybook/assets/{form.stories-BLcmnfy8.js → form.stories-C8YjdHnX.js} +1 -1
- package/dist/storybook/assets/{formation.stories-DZ9-Ct5F.js → formation.stories-Bt29JldX.js} +1 -1
- package/dist/storybook/assets/{iframe-DGCZgYKU.js → iframe-CzFXqOr-.js} +2 -2
- package/dist/storybook/assets/{index-DHATsyTR.js → index-B5IpJ81Q.js} +1 -1
- package/dist/storybook/assets/{index-D-ApmKaY.js → index-CR-eYtkm.js} +88 -88
- package/dist/storybook/assets/initialize-context-rEvM6bdZ.js +1 -0
- package/dist/storybook/assets/input-Db9WkmPP.js +1 -0
- package/dist/storybook/assets/input-Dz1ZZYN5.css +1 -0
- package/dist/storybook/assets/{input-group.stories-EhmORqH9.js → input-group.stories-BCajsqAk.js} +1 -1
- package/dist/storybook/assets/{input-validation-BdnKKR1J.js → input-validation-xYDgrqcS.js} +1 -1
- package/dist/storybook/assets/{input.stories-FKl0qVhm.js → input.stories-SJy3TKkD.js} +1 -1
- package/dist/storybook/assets/{inputs-Cpi6xZLB.js → inputs-BKaZW2Pv.js} +1 -1
- package/dist/storybook/assets/{layout-forms-DxC0zO_Y.js → layout-forms-D2dIpGLv.js} +1 -1
- package/dist/storybook/assets/{layout-general-Be4RMwPl.js → layout-general-szYPo7Nk.js} +1 -1
- package/dist/storybook/assets/{list-bKpz6I9Q.js → list-By3wp5Wa.js} +1 -1
- package/dist/storybook/assets/{list.stories-Cgmt29Wv.js → list.stories-BcDHHHYJ.js} +1 -1
- package/dist/storybook/assets/{list.stories-data-D_Aj3AN4.js → list.stories-data-Doo2Rqun.js} +1 -1
- package/dist/storybook/assets/{loader.stories-pS8zRM4u.js → loader.stories-Q0U2BqZX.js} +1 -1
- package/dist/storybook/assets/{menu.stories-DLJSzJa-.js → menu.stories-1I5AGGQx.js} +1 -1
- package/dist/storybook/assets/menu.test-case.stories-XN9XFV-D.js +3 -0
- package/dist/storybook/assets/message-BRyKdRaX.js +1 -0
- package/dist/storybook/assets/message-C2ZCkHX6.css +1 -0
- package/dist/storybook/assets/{message.stories-r_UlbshI.js → message.stories-bCqCYIuN.js} +1 -1
- package/dist/storybook/assets/meta-content-ByVTG0hd.css +1 -0
- package/dist/storybook/assets/meta-content-DNgQbAW0.js +9 -0
- package/dist/storybook/assets/{modal.stories-DOgeTuHT.js → modal.stories-C2d-Em5V.js} +1 -1
- package/dist/storybook/assets/modal.test-case.stories-Ci1WRYdo.js +21 -0
- package/dist/storybook/assets/{number-input-CJJvhIIv.js → number-input-CNnU6gOF.js} +2 -2
- package/dist/storybook/assets/{number-input.stories-CKVq60XH.js → number-input.stories-Bo26PJmJ.js} +1 -1
- package/dist/storybook/assets/number-input.test-case.stories-BBKpBWfA.js +92 -0
- package/dist/storybook/assets/{option-dropdown.stories-CIvqMhQ3.js → option-dropdown.stories-CznUbXVi.js} +1 -1
- package/dist/storybook/assets/{padding-and-spacing-BZdh5XRo.js → padding-and-spacing-rWdBf9ln.js} +1 -1
- package/dist/storybook/assets/{page.stories-DnCh8h8y.js → page.stories-DthnK8qb.js} +1 -1
- package/dist/storybook/assets/{pagination-DWc8zp3k.js → pagination-CR1nxnnq.js} +1 -1
- package/dist/storybook/assets/{pagination.stories-B5cOvzik.js → pagination.stories-qXmBYwYc.js} +1 -1
- package/dist/storybook/assets/{pop-confirm.stories-DCpooB2O.js → pop-confirm.stories-CHa0qUBe.js} +1 -1
- package/dist/storybook/assets/{popover-rq33c1W2.js → popover-C_2P8LFJ.js} +1 -1
- package/dist/storybook/assets/{popover.stories-p9_-pH_Q.js → popover.stories-DZTfimDf.js} +1 -1
- package/dist/storybook/assets/{preview-B3bzTGOp.js → preview-BpH8OxJT.js} +2 -2
- package/dist/storybook/assets/{preview-NGnahGuq.js → preview-CVuoXXv0.js} +1 -1
- package/dist/storybook/assets/{projects.stories-Co_WnKSx.js → projects.stories-BPm6ucAe.js} +1 -1
- package/dist/storybook/assets/{reservoirs.stories-UW_8sofe.js → reservoirs.stories-r1Ip90kJ.js} +1 -1
- package/dist/storybook/assets/{rich-text-input-dDjxXFl-.css → rich-text-input-BJfL0Me_.css} +1 -1
- package/dist/storybook/assets/{rich-text-input.stories-CK_OTGiV.js → rich-text-input.stories-DwaseXZv.js} +4 -4
- package/dist/storybook/assets/{row.stories-D11wLSt6.js → row.stories-DFKACj3C.js} +1 -1
- package/dist/storybook/assets/select-BmYXTl_0.css +1 -0
- package/dist/storybook/assets/select-Cwks-WA0.js +61 -0
- package/dist/storybook/assets/{select.stories-Bpffz9TF.js → select.stories-DjGSNDXK.js} +1 -1
- package/dist/storybook/assets/select.test-case.stories-CrXzt4qn.js +82 -0
- package/dist/storybook/assets/side-bar-fBbBqyAT.css +1 -0
- package/dist/storybook/assets/side-bar-wpFQ5NEE.js +24 -0
- package/dist/storybook/assets/{side-bar.stories-M6FsuCrQ.js → side-bar.stories-LjClxJcG.js} +1 -1
- package/dist/storybook/assets/{site.stories-ZGohyW6Z.js → site.stories-BnWmALGd.js} +1 -1
- package/dist/storybook/assets/{slider-DnRddBCy.css → slider-Cf9tPrCy.css} +1 -1
- package/dist/storybook/assets/{slider-C7vnj_3M.js → slider-Dvdl3yGr.js} +4 -4
- package/dist/storybook/assets/slider.stories-ai1lgqaI.js +134 -0
- package/dist/storybook/assets/{smart-upload-modal.stories-xqiXR6jV.js → smart-upload-modal.stories-BlTSF64K.js} +1 -1
- package/dist/storybook/assets/{spacer.stories-BBTt2LdE.js → spacer.stories-BT2S6B0R.js} +1 -1
- package/dist/storybook/assets/table-BtBtDwPu.css +1 -0
- package/dist/storybook/assets/table-CkNaVBsz.js +86 -0
- package/dist/storybook/assets/{table.stories-data-C3vJedB1.js → table.stories-data-C7mC5R8Q.js} +1 -1
- package/dist/storybook/assets/{table.stories-C1GgZCCR.js → table.stories-rxOOpdhc.js} +1 -1
- package/dist/storybook/assets/{textarea-D6ltcKhz.js → textarea-DflOOrxV.js} +2 -2
- package/dist/storybook/assets/textarea-TqxidmV4.css +1 -0
- package/dist/storybook/assets/{textarea.stories-CJ-Oqytp.js → textarea.stories-CzsqRVpC.js} +1 -1
- package/dist/storybook/assets/{title.stories-jatDyjoM.js → title.stories-CcqyFQEQ.js} +1 -1
- package/dist/storybook/assets/{toaster-BoBcvmf9.js → toaster-O8ftrUAJ.js} +1 -1
- package/dist/storybook/assets/{toaster.stories-G6nKp3uV.js → toaster.stories-CdpwLBSo.js} +1 -1
- package/dist/storybook/assets/toaster.test-case.stories-Cy3_Gvs_.js +6 -0
- package/dist/storybook/assets/{tooltip.test-case.stories-C0wxGvKJ.js → tooltip.test-case.stories-De9h8ThH.js} +1 -1
- package/dist/storybook/assets/{top-bar-DkXSzzqt.js → top-bar-Bjf6PQE1.js} +1 -1
- package/dist/storybook/assets/{top-bar.stories-HDmWT243.js → top-bar.stories-1hZmlzDT.js} +1 -1
- package/dist/storybook/assets/{top-bar.testcase.stories-DfmrkEpT.js → top-bar.testcase.stories-BsFYqaw6.js} +1 -1
- package/dist/storybook/assets/{tree.stories-feLUcTtm.js → tree.stories-NGZfmH_B.js} +1 -1
- package/dist/storybook/assets/unit-input-Byipu-z0.js +10 -0
- package/dist/storybook/assets/{unit-input.stories-zmSrl6iW.js → unit-input.stories-CChVbxmI.js} +1 -1
- package/dist/storybook/assets/unit-input.test-case.stories-BwKiucyc.js +220 -0
- package/dist/storybook/assets/unit-table.stories-DvpNdCS9.js +152 -0
- package/dist/storybook/assets/unit-table.test-case.stories-OSAkErH8.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/404.html +0 -1
- package/dist/storybook/assets/button-DHevvVBE.js +0 -1
- package/dist/storybook/assets/button-fAxt_G4d.css +0 -1
- package/dist/storybook/assets/drawer-DOWJp9T4.js +0 -3
- package/dist/storybook/assets/drawer-DhrjYsQu.css +0 -1
- package/dist/storybook/assets/input-DD7t4kHm.css +0 -1
- package/dist/storybook/assets/input-DTXbDJaL.js +0 -1
- package/dist/storybook/assets/menu.test-case.stories-DyrNbGBs.js +0 -3
- package/dist/storybook/assets/message-Cl3kn7ZD.css +0 -1
- package/dist/storybook/assets/message-Y48EomV-.js +0 -1
- package/dist/storybook/assets/meta-content-DWZbURV2.js +0 -9
- package/dist/storybook/assets/meta-content-DnZPPeTF.css +0 -1
- package/dist/storybook/assets/modal.test-case.stories-DQ1Izuq6.js +0 -21
- package/dist/storybook/assets/number-input.test-case.stories-Dh1F7N8M.js +0 -92
- package/dist/storybook/assets/select-03uRbc4I.js +0 -61
- package/dist/storybook/assets/select-H-9tdhwc.css +0 -1
- package/dist/storybook/assets/select.test-case.stories-DwDNDHax.js +0 -82
- package/dist/storybook/assets/side-bar-CSx5wI-k.js +0 -24
- package/dist/storybook/assets/side-bar-auov230-.css +0 -1
- package/dist/storybook/assets/slider.stories-BzBb3PkP.js +0 -171
- package/dist/storybook/assets/table-B8ojy8Nj.css +0 -1
- package/dist/storybook/assets/table-DyOsClUv.js +0 -86
- package/dist/storybook/assets/textarea-H-YTEwr8.css +0 -1
- package/dist/storybook/assets/toaster.test-case.stories-CCHTh_U1.js +0 -6
- package/dist/storybook/assets/unit-input-CooRJQnF.js +0 -10
- package/dist/storybook/assets/unit-input.test-case.stories-C1xRJ1EZ.js +0 -220
- package/dist/storybook/assets/unit-table.stories-Bl2gHPKG.js +0 -152
- package/dist/storybook/assets/unit-table.test-case.stories-DpSewGv4.js +0 -1
- package/dist/storybook/assets/use-previous-D775JrO6.js +0 -1
package/dist/storybook/assets/{table.stories-data-C3vJedB1.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-D-uVCDzk.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};
|
|
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};
|
|
@@ -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-DyOsClUv.js";import{C as dn}from"./card-EcjmryU9.js";import{I as se}from"./input-DTXbDJaL.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-C3vJedB1.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-D-uVCDzk.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./button-DHevvVBE.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-DWc8zp3k.js";import"./select-03uRbc4I.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-CJJvhIIv.js";import"./index-C0x1JmaP.js";import"./index-DRSy5Ssd.js";import"./check-box-DPLaOkRR.js";import"./help-icon-Buhx5nl6.js";import"./slider-C7vnj_3M.js";import"./index-BI4_Bp97.js";import"./popover-rq33c1W2.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 => {
|
|
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-CkNaVBsz.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-CNnU6gOF.js";import"./index-C0x1JmaP.js";import"./index-DRSy5Ssd.js";import"./check-box-DPLaOkRR.js";import"./help-icon-Buhx5nl6.js";import"./slider-Dvdl3yGr.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} />;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as
|
|
1
|
+
import{j as l}from"./jsx-runtime-eps93zm2.js";import{r as w}from"./index-DhsZuJvc.js";import{c as R}from"./index-Bk2sglWO.js";import{i as s}from"./types-Dx2TtIG9.js";import{D as L}from"./disabled-context-rmpd7YJS.js";import{l as t}from"./lodash-c4VUpsOs.js";import{T as F}from"./tooltip-1V7clEnw.js";const N="_inputInTable_q0tl0_1",h="_inputHover_q0tl0_13",A="_inputFocus_q0tl0_18",H="_inputError_q0tl0_25",V="_inputWarning_q0tl0_26",M="_inputDisabled_q0tl0_61",k="_hideScrollbars_q0tl0_67",C="_textarea_q0tl0_77",j="_small_q0tl0_116",S="_monospace_q0tl0_155",a={inputInTable:N,inputHover:h,inputFocus:A,inputError:H,inputWarning:V,inputDisabled:M,hideScrollbars:k,textarea:C,small:j,monospace:S},I=({name:i,value:u="",placeholder:o="",cols:m,rows:d,disabled:p=!1,onChange:c=t.noop,onKeyPress:f=t.noop,onFocus:g=t.noop,onBlur:T=t.noop,tabIndex:y=0,error:e=null,warning:n=null,tooltip:r=null,maxTooltipWidth:v,resize:b,monospace:q=!1,testId:x})=>{const _=w.useContext(L),E=l.jsx("textarea",{className:R(a.textarea,e?a.error:"",n?a.warning:"",q?a.monospace:""),name:i,value:u,placeholder:o,cols:m,rows:d,onChange:c,disabled:p||_,onKeyPress:f,onFocus:g,onBlur:T,tabIndex:y,style:{resize:b},"data-error":e||null,"data-warning":n||null,"data-testid":x});return l.jsx(F,{error:!!e,warning:!!n,text:r||e||n,enabled:r&&s(r)||e&&s(e)||n&&s(n)||!1,maxWidth:v,placement:"bottom-center",children:E})};I.__docgenInfo={description:"",methods:[],displayName:"TextArea",props:{name:{required:!1,tsType:{name:"string"},description:""},value:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:"",defaultValue:{value:"''",computed:!1}},placeholder:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},cols:{required:!1,tsType:{name:"number"},description:""},rows:{required:!1,tsType:{name:"number"},description:""},disabled:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},onChange:{required:!1,tsType:{name:"signature",type:"function",raw:`(
|
|
2
2
|
event: TChangeEvent<T>,
|
|
3
3
|
...additionalProps: { [key: string]: any }[]
|
|
4
4
|
) => void`,signature:{arguments:[{type:{name:"intersection",raw:`ChangeEvent<T> & {
|
|
@@ -10,4 +10,4 @@ import{j as i}from"./jsx-runtime-eps93zm2.js";import{r as h}from"./index-DhsZuJv
|
|
|
10
10
|
| T
|
|
11
11
|
| { name: string; value: any; label?: string; files?: FileList | null };
|
|
12
12
|
}`,signature:{properties:[{key:"target",value:{name:"union",raw:`| T
|
|
13
|
-
| { name: string; value: any; label?: string; files?: FileList | null }`,elements:[{name:"HTMLTextAreaElement"},{name:"signature",type:"object",raw:"{ name: string; value: any; label?: string; files?: FileList | null }",signature:{properties:[{key:"name",value:{name:"string",required:!0}},{key:"value",value:{name:"any",required:!0}},{key:"label",value:{name:"string",required:!1}},{key:"files",value:{name:"union",raw:"FileList | null",elements:[{name:"FileList"},{name:"null"}],required:!1}}]}}],required:!0}}]}}]},name:"event"},{type:{name:"Array",elements:[{name:"signature",type:"object",raw:"{ [key: string]: any }",signature:{properties:[{key:{name:"string"},value:{name:"any",required:!0}}]}}],raw:"{ [key: string]: any }[]"},name:"additionalProps",rest:!0}],return:{name:"void"}}},description:"",defaultValue:{value:"noop",computed:!0}},onKeyPress:{required:!1,tsType:{name:"signature",type:"function",raw:"(evt: KeyboardEvent<HTMLTextAreaElement>) => void",signature:{arguments:[{type:{name:"KeyboardEvent",elements:[{name:"HTMLTextAreaElement"}],raw:"KeyboardEvent<HTMLTextAreaElement>"},name:"evt"}],return:{name:"void"}}},description:"",defaultValue:{value:"noop",computed:!0}},onFocus:{required:!1,tsType:{name:"signature",type:"function",raw:"(evt: FocusEvent<HTMLTextAreaElement>) => void",signature:{arguments:[{type:{name:"FocusEvent",elements:[{name:"HTMLTextAreaElement"}],raw:"FocusEvent<HTMLTextAreaElement>"},name:"evt"}],return:{name:"void"}}},description:"",defaultValue:{value:"noop",computed:!0}},onBlur:{required:!1,tsType:{name:"signature",type:"function",raw:"(evt: FocusEvent<HTMLTextAreaElement>) => void",signature:{arguments:[{type:{name:"FocusEvent",elements:[{name:"HTMLTextAreaElement"}],raw:"FocusEvent<HTMLTextAreaElement>"},name:"evt"}],return:{name:"void"}}},description:"",defaultValue:{value:"noop",computed:!0}},tabIndex:{required:!1,tsType:{name:"number"},description:"",defaultValue:{value:"0",computed:!1}},error:{required:!1,tsType:{name:"union",raw:"TStringOrNumber | React.ReactNode",elements:[{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},{name:"ReactReactNode",raw:"React.ReactNode"}]},description:"",defaultValue:{value:"null",computed:!1}},warning:{required:!1,tsType:{name:"union",raw:"TStringOrNumber | React.ReactNode",elements:[{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},{name:"ReactReactNode",raw:"React.ReactNode"}]},description:"",defaultValue:{value:"null",computed:!1}},tooltip:{required:!1,tsType:{name:"union",raw:"TStringOrNumber | React.ReactNode",elements:[{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},{name:"ReactReactNode",raw:"React.ReactNode"}]},description:"",defaultValue:{value:"null",computed:!1}},maxTooltipWidth:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:""},resize:{required:!1,tsType:{name:"Property.Resize"},description:""},monospace:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},testId:{required:!1,tsType:{name:"string"},description:""}}};export{
|
|
13
|
+
| { name: string; value: any; label?: string; files?: FileList | null }`,elements:[{name:"HTMLTextAreaElement"},{name:"signature",type:"object",raw:"{ name: string; value: any; label?: string; files?: FileList | null }",signature:{properties:[{key:"name",value:{name:"string",required:!0}},{key:"value",value:{name:"any",required:!0}},{key:"label",value:{name:"string",required:!1}},{key:"files",value:{name:"union",raw:"FileList | null",elements:[{name:"FileList"},{name:"null"}],required:!1}}]}}],required:!0}}]}}]},name:"event"},{type:{name:"Array",elements:[{name:"signature",type:"object",raw:"{ [key: string]: any }",signature:{properties:[{key:{name:"string"},value:{name:"any",required:!0}}]}}],raw:"{ [key: string]: any }[]"},name:"additionalProps",rest:!0}],return:{name:"void"}}},description:"",defaultValue:{value:"noop",computed:!0}},onKeyPress:{required:!1,tsType:{name:"signature",type:"function",raw:"(evt: KeyboardEvent<HTMLTextAreaElement>) => void",signature:{arguments:[{type:{name:"KeyboardEvent",elements:[{name:"HTMLTextAreaElement"}],raw:"KeyboardEvent<HTMLTextAreaElement>"},name:"evt"}],return:{name:"void"}}},description:"",defaultValue:{value:"noop",computed:!0}},onFocus:{required:!1,tsType:{name:"signature",type:"function",raw:"(evt: FocusEvent<HTMLTextAreaElement>) => void",signature:{arguments:[{type:{name:"FocusEvent",elements:[{name:"HTMLTextAreaElement"}],raw:"FocusEvent<HTMLTextAreaElement>"},name:"evt"}],return:{name:"void"}}},description:"",defaultValue:{value:"noop",computed:!0}},onBlur:{required:!1,tsType:{name:"signature",type:"function",raw:"(evt: FocusEvent<HTMLTextAreaElement>) => void",signature:{arguments:[{type:{name:"FocusEvent",elements:[{name:"HTMLTextAreaElement"}],raw:"FocusEvent<HTMLTextAreaElement>"},name:"evt"}],return:{name:"void"}}},description:"",defaultValue:{value:"noop",computed:!0}},tabIndex:{required:!1,tsType:{name:"number"},description:"",defaultValue:{value:"0",computed:!1}},error:{required:!1,tsType:{name:"union",raw:"TStringOrNumber | React.ReactNode",elements:[{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},{name:"ReactReactNode",raw:"React.ReactNode"}]},description:"",defaultValue:{value:"null",computed:!1}},warning:{required:!1,tsType:{name:"union",raw:"TStringOrNumber | React.ReactNode",elements:[{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},{name:"ReactReactNode",raw:"React.ReactNode"}]},description:"",defaultValue:{value:"null",computed:!1}},tooltip:{required:!1,tsType:{name:"union",raw:"TStringOrNumber | React.ReactNode",elements:[{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},{name:"ReactReactNode",raw:"React.ReactNode"}]},description:"",defaultValue:{value:"null",computed:!1}},maxTooltipWidth:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:""},resize:{required:!1,tsType:{name:"Property.Resize"},description:""},monospace:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},testId:{required:!1,tsType:{name:"string"},description:""}}};export{I as T};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._inputInTable_q0tl0_1{background-color:transparent;border-radius:inherit!important;height:var(--size);min-height:100%}._inputInTable_q0tl0_1:not(:hover):not([data-error]):not([data-warning]){border-color:transparent}._inputInTable_q0tl0_1:not(:focus){box-shadow:none}._inputHover_q0tl0_13{position:relative;border-color:var(--color-border-hover);z-index:2}._inputFocus_q0tl0_18{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputError_q0tl0_25,._inputWarning_q0tl0_26{position:relative}._inputError_q0tl0_25{z-index:2;border-color:var(--color-border-error);color:var(--color-text-error)!important;background-color:var(--color-background-error-muted)}._inputError_q0tl0_25:hover{border-color:var(--color-border-error-hover)!important}._inputError_q0tl0_25:focus{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputWarning_q0tl0_26{z-index:1;border-color:var(--color-border-warning);color:var(--color-text-warning)!important;background-color:var(--color-background-warning-muted)}._inputWarning_q0tl0_26:hover{border-color:var(--color-border-warning-hover)!important}._inputWarning_q0tl0_26:focus{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputDisabled_q0tl0_61{pointer-events:none;background-color:var(--color-background-disabled);color:var(--color-text-muted);box-shadow:none}._hideScrollbars_q0tl0_67{scrollbar-width:none;-ms-overflow-style:none}._hideScrollbars_q0tl0_67::-webkit-scrollbar{display:none}._textarea_q0tl0_77{margin:0;display:block;width:100%;max-width:100%;outline:0;text-align:left;font-family:var(--font-family);line-height:var(--line-height);padding:var(--padding-input);background:var(--color-background-input);border:1px solid var(--color-border);color:var(--color-text);border-radius:var(--border-radius);transition:box-shadow .1s ease,border-color .1s ease;box-shadow:none;min-height:var(--size)}._textarea_q0tl0_77::placeholder{color:var(--color-text-placeholder)}._textarea_q0tl0_77:hover{position:relative;border-color:var(--color-border-hover);z-index:2}._textarea_q0tl0_77:focus{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._textarea_q0tl0_77[disabled]{pointer-events:none;background-color:var(--color-background-disabled);color:var(--color-text-muted);box-shadow:none}._textarea_q0tl0_77._small_q0tl0_116{font-size:var(--font-size-sm);min-height:var(--size-sm);padding:var(--padding-input-sm)}._textarea_q0tl0_77[data-warning]{position:relative;z-index:1;border-color:var(--color-border-warning);color:var(--color-text-warning)!important;background-color:var(--color-background-warning-muted)}._textarea_q0tl0_77[data-warning]:hover{border-color:var(--color-border-warning-hover)!important}._textarea_q0tl0_77[data-warning]:focus{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._textarea_q0tl0_77[data-error]{position:relative;z-index:2;border-color:var(--color-border-error);color:var(--color-text-error)!important;background-color:var(--color-background-error-muted)}._textarea_q0tl0_77[data-error]:hover{border-color:var(--color-border-error-hover)!important}._textarea_q0tl0_77[data-error]:focus{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._textarea_q0tl0_77._monospace_q0tl0_155{font-family:monospace}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as u}from"./jsx-runtime-eps93zm2.js";import{T as s}from"./textarea-
|
|
1
|
+
import{j as u}from"./jsx-runtime-eps93zm2.js";import{T as s}from"./textarea-DflOOrxV.js";import"./index-DhsZuJvc.js";import"./index-Bk2sglWO.js";import"./types-Dx2TtIG9.js";import"./lodash-c4VUpsOs.js";import"./disabled-context-rmpd7YJS.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";const{useArgs:g}=__STORYBOOK_MODULE_PREVIEW_API__,f={title:"Forms/TextArea",component:s,args:{disabled:!1}},c=n=>{const[i,o]=g(),m=p=>{o({value:p.target.value})};return u.jsx(s,{...n,onChange:m})},e=c.bind({});var t,r,a;e.parameters={...e.parameters,docs:{...(t=e.parameters)==null?void 0:t.docs,source:{originalSource:`args => {
|
|
2
2
|
const [_, updateArgs] = useArgs();
|
|
3
3
|
const handleChange = (evt: ChangeEvent<HTMLTextAreaElement>) => {
|
|
4
4
|
updateArgs({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as 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-CkNaVBsz.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-CNnU6gOF.js";import"./index-C0x1JmaP.js";import"./index-DRSy5Ssd.js";import"./check-box-DPLaOkRR.js";import"./slider-Dvdl3yGr.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} />;
|
|
@@ -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')
|
|
@@ -0,0 +1,6 @@
|
|
|
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
|
+
return <Button onClick={() => toast({
|
|
3
|
+
...args,
|
|
4
|
+
onClose: () => console.log('toast closed')
|
|
5
|
+
})} label="Show toast" />;
|
|
6
|
+
}`,...(u=(d=e.parameters)==null?void 0:d.docs)==null?void 0:u.source}}};const A=["Test"];export{e as Test,A as __namedExportsOrder,O as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o}from"./jsx-runtime-eps93zm2.js";import{T as m}from"./tooltip-1V7clEnw.js";import{M as u}from"./actions-
|
|
1
|
+
import{j as o}from"./jsx-runtime-eps93zm2.js";import{T as m}from"./tooltip-1V7clEnw.js";import{M as u}from"./actions-Bax0KeqM.js";import{m as d}from"./menu.stories-data-CQ59XhzU.js";import"./index-DhsZuJvc.js";import"./index-CUZDtIZe.js";import"./index-Bk2sglWO.js";import"./lodash-c4VUpsOs.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./button-Cbv7WK6k.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./types-BmbYqTX_.js";import"./types-Dx2TtIG9.js";import"./badge-CLQ59MDF.js";import"./flex-EllkLxgO.js";const B={title:"Basic/Tooltip/Test Cases",component:m,args:{text:"Tooltip text"},tags:["!autodocs"]},l=c=>o.jsx(m,{...c}),e=l.bind({});e.args={children:o.jsx(u,{menu:d}),placement:"bottom-end",display:"inline-block"};const s=l.bind({});s.args={children:o.jsx("span",{children:"Hover over me"}),text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean pharetra tellus eu cursus suscipit. Maecenas leo sapien, convallis ac urna ullamcorper, tempus porttitor eros. Suspendisse pellentesque odio ac metus semper, nec sagittis nisi cursus. Aenean felis libero, bibendum id accumsan id, commodo suscipit ex. Pellentesque gravida rhoncus neque, ac tincidunt libero maximus vel. In lacus nisi, malesuada vitae velit vel, laoreet porta nisl."};var t,r,i;e.parameters={...e.parameters,docs:{...(t=e.parameters)==null?void 0:t.docs,source:{originalSource:`args => <Tooltip
|
|
2
2
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
3
3
|
{...args} />`,...(i=(r=e.parameters)==null?void 0:r.docs)==null?void 0:i.source}}};var a,n,p;s.parameters={...s.parameters,docs:{...(a=s.parameters)==null?void 0:a.docs,source:{originalSource:`args => <Tooltip
|
|
4
4
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as n}from"./jsx-runtime-eps93zm2.js";import{c as d}from"./index-Bk2sglWO.js";import{I as q}from"./icon-BSFY3vDO.js";import{T}from"./common-types-Sih75Sav.js";import{B as E}from"./button-
|
|
1
|
+
import{j as n}from"./jsx-runtime-eps93zm2.js";import{c as d}from"./index-Bk2sglWO.js";import{I as q}from"./icon-BSFY3vDO.js";import{T}from"./common-types-Sih75Sav.js";import{B as E}from"./button-Cbv7WK6k.js";import{M as w}from"./actions-Bax0KeqM.js";import{r as N}from"./index-DhsZuJvc.js";import{D as M}from"./disabled-context-rmpd7YJS.js";const R="_topbar_oyr59_11",_="_fixed_oyr59_21",j="_appSwitcher_oyr59_29",h="_title_oyr59_75",C="_logo_oyr59_91",x="_label_oyr59_94",I="_brand_oyr59_99",B="_version_oyr59_104",H="_left_oyr59_111",L="_right_oyr59_112",P="_item_oyr59_126",A="_link_oyr59_127",D="_button_oyr59_138",O="_menu_oyr59_139",S="_active_oyr59_168",V="_alert_oyr59_193",a={topbar:R,fixed:_,appSwitcher:j,title:h,logo:C,label:x,brand:I,version:B,left:H,right:L,item:P,link:A,button:D,menu:O,active:S,alert:V},g=({warning:e})=>n.jsx("div",{className:a.alert,children:e});g.__docgenInfo={description:"",methods:[],displayName:"Warning",props:{warning:{required:!0,tsType:{name:"ReactNode"},description:""}}};const f=({icon:e,url:t,onClick:s})=>{const r=n.jsx(q,{icon:e});return t?n.jsx("a",{href:t,onClick:s,className:a.appSwitcher,children:r}):n.jsx("div",{onClick:s,className:a.appSwitcher,children:r})};f.__docgenInfo={description:"",methods:[],displayName:"AppSwitcher",props:{icon:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},url:{required:!1,tsType:{name:"string"},description:""},onClick:{required:!1,tsType:{name:"MouseEventHandler",elements:[{name:"union",raw:"HTMLDivElement | HTMLAnchorElement",elements:[{name:"HTMLDivElement"},{name:"HTMLAnchorElement"}]}],raw:"MouseEventHandler<HTMLDivElement | HTMLAnchorElement>"},description:""}}};const b=({label:e,logo:t,url:s,version:r,onClick:i})=>{const l=n.jsxs("div",{className:a.title,children:[t&&n.jsx("div",{className:a.logo,children:t}),e&&n.jsx("span",{className:a.label,children:e}),r&&n.jsx("div",{className:a.version,children:r})]});return n.jsx("div",{className:d(a.item,a.brand),children:s?n.jsx("a",{href:s,onClick:i,children:l}):n.jsx("div",{onClick:i,children:l})})};b.__docgenInfo={description:"",methods:[],displayName:"Title",props:{label:{required:!1,tsType:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},description:""},logo:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},url:{required:!1,tsType:{name:"string"},description:""},version:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:""},onClick:{required:!1,tsType:{name:"MouseEventHandler",elements:[{name:"union",raw:"HTMLDivElement | HTMLAnchorElement",elements:[{name:"HTMLDivElement"},{name:"HTMLAnchorElement"}]}],raw:"MouseEventHandler<HTMLDivElement | HTMLAnchorElement>"},description:""}}};var m=(e=>(e.LINK="Link",e.BUTTON="Button",e.MENU="Menu",e.COMPONENT="Component",e))(m||{});const p=({label:e,url:t,icon:s,onClick:r,active:i,disabled:l,testId:c,component:o="a"})=>{const u=N.useContext(M),k=v=>{(l||u)&&v.preventDefault(),r==null||r(v)};return n.jsxs(o,{className:d(a.link,i?a.active:""),href:t||"#",to:t,onClick:k,"aria-disabled":l||u,"data-testid":c,role:r&&!t?"button":void 0,children:[s,n.jsx("span",{className:a.label,children:e})]})};p.__docgenInfo={description:"",methods:[],displayName:"Link",props:{label:{required:!1,tsType:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},description:""},url:{required:!1,tsType:{name:"string"},description:""},icon:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},onClick:{required:!1,tsType:{name:"MouseEventHandler",elements:[{name:"HTMLAnchorElement"}],raw:"MouseEventHandler<HTMLAnchorElement>"},description:""},active:{required:!1,tsType:{name:"boolean"},description:""},disabled:{required:!1,tsType:{name:"boolean"},description:""},testId:{required:!1,tsType:{name:"string"},description:""},component:{required:!1,tsType:{name:"ReactElementType",raw:"React.ElementType"},description:"",defaultValue:{value:"'a'",computed:!1}}}};const y=({element:e})=>{switch(e.type){case m.LINK:return n.jsx("div",{className:a.item,children:n.jsx(p,{label:e.label,url:e.url,icon:e.icon,onClick:e.onClick,active:e.active,disabled:e.disabled,testId:e.testId,component:e.component})});case m.BUTTON:return n.jsx("div",{className:d(a.item,a.button),children:n.jsx(E,{label:e.label,colored:e.colored,pill:!0,disabled:e.disabled,onClick:e.onClick,icon:e.icon,testId:e.testId})});case m.MENU:return n.jsx("div",{className:d(a.item,a.menu),children:n.jsx(w,{maxHeight:"100%",menu:{trigger:T.COMPONENT,fullHeightTrigger:!0,placement:"bottom-start",component:n.jsx(p,{label:e.label,icon:e.icon,onClick:e.onClick}),sections:e.sections}})});case m.COMPONENT:return n.jsx("div",{className:a.item,children:e.component});default:return null}};y.__docgenInfo={description:"",methods:[],displayName:"Element",props:{element:{required:!0,tsType:{name:"union",raw:"TLinkElement | TButtonElement | TMenuElement | TComponentElement",elements:[{name:"intersection",raw:`TBaseElementProps & {
|
|
2
2
|
type: 'Link';
|
|
3
3
|
url?: string;
|
|
4
4
|
active?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-eps93zm2.js";import{H as I,L as c,S as D,R as l}from"./react-router-dom-Ck2Y_Fzc.js";import{I as O,T as A}from"./common-types-Sih75Sav.js";import{T as p}from"./top-bar-
|
|
1
|
+
import{j as e}from"./jsx-runtime-eps93zm2.js";import{H as I,L as c,S as D,R as l}from"./react-router-dom-Ck2Y_Fzc.js";import{I as O,T as A}from"./common-types-Sih75Sav.js";import{T as p}from"./top-bar-Bjf6PQE1.js";import{P as w}from"./page-7SSpdYhb.js";import{M as N}from"./actions-Bax0KeqM.js";import{B as m}from"./button-Cbv7WK6k.js";import{B as P}from"./badge-CLQ59MDF.js";import{L as v}from"./logo-BVP9045W.js";import{s as H}from"./icon-custom-Xcl4YkWP.js";import{M as s}from"./types-BmbYqTX_.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";import"./icon-BSFY3vDO.js";import"./disabled-context-rmpd7YJS.js";import"./lodash-c4VUpsOs.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./types-Dx2TtIG9.js";import"./spinner-AWUe4xwQ.js";const M=[{type:"Link",label:"Link",onClick:()=>{}},{type:"Link",label:"Active",active:!0,onClick:()=>{}},{type:"Link",label:"Disabled",disabled:!0,onClick:()=>{}},{type:"Menu",label:"Dropdown",onClick:()=>{},sections:[{type:"Option",label:"Alpacas",onClick:()=>{}},{type:"Option",label:"Llamas",onClick:()=>{}}]},{type:"Button",label:"Save",colored:!0,onClick:()=>{},testId:"top-bar-button-save"}],E=[{type:"Component",component:e.jsx(P,{title:"3",small:!0,margin:"5px",children:e.jsx(m,{icon:O.NOTIFICATION,round:!0,onClick:()=>{}})})},{type:"Component",component:e.jsx(N,{menu:{trigger:A.COMPONENT,fullHeightTrigger:!0,placement:"bottom-end",component:e.jsx(m,{label:"TU",round:!0,onClick:()=>{}}),sections:[{type:s.HEADING,label:"Test User"},{type:s.OPTION,label:"Profile",icon:"user",onClick:()=>{}},{type:s.DIVIDER},{type:s.OPTION,label:"Sign out",icon:"lock",onClick:()=>{}}]}})}],ce={title:"Navigation/TopBar",component:p,parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}},argTypes:{height:{control:"text"}},args:{title:{logo:e.jsx("img",{src:v,alt:"logo"}),onClick:()=>{}},content:M,contentRight:E}},i=j=>e.jsx(p,{...j}),n=i.bind({}),t=i.bind({});t.args={warning:"Application update available. Please refresh your browser."};const r=i.bind({});r.args={title:{label:"Text Branding",onClick:()=>{}}};const o=i.bind({});o.args={appSwitcher:{icon:H,onClick:()=>{}}};const a=()=>e.jsx(I,{children:e.jsxs(w,{left:0,children:[e.jsx(p,{content:[{type:"Link",label:"Dashboard",component:c,url:"/dashboard"},{type:"Link",label:"Settings",component:c,url:"/settings"}]}),e.jsxs(D,{children:[e.jsx(l,{path:"/dashboard",children:"Dashboard"}),e.jsx(l,{path:"/settings",children:"Settings"})]})]})});a.__docgenInfo={description:"",methods:[],displayName:"AsRouterLink"};var d,u,g;n.parameters={...n.parameters,docs:{...(d=n.parameters)==null?void 0:d.docs,source:{originalSource:"args => <TopBar {...args} />",...(g=(u=n.parameters)==null?void 0:u.docs)==null?void 0:g.source}}};var h,b,k;t.parameters={...t.parameters,docs:{...(h=t.parameters)==null?void 0:h.docs,source:{originalSource:"args => <TopBar {...args} />",...(k=(b=t.parameters)==null?void 0:b.docs)==null?void 0:k.source}}};var T,y,f;r.parameters={...r.parameters,docs:{...(T=r.parameters)==null?void 0:T.docs,source:{originalSource:"args => <TopBar {...args} />",...(f=(y=r.parameters)==null?void 0:y.docs)==null?void 0:f.source}}};var x,S,C;o.parameters={...o.parameters,docs:{...(x=o.parameters)==null?void 0:x.docs,source:{originalSource:"args => <TopBar {...args} />",...(C=(S=o.parameters)==null?void 0:S.docs)==null?void 0:C.source}}};var L,B,R;a.parameters={...a.parameters,docs:{...(L=a.parameters)==null?void 0:L.docs,source:{originalSource:`() => {
|
|
2
2
|
return <HashRouter>
|
|
3
3
|
<Page left={0}>
|
|
4
4
|
<TopBar content={[{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-eps93zm2.js";import{I as n}from"./common-types-Sih75Sav.js";import{T as l}from"./top-bar-
|
|
1
|
+
import{j as e}from"./jsx-runtime-eps93zm2.js";import{I as n}from"./common-types-Sih75Sav.js";import{T as l}from"./top-bar-Bjf6PQE1.js";import{B as s}from"./button-Cbv7WK6k.js";import{B as m}from"./badge-CLQ59MDF.js";import{L as p}from"./logo-BVP9045W.js";import"./index-DhsZuJvc.js";import"./index-Bk2sglWO.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./disabled-context-rmpd7YJS.js";import"./actions-Bax0KeqM.js";import"./lodash-c4VUpsOs.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./types-BmbYqTX_.js";import"./types-Dx2TtIG9.js";import"./spinner-AWUe4xwQ.js";const h={title:"Navigation/TopBar/Test Cases",parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}}},o=()=>e.jsx(l,{title:{logo:e.jsx("img",{src:p,alt:"logo"}),version:"V1.2.3",onClick:()=>{}},content:[{type:"Link",label:"Link",onClick:()=>{}},{type:"Link",label:"Lorem ipsum dolor est compendum lorem ipsum dolor est compendum lorem ipsum dolor est (cloned 2022-06-17 01:33:42)",active:!0,onClick:()=>{}},{type:"Link",label:"Disabled",disabled:!0,onClick:()=>{}},{type:"Button",label:"Save",colored:!0,onClick:()=>{},testId:"top-bar-button-save"}],contentRight:[{type:"Component",component:e.jsx(m,{title:"3",small:!0,margin:"5px",children:e.jsx(s,{icon:n.NOTIFICATION,round:!0,onClick:()=>{}})})}]});o.__docgenInfo={description:"",methods:[],displayName:"OverflowingLinks"};var t,r,i;o.parameters={...o.parameters,docs:{...(t=o.parameters)==null?void 0:t.docs,source:{originalSource:`() => <TopBar title={{
|
|
2
2
|
logo: <img src={LogoSVG} alt="logo" />,
|
|
3
3
|
version: 'V1.2.3',
|
|
4
4
|
onClick: () => {}
|